Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/sys/dev/nvmm Open code preempt_needed() which is not avai...



details:   https://anonhg.NetBSD.org/src/rev/7c8778fe2d81
branches:  netbsd-9
changeset: 936722:7c8778fe2d81
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Aug 02 11:19:09 2020 +0000

description:
Open code preempt_needed() which is not available on this branch.
Fixes build fallout from ticket #1032.

diffstat:

 sys/dev/nvmm/nvmm_internal.h |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r 91dbc618e1d9 -r 7c8778fe2d81 sys/dev/nvmm/nvmm_internal.h
--- a/sys/dev/nvmm/nvmm_internal.h      Sun Aug 02 09:14:12 2020 +0000
+++ b/sys/dev/nvmm/nvmm_internal.h      Sun Aug 02 11:19:09 2020 +0000
@@ -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 @@
 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) {



Home | Main Index | Thread Index | Old Index