Commit graph

7554 commits

Author SHA1 Message Date
fangpeina
3518c69e6c input/ff: extend ioctrl to support factory calibration
Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2024-11-14 23:35:07 +08:00
fangpeina
a719db1b58 drivers/input: support RTP file simulation in RAMLOOP mode
For resource-constrained devices, simulate RTP
playback effects using preset custom RAMLOOP
combinations instead of using RTP files to play
custom vibration effects.

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2024-11-14 23:35:07 +08:00
hujun5
ea20ae588a pthread_cond_broadcast use wait_count for judement
This commit fixes the comment from https://github.com/apache/nuttx/pull/14581

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-14 23:22:52 +08:00
Masayuki Ishikawa
bbf2bbf37d Revert "arch_atomic : Introduce CONFIG_LIBC_ARCH_ATOMIC"
This reverts commit 81e7b13a05.
2024-11-13 10:45:12 +09:00
hujun5
a72f1820af Fix typo errors in include/nuttx/clock.h
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-12 17:24:23 +08:00
chenrun1
0bad7f814a rammtd:add rammtd_uninitialize
Summary:
  Added rammtd_uninitialize to manage rammtd

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-11-12 14:58:01 +08:00
Takuya Miyasita
81e7b13a05 arch_atomic : Introduce CONFIG_LIBC_ARCH_ATOMIC
Some armv7-m-based SoCs do not work with atomic instructions,
even though armv7-m supports them.

To avoid using atomic instructions generated by gcc,
CONFIG_LIBC_ARCH_ATOMIC is newly introduced with which
arch_atomic.c is linked explicitly.

However, the function names need to be changed to avoid
build errors, since the functions described in stdatomic.h
are gcc built-in and inlined when the code is compiled.

Signed-off-by: Takuya Miyasita <Takuya.Miyashita@sony.com>
2024-11-12 14:27:42 +09:00
guoshichao
f94e092fad ghs: fix the naked_function attr cannot handle warning
with greenhills version older than 202354, the __attribute__((naked))
cannot handled by greenhills compiler, and will report warning:

"/home/guoshichao/work_profile/vela_os/vela_car_6/nuttx/arch/arm/src/armv7-m/arm_svcall.c", line 79: warning #1097-D:
          unknown attribute "naked"
  static void dispatch_syscall(void) naked_function;
                                     ^

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-11-11 22:32:26 +08:00
hujun5
55dbf37017 fix compiler error
reason:
when CONFIG_CLOCK_TIMEKEEPING=y, compiler error may report

In file included from /home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/sched.h:42,
                 from /home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/arch.h:89,
                 from boardctl.c:33:
/home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/irq.h:261:12: error: conflicting types for 'enter_critical_section'; have 'irqstate_t(void)' {aka 'long unsigned int(void)'}
  261 | irqstate_t enter_critical_section(void) noinstrument_function;
      |            ^~~~~~~~~~~~~~~~~~~~~~
In file included from /home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/wqueue.h:37,
                 from /home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/addrenv.h:39,
                 from /home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/sched.h:40:
/home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/wdog.h:267:11: note: previous implicit declaration of 'enter_critical_section' with type 'int()'
  267 |   flags = enter_critical_section();
      |           ^~~~~~~~~~~~~~~~~~~~~~
hujun5@hujun5-OptiPlex-7070:~/downloads1/vela_sim/nuttx$ make -j12
sched/sched_processtimer.c: In function 'nxsched_process_timer':
sched/sched_processtimer.c:178:3: error: implicit declaration of function 'clock_update_wall_time' [-Werror=implicit-function-declaration]
  178 |   clock_update_wall_time();

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-11 19:48:38 +08:00
robert
5e8f1eefb0 Bluetooth: improved pairing process and host layer now successfully receives ACL packets 2024-11-10 14:33:52 -03:00
hujun5
6611480904 isrthread: add configuring the stack of an isrthread as static
reason:
we configure the isr thread stack as static to allow for more flexible placement of the stack.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-08 01:49:14 +08:00
wanggang26
929bbf0be8 fs: add merge partitions support
Usage example for merging the factory partition and reserve
partition into the merge partition:
register_merge_blockdriver("/dev/merge", "/dev/factory", "/dev/reserve",
NULL)

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-11-07 14:59:23 +08:00
wangjianyu3
c1553464bb nuttx/uorb.h: Add GNSS firmware version for struct sensor_gnss
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-06 21:18:57 +08:00
Alin Jerpelea
cfda04089c include: migrate license to ASF
Augusto Fraga Giachero has sumitted the ICLA and the license can be
replaced by the ASF License

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-11-06 19:46:13 +08:00
hujun5
c498991ba4 smpcall: add nxsched_smp_call_async and nxsched_smp_call_single_async
reason:
The old implementation of the SMP call, even when using the "no wait" parameter,
could still result in waiting, if invoking it within a critical section
may lead to deadlocks. Therefore, in order to implement a truly asynchronous SMP
call strategy, we have added nxsched_smp_call_async.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-06 09:53:28 +08:00
Peter van der Perk
faee89b966 net: fix inet #14634 regression
Define wasn't imported by netconfig.h move definitions
2024-11-05 18:36:02 +08:00
Peter van der Perk
c371afc7f4 net: inet.h match inet_sockif.c definition
Fixes psock_socket: ERROR: socket address family unsupported: 2
When using the minimal CONFIG_NET configuration typically used for
SocketCAN

Update net/inet/inet.h

Co-authored-by: Xiang Xiao <xiaoxiang781216@gmail.com>

Update net/inet/inet.h

Co-authored-by: Xiang Xiao <xiaoxiang781216@gmail.com>
2024-11-05 01:58:45 +08:00
zhanghongyu
082bc17ab0 netinet/if_ether.h: move #define ETH_XXX into if_ether.h
consistent with other operating systems

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-11-04 21:14:31 +08:00
Xiang Xiao
a96a4de19a timers: Replace DEBUGASSERT with the error code
fix the issue report here:
https://lists.apache.org/thread/sys37yf63rq501fd1v8y3zyh6vk10v1d
when driver no support for ops, should not panic, prefer errno.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-11-04 10:05:52 +01:00
Xiang Xiao
9882e0e9c3 fs: Fix mtd/sector512.c:554:19: error: incomplete definition of type 'struct partition_info_s'
by moving geometry and partition_info_s to include/fs/ioctl.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-11-03 21:08:50 +08:00
hujun5
a1bb967941 remove nxsched_lock_irq/nxsched_unlock_irq
reason:
nxsched_lock_irq has the same functionality as sched_lock

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-03 16:00:17 +08:00
Xiang Xiao
c5381c3eb2 Replace __attribute__((packed)) with [begin|end]_packed_struct
since the different compiler express the packed structure in the different way
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-11-03 10:20:38 +08:00
hujun5
2c0e5e872b pthread_cond remove csection
reason:
We decouple semcount from business logic by using an independent counting variable,
which allows us to remove critical sections in many cases.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-02 09:40:19 -03:00
nuttxs
3818ce8268 sys/socket: use __attribute__((packed)) to avoid changes in
the size of struct sockaddr_storage due to struct alignment
2024-11-01 11:15:54 -03:00
ouyangxiangzhen
17c51c0667 userspace: Exclude nuttx/arch.h
This patch fixed userspace headers conflict. Architecture-related definition and API should not be exposed to users.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-11-01 16:59:37 +08:00
cuiziwei
d1e5b38b9b nuttx/semaphore: Move define CONFIG_SEM_PREALLOCHOLDERS to include/semaphore.h.
Move CONFIG_SEM_PREALLOCHOLDERS to include/semaphore.h to avoid undefined issues from occurring in other places as well.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-31 18:37:53 +08:00
Karel Kočí
b851916d76 libs/libc/obstack: fix allocated chunk overrun due to invalid limit
This primarily fixes allocated memory overrun due to invalidly
calculated limit of the chunk. The function here allocates chunk of size
that includes required header. The error was that size of the chunk was
invalidly again added when limit was being calculated. This was causing
memory overrun and issues especially with object growing (reallocation).

The secondary fix here is to the algorithm that rounds the required size
to the multiple of chunk size. In short chunk size must be reduced by
one to get the correct mask. The condition that was generating the mask
was also invalid because it must perform shift with at most one less
than number of bits (not bytes).
2024-10-30 11:53:18 -03:00
chenrun1
759b77b975 nuttx/atomic.h:Add use condition for using stdatomic.h
Summary:
  add check !defined(__STDC_NO_ATOMICS__)
  If the macro constant __STDC_NO_ATOMICS__(C11) is defined by the compiler, the header <stdatomic.h>, the keyword _Atomic, and all of the names listed here are not provided.

  refer to:https://en.cppreference.com/w/c/atomic

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-10-30 21:29:04 +08:00
zhanghongyu
c11752e59f arp.h: make struct arpreq four-byte aligned
avoid memory waste in 64-bit architectures.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-30 21:10:46 +08:00
YAMAMOTO Takashi
761ee81956 move readv/writev to the kernel
currently, nuttx implements readv/writev on the top of read/write.
while it might work for the simplest cases, it's broken by design.
for example, it's impossible to make it work correctly for files
which need to preserve data boundaries without allocating a single
contiguous buffer. (udp socket, some character devices, etc)

this change is a start of the migration to a better design.
that is, implement read/write on the top of readv/writev.

to avoid a single huge change, following things will NOT be done in
this commit:

* fix actual bugs caused by the original readv-based-on-read design.
  (cf. https://github.com/apache/nuttx/pull/12674)

* adapt filesystems/drivers to actually benefit from the new interface.
  (except a few trivial examples)

* eventually retire the old interface.

* retire read/write syscalls. implement them in libc instead.

* pread/pwrite/preadv/pwritev (except the introduction of struct uio,
  which is a preparation to back these variations with the new
  interface.)
2024-10-30 17:07:54 +08:00
ligd
4541132035 Revert "shced:sem: replace mutex with spinlock"
Cause we can't do sem_post/wait within spinlock

This reverts commit 23d65cb97f.

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-29 23:01:39 +08:00
zhanghongyu
c22b39d8d7 arp.h: make struct arpreq four-byte aligned
current sizeof(struct sockaddr_in) is 66

arp/arp_table.c:241:28: runtime error: member access within misaligned address 0xe5f134e6 for type 'struct sockaddr_in', which requires 4 byte alignment
0xe5f134e6: note: pointer points here
 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00
             ^
    #0 0x543287c1 in arp_get_arpreq arp/arp_table.c:241
    #1 0x5432a11f in arp_snapshot arp/arp_table.c:574
    #2 0x5435f0be in netlink_fill_arptable netlink/netlink_route.c:547
    #3 0x5435ffca in netlink_get_neighbor netlink/netlink_route.c:715
    #4 0x54360116 in netlink_get_neighborlist netlink/netlink_route.c:743
    #5 0x54363b20 in netlink_route_sendto netlink/netlink_route.c:1382
    #6 0x542ef1b1 in netlink_sendmsg netlink/netlink_sockif.c:625
    #7 0x542be94d in psock_sendmsg socket/sendmsg.c:96
    #8 0x542bc94b in psock_sendto socket/sendto.c:134
    #9 0x542bcb28 in sendto socket/sendto.c:247
    #10 0x542bc5ea in send socket/send.c:163
    #11 0x542aa715 in netlib_get_arptable /home/mi/gaofengzhi/code/dev1025/apps/netutils/netlib/netlib_getarptab.c:152
    #12 0x54279109 in cmd_arp /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_netcmds.c:1197
    #13 0x54257faf in nsh_command /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_command.c:1263
    #14 0x54231982 in nsh_execute /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_parse.c:718
    #15 0x5423da42 in nsh_parse_command /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_parse.c:2619
    #16 0x5423e12a in nsh_parse /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_parse.c:2706
    #17 0x5424088f in nsh_session /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_session.c:245
    #18 0x5422efc9 in nsh_consolemain /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_consolemain.c:75
    #19 0x5419e89f in nsh_main /home/mi/gaofengzhi/code/dev1025/apps/system/nsh/nsh_main.c:74
    #20 0x54067ee1 in nxtask_startup sched/task_startup.c:70
    #21 0x53f366c6 in nxtask_start task/task_start.c:116
    #22 0x5409e1a4 in pre_start sim/sim_initialstate.c:52

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-29 20:43:15 +08:00
zhanghongyu
306cb3301b include/netinet/if_ether.h: add ethhdr definition.
adapts to third-party code compilation. in the process of porting EtherCAT,
we encounter some situations where the structure is not defined, or the
returned data types do not match the expectations. Refer to the EtherCAT
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-29 18:13:35 +08:00
Xiang Xiao
32784b0898 libc: Refine the arc4random_buf implementation
fill the buffer with getrandom instead random pool
and move the implementation to from crypto to libc

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-26 18:04:21 -03:00
chao an
c6591c0f49 driver/serial: remove return value of up_putc()
modify the prototype of up_putc(): remove the return value

The architecture code does not care about the return value of up_putc(), so removing it saves two statements:

Before:                                                    After:
de4c: e52de004  push  {lr}    @ (str lr, [sp, #-4]!)    |  de4c: e52de004  push  {lr}    @ (str lr, [sp, #-4]!)
de50: e24dd014  sub sp, sp, #20                         |  de50: e24dd014  sub sp, sp, #20
de54: e58d0004  str r0, [sp, #4]                        |  de54: e58d0004  str r0, [sp, #4]
de58: e30030f8  movw  r3, #248  @ 0xf8                  |  de58: e30030f8  movw  r3, #248  @ 0xf8
de5c: e3423000  movt  r3, #8192 @ 0x2000                |  de5c: e3423000  movt  r3, #8192 @ 0x2000
de60: e58d300c  str r3, [sp, #12]                       |  de60: e58d300c  str r3, [sp, #12]
de64: e59d1004  ldr r1, [sp, #4]                        |  de64: e59d1004  ldr r1, [sp, #4]
de68: e59d000c  ldr r0, [sp, #12]                       |  de68: e59d000c  ldr r0, [sp, #12]
de6c: ebfffe66  bl  d80c <pl011_putc>                   |  de6c: ebfffe66  bl  d80c <pl011_putc>
de70: e59d3004  ldr r3, [sp, #4]                        |  de70: e28dd014  add sp, sp, #20
de74: e1a00003  mov r0, r3                              |  de74: e49df004  pop {pc}    @ (ldr pc, [sp], #4)
de78: e28dd014  add sp, sp, #20                         |
de7c: e49df004  pop {pc}    @ (ldr pc, [sp], #4)        |

Signed-off-by: chao an <anchao@lixiang.com>
2024-10-26 13:21:29 +08:00
chao an
052ea5b20d mm/kasan: extern kasan API only MM_KASAN is enabled
this PR will fix g_region_init is incorrectly linked to the image if MM_KASAN is not enabled.

Signed-off-by: chao an <anchao@lixiang.com>
2024-10-25 19:04:14 +08:00
anjiahao
b33226d76e coredump: coredump_add_memory_region need use flags
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-24 08:46:01 +08:00
ligd
e73c05718c tls.h: list.h should depends on CONFIG_PTHREAD_ATFORK
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-23 20:10:43 +08:00
buxiasen
cb720024b6 Revert "libc/lib_bzero:Add bzero prototype."
This reverts commit 908814a575.

In macos, memset will be automatic optmize to bzero, caused dead loop, as we not using bzero, macro re-define should ablt to cover the requirements.

Signed-off-by: buxiasen <buxiasen@gmail.com>
2024-10-23 10:08:23 +08:00
ligd
cdccce48ac libcxx: fix compile error
from ServiceManager.cpp:17:
/home/ligd/platform/dev/apps/external/android/frameworks/native/libs/binder/ndk/include_cpp/android/binder_to_string.h:71:24: error: expected nested-name-specifier before numeric constant
   71 |     template <typename _U>
      |                        ^~
/home/ligd/platform/dev/apps/external/android/frameworks/native/libs/binder/ndk/include_cpp/android/binder_to_string.h:71:24: error: expected ‘>’ before numeric constant
In file included from /home/ligd/platform/dev/apps/external/android/frameworks/native/libs/binder/aidl/android/os/ConnectionInfo.h:3,
                 from /home/ligd/platform/dev/apps/external/android/frameworks/native/libs/binder/aidl/android/os/IServiceManager.h:3,
                 from /home/ligd/platform/dev/apps/external/android/frameworks/native/libs/binder/aidl/android/os/BnServiceManager.h:4:
/home/ligd/platform/dev/apps/external/android/frameworks/native/libs/binder/ndk/include_cpp/android/binder_to_string.h:72:56: error: no matching function for call to ‘declval<1>()’
   72 |     static auto _test(int) -> decltype(std::declval<_U>().toString(), std::true_type());
      |                                        ~~~~~~~~~~~~~~~~^~
In file included from /home/ligd/platform/dev/nuttx/include/libcxx/__type_traits/is_convertible.h:18,

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-23 09:42:57 +08:00
Matteo Golin
bbc95d70db adc: Implement ADC driver interface for MCP3008 over SPI. Includes documentation page for the driver, and inclusion of driver registration code for RP2040-based boards. 2024-10-22 13:56:23 +08:00
Bowen Wang
d17cdbc656 rpmsg/rpmsg_virtio.h: include <openamp/remoteproc.h> to fix compile error
/data/project/code/apache/nuttx/include/nuttx/rpmsg/rpmsg_virtio.h:176:28: error: field ‘rsc_tbl_hdr’ has incomplete type
  176 |   struct resource_table    rsc_tbl_hdr;
      |                            ^~~~~~~~~~~
/data/project/code/apache/nuttx/include/nuttx/rpmsg/rpmsg_virtio.h:178:28: error: field ‘log_trace’ has incomplete type
  178 |   struct fw_rsc_trace      log_trace;
      |                            ^~~~~~~~~
/data/project/code/apache/nuttx/include/nuttx/rpmsg/rpmsg_virtio.h:179:28: error: field ‘rpmsg_vdev’ has incomplete type
  179 |   struct fw_rsc_vdev       rpmsg_vdev;
      |                            ^~~~~~~~~~
/data/project/code/apache/nuttx/include/nuttx/rpmsg/rpmsg_virtio.h:180:28: error: field ‘rpmsg_vring0’ has incomplete type
  180 |   struct fw_rsc_vdev_vring rpmsg_vring0;
      |                            ^~~~~~~~~~~~
/data/project/code/apache/nuttx/include/nuttx/rpmsg/rpmsg_virtio.h:181:28: error: field ‘rpmsg_vring1’ has incomplete type
  181 |   struct fw_rsc_vdev_vring rpmsg_vring1;
      |                            ^~~~~~~~~~~~
/data/project/code/apache/nuttx/include/nuttx/rpmsg/rpmsg_virtio.h:182:28: error: field ‘config’ has incomplete type
  182 |   struct fw_rsc_config     config;

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-22 08:55:57 +08:00
chao an
d49db03e04 libs/misc/memoryregion: remove unused memory_region
memory region will no longer be used

Signed-off-by: chao an <anchao@lixiang.com>
2024-10-18 21:32:48 +08:00
Xiang Xiao
24cb8c25ab bluetooth: Fix the incompatibility made by https://github.com/apache/nuttx/pull/14224
that pr requires chip turn on CONFIG_DRIVERS_BLUETOOTH to use bluetooth,
but not all defconig enable this option, so let's map bt_driver_register
to bt_netdev_register in header file in this case, and revert the unnessary
change in the related chip and board folders.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-18 09:05:54 +08:00
yangguangcai
66e0e1bb7f AVR:disable nosanitize_address.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-10-17 22:52:42 +08:00
jihandong
d802912cba nuttx ai driver update
Signed-off-by: jihandong <jihandong@xiaomi.com>
2024-10-17 22:35:40 +08:00
chengkai
772807c50f bluetooth: add bt_driver_register interface
add bt_driver_register interface, which could handle
these cases:bth4 bth5 btbridge btslip and btuart_lowerhalf_s etc.

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai
3144971704 bluetooth: extract btuart_register interface
add btuart_create interface, which would be more
flexible in complex cases. And extract btuart_register interface.

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai
cc36c44824 bluetooth:add btslip driver
add btslip driver.

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai
8e17e1657b bluetooth: fix bt bridge would not filter vendor hci cmd
when downloading rtk firmware with vendor hci cmd sending to
bt bridge, which would not filter that hci cmd.

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
Ville Juven
2195b47655 smp: Implement empty macro for obtaining logical CPU index
This implements empty hooks to the arch/chip layer, which can implement
an optional translation between logical<->physical CPU/core id.

The default mapping is 1:1 i.e. logical=physical.
2024-10-17 13:43:06 +08:00
Petro Karashchenko
2048715134 serial: remove 'TIOCSLINID'
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-10-17 09:08:58 +08:00
yangsong8
8c13b8df1d syslog: convert \n to \r\n in syslog framework layer
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-10-17 02:29:51 +08:00
anjiahao
a72e9e5621 modlib:if elf in romfs/tmpfs, try use xipbase
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-16 18:40:06 +08:00
anjiahao
112b6fd9a5 modlib:support modlib can load PIC elf
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-16 18:40:06 +08:00
gaohedong
cfc90ad1f3 nuttx/can: support to Send message priority sorting function.
Linked list-based priority sorting function for sending messages.

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2024-10-16 18:37:01 +08:00
dongjiuzhu1
2cf8c25292 drivers/power/battery: add charge/battery health interface support
Signed-off-by: liangdongdong<liangdongdong@xiaomi.com>
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-16 17:33:20 +08:00
zhaohaiyang1
9985b0551e nuttx/can.h: support timestamp for can frame
and update "can.rst" file for add struct timeval ch_ts info.

Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
2024-10-16 17:04:31 +08:00
wurui3
42e416d054 nuttx/audio: increase bits of samplerate in struct audio_info_s.
Current 8 bits of uint8_t cannot represent sample rate bigger than
255,change uint8_t to uint32_t to expand sample rate range.

Signed-off-by: wurui3 <wurui3@xiaomi.com>
2024-10-16 15:40:35 +08:00
wanggang26
848b596a12 coredump: measure the system's running time in milliseconds unit
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-10-16 15:35:21 +08:00
wangxiaoxin
2a99490ed6 add a flag of lin internal sleep/wakeup state
Signed-off-by: wangxiaoxin <wangxiaoxin@xiaomi.com>
2024-10-16 14:33:59 +08:00
renzhiyuan1
91ce3de250 AI engine driver
Add AI engine driver for heterogeneous NPU backends.

Signed-off-by: renzhiyuan1 <renzhiyuan1@xiaomi.com>
2024-10-16 13:57:23 +08:00
Lingao Meng
c2b89540d2 include: queue.h: Make flink clear after sq_rem
In the previous design, this member may be cleared or not cleared,
which results in the API's side effects not being a clear property.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2024-10-16 13:56:49 +08:00
xumin6
1d5f0245ab external/ffmpeg: add offloding audio recording with amr format.
Signed-off-by: xumin6 <xumin6@xiaomi.com>
2024-10-16 13:56:07 +08:00
zhangyuan29
080c22e944 atomic: include stddef.h in atomic.h
error info:
error: expected '=', ',', ';', 'asm' or '__attribute__' before 'atomic_wchar_t'

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-10-16 12:24:18 +08:00
chenzhijia
d52074a9cb libs/libc/unistd: add getspnam function
Add getspnam function to pass tlpi example:
https://man7.org/tlpi/code/online/dist/users_groups/check_password.c.html

Signed-off-by: chenzhijia <chenzhijia@xiaomi.com>
2024-10-16 11:15:25 +08:00
chenzhijia
2a328279ca libs/libc/unistd: add crypt function
Add crypt function to pass tlpi example:
https://man7.org/tlpi/code/online/dist/users_groups/check_password.c.html

Signed-off-by: chenzhijia <chenzhijia@xiaomi.com>
2024-10-16 11:15:25 +08:00
chenzhijia
ad70ca33c8 libs/libc/unistd: add getpass function
Add getpass function to pass tlpi example:
https://man7.org/tlpi/code/online/dist/users_groups/check_password.c.html

Signed-off-by: chenzhijia <chenzhijia@xiaomi.com>
2024-10-16 11:15:25 +08:00
chenzhijia
c0039d6623 libs/libc/pwd: add new member to passwd struct
Add pw_passwd member to pass tlpi example:
https://man7.org/tlpi/code/online/dist/users_groups/check_password.c.html

Signed-off-by: chenzhijia <chenzhijia@xiaomi.com>
2024-10-16 11:15:25 +08:00
hanqiyuan
c7455e7e8e audio: add offload underflow msg state
Signed-off-by: hanqiyuan <hanqiyuan@xiaomi.com>
2024-10-16 08:11:04 +08:00
anjiahao
0bd9c8d7ae Kconfig:Add an option to disable compilation of floating point related files
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-16 07:58:00 +08:00
chenzhijia
65fbf4cf64 nuttx/include:Modify the CPU_SET series macro definition in sched.h
Modify the CPU_SET series macro definition to avoid an error when shifting 31 bits to the left.

Signed-off-by: chenzhijia <chenzhijia@xiaomi.com>
2024-10-15 21:05:36 +08:00
chenzhijia
aca7552d9c nuttx/include:add #define CPU_SETSIZE in sched.h
add #define CPU_SETSIZE in sched.h to pass tlpi example: https://man7.org/tlpi/code/online/dist/procpri/t_sched_getaffinity.c.html

Signed-off-by: chenzhijia <chenzhijia@xiaomi.com>
2024-10-15 21:05:36 +08:00
wangxiaoxin
366ede9530 add lin status changes the format of the reported frame and add the macros that lin needs
Signed-off-by: wangxiaoxin <wangxiaoxin@xiaomi.com>
2024-10-15 19:45:38 +08:00
wanggang26
d22ad37cd7 elf:fix a ci error
Configuration/Tool: teensy-2.0/nsh
In file included from
/github/workspace/sources/nuttx/include/nuttx/coredump.h:35:0,
                 from
/github/workspace/sources/nuttx/sched/misc/coredump.h:28,
                 from ./init/nx_bringup.c:54:
/github/workspace/sources/nuttx/include/nuttx/elf.h:31:22: fatal error:
arch/elf.h: No such file or directory

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-10-15 19:41:26 +08:00
hujun5
a567148888 sched: add up_this_task and up_change_task macro stub
reason:
We can utilize percpu storage to hold information about the
current running task. If we intend to implement this feature, we would
need to define two macros that help us manage this percpu information
effectively.

up_this_task: This macro is designed to read the contents of the percpu
              register to retrieve information about the current
              running task.This allows us to quickly access
              task-specific data without having to disable interrupts,
              access global variables and obtain the current cpu index.

up_update_task: This macro is responsible for updating the contents of
                the percpu register.It is typically called during
                initialization or when a context switch occurs to ensure
                that the percpu register reflects the information of the
                newly running task.

Configuring NuttX and compile:
$ ./tools/configure.sh -l qemu-armv8a:nsh_smp
$ make
Running with qemu
$ qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic \
   -machine virt,virtualization=on,gic-version=3 \
   -net none -chardev stdio,id=con,mux=on -serial chardev:con \
   -mon chardev=con,mode=readline -kernel ./nuttx

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-15 15:25:55 +08:00
cuiziwei
8d7ee794f4 nuttx/elf.h: Fix build error with unknown type name 'bool'.
nuttx/include/nuttx/elf.h:118:1: error: unknown type name 'bool'
  118 | bool up_checkarch(FAR const Elf_Ehdr *hdr);
      | ^~~~
nuttx/include/nuttx/elf.h:30:1: note: 'bool' is defined in header '<stdbool.h>'; did you forget to '#include <stdbool.h>'?
   29 | #include <arch/elf.h>
  +++ |+#include <stdbool.h>
   30 |

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-15 12:35:10 +08:00
wanggang26
7e5fb8450f coredump: add architecture-specific registers dump, including NVIC and MPU
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-10-15 11:40:05 +08:00
wanggang26
9b094e8f0d mmcsd:add postsleep fields for mmc_ioc_cmd
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-10-15 02:06:00 +08:00
ligd
7d218f93fa libc: add nx_strdup() & nx_strndup() support
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-15 01:16:48 +08:00
chao an
2a65a34bee Revert "pthread: We should not directly include arch/spinlock.h as it may cause compilation errors in C++."
This reverts commit 444a9fbcd6.
2024-10-14 17:42:16 +08:00
chao an
ce42a9affc Revert "sched/spinlock: remove nesting spinlock support"
This reverts commit 5aa13bc490.
2024-10-14 17:42:16 +08:00
hujun5
b964eeee18 Reapply "sched/spinlock: remove nesting spinlock support"
This reverts commit 9e81f5efac.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-13 18:31:35 +08:00
zhangwenjian
7a3c50b3db noteram:support binary read mode
Signed-off-by: zhangwenjian <zhangwenjian@xiaomi.com>
2024-10-13 14:05:50 +08:00
wangmingrong
1b3f3d19e9 noteram: fix variable type
Signed-off-by: wangmingrong <wangmingrong@xiaomi.com>
2024-10-13 14:05:50 +08:00
zhangwenjian
149b1f186e drivers/note:add the api of sched_note_add
Signed-off-by: zhangwenjian <zhangwenjian@xiaomi.com>
2024-10-13 14:05:50 +08:00
zhangwenjian
7aa1871664 note:support filter for each note channel
Signed-off-by: zhangwenjian <zhangwenjian@xiaomi.com>
2024-10-13 14:05:50 +08:00
yinshengkai
c018be66bd note: merge nc_systime_nsec and sec
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-13 14:05:50 +08:00
yintao
d2fc3f21de net/rpmsg: use hash to handle rp_name
expand the user's rpname size
hash when exceed RPMSG_SOCKET_NAME_LEN due to the limitation of eptname

Signed-off-by: yintao <yintao@xiaomi.com>
2024-10-13 11:33:04 +08:00
YanXiaowei
356ddee5b8 support trace_beginex and trace_endex
Signed-off-by: YanXiaowei <yanxiaowei@xiaomi.com>
2024-10-13 10:23:44 +08:00
chenrun1
9e81f5efac Revert "sched/spinlock: remove nesting spinlock support"
This reverts commit 5aa13bc490.
2024-10-13 09:41:59 +08:00
chenzhijia
505adfa277 nuttx:move "#define STRINGIFY(x)" to nuttx/macro.h
Franklin requirement, "#define STRINGIFY(x)" conflicts with https://github.com/mborgerding/kissfft define

Signed-off-by: chenzhijia <chenzhijia@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-13 03:16:25 +08:00
yinshengkai
38e474b0c5 libc: add CRC-8-ROHC support
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-13 03:09:26 +08:00
yangshuyong
c1eee1cc29 Changed the i3c_priv_xfer's member to flags from rnw
Signed-off-by: yangshuyong <yangshuyong@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-13 02:49:05 +08:00
Bowen Wang
143466baed drivers/pci: fix pci framework warning in 32bit chip
In file included from pci/pci.c:30:
pci/pci.c: In function 'pci_setup_device':
pci/pci.c:449:66: warning: right shift count >= width of type [-Wshift-count-overflow]
  449 |           pci_write_config_dword(dev, base_address_1, res->start >> 32);
      |                                                                  ^~
pci/pci.c: In function 'pci_presetup_bridge':
pci/pci.c:541:51: warning: right shift count >= width of type [-Wshift-count-overflow]
  541 |                              ctrl->mem_pref.start >> 32);
      |                                                   ^~
pci/pci.c: In function 'pci_postsetup_bridge':
pci/pci.c:604:57: warning: right shift count >= width of type [-Wshift-count-overflow]
  604 |                              (ctrl->mem_pref.start - 1) >> 32);
      |                                                         ^~
CC:  pthread/pthread_release.c pci/pci_ecam.c:71:12: warning: initialization of 'int (*)(struct pci_bus_s *, unsigned int,  int,  int,  uint32_t *)' {aka 'int (*)(struct pci_bus_s *, unsigned int,  int,  int,  long unsigned int *)'} from incompatible pointer type 'int (*)(struct pci_bus_s *, uint32_t,  int,  int,  uint32_t *)' {aka 'int (*)(struct pci_bus_s *, long unsigned int,  int,  int,  long unsigned int *)'} [-Wincompatible-pointer-types]
   71 |   .read  = pci_ecam_read_config,
      |            ^~~~~~~~~~~~~~~~~~~~
pci/pci_ecam.c:71:12: note: (near initialization for 'g_pci_ecam_ops.read')
pci/pci_ecam.c:72:12: warning: initialization of 'int (*)(struct pci_bus_s *, unsigned int,  int,  int,  uint32_t)' {aka 'int (*)(struct pci_bus_s *, unsigned int,  int,  int,  long unsigned int)'} from incompatible pointer type 'int (*)(struct pci_bus_s *, uint32_t,  int,  int,  uint32_t)' {aka 'int (*)(struct pci_bus_s *, long unsigned int,  int,  int,  long unsigned int)'} [-Wincompatible-pointer-types]
   72 |   .write = pci_ecam_write_config,

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-13 02:28:32 +08:00
hujun5
444a9fbcd6 pthread: We should not directly include arch/spinlock.h as it may cause compilation errors in C++.
Instead, we should use nuttx/spinlock.h.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-13 02:27:58 +08:00
Bowen Wang
bc97e73aee include/.gitignore: add openlibm to gitignore
avoid git add incorrect files

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-13 02:27:28 +08:00
yinshengkai
c23878e442 sched: modify CONFIG_DUMP_ON_EXIT to CONFIG_SCHED_DUMP_ON_EXIT
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-13 02:06:38 +08:00
Bowen Wang
b5b0430c39 net/vsock: add AF_VSOCK address family
Add AF_VSOCK address family support, This is the vsock framework
preparation patch.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-13 02:02:03 +08:00
p-szafonimateusz
4e69a3d2db include/nuttx/arch.h: MSI alloc API should be always available
MSI-like interrupts delivery can be used also for other devices than PCI, e.g HPET

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-10-13 00:33:29 +08:00