Xiang Xiao
556a81d8e4
Revert "Use small lock to protect usbdev and endpoint in arch mips"
...
This reverts commit ac2b495945 .
2025-02-13 14:15:43 +08:00
Xiang Xiao
9e687ca896
Revert "Use small lock to protect resources related to irq in arch avr, hc, mips and or1k."
...
This reverts commit bed3bd0852 .
2025-02-13 14:15:43 +08:00
Xiang Xiao
0021e7731a
Revert "Because sched_lock is now called in spin_lock_irqsave, there is no need to call it explicitly."
...
This reverts commit b0af946b7a .
2025-02-13 14:15:43 +08:00
Xiang Xiao
61620affe6
Revert "Use small lock to protect resources related to i2c."
...
This reverts commit 919ed2e3d4 .
2025-02-13 14:15:43 +08:00
Xiang Xiao
83c2bcb33a
Revert "Use small lock to protect resources related to ethernet."
...
This reverts commit 60125038fc .
2025-02-13 14:15:43 +08:00
wangzhi16
60125038fc
Use small lock to protect resources related to ethernet.
...
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-01-24 12:13:28 +08:00
wangzhi16
919ed2e3d4
Use small lock to protect resources related to i2c.
...
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-01-24 01:38:16 +08:00
wangzhi16
b0af946b7a
Because sched_lock is now called in spin_lock_irqsave, there is no need to call it explicitly.
...
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-01-23 20:43:51 +08:00
wangzhi16
bed3bd0852
Use small lock to protect resources related to irq in arch avr, hc, mips and or1k.
...
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-01-22 15:27:30 +08:00
wangzhi16
ac2b495945
Use small lock to protect usbdev and endpoint in arch mips
...
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-01-15 17:14:23 +08:00
buxiasen
89455bc9a1
arch: up_getusrsp change to inline and implement in irq.h
...
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-01-06 23:03:05 +08:00
wangzhi16
893c5e92c2
Reduce the size of tcb by four bytes.
...
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-01-02 23:18:42 +08:00
hujun5
798695a4f7
use small lock in following files:
...
arch/arm/src/tiva/common/tiva_hciuart.c
arch/arm/src/tms570/tms570_lowputc.c
arch/arm/src/xmc4/xmc4_serial.c
arch/arm64/src/a64/a64_serial.c
arch/mips/src/pic32mx/pic32mx_serial.c
arch/mips/src/pic32mz/pic32mz_serial.c
arch/risc-v/src/c906/c906_serial.c
arch/risc-v/src/fe310/fe310_serial.c
arch/risc-v/src/hpm6750/hpm6750_serial.c
arch/risc-v/src/k210/k210_serial.c
arch/sparc/src/bm3803/bm3803-serial.c
arch/sparc/src/bm3823/bm3823-serial.c
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-23 22:48:35 +08:00
hujun5
ecdff659d1
modifyreg[8|32]: use small lock in modifyreg[8|32]
...
reason:
We would like to replace the big lock with a small lock.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-19 21:55:21 +08:00
hujun5
75ddce6e3a
modifyreg16: use small lock in modifyreg16
...
reason:
We would like to replace the big lock with a small lock.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-18 20:28:26 +08:00
hujun5
188a7ce990
gpio: use small lock to protect configgpio
...
reason:
We would like to replace the critical section with a small lock.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-17 16:37:59 +08:00
hujun5
bc844509e2
addrenv: Ensure that the transmission parameter of addrenv_switch is not NULL
...
reason:
avoid obtaining this_task multiple times.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-04 14:20:12 +08:00
Alin Jerpelea
d69ac54147
arch/misps: migrate to SPDX identifier
...
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-02 22:43:23 +08:00
hujun5
19b4911d7f
arch: remove up_current_regs in common code
...
reason:
When entering an exception or interrupt, there are two sets of registers:
one is the "running regs", which we need to save,
and the other is the "ready to running regs", which we may soon use.
For consistency in logic, we can always store the "running regs" in the regs field of g_running_tasks,
otherwise it may lead to errors in the storage location of the "running regs."
When we need to access the "running regs," we should uniformly retrieve them from the regs field of g_running_tasks.
As the next step, we will rename the set_current_regs/up_current_regs functions
for each architecture to more appropriate names, solely for the purpose of identifying interrupts.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-15 18:25:35 +08: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
cuiziwei
12fd5ec472
nuttx: Add LIBSUPCXX_TOOLCHAIN to link the prebuilt library provide by toolchain.
...
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-24 01:38:03 +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
hujun5
1ff49872a7
arch: There is no need to use sched_[un]lock
...
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-12 13:28:23 +08:00
anjiahao
e5f9b42ea0
binfmt/libelf:Remove libelf implementation [2/2]
...
this commit is part two, all logic move to modlib, so we can remove it.
and change all use defconfig
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-12 12:29:06 +08:00
anjiahao
9ed93c6b1e
unify MODULE & ELF flag to Toolchain.defs
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-08 19:56:33 +08:00
buxiasen
0b3859521a
arch: fix the sched parameter update when exiting
...
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-08 13:53:06 +08:00
hujun5
f132ed2edb
signal: adjust the signal processing logic to remove the judgment
...
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-07 13:32:57 +08:00
hujun5
7eea4223ee
arch: move sigdeliver to common code
...
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-07 13:32:57 +08:00
hujun5
eae57cb0e6
sched: replace sync pause with async pause for nxtask_terminate
...
reason:
In the kernel, we are planning to remove all occurrences of up_cpu_pause as one of the steps to
simplify the implementation of critical sections. The goal is to enable spin_lock_irqsave to encapsulate critical sections,
thereby facilitating the replacement of critical sections(big lock) with smaller spin_lock_irqsave(small lock)
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-06 09:26:56 +08:00
ligd
551e6ce3ab
compile: add DEBUG_SYMBOLS_LEVEL allow custom the level
...
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-09-27 00:13:07 +08:00
anjiahao
c76e83beaa
Debug option:change -g to -g3, add macro information to elf
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-09-27 00:13:07 +08:00
Masayuki Ishikawa
df298c186f
Revert "build depend:Revert Make.dep intermediate ddc file"
...
This reverts commit ddc3119c4e .
2024-09-15 19:29:47 +08:00
xuxin19
ddc3119c4e
build depend:Revert Make.dep intermediate ddc file
...
Revert "Parallelize depend file generation"
This reverts commit d5b6ec450f .
parallel depend ddc does not significantly speed up compilation,
intermediately generated .ddc files can cause problems if compilation is interrupted unexpectedly
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-15 10:01:58 +08:00
hujun5
908df725ad
arch: use up_current_regs/up_set_current_regs replace CURRENT_REGS
...
reason:
1 On different architectures, we can utilize more optimized strategies
to implement up_current_regs/up_set_current_regs.
eg. use interrupt registersor percpu registers.
code size
before
text data bss dec hex filename
262848 49985 63893 376726 5bf96 nuttx
after
text data bss dec hex filename
262844 49985 63893 376722 5bf92 nuttx
size change -4
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-09-13 23:18:58 +08:00
meijian
a7224cf35a
net/netstatistics: add tx/rx bytes statistics for dev
...
We can see them in ifconfig:
ap> ifconfig
wlan0 Link encap:Ethernet HWaddr 42:64:7f:b3:12:03 at UP mtu 1500
inet addr:10.0.1.2 DRaddr:10.0.1.1 Mask:255.255.255.0
inet6 DRaddr: ::
RX: Received Fragment Errors Bytes
00000b9b 00000000 00000000 21daf5
IPv4 IPv6 ARP Dropped
00000a33 00000137 00000031 00000000
TX: Queued Sent Errors Timeouts Bytes
00000ac4 00000ac4 00000000 00000000 1a2103
Total Errors: 00000000
Signed-off-by: meijian <meijian@xiaomi.com>
2024-09-10 11:36:03 +08: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
yangsong8
5a39e83c05
usbdev: extend the usb req len to size_t
...
Some USB controllers can receive or send multiple data packets then
generate one interrupt. This mechanism can reduce the number of data
copies. Extend req buf to accommodate this.
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-08-30 01:32:02 +08:00
Petro Karashchenko
f40b09cbc9
style: remove redundant spaces
...
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-08-25 19:22:15 +08:00
hujun5
a4fece3450
spin_lock: inline spin_lock
...
test:
We can use qemu for testing.
compiling
make distclean -j20; ./tools/configure.sh -l qemu-armv8a:nsh_smp ;make -j20
running
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
2024-07-15 02:29:30 +08:00
xuxingliang
c6d712df0e
sched: move nxsched_dumponexit() to task_exithook
...
So the tcb->group still exists to dump files.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-06-30 17:30:42 +08:00
yanghuatao
7e342b3422
arch: Add --whole-archive linker option for some of architectures
...
Add Kconfig option that enable --whole-archive linker option for some of architectures
Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2024-06-28 02:31:40 +08:00
hujun5
5cee996588
up_putc: int up_putc, enter_critical_section may be called
...
before kernel has been iniitialized,we use spin_lock_irqsave to replace.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-05-09 13:45:02 +08:00
Philippe Leduc
3dc6b4c9bd
Add basic support for locales in order to C++ streams to build and work for simple cases (POSIX / C locale).
...
Fix build with C++ GCC toolchain
2024-04-29 17:34:10 +08:00
ligd
3844efb5b8
stack: update up_get_intstackbase API to support cpu id
...
For crash dump all the CPU intstack
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-04-09 16:59:00 -03:00
trns1997
54e9e582d5
Use C++ standard lib from toolchain
...
Signed-off-by: trns1997 <trns1997@gmail.com>
2024-03-06 08:42:44 +08:00
Marco Casaroli
447cc9698f
use apps-or-nuttx-Make.defs for archs
...
This will allow apps to tweak build configuration of NuttX
2024-03-01 12:59:16 -03:00
Yanfeng Liu
1e9434e2db
arch/: remove duplicated task exit logs
...
Newly added logging in `sched/task_exit.c` obsoletes the existing
ones in `arch/up_exit()`, thus remove the latter to reduce duplications.
Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-01-17 09:18:17 -08:00
simbit18
c494ce4a96
Update kconfig2html.c
...
Fix nuttx coding style
2023-12-14 20:02:52 -08:00
chao an
64cf63475c
arch/dumponexit: unify dump on exit to common code
...
remove arch implement and move to common code
Signed-off-by: chao an <anchao@xiaomi.com>
2023-11-15 08:28:25 -08:00