Discussion:
[edk2] [patch] EDKII:Display engine should not depend on the framework code
Bi, Dandan
2015-06-05 03:35:27 UTC
Permalink
Display engine base on class opcode to detect whether in
frontpage form.Now remove class/subclass and use ClassGuid to
judge whether in frontpage form

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <***@intel.com>
---
.../Universal/BdsDxe/FrontPageVfr.Vfr | 4 +---
MdeModulePkg/Include/Guid/FormsetClassGuid.h | 25 ++++++++++++++++++++++
.../CustomizedDisplayLib/CustomizedDisplayLib.inf | 3 ++-
.../CustomizedDisplayLibInternal.c | 23 +++++++++++++++++++-
.../CustomizedDisplayLibInternal.h | 3 ++-
MdeModulePkg/MdeModulePkg.dec | 3 +++
MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c | 1 +
.../Universal/SetupBrowserDxe/Presentation.c | 17 +++++++++++++++
MdeModulePkg/Universal/SetupBrowserDxe/Setup.h | 1 +
9 files changed, 74 insertions(+), 6 deletions(-)
create mode 100644 MdeModulePkg/Include/Guid/FormsetClassGuid.h

diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr
index d5fe4f4..a2d92df 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr
@@ -1,10 +1,10 @@
///** @file
//
// Browser formset.
//
-// Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
+// Copyright (c) 2007 - 2015, 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
//
@@ -39,12 +39,10 @@
formset
guid = FRONT_PAGE_FORMSET_GUID,
title = STRING_TOKEN(STR_FRONT_PAGE_TITLE),
help = STRING_TOKEN(STR_NULL_STRING),
classguid = FRONT_PAGE_FORMSET_GUID,
- class = FRONT_PAGE_CLASS,
- subclass = FRONT_PAGE_SUBCLASS,
form formid = FRONT_PAGE_FORM_ID,
title = STRING_TOKEN(STR_FRONT_PAGE_TITLE);
banner
diff --git a/MdeModulePkg/Include/Guid/FormsetClassGuid.h b/MdeModulePkg/Include/Guid/FormsetClassGuid.h
new file mode 100644
index 0000000..1bd2b44
--- /dev/null
+++ b/MdeModulePkg/Include/Guid/FormsetClassGuid.h
@@ -0,0 +1,25 @@
+/** @file
+ ClassGuid defined in FormSet.
+
+Copyright (c) 2015, 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 that 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 __FORMSET_CLASS_GUID_H__
+#define __FORMSET_CLASS_GUID_H__
+
+#define FRONT_PAGE_FORMSET_GUID \
+ { \
+ 0x9e0c30bc, 0x3f06, 0x4ba6, {0x82, 0x88, 0x9, 0x17, 0x9b, 0x85, 0x5d, 0xbe} \
+ }
+
+extern EFI_GUID gFrontPageFormSetGuid;
+
+#endif
diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
index cdcc256..d699275 100644
--- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
+++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
@@ -1,9 +1,9 @@
## @file
# Customize display library used by display engine.
#
-# Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2013 - 2015, 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
@@ -52,10 +52,11 @@
DevicePathLib
PcdLib
[Guids]
gEfiIfrTianoGuid ## SOMETIMES_CONSUMES ## UNDEFINED
+ gFrontPageFormSetGuid ## SOMETIMES_CONSUMES ## UNDEFINED

[Protocols]
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserSubtitleTextColor ## CONSUMES
diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
index ad4bc9a..d6cf698 100644
--- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
+++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
@@ -1,10 +1,10 @@
/** @file
This library class defines a set of interfaces to customize Display module
-Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2013-2015, 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 that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.

@@ -254,11 +254,32 @@ PrintFramework (
VOID
ProcessUserOpcode(
IN EFI_IFR_OP_HEADER *OpCodeData
)
{
+ EFI_GUID * ClassGuid;
+ UINT8 ClassGuidNum;
+
+ ClassGuid = NULL;
+ ClassGuidNum = 0;
+
switch (OpCodeData->OpCode) {
+ case EFI_IFR_FORM_SET_OP:
+ //
+ // process the statement outside of form,if it is formset op, get its classguid and compared with gFrontPageFormSetGuid
+ //
+ ClassGuidNum = (UINT8)(((EFI_IFR_FORM_SET *)OpCodeData)->Flags & 0x3);
+ ClassGuid = (EFI_GUID *)(VOID *)((UINT8 *)OpCodeData + sizeof (EFI_IFR_FORM_SET));
+ while (ClassGuidNum-- > 0){
+ if (CompareGuid(&gFrontPageFormSetGuid,ClassGuid)){
+ gClassOfVfr = FORMSET_CLASS_FRONT_PAGE;
+ break;
+ }
+ ClassGuid ++;
+ }
+ break;
+
case EFI_IFR_GUID_OP:
if (CompareGuid (&gEfiIfrTianoGuid, (EFI_GUID *)((CHAR8*) OpCodeData + sizeof (EFI_IFR_OP_HEADER)))) {
//
// Tiano specific GUIDed opcodes
//
diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.h b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.h
index 7342b50..e5f4526 100644
--- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.h
+++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.h
@@ -1,10 +1,10 @@
/** @file
This library class defines a set of interfaces to customize Display module
-Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2013-2015, 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 that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.

@@ -35,10 +35,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Protocol/DevicePathFromText.h>
#include <Guid/MdeModuleHii.h>
#include <Guid/HiiPlatformSetupFormset.h>
#include <Guid/HiiFormMapMethodGuid.h>
+#include <Guid/FormsetClassGuid.h>
#include <Library/PrintLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 4d89a57..89f1b07 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -291,10 +291,13 @@
## GUID indicates the LZMA custom compress/decompress algorithm.
# Include/Guid/LzmaDecompress.h
gLzmaCustomDecompressGuid = { 0xEE4E5898, 0x3914, 0x4259, { 0x9D, 0x6E, 0xDC, 0x7B, 0xD7, 0x94, 0x03, 0xCF }}
gLzmaF86CustomDecompressGuid = { 0xD42AE6BD, 0x1352, 0x4bfb, { 0x90, 0x9A, 0xCA, 0x72, 0xA6, 0xEA, 0xE8, 0x89 }}
+ # Include/Guid/FormsetClassGuid.h
+ gFrontPageFormSetGuid = { 0x9e0c30bc, 0x3f06, 0x4ba6, {0x82, 0x88, 0x9, 0x17, 0x9b, 0x85, 0x5d, 0xbe }}
+
[Ppis]
## Include/Ppi/AtaController.h
gPeiAtaControllerPpiGuid = { 0xa45e60d1, 0xc719, 0x44aa, { 0xb0, 0x7a, 0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }}
## Include/Ppi/UsbHostController.h
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
index 3785c32..4540560 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
@@ -1707,10 +1707,11 @@ ParseOpCodes (
return EFI_INVALID_PARAMETER;
}
CopyMem (&FormSet->FormSetTitle, &((EFI_IFR_FORM_SET *) OpCodeData)->FormSetTitle, sizeof (EFI_STRING_ID));
CopyMem (&FormSet->Help, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID));
+ FormSet->OpCode = (EFI_IFR_OP_HEADER *) OpCodeData;//save the opcode address of formset
if (OpCodeLength > OFFSET_OF (EFI_IFR_FORM_SET, Flags)) {
//
// The formset OpCode contains ClassGuid
//
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
index 002a86a..bdf2f8a 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
@@ -544,10 +544,27 @@ AddStatementToDisplayForm (
InsertTailList(&gDisplayFormData.StatementListOSF, &DisplayStatement->DisplayLink);
}
//
+ // Process the formset which has ClassGuid and treat this formset as statement outside the form.
+ //
+ if (&gCurrentSelection->FormSet->ClassGuid != NULL) {
+ DisplayStatement = AllocateZeroPool (sizeof (FORM_DISPLAY_ENGINE_STATEMENT));
+ ASSERT (DisplayStatement != NULL);
+
+ DisplayStatement->Signature = FORM_DISPLAY_ENGINE_STATEMENT_SIGNATURE;
+ DisplayStatement->Version = FORM_DISPLAY_ENGINE_STATEMENT_VERSION_1;
+ DisplayStatement->OpCode = gCurrentSelection->FormSet->OpCode;
+
+ InitializeListHead (&DisplayStatement->NestStatementList);
+ InitializeListHead (&DisplayStatement->OptionListHead);
+
+ InsertTailList(&gDisplayFormData.StatementListOSF, &DisplayStatement->DisplayLink);
+ }
+
+ //
// Process the statement in this form.
//
Link = GetFirstNode (&gCurrentSelection->Form->StatementListHead);
while (!IsNull (&gCurrentSelection->Form->StatementListHead, Link)) {
Statement = FORM_BROWSER_STATEMENT_FROM_LINK (Link);
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
index c8aa9dd..82bc23b 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
@@ -452,10 +452,11 @@ typedef struct {
UINT8 NumberOfClassGuid;
EFI_GUID ClassGuid[3]; // Up to three ClassGuid
UINT16 Class; // Tiano extended Class code
UINT16 SubClass; // Tiano extended Subclass code
EFI_IMAGE_ID ImageId;
+ EFI_IFR_OP_HEADER *OpCode; //mainly for formset op to get ClassGuid
FORM_BROWSER_STATEMENT *StatementBuffer; // Buffer for all Statements and Questions
EXPRESSION_OPCODE *ExpressionBuffer; // Buffer for all Expression OpCode
FORM_BROWSER_FORM *SaveFailForm; // The form which failed to save.
FORM_BROWSER_STATEMENT *SaveFailStatement; // The Statement which failed to save.
--
1.9.5.msysgit.1
Gao, Liming
2015-06-05 05:48:05 UTC
Permalink
Dandan:
Could we use PCD instead of FRONT_PAGE_FORMSET_GUID? If so, user can configure it if their UiApp changes this GUID.

Thanks
Liming
From: Bi, Dandan
Sent: Friday, June 05, 2015 11:35 AM
To: 'edk2-***@lists.sourceforge.net'; Dong, Eric; Gao, Liming
Subject: [patch] EDKII:Display engine should not depend on the framework code

Display engine base on class opcode to detect whether in
frontpage form.Now remove class/subclass and use ClassGuid to
judge whether in frontpage form

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <***@intel.com<mailto:***@intel.com>>
---
.../Universal/BdsDxe/FrontPageVfr.Vfr | 4 +---
MdeModulePkg/Include/Guid/FormsetClassGuid.h | 25 ++++++++++++++++++++++
.../CustomizedDisplayLib/CustomizedDisplayLib.inf | 3 ++-
.../CustomizedDisplayLibInternal.c | 23 +++++++++++++++++++-
.../CustomizedDisplayLibInternal.h | 3 ++-
MdeModulePkg/MdeModulePkg.dec | 3 +++
MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c | 1 +
.../Universal/SetupBrowserDxe/Presentation.c | 17 +++++++++++++++
MdeModulePkg/Universal/SetupBrowserDxe/Setup.h | 1 +
9 files changed, 74 insertions(+), 6 deletions(-)
create mode 100644 MdeModulePkg/Include/Guid/FormsetClassGuid.h

diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr
index d5fe4f4..a2d92df 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr
@@ -1,10 +1,10 @@
///** @file
//
// Browser formset.
//
-// Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
+// Copyright (c) 2007 - 2015, 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
//
@@ -39,12 +39,10 @@
formset
guid = FRONT_PAGE_FORMSET_GUID,
title = STRING_TOKEN(STR_FRONT_PAGE_TITLE),
help = STRING_TOKEN(STR_NULL_STRING),
classguid = FRONT_PAGE_FORMSET_GUID,
- class = FRONT_PAGE_CLASS,
- subclass = FRONT_PAGE_SUBCLASS,

form formid = FRONT_PAGE_FORM_ID,
title = STRING_TOKEN(STR_FRONT_PAGE_TITLE);

banner
diff --git a/MdeModulePkg/Include/Guid/FormsetClassGuid.h b/MdeModulePkg/Include/Guid/FormsetClassGuid.h
new file mode 100644
index 0000000..1bd2b44
--- /dev/null
+++ b/MdeModulePkg/Include/Guid/FormsetClassGuid.h
@@ -0,0 +1,25 @@
+/** @file
+ ClassGuid defined in FormSet.
+
+Copyright (c) 2015, 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 that 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 __FORMSET_CLASS_GUID_H__
+#define __FORMSET_CLASS_GUID_H__
+
+#define FRONT_PAGE_FORMSET_GUID \
+ { \
+ 0x9e0c30bc, 0x3f06, 0x4ba6, {0x82, 0x88, 0x9, 0x17, 0x9b, 0x85, 0x5d, 0xbe} \
+ }
+
+extern EFI_GUID gFrontPageFormSetGuid;
+
+#endif
diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
index cdcc256..d699275 100644
--- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
+++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
@@ -1,9 +1,9 @@
## @file
# Customize display library used by display engine.
#
-# Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2013 - 2015, 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
@@ -52,10 +52,11 @@
DevicePathLib
PcdLib

[Guids]
gEfiIfrTianoGuid ## SOMETIMES_CONSUMES ## UNDEFINED
+ gFrontPageFormSetGuid ## SOMETIMES_CONSUMES ## UNDEFINED

[Protocols]

[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserSubtitleTextColor ## CONSUMES
diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
index ad4bc9a..d6cf698 100644
--- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
+++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
@@ -1,10 +1,10 @@
/** @file

This library class defines a set of interfaces to customize Display module

-Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2013-2015, 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 that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.

@@ -254,11 +254,32 @@ PrintFramework (
VOID
ProcessUserOpcode(
IN EFI_IFR_OP_HEADER *OpCodeData
)
{
+ EFI_GUID * ClassGuid;
+ UINT8 ClassGuidNum;
+
+ ClassGuid = NULL;
+ ClassGuidNum = 0;
+
switch (OpCodeData->OpCode) {
+ case EFI_IFR_FORM_SET_OP:
+ //
+ // process the statement outside of form,if it is formset op, get its classguid and compared with gFrontPageFormSetGuid
+ //
+ ClassGuidNum = (UINT8)(((EFI_IFR_FORM_SET *)OpCodeData)->Flags & 0x3);
+ ClassGuid = (EFI_GUID *)(VOID *)((UINT8 *)OpCodeData + sizeof (EFI_IFR_FORM_SET));
+ while (ClassGuidNum-- > 0){
+ if (CompareGuid(&gFrontPageFormSetGuid,ClassGuid)){
+ gClassOfVfr = FORMSET_CLASS_FRONT_PAGE;
+ break;
+ }
+ ClassGuid ++;
+ }
+ break;
+
case EFI_IFR_GUID_OP:
if (CompareGuid (&gEfiIfrTianoGuid, (EFI_GUID *)((CHAR8*) OpCodeData + sizeof (EFI_IFR_OP_HEADER)))) {
//
// Tiano specific GUIDed opcodes
//
diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.h b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.h
index 7342b50..e5f4526 100644
--- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.h
+++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.h
@@ -1,10 +1,10 @@
/** @file

This library class defines a set of interfaces to customize Display module

-Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2013-2015, 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 that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.

@@ -35,10 +35,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Protocol/DevicePathFromText.h>

#include <Guid/MdeModuleHii.h>
#include <Guid/HiiPlatformSetupFormset.h>
#include <Guid/HiiFormMapMethodGuid.h>
+#include <Guid/FormsetClassGuid.h>

#include <Library/PrintLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 4d89a57..89f1b07 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -291,10 +291,13 @@
## GUID indicates the LZMA custom compress/decompress algorithm.
# Include/Guid/LzmaDecompress.h
gLzmaCustomDecompressGuid = { 0xEE4E5898, 0x3914, 0x4259, { 0x9D, 0x6E, 0xDC, 0x7B, 0xD7, 0x94, 0x03, 0xCF }}
gLzmaF86CustomDecompressGuid = { 0xD42AE6BD, 0x1352, 0x4bfb, { 0x90, 0x9A, 0xCA, 0x72, 0xA6, 0xEA, 0xE8, 0x89 }}

+ # Include/Guid/FormsetClassGuid.h
+ gFrontPageFormSetGuid = { 0x9e0c30bc, 0x3f06, 0x4ba6, {0x82, 0x88, 0x9, 0x17, 0x9b, 0x85, 0x5d, 0xbe }}
+
[Ppis]
## Include/Ppi/AtaController.h
gPeiAtaControllerPpiGuid = { 0xa45e60d1, 0xc719, 0x44aa, { 0xb0, 0x7a, 0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }}

## Include/Ppi/UsbHostController.h
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
index 3785c32..4540560 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
@@ -1707,10 +1707,11 @@ ParseOpCodes (
return EFI_INVALID_PARAMETER;
}

CopyMem (&FormSet->FormSetTitle, &((EFI_IFR_FORM_SET *) OpCodeData)->FormSetTitle, sizeof (EFI_STRING_ID));
CopyMem (&FormSet->Help, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID));
+ FormSet->OpCode = (EFI_IFR_OP_HEADER *) OpCodeData;//save the opcode address of formset

if (OpCodeLength > OFFSET_OF (EFI_IFR_FORM_SET, Flags)) {
//
// The formset OpCode contains ClassGuid
//
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
index 002a86a..bdf2f8a 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
@@ -544,10 +544,27 @@ AddStatementToDisplayForm (

InsertTailList(&gDisplayFormData.StatementListOSF, &DisplayStatement->DisplayLink);
}

//
+ // Process the formset which has ClassGuid and treat this formset as statement outside the form.
+ //
+ if (&gCurrentSelection->FormSet->ClassGuid != NULL) {
+ DisplayStatement = AllocateZeroPool (sizeof (FORM_DISPLAY_ENGINE_STATEMENT));
+ ASSERT (DisplayStatement != NULL);
+
+ DisplayStatement->Signature = FORM_DISPLAY_ENGINE_STATEMENT_SIGNATURE;
+ DisplayStatement->Version = FORM_DISPLAY_ENGINE_STATEMENT_VERSION_1;
+ DisplayStatement->OpCode = gCurrentSelection->FormSet->OpCode;
+
+ InitializeListHead (&DisplayStatement->NestStatementList);
+ InitializeListHead (&DisplayStatement->OptionListHead);
+
+ InsertTailList(&gDisplayFormData.StatementListOSF, &DisplayStatement->DisplayLink);
+ }
+
+ //
// Process the statement in this form.
//
Link = GetFirstNode (&gCurrentSelection->Form->StatementListHead);
while (!IsNull (&gCurrentSelection->Form->StatementListHead, Link)) {
Statement = FORM_BROWSER_STATEMENT_FROM_LINK (Link);
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
index c8aa9dd..82bc23b 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
@@ -452,10 +452,11 @@ typedef struct {
UINT8 NumberOfClassGuid;
EFI_GUID ClassGuid[3]; // Up to three ClassGuid
UINT16 Class; // Tiano extended Class code
UINT16 SubClass; // Tiano extended Subclass code
EFI_IMAGE_ID ImageId;
+ EFI_IFR_OP_HEADER *OpCode; //mainly for formset op to get ClassGuid

FORM_BROWSER_STATEMENT *StatementBuffer; // Buffer for all Statements and Questions
EXPRESSION_OPCODE *ExpressionBuffer; // Buffer for all Expression OpCode
FORM_BROWSER_FORM *SaveFailForm; // The form which failed to save.
FORM_BROWSER_STATEMENT *SaveFailStatement; // The Statement which failed to save.
--
1.9.5.msysgit.1
Bi, Dandan
2015-06-08 05:57:09 UTC
Permalink
Display engine base on class opcode to detect whether in
frontpage form.Now remove class/subclass and use ClassGuid to
judge whether in frontpage form

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <***@intel.com>
---
.../Universal/BdsDxe/FrontPageVfr.Vfr | 4 +---
.../CustomizedDisplayLib/CustomizedDisplayLib.inf | 5 +++--
.../CustomizedDisplayLibInternal.c | 23 +++++++++++++++++++++-
MdeModulePkg/MdeModulePkg.dec | 4 ++++
MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c | 1 +
.../Universal/SetupBrowserDxe/Presentation.c | 17 ++++++++++++++++
MdeModulePkg/Universal/SetupBrowserDxe/Setup.h | 1 +
7 files changed, 49 insertions(+), 6 deletions(-)

diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr
index d5fe4f4..a2d92df 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr
@@ -1,10 +1,10 @@
///** @file
//
// Browser formset.
//
-// Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
+// Copyright (c) 2007 - 2015, 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
//
@@ -39,12 +39,10 @@
formset
guid = FRONT_PAGE_FORMSET_GUID,
title = STRING_TOKEN(STR_FRONT_PAGE_TITLE),
help = STRING_TOKEN(STR_NULL_STRING),
classguid = FRONT_PAGE_FORMSET_GUID,
- class = FRONT_PAGE_CLASS,
- subclass = FRONT_PAGE_SUBCLASS,
form formid = FRONT_PAGE_FORM_ID,
title = STRING_TOKEN(STR_FRONT_PAGE_TITLE);
banner
diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
index cdcc256..477a8fd 100644
--- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
+++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
@@ -1,9 +1,9 @@
## @file
# Customize display library used by display engine.
#
-# Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2013 - 2015, 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
@@ -59,6 +59,7 @@
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserSubtitleTextColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextHighlightColor ## CONSUMES
- gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor ## CONSUMES
\ No newline at end of file
+ gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor ## CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdFrontPageFormSet ## CONSUMES
\ No newline at end of file
diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
index ad4bc9a..e2bef2b 100644
--- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
+++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
@@ -1,10 +1,10 @@
/** @file
This library class defines a set of interfaces to customize Display module
-Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2013-2015, 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 that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.

@@ -254,11 +254,32 @@ PrintFramework (
VOID
ProcessUserOpcode(
IN EFI_IFR_OP_HEADER *OpCodeData
)
{
+ EFI_GUID * ClassGuid;
+ UINT8 ClassGuidNum;
+
+ ClassGuid = NULL;
+ ClassGuidNum = 0;
+
switch (OpCodeData->OpCode) {
+ case EFI_IFR_FORM_SET_OP:
+ //
+ // process the statement outside of form,if it is formset op, get its classguid and compared with gFrontPageFormSetGuid
+ //
+ ClassGuidNum = (UINT8)(((EFI_IFR_FORM_SET *)OpCodeData)->Flags & 0x3);
+ ClassGuid = (EFI_GUID *)(VOID *)((UINT8 *)OpCodeData + sizeof (EFI_IFR_FORM_SET));
+ while (ClassGuidNum-- > 0){
+ if (CompareGuid((EFI_GUID*)PcdGetPtr (PcdFrontPageFormSet),ClassGuid)){
+ gClassOfVfr = FORMSET_CLASS_FRONT_PAGE;
+ break;
+ }
+ ClassGuid ++;
+ }
+ break;
+
case EFI_IFR_GUID_OP:
if (CompareGuid (&gEfiIfrTianoGuid, (EFI_GUID *)((CHAR8*) OpCodeData + sizeof (EFI_IFR_OP_HEADER)))) {
//
// Tiano specific GUIDed opcodes
//
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 4d89a57..5ba2464 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -966,10 +966,14 @@
## Specify the console output row of text setup.
# @Prompt Console Output Row of Text Setup
gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutRow|25|UINT32|0x4000000e
[PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
+ ## This PCD points to the formset Class GUID
+ # Platform can customize the PCD to point to different formset
+ gEfiMdeModulePkgTokenSpaceGuid.PcdFrontPageFormSet|{ 0xbc, 0x30, 0x0c, 0x9e,0x06, 0x3f, 0xa6, 0x4b, 0x82, 0x88, 0x9, 0x17, 0x9b, 0x85, 0x5d, 0xbe }|VOID*|0x0001006e
+
## Base address of the NV variable range in flash device.
# @Prompt Base address of flash NV variable range.
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|0x0|UINT32|0x30000001
## Size of the NV variable range. Note that this value should less than or equal to PcdFlashNvStorageFtwSpareSize.
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
index 3785c32..4540560 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
@@ -1707,10 +1707,11 @@ ParseOpCodes (
return EFI_INVALID_PARAMETER;
}
CopyMem (&FormSet->FormSetTitle, &((EFI_IFR_FORM_SET *) OpCodeData)->FormSetTitle, sizeof (EFI_STRING_ID));
CopyMem (&FormSet->Help, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID));
+ FormSet->OpCode = (EFI_IFR_OP_HEADER *) OpCodeData;//save the opcode address of formset
if (OpCodeLength > OFFSET_OF (EFI_IFR_FORM_SET, Flags)) {
//
// The formset OpCode contains ClassGuid
//
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
index 002a86a..bdf2f8a 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
@@ -544,10 +544,27 @@ AddStatementToDisplayForm (
InsertTailList(&gDisplayFormData.StatementListOSF, &DisplayStatement->DisplayLink);
}
//
+ // Process the formset which has ClassGuid and treat this formset as statement outside the form.
+ //
+ if (&gCurrentSelection->FormSet->ClassGuid != NULL) {
+ DisplayStatement = AllocateZeroPool (sizeof (FORM_DISPLAY_ENGINE_STATEMENT));
+ ASSERT (DisplayStatement != NULL);
+
+ DisplayStatement->Signature = FORM_DISPLAY_ENGINE_STATEMENT_SIGNATURE;
+ DisplayStatement->Version = FORM_DISPLAY_ENGINE_STATEMENT_VERSION_1;
+ DisplayStatement->OpCode = gCurrentSelection->FormSet->OpCode;
+
+ InitializeListHead (&DisplayStatement->NestStatementList);
+ InitializeListHead (&DisplayStatement->OptionListHead);
+
+ InsertTailList(&gDisplayFormData.StatementListOSF, &DisplayStatement->DisplayLink);
+ }
+
+ //
// Process the statement in this form.
//
Link = GetFirstNode (&gCurrentSelection->Form->StatementListHead);
while (!IsNull (&gCurrentSelection->Form->StatementListHead, Link)) {
Statement = FORM_BROWSER_STATEMENT_FROM_LINK (Link);
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
index c8aa9dd..82bc23b 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
@@ -452,10 +452,11 @@ typedef struct {
UINT8 NumberOfClassGuid;
EFI_GUID ClassGuid[3]; // Up to three ClassGuid
UINT16 Class; // Tiano extended Class code
UINT16 SubClass; // Tiano extended Subclass code
EFI_IMAGE_ID ImageId;
+ EFI_IFR_OP_HEADER *OpCode; //mainly for formset op to get ClassGuid
FORM_BROWSER_STATEMENT *StatementBuffer; // Buffer for all Statements and Questions
EXPRESSION_OPCODE *ExpressionBuffer; // Buffer for all Expression OpCode
FORM_BROWSER_FORM *SaveFailForm; // The form which failed to save.
FORM_BROWSER_STATEMENT *SaveFailStatement; // The Statement which failed to save.
--
1.9.5.msysgit.1
Gao, Liming
2015-06-08 09:05:42 UTC
Permalink
Dandan:
How about name PCD to PcdFrontPageFormSetGuid? And, if FormSetGuid or one of the elements of the ClassId field in the EFI_IFR_FORM_SET op-code matches this PCD value, it means this formset is front page.

Thanks
Liming
From: Bi, Dandan
Sent: Monday, June 08, 2015 1:57 PM
To: 'edk2-***@lists.sourceforge.net'; Dong, Eric; Gao, Liming
Subject: [patch] EDKII:Display engine should not depend on the framework code

Display engine base on class opcode to detect whether in
frontpage form.Now remove class/subclass and use ClassGuid to
judge whether in frontpage form

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <***@intel.com<mailto:***@intel.com>>
---
.../Universal/BdsDxe/FrontPageVfr.Vfr | 4 +---
.../CustomizedDisplayLib/CustomizedDisplayLib.inf | 5 +++--
.../CustomizedDisplayLibInternal.c | 23 +++++++++++++++++++++-
MdeModulePkg/MdeModulePkg.dec | 4 ++++
MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c | 1 +
.../Universal/SetupBrowserDxe/Presentation.c | 17 ++++++++++++++++
MdeModulePkg/Universal/SetupBrowserDxe/Setup.h | 1 +
7 files changed, 49 insertions(+), 6 deletions(-)

diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr
index d5fe4f4..a2d92df 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr
@@ -1,10 +1,10 @@
///** @file
//
// Browser formset.
//
-// Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
+// Copyright (c) 2007 - 2015, 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
//
@@ -39,12 +39,10 @@
formset
guid = FRONT_PAGE_FORMSET_GUID,
title = STRING_TOKEN(STR_FRONT_PAGE_TITLE),
help = STRING_TOKEN(STR_NULL_STRING),
classguid = FRONT_PAGE_FORMSET_GUID,
- class = FRONT_PAGE_CLASS,
- subclass = FRONT_PAGE_SUBCLASS,

form formid = FRONT_PAGE_FORM_ID,
title = STRING_TOKEN(STR_FRONT_PAGE_TITLE);

banner
diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
index cdcc256..477a8fd 100644
--- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
+++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
@@ -1,9 +1,9 @@
## @file
# Customize display library used by display engine.
#
-# Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2013 - 2015, 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
@@ -59,6 +59,7 @@

[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserSubtitleTextColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextHighlightColor ## CONSUMES
- gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor ## CONSUMES
\ No newline at end of file
+ gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor ## CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdFrontPageFormSet ## CONSUMES
\ No newline at end of file
diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
index ad4bc9a..e2bef2b 100644
--- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
+++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
@@ -1,10 +1,10 @@
/** @file

This library class defines a set of interfaces to customize Display module

-Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2013-2015, 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 that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.

@@ -254,11 +254,32 @@ PrintFramework (
VOID
ProcessUserOpcode(
IN EFI_IFR_OP_HEADER *OpCodeData
)
{
+ EFI_GUID * ClassGuid;
+ UINT8 ClassGuidNum;
+
+ ClassGuid = NULL;
+ ClassGuidNum = 0;
+
switch (OpCodeData->OpCode) {
+ case EFI_IFR_FORM_SET_OP:
+ //
+ // process the statement outside of form,if it is formset op, get its classguid and compared with gFrontPageFormSetGuid
+ //
+ ClassGuidNum = (UINT8)(((EFI_IFR_FORM_SET *)OpCodeData)->Flags & 0x3);
+ ClassGuid = (EFI_GUID *)(VOID *)((UINT8 *)OpCodeData + sizeof (EFI_IFR_FORM_SET));
+ while (ClassGuidNum-- > 0){
+ if (CompareGuid((EFI_GUID*)PcdGetPtr (PcdFrontPageFormSet),ClassGuid)){
+ gClassOfVfr = FORMSET_CLASS_FRONT_PAGE;
+ break;
+ }
+ ClassGuid ++;
+ }
+ break;
+
case EFI_IFR_GUID_OP:
if (CompareGuid (&gEfiIfrTianoGuid, (EFI_GUID *)((CHAR8*) OpCodeData + sizeof (EFI_IFR_OP_HEADER)))) {
//
// Tiano specific GUIDed opcodes
//
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 4d89a57..5ba2464 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -966,10 +966,14 @@
## Specify the console output row of text setup.
# @Prompt Console Output Row of Text Setup
gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutRow|25|UINT32|0x4000000e

[PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
+ ## This PCD points to the formset Class GUID
+ # Platform can customize the PCD to point to different formset
+ gEfiMdeModulePkgTokenSpaceGuid.PcdFrontPageFormSet|{ 0xbc, 0x30, 0x0c, 0x9e,0x06, 0x3f, 0xa6, 0x4b, 0x82, 0x88, 0x9, 0x17, 0x9b, 0x85, 0x5d, 0xbe }|VOID*|0x0001006e
+
## Base address of the NV variable range in flash device.
# @Prompt Base address of flash NV variable range.
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|0x0|UINT32|0x30000001

## Size of the NV variable range. Note that this value should less than or equal to PcdFlashNvStorageFtwSpareSize.
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
index 3785c32..4540560 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
@@ -1707,10 +1707,11 @@ ParseOpCodes (
return EFI_INVALID_PARAMETER;
}

CopyMem (&FormSet->FormSetTitle, &((EFI_IFR_FORM_SET *) OpCodeData)->FormSetTitle, sizeof (EFI_STRING_ID));
CopyMem (&FormSet->Help, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID));
+ FormSet->OpCode = (EFI_IFR_OP_HEADER *) OpCodeData;//save the opcode address of formset

if (OpCodeLength > OFFSET_OF (EFI_IFR_FORM_SET, Flags)) {
//
// The formset OpCode contains ClassGuid
//
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
index 002a86a..bdf2f8a 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
@@ -544,10 +544,27 @@ AddStatementToDisplayForm (

InsertTailList(&gDisplayFormData.StatementListOSF, &DisplayStatement->DisplayLink);
}

//
+ // Process the formset which has ClassGuid and treat this formset as statement outside the form.
+ //
+ if (&gCurrentSelection->FormSet->ClassGuid != NULL) {
+ DisplayStatement = AllocateZeroPool (sizeof (FORM_DISPLAY_ENGINE_STATEMENT));
+ ASSERT (DisplayStatement != NULL);
+
+ DisplayStatement->Signature = FORM_DISPLAY_ENGINE_STATEMENT_SIGNATURE;
+ DisplayStatement->Version = FORM_DISPLAY_ENGINE_STATEMENT_VERSION_1;
+ DisplayStatement->OpCode = gCurrentSelection->FormSet->OpCode;
+
+ InitializeListHead (&DisplayStatement->NestStatementList);
+ InitializeListHead (&DisplayStatement->OptionListHead);
+
+ InsertTailList(&gDisplayFormData.StatementListOSF, &DisplayStatement->DisplayLink);
+ }
+
+ //
// Process the statement in this form.
//
Link = GetFirstNode (&gCurrentSelection->Form->StatementListHead);
while (!IsNull (&gCurrentSelection->Form->StatementListHead, Link)) {
Statement = FORM_BROWSER_STATEMENT_FROM_LINK (Link);
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
index c8aa9dd..82bc23b 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
@@ -452,10 +452,11 @@ typedef struct {
UINT8 NumberOfClassGuid;
EFI_GUID ClassGuid[3]; // Up to three ClassGuid
UINT16 Class; // Tiano extended Class code
UINT16 SubClass; // Tiano extended Subclass code
EFI_IMAGE_ID ImageId;
+ EFI_IFR_OP_HEADER *OpCode; //mainly for formset op to get ClassGuid

FORM_BROWSER_STATEMENT *StatementBuffer; // Buffer for all Statements and Questions
EXPRESSION_OPCODE *ExpressionBuffer; // Buffer for all Expression OpCode
FORM_BROWSER_FORM *SaveFailForm; // The form which failed to save.
FORM_BROWSER_STATEMENT *SaveFailStatement; // The Statement which failed to save.
--
1.9.5.msysgit.1
Bi, Dandan
2015-06-09 02:08:17 UTC
Permalink
Display engine base on class opcode to detect whether in
front page.Now remove class/subclass and use FormsetGuid
or ClassGuid to judge whether in front page

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <***@intel.com>
---
.../Universal/BdsDxe/FrontPageVfr.Vfr | 4 +---
.../CustomizedDisplayLib/CustomizedDisplayLib.inf | 5 ++--
.../CustomizedDisplayLibInternal.c | 27 +++++++++++++++++++++-
MdeModulePkg/MdeModulePkg.dec | 4 ++++
MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c | 1 +
.../Universal/SetupBrowserDxe/Presentation.c | 15 ++++++++++++
MdeModulePkg/Universal/SetupBrowserDxe/Setup.h | 1 +
7 files changed, 51 insertions(+), 6 deletions(-)

diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr
index d5fe4f4..a2d92df 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr
@@ -1,10 +1,10 @@
///** @file
//
// Browser formset.
//
-// Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
+// Copyright (c) 2007 - 2015, 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
//
@@ -39,12 +39,10 @@
formset
guid = FRONT_PAGE_FORMSET_GUID,
title = STRING_TOKEN(STR_FRONT_PAGE_TITLE),
help = STRING_TOKEN(STR_NULL_STRING),
classguid = FRONT_PAGE_FORMSET_GUID,
- class = FRONT_PAGE_CLASS,
- subclass = FRONT_PAGE_SUBCLASS,
form formid = FRONT_PAGE_FORM_ID,
title = STRING_TOKEN(STR_FRONT_PAGE_TITLE);
banner
diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
index cdcc256..2352894 100644
--- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
+++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
@@ -1,9 +1,9 @@
## @file
# Customize display library used by display engine.
#
-# Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2013 - 2015, 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
@@ -59,6 +59,7 @@
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserSubtitleTextColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextHighlightColor ## CONSUMES
- gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor ## CONSUMES
\ No newline at end of file
+ gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor ## CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdFrontPageFormSetGuid ## CONSUMES
\ No newline at end of file
diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
index ad4bc9a..f9032b8 100644
--- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
+++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
@@ -1,10 +1,10 @@
/** @file
This library class defines a set of interfaces to customize Display module
-Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2013-2015, 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 that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.

@@ -254,11 +254,36 @@ PrintFramework (
VOID
ProcessUserOpcode(
IN EFI_IFR_OP_HEADER *OpCodeData
)
{
+ EFI_GUID * ClassGuid;
+ UINT8 ClassGuidNum;
+
+ ClassGuid = NULL;
+ ClassGuidNum = 0;
+
switch (OpCodeData->OpCode) {
+ case EFI_IFR_FORM_SET_OP:
+ //
+ // process the statement outside of form,if it is formset op, get its formsetguid or classguid and compared with gFrontPageFormSetGuid
+ //
+ if (CompareGuid((EFI_GUID*)PcdGetPtr (PcdFrontPageFormSetGuid),(EFI_GUID*)&((EFI_IFR_FORM_SET *) OpCodeData)->Guid)){
+ gClassOfVfr = FORMSET_CLASS_FRONT_PAGE;
+ } else{
+ ClassGuidNum = (UINT8)(((EFI_IFR_FORM_SET *)OpCodeData)->Flags & 0x3);
+ ClassGuid = (EFI_GUID *)(VOID *)((UINT8 *)OpCodeData + sizeof (EFI_IFR_FORM_SET));
+ while (ClassGuidNum-- > 0){
+ if (CompareGuid((EFI_GUID*)PcdGetPtr (PcdFrontPageFormSetGuid),ClassGuid)){
+ gClassOfVfr = FORMSET_CLASS_FRONT_PAGE;
+ break;
+ }
+ ClassGuid ++;
+ }
+ }
+ break;
+
case EFI_IFR_GUID_OP:
if (CompareGuid (&gEfiIfrTianoGuid, (EFI_GUID *)((CHAR8*) OpCodeData + sizeof (EFI_IFR_OP_HEADER)))) {
//
// Tiano specific GUIDed opcodes
//
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 4d89a57..e306e59 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -966,10 +966,14 @@
## Specify the console output row of text setup.
# @Prompt Console Output Row of Text Setup
gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutRow|25|UINT32|0x4000000e
[PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
+ ## This PCD points to the front page formset GUID
+ # Compare the FormsetGuid or ClassGuid with this PCD value can detect whether in front page
+ gEfiMdeModulePkgTokenSpaceGuid.PcdFrontPageFormSetGuid|{ 0xbc, 0x30, 0x0c, 0x9e,0x06, 0x3f, 0xa6, 0x4b, 0x82, 0x88, 0x9, 0x17, 0x9b, 0x85, 0x5d, 0xbe }|VOID*|0x0001006e
+
## Base address of the NV variable range in flash device.
# @Prompt Base address of flash NV variable range.
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|0x0|UINT32|0x30000001
## Size of the NV variable range. Note that this value should less than or equal to PcdFlashNvStorageFtwSpareSize.
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
index 3785c32..4540560 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
@@ -1707,10 +1707,11 @@ ParseOpCodes (
return EFI_INVALID_PARAMETER;
}
CopyMem (&FormSet->FormSetTitle, &((EFI_IFR_FORM_SET *) OpCodeData)->FormSetTitle, sizeof (EFI_STRING_ID));
CopyMem (&FormSet->Help, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID));
+ FormSet->OpCode = (EFI_IFR_OP_HEADER *) OpCodeData;//save the opcode address of formset
if (OpCodeLength > OFFSET_OF (EFI_IFR_FORM_SET, Flags)) {
//
// The formset OpCode contains ClassGuid
//
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
index 002a86a..356cd9c 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
@@ -544,10 +544,25 @@ AddStatementToDisplayForm (
InsertTailList(&gDisplayFormData.StatementListOSF, &DisplayStatement->DisplayLink);
}
//
+ // treat formset as statement outside the form,get its opcode.
+ //
+ DisplayStatement = AllocateZeroPool (sizeof (FORM_DISPLAY_ENGINE_STATEMENT));
+ ASSERT (DisplayStatement != NULL);
+
+ DisplayStatement->Signature = FORM_DISPLAY_ENGINE_STATEMENT_SIGNATURE;
+ DisplayStatement->Version = FORM_DISPLAY_ENGINE_STATEMENT_VERSION_1;
+ DisplayStatement->OpCode = gCurrentSelection->FormSet->OpCode;
+
+ InitializeListHead (&DisplayStatement->NestStatementList);
+ InitializeListHead (&DisplayStatement->OptionListHead);
+
+ InsertTailList(&gDisplayFormData.StatementListOSF, &DisplayStatement->DisplayLink);
+
+ //
// Process the statement in this form.
//
Link = GetFirstNode (&gCurrentSelection->Form->StatementListHead);
while (!IsNull (&gCurrentSelection->Form->StatementListHead, Link)) {
Statement = FORM_BROWSER_STATEMENT_FROM_LINK (Link);
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
index c8aa9dd..82bc23b 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
@@ -452,10 +452,11 @@ typedef struct {
UINT8 NumberOfClassGuid;
EFI_GUID ClassGuid[3]; // Up to three ClassGuid
UINT16 Class; // Tiano extended Class code
UINT16 SubClass; // Tiano extended Subclass code
EFI_IMAGE_ID ImageId;
+ EFI_IFR_OP_HEADER *OpCode; //mainly for formset op to get ClassGuid
FORM_BROWSER_STATEMENT *StatementBuffer; // Buffer for all Statements and Questions
EXPRESSION_OPCODE *ExpressionBuffer; // Buffer for all Expression OpCode
FORM_BROWSER_FORM *SaveFailForm; // The form which failed to save.
FORM_BROWSER_STATEMENT *SaveFailStatement; // The Statement which failed to save.
--
1.9.5.msysgit.1
Gao, Liming
2015-06-09 04:48:59 UTC
Permalink
Reviewed-by: Liming Gao <***@intel.com<mailto:***@intel.com>>


From: Bi, Dandan
Sent: Tuesday, June 09, 2015 10:08 AM
To: 'edk2-***@lists.sourceforge.net'; Dong, Eric; Gao, Liming
Subject: [patch] EDKII:Display engine should not depend on the framework code

Display engine base on class opcode to detect whether in
front page.Now remove class/subclass and use FormsetGuid
or ClassGuid to judge whether in front page

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <***@intel.com<mailto:***@intel.com>>
---
.../Universal/BdsDxe/FrontPageVfr.Vfr | 4 +---
.../CustomizedDisplayLib/CustomizedDisplayLib.inf | 5 ++--
.../CustomizedDisplayLibInternal.c | 27 +++++++++++++++++++++-
MdeModulePkg/MdeModulePkg.dec | 4 ++++
MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c | 1 +
.../Universal/SetupBrowserDxe/Presentation.c | 15 ++++++++++++
MdeModulePkg/Universal/SetupBrowserDxe/Setup.h | 1 +
7 files changed, 51 insertions(+), 6 deletions(-)

diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr
index d5fe4f4..a2d92df 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr
@@ -1,10 +1,10 @@
///** @file
//
// Browser formset.
//
-// Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
+// Copyright (c) 2007 - 2015, 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
//
@@ -39,12 +39,10 @@
formset
guid = FRONT_PAGE_FORMSET_GUID,
title = STRING_TOKEN(STR_FRONT_PAGE_TITLE),
help = STRING_TOKEN(STR_NULL_STRING),
classguid = FRONT_PAGE_FORMSET_GUID,
- class = FRONT_PAGE_CLASS,
- subclass = FRONT_PAGE_SUBCLASS,

form formid = FRONT_PAGE_FORM_ID,
title = STRING_TOKEN(STR_FRONT_PAGE_TITLE);

banner
diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
index cdcc256..2352894 100644
--- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
+++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
@@ -1,9 +1,9 @@
## @file
# Customize display library used by display engine.
#
-# Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2013 - 2015, 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
@@ -59,6 +59,7 @@

[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserSubtitleTextColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextHighlightColor ## CONSUMES
- gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor ## CONSUMES
\ No newline at end of file
+ gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor ## CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdFrontPageFormSetGuid ## CONSUMES
\ No newline at end of file
diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
index ad4bc9a..f9032b8 100644
--- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
+++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
@@ -1,10 +1,10 @@
/** @file

This library class defines a set of interfaces to customize Display module

-Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2013-2015, 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 that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.

@@ -254,11 +254,36 @@ PrintFramework (
VOID
ProcessUserOpcode(
IN EFI_IFR_OP_HEADER *OpCodeData
)
{
+ EFI_GUID * ClassGuid;
+ UINT8 ClassGuidNum;
+
+ ClassGuid = NULL;
+ ClassGuidNum = 0;
+
switch (OpCodeData->OpCode) {
+ case EFI_IFR_FORM_SET_OP:
+ //
+ // process the statement outside of form,if it is formset op, get its formsetguid or classguid and compared with gFrontPageFormSetGuid
+ //
+ if (CompareGuid((EFI_GUID*)PcdGetPtr (PcdFrontPageFormSetGuid),(EFI_GUID*)&((EFI_IFR_FORM_SET *) OpCodeData)->Guid)){
+ gClassOfVfr = FORMSET_CLASS_FRONT_PAGE;
+ } else{
+ ClassGuidNum = (UINT8)(((EFI_IFR_FORM_SET *)OpCodeData)->Flags & 0x3);
+ ClassGuid = (EFI_GUID *)(VOID *)((UINT8 *)OpCodeData + sizeof (EFI_IFR_FORM_SET));
+ while (ClassGuidNum-- > 0){
+ if (CompareGuid((EFI_GUID*)PcdGetPtr (PcdFrontPageFormSetGuid),ClassGuid)){
+ gClassOfVfr = FORMSET_CLASS_FRONT_PAGE;
+ break;
+ }
+ ClassGuid ++;
+ }
+ }
+ break;
+
case EFI_IFR_GUID_OP:
if (CompareGuid (&gEfiIfrTianoGuid, (EFI_GUID *)((CHAR8*) OpCodeData + sizeof (EFI_IFR_OP_HEADER)))) {
//
// Tiano specific GUIDed opcodes
//
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 4d89a57..e306e59 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -966,10 +966,14 @@
## Specify the console output row of text setup.
# @Prompt Console Output Row of Text Setup
gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutRow|25|UINT32|0x4000000e

[PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
+ ## This PCD points to the front page formset GUID
+ # Compare the FormsetGuid or ClassGuid with this PCD value can detect whether in front page
+ gEfiMdeModulePkgTokenSpaceGuid.PcdFrontPageFormSetGuid|{ 0xbc, 0x30, 0x0c, 0x9e,0x06, 0x3f, 0xa6, 0x4b, 0x82, 0x88, 0x9, 0x17, 0x9b, 0x85, 0x5d, 0xbe }|VOID*|0x0001006e
+
## Base address of the NV variable range in flash device.
# @Prompt Base address of flash NV variable range.
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|0x0|UINT32|0x30000001

## Size of the NV variable range. Note that this value should less than or equal to PcdFlashNvStorageFtwSpareSize.
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
index 3785c32..4540560 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
@@ -1707,10 +1707,11 @@ ParseOpCodes (
return EFI_INVALID_PARAMETER;
}

CopyMem (&FormSet->FormSetTitle, &((EFI_IFR_FORM_SET *) OpCodeData)->FormSetTitle, sizeof (EFI_STRING_ID));
CopyMem (&FormSet->Help, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID));
+ FormSet->OpCode = (EFI_IFR_OP_HEADER *) OpCodeData;//save the opcode address of formset

if (OpCodeLength > OFFSET_OF (EFI_IFR_FORM_SET, Flags)) {
//
// The formset OpCode contains ClassGuid
//
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
index 002a86a..356cd9c 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
@@ -544,10 +544,25 @@ AddStatementToDisplayForm (

InsertTailList(&gDisplayFormData.StatementListOSF, &DisplayStatement->DisplayLink);
}

//
+ // treat formset as statement outside the form,get its opcode.
+ //
+ DisplayStatement = AllocateZeroPool (sizeof (FORM_DISPLAY_ENGINE_STATEMENT));
+ ASSERT (DisplayStatement != NULL);
+
+ DisplayStatement->Signature = FORM_DISPLAY_ENGINE_STATEMENT_SIGNATURE;
+ DisplayStatement->Version = FORM_DISPLAY_ENGINE_STATEMENT_VERSION_1;
+ DisplayStatement->OpCode = gCurrentSelection->FormSet->OpCode;
+
+ InitializeListHead (&DisplayStatement->NestStatementList);
+ InitializeListHead (&DisplayStatement->OptionListHead);
+
+ InsertTailList(&gDisplayFormData.StatementListOSF, &DisplayStatement->DisplayLink);
+
+ //
// Process the statement in this form.
//
Link = GetFirstNode (&gCurrentSelection->Form->StatementListHead);
while (!IsNull (&gCurrentSelection->Form->StatementListHead, Link)) {
Statement = FORM_BROWSER_STATEMENT_FROM_LINK (Link);
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
index c8aa9dd..82bc23b 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
@@ -452,10 +452,11 @@ typedef struct {
UINT8 NumberOfClassGuid;
EFI_GUID ClassGuid[3]; // Up to three ClassGuid
UINT16 Class; // Tiano extended Class code
UINT16 SubClass; // Tiano extended Subclass code
EFI_IMAGE_ID ImageId;
+ EFI_IFR_OP_HEADER *OpCode; //mainly for formset op to get ClassGuid

FORM_BROWSER_STATEMENT *StatementBuffer; // Buffer for all Statements and Questions
EXPRESSION_OPCODE *ExpressionBuffer; // Buffer for all Expression OpCode
FORM_BROWSER_FORM *SaveFailForm; // The form which failed to save.
FORM_BROWSER_STATEMENT *SaveFailStatement; // The Statement which failed to save.
--
1.9.5.msysgit.1

Loading...