diff --git a/configs/Kconfig b/configs/Kconfig index e2132be560c..72fcd7f709e 100644 --- a/configs/Kconfig +++ b/configs/Kconfig @@ -1799,12 +1799,19 @@ config BOARDCTL_UNIQUEID_SIZE Provides the size of the memory buffer that must be provided by the caller of board_uniqueid() in which to receive the board unique ID. -config BOARDCTL_SYMTAB - bool "Enable symbol table interfaces" +config BOARDCTL_APP_SYMTAB + bool "Enable application symbol table interfaces" default n depends on EXECFUNCS_HAVE_SYMTAB ---help--- - Enables support for the BOARDIOC_SYMTAB boardctl() command. + Enables support for the BOARDIOC_APP_SYMTAB boardctl() command. + +config BOARDCTL_OS_SYMTAB + bool "Enable kernel module symbol table interfaces" + default n + depends on MODULE + ---help--- + Enables support for the BOARDIOC_OS_SYMTAB boardctl() command. config BOARDCTL_TSCTEST bool "Enable touchscreen test interfaces" diff --git a/configs/boardctl.c b/configs/boardctl.c index 1898faf3d75..924e78e98c9 100644 --- a/configs/boardctl.c +++ b/configs/boardctl.c @@ -46,6 +46,7 @@ #include #include +#include #include #ifdef CONFIG_LIB_BOARDCTL @@ -148,15 +149,17 @@ int boardctl(unsigned int cmd, uintptr_t arg) break; #endif -#ifdef CONFIG_BOARDCTL_SYMTAB - /* CMD: BOARDIOC_SYMTAB - * DESCRIPTION: Select a symbol table +#ifdef CONFIG_BOARDCTL_APP_SYMTAB + /* CMD: BOARDIOC_APP_SYMTAB + * DESCRIPTION: Select the application symbol table. This symbol table + * provides the symbol definitions exported to application + * code from application space. * ARG: A pointer to an instance of struct boardioc_symtab_s - * CONFIGURATION: CONFIG_BOARDCTL_SYMTAB + * CONFIGURATION: CONFIG_BOARDCTL_APP_SYMTAB * DEPENDENCIES: None */ - case BOARDIOC_SYMTAB: + case BOARDIOC_APP_SYMTAB: { FAR const struct boardioc_symtab_s *symdesc = (FAR const struct boardioc_symtab_s *)arg; @@ -168,6 +171,28 @@ int boardctl(unsigned int cmd, uintptr_t arg) break; #endif +#ifdef CONFIG_BOARDCTL_OS_SYMTAB + /* CMD: BOARDIOC_OS_SYMTAB + * DESCRIPTION: Select the OS symbol table. This symbol table provides + * the symbol definitions exported by the OS to kernel + * modules. + * ARG: A pointer to an instance of struct boardioc_symtab_s + * CONFIGURATION: CONFIG_BOARDCTL_OS_SYMTAB + * DEPENDENCIES: None + */ + + case BOARDIOC_OS_SYMTAB: + { + FAR const struct boardioc_symtab_s *symdesc = + (FAR const struct boardioc_symtab_s *)arg; + + DEBUGASSERT(symdesc != NULL); + mod_setsymtab(symdesc->symtab, symdesc->nsymbols); + ret = OK; + } + break; +#endif + #ifdef CONFIG_BOARDCTL_TSCTEST /* CMD: BOARDIOC_TSCTEST_SETUP * DESCRIPTION: Touchscreen controller test configuration diff --git a/configs/samv71-xult/module/defconfig b/configs/samv71-xult/module/defconfig index b6a7d946f6a..8ba67a829ea 100644 --- a/configs/samv71-xult/module/defconfig +++ b/configs/samv71-xult/module/defconfig @@ -336,6 +336,7 @@ CONFIG_NSH_MMCSDMINOR=0 # CONFIG_SAMV71XULT_MXTXPLND is not set CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set +CONFIG_BOARDCTL_OS_SYMTAB=y # CONFIG_BOARDCTL_TSCTEST is not set # CONFIG_BOARDCTL_ADCTEST is not set # CONFIG_BOARDCTL_PWMTEST is not set diff --git a/configs/sim/bas/defconfig b/configs/sim/bas/defconfig index 2e57557c341..2c5fde3af67 100644 --- a/configs/sim/bas/defconfig +++ b/configs/sim/bas/defconfig @@ -146,7 +146,7 @@ CONFIG_NSH_MMCSDMINOR=0 CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_POWEROFF is not set # CONFIG_BOARDCTL_UNIQUEID is not set -# CONFIG_BOARDCTL_SYMTAB is not set +# CONFIG_BOARDCTL_APP_SYMTAB is not set # CONFIG_BOARDCTL_TSCTEST is not set # CONFIG_BOARDCTL_ADCTEST is not set # CONFIG_BOARDCTL_PWMTEST is not set diff --git a/configs/sim/nsh/defconfig b/configs/sim/nsh/defconfig index 3cf734734a9..b52d9e26426 100644 --- a/configs/sim/nsh/defconfig +++ b/configs/sim/nsh/defconfig @@ -146,7 +146,7 @@ CONFIG_NSH_MMCSDMINOR=0 CONFIG_LIB_BOARDCTL=y CONFIG_BOARDCTL_POWEROFF=y # CONFIG_BOARDCTL_UNIQUEID is not set -# CONFIG_BOARDCTL_SYMTAB is not set +# CONFIG_BOARDCTL_APP_SYMTAB is not set # CONFIG_BOARDCTL_TSCTEST is not set # CONFIG_BOARDCTL_ADCTEST is not set # CONFIG_BOARDCTL_PWMTEST is not set diff --git a/configs/sim/udgram/defconfig b/configs/sim/udgram/defconfig index 1edd31f1d83..73a78ee9e46 100644 --- a/configs/sim/udgram/defconfig +++ b/configs/sim/udgram/defconfig @@ -147,7 +147,7 @@ CONFIG_NSH_MMCSDMINOR=0 CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_POWEROFF is not set # CONFIG_BOARDCTL_UNIQUEID is not set -# CONFIG_BOARDCTL_SYMTAB is not set +# CONFIG_BOARDCTL_APP_SYMTAB is not set # CONFIG_BOARDCTL_TSCTEST is not set # CONFIG_BOARDCTL_ADCTEST is not set # CONFIG_BOARDCTL_PWMTEST is not set diff --git a/configs/sim/unionfs/defconfig b/configs/sim/unionfs/defconfig index 0d793240569..74327b71c85 100644 --- a/configs/sim/unionfs/defconfig +++ b/configs/sim/unionfs/defconfig @@ -146,7 +146,7 @@ CONFIG_NSH_MMCSDMINOR=0 CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_POWEROFF is not set # CONFIG_BOARDCTL_UNIQUEID is not set -# CONFIG_BOARDCTL_SYMTAB is not set +# CONFIG_BOARDCTL_APP_SYMTAB is not set # CONFIG_BOARDCTL_TSCTEST is not set # CONFIG_BOARDCTL_ADCTEST is not set # CONFIG_BOARDCTL_PWMTEST is not set diff --git a/configs/sim/ustream/defconfig b/configs/sim/ustream/defconfig index c475ecf7f04..8e4f79ef080 100644 --- a/configs/sim/ustream/defconfig +++ b/configs/sim/ustream/defconfig @@ -147,7 +147,7 @@ CONFIG_NSH_MMCSDMINOR=0 CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_POWEROFF is not set # CONFIG_BOARDCTL_UNIQUEID is not set -# CONFIG_BOARDCTL_SYMTAB is not set +# CONFIG_BOARDCTL_APP_SYMTAB is not set # CONFIG_BOARDCTL_TSCTEST is not set # CONFIG_BOARDCTL_ADCTEST is not set # CONFIG_BOARDCTL_PWMTEST is not set