blob: f59308c0de3e6ca2f05f1f1a28ead595cf7c7f70 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#include "macros.h"
#include "PR/os_internal.h"
#include "PR/ultraerror.h"
#include "osint.h"
__OSEventState __osEventStateTab[OS_NUM_EVENTS] ALIGNED(8);
#if BUILD_VERSION >= VERSION_J
u32 __osPreNMI = FALSE;
#endif
void osSetEventMesg(OSEvent event, OSMesgQueue* mq, OSMesg msg) {
register u32 saveMask;
__OSEventState* es;
#ifdef _DEBUG
if (event >= OS_NUM_EVENTS) {
__osError(ERR_OSSETEVENTMESG, 1, event);
return;
}
#endif
saveMask = __osDisableInt();
es = &__osEventStateTab[event];
es->messageQueue = mq;
es->message = msg;
#if BUILD_VERSION >= VERSION_J
if (event == OS_EVENT_PRENMI) {
if (__osShutdown && !__osPreNMI) {
osSendMesg(mq, msg, OS_MESG_NOBLOCK);
}
__osPreNMI = TRUE;
}
#endif
__osRestoreInt(saveMask);
}
|