Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Switch in_interrupt() in KCOV to cpu_intr_p()



details:   https://anonhg.NetBSD.org/src/rev/6f9a4de604d0
branches:  trunk
changeset: 846795:6f9a4de604d0
user:      kamil <kamil%NetBSD.org@localhost>
date:      Sun Dec 01 17:41:11 2019 +0000

description:
Switch in_interrupt() in KCOV to cpu_intr_p()

This makes KCOV more MI friendly and removes x86-specific in_interrupt()
implementation.

diffstat:

 sys/kern/subr_kcov.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r cd5cdfd3900d -r 6f9a4de604d0 sys/kern/subr_kcov.c
--- a/sys/kern/subr_kcov.c      Sun Dec 01 17:25:47 2019 +0000
+++ b/sys/kern/subr_kcov.c      Sun Dec 01 17:41:11 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_kcov.c,v 1.9 2019/11/15 09:44:44 maxv Exp $       */
+/*     $NetBSD: subr_kcov.c,v 1.10 2019/12/01 17:41:11 kamil Exp $     */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -38,6 +38,7 @@
 
 #include <sys/conf.h>
 #include <sys/condvar.h>
+#include <sys/cpu.h>
 #include <sys/file.h>
 #include <sys/filedesc.h>
 #include <sys/kmem.h>
@@ -342,7 +343,7 @@
 static inline bool __nomsan
 in_interrupt(void)
 {
-       return curcpu()->ci_idepth >= 0;
+       return cpu_intr_p();
 }
 
 void __sanitizer_cov_trace_pc(void);



Home | Main Index | Thread Index | Old Index