1) Sync EdkCompatibilityPkg with EDK 1.04. The changes includes:
1.1) Bug fixes. (For details, please check Documents & files: Snapshot/Release Notes at https://edk.tianocore.org/servlets/ProjectDocumentList?folderID=43&expandFolder=43&folderID=6) 1.2) Add new UEFI protocol definitions for AbsolutePointer, FormBrowser2, HiiConfigAccess, HiiConfigRouting, HiiDatabase, HiiFont, HiiImage, HiiString, SimpleTextInputEx, DPC protocol. 1.3) Add Smbios 2.5, 2.6 supports. Incompatible changes hilighted: 1) EFI_MANAGED_NETWORK_PROTOCOL_GUID changed. 2) EFI_IP4_IPCONFIG_DATA changed. 2) Add in EdkCompatibilityPkg/EdkCompatibilityPkg.dsc to build all libraries in this package. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4624 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
103
EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/Makefile
Normal file
103
EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/Makefile
Normal file
@@ -0,0 +1,103 @@
|
||||
#/*++
|
||||
#
|
||||
# Copyright (c) 2004 - 2007, Intel Corporation
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
# http://opensource.org/licenses/bsd-license.php
|
||||
#
|
||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#
|
||||
# Module Name:
|
||||
#
|
||||
# Makefile
|
||||
#
|
||||
# Abstract:
|
||||
#
|
||||
# makefile for building the StrGather utility.
|
||||
#
|
||||
#--*/
|
||||
|
||||
#
|
||||
# Make sure environmental variable EDK_SOURCE is set
|
||||
#
|
||||
!IFNDEF EDK_SOURCE
|
||||
!ERROR EDK_SOURCE environmental variable not set
|
||||
!ENDIF
|
||||
|
||||
#
|
||||
# Do this if you want to compile from this directory
|
||||
#
|
||||
!IFNDEF TOOLCHAIN
|
||||
TOOLCHAIN = TOOLCHAIN_MSVC
|
||||
!ENDIF
|
||||
|
||||
!INCLUDE $(BUILD_DIR)\PlatformTools.env
|
||||
|
||||
#
|
||||
# Target specific information
|
||||
#
|
||||
TARGET_NAME = StrGather
|
||||
TARGET_SRC_DIR = $(EDK_TOOLS_SOURCE)\Uefi$(TARGET_NAME)
|
||||
TARGET_EXE = $(EDK_TOOLS_OUTPUT)\StrGather.exe
|
||||
|
||||
#
|
||||
# Build targets
|
||||
#
|
||||
|
||||
all: $(TARGET_EXE)
|
||||
|
||||
|
||||
LIBS = "$(EDK_TOOLS_OUTPUT)\Common.lib"
|
||||
|
||||
OBJECTS = $(EDK_TOOLS_OUTPUT)\StrGather.obj \
|
||||
$(EDK_TOOLS_OUTPUT)\StringDB.obj
|
||||
|
||||
INC_PATHS = -I $(TARGET_SRC_DIR) \
|
||||
-I $(EDK_SOURCE)\Foundation\Include\Ia32 \
|
||||
-I $(EDK_SOURCE)\Foundation\Efi\Include \
|
||||
-I $(EDK_SOURCE)\Foundation\Framework\Include \
|
||||
-I $(EDK_SOURCE)\Foundation\Include\IndustryStandard \
|
||||
-I $(EDK_SOURCE)\Foundation\ \
|
||||
-I $(EDK_SOURCE)\Foundation\Core\Dxe \
|
||||
-I $(EDK_SOURCE)\Foundation\Efi \
|
||||
-I $(EDK_SOURCE)\Foundation\Framework \
|
||||
-I $(EDK_TOOLS_SOURCE)\Common \
|
||||
-I $(EDK_SOURCE)\Foundation\Include
|
||||
|
||||
INC_DEPS = $(TARGET_SRC_DIR)\StrGather.h $(TARGET_SRC_DIR)\StringDB.h
|
||||
|
||||
C_FLAGS = $(C_FLAGS) /W4
|
||||
|
||||
#
|
||||
# Compile each source file
|
||||
#
|
||||
$(EDK_TOOLS_OUTPUT)\StrGather.obj : $(TARGET_SRC_DIR)\StrGather.c $(INC_DEPS)
|
||||
$(CC) $(C_FLAGS) $(INC_PATHS) $(TARGET_SRC_DIR)\StrGather.c /Fo$@
|
||||
|
||||
$(EDK_TOOLS_OUTPUT)\StringDB.obj : $(TARGET_SRC_DIR)\StringDB.c $(INC_DEPS)
|
||||
$(CC) $(C_FLAGS) $(INC_PATHS) $(TARGET_SRC_DIR)\StringDB.c /Fo$@
|
||||
|
||||
#
|
||||
# Add Binary Build description for this tools.
|
||||
#
|
||||
|
||||
!IF (("$(EFI_BINARY_TOOLS)" == "YES") && EXIST($(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).exe))
|
||||
$(TARGET_EXE): $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).exe
|
||||
copy $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).exe $(TARGET_EXE) /Y
|
||||
if exist $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).pdb \
|
||||
copy $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).pdb $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).pdb /Y
|
||||
!ELSE
|
||||
$(TARGET_EXE) : $(OBJECTS) $(LIBS)
|
||||
$(LINK) $(MSVS_LINK_LIBPATHS) $(L_FLAGS) $(LIBS) /out:$(TARGET_EXE) $(OBJECTS)
|
||||
!IF ("$(EFI_BINARY_BUILD)" == "YES")
|
||||
if not exist $(EFI_PLATFORM_BIN)\Tools mkdir $(EFI_PLATFORM_BIN)\Tools
|
||||
if exist $(TARGET_EXE) copy $(TARGET_EXE) $(EFI_PLATFORM_BIN)\tools\$(TARGET_NAME).exe /Y
|
||||
if exist $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).pdb \
|
||||
copy $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).pdb $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).pdb /Y
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
clean:
|
||||
|
2829
EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
Normal file
2829
EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,87 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
StrGather.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Common defines and prototypes for StrGather.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _STR_GATHER_H_
|
||||
#define _STR_GATHER_H_
|
||||
|
||||
#define MALLOC(size) malloc (size)
|
||||
#define FREE(ptr) do { if ((ptr) != NULL) { free (ptr); } } while (0)
|
||||
|
||||
#define PROGRAM_NAME "StrGather"
|
||||
|
||||
typedef CHAR16 WCHAR;
|
||||
|
||||
#define UNICODE_TO_ASCII(w) (INT8) ((w) & 0xFF)
|
||||
#define ASCII_TO_UNICODE(a) (WCHAR) ((UINT8) (a))
|
||||
|
||||
#define UNICODE_HASH L'#'
|
||||
#define UNICODE_BACKSLASH L'\\'
|
||||
#define UNICODE_SLASH L'/'
|
||||
#define UNICODE_EQUAL_SIGN L'='
|
||||
#define UNICODE_PLUS_SIGN L'+'
|
||||
|
||||
#define UNICODE_FILE_START 0xFEFF
|
||||
#define UNICODE_CR 0x000D
|
||||
#define UNICODE_LF 0x000A
|
||||
#define UNICODE_NULL 0x0000
|
||||
#define UNICODE_SPACE L' '
|
||||
#define UNICODE_SLASH L'/'
|
||||
#define UNICODE_DOUBLE_QUOTE L'"'
|
||||
#define UNICODE_OPEN_PAREN L'('
|
||||
#define UNICODE_CLOSE_PAREN L')'
|
||||
#define UNICODE_Z L'Z'
|
||||
#define UNICODE_z L'z'
|
||||
#define UNICODE_A L'A'
|
||||
#define UNICODE_a L'a'
|
||||
#define UNICODE_F L'F'
|
||||
#define UNICODE_f L'f'
|
||||
#define UNICODE_UNDERSCORE L'_'
|
||||
#define UNICODE_MINUS L'-'
|
||||
#define UNICODE_0 L'0'
|
||||
#define UNICODE_9 L'9'
|
||||
#define UNICODE_TAB L'\t'
|
||||
#define UNICODE_NBR_STRING L"\\nbr"
|
||||
#define UNICODE_BR_STRING L"\\br"
|
||||
#define UNICODE_WIDE_STRING L"\\wide"
|
||||
#define UNICODE_NARROW_STRING L"\\narrow"
|
||||
|
||||
//
|
||||
// This is the length of a valid string identifier
|
||||
//
|
||||
#define LANGUAGE_IDENTIFIER_NAME_LEN 128
|
||||
|
||||
typedef struct _TEXT_STRING_LIST {
|
||||
struct _TEXT_STRING_LIST *Next;
|
||||
UINT8 *Str;
|
||||
} TEXT_STRING_LIST;
|
||||
|
||||
typedef struct _WCHAR_STRING_LIST {
|
||||
struct _WCHAR_STRING_LIST *Next;
|
||||
WCHAR *Str;
|
||||
} WCHAR_STRING_LIST;
|
||||
|
||||
typedef struct _WCHAR_MATCHING_STRING_LIST {
|
||||
struct _WCHAR_MATCHING_STRING_LIST *Next;
|
||||
WCHAR *Str1;
|
||||
WCHAR *Str2;
|
||||
} WCHAR_MATCHING_STRING_LIST;
|
||||
|
||||
#endif // #ifndef _STR_GATHER_H_
|
2674
EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StringDB.c
Normal file
2674
EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StringDB.c
Normal file
File diff suppressed because it is too large
Load Diff
254
EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StringDB.h
Normal file
254
EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StringDB.h
Normal file
@@ -0,0 +1,254 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
StringDB.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Common defines and prototypes for string database management
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _STRING_DB_H_
|
||||
#define _STRING_DB_H_
|
||||
|
||||
#define LANGUAGE_NAME_STRING_NAME L"$LANGUAGE_NAME"
|
||||
#define PRINTABLE_LANGUAGE_NAME_STRING_NAME L"$PRINTABLE_LANGUAGE_NAME"
|
||||
|
||||
typedef CHAR16 WCHAR;
|
||||
|
||||
#define NARROW_CHAR 0xFFF0
|
||||
#define WIDE_CHAR 0xFFF1
|
||||
#define NON_BREAKING_CHAR 0xFFF2
|
||||
#define GLYPH_WIDTH 8
|
||||
#define GLYPH_HEIGHT 19
|
||||
|
||||
#define STRING_DB_KEY (('S' << 24) | ('D' << 16) | ('B' << 8) | 'K')
|
||||
//
|
||||
// Version supported by this tool
|
||||
//
|
||||
#define STRING_DB_VERSION 0x00010000
|
||||
|
||||
#define STRING_DB_MAJOR_VERSION_MASK 0xFFFF0000
|
||||
#define STRING_DB_MINOR_VERSION_MASK 0x0000FFFF
|
||||
|
||||
#define DEFINE_STR L"// #define"
|
||||
|
||||
#define EFI_STRING_ID_BEGIN 0x01
|
||||
|
||||
//
|
||||
// This is the header that gets written to the top of the
|
||||
// output binary database file.
|
||||
//
|
||||
typedef struct {
|
||||
UINT32 Key;
|
||||
UINT32 HeaderSize;
|
||||
UINT32 Version;
|
||||
UINT32 NumStringIdenfiers;
|
||||
UINT32 StringIdentifiersSize;
|
||||
UINT32 NumLanguages;
|
||||
} STRING_DB_HEADER;
|
||||
|
||||
//
|
||||
// When we write out data to the database, we have a UINT16 identifier, which
|
||||
// indicates what follows, followed by the data. Here's the structure.
|
||||
//
|
||||
typedef struct {
|
||||
UINT16 DataType;
|
||||
UINT16 Reserved;
|
||||
} DB_DATA_ITEM_HEADER;
|
||||
|
||||
#define DB_DATA_TYPE_INVALID 0x0000
|
||||
#define DB_DATA_TYPE_STRING_IDENTIFIER 0x0001
|
||||
#define DB_DATA_TYPE_LANGUAGE_DEFINITION 0x0002
|
||||
#define DB_DATA_TYPE_STRING_DEFINITION 0x0003
|
||||
#define DB_DATA_TYPE_LAST DB_DATA_TYPE_STRING_DEFINITION
|
||||
|
||||
//
|
||||
// We have to keep track of a list of languages, each of which has its own
|
||||
// list of strings. Define a structure to keep track of all languages and
|
||||
// their list of strings.
|
||||
//
|
||||
typedef struct _STRING_LIST {
|
||||
struct _STRING_LIST *Next;
|
||||
UINT32 Size; // number of bytes in string, including null terminator
|
||||
WCHAR *LanguageName;
|
||||
WCHAR *StringName; // for example STR_ID_TEXT1
|
||||
WCHAR *Scope; //
|
||||
WCHAR *Str; // the actual string
|
||||
UINT16 Flags; // properties of this string (used, undefined)
|
||||
} STRING_LIST;
|
||||
|
||||
typedef struct _LANGUAGE_LIST {
|
||||
struct _LANGUAGE_LIST *Next;
|
||||
WCHAR *LanguageName;
|
||||
WCHAR *PrintableLanguageName;
|
||||
WCHAR *SecondaryLanguageList;
|
||||
STRING_LIST *String;
|
||||
STRING_LIST *LastString;
|
||||
} LANGUAGE_LIST;
|
||||
|
||||
//
|
||||
// We also keep track of all the string identifier names, which we assign unique
|
||||
// values to. Create a structure to keep track of them all.
|
||||
//
|
||||
typedef struct _STRING_IDENTIFIER {
|
||||
struct _STRING_IDENTIFIER *Next;
|
||||
UINT32 Index; // only need 16 bits, but makes it easier with UINT32
|
||||
WCHAR *StringName;
|
||||
UINT16 Flags; // if someone referenced it via STRING_TOKEN()
|
||||
} STRING_IDENTIFIER;
|
||||
//
|
||||
// Keep our globals in this structure to be as modular as possible.
|
||||
//
|
||||
typedef struct {
|
||||
FILE *StringDBFptr;
|
||||
LANGUAGE_LIST *LanguageList;
|
||||
LANGUAGE_LIST *LastLanguageList;
|
||||
LANGUAGE_LIST *CurrentLanguage; // keep track of the last language they used
|
||||
STRING_IDENTIFIER *StringIdentifier;
|
||||
STRING_IDENTIFIER *LastStringIdentifier;
|
||||
UINT8 *StringDBFileName;
|
||||
UINT32 NumStringIdentifiers;
|
||||
UINT32 NumStringIdentifiersReferenced;
|
||||
STRING_IDENTIFIER *CurrentStringIdentifier; // keep track of the last string identifier they added
|
||||
WCHAR *CurrentScope;
|
||||
} STRING_DB_DATA;
|
||||
|
||||
typedef struct _SPkgBlkBuffer {
|
||||
UINT32 mBlkSize;
|
||||
VOID *mBlkBuffer;
|
||||
struct _SPkgBlkBuffer *mNext;
|
||||
} SPkgBlkBuffer;
|
||||
|
||||
void
|
||||
StringDBConstructor (
|
||||
void
|
||||
)
|
||||
;
|
||||
void
|
||||
StringDBDestructor (
|
||||
void
|
||||
)
|
||||
;
|
||||
|
||||
STATUS
|
||||
StringDBAddString (
|
||||
WCHAR *LanguageName,
|
||||
WCHAR *StringIdentifier,
|
||||
WCHAR *Scope,
|
||||
WCHAR *String,
|
||||
BOOLEAN Format,
|
||||
UINT16 Flags
|
||||
)
|
||||
;
|
||||
|
||||
STATUS
|
||||
StringDBSetScope (
|
||||
WCHAR *Scope
|
||||
)
|
||||
;
|
||||
|
||||
#define STRING_FLAGS_REFERENCED 0x0001 // if referenced somewhere
|
||||
#define STRING_FLAGS_UNDEFINED 0x0002 // if we added it for padding purposes
|
||||
#define STRING_FLAGS_INDEX_ASSIGNED 0x0004 // so don't change the index value
|
||||
#define STRING_ID_INVALID 0xFFFF
|
||||
#define STRING_ID_LANGUAGE_NAME 0x0000
|
||||
#define STRING_ID_PRINTABLE_LANGUAGE_NAME 0x0001
|
||||
|
||||
STATUS
|
||||
StringDBAddStringIdentifier (
|
||||
WCHAR *StringIdentifier,
|
||||
UINT16 *NewId,
|
||||
UINT16 Flags
|
||||
)
|
||||
;
|
||||
|
||||
STATUS
|
||||
StringDBReadDatabase (
|
||||
INT8 *DBFileName,
|
||||
BOOLEAN IgnoreIfNotExist,
|
||||
BOOLEAN Verbose
|
||||
)
|
||||
;
|
||||
|
||||
STATUS
|
||||
StringDBWriteDatabase (
|
||||
INT8 *DBFileName,
|
||||
BOOLEAN Verbose
|
||||
)
|
||||
;
|
||||
|
||||
STATUS
|
||||
StringDBDumpDatabase (
|
||||
INT8 *DBFileName,
|
||||
INT8 *OutputFileName,
|
||||
BOOLEAN Verbose
|
||||
)
|
||||
;
|
||||
|
||||
STATUS
|
||||
StringDBAddLanguage (
|
||||
WCHAR *LanguageName,
|
||||
WCHAR *PrintableLanguageName,
|
||||
WCHAR *SecondaryLanguageList
|
||||
)
|
||||
;
|
||||
|
||||
STATUS
|
||||
StringDBAddSecondaryLanguage (
|
||||
WCHAR *LanguageName,
|
||||
WCHAR *SecondaryLanguageList
|
||||
)
|
||||
;
|
||||
|
||||
STATUS
|
||||
StringDBDumpCStrings (
|
||||
INT8 *BaseName,
|
||||
INT8 *FileName
|
||||
)
|
||||
;
|
||||
|
||||
STATUS
|
||||
StringDBDumpStringDefines (
|
||||
INT8 *FileName,
|
||||
INT8 *BaseName
|
||||
)
|
||||
;
|
||||
|
||||
STATUS
|
||||
StringDBSetCurrentLanguage (
|
||||
WCHAR *LanguageName
|
||||
)
|
||||
;
|
||||
|
||||
STATUS
|
||||
StringDBSetStringReferenced (
|
||||
INT8 *StringIdentifierName,
|
||||
BOOLEAN IgnoreNotFound
|
||||
)
|
||||
;
|
||||
|
||||
void
|
||||
StringDBFormatString (
|
||||
WCHAR *String
|
||||
)
|
||||
;
|
||||
|
||||
LANGUAGE_LIST *
|
||||
StringDBFindLanguageList (
|
||||
WCHAR *LanguageName
|
||||
)
|
||||
;
|
||||
|
||||
#endif // #ifndef _STRING_DB_H_
|
Reference in New Issue
Block a user