Commit Graph

54355 Commits

Author SHA1 Message Date
hujun5
427e5f18e8 irq: irq with the same priority share the same wqueue
reason:
1 We place interrupt handling functions of the same priority into the work queue corresponding
to that priority, allowing high-priority interrupts to preempt low-priority ones,
thus ensuring the real-time performance of high-priority interrupts.

2 The sole purpose of the interrupt handler is to wake
up the work queue of the corresponding priority and execute the interrupt handling function.

3 Compared to the functionality of isr threads, this
approach saves more memory, particularly when the number of interrupts is large.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-06 17:43:11 +08:00
Petro Karashchenko
c6a7816bed libs/libm/libm: increase number of 'log' iterations before epsilon relaxation
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-09-06 17:40:57 +08:00
Petro Karashchenko
02b1e895e2 libs/libm/libm: apply epsilon relax factor only if epsilon is small
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-09-06 17:40:57 +08:00
Petro Karashchenko
9cfb10069c Revert "libs/libm: fix epsilon relaxation in log and logf"
This reverts commit a2ed0ddd72.
2024-09-06 17:40:57 +08:00
hujun5
c45e4ac440 boardcrtl: change BOARDCTL_TESTSET to BOARDIOC_SPINLOCK
reason:
BOARDIOC_SPINLOCK can support the combined semantics
of disabling interrupts (irq), trylock, and spinlock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-06 16:10:09 +08:00
Xiang Xiao
659448a9d8 fs/hostfs: Replace strcpy with memcpy
The strcpy function is dangerous because it does not check the length of the

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-09-06 12:27:55 +08:00
chenrun1
44351959ee mmcsd_sdio:Limit the use of sleep in mmcsd.
reference:https://github.com/apache/nuttx/pull/12971

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-09-06 12:25:55 +08:00
chenrun1
0e13ea9ed1 mmcsd_sdio:Fix performing read and write in irq
In some usage scenarios, read and write tasks will be performed during interruptions. If sleep is used at this time, it will cause a timeout crash. Therefore, a macro is added to determine whether it is currently interrupted to select sleep/delay.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-09-06 12:25:55 +08:00
hujun5
40ae660d30 init: add OSINIT_TASK_READY
reason:
simplifying some code writing

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-06 11:25:34 +08:00
lipengfei28
aeb98d9c05 fix Compile error
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
lipengfei28
5c119b4a03 refresh the pci test config
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
lipengfei28
b70922cb24 pci: add ioctl for userspace
which is same as OpenBSD:
https://github.com/openbsd/src/blob/master/sys/sys/pciio.h

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
lipengfei28
dba7700813 pci: add rom addr and rom size to resource
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
lipengfei28
3250625a15 pci: add find device from bus
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
lipengfei28
9dc9500aaf pci add register drivers
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
lipengfei28
c25f839b06 pci: add pci bus find capability interface
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
lipengfei28
45f1597562 pci: add pci read/write config/io space interface
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
lipengfei28
d9c8838319 pci: use g_pci_ctrl_list replace g_root_bus_list
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
yangshuyong
75f8c72dbb drivers/pci/pci_qemu_edu: update qemu edu driver code
Signed-off-by: yangshuyong <yangshuyong@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
yangshuyong
9c07b369e9 drivers/pci/pci_qemu_test: update qemu pci test code
Change the qmeu pci test code for new pci driver framework

Signed-off-by: yangshuyong <yangshuyong@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
yangshuyong
7cbb7d36d8 Changed the x86 64 pci driver
Signed-off-by: yangshuyong <yangshuyong@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
yangshuyong
125884ae95 Changed the pci bus for arm architecture
Signed-off-by: yangshuyong <yangshuyong@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
yinshengkai
cec3b5c0fb boards: Add TLS_NELEM dependency to libcxxabi
Refresh all defconfig

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-09-06 09:52:33 +08:00
yinshengkai
a055734912 libcxx: adds tls&libcxxabi dependency
If libcxxabi is not enabled, the toolchain default implementation will be used. However, arm-gcc does not enable thread
support by default, which will cause errors in a multi-threaded environment.

libcxx depends on pthread_key_create

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-09-06 09:52:33 +08:00
yinshengkai
6d39b248a4 libcxxabi: fix compilation warnings
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-09-06 09:52:33 +08:00
yinshengkai
ad76a4f7a9 libcxxabi: libcxxabi enables exceptions by default
In the following code, even though the application does not use exceptions, an exception is still thrown in libcxx

If libcxxabi is not enabled, the toolchain default implementation will be used. However, arm-gcc does not enable thread
support by default, which will cause errors in a multi-threaded environment.

Therefore, we need to use libcxxabi to ensure normal functions in a multi-threaded environment.

using namespace std;

void foo(bool recur);
int bar(bool recur)
{
  if (recur) {
      foo(false);
  }
  return 0xFAFAFA;
}

void foo(bool recur)
{
  static int i = bar(recur);
  cout << "Static is:" << i << "\n";
}

int main(int argc, char *argv[])
{
  foo(true);
  return 0;
}

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-09-06 09:52:33 +08:00
yinshengkai
b721f2c84e libcxx: Disable dynamic type checking when enabling libcxxabi
It results in a recursive call, cxxabiv1::__dynamic_case -> is_equal -> __ubsan::checkDynamic -> cxxabiv1::__dynamic_case

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-09-06 09:52:33 +08:00
Filipe Cavalcanti
2af7037fa1 xtensa/esp32s2: add WiFi support on ESP32S2 2024-09-06 09:46:59 +08:00
Filipe Cavalcanti
4915338857 xtensa/esp32s2: fix for timers and watchdog init on startup 2024-09-06 09:46:59 +08:00
Filipe Cavalcanti
2e884cbd11 xtensa/esp32s2: add support for shutdown handlers 2024-09-06 09:46:59 +08:00
yinshengkai
6ac1299218 nrf91: fix cmake compiler error
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-09-06 09:42:53 +08:00
yinshengkai
d7f02a8cb6 sched: change pthread_mutex implementation from sem to mutex
Since pthread_mutex is implemented by sem, it is impossible to see in ps who holds the lock and causes the wait.
Replace sem with mutex implementation to solve the above problems

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-09-06 09:42:53 +08:00
yinshengkai
2fd3981a8e pthread: remove pshared parameter from pthread_mutex_init
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-09-06 09:42:53 +08:00
yinshengkai
4feb418e36 pthread: remove the code which save and restore mutex state in pthread_condwait
type and flags are only initialized in mutex_init and should not change in the middle

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-09-06 09:42:53 +08:00
hujun5
608b59e401 smp: enable smp_call in all smp arch
reason:
In subsequent implementations, we will replace up_cpu_pause with smp_call.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-06 07:11:38 +09:00
hujun5
ea181e2621 arm: armv7-a/r and armv8-r up_cpu_index inline
reason:
inline small code to improve performance

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-06 03:44:49 +08:00
yinshengkai
da6ddea8d4 arch/arm: support kernel heap in BUILD_FLAT mode
Make umm & kmm heap alloc more clear, and possible support FLAT build to
enable kernel heap.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-09-05 11:19:47 -03:00
hujun5
874c0b002c spinlock: spin_initialize should add memory barrier
reason:
spin_initialize is often used to release a lock,
and if we don't include a memory barrier,
it may lead to the lock being released prematurely.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-05 21:28:52 +08:00
hujun5
855060f353 sched: Make sure that affinity mask is valid
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-05 21:26:58 +08:00
shizhenghui
af19a22b11 ci-docker: add subversion to linux dockerfile
Add subversion to install list ensure linux docker
can use svn command to download source code.

Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-09-05 21:25:46 +08:00
hujun5
e1b9144e71 can: Before we use pstate, we should check if it is NULL.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-05 21:25:22 +08:00
chao an
dedb4c95c9 armv8-r/r52: add neon support into compiler line
1. correct the armv8-r fpu flag from vfpv3-d16 to fpv5-sp-d16
2. add neon support

This commit updates the build script to specify the FPU type of
`fpv5-sp-d16` when the processor is configured with a single-precision
FPU, and `neon-fp-armv8` when the processor is configured with a
double-precision + Advanced SIMD-capable FPU.

Note that the `fp-armv8` FPU type is an alias for double-precision FPv5
with 32 double-precision registers (refer to the GCC
`gcc/config/arm/arm-cpus.in` for more details); NEON is always
specified in case of a double-precision configuration because the
Cortex-R52 can only be configured as such.

Reference:
https://developer.arm.com/Processors/Cortex-R52

Instruction set:

Arm and Thumb-2. Supports DSP instructions and a configurable Floating-Point
Unit either with single-precision or double precision and Neon.

Signed-off-by: chao an <anchao@lixiang.com>
2024-09-05 09:52:51 -03:00
hujun5
a65adcd9db smp: smp call handler add up_cpu_paused_[save|restore]
reason:
Since smp call handler may lead to context switching,
we need to update the context information by calling up_cpu_paused_[save|restore].

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-05 09:35:17 -03:00
tfzou
fad8a22074 arm: Add support for CSK6011A SOC and CSK6011A-NANO board
Signed-off-by: tfzou <tfzou@listenai.com>
2024-09-05 09:34:33 -03:00
hujun5
198630a809 sched: use this_task replace nxsched_self
reason:
We can reduce a function call to improve performance.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-05 09:33:50 -03:00
TAiGA
cc0d4af20a tools/mksymtab: support for structure 2024-09-05 15:54:49 +08:00
fangxinyong
7b05a550dc sched: replace up_cpu_index with this_cpu
Make this_cpu is arch independent and up_cpu_index do that.
In AMP mode, up_cpu_index() may return the index of the physical core.

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2024-09-05 12:09:24 +08:00
YAMAMOTO Takashi
fb58ac99fa esp32_psram.c: Remove a seemingly stale comment 2024-09-05 11:49:31 +08:00
chao an
2465b67c84 cmake/tricore: filter out nostdlib in linker phase to avoid build break
Regression by:

| commit b64fb09e6c
| Author: xuxin19 <xuxin19@xiaomi.com>
| Date:   Tue Jul 16 15:50:13 2024 +0800
|
|     cmake:bugfix fix CMake LTO build block
|
|     it was wrong in https://github.com/apache/nuttx/pull/12423/files#r1618852245
|     EXTRA_FLAGS is useful in LTO for pass option tu lto linker
|
|     Signed-off-by: xuxin19 <xuxin19@xiaomi.com>

Signed-off-by: chao an <anchao@lixiang.com>
2024-09-05 11:47:06 +08:00
Kevin Zhou
fc6bcd6600 xtensa/esp32s3: Add timing delay set interface for QSPI 2024-09-05 11:36:18 +08:00