From patchwork Fri Aug 9 23:26:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Franz X-Patchwork-Id: 2842252 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 36C14BF546 for ; Fri, 9 Aug 2013 23:29:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3390520345 for ; Fri, 9 Aug 2013 23:29:20 +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 316B820316 for ; Fri, 9 Aug 2013 23:29:19 +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 1V7w6P-00014V-NT; Fri, 09 Aug 2013 23:28:14 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V7w62-0003ib-0t; Fri, 09 Aug 2013 23:27:50 +0000 Received: from mail-pd0-f177.google.com ([209.85.192.177]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V7w5A-0003Yp-Rw for linux-arm-kernel@lists.infradead.org; Fri, 09 Aug 2013 23:26:58 +0000 Received: by mail-pd0-f177.google.com with SMTP id y10so1128375pdj.8 for ; Fri, 09 Aug 2013 16:26:35 -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=O+aAjAlX2P/H0Im0opD6PhloDRBibvuDRSqyX0GgywE=; b=BNKeKziYpRBfu6vkRkDftwfQiV3GEH5lKj8jXhflTNpagozFSpYKT4UCW7eJtUAlmK Q2DG7IA7JCC0sLt9jvzq1l53Jl6El8AhHflbnB52eq/cDECSWxukMpoCfPQO4ZLyzNiD 29KbWokrOmi84ni/XeXOgiDIWr/PcAYSahm0Ze9JxRgu9dcyT/7KTEeDO8vCBWMFFr6P leIt9YQz90i9UjCJKWo1nXMls4c/SUS61zCro3CHY16RXruABMnF1MN1wY9mBVzSqL8h AmIFCw/dmDyuAwQduzmBIwWZU4srHXJx+jq+YUqemxcYHzSCarfiFofdkcAO25UKZPtB /0AQ== X-Gm-Message-State: ALoCoQn9a6MFwXYYUZHjvuLQub0+4u8kJIQU934WghkVn7tvIcbjcmADaRrmDifIg7aEqJa4CTlg X-Received: by 10.66.164.1 with SMTP id ym1mr3026206pab.28.1376090795500; Fri, 09 Aug 2013 16:26:35 -0700 (PDT) Received: from rfranz-i7.local (c-24-10-48-230.hsd1.ca.comcast.net. [24.10.48.230]) by mx.google.com with ESMTPSA id ue9sm24823913pab.7.2013.08.09.16.26.33 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 16:26:34 -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 05/16] 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: Fri, 9 Aug 2013 16:26:06 -0700 Message-Id: <1376090777-20090-6-git-send-email-roy.franz@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1376090777-20090-1-git-send-email-roy.franz@linaro.org> References: <1376090777-20090-1-git-send-email-roy.franz@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130809_192657_040421_73660004 X-CRM114-Status: UNSURE ( 9.06 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) Cc: Roy Franz , dave.martin@arm.com, leif.lindholm@linaro.org, msalter@redhat.com 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 Acked-by: Mark Salter --- 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 40cd16e..1d0a079 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;