/* Physical address limits shared by the 32-bit kernel and the UEFI loader. */ #ifndef PHYS_H #define PHYS_H /* Lowmem: the kernel identity-maps [0, MM_MAX_PHYS) with 4 MB pages and * dereferences physical addresses there directly. Ring-3 address space * starts at USER_BASE (0x40000000), so lowmem ends at 1 GB. Everything the * kernel touches through a physical pointer (page tables, DMA buffers, * canvases, kernel stacks, kmalloc) must be lowmem. */ #define MM_MAX_PHYS 0x40000000u /* The kmap window: one 4 MB page-directory slot in the unused gap between * the ring-3 program/stack window and USER_WIN_BASE (0x50000000). Its * supervisor page table holds per-CPU temporary mappings of arbitrary frames * and is shared by every process directory. Not the last lowmem slot * (firmware puts the ACPI tables at the top of RAM) and not the top of the * address space (a VBE LFB may sit at 0xFF000000). */ #define MM_KMAP_VA 0x4FC00000u /* The ioremap window: kernel-only virtual space for MMIO, firmware tables * and the LFB above lowmem. Ring-3 space may use [USER_BASE, IOMAP_BASE). */ #define IOMAP_BASE 0xC0000000u /* Highmem: RAM in [MM_MAX_PHYS, MM_HIGH_LIMIT) is tracked by the frame * allocator but never identity-mapped; it only backs ring-3 pages, which * the kernel reaches through the owning process's mapping or kmap(). * RAM above 4 GB would need PAE. */ #define MM_HIGH_LIMIT 0x100000000ull #endif