Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/pgoyette-compat]: src/sys Convert yet another function pointer to the MP...
details: https://anonhg.NetBSD.org/src/rev/e6103520c8bd
branches: pgoyette-compat
changeset: 830780:e6103520c8bd
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Mon Sep 24 22:56:45 2018 +0000
description:
Convert yet another function pointer to the MP-safe mechanism
diffstat:
sys/arch/amd64/amd64/netbsd32_machdep.c | 13 +++++++++----
sys/arch/amd64/amd64/netbsd32_machdep_16.c | 13 ++++++++-----
sys/compat/netbsd32/netbsd32.h | 4 ++--
3 files changed, 19 insertions(+), 11 deletions(-)
diffs (107 lines):
diff -r 06af3052c76a -r e6103520c8bd sys/arch/amd64/amd64/netbsd32_machdep.c
--- a/sys/arch/amd64/amd64/netbsd32_machdep.c Mon Sep 24 10:20:59 2018 +0000
+++ b/sys/arch/amd64/amd64/netbsd32_machdep.c Mon Sep 24 22:56:45 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_machdep.c,v 1.115.2.3 2018/09/14 08:38:37 pgoyette Exp $ */
+/* $NetBSD: netbsd32_machdep.c,v 1.115.2.4 2018/09/24 22:56:45 pgoyette Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.115.2.3 2018/09/14 08:38:37 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.115.2.4 2018/09/24 22:56:45 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -270,13 +270,18 @@
netbsd32_buildcontext(l, tf, fp, catcher, onstack);
}
-void (*vec_netbsd32_sendsig)(const ksiginfo_t *, const sigset_t *);
+MODULE_CALL_HOOK_DECL(netbsd32_sendsig_hook, f,
+ (const ksiginfo_t *ksi, const sigset_t *mask), (ksi, mask),
+ netbsd32_sendsig_siginfo());
+MODULE_CALL_HOOK(netbsd32_sendsig_hook, f,
+ (const ksiginfo_t *ksi, const sigset_t *mask), (ksi, mask),
+ netbsd32_sendsig_siginfo());
void
netbsd32_sendsig(const ksiginfo_t *ksi, const sigset_t *mask)
{
- (*vec_netbsd32_sendsig)(ksi, mask);
+ netbsd32_sendsig_hook_f_call(ksi, mask);
}
#ifdef COREDUMP
diff -r 06af3052c76a -r e6103520c8bd sys/arch/amd64/amd64/netbsd32_machdep_16.c
--- a/sys/arch/amd64/amd64/netbsd32_machdep_16.c Mon Sep 24 10:20:59 2018 +0000
+++ b/sys/arch/amd64/amd64/netbsd32_machdep_16.c Mon Sep 24 22:56:45 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_machdep_16.c,v 1.1.2.2 2018/09/14 08:38:37 pgoyette Exp $ */
+/* $NetBSD: netbsd32_machdep_16.c,v 1.1.2.3 2018/09/24 22:56:45 pgoyette Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.2 2018/09/14 08:38:37 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.3 2018/09/24 22:56:45 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -85,6 +85,8 @@
void netbsd32_sendsig_16(const ksiginfo_t *, const sigset_t *);
+struct netbsd32_sendsig_hook_t netbsd32_sendsig_hook;
+
static void
netbsd32_sendsig_sigcontext(const ksiginfo_t *ksi, const sigset_t *mask)
{
@@ -240,18 +242,19 @@
return (EJUSTRETURN);
}
-extern void (*vec_netbsd32_sendsig)(const ksiginfo_t *, const sigset_t *);
+MODULE_HOOK_SET(netbsd32_sendsig_hook, "nb32_16", netbsd32_sendsig_16);
+MODULE_HOOK_UNSET(netbsd32_sendsig_hook);
void
netbsd32_machdep_md_16_init(void)
{
- vec_netbsd32_sendsig = netbsd32_sendsig_16;
+ netbsd32_sendsig_hook_set();
}
void
netbsd32_machdep_md_16_fini(void)
{
- vec_netbsd32_sendsig = netbsd32_sendsig_siginfo;
+ netbsd32_sendsig_hook_set();
}
diff -r 06af3052c76a -r e6103520c8bd sys/compat/netbsd32/netbsd32.h
--- a/sys/compat/netbsd32/netbsd32.h Mon Sep 24 10:20:59 2018 +0000
+++ b/sys/compat/netbsd32/netbsd32.h Mon Sep 24 22:56:45 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32.h,v 1.116.2.12 2018/09/23 11:57:09 pgoyette Exp $ */
+/* $NetBSD: netbsd32.h,v 1.116.2.13 2018/09/24 22:56:45 pgoyette Exp $ */
/*
* Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green
@@ -1167,7 +1167,7 @@
SYSCTL_SETUP_PROTO(netbsd32_sysctl_emul_setup);
#endif /* SYSCTL_SETUP_PROTO */
-extern void (*vec_netbsd32_sendsig)(const ksiginfo_t *, const sigset_t *);
+MODULE_HOOK(netbsd32_sendsig_hook, (const ksiginfo_t *, const sigset_t *);
extern struct sysent netbsd32_sysent[];
extern const uint32_t netbsd32_sysent_nomodbits[];
Home |
Main Index |
Thread Index |
Old Index