FreeCalypso > hg > freecalypso-sw
annotate gsm-fw/gpf/osl/os_drv.c @ 553:e4feac5bc3ea
gsm-fw/L1/cfile/l1_drive.c: preliminary preen
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Mon, 04 Aug 2014 00:07:21 +0000 |
parents | 46bdf41cb019 |
children |
rev | line source |
---|---|
364
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1 /* |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2 * This C module is a reconstruction based on the disassembly of |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3 * os_drv.obj in frame_na7_db_fl.lib from the Leonardo package. |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
4 */ |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
5 |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
6 /* set of included headers from COFF symtab: */ |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
7 #include "gpfconf.h" /* FreeCalypso addition */ |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
8 #include "../../nucleus/nucleus.h" |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
9 #include "typedefs.h" |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
10 #include "gdi.h" |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
11 #include "os.h" |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
12 |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
13 typedef unsigned char u_char; |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
14 |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
15 extern OS_HANDLE os_ext_pool_handle; |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
16 |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
17 static u_char *HISR_Stack; |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
18 static T_DRV_SIGNAL *SignalID; |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
19 static void (*DrvCallback)(T_DRV_SIGNAL *); |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
20 static NU_HISR CallBack_HISR; |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
21 |
365
46bdf41cb019
OSL: os_drv.c finished
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
364
diff
changeset
|
22 #define CB_HISR_STACK_SIZE 1024 |
46bdf41cb019
OSL: os_drv.c finished
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
364
diff
changeset
|
23 |
364
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
24 GLOBAL LONG |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
25 os_ExecuteCallback(OS_HANDLE Caller, void (*Callback)(T_DRV_SIGNAL *), |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
26 T_DRV_SIGNAL *Signal) |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
27 { |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
28 DrvCallback = Callback; |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
29 SignalID = Signal; |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
30 NU_Activate_HISR(&CallBack_HISR); |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
31 return(OS_OK); |
4a78dc764229
OSL: os_drv.c started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
32 } |
365
46bdf41cb019
OSL: os_drv.c finished
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
364
diff
changeset
|
33 |
46bdf41cb019
OSL: os_drv.c finished
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
364
diff
changeset
|
34 static void |
46bdf41cb019
OSL: os_drv.c finished
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
364
diff
changeset
|
35 CallbackFunc(void) |
46bdf41cb019
OSL: os_drv.c finished
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
364
diff
changeset
|
36 { |
46bdf41cb019
OSL: os_drv.c finished
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
364
diff
changeset
|
37 DrvCallback(SignalID); |
46bdf41cb019
OSL: os_drv.c finished
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
364
diff
changeset
|
38 } |
46bdf41cb019
OSL: os_drv.c finished
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
364
diff
changeset
|
39 |
46bdf41cb019
OSL: os_drv.c finished
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
364
diff
changeset
|
40 GLOBAL LONG |
46bdf41cb019
OSL: os_drv.c finished
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
364
diff
changeset
|
41 os_CreateCallback(void) |
46bdf41cb019
OSL: os_drv.c finished
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
364
diff
changeset
|
42 { |
46bdf41cb019
OSL: os_drv.c finished
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
364
diff
changeset
|
43 if (os_AllocateMemory(OS_NOTASK, (T_VOID_STRUCT **) &HISR_Stack, |
46bdf41cb019
OSL: os_drv.c finished
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
364
diff
changeset
|
44 CB_HISR_STACK_SIZE, 0xFFFFFFFF, |
46bdf41cb019
OSL: os_drv.c finished
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
364
diff
changeset
|
45 os_ext_pool_handle) == OS_ERROR) |
46bdf41cb019
OSL: os_drv.c finished
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
364
diff
changeset
|
46 return(OS_ERROR); |
46bdf41cb019
OSL: os_drv.c finished
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
364
diff
changeset
|
47 if (NU_Create_HISR(&CallBack_HISR, "CB_HISR", CallbackFunc, 2, |
46bdf41cb019
OSL: os_drv.c finished
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
364
diff
changeset
|
48 HISR_Stack, CB_HISR_STACK_SIZE) == NU_SUCCESS) |
46bdf41cb019
OSL: os_drv.c finished
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
364
diff
changeset
|
49 return(OS_OK); |
46bdf41cb019
OSL: os_drv.c finished
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
364
diff
changeset
|
50 else |
46bdf41cb019
OSL: os_drv.c finished
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
364
diff
changeset
|
51 return(OS_ERROR); |
46bdf41cb019
OSL: os_drv.c finished
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
364
diff
changeset
|
52 } |