blob: 1f78de8e772bcd49b2611e18150ddaa99683f879 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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
|