Lines Matching +full:num +full:- +full:rows
1 // SPDX-License-Identifier: GPL-2.0+
20 unsigned long rows; member
28 .rows = 25,
34 .rows = 50,
40 .rows = 0,
84 * @num: number of return values expected
86 * @return: non-zero indicates error
88 static int term_read_reply(int *n, int num, char end_char) in term_read_reply() argument
94 return -1; in term_read_reply()
97 return -1; in term_read_reply()
104 if (i >= num) in term_read_reply()
105 return -1; in term_read_reply()
111 return -1; in term_read_reply()
116 n[i] += c - '0'; in term_read_reply()
118 return -1; in term_read_reply()
121 if (i != num - 1) in term_read_reply()
122 return -1; in term_read_reply()
132 struct cout_mode *mode = &efi_cout_modes[con->mode]; in efi_cout_output_string()
159 con->cursor_column = max(0, con->cursor_column - 1); in efi_cout_output_string()
162 con->cursor_column = 0; in efi_cout_output_string()
163 con->cursor_row++; in efi_cout_output_string()
165 case '\r': /* U+000D, carriage-return */ in efi_cout_output_string()
166 con->cursor_column = 0; in efi_cout_output_string()
175 con->cursor_column++; in efi_cout_output_string()
178 if (con->cursor_column >= mode->columns) { in efi_cout_output_string()
179 con->cursor_column = 0; in efi_cout_output_string()
180 con->cursor_row++; in efi_cout_output_string()
182 con->cursor_row = min(con->cursor_row, (s32)mode->rows - 1); in efi_cout_output_string()
197 static bool cout_mode_matches(struct cout_mode *mode, int rows, int cols) in cout_mode_matches() argument
199 if (!mode->present) in cout_mode_matches()
202 return (mode->rows == rows) && (mode->columns == cols); in cout_mode_matches()
206 * query_console_serial() - query console size
208 * @rows pointer to return number of rows
212 static int query_console_serial(int *rows, int *cols) in query_console_serial() argument
224 * man page and the ECMA-48 standard. in query_console_serial()
235 /* Read {rows,cols} */ in query_console_serial()
242 *rows = n[0]; in query_console_serial()
258 int rows = 25, cols = 80; in query_console_size() local
264 struct udevice *dev = stdout_dev->priv; in query_console_size()
267 rows = priv->rows; in query_console_size()
268 cols = priv->cols; in query_console_size()
269 } else if (query_console_serial(&rows, &cols)) { in query_console_size()
274 if (cols >= 80 && rows >= 50) { in query_console_size()
283 if (!cout_mode_matches(&efi_cout_modes[0], rows, cols) && in query_console_size()
284 !cout_mode_matches(&efi_cout_modes[1], rows, cols)) { in query_console_size()
286 efi_cout_modes[EFI_COUT_MODE_2].rows = rows; in query_console_size()
296 unsigned long *rows) in efi_cout_query_mode() argument
298 EFI_ENTRY("%p, %ld, %p, %p", this, mode_number, columns, rows); in efi_cout_query_mode()
308 if (rows) in efi_cout_query_mode()
309 *rows = efi_cout_modes[mode_number].rows; in efi_cout_query_mode()
396 struct cout_mode *mode = &efi_cout_modes[con->mode]; in efi_cout_set_cursor_position()
405 if (row >= mode->rows || column >= mode->columns) { in efi_cout_set_cursor_position()
446 * struct efi_cin_notify_function - registered console input notify function
464 * set_shift_mask() - set shift mask
470 key_state->key_shift_state = EFI_SHIFT_STATE_VALID; in set_shift_mask()
472 --mod; in set_shift_mask()
474 key_state->key_shift_state |= EFI_LEFT_SHIFT_PRESSED; in set_shift_mask()
476 key_state->key_shift_state |= EFI_LEFT_ALT_PRESSED; in set_shift_mask()
478 key_state->key_shift_state |= EFI_LEFT_CONTROL_PRESSED; in set_shift_mask()
480 key_state->key_shift_state |= EFI_LEFT_LOGO_PRESSED; in set_shift_mask()
482 key_state->key_shift_state |= EFI_LEFT_LOGO_PRESSED; in set_shift_mask()
487 * analyze_modifiers() - analyze modifiers (shift, alt, ctrl) for function keys
510 mod += c - '0'; in analyze_modifiers()
527 * efi_cin_read_key() - read a key from the console input
529 * @key: - key received
530 * Return: - status code
543 key->key_state.key_shift_state = EFI_SHIFT_STATE_INVALID; in efi_cin_read_key()
544 key->key_state.key_toggle_state = EFI_TOGGLE_STATE_INVALID; in efi_cin_read_key()
546 /* We do not support multi-word codes */ in efi_cin_read_key()
561 case 'O': /* F1 - F4 */ in efi_cin_read_key()
565 set_shift_mask(ch - '0', &key->key_state); in efi_cin_read_key()
568 pressed_key.scan_code = ch - 'P' + 11; in efi_cin_read_key()
574 pressed_key.scan_code = ch - 'A' + 1; in efi_cin_read_key()
583 ch = analyze_modifiers(&key->key_state); in efi_cin_read_key()
585 case '1'...'5': /* F1 - F5 */ in efi_cin_read_key()
586 pressed_key.scan_code = ch - '1' + 11; in efi_cin_read_key()
588 case '7'...'9': /* F6 - F8 */ in efi_cin_read_key()
589 pressed_key.scan_code = ch - '7' + 16; in efi_cin_read_key()
592 pressed_key.scan_code = ch - 'A' + 1; in efi_cin_read_key()
603 ch = analyze_modifiers(&key->key_state); in efi_cin_read_key()
605 case '0'...'1': /* F9 - F10 */ in efi_cin_read_key()
606 pressed_key.scan_code = ch - '0' + 19; in efi_cin_read_key()
608 case '3'...'4': /* F11 - F12 */ in efi_cin_read_key()
609 pressed_key.scan_code = ch - '3' + 21; in efi_cin_read_key()
618 analyze_modifiers(&key->key_state); in efi_cin_read_key()
622 analyze_modifiers(&key->key_state); in efi_cin_read_key()
626 analyze_modifiers(&key->key_state); in efi_cin_read_key()
632 set_shift_mask(3, &key->key_state); in efi_cin_read_key()
640 key->key_state.key_shift_state |= EFI_SHIFT_STATE_VALID; in efi_cin_read_key()
649 key->key_state.key_shift_state |= in efi_cin_read_key()
655 key->key_state.key_shift_state |= in efi_cin_read_key()
660 key->key = pressed_key; in efi_cin_read_key()
666 * efi_cin_notify() - notify registered functions
676 if (item->key.key.unicode_char || item->key.key.scan_code) { in efi_cin_notify()
677 if (item->key.key.unicode_char != in efi_cin_notify()
679 item->key.key.scan_code != next_key.key.scan_code) in efi_cin_notify()
682 if (item->key.key_state.key_shift_state && in efi_cin_notify()
683 item->key.key_state.key_shift_state != in efi_cin_notify()
689 EFI_CALL(item->function(&next_key)); in efi_cin_notify()
694 * efi_cin_check() - check if keyboard input is available
721 * efi_cin_empty_buffer() - empty input buffer
731 * efi_cin_reset_ex() - reset console input
733 * @this: - the extended simple text input protocol
734 * @extended_verification: - extended verification
764 * efi_cin_read_key_stroke_ex() - read key stroke
802 efi_con_in.wait_for_key->is_signaled = false; in efi_cin_read_key_stroke_ex()
808 * efi_cin_set_state() - set toggle key state
826 * U-Boot supports multiple console input sources like serial and in efi_cin_set_state()
836 * efi_cin_register_key_notify() - register key notification function
870 key_data->key.unicode_char, in efi_cin_register_key_notify()
871 key_data->key.scan_code, in efi_cin_register_key_notify()
872 key_data->key_state.key_shift_state, in efi_cin_register_key_notify()
873 key_data->key_state.key_toggle_state); in efi_cin_register_key_notify()
880 notify_function->key = *key_data; in efi_cin_register_key_notify()
881 notify_function->function = key_notify_function; in efi_cin_register_key_notify()
882 list_add_tail(¬ify_function->link, &cin_notify_functions); in efi_cin_register_key_notify()
889 * efi_cin_unregister_key_notify() - unregister key notification function
925 list_del(¬ify_function->link); in efi_cin_unregister_key_notify()
933 * efi_cin_reset() - drain the input buffer
965 * efi_cin_read_key_stroke() - read key stroke
1003 efi_con_in.wait_for_key->is_signaled = false; in efi_cin_read_key_stroke()
1026 * efi_console_timer_notify() - notify the console timer event
1040 * efi_key_notify() - notify the wait for key event
1053 * efi_console_register() - install the console protocols