Final switch to C++ compiler

This commit is contained in:
jief 2020-02-17 23:41:09 +03:00
parent 15a4ba4694
commit 7fa464fde0
105 changed files with 692 additions and 618 deletions

4
.gitignore vendored
View File

@ -117,8 +117,8 @@ CloverPrefpane.strings
#CloverPackage/CloverPrefpane/src/*.lproj #CloverPackage/CloverPrefpane/src/*.lproj
BaseTools/Source/Python/build/BuildReport.pyc BaseTools/Source/Python/build/BuildReport.pyc
Conf/BuildEnv.sh
Conf/.AutoGenIdFile.txt
CloverPackage/revision CloverPackage/revision
CloverPackage/version CloverPackage/version
tools tools
/Conf/

View File

@ -686,5 +686,6 @@ DEFINE BUILD_OPTIONS=-DMDEPKG_NDEBUG -DCLOVER_BUILD $(VBIOS_PATCH_CLOVEREFI_FLAG
XCODE:*_*_*_CC_FLAGS = -fno-unwind-tables -Wno-msvc-include -Os $(BUILD_OPTIONS) $(DISABLE_LTO_FLAG) XCODE:*_*_*_CC_FLAGS = -fno-unwind-tables -Wno-msvc-include -Os $(BUILD_OPTIONS) $(DISABLE_LTO_FLAG)
GCC:*_*_*_CC_FLAGS = $(BUILD_OPTIONS) $(DISABLE_LTO_FLAG) GCC:*_*_*_CC_FLAGS = $(BUILD_OPTIONS) $(DISABLE_LTO_FLAG)
GCC:*_*_*_CXX_FLAGS = $(BUILD_OPTIONS) $(DISABLE_LTO_FLAG)
#-Wunused-but-set-variable #-Wunused-but-set-variable
# -Os -fno-omit-frame-pointer -maccumulate-outgoing-args # -Os -fno-omit-frame-pointer -maccumulate-outgoing-args

View File

@ -589,7 +589,7 @@ typedef struct {
typedef typedef
VOID VOID
(*DEV_PATH_FUNCTION) ( (*DEV_PATH_FUNCTION_VOID) (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN VOID *DevPath
); );
@ -597,7 +597,7 @@ VOID
typedef struct { typedef struct {
UINT8 Type; UINT8 Type;
UINT8 SubType; UINT8 SubType;
DEV_PATH_FUNCTION Function; DEV_PATH_FUNCTION_VOID Function;
} DEVICE_PATH_STRING_TABLE; } DEVICE_PATH_STRING_TABLE;
typedef struct { typedef struct {
@ -1067,7 +1067,7 @@ CHAR16 *
EFIAPI EFIAPI
CatPrint ( CatPrint (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN CHAR16 *Fmt, IN CONST CHAR16 *Fmt,
... ...
); );

View File

@ -318,6 +318,9 @@ struct _LIST_ENTRY {
/// Datum is read-only. /// Datum is read-only.
/// ///
#define CONST const #define CONST const
#ifndef JCONST
#define JCONST
#endif
/// ///
/// Datum is scoped to the current file or function. /// Datum is scoped to the current file or function.

View File

@ -481,7 +481,7 @@ ReallocateReservedPool (
VOID VOID
EFIAPI EFIAPI
FreePool ( FreePool (
IN VOID *Buffer IN JCONST VOID *Buffer
); );
#endif #endif

View File

@ -113,9 +113,9 @@ struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL {
typedef typedef
EFI_STATUS EFI_STATUS
(EFIAPI *EFI_FILE_OPEN)( (EFIAPI *EFI_FILE_OPEN)(
IN EFI_FILE_PROTOCOL *This, IN JCONST EFI_FILE_PROTOCOL *This,
OUT EFI_FILE_PROTOCOL **NewHandle, OUT EFI_FILE_PROTOCOL **NewHandle,
IN CHAR16 *FileName, IN JCONST CHAR16 *FileName,
IN UINT64 OpenMode, IN UINT64 OpenMode,
IN UINT64 Attributes IN UINT64 Attributes
); );

View File

@ -191,7 +191,7 @@ typedef
EFI_STATUS EFI_STATUS
(EFIAPI *EFI_TEXT_STRING)( (EFIAPI *EFI_TEXT_STRING)(
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
IN CHAR16 *String IN JCONST CHAR16 *String
); );
/** /**

View File

@ -78,8 +78,8 @@ typedef
BOOLEAN BOOLEAN
(EFIAPI *EFI_UNICODE_COLLATION_METAIMATCH)( (EFIAPI *EFI_UNICODE_COLLATION_METAIMATCH)(
IN EFI_UNICODE_COLLATION_PROTOCOL *This, IN EFI_UNICODE_COLLATION_PROTOCOL *This,
IN CHAR16 *String, IN JCONST CHAR16 *String,
IN CHAR16 *Pattern IN JCONST CHAR16 *Pattern
); );
/** /**

View File

@ -645,7 +645,7 @@ VOID
typedef typedef
EFI_STATUS EFI_STATUS
(EFIAPI *EFI_GET_VARIABLE)( (EFIAPI *EFI_GET_VARIABLE)(
IN CHAR16 *VariableName, IN JCONST CHAR16 *VariableName,
IN EFI_GUID *VendorGuid, IN EFI_GUID *VendorGuid,
OUT UINT32 *Attributes, OPTIONAL OUT UINT32 *Attributes, OPTIONAL
IN OUT UINTN *DataSize, IN OUT UINTN *DataSize,
@ -723,7 +723,7 @@ EFI_STATUS
typedef typedef
EFI_STATUS EFI_STATUS
(EFIAPI *EFI_SET_VARIABLE)( (EFIAPI *EFI_SET_VARIABLE)(
IN CHAR16 *VariableName, IN JCONST CHAR16 *VariableName,
IN EFI_GUID *VendorGuid, IN EFI_GUID *VendorGuid,
IN UINT32 Attributes, IN UINT32 Attributes,
IN UINTN DataSize, IN UINTN DataSize,

View File

@ -730,7 +730,7 @@ void PostCleanupXSDT()
/** Saves Buffer of Length to disk as DirName\\FileName. */ /** Saves Buffer of Length to disk as DirName\\FileName. */
EFI_STATUS SaveBufferToDisk(VOID *Buffer, UINTN Length, CHAR16 *DirName, CHAR16 *FileName) EFI_STATUS SaveBufferToDisk(VOID *Buffer, UINTN Length, CONST CHAR16 *DirName, CONST CHAR16 *FileName)
{ {
if (DirName == NULL || FileName == NULL) { if (DirName == NULL || FileName == NULL) {
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
@ -838,7 +838,7 @@ STATIC UINT8 NameCSDT2[] = {0x80, 0x43, 0x53, 0x44, 0x54};
//UINT32 get_size(UINT8 * An, UINT32 ); // Let borrow from FixBiosDsdt. //UINT32 get_size(UINT8 * An, UINT32 ); // Let borrow from FixBiosDsdt.
static CHAR16* GenerateFileName(CHAR16* FileNamePrefix, UINTN SsdtCount, UINTN ChildCount, CHAR8 OemTableId[9]) static CHAR16* GenerateFileName(CONST CHAR16* FileNamePrefix, UINTN SsdtCount, UINTN ChildCount, CHAR8 OemTableId[9])
// ChildCount == IGNORE_INDEX indicates normal SSDT // ChildCount == IGNORE_INDEX indicates normal SSDT
// SsdtCount == IGNORE_INDEX indicates dynamic SSDT in DSDT // SsdtCount == IGNORE_INDEX indicates dynamic SSDT in DSDT
// otherwise is child SSDT from normal SSDT // otherwise is child SSDT from normal SSDT
@ -865,7 +865,7 @@ static CHAR16* GenerateFileName(CHAR16* FileNamePrefix, UINTN SsdtCount, UINTN C
return FileName; return FileName;
} }
VOID DumpChildSsdt(EFI_ACPI_DESCRIPTION_HEADER *TableEntry, CHAR16 *DirName, CHAR16 *FileNamePrefix, UINTN SsdtCount) VOID DumpChildSsdt(EFI_ACPI_DESCRIPTION_HEADER *TableEntry, CONST CHAR16 *DirName, CONST CHAR16 *FileNamePrefix, UINTN SsdtCount)
{ {
EFI_STATUS Status = EFI_SUCCESS; EFI_STATUS Status = EFI_SUCCESS;
INTN j, k, pacLen, pacCount; INTN j, k, pacLen, pacCount;
@ -995,7 +995,7 @@ VOID DumpChildSsdt(EFI_ACPI_DESCRIPTION_HEADER *TableEntry, CHAR16 *DirName, CHA
/** Saves Table to disk as DirName\\FileName (DirName != NULL) /** Saves Table to disk as DirName\\FileName (DirName != NULL)
* or just prints basic table data to log (DirName == NULL). * or just prints basic table data to log (DirName == NULL).
*/ */
EFI_STATUS DumpTable(EFI_ACPI_DESCRIPTION_HEADER *TableEntry, CHAR8 *CheckSignature, CHAR16 *DirName, CHAR16 *FileName, CHAR16 *FileNamePrefix, INTN *SsdtCount) EFI_STATUS DumpTable(EFI_ACPI_DESCRIPTION_HEADER *TableEntry, CONST CHAR8 *CheckSignature, CONST CHAR16 *DirName, CONST CHAR16 *FileName, CONST CHAR16 *FileNamePrefix, INTN *SsdtCount)
{ {
EFI_STATUS Status; EFI_STATUS Status;
CHAR8 Signature[5]; CHAR8 Signature[5];
@ -1095,7 +1095,7 @@ EFI_STATUS DumpTable(EFI_ACPI_DESCRIPTION_HEADER *TableEntry, CHAR8 *CheckSignat
} }
/** Saves to disk (DirName != NULL) or prints to log (DirName == NULL) Fadt tables: Dsdt and Facs. */ /** Saves to disk (DirName != NULL) or prints to log (DirName == NULL) Fadt tables: Dsdt and Facs. */
EFI_STATUS DumpFadtTables(EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt, CHAR16 *DirName, CHAR16 *FileNamePrefix, INTN *SsdtCount) EFI_STATUS DumpFadtTables(EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt, CONST CHAR16 *DirName, CONST CHAR16 *FileNamePrefix, INTN *SsdtCount)
{ {
EFI_ACPI_DESCRIPTION_HEADER *TableEntry; EFI_ACPI_DESCRIPTION_HEADER *TableEntry;
EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *Facs; EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *Facs;
@ -1243,7 +1243,7 @@ VOID DumpTables(VOID *RsdPtrVoid, CHAR16 *DirName)
EFI_STATUS Status; EFI_STATUS Status;
UINTN Length; UINTN Length;
INTN SsdtCount; INTN SsdtCount;
CHAR16 *FileNamePrefix; CONST CHAR16 *FileNamePrefix;
// //
// RSDP // RSDP
// Take it as Acpi 2.0, but take care that if RsdPtr->Revision == 0 // Take it as Acpi 2.0, but take care that if RsdPtr->Revision == 0
@ -1506,7 +1506,7 @@ VOID SaveOemDsdt(BOOLEAN FullPatch)
UINTN DsdtLen = 0; UINTN DsdtLen = 0;
CHAR16* OriginDsdt = PoolPrint(L"%s\\ACPI\\origin\\DSDT.aml", OEMPath); CHAR16* OriginDsdt = PoolPrint(L"%s\\ACPI\\origin\\DSDT.aml", OEMPath);
CHAR16* OriginDsdtFixed = PoolPrint(L"%s\\ACPI\\origin\\DSDT-%x.aml", OEMPath, gSettings.FixDsdt); CHAR16* OriginDsdtFixed = PoolPrint(L"%s\\ACPI\\origin\\DSDT-%x.aml", OEMPath, gSettings.FixDsdt);
CHAR16* PathPatched = L"\\EFI\\CLOVER\\ACPI\\patched"; CONST CHAR16* PathPatched = L"\\EFI\\CLOVER\\ACPI\\patched";
CHAR16* PathDsdt; // = L"\\DSDT.aml"; CHAR16* PathDsdt; // = L"\\DSDT.aml";
CHAR16* AcpiOemPath = PoolPrint(L"%s\\ACPI\\patched", OEMPath); CHAR16* AcpiOemPath = PoolPrint(L"%s\\ACPI\\patched", OEMPath);
@ -1695,7 +1695,7 @@ EFI_STATUS PatchACPI(IN REFIT_VOLUME *Volume, CHAR8 *OSVersion)
SSDT_TABLE *Ssdt = NULL; SSDT_TABLE *Ssdt = NULL;
UINT8 *buffer = NULL; UINT8 *buffer = NULL;
UINTN bufferLen = 0; UINTN bufferLen = 0;
CHAR16* PathPatched = L"\\EFI\\CLOVER\\ACPI\\patched"; CONST CHAR16* PathPatched = L"\\EFI\\CLOVER\\ACPI\\patched";
CHAR16* PathDsdt; // = L"\\DSDT.aml"; CHAR16* PathDsdt; // = L"\\DSDT.aml";
// CHAR16* PatchedAPIC = L"\\EFI\\CLOVER\\ACPI\\origin\\APIC-p.aml"; // CHAR16* PatchedAPIC = L"\\EFI\\CLOVER\\ACPI\\origin\\APIC-p.aml";
UINT32* rf = NULL; UINT32* rf = NULL;
@ -2411,7 +2411,7 @@ EFI_STATUS LoadAndInjectAcpiTable(CHAR16 *PathPatched,
/** /**
* Patches UEFI ACPI tables with tables found in OsSubdir. * Patches UEFI ACPI tables with tables found in OsSubdir.
*/ */
EFI_STATUS PatchACPI_OtherOS(CHAR16* OsSubdir, BOOLEAN DropSSDT) EFI_STATUS PatchACPI_OtherOS(CONST CHAR16* OsSubdir, BOOLEAN DropSSDT)
{ {
EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *RsdPointer; EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *RsdPointer;
EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *FadtPointer; EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *FadtPointer;

View File

@ -182,7 +182,7 @@ UINT32 aml_fill_simple_name(CHAR8* buffer, /* CONST*/ CHAR8* name)
return 4; return 4;
} }
UINT32 aml_fill_name(AML_CHUNK* node, /* CONST*/ CHAR8* name) UINT32 aml_fill_name(AML_CHUNK* node, CONST CHAR8* name)
{ {
INTN len, offset, count; INTN len, offset, count;
UINT32 root = 0; UINT32 root = 0;
@ -247,7 +247,7 @@ AML_CHUNK* aml_add_scope(AML_CHUNK* parent, /* CONST*/ CHAR8* name)
return node; return node;
} }
AML_CHUNK* aml_add_name(AML_CHUNK* parent, /* CONST*/ CHAR8* name) AML_CHUNK* aml_add_name(AML_CHUNK* parent, CONST CHAR8* name)
{ {
AML_CHUNK* node = aml_create_node(parent); AML_CHUNK* node = aml_create_node(parent);
@ -261,7 +261,7 @@ AML_CHUNK* aml_add_name(AML_CHUNK* parent, /* CONST*/ CHAR8* name)
return node; return node;
} }
AML_CHUNK* aml_add_method(AML_CHUNK* parent, /* CONST*/ CHAR8* name, UINT8 args) AML_CHUNK* aml_add_method(AML_CHUNK* parent, CONST CHAR8* name, UINT8 args)
{ {
AML_CHUNK* node = aml_create_node(parent); AML_CHUNK* node = aml_create_node(parent);
@ -311,7 +311,7 @@ AML_CHUNK* aml_add_alias(AML_CHUNK* parent, /* CONST*/ CHAR8* name1, /* CONST*/
return node; return node;
} }
AML_CHUNK* aml_add_return_name(AML_CHUNK* parent, /* CONST*/ CHAR8* name) AML_CHUNK* aml_add_return_name(AML_CHUNK* parent, CONST CHAR8* name)
{ {
AML_CHUNK* node = aml_create_node(parent); AML_CHUNK* node = aml_create_node(parent);
@ -337,7 +337,7 @@ AML_CHUNK* aml_add_return_byte(AML_CHUNK* parent, UINT8 value)
return node; return node;
} }
AML_CHUNK* aml_add_device(AML_CHUNK* parent, /* CONST*/ CHAR8* name) AML_CHUNK* aml_add_device(AML_CHUNK* parent, CONST CHAR8* name)
{ {
AML_CHUNK* node = aml_create_node(parent); AML_CHUNK* node = aml_create_node(parent);
@ -414,7 +414,7 @@ AML_CHUNK* aml_add_string_buffer(AML_CHUNK* parent, CONST CHAR8* StringBuf)
return node; return node;
} }
AML_CHUNK* aml_add_string(AML_CHUNK* parent, /* CONST*/ CHAR8* StringBuf) AML_CHUNK* aml_add_string(AML_CHUNK* parent, CONST CHAR8* StringBuf)
{ {
AML_CHUNK* node = aml_create_node(parent); AML_CHUNK* node = aml_create_node(parent);

View File

@ -27,9 +27,9 @@ AML_CHUNK* aml_add_word(AML_CHUNK* parent, UINT16 value);
AML_CHUNK* aml_add_dword(AML_CHUNK* parent, UINT32 value); AML_CHUNK* aml_add_dword(AML_CHUNK* parent, UINT32 value);
AML_CHUNK* aml_add_qword(AML_CHUNK* parent, UINT64 value); AML_CHUNK* aml_add_qword(AML_CHUNK* parent, UINT64 value);
AML_CHUNK* aml_add_scope(AML_CHUNK* parent, /* CONST*/ CHAR8* name); AML_CHUNK* aml_add_scope(AML_CHUNK* parent, /* CONST*/ CHAR8* name);
AML_CHUNK* aml_add_name(AML_CHUNK* parent, /* CONST*/ CHAR8* name); AML_CHUNK* aml_add_name(AML_CHUNK* parent, CONST CHAR8* name);
AML_CHUNK* aml_add_method(AML_CHUNK* parent, /* CONST*/ CHAR8* name, UINT8 args); AML_CHUNK* aml_add_method(AML_CHUNK* parent, CONST CHAR8* name, UINT8 args);
AML_CHUNK* aml_add_return_name(AML_CHUNK* parent, /* CONST*/ CHAR8* name); AML_CHUNK* aml_add_return_name(AML_CHUNK* parent, CONST CHAR8* name);
AML_CHUNK* aml_add_return_byte(AML_CHUNK* parent, UINT8 value); AML_CHUNK* aml_add_return_byte(AML_CHUNK* parent, UINT8 value);
AML_CHUNK* aml_add_package(AML_CHUNK* parent); AML_CHUNK* aml_add_package(AML_CHUNK* parent);
AML_CHUNK* aml_add_alias(AML_CHUNK* parent, /* CONST*/ CHAR8* name1, /* CONST*/ CHAR8* name2); AML_CHUNK* aml_add_alias(AML_CHUNK* parent, /* CONST*/ CHAR8* name1, /* CONST*/ CHAR8* name2);
@ -38,10 +38,10 @@ UINT32 aml_write_node(AML_CHUNK* node, CHAR8* buffer, UINT32 offset);
UINT32 aml_write_size(UINT32 size, CHAR8* buffer, UINT32 offset); UINT32 aml_write_size(UINT32 size, CHAR8* buffer, UINT32 offset);
// add by pcj // add by pcj
AML_CHUNK* aml_add_string(AML_CHUNK* parent, /* CONST*/ CHAR8* string); AML_CHUNK* aml_add_string(AML_CHUNK* parent, CONST CHAR8* string);
AML_CHUNK* aml_add_byte_buffer(AML_CHUNK* parent, /* CONST*/ UINT8* data,UINT32 size); AML_CHUNK* aml_add_byte_buffer(AML_CHUNK* parent, /* CONST*/ UINT8* data,UINT32 size);
AML_CHUNK* aml_add_string_buffer(AML_CHUNK* parent, CONST CHAR8* string); AML_CHUNK* aml_add_string_buffer(AML_CHUNK* parent, CONST CHAR8* string);
AML_CHUNK* aml_add_device(AML_CHUNK* parent, /* CONST*/ CHAR8* name); AML_CHUNK* aml_add_device(AML_CHUNK* parent, CONST CHAR8* name);
AML_CHUNK* aml_add_local0(AML_CHUNK* parent); AML_CHUNK* aml_add_local0(AML_CHUNK* parent);
AML_CHUNK* aml_add_store(AML_CHUNK* parent); AML_CHUNK* aml_add_store(AML_CHUNK* parent);
AML_CHUNK* aml_add_return(AML_CHUNK* parent); AML_CHUNK* aml_add_return(AML_CHUNK* parent);

View File

@ -212,7 +212,7 @@ EFI_STATUS SetupBooterLog(BOOLEAN AllowGrownSize)
// Made msgbuf and msgCursor private to this source // Made msgbuf and msgCursor private to this source
// so we need a different way of saving the msg log - apianti // so we need a different way of saving the msg log - apianti
EFI_STATUS SaveBooterLog(IN EFI_FILE_HANDLE BaseDir OPTIONAL, IN CHAR16 *FileName) EFI_STATUS SaveBooterLog(IN EFI_FILE_HANDLE BaseDir OPTIONAL, IN CONST CHAR16 *FileName)
{ {
CHAR8 *MemLogBuffer; CHAR8 *MemLogBuffer;
UINTN MemLogLen; UINTN MemLogLen;

View File

@ -185,7 +185,7 @@ FindDevicePathNodeWithType (
EFI_STATUS EFI_STATUS
CreateBootOptionDevicePath ( CreateBootOptionDevicePath (
IN EFI_HANDLE FileDeviceHandle, IN EFI_HANDLE FileDeviceHandle,
IN CHAR16 *FileName, IN CONST CHAR16 *FileName,
IN BOOLEAN UseShortForm, IN BOOLEAN UseShortForm,
OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
) )
@ -762,7 +762,7 @@ FindFreeBootNum (
EFI_STATUS EFI_STATUS
FindBootOptionForFile ( FindBootOptionForFile (
IN EFI_HANDLE FileDeviceHandle, IN EFI_HANDLE FileDeviceHandle,
IN CHAR16 *FileName, IN CONST CHAR16 *FileName,
OUT UINT16 *BootNum, OUT UINT16 *BootNum,
OUT UINTN *BootIndex OUT UINTN *BootIndex
) )
@ -1018,9 +1018,9 @@ AddBootOption (
EFI_STATUS EFI_STATUS
AddBootOptionForFile ( AddBootOptionForFile (
IN EFI_HANDLE FileDeviceHandle, IN EFI_HANDLE FileDeviceHandle,
IN CHAR16 *FileName, IN CONST CHAR16 *FileName,
IN BOOLEAN UseShortForm, IN BOOLEAN UseShortForm,
IN CHAR16 *Description, IN CONST CHAR16 *Description,
IN UINT8 *OptionalData, IN UINT8 *OptionalData,
IN UINTN OptionalDataSize, IN UINTN OptionalDataSize,
IN UINTN BootIndex, IN UINTN BootIndex,
@ -1124,7 +1124,7 @@ DeleteBootOption (
EFI_STATUS EFI_STATUS
DeleteBootOptionForFile ( DeleteBootOptionForFile (
IN EFI_HANDLE FileDeviceHandle, IN EFI_HANDLE FileDeviceHandle,
IN CHAR16 *FileName IN CONST CHAR16 *FileName
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;

View File

@ -112,7 +112,7 @@ CopyRecord(IN PLATFORM_DATA *Rec,
/// Adds a key-value-pair to the DataHubProtocol /// Adds a key-value-pair to the DataHubProtocol
EFI_STATUS EFIAPI EFI_STATUS EFIAPI
LogDataHub(IN EFI_GUID *TypeGuid, LogDataHub(IN EFI_GUID *TypeGuid,
IN CHAR16 *Name, IN CONST CHAR16 *Name,
IN VOID *Data, IN VOID *Data,
IN UINT32 DataSize) IN UINT32 DataSize)
{ {
@ -171,7 +171,7 @@ OvrRuntimeServices(EFI_RUNTIME_SERVICES *RS)
{ {
EFI_STATUS Status; EFI_STATUS Status;
CopyMem(&gOrgRS, RS, sizeof(EFI_RUNTIME_SERVICES)); CopyMem(&gOrgRS, RS, sizeof(EFI_RUNTIME_SERVICES));
RS->SetVariable = OvrSetVariable; RS->SetVariable = (EFI_SET_VARIABLE)OvrSetVariable;
RS->Hdr.CRC32 = 0; RS->Hdr.CRC32 = 0;
Status = gBS->CalculateCrc32(RS, RS->Hdr.HeaderSize, &RS->Hdr.CRC32); Status = gBS->CalculateCrc32(RS, RS->Hdr.HeaderSize, &RS->Hdr.CRC32);
return Status; return Status;
@ -185,10 +185,10 @@ SetVariablesForOSX(LOADER_ENTRY *Entry)
UINT32 Attributes; UINT32 Attributes;
UINT32 Color; UINT32 Color;
CHAR8 *None; CONST CHAR8 *None;
CHAR8 *NvidiaWebValue; CONST CHAR8 *NvidiaWebValue;
CHAR16 *KbdPrevLang; CONST CHAR16 *KbdPrevLang;
UINTN LangLen; UINTN LangLen;
CHAR8 *VariablePtr; CHAR8 *VariablePtr;
VOID *OldData; VOID *OldData;

View File

@ -34,11 +34,11 @@ CHAR16 *
EFIAPI EFIAPI
CatPrint ( CatPrint (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN CHAR16 *Fmt, IN CONST CHAR16 *Fmt,
... ...
) )
{ {
UINT16 *AppendStr; CHAR16 *AppendStr;
VA_LIST Args; VA_LIST Args;
UINTN StringSize; UINTN StringSize;
@ -89,7 +89,7 @@ CatPrint (
static VOID static VOID
DevPathPci ( DevPathPci (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN PCI_DEVICE_PATH *DevPath
) )
{ {
PCI_DEVICE_PATH *Pci; PCI_DEVICE_PATH *Pci;
@ -111,7 +111,7 @@ DevPathPci (
static VOID static VOID
DevPathPccard ( DevPathPccard (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN PCCARD_DEVICE_PATH *DevPath
) )
{ {
PCCARD_DEVICE_PATH *Pccard; PCCARD_DEVICE_PATH *Pccard;
@ -133,7 +133,7 @@ DevPathPccard (
static VOID static VOID
DevPathMemMap ( DevPathMemMap (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN MEMMAP_DEVICE_PATH *DevPath
) )
{ {
MEMMAP_DEVICE_PATH *MemMap; MEMMAP_DEVICE_PATH *MemMap;
@ -161,7 +161,7 @@ DevPathMemMap (
static VOID static VOID
DevPathController ( DevPathController (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN CONTROLLER_DEVICE_PATH *DevPath
) )
{ {
CONTROLLER_DEVICE_PATH *Controller; CONTROLLER_DEVICE_PATH *Controller;
@ -181,11 +181,11 @@ DevPathController (
VOID VOID
DevPathVendor ( DevPathVendor (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN VENDOR_DEVICE_PATH *DevPath
) )
{ {
VENDOR_DEVICE_PATH *Vendor; VENDOR_DEVICE_PATH *Vendor;
CHAR16 *Type; CONST CHAR16 *Type;
UINTN DataLength; UINTN DataLength;
UINTN Index; UINTN Index;
// UINT32 FlowControlMap; // UINT32 FlowControlMap;
@ -306,7 +306,7 @@ DevPathVendor (
static VOID static VOID
DevPathAcpi ( DevPathAcpi (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN ACPI_HID_DEVICE_PATH *DevPath
) )
{ {
ACPI_HID_DEVICE_PATH *Acpi; ACPI_HID_DEVICE_PATH *Acpi;
@ -332,7 +332,7 @@ DevPathAcpi (
static VOID static VOID
DevPathExtendedAcpi ( DevPathExtendedAcpi (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN ACPI_EXTENDED_HID_DEVICE_PATH *DevPath
) )
{ {
ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi; ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi;
@ -450,7 +450,7 @@ DevPathExtendedAcpi (
static VOID static VOID
DevPathAdrAcpi ( DevPathAdrAcpi (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN ACPI_ADR_DEVICE_PATH *DevPath
) )
{ {
ACPI_ADR_DEVICE_PATH *AcpiAdr; ACPI_ADR_DEVICE_PATH *AcpiAdr;
@ -482,7 +482,7 @@ DevPathAdrAcpi (
static VOID static VOID
DevPathAtapi ( DevPathAtapi (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN ATAPI_DEVICE_PATH *DevPath
) )
{ {
ATAPI_DEVICE_PATH *Atapi; ATAPI_DEVICE_PATH *Atapi;
@ -509,7 +509,7 @@ DevPathAtapi (
static VOID static VOID
DevPathScsi ( DevPathScsi (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN SCSI_DEVICE_PATH *DevPath
) )
{ {
SCSI_DEVICE_PATH *Scsi; SCSI_DEVICE_PATH *Scsi;
@ -531,7 +531,7 @@ DevPathScsi (
static VOID static VOID
DevPathFibre ( DevPathFibre (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN FIBRECHANNEL_DEVICE_PATH *DevPath
) )
{ {
FIBRECHANNEL_DEVICE_PATH *Fibre; FIBRECHANNEL_DEVICE_PATH *Fibre;
@ -553,7 +553,7 @@ DevPathFibre (
static VOID static VOID
DevPath1394 ( DevPath1394 (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN F1394_DEVICE_PATH *DevPath
) )
{ {
F1394_DEVICE_PATH *F1394Path; F1394_DEVICE_PATH *F1394Path;
@ -575,7 +575,7 @@ DevPath1394 (
static VOID static VOID
DevPathUsb ( DevPathUsb (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN USB_DEVICE_PATH *DevPath
) )
{ {
USB_DEVICE_PATH *Usb; USB_DEVICE_PATH *Usb;
@ -597,7 +597,7 @@ DevPathUsb (
static VOID static VOID
DevPathUsbWWID ( DevPathUsbWWID (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN USB_WWID_DEVICE_PATH *DevPath
) )
{ {
USB_WWID_DEVICE_PATH *UsbWWId; USB_WWID_DEVICE_PATH *UsbWWId;
@ -625,7 +625,7 @@ DevPathUsbWWID (
static VOID static VOID
DevPathLogicalUnit ( DevPathLogicalUnit (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN DEVICE_LOGICAL_UNIT_DEVICE_PATH *DevPath
) )
{ {
DEVICE_LOGICAL_UNIT_DEVICE_PATH *LogicalUnit; DEVICE_LOGICAL_UNIT_DEVICE_PATH *LogicalUnit;
@ -647,7 +647,7 @@ DevPathLogicalUnit (
static VOID static VOID
DevPathUsbClass ( DevPathUsbClass (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN USB_CLASS_DEVICE_PATH *DevPath
) )
{ {
USB_CLASS_DEVICE_PATH *UsbClass; USB_CLASS_DEVICE_PATH *UsbClass;
@ -677,7 +677,7 @@ DevPathUsbClass (
static VOID static VOID
DevPathSata ( DevPathSata (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN SATA_DEVICE_PATH *DevPath
) )
{ {
SATA_DEVICE_PATH *Sata; SATA_DEVICE_PATH *Sata;
@ -717,7 +717,7 @@ DevPathSata (
VOID VOID
DevPathToTextNVMe ( DevPathToTextNVMe (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath /*, IN NVME_NAMESPACE_DEVICE_PATH *DevPath /*,
IN BOOLEAN DisplayOnly, IN BOOLEAN DisplayOnly,
IN BOOLEAN AllowShortcuts */ IN BOOLEAN AllowShortcuts */
) )
@ -751,7 +751,7 @@ DevPathToTextNVMe (
static VOID static VOID
DevPathI2O ( DevPathI2O (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN I2O_DEVICE_PATH *DevPath
) )
{ {
I2O_DEVICE_PATH *I2OPath; I2O_DEVICE_PATH *I2OPath;
@ -773,7 +773,7 @@ DevPathI2O (
static VOID static VOID
DevPathMacAddr ( DevPathMacAddr (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN MAC_ADDR_DEVICE_PATH *DevPath
) )
{ {
MAC_ADDR_DEVICE_PATH *MACDevPath; MAC_ADDR_DEVICE_PATH *MACDevPath;
@ -809,7 +809,7 @@ DevPathMacAddr (
static VOID static VOID
DevPathIPv4 ( DevPathIPv4 (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN IPv4_DEVICE_PATH *DevPath
) )
{ {
IPv4_DEVICE_PATH *IPDevPath; IPv4_DEVICE_PATH *IPDevPath;
@ -839,7 +839,7 @@ DevPathIPv4 (
static VOID static VOID
DevPathIPv6 ( DevPathIPv6 (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN IPv6_DEVICE_PATH *DevPath
) )
{ {
IPv6_DEVICE_PATH *IPv6DevPath; IPv6_DEVICE_PATH *IPv6DevPath;
@ -880,7 +880,7 @@ DevPathIPv6 (
static VOID static VOID
DevPathInfiniBand ( DevPathInfiniBand (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN INFINIBAND_DEVICE_PATH *DevPath
) )
{ {
INFINIBAND_DEVICE_PATH *InfiniBand; INFINIBAND_DEVICE_PATH *InfiniBand;
@ -910,7 +910,7 @@ DevPathInfiniBand (
static VOID static VOID
DevPathUart ( DevPathUart (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN UART_DEVICE_PATH *DevPath
) )
{ {
UART_DEVICE_PATH *Uart; UART_DEVICE_PATH *Uart;
@ -995,7 +995,7 @@ DevPathUart (
static VOID static VOID
DevPathiSCSI ( DevPathiSCSI (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN ISCSI_DEVICE_PATH_WITH_NAME *DevPath
) )
{ {
ISCSI_DEVICE_PATH_WITH_NAME *IScsi; ISCSI_DEVICE_PATH_WITH_NAME *IScsi;
@ -1038,7 +1038,7 @@ DevPathiSCSI (
static VOID static VOID
DevPathVlan ( DevPathVlan (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN VLAN_DEVICE_PATH *DevPath
) )
{ {
VLAN_DEVICE_PATH *Vlan; VLAN_DEVICE_PATH *Vlan;
@ -1060,7 +1060,7 @@ DevPathVlan (
static VOID static VOID
DevPathHardDrive ( DevPathHardDrive (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN HARDDRIVE_DEVICE_PATH *DevPath
) )
{ {
HARDDRIVE_DEVICE_PATH *Hd; HARDDRIVE_DEVICE_PATH *Hd;
@ -1110,7 +1110,7 @@ DevPathHardDrive (
static VOID static VOID
DevPathCDROM ( DevPathCDROM (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN CDROM_DEVICE_PATH *DevPath
) )
{ {
CDROM_DEVICE_PATH *Cd; CDROM_DEVICE_PATH *Cd;
@ -1132,7 +1132,7 @@ DevPathCDROM (
static VOID static VOID
DevPathFilePath ( DevPathFilePath (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN FILEPATH_DEVICE_PATH *DevPath
) )
{ {
FILEPATH_DEVICE_PATH *Fp; FILEPATH_DEVICE_PATH *Fp;
@ -1154,7 +1154,7 @@ DevPathFilePath (
static VOID static VOID
DevPathMediaProtocol ( DevPathMediaProtocol (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN MEDIA_PROTOCOL_DEVICE_PATH *DevPath
) )
{ {
MEDIA_PROTOCOL_DEVICE_PATH *MediaProt; MEDIA_PROTOCOL_DEVICE_PATH *MediaProt;
@ -1176,7 +1176,7 @@ DevPathMediaProtocol (
static VOID static VOID
DevPathFvFilePath ( DevPathFvFilePath (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *DevPath
) )
{ {
MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvFilePath; MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvFilePath;
@ -1198,7 +1198,7 @@ DevPathFvFilePath (
static VOID static VOID
DevPathRelativeOffsetRange0 ( DevPathRelativeOffsetRange0 (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *DevPath
) )
{ {
MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *Offset; MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *Offset;
@ -1225,11 +1225,11 @@ DevPathRelativeOffsetRange0 (
static VOID static VOID
DevPathBssBss ( DevPathBssBss (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN BBS_BBS_DEVICE_PATH *DevPath
) )
{ {
BBS_BBS_DEVICE_PATH *Bbs; BBS_BBS_DEVICE_PATH *Bbs;
CHAR16 *Type; CONST CHAR16 *Type;
Bbs = DevPath; Bbs = DevPath;
switch (Bbs->DeviceType) { switch (Bbs->DeviceType) {
@ -1318,7 +1318,7 @@ DevPathNodeUnknown (
static VOID static VOID
DevPathFvPath ( DevPathFvPath (
IN OUT POOL_PRINT *Str, IN OUT POOL_PRINT *Str,
IN VOID *DevPath IN MEDIA_FW_VOL_DEVICE_PATH *DevPath
) )
{ {
MEDIA_FW_VOL_DEVICE_PATH *FvPath; MEDIA_FW_VOL_DEVICE_PATH *FvPath;
@ -1331,192 +1331,192 @@ DEVICE_PATH_STRING_TABLE DevPathTable[] = {
{ {
HARDWARE_DEVICE_PATH, HARDWARE_DEVICE_PATH,
HW_PCI_DP, HW_PCI_DP,
DevPathPci (DEV_PATH_FUNCTION_VOID)DevPathPci
}, },
{ {
HARDWARE_DEVICE_PATH, HARDWARE_DEVICE_PATH,
HW_PCCARD_DP, HW_PCCARD_DP,
DevPathPccard (DEV_PATH_FUNCTION_VOID)DevPathPccard
}, },
{ {
HARDWARE_DEVICE_PATH, HARDWARE_DEVICE_PATH,
HW_MEMMAP_DP, HW_MEMMAP_DP,
DevPathMemMap (DEV_PATH_FUNCTION_VOID)DevPathMemMap
}, },
{ {
HARDWARE_DEVICE_PATH, HARDWARE_DEVICE_PATH,
HW_VENDOR_DP, HW_VENDOR_DP,
DevPathVendor (DEV_PATH_FUNCTION_VOID)DevPathVendor
}, },
{ {
HARDWARE_DEVICE_PATH, HARDWARE_DEVICE_PATH,
HW_CONTROLLER_DP, HW_CONTROLLER_DP,
DevPathController (DEV_PATH_FUNCTION_VOID)DevPathController
}, },
{ {
ACPI_DEVICE_PATH, ACPI_DEVICE_PATH,
ACPI_DP, ACPI_DP,
DevPathAcpi (DEV_PATH_FUNCTION_VOID)DevPathAcpi
}, },
{ {
ACPI_DEVICE_PATH, ACPI_DEVICE_PATH,
ACPI_EXTENDED_DP, ACPI_EXTENDED_DP,
DevPathExtendedAcpi (DEV_PATH_FUNCTION_VOID)DevPathExtendedAcpi
}, },
{ {
ACPI_DEVICE_PATH, ACPI_DEVICE_PATH,
ACPI_ADR_DP, ACPI_ADR_DP,
DevPathAdrAcpi (DEV_PATH_FUNCTION_VOID)DevPathAdrAcpi
}, },
{ {
MESSAGING_DEVICE_PATH, MESSAGING_DEVICE_PATH,
MSG_ATAPI_DP, MSG_ATAPI_DP,
DevPathAtapi (DEV_PATH_FUNCTION_VOID)DevPathAtapi
}, },
{ {
MESSAGING_DEVICE_PATH, MESSAGING_DEVICE_PATH,
MSG_SCSI_DP, MSG_SCSI_DP,
DevPathScsi (DEV_PATH_FUNCTION_VOID)DevPathScsi
}, },
{ {
MESSAGING_DEVICE_PATH, MESSAGING_DEVICE_PATH,
MSG_FIBRECHANNEL_DP, MSG_FIBRECHANNEL_DP,
DevPathFibre (DEV_PATH_FUNCTION_VOID)DevPathFibre
}, },
{ {
MESSAGING_DEVICE_PATH, MESSAGING_DEVICE_PATH,
MSG_1394_DP, MSG_1394_DP,
DevPath1394 (DEV_PATH_FUNCTION_VOID)DevPath1394
}, },
{ {
MESSAGING_DEVICE_PATH, MESSAGING_DEVICE_PATH,
MSG_USB_DP, MSG_USB_DP,
DevPathUsb (DEV_PATH_FUNCTION_VOID)DevPathUsb
}, },
{ {
MESSAGING_DEVICE_PATH, MESSAGING_DEVICE_PATH,
MSG_USB_WWID_DP, MSG_USB_WWID_DP,
DevPathUsbWWID (DEV_PATH_FUNCTION_VOID)DevPathUsbWWID
}, },
{ {
MESSAGING_DEVICE_PATH, MESSAGING_DEVICE_PATH,
MSG_DEVICE_LOGICAL_UNIT_DP, MSG_DEVICE_LOGICAL_UNIT_DP,
DevPathLogicalUnit (DEV_PATH_FUNCTION_VOID)DevPathLogicalUnit
}, },
{ {
MESSAGING_DEVICE_PATH, MESSAGING_DEVICE_PATH,
MSG_USB_CLASS_DP, MSG_USB_CLASS_DP,
DevPathUsbClass (DEV_PATH_FUNCTION_VOID)DevPathUsbClass
}, },
{ {
MESSAGING_DEVICE_PATH, MESSAGING_DEVICE_PATH,
MSG_SATA_DP, MSG_SATA_DP,
DevPathSata (DEV_PATH_FUNCTION_VOID)DevPathSata
}, },
{ {
MESSAGING_DEVICE_PATH, MESSAGING_DEVICE_PATH,
MSG_NVME_NAMESPACE_DP, MSG_NVME_NAMESPACE_DP,
DevPathToTextNVMe (DEV_PATH_FUNCTION_VOID)DevPathToTextNVMe
}, },
{ {
MESSAGING_DEVICE_PATH, MESSAGING_DEVICE_PATH,
MSG_I2O_DP, MSG_I2O_DP,
DevPathI2O (DEV_PATH_FUNCTION_VOID)DevPathI2O
}, },
{ {
MESSAGING_DEVICE_PATH, MESSAGING_DEVICE_PATH,
MSG_MAC_ADDR_DP, MSG_MAC_ADDR_DP,
DevPathMacAddr (DEV_PATH_FUNCTION_VOID)DevPathMacAddr
}, },
{ {
MESSAGING_DEVICE_PATH, MESSAGING_DEVICE_PATH,
MSG_IPv4_DP, MSG_IPv4_DP,
DevPathIPv4 (DEV_PATH_FUNCTION_VOID)DevPathIPv4
}, },
{ {
MESSAGING_DEVICE_PATH, MESSAGING_DEVICE_PATH,
MSG_IPv6_DP, MSG_IPv6_DP,
DevPathIPv6 (DEV_PATH_FUNCTION_VOID)DevPathIPv6
}, },
{ {
MESSAGING_DEVICE_PATH, MESSAGING_DEVICE_PATH,
MSG_INFINIBAND_DP, MSG_INFINIBAND_DP,
DevPathInfiniBand (DEV_PATH_FUNCTION_VOID)DevPathInfiniBand
}, },
{ {
MESSAGING_DEVICE_PATH, MESSAGING_DEVICE_PATH,
MSG_UART_DP, MSG_UART_DP,
DevPathUart (DEV_PATH_FUNCTION_VOID)DevPathUart
}, },
{ {
MESSAGING_DEVICE_PATH, MESSAGING_DEVICE_PATH,
MSG_VENDOR_DP, MSG_VENDOR_DP,
DevPathVendor (DEV_PATH_FUNCTION_VOID)DevPathVendor
}, },
{ {
MESSAGING_DEVICE_PATH, MESSAGING_DEVICE_PATH,
MSG_ISCSI_DP, MSG_ISCSI_DP,
DevPathiSCSI (DEV_PATH_FUNCTION_VOID)DevPathiSCSI
}, },
{ {
MESSAGING_DEVICE_PATH, MESSAGING_DEVICE_PATH,
MSG_VLAN_DP, MSG_VLAN_DP,
DevPathVlan (DEV_PATH_FUNCTION_VOID)DevPathVlan
}, },
{ {
MEDIA_DEVICE_PATH, MEDIA_DEVICE_PATH,
MEDIA_HARDDRIVE_DP, MEDIA_HARDDRIVE_DP,
DevPathHardDrive (DEV_PATH_FUNCTION_VOID)DevPathHardDrive
}, },
{ {
MEDIA_DEVICE_PATH, MEDIA_DEVICE_PATH,
MEDIA_CDROM_DP, MEDIA_CDROM_DP,
DevPathCDROM (DEV_PATH_FUNCTION_VOID)DevPathCDROM
}, },
{ {
MEDIA_DEVICE_PATH, MEDIA_DEVICE_PATH,
MEDIA_VENDOR_DP, MEDIA_VENDOR_DP,
DevPathVendor (DEV_PATH_FUNCTION_VOID)DevPathVendor
}, },
{ {
MEDIA_DEVICE_PATH, MEDIA_DEVICE_PATH,
MEDIA_FILEPATH_DP, MEDIA_FILEPATH_DP,
DevPathFilePath (DEV_PATH_FUNCTION_VOID)DevPathFilePath
}, },
{ {
MEDIA_DEVICE_PATH, MEDIA_DEVICE_PATH,
MEDIA_PROTOCOL_DP, MEDIA_PROTOCOL_DP,
DevPathMediaProtocol (DEV_PATH_FUNCTION_VOID)DevPathMediaProtocol
}, },
{ {
MEDIA_DEVICE_PATH, MEDIA_DEVICE_PATH,
MEDIA_PIWG_FW_VOL_DP, MEDIA_PIWG_FW_VOL_DP,
DevPathFvPath, (DEV_PATH_FUNCTION_VOID)DevPathFvPath,
}, },
{ {
MEDIA_DEVICE_PATH, MEDIA_DEVICE_PATH,
MEDIA_PIWG_FW_FILE_DP, MEDIA_PIWG_FW_FILE_DP,
DevPathFvFilePath (DEV_PATH_FUNCTION_VOID)DevPathFvFilePath
}, },
{ {
MEDIA_DEVICE_PATH, MEDIA_DEVICE_PATH,
MEDIA_RELATIVE_OFFSET_RANGE_DP, MEDIA_RELATIVE_OFFSET_RANGE_DP,
DevPathRelativeOffsetRange0, (DEV_PATH_FUNCTION_VOID)DevPathRelativeOffsetRange0,
}, },
{ {
BBS_DEVICE_PATH, BBS_DEVICE_PATH,
BBS_BBS_DP, BBS_BBS_DP,
DevPathBssBss (DEV_PATH_FUNCTION_VOID)DevPathBssBss
}, },
{ {
END_DEVICE_PATH_TYPE, END_DEVICE_PATH_TYPE,
END_INSTANCE_DEVICE_PATH_SUBTYPE, END_INSTANCE_DEVICE_PATH_SUBTYPE,
DevPathEndInstance (DEV_PATH_FUNCTION_VOID)DevPathEndInstance
}, },
{ {
0, 0,
0, 0,
NULL (DEV_PATH_FUNCTION_VOID)NULL
} }
}; };

View File

@ -5,8 +5,11 @@
//totally rebuilt by Slice, 2012-2013 //totally rebuilt by Slice, 2012-2013
// NForce additions by Oscar09, 2013 // NForce additions by Oscar09, 2013
#include "Platform.h"
#include "StateGenerator.h" #include "StateGenerator.h"
extern "C" {
#include <IndustryStandard/PciCommand.h> #include <IndustryStandard/PciCommand.h>
}
#ifdef DBG #ifdef DBG
#undef DBG #undef DBG
@ -56,8 +59,8 @@ UINT32 DisplayADR1[4];
UINT32 DisplayADR2[4]; UINT32 DisplayADR2[4];
UINT32 NetworkADR1[4]; UINT32 NetworkADR1[4];
UINT32 NetworkADR2[4]; UINT32 NetworkADR2[4];
CHAR8* Netmodel[4]; CONST CHAR8* Netmodel[4];
CHAR8* NetName[4] = { "ETH0", "ETH1", "ETH2", "ETH3" }; CONST CHAR8* NetName[4] = { "ETH0", "ETH1", "ETH2", "ETH3" };
UINT32 net_count = 0; UINT32 net_count = 0;
UINT32 ArptADR1; UINT32 ArptADR1;
UINT32 ArptADR2; UINT32 ArptADR2;
@ -160,7 +163,7 @@ static struct lpc_device_t lpc_chipset[] =
struct net_chipsets_t { struct net_chipsets_t {
UINT32 id; UINT32 id;
CHAR8 *name; CONST CHAR8 *name;
}; };
static struct net_chipsets_t NetChipsets[] = { static struct net_chipsets_t NetChipsets[] = {
@ -496,7 +499,7 @@ BOOLEAN CmpNum(UINT8 *dsdt, INT32 i, BOOLEAN Sure)
//extern UINT32 HDA_IC_sendVerb(EFI_PCI_IO_PROTOCOL *PciIo, UINT32 codecAdr, UINT32 nodeId, UINT32 verb); //extern UINT32 HDA_IC_sendVerb(EFI_PCI_IO_PROTOCOL *PciIo, UINT32 codecAdr, UINT32 nodeId, UINT32 verb);
BOOLEAN get_lpc_model(UINT32 id) { BOOLEAN get_lpc_model(UINT32 id) {
int i; UINTN i;
for (i=1; i< (sizeof(lpc_chipset) / sizeof(lpc_chipset[0])); i++) { for (i=1; i< (sizeof(lpc_chipset) / sizeof(lpc_chipset[0])); i++) {
if (lpc_chipset[i].id == id) { if (lpc_chipset[i].id == id) {
@ -507,7 +510,7 @@ BOOLEAN get_lpc_model(UINT32 id) {
} }
BOOLEAN get_ide_model(UINT32 id) { BOOLEAN get_ide_model(UINT32 id) {
int i; UINTN i;
for (i=1; i< (sizeof(ide_chipset) / sizeof(ide_chipset[0])); i++) { for (i=1; i< (sizeof(ide_chipset) / sizeof(ide_chipset[0])); i++) {
if (ide_chipset[i].id == id) { if (ide_chipset[i].id == id) {
@ -518,7 +521,7 @@ BOOLEAN get_ide_model(UINT32 id) {
} }
/* /*
BOOLEAN get_ahci_model(UINT32 id) { BOOLEAN get_ahci_model(UINT32 id) {
int i; UINTN i;
for (i=1; i< (sizeof(ahci_chipset) / sizeof(ahci_chipset[0])); i++) { for (i=1; i< (sizeof(ahci_chipset) / sizeof(ahci_chipset[0])); i++) {
if (ahci_chipset[i].id == id) { if (ahci_chipset[i].id == id) {
@ -528,8 +531,8 @@ BOOLEAN get_ahci_model(UINT32 id) {
return TRUE; return TRUE;
} }
*/ */
CHAR8* get_net_model(UINT32 id) { CONST CHAR8* get_net_model(UINT32 id) {
int i; UINTN i;
for (i=1; i< (sizeof(NetChipsets) / sizeof(NetChipsets[0])); i++) { for (i=1; i< (sizeof(NetChipsets) / sizeof(NetChipsets[0])); i++) {
if (NetChipsets[i].id == id) { if (NetChipsets[i].id == id) {
@ -1181,7 +1184,7 @@ INT32 write_size(UINT32 adr, UINT8* buffer, UINT32 len, INT32 sizeoffset)
return offset; return offset;
} }
INT32 FindName(UINT8 *dsdt, INT32 len, CHAR8* name) INT32 FindName(UINT8 *dsdt, INT32 len, CONST CHAR8* name)
{ {
INT32 i; INT32 i;
for (i = 0; len >= 5 && i < len-5; i++) { for (i = 0; len >= 5 && i < len-5; i++) {
@ -1324,7 +1327,7 @@ INT32 FindBin (UINT8 *dsdt, UINT32 len, UINT8* bin, UINT32 N)
//if (!FindMethod(dsdt, len, "DTGP")) //if (!FindMethod(dsdt, len, "DTGP"))
// return address of size field. Assume size not more then 0x0FFF = 4095 bytes // return address of size field. Assume size not more then 0x0FFF = 4095 bytes
//assuming only short methods //assuming only short methods
UINT32 FindMethod (UINT8 *dsdt, UINT32 len, /* CONST*/ CHAR8* Name) UINT32 FindMethod (UINT8 *dsdt, UINT32 len, CONST CHAR8* Name)
{ {
UINT32 i; UINT32 i;
for (i = 0; len >= 7 && i < len - 7; i++) { for (i = 0; len >= 7 && i < len - 7; i++) {
@ -1480,7 +1483,7 @@ UINT32 CorrectOuters (UINT8 *dsdt, UINT32 len, UINT32 adr, INT32 shift)
} }
//ReplaceName(dsdt, len, "AZAL", "HDEF"); //ReplaceName(dsdt, len, "AZAL", "HDEF");
INTN ReplaceName(UINT8 *dsdt, UINT32 len, /* CONST*/ CHAR8 *OldName, /* CONST*/ CHAR8 *NewName) INTN ReplaceName(UINT8 *dsdt, UINT32 len, CONST CHAR8 *OldName, CONST CHAR8 *NewName)
{ {
UINTN i; UINTN i;
INTN j = 0; INTN j = 0;
@ -1563,7 +1566,7 @@ BOOLEAN CustProperties(AML_CHUNK* pack, UINT32 Dev)
} }
//len = DeleteDevice("AZAL", dsdt, len); //len = DeleteDevice("AZAL", dsdt, len);
UINT32 DeleteDevice(/*CONST*/ CHAR8 *Name, UINT8 *dsdt, UINT32 len) UINT32 DeleteDevice(CONST CHAR8 *Name, UINT8 *dsdt, UINT32 len)
{ {
UINT32 i, j; UINT32 i, j;
INT32 size = 0, sizeoffset; INT32 size = 0, sizeoffset;

View File

@ -58,7 +58,7 @@ CONST CHAR8 hdcID[4] = HDC_ID;
extern UINTN AudioNum; extern UINTN AudioNum;
extern HDA_OUTPUTS AudioList[20]; extern HDA_OUTPUTS AudioList[20];
extern EFI_AUDIO_IO_PROTOCOL *AudioIo; extern EFI_AUDIO_IO_PROTOCOL *AudioIo;
extern CHAR16 *OEMPath; extern CONST CHAR16 *OEMPath;
VOID VOID
EFIAPI EFIAPI

View File

@ -25,6 +25,7 @@
#ifndef _EFI_HDA_CODEC_DUMP_H_ #ifndef _EFI_HDA_CODEC_DUMP_H_
#define _EFI_HDA_CODEC_DUMP_H_ #define _EFI_HDA_CODEC_DUMP_H_
extern "C" {
// Common UEFI includes and library classes. // Common UEFI includes and library classes.
#include <Uefi.h> #include <Uefi.h>
#include <Library/BaseLib.h> #include <Library/BaseLib.h>
@ -38,6 +39,7 @@
// Consumed protocols. // Consumed protocols.
#include <Protocol/HdaCodecInfo.h> #include <Protocol/HdaCodecInfo.h>
}
#define HDA_MAX_CONNS 32 #define HDA_MAX_CONNS 32
#define HDA_MAX_NAMELEN 32 #define HDA_MAX_NAMELEN 32

View File

@ -376,8 +376,8 @@ GetSleepImageLocation(IN REFIT_VOLUME *Volume, REFIT_VOLUME **SleepImageVolume,
UINT8 *PrefBuffer = NULL; UINT8 *PrefBuffer = NULL;
UINTN PrefBufferLen = 0; UINTN PrefBufferLen = 0;
TagPtr PrefDict, dict, dict2, prop; TagPtr PrefDict, dict, dict2, prop;
CHAR16 *PrefName = L"\\Library\\Preferences\\SystemConfiguration\\com.apple.PowerManagement.plist"; CONST CHAR16 *PrefName = L"\\Library\\Preferences\\SystemConfiguration\\com.apple.PowerManagement.plist";
CHAR16 *PrefName2 = L"\\Library\\Preferences\\com.apple.PowerManagement.plist"; CONST CHAR16 *PrefName2 = L"\\Library\\Preferences\\com.apple.PowerManagement.plist";
CHAR16 *PrefName3 = NULL; CHAR16 *PrefName3 = NULL;
CHAR16 *ImageName = NULL; CHAR16 *ImageName = NULL;
REFIT_VOLUME *ImageVolume = Volume; REFIT_VOLUME *ImageVolume = Volume;

View File

@ -18,8 +18,8 @@ Abstract:
#ifndef _LEGACY_BIOS_THUNK_H_ #ifndef _LEGACY_BIOS_THUNK_H_
#define _LEGACY_BIOS_THUNK_H_ #define _LEGACY_BIOS_THUNK_H_
extern "C" {
#include <Uefi.h> #include <Uefi.h>
// //
// Driver Consumed Protocol Prototypes // Driver Consumed Protocol Prototypes
// //
@ -49,6 +49,8 @@ Abstract:
#include <IndustryStandard/Pci.h> #include <IndustryStandard/Pci.h>
} // extern "C"
#define EFI_SEGMENT(_Adr) (UINT16) ((UINT16) (((UINTN) (_Adr)) >> 4) & 0xf000) #define EFI_SEGMENT(_Adr) (UINT16) ((UINT16) (((UINTN) (_Adr)) >> 4) & 0xf000)
#define EFI_OFFSET(_Adr) (UINT16) (((UINT16) ((UINTN) (_Adr))) & 0xffff) #define EFI_OFFSET(_Adr) (UINT16) (((UINT16) ((UINTN) (_Adr))) & 0xffff)

View File

@ -762,8 +762,8 @@ EFI_STATUS bootPBR(REFIT_VOLUME* volume, BOOLEAN SataReset)
UINT16 BbsCount; UINT16 BbsCount;
BBS_TABLE *BbsTable = NULL; BBS_TABLE *BbsTable = NULL;
BBS_TABLE *BbsTableIt = NULL; BBS_TABLE *BbsTableIt = NULL;
CHAR16 *BbsPriorityTxt; CONST CHAR16 *BbsPriorityTxt;
CHAR16 *BbsDevTypeTxt; CONST CHAR16 *BbsDevTypeTxt;
MBR_PARTITION_INFO *pMBR = (MBR_PARTITION_INFO*)(UINTN)0x11BE; // typical location boot0 installs it, should be unused otherwise... MBR_PARTITION_INFO *pMBR = (MBR_PARTITION_INFO*)(UINTN)0x11BE; // typical location boot0 installs it, should be unused otherwise...
// //

View File

@ -91,7 +91,7 @@ GetEfiTimeInMs (
/** Reads and returns value of NVRAM variable. */ /** Reads and returns value of NVRAM variable. */
VOID *GetNvramVariable ( VOID *GetNvramVariable (
IN CHAR16 *VariableName, IN CONST CHAR16 *VariableName,
IN EFI_GUID *VendorGuid, IN EFI_GUID *VendorGuid,
OUT UINT32 *Attributes OPTIONAL, OUT UINT32 *Attributes OPTIONAL,
OUT UINTN *DataSize OPTIONAL) OUT UINTN *DataSize OPTIONAL)
@ -135,7 +135,7 @@ VOID *GetNvramVariable (
/** Sets NVRAM variable. Does nothing if variable with the same data and attributes already exists. */ /** Sets NVRAM variable. Does nothing if variable with the same data and attributes already exists. */
EFI_STATUS EFI_STATUS
SetNvramVariable ( SetNvramVariable (
IN CHAR16 *VariableName, IN CONST CHAR16 *VariableName,
IN EFI_GUID *VendorGuid, IN EFI_GUID *VendorGuid,
IN UINT32 Attributes, IN UINT32 Attributes,
IN UINTN DataSize, IN UINTN DataSize,
@ -181,7 +181,7 @@ SetNvramVariable (
/** Sets NVRAM variable. Does nothing if variable with the same name already exists. */ /** Sets NVRAM variable. Does nothing if variable with the same name already exists. */
EFI_STATUS EFI_STATUS
AddNvramVariable ( AddNvramVariable (
IN CHAR16 *VariableName, IN CONST CHAR16 *VariableName,
IN EFI_GUID *VendorGuid, IN EFI_GUID *VendorGuid,
IN UINT32 Attributes, IN UINT32 Attributes,
IN UINTN DataSize, IN UINTN DataSize,
@ -207,7 +207,7 @@ AddNvramVariable (
/** Deletes NVRAM variable. */ /** Deletes NVRAM variable. */
EFI_STATUS EFI_STATUS
DeleteNvramVariable ( DeleteNvramVariable (
IN CHAR16 *VariableName, IN CONST CHAR16 *VariableName,
IN EFI_GUID *VendorGuid IN EFI_GUID *VendorGuid
) )
{ {
@ -387,7 +387,7 @@ UINT32 TypeFromName(CHAR16 *Name)
} }
UINT32 FourCharKey(CHAR8 *Name) UINT32 FourCharKey(CONST CHAR8 *Name)
{ {
return (Name[0] << 24) + (Name[1] << 16) + (Name[2] << 8) + Name[3]; //Big Endian return (Name[0] << 24) + (Name[1] << 16) + (Name[2] << 8) + Name[3]; //Big Endian
} }
@ -814,7 +814,7 @@ GetEfiBootDeviceFromNvram ()
EFI_STATUS EFI_STATUS
LoadNvramPlist ( LoadNvramPlist (
IN EFI_FILE *RootDir, IN EFI_FILE *RootDir,
IN CHAR16* NVRAMPlistPath IN CONST CHAR16* NVRAMPlistPath
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
@ -1097,7 +1097,7 @@ FindStartupDiskVolume (
REFIT_VOLUME *Volume; REFIT_VOLUME *Volume;
REFIT_VOLUME *DiskVolume; REFIT_VOLUME *DiskVolume;
BOOLEAN IsPartitionVolume; BOOLEAN IsPartitionVolume;
CHAR16 *LoaderPath; CONST CHAR16 *LoaderPath;
CHAR16 *EfiBootVolumeStr; CHAR16 *EfiBootVolumeStr;
@ -1313,7 +1313,7 @@ FindStartupDiskVolume (
/** Sets efi-boot-device-data RT var to currently selected Volume and LoadePath. */ /** Sets efi-boot-device-data RT var to currently selected Volume and LoadePath. */
EFI_STATUS SetStartupDiskVolume ( EFI_STATUS SetStartupDiskVolume (
IN REFIT_VOLUME *Volume, IN REFIT_VOLUME *Volume,
IN CHAR16 *LoaderPath IN CONST CHAR16 *LoaderPath
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
@ -1321,7 +1321,7 @@ EFI_STATUS SetStartupDiskVolume (
EFI_DEVICE_PATH_PROTOCOL *FileDevPath; EFI_DEVICE_PATH_PROTOCOL *FileDevPath;
EFI_GUID *Guid; EFI_GUID *Guid;
CHAR8 *EfiBootDevice; CHAR8 *EfiBootDevice;
CHAR8 *EfiBootDeviceTmpl; CONST CHAR8 *EfiBootDeviceTmpl;
UINTN Size; UINTN Size;
UINT32 Attributes; UINT32 Attributes;

View File

@ -76,6 +76,8 @@ extern "C" {
#include <Protocol/AppleSMC.h> #include <Protocol/AppleSMC.h>
#include <Protocol/AppleImageCodecProtocol.h> #include <Protocol/AppleImageCodecProtocol.h>
}
#include "../refit/lib.h" #include "../refit/lib.h"
#include "string.h" #include "string.h"
#include "boot.h" #include "boot.h"
@ -789,14 +791,14 @@ struct CUSTOM_LOADER_ENTRY {
CUSTOM_LOADER_ENTRY *SubEntries; CUSTOM_LOADER_ENTRY *SubEntries;
EG_IMAGE *Image; EG_IMAGE *Image;
EG_IMAGE *DriveImage; EG_IMAGE *DriveImage;
CHAR16 *ImagePath; CONST CHAR16 *ImagePath;
CHAR16 *DriveImagePath; CONST CHAR16 *DriveImagePath;
CHAR16 *Volume; CONST CHAR16 *Volume;
CHAR16 *Path; CONST CHAR16 *Path;
CHAR16 *Options; CONST CHAR16 *Options;
CHAR16 *FullTitle; CONST CHAR16 *FullTitle;
CHAR16 *Title; CONST CHAR16 *Title;
CHAR16 *Settings; CONST CHAR16 *Settings;
CHAR16 Hotkey; CHAR16 Hotkey;
BOOLEAN CommonSettings; BOOLEAN CommonSettings;
UINT8 Flags; UINT8 Flags;
@ -814,11 +816,11 @@ struct CUSTOM_LEGACY_ENTRY {
CUSTOM_LEGACY_ENTRY *Next; CUSTOM_LEGACY_ENTRY *Next;
EG_IMAGE *Image; EG_IMAGE *Image;
EG_IMAGE *DriveImage; EG_IMAGE *DriveImage;
CHAR16 *ImagePath; CONST CHAR16 *ImagePath;
CHAR16 *DriveImagePath; CONST CHAR16 *DriveImagePath;
CHAR16 *Volume; CONST CHAR16 *Volume;
CHAR16 *FullTitle; CONST CHAR16 *FullTitle;
CHAR16 *Title; CONST CHAR16 *Title;
CHAR16 Hotkey; CHAR16 Hotkey;
UINT8 Flags; UINT8 Flags;
UINT8 Type; UINT8 Type;
@ -1414,7 +1416,7 @@ typedef struct {
UINT32 pad1; UINT32 pad1;
UINT32 ModuleSize; UINT32 ModuleSize;
UINT32 Frequency; UINT32 Frequency;
CHAR8* Vendor; CONST CHAR8* Vendor;
CHAR8* PartNo; CHAR8* PartNo;
CHAR8* SerialNo; CHAR8* SerialNo;
} RAM_SLOT_INFO; } RAM_SLOT_INFO;
@ -1579,7 +1581,7 @@ typedef struct {
/// ///
/// Null terminated BootOption Description (pointer to 6th byte of Variable). /// Null terminated BootOption Description (pointer to 6th byte of Variable).
/// ///
CHAR16 *Description; CONST CHAR16 *Description;
/// ///
/// Size in bytes of BootOption Description. /// Size in bytes of BootOption Description.
/// ///
@ -1614,29 +1616,29 @@ extern BOOLEAN DoHibernateWake;
/* Switch for APFS support */ /* Switch for APFS support */
extern UINTN APFSUUIDBankCounter; extern UINTN APFSUUIDBankCounter;
extern UINT8 *APFSUUIDBank; extern UINT8 *APFSUUIDBank;
extern CHAR16 **SystemPlists; extern CONST CHAR16 **SystemPlists;
extern CHAR16 **InstallPlists; extern CONST CHAR16 **InstallPlists;
extern CHAR16 **RecoveryPlists; extern CONST CHAR16 **RecoveryPlists;
extern EFI_GUID APFSSignature; extern EFI_GUID APFSSignature;
extern BOOLEAN APFSSupport; extern BOOLEAN APFSSupport;
//extern UINT32 gCpuSpeed; //kHz //extern UINT32 gCpuSpeed; //kHz
//extern UINT16 gCPUtype; //extern UINT16 gCPUtype;
extern UINT64 TurboMsr; extern UINT64 TurboMsr;
extern CHAR8 *BiosVendor; extern CONST CHAR8 *BiosVendor;
extern EFI_GUID *gEfiBootDeviceGuid; extern EFI_GUID *gEfiBootDeviceGuid;
extern EFI_DEVICE_PATH_PROTOCOL *gEfiBootDeviceData; extern EFI_DEVICE_PATH_PROTOCOL *gEfiBootDeviceData;
extern CHAR8 *AppleSystemVersion[]; extern CHAR8 *AppleSystemVersion[];
extern CHAR8 *AppleFirmwareVersion[]; extern CHAR8 *AppleFirmwareVersion[];
extern CHAR8 *AppleReleaseDate[]; extern CHAR8 *AppleReleaseDate[];
extern CHAR8 *AppleManufacturer; extern CONST CHAR8 *AppleManufacturer;
extern CHAR8 *AppleProductName[]; extern CHAR8 *AppleProductName[];
extern CHAR8 *AppleSystemVersion[]; extern CHAR8 *AppleSystemVersion[];
extern CHAR8 *AppleSerialNumber[]; extern CHAR8 *AppleSerialNumber[];
extern CHAR8 *AppleFamilies[]; extern CHAR8 *AppleFamilies[];
extern CHAR8 *AppleBoardID[]; extern CHAR8 *AppleBoardID[];
extern CHAR8 *AppleChassisAsset[]; extern CHAR8 *AppleChassisAsset[];
extern CHAR8 *AppleBoardSN; extern CONST CHAR8 *AppleBoardSN;
extern CHAR8 *AppleBoardLocation; extern CONST CHAR8 *AppleBoardLocation;
extern EFI_SYSTEM_TABLE *gST; extern EFI_SYSTEM_TABLE *gST;
extern EFI_BOOT_SERVICES *gBS; extern EFI_BOOT_SERVICES *gBS;
extern SETTINGS_DATA gSettings; extern SETTINGS_DATA gSettings;
@ -1715,7 +1717,7 @@ extern SIDELOAD_KEXT *InjectKextList;
// Hold theme fixed IconFormat / extension // Hold theme fixed IconFormat / extension
extern CHAR16 *IconFormat; extern CHAR16 *IconFormat;
extern CHAR16 *gFirmwareRevision; extern CONST CHAR16 *gFirmwareRevision;
extern BOOLEAN ResumeFromCoreStorage; extern BOOLEAN ResumeFromCoreStorage;
extern BOOLEAN gRemapSmBiosIsRequire; // syscl: pass argument for Dell SMBIOS here extern BOOLEAN gRemapSmBiosIsRequire; // syscl: pass argument for Dell SMBIOS here
@ -1772,7 +1774,7 @@ SetupBooterLog (
EFI_STATUS EFI_STATUS
SaveBooterLog ( SaveBooterLog (
IN EFI_FILE_HANDLE BaseDir OPTIONAL, IN EFI_FILE_HANDLE BaseDir OPTIONAL,
IN CHAR16 *FileName IN CONST CHAR16 *FileName
); );
VOID VOID
@ -1868,9 +1870,9 @@ CHAR8
IN LOADER_ENTRY *Entry IN LOADER_ENTRY *Entry
); );
CHAR16 CONST CHAR16
*GetOSIconName ( *GetOSIconName (
IN CHAR8 *OSVersion IN CONST CHAR8 *OSVersion
); );
EFI_STATUS EFI_STATUS
@ -1897,7 +1899,7 @@ InitTheme (
); );
EFI_STATUS EFI_STATUS
StartupSoundPlay(EFI_FILE *Dir, CHAR16* SoundFile); StartupSoundPlay(EFI_FILE *Dir, CONST CHAR16* SoundFile);
VOID GetOutputs(); VOID GetOutputs();
@ -1938,7 +1940,7 @@ ParseLoadOptions (
// //
VOID VOID
*GetNvramVariable ( *GetNvramVariable (
IN CHAR16 *VariableName, IN CONST CHAR16 *VariableName,
IN EFI_GUID *VendorGuid, IN EFI_GUID *VendorGuid,
OUT UINT32 *Attributes OPTIONAL, OUT UINT32 *Attributes OPTIONAL,
OUT UINTN *DataSize OPTIONAL OUT UINTN *DataSize OPTIONAL
@ -1946,7 +1948,7 @@ VOID
EFI_STATUS EFI_STATUS
AddNvramVariable ( AddNvramVariable (
IN CHAR16 *VariableName, IN CONST CHAR16 *VariableName,
IN EFI_GUID *VendorGuid, IN EFI_GUID *VendorGuid,
IN UINT32 Attributes, IN UINT32 Attributes,
IN UINTN DataSize, IN UINTN DataSize,
@ -1955,7 +1957,7 @@ AddNvramVariable (
EFI_STATUS EFI_STATUS
SetNvramVariable ( SetNvramVariable (
IN CHAR16 *VariableName, IN CONST CHAR16 *VariableName,
IN EFI_GUID *VendorGuid, IN EFI_GUID *VendorGuid,
IN UINT32 Attributes, IN UINT32 Attributes,
IN UINTN DataSize, IN UINTN DataSize,
@ -1964,7 +1966,7 @@ SetNvramVariable (
EFI_STATUS EFI_STATUS
DeleteNvramVariable ( DeleteNvramVariable (
IN CHAR16 *VariableName, IN CONST CHAR16 *VariableName,
IN EFI_GUID *VendorGuid IN EFI_GUID *VendorGuid
); );
@ -2008,7 +2010,7 @@ FindStartupDiskVolume (
EFI_STATUS EFI_STATUS
SetStartupDiskVolume ( SetStartupDiskVolume (
IN REFIT_VOLUME *Volume, IN REFIT_VOLUME *Volume,
IN CHAR16 *LoaderPath IN CONST CHAR16 *LoaderPath
); );
VOID VOID
@ -2022,7 +2024,7 @@ EFI_STATUS
EFIAPI EFIAPI
LogDataHub ( LogDataHub (
EFI_GUID *TypeGuid, EFI_GUID *TypeGuid,
CHAR16 *Name, CONST CHAR16 *Name,
VOID *Data, VOID *Data,
UINT32 DataSize UINT32 DataSize
); );
@ -2058,7 +2060,7 @@ setup_gma_devprop (
pci_dt_t *gma_dev pci_dt_t *gma_dev
); );
CHAR8 CONST CHAR8
*get_gma_model ( *get_gma_model (
IN UINT16 DeviceID IN UINT16 DeviceID
); );
@ -2083,7 +2085,7 @@ setup_nvidia_devprop (
pci_dt_t *nvda_dev pci_dt_t *nvda_dev
); );
CHAR8 CONST CHAR8
*get_nvidia_model ( *get_nvidia_model (
UINT32 device_id, UINT32 device_id,
UINT32 subsys_id, UINT32 subsys_id,
@ -2126,7 +2128,7 @@ EFI_STATUS
PatchACPI(IN REFIT_VOLUME *Volume, CHAR8 *OSVersion); PatchACPI(IN REFIT_VOLUME *Volume, CHAR8 *OSVersion);
EFI_STATUS EFI_STATUS
PatchACPI_OtherOS(CHAR16* OsSubdir, BOOLEAN DropSSDT); PatchACPI_OtherOS(CONST CHAR16* OsSubdir, BOOLEAN DropSSDT);
UINT8 UINT8
Checksum8 ( Checksum8 (
@ -2279,7 +2281,7 @@ SaveSettings (VOID);
UINTN UINTN
iStrLen( iStrLen(
CHAR8* String, CONST CHAR8* String,
UINTN MaxLen UINTN MaxLen
); );
@ -2343,8 +2345,8 @@ INTN
countOccurrences(CHAR8 *s, CHAR8 c); countOccurrences(CHAR8 *s, CHAR8 c);
CHAR16 *AddLoadOption(IN CHAR16 *LoadOptions, IN CHAR16 *LoadOption); CHAR16 *AddLoadOption(IN CONST CHAR16 *LoadOptions, IN CONST CHAR16 *LoadOption);
CHAR16 *RemoveLoadOption(IN CHAR16 *LoadOptions, IN CHAR16 *LoadOption); CHAR16 *RemoveLoadOption(IN CONST CHAR16 *LoadOptions, IN CONST CHAR16 *LoadOption);
// //
// BootOptions.c // BootOptions.c
@ -2419,9 +2421,9 @@ FindBootOptionForFile (
EFI_STATUS EFI_STATUS
AddBootOptionForFile ( AddBootOptionForFile (
IN EFI_HANDLE FileDeviceHandle, IN EFI_HANDLE FileDeviceHandle,
IN CHAR16 *FileName, IN CONST CHAR16 *FileName,
IN BOOLEAN UseShortForm, IN BOOLEAN UseShortForm,
IN CHAR16 *Description, IN CONST CHAR16 *Description,
IN UINT8 *OptionalData, IN UINT8 *OptionalData,
IN UINTN OptionalDataSize, IN UINTN OptionalDataSize,
IN UINTN BootIndex, IN UINTN BootIndex,
@ -2439,7 +2441,7 @@ DeleteBootOption (
EFI_STATUS EFI_STATUS
DeleteBootOptionForFile ( DeleteBootOptionForFile (
IN EFI_HANDLE FileDeviceHandle, IN EFI_HANDLE FileDeviceHandle,
IN CHAR16 *FileName IN CONST CHAR16 *FileName
); );
/** Deletes all boot option that points to a file which contains FileName in it's path. */ /** Deletes all boot option that points to a file which contains FileName in it's path. */
@ -2474,7 +2476,7 @@ RegisterDriversToHighestPriority (
EFI_STATUS EFI_STATUS
LoadUserSettings ( LoadUserSettings (
IN EFI_FILE *RootDir, IN EFI_FILE *RootDir,
CHAR16 *ConfName, CONST CHAR16 *ConfName,
TagPtr *dict TagPtr *dict
); );
@ -2516,15 +2518,15 @@ PrepareHibernation (
// //
INTN INTN
StrniCmp ( StrniCmp (
IN CHAR16 *Str1, IN CONST CHAR16 *Str1,
IN CHAR16 *Str2, IN CONST CHAR16 *Str2,
IN UINTN Count IN UINTN Count
); );
CHAR16 CONST CHAR16
*StriStr( *StriStr(
IN CHAR16 *Str, IN CONST CHAR16 *Str,
IN CHAR16 *SearchFor IN CONST CHAR16 *SearchFor
); );
VOID VOID
@ -2534,18 +2536,14 @@ StrToLower (
VOID VOID
AlertMessage ( AlertMessage (
IN CHAR16 *Title, IN CONST CHAR16 *Title,
IN CHAR16 *Message IN CONST CHAR16 *Message
); );
BOOLEAN BOOLEAN
YesNoMessage ( YesNoMessage (
IN CHAR16 *Title, IN CONST CHAR16 *Title,
IN CHAR16 *Message); IN CONST CHAR16 *Message);
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -77,9 +77,9 @@ UINT16 dropDSM;
BOOLEAN GetLegacyLanAddress; BOOLEAN GetLegacyLanAddress;
BOOLEAN ResumeFromCoreStorage; BOOLEAN ResumeFromCoreStorage;
BOOLEAN gRemapSmBiosIsRequire; BOOLEAN gRemapSmBiosIsRequire;
CHAR16 **SystemPlists = NULL; CONST CHAR16 **SystemPlists = NULL;
CHAR16 **InstallPlists = NULL; CONST CHAR16 **InstallPlists = NULL;
CHAR16 **RecoveryPlists = NULL; CONST CHAR16 **RecoveryPlists = NULL;
// QPI // QPI
BOOLEAN SetTable132 = FALSE; BOOLEAN SetTable132 = FALSE;
@ -342,7 +342,7 @@ ParseLoadOptions (
CHAR8 *Start; CHAR8 *Start;
UINTN TailSize; UINTN TailSize;
UINTN i; UINTN i;
CHAR8 *PlistStrings[] = CONST CHAR8 *PlistStrings[] =
{ {
"<?xml", "<?xml",
"<!DOCTYPE plist", "<!DOCTYPE plist",
@ -560,7 +560,7 @@ SetBootCurrent(REFIT_MENU_ENTRY *LoadedEntry)
UINT8 UINT8
*GetDataSetting ( *GetDataSetting (
IN TagPtr Dict, IN TagPtr Dict,
IN CHAR8 *PropName, IN CONST CHAR8 *PropName,
OUT UINTN *DataLen OUT UINTN *DataLen
) )
{ {
@ -611,7 +611,7 @@ UINT8
EFI_STATUS EFI_STATUS
LoadUserSettings ( LoadUserSettings (
IN EFI_FILE *RootDir, IN EFI_FILE *RootDir,
IN CHAR16 *ConfName, IN CONST CHAR16 *ConfName,
TagPtr *Dict) TagPtr *Dict)
{ {
EFI_STATUS Status = EFI_NOT_FOUND; EFI_STATUS Status = EFI_NOT_FOUND;
@ -1819,7 +1819,7 @@ FillinCustomEntry (
Prop = GetProperty (DictPointer, "AddArguments"); Prop = GetProperty (DictPointer, "AddArguments");
if (Prop != NULL && (Prop->type == kTagTypeString)) { if (Prop != NULL && (Prop->type == kTagTypeString)) {
if (Entry->Options != NULL) { if (Entry->Options != NULL) {
CHAR16 *OldOptions = Entry->Options; CONST CHAR16 *OldOptions = Entry->Options;
Entry->Options = PoolPrint (L"%s %a", OldOptions, Prop->string); Entry->Options = PoolPrint (L"%s %a", OldOptions, Prop->string);
FreePool (OldOptions); FreePool (OldOptions);
} else { } else {
@ -6508,14 +6508,14 @@ GetUserSettings(
return EFI_SUCCESS; return EFI_SUCCESS;
} }
static CHAR8 *SearchString ( static CONST CHAR8 *SearchString (
IN CHAR8 *Source, IN CONST CHAR8 *Source,
IN UINT64 SourceSize, IN UINT64 SourceSize,
IN CHAR8 *Search, IN CONST CHAR8 *Search,
IN UINTN SearchSize IN UINTN SearchSize
) )
{ {
CHAR8 *End = Source + SourceSize; CONST CHAR8 *End = Source + SourceSize;
while (Source < End) { while (Source < End) {
if (CompareMem(Source, Search, SearchSize) == 0) { if (CompareMem(Source, Search, SearchSize) == 0) {
@ -6572,7 +6572,7 @@ CHAR8 *GetOSVersion(IN LOADER_ENTRY *Entry)
// 1st stage - 1 // 1st stage - 1
// Check for plist - createinstallmedia/BaseSystem/InstallDVD/InstallESD // Check for plist - createinstallmedia/BaseSystem/InstallDVD/InstallESD
CHAR16 *InstallerPlist = L"\\.IABootFilesSystemVersion.plist"; // 10.9 - 10.13.3 CONST CHAR16 *InstallerPlist = L"\\.IABootFilesSystemVersion.plist"; // 10.9 - 10.13.3
if (!FileExists (Entry->Volume->RootDir, InstallerPlist) && FileExists (Entry->Volume->RootDir, L"\\System\\Library\\CoreServices\\boot.efi") && if (!FileExists (Entry->Volume->RootDir, InstallerPlist) && FileExists (Entry->Volume->RootDir, L"\\System\\Library\\CoreServices\\boot.efi") &&
((FileExists (Entry->Volume->RootDir, L"\\BaseSystem.dmg") && FileExists (Entry->Volume->RootDir, L"\\mach_kernel")) || // 10.7/10.8 ((FileExists (Entry->Volume->RootDir, L"\\BaseSystem.dmg") && FileExists (Entry->Volume->RootDir, L"\\mach_kernel")) || // 10.7/10.8
FileExists (Entry->Volume->RootDir, L"\\System\\Installation\\CDIS\\Mac OS X Installer.app") || // 10.6/10.7 FileExists (Entry->Volume->RootDir, L"\\System\\Installation\\CDIS\\Mac OS X Installer.app") || // 10.6/10.7
@ -6678,13 +6678,13 @@ CHAR8 *GetOSVersion(IN LOADER_ENTRY *Entry)
// Check for ia.log - InstallESD/createinstallmedia/startosinstall // Check for ia.log - InstallESD/createinstallmedia/startosinstall
// Implemented by Sherlocks // Implemented by Sherlocks
if (OSVersion == NULL) { if (OSVersion == NULL) {
CHAR8 *s, *fileBuffer, *targetString; CONST CHAR8 *s, *fileBuffer, *targetString;
CHAR8 *Res5 = (__typeof__(Res5))AllocateZeroPool(5); CHAR8 *Res5 = (__typeof__(Res5))AllocateZeroPool(5);
CHAR8 *Res6 = (__typeof__(Res6))AllocateZeroPool(6); CHAR8 *Res6 = (__typeof__(Res6))AllocateZeroPool(6);
CHAR8 *Res7 = (__typeof__(Res7))AllocateZeroPool(7); CHAR8 *Res7 = (__typeof__(Res7))AllocateZeroPool(7);
CHAR8 *Res8 = (__typeof__(Res8))AllocateZeroPool(8); CHAR8 *Res8 = (__typeof__(Res8))AllocateZeroPool(8);
UINTN fileLen = 0; UINTN fileLen = 0;
CHAR16 *InstallerLog = L"\\Mac OS X Install Data\\ia.log"; // 10.7 CONST CHAR16 *InstallerLog = L"\\Mac OS X Install Data\\ia.log"; // 10.7
if (!FileExists (Entry->Volume->RootDir, InstallerLog)) { if (!FileExists (Entry->Volume->RootDir, InstallerLog)) {
InstallerLog = L"\\OS X Install Data\\ia.log"; // 10.8 - 10.11 InstallerLog = L"\\OS X Install Data\\ia.log"; // 10.8 - 10.11
if (!FileExists (Entry->Volume->RootDir, InstallerLog)) { if (!FileExists (Entry->Volume->RootDir, InstallerLog)) {
@ -6806,12 +6806,12 @@ CHAR8 *GetOSVersion(IN LOADER_ENTRY *Entry)
return OSVersion; return OSVersion;
} }
CHAR16 CONST CHAR16
*GetOSIconName ( *GetOSIconName (
IN CHAR8 *OSVersion IN CONST CHAR8 *OSVersion
) )
{ {
CHAR16 *OSIconName; CONST CHAR16 *OSIconName;
if (OSVersion == NULL) { if (OSVersion == NULL) {
OSIconName = L"mac"; OSIconName = L"mac";
} else if (AsciiStrStr (OSVersion, "10.15") != 0) { } else if (AsciiStrStr (OSVersion, "10.15") != 0) {
@ -6868,9 +6868,9 @@ GetRootUUID (IN REFIT_VOLUME *Volume)
TagPtr Prop; TagPtr Prop;
CHAR16 Uuid[40]; CHAR16 Uuid[40];
CHAR16* SystemPlistR; CONST CHAR16* SystemPlistR;
CHAR16* SystemPlistP; CONST CHAR16* SystemPlistP;
CHAR16* SystemPlistS; CONST CHAR16* SystemPlistS;
BOOLEAN HasRock; BOOLEAN HasRock;
BOOLEAN HasPaper; BOOLEAN HasPaper;
@ -7029,7 +7029,7 @@ GetDevices ()
((Pci.Hdr.ClassCode[1] == (PCI_CLASS_DISPLAY_VGA)) || ((Pci.Hdr.ClassCode[1] == (PCI_CLASS_DISPLAY_VGA)) ||
(Pci.Hdr.ClassCode[1] == (PCI_CLASS_DISPLAY_OTHER))) && (Pci.Hdr.ClassCode[1] == (PCI_CLASS_DISPLAY_OTHER))) &&
(NGFX < 4)) { (NGFX < 4)) {
CHAR8 *CardFamily = ""; CONST CHAR8 *CardFamily = "";
UINT16 UFamily; UINT16 UFamily;
GFX_PROPERTIES *gfx = &gGraphics[NGFX]; GFX_PROPERTIES *gfx = &gGraphics[NGFX];

View File

@ -58,7 +58,7 @@ EFI_AUDIO_IO_PROTOCOL *AudioIo = NULL;
EFI_STATUS EFI_STATUS
StartupSoundPlay(EFI_FILE *Dir, CHAR16* SoundFile) StartupSoundPlay(EFI_FILE *Dir, CONST CHAR16* SoundFile)
{ {
EFI_STATUS Status = EFI_NOT_FOUND; EFI_STATUS Status = EFI_NOT_FOUND;
UINT8 *FileData = NULL; UINT8 *FileData = NULL;

View File

@ -1452,7 +1452,7 @@ BOOLEAN get_binimage_owr(value_t *val, INTN index, BOOLEAN Sier)
BOOLEAN get_romrevision_val(value_t *val, INTN index, BOOLEAN Sier) BOOLEAN get_romrevision_val(value_t *val, INTN index, BOOLEAN Sier)
{ {
CHAR8* cRev="109-B77101-00"; CONST CHAR8* cRev="109-B77101-00";
UINT8 *rev; UINT8 *rev;
if (!card->rom){ if (!card->rom){
val->type = kPtr; val->type = kPtr;
@ -1561,12 +1561,14 @@ VOID devprop_add_list(AtiDevProp devprop_list[], CHAR8 *OSVersion)
if (devprop_list[i].all_ports) { if (devprop_list[i].all_ports) {
for (pnum = 1; pnum < card->ports; pnum++) { for (pnum = 1; pnum < card->ports; pnum++) {
if (devprop_list[i].get_value(val, pnum, Sier)) { if (devprop_list[i].get_value(val, pnum, Sier)) {
devprop_list[i].name[1] = (CHAR8)(0x30 + pnum); // convert to ascii char newname[AsciiStrLen(devprop_list[i].name)+1];
devprop_add_value(card->device, devprop_list[i].name, val->data, val->size); AsciiStrCpy(newname, devprop_list[i].name);
newname[1] = (CHAR8)(0x30 + pnum); // convert to ascii
devprop_add_value(card->device, newname, val->data, val->size);
free_val(val); free_val(val);
} }
} }
devprop_list[i].name[1] = 0x30; // write back our "@0," for a next possible card // devprop_list[i].name[1] = 0x30; // write back our "@0," for a next possible card
} }
} else { } else {
if (devprop_list[i].default_val.type != kNul) { if (devprop_list[i].default_val.type != kNul) {
@ -1579,14 +1581,15 @@ VOID devprop_add_list(AtiDevProp devprop_list[], CHAR8 *OSVersion)
if (devprop_list[i].all_ports) { if (devprop_list[i].all_ports) {
for (pnum = 1; pnum < card->ports; pnum++) { for (pnum = 1; pnum < card->ports; pnum++) {
if (devprop_list[i].default_val.type != kNul) { if (devprop_list[i].default_val.type != kNul) {
devprop_list[i].name[1] = (CHAR8)(0x30 + pnum); // convert to ascii char newname[AsciiStrLen(devprop_list[i].name)+1];
devprop_add_value(card->device, devprop_list[i].name, newname[1] = (CHAR8)(0x30 + pnum); // convert to ascii
devprop_add_value(card->device, newname,
devprop_list[i].default_val.type == kCst ? devprop_list[i].default_val.type == kCst ?
(UINT8 *)&(devprop_list[i].default_val.data) : devprop_list[i].default_val.data, (UINT8 *)&(devprop_list[i].default_val.data) : devprop_list[i].default_val.data,
devprop_list[i].default_val.size); devprop_list[i].default_val.size);
} }
} }
devprop_list[i].name[1] = 0x30; // write back our "@0," for a next possible card // devprop_list[i].name[1] = 0x30; // write back our "@0," for a next possible card
} }
} }
} }

View File

@ -277,7 +277,7 @@ typedef struct {
typedef struct { typedef struct {
UINT32 flags; UINT32 flags;
BOOLEAN all_ports; BOOLEAN all_ports;
CHAR8 *name; CONST CHAR8 *name;
BOOLEAN (*get_value)(value_t *val, INTN index, BOOLEAN Sier); BOOLEAN (*get_value)(value_t *val, INTN index, BOOLEAN Sier);
value_t default_val; value_t default_val;
} AtiDevProp; } AtiDevProp;

View File

@ -104,12 +104,12 @@ CARDLIST* FindCardWithIds(UINT32 Id, UINT32 SubId)
VOID FillCardList(TagPtr CfgDict) VOID FillCardList(TagPtr CfgDict)
{ {
if (IsListEmpty(&gCardList) && (CfgDict != NULL)) { if (IsListEmpty(&gCardList) && (CfgDict != NULL)) {
CHAR8 *VEN[] = { "NVIDIA", "ATI" }; CONST CHAR8 *VEN[] = { "NVIDIA", "ATI" };
INTN Index, Count = sizeof(VEN) / sizeof(VEN[0]); INTN Index, Count = sizeof(VEN) / sizeof(VEN[0]);
TagPtr prop; TagPtr prop;
for (Index = 0; Index < Count; Index++) { for (Index = 0; Index < Count; Index++) {
CHAR8 *key = VEN[Index]; CONST CHAR8 *key = VEN[Index];
prop = GetProperty(CfgDict, key); prop = GetProperty(CfgDict, key);
if(prop && (prop->type == kTagTypeArray)) { if(prop && (prop->type == kTagTypeArray)) {
@ -120,7 +120,7 @@ VOID FillCardList(TagPtr CfgDict)
TagPtr prop2 = 0; TagPtr prop2 = 0;
count = GetTagCount(prop); count = GetTagCount(prop);
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
CHAR8 *model_name = NULL; CONST CHAR8 *model_name = NULL;
UINT32 dev_id = 0; UINT32 dev_id = 0;
UINT32 subdev_id = 0; UINT32 subdev_id = 0;
UINT64 VramSize = 0; UINT64 VramSize = 0;

View File

@ -210,7 +210,7 @@ DevPropDevice *devprop_add_device_pci(DevPropString *StringBuf, pci_dt_t *PciDt,
BOOLEAN devprop_add_value(DevPropDevice *device, CHAR8 *nm, UINT8 *vl, UINTN len) BOOLEAN devprop_add_value(DevPropDevice *device, CONST CHAR8 *nm, UINT8 *vl, UINTN len)
{ {
UINT32 offset; UINT32 offset;
UINT32 off; UINT32 off;

View File

@ -162,7 +162,7 @@ extern UINT32 device_inject_stringlength;
DevPropString *devprop_create_string(void); DevPropString *devprop_create_string(void);
//DevPropDevice *devprop_add_device(DevPropString *string, char *path); //DevPropDevice *devprop_add_device(DevPropString *string, char *path);
DevPropDevice *devprop_add_device_pci(DevPropString *string, pci_dt_t *PciDt, EFI_DEVICE_PATH_PROTOCOL *DevicePath); DevPropDevice *devprop_add_device_pci(DevPropString *string, pci_dt_t *PciDt, EFI_DEVICE_PATH_PROTOCOL *DevicePath);
BOOLEAN devprop_add_value(DevPropDevice *device, CHAR8 *nm, UINT8 *vl, UINTN len); BOOLEAN devprop_add_value(DevPropDevice *device, CONST CHAR8 *nm, UINT8 *vl, UINTN len);
CHAR8 *devprop_generate_string(DevPropString *string); CHAR8 *devprop_generate_string(DevPropString *string);
VOID devprop_free_string(DevPropString *string); VOID devprop_free_string(DevPropString *string);

View File

@ -78,7 +78,7 @@
#define DBG(...) DebugLog(DEBUG_GMA, __VA_ARGS__) #define DBG(...) DebugLog(DEBUG_GMA, __VA_ARGS__)
#endif #endif
CHAR16 *CFLFBPath = L"/System/Library/Extensions/AppleIntelCFLGraphicsFramebuffer.kext"; CONST CHAR16 *CFLFBPath = L"/System/Library/Extensions/AppleIntelCFLGraphicsFramebuffer.kext";
extern CHAR8* gDeviceProperties; extern CHAR8* gDeviceProperties;
extern CHAR8 ClassFix[]; extern CHAR8 ClassFix[];
@ -940,9 +940,9 @@ static struct gma_gpu_t KnownGPUS[] = {
}; };
CHAR8 *get_gma_model(UINT16 id) CONST CHAR8 *get_gma_model(UINT16 id)
{ {
INT32 i; UINTN i;
for (i = 0; i < (sizeof(KnownGPUS) / sizeof(KnownGPUS[0])); i++) for (i = 0; i < (sizeof(KnownGPUS) / sizeof(KnownGPUS[0])); i++)
{ {
@ -958,7 +958,7 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
UINTN j; UINTN j;
UINTN i; UINTN i;
CHAR8 *devicepath; CHAR8 *devicepath;
CHAR8 *model; CONST CHAR8 *model;
DevPropDevice *device = NULL; DevPropDevice *device = NULL;
UINT8 BuiltIn = 0x00; UINT8 BuiltIn = 0x00;
UINT32 FakeID; UINT32 FakeID;

View File

@ -6,7 +6,7 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev);
struct gma_gpu_t { struct gma_gpu_t {
UINT32 device; UINT32 device;
CHAR8 *name; CONST CHAR8 *name;
}; };
/* /*

View File

@ -872,7 +872,7 @@ BOOLEAN HaswellEXCPM(VOID *kernelData, LOADER_ENTRY *Entry, BOOLEAN use_xcpm_idl
{ {
DBG("HaswellEXCPM() ===>\n"); DBG("HaswellEXCPM() ===>\n");
UINT8 *kern = (UINT8*)kernelData; UINT8 *kern = (UINT8*)kernelData;
CHAR8 *comment; CONST CHAR8 *comment;
UINT32 i; UINT32 i;
UINT32 patchLocation; UINT32 patchLocation;
UINT64 os_version = AsciiOSVersionToUint64(Entry->OSVersion); UINT64 os_version = AsciiOSVersionToUint64(Entry->OSVersion);
@ -1067,7 +1067,7 @@ BOOLEAN HaswellLowEndXCPM(VOID *kernelData, LOADER_ENTRY *Entry, BOOLEAN use_xcp
DBG("HaswellLowEndXCPM() ===>\n"); DBG("HaswellLowEndXCPM() ===>\n");
UINT8 *kern = (UINT8*)kernelData; UINT8 *kern = (UINT8*)kernelData;
UINT64 os_version = AsciiOSVersionToUint64(Entry->OSVersion); UINT64 os_version = AsciiOSVersionToUint64(Entry->OSVersion);
CHAR8 *comment; CONST CHAR8 *comment;
// check OS version suit for patches // check OS version suit for patches
if (!IsXCPMOSVersionCompat(os_version)) { if (!IsXCPMOSVersionCompat(os_version)) {
@ -1137,7 +1137,7 @@ BOOLEAN HaswellLowEndXCPM(VOID *kernelData, LOADER_ENTRY *Entry, BOOLEAN use_xcp
BOOLEAN KernelIvyBridgeXCPM(VOID *kernelData, LOADER_ENTRY *Entry, BOOLEAN use_xcpm_idle) BOOLEAN KernelIvyBridgeXCPM(VOID *kernelData, LOADER_ENTRY *Entry, BOOLEAN use_xcpm_idle)
{ {
UINT8 *kern = (UINT8*)kernelData; UINT8 *kern = (UINT8*)kernelData;
CHAR8 *comment; CONST CHAR8 *comment;
UINT32 i; UINT32 i;
UINT32 patchLocation; UINT32 patchLocation;
UINT64 os_version = AsciiOSVersionToUint64(Entry->OSVersion); UINT64 os_version = AsciiOSVersionToUint64(Entry->OSVersion);
@ -1221,7 +1221,7 @@ BOOLEAN KernelIvyBridgeXCPM(VOID *kernelData, LOADER_ENTRY *Entry, BOOLEAN use_x
BOOLEAN KernelIvyE5XCPM(VOID *kernelData, LOADER_ENTRY *Entry, BOOLEAN use_xcpm_idle) BOOLEAN KernelIvyE5XCPM(VOID *kernelData, LOADER_ENTRY *Entry, BOOLEAN use_xcpm_idle)
{ {
UINT8 *kern = (UINT8*)kernelData; UINT8 *kern = (UINT8*)kernelData;
CHAR8 *comment; CONST CHAR8 *comment;
UINT32 i; UINT32 i;
UINT32 patchLocation; UINT32 patchLocation;
UINT64 os_version = AsciiOSVersionToUint64(Entry->OSVersion); UINT64 os_version = AsciiOSVersionToUint64(Entry->OSVersion);

View File

@ -288,7 +288,7 @@ VOID LoadPlugInKexts(IN LOADER_ENTRY *Entry, IN EFI_FILE *RootDir, IN CHAR16 *Di
DirIterClose(&PlugInIter); DirIterClose(&PlugInIter);
} }
VOID AddKexts(IN LOADER_ENTRY *Entry, CHAR16 *SrcDir, CHAR16 *Path/*, CHAR16 *UniSysVers*/, cpu_type_t archCpuType) VOID AddKexts(IN LOADER_ENTRY *Entry, CONST CHAR16 *SrcDir, CONST CHAR16 *Path/*, CHAR16 *UniSysVers*/, cpu_type_t archCpuType)
{ {
CHAR16 *FileName; CHAR16 *FileName;
CHAR16 *PlugInName; CHAR16 *PlugInName;
@ -342,8 +342,8 @@ EFI_STATUS LoadKexts(IN LOADER_ENTRY *Entry)
EFI_FILE_INFO *PlugInFile; EFI_FILE_INFO *PlugInFile;
CHAR16 *FileName; CHAR16 *FileName;
CHAR16 *PlugIns; CHAR16 *PlugIns;
CHAR16 *Arch = NULL; CONST CHAR16 *Arch = NULL;
CHAR16 *Ptr = NULL; CONST CHAR16 *Ptr = NULL;
#if defined(MDE_CPU_X64) #if defined(MDE_CPU_X64)
cpu_type_t archCpuType=CPU_TYPE_X86_64; cpu_type_t archCpuType=CPU_TYPE_X86_64;
#else #else

View File

@ -224,7 +224,7 @@ VOID ExtractKextBundleIdentifier(CHAR8 *Plist)
if (BIStart != NULL) { if (BIStart != NULL) {
BIStart += 8; // skip "<string>" BIStart += 8; // skip "<string>"
BIEnd = AsciiStrStr(BIStart, "</string>"); BIEnd = AsciiStrStr(BIStart, "</string>");
if (BIEnd != NULL && (BIEnd - BIStart + 1) < sizeof(gKextBundleIdentifier)) { if (BIEnd != NULL && (UINTN)(BIEnd - BIStart + 1) < sizeof(gKextBundleIdentifier)) { // (UINTN)(BIEnd - BIStart + 1) = valid cast because BIEnd is > BIStart
CopyMem(gKextBundleIdentifier, BIStart, BIEnd - BIStart); CopyMem(gKextBundleIdentifier, BIStart, BIEnd - BIStart);
gKextBundleIdentifier[BIEnd - BIStart] = '\0'; gKextBundleIdentifier[BIEnd - BIStart] = '\0';
return; return;
@ -1139,7 +1139,7 @@ VOID PatchKext(UINT8 *Driver, UINT32 DriverSize, CHAR8 *InfoPlist, UINT32 InfoPl
// This func is hard to read and debug and probably not reliable, // This func is hard to read and debug and probably not reliable,
// but it seems it works. // but it seems it works.
// //
UINT64 GetPlistHexValue(CHAR8 *Plist, CHAR8 *Key, CHAR8 *WholePlist) UINT64 GetPlistHexValue(CONST CHAR8 *Plist, CONST CHAR8 *Key, CONST CHAR8 *WholePlist)
{ {
CHAR8 *Value; CHAR8 *Value;
CHAR8 *IntTag; CHAR8 *IntTag;

View File

@ -48,7 +48,7 @@
typedef struct _vidTag { typedef struct _vidTag {
UINT8 bank; UINT8 bank;
UINT8 code; UINT8 code;
CHAR8* name; CONST CHAR8* name;
} VenIdName; } VenIdName;
VenIdName vendorMap[] = { VenIdName vendorMap[] = {

View File

@ -2004,9 +2004,9 @@ static INT32 patch_nvidia_rom(UINT8 *rom)
return (has_lvds ? PATCH_ROM_SUCCESS_HAS_LVDS : PATCH_ROM_SUCCESS); return (has_lvds ? PATCH_ROM_SUCCESS_HAS_LVDS : PATCH_ROM_SUCCESS);
} }
CHAR8 *get_nvidia_model(UINT32 device_id, UINT32 subsys_id, CARDLIST * nvcard) CONST CHAR8 *get_nvidia_model(UINT32 device_id, UINT32 subsys_id, CARDLIST * nvcard)
{ {
INT32 i, j; UINTN i, j;
//DBG("get_nvidia_model for (%08x, %08x)\n", device_id, subsys_id); //DBG("get_nvidia_model for (%08x, %08x)\n", device_id, subsys_id);
//ErmaC added selector for nVidia "old" style in System Profiler //ErmaC added selector for nVidia "old" style in System Profiler
@ -2183,7 +2183,7 @@ BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev)
// UINT32 boot_display = 0; // UINT32 boot_display = 0;
//UINT32 subsystem; //UINT32 subsystem;
INT32 nvPatch = 0; INT32 nvPatch = 0;
CHAR8 *model = NULL; CONST CHAR8 *model = NULL;
CHAR16 FileName[64]; CHAR16 FileName[64];
UINT8 *buffer = NULL; UINT8 *buffer = NULL;
UINTN bufferLen = 0; UINTN bufferLen = 0;

View File

@ -59,14 +59,14 @@ extern CHAR8* gDeviceProperties;
typedef struct nvidia_pci_info_t typedef struct nvidia_pci_info_t
{ {
UINT32 device; // VendorID + DeviceID UINT32 device; // VendorID + DeviceID
CHAR8 *name_model; CONST CHAR8 *name_model;
} nvidia_pci_info_t; } nvidia_pci_info_t;
typedef struct nvidia_card_info_t typedef struct nvidia_card_info_t
{ {
UINT32 device; // VendorID + DeviceID UINT32 device; // VendorID + DeviceID
UINT32 subdev; // SubdeviceID + SubvendorID UINT32 subdev; // SubdeviceID + SubvendorID
CHAR8 *name_model; CONST CHAR8 *name_model;
UINT8 *custom_NVCAP; UINT8 *custom_NVCAP;
} nvidia_card_info_t; } nvidia_card_info_t;

View File

@ -7,12 +7,12 @@
/* Machine Default Data */ /* Machine Default Data */
CHAR8 *DefaultMemEntry = "N/A"; CONST CHAR8 *DefaultMemEntry = "N/A";
CHAR8 *DefaultSerial = "CT288GT9VT6"; CONST CHAR8 *DefaultSerial = "CT288GT9VT6";
CHAR8 *BiosVendor = "Apple Inc."; CONST CHAR8 *BiosVendor = "Apple Inc.";
CHAR8 *AppleManufacturer = "Apple Computer, Inc."; //Old name, before 2007 CONST CHAR8 *AppleManufacturer = "Apple Computer, Inc."; //Old name, before 2007
CHAR8 *AppleBoardSN = "C02140302D5DMT31M"; CONST CHAR8 *AppleBoardSN = "C02140302D5DMT31M";
CHAR8 *AppleBoardLocation = "Part Component"; CONST CHAR8 *AppleBoardLocation = "Part Component";
UINT32 gFwFeatures; UINT32 gFwFeatures;
UINT32 gFwFeaturesMask; UINT32 gFwFeaturesMask;

View File

@ -60,7 +60,7 @@ EFI_STATUS ParseTagBoolean(CHAR8* buffer, TagPtr * tag, UINT32 type,UINT32* lenP
//INTN GetTagCount( TagPtr dict ); //INTN GetTagCount( TagPtr dict );
TagPtr NewTag( void ); TagPtr NewTag( void );
EFI_STATUS FixDataMatchingTag( CHAR8* buffer, CHAR8* tag,UINT32* lenPtr); EFI_STATUS FixDataMatchingTag( CHAR8* buffer, CONST CHAR8* tag,UINT32* lenPtr);
CHAR8* NewSymbol(CHAR8* string); CHAR8* NewSymbol(CHAR8* string);
VOID FreeSymbol(CHAR8* string); VOID FreeSymbol(CHAR8* string);
SymbolPtr FindSymbol( char * string, SymbolPtr * prevSymbol ); SymbolPtr FindSymbol( char * string, SymbolPtr * prevSymbol );
@ -437,7 +437,8 @@ EFI_STATUS XMLParseNextTag(CHAR8* buffer, TagPtr* tag, UINT32* lenPtr)
return Status; return Status;
} }
if (length == -1) { // TODO jief : seems to me that length cannot be -1. Added the cast anyway to avoid regression. If confirmed, the next 3 lines must be removed.
if (length == (UINT32)-1) {
DBG("(length == -1)\n"); DBG("(length == -1)\n");
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
@ -831,7 +832,7 @@ EFI_STATUS GetNextTag( UINT8* buffer, CHAR8** tag, UINT32* start, UINT32* length
*length = cnt2 + 1; //unreal to be -1. This is UINT32 *length = cnt2 + 1; //unreal to be -1. This is UINT32
if (*length == -1) { if (*length == (UINT32)-1) {
DBG("GetNextTag with *length == -1\n"); DBG("GetNextTag with *length == -1\n");
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
@ -845,7 +846,7 @@ EFI_STATUS GetNextTag( UINT8* buffer, CHAR8** tag, UINT32* start, UINT32* length
// Returns the length of the data found, counting the end tag, // Returns the length of the data found, counting the end tag,
// or -1 if the end tag was not found. // or -1 if the end tag was not found.
EFI_STATUS FixDataMatchingTag( CHAR8* buffer, CHAR8* tag, UINT32* lenPtr) EFI_STATUS FixDataMatchingTag( CHAR8* buffer, CONST CHAR8* tag, UINT32* lenPtr)
{ {
EFI_STATUS Status; EFI_STATUS Status;
UINT32 length; UINT32 length;
@ -869,7 +870,7 @@ EFI_STATUS FixDataMatchingTag( CHAR8* buffer, CHAR8* tag, UINT32* lenPtr)
buffer[start + stop] = '\0'; buffer[start + stop] = '\0';
*lenPtr = start + length; *lenPtr = start + length;
if (*lenPtr == -1) { if (*lenPtr == (UINTN)-1) { // Why is this test. -1 is UINTN_MAX.
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }

View File

@ -217,10 +217,10 @@ VOID* GetSmbiosTablesFromConfigTables (VOID)
// search restricted to MaxLen, for example // search restricted to MaxLen, for example
// iStrLen("ABC ", 20) == 3 // iStrLen("ABC ", 20) == 3
// if MaxLen=0 then as usual strlen but bugless // if MaxLen=0 then as usual strlen but bugless
UINTN iStrLen(CHAR8* String, UINTN MaxLen) UINTN iStrLen(CONST CHAR8* String, UINTN MaxLen)
{ {
UINTN Len = 0; UINTN Len = 0;
CHAR8* BA; CONST CHAR8* BA;
if(MaxLen > 0) { if(MaxLen > 0) {
for (Len=0; Len<MaxLen; Len++) { for (Len=0; Len<MaxLen; Len++) {
if (String[Len] == 0) { if (String[Len] == 0) {
@ -267,7 +267,7 @@ EFI_SMBIOS_HANDLE LogSmbiosTable (APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTableN)
return SmbiosTableN.Hdr->Handle; return SmbiosTableN.Hdr->Handle;
} }
EFI_STATUS UpdateSmbiosString (APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTableN, SMBIOS_TABLE_STRING* Field, CHAR8* Buffer) EFI_STATUS UpdateSmbiosString (CONST APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTableN, SMBIOS_TABLE_STRING* Field, CHAR8* Buffer)
{ {
CHAR8* AString; CHAR8* AString;
CHAR8* C1; //pointers for copy CHAR8* C1; //pointers for copy
@ -735,7 +735,6 @@ VOID PatchTableType4()
UINTN AddBrand = 0; UINTN AddBrand = 0;
CHAR8 BrandStr[48]; CHAR8 BrandStr[48];
UINT16 ProcChar = 0; UINT16 ProcChar = 0;
CHAR8 *SocketDesignationMac = "U2E1";
//Note. iMac11,2 has four tables for CPU i3 //Note. iMac11,2 has four tables for CPU i3
UINTN CpuNumber; UINTN CpuNumber;
@ -894,6 +893,8 @@ VOID PatchTableType4()
newSmbiosTable.Type4->ProcessorCharacteristics = ProcChar; newSmbiosTable.Type4->ProcessorCharacteristics = ProcChar;
} }
// TODO Jief : looks that the next line modify SocketDesignationMac, which is not used
CHAR8 SocketDesignationMac[] = "U2E1";
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type4->Socket, SocketDesignationMac); UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type4->Socket, SocketDesignationMac);
if (AddBrand) { if (AddBrand) {
@ -1346,19 +1347,25 @@ VOID PatchTableType17()
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->DeviceLocator, (CHAR8*)&deviceLocator[0]); UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->DeviceLocator, (CHAR8*)&deviceLocator[0]);
if ((gRAM.User[UserIndex].InUse) && (gRAM.User[UserIndex].ModuleSize > 0)) { if ((gRAM.User[UserIndex].InUse) && (gRAM.User[UserIndex].ModuleSize > 0)) {
if (iStrLen(gRAM.User[UserIndex].Vendor, 64) > 0) { if (iStrLen(gRAM.User[UserIndex].Vendor, 64) > 0) {
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->Manufacturer, gRAM.User[UserIndex].Vendor); CHAR8* vendor = (CHAR8*)AllocatePool(AsciiStrLen(gRAM.User[UserIndex].Vendor)+1); // this will never be freed. WIll be solved when using a string object.
AsciiStrCpy(vendor, gRAM.User[UserIndex].Vendor);
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->Manufacturer, vendor);
gRAM.User[UserIndex].Vendor = vendor;
} else { } else {
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->Manufacturer, "unknown"); CHAR8 unknown[] = "unknown";
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->Manufacturer, unknown);
} }
if (iStrLen(gRAM.User[UserIndex].SerialNo, 64) > 0) { if (iStrLen(gRAM.User[UserIndex].SerialNo, 64) > 0) {
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->SerialNumber, gRAM.User[UserIndex].SerialNo); UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->SerialNumber, gRAM.User[UserIndex].SerialNo);
} else { } else {
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->SerialNumber, "unknown"); CHAR8 unknown[] = "unknown";
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->SerialNumber, unknown);
} }
if (iStrLen(gRAM.User[UserIndex].PartNo, 64) > 0) { if (iStrLen(gRAM.User[UserIndex].PartNo, 64) > 0) {
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->PartNumber, gRAM.User[UserIndex].PartNo); UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->PartNumber, gRAM.User[UserIndex].PartNo);
} else { } else {
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->PartNumber, "unknown"); CHAR8 unknown[] = "unknown";
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->PartNumber, unknown);
} }
newSmbiosTable.Type17->Speed = (UINT16)gRAM.User[UserIndex].Frequency; newSmbiosTable.Type17->Speed = (UINT16)gRAM.User[UserIndex].Frequency;
if (gRAM.User[UserIndex].ModuleSize > 0x7FFF) { if (gRAM.User[UserIndex].ModuleSize > 0x7FFF) {
@ -1573,18 +1580,23 @@ VOID PatchTableType17()
CopyMem((VOID*)newSmbiosTable.Type17, (VOID *)SmbiosTable.Type17, TableSize); CopyMem((VOID*)newSmbiosTable.Type17, (VOID *)SmbiosTable.Type17, TableSize);
newSmbiosTable.Type17->AssetTag = 0; newSmbiosTable.Type17->AssetTag = 0;
if (iStrLen(gRAM.SMBIOS[SMBIOSIndex].Vendor, 64) > 0) { if (iStrLen(gRAM.SMBIOS[SMBIOSIndex].Vendor, 64) > 0) {
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->Manufacturer, gRAM.SMBIOS[SMBIOSIndex].Vendor); CHAR8* vendor = (CHAR8*)AllocatePool(AsciiStrLen(gRAM.SMBIOS[SMBIOSIndex].Vendor)+1); // this will never be freed. WIll be solved when using a string object.
AsciiStrCpy(vendor, gRAM.SMBIOS[SMBIOSIndex].Vendor);
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->Manufacturer, vendor);
gRAM.SMBIOS[SMBIOSIndex].Vendor = vendor;
AsciiSPrint(gSettings.MemoryManufacturer, 64, "%a", gRAM.SMBIOS[SMBIOSIndex].Vendor); AsciiSPrint(gSettings.MemoryManufacturer, 64, "%a", gRAM.SMBIOS[SMBIOSIndex].Vendor);
} else { } else {
// newSmbiosTable.Type17->Manufacturer = 0; // newSmbiosTable.Type17->Manufacturer = 0;
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->Manufacturer, "unknown"); CHAR8 unknown[] = "unknown";
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->Manufacturer, unknown);
} }
if (iStrLen(gRAM.SMBIOS[SMBIOSIndex].SerialNo, 64) > 0) { if (iStrLen(gRAM.SMBIOS[SMBIOSIndex].SerialNo, 64) > 0) {
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->SerialNumber, gRAM.SMBIOS[SMBIOSIndex].SerialNo); UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->SerialNumber, gRAM.SMBIOS[SMBIOSIndex].SerialNo);
AsciiSPrint(gSettings.MemorySerialNumber, 64, "%a", gRAM.SMBIOS[SMBIOSIndex].SerialNo); AsciiSPrint(gSettings.MemorySerialNumber, 64, "%a", gRAM.SMBIOS[SMBIOSIndex].SerialNo);
} else { } else {
// newSmbiosTable.Type17->SerialNumber = 0; // newSmbiosTable.Type17->SerialNumber = 0;
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->SerialNumber, "unknown"); CHAR8 unknown[] = "unknown";
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->SerialNumber, unknown);
} }
if (iStrLen(gRAM.SMBIOS[SMBIOSIndex].PartNo, 64) > 0) { if (iStrLen(gRAM.SMBIOS[SMBIOSIndex].PartNo, 64) > 0) {
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->PartNumber, gRAM.SMBIOS[SMBIOSIndex].PartNo); UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->PartNumber, gRAM.SMBIOS[SMBIOSIndex].PartNo);
@ -1592,7 +1604,8 @@ VOID PatchTableType17()
DBG(" partNum=%a\n", gRAM.SMBIOS[SMBIOSIndex].PartNo); DBG(" partNum=%a\n", gRAM.SMBIOS[SMBIOSIndex].PartNo);
} else { } else {
// newSmbiosTable.Type17->PartNumber = 0; // newSmbiosTable.Type17->PartNumber = 0;
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->PartNumber, "unknown"); CHAR8 unknown[] = "unknown";
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->PartNumber, unknown);
DBG(" partNum unknown\n"); DBG(" partNum unknown\n");
} }
} else { } else {
@ -1611,22 +1624,28 @@ VOID PatchTableType17()
if (gRAM.SPD[SPDIndex].InUse) { if (gRAM.SPD[SPDIndex].InUse) {
if (iStrLen(gRAM.SPD[SPDIndex].Vendor, 64) > 0) { if (iStrLen(gRAM.SPD[SPDIndex].Vendor, 64) > 0) {
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->Manufacturer, gRAM.SPD[SPDIndex].Vendor); CHAR8* vendor = (CHAR8*)AllocatePool(AsciiStrLen(gRAM.SPD[SPDIndex].Vendor)+1); // this will never be freed. WIll be solved when using a string object.
AsciiStrCpy(vendor, gRAM.SPD[SPDIndex].Vendor);
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->Manufacturer, vendor);
gRAM.SPD[SPDIndex].Vendor = vendor;
AsciiSPrint(gSettings.MemoryManufacturer, 64, "%a", gRAM.SPD[SPDIndex].Vendor); AsciiSPrint(gSettings.MemoryManufacturer, 64, "%a", gRAM.SPD[SPDIndex].Vendor);
} else { } else {
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->Manufacturer, "unknown"); CHAR8 unknown[] = "unknown";
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->Manufacturer, unknown);
} }
if (iStrLen(gRAM.SPD[SPDIndex].SerialNo, 64) > 0) { if (iStrLen(gRAM.SPD[SPDIndex].SerialNo, 64) > 0) {
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->SerialNumber, gRAM.SPD[SPDIndex].SerialNo); UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->SerialNumber, gRAM.SPD[SPDIndex].SerialNo);
AsciiSPrint(gSettings.MemorySerialNumber, 64, "%a", gRAM.SPD[SPDIndex].SerialNo); AsciiSPrint(gSettings.MemorySerialNumber, 64, "%a", gRAM.SPD[SPDIndex].SerialNo);
} else { } else {
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->SerialNumber, "unknown"); CHAR8 unknown[] = "unknown";
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->SerialNumber, unknown);
} }
if (iStrLen(gRAM.SPD[SPDIndex].PartNo, 64) > 0) { if (iStrLen(gRAM.SPD[SPDIndex].PartNo, 64) > 0) {
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->PartNumber, gRAM.SPD[SPDIndex].PartNo); UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->PartNumber, gRAM.SPD[SPDIndex].PartNo);
AsciiSPrint(gSettings.MemoryPartNumber, 64, "%a", gRAM.SPD[SPDIndex].PartNo); AsciiSPrint(gSettings.MemoryPartNumber, 64, "%a", gRAM.SPD[SPDIndex].PartNo);
} else { } else {
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->PartNumber, "unknown"); CHAR8 unknown[] = "unknown";
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->PartNumber, unknown);
} }
if (gRAM.Frequency > gRAM.SPD[SPDIndex].Frequency) { if (gRAM.Frequency > gRAM.SPD[SPDIndex].Frequency) {
newSmbiosTable.Type17->Speed = (UINT16)gRAM.Frequency; newSmbiosTable.Type17->Speed = (UINT16)gRAM.Frequency;
@ -1650,7 +1669,10 @@ VOID PatchTableType17()
(iStrLen(gRAM.SMBIOS[SMBIOSIndex].Vendor, 64) > 0) && (iStrLen(gRAM.SMBIOS[SMBIOSIndex].Vendor, 64) > 0) &&
(AsciiStrnCmp(gRAM.SPD[SPDIndex].Vendor, "NoName", 6) == 0)) { (AsciiStrnCmp(gRAM.SPD[SPDIndex].Vendor, "NoName", 6) == 0)) {
DBG("Type17->Manufacturer corrected by SMBIOS from NoName to %a\n", gRAM.SMBIOS[SMBIOSIndex].Vendor); DBG("Type17->Manufacturer corrected by SMBIOS from NoName to %a\n", gRAM.SMBIOS[SMBIOSIndex].Vendor);
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->Manufacturer, gRAM.SMBIOS[SMBIOSIndex].Vendor); CHAR8* vendor = (CHAR8*)AllocatePool(AsciiStrLen(gRAM.SMBIOS[SMBIOSIndex].Vendor)+1); // this will never be freed. WIll be solved when using a string object.
AsciiStrCpy(vendor, gRAM.SMBIOS[SMBIOSIndex].Vendor);
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->Manufacturer, vendor);
gRAM.SMBIOS[SMBIOSIndex].Vendor = vendor;
} }
AsciiSPrint(gSettings.MemorySpeed, 64, "%d", newSmbiosTable.Type17->Speed); AsciiSPrint(gSettings.MemorySpeed, 64, "%d", newSmbiosTable.Type17->Speed);

View File

@ -47,7 +47,7 @@ extern UINT16 TotalCount;
BOOLEAN smbIntel; BOOLEAN smbIntel;
UINT8 smbPage; UINT8 smbPage;
CHAR8 *spd_memory_types[] = CONST CHAR8 *spd_memory_types[] =
{ {
"RAM", /* 00h Undefined */ "RAM", /* 00h Undefined */
"FPM", /* 01h FPM */ "FPM", /* 01h FPM */
@ -324,25 +324,24 @@ VOID init_spd(UINT16* spd_indexes, UINT8* spd, UINT32 base, UINT8 slot)
// Get Vendor Name from spd, 3 cases handled DDR3, DDR4 and DDR2, // Get Vendor Name from spd, 3 cases handled DDR3, DDR4 and DDR2,
// have different formats, always return a valid ptr. // have different formats, always return a valid ptr.
CHAR8* getVendorName(RAM_SLOT_INFO* slot, UINT8 *spd, UINT32 base, UINT8 slot_num) CONST CHAR8* getVendorName(RAM_SLOT_INFO* slot, UINT8 *spd, UINT32 base, UINT8 slot_num)
{ {
UINT8 bank = 0; UINT8 bank = 0;
UINT8 code = 0; UINT8 code = 0;
UINT8 parity; UINT8 parity;
UINT8 testbit; UINT8 testbit;
INTN i = 0;
//UINT8 * spd = (UINT8 *) slot->spd; //UINT8 * spd = (UINT8 *) slot->spd;
if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR4) { // DDR4 if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR4) { // DDR4
bank = spd[SPD_DDR4_MANUFACTURER_ID_BANK]; bank = spd[SPD_DDR4_MANUFACTURER_ID_BANK];
code = spd[SPD_DDR4_MANUFACTURER_ID_CODE]; code = spd[SPD_DDR4_MANUFACTURER_ID_CODE];
parity = bank; parity = bank;
testbit = bank; testbit = bank;
for (i=6; i >= 0; i--) { parity ^= (testbit <<= 1); } for (UINTN i=6; i >= 0; i--) { parity ^= (testbit <<= 1); }
if ( (parity & 0x80) == 0 ) { if ( (parity & 0x80) == 0 ) {
DBG("Bad parity bank=0x%2X code=0x%2X\n", bank, code); DBG("Bad parity bank=0x%2X code=0x%2X\n", bank, code);
} }
bank &= 0x7f; bank &= 0x7f;
for (i=0; i < VEN_MAP_SIZE; i++) { for (UINTN i=0; i < VEN_MAP_SIZE; i++) {
if (bank==vendorMap[i].bank && code==vendorMap[i].code) { if (bank==vendorMap[i].bank && code==vendorMap[i].code) {
return vendorMap[i].name; return vendorMap[i].name;
} }
@ -353,13 +352,13 @@ CHAR8* getVendorName(RAM_SLOT_INFO* slot, UINT8 *spd, UINT32 base, UINT8 slot_nu
code = spd[SPD_DDR3_MEMORY_CODE]; code = spd[SPD_DDR3_MEMORY_CODE];
parity = bank; parity = bank;
testbit = bank; testbit = bank;
for (i=6; i >= 0; i--) { parity ^= (testbit <<= 1); } for (UINTN i=6; i >= 0; i--) { parity ^= (testbit <<= 1); }
if ( (parity & 0x80) == 0 ) { if ( (parity & 0x80) == 0 ) {
DBG("Bad parity bank=0x%2X code=0x%2X\n", bank, code); DBG("Bad parity bank=0x%2X code=0x%2X\n", bank, code);
} }
bank &= 0x7f; bank &= 0x7f;
for (i=0; i < VEN_MAP_SIZE; i++) { for (UINTN i=0; i < VEN_MAP_SIZE; i++) {
if (bank==vendorMap[i].bank && code==vendorMap[i].code) { if (bank==vendorMap[i].bank && code==vendorMap[i].code) {
return vendorMap[i].name; return vendorMap[i].name;
} }
@ -367,6 +366,7 @@ CHAR8* getVendorName(RAM_SLOT_INFO* slot, UINT8 *spd, UINT32 base, UINT8 slot_nu
} else if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR2 || } else if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR2 ||
spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR) { spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR) {
if(spd[64]==0x7f) { if(spd[64]==0x7f) {
UINTN i;
for (i=64; i<72 && spd[i]==0x7f;i++) { for (i=64; i<72 && spd[i]==0x7f;i++) {
bank++; bank++;
READ_SPD(spd, base, slot_num, (UINT8)(i+1)); // prefetch next spd byte to read for next loop READ_SPD(spd, base, slot_num, (UINT8)(i+1)); // prefetch next spd byte to read for next loop
@ -377,7 +377,7 @@ CHAR8* getVendorName(RAM_SLOT_INFO* slot, UINT8 *spd, UINT32 base, UINT8 slot_nu
code = spd[64]; code = spd[64];
bank = 0; bank = 0;
} }
for (i=0; i < VEN_MAP_SIZE; i++) { for (UINTN i=0; i < VEN_MAP_SIZE; i++) {
if (bank==vendorMap[i].bank && code==vendorMap[i].code) { if (bank==vendorMap[i].bank && code==vendorMap[i].code) {
return vendorMap[i].name; return vendorMap[i].name;
} }

View File

@ -5,7 +5,7 @@
#include "Platform.h" #include "Platform.h"
CHAR8 *NonDetected = "10.10.10"; //longer string CHAR8 NonDetected[] = "10.10.10"; //longer string
/** /**
Convert a Null-terminated ASCII string representing version number (separate by dots) Convert a Null-terminated ASCII string representing version number (separate by dots)

View File

@ -223,7 +223,7 @@ void XStringW::vSPrintf(const wchar_t *format, VA_LIST va)
spc.Len = 0; spc.Len = 0;
spc.Maxlen = m_size; spc.Maxlen = m_size;
ZeroMem(&ps, sizeof (ps)); ZeroMem(&ps, sizeof (ps));
ps.Output = (IN EFI_STATUS (EFIAPI *)(VOID *context, CHAR16 *str))_PoolPrint; ps.Output = (IN EFI_STATUS (EFIAPI *)(VOID *context, CONST CHAR16 *str))_PoolPrint;
ps.Context = (void*)&spc; ps.Context = (void*)&spc;
ps.fmt.u.pw = format; ps.fmt.u.pw = format;

View File

@ -0,0 +1,37 @@
#include "../Platform/Platform.h"
extern "C" {
/*
* memset and memcpy has to be provided for clang
*/
void* memset(void* dst, int ch, UINT64 count) __attribute__ ((used));
void* memcpy(void* dst, const void* src, UINT64 count) __attribute__ ((used));
void* memset(void* dst, int ch, UINT64 count)
{
SetMem(dst, count, (UINT8)(ch));
return dst;
}
void* memcpy(void* dst, const void* src, UINT64 count)
{
CopyMem(dst, src, count);
return dst;
}
} // extern "C"
CONST CHAR16 *
EFIAPI
ConstStrStr (
IN CONST CHAR16 *String,
IN CONST CHAR16 *SearchString
)
{
return StrStr((CHAR16*)String, SearchString);
}

View File

@ -0,0 +1,9 @@
#include "../Platform/Platform.h"
CONST CHAR16 *
EFIAPI
ConstStrStr (
IN CONST CHAR16 *String,
IN CONST CHAR16 *SearchString
);

View File

@ -709,7 +709,7 @@ STATIC UINT8 whiteAppleLogo[] = {
0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82, 0x82, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82, 0x82,
}; };
static CHAR16 *CustomBootModeStr[] = { static CONST CHAR16 *CustomBootModeStr[] = {
L"CUSTOM_BOOT_DISABLED", L"CUSTOM_BOOT_DISABLED",
L"CUSTOM_BOOT_DISABLED", L"CUSTOM_BOOT_DISABLED",
L"CUSTOM_BOOT_NONE", L"CUSTOM_BOOT_NONE",
@ -718,7 +718,7 @@ static CHAR16 *CustomBootModeStr[] = {
L"CUSTOM_BOOT_THEME", L"CUSTOM_BOOT_THEME",
L"CUSTOM_BOOT_USER", L"CUSTOM_BOOT_USER",
}; };
CHAR16 *CustomBootModeToStr(IN UINT8 Mode) CONST CHAR16 *CustomBootModeToStr(IN UINT8 Mode)
{ {
if (Mode >= (sizeof(CustomBootModeStr) / sizeof(CHAR16 *))) { if (Mode >= (sizeof(CustomBootModeStr) / sizeof(CHAR16 *))) {
return CustomBootModeStr[0]; return CustomBootModeStr[0];

View File

@ -47,7 +47,7 @@
#define DBG(...) DebugLog(DEBUG_COMMON_MENU, __VA_ARGS__) #define DBG(...) DebugLog(DEBUG_COMMON_MENU, __VA_ARGS__)
#endif #endif
static CHAR16 *BuiltinIconNames[] = { static CONST CHAR16 *BuiltinIconNames[] = {
/* /*
L"About", L"About",
L"Options", L"Options",
@ -73,7 +73,7 @@ static CHAR16 *BuiltinIconNames[] = {
}; };
static const UINTN BuiltinIconNamesCount = (sizeof(BuiltinIconNames) / sizeof(CHAR16 *)); static const UINTN BuiltinIconNamesCount = (sizeof(BuiltinIconNames) / sizeof(CHAR16 *));
EG_IMAGE *LoadBuiltinIcon(IN CHAR16 *IconName) EG_IMAGE *LoadBuiltinIcon(IN CONST CHAR16 *IconName)
{ {
UINTN Index = 0; UINTN Index = 0;
if (IconName == NULL) { if (IconName == NULL) {
@ -166,7 +166,7 @@ LOADER_ENTRY * DuplicateLoaderEntry(IN LOADER_ENTRY *Entry)
return DuplicateEntry; return DuplicateEntry;
} }
CHAR16 *AddLoadOption(IN CHAR16 *LoadOptions, IN CHAR16 *LoadOption) CHAR16 *AddLoadOption(IN CONST CHAR16 *LoadOptions, IN CONST CHAR16 *LoadOption)
{ {
// If either option strings are null nothing to do // If either option strings are null nothing to do
if (LoadOptions == NULL) if (LoadOptions == NULL)
@ -181,9 +181,9 @@ CHAR16 *AddLoadOption(IN CHAR16 *LoadOptions, IN CHAR16 *LoadOption)
return PoolPrint(L"%s %s", LoadOptions, LoadOption); return PoolPrint(L"%s %s", LoadOptions, LoadOption);
} }
CHAR16 *RemoveLoadOption(IN CHAR16 *LoadOptions, IN CHAR16 *LoadOption) CHAR16 *RemoveLoadOption(IN CONST CHAR16 *LoadOptions, IN CONST CHAR16 *LoadOption)
{ {
CHAR16 *Placement; CONST CHAR16 *Placement;
CHAR16 *NewLoadOptions; CHAR16 *NewLoadOptions;
UINTN Length, Offset, OptionLength; UINTN Length, Offset, OptionLength;
@ -239,8 +239,8 @@ CHAR16 *RemoveLoadOption(IN CHAR16 *LoadOptions, IN CHAR16 *LoadOption)
} }
#define TO_LOWER(ch) (((ch >= L'A') && (ch <= L'Z')) ? ((ch - L'A') + L'a') : ch) #define TO_LOWER(ch) (((ch >= L'A') && (ch <= L'Z')) ? ((ch - L'A') + L'a') : ch)
INTN StrniCmp(IN CHAR16 *Str1, INTN StrniCmp(IN CONST CHAR16 *Str1,
IN CHAR16 *Str2, IN CONST CHAR16 *Str2,
IN UINTN Count) IN UINTN Count)
{ {
CHAR16 Ch1, Ch2; CHAR16 Ch1, Ch2;
@ -271,10 +271,10 @@ INTN StrniCmp(IN CHAR16 *Str1,
return 0; return 0;
} }
CHAR16 *StriStr(IN CHAR16 *Str, CONST CHAR16 *StriStr(IN CONST CHAR16 *Str,
IN CHAR16 *SearchFor) IN CONST CHAR16 *SearchFor)
{ {
CHAR16 *End; CONST CHAR16 *End;
UINTN Length; UINTN Length;
UINTN SearchLength; UINTN SearchLength;
if ((Str == NULL) || (SearchFor == NULL)) { if ((Str == NULL) || (SearchFor == NULL)) {
@ -306,9 +306,10 @@ VOID StrToLower(IN CHAR16 *Str)
} }
} }
STATIC CHAR16 **CreateInfoLines(IN CHAR16 *Message, OUT UINTN *Count) STATIC CHAR16 **CreateInfoLines(IN CONST CHAR16 *Message, OUT UINTN *Count)
{ {
CHAR16 *Ptr, **Information; CONST CHAR16 *Ptr;
CHAR16 **Information;
UINTN Index = 0, Total = 0; UINTN Index = 0, Total = 0;
UINTN Length = ((Message == NULL) ? 0 : StrLen(Message)); UINTN Length = ((Message == NULL) ? 0 : StrLen(Message));
// Check parameters // Check parameters
@ -327,12 +328,12 @@ STATIC CHAR16 **CreateInfoLines(IN CHAR16 *Message, OUT UINTN *Count)
return NULL; return NULL;
} }
// Copy strings // Copy strings
Information[Index++] = Ptr = (CHAR16 *)(Information + Total); CHAR16* Ptr2 = Information[Index++] = (CHAR16 *)(Information + Total);
StrCpyS(Ptr, Length + 1, Message); StrCpyS(Ptr2, Length + 1, Message);
while ((Index < Total) && while ((Index < Total) &&
((Ptr = StrStr(Ptr, L"\n")) != NULL)) { ((Ptr2 = (CHAR16*)StrStr(Ptr2, L"\n")) != NULL)) { // cast is ok because FilePath is not const, and we know that StrStr returns a pointer in FilePath. Will disappear when using a string object instead of CHAR16*
*Ptr++ = 0; *Ptr2++ = 0;
Information[Index++] = Ptr; Information[Index++] = Ptr2;
} }
// Return the info lines // Return the info lines
if (Count != NULL) { if (Count != NULL) {
@ -349,7 +350,7 @@ STATIC REFIT_MENU_SCREEN AlertMessageMenu = {0, NULL, NULL, 0, NULL, 1, AlertMe
{ 0, 0, 0, 0 } , NULL }; { 0, 0, 0, 0 } , NULL };
// Display an alert message // Display an alert message
VOID AlertMessage(IN CHAR16 *Title, IN CHAR16 *Message) VOID AlertMessage(IN CONST CHAR16 *Title, IN CONST CHAR16 *Message)
{ {
UINTN Count = 0; UINTN Count = 0;
// Break message into info lines // Break message into info lines
@ -359,7 +360,7 @@ VOID AlertMessage(IN CHAR16 *Title, IN CHAR16 *Message)
if (Count > 0) { if (Count > 0) {
// Display the alert message // Display the alert message
AlertMessageMenu.InfoLineCount = Count; AlertMessageMenu.InfoLineCount = Count;
AlertMessageMenu.InfoLines = Information; AlertMessageMenu.InfoLines = (CONST CHAR16**)Information;
AlertMessageMenu.Title = Title; AlertMessageMenu.Title = Title;
RunMenu(&AlertMessageMenu, NULL); RunMenu(&AlertMessageMenu, NULL);
} }
@ -380,7 +381,7 @@ STATIC REFIT_MENU_SCREEN YesNoMessageMenu = {0, NULL, NULL, 0, NULL, 2, YesNoMe
{ 0, 0, 0, 0 } , NULL }; { 0, 0, 0, 0 } , NULL };
// Display a yes/no prompt // Display a yes/no prompt
BOOLEAN YesNoMessage(IN CHAR16 *Title, IN CHAR16 *Message) BOOLEAN YesNoMessage(IN CHAR16 *Title, IN CONST CHAR16 *Message)
{ {
BOOLEAN Result = FALSE; BOOLEAN Result = FALSE;
UINTN Count = 0, MenuExit; UINTN Count = 0, MenuExit;
@ -388,7 +389,7 @@ BOOLEAN YesNoMessage(IN CHAR16 *Title, IN CHAR16 *Message)
CHAR16 **Information = CreateInfoLines(Message, &Count); CHAR16 **Information = CreateInfoLines(Message, &Count);
// Display the yes/no message // Display the yes/no message
YesNoMessageMenu.InfoLineCount = Count; YesNoMessageMenu.InfoLineCount = Count;
YesNoMessageMenu.InfoLines = Information; YesNoMessageMenu.InfoLines = (CONST CHAR16**)Information;
YesNoMessageMenu.Title = Title; YesNoMessageMenu.Title = Title;
do do
{ {

View File

@ -45,7 +45,7 @@ extern REFIT_MENU_ENTRY MenuEntryExit;
extern REFIT_MENU_SCREEN MainMenu; extern REFIT_MENU_SCREEN MainMenu;
// common // common
EG_IMAGE *LoadBuiltinIcon(IN CHAR16 *IconName); EG_IMAGE *LoadBuiltinIcon(IN CONST CHAR16 *IconName);
LOADER_ENTRY * DuplicateLoaderEntry(IN LOADER_ENTRY *Entry); LOADER_ENTRY * DuplicateLoaderEntry(IN LOADER_ENTRY *Entry);
//CHAR16 *AddLoadOption(IN CHAR16 *LoadOptions, IN CHAR16 *LoadOption); //CHAR16 *AddLoadOption(IN CHAR16 *LoadOptions, IN CHAR16 *LoadOption);
//CHAR16 *RemoveLoadOption(IN CHAR16 *LoadOptions, IN CHAR16 *LoadOption); //CHAR16 *RemoveLoadOption(IN CHAR16 *LoadOptions, IN CHAR16 *LoadOption);
@ -84,7 +84,7 @@ VOID ScanTool(VOID);
VOID AddCustomTool(VOID); VOID AddCustomTool(VOID);
// locked graphics // locked graphics
CHAR16 *CustomBootModeToStr(IN UINT8 Mode); CONST CHAR16 *CustomBootModeToStr(IN UINT8 Mode);
EFI_STATUS LockBootScreen(VOID); EFI_STATUS LockBootScreen(VOID);
EFI_STATUS UnlockBootScreen(VOID); EFI_STATUS UnlockBootScreen(VOID);

View File

@ -48,7 +48,7 @@
#endif #endif
static LEGACY_ENTRY * AddLegacyEntry(IN CHAR16 *FullTitle, IN CHAR16 *LoaderTitle, IN REFIT_VOLUME *Volume, IN EG_IMAGE *Image, IN EG_IMAGE *DriveImage, IN CHAR16 Hotkey, IN BOOLEAN CustomEntry) static LEGACY_ENTRY * AddLegacyEntry(IN CONST CHAR16 *FullTitle, IN CONST CHAR16 *LoaderTitle, IN REFIT_VOLUME *Volume, IN EG_IMAGE *Image, IN EG_IMAGE *DriveImage, IN CHAR16 Hotkey, IN BOOLEAN CustomEntry)
{ {
LEGACY_ENTRY *Entry, *SubEntry; LEGACY_ENTRY *Entry, *SubEntry;
REFIT_MENU_SCREEN *SubScreen; REFIT_MENU_SCREEN *SubScreen;

View File

@ -70,10 +70,10 @@ extern LOADER_ENTRY *SubMenuKextInjectMgmt(LOADER_ENTRY *Entry);
// Linux loader path data // Linux loader path data
typedef struct LINUX_PATH_DATA typedef struct LINUX_PATH_DATA
{ {
CHAR16 *Path; CONST CHAR16 *Path;
CHAR16 *Title; CONST CHAR16 *Title;
CHAR16 *Icon; CONST CHAR16 *Icon;
CHAR8 *Issue; CONST CHAR8 *Issue;
} LINUX_PATH_DATA; } LINUX_PATH_DATA;
STATIC LINUX_PATH_DATA LinuxEntryData[] = { STATIC LINUX_PATH_DATA LinuxEntryData[] = {
@ -146,10 +146,10 @@ STATIC CONST UINTN LinuxEntryDataCount = (sizeof(LinuxEntryData) / sizeof(LINUX_
#define ANDX86_FINDLEN 3 #define ANDX86_FINDLEN 3
typedef struct ANDX86_PATH_DATA typedef struct ANDX86_PATH_DATA
{ {
CHAR16 *Path; CONST CHAR16 *Path;
CHAR16 *Title; CONST CHAR16 *Title;
CHAR16 *Icon; CONST CHAR16 *Icon;
CHAR16 *Find[ANDX86_FINDLEN]; CONST CHAR16 *Find[ANDX86_FINDLEN];
} ANDX86_PATH_DATA; } ANDX86_PATH_DATA;
STATIC ANDX86_PATH_DATA AndroidEntryData[] = { STATIC ANDX86_PATH_DATA AndroidEntryData[] = {
@ -167,12 +167,12 @@ STATIC CONST UINTN AndroidEntryDataCount = (sizeof(AndroidEntryData) / sizeof(AN
#endif #endif
#endif #endif
CHAR16 *PaperBoot = L"\\com.apple.boot.P\\boot.efi"; CONST CHAR16 *PaperBoot = L"\\com.apple.boot.P\\boot.efi";
CHAR16 *RockBoot = L"\\com.apple.boot.R\\boot.efi"; CONST CHAR16 *RockBoot = L"\\com.apple.boot.R\\boot.efi";
CHAR16 *ScissorBoot = L"\\com.apple.boot.S\\boot.efi"; CONST CHAR16 *ScissorBoot = L"\\com.apple.boot.S\\boot.efi";
// OS X installer paths // OS X installer paths
STATIC CHAR16 *OSXInstallerPaths[] = { CONST CHAR16 *OSXInstallerPaths[] = {
L"\\.IABootFiles\\boot.efi", // 10.9 - 10.13.3 L"\\.IABootFiles\\boot.efi", // 10.9 - 10.13.3
L"\\Mac OS X Install Data\\boot.efi", // 10.7 L"\\Mac OS X Install Data\\boot.efi", // 10.7
L"\\OS X Install Data\\boot.efi", // 10.8 - 10.11 L"\\OS X Install Data\\boot.efi", // 10.8 - 10.11
@ -217,7 +217,7 @@ STATIC INTN TimeCmp(IN EFI_TIME *Time1,
return Comparison; return Comparison;
} }
UINT8 GetOSTypeFromPath(IN CHAR16 *Path) UINT8 GetOSTypeFromPath(IN CONST CHAR16 *Path)
{ {
if (Path == NULL) { if (Path == NULL) {
return OSTYPE_OTHER; return OSTYPE_OTHER;
@ -264,7 +264,7 @@ UINT8 GetOSTypeFromPath(IN CHAR16 *Path)
return OSTYPE_OTHER; return OSTYPE_OTHER;
} }
STATIC CHAR16 *LinuxIconNameFromPath(IN CHAR16 *Path, STATIC CONST CHAR16 *LinuxIconNameFromPath(IN CONST CHAR16 *Path,
IN EFI_FILE_PROTOCOL *RootDir) IN EFI_FILE_PROTOCOL *RootDir)
{ {
UINTN Index; UINTN Index;
@ -304,7 +304,7 @@ STATIC CHAR16 *LinuxIconNameFromPath(IN CHAR16 *Path,
return L"linux"; return L"linux";
} }
STATIC CHAR16 *LinuxInitImagePath[] = { STATIC CONST CHAR16 *LinuxInitImagePath[] = {
L"initrd%s", L"initrd%s",
L"initrd.img%s", L"initrd.img%s",
L"initrd%s.img", L"initrd%s.img",
@ -315,9 +315,9 @@ STATIC CHAR16 *LinuxInitImagePath[] = {
STATIC CONST UINTN LinuxInitImagePathCount = (sizeof(LinuxInitImagePath) / sizeof(CHAR16 *)); STATIC CONST UINTN LinuxInitImagePathCount = (sizeof(LinuxInitImagePath) / sizeof(CHAR16 *));
STATIC CHAR16 *LinuxKernelOptions(IN EFI_FILE_PROTOCOL *Dir, STATIC CHAR16 *LinuxKernelOptions(IN EFI_FILE_PROTOCOL *Dir,
IN CHAR16 *Version, IN CONST CHAR16 *Version,
IN CHAR16 *PartUUID, IN CONST CHAR16 *PartUUID,
IN CHAR16 *Options OPTIONAL) IN CONST CHAR16 *Options OPTIONAL)
{ {
UINTN Index = 0; UINTN Index = 0;
if ((Dir == NULL) || (PartUUID == NULL)) { if ((Dir == NULL) || (PartUUID == NULL)) {
@ -359,7 +359,7 @@ STATIC BOOLEAN isFirstRootUUID(REFIT_VOLUME *Volume)
STATIC EFI_STATUS GetOSXVolumeName(LOADER_ENTRY *Entry) STATIC EFI_STATUS GetOSXVolumeName(LOADER_ENTRY *Entry)
{ {
EFI_STATUS Status = EFI_NOT_FOUND; EFI_STATUS Status = EFI_NOT_FOUND;
CHAR16* targetNameFile = L"\\System\\Library\\CoreServices\\.disk_label.contentDetails"; CONST CHAR16* targetNameFile = L"\\System\\Library\\CoreServices\\.disk_label.contentDetails";
CHAR8* fileBuffer; CHAR8* fileBuffer;
CHAR8* targetString; CHAR8* targetString;
UINTN fileLen = 0; UINTN fileLen = 0;
@ -402,10 +402,10 @@ STATIC EFI_STATUS GetOSXVolumeName(LOADER_ENTRY *Entry)
extern BOOLEAN CopyKernelAndKextPatches(IN OUT KERNEL_AND_KEXT_PATCHES *Dst, IN KERNEL_AND_KEXT_PATCHES *Src); extern BOOLEAN CopyKernelAndKextPatches(IN OUT KERNEL_AND_KEXT_PATCHES *Dst, IN KERNEL_AND_KEXT_PATCHES *Src);
STATIC LOADER_ENTRY *CreateLoaderEntry(IN CHAR16 *LoaderPath, STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST CHAR16 *LoaderPath,
IN CONST CHAR16 *LoaderOptions, IN CONST CHAR16 *LoaderOptions,
IN CHAR16 *FullTitle, IN CONST CHAR16 *FullTitle,
IN CHAR16 *LoaderTitle, IN CONST CHAR16 *LoaderTitle,
IN REFIT_VOLUME *Volume, IN REFIT_VOLUME *Volume,
IN EG_IMAGE *Image, IN EG_IMAGE *Image,
IN EG_IMAGE *DriveImage, IN EG_IMAGE *DriveImage,
@ -419,14 +419,14 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CHAR16 *LoaderPath,
IN BOOLEAN CustomEntry) IN BOOLEAN CustomEntry)
{ {
EFI_DEVICE_PATH *LoaderDevicePath; EFI_DEVICE_PATH *LoaderDevicePath;
CHAR16 *LoaderDevicePathString; CONST CHAR16 *LoaderDevicePathString;
CHAR16 *FilePathAsString; CONST CHAR16 *FilePathAsString;
CHAR16 *OSIconName; CONST CHAR16 *OSIconName;
//CHAR16 IconFileName[256]; Sothor - Unused? //CHAR16 IconFileName[256]; Sothor - Unused?
CHAR16 ShortcutLetter; CHAR16 ShortcutLetter;
LOADER_ENTRY *Entry; LOADER_ENTRY *Entry;
INTN i; INTN i;
CHAR8 *indent = " "; CONST CHAR8 *indent = " ";
// Check parameters are valid // Check parameters are valid
if ((LoaderPath == NULL) || (*LoaderPath == 0) || (Volume == NULL)) { if ((LoaderPath == NULL) || (*LoaderPath == 0) || (Volume == NULL)) {
@ -725,7 +725,8 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CHAR16 *LoaderPath,
STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry) STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
{ {
CHAR16 *FileName, *TempOptions; CONST CHAR16 *FileName;
CHAR16* TempOptions;
// CHAR16 DiagsFileName[256]; // CHAR16 DiagsFileName[256];
LOADER_ENTRY *SubEntry; LOADER_ENTRY *SubEntry;
REFIT_MENU_SCREEN *SubScreen; REFIT_MENU_SCREEN *SubScreen;
@ -968,8 +969,8 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
// DBG(" Added '%s': OSType='%d', OSVersion='%a'\n", Entry->me.Title, Entry->LoaderType, Entry->OSVersion); // DBG(" Added '%s': OSType='%d', OSVersion='%a'\n", Entry->me.Title, Entry->LoaderType, Entry->OSVersion);
} }
STATIC BOOLEAN AddLoaderEntry(IN CHAR16 *LoaderPath, IN CONST CHAR16 *LoaderOptions, STATIC BOOLEAN AddLoaderEntry(IN CONST CHAR16 *LoaderPath, IN CONST CHAR16 *LoaderOptions,
IN CHAR16 *LoaderTitle, IN CONST CHAR16 *LoaderTitle,
IN REFIT_VOLUME *Volume, IN EG_IMAGE *Image, IN REFIT_VOLUME *Volume, IN EG_IMAGE *Image,
IN UINT8 OSType, IN UINT8 Flags) IN UINT8 OSType, IN UINT8 Flags)
{ {
@ -1485,7 +1486,7 @@ VOID ScanLoader(VOID)
} }
STATIC VOID AddCustomEntry(IN UINTN CustomIndex, STATIC VOID AddCustomEntry(IN UINTN CustomIndex,
IN CHAR16 *CustomPath, IN CONST CHAR16 *CustomPath,
IN CUSTOM_LOADER_ENTRY *Custom, IN CUSTOM_LOADER_ENTRY *Custom,
IN REFIT_MENU_SCREEN *SubMenu) IN REFIT_MENU_SCREEN *SubMenu)
{ {
@ -1799,7 +1800,7 @@ STATIC VOID AddCustomEntry(IN UINTN CustomIndex,
do do
{ {
// Search for linux kernels // Search for linux kernels
CHAR16 *CustomOptions = Custom->Options; CONST CHAR16 *CustomOptions = Custom->Options;
if (FindCustomPath && (Custom->KernelScan == KERNEL_SCAN_ALL)) { if (FindCustomPath && (Custom->KernelScan == KERNEL_SCAN_ALL)) {
EFI_FILE_INFO *FileInfo = NULL; EFI_FILE_INFO *FileInfo = NULL;
// Get the next kernel path or stop looking // Get the next kernel path or stop looking

View File

@ -33,7 +33,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
CONST INTN SecureBootDef = 0; //CONST INTN SecureBootDef = 0; // jief : not used ??
#ifdef ENABLE_SECURE_BOOT #ifdef ENABLE_SECURE_BOOT

View File

@ -33,7 +33,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
CONST INTN SecureHashDef = 0; //CONST INTN SecureHashDef = 0; // jief : not used ??
#ifdef ENABLE_SECURE_BOOT #ifdef ENABLE_SECURE_BOOT

View File

@ -33,7 +33,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
CONST INTN SecureMenuDef = 0; //CONST INTN SecureMenuDef = 0; // jief : not used ??
#ifdef ENABLE_SECURE_BOOT #ifdef ENABLE_SECURE_BOOT

View File

@ -33,7 +33,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
CONST INTN SecureVarsDef = 0; //CONST INTN SecureVarsDef = 0; // jief : not used ??
#ifdef ENABLE_SECURE_BOOT #ifdef ENABLE_SECURE_BOOT

View File

@ -70,9 +70,9 @@
extern EMU_VARIABLE_CONTROL_PROTOCOL *gEmuVariableControl; extern EMU_VARIABLE_CONTROL_PROTOCOL *gEmuVariableControl;
STATIC BOOLEAN AddToolEntry(IN CHAR16 *LoaderPath, IN CHAR16 *FullTitle, IN CHAR16 *LoaderTitle, STATIC BOOLEAN AddToolEntry(IN CONST CHAR16 *LoaderPath, IN CONST CHAR16 *FullTitle, IN CONST CHAR16 *LoaderTitle,
IN REFIT_VOLUME *Volume, IN EG_IMAGE *Image, IN REFIT_VOLUME *Volume, IN EG_IMAGE *Image,
IN CHAR16 ShortcutLetter, IN CHAR16 *Options) IN CHAR16 ShortcutLetter, IN CONST CHAR16 *Options)
{ {
LOADER_ENTRY *Entry; LOADER_ENTRY *Entry;
// Check the loader exists // Check the loader exists
@ -110,7 +110,7 @@ STATIC BOOLEAN AddToolEntry(IN CHAR16 *LoaderPath, IN CHAR16 *FullTitle, IN CHAR
return TRUE; return TRUE;
} }
STATIC VOID AddCloverEntry(IN CHAR16 *LoaderPath, IN CHAR16 *LoaderTitle, IN REFIT_VOLUME *Volume) STATIC VOID AddCloverEntry(IN CONST CHAR16 *LoaderPath, IN CONST CHAR16 *LoaderTitle, IN REFIT_VOLUME *Volume)
{ {
LOADER_ENTRY *Entry, *SubEntry; LOADER_ENTRY *Entry, *SubEntry;
REFIT_MENU_SCREEN *SubScreen; REFIT_MENU_SCREEN *SubScreen;

View File

@ -8,12 +8,14 @@
#ifndef FloatLib_h #ifndef FloatLib_h
#define FloatLib_h #define FloatLib_h
extern "C" {
#include <Uefi.h> #include <Uefi.h>
#include <Library/UefiBootServicesTableLib.h> #include <Library/UefiBootServicesTableLib.h>
#include <Library/BaseMemoryLib.h> #include <Library/BaseMemoryLib.h>
#include <Library/BaseLib.h> #include <Library/BaseLib.h>
#include <Library/MemoryAllocationLib.h> #include <Library/MemoryAllocationLib.h>
#include <Library/PrintLib.h> #include <Library/PrintLib.h>
}
#define PI (3.1415926536f) #define PI (3.1415926536f)
#define PI2 (6.283185307179586f) #define PI2 (6.283185307179586f)

View File

@ -35,7 +35,7 @@
extern VOID extern VOID
WaitForKeyPress(CHAR16 *Message); WaitForKeyPress(CHAR16 *Message);
extern void DumpFloat2 (char* s, float* t, int N); extern void DumpFloat2 (CONST char* s, float* t, int N);
extern EG_IMAGE *BackgroundImage; extern EG_IMAGE *BackgroundImage;
extern EG_IMAGE *Banner; extern EG_IMAGE *Banner;
extern EG_IMAGE *BigBack; extern EG_IMAGE *BigBack;
@ -51,7 +51,7 @@ textFaces textFace[4]; //0-help 1-message 2-menu 3-test
NSVGparser *mainParser = NULL; //it must be global variable NSVGparser *mainParser = NULL; //it must be global variable
EFI_STATUS ParseSVGIcon(NSVGparser *p, INTN Id, CHAR8 *IconName, float Scale, EG_IMAGE **Image) EFI_STATUS ParseSVGIcon(NSVGparser *p, INTN Id, CONST CHAR8 *IconName, float Scale, EG_IMAGE **Image)
{ {
EFI_STATUS Status = EFI_NOT_FOUND; EFI_STATUS Status = EFI_NOT_FOUND;
NSVGimage *SVGimage; NSVGimage *SVGimage;
@ -316,9 +316,9 @@ EFI_STATUS ParseSVGTheme(CONST CHAR8* buffer, TagPtr * dict, UINT32 bufSize)
i++; i++;
continue; continue;
} }
CHAR16 *IconPath = BuiltinIconTable[i].Path; CONST CHAR16 *IconPath = BuiltinIconTable[i].Path;
// DBG("next table icon=%s\n", IconPath); // DBG("next table icon=%s\n", IconPath);
CHAR16 *ptr = StrStr(IconPath, L"\\"); CONST CHAR16 *ptr = StrStr(IconPath, L"\\");
if (!ptr) { if (!ptr) {
ptr = IconPath; ptr = IconPath;
} else { } else {

View File

@ -397,14 +397,14 @@ EFI_STATUS egFindESP(OUT EFI_FILE_HANDLE *RootDir)
return Status; return Status;
} }
//if (NULL, ...) then save to EFI partition //if (NULL, ...) then save to EFI partition
EFI_STATUS egSaveFile(IN EFI_FILE_HANDLE BaseDir OPTIONAL, IN CHAR16 *FileName, EFI_STATUS egSaveFile(IN EFI_FILE_HANDLE BaseDir OPTIONAL, IN CONST CHAR16 *FileName,
IN CONST VOID *FileData, IN UINTN FileDataLength) IN CONST VOID *FileData, IN UINTN FileDataLength)
{ {
EFI_STATUS Status; EFI_STATUS Status;
EFI_FILE_HANDLE FileHandle; EFI_FILE_HANDLE FileHandle;
UINTN BufferSize; UINTN BufferSize;
BOOLEAN CreateNew = TRUE; BOOLEAN CreateNew = TRUE;
CHAR16 *p = FileName + StrLen(FileName); CONST CHAR16 *p = FileName + StrLen(FileName);
CHAR16 DirName[256]; CHAR16 DirName[256];
UINTN dirNameLen; UINTN dirNameLen;
@ -540,7 +540,7 @@ EG_IMAGE * egLoadImage(IN EFI_FILE_HANDLE BaseDir, IN CONST CHAR16 *FileName, IN
} }
//caller is responsible for free image //caller is responsible for free image
EG_IMAGE * egLoadIcon(IN EFI_FILE_HANDLE BaseDir, IN CHAR16 *FileName, IN UINTN IconSize) EG_IMAGE * egLoadIcon(IN EFI_FILE_HANDLE BaseDir, IN CONST CHAR16 *FileName, IN UINTN IconSize)
{ {
EFI_STATUS Status; EFI_STATUS Status;
UINT8 *FileData; UINT8 *FileData;
@ -556,13 +556,13 @@ EG_IMAGE * egLoadIcon(IN EFI_FILE_HANDLE BaseDir, IN CHAR16 *FileName, IN UINTN
INTN i = 0; INTN i = 0;
UINTN Size; UINTN Size;
CHAR16 *ptr = StrStr(FileName, L"\\"); CONST CHAR16 *ptr = StrStr(FileName, L"\\");
if (!ptr) { if (!ptr) {
ptr = FileName; ptr = FileName;
} else { } else {
ptr++; ptr++;
} }
CHAR16 *ptr2 = StrStr(ptr, L"."); CONST CHAR16 *ptr2 = StrStr(ptr, L".");
Size = ptr2 - ptr + 2; Size = ptr2 - ptr + 2;
IconName = (__typeof__(IconName))AllocateZeroPool(Size); IconName = (__typeof__(IconName))AllocateZeroPool(Size);
UnicodeStrToAsciiStrS(ptr, IconName, Size - 1); UnicodeStrToAsciiStrS(ptr, IconName, Size - 1);

View File

@ -37,6 +37,7 @@
#ifndef __LIBEG_LIBEG_H__ #ifndef __LIBEG_LIBEG_H__
#define __LIBEG_LIBEG_H__ #define __LIBEG_LIBEG_H__
extern "C" {
#include <PiDxe.h> #include <PiDxe.h>
#include <Base.h> #include <Base.h>
#include <Uefi.h> #include <Uefi.h>
@ -132,6 +133,8 @@
#include <IndustryStandard/Atapi.h> #include <IndustryStandard/Atapi.h>
#include <IndustryStandard/AppleSmBios.h> #include <IndustryStandard/AppleSmBios.h>
} // extern "C"
/* types */ /* types */
typedef enum { typedef enum {
@ -191,8 +194,8 @@ typedef struct {
typedef struct { typedef struct {
EG_IMAGE *Image; EG_IMAGE *Image;
CHAR16 *Path; CONST CHAR16 *Path;
CHAR16 *Format; CONST CHAR16 *Format;
UINTN PixelSize; UINTN PixelSize;
} BUILTIN_ICON; } BUILTIN_ICON;
@ -206,7 +209,7 @@ EFI_STATUS egSetMaxResolution(VOID);
EFI_STATUS egSetMode(INT32 Next); EFI_STATUS egSetMode(INT32 Next);
VOID egGetScreenSize(OUT INTN *ScreenWidth, OUT INTN *ScreenHeight); VOID egGetScreenSize(OUT INTN *ScreenWidth, OUT INTN *ScreenHeight);
CHAR16* egScreenDescription(VOID); CONST CHAR16* egScreenDescription(VOID);
BOOLEAN egHasGraphicsMode(VOID); BOOLEAN egHasGraphicsMode(VOID);
BOOLEAN egIsGraphicsModeEnabled(VOID); BOOLEAN egIsGraphicsModeEnabled(VOID);
VOID egSetGraphicsModeEnabled(IN BOOLEAN Enable); VOID egSetGraphicsModeEnabled(IN BOOLEAN Enable);
@ -223,15 +226,15 @@ VOID egFreeImage(IN EG_IMAGE *Image);
VOID ScaleImage(OUT EG_IMAGE *NewImage, IN EG_IMAGE *OldImage); VOID ScaleImage(OUT EG_IMAGE *NewImage, IN EG_IMAGE *OldImage);
EG_IMAGE * egLoadImage(IN EFI_FILE_HANDLE BaseDir, IN CONST CHAR16 *FileName, IN BOOLEAN WantAlpha); EG_IMAGE * egLoadImage(IN EFI_FILE_HANDLE BaseDir, IN CONST CHAR16 *FileName, IN BOOLEAN WantAlpha);
EG_IMAGE * egLoadIcon(IN EFI_FILE_HANDLE BaseDir, IN CHAR16 *FileName, IN UINTN IconSize); EG_IMAGE * egLoadIcon(IN EFI_FILE_HANDLE BaseDir, IN CONST CHAR16 *FileName, IN UINTN IconSize);
EG_IMAGE * egEnsureImageSize(IN EG_IMAGE *Image, IN INTN Width, IN INTN Height, IN EG_PIXEL *Color); EG_IMAGE * egEnsureImageSize(IN EG_IMAGE *Image, IN INTN Width, IN INTN Height, IN EG_PIXEL *Color);
EFI_STATUS egLoadFile(IN EFI_FILE_HANDLE BaseDir, IN CONST CHAR16 *FileName, EFI_STATUS egLoadFile(IN EFI_FILE_HANDLE BaseDir, IN CONST CHAR16 *FileName,
OUT UINT8 **FileData, OUT UINTN *FileDataLength); OUT UINT8 **FileData, OUT UINTN *FileDataLength);
EFI_STATUS egSaveFile(IN EFI_FILE_HANDLE BaseDir OPTIONAL, IN CHAR16 *FileName, EFI_STATUS egSaveFile(IN EFI_FILE_HANDLE BaseDir OPTIONAL, IN CONST CHAR16 *FileName,
IN CONST VOID *FileData, IN UINTN FileDataLength); IN CONST VOID *FileData, IN UINTN FileDataLength);
EFI_STATUS egMkDir(IN EFI_FILE_HANDLE BaseDir OPTIONAL, IN CHAR16 *DirName); EFI_STATUS egMkDir(IN EFI_FILE_HANDLE BaseDir OPTIONAL, IN CONST CHAR16 *DirName);
EFI_STATUS egFindESP(OUT EFI_FILE_HANDLE *RootDir); EFI_STATUS egFindESP(OUT EFI_FILE_HANDLE *RootDir);
VOID egFillImage(IN OUT EG_IMAGE *CompImage, IN EG_PIXEL *Color); VOID egFillImage(IN OUT EG_IMAGE *CompImage, IN EG_PIXEL *Color);
@ -241,8 +244,8 @@ VOID egFillImageArea(IN OUT EG_IMAGE *CompImage,
IN EG_PIXEL *Color); IN EG_PIXEL *Color);
VOID egComposeImage(IN OUT EG_IMAGE *CompImage, IN EG_IMAGE *TopImage, IN INTN PosX, IN INTN PosY); VOID egComposeImage(IN OUT EG_IMAGE *CompImage, IN EG_IMAGE *TopImage, IN INTN PosX, IN INTN PosY);
VOID PrepareFont(VOID); VOID PrepareFont(VOID);
VOID egMeasureText(IN CHAR16 *Text, OUT INTN *Width, OUT INTN *Height); VOID egMeasureText(IN CONST CHAR16 *Text, OUT INTN *Width, OUT INTN *Height);
INTN egRenderText(IN CHAR16 *Text, IN OUT EG_IMAGE *CompImage, IN INTN PosX, IN INTN PosY, IN INTN Cursor, INTN textType); INTN egRenderText(IN CONST CHAR16 *Text, IN OUT EG_IMAGE *CompImage, IN INTN PosX, IN INTN PosY, IN INTN Cursor, INTN textType);
VOID egClearScreen(IN EG_PIXEL *Color); VOID egClearScreen(IN EG_PIXEL *Color);
//VOID egDrawImage(IN EG_IMAGE *Image, IN INTN ScreenPosX, IN INTN ScreenPosY); //VOID egDrawImage(IN EG_IMAGE *Image, IN INTN ScreenPosX, IN INTN ScreenPosY);
@ -255,7 +258,7 @@ VOID egTakeImage(IN EG_IMAGE *Image, INTN ScreenPosX, INTN ScreenPosY,
EFI_STATUS egScreenShot(VOID); EFI_STATUS egScreenShot(VOID);
INTN drawSVGtext(EG_IMAGE* TextBufferXY, INTN posX, INTN posY, INTN textType, const CHAR16* text, UINTN Cursor); INTN drawSVGtext(EG_IMAGE* TextBufferXY, INTN posX, INTN posY, INTN textType, CONST CHAR16* text, UINTN Cursor);
VOID testSVG(VOID); VOID testSVG(VOID);
#endif /* __LIBEG_LIBEG_H__ */ #endif /* __LIBEG_LIBEG_H__ */

View File

@ -43,9 +43,6 @@
#include "Platform.h" #include "Platform.h"
#ifdef __cplusplus
extern "C" {
#endif
#if defined(_MSC_VER) #if defined(_MSC_VER)
# define ALIGN_64 __declspec(align(8)) # define ALIGN_64 __declspec(align(8))
@ -184,9 +181,6 @@ EG_IMAGE * egDecodePNG(IN UINT8 *FileData, IN UINTN FileDataLength, IN BOOLEAN W
//VOID egEncodeBMP(IN EG_IMAGE *Image, OUT UINT8 **FileData, OUT UINTN *FileDataLength); //VOID egEncodeBMP(IN EG_IMAGE *Image, OUT UINT8 **FileData, OUT UINTN *FileDataLength);
#ifdef __cplusplus
}
#endif
#endif /* __LIBEG_LIBEGINT_H__ */ #endif /* __LIBEG_LIBEGINT_H__ */

View File

@ -440,7 +440,7 @@ VOID egGetScreenSize(OUT INTN *ScreenWidth, OUT INTN *ScreenHeight)
*ScreenHeight = egScreenHeight; *ScreenHeight = egScreenHeight;
} }
CHAR16 * egScreenDescription(VOID) CONST CHAR16 * egScreenDescription(VOID)
{ {
if (egHasGraphics) { if (egHasGraphics) {
if (GraphicsOutput != NULL) { if (GraphicsOutput != NULL) {

View File

@ -35,15 +35,17 @@ Rename this file to lodepng.cpp to use it for C++, or to lodepng.c to use it for
//#include <stdio.h> //#include <stdio.h>
//#include <stdlib.h> //#include <stdlib.h>
extern "C" {
#include <Uefi.h> #include <Uefi.h>
#include <Library/UefiBootServicesTableLib.h> #include <Library/UefiBootServicesTableLib.h>
#include <Library/BaseMemoryLib.h> #include <Library/BaseMemoryLib.h>
#include <Library/BaseLib.h> #include <Library/BaseLib.h>
#include <Library/MemoryAllocationLib.h> #include <Library/MemoryAllocationLib.h>
}
// Floating point operations are used here, this must be defined to prevent linker error // Floating point operations are used here, this must be defined to prevent linker error
#ifndef ENABLE_SECURE_BOOT #ifndef ENABLE_SECURE_BOOT
CONST INT32 _fltused = 0; //CONST INT32 _fltused = 0; // jief : not used ??
#endif #endif
/* /*
@ -86,7 +88,7 @@ void* lodepng_realloc(void* ptr, size_t new_size)
//#define memcpy(dest,source,count) gBS->CopyMem(dest,source,(UINTN)(count)) //#define memcpy(dest,source,count) gBS->CopyMem(dest,source,(UINTN)(count))
//#define memset(dest,ch,count) gBS->SetMem(dest,(UINTN)(count),(UINT8)(ch)) //#define memset(dest,ch,count) gBS->SetMem(dest,(UINTN)(count),(UINT8)(ch))
#define memcpy(dest,source,count) CopyMem(dest,(void*)source,(UINTN)(count)) #define memcpy(dest,source,count) CopyMem(dest,(void*)(source),(UINTN)(count))
#define memset(dest,ch,count) SetMem(dest,(UINTN)(count),(UINT8)(ch)) #define memset(dest,ch,count) SetMem(dest,(UINTN)(count),(UINT8)(ch))

View File

@ -103,7 +103,7 @@ void nsvg__deleteShapes(NSVGshape* shape);
extern BOOLEAN DayLight; extern BOOLEAN DayLight;
void DumpFloat2 (char* s, float* t, int N) void DumpFloat2 (CONST char* s, float* t, int N)
{ {
#if DEBUG_SVG #if DEBUG_SVG
int i; int i;

View File

@ -42,6 +42,9 @@
#ifndef NANOSVG_H #ifndef NANOSVG_H
#define NANOSVG_H #define NANOSVG_H
extern "C" {
#include <Library/BaseMemoryLib.h>
}
#include "Platform.h" #include "Platform.h"
#define NANOSVG_ALL_COLOR_KEYWORDS 1 #define NANOSVG_ALL_COLOR_KEYWORDS 1
@ -49,7 +52,7 @@
//There are defines for compilation as first step. Must be revised //There are defines for compilation as first step. Must be revised
#define memcpy(dest,source,count) CopyMem(dest,(void*)source,(UINTN)(count)) #define memcpy(dest,source,count) CopyMem(dest,(void*)(source),(UINTN)(count))
#define memset(dest,ch,count) SetMem(dest,(UINTN)(count),(UINT8)(ch)) #define memset(dest,ch,count) SetMem(dest,(UINTN)(count),(UINT8)(ch))
#define strcmp(a,b) AsciiStrCmp(a,b) #define strcmp(a,b) AsciiStrCmp(a,b)
#define strncmp(a,b,n) AsciiStrnCmp(a,b,n) #define strncmp(a,b,n) AsciiStrnCmp(a,b,n)

View File

@ -68,7 +68,7 @@ CONST EG_PIXEL SemiWhitePixel = {255, 255, 255, 210}; //semitransparent
// Text rendering // Text rendering
// //
VOID egMeasureText(IN CHAR16 *Text, OUT INTN *Width, OUT INTN *Height) VOID egMeasureText(IN CONST CHAR16 *Text, OUT INTN *Width, OUT INTN *Height)
{ {
INTN ScaledWidth = (INTN)(GlobalConfig.CharWidth * GlobalConfig.Scale); INTN ScaledWidth = (INTN)(GlobalConfig.CharWidth * GlobalConfig.Scale);
if (Width != NULL) if (Width != NULL)
@ -84,7 +84,7 @@ EG_IMAGE * egLoadFontImage(IN BOOLEAN UseEmbedded, IN INTN Rows, IN INTN Cols)
EG_PIXEL *PixelPtr, FirstPixel; EG_PIXEL *PixelPtr, FirstPixel;
BOOLEAN isKorean = (gLanguage == korean); BOOLEAN isKorean = (gLanguage == korean);
CHAR16 *fontFilePath = NULL; CHAR16 *fontFilePath = NULL;
CHAR16 *commonFontDir = L"EFI\\CLOVER\\font"; CONST CHAR16 *commonFontDir = L"EFI\\CLOVER\\font";
if (IsEmbeddedTheme() && !isKorean) { //or initial screen before theme init if (IsEmbeddedTheme() && !isKorean) { //or initial screen before theme init
NewImage = egDecodePNG(ACCESS_EMB_DATA(emb_font_data), ACCESS_EMB_SIZE(emb_font_data), TRUE); NewImage = egDecodePNG(ACCESS_EMB_DATA(emb_font_data), ACCESS_EMB_SIZE(emb_font_data), TRUE);
@ -247,7 +247,7 @@ INTN GetEmpty(EG_PIXEL *Ptr, EG_PIXEL *FirstPixel, INTN MaxWidth, INTN Step, INT
return m; return m;
} }
INTN egRenderText(IN CHAR16 *Text, IN OUT EG_IMAGE *CompImage, INTN egRenderText(IN CONST CHAR16 *Text, IN OUT EG_IMAGE *CompImage,
IN INTN PosX, IN INTN PosY, IN INTN Cursor, INTN textType) IN INTN PosX, IN INTN PosY, IN INTN Cursor, INTN textType)
{ {
EG_PIXEL *BufferPtr; EG_PIXEL *BufferPtr;

View File

@ -34,25 +34,25 @@
# EfiLib/GenericBdsLib.h # EfiLib/GenericBdsLib.h
# EfiLib/BmLib.c # EfiLib/BmLib.c
# Platform/DevicePath.c #included into GenericBdsLib # Platform/DevicePath.c #included into GenericBdsLib
Platform/BdsConnect.c #included into GenericBdsLib Platform/BdsConnect.cpp #included into GenericBdsLib
refit/main.cpp refit/main.cpp
refit/icns.c refit/icns.cpp
refit/lib.c refit/lib.cpp
refit/lib.h refit/lib.h
refit/menu.cpp refit/menu.cpp
refit/screen.c refit/screen.cpp
refit/IO.c refit/IO.cpp
refit/IO.h refit/IO.h
entry_scan/common.c entry_scan/common.cpp
entry_scan/legacy.c entry_scan/legacy.cpp
entry_scan/loader.c entry_scan/loader.cpp
entry_scan/tool.c entry_scan/tool.cpp
entry_scan/secureboot.c entry_scan/secureboot.cpp
entry_scan/securehash.c entry_scan/securehash.cpp
entry_scan/securemenu.c entry_scan/securemenu.cpp
entry_scan/securevars.c entry_scan/securevars.cpp
entry_scan/bootscreen.c entry_scan/bootscreen.cpp
entry_scan/lockedgraphics.c entry_scan/lockedgraphics.cpp
entry_scan/CanonicalDB.h entry_scan/CanonicalDB.h
entry_scan/CloverDB.h entry_scan/CloverDB.h
entry_scan/CloverKEK.h entry_scan/CloverKEK.h
@ -61,105 +61,106 @@
entry_scan/MSUEFICADB.h entry_scan/MSUEFICADB.h
entry_scan/entry_scan.h entry_scan/entry_scan.h
entry_scan/securebootkeys.h entry_scan/securebootkeys.h
libeg/egemb_icons.c libeg/egemb_icons.cpp
libeg/egemb_icons_dark.c libeg/egemb_icons_dark.cpp
libeg/egemb_font.c libeg/egemb_font.cpp
libeg/scroll_images.c libeg/scroll_images.cpp
libeg/BmLib.c libeg/BmLib.cpp
libeg/image.c libeg/image.cpp
# libeg/load_bmp.c # libeg/load_bmp.cpp
libeg/load_icns.c libeg/load_icns.cpp
libeg/libscreen.c libeg/libscreen.cpp
libeg/lodepng.c libeg/lodepng.cpp
libeg/lodepng.h libeg/lodepng.h
libeg/text.c libeg/text.cpp
libeg/FloatLib.c libeg/FloatLib.cpp
libeg/FloatLib.h libeg/FloatLib.h
libeg/nanosvg.c libeg/nanosvg.cpp
libeg/nanosvg.h libeg/nanosvg.h
libeg/nanosvgrast.c libeg/nanosvgrast.cpp
libeg/VectorGraphics.c libeg/VectorGraphics.cpp
libeg/libeg.h libeg/libeg.h
libeg/libegint.h libeg/libegint.h
Platform/AcpiPatcher.c Platform/AcpiPatcher.cpp
Platform/ati_reg.h Platform/ati_reg.h
Platform/AmlGenerator.c Platform/AmlGenerator.cpp
Platform/AmlGenerator.h Platform/AmlGenerator.h
Platform/ati.c Platform/ati.cpp
Platform/ati.h Platform/ati.h
# Platform/BiosVideo.h # Platform/BiosVideo.h
# Platform/Bmp.h # Platform/Bmp.h
Platform/boot.h Platform/boot.h
Platform/BootLog.c Platform/BootLog.cpp
Platform/BootOptions.c Platform/BootOptions.cpp
Platform/Console.c Platform/Console.cpp
Platform/cpu.c Platform/cpu.cpp
Platform/DataHubCpu.c Platform/DataHubCpu.cpp
# Platform/DataHubRecords.h # Platform/DataHubRecords.h
Platform/device_inject.c Platform/device_inject.cpp
Platform/device_inject.h Platform/device_inject.h
# Platform/device_tree.c # Platform/device_tree.cpp
# Platform/device_tree.h # Platform/device_tree.h
Platform/Edid.c Platform/Edid.cpp
Platform/Events.c Platform/Events.cpp
Platform/hda.c Platform/hda.cpp
Platform/hda.h Platform/hda.h
Platform/HdaCodecDump.c Platform/HdaCodecDump.cpp
Platform/HdaCodecDump.h Platform/HdaCodecDump.h
Platform/gma.c Platform/gma.cpp
Platform/gma.h Platform/gma.h
Platform/guid.c Platform/guid.cpp
Platform/Injectors.c Platform/Injectors.cpp
Platform/LegacyBiosThunk.c Platform/LegacyBiosThunk.cpp
Platform/LegacyBiosThunk.h Platform/LegacyBiosThunk.h
Platform/LegacyBoot.c Platform/LegacyBoot.cpp
Platform/memvendors.h Platform/memvendors.h
Platform/nvidia.c Platform/nvidia.cpp
Platform/nvidia.h Platform/nvidia.h
# Platform/pci.c # Platform/pci.cpp
# Platform/picopng.c # Platform/picopng.cpp
# Platform/picopng.h # Platform/picopng.h
Platform/Platform.h Platform/Platform.h
Platform/platformdata.c Platform/platformdata.cpp
Platform/plist.c Platform/plist.cpp
Platform/Pointer.c Platform/Pointer.cpp
Platform/Settings.c Platform/Settings.cpp
Platform/smbios.c Platform/smbios.cpp
# Platform/SmBios.h # Platform/SmBios.h
Platform/spd.c Platform/spd.cpp
Platform/spd.h Platform/spd.h
Platform/string.c Platform/string.cpp
Platform/string.h Platform/string.h
Platform/StateGenerator.c Platform/StateGenerator.cpp
Platform/StateGenerator.h Platform/StateGenerator.h
# Platform/stringTable.c # Platform/stringTable.cpp
Platform/usbfix.c Platform/usbfix.cpp
# Platform/UsbMass.h # Platform/UsbMass.h
# Platform/UsbMassBoot.h # Platform/UsbMassBoot.h
# Platform/UsbMassImpl.h # Platform/UsbMassImpl.h
# Platform/VesaBiosExtensions.h # Platform/VesaBiosExtensions.h
Platform/b64cdecode.h Platform/b64cdecode.h
Platform/b64cdecode.c Platform/b64cdecode.cpp
Platform/FixBiosDsdt.c Platform/FixBiosDsdt.cpp
Platform/loader.h Platform/loader.h
Platform/LoaderUefi.h Platform/LoaderUefi.h
Platform/kernel_patcher.h Platform/kernel_patcher.h
Platform/kernel_patcher.c Platform/kernel_patcher.cpp
Platform/kext_patcher.c Platform/kext_patcher.cpp
Platform/kext_inject.c Platform/kext_inject.cpp
Platform/kext_inject.h Platform/kext_inject.h
Platform/Nvram.c Platform/Nvram.cpp
Platform/card_vlist.c Platform/card_vlist.cpp
Platform/PlatformDriverOverride.c Platform/PlatformDriverOverride.cpp
Platform/Hibernate.c Platform/Hibernate.cpp
Platform/Net.c Platform/Net.cpp
Platform/sound.c Platform/sound.cpp
Platform/StartupSound.c Platform/StartupSound.cpp
Platform/sse3_patcher.h Platform/sse3_patcher.h
Platform/sse3_5_patcher.h Platform/sse3_5_patcher.h
Version.h Version.h
cpp_util/XStringW.h cpp_util/XStringW.h
cpp_util/XStringW.cpp cpp_util/XStringW.cpp
cpp_util/memory.cpp
cpp_util/global1.cpp cpp_util/global1.cpp
cpp_util/global2.cpp cpp_util/global2.cpp
cpp_util/globals_ctor.cpp cpp_util/globals_ctor.cpp
@ -315,9 +316,7 @@
[Pcd] [Pcd]
[BuildOptions] [BuildOptions]
# XCODE:*_*_*_CC_FLAGS = -fsigned-char -O2 -fno-common XCODE:*_*_*_CC_FLAGS = -fsigned-char -O2 -fno-omit-frame-pointer -ffreestanding -fno-rtti -fno-exceptions -Wno-deprecated -Wno-writable-strings -Wno-unused-const-variable -DJCONST=const
XCODE:*_*_*_CC_FLAGS = -fsigned-char -O2 -fno-omit-frame-pointer -ffreestanding -fno-rtti -fno-exceptions -Wno-deprecated -Wno-writable-strings -Wno-unused-const-variable
# XCODE:*_*_*_DLINK_FLAGS = -order_file $(EDK_TOOLS_PATH)/Scripts/ClangLinkOrder.txt
GCC:*_*_*_CC_FLAGS = -std=c99 -Os -fno-omit-frame-pointer -maccumulate-outgoing-args GCC:*_*_*_CC_FLAGS = -std=c99 -Os -fno-omit-frame-pointer -maccumulate-outgoing-args
GCC:*_*_*_CXX_FLAGS = -std=c++11 -Os -fno-omit-frame-pointer -maccumulate-outgoing-args -ffreestanding -fno-rtti -fno-exceptions -Wno-deprecated -Wno-write-strings -Wno-unused-const-variable GCC:*_*_*_CXX_FLAGS = -std=c++11 -Os -fno-omit-frame-pointer -maccumulate-outgoing-args -ffreestanding -fno-rtti -fno-exceptions -Wno-deprecated -Wno-write-strings -Wno-unused-const-variable -DJCONST=const
MSFT:*_*_*_CC_FLAGS = /Os /wd4201 MSFT:*_*_*_CC_FLAGS = /Os /wd4201

View File

@ -64,7 +64,7 @@ _IPrint (
IN UINTN Column, IN UINTN Column,
IN UINTN Row, IN UINTN Row,
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *Out, IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *Out,
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
IN CHAR8 *fmta, IN CHAR8 *fmta,
IN VA_LIST args IN VA_LIST args
); );
@ -236,7 +236,7 @@ Returns:
PRINT_STATE ps; PRINT_STATE ps;
SetMem (&ps, sizeof (ps), 0); SetMem (&ps, sizeof (ps), 0);
ps.Output = (IN EFI_STATUS (EFIAPI *)(VOID *context, CHAR16 *str))Output; ps.Output = (IN EFI_STATUS (EFIAPI *)(VOID *context, CONST CHAR16 *str)) Output; // C++ doesn't cast automatically to void* for param 1
ps.Context = spc; ps.Context = spc;
ps.fmt.u.pw = fmt; ps.fmt.u.pw = fmt;
//ps.args = args; //ps.args = args;
@ -285,7 +285,7 @@ EFIAPI
PrintAt ( PrintAt (
IN UINTN Column, IN UINTN Column,
IN UINTN Row, IN UINTN Row,
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
... ...
) )
/*++ /*++
@ -321,7 +321,7 @@ _IPrint (
IN UINTN Column, IN UINTN Column,
IN UINTN Row, IN UINTN Row,
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *Out, IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *Out,
IN CHAR16 *fmt, IN CONST CHAR16 *fmt,
IN CHAR8 *fmta, IN CHAR8 *fmta,
IN VA_LIST args IN VA_LIST args
) )
@ -354,7 +354,7 @@ Returns:
SetMem (&ps, sizeof (ps), 0); SetMem (&ps, sizeof (ps), 0);
ps.Context = Out; ps.Context = Out;
ps.Output = (EFI_STATUS (EFIAPI *) (VOID *, CHAR16 *)) Out->OutputString; ps.Output = (EFI_STATUS (EFIAPI *) (VOID *, CONST CHAR16 *)) Out->OutputString; // C++ doesn't cast automatically to void* for param 1
ps.SetAttr = (EFI_STATUS (EFIAPI *) (VOID *, UINTN)) Out->SetAttribute; ps.SetAttr = (EFI_STATUS (EFIAPI *) (VOID *, UINTN)) Out->SetAttribute;
// ASSERT (NULL != Out->Mode); // ASSERT (NULL != Out->Mode);
if (!Out->Mode) { if (!Out->Mode) {
@ -1431,7 +1431,7 @@ Returns:
UINTN Column; UINTN Column;
INTN Row; INTN Row;
UINTN StartColumn; UINTN StartColumn;
UINTN Update; INTN Update;
UINTN Delete; UINTN Delete;
UINTN Len; UINTN Len;
UINTN StrPos; UINTN StrPos;

View File

@ -54,7 +54,7 @@ typedef struct {
UINTN Index; UINTN Index;
union { union {
CONST CHAR16 *pw; CONST CHAR16 *pw;
CHAR8 *pc; CONST CHAR8 *pc;
} u; } u;
} POINTER; } POINTER;
@ -95,7 +95,7 @@ typedef struct _pstate {
UINTN AttrBlueColor; UINTN AttrBlueColor;
UINTN AttrGreenColor; UINTN AttrGreenColor;
EFI_STATUS (EFIAPI *Output) (VOID *context, CHAR16 *str); EFI_STATUS (EFIAPI *Output) (void *context, CONST CHAR16 *str);
EFI_STATUS (EFIAPI *SetAttr) (VOID *context, UINTN attr); EFI_STATUS (EFIAPI *SetAttr) (VOID *context, UINTN attr);
VOID *Context; VOID *Context;

View File

@ -124,7 +124,7 @@ MISC_ICONS OSIconsTable[] = {
//#define DEC_BUILTIN_ICON(id, ico) BuiltinIconTable[id].Image = egDecodePNG(&ico[0], SZ_##ico, TRUE) //#define DEC_BUILTIN_ICON(id, ico) BuiltinIconTable[id].Image = egDecodePNG(&ico[0], SZ_##ico, TRUE)
#define DEC_BUILTIN_ICON(id, ico) BuiltinIconTable[id].Image = egDecodePNG(ACCESS_EMB_DATA(ico), ACCESS_EMB_SIZE(ico), TRUE) #define DEC_BUILTIN_ICON(id, ico) BuiltinIconTable[id].Image = egDecodePNG(ACCESS_EMB_DATA(ico), ACCESS_EMB_SIZE(ico), TRUE)
CHAR16 * GetIconsExt(IN CHAR16 *Icon, IN CHAR16 *Def) CHAR16 * GetIconsExt(IN CONST CHAR16 *Icon, IN CONST CHAR16 *Def)
{ {
return PoolPrint(L"%s.%s", Icon, ((GlobalConfig.IconFormat != ICON_FORMAT_DEF) && (IconFormat != NULL)) ? IconFormat : Def); return PoolPrint(L"%s.%s", Icon, ((GlobalConfig.IconFormat != ICON_FORMAT_DEF) && (IconFormat != NULL)) ? IconFormat : Def);
} }
@ -133,7 +133,7 @@ EG_IMAGE * BuiltinIcon(IN UINTN Id)
{ {
INTN Size; INTN Size;
EG_IMAGE *TextBuffer = NULL; EG_IMAGE *TextBuffer = NULL;
CHAR16 *p; CONST CHAR16 *p;
CHAR16 *Text; CHAR16 *Text;
if (Id >= BUILTIN_ICON_COUNT) { if (Id >= BUILTIN_ICON_COUNT) {
@ -270,8 +270,10 @@ EG_IMAGE * BuiltinIcon(IN UINTN Id)
// egFillImage(TextBuffer, &MenuBackgroundPixel); // egFillImage(TextBuffer, &MenuBackgroundPixel);
p = StrStr(BuiltinIconTable[Id].Path, L"_"); p++; p = StrStr(BuiltinIconTable[Id].Path, L"_"); p++;
Text = (CHAR16*)AllocateCopyPool(30, (VOID*)p); Text = (CHAR16*)AllocateCopyPool(30, (VOID*)p);
p = StrStr(Text, L"."); // the 2 next lines seems to be useless, because there is no '.' in BuiltinIconTable
*p = L'\0'; // TODO jief : double check
// p = StrStr(Text, L".");
// *p = L'\0';
if (StrCmp(Text, L"shutdown") == 0) { if (StrCmp(Text, L"shutdown") == 0) {
// icon name is shutdown from historic reasons, but function is now exit // icon name is shutdown from historic reasons, but function is now exit
UnicodeSPrint(Text, 30, L"exit"); UnicodeSPrint(Text, 30, L"exit");
@ -289,7 +291,7 @@ EG_IMAGE * BuiltinIcon(IN UINTN Id)
// Load an icon for an operating system // Load an icon for an operating system
// //
EG_IMAGE * LoadOSIcon(IN CHAR16 *OSIconName OPTIONAL, IN CHAR16 *FallbackIconName, IN UINTN PixelSize, IN BOOLEAN BootLogo, IN BOOLEAN WantDummy) EG_IMAGE * LoadOSIcon(IN CONST CHAR16 *OSIconName OPTIONAL, IN CONST CHAR16 *FallbackIconName, IN UINTN PixelSize, IN BOOLEAN BootLogo, IN BOOLEAN WantDummy)
{ {
EG_IMAGE *Image; EG_IMAGE *Image;
CHAR16 CutoutName[16], FirstName[16]; CHAR16 CutoutName[16], FirstName[16];
@ -370,7 +372,7 @@ EG_IMAGE * LoadOSIcon(IN CHAR16 *OSIconName OPTIONAL, IN CHAR16 *FallbackIconNam
// Load an image from a .icns file // Load an image from a .icns file
// //
EG_IMAGE * LoadIcns(IN EFI_FILE_HANDLE BaseDir, IN CHAR16 *FileName, IN UINTN PixelSize) EG_IMAGE * LoadIcns(IN EFI_FILE_HANDLE BaseDir, IN CONST CHAR16 *FileName, IN UINTN PixelSize)
{ {
if (GlobalConfig.TextOnly) // skip loading if it's not used anyway if (GlobalConfig.TextOnly) // skip loading if it's not used anyway
return NULL; return NULL;
@ -412,7 +414,7 @@ EG_IMAGE * DummyImage(IN UINTN PixelSize)
return Image; return Image;
} }
EG_IMAGE * LoadIcnsFallback(IN EFI_FILE_HANDLE BaseDir, IN CHAR16 *FileName, IN UINTN PixelSize) EG_IMAGE * LoadIcnsFallback(IN EFI_FILE_HANDLE BaseDir, IN CONST CHAR16 *FileName, IN UINTN PixelSize)
{ {
EG_IMAGE *Image; EG_IMAGE *Image;

View File

@ -66,7 +66,7 @@ BOOLEAN gBootChanged = FALSE;
BOOLEAN gThemeOptionsChanged = FALSE; BOOLEAN gThemeOptionsChanged = FALSE;
EFI_FILE *OEMDir; EFI_FILE *OEMDir;
CHAR16 *OEMPath = L"EFI\\CLOVER"; CONST CHAR16 *OEMPath = L"EFI\\CLOVER";
EFI_FILE *OemThemeDir = NULL; EFI_FILE *OemThemeDir = NULL;
@ -128,8 +128,8 @@ NodeParser (UINT8 *DevPath, UINTN PathSize, UINT8 Type)
} }
BOOLEAN MetaiMatch ( BOOLEAN MetaiMatch (
IN CHAR16 *String, IN CONST CHAR16 *String,
IN CHAR16 *Pattern IN CONST CHAR16 *Pattern
); );
/** /**
@ -1365,7 +1365,7 @@ REFIT_VOLUME *FindVolumeByName(IN CHAR16 *VolName)
// file and dir functions // file and dir functions
// //
BOOLEAN FileExists(IN EFI_FILE *Root, IN CHAR16 *RelativePath) BOOLEAN FileExists(IN CONST EFI_FILE *Root, IN CONST CHAR16 *RelativePath)
{ {
EFI_STATUS Status; EFI_STATUS Status;
EFI_FILE *TestFile = NULL; EFI_FILE *TestFile = NULL;
@ -1380,7 +1380,7 @@ BOOLEAN FileExists(IN EFI_FILE *Root, IN CHAR16 *RelativePath)
return FALSE; return FALSE;
} }
BOOLEAN DeleteFile(IN EFI_FILE *Root, IN CHAR16 *RelativePath) BOOLEAN DeleteFile(IN EFI_FILE *Root, IN CONST CHAR16 *RelativePath)
{ {
EFI_STATUS Status; EFI_STATUS Status;
EFI_FILE *File; EFI_FILE *File;
@ -1479,7 +1479,7 @@ EFI_STATUS DirNextEntry(IN EFI_FILE *Directory, IN OUT EFI_FILE_INFO **DirEntry,
return Status; return Status;
} }
VOID DirIterOpen(IN EFI_FILE *BaseDir, IN CHAR16 *RelativePath OPTIONAL, OUT REFIT_DIR_ITER *DirIter) VOID DirIterOpen(IN EFI_FILE *BaseDir, IN CONST CHAR16 *RelativePath OPTIONAL, OUT REFIT_DIR_ITER *DirIter)
{ {
if (RelativePath == NULL) { if (RelativePath == NULL) {
DirIter->LastStatus = EFI_SUCCESS; DirIter->LastStatus = EFI_SUCCESS;
@ -1492,7 +1492,7 @@ VOID DirIterOpen(IN EFI_FILE *BaseDir, IN CHAR16 *RelativePath OPTIONAL, OUT REF
DirIter->LastFileInfo = NULL; DirIter->LastFileInfo = NULL;
} }
BOOLEAN DirIterNext(IN OUT REFIT_DIR_ITER *DirIter, IN UINTN FilterMode, IN CHAR16 *FilePattern OPTIONAL, BOOLEAN DirIterNext(IN OUT REFIT_DIR_ITER *DirIter, IN UINTN FilterMode, IN CONST CHAR16 *FilePattern OPTIONAL,
OUT EFI_FILE_INFO **DirEntry) OUT EFI_FILE_INFO **DirEntry)
{ {
if (DirIter->LastFileInfo != NULL) { if (DirIter->LastFileInfo != NULL) {
@ -1539,8 +1539,8 @@ EFI_STATUS DirIterClose(IN OUT REFIT_DIR_ITER *DirIter)
// //
BOOLEAN BOOLEAN
MetaiMatch ( MetaiMatch (
IN CHAR16 *String, IN CONST CHAR16 *String,
IN CHAR16 *Pattern IN CONST CHAR16 *Pattern
) )
{ {
if (!mUnicodeCollation) { if (!mUnicodeCollation) {
@ -1584,9 +1584,9 @@ InitializeUnicodeCollationProtocol (VOID)
CHAR16 * Basename(IN CHAR16 *Path) CONST CHAR16 * Basename(IN CONST CHAR16 *Path)
{ {
CHAR16 *FileName; CONST CHAR16 *FileName;
UINTN i; UINTN i;
FileName = Path; FileName = Path;
@ -1657,7 +1657,7 @@ CHAR16 *FileDevicePathToStr(IN EFI_DEVICE_PATH_PROTOCOL *DevPath)
{ {
CHAR16 *FilePath; CHAR16 *FilePath;
CHAR16 *Char; CHAR16 *Char;
CHAR16 *Tail; CONST CHAR16 *Tail;
FilePath = DevicePathToStr(DevPath); FilePath = DevicePathToStr(DevPath);
// fix / into '\\' // fix / into '\\'
@ -1669,14 +1669,14 @@ CHAR16 *FileDevicePathToStr(IN EFI_DEVICE_PATH_PROTOCOL *DevPath)
} }
} }
// "\\\\" into '\\' // "\\\\" into '\\'
Char = StrStr(FilePath, L"\\\\"); Char = (CHAR16*)StrStr(FilePath, L"\\\\"); // cast is ok because FilePath is not const, and we know that StrStr returns a pointer in FilePath. Will disappear when using a string object instead of CHAR16*
while (Char != NULL) { while (Char != NULL) {
// StrCpyS(Char, 4, Char + 1); //can't overlap // StrCpyS(Char, 4, Char + 1); //can't overlap
Tail = Char + 1; Tail = Char + 1;
while (*Tail != 0) { while (*Tail != 0) {
*(Char++) = *(Tail++); *(Char++) = *(Tail++);
} }
Char = StrStr(FilePath, L"\\\\"); Char = (CHAR16*)StrStr(FilePath, L"\\\\"); // cast is ok because FilePath is not const, and we know that StrStr returns a pointer in FilePath. Will disappear when using a string object instead of CHAR16*
} }
return FilePath; return FilePath;
} }
@ -1733,7 +1733,7 @@ BOOLEAN DumpVariable(CHAR16* Name, EFI_GUID* Guid, INTN DevicePathAt)
return FALSE; return FALSE;
} }
VOID DbgHeader(CHAR8 *str) VOID DbgHeader(CONST CHAR8 *str)
{ {
#if defined(ADVLOG) #if defined(ADVLOG)
INTN i, len = 50 - AsciiStrLen(str); INTN i, len = 50 - AsciiStrLen(str);

View File

@ -73,11 +73,15 @@
#define Print if ((!GlobalConfig.Quiet) || (GlobalConfig.TextOnly)) Print #define Print if ((!GlobalConfig.Quiet) || (GlobalConfig.TextOnly)) Print
//#include "GenericBdsLib.h" //#include "GenericBdsLib.h"
extern "C" {
extern EFI_HANDLE gImageHandle; extern EFI_HANDLE gImageHandle;
extern EFI_SYSTEM_TABLE* gST; extern EFI_SYSTEM_TABLE* gST;
extern EFI_BOOT_SERVICES* gBS; extern EFI_BOOT_SERVICES* gBS;
extern EFI_RUNTIME_SERVICES* gRT; extern EFI_RUNTIME_SERVICES* gRT;
}
#define TAG_ABOUT (1) #define TAG_ABOUT (1)
#define TAG_RESET (2) #define TAG_RESET (2)
#define TAG_SHUTDOWN (3) #define TAG_SHUTDOWN (3)
@ -214,17 +218,17 @@ OSTYPE_COMPARE_IMP(OSTYPE_IS_LINUX, type1, type2) || OSTYPE_COMPARE_IMP(OSTYPE_I
typedef struct { typedef struct {
UINT8 Type; UINT8 Type;
CHAR16 *IconName; CONST CHAR16 *IconName;
CHAR16 *Name; CONST CHAR16 *Name;
} LEGACY_OS; } LEGACY_OS;
typedef struct { typedef struct {
EFI_DEVICE_PATH *DevicePath; EFI_DEVICE_PATH *DevicePath;
EFI_HANDLE DeviceHandle; EFI_HANDLE DeviceHandle;
EFI_FILE *RootDir; EFI_FILE *RootDir;
CHAR16 *DevicePathString; CONST CHAR16 *DevicePathString;
CHAR16 *VolName; CONST CHAR16 *VolName;
CHAR16 *VolLabel; CONST CHAR16 *VolLabel;
UINT8 DiskKind; UINT8 DiskKind;
LEGACY_OS *LegacyOS; LEGACY_OS *LegacyOS;
BOOLEAN Hidden; BOOLEAN Hidden;
@ -382,7 +386,7 @@ extern INTN ScrollbarYMovement;
typedef struct _refit_menu_screen REFIT_MENU_SCREEN; typedef struct _refit_menu_screen REFIT_MENU_SCREEN;
typedef struct _refit_menu_entry { typedef struct _refit_menu_entry {
CHAR16 *Title; CONST CHAR16 *Title;
UINTN Tag; UINTN Tag;
UINTN Row; UINTN Row;
CHAR16 ShortcutDigit; CHAR16 ShortcutDigit;
@ -414,15 +418,15 @@ typedef struct _refit_input_dialog {
struct _refit_menu_screen { struct _refit_menu_screen {
UINTN ID; UINTN ID;
CHAR16 *Title; CONST CHAR16 *Title;
EG_IMAGE *TitleImage; EG_IMAGE *TitleImage;
INTN InfoLineCount; INTN InfoLineCount;
CHAR16 **InfoLines; CONST CHAR16 **InfoLines;
INTN EntryCount; INTN EntryCount;
REFIT_MENU_ENTRY **Entries; REFIT_MENU_ENTRY **Entries;
INTN TimeoutSeconds; INTN TimeoutSeconds;
CHAR16 *TimeoutText; CONST CHAR16 *TimeoutText;
CHAR16 *Theme; CONST CHAR16 *Theme;
BOOLEAN AnimeRun; BOOLEAN AnimeRun;
BOOLEAN Once; BOOLEAN Once;
UINT64 LastDraw; UINT64 LastDraw;
@ -618,11 +622,11 @@ typedef struct KERNEL_AND_KEXT_PATCHES
typedef struct { typedef struct {
REFIT_MENU_ENTRY me; REFIT_MENU_ENTRY me;
REFIT_VOLUME *Volume; REFIT_VOLUME *Volume;
CHAR16 *DevicePathString; CONST CHAR16 *DevicePathString;
CHAR16 *LoadOptions; //moved here for compatibility with legacy CONST CHAR16 *LoadOptions; //moved here for compatibility with legacy
UINTN BootNum; UINTN BootNum;
CHAR16 *LoaderPath; CONST CHAR16 *LoaderPath;
CHAR16 *VolName; CONST CHAR16 *VolName;
EFI_DEVICE_PATH *DevicePath; EFI_DEVICE_PATH *DevicePath;
UINT16 Flags; UINT16 Flags;
UINT8 LoaderType; UINT8 LoaderType;
@ -632,16 +636,16 @@ typedef struct {
UINT8 CustomBoot; UINT8 CustomBoot;
EG_IMAGE *CustomLogo; EG_IMAGE *CustomLogo;
KERNEL_AND_KEXT_PATCHES *KernelAndKextPatches; KERNEL_AND_KEXT_PATCHES *KernelAndKextPatches;
CHAR16 *Settings; CONST CHAR16 *Settings;
} LOADER_ENTRY; } LOADER_ENTRY;
typedef struct { typedef struct {
REFIT_MENU_ENTRY me; REFIT_MENU_ENTRY me;
REFIT_VOLUME *Volume; REFIT_VOLUME *Volume;
CHAR16 *DevicePathString; CONST CHAR16 *DevicePathString;
CONST CHAR16 *LoadOptions; CONST CHAR16 *LoadOptions;
UINTN BootNum; UINTN BootNum;
CHAR16 *LoaderPath; //will be set to NULL CONST CHAR16 *LoaderPath; //will be set to NULL
} LEGACY_ENTRY; } LEGACY_ENTRY;
#define ANIME_INFINITE ((UINTN)-1) #define ANIME_INFINITE ((UINTN)-1)
@ -676,7 +680,7 @@ extern EFI_DEVICE_PATH *SelfFullDevicePath;
extern EFI_FILE *ThemeDir; extern EFI_FILE *ThemeDir;
extern CHAR16 *ThemePath; extern CHAR16 *ThemePath;
extern EFI_FILE *OEMDir; extern EFI_FILE *OEMDir;
extern CHAR16 *OEMPath; extern CONST CHAR16 *OEMPath;
extern EFI_FILE *OemThemeDir; extern EFI_FILE *OemThemeDir;
extern BOOLEAN MainAnime; extern BOOLEAN MainAnime;
@ -706,9 +710,9 @@ VOID UninitRefitLib(VOID);
EFI_STATUS ReinitRefitLib(VOID); EFI_STATUS ReinitRefitLib(VOID);
EFI_STATUS ReinitSelfLib(VOID); EFI_STATUS ReinitSelfLib(VOID);
//extern EFI_STATUS FinishInitRefitLib(VOID); -- static //extern EFI_STATUS FinishInitRefitLib(VOID); -- static
VOID PauseForKey(IN CHAR16 *Msg); VOID PauseForKey(IN CONST CHAR16 *Msg);
BOOLEAN IsEmbeddedTheme(VOID); BOOLEAN IsEmbeddedTheme(VOID);
UINT8 GetOSTypeFromPath (IN CHAR16 *Path); UINT8 GetOSTypeFromPath (IN CONST CHAR16 *Path);
VOID CreateList(OUT VOID ***ListPtr, OUT UINTN *ElementCount, IN UINTN InitialElementCount); VOID CreateList(OUT VOID ***ListPtr, OUT UINTN *ElementCount, IN UINTN InitialElementCount);
VOID AddListElement(IN OUT VOID ***ListPtr, IN OUT UINTN *ElementCount, IN VOID *NewElement); VOID AddListElement(IN OUT VOID ***ListPtr, IN OUT UINTN *ElementCount, IN VOID *NewElement);
@ -728,17 +732,17 @@ VOID ScanVolumes(VOID);
REFIT_VOLUME *FindVolumeByName(IN CHAR16 *VolName); REFIT_VOLUME *FindVolumeByName(IN CHAR16 *VolName);
BOOLEAN FileExists(IN EFI_FILE *BaseDir, IN CHAR16 *RelativePath); BOOLEAN FileExists(IN CONST EFI_FILE *BaseDir, IN CONST CHAR16 *RelativePath);
BOOLEAN DeleteFile(IN EFI_FILE *Root, IN CHAR16 *RelativePath); BOOLEAN DeleteFile(IN EFI_FILE *Root, IN CONST CHAR16 *RelativePath);
EFI_STATUS DirNextEntry(IN EFI_FILE *Directory, IN OUT EFI_FILE_INFO **DirEntry, IN UINTN FilterMode); EFI_STATUS DirNextEntry(IN EFI_FILE *Directory, IN OUT EFI_FILE_INFO **DirEntry, IN UINTN FilterMode);
VOID DirIterOpen(IN EFI_FILE *BaseDir, IN CHAR16 *RelativePath OPTIONAL, OUT REFIT_DIR_ITER *DirIter); VOID DirIterOpen(IN EFI_FILE *BaseDir, IN CONST CHAR16 *RelativePath OPTIONAL, OUT REFIT_DIR_ITER *DirIter);
BOOLEAN DirIterNext(IN OUT REFIT_DIR_ITER *DirIter, IN UINTN FilterMode, IN CHAR16 *FilePattern OPTIONAL, OUT EFI_FILE_INFO **DirEntry); BOOLEAN DirIterNext(IN OUT REFIT_DIR_ITER *DirIter, IN UINTN FilterMode, IN CONST CHAR16 *FilePattern OPTIONAL, OUT EFI_FILE_INFO **DirEntry);
EFI_STATUS DirIterClose(IN OUT REFIT_DIR_ITER *DirIter); EFI_STATUS DirIterClose(IN OUT REFIT_DIR_ITER *DirIter);
CHAR16 * Basename(IN CHAR16 *Path); CONST CHAR16 * Basename(IN CONST CHAR16 *Path);
VOID ReplaceExtension(IN OUT CHAR16 *Path, IN CHAR16 *Extension); VOID ReplaceExtension(IN OUT CHAR16 *Path, IN CHAR16 *Extension);
CHAR16 * egFindExtension(IN CHAR16 *FileName); CHAR16 * egFindExtension(IN CHAR16 *FileName);
@ -807,9 +811,9 @@ extern EG_IMAGE *BackgroundImage;
VOID InitScreen(IN BOOLEAN SetMaxResolution); VOID InitScreen(IN BOOLEAN SetMaxResolution);
VOID SetupScreen(VOID); VOID SetupScreen(VOID);
VOID BeginTextScreen(IN CHAR16 *Title); VOID BeginTextScreen(IN CONST CHAR16 *Title);
VOID FinishTextScreen(IN BOOLEAN WaitAlways); VOID FinishTextScreen(IN BOOLEAN WaitAlways);
VOID BeginExternalScreen(IN BOOLEAN UseGraphicsMode, IN CHAR16 *Title); VOID BeginExternalScreen(IN BOOLEAN UseGraphicsMode, IN CONST CHAR16 *Title);
VOID FinishExternalScreen(VOID); VOID FinishExternalScreen(VOID);
VOID TerminateScreen(VOID); VOID TerminateScreen(VOID);
VOID SetNextScreenMode(INT32); VOID SetNextScreenMode(INT32);
@ -821,8 +825,8 @@ VOID DebugPause(VOID);
#endif #endif
VOID EndlessIdleLoop(VOID); VOID EndlessIdleLoop(VOID);
BOOLEAN CheckFatalError(IN EFI_STATUS Status, IN CHAR16 *where); BOOLEAN CheckFatalError(IN EFI_STATUS Status, IN CONST CHAR16 *where);
BOOLEAN CheckError(IN EFI_STATUS Status, IN CHAR16 *where); BOOLEAN CheckError(IN EFI_STATUS Status, IN CONST CHAR16 *where);
VOID SwitchToGraphicsAndClear(VOID); VOID SwitchToGraphicsAndClear(VOID);
VOID BltClearScreen(IN BOOLEAN ShowBanner); VOID BltClearScreen(IN BOOLEAN ShowBanner);
@ -841,13 +845,12 @@ VOID FreeAnime(GUI_ANIME *Anime);
// icns loader module // icns loader module
// //
EG_IMAGE * LoadOSIcon(IN CHAR16 *OSIconName OPTIONAL, IN CHAR16 *FallbackIconName, IN UINTN PixelSize, IN BOOLEAN BootLogo, IN BOOLEAN WantDummy); EG_IMAGE * LoadOSIcon(IN CONST CHAR16 *OSIconName OPTIONAL, IN CONST CHAR16 *FallbackIconName, IN UINTN PixelSize, IN BOOLEAN BootLogo, IN BOOLEAN WantDummy);
EG_IMAGE * LoadIcns(IN EFI_FILE_HANDLE BaseDir, IN CONST CHAR16 *FileName, IN UINTN PixelSize);
EG_IMAGE * LoadIcns(IN EFI_FILE_HANDLE BaseDir, IN CHAR16 *FileName, IN UINTN PixelSize); EG_IMAGE * LoadIcnsFallback(IN EFI_FILE_HANDLE BaseDir, IN CONST CHAR16 *FileName, IN UINTN PixelSize);
EG_IMAGE * LoadIcnsFallback(IN EFI_FILE_HANDLE BaseDir, IN CHAR16 *FileName, IN UINTN PixelSize);
EG_IMAGE * DummyImage(IN UINTN PixelSize); EG_IMAGE * DummyImage(IN UINTN PixelSize);
EG_IMAGE * BuiltinIcon(IN UINTN Id); EG_IMAGE * BuiltinIcon(IN UINTN Id);
CHAR16 * GetIconsExt(IN CHAR16 *Icon, IN CHAR16 *Def); CHAR16 * GetIconsExt(IN CONST CHAR16 *Icon, IN CONST CHAR16 *Def);
EG_IMAGE * GetSmallHover(IN UINTN Id); EG_IMAGE * GetSmallHover(IN UINTN Id);
#define BUILTIN_ICON_FUNC_ABOUT (0) #define BUILTIN_ICON_FUNC_ABOUT (0)
@ -903,20 +906,20 @@ EG_IMAGE * GetSmallHover(IN UINTN Id);
#define ICON_FORMAT_PNG (2) #define ICON_FORMAT_PNG (2)
#define ICON_FORMAT_BMP (3) #define ICON_FORMAT_BMP (3)
VOID AddMenuInfoLine(IN REFIT_MENU_SCREEN *Screen, IN CHAR16 *InfoLine); VOID AddMenuInfoLine(IN REFIT_MENU_SCREEN *Screen, IN CONST CHAR16 *InfoLine);
VOID AddMenuInfo(IN REFIT_MENU_SCREEN *SubScreen, IN CHAR16 *Line); VOID AddMenuInfo(IN REFIT_MENU_SCREEN *SubScreen, IN CONST CHAR16 *Line);
VOID AddMenuEntry(IN REFIT_MENU_SCREEN *Screen, IN REFIT_MENU_ENTRY *Entry); VOID AddMenuEntry(IN REFIT_MENU_SCREEN *Screen, IN REFIT_MENU_ENTRY *Entry);
VOID AddMenuCheck(REFIT_MENU_SCREEN *SubScreen, CONST CHAR8 *Text, UINTN Bit, INTN ItemNum); VOID AddMenuCheck(REFIT_MENU_SCREEN *SubScreen, CONST CHAR8 *Text, UINTN Bit, INTN ItemNum);
VOID FreeMenu(IN REFIT_MENU_SCREEN *Screen); VOID FreeMenu(IN REFIT_MENU_SCREEN *Screen);
UINTN RunMenu(IN REFIT_MENU_SCREEN *Screen, OUT REFIT_MENU_ENTRY **ChosenEntry); UINTN RunMenu(IN REFIT_MENU_SCREEN *Screen, OUT REFIT_MENU_ENTRY **ChosenEntry);
UINTN RunMainMenu(IN REFIT_MENU_SCREEN *Screen, IN INTN DefaultSelection, OUT REFIT_MENU_ENTRY **ChosenEntry); UINTN RunMainMenu(IN REFIT_MENU_SCREEN *Screen, IN INTN DefaultSelection, OUT REFIT_MENU_ENTRY **ChosenEntry);
VOID DrawMenuText(IN CHAR16 *Text, IN INTN SelectedWidth, IN INTN XPos, IN INTN YPos, IN INTN Cursor); VOID DrawMenuText(IN CONST CHAR16 *Text, IN INTN SelectedWidth, IN INTN XPos, IN INTN YPos, IN INTN Cursor);
VOID ReinitVolumes(VOID); VOID ReinitVolumes(VOID);
BOOLEAN ReadAllKeyStrokes(VOID); BOOLEAN ReadAllKeyStrokes(VOID);
VOID OptionsMenu(OUT REFIT_MENU_ENTRY **ChosenEntry, IN CHAR8 *LastChosenOS); VOID OptionsMenu(OUT REFIT_MENU_ENTRY **ChosenEntry, IN CHAR8 *LastChosenOS);
VOID FreeScrollBar(VOID); VOID FreeScrollBar(VOID);
INTN DrawTextXY(IN CHAR16 *Text, IN INTN XPos, IN INTN YPos, IN UINT8 XAlign); INTN DrawTextXY(IN CONST CHAR16 *Text, IN INTN XPos, IN INTN YPos, IN UINT8 XAlign);
VOID DrawBCSText(IN CHAR16 *Text, IN INTN XPos, IN INTN YPos, IN UINT8 XAlign); VOID DrawBCSText(IN CONST CHAR16 *Text, IN INTN XPos, IN INTN YPos, IN UINT8 XAlign);
// //
// config module // config module
@ -924,7 +927,7 @@ VOID DrawBCSText(IN CHAR16 *Text, IN INTN XPos, IN INTN YPos, IN UINT8 XAlign);
typedef struct MISC_ICONS { typedef struct MISC_ICONS {
EG_IMAGE *image; EG_IMAGE *image;
CHAR8 *name; CONST CHAR8 *name;
} MISC_ICONS; } MISC_ICONS;
extern MISC_ICONS OSIconsTable[]; extern MISC_ICONS OSIconsTable[];
@ -1008,7 +1011,7 @@ VOID DumpKernelAndKextPatches(KERNEL_AND_KEXT_PATCHES *Patches);
//VOID FilterKextPatches(IN LOADER_ENTRY *Entry); //VOID FilterKextPatches(IN LOADER_ENTRY *Entry);
UINT32 EncodeOptions(CHAR16 *Options); UINT32 EncodeOptions(CONST CHAR16 *Options);
CHAR8* GetUnicodeChar(CHAR8 *s, CHAR16* UnicodeChar); CHAR8* GetUnicodeChar(CHAR8 *s, CHAR16* UnicodeChar);
@ -1017,7 +1020,7 @@ CHAR8* GetUnicodeChar(CHAR8 *s, CHAR16* UnicodeChar);
#define FSearchReplace(Source, Search, Replace) SearchAndReplace(Source, KERNEL_MAX_SIZE, Search, sizeof(Search), Replace, 1) #define FSearchReplace(Source, Search, Replace) SearchAndReplace(Source, KERNEL_MAX_SIZE, Search, sizeof(Search), Replace, 1)
#endif //FKERNELPATCH #endif //FKERNELPATCH
VOID DbgHeader(CHAR8 *str); VOID DbgHeader(CONST CHAR8 *str);
#endif #endif
/* /*

Some files were not shown because too many files have changed in this diff Show More