]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.c
MdePkg: Clean up source files
[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
LG
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php.\r
e386b444 9\r
9095d37b
LG
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
e386b444 12\r
e386b444 13**/\r
14\r
15\r
c892d846 16\r
c7d265a9 17#include <PiPei.h>\r
c892d846 18\r
19\r
c7d265a9 20#include <Library/ResourcePublicationLib.h>\r
21#include <Library/PeiServicesLib.h>\r
22#include <Library/DebugLib.h>\r
23\r
e386b444 24\r
25/**\r
e386b444 26 Declares the presence of permanent system memory in the platform.\r
27\r
28 Declares that the system memory buffer specified by MemoryBegin and MemoryLength\r
29 as permanent memory that may be used for general purpose use by software.\r
30 The amount of memory available to software may be less than MemoryLength\r
9095d37b 31 if published memory has alignment restrictions.\r
e934a741 32 If MemoryLength is 0, then ASSERT().\r
9095d37b 33 If MemoryLength is greater than (MAX_ADDRESS - MemoryBegin + 1), then ASSERT().\r
e386b444 34\r
35 @param MemoryBegin The start address of the memory being declared.\r
36 @param MemoryLength The number of bytes of memory being declared.\r
37\r
38 @retval RETURN_SUCCESS The memory buffer was published.\r
39 @retval RETURN_OUT_OF_RESOURCES There are not enough resources to publish the memory buffer\r
40\r
41**/\r
42RETURN_STATUS\r
43EFIAPI\r
44PublishSystemMemory (\r
45 IN PHYSICAL_ADDRESS MemoryBegin,\r
46 IN UINT64 MemoryLength\r
47 )\r
48{\r
49 EFI_STATUS Status;\r
50\r
51 ASSERT (MemoryLength > 0);\r
52 ASSERT (MemoryLength <= (MAX_ADDRESS - MemoryBegin + 1));\r
53\r
54 Status = PeiServicesInstallPeiMemory (MemoryBegin, MemoryLength);\r
9095d37b 55\r
e386b444 56 return (RETURN_STATUS) Status;\r
57}\r
58\r