Initialize MXCSR register
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
Rafal Kupiec 2023-02-05 00:30:12 +01:00
parent 5eaf7d63a3
commit c6cadbd655
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
3 changed files with 29 additions and 0 deletions

View File

@ -44,6 +44,10 @@ XTCDECL
VOID
ArLoadInterruptDescriptorTable(IN PVOID Source);
XTCDECL
VOID
ArLoadMxcsrRegister(IN ULONG Source);
XTCDECL
VOID
ArLoadSegment(IN USHORT Segment,

View File

@ -141,6 +141,25 @@ ArLoadInterruptDescriptorTable(IN PVOID Source)
: "memory");
}
/**
* Loads the value in the source operand into the MXCSR register
*
* @param Source
* Supplies a source value to be loaded into the MXCSR register.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTCDECL
VOID
ArLoadMxcsrRegister(IN ULONG Source)
{
asm volatile("ldmxcsr %0"
:
: "m" (Source));
}
/**
* Loads source data into specified segment.
*

View File

@ -66,6 +66,9 @@ ArInitializeProcessor(VOID)
/* Initialize processor registers */
ArpInitializeProcessorRegisters();
/* Identify processor */
ArpIdentifyProcessor();
}
/**
@ -254,6 +257,9 @@ ArpInitializeProcessorRegisters(VOID)
PatAttributes = (PAT_TYPE_WB << 0) | (PAT_TYPE_USWC << 8) | (PAT_TYPE_WEAK_UC << 16) | (PAT_TYPE_STRONG_UC << 24) |
(PAT_TYPE_WB << 32) | (PAT_TYPE_USWC << 40) | (PAT_TYPE_WEAK_UC << 48) | (PAT_TYPE_STRONG_UC << 56);
ArWriteModelSpecificRegister(X86_MSR_PAT, PatAttributes);
/* Initialize MXCSR register */
ArLoadMxcsrRegister(INITIAL_MXCSR);
}
/**