]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.c
Since PciXXXReadBuffer/PciXXXWriteBuffer does not check the alignment of user buffer...
[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
4 Copyright (c) 2006, Intel Corporation<BR>\r
5 All rights reserved. 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
9\r
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
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
26 \r
27 Declares the presence of permanent system memory in the platform.\r
28\r
29 Declares that the system memory buffer specified by MemoryBegin and MemoryLength\r
30 as permanent memory that may be used for general purpose use by software.\r
31 The amount of memory available to software may be less than MemoryLength\r
32 if published memory has alignment restrictions. \r
33\r
34 @param MemoryBegin The start address of the memory being declared.\r
35 @param MemoryLength The number of bytes of memory being declared.\r
36\r
37 @retval RETURN_SUCCESS The memory buffer was published.\r
38 @retval RETURN_OUT_OF_RESOURCES There are not enough resources to publish the memory buffer\r
39\r
40**/\r
41RETURN_STATUS\r
42EFIAPI\r
43PublishSystemMemory (\r
44 IN PHYSICAL_ADDRESS MemoryBegin,\r
45 IN UINT64 MemoryLength\r
46 )\r
47{\r
48 EFI_STATUS Status;\r
49\r
50 ASSERT (MemoryLength > 0);\r
51 ASSERT (MemoryLength <= (MAX_ADDRESS - MemoryBegin + 1));\r
52\r
53 Status = PeiServicesInstallPeiMemory (MemoryBegin, MemoryLength);\r
54 \r
55 return (RETURN_STATUS) Status;\r
56}\r
57\r