stos/amd64: cpu: Default to IRQL_PASSIVE on startup
We cannot be certain that the CR8 register will be zeroed by the time we have control passed to us, therefore it is wise to set it ourselves. Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <hal/kpcr.h>
|
#include <hal/kpcr.h>
|
||||||
|
#include <hal/intr.h>
|
||||||
#include <ex/trace.h>
|
#include <ex/trace.h>
|
||||||
#include <machine/cpuid.h>
|
#include <machine/cpuid.h>
|
||||||
#include <machine/idt.h>
|
#include <machine/idt.h>
|
||||||
@@ -122,4 +123,11 @@ HalKpcrP1Init(KPCR *Kpcr)
|
|||||||
MdVectorInit();
|
MdVectorInit();
|
||||||
MdIdtLoad();
|
MdIdtLoad();
|
||||||
|
|
||||||
|
/* Default to IRQL_PASSIVE */
|
||||||
|
ASMV(
|
||||||
|
"mov %0, %%cr8"
|
||||||
|
:
|
||||||
|
: "r" ((UQUAD)IRQL_PASSIVE)
|
||||||
|
: "memory"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user