2 * RISC-V specific proc functions for linux-user
4 * SPDX-License-Identifier: GPL-2.0-or-later
6 #ifndef RISCV_TARGET_PROC_H
7 #define RISCV_TARGET_PROC_H
9 static int open_cpuinfo(CPUArchState
*cpu_env
, int fd
)
12 int num_cpus
= sysconf(_SC_NPROCESSORS_ONLN
);
13 RISCVCPU
*cpu
= env_archcpu(cpu_env
);
14 const RISCVCPUConfig
*cfg
= riscv_cpu_cfg((CPURISCVState
*) cpu_env
);
15 char *isa_string
= riscv_isa_string(cpu
);
19 mmu
= (cpu_env
->xl
== MXL_RV32
) ? "sv32" : "sv48";
24 for (i
= 0; i
< num_cpus
; i
++) {
25 dprintf(fd
, "processor\t: %d\n", i
);
26 dprintf(fd
, "hart\t\t: %d\n", i
);
27 dprintf(fd
, "isa\t\t: %s\n", isa_string
);
28 dprintf(fd
, "mmu\t\t: %s\n", mmu
);
29 dprintf(fd
, "uarch\t\t: qemu\n\n");
35 #define HAVE_ARCH_PROC_CPUINFO
37 #endif /* RISCV_TARGET_PROC_H */