Skip to content
Permalink
Browse files

MdeModulePkg: Add DxeGcdCorePlatformHookLib

The library provides the function to perform the platform hooks after
Gcd core is initialized.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
  • Loading branch information
codomania committed Jun 5, 2017
1 parent 4f95545 commit 171f816376b3b0677cbfb90271a94a920d7ad72d
@@ -93,7 +93,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/DxeServicesLib.h>
#include <Library/DebugAgentLib.h>
#include <Library/CpuExceptionHandlerLib.h>

#include <Library/DxeGcdCorePlatformHookLib.h>

//
// attributes for reserved memory before it is promoted to system memory
@@ -100,6 +100,7 @@
DebugAgentLib
CpuExceptionHandlerLib
PcdLib
DxeGcdCorePlatformHookLib

[Guids]
gEfiEventMemoryMapChangeGuid ## PRODUCES ## Event
@@ -297,6 +297,11 @@ DxeMain (
Status = CoreInitializeGcdServices (&HobStart, MemoryBaseAddress, MemoryLength);
ASSERT_EFI_ERROR (Status);

//
// Call Platform hooks for Gcd
//
DxeGcdCorePlatformHookReady (&mDxeServices);

//
// Call constructor for all libraries
//
@@ -0,0 +1,33 @@
/** @file
Library that provides platform hooks to perform post processing of Gcd memory map.
Copyright (c) 2017, AMD Inc. All rights reserved.<BR>
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.
**/

#ifndef __DXE_GCD_CORE_PLATFORM_HOOK_LIB_H__
#define __DXE_GCD_CORE_PLATFORM_HOOK_LIB_H__


/**
This function is hook point called after the GCD memory map is initialized,
it allows the platform to perform post processing before the GCD maps are
made available to other drivers.
**/
VOID
EFIAPI
DxeGcdCorePlatformHookReady (
EFI_DXE_SERVICES *gDS
);


#endif

@@ -0,0 +1,30 @@
/** @file
DxeCore Gcd Platform Hook NULL library instance.
Copyright (c) 2017, AMD Inc. All rights reserved.<BR>
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.
**/

#include <PiDxe.h>

#include <Library/DxeGcdCorePlatformHookLib.h>

/**
This function is hook point called after the GCD memory map is initialized,
it allows the platform to perform post processing before the GCD maps are
made available to other drivers.
**/
VOID
EFIAPI
DxeGcdCorePlatformHookReady (
EFI_DXE_SERVICES *gDS
)
{
}
@@ -0,0 +1,33 @@
## @file
# GCD core platform hook lib

# Copyright (c) 2017, AMD Inc. All rights reserved.<BR>
# 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.
#
##

[Defines]
INF_VERSION = 1.25
BASE_NAME = DxeGcdCorePlatformHookLib
FILE_GUID = 7C1DC10D-D271-422a-AFF3-CBCF70344431
MODULE_TYPE = DXE_CORE
VERSION_STRING = 1.0

LIBRARY_CLASS = DxeGcdCorePlatformHookLib | DXE_CORE

[Sources]
DxeGcdCorePlatformHookLibNull.c

[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec

[LibraryClasses]
BaseLib
DebugLib
@@ -167,6 +167,8 @@
##
NonDiscoverableDeviceRegistrationLib|Include/Library/NonDiscoverableDeviceRegistrationLib.h

DxeGcdCorePlatformHookLib|Include/Library/DxeGcdCorePlatformHookLib.h

[Guids]
## MdeModule package token space guid
# Include/Guid/MdeModulePkgTokenSpace.h
@@ -124,6 +124,7 @@
HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf
MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf
ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf
DxeGcdCorePlatformHookLib|MdeModulePkg/Library/DxeGcdCorePlatformHookLib/DxeGcdCorePlatformHookLibNull.inf

[LibraryClasses.common.DXE_DRIVER]
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
@@ -283,6 +283,7 @@
!endif
CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
DxeGcdCorePlatformHookLib|MdeModulePkg/Library/DxeGcdCorePlatformHookLib/DxeGcdCorePlatformHookLibNull.inf

[LibraryClasses.common.DXE_RUNTIME_DRIVER]
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf

0 comments on commit 171f816

Please sign in to comment.
You can’t perform that action at this time.