This commit was generated by cvs2svn to track changes on a CVS vendor
[deliverable/binutils-gdb.git] / sim / common / sim-config.c
index 278219e24fdba30c77ab298470e8d2256be4537b..10a19aaa2051ae518f3da268b2c105a4388f3fc5 100644 (file)
@@ -28,13 +28,6 @@ int current_host_byte_order;
 int current_target_byte_order;
 int current_stdio;
 
-/* The currently selected environment.
-   This isn't used unless the choice is runtime selectable.
-   The proper way to determine the currently selected environment
-   is with the CURRENT_ENVIRONMENT macro.
-   This is set to ALL_ENVIRONMENT to indicate none has been selected yet.  */
-enum sim_environment current_environment = ALL_ENVIRONMENT;
-
 enum sim_alignments current_alignment;
 
 #if defined (WITH_FLOATING_POINT)
@@ -130,6 +123,18 @@ config_floating_point_to_a (int floating_point)
 }
 #endif
 
+/* Set the default environment, prior to parsing argv.  */
+
+void
+sim_config_default (SIM_DESC sd)
+{
+   /* Set the current environment to ALL_ENVIRONMENT to indicate none has been
+      selected yet.  This is so that after parsing argv, we know whether the
+      environment was explicitly specified or not.  */
+  STATE_ENVIRONMENT (sd) = ALL_ENVIRONMENT;
+}
+
+/* Complete and verify the simulation environment.  */
 
 SIM_RC
 sim_config (SIM_DESC sd)
@@ -228,24 +233,24 @@ sim_config (SIM_DESC sd)
   
   /* set the environment */
 #if (WITH_TREE_PROPERTIES)
-  if (current_environment == ALL_ENVIRONMENT)
+  if (STATE_ENVIRONMENT (sd) == ALL_ENVIRONMENT)
     {
       const char *env =
        tree_find_string_property(root, "/openprom/options/env");
-      current_environment = ((strcmp(env, "user") == 0
-                             || strcmp(env, "uea") == 0)
-                            ? USER_ENVIRONMENT
-                            : (strcmp(env, "virtual") == 0
-                               || strcmp(env, "vea") == 0)
-                            ? VIRTUAL_ENVIRONMENT
-                            : (strcmp(env, "operating") == 0
-                               || strcmp(env, "oea") == 0)
-                            ? OPERATING_ENVIRONMENT
-                            : ALL_ENVIRONMENT);
+      STATE_ENVIRONMENT (sd) = ((strcmp(env, "user") == 0
+                                || strcmp(env, "uea") == 0)
+                               ? USER_ENVIRONMENT
+                               : (strcmp(env, "virtual") == 0
+                                  || strcmp(env, "vea") == 0)
+                               ? VIRTUAL_ENVIRONMENT
+                               : (strcmp(env, "operating") == 0
+                                  || strcmp(env, "oea") == 0)
+                               ? OPERATING_ENVIRONMENT
+                               : ALL_ENVIRONMENT);
     }
 #endif
-  if (current_environment == ALL_ENVIRONMENT)
-    current_environment = DEFAULT_ENVIRONMENT;
+  if (STATE_ENVIRONMENT (sd) == ALL_ENVIRONMENT)
+    STATE_ENVIRONMENT (sd) = DEFAULT_ENVIRONMENT;
   
   
   /* set the alignment */
@@ -323,16 +328,19 @@ print_sim_config (SIM_DESC sd)
                 config_stdio_to_a (WITH_STDIO));
 
   sim_io_printf (sd, "WITH_TARGET_WORD_MSB     = %d\n",
-               WITH_TARGET_WORD_MSB);
+                WITH_TARGET_WORD_MSB);
 
   sim_io_printf (sd, "WITH_TARGET_WORD_BITSIZE = %d\n",
-               WITH_TARGET_WORD_BITSIZE);
+                WITH_TARGET_WORD_BITSIZE);
 
   sim_io_printf (sd, "WITH_TARGET_ADDRESS_BITSIZE = %d\n",
-               WITH_TARGET_ADDRESS_BITSIZE);
+                WITH_TARGET_ADDRESS_BITSIZE);
 
   sim_io_printf (sd, "WITH_TARGET_CELL_BITSIZE = %d\n",
-               WITH_TARGET_CELL_BITSIZE);
+                WITH_TARGET_CELL_BITSIZE);
+
+  sim_io_printf (sd, "WITH_TARGET_FLOATING_POINT_BITSIZE = %d\n",
+                WITH_TARGET_FLOATING_POINT_BITSIZE);
 
   sim_io_printf (sd, "WITH_ENVIRONMENT = %s\n",
                 config_environment_to_a (WITH_ENVIRONMENT));
This page took 0.024948 seconds and 4 git commands to generate.