Commit Graph

50189 Commits

Author SHA1 Message Date
zhangyuan21
8f39ba6ae4 arch: update g_running_tasks when context switch occurred
When supporting high-priority interrupts, updating the
g_running_tasks within a high-priority interrupt may be
cause problems. The g_running_tasks should only be updated
when it is determined that a task context switch has occurred.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-08-01 09:35:18 -07:00
simbit18
34c56139aa drivers/sensors/bmi270.c: fix define BMI270_TEMPERATURE
fix BMI160_TEMPERATURE_0 ->BMI270_TEMPERATURE_0
fix BMI270_TEMPERATURE_1 ->BMI270_TEMPERATURE_1
2023-08-01 18:06:59 +02:00
lpxiao
3341a6d2a9 Optimize stm32 RTC accuracy 2023-08-01 18:02:09 +02:00
guanyi
55a727b1ce ltp: sigprocmask fix
1. change signal/sig_procmask.c and pthread/pthread_sigmask.c together
2. clear signals unconditionally

Signed-off-by: guanyi <guanyi@xiaomi.com>
2023-07-31 22:29:31 -07:00
dongjiuzhu1
f8ce0cd4ca fs/pseudofile: config pseudofile feature
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-31 22:22:58 -07:00
dongjiuzhu1
8336ee78b8 vfs/fs_pseudofile: fix coverity issue
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-31 22:22:58 -07:00
dongjiuzhu1
0f6d0eac52 fs/pesudofile: support pseudo-file operation
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-31 22:22:58 -07:00
dongjiuzhu1
917728bad9 driver/ftl: pass the number of eraseblock for ftl_get_cblock
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-31 22:22:25 -07:00
dongjiuzhu1
80004ef07d fs/nfs: fix coding style issue
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-31 21:41:30 -07:00
Petro Karashchenko
eab86b72c4 tools/ci/testrun: increase ostest timeout on CI
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-31 18:58:48 -07:00
Petro Karashchenko
effb0a1cad drivers: restore C89 compatibility by avoiding binary constants
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-31 18:56:40 -07:00
Petro Karashchenko
f3b5465969 drivers: remove redundant parentheses
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-31 18:56:40 -07:00
Petro Karashchenko
f00c6d3047 arch/arm: fix declaration of extern types
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-31 18:56:40 -07:00
Petro Karashchenko
6621dc016b net/udp: remove FAR from non-pointer variables
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-31 18:56:40 -07:00
yangyalei
f40eee50d6 pwd: Add initial implementation of getpwent
fix ltp sigqueue testcase crash in getpwent:
nsh> ltp_sigqueue_3_1
core dumped

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2023-07-31 07:50:10 -07:00
yangyalei
4ecff53e2c sigaltstack: Add initial implementation of sigaltstack
fix ltp testcase compile error:
ltp/testcases/open_posix_testsuite/conformance/definitions/signal_h/31-1-buildonly.c:16:13: \
error: ‘sigaltstack’ undeclared (first use in this function)
   16 |  dummyvar = sigaltstack;
      |             ^~~~~~~~~~~

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2023-07-31 07:50:10 -07:00
yangyalei
30367fd4cd sched: inherit parent priority by default, except idle
Signed-off-by: yangyalei <yangyalei@xiaomi.com>

asdfas

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2023-07-31 07:50:10 -07:00
yangyalei
3721af647a Add _POSIX_THREAD_PRIORITY_SCHEDULING define
fix ltp_pthread_rwlock_rdlock_2_2 testcase error:
nsh> ltp_pthread_rwlock_rdlock_2_2
Posix Thread Execution Scheduling not supported

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2023-07-31 07:50:10 -07:00
yangyalei
700cc5ab90 single: add SS_ONSTACK and SS_DISABLE define
fix ltp_sigaltstack_6_1 testcase comile error:
iltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/6-1.c:41:28: \
error: ‘SS_ONSTACK’ undeclared (first use in this function); did you mean ‘SA_ONSTACK’?
ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/8-1.c:41:28: \
error: ‘SS_DISABLE’ undeclared (first use in this function

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2023-07-31 07:50:10 -07:00
yangyalei
ed705f9cb3 sysconf: add _SC_THREAD_THREADS_MAX response
fix ltp_pthread_create_s_c1 test get wrong PTHREAD_THREADS_MAX.

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2023-07-31 07:50:10 -07:00
yangyalei
c33e6528b1 getrlimit: add RLIMIT_MEMLOCK define
add RLIMIT_MEMLOCK define, enable compile mmap/18-1.c.
ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/18-1.c:95:16: \
error: ‘RLIMIT_MEMLOCK’ undeclared (first use in this function); did you mean ‘RLIMIT_STACK’?

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2023-07-31 07:50:10 -07:00
yangyalei
b2a9c6a3e5 sched: inherit parent priority by default
fix ltp pthread_cond_wait_1 test question, child should inherit parent
priority by default.
nsh> ltp_pthread_cond_wait_1
Error: the policy or priority not correct

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2023-07-31 07:50:10 -07:00
yangyalei
fde8affe71 singal: add stack_t define
stack_t used by sigaltstack, make it compile sucess in sim.

Signed-off-by: yangyalei <yangyalei@xiaomi.com>

ltp: fix compile errors

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2023-07-31 07:50:10 -07:00
yangyalei
9a60d7bb49 signal: add SIGWINCH define
SIGWINCH used in ltp sigaction/16-1.c testcase.
ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16-1.c:79:3:
error: ‘SIGWINCH’ undeclared here (not in a function); did you mean ‘SIGINT’?
   79 |  {SIGWINCH, "SIGWINCH", 0},
      |   ^~~~~~~~
      |   SIGINT

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2023-07-31 07:50:10 -07:00
yangyalei
a551be4ee2 malloc: set errno to ENOMEM when malloc fail
fix LTP case ltp_threads_pthread_cond_init_s_c error:
"Test ltp_threads_pthread_cond_init_s_c unresolved: got 38
(Invalid system call number) on line 236 (Memory not full)"

Signed-off-by: yangyalei <yangyalei@xiaomi.com>

ltp: fix review questions

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2023-07-31 07:50:10 -07:00
yangyalei
f2844a2e3c vfs: return OK when fsync dir
Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2023-07-31 07:50:10 -07:00
Ville Juven
c126ee8468 sched/assert.c: Fix style check error 2023-07-31 07:48:53 -07:00
Ville Juven
61460efe3c riscv/qemu-rv: Add FPU support back to qemu-rv
The FPU restore issue does not show itself any longer, so FPU support
can be re-enabled.
2023-07-31 07:48:53 -07:00
Ville Juven
d0fbf9883d riscv/lazyfpu: Add option to disable lazy FPU
Adds option to use the old implementation where FPU is stored into
the process stack.
2023-07-31 07:48:53 -07:00
Ville Juven
83105cfa49 sched/assert: Store table for all registers instead of buffer
This way the registers can be read easily
2023-07-31 07:48:53 -07:00
Ville Juven
4a468b8d3b riscv/saveusercontext: Fix FPU state save 2023-07-31 07:48:53 -07:00
Ville Juven
0ea9debfce riscv/riscv_fpu: Clear the full FPU status/control register on boot
Instead of clearing the fields individually, just wipe the whole register.
This can be done because flags and rm are just parts of the fcsr.

31             8        5           0
+--------------+--------+-----------+
|              |        |           |
|   RESERVED   |  FRM   |  FSTATUS  |
|              |        |           |
+--------------+--------+-----------+
                FCSR
2023-07-31 07:48:53 -07:00
Ville Juven
b409d72e9d riscv/fpu: Restore correct lazy-FPU functionality
- Save the FPU registers into the tcb so they don't get lost if the stack
  frame for xcp.regs moves (as it does)
- Handle interger and FPU register save/load separately
- Integer registers are saved/loaded always, like before
- FPU registers are only saved during a context switch:
  - Save ONLY if FPU is dirty
  - Restore always if FPU has been used (not in FSTATE_OFF, FSTATE_INIT)
- Remove all lazy-FPU related logic from the macros, it is not needed
2023-07-31 07:48:53 -07:00
Ville Juven
3b5c0c885f riscv/swint: Give the full tcb to the context switch routine
Why? The tcb can contain info that is needed by the context switch
routine. One example is lazy-FPU handling; the integer registers can
be stored into the stack, because they are always stored & restored.

Lazy-FPU however needs a non-volatile location to store the FPU registers
as the save feature will skip saving a clean FPU, but the restore must
always restore the FPU registers if the thread uses FPU.
2023-07-31 07:48:53 -07:00
simbit18
8f744592d5 Fix nuttx coding style
Fix Comments
2023-07-31 10:54:53 -03:00
wangbowen6
b0ab41beee memdump: support dump the leak memory (malloced but task exit)
1. command "memdump leak" can dump the leacked memory node;
2. fix the leak memory stat bug in memory manager;

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2023-07-31 05:48:33 -07:00
Michal Lenc
1fb65e18d2 w25.c: enable support for W25QxxxJV NOR flash memories
W25QxxxJV NOR memories are backward compatible with older Winbond´s
generations and thus can also be supported here. This essentially brings
the support for generic SPI to W25QxxxJV memories as w25qxxxjv.c file only
supports QSPI communication.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-07-31 05:46:57 -07:00
wangbowen6
2dedaa449b mm: use shced_backtrace and skip the first numbers in mm backatrace
beacause the first numbers backtrace in mm node is same, skip them to
show more useful backtrace.

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2023-07-31 05:46:37 -07:00
Bowen Wang
c9e3a0669f sched_backtrace: define sched_dumpstack when not enable SCHED_BACKTRACE
Before directly use sched_backtrace() with SCHED_BACKTRACE disable will
lead compile error, this commit avoid this problem by define
sched_backtrace to 0 when CONFIG_SCHED_BACKTRACE not enable.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2023-07-31 05:46:37 -07:00
Bowen Wang
28cb5e7984 arm64: add kasan support for arm64
Add kasan compiler option in arm64 Toolchain.defs

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2023-07-31 05:45:46 -07:00
Bowen Wang
835a2a8801 watchdog: add CONFIG_WATCHDOG_PANIC_NOTIFIER for panic notifier
wdog_notifier() will be called in _assert to keep the crash scene
as mush as possible, which is useful for debug.

But once disable the watchdog, the hardware watchdog can not reboot
the system too. If a crash happened in the _assert (e.g. the tcb sp
has been corrupted, system will crash again in tack stack dump),
system will crashing forever and can not reboot.

So add a config to disable this feature by default and can be enable
if anyone need it.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2023-07-31 14:45:18 +02:00
zhangyuan21
f9cab5b9dc arch/arm64: add ARM64_DCACHE_DISABLE and ARM64_ICACHE_DISABLE config
Enable dcache and icache when ARM64_DCACHE_DISABLE and ARM64_ICACHE_DISABLE
disabled at __start.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-07-31 05:33:23 -07:00
Bowen Wang
d24622888f arm64_backtrace: use running_task if arch_get_current_tcb return NULL
In the init phase of the OS, arch_get_current_tcb return NULL. Enable
the memory backatrace default will crash in backtrace function.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2023-07-31 04:52:49 -07:00
dongjiuzhu1
e4c015f0aa fs/nfs: support seek, fsync operation
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-31 03:46:13 -07:00
SPRESENSE
4b966aa1e7 drivers/video: Fix returned errno in error cases
When the value that is out of range is specified in ioctl(VIDIOC_S_CTRL) and
ioctl(VIDIOC_S_EXT_CTRLS), returned value should be not EINVAL but ERANGE.
2023-07-31 03:28:54 -07:00
SPRESENSE
f04dce1314 boards: cxd56xx: Fix issue that GPO is not iniitalized by watchdog
Fix an issue that GPO pins is not iniitalized by watchdog reboot.
If the watchdog expires during LTE is in use, it causes the LTE
to remain powered on and fails to launch after reboot.
2023-07-31 03:28:43 -07:00
SPRESENSE
2d2c3eb2cf drivers/video: Initialize flags member of query control APIs
video driver does not support flags member of ioctl(VIDIOC_QUERYCTRL)
and ioctl(VIDIOC_QUERY_EXT_CTRL).
But, ioctl returns with the flags member that has the garbage value.
Add initialization of flags member to avoid return of the garbage value.
2023-07-31 02:56:10 -07:00
zhangyuan21
e50d1211df task_spawnparms: out of loop when ret less than 0
The nxspawn_dup2 function will return a value greater than 0,
so the loop should only exit if ret is less than 0.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-07-31 00:47:42 -07:00
zhangyuan21
c6f32f4363 arm-m: Check the dcache status before enabling dcache
If the cache is already enabled before NuttX starts up,
enabling the cache in NuttX will cause the cache to be
re-invalidated, then resulting in data that is already
in the cache being flushed out.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-07-31 08:49:21 +02:00
Xiang Xiao
427e574bd1 fs/unionfs: Remove unionfs_mount function
since the same function can be achieved by mount:
mount(NULL, "/mnt/unionfs", "unionfs", 0,
      "fspath1=/mnt/path1,prefix1=prefix1,"
      "fspath2=/mnt/path2,prefix2=prefix2");

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-30 18:51:26 -03:00