15extern BOOLEAN HBufferImageNeedRefresh;
16extern BOOLEAN HBufferImageOnlyLineNeedRefresh;
17extern BOOLEAN HBufferImageMouseNeedRefresh;
49 CopyMem (&HMemImage, &HMemImageConst,
sizeof (HMemImage));
51 Status =
gBS->LocateProtocol (
52 &gEfiCpuIo2ProtocolGuid,
54 (VOID **)&HMemImage.IoFncs
56 if (!EFI_ERROR (Status)) {
59 return EFI_LOAD_ERROR;
74 HMemImageBackupVar.Offset = HMemImage.Offset;
75 HMemImageBackupVar.Size = HMemImage.Size;
95 HMemImage.Offset = Offset;
96 HMemImage.Size = Size;
124 HBufferImage.BufferType = FileTypeMemBuffer;
127 if (Buffer ==
NULL) {
129 return EFI_OUT_OF_RESOURCES;
132 Status = HMemImage.IoFncs->
Mem.
Read (
140 if (EFI_ERROR (Status)) {
143 return EFI_LOAD_ERROR;
151 if (EFI_ERROR (Status)) {
158 HBufferImage.DisplayPosition.Row = 2;
159 HBufferImage.DisplayPosition.Column = 10;
161 HBufferImage.MousePosition.Row = 2;
162 HBufferImage.MousePosition.Column = 10;
164 HBufferImage.LowVisibleRow = 1;
165 HBufferImage.HighBits =
TRUE;
167 HBufferImage.BufferPosition.Row = 1;
168 HBufferImage.BufferPosition.Column = 1;
171 Str =
CatSPrint (
NULL, L
"%d Lines Read", HBufferImage.NumLines);
174 return EFI_OUT_OF_RESOURCES;
178 SHELL_FREE_NON_NULL (Str);
180 HMainEditor.SelectStart = 0;
181 HMainEditor.SelectEnd = 0;
187 if (HBufferImage.Lines !=
NULL) {
188 HBufferImage.CurrentLine =
CR (HBufferImage.ListHead->ForwardLink,
HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
196 return EFI_OUT_OF_RESOURCES;
199 HBufferImage.CurrentLine = Line;
202 HBufferImage.Modified =
FALSE;
203 HBufferImageNeedRefresh =
TRUE;
204 HBufferImageOnlyLineNeedRefresh =
FALSE;
205 HBufferImageMouseNeedRefresh =
TRUE;
232 if (HBufferImage.Modified ==
FALSE) {
236 HBufferImage.BufferType = FileTypeMemBuffer;
240 if (Buffer ==
NULL) {
241 return EFI_OUT_OF_RESOURCES;
245 if (EFI_ERROR (Status)) {
253 Status = HMemImage.IoFncs->
Mem.
Write (
263 if (EFI_ERROR (Status)) {
264 return EFI_LOAD_ERROR;
270 HBufferImage.Modified =
FALSE;
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
EFI_STATUS HBufferImageFree(VOID)
EFI_STATUS HBufferImageListToBuffer(IN VOID *Buffer, IN UINTN Bytes)
EFI_STATUS HBufferImageBufferToList(IN VOID *Buffer, IN UINTN Bytes)
HEFI_EDITOR_LINE * HBufferImageCreateLine(VOID)
EFI_STATUS StatusBarSetStatusString(IN CHAR16 *Str)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define CR(Record, TYPE, Field, TestSignature)
EFI_STATUS HMemImageSetMemOffsetSize(IN UINTN Offset, IN UINTN Size)
EFI_STATUS HMemImageSave(IN UINTN Offset, IN UINTN Size)
EFI_STATUS HMemImageInit(VOID)
EFI_STATUS HMemImageRead(IN UINTN Offset, IN UINTN Size, IN BOOLEAN Recover)
EFI_STATUS HMemImageBackup(VOID)
CHAR16 *EFIAPI CatSPrint(IN CHAR16 *String OPTIONAL, IN CONST CHAR16 *FormatString,...)
EFI_CPU_IO_PROTOCOL_ACCESS Mem
EFI_CPU_IO_PROTOCOL_IO_MEM Read
EFI_CPU_IO_PROTOCOL_IO_MEM Write