Commit Graph

6058 Commits

Author SHA1 Message Date
Peter Bee
77504aa1b5 drivers/video: minor fix
Fix missing header for bool in imgsensor.h and FAR in video.c

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-09 23:37:49 +08:00
tangyusong1
f454dfccb2 Adjust ioctl function of cellular
Add SIOCGCELLNETDEV
Give a uint8_t[136] for cellular to save data

Signed-off-by: tangyusong1 <tangyusong1@xiaomi.com>
2022-12-09 11:19:55 +08:00
Peter van der Perk
f72f7ebee0 Sysview add prefix kconfig to add an option to decouple sched_note calls 2022-12-08 17:49:55 +01:00
tangyusong1
1c7a9d282c Add mtu set and interface name set in ioctl
Follow LinuxOS:linux-5.10.152\include\uapi\linux\sockios.h
Add SIOCSIFMTU and SIOCSIFNAME

Signed-off-by: tangyusong1 <tangyusong1@xiaomi.com>
2022-12-08 13:58:26 +01:00
Peter Bee
31347da187 drivers/video: add support for V4L2 mmap-ed buffer
Support V4L2_MEMORY_MMAP memory mode

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-07 01:21:46 +08:00
田昕
2719869ab2 Move _assert to kernel space.
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-12-06 18:33:21 +08:00
Zhe Weng
2a780e0467 net/ipfwd: fix devif_forward after IOB offload.
Problem:
- `iob_copyout` to `d_buf` doesn't set `io_len` of the IOB, so `devif_poll` failed to copy the data into `buf` by `iob_copyout`

Modification:
- Just Move the IOB in `devif_forward`.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2022-12-06 17:03:47 +08:00
chao an
b5507ea9a2 compile/attribute: minor fix for packed struct mismatch
Signed-off-by: chao an <anchao@xiaomi.com>
2022-12-06 03:50:20 +08:00
田昕
b9c913a195 include/nuttx/notifier:fix compiling error.
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-12-06 00:12:41 +08:00
Xiang Xiao
055f1f33eb libc/stream: Rename [lib_stream_](put|get) to [lib_stream_](putc|getc)
to make the naming style consistent with each other

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 14:27:55 +01:00
Xiang Xiao
83c4e7d9b6 libc/hex2bin: Remove the unused declaration
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 10:42:22 +01:00
Xiang Xiao
43bda3282f net/arp: Move arp_ipin and arp_out to private header file
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-04 20:39:21 +08:00
Xiang Xiao
c6e9edcbb6 net: Rename arp_arpin to arp_input
align with other similar function(e.g. ipv4_input and ipv6_input)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-04 20:39:21 +08:00
chao an
62004a28a6 net/d_buf: remove d_buf reference from l3/l4
l3/l4 stack will decouple the reference of d_buf gradually, Only legacy
devices still retain d_buf support, new net devices will use d_iob

Signed-off-by: chao an <anchao@xiaomi.com>
2022-12-04 20:37:14 +08:00
chao an
34d2cde8a8 net/l2/l3/l4: add support of iob offload
1. Add new config CONFIG_NET_LL_GUARDSIZE to isolation of l2 stack,
   which will benefit l3(IP) layer for multi-MAC(l2) implementation,
   especially in some NICs such as celluler net driver.

new configuration options: CONFIG_NET_LL_GUARDSIZE

CONFIG_NET_LL_GUARDSIZE will reserved l2 buffer header size of
network buffer to isolate the L2/L3 (MAC/IP) data on network layer,
which will be beneficial to L3 network layer protocol transparent
transmission and forwarding

------------------------------------------------------------
Layout of frist iob entry:

        iob_data (aligned by CONFIG_IOB_ALIGNMENT)
            |
            |                  io_offset(CONFIG_NET_LL_GUARDSIZE)
            |                                |
            -------------------------------------------------
      iob   |            Reserved            |    io_len    |
            -------------------------------------------------

-------------------------------------------------------------
Layout of different NICs implementation:

        iob_data (aligned by CONFIG_IOB_ALIGNMENT)
            |
            |                 io_offset(CONFIG_NET_LL_GUARDSIZE)
            |                                |
            -------------------------------------------------
 Ethernet   |       Reserved    | ETH_HDRLEN |    io_len    |
            ---------------------------------|---------------
 8021Q      |   Reserved  | ETH_8021Q_HDRLEN |    io_len    |
            ---------------------------------|---------------
 ipforward  |            Reserved            |    io_len    |
            -------------------------------------------------

--------------------------------------------------------------------

2. Support iob offload to l2 driver to avoid unnecessary memory copy

Support send/receive iob vectors directly between the NICs and l3/l4
stack to avoid unnecessary memory copies, especially on hardware that
supports Scatter/gather, which can greatly improve performance.

new interface to support iob offload:

  ------------------------------------------
  |    IOB version     |     original      |
  |----------------------------------------|
  |  devif_iob_poll()  |   devif_poll()    |
  |       ...          |       ...         |
  ------------------------------------------

--------------------------------------------------------------------

1> NIC hardware support Scatter/gather transfer

TX:

                tcp_poll()/udp_poll()/pkt_poll()/...(l3|l4)
                           /              \
                          /                \
devif_poll_[l3|l4]_connections()     devif_iob_send() (nocopy:udp/icmp/...)
           /                                   \      (copy:tcp)
          /                                     \
  devif_iob_poll("NIC"_txpoll)                callback() // "NIC"_txpoll
                                                  |
                            dev->d_iob:           |
                                                ---------------         ---------------
                             io_data       iob1 |  |          |    iob3 |  |          |
                                    \           ---------------         ---------------
                                  ---------------  |       --------------- |
                             iob0 |  |          |  |  iob2 |  |          | |
                                  ---------------  |       --------------- |
                                     \             |          /           /
                                        \          |       /           /
                                   ----------------------------------------------
                    NICs io vector |    |    |    |    |    |    |    |    |    |
                                   ----------------------------------------------

RX:

  [tcp|udp|icmp|...]ipv[4|6]_data_handler()(iob_concat/append to readahead)
                    |
                    |
      [tcp|udp|icmp|...]_ipv[4|6]_in()/...
                    |
                    |
          pkt/ipv[4/6]_input()/...
                    |
                    |
     NICs io vector receive(iov_base to each iobs)

--------------------------------------------------------------------

2> CONFIG_IOB_BUFSIZE is greater than MTU:

TX:

"(CONFIG_IOB_BUFSIZE) > (MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE + CONFIG_NET_LL_GUARDSIZE)"

                tcp_poll()/udp_poll()/pkt_poll()/...(l3|l4)
                           /              \
                          /                \
devif_poll_[l3|l4]_connections()     devif_iob_send() (nocopy:udp/icmp/...)
           /                                   \      (copy:tcp)
          /                                     \
  devif_iob_poll("NIC"_txpoll)                callback() // "NIC"_txpoll
                                                  |
                                             "NIC"_send()
                          (dev->d_iob->io_data[CONFIG_NET_LL_GUARDSIZE - NET_LL_HDRLEN(dev)])

RX:

  [tcp|udp|icmp|...]ipv[4|6]_data_handler()(iob_concat/append to readahead)
                    |
                    |
      [tcp|udp|icmp|...]_ipv[4|6]_in()/...
                    |
                    |
          pkt/ipv[4/6]_input()/...
                    |
                    |
     NICs io vector receive(iov_base to io_data)

--------------------------------------------------------------------

3> Compatible with all old flat buffer NICs

TX:
                tcp_poll()/udp_poll()/pkt_poll()/...(l3|l4)
                           /              \
                          /                \
devif_poll_[l3|l4]_connections()     devif_iob_send() (nocopy:udp/icmp/...)
           /                                   \      (copy:tcp)
          /                                     \
  devif_iob_poll(devif_poll_callback())  devif_poll_callback() /* new interface, gather iobs to flat buffer */
       /                                           \
      /                                             \
 devif_poll("NIC"_txpoll)                     "NIC"_send()(dev->d_buf)

RX:

  [tcp|udp|icmp|...]ipv[4|6]_data_handler()(iob_concat/append to readahead)
                    |
                    |
      [tcp|udp|icmp|...]_ipv[4|6]_in()/...
                    |
                    |
               netdev_input()  /* new interface, Scatter/gather flat/iob buffer */
                    |
                    |
          pkt/ipv[4|6]_input()/...
                    |
                    |
    NICs io vector receive(Orignal flat buffer)

3. Iperf passthrough on NuttX simulator:

  -------------------------------------------------
  |  Protocol      | Server | Client |            |
  |-----------------------------------------------|
  |  TCP           |  813   |   834  |  Mbits/sec |
  |  TCP(Offload)  | 1720   |  1100  |  Mbits/sec |
  |  UDP           |   22   |   757  |  Mbits/sec |
  |  UDP(Offload)  |   25   |  1250  |  Mbits/sec |
  -------------------------------------------------

Signed-off-by: chao an <anchao@xiaomi.com>
2022-12-03 11:47:04 +08:00
Peter Bee
c26fd6565d drivers/video: enhance v4l2 compatibility
Add common BSD v4l2 header file
Complete ioctls according to standard v4l2 drivers

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-03 02:48:01 +08:00
田昕
cb0418676f include/nuttx:add linux-like notifier
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-12-02 22:56:22 +08:00
Peter Bee
87e16c3694 drivers/video: add support for yuv420p
Add calc functions for buffer size (yuv420p is 6Byte/4px)

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-02 13:18:20 +08:00
Peter Bee
365b1f4bb8 drivers/video: add support for YUYV format
Add YUYV format which is used by most USB Cameras

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-02 13:18:20 +08:00
FASTSHIFT
0ae242aa8d drivers/video/fb: add poll support
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2022-12-01 15:08:03 +08:00
chao an
4281acdb83 net/chksum: move all chksum api declarations to common header
The following APIs need to be overriden by the arch after enabling
CONFIG_NET_ARCH_CHKSUM, move these functions to the common header
file to avoid prototype conflicts

uint16_t chksum(uint16_t sum, FAR const uint8_t *data, uint16_t len);
uint16_t net_chksum(FAR uint16_t *data, uint16_t len);
uint16_t ipv4_upperlayer_chksum(FAR struct net_driver_s *dev, uint8_t proto);
uint16_t ipv6_upperlayer_chksum(FAR struct net_driver_s *dev,
                                uint8_t proto, unsigned int iplen);
uint16_t ipv4_chksum(FAR struct ipv4_hdr_s *ipv4);

Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-30 15:08:14 +08:00
liyi
391b501639 net: extract l3 header build code into new functions
Signed-off-by: liyi <liyi25@xiaomi.com>
2022-11-29 18:36:15 +08:00
Masayuki Ishikawa
8b4ffb8d3e virtio: Add virtio drivers
Summary:
- This commit adds virtio-mmio and virtio-net drivers

Impact:
- None (new drivers)

Testing:
- Tested with rv-virt (will be updated later) with QEMU-7.1

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-11-29 13:16:44 +08:00
chao an
cdaa2ba8d4 mm/iob: new function iob_update_pktlen() to update packet length of the iob
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-29 13:16:23 +08:00
chao an
b452e2fddf mm/iob: new function iob_reserve() to adjust headroom offset
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-29 13:16:23 +08:00
田昕
1d8d6e5ed2 drivers/syslog:support stream as syslog backend.
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-11-28 20:19:00 +08:00
Xiang Xiao
af2b491420 driver/segger: Move SYSLOG_RTT config from drivers/syslog to drivers/segger
and remove include/nuttx/syslog/syslog_rtt.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-27 23:10:39 +01:00
Xiang Xiao
fd268d7123 drivers/segger: Add STREAM_RTT option
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-27 23:10:39 +01:00
Xiang Xiao
df6666ab5e libc/stream: Rename lib_stream_[put|get]c to lib_stream_[put|get]
keep the macro consistent with the callback name

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-27 22:59:21 +01:00
yinshengkai
126b33c488 drivers/segger: add Segger RTT stream support
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-11-27 23:39:20 +08:00
chao an
8850dee746 net/devif: move preprocess of txpoll into common code
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-27 12:11:12 +08:00
yinshengkai
511070c300 include: unified stream read and write interface
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-11-25 21:41:51 +08:00
Xiang Xiao
5fd1379d3f syslog: Move syslog stream to libc like other stream implementation
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-25 01:46:31 +08:00
Xiang Xiao
90c641d4c1 libc/streams: Add lib_[si]gets_t callback
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-25 01:07:12 +08:00
Xiang Xiao
5ee1da4211 libc/streams: Ensure the different stream type has the common layout
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-25 01:07:12 +08:00
田昕
28739b8b8a libc/stream:Add mtd backend stream.
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-11-24 12:07:10 +08:00
dongjiuzhu1
ccf0c3566e net/local: support cmd SO_PEERCRED
the credentials of the peer process connected to this socket.
refs:https://man7.org/linux/man-pages/man7/unix.7.html

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-11-23 15:01:54 +08:00
dongjiuzhu1
e6f8ccda4a net/get/setsockopt: add si_get/setsockopt interface to simply get/setsockopt
move private option to protocol sockif

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-11-23 15:01:54 +08:00
zhangyuan21
d8051ba979 nuttx/sched: merge up_block_task and up_unblock_task 2022-11-22 22:59:08 +08:00
wangbowen6
25bfd437fe fs_epoll: support extend the epoll dynamicly.
1. epoll_ctl(EPOLL_CTL_ADD) support extend the epoll
   events dynamicly;
2. enhance the epoll performance by moving some poll setup
   and teardown process to the EPOLL_CTL_ADD/DEL/MOD;

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-11-22 21:08:56 +08:00
Ville Juven
f8a6ec2cdf mm/shm: Fix ARCH_SHM_VEND
The last address is base+size-1
2022-11-22 08:54:34 +01:00
Ville Juven
48b9a8d6f4 mm/shm: Move the vma allocators to separate functions
This will allow changing the underlying backend, i.e. granule allocator,
to something more efficient, if this is needed later.

Also, it gives easier access to the common SHM book keeping.
2022-11-22 08:54:34 +01:00
Ville Juven
458ff380e5 mm/gran: Allow run-time execution of gran_reserve
User can ask for specific granules to be allocated.

This is useful for one thing only: when mmap() is called for a specific
vaddr. The parameter itself is non-sensical, this is just to satisfy
the POSIX standard.
2022-11-22 08:54:34 +01:00
zhangyuan21
5c1b518314 nuttx/sched: move reprioritize process to public function 2022-11-22 15:29:00 +09:00
zhangyuan21
08f7152d9f nuttx/sched: remove nxsched_remove_readytorun from up_block_task
It takes about 10 cycles to obtain the task list according to the task
status. In most cases, we know the task status, so we can directly
add the task from the specified task list to reduce time consuming.
2022-11-22 15:29:00 +09:00
zhangyuan21
e54b602208 nuttx/sched: remove nxsched_remove_blocked from up_unblock_task
It takes about 10 cycles to obtain the task list according to the task
status. In most cases, we know the task status, so we can directly
delete the task from the specified task list to reduce time consuming.
2022-11-22 15:29:00 +09:00
Xiang Xiao
af2aa13873 phtread: Change stacksize type from long to size_t
follow the standard prototype:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_attr_getstack.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-22 08:23:37 +09:00
Robert-Ionut Alexa
039262484a drivers/sensors: add LTR308 ambient light sensor
Add support for the LTR308 ambient light sensor through I2C. Currently,
the interrupt-driven mode of operation is not supported.

Signed-off-by: Robert-Ionut Alexa <robertalexa2000@gmail.com>
2022-11-21 23:48:52 +08:00
Xiang Xiao
1a942c3c31 Fix lcd/ili9225.c:388:46: error: shift count >= width of type
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-20 14:34:44 +01:00
qinwei1
ce95db46b9 include/nuttx/tls.h: add CXX extern define for tls
Summary:
   In order to use C functions in C++ code, "extern C"
needs to be defined in the C header file.
   Add "extern C" define for tls.h

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2022-11-18 12:42:26 +08:00
qinwei1
8021dfece6 sched/task/task_getpid: getpid should return process id not thread id
Summary:
   implement the right semantics:
1. getpid should return the main thread id
2. gettid should return the current thread id

Refer to:
 https://github.com/apache/incubator-nuttx/issues/2499
 https://github.com/apache/incubator-nuttx/pull/2518

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2022-11-17 17:58:08 +08:00
zhangyuan21
f27065cb9e sched/mqueue: make mqueue and mqueue sysv can disable separately 2022-11-16 20:03:40 +08:00
Simon Filgis
6376d90c3d In case of SAMV7 it is possible to overwrite the pwm output with 0 or 1 immediately. Changing the dutycycle to 0 or 100 will take effect only on end of cycle, which could be to late for some applications.
This solution adds a overwrite flag and value when updating the duty cycle.
2022-11-16 12:07:09 +08:00
David Sidrane
d05a5d16ee imxrt:Support TJ1103 PHY 2022-11-15 02:27:35 +08:00
anjiahao
a4563b8744 Fix the coding style and typo issue
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-14 09:34:04 +09:00
Andrés Sánchez Pascual
9f029194e1 sys: boardctl: Add more reset causes to enum
Signed-off-by: Andrés Sánchez Pascual <tito97_sp@hotmail.com>
2022-11-13 21:26:31 -03:00
Xiang Xiao
f52ad42425 Fix error: unknown attribute 'long_call' ignored [-Werror,-Wunknown-attributes]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-13 22:35:19 +08:00
Xiang Xiao
6f33dd6ea0 mm/heap: Change TCB_FLAG_HEAPCHECK to TCB_FLAG_HEAP_CHECK
align with other flags naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-12 09:39:01 +01:00
Zhe Weng
8239ddeef4 net/nat: Add TCP entry expiration logic
Add TCP entry expiration logic for NAT, with entries changed from sq to dq for fast removal.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2022-11-11 14:36:55 +08:00
Zhe Weng
b595430578 net: add basic NAT workflow
Add basic functions for NAT (NAPT), remaining some logic unimplemented (UDP, ICMP, port assignment, etc). NAT for TCP can work now (unless port conflicts).
Outbound: LAN ->  Forward  ->  NAT(only if targeting at WAN)  -> WAN
Inbound:  WAN ->  NAT(only from WAN, change dest) -> Forward  -> LAN

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2022-11-11 14:36:55 +08:00
ligd
4501490302 hwspinlock: add hwspinlock driver for multi CPU
The design follow Linux kernel:
https://www.kernel.org/doc/html/latest/locking/hwspinlock.html

Signed-off-by: ligd <liguiding@pinecone.net>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-09 09:12:01 +01:00
anjiahao
0c26658906 random_pool:add a new api arc4random
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-11-09 06:41:19 +01:00
Michael Jung
b401db5ca4 prctl syscall is present unconditionally
I had a link problem regarding prctl while CONFIG_TASK_NAME_SIZE was
defined 0 and building in protected mode.  Turns out in monolithic
build prctl is present no matter what CONFIG_TASK_NAME_SIZE, but in
protected mode build its only present if CONFIG_TASK_NAME_SIZE > 0.
So, bring protected mode build in sync with the monolithic one.

Signed-off-by: Michael Jung <michael.jung@secore.ly>
2022-11-09 01:21:16 +08:00
Xiang Xiao
38d1244751 mm/mempool: Remove MM_MEMPOOL option from Kconfig
since the linker can remove the unused object file from the final image

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-08 10:18:27 -03:00
Lucas Saavedra Vaz
fa0ccce046 audio: Add support for the ES8388 codec (output) 2022-11-08 10:03:18 -03:00
Xiang Xiao
ace71efe77 drivers/mbox: Don't reference the nonexistent CONFIG_MBOX
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-07 10:14:20 +01:00
Xiang Xiao
a7e99346a1 net/tcp: Make TCP_MAXRTX and TCP_MAXSYNRTX configurable
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-07 10:05:57 +01:00
anjiahao
64ebdb0339 include/endian:add openbsd style macro
bemtoh htobem lemtoh htolem

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-11-05 20:37:39 +08:00
Xiang Xiao
e292200f61 video: Move _VIDIOCBASE and _VIDIOC to include/nuttx/fs/ioctl.h
to align with other drivers

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-05 06:51:53 +01:00
Xiang Xiao
3b060bad34 Fix error: format specifies type 'unsigned short' but the argument has type 'int'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 17:12:42 +01:00
zhangyuan21
b118083c35 arch_timer: adjust timer/arch_timer to support tick
Enable CONFIG_SCHED_TICKLESS_TICK_ARGUMENT in tickless mode
to improve the performance.
2022-11-01 21:53:08 +08:00
Xiang Xiao
28947517ca sched/spawn: Rename task_spawnattr_[get|set]stack[size|addr] to posix_spawnattr_[get|set]stack[size|addr]
since they can be not only used in task_spawn but also in posix_spawn

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 09:51:18 +09:00
chao an
e0a3fdf982 sched/posix/timer: handle invaild timerid correctly
TIMER_SETTIME(2)

NAME
       timer_settime, timer_gettime - arm/disarm and fetch state of POSIX per-process timer

SYNOPSIS
       #include <time.h>

       int timer_settime(timer_t timerid, int flags,
                         const struct itimerspec *new_value,
                         struct itimerspec *old_value);
       int timer_gettime(timer_t timerid, struct itimerspec *curr_value);
...
ERRORS
...
       EINVAL timerid is invalid.

Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-31 19:59:29 -03:00
Xiang Xiao
e08c296a8e Change the type of tg_joinlock, mm_lock and md_lock from sem_t to mutex_t
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-31 10:35:53 +01:00
Xiang Xiao
64e7833cbc sched/spawn: Support task_spawnattr_[set|get]stackaddr
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-31 12:46:58 +09:00
Xiang Xiao
b9b032af72 sched/spawn: Support task_spawnattr_[set|get]stacksize in kernel mode
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-31 12:46:58 +09:00
anjiahao
d7b4e91dda Call nxsem_destroy or nxmutex_destry in the error path
1.Don't check the return value of nxsem_init or nxmutex_init
2.Fix some style issue

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-30 13:56:52 +01:00
Xiang Xiao
732092570e sched/mutex: NXMUTEX_INITIALIZER should enable priority inheritance
and remove the unused macro PRIOINHERIT_FLAGS_DISABLE

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-29 21:37:06 +02:00
zhanghongyu
f00c11aec4 socket: separation error code EBADF and ENOTSOCK
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-10-29 08:18:02 +02:00
yinshengkai
65dc1fe0fc mm: add kmm/umm_memdump
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-10-29 11:35:27 +08:00
Xiang Xiao
5bee68ebac sched: remove the unused function nx_wait and nx_waitid
This partially reverts commit de2a9d8a77.
2022-10-28 21:19:46 +02:00
dongjiuzhu1
6f208524a1 lib/math32.h: support LOG2_CEIL/LOG2_FLOOR function at compile time
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-10-29 00:12:02 +08:00
dongjiuzhu1
5828e5bb88 mm/mempool: add new api: xx_realloc and xx_alloc_size
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-10-28 21:31:35 +08:00
Jiuzhu Dong
8994c8efa2 mm/mempool: support specifying alloc and free function
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-10-28 21:31:35 +08:00
Jiuzhu Dong
a01f3beefd mm/mempool: support multiple memory pool
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-10-28 21:31:35 +08:00
Xiang Xiao
488a56280a fs: Correct the comment of file_allocate
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-28 10:12:08 +02:00
Xiang Xiao
604eea453b fs/vfs: Let caller control whether add the reference count of inode in file_allocate
to simplify the caller in some special case

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-28 10:12:08 +02:00
Xiang Xiao
4d4bb458da fs/vfs: Move file_allocate from fs/inode/inode.h to include/nuttx/fs/fs.h
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-28 10:12:08 +02:00
chao an
a8d3286258 net: move device buffer define to common header
Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-28 00:32:16 -04:00
Xiang Xiao
6940ca8677 fs: Remove the duplication umount macro
which is already defined in include/sys/mount.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-27 23:14:25 +02:00
Xiang Xiao
19bded4738 fs: Remove the unused nx_pipe to prefer file_pipe for kernel
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-27 23:14:25 +02:00
Xiang Xiao
fc1efe2c0b fs: Remove the unused nx_fcntl to prefer file_fcntl for kernel
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-27 23:14:25 +02:00
Xiang Xiao
b22cc1e2b8 fs: Remove the unused nx_dup to prefer file_dup for kernel
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-27 23:14:25 +02:00
Xiang Xiao
cf21319d3a fs: Remove the unused nx_poll to prefer file_poll for kernel
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-27 23:14:25 +02:00
Xiang Xiao
aa31648c9f fs: Remove the unused nx_[v]ioctl to prefer file_[v]ioctl for kernel
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-27 23:14:25 +02:00
Minh Nguyen
153060d34d Update errno to match asm-generic
Modify some comment.
2022-10-28 02:19:26 +08:00
wangbowen6
f56710c121 rpmsgblk: rpmsg block device support
Like rpmsgdev and rpmsgmtd, rpmsgblk allow the local cpu to
access the block device in the remote cpu.

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-10-28 01:13:58 +08:00
Xiang Xiao
05d40eeeff net: Remove the unused nx_recv[from] to prefer psock_recv[from] for kernel
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-27 16:47:32 +02:00
Xiang Xiao
3e982b6556 net: Remove the unused nx_send to prefer psock_send for kernel
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-27 16:47:32 +02:00
Petro Karashchenko
fdff92fd19 libs/libc/time: mktime normalize struct tm
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-27 21:22:08 +08:00
Tiago Medicci Serrano
6f1fbc29ee audio/i2s: add i2s_mclkfrequency method to the I2S lower half
This method allows the codec driver to set a specific mclk
frequency for the I2S lower half. This provides support to change
it on run time according to the supported master clock frequency
of the audio codec, the sample rate and the data width.
2022-10-27 00:09:01 +08:00
Karel Kočí
61b1791584 libs/libc: add obstack 2022-10-26 09:11:52 +08:00
SPRESENSE
277c8e368b drivers/video: Update API to dump register for debug 2022-10-26 03:57:26 +08:00
SPRESENSE
1332bdb9a7 drivers/video: Add get frame interval API 2022-10-26 03:57:26 +08:00
SPRESENSE
306029e6e4 lte: Include nuttx/fs/ioctl.h instead of wireless.h
lte command definitions are separated from wireless ioctl.
2022-10-24 13:09:29 +08:00
Petro Karashchenko
2fd7e18a16 include/sys: fix style issues in queue.h
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-24 12:59:24 +08:00
Miguel Herranz
819ebe7356 libc/stdio: Add stdio file locking functions
Add flockfile(), ftrylockfile() and funlockfile() functions [1].

[1] POSIX.1-2008 / System Interfaces / flockfile
    https://pubs.opengroup.org/onlinepubs/9699919799.2008edition/functions/flockfile.html

Signed-off-by: Miguel Herranz <miguel@midokura.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-22 23:34:45 +08:00
anjiahao
577e550698 libc/semaphore:sem_init change defult protocol
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-10-22 14:50:48 +08:00
chao an
205c8934a3 sched/msgq: add support of System V message queue
https://man.openbsd.org/msgget.2

Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-22 12:58:11 +08:00
chao an
96c3debe6a sched/mqueue: decoupling condition member to common prologue
Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-22 12:58:11 +08:00
Alin Jerpelea
06c8e43df9 drivers: modem: update altair modem
update Altair modem with the ALT1250 implementation

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-10-22 09:00:32 +08:00
raiden00pl
36ae5316b7 include/nuttx/can.h: make error definitions compatible with Linux 2022-10-21 18:47:29 +08:00
Xiang Xiao
942513cd37 time: Typedef time_t to int64_t if CONFIG_SYSTEM_TIME64 is defined
to handle 2038 problem correctly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-20 22:17:52 +02:00
Xiang Xiao
1e6a8f56d3 sched/spawn: Fix the minor typo error
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-20 21:51:40 +02:00
YAMAMOTO Takashi
8a972817e0 sched.h: Simplify HAVE_GROUP_MEMBERS logic
After the retirement of CONFIG_SCHED_EXIT_KILL_CHILDREN, [1]
the behavior is now effectively controlled by
CONFIG_SCHED_CHILD_STATUS, which is IMO confusing.
(It was even surprising me.)

This commit solves it by making HAVE_GROUP_MEMBERS
a synonym of !CONFIG_DISABLE_PTHREAD. I guess this change aligns
the intention of the CONFIG_SCHED_EXIT_KILL_CHILDREN retirement.
That is, always tries to be similar to the standard behavior.

Another option would be to revive CONFIG_SCHED_EXIT_KILL_CHILDREN
and make the HAVE_GROUP_MEMBERS logic aware of it.
It might be a good idea if we want a finer-grained control of
code to build. (One can argue his application uses pthread
but does never _exit. In that case, it might be a waste to maintain
group membership. I suspect it might not be too rare in embedded
world.)

[1] commit 6982eb35fe
2022-10-19 21:32:30 +08:00
YAMAMOTO Takashi
f100a4bb92 Implement fdopendir 2022-10-19 21:20:35 +08:00
Xiang Xiao
e2a18ad339 sched: Support envp argument of task_spawn and nxtask_create
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-19 08:22:56 +09:00
Xiang Xiao
6b31918b42 Remove the unnecessary cast for main_t, NULL and argv
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-18 08:51:45 +02:00
anjiahao
d1d46335df Replace nxsem API when used as a lock with nxmutex API
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 15:59:46 +09:00
Xiang Xiao
6854cce059 sched/spawn: Add the dummy task_spawnattr_xxxstackyyy in the kernel mode
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 19:13:42 +02:00
Xiang Xiao
78f6a02bc8 boards: Remove the duplicated prototype of CONFIG_INIT_ENTRYPOINT
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 19:02:44 +02:00
luojun1
ec4af00538 Add Cellular link layer support
1.Add cellular link layer enum definition and register flow
2.Add ioctl flow to set cellular NICs parameters

Signed-off-by: luojun1 <luojun1@xiaomi.com>
Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-15 18:34:07 +08:00
zhangyuan21
fc9b5e1980 arch_alarm: adjust oneshot/arch_alarm to support tick 2022-10-12 11:55:46 +08:00
zhangyuan21
750007ded9 sched: use tick count for sched timer expiration 2022-10-12 11:55:46 +08:00
liangchaozhong
cc426f8539 usrsock:add done flag in usrsock_iovec_do
set done to true if all data in iovec array is copied

Signed-off-by: liangchaozhong <liangchaozhong@xiaomi.com>
2022-10-11 00:57:49 +08:00
Xiang Xiao
a875e13105 list.h: Add local temp variable to avoid the double evaluation
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-06 08:29:39 +02:00
Petro Karashchenko
d247e8d1d2 sched/semaphore: fix priority boost restoration for priority inheritance
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-03 15:14:24 -03:00
Xiang Xiao
6ec74d8d36 bluetooth: Forward ioctl to btuart lowerhalf driver
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-02 18:14:00 -03:00
wangbowen6
e9ccab2db3 fs/poll: using callback mechanism to implement poll notification
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-10-03 00:00:56 +08:00
raiden00pl
0aa0394ca2 include/stdint.h: add sig_atomic_t limits 2022-10-02 22:30:54 +08:00
raiden00pl
d8483a24e8 include/threads.h: return values should be integer type to prevent compiler warnings 2022-10-02 22:30:29 +08:00
zhangyuan21
85d013f69a sched: mqueue wait list optimize 2022-09-28 18:08:37 +08:00
zhangyuan21
838309313e sched: semaphore wait list optimize 2022-09-28 18:08:37 +08:00
Fotis Panagiotopoulos
bbf3f2866d Fixed non-UTF8 characters. 2022-09-28 09:38:55 +08:00
Xiang Xiao
764540267e sched/clock: Rename g_system_timer to g_system_ticks
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-27 17:45:44 -03:00
yinshengkai
ae38e3eb10 sched: Optimize sched_note_begin/end
Optimize sched_note_begin/end, replace note_printf with note_string
sched_note_begin/end optimized from 50us to 1us per consumption

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-09-27 21:32:35 +08:00
Xiang Xiao
40ef5bc6db libc: Move queue.h from include to include/nuttx
to avoid the conflict with libuv's queue.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-26 08:04:58 +02:00
wangbowen6
344c8be049 poll: add poll_notify() api and call it in all drivers
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-09-26 12:06:32 +08:00
chao an
74842880f9 compiler.h: add MSVC(Microsoft Visual C++)-specific definitions
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-26 04:40:34 +08:00
Xiang Xiao
70290b6e38 arch: Change the linker generated symbols from uint32_t to uint8_t *
and remove the duplicated declaration

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-24 21:26:56 +02:00
zhangyuan21
af72a528f1 sched: merge waitsem and msgwaitq 2022-09-22 16:32:44 +08:00
Xiang Xiao
4c44c6f709 arch.h: Make _sinit/_einit as an offical interface
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-22 08:29:24 +08:00
Xiang Xiao
53466c6d46 net: Add IN6_IS_ADDR_LINKLOCAL macro
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-21 18:28:40 +08:00
Xiang Xiao
03f45a124a watchdog: Support auto monitor keep alive from oneshot lowerhalf
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-20 22:04:36 +02:00
Xiang Xiao
1eefec4db3 watchdog: Support auto monitor keep alive from timer lowerhalf
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-20 22:04:36 +02:00
Xiang Xiao
db518bf0df fs: Allocate unique serial number for the root pseduo file system node
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-20 16:21:06 +08:00
Xiang Xiao
079a6fa6cc arch/armv7[a|r]: Implement up_affinity_irq
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-20 16:20:17 +09:00
Xiang Xiao
ef43283c67 arch/arm: Unify arm_cpu_sgi to up_trigger_irq
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-20 16:20:17 +09:00
chao an
d5a1576361 net/wireless: add support for netdev private ioctl
Signed-off-by: chao an <anchao@xiaomi.com>
Signed-off-by: caohongwei <caohongwei@xiaomi.com>
2022-09-20 01:16:22 +08:00
chao an
8b238e0b3d net/wireless: separate command catagory of bt/pktradio from wireless ioctl
1. separate command catagory of bt/pktradio from wireless ioctl
2. Remove commoand count limit to support vendor command

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-20 01:16:22 +08:00
ligd
e2df52390a SMP: fix crash when switch to new task which is still running
Situation:

Assume we have 2 cpus, and busy run task0.

CPU0                                CPU1
task0 -> task1                      task2 -> task0
1. remove task0 form runninglist
2. take task1 as new tcb
3. add task0 to blocklist
4. clear spinlock
                                    4.1 remove task2 form runninglist
                                    4.2 take task0 as new tcb
                                    4.3 add task2 to blocklist
                                    4.4 use svc ISR swith to task0
                                    4.5 crash
5. use svc ISR swith to task1

Fix:
Move clear spinlock to the end of svc ISR

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-17 17:37:47 +09:00
田昕
f6ebbe4429 drivers/mtd:init commit of power-loss resilient cfg
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-09-15 17:46:56 +08:00
liangchaozhong
62cbd72149 remove access on /dev/usrsock in up_usrsock.c
Signed-off-by: liangchaozhong <liangchaozhong@xiaomi.com>
2022-09-10 13:08:22 +08:00
liangchaozhong
644c4afeed usrsock:refine usrsock's architecture
Seperate usrsock device driver with usrsock core function layer
to make it more flexiable to adopt other kind of usrsock interface driver

Signed-off-by: liangchaozhong <liangchaozhong@xiaomi.com>
2022-09-09 20:56:12 +09:00
wangbowen6
c754df6411 drivers/mtd: add rpmsg mtd support
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-09-09 19:27:57 +08:00
wangbowen6
25c2f3e042 driver: move find_mtddriver() to fs.h and add close_mtddriver.c
Rpmsg mtd need a way to find the mtd device according to the
mtd device path.

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-09-09 19:27:57 +08:00
ligd
4bd88acf1b wqueue: fix work_qcancel() judge error caused by the union in struct work_s
in struct work_s:
union
{
  struct
  {
    struct dq_entry_s dq; /* Implements a double linked list */
    clock_t qtime;        /* Time work queued */
  } s;
  struct wdog_s timer;    /* Delay expiry timer */
}

while we use WDOG_ISACTIVE(&work->timer) to decide use dq or timer,
that is error, wd_cancel() maybe modify this area, dq_rem() also can
modify this area.
So we can't use the WDOG_ISACTIVE(&work->timer) to take as the judgement,
when there is a union.

Fix:
swap the order in struct wdog_s, move the arg to the second 32bit

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-08 15:03:54 +02:00
ligd
4a87578bdb wqueue: change single queue to double queue to improve speed
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-08 15:03:54 +02:00
ligd
2cc3ec57ef queue: add dq_rmafter support
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-08 15:03:54 +02:00
Neale Ferguson
213b954a90 * Squash round() commits
- Add check in roundx() functions for infinite or NaN cases
  - Add block to avoid style warnings
  - Define long double constants and macros for infinity and nan
  - Correct return syntax to match NuttX style
  - Make c89 compliant
  - Fix definitions of INFINITY_L/NAN_L

* include/nuttx/lib/math.h - match standard naming conventions
  - Rename isinf_l to isinfl
  - Rename isinf_f to isinff
  - Add finite()
  - Add finitel()
  - Add finitef()
  - Define isnanl and isnanf
  - Define isfinite() so that it uses the appropriate macro

* libs/libc/math/lib_asinf.c
  libs/libc/math/lib_asinl.c
  libs/libc/math/lib_roundf.c
  libs/libc/math/lib_roundl.c
  libs/libc/math/lib_sqrtf.c
  libs/libc/math/lib_sqrtl.c
  - Use renamed macros
  - Use correct NAN_x or INFINIT_x macro on returns
2022-09-08 20:57:27 +08:00
Nathan Hartman
de8d54781c fs: Fix symbol name in comments 2022-09-08 09:01:55 +08:00
Xiang Xiao
e17b678a16 compiler.h: Rename inline_function to always_inline_function
reserve inline_function macro for inline keyword

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-07 10:24:04 +02:00
zhanghongyu
9bff29d7e7 udp: add IPVx_PKTINFO related support
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-09-07 10:49:47 +08:00
Xiang Xiao
e0bb281e7a net: Align the prototype of sock_intf_s::si_ioctl with file_operations::ioctl
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-06 22:46:37 +08:00
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