Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386/pnpbios Add pnpbios_getiosize



details:   https://anonhg.NetBSD.org/src/rev/3fcefe216bba
branches:  trunk
changeset: 500703:3fcefe216bba
user:      jmc <jmc%NetBSD.org@localhost>
date:      Sun Dec 17 07:59:14 2000 +0000

description:
Add pnpbios_getiosize

diffstat:

 sys/arch/i386/pnpbios/pnpbios.c    |  22 +++++++++++++++++++++-
 sys/arch/i386/pnpbios/pnpbiosvar.h |   3 ++-
 2 files changed, 23 insertions(+), 2 deletions(-)

diffs (53 lines):

diff -r 2ee65132da19 -r 3fcefe216bba sys/arch/i386/pnpbios/pnpbios.c
--- a/sys/arch/i386/pnpbios/pnpbios.c   Sun Dec 17 07:58:37 2000 +0000
+++ b/sys/arch/i386/pnpbios/pnpbios.c   Sun Dec 17 07:59:14 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pnpbios.c,v 1.20 2000/06/29 08:44:58 mrg Exp $ */
+/* $NetBSD: pnpbios.c,v 1.21 2000/12/17 07:59:14 jmc Exp $ */
 
 /*
  * Copyright (c) 2000 Jason R. Thorpe.  All rights reserved.
@@ -1362,6 +1362,26 @@
        return (0);
 }
 
+int
+pnpbios_getiosize(pbt, resc, idx, sizep)
+        pnpbios_tag_t pbt;
+        struct pnpresources *resc;
+        int idx;
+        int *sizep;
+{
+        struct pnp_io *io;
+
+        if (idx >= resc->numio)
+            return (EINVAL);
+
+        io = SIMPLEQ_FIRST(&resc->io);
+        while (idx--)
+                io = SIMPLEQ_NEXT(io, next);
+        if (sizep)
+                *sizep = io->len;
+        return (0);
+}
+
 void *
 pnpbios_intr_establish(pbt, resc, idx, level, fcn, arg)
        pnpbios_tag_t pbt;
diff -r 2ee65132da19 -r 3fcefe216bba sys/arch/i386/pnpbios/pnpbiosvar.h
--- a/sys/arch/i386/pnpbios/pnpbiosvar.h        Sun Dec 17 07:58:37 2000 +0000
+++ b/sys/arch/i386/pnpbios/pnpbiosvar.h        Sun Dec 17 07:59:14 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pnpbiosvar.h,v 1.4 2000/04/22 06:38:24 thorpej Exp $ */
+/* $NetBSD: pnpbiosvar.h,v 1.5 2000/12/17 07:59:14 jmc Exp $ */
 /*
  * Copyright (c) 1999
  *     Matthias Drochner.  All rights reserved.
@@ -94,6 +94,7 @@
 
 int pnpbios_getiobase __P((pnpbios_tag_t, struct pnpresources *, int,
                           bus_space_tag_t *, int *));
+int pnpbios_getiosize __P((pnpbios_tag_t, struct pnpresources *, int, int *));
 int pnpbios_getirqnum __P((pnpbios_tag_t, struct pnpresources *, int, int *,
                           int *));
 int pnpbios_getdmachan __P((pnpbios_tag_t, struct pnpresources *, int, int *));



Home | Main Index | Thread Index | Old Index