]> rtime.felk.cvut.cz Git - l4.git/commitdiff
fiasco: Improved access to APIC through Jailhosue. Read and write instructions are...
authorMaxim Baryshnikov <barysmax@fel.cvut.cz>
Thu, 12 May 2016 20:08:37 +0000 (22:08 +0200)
committerMaxim Baryshnikov <barysmax@fel.cvut.cz>
Thu, 12 May 2016 20:08:37 +0000 (22:08 +0200)
kernel/fiasco/src/kern/ia32/apic-ia32.cpp

index d60f003aeaf68b726040138a47353ba0c0aab3f5..5ddb759172062f1e7b2ce588d7d40a9804ba9fa8 100644 (file)
@@ -288,7 +288,9 @@ Unsigned32
 Apic::reg_read(unsigned reg)
 {
   Unsigned32 val;
-  asm volatile ("mov %1,%0\n" : "=b" (val) : "m" (*(Unsigned32*)(io_base + reg)) : "memory");
+  /* assembly-encoded to match the Jailhouse hypervisor MMIO parser support */
+  void *address = (void*)(/*(Unsigned32*)*/(io_base + reg));
+  asm volatile("mov (%1),%0" : "=r" (val) : "r" (address));
   return val;
 }
 
@@ -296,7 +298,9 @@ PUBLIC static inline
 void
 Apic::reg_write(unsigned reg, Unsigned32 val)
 {
-  asm volatile ("mov %1,%0\n" : "=m" (*(Unsigned32*)(io_base + reg)) : "b" (val) : "memory");
+  /* assembly-encoded to match the Jailhouse hypervisor MMIO parser support */
+  void *address = (void*)(/*(Unsigned32*)*/(io_base + reg));
+  asm volatile("mov %0,(%1)" : : "r" (val), "r" (address));
 }
 
 PUBLIC static inline