Skip to content

Commit 01488f7

Browse files
committed
Remove target/riscv/asm.h
The file asm.h is only used by riscv-011.c. Remove the whole asm.h file and inline the two functions into riscv-011.c which is the only place of use. Change-Id: Ifa4b2b87ab9f3f50c78a75361003ce478bfd9d5f Signed-off-by: Jan Matyas <[email protected]>
1 parent eb9ba21 commit 01488f7

File tree

4 files changed

+26
-42
lines changed

4 files changed

+26
-42
lines changed

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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,32 @@ static unsigned int slot_offset(const struct target *target, slot_t slot)
251251
return 0; /* Silence -Werror=return-type */
252252
}
253253

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

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)