Source-Changes-HG archive

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

[src/trunk]: src/sys/sys In order to prevent _mcount() from being recursively...



details:   https://anonhg.NetBSD.org/src/rev/e3b51bd42763
branches:  trunk
changeset: 1024757:e3b51bd42763
user:      ryo <ryo%NetBSD.org@localhost>
date:      Tue Nov 02 11:26:03 2021 +0000

description:
In order to prevent _mcount() from being recursively called when built with COPTS=-O0,
sprinkle `__always_inline' to make _mcount() be generated as a single function.

diffstat:

 sys/arch/aarch64/include/cpu.h     |   4 ++--
 sys/arch/alpha/include/alpha_cpu.h |   4 ++--
 sys/arch/amd64/include/cpu.h       |   4 ++--
 sys/arch/amd64/include/profile.h   |  14 +++++++-------
 sys/arch/dreamcast/include/intr.h  |   6 +++---
 sys/arch/evbsh3/include/intr.h     |   6 +++---
 sys/arch/hpcsh/include/intr.h      |   6 +++---
 sys/arch/hppa/include/cpu.h        |   4 ++--
 sys/arch/i386/include/cpu.h        |   4 ++--
 sys/arch/i386/include/profile.h    |   8 ++++----
 sys/arch/landisk/include/intr.h    |   6 +++---
 sys/arch/mmeye/include/intr.h      |   6 +++---
 sys/arch/powerpc/include/cpu.h     |   4 ++--
 sys/arch/sparc/include/psl.h       |   6 +++---
 sys/arch/sparc64/include/psl.h     |   8 ++++----
 sys/arch/vax/include/intr.h        |  12 ++++++------
 sys/arch/vax/include/mtpr.h        |   6 +++---
 sys/sys/spl.h                      |   4 ++--
 18 files changed, 56 insertions(+), 56 deletions(-)

diffs (truncated from 487 to 300 lines):

diff -r f16940a3851d -r e3b51bd42763 sys/arch/aarch64/include/cpu.h
--- a/sys/arch/aarch64/include/cpu.h    Tue Nov 02 11:22:03 2021 +0000
+++ b/sys/arch/aarch64/include/cpu.h    Tue Nov 02 11:26:03 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.44 2021/11/01 08:53:40 skrll Exp $ */
+/* $NetBSD: cpu.h,v 1.45 2021/11/02 11:26:03 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014, 2020 The NetBSD Foundation, Inc.
@@ -177,7 +177,7 @@
 } __aligned(COHERENCY_UNIT);
 
 #ifdef _KERNEL
-static inline struct lwp * __attribute__ ((const))
+static inline __always_inline struct lwp * __attribute__ ((const))
 aarch64_curlwp(void)
 {
        struct lwp *l;
diff -r f16940a3851d -r e3b51bd42763 sys/arch/alpha/include/alpha_cpu.h
--- a/sys/arch/alpha/include/alpha_cpu.h        Tue Nov 02 11:22:03 2021 +0000
+++ b/sys/arch/alpha/include/alpha_cpu.h        Tue Nov 02 11:26:03 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: alpha_cpu.h,v 1.54 2021/05/27 22:05:24 thorpej Exp $ */
+/* $NetBSD: alpha_cpu.h,v 1.55 2021/11/02 11:26:03 ryo Exp $ */
 
 /*
  * Copyright (c) 1996 Carnegie-Mellon University.
@@ -453,7 +453,7 @@
        return (v0);
 }
 
-static __inline unsigned long
+static __inline __always_inline unsigned long
 alpha_pal_rdval(void)
 {
        register unsigned long v0 __asm("$0");
diff -r f16940a3851d -r e3b51bd42763 sys/arch/amd64/include/cpu.h
--- a/sys/arch/amd64/include/cpu.h      Tue Nov 02 11:22:03 2021 +0000
+++ b/sys/arch/amd64/include/cpu.h      Tue Nov 02 11:26:03 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.69 2021/04/17 20:12:55 rillig Exp $  */
+/*     $NetBSD: cpu.h,v 1.70 2021/11/02 11:26:03 ryo Exp $     */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -48,7 +48,7 @@
 static struct cpu_info *x86_curcpu(void);
 static lwp_t *x86_curlwp(void);
 
-__inline static struct cpu_info * __unused __nomsan
+__inline __always_inline static struct cpu_info * __unused __nomsan
 x86_curcpu(void)
 {
        struct cpu_info *ci;
diff -r f16940a3851d -r e3b51bd42763 sys/arch/amd64/include/profile.h
--- a/sys/arch/amd64/include/profile.h  Tue Nov 02 11:22:03 2021 +0000
+++ b/sys/arch/amd64/include/profile.h  Tue Nov 02 11:26:03 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: profile.h,v 1.20 2021/04/17 20:12:55 rillig Exp $      */
+/*     $NetBSD: profile.h,v 1.21 2021/11/02 11:26:03 ryo Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -80,7 +80,7 @@
 
 #ifdef _KERNEL
 #ifdef XENPV
-static inline void
+static inline __always_inline void
 mcount_disable_intr(void)
 {
        /* should be __cli() but this calls x86_lfence() which calls mcount */
@@ -88,13 +88,13 @@
        __asm volatile("lfence" ::: "memory"); /* x86_lfence() */
 }
 
-static inline u_long
+static inline __always_inline u_long
 mcount_read_psl(void)
 {
        return (curcpu()->ci_vcpu->evtchn_upcall_mask);
 }
 
-static inline void
+static inline __always_inline void
 mcount_write_psl(u_long psl)
 {
        curcpu()->ci_vcpu->evtchn_upcall_mask = psl;
@@ -104,13 +104,13 @@
 }
 
 #else /* XENPV */
-static inline void
+static inline __always_inline void
 mcount_disable_intr(void)
 {
        __asm volatile("cli");
 }
 
-static inline u_long
+static inline __always_inline u_long
 mcount_read_psl(void)
 {
        u_long  ef;
@@ -119,7 +119,7 @@
        return (ef);
 }
 
-static inline void
+static inline __always_inline void
 mcount_write_psl(u_long ef)
 {
        __asm volatile("pushq %0; popfq" : : "r" (ef));
diff -r f16940a3851d -r e3b51bd42763 sys/arch/dreamcast/include/intr.h
--- a/sys/arch/dreamcast/include/intr.h Tue Nov 02 11:22:03 2021 +0000
+++ b/sys/arch/dreamcast/include/intr.h Tue Nov 02 11:26:03 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.h,v 1.9 2008/04/28 20:23:16 martin Exp $  */
+/*     $NetBSD: intr.h,v 1.10 2021/11/02 11:26:03 ryo Exp $    */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -44,14 +44,14 @@
        ipl_t _ipl;
 } ipl_cookie_t;
 
-static inline ipl_cookie_t
+static inline __always_inline ipl_cookie_t
 makeiplcookie(ipl_t ipl)
 {
 
        return (ipl_cookie_t){._ipl = ipl << 4};
 }
 
-static inline int
+static inline __always_inline int
 splraiseipl(ipl_cookie_t icookie)
 {
 
diff -r f16940a3851d -r e3b51bd42763 sys/arch/evbsh3/include/intr.h
--- a/sys/arch/evbsh3/include/intr.h    Tue Nov 02 11:22:03 2021 +0000
+++ b/sys/arch/evbsh3/include/intr.h    Tue Nov 02 11:26:03 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.h,v 1.14 2010/04/06 15:54:30 nonaka Exp $ */
+/*     $NetBSD: intr.h,v 1.15 2021/11/02 11:26:04 ryo Exp $    */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -44,14 +44,14 @@
        ipl_t _ipl;
 } ipl_cookie_t;
 
-static inline ipl_cookie_t
+static inline __always_inline ipl_cookie_t
 makeiplcookie(ipl_t ipl)
 {
 
        return (ipl_cookie_t){._ipl = ipl << 4};
 }
 
-static inline int
+static inline __always_inline int
 splraiseipl(ipl_cookie_t icookie)
 {
 
diff -r f16940a3851d -r e3b51bd42763 sys/arch/hpcsh/include/intr.h
--- a/sys/arch/hpcsh/include/intr.h     Tue Nov 02 11:22:03 2021 +0000
+++ b/sys/arch/hpcsh/include/intr.h     Tue Nov 02 11:26:03 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.h,v 1.13 2008/04/28 20:23:23 martin Exp $ */
+/*     $NetBSD: intr.h,v 1.14 2021/11/02 11:26:04 ryo Exp $    */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -51,14 +51,14 @@
        ipl_t _ipl;
 } ipl_cookie_t;
 
-static inline ipl_cookie_t
+static inline __always_inline ipl_cookie_t
 makeiplcookie(ipl_t ipl)
 {
 
        return (ipl_cookie_t){._ipl = ipl << 4};
 }
 
-static inline int
+static inline __always_inline int
 splraiseipl(ipl_cookie_t icookie)
 {
 
diff -r f16940a3851d -r e3b51bd42763 sys/arch/hppa/include/cpu.h
--- a/sys/arch/hppa/include/cpu.h       Tue Nov 02 11:22:03 2021 +0000
+++ b/sys/arch/hppa/include/cpu.h       Tue Nov 02 11:26:03 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.11 2021/08/14 17:51:19 ryo Exp $     */
+/*     $NetBSD: cpu.h,v 1.12 2021/11/02 11:26:04 ryo Exp $     */
 
 /*     $OpenBSD: cpu.h,v 1.55 2008/07/23 17:39:35 kettenis Exp $       */
 
@@ -342,7 +342,7 @@
 void   cpu_boot_secondary_processors(void);
 
 #if !defined(_MODULE)
-static __inline struct cpu_info *
+static __inline __always_inline struct cpu_info *
 _hppa_curcpu(void)
 {
        struct cpu_info *ci;
diff -r f16940a3851d -r e3b51bd42763 sys/arch/i386/include/cpu.h
--- a/sys/arch/i386/include/cpu.h       Tue Nov 02 11:22:03 2021 +0000
+++ b/sys/arch/i386/include/cpu.h       Tue Nov 02 11:26:03 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.182 2019/11/21 19:24:00 ad Exp $     */
+/*     $NetBSD: cpu.h,v 1.183 2021/11/02 11:26:04 ryo Exp $    */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -45,7 +45,7 @@
 static struct cpu_info *x86_curcpu(void);
 static lwp_t *x86_curlwp(void);
 
-__inline static struct cpu_info * __unused
+__inline __always_inline static struct cpu_info * __unused
 x86_curcpu(void)
 {
        struct cpu_info *ci;
diff -r f16940a3851d -r e3b51bd42763 sys/arch/i386/include/profile.h
--- a/sys/arch/i386/include/profile.h   Tue Nov 02 11:22:03 2021 +0000
+++ b/sys/arch/i386/include/profile.h   Tue Nov 02 11:26:03 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: profile.h,v 1.37 2017/06/08 18:25:14 christos Exp $    */
+/*     $NetBSD: profile.h,v 1.38 2021/11/02 11:26:04 ryo Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -84,13 +84,13 @@
 }
 
 #ifdef _KERNEL
-static inline void
+static inline __always_inline void
 mcount_disable_intr(void)
 {
        __asm volatile("cli");
 }
 
-static inline u_long
+static inline __always_inline u_long
 mcount_read_psl(void)
 {
        u_long  ef;
@@ -99,7 +99,7 @@
        return (ef);
 }
 
-static inline void
+static inline __always_inline void
 mcount_write_psl(u_long ef)
 {
        __asm volatile("pushl %0; popfl" : : "r" (ef));
diff -r f16940a3851d -r e3b51bd42763 sys/arch/landisk/include/intr.h
--- a/sys/arch/landisk/include/intr.h   Tue Nov 02 11:22:03 2021 +0000
+++ b/sys/arch/landisk/include/intr.h   Tue Nov 02 11:26:03 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.h,v 1.6 2008/04/28 20:23:26 martin Exp $  */
+/*     $NetBSD: intr.h,v 1.7 2021/11/02 11:26:04 ryo Exp $     */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -44,14 +44,14 @@
        ipl_t _ipl;
 } ipl_cookie_t;
 
-static inline ipl_cookie_t
+static inline __always_inline ipl_cookie_t
 makeiplcookie(ipl_t ipl)
 {
 
        return (ipl_cookie_t){._ipl = ipl << 4};
 }
 
-static inline int
+static inline __always_inline int
 splraiseipl(ipl_cookie_t icookie)
 {
 
diff -r f16940a3851d -r e3b51bd42763 sys/arch/mmeye/include/intr.h
--- a/sys/arch/mmeye/include/intr.h     Tue Nov 02 11:22:03 2021 +0000
+++ b/sys/arch/mmeye/include/intr.h     Tue Nov 02 11:26:03 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.h,v 1.12 2018/04/19 21:50:06 christos Exp $       */
+/*     $NetBSD: intr.h,v 1.13 2021/11/02 11:26:04 ryo Exp $    */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -49,14 +49,14 @@
        ipl_t _ipl;
 } ipl_cookie_t;
 



Home | Main Index | Thread Index | Old Index