OpenCore  1.0.4
OpenCore Bootloader
1.0.4
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
AppleRtcRam.c File Reference
#include <Guid/OcVariable.h>
#include <Protocol/AppleRtcRam.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/OcMiscLib.h>
#include <Library/OcRtcLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
#include "OcRtcLibInternal.h"

Go to the source code of this file.

Functions

STATIC EFI_STATUS SyncRtcRead (IN UINT8 Address, IN UINT8 *ValuePtr)
 
STATIC EFI_STATUS SyncRtcWrite (IN UINT8 Address, IN UINT8 Value)
 
STATIC EFI_STATUS SyncRtcWaitForReady (VOID)
 
STATIC UINTN EFIAPI AppleRtcGetAvailableMemory (IN APPLE_RTC_RAM_PROTOCOL *This)
 
STATIC EFI_STATUS EFIAPI AppleRtcRamReadData (IN APPLE_RTC_RAM_PROTOCOL *This, OUT UINT8 *Buffer, IN UINTN BufferSize, IN UINTN Address)
 
STATIC EFI_STATUS EFIAPI AppleRtcRamWriteData (IN APPLE_RTC_RAM_PROTOCOL *This, IN CONST UINT8 *Buffer, IN UINTN BufferSize, IN UINTN Address)
 
STATIC EFI_STATUS EFIAPI AppleRtcRamReset (IN APPLE_RTC_RAM_PROTOCOL *This)
 
APPLE_RTC_RAM_PROTOCOLOcAppleRtcRamInstallProtocol (IN BOOLEAN Reinstall)
 

Variables

STATIC EFI_LOCK mAppleRtcRamLock
 
STATIC UINT8 mEmulatedRtcArea [APPLE_RTC_TOTAL_SIZE]
 
STATIC BOOLEAN mEmulatedRtcStatus [APPLE_RTC_TOTAL_SIZE]
 
STATIC APPLE_RTC_RAM_PROTOCOL mAppleRtcRamProtocol
 

Detailed Description

OcRtcLib - library with RTC I/O functions

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.c.

Function Documentation

◆ AppleRtcGetAvailableMemory()

STATIC UINTN EFIAPI AppleRtcGetAvailableMemory ( IN APPLE_RTC_RAM_PROTOCOL * This)

Definition at line 115 of file AppleRtcRam.c.

◆ AppleRtcRamReadData()

STATIC EFI_STATUS EFIAPI AppleRtcRamReadData ( IN APPLE_RTC_RAM_PROTOCOL * This,
OUT UINT8 * Buffer,
IN UINTN BufferSize,
IN UINTN Address )

Definition at line 125 of file AppleRtcRam.c.

◆ AppleRtcRamReset()

STATIC EFI_STATUS EFIAPI AppleRtcRamReset ( IN APPLE_RTC_RAM_PROTOCOL * This)

Definition at line 242 of file AppleRtcRam.c.

◆ AppleRtcRamWriteData()

STATIC EFI_STATUS EFIAPI AppleRtcRamWriteData ( IN APPLE_RTC_RAM_PROTOCOL * This,
IN CONST UINT8 * Buffer,
IN UINTN BufferSize,
IN UINTN Address )

< This is not checked in the original.

< Does not check the error code.

Definition at line 182 of file AppleRtcRam.c.

◆ 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.

◆ SyncRtcRead()

STATIC EFI_STATUS SyncRtcRead ( IN UINT8 Address,
IN UINT8 * ValuePtr )

Definition at line 36 of file AppleRtcRam.c.

◆ SyncRtcWaitForReady()

STATIC EFI_STATUS SyncRtcWaitForReady ( VOID )

Definition at line 83 of file AppleRtcRam.c.

◆ SyncRtcWrite()

STATIC EFI_STATUS SyncRtcWrite ( IN UINT8 Address,
IN UINT8 Value )

Definition at line 59 of file AppleRtcRam.c.

Variable Documentation

◆ mAppleRtcRamLock

STATIC EFI_LOCK mAppleRtcRamLock

Definition at line 30 of file AppleRtcRam.c.

◆ mAppleRtcRamProtocol

STATIC APPLE_RTC_RAM_PROTOCOL mAppleRtcRamProtocol
Initial value:
= {
}
STATIC UINTN EFIAPI AppleRtcGetAvailableMemory(IN APPLE_RTC_RAM_PROTOCOL *This)
STATIC EFI_STATUS EFIAPI AppleRtcRamWriteData(IN APPLE_RTC_RAM_PROTOCOL *This, IN CONST UINT8 *Buffer, IN UINTN BufferSize, IN UINTN Address)
STATIC EFI_STATUS EFIAPI AppleRtcRamReadData(IN APPLE_RTC_RAM_PROTOCOL *This, OUT UINT8 *Buffer, IN UINTN BufferSize, IN UINTN Address)
STATIC EFI_STATUS EFIAPI AppleRtcRamReset(IN APPLE_RTC_RAM_PROTOCOL *This)

Definition at line 281 of file AppleRtcRam.c.

◆ mEmulatedRtcArea

STATIC UINT8 mEmulatedRtcArea[APPLE_RTC_TOTAL_SIZE]

Definition at line 31 of file AppleRtcRam.c.

◆ mEmulatedRtcStatus

STATIC BOOLEAN mEmulatedRtcStatus[APPLE_RTC_TOTAL_SIZE]

Definition at line 32 of file AppleRtcRam.c.