Author: tkreuzer
Date: Thu Aug 21 08:30:00 2008
New Revision: 35504
URL:
http://svn.reactos.org/svn/reactos?rev=35504&view=rev
Log:
Implement __readcr8, __writecr8, __lidt and __sidt intrinsics.
Modified:
branches/ros-amd64-bringup/reactos/include/psdk/intrin_x86.h
Modified: branches/ros-amd64-bringup/reactos/include/psdk/intrin_x86.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
==============================================================================
--- branches/ros-amd64-bringup/reactos/include/psdk/intrin_x86.h [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/include/psdk/intrin_x86.h [iso-8859-1] Thu Aug 21
08:30:00 2008
@@ -1105,6 +1105,11 @@
__asm__("movq %q[Data], %%cr4" : : [Data] "q" (Data) :
"memory");
}
+static __inline__ __attribute__((always_inline)) void __writecr8(const unsigned long long
Data)
+{
+ __asm__("movq %q[Data], %%cr8" : : [Data] "q" (Data) :
"memory");
+}
+
static __inline__ __attribute__((always_inline)) unsigned long long __readcr0(void)
{
unsigned long long value;
@@ -1133,6 +1138,13 @@
return value;
}
+static __inline__ __attribute__((always_inline)) unsigned long long __readcr8(void)
+{
+ unsigned long long value;
+ __asm__ __volatile__("movq %%cr8, %q[value]" : [value] "=q"
(value));
+ return value;
+}
+
#else
static __inline__ __attribute__((always_inline)) void __writecr0(const unsigned long long
Data)
{
@@ -1218,6 +1230,16 @@
__asm__ __volatile__("wbinvd");
}
+static __inline__ __attribute__((always_inline)) void __lidt(void *Source)
+{
+ __asm__ __volatile__("lidt %0" : : "m"(*(short*)Source));
+}
+
+static __inline__ __attribute__((always_inline)) void __sidt(void *Destination)
+{
+ __asm__ __volatile__("sidt %0" : : "m"(*(short*)Destination));
+}
+
#endif /* KJK_INTRIN_X86_H_ */
/* EOF */