OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
OcRtcLib.h File Reference

Go to the source code of this file.

Functions

UINT8 OcRtcRead (IN UINT8 Offset)
 
VOID OcRtcWrite (IN UINT8 Offset, IN UINT8 Value)
 
UINT16 OcRtcChecksumApple (IN CONST VOID *Data, IN UINTN Size)
 
APPLE_RTC_RAM_PROTOCOLOcAppleRtcRamInstallProtocol (IN BOOLEAN Reinstall)
 
UINT8 OcRtcReadIvy (IN UINT8 Offset)
 
VOID OcRtcWriteIvy (IN UINT8 Offset, IN UINT8 Value)
 

Detailed Description

OcRtcLib - library with RTC I/O functions

Copyright (c) 2017-2018, vit9696

All rights reserved.

This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Definition in file OcRtcLib.h.

Function Documentation

◆ OcAppleRtcRamInstallProtocol()

APPLE_RTC_RAM_PROTOCOL * OcAppleRtcRamInstallProtocol ( IN BOOLEAN Reinstall)

Install and initialise Apple RTC RAM protocol.

Parameters
[in]ReinstallOverwrite installed protocol.
Return values
installedor located protocol or NULL.

Definition at line 289 of file AppleRtcRam.c.

◆ OcRtcChecksumApple()

UINT16 OcRtcChecksumApple ( IN CONST VOID * Data,
IN UINTN Size )

Calculate Apple CMOS checksum. This is a modified version of ANSI CRC16 in REFIN mode (0xA001 poly). See http://zlib.net/crc_v3.txt for more details.

  1. Effective poly is 0x2001 due to a bitwise OR with BIT15. The change turns CRC16 into CRC14, making BIT14 and BIT15 always zero. This modification is commonly found in legacy Phoenix firmware, where it was used for password hashing as found by dogbert: http://sites.google.com/site/dogber1/blag/pwgen-5dec.py
  2. Only 7 shifts per byte are performed instead of the usual 8. This might improve checksum quality against specific data, but the exact reasons are unknown. The algorithm did not change since its introduction in 10.4.x, and since Apple Developer Transition Kit was based on Phoenix firmware, this could just be a quick change to get a different checksum.
Parameters
[in]DataPointer to data to calculate the checksum of.
[in]SizeSize of data.
Return values
Resultingchecksum.

Definition at line 70 of file OcRtcLib.c.

◆ OcRtcRead()

UINT8 OcRtcRead ( IN UINT8 Offset)

Definition at line 25 of file OcRtcLib.c.

◆ OcRtcReadIvy()

UINT8 OcRtcReadIvy ( IN UINT8 Offset)

Definition at line 100 of file OcRtcLib.c.

◆ OcRtcWrite()

VOID OcRtcWrite ( IN UINT8 Offset,
IN UINT8 Value )

Definition at line 47 of file OcRtcLib.c.

◆ OcRtcWriteIvy()

VOID OcRtcWriteIvy ( IN UINT8 Offset,
IN UINT8 Value )

Definition at line 123 of file OcRtcLib.c.