|
From: <lg...@us...> - 2010-02-05 08:08:55
|
Revision: 1847
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=1847&view=rev
Author: lgao4
Date: 2010-02-05 06:50:09 +0000 (Fri, 05 Feb 2010)
Log Message:
-----------
Correct copyright of C tools.
Modified Paths:
--------------
trunk/BaseTools/Source/C/BootSectImage/bootsectimage.c
trunk/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c
trunk/BaseTools/Source/C/EfiRom/EfiRom.c
trunk/BaseTools/Source/C/GenBootSector/GenBootSector.c
trunk/BaseTools/Source/C/GenCrc32/GenCrc32.c
trunk/BaseTools/Source/C/GenFfs/GenFfs.c
trunk/BaseTools/Source/C/GenPage/GenPage.c
trunk/BaseTools/Source/C/GenSec/GenSec.c
trunk/BaseTools/Source/C/GenVtf/GenVtf.c
trunk/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c
trunk/BaseTools/Source/C/Split/Split.c
trunk/BaseTools/Source/C/TianoCompress/TianoCompress.c
trunk/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
trunk/BaseTools/Source/C/VolInfo/VolInfo.c
Modified: trunk/BaseTools/Source/C/BootSectImage/bootsectimage.c
===================================================================
--- trunk/BaseTools/Source/C/BootSectImage/bootsectimage.c 2010-02-05 03:33:51 UTC (rev 1846)
+++ trunk/BaseTools/Source/C/BootSectImage/bootsectimage.c 2010-02-05 06:50:09 UTC (rev 1847)
@@ -4,7 +4,7 @@
Patch the BPB information in boot sector image file.
Patch the MBR code in MBR image file.
-Copyright 2006 - 2008, Intel Corporation
+Copyright 2006 - 2010, 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
@@ -56,7 +56,7 @@
--*/
{
printf ("%s v%d.%d - Utility to break a file into two pieces at the specified offset.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);
- printf ("Copyright (c) 1999-2007 Intel Corporation. All rights reserved.\n");
+ printf ("Copyright (c) 1999-2010 Intel Corporation. All rights reserved.\n");
}
void
Modified: trunk/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c
===================================================================
--- trunk/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c 2010-02-05 03:33:51 UTC (rev 1846)
+++ trunk/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c 2010-02-05 06:50:09 UTC (rev 1847)
@@ -1,6 +1,6 @@
/** @file
-Copyright 2006 - 2008, Intel Corporation
+Copyright 2006 - 2010, 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
@@ -84,7 +84,7 @@
--*/
{
printf ("%s v%d.%d -Utility to break a file into two pieces at the request offset.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);
- printf ("Copyright (c) 1999-2007 Intel Corporation. All rights reserved.\n");
+ printf ("Copyright (c) 1999-2010 Intel Corporation. All rights reserved.\n");
}
VOID
Modified: trunk/BaseTools/Source/C/EfiRom/EfiRom.c
===================================================================
--- trunk/BaseTools/Source/C/EfiRom/EfiRom.c 2010-02-05 03:33:51 UTC (rev 1846)
+++ trunk/BaseTools/Source/C/EfiRom/EfiRom.c 2010-02-05 06:50:09 UTC (rev 1847)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 1999-2008 Intel Corporation. All rights reserved
+Copyright (c) 1999-2010 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
@@ -1205,7 +1205,7 @@
//
// Copyright declaration
//
- fprintf (stdout, "Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.\n\n");
+ fprintf (stdout, "Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.\n\n");
//
// Details Option
Modified: trunk/BaseTools/Source/C/GenBootSector/GenBootSector.c
===================================================================
--- trunk/BaseTools/Source/C/GenBootSector/GenBootSector.c 2010-02-05 03:33:51 UTC (rev 1846)
+++ trunk/BaseTools/Source/C/GenBootSector/GenBootSector.c 2010-02-05 06:50:09 UTC (rev 1847)
@@ -1,6 +1,6 @@
/** @file
-Copyright 2006 - 2008, Intel Corporation
+Copyright 2006 - 2010, 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
@@ -542,7 +542,7 @@
--*/
{
printf ("%s v%d.%d -Utility to retrieve and update the boot sector or MBR.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);
- printf ("Copyright (c) 2009 Intel Corporation. All rights reserved.\n");
+ printf ("Copyright (c) 2009 - 2010 Intel Corporation. All rights reserved.\n");
}
VOID
Modified: trunk/BaseTools/Source/C/GenCrc32/GenCrc32.c
===================================================================
--- trunk/BaseTools/Source/C/GenCrc32/GenCrc32.c 2010-02-05 03:33:51 UTC (rev 1846)
+++ trunk/BaseTools/Source/C/GenCrc32/GenCrc32.c 2010-02-05 06:50:09 UTC (rev 1847)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2007 - 2008, Intel Corporation
+Copyright (c) 2007 - 2010, 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
@@ -86,7 +86,7 @@
//
// Copyright declaration
//
- fprintf (stdout, "Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.\n\n");
+ fprintf (stdout, "Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.\n\n");
//
// Details Option
Modified: trunk/BaseTools/Source/C/GenFfs/GenFfs.c
===================================================================
--- trunk/BaseTools/Source/C/GenFfs/GenFfs.c 2010-02-05 03:33:51 UTC (rev 1846)
+++ trunk/BaseTools/Source/C/GenFfs/GenFfs.c 2010-02-05 06:50:09 UTC (rev 1847)
@@ -1,6 +1,6 @@
/**
-Copyright (c) 2004-2008, Intel Corporation
+Copyright (c) 2004-2010, 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
@@ -119,7 +119,7 @@
//
// Copyright declaration
//
- fprintf (stdout, "Copyright (c) 2007, Intel Corporation. All rights reserved.\n\n");
+ fprintf (stdout, "Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.\n\n");
//
// Details Option
Modified: trunk/BaseTools/Source/C/GenPage/GenPage.c
===================================================================
--- trunk/BaseTools/Source/C/GenPage/GenPage.c 2010-02-05 03:33:51 UTC (rev 1846)
+++ trunk/BaseTools/Source/C/GenPage/GenPage.c 2010-02-05 06:50:09 UTC (rev 1847)
@@ -1,6 +1,6 @@
/** @file
-Copyright 2006 - 2008, Intel Corporation
+Copyright 2006 - 2010, 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
@@ -92,7 +92,7 @@
--*/
{
printf ("%s v%d.%d -Utility to generate the EfiLoader image containing page table.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);
- printf ("Copyright (c) 2008 - 2009 Intel Corporation. All rights reserved.\n");
+ printf ("Copyright (c) 2008 - 2010 Intel Corporation. All rights reserved.\n");
}
VOID
Modified: trunk/BaseTools/Source/C/GenSec/GenSec.c
===================================================================
--- trunk/BaseTools/Source/C/GenSec/GenSec.c 2010-02-05 03:33:51 UTC (rev 1846)
+++ trunk/BaseTools/Source/C/GenSec/GenSec.c 2010-02-05 06:50:09 UTC (rev 1847)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2004 - 2008, Intel Corporation
+Copyright (c) 2004 - 2010, 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
@@ -150,7 +150,7 @@
//
// Copyright declaration
//
- fprintf (stdout, "Copyright (c) 2007, Intel Corporation. All rights reserved.\n\n");
+ fprintf (stdout, "Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.\n\n");
//
// Details Option
Modified: trunk/BaseTools/Source/C/GenVtf/GenVtf.c
===================================================================
--- trunk/BaseTools/Source/C/GenVtf/GenVtf.c 2010-02-05 03:33:51 UTC (rev 1846)
+++ trunk/BaseTools/Source/C/GenVtf/GenVtf.c 2010-02-05 06:50:09 UTC (rev 1847)
@@ -1,6 +1,6 @@
/**
-Copyright (c) 1999-2008 Intel Corporation. All rights reserved
+Copyright (c) 1999-2010 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
@@ -2407,7 +2407,7 @@
//
// Copyright declaration
//
- fprintf (stdout, "Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.\n\n");
+ fprintf (stdout, "Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.\n\n");
//
// Details Option
//
Modified: trunk/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c
===================================================================
--- trunk/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c 2010-02-05 03:33:51 UTC (rev 1846)
+++ trunk/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c 2010-02-05 06:50:09 UTC (rev 1847)
@@ -1,6 +1,6 @@
/** @file
-Copyright 2006 - 2009, Intel Corporation
+Copyright 2006 - 2010, 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
@@ -273,7 +273,7 @@
)
{
printf ("%s v%d.%d -Utility to retrieve and update the boot sector or MBR.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);
- printf ("Copyright (c) 2007-2009 Intel Corporation. All rights reserved.\n");
+ printf ("Copyright (c) 2007-2010 Intel Corporation. All rights reserved.\n");
}
Modified: trunk/BaseTools/Source/C/Split/Split.c
===================================================================
--- trunk/BaseTools/Source/C/Split/Split.c 2010-02-05 03:33:51 UTC (rev 1846)
+++ trunk/BaseTools/Source/C/Split/Split.c 2010-02-05 06:50:09 UTC (rev 1847)
@@ -2,7 +2,7 @@
Split a file into two pieces at the request offset.
-Copyright (c) 1999-2008 Intel Corporation. All rights reserved
+Copyright (c) 1999-2010 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
@@ -58,7 +58,7 @@
--*/
{
printf ("%s v%d.%d -Utility to break a file into two pieces at the request offset.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);
- printf ("Copyright (c) 1999-2007 Intel Corporation. All rights reserved.\n");
+ printf ("Copyright (c) 1999-2010 Intel Corporation. All rights reserved.\n");
}
void
Modified: trunk/BaseTools/Source/C/TianoCompress/TianoCompress.c
===================================================================
--- trunk/BaseTools/Source/C/TianoCompress/TianoCompress.c 2010-02-05 03:33:51 UTC (rev 1846)
+++ trunk/BaseTools/Source/C/TianoCompress/TianoCompress.c 2010-02-05 06:50:09 UTC (rev 1847)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2007 - 2008, Intel Corporation
+Copyright (c) 2007 - 2010, 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
@@ -1695,7 +1695,7 @@
//
// Copyright declaration
//
- fprintf (stdout, "Copyright (c) 2007, Intel Corporation. All rights reserved.\n\n");
+ fprintf (stdout, "Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.\n\n");
//
// Details Option
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp 2010-02-05 03:33:51 UTC (rev 1846)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp 2010-02-05 06:50:09 UTC (rev 1847)
@@ -2,7 +2,7 @@
VfrCompiler main class and main function.
-Copyright (c) 2004 - 2008, Intel Corporation
+Copyright (c) 2004 - 2010, 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
@@ -383,6 +383,7 @@
CONST CHAR8 *Help[] = {
" ",
"VfrCompile version " VFR_COMPILER_VERSION VFR_COMPILER_UPDATE_TIME,
+ "Copyright (c) 2004-2010 Intel Corporation. All rights reserved.",
" ",
"Usage: VfrCompile [options] VfrFile",
" ",
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2010-02-05 03:33:51 UTC (rev 1846)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2010-02-05 06:50:09 UTC (rev 1847)
@@ -1,5 +1,5 @@
/*++
-Copyright (c) 2004 - 2009, Intel Corporation
+Copyright (c) 2004 - 2010, 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
Modified: trunk/BaseTools/Source/C/VolInfo/VolInfo.c
===================================================================
--- trunk/BaseTools/Source/C/VolInfo/VolInfo.c 2010-02-05 03:33:51 UTC (rev 1846)
+++ trunk/BaseTools/Source/C/VolInfo/VolInfo.c 2010-02-05 06:50:09 UTC (rev 1847)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 1999 - 2008, Intel Corporation
+Copyright (c) 1999 - 2010, 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
@@ -1801,7 +1801,7 @@
//
// Copyright declaration
//
- fprintf (stdout, "Copyright (c) 2007, Intel Corporation. All rights reserved.\n\n");
+ fprintf (stdout, "Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.\n\n");
//
// Details Option
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lg...@us...> - 2010-02-24 09:18:10
|
Revision: 1896
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=1896&view=rev
Author: lgao4
Date: 2010-02-24 09:18:03 +0000 (Wed, 24 Feb 2010)
Log Message:
-----------
Enhance VfrCompiler to support HiiFormMap feature.
Modified Paths:
--------------
trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
trunk/BaseTools/Source/C/VfrCompile/EfiVfr.h
trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
trunk/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
trunk/BaseTools/Source/C/VfrCompile/VfrUtilityLib.h
Modified: trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
===================================================================
--- trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h 2010-02-24 09:00:54 UTC (rev 1895)
+++ trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h 2010-02-24 09:18:03 UTC (rev 1896)
@@ -3,7 +3,7 @@
IFR is primarily consumed by the EFI presentation engine, and produced by EFI
internal application and drivers as well as all add-in card option-ROM drivers
- Copyright (c) 2006 - 2009, Intel Corporation All rights reserved.
+ Copyright (c) 2006 - 2010, 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
@@ -618,6 +618,7 @@
#define EFI_IFR_DISABLE_IF_OP 0x1E
#define EFI_IFR_TO_LOWER_OP 0x20
#define EFI_IFR_TO_UPPER_OP 0x21
+#define EFI_IFR_MAP_OP 0x22
#define EFI_IFR_ORDERED_LIST_OP 0x23
#define EFI_IFR_VARSTORE_OP 0x24
#define EFI_IFR_VARSTORE_NAME_VALUE_OP 0x25
@@ -626,6 +627,10 @@
#define EFI_IFR_VERSION_OP 0x28
#define EFI_IFR_END_OP 0x29
#define EFI_IFR_MATCH_OP 0x2A
+#define EFI_IFR_GET_OP 0x2B
+#define EFI_IFR_SET_OP 0x2C
+#define EFI_IFR_READ_OP 0x2D
+#define EFI_IFR_WRITE_OP 0x2E
#define EFI_IFR_EQUAL_OP 0x2F
#define EFI_IFR_NOT_EQUAL_OP 0x30
#define EFI_IFR_GREATER_THAN_OP 0x31
@@ -672,6 +677,7 @@
#define EFI_IFR_VALUE_OP 0x5A
#define EFI_IFR_DEFAULT_OP 0x5B
#define EFI_IFR_DEFAULTSTORE_OP 0x5C
+#define EFI_IFR_FORM_MAP_OP 0x5D
#define EFI_IFR_CATENATE_OP 0x5E
#define EFI_IFR_GUID_OP 0x5F
#define EFI_IFR_SECURITY_OP 0x60
@@ -730,14 +736,14 @@
typedef struct _EFI_IFR_VARSTORE_EFI {
EFI_IFR_OP_HEADER Header;
- UINT16 VarStoreId;
+ EFI_VARSTORE_ID VarStoreId;
EFI_GUID Guid;
UINT32 Attributes;
} EFI_IFR_VARSTORE_EFI;
typedef struct _EFI_IFR_VARSTORE_NAME_VALUE {
EFI_IFR_OP_HEADER Header;
- UINT16 VarStoreId;
+ EFI_VARSTORE_ID VarStoreId;
EFI_GUID Guid;
} EFI_IFR_VARSTORE_NAME_VALUE;
@@ -747,7 +753,7 @@
EFI_STRING_ID FormSetTitle;
EFI_STRING_ID Help;
UINT8 Flags;
- EFI_GUID ClassGuid[1];
+ // EFI_GUID ClassGuid[];
} EFI_IFR_FORM_SET;
typedef struct _EFI_IFR_END {
@@ -1009,6 +1015,9 @@
#define EFI_IFR_TYPE_DATE 0x06
#define EFI_IFR_TYPE_STRING 0x07
#define EFI_IFR_TYPE_OTHER 0x08
+#define EFI_IFR_TYPE_UNDEFINED 0x09
+#define EFI_IFR_TYPE_ACTION 0x0A
+#define EFI_IFR_TYPE_BUFFER 0x0B
#define EFI_IFR_OPTION_DEFAULT 0x10
#define EFI_IFR_OPTION_DEFAULT_MFG 0x20
@@ -1288,6 +1297,100 @@
EFI_GUID Permissions;
} EFI_IFR_SECURITY;
+typedef struct _EFI_IFR_FORM_MAP_METHOD {
+ ///
+ /// The string identifier which provides the human-readable name of
+ /// the configuration method for this standards map form.
+ ///
+ EFI_STRING_ID MethodTitle;
+ ///
+ /// Identifier which uniquely specifies the configuration methods
+ /// associated with this standards map form.
+ ///
+ EFI_GUID MethodIdentifier;
+} EFI_IFR_FORM_MAP_METHOD;
+
+typedef struct _EFI_IFR_FORM_MAP {
+ ///
+ /// The sequence that defines the type of opcode as well as the length
+ /// of the opcode being defined. Header.OpCode = EFI_IFR_FORM_MAP_OP.
+ ///
+ EFI_IFR_OP_HEADER Header;
+ ///
+ /// The unique identifier for this particular form.
+ ///
+ EFI_FORM_ID FormId;
+ ///
+ /// One or more configuration method's name and unique identifier.
+ ///
+ // EFI_IFR_FORM_MAP_METHOD Methods[];
+} EFI_IFR_FORM_MAP;
+
+typedef struct _EFI_IFR_SET {
+ ///
+ /// The sequence that defines the type of opcode as well as the length
+ /// of the opcode being defined. Header.OpCode = EFI_IFR_SET_OP.
+ ///
+ EFI_IFR_OP_HEADER Header;
+ ///
+ /// Specifies the identifier of a previously declared variable store to
+ /// use when storing the question's value.
+ ///
+ EFI_VARSTORE_ID VarStoreId;
+ union {
+ ///
+ /// A 16-bit Buffer Storage offset.
+ ///
+ EFI_STRING_ID VarName;
+ ///
+ /// A Name Value or EFI Variable name (VarName).
+ ///
+ UINT16 VarOffset;
+ } VarStoreInfo;
+ ///
+ /// Specifies the type used for storage.
+ ///
+ UINT8 VarStoreType;
+} EFI_IFR_SET;
+
+typedef struct _EFI_IFR_GET {
+ ///
+ /// The sequence that defines the type of opcode as well as the length
+ /// of the opcode being defined. Header.OpCode = EFI_IFR_GET_OP.
+ ///
+ EFI_IFR_OP_HEADER Header;
+ ///
+ /// Specifies the identifier of a previously declared variable store to
+ /// use when retrieving the value.
+ ///
+ EFI_VARSTORE_ID VarStoreId;
+ union {
+ ///
+ /// A 16-bit Buffer Storage offset.
+ ///
+ EFI_STRING_ID VarName;
+ ///
+ /// A Name Value or EFI Variable name (VarName).
+ ///
+ UINT16 VarOffset;
+ } VarStoreInfo;
+ ///
+ /// Specifies the type used for storage.
+ ///
+ UINT8 VarStoreType;
+} EFI_IFR_GET;
+
+typedef struct _EFI_IFR_READ {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_READ;
+
+typedef struct _EFI_IFR_WRITE {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_WRITE;
+
+typedef struct _EFI_IFR_MAP {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_MAP;
//
// Keyboard Package
//
Modified: trunk/BaseTools/Source/C/VfrCompile/EfiVfr.h
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/EfiVfr.h 2010-02-24 09:00:54 UTC (rev 1895)
+++ trunk/BaseTools/Source/C/VfrCompile/EfiVfr.h 2010-02-24 09:18:03 UTC (rev 1896)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2004 - 2008, Intel Corporation
+Copyright (c) 2004 - 2010, 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
@@ -31,6 +31,7 @@
#define MAX_VFR_LINE_LEN 4096
#define EFI_IFR_MAX_LENGTH 0xFF
+#define MAX_IFR_EXPRESSION_DEPTH 0x9
#define EFI_VARSTORE_ID_INVALID 0
#define EFI_VAROFFSET_INVALID 0xFFFF
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp 2010-02-24 09:00:54 UTC (rev 1895)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp 2010-02-24 09:18:03 UTC (rev 1896)
@@ -2,7 +2,7 @@
The definition of CFormPkg's member function
-Copyright (c) 2004 - 2009, Intel Corporation
+Copyright (c) 2004 - 2010, 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
@@ -1242,7 +1242,7 @@
{ 0, 0 }, // 0x1F
{ sizeof (EFI_IFR_TO_LOWER), 0 }, // EFI_IFR_TO_LOWER_OP - 0x20
{ sizeof (EFI_IFR_TO_UPPER), 0 }, // EFI_IFR_TO_UPPER_OP - 0x21
- { 0, 0 }, // 0x22
+ { sizeof (EFI_IFR_MAP), 1 }, // EFI_IFR_MAP - 0x22
{ sizeof (EFI_IFR_ORDERED_LIST), 1 }, // EFI_IFR_ORDERED_LIST_OP - 0x23
{ sizeof (EFI_IFR_VARSTORE), 0 }, // EFI_IFR_VARSTORE_OP
{ sizeof (EFI_IFR_VARSTORE_NAME_VALUE), 0 }, // EFI_IFR_VARSTORE_NAME_VALUE_OP
@@ -1250,8 +1250,11 @@
{ sizeof (EFI_IFR_VARSTORE_DEVICE), 1 }, // EFI_IFR_VARSTORE_DEVICE_OP
{ sizeof (EFI_IFR_VERSION), 0 }, // EFI_IFR_VERSION_OP - 0x28
{ sizeof (EFI_IFR_END), 0 }, // EFI_IFR_END_OP
- { sizeof (EFI_IFR_MATCH), 1 }, // EFI_IFR_MATCH_OP - 0x2A
- { 0, 0 }, { 0, 0} , { 0, 0} , { 0, 0} , // 0x2B ~ 0x2E
+ { sizeof (EFI_IFR_MATCH), 0 }, // EFI_IFR_MATCH_OP - 0x2A
+ { sizeof (EFI_IFR_GET), 0 }, // EFI_IFR_GET - 0x2B
+ { sizeof (EFI_IFR_SET), 0 }, // EFI_IFR_SET - 0x2C
+ { sizeof (EFI_IFR_READ), 0 }, // EFI_IFR_READ - 0x2D
+ { sizeof (EFI_IFR_WRITE), 0 }, // EFI_IFR_WRITE - 0x2E
{ sizeof (EFI_IFR_EQUAL), 0 }, // EFI_IFR_EQUAL_OP - 0x2F
{ sizeof (EFI_IFR_NOT_EQUAL), 0 }, // EFI_IFR_NOT_EQUAL_OP
{ sizeof (EFI_IFR_GREATER_THAN), 0 }, // EFI_IFR_GREATER_THAN_OP
@@ -1298,7 +1301,7 @@
{ sizeof (EFI_IFR_VALUE), 1 }, // EFI_IFR_VALUE_OP
{ sizeof (EFI_IFR_DEFAULT), 0 }, // EFI_IFR_DEFAULT_OP
{ sizeof (EFI_IFR_DEFAULTSTORE), 0 }, // EFI_IFR_DEFAULTSTORE_OP - 0x5C
- { 0, 0}, // 0x5D
+ { sizeof (EFI_IFR_FORM_MAP), 1}, // EFI_IFR_FORM_MAP_OP - 0x5D
{ sizeof (EFI_IFR_CATENATE), 0 }, // EFI_IFR_CATENATE_OP
{ sizeof (EFI_IFR_GUID), 0 }, // EFI_IFR_GUID_OP
{ sizeof (EFI_IFR_SECURITY), 0 }, // EFI_IFR_SECURITY_OP - 0x60
@@ -1313,9 +1316,9 @@
"EFI_IFR_ACTION", "EFI_IFR_RESET_BUTTON", "EFI_IFR_FORM_SET", "EFI_IFR_REF", "EFI_IFR_NO_SUBMIT_IF", "EFI_IFR_INCONSISTENT_IF",
"EFI_IFR_EQ_ID_VAL", "EFI_IFR_EQ_ID_ID", "EFI_IFR_EQ_ID_LIST", "EFI_IFR_AND", "EFI_IFR_OR", "EFI_IFR_NOT",
"EFI_IFR_RULE", "EFI_IFR_GRAY_OUT_IF", "EFI_IFR_DATE", "EFI_IFR_TIME", "EFI_IFR_STRING", "EFI_IFR_REFRESH",
- "EFI_IFR_DISABLE_IF", "EFI_IFR_INVALID", "EFI_IFR_TO_LOWER", "EFI_IFR_TO_UPPER", "EFI_IFR_INVALID", "EFI_IFR_ORDERED_LIST",
+ "EFI_IFR_DISABLE_IF", "EFI_IFR_INVALID", "EFI_IFR_TO_LOWER", "EFI_IFR_TO_UPPER", "EFI_IFR_MAP", "EFI_IFR_ORDERED_LIST",
"EFI_IFR_VARSTORE", "EFI_IFR_VARSTORE_NAME_VALUE", "EFI_IFR_VARSTORE_EFI", "EFI_IFR_VARSTORE_DEVICE", "EFI_IFR_VERSION", "EFI_IFR_END",
- "EFI_IFR_MATCH", "EFI_IFR_INVALID", "EFI_IFR_INVALID", "EFI_IFR_INVALID", "EFI_IFR_INVALID", "EFI_IFR_EQUAL",
+ "EFI_IFR_MATCH", "EFI_IFR_GET", "EFI_IFR_SET", "EFI_IFR_READ", "EFI_IFR_WRITE", "EFI_IFR_EQUAL",
"EFI_IFR_NOT_EQUAL", "EFI_IFR_GREATER_THAN", "EFI_IFR_GREATER_EQUAL", "EFI_IFR_LESS_THAN", "EFI_IFR_LESS_EQUAL", "EFI_IFR_BITWISE_AND",
"EFI_IFR_BITWISE_OR", "EFI_IFR_BITWISE_NOT", "EFI_IFR_SHIFT_LEFT", "EFI_IFR_SHIFT_RIGHT", "EFI_IFR_ADD", "EFI_IFR_SUBTRACT",
"EFI_IFR_MULTIPLY", "EFI_IFR_DIVIDE", "EFI_IFR_MODULO", "EFI_IFR_RULE_REF", "EFI_IFR_QUESTION_REF1", "EFI_IFR_QUESTION_REF2",
@@ -1323,7 +1326,7 @@
"EFI_IFR_TO_UINT", "EFI_IFR_TO_STRING", "EFI_IFR_TO_BOOLEAN", "EFI_IFR_MID", "EFI_IFR_FIND", "EFI_IFR_TOKEN",
"EFI_IFR_STRING_REF1","EFI_IFR_STRING_REF2", "EFI_IFR_CONDITIONAL", "EFI_IFR_QUESTION_REF3", "EFI_IFR_ZERO", "EFI_IFR_ONE",
"EFI_IFR_ONES", "EFI_IFR_UNDEFINED", "EFI_IFR_LENGTH", "EFI_IFR_DUP", "EFI_IFR_THIS", "EFI_IFR_SPAN",
- "EFI_IFR_VALUE", "EFI_IFR_DEFAULT", "EFI_IFR_DEFAULTSTORE", "EFI_IFR_INVALID", "EFI_IFR_CATENATE", "EFI_IFR_GUID",
+ "EFI_IFR_VALUE", "EFI_IFR_DEFAULT", "EFI_IFR_DEFAULTSTORE", "EFI_IFR_FORM_MAP", "EFI_IFR_CATENATE", "EFI_IFR_GUID",
"EFI_IFR_SECURITY",
};
@@ -1396,4 +1399,4 @@
mHeader = OpHdr.mHeader;
}
-UINT32 CIfrForm::FormIdBitMap[EFI_FREE_FORM_ID_BITMAP_SIZE] = {0, };
+UINT32 CIfrFormId::FormIdBitMap[EFI_FREE_FORM_ID_BITMAP_SIZE] = {0, };
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2010-02-24 09:00:54 UTC (rev 1895)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2010-02-24 09:18:03 UTC (rev 1896)
@@ -2,7 +2,7 @@
The definition of CFormPkg's member function
-Copyright (c) 2004 - 2009, Intel Corporation
+Copyright (c) 2004 - 2010, 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
@@ -557,6 +557,7 @@
class CIfrFormSet : public CIfrObj, public CIfrOpHeader {
private:
EFI_IFR_FORM_SET *mFormSet;
+ EFI_GUID *mClassGuid;
public:
CIfrFormSet (UINT8 Size) : CIfrObj (EFI_IFR_FORM_SET_OP, (CHAR8 **)&mFormSet, Size),
@@ -565,6 +566,7 @@
mFormSet->FormSetTitle = EFI_STRING_ID_INVALID;
mFormSet->Flags = 0;
memset (&mFormSet->Guid, 0, sizeof (EFI_GUID));
+ mClassGuid = (EFI_GUID *) (mFormSet + 1);
}
VOID SetGuid (IN EFI_GUID *Guid) {
@@ -580,7 +582,7 @@
}
VOID SetClassGuid (IN EFI_GUID *Guid) {
- memcpy (&(mFormSet->ClassGuid[mFormSet->Flags++]), Guid, sizeof (EFI_GUID));
+ memcpy (&(mClassGuid[mFormSet->Flags++]), Guid, sizeof (EFI_GUID));
}
UINT8 GetFlags() {
@@ -620,10 +622,8 @@
#define EFI_FORM_ID_MAX 0xFFFF
#define EFI_FREE_FORM_ID_BITMAP_SIZE ((EFI_FORM_ID_MAX + 1) / EFI_BITS_PER_UINT32)
-class CIfrForm : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_FORM *mForm;
-
+class CIfrFormId {
+public:
STATIC UINT32 FormIdBitMap[EFI_FREE_FORM_ID_BITMAP_SIZE];
STATIC BOOLEAN ChekFormIdFree (IN EFI_FORM_ID FormId) {
@@ -639,7 +639,12 @@
FormIdBitMap[Index] |= (0x80000000 >> Offset);
}
+};
+class CIfrForm : public CIfrObj, public CIfrOpHeader {
+private:
+ EFI_IFR_FORM *mForm;
+
public:
CIfrForm () : CIfrObj (EFI_IFR_FORM_OP, (CHAR8 **)&mForm),
CIfrOpHeader (EFI_IFR_FORM_OP, &mForm->Header) {
@@ -654,11 +659,11 @@
//
return VFR_RETURN_INVALID_PARAMETER;
}
- if (CIfrForm::ChekFormIdFree (FormId) == FALSE) {
+ if (CIfrFormId::ChekFormIdFree (FormId) == FALSE) {
return VFR_RETURN_FORMID_REDEFINED;
}
mForm->FormId = FormId;
- CIfrForm::MarkFormIdUsed (FormId);
+ CIfrFormId::MarkFormIdUsed (FormId);
return VFR_RETURN_SUCCESS;
}
@@ -667,6 +672,44 @@
}
};
+class CIfrFormMap : public CIfrObj, public CIfrOpHeader {
+private:
+ EFI_IFR_FORM_MAP *mFormMap;
+ EFI_IFR_FORM_MAP_METHOD *mMethodMap;
+
+public:
+ CIfrFormMap () : CIfrObj (EFI_IFR_FORM_MAP_OP, (CHAR8 **)&mFormMap, sizeof (EFI_IFR_FORM_MAP), TRUE),
+ CIfrOpHeader (EFI_IFR_FORM_MAP_OP, &mFormMap->Header) {
+ mFormMap->FormId = 0;
+ mMethodMap = (EFI_IFR_FORM_MAP_METHOD *) (mFormMap + 1);
+ }
+
+ EFI_VFR_RETURN_CODE SetFormId (IN EFI_FORM_ID FormId) {
+ if (FormId == 0) {
+ //
+ // FormId can't be 0.
+ //
+ return VFR_RETURN_INVALID_PARAMETER;
+ }
+ if (CIfrFormId::ChekFormIdFree (FormId) == FALSE) {
+ return VFR_RETURN_FORMID_REDEFINED;
+ }
+ mFormMap->FormId = FormId;
+ CIfrFormId::MarkFormIdUsed (FormId);
+ return VFR_RETURN_SUCCESS;
+ }
+
+ VOID SetFormMapMethod (IN EFI_STRING_ID MethodTitle, IN EFI_GUID *MethodGuid) {
+ if (ExpendObjBin (sizeof (EFI_IFR_FORM_MAP_METHOD))) {
+ IncLength (sizeof (EFI_IFR_FORM_MAP_METHOD));
+
+ mMethodMap->MethodTitle = MethodTitle;
+ memcpy (&(mMethodMap->MethodIdentifier), MethodGuid, sizeof (EFI_GUID));
+ mMethodMap ++;
+ }
+ }
+};
+
class CIfrVarStore : public CIfrObj, public CIfrOpHeader {
private:
EFI_IFR_VARSTORE *mVarStore;
@@ -832,6 +875,66 @@
};
+class CIfrRead : public CIfrObj, public CIfrOpHeader{
+private:
+ EFI_IFR_READ *mRead;
+
+public:
+ CIfrRead () : CIfrObj (EFI_IFR_READ_OP, (CHAR8 **)&mRead),
+ CIfrOpHeader (EFI_IFR_READ_OP, &mRead->Header) {}
+
+};
+
+class CIfrWrite : public CIfrObj, public CIfrOpHeader{
+private:
+ EFI_IFR_WRITE *mWrite;
+
+public:
+ CIfrWrite () : CIfrObj (EFI_IFR_WRITE_OP, (CHAR8 **)&mWrite),
+ CIfrOpHeader (EFI_IFR_WRITE_OP, &mWrite->Header) {}
+
+};
+
+class CIfrGet : public CIfrObj, public CIfrOpHeader{
+private:
+ EFI_IFR_GET *mGet;
+
+public:
+ CIfrGet (
+ IN UINT32 LineNo
+ ) : CIfrObj (EFI_IFR_GET_OP, (CHAR8 **)&mGet),
+ CIfrOpHeader (EFI_IFR_GET_OP, &mGet->Header) {
+ SetLineNo (LineNo);
+ }
+
+ VOID SetVarInfo (IN EFI_VARSTORE_INFO *Info) {
+ mGet->VarStoreId = Info->mVarStoreId;
+ mGet->VarStoreInfo.VarName = Info->mInfo.mVarName;
+ mGet->VarStoreInfo.VarOffset = Info->mInfo.mVarOffset;
+ mGet->VarStoreType = Info->mVarType;
+ }
+};
+
+class CIfrSet : public CIfrObj, public CIfrOpHeader{
+private:
+ EFI_IFR_SET *mSet;
+
+public:
+ CIfrSet (
+ IN UINT32 LineNo
+ ) : CIfrObj (EFI_IFR_SET_OP, (CHAR8 **)&mSet),
+ CIfrOpHeader (EFI_IFR_SET_OP, &mSet->Header) {
+ SetLineNo (LineNo);
+ }
+
+ VOID SetVarInfo (IN EFI_VARSTORE_INFO *Info) {
+ mSet->VarStoreId = Info->mVarStoreId;
+ mSet->VarStoreInfo.VarName = Info->mInfo.mVarName;
+ mSet->VarStoreInfo.VarOffset = Info->mInfo.mVarOffset;
+ mSet->VarStoreType = Info->mVarType;
+ }
+};
+
class CIfrSubtitle : public CIfrObj, public CIfrOpHeader, public CIfrStatementHeader {
private:
EFI_IFR_SUBTITLE *mSubtitle;
@@ -2310,6 +2413,19 @@
}
};
+class CIfrMap : public CIfrObj, public CIfrOpHeader{
+private:
+ EFI_IFR_MAP *mMap;
+
+public:
+ CIfrMap (
+ IN UINT32 LineNo
+ ) : CIfrObj (EFI_IFR_MAP_OP, (CHAR8 **)&mMap),
+ CIfrOpHeader (EFI_IFR_MAP_OP, &mMap->Header) {
+ SetLineNo (LineNo);
+ }
+};
+
class CIfrMatch : public CIfrObj, public CIfrOpHeader {
private:
EFI_IFR_MATCH *mMatch;
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2010-02-24 09:00:54 UTC (rev 1895)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2010-02-24 09:18:03 UTC (rev 1896)
@@ -131,6 +131,9 @@
#token EndList("endlist") "endlist"
#token EndForm("endform") "endform"
#token Form("form") "form"
+#token FormMap("formmap") "formmap"
+#token MapTitle("maptitle") "maptitle"
+#token MapGuid("mapguid") "mapguid"
#token Subtitle("subtitle") "subtitle"
#token Help("help") "help"
#token Text("text") "text"
@@ -214,6 +217,8 @@
#token Rule("rule") "rule"
#token EndRule("endrule") "endrule"
#token Value("value") "value"
+#token Read("read") "read"
+#token Write("write") "write"
#token ResetButton("resetbutton") "resetbutton"
#token EndResetButton("endresetbutton") "endresetbutton"
#token DefaultStore("defaultstore") "defaultstore"
@@ -250,7 +255,8 @@
vfrProgram > [UINT8 Return] :
<<
- mParserStatus = 0;
+ mParserStatus = 0;
+ mCIfrOpHdrIndex = 0;
mConstantOnlyInExpression = FALSE;
>>
(
@@ -488,24 +494,26 @@
<<
switch (ClassGuidNum) {
case 0:
- FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET));
+ FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + sizeof(EFI_GUID));
FSObj->SetClassGuid(&DefaultClassGuid);
break;
case 1:
- FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET));
+ FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum * sizeof(EFI_GUID));
FSObj->SetClassGuid(&ClassGuid1);
break;
case 2:
- FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + sizeof(EFI_GUID));
+ FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum * sizeof(EFI_GUID));
FSObj->SetClassGuid(&ClassGuid1);
FSObj->SetClassGuid(&ClassGuid2);
break;
- default:
- FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + 2 * sizeof(EFI_GUID));
+ case 3:
+ FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum * sizeof(EFI_GUID));
FSObj->SetClassGuid(&ClassGuid1);
FSObj->SetClassGuid(&ClassGuid2);
FSObj->SetClassGuid(&ClassGuid3);
break;
+ default:
+ break;
}
SET_LINE_INFO (*FSObj, L);
@@ -544,6 +552,7 @@
vfrFormSetList :
(
vfrFormDefinition |
+ vfrFormMapDefinition |
vfrStatementImage |
vfrStatementVarStoreLinear |
vfrStatementVarStoreEfi |
@@ -774,11 +783,11 @@
mCVfrQuestionDB.RegisterQuestion (QName, VarIdStr, QId);
break;
case QUESTION_DATE:
- mCVfrQuestionDB.RegisterNewDateQuestion (QName, VarIdStr, QId);
- break;
+ mCVfrQuestionDB.RegisterNewDateQuestion (QName, VarIdStr, QId);
+ break;
case QUESTION_TIME:
- mCVfrQuestionDB.RegisterNewTimeQuestion (QName, VarIdStr, QId);
- break;
+ mCVfrQuestionDB.RegisterNewTimeQuestion (QName, VarIdStr, QId);
+ break;
default:
_PCATCH(VFR_RETURN_FATAL_ERROR);
}
@@ -823,7 +832,7 @@
| LateCheckFlag
;
-vfrStorageVarId[EFI_VARSTORE_INFO & Info, CHAR8 *&QuestVarIdStr] :
+vfrStorageVarId[EFI_VARSTORE_INFO & Info, CHAR8 *&QuestVarIdStr, BOOLEAN CheckFlag = TRUE] :
<<
UINT32 Idx;
UINT32 LineNo;
@@ -856,9 +865,11 @@
);
VfrReturnCode = mCVfrDataStorage.GetVarStoreType (SName, VarStoreType);
}
- _PCATCH(VfrReturnCode, SN1);
- _PCATCH(mCVfrDataStorage.GetVarStoreId (SName, &$Info.mVarStoreId), SN1);
- _PCATCH(mCVfrDataStorage.GetNameVarStoreInfo (&$Info, Idx), SN1);
+ if (CheckFlag || VfrReturnCode == VFR_RETURN_SUCCESS) {
+ _PCATCH(VfrReturnCode, SN1);
+ _PCATCH(mCVfrDataStorage.GetVarStoreId (SName, &$Info.mVarStoreId), SN1);
+ _PCATCH(mCVfrDataStorage.GetNameVarStoreInfo (&$Info, Idx), SN1);
+ }
>>
)
|
@@ -877,17 +888,21 @@
);
VfrReturnCode = mCVfrDataStorage.GetVarStoreType (SName, VarStoreType);
}
- _PCATCH(VfrReturnCode, SN2);
- _PCATCH(mCVfrDataStorage.GetVarStoreId (SName, &$Info.mVarStoreId), SN2);
- if (VarStoreType == EFI_VFR_VARSTORE_BUFFER) {
- _PCATCH(mCVfrDataStorage.GetBufferVarStoreDataTypeName(SName, &TName), SN2);
- _STRCAT(&VarStr, TName);
+ if (CheckFlag || VfrReturnCode == VFR_RETURN_SUCCESS) {
+ _PCATCH(VfrReturnCode, SN2);
+ _PCATCH(mCVfrDataStorage.GetVarStoreId (SName, &$Info.mVarStoreId), SN2);
+ if (VarStoreType == EFI_VFR_VARSTORE_BUFFER) {
+ _PCATCH(mCVfrDataStorage.GetBufferVarStoreDataTypeName(SName, &TName), SN2);
+ _STRCAT(&VarStr, TName);
+ }
}
>>
(
"." <<
- _PCATCH(((VarStoreType != EFI_VFR_VARSTORE_BUFFER) ? VFR_RETURN_EFIVARSTORE_USE_ERROR : VFR_RETURN_SUCCESS), SN2);
+ if (CheckFlag || VfrReturnCode == VFR_RETURN_SUCCESS) {
+ _PCATCH(((VarStoreType != EFI_VFR_VARSTORE_BUFFER) ? VFR_RETURN_EFIVARSTORE_USE_ERROR : VFR_RETURN_SUCCESS), SN2);
+ }
_STRCAT(&VarIdStr, "."); _STRCAT(&VarStr, ".");
>>
SF:StringIdentifier << _STRCAT(&VarIdStr, SF->getText()); _STRCAT(&VarStr, SF->getText()); >>
@@ -1082,6 +1097,33 @@
";"
;
+vfrFormMapDefinition :
+ <<
+ CIfrFormMap *FMapObj = NULL;
+ UINT32 FormMapMethodNumber = 0;
+ EFI_GUID Guid;
+ >>
+ F:FormMap << FMapObj = new CIfrFormMap(); FMapObj->SetLineNo(F->getLine()); >>
+ FormId "=" S1:Number "," << _PCATCH(FMapObj->SetFormId (_STOFID(S1->getText())), S1); >>
+ (
+ MapTitle "=" "STRING_TOKEN" "\(" S2:Number "\)" ";"
+ MapGuid "=" guidDefinition[Guid] ";" << FMapObj->SetFormMapMethod (_STOFID(S2->getText()), &Guid); FormMapMethodNumber ++; >>
+ )* << if (FormMapMethodNumber == 0) {_PCATCH (VFR_RETURN_INVALID_PARAMETER, F->getLine(), "No MapMethod is set for FormMap!");} delete FMapObj;>>
+ (
+ vfrStatementImage |
+ vfrStatementLocked |
+ vfrStatementRules |
+ vfrStatementDefault |
+ vfrStatem...
[truncated message content] |
|
From: <and...@us...> - 2010-03-24 17:29:28
|
Revision: 1941
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=1941&view=rev
Author: andrewfish
Date: 2010-03-24 17:29:20 +0000 (Wed, 24 Mar 2010)
Log Message:
-----------
Add support for ARM MOVW & MOVT relocations. These relocations are different than other relocations as each instruction only enocodes 1/2 of the 32-bit address so the MOVT that encodes the upper 16-bits requires Addend info in the relocation entry. This is done via Elf32_Rela in ELF by adding the Addend into the relocation data. Usually the Addend is read out of the instruction and the relocation entry points to the instruction. The PE/COFF spec is pending an update to describe ARM MOVW & MOVT relocation types.
Modified Paths:
--------------
trunk/BaseTools/Source/C/Common/BasePeCoff.c
trunk/BaseTools/Source/C/Common/PeCoffLib.h
trunk/BaseTools/Source/C/Common/PeCoffLoaderEx.c
trunk/BaseTools/Source/C/GenFw/GenFw.c
trunk/BaseTools/Source/C/GenFw/elf_common.h
trunk/BaseTools/Source/C/Include/Common/BaseTypes.h
trunk/BaseTools/Source/C/Include/IndustryStandard/PeImage.h
Modified: trunk/BaseTools/Source/C/Common/BasePeCoff.c
===================================================================
--- trunk/BaseTools/Source/C/Common/BasePeCoff.c 2010-03-23 09:18:48 UTC (rev 1940)
+++ trunk/BaseTools/Source/C/Common/BasePeCoff.c 2010-03-24 17:29:20 UTC (rev 1941)
@@ -71,6 +71,14 @@
IN UINT64 Adjust
);
+RETURN_STATUS
+PeCoffLoaderRelocateArmImage (
+ IN UINT16 **Reloc,
+ IN OUT CHAR8 *Fixup,
+ IN OUT CHAR8 **FixupData,
+ IN UINT64 Adjust
+ );
+
STATIC
RETURN_STATUS
PeCoffLoaderGetPeHeader (
@@ -777,9 +785,11 @@
default:
switch (MachineType) {
case EFI_IMAGE_MACHINE_IA32:
- case EFI_IMAGE_MACHINE_ARMT:
Status = PeCoffLoaderRelocateIa32Image (Reloc, Fixup, &FixupData, Adjust);
break;
+ case EFI_IMAGE_MACHINE_ARMT:
+ Status = PeCoffLoaderRelocateArmImage (&Reloc, Fixup, &FixupData, Adjust);
+ break;
case EFI_IMAGE_MACHINE_X64:
Status = PeCoffLoaderRelocateX64Image (Reloc, Fixup, &FixupData, Adjust);
break;
Modified: trunk/BaseTools/Source/C/Common/PeCoffLib.h
===================================================================
--- trunk/BaseTools/Source/C/Common/PeCoffLib.h 2010-03-23 09:18:48 UTC (rev 1940)
+++ trunk/BaseTools/Source/C/Common/PeCoffLib.h 2010-03-24 17:29:20 UTC (rev 1941)
@@ -144,4 +144,38 @@
)
;
+//
+// These functions are used by the ARM PE/COFF relocation code and by
+// the ELF to PE/COFF converter so that is why they are public
+//
+
+/**
+ Pass in a pointer to an ARM MOVT or MOVW immediate instruciton and
+ return the immediate data encoded in the instruction
+
+ @param Instruction Pointer to ARM MOVT or MOVW immediate instruction
+
+ @return Immediate address encoded in the instruction
+
+**/
+UINT16
+ThumbMovtImmediateAddress (
+ IN UINT16 *Instruction
+ );
+
+/**
+ Update an ARM MOVT or MOVW immediate instruction immediate data.
+
+ @param Instruction Pointer to ARM MOVT or MOVW immediate instruction
+ @param Address New addres to patch into the instruction
+
+**/
+VOID
+ThumbMovtImmediatePatch (
+ IN OUT UINT16 *Instruction,
+ IN UINT16 Address
+ );
+
+
+
#endif
Modified: trunk/BaseTools/Source/C/Common/PeCoffLoaderEx.c
===================================================================
--- trunk/BaseTools/Source/C/Common/PeCoffLoaderEx.c 2010-03-23 09:18:48 UTC (rev 1940)
+++ trunk/BaseTools/Source/C/Common/PeCoffLoaderEx.c 2010-03-24 17:29:20 UTC (rev 1941)
@@ -315,3 +315,121 @@
return RETURN_SUCCESS;
}
+/**
+ Pass in a pointer to an ARM MOVT or MOVW immediate instruciton and
+ return the immediate data encoded in the instruction
+
+ @param Instruction Pointer to ARM MOVT or MOVW immediate instruction
+
+ @return Immediate address encoded in the instruction
+
+**/
+UINT16
+ThumbMovtImmediateAddress (
+ IN UINT16 *Instruction
+ )
+{
+ UINT32 Movt;
+ UINT16 Address;
+
+ // Thumb2 is two 16-bit instructions working together. Not a single 32-bit instruction
+ // Example MOVT R0, #0 is 0x0000f2c0 or 0xf2c0 0x0000
+ Movt = (*Instruction << 16) | (*(Instruction + 1));
+
+ // imm16 = imm4:i:imm3:imm8
+ // imm4 -> Bit19:Bit16
+ // i -> Bit26
+ // imm3 -> Bit14:Bit12
+ // imm8 -> Bit7:Bit0
+ Address = (UINT16)(Movt & 0x000000ff); // imm8
+ Address |= (UINT16)((Movt >> 4) & 0x0000f700); // imm4 imm3
+ Address |= (((Movt & BIT26) != 0) ? BIT11 : 0); // i
+ return Address;
+}
+
+
+/**
+ Update an ARM MOVT or MOVW immediate instruction immediate data.
+
+ @param Instruction Pointer to ARM MOVT or MOVW immediate instruction
+ @param Address New addres to patch into the instruction
+**/
+VOID
+ThumbMovtImmediatePatch (
+ IN OUT UINT16 *Instruction,
+ IN UINT16 Address
+ )
+{
+ UINT16 Patch;
+
+ // First 16-bit chunk of instruciton
+ Patch = ((Address >> 12) & 0x000f); // imm4
+ Patch |= (((Address & BIT11) != 0) ? BIT10 : 0); // i
+ *Instruction = (*Instruction & ~0x040f) | Patch;
+
+ // Second 16-bit chunk of instruction
+ Patch = Address & 0x000000ff; // imm8
+ Patch |= ((Address << 4) & 0x00007000); // imm3
+ Instruction++;
+ *Instruction = (*Instruction & ~0x70ff) | Patch;
+}
+
+/**
+ Performs an ARM-based specific relocation fixup and is a no-op on other
+ instruction sets.
+
+ @param Reloc Pointer to the relocation record.
+ @param Fixup Pointer to the address to fix up.
+ @param FixupData Pointer to a buffer to log the fixups.
+ @param Adjust The offset to adjust the fixup.
+
+ @return Status code.
+
+**/
+RETURN_STATUS
+PeCoffLoaderRelocateArmImage (
+ IN UINT16 **Reloc,
+ IN OUT CHAR8 *Fixup,
+ IN OUT CHAR8 **FixupData,
+ IN UINT64 Adjust
+ )
+{
+ UINT16 *Fixup16;
+ UINT16 FixupVal;
+ UINT16 *Addend;
+
+ Fixup16 = (UINT16 *) Fixup;
+
+ switch ((**Reloc) >> 12) {
+ case EFI_IMAGE_REL_BASED_ARM_THUMB_MOVW:
+ FixupVal = ThumbMovtImmediateAddress (Fixup16) + (UINT16)Adjust;
+ ThumbMovtImmediatePatch (Fixup16, FixupVal);
+
+ if (*FixupData != NULL) {
+ *FixupData = ALIGN_POINTER (*FixupData, sizeof (UINT16));
+ *(UINT16 *)*FixupData = *Fixup16;
+ *FixupData = *FixupData + sizeof (UINT16);
+ }
+ break;
+
+ case EFI_IMAGE_REL_BASED_ARM_THUMB_MOVT:
+ // For MOVT you need to know the lower 16-bits do do the math
+ // So this relocation entry is really two entries.
+ *Reloc = *Reloc + 1;
+ Addend = *Reloc;
+ FixupVal = (UINT16)(((ThumbMovtImmediateAddress (Fixup16) << 16) + Adjust + *Addend) >> 16);
+ ThumbMovtImmediatePatch (Fixup16, FixupVal);
+
+ if (*FixupData != NULL) {
+ *FixupData = ALIGN_POINTER (*FixupData, sizeof (UINT16));
+ *(UINT16 *)*FixupData = *Fixup16;
+ *FixupData = *FixupData + sizeof (UINT16);
+ }
+ break;
+
+ default:
+ return RETURN_UNSUPPORTED;
+ }
+
+ return RETURN_SUCCESS;
+}
Modified: trunk/BaseTools/Source/C/GenFw/GenFw.c
===================================================================
--- trunk/BaseTools/Source/C/GenFw/GenFw.c 2010-03-23 09:18:48 UTC (rev 1940)
+++ trunk/BaseTools/Source/C/GenFw/GenFw.c 2010-03-24 17:29:20 UTC (rev 1941)
@@ -988,8 +988,9 @@
//
for (Idx = 0; Idx < Ehdr->e_shnum; Idx++) {
Elf_Shdr *RelShdr = GetShdrByIndex(Idx);
- if (RelShdr->sh_type != SHT_REL)
+ if ((RelShdr->sh_type != SHT_REL) && (RelShdr->sh_type != SHT_RELA)) {
continue;
+ }
SecShdr = GetShdrByIndex(RelShdr->sh_info);
SecOffset = CoffSectionsOffset[RelShdr->sh_info];
if (RelShdr->sh_type == SHT_REL && (*Filter)(SecShdr)) {
@@ -1002,6 +1003,7 @@
Elf_Sym *Sym = (Elf_Sym *)(Symtab + ELF_R_SYM(Rel->r_info) * SymtabShdr->sh_entsize);
Elf_Shdr *SymShdr;
UINT8 *Targ;
+ UINT16 Address;
if (Sym->st_shndx == SHN_UNDEF
|| Sym->st_shndx == SHN_ABS
@@ -1040,16 +1042,31 @@
}
} else if (Ehdr->e_machine == EM_ARM) {
switch (ELF32_R_TYPE(Rel->r_info)) {
- case R_ARM_RBASE: // No relocation - no action required
+ case R_ARM_RBASE:
+ // No relocation - no action required
- // Thease are all PC-relative relocations and don't require modification
case R_ARM_PC24:
case R_ARM_XPC25:
case R_ARM_THM_PC22:
case R_ARM_THM_JUMP19:
case R_ARM_CALL:
+ case R_ARM_JMP24:
+ // Thease are all PC-relative relocations and don't require modification
+ // GCC does not seem to have the concept of a application that just needs to get relocated.
break;
+
+ case R_ARM_THM_MOVW_ABS_NC:
+ // MOVW is only lower 16-bits of the addres
+ Address = (UINT16)(Sym->st_value - SymShdr->sh_addr + CoffSectionsOffset[Sym->st_shndx]);
+ ThumbMovtImmediatePatch ((UINT16 *)Targ, Address);
+ break;
+ case R_ARM_THM_MOVT_ABS:
+ // MOVT is only upper 16-bits of the addres
+ Address = (UINT16)((Sym->st_value - SymShdr->sh_addr + CoffSectionsOffset[Sym->st_shndx]) >> 16);
+ ThumbMovtImmediatePatch ((UINT16 *)Targ, Address);
+ break;
+
case R_ARM_ABS32:
case R_ARM_RABS32:
//
@@ -1057,6 +1074,7 @@
//
*(UINT32 *)Targ = *(UINT32 *)Targ - SymShdr->sh_addr + CoffSectionsOffset[Sym->st_shndx];
break;
+
default:
Error (NULL, 0, 3000, "Invalid", "WriteSections (): %s unsupported ELF EM_ARM relocation 0x%x.", mInImageName, (unsigned) ELF32_R_TYPE(Rel->r_info));
}
@@ -1149,17 +1167,27 @@
UINT8 *Targ;
Elf32_Phdr *DynamicSegment;
Elf32_Phdr *TargetSegment;
+ Elf_Sym *Sym;
+ Elf_Shdr *SymtabShdr;
+ UINT8 *Symtab;
+
for (Index = 0, FoundRelocations = FALSE; Index < Ehdr->e_shnum; Index++) {
Elf_Shdr *RelShdr = GetShdrByIndex(Index);
- if (RelShdr->sh_type == SHT_REL) {
- Elf_Shdr *SecShdr = GetShdrByIndex(RelShdr->sh_info);
+ if ((RelShdr->sh_type == SHT_REL) || (RelShdr->sh_type == SHT_RELA)) {
+ Elf_Shdr *SecShdr = GetShdrByIndex (RelShdr->sh_info);
if (IsTextShdr(SecShdr) || IsDataShdr(SecShdr)) {
UINT32 RelIdx;
+
+ SymtabShdr = GetShdrByIndex (RelShdr->sh_link);
+ Symtab = (UINT8*)Ehdr + SymtabShdr->sh_offset;
FoundRelocations = TRUE;
for (RelIdx = 0; RelIdx < RelShdr->sh_size; RelIdx += RelShdr->sh_entsize) {
- Elf_Rel *Rel = (Elf_Rel *)
- ((UINT8*)Ehdr + RelShdr->sh_offset + RelIdx);
+ Elf_Rel *Rel = (Elf_Rel *)((UINT8*)Ehdr + RelShdr->sh_offset + RelIdx);
+ Elf_Shdr *SymShdr;
+
+ Sym = (Elf_Sym *)(Symtab + ELF_R_SYM(Rel->r_info) * SymtabShdr->sh_entsize);
+ SymShdr = GetShdrByIndex (Sym->st_shndx);
if (Ehdr->e_machine == EM_386) {
switch (ELF_R_TYPE(Rel->r_info)) {
@@ -1176,15 +1204,36 @@
}
} else if (Ehdr->e_machine == EM_ARM) {
switch (ELF32_R_TYPE(Rel->r_info)) {
- case R_ARM_RBASE: // No relocation - no action required
-
- // Thease are all PC-relative relocations and don't require modification
+ case R_ARM_RBASE:
+ // No relocation - no action required
case R_ARM_PC24:
case R_ARM_XPC25:
case R_ARM_THM_PC22:
case R_ARM_THM_JUMP19:
case R_ARM_CALL:
+ case R_ARM_JMP24:
+ // Thease are all PC-relative relocations and don't require modification
break;
+
+ case R_ARM_THM_MOVW_ABS_NC:
+ CoffAddFixup (
+ CoffSectionsOffset[RelShdr->sh_info]
+ + (Rel->r_offset - SecShdr->sh_addr),
+ EFI_IMAGE_REL_BASED_ARM_THUMB_MOVW
+ );
+ break;
+
+ case R_ARM_THM_MOVT_ABS:
+ CoffAddFixup (
+ CoffSectionsOffset[RelShdr->sh_info]
+ + (Rel->r_offset - SecShdr->sh_addr),
+ EFI_IMAGE_REL_BASED_ARM_THUMB_MOVT
+ );
+
+ // The relocation entry needs to contain the lower 16-bits so we can do math
+ CoffAddFixupEntry ((UINT16)(Sym->st_value - SymShdr->sh_addr + CoffSectionsOffset[Sym->st_shndx]));
+ break;
+
case R_ARM_ABS32:
case R_ARM_RABS32:
CoffAddFixup (
@@ -1241,6 +1290,7 @@
Error (NULL, 0, 3000, "Invalid", "%s bad ARM dynamic relocations.", mInImageName);
}
+
for (K = 0; K < RelSize; K += RelElementSize) {
if (DynamicSegment->p_paddr == 0) {
@@ -1254,6 +1304,7 @@
switch (ELF32_R_TYPE (Rel->r_info)) {
case R_ARM_RBASE:
break;
+
case R_ARM_RABS32:
TargetSegment = GetPhdrByIndex (ELF32_R_SYM (Rel->r_info) - 1);
@@ -1264,6 +1315,7 @@
CoffAddFixup (CoffSectionsOffset[ELF32_R_SYM (Rel->r_info)] + (Rel->r_offset - TargetSegment->p_vaddr), EFI_IMAGE_REL_BASED_HIGHLOW);
break;
+
default:
Error (NULL, 0, 3000, "Invalid", "%s bad ARM dynamic relocations, unkown type %d.", mInImageName, ELF32_R_TYPE (Rel->r_info));
break;
Modified: trunk/BaseTools/Source/C/GenFw/elf_common.h
===================================================================
--- trunk/BaseTools/Source/C/GenFw/elf_common.h 2010-03-23 09:18:48 UTC (rev 1940)
+++ trunk/BaseTools/Source/C/GenFw/elf_common.h 2010-03-24 17:29:20 UTC (rev 1941)
@@ -597,7 +597,11 @@
#define R_ARM_GOTPC 25 /* Add PC-relative GOT table address. */
#define R_ARM_GOT32 26 /* Add PC-relative GOT offset. */
#define R_ARM_PLT32 27 /* Add PC-relative PLT offset. */
-#define R_ARM_CALL 28
+#define R_ARM_CALL 28
+#define R_ARM_JMP24 29
+#define R_ARM_THM_MOVW_ABS_NC 47
+#define R_ARM_THM_MOVT_ABS 48
+
#define R_ARM_THM_JUMP19 51
#define R_ARM_GNU_VTENTRY 100
#define R_ARM_GNU_VTINHERIT 101
Modified: trunk/BaseTools/Source/C/Include/Common/BaseTypes.h
===================================================================
--- trunk/BaseTools/Source/C/Include/Common/BaseTypes.h 2010-03-23 09:18:48 UTC (rev 1940)
+++ trunk/BaseTools/Source/C/Include/Common/BaseTypes.h 2010-03-24 17:29:20 UTC (rev 1941)
@@ -220,4 +220,69 @@
typedef UINT64 PHYSICAL_ADDRESS;
+#define BIT0 0x00000001
+#define BIT1 0x00000002
+#define BIT2 0x00000004
+#define BIT3 0x00000008
+#define BIT4 0x00000010
+#define BIT5 0x00000020
+#define BIT6 0x00000040
+#define BIT7 0x00000080
+#define BIT8 0x00000100
+#define BIT9 0x00000200
+#define BIT10 0x00000400
+#define BIT11 0x00000800
+#define BIT12 0x00001000
+#define BIT13 0x00002000
+#define BIT14 0x00004000
+#define BIT15 0x00008000
+#define BIT16 0x00010000
+#define BIT17 0x00020000
+#define BIT18 0x00040000
+#define BIT19 0x00080000
+#define BIT20 0x00100000
+#define BIT21 0x00200000
+#define BIT22 0x00400000
+#define BIT23 0x00800000
+#define BIT24 0x01000000
+#define BIT25 0x02000000
+#define BIT26 0x04000000
+#define BIT27 0x08000000
+#define BIT28 0x10000000
+#define BIT29 0x20000000
+#define BIT30 0x40000000
+#define BIT31 0x80000000
+#define BIT32 0x0000000100000000ULL
+#define BIT33 0x0000000200000000ULL
+#define BIT34 0x0000000400000000ULL
+#define BIT35 0x0000000800000000ULL
+#define BIT36 0x0000001000000000ULL
+#define BIT37 0x0000002000000000ULL
+#define BIT38 0x0000004000000000ULL
+#define BIT39 0x0000008000000000ULL
+#define BIT40 0x0000010000000000ULL
+#define BIT41 0x0000020000000000ULL
+#define BIT42 0x0000040000000000ULL
+#define BIT43 0x0000080000000000ULL
+#define BIT44 0x0000100000000000ULL
+#define BIT45 0x0000200000000000ULL
+#define BIT46 0x0000400000000000ULL
+#define BIT47 0x0000800000000000ULL
+#define BIT48 0x0001000000000000ULL
+#define BIT49 0x0002000000000000ULL
+#define BIT50 0x0004000000000000ULL
+#define BIT51 0x0008000000000000ULL
+#define BIT52 0x0010000000000000ULL
+#define BIT53 0x0020000000000000ULL
+#define BIT54 0x0040000000000000ULL
+#define BIT55 0x0080000000000000ULL
+#define BIT56 0x0100000000000000ULL
+#define BIT57 0x0200000000000000ULL
+#define BIT58 0x0400000000000000ULL
+#define BIT59 0x0800000000000000ULL
+#define BIT60 0x1000000000000000ULL
+#define BIT61 0x2000000000000000ULL
+#define BIT62 0x4000000000000000ULL
+#define BIT63 0x8000000000000000ULL
+
#endif
Modified: trunk/BaseTools/Source/C/Include/IndustryStandard/PeImage.h
===================================================================
--- trunk/BaseTools/Source/C/Include/IndustryStandard/PeImage.h 2010-03-23 09:18:48 UTC (rev 1940)
+++ trunk/BaseTools/Source/C/Include/IndustryStandard/PeImage.h 2010-03-24 17:29:20 UTC (rev 1941)
@@ -513,6 +513,9 @@
#define EFI_IMAGE_REL_BASED_IA64_IMM64 9
#define EFI_IMAGE_REL_BASED_DIR64 10
+#define EFI_IMAGE_REL_BASED_ARM_THUMB_MOVW 11
+#define EFI_IMAGE_REL_BASED_ARM_THUMB_MOVT 12
+
///
/// Line number format.
///
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2010-12-21 20:38:17
|
Revision: 2104
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2104&view=rev
Author: andrewfish
Date: 2010-12-21 20:38:10 +0000 (Tue, 21 Dec 2010)
Log Message:
-----------
Update tools to follow latest PE/COFF specification in reguards to ARM MOVW/MOVT relocations that were added in the latest specification. Previous implementation was a guess on how it may be implemented, so it was removed.
Modified Paths:
--------------
trunk/BaseTools/Source/C/Common/PeCoffLib.h
trunk/BaseTools/Source/C/Common/PeCoffLoaderEx.c
trunk/BaseTools/Source/C/GenFw/Elf32Convert.c
trunk/BaseTools/Source/C/Include/IndustryStandard/PeImage.h
Modified: trunk/BaseTools/Source/C/Common/PeCoffLib.h
===================================================================
--- trunk/BaseTools/Source/C/Common/PeCoffLib.h 2010-12-15 00:54:06 UTC (rev 2103)
+++ trunk/BaseTools/Source/C/Common/PeCoffLib.h 2010-12-21 20:38:10 UTC (rev 2104)
@@ -159,6 +159,7 @@
**/
UINT16
+EFIAPI
ThumbMovtImmediateAddress (
IN UINT16 *Instruction
);
@@ -171,11 +172,41 @@
**/
VOID
+EFIAPI
ThumbMovtImmediatePatch (
IN OUT UINT16 *Instruction,
IN UINT16 Address
);
+/**
+ Pass in a pointer to an ARM MOVW/MOVT instruciton pair and
+ return the immediate data encoded in the two` instruction
+ @param Instructions Pointer to ARM MOVW/MOVT insturction pair
+
+ @return Immediate address encoded in the instructions
+
+**/
+UINT32
+EFIAPI
+ThumbMovwMovtImmediateAddress (
+ IN UINT16 *Instructions
+ );
+
+/**
+ Update an ARM MOVW/MOVT immediate instruction instruction pair.
+
+ @param Instructions Pointer to ARM MOVW/MOVT instruction pair
+ @param Address New addres to patch into the instructions
+**/
+VOID
+EFIAPI
+ThumbMovwMovtImmediatePatch (
+ IN OUT UINT16 *Instructions,
+ IN UINT32 Address
+ );
+
+
+
#endif
Modified: trunk/BaseTools/Source/C/Common/PeCoffLoaderEx.c
===================================================================
--- trunk/BaseTools/Source/C/Common/PeCoffLoaderEx.c 2010-12-15 00:54:06 UTC (rev 2103)
+++ trunk/BaseTools/Source/C/Common/PeCoffLoaderEx.c 2010-12-21 20:38:10 UTC (rev 2104)
@@ -24,7 +24,9 @@
#include <Common/UefiBaseTypes.h>
#include <IndustryStandard/PeImage.h>
#include "PeCoffLib.h"
+#include "CommonLib.h"
+
#define EXT_IMM64(Value, Address, Size, InstPos, ValPos) \
Value |= (((UINT64)((*(Address) >> InstPos) & (((UINT64)1 << Size) - 1))) << ValPos)
@@ -375,6 +377,55 @@
}
/**
+ Pass in a pointer to an ARM MOVW/MOVT instruciton pair and
+ return the immediate data encoded in the two` instruction
+
+ @param Instructions Pointer to ARM MOVW/MOVT insturction pair
+
+ @return Immediate address encoded in the instructions
+
+**/
+UINT32
+EFIAPI
+ThumbMovwMovtImmediateAddress (
+ IN UINT16 *Instructions
+ )
+{
+ UINT16 *Word;
+ UINT16 *Top;
+
+ Word = Instructions; // MOVW
+ Top = Word + 2; // MOVT
+
+ return (ThumbMovtImmediateAddress (Top) << 16) + ThumbMovtImmediateAddress (Word);
+}
+
+
+/**
+ Update an ARM MOVW/MOVT immediate instruction instruction pair.
+
+ @param Instructions Pointer to ARM MOVW/MOVT instruction pair
+ @param Address New addres to patch into the instructions
+**/
+VOID
+EFIAPI
+ThumbMovwMovtImmediatePatch (
+ IN OUT UINT16 *Instructions,
+ IN UINT32 Address
+ )
+{
+ UINT16 *Word;
+ UINT16 *Top;
+
+ Word = (UINT16 *)Instructions; // MOVW
+ Top = Word + 2; // MOVT
+
+ ThumbMovtImmediatePatch (Word, (UINT16)(Address & 0xffff));
+ ThumbMovtImmediatePatch (Top, (UINT16)(Address >> 16));
+}
+
+
+/**
Performs an ARM-based specific relocation fixup and is a no-op on other
instruction sets.
@@ -395,38 +446,26 @@
)
{
UINT16 *Fixup16;
- UINT16 FixupVal;
- UINT16 *Addend;
+ UINT32 FixupVal;
- Fixup16 = (UINT16 *) Fixup;
+ Fixup16 = (UINT16 *) Fixup;
switch ((**Reloc) >> 12) {
- case EFI_IMAGE_REL_BASED_ARM_THUMB_MOVW:
- FixupVal = ThumbMovtImmediateAddress (Fixup16) + (UINT16)Adjust;
- ThumbMovtImmediatePatch (Fixup16, FixupVal);
-
+
+ case EFI_IMAGE_REL_BASED_ARM_MOV32T:
+ FixupVal = ThumbMovwMovtImmediateAddress (Fixup16) + (UINT32)Adjust;
+ ThumbMovwMovtImmediatePatch (Fixup16, FixupVal);
+
+
if (*FixupData != NULL) {
- *FixupData = ALIGN_POINTER (*FixupData, sizeof (UINT16));
- *(UINT16 *)*FixupData = *Fixup16;
- *FixupData = *FixupData + sizeof (UINT16);
+ *FixupData = ALIGN_POINTER(*FixupData, sizeof(UINT64));
+ *(UINT64 *)(*FixupData) = *Fixup16;
+ CopyMem (*FixupData, Fixup16, sizeof (UINT64));
}
break;
-
- case EFI_IMAGE_REL_BASED_ARM_THUMB_MOVT:
- // For MOVT you need to know the lower 16-bits do do the math
- // So this relocation entry is really two entries.
- *Reloc = *Reloc + 1;
- Addend = *Reloc;
- FixupVal = (UINT16)(((ThumbMovtImmediateAddress (Fixup16) << 16) + Adjust + *Addend) >> 16);
- ThumbMovtImmediatePatch (Fixup16, FixupVal);
-
- if (*FixupData != NULL) {
- *FixupData = ALIGN_POINTER (*FixupData, sizeof (UINT16));
- *(UINT16 *)*FixupData = *Fixup16;
- *FixupData = *FixupData + sizeof (UINT16);
- }
- break;
+ case EFI_IMAGE_REL_BASED_ARM_MOV32A:
+ // break omitted - ARM instruction encoding not implemented
default:
return RETURN_UNSUPPORTED;
}
Modified: trunk/BaseTools/Source/C/GenFw/Elf32Convert.c
===================================================================
--- trunk/BaseTools/Source/C/GenFw/Elf32Convert.c 2010-12-15 00:54:06 UTC (rev 2103)
+++ trunk/BaseTools/Source/C/GenFw/Elf32Convert.c 2010-12-21 20:38:10 UTC (rev 2104)
@@ -650,18 +650,18 @@
case R_ARM_THM_ALU_PREL_11_0:
case R_ARM_THM_PC12:
case R_ARM_REL32_NOI:
- case R_ARM_ALU_PC_G0_NC:
- case R_ARM_ALU_PC_G0:
- case R_ARM_ALU_PC_G1_NC:
- case R_ARM_ALU_PC_G1:
- case R_ARM_ALU_PC_G2:
- case R_ARM_LDR_PC_G1:
- case R_ARM_LDR_PC_G2:
- case R_ARM_LDRS_PC_G0:
- case R_ARM_LDRS_PC_G1:
- case R_ARM_LDRS_PC_G2:
- case R_ARM_LDC_PC_G0:
- case R_ARM_LDC_PC_G1:
+ case R_ARM_ALU_PC_G0_NC:
+ case R_ARM_ALU_PC_G0:
+ case R_ARM_ALU_PC_G1_NC:
+ case R_ARM_ALU_PC_G1:
+ case R_ARM_ALU_PC_G2:
+ case R_ARM_LDR_PC_G1:
+ case R_ARM_LDR_PC_G2:
+ case R_ARM_LDRS_PC_G0:
+ case R_ARM_LDRS_PC_G1:
+ case R_ARM_LDRS_PC_G2:
+ case R_ARM_LDC_PC_G0:
+ case R_ARM_LDC_PC_G1:
case R_ARM_LDC_PC_G2:
case R_ARM_GOT_PREL:
case R_ARM_THM_JUMP11:
@@ -704,6 +704,8 @@
return TRUE;
}
+UINTN gMovwOffset = 0;
+
STATIC
VOID
WriteRelocations32 (
@@ -786,18 +788,18 @@
case R_ARM_THM_ALU_PREL_11_0:
case R_ARM_THM_PC12:
case R_ARM_REL32_NOI:
- case R_ARM_ALU_PC_G0_NC:
- case R_ARM_ALU_PC_G0:
- case R_ARM_ALU_PC_G1_NC:
- case R_ARM_ALU_PC_G1:
- case R_ARM_ALU_PC_G2:
- case R_ARM_LDR_PC_G1:
- case R_ARM_LDR_PC_G2:
- case R_ARM_LDRS_PC_G0:
- case R_ARM_LDRS_PC_G1:
- case R_ARM_LDRS_PC_G2:
- case R_ARM_LDC_PC_G0:
- case R_ARM_LDC_PC_G1:
+ case R_ARM_ALU_PC_G0_NC:
+ case R_ARM_ALU_PC_G0:
+ case R_ARM_ALU_PC_G1_NC:
+ case R_ARM_ALU_PC_G1:
+ case R_ARM_ALU_PC_G2:
+ case R_ARM_LDR_PC_G1:
+ case R_ARM_LDR_PC_G2:
+ case R_ARM_LDRS_PC_G0:
+ case R_ARM_LDRS_PC_G1:
+ case R_ARM_LDRS_PC_G2:
+ case R_ARM_LDC_PC_G0:
+ case R_ARM_LDC_PC_G1:
case R_ARM_LDC_PC_G2:
case R_ARM_GOT_PREL:
case R_ARM_THM_JUMP11:
@@ -812,19 +814,18 @@
CoffAddFixup (
mCoffSectionsOffset[RelShdr->sh_info]
+ (Rel->r_offset - SecShdr->sh_addr),
- EFI_IMAGE_REL_BASED_ARM_THUMB_MOVW
+ EFI_IMAGE_REL_BASED_ARM_MOV32T
);
+
+ // PE/COFF treats MOVW/MOVT relocation as single 64-bit instruction
+ // Track this address so we can log an error for unsupported sequence of MOVW/MOVT
+ gMovwOffset = mCoffSectionsOffset[RelShdr->sh_info] + (Rel->r_offset - SecShdr->sh_addr);
break;
case R_ARM_THM_MOVT_ABS:
- CoffAddFixup (
- mCoffSectionsOffset[RelShdr->sh_info]
- + (Rel->r_offset - SecShdr->sh_addr),
- EFI_IMAGE_REL_BASED_ARM_THUMB_MOVT
- );
-
- // The relocation entry needs to contain the lower 16-bits so we can do math
- CoffAddFixupEntry ((UINT16)(Sym->st_value - SymShdr->sh_addr + mCoffSectionsOffset[Sym->st_shndx]));
+ if ((gMovwOffset + 4) != (mCoffSectionsOffset[RelShdr->sh_info] + (Rel->r_offset - SecShdr->sh_addr))) {
+ Error (NULL, 0, 3000, "Not Supported", "PE/COFF requires MOVW+MOVT instruction sequence %x +4 != %x.", gMovwOffset, mCoffSectionsOffset[RelShdr->sh_info] + (Rel->r_offset - SecShdr->sh_addr));
+ }
break;
case R_ARM_ABS32:
Modified: trunk/BaseTools/Source/C/Include/IndustryStandard/PeImage.h
===================================================================
--- trunk/BaseTools/Source/C/Include/IndustryStandard/PeImage.h 2010-12-15 00:54:06 UTC (rev 2103)
+++ trunk/BaseTools/Source/C/Include/IndustryStandard/PeImage.h 2010-12-21 20:38:10 UTC (rev 2104)
@@ -516,8 +516,6 @@
#define EFI_IMAGE_REL_BASED_IA64_IMM64 9
#define EFI_IMAGE_REL_BASED_DIR64 10
-#define EFI_IMAGE_REL_BASED_ARM_THUMB_MOVW 11
-#define EFI_IMAGE_REL_BASED_ARM_THUMB_MOVT 12
///
/// Line number format.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yd...@us...> - 2011-06-09 10:45:54
|
Revision: 2167
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2167&view=rev
Author: ydong10
Date: 2011-06-09 10:45:48 +0000 (Thu, 09 Jun 2011)
Log Message:
-----------
Add new "Modal form" opcode
Signed-off-by: ydong10
Reviewed-by: lgao4
Modified Paths:
--------------
trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
Modified: trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
===================================================================
--- trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h 2011-06-06 20:22:16 UTC (rev 2166)
+++ trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h 2011-06-09 10:45:48 UTC (rev 2167)
@@ -681,6 +681,7 @@
#define EFI_IFR_CATENATE_OP 0x5E
#define EFI_IFR_GUID_OP 0x5F
#define EFI_IFR_SECURITY_OP 0x60
+#define EFI_IFR_MODAL_TAG_OP 0x61
typedef struct _EFI_IFR_OP_HEADER {
@@ -771,6 +772,10 @@
EFI_IMAGE_ID Id;
} EFI_IFR_IMAGE;
+typedef struct _EFI_IFR_MODAL {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_MODAL;
+
typedef struct _EFI_IFR_LOCKED {
EFI_IFR_OP_HEADER Header;
} EFI_IFR_LOCKED;
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp 2011-06-06 20:22:16 UTC (rev 2166)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp 2011-06-09 10:45:48 UTC (rev 2167)
@@ -1305,6 +1305,7 @@
{ sizeof (EFI_IFR_CATENATE), 0 }, // EFI_IFR_CATENATE_OP
{ sizeof (EFI_IFR_GUID), 0 }, // EFI_IFR_GUID_OP
{ sizeof (EFI_IFR_SECURITY), 0 }, // EFI_IFR_SECURITY_OP - 0x60
+ { sizeof (EFI_IFR_MODAL), 0}, // EFI_IFR_MODAL_OP - 0x61
};
#ifdef CIFROBJ_DEUBG
@@ -1327,7 +1328,7 @@
"EFI_IFR_STRING_REF1","EFI_IFR_STRING_REF2", "EFI_IFR_CONDITIONAL", "EFI_IFR_QUESTION_REF3", "EFI_IFR_ZERO", "EFI_IFR_ONE",
"EFI_IFR_ONES", "EFI_IFR_UNDEFINED", "EFI_IFR_LENGTH", "EFI_IFR_DUP", "EFI_IFR_THIS", "EFI_IFR_SPAN",
"EFI_IFR_VALUE", "EFI_IFR_DEFAULT", "EFI_IFR_DEFAULTSTORE", "EFI_IFR_FORM_MAP", "EFI_IFR_CATENATE", "EFI_IFR_GUID",
- "EFI_IFR_SECURITY",
+ "EFI_IFR_SECURITY", "EFI_IFR_MODAL",
};
VOID
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2011-06-06 20:22:16 UTC (rev 2166)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2011-06-09 10:45:48 UTC (rev 2167)
@@ -809,6 +809,17 @@
}
};
+class CIfrModal : public CIfrObj, public CIfrOpHeader {
+private:
+ EFI_IFR_MODAL *mModal;
+
+public:
+ CIfrModal () : CIfrObj (EFI_IFR_MODAL_TAG_OP, (CHAR8 **)&mModal),
+ CIfrOpHeader (EFI_IFR_MODAL_TAG_OP, &mModal->Header) {
+ }
+};
+
+
class CIfrLocked : public CIfrObj, public CIfrOpHeader {
private:
EFI_IFR_LOCKED *mLocked;
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2011-06-06 20:22:16 UTC (rev 2166)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2011-06-09 10:45:48 UTC (rev 2167)
@@ -237,6 +237,7 @@
#token EndGuidOp("endguidop") "endguidop"
#token DataType("datatype") "datatype"
#token Data("data") "data"
+#token Modal("modal") "modal"
//
// Define the class and subclass tokens
@@ -1251,7 +1252,8 @@
vfrStatementBanner |
// Just for framework vfr compatibility
vfrStatementInvalid |
- vfrStatementExtension
+ vfrStatementExtension |
+ vfrStatementModal
)*
E:EndForm <<
if (mCompatibleMode) {
@@ -1310,7 +1312,8 @@
vfrStatementConditional |
vfrStatementLabel |
vfrStatementBanner |
- vfrStatementExtension
+ vfrStatementExtension |
+ vfrStatementModal
)*
E:EndForm << CRT_END_OP (E); >>
";"
@@ -2490,6 +2493,11 @@
L:Locked << LObj.SetLineNo(L->getLine()); >>
;
+vfrModalTag :
+ << CIfrModal MObj; >>
+ L:Modal << MObj.SetLineNo(L->getLine()); >>
+ ;
+
vfrStatementStatTag :
vfrImageTag |
vfrLockedTag
@@ -2504,6 +2512,11 @@
";"
;
+vfrStatementModal :
+ vfrModalTag
+ ";"
+ ;
+
vfrStatementLocked :
vfrLockedTag
";"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yd...@us...> - 2011-06-09 10:59:52
|
Revision: 2169
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2169&view=rev
Author: ydong10
Date: 2011-06-09 10:59:46 +0000 (Thu, 09 Jun 2011)
Log Message:
-----------
Add new "Refresh Event Group" opcode
Signed-off-by: ydong10
Reviewed-by: lgao4
Modified Paths:
--------------
trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
Modified: trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
===================================================================
--- trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h 2011-06-09 10:49:32 UTC (rev 2168)
+++ trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h 2011-06-09 10:59:46 UTC (rev 2169)
@@ -682,6 +682,7 @@
#define EFI_IFR_GUID_OP 0x5F
#define EFI_IFR_SECURITY_OP 0x60
#define EFI_IFR_MODAL_TAG_OP 0x61
+#define EFI_IFR_REFRESH_ID_OP 0x62
typedef struct _EFI_IFR_OP_HEADER {
@@ -998,6 +999,11 @@
UINT8 RefreshInterval;
} EFI_IFR_REFRESH;
+typedef struct _EFI_IFR_REFRESH_ID {
+ EFI_IFR_OP_HEADER Header;
+ EFI_GUID RefreshEventGroupId;
+} EFI_IFR_REFRESH_ID;
+
typedef struct _EFI_IFR_VARSTORE_DEVICE {
EFI_IFR_OP_HEADER Header;
EFI_STRING_ID DevicePath;
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp 2011-06-09 10:49:32 UTC (rev 2168)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp 2011-06-09 10:59:46 UTC (rev 2169)
@@ -1306,6 +1306,7 @@
{ sizeof (EFI_IFR_GUID), 0 }, // EFI_IFR_GUID_OP
{ sizeof (EFI_IFR_SECURITY), 0 }, // EFI_IFR_SECURITY_OP - 0x60
{ sizeof (EFI_IFR_MODAL), 0}, // EFI_IFR_MODAL_OP - 0x61
+ { sizeof (EFI_IFR_REFRESH_ID), 0}, // EFI_IFR_REFRESH_ID_OP - 0x62
};
#ifdef CIFROBJ_DEUBG
@@ -1328,7 +1329,7 @@
"EFI_IFR_STRING_REF1","EFI_IFR_STRING_REF2", "EFI_IFR_CONDITIONAL", "EFI_IFR_QUESTION_REF3", "EFI_IFR_ZERO", "EFI_IFR_ONE",
"EFI_IFR_ONES", "EFI_IFR_UNDEFINED", "EFI_IFR_LENGTH", "EFI_IFR_DUP", "EFI_IFR_THIS", "EFI_IFR_SPAN",
"EFI_IFR_VALUE", "EFI_IFR_DEFAULT", "EFI_IFR_DEFAULTSTORE", "EFI_IFR_FORM_MAP", "EFI_IFR_CATENATE", "EFI_IFR_GUID",
- "EFI_IFR_SECURITY", "EFI_IFR_MODAL",
+ "EFI_IFR_SECURITY", "EFI_IFR_MODAL", "EFI_IFR_REFRESH_ID",
};
VOID
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2011-06-09 10:49:32 UTC (rev 2168)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2011-06-09 10:59:46 UTC (rev 2169)
@@ -1492,6 +1492,21 @@
}
};
+class CIfrRefreshId : public CIfrObj, public CIfrOpHeader {
+private:
+ EFI_IFR_REFRESH_ID *mRefreshId;
+
+public:
+ CIfrRefreshId () : CIfrObj (EFI_IFR_REFRESH_ID_OP, (CHAR8 **)&mRefreshId),
+ CIfrOpHeader (EFI_IFR_REFRESH_ID_OP, &mRefreshId->Header) {
+ memset (&mRefreshId->RefreshEventGroupId, 0, sizeof (EFI_GUID));
+ }
+
+ VOID SetRefreshEventGroutId (IN EFI_GUID *RefreshEventGroupId) {
+ memcpy (&mRefreshId->RefreshEventGroupId, RefreshEventGroupId, sizeof (EFI_GUID));
+ }
+};
+
class CIfrVarStoreDevice : public CIfrObj, public CIfrOpHeader {
private:
EFI_IFR_VARSTORE_DEVICE *mVarStoreDevice;
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2011-06-09 10:49:32 UTC (rev 2168)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2011-06-09 10:59:46 UTC (rev 2169)
@@ -2342,7 +2342,8 @@
vfrStatementDisableIfQuest |
vfrStatementRefresh |
vfrStatementVarstoreDevice |
- vfrStatementExtension
+ vfrStatementExtension |
+ vfrStatementRefreshEvent
;
vfrStatementQuestionTagList :
@@ -2556,6 +2557,15 @@
Interval "=" I:Number << RObj.SetRefreshInterval (_STOU8(I->getText())); >>
;
+vfrStatementRefreshEvent :
+ <<
+ CIfrRefreshId RiObj;
+ EFI_GUID Guid;
+ >>
+ L:RefreshGuid << RiObj.SetLineNo(L->getLine()); >>
+ "=" guidDefinition[Guid] "," << RiObj.SetRefreshEventGroutId (&Guid); >>
+ ;
+
vfrStatementVarstoreDevice :
<< CIfrVarStoreDevice VDObj; >>
L:VarstoreDevice << VDObj.SetLineNo(L->getLine()); >>
@@ -2824,6 +2834,7 @@
#token QuestionRefVal("questionrefval") "questionrefval"
#token StringRefVal("stringrefval") "stringrefval"
#token Map("map") "map"
+#token RefreshGuid("refreshguid") "refreshguid"
//
// Root expression extension function called by other function.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yd...@us...> - 2011-06-28 05:38:14
|
Revision: 2189
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2189&view=rev
Author: ydong10
Date: 2011-06-28 05:38:07 +0000 (Tue, 28 Jun 2011)
Log Message:
-----------
Add new "ref5" opcode.
Signed-off-by: ydong10
Reviewed-by: lgao4
Modified Paths:
--------------
trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
trunk/BaseTools/Source/C/VfrCompile/EfiVfr.h
trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
trunk/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
trunk/BaseTools/Source/C/VfrCompile/VfrUtilityLib.h
Modified: trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
===================================================================
--- trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h 2011-06-28 05:33:55 UTC (rev 2188)
+++ trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h 2011-06-28 05:38:07 UTC (rev 2189)
@@ -575,6 +575,13 @@
UINT8 Day;
} EFI_HII_DATE;
+typedef struct {
+ EFI_QUESTION_ID QuestionId;
+ EFI_FORM_ID FormId;
+ EFI_GUID FormSetGuid;
+ EFI_STRING_ID DevicePath;
+} EFI_HII_REF;
+
typedef union {
UINT8 u8;
UINT16 u16;
@@ -584,6 +591,7 @@
EFI_HII_TIME time;
EFI_HII_DATE date;
EFI_STRING_ID string;
+ EFI_HII_REF ref;
} EFI_IFR_TYPE_VALUE;
#define EFI_IFR_FORM_OP 0x01
@@ -850,6 +858,11 @@
EFI_STRING_ID DevicePath;
} EFI_IFR_REF4;
+typedef struct _EFI_IFR_REF5 {
+ EFI_IFR_OP_HEADER Header;
+ EFI_IFR_QUESTION_HEADER Question;
+} EFI_IFR_REF5;
+
typedef struct _EFI_IFR_RESET_BUTTON {
EFI_IFR_OP_HEADER Header;
EFI_IFR_STATEMENT_HEADER Statement;
@@ -1029,6 +1042,7 @@
#define EFI_IFR_TYPE_UNDEFINED 0x09
#define EFI_IFR_TYPE_ACTION 0x0A
#define EFI_IFR_TYPE_BUFFER 0x0B
+#define EFI_IFR_TYPE_REF 0x0C
#define EFI_IFR_OPTION_DEFAULT 0x10
#define EFI_IFR_OPTION_DEFAULT_MFG 0x20
Modified: trunk/BaseTools/Source/C/VfrCompile/EfiVfr.h
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/EfiVfr.h 2011-06-28 05:33:55 UTC (rev 2188)
+++ trunk/BaseTools/Source/C/VfrCompile/EfiVfr.h 2011-06-28 05:38:07 UTC (rev 2189)
@@ -43,6 +43,7 @@
QUESTION_NORMAL,
QUESTION_DATE,
QUESTION_TIME,
+ QUESTION_REF,
} EFI_QUESION_TYPE;
typedef enum {
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2011-06-28 05:33:55 UTC (rev 2188)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2011-06-28 05:38:07 UTC (rev 2189)
@@ -1054,8 +1054,8 @@
EFI_IFR_REF4 *mRef4;
public:
- CIfrRef4 () : CIfrObj (EFI_IFR_REF_OP, (CHAR8 **)&mRef4, sizeof(EFI_IFR_REF3)),
- CIfrOpHeader (EFI_IFR_REF_OP, &mRef4->Header, sizeof (EFI_IFR_REF3)),
+ CIfrRef4 () : CIfrObj (EFI_IFR_REF_OP, (CHAR8 **)&mRef4, sizeof(EFI_IFR_REF4)),
+ CIfrOpHeader (EFI_IFR_REF_OP, &mRef4->Header, sizeof(EFI_IFR_REF4)),
CIfrQuestionHeader (&mRef4->Question) {
mRef4->FormId = 0;
mRef4->QuestionId = EFI_QUESTION_ID_INVALID;
@@ -1080,6 +1080,17 @@
}
};
+class CIfrRef5 : public CIfrObj, public CIfrOpHeader, public CIfrQuestionHeader {
+private:
+ EFI_IFR_REF5 *mRef5;
+
+public:
+ CIfrRef5 () : CIfrObj (EFI_IFR_REF_OP, (CHAR8 **)&mRef5, sizeof (EFI_IFR_REF5)),
+ CIfrOpHeader (EFI_IFR_REF_OP, &mRef5->Header, sizeof (EFI_IFR_REF5)),
+ CIfrQuestionHeader (&mRef5->Question) {
+ }
+};
+
class CIfrResetButton : public CIfrObj, public CIfrOpHeader, public CIfrStatementHeader {
private:
EFI_IFR_RESET_BUTTON *mResetButton;
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2011-06-28 05:33:55 UTC (rev 2188)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2011-06-28 05:38:07 UTC (rev 2189)
@@ -341,6 +341,7 @@
dataStructFieldString |
dataStructFieldDate |
dataStructFieldTime |
+ dataStructFieldRef |
dataStructFieldUser
)*
;
@@ -427,6 +428,16 @@
";" << _PCATCH(gCVfrVarDataTypeDB.DataTypeAddField (N->getText(), D->getText(), ArrayNum), N); >>
;
+dataStructFieldRef :
+ << UINT32 ArrayNum = 0; >>
+ D:"EFI_HII_REF"
+ N:StringIdentifier
+ {
+ OpenBracket I:Number CloseBracket << ArrayNum = _STOU32(I->getText()); >>
+ }
+ ";" << _PCATCH(gCVfrVarDataTypeDB.DataTypeAddField (N->getText(), D->getText(), ArrayNum), N); >>
+ ;
+
dataStructFieldUser :
<< UINT32 ArrayNum = 0; >>
T:StringIdentifier
@@ -603,7 +614,9 @@
<< TypeName = D->getText(); LineNum = D->getLine(); IsStruct = TRUE;>>
| T:"EFI_HII_TIME" {OpenBracket AN8:Number CloseBracket <<ArrayNum = _STOU32(AN8->getText());>>}
<< TypeName = T->getText(); LineNum = T->getLine(); IsStruct = TRUE;>>
- | TN:StringIdentifier {OpenBracket AN9:Number CloseBracket <<ArrayNum = _STOU32(AN9->getText());>>}
+ | R:"EFI_HII_REF" {OpenBracket AN9:Number CloseBracket <<ArrayNum = _STOU32(AN9->getText());>>}
+ << TypeName = R->getText(); LineNum = R->getLine(); IsStruct = TRUE;>>
+ | TN:StringIdentifier {OpenBracket AN10:Number CloseBracket <<ArrayNum = _STOU32(AN10->getText());>>}
<< TypeName = TN->getText(); LineNum = TN->getLine(); IsStruct = TRUE;>>
)
<<
@@ -795,6 +808,7 @@
| U64:"UINT64" "," << TypeName = U64->getText(); LineNum = U64->getLine(); >>
| D:"EFI_HII_DATE" "," << TypeName = D->getText(); LineNum = D->getLine(); >>
| T:"EFI_HII_TIME" "," << TypeName = T->getText(); LineNum = T->getLine(); >>
+ | R:"EFI_HII_REF" "," << TypeName = R->getText(); LineNum = R->getLine(); >>
)
{ Key "=" FID:Number "," << // Key is used to assign Varid in Framework VFR but no use in UEFI2.1 VFR
if (mCompatibleMode) {
@@ -979,39 +993,31 @@
case QUESTION_TIME:
mCVfrQuestionDB.RegisterNewTimeQuestion (QName, VarIdStr, QId);
break;
+ case QUESTION_REF:
+ //
+ // VarIdStr != NULL stand for question with storagae.
+ //
+ if (VarIdStr != NULL) {
+ mCVfrQuestionDB.RegisterRefQuestion (QName, VarIdStr, QId);
+ } else {
+ mCVfrQuestionDB.RegisterQuestion (QName, NULL, QId);
+ }
+ break;
default:
_PCATCH(VFR_RETURN_FATAL_ERROR);
}
$QHObj.SetQuestionId (QId);
- $QHObj.SetVarStoreInfo (&Info);
+ if (VarIdStr != NULL) {
+ $QHObj.SetVarStoreInfo (&Info);
+ }
>>
vfrStatementHeader[&$QHObj]
- << _SAVE_CURRQEST_VARINFO (Info); >>
- << if (VarIdStr != NULL) delete VarIdStr; >>
- ;
-
-vfrQuestionHeaderWithNoStorage[CIfrQuestionHeader *QHObj] :
- <<
- EFI_QUESTION_ID QId = EFI_QUESTION_ID_INVALID;
- CHAR8 *QName = NULL;
- >>
- {
- Name "=" QN:StringIdentifier "," <<
- QName = QN->getText();
- _PCATCH(mCVfrQuestionDB.FindQuestion (QName), VFR_RETURN_UNDEFINED, QN, "has already been used please used anther name");
+ <<
+ if (VarIdStr != NULL) {
+ delete VarIdStr;
+ _SAVE_CURRQEST_VARINFO (Info);
+ }
>>
- }
- {
- QuestionId "=" ID:Number "," <<
- QId = _STOQID(ID->getText());
- _PCATCH(mCVfrQuestionDB.FindQuestion (QId), VFR_RETURN_UNDEFINED, ID, "redefined quesiont ID");
- >>
- }
- <<
- mCVfrQuestionDB.RegisterQuestion (QName, NULL, QId);
- $QHObj->SetQuestionId (QId);
- >>
- vfrStatementHeader[$QHObj]
;
questionheaderFlagsField[UINT8 & Flags] :
@@ -1061,6 +1067,8 @@
_PCATCH(mCVfrDataStorage.GetVarStoreId (SName, &$Info.mVarStoreId), SN1);
_PCATCH(mCVfrDataStorage.GetNameVarStoreInfo (&$Info, Idx), SN1);
}
+
+ QuestVarIdStr = VarIdStr;
>>
)
|
@@ -1195,6 +1203,9 @@
;
vfrConstantValueField[UINT8 Type] > [EFI_IFR_TYPE_VALUE Value] :
+ <<
+ EFI_GUID Guid;
+ >>
N1:Number <<
switch ($Type) {
case EFI_IFR_TYPE_NUM_SIZE_8 :
@@ -1217,6 +1228,7 @@
break;
case EFI_IFR_TYPE_TIME :
case EFI_IFR_TYPE_DATE :
+ case EFI_IFR_TYPE_REF :
default :
break;
}
@@ -1228,6 +1240,8 @@
| Z:Zero << $Value.u8 = _STOU8(Z->getText()); >>
| HOUR:Number ":" MINUTE:Number ":" SECOND:Number << $Value.time = _STOT(HOUR->getText(), MINUTE->getText(), SECOND->getText()); >>
| YEAR:Number "/" MONTH:Number "/" DAY:Number << $Value.date = _STOD(YEAR->getText(), MONTH->getText(), DAY->getText()); >>
+ | QI:Number";" FI:Number";" guidDefinition[Guid] ";" "STRING_TOKEN" "\(" DP:Number "\)"
+ << $Value.ref = _STOR(QI->getText(), FI->getText(), &Guid, DP->getText()); >>
| "STRING_TOKEN" "\(" S1:Number "\)" << $Value.string = _STOSID(S1->getText()); >>
;
@@ -1519,7 +1533,7 @@
vfrStatementGoto :
<<
- UINT8 RefType = 1;
+ UINT8 RefType = 5;
EFI_STRING_ID DevPath = EFI_STRING_ID_INVALID;
EFI_GUID FSId = {0,};
EFI_FORM_ID FId;
@@ -1530,6 +1544,7 @@
CIfrRef2 *R2Obj = NULL;
CIfrRef3 *R3Obj = NULL;
CIfrRef4 *R4Obj = NULL;
+ CIfrRef5 *R5Obj = NULL;
>>
G:Goto
(
@@ -1572,9 +1587,19 @@
FId = _STOFID(F4->getText());
>>
)
+ |
+ (
+ )
)
<<
switch (RefType) {
+ case 5:
+ {
+ R5Obj = new CIfrRef5;
+ QHObj = R5Obj;
+ R5Obj->SetLineNo(G->getLine());
+ break;
+ }
case 4:
{
R4Obj = new CIfrRef4;
@@ -1616,13 +1641,13 @@
default: break;
}
>>
- vfrQuestionHeaderWithNoStorage[QHObj]
+ vfrQuestionHeader[*QHObj, QUESTION_REF]
{ "," vfrStatementStatTagList }
{ "," F:FLAGS "=" vfrGotoFlags[QHObj, F->getLine()] }
{
"," Key "=" KN:Number << AssignQuestionKey (*QHObj, KN); >>
}
- ";" << if (R1Obj != NULL) {delete R1Obj;} if (R2Obj != NULL) {delete R2Obj;} if (R3Obj != NULL) {delete R3Obj;} if (R4Obj != NULL) {delete R4Obj;} >>
+ ";" << if (R1Obj != NULL) {delete R1Obj;} if (R2Obj != NULL) {delete R2Obj;} if (R3Obj != NULL) {delete R3Obj;} if (R4Obj != NULL) {delete R4Obj;} if (R5Obj != NULL) {delete R5Obj;}>>
;
vfrGotoFlags [CIfrQuestionHeader *QHObj, UINT32 LineNum] :
@@ -1795,7 +1820,7 @@
vfrStatementAction :
<< CIfrAction AObj; >>
L:Action << AObj.SetLineNo(L->getLine()); >>
- vfrQuestionHeaderWithNoStorage[&AObj] ","
+ vfrQuestionHeader[AObj] ","
{ F:FLAGS "=" vfrActionFlags[AObj, F->getLine()] "," }
Config "=" "STRING_TOKEN" "\(" S:Number "\)" "," << AObj.SetQuestionConfig (_STOSID(S->getText())); >>
vfrStatementQuestionTagList
@@ -3744,6 +3769,7 @@
UINT64 _STOU64 (IN CHAR8 *);
EFI_HII_DATE _STOD (IN CHAR8 *, IN CHAR8 *, IN CHAR8 *);
EFI_HII_TIME _STOT (IN CHAR8 *, IN CHAR8 *, IN CHAR8 *);
+ EFI_HII_REF _STOR (IN CHAR8 *, IN CHAR8 *, IN EFI_GUID *, IN CHAR8 *);
EFI_STRING_ID _STOSID (IN CHAR8 *);
EFI_FORM_ID _STOFID (IN CHAR8 *);
@@ -4182,6 +4208,25 @@
*Dest = NewStr;
}
+EFI_HII_REF
+EfiVfrParser::_STOR (
+ IN CHAR8 *QuestionId,
+ IN CHAR8 *FormId,
+ IN EFI_GUID *FormSetGuid,
+ IN CHAR8 *DevicePath
+ )
+{
+ EFI_HII_REF Ref;
+ UINT32 Index;
+
+ memcpy (&Ref.FormSetGuid, FormSetGuid, sizeof (EFI_GUID));
+ Ref.QuestionId = _STOQID (QuestionId);
+ Ref.FormId = _STOFID (FormId);
+ Ref.DevicePath = _STOSID (DevicePath);
+
+ return Ref;
+}
+
//
// framework vfr to default declare varstore for each structure
//
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp 2011-06-28 05:33:55 UTC (rev 2188)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp 2011-06-28 05:38:07 UTC (rev 2189)
@@ -468,6 +468,7 @@
{"EFI_HII_DATE", EFI_IFR_TYPE_DATE, sizeof (EFI_HII_DATE), sizeof (UINT16)},
{"EFI_STRING_ID", EFI_IFR_TYPE_STRING, sizeof (EFI_STRING_ID),sizeof (EFI_STRING_ID)},
{"EFI_HII_TIME", EFI_IFR_TYPE_TIME, sizeof (EFI_HII_TIME), sizeof (UINT8)},
+ {"EFI_HII_REF", EFI_IFR_TYPE_REF, sizeof (EFI_HII_REF), sizeof (EFI_GUID)},
{NULL, EFI_IFR_TYPE_OTHER, 0, 0}
};
@@ -789,6 +790,37 @@
pSecondsField->mArrayNum = 0;
New->mMembers = pHoursField;
+ } else if (strcmp (gInternalTypesTable[Index].mTypeName, "EFI_HII_REF") == 0) {
+ SVfrDataField *pQuestionIdField = new SVfrDataField;
+ SVfrDataField *pFormIdField = new SVfrDataField;
+ SVfrDataField *pFormSetGuidField = new SVfrDataField;
+ SVfrDataField *pDevicePathField = new SVfrDataField;
+
+ strcpy (pQuestionIdField->mFieldName, "QuestionId");
+ GetDataType ((CHAR8 *)"UINT16", &pQuestionIdField->mFieldType);
+ pQuestionIdField->mOffset = 0;
+ pQuestionIdField->mNext = pFormIdField;
+ pQuestionIdField->mArrayNum = 0;
+
+ strcpy (pFormIdField->mFieldName, "FormId");
+ GetDataType ((CHAR8 *)"UINT16", &pFormIdField->mFieldType);
+ pFormIdField->mOffset = 2;
+ pFormIdField->mNext = pFormSetGuidField;
+ pFormIdField->mArrayNum = 0;
+
+ strcpy (pFormSetGuidField->mFieldName, "FormSetGuid");
+ GetDataType ((CHAR8 *)"EFI_GUID", &pFormSetGuidField->mFieldType);
+ pFormSetGuidField->mOffset = 4;
+ pFormSetGuidField->mNext = pDevicePathField;
+ pFormSetGuidField->mArrayNum = 0;
+
+ strcpy (pDevicePathField->mFieldName, "DevicePath");
+ GetDataType ((CHAR8 *)"EFI_STRING_ID", &pDevicePathField->mFieldType);
+ pDevicePathField->mOffset = 20;
+ pDevicePathField->mNext = NULL;
+ pDevicePathField->mArrayNum = 0;
+
+ New->mMembers = pQuestionIdField;
} else {
New->mMembers = NULL;
}
@@ -2770,6 +2802,100 @@
}
}
+VOID
+CVfrQuestionDB::RegisterRefQuestion (
+ IN CHAR8 *Name,
+ IN CHAR8 *BaseVarId,
+ IN OUT EFI_QUESTION_ID &QuestionId
+ )
+{
+ SVfrQuestionNode *pNode[4] = {NULL, };
+ UINT32 Len;
+ CHAR8 *VarIdStr[4] = {NULL, };
+ CHAR8 Index;
+
+ if (BaseVarId == NULL) {
+ return;
+ }
+
+ Len = strlen (BaseVarId);
+
+ VarIdStr[0] = new CHAR8[Len + strlen (".QuestionId") + 1];
+ if (VarIdStr[0] != NULL) {
+ strcpy (VarIdStr[0], BaseVarId);
+ strcat (VarIdStr[0], ".QuestionId");
+ }
+ VarIdStr[1] = new CHAR8[Len + strlen (".FormId") + 1];
+ if (VarIdStr[1] != NULL) {
+ strcpy (VarIdStr[1], BaseVarId);
+ strcat (VarIdStr[1], ".FormId");
+ }
+ VarIdStr[2] = new CHAR8[Len + strlen (".FormSetGuid") + 1];
+ if (VarIdStr[2] != NULL) {
+ strcpy (VarIdStr[2], BaseVarId);
+ strcat (VarIdStr[2], ".FormSetGuid");
+ }
+ VarIdStr[3] = new CHAR8[Len + strlen (".DevicePath") + 1];
+ if (VarIdStr[3] != NULL) {
+ strcpy (VarIdStr[3], BaseVarId);
+ strcat (VarIdStr[3], ".DevicePath");
+ }
+
+ if ((pNode[0] = new SVfrQuestionNode (Name, VarIdStr[0])) == NULL) {
+ goto Err;
+ }
+ if ((pNode[1] = new SVfrQuestionNode (Name, VarIdStr[1])) == NULL) {
+ goto Err;
+ }
+ if ((pNode[2] = new SVfrQuestionNode (Name, VarIdStr[2])) == NULL) {
+ goto Err;
+ }
+ if ((pNode[3] = new SVfrQuestionNode (Name, VarIdStr[3])) == NULL) {
+ goto Err;
+ }
+
+ if (QuestionId == EFI_QUESTION_ID_INVALID) {
+ QuestionId = GetFreeQuestionId ();
+ } else {
+ if (ChekQuestionIdFree (QuestionId) == FALSE) {
+ goto Err;
+ }
+ MarkQuestionIdUsed (QuestionId);
+ }
+
+ pNode[0]->mQuestionId = QuestionId;
+ pNode[1]->mQuestionId = QuestionId;
+ pNode[2]->mQuestionId = QuestionId;
+ pNode[3]->mQuestionId = QuestionId;
+ pNode[0]->mQtype = QUESTION_REF;
+ pNode[1]->mQtype = QUESTION_REF;
+ pNode[2]->mQtype = QUESTION_REF;
+ pNode[3]->mQtype = QUESTION_REF;
+ pNode[0]->mNext = pNode[1];
+ pNode[1]->mNext = pNode[2];
+ pNode[2]->mNext = pNode[3];
+ pNode[3]->mNext = mQuestionList;
+ mQuestionList = pNode[0];
+
+ gCFormPkg.DoPendingAssign (VarIdStr[0], (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));
+ gCFormPkg.DoPendingAssign (VarIdStr[1], (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));
+ gCFormPkg.DoPendingAssign (VarIdStr[2], (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));
+ gCFormPkg.DoPendingAssign (VarIdStr[3], (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));
+
+ return;
+
+ Err:
+ for (Index = 0; Index < 4; Index++) {
+ if (pNode[Index] != NULL) {
+ delete pNode[Index];
+ }
+
+ if (VarIdStr[Index] != NULL) {
+ delete VarIdStr[Index];
+ }
+ }
+}
+
EFI_VFR_RETURN_CODE
CVfrQuestionDB::UpdateQuestionId (
IN EFI_QUESTION_ID QId,
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrUtilityLib.h
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrUtilityLib.h 2011-06-28 05:33:55 UTC (rev 2188)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrUtilityLib.h 2011-06-28 05:38:07 UTC (rev 2189)
@@ -359,6 +359,7 @@
VOID RegisterNewDateQuestion (IN CHAR8 *, IN CHAR8 *, IN OUT EFI_QUESTION_ID &);
VOID RegisterOldTimeQuestion (IN CHAR8 *, IN CHAR8 *, IN CHAR8 *, IN OUT EFI_QUESTION_ID &);
VOID RegisterNewTimeQuestion (IN CHAR8 *, IN CHAR8 *, IN OUT EFI_QUESTION_ID &);
+ VOID RegisterRefQuestion (IN CHAR8 *, IN CHAR8 *, IN OUT EFI_QUESTION_ID &);
EFI_VFR_RETURN_CODE UpdateQuestionId (IN EFI_QUESTION_ID, IN EFI_QUESTION_ID);
VOID GetQuestionId (IN CHAR8 *, IN CHAR8 *, OUT EFI_QUESTION_ID &, OUT UINT32 &, OUT EFI_QUESION_TYPE *QType = NULL);
EFI_VFR_RETURN_CODE FindQuestion (IN EFI_QUESTION_ID);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yd...@us...> - 2011-08-16 05:38:09
|
Revision: 2252
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2252&view=rev
Author: ydong10
Date: 2011-08-16 05:38:03 +0000 (Tue, 16 Aug 2011)
Log Message:
-----------
Add one new command line parameter for Vfrcompile to input new default class guid.
Signed-off-by: ydong10
Reviewed-by: lgao4
Modified Paths:
--------------
trunk/BaseTools/Source/C/Common/ParseInf.h
trunk/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
trunk/BaseTools/Source/C/VfrCompile/VfrCompiler.h
trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
trunk/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
Modified: trunk/BaseTools/Source/C/Common/ParseInf.h
===================================================================
--- trunk/BaseTools/Source/C/Common/ParseInf.h 2011-08-15 16:17:48 UTC (rev 2251)
+++ trunk/BaseTools/Source/C/Common/ParseInf.h 2011-08-16 05:38:03 UTC (rev 2252)
@@ -31,7 +31,9 @@
#define _MAX_PATH 500
#endif
-
+#ifdef __cplusplus
+extern "C" {
+#endif
//
// Functions declarations
//
@@ -227,4 +229,9 @@
TRUE if section found
--*/
+
+#ifdef __cplusplus
+}
#endif
+
+#endif
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp 2011-08-15 16:17:48 UTC (rev 2251)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp 2011-08-16 05:38:03 UTC (rev 2252)
@@ -63,7 +63,9 @@
)
{
INT32 Index;
-
+ EFI_STATUS Status;
+
+ Status = EFI_SUCCESS;
SetUtilityName ((CHAR8*) PROGRAM_NAME);
mOptions.VfrFileName[0] = '\0';
@@ -79,6 +81,8 @@
mOptions.SkipCPreprocessor = TRUE;
mOptions.CPreprocessorOptions = NULL;
mOptions.CompatibleMode = FALSE;
+ mOptions.HasOverrideClassGuid = FALSE;
+ memset (&mOptions.OverrideClassGuid, 0, sizeof (EFI_GUID));
if (Argc == 1) {
Usage ();
@@ -141,6 +145,14 @@
}
gCVfrStringDB.SetStringFileName(Argv[Index]);
DebugMsg (NULL, 0, 9, (CHAR8 *) "Input string file path", Argv[Index]);
+ } else if ((stricmp (Argv[Index], "-g") == 0) || (stricmp (Argv[Index], "--guid") == 0)) {
+ Index++;
+ Status = StringToGuid (Argv[Index], &mOptions.OverrideClassGuid);
+ if (EFI_ERROR (Status)) {
+ DebugError (NULL, 0, 1000, "Invalid format:", "%s", Argv[Index]);
+ goto Fail;
+ }
+ mOptions.HasOverrideClassGuid = TRUE;
} else {
DebugError (NULL, 0, 1000, "Unknown option", "unrecognized option %s", Argv[Index]);
goto Fail;
@@ -410,6 +422,8 @@
" compatible framework vfr file",
" -s, --string-db",
" input uni string package file",
+ " -g, --guid Guid",
+ " default class guid input,Its format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
NULL
};
for (Index = 0; Help[Index] != NULL; Index++) {
@@ -483,7 +497,7 @@
delete PreProcessCmd;
}
-extern UINT8 VfrParserStart (IN FILE *, IN BOOLEAN);
+extern UINT8 VfrParserStart (IN FILE *, IN INPUT_INFO_TO_SYNTAX *);
VOID
CVfrCompiler::Compile (
@@ -492,6 +506,7 @@
{
FILE *pInFile = NULL;
CHAR8 *InFileName = NULL;
+ INPUT_INFO_TO_SYNTAX InputInfo;
if (!IS_RUN_STATUS(STATUS_PREPROCESSED)) {
goto Fail;
@@ -506,7 +521,14 @@
goto Fail;
}
- if (VfrParserStart (pInFile, mOptions.CompatibleMode) != 0) {
+ InputInfo.CompatibleMode = mOptions.CompatibleMode;
+ if (mOptions.HasOverrideClassGuid) {
+ InputInfo.OverrideClassGuid = &mOptions.OverrideClassGuid;
+ } else {
+ InputInfo.OverrideClassGuid = NULL;
+ }
+
+ if (VfrParserStart (pInFile, &InputInfo) != 0) {
goto Fail;
}
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrCompiler.h
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrCompiler.h 2011-08-15 16:17:48 UTC (rev 2251)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrCompiler.h 2011-08-16 05:38:03 UTC (rev 2252)
@@ -20,6 +20,7 @@
#include "EfiVfr.h"
#include "VfrFormPkg.h"
#include "VfrUtilityLib.h"
+#include "ParseInf.h"
#define PROGRAM_NAME "VfrCompile"
#define VFR_COMPILER_VERSION " 2.00 (UEFI 2.3.1)"
@@ -54,6 +55,8 @@
bool SkipCPreprocessor;
CHAR8 *CPreprocessorOptions;
BOOLEAN CompatibleMode;
+ BOOLEAN HasOverrideClassGuid;
+ EFI_GUID OverrideClassGuid;
} OPTIONS;
typedef enum {
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2011-08-15 16:17:48 UTC (rev 2251)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2011-08-16 05:38:03 UTC (rev 2252)
@@ -96,6 +96,11 @@
struct SBufferNode *mNext;
};
+typedef struct {
+ BOOLEAN CompatibleMode;
+ EFI_GUID *OverrideClassGuid;
+} INPUT_INFO_TO_SYNTAX;
+
class CFormPkg {
private:
UINT32 mBufferSize;
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2011-08-15 16:17:48 UTC (rev 2251)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2011-08-16 05:38:03 UTC (rev 2252)
@@ -51,11 +51,12 @@
UINT8
VfrParserStart (
IN FILE *File,
- IN BOOLEAN CompatibleMode
+ IN INPUT_INFO_TO_SYNTAX *InputInfo
)
{
ParserBlackBox<CVfrDLGLexer, EfiVfrParser, ANTLRToken> VfrParser(File);
- VfrParser.parser()->SetCompatibleMode (CompatibleMode);
+ VfrParser.parser()->SetCompatibleMode (InputInfo->CompatibleMode);
+ VfrParser.parser()->SetOverrideClassGuid (InputInfo->OverrideClassGuid);
return VfrParser.parser()->vfrProgram();
}
>>
@@ -509,19 +510,42 @@
","
}
<<
+ if (mOverrideClassGuid != NULL && ClassGuidNum >= 3) {
+ _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "Already has 3 class guids, can't add extra class guid!");
+ }
switch (ClassGuidNum) {
case 0:
- FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + sizeof(EFI_GUID));
+ if (mOverrideClassGuid != NULL) {
+ ClassGuidNum = 2;
+ } else {
+ ClassGuidNum = 1;
+ }
+ FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum * sizeof(EFI_GUID));
FSObj->SetClassGuid(&DefaultClassGuid);
+ if (mOverrideClassGuid != NULL) {
+ FSObj->SetClassGuid(mOverrideClassGuid);
+ }
break;
case 1:
+ if (mOverrideClassGuid != NULL) {
+ ClassGuidNum ++;
+ }
FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum * sizeof(EFI_GUID));
FSObj->SetClassGuid(&ClassGuid1);
+ if (mOverrideClassGuid != NULL) {
+ FSObj->SetClassGuid(mOverrideClassGuid);
+ }
break;
case 2:
+ if (mOverrideClassGuid != NULL) {
+ ClassGuidNum ++;
+ }
FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum * sizeof(EFI_GUID));
FSObj->SetClassGuid(&ClassGuid1);
FSObj->SetClassGuid(&ClassGuid2);
+ if (mOverrideClassGuid != NULL) {
+ FSObj->SetClassGuid(mOverrideClassGuid);
+ }
break;
case 3:
FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum * sizeof(EFI_GUID));
@@ -3813,6 +3837,7 @@
EFI_VARSTORE_INFO mCurrQestVarInfo;
+ EFI_GUID *mOverrideClassGuid;
//
// For framework vfr compatibility
@@ -3864,6 +3889,7 @@
VOID IdEqValDoSpecial (IN UINT32 &, IN UINT32, IN EFI_QUESTION_ID, IN CHAR8 *, IN UINT32, IN UINT16, IN EFI_COMPARE_TYPE);
VOID IdEqIdDoSpecial (IN UINT32 &, IN UINT32, IN EFI_QUESTION_ID, IN CHAR8 *, IN UINT32, IN EFI_QUESTION_ID, IN CHAR8 *, IN UINT32, IN EFI_COMPARE_TYPE);
VOID IdEqListDoSpecial (IN UINT32 &, IN UINT32, IN EFI_QUESTION_ID, IN CHAR8 *, IN UINT32, IN UINT16, IN UINT16 *);
+ VOID SetOverrideClassGuid (IN EFI_GUID *);
//
// For framework vfr compatibility
//
@@ -4672,6 +4698,12 @@
}
}
+VOID
+EfiVfrParser::SetOverrideClassGuid (IN EFI_GUID *OverrideClassGuid)
+{
+ mOverrideClassGuid = OverrideClassGuid;
+}
+
//
// For framework vfr compatibility
//
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp 2011-08-15 16:17:48 UTC (rev 2251)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp 2011-08-16 05:38:03 UTC (rev 2252)
@@ -636,7 +636,7 @@
EFI_VFR_RETURN_CODE
CVfrVarDataTypeDB::GetTypeField (
- IN CHAR8 *FName,
+ IN CONST CHAR8 *FName,
IN SVfrDataType *Type,
OUT SVfrDataField *&Field
)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gi...@us...> - 2011-09-08 03:01:20
|
Revision: 2299
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2299&view=rev
Author: gikidy
Date: 2011-09-08 03:01:13 +0000 (Thu, 08 Sep 2011)
Log Message:
-----------
1) GenFv: Fix issue where 64-bit pointer was being truncated, This change fixes a scenario where the high 32-bits of ImageContext.ImageAddress were found to be zero'd by the bitwise-and operation;
2) Check FfsRebase return status for an error condition;
3) Make check values of Base and End more precisely.
Signed-off-by: gikidy
Reviewed-by: lgao4
Modified Paths:
--------------
trunk/BaseTools/Source/C/Common/BasePeCoff.c
trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c
Modified: trunk/BaseTools/Source/C/Common/BasePeCoff.c
===================================================================
--- trunk/BaseTools/Source/C/Common/BasePeCoff.c 2011-09-07 05:05:32 UTC (rev 2298)
+++ trunk/BaseTools/Source/C/Common/BasePeCoff.c 2011-09-08 03:01:13 UTC (rev 2299)
@@ -979,14 +979,7 @@
ImageContext,
Section->VirtualAddress + Section->Misc.VirtualSize - 1
);
- if (ImageContext->IsTeImage) {
- Base = (CHAR8 *) ((UINTN) Base + sizeof (EFI_TE_IMAGE_HEADER) - (UINTN) TeHdr->StrippedSize);
- End = (CHAR8 *) ((UINTN) End + sizeof (EFI_TE_IMAGE_HEADER) - (UINTN) TeHdr->StrippedSize);
- }
- if (End > MaxEnd) {
- MaxEnd = End;
- }
//
// If the base start or end address resolved to 0, then fail.
//
@@ -995,6 +988,16 @@
return RETURN_LOAD_ERROR;
}
+
+ if (ImageContext->IsTeImage) {
+ Base = (CHAR8 *) ((UINTN) Base + sizeof (EFI_TE_IMAGE_HEADER) - (UINTN) TeHdr->StrippedSize);
+ End = (CHAR8 *) ((UINTN) End + sizeof (EFI_TE_IMAGE_HEADER) - (UINTN) TeHdr->StrippedSize);
+ }
+
+ if (End > MaxEnd) {
+ MaxEnd = End;
+ }
+
//
// Read the section
//
Modified: trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c
===================================================================
--- trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c 2011-09-07 05:05:32 UTC (rev 2298)
+++ trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c 2011-09-08 03:01:13 UTC (rev 2299)
@@ -1085,7 +1085,11 @@
// Rebase the PE or TE image in FileBuffer of FFS file for XIP
// Rebase for the debug genfvmap tool
//
- FfsRebase (FvInfo, FvInfo->FvFiles[Index], (EFI_FFS_FILE_HEADER *) FileBuffer, (UINTN) *VtfFileImage - (UINTN) FvImage->FileImage, FvMapFile);
+ Status = FfsRebase (FvInfo, FvInfo->FvFiles[Index], (EFI_FFS_FILE_HEADER *) FileBuffer, (UINTN) *VtfFileImage - (UINTN) FvImage->FileImage, FvMapFile);
+ if (EFI_ERROR (Status)) {
+ Error (NULL, 0, 3000, "Invalid", "Could not rebase %s.", FvInfo->FvFiles[Index]);
+ return Status;
+ }
//
// copy VTF File
//
@@ -1124,7 +1128,11 @@
// Rebase the PE or TE image in FileBuffer of FFS file for XIP.
// Rebase Bs and Rt drivers for the debug genfvmap tool.
//
- FfsRebase (FvInfo, FvInfo->FvFiles[Index], (EFI_FFS_FILE_HEADER *) FileBuffer, (UINTN) FvImage->CurrentFilePointer - (UINTN) FvImage->FileImage, FvMapFile);
+ Status = FfsRebase (FvInfo, FvInfo->FvFiles[Index], (EFI_FFS_FILE_HEADER *) FileBuffer, (UINTN) FvImage->CurrentFilePointer - (UINTN) FvImage->FileImage, FvMapFile);
+ if (EFI_ERROR (Status)) {
+ Error (NULL, 0, 3000, "Invalid", "Could not rebase %s.", FvInfo->FvFiles[Index]);
+ return Status;
+ }
//
// Copy the file
//
@@ -3020,7 +3028,7 @@
return EFI_OUT_OF_RESOURCES;
}
memset ((VOID *) MemoryImagePointer, 0, (UINTN) ImageContext.ImageSize + ImageContext.SectionAlignment);
- ImageContext.ImageAddress = ((UINTN) MemoryImagePointer + ImageContext.SectionAlignment - 1) & (~((INT64)ImageContext.SectionAlignment - 1));
+ ImageContext.ImageAddress = ((UINTN) MemoryImagePointer + ImageContext.SectionAlignment - 1) & (~((UINTN) ImageContext.SectionAlignment - 1));
Status = PeCoffLoaderLoadImage (&ImageContext);
if (EFI_ERROR (Status)) {
@@ -3247,7 +3255,7 @@
return EFI_OUT_OF_RESOURCES;
}
memset ((VOID *) MemoryImagePointer, 0, (UINTN) ImageContext.ImageSize + ImageContext.SectionAlignment);
- ImageContext.ImageAddress = ((UINTN) MemoryImagePointer + ImageContext.SectionAlignment - 1) & (~(ImageContext.SectionAlignment - 1));
+ ImageContext.ImageAddress = ((UINTN) MemoryImagePointer + ImageContext.SectionAlignment - 1) & (~((UINTN) ImageContext.SectionAlignment - 1));
Status = PeCoffLoaderLoadImage (&ImageContext);
if (EFI_ERROR (Status)) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jlj...@us...> - 2011-10-26 04:15:31
|
Revision: 2379
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2379&view=rev
Author: jljusten
Date: 2011-10-26 04:15:24 +0000 (Wed, 26 Oct 2011)
Log Message:
-----------
BaseTools/Source/C: Fix warnings generated by GCC 4.6
GCC 4.6 generates a warning when a variable is set,
but never used.
This patch cleans up these cases in our BaseTools C
based tools.
Signed-off-by: jljusten
Reviewed-by: gikidy
Modified Paths:
--------------
trunk/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c
trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c
trunk/BaseTools/Source/C/GenFw/Elf32Convert.c
trunk/BaseTools/Source/C/GenFw/Elf64Convert.c
trunk/BaseTools/Source/C/GenSec/GenSec.c
trunk/BaseTools/Source/C/GenVtf/GenVtf.c
trunk/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c
trunk/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
trunk/BaseTools/Source/C/Split/Split.c
Modified: trunk/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c
===================================================================
--- trunk/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
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
@@ -181,7 +181,6 @@
CHAR8* OutputFileName = NULL;
CHAR8* InputFileNames[MAX_PE_IMAGES + 1];
UINT8 InputFileCount = 0;
- BOOLEAN QuietFlag = FALSE;
UINT64 DebugLevel = 0;
UINT64 VerboseLevel = 0;
EFI_STATUS Status = EFI_SUCCESS;
@@ -220,7 +219,6 @@
}
if ((stricmp (argv[0], "-q") == 0) || (stricmp (argv[0], "--quiet") == 0)) {
- QuietFlag = TRUE;
argc --;
argv ++;
continue;
Modified: trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c
===================================================================
--- trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
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
@@ -2801,7 +2801,6 @@
PE_COFF_LOADER_IMAGE_CONTEXT OrigImageContext;
EFI_PHYSICAL_ADDRESS XipBase;
EFI_PHYSICAL_ADDRESS NewPe32BaseAddress;
- EFI_PHYSICAL_ADDRESS *BaseToUpdate;
UINTN Index;
EFI_FILE_SECTION_POINTER CurrentPe32Section;
EFI_FFS_FILE_STATE SavedState;
@@ -2818,7 +2817,6 @@
Index = 0;
MemoryImagePointer = NULL;
- BaseToUpdate = NULL;
TEImageHeader = NULL;
ImgHdr = NULL;
SectionHeader = NULL;
@@ -2992,7 +2990,6 @@
}
NewPe32BaseAddress = XipBase + (UINTN) CurrentPe32Section.Pe32Section + sizeof (EFI_PE32_SECTION) - (UINTN)FfsFile;
- BaseToUpdate = &XipBase;
break;
case EFI_FV_FILETYPE_DRIVER:
@@ -3008,7 +3005,6 @@
return EFI_ABORTED;
}
NewPe32BaseAddress = XipBase + (UINTN) CurrentPe32Section.Pe32Section + sizeof (EFI_PE32_SECTION) - (UINTN)FfsFile;
- BaseToUpdate = &XipBase;
break;
default:
Modified: trunk/BaseTools/Source/C/GenFw/Elf32Convert.c
===================================================================
--- trunk/BaseTools/Source/C/GenFw/Elf32Convert.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/GenFw/Elf32Convert.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -738,10 +738,6 @@
UINT8 *Targ;
Elf32_Phdr *DynamicSegment;
Elf32_Phdr *TargetSegment;
- Elf_Sym *Sym;
- Elf_Shdr *SymtabShdr;
- UINT8 *Symtab;
-
for (Index = 0, FoundRelocations = FALSE; Index < mEhdr->e_shnum; Index++) {
Elf_Shdr *RelShdr = GetShdrByIndex(Index);
@@ -750,16 +746,10 @@
if (IsTextShdr(SecShdr) || IsDataShdr(SecShdr)) {
UINT32 RelIdx;
- SymtabShdr = GetShdrByIndex (RelShdr->sh_link);
- Symtab = (UINT8*)mEhdr + SymtabShdr->sh_offset;
FoundRelocations = TRUE;
for (RelIdx = 0; RelIdx < RelShdr->sh_size; RelIdx += RelShdr->sh_entsize) {
Elf_Rel *Rel = (Elf_Rel *)((UINT8*)mEhdr + RelShdr->sh_offset + RelIdx);
- Elf_Shdr *SymShdr;
- Sym = (Elf_Sym *)(Symtab + ELF_R_SYM(Rel->r_info) * SymtabShdr->sh_entsize);
- SymShdr = GetShdrByIndex (Sym->st_shndx);
-
if (mEhdr->e_machine == EM_386) {
switch (ELF_R_TYPE(Rel->r_info)) {
case R_386_NONE:
Modified: trunk/BaseTools/Source/C/GenFw/Elf64Convert.c
===================================================================
--- trunk/BaseTools/Source/C/GenFw/Elf64Convert.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/GenFw/Elf64Convert.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -637,29 +637,17 @@
UINT32 Index;
EFI_IMAGE_OPTIONAL_HEADER_UNION *NtHdr;
EFI_IMAGE_DATA_DIRECTORY *Dir;
- BOOLEAN FoundRelocations;
- Elf_Sym *Sym;
- Elf_Shdr *SymtabShdr;
- UINT8 *Symtab;
-
- for (Index = 0, FoundRelocations = FALSE; Index < mEhdr->e_shnum; Index++) {
+ for (Index = 0; Index < mEhdr->e_shnum; Index++) {
Elf_Shdr *RelShdr = GetShdrByIndex(Index);
if ((RelShdr->sh_type == SHT_REL) || (RelShdr->sh_type == SHT_RELA)) {
Elf_Shdr *SecShdr = GetShdrByIndex (RelShdr->sh_info);
if (IsTextShdr(SecShdr) || IsDataShdr(SecShdr)) {
UINT64 RelIdx;
- SymtabShdr = GetShdrByIndex (RelShdr->sh_link);
- Symtab = (UINT8*)mEhdr + SymtabShdr->sh_offset;
- FoundRelocations = TRUE;
for (RelIdx = 0; RelIdx < RelShdr->sh_size; RelIdx += RelShdr->sh_entsize) {
Elf_Rela *Rel = (Elf_Rela *)((UINT8*)mEhdr + RelShdr->sh_offset + RelIdx);
- Elf_Shdr *SymShdr;
- Sym = (Elf_Sym *)(Symtab + ELF_R_SYM(Rel->r_info) * SymtabShdr->sh_entsize);
- SymShdr = GetShdrByIndex (Sym->st_shndx);
-
if (mEhdr->e_machine == EM_X86_64) {
switch (ELF_R_TYPE(Rel->r_info)) {
case R_X86_64_NONE:
Modified: trunk/BaseTools/Source/C/GenSec/GenSec.c
===================================================================
--- trunk/BaseTools/Source/C/GenSec/GenSec.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/GenSec/GenSec.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
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
@@ -915,7 +915,6 @@
{
UINT32 Index;
UINT32 InputFileNum;
- FILE *InFile;
FILE *OutFile;
CHAR8 **InputFileName;
CHAR8 *OutputFileName;
@@ -944,7 +943,6 @@
SectionName = NULL;
CompressionName = NULL;
StringBuffer = "";
- InFile = NULL;
OutFile = NULL;
VersionNumber = 0;
InputFileNum = 0;
Modified: trunk/BaseTools/Source/C/GenVtf/GenVtf.c
===================================================================
--- trunk/BaseTools/Source/C/GenVtf/GenVtf.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/GenVtf/GenVtf.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -1,6 +1,6 @@
/**
-Copyright (c) 1999 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 1999 - 2011, Intel Corporation. All rights reserved.<BR>
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
@@ -1141,7 +1141,6 @@
EFI_STATUS Status;
UINT64 CompStartAddress;
UINT64 FileSize;
- UINT64 NumByteRead;
UINT64 NumAdjustByte;
UINT8 *Buffer;
FILE *Fp;
@@ -1189,7 +1188,7 @@
//
// Read first 64 bytes of PAL header and use it to find version info
//
- NumByteRead = fread (Buffer, sizeof (UINT8), SIZE_OF_PAL_HEADER, Fp);
+ fread (Buffer, sizeof (UINT8), SIZE_OF_PAL_HEADER, Fp);
//
// PAL header contains the version info. Currently, we will use the header
@@ -1200,7 +1199,7 @@
}
}
- NumByteRead = fread (Buffer, sizeof (UINT8), (UINTN) FileSize, Fp);
+ fread (Buffer, sizeof (UINT8), (UINTN) FileSize, Fp);
fclose (Fp);
//
@@ -1329,7 +1328,6 @@
UINT64 AbsAddress;
UINTN RelativeAddress;
UINT64 FileSize;
- UINT64 NumByteRead;
UINT8 *Buffer;
FILE *Fp;
FIT_TABLE *PalFitPtr;
@@ -1367,7 +1365,7 @@
//
// Read, Get version Info and discard the PAL header.
//
- NumByteRead = fread (Buffer, sizeof (UINT8), SIZE_OF_PAL_HEADER, Fp);
+ fread (Buffer, sizeof (UINT8), SIZE_OF_PAL_HEADER, Fp);
//
// Extract the version info from header of PAL_A. Once done, discrad this buffer
@@ -1379,7 +1377,7 @@
//
// Read PAL_A file in a buffer
//
- NumByteRead = fread (Buffer, sizeof (UINT8), (UINTN) FileSize, Fp);
+ fread (Buffer, sizeof (UINT8), (UINTN) FileSize, Fp);
fclose (Fp);
PalStartAddress = Fv1EndAddress - (SIZE_TO_OFFSET_PAL_A_END + FileSize);
@@ -1759,7 +1757,6 @@
UINT8 *Buffer;
UINT8 *LocalVtfBuffer;
UINTN FileSize;
- UINTN NumByteRead;
FILE *Fp;
if (!strcmp (FileName, "")) {
@@ -1784,7 +1781,7 @@
return EFI_OUT_OF_RESOURCES;
}
- NumByteRead = fread (Buffer, sizeof (UINT8), FileSize, Fp);
+ fread (Buffer, sizeof (UINT8), FileSize, Fp);
LocalVtfBuffer = (UINT8 *) Vtf1EndBuffer - SIZE_IA32_RESET_VECT;
memcpy (LocalVtfBuffer, Buffer, FileSize);
@@ -2121,7 +2118,6 @@
FILE *Fp;
UINT64 *StartAddressPtr;
UINTN FirstFwVSize;
- UINTN NumByte;
StartAddressPtr = malloc (sizeof (UINT64));
if (StartAddressPtr == NULL) {
@@ -2141,7 +2137,7 @@
FirstFwVSize = _filelength (fileno (Fp));
fseek (Fp, (long) (FirstFwVSize - (UINTN) (SIZE_IA32_RESET_VECT + SIZE_SALE_ENTRY_POINT)), SEEK_SET);
- NumByte = fwrite ((VOID *) StartAddressPtr, sizeof (UINT64), 1, Fp);
+ fwrite ((VOID *) StartAddressPtr, sizeof (UINT64), 1, Fp);
if (Fp) {
fclose (Fp);
Modified: trunk/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c
===================================================================
--- trunk/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
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
@@ -305,7 +305,6 @@
char *argv[]
)
{
- CHAR8 *AppName;
INTN Index;
BOOLEAN ProcessMbr;
ERROR_STATUS Status;
@@ -319,7 +318,6 @@
ZeroMem(&InputPathInfo, sizeof(PATH_INFO));
ZeroMem(&OutputPathInfo, sizeof(PATH_INFO));
- AppName = *argv;
argv ++;
argc --;
Modified: trunk/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
===================================================================
--- trunk/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -1,6 +1,19 @@
-/* LzmaEnc.c -- LZMA Encoder
-2009-02-02 : Igor Pavlov : Public domain */
+/** @file
+ Based on LZMA SDK 4.65:
+ LzmaEnc.c -- LZMA Encoder
+ 2009-02-02 : Igor Pavlov : Public domain
+ Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
+ 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.
+
+**/
+
#include <string.h>
/* #define SHOW_STAT */
@@ -1919,11 +1932,13 @@
static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig)
{
UInt32 beforeSize = kNumOpts;
+ #ifdef COMPRESS_MF_MT
Bool btMode;
+ #endif
if (!RangeEnc_Alloc(&p->rc, alloc))
return SZ_ERROR_MEM;
+ #ifdef COMPRESS_MF_MT
btMode = (p->matchFinderBase.btMode != 0);
- #ifdef COMPRESS_MF_MT
p->mtMode = (p->multiThread && !p->fastMode && btMode);
#endif
Modified: trunk/BaseTools/Source/C/Split/Split.c
===================================================================
--- trunk/BaseTools/Source/C/Split/Split.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/Split/Split.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -2,7 +2,7 @@
Split a file into two pieces at the request offset.
-Copyright (c) 1999 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 1999 - 2011, Intel Corporation. All rights reserved.<BR>
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
@@ -229,7 +229,6 @@
CHAR8 *CurrentDir = NULL;
UINT64 Index;
CHAR8 CharC;
- BOOLEAN QuietFlag = TRUE;
UINT64 DebugLevel = 0;
UINT64 VerboseLevel = 0;
@@ -307,7 +306,6 @@
}
if ((stricmp (argv[0], "-q") == 0) || (stricmp (argv[0], "--quiet") == 0)) {
- QuietFlag = TRUE;
argc --;
argv ++;
continue;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yd...@us...> - 2011-11-16 06:26:15
|
Revision: 2409
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2409&view=rev
Author: ydong10
Date: 2011-11-16 06:26:09 +0000 (Wed, 16 Nov 2011)
Log Message:
-----------
According to PI 1.2c Vol 3, EFI_FVB2_ALIGNMNET_512K should be EFI_FVB2_ALIGNMENT_512K.
Signed-off-by: lzeng14
Reviewed-by: lgao4
Modified Paths:
--------------
trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c
trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.h
trunk/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h
trunk/BaseTools/Source/C/VolInfo/VolInfo.c
Modified: trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c
===================================================================
--- trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c 2011-11-16 06:00:32 UTC (rev 2408)
+++ trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c 2011-11-16 06:26:09 UTC (rev 2409)
@@ -84,7 +84,7 @@
EFI_FVB2_ALIGNMENT_64K_STRING,
EFI_FVB2_ALIGNMENT_128K_STRING,
EFI_FVB2_ALIGNMENT_256K_STRING,
- EFI_FVB2_ALIGNMNET_512K_STRING,
+ EFI_FVB2_ALIGNMENT_512K_STRING,
EFI_FVB2_ALIGNMENT_1M_STRING,
EFI_FVB2_ALIGNMENT_2M_STRING,
EFI_FVB2_ALIGNMENT_4M_STRING,
Modified: trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.h
===================================================================
--- trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.h 2011-11-16 06:00:32 UTC (rev 2408)
+++ trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.h 2011-11-16 06:26:09 UTC (rev 2409)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
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
@@ -130,7 +130,7 @@
#define EFI_FVB2_ALIGNMENT_64K_STRING "EFI_FVB2_ALIGNMENT_64K"
#define EFI_FVB2_ALIGNMENT_128K_STRING "EFI_FVB2_ALIGNMENT_128K"
#define EFI_FVB2_ALIGNMENT_256K_STRING "EFI_FVB2_ALIGNMENT_256K"
-#define EFI_FVB2_ALIGNMNET_512K_STRING "EFI_FVB2_ALIGNMENT_512K"
+#define EFI_FVB2_ALIGNMENT_512K_STRING "EFI_FVB2_ALIGNMENT_512K"
#define EFI_FVB2_ALIGNMENT_1M_STRING "EFI_FVB2_ALIGNMENT_1M"
#define EFI_FVB2_ALIGNMENT_2M_STRING "EFI_FVB2_ALIGNMENT_2M"
#define EFI_FVB2_ALIGNMENT_4M_STRING "EFI_FVB2_ALIGNMENT_4M"
Modified: trunk/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h
===================================================================
--- trunk/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h 2011-11-16 06:00:32 UTC (rev 2408)
+++ trunk/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h 2011-11-16 06:26:09 UTC (rev 2409)
@@ -1,7 +1,7 @@
/** @file
The firmware volume related definitions in PI.
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License which accompanies this
@@ -73,7 +73,7 @@
#define EFI_FVB2_ALIGNMENT_64K 0x00100000
#define EFI_FVB2_ALIGNMENT_128K 0x00110000
#define EFI_FVB2_ALIGNMENT_256K 0x00120000
-#define EFI_FVB2_ALIGNMNET_512K 0x00130000
+#define EFI_FVB2_ALIGNMENT_512K 0x00130000
#define EFI_FVB2_ALIGNMENT_1M 0x00140000
#define EFI_FVB2_ALIGNMENT_2M 0x00150000
#define EFI_FVB2_ALIGNMENT_4M 0x00160000
Modified: trunk/BaseTools/Source/C/VolInfo/VolInfo.c
===================================================================
--- trunk/BaseTools/Source/C/VolInfo/VolInfo.c 2011-11-16 06:00:32 UTC (rev 2408)
+++ trunk/BaseTools/Source/C/VolInfo/VolInfo.c 2011-11-16 06:26:09 UTC (rev 2409)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 1999 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 1999 - 2011, Intel Corporation. All rights reserved.<BR>
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
@@ -845,8 +845,8 @@
printf (" EFI_FVB2_ALIGNMENT_256K\n");
}
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMNET_512K) {
- printf (" EFI_FVB2_ALIGNMNET_512K\n");
+ if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_512K) {
+ printf (" EFI_FVB2_ALIGNMENT_512K\n");
}
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_1M) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yd...@us...> - 2011-11-18 01:36:03
|
Revision: 2417
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2417&view=rev
Author: ydong10
Date: 2011-11-18 01:35:57 +0000 (Fri, 18 Nov 2011)
Log Message:
-----------
According to PI errata 0000718 and PI 1.2c Vol 3 3.2.1, comment out "Types" for EFI_FIRMWARE_VOLUME_EXT_ENTRY_OEM_TYPE structure and "Data" for EFI_FIRMWARE_VOLUME_EXT_ENTRY_GUID_TYPE structure.
Signed-off-by: lzeng14
Reviewed-by: hhtian
Modified Paths:
--------------
trunk/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.h
trunk/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h
Modified: trunk/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
===================================================================
--- trunk/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c 2011-11-18 01:35:41 UTC (rev 2416)
+++ trunk/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c 2011-11-18 01:35:57 UTC (rev 2417)
@@ -553,7 +553,7 @@
EFI_FIRMWARE_VOLUME_HEADER *hdr = (EFI_FIRMWARE_VOLUME_HEADER*)Fv;
EFI_FFS_FILE_HEADER *fhdr = NULL;
- EFI_FVB_ATTRIBUTES FvbAttributes;
+ EFI_FVB_ATTRIBUTES_2 FvbAttributes;
UINTN offset;
UINTN fsize;
UINTN newSize;
@@ -869,7 +869,7 @@
EFI_FIRMWARE_VOLUME_HEADER *hdr = (EFI_FIRMWARE_VOLUME_HEADER*)Fv;
EFI_FFS_FILE_HEADER *fhdr = NULL;
- EFI_FVB_ATTRIBUTES FvbAttributes;
+ EFI_FVB_ATTRIBUTES_2 FvbAttributes;
UINTN fsize;
EFI_STATUS Status;
Modified: trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.h
===================================================================
--- trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.h 2011-11-18 01:35:41 UTC (rev 2416)
+++ trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.h 2011-11-18 01:35:57 UTC (rev 2417)
@@ -226,7 +226,7 @@
BOOLEAN FvNameGuidSet;
CHAR8 FvExtHeaderFile[_MAX_PATH];
UINTN Size;
- EFI_FVB_ATTRIBUTES FvAttributes;
+ EFI_FVB_ATTRIBUTES_2 FvAttributes;
CHAR8 FvName[_MAX_PATH];
EFI_FV_BLOCK_MAP_ENTRY FvBlocks[MAX_NUMBER_OF_FV_BLOCKS];
CHAR8 FvFiles[MAX_NUMBER_OF_FILES_IN_FV][_MAX_PATH];
Modified: trunk/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h
===================================================================
--- trunk/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h 2011-11-18 01:35:41 UTC (rev 2416)
+++ trunk/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h 2011-11-18 01:35:57 UTC (rev 2417)
@@ -14,7 +14,7 @@
File Name: PiFirmwareVolume.h
@par Revision Reference:
- Version 1.0.
+ Version 1.2C
**/
@@ -33,7 +33,7 @@
#define EFI_FV_FILE_ATTRIB_FIXED 0x00000100
#define EFI_FV_FILE_ATTRIB_MEMORY_MAPPED 0x00000200
-typedef UINT32 EFI_FVB_ATTRIBUTES;
+typedef UINT32 EFI_FVB_ATTRIBUTES_2;
//
// Attributes bit definitions
@@ -101,7 +101,7 @@
EFI_GUID FileSystemGuid;
UINT64 FvLength;
UINT32 Signature;
- EFI_FVB_ATTRIBUTES Attributes;
+ EFI_FVB_ATTRIBUTES_2 Attributes;
UINT16 HeaderLength;
UINT16 Checksum;
UINT16 ExtHeaderOffset;
@@ -139,8 +139,20 @@
// Array of GUIDs.
// Each GUID represents an OEM file type.
//
- EFI_GUID Types[1];
+ // EFI_GUID Types[1];
+ //
} EFI_FIRMWARE_VOLUME_EXT_ENTRY_OEM_TYPE;
+#define EFI_FV_EXT_TYPE_GUID_TYPE 0x0002
+typedef struct {
+ EFI_FIRMWARE_VOLUME_EXT_ENTRY Hdr;
+ EFI_GUID FormatType;
+ //
+ // An arry of bytes of length Length.
+ //
+ // UINT8 Data[1];
+ //
+} EFI_FIRMWARE_VOLUME_EXT_ENTRY_GUID_TYPE;
+
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yd...@us...> - 2012-01-12 13:11:27
|
Revision: 2478
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2478&view=rev
Author: ydong10
Date: 2012-01-12 13:11:16 +0000 (Thu, 12 Jan 2012)
Log Message:
-----------
Correct definition to follow spec.
Signed-off-by: ydong10
Reviewed-by: lgao4
Modified Paths:
--------------
trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
Modified: trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
===================================================================
--- trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h 2012-01-10 02:12:06 UTC (rev 2477)
+++ trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h 2012-01-12 13:11:16 UTC (rev 2478)
@@ -3,7 +3,7 @@
IFR is primarily consumed by the EFI presentation engine, and produced by EFI
internal application and drivers as well as all add-in card option-ROM drivers
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License which accompanies this
@@ -613,7 +613,7 @@
#define EFI_IFR_INCONSISTENT_IF_OP 0x11
#define EFI_IFR_EQ_ID_VAL_OP 0x12
#define EFI_IFR_EQ_ID_ID_OP 0x13
-#define EFI_IFR_EQ_ID_LIST_OP 0x14
+#define EFI_IFR_EQ_ID_VAL_LIST_OP 0x14
#define EFI_IFR_AND_OP 0x15
#define EFI_IFR_OR_OP 0x16
#define EFI_IFR_NOT_OP 0x17
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp 2012-01-10 02:12:06 UTC (rev 2477)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp 2012-01-12 13:11:16 UTC (rev 2478)
@@ -2,7 +2,7 @@
The definition of CFormPkg's member function
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
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
@@ -963,7 +963,7 @@
switch (OpCode) {
case EFI_IFR_EQ_ID_VAL_OP:
case EFI_IFR_EQ_ID_ID_OP:
- case EFI_IFR_EQ_ID_LIST_OP:
+ case EFI_IFR_EQ_ID_VAL_LIST_OP:
case EFI_IFR_QUESTION_REF1_OP:
return TRUE;
default:
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2012-01-10 02:12:06 UTC (rev 2477)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2012-01-12 13:11:16 UTC (rev 2478)
@@ -2,7 +2,7 @@
The definition of CFormPkg's member function
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
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
@@ -1885,8 +1885,8 @@
public:
CIfrEqIdList (
IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_EQ_ID_LIST_OP, (CHAR8 **)&mEqIdVList, sizeof (EFI_IFR_EQ_ID_VAL_LIST), TRUE),
- CIfrOpHeader (EFI_IFR_EQ_ID_LIST_OP, &mEqIdVList->Header) {
+ ) : CIfrObj (EFI_IFR_EQ_ID_VAL_LIST_OP, (CHAR8 **)&mEqIdVList, sizeof (EFI_IFR_EQ_ID_VAL_LIST), TRUE),
+ CIfrOpHeader (EFI_IFR_EQ_ID_VAL_LIST_OP, &mEqIdVList->Header) {
SetLineNo (LineNo);
mEqIdVList->QuestionId = EFI_QUESTION_ID_INVALID;
mEqIdVList->ListLength = 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lg...@us...> - 2012-04-06 05:39:18
|
Revision: 2518
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2518&view=rev
Author: lgao4
Date: 2012-04-06 05:39:12 +0000 (Fri, 06 Apr 2012)
Log Message:
-----------
Add LzmaF86Compress.bat into LzmaCompress source directory. It will be copied to $(SYS_BIN_PATH) in make phase.
Signed-off-by: Liming Gao <lim...@in...>
Reviewed-by: Larry Hauch <lar...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/C/LzmaCompress/Makefile
trunk/BaseTools/Source/C/Makefile
Added Paths:
-----------
trunk/BaseTools/Source/C/LzmaCompress/LzmaF86Compress.bat
Added: trunk/BaseTools/Source/C/LzmaCompress/LzmaF86Compress.bat
===================================================================
--- trunk/BaseTools/Source/C/LzmaCompress/LzmaF86Compress.bat (rev 0)
+++ trunk/BaseTools/Source/C/LzmaCompress/LzmaF86Compress.bat 2012-04-06 05:39:12 UTC (rev 2518)
@@ -0,0 +1,31 @@
+@REM
+@REM This script will exec LzmaCompress tool with --f86 option that enables converter for x86 code.
+@REM
+@REM Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
+@REM This program and the accompanying materials
+@REM are licensed and made available under the terms and conditions of the BSD License
+@REM which accompanies this distribution. The full text of the license may be found at
+@REM http://opensource.org/licenses/bsd-license.php
+@REM
+@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+@REM
+
+@echo off
+@setlocal
+
+:Begin
+if "%1"=="" goto End
+if "%1"=="-e" (
+ set FLAG=--f86
+)
+if "%1"=="-d" (
+ set FLAG=--f86
+)
+set ARGS=%ARGS% %1
+shift
+goto Begin
+
+:End
+LzmaCompress %ARGS% %FLAG%
+@echo on
Modified: trunk/BaseTools/Source/C/LzmaCompress/Makefile
===================================================================
--- trunk/BaseTools/Source/C/LzmaCompress/Makefile 2012-04-05 08:22:02 UTC (rev 2517)
+++ trunk/BaseTools/Source/C/LzmaCompress/Makefile 2012-04-06 05:39:12 UTC (rev 2518)
@@ -30,3 +30,12 @@
!INCLUDE ..\Makefiles\ms.app
+all: $(BIN_PATH)\LzmaF86Compress.bat
+
+$(BIN_PATH)\LzmaF86Compress.bat: LzmaF86Compress.bat
+ copy LzmaF86Compress.bat $(BIN_PATH)\LzmaF86Compress.bat /Y
+
+cleanall: localCleanall
+
+localCleanall:
+ del /f /q $(BIN_PATH)\LzmaF86Compress.bat > nul
Modified: trunk/BaseTools/Source/C/Makefile
===================================================================
--- trunk/BaseTools/Source/C/Makefile 2012-04-05 08:22:02 UTC (rev 2517)
+++ trunk/BaseTools/Source/C/Makefile 2012-04-06 05:39:12 UTC (rev 2518)
@@ -1,7 +1,7 @@
## @file
# Windows makefile for C tools build.
#
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
# 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
@@ -59,6 +59,7 @@
@echo ######################
@-xcopy $(LIB_PATH)\*.lib $(SYS_LIB_PATH) /I /D /E /F /Y > NUL 2>&1
@-xcopy $(BIN_PATH)\*.exe $(SYS_BIN_PATH) /I /D /E /F /Y > NUL 2>&1
+ @-xcopy $(BIN_PATH)\*.bat $(SYS_BIN_PATH) /I /D /E /F /Y > NUL 2>&1
.PHONY: clean
clean:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yd...@us...> - 2012-09-27 10:54:15
|
Revision: 2552
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2552&view=rev
Author: ydong10
Date: 2012-09-27 10:54:08 +0000 (Thu, 27 Sep 2012)
Log Message:
-----------
Enable EFI_IFR_DEFAULT2 opcode in vfrcompile.
Signed-off-by: Eric Dong <eri...@in...>
Reviewed-by: Liming Gao <lim...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
Modified: trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
===================================================================
--- trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h 2012-09-27 02:47:43 UTC (rev 2551)
+++ trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h 2012-09-27 10:54:08 UTC (rev 2552)
@@ -803,6 +803,12 @@
EFI_IFR_TYPE_VALUE Value;
} EFI_IFR_DEFAULT;
+typedef struct _EFI_IFR_DEFAULT_2 {
+ EFI_IFR_OP_HEADER Header;
+ UINT16 DefaultId;
+ UINT8 Type;
+} EFI_IFR_DEFAULT_2;
+
typedef struct _EFI_IFR_VALUE {
EFI_IFR_OP_HEADER Header;
} EFI_IFR_VALUE;
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2012-09-27 02:47:43 UTC (rev 2551)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2012-09-27 10:54:08 UTC (rev 2552)
@@ -923,6 +923,29 @@
}
};
+class CIfrDefault2 : public CIfrObj, public CIfrOpHeader {
+private:
+ EFI_IFR_DEFAULT_2 *mDefault;
+
+public:
+ CIfrDefault2 (
+ IN UINT16 DefaultId = EFI_HII_DEFAULT_CLASS_STANDARD,
+ IN UINT8 Type = EFI_IFR_TYPE_OTHER
+ ) : CIfrObj (EFI_IFR_DEFAULT_OP, (CHAR8 **)&mDefault, sizeof (EFI_IFR_DEFAULT_2)),
+ CIfrOpHeader (EFI_IFR_DEFAULT_OP, &mDefault->Header, sizeof (EFI_IFR_DEFAULT_2)) {
+ mDefault->Type = Type;
+ mDefault->DefaultId = DefaultId;
+ }
+
+ VOID SetDefaultId (IN UINT16 DefaultId) {
+ mDefault->DefaultId = DefaultId;
+ }
+
+ VOID SetType (IN UINT8 Type) {
+ mDefault->Type = Type;
+ }
+};
+
class CIfrValue : public CIfrObj, public CIfrOpHeader{
private:
EFI_IFR_VALUE *mValue;
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2012-09-27 02:47:43 UTC (rev 2551)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2012-09-27 10:54:08 UTC (rev 2552)
@@ -1455,28 +1455,42 @@
<<
BOOLEAN IsExp = FALSE;
EFI_IFR_TYPE_VALUE Val = gZeroEfiIfrTypeValue;
- CIfrDefault DObj;
+ CIfrDefault *DObj = NULL;
+ CIfrDefault2 *DObj2 = NULL;
EFI_DEFAULT_ID DefaultId = EFI_HII_DEFAULT_CLASS_STANDARD;
CHAR8 *VarStoreName = NULL;
EFI_VFR_VARSTORE_TYPE VarStoreType = EFI_VFR_VARSTORE_INVALID;
>>
- D:Default << DObj.SetLineNo(D->getLine()); >>
+ D:Default
(
(
- vfrStatementValue "," << IsExp = TRUE; DObj.SetScope (1); CIfrEnd EndObj1; EndObj1.SetLineNo(D->getLine()); >>
- | "=" vfrConstantValueField[_GET_CURRQEST_DATATYPE()] > [Val] "," <<
+ "=" vfrConstantValueField[_GET_CURRQEST_DATATYPE()] > [Val] ","
+ <<
if (gCurrentMinMaxData != NULL && gCurrentMinMaxData->IsNumericOpcode()) {
//check default value is valid for Numeric Opcode
if (Val.u64 < gCurrentMinMaxData->GetMinData(_GET_CURRQEST_DATATYPE()) || Val.u64 > gCurrentMinMaxData->GetMaxData(_GET_CURRQEST_DATATYPE())) {
_PCATCH (VFR_RETURN_INVALID_PARAMETER, D->getLine(), "Numeric default value must be between MinValue and MaxValue.");
}
}
- DObj.SetType (_GET_CURRQEST_DATATYPE());
- DObj.SetValue(Val);
+ DObj = new CIfrDefault;
+ DObj->SetLineNo(D->getLine());
+ DObj->SetType (_GET_CURRQEST_DATATYPE());
+ DObj->SetValue(Val);
>>
+ | << IsExp = TRUE; DObj2 = new CIfrDefault2; DObj2->SetLineNo(D->getLine()); DObj2->SetScope (1); >>
+ vfrStatementValue "," << CIfrEnd EndObj1; EndObj1.SetLineNo(D->getLine()); >>
)
{
- DefaultStore "=" SN:StringIdentifier "," << _PCATCH(mCVfrDefaultStore.GetDefaultId (SN->getText(), &DefaultId), SN); DObj.SetDefaultId (DefaultId); >>
+ DefaultStore "=" SN:StringIdentifier "," <<
+ _PCATCH(mCVfrDefaultStore.GetDefaultId (SN->getText(), &DefaultId), SN);
+ if (DObj != NULL) {
+ DObj->SetDefaultId (DefaultId);
+ }
+
+ if (DObj2 != NULL) {
+ DObj2->SetDefaultId (DefaultId);
+ }
+ >>
}
<<
_PCATCH(mCVfrDataStorage.GetVarStoreName (_GET_CURRQEST_VARTINFO().mVarStoreId, &VarStoreName), D->getLine());
@@ -1491,6 +1505,9 @@
D->getLine()
);
}
+
+ if (DObj != NULL) {delete DObj;}
+ if (DObj2 != NULL) {delete DObj2;}
>>
)
;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yd...@us...> - 2012-10-30 02:11:24
|
Revision: 2561
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2561&view=rev
Author: ydong10
Date: 2012-10-30 02:11:17 +0000 (Tue, 30 Oct 2012)
Log Message:
-----------
Correct the definition for Modal opcode, from EFI_IFR_MODAL to EFI_IFR_MODAL_TAG
Signed-off-by: Eric Dong <eri...@in...>
Reviewed-by: Liming Gao <lim...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
Modified: trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
===================================================================
--- trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h 2012-10-25 23:14:06 UTC (rev 2560)
+++ trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h 2012-10-30 02:11:17 UTC (rev 2561)
@@ -783,9 +783,9 @@
EFI_IMAGE_ID Id;
} EFI_IFR_IMAGE;
-typedef struct _EFI_IFR_MODAL {
+typedef struct _EFI_IFR_MODAL_TAG {
EFI_IFR_OP_HEADER Header;
-} EFI_IFR_MODAL;
+} EFI_IFR_MODAL_TAG;
typedef struct _EFI_IFR_LOCKED {
EFI_IFR_OP_HEADER Header;
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp 2012-10-25 23:14:06 UTC (rev 2560)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp 2012-10-30 02:11:17 UTC (rev 2561)
@@ -1657,7 +1657,7 @@
{ sizeof (EFI_IFR_CATENATE), 0 }, // EFI_IFR_CATENATE_OP
{ sizeof (EFI_IFR_GUID), 0 }, // EFI_IFR_GUID_OP
{ sizeof (EFI_IFR_SECURITY), 0 }, // EFI_IFR_SECURITY_OP - 0x60
- { sizeof (EFI_IFR_MODAL), 0}, // EFI_IFR_MODAL_OP - 0x61
+ { sizeof (EFI_IFR_MODAL_TAG), 0}, // EFI_IFR_MODAL_TAG_OP - 0x61
{ sizeof (EFI_IFR_REFRESH_ID), 0}, // EFI_IFR_REFRESH_ID_OP - 0x62
};
@@ -1681,7 +1681,7 @@
"EFI_IFR_STRING_REF1","EFI_IFR_STRING_REF2", "EFI_IFR_CONDITIONAL", "EFI_IFR_QUESTION_REF3", "EFI_IFR_ZERO", "EFI_IFR_ONE",
"EFI_IFR_ONES", "EFI_IFR_UNDEFINED", "EFI_IFR_LENGTH", "EFI_IFR_DUP", "EFI_IFR_THIS", "EFI_IFR_SPAN",
"EFI_IFR_VALUE", "EFI_IFR_DEFAULT", "EFI_IFR_DEFAULTSTORE", "EFI_IFR_FORM_MAP", "EFI_IFR_CATENATE", "EFI_IFR_GUID",
- "EFI_IFR_SECURITY", "EFI_IFR_MODAL", "EFI_IFR_REFRESH_ID",
+ "EFI_IFR_SECURITY", "EFI_IFR_MODAL_TAG", "EFI_IFR_REFRESH_ID",
};
VOID
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2012-10-25 23:14:06 UTC (rev 2560)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2012-10-30 02:11:17 UTC (rev 2561)
@@ -880,7 +880,7 @@
class CIfrModal : public CIfrObj, public CIfrOpHeader {
private:
- EFI_IFR_MODAL *mModal;
+ EFI_IFR_MODAL_TAG *mModal;
public:
CIfrModal () : CIfrObj (EFI_IFR_MODAL_TAG_OP, (CHAR8 **)&mModal),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <oli...@us...> - 2013-05-07 15:22:00
|
Revision: 2581
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2581&view=rev
Author: oliviermartin
Date: 2013-05-07 15:21:51 +0000 (Tue, 07 May 2013)
Log Message:
-----------
Enable native ARM builds of BaseTools
This patch, incoorporating some earlier work by Joh...@li...,
enables full support for the BaseTools on ARM platforms - for building
edk2 natively under ARM Linux.
Signed-off-by: lei...@li...
Reviewed-by: Olivier Martin <oli...@ar...>
Modified Paths:
--------------
trunk/BaseTools/Source/C/Makefiles/header.makefile
Added Paths:
-----------
trunk/BaseTools/Source/C/Include/Arm/
trunk/BaseTools/Source/C/Include/Arm/ProcessorBind.h
Added: trunk/BaseTools/Source/C/Include/Arm/ProcessorBind.h
===================================================================
--- trunk/BaseTools/Source/C/Include/Arm/ProcessorBind.h (rev 0)
+++ trunk/BaseTools/Source/C/Include/Arm/ProcessorBind.h 2013-05-07 15:21:51 UTC (rev 2581)
@@ -0,0 +1,158 @@
+/** @file
+ Processor or Compiler specific defines and types for ARM.
+
+ Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+ Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
+ 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.
+
+**/
+
+#ifndef __PROCESSOR_BIND_H__
+#define __PROCESSOR_BIND_H__
+
+///
+/// Define the processor type so other code can make processor based choices
+///
+#define MDE_CPU_ARM
+
+//
+// Make sure we are using the correct packing rules per EFI specification
+//
+#ifndef __GNUC__
+#pragma pack()
+#endif
+
+#if _MSC_EXTENSIONS
+ //
+ // use Microsoft* C complier dependent integer width types
+ //
+ typedef unsigned __int64 UINT64;
+ typedef __int64 INT64;
+ typedef unsigned __int32 UINT32;
+ typedef __int32 INT32;
+ typedef unsigned short UINT16;
+ typedef unsigned short CHAR16;
+ typedef short INT16;
+ typedef unsigned char BOOLEAN;
+ typedef unsigned char UINT8;
+ typedef char CHAR8;
+ typedef signed char INT8;
+#else
+ //
+ // Assume standard ARM alignment.
+ //
+ typedef unsigned long long UINT64;
+ typedef long long INT64;
+ typedef unsigned int UINT32;
+ typedef int INT32;
+ typedef unsigned short UINT16;
+ typedef unsigned short CHAR16;
+ typedef short INT16;
+ typedef unsigned char BOOLEAN;
+ typedef unsigned char UINT8;
+ typedef char CHAR8;
+ typedef signed char INT8;
+
+ #define UINT8_MAX 0xff
+#endif
+
+///
+/// Unsigned value of native width. (4 bytes on supported 32-bit processor instructions,
+/// 8 bytes on supported 64-bit processor instructions)
+///
+typedef UINT32 UINTN;
+
+///
+/// Signed value of native width. (4 bytes on supported 32-bit processor instructions,
+/// 8 bytes on supported 64-bit processor instructions)
+///
+typedef INT32 INTN;
+
+//
+// Processor specific defines
+//
+
+///
+/// A value of native width with the highest bit set.
+///
+#define MAX_BIT 0x80000000
+
+///
+/// A value of native width with the two highest bits set.
+///
+#define MAX_2_BITS 0xC0000000
+
+///
+/// Maximum legal ARM address
+///
+#define MAX_ADDRESS 0xFFFFFFFF
+
+///
+/// The stack alignment required for ARM
+///
+#define CPU_STACK_ALIGNMENT sizeof(UINT64)
+
+//
+// Modifier to ensure that all protocol member functions and EFI intrinsics
+// use the correct C calling convention. All protocol member functions and
+// EFI intrinsics are required to modify their member functions with EFIAPI.
+//
+#define EFIAPI
+
+#if defined(__GNUC__)
+ ///
+ /// For GNU assembly code, .global or .globl can declare global symbols.
+ /// Define this macro to unify the usage.
+ ///
+ #define ASM_GLOBAL .globl
+
+ #if !defined(__APPLE__)
+ ///
+ /// ARM EABI defines that the linker should not manipulate call relocations
+ /// (do bl/blx conversion) unless the target symbol has function type.
+ /// CodeSourcery 2010.09 started requiring the .type to function properly
+ ///
+ #define INTERWORK_FUNC(func__) .type ASM_PFX(func__), %function
+
+ #define GCC_ASM_EXPORT(func__) \
+ .global _CONCATENATE (__USER_LABEL_PREFIX__, func__) ;\
+ .type ASM_PFX(func__), %function
+
+ #define GCC_ASM_IMPORT(func__) \
+ .extern _CONCATENATE (__USER_LABEL_PREFIX__, func__)
+
+ #else
+ //
+ // .type not supported by Apple Xcode tools
+ //
+ #define INTERWORK_FUNC(func__)
+
+ #define GCC_ASM_EXPORT(func__) \
+ .globl _CONCATENATE (__USER_LABEL_PREFIX__, func__) \
+
+ #define GCC_ASM_IMPORT(name)
+
+ #endif
+#endif
+
+/**
+ Return the pointer to the first instruction of a function given a function pointer.
+ On ARM CPU architectures, these two pointer values are the same,
+ so the implementation of this macro is very simple.
+
+ @param FunctionPointer A pointer to a function.
+
+ @return The pointer to the first instruction of a function given a function pointer.
+
+**/
+#define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)
+
+#endif
+
+
Modified: trunk/BaseTools/Source/C/Makefiles/header.makefile
===================================================================
--- trunk/BaseTools/Source/C/Makefiles/header.makefile 2013-05-07 15:13:32 UTC (rev 2580)
+++ trunk/BaseTools/Source/C/Makefiles/header.makefile 2013-05-07 15:21:51 UTC (rev 2581)
@@ -4,6 +4,7 @@
# ARCH = x86_64 or x64 for EM64T build
# ARCH = ia32 or IA32 for IA32 build
# ARCH = ia64 or IA64 for IA64 build
+# ARCH = Arm or ARM for ARM build
#
# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
@@ -34,6 +35,10 @@
ARCH_INCLUDE = -I $(MAKEROOT)/Include/X64/
endif
+ifeq ($(ARCH), ARM)
+ARCH_INCLUDE = -I $(MAKEROOT)/Include/Arm/
+endif
+
INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE)
CPPFLAGS = $(INCLUDE)
CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fno-merge-constants -nostdlib -Wall -Werror -c -g
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yd...@us...> - 2013-08-20 07:39:42
|
Revision: 2600
http://sourceforge.net/p/edk2-buildtools/code/2600
Author: ydong10
Date: 2013-08-20 07:39:40 +0000 (Tue, 20 Aug 2013)
Log Message:
-----------
Add support for the warningif opcode.
Signed-off-by: Eric Dong <eri...@in...>
Reviewed-by: Liming Gao <lim...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
Modified: trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
===================================================================
--- trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h 2013-08-15 05:08:12 UTC (rev 2599)
+++ trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h 2013-08-20 07:39:40 UTC (rev 2600)
@@ -3,7 +3,7 @@
IFR is primarily consumed by the EFI presentation engine, and produced by EFI
internal application and drivers as well as all add-in card option-ROM drivers
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License which accompanies this
@@ -691,6 +691,7 @@
#define EFI_IFR_SECURITY_OP 0x60
#define EFI_IFR_MODAL_TAG_OP 0x61
#define EFI_IFR_REFRESH_ID_OP 0x62
+#define EFI_IFR_WARNING_IF_OP 0x63
typedef struct _EFI_IFR_OP_HEADER {
@@ -1015,6 +1016,12 @@
EFI_STRING_ID Error;
} EFI_IFR_NO_SUBMIT_IF;
+typedef struct _EFI_IFR_WARNING_IF {
+ EFI_IFR_OP_HEADER Header;
+ EFI_STRING_ID Warning;
+ UINT8 TimeOut;
+} EFI_IFR_WARNING_IF;
+
typedef struct _EFI_IFR_REFRESH {
EFI_IFR_OP_HEADER Header;
UINT8 RefreshInterval;
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp 2013-08-15 05:08:12 UTC (rev 2599)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp 2013-08-20 07:39:40 UTC (rev 2600)
@@ -1673,6 +1673,7 @@
{ sizeof (EFI_IFR_SECURITY), 0 }, // EFI_IFR_SECURITY_OP - 0x60
{ sizeof (EFI_IFR_MODAL_TAG), 0}, // EFI_IFR_MODAL_TAG_OP - 0x61
{ sizeof (EFI_IFR_REFRESH_ID), 0}, // EFI_IFR_REFRESH_ID_OP - 0x62
+ { sizeof (EFI_IFR_WARNING_IF), 1}, // EFI_IFR_WARNING_IF_OP - 0x63
};
#ifdef CIFROBJ_DEUBG
@@ -1695,7 +1696,7 @@
"EFI_IFR_STRING_REF1","EFI_IFR_STRING_REF2", "EFI_IFR_CONDITIONAL", "EFI_IFR_QUESTION_REF3", "EFI_IFR_ZERO", "EFI_IFR_ONE",
"EFI_IFR_ONES", "EFI_IFR_UNDEFINED", "EFI_IFR_LENGTH", "EFI_IFR_DUP", "EFI_IFR_THIS", "EFI_IFR_SPAN",
"EFI_IFR_VALUE", "EFI_IFR_DEFAULT", "EFI_IFR_DEFAULTSTORE", "EFI_IFR_FORM_MAP", "EFI_IFR_CATENATE", "EFI_IFR_GUID",
- "EFI_IFR_SECURITY", "EFI_IFR_MODAL_TAG", "EFI_IFR_REFRESH_ID",
+ "EFI_IFR_SECURITY", "EFI_IFR_MODAL_TAG", "EFI_IFR_REFRESH_ID", "EFI_IFR_WARNING_IF",
};
VOID
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2013-08-15 05:08:12 UTC (rev 2599)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2013-08-20 07:39:40 UTC (rev 2600)
@@ -1612,6 +1612,26 @@
}
};
+class CIfrWarningIf : public CIfrObj, public CIfrOpHeader {
+private:
+ EFI_IFR_WARNING_IF *mWarningIf;
+
+public:
+ CIfrWarningIf () : CIfrObj (EFI_IFR_WARNING_IF_OP, (CHAR8 **)&mWarningIf),
+ CIfrOpHeader (EFI_IFR_WARNING_IF_OP, &mWarningIf->Header) {
+ mWarningIf->Warning = EFI_STRING_ID_INVALID;
+ mWarningIf->TimeOut = 0;
+ }
+
+ VOID SetWarning (IN EFI_STRING_ID Warning) {
+ mWarningIf->Warning = Warning;
+ }
+
+ VOID SetTimeOut (IN UINT8 TimeOut) {
+ mWarningIf->TimeOut = TimeOut;
+ }
+};
+
class CIfrNoSubmitIf : public CIfrObj, public CIfrOpHeader {
private:
EFI_IFR_NO_SUBMIT_IF *mNoSubmitIf;
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2013-08-15 05:08:12 UTC (rev 2599)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2013-08-20 07:39:40 UTC (rev 2600)
@@ -184,6 +184,7 @@
#token Goto("goto") "goto"
#token FormSetGuid("formsetguid") "formsetguid"
#token InconsistentIf("inconsistentif") "inconsistentif"
+#token WarningIf("warningif") "warningif"
#token NoSubmitIf("nosubmitif") "nosubmitif"
#token EndIf("endif") "endif"
#token Key("key") "key"
@@ -2627,7 +2628,8 @@
vfrStatementRefresh |
vfrStatementVarstoreDevice |
vfrStatementExtension |
- vfrStatementRefreshEvent
+ vfrStatementRefreshEvent |
+ vfrStatementWarningIf
;
vfrStatementQuestionTagList :
@@ -2825,6 +2827,15 @@
E:EndIf << CRT_END_OP (E); >>
;
+vfrStatementWarningIf :
+ << CIfrWarningIf WIObj; >>
+ L:WarningIf << WIObj.SetLineNo(L->getLine()); >>
+ Prompt "=" "STRING_TOKEN" "\(" S:Number "\)" "," << WIObj.SetWarning (_STOSID(S->getText())); >>
+ {Timeout "=" T:Number "," << WIObj.SetTimeOut (_STOU8(T->getText())); >>}
+ vfrStatementExpression[0]
+ E:EndIf << CRT_END_OP (E); >>
+ ;
+
vfrStatementDisableIfQuest :
<<
CIfrDisableIf DIObj;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yz...@us...> - 2013-11-27 05:58:57
|
Revision: 2617
http://sourceforge.net/p/edk2-buildtools/code/2617
Author: yzhen22
Date: 2013-11-27 05:58:54 +0000 (Wed, 27 Nov 2013)
Log Message:
-----------
update EFI_SIGNATURE_x to SIGNATURE_x which is more common version to keep in step with other pkg
Signed-off-by: Yuxin Zheng <yux...@in...>
Reviewed-by: Chen, Hesheng <hes...@in...>
Reviewed-by: Liu, Yingke D <Yin...@in... >
Reviewed-by: Feng, Bob C <bob...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.h
trunk/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h
trunk/BaseTools/Source/C/Include/Common/UefiBaseTypes.h
trunk/BaseTools/Source/C/Include/IndustryStandard/PeImage.h
trunk/BaseTools/Source/C/Include/IndustryStandard/pci22.h
Modified: trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.h
===================================================================
--- trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.h 2013-11-27 05:55:10 UTC (rev 2616)
+++ trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.h 2013-11-27 05:58:54 UTC (rev 2617)
@@ -168,7 +168,7 @@
// VTF (Firmware Volume Top File) signatures
//
#define IA32_X64_VTF_SIGNATURE_OFFSET 0x14
-#define IA32_X64_VTF0_SIGNATURE EFI_SIGNATURE_32('V','T','F',0)
+#define IA32_X64_VTF0_SIGNATURE SIGNATURE_32('V','T','F',0)
//
// Defines to calculate the offset for PEI CORE entry points
Modified: trunk/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h
===================================================================
--- trunk/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h 2013-11-27 05:55:10 UTC (rev 2616)
+++ trunk/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h 2013-11-27 05:58:54 UTC (rev 2617)
@@ -111,7 +111,7 @@
EFI_FV_BLOCK_MAP_ENTRY BlockMap[1];
} EFI_FIRMWARE_VOLUME_HEADER;
-#define EFI_FVH_SIGNATURE EFI_SIGNATURE_32 ('_', 'F', 'V', 'H')
+#define EFI_FVH_SIGNATURE SIGNATURE_32 ('_', 'F', 'V', 'H')
///
/// Firmware Volume Header Revision definition
Modified: trunk/BaseTools/Source/C/Include/Common/UefiBaseTypes.h
===================================================================
--- trunk/BaseTools/Source/C/Include/Common/UefiBaseTypes.h 2013-11-27 05:55:10 UTC (rev 2616)
+++ trunk/BaseTools/Source/C/Include/Common/UefiBaseTypes.h 2013-11-27 05:58:54 UTC (rev 2617)
@@ -1,7 +1,7 @@
/** @file
Defines data types and constants introduced in UEFI.
- Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License which accompanies this
@@ -146,10 +146,10 @@
//
// Define macros to build data structure signatures from characters.
//
-#define EFI_SIGNATURE_16(A, B) ((A) | (B << 8))
-#define EFI_SIGNATURE_32(A, B, C, D) (EFI_SIGNATURE_16 (A, B) | (EFI_SIGNATURE_16 (C, D) << 16))
-#define EFI_SIGNATURE_64(A, B, C, D, E, F, G, H) \
- (EFI_SIGNATURE_32 (A, B, C, D) | ((UINT64) (EFI_SIGNATURE_32 (E, F, G, H)) << 32))
+#define SIGNATURE_16(A, B) ((A) | (B << 8))
+#define SIGNATURE_32(A, B, C, D) (SIGNATURE_16 (A, B) | (SIGNATURE_16 (C, D) << 16))
+#define SIGNATURE_64(A, B, C, D, E, F, G, H) \
+ (SIGNATURE_32 (A, B, C, D) | ((UINT64) (SIGNATURE_32 (E, F, G, H)) << 32))
//
Modified: trunk/BaseTools/Source/C/Include/IndustryStandard/PeImage.h
===================================================================
--- trunk/BaseTools/Source/C/Include/IndustryStandard/PeImage.h 2013-11-27 05:55:10 UTC (rev 2616)
+++ trunk/BaseTools/Source/C/Include/IndustryStandard/PeImage.h 2013-11-27 05:58:54 UTC (rev 2617)
@@ -4,7 +4,7 @@
@bug Fix text - doc as defined in MSFT EFI specification.
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available
@@ -648,7 +648,7 @@
///
/// Debug Data Structure defined by Apple Mach-O to Coff utility
///
-#define CODEVIEW_SIGNATURE_MTOC EFI_SIGNATURE_32('M', 'T', 'O', 'C')
+#define CODEVIEW_SIGNATURE_MTOC SIGNATURE_32('M', 'T', 'O', 'C')
typedef struct {
UINT32 Signature; ///< "MTOC"
EFI_GUID MachOUuid;
Modified: trunk/BaseTools/Source/C/Include/IndustryStandard/pci22.h
===================================================================
--- trunk/BaseTools/Source/C/Include/IndustryStandard/pci22.h 2013-11-27 05:55:10 UTC (rev 2616)
+++ trunk/BaseTools/Source/C/Include/IndustryStandard/pci22.h 2013-11-27 05:58:54 UTC (rev 2617)
@@ -1,7 +1,7 @@
/** @file
Support for PCI 2.2 standard.
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License which accompanies this
@@ -335,7 +335,7 @@
#pragma pack()
#define PCI_EXPANSION_ROM_HEADER_SIGNATURE 0xaa55
-#define PCI_DATA_STRUCTURE_SIGNATURE EFI_SIGNATURE_32 ('P', 'C', 'I', 'R')
+#define PCI_DATA_STRUCTURE_SIGNATURE SIGNATURE_32 ('P', 'C', 'I', 'R')
#define PCI_CODE_TYPE_PCAT_IMAGE 0x00
#define PCI_CODE_TYPE_EFI_IMAGE 0x03
#define EFI_PCI_EXPANSION_ROM_HEADER_COMPRESSED 0x0001
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yi...@us...> - 2014-02-20 08:55:39
|
Revision: 2650
http://sourceforge.net/p/edk2-buildtools/code/2650
Author: yingke
Date: 2014-02-20 08:55:36 +0000 (Thu, 20 Feb 2014)
Log Message:
-----------
Large file supported by VolInfo.
Reviewed-by: Liming Gao <lim...@in...>
Reviewed-by: Star Zeng <zen...@in...>
Signed-off-by: Yingke Liu <yin...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
trunk/BaseTools/Source/C/Common/FirmwareVolumeBufferLib.h
trunk/BaseTools/Source/C/VolInfo/VolInfo.c
Modified: trunk/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
===================================================================
--- trunk/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c 2014-01-24 00:48:22 UTC (rev 2649)
+++ trunk/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c 2014-02-20 08:55:36 UTC (rev 2650)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 1999 - 2008, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -32,7 +32,38 @@
) \
)
+STATIC
+UINT32
+FvBufGetSecHdrLen(
+ IN EFI_COMMON_SECTION_HEADER *SectionHeader
+ )
+{
+ if (SectionHeader == NULL) {
+ return 0;
+ }
+ if (FvBufExpand3ByteSize(SectionHeader->Size) == 0xffffff) {
+ return sizeof(EFI_COMMON_SECTION_HEADER2);
+ }
+ return sizeof(EFI_COMMON_SECTION_HEADER);
+}
+STATIC
+UINT32
+FvBufGetSecFileLen (
+ IN EFI_COMMON_SECTION_HEADER *SectionHeader
+ )
+{
+ UINT32 Length;
+ if (SectionHeader == NULL) {
+ return 0;
+ }
+ Length = FvBufExpand3ByteSize(SectionHeader->Size);
+ if (Length == 0xffffff) {
+ Length = ((EFI_COMMON_SECTION_HEADER2 *)SectionHeader)->ExtendedSize;
+ }
+ return Length;
+}
+
//
// Local prototypes
//
@@ -92,7 +123,7 @@
return Status;
}
- FileToRmLength = FvBufExpand3ByteSize (FileToRm->Size);
+ FileToRmLength = FvBufGetFfsFileSize (FileToRm);
CommonLibBinderSetMem (
FileToRm,
@@ -218,7 +249,7 @@
EFI_FFS_FILE_STATE StateBackup;
UINT32 FileSize;
- FileSize = FvBufExpand3ByteSize (File->Size);
+ FileSize = FvBufGetFfsFileSize (File);
//
// Fill in checksums and state, they must be 0 for checksumming.
@@ -231,13 +262,13 @@
File->IntegrityCheck.Checksum.Header =
FvBufCalculateChecksum8 (
(UINT8 *) File,
- sizeof (EFI_FFS_FILE_HEADER)
+ FvBufGetFfsHeaderSize (File)
);
if (File->Attributes & FFS_ATTRIB_CHECKSUM) {
File->IntegrityCheck.Checksum.File = FvBufCalculateChecksum8 (
- (VOID*)(File + 1),
- FileSize - sizeof (EFI_FFS_FILE_HEADER)
+ (VOID*)((UINT8 *)File + FvBufGetFfsHeaderSize (File)),
+ FileSize - FvBufGetFfsHeaderSize (File)
);
} else {
File->IntegrityCheck.Checksum.File = FFS_FIXED_CHECKSUM;
@@ -568,7 +599,7 @@
}
FvbAttributes = hdr->Attributes;
- newSize = FvBufExpand3ByteSize (((EFI_FFS_FILE_HEADER*)File)->Size);
+ newSize = FvBufGetFfsFileSize ((EFI_FFS_FILE_HEADER*)File);
for(
offset = (UINTN)ALIGN_POINTER (hdr->HeaderLength, 8);
@@ -587,7 +618,7 @@
// BUGBUG: Need to make sure that the new file does not already
// exist.
- fsize = FvBufExpand3ByteSize (fhdr->Size);
+ fsize = FvBufGetFfsFileSize (fhdr);
if (fsize == 0 || (offset + fsize > fvSize)) {
return EFI_VOLUME_CORRUPTED;
}
@@ -725,7 +756,7 @@
}
erasedUint8 = (UINT8)((hdr->Attributes & EFI_FVB2_ERASE_POLARITY) ? 0xFF : 0);
- NewFileSize = FvBufExpand3ByteSize (((EFI_FFS_FILE_HEADER*)File)->Size);
+ NewFileSize = FvBufGetFfsFileSize ((EFI_FFS_FILE_HEADER*)File);
if (NewFileSize != (UINTN)ALIGN_POINTER (NewFileSize, 8)) {
return EFI_INVALID_PARAMETER;
@@ -739,7 +770,7 @@
LastFileSize = 0;
do {
Status = FvBufFindNextFile (Fv, &Key, (VOID **)&LastFile);
- LastFileSize = FvBufExpand3ByteSize (((EFI_FFS_FILE_HEADER*)File)->Size);
+ LastFileSize = FvBufGetFfsFileSize ((EFI_FFS_FILE_HEADER*)File);
} while (!EFI_ERROR (Status));
//
@@ -812,6 +843,64 @@
}
UINT32
+FvBufGetFfsFileSize (
+ IN EFI_FFS_FILE_HEADER *Ffs
+ )
+/*++
+
+Routine Description:
+
+ Get the FFS file size.
+
+Arguments:
+
+ Ffs - Pointer to FFS header
+
+Returns:
+
+ UINT32
+
+--*/
+{
+ if (Ffs == NULL) {
+ return 0;
+ }
+ if (Ffs->Attributes & FFS_ATTRIB_LARGE_FILE) {
+ return ((EFI_FFS_FILE_HEADER2 *)Ffs)->ExtendedSize;
+ }
+ return FvBufExpand3ByteSize(Ffs->Size);
+}
+
+UINT32
+FvBufGetFfsHeaderSize (
+ IN EFI_FFS_FILE_HEADER *Ffs
+ )
+/*++
+
+Routine Description:
+
+ Get the FFS header size.
+
+Arguments:
+
+ Ffs - Pointer to FFS header
+
+Returns:
+
+ UINT32
+
+--*/
+{
+ if (Ffs == NULL) {
+ return 0;
+ }
+ if (Ffs->Attributes & FFS_ATTRIB_LARGE_FILE) {
+ return sizeof(EFI_FFS_FILE_HEADER2);
+ }
+ return sizeof(EFI_FFS_FILE_HEADER);
+}
+
+UINT32
FvBufExpand3ByteSize (
IN VOID* Size
)
@@ -897,7 +986,7 @@
) {
fhdr = (EFI_FFS_FILE_HEADER*) ((UINT8*)hdr + *Key);
- fsize = FvBufExpand3ByteSize (fhdr->Size);
+ fsize = FvBufGetFfsFileSize (fhdr);
if (!EFI_TEST_FFS_ATTRIBUTES_BIT(
FvbAttributes,
@@ -1089,8 +1178,8 @@
//
// Raw filetypes don't have sections, so we just return the raw data
//
- *RawData = (VOID*)(File + 1);
- *RawDataSize = FvBufExpand3ByteSize (File->Size) - sizeof (*File);
+ *RawData = (VOID*)((UINT8 *)File + FvBufGetFfsHeaderSize (File));
+ *RawDataSize = FvBufGetFfsFileSize (File) - FvBufGetFfsHeaderSize (File);
return EFI_SUCCESS;
}
@@ -1102,9 +1191,9 @@
return Status;
}
- *RawData = (VOID*)(Section + 1);
+ *RawData = (VOID*)((UINT8 *)Section + FvBufGetSecHdrLen(Section));
*RawDataSize =
- FvBufExpand3ByteSize (Section->Size) - sizeof (*Section);
+ FvBufGetSecFileLen (Section) - FvBufGetSecHdrLen(Section);
return EFI_SUCCESS;
@@ -1144,16 +1233,28 @@
UINT32 NewFileSize;
EFI_RAW_SECTION* NewSection;
UINT32 NewSectionSize;
+ UINT32 FfsHdrLen;
+ UINT32 SecHdrLen;
//
// The section size is the DataSize + the size of the section header
//
NewSectionSize = (UINT32)sizeof (EFI_RAW_SECTION) + (UINT32)RawDataSize;
+ SecHdrLen = sizeof (EFI_RAW_SECTION);
+ if (NewSectionSize >= MAX_SECTION_SIZE) {
+ NewSectionSize = (UINT32)sizeof (EFI_RAW_SECTION2) + (UINT32)RawDataSize;
+ SecHdrLen = sizeof (EFI_RAW_SECTION2);
+ }
//
// The file size is the size of the file header + the section size
//
NewFileSize = sizeof (EFI_FFS_FILE_HEADER) + NewSectionSize;
+ FfsHdrLen = sizeof (EFI_FFS_FILE_HEADER);
+ if (NewFileSize >= MAX_FFS_SIZE) {
+ NewFileSize = sizeof (EFI_FFS_FILE_HEADER2) + NewSectionSize;
+ FfsHdrLen = sizeof (EFI_FFS_FILE_HEADER2);
+ }
//
// Try to allocate a buffer to build the new FFS file in
@@ -1167,24 +1268,35 @@
//
// The NewSection follow right after the FFS file header
//
- NewSection = (EFI_RAW_SECTION*)(NewFile + 1);
- FvBufCompact3ByteSize (NewSection->Size, NewSectionSize);
+ NewSection = (EFI_RAW_SECTION*)((UINT8*)NewFile + FfsHdrLen);
+ if (NewSectionSize >= MAX_SECTION_SIZE) {
+ FvBufCompact3ByteSize (NewSection->Size, 0xffffff);
+ ((EFI_RAW_SECTION2 *)NewSection)->ExtendedSize = NewSectionSize;
+ } else {
+ FvBufCompact3ByteSize (NewSection->Size, NewSectionSize);
+ }
NewSection->Type = EFI_SECTION_RAW;
//
// Copy the actual file data into the buffer
//
- CommonLibBinderCopyMem (NewSection + 1, RawData, RawDataSize);
+ CommonLibBinderCopyMem ((UINT8 *)NewSection + SecHdrLen, RawData, RawDataSize);
//
// Initialize the FFS file header
//
CommonLibBinderCopyMem (&NewFile->Name, Filename, sizeof (EFI_GUID));
- FvBufCompact3ByteSize (NewFile->Size, NewFileSize);
+ NewFile->Attributes = 0;
+ if (NewFileSize >= MAX_FFS_SIZE) {
+ FvBufCompact3ByteSize (NewFile->Size, 0x0);
+ ((EFI_FFS_FILE_HEADER2 *)NewFile)->ExtendedSize = NewFileSize;
+ NewFile->Attributes |= FFS_ATTRIB_LARGE_FILE;
+ } else {
+ FvBufCompact3ByteSize (NewFile->Size, NewFileSize);
+ }
NewFile->Type = EFI_FV_FILETYPE_FREEFORM;
- NewFile->Attributes = 0;
NewFile->IntegrityCheck.Checksum.Header =
- FvBufCalculateChecksum8 ((UINT8*)NewFile, sizeof (*NewFile));
+ FvBufCalculateChecksum8 ((UINT8*)NewFile, FfsHdrLen);
NewFile->IntegrityCheck.Checksum.File = FFS_FIXED_CHECKSUM;
NewFile->State = (UINT8)~( EFI_FILE_HEADER_CONSTRUCTION |
EFI_FILE_HEADER_VALID |
@@ -1239,7 +1351,7 @@
}
sectionHdr = (EFI_COMMON_SECTION_HEADER*)((UINT8*)SectionsStart + *Key);
- sectionSize = FvBufExpand3ByteSize (sectionHdr->Size);
+ sectionSize = FvBufGetSecFileLen (sectionHdr);
if (sectionSize < sizeof (EFI_COMMON_SECTION_HEADER)) {
return EFI_NOT_FOUND;
@@ -1287,10 +1399,10 @@
UINTN TotalSectionsSize;
EFI_COMMON_SECTION_HEADER* NextSection;
- SectionStart = (VOID*)((UINTN)FfsFile + sizeof (EFI_FFS_FILE_HEADER));
+ SectionStart = (VOID*)((UINTN)FfsFile + FvBufGetFfsHeaderSize(FfsFile));
TotalSectionsSize =
- FvBufExpand3ByteSize (((EFI_FFS_FILE_HEADER*)FfsFile)->Size) -
- sizeof (EFI_FFS_FILE_HEADER);
+ FvBufGetFfsFileSize ((EFI_FFS_FILE_HEADER*)FfsFile) -
+ FvBufGetFfsHeaderSize(FfsFile);
Key = 0;
*Count = 0;
while (TRUE) {
@@ -1352,10 +1464,10 @@
UINTN TotalSectionsSize;
EFI_COMMON_SECTION_HEADER* NextSection;
- SectionStart = (VOID*)((UINTN)FfsFile + sizeof (EFI_FFS_FILE_HEADER));
+ SectionStart = (VOID*)((UINTN)FfsFile + FvBufGetFfsHeaderSize(FfsFile));
TotalSectionsSize =
- FvBufExpand3ByteSize (((EFI_FFS_FILE_HEADER*)FfsFile)->Size) -
- sizeof (EFI_FFS_FILE_HEADER);
+ FvBufGetFfsFileSize ((EFI_FFS_FILE_HEADER*)FfsFile) -
+ FvBufGetFfsHeaderSize(FfsFile);
Key = 0;
while (TRUE) {
Status = FvBufFindNextSection (
@@ -1436,7 +1548,7 @@
EndOfLastFile = (UINT8*)FvHdr + FvHdr->FvLength;
while (!EFI_ERROR (FvBufFindNextFile (Fv, &Key, (VOID **)&FileIt))) {
EndOfLastFile =
- (VOID*)((UINT8*)FileIt + FvBufExpand3ByteSize (FileIt->Size));
+ (VOID*)((UINT8*)FileIt + FvBufGetFfsFileSize (FileIt));
}
//
Modified: trunk/BaseTools/Source/C/Common/FirmwareVolumeBufferLib.h
===================================================================
--- trunk/BaseTools/Source/C/Common/FirmwareVolumeBufferLib.h 2014-01-24 00:48:22 UTC (rev 2649)
+++ trunk/BaseTools/Source/C/Common/FirmwareVolumeBufferLib.h 2014-02-20 08:55:36 UTC (rev 2650)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 1999 - 2008, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -82,6 +82,16 @@
IN VOID* Size
);
+UINT32
+FvBufGetFfsFileSize (
+ IN EFI_FFS_FILE_HEADER *Ffs
+ );
+
+UINT32
+FvBufGetFfsHeaderSize (
+ IN EFI_FFS_FILE_HEADER *Ffs
+ );
+
EFI_STATUS
FvBufExtend (
IN VOID **Fv,
Modified: trunk/BaseTools/Source/C/VolInfo/VolInfo.c
===================================================================
--- trunk/BaseTools/Source/C/VolInfo/VolInfo.c 2014-01-24 00:48:22 UTC (rev 2649)
+++ trunk/BaseTools/Source/C/VolInfo/VolInfo.c 2014-02-20 08:55:36 UTC (rev 2650)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 1999 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -975,22 +975,24 @@
UINT32 FileLength;
UINT8 FileState;
UINT8 Checksum;
- EFI_FFS_FILE_HEADER BlankHeader;
+ EFI_FFS_FILE_HEADER2 BlankHeader;
EFI_STATUS Status;
UINT8 GuidBuffer[PRINTED_GUID_BUFFER_SIZE];
+ UINT32 HeaderSize;
#if (PI_SPECIFICATION_VERSION < 0x00010000)
UINT16 *Tail;
#endif
//
// Check if we have free space
//
+ HeaderSize = FvBufGetFfsHeaderSize(FileHeader);
if (ErasePolarity) {
- memset (&BlankHeader, -1, sizeof (EFI_FFS_FILE_HEADER));
+ memset (&BlankHeader, -1, HeaderSize);
} else {
- memset (&BlankHeader, 0, sizeof (EFI_FFS_FILE_HEADER));
+ memset (&BlankHeader, 0, HeaderSize);
}
- if (memcmp (&BlankHeader, FileHeader, sizeof (EFI_FFS_FILE_HEADER)) == 0) {
+ if (memcmp (&BlankHeader, FileHeader, HeaderSize) == 0) {
return EFI_SUCCESS;
}
//
@@ -1008,7 +1010,7 @@
// PrintGuid (&FileHeader->Name);
// printf ("\n");
//
- FileLength = GetLength (FileHeader->Size);
+ FileLength = FvBufGetFfsFileSize (FileHeader);
printf ("File Offset: 0x%08X\n", (unsigned) ((UINTN) FileHeader - (UINTN) FvImage));
printf ("File Length: 0x%08X\n", (unsigned) FileLength);
printf ("File Attributes: 0x%02X\n", FileHeader->Attributes);
@@ -1031,7 +1033,7 @@
case EFI_FILE_HEADER_VALID:
printf (" EFI_FILE_HEADER_VALID\n");
- Checksum = CalculateSum8 ((UINT8 *) FileHeader, sizeof (EFI_FFS_FILE_HEADER));
+ Checksum = CalculateSum8 ((UINT8 *) FileHeader, HeaderSize);
Checksum = (UINT8) (Checksum - FileHeader->IntegrityCheck.Checksum.File);
Checksum = (UINT8) (Checksum - FileHeader->State);
if (Checksum != 0) {
@@ -1053,7 +1055,7 @@
//
// Calculate header checksum
//
- Checksum = CalculateSum8 ((UINT8 *) FileHeader, sizeof (EFI_FFS_FILE_HEADER));
+ Checksum = CalculateSum8 ((UINT8 *) FileHeader, HeaderSize);
Checksum = (UINT8) (Checksum - FileHeader->IntegrityCheck.Checksum.File);
Checksum = (UINT8) (Checksum - FileHeader->State);
if (Checksum != 0) {
@@ -1061,13 +1063,13 @@
return EFI_ABORTED;
}
- FileLength = GetLength (FileHeader->Size);
+ FileLength = FvBufGetFfsFileSize (FileHeader);
if (FileHeader->Attributes & FFS_ATTRIB_CHECKSUM) {
//
// Calculate file checksum
//
- Checksum = CalculateSum8 ((UINT8 *) (FileHeader + 1), FileLength - sizeof (EFI_FFS_FILE_HEADER));
+ Checksum = CalculateSum8 ((UINT8 *)FileHeader + HeaderSize, FileLength - HeaderSize);
Checksum = Checksum + FileHeader->IntegrityCheck.Checksum.File;
if (Checksum != 0) {
Error (NULL, 0, 0003, "error parsing FFS file", "FFS file with Guid %s has invalid file checksum", GuidBuffer);
@@ -1180,8 +1182,8 @@
// All other files have sections
//
Status = ParseSection (
- (UINT8 *) ((UINTN) FileHeader + sizeof (EFI_FFS_FILE_HEADER)),
- GetLength (FileHeader->Size) - sizeof (EFI_FFS_FILE_HEADER)
+ (UINT8 *) ((UINTN) FileHeader + HeaderSize),
+ FvBufGetFfsFileSize (FileHeader) - HeaderSize
);
if (EFI_ERROR (Status)) {
//
@@ -1225,6 +1227,7 @@
EFI_SECTION_TYPE Type;
UINT8 *Ptr;
UINT32 SectionLength;
+ UINT32 SectionHeaderLen;
CHAR8 *SectionName;
EFI_STATUS Status;
UINT32 ParsedLength;
@@ -1246,6 +1249,10 @@
CHAR8 *ToolOutputFile;
CHAR8 *SystemCommandFormatString;
CHAR8 *SystemCommand;
+ EFI_GUID *EfiGuid;
+ UINT16 DataOffset;
+ UINT16 Attributes;
+ UINT32 RealHdrLen;
ParsedLength = 0;
while (ParsedLength < BufferLength) {
@@ -1264,6 +1271,12 @@
continue;
}
+ //
+ // Get real section file size
+ //
+ SectionLength = GetSectionFileLength ((EFI_COMMON_SECTION_HEADER *) Ptr);
+ SectionHeaderLen = GetSectionHeaderLength((EFI_COMMON_SECTION_HEADER *)Ptr);
+
SectionName = SectionNameToStr (Type);
printf ("------------------------------------------------------------\n");
printf (" Type: %s\n Size: 0x%08X\n", SectionName, (unsigned) SectionLength);
@@ -1283,7 +1296,7 @@
break;
case EFI_SECTION_FIRMWARE_VOLUME_IMAGE:
- Status = PrintFvInfo (((EFI_FIRMWARE_VOLUME_IMAGE_SECTION*)Ptr) + 1, TRUE);
+ Status = PrintFvInfo (Ptr + SectionHeaderLen, TRUE);
if (EFI_ERROR (Status)) {
Error (NULL, 0, 0003, "printing of FV section contents failed", NULL);
return EFI_SECTION_ERROR;
@@ -1304,15 +1317,22 @@
break;
case EFI_SECTION_VERSION:
- printf (" Build Number: 0x%02X\n", ((EFI_VERSION_SECTION *) Ptr)->BuildNumber);
- printf (" Version Strg: %s\n", (char*) ((EFI_VERSION_SECTION *) Ptr)->VersionString);
+ printf (" Build Number: 0x%02X\n", *(UINT16 *)(Ptr + SectionHeaderLen));
+ printf (" Version Strg: %s\n", (char*) (Ptr + SectionHeaderLen + sizeof (UINT16)));
break;
case EFI_SECTION_COMPRESSION:
UncompressedBuffer = NULL;
- CompressedLength = SectionLength - sizeof (EFI_COMPRESSION_SECTION);
- UncompressedLength = ((EFI_COMPRESSION_SECTION *) Ptr)->UncompressedLength;
- CompressionType = ((EFI_COMPRESSION_SECTION *) Ptr)->CompressionType;
+ if (SectionHeaderLen == sizeof (EFI_COMMON_SECTION_HEADER)) {
+ RealHdrLen = sizeof(EFI_COMPRESSION_SECTION);
+ UncompressedLength = ((EFI_COMPRESSION_SECTION *)Ptr)->UncompressedLength;
+ CompressionType = ((EFI_COMPRESSION_SECTION *)Ptr)->CompressionType;
+ } else {
+ RealHdrLen = sizeof(EFI_COMPRESSION_SECTION2);
+ UncompressedLength = ((EFI_COMPRESSION_SECTION2 *)Ptr)->UncompressedLength;
+ CompressionType = ((EFI_COMPRESSION_SECTION2 *)Ptr)->CompressionType;
+ }
+ CompressedLength = SectionLength - RealHdrLen;
printf (" Uncompressed Length: 0x%08X\n", (unsigned) UncompressedLength);
if (CompressionType == EFI_NOT_COMPRESSED) {
@@ -1328,13 +1348,13 @@
return EFI_SECTION_ERROR;
}
- UncompressedBuffer = Ptr + sizeof (EFI_COMPRESSION_SECTION);
+ UncompressedBuffer = Ptr + RealHdrLen;
} else if (CompressionType == EFI_STANDARD_COMPRESSION) {
GetInfoFunction = EfiGetInfo;
DecompressFunction = EfiDecompress;
printf (" Compression Type: EFI_STANDARD_COMPRESSION\n");
- CompressedBuffer = Ptr + sizeof (EFI_COMPRESSION_SECTION);
+ CompressedBuffer = Ptr + RealHdrLen;
Status = GetInfoFunction (CompressedBuffer, CompressedLength, &DstSize, &ScratchSize);
if (EFI_ERROR (Status)) {
@@ -1387,16 +1407,25 @@
break;
case EFI_SECTION_GUID_DEFINED:
+ if (SectionHeaderLen == sizeof(EFI_COMMON_SECTION_HEADER)) {
+ EfiGuid = &((EFI_GUID_DEFINED_SECTION *) Ptr)->SectionDefinitionGuid;
+ DataOffset = ((EFI_GUID_DEFINED_SECTION *) Ptr)->DataOffset;
+ Attributes = ((EFI_GUID_DEFINED_SECTION *) Ptr)->Attributes;
+ } else {
+ EfiGuid = &((EFI_GUID_DEFINED_SECTION2 *) Ptr)->SectionDefinitionGuid;
+ DataOffset = ((EFI_GUID_DEFINED_SECTION2 *) Ptr)->DataOffset;
+ Attributes = ((EFI_GUID_DEFINED_SECTION2 *) Ptr)->Attributes;
+ }
printf (" SectionDefinitionGuid: ");
- PrintGuid (&((EFI_GUID_DEFINED_SECTION *) Ptr)->SectionDefinitionGuid);
+ PrintGuid (EfiGuid);
printf ("\n");
- printf (" DataOffset: 0x%04X\n", (unsigned) ((EFI_GUID_DEFINED_SECTION *) Ptr)->DataOffset);
- printf (" Attributes: 0x%04X\n", (unsigned) ((EFI_GUID_DEFINED_SECTION *) Ptr)->Attributes);
+ printf (" DataOffset: 0x%04X\n", (unsigned) DataOffset);
+ printf (" Attributes: 0x%04X\n", (unsigned) Attributes);
ExtractionTool =
LookupGuidedSectionToolPath (
mParsedGuidedSectionTools,
- &((EFI_GUID_DEFINED_SECTION *) Ptr)->SectionDefinitionGuid
+ EfiGuid
);
if (ExtractionTool != NULL) {
@@ -1427,8 +1456,8 @@
Status =
PutFileImage (
ToolInputFile,
- (CHAR8*) SectionBuffer + ((EFI_GUID_DEFINED_SECTION *) Ptr)->DataOffset,
- BufferLength - ((EFI_GUID_DEFINED_SECTION *) Ptr)->DataOffset
+ (CHAR8*) SectionBuffer + DataOffset,
+ BufferLength - DataOffset
);
system (SystemCommand);
@@ -1461,7 +1490,7 @@
// Check for CRC32 sections which we can handle internally if needed.
//
} else if (!CompareGuid (
- &((EFI_GUID_DEFINED_SECTION *) Ptr)->SectionDefinitionGuid,
+ EfiGuid,
&gEfiCrc32GuidedSectionExtractionProtocolGuid
)
) {
@@ -1469,8 +1498,8 @@
// CRC32 guided section
//
Status = ParseSection (
- SectionBuffer + ((EFI_GUID_DEFINED_SECTION *) Ptr)->DataOffset,
- BufferLength - ((EFI_GUID_DEFINED_SECTION *) Ptr)->DataOffset
+ SectionBuffer + DataOffset,
+ BufferLength - DataOffset
);
if (EFI_ERROR (Status)) {
Error (NULL, 0, 0003, "parse of CRC32 GUIDED section failed", NULL);
@@ -1540,8 +1569,8 @@
return EFI_SUCCESS;
}
- Ptr += sizeof (EFI_COMMON_SECTION_HEADER);
- SectionLength -= sizeof (EFI_COMMON_SECTION_HEADER);
+ Ptr += GetSectionHeaderLength((EFI_COMMON_SECTION_HEADER *)Ptr);
+ SectionLength -= GetSectionHeaderLength((EFI_COMMON_SECTION_HEADER *)Ptr);
while (SectionLength > 0) {
printf (" ");
switch (*Ptr) {
@@ -1809,7 +1838,7 @@
//
// Copyright declaration
//
- fprintf (stdout, "Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.\n\n");
+ fprintf (stdout, "Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.\n\n");
//
// Details Option
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|