public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ruiyu Ni <ruiyu.ni@intel.com>
To: edk2-devel@lists.01.org
Cc: Liming Gao <liming.gao@intel.com>
Subject: [PATCH 1/2] MdeModulePkg/NullMemoryTest: Change prototype of ConvertToTestedMemory
Date: Tue,  6 Mar 2018 11:39:32 +0800	[thread overview]
Message-ID: <20180306033933.278752-2-ruiyu.ni@intel.com> (raw)
In-Reply-To: <20180306033933.278752-1-ruiyu.ni@intel.com>

The patch should not impact the functionality.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
---
 .../MemoryTest/NullMemoryTestDxe/NullMemoryTest.c  | 37 ++++++++++++++--------
 1 file changed, 24 insertions(+), 13 deletions(-)

diff --git a/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTest.c b/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTest.c
index 11af8ea77f..c66f3fd208 100644
--- a/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTest.c
+++ b/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTest.c
@@ -59,37 +59,40 @@ GenericMemoryTestEntryPoint (
 }
 
 /**
-  Convert the memory descriptor to tested.
+  Convert the memory range to tested.
 
-  @param Descriptor  Pointer to EFI_GCD_MEMORY_SPACE_DESCRIPTOR
+  @param BaseAddress  Base address of the memory range.
+  @param Length       Length of the memory range.
+  @param Capabilities Capabilities of the memory range.
 
-  @retval EFI_SUCCESS The memory descriptor is converted to tested.
+  @retval EFI_SUCCESS The memory range is converted to tested.
   @retval others      Error happens.
 **/
 EFI_STATUS
 ConvertToTestedMemory (
-  IN CONST EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Descriptor
+  IN UINT64           BaseAddress,
+  IN UINT64           Length,
+  IN UINT64           Capabilities
   )
 {
   EFI_STATUS Status;
   Status = gDS->RemoveMemorySpace (
-                  Descriptor->BaseAddress,
-                  Descriptor->Length
+                  BaseAddress,
+                  Length
                   );
   if (!EFI_ERROR (Status)) {
     Status = gDS->AddMemorySpace (
-                    ((Descriptor->Capabilities & EFI_MEMORY_MORE_RELIABLE) == EFI_MEMORY_MORE_RELIABLE) ?
+                    ((Capabilities & EFI_MEMORY_MORE_RELIABLE) == EFI_MEMORY_MORE_RELIABLE) ?
                     EfiGcdMemoryTypeMoreReliable : EfiGcdMemoryTypeSystemMemory,
-                    Descriptor->BaseAddress,
-                    Descriptor->Length,
-                    Descriptor->Capabilities &~
+                    BaseAddress,
+                    Length,
+                    Capabilities &~
                     (EFI_MEMORY_PRESENT | EFI_MEMORY_INITIALIZED | EFI_MEMORY_TESTED | EFI_MEMORY_RUNTIME)
                     );
   }
   return Status;
 }
 
-
 /**
   Initialize the generic memory test.
 
@@ -129,7 +132,11 @@ InitializeMemoryTest (
       //
       // For those reserved memory that have not been tested, simply promote to system memory.
       //
-      Status = ConvertToTestedMemory (&MemorySpaceMap[Index]);
+      Status = ConvertToTestedMemory (
+                 MemorySpaceMap[Index].BaseAddress,
+                 MemorySpaceMap[Index].Length,
+                 MemorySpaceMap[Index].Capabilities
+                 );
       ASSERT_EFI_ERROR (Status);
       mTestedSystemMemory += MemorySpaceMap[Index].Length;
       mTotalSystemMemory += MemorySpaceMap[Index].Length;
@@ -236,7 +243,11 @@ GenCompatibleRangeTest (
 
   Status = gDS->GetMemorySpaceDescriptor (StartAddress, &Descriptor);
   if (!EFI_ERROR (Status)) {
-    Status = ConvertToTestedMemory (&Descriptor);
+    Status = ConvertToTestedMemory (
+               Descriptor.BaseAddress,
+               Descriptor.Length,
+               Descriptor.Capabilities
+               );
   }
   return Status;
 }
-- 
2.16.1.windows.1



  reply	other threads:[~2018-03-06  3:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-06  3:39 [PATCH 0/2] Fix bug in CompatibleRangeTest Ruiyu Ni
2018-03-06  3:39 ` Ruiyu Ni [this message]
2018-03-06  3:39 ` [PATCH 2/2] MdeModulePkg/NullMemoryTest: " Ruiyu Ni
2018-03-07  4:09 ` [PATCH 0/2] " Kinney, Michael D
2018-03-07  4:25   ` Gao, Liming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180306033933.278752-2-ruiyu.ni@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox