You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/10/18 20:18:44 UTC
[incubator-nuttx-apps] branch master updated: nshlib: Rename CONFIG_SYSTEM_NSH_SYMTAB to CONFIG_NSH_SYMTAB
This is an automated email from the ASF dual-hosted git repository.
pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new 0d2ef4719 nshlib: Rename CONFIG_SYSTEM_NSH_SYMTAB to CONFIG_NSH_SYMTAB
0d2ef4719 is described below
commit 0d2ef471929b4f050516cf82a827439e548c3d93
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sat Oct 15 18:19:09 2022 +0800
nshlib: Rename CONFIG_SYSTEM_NSH_SYMTAB to CONFIG_NSH_SYMTAB
Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
nshlib/Kconfig | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
nshlib/nsh_init.c | 20 ++++++++++----------
system/nsh/Kconfig | 48 ------------------------------------------------
tools/mksymtab.sh | 8 ++++----
4 files changed, 62 insertions(+), 62 deletions(-)
diff --git a/nshlib/Kconfig b/nshlib/Kconfig
index 24e508e16..f3b914edf 100644
--- a/nshlib/Kconfig
+++ b/nshlib/Kconfig
@@ -203,6 +203,54 @@ config NSH_FILE_APPS
system. This options requires support for the posix_spawn()
interface (LIBC_EXECFUNCS).
+config NSH_SYMTAB
+ bool "Register symbol table"
+ default n
+ depends on LIBC_EXECFUNCS && BOARDCTL && !EXECFUNCS_HAVE_SYMTAB
+ select BOARDCTL_APP_SYMTAB
+ ---help---
+ Enable logic to automatically register an application symbol table
+ as part of NSH initialization. If enabled, then application logic
+ must provide the following:
+
+ const struct symtab_s g_exports[];
+ const int g_nexports;
+
+ Where g_exports is the name of the exported application symbol table
+ and g_nexports holds the number of entries in the application symbol
+ table.
+
+ This is done very early in the NSH initialization sequence.
+
+ Why might you want to do this? There is really only one reason: You
+ would like to have the symbol tables in place early so that programs
+ started by NSH, perhaps via an initialization script, will have all
+ of the necessary symbols in place. Otherwise, you probably do *not*
+ want this option!
+
+if NSH_SYMTAB
+
+config NSH_SYMTAB_ARRAYNAME
+ string "Symbol table used by exec[l|v]"
+ default "g_exports"
+ ---help---
+ The exec[l|v] and posix_spawn() functions needs to have (1) a
+ symbol table that provides the list of symbols exported by the base
+ code, and (2) the number of symbols in that table. This selection
+ provides the name of that symbol table.
+
+config NSH_SYMTAB_COUNTNAME
+ string "Variable holding the number of symbols"
+ default "g_nexports"
+ ---help---
+ The exec[l|v] and posix_spawn() functions needs to have (1) a
+ symbol table that provides the list of symbols exported by the base
+ code, and (2) the number of symbols in that table. This selection
+ provides the name of 'int' variable that holds the number of symbol
+ in the table.
+
+endif # NSH_SYMTAB
+
menu "Disable Individual commands"
config NSH_DISABLE_ADDROUTE
diff --git a/nshlib/nsh_init.c b/nshlib/nsh_init.c
index c49bdfd34..ba4664149 100644
--- a/nshlib/nsh_init.c
+++ b/nshlib/nsh_init.c
@@ -41,7 +41,7 @@
/* Symbol table is not needed if loadable binary modules are not supported */
#if !defined(CONFIG_LIBC_EXECFUNCS)
-# undef CONFIG_SYSTEM_NSH_SYMTAB
+# undef CONFIG_NSH_SYMTAB
#endif
/* boardctl() support is also required for application-space symbol table
@@ -49,7 +49,7 @@
*/
#if !defined(CONFIG_BOARDCTL) || !defined(CONFIG_BOARDCTL_APP_SYMTAB)
-# undef CONFIG_SYSTEM_NSH_SYMTAB
+# undef CONFIG_NSH_SYMTAB
#endif
/* If a symbol table is provided by board-specific logic, then we do not
@@ -57,7 +57,7 @@
*/
#ifdef CONFIG_EXECFUNCS_HAVE_SYMTAB
-# undef CONFIG_SYSTEM_NSH_SYMTAB
+# undef CONFIG_NSH_SYMTAB
#endif
/****************************************************************************
@@ -73,9 +73,9 @@ static const struct extmatch_vtable_s g_nsh_extmatch =
};
#endif
-#if defined(CONFIG_SYSTEM_NSH_SYMTAB)
-extern const struct symtab_s CONFIG_SYSTEM_NSH_SYMTAB_ARRAYNAME[];
-extern const int CONFIG_SYSTEM_NSH_SYMTAB_COUNTNAME;
+#if defined(CONFIG_NSH_SYMTAB)
+extern const struct symtab_s CONFIG_NSH_SYMTAB_ARRAYNAME[];
+extern const int CONFIG_NSH_SYMTAB_COUNTNAME;
#endif
/****************************************************************************
@@ -100,7 +100,7 @@ extern const int CONFIG_SYSTEM_NSH_SYMTAB_COUNTNAME;
void nsh_initialize(void)
{
-#if defined (CONFIG_SYSTEM_NSH_SYMTAB)
+#if defined (CONFIG_NSH_SYMTAB)
struct boardioc_symtab_s symdesc;
#endif
#if defined(CONFIG_NSH_ROMFSETC) && !defined(CONFIG_NSH_DISABLESCRIPT)
@@ -129,11 +129,11 @@ void nsh_initialize(void)
usbtrace_enable(TRACE_BITSET);
#endif
-#if defined(CONFIG_SYSTEM_NSH_SYMTAB)
+#if defined(CONFIG_NSH_SYMTAB)
/* Make sure that we are using our symbol table */
- symdesc.symtab = (FAR struct symtab_s *)CONFIG_SYSTEM_NSH_SYMTAB_ARRAYNAME; /* Discard 'const' */
- symdesc.nsymbols = CONFIG_SYSTEM_NSH_SYMTAB_COUNTNAME;
+ symdesc.symtab = (FAR struct symtab_s *)CONFIG_NSH_SYMTAB_ARRAYNAME; /* Discard 'const' */
+ symdesc.nsymbols = CONFIG_NSH_SYMTAB_COUNTNAME;
boardctl(BOARDIOC_APP_SYMTAB, (uintptr_t)&symdesc);
#endif
diff --git a/system/nsh/Kconfig b/system/nsh/Kconfig
index 20b16ba89..1fbc535a0 100644
--- a/system/nsh/Kconfig
+++ b/system/nsh/Kconfig
@@ -21,54 +21,6 @@ config SYSTEM_NSH_STACKSIZE
int "NuttX shell stack size"
default DEFAULT_TASK_STACKSIZE
-config SYSTEM_NSH_SYMTAB
- bool "Register symbol table"
- default n
- depends on LIBC_EXECFUNCS && BOARDCTL && !EXECFUNCS_HAVE_SYMTAB
- select BOARDCTL_APP_SYMTAB
- ---help---
- Enable logic to automatically register an application symbol table
- as part of NSH initialization. If enabled, then application logic
- must provide the following:
-
- const struct symtab_s g_exports[];
- const int g_nexports;
-
- Where g_exports is the name of the exported application symbol table
- and g_nexports holds the number of entries in the application symbol
- table.
-
- This is done very early in the NSH initialization sequence.
-
- Why might you want to do this? There is really only one reason: You
- would like to have the symbol tables in place early so that programs
- started by NSH, perhaps via an initialization script, will have all
- of the necessary symbols in place. Otherwise, you probably do *not*
- want this option!
-
-if SYSTEM_NSH_SYMTAB
-
-config SYSTEM_NSH_SYMTAB_ARRAYNAME
- string "Symbol table used by exec[l|v]"
- default "g_exports"
- ---help---
- The exec[l|v] and posix_spawn() functions needs to have (1) a
- symbol table that provides the list of symbols exported by the base
- code, and (2) the number of symbols in that table. This selection
- provides the name of that symbol table.
-
-config SYSTEM_NSH_SYMTAB_COUNTNAME
- string "Variable holding the number of symbols"
- default "g_nexports"
- ---help---
- The exec[l|v] and posix_spawn() functions needs to have (1) a
- symbol table that provides the list of symbols exported by the base
- code, and (2) the number of symbols in that table. This selection
- provides the name of 'int' variable that holds the number of symbol
- in the table.
-
-endif # SYSTEM_NSH_SYMTAB
-
config SYSTEM_NSH_PROGNAME
string "Program name"
default "nsh"
diff --git a/tools/mksymtab.sh b/tools/mksymtab.sh
index 9275945eb..f2cd82fdd 100755
--- a/tools/mksymtab.sh
+++ b/tools/mksymtab.sh
@@ -66,8 +66,8 @@ echo ""
if [ -z "$prefix" ]; then
echo "#if defined(CONFIG_EXECFUNCS_HAVE_SYMTAB)"
echo "const struct symtab_s CONFIG_EXECFUNCS_SYMTAB_ARRAY[] = "
- echo "#elif defined(CONFIG_SYSTEM_NSH_SYMTAB)"
- echo "const struct symtab_s CONFIG_SYSTEM_NSH_SYMTAB_ARRAYNAME[] = "
+ echo "#elif defined(CONFIG_NSH_SYMTAB)"
+ echo "const struct symtab_s CONFIG_NSH_SYMTAB_ARRAYNAME[] = "
echo "#else"
echo "const struct symtab_s dummy_symtab[] = "
echo "#endif"
@@ -86,8 +86,8 @@ echo ""
if [ -z "$prefix" ]; then
echo "#if defined(CONFIG_EXECFUNCS_HAVE_SYMTAB)"
echo "const int CONFIG_EXECFUNCS_NSYMBOLS_VAR = sizeof(CONFIG_EXECFUNCS_SYMTAB_ARRAY) / sizeof(struct symtab_s);"
- echo "#elif defined(CONFIG_SYSTEM_NSH_SYMTAB)"
- echo "const int CONFIG_SYSTEM_NSH_SYMTAB_COUNTNAME = sizeof(CONFIG_SYSTEM_NSH_SYMTAB_ARRAYNAME) / sizeof(struct symtab_s);"
+ echo "#elif defined(CONFIG_NSH_SYMTAB)"
+ echo "const int CONFIG_NSH_SYMTAB_COUNTNAME = sizeof(CONFIG_NSH_SYMTAB_ARRAYNAME) / sizeof(struct symtab_s);"
echo "#else"
echo "const int dummy_nsymtabs = sizeof(dummy_symtab) / sizeof(struct symtab_s);"
echo "#endif"