mirror of
https://github.com/zeldaret/mm.git
synced 2026-08-19 21:32:54 -04:00
Port OoT's docs for fault.c and fault_drawer.c (#1199)
* fault.h * some docs stealing * fix building * fault_internal.h * pass * finish stealing docs * finish cleanup * format * warning * Update src/boot_O2_g3/fault.c Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * Update src/boot_O2_g3/fault.c Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * Update src/boot_O2_g3/fault.c Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * review Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * arggggg * arggggg part 2 * STACK * PHYS_TO_K0(0x400000) * format * fix * Instance * format * Neutral reset * variables.h cleanup * bss * frameBuffer * format * Update src/boot_O2_g3/fault.c Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * review Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * Update src/boot_O2_g3/fault.c Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * bss * bss * bss * callback cleanup * fix function declarations * fix again * bss * bss * Update src/overlays/actors/ovl_En_Fishing/z_en_fishing.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update src/boot_O2_g3/fault.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * bss * bss * Update src/boot_O2_g3/fault.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * review * import bss * format * minor cleanup * bss * review * fix * bss * bss * bss * bss * bss * format * a * Z_PRIORITY_FAULT * bss * fix * idle.c bss doesn't want to get fixed :c * review * bss --------- Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
This commit is contained in:
@@ -1,28 +1,28 @@
|
||||
#include "global.h"
|
||||
|
||||
void osCreateThread(OSThread* t, OSId id, void* entry, void* arg, void* sp, OSPri p) {
|
||||
void osCreateThread(OSThread* thread, OSId id, void* entry, void* arg, void* sp, OSPri p) {
|
||||
register u32 saveMask;
|
||||
OSIntMask mask;
|
||||
|
||||
t->id = id;
|
||||
t->priority = p;
|
||||
t->next = NULL;
|
||||
t->queue = NULL;
|
||||
t->context.pc = (u32)entry;
|
||||
t->context.a0 = arg;
|
||||
t->context.sp = (u64)(s32)sp - 16;
|
||||
t->context.ra = __osCleanupThread;
|
||||
thread->id = id;
|
||||
thread->priority = p;
|
||||
thread->next = NULL;
|
||||
thread->queue = NULL;
|
||||
thread->context.pc = (u32)entry;
|
||||
thread->context.a0 = arg;
|
||||
thread->context.sp = (u64)(s32)sp - 16;
|
||||
thread->context.ra = __osCleanupThread;
|
||||
|
||||
mask = 0x3FFF01;
|
||||
t->context.sr = 0xFF03;
|
||||
t->context.rcp = (mask & 0x3F0000) >> 16;
|
||||
t->context.fpcsr = 0x01000800;
|
||||
t->fp = 0;
|
||||
t->state = 1;
|
||||
t->flags = 0;
|
||||
thread->context.sr = 0xFF03;
|
||||
thread->context.rcp = (mask & 0x3F0000) >> 16;
|
||||
thread->context.fpcsr = 0x01000800;
|
||||
thread->fp = 0;
|
||||
thread->state = 1;
|
||||
thread->flags = 0;
|
||||
|
||||
saveMask = __osDisableInt();
|
||||
t->tlnext = __osActiveQueue;
|
||||
__osActiveQueue = t;
|
||||
thread->tlnext = __osActiveQueue;
|
||||
__osActiveQueue = thread;
|
||||
__osRestoreInt(saveMask);
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
#include "global.h"
|
||||
|
||||
void osSetThreadPri(OSThread* t, OSPri p) {
|
||||
void osSetThreadPri(OSThread* thread, OSPri p) {
|
||||
register u32 saveMask;
|
||||
|
||||
saveMask = __osDisableInt();
|
||||
|
||||
if (t == NULL) {
|
||||
t = __osRunningThread;
|
||||
if (thread == NULL) {
|
||||
thread = __osRunningThread;
|
||||
}
|
||||
|
||||
if (t->priority != p) {
|
||||
t->priority = p;
|
||||
if (thread->priority != p) {
|
||||
thread->priority = p;
|
||||
|
||||
if (t != __osRunningThread && t->state != 1) {
|
||||
__osDequeueThread(t->queue, t);
|
||||
__osEnqueueThread(t->queue, t);
|
||||
if (thread != __osRunningThread && thread->state != 1) {
|
||||
__osDequeueThread(thread->queue, thread);
|
||||
__osEnqueueThread(thread->queue, thread);
|
||||
}
|
||||
|
||||
if (__osRunningThread->priority < __osRunQueue->priority) {
|
||||
|
||||
Reference in New Issue
Block a user