source: rtems/cpukit/score/cpu/no_cpu/cpu.c @ d0279f6e

4.9
Last change on this file since d0279f6e was 3c87adba, checked in by Joel Sherrill <joel.sherrill@…>, on Jul 31, 2008 at 2:55:56 PM

2008-07-31 Joel Sherrill <joel.sherrill@…>

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