Commit Graph

48257 Commits

Author SHA1 Message Date
Nathan Hartman
5d2e1d40dc arch/tiva: Fix inability to control serial CTS/RTS via termios
* arch/arm/src/tiva/common/tiva_serial.c:
  (up_ioctl): PR #8406 (commit 1edec0aaa1) added support for
   configuring the serial port's CTS/RTS flow control at runtime using
   termios when built with CONFIG_SERIAL_TERMIOS and either or both of
   CONFIG_SERIAL_OFLOWCONTROL and CONFIG_SERIAL_IFLOWCONTROL. However,
   a runtime sanity check left over from before prevented this from
   working: When processing ioctl TCSETS, we would return -EINVAL if
   one or both of CCTS_OFLOW and CRTS_IFLOW were requested, which was
   not deserved if the requested features were in fact supported.
   Fixing the sanity check so it depends on features actually
   configured.
2023-02-08 10:31:11 +08:00
raiden00pl
18cf2c4297 boards/stm32f4discovery: add nxscope CDCACM example 2023-02-08 10:06:59 +08:00
raiden00pl
fc322a9c78 boards/sim: add nxscope config 2023-02-08 10:06:59 +08:00
Nathan Hartman
962e072fd5 mips/ld scripts: Fix typo in comment (s/mappled/mapped/) 2023-02-08 10:06:26 +08:00
Nathan Hartman
d383db53f9 boards/pic32mz-starterkit: Fix building with Sourcery toolchain
Fixing an issue that occurred When building with the
Sourcery CodeBench Lite MIPS Toolchain for Linux
(CONFIG_MIPS32_TOOLCHAIN_SOURCERY_CODEBENCH_LITE).
2023-02-08 10:06:01 +08:00
Nathan Hartman
1b3cac19a0 serial: Fix typo in comments (s/besued/because/) 2023-02-08 10:05:27 +08:00
Ville Juven
f4b82b6405 sched/addrenv: Remove up_addrenv_restore
The function is not relevant any longer, remove it. Also remove
save_addrenv_t, the parameter taken by up_addrenv_restore.

Implement addrenv_select() / addrenv_restore() to handle the temporary
instantiation of address environments, e.g. when a process is being
created.
2023-02-08 02:51:23 +08:00
Ville Juven
09e7987121 sched/addrenv: Fix system crash when process group has been deleted
There is currently a big problem in the address environment handling which
is that the address environment is released too soon when the process is
exiting. The current MMU mappings will always be the exiting process's, which means
the system needs them AT LEAST until the next context switch happens. If
the next thread is a kernel thread, the address environment is needed for
longer.

Kernel threads "lend" the address environment of the previous user process.
This is beneficial in two ways:
- The kernel processes do not need an allocated address environment
- When a context switch happens from user -> kernel or kernel -> kernel,
  the TLB does not need to be flushed. This must be done only when
  changing to a different user address environment.

Another issue is when a new process is created; the address environment
of the new process must be temporarily instantiated by up_addrenv_select().
However, the system scheduler does not know that the process has a different
address environment to its own and when / if a context restore happens, the
wrong MMU page directory is restored and the process will either crash or
do something horribly wrong.

The following changes are needed to fix the issues:
- Add mm_curr which is the current address environment of the process
- Add a reference counter to safeguard the address environment
- Whenever an address environment is mapped to MMU, its reference counter
  is incremented
- Whenever and address environment is unmapped from MMU, its reference
  counter is decremented, and tested. If no more references -> drop the
  address environment and release the memory as well
- To limit the context switch delay, the address environment is freed in
  a separate low priority clean-up thread (LPWORK)
- When a process temporarily instantiates another process's address
  environment, the scheduler will now know of this and will restore the
  correct mappings to MMU

Why is this not causing more noticeable issues ? The problem only happens
under the aforementioned special conditions, and if a context switch or
IRQ occurs during this time.
2023-02-08 02:51:23 +08:00
Ville Juven
5713d85df0 group/group_addrenv: Move address environment from group -> tcb
Detach the address environment handling from the group structure to the
tcb. This is preparation to fix rare cases where the system (MMU) is left
without a valid page directory, e.g. when a process exits.
2023-02-08 02:51:23 +08:00
raiden00pl
ca95d592d3 boards/stm32f4disco: add timer driver support 2023-02-08 02:43:13 +08:00
chao an
68970fe8a1 sim/dynconns: enable more configs to catch compile warning
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-08 02:42:59 +08:00
Igor Mišić
0a4fbcd123 drivers/mtd: add Kconfig options for RAMTRON emulated page & sector size 2023-02-08 01:44:51 +08:00
chao an
1cb11968b7 net/ip: fix compile break if enable NET_LOCAL_SCM
1.
net/slip.c:865:29: warning: unused variable ‘priv’ [-Wunused-variable]
  865 |   FAR struct slip_driver_s *priv =
      |                             ^~~~
net/slip.c: In function ‘slip_rmmac’:
net/slip.c:895:29: warning: unused variable ‘priv’ [-Wunused-variable]
  895 |   FAR struct slip_driver_s *priv =
      |                             ^~~~
2.
local/local_sendmsg.c: In function ‘local_sendmsg’:
local/local_sendmsg.c:423:18: warning: ‘count’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  423 |           return count;
      |                  ^~~~~
local/local_sendmsg.c:131:11: warning: ‘i’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  131 |   while (i-- > 0)
      |          ~^~
local/local_sendmsg.c:71:7: note: ‘i’ was declared here
   71 |   int i;
      |       ^

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-07 12:46:40 +02:00
chao an
e3a6c16944 net/ip: fix compile break if disable NET_TCP
1.
ipfrag/ipv4_frag.c: In function ‘ipv4_fragin’:
ipfrag/ipv4_frag.c:184:22: warning: ‘head’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  184 |   ipv4->len[1] = head->io_pktlen & 0xff;
      |                  ~~~~^~~~~~~~~~~
ipfrag/ipv4_frag.c:123:21: note: ‘head’ was declared here
  123 |   FAR struct iob_s *head;
      |                     ^~~~

2.
devif/ipv6_input.c: In function ‘ipv6_in’:
devif/ipv6_input.c:60:33: error: ‘TCPIPv6BUF’ undeclared (first use in this function); did you mean ‘UDPIPv6BUF’?
   60 | #define PAYLOAD ((FAR uint8_t *)TCPIPv6BUF)
      |                                 ^~~~~~~~~~

3.
nat/ipv4_nat.c: In function ‘ipv4_nat_inbound_icmp’:
nat/ipv4_nat.c:67:30: error: ‘TCP_HDRLEN’ undeclared (first use in this function); did you mean ‘UDP_HDRLEN’?
   67 |   ((proto) == IP_PROTO_TCP ? TCP_HDRLEN : \
      |                              ^~~~~~~~~~
nat/ipv4_nat.c:323:47: note: in expansion of macro ‘L4_HDRLEN’
  323 |             inner_l4hdrlen = MIN(inner_l4len, L4_HDRLEN(inner->proto));
      |                                               ^~~~~~~~~

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-07 12:46:40 +02:00
Xiang Xiao
97e994a1f9 Move SEEK_xxx from unistd.h to sys/types.h
so fcntl.h, stdio.h and unistd.h could get these definiton:
https://en.cppreference.com/w/c/io/fseek
https://pubs.opengroup.org/onlinepubs/7908799/xsh/fcntl.html
https://pubs.opengroup.org/onlinepubs/007904975/functions/lseek.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-07 12:16:22 +02:00
dongjiuzhu1
63e6f80fb0 sync: add sync api
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-02-07 12:15:05 +02:00
Lucas Saavedra Vaz
21d9163aae arch/xtensa/esp32s2: Add support for touch pad interrupts 2023-02-07 12:19:41 +08:00
Lucas Saavedra Vaz
247aad82f2 arch/xtensa/esp32s2: Fix touch function typo 2023-02-07 12:19:41 +08:00
Nathan Hartman
5f9cb6faf4 drivers/serial: Fix docstrings on UART interrupt handlers 2023-02-07 04:41:36 +08:00
chao an
caa16742db rp2040/raspberrypi-pico-w: update submodule to avoid invaild firmware
The cyw43-driver is a submodule in the pick-sdk, if the submodule is
not updated, the dummy firmware driver will be used, update the document
to correct the setup flow.

${PICO_SDK_PATH}/lib/cyw43-driver/firmware/43439A0-7.95.49.00.combined

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-07 04:40:38 +08:00
chao an
1b245664ad arm/rp2040: fix compile warning on boot2 build
ld: warning: boards/arm/rp2040/raspberrypi-pico-w/scripts/raspberrypi-pico-flash.ld contains output sections; did you forget -T?
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-07 04:40:38 +08:00
chao an
5c047f634f raspberrypi-pico-w/telnet: enable more configs
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-07 04:40:38 +08:00
chao an
1779433c35 wireless/bcm43xxx/qspi: try tx after rx fails
1. Try tx after rx fails to avoid gspi_thread busy to try rx
2. Add some delay if alloc frame buffer failed

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-07 04:40:38 +08:00
chao an
d5ac2be84f bcm43xxx/bcmf_ioctl.h: pack wl_* structure to avoid unaligned access
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-07 04:40:38 +08:00
chao an
5ac638944b arm/backtrace: fix compile warning
common/arm_backtrace_unwind.c: In function 'up_backtrace':
common/arm_backtrace_unwind.c:626:27:
warning: assignment to 'long unsigned int' from 'uint8_t (*)[]'\
{aka 'unsigned char (*)[]'} makes integer from pointer without a cast [-Wint-conversion]

  626 |           frame.stack_top = &g_intstacktop;
      |
2023-02-07 04:40:38 +08:00
dongjiuzhu1
14f8a6c2dd fs: support openat/fchmodat/mkfifoat/fstatat/...at api
Refs to:
https://linux.die.net/man/2/openat

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-02-07 03:45:38 +08:00
dongjiuzhu1
7bbabc74fb fs/dir: provide absolute directory path for F_GETPATH by fcntl
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-02-07 03:45:38 +08:00
chao an
dad6b105ca tools/Config: silent print of archive objects
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-06 16:22:28 -03:00
chao an
5e623da2dd tools/Config: stack usage(.su) file should be removed on clean phase
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-07 00:30:49 +08:00
Xiang Xiao
65a04c66a2 libc: Define _assert/__assert to avoid 3rd libary redefine them
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-06 15:04:30 +01:00
Xiang Xiao
d8a8c2fdd8 boards: Enable assert for citest
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-06 21:33:15 +09:00
lilei19
de21025702 fix a bug of strtold
if input is -1e308,The output should be -100000000......
  but the output is -inf
2023-02-06 20:26:45 +08:00
Masayuki Ishikawa
79704620f8 tools: ci: Fix testrun/utins/common.py for sabrelite (QEMU)
Summary:
- I noticed that nuttx crashes if DEBUG_ASSERTIONS=y
- This commit fixes this issue by changing QEMU options

Impact:
- None

Testing:
- Tested with QEMU

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-02-06 18:26:05 +08:00
Masayuki Ishikawa
25a6448a1a boards: sabre-6quad: Update README.txt
Summary:
- This commit updates README.txt regarding QEMU with DEBUG_ASSERTIONS=y

Impact:
- None

Testing:
- Tested with QEMU-7.1

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-02-06 18:26:05 +08:00
Masayuki Ishikawa
50989430cd boards: sabre-6quad: Enable DEBUG_ASSERTION in citest
Summary:
- Since QEMU does not report L2CC information correctly,
  NuttX stops if DEBUG_ASSERTIONS=y.
- This commit adds DEBUG_ASSERTIONS=y to citest/defconfigs
  and disables L2CC related configs.
- Also, it disables RAMLOG to show the crash information

Impact:
- None

Testing:
- Tested with QEMU-7.1

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-02-06 18:26:05 +08:00
dependabot[bot]
9d8f7de81c build(deps): bump docker/build-push-action from 3 to 4
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3 to 4.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-06 12:18:12 +08:00
Stuart Ianna
a2a542562f fs: Implment link as a normal function instead macro
so "using ::link;" can pass the compiling. This change also
simplify the implementation of the hard link in the future.
2023-02-04 18:31:23 -03:00
Lucas Saavedra Vaz
1e3af48fff arch/xtensa/esp32s2: Add support for RTC IRQs 2023-02-04 18:28:10 -03:00
Lucas Saavedra Vaz
7df663bff8 docs/boards/esp32s2-saola-1: Fix watchdog example 2023-02-04 18:28:10 -03:00
wangbowen6
a11cb59af6 tc32/Make.defs: fix build break after merge unblock/block_task
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2023-02-04 18:25:58 -03:00
wangbowen6
f925e17f18 tlsr82/backtrace: tc32 backtrace bug fix
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2023-02-04 18:25:58 -03:00
Xiang Xiao
83764079a1 boards/sim: Enable CONFIG_ARCH_MATH_H for libcxxtest
to undefine __GLIBC__, otherwise libcxx misthink it work with glibc

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-04 21:00:54 +02:00
chao an
d03b105160 drivers/syslog: correct Kconfig name
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-05 01:05:32 +08:00
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