Module Name: src
Committed By: martin
Date: Sun Aug 2 11:19:09 UTC 2020
Modified Files:
src/sys/dev/nvmm [netbsd-9]: nvmm_internal.h
Log Message:
Open code preempt_needed() which is not available on this branch.
Fixes build fallout from ticket #1032.
To generate a diff of this commit:
cvs rdiff -u -r1.12.2.3 -r1.12.2.4 src/sys/dev/nvmm/nvmm_internal.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/dev/nvmm/nvmm_internal.h
diff -u src/sys/dev/nvmm/nvmm_internal.h:1.12.2.3 src/sys/dev/nvmm/nvmm_internal.h:1.12.2.4
--- src/sys/dev/nvmm/nvmm_internal.h:1.12.2.3 Sun Aug 2 08:49:08 2020
+++ src/sys/dev/nvmm/nvmm_internal.h Sun Aug 2 11:19:09 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: nvmm_internal.h,v 1.12.2.3 2020/08/02 08:49:08 martin Exp $ */
+/* $NetBSD: nvmm_internal.h,v 1.12.2.4 2020/08/02 11:19:09 martin Exp $ */
/*
* Copyright (c) 2018-2020 The NetBSD Foundation, Inc.
@@ -125,7 +125,13 @@ extern const struct nvmm_impl nvmm_x86_v
static inline bool
nvmm_return_needed(void)
{
- if (preempt_needed()) {
+ lwp_t *l = curlwp;
+ int needed;
+
+ KPREEMPT_DISABLE(l);
+ needed = l->l_cpu->ci_want_resched;
+ KPREEMPT_ENABLE(l);
+ if (needed) {
return true;
}
if (curlwp->l_flag & LW_USERRET) {