mirror of https://github.com/acidanthera/audk.git
MdeModulePkg/MemoryStatusCode: Expose the DXE memory status code table.
Let data of DXE memory status code can be used by other modules. 1. Save the address of DXE memory status code table to DxeConfigurationTable. 2. Save the address of SMM memory status code table to SmmConfigurationTable. 3. Move RUNTIME_MEMORY_STATUSCODE_HEADER to its public header file. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
parent
c99bcf3d8a
commit
848e147239
|
@ -2,6 +2,7 @@
|
|||
GUID used to identify status code records HOB that originate from the PEI status code.
|
||||
|
||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
|
||||
This program and the accompanying materials are licensed and made available under
|
||||
the terms and conditions of the BSD License that accompanies this distribution.
|
||||
The full text of the license may be found at
|
||||
|
@ -55,6 +56,25 @@ typedef struct {
|
|||
UINT32 MaxRecordsNumber;
|
||||
} MEMORY_STATUSCODE_PACKET_HEADER;
|
||||
|
||||
///
|
||||
/// A header structure that is followed by an array of records that contain the
|
||||
/// parameters passed into the ReportStatusCode() service in the DXE Services Table.
|
||||
///
|
||||
typedef struct {
|
||||
///
|
||||
/// The index pointing to the last recored being stored.
|
||||
///
|
||||
UINT32 RecordIndex;
|
||||
///
|
||||
/// The number of records being stored.
|
||||
///
|
||||
UINT32 NumberOfRecords;
|
||||
///
|
||||
/// The maximum number of records that can be stored.
|
||||
///
|
||||
UINT32 MaxRecordsNumber;
|
||||
} RUNTIME_MEMORY_STATUSCODE_HEADER;
|
||||
|
||||
///
|
||||
/// A structure that contains the parameters passed into the ReportStatusCode()
|
||||
/// service in the PEI Services Table.
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
Runtime memory status code worker.
|
||||
|
||||
Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
|
||||
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<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
|
||||
|
@ -20,6 +21,7 @@ RUNTIME_MEMORY_STATUSCODE_HEADER *mRtMemoryStatusCodeTable;
|
|||
Initialize runtime memory status code table as initialization for runtime memory status code worker
|
||||
|
||||
@retval EFI_SUCCESS Runtime memory status code table successfully initialized.
|
||||
@retval others Errors from gBS->InstallConfigurationTable().
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
|
@ -27,6 +29,8 @@ RtMemoryStatusCodeInitializeWorker (
|
|||
VOID
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
//
|
||||
// Allocate runtime memory status code pool.
|
||||
//
|
||||
|
@ -40,8 +44,9 @@ RtMemoryStatusCodeInitializeWorker (
|
|||
mRtMemoryStatusCodeTable->NumberOfRecords = 0;
|
||||
mRtMemoryStatusCodeTable->MaxRecordsNumber =
|
||||
(PcdGet16 (PcdStatusCodeMemorySize) * 1024) / sizeof (MEMORY_STATUSCODE_RECORD);
|
||||
Status = gBS->InstallConfigurationTable (&gMemoryStatusCodeRecordGuid, mRtMemoryStatusCodeTable);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
Internal include file for Status Code Handler Driver.
|
||||
|
||||
Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<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
|
||||
|
@ -40,15 +41,6 @@
|
|||
//
|
||||
#define MAX_DEBUG_MESSAGE_LENGTH 0x100
|
||||
|
||||
//
|
||||
// Runtime memory status code worker definition
|
||||
//
|
||||
typedef struct {
|
||||
UINT32 RecordIndex;
|
||||
UINT32 NumberOfRecords;
|
||||
UINT32 MaxRecordsNumber;
|
||||
} RUNTIME_MEMORY_STATUSCODE_HEADER;
|
||||
|
||||
extern RUNTIME_MEMORY_STATUSCODE_HEADER *mRtMemoryStatusCodeTable;
|
||||
|
||||
/**
|
||||
|
@ -96,6 +88,7 @@ SerialStatusCodeReportWorker (
|
|||
Initialize runtime memory status code table as initialization for runtime memory status code worker
|
||||
|
||||
@retval EFI_SUCCESS Runtime memory status code table successfully initialized.
|
||||
@retval others Errors from gBS->InstallConfigurationTable().
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
# Status Code Handler Driver which produces general handlers and hook them onto the DXE status code router.
|
||||
#
|
||||
# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
|
||||
#
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
|
@ -52,7 +53,9 @@
|
|||
BaseMemoryLib
|
||||
|
||||
[Guids]
|
||||
gMemoryStatusCodeRecordGuid ## SOMETIMES_CONSUMES ## HOB
|
||||
## SOMETIMES_CONSUMES ## HOB
|
||||
## SOMETIMES_PRODUCES ## SystemTable
|
||||
gMemoryStatusCodeRecordGuid
|
||||
gEfiStatusCodeDataTypeStringGuid ## SOMETIMES_CONSUMES ## UNDEFINED
|
||||
gEfiEventVirtualAddressChangeGuid ## CONSUMES ## Event
|
||||
gEfiEventExitBootServicesGuid ## CONSUMES ## Event
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
Runtime memory status code worker.
|
||||
|
||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<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
|
||||
|
@ -20,13 +21,15 @@ RUNTIME_MEMORY_STATUSCODE_HEADER *mSmmMemoryStatusCodeTable;
|
|||
Initialize SMM memory status code table as initialization for memory status code worker
|
||||
|
||||
@retval EFI_SUCCESS SMM memory status code table successfully initialized.
|
||||
|
||||
@retval others Errors from gSmst->SmmInstallConfigurationTable().
|
||||
**/
|
||||
EFI_STATUS
|
||||
MemoryStatusCodeInitializeWorker (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
//
|
||||
// Allocate SMM memory status code pool.
|
||||
//
|
||||
|
@ -34,7 +37,13 @@ MemoryStatusCodeInitializeWorker (
|
|||
ASSERT (mSmmMemoryStatusCodeTable != NULL);
|
||||
|
||||
mSmmMemoryStatusCodeTable->MaxRecordsNumber = (PcdGet16 (PcdStatusCodeMemorySize) * 1024) / sizeof (MEMORY_STATUSCODE_RECORD);
|
||||
return EFI_SUCCESS;
|
||||
Status = gSmst->SmmInstallConfigurationTable (
|
||||
gSmst,
|
||||
&gMemoryStatusCodeRecordGuid,
|
||||
&mSmmMemoryStatusCodeTable,
|
||||
sizeof (mSmmMemoryStatusCodeTable)
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
Internal include file for Status Code Handler Driver.
|
||||
|
||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<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
|
||||
|
@ -37,15 +38,6 @@
|
|||
//
|
||||
#define MAX_DEBUG_MESSAGE_LENGTH 0x100
|
||||
|
||||
//
|
||||
// Runtime memory status code worker definition
|
||||
//
|
||||
typedef struct {
|
||||
UINT32 RecordIndex;
|
||||
UINT32 NumberOfRecords;
|
||||
UINT32 MaxRecordsNumber;
|
||||
} RUNTIME_MEMORY_STATUSCODE_HEADER;
|
||||
|
||||
extern RUNTIME_MEMORY_STATUSCODE_HEADER *mSmmMemoryStatusCodeTable;
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
# Status Code Handler Driver which produces general handlers and hook them onto the SMM status code router.
|
||||
#
|
||||
# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
|
||||
#
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
|
@ -52,6 +53,7 @@
|
|||
|
||||
[Guids]
|
||||
gEfiStatusCodeDataTypeStringGuid ## SOMETIMES_CONSUMES ## UNDEFINED
|
||||
gMemoryStatusCodeRecordGuid ## SOMETIMES_PRODUCES ## UNDEFINED # SmmSystemTable
|
||||
|
||||
[Protocols]
|
||||
gEfiSmmRscHandlerProtocolGuid ## CONSUMES
|
||||
|
|
Loading…
Reference in New Issue