source: rtems/cpukit/score/cpu/avr/cpu.c @ cca8379

4.104.115
Last change on this file since cca8379 was cca8379, checked in by Joel Sherrill <joel.sherrill@…>, on 02/12/09 at 15:55:55

2009-02-12 Joel Sherrill <joel.sherrill@…>

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