X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=sim%2Fcommon%2Fsim-core.h;h=7f338b79ba481cf409f73e2b953df62d8bee0f29;hb=1ce22eebea40573551c2db2e7c83951154d14c81;hp=e0f25fcf8a3b8569114b30e3f8e84c151cfe530a;hpb=e4d013fc0f3df3200be2dca48ed2e330e8a4ddf9;p=deliverable%2Fbinutils-gdb.git diff --git a/sim/common/sim-core.h b/sim/common/sim-core.h index e0f25fcf8a..7f338b79ba 100644 --- a/sim/common/sim-core.h +++ b/sim/common/sim-core.h @@ -1,6 +1,6 @@ /* The common simulator framework for GDB, the GNU Debugger. - Copyright 2002, 2007, 2008, 2009 Free Software Foundation, Inc. + Copyright 2002-2020 Free Software Foundation, Inc. Contributed by Andrew Cagney and Red Hat. @@ -57,11 +57,7 @@ struct _sim_core_mapping { void *free_buffer; void *buffer; /* callback map */ -#if (WITH_HW) struct hw *device; -#else - device *device; -#endif /* tracing */ int trace; /* growth */ @@ -93,7 +89,7 @@ struct _sim_core { typedef struct _sim_cpu_core { sim_core_common common; - address_word xor[WITH_XOR_ENDIAN + 1]; /* +1 to avoid zero-sized array */ + address_word byte_xor[WITH_XOR_ENDIAN + 1]; /* +1 to avoid zero-sized array */ } sim_cpu_core; @@ -119,10 +115,9 @@ extern SIM_RC sim_core_install (SIM_DESC sd); translated into ADDRESS_SPACE:OFFSET before being passed to the client device. - MODULO - when the simulator has been configured WITH_MODULO support - and is greater than zero, specifies that accesses to the region - [ADDR .. ADDR+NR_BYTES) should be mapped onto the sub region [ADDR - .. ADDR+MODULO). The modulo value must be a power of two. + MODULO - Specifies that accesses to the region [ADDR .. ADDR+NR_BYTES) + should be mapped onto the sub region [ADDR .. ADDR+MODULO). The modulo + value must be a power of two. DEVICE - When non NULL, indicates that this is a callback memory space and specified device's memory callback handler should be @@ -145,11 +140,7 @@ extern void sim_core_attach address_word addr, address_word nr_bytes, unsigned modulo, -#if (WITH_HW) struct hw *client, -#else - device *client, -#endif void *optional_buffer); @@ -241,6 +232,14 @@ extern unsigned sim_core_xor_write_buffer unsigned nr_bytes); +/* Translate an address based on a map. */ + +extern void *sim_core_trans_addr +(SIM_DESC sd, + sim_cpu *cpu, + unsigned map, + address_word addr); + /* Fixed sized, processor oriented, read/write. @@ -278,7 +277,7 @@ DECLARE_SIM_CORE_WRITE_N(aligned,4,4) DECLARE_SIM_CORE_WRITE_N(aligned,8,8) DECLARE_SIM_CORE_WRITE_N(aligned,16,16) -#define sim_core_write_unaligned_1 sim_core_write_aligned_1 +#define sim_core_write_unaligned_1 sim_core_write_aligned_1 DECLARE_SIM_CORE_WRITE_N(unaligned,2,2) DECLARE_SIM_CORE_WRITE_N(unaligned,4,4) DECLARE_SIM_CORE_WRITE_N(unaligned,8,8) @@ -340,14 +339,4 @@ DECLARE_SIM_CORE_READ_N(misaligned,7,8) #undef DECLARE_SIM_CORE_READ_N - -#if (WITH_DEVICES) -/* TODO: create sim/common/device.h */ -/* These are defined with each particular cpu. */ -void device_error (device *me, char* message, ...); -int device_io_read_buffer(device *me, void *dest, int space, address_word addr, unsigned nr_bytes, SIM_DESC sd, sim_cpu *processor, sim_cia cia); -int device_io_write_buffer(device *me, const void *source, int space, address_word addr, unsigned nr_bytes, SIM_DESC sd, sim_cpu *processor, sim_cia cia); -#endif - - #endif