Module Name:    src
Committed By:   jym
Date:           Sat Oct  2 21:52:15 UTC 2010

Modified Files:
        src/sys/dev/pci: agp.c
        src/sys/sys: agpio.h

Log Message:
Revert christos@ fix for the i386 paddr_t change and agp_allocate.

Make 'physical' element of the struct agp_allocate an uint32_t. This
is similar to what other kernels do (at least Solaris and Linux).

This patch should make xserver work again within an i386 userland in a
64 bits paddr_t world.

Thanks to Iain Hibbert for reporting the break, and providing initial hints.

See http://mail-index.netbsd.org/current-users/2010/09/27/msg014418.html


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/dev/pci/agp.c
cvs rdiff -u -r1.8 -r1.9 src/sys/sys/agpio.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/agp.c
diff -u src/sys/dev/pci/agp.c:1.73 src/sys/dev/pci/agp.c:1.74
--- src/sys/dev/pci/agp.c:1.73	Tue Sep 28 20:14:11 2010
+++ src/sys/dev/pci/agp.c	Sat Oct  2 21:52:15 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: agp.c,v 1.73 2010/09/28 20:14:11 christos Exp $	*/
+/*	$NetBSD: agp.c,v 1.74 2010/10/02 21:52:15 jym Exp $	*/
 
 /*-
  * Copyright (c) 2000 Doug Rabson
@@ -65,7 +65,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: agp.c,v 1.73 2010/09/28 20:14:11 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: agp.c,v 1.74 2010/10/02 21:52:15 jym Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -944,41 +944,6 @@
 	case AGPIOC_SETUP:
 		return agp_setup_user(sc, (agp_setup *)data);
 
-#ifdef __i386__
-{
-	/*
-	 * Handle paddr_t change from 32 bit for non PAE kernels
-	 * to 64 bit.
-	 */
-#define AGPIOC_OALLOCATE  _IOWR(AGPIOC_BASE, 6, agp_oallocate)
-
-	typedef struct _agp_oallocate {
-		int key;		/* tag of allocation            */
-		size_t pg_count;	/* number of pages              */
-		uint32_t type;		/* 0 == normal, other devspec   */
-		u_long physical;	/* device specific (some devices
-					 * need a phys address of the
-					 * actual page behind the gatt
-					 * table)                        */
-	} agp_oallocate;
-
-	case AGPIOC_OALLOCATE: {
-		int ret;
-		agp_allocate aga;
-		agp_oallocate *oaga = data;
-
-		aga.type = oaga->type;
-		aga.pg_count = oaga->pg_count;
-
-		if ((ret = agp_allocate_user(sc, &aga)) == 0) {
-			oaga->key = aga.key;
-			oaga->physical = (u_long)aga.physical;
-		}
-
-		return ret;
-	}
-}
-#endif
 	case AGPIOC_ALLOCATE:
 		return agp_allocate_user(sc, (agp_allocate *)data);
 

Index: src/sys/sys/agpio.h
diff -u src/sys/sys/agpio.h:1.8 src/sys/sys/agpio.h:1.9
--- src/sys/sys/agpio.h:1.8	Tue Sep 28 14:02:48 2010
+++ src/sys/sys/agpio.h	Sat Oct  2 21:52:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: agpio.h,v 1.8 2010/09/28 14:02:48 christos Exp $	*/
+/*	$NetBSD: agpio.h,v 1.9 2010/10/02 21:52:14 jym Exp $	*/
 
 /*-
  * Copyright (c) 2000 Doug Rabson
@@ -111,13 +111,7 @@
 	int key;		/* tag of allocation            */
 	size_t pg_count;	/* number of pages              */
 	uint32_t type;		/* 0 == normal, other devspec   */
-#ifdef __i386__
-	/* XXX: For transition, until paddr_t becomes 64bits for all kernels */
-	uint64_t
-#else
-   	paddr_t
-#endif
-		physical;	/* device specific (some devices
+	uint32_t physical;	/* device specific (some devices
 				 * need a phys address of the
 				 * actual page behind the gatt
 				 * table)                        */

Reply via email to