Author: tkreuzer
Date: Wed Feb 3 19:53:41 2010
New Revision: 45399
URL:
http://svn.reactos.org/svn/reactos?rev=45399&view=rev
Log:
[NTOS]
- Get rid of all Ke386* inline functions for amd64
- add some stubs for msvc
Modified:
branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/intrin_i.h
branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/intrin_i.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/intrin_i.h
[iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/intrin_i.h
[iso-8859-1] Wed Feb 3 19:53:41 2010
@@ -1,13 +1,12 @@
#ifndef _INTRIN_INTERNAL_
#define _INTRIN_INTERNAL_
-#ifdef CONFIG_SMP
-#define LOCK "lock ; "
-#else
-#define LOCK ""
-#endif
-
-#define KeSetCurrentIrql(x) __writecr8(x)
+VOID
+FORCEINLINE
+KeSetCurrentIrql(KIRQL Irql)
+{
+ __writecr8(Irql);
+}
PKGDTENTRY64
FORCEINLINE
@@ -103,344 +102,41 @@
}
-#define _Ke386GetSeg(N) ({ \
- unsigned int __d; \
- __asm__("movl %%" #N ",%0\n\t"
:"=r" (__d)); \
- __d; \
- })
+#elif defined(_MSC_VER)
-#define _Ke386SetSeg(N,X) __asm__ __volatile__("movl %0,%%" #N :
:"r" (X));
+#define UNIMPLEMENTED DbgPrint("%s is unimplemented!!!\n", __FUNCTION__);
-#define _Ke386GetDr(N) ({ \
- unsigned int __d; \
- __asm__("movq %%dr" #N ",%0\n\t"
:"=r" (__d)); \
- __d; \
- })
+void FORCEINLINE __lgdt(void *Source)
+{
+ UNIMPLEMENTED;
+}
-#define _Ke386SetDr(N,X) __asm__ __volatile__("movl %0,%%dr" #N :
:"r" (X));
+void FORCEINLINE __sgdt(void *Destination)
+{
+ UNIMPLEMENTED;
+}
+
+void FORCEINLINE __lldt(unsigned short Value)
+{
+ UNIMPLEMENTED;
+}
+
+void FORCEINLINE __sldt(void *Destination)
+{
+ UNIMPLEMENTED;
+}
+
+void FORCEINLINE __ltr(unsigned short Source)
+{
+ UNIMPLEMENTED;
+}
+
+void FORCEINLINE __str(unsigned short *Destination)
+{
+ UNIMPLEMENTED;
+}
-static inline void Ki386Cpuid(ULONG Op, PULONG Eax, PULONG Ebx, PULONG Ecx, PULONG Edx)
-{
- __asm__("cpuid"
- : "=a" (*Eax), "=b" (*Ebx), "=c" (*Ecx),
"=d" (*Edx)
- : "0" (Op));
-}
-
-#define Ke386Rdmsr(msr,val1,val2) __asm__ __volatile__("rdmsr" : "=a"
(val1), "=d" (val2) : "c" (msr))
-#define Ke386Wrmsr(msr,val1,val2) __asm__ __volatile__("wrmsr" : /* no outputs
*/ : "c" (msr), "a" (val1), "d" (val2))
-
-#define Ke386HaltProcessor() __asm__("hlt\n\t");
-
-#define Ke386FnInit() __asm__("fninit\n\t");
-
-
-//
-// CR Macros
-//
-#define Ke386SetCr2(X) __asm__ __volatile__("movq %0,%%cr2" :
:"r" ((void*)X));
-
-//
-// DR Macros
-//
-#define Ke386GetDr0() _Ke386GetDr(0)
-#define Ke386GetDr1() _Ke386GetDr(1)
-#define Ke386SetDr0(X) _Ke386SetDr(0,X)
-#define Ke386SetDr1(X) _Ke386SetDr(1,X)
-#define Ke386GetDr2() _Ke386GetDr(2)
-#define Ke386SetDr2(X) _Ke386SetDr(2,X)
-#define Ke386GetDr3() _Ke386GetDr(3)
-#define Ke386SetDr3(X) _Ke386SetDr(3,X)
-#define Ke386GetDr4() _Ke386GetDr(4)
-#define Ke386SetDr4(X) _Ke386SetDr(4,X)
-#define Ke386GetDr6() _Ke386GetDr(6)
-#define Ke386SetDr6(X) _Ke386SetDr(6,X)
-#define Ke386GetDr7() _Ke386GetDr(7)
-#define Ke386SetDr7(X) _Ke386SetDr(7,X)
-
-//
-// Segment Macros
-//
-#define Ke386GetSs() _Ke386GetSeg(ss)
-#define Ke386GetFs() _Ke386GetSeg(fs)
-#define Ke386SetFs(X) _Ke386SetSeg(fs, X)
-#define Ke386SetGs(X) _Ke386SetSeg(gs, X)
-#define Ke386SetDs(X) _Ke386SetSeg(ds, X)
-#define Ke386SetEs(X) _Ke386SetSeg(es, X)
-#define Ke386SetSs(X) _Ke386SetSeg(ss, X)
-
-#elif defined(_MSC_VER)
-
-VOID
-FORCEINLINE
-Ke386Wrmsr(IN ULONG Register,
- IN ULONG Var1,
- IN ULONG Var2)
-{
- __writemsr(Register, (ULONG64)Var1 <<32 | Var2);
-}
-
-ULONGLONG
-FORCEINLINE
-Ke386Rdmsr(IN ULONG Register,
- IN ULONG Var1,
- IN ULONG Var2)
-{
- return __readmsr(Register);
-}
-
-#define UNIMPLEMENTED DbgPrint("unimplemented!!!\n");
-
-VOID
-FORCEINLINE
-Ki386Cpuid(IN ULONG Operation,
- OUT PULONG Var1,
- OUT PULONG Var2,
- OUT PULONG Var3,
- OUT PULONG Var4)
-{
- UNIMPLEMENTED;
-}
-
-VOID
-FORCEINLINE
-Ke386FnInit(VOID)
-{
- UNIMPLEMENTED;
-}
-
-VOID
-FORCEINLINE
-Ke386HaltProcessor(VOID)
-{
- UNIMPLEMENTED;
-}
-
-VOID
-FORCEINLINE
-Ke386GetInterruptDescriptorTable(OUT KDESCRIPTOR Descriptor)
-{
- UNIMPLEMENTED;
-}
-
-VOID
-FORCEINLINE
-Ke386SetInterruptDescriptorTable(IN KDESCRIPTOR Descriptor)
-{
- UNIMPLEMENTED;
-}
-
-VOID
-FORCEINLINE
-Ke386GetGlobalDescriptorTable(OUT KDESCRIPTOR Descriptor)
-{
- UNIMPLEMENTED;
-}
-
-VOID
-FORCEINLINE
-Ke386SetGlobalDescriptorTable(IN KDESCRIPTOR Descriptor)
-{
- UNIMPLEMENTED;
-}
-
-VOID
-FORCEINLINE
-Ke386GetLocalDescriptorTable(OUT USHORT Descriptor)
-{
- UNIMPLEMENTED;
-}
-
-VOID
-FORCEINLINE
-Ke386SetLocalDescriptorTable(IN USHORT Descriptor)
-{
- UNIMPLEMENTED;
-}
-
-VOID
-FORCEINLINE
-Ke386SaveFlags(IN ULONG Flags)
-{
- UNIMPLEMENTED;
-}
-
-VOID
-FORCEINLINE
-Ke386RestoreFlags(IN ULONG Flags)
-{
- UNIMPLEMENTED;
-}
-
-VOID
-FORCEINLINE
-Ke386SetTr(IN USHORT Tr)
-{
- UNIMPLEMENTED;
-}
-
-USHORT
-FORCEINLINE
-Ke386GetTr(IN USHORT Tr)
-{
- UNIMPLEMENTED;
-}
-
-//
-// CR Macros
-//
-VOID
-FORCEINLINE
-Ke386SetCr2(IN ULONG Value)
-{
- UNIMPLEMENTED;
-}
-
-//
-// DR Macros
-//
-ULONG
-FORCEINLINE
-Ke386GetDr0(VOID)
-{
- UNIMPLEMENTED;
-}
-
-ULONG
-FORCEINLINE
-Ke386GetDr1(VOID)
-{
- UNIMPLEMENTED;
-}
-
-ULONG
-FORCEINLINE
-Ke386GetDr2(VOID)
-{
- UNIMPLEMENTED;
-}
-
-ULONG
-FORCEINLINE
-Ke386GetDr3(VOID)
-{
- UNIMPLEMENTED;
-}
-
-ULONG
-FORCEINLINE
-Ke386GetDr6(VOID)
-{
- UNIMPLEMENTED;
-}
-
-ULONG
-FORCEINLINE
-Ke386GetDr7(VOID)
-{
- UNIMPLEMENTED;
-}
-
-VOID
-FORCEINLINE
-Ke386SetDr0(IN ULONG Value)
-{
- UNIMPLEMENTED;
-}
-
-VOID
-FORCEINLINE
-Ke386SetDr1(IN ULONG Value)
-{
- UNIMPLEMENTED;
-}
-
-VOID
-FORCEINLINE
-Ke386SetDr2(IN ULONG Value)
-{
- UNIMPLEMENTED;
-}
-
-VOID
-FORCEINLINE
-Ke386SetDr3(IN ULONG Value)
-{
- UNIMPLEMENTED;
-}
-
-VOID
-FORCEINLINE
-Ke386SetDr6(IN ULONG Value)
-{
- UNIMPLEMENTED;
-}
-
-VOID
-FORCEINLINE
-Ke386SetDr7(IN ULONG Value)
-{
- UNIMPLEMENTED;
-}
-
-//
-// Segment Macros
-//
-USHORT
-FORCEINLINE
-Ke386GetSs(VOID)
-{
- UNIMPLEMENTED;
-}
-
-USHORT
-FORCEINLINE
-Ke386GetFs(VOID)
-{
- UNIMPLEMENTED;
-}
-
-USHORT
-FORCEINLINE
-Ke386GetDs(VOID)
-{
- UNIMPLEMENTED;
-}
-
-USHORT
-FORCEINLINE
-Ke386GetEs(VOID)
-{
- UNIMPLEMENTED;
-}
-
-VOID
-FORCEINLINE
-Ke386SetSs(IN USHORT Value)
-{
- UNIMPLEMENTED;
-}
-
-VOID
-FORCEINLINE
-Ke386SetFs(IN USHORT Value)
-{
- UNIMPLEMENTED;
-}
-
-VOID
-FORCEINLINE
-Ke386SetDs(IN USHORT Value)
-{
- UNIMPLEMENTED;
-}
-
-VOID
-FORCEINLINE
-Ke386SetEs(IN USHORT Value)
-{
- UNIMPLEMENTED;
-}
#else
#error Unknown compiler for inline assembler
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c [iso-8859-1] Wed Feb 3
19:53:41 2010
@@ -389,11 +389,6 @@
__writemsr(X86_MSR_GSBASE, (ULONG64)Pcr);
__writemsr(X86_MSR_KERNEL_GSBASE, (ULONG64)Pcr);
- /* Load Ring 3 selectors for DS/ES/FS */
- Ke386SetDs(KGDT64_R3_DATA | RPL_MASK);
- Ke386SetEs(KGDT64_R3_DATA | RPL_MASK);
- Ke386SetFs(KGDT64_R3_CMTEB | RPL_MASK);
-
/* LDT is unused */
__lldt(0);