diff options
Diffstat (limited to 'usr')
-rw-r--r-- | usr/src/boot/common/tem.c | 72 | ||||
-rw-r--r-- | usr/src/boot/i386/libi386/vidconsole.c | 15 | ||||
-rw-r--r-- | usr/src/boot/sys/sys/tem.h | 3 | ||||
-rw-r--r-- | usr/src/boot/sys/sys/tem_impl.h | 2 |
4 files changed, 46 insertions, 46 deletions
diff --git a/usr/src/boot/common/tem.c b/usr/src/boot/common/tem.c index 2798f2883d..8eef7da2b6 100644 --- a/usr/src/boot/common/tem.c +++ b/usr/src/boot/common/tem.c @@ -91,7 +91,7 @@ static void tems_modechange_callback(struct vis_modechg_arg *, static void tems_reset_colormap(void); static void tem_free_buf(struct tem_vt_state *); -static void tem_internal_init(struct tem_vt_state *, boolean_t, boolean_t); +static void tem_internal_init(struct tem_vt_state *, bool, bool); static void tems_get_initial_color(tem_color_t *pcolor); static void tem_control(struct tem_vt_state *, uint8_t); @@ -130,7 +130,7 @@ static void tem_virtual_display(struct tem_vt_state *, term_char_t *, static void tem_align_cursor(struct tem_vt_state *tem); static void tem_check_first_time(struct tem_vt_state *tem); -static void tem_reset_display(struct tem_vt_state *, boolean_t, boolean_t); +static void tem_reset_display(struct tem_vt_state *, bool, bool); static void tem_terminal_emulate(struct tem_vt_state *, uint8_t *, int); static void tem_text_cursor(struct tem_vt_state *, short); static void tem_text_cls(struct tem_vt_state *, @@ -155,7 +155,7 @@ static void tem_text_copy(struct tem_vt_state *, screen_pos_t, screen_pos_t); static void tem_pix_bit2pix(struct tem_vt_state *, term_char_t *); static void tem_pix_cls_range(struct tem_vt_state *, screen_pos_t, int, - int, screen_pos_t, int, int, boolean_t); + int, screen_pos_t, int, int, bool); static void tem_pix_cls(struct tem_vt_state *, int, screen_pos_t, screen_pos_t); @@ -213,7 +213,7 @@ tem_write(tem_vt_state_t tem_arg, uint8_t *buf, ssize_t len) static void tem_internal_init(struct tem_vt_state *ptem, - boolean_t init_color, boolean_t clear_screen) + bool init_color, bool clear_screen) { size_t size, width, height; @@ -285,7 +285,7 @@ tem_init(void) return ((tem_vt_state_t)ptem); } - tem_internal_init(ptem, B_TRUE, B_FALSE); + tem_internal_init(ptem, true, false); tem_add(ptem); return ((tem_vt_state_t)ptem); @@ -296,12 +296,12 @@ tem_init(void) * been re-inited. */ static void -tem_reinit(struct tem_vt_state *tem, boolean_t reset_display) +tem_reinit(struct tem_vt_state *tem, bool reset_display) { tem_free_buf(tem); /* only free virtual buffers */ /* reserve color */ - tem_internal_init(tem, B_FALSE, reset_display); + tem_internal_init(tem, false, reset_display); } static void @@ -321,7 +321,7 @@ tem_free_buf(struct tem_vt_state *tem) } static int -tems_failed(boolean_t finish_ioctl) +tems_failed(bool finish_ioctl) { if (finish_ioctl && tems.ts_hdl != NULL) (void) tems.ts_hdl->c_ioctl(tems.ts_hdl, VIS_DEVFINI, NULL); @@ -360,7 +360,7 @@ tem_info_init(struct console *cp) */ if (cp->c_ioctl(cp, VIS_DEVINIT, &temargs) != 0) { printf("terminal emulator: Compatible fb not found\n"); - ret = tems_failed(B_FALSE); + ret = tems_failed(false); return (ret); } @@ -369,7 +369,7 @@ tem_info_init(struct console *cp) printf( "terminal emulator: VIS_CONS_REV %d (see sys/visual_io.h) " "of console fb driver not supported\n", temargs.version); - ret = tems_failed(B_TRUE); + ret = tems_failed(true); return (ret); } @@ -378,13 +378,13 @@ tem_info_init(struct console *cp) (temargs.depth == 15) || (temargs.depth == 16) || (temargs.depth == 24) || (temargs.depth == 32))) { printf("terminal emulator: unsupported depth\n"); - ret = tems_failed(B_TRUE); + ret = tems_failed(true); return (ret); } if ((temargs.mode != VIS_TEXT) && (temargs.mode != VIS_PIXEL)) { printf("terminal emulator: unsupported mode\n"); - ret = tems_failed(B_TRUE); + ret = tems_failed(true); return (ret); } @@ -402,7 +402,7 @@ tem_info_init(struct console *cp) for (p = list_head(&tems.ts_list); p != NULL; p = list_next(&tems.ts_list, p)) { - tem_internal_init(p, B_TRUE, B_FALSE); + tem_internal_init(p, true, false); if (temargs.mode == VIS_PIXEL) tem_pix_align(p); } @@ -594,7 +594,7 @@ tems_modechange_callback(struct vis_modechg_arg *arg __unused, active->tvs_fg_color = tems.ts_init_color.fg_color; active->tvs_bg_color = tems.ts_init_color.bg_color; active->tvs_flags = tems.ts_init_color.a_flags; - tem_reinit(active, B_TRUE); + tem_reinit(active, true); return; } @@ -609,7 +609,7 @@ tems_modechange_callback(struct vis_modechg_arg *arg __unused, /* color depth did change, reset colors */ tems_reset_colormap(); tems_get_initial_color(&tems.ts_init_color); - tem_reinit(active, B_TRUE); + tem_reinit(active, true); return; } @@ -787,7 +787,7 @@ tem_prom_scroll_up(struct tem_vt_state *tem, int nrows) ncols = (tems.ts_p_dimension.width + (width - 1)) / width; tem_pix_cls_range(tem, 0, nrows, tems.ts_p_offset.y, - 0, ncols, 0, B_TRUE); + 0, ncols, 0, true); } /* @@ -859,20 +859,20 @@ tem_pix_align(struct tem_vt_state *tem) (screen_pos_t)row; tem->tvs_s_cursor.col = tem->tvs_c_cursor.col = 0; } else { - tem_reset_display(tem, B_TRUE, B_TRUE); + tem_reset_display(tem, true, true); } } static void -tems_get_inverses(boolean_t *p_inverse, boolean_t *p_inverse_screen) +tems_get_inverses(bool *p_inverse, bool *p_inverse_screen) { int i_inverse = 0; int i_inverse_screen = 0; plat_tem_get_inverses(&i_inverse, &i_inverse_screen); - *p_inverse = (i_inverse == 0) ? B_FALSE : B_TRUE; - *p_inverse_screen = (i_inverse_screen == 0) ? B_FALSE : B_TRUE; + *p_inverse = i_inverse != 0; + *p_inverse_screen = i_inverse_screen != 0; } /* @@ -881,7 +881,7 @@ tems_get_inverses(boolean_t *p_inverse, boolean_t *p_inverse_screen) static void tems_get_initial_color(tem_color_t *pcolor) { - boolean_t inverse, inverse_screen; + bool inverse, inverse_screen; unsigned short flags = 0; uint8_t fg, bg; @@ -923,7 +923,7 @@ tems_get_initial_color(tem_color_t *pcolor) } void -tem_activate(tem_vt_state_t tem_arg, boolean_t unblank) +tem_activate(tem_vt_state_t tem_arg, bool unblank) { struct tem_vt_state *tem = (struct tem_vt_state *)tem_arg; @@ -1145,7 +1145,7 @@ tem_control(struct tem_vt_state *tem, uint8_t ch) case A_CSI: tem->tvs_curparam = 0; tem->tvs_paramval = 0; - tem->tvs_gotparam = B_FALSE; + tem->tvs_gotparam = false; /* clear the parameters */ for (int i = 0; i < TEM_MAXPARAMS; i++) tem->tvs_params[i] = -1; @@ -1736,7 +1736,7 @@ tem_getparams(struct tem_vt_state *tem, uint8_t ch) { if (isdigit(ch)) { tem->tvs_paramval = ((tem->tvs_paramval * 10) + (ch - '0')); - tem->tvs_gotparam = B_TRUE; /* Remember got parameter */ + tem->tvs_gotparam = true; /* Remember got parameter */ return; /* Return immediately */ } else if (tem->tvs_state == A_STATE_CSI_EQUAL || tem->tvs_state == A_STATE_CSI_QMARK) { @@ -1753,7 +1753,7 @@ tem_getparams(struct tem_vt_state *tem, uint8_t ch) if (ch == ';') { /* Restart parameter search */ - tem->tvs_gotparam = B_FALSE; + tem->tvs_gotparam = false; tem->tvs_paramval = 0; /* No parame value yet */ } else { /* Handle escape sequence */ @@ -2011,7 +2011,7 @@ tem_parse(struct tem_vt_state *tem, tem_char_t ch) if (ch == '[') { tem->tvs_curparam = 0; tem->tvs_paramval = 0; - tem->tvs_gotparam = B_FALSE; + tem->tvs_gotparam = false; /* clear the parameters */ for (i = 0; i < TEM_MAXPARAMS; i++) tem->tvs_params[i] = -1; @@ -2024,7 +2024,7 @@ tem_parse(struct tem_vt_state *tem, tem_char_t ch) tem->tvs_state = A_STATE_START; if (ch == 'c') { /* ESC c resets display */ - tem_reset_display(tem, B_TRUE, B_TRUE); + tem_reset_display(tem, true, true); } else if (ch == 'H') { /* ESC H sets a tab */ tem_set_tab(tem); @@ -2335,7 +2335,7 @@ tem_pix_copy(struct tem_vt_state *tem, screen_pos_t t_col, screen_pos_t t_row) { struct vis_conscopy ma; - static boolean_t need_clear = B_TRUE; + static bool need_clear = true; if (need_clear && tem->tvs_first_line > 0) { /* @@ -2348,7 +2348,7 @@ tem_pix_copy(struct tem_vt_state *tem, */ tem_pix_clear_prom_output(tem); } - need_clear = B_FALSE; + need_clear = false; ma.s_row = s_row * tems.ts_font.vf_height + tems.ts_p_offset.y; ma.e_row = (e_row + 1) * tems.ts_font.vf_height + @@ -2406,7 +2406,7 @@ tem_pix_cls(struct tem_vt_state *tem, int count, screen_pos_t row, screen_pos_t col) { tem_pix_cls_range(tem, row, 1, tems.ts_p_offset.y, - col, count, tems.ts_p_offset.x, B_FALSE); + col, count, tems.ts_p_offset.x, false); } /* @@ -2445,8 +2445,7 @@ tem_pix_clear_prom_output(struct tem_vt_state *tem) ncols = (tems.ts_p_dimension.width + (width - 1)) / width; if (nrows > 0) - tem_pix_cls_range(tem, 0, nrows, offset, 0, ncols, 0, - B_FALSE); + tem_pix_cls_range(tem, 0, nrows, offset, 0, ncols, 0, false); } /* @@ -2591,7 +2590,7 @@ tem_mv_cursor(struct tem_vt_state *tem, int row, int col) /* ARGSUSED */ static void -tem_reset_emulator(struct tem_vt_state *tem, boolean_t init_color) +tem_reset_emulator(struct tem_vt_state *tem, bool init_color) { int j; @@ -2603,7 +2602,7 @@ tem_reset_emulator(struct tem_vt_state *tem, boolean_t init_color) tem->tvs_s_cursor.col = 0; tem->tvs_outindex = 0; tem->tvs_state = A_STATE_START; - tem->tvs_gotparam = B_FALSE; + tem->tvs_gotparam = false; tem->tvs_curparam = 0; tem->tvs_paramval = 0; tem->tvs_nscroll = 1; @@ -2628,8 +2627,7 @@ tem_reset_emulator(struct tem_vt_state *tem, boolean_t init_color) } static void -tem_reset_display(struct tem_vt_state *tem, - boolean_t clear_txt, boolean_t init_color) +tem_reset_display(struct tem_vt_state *tem, bool clear_txt, bool init_color) { tem_reset_emulator(tem, init_color); @@ -2875,7 +2873,7 @@ static void tem_pix_cls_range(struct tem_vt_state *tem, screen_pos_t row, int nrows, int offset_y, screen_pos_t col, int ncols, int offset_x, - boolean_t sroll_up) + bool sroll_up) { struct vis_consdisplay da; int i, j; diff --git a/usr/src/boot/i386/libi386/vidconsole.c b/usr/src/boot/i386/libi386/vidconsole.c index 490c4571a4..721766ff35 100644 --- a/usr/src/boot/i386/libi386/vidconsole.c +++ b/usr/src/boot/i386/libi386/vidconsole.c @@ -44,6 +44,7 @@ #include <sys/vgareg.h> #include <sys/vgasubr.h> #include <machine/cpufunc.h> +#include <stdbool.h> #if KEYBOARD_PROBE @@ -66,7 +67,7 @@ static int vidc_text_devinit(struct vis_devinit *); static int vidc_text_cons_clear(struct vis_consclear *); static void vidc_text_cons_copy(struct vis_conscopy *); static void vidc_text_cons_display(struct vis_consdisplay *); -static void vidc_text_set_cursor(screen_pos_t, screen_pos_t, boolean_t); +static void vidc_text_set_cursor(screen_pos_t, screen_pos_t, bool); static void vidc_text_get_cursor(screen_pos_t *, screen_pos_t *); static int vidc_text_cons_put_cmap(struct vis_cmap *); @@ -141,7 +142,7 @@ plat_stdout_is_framebuffer(void) void plat_tem_hide_prom_cursor(void) { - vidc_text_set_cursor(0, 0, B_FALSE); + vidc_text_set_cursor(0, 0, false); } void @@ -481,7 +482,7 @@ vidc_text_cons_display(struct vis_consdisplay *da) } static void -vidc_text_set_cursor(screen_pos_t row, screen_pos_t col, boolean_t visible) +vidc_text_set_cursor(screen_pos_t row, screen_pos_t col, bool visible) { uint16_t addr; uint8_t msl, s, e; @@ -490,7 +491,7 @@ vidc_text_set_cursor(screen_pos_t row, screen_pos_t col, boolean_t visible) s = vga_get_crtc(VGA_REG_ADDR, VGA_CRTC_CSSL) & 0xC0; e = vga_get_crtc(VGA_REG_ADDR, VGA_CRTC_CESL); - if (visible == B_TRUE) { + if (visible) { addr = row * TEXT_COLS + col; vga_set_crtc(VGA_REG_ADDR, VGA_CRTC_CLAH, addr >> 8); vga_set_crtc(VGA_REG_ADDR, VGA_CRTC_CLAL, addr & 0xff); @@ -522,13 +523,13 @@ vidc_cons_cursor(struct vis_conscursor *cc) if (plat_stdout_is_framebuffer()) gfx_fb_display_cursor(cc); else - vidc_text_set_cursor(cc->row, cc->col, B_FALSE); + vidc_text_set_cursor(cc->row, cc->col, false); break; case VIS_DISPLAY_CURSOR: if (plat_stdout_is_framebuffer()) gfx_fb_display_cursor(cc); else - vidc_text_set_cursor(cc->row, cc->col, B_TRUE); + vidc_text_set_cursor(cc->row, cc->col, true); break; case VIS_GET_CURSOR: if (plat_stdout_is_framebuffer()) { @@ -882,7 +883,7 @@ vidc_init(struct console *cp, int arg) if (rc == 0 && tem == NULL) { tem = tem_init(); if (tem != NULL) - tem_activate(tem, B_TRUE); + tem_activate(tem, true); } for (i = 0; i < 10 && vidc_ischar(cp); i++) diff --git a/usr/src/boot/sys/sys/tem.h b/usr/src/boot/sys/sys/tem.h index fef3277c50..2ae58c8d01 100644 --- a/usr/src/boot/sys/sys/tem.h +++ b/usr/src/boot/sys/sys/tem.h @@ -37,6 +37,7 @@ extern "C" { #include <sys/types.h> #include <sys/visual_io.h> +#include <stdbool.h> typedef uint8_t text_color_t; @@ -63,7 +64,7 @@ void tem_write(tem_vt_state_t, uint8_t *, ssize_t); void tem_get_size(uint16_t *, uint16_t *, uint16_t *, uint16_t *); void tem_save_state(void); void tem_register_modechg_cb(tem_modechg_cb_t, tem_modechg_cb_arg_t); -void tem_activate(tem_vt_state_t, boolean_t); +void tem_activate(tem_vt_state_t, bool); void tem_switch(tem_vt_state_t, tem_vt_state_t); void tem_get_colors(tem_vt_state_t, text_color_t *, text_color_t *); diff --git a/usr/src/boot/sys/sys/tem_impl.h b/usr/src/boot/sys/sys/tem_impl.h index 3a13a7df0e..c6ef043ae0 100644 --- a/usr/src/boot/sys/sys/tem_impl.h +++ b/usr/src/boot/sys/sys/tem_impl.h @@ -279,7 +279,7 @@ void tem_write(tem_vt_state_t, uint8_t *, ssize_t); void tem_get_size(uint16_t *, uint16_t *, uint16_t *, uint16_t *); void tem_save_state(void); void tem_register_modechg_cb(tem_modechg_cb_t, tem_modechg_cb_arg_t); -void tem_activate(tem_vt_state_t, boolean_t); +void tem_activate(tem_vt_state_t, bool); void tem_get_colors(tem_vt_state_t, text_color_t *, text_color_t *); void tem_image_display(struct tem_vt_state *, screen_pos_t, screen_pos_t, screen_pos_t, screen_pos_t); |