1 Star 0 Fork 99

yangqiming/grub2

forked from src-openEuler/grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0126-Make-grub_getkeystatus-helper-funtion-available-ever.patch 2.37 KB
一键复制 编辑 原始数据 按行查看 历史
hanzj0122_admin 提交于 2020-07-29 20:47 . update to 2.04
From 493de1bf8d04c9129efd66e7134eef12f436aba4 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Wed, 6 Jun 2018 16:47:11 +0200
Subject: [PATCH 126/220] Make grub_getkeystatus helper funtion available
everywhere
Move the grub_getkeystatus helper function from
grub-core/commands/keystatus.c to grub-core/kern/term.c
and export it so that it can be used outside of the
keystatus command code too.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
grub-core/commands/keystatus.c | 18 ------------------
grub-core/kern/term.c | 18 ++++++++++++++++++
include/grub/term.h | 1 +
3 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/grub-core/commands/keystatus.c b/grub-core/commands/keystatus.c
index 460cf4e..ff3f587 100644
--- a/grub-core/commands/keystatus.c
+++ b/grub-core/commands/keystatus.c
@@ -35,24 +35,6 @@ static const struct grub_arg_option options[] =
{0, 0, 0, 0, 0, 0}
};
-static int
-grub_getkeystatus (void)
-{
- int status = 0;
- grub_term_input_t term;
-
- if (grub_term_poll_usb)
- grub_term_poll_usb (0);
-
- FOR_ACTIVE_TERM_INPUTS(term)
- {
- if (term->getkeystatus)
- status |= term->getkeystatus (term);
- }
-
- return status;
-}
-
static grub_err_t
grub_cmd_keystatus (grub_extcmd_context_t ctxt,
int argc __attribute__ ((unused)),
diff --git a/grub-core/kern/term.c b/grub-core/kern/term.c
index 07720ee..93bd337 100644
--- a/grub-core/kern/term.c
+++ b/grub-core/kern/term.c
@@ -120,6 +120,24 @@ grub_getkey (void)
}
}
+int
+grub_getkeystatus (void)
+{
+ int status = 0;
+ grub_term_input_t term;
+
+ if (grub_term_poll_usb)
+ grub_term_poll_usb (0);
+
+ FOR_ACTIVE_TERM_INPUTS(term)
+ {
+ if (term->getkeystatus)
+ status |= term->getkeystatus (term);
+ }
+
+ return status;
+}
+
void
grub_refresh (void)
{
diff --git a/include/grub/term.h b/include/grub/term.h
index 8117e2a..c215133 100644
--- a/include/grub/term.h
+++ b/include/grub/term.h
@@ -327,6 +327,7 @@ grub_term_unregister_output (grub_term_output_t term)
void grub_putcode (grub_uint32_t code, struct grub_term_output *term);
int EXPORT_FUNC(grub_getkey) (void);
int EXPORT_FUNC(grub_getkey_noblock) (void);
+int EXPORT_FUNC(grub_getkeystatus) (void);
void grub_cls (void);
void EXPORT_FUNC(grub_refresh) (void);
void grub_puts_terminal (const char *str, struct grub_term_output *term);
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yyangqiming/grub2.git
git@gitee.com:yyangqiming/grub2.git
yyangqiming
grub2
grub2
master

搜索帮助