]> rtime.felk.cvut.cz Git - l4.git/commitdiff
fiasco: Access APIC with instructions understood by jailhouse
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 12 May 2016 10:42:28 +0000 (12:42 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 12 May 2016 10:43:06 +0000 (12:43 +0200)
kernel/fiasco/src/kern/ia32/apic-ia32.cpp

index a015c376bc5ea9becf556ddd897697a053ee646a..d60f003aeaf68b726040138a47353ba0c0aab3f5 100644 (file)
@@ -287,14 +287,16 @@ PUBLIC static inline
 Unsigned32
 Apic::reg_read(unsigned reg)
 {
-  return *((volatile Unsigned32*)(io_base + reg));
+  Unsigned32 val;
+  asm volatile ("mov %1,%0\n" : "=b" (val) : "m" (*(Unsigned32*)(io_base + reg)) : "memory");
+  return val;
 }
 
 PUBLIC static inline
 void
 Apic::reg_write(unsigned reg, Unsigned32 val)
 {
-  *((volatile Unsigned32*)(io_base + reg)) = val;
+  asm volatile ("mov %1,%0\n" : "=m" (*(Unsigned32*)(io_base + reg)) : "b" (val) : "memory");
 }
 
 PUBLIC static inline