Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/alpha Make all of the EISA chipset functions call t...



details:   https://anonhg.NetBSD.org/src/rev/c470f65c1602
branches:  trunk
changeset: 1023761:c470f65c1602
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Sep 25 20:16:17 2021 +0000

description:
Make all of the EISA chipset functions call through real functions,
rather the macros.

diffstat:

 sys/arch/alpha/eisa/eisa_machdep.c    |  49 +++++++++++++++++++++++++++++++++-
 sys/arch/alpha/include/eisa_machdep.h |  42 +++++++++++++----------------
 2 files changed, 66 insertions(+), 25 deletions(-)

diffs (127 lines):

diff -r c035d5a9a0e2 -r c470f65c1602 sys/arch/alpha/eisa/eisa_machdep.c
--- a/sys/arch/alpha/eisa/eisa_machdep.c        Sat Sep 25 20:05:55 2021 +0000
+++ b/sys/arch/alpha/eisa/eisa_machdep.c        Sat Sep 25 20:16:17 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: eisa_machdep.c,v 1.13 2020/11/18 02:04:29 thorpej Exp $ */
+/* $NetBSD: eisa_machdep.c,v 1.14 2021/09/25 20:16:17 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: eisa_machdep.c,v 1.13 2020/11/18 02:04:29 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: eisa_machdep.c,v 1.14 2021/09/25 20:16:17 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -45,6 +45,51 @@
 #include <dev/eisa/eisareg.h>
 #include <dev/eisa/eisavar.h>
 
+void
+eisa_attach_hook(device_t parent, device_t self,
+    struct eisabus_attach_args *eba)
+{
+       eba->eba_ec->ec_attach_hook(parent, self, eba);
+}
+
+int
+eisa_maxslots(eisa_chipset_tag_t ec)
+{
+       return ec->ec_maxslots(ec->ec_v);
+}
+
+int
+eisa_intr_map(eisa_chipset_tag_t ec, u_int irq, eisa_intr_handle_t *ihp)
+{
+       return ec->ec_intr_map(ec->ec_v, irq, ihp);
+}
+
+const char *
+eisa_intr_string(eisa_chipset_tag_t ec, eisa_intr_handle_t ih, char *buf,
+    size_t len)
+{
+       return ec->ec_intr_string(ec->ec_v, ih, buf, len);
+}
+
+const struct evcnt *
+eisa_intr_evcnt(eisa_chipset_tag_t ec, eisa_intr_handle_t ih)
+{
+       return ec->ec_intr_evcnt(ec->ec_v, ih);
+}
+
+void *
+eisa_intr_establish(eisa_chipset_tag_t ec, eisa_intr_handle_t ih,
+    int type, int level, int (*func)(void *), void *arg)
+{
+       return ec->ec_intr_establish(ec->ec_v, ih, type, level, func, arg);
+}
+
+void
+eisa_intr_disestablish(eisa_chipset_tag_t ec, void *cookie)
+{
+       return ec->ec_intr_disestablish(ec->ec_v, cookie);
+}
+
 #define        EISA_SLOT_HEADER_SIZE   31
 #define        EISA_SLOT_INFO_OFFSET   20
 
diff -r c035d5a9a0e2 -r c470f65c1602 sys/arch/alpha/include/eisa_machdep.h
--- a/sys/arch/alpha/include/eisa_machdep.h     Sat Sep 25 20:05:55 2021 +0000
+++ b/sys/arch/alpha/include/eisa_machdep.h     Sat Sep 25 20:16:17 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: eisa_machdep.h,v 1.12 2014/03/29 19:28:25 christos Exp $ */
+/* $NetBSD: eisa_machdep.h,v 1.13 2021/09/25 20:16:17 thorpej Exp $ */
 
 /*
  * Copyright (c) 1996 Carnegie-Mellon University.
@@ -51,29 +51,25 @@
 /*
  * Functions provided to machine-independent EISA code.
  */
-#define        eisa_attach_hook(p, s, a)                                       \
-    (*(a)->eba_ec->ec_attach_hook)((p), (s), (a))
-#define        eisa_maxslots(c)                                                \
-    (*(c)->ec_maxslots)((c)->ec_v)
-#define        eisa_intr_map(c, i, hp)                                         \
-    (*(c)->ec_intr_map)((c)->ec_v, (i), (hp))
-#define        eisa_intr_string(c, h, buf, len)                                \
-    (*(c)->ec_intr_string)((c)->ec_v, (h), (buf), (len))
-#define        eisa_intr_evcnt(c, h)                                           \
-    (*(c)->ec_intr_evcnt)((c)->ec_v, (h))
-#define        eisa_intr_establish(c, h, t, l, f, a)                           \
-    (*(c)->ec_intr_establish)((c)->ec_v, (h), (t), (l), (f), (a))
-#define        eisa_intr_disestablish(c, h)                                    \
-    (*(c)->ec_intr_disestablish)((c)->ec_v, (h))
+void           eisa_attach_hook(device_t, device_t,
+                   struct eisabus_attach_args *);
+int            eisa_maxslots(eisa_chipset_tag_t);
+int            eisa_intr_map(eisa_chipset_tag_t, u_int, eisa_intr_handle_t *);
+const char *   eisa_intr_string(eisa_chipset_tag_t, eisa_intr_handle_t,
+                   char *, size_t);
+const struct evcnt *eisa_intr_evcnt(eisa_chipset_tag_t, eisa_intr_handle_t);
+void *         eisa_intr_establish(eisa_chipset_tag_t, eisa_intr_handle_t,
+                   int, int, int (*)(void *), void *);
+void           eisa_intr_disestablish(eisa_chipset_tag_t, void *);
 
-int    eisa_conf_read_mem(eisa_chipset_tag_t, int, int, int,
-           struct eisa_cfg_mem *);
-int    eisa_conf_read_irq(eisa_chipset_tag_t, int, int, int,
-           struct eisa_cfg_irq *);
-int    eisa_conf_read_dma(eisa_chipset_tag_t, int, int, int,
-           struct eisa_cfg_dma *);
-int    eisa_conf_read_io(eisa_chipset_tag_t, int, int, int,
-           struct eisa_cfg_io *);
+int            eisa_conf_read_mem(eisa_chipset_tag_t, int, int, int,
+                   struct eisa_cfg_mem *);
+int            eisa_conf_read_irq(eisa_chipset_tag_t, int, int, int,
+                   struct eisa_cfg_irq *);
+int            eisa_conf_read_dma(eisa_chipset_tag_t, int, int, int,
+                   struct eisa_cfg_dma *);
+int            eisa_conf_read_io(eisa_chipset_tag_t, int, int, int,
+                   struct eisa_cfg_io *);
 
 /*
  * Internal functions, NOT TO BE USED BY MACHINE-INDEPENDENT CODE!



Home | Main Index | Thread Index | Old Index