summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg/Sample/Platform/Generic/MonoStatusCode/Library/Pei/MemoryStatusCode/MemoryStatusCode.h
diff options
context:
space:
mode:
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2007-06-28 07:12:34 +0000
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2007-06-28 07:12:34 +0000
commitb38907a6d41515f48fe01a7c3d7c6b84b269926b (patch)
tree9897316f81d7e141a3722725f7a7138f97646a37 /EdkCompatibilityPkg/Sample/Platform/Generic/MonoStatusCode/Library/Pei/MemoryStatusCode/MemoryStatusCode.h
parent3eb9473ea9a949badfe06ae61d2d3fcfa53651c7 (diff)
downloadedk2-platforms-b38907a6d41515f48fe01a7c3d7c6b84b269926b.tar.xz
Add in more library for ECP.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2833 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Sample/Platform/Generic/MonoStatusCode/Library/Pei/MemoryStatusCode/MemoryStatusCode.h')
-rw-r--r--EdkCompatibilityPkg/Sample/Platform/Generic/MonoStatusCode/Library/Pei/MemoryStatusCode/MemoryStatusCode.h103
1 files changed, 103 insertions, 0 deletions
diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/MonoStatusCode/Library/Pei/MemoryStatusCode/MemoryStatusCode.h b/EdkCompatibilityPkg/Sample/Platform/Generic/MonoStatusCode/Library/Pei/MemoryStatusCode/MemoryStatusCode.h
new file mode 100644
index 0000000000..b6660b0452
--- /dev/null
+++ b/EdkCompatibilityPkg/Sample/Platform/Generic/MonoStatusCode/Library/Pei/MemoryStatusCode/MemoryStatusCode.h
@@ -0,0 +1,103 @@
+/*++
+
+Copyright (c) 2004, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+Module Name:
+
+ MemoryStatusCode.h
+
+Abstract:
+
+ Lib to provide status code reporting via memory.
+
+--*/
+
+#ifndef _PEI_MEMORY_STATUS_CODE_H_
+#define _PEI_MEMORY_STATUS_CODE_H_
+
+//
+// Statements that include other files
+//
+#include "Tiano.h"
+#include "Pei.h"
+#include "SimpleCpuIoLib.h"
+#include "EfiCommonLib.h"
+
+//
+// Produced PPI
+//
+#include EFI_PPI_PRODUCER (StatusCodeMemory)
+#include EFI_PPI_PRODUCER (StatusCode)
+
+//
+// Ppi Consumed For Notification
+//
+#include EFI_PPI_CONSUMER (MemoryDiscovered)
+#if (PI_SPECIFICATION_VERSION < 0x00010000)
+#include EFI_PPI_CONSUMER (LoadFile)
+#endif
+//
+// Private data
+//
+//
+// Define the amount of heap to use before memory is allocated
+//
+#define PEI_STATUS_CODE_HEAP_LENGTH 512
+#define PEI_STATUS_CODE_MAX_HEAP_ENTRY (PEI_STATUS_CODE_HEAP_LENGTH / sizeof (EFI_STATUS_CODE_ENTRY))
+
+//
+// Define the number of 4K pages of BS memory to allocate (1MB)
+//
+#define PEI_STATUS_CODE_RT_PAGES (128)
+#define PEI_STATUS_CODE_RT_LENGTH (PEI_STATUS_CODE_RT_PAGES * 1024 * 4)
+#define PEI_STATUS_CODE_MAX_RT_ENTRY (PEI_STATUS_CODE_RT_LENGTH / sizeof (EFI_STATUS_CODE_ENTRY))
+
+//
+// Define a private data structure
+//
+#define MEMORY_STATUS_CODE_SIGNATURE EFI_SIGNATURE_32 ('M', 'S', 'C', 'S')
+
+typedef struct _MEMORY_STATUS_CODE_INSTANCE {
+ UINT32 Signature;
+ struct _MEMORY_STATUS_CODE_INSTANCE *This;
+ EFI_FFS_FILE_HEADER *FfsHeader;
+ EFI_PEI_PPI_DESCRIPTOR PpiDescriptor;
+ PEI_STATUS_CODE_MEMORY_PPI StatusCodeMemoryPpi;
+#if (PI_SPECIFICATION_VERSION < 0x00010000)
+ EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor;
+#endif
+} MEMORY_STATUS_CODE_INSTANCE;
+
+#define MEMORY_STATUS_CODE_FROM_DESCRIPTOR_THIS(a) \
+ PEI_CR (a, \
+ MEMORY_STATUS_CODE_INSTANCE, \
+ PpiDescriptor, \
+ MEMORY_STATUS_CODE_SIGNATURE \
+ )
+#define MEMORY_STATUS_CODE_FROM_NOTIFY_THIS(a) \
+ PEI_CR (a, \
+ MEMORY_STATUS_CODE_INSTANCE, \
+ NotifyDescriptor, \
+ MEMORY_STATUS_CODE_SIGNATURE \
+ )
+
+//
+// Private function declarations
+//
+EFI_STATUS
+EFIAPI
+LoadImageCallback (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,
+ IN VOID *Ppi
+ )
+;
+
+#endif