Merge pull request #1206 from JanMatCodasip/jm-codasip/remove-asm-h

Remove target/riscv/asm.h
This commit is contained in:
Evgeniy Naydanov 2025-01-27 15:56:12 +03:00 committed by GitHub
commit e870c5f2de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 26 additions and 44 deletions

View File

@ -2,7 +2,6 @@
noinst_LTLIBRARIES += %D%/libriscv.la noinst_LTLIBRARIES += %D%/libriscv.la
%C%_libriscv_la_SOURCES = \ %C%_libriscv_la_SOURCES = \
%D%/asm.h \
%D%/batch.h \ %D%/batch.h \
%D%/debug_defines.h \ %D%/debug_defines.h \
%D%/debug_reg_printer.h \ %D%/debug_reg_printer.h \

View File

@ -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 */

View File

@ -10,7 +10,6 @@
#include "program.h" #include "program.h"
#include "helper/log.h" #include "helper/log.h"
#include "asm.h"
#include "debug_defines.h" #include "debug_defines.h"
#include "encoding.h" #include "encoding.h"

View File

@ -26,7 +26,6 @@
#include "riscv.h" #include "riscv.h"
#include "riscv_reg.h" #include "riscv_reg.h"
#include "riscv-011_reg.h" #include "riscv-011_reg.h"
#include "asm.h"
#include "gdb_regs.h" #include "gdb_regs.h"
#include "field_helpers.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 */ 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, static uint32_t load_slot(const struct target *target, unsigned int dest,
slot_t slot) slot_t slot)
{ {

View File

@ -31,7 +31,6 @@
#include "debug_defines.h" #include "debug_defines.h"
#include "rtos/rtos.h" #include "rtos/rtos.h"
#include "program.h" #include "program.h"
#include "asm.h"
#include "batch.h" #include "batch.h"
#include "debug_reg_printer.h" #include "debug_reg_printer.h"
#include "field_helpers.h" #include "field_helpers.h"