aboutsummaryrefslogtreecommitdiff
path: root/stand/efi/libefi/efi_console.c
diff options
context:
space:
mode:
Diffstat (limited to 'stand/efi/libefi/efi_console.c')
-rw-r--r--stand/efi/libefi/efi_console.c56
1 files changed, 16 insertions, 40 deletions
diff --git a/stand/efi/libefi/efi_console.c b/stand/efi/libefi/efi_console.c
index 1aeb94344c58..46a3c957f151 100644
--- a/stand/efi/libefi/efi_console.c
+++ b/stand/efi/libefi/efi_console.c
@@ -24,9 +24,6 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <sys/param.h>
#include <efi.h>
#include <efilib.h>
@@ -66,7 +63,7 @@ void HO(void);
void end_term(void);
#endif
-#define TEXT_ROWS 24
+#define TEXT_ROWS 25
#define TEXT_COLS 80
static tf_bell_t efi_cons_bell;
@@ -129,14 +126,14 @@ int efi_cons_poll(void);
static void cons_draw_frame(teken_attr_t *);
struct console efi_console = {
- "efi",
- "EFI console",
- C_WIDEOUT,
- efi_cons_probe,
- efi_cons_init,
- efi_cons_putchar,
- efi_cons_getchar,
- efi_cons_poll
+ .c_name = "efi",
+ .c_desc = "EFI console",
+ .c_flags = C_WIDEOUT,
+ .c_probe = efi_cons_probe,
+ .c_init = efi_cons_init,
+ .c_out = efi_cons_putchar,
+ .c_in = efi_cons_getchar,
+ .c_ready = efi_cons_poll
};
/*
@@ -555,7 +552,7 @@ curs_move(int *_x, int *_y, int x, int y)
if (_y != NULL)
*_y = conout->Mode->CursorRow;
}
-
+
/* Clear internal state of the terminal emulation code. */
void
end_term(void)
@@ -690,7 +687,7 @@ HO(void)
args[0] = args[1] = 1;
CM();
}
-
+
/* Clear line from current position to end of line */
static void
CL(int direction)
@@ -713,7 +710,7 @@ CL(int direction)
default: /* NOTREACHED */
__unreachable();
}
-
+
if (cury == y - 1)
len--;
@@ -728,7 +725,7 @@ CL(int direction)
if (direction != 0)
curs_move(NULL, NULL, 0, cury);
-
+
conout->OutputString(conout, line);
/* restore cursor position */
curs_move(NULL, NULL, curx, cury);
@@ -745,7 +742,7 @@ get_arg(int c)
args[argc] += c - '0';
}
#endif
-
+
/* Emulate basic capabilities of cons25 terminal */
static void
efi_term_emu(int c)
@@ -758,7 +755,7 @@ efi_term_emu(int c)
};
int t, i;
EFI_STATUS status;
-
+
switch (esc) {
case 0:
switch (c) {
@@ -1044,28 +1041,7 @@ cons_update_mode(bool use_gfx_mode)
a = teken_get_defattr(&gfx_state.tg_teken);
attr = *a;
- /*
- * On first run, we set up the efi_set_colors()
- * callback. If the env is already set, we
- * pick up fg and bg color values from the environment.
- */
- ptr = getenv("teken.fg_color");
- if (ptr != NULL) {
- attr.ta_fgcolor = strtol(ptr, NULL, 10);
- ptr = getenv("teken.bg_color");
- attr.ta_bgcolor = strtol(ptr, NULL, 10);
-
- teken_set_defattr(&gfx_state.tg_teken, &attr);
- } else {
- snprintf(env, sizeof(env), "%d",
- attr.ta_fgcolor);
- env_setenv("teken.fg_color", EV_VOLATILE, env,
- efi_set_colors, env_nounset);
- snprintf(env, sizeof(env), "%d",
- attr.ta_bgcolor);
- env_setenv("teken.bg_color", EV_VOLATILE, env,
- efi_set_colors, env_nounset);
- }
+ gfx_fb_setcolors(&attr, efi_set_colors, env_nounset);
}
}