]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Sample/Platform/Generic/MonoStatusCode/Library/Pei/MemoryStatusCode/MemoryStatusCode.h
Add in more library for ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Sample / Platform / Generic / MonoStatusCode / Library / Pei / MemoryStatusCode / MemoryStatusCode.h
1 /*++
2
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
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 Module Name:
13
14 MemoryStatusCode.h
15
16 Abstract:
17
18 Lib to provide status code reporting via memory.
19
20 --*/
21
22 #ifndef _PEI_MEMORY_STATUS_CODE_H_
23 #define _PEI_MEMORY_STATUS_CODE_H_
24
25 //
26 // Statements that include other files
27 //
28 #include "Tiano.h"
29 #include "Pei.h"
30 #include "SimpleCpuIoLib.h"
31 #include "EfiCommonLib.h"
32
33 //
34 // Produced PPI
35 //
36 #include EFI_PPI_PRODUCER (StatusCodeMemory)
37 #include EFI_PPI_PRODUCER (StatusCode)
38
39 //
40 // Ppi Consumed For Notification
41 //
42 #include EFI_PPI_CONSUMER (MemoryDiscovered)
43 #if (PI_SPECIFICATION_VERSION < 0x00010000)
44 #include EFI_PPI_CONSUMER (LoadFile)
45 #endif
46 //
47 // Private data
48 //
49 //
50 // Define the amount of heap to use before memory is allocated
51 //
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))
54
55 //
56 // Define the number of 4K pages of BS memory to allocate (1MB)
57 //
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))
61
62 //
63 // Define a private data structure
64 //
65 #define MEMORY_STATUS_CODE_SIGNATURE EFI_SIGNATURE_32 ('M', 'S', 'C', 'S')
66
67 typedef struct _MEMORY_STATUS_CODE_INSTANCE {
68 UINT32 Signature;
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;
75 #endif
76 } MEMORY_STATUS_CODE_INSTANCE;
77
78 #define MEMORY_STATUS_CODE_FROM_DESCRIPTOR_THIS(a) \
79 PEI_CR (a, \
80 MEMORY_STATUS_CODE_INSTANCE, \
81 PpiDescriptor, \
82 MEMORY_STATUS_CODE_SIGNATURE \
83 )
84 #define MEMORY_STATUS_CODE_FROM_NOTIFY_THIS(a) \
85 PEI_CR (a, \
86 MEMORY_STATUS_CODE_INSTANCE, \
87 NotifyDescriptor, \
88 MEMORY_STATUS_CODE_SIGNATURE \
89 )
90
91 //
92 // Private function declarations
93 //
94 EFI_STATUS
95 EFIAPI
96 LoadImageCallback (
97 IN EFI_PEI_SERVICES **PeiServices,
98 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,
99 IN VOID *Ppi
100 )
101 ;
102
103 #endif