Commit Graph

6201 Commits

Author SHA1 Message Date
Petro Karashchenko
a8f4a89221 signal: add SIGSYS
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-03-28 11:24:35 -06:00
Gregory Nutt
717bb04cb7 Increase the number of real time signals. Two is not enough.
Refer to issue #8867 for details and rational.

Convert sigset_t to an array type so that more than 32 signals can be supported.

Why not use a uin64_t?
- Using a uin32_t is more flexible if we decide to increase the number of signals beyound 64.
- 64-bit accesses are not atomic, at least not on 32-bit ARMv7-M and similar
- Keeping the base type as uint32_t does not introduce additional overhead due to padding to achieve 64-bit alignment of uin64_t
- Some architectures still supported by NuttX do not support uin64_t
  types,

Increased the number of signals to 64. This matches Linux. This will support all xsignals defined by Linux and also 32 real time signals (also like Linux).

This is is a work in progress; a draft PR that you are encouraged to comment on.
2023-03-27 16:59:04 +03:00
Xiang Xiao
bc3e6c84e1 arch: Rename up_[early]serialinit to [arm64|riscv|x86_64][early]serialinit
The naming standard at:
https://cwiki.apache.org/confluence/display/NUTTX/Naming+of+Architecture%2C+MCU%2C+and+Board+Interfaces
requires that all MCU-private function begin with the name of the architecture, not up_.

follow the change from: https://github.com/apache/nuttx/pull/930

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-27 12:35:04 +03:00
Xiang Xiao
beb38917d1 signal: Replace NuttX special SIGWORK with SIGPAGING(SIGRTMIN)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-26 08:31:36 -06:00
Xiang Xiao
5ce5d01d75 signal: Remove configurable assignment of signal numbers
please reference the issue here for more information:
https://github.com/apache/nuttx/issues/8898

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-26 08:31:36 -06:00
Xiang Xiao
c9b917bcee assert.h: Replace NULL with 0 to avoid including stddef.h
Fix error: 'NULL' undeclared if user include assert.h only

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-24 13:13:43 -06:00
raiden00pl
50cf84c99a usbdev-composite: ep0 submit should be send only once for the composite class 2023-03-24 14:54:31 -03:00
raiden00pl
0b4b35c80a include/nuttx/usb/usbmsc.h: fix compiler error when USBMSC_COMPOSITE=y
usbdev/usbmsc.c:1758:5: error: conflicting types for 'usbmsc_classobject'; have 'int(void *, struct usbdev_devinfo_s *, struct usbdevclass_driver_s **)'
 1758 | int usbmsc_classobject(FAR void *handle,
      |     ^~~~~~~~~~~~~~~~~~
In file included from /home/raiden00/git/RTOS/nuttx/nuttx/include/nuttx/usb/usbdev.h:36,
                 from usbdev/usbmsc.c:68:
/home/raiden00/git/RTOS/nuttx/nuttx/include/nuttx/usb/usbmsc.h:173:5: note: previous declaration of 'usbmsc_classobject' with type 'int(void *, struct usbdev_devinfo_s *, struct usbdevclass_driver_s **)'
  173 | int usbmsc_classobject(FAR void *handle,
2023-03-24 17:23:24 +02:00
Petro Karashchenko
5651715486 signal: remove unused SIGCONDTIMEDOUT
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-03-23 17:17:25 -06:00
Gregory Nutt
104a7d4e00 Correct Real Time signal definitions.
There are number problems with the implementation of realtime signals in NuttX as discussed in Issue #8869.  A first step to correcting any of these is to correct the definitions of SIGRTMIN, SIGRTMAX, and RTSIG_SIX.

SIGRTMIN is the first real-time signals.  Real-time signal numbers must not overlap the standard signal numbers.  Before this fix, it was set equal to the first standard signal.  Real-time signals differ from standard signals in that (1) they have no default actions, and (2) real time signal actions are prioritized whereas standard signal actions are processed FIFO.

SIGRTMAX is the last real-time signal.

RTSIG_MAX must be set equal to maximum number of realtime signals reserved for application use

The change corrects the definitons but has not impact at all becasuse none of there definitions are currently used in the OS.  But they will be when prioritized real time signal handling is implemented.
2023-03-23 21:56:13 +02:00
chao an
1b46484849 mmcsd/sdio: fix potential race condition in sdio
sdio driver should ensure the thread safety

Signed-off-by: chao an <anchao@xiaomi.com>
2023-03-21 14:40:44 -03:00
Lucas Saavedra Vaz
326261dd7d drivers/audio/es8388: Add input support 2023-03-21 12:13:59 -03:00
yinshengkai
64e7e43f1f drivers/note: adjust the note_driver_ops definition
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-03-21 12:13:38 -03:00
yinshengkai
cb06ad5ec4 note: fix sched_note_begin/end parameter error
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-03-21 12:13:38 -03:00
yinshengkai
926bfe5818 include/assert: fix nxstyle
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-03-21 12:09:45 -03:00
yinshengkai
216483f96b include/compiler: replace likely to predict_true
likely is defined repeatedly in an external library

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-03-21 12:09:45 -03:00
chao an
c839fc45af libc/settimeofday: correct prototype of settimeofday()
Signed-off-by: chao an <anchao@xiaomi.com>
2023-03-21 11:16:30 -03:00
ligd
bb281eedfa cache: add up_get_xcache_linesize() support
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-03-20 17:17:22 +08:00
Xiang Xiao
b63994b7f7 drivers/serial: Always support c_oflag, c_iflag and c_lflag in termios
CONFIG_SERIAL_TERMIOS only decide whether to support c_cflag field since
many terminal application need the first three fields to work correctly.
For more information please reference:
https://www.mail-archive.com/dev@nuttx.apache.org/msg09321.html

before this change(olimexino-stm32:tiny):
   text    data     bss     dec     hex filename
  34884     328    1768   36980    9074 nuttx
after this change:
   text    data     bss     dec     hex filename
  35052     340    1768   37160    9128 nuttx
delta
   text    data     bss     dec     hex filename
    168      12       0     180      b4 nuttx

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-19 14:54:59 -06:00
zhanghongyu
d9e009cb46 icmpv6: add route advertise RDNSS field handle when icmpv6_input
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-03-17 16:50:37 -03:00
raiden00pl
a6c1ef3c52 wireless/bluetooth: add RPMSG HCI controller support 2023-03-14 09:51:13 +08:00
Michal Lenc
c4d8bbd190 pwm.h: add comment regarding possible channel numbers
PWM drivers use channel numbers 0 and -1 to skip the channel and/or
all following channels. This situation is well established in the drivers
however it was not mentioned in pwm.h file. This commit adds a comment
mentioning it.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-03-11 11:37:04 +01:00
Zhe Weng
7b0d80c94a net/icmpv6: align structs to 2 bytes.
Fix following misaligned errors:

icmpv6/icmpv6_radvertise.c:145:21: runtime error: member access within misaligned address 0x573da9e6 for type 'struct icmpv6_router_advertise_s', which requires 4 byte alignment
0x573da9e6: note: pointer points here
 00 00 00 01 85 00  d6 14 00 00 00 00 01 01  12 8c 25 08 9c f8 04 00  00 00 ff 02 00 00 00 00  00 00
             ^
icmpv6/icmpv6_radvertise.c:167:21: runtime error: member access within misaligned address 0x573da9fe for type 'struct icmpv6_mtu_s', which requires 4 byte alignment
0x573da9fe: note: pointer points here
 af 78 ab 72 00 00  00 00 00 00 00 01 ff 00  00 01 04 00 00 00 ff 02  00 00 00 00 00 00 00 00  00 01
             ^
icmpv6/icmpv6_radvertise.c:176:23: runtime error: member access within misaligned address 0x573daa06 for type 'struct icmpv6_prefixinfo_s', which requires 4 byte alignment
0x573daa06: note: pointer points here
 00 00 05 dc ff 00  00 01 04 00 00 00 ff 02  00 00 00 00 00 00 00 00  00 01 ff 08 9c f8 04 00  00 00
             ^

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-03-10 09:41:02 +01:00
Petro Karashchenko
ab196aebe4 include/nuttx/mm: remove FAR from non-pointer types
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-03-09 16:27:07 -03:00
Petro Karashchenko
4581a84064 nuttx: fix indentation issue
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-03-09 16:27:07 -03:00
Xiang Xiao
75ecbd4382 net/local: Return the unblock handle correctly in local_accept
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-09 09:17:19 +01:00
Zhe Weng
cd1decf4a5 mm/iob: Support neg offset in iob_clone
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-03-08 23:09:25 +02:00
Michal Lenc
88f3d89920 pwm: add configuration option for dead time generators
PWM drivers usually supports dead time generators that automatically
insert output activation delay for complementary PWM outputs. This
is usefull for some control purposes as control of H bridge for example.

This commit adds an application to driver interface that can be used
to set up those delays (if supported by the selected architecture)
directly from the application. The set up remains the same as for duty
cycle value.

The whole addition is by default disabled. It can be enabled by config
option PWM_DEADTIME.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-03-07 01:30:01 +08:00
Xiang Xiao
9308a72419 vfs/poll: Remove the unused ptr field from pollfd
forget in the commit:
commit 0a95c7721b
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date:   Fri Nov 11 03:47:07 2022 +0800

    vfs/poll: Remove POLLFILE and POLLSOCK NuttX specific extension

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-06 13:19:42 +02:00
yinshengkai
da4e2671f5 trace: Add kernel tracepoint support
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-03-04 12:57:48 +08:00
Huang Qi
68384e9db4 drivers/serial: Echo input in driver layer
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-03 11:37:41 +08:00
Huang Qi
dfc70b1ddb libc/stdio: Implement lib_get_stream
Use lib_get_stream() to fetch stdin/stdout/stderr,
since is more easy to works with other language by function call
than export native C structure memory layout.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-02 09:56:57 +01:00
Xiang Xiao
92b2f1bd3d fs: Undefine CONFIG_FS_LARGEFILE if compiler doesn't support long long
to simplify the large file check in many place

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-02 09:37:58 +01:00
Huang Qi
c4156ba4e5 lib.h: Remove forward declaration for streamlist
Since <nuttx/fs/fs.h> included already.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-02 13:32:44 +08:00
yinshengkai
67461175fe note: support note filtering at runtime
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-03-01 22:09:41 +08:00
huxiandong
266455f01c mtd: Extend isbad and markbad func for mtd_dev_s
Signed-off-by: huxiandong <huxiandong@xiaomi.com>
2023-03-01 10:06:56 -03:00
Huang Qi
b96035885a stdio: Implement simple buffered out stream for vdprintf
Improve performance for raw fd based printf like operation.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-01 13:08:59 +09:00
YAMAMOTO Takashi
892ecb4e40 Make 64-bit time_t unsigned
* 32-bit time_t should be unsigned because otherwise it wraps too
  soon. (in 2038)

* 64-bit time_t should be unsigned because it should be consistent
  within NuttX.

* While signed time_t seems more popular among other OSes, the
  consisitency within NuttX outweighs, IMO.
2023-02-27 23:55:52 +08:00
Xiang Xiao
2c5f653bfd Remove the tail spaces from all files except Documentation
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-26 13:24:24 -08:00
wangbowen6
d77b53957c sched/env: add tg_envc in task_group_s to avoid some loops in code
this commit optimize the env api speed

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2023-02-25 23:10:37 +02:00
yinshengkai
f9f0ab8dc4 drivers: add note driver backend for recording scheduling information
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-02-25 18:39:27 +08:00
chenrun1
4f3c73fb45 libc/lib_bzero:Add bzero prototype.
Implement the bzero function as an alternative to macro expansion.
2023-02-25 08:07:07 +02:00
pengyiqiang
621bf54efc drivers/video/fb: fix poll event lost
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2023-02-24 22:21:09 +08:00
lilei19
38f64f559d change strcpy to strlcpy
Signed-off-by: lilei19 <lilei19@xiaomi.com>
2023-02-24 12:15:40 +08:00
chenrun1
e6227e1943 include/signal.h:Expanding SIGNAL to be consistent with Linux 2023-02-24 04:07:10 +08:00
chenrun1
5430de72f8 libc/lib_rawmemchr.c:Add rawmemchr methon. 2023-02-24 04:06:04 +08:00
yinshengkai
cb594a4c9c include: add branch prediction for assert
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-02-23 22:35:33 +08:00
yinshengkai
ecdaeddfcd include: add likely and unlikely for branch prediction
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-02-23 22:35:33 +08:00
yinshengkai
55ce5d0511 note: remove SCHED_INSTRUMENTATION_HIRES
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-02-23 22:30:07 +08:00
wangbowen6
7a4bd09e48 execinfo.h: include nuttx/sched.h instead sched.h
beacause _SCHED_GETTID is in nuttx/sched.h, when use dump_stack()
compile error log:
unqlite.c:51256: undefined reference to `_SCHED_GETTID'

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2023-02-23 14:24:32 +08:00