aboutsummaryrefslogtreecommitdiffstats
path: root/src/x86.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/x86.h')
-rw-r--r--src/x86.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/x86.h b/src/x86.h
index c7bb60df..43a9e6d8 100644
--- a/src/x86.h
+++ b/src/x86.h
@@ -140,6 +140,13 @@ static inline u32 rol(u32 val, u16 rol) {
return res;
}
+static inline u32 ror(u32 val, u16 ror) {
+ u32 res;
+ asm volatile("rorl %%cl, %%eax"
+ : "=a" (res) : "a" (val), "c" (ror));
+ return res;
+}
+
static inline void outb(u8 value, u16 port) {
__asm__ __volatile__("outb %b0, %w1" : : "a"(value), "Nd"(port));
}