]>
Commit | Line | Data |
---|---|---|
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 | |
c7d265a9 | 9 | #include <PiPei.h>\r |
c892d846 | 10 | \r |
c7d265a9 | 11 | #include <Library/ResourcePublicationLib.h>\r |
12 | #include <Library/PeiServicesLib.h>\r | |
13 | #include <Library/DebugLib.h>\r | |
14 | \r | |
e386b444 | 15 | /**\r |
e386b444 | 16 | Declares the presence of permanent system memory in the platform.\r |
17 | \r | |
18 | Declares that the system memory buffer specified by MemoryBegin and MemoryLength\r | |
19 | as permanent memory that may be used for general purpose use by software.\r | |
20 | The amount of memory available to software may be less than MemoryLength\r | |
9095d37b | 21 | if published memory has alignment restrictions.\r |
e934a741 | 22 | If MemoryLength is 0, then ASSERT().\r |
9095d37b | 23 | If MemoryLength is greater than (MAX_ADDRESS - MemoryBegin + 1), then ASSERT().\r |
e386b444 | 24 | \r |
25 | @param MemoryBegin The start address of the memory being declared.\r | |
26 | @param MemoryLength The number of bytes of memory being declared.\r | |
27 | \r | |
28 | @retval RETURN_SUCCESS The memory buffer was published.\r | |
29 | @retval RETURN_OUT_OF_RESOURCES There are not enough resources to publish the memory buffer\r | |
30 | \r | |
31 | **/\r | |
32 | RETURN_STATUS\r | |
33 | EFIAPI\r | |
34 | PublishSystemMemory (\r | |
2f88bd3a MK |
35 | IN PHYSICAL_ADDRESS MemoryBegin,\r |
36 | IN UINT64 MemoryLength\r | |
e386b444 | 37 | )\r |
38 | {\r | |
2f88bd3a | 39 | EFI_STATUS Status;\r |
e386b444 | 40 | \r |
41 | ASSERT (MemoryLength > 0);\r | |
42 | ASSERT (MemoryLength <= (MAX_ADDRESS - MemoryBegin + 1));\r | |
43 | \r | |
2f88bd3a | 44 | Status = PeiServicesInstallPeiMemory (MemoryBegin, MemoryLength);\r |
9095d37b | 45 | \r |
2f88bd3a | 46 | return (RETURN_STATUS)Status;\r |
e386b444 | 47 | }\r |