* config/tc-alpha.c (O_samegp): New.
[external/binutils.git] / sim / common / sim-config.h
index 59a8c37..9720712 100644 (file)
@@ -19,8 +19,9 @@
     */
 
 
-#ifndef _PSIM_CONFIG_H_
-#define _PSIM_CONFIG_H_
+#ifndef SIM_CONFIG_H
+#define SIM_CONFIG_H
+
 
 /* Host dependant:
 
@@ -55,7 +56,6 @@
 
 #if defined(__linux__)
 # include <endian.h>
-# include <asm/byteorder.h>
 # if defined(__LITTLE_ENDIAN) && !defined(LITTLE_ENDIAN)
 #  define LITTLE_ENDIAN __LITTLE_ENDIAN
 # endif
 
 /* INSERT HERE - additional hosts that do not have LITTLE_ENDIAN and
    BIG_ENDIAN definitions available.  */
+\f
+/* 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:
@@ -272,7 +276,7 @@ extern int current_target_byte_order;
    The actual number of processors is taken from the device
    /options/smp@<nr-cpu> */
 
-#if defined (WITH_SMP) && WITH_SMP > 0
+#if defined (WITH_SMP) && (WITH_SMP > 0)
 #define MAX_NR_PROCESSORS              WITH_SMP
 #endif
 
@@ -281,19 +285,28 @@ extern int current_target_byte_order;
 #endif
 
 
-/* Word size of host/target:
+/* Size of target word, address and OpenFirmware Cell:
+
+   The target word size is determined by the natural size of its
+   reginsters.
 
-   Set these according to your host and target requirements.  At this
-   point in time, I've only compiled (not run) for a 64bit and never
-   built for a 64bit host.  This will always remain a compile time
-   option */
+   On most hosts, the address and cell are the same size as a target
+   word.  */
 
 #ifndef WITH_TARGET_WORD_BITSIZE
-#define WITH_TARGET_WORD_BITSIZE        32 /* compiled only */
+#define WITH_TARGET_WORD_BITSIZE        32
+#endif
+
+#ifndef WITH_TARGET_ADDRESS_BITSIZE
+#define WITH_TARGET_ADDRESS_BITSIZE    WITH_TARGET_WORD_BITSIZE
+#endif
+
+#ifndef WITH_TARGET_CELL_BITSIZE
+#define WITH_TARGET_CELL_BITSIZE       WITH_TARGET_WORD_BITSIZE
 #endif
 
-#ifndef WITH_HOST_WORD_BITSIZE
-#define WITH_HOST_WORD_BITSIZE         32 /* 64bit ready? */
+#ifndef WITH_TARGET_FLOATING_POINT_BITSIZE
+#define WITH_TARGET_FLOATING_POINT_BITSIZE 64
 #endif
 
 
@@ -319,48 +332,59 @@ extern int current_target_byte_order;
    expect to see (VEA includes things like coherency and the time
    base) while OEA is what an operating system expects to see.  By
    setting these to specific values, the build process is able to
-   eliminate non relevent environment code
-
-   CURRENT_ENVIRONMENT specifies which of vea or oea is required for
-   the current runtime. */
-
-#if defined (WITH_ENVIRONMENT)
-
-#define USER_ENVIRONMENT               1
-#define VIRTUAL_ENVIRONMENT            2
-#define OPERATING_ENVIRONMENT          3
+   eliminate non relevent environment code.
+
+   STATE_ENVIRONMENT(sd) specifies which of vea or oea is required for
+   the current runtime.
+
+   ALL_ENVIRONMENT is used during configuration as a value for
+   WITH_ENVIRONMENT to indicate the choice is runtime selectable.
+   The default is then USER_ENVIRONMENT [since allowing the user to choose
+   the default at configure time seems like featuritis and since people using
+   OPERATING_ENVIRONMENT have more to worry about than selecting the
+   default].
+   ALL_ENVIRONMENT is also used to set STATE_ENVIRONMENT to the
+   "uninitialized" state.  */
+
+enum sim_environment {
+  ALL_ENVIRONMENT,
+  USER_ENVIRONMENT,
+  VIRTUAL_ENVIRONMENT,
+  OPERATING_ENVIRONMENT
+};
 
-extern int current_environment;
-#define CURRENT_ENVIRONMENT (WITH_ENVIRONMENT \
-                            ? WITH_ENVIRONMENT \
-                            : current_environment)
+/* If the simulator specified SIM_AC_OPTION_ENVIRONMENT, indicate so.  */
+#ifdef WITH_ENVIRONMENT
+#define SIM_HAVE_ENVIRONMENT
+#endif
 
+/* If the simulator doesn't specify SIM_AC_OPTION_ENVIRONMENT in its
+   configure.in, the only supported environment is the user environment.  */
+#ifndef WITH_ENVIRONMENT
+#define WITH_ENVIRONMENT USER_ENVIRONMENT
 #endif
 
+#define DEFAULT_ENVIRONMENT (WITH_ENVIRONMENT != ALL_ENVIRONMENT \
+                            ? WITH_ENVIRONMENT \
+                            : USER_ENVIRONMENT)
 
 
-/* Callback/Default Memory.
+/* Callback & Modulo Memory.
 
    Core includes a builtin memory type (raw_memory) that is
    implemented using an array.  raw_memory does not require any
    additional functions etc.
 
    Callback memory is where the core calls a core device for the data
-   it requires.
+   it requires.  Callback memory can be layered using priorities.
 
-   Default memory is an extenstion of this where for addresses that do
-   not map into either a callback or core memory range a default map
-   can be used.
+   Modulo memory is a variation on raw_memory where ADDRESS & (MODULO
+   - 1) is used as the index into the memory array.
 
-   The OEA model uses callback memory for devices and default memory
-   for buses.
+   The OEA model uses callback memory for devices.
 
    The VEA model uses callback memory to capture `page faults'.
 
-   While it may be possible to eliminate callback/default memory (and
-   hence also eliminate an additional test per memory fetch) it
-   probably is not worth the effort.
-
    BTW, while raw_memory could have been implemented as a callback,
    profiling has shown that there is a biger win (at least for the
    x86) in eliminating a function call for the most common
@@ -370,6 +394,10 @@ extern int current_environment;
 #define WITH_CALLBACK_MEMORY           1
 #endif
 
+#ifndef WITH_MODULO_MEMORY
+#define WITH_MODULO_MEMORY              0
+#endif
+
 
 
 /* Alignment:
@@ -396,9 +424,16 @@ enum sim_alignments {
 extern enum sim_alignments current_alignment;
 
 #if !defined (WITH_ALIGNMENT)
-#define WITH_ALIGNMENT NONSTRICT_ALIGNMENT
+#define WITH_ALIGNMENT 0
+#endif
+
+#if !defined (WITH_DEFAULT_ALIGNMENT)
+#define WITH_DEFAULT_ALIGNMENT 0 /* fatal */
 #endif
 
+
+
+
 #define CURRENT_ALIGNMENT (WITH_ALIGNMENT \
                           ? WITH_ALIGNMENT \
                           : current_alignment)
@@ -543,13 +578,17 @@ extern int current_stdio;
 #endif
 
 
-/* complete/verify/print the simulator configuration */
+/* Set the default state configuration, before parsing argv.  */
 
-extern SIM_RC sim_config
-(SIM_DESC sd);
+extern void sim_config_default (SIM_DESC sd);
 
+/* Complete and verify the simulator configuration.  */
+
+extern SIM_RC sim_config (SIM_DESC sd);
+
+/* Print the simulator configuration.  */
 
 extern void print_sim_config (SIM_DESC sd);
 
 
-#endif /* _PSIM_CONFIG_H */
+#endif