aboutsummaryrefslogtreecommitdiffstats
path: root/src/x86.h
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2015-09-29 10:14:58 -0400
committerKevin O'Connor <kevin@koconnor.net>2015-10-15 10:52:13 -0400
commiteee06e060ebd536a1ac9610fdcb41406142b88f0 (patch)
tree3bb88c25927ae61651a4a24b969afa246d8d2e88 /src/x86.h
parent1dcf02b06797309676a2915454d1388b8ef0434d (diff)
downloadseabios-eee06e060ebd536a1ac9610fdcb41406142b88f0.tar.gz
virtio: Move standard definitions from virtio-ring.h to standard headers
Move PAGE_SHIFT / virt_to_phys() to memmap.h and smp_[rw]mb() to x86.h. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/x86.h')
-rw-r--r--src/x86.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/x86.h b/src/x86.h
index 19d404fc..53378e9e 100644
--- a/src/x86.h
+++ b/src/x86.h
@@ -190,6 +190,14 @@ static inline void outsl(u16 port, u32 *data, u32 count) {
: "+c"(count), "+S"(data) : "d"(port) : "memory");
}
+/* Compiler barrier is enough as an x86 CPU does not reorder reads or writes */
+static inline void smp_rmb(void) {
+ barrier();
+}
+static inline void smp_wmb(void) {
+ barrier();
+}
+
static inline void writel(void *addr, u32 val) {
barrier();
*(volatile u32 *)addr = val;