source: rtems/cpukit/score/src/isr.c @ 2d7ae960

4.115
Last change on this file since 2d7ae960 was 61baacce, checked in by Joel Sherrill <joel.sherrill@…>, on 06/11/12 at 17:27:31

isr.c: Do not call _CPU_Initialize_vectors() if PIC Interrupt Model

  • Property mode set to 100644
File size: 1.9 KB
Line 
1/**
2 *  @file
3 *
4 *  ISR Handler Initialization
5 */
6
7/*
8 *  COPYRIGHT (c) 1989-2012.
9 *  On-Line Applications Research Corporation (OAR).
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.com/license/LICENSE.
14 */
15
16#if HAVE_CONFIG_H
17#include "config.h"
18#endif
19
20#include <rtems/system.h>
21#include <rtems/score/isr.h>
22#include <rtems/score/stack.h>
23#include <rtems/score/interr.h>
24#include <rtems/score/wkspace.h>
25#include <rtems/config.h>
26
27/*  _ISR_Handler_initialization
28 *
29 *  This routine initializes the ISR handler.
30 *
31 *  Input parameters: NONE
32 *
33 *  Output parameters: NONE
34 */
35
36void _ISR_Handler_initialization( void )
37{
38  _ISR_Nest_level = 0;
39
40#if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE)
41  _ISR_Vector_table = _Workspace_Allocate_or_fatal_error(
42     sizeof(ISR_Handler_entry) * ISR_NUMBER_OF_VECTORS
43  );
44
45  _CPU_Initialize_vectors();
46#endif
47
48#if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE )
49
50  if ( !_Stack_Is_enough(Configuration.interrupt_stack_size) )
51    _Internal_error_Occurred(
52      INTERNAL_ERROR_CORE,
53      true,
54      INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL
55    );
56
57  _CPU_Interrupt_stack_low = _Workspace_Allocate_or_fatal_error(
58    Configuration.interrupt_stack_size
59  );
60
61  _CPU_Interrupt_stack_high = _Addresses_Add_offset(
62    _CPU_Interrupt_stack_low,
63    Configuration.interrupt_stack_size
64  );
65
66#if (CPU_STACK_ALIGNMENT != 0)
67  _CPU_Interrupt_stack_high = (void *)
68    ((uintptr_t) _CPU_Interrupt_stack_high & ~(CPU_STACK_ALIGNMENT - 1));
69#endif
70
71  /* Interrupt stack might have to be aligned and/or setup
72   * in a specific way.
73   */
74#if defined(_CPU_Interrupt_stack_setup)
75  _CPU_Interrupt_stack_setup(_CPU_Interrupt_stack_low, _CPU_Interrupt_stack_high);
76#endif
77
78#endif
79
80#if ( CPU_HAS_HARDWARE_INTERRUPT_STACK == TRUE )
81  _CPU_Install_interrupt_stack();
82#endif
83
84#if defined(RTEMS_SMP)
85  _ISR_SMP_Initialize();
86#endif
87}
Note: See TracBrowser for help on using the repository browser.