arch/arm64: Support FEAT_CCIDX
[coreboot2.git] / util / kconfig / mnconf-common.c
blob18cb9a6c5aaad648c4b7f04c5457bd4442064226
1 // SPDX-License-Identifier: GPL-2.0-only
2 #include "expr.h"
3 #include "list.h"
4 #include "mnconf-common.h"
6 int jump_key_char;
8 int next_jump_key(int key)
10 if (key < '1' || key > '9')
11 return '1';
13 key++;
15 if (key > '9')
16 key = '1';
18 return key;
21 int handle_search_keys(int key, size_t start, size_t end, void *_data)
23 struct search_data *data = _data;
24 struct jump_key *pos;
25 int index = 0;
27 if (key < '1' || key > '9')
28 return 0;
30 list_for_each_entry(pos, data->head, entries) {
31 index = next_jump_key(index);
33 if (pos->offset < start)
34 continue;
36 if (pos->offset >= end)
37 break;
39 if (key == index) {
40 data->target = pos->target;
41 return 1;
45 return 0;
48 int get_jump_key_char(void)
50 jump_key_char = next_jump_key(jump_key_char);
52 return jump_key_char;