From 383861bd08c47a160f54351e6b8519140b9aad8e Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 21 Jan 2016 21:00:25 -0500 Subject: sim: invert sim_state storage Currently all ports have to declare sim_state themselves in their sim-main.h and then embed the common sim_state_base & sim_cpu in it. This dynamic makes it impossible to share common object code among multiple ports because the core data structure is always different. Let's invert this relationship: common code declares sim_state, and if the port actually needs state on a per-instance basis, it can use the new arch_data field for it. Most ports don't actually use it, so they don't need to declare anything at all. This is the first in a series of changes: it adds a define to select between the old & new layouts, then converts all the ports that don't need custom state over to the new layout. --- sim/v850/sim-main.h | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'sim/v850/sim-main.h') diff --git a/sim/v850/sim-main.h b/sim/v850/sim-main.h index 6556273..6dc5c44 100644 --- a/sim/v850/sim-main.h +++ b/sim/v850/sim-main.h @@ -1,6 +1,8 @@ #ifndef SIM_MAIN_H #define SIM_MAIN_H +#define SIM_HAVE_COMMON_SIM_STATE + /* The v850 has 32bit words, numbered 31 (MSB) to 0 (LSB) */ #define WITH_TARGET_WORD_MSB 31 @@ -48,18 +50,6 @@ struct _sim_cpu sim_cpu_base base; }; -struct sim_state { - sim_cpu *cpu[MAX_NR_PROCESSORS]; -#if 0 - SIM_ADDR rom_size; - SIM_ADDR low_end; - SIM_ADDR high_start; - SIM_ADDR high_base; - void *mem; -#endif - sim_state_base base; -}; - /* For compatibility, until all functions converted to passing SIM_DESC as an argument */ extern SIM_DESC simulator; -- cgit v1.1