annotate gsm-fw/gpf/osl/os_com_fl.c @ 350:5bc6a8f8b4a8

OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Thu, 08 May 2014 07:55:06 +0000
parents a163da322bc5
children fd015570cacc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
349
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1 /*
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
2 * This C module is a reconstruction based on the disassembly of
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
3 * os_com.obj in frame_na7_db_fl.lib from the Leonardo package.
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
4 */
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6 /* set of included headers from COFF symtab: */
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
7 #include <stdio.h>
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8 #include <string.h>
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9 #include "gpfconf.h" /* FreeCalypso addition */
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10 #include "../../nucleus/nucleus.h"
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11 #include "typedefs.h"
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12 #include "os.h"
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
13 #include "gdi.h"
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
14 #include "os_types.h"
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
15 #include "os_glob.h"
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
16
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
17 typedef unsigned char u_char;
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
18
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
19 extern T_OS_COM_TABLE_ENTRY ComTable[];
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
20
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
21 static NU_SEMAPHORE ComSemCB;
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
22
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
23 static int
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
24 os_GetQueueEntry(USHORT Index, OS_HANDLE *Handle)
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
25 {
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
26 static USHORT Idx;
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
27
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
28 if (Index == FIRST_ENTRY)
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
29 Idx = 0;
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
30 if (Index == FIRST_ENTRY || Index == NEXT_ENTRY) {
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
31 while (++Idx <= MaxCommunications && !ComTable[Idx].Name[0])
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
32 ;
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
33 } else
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
34 Idx = Index;
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
35 if (Idx <= MaxCommunications && ComTable[Idx].Name[0]) {
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
36 *Handle = Idx;
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
37 return(0);
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
38 } else
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
39 return(-1);
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
40 }
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
41
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
42 GLOBAL LONG
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
43 os_QueueInformation(USHORT Index, char *Buffer)
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
44 {
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
45 OS_HANDLE Handle;
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
46 T_OS_COM_TABLE_ENTRY *ent;
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
47 UNSIGNED Used;
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
48 OPTION SuspendType;
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
49 UNSIGNED TasksWaiting;
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
50 NU_TASK *First;
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
51 CHAR Name[NU_MAX_NAME];
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
52
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
53 if (os_GetQueueEntry(Index, &Handle) < 0)
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
54 return(OS_ERROR);
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
55 ent = ComTable + Handle;
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
56 if (NU_Semaphore_Information(&ent->UsedSemCB, Name, &Used, &SuspendType,
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
57 &TasksWaiting, &First) != NU_SUCCESS)
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
58 return(OS_ERROR);
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
59 sprintf(Buffer, "Name:%s Startadr:%lx Entries:%d Used:%ld MaxUsed:%d",
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
60 ent->Name, (ULONG)ent->pQueueMemory, ent->Entries, (LONG)Used,
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
61 ent->MaxUsed);
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
62 return(OS_OK);
a163da322bc5 OSL: os_com_fl.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
63 }
350
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
64
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
65 GLOBAL LONG
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
66 os_OpenQueue(OS_HANDLE TaskHandle, char *Name, OS_HANDLE *ComHandle)
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
67 {
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
68 USHORT i;
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
69
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
70 if (!Name)
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
71 return(OS_ERROR);
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
72 for (i = 1; i <= MaxCommunications; i++)
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
73 if (ComTable[i].Name[0] &&
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
74 !strncmp(ComTable[i].Name, Name, RESOURCE_NAMELEN - 1)) {
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
75 *ComHandle = i;
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
76 return(OS_OK);
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
77 }
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
78 return(OS_ERROR);
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
79 }
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
80
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
81 GLOBAL LONG
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
82 os_GetQueueState(OS_HANDLE Caller, OS_HANDLE Handle, ULONG *Used, ULONG *Free)
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
83 {
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
84 if (ComTable[Handle].Name[0]) {
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
85 *Used = ComTable[Handle].UsedSemCB.sm_semaphore_count;
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
86 *Free = ComTable[Handle].FreeSemCB.sm_semaphore_count;
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
87 return(OS_OK);
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
88 } else
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
89 return(OS_ERROR);
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
90 }
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
91
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
92 GLOBAL LONG
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
93 os_GetQueueName(OS_HANDLE Caller, OS_HANDLE ComHandle, char *Name)
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
94 {
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
95 if (ComHandle > MaxCommunications)
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
96 return(OS_ERROR);
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
97 if (!ComTable[ComHandle].Name[0])
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
98 return(OS_ERROR);
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
99 strcpy(Name, ComTable[ComHandle].Name);
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
100 return(OS_OK);
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
101 }
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
102
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
103 GLOBAL LONG
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
104 os_GetQueueHandle(OS_HANDLE Caller, char *Name, OS_HANDLE *ComHandle)
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
105 {
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
106 USHORT i;
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
107
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
108 for (i = 1; i <= MaxCommunications; i++)
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
109 if (ComTable[i].Name[0] &&
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
110 !strncmp(Name, ComTable[i].Name, RESOURCE_NAMELEN - 1)) {
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
111 *ComHandle = i;
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
112 return(OS_OK);
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
113 }
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
114 return(OS_ERROR);
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
115 }
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
116
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
117 GLOBAL LONG
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
118 os_GetQueueData(OS_HANDLE Caller, OS_HANDLE Handle, USHORT Index, USHORT *Type,
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
119 ULONG *opc, ULONG *ptr, ULONG *time)
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
120 {
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
121 static USHORT entry;
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
122 static T_QDATA_ELEMENT *p;
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
123
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
124 if (!ComTable[Handle].Name[0])
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
125 return(OS_ERROR);
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
126 if (Index == FIRST_ENTRY) {
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
127 *Type = ComTable[Handle].current_msg.type;
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
128 *opc = ComTable[Handle].current_msg.opc;
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
129 *time = ComTable[Handle].current_msg.time;
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
130 *ptr = (ULONG) ComTable[Handle].current_msg.ptr;
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
131 p = ComTable[Handle].pQueueMemory;
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
132 entry = 0;
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
133 return(OS_OK);
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
134 }
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
135 if (entry >= ComTable[Handle].Entries)
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
136 return(OS_ERROR);
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
137 entry++;
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
138 *Type = p->Data.data16;
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
139 *ptr = (ULONG) p->Data.ptr;
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
140 *opc = p->Data.data32;
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
141 *time = p->Data.time;
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
142 p++;
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
143 return(OS_OK);
5bc6a8f8b4a8 OSL: os_com_fl.c: reconstructed up to os_GetQueueData()
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 349
diff changeset
144 }