changeset 18793:dc69d7863332

8914 loader: gcc 4.4.4 fails to allocate register for do_cpuid()
author Toomas Soome <tsoome@me.com>
date Sun, 10 Dec 2017 11:51:37 +0200
parents 2b2d7cd7561b
children 1b9f225f53c2
files usr/src/boot/sys/i386/include/cpufunc.h
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/boot/sys/i386/include/cpufunc.h	Sat Dec 09 19:11:31 2017 +0200
+++ b/usr/src/boot/sys/i386/include/cpufunc.h	Sun Dec 10 11:51:37 2017 +0200
@@ -109,9 +109,12 @@
 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));
+	__asm __volatile("pushl %%ebx      \n\t"
+			 "cpuid            \n\t"
+			 "movl %%ebx, %1   \n\t"
+			 "popl %%ebx       \n\t"
+			 : "=a" (p[0]), "=m" (p[1]), "=c" (p[2]), "=d" (p[3])
+			 : "0" (ax));
 }
 
 static __inline void