From e611b132f9b8abe35b362e5870b74bce94a1e58e Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 16 May 2020 20:51:50 -0700 Subject: initial commit --- private/ntos/nthals/halx86/i386/ixcmos.inc | 66 ++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 private/ntos/nthals/halx86/i386/ixcmos.inc (limited to 'private/ntos/nthals/halx86/i386/ixcmos.inc') diff --git a/private/ntos/nthals/halx86/i386/ixcmos.inc b/private/ntos/nthals/halx86/i386/ixcmos.inc new file mode 100644 index 000000000..1f78de8e7 --- /dev/null +++ b/private/ntos/nthals/halx86/i386/ixcmos.inc @@ -0,0 +1,66 @@ +;/* +;++ +; +; Copyright (c) 1989 Microsoft Corporation +; +; Module Name: +; +; ixcmos.inc +; +; Abstract: +; +; This module contains common definitions used by the CMOS. +; +; Author: +; +; Landy Wang (corollary!landy) 04-Dec-1992 +; +; (Moved from ixclock.asm) +; +;-- + +; +; _HalpAcquireCmosSpinLock and _HalpReleaseCmosSpinLock +; must be called before accessing the CMOS in both uniprocessor +; and multiprocessor systems. + +RTCIRQ EQU 8 ; IRQ number for RTC interrupt +CMOS_CONTROL_PORT EQU 70h ; command port for cmos +CMOS_DATA_PORT EQU 71h ; cmos data port + +; +; CMOS_READ +; +; Description: This macro reads a byte from the CMOS register specified +; in (AL). +; +; Parameter: (AL) = address/register to read +; Returns: (AL) = data +; + +CMOS_READ MACRO + OUT CMOS_CONTROL_PORT,al ; ADDRESS LOCATION AND DISABLE NMI + IODelay ; I/O DELAY + IN AL,CMOS_DATA_PORT ; READ IN REQUESTED CMOS DATA + IODelay ; I/O DELAY +ENDM + +; +; CMOS_WRITE +; +; Description: This macro reads a byte from the CMOS register specified +; in (AL). +; +; Parameter: (AL) = address/register to read +; (AH) = data to be written +; +; Return: None +; + +CMOS_WRITE MACRO + OUT CMOS_CONTROL_PORT,al ; ADDRESS LOCATION AND DISABLE NMI + IODelay ; I/O DELAY + MOV AL,AH ; (AL) = DATA + OUT CMOS_DATA_PORT,AL ; PLACE IN REQUESTED CMOS LOCATION + IODelay ; I/O DELAY +ENDM -- cgit v1.2.3