FYI

On 10/15/2018 02:33 AM, Supreeth Venkatesh wrote:
Please use a commit message less than 80 Cols.


On 10/13/2018 04:42 PM, Eric Jin wrote:
Cc: Supreeth Venkatesh <supreeth.venkat...@arm.com>
Cc: Jiaxin Wu <jiaxin...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Jin <eric....@intel.com>
---
  ...rTaskPriorityServicesBBTestCreateEventEx.c | 26 +++++++++++--------
  .../BlackBoxTest/Support.c                    | 19 +++++++++++++-
  2 files changed, 33 insertions(+), 12 deletions(-)

diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/EventTimerTaskPriorityServices/BlackBoxTest/EventTimerTaskPriorityServicesBBTestCreateEventEx.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/EventTimerTaskPriorityServices/BlackBoxTest/EventTimerTaskPriorityServicesBBTestCreateEventEx.c
index e2e173ab..25d1ed97 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/EventTimerTaskPriorityServices/BlackBoxTest/EventTimerTaskPriorityServicesBBTestCreateEventEx.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/EventTimerTaskPriorityServices/BlackBoxTest/EventTimerTaskPriorityServicesBBTestCreateEventEx.c
@@ -1,7 +1,7 @@
  /** @file
      Copyright 2006 - 2016 Unified EFI, Inc.<BR>
-  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR> +  Copyright (c) 2010 - 2018, 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
@@ -192,6 +192,10 @@ BBTestCreateEventEx_Func (
    BBTestCreateEventEx_Func_Sub2 (StandardLib);
  #endif
  +  //
+  // The test for the EFI_EVENT_GROUP_MEMORY_MAP_CHANGE
+  // This event group is notified by the system when the memory map has changed.
+  //
    BBTestCreateEventEx_Func_Sub3 (StandardLib);
      //
@@ -599,12 +603,12 @@ BBTestCreateEventEx_Func_Sub1 (
    UINTN               Buffer[MAX_TEST_EVENT_NUM + MAX_TEST_EVENT_NUM*2];
      //
-  // Initialize Buffer
+  // Initialize Buffer and the 0xAA is only for the Sub3 test
    //
    for (Index = 0; Index < MAX_TEST_EVENT_NUM; Index ++) {
Strange Logic here. Needs re-look.
      Buffer[Index] = Index;
-    Buffer[Index + MAX_TEST_EVENT_NUM + Index] = (UINTN)(-1);
-    Buffer[Index + MAX_TEST_EVENT_NUM + 1 + Index] = (UINTN)(-1);
+    Buffer[Index + MAX_TEST_EVENT_NUM + Index] = (UINTN)(0xAA);
Magic Number 0xAA
+    Buffer[Index + MAX_TEST_EVENT_NUM + 1 + Index] = (UINTN)(0xAA);
Magic Number 0xAA. Please define Macro or const.
    }
      //
@@ -755,12 +759,12 @@ BBTestCreateEventEx_Func_Sub2 (
    UINTN               Buffer[MAX_TEST_EVENT_NUM + MAX_TEST_EVENT_NUM*2];
      //
-  // Initialize Buffer
+  // Initialize Buffer and the 0xAA is only for the Sub3 test
    //
    for (Index = 0; Index < MAX_TEST_EVENT_NUM; Index ++) {
      Buffer[Index] = Index;
-    Buffer[Index + MAX_TEST_EVENT_NUM + Index] = (UINTN)(-1);
-    Buffer[Index + MAX_TEST_EVENT_NUM + 1 + Index] = (UINTN)(-1);
+    Buffer[Index + MAX_TEST_EVENT_NUM + Index] = (UINTN)(0xAA);
Magic Number 0xAA. Please define Macro or const.
+    Buffer[Index + MAX_TEST_EVENT_NUM + 1 + Index] = (UINTN)(0xAA);
Magic Number 0xAA. Please define Macro or const.
    }
      //
@@ -914,12 +918,12 @@ BBTestCreateEventEx_Func_Sub3 (
    UINTN               Buffer[MAX_TEST_EVENT_NUM + MAX_TEST_EVENT_NUM*2];
      //
-  // Initialize Buffer
+  // Initialize Buffer and the trick to initial it as 0xAA
    //
    for (Index = 0; Index < MAX_TEST_EVENT_NUM; Index ++) {
      Buffer[Index] = Index;
-    Buffer[Index + MAX_TEST_EVENT_NUM + Index] = (UINTN)(-1);
-    Buffer[Index + MAX_TEST_EVENT_NUM + 1 + Index] = (UINTN)(-1);
+    Buffer[Index + MAX_TEST_EVENT_NUM + Index] = (UINTN)(0xAA);
Strange Logic here. Needs re-look. Also, Magic Number AA.
+    Buffer[Index + MAX_TEST_EVENT_NUM + 1 + Index] = (UINTN)(0xAA);
Strange Logic here. Needs re-look. Also, Magic Number AA.
    }
      //
@@ -974,7 +978,7 @@ BBTestCreateEventEx_Func_Sub3 (
    }
        //
-  // Install a configuration table at TPL_NOTIFY
+  // Call AllocatePage to change the memorymap
    //
    OldTpl = gtBS->RaiseTPL (TPL_NOTIFY);
    diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/EventTimerTaskPriorityServices/BlackBoxTest/Support.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/EventTimerTaskPriorityServices/BlackBoxTest/Support.c
index aa02383e..823e16ab 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/EventTimerTaskPriorityServices/BlackBoxTest/Support.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/EventTimerTaskPriorityServices/BlackBoxTest/Support.c
@@ -1,7 +1,7 @@
  /** @file
      Copyright 2006 - 2010 Unified EFI, Inc.<BR>
-  Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2010 - 2018, 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
@@ -64,6 +64,23 @@ NotifyFunctionTplEx(
        EventIndex = Buffer[0];
  +    //
+    // The special code for the sub3
+    // To block possible enter triggered by CreateEventEx
+    //
+    if (EventIndex != 2 && Buffer[4] == (UINTN)(0xAA))
Magic Numbers 2, 4 and OxAA.
+      return;
+
+    //
+    // The special code for the sub3
+    // To initial the Buffer and block the possible enter caused by the CloseEvent
+    //
+    if (EventIndex == 2 && Buffer[1] == (UINTN)(0xAA)) {
Magic Numbers 2, 1 and OxAA.
+      for (Index=1; Index<7; Index++) {
Magic Numbers 1, 7.
+        Buffer[Index] = (UINTN)(-1);
Magic Number -1.
+      }
+    }
+
      Index = 3-EventIndex;
Magic Number 3.
        while (1) {


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to