From 2c88fae9adc45e64367b6651f451ce4440f1c9ec Mon Sep 17 00:00:00 2001 From: Ian Carmichael Date: Mon, 9 Feb 1998 23:53:33 +0000 Subject: [PATCH] * Add hardware_init hook. --- sim/mips/configure.in | 4 +++- sim/mips/interp.c | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sim/mips/configure.in b/sim/mips/configure.in index 5b3a1ca486b..a3b294abfda 100644 --- a/sim/mips/configure.in +++ b/sim/mips/configure.in @@ -201,7 +201,9 @@ AC_SUBST(sim_gen) case "${target}" in # start-sanitize-sky - mips64r59*-sky-*) mips_extra_objs='$(SIM_SKY_OBJS)' ;; + mips64r59*-sky-*) mips_extra_objs='$(SIM_SKY_OBJS)' ; + SIM_SUBTARGET="-DWITH_DEVICES=1 -DDEVICE_INIT=1";; + # end-sanitize-sky *) mips_extra_objs="" ;; esac diff --git a/sim/mips/interp.c b/sim/mips/interp.c index 9045004d728..da161828a08 100644 --- a/sim/mips/interp.c +++ b/sim/mips/interp.c @@ -252,6 +252,15 @@ interrupt_event (SIM_DESC sd, void *data) } +/*---------------------------------------------------------------------------*/ +/*-- Device registration hook -----------------------------------------------*/ +/*---------------------------------------------------------------------------*/ +static device_init(SIM_DESC sd) { +#ifdef DEVICE_INIT + extern void register_devices(SIM_DESC); + register_devices(sd); +#endif +} /*---------------------------------------------------------------------------*/ /*-- GDB simulator interface ------------------------------------------------*/ @@ -292,6 +301,8 @@ sim_open (kind, cb, abfd, argv) MEM_SIZE, /* actual size */ K0BASE); + device_init(sd); + /* getopt will print the error message so we just have to exit if this fails. FIXME: Hmmm... in the case of gdb we need getopt to call print_filtered. */ -- 2.30.2