X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Futil.h;fp=src%2Futil.h;h=35d1a971381ba158b00f3d834437ffadafba8cc8;hp=5f3489fe5aaa0ce31ac8b43d0646fdd121766853;hb=574b83282bd01d6b9a70843238bbcbab1590fe76;hpb=fb3df30d97e3824335a6c17fd8d49b9706b6b3c7 diff --git a/src/util.h b/src/util.h index 5f3489f..35d1a97 100644 --- a/src/util.h +++ b/src/util.h @@ -106,12 +106,6 @@ void debug_break(void); 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__ @@ -178,17 +172,6 @@ static void INLINE memset16(void *dest, uint16_t val, int count) #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 @@ -251,6 +234,10 @@ static unsigned int __inline get_cs(void) } #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_ */