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

Go to the source code of this file.

Data Structures

struct  APPLE_RTC_RAM_PROTOCOL_
 

Macros

#define APPLE_RTC_RAM_PROTOCOL_GUID
 

Typedefs

typedef struct APPLE_RTC_RAM_PROTOCOL_ APPLE_RTC_RAM_PROTOCOL
 
typedef UINTN(EFIAPI * APPLE_RTC_RAM_GET_AVAILABLE_MEMORY) (IN APPLE_RTC_RAM_PROTOCOL *This)
 
typedef EFI_STATUS(EFIAPI * APPLE_RTC_RAM_READ_MEMORY) (IN APPLE_RTC_RAM_PROTOCOL *This, OUT UINT8 *Buffer, IN UINTN BufferSize, IN UINTN Address)
 
typedef EFI_STATUS(EFIAPI * APPLE_RTC_RAM_WRITE_MEMORY) (IN APPLE_RTC_RAM_PROTOCOL *This, IN CONST UINT8 *Buffer, IN UINTN BufferSize, IN UINTN Address)
 
typedef EFI_STATUS(EFIAPI * APPLE_RTC_RAM_RESET_MEMORY) (IN APPLE_RTC_RAM_PROTOCOL *This)
 

Variables

EFI_GUID gAppleRtcRamProtocolGuid
 

Detailed Description

Apple RTC RAM.

Copyright (C) 2020, 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 AppleRtcRam.h.

Macro Definition Documentation

◆ APPLE_RTC_RAM_PROTOCOL_GUID

#define APPLE_RTC_RAM_PROTOCOL_GUID
Value:
{ 0xE121EC07, 0x9C42, 0x45EE, \
{ 0xB0, 0xB6, 0xFF, 0xF8, 0xEF, 0x03, 0xC5, 0x21 } }

Installed by RTC driver. E121EC07-9C42-45EE-B0B6-FFF8EF03C521 Found in AppleRtcRam (CC54F583-3F9E-4AB0-9F7C-D2C7ED1C87A5).

Note, there is a sibling driver in PEI: 13CFE225-E07B-40F3-9703-EBE99318766E Found in AppleRtcRamPeim (1B99796D-2A26-437E-BEE0-014F0EBBECE1).

Definition at line 30 of file AppleRtcRam.h.

Typedef Documentation

◆ APPLE_RTC_RAM_GET_AVAILABLE_MEMORY

typedef UINTN(EFIAPI * APPLE_RTC_RAM_GET_AVAILABLE_MEMORY) (IN APPLE_RTC_RAM_PROTOCOL *This)

Obtain available RTC memory in bytes.

Parameters
[in]ThisApple RTC RAM protocol instance.
Return values
256under normal circumstances.

Definition at line 44 of file AppleRtcRam.h.

◆ APPLE_RTC_RAM_PROTOCOL

Definition at line 34 of file AppleRtcRam.h.

◆ APPLE_RTC_RAM_READ_MEMORY

typedef EFI_STATUS(EFIAPI * APPLE_RTC_RAM_READ_MEMORY) (IN APPLE_RTC_RAM_PROTOCOL *This, OUT UINT8 *Buffer, IN UINTN BufferSize, IN UINTN Address)

Read memory from RTC.

Parameters
[in]ThisApple RTC RAM protocol instance.
[out]BufferDestination buffer to read to.
[in]BufferSizeThe amount of memory to read in bytes.
[in]AddressThe starting RTC offset to read from.

The implementation should respect data consistency:

  • If APPLE_RTC_BG_COLOR_ADDR ^ APPLE_RTC_BG_COMPLEMENT_ADDR != 0xFF APPLE_RTC_BG_COLOR_GRAY should be returned for APPLE_RTC_BG_COLOR_ADDR.
Return values
EFI_INVALID_PARAMETERwhen Buffer is NULL.
EFI_INVALID_PARAMETERwhen BufferSize is 0.
EFI_INVALID_PARAMETERwhen the requested memory is out of range.
EFI_ACCESS_DENIEDwhen an RTC I/O operating is in progress.
EFI_TIMEOUTwhen RTC device is not ready.
EFI_SUCCESSon success.

Definition at line 69 of file AppleRtcRam.h.

◆ APPLE_RTC_RAM_RESET_MEMORY

typedef EFI_STATUS(EFIAPI * APPLE_RTC_RAM_RESET_MEMORY) (IN APPLE_RTC_RAM_PROTOCOL *This)

Reset RTC memory to default values. For uses like CMD+OPT+P+R.

The implementation should maintain data consistency:

  • Core memory as defined by APPLE_RTC_CORE_SIZE should not be changed.
  • Preserve APPLE_RTC_RESERVED_ADDR area.
  • Preserve APPLE_RTC_FIRMWARE_57_ADDR address.
Parameters
[in]ThisApple RTC RAM protocol instance.
Return values
EFI_OUT_OF_RESOURCESwhen a memory allocation error happened.
EFI_ACCESS_DENIEDwhen an RTC I/O operating is in progress.
EFI_TIMEOUTwhen RTC device is not ready.
EFI_SUCCESSon success.

Definition at line 127 of file AppleRtcRam.h.

◆ APPLE_RTC_RAM_WRITE_MEMORY

typedef EFI_STATUS(EFIAPI * APPLE_RTC_RAM_WRITE_MEMORY) (IN APPLE_RTC_RAM_PROTOCOL *This, IN CONST UINT8 *Buffer, IN UINTN BufferSize, IN UINTN Address)

Write memory to RTC.

Parameters
[in]ThisApple RTC RAM protocol instance.
[in]BufferSource buffer to write to RTC.
[in]BufferSizeThe amount of memory to write in bytes.
[in]AddressThe starting RTC offset to write to.

The implementation should maintain data consistency:

  • APPLE_RTC_BG_COMPLEMENT_ADDR should be set to ~APPLE_RTC_BG_COLOR_ADDR.
  • APPLE_RTC_CORE_CHECKSUM_ADDR1 / APPLE_RTC_CORE_CHECKSUM_ADDR2 should be recalculated if necessary.
  • APPLE_RTC_MAIN_CHECKSUM_ADDR1 / APPLE_RTC_MAIN_CHECKSUM_ADDR2 should be recalculated if necessary.
Return values
EFI_INVALID_PARAMETERwhen Buffer is NULL.
EFI_INVALID_PARAMETERwhen BufferSize is 0.
EFI_INVALID_PARAMETERwhen the requested memory is out of range.
EFI_INVALID_PARAMETERwhen trying to update system memory before APPLE_RTC_CHECKSUM_START.
EFI_OUT_OF_RESOURCESwhen a memory allocation error happened.
EFI_ACCESS_DENIEDwhen an RTC I/O operating is in progress.
EFI_TIMEOUTwhen RTC device is not ready.
EFI_SUCCESSon success.

Definition at line 103 of file AppleRtcRam.h.

Variable Documentation

◆ gAppleRtcRamProtocolGuid

EFI_GUID gAppleRtcRamProtocolGuid
extern