Add option to make options inline
authorMichael Meissner <gnu@the-meissners.org>
Wed, 15 Nov 1995 23:01:47 +0000 (23:01 +0000)
committerMichael Meissner <gnu@the-meissners.org>
Wed, 15 Nov 1995 23:01:47 +0000 (23:01 +0000)
sim/ppc/ChangeLog
sim/ppc/inline.c
sim/ppc/inline.h
sim/ppc/options.c
sim/ppc/options.h [new file with mode: 0644]
sim/ppc/std-config.h

index cd96e8ee3186fb3da09f180ba53ab09c58f9f52f..ec5b7c859f7b8706ab37ed9a293a2e4325836ed8 100644 (file)
@@ -20,6 +20,10 @@ Wed Nov 15 17:32:13 1995  Michael Meissner  <meissner@tiktok.cygnus.com>
        * {ppc-instructions,igen.c}: More global changes to add model
        specific features.
 
+       * inline.{c,h}: Provide for inlining options.c.
+       * options.{c,h}: Ditto.
+       * std-config.h: Add OPTIONS_INLINE.
+
 Tue Nov 14 04:47:25 1995  Michael Meissner  <meissner@tiktok.cygnus.com>
 
        * Makefile.in (devices.o, main.o): Update dependency.
index 894f0c98bff9750414c9260cb69889e647be1f64..b025745fcd71190fb80eaf415ec9d0864b6b67aa 100644 (file)
 #include "model.c"
 #endif
 
+#if OPTIONS_INLINE
+#include "options.c"
+#endif
+
 #if FUNCTION_UNIT_INLINE
 #include "function_unit.c"
 #endif
index 0c191f58d383a2aa7516c7aacd79b860860abd8a..c6112f3a78c04e9ce9cc1ed1ae3cc79f09c1f878 100644 (file)
@@ -69,6 +69,7 @@
 #define INLINE_MODEL static
 #endif
 #define STATIC_MODEL static
+#define EXTERN_MODEL static
 #endif
 
 #if BITS_INLINE
 #endif
 #endif
 
+#if OPTIONS_INLINE
+#if OPTIONS_INLINE == 2
+#define INLINE_OPTIONS static INLINE
+#else
+#define INLINE_OPTIONS static
+#endif
+#endif
+
 
 #endif
index a48a3b7fb1ddc9d4c7432ca0e1eaa7a7bb6613f0..7240b588e897081948b10f8ccc37b3d9b9a6d313 100644 (file)
@@ -85,7 +85,7 @@ options_mon (int mon)
   return "UNKNOWN";
 }
 
-void
+INLINE_OPTIONS void
 print_options (void)
 {
 #if defined(_GNUC_) && defined(__VERSION__)
@@ -96,6 +96,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_XOR_ENDIAN          = %d\n", WITH_XOR_ENDIAN);
   printf_filtered ("WITH_BSWAP               = %d\n", WITH_BSWAP);
   printf_filtered ("WITH_SMP                 = %d\n", WITH_SMP);
   printf_filtered ("WITH_HOST_WORD_BITSIZE   = %d\n", WITH_HOST_WORD_BITSIZE);
@@ -129,6 +130,7 @@ print_options (void)
   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 ("OPTIONS_INLINE           = %d\n", FUNCTION_UNIT_INLINE);
 
 #ifdef OPCODE_RULES
   printf_filtered ("OPCODE rules             = %s\n", OPCODE_RULES);
diff --git a/sim/ppc/options.h b/sim/ppc/options.h
new file mode 100644 (file)
index 0000000..e27b6ae
--- /dev/null
@@ -0,0 +1,30 @@
+/*  This file is part of the program psim.
+
+    Copyright (C) 1994-1995, Andrew Cagney <cagney@highland.com.au>
+
+    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 _OPTIONS_H_
+#define _OPTIONS_H_
+
+#ifndef INLINE_OPTIONS
+#define INLINE_OPTIONS
+#endif
+
+INLINE_OPTIONS void print_options (void);
+
+#endif /* _OPTIONS_H_ */
index 8a77d3ae3d5f74ef21b694fe5f52a583d1020e73..6195db77ec32468a460a996875bb99c3b05ef969 100644 (file)
@@ -49,6 +49,17 @@ extern int current_target_byte_order;
                                   : current_target_byte_order)
 
 
+/* PowerPC XOR endian.
+
+   In addition to the above, the simulator can support the PowerPC's
+   horrible XOR endian mode.  This feature makes it possible to
+   control the endian mode of a processor using the MSR. */
+
+#ifndef WITH_XOR_ENDIAN
+#define WITH_XOR_ENDIAN                8
+#endif
+
+
 /* Intel host BSWAP support:
 
    Whether to use bswap on the 486 and pentiums rather than the 386
@@ -69,7 +80,7 @@ extern int current_target_byte_order;
    /options/smp@<nr-cpu> */
 
 #ifndef WITH_SMP
-#define WITH_SMP                        2
+#define WITH_SMP                        5
 #endif
 #if WITH_SMP
 #define MAX_NR_PROCESSORS              WITH_SMP
@@ -343,7 +354,11 @@ extern ppc_model current_ppc_model;
 /* Your compilers inline reserved word */
 
 #ifndef INLINE
-#if defined(__GNUC__) && defined(__OPTIMIZE__)
+#if defined(__GNUC__) && defined(__OPTIMIZE__) && \
+  (DEFAULT_INLINE || SIM_ENDIAN_INLINE || BITS_INLINE || CPU_INLINE || VM_INLINE || CORE_INLINE \
+   || EVENTS_INLINE || MON_INLINE || INTERRUPTS_INLINE || REGISTERS_INLINE || DEVICE_TREE_INLINE \
+   || DEVICES_INLINE || SPREG_INLINE || SEMANTICS_INLINE || IDECODE_INLINE || MODEL_INLINE \
+   || FUNCTION_UNIT_INLINE)
 #define INLINE __inline__
 #else
 #define INLINE /*inline*/
@@ -485,4 +500,13 @@ extern ppc_model current_ppc_model;
 #define FUNCTION_UNIT_INLINE           DEFAULT_INLINE
 #endif
 
+/* Code to print out what options we were compiled with.  Because this
+   is called at process startup, it doesn't have to be inlined, but
+   if it isn't brought in and the model routines are inline, the model
+   routines will be pulled in twice.  */
+
+#ifndef OPTIONS_INLINE
+#define OPTIONS_INLINE                 (DEFAULT_INLINE ? 1 : 0)
+#endif
+
 #endif /* _CONFIG_H */