source: rtems/cpukit/score/cpu/m32c/cpu.c @ 6563691

4.104.115
Last change on this file since 6563691 was 6563691, checked in by Joel Sherrill <joel.sherrill@…>, on 05/10/10 at 20:08:50

2010-05-10 Joel Sherrill <joel.sherrilL@…>

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