summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/cpufunc.h
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2002-02-12 21:06:48 +0000
committerdwmalone <dwmalone@FreeBSD.org>2002-02-12 21:06:48 +0000
commitd48667d57b70b83c9ee1efd42bc506acf8f227d7 (patch)
tree5a9c2d0d7c1da9d26f510e39afe2f9b9ab71b0c0 /sys/amd64/include/cpufunc.h
parent34c0145ee3ec3a499012c5105a99caf53eced3ee (diff)
downloadFreeBSD-src-d48667d57b70b83c9ee1efd42bc506acf8f227d7.zip
FreeBSD-src-d48667d57b70b83c9ee1efd42bc506acf8f227d7.tar.gz
Move do_cpuid() from a identcpu.c into cpufunc.h.
Diffstat (limited to 'sys/amd64/include/cpufunc.h')
-rw-r--r--sys/amd64/include/cpufunc.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h
index c80c9f2..969541f 100644
--- a/sys/amd64/include/cpufunc.h
+++ b/sys/amd64/include/cpufunc.h
@@ -365,6 +365,16 @@ read_eflags(void)
return (ef);
}
+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)
+ );
+}
+
static __inline u_int64_t
rdmsr(u_int msr)
{
@@ -572,6 +582,7 @@ int breakpoint __P((void));
u_int bsfl __P((u_int mask));
u_int bsrl __P((u_int mask));
void disable_intr __P((void));
+void do_cpuid __P((u_int ax, u_int *p));
void enable_intr __P((void));
u_char inb __P((u_int port));
u_int inl __P((u_int port));
OpenPOWER on IntegriCloud