diff options
author | kato <kato@FreeBSD.org> | 1998-01-25 17:02:00 +0000 |
---|---|---|
committer | kato <kato@FreeBSD.org> | 1998-01-25 17:02:00 +0000 |
commit | a75b33e07590c9dd9ab9aaf5c0b2b3aa37bc118f (patch) | |
tree | c61836d1e80e9a7e42fbe55817ad66c04d96b90e | |
parent | 208e2605867682bd7711f6761442fb96a780702e (diff) | |
download | FreeBSD-src-a75b33e07590c9dd9ab9aaf5c0b2b3aa37bc118f.zip FreeBSD-src-a75b33e07590c9dd9ab9aaf5c0b2b3aa37bc118f.tar.gz |
Added cpuid instruction.
-rw-r--r-- | sys/amd64/include/cpufunc.h | 11 | ||||
-rw-r--r-- | sys/i386/include/cpufunc.h | 11 |
2 files changed, 20 insertions, 2 deletions
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index 8806ef3..0aa8e74 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cpufunc.h,v 1.73 1997/12/14 02:11:23 dyson Exp $ + * $Id: cpufunc.h,v 1.74 1998/01/15 07:32:55 gibbs Exp $ */ /* @@ -58,6 +58,14 @@ breakpoint(void) } static __inline void +cpuid(u_int *eax, u_int *ebx, u_int *ecx, u_int *edx) +{ + __asm __volatile(".byte 0x0f, 0xa2" + : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx) + : "a" (*eax)); +} + +static __inline void disable_intr(void) { __asm __volatile("cli" : : : "memory"); @@ -395,6 +403,7 @@ wrmsr(u_int msr, quad_t newval) #else /* !__GNUC__ */ int breakpoint __P((void)); +void cpuid __P((u_int *eax, u_int *ebx, u_int *ecx, u_int *edx)); void disable_intr __P((void)); void enable_intr __P((void)); u_char inb __P((u_int port)); diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h index 8806ef3..0aa8e74 100644 --- a/sys/i386/include/cpufunc.h +++ b/sys/i386/include/cpufunc.h @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cpufunc.h,v 1.73 1997/12/14 02:11:23 dyson Exp $ + * $Id: cpufunc.h,v 1.74 1998/01/15 07:32:55 gibbs Exp $ */ /* @@ -58,6 +58,14 @@ breakpoint(void) } static __inline void +cpuid(u_int *eax, u_int *ebx, u_int *ecx, u_int *edx) +{ + __asm __volatile(".byte 0x0f, 0xa2" + : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx) + : "a" (*eax)); +} + +static __inline void disable_intr(void) { __asm __volatile("cli" : : : "memory"); @@ -395,6 +403,7 @@ wrmsr(u_int msr, quad_t newval) #else /* !__GNUC__ */ int breakpoint __P((void)); +void cpuid __P((u_int *eax, u_int *ebx, u_int *ecx, u_int *edx)); void disable_intr __P((void)); void enable_intr __P((void)); u_char inb __P((u_int port)); |