From 611bd1cba04602d5d7b807e1d80b13e994d80653 Mon Sep 17 00:00:00 2001 From: Travis Geiselbrecht Date: Fri, 21 Oct 2022 23:45:42 -0700 Subject: [PATCH] [bus][pci] ask for 4MB alignment when mapping the ecam This helps any architecture that might have a better chance with using large pages. --- dev/bus/pci/backend/ecam.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dev/bus/pci/backend/ecam.cpp b/dev/bus/pci/backend/ecam.cpp index 47e39d96..6f1a4a56 100644 --- a/dev/bus/pci/backend/ecam.cpp +++ b/dev/bus/pci/backend/ecam.cpp @@ -65,8 +65,9 @@ status_t pci_ecam::initialize() { #if WITH_KERNEL_VM // try to map the aperture + // ask for 4MB aligned regions (log2 22) to help with the mmu on most architectures //status_t vmm_alloc_physical(vmm_aspace_t *aspace, const char *name, size_t size, void **ptr, uint8_t align_log2, paddr_t paddr, uint vmm_flags, uint arch_mmu_flags) - status_t err = vmm_alloc_physical(vmm_get_kernel_aspace(), "pci_ecam", size, (void **)&ecam_ptr_, 0, base_, 0, ARCH_MMU_FLAG_UNCACHED_DEVICE); + status_t err = vmm_alloc_physical(vmm_get_kernel_aspace(), "pci_ecam", size, (void **)&ecam_ptr_, 22, base_, 0, ARCH_MMU_FLAG_UNCACHED_DEVICE); LTRACEF("vmm_alloc_physical returns %d, ptr %p\n", err, ecam_ptr_); if (err != NO_ERROR) {