Commit Graph

37728 Commits

Author SHA1 Message Date
Oleg Evseev
247bc10c26 drivers/can: fix wrong use of nxsem_getvalue
Bug caused increase of fifo->rx_sem with each received msg until finally after 32767 messages get into
DEBUGASSERT(sem->semcount<SEM_VALUE_MAX);
or stopping receiving anything at all without debug, while tx was working.

issue #1354
2020-07-05 14:38:55 -03:00
Gregory Nutt
2481b1bfd5 Do not ignore .asm files that are tracked. 2020-07-04 17:52:42 +01:00
Xiang Xiao
95aa3a11d1 arch/tms570: Remove the unused frac variable
and change the type of divb7 from float32_t to float

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-04 08:31:06 -07:00
Oleg Evseev
9761235408 libs/libc/semaphore/sem_getvalue: correct get_value descriptions
avoid possible confusion and follow the description POSIX.1-2017
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_getvalue.html
2020-07-04 00:36:02 -05:00
YAMAMOTO Takashi
749e871e15 sim: Fix 32-bit module build
Specify -mcmodel=large only on 64-bit case. (x86-64)
The code model is not available for 32-bit.

This fixes the following error:

    MODULECC: chardev.c
    cc1: error: code model 'large' not supported in the 32 bit mode
    Makefile:79: recipe for target 'chardev.o' failed
2020-07-03 23:48:48 -05:00
Xiang Xiao
60fe0a0f96 libc: Refine the inline handling
1.Remove CONFIG_HAVE_INLINE macro
2.Change the ANSI C function to normal function
3.Other simple non ANSI function to macro

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-04 11:10:29 +09:00
Xiang Xiao
993591dca1 arch/x86_64: Fix Warning: ignoring changed section attributes
chip/intel64_head.S: Assembler messages:
chip/intel64_head.S:281: Warning: ignoring changed section attributes for .text
chip/intel64_head.S:485: Warning: ignoring changed section attributes for .bss

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-03 10:20:39 +01:00
Gregory Nutt
deb3b13759 Udate TODO List
Remove an issues that has recently be resolved.
2020-07-02 20:58:37 +01:00
Xiang Xiao
b984534255 lib/math: Remove float32 and float64 definition
since they aren't defined by standard and never supported by other POSIX OS

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-02 10:53:34 -03:00
chao.an
9d7856192b make/POSTBUILD: make BIN directory configurable
enhance the post build can support configurable BIN directory

Change-Id: I64f286b6eb5ed77e91b67a27d815d62c345ac589
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-07-02 12:29:16 +01:00
chao.an
30d2b6c89c make/export: export post build script
post build processing is also necessary for import compilation

Change-Id: Ie27e25b84e2212e9c86358c30ca1a5b7c2adffc5
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-07-02 12:29:16 +01:00
chao.an
628a352973 make/export: use LDNAME instead of LDSCRIPT
use LDNAME instead of LDSCRIPT to avoid invalid native path
exported to the import build

Change-Id: I1ba3cfdbfca02447941dc32a292fe4d76c1ced04
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-07-02 12:29:16 +01:00
chao.an
d938e2cd46 CI check: fix nxstyle warning
nxstyle fixes to reduce the CI warnings

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-07-02 01:53:23 -05:00
chao.an
3fbdc213b7 syscall/prctl: fix PR_SET_NAME failure if without <pid> arg
add PR_SET_NAME_EXT/PR_GET_NAME_EXT extension to avoid semantic
conflicts, use extened version for pthread_setname_np/pthread_getname_np

Change-Id: I40404c737977a623130dcd37feb4061b5526e466
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-07-01 21:52:18 -05:00
Xiang Xiao
310b572116 board/olimex-stm32-p407: Remove CONFIG_SYSTEM_NSH_CXXINITIALIZE
forget in commit 49020acfdc

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-01 11:00:33 -06:00
Xiang Xiao
49020acfdc boards: Remove the unused CONFIG_xxx_CXXINITIALIZE=y
since cxx initialization is controlled by CONFIG_HAVE_CXXINITIALIZE now

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I39438dc3006d0a0b810052ecef50cd3c92f09d83
2020-07-01 10:41:37 -06:00
Xiang Xiao
8153e31753 sched: Call c++ global variables constructor inside nxtask_startup
to avoid the similar code spread around each application

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I8967d647eaf2ecae47f29f83e7fa322ef1b42a02
2020-07-01 07:55:33 -06:00
Xiang Xiao
e9c7df4769 sched: Rename task_startup to nxtask_startup
to follow the naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3594d12a65e8cacea99bc295d622628304c3f9f8
2020-07-01 07:55:33 -06:00
Jari van Ewijk
b84ce844c6 S32K additional style fixes 2020-07-01 13:45:38 +01:00
Jari van Ewijk
3db090a210 S32K - Expand FlexTimer header file and add PWM support 2020-07-01 13:45:38 +01:00
Xiang Xiao
651eefc8f7 fs: Rename link to symlink
since the current implementation is really a symoblic link not hard link

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I59d30d0a620b0b5714fe91bbe90d4405cf53d187
2020-07-01 11:58:12 +02:00
YAMAMOTO Takashi
028d0c0d15 sim: Disable stack protector for CMODULEFLAGS
On Linux, we (ab)use the host compiler to compile binaries for NuttX.
Explicitly disable features which might be default on the host while
not available on NuttX.

On macOS, this is not necessary because we use a cross compiler,
which has safer defaults for our purpose, to build binaries to
run on NuttX. But this doesn't hurt either.
2020-07-01 01:06:15 -05:00
YAMAMOTO Takashi
b8b2ac4f2c sim: Sync Linux CMODULEFLAGS with macOS
Namely, always use -mcmodel=large.

NuttX modules are loaded into the NuttX heap, which can be out of
range for 32-bit relocations generated with -mcmodel=small.

A possible alternative would be to use MAP_32BIT to allocate sim heap.
But I prefer this approach because it's very convenient for me to
be able to share modules between Linux and macOS sim.
2020-07-01 01:06:15 -05:00
chao.an
e7f2dc8173 net/sockopt: change the socket option style from Linux to BSD
Linux Programmer's Manual
...
IP(7)
...
NOTES
...
    Using the SOL_IP socket options level isn't portable;
    BSD-based stacks use the IPPROTO_IP level.

Change-Id: I63ea5ec7714481b5201608ec4449e522e2be3da2
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-30 18:49:58 -03:00
Xiang Xiao
a102922e12 libc: Implement realpath
specified here:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ie52dcd1c5c5faa4b033901eedd7182bbb9473f7a
2020-06-30 13:09:58 -06:00
Xiang Xiao
0b891d60f9 vfs: Define symlink as link
specified here:
https://pubs.opengroup.org/onlinepubs/009695399/functions/symlink.html
yes, symlink is different from link:
1.symlink create the soft(symbolic) link
2.link create the hard link
but it is suitable to make them same now since vfs doesn't support the
hard link and the soft link in file system level yet.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3b6e311cc1c826542165c9d93cbe5e078f113684
2020-06-30 13:09:58 -06:00
Xiang Xiao
b598ab43d7 fs: Implement lstat function
specified here:
https://pubs.opengroup.org/onlinepubs/009695399/functions/lstat.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Iefc23a02d425ff84fa4027aea7da1181b01eced7
2020-06-30 13:09:58 -06:00
Peter van der Perk
b938348cdb S32K1XX EEEPROM indentation fix 2020-06-30 12:46:50 -06:00
Peter van der Perk
4a40a7c3d7 S32K148EVB netdev lateinit to support Enet & CAN at the same time 2020-06-30 12:46:50 -06:00
Peter van der Perk
eca1011b1e Expose xxx_caninitialize() correctly so it's usable in latedev init when there are multiple net devices 2020-06-30 12:46:50 -06:00
Xiang Xiao
14ecb8723a sched: Change tcb_s to task_tcb_s for nxtask_[un]init
since these functions can just work with task not thread

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-06-30 10:54:42 -06:00
Jari van Ewijk
1306cbc16e S32K additional style fixes 2020-06-30 15:46:15 +01:00
Jari van Ewijk
86c151edf1 S32K Small Fixes:
- Typos / wrong names in s32k14x_irq.h, s32k1xx_memorymap.h and s32k1xx_pcc.h
- Wrong base address for port input disable register in s32k1xx_pin.c
- up_* still had to be changed to arm_* in some places
2020-06-30 15:46:15 +01:00
chao.an
b8e5755568 make/version: correct the version generation
incorrect version generation by commit 3ec12a84c2

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-30 14:51:18 +02:00
ligd
0fe2884713 libs/libc/machine/risc-v: add rv32 support
Change-Id: I96a02aacea4e1d034f986f2937fe496da1f486ba
Signed-off-by: ligd <liguiding@fishsemi.com>
2020-06-30 09:31:21 -03:00
ligd
36a0978952 arch/risc-v/src/rv32im: update & complete risc-v rv32im arch
1. add schedulesigaction.c
2. add SYS_save_context handling
3. Skip ECALL instruction when up_swint()

Change-Id: Id52c6dd9ee1052441957b73463c00d3fd26555c5
Signed-off-by: ligd <liguiding@fishsemi.com>
2020-06-30 09:31:21 -03:00
chao.an
b896da25c7 make/export: copy incdir.c for export build
export build break by commit 5555070fc3

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-30 10:28:56 +02:00
Xiang Xiao
a81a260490 vfs: Add chmod/fchmod/utimes function prototype
but skip the implemenation because VFS layer doesn't support the time/mode change yet:
https://pubs.opengroup.org/onlinepubs/009695399/functions/chmod.html
https://pubs.opengroup.org/onlinepubs/009696699/functions/fchmod.html
https://pubs.opengroup.org/onlinepubs/009695399/functions/utimes.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ie4a2d3bb4eb5f5aaa0aeb794a4012b096aa94e4f
2020-06-30 09:20:33 +01:00
chao.an
b9ad4a000e binfmt/exec: allocate stack from internal
Implement of nxtask_init() support stack allocation from internal

Change-Id: I4885c5b901d90e57eb9d15d8bc1af32761584d19
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-30 08:26:38 +02:00
chao.an
2fc02ec4a4 sched/task_init: change the stack pointer type to (void *)
change the stack pointer type from (uint32_t *) to (void *)

Change-Id: I90bb7d6a9cb0184c133578a1a2ae9a19c233ad30
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-30 08:26:38 +02:00
chao.an
62b777b1cd sched/task: unify task initialization
1. nxthread_create() Reduce code duplication
2. nxtask_init(): support stack allocation from internal

Change-Id: Ib495a6efb032d9caa9b03113a0763b71486d14ea
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-30 08:26:38 +02:00
liuhaitao
ac1641dc1b stm32/nucleo-f412zg: refresh nsh defconfig
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-06-29 23:17:03 -05:00
liuhaitao
708f68a3d2 stm32/nucleo-f412zg: update nucleo-f412zg files to fix nightly build break
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-06-29 23:17:03 -05:00
Xiang Xiao
d8376efdc1 nxsched_release_tcb: Should release stack in kernel build too
otherwise the memory can't be reused util the process exit

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-06-29 17:07:50 -06:00
Brennan Ashton
e87617f9fa nxstyle: fixup style issues in mm_realloc.c
Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-06-29 14:56:26 -07:00
Brennan Ashton
fcd6e1c7eb mm: Do not memcopy more than oldsize when realloc
When realloc up from a mem area to a larger one where a new node
is needed. The the larger memory region is copied from the source
this can both leak data as well as cause memory faults accesssing
invalid data.

This was first reported by Kwonsk

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-06-29 14:56:26 -07:00
chao.an
b296adc3bb socket/SOL: sync the SOL index with linux
Change-Id: I32b9eb7cc3bc1428f0ff7bf5e60d7fff52621db2
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-29 11:34:43 -05:00
Jacob Dahl
b12b3072e8 Added support for STM32F412xx. Tested with the NUCLEO-F412ZG dev board as well as a custom board using the STM32F412CE. 2020-06-29 17:44:35 +02:00
Xiang Xiao
b71c491f00 libc/math: Fix warning: dereferencing type-punned pointer will break strict-aliasing rules
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I15aa5d664c20ea7bb95ba60e056134d2ff933db9
2020-06-29 16:25:22 +01:00
Xiang Xiao
43b613877d libc/stdio: Remove sys/types.h inclusion for printf/scanf
since double_t move from sys/types.h to math.h now and remove
math.h inclusion too because lib_dtoa_engine.h already include

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3497a73908301d999cf1cfc4a66552a7ca4868c6
2020-06-29 16:25:22 +01:00