FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/gpf/osl/os_drv.c @ 365:46bdf41cb019
OSL: os_drv.c finished
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Thu, 29 May 2014 01:18:38 +0000 |
parents | 4a78dc764229 |
children |
comparison
equal
deleted
inserted
replaced
364:4a78dc764229 | 365:46bdf41cb019 |
---|---|
17 static u_char *HISR_Stack; | 17 static u_char *HISR_Stack; |
18 static T_DRV_SIGNAL *SignalID; | 18 static T_DRV_SIGNAL *SignalID; |
19 static void (*DrvCallback)(T_DRV_SIGNAL *); | 19 static void (*DrvCallback)(T_DRV_SIGNAL *); |
20 static NU_HISR CallBack_HISR; | 20 static NU_HISR CallBack_HISR; |
21 | 21 |
22 #define CB_HISR_STACK_SIZE 1024 | |
23 | |
22 GLOBAL LONG | 24 GLOBAL LONG |
23 os_ExecuteCallback(OS_HANDLE Caller, void (*Callback)(T_DRV_SIGNAL *), | 25 os_ExecuteCallback(OS_HANDLE Caller, void (*Callback)(T_DRV_SIGNAL *), |
24 T_DRV_SIGNAL *Signal) | 26 T_DRV_SIGNAL *Signal) |
25 { | 27 { |
26 DrvCallback = Callback; | 28 DrvCallback = Callback; |
27 SignalID = Signal; | 29 SignalID = Signal; |
28 NU_Activate_HISR(&CallBack_HISR); | 30 NU_Activate_HISR(&CallBack_HISR); |
29 return(OS_OK); | 31 return(OS_OK); |
30 } | 32 } |
33 | |
34 static void | |
35 CallbackFunc(void) | |
36 { | |
37 DrvCallback(SignalID); | |
38 } | |
39 | |
40 GLOBAL LONG | |
41 os_CreateCallback(void) | |
42 { | |
43 if (os_AllocateMemory(OS_NOTASK, (T_VOID_STRUCT **) &HISR_Stack, | |
44 CB_HISR_STACK_SIZE, 0xFFFFFFFF, | |
45 os_ext_pool_handle) == OS_ERROR) | |
46 return(OS_ERROR); | |
47 if (NU_Create_HISR(&CallBack_HISR, "CB_HISR", CallbackFunc, 2, | |
48 HISR_Stack, CB_HISR_STACK_SIZE) == NU_SUCCESS) | |
49 return(OS_OK); | |
50 else | |
51 return(OS_ERROR); | |
52 } |