diff options
| author | thorpej <thorpej@NetBSD.org> | 2021-09-25 20:16:17 +0000 |
|---|---|---|
| committer | thorpej <thorpej@NetBSD.org> | 2021-09-25 20:16:17 +0000 |
| commit | 888963ca36af01e1643a4cfce8bf2f8a6e6ec9dd (patch) | |
| tree | 750dd439844b522642606877b5b9e8cdf546e4e8 /sys | |
| parent | 1ab480b9b0680496f1f3b153f197c7856d119ac4 (diff) | |
Make all of the EISA chipset functions call through real functions,
rather the macros.
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/arch/alpha/eisa/eisa_machdep.c | 49 | ||||
| -rw-r--r-- | sys/arch/alpha/include/eisa_machdep.h | 42 |
2 files changed, 66 insertions, 25 deletions
diff --git a/sys/arch/alpha/eisa/eisa_machdep.c b/sys/arch/alpha/eisa/eisa_machdep.c index 5dc528e2a9e..d5ca5ef7a72 100644 --- a/sys/arch/alpha/eisa/eisa_machdep.c +++ b/sys/arch/alpha/eisa/eisa_machdep.c @@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: eisa_machdep.c,v 1.13 2020/11/18 02:04:29 thorpej Ex #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 --git a/sys/arch/alpha/include/eisa_machdep.h b/sys/arch/alpha/include/eisa_machdep.h index 98df70953d3..ee255d6792d 100644 --- a/sys/arch/alpha/include/eisa_machdep.h +++ b/sys/arch/alpha/include/eisa_machdep.h @@ -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 @@ struct alpha_eisa_chipset { /* * 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! |
