mirror of
https://github.com/encounter/tp.git
synced 2026-07-11 06:18:46 -07:00
clean up dolphin files / work on some rels (#212)
* d_a_alldie / d_a_tboxSw / d_a_tag_gstart / d_a_tag_hstop * dolphin OS work / cleanup * dolphin GX work / cleanup * finish changing dolphin files to C * more files into C * match rest of MSL_C math functions * more dolphin files converted to C * remove asm * d_bg_w work * remove asm * d_a_alink work / kytag14
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
#ifndef OSTHREAD_H
|
||||
#define OSTHREAD_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/os/OSMutex.h"
|
||||
#include "dolphin/os/OSContext.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -16,24 +14,6 @@ typedef u16 OSThreadState;
|
||||
#define OS_THREAD_STATE_WAITING 4
|
||||
#define OS_THREAD_STATE_DEAD 8
|
||||
|
||||
typedef struct OSMutexLink {
|
||||
struct OSMutex* prev;
|
||||
struct OSMutex* next;
|
||||
} OSMutexLink;
|
||||
|
||||
typedef struct OSMutexQueue {
|
||||
struct OSMutex* prev;
|
||||
struct OSMutex* next;
|
||||
} OSMutexQueue;
|
||||
|
||||
typedef struct OSMutex {
|
||||
/* 0x00 */ //OSThreadQueue queue;
|
||||
/* 0x08 */ //OSThread* thread;
|
||||
/* 0x0C */ //s32 count;
|
||||
/* 0x10 */ //OSMutexLink link;
|
||||
u8 unk[24];
|
||||
} OSMutex; // Size: 0x18
|
||||
|
||||
typedef struct OSThreadLink {
|
||||
struct OSThread* prev;
|
||||
struct OSThread* next;
|
||||
@@ -44,32 +24,45 @@ typedef struct OSThreadQueue {
|
||||
/* 0x4 */ struct OSThread* tail;
|
||||
} OSThreadQueue;
|
||||
|
||||
typedef struct OSMutexLink {
|
||||
struct OSMutex* prev;
|
||||
struct OSMutex* next;
|
||||
} OSMutexLink;
|
||||
|
||||
typedef struct OSMutexQueue {
|
||||
struct OSMutex* prev;
|
||||
struct OSMutex* next;
|
||||
} OSMutexQueue;
|
||||
|
||||
typedef struct OSCond {
|
||||
struct OSThreadQueue queue;
|
||||
OSThreadQueue queue;
|
||||
} OSCond;
|
||||
|
||||
typedef void (*OSSwitchThreadCallback)(struct OSThread* from, struct OSThread* to);
|
||||
|
||||
typedef struct OSThread {
|
||||
struct OSContext context;
|
||||
OSContext context;
|
||||
OSThreadState state;
|
||||
u16 attributes;
|
||||
s32 suspend_count;
|
||||
u32 effective_priority;
|
||||
s32 effective_priority;
|
||||
u32 base_priority;
|
||||
void* exit_value;
|
||||
struct OSThreadQueue* queue;
|
||||
struct OSThreadLink link;
|
||||
struct OSThreadQueue join_queue;
|
||||
OSThreadQueue* queue;
|
||||
OSThreadLink link;
|
||||
OSThreadQueue join_queue;
|
||||
struct OSMutex* mutex;
|
||||
OSMutexQueue owned_mutexes;
|
||||
struct OSThreadLink active_threads_link;
|
||||
OSThreadLink active_threads_link;
|
||||
u8* stack_base;
|
||||
u8* stack_end;
|
||||
u8* error_code;
|
||||
void* data[2];
|
||||
} OSThread;
|
||||
|
||||
typedef void (*OSSwitchThreadCallback)(OSThread* from, OSThread* to);
|
||||
|
||||
OSThreadQueue OS_THREAD_QUEUE : 0x800000DC;
|
||||
OSThread* OS_CURRENT_THREAD : 0x800000E4;
|
||||
|
||||
static void DefaultSwitchThreadCallback(OSThread* from, OSThread* to);
|
||||
OSSwitchThreadCallback OSSetSwitchThreadCallback(OSSwitchThreadCallback func);
|
||||
void __OSThreadInit(void);
|
||||
|
||||
Reference in New Issue
Block a user