x86: cleanup in machine/cpufunc.h

Reduce diffs between amd64 and i386 and improve whitespace

Reviewed by:	jhb, imp
This commit is contained in:
Brooks Davis 2022-06-13 18:35:38 +01:00
parent d07600c563
commit 24983043bf
2 changed files with 4 additions and 11 deletions

View File

@ -105,16 +105,16 @@ static __inline void
do_cpuid(u_int ax, u_int *p) do_cpuid(u_int ax, u_int *p)
{ {
__asm __volatile("cpuid" __asm __volatile("cpuid"
: "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3]) : "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3])
: "0" (ax)); : "0" (ax));
} }
static __inline void static __inline void
cpuid_count(u_int ax, u_int cx, u_int *p) cpuid_count(u_int ax, u_int cx, u_int *p)
{ {
__asm __volatile("cpuid" __asm __volatile("cpuid"
: "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3]) : "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3])
: "0" (ax), "c" (cx)); : "0" (ax), "c" (cx));
} }
static __inline void static __inline void

View File

@ -98,7 +98,6 @@ clts(void)
static __inline void static __inline void
disable_intr(void) disable_intr(void)
{ {
__asm __volatile("cli" : : : "memory"); __asm __volatile("cli" : : : "memory");
} }
@ -147,14 +146,12 @@ cpuid_count(u_int ax, u_int cx, u_int *p)
static __inline void static __inline void
enable_intr(void) enable_intr(void)
{ {
__asm __volatile("sti"); __asm __volatile("sti");
} }
static __inline void static __inline void
cpu_monitor(const void *addr, u_long extensions, u_int hints) cpu_monitor(const void *addr, u_long extensions, u_int hints)
{ {
__asm __volatile("monitor" __asm __volatile("monitor"
: : "a" (addr), "c" (extensions), "d" (hints)); : : "a" (addr), "c" (extensions), "d" (hints));
} }
@ -162,28 +159,24 @@ cpu_monitor(const void *addr, u_long extensions, u_int hints)
static __inline void static __inline void
cpu_mwait(u_long extensions, u_int hints) cpu_mwait(u_long extensions, u_int hints)
{ {
__asm __volatile("mwait" : : "a" (hints), "c" (extensions)); __asm __volatile("mwait" : : "a" (hints), "c" (extensions));
} }
static __inline void static __inline void
lfence(void) lfence(void)
{ {
__asm __volatile("lfence" : : : "memory"); __asm __volatile("lfence" : : : "memory");
} }
static __inline void static __inline void
mfence(void) mfence(void)
{ {
__asm __volatile("mfence" : : : "memory"); __asm __volatile("mfence" : : : "memory");
} }
static __inline void static __inline void
sfence(void) sfence(void)
{ {
__asm __volatile("sfence" : : : "memory"); __asm __volatile("sfence" : : : "memory");
} }