source: rtems/cpukit/score/src/isr.c @ 11e8bc5

4.115
Last change on this file since 11e8bc5 was 11e8bc5, checked in by Joel Sherrill <joel.sherrill@…>, on 06/29/10 at 00:34:12

2010-06-28 Joel Sherrill <joel.sherrill@…>

PR 1573/cpukit

  • configure.ac, posix/src/killinfo.c, posix/src/psignalclearprocesssignals.c, posix/src/psignalsetprocesssignals.c, posix/src/psignalunblockthread.c, posix/src/pthreadcreate.c, posix/src/pthreadkill.c, posix/src/pthreadsigmask.c, rtems/src/signalsend.c, rtems/src/taskmode.c, score/Makefile.am, score/preinstall.am, score/include/rtems/system.h, score/include/rtems/score/context.h, score/include/rtems/score/isr.h, score/include/rtems/score/thread.h, score/src/isr.c, score/src/isrthreaddispatch.c, score/src/thread.c, score/src/threaddispatch.c, score/src/threadloadenv.c: Add a per cpu data structure which contains the information required by RTEMS for each CPU core. This encapsulates information such as thread executing, heir, idle and dispatch needed.
  • score/include/rtems/score/percpu.h, score/src/percpu.c: New files.
  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*
2 *  ISR Handler
3 *
4 *
5 *  COPYRIGHT (c) 1989-2008.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  $Id$
13 */
14
15#if HAVE_CONFIG_H
16#include "config.h"
17#endif
18
19#include <rtems/system.h>
20#include <rtems/score/isr.h>
21#include <rtems/score/stack.h>
22#include <rtems/score/interr.h>
23#include <rtems/score/wkspace.h>
24#include <rtems/config.h>
25
26/*  _ISR_Handler_initialization
27 *
28 *  This routine initializes the ISR handler.
29 *
30 *  Input parameters: NONE
31 *
32 *  Output parameters: NONE
33 */
34
35void _ISR_Handler_initialization( void )
36{
37  _ISR_Nest_level = 0;
38
39#if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE)
40  _ISR_Vector_table = _Workspace_Allocate_or_fatal_error(
41     sizeof(ISR_Handler_entry) * ISR_NUMBER_OF_VECTORS
42  );
43#endif
44
45  _CPU_Initialize_vectors();
46
47#if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE )
48
49  if ( !_Stack_Is_enough(Configuration.interrupt_stack_size) )
50    _Internal_error_Occurred(
51      INTERNAL_ERROR_CORE,
52      true,
53      INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL
54    );
55
56  _CPU_Interrupt_stack_low = _Workspace_Allocate_or_fatal_error(
57    Configuration.interrupt_stack_size
58  );
59
60  _CPU_Interrupt_stack_high = _Addresses_Add_offset(
61    _CPU_Interrupt_stack_low,
62    Configuration.interrupt_stack_size
63  );
64
65  _CPU_Interrupt_stack_high = (void *)
66    ((uintptr_t) _CPU_Interrupt_stack_high & ~CPU_STACK_ALIGNMENT);
67
68  /* Interrupt stack might have to be aligned and/or setup
69   * in a specific way.
70   */
71#if defined(_CPU_Interrupt_stack_setup)
72  _CPU_Interrupt_stack_setup(_CPU_Interrupt_stack_low, _CPU_Interrupt_stack_high);
73#endif
74
75#endif
76
77#if ( CPU_HAS_HARDWARE_INTERRUPT_STACK == TRUE )
78  _CPU_Install_interrupt_stack();
79#endif
80
81}
Note: See TracBrowser for help on using the repository browser.