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:
Chloe M.
2026-06-23 22:05:02 +00:00
parent 114cc434d2
commit 531a027122
+8
View File
@@ -7,6 +7,7 @@
*/
#include <hal/kpcr.h>
#include <hal/intr.h>
#include <ex/trace.h>
#include <machine/cpuid.h>
#include <machine/idt.h>
@@ -122,4 +123,11 @@ HalKpcrP1Init(KPCR *Kpcr)
MdVectorInit();
MdIdtLoad();
/* Default to IRQL_PASSIVE */
ASMV(
"mov %0, %%cr8"
:
: "r" ((UQUAD)IRQL_PASSIVE)
: "memory"
);
}