OpenOCD
program.h File Reference
Include dependency graph for program.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  riscv_program
 

Macros

#define RISCV_DSCRATCH_COUNT   2
 
#define RISCV_MAX_DEBUG_BUFFER_SIZE   32
 
#define RISCV_REGISTER_COUNT   32
 

Functions

int riscv_program_addi (struct riscv_program *p, enum gdb_regno d, enum gdb_regno s, int16_t i)
 
int riscv_program_csrr (struct riscv_program *p, enum gdb_regno d, enum gdb_regno csr)
 
int riscv_program_csrrci (struct riscv_program *p, enum gdb_regno d, unsigned int z, enum gdb_regno csr)
 
int riscv_program_csrrsi (struct riscv_program *p, enum gdb_regno d, unsigned int z, enum gdb_regno csr)
 
int riscv_program_csrw (struct riscv_program *p, enum gdb_regno s, enum gdb_regno csr)
 
int riscv_program_ebreak (struct riscv_program *p)
 
int riscv_program_exec (struct riscv_program *p, struct target *t)
 Add ebreak and execute the program. More...
 
int riscv_program_fence (struct riscv_program *p)
 
int riscv_program_fence_i (struct riscv_program *p)
 
int riscv_program_init (struct riscv_program *p, struct target *t)
 
int riscv_program_insert (struct riscv_program *p, riscv_insn_t i)
 
int riscv_program_lbr (struct riscv_program *p, enum gdb_regno d, enum gdb_regno a, int o)
 
int riscv_program_ldr (struct riscv_program *p, enum gdb_regno d, enum gdb_regno a, int o)
 
int riscv_program_lhr (struct riscv_program *p, enum gdb_regno d, enum gdb_regno a, int o)
 
int riscv_program_lwr (struct riscv_program *p, enum gdb_regno d, enum gdb_regno a, int o)
 
int riscv_program_sbr (struct riscv_program *p, enum gdb_regno s, enum gdb_regno a, int o)
 
int riscv_program_sdr (struct riscv_program *p, enum gdb_regno s, enum gdb_regno a, int o)
 
int riscv_program_shr (struct riscv_program *p, enum gdb_regno s, enum gdb_regno a, int o)
 
int riscv_program_swr (struct riscv_program *p, enum gdb_regno s, enum gdb_regno a, int o)
 
int riscv_program_write (struct riscv_program *program)
 

Macro Definition Documentation

◆ RISCV_DSCRATCH_COUNT

#define RISCV_DSCRATCH_COUNT   2

Definition at line 10 of file program.h.

◆ RISCV_MAX_DEBUG_BUFFER_SIZE

#define RISCV_MAX_DEBUG_BUFFER_SIZE   32

Definition at line 8 of file program.h.

◆ RISCV_REGISTER_COUNT

#define RISCV_REGISTER_COUNT   32

Definition at line 9 of file program.h.

Function Documentation

◆ riscv_program_addi()

int riscv_program_addi ( struct riscv_program p,
enum gdb_regno  d,
enum gdb_regno  s,
int16_t  i 
)

Definition at line 170 of file program.c.

References addi(), and riscv_program_insert().

Referenced by read_memory_progbuf(), and write_memory_progbuf().

◆ riscv_program_csrr()

int riscv_program_csrr ( struct riscv_program p,
enum gdb_regno  d,
enum gdb_regno  csr 
)

Definition at line 137 of file program.c.

References csr, csrrs(), GDB_REGNO_CSR0, GDB_REGNO_CSR4095, GDB_REGNO_ZERO, and riscv_program_insert().

Referenced by register_read_direct().

◆ riscv_program_csrrci()

int riscv_program_csrrci ( struct riscv_program p,
enum gdb_regno  d,
unsigned int  z,
enum gdb_regno  csr 
)

◆ riscv_program_csrrsi()

int riscv_program_csrrsi ( struct riscv_program p,
enum gdb_regno  d,
unsigned int  z,
enum gdb_regno  csr 
)

◆ riscv_program_csrw()

int riscv_program_csrw ( struct riscv_program p,
enum gdb_regno  s,
enum gdb_regno  csr 
)

Definition at line 143 of file program.c.

References csr, csrrw(), GDB_REGNO_CSR0, GDB_REGNO_ZERO, and riscv_program_insert().

Referenced by register_write_direct().

◆ riscv_program_ebreak()

◆ riscv_program_exec()

◆ riscv_program_fence()

int riscv_program_fence ( struct riscv_program p)

Definition at line 154 of file program.c.

References fence(), and riscv_program_insert().

Referenced by execute_fence().

◆ riscv_program_fence_i()

int riscv_program_fence_i ( struct riscv_program p)

Definition at line 149 of file program.c.

References fence_i(), and riscv_program_insert().

Referenced by execute_fence().

◆ riscv_program_init()

◆ riscv_program_insert()

◆ riscv_program_lbr()

int riscv_program_lbr ( struct riscv_program p,
enum gdb_regno  d,
enum gdb_regno  a,
int  o 
)

Definition at line 120 of file program.c.

References lb(), offset, and riscv_program_insert().

Referenced by read_memory_progbuf(), and read_memory_progbuf_one().

◆ riscv_program_ldr()

int riscv_program_ldr ( struct riscv_program p,
enum gdb_regno  d,
enum gdb_regno  a,
int  o 
)

Definition at line 105 of file program.c.

References ld(), offset, and riscv_program_insert().

Referenced by read_memory_progbuf(), and read_memory_progbuf_one().

◆ riscv_program_lhr()

int riscv_program_lhr ( struct riscv_program p,
enum gdb_regno  d,
enum gdb_regno  a,
int  o 
)

Definition at line 115 of file program.c.

References lh(), offset, and riscv_program_insert().

Referenced by read_memory_progbuf(), and read_memory_progbuf_one().

◆ riscv_program_lwr()

int riscv_program_lwr ( struct riscv_program p,
enum gdb_regno  d,
enum gdb_regno  a,
int  o 
)

Definition at line 110 of file program.c.

References lw(), offset, and riscv_program_insert().

Referenced by read_memory_progbuf(), and read_memory_progbuf_one().

◆ riscv_program_sbr()

int riscv_program_sbr ( struct riscv_program p,
enum gdb_regno  s,
enum gdb_regno  a,
int  o 
)

Definition at line 100 of file program.c.

References offset, riscv_program_insert(), and sb().

Referenced by write_memory_progbuf().

◆ riscv_program_sdr()

int riscv_program_sdr ( struct riscv_program p,
enum gdb_regno  s,
enum gdb_regno  a,
int  o 
)

Definition at line 85 of file program.c.

References offset, riscv_program_insert(), and sd().

Referenced by write_memory_progbuf().

◆ riscv_program_shr()

int riscv_program_shr ( struct riscv_program p,
enum gdb_regno  s,
enum gdb_regno  a,
int  o 
)

Definition at line 95 of file program.c.

References offset, riscv_program_insert(), and sh().

Referenced by write_memory_progbuf().

◆ riscv_program_swr()

int riscv_program_swr ( struct riscv_program p,
enum gdb_regno  s,
enum gdb_regno  a,
int  o 
)

Definition at line 90 of file program.c.

References offset, riscv_program_insert(), and sw().

Referenced by write_memory_progbuf().

◆ riscv_program_write()