source: rtems/cpukit/score/cpu/lm32/cpu.c @ 9165349d

Last change on this file since 9165349d was 3fe2155, checked in by Sebastian Huber <sebastian.huber@…>, on 02/01/19 at 09:00:36

Remove superfluous <rtems/system.h> includes

  • Property mode set to 100644
File size: 2.3 KB
Line 
1/**
2 *  @file
3 *
4 *  @brief LM32 CPU Dependent Source
5 */
6
7/*
8 *  COPYRIGHT (c) 1989-1999.
9 *  On-Line Applications Research Corporation (OAR).
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.org/license/LICENSE.
14 *
15 *  Jukka Pietarinen <jukka.pietarinen@mrf.fi>, 2008,
16 *  Micro-Research Finland Oy
17 */
18
19#ifdef HAVE_CONFIG_H
20#include "config.h"
21#endif
22
23#include <rtems/score/isr.h>
24#include <rtems/score/wkspace.h>
25
26/*  _CPU_Initialize
27 *
28 *  This routine performs processor dependent initialization.
29 *
30 *  INPUT PARAMETERS: NONE
31 *
32 *  LM32 Specific Information:
33 *
34 *  XXX document implementation including references if appropriate
35 */
36
37void _CPU_Initialize(void)
38{
39  /*
40   *  If there is not an easy way to initialize the FP context
41   *  during Context_Initialize, then it is usually easier to
42   *  save an "uninitialized" FP context here and copy it to
43   *  the task's during Context_Initialize.
44   */
45
46  /* FP context initialization support goes here */
47}
48
49uint32_t   _CPU_ISR_Get_level( void )
50{
51  /*
52   *  This routine returns the current interrupt level.
53   */
54
55  return 0;
56}
57
58void _CPU_ISR_install_vector(
59  uint32_t         vector,
60  CPU_ISR_handler  new_handler,
61  CPU_ISR_handler *old_handler
62)
63{
64   *old_handler = _ISR_Vector_table[ vector ];
65
66   /*
67    *  We put the actual user ISR address in '_ISR_vector_table'.  This will
68    *  be used by the _ISR_Handler so the user gets control.
69    */
70
71    _ISR_Vector_table[ vector ] = new_handler;
72}
73
74/*
75 *  _CPU_Thread_Idle_body
76 *
77 *  NOTES:
78 *
79 *  1. This is the same as the regular CPU independent algorithm.
80 *
81 *  2. If you implement this using a "halt", "idle", or "shutdown"
82 *     instruction, then don't forget to put it in an infinite loop.
83 *
84 *  3. Be warned. Some processors with onboard DMA have been known
85 *     to stop the DMA if the CPU were put in IDLE mode.  This might
86 *     also be a problem with other on-chip peripherals.  So use this
87 *     hook with caution.
88 *
89 *  LM32 Specific Information:
90 *
91 *  XXX document implementation including references if appropriate
92 */
93
94void *_CPU_Thread_Idle_body( uintptr_t ignored )
95{
96  for( ; ; ) {
97    /* The LM32 softcore itself hasn't any HLT instruction. But the
98     * LM32 qemu target interprets this nop instruction as HLT.
99     */
100    __asm__ volatile("and r0, r0, r0");
101 }
102}
Note: See TracBrowser for help on using the repository browser.