diff options
Diffstat (limited to 'sim')
-rw-r--r-- | sim/igen/ChangeLog | 2 | ||||
-rw-r--r-- | sim/igen/igen.c | 56 |
2 files changed, 36 insertions, 22 deletions
diff --git a/sim/igen/ChangeLog b/sim/igen/ChangeLog index 3637e16..696c4b6 100644 --- a/sim/igen/ChangeLog +++ b/sim/igen/ChangeLog @@ -1,5 +1,7 @@ Mon Sep 15 15:47:21 1997 Andrew Cagney <cagney@b1.cygnus.com> + * igen.c (gen_run_c): Handle non-multi-sim case. + * gen-support.c (gen_support_h): Define SD_ - to replace _SD. Define CIA from cia. diff --git a/sim/igen/igen.c b/sim/igen/igen.c index ae2d0ec..f836d64 100644 --- a/sim/igen/igen.c +++ b/sim/igen/igen.c @@ -854,41 +854,53 @@ gen_run_c (lf *file, lf_printf (file, " int siggnal)\n"); lf_printf (file, "{\n"); lf_indent (file, +2); - lf_printf (file, "int mach;\n"); - lf_printf (file, "if (STATE_ARCHITECTURE (sd) == NULL)\n"); - lf_printf (file, " mach = 0;\n"); - lf_printf (file, "else\n"); - lf_printf (file, " mach = STATE_ARCHITECTURE (sd)->mach;\n"); - lf_printf (file, "switch (mach)\n"); - lf_printf (file, " {\n"); - lf_indent (file, +2); - for (entry = gen->tables; entry != NULL; entry = entry->next) + if (options.gen.multi_sim) { - lf_printf (file, "case bfd_mach_%s:\n", entry->processor); + lf_printf (file, "int mach;\n"); + lf_printf (file, "if (STATE_ARCHITECTURE (sd) == NULL)\n"); + lf_printf (file, " mach = 0;\n"); + lf_printf (file, "else\n"); + lf_printf (file, " mach = STATE_ARCHITECTURE (sd)->mach;\n"); + lf_printf (file, "switch (mach)\n"); + lf_printf (file, " {\n"); + lf_indent (file, +2); + for (entry = gen->tables; entry != NULL; entry = entry->next) + { + lf_printf (file, "case bfd_mach_%s:\n", entry->processor); + lf_indent (file, +2); + print_function_name (file, + "run", + NULL, /* format name */ + entry->processor, + NULL, /* expanded bits */ + function_name_prefix_engine); + lf_printf (file, " (sd, next_cpu_nr, siggnal);\n"); + lf_printf (file, "break;\n"); + lf_indent (file, -2); + } + lf_printf (file, "default:\n"); lf_indent (file, +2); + lf_printf (file, "sim_engine_abort (sd, NULL, NULL_CIA,\n"); + lf_printf (file, " \"sim_engine_run - unknown machine\");\n"); + lf_printf (file, "break;\n"); + lf_indent (file, -2); + lf_indent (file, -2); + lf_printf (file, " }\n"); + } + else + { print_function_name (file, "run", NULL, /* format name */ - entry->processor, + NULL, /* NO processor */ NULL, /* expanded bits */ function_name_prefix_engine); lf_printf (file, " (sd, next_cpu_nr, siggnal);\n"); - lf_printf (file, "break;\n"); - lf_indent (file, -2); } - lf_printf (file, "default:\n"); - lf_indent (file, +2); - lf_printf (file, "sim_engine_abort (sd, NULL, NULL_CIA,\n"); - lf_printf (file, " \"sim_engine_run - unknown machine\");\n"); - lf_printf (file, "break;\n"); - lf_indent (file, -2); - lf_indent (file, -2); - lf_printf (file, " }\n"); lf_indent (file, -2); lf_printf (file, "}\n"); } - /****************************************************************/ static gen_table * |