CONFIG_BUILD_LOADABLE: Check the kernel function callable by BUILD_KERNEL instead of BUILD_LOADABLE since BUILD_LOADABLE could be turned on even with BUILD_FLAT.

This commit is contained in:
Xiang Xiao 2019-10-03 14:10:32 -06:00 committed by Gregory Nutt
parent 4b49362719
commit 63c3772888
20 changed files with 29 additions and 30 deletions

View File

@ -398,7 +398,7 @@ examples/flash_test
* CONFIG_MTD_SMART=y - SMART block driver support
* CONFIG_NSH_BUILTIN_APPS=y - This example can only be built as an NSH
command
* CONFIG_BUILD_PROTECTED=n and CONFIG_BUILD_LOADABLE=n- This test uses
* CONFIG_BUILD_PROTECTED=n and CONFIG_BUILD_KERNEL=n - This test uses
internal OS interfaces and so is not available in the NUTTX kernel
builds
@ -1496,7 +1496,7 @@ examples/relays
relies on internal OS interfaces that are not normally available to a
user-space program. As a result, this example cannot be used if a
NuttX is built as a protected, supervisor kernel (CONFIG_BUILD_PROTECTED
or CONFIG_BUILD_LOADABLE).
or CONFIG_BUILD_KERNEL).
examples/rfid_readuid
^^^^^^^^^^^^^^^^^^^^^

View File

@ -6,7 +6,7 @@
config EXAMPLES_FLASH_TEST
tristate "SMART FLASH block device test"
default n
depends on (!BUILD_PROTECTED && !BUILD_LOADABLE) && MTD_SMART && NSH_BUILTIN_APPS
depends on (!BUILD_PROTECTED && !BUILD_KERNEL) && MTD_SMART && NSH_BUILTIN_APPS
---help---
This logic performs a SMART flash block device test. This test
performs a sector allocate, read, write, free and garbage collection

View File

@ -78,7 +78,7 @@ config EXAMPLES_I2SCHAR_BUFSIZE
config EXAMPLES_I2SCHAR_DEVINIT
bool "Architecture-specific device initialization"
default 256
depends on !BUILD_PROTECTED && !BUILD_LOADABLE
depends on !BUILD_PROTECTED && !BUILD_KERNEL
---help---
Define if architecture-specific I2S device initialize is available.
If defined, the platform specific code must provide a function

View File

@ -128,7 +128,7 @@ config EXAMPLES_MODULE_NOSTRIP
config EXAMPLES_MODULE_LIBC
bool "Link with LIBC"
default n
depends on !BUILD_LOADABLE && EXPERIMENTAL
depends on EXPERIMENTAL
---help---
Link with the C library (and also math library if it was built).
By default, all undefined symbols must be provided via a symbol
@ -147,6 +147,6 @@ config EXAMPLES_MODULE_LIBC
config EXAMPLES_MODULE_LIBGCC
bool "Link with LIBGCC"
default n
depends on !BUILD_LOADABLE && EXPERIMENTAL
depends on EXPERIMENTAL
endif

View File

@ -6,7 +6,7 @@
config EXAMPLES_MTDPART
tristate "MTD partition test"
default n
depends on MTD_PARTITION && !BUILD_PROTECTED && !BUILD_LOADABLE
depends on MTD_PARTITION && !BUILD_PROTECTED && !BUILD_KERNEL
---help---
Enable the MTD partition test example.

View File

@ -6,7 +6,7 @@
config EXAMPLES_MTDRWB
tristate "MTD R/W buffer test"
default n
depends on (MTD_WRBUFFER || MTD_READAHEAD) && !BUILD_PROTECTED && !BUILD_LOADABLE
depends on (MTD_WRBUFFER || MTD_READAHEAD) && !BUILD_PROTECTED && !BUILD_KERNEL
---help---
Enable the MTD R/W buffer test example.

View File

@ -133,7 +133,7 @@ config EXAMPLES_NETTEST_INIT
bool "Initialize network"
default n if NSH_BUILTIN_APPS
default y if !NSH_BUILTIN_APPS
depends on !BUILD_LOADABLE && !EXAMPLES_NETTEST_LOOPBACK
depends on !EXAMPLES_NETTEST_LOOPBACK
---help---
Include logic to initialize the network. This should not be done if
the network is already initialized when nettest runs. This is

View File

@ -7,7 +7,7 @@ config EXAMPLES_NXFLAT
bool "NXFLAT example"
default n
select LIBC_EXECFUNCS
depends on NXFLAT && !BUILD_LOADABLE
depends on NXFLAT
---help---
Enable the NXFLAT example

View File

@ -67,7 +67,7 @@ endif # !EXAMPLES_SOTEST_BUILTINFS
config EXAMPLES_SOTEST_LIBC
bool "Link with LIBC"
default n
depends on !BUILD_LOADABLE && EXPERIMENTAL
depends on EXPERIMENTAL
---help---
Link with the C library (and also math library if it was built).
By default, all undefined symbols must be provided via a symbol
@ -86,6 +86,6 @@ config EXAMPLES_SOTEST_LIBC
config EXAMPLES_SOTEST_LIBGCC
bool "Link with LIBGCC"
default n
depends on !BUILD_LOADABLE && EXPERIMENTAL
depends on EXPERIMENTAL
endif

View File

@ -143,7 +143,7 @@ config EXAMPLES_TCPBLASTER_INIT
bool "Initialize network"
default n if NSH_BUILTIN_APPS
default y if !NSH_BUILTIN_APPS
depends on !BUILD_LOADABLE && !EXAMPLES_TCPBLASTER_LOOPBACK
depends on !EXAMPLES_TCPBLASTER_LOOPBACK
---help---
Include logic to initialize the network. This should not be done if
the network is already initialized when tcpblaster runs. This is

View File

@ -60,7 +60,7 @@ config EXAMPLES_UDPBLASTER_INIT
bool "Initialize network"
default n if NSH_BUILTIN_APPS
default y if !NSH_BUILTIN_APPS
depends on !BUILD_LOADABLE && !EXAMPLES_UDPBLASTER_LOOPBACK
depends on !EXAMPLES_UDPBLASTER_LOOPBACK
---help---
Include logic to initialize the network. This should not be done if
the network is already initialized when udpblaster runs. This is

View File

@ -47,7 +47,7 @@
* Pre-processor Definitions
****************************************************************************/
#ifdef CONFIG_BUILD_LOADABLE
#ifdef CONFIG_BUILD_KERNEL
/* In the kernel build mode, we need to use a named semaphore so that all
* processes will share the same, named semaphore instance.
*/
@ -59,7 +59,7 @@
* Private Data
****************************************************************************/
#ifndef CONFIG_BUILD_LOADABLE
#ifndef CONFIG_BUILD_KERNEL
/* In the FLAT and PROTECTED build modes, we do not need to bother with a
* named semaphore. We use a single global semaphore in theses cases.
*/
@ -92,7 +92,7 @@ int passwd_lock(FAR sem_t **semp)
{
FAR sem_t *sem;
#ifdef CONFIG_BUILD_LOADABLE
#ifdef CONFIG_BUILD_KERNEL
/* Open the shared, named semaphore */
sem = sem_open(PASSWD_SEMNAME, O_CREAT, 0644, 1);
@ -127,7 +127,7 @@ int passwd_unlock(FAR sem_t *sem)
sem_post(sem);
#ifdef CONFIG_BUILD_LOADABLE
#ifdef CONFIG_BUILD_KERNEL
/* Close the named semaphore */
(void)sem_close(sem);

View File

@ -561,7 +561,7 @@
* library where they will become accessible to application code.
*/
#if defined(CONFIG_BUILD_PROTECTED) || defined(CONFIG_BUILD_LOADABLE)
#if defined(CONFIG_BUILD_PROTECTED) || defined(CONFIG_BUILD_KERNEL)
# undef CONFIG_NSH_DISABLE_MKRD /* 'mkrd' depends on ramdisk_register */
# define CONFIG_NSH_DISABLE_MKRD 1
#endif

View File

@ -58,7 +58,7 @@
* Private Data
****************************************************************************/
#ifndef CONFIG_BUILD_LOADABLE
#ifndef CONFIG_BUILD_KERNEL
static sem_t g_exclsem = SEM_INITIALIZER(1);
#endif
@ -78,7 +78,7 @@ static uint8_t g_buf2[MAX_BLOCKSIZE + LZF_MAX_HDR_SIZE + 16];
* Private Functions
****************************************************************************/
#ifndef CONFIG_BUILD_LOADABLE
#ifndef CONFIG_BUILD_KERNEL
static void lzf_exit(int exitcode) noreturn_function;
static void lzf_exit(int exitcode)
{
@ -443,7 +443,7 @@ int lzf_main(int argc, FAR char *argv[])
int optc;
int ret = 0;
#ifndef CONFIG_BUILD_LOADABLE
#ifndef CONFIG_BUILD_KERNEL
/* Get exclusive access to the global variables. Global variables are
* used because the hash table and buffers are too large to allocate on
* the embedded stack. But the use of global variables has the downside

View File

@ -106,8 +106,7 @@
*/
#undef HAVE_NSH_COMMAND
#if (defined(CONFIG_SYSTEM_SYSTEM) || defined(CONFIG_SYSTEM_POPEN)) && \
defined(CONFIG_BUILD_LOADABLE)
#if defined(CONFIG_SYSTEM_SYSTEM) || defined(CONFIG_SYSTEM_POPEN)
# define HAVE_NSH_COMMAND 1
#endif
@ -285,7 +284,7 @@ int nsh_main(int argc, char *argv[])
* 2) As a single command processor. In this case, the single command is
* is provided in argv[1].
*
* NOTE: The latter mode is only available if CONFIG_BUILD_LOADABLE=y.
* NOTE: The latter mode is only available if CONFIG_SYSTEM_NSH=m.
* In that case, this main() function will be built as a process. The
* process will be started with a command by the implementations of the
* system() and popen() interfaces.

View File

@ -18,7 +18,7 @@ if SYSTEM_POPEN
config SYSTEM_POPEN_SHPATH
string "Path to shell command"
default "/bin/nsh"
depends on BUILD_LOADABLE
depends on SYSTEM_NSH=m
---help---
This is the full path to the program in a mounted file system that
implements the system() command. That is, a program that starts the

View File

@ -261,7 +261,7 @@ FILE *popen(FAR const char *command, FAR const char *mode)
argv[0] = (FAR char *)command;
argv[1] = NULL;
#ifdef CONFIG_BUILD_LOADABLE
#ifdef CONFIG_SYSTEM_POPEN_SHPATH
errcode = posix_spawn(&container->shell, CONFIG_SYSTEM_POPEN_SHPATH,
&file_actions, &attr, argv,
(FAR char * const *)NULL);

View File

@ -17,7 +17,7 @@ if SYSTEM_SYSTEM
config SYSTEM_SYSTEM_SHPATH
string "Path to shell command"
default "/bin/nsh"
depends on BUILD_LOADABLE
depends on SYSTEM_NSH=m
---help---
This is the full path to the program in a mounted file system that
implements the system() command. That is, a program that starts the

View File

@ -144,7 +144,7 @@ int system(FAR const char *cmd)
argv[0] = (FAR char *)cmd;
argv[1] = NULL;
#ifdef CONFIG_BUILD_LOADABLE
#ifdef CONFIG_SYSTEM_SYSTEM_SHPATH
errcode = posix_spawn(&pid, CONFIG_SYSTEM_SYSTEM_SHPATH, NULL, &attr,
argv, (FAR char * const *)NULL);
#else

View File

@ -79,4 +79,4 @@ system/usbmsc
it relies on internal OS interfaces that are not normally available to a
user-space program. As a result, this add-on cannot be used if a
NuttX is built as a protected, supervisor kernel (CONFIG_BUILD_PROTECTED
or CONFIG_BUILD_LOADABLE).
or CONFIG_BUILD_KERNEL).