You've already forked slimbootloader
mirror of
https://github.com/Dasharo/slimbootloader.git
synced 2026-03-06 15:26:20 -08:00
* Sync BaseTools to align with edk2-stable202311 Keep the SBL specific change (e.g. Lz4). Signed-off-by: Guo Dong <guo.dong@intel.com> * feat: Sync MdePkg from EDK2 edk2-stable202311 branch Only sync required file without any changes to EDK2 files. Signed-off-by: Guo Dong <guo.dong@intel.com> * feat: Update MdePkg for SBL after sync from EDK2 Signed-off-by: Guo Dong <guo.dong@intel.com> * Update SBL after updating Basetool and MdePkg After Sync BaseTool and MdePkg to edk2-stable202311, Need update SBL code to align with this change. Signed-off-by: Guo Dong <guo.dong@intel.com> * feat: rollback some changes after mdepkg sync New change from MdePkg requires new NASM version. To make sure NASM 2.14.02 still works, just rollback few changes. Signed-off-by: Guo Dong <guo.dong@intel.com> * feat: Update component size to fix build failure After syncing BaseTool and MdePkg, some components would have a little bigger size. So update the config to fix the build failure. Signed-off-by: Guo Dong <guo.dong@intel.com> * feat: Remove unused asl code Some ASL files don't exist but they are included in other asl files. It would cause build failure with new build BaseTool. So just remove them to fix the build failure. Signed-off-by: Guo Dong <guo.dong@intel.com> --------- Signed-off-by: Guo Dong <guo.dong@intel.com>
80 lines
1.5 KiB
C
80 lines
1.5 KiB
C
/** @file
|
|
Header file for helper functions useful for accessing files.
|
|
|
|
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
|
|
**/
|
|
|
|
#ifndef _EFI_MEMORY_FILE_H
|
|
#define _EFI_MEMORY_FILE_H
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <Common/UefiBaseTypes.h>
|
|
|
|
//
|
|
// Common data structures
|
|
//
|
|
typedef struct {
|
|
CHAR8 *FileImage;
|
|
CHAR8 *Eof;
|
|
CHAR8 *CurrentFilePointer;
|
|
} MEMORY_FILE;
|
|
|
|
|
|
//
|
|
// Functions declarations
|
|
//
|
|
|
|
/**
|
|
This opens a file, reads it into memory and returns a memory file
|
|
object.
|
|
|
|
@param InputFile Memory file image.
|
|
@param OutputMemoryFile Handle to memory file
|
|
|
|
@return EFI_STATUS
|
|
OutputMemoryFile is valid if !EFI_ERROR
|
|
**/
|
|
EFI_STATUS
|
|
GetMemoryFile (
|
|
IN CHAR8 *InputFileName,
|
|
OUT EFI_HANDLE *OutputMemoryFile
|
|
)
|
|
;
|
|
|
|
/**
|
|
Frees all memory associated with the input memory file.
|
|
|
|
@param InputMemoryFile Handle to memory file
|
|
|
|
@return EFI_STATUS
|
|
**/
|
|
EFI_STATUS
|
|
FreeMemoryFile (
|
|
IN EFI_HANDLE InputMemoryFile
|
|
)
|
|
;
|
|
|
|
/**
|
|
This function reads a line from the memory file. The newline characters
|
|
are stripped and a null terminated string is returned.
|
|
|
|
If the string pointer returned is non-NULL, then the caller must free the
|
|
memory associated with this string.
|
|
|
|
@param InputMemoryFile Handle to memory file
|
|
|
|
@retval NULL if error or EOF
|
|
@retval NULL character termincated string otherwise (MUST BE FREED BY CALLER)
|
|
**/
|
|
CHAR8 *
|
|
ReadMemoryFileLine (
|
|
IN EFI_HANDLE InputMemoryFile
|
|
)
|
|
;
|
|
|
|
|
|
#endif
|