···8#include <linux/pci.h>9#include <linux/module.h>10#include <linux/dmar.h>11-#include <linux/bootmem.h>12-#include <asm/proto.h>13#include <asm/io.h>14#include <asm/gart.h>15#include <asm/calgary.h>···286}287early_param("iommu", iommu_setup);288289-static __initdata void *dma32_bootmem_ptr;290-static unsigned long dma32_bootmem_size __initdata = (128ULL<<20);291-292-static int __init parse_dma32_size_opt(char *p)293-{294- if (!p)295- return -EINVAL;296- dma32_bootmem_size = memparse(p, &p);297- return 0;298-}299-early_param("dma32_size", parse_dma32_size_opt);300-301-void __init dma32_reserve_bootmem(void)302-{303- unsigned long size, align;304- if (end_pfn <= MAX_DMA32_PFN)305- return;306-307- align = 64ULL<<20;308- size = round_up(dma32_bootmem_size, align);309- dma32_bootmem_ptr = __alloc_bootmem_nopanic(size, align,310- __pa(MAX_DMA_ADDRESS));311- if (dma32_bootmem_ptr)312- dma32_bootmem_size = size;313- else314- dma32_bootmem_size = 0;315-}316-static void __init dma32_free_bootmem(void)317-{318- int node;319-320- if (end_pfn <= MAX_DMA32_PFN)321- return;322-323- if (!dma32_bootmem_ptr)324- return;325-326- for_each_online_node(node)327- free_bootmem_node(NODE_DATA(node), __pa(dma32_bootmem_ptr),328- dma32_bootmem_size);329-330- dma32_bootmem_ptr = NULL;331- dma32_bootmem_size = 0;332-}333-334void __init pci_iommu_alloc(void)335{336- /* free the range so iommu could get some range less than 4G */337- dma32_free_bootmem();338 /*339 * The order of these functions is important for340 * fall-back/fail-over reasons
···8#include <linux/pci.h>9#include <linux/module.h>10#include <linux/dmar.h>0011#include <asm/io.h>12#include <asm/gart.h>13#include <asm/calgary.h>···288}289early_param("iommu", iommu_setup);290000000000000000000000000000000000000000000000291void __init pci_iommu_alloc(void)292{00293 /*294 * The order of these functions is important for295 * fall-back/fail-over reasons
-2
arch/x86/kernel/setup_64.c
···389390 early_res_to_bootmem();391392- dma32_reserve_bootmem();393-394#ifdef CONFIG_ACPI_SLEEP395 /*396 * Reserve low memory region for sleep support.
···389390 early_res_to_bootmem();39100392#ifdef CONFIG_ACPI_SLEEP393 /*394 * Reserve low memory region for sleep support.
-1
include/asm-x86/pci_64.h
···25262728-extern void dma32_reserve_bootmem(void);29extern void pci_iommu_alloc(void);3031/* The PCI address space does equal the physical memory
···252627028extern void pci_iommu_alloc(void);2930/* The PCI address space does equal the physical memory