asm volatile ("mov %0, %%ss" :: "rm" (ss));
}
+static inline unsigned int read_flags(void)
+{
+ unsigned int flags;
+
+ asm volatile ("pushf; pop %0" : "=rm" (flags));
+
+ return flags;
+}
+
+static inline void write_flags(unsigned int flags)
+{
+ asm volatile ("push %0; popf" :: "irm" (flags));
+}
+
static inline unsigned long read_cr0(void)
{
unsigned long cr0;
xsetbv(0, xcr0);
}
+static inline void clflush(const void *ptr)
+{
+ asm volatile ("clflush %0" :: "m" (*(const char *)ptr));
+}
+
#endif /* XTF_X86_LIB_H */
/*
pack_gate(g, 14, sel, offset, dpl, other);
}
+static inline void pack_trap_gate(
+ env_gate *g, unsigned int sel, unsigned long offset,
+ unsigned int dpl, unsigned int other)
+{
+ pack_gate(g, 15, sel, offset, dpl, other);
+}
+
#endif /* XTF_X86_GATE_H */
/*