Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
1.6 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. xxtime.c
  5. Abstract:
  6. This module implements the HAL set/query realtime clock routines for
  7. an x86 system.
  8. Author:
  9. David N. Cutler (davec) 5-May-1991
  10. Environment:
  11. Kernel mode
  12. Revision History:
  13. --*/
  14. #include "halp.h"
  15. BOOLEAN
  16. HalQueryRealTimeClock (
  17. OUT PTIME_FIELDS TimeFields
  18. )
  19. /*++
  20. Routine Description:
  21. This routine queries the realtime clock.
  22. N.B. This routine assumes that the caller has provided any required
  23. synchronization to query the realtime clock information.
  24. Arguments:
  25. TimeFields - Supplies a pointer to a time structure that receives
  26. the realtime clock information.
  27. Return Value:
  28. If the power to the realtime clock has not failed, then the time
  29. values are read from the realtime clock and a value of TRUE is
  30. returned. Otherwise, a value of FALSE is returned.
  31. --*/
  32. {
  33. HalpReadCmosTime(TimeFields);
  34. return TRUE;
  35. }
  36. BOOLEAN
  37. HalSetRealTimeClock (
  38. IN PTIME_FIELDS TimeFields
  39. )
  40. /*++
  41. Routine Description:
  42. This routine sets the realtime clock.
  43. N.B. This routine assumes that the caller has provided any required
  44. synchronization to set the realtime clock information.
  45. Arguments:
  46. TimeFields - Supplies a pointer to a time structure that specifies the
  47. realtime clock information.
  48. Return Value:
  49. If the power to the realtime clock has not failed, then the time
  50. values are written to the realtime clock and a value of TRUE is
  51. returned. Otherwise, a value of FALSE is returned.
  52. --*/
  53. {
  54. HalpWriteCmosTime(TimeFields);
  55. return TRUE;
  56. }
  57.