source: rtems/c/src/lib/libcpu/powerpc/old-exceptions/cpu_asm.S @ 590aba4f

4.104.114.84.95
Last change on this file since 590aba4f was 590aba4f, checked in by Joel Sherrill <joel.sherrill@…>, on 10/12/01 at 21:03:53

2001-10-12 Joel Sherrill <joel@…>

  • mpc6xx/clock/c_clock.c, mpc6xx/clock/c_clock.h, mpc8xx/clock/clock.c, mpc8xx/timer/timer.c, new_exception_processing/cpu.c, new_exception_processing/cpu.h, new_exception_processing/cpu_asm.S, old_exception_processing/cpu.c, old_exception_processing/cpu.h, old_exception_processing/cpu_asm.S, old_exception_processing/rtems.S: Fixed typo.
  • Property mode set to 100644
File size: 13.6 KB
Line 
1
2/*  cpu_asm.s   1.1 - 95/12/04
3 *
4 *  This file contains the assembly code for the PowerPC implementation
5 *  of RTEMS.
6 *
7 *  Author:     Andrew Bray <andy@i-cubed.co.uk>
8 *
9 *  COPYRIGHT (c) 1995 by i-cubed ltd.
10 *
11 *  To anyone who acknowledges that this file is provided "AS IS"
12 *  without any express or implied warranty:
13 *      permission to use, copy, modify, and distribute this file
14 *      for any purpose is hereby granted without fee, provided that
15 *      the above copyright notice and this notice appears in all
16 *      copies, and that the name of i-cubed limited not be used in
17 *      advertising or publicity pertaining to distribution of the
18 *      software without specific, written prior permission.
19 *      i-cubed limited makes no representations about the suitability
20 *      of this software for any purpose.
21 *
22 *  Derived from c/src/exec/cpu/no_cpu/cpu_asm.c:
23 *
24 *  COPYRIGHT (c) 1989-1997.
25 *  On-Line Applications Research Corporation (OAR).
26 *
27 *  The license and distribution terms for this file may in
28 *  the file LICENSE in this distribution or at
29 *  http://www.OARcorp.com/rtems/license.html.
30 *
31 *  $Id$
32 */
33
34#include <asm.h>
35#include "ppc_offs.h"
36       
37        BEGIN_CODE
38/*
39 *  _CPU_Context_save_fp_context
40 *
41 *  This routine is responsible for saving the FP context
42 *  at *fp_context_ptr.  If the point to load the FP context
43 *  from is changed then the pointer is modified by this routine.
44 *
45 *  Sometimes a macro implementation of this is in cpu.h which dereferences
46 *  the ** and a similarly named routine in this file is passed something
47 *  like a (Context_Control_fp *).  The general rule on making this decision
48 *  is to avoid writing assembly language.
49 */
50
51        ALIGN (PPC_CACHE_ALIGNMENT, PPC_CACHE_ALIGN_POWER)
52        PUBLIC_PROC (_CPU_Context_save_fp)
53PROC (_CPU_Context_save_fp):
54#if (PPC_HAS_FPU == 1)
55        lwz     r3, 0(r3)
56#if (PPC_HAS_DOUBLE == 1)
57        stfd    f0, FP_0(r3)
58        stfd    f1, FP_1(r3)
59        stfd    f2, FP_2(r3)
60        stfd    f3, FP_3(r3)
61        stfd    f4, FP_4(r3)
62        stfd    f5, FP_5(r3)
63        stfd    f6, FP_6(r3)
64        stfd    f7, FP_7(r3)
65        stfd    f8, FP_8(r3)
66        stfd    f9, FP_9(r3)
67        stfd    f10, FP_10(r3)
68        stfd    f11, FP_11(r3)
69        stfd    f12, FP_12(r3)
70        stfd    f13, FP_13(r3)
71        stfd    f14, FP_14(r3)
72        stfd    f15, FP_15(r3)
73        stfd    f16, FP_16(r3)
74        stfd    f17, FP_17(r3)
75        stfd    f18, FP_18(r3)
76        stfd    f19, FP_19(r3)
77        stfd    f20, FP_20(r3)
78        stfd    f21, FP_21(r3)
79        stfd    f22, FP_22(r3)
80        stfd    f23, FP_23(r3)
81        stfd    f24, FP_24(r3)
82        stfd    f25, FP_25(r3)
83        stfd    f26, FP_26(r3)
84        stfd    f27, FP_27(r3)
85        stfd    f28, FP_28(r3)
86        stfd    f29, FP_29(r3)
87        stfd    f30, FP_30(r3)
88        stfd    f31, FP_31(r3)
89        mffs    f2
90        stfd    f2, FP_FPSCR(r3)
91#else
92        stfs    f0, FP_0(r3)
93        stfs    f1, FP_1(r3)
94        stfs    f2, FP_2(r3)
95        stfs    f3, FP_3(r3)
96        stfs    f4, FP_4(r3)
97        stfs    f5, FP_5(r3)
98        stfs    f6, FP_6(r3)
99        stfs    f7, FP_7(r3)
100        stfs    f8, FP_8(r3)
101        stfs    f9, FP_9(r3)
102        stfs    f10, FP_10(r3)
103        stfs    f11, FP_11(r3)
104        stfs    f12, FP_12(r3)
105        stfs    f13, FP_13(r3)
106        stfs    f14, FP_14(r3)
107        stfs    f15, FP_15(r3)
108        stfs    f16, FP_16(r3)
109        stfs    f17, FP_17(r3)
110        stfs    f18, FP_18(r3)
111        stfs    f19, FP_19(r3)
112        stfs    f20, FP_20(r3)
113        stfs    f21, FP_21(r3)
114        stfs    f22, FP_22(r3)
115        stfs    f23, FP_23(r3)
116        stfs    f24, FP_24(r3)
117        stfs    f25, FP_25(r3)
118        stfs    f26, FP_26(r3)
119        stfs    f27, FP_27(r3)
120        stfs    f28, FP_28(r3)
121        stfs    f29, FP_29(r3)
122        stfs    f30, FP_30(r3)
123        stfs    f31, FP_31(r3)
124        mffs    f2
125        stfs    f2, FP_FPSCR(r3)
126#endif
127#endif
128        blr
129
130/*
131 *  _CPU_Context_restore_fp_context
132 *
133 *  This routine is responsible for restoring the FP context
134 *  at *fp_context_ptr.  If the point to load the FP context
135 *  from is changed then the pointer is modified by this routine.
136 *
137 *  Sometimes a macro implementation of this is in cpu.h which dereferences
138 *  the ** and a similarly named routine in this file is passed something
139 *  like a (Context_Control_fp *).  The general rule on making this decision
140 *  is to avoid writing assembly language.
141 */
142
143        ALIGN (PPC_CACHE_ALIGNMENT, PPC_CACHE_ALIGN_POWER)
144        PUBLIC_PROC (_CPU_Context_restore_fp)
145PROC (_CPU_Context_restore_fp):
146#if (PPC_HAS_FPU == 1)
147        lwz     r3, 0(r3)
148#if (PPC_HAS_DOUBLE == 1)
149        lfd     f2, FP_FPSCR(r3)
150        mtfsf   255, f2
151        lfd     f0, FP_0(r3)
152        lfd     f1, FP_1(r3)
153        lfd     f2, FP_2(r3)
154        lfd     f3, FP_3(r3)
155        lfd     f4, FP_4(r3)
156        lfd     f5, FP_5(r3)
157        lfd     f6, FP_6(r3)
158        lfd     f7, FP_7(r3)
159        lfd     f8, FP_8(r3)
160        lfd     f9, FP_9(r3)
161        lfd     f10, FP_10(r3)
162        lfd     f11, FP_11(r3)
163        lfd     f12, FP_12(r3)
164        lfd     f13, FP_13(r3)
165        lfd     f14, FP_14(r3)
166        lfd     f15, FP_15(r3)
167        lfd     f16, FP_16(r3)
168        lfd     f17, FP_17(r3)
169        lfd     f18, FP_18(r3)
170        lfd     f19, FP_19(r3)
171        lfd     f20, FP_20(r3)
172        lfd     f21, FP_21(r3)
173        lfd     f22, FP_22(r3)
174        lfd     f23, FP_23(r3)
175        lfd     f24, FP_24(r3)
176        lfd     f25, FP_25(r3)
177        lfd     f26, FP_26(r3)
178        lfd     f27, FP_27(r3)
179        lfd     f28, FP_28(r3)
180        lfd     f29, FP_29(r3)
181        lfd     f30, FP_30(r3)
182        lfd     f31, FP_31(r3)
183#else
184        lfs     f2, FP_FPSCR(r3)
185        mtfsf   255, f2
186        lfs     f0, FP_0(r3)
187        lfs     f1, FP_1(r3)
188        lfs     f2, FP_2(r3)
189        lfs     f3, FP_3(r3)
190        lfs     f4, FP_4(r3)
191        lfs     f5, FP_5(r3)
192        lfs     f6, FP_6(r3)
193        lfs     f7, FP_7(r3)
194        lfs     f8, FP_8(r3)
195        lfs     f9, FP_9(r3)
196        lfs     f10, FP_10(r3)
197        lfs     f11, FP_11(r3)
198        lfs     f12, FP_12(r3)
199        lfs     f13, FP_13(r3)
200        lfs     f14, FP_14(r3)
201        lfs     f15, FP_15(r3)
202        lfs     f16, FP_16(r3)
203        lfs     f17, FP_17(r3)
204        lfs     f18, FP_18(r3)
205        lfs     f19, FP_19(r3)
206        lfs     f20, FP_20(r3)
207        lfs     f21, FP_21(r3)
208        lfs     f22, FP_22(r3)
209        lfs     f23, FP_23(r3)
210        lfs     f24, FP_24(r3)
211        lfs     f25, FP_25(r3)
212        lfs     f26, FP_26(r3)
213        lfs     f27, FP_27(r3)
214        lfs     f28, FP_28(r3)
215        lfs     f29, FP_29(r3)
216        lfs     f30, FP_30(r3)
217        lfs     f31, FP_31(r3)
218#endif
219#endif
220        blr
221
222
223/*  _CPU_Context_switch
224 *
225 *  This routine performs a normal non-FP context switch.
226 */
227        ALIGN (PPC_CACHE_ALIGNMENT, PPC_CACHE_ALIGN_POWER)
228        PUBLIC_PROC (_CPU_Context_switch)
229PROC (_CPU_Context_switch):
230        sync
231        isync
232#if (PPC_CACHE_ALIGNMENT == 4) /* No cache */
233        stw     r1, GP_1(r3)
234        lwz     r1, GP_1(r4)
235        stw     r2, GP_2(r3)
236        lwz     r2, GP_2(r4)
237#if (PPC_USE_MULTIPLE == 1)
238        stmw    r13, GP_13(r3)
239        lmw     r13, GP_13(r4)
240#else
241        stw     r13, GP_13(r3)
242        lwz     r13, GP_13(r4)
243        stw     r14, GP_14(r3)
244        lwz     r14, GP_14(r4)
245        stw     r15, GP_15(r3)
246        lwz     r15, GP_15(r4)
247        stw     r16, GP_16(r3)
248        lwz     r16, GP_16(r4)
249        stw     r17, GP_17(r3)
250        lwz     r17, GP_17(r4)
251        stw     r18, GP_18(r3)
252        lwz     r18, GP_18(r4)
253        stw     r19, GP_19(r3)
254        lwz     r19, GP_19(r4)
255        stw     r20, GP_20(r3)
256        lwz     r20, GP_20(r4)
257        stw     r21, GP_21(r3)
258        lwz     r21, GP_21(r4)
259        stw     r22, GP_22(r3)
260        lwz     r22, GP_22(r4)
261        stw     r23, GP_23(r3)
262        lwz     r23, GP_23(r4)
263        stw     r24, GP_24(r3)
264        lwz     r24, GP_24(r4)
265        stw     r25, GP_25(r3)
266        lwz     r25, GP_25(r4)
267        stw     r26, GP_26(r3)
268        lwz     r26, GP_26(r4)
269        stw     r27, GP_27(r3)
270        lwz     r27, GP_27(r4)
271        stw     r28, GP_28(r3)
272        lwz     r28, GP_28(r4)
273        stw     r29, GP_29(r3)
274        lwz     r29, GP_29(r4)
275        stw     r30, GP_30(r3)
276        lwz     r30, GP_30(r4)
277        stw     r31, GP_31(r3)
278        lwz     r31, GP_31(r4)
279#endif
280        mfcr    r5
281        stw     r5, GP_CR(r3)
282        lwz     r5, GP_CR(r4)
283        mflr    r6
284        mtcrf   255, r5
285        stw     r6, GP_PC(r3)
286        lwz     r6, GP_PC(r4)
287        mfmsr   r7
288        mtlr    r6
289        stw     r7, GP_MSR(r3)
290        lwz     r7, GP_MSR(r4)
291        mtmsr   r7
292#endif
293#if (PPC_CACHE_ALIGNMENT == 16)
294        /* This assumes that all the registers are in the given order */
295        li      r5, 16
296        addi    r3,r3,-4
297#if ( PPC_USE_DATA_CACHE )
298        dcbz    r5, r3
299#endif
300        stw     r1, GP_1+4(r3)
301        stw     r2, GP_2+4(r3)
302#if (PPC_USE_MULTIPLE == 1)
303        addi    r3, r3, GP_14+4
304#if ( PPC_USE_DATA_CACHE )
305        dcbz    r5, r3
306#endif
307
308        addi    r3, r3, GP_18-GP_14
309#if ( PPC_USE_DATA_CACHE )
310        dcbz    r5, r3
311#endif
312        addi    r3, r3, GP_22-GP_18
313#if ( PPC_USE_DATA_CACHE )
314        dcbz    r5, r3
315#endif
316        addi    r3, r3, GP_26-GP_22
317#if ( PPC_USE_DATA_CACHE )
318        dcbz    r5, r3
319#endif
320        stmw    r13, GP_13-GP_26(r3)
321#else
322        stw     r13, GP_13+4(r3)
323        stwu    r14, GP_14+4(r3)
324#if ( PPC_USE_DATA_CACHE )
325        dcbz    r5, r3
326#endif
327        stw     r15, GP_15-GP_14(r3)
328        stw     r16, GP_16-GP_14(r3)
329        stw     r17, GP_17-GP_14(r3)
330        stwu    r18, GP_18-GP_14(r3)
331#if ( PPC_USE_DATA_CACHE )
332        dcbz    r5, r3
333#endif
334        stw     r19, GP_19-GP_18(r3)
335        stw     r20, GP_20-GP_18(r3)
336        stw     r21, GP_21-GP_18(r3)
337        stwu    r22, GP_22-GP_18(r3)
338#if ( PPC_USE_DATA_CACHE )
339        dcbz    r5, r3
340#endif
341        stw     r23, GP_23-GP_22(r3)
342        stw     r24, GP_24-GP_22(r3)
343        stw     r25, GP_25-GP_22(r3)
344        stwu    r26, GP_26-GP_22(r3)
345#if ( PPC_USE_DATA_CACHE )
346        dcbz    r5, r3
347#endif
348        stw     r27, GP_27-GP_26(r3)
349        stw     r28, GP_28-GP_26(r3)
350        stw     r29, GP_29-GP_26(r3)
351        stw     r30, GP_30-GP_26(r3)
352        stw     r31, GP_31-GP_26(r3)
353#endif
354#if ( PPC_USE_DATA_CACHE )
355        dcbt    r0, r4
356#endif
357        mfcr    r6
358        stw     r6, GP_CR-GP_26(r3)
359        mflr    r7
360        stw     r7, GP_PC-GP_26(r3)
361        mfmsr   r8
362        stw     r8, GP_MSR-GP_26(r3)
363       
364#if ( PPC_USE_DATA_CACHE )
365        dcbt    r5, r4
366#endif
367        lwz     r1, GP_1(r4)
368        lwz     r2, GP_2(r4)
369#if (PPC_USE_MULTIPLE == 1)
370        addi    r4, r4, GP_15
371#if ( PPC_USE_DATA_CACHE )
372        dcbt    r5, r4
373#endif
374        addi    r4, r4, GP_19-GP_15
375#if ( PPC_USE_DATA_CACHE )
376        dcbt    r5, r4
377#endif
378        addi    r4, r4, GP_23-GP_19
379#if ( PPC_USE_DATA_CACHE )
380        dcbt    r5, r4
381#endif
382        addi    r4, r4, GP_27-GP_23
383#if ( PPC_USE_DATA_CACHE )
384        dcbt    r5, r4
385#endif
386        lmw     r13, GP_13-GP_27(r4)
387#else
388        lwz     r13, GP_13(r4)
389        lwz     r14, GP_14(r4)
390        lwzu    r15, GP_15(r4)
391#if ( PPC_USE_DATA_CACHE )
392        dcbt    r5, r4
393#endif
394        lwz     r16, GP_16-GP_15(r4)
395        lwz     r17, GP_17-GP_15(r4)
396        lwz     r18, GP_18-GP_15(r4)
397        lwzu    r19, GP_19-GP_15(r4)
398#if ( PPC_USE_DATA_CACHE )
399        dcbt    r5, r4
400#endif
401        lwz     r20, GP_20-GP_19(r4)
402        lwz     r21, GP_21-GP_19(r4)
403        lwz     r22, GP_22-GP_19(r4)
404        lwzu    r23, GP_23-GP_19(r4)
405#if ( PPC_USE_DATA_CACHE )
406        dcbt    r5, r4
407#endif
408        lwz     r24, GP_24-GP_23(r4)
409        lwz     r25, GP_25-GP_23(r4)
410        lwz     r26, GP_26-GP_23(r4)
411        lwzu    r27, GP_27-GP_23(r4)
412#if ( PPC_USE_DATA_CACHE )
413        dcbt    r5, r4
414#endif
415        lwz     r28, GP_28-GP_27(r4)
416        lwz     r29, GP_29-GP_27(r4)
417        lwz     r30, GP_30-GP_27(r4)
418        lwz     r31, GP_31-GP_27(r4)
419#endif
420        lwz     r6, GP_CR-GP_27(r4)
421        lwz     r7, GP_PC-GP_27(r4)
422        lwz     r8, GP_MSR-GP_27(r4)
423        mtcrf   255, r6
424        mtlr    r7
425        mtmsr   r8
426#endif
427#if (PPC_CACHE_ALIGNMENT == 32)
428        /* This assumes that all the registers are in the given order */
429        li      r5, 32
430        addi    r3,r3,-4
431#if ( PPC_USE_DATA_CACHE )
432        dcbz    r5, r3
433#endif
434        stw     r1, GP_1+4(r3)
435        stw     r2, GP_2+4(r3)
436#if (PPC_USE_MULTIPLE == 1)
437        addi    r3, r3, GP_18+4
438#if ( PPC_USE_DATA_CACHE )
439        dcbz    r5, r3
440#endif
441        stmw    r13, GP_13-GP_18(r3)
442#else
443        stw     r13, GP_13+4(r3)
444        stw     r14, GP_14+4(r3)
445        stw     r15, GP_15+4(r3)
446        stw     r16, GP_16+4(r3)
447        stw     r17, GP_17+4(r3)
448        stwu    r18, GP_18+4(r3)
449#if ( PPC_USE_DATA_CACHE )
450        dcbz    r5, r3
451#endif
452        stw     r19, GP_19-GP_18(r3)
453        stw     r20, GP_20-GP_18(r3)
454        stw     r21, GP_21-GP_18(r3)
455        stw     r22, GP_22-GP_18(r3)
456        stw     r23, GP_23-GP_18(r3)
457        stw     r24, GP_24-GP_18(r3)
458        stw     r25, GP_25-GP_18(r3)
459        stw     r26, GP_26-GP_18(r3)
460        stw     r27, GP_27-GP_18(r3)
461        stw     r28, GP_28-GP_18(r3)
462        stw     r29, GP_29-GP_18(r3)
463        stw     r30, GP_30-GP_18(r3)
464        stw     r31, GP_31-GP_18(r3)
465#endif
466#if ( PPC_USE_DATA_CACHE )
467        dcbt    r0, r4
468#endif
469        mfcr    r6
470        stw     r6, GP_CR-GP_18(r3)
471        mflr    r7
472        stw     r7, GP_PC-GP_18(r3)
473        mfmsr   r8
474        stw     r8, GP_MSR-GP_18(r3)
475
476#if ( PPC_USE_DATA_CACHE )
477        dcbt    r5, r4
478#endif
479        lwz     r1, GP_1(r4)
480        lwz     r2, GP_2(r4)
481#if (PPC_USE_MULTIPLE == 1)
482        addi    r4, r4, GP_19
483#if ( PPC_USE_DATA_CACHE )
484        dcbt    r5, r4
485#endif
486        lmw     r13, GP_13-GP_19(r4)
487#else
488        lwz     r13, GP_13(r4)
489        lwz     r14, GP_14(r4)
490        lwz     r15, GP_15(r4)
491        lwz     r16, GP_16(r4)
492        lwz     r17, GP_17(r4)
493        lwz     r18, GP_18(r4)
494        lwzu    r19, GP_19(r4)
495#if ( PPC_USE_DATA_CACHE )
496        dcbt    r5, r4
497#endif
498        lwz     r20, GP_20-GP_19(r4)
499        lwz     r21, GP_21-GP_19(r4)
500        lwz     r22, GP_22-GP_19(r4)
501        lwz     r23, GP_23-GP_19(r4)
502        lwz     r24, GP_24-GP_19(r4)
503        lwz     r25, GP_25-GP_19(r4)
504        lwz     r26, GP_26-GP_19(r4)
505        lwz     r27, GP_27-GP_19(r4)
506        lwz     r28, GP_28-GP_19(r4)
507        lwz     r29, GP_29-GP_19(r4)
508        lwz     r30, GP_30-GP_19(r4)
509        lwz     r31, GP_31-GP_19(r4)
510#endif
511        lwz     r6, GP_CR-GP_19(r4)
512        lwz     r7, GP_PC-GP_19(r4)
513        lwz     r8, GP_MSR-GP_19(r4)
514        mtcrf   255, r6
515        mtlr    r7
516        mtmsr   r8
517#endif
518        blr
519
520/*
521 *  _CPU_Context_restore
522 *
523 *  This routine is generallu used only to restart self in an
524 *  efficient manner.  It may simply be a label in _CPU_Context_switch.
525 *
526 *  NOTE: May be unnecessary to reload some registers.
527 */
528/*
529 * ACB: Don't worry about cache optimisation here - this is not THAT critical.
530 */
531        ALIGN (PPC_CACHE_ALIGNMENT, PPC_CACHE_ALIGN_POWER)
532        PUBLIC_PROC (_CPU_Context_restore)
533PROC (_CPU_Context_restore):
534        lwz     r5, GP_CR(r3)
535        lwz     r6, GP_PC(r3)
536        lwz     r7, GP_MSR(r3)
537        mtcrf   255, r5
538        mtlr    r6
539        mtmsr   r7
540        lwz     r1, GP_1(r3)
541        lwz     r2, GP_2(r3)
542#if (PPC_USE_MULTIPLE == 1)
543        lmw     r13, GP_13(r3)
544#else
545        lwz     r13, GP_13(r3)
546        lwz     r14, GP_14(r3)
547        lwz     r15, GP_15(r3)
548        lwz     r16, GP_16(r3)
549        lwz     r17, GP_17(r3)
550        lwz     r18, GP_18(r3)
551        lwz     r19, GP_19(r3)
552        lwz     r20, GP_20(r3)
553        lwz     r21, GP_21(r3)
554        lwz     r22, GP_22(r3)
555        lwz     r23, GP_23(r3)
556        lwz     r24, GP_24(r3)
557        lwz     r25, GP_25(r3)
558        lwz     r26, GP_26(r3)
559        lwz     r27, GP_27(r3)
560        lwz     r28, GP_28(r3)
561        lwz     r29, GP_29(r3)
562        lwz     r30, GP_30(r3)
563        lwz     r31, GP_31(r3)
564#endif
565
566        blr
567
568/*  Individual interrupt prologues look like this:
569 * #if (PPC_ABI == PPC_ABI_POWEROPEN || PPC_ABI == PPC_ABI_GCC27)
570 * #if (PPC_HAS_FPU)
571 *      stwu    r1, -(20*4 + 18*8 + IP_END)(r1)
572 * #else
573 *      stwu    r1, -(20*4 + IP_END)(r1)
574 * #endif
575 * #else
576 *      stwu    r1, -(IP_END)(r1)
577 * #endif
578 *      stw     r0, IP_0(r1)
579 *
580 *      li      r0, vectornum
581 *      b       PROC (_ISR_Handler{,C})
582 */
583
584/*  void __ISR_Handler()
585 *
586 *  This routine provides the RTEMS interrupt management.
587 *  The vector number is in r0. R0 has already been stacked.
588 *
589 */
590        ALIGN (PPC_CACHE_ALIGNMENT, PPC_CACHE_ALIGN_POWER)
591        PUBLIC_PROC (_ISR_Handler)
592PROC (_ISR_Handler):
593#define LABEL(x)        x
594/*  XXX ??
595#define MTSAVE(x)       mtspr   sprg0, x
596#define MFSAVE(x)       mfspr   x, sprg0
597*/
598#define MTPC(x)         mtspr   srr0, x
599#define MFPC(x)         mfspr   x, srr0
600#define MTMSR(x)        mtspr   srr1, x
601#define MFMSR(x)        mfspr   x, srr1
602
603        #include        "irq_stub.S"
604        rfi
605
606#if (PPC_HAS_RFCI == 1)
607/*  void __ISR_HandlerC()
608 *
609 *  This routine provides the RTEMS interrupt management.
610 *  For critical interrupts
611 *
612 */
613        ALIGN (PPC_CACHE_ALIGNMENT, PPC_CACHE_ALIGN_POWER)
614        PUBLIC_PROC (_ISR_HandlerC)
615PROC (_ISR_HandlerC):
616#undef  LABEL
617#undef  MTSAVE
618#undef  MFSAVE
619#undef  MTPC
620#undef  MFPC
621#undef  MTMSR
622#undef  MFMSR
623#define LABEL(x)        x##_C
624/* XXX??
625#define MTSAVE(x)       mtspr   sprg1, x
626#define MFSAVE(x)       mfspr   x, sprg1
627*/
628#define MTPC(x)         mtspr   srr2, x
629#define MFPC(x)         mfspr   x, srr2
630#define MTMSR(x)        mtspr   srr3, x
631#define MFMSR(x)        mfspr   x, srr3
632        #include        "irq_stub.S"
633        rfci
634#endif
635
636/*  PowerOpen descriptors for indirect function calls.
637 */
638
639#if (PPC_ABI == PPC_ABI_POWEROPEN)
640        DESCRIPTOR (_CPU_Context_save_fp)
641        DESCRIPTOR (_CPU_Context_restore_fp)
642        DESCRIPTOR (_CPU_Context_switch)
643        DESCRIPTOR (_CPU_Context_restore)
644        DESCRIPTOR (_ISR_Handler)
645#if (PPC_HAS_RFCI == 1)
646        DESCRIPTOR (_ISR_HandlerC)
647#endif
648#endif
Note: See TracBrowser for help on using the repository browser.