Rev 912 | Rev 916 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 912 | Rev 915 | ||
---|---|---|---|
Line 30... | Line 30... | ||
30 | #include <arch/stack.h> |
30 | #include <arch/stack.h> |
31 | #include <arch/register.h> |
31 | #include <arch/register.h> |
32 | #include <arch/mm/page.h> |
32 | #include <arch/mm/page.h> |
33 | #include <align.h> |
33 | #include <align.h> |
34 | 34 | ||
35 | #define STACK_ITEMS 13 |
35 | #define STACK_ITEMS 14 |
36 | #define STACK_FRAME_SIZE ALIGN_UP((STACK_ITEMS*STACK_ITEM_SIZE) + STACK_SCRATCH_AREA_SIZE, STACK_ALIGNMENT) |
36 | #define STACK_FRAME_SIZE ALIGN_UP((STACK_ITEMS*STACK_ITEM_SIZE) + STACK_SCRATCH_AREA_SIZE, STACK_ALIGNMENT) |
37 | 37 | ||
38 | #if (STACK_ITEMS % 2 == 0) |
38 | #if (STACK_ITEMS % 2 == 0) |
39 | # define STACK_FRAME_BIAS 8 |
39 | # define STACK_FRAME_BIAS 8 |
40 | #else |
40 | #else |
Line 139... | Line 139... | ||
139 | 139 | ||
140 | mov r27 = ar.rnat |
140 | mov r27 = ar.rnat |
141 | mov r28 = ar.bspstore ;; |
141 | mov r28 = ar.bspstore ;; |
142 | 142 | ||
143 | /* assume kernel backing store */ |
143 | /* assume kernel backing store */ |
144 | /* mov ar.bspstore = r28 ;; */ |
144 | mov ar.bspstore = r28 ;; |
145 | 145 | ||
146 | mov r29 = ar.bsp |
146 | mov r29 = ar.bsp |
147 | 147 | ||
148 | st8 [r31] = r27, -8 ;; /* save ar.rnat */ |
148 | st8 [r31] = r27, -8 ;; /* save ar.rnat */ |
- | 149 | st8 [r31] = r28, -8 ;; /* save new value written to ar.bspstore */ |
|
149 | st8 [r31] = r28, -8 ;; /* save ar.bspstore */ |
150 | st8 [r31] = r28, -8 ;; /* save ar.bspstore */ |
150 | st8 [r31] = r29, -8 /* save ar.bsp */ |
151 | st8 [r31] = r29, -8 /* save ar.bsp */ |
151 | 152 | ||
152 | mov ar.rsc = r24 /* restore RSE's setting */ |
153 | mov ar.rsc = r24 /* restore RSE's setting */ |
153 | 154 | ||
Line 159... | Line 160... | ||
159 | /* 16. RSE switch to interrupted context */ |
160 | /* 16. RSE switch to interrupted context */ |
160 | cover /* allocate zerro size frame (step 1 (from Intel Docs)) */ |
161 | cover /* allocate zerro size frame (step 1 (from Intel Docs)) */ |
161 | 162 | ||
162 | add r31 = STACK_SCRATCH_AREA_SIZE, r12 ;; |
163 | add r31 = STACK_SCRATCH_AREA_SIZE, r12 ;; |
163 | 164 | ||
164 | mov r28 = ar.bspstore /* calculate loadrs (step 2) */ |
165 | ld8 r30 = [r31], +8 ;; /* load ar.bsp */ |
165 | ld8 r29 = [r31], +8 ;; /* load ar.bsp */ |
166 | ld8 r29 = [r31], +8 ;; /* load ar.bspstore */ |
- | 167 | ld8 r28 = [r31], +8 ;; /* load ar.bspstore_new */ |
|
166 | sub r27 = r29 , r28 ;; |
168 | sub r27 = r30 , r28 ;; /* calculate loadrs (step 2) */ |
167 | shl r27 = r27, 16 |
169 | shl r27 = r27, 16 |
168 | 170 | ||
169 | mov r24 = ar.rsc ;; |
171 | mov r24 = ar.rsc ;; |
170 | and r30 = ~3, r24 ;; |
172 | and r30 = ~3, r24 ;; |
171 | or r24 = r30 , r27 ;; |
173 | or r24 = r30 , r27 ;; |
172 | mov ar.rsc = r24 ;; /* place RSE in enforced lazy mode */ |
174 | mov ar.rsc = r24 ;; /* place RSE in enforced lazy mode */ |
173 | 175 | ||
174 | loadrs /* (step 3) */ |
176 | loadrs /* (step 3) */ |
175 | 177 | ||
176 | ld8 r28 = [r31], +8 ;; /* load ar.bspstore */ |
- | |
177 | ld8 r27 = [r31], +8 ;; /* load ar.rnat */ |
178 | ld8 r27 = [r31], +8 ;; /* load ar.rnat */ |
178 | ld8 r26 = [r31], +8 ;; /* load cr.ifs */ |
179 | ld8 r26 = [r31], +8 ;; /* load cr.ifs */ |
179 | ld8 r25 = [r31], +8 ;; /* load ar.pfs */ |
180 | ld8 r25 = [r31], +8 ;; /* load ar.pfs */ |
180 | ld8 r24 = [r31], +8 ;; /* load ar.rsc */ |
181 | ld8 r24 = [r31], +8 ;; /* load ar.rsc */ |
181 | 182 | ||
182 | /* mov ar.bspstore = r28 ;; */ /* (step 4) */ |
183 | mov ar.bspstore = r29 ;; /* (step 4) */ |
183 | /* mov ar.rnat = r27 */ /* (step 5) */ |
184 | mov ar.rnat = r27 /* (step 5) */ |
184 | 185 | ||
185 | mov ar.pfs = r25 /* (step 6) */ |
186 | mov ar.pfs = r25 /* (step 6) */ |
186 | mov cr.ifs = r26 |
187 | mov cr.ifs = r26 |
187 | 188 | ||
188 | mov ar.rsc = r24 /* (step 7) */ |
189 | mov ar.rsc = r24 /* (step 7) */ |