Module Name:    src
Committed By:   christos
Date:           Tue Sep 28 14:02:48 UTC 2010

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

Log Message:
- fixes from Jean-Yves Migeon
- handle transitional paddr_t period for i386


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/pci/agp.c
cvs rdiff -u -r1.7 -r1.8 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.71 src/sys/dev/pci/agp.c:1.72
--- src/sys/dev/pci/agp.c:1.71	Mon Sep 27 18:53:46 2010
+++ src/sys/dev/pci/agp.c	Tue Sep 28 10:02:48 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: agp.c,v 1.71 2010/09/27 22:53:46 christos Exp $	*/
+/*	$NetBSD: agp.c,v 1.72 2010/09/28 14:02:48 christos Exp $	*/
 
 /*-
  * Copyright (c) 2000 Doug Rabson
@@ -65,7 +65,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: agp.c,v 1.71 2010/09/27 22:53:46 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: agp.c,v 1.72 2010/09/28 14:02:48 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -963,15 +963,19 @@
 	} agp_oallocate;
 
 	case AGPIOC_OALLOCATE: {
+		int ret;
 		agp_allocate aga;
 		agp_oallocate *oaga = data;
 
-		aga.key = oaga->key;
-		aga.pg_count = oaga->pg_count;
 		aga.type = oaga->type;
-		aga.physical = oaga->physical;
+		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 agp_allocate_user(sc, &aga);
+		return ret;
 	}
 }
 #endif

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

Reply via email to