From 82ea14fd9d61893514375b6649e0a74a076d4443 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Fri, 27 Mar 1998 04:25:45 +0000 Subject: Define CPU_INDEX. Initialize. For mips_options, iterate over MAX_NR_PROCESSORS when setting options. --- sim/common/ChangeLog | 7 +++++++ sim/common/sim-base.h | 10 +++++++++- sim/common/sim-module.c | 7 ++++++- 3 files changed, 22 insertions(+), 2 deletions(-) (limited to 'sim/common') diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index ec33093..b23393b 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,10 @@ +Fri Mar 27 14:55:06 1998 Andrew Cagney + + * sim-base.h (CPU_INDEX): Define. + + * sim-utils.c (sim_state_alloc): Initialize. + * sim-module.c (sim_post_argv_init): Ditto. + start-sanitize-am30 Thu Mar 26 10:07:57 1998 Stu Grossman diff --git a/sim/common/sim-base.h b/sim/common/sim-base.h index 654e71e..1c395df 100644 --- a/sim/common/sim-base.h +++ b/sim/common/sim-base.h @@ -1,5 +1,5 @@ /* Simulator pseudo baseclass. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997-1998 Free Software Foundation, Inc. Contributed by Cygnus Support. This file is part of GDB, the GNU debugger. @@ -174,6 +174,10 @@ typedef struct { struct _bfd *prog_bfd; #define STATE_PROG_BFD(sd) ((sd)->base.prog_bfd) + /* Symbol table for prog_bfd */ + struct symbol_cache_entry **prog_syms; +#define STATE_PROG_SYMS(sd) ((sd)->base.prog_syms) + /* The program's text section. */ struct sec *text_section; /* Starting and ending text section addresses from the bfd. */ @@ -243,6 +247,10 @@ typedef struct { SIM_DESC state; #define CPU_STATE(cpu) ((cpu)->base.state) + /* Processor index within the SD_DESC */ + int index; +#define CPU_INDEX(cpu) ((cpu)->base.index) + /* The name of the cpu. */ const char *name; #define CPU_NAME(cpu) ((cpu)->base.name) diff --git a/sim/common/sim-module.c b/sim/common/sim-module.c index 297b133..0fb5471 100644 --- a/sim/common/sim-module.c +++ b/sim/common/sim-module.c @@ -87,6 +87,8 @@ sim_pre_argv_init (SIM_DESC sd, const char *myname) } } + sim_config_default (sd); + /* Install all configured in modules. */ if (sim_module_install (sd) != SIM_RC_OK) return SIM_RC_FAIL; @@ -108,7 +110,10 @@ sim_post_argv_init (SIM_DESC sd) /* Set the cpu->state backlinks for each cpu. */ for (i = 0; i < MAX_NR_PROCESSORS; ++i) - CPU_STATE (STATE_CPU (sd, i)) = sd; + { + CPU_STATE (STATE_CPU (sd, i)) = sd; + CPU_INDEX (STATE_CPU (sd, i)) = i; + } return SIM_RC_OK; } -- cgit v1.1