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