Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386/include i386: Make curlwp and curcpu() flushable.



details:   https://anonhg.NetBSD.org/src/rev/8c6b30a918b3
branches:  trunk
changeset: 374183:8c6b30a918b3
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Apr 09 08:18:03 2023 +0000

description:
i386: Make curlwp and curcpu() flushable.

The only effect of the `volatile' qualifier on an asm block with
outputs is to force the instructions to appear in the generated code,
even if the outputs end up being unused.  Since these instructions
have no (architectural) side effects -- provided %fs is set
correctly, which must be the case here -- there's no need for the
volatile qualifier, so nix it.

diffstat:

 sys/arch/i386/include/cpu.h |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 638dde63874e -r 8c6b30a918b3 sys/arch/i386/include/cpu.h
--- a/sys/arch/i386/include/cpu.h       Sun Apr 09 08:17:56 2023 +0000
+++ b/sys/arch/i386/include/cpu.h       Sun Apr 09 08:18:03 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.183 2021/11/02 11:26:04 ryo Exp $    */
+/*     $NetBSD: cpu.h,v 1.184 2023/04/09 08:18:03 riastradh Exp $      */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -50,7 +50,7 @@ x86_curcpu(void)
 {
        struct cpu_info *ci;
 
-       __asm volatile("movl %%fs:%1, %0" :
+       __asm("movl %%fs:%1, %0" :
            "=r" (ci) :
            "m"
            (*(struct cpu_info * const *)offsetof(struct cpu_info, ci_self)));
@@ -62,7 +62,7 @@ x86_curlwp(void)
 {
        lwp_t *l;
 
-       __asm volatile("movl %%fs:%1, %0" :
+       __asm("movl %%fs:%1, %0" :
            "=r" (l) :
            "m"
            (*(struct cpu_info * const *)offsetof(struct cpu_info, ci_curlwp)));



Home | Main Index | Thread Index | Old Index