I not two problems in handling of the return error values in PR #3858:
1. In KERNEL mode, the error return value of _SEM_WAIT() will be a negated errno value; in all other modes, it will be -1 (ERROR) with the errno variable set. This must be handled in the test of the returned value: Don't compare with -1; rather check if < 0
2. Also, conversion of the returned value to a negated errno value must be handled differently. This is handled by replacing -get_errno() with the macro _ERRVAL(ret)
This effects only error handling (it fixes it) and no other impacts are expected.
It's better to save one argument by returning pid directly.
This change also follow the convention of task_create.
BTW, it is reasonable to adjust the function prototype a
little bit from both implementation and consistency since
task_spawn is NuttX specific API.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
OS functions in syscall.csv are ordered alphabetically. However, two recently added functions are not in the correct location. This PR simply corrects that ordering.
The ordering of one entry was also corrected in libs/libc/libc.csv. Same issue.
This change is only cosmetic.
Verified only by CI
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>
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>
Drop to user-space in kernel/protected build with up_pthread_exit,
now all pthread_cleanup functions executed in user mode.
* A new syscall SYS_pthread_exit added
* A new tcb flag TCB_FLAG_CANCEL_DOING added
* up_pthread_exit implemented for riscv/arm arch
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Pros:
* Reduce code differences
* Smaller allocations for !CONFIG_ARCH_USE_MODULE_TEXT
Cons:
* Likely to use more memory for !CONFIG_ARCH_USE_MODULE_TEXT in total
Tested with:
* sim:module on macOS
* esp32-devkit:nsh + CONFIG_MODULE on qemu
* lm3s6965-ek:qemu-protected + CONFIG_EXAMPLES_SOTEST on qemu
arch: Allocate the space from the beginning in up_stack_frame
and modify the affected portion:
1.Correct the stack dump and check
2.Allocate tls_info_s by up_stack_frame too
3.Move the stack fork allocation from arch to sched
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
I've seen a module with 16 bytes .rodata alignment for xmm operations.
It was getting SEGV on sim/Linux because of the alignment issue.
The same module binary seems working fine after applying this patch.
Also, tested on sim/macOS and esp32 on qemu,
using a module with an artificially large alignment. (64 bytes)
Fix comment in libs/libc/tls/tls_getinfo.c: The TLS data must lie at the beginning of the allocated stack memory for both push-up and push-down stacks.
Ken Pettit has submitted the ICLA and we can migrate the licenses
to Apache.
Sebastien Lorquet has submitted the ICLA and we can migrate the licenses
to Apache.
Gregory Nutt has submitted the SGA and we can migrate the licenses
to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Or genromfs failed to generate the right romfs.img
Change-Id: Icbcc2e89da1ede644b994d33e70f1a48662c412b
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
Per the Linux man page, "By default, getopt() permutes the contents of argv as it scans, so that eventually all the nonoptions are at the end." This behavior, however, is not implemented in the NuttX getopt() logic.
The Linux man page requires that the getopt_long() and getopt_long_only() functions accept arguments to options in a form like:
--option=argument
This PR adds that missing functionality.
This change effects only getopt_long() and getopt_long_only()
Tested on a simulator NSH configuration with a modified version of the getopt() test in apps/testing/ostest.