Select one of the symbols to view example projects that use it.
 
Outline
#define TARGET__RISCV__PROGRAM_H
#include "riscv.h"
#define RISCV_MAX_DEBUG_BUFFER_SIZE
#define RISCV_REGISTER_COUNT
#define RISCV_DSCRATCH_COUNT
riscv_program
riscv_program_init(struct riscv_program *, struct target *);
riscv_program_write(struct riscv_program *);
riscv_program_exec(struct riscv_program *, struct target *);
riscv_program_insert(struct riscv_program *, riscv_insn_t);
riscv_program_ldr(struct riscv_program *, enum gdb_regno, enum gdb_regno, int);
riscv_program_lwr(struct riscv_program *, enum gdb_regno, enum gdb_regno, int);
riscv_program_lhr(struct riscv_program *, enum gdb_regno, enum gdb_regno, int);
riscv_program_lbr(struct riscv_program *, enum gdb_regno, enum gdb_regno, int);
riscv_program_sdr(struct riscv_program *, enum gdb_regno, enum gdb_regno, int);
riscv_program_swr(struct riscv_program *, enum gdb_regno, enum gdb_regno, int);
riscv_program_shr(struct riscv_program *, enum gdb_regno, enum gdb_regno, int);
riscv_program_sbr(struct riscv_program *, enum gdb_regno, enum gdb_regno, int);
riscv_program_csrrsi(struct riscv_program *, enum gdb_regno, unsigned int, enum gdb_regno);
riscv_program_csrrci(struct riscv_program *, enum gdb_regno, unsigned int, enum gdb_regno);
riscv_program_csrr(struct riscv_program *, enum gdb_regno, enum gdb_regno);
riscv_program_csrw(struct riscv_program *, enum gdb_regno, enum gdb_regno);
riscv_program_fence_i(struct riscv_program *);
riscv_program_fence(struct riscv_program *);
riscv_program_ebreak(struct riscv_program *);
riscv_program_addi(struct riscv_program *, enum gdb_regno, enum gdb_regno, int16_t);
Files
loading...
SourceVuDevelopment ToolsOpenOCDsrc/target/riscv/program.h
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef TARGET__RISCV__PROGRAM_H #define TARGET__RISCV__PROGRAM_H #include "riscv.h" #define RISCV_MAX_DEBUG_BUFFER_SIZE 32 #define RISCV_REGISTER_COUNT 32 #define RISCV_DSCRATCH_COUNT 2 /* The various RISC-V debug specifications all revolve around setting up * program buffers and executing them on the target. This structure contains a * single program, which can then be executed on targets. *//* ... */ struct riscv_program { struct target *target; uint32_t debug_buffer[RISCV_MAX_DEBUG_BUFFER_SIZE]; /* Number of 32-bit instructions in the program. */ size_t instruction_count; /* Side effects of executing this program. These must be accounted for * in order to maintain correct executing of the target system. *//* ... */ bool writes_xreg[RISCV_REGISTER_COUNT]; /* XLEN on the target. */ int target_xlen; ...}; /* Initializes a program with the header. */ int riscv_program_init(struct riscv_program *p, struct target *t); /* Write the program to the program buffer. */ int riscv_program_write(struct riscv_program *program); /* Executes a program, returning 0 if the program successfully executed. Note * that this may cause registers to be saved or restored, which could result to * calls to things like riscv_save_register which itself could require a * program to execute. That's OK, just make sure this eventually terminates. * *//* ... */ int riscv_program_exec(struct riscv_program *p, struct target *t); /* A lower level interface, you shouldn't use this unless you have a reason. */ int riscv_program_insert(struct riscv_program *p, riscv_insn_t i); /* Helpers to assemble various instructions. Return 0 on success. These might * assemble into a multi-instruction sequence that overwrites some other * register, but those will be properly saved and restored. *//* ... */ int riscv_program_ldr(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_lhr(struct riscv_program *p, enum gdb_regno d, enum gdb_regno a, int o); int riscv_program_lbr(struct riscv_program *p, enum gdb_regno d, 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_swr(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_sbr(struct riscv_program *p, enum gdb_regno s, enum gdb_regno a, int o); int riscv_program_csrrsi(struct riscv_program *p, enum gdb_regno d, unsigned int z, 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_csrr(struct riscv_program *p, enum gdb_regno d, enum gdb_regno csr); int riscv_program_csrw(struct riscv_program *p, enum gdb_regno s, enum gdb_regno csr); int riscv_program_fence_i(struct riscv_program *p); int riscv_program_fence(struct riscv_program *p); int riscv_program_ebreak(struct riscv_program *p); int riscv_program_addi(struct riscv_program *p, enum gdb_regno d, enum gdb_regno s, int16_t i); /* ... */ #endif
Details
Show:
from
Types: Columns:
Click anywhere in the source to view detailed information here...