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

Function SimpleRtcRead

rEFIt_UEFI/Platform/Hibernate.cpp:270–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268#define RTC_NMI_MASK 0x80
269
270STATIC
271UINT8
272SimpleRtcRead (
273 IN UINT8 Offset
274 )
275{
276 UINT8 RtcIndexPort;
277 UINT8 RtcDataPort;
278 UINT8 RtcIndexNmi;
279
280 if (Offset < RTC_BANK_SIZE) {
281 RtcIndexPort = R_PCH_RTC_INDEX;
282 RtcDataPort = R_PCH_RTC_TARGET;
283 } else {
284 RtcIndexPort = R_PCH_RTC_EXT_INDEX;
285 RtcDataPort = R_PCH_RTC_EXT_TARGET;
286 }
287
288 RtcIndexNmi = IoRead8 (RtcIndexPort) & RTC_NMI_MASK;
289 IoWrite8 (RtcIndexPort, (Offset & RTC_DATA_MASK) | RtcIndexNmi);
290 return IoRead8 (RtcDataPort);
291}
292
293STATIC
294VOID

Callers 1

PrepareHibernationFunction · 0.85

Calls 2

IoRead8Function · 0.50
IoWrite8Function · 0.50

Tested by

no test coverage detected