source: rtems-schedsim/schedsim/rtems/sched_cpu/cpu.c @ abb18dc

base initial
Last change on this file since abb18dc was abb18dc, checked in by Joel Sherrill <joel.sherrill@…>, on 04/25/11 at 15:53:10

Initial import.

  • Property mode set to 100644
File size: 3.6 KB
Line 
1/*
2 *  XXX CPU Dependent Source
3 *
4 *  BASED UPON SOURCE IN RTEMS, MODIFIED FOR SIMULATOR
5 *
6 *  COPYRIGHT (c) 1989-2010.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15
16#ifdef 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/wkspace.h>
23
24/*  _CPU_Initialize
25 *
26 *  This routine performs processor dependent initialization.
27 *
28 *  INPUT PARAMETERS: NONE
29 *
30 *  NO_CPU Specific Information:
31 *
32 *  XXX document implementation including references if appropriate
33 */
34
35void _CPU_Initialize(void)
36{
37  /*
38   *  If there is not an easy way to initialize the FP context
39   *  during Context_Initialize, then it is usually easier to
40   *  save an "uninitialized" FP context here and copy it to
41   *  the task's during Context_Initialize.
42   */
43
44  /* FP context initialization support goes here */
45}
46
47/*PAGE
48 *
49 *  _CPU_ISR_Get_level
50 *
51 *  NO_CPU Specific Information:
52 *
53 *  XXX document implementation including references if appropriate
54 */
55
56uint32_t   _CPU_ISR_Get_level( void )
57{
58  /*
59   *  This routine returns the current interrupt level.
60   */
61
62  return 0;
63}
64
65/*PAGE
66 *
67 *  _CPU_ISR_install_raw_handler
68 *
69 *  NO_CPU Specific Information:
70 *
71 *  XXX document implementation including references if appropriate
72 */
73
74void _CPU_ISR_install_raw_handler(
75  uint32_t    vector,
76  proc_ptr    new_handler,
77  proc_ptr   *old_handler
78)
79{
80  /*
81   *  This is where we install the interrupt handler into the "raw" interrupt
82   *  table used by the CPU to dispatch interrupt handlers.
83   */
84}
85
86/*PAGE
87 *
88 *  _CPU_ISR_install_vector
89 *
90 *  This kernel routine installs the RTEMS handler for the
91 *  specified vector.
92 *
93 *  Input parameters:
94 *    vector      - interrupt vector number
95 *    old_handler - former ISR for this vector number
96 *    new_handler - replacement ISR for this vector number
97 *
98 *  Output parameters:  NONE
99 *
100 *
101 *  NO_CPU Specific Information:
102 *
103 *  XXX document implementation including references if appropriate
104 */
105
106void _CPU_ISR_install_vector(
107  uint32_t    vector,
108  proc_ptr    new_handler,
109  proc_ptr   *old_handler
110)
111{
112   *old_handler = _ISR_Vector_table[ vector ];
113
114   /*
115    *  If the interrupt vector table is a table of pointer to isr entry
116    *  points, then we need to install the appropriate RTEMS interrupt
117    *  handler for this vector number.
118    */
119
120   _CPU_ISR_install_raw_handler( vector, new_handler, old_handler );
121
122   /*
123    *  We put the actual user ISR address in '_ISR_vector_table'.  This will
124    *  be used by the _ISR_Handler so the user gets control.
125    */
126
127    _ISR_Vector_table[ vector ] = new_handler;
128}
129
130/*PAGE
131 *
132 *  _CPU_Install_interrupt_stack
133 *
134 *  NO_CPU Specific Information:
135 *
136 *  XXX document implementation including references if appropriate
137 */
138
139void _CPU_Install_interrupt_stack( void )
140{
141}
142
143/*PAGE
144 *
145 *  _CPU_Thread_Idle_body
146 *
147 *  NOTES:
148 *
149 *  1. This is the same as the regular CPU independent algorithm.
150 *
151 *  2. If you implement this using a "halt", "idle", or "shutdown"
152 *     instruction, then don't forget to put it in an infinite loop.
153 *
154 *  3. Be warned. Some processors with onboard DMA have been known
155 *     to stop the DMA if the CPU were put in IDLE mode.  This might
156 *     also be a problem with other on-chip peripherals.  So use this
157 *     hook with caution.
158 *
159 *  NO_CPU Specific Information:
160 *
161 *  XXX document implementation including references if appropriate
162 */
163
164void *_CPU_Thread_Idle_body( uintptr_t ignored )
165{
166
167  for( ; ; )
168    /* insert your "halt" instruction here */ ;
169}
Note: See TracBrowser for help on using the repository browser.