From patchwork Mon Sep 12 08:33:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 604981 Delivered-To: patch@linaro.org Received: by 2002:a05:6504:2213:b0:1da:4c02:b5e7 with SMTP id z19csp2442912ltw; Mon, 12 Sep 2022 01:32:27 -0700 (PDT) X-Google-Smtp-Source: AA6agR76fwt7MHaohFv4Fb5qhyJb9yP2uWFcIEKWKQeMhK01ufIE0E9sQffPdemoia9ww4YCYNSm X-Received: by 2002:a05:6402:43cc:b0:451:129e:1b1e with SMTP id p12-20020a05640243cc00b00451129e1b1emr12010760edc.258.1662971547424; Mon, 12 Sep 2022 01:32:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662971547; cv=none; d=google.com; s=arc-20160816; b=CbdUdx99gTAXxP5c++9i3IL9zoQ7YaA/8rz3gueVRKsWjY3Qg+LtJQ/83/D9gUBEXA 4VYl9IQbUNznpvrf0IMRTPXfAveMLUHpN9JMzEoiM5W1h/5j5muDyoa7004014pypvjp 0vaAbtqZ6hC57r5MGj0Eg0Ch9snNe5rHVvyWCW72v/OVrCEOSfIlrRGOv3uosxRhbHss Z7KsLwBRO/5Uu4XEWCDN/MCiNj90CJsRkiY0ig7jByjh+fpyJIo9PCUIN/OCOjy6yvKO RCmgZDQMKvK7joMzE3q3P8J+ELYNX+R3VMco1L715pDxfMucR+6RJzpbQ3e47p+jDLT1 RGMA== 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=nxxHqT3LQmYnOzhmoQJ9it5hG8dE8c8+kpqf94HPN3Y=; b=V6Hi8VLF82gFcrgTuaPhwCqajKvGtNIrgFxcm2d1yWXZbxfMCrS2RoGVJGqsEmQY3m rpna6rZcUmiOxALrW0xhFoliZaqoqqMTQXJjdzxccsWv3l+ZmjmKJ/cXBKDLXOELJahZ Qq4eBoN3dDCA6b16xZZShWvuebEAL3ttTBzsMZFBSXqUL9kMtv08vD9pNMxrKNRjkDe2 FHqRZEYvdDLG3/g3G7sDNo4qX0worOciRHlAunI9i5iO0BXDyV24bMgQ2HTs5NsohpF2 vY3Ccrn+d5gPvHLMCuaFcXrPS3tn9FVPepP2Bet3w2Ilc1Rlh4Oc1VDrEnwGq1m/58kd ml7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RxKtHFjh; 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 qk8-20020a1709077f8800b007314bba0e9bsi7435728ejc.353.2022.09.12.01.32.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 01:32:27 -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=RxKtHFjh; 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 ECA2884A0B; Mon, 12 Sep 2022 10:32:19 +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="RxKtHFjh"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 279E1849F0; Mon, 12 Sep 2022 10:32:07 +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-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) (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 43EEA84AB1 for ; Mon, 12 Sep 2022 10:31:58 +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-pf1-x42b.google.com with SMTP id y136so7919661pfb.3 for ; Mon, 12 Sep 2022 01:31:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date; bh=nxxHqT3LQmYnOzhmoQJ9it5hG8dE8c8+kpqf94HPN3Y=; b=RxKtHFjhBQ6qvun0xczDbYcwVfX5sH5R7KU28HgTwdzaKm1jBSYkaYmpMjThKBbUuA Pfa99L24QLc2clLHJWGwWEWpYXzURor6fHEWRzmZA8MnnsR2sQvSW8YseY7yC69oqXTR n6dajAqV9b5xJBiP4L2tLKx4QFRnvAqaJBcKZDLiifdml8OBVQazX3IKF8uKQqY6U13e zqEU/sITeZBov7F96wOYEkU/BLf16N2gGeWNIuvDwLazeEbQrrH2IxRN9sjvE3Wl19pg Lk3uCq9abgCvOWC4tb+bRyvvdBIybpE5NbVBoJ8yhnuaXY2PwtauvI53ZK4PEq2F6+lN aAjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date; bh=nxxHqT3LQmYnOzhmoQJ9it5hG8dE8c8+kpqf94HPN3Y=; b=v/e+1iu5zVA0ScdPLBVmBxHgDU4nNZfUN8bgYOEpyFuISXIpsQmNfs7wNaj0jmVs5t NcMdFhdfTQdTJ+dHm6nYH1O9W65a2xLLu+F32cz2Ov9EmFk516L/qMjqjXyUrnWE3ddt JaxxLt7iUq8cni8mykQk7XwzupjOYbNSqpZ56t/fZjhKEfxxcLVW2y1F8A7wXCBpfwbU vMTFt/aPisOAfzipGxwlkgU4SrOXDJiTo49alMNtLy1SJx4ouzXMB0o8cM0NA/lkru5E ZfYtXqcX1deNIOnvbTG0ByGSRLD9pnZlcpNe0rfbfdHxRiYokKyPtkMV4eljocfPuiZa vV6w== X-Gm-Message-State: ACgBeo2chM2gifmDburNbkzyNKPTL2m9URjXO3gba+0+l/X+HS28MwUn XwShc44KNGL5Aelro1WxOp/2LpjL29aoRA== X-Received: by 2002:a63:6909:0:b0:41c:9f4f:a63c with SMTP id e9-20020a636909000000b0041c9f4fa63cmr23452329pgc.76.1662971516338; Mon, 12 Sep 2022 01:31:56 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id d15-20020a621d0f000000b00540ad46bc1dsm4698506pfd.157.2022.09.12.01.31.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 01:31:55 -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 v17 03/10] menu: add KEY_PLUS, KEY_MINUS and KEY_SPACE handling Date: Mon, 12 Sep 2022 17:33:52 +0900 Message-Id: <20220912083359.24510-4-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220912083359.24510-1-masahisa.kojima@linaro.org> References: <20220912083359.24510-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, KEY_MINUS and KEY_SPACE. Signed-off-by: Masahisa Kojima Reviewed-by: Heinrich Schuchardt Reviewed-by: Ilias Apalodimas --- No update since v11 Changes in v11: - add SPACE key handling Newly created in v7 common/menu.c | 9 +++++++++ include/menu.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/common/menu.c b/common/menu.c index 3e876b55b3..0d19601cf5 100644 --- a/common/menu.c +++ b/common/menu.c @@ -548,4 +548,13 @@ 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; + + if (c == ' ') + *key = KEY_SPACE; } diff --git a/include/menu.h b/include/menu.h index e74616cae8..702aacb170 100644 --- a/include/menu.h +++ b/include/menu.h @@ -48,6 +48,9 @@ enum bootmenu_key { KEY_DOWN, KEY_SELECT, KEY_QUIT, + KEY_PLUS, + KEY_MINUS, + KEY_SPACE, }; void bootmenu_autoboot_loop(struct bootmenu_data *menu,