Lines 71-79
Link Here
|
71 |
ldr r0, =ARM_RAS_START; \ |
71 |
ldr r0, =ARM_RAS_START; \ |
72 |
mov r1, #0; \ |
72 |
mov r1, #0; \ |
73 |
str r1, [r0]; \ |
73 |
str r1, [r0]; \ |
74 |
ldr r0, =ARM_RAS_END; \ |
|
|
75 |
mov r1, #0xffffffff; \ |
74 |
mov r1, #0xffffffff; \ |
76 |
str r1, [r0]; |
75 |
str r1, [r0, #4]; |
77 |
|
76 |
|
78 |
/* |
77 |
/* |
79 |
* PULLFRAME - macro to pull a trap frame from the stack in the current mode |
78 |
* PULLFRAME - macro to pull a trap frame from the stack in the current mode |
Lines 118-140
Link Here
|
118 |
stmia sp, {r0-r12}; /* Push the user mode registers */ \ |
117 |
stmia sp, {r0-r12}; /* Push the user mode registers */ \ |
119 |
add r0, sp, #(4*13); /* Adjust the stack pointer */ \ |
118 |
add r0, sp, #(4*13); /* Adjust the stack pointer */ \ |
120 |
stmia r0, {r13-r14}^; /* Push the user mode registers */ \ |
119 |
stmia r0, {r13-r14}^; /* Push the user mode registers */ \ |
121 |
mov r0, r0; /* NOP for previous instruction */ \ |
120 |
mov r0, r0; /* NOP for previous instruction */ \ |
122 |
ldr r5, =ARM_RAS_START; /* Check if there's any RAS */ \ |
121 |
ldr r5, =ARM_RAS_START; /* Retrieve global RAS_END and */ \ |
123 |
ldr r3, [r5]; \ |
122 |
ldr r4, [r5, #4]; /* reset it to point at the */ \ |
124 |
cmp r3, #0; /* Is the update needed ? */ \ |
123 |
cmp r4, #0xffffffff; /* end of memory if necessary; */ \ |
125 |
ldrgt lr, [r0, #16]; \ |
124 |
movne r1, #0xffffffff; /* leave value in r4 for later */ \ |
126 |
ldrgt r1, =ARM_RAS_END; \ |
125 |
strne r1, [r5, #4]; /* comparision against PC. */ \ |
127 |
ldrgt r4, [r1]; /* Get the end of the RAS */ \ |
126 |
ldr r3, [r5]; /* Retrieve global RAS_START */ \ |
128 |
movgt r2, #0; /* Reset the magic addresses */ \ |
127 |
cmp r3, #0; /* and reset it if non-zero. */ \ |
129 |
strgt r2, [r5]; \ |
128 |
movne r1, #0; /* If non-zero RAS_START and */ \ |
130 |
movgt r2, #0xffffffff; \ |
129 |
strne r1, [r5]; /* PC was lower than RAS_END, */ \ |
131 |
strgt r2, [r1]; \ |
130 |
ldrne r1, [r0, #16]; /* adjust the saved PC so that */ \ |
132 |
cmpgt lr, r3; /* Were we in the RAS ? */ \ |
131 |
cmpne r4, r1; /* execution later resumes at */ \ |
133 |
cmpgt r4, lr; \ |
132 |
strhi r3, [r0, #16]; /* the RAS_START location. */ \ |
134 |
strgt r3, [r0, #16]; /* Yes, update the pc */ \ |
133 |
mrs r0, spsr_all; \ |
135 |
mrs r0, spsr_all; /* Put the SPSR on the stack */ \ |
134 |
str r0, [sp, #-4]! |
136 |
str r0, [sp, #-4]! |
135 |
|
137 |
|
|
|
138 |
/* |
136 |
/* |
139 |
* PULLFRAMEFROMSVCANDEXIT - macro to pull a trap frame from the stack |
137 |
* PULLFRAMEFROMSVCANDEXIT - macro to pull a trap frame from the stack |
140 |
* in SVC32 mode and restore the saved processor mode and PC. |
138 |
* in SVC32 mode and restore the saved processor mode and PC. |