Commit Graph

5744 Commits

Author SHA1 Message Date
anjiahao
1a5351edac libc:add timingsafe_bcmp to libc
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-09-05 22:27:05 +08:00
anjiahao
21934122d5 include:endian.h add openbsd style
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-09-05 10:39:36 -03:00
Michal Lenc
8e2b4576bf sensors/qencoder: add QEIOC_GETINDEX ioctl
This IOCTL (QEIOC_GETINDEX) allows the application to get the actual
encoder position, the index last position and the index count with
one IOCTL call if supported by architecture specific level.

The position, index and count is passed to application level through
qe_index_s structure.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2022-09-04 11:08:45 +08:00
zhangyuan21
1a9252aec9 nuttx/queue: change some queue function to macro 2022-09-04 11:08:02 +08:00
Xiang Xiao
71af0b5295 list.h: Change inline function to macro as much as possbile
since C89 doesn't support inline keyword:
https://github.com/apache/incubator-nuttx/issues/6896

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-31 09:01:02 +02:00
Junbo Zheng
c947ddd441 include/nuttx/list.h: support list entry macro
Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2022-08-31 09:01:02 +02:00
Huang Qi
7e316d0ba9 compiler.h: Add a new attribute nosanitize_undefined
This allow us to disable UBSan for particular function.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-08-30 19:35:24 +08:00
Xiang Xiao
3b0516f6a2 libc/crc: Add full suffix to avoid the the penitential symbol collision
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-29 18:06:53 +02:00
xiaoxiang
5548676ab5 sched: Fix macro "SCHED_NOTE_PRINTF" requires 3 argumnets, but only 1 given
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-08-29 12:04:50 +02:00
chengkai
7a7b5e5779 wireless/bluetooth:add bt bridge codes
Signed-off-by: chengkai <chengkai@xiaomi.com>
2022-08-27 15:57:30 +08:00
Gustavo Henrique Nihei
5ed2ee85c9 arch: Improve documentation for up_fpucmp function
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-08-26 11:57:06 +08:00
chao.an
9cb17841d8 net/sockopt: move BINDTODEVICE to socket level
rename the UDP_BINDTODEVICE to SO_BINDTODEVICE to follow the linux
style to be compatible with non-UDP protocol binding requirements

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-08-25 17:56:52 +08:00
chengkai
d78ffeca71 serial/uart/h4: add ioctl interface
Signed-off-by: chengkai <chengkai@xiaomi.com>
2022-08-24 21:42:58 +08:00
chengkai
841d8f5b37 net:add btsnoop and snoop
Signed-off-by: chengkai <chengkai@xiaomi.com>
2022-08-24 21:42:30 +08:00
chengkai
4ee39f6e9a libc: add lib_dump utils
Signed-off-by: chengkai <chengkai@xiaomi.com>
2022-08-24 16:58:10 +08:00
chengkai
0334a35288 wireless/bluetooth:add btsnoop open-close ioctl cmd
1. SIOCBTSNOOPOPEN: open btsnoop
2. SIOCBTSNOOPCLOSE: close btsnoop

Signed-off-by: chengkai <chengkai@xiaomi.com>
2022-08-24 11:13:40 +08:00
Xiang Xiao
d22e1e1998 compiler.h: Add nosanitize_address macro
and replace all __attribute__((no_sanitize_address)) with it

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-23 17:50:52 +02:00
Xiang Xiao
0334819742 net/usrsock: Change xid from uint64_t to uint32_t
by generating the new xid for each transaction

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-23 12:16:33 -03:00
Xiang Xiao
27e8d058e7 sched: Simplify the cpuload process
1.Forward nxsched_process_cpuload to nxsched_process_cpuload_ticks directly
2.Define the dummy nxsched_process_cpuload_ticks when CPULOAD isn't enabled
3.Remove the weak attribute from nxsched_process_cpuload_ticks

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-18 22:11:29 +03:00
chao.an
5dd5d177ae sched: fix visual studio Compiler Error C2010
D:\code\incubator-nuttx\include\nuttx/sched_note.h(710,1):
  error C2010: “.”: unexpected in macro formal parameter list
  [D:\code\incubator-nuttx\vs20225\sched\sched.vcxproj]

Compiler Error C2010: 'character' : unexpected in macro formal parameter list

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

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-08-18 12:05:16 +08:00
Michał Łyszczek
4e967c67b4 stm32wl5: fix unbuffered mode and other possible bugs
This patch fixes unbuffered mode so it actually works.

Also, patch contains fixes for possible bugs that could result in
deadlock or system hang in certain situations.

Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
2022-08-18 11:46:38 +08:00
chao.an
14fb56c799 netdev: fix visual studio Compiler Error C2016
D:\code\incubator-nuttx\include\nuttx/net/netdev.h(275,3):
  error C2016: C requires that a struct or union has at least one member
  [D:\code\incubator-nuttx\vs20222\boards\board.vcxproj]

Compiler error C2016: C requires that a struct or union has at least one member

Reference:
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-errors-c2001-through-c2099?view=msvc-170

Signed-off-by: xiangdong6 <xiangdong6@xiaomi.com>
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-08-17 21:38:30 +08:00
wangbowen6
52a1692cfa rpmsgdev: add rpmsg-device support.
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-08-17 18:33:58 +08:00
Duane Skelton
df4b8adacf Added extern C {} wrapper consistent with other headers in include/sys 2022-08-16 12:04:01 +08:00
anjiahao
beb9144141 include:add sys/queue.h support form openbsd
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-08-16 12:03:45 +08:00
zhanghongyu
b80b4831e0 wireless: Add ioctl cmd to setting PTA prio
info:
https://docs.silabs.com/wifi/wf200/content-source/application-note/wifi-coexistence#pta-state-request

Is the PTA priority enumeration type sufficient?

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-08-15 23:15:45 +08:00
Xiang Xiao
ba9486de4a iob: Remove iob_user_e enum and related code
since it is impossible to track producer and consumer
correctly if TCP/IP stack pass IOB directly to netdev

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-15 08:41:20 +03:00
curuvar
e247eaf3e8 Add gSPI mode support for Infineon CYW43539 2022-08-15 10:31:36 +08:00
Nathan Hartman
0892c895fc ioexpander: Fix typos in comments
include/nuttx/ioexpander/gpio.h:
* Fix some typos in comments.
2022-08-15 10:25:11 +08:00
Nathan Hartman
9d5a91c41a ioexpander: Honor C89 standard 2022-08-15 10:24:39 +08:00
luojun1
4e62772be5 modify iob to support header padding and alignment features
Signed-off-by: luojun1 <luojun1@xiaomi.com>
2022-08-14 21:00:28 +08:00
Tiago Medicci Serrano
ab60d0d3fb Framebuffer's callback buffer starts from the area being drawn.
The commit 664d45dcba updated the
behavior of the framebuffer's putarea callback enabling it to be
used to draw a particular area of the display. Previously, putarea
was only used to draw the entire area of the display. Any different
area was drawn, row by row, by putrun. Also, before checking for
which callback to call, the framebuffer driver adjusted the buffer
reference that was going to be used for calling the driver's callback
to point to the init of the relevant data. After that commit, the
framebuffer's buffer reference passed to the driver's putarea now
contains the data to draw the entire display. Unlike the previous
version of that implementation, only the putrun's callback buffer
was being referenced from the address that contains the data that
actually is being drawn.

This commit fixes it by adjusting the reference for the run buffer
passed to the putrun/putarea callback. It always starts from the
beginning of the relevant data that is actually being drawn. That is
necessary because lcddev (which uses the same LCD display driver
callbacks) actually don't allocate a buffer containing the data to
draw the whole display, so the same putarea implementation of the
LCD drivers would'n be able to work for both lcddev and framebuffer.
Also it's necessary to pass the stride argument to the LCD drivers
in order to enable them to do partial writes by calculating the
buffer offset while sending row-by-row. The stride is equal the
width multiplied by the bytes per pixel (may add some padding)
for framebuffer and is equal to the lenght of the row being drawn
(multiplied by the same BPP) for lcddev.

Why this approach?
Other possible approaches would be:
1) modify lcddev driver to translate received buffer data to a
buffer similar to the framebuffer. That wouldn't be efficient
considering memory allocation.
2) Create a new callback function. While possible, it'd be confusing
to create a different callback to draw the whole screen and another
to draw only an area of the screen. Also, these callbacks would
differ themselves only from the way the buffer is filled.
3) Simply reverting 664d45dcba would
break the usage of the putarea callback to draw an area of the
display, which would also be inefficient.

This approach is based on the Zephyr's implementation of the ST7789
driver: the buffer starts from the beginiing of the region that would
be drawn. The display device driver's putarea implementation should
check if the operation refers to a full screen/full row and implement
(if possible) a single operation to send the data to be drawn more
efficiently.

Finally, this approach requires that the drivers which implement
the putarea callback and expects the entire framebuffer buffer
to be modified. They don't need to calculate where the data begins
as the new buffer represents the data from the address that is
actually being drawn. This includes adjusting the LCD drivers
GC9A01 and ST7789 and the driver for APA102-based LED matrix display.
2022-08-13 20:36:45 +08:00
Xiang Xiao
2b37909c9e libc: Move crc8.h, crc16.h and crc32.h from include to include/nuttx
to avoid the conflict with the 3rd party library

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-13 13:28:24 +03:00
Xiang Xiao
5f93ae9dd2 fs/rpmsg: Move the server initialization to fs_initialize
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-11 02:08:42 +03:00
Jiuzhu Dong
aeec797511 syscall: remove directory syscall
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-10 13:33:08 +08:00
Xiang Xiao
fa2e1897ea libc: Implement memfd on top of tmpfs
https://man7.org/linux/man-pages/man2/memfd_create.2.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-09 22:13:09 +03:00
Jiuzhu Dong
4dbf4555eb fs/dir: support fchdir and dirfd
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-09 23:30:01 +08:00
Jiuzhu Dong
fe17f747a7 fs/directory: move private directory information to filesystem
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-09 23:30:01 +08:00
Jiuzhu Dong
90db4daca9 fs/directory: update readdir interface for all filesystem
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-09 23:30:01 +08:00
Jiuzhu Dong
3a70962b7a fs/directory: use file mode to manage directory
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-09 23:30:01 +08:00
Jiuzhu Dong
094e986bbd fcntl/O_CLOEXEC: add O_CLOEXEC map for hostfs
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-09 23:30:01 +08:00
Jiuzhu Dong
c18b5602e8 fs/procfs: add mempool info to proc/mempool
server> cat /proc/mempool
                   total    bsize    nused    nfree   nifree  nwaiter
       hello:        400       20       17        3        0        0

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-09 15:38:57 +08:00
Jiuzhu Dong
e3bbbfe4d0 mm/mempool: support memory buffer pool
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-09 15:38:57 +08:00
Jiuzhu Dong
c4bed9eae9 driver/sensor: rename /dev/sensor -> /dev/uorb
because this directory contains all topics by uorb using, not just sensors.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-08 19:45:52 +08:00
Xiang Xiao
16d858f3ee libc/err: Add _func suffix to avoid the the penitential symbol collision
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-08 07:39:59 -04:00
Xiang Xiao
e26d8759d0 libc: Remove CONFIG_LIBC_ERR
let linker remove the unused object files from the final image

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-08 07:39:59 -04:00
sheyunhu
a623b5f31e tls: fix conflicting types for 'up_tls_initialize' compilation problem
Signed-off-by: sheyunhu <sheyunhu@xiaomi.com>
2022-08-05 08:45:11 +03:00
Peter van der Perk
f64677b8c9 Add Embedded Template Library (ETL) support 2022-08-05 09:38:48 +08:00
liyi
0083a2e4f2 optimize UNUSED macro
Signed-off-by: liyi <liyi25@xiaomi.com>
2022-08-04 16:34:45 +08:00
Xiang Xiao
306431d16f list: Remove the unnecessary ? : operator
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-02 18:50:46 +03:00