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)
}
#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)
/* set the target byte order */
-#if (WITH_DEVICES)
+#if (WITH_TREE_PROPERTIES)
if (current_target_byte_order == 0)
current_target_byte_order
= (tree_find_boolean_property (root, "/options/little-endian?")
/* set the environment */
-#if (WITH_DEVICES)
- if (current_environment == ALL_ENVIRONMENT)
+#if (WITH_TREE_PROPERTIES)
+ 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 */
-#if defined (WITH_DEVICES)
+#if (WITH_TREE_PROPERTIES)
if (current_alignment == 0)
current_alignment =
(tree_find_boolean_property(root, "/openprom/options/strict-alignment?")
sim_io_printf (sd, "WITH_STDIO = %s\n",
config_stdio_to_a (WITH_STDIO));
+ sim_io_printf (sd, "WITH_TARGET_WORD_MSB = %d\n",
+ 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_WORD_MSB = %d\n",
- WITH_TARGET_WORD_MSB);
+ sim_io_printf (sd, "WITH_TARGET_ADDRESS_BITSIZE = %d\n",
+ WITH_TARGET_ADDRESS_BITSIZE);
+
+ sim_io_printf (sd, "WITH_TARGET_CELL_BITSIZE = %d\n",
+ 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));