OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [score/] [cpu/] [no_cpu/] [cpu.c] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 *  Or1k 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
 */
13
 
14
#include <rtems/system.h>
15
#include <rtems/score/isr.h>
16
#include <rtems/score/wkspace.h>
17
 
18
/*  _CPU_Initialize
19
 *
20
 *  This routine performs processor dependent initialization.
21
 *
22
 *  INPUT PARAMETERS:
23
 *    cpu_table       - CPU table to initialize
24
 *    thread_dispatch - address of disptaching routine
25
 *
26
 */
27
 
28
 
29
void _CPU_Initialize(
30
  rtems_cpu_table  *cpu_table,
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
  _CPU_Table = *cpu_table;
57
}
58
 
59
/*PAGE
60
 *
61
 *  _CPU_ISR_Get_level
62
 *
63
 */
64
 
65
unsigned32 _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
 */
79
 
80
void _CPU_ISR_install_raw_handler(
81
  unsigned32  vector,
82
  proc_ptr    new_handler,
83
  proc_ptr   *old_handler
84
)
85
{
86
  /*
87
   *  This is where we install the interrupt handler into the "raw" interrupt
88
   *  table used by the CPU to dispatch interrupt handlers.
89
   */
90
}
91
 
92
/*PAGE
93
 *
94
 *  _CPU_ISR_install_vector
95
 *
96
 *  This kernel routine installs the RTEMS handler for the
97
 *  specified vector.
98
 *
99
 *  Input parameters:
100
 *    vector      - interrupt vector number
101
 *    old_handler - former ISR for this vector number
102
 *    new_handler - replacement ISR for this vector number
103
 *
104
 *  Output parameters:  NONE
105
 *
106
 *
107
 */
108
 
109
void _CPU_ISR_install_vector(
110
  unsigned32  vector,
111
  proc_ptr    new_handler,
112
  proc_ptr   *old_handler
113
)
114
{
115
   *old_handler = _ISR_Vector_table[ vector ];
116
 
117
   /*
118
    *  If the interrupt vector table is a table of pointer to isr entry
119
    *  points, then we need to install the appropriate RTEMS interrupt
120
    *  handler for this vector number.
121
    */
122
 
123
   _CPU_ISR_install_raw_handler( vector, new_handler, old_handler );
124
 
125
   /*
126
    *  We put the actual user ISR address in '_ISR_vector_table'.  This will
127
    *  be used by the _ISR_Handler so the user gets control.
128
    */
129
 
130
    _ISR_Vector_table[ vector ] = new_handler;
131
}
132
 
133
/*PAGE
134
 *
135
 *  _CPU_Install_interrupt_stack
136
 *
137
 */
138
 
139
void _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
 */
160
 
161
void _CPU_Thread_Idle_body( void )
162
{
163
 
164
  for( ; ; )
165
    /* insert your "halt" instruction here */ ;
166
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.