5 .set GP_SRR0, (SRR0_OFFSET - 8)
6 .set GP_SRR1, (GP_SRR0 + 4)
8 .set GP_1, (GPR1_OFFSET - 8)
11 .set GP_5, (GPR5_OFFSET - 8)
14 .set GP_13, (GPR13_OFFSET - 8)
15 .set GP_14, (GP_13 + 4)
16 .set GP_15, (GP_14 + 4)
17 .set GP_16, (GP_15 + 4)
18 .set GP_17, (GP_16 + 4)
19 .set GP_18, (GP_17 + 4)
20 .set GP_19, (GP_18 + 4)
21 .set GP_20, (GP_19 + 4)
22 .set GP_21, (GP_20 + 4)
23 .set GP_22, (GP_21 + 4)
24 .set GP_23, (GP_22 + 4)
25 .set GP_24, (GP_23 + 4)
26 .set GP_25, (GP_24 + 4)
27 .set GP_26, (GP_25 + 4)
28 .set GP_27, (GP_26 + 4)
29 .set GP_28, (GP_27 + 4)
30 .set GP_29, (GP_28 + 4)
31 .set GP_30, (GP_29 + 4)
32 .set GP_31, (GP_30 + 4)
34 .set GQ_0, (GP_31 + 4)
43 .set GP_CR, (GQ_7 + 4)
44 .set GP_LR, (GP_CR + 4)
45 .set GP_CTR, (GP_LR + 4)
46 .set GP_XER, (GP_CTR + 4)
47 .set GP_MSR, (GP_XER + 4)
48 .set GP_DAR, (GP_MSR + 4)
50 .set STATE, (GP_DAR + 4)
51 .set MODE, (STATE + 2)
53 .set FP_0, (FPR0_OFFSET - 8)
54 .set FP_1, (FP_0 + FP_SIZE)
55 .set FP_2, (FP_1 + FP_SIZE)
56 .set FP_3, (FP_2 + FP_SIZE)
57 .set FP_4, (FP_3 + FP_SIZE)
58 .set FP_5, (FP_4 + FP_SIZE)
59 .set FP_6, (FP_5 + FP_SIZE)
60 .set FP_7, (FP_6 + FP_SIZE)
61 .set FP_8, (FP_7 + FP_SIZE)
62 .set FP_9, (FP_8 + FP_SIZE)
63 .set FP_10, (FP_9 + FP_SIZE)
64 .set FP_11, (FP_10 + FP_SIZE)
65 .set FP_12, (FP_11 + FP_SIZE)
66 .set FP_13, (FP_12 + FP_SIZE)
67 .set FP_14, (FP_13 + FP_SIZE)
68 .set FP_15, (FP_14 + FP_SIZE)
69 .set FP_16, (FP_15 + FP_SIZE)
70 .set FP_17, (FP_16 + FP_SIZE)
71 .set FP_18, (FP_17 + FP_SIZE)
72 .set FP_19, (FP_18 + FP_SIZE)
73 .set FP_20, (FP_19 + FP_SIZE)
74 .set FP_21, (FP_20 + FP_SIZE)
75 .set FP_22, (FP_21 + FP_SIZE)
76 .set FP_23, (FP_22 + FP_SIZE)
77 .set FP_24, (FP_23 + FP_SIZE)
78 .set FP_25, (FP_24 + FP_SIZE)
79 .set FP_26, (FP_25 + FP_SIZE)
80 .set FP_27, (FP_26 + FP_SIZE)
81 .set FP_28, (FP_27 + FP_SIZE)
82 .set FP_29, (FP_28 + FP_SIZE)
83 .set FP_30, (FP_29 + FP_SIZE)
84 .set FP_31, (FP_30 + FP_SIZE)
85 .set FP_FPSCR, (FP_31 + FP_SIZE)
86 .set PSFP_0, (FP_FPSCR + FP_SIZE)
87 .set PSFP_1, (PSFP_0 + FP_SIZE)
88 .set PSFP_2, (PSFP_1 + FP_SIZE)
89 .set PSFP_3, (PSFP_2 + FP_SIZE)
90 .set PSFP_4, (PSFP_3 + FP_SIZE)
91 .set PSFP_5, (PSFP_4 + FP_SIZE)
92 .set PSFP_6, (PSFP_5 + FP_SIZE)
93 .set PSFP_7, (PSFP_6 + FP_SIZE)
94 .set PSFP_8, (PSFP_7 + FP_SIZE)
95 .set PSFP_9, (PSFP_8 + FP_SIZE)
96 .set PSFP_10, (PSFP_9 + FP_SIZE)
97 .set PSFP_11, (PSFP_10 + FP_SIZE)
98 .set PSFP_12, (PSFP_11 + FP_SIZE)
99 .set PSFP_13, (PSFP_12 + FP_SIZE)
100 .set PSFP_14, (PSFP_13 + FP_SIZE)
101 .set PSFP_15, (PSFP_14 + FP_SIZE)
102 .set PSFP_16, (PSFP_15 + FP_SIZE)
103 .set PSFP_17, (PSFP_16 + FP_SIZE)
104 .set PSFP_18, (PSFP_17 + FP_SIZE)
105 .set PSFP_19, (PSFP_18 + FP_SIZE)
106 .set PSFP_20, (PSFP_19 + FP_SIZE)
107 .set PSFP_21, (PSFP_20 + FP_SIZE)
108 .set PSFP_22, (PSFP_21 + FP_SIZE)
109 .set PSFP_23, (PSFP_22 + FP_SIZE)
110 .set PSFP_24, (PSFP_23 + FP_SIZE)
111 .set PSFP_25, (PSFP_24 + FP_SIZE)
112 .set PSFP_26, (PSFP_25 + FP_SIZE)
113 .set PSFP_27, (PSFP_26 + FP_SIZE)
114 .set PSFP_28, (PSFP_27 + FP_SIZE)
115 .set PSFP_29, (PSFP_28 + FP_SIZE)
116 .set PSFP_30, (PSFP_29 + FP_SIZE)
117 .set PSFP_31, (PSFP_30 + FP_SIZE)
120 .globl _cpu_context_save_fp
121 _cpu_context_save_fp:
158 stfd fr0, FP_FPSCR(r3)
163 psq_st fr0,PSFP_0(r3),0,0
164 psq_st fr1,PSFP_1(r3),0,0
165 psq_st fr2,PSFP_2(r3),0,0
166 psq_st fr3,PSFP_3(r3),0,0
167 psq_st fr4,PSFP_4(r3),0,0
168 psq_st fr5,PSFP_5(r3),0,0
169 psq_st fr6,PSFP_6(r3),0,0
170 psq_st fr7,PSFP_7(r3),0,0
171 psq_st fr8,PSFP_8(r3),0,0
172 psq_st fr9,PSFP_9(r3),0,0
173 psq_st fr10,PSFP_10(r3),0,0
174 psq_st fr11,PSFP_11(r3),0,0
175 psq_st fr12,PSFP_12(r3),0,0
176 psq_st fr13,PSFP_13(r3),0,0
177 psq_st fr14,PSFP_14(r3),0,0
178 psq_st fr15,PSFP_15(r3),0,0
179 psq_st fr16,PSFP_16(r3),0,0
180 psq_st fr17,PSFP_17(r3),0,0
181 psq_st fr18,PSFP_18(r3),0,0
182 psq_st fr19,PSFP_19(r3),0,0
183 psq_st fr20,PSFP_20(r3),0,0
184 psq_st fr21,PSFP_21(r3),0,0
185 psq_st fr22,PSFP_22(r3),0,0
186 psq_st fr23,PSFP_23(r3),0,0
187 psq_st fr24,PSFP_24(r3),0,0
188 psq_st fr25,PSFP_25(r3),0,0
189 psq_st fr26,PSFP_26(r3),0,0
190 psq_st fr27,PSFP_27(r3),0,0
191 psq_st fr28,PSFP_28(r3),0,0
192 psq_st fr29,PSFP_29(r3),0,0
193 psq_st fr30,PSFP_30(r3),0,0
194 psq_st fr31,PSFP_31(r3),0,0
199 .globl _cpu_context_restore_fp
200 _cpu_context_restore_fp:
204 lfd fr0, FP_FPSCR(r3)
209 psq_l fr0,PSFP_0(r3),0,0
210 psq_l fr1,PSFP_1(r3),0,0
211 psq_l fr2,PSFP_2(r3),0,0
212 psq_l fr3,PSFP_3(r3),0,0
213 psq_l fr4,PSFP_4(r3),0,0
214 psq_l fr5,PSFP_5(r3),0,0
215 psq_l fr6,PSFP_6(r3),0,0
216 psq_l fr7,PSFP_7(r3),0,0
217 psq_l fr8,PSFP_8(r3),0,0
218 psq_l fr9,PSFP_9(r3),0,0
219 psq_l fr10,PSFP_10(r3),0,0
220 psq_l fr11,PSFP_11(r3),0,0
221 psq_l fr12,PSFP_12(r3),0,0
222 psq_l fr13,PSFP_13(r3),0,0
223 psq_l fr14,PSFP_14(r3),0,0
224 psq_l fr15,PSFP_15(r3),0,0
225 psq_l fr16,PSFP_16(r3),0,0
226 psq_l fr17,PSFP_17(r3),0,0
227 psq_l fr18,PSFP_18(r3),0,0
228 psq_l fr19,PSFP_19(r3),0,0
229 psq_l fr20,PSFP_20(r3),0,0
230 psq_l fr21,PSFP_21(r3),0,0
231 psq_l fr22,PSFP_22(r3),0,0
232 psq_l fr23,PSFP_23(r3),0,0
233 psq_l fr24,PSFP_24(r3),0,0
234 psq_l fr25,PSFP_25(r3),0,0
235 psq_l fr26,PSFP_26(r3),0,0
236 psq_l fr27,PSFP_27(r3),0,0
237 psq_l fr28,PSFP_28(r3),0,0
238 psq_l fr29,PSFP_29(r3),0,0
239 psq_l fr30,PSFP_30(r3),0,0
240 psq_l fr31,PSFP_31(r3),0,0
278 .globl _cpu_context_switch
371 rlwinm r5, r5, 0, 19, 17
377 .globl _cpu_context_save
382 stw sp,GPR1_OFFSET-8(r3)
383 stw toc,GPR2_OFFSET-8(r3)
384 stmw r13,GPR13_OFFSET-8(r3)
387 stw r6, CTR_OFFSET-8(r3)
389 stw r6, CR_OFFSET-8(r3)
391 stw r7, LR_OFFSET-8(r3)
393 stw r8, MSR_OFFSET-8(r3)
396 stw r6,GQR1_OFFSET-8(r3)
398 stw r6,GQR2_OFFSET-8(r3)
400 stw r6,GQR3_OFFSET-8(r3)
402 stw r6,GQR4_OFFSET-8(r3)
404 stw r6,GQR5_OFFSET-8(r3)
406 stw r6,GQR6_OFFSET-8(r3)
408 stw r6,GQR7_OFFSET-8(r3)
413 .globl _cpu_context_restore
414 _cpu_context_restore:
415 lwz sp,GPR1_OFFSET-8(r3)
416 lwz toc,GPR2_OFFSET-8(r3)
417 lmw r13,GPR13_OFFSET-8(r3)
419 lwz r6, CTR_OFFSET-8(r3)
421 lwz r6, CR_OFFSET-8(r3)
423 lwz r7, LR_OFFSET-8(r3)
425 lwz r8, MSR_OFFSET-8(r3)
429 lwz r6, GQR1_OFFSET-8(r3)
431 lwz r6, GQR2_OFFSET-8(r3)
433 lwz r6, GQR3_OFFSET-8(r3)
435 lwz r6, GQR4_OFFSET-8(r3)
437 lwz r6, GQR5_OFFSET-8(r3)
439 lwz r6, GQR6_OFFSET-8(r3)
441 lwz r6, GQR7_OFFSET-8(r3)
448 .globl _cpu_context_switch_ex
449 _cpu_context_switch_ex:
513 rlwinm r5, r5, 0, 19, 17
520 .globl _cpu_context_save_ex
521 _cpu_context_save_ex:
525 stw r0,GPR0_OFFSET-8(r3)
526 stw sp,GPR1_OFFSET-8(r3)
527 stw toc,GPR2_OFFSET-8(r3)
528 stmw r3,GPR3_OFFSET-8(r3)
531 stw r6, CTR_OFFSET-8(r3)
533 stw r6, CR_OFFSET-8(r3)
535 stw r7, LR_OFFSET-8(r3)
537 stw r8, XER_OFFSET-8(r3)
539 stw r8, MSR_OFFSET-8(r3)
541 stw r8, DAR_OFFSET-8(r3)
543 stw r8, SRR0_OFFSET-8(r3)
545 stw r8, SRR1_OFFSET-8(r3)
548 stw r6,GQR1_OFFSET-8(r3)
550 stw r6,GQR2_OFFSET-8(r3)
552 stw r6,GQR3_OFFSET-8(r3)
554 stw r6,GQR4_OFFSET-8(r3)
556 stw r6,GQR5_OFFSET-8(r3)
558 stw r6,GQR6_OFFSET-8(r3)
560 stw r6,GQR7_OFFSET-8(r3)
565 .globl _cpu_context_restore_ex
566 _cpu_context_restore_ex:
568 lwz r6, CTR_OFFSET-8(r3)
570 lwz r6, CR_OFFSET-8(r3)
572 lwz r7, LR_OFFSET-8(r3)
574 lwz r7, XER_OFFSET-8(r3)
576 lwz r8, MSR_OFFSET-8(r3)
578 lwz r8, SRR0_OFFSET-8(r3)
580 lwz r8, SRR1_OFFSET-8(r3)
583 lwz r6, GQR1_OFFSET-8(r3)
585 lwz r6, GQR2_OFFSET-8(r3)
587 lwz r6, GQR3_OFFSET-8(r3)
589 lwz r6, GQR4_OFFSET-8(r3)
591 lwz r6, GQR5_OFFSET-8(r3)
593 lwz r6, GQR6_OFFSET-8(r3)
595 lwz r6, GQR7_OFFSET-8(r3)
598 lwz sp,GPR1_OFFSET-8(r3)
599 lwz toc,GPR2_OFFSET-8(r3)
600 lmw r4,GPR4_OFFSET-8(r3)
601 lwz r3,GPR3_OFFSET-8(r3)