]> git.proxmox.com Git - mirror_edk2.git/blob - EdkModulePkg/Library/EdkMemoryStatusCodeLib/MemoryStatusCode.h
1. adjust contents layout of SPD header editor, FPD header editor.
[mirror_edk2.git] / EdkModulePkg / Library / EdkMemoryStatusCodeLib / MemoryStatusCode.h
1 /*++
2
3 Copyright (c) 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 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 // Publicly exported function
27 //
28 EFI_STATUS
29 EFIAPI
30 InstallMonoStatusCode (
31 IN EFI_FFS_FILE_HEADER *FfsHeader,
32 IN EFI_PEI_SERVICES **PeiServices
33 )
34 ;
35 //
36 // Publicly exported data
37 //
38 extern BOOLEAN gRunningFromMemory;
39 //
40 // Private data
41 //
42 //
43 // Define the amount of heap to use before memory is allocated
44 //
45 #define PEI_STATUS_CODE_HEAP_LENGTH 512
46 #define PEI_STATUS_CODE_MAX_HEAP_ENTRY (PEI_STATUS_CODE_HEAP_LENGTH / sizeof (EFI_STATUS_CODE_ENTRY))
47
48 //
49 // Define the number of 4K pages of BS memory to allocate (1MB)
50 //
51 #define PEI_STATUS_CODE_RT_PAGES (128)
52 #define PEI_STATUS_CODE_RT_LENGTH (PEI_STATUS_CODE_RT_PAGES * 1024 * 4)
53 #define PEI_STATUS_CODE_MAX_RT_ENTRY (PEI_STATUS_CODE_RT_LENGTH / sizeof (EFI_STATUS_CODE_ENTRY))
54
55 //
56 // Define a private data structure
57 //
58 #define MEMORY_STATUS_CODE_SIGNATURE EFI_SIGNATURE_32 ('M', 'S', 'C', 'S')
59
60 typedef struct _MEMORY_STATUS_CODE_INSTANCE {
61 UINT32 Signature;
62 struct _MEMORY_STATUS_CODE_INSTANCE *This;
63 EFI_FFS_FILE_HEADER *FfsHeader;
64 EFI_PEI_PPI_DESCRIPTOR PpiDescriptor;
65 PEI_STATUS_CODE_MEMORY_PPI StatusCodeMemoryPpi;
66 EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor;
67 } MEMORY_STATUS_CODE_INSTANCE;
68
69 #define MEMORY_STATUS_CODE_FROM_DESCRIPTOR_THIS(a) \
70 PEI_CR (a, \
71 MEMORY_STATUS_CODE_INSTANCE, \
72 PpiDescriptor, \
73 MEMORY_STATUS_CODE_SIGNATURE \
74 )
75 #define MEMORY_STATUS_CODE_FROM_NOTIFY_THIS(a) \
76 PEI_CR (a, \
77 MEMORY_STATUS_CODE_INSTANCE, \
78 NotifyDescriptor, \
79 MEMORY_STATUS_CODE_SIGNATURE \
80 )
81
82 //
83 // Private function declarations
84 //
85 EFI_STATUS
86 EFIAPI
87 LoadImageCallback (
88 IN EFI_PEI_SERVICES **PeiServices,
89 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,
90 IN VOID *Ppi
91 )
92 ;
93
94 #endif