Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

types.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 *
00003 *                                               Realmode X86 Emulator Library
00004 *
00005 *               Copyright (C) 1996-1999 SciTech Software, Inc.
00006 *                                    Copyright (C) David Mosberger-Tang
00007 *                                          Copyright (C) 1999 Egbert Eich
00008 *
00009 *  ========================================================================
00010 *
00011 *  Permission to use, copy, modify, distribute, and sell this software and
00012 *  its documentation for any purpose is hereby granted without fee,
00013 *  provided that the above copyright notice appear in all copies and that
00014 *  both that copyright notice and this permission notice appear in
00015 *  supporting documentation, and that the name of the authors not be used
00016 *  in advertising or publicity pertaining to distribution of the software
00017 *  without specific, written prior permission.  The authors makes no
00018 *  representations about the suitability of this software for any purpose.
00019 *  It is provided "as is" without express or implied warranty.
00020 *
00021 *  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
00022 *  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
00023 *  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
00024 *  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
00025 *  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
00026 *  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
00027 *  PERFORMANCE OF THIS SOFTWARE.
00028 *
00029 *  ========================================================================
00030 *
00031 * Language:             ANSI C
00032 * Environment:  Any
00033 * Developer:    Kendall Bennett
00034 *
00035 * Description:  Header file for x86 emulator type definitions.
00036 *
00037 ****************************************************************************/
00038 
00039 /* $XFree86: xc/extras/x86emu/include/x86emu/types.h,v 1.6 2003/06/12 14:12:26 eich Exp $ */
00040 
00041 #ifndef __X86EMU_TYPES_H
00042 #define __X86EMU_TYPES_H
00043 
00044 #ifndef IN_MODULE
00045 #include <sys/types.h>
00046 #endif
00047 
00048 /*
00049  * The following kludge is an attempt to work around typedef conflicts with
00050  * <sys/types.h>.
00051  */
00052 #define u8   x86emuu8
00053 #define u16  x86emuu16
00054 #define u32  x86emuu32
00055 #define u64  x86emuu64
00056 #define s8   x86emus8
00057 #define s16  x86emus16
00058 #define s32  x86emus32
00059 #define s64  x86emus64
00060 #define uint x86emuuint
00061 #define sint x86emusint
00062 
00063 /*---------------------- Macros and type definitions ----------------------*/
00064 
00065 /* Currently only for Linux/32bit */
00066 #undef  __HAS_LONG_LONG__
00067 #if defined(__GNUC__) && !defined(NO_LONG_LONG)
00068 #define __HAS_LONG_LONG__
00069 #endif
00070 
00071 /* Taken from Xmd.h */
00072 #undef NUM32
00073 #if defined (_LP64) || \
00074     defined(__alpha) || defined(__alpha__) || \
00075     defined(__ia64__) || defined(ia64) || \
00076     defined(__sparc64__) || \
00077     defined(__s390x__) || \
00078     (defined(__hppa__) && defined(__LP64)) || \
00079     defined(__AMD64__) || defined(AMD64) || \
00080     (defined(__sgi) && (_MIPS_SZLONG == 64))
00081 #define NUM32 int
00082 #else
00083 #define NUM32 long
00084 #endif
00085 
00086 typedef unsigned char           u8;
00087 typedef unsigned short          u16;
00088 typedef unsigned NUM32          u32;
00089 #ifdef __HAS_LONG_LONG__
00090 typedef unsigned long long      u64;
00091 #endif
00092 
00093 typedef char                            s8;
00094 typedef short                           s16;
00095 typedef NUM32                           s32;
00096 #ifdef __HAS_LONG_LONG__
00097 typedef long long                       s64;
00098 #endif
00099 
00100 typedef unsigned int                    uint;
00101 typedef int                             sint;
00102 
00103 typedef u16 X86EMU_pioAddr;
00104 
00105 #undef NUM32
00106 
00107 #endif  /* __X86EMU_TYPES_H */