diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-12-25 02:13:18 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-12-25 02:18:16 -0500 |
commit | 42a3af5688cd41550e2b517f676f03f2842e615b (patch) | |
tree | 5592399da0fca61cddc8f1c761d9bbd01b6dc412 /sim/common | |
parent | 9e8e7dd966670c80f3b71f8cf7e07f2843b33e80 (diff) | |
download | gdb-42a3af5688cd41550e2b517f676f03f2842e615b.zip gdb-42a3af5688cd41550e2b517f676f03f2842e615b.tar.gz gdb-42a3af5688cd41550e2b517f676f03f2842e615b.tar.bz2 |
sim: device_error: punt
Only four targets implement this function, and three of them do nothing.
The 4th merely calls abort. Since calls to this function are followed
by calls to sim_hw_abort or sim_io_error, this is largely useless. In
the two places where we don't, replace the call with sim_engine_abort.
We want to kill off the WITH_DEVICES logic in favor of WITH_HW, so this
is a good first step.
Diffstat (limited to 'sim/common')
-rw-r--r-- | sim/common/ChangeLog | 10 | ||||
-rw-r--r-- | sim/common/sim-core.c | 24 | ||||
-rw-r--r-- | sim/common/sim-core.h | 1 | ||||
-rw-r--r-- | sim/common/sim-n-core.h | 10 |
4 files changed, 16 insertions, 29 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 0a6cb15..52931d8 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,5 +1,15 @@ 2015-12-25 Mike Frysinger <vapier@gentoo.org> + * sim-core.c (device_error): Delete. + (sim_core_map_attach): Delete calls to device_error. + (sim_core_attach): Likewise. + * sim-core.h (device_error): Delete. + * sim-n-core.h (sim_core_read_aligned_N): Change device_error call + to sim_engine_abort. + (sim_core_write_aligned_N): Likewise. + +2015-12-25 Mike Frysinger <vapier@gentoo.org> + * sim-config.h (WITH_CALLBACK_MEMORY): Delete. * sim-core.c (sim_core_write_buffer): Likewise. * sim-n-core.h (sim_core_read_aligned_N): Likewise. diff --git a/sim/common/sim-core.c b/sim/common/sim-core.c index a5e3cdb..26fabd5 100644 --- a/sim/common/sim-core.c +++ b/sim/common/sim-core.c @@ -28,7 +28,6 @@ #if (WITH_HW) #include "sim-hw.h" -#define device_error(client, ...) device_error ((device *)(client), __VA_ARGS__) #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 @@ -194,9 +193,6 @@ sim_core_map_attach (SIM_DESC sd, /* actually do occasionally get a zero size map */ if (nr_bytes == 0) { -#if (WITH_DEVICES) - device_error (client, "called on sim_core_map_attach with size zero"); -#endif #if (WITH_HW) sim_hw_abort (sd, client, "called on sim_core_map_attach with size zero"); #endif @@ -223,17 +219,6 @@ sim_core_map_attach (SIM_DESC sd, if (next_mapping != NULL && next_mapping->level == level && next_mapping->base < (addr + (nr_bytes - 1))) { -#if (WITH_DEVICES) - device_error (client, "memory map %d:0x%lx..0x%lx (%ld bytes) overlaps %d:0x%lx..0x%lx (%ld bytes)", - space, - (long) addr, - (long) (addr + nr_bytes - 1), - (long) nr_bytes, - next_mapping->space, - (long) next_mapping->base, - (long) next_mapping->bound, - (long) next_mapping->nr_bytes); -#endif #if WITH_HW sim_hw_abort (sd, client, "memory map %d:0x%lx..0x%lx (%ld bytes) overlaps %d:0x%lx..0x%lx (%ld bytes)", space, @@ -297,9 +282,6 @@ sim_core_attach (SIM_DESC sd, if (client != NULL && modulo != 0) { -#if (WITH_DEVICES) - device_error (client, "sim_core_attach - internal error - modulo and callback memory conflict"); -#endif #if (WITH_HW) sim_hw_abort (sd, client, "sim_core_attach - internal error - modulo and callback memory conflict"); #endif @@ -318,9 +300,6 @@ sim_core_attach (SIM_DESC sd, } if (mask != sizeof (unsigned64) - 1) { -#if (WITH_DEVICES) - device_error (client, "sim_core_attach - internal error - modulo %lx not power of two", (long) modulo); -#endif #if (WITH_HW) sim_hw_abort (sd, client, "sim_core_attach - internal error - modulo %lx not power of two", (long) modulo); #endif @@ -331,9 +310,6 @@ sim_core_attach (SIM_DESC sd, /* verify consistency between device and buffer */ if (client != NULL && optional_buffer != NULL) { -#if (WITH_DEVICES) - device_error (client, "sim_core_attach - internal error - conflicting buffer and attach arguments"); -#endif #if (WITH_HW) sim_hw_abort (sd, client, "sim_core_attach - internal error - conflicting buffer and attach arguments"); #endif diff --git a/sim/common/sim-core.h b/sim/common/sim-core.h index a60e60a..bf98232 100644 --- a/sim/common/sim-core.h +++ b/sim/common/sim-core.h @@ -351,7 +351,6 @@ DECLARE_SIM_CORE_READ_N(misaligned,7,8) #if (WITH_DEVICES) /* TODO: create sim/common/device.h */ /* These are defined with each particular cpu. */ -void device_error (device *me, const char *message, ...) __attribute__((format (printf, 2, 3))); 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 diff --git a/sim/common/sim-n-core.h b/sim/common/sim-n-core.h index f57e8f8..3393f19 100644 --- a/sim/common/sim-n-core.h +++ b/sim/common/sim-n-core.h @@ -169,8 +169,9 @@ sim_core_read_aligned_N(sim_cpu *cpu, { unsigned_M data; if (device_io_read_buffer (mapping->device, &data, mapping->space, addr, N, CPU_STATE (cpu), cpu, cia) != N) - device_error (mapping->device, "internal error - %s - io_read_buffer should not fail", - XSTRING (sim_core_read_aligned_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; } @@ -300,8 +301,9 @@ sim_core_write_aligned_N(sim_cpu *cpu, { unsigned_M data = H2T_M (val); if (device_io_write_buffer (mapping->device, &data, mapping->space, addr, N, CPU_STATE (cpu), cpu, cia) != N) - device_error (mapping->device, "internal error - %s - io_write_buffer should not fail", - XSTRING (sim_core_write_aligned_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 |