diff options
author | Doug Evans <dje@google.com> | 1998-02-27 18:39:22 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 1998-02-27 18:39:22 +0000 |
commit | 966df5804d7586c1a30853ffb4aa0663c942c337 (patch) | |
tree | 3451ce3db2f4deec7d55670a701f507c024b6d72 /sim/common/sim-memopt.c | |
parent | 2e7236783eccbd1d0bed7f49aac81e447be5e314 (diff) | |
download | gdb-966df5804d7586c1a30853ffb4aa0663c942c337.zip gdb-966df5804d7586c1a30853ffb4aa0663c942c337.tar.gz gdb-966df5804d7586c1a30853ffb4aa0663c942c337.tar.bz2 |
* sim-base.h (sim_cpu_base): New members name, options.
(sim_cpu_lookup): Add prototype.
* sim-module.c (sim_pre_argv_init): Provide default names for cpus.
* sim-options.h (DECLARE_OPTION_HANDLER): New argument `cpu'.
(sim_add_option_table): Update prototype.
* sim-options.c (sim_add_option_table): New argument `cpu'.
(standard_option_handler,standard_install): Update.
(sim_parse_args): Handle cpu specific options.
(print_help): New static function.
(sim_print_help): Call it. Print cpu specific options.
(find_match): New static function.
(sim_args_command): Call it. Handle cpu specific options.
* sim-utils.c (sim_cpu_lookup): New function.
* sim-memopt.c (memory_option_handler): Update.
(sim_memopt_install): Update.
* sim-model.c (model_option_handler): Update.
(model_install): Update.
* sim-profile.c (profile_option_handler): Update.
(profile_install): Update.
* sim-trace.c (trace_option_handler): Update.
(trace_install): Update.
* sim-watch.c (watchpoint_option_handler): Update.
(sim_watchpoint_install): Update.
* cgen-scache.c (scache_option_handler): Update.
(scache_install): Update.
Diffstat (limited to 'sim/common/sim-memopt.c')
-rw-r--r-- | sim/common/sim-memopt.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/sim/common/sim-memopt.c b/sim/common/sim-memopt.c index 82578c0..b21ea19 100644 --- a/sim/common/sim-memopt.c +++ b/sim/common/sim-memopt.c @@ -180,11 +180,8 @@ parse_addr (char *chp, static SIM_RC -memory_option_handler (sd, opt, arg, is_command) - SIM_DESC sd; - int opt; - char *arg; - int is_command; +memory_option_handler (SIM_DESC sd, sim_cpu *cpu, int opt, + char *arg, int is_command) { switch (opt) { @@ -252,14 +249,15 @@ memory_option_handler (sd, opt, arg, is_command) chp = parse_size (chp + 1, &nr_bytes, &modulo); /* try to attach/insert the main record */ entry = do_memopt_add (sd, level, space, addr, nr_bytes, modulo, - &STATE_MEMOPT (sd), zalloc (nr_bytes)); + &STATE_MEMOPT (sd), + zalloc (modulo ? modulo : nr_bytes)); /* now attach all the aliases */ while (*chp == ',') { int a_level = level; int a_space = space; address_word a_addr = addr; - chp = parse_addr (chp, &a_level, &a_space, &a_addr); + chp = parse_addr (chp + 1, &a_level, &a_space, &a_addr); do_memopt_add (sd, a_level, a_space, a_addr, nr_bytes, modulo, &entry->alias, entry->buffer); } @@ -320,8 +318,7 @@ memory_option_handler (sd, opt, arg, is_command) sim_io_printf (sd, " alias "); if (entry->space != 0) sim_io_printf (sd, "0x%lx:", (long) entry->space); - sim_io_printf (sd, "0x%08lx", - (long) entry->addr); + sim_io_printf (sd, "0x%08lx", (long) entry->addr); if (entry->level != 0) sim_io_printf (sd, "@0x%lx", (long) entry->level); sim_io_printf (sd, ",0x%lx", @@ -334,7 +331,7 @@ memory_option_handler (sd, opt, arg, is_command) { if (alias->space != 0) sim_io_printf (sd, "0x%lx:", (long) alias->space); - sim_io_printf (sd, ",0x%08lx", alias->addr); + sim_io_printf (sd, ",0x%08lx", (long) alias->addr); if (alias->level != 0) sim_io_printf (sd, "@0x%lx", (long) alias->level); } @@ -366,7 +363,7 @@ SIM_RC sim_memopt_install (SIM_DESC sd) { SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER); - sim_add_option_table (sd, memory_options); + sim_add_option_table (sd, NULL, memory_options); sim_module_add_uninstall_fn (sd, sim_memory_uninstall); sim_module_add_init_fn (sd, sim_memory_init); return SIM_RC_OK; |