Commit Graph

6897 Commits

Author SHA1 Message Date
yinshengkai
f25a506f91 include: When defining NDEBUG, assert will implement alignment standards
As defined by the C standard, if NDEBUG is defined, assert should do nothing but be simply defined as:

  #define assert(ignore) ((void)0)

Reference link:
https://pubs.opengroup.org/onlinepubs/009695399/basedefs/assert.h.html

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-05-17 10:18:16 -03:00
dulibo1
3762bda5e2 pm: procfs add pm prepare fail stats
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-05-17 19:07:44 +08:00
Nicolas Lemblé
03dbb82db9 Add c symbols to std 2024-05-16 10:25:01 -03:00
shizhenghui
ed1ad1be65 Add v4l2m2m & sim decoder
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-05-15 22:03:18 +08:00
shizhenghui
03c756dd74 videoio: modify data type of v4l2_buffer from uint32_t to uint16_t
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-05-15 22:03:18 +08:00
shizhenghui
fecf2039d8 videoio: modify the v4l2_pix_format type is the same as mplane
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-05-15 22:03:18 +08:00
simbit18
360c2fc44c fix nxstyle
Remove TABs
fix Relative file path does not match actual file.
2024-05-15 21:53:59 +08:00
zhanghongyu
53a72a31fb sys/socket.h: add the definition of SCM_TIMESTAMP.
Third-party library lcm will use SCM_TIMESTAMP macro definition

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-05-15 16:12:10 +08:00
Zhe Weng
c234fac910 net/netdev: Check quota when registering lower-half devices
Some drivers may set too big quota by accident and consume all of our
buffers, so we add a check when registering devices.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-05-14 17:43:26 -03:00
meijian
4702a09538 net/netlink: Add RTM preifx notify support
Signed-off-by: meijian <meijian@xiaomi.com>
2024-05-14 10:05:37 -03:00
chao an
66509e490e sched/mqueue: add support of tick based send() and receive()
Add tick based send()/receive() to reduce the cost of time conversion

Signed-off-by: chao an <anchao@lixiang.com>
2024-05-14 00:32:13 +08:00
hujun5
90f9ffc2e8 sched/sched: CONFIG_SCHED_RESUMESCHEDULER macro define error
we removed "select SCHED_RESUMESCHEDULER",
As SCHED_RESUMESCHEDULER is not a necessary feature in SMP,
turning it on by default may affect performance.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-05-09 01:39:47 +08:00
Stuart Ianna
c4dbabb1bb drivers/devicetree: Add a set of commonly used FDT utilities. 2024-05-09 01:37:11 +08:00
Yanfeng Liu
ce8cfde768 nuttx/sched.h: minor revision on comments
This is mainly to align them better.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-05-08 15:41:28 +08:00
zhanghongyu
908814a575 libc/lib_bzero:Add bzero prototype.
Implement the bzero function as an alternative to macro expansion.

and 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: zhanghongyu <zhanghongyu@xiaomi.com>
2024-05-07 14:59:05 +02:00
simbit18
0e67a79b94 fix nxstyle
corrected comments in C89 style
2024-05-03 14:15:56 -03:00
Yanfeng Liu
0f5ba00a50 mm/map: revise device mapping functions
This revises vm_map_region() by accepting unaligned paddr, which is
aligned-down before mapping and in-page offset is then added to vaddr
before returning. It also moves vm_map_region() and vm_unmap_region()
to vm_region.c.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-05-03 23:58:39 +08:00
Jukka Laitinen
9277be2503 Add configuration option for RTL8211F RGMII PHY
Also extend the "struct phy_desc_s" to support for 1GB PHY's, the speed
detection always needs more than one bit.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-05-02 16:30:41 -03:00
yinshengkai
b87804c2ba libc/string: replace __builtin_ffsl with inline function
In the gcc-riscv compiler, __builtin_ffs will call ffs, and calling __builtin_ffs in ffs will cause recursion

Change ffs to an inline function, and compile ffs implemented by nuttx by default.
Only call the implementation of nuttx when the compiler cannot provide an ffs implementation.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-04-30 19:47:08 +08:00
Philippe Leduc
3dc6b4c9bd Add basic support for locales in order to C++ streams to build and work for simple cases (POSIX / C locale).
Fix build with C++ GCC toolchain
2024-04-29 17:34:10 +08:00
anjiahao
0040e9a239 drivers/serial:support arm cmsdk drivers
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-04-26 18:42:35 -03:00
Yanfeng Liu
3822d88669 mm/arch: userspace device mapping support
This patch adds definitions to support user space device mappings
that allows devices like frame buffer to be accessible from user
space in kernel mode.

The are mainly two changes:

- in `mm/`:
  added vm_map_region(), vm_unmap_region() for drivers to do
  device mapping easily.
- in `arch/`:
  extended ARCH_SHM_NPAGES as user-space mapping region size.
  decoupled ARCH_SHM_MAXREGIONS from region size calculations and
  limit its usage only for SysV shm purposes.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-04-26 12:11:35 +08:00
zhanghongyu
b934555fd1 mm/iob: Support alloc IOB via malloc
Support the network interface card driver to receive zero copies of packets and send and receive giant frame packets, allowing drivers to initialize the DMA buffer to the iob structure, and we can apply for IOB with large memory

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-04-26 01:06:21 +08:00
zhanghongyu
00d208baf6 mm/iob: replace CONFIG_IOB_BUFSIZE to IOB_BUFSIZE(iob)
Variable length iob can be supported

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-04-26 01:06:21 +08:00
Zhe Weng
918e38419a netfilter.h: Include <netinet/in.h> for struct in_addr
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-24 08:41:28 +02:00
Zhe Weng
6beb459a43 netfilter: Move IP6T_F to correct file
Ref: https://github.com/torvalds/linux/blob/v6.7/include/uapi/linux/netfilter_ipv6/ip6_tables.h#L91-L95

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-24 08:41:28 +02:00
Juha Niskanen
3348d03f95 libs/libc/inttypes: add support for imaxdiv
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2024-04-23 10:26:48 -03:00
raiden00pl
41803a0c20 sensors/bh1749nuc: add support for the new sensor framework
bh1749nuc can be used with the new sensor framework
2024-04-21 14:48:28 -03:00
dongjiuzhu1
7c4e3aff14 drivers/usbdev/mtp: fix compile break
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-21 23:24:40 +08:00
dongjiuzhu1
e7fd416f9f drivers/usbdev: support config pid/vid by soft interface
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-21 23:24:40 +08:00
dongjiuzhu1
e5a925543b drivers/usbdev: fix double free when cdcacm uninitialize with not used
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-21 23:21:54 +08:00
dongjiuzhu1
ad59ef075f drivers/usbdev: remove first uninitialization and release resouce once.
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-21 23:21:54 +08:00
dongjiuzhu1
9c55f21a6f drivers/cdcacm/serial: add release interface to release uart_dev resource
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-21 23:21:54 +08:00
raiden00pl
5af805b2ef sensors/bmi270: add support for the new sensor framework
bmi270 can be used with the new sensor framework
2024-04-21 19:06:18 +08:00
raiden00pl
3d765616ea sensors/adxl372: add support for the new sensor framework
adxl372 can be used with the new sensor framework
2024-04-21 18:57:33 +08:00
raiden00pl
db7c8be61f sensors: add support for bmm150 magnetometer
add support for Bosch BMM150 Magnetometer
2024-04-20 16:20:43 -03:00
raiden00pl
ebcf25b2f6 sensors: add support for adxl362 accelerometer
add support for Analog Devices ADXL362 accelerometer
2024-04-20 11:47:50 -03:00
Zhe Weng
3a844d8dd7 net/netlink: Add NETLINK_NETFILTER's CONNTRACK support
Now we only supports conntrack info from NAT entries, to let our apps in user space know the mapping status in NAT.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-18 13:03:59 +08:00
Michal Lenc
9798674f27 libc: add support for reallocarray
This commit adds support for reallocarray function. The functionality
is the same as for standard realloc, but the function also checks for
multiplication overflow and fails safely in case it occurs.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-04-17 11:36:39 -03:00
Xiang Xiao
81c8f902b6 video: Move video_format_s from video.h to v4l2_cap.c
since it is only used in v4l2_cap.c.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-04-14 12:08:30 -03:00
Jakub Janousek
23c6b5b07d drivers/spi: Add support for FPGA iCE40 bitstream loading.
Tested on ICE-V-Wireless board.

Signed-off-by: Jakub Janousek <janouja9@fel.cvut.cz>
2024-04-12 10:19:58 -03:00
jianglianfang
62a4799409 video/vnc: add vnc_fb_register
To optimize the initialization of vnc, change it to vnc_fb_register.

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-04-12 17:42:49 +08:00
hujun5
638716504d fdcheck: update fdcheck impl
1 store fd in the high position
2 removing the pid information , as the tag information is sufficient.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-04-11 10:45:44 +08:00
ligd
3844efb5b8 stack: update up_get_intstackbase API to support cpu id
For crash dump all the CPU intstack

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-04-09 16:59:00 -03:00
chao an
09e5dca965 sched/pthread: detached thread should destroy the join info
In order to ensure the detached thread obtain the correct return
value from pthread_join()/pthread_cancel(), the detached thread
will create joininfo to save the detached status after thread
destroyed.  If there are too many of detached threads in the
process group, the joininfo will consume too much memory.
This is not friendly to embedded MCU devices.
This commit keep the semantics as #11898 was introduced,
will no longer save joininfo for detached threads to avoid wasting memory.

Signed-off-by: chao an <anchao@lixiang.com>
2024-04-09 13:46:51 +08:00
Pressl, Štěpán
21de46a4d1 include/nuttx/timers/pwm.h: add dcpol attribute to pwm_chan_s
This attribute can set the default polarity of a disabled channel.
2024-04-05 17:14:23 -03:00
Michal Lenc
17e1d43f6d ioexpander/icjx: add support for change of input interrupts on NINT
iC-JX expander has NINT (not interrupt) pin that goes to logical zero
if interrupt occurs. This commit adds support for iC-JX options settings
that allows to enable the interrupt for defined input pins.

The interrupt is handled in HP worker thread to avoid waiting for SPI
transfers in interrupt context. Board has to configure interrupt event
for GPIO pin connected to NINT.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-04-05 15:23:10 -03:00
Yanfeng Liu
7523654386 mm/map.h: minor revision on comments and field defs
This patch uses "struct mm_map_entry_s" instead of the non-existing
"struct mm_map_entry" with minor revision on comments.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-04-03 10:15:48 -03:00
chao an
ad4fb55d1f sched/environ: Improve performance of set/unset environment
reserve dimensional array of environment to avoid frequent scaling

Signed-off-by: chao an <anchao@lixiang.com>
2024-04-03 00:10:56 +08:00
chao an
f732428331 board/control: add irq affinity control
add support for set an IRQ affinity to CPUs by software

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-30 12:21:25 +08:00