aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scripts/kconfig/lex.zconf.c_shipped25
-rw-r--r--scripts/kconfig/lkc_proto.h2
-rw-r--r--scripts/kconfig/menu.c64
-rw-r--r--scripts/kconfig/symbol.c24
-rw-r--r--scripts/kconfig/zconf.tab.c_shipped301
-rw-r--r--scripts/kconfig/zconf.y13
6 files changed, 206 insertions, 223 deletions
diff --git a/scripts/kconfig/lex.zconf.c_shipped b/scripts/kconfig/lex.zconf.c_shipped
index bed0f4e2d2f7..6a61cee4a32c 100644
--- a/scripts/kconfig/lex.zconf.c_shipped
+++ b/scripts/kconfig/lex.zconf.c_shipped
@@ -5,25 +5,6 @@
5 5
6/* A lexical scanner generated by flex */ 6/* A lexical scanner generated by flex */
7 7
8#define yy_create_buffer zconf_create_buffer
9#define yy_delete_buffer zconf_delete_buffer
10#define yy_flex_debug zconf_flex_debug
11#define yy_init_buffer zconf_init_buffer
12#define yy_flush_buffer zconf_flush_buffer
13#define yy_load_buffer_state zconf_load_buffer_state
14#define yy_switch_to_buffer zconf_switch_to_buffer
15#define yyin zconfin
16#define yyleng zconfleng
17#define yylex zconflex
18#define yylineno zconflineno
19#define yyout zconfout
20#define yyrestart zconfrestart
21#define yytext zconftext
22#define yywrap zconfwrap
23#define yyalloc zconfalloc
24#define yyrealloc zconfrealloc
25#define yyfree zconffree
26
27#define FLEX_SCANNER 8#define FLEX_SCANNER
28#define YY_FLEX_MAJOR_VERSION 2 9#define YY_FLEX_MAJOR_VERSION 2
29#define YY_FLEX_MINOR_VERSION 5 10#define YY_FLEX_MINOR_VERSION 5
@@ -354,7 +335,7 @@ void zconffree (void * );
354 335
355/* Begin user sect3 */ 336/* Begin user sect3 */
356 337
357#define zconfwrap(n) 1 338#define zconfwrap() 1
358#define YY_SKIP_YYWRAP 339#define YY_SKIP_YYWRAP
359 340
360typedef unsigned char YY_CHAR; 341typedef unsigned char YY_CHAR;
@@ -1535,7 +1516,7 @@ static int yy_get_next_buffer (void)
1535 1516
1536 /* Read in more data. */ 1517 /* Read in more data. */
1537 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), 1518 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1538 (yy_n_chars), num_to_read ); 1519 (yy_n_chars), (size_t) num_to_read );
1539 1520
1540 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 1521 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1541 } 1522 }
@@ -2007,7 +1988,7 @@ YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size )
2007 1988
2008/** Setup the input buffer state to scan a string. The next call to zconflex() will 1989/** Setup the input buffer state to scan a string. The next call to zconflex() will
2009 * scan from a @e copy of @a str. 1990 * scan from a @e copy of @a str.
2010 * @param str a NUL-terminated string to scan 1991 * @param yystr a NUL-terminated string to scan
2011 * 1992 *
2012 * @return the newly allocated buffer state object. 1993 * @return the newly allocated buffer state object.
2013 * @note If you want to scan bytes that may contain NUL values, then use 1994 * @note If you want to scan bytes that may contain NUL values, then use
diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h
index 4d09f6ddefe3..8e69461313d1 100644
--- a/scripts/kconfig/lkc_proto.h
+++ b/scripts/kconfig/lkc_proto.h
@@ -21,7 +21,7 @@ P(menu_get_help,const char *,(struct menu *menu));
21/* symbol.c */ 21/* symbol.c */
22P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]); 22P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]);
23 23
24P(sym_lookup,struct symbol *,(const char *name, int isconst)); 24P(sym_lookup,struct symbol *,(const char *name, int flags));
25P(sym_find,struct symbol *,(const char *name)); 25P(sym_find,struct symbol *,(const char *name));
26P(sym_re_search,struct symbol **,(const char *pattern)); 26P(sym_re_search,struct symbol **,(const char *pattern));
27P(sym_type_name,const char *,(enum symbol_type type)); 27P(sym_type_name,const char *,(enum symbol_type type));
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index 606ceb9e746e..07ff8d105c9d 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -235,18 +235,22 @@ void menu_finalize(struct menu *parent)
235 sym = parent->sym; 235 sym = parent->sym;
236 if (parent->list) { 236 if (parent->list) {
237 if (sym && sym_is_choice(sym)) { 237 if (sym && sym_is_choice(sym)) {
238 /* find the first choice value and find out choice type */ 238 if (sym->type == S_UNKNOWN) {
239 for (menu = parent->list; menu; menu = menu->next) { 239 /* find the first choice value to find out choice type */
240 if (menu->sym) { 240 current_entry = parent;
241 current_entry = parent; 241 for (menu = parent->list; menu; menu = menu->next) {
242 if (sym->type == S_UNKNOWN) 242 if (menu->sym && menu->sym->type != S_UNKNOWN) {
243 menu_set_type(menu->sym->type); 243 menu_set_type(menu->sym->type);
244 current_entry = menu; 244 break;
245 if (menu->sym->type == S_UNKNOWN) 245 }
246 menu_set_type(sym->type);
247 break;
248 } 246 }
249 } 247 }
248 /* set the type of the remaining choice values */
249 for (menu = parent->list; menu; menu = menu->next) {
250 current_entry = menu;
251 if (menu->sym && menu->sym->type == S_UNKNOWN)
252 menu_set_type(sym->type);
253 }
250 parentdep = expr_alloc_symbol(sym); 254 parentdep = expr_alloc_symbol(sym);
251 } else if (parent->prompt) 255 } else if (parent->prompt)
252 parentdep = parent->prompt->visible.expr; 256 parentdep = parent->prompt->visible.expr;
@@ -313,50 +317,36 @@ void menu_finalize(struct menu *parent)
313 } 317 }
314 } 318 }
315 for (menu = parent->list; menu; menu = menu->next) { 319 for (menu = parent->list; menu; menu = menu->next) {
316 if (sym && sym_is_choice(sym) && menu->sym) { 320 if (sym && sym_is_choice(sym) &&
321 menu->sym && !sym_is_choice_value(menu->sym)) {
322 current_entry = menu;
317 menu->sym->flags |= SYMBOL_CHOICEVAL; 323 menu->sym->flags |= SYMBOL_CHOICEVAL;
318 if (!menu->prompt) 324 if (!menu->prompt)
319 menu_warn(menu, "choice value must have a prompt"); 325 menu_warn(menu, "choice value must have a prompt");
320 for (prop = menu->sym->prop; prop; prop = prop->next) { 326 for (prop = menu->sym->prop; prop; prop = prop->next) {
321 if (prop->type == P_PROMPT && prop->menu != menu) {
322 prop_warn(prop, "choice values "
323 "currently only support a "
324 "single prompt");
325 }
326 if (prop->type == P_DEFAULT) 327 if (prop->type == P_DEFAULT)
327 prop_warn(prop, "defaults for choice " 328 prop_warn(prop, "defaults for choice "
328 "values not supported"); 329 "values not supported");
330 if (prop->menu == menu)
331 continue;
332 if (prop->type == P_PROMPT &&
333 prop->menu->parent->sym != sym)
334 prop_warn(prop, "choice value used outside its choice group");
329 } 335 }
330 current_entry = menu;
331 if (menu->sym->type == S_UNKNOWN)
332 menu_set_type(sym->type);
333 /* Non-tristate choice values of tristate choices must 336 /* Non-tristate choice values of tristate choices must
334 * depend on the choice being set to Y. The choice 337 * depend on the choice being set to Y. The choice
335 * values' dependencies were propagated to their 338 * values' dependencies were propagated to their
336 * properties above, so the change here must be re- 339 * properties above, so the change here must be re-
337 * propagated. */ 340 * propagated.
341 */
338 if (sym->type == S_TRISTATE && menu->sym->type != S_TRISTATE) { 342 if (sym->type == S_TRISTATE && menu->sym->type != S_TRISTATE) {
339 basedep = expr_alloc_comp(E_EQUAL, sym, &symbol_yes); 343 basedep = expr_alloc_comp(E_EQUAL, sym, &symbol_yes);
340 basedep = expr_alloc_and(basedep, menu->dep); 344 menu->dep = expr_alloc_and(basedep, menu->dep);
341 basedep = expr_eliminate_dups(basedep);
342 menu->dep = basedep;
343 for (prop = menu->sym->prop; prop; prop = prop->next) { 345 for (prop = menu->sym->prop; prop; prop = prop->next) {
344 if (prop->menu != menu) 346 if (prop->menu != menu)
345 continue; 347 continue;
346 dep = expr_alloc_and(expr_copy(basedep), 348 prop->visible.expr = expr_alloc_and(expr_copy(basedep),
347 prop->visible.expr); 349 prop->visible.expr);
348 dep = expr_eliminate_dups(dep);
349 dep = expr_trans_bool(dep);
350 prop->visible.expr = dep;