diff options
author | Keshavamurthy, Anil S <anil.s.keshavamurthy@intel.com> | 2007-10-21 19:41:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-22 11:13:19 -0400 |
commit | e820482cd2621dba60e403af1c54502daa54b220 (patch) | |
tree | 3498401c7154e14008ab80b2f0cbca539ce7ffbc /arch/x86 | |
parent | 3460a6d9cef9ac2aa997da7eff7ff1c8291b361c (diff) |
Intel IOMMU: Iommu Gfx workaround
When we fix all the opensource gfx drivers to use the DMA api's, at that time
we can yank this config options out.
[jengelh@computergmbh.de: Kconfig fixes]
Signed-off-by: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Muli Ben-Yehuda <muli@il.ibm.com>
Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Ashok Raj <ashok.raj@intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/e820_64.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/x86/kernel/e820_64.c b/arch/x86/kernel/e820_64.c index 57616865d8a0..1ca228b06a20 100644 --- a/arch/x86/kernel/e820_64.c +++ b/arch/x86/kernel/e820_64.c | |||
@@ -729,3 +729,22 @@ __init void e820_setup_gap(void) | |||
729 | printk(KERN_INFO "Allocating PCI resources starting at %lx (gap: %lx:%lx)\n", | 729 | printk(KERN_INFO "Allocating PCI resources starting at %lx (gap: %lx:%lx)\n", |
730 | pci_mem_start, gapstart, gapsize); | 730 | pci_mem_start, gapstart, gapsize); |
731 | } | 731 | } |
732 | |||
733 | int __init arch_get_ram_range(int slot, u64 *addr, u64 *size) | ||
734 | { | ||
735 | int i; | ||
736 | |||
737 | if (slot < 0 || slot >= e820.nr_map) | ||
738 | return -1; | ||
739 | for (i = slot; i < e820.nr_map; i++) { | ||
740 | if (e820.map[i].type != E820_RAM) | ||
741 | continue; | ||
742 | break; | ||
743 | } | ||
744 | if (i == e820.nr_map || e820.map[i].addr > (max_pfn << PAGE_SHIFT)) | ||
745 | return -1; | ||
746 | *addr = e820.map[i].addr; | ||
747 | *size = min_t(u64, e820.map[i].size + e820.map[i].addr, | ||
748 | max_pfn << PAGE_SHIFT) - *addr; | ||
749 | return i + 1; | ||
750 | } | ||