diff TOOLS/cpuinfo.c @ 13612:c0bde085511c

Zeta OS support, mostly working.
author reimar
date Mon, 11 Oct 2004 19:26:13 +0000
parents a85bfb689e62
children 0bfb87188015
line wrap: on
line diff
--- a/TOOLS/cpuinfo.c	Mon Oct 11 16:23:20 2004 +0000
+++ b/TOOLS/cpuinfo.c	Mon Oct 11 19:26:13 2004 +0000
@@ -17,6 +17,10 @@
 #define sleep(t) _sleep(1000*t);
 #endif
 
+#ifdef __BEOS__
+#define usleep(t) snooze(t)
+#endif
+
 #ifdef M_UNIX
 typedef long long int64_t;
 #define	MISSING_USLEEP
@@ -36,11 +40,13 @@
 cpuid(int func) {
 	cpuid_regs_t regs;
 #define	CPUID	".byte 0x0f, 0xa2; "
-	asm("movl %4,%%eax; " CPUID
-	    "movl %%eax,%0; movl %%ebx,%1; movl %%ecx,%2; movl %%edx,%3"
+	asm("push %%ebx; "
+	    "movl %4,%%eax; " CPUID
+	    "movl %%eax,%0; movl %%ebx,%1; movl %%ecx,%2; movl %%edx,%3; "
+	    "pop %%ebx"
 		: "=m" (regs.eax), "=m" (regs.ebx), "=m" (regs.ecx), "=m" (regs.edx)
 		: "g" (func)
-		: "%eax", "%ebx", "%ecx", "%edx");
+		: "%eax", "%ecx", "%edx");
 	return regs;
 }