TianoCore EDK2 master
CpuS3Data.c File Reference

Go to the source code of this file.

Data Structures

struct  ACPI_CPU_DATA_EX
 

Functions

VOIDAllocateAcpiNvsMemory (IN UINTN Size)
 
VOIDAllocateZeroPages (IN UINTN Size)
 
VOID EFIAPI CpuS3DataOnEndOfDxe (IN EFI_EVENT Event, OUT VOID *Context)
 
EFI_STATUS EFIAPI CpuS3DataInitialize (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Detailed Description

ACPI CPU Data initialization module

This module initializes the ACPI_CPU_DATA structure and registers the address of this structure in the PcdCpuS3DataAddress PCD. This is a generic/simple version of this module. It does not provide a machine check handler or CPU register initialization tables for ACPI S3 resume. It also only supports the number of CPUs reported by the MP Services Protocol, so this module does not support hot plug CPUs. This module can be copied into a CPU specific package and customized if these additional features are required.

Copyright (c) 2013 - 2021, Intel Corporation. All rights reserved.
Copyright (c) 2015, Red Hat, Inc.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file CpuS3Data.c.

Function Documentation

◆ AllocateAcpiNvsMemory()

VOID * AllocateAcpiNvsMemory ( IN UINTN  Size)

Allocate EfiACPIMemoryNVS memory.

Parameters
[in]SizeSize of memory to allocate.
Returns
Allocated address for output.

Definition at line 52 of file CpuS3Data.c.

◆ AllocateZeroPages()

VOID * AllocateZeroPages ( IN UINTN  Size)

Allocate memory and clean it with zero.

Parameters
[in]SizeSize of memory to allocate.
Returns
Allocated address for output.

Definition at line 85 of file CpuS3Data.c.

◆ CpuS3DataInitialize()

EFI_STATUS EFIAPI CpuS3DataInitialize ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

The entry function of the CpuS3Data driver.

Allocate and initialize all fields of the ACPI_CPU_DATA structure except the MTRR settings. Register an event notification on gEfiEndOfDxeEventGroupGuid to capture the ACPI_CPU_DATA MTRR settings. The PcdCpuS3DataAddress is set to the address that ACPI_CPU_DATA is allocated at.

Parameters
[in]ImageHandleThe firmware allocated handle for the EFI image.
[in]SystemTableA pointer to the EFI System Table.
Return values
EFI_SUCCESSThe entry point is executed successfully.
EFI_UNSUPPORTEDDo not support ACPI S3.
otherSome error occurs when executing this entry point.

Definition at line 157 of file CpuS3Data.c.

◆ CpuS3DataOnEndOfDxe()

VOID EFIAPI CpuS3DataOnEndOfDxe ( IN EFI_EVENT  Event,
OUT VOID Context 
)

Callback function executed when the EndOfDxe event group is signaled.

We delay allocating StartupVector and saving the MTRR settings until BDS signals EndOfDxe.

Parameters
[in]EventEvent whose notification function is being invoked.
[out]ContextPointer to the MTRR_SETTINGS buffer to fill in.

Definition at line 109 of file CpuS3Data.c.