From patchwork Tue Jun 30 13:17:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 50477 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 96713229DF for ; Tue, 30 Jun 2015 13:18:10 +0000 (UTC) Received: by wguu7 with SMTP id u7sf3864086wgu.0 for ; Tue, 30 Jun 2015 06:18:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:reply-to:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=lqB5zlBEv5nYYnFKqBerS6fKfHJPVSjAs4QTdlxgI48=; b=eGRU/L+tDmqY6jA/9IZ7sxEeWhyXfR2iJn+4CjJ50ssoU4eXP8T7VVMETsDWWyWBVY t6L0wHJYJ0Epw6DomW8BCymWgznFY05SCzG9iLn8o1y6XUaTgO4ybAjQ/8f+0LhILzfB mzEhmUmu1cTLQQwlaA5jJi5W9bgbTwrEptvr1ategVjkpoY67jazczrh+sJbgbZr6uvr xo0RstwnHGsCm9QGG29He2n1j1RVe+W0jcCXjoD/gT+uJ/Aihr/c2kUZNIOcFs+e9bY/ WTRkClkDyMK3iqgajxTzel6l7HspRbNXDt7HDO79RwryeJC7Cv+e5Quv51ZOJBixcHDI 8gAQ== X-Gm-Message-State: ALoCoQkHFxF/bajECovIh9HGZ3hfhP/+ba7vHGDjNQivEZ/A59QUgpzK8w8LWfLF9YyOQh34j1HI X-Received: by 10.180.37.198 with SMTP id a6mr11803825wik.7.1435670289958; Tue, 30 Jun 2015 06:18:09 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.136 with SMTP id q8ls49406laj.91.gmail; Tue, 30 Jun 2015 06:18:09 -0700 (PDT) X-Received: by 10.152.6.105 with SMTP id z9mr19346253laz.98.1435670289790; Tue, 30 Jun 2015 06:18:09 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id nr6si38135436lbb.11.2015.06.30.06.18.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jun 2015 06:18:09 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by lagh6 with SMTP id h6so13008089lag.2 for ; Tue, 30 Jun 2015 06:18:09 -0700 (PDT) X-Received: by 10.112.160.165 with SMTP id xl5mr19600193lbb.36.1435670289334; Tue, 30 Jun 2015 06:18:09 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp2444434lbb; Tue, 30 Jun 2015 06:18:08 -0700 (PDT) X-Received: by 10.50.178.133 with SMTP id cy5mr23846239igc.5.1435670287609; Tue, 30 Jun 2015 06:18:07 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id l97si12119225iod.39.2015.06.30.06.18.06 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 30 Jun 2015 06:18:07 -0700 (PDT) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Z9vQ9-0004k0-KB; Tue, 30 Jun 2015 13:17:53 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Z9vQ8-0004jv-MB for edk2-devel@lists.sourceforge.net; Tue, 30 Jun 2015 13:17:52 +0000 Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of linaro.org designates 74.125.82.49 as permitted sender) client-ip=74.125.82.49; envelope-from=ard.biesheuvel@linaro.org; helo=mail-wg0-f49.google.com; Received: from mail-wg0-f49.google.com ([74.125.82.49]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1Z9vQ7-0003GX-Kx for edk2-devel@lists.sourceforge.net; Tue, 30 Jun 2015 13:17:52 +0000 Received: by wgck11 with SMTP id k11so9576741wgc.0 for ; Tue, 30 Jun 2015 06:17:45 -0700 (PDT) X-Received: by 10.180.37.229 with SMTP id b5mr33307482wik.16.1435670265677; Tue, 30 Jun 2015 06:17:45 -0700 (PDT) Received: from localhost.localdomain ([185.13.106.91]) by mx.google.com with ESMTPSA id lk5sm16980848wic.24.2015.06.30.06.17.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Jun 2015 06:17:44 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.sourceforge.net, lersek@redhat.com, jiewen.yao@intel.com Date: Tue, 30 Jun 2015 15:17:31 +0200 Message-Id: <1435670255-4106-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1435670255-4106-1-git-send-email-ard.biesheuvel@linaro.org> References: <1435670255-4106-1-git-send-email-ard.biesheuvel@linaro.org> X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1Z9vQ7-0003GX-Kx Cc: matt.fleming@intel.com Subject: [edk2] [PATCH 1/5] MdeModulePkg: remove unused functions from Core/Dxe/Misc/PropertiesTable.c X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 This removes the functions RevertRuntimeMemoryMap () and DumpMemoryMap () which are not referenced anywhere in the code. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c | 82 -------------------- 1 file changed, 82 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c b/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c index 351599311281..24240113659d 100644 --- a/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c +++ b/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c @@ -144,35 +144,6 @@ CoreReleasePropertiesTableLock ( } /** - Dump memory map. - - @param MemoryMap A pointer to the buffer in which firmware places - the current memory map. - @param MemoryMapSize Size, in bytes, of the MemoryMap buffer. - @param DescriptorSize Size, in bytes, of an individual EFI_MEMORY_DESCRIPTOR. -**/ -VOID -DumpMemoryMap ( - IN EFI_MEMORY_DESCRIPTOR *MemoryMap, - IN UINTN MemoryMapSize, - IN UINTN DescriptorSize - ) -{ - EFI_MEMORY_DESCRIPTOR *MemoryMapEntry; - EFI_MEMORY_DESCRIPTOR *MemoryMapEnd; - UINT64 MemoryBlockLength; - - DEBUG ((EFI_D_VERBOSE, " MemoryMap:\n")); - MemoryMapEntry = MemoryMap; - MemoryMapEnd = (EFI_MEMORY_DESCRIPTOR *) ((UINT8 *) MemoryMap + MemoryMapSize); - while (MemoryMapEntry < MemoryMapEnd) { - MemoryBlockLength = (UINT64) (EfiPagesToSize (MemoryMapEntry->NumberOfPages)); - DEBUG ((EFI_D_VERBOSE, " Entry(0x%02x) 0x%016lx - 0x%016lx (0x%016lx)\n", MemoryMapEntry->Type, MemoryMapEntry->PhysicalStart, MemoryMapEntry->PhysicalStart + MemoryBlockLength, MemoryMapEntry->Attribute)); - MemoryMapEntry = NEXT_MEMORY_DESCRIPTOR (MemoryMapEntry, DescriptorSize); - } -} - -/** Sort memory map entries based upon PhysicalStart, from low to high. @param MemoryMap A pointer to the buffer in which firmware places @@ -305,59 +276,6 @@ EnforceMemoryMapAttribute ( } /** - Sort memory map entries whose type is EfiRuntimeServicesCode/EfiRuntimeServicesData, - from high to low. - This function assumes memory map is already from low to high, so it just reverts them. - - @param MemoryMap A pointer to the buffer in which firmware places - the current memory map. - @param MemoryMapSize Size, in bytes, of the MemoryMap buffer. - @param DescriptorSize Size, in bytes, of an individual EFI_MEMORY_DESCRIPTOR. -**/ -VOID -RevertRuntimeMemoryMap ( - IN OUT EFI_MEMORY_DESCRIPTOR *MemoryMap, - IN UINTN MemoryMapSize, - IN UINTN DescriptorSize - ) -{ - EFI_MEMORY_DESCRIPTOR *MemoryMapEntry; - EFI_MEMORY_DESCRIPTOR *MemoryMapEnd; - EFI_MEMORY_DESCRIPTOR TempMemoryMap; - - EFI_MEMORY_DESCRIPTOR *RuntimeMapEntryBegin; - EFI_MEMORY_DESCRIPTOR *RuntimeMapEntryEnd; - - MemoryMapEntry = MemoryMap; - RuntimeMapEntryBegin = NULL; - RuntimeMapEntryEnd = NULL; - MemoryMapEnd = (EFI_MEMORY_DESCRIPTOR *) ((UINT8 *) MemoryMap + MemoryMapSize); - while ((UINTN)MemoryMapEntry < (UINTN)MemoryMapEnd) { - if ((MemoryMapEntry->Type == EfiRuntimeServicesCode) || - (MemoryMapEntry->Type == EfiRuntimeServicesData)) { - if (RuntimeMapEntryBegin == NULL) { - RuntimeMapEntryBegin = MemoryMapEntry; - } - RuntimeMapEntryEnd = MemoryMapEntry; - } - MemoryMapEntry = NEXT_MEMORY_DESCRIPTOR (MemoryMapEntry, DescriptorSize); - } - - MemoryMapEntry = RuntimeMapEntryBegin; - MemoryMapEnd = RuntimeMapEntryEnd; - while (MemoryMapEntry < MemoryMapEnd) { - CopyMem (&TempMemoryMap, MemoryMapEntry, sizeof(EFI_MEMORY_DESCRIPTOR)); - CopyMem (MemoryMapEntry, MemoryMapEnd, sizeof(EFI_MEMORY_DESCRIPTOR)); - CopyMem (MemoryMapEnd, &TempMemoryMap, sizeof(EFI_MEMORY_DESCRIPTOR)); - - MemoryMapEntry = NEXT_MEMORY_DESCRIPTOR (MemoryMapEntry, DescriptorSize); - MemoryMapEnd = PREVIOUS_MEMORY_DESCRIPTOR (MemoryMapEnd, DescriptorSize); - } - - return ; -} - -/** Return the first image record, whose [ImageBase, ImageSize] covered by [Buffer, Length]. @param Buffer Start Address