3 Copyright (c) 2004, 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
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.
18 Lib to provide status code reporting via memory.
22 #ifndef _PEI_MEMORY_STATUS_CODE_H_
23 #define _PEI_MEMORY_STATUS_CODE_H_
26 // Statements that include other files
30 #include "SimpleCpuIoLib.h"
31 #include "EfiCommonLib.h"
36 #include EFI_PPI_PRODUCER (StatusCodeMemory)
37 #include EFI_PPI_PRODUCER (StatusCode)
40 // Ppi Consumed For Notification
42 #include EFI_PPI_CONSUMER (MemoryDiscovered)
43 #if (PI_SPECIFICATION_VERSION < 0x00010000)
44 #include EFI_PPI_CONSUMER (LoadFile)
50 // Define the amount of heap to use before memory is allocated
52 #define PEI_STATUS_CODE_HEAP_LENGTH 512
53 #define PEI_STATUS_CODE_MAX_HEAP_ENTRY (PEI_STATUS_CODE_HEAP_LENGTH / sizeof (EFI_STATUS_CODE_ENTRY))
56 // Define the number of 4K pages of BS memory to allocate (1MB)
58 #define PEI_STATUS_CODE_RT_PAGES (128)
59 #define PEI_STATUS_CODE_RT_LENGTH (PEI_STATUS_CODE_RT_PAGES * 1024 * 4)
60 #define PEI_STATUS_CODE_MAX_RT_ENTRY (PEI_STATUS_CODE_RT_LENGTH / sizeof (EFI_STATUS_CODE_ENTRY))
63 // Define a private data structure
65 #define MEMORY_STATUS_CODE_SIGNATURE EFI_SIGNATURE_32 ('M', 'S', 'C', 'S')
67 typedef struct _MEMORY_STATUS_CODE_INSTANCE
{
69 struct _MEMORY_STATUS_CODE_INSTANCE
*This
;
70 EFI_FFS_FILE_HEADER
*FfsHeader
;
71 EFI_PEI_PPI_DESCRIPTOR PpiDescriptor
;
72 PEI_STATUS_CODE_MEMORY_PPI StatusCodeMemoryPpi
;
73 #if (PI_SPECIFICATION_VERSION < 0x00010000)
74 EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor
;
76 } MEMORY_STATUS_CODE_INSTANCE
;
78 #define MEMORY_STATUS_CODE_FROM_DESCRIPTOR_THIS(a) \
80 MEMORY_STATUS_CODE_INSTANCE, \
82 MEMORY_STATUS_CODE_SIGNATURE \
84 #define MEMORY_STATUS_CODE_FROM_NOTIFY_THIS(a) \
86 MEMORY_STATUS_CODE_INSTANCE, \
88 MEMORY_STATUS_CODE_SIGNATURE \
92 // Private function declarations
97 IN EFI_PEI_SERVICES
**PeiServices
,
98 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,