From patchwork Thu Aug 3 10:04:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 109310 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp573366qge; Thu, 3 Aug 2017 03:10:28 -0700 (PDT) X-Received: by 10.237.34.180 with SMTP id p49mr1315436qtc.163.1501755027962; Thu, 03 Aug 2017 03:10:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501755027; cv=none; d=google.com; s=arc-20160816; b=LFvzLCs5pa8bXx56MWfvgPeVx29ciFxrYRLq516KCrptyJhHLS2s5YycNoAJWFMQln 5+U5jeWdn2wXW0cnsfj0reDofKCZdKZjb8QoXQ1fqRNtd4pmluksoBucABZHas60yFAN GkEHqoB8J5583c2749xAR9pPwdLe4qhKrZZzB3gWkMw9PaT+oyuKA2/l2C/C2Xg8vga3 L6cuBCujkPAasxOEx6Y2ea0J6ftExljrMQExFd4exEp1+/hsJvmWY34j/mmAPxnQct/B /PtSdwYjKSuen+HZm3gP0iDzalOuwCSx4bIJT80kiJ53aqdgKFTGwYY1Lg+siITNMaNs INxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature:arc-authentication-results; bh=2EbIRiJqK14hzPpToOanEeBgwHByGWgLVuRMLgsZ8xM=; b=q/VkrmaEZIym/+YDxN+qjqiJZoMIqX6rfNxXVpqXtVpQp7wu4NMj0G/Orpxk2jMXyD jxmk1hT1RhB5Ri1hmeWnkjhgtTU4rlmV7Ug2OI8uvjhIWghU0qY3i567t63QDv4Q8UKz sABLMv4R8DKouY7wlhjdUWQqcDPcag5w8MIlvZUXvY0etrhc8T0kAY1vujyGUArZbj/+ n5jnXgCmB/2DhTV6Ry9dWSGwk7hOr9/Q/Wm98hrX1K51Xs4zMhAIxLAChTWqqEpdwyxB xZ2BmC8Qbyd+Yh7U/r487CrZYWUEeo1SEQTfNJy/XmGP5rZoPGoKW9fk78QiTGh38FRh GCjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=driwqUnS; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=grub-devel-bounces+patch=linaro.org@gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id j4si32920919qkh.52.2017.08.03.03.10.26 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 03 Aug 2017 03:10:27 -0700 (PDT) Received-SPF: pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=driwqUnS; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=grub-devel-bounces+patch=linaro.org@gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:53216 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddD5E-0002cv-4G for patch@linaro.org; Thu, 03 Aug 2017 06:10:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddD1g-0000Hr-Qb for grub-devel@gnu.org; Thu, 03 Aug 2017 06:06:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ddD1f-0004By-CI for grub-devel@gnu.org; Thu, 03 Aug 2017 06:06:44 -0400 Received: from mail-wr0-x236.google.com ([2a00:1450:400c:c0c::236]:37236) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ddD1f-0004Az-4j for grub-devel@gnu.org; Thu, 03 Aug 2017 06:06:43 -0400 Received: by mail-wr0-x236.google.com with SMTP id 33so3716645wrz.4 for ; Thu, 03 Aug 2017 03:06:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SIHJipF/O4IOnL2Qn2/rXLcwLZRoT04WyhYqUH1AGU4=; b=driwqUnSGGpvy8Wi4yWz6FiuAWKsbqHhA7BidM2Ffkv2X5ZJ0K7dSYOP0sK6ojiKGJ HLN5zGstcXGYO4IypBnGMy6ecneqlXmW+gXSmsQ8nq45xmWXUEbZCbS7czTYO5gEjsAA 1pM0emPdorD4gnaMxwWYYMVCiVK5IMv6VnIlM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SIHJipF/O4IOnL2Qn2/rXLcwLZRoT04WyhYqUH1AGU4=; b=P8rQ5KU23xWnVhkmaZPGewvbwVlSETMs9AjGA7T7A/c8Lnhj29+182nXgLVjAAuyXO AEdP327Dumvv0bs91qGR8kH3Hu4KF76LFgj5jH7TJVWnJGP4a2dRnfZ45rwqYI/e9GGY zSnE45aeBa0LHX4YvxI77AuN2d7WJuFtwWXBPKM+ce2GVHQl1ZPD2ncxcCk+OhdF61aK ur6VN/TTCEhze9d7JVPMzJzx5Lq5Dj2MXDwPLL+9LFQ1fN3LFvbocVDswQFOCEca8i3L jEf4W//tuBuDqAqooY3u47Kbd7VfbV1D/S92OAflMwTjTyJU9HiG4DNJRQSmU5c+q/RP eD3w== X-Gm-Message-State: AIVw112vV2YCIiTRa7Slro3VJR+gUFgHWe3znj2G0lwTwI5uYydIXsWX LXxouqgiPWd6Jh1tqjRX+g== X-Received: by 10.223.163.135 with SMTP id l7mr1033777wrb.89.1501754801858; Thu, 03 Aug 2017 03:06:41 -0700 (PDT) Received: from vanye.hemma.eciton.net (cpc92316-cmbg19-2-0-cust118.5-4.cable.virginm.net. [82.12.0.119]) by smtp.gmail.com with ESMTPSA id e5sm2274543wre.24.2017.08.03.03.06.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Aug 2017 03:06:41 -0700 (PDT) From: Leif Lindholm To: grub-devel@gnu.org Subject: [PATCH v2 08/14] arm64 linux loader: improve type portability Date: Thu, 3 Aug 2017 11:04:26 +0100 Message-Id: <20170803100432.29913-9-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170803100432.29913-1-leif.lindholm@linaro.org> References: <20170803100432.29913-1-leif.lindholm@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::236 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The development of GNU GRUB Cc: Daniel Kiper MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" In preparation for turning this into a common loader for 32-bit and 64-bit platforms, ensure the code will compile cleanly for either. Signed-off-by: Leif Lindholm --- grub-core/loader/arm64/linux.c | 15 ++++++--------- grub-core/loader/efi/fdt.c | 8 ++++---- 2 files changed, 10 insertions(+), 13 deletions(-) -- 2.11.0 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c index 57ee43fac..c60469e53 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -58,8 +58,6 @@ grub_arm64_uefi_check_image (struct grub_arm64_linux_kernel_header * lh) N_("plain image kernel not supported - rebuild with CONFIG_(U)EFI_STUB enabled")); grub_dprintf ("linux", "UEFI stub kernel:\n"); - grub_dprintf ("linux", "text_offset = 0x%012llx\n", - (long long unsigned) lh->text_offset); grub_dprintf ("linux", "PE/COFF header @ %08x\n", lh->hdr_offset); return GRUB_ERR_NONE; @@ -87,8 +85,8 @@ finalize_params_linux (void) /* Set initrd info */ if (initrd_start && initrd_end > initrd_start) { - grub_dprintf ("linux", "Initrd @ 0x%012lx-0x%012lx\n", - initrd_start, initrd_end); + grub_dprintf ("linux", "Initrd @ %p-%p\n", + (void *) initrd_start, (void *) initrd_end); retval = grub_fdt_set_prop64 (fdt, node, "linux,initrd-start", initrd_start); @@ -163,7 +161,7 @@ grub_arm64_uefi_boot_image (grub_addr_t addr, grub_size_t size, char *args) /* When successful, not reached */ b->unload_image (image_handle); - grub_efi_free_pages ((grub_efi_physical_address_t) loaded_image->load_options, + grub_efi_free_pages ((grub_addr_t) loaded_image->load_options, GRUB_EFI_BYTES_TO_PAGES (loaded_image->load_options_size)); return grub_errno; @@ -190,7 +188,7 @@ grub_linux_unload (void) initrd_start = initrd_end = 0; grub_free (linux_args); if (kernel_addr) - grub_efi_free_pages ((grub_efi_physical_address_t) kernel_addr, + grub_efi_free_pages ((grub_addr_t) kernel_addr, GRUB_EFI_BYTES_TO_PAGES (kernel_size)); grub_fdt_unload (); return GRUB_ERR_NONE; @@ -242,8 +240,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), fail: grub_initrd_close (&initrd_ctx); if (initrd_mem && !initrd_start) - grub_efi_free_pages ((grub_efi_physical_address_t) initrd_mem, - initrd_pages); + grub_efi_free_pages ((grub_addr_t) initrd_mem, initrd_pages); return grub_errno; } @@ -330,7 +327,7 @@ fail: grub_free (linux_args); if (kernel_addr && !loaded) - grub_efi_free_pages ((grub_efi_physical_address_t) kernel_addr, + grub_efi_free_pages ((grub_addr_t) kernel_addr, GRUB_EFI_BYTES_TO_PAGES (kernel_size)); return grub_errno; diff --git a/grub-core/loader/efi/fdt.c b/grub-core/loader/efi/fdt.c index 9715afee0..08bdb3d51 100644 --- a/grub-core/loader/efi/fdt.c +++ b/grub-core/loader/efi/fdt.c @@ -33,12 +33,12 @@ void * grub_fdt_load (grub_size_t additional_size) { void *raw_fdt; - grub_size_t size; + unsigned int size; if (fdt) { size = GRUB_EFI_BYTES_TO_PAGES (grub_fdt_get_totalsize (fdt)); - grub_efi_free_pages ((grub_efi_physical_address_t) fdt, size); + grub_efi_free_pages ((grub_addr_t) fdt, size); } if (loaded_fdt) @@ -50,7 +50,7 @@ grub_fdt_load (grub_size_t additional_size) raw_fdt ? grub_fdt_get_totalsize (raw_fdt) : GRUB_FDT_EMPTY_TREE_SZ; size += additional_size; - grub_dprintf ("linux", "allocating %ld bytes for fdt\n", size); + grub_dprintf ("linux", "allocating %d bytes for fdt\n", size); fdt = grub_efi_allocate_pages (0, GRUB_EFI_BYTES_TO_PAGES (size)); if (!fdt) return NULL; @@ -89,7 +89,7 @@ grub_fdt_unload (void) { if (!fdt) { return; } - grub_efi_free_pages ((grub_efi_physical_address_t) fdt, + grub_efi_free_pages ((grub_addr_t) fdt, GRUB_EFI_BYTES_TO_PAGES (grub_fdt_get_totalsize (fdt))); fdt = NULL; }