TianoCore EDK2 master
Loading...
Searching...
No Matches
RamDiskProtocol.c File Reference
#include "RamDiskImpl.h"

Go to the source code of this file.

Functions

VOID RamDiskInitDeviceNode (IN RAM_DISK_PRIVATE_DATA *PrivateData, IN OUT MEDIA_RAM_DISK_DEVICE_PATH *RamDiskDevNode)
 
EFI_STATUS RamDiskPublishSsdt (VOID)
 
EFI_STATUS RamDiskPublishNfit (IN RAM_DISK_PRIVATE_DATA *PrivateData)
 
EFI_STATUS RamDiskUnpublishNfit (IN RAM_DISK_PRIVATE_DATA *PrivateData)
 
EFI_STATUS EFIAPI RamDiskRegister (IN UINT64 RamDiskBase, IN UINT64 RamDiskSize, IN EFI_GUID *RamDiskType, IN EFI_DEVICE_PATH *ParentDevicePath OPTIONAL, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath)
 
EFI_STATUS EFIAPI RamDiskUnregister (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath)
 

Variables

RAM_DISK_PRIVATE_DATA mRamDiskPrivateDataTemplate
 
MEDIA_RAM_DISK_DEVICE_PATH mRamDiskDeviceNodeTemplate
 
BOOLEAN mRamDiskSsdtTableKeyValid = FALSE
 
UINTN mRamDiskSsdtTableKey
 

Detailed Description

The realization of EFI_RAM_DISK_PROTOCOL.

Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file RamDiskProtocol.c.

Function Documentation

◆ RamDiskInitDeviceNode()

VOID RamDiskInitDeviceNode ( IN RAM_DISK_PRIVATE_DATA PrivateData,
IN OUT MEDIA_RAM_DISK_DEVICE_PATH RamDiskDevNode 
)

Initialize the RAM disk device node.

Parameters
[in]PrivateDataPoints to RAM disk private data.
[in,out]RamDiskDevNodePoints to the RAM disk device node.

Definition at line 40 of file RamDiskProtocol.c.

◆ RamDiskPublishNfit()

EFI_STATUS RamDiskPublishNfit ( IN RAM_DISK_PRIVATE_DATA PrivateData)

Publish the RAM disk NVDIMM Firmware Interface Table (NFIT) to the ACPI table.

Parameters
[in]PrivateDataPoints to RAM disk private data.
Return values
EFI_SUCCESSThe RAM disk NFIT has been published.
othersThe RAM disk NFIT has not been published.

Definition at line 128 of file RamDiskProtocol.c.

◆ RamDiskPublishSsdt()

EFI_STATUS RamDiskPublishSsdt ( VOID  )

Initialize and publish NVDIMM root device SSDT in ACPI table.

Return values
EFI_SUCCESSThe NVDIMM root device SSDT is published.
OthersThe NVDIMM root device SSDT is not published.

Definition at line 65 of file RamDiskProtocol.c.

◆ RamDiskRegister()

EFI_STATUS EFIAPI RamDiskRegister ( IN UINT64  RamDiskBase,
IN UINT64  RamDiskSize,
IN EFI_GUID RamDiskType,
IN EFI_DEVICE_PATH *ParentDevicePath  OPTIONAL,
OUT EFI_DEVICE_PATH_PROTOCOL **  DevicePath 
)

Register a RAM disk with specified address, size and type.

Parameters
[in]RamDiskBaseThe base address of registered RAM disk.
[in]RamDiskSizeThe size of registered RAM disk.
[in]RamDiskTypeThe type of registered RAM disk. The GUID can be any of the values defined in section 9.3.6.9, or a vendor defined GUID.
[in]ParentDevicePathPointer to the parent device path. If there is no parent device path then ParentDevicePath is NULL.
[out]DevicePathOn return, points to a pointer to the device path of the RAM disk device. If ParentDevicePath is not NULL, the returned DevicePath is created by appending a RAM disk node to the parent device path. If ParentDevicePath is NULL, the returned DevicePath is a RAM disk device path without appending. This function is responsible for allocating the buffer DevicePath with the boot service AllocatePool().
Return values
EFI_SUCCESSThe RAM disk is registered successfully.
EFI_INVALID_PARAMETERDevicePath or RamDiskType is NULL. RamDiskSize is 0.
EFI_ALREADY_STARTEDA Device Path Protocol instance to be created is already present in the handle database.
EFI_OUT_OF_RESOURCESThe RAM disk register operation fails due to resource limitation.

Definition at line 593 of file RamDiskProtocol.c.

◆ RamDiskUnpublishNfit()

EFI_STATUS RamDiskUnpublishNfit ( IN RAM_DISK_PRIVATE_DATA PrivateData)

Unpublish the RAM disk NVDIMM Firmware Interface Table (NFIT) from the ACPI table.

Parameters
[in]PrivateDataPoints to RAM disk private data.
Return values
EFI_SUCCESSThe RAM disk NFIT has been unpublished.
othersThe RAM disk NFIT has not been unpublished.

Definition at line 380 of file RamDiskProtocol.c.

◆ RamDiskUnregister()

EFI_STATUS EFIAPI RamDiskUnregister ( IN EFI_DEVICE_PATH_PROTOCOL DevicePath)

Unregister a RAM disk specified by DevicePath.

Parameters
[in]DevicePathA pointer to the device path that describes a RAM Disk device.
Return values
EFI_SUCCESSThe RAM disk is unregistered successfully.
EFI_INVALID_PARAMETERDevicePath is NULL.
EFI_UNSUPPORTEDThe device specified by DevicePath is not a valid ramdisk device path and not supported by the driver.
EFI_NOT_FOUNDThe RAM disk pointed by DevicePath doesn't exist.

Definition at line 762 of file RamDiskProtocol.c.

Variable Documentation

◆ mRamDiskDeviceNodeTemplate

MEDIA_RAM_DISK_DEVICE_PATH mRamDiskDeviceNodeTemplate
Initial value:
= {
{
MEDIA_DEVICE_PATH,
{
(UINT8)(sizeof (MEDIA_RAM_DISK_DEVICE_PATH)),
(UINT8)((sizeof (MEDIA_RAM_DISK_DEVICE_PATH)) >> 8)
}
}
}
#define MEDIA_RAM_DISK_DP
Definition: DevicePath.h:1205

Definition at line 18 of file RamDiskProtocol.c.

◆ mRamDiskPrivateDataTemplate

RAM_DISK_PRIVATE_DATA mRamDiskPrivateDataTemplate
Initial value:
= {
RAM_DISK_PRIVATE_DATA_SIGNATURE,
}
#define NULL
Definition: Base.h:319

Definition at line 13 of file RamDiskProtocol.c.

◆ mRamDiskSsdtTableKey

UINTN mRamDiskSsdtTableKey

Definition at line 30 of file RamDiskProtocol.c.

◆ mRamDiskSsdtTableKeyValid

BOOLEAN mRamDiskSsdtTableKeyValid = FALSE

Definition at line 29 of file RamDiskProtocol.c.