source: rtems/c/src/lib/libcpu/sh/shgdb/score/cpu_asm.c @ 3d0af835

4.115
Last change on this file since 3d0af835 was 3d0af835, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/11/11 at 09:57:25

2011-02-11 Ralf Corsépius <ralf.corsepius@…>

  • sh7032/delay/delay.c, sh7032/score/cpu_asm.c, sh7032/score/ispsh7032.c, sh7045/sci/sci.c, sh7045/sci/sci_termios.c, sh7045/score/cpu_asm.c, sh7045/score/ispsh7045.c, sh7750/sci/sh4uart.c, sh7750/score/cpu_asm.c, sh7750/score/ispsh7750.c, shgdb/score/cpu_asm.c, shgdb/score/ispshgdb.c: Use "asm" instead of "asm" for improved c99-compliance.
  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 *  Support for SuperH Simulator in GDB
3 *
4 *  COPYRIGHT (c) 1989-2008.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 *
11 *  $Id$
12 */
13
14#include <rtems/system.h>
15#include <rtems/score/cpu.h>
16#include <rtems/score/isr.h>
17#include <rtems/score/thread.h>
18#include <rtems/score/sh.h>
19
20#if (CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE)
21  unsigned long    *_old_stack_ptr;
22#endif
23
24register unsigned long  *stack_ptr __asm__ ("r15");
25
26/*
27 *  This routine provides the RTEMS interrupt management.
28 */
29
30void __ISR_Handler( uint32_t   vector)
31{
32  ISR_Level level;
33
34  _ISR_Disable( level );
35
36  _Thread_Dispatch_disable_level++;
37
38#if (CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE)
39  if ( _ISR_Nest_level == 0 )
40    {
41      /* Install irq stack */
42      _old_stack_ptr = stack_ptr;
43      stack_ptr = _CPU_Interrupt_stack_high;
44    }
45
46#endif
47
48  _ISR_Nest_level++;
49
50  _ISR_Enable( level );
51
52  /* call isp */
53  if ( _ISR_Vector_table[ vector])
54    (*_ISR_Vector_table[ vector ])( vector );
55
56  _ISR_Disable( level );
57
58  _Thread_Dispatch_disable_level--;
59
60  _ISR_Nest_level--;
61
62#if (CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE)
63
64  if ( _ISR_Nest_level == 0 )
65    /* restore old stack pointer */
66    stack_ptr = _old_stack_ptr;
67#endif
68
69  _ISR_Enable( level );
70
71  if ( _ISR_Nest_level )
72    return;
73
74  if ( _Thread_Dispatch_disable_level ) {
75    return;
76  }
77
78  if ( _Thread_Dispatch_necessary ) {
79    _Thread_Dispatch();
80  }
81}
Note: See TracBrowser for help on using the repository browser.