BOOLEAN Ke386GlobalPagesEnabled = FALSE;
ULONG KiFastSystemCallDisable = 1;
ULONG KeI386NpxPresent = 0;
+ULONG MxcsrFeatureMask = 0;
ULONG KeI386XMMIPresent = 0;
ULONG KeI386FxsrPresent = 0;
extern PVOID Ki386InitialStackArray[MAXIMUM_PROCESSORS];
#pragma alloc_text(INIT, Ki386SetProcessorFeatures)
#endif
+BOOLEAN
+NTAPI
+KiIsNpxPresent(
+ VOID
+);
+
/* FUNCTIONS *****************************************************************/
+VOID
+INIT_FUNCTION
+NTAPI
+KiCheckFPU(VOID)
+{
+ PKPRCB Prcb = KeGetCurrentPrcb();
+
+ /* Check for a math co-processor (NPX) */
+ KeI386NpxPresent = KiIsNpxPresent();
+
+ /* Check for and enable MMX/SSE support if possible */
+ KeI386FxsrPresent = Prcb->FeatureBits & X86_FEATURE_FXSR ? TRUE : FALSE;
+
+ /* Check for SSE (2 and 3 should have this set too) */
+ KeI386XMMIPresent = Prcb->FeatureBits & X86_FEATURE_SSE ? TRUE : FALSE;
+
+ /* Check if Fxsr was found */
+ if (KeI386FxsrPresent)
+ {
+ /* Enable it. FIXME: Send an IPI */
+ Ke386SetCr4(Ke386GetCr4() | X86_CR4_OSFXSR);
+
+ /* Check if XMM was found too */
+ if (KeI386XMMIPresent)
+ {
+ /* Enable it: FIXME: Send an IPI. */
+ Ke386SetCr4(Ke386GetCr4() | X86_CR4_OSXMMEXCPT);
+
+ /* FIXME: Implement and enable XMM Page Zeroing for Mm */
+ }
+ }
+}
+
static VOID INIT_FUNCTION
Ki386GetCpuId(VOID)
{