1 #ifndef TARGET__RISCV__ASM_H
2 #define TARGET__RISCV__ASM_H
6 /*** Version-independent functions that we don't want in the main address space. ***/
8 static uint32_t load(const struct target *target, unsigned int rd,
9 unsigned int base, uint16_t offset) __attribute__ ((unused));
10 static uint32_t load(const struct target *target, unsigned int rd,
11 unsigned int base, uint16_t offset)
13 switch (riscv_xlen(target)) {
15 return lw(rd, base, offset);
17 return ld(rd, base, offset);
20 return 0; /* Silence -Werror=return-type */
23 static uint32_t store(const struct target *target, unsigned int src,
24 unsigned int base, uint16_t offset) __attribute__ ((unused));
25 static uint32_t store(const struct target *target, unsigned int src,
26 unsigned int base, uint16_t offset)
28 switch (riscv_xlen(target)) {
30 return sw(src, base, offset);
32 return sd(src, base, offset);
35 return 0; /* Silence -Werror=return-type */