initial import
[glibc.git] / sysdeps / standalone / m68k / m68020 / m68020.h
blobe9e6f7d87544903a87bbbace16b886e3ff7efcbf
1 /* Copyright (C) 1994 Free Software Foundation, Inc.
2 Contributed by Joel Sherrill (jsherril@redstone-emh2.army.mil),
3 On-Line Applications Research Corporation.
5 This file is part of the GNU C Library.
7 The GNU C Library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public License as
9 published by the Free Software Foundation; either version 2 of the
10 License, or (at your option) any later version.
12 The GNU C Library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public
18 License along with the GNU C Library; see the file COPYING.LIB. If
19 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
20 Cambridge, MA 02139, USA. */
22 /* m68020.h
24 * This file contains macros which are used to access MC68020
25 * registers which are not addressable by C. These are
26 * useful when developing the board specific support.
29 #ifndef m68020_h__
30 #define m68020_h__
32 typedef void ( *mc68020_isr )( void );
34 #define disable_intr( level ) \
35 { (level) = 0; \
36 asm volatile ( "movew %%sr,%0 ; \
37 orw #0x0700,%%sr" \
38 : "=d" ((level)) : "0" ((level)) ); \
41 #define enable_intr( level ) \
42 { asm volatile ( "movew %0,%%sr " \
43 : "=d" ((level)) : "0" ((level)) ); \
46 #define flash_intr( level ) \
47 { asm volatile ( "movew %0,%%sr ; \
48 orw #0x0700,%%sr" \
49 : "=d" ((level)) : "0" ((level)) ); \
52 #define get_vbr( vbr ) \
53 { (vbr) = 0; \
54 asm volatile ( "movec %%vbr,%0 " \
55 : "=a" (vbr) : "0" (vbr) ); \
58 #define set_vbr( vbr ) \
59 { register mc68020_isr *_vbr= (mc68020_isr *)(vbr); \
60 asm volatile ( "movec %0,%%vbr " \
61 : "=a" (_vbr) : "0" (_vbr) ); \
64 #define enable_caching() \
65 { register unsigned int _ctl=0x01; \
66 asm volatile ( "movec %0,%%cacr" \
67 : "=d" (_ctl) : "0" (_ctl) ); \
70 #define delay( microseconds ) \
71 { register unsigned int _delay=(microseconds); \
72 register unsigned int _tmp=123; \
73 asm volatile( "0: \
74 nbcd %0 ; \
75 nbcd %0 ; \
76 dbf %1,0 " \
77 : "=d" (_tmp), "=d" (_delay) \
78 : "0" (_tmp), "1" (_delay) ); \
81 #define enable_tracing()
82 #define cause_intr( X )
83 #define clear_intr( X )
85 extern mc68020_isr M68Kvec[]; /* vector table address */
87 #endif
88 /* end of include file */