Skip to content

Commit

Permalink
Basic support for riscv (#42)
Browse files Browse the repository at this point in the history
* Basic support for riscv
* Add build of SymQEMU for Risc-V in Dockerfile

---------

Co-authored-by: Vlada Logunova <[email protected]>
  • Loading branch information
aurelf and Antwy authored Mar 18, 2024
1 parent 5c00e64 commit adc2711
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
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

0 comments on commit adc2711

Please sign in to comment.