Commit Graph

6575 Commits

Author SHA1 Message Date
ligd
7a0ef1d0ca secure: fix compile failed when no CONFIG_ARCH_HAVE_TRUSTZONE
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-05 12:40:34 -07:00
anjiahao
3a808bab19 support stm32f429i-disco run open flash loader
We can use the driver in nuttx to download
files with debugger

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-05 12:40:02 -07:00
cuiziwei
7c8bb8c293 nuttx/tls: Remove the max key limiatation in task_tls_alloc and pthread_key_create
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2023-08-05 06:33:49 -07:00
yinshengkai
a6fcb0a5a9 fs: add pipe type support to inode
Both the device and the pipe used the FSNODEFLAG_TYPE_DRIVER type before,
and now add an independent pipe type

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-05 06:32:50 -07:00
Xiang Xiao
1dfcdaad84 noteram: Remove the unnessary inclusion and declaration from header file
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-04 19:24:08 -03:00
yinshengkai
08c4ac133b sched/cpuload: add SCHED_CPULOAD_OSCLK option
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-04 10:58:54 -07:00
yinshengkai
72de29422a drivers/noteram: noteram support multiple instances
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-04 06:48:48 -07:00
yinshengkai
3ab4d4a113 drivers/noteram: reduce global variable references
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-04 06:48:48 -07:00
Michal Lenc
a5fb83a5d3 ioexpander: define IOEXPANDER_OPTION_NONGENERIC option
This introduces non-generic option interface for IO expanders.
Some IO expanders have more advance options for pins and communication.
This is used to pass driver dependend structure to expander driver.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-08-04 05:54:24 -07:00
likun17
50fe301e8f fix SIM sensor rpmsg runtime error by asan report.
Signed-off-by: likun17 <likun17@xiaomi.com>
2023-08-04 04:20:45 -07:00
zhangyuan21
602d5974c8 usbdev: move usbdev_req function to common code
Move usbdev_req function to common code, Reduce duplicated code.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-08-03 22:46:25 -07:00
yangsen5
d8ca744052 drivers/video: video driver supports NV12
Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2023-08-03 22:37:53 -07:00
makejian
775d9de30a crypto: export MD5/SHA1/SHA256/SHA512 via /dev/crypto
refer to commit 649dc2d985
(1) import hash method
(2) separate the update and finish processes

Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-03 22:37:30 -07:00
rongyichang
9e4a9fe32b drivers/fb: add fboverlay pandisplay & display area ioctl
1. support doublebuffer swtich for overlay layer
2. Add display area ioctl to scale the active area of the overlay layer
   to a specific region on the LCD through hardware.

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-08-03 10:57:14 -07:00
ligd
d313248a5b queue: add dq_inqueue & sq_inqueue support
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-03 10:16:41 -07:00
Michal Lenc
0f6a5e50c4 ioexpander: add option to register GPIO by name for IOexpander
Function gpio_lower_half_byname() was added to support registration of
GPIO pin by name as supported for IOexpander. Some of the code is wrapped
in new static function gpio_lower_half_internal() to avoid code
duplication.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-08-03 07:02:12 -07:00
Michal Lenc
bf90361895 ioexpander: add support for pcf8575 expander
This adds support for 16 bit io expander pcf8575. The driver is basically
the same as for pcf8574 however it is for 16 bits instead of 8 bits. Since
pcf8575 and pcf8574 can be both used on the same i2c bus the driver for
pcf8575 is implemented in a different file to reduce the code size
and complexity and to have less if statements in the driver.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-08-03 06:52:27 -07:00
makejian
d5041420a3 crypto: porting Curve25519 algorithm into nuttx crypto
Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-03 03:20:13 -07:00
zhangyuan21
3aa2aa4703 assert: add more information to panic notifier
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-08-03 03:17:22 -07:00
zhangyuan21
bfab486611 assert: add panic notifier data for notify more information
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-08-03 03:17:22 -07:00
yangjiao
bef756c004 fs/mqueue: Fix the wrong field type in mq_attr as the spec and add the logical judgment to deal with the condition when mq_maxmsg or mq_msgsize is less than zero or equal to zero.
In POSIX standard spec https://pubs.opengroup.org/onlinepubs/7908799/xsh/mqueue.h.html, the field type in mq_attr should be long not size_t. And no logical judgment when mq_maxmsg <= 0 or mq_msgsize <= 0. In this change, i update the field type in mq_attr, and add the missing logical judgment.

Signed-off-by: yangjiao <yangjiao@xiaomi.com>
2023-08-03 03:10:56 -07:00
Lee Lup Yuen
b2c1930825 serial/uart_16550: Wait before setting Line Control Register (Synopsys DesignWare 8250)
Some UART Controllers (Synopsys DesignWare 8250) will trigger spurious interrupts when the Line Control Register (LCR) is set while the UART is busy. This patch provides the option (16550_WAIT_LCR) to wait for UART until it's not busy, before setting the LCR. (16550_WAIT_LCR is disabled by default)

This patch fixes the spurious UART interrupts for the upcoming port of NuttX to StarFive JH7110 SoC (with Synopsys DesignWare 8250 UART). [The patch is explained here](https://lupyuen.github.io/articles/plic#appendix-fix-the-spurious-uart-interrupts)

drivers/serial/uart_16550.c: If 16550_WAIT_LCR is enabled, wait until UART is not busy before setting LCR

include/nuttx/serial/uart_16550.h: Define the UART Status Register (USR) for checking if UART is busy

drivers/serial/Kconfig-16550: Added option 16550_WAIT_LCR to 16550 UART Config, disabled by default
2023-08-03 08:38:07 +02:00
fangxinyong
43b0421b2a mm/map: limit the count of memory mapping for the task
No memory map count limit that will exhaust memory and cause
the system hang. Also that fix pass LTP posix case mmap/24-1.c

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2023-08-02 22:57:28 -07:00
fangxinyong
2bf434214e libc/sysconf: add _SC_REALTIME_SIGNALS
pass ltp case: open_posix_testsuite/conformance/interfaces/sigwait/7-1.c

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2023-08-02 22:57:28 -07:00
fangxinyong
da3a75da2c libc/net: compatible with Android for htonq/ntohq
Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2023-08-02 22:47:29 -07:00
Bowen Wang
477602e657 mm_heap: mm dump and panic only valid for the heap own by OS
When other code use nuttx memory manager by call mm_xx api directly,
it better to let other code to control weather dump or panic when
malloc failed.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2023-08-02 06:11:59 -07:00
yangguangcai
05af311e68 qemu:add qemu rtc driver.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-02 03:27:55 -07:00
dongjiuzhu1
2945252b71 sensor/gps: support gps driver model
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-08-01 23:09:46 -07:00
dongjiuzhu1
1920ff31d3 libs/libc/gpsutils/minmea: move minmea library from apps/gpsutils
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-08-01 23:09:46 -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
0f6d0eac52 fs/pesudofile: support pseudo-file operation
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-31 22:22:58 -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
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
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
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
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
simbit18
8f744592d5 Fix nuttx coding style
Fix Comments
2023-07-31 10:54:53 -03: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
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
simonatoaca
9794dc118f drivers: Added support for BME680
drivers/sensors/bme680.c: The bme680 driver
sensor.h: Added new type of sensor (Gas) to be used for retrieving the bme680 data
esp32/common/src/esp32_bme680.c: bme680 support on esp32
esp32/esp32-sparrow_kit/esp32_bringup.c: added support for the bme680
esp32/esp32-sparrow-kit/configs/nsh/defconfig: fixed defconfig ci problem

Signed-off-by: simonatoaca <simona.alexandra2000@gmail.com>

esp32-sparrow-kit: Fixed defconfig

Signed-off-by: simonatoaca <simona.alexandra2000@gmail.com>

Code is now C89 compatible

Signed-off-by: simonatoaca <simona.alexandra2000@gmail.com>

Reused already defined sensor data structs by registering every sub-sensor separately

Signed-off-by: simonatoaca <simona.alexandra2000@gmail.com>

Implemented suggestions

Signed-off-by: simonatoaca <simona.alexandra2000@gmail.com>
2023-07-29 17:47:23 -03:00
dongjiuzhu1
6ff4826492 nuttx/bits.h: support GENMASK and GENMASK_ULL
Ref to https://github.com/torvalds/linux/blob/master/include/linux/bits.h

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-29 16:41:31 -03:00
yuexinyi
326cf2bf88 drivers/video: add new video driver register api to support multi instance
Signed-off-by: yuexinyi <yuexinyi@xiaomi.com>
2023-07-29 07:42:29 -07:00
yuexinyi
56be0ab050 drivers/video: add capture arg to support multi instance
Signed-off-by: yuexinyi <yuexinyi@xiaomi.com>
2023-07-29 07:42:29 -07:00
yuexinyi
96ea877490 drivers/video: video ioctrl api support multi instance
Signed-off-by: yuexinyi <yuexinyi@xiaomi.com>
2023-07-29 07:42:29 -07:00
dongjiuzhu1
5d09b4cbd0 libc/rand_r: support rand_r api
refs to https://pubs.opengroup.org/onlinepubs/7908799/xsh/rand.html

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-29 07:28:23 -07:00
dongjiuzhu1
d415b7df54 include/fcntl.h: add O_NOATIME flags
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-28 20:56:22 -07:00
dongjiuzhu1
afb473707f libc/pthread: add pthread_attr_set/getscope
refs to https://pubs.opengroup.org/onlinepubs/7908799/xsh/pthread_attr_setscope.html

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-28 20:55:22 -07:00
dongjiuzhu1
9bf66ba3d5 driver/spi_slave: support spi_slave asynchronous
1. support spi slave device poll
2. support read non-block/block mode

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-28 19:11:16 +03:00
dongjiuzhu1
21d19f89af driver/adc: fill in missing parameters about adc driver
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-28 05:00:19 -07:00
guoshichao
9d7f349664 libs/pthread/pthread_atfork: fulfill implement pthread_atfork function
1. add the pthread_atfork implementation
2. the pthread_atfork implementation are referred to https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_atfork.html

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2023-07-26 10:41:52 +02:00
guoshichao
3524f4b9ce libs/libc/fork: add lib_fork implementation
1. add lib_fork api in libs/libc, we need a fork() api to implement the
fork relative method, such as pthread_atfork
2. rename the assembly fork entry function name to up_fork(), and rename
the up_fork() to arch specific name, such as
sim_fork()/arm_fork()/mips_fork() etc.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2023-07-26 10:41:52 +02:00
Xiang Xiao
f3269a6caa sched: Rename DEBUG_TCBINFO to ARCH_HAVE_TCBINFO
and select if the arch support to define g_tcbinfo variable

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-26 09:33:38 +02:00
Xiang Xiao
e28f6d6e6e hwspinlock: Fix typo error(spin_lock_restore to spin_unlock_irqrestore)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-25 13:03:31 +02:00
Xiang Xiao
13dfe41f6c Fix include/nuttx/hwspinlock/hwspinlock.h:117:3: error: too few arguments to function 'hwspin_unlock'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-25 09:11:24 +03:00
zhangyuan21
9792211b96 sched/tcbinfo: add stack info to tcbinfo
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-07-24 09:47:12 -07:00
anjiahao
9f644579b3 fix sim register & tcb info typo
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-07-23 21:59:35 -07:00
Victor Benso
0c5145b7d1 New implementation of the ESP32's RMT driver. 2023-07-23 16:17:57 -03:00
raiden00pl
e5b6d1cb29 include/nuttx/wireless/lte/lte.h: add fw_version field to lte_version_t 2023-07-23 19:56:38 +08:00
raiden00pl
4f8b979855 include/nuttx/wireless/lte/lte.h: increase bb_product length 2023-07-23 19:56:38 +08:00
Xiang Xiao
a51be33a41 libc/tls: Change the default value of TLS_NELEM to zero
to ensure the default config as small as possible.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-20 08:11:30 +02:00
xiajizhong
7160849f63 new feature on trace dump support segger-rtt
Signed-off-by: xiajizhong <xiajizhong@xiaomi.com>
2023-07-16 14:37:21 +03:00
Manish Kumar Sharma
6a1abbcf56 driver/audio: remove unnecessary switch in switch
- There is unnecessary switch inside switch which is making code not too readable

Signed-off-by: Manish Kumar Sharma <manishsharma3134@gmail.com>
2023-07-16 16:40:34 +08:00
Xiang Xiao
16d375e90f include/nuttx/sched.h: Remove the unnecessary forward declaration
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-16 00:35:35 +03:00
chenrun1
22d1059c97 armv7/8 cache: add up_get_xcache_size() support
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-07-15 15:11:07 +08:00
anjiahao
b956495c5e libs/libc:Support gdb rsp protocol
you can debug nuttx through any transport layer (serial port, network etc.),
currently supports the following functions:
1. Read and write registers
2. Read and write memory
3. Switch thread and read stack information

Future support plans:
1. Support breakpoint, watch point (requires architecture support).

related information:
https://sourceware.org/gdb/onlinedocs/gdb/Remote-Protocol.html

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-07-15 01:57:11 +08:00
yinshengkai
fe9251b546 libc: export lib_sprintf_internal function
This function does not take numbered arguments in printf

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-07-14 00:22:11 +03:00
chao an
8ef5f02b66 libs: fix visual studio Compiler Error C2036
D:\code\nuttx\include\nuttx\net\netfilter\ip_tables.h(288,42): error C2036: "void *" : unknown size

Reference:
https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-error-c2036?view=msvc-170

Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-14 01:23:16 +08:00
chao an
54740b3ad2 win/MSVC: add packed_struct macro implement
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-14 01:18:09 +08:00
guoshichao
79af1cdfe6 libs/libc/getpgid: add getpgid implementation
1. the getpgid function can help to pass the
ltp/open_posix_testsuite/killpg related testcases
2. NuttX do not support process group, so we use the process id as
process group id
3. the implementation are referred to: https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpgid.html

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2023-07-13 19:37:35 +08:00
simbit18
1b1ac6f3b7 Fix nuttx coding style
Remove TABs
Fix indentation
Fix Multi-line comments
Fix Comments to the Right of Statements.

Fix nuttx coding style

Fix Comments to the Right of Statements.
2023-07-13 19:30:56 +08:00
Neale Ferguson
878384fef0 Fix and improve dynamic loader
This patch fixes some issues found by Mark Stevens and
improve the dynamic loader.
2023-07-13 10:11:58 +08:00
yinshengkai
ce98f186c0 syslog: add syslog channel filtering function
support to control the opening or closing of the specified channel through the syslogmask command at runtime

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-07-13 01:04:07 +08:00
rongyichang
6902ed9516 drivers/lcd: add area alignment ioctl for lcd driver
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-07-13 01:03:18 +08:00
dulibo1
7ccdb2cfa8 battery:fix poll return type
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-07-12 11:06:47 -03:00
fangxinyong
ffa084f3d2 signal: SIGKILL or SIGSTOP cannot be caught
pass ltp signal test cases, for posix spec, SIGKILL and SIGSTOP cannot be caught.

https://pubs.opengroup.org/onlinepubs/9699919799/functions/signal.html
https://pubs.opengroup.org/onlinepubs/007904875/functions/sigset.html

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2023-07-12 21:27:06 +08:00
yinshengkai
9c6f48e57b drivers/segger: add RTT serial support
usage:
  1. Connect Jlink, start JLinkGDBServer
     JLinkGDBServer -if SWD -device stm32h743zi -speed 16000
  2. Listen to the RTT port data and forward it to the virtual serial port
     sudo socat -d -d PTY,link=/dev/ttyRTT0,raw,ignoreeof TCP:127.0.0.1:19021,reuseaddr
  3. Read serial data
     minicom -D /dev/ttyRTT0

Performance:(STM32H743, 400MHZ)
time "dd if=/dev/zero of=/dev/console bs=512 count=2048"
6.67 sec  157KB/s

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-07-12 09:54:50 +08:00
Zhe Weng
c253bb91a2 drivers/net: Add wireless ops in upper-half driver
Take the idea from Linux's iw_handler array and esp32c3_wlan's wlan_ops_s, and make it a common logic of upper-half driver.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-07-12 03:32:02 +08:00
guoshichao
c33d1c9c97 sched/task/fork: add fork implementation
1. as we can use fork to implement vfork, so we rename the vfork to
fork, and use the fork method as the base to implement vfork method
2. create the vfork function as a libc function based on fork
function

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2023-07-12 02:27:37 +08:00
rongyichang
5d7864fbcb drivers/spi: add support for qspi hwfeatures
add QSPI_BITORDER and QSPI_WORD_REVERSE hwfeatures

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-07-12 01:42:25 +08:00
simbit18
9681c52517 Fix nuttx coding style
Remove TABs
Fix indentation
2023-07-11 23:32:17 +08:00
yanghuatao
2529f371ee change clockid_t type from uint8_t to int
make the clock_getres pass the ltp/open_posix_testsuite/clock_getres testcases, posix has no explain about clockid_t type, referrence linux: 858fd168a9/include/linux/types.h (L27) and 858fd168a9/include/uapi/asm-generic/posix_types.h (L96)

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2023-07-11 22:36:23 +08:00
Xiang Xiao
9dc59e9109 Fix error: Mixed case identifier found
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-10 23:03:17 +03:00
Xiang Xiao
ebcb03dce9 libc/symtab: Don't include symtab.h in the header files
to unify the inclusion of symtab.h only from the source files

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-10 23:03:17 +03:00
Xiang Xiao
229293f9f8 binfmt: Move [elf|nxflat]_[un]initialize to private header file
like what builtin binary format do

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-10 23:03:17 +03:00
liuzhao
899471c6bd add support for YT8512 phy 2023-07-11 03:40:53 +08:00
Xiang Xiao
813b652ba5 elf: Move 32/64bit generic mapping from risc-v/arch_elf.c to elfxx.h
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-10 13:09:47 -03:00
Xiang Xiao
5849cf71d8 libc/symtab: Move SYMTAB_XXX from unistd/Kconfig to symtab/Kconfig
Make code and config in the same location

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-10 13:09:47 -03:00
guoshichao
dc08798764 libs/libc/pthread: add the implementation of pthread_getcpuclockid
1. the implementation can pass the
ltp/open_posix_testsuite/pthread_getcpuclockid testcases
2. the modification are referred to https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_getcpuclockid.html

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2023-07-10 13:40:49 +08:00
zhanghongyu
859b96e727 net/ioctl: add some bridge calls command
In order to support the compilation of third-party library, we encounter
some situations where the macro is not defined, refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-07-09 12:02:28 +08:00
zhanghongyu
6efeec77e1 net: add netfilter compatible definitions for iptables
In order to support the compilation of third-party library, we encounter
some situations where the macro is not defined, refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-07-08 15:29:21 -03:00
zhanghongyu
3538d1b313 netlink: add some definition
In order to support the compilation of third-party library, we encounter
some situations where the macro is not defined, refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-07-08 11:12:41 -03:00
zhanghongyu
f917416340 netlink: add statistics-related struct definitions
In order to support the compilation of third-party library, we encounter
some situations where the macro is not defined, refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-07-08 11:12:41 -03:00
zhanghongyu
3b186dabe0 net/if.h: add definitions associated with IF_OPER_
In order to support the compilation of third-party library, we encounter
some situations where the macro is not defined, refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-07-08 10:59:37 -03:00
zhanghongyu
08b92ef7cf ifaddrs: add union ifa_ifu include ifu_broadaddr and ifu_dstaddr
In order to support the compilation of third-party library, we encounter
some situations where the macro is not defined, refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-07-08 15:42:11 +08:00
Petro Karashchenko
b8d3e32bdf sched/clock: move clock_getcpuclockid() and clock_getres() to libc
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-07 17:39:39 -03:00
Petro Karashchenko
15991ef919 include/nuttx: remove semicolon in _SIG_KILL definition
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-07 17:39:39 -03:00
Petro Karashchenko
9369b75ee5 includes/nuttx: fix _SCHED_GET(T/P/PP)ID definition issue
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-07 17:39:39 -03:00
qiaohaijiao1
a5d1d2d4e5 audio: add AUDIOIOC_FLUSH ioctl
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2023-07-07 23:06:11 +08:00
Gregory Nutt
8868c58720 Fix Deadloop in VFS if CONFIG_CANCELLATION_POINTS is enabled
If cancellation points are enabled, then the following logic is activated in sem_wait().  This causes ECANCELED to be returned every time that sem_wait is called.

    int sem_wait(FAR sem_t *sem)
    {
      ...

      /* sem_wait() is a cancellation point */

      if (enter_cancellation_point())
        {
    #ifdef CONFIG_CANCELLATION_POINTS
          /* If there is a pending cancellation, then do not perform
           * the wait.  Exit now with ECANCELED.
           */

          errcode = ECANCELED;
          goto errout_with_cancelpt;
    #endif
        }
      ...

Normally this works fine.  sem_wait() is the OS API called by the application and will cancel the thread just before it returns to the application.  Since it is cancellation point, it should never be called from within the OS.

There there is is one perverse cases where sem_wait() may be nested within another cancellation point.  If open() is called, it will attempt to lock a VFS data structure and will eventually call nxmutex_lock().  nxmutex_lock() waits on a semaphore:

   int nxmutex_lock(FAR mutex_t *mutex)
   {
     ...

     for (; ; )
       {
         /* Take the semaphore (perhaps waiting) */

         ret = _SEM_WAIT(&mutex->sem);
         if (ret >= 0)
           {
             mutex->holder = _SCHED_GETTID();
             break;
           }

         ret = _SEM_ERRVAL(ret);
         if (ret != -EINTR && ret != -ECANCELED)
           {
             break;
           }
       }
   ...
}

In the FLAT build, _SEM_WAIT expands to sem_wait().  That causes the error in the logic:  It should always expand to nxsem_wait().  That is because sem_wait() is cancellation point and should never be called from with the OS or the C library internally.

The failure occurs because the cancellation point logic in sem_wait() returns -ECANCELED (via _SEM_ERRVAL) because sem_wait() is nested; it needs to return the -ECANCELED error to the outermost cancellation point which is open() in this case.  Returning -ECANCELED then causes an infinite loop to occur in nxmutex_lock().

The correct behavior in this case is to call nxsem_wait() instead of sem_wait().  nxsem_wait() is identical to sem_wait() except that it is not a cancelation point.  It will return -ECANCELED if the thread is canceled, but only once.  So no infinite loop results.

In addition, an nxsem_wait() system call was added to support the call from nxmutex_lock().

This resolves Issue #9695
2023-07-06 14:20:29 -03:00
Xiang Xiao
62480d1a8b boardctl: Add const to struct boardioc_symtab_s::symtab
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-06 09:24:02 -03:00
Xiang Xiao
935f43185f libc/modlib: Replace nx_stat with file_stat
to avoid searching the path twice

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-06 09:20:24 -03:00
Neale Ferguson
fec789047a Add support for the loading of ET_DYN objects
* libs/libc/machine/arm/armv7-m/arch_elf.c
      - Fix cast of error message parameters

    * build-globals.sh
      - Build the modlib_globals.S file used to resolve symbols when dynamically loading

    * libs/libc/modlib/Make.defs
      - Build modlib_globals.S for all targets

    * libs/libc/modlib/modlib_load.c
      - Calculate sizes and text/data addresses based on program headers rather than section headers
      - Handle objects with no program headers

    * libs/libc/modlib/modlib_bind.c
      - Call modlib_readsym with pointer to symbol table
      - Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN)
      - Differentiate between ET_REL and ET_DYN objects
      - Use arch independent symbol ELF_R_SYM
      - Cast sizes to avoid warnings

    * libs/libc/modlib/modlib_load.c
      - Cast sizes to avoid warnings

    * include/elf.h
      - Add definitions that may be found in shared objects

    * include/nuttx/lib/modlib.h
      - Add parameter to modlib_readsym prototype
      - Add prototypes for:
        - modlib_insertsymtab
        - modlib_findglobal
      - Define Elf_Dyn and Elf_Off according to the elf architecture
      - Add fields to mod_loadifno_s:
        - Program headers
        - Exported symbols
        - Data section address
        - Padding requirement
        - Section index for dynamic symbol table
        - Number of symbols exported
      - Add prottotype for modlib_freesymtab

    * libs/libc/dlfcn/lib_dlclose.c
      - Free the symbol table when the dll is closed

    * libs/libc/dlfcn/lib_dlopen.c
      - Add dump of program headers to debug routine
      - Differentiate between ET_REL and ET_DYN objects

    * libs/libc/machine/arm/armv7-m/arch_elf.c
      - Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types

    * libs/libc/modlib/modlib_loadshdrs.c
      - Rename modlib_loadshdrs.c to modlib_loadhdrs.c
      - Rename modlib_loadshdrs to modlib_loadhdrs
      - Add code to load program headers

    * libs/libc/modlib/modlib_symbols.c
      - Define entry point structure
      - Add offset parameter to modlib_symname() and use to find symbol names
      - Add symtab section header parameter to modlib_readsym()
      - Add offset parameter to modlib_symvalue() to locate symbol names
      - Add modlib_insertsyntab() to create a symbol table for exporting and resolution
      - Add findEP() to resolve a symbol in the modlib_global table
      - Add modlib_findglobal() to find symbol in the modlib_global table
      - Add modlib_freesymtab() to free the symbol table

    * libs/libc/modlib/modlib_uninit.c
      - Free header and sections from a module_loadinfo_s control block

    * libs/libc/modlib/modlib_verify.c
      - Handle ET_DYN shared objects

    * libs/libc/modlib/modlib_globals.S
      - Multi-target global table
      - Define library APIs that may be resolved when loading a shared object
2023-07-06 09:13:38 -03:00
SPRESENSE
4eb6da33c2 cxd56/alt1250: Change power on sequence
Change the power on sequence according to ALT1250 modem spec.
2023-07-06 13:18:57 +08:00
raiden00pl
206d339b37 arch/arm: add support for ARMv8-M Security Extensions 2023-07-05 11:20:46 -03:00
Xiang Xiao
015e30a866 drivers/net: Remove HAVE_ATOMICS and use CONFIG_HAVE_ATOMICS directly
since OpenAMP never support to compile in c89 only mode

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-05 13:43:17 +03:00
fangxinyong
dc7f8f136c signal: correct to const pointer for sigorset and sigandset
the two GNU functions, should use const input pointer parameter.

https://refspecs.linuxfoundation.org/LSB_1.3.0/gLSB/gLSB/baselib-sigorset.html
https://refspecs.linuxfoundation.org/LSB_1.3.0/gLSB/gLSB/baselib-sigandset.html

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2023-07-05 16:26:18 +08:00
guoshichao
bc084a8505 sched/clock/clock_getcpuclockid: add clock_getcpuclockid implementation
1. the implementation can pass the full
ltp/open_posix_testsuite/clock_getcpuclockid testcases
2. the modification are referred to https://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_getcpuclockid.html

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2023-07-05 00:32:11 +08:00
libei1
63774125d9 arch/sim : Audio driver add AUDIOIOC_GETLATENCY ioctl
add AUDIOIOC_GETLATENCY definition, and add reference code in sim alsa.

Signed-off-by: libei1 <libei1@xiaomi.com>
2023-07-04 13:48:58 +08:00
guoshichao
42f8308423 sched/clock/clock_getres: add two CPUTIME_ID res support
1. make the clock_getres can pass the
ltp/open_posix_testsuite/clock_getres 7-1, 8-1 two cases
2. the modification are referred to https://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_getres.html

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2023-07-03 23:11:00 +03:00
Nicolas Caramelli
e82b762fb7 input/touchscreen: Translate raw X/Y data into pixel coordinates 2023-07-03 10:17:04 -03:00
Zhe Weng
210c72a651 errno: Adjust help string for EALREADY and ESTALE
EALREADY:
Both Linux(asm-generic/errno.h) and FreeBSD(sys/sys/errno.h) regard it as "Operation already in progress"

ESTALE:
Linux specifically removed the "NFS" description, and we may not only use it for NFS
0ca4343518

The ECANCELED and EOWNERDEAD also use different strings from Linux's header, but their meanings are same, and NuttX's description are more likely to obey POSIX 1003.1-2008, so not changing them.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-07-03 13:38:02 +08:00
Petro Karashchenko
46facd44b3 drivers/net/netdev: improve granularity of 'quota' locking
There is no need to use global spinlock to protect netdev
specific data counters. Allocate per-netdev specific spinlock
to get better locking granularity.

Move C/C++ atomic support checking to compiler.h

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-01 15:27:09 -03:00
Xiang Xiao
5af99c65de fs: Define __USE_FILE_OFFSET64 when CONFIG_FS_LARGEFILE is enabled
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-30 20:22:10 -03:00
guoshichao
d5f45dc33b libs/libc/aio: fix aio_cancel compatible issue
1. make the aio_cancel implementation can pass the
ltp/open_posix_testsuite/aio_cancel testcases
2. the modification are referred to https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_cancel.html

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2023-06-29 23:25:33 +08:00
chao an
4de2284614 compiler/fortify: remove unused label prefix and fix build warning
string/lib_memmove.c:39:1: warning: optimization attribute on 'memmove' follows definition but the attribute doesn't match [-Wattributes]
   39 | {
      | ^
In file included from string/lib_memmove.c:27:
nuttx/include/string.h:177:37: note: previous definition of 'memmove' with type 'void *(void *, const void *, size_t)' {aka 'void *(void *, const void *, unsigned int)'}
  177 | fortify_function(memmove) FAR void *memmove(FAR void *dest,
      |                                     ^~~~~~~
string/lib_memset.c:55:1: warning: optimization attribute on 'memset' follows definition but the attribute doesn't match [-Wattributes]
   55 | {
      | ^
In file included from string/lib_memset.c:30:
nuttx/include/string.h:194:36: note: previous definition of 'memset' with type 'void *(void *, int,  size_t)' {aka 'void *(void *, int,  unsigned int)'}
  194 | fortify_function(memset) FAR void *memset(FAR void *s, int c, size_t n)
      |                                    ^~~~~~
CC:  unistd/lib_sysconf.c string/lib_memcpy.c:43:1: warning: optimization attribute on 'memcpy' follows definition but the attribute doesn't match [-Wattributes]
   43 | {
      | ^
In file included from string/lib_memcpy.c:27:
nuttx/include/string.h:186:36: note: previous definition of 'memcpy' with type 'void *(void *, const void *, size_t)' {aka 'void *(void *, const void *, unsigned int)'}
  186 | fortify_function(memcpy) FAR void *memcpy(FAR void *dest,
      |

Signed-off-by: chao an <anchao@xiaomi.com>
2023-06-28 08:47:33 +08:00
raiden00pl
dc608de144 drivers/ioexpander: add support for SX1509
SX1509 from Semtech is GPIO expander with LED driver and keypad engine.
For now, the keypad engine is not supported.
2023-06-27 14:44:00 -03:00
raiden00pl
c63b2d5c91 drivers/userled: add an interface to support LED effects.
LED effects must be implemented in the lower-half of the LED driver.
The interface is designed to supports the following LED effects:
  - intenisty (PWM)
  - Bling (Timer)
  - Fade in, Fade out (Ramp)
2023-06-27 14:44:00 -03:00
Stuart Ianna
8a668fe733 include/sys: Include string.h to silence implicit memset declration.
This change stops the warning "implicit declaration of function 'memset'" when using the `FD_ZERO` macro.
2023-06-27 10:36:13 +03:00
guoshichao
037a6f5836 libs/libc/signal: add killpg function
1. the killpg function can make all the
ltp/open_posix_testsuite/killpg testcaes passed
2. Nuttx do not support process group, so we use kill process instead
3. the implementation are referred to:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/killpg.html

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2023-06-27 13:26:20 +08:00
Xiang Xiao
7f80b4aeba clock: Move the content of include/nuttx/time.h to include/nuttx/clock.h
and remove include/nuttx/time.h to reduce the nuttx specific header files

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-26 19:14:08 +03:00
Xiang Xiao
b5c48f3ed8 binfmt: Always include arch/elf.h in include/nuttx/elf.h
since symbols defined in arch/elf.h is also used in other case, for example:
CC:  pthread/pthread_testcancel.c machine/arm/gnu_unwind_find_exidx.c:32:8: error: unknown type name '__EIT_entry'
   32 | static __EIT_entry *__exidx_start_elf;
      |        ^~~~~~~~~~~

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-25 19:02:53 -03:00
guoshichao
3821ad514d libs/libc/unistd: add getpgrp function
1. the getpgrp function can help to pass the ltp/open_posix_teststuite/killpg related testcases
2. Nuttx do not support process group, so we use getpid to implement this
3. the implementation are referred to: https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpgrp.html

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2023-06-26 01:03:36 +08:00
Filipe Cavalcanti
9603288c80 drivers/sensors/mpu60x0.c: add IOCTL for AFS_SEL, sample rate and FIFO support 2023-06-24 10:57:12 -03:00
Roy Feng
10251f6b6c Fix assertion of free a wrong heap 2023-06-24 16:34:53 +08:00
Xiang Xiao
efd1b838e6 syslog: Add sc_write_force callback
It is used to write the log message to the channel immediately
when the log message is generated in the interrupt context, which
is faster than the normal force callback.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-23 09:55:19 -03:00
Xiang Xiao
e62c915972 syslog: Remove syslog_force and related stuff
syslog_force is used to force the syslog output to the
console in interrupt context, but we can use syslog_write
to do the same(and more) thing.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-23 09:55:19 -03:00
anjiahao
d5981375a6 Support gcc FORTIFY_SOURCE features for nuttx libc
This function will use gcc's function
__builtin_dynamic_object_size and __builtin_object_size

Its function is to obtain the size of the object through compilation,
so as to judge whether there are out-of-bounds operations in commonly used functions.
It should be noted that the option -O2 and above is required to enable this function

Signed-off-by: anjiahao <1090959677@qq.com>
2023-06-22 20:38:45 +08:00
anjiahao
4ae17a6f7b sched:Automatically find deadlocks when assert
When asserting, automatically analyze whether
there is a deadlock in the thread, and if there
is a deadlock, print out the deadlocked thread.

The principle is to analyze whether there is
a lock ring through the tcb holder.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-06-22 16:08:03 +08:00
Xiang Xiao
0572bc4d03 mm/mempool: Count the backtrace overhead in mempool_[dump|info[_task]]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-19 11:37:34 +03:00
Xiang Xiao
9b6cd96671 mm: Rename PID_MM_INVALID to PID_MM_LEAK
to express the intent more clear

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-18 14:26:07 +03:00
Xiang Xiao
b00237ac01 mm: Move PID_MM_MEMPOOL after PID_MM_ALLOC
so the allocation from mempool could be dumped correctly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-18 09:12:14 +03:00
Xiang Xiao
f01deff80f mm: Rename MM_BACKTRACE_XXX_PID to PID_MM_XXX
and move the definition to malloc.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-18 09:12:14 +03:00
Xiang Xiao
ddbe9eb6ab mm: Rename mm_memdump_s to malltask
align with the naming of mallinfo_task

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-18 09:12:14 +03:00
Bowen Wang
8515294caa lib_syslograwstream: fix bug when iob alloc failed
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2023-06-17 19:33:41 +08:00
zhangyuan21
514e77b75e semaphore: Optimize priority inheritance with only one holder
This PR is a modification that optimizes priority inheritance
for only one holder. After the above modifications are completed,
the mutex lock->unlock process that supports priority inheritance
can be optimized by 200 cycles.

Before modify: 2000 cycle
After modify: 1742 cycle

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-06-17 08:26:46 +03:00
zhanghongyu
7b5af12158 statfs: add f_fsid field for third-party code compile
because NuttX doesn't have the device number, so we're not assigning a
valid value here. just memset to zero.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-06-16 11:10:25 +08:00
Zhe Weng
f80539b6a8 netdev/upper: Use atomic when we have atomic support from compiler
Ref: How to test atomic support https://beej.us/guide/bgc/html/split/chapter-atomics.html

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-06-15 19:31:59 -03:00
Zhe Weng
483eb10f37 netdev/upper: Make quota_load public
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-06-15 19:31:59 -03:00
Simon Filgis
04f8bab063 Dynamic adjustment of the orientation, switch orientation on the fly:
1. orientation is a parameter of initialize
2. y and x offset need to be adjusted with the orientaiton
3. bpp must be changed no matter what
2023-06-15 10:15:11 -03:00
zhangyuan21
fc9f87824c sched/pthread: Return ESRCH when the task is in the process of exit.
Resolving the issue with the ltp_interfaces_pthread_join_6_2 test case.

In SMP mode, the pthread may still be in the process of exiting when
pthread_join returns, and calling pthread_join again at this time will
result in an error. The error code returned should be ESRCH.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-06-15 10:12:25 -03:00
yanghuatao
29a336d6a8 sched/tls: remove PTHREAD_CLEANUP from Kconfig
use PTHREAD_CLEANUP_STACKSIZE to enable or disable interfaces pthread_cleanup_push() and pthread_cleanup_pop().
reasons:(1)same as TLS_TASK_NELEM (2)it is no need to use two variables

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2023-06-14 12:00:48 +08:00
Sebastien Lorquet
43fec5dd53 pca9555: fix const correctness of pin set parameters 2023-06-13 16:10:52 -03:00
zhanghongyu
59c01ea05d netfilter: add NF_IP_xxx definition
we will integrate network management tools in future projects.  In the
process of porting the tools, we encounter some situations where the
structure is not defined, refer to the common implementation of other
systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-06-14 02:01:45 +08:00
zhangyuan21
6c38c44af2 assert: add regs parameter to board_crashdump function
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-06-13 09:42:27 +08:00
Alan Carvalho de Assis
69081a72d7 libdsp: Add average filter
This commit add average filter to DSP library
2023-06-12 08:39:38 +02:00
chao an
3ce2796175 assert: disable function/line print if DEBUG_ASSERTIONS_FILENAME disabled
Test on sim/nsh:
(CONFIG_DEBUG_ASSERTIONS=y CONFIG_DEFAULT_SMALL=y)
   text	   data	    bss	    dec	    hex	filename
 423626	  27152	   4128	 454906	  6f0fa	nuttx     /* before */
 417010	  27152	   4128	 448290	  6d722	nuttx     /* after */
  -6616

Signed-off-by: chao an <anchao@xiaomi.com>
2023-06-12 13:36:08 +08:00