source: rtems/c/src/lib/libbsp/sparc/erc32/startup/setvec.c @ 72f4b246

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

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

  • startup/setvec.c: Change prototype of IDLE thread to consistently return void * and take a uintptr_t argument.
  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*  set_vector
2 *
3 *  This routine installs an interrupt vector on the SPARC simulator.
4 *
5 *  INPUT PARAMETERS:
6 *    handler - interrupt handler entry point
7 *    vector  - vector number
8 *    type    - 0 indicates raw hardware connect
9 *              1 indicates RTEMS interrupt connect
10 *
11 *  OUTPUT PARAMETERS:  NONE
12 *
13 *  RETURNS:
14 *    address of previous interrupt handler
15 *
16 *  COPYRIGHT (c) 1989-1999.
17 *  On-Line Applications Research Corporation (OAR).
18 *
19 *  The license and distribution terms for this file may be
20 *  found in the file LICENSE in this distribution or at
21 *  http://www.rtems.com/license/LICENSE.
22 *
23 *  Ported to ERC32 implementation of the SPARC by On-Line Applications
24 *  Research Corporation (OAR) under contract to the European Space
25 *  Agency (ESA).
26 *
27 *  ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
28 *  European Space Agency.
29 *
30 *  $Id$
31 */
32
33#include <bsp.h>
34
35rtems_isr_entry set_vector(                   /* returns old vector */
36  rtems_isr_entry     handler,                /* isr routine        */
37  rtems_vector_number vector,                 /* vector number      */
38  int                 type                    /* RTEMS or RAW intr  */
39)
40{
41  rtems_isr_entry previous_isr;
42  uint32_t        real_trap;
43  uint32_t        source;
44
45  if ( type )
46    rtems_interrupt_catch( handler, vector, &previous_isr );
47  else
48    _CPU_ISR_install_raw_handler( vector, handler, (void *)&previous_isr );
49
50  real_trap = SPARC_REAL_TRAP_NUMBER( vector );
51
52  if ( ERC32_Is_MEC_Trap( real_trap ) ) {
53
54    source = ERC32_TRAP_SOURCE( real_trap );
55
56    ERC32_Clear_interrupt( source );
57    ERC32_Unmask_interrupt( source );
58  }
59
60  return previous_isr;
61}
62
63/* ERC32 power-down function */
64
65void *_CPU_Thread_Idle_body( uintptr_t ignored )
66{
67  while (1) {
68    ERC32_MEC.Power_Down = 0;   /* value is irrelevant */
69  }
70}
Note: See TracBrowser for help on using the repository browser.