From 1a9e2f75a7848f318007acaac78c5571e3e83033 Mon Sep 17 00:00:00 2001 From: jhb Date: Tue, 21 May 2002 20:21:53 +0000 Subject: [PATCH] Add an inline function cpu_pause() for the IA32 'pause' instruction. --- sys/amd64/include/cpufunc.h | 6 ++++++ sys/i386/include/cpufunc.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index a77fda1fb5a3..e0b7c996071d 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -560,6 +560,12 @@ load_dr7(u_int sel) __asm __volatile("movl %0,%%dr7" : : "r" (sel)); } +static __inline void +cpu_pause(void) +{ + __asm __volatile("pause"); +} + static __inline register_t intr_disable(void) { diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h index a77fda1fb5a3..e0b7c996071d 100644 --- a/sys/i386/include/cpufunc.h +++ b/sys/i386/include/cpufunc.h @@ -560,6 +560,12 @@ load_dr7(u_int sel) __asm __volatile("movl %0,%%dr7" : : "r" (sel)); } +static __inline void +cpu_pause(void) +{ + __asm __volatile("pause"); +} + static __inline register_t intr_disable(void) {