Mario Kart 64
Loading...
Searching...
No Matches
libultra_internal.h
Go to the documentation of this file.
1#ifndef _LIBULTRA_INTERNAL_H_
2#define _LIBULTRA_INTERNAL_H_
3#include <ultra64.h>
4#include <PR/os_thread.h>
5#include "macros.h"
6
7typedef struct __OSEventState {
8 OSMesgQueue* messageQueue;
9 OSMesg message;
11
16
17/*
18 * This define is needed because the original definitions in __osDequeueThread.c are declared
19 * seperately instead of part of a single struct, however some code alises over this memory
20 * assuming a unified structure. To fix this, we declare the full type here and then alias the
21 * symbol names to the correct members in AVOID_UB.
22 */
23typedef struct {
24 /*0x00*/ struct OSThread_s* next;
25 /*0x04*/ OSPri priority;
26 /*0x08*/ struct OSThread_s* queue;
27 /*0x0C*/ struct OSThread_s* tlnext;
28 /*0x10*/ struct OSThread_s* unk10;
29 /*0x14*/ u32 unk14;
31
32// Original OSThread_ListHead definitions
37
38// Original EEPROM definitions
39extern u32 D_80365E00[15];
40extern u32 D_80365E3C;
41
42typedef struct {
43 u32 initialized; // probably something like initialized?
45 OSMesgQueue* cmdQueue;
46 OSMesgQueue* eventQueue;
47 OSMesgQueue* accessQueue;
48 s32 (*dma_func)(s32, u32, void*, size_t);
49 s32 (*edma_func)(OSPiHandle*, s32, u32, void*, size_t);
50} OSMgrArgs;
51
60void __osSiGetAccess(void);
61void __osSiRelAccess(void);
64void __osPiGetAccess(void);
68s32 __osSiRawReadIo(void*, u32*);
70s32 osPiRawReadIo(u32 a0, u32* a1);
73s32 __osSpSetPc(void*);
76s32 __osSpRawStartDma(u32 dir, void* sp_ptr, void* dram_ptr, size_t size);
77void __osSetHWIntrRoutine(OSHWIntr interrupt, s32 (*handler)(void));
79void __osViInit(void);
82void __osViSwapContext(void);
90#endif
s32 __osSiRawWriteIo(void *, u32)
Definition __osSiRawWriteIo.c:4
s32 __osSpSetPc(void *)
Definition __osSpSetPc.c:4
s32 __osSpDeviceBusy(void)
Definition __osSpDeviceBusy.c:4
void __osSetSR(u32)
OSThread * __osActiveQueue
Definition __osDequeueThread.c:5
s32 __osAtomicDec(u32 *)
Definition __osAtomicDec.c:3
void __osViSwapContext(void)
Definition __osViSwapContext.c:7
u32 __osSpGetStatus(void)
Definition __osSpGetStatus.c:4
void __osSetTimerIntr(u64)
Definition osTimer.c:59
u32 __osGetCause(void)
OSThread * __osRunningThread
Definition __osDequeueThread.c:6
void __osSpSetStatus(u32)
Definition __osSpSetStatus.c:4
u32 __osProbeTLB(void *)
s32 __osSiRawReadIo(void *, u32 *)
Definition __osSiRawReadIo.c:4
void __osDispatchThread(void)
void __osSetCompare(u32)
s32 __osSiRawStartDma(s32, void *)
Definition __osSiRawStartDma.c:4
u32 D_80365E00[15]
void __osSetHWIntrRoutine(OSHWIntr interrupt, s32(*handler)(void))
Definition __osSetHWIntrRoutine.c:8
void __osDequeueThread(OSThread **, OSThread *)
OSThread * __osFaultedThread
Definition __osDequeueThread.c:7
void __osViInit(void)
Definition __osViInit.c:16
s32 __osDisableInt(void)
OSThread * __osRunQueue
Definition __osDequeueThread.c:4
u64 __osInsertTimer(OSTimer *)
Definition osTimer.c:68
struct __osThreadTail __osThreadTail
void __osSiRelAccess(void)
Definition __osSiCreateAccessQueue.c:23
s32 __osAiDeviceBusy(void)
Definition __osAiDeviceBusy.c:4
OSThread * __osPopThread(OSThread **)
s32 __osSiDeviceBusy(void)
Definition __osSiDeviceBusy.c:4
u32 __osGetSR(void)
s32 osPiRawReadIo(u32 a0, u32 *a1)
Definition osPiRawReadIo.c:6
OSViContext * __osViGetCurrentContext2(void)
void __osSiCreateAccessQueue(void)
Definition __osSiCreateAccessQueue.c:9
void __osEnqueueThread(OSThread **, OSThread *)
void __osSetFpcCsr(u32)
struct __OSEventState __OSEventState
void __osSiGetAccess(void)
Definition __osSiCreateAccessQueue.c:15
void __osRestoreInt(s32)
s32 __osSpRawStartDma(u32 dir, void *sp_ptr, void *dram_ptr, size_t size)
Definition __osSpRawStartDma.c:4
u32 D_80365E3C
OSViContext * __osViGetCurrentContext(void)
Definition __osViGetCurrentContext.c:5
s32 __osLeoInterrupt()
Definition __osLeoInterrupt.c:12
void __osPiCreateAccessQueue(void)
Definition __osPiCreateAccessQueue.c:9
void __osPiGetAccess(void)
Definition __osPiCreateAccessQueue.c:15
void __osEnqueueAndYield(OSThread **)
unsigned long long int u64
Definition llconv.c:2
s32 OSPri
Definition os_thread.h:21
Definition libultra_internal.h:42
OSMesgQueue * eventQueue
Definition libultra_internal.h:46
OSMesgQueue * accessQueue
Definition libultra_internal.h:47
u32 initialized
Definition libultra_internal.h:43
OSMesgQueue * cmdQueue
Definition libultra_internal.h:45
OSThread * mgrThread
Definition libultra_internal.h:44
Definition os_pi.h:28
Definition libultra_internal.h:23
OSPri priority
Definition libultra_internal.h:25
struct OSThread_s * next
Definition libultra_internal.h:24
struct OSThread_s * queue
Definition libultra_internal.h:26
u32 unk14
Definition libultra_internal.h:29
struct OSThread_s * unk10
Definition libultra_internal.h:28
struct OSThread_s * tlnext
Definition libultra_internal.h:27
Definition os_thread.h:50
Definition os_time.h:9
Definition os_vi.h:54
Definition libultra_internal.h:7
OSMesg message
Definition libultra_internal.h:9
OSMesgQueue * messageQueue
Definition libultra_internal.h:8
Definition libultra_internal.h:12
OSThread * next
Definition libultra_internal.h:13
OSPri priority
Definition libultra_internal.h:14
signed int s32
Definition ultratypes.h:15
unsigned int u32
Definition ultratypes.h:16