Module Name: src Committed By: christos Date: Sun Oct 10 21:24:35 UTC 2010
Modified Files: src/sys/dev/pci: agp.c Log Message: restore binary compatibility for amd64; requested by joerg. To generate a diff of this commit: cvs rdiff -u -r1.74 -r1.75 src/sys/dev/pci/agp.c 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.74 src/sys/dev/pci/agp.c:1.75 --- src/sys/dev/pci/agp.c:1.74 Sat Oct 2 17:52:15 2010 +++ src/sys/dev/pci/agp.c Sun Oct 10 17:24:34 2010 @@ -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);