aboutsummaryrefslogtreecommitdiff
path: root/sim/common/sim-config.h
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>1997-12-04 02:04:42 +0000
committerDoug Evans <dje@google.com>1997-12-04 02:04:42 +0000
commit22469a10e8be365c0c85af41370cf5aa8e33bb51 (patch)
treedf706e34cfa28efe48b78f89020e079b0f68ac2f /sim/common/sim-config.h
parentb65b4d8b06ade312280a913279d5501180c70992 (diff)
downloadgdb-22469a10e8be365c0c85af41370cf5aa8e33bb51.zip
gdb-22469a10e8be365c0c85af41370cf5aa8e33bb51.tar.gz
gdb-22469a10e8be365c0c85af41370cf5aa8e33bb51.tar.bz2
* Make-common.in (SIM_ENVIRONMENT): New variable.
(CONFIG_CFLAGS): Add it. * aclocal.m4 (SIM_AC_OPTION_ENVIRONMENT): Handle --enable-sim-environment option. * configure: Regenerated. * sim-config.h (environment support): Rewrite. * sim-config.c (current_environment): Define as enum, unconditionally. (current_alignment): Define unconditionally. (config_environment_to_a): Update. (config_alignment_to_a): Fix type of argument. Define unconditionally. (sim_config): Handle environment and alignment determination unconditionally. Delete sanity checks of current_environment, unnecessary. (print_sim_config): Update. * sim-options.c (STANDARD_OPTIONS enum): Add OPTION_ENVIRONMENT. (standard_options): Add --environment. (standard_option_handler): Likewise.
Diffstat (limited to 'sim/common/sim-config.h')
-rw-r--r--sim/common/sim-config.h45
1 files changed, 33 insertions, 12 deletions
diff --git a/sim/common/sim-config.h b/sim/common/sim-config.h
index cea3101..f09eb98 100644
--- a/sim/common/sim-config.h
+++ b/sim/common/sim-config.h
@@ -319,24 +319,45 @@ 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
+ eliminate non relevent environment code.
CURRENT_ENVIRONMENT specifies which of vea or oea is required for
- the current runtime. */
+ 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 `current_environment' to the
+ "unknown" state. */
+
+enum sim_environment {
+ ALL_ENVIRONMENT,
+ USER_ENVIRONMENT,
+ VIRTUAL_ENVIRONMENT,
+ OPERATING_ENVIRONMENT
+};
-#if defined (WITH_ENVIRONMENT)
+/* If the simulator specified SIM_AC_OPTION_ENVIRONMENT, indicate so. */
+#ifdef WITH_ENVIRONMENT
+#define SIM_HAVE_ENVIRONMENT
+#endif
-#define USER_ENVIRONMENT 1
-#define VIRTUAL_ENVIRONMENT 2
-#define OPERATING_ENVIRONMENT 3
+/* 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
-extern int current_environment;
-#define CURRENT_ENVIRONMENT (WITH_ENVIRONMENT \
+#define DEFAULT_ENVIRONMENT (WITH_ENVIRONMENT != ALL_ENVIRONMENT \
? WITH_ENVIRONMENT \
- : current_environment)
-
-#endif
+ : USER_ENVIRONMENT)
+extern enum sim_environment current_environment;
+#define CURRENT_ENVIRONMENT (WITH_ENVIRONMENT != ALL_ENVIRONMENT \
+ ? WITH_ENVIRONMENT \
+ : current_environment)
/* Callback & Modulo Memory.
@@ -394,7 +415,7 @@ 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)