1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #ifndef TARGET__RISCV__ASM_H
4 #define TARGET__RISCV__ASM_H
8 /*** Version-independent functions that we don't want in the main address space. ***/
10 static uint32_t load(const struct target *target, unsigned int rd,
11 unsigned int base, uint16_t offset) __attribute__ ((unused));
12 static uint32_t load(const struct target *target, unsigned int rd,
13 unsigned int base, uint16_t offset)
15 switch (riscv_xlen(target)) {
17 return lw(rd, base, offset);
19 return ld(rd, base, offset);
22 return 0; /* Silence -Werror=return-type */
25 static uint32_t store(const struct target *target, unsigned int src,
26 unsigned int base, uint16_t offset) __attribute__ ((unused));
27 static uint32_t store(const struct target *target, unsigned int src,
28 unsigned int base, uint16_t offset)
30 switch (riscv_xlen(target)) {
32 return sw(src, base, offset);
34 return sd(src, base, offset);
37 return 0; /* Silence -Werror=return-type */