Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp802328pxu; Wed, 7 Oct 2020 16:56:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTnuQsAChTgN2l+mlZfov9YAOEsS+pr82uzPfTthHcmd0JzVIxydlKNHBJZG2igHF9oLDc X-Received: by 2002:a17:906:3290:: with SMTP id 16mr4472309ejw.308.1602114961581; Wed, 07 Oct 2020 16:56:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602114961; cv=none; d=google.com; s=arc-20160816; b=sG++SLRWFu+cCIANMUTtC31kUos5jVetISYdyEH9GhfVVEdqxJDsuNbhUeNqtG+fbc 8QfaAPK/46DJYRVYf+flqfCUe9eStuPi9SUj0qrh1LfzaFjXELc3XAmPXBaxxoGID6cl e+y79z2PMGJgJLWCnfPWj9Fe+S4056W2rPGISph+e1rG4ucX9CebSWwi2pm9NXFNr6ye q9RVCDomP0sOAYxqpWaKvx3WXB4aOf+072xIOurdtGXOb7umcQN3aOWbjVylHq8ZuxPM CNGbKqwzcsU0m/SYfh4bgDKaDv1655Uy1n+SfpcXRZNcx9wiKJaokzL8KgdT12MRdjKd WOJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=o5OvaQB6bbpSDlYD+VA1usRAYhfy2fhJn0w2gDouEVE=; b=UNRt88Gs0dlqxWCNlsnRfyZAl9hku9YMQwzTmJ8exUEHUTltt11pz1lKYTJD6sb/Ri l3KXaxKJJwv/ZDkXb/aiOTpBATMjTAh+i3Z7mn7UO/aHHT54qVkQ2V5LoND0gvTa1O/s /Zq4puh8QDlru7zh537HPSeOT/7nNySC2sM7KnQVG+mqNdXObKaUtuW+9/Ne771ARh8U u47ogU39ZUOv1FL9BI6bOHiOWao/J6gv+XyyiANGB1MGeym1VbiRTL4uZZ0O9pbzZm0W 2OrOgTmibNtjJuDC36P5egDQjyvlAkVHw5GLtcLys1NSHgptHXj1njPM6Ss22hFwe4nl zUMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q11si2431218eds.162.2020.10.07.16.55.37; Wed, 07 Oct 2020 16:56:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728565AbgJGTyC (ORCPT + 99 others); Wed, 7 Oct 2020 15:54:02 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:35637 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728516AbgJGTx5 (ORCPT ); Wed, 7 Oct 2020 15:53:57 -0400 Received: by mail-qt1-f193.google.com with SMTP id o21so3089682qtp.2 for ; Wed, 07 Oct 2020 12:53:54 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=o5OvaQB6bbpSDlYD+VA1usRAYhfy2fhJn0w2gDouEVE=; b=rnk3thEvFbljAn/nNQeFm8xipZwIlwyZEdfSQzPQ2GUsx0xe/8QW0F72NRmI6Vk9Ss J1PE8OaOFRdI2UFqRWYWe9Nt/QoKrMACH5WfOiphqX8FsF5heoQ6uHzx/yoYz6+tgMs+ e3sGX0+yQCslpbXTo5s0ePmzfZMpX244Ji7DRf3aLoQWV43zuBEqZQSo6e0FOf2ZS/6V eS+CXK1uI3gMfOVvYTFVG7prrMiCFxL2wuEnm0oCKmK8a9yUNwwMbgGQ7cGs8cJLfhq2 GEw7z0KoMuRYPtBc02+GpitF7vPWpyIRynu1whuSmHl4iGwoYus1eV8ziQU1CdkIIcF5 2CJg== X-Gm-Message-State: AOAM532QrqbFC4L9tbnPkJyEcMwxsV5h30HLStTiT70/1RcIgtws56oh 8iinBByTpjKJ+E1usqfNsKE= X-Received: by 2002:aed:2310:: with SMTP id h16mr4998668qtc.323.1602100434466; Wed, 07 Oct 2020 12:53:54 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id k20sm2287658qtm.44.2020.10.07.12.53.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Oct 2020 12:53:54 -0700 (PDT) From: Arvind Sankar To: x86@kernel.org, Joerg Roedel Cc: linux-kernel@vger.kernel.org Subject: [PATCH 2/5] x86/boot: Move get_cmd_line_ptr() and COMMAND_LINE_SIZE into misc.h Date: Wed, 7 Oct 2020 15:53:48 -0400 Message-Id: <20201007195351.776555-3-nivedita@alum.mit.edu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201007195351.776555-1-nivedita@alum.mit.edu> References: <20201007195351.776555-1-nivedita@alum.mit.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move get_cmd_line_ptr() and COMMAND_LINE_SIZE into misc.h for easier use from multiple files. Signed-off-by: Arvind Sankar --- arch/x86/boot/compressed/cmdline.c | 8 -------- arch/x86/boot/compressed/kaslr.c | 6 ------ arch/x86/boot/compressed/misc.h | 13 +++++++++++++ 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/arch/x86/boot/compressed/cmdline.c b/arch/x86/boot/compressed/cmdline.c index f1add5d85da9..d0e1d386749d 100644 --- a/arch/x86/boot/compressed/cmdline.c +++ b/arch/x86/boot/compressed/cmdline.c @@ -12,14 +12,6 @@ static inline char rdfs8(addr_t addr) return *((char *)(fs + addr)); } #include "../cmdline.c" -unsigned long get_cmd_line_ptr(void) -{ - unsigned long cmd_line_ptr = boot_params->hdr.cmd_line_ptr; - - cmd_line_ptr |= (u64)boot_params->ext_cmd_line_ptr << 32; - - return cmd_line_ptr; -} int cmdline_find_option(const char *option, char *buffer, int bufsize) { return __cmdline_find_option(get_cmd_line_ptr(), option, buffer, bufsize); diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c index b59547ce5b19..f3286a3bef36 100644 --- a/arch/x86/boot/compressed/kaslr.c +++ b/arch/x86/boot/compressed/kaslr.c @@ -36,12 +36,6 @@ #define STATIC #include -#define _SETUP -#include /* For COMMAND_LINE_SIZE */ -#undef _SETUP - -extern unsigned long get_cmd_line_ptr(void); - /* Simplified build-specific string for starting entropy. */ static const char build_str[] = UTS_RELEASE " (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION; diff --git a/arch/x86/boot/compressed/misc.h b/arch/x86/boot/compressed/misc.h index 6d31f1b4c4d1..95aacc361f78 100644 --- a/arch/x86/boot/compressed/misc.h +++ b/arch/x86/boot/compressed/misc.h @@ -25,6 +25,10 @@ #include #include +#define _SETUP +#include /* For COMMAND_LINE_SIZE */ +#undef _SETUP + #define BOOT_CTYPE_H #include @@ -70,6 +74,15 @@ static inline void debug_puthex(unsigned long value) #endif /* cmdline.c */ +static inline +unsigned long get_cmd_line_ptr(void) +{ + unsigned long cmd_line_ptr = boot_params->hdr.cmd_line_ptr; + + cmd_line_ptr |= (u64)boot_params->ext_cmd_line_ptr << 32; + + return cmd_line_ptr; +} int cmdline_find_option(const char *option, char *buffer, int bufsize); int cmdline_find_option_bool(const char *option); -- 2.26.2