source: rtems/c/src/lib/libcpu/powerpc/old-exceptions/cpu.c @ 185da08

4.104.114.84.95
Last change on this file since 185da08 was 185da08, checked in by Thomas Doerfler <Thomas.Doerfler@…>, on 07/10/07 at 18:43:12

additional fixes for the shared exception code

  • Property mode set to 100644
File size: 20.0 KB
Line 
1/*
2 *  PowerPC CPU Dependent Source
3 *
4 *  Author:     Andrew Bray <andy@i-cubed.co.uk>
5 *
6 *  COPYRIGHT (c) 1995 by i-cubed ltd.
7 *
8 *  To anyone who acknowledges that this file is provided "AS IS"
9 *  without any express or implied warranty:
10 *      permission to use, copy, modify, and distribute this file
11 *      for any purpose is hereby granted without fee, provided that
12 *      the above copyright notice and this notice appears in all
13 *      copies, and that the name of i-cubed limited not be used in
14 *      advertising or publicity pertaining to distribution of the
15 *      software without specific, written prior permission.
16 *      i-cubed limited makes no representations about the suitability
17 *      of this software for any purpose.
18 *
19 *  Derived from c/src/exec/cpu/no_cpu/cpu.c:
20 *
21 *  COPYRIGHT (c) 1989-1997.
22 *  On-Line Applications Research Corporation (OAR).
23 *
24 *  The license and distribution terms for this file may be found in
25 *  the file LICENSE in this distribution or at
26 *  http://www.rtems.com/license/LICENSE.
27 *
28 *  $Id$
29 */
30
31#include <bsp.h>
32#include <rtems/system.h>
33#include <rtems/score/isr.h>
34#include <rtems/score/context.h>
35#include <rtems/score/thread.h>
36#include <rtems/score/interr.h>
37
38#include <rtems/powerpc/cache.h>
39#include <rtems/powerpc/powerpc.h>
40
41/*
42 *  These are for testing purposes.
43 */
44
45/*  _CPU_Initialize
46 *
47 *  This routine performs processor dependent initialization.
48 *
49 *  INPUT PARAMETERS:
50 *    cpu_table       - CPU table to initialize
51 *    thread_dispatch - address of disptaching routine
52 */
53
54static void ppc_spurious(int, CPU_Interrupt_frame *);
55
56int _CPU_spurious_count = 0;
57int _CPU_last_spurious = 0;
58
59void _CPU_Initialize(
60  rtems_cpu_table  *cpu_table,
61  void      (*thread_dispatch)      /* ignored on this CPU */
62)
63{
64#if (PPC_USE_SPRG)
65  int i;
66#endif
67  register uint32_t   r2 = 0;
68  register uint32_t   r13 = 0;
69
70  asm ("mr %0,13" : "=r" ((r13)) : "0" ((r13)));
71  _CPU_IRQ_info.Default_r13 = r13;
72
73  asm ("mr %0,2" : "=r" ((r2)) : "0" ((r2)));
74  _CPU_IRQ_info.Default_r2 = r2;
75
76  _CPU_IRQ_info.Nest_level = &_ISR_Nest_level;
77  _CPU_IRQ_info.Disable_level = &_Thread_Dispatch_disable_level;
78  /* fill in _CPU_IRQ_info.Vector_table later */
79  _CPU_IRQ_info.Switch_necessary = &_Context_Switch_necessary;
80  _CPU_IRQ_info.Signal = &_ISR_Signals_to_thread_executing;
81
82#if (PPC_USE_SPRG)
83  i = (int)&_CPU_IRQ_info;
84  asm volatile("mtspr 0x113, %0" : "=r" (i) : "0" (i)); /* SPRG 3 */
85#endif
86
87  /*
88   * Store Msr Value in the IRQ info structure.
89   */
90   _CPU_MSR_GET(_CPU_IRQ_info.msr_initial);
91
92#if (PPC_USE_SPRG)
93  i = _CPU_IRQ_info.msr_initial;
94  asm volatile("mtspr 0x112, %0" : "=r" (i) : "0" (i)); /* SPRG 2 */
95#endif
96
97  _CPU_Table = *cpu_table;
98}
99
100/*
101 *  _CPU_Initialize_vectors()
102 *
103 *  Support routine to initialize the RTEMS vector table after it is allocated.
104 *
105 *  PowerPC Specific Information:
106 *
107 *  Complete initialization since the table is now allocated.
108 */
109
110void _CPU_Initialize_vectors(void)
111{
112  int i;
113  proc_ptr handler = (proc_ptr)ppc_spurious;
114
115  _CPU_IRQ_info.Vector_table = _ISR_Vector_table;
116
117  if ( _CPU_Table.spurious_handler )
118    handler = (proc_ptr)_CPU_Table.spurious_handler;
119
120  for (i = 0; i < PPC_INTERRUPT_MAX;  i++)
121    _ISR_Vector_table[i] = handler;
122
123}
124
125/*PAGE
126 *
127 *  _CPU_ISR_Calculate_level
128 *
129 *  The PowerPC puts its interrupt enable status in the MSR register
130 *  which also contains things like endianness control.  To be more
131 *  awkward, the layout varies from processor to processor.  This
132 *  is why it was necessary to adopt a scheme which allowed the user
133 *  to specify specifically which interrupt sources were enabled.
134 */
135
136uint32_t   _CPU_ISR_Calculate_level(
137  uint32_t   new_level
138)
139{
140  register uint32_t   new_msr = 0;
141
142  /*
143   *  Set the critical interrupt enable bit
144   */
145
146#if (PPC_HAS_RFCI)
147  if ( !(new_level & PPC_INTERRUPT_LEVEL_CE) )
148    new_msr |= PPC_MSR_CE;
149#endif
150
151  if ( !(new_level & PPC_INTERRUPT_LEVEL_ME) )
152    new_msr |= PPC_MSR_ME;
153
154  if ( !(new_level & PPC_INTERRUPT_LEVEL_EE) )
155    new_msr |= PPC_MSR_EE;
156
157  return new_msr;
158}
159
160/*PAGE
161 *
162 *  _CPU_ISR_Set_level
163 *
164 *  This routine sets the requested level in the MSR.
165 */
166
167void _CPU_ISR_Set_level(
168  uint32_t   new_level
169)
170{
171  register uint32_t   tmp = 0;
172  register uint32_t   new_msr;
173
174  new_msr = _CPU_ISR_Calculate_level( new_level );
175
176  asm volatile (
177    "mfmsr %0; andc %0,%0,%1; and %2, %2, %1; or %0, %0, %2; mtmsr %0" :
178    "=&r" ((tmp)) :
179    "r" ((PPC_MSR_DISABLE_MASK)), "r" ((new_msr)), "0" ((tmp))
180  );
181}
182
183/*PAGE
184 *
185 *  _CPU_ISR_Get_level
186 *
187 *  This routine gets the current interrupt level from the MSR and
188 *  converts it to an RTEMS interrupt level.
189 */
190
191uint32_t   _CPU_ISR_Get_level( void )
192{
193  uint32_t   level = 0;
194  uint32_t   msr;
195
196  asm volatile("mfmsr %0" : "=r" ((msr)));
197
198  msr &= PPC_MSR_DISABLE_MASK;
199
200  /*
201   *  Set the critical interrupt enable bit
202   */
203
204#if (PPC_HAS_RFCI)
205  if ( !(msr & PPC_MSR_CE) )
206    level |= PPC_INTERRUPT_LEVEL_CE;
207#endif
208
209  if ( !(msr & PPC_MSR_ME) )
210    level |= PPC_INTERRUPT_LEVEL_ME;
211
212  if ( !(msr & PPC_MSR_EE) )
213    level |= PPC_INTERRUPT_LEVEL_EE;
214
215  return level;
216}
217
218/*PAGE
219 *
220 *  _CPU_Context_Initialize
221 */
222
223void _CPU_Context_Initialize(
224  Context_Control  *the_context,
225  uint32_t         *stack_base,
226  uint32_t          size,
227  uint32_t          new_level,
228  void             *entry_point,
229  boolean           is_fp
230)
231{
232  uint32_t   msr_value;
233  uint32_t   sp;
234
235  sp = (uint32_t)stack_base + size - PPC_MINIMUM_STACK_FRAME_SIZE;
236  *((uint32_t*)sp) = 0;
237  the_context->gpr1 = sp;
238
239  the_context->msr = _CPU_ISR_Calculate_level( new_level );
240
241  /*
242   *  The FP bit of the MSR should only be enabled if this is a floating
243   *  point task.  Unfortunately, the vfprintf_r routine in newlib
244   *  ends up pushing a floating point register regardless of whether or
245   *  not a floating point number is being printed.  Serious restructuring
246   *  of vfprintf.c will be required to avoid this behavior.  At this
247   *  time (7 July 1997), this restructuring is not being done.
248   */
249
250  /*if ( is_fp ) */
251    the_context->msr |= PPC_MSR_FP;
252
253  /*
254   *  Calculate the task's MSR value:
255   *
256   *     + Set the exception prefix bit to point to the exception table
257   *     + Force the RI bit
258   *     + Use the DR and IR bits
259   */
260  _CPU_MSR_GET( msr_value );
261  the_context->msr |= (msr_value & PPC_MSR_EP);
262#if defined(PPC_MSR_RI)
263  the_context->msr |= PPC_MSR_RI;
264#endif
265  the_context->msr |= msr_value & (PPC_MSR_DR|PPC_MSR_IR);
266
267#if (PPC_ABI == PPC_ABI_SVR4)
268  { unsigned    r13 = 0;
269    asm volatile ("mr %0, 13" : "=r" ((r13)));
270
271    the_context->pc = (uint32_t)entry_point;
272    the_context->gpr13 = r13;
273  }
274#endif
275
276#if (PPC_ABI == PPC_ABI_EABI)
277  { uint32_t    r2 = 0;
278    unsigned    r13 = 0;
279    asm volatile ("mr %0,2; mr %1,13" : "=r" ((r2)), "=r" ((r13)));
280
281    the_context->pc = (uint32_t)entry_point;
282    the_context->gpr2 = r2;
283    the_context->gpr13 = r13;
284  }
285#endif
286}
287
288/*  _CPU_ISR_install_vector
289 *
290 *  This kernel routine installs the RTEMS handler for the
291 *  specified vector.
292 *
293 *  Input parameters:
294 *    vector      - interrupt vector number
295 *    old_handler - former ISR for this vector number
296 *    new_handler - replacement ISR for this vector number
297 *
298 *  Output parameters:  NONE
299 *
300 */
301
302void _CPU_ISR_install_vector(
303  uint32_t    vector,
304  proc_ptr    new_handler,
305  proc_ptr   *old_handler
306)
307{
308   proc_ptr   ignored;
309   *old_handler = _ISR_Vector_table[ vector ];
310
311   /*
312    *  If the interrupt vector table is a table of pointer to isr entry
313    *  points, then we need to install the appropriate RTEMS interrupt
314    *  handler for this vector number.
315    */
316
317   /*
318    * Install the wrapper so this ISR can be invoked properly.
319    */
320   if (_CPU_Table.exceptions_in_RAM)
321      _CPU_ISR_install_raw_handler( vector, _ISR_Handler, &ignored );
322
323   /*
324    *  We put the actual user ISR address in '_ISR_vector_table'.  This will
325    *  be used by the _ISR_Handler so the user gets control.
326    */
327
328    _ISR_Vector_table[ vector ] = new_handler ? (ISR_Handler_entry)new_handler :
329       _CPU_Table.spurious_handler ?
330          (ISR_Handler_entry)_CPU_Table.spurious_handler :
331          (ISR_Handler_entry)ppc_spurious;
332}
333
334/*PAGE
335 *
336 *  _CPU_Install_interrupt_stack
337 */
338
339void _CPU_Install_interrupt_stack( void )
340{
341/* PPC_ABI_EABI */
342  _CPU_IRQ_info.Stack = _CPU_Interrupt_stack_high - 8;
343}
344
345/* Handle a spurious interrupt */
346static void ppc_spurious(int v, CPU_Interrupt_frame *i)
347{
348#if 0
349    printf("Spurious interrupt on vector %d from %08.8x\n",
350           v, i->pc);
351#endif
352#if defined(ppc403) || defined(ppc405)
353    if (v == PPC_IRQ_EXTERNAL)
354        {
355            register int r = 0;
356
357            asm volatile("mtdcr 0x42, %0" :
358                "=&r" ((r)) : "0" ((r))); /* EXIER */
359        }
360    else if (v == PPC_IRQ_PIT)
361        {
362            register int r = 0x08000000;
363
364            asm volatile("mtspr 0x3d8, %0" :
365                "=&r" ((r)) : "0" ((r))); /* TSR */
366        }
367    else if (v == PPC_IRQ_FIT)
368        {
369            register int r = 0x04000000;
370
371            asm volatile("mtspr 0x3d8, %0" :
372                "=&r" ((r)) : "0" ((r))); /* TSR */
373        }
374#endif
375    ++_CPU_spurious_count;
376    _CPU_last_spurious = v;
377}
378
379void _CPU_Fatal_error(uint32_t   _error)
380{
381  asm volatile ("mr 3, %0" : : "r" ((_error)));
382  asm volatile ("tweq 5,5");
383  asm volatile ("li 0,0; mtmsr 0");
384  while (1) ;
385}
386
387#define PPC_SYNCHRONOUS_TRAP_BIT_MASK    0x100
388#define PPC_ASYNCHRONOUS_TRAP( _trap ) (_trap)
389#define PPC_SYNCHRONOUS_TRAP ( _trap ) ((_trap)+PPC_SYNCHRONOUS_TRAP_BIT_MASK)
390#define PPC_REAL_TRAP_NUMBER ( _trap ) ((_trap)%PPC_SYNCHRONOUS_TRAP_BIT_MASK)
391
392const CPU_Trap_table_entry _CPU_Trap_slot_template = {
393
394  0x9421ff90,           /* stwu    r1, -(IP_END)(r1)            */
395
396  0x90010008,           /* stw   %r0, IP_0(%r1)                 */
397  0x38000000,           /* li    %r0, PPC_IRQ                   */
398  0x48000002            /* ba    PROC (_ISR_Handler)            */
399};
400
401#if defined(mpc860) || defined(mpc821)
402const CPU_Trap_table_entry _CPU_Trap_slot_template_m860 = {
403  0x7c0803ac,           /* mtlr  %r0                            */
404  0x81210028,           /* lwz   %r9, IP_9(%r1)                 */
405  0x38000000,           /* li    %r0, PPC_IRQ                   */
406  0x48000002            /* b     PROC (_ISR_Handler)            */
407};
408#endif /* mpc860 */
409
410uint32_t    ppc_exception_vector_addr(
411  uint32_t   vector
412);
413
414/*PAGE
415 *
416 *  _CPU_ISR_install_raw_handler
417 *
418 *  This routine installs the specified handler as a "raw" non-executive
419 *  supported trap handler (a.k.a. interrupt service routine).
420 *
421 *  Input Parameters:
422 *    vector      - trap table entry number plus synchronous
423 *                    vs. asynchronous information
424 *    new_handler - address of the handler to be installed
425 *    old_handler - pointer to an address of the handler previously installed
426 *
427 *  Output Parameters: NONE
428 *    *new_handler - address of the handler previously installed
429 *
430 *  NOTE:
431 *
432 *  This routine is based on the SPARC routine _CPU_ISR_install_raw_handler.
433 *  Install a software trap handler as an executive interrupt handler
434 *  (which is desirable since RTEMS takes care of window and register issues),
435 *  then the executive needs to know that the return address is to the trap
436 *  rather than the instruction following the trap.
437 *
438 */
439
440void _CPU_ISR_install_raw_handler(
441  uint32_t    vector,
442  proc_ptr    new_handler,
443  proc_ptr   *old_handler
444)
445{
446  uint32_t               real_vector;
447  CPU_Trap_table_entry  *slot;
448  uint32_t               u32_handler=0;
449
450  /*
451   *  Get the "real" trap number for this vector ignoring the synchronous
452   *  versus asynchronous indicator included with our vector numbers.
453   */
454
455  real_vector = vector;
456
457  /*
458   *  Get the current base address of the trap table and calculate a pointer
459   *  to the slot we are interested in.
460   */
461  slot = (CPU_Trap_table_entry  *)ppc_exception_vector_addr( real_vector );
462
463  /*
464   *  Get the address of the old_handler from the trap table.
465   *
466   *  NOTE: The old_handler returned will be bogus if it does not follow
467   *        the RTEMS model.
468   */
469
470#define HIGH_BITS_MASK   0xFFFFFC00
471#define HIGH_BITS_SHIFT  10
472#define LOW_BITS_MASK    0x000003FF
473
474  if (slot->stwu_r1 == _CPU_Trap_slot_template.stwu_r1) {
475    /*
476     * Set u32_handler = to target address
477     */
478    u32_handler = slot->b_Handler & 0x03fffffc;
479
480    /* IMD FIX: sign extend address fragment... */
481    if (u32_handler & 0x02000000) {
482      u32_handler  |= 0xfc000000;
483    }
484
485    *old_handler =  (proc_ptr) u32_handler;
486  } else
487/* There are two kinds of handlers for the MPC860. One is the 'standard'
488 *  one like above. The other is for the cascaded interrupts from the SIU
489 *  and CPM. Therefore we must check for the alternate one if the standard
490 *  one is not present
491 */
492#if defined(mpc860) || defined(mpc821)
493  if (slot->stwu_r1 == _CPU_Trap_slot_template_m860.stwu_r1) {
494    /*
495     * Set u32_handler = to target address
496     */
497    u32_handler = slot->b_Handler & 0x03fffffc;
498    *old_handler =  (proc_ptr) u32_handler;
499  } else
500#endif /* mpc860 */
501
502    *old_handler = 0;
503
504  /*
505   *  Copy the template to the slot and then fix it.
506   */
507#if defined(mpc860) || defined(mpc821)
508  if (vector >= PPC_IRQ_IRQ0)
509    *slot = _CPU_Trap_slot_template_m860;
510  else
511#endif /* mpc860 */
512  *slot = _CPU_Trap_slot_template;
513
514  u32_handler = (uint32_t) new_handler;
515
516  /*
517   * IMD FIX: insert address fragment only (bits 6..29)
518   *          therefore check for proper address range
519   *          and remove unwanted bits
520   */
521  if ((u32_handler & 0xfc000000) == 0xfc000000) {
522    u32_handler  &= ~0xfc000000;
523  }
524  else if ((u32_handler & 0xfc000000) != 0x00000000) {
525    _Internal_error_Occurred(INTERNAL_ERROR_CORE,
526                             TRUE,
527                             u32_handler);
528  }
529
530  slot->b_Handler |= u32_handler;
531
532  slot->li_r0_IRQ  |= vector;
533
534  _CPU_Data_Cache_Block_Flush( slot );
535}
536
537uint32_t    ppc_exception_vector_addr(
538  uint32_t   vector
539)
540{
541#if (!PPC_HAS_EVPR)
542  uint32_t   Msr;
543#endif
544  uint32_t   Top = 0;
545  uint32_t   Offset = 0x000;
546
547#if (PPC_HAS_EXCEPTION_PREFIX)
548  _CPU_MSR_GET ( Msr );
549  if ( ( Msr & PPC_MSR_EP) != 0 ) /* Vectors at FFFx_xxxx */
550    Top = 0xfff00000;
551#elif (PPC_HAS_EVPR)
552  asm volatile( "mfspr %0,0x3d6" : "=r" (Top)); /* EVPR */
553  Top = Top & 0xffff0000;
554#endif
555
556  switch ( vector ) {
557    case PPC_IRQ_SYSTEM_RESET:   /* on 40x aka PPC_IRQ_CRIT */
558      Offset = 0x00100;
559      break;
560    case PPC_IRQ_MCHECK:
561      Offset = 0x00200;
562      break;
563    case PPC_IRQ_PROTECT:
564      Offset = 0x00300;
565      break;
566    case PPC_IRQ_ISI:
567      Offset = 0x00400;
568      break;
569    case PPC_IRQ_EXTERNAL:
570      Offset = 0x00500;
571      break;
572    case PPC_IRQ_ALIGNMENT:
573      Offset = 0x00600;
574      break;
575    case PPC_IRQ_PROGRAM:
576      Offset = 0x00700;
577      break;
578    case PPC_IRQ_NOFP:
579      Offset = 0x00800;
580      break;
581    case PPC_IRQ_DECREMENTER:
582      Offset = 0x00900;
583      break;
584    case PPC_IRQ_RESERVED_A:
585      Offset = 0x00a00;
586      break;
587    case PPC_IRQ_RESERVED_B:
588      Offset = 0x00b00;
589      break;
590    case PPC_IRQ_SCALL:
591      Offset = 0x00c00;
592      break;
593    case PPC_IRQ_TRACE:
594      Offset = 0x00d00;
595      break;
596    case PPC_IRQ_FP_ASST:
597      Offset = 0x00e00;
598      break;
599
600#if defined(ppc403) || defined(ppc405)
601
602/*  PPC_IRQ_CRIT is the same vector as PPC_IRQ_RESET
603    case PPC_IRQ_CRIT:
604      Offset = 0x00100;
605      break;
606*/
607    case PPC_IRQ_PIT:
608      Offset = 0x01000;
609      break;
610    case PPC_IRQ_FIT:
611      Offset = 0x01010;
612      break;
613    case PPC_IRQ_WATCHDOG:
614      Offset = 0x01020;
615      break;
616    case PPC_IRQ_DEBUG:
617      Offset = 0x02000;
618      break;
619
620#elif defined(ppc601)
621    case PPC_IRQ_TRACE:
622      Offset = 0x02000;
623      break;
624
625#elif defined(ppc603) || defined(ppc603e)
626    case PPC_IRQ_TRANS_MISS:
627      Offset = 0x1000;
628      break;
629    case PPC_IRQ_DATA_LOAD:
630      Offset = 0x1100;
631      break;
632    case PPC_IRQ_DATA_STORE:
633      Offset = 0x1200;
634      break;
635    case PPC_IRQ_ADDR_BRK:
636      Offset = 0x1300;
637      break;
638    case PPC_IRQ_SYS_MGT:
639      Offset = 0x1400;
640      break;
641
642#elif defined(mpc604)
643    case PPC_IRQ_ADDR_BRK:
644      Offset = 0x1300;
645      break;
646    case PPC_IRQ_SYS_MGT:
647      Offset = 0x1400;
648      break;
649
650#elif defined(mpc860) || defined(mpc821)
651    case PPC_IRQ_EMULATE:
652      Offset = 0x1000;
653      break;
654    case PPC_IRQ_INST_MISS:
655      Offset = 0x1100;
656      break;
657    case PPC_IRQ_DATA_MISS:
658      Offset = 0x1200;
659      break;
660    case PPC_IRQ_INST_ERR:
661      Offset = 0x1300;
662      break;
663    case PPC_IRQ_DATA_ERR:
664      Offset = 0x1400;
665      break;
666    case PPC_IRQ_DATA_BPNT:
667      Offset = 0x1c00;
668      break;
669    case PPC_IRQ_INST_BPNT:
670      Offset = 0x1d00;
671      break;
672    case PPC_IRQ_IO_BPNT:
673      Offset = 0x1e00;
674      break;
675    case PPC_IRQ_DEV_PORT:
676      Offset = 0x1f00;
677      break;
678    case PPC_IRQ_IRQ0:
679      Offset = 0x2000;
680      break;
681    case PPC_IRQ_LVL0:
682      Offset = 0x2040;
683      break;
684    case PPC_IRQ_IRQ1:
685      Offset = 0x2080;
686      break;
687    case PPC_IRQ_LVL1:
688      Offset = 0x20c0;
689      break;
690    case PPC_IRQ_IRQ2:
691      Offset = 0x2100;
692      break;
693    case PPC_IRQ_LVL2:
694      Offset = 0x2140;
695      break;
696    case PPC_IRQ_IRQ3:
697      Offset = 0x2180;
698      break;
699    case PPC_IRQ_LVL3:
700      Offset = 0x21c0;
701      break;
702    case PPC_IRQ_IRQ4:
703      Offset = 0x2200;
704      break;
705    case PPC_IRQ_LVL4:
706      Offset = 0x2240;
707      break;
708    case PPC_IRQ_IRQ5:
709      Offset = 0x2280;
710      break;
711    case PPC_IRQ_LVL5:
712      Offset = 0x22c0;
713      break;
714    case PPC_IRQ_IRQ6:
715      Offset = 0x2300;
716      break;
717    case PPC_IRQ_LVL6:
718      Offset = 0x2340;
719      break;
720    case PPC_IRQ_IRQ7:
721      Offset = 0x2380;
722      break;
723    case PPC_IRQ_LVL7:
724      Offset = 0x23c0;
725      break;
726    case PPC_IRQ_CPM_ERROR:
727      Offset = 0x2400;
728      break;
729    case PPC_IRQ_CPM_PC4:
730      Offset = 0x2410;
731      break;
732    case PPC_IRQ_CPM_PC5:
733      Offset = 0x2420;
734      break;
735    case PPC_IRQ_CPM_SMC2:
736      Offset = 0x2430;
737      break;
738    case PPC_IRQ_CPM_SMC1:
739      Offset = 0x2440;
740      break;
741    case PPC_IRQ_CPM_SPI:
742      Offset = 0x2450;
743      break;
744    case PPC_IRQ_CPM_PC6:
745      Offset = 0x2460;
746      break;
747    case PPC_IRQ_CPM_TIMER4:
748      Offset = 0x2470;
749      break;
750    case PPC_IRQ_CPM_RESERVED_8:
751      Offset = 0x2480;
752      break;
753    case PPC_IRQ_CPM_PC7:
754      Offset = 0x2490;
755      break;
756    case PPC_IRQ_CPM_PC8:
757      Offset = 0x24a0;
758      break;
759    case PPC_IRQ_CPM_PC9:
760      Offset = 0x24b0;
761      break;
762    case PPC_IRQ_CPM_TIMER3:
763      Offset = 0x24c0;
764      break;
765    case PPC_IRQ_CPM_RESERVED_D:
766      Offset = 0x24d0;
767      break;
768    case PPC_IRQ_CPM_PC10:
769      Offset = 0x24e0;
770      break;
771    case PPC_IRQ_CPM_PC11:
772      Offset = 0x24f0;
773      break;
774    case PPC_IRQ_CPM_I2C:
775      Offset = 0x2500;
776      break;
777    case PPC_IRQ_CPM_RISC_TIMER:
778      Offset = 0x2510;
779      break;
780    case PPC_IRQ_CPM_TIMER2:
781      Offset = 0x2520;
782      break;
783    case PPC_IRQ_CPM_RESERVED_13:
784      Offset = 0x2530;
785      break;
786    case PPC_IRQ_CPM_IDMA2:
787      Offset = 0x2540;
788      break;
789    case PPC_IRQ_CPM_IDMA1:
790      Offset = 0x2550;
791      break;
792    case PPC_IRQ_CPM_SDMA_ERROR:
793      Offset = 0x2560;
794      break;
795    case PPC_IRQ_CPM_PC12:
796      Offset = 0x2570;
797      break;
798    case PPC_IRQ_CPM_PC13:
799      Offset = 0x2580;
800      break;
801    case PPC_IRQ_CPM_TIMER1:
802      Offset = 0x2590;
803      break;
804    case PPC_IRQ_CPM_PC14:
805      Offset = 0x25a0;
806      break;
807    case PPC_IRQ_CPM_SCC4:
808      Offset = 0x25b0;
809      break;
810    case PPC_IRQ_CPM_SCC3:
811      Offset = 0x25c0;
812      break;
813    case PPC_IRQ_CPM_SCC2:
814      Offset = 0x25d0;
815      break;
816    case PPC_IRQ_CPM_SCC1:
817      Offset = 0x25e0;
818      break;
819    case PPC_IRQ_CPM_PC15:
820      Offset = 0x25f0;
821      break;
822#endif
823
824  }
825  Top += Offset;
826  return Top;
827}
828
829/*PAGE
830 *
831 *  This is the PowerPC specific implementation of the routine which
832 *  returns TRUE if an interrupt is in progress.
833 *
834 *  NOTE: This is the same as the generic version. But since the
835 *        PowerPC is still supporting old and new exception processing
836 *        models and the new exception processing model has a hardware
837 *        way of doing this, we have to provide this capability here
838 *        for symmetry.
839 */
840
841boolean _ISR_Is_in_progress( void )
842{
843  return (_ISR_Nest_level != 0);
844}
845
846const unsigned int _PPC_MSR_DISABLE_MASK = PPC_MSR_DISABLE_MASK;
Note: See TracBrowser for help on using the repository browser.