source: rtems/c/src/exec/score/cpu/m68k/cpu.c @ 9e86dd7d

4.104.114.84.95
Last change on this file since 9e86dd7d was 9e86dd7d, checked in by Joel Sherrill <joel.sherrill@…>, on 06/07/95 at 01:27:28

incorporated mc68302 support

  • Property mode set to 100644
File size: 3.2 KB
Line 
1/*
2 *  Motorola MC68020 Dependent Source
3 *
4 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
5 *  On-Line Applications Research Corporation (OAR).
6 *  All rights assigned to U.S. Government, 1994.
7 *
8 *  This material may be reproduced by or for the U.S. Government pursuant
9 *  to the copyright license under the clause at DFARS 252.227-7013.  This
10 *  notice must appear in all copies of this file and its derivatives.
11 *
12 *  $Id$
13 */
14
15#include <rtems/system.h>
16#include <rtems/fatal.h>
17#include <rtems/isr.h>
18
19/*  _CPU_Initialize
20 *
21 *  This routine performs processor dependent initialization.
22 *
23 *  INPUT PARAMETERS:
24 *    cpu_table       - CPU table to initialize
25 *    thread_dispatch - entry pointer to thread dispatcher
26 *
27 *  OUTPUT PARAMETERS: NONE
28 */
29
30void _CPU_Initialize(
31  rtems_cpu_table  *cpu_table,
32  void      (*thread_dispatch)      /* ignored on this CPU */
33)
34{
35
36  if ( cpu_table == NULL )
37    rtems_fatal_error_occurred( RTEMS_NOT_CONFIGURED );
38
39  _CPU_Table = *cpu_table;
40
41}
42
43/*  _CPU_ISR_install_vector
44 *
45 *  This kernel routine installs the RTEMS handler for the
46 *  specified vector.
47 *
48 *  Input parameters:
49 *    vector      - interrupt vector number
50 *    new_handler - replacement ISR for this vector number
51 *    old_handler - former ISR for this vector number
52 *
53 *  Output parameters:  NONE
54 *
55 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
56 *  On-Line Applications Research Corporation (OAR).
57 *
58 *  This material may be reproduced by or for the U.S. Government pursuant
59 *  to the copyright license under the clause at DFARS 252.227-7013.  This
60 *  notice must appear in all copies of this file and its derivatives.
61 *
62 *  $Id$
63 */
64
65void _CPU_ISR_install_vector(
66  unsigned32  vector,
67  proc_ptr    new_handler,
68  proc_ptr   *old_handler
69)
70{
71  proc_ptr *interrupt_table = NULL;
72
73  m68k_get_vbr( interrupt_table );
74
75  *old_handler = _ISR_Vector_table[ vector ];
76
77  _ISR_Vector_table[ vector ] = new_handler;
78  interrupt_table[ vector ] = _ISR_Handler;
79}
80
81
82/*PAGE
83 *
84 *  _CPU_Install_interrupt_stack
85 */
86
87void _CPU_Install_interrupt_stack( void )
88{
89#if ( M68K_HAS_SEPARATE_STACKS == 1 )
90  void *isp = _CPU_Interrupt_stack_high;
91
92  asm volatile ( "movec %0,%%isp" : "=r" (isp) : "0" (isp) );
93#else
94#warning "FIX ME... HOW DO I INSTALL THE INTERRUPT STACK!!!"
95#endif
96}
97
98#if ( M68K_HAS_BFFFO != 1 )
99/*
100 * Returns log2(x)  0<x<256
101 */
102const unsigned char __log2table[256] = {
103    0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
104    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
105    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
106    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
107    6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
108    6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
109    6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
110    6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
111    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
112    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
113    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
114    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
115    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
116    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
117    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
118    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
119};
120#endif
Note: See TracBrowser for help on using the repository browser.