From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E9FDA223CDC21 for ; Mon, 5 Mar 2018 19:33:24 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Mar 2018 19:39:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,430,1515484800"; d="scan'208";a="209154730" Received: from ray-dev.ccr.corp.intel.com ([10.239.9.44]) by fmsmga006.fm.intel.com with ESMTP; 05 Mar 2018 19:39:37 -0800 From: Ruiyu Ni To: edk2-devel@lists.01.org Cc: Liming Gao Date: Tue, 6 Mar 2018 11:39:32 +0800 Message-Id: <20180306033933.278752-2-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.16.1.windows.1 In-Reply-To: <20180306033933.278752-1-ruiyu.ni@intel.com> References: <20180306033933.278752-1-ruiyu.ni@intel.com> Subject: [PATCH 1/2] MdeModulePkg/NullMemoryTest: Change prototype of ConvertToTestedMemory X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2018 03:33:25 -0000 The patch should not impact the functionality. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Liming Gao --- .../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