Module Name: src Committed By: thorpej Date: Sat Sep 25 20:16:17 UTC 2021
Modified Files: src/sys/arch/alpha/eisa: eisa_machdep.c src/sys/arch/alpha/include: eisa_machdep.h Log Message: Make all of the EISA chipset functions call through real functions, rather the macros. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/arch/alpha/eisa/eisa_machdep.c cvs rdiff -u -r1.12 -r1.13 src/sys/arch/alpha/include/eisa_machdep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/alpha/eisa/eisa_machdep.c diff -u src/sys/arch/alpha/eisa/eisa_machdep.c:1.13 src/sys/arch/alpha/eisa/eisa_machdep.c:1.14 --- src/sys/arch/alpha/eisa/eisa_machdep.c:1.13 Wed Nov 18 02:04:29 2020 +++ src/sys/arch/alpha/eisa/eisa_machdep.c Sat Sep 25 20:16:17 2021 @@ -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 #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 Index: src/sys/arch/alpha/include/eisa_machdep.h diff -u src/sys/arch/alpha/include/eisa_machdep.h:1.12 src/sys/arch/alpha/include/eisa_machdep.h:1.13 --- src/sys/arch/alpha/include/eisa_machdep.h:1.12 Sat Mar 29 19:28:25 2014 +++ src/sys/arch/alpha/include/eisa_machdep.h Sat Sep 25 20:16:17 2021 @@ -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)) - -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 *); +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 *); /* * Internal functions, NOT TO BE USED BY MACHINE-INDEPENDENT CODE!