|
| 1 | +/// Architecture identifier. |
| 2 | +pub const ARCH: &str = "x86_64"; |
| 3 | +/// Platform identifier. |
| 4 | +pub const PLAT: &str = "x86_64-qemu-q35"; |
| 5 | +/// Number of CPUs |
| 6 | +pub const SMP: usize = 1; |
| 7 | + |
| 8 | +/// |
| 9 | +/// Device specifications |
| 10 | +/// |
| 11 | +mod device { |
| 12 | + /// MMIO regions with format (`base_paddr`, `size`). |
| 13 | + pub const MMIO_REGIONS: &[(usize, usize)] = &[ |
| 14 | + (0xb000_0000, 0x1000_0000), |
| 15 | + (0xfe00_0000, 0xc0_0000), |
| 16 | + (0xfec0_0000, 0x1000), |
| 17 | + (0xfed0_0000, 0x1000), |
| 18 | + (0xfee0_0000, 0x1000), |
| 19 | + ]; |
| 20 | + /// End PCI bus number. |
| 21 | + pub const PCI_BUS_END: usize = 0; |
| 22 | + /// Base physical address of the PCIe ECAM space (should read from ACPI 'MCFG' table). |
| 23 | + pub const PCI_ECAM_BASE: usize = 0; |
| 24 | + /// PCI device memory ranges (not used on x86). |
| 25 | + pub const PCI_RANGES: &[(usize, usize)] = &[]; |
| 26 | + /// VirtIO MMIO regions with format (`base_paddr`, `size`). |
| 27 | + pub const VIRTIO_MMIO_REGIONS: &[(usize, usize)] = &[]; |
| 28 | +} |
| 29 | + |
| 30 | +/// |
| 31 | +/// Kernel configs |
| 32 | +/// |
| 33 | +mod kernel { |
| 34 | + /// Stack size of each task. |
| 35 | + pub const TASK_STACK_SIZE: usize = 0; |
| 36 | + /// Number of timer ticks per second (Hz). A timer tick may contain several timer |
| 37 | + /// interrupts. |
| 38 | + pub const TICKS_PER_SEC: usize = 0; |
| 39 | +} |
| 40 | + |
| 41 | +/// |
| 42 | +/// Platform configs |
| 43 | +/// |
| 44 | +mod platform { |
| 45 | + /// Kernel address space base. |
| 46 | + pub const KERNEL_ASPACE_BASE: usize = 0xffff_ff80_0000_0000; |
| 47 | + /// Kernel address space size. |
| 48 | + pub const KERNEL_ASPACE_SIZE: usize = 0x0000_007f_ffff_f000; |
| 49 | + /// Base physical address of the kernel image. |
| 50 | + pub const KERNEL_BASE_PADDR: usize = 0x20_0000; |
| 51 | + /// Base virtual address of the kernel image. |
| 52 | + pub const KERNEL_BASE_VADDR: usize = 0xffff_ff80_0020_0000; |
| 53 | + /// Offset of bus address and phys address. some boards, the bus address is |
| 54 | + /// different from the physical address. |
| 55 | + pub const PHYS_BUS_OFFSET: usize = 0; |
| 56 | + /// Base address of the whole physical memory. |
| 57 | + pub const PHYS_MEMORY_BASE: usize = 0; |
| 58 | + /// Size of the whole physical memory. |
| 59 | + pub const PHYS_MEMORY_SIZE: usize = 0x800_0000; |
| 60 | + /// Linear mapping offset, for quick conversions between physical and virtual |
| 61 | + /// addresses. |
| 62 | + pub const PHYS_VIRT_OFFSET: usize = 0xffff_ff80_0000_0000; |
| 63 | + /// Timer interrupt frequencyin Hz. |
| 64 | + pub const TIMER_FREQUENCY: usize = 0; |
| 65 | +} |
0 commit comments