Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic support for riscv #42

Merged
merged 4 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN ./configure \
--disable-opengl \
--disable-virglrenderer \
--disable-werror \
--target-list=x86_64-linux-user \
--target-list=x86_64-linux-user,riscv64-linux-user \
--enable-debug \
--symcc-source=/symcc \
--symcc-build=/symcc/build
Expand Down
5 changes: 5 additions & 0 deletions target/riscv/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
#include "kvm_riscv.h"
#include "tcg/tcg.h"

#define SymExpr void*
#include "RuntimeCommon.h"

/* RISC-V CPU definitions */
static const char riscv_single_letter_exts[] = "IEMAFDQCPVH";

Expand Down Expand Up @@ -1616,6 +1619,8 @@ static void riscv_cpu_set_irq(void *opaque, int irq, int level)
static void riscv_cpu_init(Object *obj)
{
RISCVCPU *cpu = RISCV_CPU(obj);
memset(cpu->env_exprs, 0, sizeof(cpu->env_exprs));
_sym_register_expression_region(cpu->env_exprs, sizeof(cpu->env_exprs));

cpu_set_cpustate_pointers(cpu);

Expand Down
2 changes: 2 additions & 0 deletions target/riscv/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@ struct ArchCPU {
/* < public > */
CPUNegativeOffsetState neg;
CPURISCVState env;
/* space for symbolic expressions corresponding to env */
void *env_exprs[512 + 1]; /* TCG_MAX_TEMPS + 1 (for NULL) */

char *dyn_csr_xml;
char *dyn_vreg_xml;
Expand Down