···88#include <linux/pci.h>99#include <linux/module.h>1010#include <linux/dmar.h>1111-#include <linux/bootmem.h>1212-#include <asm/proto.h>1311#include <asm/io.h>1412#include <asm/gart.h>1513#include <asm/calgary.h>···286288}287289early_param("iommu", iommu_setup);288290289289-static __initdata void *dma32_bootmem_ptr;290290-static unsigned long dma32_bootmem_size __initdata = (128ULL<<20);291291-292292-static int __init parse_dma32_size_opt(char *p)293293-{294294- if (!p)295295- return -EINVAL;296296- dma32_bootmem_size = memparse(p, &p);297297- return 0;298298-}299299-early_param("dma32_size", parse_dma32_size_opt);300300-301301-void __init dma32_reserve_bootmem(void)302302-{303303- unsigned long size, align;304304- if (end_pfn <= MAX_DMA32_PFN)305305- return;306306-307307- align = 64ULL<<20;308308- size = round_up(dma32_bootmem_size, align);309309- dma32_bootmem_ptr = __alloc_bootmem_nopanic(size, align,310310- __pa(MAX_DMA_ADDRESS));311311- if (dma32_bootmem_ptr)312312- dma32_bootmem_size = size;313313- else314314- dma32_bootmem_size = 0;315315-}316316-static void __init dma32_free_bootmem(void)317317-{318318- int node;319319-320320- if (end_pfn <= MAX_DMA32_PFN)321321- return;322322-323323- if (!dma32_bootmem_ptr)324324- return;325325-326326- for_each_online_node(node)327327- free_bootmem_node(NODE_DATA(node), __pa(dma32_bootmem_ptr),328328- dma32_bootmem_size);329329-330330- dma32_bootmem_ptr = NULL;331331- dma32_bootmem_size = 0;332332-}333333-334291void __init pci_iommu_alloc(void)335292{336336- /* free the range so iommu could get some range less than 4G */337337- dma32_free_bootmem();338293 /*339294 * The order of these functions is important for340295 * fall-back/fail-over reasons
-2
arch/x86/kernel/setup_64.c
···389389390390 early_res_to_bootmem();391391392392- dma32_reserve_bootmem();393393-394392#ifdef CONFIG_ACPI_SLEEP395393 /*396394 * Reserve low memory region for sleep support.
-1
include/asm-x86/pci_64.h
···2525262627272828-extern void dma32_reserve_bootmem(void);2928extern void pci_iommu_alloc(void);30293130/* The PCI address space does equal the physical memory