FreeCalypso > hg > freecalypso-sw
annotate gsm-fw/L1/cust0/ind_os.c @ 992:a7b0b426f9ca
target-utils: boot ROM UART autodetection revamped
The new implementation should work with both the familiar Calypso C035
boot ROM version found in our regular targets as well as the older
Calypso F741979B version found on the vintage D-Sample board.
author | Mychaela Falconia <falcon@ivan.Harhan.ORG> |
---|---|
date | Wed, 30 Dec 2015 21:28:41 +0000 |
parents | a6ff7b513bcf |
children |
rev | line source |
---|---|
517
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1 /************* Revision Controle System Header ************* |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2 * GSM Layer 1 software |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3 * IND_OS.C |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
4 * |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
5 * Filename ind_os.c |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
6 * Version 1.1 |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
7 * Date 04/26/00 |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
8 * |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
9 ************* Revision Controle System Header *************/ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
10 |
518
ffbb71ee664c
gsm-fw/L1/cust0/ind_os.c: adopted MV100 version, started FC adaptation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
517
diff
changeset
|
11 #include "../../include/config.h" |
517
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
12 |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
13 // Nucleus include files. |
518
ffbb71ee664c
gsm-fw/L1/cust0/ind_os.c: adopted MV100 version, started FC adaptation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
517
diff
changeset
|
14 #include "../../nucleus/nucleus.h" |
ffbb71ee664c
gsm-fw/L1/cust0/ind_os.c: adopted MV100 version, started FC adaptation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
517
diff
changeset
|
15 #include "../../nucleus/tc_defs.h" |
ffbb71ee664c
gsm-fw/L1/cust0/ind_os.c: adopted MV100 version, started FC adaptation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
517
diff
changeset
|
16 #include "../../include/sys_types.h" |
517
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
17 #include "ind_os.h" |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
18 |
527
a6ff7b513bcf
gsm-fw/L1/cust0: use -I flags in the Makefile to make C code files less ugly
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
520
diff
changeset
|
19 #include "l1_confg.h" |
517
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
20 // Layer1 and debug include files. |
527
a6ff7b513bcf
gsm-fw/L1/cust0: use -I flags in the Makefile to make C code files less ugly
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
520
diff
changeset
|
21 #include "l1_types.h" |
a6ff7b513bcf
gsm-fw/L1/cust0: use -I flags in the Makefile to make C code files less ugly
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
520
diff
changeset
|
22 #include "l1_const.h" |
517
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
23 |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
24 #if (L1_GTT == 1) |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
25 #include "l1gtt_const.h" |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
26 #include "l1gtt_defty.h" |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
27 #endif |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
28 |
518
ffbb71ee664c
gsm-fw/L1/cust0/ind_os.c: adopted MV100 version, started FC adaptation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
517
diff
changeset
|
29 /* the newer LoCosto cust1 version has these lines commented out */ |
ffbb71ee664c
gsm-fw/L1/cust0/ind_os.c: adopted MV100 version, started FC adaptation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
517
diff
changeset
|
30 //#if ((ANALOG == 1) || (ANALOG == 2)) |
ffbb71ee664c
gsm-fw/L1/cust0/ind_os.c: adopted MV100 version, started FC adaptation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
517
diff
changeset
|
31 // #include "spi_drv.h" |
ffbb71ee664c
gsm-fw/L1/cust0/ind_os.c: adopted MV100 version, started FC adaptation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
517
diff
changeset
|
32 //#endif |
517
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
33 |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
34 #if TESTMODE |
527
a6ff7b513bcf
gsm-fw/L1/cust0: use -I flags in the Makefile to make C code files less ugly
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
520
diff
changeset
|
35 #include "l1tm_defty.h" |
517
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
36 #endif |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
37 |
527
a6ff7b513bcf
gsm-fw/L1/cust0: use -I flags in the Makefile to make C code files less ugly
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
520
diff
changeset
|
38 #include "l1audio_const.h" |
a6ff7b513bcf
gsm-fw/L1/cust0: use -I flags in the Makefile to make C code files less ugly
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
520
diff
changeset
|
39 #include "l1audio_cust.h" |
a6ff7b513bcf
gsm-fw/L1/cust0: use -I flags in the Makefile to make C code files less ugly
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
520
diff
changeset
|
40 #include "l1audio_defty.h" |
a6ff7b513bcf
gsm-fw/L1/cust0: use -I flags in the Makefile to make C code files less ugly
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
520
diff
changeset
|
41 #include "l1_defty.h" |
a6ff7b513bcf
gsm-fw/L1/cust0: use -I flags in the Makefile to make C code files less ugly
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
520
diff
changeset
|
42 #include "l1_msgty.h" |
a6ff7b513bcf
gsm-fw/L1/cust0: use -I flags in the Makefile to make C code files less ugly
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
520
diff
changeset
|
43 #include "l1_varex.h" |
517
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
44 |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
45 #if (CHIPSET == 2 || CHIPSET == 3 || CHIPSET == 4 || CHIPSET == 5 || CHIPSET == 6 || CHIPSET == 7 || CHIPSET == 8 || CHIPSET == 10 || CHIPSET == 11 || CHIPSET == 12) |
520
ed6071292a5c
L1: first C module compiles: ind_os.c
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
518
diff
changeset
|
46 #include "../../bsp/ulpd.h" |
517
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
47 #endif |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
48 |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
49 extern UWORD32 TCD_Priority_Groups; |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
50 extern TC_HCB *TCD_Active_HISR_Heads[TC_HISR_PRIORITIES]; |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
51 extern VOID *TCD_Current_Thread; |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
52 extern TC_HCB *TCD_Active_HISR_Tails[TC_HISR_PRIORITIES]; |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
53 extern INT TMD_Timer_State; |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
54 extern UWORD32 TMD_Timer; // for big sleep |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
55 extern TC_PROTECT TCD_System_Protect; |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
56 |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
57 |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
58 /*-------------------------------------------------------*/ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
59 /* int ind_os_sleep() */ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
60 /*-------------------------------------------------------*/ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
61 /* Parameters : none */ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
62 /* Return : */ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
63 /* Functionality : Suspend the thread an interval */ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
64 /* of millisecs. */ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
65 /* Limitation : */ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
66 /*-------------------------------------------------------*/ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
67 |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
68 T_OS_RETURN ind_os_sleep (SYS_UWORD32 millisecs) |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
69 { |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
70 NU_Sleep ((SYS_UWORD32) millisecs); |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
71 return OS_OK; |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
72 } |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
73 |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
74 |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
75 /*-------------------------------------------------------*/ |
520
ed6071292a5c
L1: first C module compiles: ind_os.c
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
518
diff
changeset
|
76 /* int OS_get_inactivity_ticks() */ |
517
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
77 /*-------------------------------------------------------*/ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
78 /* Parameters : none */ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
79 /* Return : Number of ticks of inactivity */ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
80 /* 0 means immediate activity planned */ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
81 /* -1 means no activity planned */ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
82 /* Functionality : Evaluates the OS activity planned */ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
83 /* by looking at ready tasks, activated */ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
84 /* HISR and the elapsed time of the timers*/ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
85 /* Limitation : Must be protected from H/W interrupts */ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
86 /*-------------------------------------------------------*/ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
87 int OS_get_inactivity_ticks(void) |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
88 { |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
89 int i; |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
90 |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
91 // Returns immediate activity if a task is ready |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
92 if (TCD_Priority_Groups) |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
93 return 0; |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
94 |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
95 //for all HISR priorities |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
96 for (i = 0; i < TC_HISR_PRIORITIES ; i++) |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
97 { |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
98 // if no hisr of priority "i" ==> go to next priority |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
99 if (TCD_Active_HISR_Heads[i] == 0) |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
100 continue; |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
101 |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
102 // the first hisr is NOT the current one (frame hisr) so it may be |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
103 // with other priority ==> abort |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
104 if (TCD_Active_HISR_Heads[i] != TCD_Current_Thread) |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
105 return 0; |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
106 |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
107 // the last hisr is NOT the current one (frame hisr) so there is |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
108 // at least another hisr with same priority ==> abort |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
109 if (TCD_Active_HISR_Tails[i] != TCD_Current_Thread) |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
110 return 0; |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
111 |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
112 // the first and last hisrs are the current one (frame hisr) but |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
113 // there are several occurences of it ! ==> abort |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
114 if ( (TCD_Active_HISR_Heads[i]->tc_activation_count != 1)) |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
115 return 0; |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
116 } |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
117 |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
118 // Returns remaining ticks number if any timer is active |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
119 if (TMD_Timer_State == TM_ACTIVE) // any active timer ? |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
120 { |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
121 if (TMD_Timer <= MIN_SLEEP_TIME) |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
122 return(0); |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
123 else |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
124 return TMD_Timer; |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
125 } |
520
ed6071292a5c
L1: first C module compiles: ind_os.c
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
518
diff
changeset
|
126 |
517
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
127 // Returns not activity if no timer active |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
128 if (TMD_Timer_State == TM_NOT_ACTIVE) |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
129 return -1; |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
130 else |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
131 // otherwise, returns immediate activity if a timer is expired (TM_EXPIRED) |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
132 return(0); |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
133 } |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
134 |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
135 /*-------------------------------------------------------*/ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
136 /* int OS_system_protect() */ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
137 /*-------------------------------------------------------*/ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
138 /* Parameters : none */ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
139 /* Return : The Thread Control Block of the thread */ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
140 /* which already owns the protection or */ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
141 /* 0 if no protection */ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
142 /* Functionality : Checks whether the system structures */ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
143 /* are already protected or not */ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
144 /*-------------------------------------------------------*/ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
145 void OS_system_protect (void) |
520
ed6071292a5c
L1: first C module compiles: ind_os.c
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
518
diff
changeset
|
146 { |
ed6071292a5c
L1: first C module compiles: ind_os.c
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
518
diff
changeset
|
147 NU_Protect((NU_PROTECT*) &TCD_System_Protect); |
517
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
148 } |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
149 |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
150 /*-------------------------------------------------------*/ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
151 /* int OS_system_Unprotect() */ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
152 /*-------------------------------------------------------*/ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
153 /* Parameters : none */ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
154 /* Return : */ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
155 /* Functionality : unprotect the system structures */ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
156 /*-------------------------------------------------------*/ |
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
157 void OS_system_Unprotect (void) |
520
ed6071292a5c
L1: first C module compiles: ind_os.c
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
518
diff
changeset
|
158 { |
ed6071292a5c
L1: first C module compiles: ind_os.c
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
518
diff
changeset
|
159 NU_Unprotect(); |
517
eafadfee35b2
gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
160 } |