- Thomas Weidenmueller: Fix build by fixing __readcr3 / __readcr4 implementations.

svn path=/trunk/; revision=21891
This commit is contained in:
Aleksey Bragin
2006-05-11 21:01:29 +00:00
parent c02800c901
commit 2e6dfbc67d
+22 -4
View File
@@ -10460,11 +10460,29 @@ extern BOOLEAN KdDebuggerEnabled;
#endif
#ifdef __GNUC__
/* Available as intrinsics on MSVC */
static __inline void _disable(void) {__asm__("cli\n\t");}
static __inline void _enable(void) {__asm__("sti\n\t");}
static __inline __int64 __readcr3(void) {__asm__("mov %cr3, %eax\n\t");}
static __inline __int64 __readcr4(void) {__asm__("mov %cr4, %eax\n\t");}
static __inline void _disable(void) {__asm__ __volatile__("cli\n");}
static __inline void _enable(void) {__asm__ __volatile__("sti\n");}
static __inline ULONG64 __readcr3(void)
{
ULONG_PTR Ret;
__asm__ __volatile__("movl %%cr3, %0;\n"
:"=r"(Ret));
return (ULONG64)Ret;
}
static __inline ULONG64 __readcr4(void)
{
ULONG_PTR Ret;
__asm__ __volatile__("movl %%cr4, %0; \n"
:"=r"(Ret));
return (ULONG64)Ret;
}
#endif
#ifdef __cplusplus
}