-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathqemu-riscv64-virt.c
executable file
·119 lines (103 loc) · 3.66 KB
/
qemu-riscv64-virt.c
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#include <config.h>
// Frontend binary
VM_IMAGE(frontend, "/path/to/your/imgs/frontend.bin")
// Backend binary
VM_IMAGE(backend, "/path/to/your/imgs/backend.bin")
struct config config = {
CONFIG_HEADER
.shmemlist_size = 1,
.shmemlist = (struct shmem[]) {
[0] = { .size = 0x01000000},
},
.vmlist_size = 2,
.vmlist = (struct vm_config[]) {
{
.image = {
.base_addr = 0x90200000,
.load_addr = VM_IMAGE_OFFSET(backend),
.size = VM_IMAGE_SIZE(backend)
},
.entry = 0x90200000,
.cpu_affinity = 0x1,
.platform = {
.cpu_num = 1,
.region_num = 1,
.regions = (struct vm_mem_region[]) {
{
.base = 0x90000000,
.size = 0x50000000,
.place_phys = true,
.phys = 0x90000000,
}
},
.remio_dev_num = 1,
.remio_devs = (struct remio_dev[]) {
{
.id = 0,
.type = REMIO_DEV_BACKEND,
.interrupt = 36,
.shmem = {
.base = 0x70000000,
.size = 0x01000000,
.shmem_id = 0,
}
}
},
.dev_num = 1,
.devs = (struct vm_dev_region[]) {
{
.pa = 0x10000000,
.va = 0x10000000,
.size = 0x100,
.interrupt_num = 1,
.interrupts = (irqid_t[]) {10}
},
},
.arch = {
.irqc.plic = {
.base = 0xc000000,
}
}
},
},
{
.image = {
.base_addr = 0x20200000,
.load_addr = VM_IMAGE_OFFSET(frontend),
.size = VM_IMAGE_SIZE(frontend)
},
.entry = 0x20200000,
.cpu_affinity = 0x2,
.platform = {
.cpu_num = 1,
.region_num = 1,
.regions = (struct vm_mem_region[]) {
{
.base = 0x20000000,
.size = 0x50000000,
},
},
.remio_dev_num = 1,
.remio_devs = (struct remio_dev[]) {
{
.id = 0,
.type = REMIO_DEV_FRONTEND,
.size = 0x200,
.va = 0x10001000,
.interrupt = 37,
.shmem = {
.base = 0x70000000,
.size = 0x01000000,
.shmem_id = 0,
}
}
},
.arch = {
.irqc.plic = {
.base = 0xc000000,
}
}
},
},
},
};