source: rtems/c/src/lib/libcpu/sh/shgdb/score/cpu_asm.c @ 6a046fe0

4.104.115
Last change on this file since 6a046fe0 was 6a046fe0, checked in by Joel Sherrill <joel.sherrill@…>, on 05/21/10 at 16:33:00

2010-05-21 Joel Sherrill <joel.sherrill@…>

  • sh7032/score/cpu_asm.c, sh7045/score/cpu_asm.c, sh7750/score/cpu_asm.c, shgdb/score/cpu_asm.c: Spacing.
  • Property mode set to 100644
File size: 1.7 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    _ISR_Signals_to_thread_executing = FALSE;
76    return;
77  }
78
79  if ( _Context_Switch_necessary || _ISR_Signals_to_thread_executing ) {
80    _ISR_Signals_to_thread_executing = FALSE;
81    _Thread_Dispatch();
82  }
83}
Note: See TracBrowser for help on using the repository browser.