From 9d8f085596f968dd3bc919a11ae130b2381b52cb Mon Sep 17 00:00:00 2001 From: Tobias Weingartner Date: Wed, 11 Jun 2008 18:49:51 +0000 Subject: Fix GART enabling by using segment end address instead of total physmem. This should be more correct than earlier code. Thank you to Markus Hennecke for reminding me. --- sys/arch/amd64/amd64/machdep.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'sys/arch/amd64') diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index b1ffd07b060..67bdcc09bd7 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.78 2008/06/10 02:55:39 weingart Exp $ */ +/* $OpenBSD: machdep.c,v 1.79 2008/06/11 18:49:50 weingart Exp $ */ /* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */ /*- @@ -310,12 +310,6 @@ cpu_startup(void) printf("real mem = %lu (%luMB)\n", ptoa((psize_t)physmem), ptoa((psize_t)physmem)/1024/1024); - if (physmem >= atop(1ULL << 32)) { - extern int amdgart_enable; - - amdgart_enable = 1; - } - /* * Find out how much space we need, allocate it, * and then give everything true virtual addresses. @@ -1325,6 +1319,10 @@ init_x86_64(paddr_t first_avail) e1 = (1UL << 32) - 1; if (s1 > e1) continue; + } else if (bigmem && (e1 >= (1UL<<32))) { + extern int amdgart_enable; + + amdgart_enable = 1; } /* Crop stuff into "640K hole" */ -- cgit v1.2.3