Lines Matching refs:CmosMemory
28 static CMOS_MEMORY CmosMemory; variable
40 BYTE RateSelect = CmosMemory.StatusRegA & 0x0F; in RtcUpdatePeriodicTimer()
62 CmosMemory.StatusRegC |= CMOS_STC_PF; in RtcPeriodicTick()
65 if (CmosMemory.StatusRegB & CMOS_STB_INT_PERIODIC) in RtcPeriodicTick()
67 CmosMemory.StatusRegC |= CMOS_STC_IRQF; in RtcPeriodicTick()
85 CmosMemory.StatusRegC |= CMOS_STC_UF; in RtcTimeUpdate()
88 if ((CurrentTime.wHour == CmosMemory.AlarmHour ) && in RtcTimeUpdate()
89 (CurrentTime.wMinute == CmosMemory.AlarmMinute) && in RtcTimeUpdate()
90 (CurrentTime.wSecond == CmosMemory.AlarmSecond)) in RtcTimeUpdate()
93 CmosMemory.StatusRegC |= CMOS_STC_AF; in RtcTimeUpdate()
96 if (CmosMemory.StatusRegB & CMOS_STB_INT_ON_ALARM) CmosMemory.StatusRegC |= CMOS_STC_IRQF; in RtcTimeUpdate()
100 if (CmosMemory.StatusRegB & CMOS_STB_INT_ON_UPDATE) CmosMemory.StatusRegC |= CMOS_STC_IRQF; in RtcTimeUpdate()
102 if (CmosMemory.StatusRegC & CMOS_STC_IRQF) in RtcTimeUpdate()
145 Value = READ_CMOS_DATA(CmosMemory, CurrentTime.wSecond); in CmosReadData()
151 Value = READ_CMOS_DATA(CmosMemory, CmosMemory.AlarmSecond); in CmosReadData()
157 Value = READ_CMOS_DATA(CmosMemory, CurrentTime.wMinute); in CmosReadData()
163 Value = READ_CMOS_DATA(CmosMemory, CmosMemory.AlarmMinute); in CmosReadData()
172 if (!(CmosMemory.StatusRegB & CMOS_STB_24HOUR) && (Value >= 12)) in CmosReadData()
178 Value = READ_CMOS_DATA(CmosMemory, Value); in CmosReadData()
189 Value = CmosMemory.AlarmHour; in CmosReadData()
191 if (!(CmosMemory.StatusRegB & CMOS_STB_24HOUR) && (Value >= 12)) in CmosReadData()
197 Value = READ_CMOS_DATA(CmosMemory, Value); in CmosReadData()
212 Value = READ_CMOS_DATA(CmosMemory, CurrentTime.wDayOfWeek + 1); in CmosReadData()
218 Value = READ_CMOS_DATA(CmosMemory, CurrentTime.wDay); in CmosReadData()
224 Value = READ_CMOS_DATA(CmosMemory, CurrentTime.wMonth); in CmosReadData()
230 Value = READ_CMOS_DATA(CmosMemory, CurrentTime.wYear % 100); in CmosReadData()
236 Value = READ_CMOS_DATA(CmosMemory, CurrentTime.wYear / 100 + 19); in CmosReadData()
243 Value = CmosMemory.StatusRegC; in CmosReadData()
244 CmosMemory.StatusRegC = 0x00; in CmosReadData()
256 Value = CmosMemory.Regs[SelectedRegister]; in CmosReadData()
281 CurrentTime.wSecond = WRITE_CMOS_DATA(CmosMemory, Data); in CmosWriteData()
287 CmosMemory.AlarmSecond = WRITE_CMOS_DATA(CmosMemory, Data); in CmosWriteData()
294 CurrentTime.wMinute = WRITE_CMOS_DATA(CmosMemory, Data); in CmosWriteData()
300 CmosMemory.AlarmMinute = WRITE_CMOS_DATA(CmosMemory, Data); in CmosWriteData()
310 if (!(CmosMemory.StatusRegB & CMOS_STB_24HOUR) && (Data & 0x80)) in CmosWriteData()
316 CurrentTime.wHour = WRITE_CMOS_DATA(CmosMemory, Data); in CmosWriteData()
328 if (!(CmosMemory.StatusRegB & CMOS_STB_24HOUR) && (Data & 0x80)) in CmosWriteData()
334 CmosMemory.AlarmHour = WRITE_CMOS_DATA(CmosMemory, Data); in CmosWriteData()
337 if (Afternoon) CmosMemory.AlarmHour += 12; in CmosWriteData()
351 CurrentTime.wDayOfWeek = WRITE_CMOS_DATA(CmosMemory, Data); in CmosWriteData()
358 CurrentTime.wDay = WRITE_CMOS_DATA(CmosMemory, Data); in CmosWriteData()
365 CurrentTime.wMonth = WRITE_CMOS_DATA(CmosMemory, Data); in CmosWriteData()
375 CurrentTime.wYear += WRITE_CMOS_DATA(CmosMemory, Data); in CmosWriteData()
387 CmosMemory.StatusRegA = Data & 0x7F; // Bit 7 is read-only in CmosWriteData()
394 CmosMemory.StatusRegB = Data; in CmosWriteData()
408 CmosMemory.ExtMemoryLow = in CmosWriteData()
409 CmosMemory.ActualExtMemoryLow = Data; in CmosWriteData()
418 CmosMemory.ExtMemoryHigh = in CmosWriteData()
419 CmosMemory.ActualExtMemoryHigh = Data; in CmosWriteData()
425 CmosMemory.Regs[SelectedRegister] = Data; in CmosWriteData()
492 RtlZeroMemory(&CmosMemory, sizeof(CmosMemory)); in CmosInitialize()
500 DWORD CmosSize = sizeof(CmosMemory); in CmosInitialize()
501 Success = ReadFile(hCmosRam, &CmosMemory, CmosSize, &CmosSize, NULL); in CmosInitialize()
506 else if (CmosSize != sizeof(CmosMemory)) in CmosInitialize()
510 CmosSize, sizeof(CmosMemory)); in CmosInitialize()
516 RtlZeroMemory(&CmosMemory, sizeof(CmosMemory)); in CmosInitialize()
517 CmosWriteFile(hCmosRam, &CmosMemory, sizeof(CmosMemory), NULL); in CmosInitialize()
523 CmosWriteFile(hCmosRam, &CmosMemory, sizeof(CmosMemory), NULL); in CmosInitialize()
529 CmosMemory.StatusRegA = CMOS_DEFAULT_STA; in CmosInitialize()
530 CmosMemory.StatusRegB = CMOS_DEFAULT_STB; in CmosInitialize()
531 CmosMemory.StatusRegC = 0x00; in CmosInitialize()
532 CmosMemory.StatusRegD = CMOS_BATTERY_OK; // Our CMOS battery works perfectly forever. in CmosInitialize()
533 CmosMemory.Diagnostics = 0x00; // Diagnostics must not find any errors. in CmosInitialize()
534 CmosMemory.ShutdownStatus = 0x00; in CmosInitialize()
535 CmosMemory.EquipmentList = CMOS_EQUIPMENT_LIST; in CmosInitialize()
538 CmosMemory.Regs[CMOS_REG_SYSOP] |= (1 << 5); in CmosInitialize()
548 CmosMemory.BaseMemoryLow = LOBYTE(0x0280); in CmosInitialize()
549 CmosMemory.BaseMemoryHigh = HIBYTE(0x0280); in CmosInitialize()
551 CmosMemory.ExtMemoryLow = in CmosInitialize()
552 CmosMemory.ActualExtMemoryLow = LOBYTE((MAX_ADDRESS - 0x100000) / 1024); in CmosInitialize()
553 CmosMemory.ExtMemoryHigh = in CmosInitialize()
554 CmosMemory.ActualExtMemoryHigh = HIBYTE((MAX_ADDRESS - 0x100000) / 1024); in CmosInitialize()
577 DWORD CmosSize = sizeof(CmosMemory); in CmosCleanup()
579 Success = CmosWriteFile(hCmosRam, &CmosMemory, CmosSize, &CmosSize); in CmosCleanup()
580 if (!Success || (CmosSize != sizeof(CmosMemory))) in CmosCleanup()
583 GetLastError(), CmosSize, sizeof(CmosMemory)); in CmosCleanup()