Files
riscv-operating-system-mooc/code/os/04-multitask/platform.h
Wang Chen fd1d098906 Encapsulate some types related to cpu word length.
The purpose is to facilitate porting to RV64.

Signed-off-by: Wang Chen <wangchen20@iscas.ac.cn>
2024-03-27 14:30:53 +08:00

30 lines
709 B
C

#ifndef __PLATFORM_H__
#define __PLATFORM_H__
/*
* 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
*/
/* This machine puts UART registers here in physical memory. */
#define UART0 0x10000000L
#endif /* __PLATFORM_H__ */