source: rtems/cpukit/score/src/isr.c @ a936aa49

4.115
Last change on this file since a936aa49 was bf54252, checked in by Alexandre Devienne <deviennealexandre@…>, on 11/28/12 at 20:14:50

Score misc: Clean up Doxygen #4 (GCI 2012)

This patch is a task from GCI 2012 which improves the Doxygen
comments in the RTEMS source.

http://www.google-melange.com/gci/task/view/google/gci2012/7985215

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