From patchwork Wed Aug 7 03:45:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Franz X-Patchwork-Id: 2839904 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 40D64BF535 for ; Wed, 7 Aug 2013 06:08:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5B63A201B7 for ; Wed, 7 Aug 2013 06:08:50 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4B89E201B3 for ; Wed, 7 Aug 2013 06:08:49 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V6uj2-0003mT-Jp; Wed, 07 Aug 2013 03:47:54 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V6uiM-0001QP-M0; Wed, 07 Aug 2013 03:47:10 +0000 Received: from mail-yh0-f50.google.com ([209.85.213.50]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V6uh4-0001Dq-10 for linux-arm-kernel@lists.infradead.org; Wed, 07 Aug 2013 03:45:59 +0000 Received: by mail-yh0-f50.google.com with SMTP id a41so491636yho.37 for ; Tue, 06 Aug 2013 20:45:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tMwV6t/+dCV2u1qE42fnBNsqAg2Ep6Qiov34Wh3wfgo=; b=ajwqxgVO6QHh4U/Nafg2jiRkmP2rSLyl/AWc5+O20IrbJ4me2ig0SLegiccCawesKD rKtIrPvGuQy54SIaWU/yGKOgNRjifI+KvrNnYb4CXuJSUWkGHHK1Qet0ELXnVxOO+toK wdw+s1l1Bb3NzoXIw5yPWfC1ZAubsDlzbVHMBMbFvQfc9pOeUWUoC4PzDGIhb+Gz289x od6/xGSdajrzkkwKd6YrcCDwnIXMI3MQehQYLeTYehqrSNwc546X2w6t3GK2PKoi1kGz RKUNB7ne/p1s6BhmvubjryNFBJvuzYo66UDkibmwEBJEqUne7yW6n6m/Nj9vCH+eJU7p 23vg== X-Gm-Message-State: ALoCoQkQc2Alc1c0OuhVJjeYeUnFaToOlstw51qqQkxiQ+QfERSLFzqqCpv85LvW8PhRcPhAbzOJ X-Received: by 10.236.145.199 with SMTP id p47mr660935yhj.235.1375847128950; Tue, 06 Aug 2013 20:45:28 -0700 (PDT) Received: from rfranz-v430.caveonetworks.com (64.2.3.195.ptr.us.xo.net. [64.2.3.195]) by mx.google.com with ESMTPSA id s65sm6814380yhs.14.2013.08.06.20.45.27 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 06 Aug 2013 20:45:28 -0700 (PDT) From: Roy Franz To: linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, matt.fleming@intel.com, linux@arm.linux.org.uk Subject: [PATCH 06/17] rename __get_map() to efi_get_memory_map(), add parameter to optionally return mmap key. The mmap key is required to exit EFI boot services, and allows efi_get_memory_map() to be used for getting final memory map. Date: Tue, 6 Aug 2013 20:45:02 -0700 Message-Id: <1375847113-24884-7-git-send-email-roy.franz@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1375847113-24884-1-git-send-email-roy.franz@linaro.org> References: <1375847113-24884-1-git-send-email-roy.franz@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130806_234550_185518_26AF2F5A X-CRM114-Status: UNSURE ( 8.33 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) Cc: Roy Franz , dave.martin@arm.com, leif.lindholm@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Roy Franz --- drivers/firmware/efi/efi-stub-helper.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/firmware/efi/efi-stub-helper.c b/drivers/firmware/efi/efi-stub-helper.c index 63e3556..cd7701f 100644 --- a/drivers/firmware/efi/efi-stub-helper.c +++ b/drivers/firmware/efi/efi-stub-helper.c @@ -46,10 +46,11 @@ static void efi_printk(efi_system_table_t *sys_table_arg, char *str) } -static efi_status_t __get_map(efi_system_table_t *sys_table_arg, - efi_memory_desc_t **map, - unsigned long *map_size, - unsigned long *desc_size) +static efi_status_t efi_get_memory_map(efi_system_table_t *sys_table_arg, + efi_memory_desc_t **map, + unsigned long *map_size, + unsigned long *desc_size, + unsigned long *key_ptr) { efi_memory_desc_t *m = NULL; efi_status_t status; @@ -77,6 +78,8 @@ again: if (status != EFI_SUCCESS) efi_call_phys1(sys_table_arg->boottime->free_pool, m); + if (key_ptr && status == EFI_SUCCESS) + *key_ptr = key; fail: *map = m; @@ -97,7 +100,8 @@ static efi_status_t efi_high_alloc(efi_system_table_t *sys_table_arg, u64 max_addr = 0; int i; - status = __get_map(sys_table_arg, &map, &map_size, &desc_size); + status = efi_get_memory_map(sys_table_arg, &map, &map_size, &desc_size, + NULL); if (status != EFI_SUCCESS) goto fail; @@ -175,7 +179,8 @@ static efi_status_t efi_low_alloc(efi_system_table_t *sys_table_arg, unsigned long nr_pages; int i; - status = __get_map(sys_table_arg, &map, &map_size, &desc_size); + status = efi_get_memory_map(sys_table_arg, &map, &map_size, &desc_size, + NULL); if (status != EFI_SUCCESS) goto fail;