Commit Graph

56135 Commits

Author SHA1 Message Date
yangguangcai fba3967f2f strcpy:skip ubsan check.
string/lib_strcpy.c:87:15: runtime error: signed integer overflow: -2132367969 - 16843009 cannot be represented in type 'long int'
    #0 0x48e77096 in strcpy string/lib_strcpy.c:87
    #1 0x535b6ea4 in libconfig_strbuf_append_string libconfig/lib/strbuf.c:60
    #2 0x53ad7f52 in libconfig_yyparse /home/ygc/ssd/x4b-sim/external/libconfig/grammar.y:186
    #3 0x5358d281 in __config_read libconfig/lib/libconfig.c:561
    #4 0x5358dea0 in config_read_file libconfig/lib/libconfig.c:677
    #5 0x52cdd0a5 in tts_vendor_list_get src/vendor.c:114
    #6 0x52cde739 in default_tts_vendor_get src/vendor.c:356
    #7 0x52a07e1d in vendorswitch_init src/vendorswitch/vendorswitch.c:501
    #8 0x52444fb9 in mico_misc_main /home/ygc/ssd/x4b-sim/vendor/xiaomi/miai/mico_misc/instance/main.c:72
    #9 0x48bee720 in nxtask_startup sched/task_startup.c:70
    #10 0x48b41eb4 in nxtask_start task/task_start.c:112
    #11 0x48c1ef3d in pre_start sim/sim_initialstate.c:52

Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-10-17 22:52:42 +08:00
yangguangcai c113a224e8 newlibc:skip asan check.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-10-17 22:52:42 +08:00
yangguangcai 6e87f11083 Merge the newlibc string into NuttX.
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 6aeb2e2996 Add space before error, bt_driver_register_internal not trigger error, add defconfig DRIVERS_BLUETOOTH.
Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
fangzhenwei d97b715e5c drivers: append bt_driver.c to bluetooth drivers Cmakelist.
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2024-10-17 18:09:32 +08:00
fangzhenwei 7a97eef679 serial: use dev references count make sure the driver only opened once
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2024-10-17 18:09:32 +08:00
duqunbo dfbeba3536 filter redundant hci reset commands due to dual Bluetooth protocol stacks
Signed-off-by: duqunbo <duqunbo@xiaomi.com>
2024-10-17 18:09:32 +08:00
wangzhi7 8b68f9d816 [bt_uart.c] fix bug:cant receive data
rootcause: in btuart_rxwork, read data in blocking mode and btuart_read do three times, maybe remote send some packets one time,so it wont read the sencond packets.

Signed-off-by: wangzhi7 <wangzhi7@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai 31605b6335 bluetooth: call bt_driver_register common interface
Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +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 b66f1147e6 bluetooth: set bt_driver_register/unregister to xx_set/unset
change bt_driver_register/unregister function name to
bt_driver_set/unset, which would be prepared for bt_driver.h

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 cae60fb4a0 bluetooth: increase HCI RX buffer size.
BLUETOOTH_MAX_FRAMELEN  buffer size is only for LE only mode.
then we need to increase HCI buffer size in BR/EDR and LE mode.

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai aeb3051aba bluetooth: fix bt_slip_send would always block
rootcause: semcount maybe zero when nxsem_wait_uninterruptible

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai 00eb8f6461 bluetooth: remove noblock mode handle
rootcause: move block and noblock handle to BTH4 handle.

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai 113b660aa6 bluetooth: fix dev->rxlen is considered to have possibly overflowed
rootcause: fix the expression dev->rxlen is considered to
have possibly overflowed.

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai 3fb63c20d4 bluetooth: fix packet pointer may refer to null
rootcasue: when packet is null, packet var in for loop would
refer to null memory.

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
cuiziwei a55d62f477 gnu++20:fix build warning to [-Wmaybe-uninitialized].
17:10:41  wireless/bluetooth/bt_slip.c:300:7: error: 'byte' may be used uninitialized [-Werror=maybe-uninitialized]
17:10:41    300 |       wlerr("err: invalid escape byte %x\n", *byte);
17:10:41        |       ^
17:10:41  wireless/bluetooth/bt_slip.c: In function 'bt_slip_receive':
17:10:41  wireless/bluetooth/bt_slip.c:766:11: note: 'byte' was declared here
17:10:41    766 |   uint8_t byte;
17:10:41        |           ^~~~

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai 65fdc5548e bluetooth: add slip SLIP_ESC case break
H5 SLIP_ESC magic payload whould be encode with
SLIP_ESC and SLIP_ESC_ESC

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai af843eb798 bluetooth: check work_available with retxworker
retxworker would delay when there are many tx hci data

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai 946dad5ff0 bluetooth: add nxmutex_lock check
Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai 933841d985 bluetooth:support read imcompleted hci data from blueooth socket
hci data from bluetooth socket maybe imcompleted hci data.

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai fee8b443dd bluetooth:add btslip checksum log for debug
add send btslip checksum log for debug

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 67d51bdf4c bluetooth:add bth5 with btslip and bth4
add bth5 with btslip and bth4, which will be more flexible in
btbridge or rpmsghci cases.

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
chengkai f0b7f48adf bluetooth:fix h5 ack to controller timeout
h5 ack which send to controller always timeout, which causing
controller would send repend hci data until host send back h5 ack.

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai c55fcb59b8 bluetooth:fix bt bridge acl data connect handle not match
bt bridge filter would not match when ACL in data
head with Packet_Boundary_Flag 0b10. in that case connect handle
is the first 3 octets of the packet, which not match
BT_HCI_EVT_LE_CONN_COMPLETE hci event alloc handle.

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai a9db2f12de wireless/bluetooth: fix ioctl no match driver param
Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai ab991be178 serial/uart/h5: fix hci cmd error when splitting type and value
Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
YAMAMOTO Takashi 4bfde8858d Discourage the use of LIBC_PRINT_EXTENSION
See the discussion in https://github.com/apache/nuttx/pull/13536
2024-10-17 18:08:23 +08:00
Ville Juven 8811eee0f4 riscv_cpustart.c: Fix reading of interrupt status
Let's read the interrupt status correctly, by checking for the interrupt
source bit instead of assuming no other status bit is set.
2024-10-17 18:08:10 +08:00
Ville Juven 8fe3ab3e39 arch/arm64: Remove arm64_copystate.c
The file is not referenced from anywhere and is obsolete / dead code anyway
-> remove it from the index.
2024-10-17 18:07:54 +08:00
Ville Juven 737dc4fcdd arch/riscv: Implement cpuid mapping
Implement hartid<->cpuid mapping for RISC-V. This is necessary for some
platforms which cannot use 1:1 mapping between logical and physical CPU /
core IDs. One example is MPFS where hart0 cannot be used for NuttX SMP as
it is a less capable "monitor" core (E51) compared to the application
cores hart1...3 (E54).

Why not just use a generic offset then? We also need the physical hart ID
for many things:
- Communication between harts (IPI)
- External interrupt acknowledgment (interrupt claim for specific CPU)
- Communication to SBI

Thus, create procedures that can do this translation:
- The default mapping is still logical=physical.
- Another flavor is to use the existing CONFIG_ARCH_RV_HARTID_BASE config
  variable, which is just a simple offset
- The final flavor is to overload hartid<->cpuid on a per chip basis (no
  example for this is provided yet)
2024-10-17 13:43:06 +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
Ville Juven f47c0a1953 arch/riscv: Remove CONFIG_ARCH_RV_HARTID_BASE offset from riscv_mhartid
The function is supposed to return the physical hart ID. It is needed
for e.g. external interrupt acknowledgment (see mpfs_plic.c).

This offset is moved initially to up_cpu_index (which is also wrong, but
less wrong than the current implementation). Finally, a translation
between physical <-> logical shall be provided.
2024-10-17 13:43:06 +08:00
Ville Juven e384a6a625 libs/modlib.c: Set VMA for empty and unallocated sections
This fixes issue where empty and unallocated sections are left without
a VMA. Some relocations depend on the section VMA being set even if there
is no data there, as the binary can refer to the symbols. Linker defined
symbols do not contain data -> they can produce empty sections.

This issue is seen when building a loadable file which declares _sctors /
_sdtors linker defined symbols for ctor/dtor sections which are empty.
crt0 references these symbols, so they need to be relocated, but the
section VMA is not set -> they go outside of the addressable range of the
user binary causing a potential crash.
2024-10-17 13:38:01 +08:00
lipengfei28 ef350afd28 Revert "arch/arm64: add CONFIG_ARCH_VMA_MAPPING"
This reverts commit e7326cfa62.
2024-10-17 12:28:58 +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
Petro Karashchenko 919242d8b9 arch/arm/samv7: fix warnings in rswdt
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-10-17 09:08:01 +08:00
Petro Karashchenko beda2abe3b arch/arm/samv7: fix preprocessor logic for ethernet
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-10-17 09:08:01 +08:00
yinshengkai 5aa48061c9 mm: fix mempool default recording backtrace
Need to initialize procfs.backtrace to false if it's disabled.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-17 09:05:11 +08:00
Neo Xu 9c6c56c255 mempool: use backtrace_format
There's no need to manually format the backtrace any more.

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-10-17 09:05:11 +08:00
anjiahao 62850f3163 mempool:when deinit mempool,need mark dict NULL before free
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-17 09:05:11 +08:00
Matteo Golin 394530e3c2 ci: documentation workflow is now only triggered when the Documentation subdirectory has modifications, and does not build pdfs. 2024-10-17 09:04:50 +08:00
Jukka Laitinen d6c795dda3 imx9/flexcan: Make self reception disable to be configurable
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-10-17 09:02:17 +08:00
Xiang Xiao c6aed84638 tools: Rename apps-or-nuttx-Make.defs to Make.defs
follow the same pattern as other Make.defs files

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-17 07:55:02 +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
Xiang Xiao 67ed036227 libc: Make getcwd() work even CONFIG_DISABLE_ENVIRON is enabled
since getcwd() can be implemented correctly without using environ

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-16 23:59:07 +08:00