annotate gsm-fw/gpf/osl/os_evt.c @ 367:c72feb362ef1

os_evt.c: got some bogus-looking code, decompiled as-is
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Thu, 29 May 2014 05:12:59 +0000
parents 227bc7a1c305
children 43ca9d5e30cb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
366
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1 /*
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
2 * This C module is a reconstruction based on the disassembly of
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
3 * os_evt.obj in frame_na7_db_fl.lib from the Leonardo package.
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
4 */
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6 /* set of included headers from COFF symtab: */
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
7 #include <stdio.h>
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8 #include <string.h>
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9 #include "gpfconf.h" /* FreeCalypso addition */
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10 #include "../../nucleus/nucleus.h"
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11 #include "typedefs.h"
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12 #include "os.h"
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
13 #include "gdi.h"
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
14 #include "os_types.h"
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
15 #include "os_glob.h"
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
16
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
17 extern T_OS_EVTGRP_TABLE_ENTRY EvtGrpTable[];
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
18
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
19 GLOBAL LONG
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
20 os_SetEvents(OS_HANDLE evt_grp_handle, unsigned event_flags)
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
21 {
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
22 if (!EvtGrpTable[evt_grp_handle].Name[0])
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
23 return(OS_ERROR);
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
24 if (NU_Set_Events(&EvtGrpTable[evt_grp_handle].EvtGrp, event_flags,
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
25 NU_OR) == NU_SUCCESS)
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
26 return(OS_OK);
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
27 else
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
28 return(OS_ERROR);
227bc7a1c305 OSL: os_evt.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
29 }
367
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
30
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
31 GLOBAL LONG
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
32 os_RetrieveEvents(OS_HANDLE evt_grp_handle, unsigned event_flags, char option,
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
33 unsigned *retrieved_events, unsigned suspend)
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
34 {
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
35 if (!EvtGrpTable[evt_grp_handle].Name[0])
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
36 return(OS_ERROR);
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
37 if (NU_Retrieve_Events(&EvtGrpTable[evt_grp_handle].EvtGrp,
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
38 event_flags, option, retrieved_events, suspend)
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
39 == NU_SUCCESS)
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
40 return(OS_OK);
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
41 else
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
42 return(OS_ERROR);
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
43 }
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
44
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
45 GLOBAL LONG
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
46 os_GetEventGroupHandle(char *evt_grp_name, OS_HANDLE *evt_grp_handle)
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
47 {
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
48 int idx;
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
49
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
50 for (idx = 0; idx <= MaxEventGroups; idx++) {
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
51 if (!EvtGrpTable[idx].Name[0])
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
52 break;
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
53 if (!strncmp(EvtGrpTable[idx].Name, evt_grp_name,
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
54 RESOURCE_NAMELEN))
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
55 break;
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
56 }
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
57 if (idx > MaxEventGroups || !EvtGrpTable[idx].Name[0]) {
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
58 *evt_grp_handle = -1;
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
59 return(OS_ERROR);
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
60 }
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
61 *evt_grp_handle = idx;
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
62 return(OS_OK);
c72feb362ef1 os_evt.c: got some bogus-looking code, decompiled as-is
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 366
diff changeset
63 }