📄 sim-config.h
字号:
/* The common simulator framework for GDB, the GNU Debugger. Copyright 2002 Free Software Foundation, Inc. Contributed by Andrew Cagney and Red Hat. This file is part of GDB. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */#ifndef SIM_CONFIG_H#define SIM_CONFIG_H/* Host dependant: The CPP below defines information about the compilation host. In particular it defines the macro's: WITH_HOST_BYTE_ORDER The byte order of the host. Could be any of LITTLE_ENDIAN, BIG_ENDIAN or 0 (unknown). Those macro's also need to be defined. *//* NetBSD: NetBSD is easy, everything you could ever want is in a header file (well almost :-) */#if defined(__NetBSD__)# include <machine/endian.h># if (WITH_HOST_BYTE_ORDER == 0)# undef WITH_HOST_BYTE_ORDER# define WITH_HOST_BYTE_ORDER BYTE_ORDER# endif# if (BYTE_ORDER != WITH_HOST_BYTE_ORDER)# error "host endian incorrectly configured, check config.h"# endif#endif/* Linux is similarly easy. */#if defined(__linux__)# include <endian.h># if defined(__LITTLE_ENDIAN) && !defined(LITTLE_ENDIAN)# define LITTLE_ENDIAN __LITTLE_ENDIAN# endif# if defined(__BIG_ENDIAN) && !defined(BIG_ENDIAN)# define BIG_ENDIAN __BIG_ENDIAN# endif# if defined(__BYTE_ORDER) && !defined(BYTE_ORDER)# define BYTE_ORDER __BYTE_ORDER# endif# if (WITH_HOST_BYTE_ORDER == 0)# undef WITH_HOST_BYTE_ORDER# define WITH_HOST_BYTE_ORDER BYTE_ORDER# endif# if (BYTE_ORDER != WITH_HOST_BYTE_ORDER)# error "host endian incorrectly configured, check config.h"# endif#endif/* INSERT HERE - hosts that have available LITTLE_ENDIAN and BIG_ENDIAN macro's *//* Some hosts don't define LITTLE_ENDIAN or BIG_ENDIAN, help them out */#ifndef LITTLE_ENDIAN#define LITTLE_ENDIAN 1234#endif#ifndef BIG_ENDIAN#define BIG_ENDIAN 4321#endif/* SunOS on SPARC: Big endian last time I looked */#if defined(sparc) || defined(__sparc__)# if (WITH_HOST_BYTE_ORDER == 0)# undef WITH_HOST_BYTE_ORDER# define WITH_HOST_BYTE_ORDER BIG_ENDIAN# endif# if (WITH_HOST_BYTE_ORDER != BIG_ENDIAN)# error "sun was big endian last time I looked ..."# endif#endif/* Random x86 Little endian last time I looked */#if defined(i386) || defined(i486) || defined(i586) || defined (i686) || defined(__i386__) || defined(__i486__) || defined(__i586__) || defined (__i686__)# if (WITH_HOST_BYTE_ORDER == 0)# undef WITH_HOST_BYTE_ORDER# define WITH_HOST_BYTE_ORDER LITTLE_ENDIAN# endif# if (WITH_HOST_BYTE_ORDER != LITTLE_ENDIAN)# error "x86 was little endian last time I looked ..."# endif#endif#if (defined (__i486__) || defined (__i586__) || defined (__i686__)) && defined(__GNUC__) && WITH_BSWAP#undef htonl#undef ntohl#define htonl(IN) __extension__ ({ int _out; __asm__ ("bswap %0" : "=r" (_out) : "0" (IN)); _out; })#define ntohl(IN) __extension__ ({ int _out; __asm__ ("bswap %0" : "=r" (_out) : "0" (IN)); _out; })#endif/* Power or PowerPC running AIX */#if defined(_POWER) && defined(_AIX)# if (WITH_HOST_BYTE_ORDER == 0)# undef WITH_HOST_BYTE_ORDER# define WITH_HOST_BYTE_ORDER BIG_ENDIAN# endif# if (WITH_HOST_BYTE_ORDER != BIG_ENDIAN)# error "Power/PowerPC AIX was big endian last time I looked ..."# endif#endif/* Solaris running PowerPC */#if defined(__PPC) && defined(__sun__)# if (WITH_HOST_BYTE_ORDER == 0)# undef WITH_HOST_BYTE_ORDER# define WITH_HOST_BYTE_ORDER LITTLE_ENDIAN# endif# if (WITH_HOST_BYTE_ORDER != LITTLE_ENDIAN)# error "Solaris on PowerPCs was little endian last time I looked ..."# endif#endif/* HP/PA */#if defined(__hppa__)# if (WITH_HOST_BYTE_ORDER == 0)# undef WITH_HOST_BYTE_ORDER# define WITH_HOST_BYTE_ORDER BIG_ENDIAN# endif# if (WITH_HOST_BYTE_ORDER != BIG_ENDIAN)# error "HP/PA was big endian last time I looked ..."# endif#endif/* Big endian MIPS */#if defined(__MIPSEB__)# if (WITH_HOST_BYTE_ORDER == 0)# undef WITH_HOST_BYTE_ORDER# define WITH_HOST_BYTE_ORDER BIG_ENDIAN# endif# if (WITH_HOST_BYTE_ORDER != BIG_ENDIAN)# error "MIPSEB was big endian last time I looked ..."# endif#endif/* Little endian MIPS */#if defined(__MIPSEL__)# if (WITH_HOST_BYTE_ORDER == 0)# undef WITH_HOST_BYTE_ORDER# define WITH_HOST_BYTE_ORDER LITTLE_ENDIAN# endif# if (WITH_HOST_BYTE_ORDER != LITTLE_ENDIAN)# error "MIPSEL was little endian last time I looked ..."# endif#endif/* Windows NT */#if defined(__WIN32__)# if (WITH_HOST_BYTE_ORDER == 0)# undef WITH_HOST_BYTE_ORDER# define WITH_HOST_BYTE_ORDER LITTLE_ENDIAN# endif# if (WITH_HOST_BYTE_ORDER != LITTLE_ENDIAN)# error "Windows NT was little endian last time I looked ..."# endif#endif/* Alpha running DEC unix */#if defined(__osf__) && defined(__alpha__)# if (WITH_HOST_BYTE_ORDER == 0)# undef WITH_HOST_BYTE_ORDER# define WITH_HOST_BYTE_ORDER LITTLE_ENDIAN# endif# if (WITH_HOST_BYTE_ORDER != LITTLE_ENDIAN)# error "AXP running DEC unix was little endian last time I looked ..."# endif#endif/* INSERT HERE - additional hosts that do not have LITTLE_ENDIAN and BIG_ENDIAN definitions available. *//* Until devices and tree properties are sorted out, tell sim-config.c not to call the tree_find_foo fns. */#define WITH_TREE_PROPERTIES 0/* endianness of the host/target: If the build process is aware (at compile time) of the endianness of the host/target it is able to eliminate slower generic endian handling code. Possible values are 0 (unknown), LITTLE_ENDIAN, BIG_ENDIAN */#ifndef WITH_HOST_BYTE_ORDER#define WITH_HOST_BYTE_ORDER 0 /*unknown*/#endif#ifndef WITH_TARGET_BYTE_ORDER#define WITH_TARGET_BYTE_ORDER 0 /*unknown*/#endif#ifndef WITH_DEFAULT_TARGET_BYTE_ORDER#define WITH_DEFAULT_TARGET_BYTE_ORDER 0 /* fatal */#endifextern int current_host_byte_order;#define CURRENT_HOST_BYTE_ORDER (WITH_HOST_BYTE_ORDER \ ? WITH_HOST_BYTE_ORDER \ : current_host_byte_order)extern int current_target_byte_order;#define CURRENT_TARGET_BYTE_ORDER (WITH_TARGET_BYTE_ORDER \ ? WITH_TARGET_BYTE_ORDER \ : current_target_byte_order)/* XOR endian. In addition to the above, the simulator can support the horrible XOR endian mode (as found in the PowerPC and MIPS ISA). See sim-core for more information. If WITH_XOR_ENDIAN is non-zero, it specifies the number of bytes potentially involved in the XOR munge. A typical value is 8. */#ifndef WITH_XOR_ENDIAN#define WITH_XOR_ENDIAN 0#endif/* Intel host BSWAP support: Whether to use bswap on the 486 and pentiums rather than the 386 sequence that uses xchgb/rorl/xchgb */#ifndef WITH_BSWAP#define WITH_BSWAP 0#endif/* SMP support: Sets a limit on the number of processors that can be simulated. If WITH_SMP is set to zero (0), the simulator is restricted to suporting only one processor (and as a consequence leaves the SMP code out of the build process). The actual number of processors is taken from the device /options/smp@<nr-cpu> */#if defined (WITH_SMP) && (WITH_SMP > 0)#define MAX_NR_PROCESSORS WITH_SMP#endif#ifndef MAX_NR_PROCESSORS#define MAX_NR_PROCESSORS 1#endif/* Size of target word, address and OpenFirmware Cell: The target word size is determined by the natural size of its reginsters. On most hosts, the address and cell are the same size as a target word. */#ifndef WITH_TARGET_WORD_BITSIZE
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -