Back to index

glibc  2.9
m68020.h
Go to the documentation of this file.
00001 /* Copyright (C) 1994, 1997 Free Software Foundation, Inc.
00002    Contributed by Joel Sherrill (jsherril@redstone-emh2.army.mil),
00003      On-Line Applications Research Corporation.
00004    This file is part of the GNU C Library.
00005 
00006    The GNU C Library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Lesser General Public
00008    License as published by the Free Software Foundation; either
00009    version 2.1 of the License, or (at your option) any later version.
00010 
00011    The GNU C Library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Lesser General Public License for more details.
00015 
00016    You should have received a copy of the GNU Lesser General Public
00017    License along with the GNU C Library; if not, write to the Free
00018    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019    02111-1307 USA.  */
00020 
00021 /*  m68020.h
00022  *
00023  *  This file contains macros which are used to access MC68020
00024  *  registers which are not addressable by C.  These are
00025  *  useful when developing the board specific support.
00026  */
00027 
00028 #ifndef m68020_h__
00029 #define m68020_h__
00030 
00031 typedef void ( *mc68020_isr )( void );
00032 
00033 #define disable_intr( level ) \
00034   { (level) = 0; \
00035     asm volatile ( "movew   %%sr,%0 ; \
00036                   orw     #0x0700,%%sr" \
00037                   : "=d" ((level)) : "0" ((level)) ); \
00038   }
00039 
00040 #define enable_intr( level ) \
00041   { asm volatile ( "movew   %0,%%sr " \
00042                      : "=d" ((level)) : "0" ((level)) ); \
00043   }
00044 
00045 #define flash_intr( level ) \
00046   { asm volatile ( "movew   %0,%%sr ; \
00047                   orw     #0x0700,%%sr" \
00048                      : "=d" ((level)) : "0" ((level)) ); \
00049   }
00050 
00051 #define get_vbr( vbr ) \
00052   { (vbr) = 0; \
00053     asm volatile ( "movec   %%vbr,%0 " \
00054                      : "=a" (vbr) : "0" (vbr) ); \
00055   }
00056 
00057 #define set_vbr( vbr ) \
00058   { register mc68020_isr *_vbr= (mc68020_isr *)(vbr); \
00059     asm volatile ( "movec   %0,%%vbr " \
00060                      : "=a" (_vbr) : "0" (_vbr) ); \
00061   }
00062 
00063 #define enable_caching() \
00064   { register unsigned int _ctl=0x01; \
00065     asm volatile ( "movec   %0,%%cacr" \
00066                      : "=d" (_ctl) : "0" (_ctl) ); \
00067   }
00068 
00069 #define delay( microseconds ) \
00070   { register unsigned int _delay=(microseconds); \
00071     register unsigned int _tmp=123; \
00072     asm volatile( "0: \
00073                    nbcd      %0 ; \
00074                    nbcd      %0 ; \
00075                    dbf       %1,0 " \
00076                 : "=d" (_tmp), "=d" (_delay) \
00077                 : "0"  (_tmp), "1"  (_delay) ); \
00078   }
00079 
00080 #define enable_tracing()
00081 #define cause_intr( X )
00082 #define clear_intr( X )
00083 
00084 extern mc68020_isr     M68Kvec[];   /* vector table address */
00085 
00086 #endif
00087 /* end of include file */