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
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 // Publicly exported function
30 InstallMonoStatusCode (
31 IN EFI_FFS_FILE_HEADER
*FfsHeader
,
32 IN EFI_PEI_SERVICES
**PeiServices
36 // Publicly exported data
38 extern BOOLEAN gRunningFromMemory
;
43 // Define the amount of heap to use before memory is allocated
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))
49 // Define the number of 4K pages of BS memory to allocate (1MB)
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))
56 // Define a private data structure
58 #define MEMORY_STATUS_CODE_SIGNATURE EFI_SIGNATURE_32 ('M', 'S', 'C', 'S')
60 typedef struct _MEMORY_STATUS_CODE_INSTANCE
{
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
;
69 #define MEMORY_STATUS_CODE_FROM_DESCRIPTOR_THIS(a) \
71 MEMORY_STATUS_CODE_INSTANCE, \
73 MEMORY_STATUS_CODE_SIGNATURE \
75 #define MEMORY_STATUS_CODE_FROM_NOTIFY_THIS(a) \
77 MEMORY_STATUS_CODE_INSTANCE, \
79 MEMORY_STATUS_CODE_SIGNATURE \
83 // Private function declarations
88 IN EFI_PEI_SERVICES
**PeiServices
,
89 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,