[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 1/6] efi/console: Move grub_console_set{colorstate, cursor} hi
From: |
Javier Martinez Canillas |
Subject: |
[PATCH v3 1/6] efi/console: Move grub_console_set{colorstate, cursor} higher in the file |
Date: |
Wed, 15 Apr 2020 12:26:17 +0200 |
This is just a preparatory patch to move the functions higher in the file,
since these will be called by the grub_prepare_for_text_output() function
that will be introduced in a later patch.
The logic is unchanged by this patch. Functions definitions are just moved
to avoid a forward declaration in a later patch, keeping the code clean.
Signed-off-by: Javier Martinez Canillas <address@hidden>
Reviewed-by: Daniel Kiper <address@hidden>
---
Changes in v3: None
Changes in v2:
- Mention in commit message that logic is unchanged after patch #1.
- Add better explanation about why the change in patch #1 is needed.
grub-core/term/efi/console.c | 82 ++++++++++++++++++------------------
1 file changed, 41 insertions(+), 41 deletions(-)
diff --git a/grub-core/term/efi/console.c b/grub-core/term/efi/console.c
index 4840cc59d3f..59d9604472a 100644
--- a/grub-core/term/efi/console.c
+++ b/grub-core/term/efi/console.c
@@ -65,6 +65,47 @@ map_char (grub_uint32_t c)
return c;
}
+static void
+grub_console_setcolorstate (struct grub_term_output *term
+ __attribute__ ((unused)),
+ grub_term_color_state state)
+{
+ grub_efi_simple_text_output_interface_t *o;
+
+ if (grub_efi_is_finished)
+ return;
+
+ o = grub_efi_system_table->con_out;
+
+ switch (state) {
+ case GRUB_TERM_COLOR_STANDARD:
+ efi_call_2 (o->set_attributes, o, GRUB_TERM_DEFAULT_STANDARD_COLOR
+ & 0x7f);
+ break;
+ case GRUB_TERM_COLOR_NORMAL:
+ efi_call_2 (o->set_attributes, o, grub_term_normal_color & 0x7f);
+ break;
+ case GRUB_TERM_COLOR_HIGHLIGHT:
+ efi_call_2 (o->set_attributes, o, grub_term_highlight_color & 0x7f);
+ break;
+ default:
+ break;
+ }
+}
+
+static void
+grub_console_setcursor (struct grub_term_output *term __attribute__ ((unused)),
+ int on)
+{
+ grub_efi_simple_text_output_interface_t *o;
+
+ if (grub_efi_is_finished)
+ return;
+
+ o = grub_efi_system_table->con_out;
+ efi_call_2 (o->enable_cursor, o, on);
+}
+
static void
grub_console_putchar (struct grub_term_output *term __attribute__ ((unused)),
const struct grub_unicode_glyph *c)
@@ -281,47 +322,6 @@ grub_console_cls (struct grub_term_output *term
__attribute__ ((unused)))
efi_call_2 (o->set_attributes, o, orig_attr);
}
-static void
-grub_console_setcolorstate (struct grub_term_output *term
- __attribute__ ((unused)),
- grub_term_color_state state)
-{
- grub_efi_simple_text_output_interface_t *o;
-
- if (grub_efi_is_finished)
- return;
-
- o = grub_efi_system_table->con_out;
-
- switch (state) {
- case GRUB_TERM_COLOR_STANDARD:
- efi_call_2 (o->set_attributes, o, GRUB_TERM_DEFAULT_STANDARD_COLOR
- & 0x7f);
- break;
- case GRUB_TERM_COLOR_NORMAL:
- efi_call_2 (o->set_attributes, o, grub_term_normal_color & 0x7f);
- break;
- case GRUB_TERM_COLOR_HIGHLIGHT:
- efi_call_2 (o->set_attributes, o, grub_term_highlight_color & 0x7f);
- break;
- default:
- break;
- }
-}
-
-static void
-grub_console_setcursor (struct grub_term_output *term __attribute__ ((unused)),
- int on)
-{
- grub_efi_simple_text_output_interface_t *o;
-
- if (grub_efi_is_finished)
- return;
-
- o = grub_efi_system_table->con_out;
- efi_call_2 (o->enable_cursor, o, on);
-}
-
static grub_err_t
grub_efi_console_output_init (struct grub_term_output *term)
{
--
2.25.1
- [PATCH v3 0/6] Improvements to EFI console and terminal drivers for Flicker Free Boot, Javier Martinez Canillas, 2020/04/15
- [PATCH v3 1/6] efi/console: Move grub_console_set{colorstate, cursor} higher in the file,
Javier Martinez Canillas <=
- [PATCH v3 2/6] kern/term: Make grub_getkeystatus helper function available everywhere, Javier Martinez Canillas, 2020/04/15
- [PATCH v3 3/6] efi/console: Add grub_console_read_key_stroke() helper function, Javier Martinez Canillas, 2020/04/15
- [PATCH v3 4/6] efi/console: Implement getkeystatus() support, Javier Martinez Canillas, 2020/04/15
- [PATCH v3 6/6] kern/term: Accept ESC, F4 and holding SHIFT as user interrupt keys, Javier Martinez Canillas, 2020/04/15
- [PATCH v3 5/6] efi/console: Do not set text-mode until we actually need it, Javier Martinez Canillas, 2020/04/15
- Re: [PATCH v3 0/6] Improvements to EFI console and terminal drivers for Flicker Free Boot, Daniel Kiper, 2020/04/16