FreeCalypso > hg > freecalypso-sw
annotate gsm-fw/gpf/osl/os_isr.c @ 347:c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Wed, 07 May 2014 20:18:11 +0000 |
parents | fdeea3d6582d |
children | e63ab4a97e24 |
rev | line source |
---|---|
346
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1 /* |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2 * This C module is a reconstruction based on the disassembly of |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3 * os_isr.obj in frame_na7_db_fl.lib from the Leonardo package. |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
4 */ |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
5 |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
6 /* set of included headers from COFF symtab: */ |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
7 #include <string.h> |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
8 #include "gpfconf.h" /* FreeCalypso addition */ |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
9 #include "../../nucleus/nucleus.h" |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
10 #include "typedefs.h" |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
11 #include "os.h" |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
12 #include "gdi.h" |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
13 #include "os_types.h" |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
14 #include "os_glob.h" |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
15 |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
16 extern T_OS_OSISR_TABLE_ENTRY OSISRTable[]; |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
17 |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
18 GLOBAL LONG |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
19 os_isr_init(void) |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
20 { |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
21 USHORT i; |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
22 |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
23 for (i = 1; i <= MaxOSISRs; i++) |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
24 OSISRTable[i].name[0] = 0; |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
25 return(OS_OK); |
fdeea3d6582d
OSL: reconstruction of os_isr.c (_fl only) started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
26 } |
347
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
27 |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
28 GLOBAL LONG |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
29 os_SetInterruptState(OS_INT_STATE new_state, OS_INT_STATE *old_state) |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
30 { |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
31 INT state; |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
32 |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
33 if (new_state) |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
34 state = NU_ENABLE_INTERRUPTS; |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
35 else |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
36 state = NU_DISABLE_INTERRUPTS; |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
37 state = NU_Control_Interrupts(state); |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
38 if (state & 0xFF) |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
39 *old_state = 0; |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
40 else |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
41 *old_state = 1; |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
42 return(OS_OK); |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
43 } |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
44 |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
45 GLOBAL LONG |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
46 os_EnableInterrupts(OS_INT_STATE *old_state) |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
47 { |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
48 INT state; |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
49 |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
50 state = NU_Control_Interrupts(NU_ENABLE_INTERRUPTS); |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
51 if (state & 0xFF) |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
52 *old_state = 0; |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
53 else |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
54 *old_state = 1; |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
55 return(OS_OK); |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
56 } |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
57 |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
58 GLOBAL LONG |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
59 os_DisableInterrupts(OS_INT_STATE *old_state) |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
60 { |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
61 INT state; |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
62 |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
63 state = NU_Control_Interrupts(NU_DISABLE_INTERRUPTS); |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
64 if (state & 0xFF) |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
65 *old_state = 0; |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
66 else |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
67 *old_state = 1; |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
68 return(OS_OK); |
c9dfa0e20640
OSL reconstruction: os_isr.c: interrupt control functions done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
346
diff
changeset
|
69 } |