| 1 |
/* $XConsortium: AsmMacros.h /main/13 1996/10/25 11:33:12 kaleb $ */ |
| 2 |
/* |
| 3 |
* (c) Copyright 1993,1994 by David Wexelblat <[email protected]> |
| 4 |
* |
| 5 |
* Permission is hereby granted, free of charge, to any person obtaining a |
| 6 |
* copy of this software and associated documentation files (the "Software"), |
| 7 |
* to deal in the Software without restriction, including without limitation |
| 8 |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 9 |
* and/or sell copies of the Software, and to permit persons to whom the |
| 10 |
* Software is furnished to do so, subject to the following conditions: |
| 11 |
* |
| 12 |
* The above copyright notice and this permission notice shall be included in |
| 13 |
* all copies or substantial portions of the Software. |
| 14 |
* |
| 15 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 18 |
* DAVID WEXELBLAT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
| 19 |
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF |
| 20 |
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 21 |
* SOFTWARE. |
| 22 |
* |
| 23 |
* Except as contained in this notice, the name of David Wexelblat shall not be |
| 24 |
* used in advertising or otherwise to promote the sale, use or other dealings |
| 25 |
* in this Software without prior written authorization from David Wexelblat. |
| 26 |
* |
| 27 |
*/ |
| 28 |
/* |
| 29 |
* Copyright 1997 |
| 30 |
* Digital Equipment Corporation. All rights reserved. |
| 31 |
* This software is furnished under license and may be used and copied only in |
| 32 |
* accordance with the following terms and conditions. Subject to these |
| 33 |
* conditions, you may download, copy, install, use, modify and distribute |
| 34 |
* this software in source and/or binary form. No title or ownership is |
| 35 |
* transferred hereby. |
| 36 |
* |
| 37 |
* 1) Any source code used, modified or distributed must reproduce and retain |
| 38 |
* this copyright notice and list of conditions as they appear in the source |
| 39 |
* file. |
| 40 |
* |
| 41 |
* 2) No right is granted to use any trade name, trademark, or logo of Digital |
| 42 |
* Equipment Corporation. Neither the "Digital Equipment Corporation" name |
| 43 |
* nor any trademark or logo of Digital Equipment Corporation may be used |
| 44 |
* to endorse or promote products derived from this software without the |
| 45 |
* prior written permission of Digital Equipment Corporation. |
| 46 |
* |
| 47 |
* 3) This software is provided "AS-IS" and any express or implied warranties, |
| 48 |
* including but not limited to, any implied warranties of merchantability, |
| 49 |
* fitness for a particular purpose, or non-infringement are disclaimed. In |
| 50 |
* no event shall DIGITAL be liable for any damages whatsoever, and in |
| 51 |
* particular, DIGITAL shall not be liable for special, indirect, |
| 52 |
* consequential, or incidental damages or damages for |
| 53 |
* lost profits, loss of revenue or loss of use, whether such damages arise |
| 54 |
* in contract, |
| 55 |
* negligence, tort, under statute, in equity, at law or otherwise, even if |
| 56 |
* advised of the possibility of such damage. |
| 57 |
* |
| 58 |
*/ |
| 59 |
|
| 60 |
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/AsmMacros.h,v 1.1 2001/11/16 21:13:34 tsi Exp $ */ |
| 61 |
|
| 62 |
/* |
| 63 |
* Modified for readability by Nick Kurshev |
| 64 |
*/ |
| 65 |
|
| 66 |
#if defined(__GNUC__) |
| 67 |
#if defined(__alpha__) |
| 68 |
#include "sysdep/AsmMacros_alpha.h" |
| 69 |
#elif defined(__ia64__) |
| 70 |
#include "sysdep/AsmMacros_ia64.h" |
| 71 |
#elif defined(__sparc__) |
| 72 |
#include "sysdep/AsmMacros_sparc.h" |
| 73 |
#elif defined( __arm32__ ) |
| 74 |
#include "sysdep/AsmMacros_arm32.h" |
| 75 |
#elif defined(__powerpc__) |
| 76 |
#include "sysdep/AsmMacros_powerpc.h" |
| 77 |
#elif defined (__i386__) |
| 78 |
#include "sysdep/AsmMacros_x86.h" |
| 79 |
#else |
| 80 |
#include "sysdep/AsmMacros_generic.h" |
| 81 |
#endif |
| 82 |
|
| 83 |
#else /* __GNUC__ */ |
| 84 |
|
| 85 |
#if defined(_MINIX) && defined(_ACK) |
| 86 |
|
| 87 |
/* inb, outb, inw and outw are defined in the library */ |
| 88 |
/* ... but I've no idea if the same is true for inl & outl */ |
| 89 |
|
| 90 |
extern u8_t inb(U16_t); |
| 91 |
extern void outb(U16_t, U8_t); |
| 92 |
extern u16_t inw(U16_t); |
| 93 |
extern void outw(U16_t, U16_t); |
| 94 |
extern u32_t inl(U16_t); |
| 95 |
extern void outl(U16_t, U32_t); |
| 96 |
|
| 97 |
#else /* not _MINIX and _ACK */ |
| 98 |
|
| 99 |
# if defined(__STDC__) && (__STDC__ == 1) |
| 100 |
# ifndef NCR |
| 101 |
# define asm __asm |
| 102 |
# endif |
| 103 |
# endif |
| 104 |
# ifdef SVR4 |
| 105 |
# include <sys/types.h> |
| 106 |
# ifndef __USLC__ |
| 107 |
# define __USLC__ |
| 108 |
# endif |
| 109 |
# endif |
| 110 |
#ifndef SCO325 |
| 111 |
# include <sys/inline.h> |
| 112 |
#else |
| 113 |
# include "../common/scoasm.h" |
| 114 |
#endif |
| 115 |
#define intr_disable() asm("cli") |
| 116 |
#define intr_enable() asm("sti") |
| 117 |
|
| 118 |
#endif /* _MINIX and _ACK */ |
| 119 |
#endif /* __GNUC__ */ |