MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / SimpleRtcWrite

Function SimpleRtcWrite

rEFIt_UEFI/Platform/Hibernate.cpp:293–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291}
292
293STATIC
294VOID
295SimpleRtcWrite (
296 IN UINT8 Offset,
297 IN UINT8 Value
298 )
299{
300 UINT8 RtcIndexPort;
301 UINT8 RtcDataPort;
302 UINT8 RtcIndexNmi;
303
304 if (Offset < RTC_BANK_SIZE) {
305 RtcIndexPort = R_PCH_RTC_INDEX;
306 RtcDataPort = R_PCH_RTC_TARGET;
307 } else {
308 RtcIndexPort = R_PCH_RTC_EXT_INDEX;
309 RtcDataPort = R_PCH_RTC_EXT_TARGET;
310 }
311
312 RtcIndexNmi = IoRead8 (RtcIndexPort) & RTC_NMI_MASK;
313 IoWrite8 (RtcIndexPort, (Offset & RTC_DATA_MASK) | RtcIndexNmi);
314 IoWrite8 (RtcDataPort, Value);
315}
316
317/** BlockIo->Read() override. */
318EFI_STATUS

Callers 1

PrepareHibernationFunction · 0.85

Calls 2

IoRead8Function · 0.50
IoWrite8Function · 0.50

Tested by

no test coverage detected