OpenOCD
asm.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #ifndef TARGET__RISCV__ASM_H
4 #define TARGET__RISCV__ASM_H
5 
6 #include "riscv.h"
7 
8 /*** Version-independent functions that we don't want in the main address space. ***/
9 
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)
14 {
15  switch (riscv_xlen(target)) {
16  case 32:
17  return lw(rd, base, offset);
18  case 64:
19  return ld(rd, base, offset);
20  }
21  assert(0);
22  return 0; /* Silence -Werror=return-type */
23 }
24 
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)
29 {
30  switch (riscv_xlen(target)) {
31  case 32:
32  return sw(src, base, offset);
33  case 64:
34  return sd(src, base, offset);
35  }
36  assert(0);
37  return 0; /* Silence -Werror=return-type */
38 }
39 
40 #endif
static uint32_t load(const struct target *target, unsigned int rd, unsigned int base, uint16_t offset) __attribute__((unused))
Definition: asm.h:12
static uint32_t store(const struct target *target, unsigned int src, unsigned int base, uint16_t offset) __attribute__((unused))
Definition: asm.h:27
struct esp_usb_jtag __attribute__
Definition: armv8.c:804
static uint32_t sw(unsigned int src, unsigned int base, uint16_t offset) __attribute__((unused))
Definition: opcodes.h:81
static uint32_t ld(unsigned int rd, unsigned int base, uint16_t offset) __attribute__((unused))
Definition: opcodes.h:105
static uint32_t sd(unsigned int src, unsigned int base, uint16_t offset) __attribute__((unused))
Definition: opcodes.h:87
static uint32_t lw(unsigned int rd, unsigned int base, uint16_t offset) __attribute__((unused))
Definition: opcodes.h:111
unsigned riscv_xlen(const struct target *target)
Definition: riscv.c:3290
Definition: target.h:120
uint8_t offset[4]
Definition: vdebug.c:9