FreeCalypso > hg > fc-tourmaline
comparison src/gpf/osl/os_evt.c @ 0:4e78acac3d88
src/{condat,cs,gpf,nucleus}: import from Selenite
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 16 Oct 2020 06:23:26 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4e78acac3d88 |
---|---|
1 /* | |
2 * This C module is a reconstruction based on the disassembly of | |
3 * os_evt.obj in frame_na7_db_fl.lib from the Leonardo package. | |
4 */ | |
5 | |
6 /* set of included headers from COFF symtab: */ | |
7 #include <stdio.h> | |
8 #include <string.h> | |
9 #include "gpfconf.h" /* FreeCalypso addition */ | |
10 #include "../../nucleus/nucleus.h" | |
11 #include "typedefs.h" | |
12 #include "os.h" | |
13 #include "gdi.h" | |
14 #include "os_types.h" | |
15 #include "os_glob.h" | |
16 | |
17 extern T_OS_EVTGRP_TABLE_ENTRY EvtGrpTable[]; | |
18 | |
19 GLOBAL LONG | |
20 os_SetEvents(OS_HANDLE evt_grp_handle, unsigned event_flags) | |
21 { | |
22 if (!EvtGrpTable[evt_grp_handle].Name[0]) | |
23 return(OS_ERROR); | |
24 if (NU_Set_Events(&EvtGrpTable[evt_grp_handle].EvtGrp, event_flags, | |
25 NU_OR) == NU_SUCCESS) | |
26 return(OS_OK); | |
27 else | |
28 return(OS_ERROR); | |
29 } | |
30 | |
31 GLOBAL LONG | |
32 os_RetrieveEvents(OS_HANDLE evt_grp_handle, unsigned event_flags, char option, | |
33 unsigned *retrieved_events, unsigned suspend) | |
34 { | |
35 if (!EvtGrpTable[evt_grp_handle].Name[0]) | |
36 return(OS_ERROR); | |
37 if (NU_Retrieve_Events(&EvtGrpTable[evt_grp_handle].EvtGrp, | |
38 event_flags, option, retrieved_events, suspend) | |
39 == NU_SUCCESS) | |
40 return(OS_OK); | |
41 else | |
42 return(OS_ERROR); | |
43 } | |
44 | |
45 GLOBAL LONG | |
46 os_GetEventGroupHandle(char *evt_grp_name, OS_HANDLE *evt_grp_handle) | |
47 { | |
48 int idx; | |
49 | |
50 for (idx = 0; idx <= MaxEventGroups; idx++) { | |
51 if (!EvtGrpTable[idx].Name[0]) | |
52 break; | |
53 if (!strncmp(EvtGrpTable[idx].Name, evt_grp_name, | |
54 RESOURCE_NAMELEN)) | |
55 break; | |
56 } | |
57 if (idx > MaxEventGroups || !EvtGrpTable[idx].Name[0]) { | |
58 *evt_grp_handle = -1; | |
59 return(OS_ERROR); | |
60 } | |
61 *evt_grp_handle = idx; | |
62 return(OS_OK); | |
63 } | |
64 | |
65 GLOBAL LONG | |
66 os_EventGroupInformation(OS_HANDLE evt_grp_handle, char *Name, | |
67 unsigned *mask_evt, unsigned *tasks_waiting, | |
68 OS_HANDLE *first_task) | |
69 { | |
70 if (!EvtGrpTable[evt_grp_handle].Name[0]) | |
71 return(OS_ERROR); | |
72 if (NU_Event_Group_Information(&EvtGrpTable[evt_grp_handle].EvtGrp, | |
73 Name, mask_evt, tasks_waiting, | |
74 first_task) == NU_SUCCESS) | |
75 return(OS_OK); | |
76 else | |
77 return(OS_ERROR); | |
78 } |