OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
OcBootServicesTableLib.c File Reference
#include <Uefi.h>
#include <Library/OcBootServicesTableLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/DevicePathLib.h>
#include <Protocol/DevicePath.h>
#include <Protocol/LoadedImage.h>

Go to the source code of this file.

Data Structures

struct  OC_REGISTERED_PROTOCOL_
 

Typedefs

typedef struct OC_REGISTERED_PROTOCOL_ OC_REGISTERED_PROTOCOL
 

Functions

STATIC EFI_STATUS EFIAPI OcConnectController (IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE *DriverImageHandle OPTIONAL, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL, IN BOOLEAN Recursive)
 
STATIC EFI_STATUS EFIAPI OcOpenProtocol (IN EFI_HANDLE Handle, IN EFI_GUID *Protocol, OUT VOID **Interface OPTIONAL, IN EFI_HANDLE AgentHandle, IN EFI_HANDLE ControllerHandle, IN UINT32 Attributes)
 
STATIC EFI_STATUS EFIAPI OcLocateHandleBuffer (IN EFI_LOCATE_SEARCH_TYPE SearchType, IN EFI_GUID *Protocol OPTIONAL, IN VOID *SearchKey OPTIONAL, IN OUT UINTN *NoHandles, OUT EFI_HANDLE **Buffer)
 
STATIC EFI_STATUS EFIAPI OcLocateProtocol (IN EFI_GUID *Protocol, IN VOID *Registration OPTIONAL, OUT VOID **Interface)
 
EFI_STATUS OcRegisterBootServicesProtocol (IN EFI_GUID *ProtocolGuid, IN VOID *ProtocolInstance, IN BOOLEAN Override)
 
EFI_STATUS EFIAPI OcBootServicesTableLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
EFI_STATUS EFIAPI OcBootServicesTableLibDestructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

EFI_HANDLE gImageHandle = NULL
 
EFI_SYSTEM_TABLE * gST = NULL
 
EFI_BOOT_SERVICES * gBS = NULL
 
STATIC EFI_CONNECT_CONTROLLER mConnectController = NULL
 
STATIC EFI_OPEN_PROTOCOL mOpenProtocol = NULL
 
STATIC EFI_LOCATE_HANDLE_BUFFER mLocateHandleBuffer = NULL
 
STATIC EFI_LOCATE_PROTOCOL mLocateProtocol = NULL
 
STATIC OC_REGISTERED_PROTOCOL mRegisteredProtocols [16]
 
STATIC UINTN mRegisteredProtocolCount = 0
 

Detailed Description

This library retrieve the EFI_BOOT_SERVICES pointer from EFI system table in library's constructor and allow overriding its properties.

Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
Copyright (c) 2020, vit9696. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file OcBootServicesTableLib.c.

Typedef Documentation

◆ OC_REGISTERED_PROTOCOL

Function Documentation

◆ OcBootServicesTableLibConstructor()

EFI_STATUS EFIAPI OcBootServicesTableLibConstructor ( IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE * SystemTable )

Definition at line 271 of file OcBootServicesTableLib.c.

◆ OcBootServicesTableLibDestructor()

EFI_STATUS EFIAPI OcBootServicesTableLibDestructor ( IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE * SystemTable )

Definition at line 341 of file OcBootServicesTableLib.c.

◆ OcConnectController()

STATIC EFI_STATUS EFIAPI OcConnectController ( IN EFI_HANDLE ControllerHandle,
IN EFI_HANDLE *DriverImageHandle OPTIONAL,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL,
IN BOOLEAN Recursive )

Definition at line 41 of file OcBootServicesTableLib.c.

◆ OcLocateHandleBuffer()

STATIC EFI_STATUS EFIAPI OcLocateHandleBuffer ( IN EFI_LOCATE_SEARCH_TYPE SearchType,
IN EFI_GUID *Protocol OPTIONAL,
IN VOID *SearchKey OPTIONAL,
IN OUT UINTN * NoHandles,
OUT EFI_HANDLE ** Buffer )

Definition at line 151 of file OcBootServicesTableLib.c.

◆ OcLocateProtocol()

STATIC EFI_STATUS EFIAPI OcLocateProtocol ( IN EFI_GUID * Protocol,
IN VOID *Registration OPTIONAL,
OUT VOID ** Interface )

Definition at line 198 of file OcBootServicesTableLib.c.

◆ OcOpenProtocol()

STATIC EFI_STATUS EFIAPI OcOpenProtocol ( IN EFI_HANDLE Handle,
IN EFI_GUID * Protocol,
OUT VOID **Interface OPTIONAL,
IN EFI_HANDLE AgentHandle,
IN EFI_HANDLE ControllerHandle,
IN UINT32 Attributes )

Definition at line 86 of file OcBootServicesTableLib.c.

◆ OcRegisterBootServicesProtocol()

EFI_STATUS OcRegisterBootServicesProtocol ( IN EFI_GUID * ProtocolGuid,
IN VOID * ProtocolInstance,
IN BOOLEAN Override )

Provide protocol instance through gBS->LocateProtocol.

Parameters
[in]ProtocolGuidPointer to protocol GUID.
[in]ProtocolInstancePointer to protocol instance.
[in]OverrideOverride protocol instead of fallback when missing.
Return values
EFI_SUCCESSon successful registration.
EFI_OUT_OF_RESOURCESwhen no free slots are available.

Definition at line 250 of file OcBootServicesTableLib.c.

Variable Documentation

◆ gBS

EFI_BOOT_SERVICES* gBS = NULL

Definition at line 29 of file OcBootServicesTableLib.c.

◆ gImageHandle

EFI_HANDLE gImageHandle = NULL

Definition at line 27 of file OcBootServicesTableLib.c.

◆ gST

EFI_SYSTEM_TABLE* gST = NULL

Definition at line 28 of file OcBootServicesTableLib.c.

◆ mConnectController

STATIC EFI_CONNECT_CONTROLLER mConnectController = NULL

Definition at line 31 of file OcBootServicesTableLib.c.

◆ mLocateHandleBuffer

STATIC EFI_LOCATE_HANDLE_BUFFER mLocateHandleBuffer = NULL

Definition at line 33 of file OcBootServicesTableLib.c.

◆ mLocateProtocol

STATIC EFI_LOCATE_PROTOCOL mLocateProtocol = NULL

Definition at line 34 of file OcBootServicesTableLib.c.

◆ mOpenProtocol

STATIC EFI_OPEN_PROTOCOL mOpenProtocol = NULL

Definition at line 32 of file OcBootServicesTableLib.c.

◆ mRegisteredProtocolCount

STATIC UINTN mRegisteredProtocolCount = 0

Definition at line 36 of file OcBootServicesTableLib.c.

◆ mRegisteredProtocols

STATIC OC_REGISTERED_PROTOCOL mRegisteredProtocols[16]

Definition at line 35 of file OcBootServicesTableLib.c.