void halt(void);
#pragma aux halt = "hlt";
-
-unsigned int get_cs(void);
-#pragma aux get_cs = \
- "xor eax, eax" \
- "mov ax, cs" \
- value[eax];
#endif
#ifdef __GNUC__
#define halt() \
asm volatile("hlt")
-
-static unsigned int INLINE get_cs(void)
-{
- unsigned int res;
- asm volatile (
- "xor %%eax, %%eax\n\t"
- "mov %%cs, %0\n\t"
- : "=a"(res)
- );
- return res;
-}
#endif
#ifdef _MSC_VER
}
#endif
+unsigned int get_cs(void);
#define get_cpl() ((int)(get_cs() & 7))
+void get_msr(uint32_t msr, uint32_t *low, uint32_t *high);
+void set_msr(uint32_t msr, uint32_t low, uint32_t high);
+
#endif /* UTIL_H_ */