annotate gsm-fw/g23m-glue/cst/cst_stack.c @ 923:10b4bed10192

gsm-fw/L1: fix for the DSP patch corruption bug The L1 code we got from the LoCosto fw contains a feature for DSP CPU load measurement. This feature is a LoCosto-ism, i.e., not applicable to earlier DBB chips (Calypso) with their respective earlier DSP ROMs. Most of the code dealing with that feature is conditionalized as #if (DSP >= 38), but one spot was missed, and the MCU code was writing into an API word dealing with this feature. In TCS211 this DSP API word happens to be used by the DSP code patch, hence that write was corrupting the patched DSP code.
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Mon, 19 Oct 2015 17:13:56 +0000
parents 8140945526c2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
1 /*******************************************************************************
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
2 *
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
3 * CST_STACK.C
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
4 *
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
5 * Tasks and HISRs stacks monitoring.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
6 *
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
7 * (C) Texas Instruments 2000
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
8 *
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
9 ******************************************************************************/
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
10
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
11 #include <stdio.h>
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
12 #include <string.h>
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
13
847
8140945526c2 cst_stack.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
14 #include "../../nucleus/nucleus.h"
8140945526c2 cst_stack.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
15 #include "../../nucleus/cs_defs.h"
8140945526c2 cst_stack.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
16 #include "../../nucleus/tc_defs.h"
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
17
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
18 // The following stack sizes are defined in int.s
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
19 #define IRQ_STACK_SIZE 128 // Number of bytes in IRQ stack
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
20 #define FIQ_STACK_SIZE 512 // Number of bytes in FIQ stack.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
21 #define SYSTEM_SIZE 1024 // Define the system stack size
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
22
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
23 int vsi_o_trace (char * caller, unsigned long tclass, char * text);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
24 int vsi_t_sleep (char * caller, unsigned long tvalue);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
25
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
26 void CST_stack_trace()
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
27 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
28 int jndex, count, char_count;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
29 TC_TCB *head, *ptr;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
30 extern CS_NODE *TCD_Created_Tasks_List;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
31 extern CS_NODE *TCD_Created_HISRs_List;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
32 unsigned untouched;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
33 char *top_stack, *top, *bottom;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
34 extern char *TCT_System_Limit;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
35 char result[80];
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
36 char name[9];
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
37
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
38 vsi_o_trace("CST", 0x08, "Stack Info ...");
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
39 vsi_o_trace("CST", 0x08, " Name top bottom current untouched");
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
40 vsi_o_trace("CST", 0x08, "-------------------------------------------------");
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
41
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
42 for (jndex=0; jndex<2; jndex++)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
43 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
44 // make use of TCB and HCB having same structure from beginning to past stack info
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
45 if (jndex == 0)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
46 ptr = head = (TC_TCB *)TCD_Created_Tasks_List;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
47 else {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
48 ptr = head = (TC_TCB *)TCD_Created_HISRs_List;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
49 vsi_o_trace("CST", 0x08, "-------------------------------------------------");
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
50 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
51
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
52 count = 0;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
53 do
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
54 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
55 untouched = 0;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
56 top_stack = (char *)ptr->tc_stack_start;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
57 while (*top_stack == 0xFE && top_stack <= (char *)ptr->tc_stack_end)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
58 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
59 untouched++;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
60 top_stack++;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
61 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
62
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
63 // Avoid to get a spurious character when tasks names are 8 characters long
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
64 memcpy (name, ptr->tc_name, 8);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
65 name[8] = 0;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
66
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
67 sprintf(result, "%8s: %08x %08x %08x 0x%x",
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
68 name,
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
69 ptr->tc_stack_start,
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
70 ptr->tc_stack_end,
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
71 ptr->tc_stack_pointer,
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
72 untouched);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
73 vsi_o_trace("CST", 0x08, result);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
74 vsi_t_sleep("",30);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
75
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
76 ptr = (TC_TCB*) ptr->tc_created.cs_next;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
77 } while (ptr != head && count++ < 50); //count is protection from infinite loops
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
78 } // end of for (jndex=0; jndex<2; jndex++)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
79
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
80 // stack allocation algorithm from the int.s function INT_Initialize()
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
81 //
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
82 // \ \
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
83 // \----------\
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
84 // \ \
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
85 // \ \
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
86 // \ \
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
87 // \ SYSSTACK \
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
88 // \ \
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
89 // \ \
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
90 // \ \
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
91 // \----------\
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
92 // \ \
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
93 // \ IRQSTACK \
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
94 // \ \
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
95 // \----------\
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
96 // \ \
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
97 // \ \
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
98 // \ FIQSTACK \
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
99 // \ \
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
100 // \ \
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
101 // \----------\
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
102 // \ \
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
103
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
104 untouched = 0;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
105 top_stack = top = (char *)TCT_System_Limit;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
106 bottom = (char *) ((unsigned)TCT_System_Limit + SYSTEM_SIZE);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
107 while (*top_stack == 0xFE && top_stack <= bottom)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
108 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
109 untouched++;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
110 top_stack++;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
111 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
112
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
113 // "CST" being the current active task with its related CST_Stack,
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
114 // the System Stack is unused (current sp_svc = System Stack Bottom)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
115 sprintf(result, "SYSSTACK: %08x %08x %08x 0x%x",
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
116 top,
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
117 bottom,
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
118 bottom, // current sp_svc = System Stack Bottom
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
119 untouched);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
120 vsi_o_trace("CST", 0x08, "-------------------------------------------------");
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
121 vsi_o_trace("CST", 0x08, result);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
122 vsi_t_sleep("",30);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
123
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
124 untouched = 0;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
125 top_stack = top = bottom + 4;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
126 bottom = (char *) ((unsigned)bottom + IRQ_STACK_SIZE);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
127 while (*top_stack == 0xFE && top_stack <= bottom)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
128 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
129 untouched++;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
130 top_stack++;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
131 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
132
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
133 // Since the processor is in supervisor mode (no IRQ & no FIQ),
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
134 // current sp_irq = IRQ Stack bottom
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
135 sprintf(result, "IRQSTACK: %08x %08x %08x 0x%x",
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
136 top,
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
137 bottom,
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
138 bottom, // current sp_irq = IRQ Stack bottom
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
139 untouched);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
140 vsi_o_trace("CST", 0x08, result);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
141 vsi_t_sleep("",30);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
142
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
143 untouched = 0;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
144 top_stack = top = bottom + 4;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
145 bottom = (char *) ((unsigned)bottom + FIQ_STACK_SIZE);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
146 while (*top_stack == 0xFE && top_stack <= bottom)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
147 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
148 untouched++;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
149 top_stack++;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
150 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
151
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
152 // Since the processor is in supervisor mode (no IRQ & no FIQ),
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
153 // current sp_fiq = FIQ Stack bottom
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
154 sprintf(result, "FIQSTACK: %08x %08x %08x 0x%x",
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
155 top,
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
156 bottom,
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
157 bottom, // current sp_fiq = FIQ Stack bottom
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
158 untouched);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
159 vsi_o_trace("CST", 0x08, result);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
160 vsi_o_trace("CST", 0x08, "-------------------------------------------------");
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
161 vsi_t_sleep("",30);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
162 }