From patchwork Fri Jul 15 14:27:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 590837 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5817:0:0:0:0 with SMTP id j23csp551705max; Fri, 15 Jul 2022 07:25:45 -0700 (PDT) X-Google-Smtp-Source: AGRyM1un5S4x23p0xb/AYehoDxI/wuCYoKYteqCz/N9Ys5YLJZr/y/IMUq+GaVXQWx+MS6omOUJ8 X-Received: by 2002:a05:6602:14d:b0:67b:9536:680f with SMTP id v13-20020a056602014d00b0067b9536680fmr7148646iot.202.1657895144867; Fri, 15 Jul 2022 07:25:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657895144; cv=none; d=google.com; s=arc-20160816; b=G1MGD4N8Fbclby0T5knVaEvgIGgbIZfFoaqiUQKX89peD7KgrQ+lr9CKzf/w+Z9vlK smllQFW53ddsUR1gPRhSFvfV+Sdris2Mr1sc5wBGP9riNt4ImCCq0g3c5AjwfAzEGJWK dWQGIFj5dqxcbHZiGpJMwYfDi2/hpS4PLN8rJrIKnhCapPe4qsibh1bIcZSu7cti/vZx 7B8tL4u2BJT9AyIMY1XQu33BlIHRBK4BZsyqyuSkEtbsVd/l4MZgdgk2SWt+sb66EYIw Ow3fUR+5DNw18Rs8S6nMPu1eZXBaW57+/3+W9DbnLSaD3h8JX/UkX/P3OEVIFnmEcdRO ZKsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=w+mVP1Njm31l7f2XbiAc9Nmn/WOjAcUUdc/0fUHeZ54=; b=fK8icVWsldPkqsMCBEmKIvT3E9eQd54wa+eYRCPJqrn6hJVZi4kDlFXm8i8Ud9qw7h mtgcF4JisyWX2BX7IU9mjyddKXQwexcaLjlVyGbc1hm0Q2Rmnzu/Zhcc58no2ezigTpF BTeojG5dd5ppEp2DKBrvaxHgqqiFyZhT4uMMlrNyl0bjldDFVrEMnrl2mz6xS7TkuQKI /m7Sh3GBpGvT9yk8DlyQTN51KDf2jHz+Y5JzU321X6JVXRLctqOiIeORWGpF07W8J+Tf 5ZgpBbkuf4xSntsU+c1pgTYWc3h+O/ZljaRreZL51T+Ghd6zm2nZFiAjDjVBl7svuw7g EPMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="k7x/uRlS"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id l7-20020a6b3e07000000b00657bc68c9e2si3977780ioa.53.2022.07.15.07.25.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jul 2022 07:25:44 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="k7x/uRlS"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 888FA8191C; Fri, 15 Jul 2022 16:25:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="k7x/uRlS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0D34C81872; Fri, 15 Jul 2022 16:25:14 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6B2C6811CA for ; Fri, 15 Jul 2022 16:25:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masahisa.kojima@linaro.org Received: by mail-pg1-x536.google.com with SMTP id e132so4544422pgc.5 for ; Fri, 15 Jul 2022 07:25:09 -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=w+mVP1Njm31l7f2XbiAc9Nmn/WOjAcUUdc/0fUHeZ54=; b=k7x/uRlSj5tYgsKZxfngKGcNfDylTTeoccpPkVSxVN4Hz0JKModuvtYUUX2y1W7KsB /z2oNtOwMj4x4LBLVt/rYCLmNO4+loBJh/qxzZ7dcARQrL64DawofVuFUeHxCN3+rJjC DL7k7dAdag38RXdvk9UKFJ6JL63izRsQwD/WgbIpxXzcHpYl1DMYOAjcf74jm4Zspsdo OkmousrCor3A7Y0usRj+WzZlm3g7ZrcG7PNoZY2PvYK5uqImhcWOBV5/vmXhXscpgLHd JVir6QsHRNpU+C6fPzl9DQeE282HTu8AK17JpDOMZtHCXHC624H74gjRMgvBgUY9T74b T45g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=w+mVP1Njm31l7f2XbiAc9Nmn/WOjAcUUdc/0fUHeZ54=; b=BXAZGN2poLw5OyGsHB0JnPud0NOMDjkT2Z1PBevC3DISyjyI0NWE6ozyZwtEVPO+5T eRActhrXW+m34PB77zmSSH/kzJ6vAXM412I+B6M3etQ5OUQeMc0BbiUeW9mgOBXxvZSa oH45KWwwDtaihH0GF8NIkn68wudOtg0Gf7dc0TLVwKgOkdT6nmawCN59JUuXA+tRz8CY qKbuzr9BrF9Ob0cJStwoGLJCqw83ckny3/fn/22qCtxt9MbtGiXoalYnM6RCJWc7SeEJ 87MLEz+CuqfpVYYsfvkwjMnYhg5bZnyAQr50ReQKTRZ2I+jFSASARz8pPlCSkjsJ56m5 yHiA== X-Gm-Message-State: AJIora8jyU9Q28+caV9r6p4MHxMEoZHlzWLBI4OpeAVRrDw28CvSD0pg sutOKWijet2FkumVULo6LiVzGpaKt9Qodg== X-Received: by 2002:a63:551:0:b0:419:9286:56 with SMTP id 78-20020a630551000000b0041992860056mr11565694pgf.267.1657895107324; Fri, 15 Jul 2022 07:25:07 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id d22-20020aa797b6000000b0051c49fb62b7sm3891174pfq.165.2022.07.15.07.25.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jul 2022 07:25:06 -0700 (PDT) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Takahiro Akashi , Mark Kettenis , Masahisa Kojima Subject: [PATCH 4/9] menu: add KEY_PLUS and KEY_MINUS handling Date: Fri, 15 Jul 2022 23:27:38 +0900 Message-Id: <20220715142743.30137-5-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220715142743.30137-1-masahisa.kojima@linaro.org> References: <20220715142743.30137-1-masahisa.kojima@linaro.org> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean This is preparation to support menu-driven UEFI BootOrder variable updated by KEY_PLUS and KEY_MINUS. Signed-off-by: Masahisa Kojima Reviewed-by: Heinrich Schuchardt --- No change since v7 Newly created in v7 common/menu.c | 6 ++++++ include/menu.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/common/menu.c b/common/menu.c index 3e876b55b3..3470f95a98 100644 --- a/common/menu.c +++ b/common/menu.c @@ -548,4 +548,10 @@ void bootmenu_loop(struct bootmenu_data *menu, /* ^C was pressed */ if (c == 0x3) *key = KEY_QUIT; + + if (c == '+') + *key = KEY_PLUS; + + if (c == '-') + *key = KEY_MINUS; } diff --git a/include/menu.h b/include/menu.h index e74616cae8..4c32e74ce9 100644 --- a/include/menu.h +++ b/include/menu.h @@ -48,6 +48,8 @@ enum bootmenu_key { KEY_DOWN, KEY_SELECT, KEY_QUIT, + KEY_PLUS, + KEY_MINUS, }; void bootmenu_autoboot_loop(struct bootmenu_data *menu,