diff options
author | Ulf Magnusson <ulfalizer@gmail.com> | 2017-10-04 01:48:14 -0400 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-12-07 09:46:57 -0500 |
commit | 52aede4ba5efd159a6c5f4a0c25586cb26e7befc (patch) | |
tree | e965212a660ae9d1b344d02f5d1fcaacdc005568 /scripts/kconfig/expr.h | |
parent | 33ca1a24866373777c5e1415f974069835f8cf41 (diff) |
kconfig: Document the 'symbol' struct
Visibility and choices in particular might be a bit tricky to figure
out.
Also fix existing comment to point out that P_MENU is also used for
menus.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts/kconfig/expr.h')
-rw-r--r-- | scripts/kconfig/expr.h | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h index ae7583c3a7b1..e7d7a5e3da68 100644 --- a/scripts/kconfig/expr.h +++ b/scripts/kconfig/expr.h | |||
@@ -74,17 +74,60 @@ enum { | |||
74 | S_DEF_COUNT | 74 | S_DEF_COUNT |
75 | }; | 75 | }; |
76 | 76 | ||
77 | /* | ||
78 | * Represents a configuration symbol. | ||
79 | * | ||
80 | * Choices are represented as a special kind of symbol and have the | ||
81 | * SYMBOL_CHOICE bit set in 'flags'. | ||
82 | */ | ||
77 | struct symbol { | 83 | struct symbol { |
84 | /* The next symbol in the same bucket in the symbol hash table */ | ||
78 | struct symbol *next; | 85 | struct symbol *next; |
86 | |||
87 | /* The name of the symbol, e.g. "FOO" for 'config FOO' */ | ||
79 | char *name; | 88 | char *name; |
89 | |||
90 | /* S_BOOLEAN, S_TRISTATE, ... */ | ||
80 | enum symbol_type type; | 91 | enum symbol_type type; |
92 | |||
93 | /* | ||
94 | * The calculated value of the symbol. The SYMBOL_VALID bit is set in | ||
95 | * 'flags' when this is up to date. Note that this value might differ | ||
96 | * from the user value set in e.g. a .config file, due to visibility. | ||
97 | */ | ||
81 | struct symbol_value curr; | 98 | struct symbol_value curr; |
99 | |||
100 | /* | ||
101 | * Values for the symbol provided from outside. def[S_DEF_USER] holds | ||
102 | * the .config value. | ||
103 | */ | ||
82 | struct symbol_value def[S_DEF_COUNT]; | 104 | struct symbol_value def[S_DEF_COUNT]; |
105 | |||
106 | /* | ||
107 | * An upper bound on the tristate value the user can set for the symbol | ||
108 | * if it is a boolean or tristate. Calculated from prompt dependencies, | ||
109 | * which also inherit dependencies from enclosing menus, choices, and | ||
110 | * ifs. If 'n', the user value will be ignored. | ||
111 | * | ||
112 | * Symbols lacking prompts always have visibility 'n'. | ||
113 | */ | ||
83 | tristate visible; | 114 | tristate visible; |
115 | |||
116 | /* SYMBOL_* flags */ | ||
84 | int flags; | 117 | int flags; |
118 | |||
119 | /* List of properties. See prop_type. */ | ||
85 | struct property *prop; | 120 | struct property *prop; |
121 | |||
122 | /* Dependencies from enclosing menus, choices, and ifs */ | ||
86 | struct expr_value dir_dep; | 123 | struct expr_value dir_dep; |
124 | |||
125 | /* Reverse dependencies through being selected by other symbols */ | ||
87 | struct expr_value rev_dep; | 126 | struct expr_value rev_dep; |
127 | |||
128 | /* | ||
129 | * "Weak" reverse dependencies through being implied by other symbols | ||
130 | */ | ||
88 | struct expr_value implied; | 131 | struct expr_value implied; |
89 | }; | 132 | }; |
90 | 133 | ||
@@ -133,7 +176,7 @@ enum prop_type { | |||
133 | P_UNKNOWN, | 176 | P_UNKNOWN, |
134 | P_PROMPT, /* prompt "foo prompt" or "BAZ Value" */ | 177 | P_PROMPT, /* prompt "foo prompt" or "BAZ Value" */ |
135 | P_COMMENT, /* text associated with a comment */ | 178 | P_COMMENT, /* text associated with a comment */ |
136 | P_MENU, /* prompt associated with a menuconfig option */ | 179 | P_MENU, /* prompt associated with a menu or menuconfig symbol */ |
137 | P_DEFAULT, /* default y */ | 180 | P_DEFAULT, /* default y */ |
138 | P_CHOICE, /* choice value */ | 181 | P_CHOICE, /* choice value */ |
139 | P_SELECT, /* select BAR */ | 182 | P_SELECT, /* select BAR */ |