Commit Graph

37756 Commits

Author SHA1 Message Date
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
Xiang Xiao d0dc72c2fb boards/x86_64/intel64: enable CONFIG_LIBM=y
to fix the math.h can't be found on macOS

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-06-29 16:25:22 +01:00
Xiang Xiao 23e0134954 mksyscall: Fix warning "variable 'i' is used uninitialized"
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-06-29 14:12:58 +01:00
Xiang Xiao d17b963bca libc: Move double_t typedef from sys/types.h to math.h
specified here:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/math.h.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3497a73908301d999cf1cfc4a66552a7ca4868c6
2020-06-29 13:37:41 +01:00
Alin Jerpelea 294fdd80a9 tools: cxd56: nxstyle fixes
nxstyle fixes to pass the CI checks

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2020-06-29 13:36:18 +01:00
Alin Jerpelea 5de436b872 tools: cxd56: mkspk: fix out of tree MAC build
The local copy of elf headers is needed for the MAC systems which miss the ELF headers.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2020-06-29 13:36:18 +01:00
Xiang Xiao 771f532dcb cxx: Remove CONFIG_NET guard from [get|set]hostname
since these two functions is always implemented now

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Iae46fa4d38b680a5d1ce5c314ffcb71af4a3dc95
2020-06-29 09:06:36 -03:00
Claudio Micheli 10f93b9d9b stm32l4: extend CAN ioctrl with NART/ABOM. Add RTR to CAN header
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2020-06-29 09:05:44 -03:00
Claudio Micheli 94e87bb6e8 stm32: extend CAN ioctrl with NART/ABOM. Add RTR to CAN header
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2020-06-29 09:05:44 -03:00
Claudio Micheli 7a346bee26 stm32f7: Add the option to include RTR in CAN header
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2020-06-29 09:05:44 -03:00
Beat Küng f6039bbfa7 stm32f7: add CANIOC_SET_NART and CANIOC_SET_ABOM ioctl's to can driver 2020-06-29 09:05:44 -03:00
Xiang Xiao 676a2b77f8 stdio.h: Implement fseeko and ftello function
specified here:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/fseek.html
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ftell.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-06-29 14:26:19 +09:00
Xiang Xiao 095e492cb3 libc: Replace nuttx/lib/math.h with math.h
Because user may replace math library with other implementation

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Idb5f2a8b2a70302c8561553b3bcbc40529b5257f
2020-06-29 06:32:10 +02:00
Xiang Xiao b2f3a4b5f9 tools/nxstyle: Support the white list
and add _Exit to the white list

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-06-28 21:07:57 +01:00
Matias Nitsche 861f80e853 stm32l4 RCC: configure flash wait states early, otherwise execution is corrupted when clock is increased before that 2020-06-28 13:25:05 -03:00
chao.an fd3be9eb37 make/export: support export extra library
Change-Id: Iaab5dc8fd61b55888dad59d9b1d8380d7bd44a58
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-27 22:45:41 +01:00
chao.an 41f434015b make/export: do not extract object from librarys
To avoid overriding of objects with duplicate file name

Change-Id: I83c964d161d23942cd3fc29eb738da44775cfc10
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-27 22:45:41 +01:00
chao.an e82a9e0f48 make/export: copy mkdeps.c for export build
Change-Id: Ic1aa04d5d4dd2332cf4a13ec51c76cdb7d90736c
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-27 22:45:41 +01:00
chao.an 98f0b0afb5 build/export: correct the export path
Change-Id: Ia2e19f30d32154c3329f46c5d8362fafd6b7e274
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-27 22:45:41 +01:00
Xiang Xiao 977f04a2b1 libc: sysconf support _SC_NPROCESSORS_CONF/_SC_NPROCESSORS_ONLN
specified here:
https://www.man7.org/linux/man-pages/man3/sysconf.3.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I87fba8476221797e59c69c1953974bebc8d0d7b3
2020-06-27 22:43:13 +01:00
Matias Nitsche c26521c38f stm32l4 dfumode: move initialization point of bootloader jump instruction to correct place 2020-06-26 09:59:40 -03:00
Matias Nitsche d1c538b65c stm32l4: dfumode style fixes 2020-06-26 09:59:40 -03:00
Matias Nitsche b4bea95a6a stm32l4: add support for booting into DFU mode 2020-06-26 09:59:40 -03:00