From 24983043bf7948e274b2b00d634ae509a292b976 Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Mon, 13 Jun 2022 18:35:38 +0100 Subject: [PATCH] x86: cleanup in machine/cpufunc.h Reduce diffs between amd64 and i386 and improve whitespace Reviewed by: jhb, imp --- sys/amd64/include/cpufunc.h | 8 ++++---- sys/i386/include/cpufunc.h | 7 ------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index 99d8c82aa111..941c951a941a 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -105,16 +105,16 @@ static __inline void do_cpuid(u_int ax, u_int *p) { __asm __volatile("cpuid" - : "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3]) - : "0" (ax)); + : "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3]) + : "0" (ax)); } static __inline void cpuid_count(u_int ax, u_int cx, u_int *p) { __asm __volatile("cpuid" - : "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3]) - : "0" (ax), "c" (cx)); + : "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3]) + : "0" (ax), "c" (cx)); } static __inline void diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h index cd7ba31bdb22..2b517b12fba0 100644 --- a/sys/i386/include/cpufunc.h +++ b/sys/i386/include/cpufunc.h @@ -98,7 +98,6 @@ clts(void) static __inline void disable_intr(void) { - __asm __volatile("cli" : : : "memory"); } @@ -147,14 +146,12 @@ cpuid_count(u_int ax, u_int cx, u_int *p) static __inline void enable_intr(void) { - __asm __volatile("sti"); } static __inline void cpu_monitor(const void *addr, u_long extensions, u_int hints) { - __asm __volatile("monitor" : : "a" (addr), "c" (extensions), "d" (hints)); } @@ -162,28 +159,24 @@ cpu_monitor(const void *addr, u_long extensions, u_int hints) static __inline void cpu_mwait(u_long extensions, u_int hints) { - __asm __volatile("mwait" : : "a" (hints), "c" (extensions)); } static __inline void lfence(void) { - __asm __volatile("lfence" : : : "memory"); } static __inline void mfence(void) { - __asm __volatile("mfence" : : : "memory"); } static __inline void sfence(void) { - __asm __volatile("sfence" : : : "memory"); }