Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


added back in 32 bit support
[palacios.git] / palacios / include / palacios / vmm_lowlevel.h
index 331a307..af1f820 100644 (file)
@@ -69,11 +69,24 @@ struct sys_segment64 {
 static void __inline__ v3_cpuid(uint32_t target, 
                                uint32_t * eax, uint32_t * ebx, 
                                uint32_t * ecx, uint32_t * edx) {
+#ifdef __V3_64BIT__
     __asm__ __volatile__ (
                          "cpuid\n\t"
                          : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
                          : "0" (target), "2" (*ecx)
                          );
+#elif __V3_32BIT__
+    // 32 bit code compiled with -fPIC, cannot use ebx as an ouput reg. Fantastic.
+    __asm__ __volatile__ (
+                         "pushl %%ebx\n\t"
+                         "movl %%edi, %%ebx\n\t"
+                         "cpuid\n\t"
+                         "movl %%ebx, %%edi\n\t"
+                         "popl %%ebx\n\t"
+                         : "=a" (*eax), "=D" (*ebx), "=c" (*ecx), "=d" (*edx)
+                         : "0" (target), "2" (*ecx)
+                         );
+#endif
     return;
 }