mirror of
https://github.com/zeldaret/mm.git
synced 2024-11-27 23:00:26 +00:00
Decompile {g,s}etthreadpri.c
This commit is contained in:
parent
21b019c010
commit
991bd83ea5
@ -99,8 +99,8 @@ SECTIONS
|
||||
build/asm/si.o(.text)
|
||||
build/asm/boot_0x8008FA60.o(.text)
|
||||
build/src/libultra/os/jammesg.o(.text)
|
||||
build/asm/setthreadpri.o(.text)
|
||||
build/asm/getthreadpri.o(.text)
|
||||
build/src/libultra/os/setthreadpri.o(.text)
|
||||
build/src/libultra/os/getthreadpri.o(.text)
|
||||
build/asm/boot_0x8008FD00.o(.text)
|
||||
build/asm/boot_0x8008FE60.o(.text)
|
||||
build/asm/boot_0x8008FEB0.o(.text)
|
||||
|
8
src/libultra/os/getthreadpri.c
Normal file
8
src/libultra/os/getthreadpri.c
Normal file
@ -0,0 +1,8 @@
|
||||
#include <osint.h>
|
||||
|
||||
OSPri osGetThreadPri(OSThread* t) {
|
||||
if (t == NULL) {
|
||||
t = __osRunningThread;
|
||||
}
|
||||
return t->priority;
|
||||
}
|
27
src/libultra/os/setthreadpri.c
Normal file
27
src/libultra/os/setthreadpri.c
Normal file
@ -0,0 +1,27 @@
|
||||
#include <osint.h>
|
||||
|
||||
void osSetThreadPri(OSThread* t, OSPri p) {
|
||||
register u32 saveMask;
|
||||
|
||||
saveMask = __osDisableInt();
|
||||
|
||||
if (t == NULL) {
|
||||
t = __osRunningThread;
|
||||
}
|
||||
|
||||
if (t->priority != p) {
|
||||
t->priority = p;
|
||||
|
||||
if (t != __osRunningThread && t->state != 1) {
|
||||
__osDequeueThread(t->queue, t);
|
||||
__osEnqueueThread(t->queue, t);
|
||||
}
|
||||
|
||||
if (__osRunningThread->priority < __osRunQueue->priority) {
|
||||
__osRunningThread->state = 2;
|
||||
__osEnqueueAndYield(&__osRunQueue);
|
||||
}
|
||||
}
|
||||
|
||||
__osRestoreInt(saveMask);
|
||||
}
|
Loading…
Reference in New Issue
Block a user