osSetEventMesg.c (624B)
1 #include "libultra_internal.h" 2 #include "osint.h" 3 4 __OSEventState __osEventStateTab[OS_NUM_EVENTS]; 5 6 #ifdef VERSION_CN 7 u32 __osPreNMI = 0; 8 #endif 9 10 void osSetEventMesg(OSEvent e, OSMesgQueue *mq, OSMesg msg) { 11 register u32 int_disabled; 12 __OSEventState *msgs; 13 int_disabled = __osDisableInt(); 14 15 msgs = __osEventStateTab + e; 16 msgs->messageQueue = mq; 17 msgs->message = msg; 18 19 #ifdef VERSION_CN 20 if (e == OS_EVENT_PRENMI) { 21 if (__osShutdown && !__osPreNMI) { 22 osSendMesg(mq, msg, OS_MESG_NOBLOCK); 23 } 24 25 __osPreNMI = TRUE; 26 } 27 #endif 28 29 __osRestoreInt(int_disabled); 30 }