summaryrefslogtreecommitdiffstats
path: root/private/ntos/nthals/halx86/i386/ixcmos.inc
diff options
context:
space:
mode:
authorAdam <you@example.com>2020-05-17 05:51:50 +0200
committerAdam <you@example.com>2020-05-17 05:51:50 +0200
commite611b132f9b8abe35b362e5870b74bce94a1e58e (patch)
treea5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/ntos/nthals/halx86/i386/ixcmos.inc
downloadNT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip
Diffstat (limited to 'private/ntos/nthals/halx86/i386/ixcmos.inc')
-rw-r--r--private/ntos/nthals/halx86/i386/ixcmos.inc66
1 files changed, 66 insertions, 0 deletions
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