diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-12-26 20:20:23 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-12-26 20:38:31 -0500 |
commit | 1b393626cef48974502e7077b191555b56680ee6 (patch) | |
tree | 90319a4085b670ee672d0bf335352b45789a07e9 /sim/common | |
parent | 466b619e95908dc073b78413f0d0d0b1cb97e4b5 (diff) | |
download | gdb-1b393626cef48974502e7077b191555b56680ee6.zip gdb-1b393626cef48974502e7077b191555b56680ee6.tar.gz gdb-1b393626cef48974502e7077b191555b56680ee6.tar.bz2 |
sim: punt WITH_DEVICES & tconfig.h support
No arch is using this anymore, and we want all new ports using the
hardware framework instead. Punt WITH_DEVICES and the two callbacks
device_io_{read,write}_buffer.
We can also punt the tconfig.h file as no port is using it anymore.
This fixes in-tree builds that get confused by picking up the wrong
one (common/ vs <port>/) caused by commit ae7d0cac8ce971f7108d270c.
Any port that needs to set up a global define can use their own
sim-main.h file that they must provide regardless.
Diffstat (limited to 'sim/common')
-rw-r--r-- | sim/common/ChangeLog | 19 | ||||
-rw-r--r-- | sim/common/Make-common.in | 3 | ||||
-rw-r--r-- | sim/common/acinclude.m4 | 3 | ||||
-rw-r--r-- | sim/common/config.in | 2 | ||||
-rwxr-xr-x | sim/common/configure | 6 | ||||
-rw-r--r-- | sim/common/sim-core.c | 54 | ||||
-rw-r--r-- | sim/common/sim-core.h | 17 | ||||
-rw-r--r-- | sim/common/sim-n-core.h | 23 | ||||
-rw-r--r-- | sim/common/tconfig.h | 3 |
9 files changed, 22 insertions, 108 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 05cdda8..9d15f64 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,5 +1,24 @@ 2015-12-26 Mike Frysinger <vapier@gentoo.org> + * acinclude.m4 (AH_BOTTOM): Delete tconfig.h appending. + * config.in, configure: Regenerate. + * Make-common.in (sim-basics_h): Delete tconfig.h. + (distclean): Likewise. + * sim-core.c (device_io_read_buffer, device_io_write_buffer): Delete. + (new_sim_core_mapping): Delete WITH_HW and device *device. + (sim_core_map_attach, sim_core_attach): Likewise. + (sim_core_read_buffer): Delete WITH_DEVICES logic. + (sim_core_write_buffer): Likewise. + * sim-core.h (struct _sim_core_mapping): Delete WITH_HW and device + *device. + (sim_core_attach): Likewise. + (device_io_read_buffer, device_io_write_buffer): Delete. + * sim-n-core.h (sim_core_read_aligned_N): Delete WITH_DEVICES logic. + (sim_core_write_aligned_N): Likewise. + * tconfig.h: Delete file. + +2015-12-26 Mike Frysinger <vapier@gentoo.org> + * sim-core.c (sim_core_read_buffer): Move cia decl to top of func. Call sim_cpu_hw_io_read_buffer if cpu is valid. (sim_core_write_buffer): Move cia decl to top of func. Call diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in index 2566bf4..d2a84d4 100644 --- a/sim/common/Make-common.in +++ b/sim/common/Make-common.in @@ -361,7 +361,6 @@ sim-base_h = $(srccom)/sim-base.h \ $(sim-cpu_h) sim-basics_h = $(srccom)/sim-basics.h \ ../common/cconfig.h \ - tconfig.h \ $(sim-config_h) \ $(callback_h) \ $(sim-inline_h) \ @@ -536,7 +535,7 @@ clean: $(SIM_EXTRA_CLEAN) distclean mostlyclean maintainer-clean realclean: clean $(SIM_EXTRA_DISTCLEAN) rm -f TAGS rm -f Makefile config.cache config.log config.status .gdbinit - rm -f tconfig.h config.h stamp-h + rm -f config.h stamp-h rm -f targ-vals.def .c.o: diff --git a/sim/common/acinclude.m4 b/sim/common/acinclude.m4 index 672227e..ebb6d1b 100644 --- a/sim/common/acinclude.m4 +++ b/sim/common/acinclude.m4 @@ -53,9 +53,6 @@ AR=${AR-ar} AC_SUBST(AR) AC_PROG_RANLIB -dnl Pull in the target configuration file directly. -AH_BOTTOM([#include "tconfig.h"]) - # Some of the common include files depend on bfd.h, and bfd.h checks # that config.h is included first by testing that the PACKAGE macro # is defined. diff --git a/sim/common/config.in b/sim/common/config.in index 1904046..4f3c89f 100644 --- a/sim/common/config.in +++ b/sim/common/config.in @@ -207,5 +207,3 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE - -#include "tconfig.h" diff --git a/sim/common/configure b/sim/common/configure index 7f1ef52..d58935d 100755 --- a/sim/common/configure +++ b/sim/common/configure @@ -6547,8 +6547,6 @@ else fi - - # Some of the common include files depend on bfd.h, and bfd.h checks # that config.h is included first by testing that the PACKAGE macro # is defined. @@ -10564,7 +10562,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10567 "configure" +#line 10565 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10670,7 +10668,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10673 "configure" +#line 10671 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/sim/common/sim-core.c b/sim/common/sim-core.c index 68212e9..eb4cbb2 100644 --- a/sim/common/sim-core.c +++ b/sim/common/sim-core.c @@ -28,8 +28,6 @@ #if (WITH_HW) #include "sim-hw.h" -#define device_io_read_buffer(client, ...) device_io_read_buffer ((device *)(client), __VA_ARGS__) -#define device_io_write_buffer(client, ...) device_io_write_buffer ((device *)(client), __VA_ARGS__) #endif /* "core" module install handler. @@ -141,11 +139,7 @@ new_sim_core_mapping (SIM_DESC sd, address_word addr, address_word nr_bytes, unsigned modulo, -#if WITH_HW struct hw *device, -#else - device *device, -#endif void *buffer, void *free_buffer) { @@ -174,11 +168,7 @@ sim_core_map_attach (SIM_DESC sd, address_word addr, address_word nr_bytes, unsigned modulo, -#if WITH_HW struct hw *client, /*callback/default*/ -#else - device *client, /*callback/default*/ -#endif void *buffer, /*raw_memory*/ void *free_buffer) /*raw_memory*/ { @@ -264,11 +254,7 @@ sim_core_attach (SIM_DESC sd, address_word addr, address_word nr_bytes, unsigned modulo, -#if WITH_HW struct hw *client, -#else - device *client, -#endif void *optional_buffer) { sim_core *memory = STATE_CORE (sd); @@ -485,26 +471,6 @@ sim_core_read_buffer (SIM_DESC sd, 0 /*dont-abort*/, NULL, NULL_CIA); if (mapping == NULL) break; -#if (WITH_DEVICES) - if (mapping->device != NULL) - { - int nr_bytes = len - count; - sim_cia cia = cpu ? CPU_PC_GET (cpu) : NULL_CIA; - if (raddr + nr_bytes - 1> mapping->bound) - nr_bytes = mapping->bound - raddr + 1; - if (device_io_read_buffer (mapping->device, - (unsigned_1*)buffer + count, - mapping->space, - raddr, - nr_bytes, - sd, - cpu, - cia) != nr_bytes) - break; - count += nr_bytes; - continue; - } -#endif #if (WITH_HW) if (mapping->device != NULL) { @@ -563,26 +529,6 @@ sim_core_write_buffer (SIM_DESC sd, 0 /*dont-abort*/, NULL, NULL_CIA); if (mapping == NULL) break; -#if (WITH_DEVICES) - if (mapping->device != NULL) - { - int nr_bytes = len - count; - sim_cia cia = cpu ? CPU_PC_GET (cpu) : NULL_CIA; - if (raddr + nr_bytes - 1 > mapping->bound) - nr_bytes = mapping->bound - raddr + 1; - if (device_io_write_buffer (mapping->device, - (unsigned_1*)buffer + count, - mapping->space, - raddr, - nr_bytes, - sd, - cpu, - cia) != nr_bytes) - break; - count += nr_bytes; - continue; - } -#endif #if (WITH_HW) if (mapping->device != NULL) { diff --git a/sim/common/sim-core.h b/sim/common/sim-core.h index bf98232..6fdf120 100644 --- a/sim/common/sim-core.h +++ b/sim/common/sim-core.h @@ -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 */ @@ -144,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); @@ -347,13 +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. */ -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 diff --git a/sim/common/sim-n-core.h b/sim/common/sim-n-core.h index 3393f19..0867cc2 100644 --- a/sim/common/sim-n-core.h +++ b/sim/common/sim-n-core.h @@ -164,18 +164,6 @@ sim_core_read_aligned_N(sim_cpu *cpu, mapping = sim_core_find_mapping (core, map, addr, N, read_transfer, 1 /*abort*/, cpu, cia); do { -#if (WITH_DEVICES) - if (mapping->device != NULL) - { - unsigned_M data; - if (device_io_read_buffer (mapping->device, &data, mapping->space, addr, N, CPU_STATE (cpu), cpu, cia) != N) - sim_engine_abort (CPU_STATE (cpu), cpu, cia, - "internal error - %s - io_read_buffer should not fail", - XSTRING (sim_core_read_aligned_N)); - val = T2H_M (data); - break; - } -#endif #if (WITH_HW) if (mapping->device != NULL) { @@ -296,17 +284,6 @@ sim_core_write_aligned_N(sim_cpu *cpu, mapping = sim_core_find_mapping (core, map, addr, N, write_transfer, 1 /*abort*/, cpu, cia); do { -#if (WITH_DEVICES) - if (mapping->device != NULL) - { - unsigned_M data = H2T_M (val); - if (device_io_write_buffer (mapping->device, &data, mapping->space, addr, N, CPU_STATE (cpu), cpu, cia) != N) - sim_engine_abort (CPU_STATE (cpu), cpu, cia, - "internal error - %s - io_write_buffer should not fail", - XSTRING (sim_core_read_aligned_N)); - break; - } -#endif #if (WITH_HW) if (mapping->device != NULL) { diff --git a/sim/common/tconfig.h b/sim/common/tconfig.h deleted file mode 100644 index eaa4832..0000000 --- a/sim/common/tconfig.h +++ /dev/null @@ -1,3 +0,0 @@ -/* Default target configuration file. - To override this, create file `tconfig.in' in the simulator's - source directory. */ |