source: rtems/cpukit/score/cpu/no_cpu/cpu.c @ 98e4ebf5

4.104.114.84.95
Last change on this file since 98e4ebf5 was 98e4ebf5, checked in by Joel Sherrill <joel.sherrill@…>, on 10/08/97 at 15:45:54

Fixed typo in the pointer to the license terms.

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