Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci restore binary compatibility for amd64; requeste...
details: https://anonhg.NetBSD.org/src/rev/0ad56ab28008
branches: trunk
changeset: 757982:0ad56ab28008
user: christos <christos%NetBSD.org@localhost>
date: Sun Oct 10 21:24:34 2010 +0000
description:
restore binary compatibility for amd64; requested by joerg.
diffstat:
sys/dev/pci/agp.c | 39 +++++++++++++++++++++++++++++++++++++--
1 files changed, 37 insertions(+), 2 deletions(-)
diffs (60 lines):
diff -r 2c0a1a4cbc86 -r 0ad56ab28008 sys/dev/pci/agp.c
--- a/sys/dev/pci/agp.c Sun Oct 10 15:29:01 2010 +0000
+++ b/sys/dev/pci/agp.c Sun Oct 10 21:24:34 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: agp.c,v 1.74 2010/10/02 21:52:15 jym Exp $ */
+/* $NetBSD: agp.c,v 1.75 2010/10/10 21:24:34 christos Exp $ */
/*-
* Copyright (c) 2000 Doug Rabson
@@ -65,7 +65,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: agp.c,v 1.74 2010/10/02 21:52:15 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: agp.c,v 1.75 2010/10/10 21:24:34 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -944,6 +944,41 @@
case AGPIOC_SETUP:
return agp_setup_user(sc, (agp_setup *)data);
+#ifdef __x86_64__
+{
+ /*
+ * 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);
Home |
Main Index |
Thread Index |
Old Index