From patchwork Wed Nov 20 02:43:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Kerr X-Patchwork-Id: 1197787 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47HnhC4QZFz9sPV for ; Wed, 20 Nov 2019 14:08:27 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="nq8F/MR6"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 47HnhC27wbzDqc7 for ; Wed, 20 Nov 2019 14:08:27 +1100 (AEDT) X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 47Hn9W5PvrzDqq0 for ; Wed, 20 Nov 2019 13:45:19 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="nq8F/MR6"; dkim-atps=neutral Received: by ozlabs.org (Postfix, from userid 1023) id 47Hn9W2m64z9sPc; Wed, 20 Nov 2019 13:45:19 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1574217919; bh=QPl/3R2UsZom6dlAIO08Omo36hxQo/tqwLs3W0Eugqo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nq8F/MR6GW1qlpxvDnMVgkQ84eW/LvAsVDjZ39JE9XgZigyvo72l7fzTOERr/dS1x vSpvmXwNuHBPKQcawhySKUNK/f4yf1mhSAByL6DIkhQFe0Ef2pmd5iTYOTAt/QpU+o /RE/+tbzgUvLRvig7CZ324HqyiasxC4nA+IBy2z5MpH/7Sxy+xkg6Hk8pJsFvNaxq9 l+rFuycZ4GPq1IQFgXAj6zIClnERKP9gBc6guQMgUwmQF2KuIF+T4VPrKwHJBFUVcB 1q2jOyK9XvoFpsk6RGncpK5RFTusnY8298YspDRuMQQgtA3DVSSwaPGcMVnSrFwnsF Raw4aHVWSi+9A== From: Jeremy Kerr To: petitboot@lists.ozlabs.org Subject: [PATCH 11/14] discover/grub2: make statements_execute non-static Date: Wed, 20 Nov 2019 10:43:03 +0800 Message-Id: <20191120024306.16526-12-jk@ozlabs.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191120024306.16526-1-jk@ozlabs.org> References: <20191120024306.16526-1-jk@ozlabs.org> MIME-Version: 1.0 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" We want to execute newly-parsed statements, so expose statements_execute() to the rest of the grub2 parser code. Signed-off-by: Jeremy Kerr --- discover/grub2/grub2.h | 3 +++ discover/grub2/script.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/discover/grub2/grub2.h b/discover/grub2/grub2.h index 668d070..deaf976 100644 --- a/discover/grub2/grub2.h +++ b/discover/grub2/grub2.h @@ -165,6 +165,9 @@ void word_append(struct grub2_word *w1, struct grub2_word *w2); /* script interface */ void script_execute(struct grub2_script *script); +int statements_execute(struct grub2_script *script, + struct grub2_statements *stmts); + int statement_simple_execute(struct grub2_script *script, struct grub2_statement *statement); int statement_block_execute(struct grub2_script *script, diff --git a/discover/grub2/script.c b/discover/grub2/script.c index 34e0400..14931f9 100644 --- a/discover/grub2/script.c +++ b/discover/grub2/script.c @@ -229,7 +229,7 @@ static void process_expansions(struct grub2_script *script, argv->argc--; } -static int statements_execute(struct grub2_script *script, +int statements_execute(struct grub2_script *script, struct grub2_statements *stmts) { struct grub2_statement *stmt;