source: rtems/c/src/exec/score/cpu/m68k/cpu.c @ 3a4ae6c

4.104.114.84.95
Last change on this file since 3a4ae6c was 3a4ae6c, checked in by Joel Sherrill <joel.sherrill@…>, on 09/11/95 at 19:35:39

The word "RTEMS" almost completely removed from the core.

Configuration Table Template file added and all tests
modified to use this. All gvar.h and conftbl.h files
removed from test directories.

Configuration parameter maximum_devices added.

Core semaphore and mutex handlers added and RTEMS API Semaphore
Manager updated to reflect this.

Initialization sequence changed to invoke API specific initialization
routines. Initialization tasks table now owned by RTEMS Tasks Manager.

Added user extension for post-switch.

Utilized user extensions to implement API specific functionality
like signal dispatching.

Added extensions to the System Initialization Thread so that an
API can register a function to be invoked while the system
is being initialized. These are largely equivalent to the
pre-driver and post-driver hooks.

Added the Modules file oar-go32_p5, modified oar-go32, and modified
the file make/custom/go32.cfg to look at an environment varable which
determines what CPU model is being used.

All BSPs updated to reflect named devices and clock driver's IOCTL
used by the Shared Memory Driver. Also merged clock isr into
main file and removed ckisr.c where possible.

Updated spsize to reflect new and moved variables.

Makefiles for the executive source and include files updated to show
break down of files into Core, RTEMS API, and Neither.

Header and inline files installed into subdirectory based on whether
logically in the Core or a part of the RTEMS API.

  • 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/core/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  _CPU_Table = *cpu_table;
37
38}
39
40/*PAGE
41 *
42 *  _CPU_ISR_Get_level
43 */
44 
45unsigned32 _CPU_ISR_Get_level( void )
46{
47  unsigned32 level;
48
49  m68k_get_interrupt_level( level );
50
51  return level;
52}
53
54/*PAGE
55 *
56 *  _CPU_ISR_install_raw_handler
57 */
58 
59void _CPU_ISR_install_raw_handler(
60  unsigned32  vector,
61  proc_ptr    new_handler,
62  proc_ptr   *old_handler
63)
64{
65  proc_ptr *interrupt_table = NULL;
66
67  m68k_get_vbr( interrupt_table );
68
69  *old_handler = interrupt_table[ vector ];
70
71  interrupt_table[ vector ] = new_handler;
72}
73
74/*PAGE
75 *
76 *  _CPU_ISR_install_vector
77 *
78 *  This kernel routine installs the RTEMS handler for the
79 *  specified vector.
80 *
81 *  Input parameters:
82 *    vector      - interrupt vector number
83 *    new_handler - replacement ISR for this vector number
84 *    old_handler - former ISR for this vector number
85 *
86 *  Output parameters:  NONE
87 */
88
89void _CPU_ISR_install_vector(
90  unsigned32  vector,
91  proc_ptr    new_handler,
92  proc_ptr   *old_handler
93)
94{
95  proc_ptr ignored;
96
97  *old_handler = _ISR_Vector_table[ vector ];
98
99  _CPU_ISR_install_raw_handler( vector, _ISR_Handler, &ignored );
100
101  _ISR_Vector_table[ vector ] = new_handler;
102}
103
104
105/*PAGE
106 *
107 *  _CPU_Install_interrupt_stack
108 */
109
110void _CPU_Install_interrupt_stack( void )
111{
112#if ( M68K_HAS_SEPARATE_STACKS == 1 )
113  void *isp = _CPU_Interrupt_stack_high;
114
115  asm volatile ( "movec %0,%%isp" : "=r" (isp) : "0" (isp) );
116#else
117#warning "FIX ME... HOW DO I INSTALL THE INTERRUPT STACK!!!"
118#endif
119}
120
121#if ( M68K_HAS_BFFFO != 1 )
122/*
123 * Returns log2(x)  0<x<256
124 */
125const unsigned char __log2table[256] = {
126    0, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
127    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
128    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
129    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
130    6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
131    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
132    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
133    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
134    7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
135    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
136    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
137    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
138    6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
139    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
140    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
141    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0
142};
143#endif
Note: See TracBrowser for help on using the repository browser.