-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplatform.h
More file actions
43 lines (36 loc) · 1014 Bytes
/
platform.h
File metadata and controls
43 lines (36 loc) · 1014 Bytes
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
#ifndef __PLATFORM_H__
#define __PLATFORM_H__
/* ---------- For different target platforms ---------- */
#define CONFIG_SYSCALL
/*
* QEMU RISC-V Virt machine with 16550a UART and VirtIO MMIO
*/
/*
* maximum number of CPUs
* see https://github.com/qemu/qemu/blob/master/include/hw/riscv/virt.h
* #define VIRT_CPUS_MAX 8
*/
#define MAXNUM_CPU 8
/*
* MemoryMap
* see https://github.com/qemu/qemu/blob/master/hw/riscv/virt.c, virt_memmap[]
* 0x00001000 -- boot ROM, provided by qemu
* 0x02000000 -- CLINT
* 0x0C000000 -- PLIC
* 0x10000000 -- UART0
* 0x10001000 -- virtio disk
* 0x80000000 -- boot ROM jumps here in machine mode, where we load our kernel
*/
#define UART0_BASE 0x10000000L
#define PLIC_BASE 0x0C000000L
#define CLINT_BASE 0x02000000L
/*
* Interrupt Source ID
* see https://github.com/qemu/qemu/blob/master/include/hw/riscv/virt.h
* enum {
* UART0_IRQ = 10,
* ......
* };
*/
#define UART0_IRQ 10
#endif /* __PLATFORM_H__ */