diff --git a/src/target/riscv/Makefile.am b/src/target/riscv/Makefile.am index 328a317b1..74f4524c7 100644 --- a/src/target/riscv/Makefile.am +++ b/src/target/riscv/Makefile.am @@ -2,7 +2,6 @@ noinst_LTLIBRARIES += %D%/libriscv.la %C%_libriscv_la_SOURCES = \ - %D%/asm.h \ %D%/batch.h \ %D%/debug_defines.h \ %D%/debug_reg_printer.h \ diff --git a/src/target/riscv/asm.h b/src/target/riscv/asm.h deleted file mode 100644 index 828cd864c..000000000 --- a/src/target/riscv/asm.h +++ /dev/null @@ -1,40 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ - -#ifndef OPENOCD_TARGET_RISCV_ASM_H -#define OPENOCD_TARGET_RISCV_ASM_H - -#include "riscv.h" - -/*** Version-independent functions that we don't want in the main address space. ***/ - -static uint32_t load(const struct target *target, unsigned int rd, - unsigned int base, uint16_t offset) __attribute__ ((unused)); -static uint32_t load(const struct target *target, unsigned int rd, - unsigned int base, uint16_t offset) -{ - switch (riscv_xlen(target)) { - case 32: - return lw(rd, base, offset); - case 64: - return ld(rd, base, offset); - } - assert(0); - return 0; /* Silence -Werror=return-type */ -} - -static uint32_t store(const struct target *target, unsigned int src, - unsigned int base, uint16_t offset) __attribute__ ((unused)); -static uint32_t store(const struct target *target, unsigned int src, - unsigned int base, uint16_t offset) -{ - switch (riscv_xlen(target)) { - case 32: - return sw(src, base, offset); - case 64: - return sd(src, base, offset); - } - assert(0); - return 0; /* Silence -Werror=return-type */ -} - -#endif /* OPENOCD_TARGET_RISCV_ASM_H */ diff --git a/src/target/riscv/program.c b/src/target/riscv/program.c index 6246d0038..47041a72c 100644 --- a/src/target/riscv/program.c +++ b/src/target/riscv/program.c @@ -10,7 +10,6 @@ #include "program.h" #include "helper/log.h" -#include "asm.h" #include "debug_defines.h" #include "encoding.h" diff --git a/src/target/riscv/riscv-011.c b/src/target/riscv/riscv-011.c index 1b89aabfa..672834da7 100644 --- a/src/target/riscv/riscv-011.c +++ b/src/target/riscv/riscv-011.c @@ -26,7 +26,6 @@ #include "riscv.h" #include "riscv_reg.h" #include "riscv-011_reg.h" -#include "asm.h" #include "gdb_regs.h" #include "field_helpers.h" @@ -251,6 +250,32 @@ static unsigned int slot_offset(const struct target *target, slot_t slot) return 0; /* Silence -Werror=return-type */ } +static uint32_t load(const struct target *target, unsigned int rd, + unsigned int base, uint16_t offset) +{ + switch (riscv_xlen(target)) { + case 32: + return lw(rd, base, offset); + case 64: + return ld(rd, base, offset); + } + assert(0); + return 0; /* Silence -Werror=return-type */ +} + +static uint32_t store(const struct target *target, unsigned int src, + unsigned int base, uint16_t offset) +{ + switch (riscv_xlen(target)) { + case 32: + return sw(src, base, offset); + case 64: + return sd(src, base, offset); + } + assert(0); + return 0; /* Silence -Werror=return-type */ +} + static uint32_t load_slot(const struct target *target, unsigned int dest, slot_t slot) { diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index 91f8d330a..4050d409e 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -31,7 +31,6 @@ #include "debug_defines.h" #include "rtos/rtos.h" #include "program.h" -#include "asm.h" #include "batch.h" #include "debug_reg_printer.h" #include "field_helpers.h"