windows-nt/Source/XPSP1/NT/base/hals/halx86/i386/xxtime.c
2020-09-26 16:20:57 +08:00

92 lines
1.6 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*++
Copyright (c) 1991 Microsoft Corporation
Module Name:
xxtime.c
Abstract:
This module implements the HAL set/query realtime clock routines for
an x86 system.
Author:
David N. Cutler (davec) 5-May-1991
Environment:
Kernel mode
Revision History:
--*/
#include "halp.h"
BOOLEAN
HalQueryRealTimeClock (
OUT PTIME_FIELDS TimeFields
)
/*++
Routine Description:
This routine queries the realtime clock.
N.B. This routine assumes that the caller has provided any required
synchronization to query the realtime clock information.
Arguments:
TimeFields - Supplies a pointer to a time structure that receives
the realtime clock information.
Return Value:
If the power to the realtime clock has not failed, then the time
values are read from the realtime clock and a value of TRUE is
returned. Otherwise, a value of FALSE is returned.
--*/
{
HalpReadCmosTime(TimeFields);
return TRUE;
}
BOOLEAN
HalSetRealTimeClock (
IN PTIME_FIELDS TimeFields
)
/*++
Routine Description:
This routine sets the realtime clock.
N.B. This routine assumes that the caller has provided any required
synchronization to set the realtime clock information.
Arguments:
TimeFields - Supplies a pointer to a time structure that specifies the
realtime clock information.
Return Value:
If the power to the realtime clock has not failed, then the time
values are written to the realtime clock and a value of TRUE is
returned. Otherwise, a value of FALSE is returned.
--*/
{
HalpWriteCmosTime(TimeFields);
return TRUE;
}