]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.c
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / PeiResourcePublicationLib / PeiResourcePublicationLib.c
CommitLineData
e386b444 1/** @file\r
2 Resource Publication Library that uses PEI Core Services to publish system memory.\r
3\r
9095d37b 4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
e386b444 6\r
e386b444 7**/\r
8\r
9\r
c892d846 10\r
c7d265a9 11#include <PiPei.h>\r
c892d846 12\r
13\r
c7d265a9 14#include <Library/ResourcePublicationLib.h>\r
15#include <Library/PeiServicesLib.h>\r
16#include <Library/DebugLib.h>\r
17\r
e386b444 18\r
19/**\r
e386b444 20 Declares the presence of permanent system memory in the platform.\r
21\r
22 Declares that the system memory buffer specified by MemoryBegin and MemoryLength\r
23 as permanent memory that may be used for general purpose use by software.\r
24 The amount of memory available to software may be less than MemoryLength\r
9095d37b 25 if published memory has alignment restrictions.\r
e934a741 26 If MemoryLength is 0, then ASSERT().\r
9095d37b 27 If MemoryLength is greater than (MAX_ADDRESS - MemoryBegin + 1), then ASSERT().\r
e386b444 28\r
29 @param MemoryBegin The start address of the memory being declared.\r
30 @param MemoryLength The number of bytes of memory being declared.\r
31\r
32 @retval RETURN_SUCCESS The memory buffer was published.\r
33 @retval RETURN_OUT_OF_RESOURCES There are not enough resources to publish the memory buffer\r
34\r
35**/\r
36RETURN_STATUS\r
37EFIAPI\r
38PublishSystemMemory (\r
39 IN PHYSICAL_ADDRESS MemoryBegin,\r
40 IN UINT64 MemoryLength\r
41 )\r
42{\r
43 EFI_STATUS Status;\r
44\r
45 ASSERT (MemoryLength > 0);\r
46 ASSERT (MemoryLength <= (MAX_ADDRESS - MemoryBegin + 1));\r
47\r
48 Status = PeiServicesInstallPeiMemory (MemoryBegin, MemoryLength);\r
9095d37b 49\r
e386b444 50 return (RETURN_STATUS) Status;\r
51}\r
52\r