Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/pic Make the splx fast path smaller.
details: https://anonhg.NetBSD.org/src/rev/c99b13208964
branches: trunk
changeset: 1018971:c99b13208964
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Mon Feb 22 21:16:25 2021 +0000
description:
Make the splx fast path smaller.
diffstat:
sys/arch/arm/pic/pic_splfuncs.c | 50 +++++++++++++++++++++++++---------------
1 files changed, 31 insertions(+), 19 deletions(-)
diffs (106 lines):
diff -r 90bb3bf4a737 -r c99b13208964 sys/arch/arm/pic/pic_splfuncs.c
--- a/sys/arch/arm/pic/pic_splfuncs.c Mon Feb 22 21:14:15 2021 +0000
+++ b/sys/arch/arm/pic/pic_splfuncs.c Mon Feb 22 21:16:25 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pic_splfuncs.c,v 1.17 2021/02/21 17:07:45 jmcneill Exp $ */
+/* $NetBSD: pic_splfuncs.c,v 1.18 2021/02/22 21:16:25 jmcneill Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -28,7 +28,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pic_splfuncs.c,v 1.17 2021/02/21 17:07:45 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic_splfuncs.c,v 1.18 2021/02/22 21:16:25 jmcneill Exp $");
#define _INTR_PRIVATE
#include <sys/param.h>
@@ -46,23 +46,34 @@
#include <arm/pic/picvar.h>
+#if defined(__HAVE_CPU_DOSOFTINTS_CI)
+#define CPU_DOSOFTINTS(ci) cpu_dosoftints_ci((ci))
+#else
+#define CPU_DOSOFTINTS(ci) cpu_dosoftints()
+#endif
+
+#if defined(__HAVE_PIC_PENDING_INTRS)
+static void splx_dopendingints(struct cpu_info *, const int);
+#endif
+
int
_splraise(int newipl)
{
struct cpu_info * const ci = curcpu();
const int oldipl = ci->ci_cpl;
- KASSERT(newipl < NIPL);
+ KDASSERT(newipl < NIPL);
if (newipl > ci->ci_cpl) {
pic_set_priority(ci, newipl);
}
return oldipl;
}
+
int
_spllower(int newipl)
{
struct cpu_info * const ci = curcpu();
const int oldipl = ci->ci_cpl;
- KASSERT(panicstr || newipl <= ci->ci_cpl);
+ KDASSERT(panicstr || newipl <= ci->ci_cpl);
if (newipl < ci->ci_cpl) {
register_t psw = cpsid(I32_bit);
ci->ci_intr_depth++;
@@ -79,17 +90,29 @@
splx(int savedipl)
{
struct cpu_info * const ci = curcpu();
- KASSERT(savedipl < NIPL);
+ KDASSERT(savedipl < NIPL);
if (__predict_false(savedipl == ci->ci_cpl)) {
return;
}
#if defined(__HAVE_PIC_PENDING_INTRS)
- if (__predict_true(ci->ci_pending_ipls == 0)) {
- goto skip_pending;
+ if (__predict_false(ci->ci_pending_ipls != 0)) {
+ splx_dopendingints(ci, savedipl);
}
+#endif
+ pic_set_priority(ci, savedipl);
+ CPU_DOSOFTINTS(ci);
+
+ KDASSERTMSG(ci->ci_cpl == savedipl, "cpl %d savedipl %d",
+ ci->ci_cpl, savedipl);
+}
+
+#if defined(__HAVE_PIC_PENDING_INTRS)
+static void __noinline
+splx_dopendingints(struct cpu_info *ci, const int savedipl)
+{
const register_t psw = cpsid(I32_bit);
ci->ci_intr_depth++;
while ((ci->ci_pending_ipls & ~__BIT(savedipl)) > __BIT(savedipl)) {
@@ -110,16 +133,5 @@
if ((psw & I32_bit) == 0) {
cpsie(I32_bit);
}
-skip_pending:
+}
#endif
-
- pic_set_priority(ci, savedipl);
-#if defined(__HAVE_CPU_DOSOFTINTS_CI)
- cpu_dosoftints_ci(ci);
-#else
- cpu_dosoftints();
-#endif
-
- KASSERTMSG(ci->ci_cpl == savedipl, "cpl %d savedipl %d",
- ci->ci_cpl, savedipl);
-}
Home |
Main Index |
Thread Index |
Old Index