Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35961
b: refs/heads/master
c: 56dd669
h: refs/heads/master
i:
  35959: 1338206
v: v3
  • Loading branch information
Aaron Durbin authored and Andi Kleen committed Sep 26, 2006
1 parent 9f7726e commit 6f5324d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9abd79280bbb9f56049f0168f412c3538cadb6eb
refs/heads/master: 56dd669a138c40ea6cdae487f233430d12372767
21 changes: 20 additions & 1 deletion trunk/arch/x86_64/kernel/aperture.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <linux/pci_ids.h>
#include <linux/pci.h>
#include <linux/bitops.h>
#include <linux/ioport.h>
#include <asm/e820.h>
#include <asm/io.h>
#include <asm/proto.h>
Expand All @@ -33,6 +34,18 @@ int fallback_aper_force __initdata = 0;

int fix_aperture __initdata = 1;

static struct resource gart_resource = {
.name = "GART",
.flags = IORESOURCE_MEM,
};

static void __init insert_aperture_resource(u32 aper_base, u32 aper_size)
{
gart_resource.start = aper_base;
gart_resource.end = aper_base + aper_size - 1;
insert_resource(&iomem_resource, &gart_resource);
}

/* This code runs before the PCI subsystem is initialized, so just
access the northbridge directly. */

Expand Down Expand Up @@ -62,6 +75,7 @@ static u32 __init allocate_aperture(void)
}
printk("Mapping aperture over %d KB of RAM @ %lx\n",
aper_size >> 10, __pa(p));
insert_aperture_resource((u32)__pa(p), aper_size);
return (u32)__pa(p);
}

Expand Down Expand Up @@ -233,8 +247,13 @@ void __init iommu_hole_init(void)
last_aper_base = aper_base;
}

if (!fix && !fallback_aper_force)
if (!fix && !fallback_aper_force) {
if (last_aper_base) {
unsigned long n = (32 * 1024 * 1024) << last_aper_order;
insert_aperture_resource((u32)last_aper_base, n);
}
return;
}

if (!fallback_aper_force)
aper_alloc = search_agp_bridge(&aper_order, &valid_agp);
Expand Down

0 comments on commit 6f5324d

Please sign in to comment.