Commit Graph

48314 Commits

Author SHA1 Message Date
zhanghongyu
e7d1ba157c usrsock: Don't clear recvfrom available flag
Don't clear available flag if the response indicate there is more data

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-02-04 20:52:56 +09:00
zhanghongyu
01fe37206a usrsock: optimize send case
Don't clear available flag if the response indicate there is more space

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-02-04 20:52:56 +09:00
Masayuki Ishikawa
6097f12765 tools: Fix Config.mk
Summary:
- I noticed that the following build error happened on my machine.

  make -C sched libsched.a EXTRAFLAGS="-D__KERNEL__ "
  make[1]: Entering directory '/mnt/m2ssd/opensource/RTOS/tmp/nuttx/sched'
  /bin/sh: 1: echoCC: clock/clock_initialize.c : not found

- This commit fixes this issue

Impact:
- Should be none

Testing:
- Build on ubuntu 18.04 x86_64

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-02-04 01:05:39 +02:00
chao an
02a9e76f73 misc/mutex: fix assertion if nxmutex_reset() before nxmutex_unlock()
sim/rpserver

NuttShell (NSH) NuttX-12.0.0
server> cu
_assert: Current Version: NuttX server 12.0.0 3ead669e7a-dirty Feb  2 2023 23:53:48 sim
_assert: Assertion failed : at file: libs/libc/misc/lib_mutex.c:303 task: cu 0x5662fff4

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-04 02:13:15 +08:00
chao an
edfae1fe21 sim/hcisocket: correct teardown device index
Parameter of HCIDEVDOWN should be the corresponding device id, not 0

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-03 23:22:54 +08:00
chao an
7625126c91 Remove the remain MIN/MAX like macro
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-03 23:22:41 +08:00
chao an
d1162ac58f mmcsd/mmcsd_spi: remove redundant mmcsd_unlock()
Assertion on lm3s6965-ek/qemu-flat if enable CONFIG_DEBUG_ASSERTIONS:

_assert: Current Version: NuttX  12.0.0 666b224c35 Feb  3 2023 19:36:38 arm
_assert: Assertion failed : at file: misc/lib_mutex.c:336 task: nsh_main 0xb385

Backtrace:
nuttx/libs/libc/sched/sched_dumpstack.c:69
nuttx/sched/misc/assert.c:494
nuttx/libs/libc/assert/lib_assert.c:36
nuttx/libs/libc/misc/lib_mutex.c:336
nuttx/drivers/mmcsd/mmcsd_spi.c:421
nuttx/drivers/mmcsd/mmcsd_spi.c:2072
nuttx/boards/arm/tiva/lm3s6965-ek/src/lm_bringup.c:119 (discriminator 3)
nuttx/boards/boardctl.c:335
apps/nshlib/nsh_init.c:144
apps/system/nsh/nsh_main.c:68
nuttx/libs/libc/sched/task_startup.c:70 (discriminator 2)
nuttx/sched/task/task_start.c:134

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-03 16:34:04 +02:00
Xiang Xiao
09841300b0 Remove the remain MIN/MAX like macro
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-03 20:42:57 +08:00
Zhe Weng
d423992988 net/tcp: Regard snd_wnd update as ACKDATA
Receiving an ACK indicating TCP Window Update will not set ACKDATA flag (because tx_unacked is 0) in our TCP stack. Then this ACK won't let us send anything after receiving it, even if it updates snd_wnd. So we need to check whether we can send data immediately when our snd_wnd is updated (especially from 0), otherwise we will only send next data after timer expiry.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-02-03 13:43:39 +02:00
yinshengkai
c57a0e90a0 tools: use relative paths when reverting to compile
Using the full path will make __FILE__ longer, which will lead to a larger flash footprint
revert 9c6c9fb0cd && e14309a92d

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-02-03 18:28:33 +08:00
yinshengkai
35ae47788b libc: Keep printf("%pS", p) behavior consistent
When ALLSYMS is not turned on, %pS will be treated as %p

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-02-03 09:19:06 +02:00
Alan Carvalho de Assis
e710ae5daf esp32c3: reserve CPUINTs 5 and 8 for BLE 2023-02-03 12:24:11 +08:00
Alan Carvalho de Assis
c12a60cb5a esp32c3: Fix WiFi adapter to use WMAC instead of MAC_NMI 2023-02-03 12:24:11 +08:00
Alan Carvalho de Assis
e950e53df2 esp32c3: Always reserve CPU INT 0 and fix cpu init order
Co-author: Tiago Medicci <tiago.medicci@espressif.com>
Co-author: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-02-03 12:24:11 +08:00
haopengxiang
8845e6bb38 sensor: Report more gps info
Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2023-02-02 22:49:27 +08:00
nietingting
2395c0f157 sensor: fix miwear sensor bb
Signed-off-by: nietingting <nietingting@xiaomi.com>
2023-02-02 22:49:27 +08:00
yangjiukui
1bcfb7af39 sensor: Enable ambient light sensor report ir strength
Signed-off-by: yangjiukui <yangjiukui@xiaomi.com>
2023-02-02 22:49:27 +08:00
xiatian6
70c6803db6 sensor: Add the calibration status flag
Signed-off-by: xiatian6 <xiatian6@xiaomi.com>
2023-02-02 22:49:27 +08:00
jinxudong
709da0fae4 fix: sensor: update hall data type
update hall data type to int32_t

Signed-off-by: jinxudong <jinxudong@xiaomi.com>
2023-02-02 22:49:27 +08:00
fangxiang
2c8c35431d fs/procfs: fix the issue of /proc/cpuload in SMP
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-02-02 22:48:30 +08:00
futerigele
7e7d4ab744 touch: Add ioctl to enable/disable gesture
Signed-off-by: futerigele <futerigele@xiaomi.com>
2023-02-02 22:48:00 +08:00
Xiang Xiao
be1c84c96a mm/mempool: Initialize spinlock with spin_initialize
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-02 22:47:34 +08:00
anjiahao
555c4fede3 spinlock: Move spinlock_init to public macros
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-02-02 22:47:34 +08:00
anjiahao
984208f6a2 tools: parsememdump.py support show total pid memory
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-02-02 22:47:03 +08:00
chao an
eca4951021 nuttx: Use MIN/MAX definitions from "sys/param.h"
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-02 22:16:04 +08:00
Xiang Xiao
df102d1f06 Remove OK macro from the code base
let's use OK from sys/types.h instead

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-02 13:58:16 +01:00
ligd
3ae4a6b8c3 sim/uart: do uart_xmitchars() when tty_txint enabled
to speed up the logout speed

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-02-02 18:27:39 +08:00
chao an
03b164f59c tools/makefile: silent all compile output
In order to make compilation warnings and errors easier to be found out,
this commit will disable the printing of the compilation process as much
as possible, and also if you want to restore the log information of the
compilation process, please enable verbose build on command line:

$ make V=0
OR
$ make V=1

| V=0:   Exit silent mode
| V=1,2: Enable echo of commands
| V=2:   Enable bug/verbose options in tools and scripts

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-02 17:40:19 +08:00
chao an
dff2192c75 misc/assert: remove const string from assert expression
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-02 15:08:47 +08:00
chao an
247b050e5f net/tcp: remove conn check since which can not be NULL
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-02 13:31:06 +08:00
chao an
4c8d244fae sched/getpid: replace syscall getpid/tid/ppid() to kernel version
NuttX kernel should not use the syscall functions, especially after
enabling CONFIG_SCHED_INSTRUMENTATION_SYSCALL, all system functions
will be traced to backend, which will impact system performance.

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-02 10:33:01 +08:00
chao an
c24dc389e4 sched/task: add kernel interface nxsched_* gettid/getpid/getppid
add new interface to implement getpid()/gettid()/getppid() for kernel version.

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-02 10:33:01 +08:00
chao an
c9981036a5 nuttx/mutex: move mutex implement to libc
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-02 10:33:01 +08:00
Nathan Hartman
5651940d02 tiva/serial: Allow changing CTS/RTS with termios
This is a follow-up to PR #6548, which added UART CTS/RTS support for
Tiva (TI TM4C12x) microcontrollers. This follow-up makes it possible,
when termios support is enabled with CONFIG_SERIAL_TERMIOS and CTS/RTS
support is enabled with CONFIG_SERIAL_OFLOWCONTROL and/or
CONFIG_SERIAL_IFLOWCONTROL, to query whether CTS/RTS are on/off at
runtime by utilizing ioctl TCGETS and to turn CTS/RTS on/off at runtime
by utilizing ioctl TCSETS.

* arch/arm/src/tiva/common/tiva_serial.c
  (up_set_format): Because this function is called from ioctl TCSETS to
   modify UART settings, and that IOCTL now respects CCTS_OFLOW and
   CRTS_IFLOW, move setting/clearing of Tiva UART's CTL register's RTSEN
   and CTSEN bits here...
  (up_setup): ...from here.
  (up_ioctl): For TCGETS, populate CCTS_OFLOW and CRTS_IFLOW bits as
   appropriate. For TCSETS, populate priv's oflow and iflow from
   supplied CCTS_OFLOW and CRTS_IFLOW bits.

Thanks to Petro Karashchenko for review and suggested fixes.

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-02-02 09:44:07 +08:00
Nathan Hartman
f2e15b431c Support termios for Tiva
The lower-half serial driver for Tiva (TI TM4C12x) microcontrollers supports
termios, but Kconfig never enabled this support because we were missing the
ARCH_HAVE_SERIAL_TERMIOS configs. This is now enabled, allowing termios support
to be enabled with CONFIG_SERIAL_TERMIOS.

* arch/arm/src/tiva/Kconfig
  (config TIVA_UART0 thru TIVA_UART7): Select ARCH_HAVE_SERIAL_TERMIOS.
2023-02-02 09:43:09 +08:00
Nathan Hartman
78154f12ff Serial: Fix wrong identifier name in comments 2023-02-02 09:42:34 +08:00
Xiang Xiao
d92dc45a80 vfs: Suppoprt F_DUPFD_CLOEXEC and MSG_CMSG_CLOEXEC
https://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html
https://linux.die.net/man/2/recvmsg

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-02 01:00:10 +02:00
Fotis Panagiotopoulos
b026072fbe Enabled UTF check in CI. 2023-02-02 00:31:02 +02:00
Xiang Xiao
bf5c7b6e5d tools/checkpatch.sh: Check the source code doesn't set executable bit
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-02 00:14:55 +02:00
Xiang Xiao
0a66cbdcdd tools/checkpatch: Should check the spell and encoding for rust file too
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-02 00:14:55 +02:00
anjiahao
8a80c6ab28 assert:add a Kconfig option to limit binfile size
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-02-02 01:58:43 +08:00
Gustavo Henrique Nihei
e6b204f438 nuttx: Use MIN/MAX definitions from "sys/param.h"
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-02-01 23:47:44 +08:00
Gustavo Henrique Nihei
079e2b8c7c include: Add MIN/MAX definition to sys/param.h
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-02-01 23:47:44 +08:00
chao an
a045eb3c1d arm/sama5/jupiter-nano: correct config name
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-01 22:36:42 +08:00
Huang Qi
4caf24a00c libc/stdio: Minor comments fix
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-02-01 21:47:30 +08:00
liangdongdong
1a22487abd Charge: Add cut-off current interface
Signed-off-by: liangdongdong<liangdongdong@xiaomi.com>
2023-02-01 09:51:31 -03:00
weizhifang
1d225aa7c3 Charge: Add shipmode into battery_ioctl.h
which is used to let battery charger enter into shipmode

Signed-off-by: weizhifang <weizhifang@xiaomi.com>
2023-02-01 09:51:31 -03:00
Ville Juven
8306e0d175 sched/group: Implement group_drop()
Implement a function for dropping references to the group structure and
finally freeing the allocated memory, if the group has been marked for
destruction
2023-02-01 09:49:09 -03:00
luojun1
8a5dc0ba12 Force sockaddr_storage to the desired alignment
First configure nuttx to support ipv4 and ipv6 dual stack,
then start two simulators and run Iperf ipv4 udp speed test,
unaligned access exception to sockaddr_in occours.

The root cause is that struct sockaddr_storage isn't set to
the desired alignment.

Signed-off-by: luojun1 <luojun1@xiaomi.com>
2023-02-01 09:46:21 -03:00
Fotis Panagiotopoulos
290a9157eb checkpatch: Added encoding check with cvt2utf 2023-02-01 20:42:35 +08:00