hw/ipmi: Don't call vmstate_register() from instance_init() functions
[qemu/ar7.git] / linux-user / riscv / target_proc.h
blobc77c003d65876d2f37e42cbef5028af180e52ba1
1 /*
2 * RISC-V specific proc functions for linux-user
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 #ifndef RISCV_TARGET_PROC_H
7 #define RISCV_TARGET_PROC_H
9 static int open_cpuinfo(CPUArchState *cpu_env, int fd)
11 int i;
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);
16 const char *mmu;
18 if (cfg->mmu) {
19 mmu = (cpu_env->xl == MXL_RV32) ? "sv32" : "sv48";
20 } else {
21 mmu = "none";
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");
32 g_free(isa_string);
33 return 0;
35 #define HAVE_ARCH_PROC_CPUINFO
37 #endif /* RISCV_TARGET_PROC_H */