X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=sim%2Fppc%2Foptions.c;h=ddb492f54fb7095ef2d1952da56a700e9f76de39;hb=228c8f4be0c428369ec6b68e25696863d1e62ed7;hp=168a4d0aa6087c889f1a7a904e68632191b46032;hpb=ba62bb1c7408ed5f014c21f3d9fa70d2424fea08;p=deliverable%2Fbinutils-gdb.git diff --git a/sim/ppc/options.c b/sim/ppc/options.c index 168a4d0aa6..ddb492f54f 100644 --- a/sim/ppc/options.c +++ b/sim/ppc/options.c @@ -4,7 +4,7 @@ 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 + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -13,18 +13,18 @@ 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. + along with this program; if not, see . */ #ifndef _OPTIONS_C_ #define _OPTIONS_C_ -#include "basics.h" +#include "cpu.h" #include "options.h" -STATIC_INLINE const char * +STATIC_INLINE_OPTIONS\ +(const char *) options_byte_order (int order) { switch (order) { @@ -36,7 +36,8 @@ options_byte_order (int order) return "UNKNOWN"; } -STATIC_INLINE const char * +STATIC_INLINE_OPTIONS\ +(const char *) options_env (int env) { switch (env) { @@ -49,7 +50,8 @@ options_env (int env) return "UNKNOWN"; } -STATIC_INLINE const char * +STATIC_INLINE_OPTIONS\ +(const char *) options_align (int align) { switch (align) { @@ -61,7 +63,8 @@ options_align (int align) return "UNKNOWN"; } -STATIC_INLINE const char * +STATIC_INLINE_OPTIONS\ +(const char *) options_float (int float_type) { switch (float_type) { @@ -72,7 +75,8 @@ options_float (int float_type) return "UNKNOWN"; } -STATIC_INLINE const char * +STATIC_INLINE_OPTIONS\ +(const char *) options_mon (int mon) { switch (mon) { @@ -85,26 +89,26 @@ options_mon (int mon) return "UNKNOWN"; } -STATIC_INLINE const char * -options_ppc (ppc_model ppc) +STATIC_INLINE_OPTIONS\ +(const char *) +options_inline (int in) { - switch (ppc) { - case PPC_MODEL_UNKNOWN: return "NONE"; - case PPC_MODEL_601: return "601"; - case PPC_MODEL_602: return "602"; - case PPC_MODEL_603: return "603"; - case PPC_MODEL_603e: return "603e"; - case PPC_MODEL_604: return "604"; - case PPC_MODEL_403: return "403"; - case PPC_MODEL_505: return "505"; - case PPC_MODEL_821: return "821"; - case PPC_MODEL_860: return "860"; + switch (in) { + case /*0*/ 0: return "0"; + case /*1*/ REVEAL_MODULE: return "REVEAL_MODULE"; + case /*2*/ INLINE_MODULE: return "INLINE_MODULE"; + case /*3*/ REVEAL_MODULE|INLINE_MODULE: return "REVEAL_MODULE|INLINE_MODULE"; + case /*4*/ PSIM_INLINE_LOCALS: return "PSIM_LOCALS_INLINE"; + case /*5*/ PSIM_INLINE_LOCALS|REVEAL_MODULE: return "PSIM_INLINE_LOCALS|REVEAL_MODULE"; + case /*6*/ PSIM_INLINE_LOCALS|INLINE_MODULE: return "PSIM_INLINE_LOCALS|INLINE_MODULE"; + case /*7*/ ALL_INLINE: return "ALL_INLINE"; } - - return "UNKNOWN"; + return "0"; } -void + +INLINE_OPTIONS\ +(void) print_options (void) { #if defined(_GNUC_) && defined(__VERSION__) @@ -115,7 +119,7 @@ print_options (void) printf_filtered ("WITH_HOST_BYTE_ORDER = %s\n", options_byte_order (WITH_HOST_BYTE_ORDER)); printf_filtered ("WITH_TARGET_BYTE_ORDER = %s\n", options_byte_order (WITH_TARGET_BYTE_ORDER)); - printf_filtered ("WITH_BSWAP = %d\n", WITH_BSWAP); + printf_filtered ("WITH_XOR_ENDIAN = %d\n", WITH_XOR_ENDIAN); printf_filtered ("WITH_SMP = %d\n", WITH_SMP); printf_filtered ("WITH_HOST_WORD_BITSIZE = %d\n", WITH_HOST_WORD_BITSIZE); printf_filtered ("WITH_TARGET_WORD_BITSIZE = %d\n", WITH_TARGET_WORD_BITSIZE); @@ -128,25 +132,28 @@ print_options (void) printf_filtered ("WITH_TRACE = %d\n", WITH_TRACE); printf_filtered ("WITH_ASSERT = %d\n", WITH_ASSERT); printf_filtered ("WITH_MON = %s\n", options_mon (WITH_MON)); - printf_filtered ("WITH_FUNCTION_UNIT = %d\n", WITH_FUNCTION_UNIT); - printf_filtered ("WITH_DEFAULT_PPC_MODEL = %s\n", options_ppc (WITH_DEFAULT_PPC_MODEL)); - printf_filtered ("WITH_PPC_MODEL = %s\n", options_ppc (WITH_PPC_MODEL)); - printf_filtered ("DEFAULT_INLINE = %d\n", DEFAULT_INLINE); - printf_filtered ("SIM_ENDIAN_INLINE = %d\n", SIM_ENDIAN_INLINE); - printf_filtered ("BITS_INLINE = %d\n", BITS_INLINE); - printf_filtered ("CPU_INLINE = %d\n", CPU_INLINE); - printf_filtered ("VM_INLINE = %d\n", VM_INLINE); - printf_filtered ("CORE_INLINE = %d\n", CORE_INLINE); - printf_filtered ("EVENTS_INLINE = %d\n", EVENTS_INLINE); - printf_filtered ("MON_INLINE = %d\n", MON_INLINE); - printf_filtered ("INTERRUPTS_INLINE = %d\n", INTERRUPTS_INLINE); - printf_filtered ("REGISTERS_INLINE = %d\n", REGISTERS_INLINE); - printf_filtered ("DEVICE_TREE_INLINE = %d\n", DEVICE_TREE_INLINE); - printf_filtered ("DEVICES_INLINE = %d\n", DEVICES_INLINE); - printf_filtered ("SPREG_INLINE = %d\n", SPREG_INLINE); - printf_filtered ("SEMANTICS_INLINE = %d\n", SEMANTICS_INLINE); - printf_filtered ("IDECODE_INLINE = %d\n", IDECODE_INLINE); - printf_filtered ("FUNCTION_UNIT_INLINE = %d\n", FUNCTION_UNIT_INLINE); + printf_filtered ("WITH_DEFAULT_MODEL = %s\n", model_name[WITH_DEFAULT_MODEL]); + printf_filtered ("WITH_MODEL = %s\n", model_name[WITH_MODEL]); + printf_filtered ("WITH_MODEL_ISSUE = %d\n", WITH_MODEL_ISSUE); + printf_filtered ("WITH_RESERVED_BITS = %d\n", WITH_RESERVED_BITS); + printf_filtered ("WITH_STDIO = %d\n", WITH_STDIO); + printf_filtered ("DEFAULT_INLINE = %s\n", options_inline (DEFAULT_INLINE)); + printf_filtered ("SIM_ENDIAN_INLINE = %s\n", options_inline (SIM_ENDIAN_INLINE)); + printf_filtered ("BITS_INLINE = %s\n", options_inline (BITS_INLINE)); + printf_filtered ("CPU_INLINE = %s\n", options_inline (CPU_INLINE)); + printf_filtered ("VM_INLINE = %s\n", options_inline (VM_INLINE)); + printf_filtered ("CORE_INLINE = %s\n", options_inline (CORE_INLINE)); + printf_filtered ("EVENTS_INLINE = %s\n", options_inline (EVENTS_INLINE)); + printf_filtered ("MON_INLINE = %s\n", options_inline (MON_INLINE)); + printf_filtered ("INTERRUPTS_INLINE = %s\n", options_inline (INTERRUPTS_INLINE)); + printf_filtered ("REGISTERS_INLINE = %s\n", options_inline (REGISTERS_INLINE)); + printf_filtered ("DEVICE_INLINE = %s\n", options_inline (DEVICE_INLINE)); + printf_filtered ("SPREG_INLINE = %s\n", options_inline (SPREG_INLINE)); + printf_filtered ("SEMANTICS_INLINE = %s\n", options_inline (SEMANTICS_INLINE)); + printf_filtered ("IDECODE_INLINE = %s\n", options_inline (IDECODE_INLINE)); + printf_filtered ("OPTIONS_INLINE = %s\n", options_inline (OPTIONS_INLINE)); + printf_filtered ("OS_EMUL_INLINE = %s\n", options_inline (OS_EMUL_INLINE)); + printf_filtered ("SUPPORT_INLINE = %s\n", options_inline (SUPPORT_INLINE)); #ifdef OPCODE_RULES printf_filtered ("OPCODE rules = %s\n", OPCODE_RULES); @@ -159,6 +166,78 @@ print_options (void) #ifdef DGEN_FLAGS printf_filtered ("DGEN_FLAGS = %s\n", DGEN_FLAGS); #endif + + { + static const char *const defines[] = { +#ifdef __GNUC__ + "__GNUC__", +#endif + +#ifdef __STRICT_ANSI__ + "__STRICT_ANSI__", +#endif + +#ifdef __CHAR_UNSIGNED__ + "__CHAR_UNSIGNED__", +#endif + +#ifdef __OPTIMIZE__ + "__OPTIMIZE__", +#endif + +#ifdef STDC_HEADERS + "STDC_HEADERS", +#endif + +#include "defines.h" + +#ifdef HAVE_TERMIOS_CLINE + "HAVE_TERMIOS_CLINE", +#endif + +#ifdef HAVE_TERMIOS_STRUCTURE + "HAVE_TERMIOS_STRUCTURE", +#endif + +#ifdef HAVE_TERMIO_CLINE + "HAVE_TERMIO_CLINE", +#endif + +#ifdef HAVE_TERMIO_STRUCTURE + "HAVE_TERMIO_STRUCTURE", +#endif + +#ifdef HAVE_DEVZERO + "HAVE_DEVZERO", +#endif + }; + + int i; + int max_len = 0; + int cols; + + for (i = 0; i < ARRAY_SIZE (defines); i++) { + int len = strlen (defines[i]); + if (len > max_len) + max_len = len; + } + + cols = 78 / (max_len + 2); + if (cols < 0) + cols = 1; + + printf_filtered ("\n#defines:"); + for (i = 0; i < ARRAY_SIZE (defines); i++) { + const char *const prefix = ((i % cols) == 0) ? "\n" : ""; + printf_filtered ("%s %s%*s", prefix, defines[i], + (((i == ARRAY_SIZE (defines) - 1) + || (((i + 1) % cols) == 0)) + ? 0 + : max_len + 4 - strlen (defines[i])), + ""); + } + printf_filtered ("\n"); + } } #endif /* _OPTIONS_C_ */