Commit Graph

45212 Commits

Author SHA1 Message Date
Petro Karashchenko
1b4d8b3734 sched: remove DEBUGASSERT from nx_waitpid
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-04-22 15:06:26 -03:00
Xiang Xiao
5a565e753c pm: Move pm_initialize call from driver_initialize to xxx_pminitialize
since it's too late with the below commit:
ommit a594a5d7a8
Author: chao.an <anchao@xiaomi.com>
Date:   Mon Apr 11 19:44:26 2022 +0800

    sched/init: drivers_initialize() should be late than up_initialize()

    up_initialize
    |
     ->up_serialinit
       |
        ->uart_register  /* ("/dev/console", &CONSOLE_DEV); */

    drivers_initialize
    |
     ->syslog_console_init
       |
        ->register_driver /* ("/dev/console", &g_consoleops, 0666, NULL); */

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-22 14:36:27 +03:00
Ville Juven
cf90e3f66b syscall: Fix prototype of exec() to syscall.csv 2022-04-22 14:34:42 +03:00
Xiang Xiao
69b5799b74 libc: Fix typo error in execle
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-22 12:23:09 +03:00
Xiang Xiao
49eb2bd415 libc: Implement execvp, execlp and execvpe as macro
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-22 10:40:31 +03:00
Xiang Xiao
55b5561fdb sched/task: Implement execle and execve
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-22 10:40:31 +03:00
Masayuki Ishikawa
04f81ecddb arch: risc-v: Do not enable FPU for K210 with QEMU
Summary:
- I noticed that maix-bit:smp does not work with QEMU.
- Actually, QEMU supports sifive_u (not K210) but it works
  if FPU is disabled.
- This commit fixes this issue.

Impact:
- K210 with QEMU only

Testing:
- Tested with qemu-5.2

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-04-22 14:52:04 +08:00
Huang Qi
06c7a3ca59 arch/risc-v/riscv_misaligned: Implement float load/store support
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-04-22 12:23:10 +08:00
Xiang Xiao
2f32c8dcf2 environ: Don't expose get_environ_ptr in csdlib
since it isn't defined in c/c++ standard

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-21 22:55:47 +03:00
Xiang Xiao
76803f4a07 sched/environ: Replace get_environ_ptr with environ
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-21 22:55:47 +03:00
Xiang Xiao
9794068a9c sched/environ: Remove the unneeded cast in env_dup
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-21 22:55:47 +03:00
Xiang Xiao
ce49c80976 sched/task: Correct the comment about environment variable
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-21 22:55:47 +03:00
Huang Qi
be95e76910 arch/risc-v: Enable FPU for K210
K210 support rv64gc ISA, now we enable F/D extension for it.

Note: QEMU for K210 don't support FPU now.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-04-21 21:47:29 +03:00
chao.an
1c8e12406e compile/opt: add config DEBUG_LINK_MAP
Selecting this option will pass "-Map=$(TOPDIR)$(DELIM)nuttx.map" to ld
when linking NuttX ELF. That file can be useful for verifying
and debugging magic section games, and for seeing which
pieces of code get eliminated with DEBUG_OPT_UNUSED_SECTIONS.

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-22 01:37:23 +08:00
chao.an
64d7326ed5 compile/opt: add config DEBUG_OPT_UNUSED_SECTIONS
Enable this option to optimization the unused input sections with the
linker by compiling with " -ffunction-sections -fdata-sections ", and
linking with " --gc-sections ".

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-22 01:37:23 +08:00
Abdelatif Guettouche
56ecd44f63 arch/xtensa: Color the other CPUs task when they are created.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2022-04-22 01:12:55 +08:00
wangbowen6
913c7148e5 assert: static_assert is not support in c standard C89,C99.
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-04-21 23:11:21 +08:00
Ville Juven
1a7d81c942 binfmt_execmodule: If incoming envp is NULL get parent envp
This keeps backwards compatibility with apps that do not provide
envp. The old implementation passes NULL always and this change fixes
any regression caused by it.
2022-04-21 18:38:37 +08:00
Ville Juven
d6ef4849a9 syscall: Add call gate for get_environ_ptr
Now that the environment strings are stored as an array of strings,
they can be passed from the application via char **environ, which
is really defined as a function call to get_environ_ptr().

This works as is for flat build, but protected mode and kernel mode
require a call gate, which is added here.
2022-04-21 18:38:37 +08:00
Ville Juven
4c1b66246d env_dup: Fix copying of env between address environments
If address environments are in use, it is not possible to simply
memcpy from from one process to another. The current implementation
of env_dup does precisely this and thus, it fails at once when it is
attempted between two user processes.

The solution is to use the kernel's heap as an intermediate buffer.
This is a simple, effective and common way to do a fork().

Obviously this is not needed for kernel processes.
2022-04-21 18:38:37 +08:00
Ville Juven
6b1ee4c2e2 binfmt_execmodule: add errout_with_args exit point
Ensures that when errout_xx is taken, args are freed
2022-04-21 18:38:37 +08:00
Xiang Xiao
1320e5add4 arch/arm: Move the duplicated assembly code to common folder
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-21 12:56:34 +03:00
Xiang Xiao
ebf1093cff arch/arm: Switch the context of save and restore from assembler to c
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-21 12:56:34 +03:00
Jiuzhu Dong
de1c184e6c boards/sim: support rc.sysinit
Follow: http://glennastory.net/boot/sysinit.html

This is first script that init runs is rc.sysinit. This
script does serval initialization tasks about basic service.

The boot sequence currently provided to the board level is:
board_earlyinitialize->
    board_lateinitialize(Peripherals driver, core driver, ...)->
	run rcS script(mount fs, run service) ->
	    board_appinitialize->

After this patch:
The boot sequence currently provided to the board level is:
board_earlyinitialize->
    board_lateinitialize(core driver,...)->
	run rc.sysinit script(mount fs, run core service) ->
	    board_appinitialize(Peripherals driver)->
		run rcS script(run other service)->

So, Peripheral drivers can do more with the file system and
core services.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-04-21 12:54:53 +03:00
Xiang Xiao
c29a3b7bd8 pipe: Increase buffer size by one byte to ompensate the full indicator
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-21 12:45:30 +03:00
Huang Qi
0332b78f99 arch/risc-v: Don't clear reserved bits in fcsr in riscv_fpuconfig
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-04-21 15:26:05 +08:00
chao.an
875c5dac75 arm/armv[7|8]m: compare of hardware fp registers should skip REG_FP_RESERVED
Fix fpu test break

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-21 14:55:54 +09:00
Abdelatif Guettouche
64e4c9ca02 arch/xtensa: Move xtensa_save_context to up_saveusercontext for
consistency with other archs.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2022-04-21 01:59:34 +08:00
Abdelatif Guettouche
0831539af1 arch.h: Fix up_exit prototype.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2022-04-21 01:59:34 +08:00
Abdelatif Guettouche
6db910a1aa arch/xtensa: Use syscall interface for xtensa_save/restore_context.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2022-04-21 01:59:34 +08:00
chao.an
0315283c21 arch/clang: add support for Clang LTO
add support of Clang's Link Time Optimization (LTO) on NuttX build system

Reference:
https://gcc.gnu.org/onlinedocs/gccint/LTO-Overview.html
https://llvm.org/docs/LinkTimeOptimization.html

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-21 01:21:54 +08:00
chao.an
67fbfda974 arch/armv6-m: add support of LLVM Clang
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-21 01:21:54 +08:00
Huang Qi
48b81bda09 arch/risc-v: Change riscv_savefpu/riscv_loadfpu to macro
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-04-20 16:08:17 +03:00
Alin Jerpelea
148c4903e3 LICENSE: document missing libc files
add missing files to the LICENSE file.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-20 21:05:45 +08:00
Alin Jerpelea
d32427b56f LICENSE: document missing wireless files
add missing files to the LICENSE file.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-20 21:05:45 +08:00
Alin Jerpelea
844a0db1a1 LICENSE: document missing igmp files
add missing files to the LICENSE file.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-20 21:05:45 +08:00
Alin Jerpelea
19c4951302 LICENSE: document missing sixlowpan files
add missing files to the LICENSE file.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-20 21:05:45 +08:00
Alin Jerpelea
764376e946 include: wireless: bluetooth: migrate the license to Apache
Gregory Nutt is the copyright holder for those files and he has submitted the
SGA as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-20 21:05:45 +08:00
Alin Jerpelea
e00652c13f LICENSE: document missing bluetooth files
add missing files to the LICENSE file.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-20 21:05:45 +08:00
Alin Jerpelea
929f82c44b LICENSE: document missing uIP files
add missing files to the LICENSE file.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-20 21:05:45 +08:00
Alin Jerpelea
67c0623b6f include: leds: ncp5623c: migrate the license to Apache
Gregory Nutt is the copyright holder for those files and he has submitted the
SGA as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-20 21:05:45 +08:00
Alin Jerpelea
7c7f5f24da include: himem: Add Apache license to files
In the initial contribution those files were missing the license

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-20 21:05:45 +08:00
Alin Jerpelea
e2c1ba00ea LICENSE: document missing nfs files
add missing files to the LICENSE file.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-20 21:05:45 +08:00
Alin Jerpelea
6f356f6887 LICENSE: document missing bcm43xxx files
add missing files to the LICENSE file.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-20 21:05:45 +08:00
Alin Jerpelea
2a44c99837 drivers: sensors: mlx90614: migrate the license to Apache
Gregory Nutt is the copyright holder for those files and he has submitted the
SGA as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-20 21:05:45 +08:00
Alin Jerpelea
bf087fee5d drivers: mtd: gd5f: migrate the license to Apache
Xiaomi has submitted the SGA
as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-20 21:05:45 +08:00
Alin Jerpelea
e84cf86ecb LICENSE: document missing mtd files
add missing files to the LICENSE file.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-20 21:05:45 +08:00
Alin Jerpelea
2e9d6081ce drivers: leds: ncp5623c: migrate the license to Apache
Gregory Nutt is the copyright holder for those files and he has submitted the
SGA as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-20 21:05:45 +08:00
Alin Jerpelea
69d67c324d boards: sim: Add Apache license to files
In the initial contribution those files were missing the license

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-20 21:05:45 +08:00
Alin Jerpelea
fbaa259298 arch: arm: stm32: Add Apache license to files
In the initial contribution those files were missing the license

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-20 21:05:45 +08:00