Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys backwards compat code for paddr_t being 32 bits.



details:   https://anonhg.NetBSD.org/src/rev/725851e1f80f
branches:  trunk
changeset: 757849:725851e1f80f
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Sep 27 21:25:38 2010 +0000

description:
backwards compat code for paddr_t being 32 bits.

diffstat:

 sys/dev/pci/agp.c |  18 ++++++++++++++++--
 sys/sys/agpio.h   |  14 ++++++++++++--
 2 files changed, 28 insertions(+), 4 deletions(-)

diffs (81 lines):

diff -r fbc4e92c9e8b -r 725851e1f80f sys/dev/pci/agp.c
--- a/sys/dev/pci/agp.c Mon Sep 27 17:08:29 2010 +0000
+++ b/sys/dev/pci/agp.c Mon Sep 27 21:25:38 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: agp.c,v 1.69 2010/06/16 03:35:01 riz Exp $     */
+/*     $NetBSD: agp.c,v 1.70 2010/09/27 21:25:38 christos Exp $        */
 
 /*-
  * Copyright (c) 2000 Doug Rabson
@@ -65,7 +65,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: agp.c,v 1.69 2010/06/16 03:35:01 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: agp.c,v 1.70 2010/09/27 21:25:38 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -944,6 +944,20 @@
        case AGPIOC_SETUP:
                return agp_setup_user(sc, (agp_setup *)data);
 
+#ifndef __LP64__       /* Wish ifdef knew about sizeof */
+       case AGPIOC_OALLOCATE: {
+               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;
+
+               return agp_allocate_user(sc, &aga);
+       }
+#endif
+               
        case AGPIOC_ALLOCATE:
                return agp_allocate_user(sc, (agp_allocate *)data);
 
diff -r fbc4e92c9e8b -r 725851e1f80f sys/sys/agpio.h
--- a/sys/sys/agpio.h   Mon Sep 27 17:08:29 2010 +0000
+++ b/sys/sys/agpio.h   Mon Sep 27 21:25:38 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: agpio.h,v 1.5 2005/12/26 18:41:36 perry Exp $  */
+/*     $NetBSD: agpio.h,v 1.6 2010/09/27 21:25:38 christos Exp $       */
 
 /*-
  * Copyright (c) 2000 Doug Rabson
@@ -65,6 +65,7 @@
 #define AGPIOC_RESERVE    _IOW (AGPIOC_BASE, 4, agp_region)
 #define AGPIOC_PROTECT    _IOW (AGPIOC_BASE, 5, agp_region)
 #endif
+#define AGPIOC_OALLOCATE  _IOWR(AGPIOC_BASE, 6, agp_oallocate)
 #define AGPIOC_ALLOCATE   _IOWR(AGPIOC_BASE, 6, agp_allocate)
 #define AGPIOC_DEALLOCATE _IOW (AGPIOC_BASE, 7, int)
 #define AGPIOC_BIND       _IOW (AGPIOC_BASE, 8, agp_bind)
@@ -107,6 +108,16 @@
 } agp_region;
 #endif
 
+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;
+
 typedef struct _agp_allocate {
        int key;                /* tag of allocation            */
        size_t pg_count;        /* number of pages              */
@@ -116,7 +127,6 @@
                                 * actual page behind the gatt
                                 * table)                        */
 } agp_allocate;
-
 typedef struct _agp_bind {
        int key;                /* tag of allocation            */
        off_t pg_start;         /* starting page to populate    */



Home | Main Index | Thread Index | Old Index