[HALX86] Set the NMI disable flag when accessing CMOS registers

An NMI while accessing the CMOS can leave it in an undefined state. NMIs are used on x64 SMP for CPU freeze in the debugger.
This commit is contained in:
Timo Kreuzer 2025-03-19 20:33:08 +02:00
parent 94fc56c038
commit 2c057d9bc1

View file

@ -24,8 +24,8 @@ UCHAR
NTAPI
HalpReadCmos(IN UCHAR Reg)
{
/* Select the register */
WRITE_PORT_UCHAR(CMOS_CONTROL_PORT, Reg);
/* Select the register (0x80 to disable NMIs) */
WRITE_PORT_UCHAR(CMOS_CONTROL_PORT, 0x80 | Reg);
/* Query the value */
return READ_PORT_UCHAR(CMOS_DATA_PORT);
@ -37,8 +37,8 @@ NTAPI
HalpWriteCmos(IN UCHAR Reg,
IN UCHAR Value)
{
/* Select the register */
WRITE_PORT_UCHAR(CMOS_CONTROL_PORT, Reg);
/* Select the register (0x80 to disable NMIs) */
WRITE_PORT_UCHAR(CMOS_CONTROL_PORT, 0x80 | Reg);
/* Write the value */
WRITE_PORT_UCHAR(CMOS_DATA_PORT, Value);