source: rtems/cpukit/score/cpu/or16/cpu.c @ ee511076

4.104.114.84.95
Last change on this file since ee511076 was ee511076, checked in by Joel Sherrill <joel.sherrill@…>, on 08/11/00 at 21:52:06

2000-08-11 Joel Sherrill <joel@…>

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