Skip to content

Commit e870c5f

Browse files
authored
Merge pull request #1206 from JanMatCodasip/jm-codasip/remove-asm-h
Remove target/riscv/asm.h
2 parents 57b58b7 + c1dfb0d commit e870c5f

File tree

5 files changed

+26
-44
lines changed

5 files changed

+26
-44
lines changed

src/target/riscv/Makefile.am

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
noinst_LTLIBRARIES += %D%/libriscv.la
44
%C%_libriscv_la_SOURCES = \
5-
%D%/asm.h \
65
%D%/batch.h \
76
%D%/debug_defines.h \
87
%D%/debug_reg_printer.h \

src/target/riscv/asm.h

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/target/riscv/program.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "program.h"
1111
#include "helper/log.h"
1212

13-
#include "asm.h"
1413
#include "debug_defines.h"
1514
#include "encoding.h"
1615

src/target/riscv/riscv-011.c

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include "riscv.h"
2727
#include "riscv_reg.h"
2828
#include "riscv-011_reg.h"
29-
#include "asm.h"
3029
#include "gdb_regs.h"
3130
#include "field_helpers.h"
3231

@@ -251,6 +250,32 @@ static unsigned int slot_offset(const struct target *target, slot_t slot)
251250
return 0; /* Silence -Werror=return-type */
252251
}
253252

253+
static uint32_t load(const struct target *target, unsigned int rd,
254+
unsigned int base, uint16_t offset)
255+
{
256+
switch (riscv_xlen(target)) {
257+
case 32:
258+
return lw(rd, base, offset);
259+
case 64:
260+
return ld(rd, base, offset);
261+
}
262+
assert(0);
263+
return 0; /* Silence -Werror=return-type */
264+
}
265+
266+
static uint32_t store(const struct target *target, unsigned int src,
267+
unsigned int base, uint16_t offset)
268+
{
269+
switch (riscv_xlen(target)) {
270+
case 32:
271+
return sw(src, base, offset);
272+
case 64:
273+
return sd(src, base, offset);
274+
}
275+
assert(0);
276+
return 0; /* Silence -Werror=return-type */
277+
}
278+
254279
static uint32_t load_slot(const struct target *target, unsigned int dest,
255280
slot_t slot)
256281
{

src/target/riscv/riscv-013.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include "debug_defines.h"
3232
#include "rtos/rtos.h"
3333
#include "program.h"
34-
#include "asm.h"
3534
#include "batch.h"
3635
#include "debug_reg_printer.h"
3736
#include "field_helpers.h"

0 commit comments

Comments
 (0)