diff options
| author | mrg <mrg@NetBSD.org> | 2019-02-04 21:57:47 +0000 |
|---|---|---|
| committer | mrg <mrg@NetBSD.org> | 2019-02-04 21:57:47 +0000 |
| commit | 08bd44a40828b016efd2ccc733e406955a801eb0 (patch) | |
| tree | ce73f6c2afe600719cb63288a559499b18c68179 /sys/dev/raidframe | |
| parent | 775e80c7b1167091d0703612c5ee57db0d544b7e (diff) | |
don't assume _LP64 == supports COMPAT_NETBSD32.
this is not true for alpha, ia64 and arm32 ports, and the first two
were not building because of it, and the latter would be missing
the oabi support (likely not a big deal, but still wrong.)
add a makefile fragment that tells you if it is supported and include
it where needed to define COMPAT_NETBSD32 when building the normal
kernel (ie, modules & rump.)
fixes alpha build, probably fixes ia64 build.
XXX: still leaves some netbsd32 code in rf_netbsdkintf.c, that should
be moved into some hooks, but first the configuration setup
needs to be moved into a common function the netbsd32 code can
call into, vs living in the switch case itself.
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_netbsdkintf.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c index 874fdeccf2e..fc5eeb4255c 100644 --- a/sys/dev/raidframe/rf_netbsdkintf.c +++ b/sys/dev/raidframe/rf_netbsdkintf.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_netbsdkintf.c,v 1.362 2019/02/03 11:03:53 martin Exp $ */ +/* $NetBSD: rf_netbsdkintf.c,v 1.363 2019/02/04 21:57:47 mrg Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc. @@ -101,10 +101,11 @@ ***********************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.362 2019/02/03 11:03:53 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.363 2019/02/04 21:57:47 mrg Exp $"); #ifdef _KERNEL_OPT #include "opt_raid_autoconfig.h" +#include "opt_compat_netbsd32.h" #endif #include <sys/param.h> @@ -150,10 +151,7 @@ __KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.362 2019/02/03 11:03:53 martin #include "rf_compat80.h" -#ifdef _LP64 -#ifndef COMPAT_NETBSD32 -#define COMPAT_NETBSD32 1 -#endif +#ifdef COMPAT_NETBSD32 #include "rf_compat32.h" #endif @@ -1112,7 +1110,7 @@ raidioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l) case RAIDFRAME_PARITYMAP_GET_DISABLE: case RAIDFRAME_PARITYMAP_SET_DISABLE: case RAIDFRAME_PARITYMAP_SET_PARAMS: -#ifdef _LP64 +#ifdef COMPAT_NETBSD32 case RAIDFRAME_GET_INFO32: #endif if ((rs->sc_flags & RAIDF_INITED) == 0) @@ -1162,7 +1160,7 @@ raidioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l) /* configure the system */ case RAIDFRAME_CONFIGURE: -#ifdef _LP64 +#ifdef COMPAT_NETBSD32 case RAIDFRAME_CONFIGURE32: #endif @@ -1179,7 +1177,7 @@ raidioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l) if (k_cfg == NULL) { return (ENOMEM); } -#ifdef _LP64 +#ifdef COMPAT_NETBSD32 if (cmd == RAIDFRAME_CONFIGURE32 && (l->l_proc->p_flag & PK_32) != 0) MODULE_CALL_HOOK(raidframe_netbsd32_config_hook, @@ -1487,21 +1485,21 @@ raidioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l) return(retcode); case RAIDFRAME_GET_INFO: -#ifdef _LP64 +#ifdef COMPAT_NETBSD32 case RAIDFRAME_GET_INFO32: -#endif /* LP64 */ +#endif RF_Malloc(d_cfg, sizeof(RF_DeviceConfig_t), (RF_DeviceConfig_t *)); if (d_cfg == NULL) return (ENOMEM); retcode = rf_get_info(raidPtr, d_cfg); if (retcode == 0) { -#ifdef _LP64 +#ifdef COMPAT_NETBSD32 if (raidframe_netbsd32_config_hook.hooked && cmd == RAIDFRAME_GET_INFO32) ucfgp = NETBSD32PTR64(*(netbsd32_pointer_t *)data); else -#endif /* _LP64 */ +#endif ucfgp = *(RF_DeviceConfig_t **)data; retcode = copyout(d_cfg, ucfgp, sizeof(RF_DeviceConfig_t)); } |
