Skip to content

Commit

Permalink
Merge branch 'open-vela:dev' into mouse_ioctl
Browse files Browse the repository at this point in the history
  • Loading branch information
HongChao6 authored Jan 6, 2025
2 parents d157589 + dfcf5ab commit 805cc30
Show file tree
Hide file tree
Showing 1,754 changed files with 14,554 additions and 4,904 deletions.
11 changes: 11 additions & 0 deletions .gitee/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## 概要

*在此部分更新信息,说明更改的必要性、具体做了什么以及如何实现的,如果有新功能出现,请提供参考资料(依赖关系、类似问题和解决方案等)。*

## 影响

*在此部分更新信息(如适用),说明更改如何影响用户、构建过程、硬件、文档、安全性、兼容性等。*

## 测试

*在此部分更新信息,详细说明如何验证更改,使用什么主机进行构建(操作系统、CPU、编译器等),使用什么目标进行验证(架构、板子:配置等)。提供更改前后的构建和运行日志将非常有帮助。*
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @xiaoxiang781216 @GUIDINGLI
20 changes: 20 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
*Note: Please adhere to [Contributing Guidelines](https://github.com/open-vela/docs/blob/dev/CONTRIBUTING.md).*

## Summary

*Update this section with information on why change is necessary,
what it exactly does and how, if new feature shows up, provide
references (dependencies, similar problems and solutions), etc.*

## Impact

*Update this section, where applicable, on how change affects users,
build process, hardware, documentation, security, compatibility, etc.*

## Testing

*Update this section with details on how did you verify the change,
what Host was used for build (OS, CPU, compiler, ..), what Target was
used for verification (arch, board:config, ..), etc. Providing build
and runtime logs from before and after change is highly appreciated.*

12 changes: 9 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,10 @@ nuttx_export_kconfig(${CMAKE_BINARY_DIR}/.config)
include(nuttx_generate_headers)
include(nuttx_generate_outputs)
include(nuttx_add_library)

# add NuttX CMake extenstion after nuttx_add_library
include(nuttx_extensions)

include(nuttx_add_application)
include(nuttx_add_romfs)
include(nuttx_add_symtab)
Expand All @@ -377,9 +381,6 @@ include(menuconfig)
include(ExternalProject)
include(FetchContent)

# add NuttX CMake extenstion at last
include(nuttx_extensions)

set(FETCHCONTENT_QUIET OFF)

# Board common directory #####################################################
Expand Down Expand Up @@ -581,6 +582,11 @@ if(NOT CONFIG_BUILD_KERNEL)

endif()

# after we traverse all build directories unify all target dependencies and all
# romfs target
process_all_target_dependencies()
process_all_directory_romfs()

# Link step ##################################################################

# Get linker script to use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -783,3 +783,20 @@ To test the XTWDT(/dev/watchdog3) an interrupt handler needs to be
implemented because XTWDT does not have system reset feature. To implement
an interrupt handler `WDIOC_CAPTURE` command can be used. When interrupt
rises, XTAL32K clock can be restored with `WDIOC_RSTCLK` command.

adb
---

Basic NuttShell configuration console enabled over USB Device (USB ADB).

You can run the configuration and compilation procedure::

$ ./tools/configure.sh esp32s3-devkit:adb
$ make -j16
$ make flash ESPTOOL_PORT=/dev/ttyACMx

Then run the adb command::

$ adb -s 1234 shell
nsh> uname -a
NuttX 0.0.0 Nov 22 2024 11:41:43 xtensa esp32s3-devkit
4 changes: 4 additions & 0 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2562,6 +2562,10 @@ config TRACE_RPMSGFS_FS
bool "Enable tracepoints in rpmsgfs"
default n

config TRACE_LROFS_FS
bool "Enable tracepoints in lrofs"
default n

endmenu # Trace Fs Support
endif

Expand Down
20 changes: 15 additions & 5 deletions arch/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,6 @@ endif #ARCH_CHIP_CUSTOM

source "$BINDIR/arch/dummy/Kconfig"

config ARCH_TOOLCHAIN_IAR
bool
default n

config ARCH_TOOLCHAIN_GNU
bool
default n
Expand All @@ -291,15 +287,24 @@ config ARCH_TOOLCHAIN_CLANG
select ARCH_TOOLCHAIN_GNU
default n

config ARCH_TOOLCHAIN_TASKING
config ARCH_TOOLCHAIN_GCC
bool
select ARCH_TOOLCHAIN_GNU
default n

config ARCH_TOOLCHAIN_GHS
bool
select ARCH_TOOLCHAIN_GNU
default n

config ARCH_TOOLCHAIN_IAR
bool
default n

config ARCH_TOOLCHAIN_TASKING
bool
default n

config ARCH_GNU_NO_WEAKFUNCTIONS
bool
depends on ARCH_TOOLCHAIN_GNU
Expand Down Expand Up @@ -484,6 +489,11 @@ config ARCH_HAVE_TESTSET
bool
default n

config ARCH_HAVE_CUSTOM_TESTSET
bool
default n
select ARCH_HAVE_TESTSET

config ARCH_HAVE_THREAD_LOCAL
bool
default n
Expand Down
13 changes: 8 additions & 5 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ config ARM_TOOLCHAIN_IAR
config ARM_TOOLCHAIN_BUILDROOT
bool "Buildroot (Cygwin or Linux)"
depends on !WINDOWS_NATIVE
select ARCH_TOOLCHAIN_GNU
select ARCH_TOOLCHAIN_GCC

config ARM_TOOLCHAIN_BUILDROOT_OABI
bool "OABI (vs EABI)"
depends on !WINDOWS_NATIVE
select ARCH_TOOLCHAIN_GNU
select ARCH_TOOLCHAIN_GCC
---help---
Most of the older buildroot toolchains are OABI

config ARM_TOOLCHAIN_GNU_EABI
bool "Generic GNU EABI toolchain"
select ARCH_TOOLCHAIN_GNU
select ARCH_TOOLCHAIN_GCC
---help---
This option should work for any modern GNU toolchain (GCC 4.5 or newer)

config ARM_TOOLCHAIN_GNU_OABI
bool "Generic GNU OABI toolchain"
select ARCH_TOOLCHAIN_GNU
select ARCH_TOOLCHAIN_GCC
---help---
This option should work for any GNU toolchain.

Expand Down Expand Up @@ -221,6 +221,7 @@ config ARCH_CHIP_LC823450
select ARCH_HAVE_HEAPCHECK
select ARCH_HAVE_MULTICPU
select ARCH_HAVE_I2CRESET
select ARCH_HAVE_CUSTOM_TESTSET
select ARCH_HAVE_CUSTOM_VECTORS
---help---
ON Semiconductor LC823450 architectures (ARM dual Cortex-M3)
Expand Down Expand Up @@ -344,11 +345,11 @@ config ARCH_CHIP_RP2040
select ARCH_CORTEXM0
select ARCH_HAVE_RAMVECTORS
select ARCH_HAVE_MULTICPU
select ARCH_HAVE_TESTSET
select ARCH_HAVE_I2CRESET
select ARM_HAVE_WFE_SEV
select ARCH_HAVE_PWM_MULTICHAN
select ARCH_BOARD_COMMON
select ARCH_HAVE_CUSTOM_TESTSET
select ARCH_HAVE_CUSTOM_VECTORS
---help---
Raspberry Pi RP2040 architectures (ARM dual Cortex-M0+).
Expand Down Expand Up @@ -655,6 +656,7 @@ config ARCH_CHIP_CXD56XX
select ARCH_HAVE_SDIO if MMCSD
select ARCH_HAVE_MATH_H
select ARCH_HAVE_I2CRESET
select ARCH_HAVE_CUSTOM_TESTSET
select ARCH_HAVE_CUSTOM_VECTORS
---help---
Sony CXD56XX (ARM Cortex-M4) architectures
Expand Down Expand Up @@ -693,6 +695,7 @@ config ARCH_CHIP_GOLDFISH_ARM
select ARCH_HAVE_RESET
select ARM_HAVE_PSCI
select ARM_HAVE_NEON
select ARCH_IDLE_CUSTOM
---help---
GOLDFISH virt platform (ARMv7a)

Expand Down
3 changes: 0 additions & 3 deletions arch/arm/include/armv6-m/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@

#ifdef __ghs__
# define __ARM_ARCH 6
# ifdef __ARM_DSP__
# define __ARM_FEATURE_DSP 1
# endif
#endif

/* Configuration ************************************************************/
Expand Down
3 changes: 0 additions & 3 deletions arch/arm/include/armv7-a/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@

#ifdef __ghs__
# define __ARM_ARCH 7
# ifdef __ARM_DSP__
# define __ARM_FEATURE_DSP 1
# endif
#endif

/* IRQ Stack Frame Format:
Expand Down
3 changes: 0 additions & 3 deletions arch/arm/include/armv7-m/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@

#ifdef __ghs__
# define __ARM_ARCH 7
# ifdef __ARM_DSP__
# define __ARM_FEATURE_DSP 1
# endif
#endif

/* Configuration ************************************************************/
Expand Down
3 changes: 0 additions & 3 deletions arch/arm/include/armv7-r/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@

#ifdef __ghs__
# define __ARM_ARCH 7
# ifdef __ARM_DSP__
# define __ARM_FEATURE_DSP 1
# endif
#endif

/* IRQ Stack Frame Format:
Expand Down
3 changes: 0 additions & 3 deletions arch/arm/include/armv8-m/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@

#ifdef __ghs__
# define __ARM_ARCH 8
# ifdef __ARM_DSP__
# define __ARM_FEATURE_DSP 1
# endif
#endif

/* Configuration ************************************************************/
Expand Down
3 changes: 0 additions & 3 deletions arch/arm/include/armv8-r/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@

#ifdef __ghs__
# define __ARM_ARCH 8
# ifdef __ARM_DSP__
# define __ARM_FEATURE_DSP 1
# endif
#endif

/* IRQ Stack Frame Format:
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/include/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
* Pre-processor Prototypes
****************************************************************************/

#if defined(__ghs__) && defined(__ARM_DSP__)
# define __ARM_FEATURE_DSP 1
#endif

#ifndef __ASSEMBLY__

#ifndef up_switch_context
Expand Down
5 changes: 1 addition & 4 deletions arch/arm/include/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,7 @@ typedef uint8_t spinlock_t;
*
****************************************************************************/

#if defined(CONFIG_ARCH_HAVE_TESTSET) \
&& !defined(CONFIG_ARCH_CHIP_LC823450) \
&& !defined(CONFIG_ARCH_CHIP_CXD56XX) \
&& !defined(CONFIG_ARCH_CHIP_RP2040)
#if defined(CONFIG_ARCH_HAVE_TESTSET) && !defined(CONFIG_ARCH_HAVE_CUSTOM_TESTSET)
static inline_function spinlock_t up_testset(volatile spinlock_t *lock)
{
spinlock_t ret = SP_UNLOCKED;
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/src/arm/arm_sigdeliver.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,7 @@ void arm_sigdeliver(void)
/* Then restore the correct state for this thread of execution. */

board_autoled_off(LED_SIGNAL);

g_running_tasks[this_cpu()] = NULL;
arm_fullcontextrestore(regs);
}
32 changes: 11 additions & 21 deletions arch/arm/src/arm/arm_syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,23 @@

uint32_t *arm_syscall(uint32_t *regs)
{
struct tcb_s *tcb = this_task();
struct tcb_s **running_task = &g_running_tasks[this_cpu()];
FAR struct tcb_s *tcb = this_task();
uint32_t cmd;
int cpu;

/* Nested interrupts are not supported */

DEBUGASSERT(up_current_regs() == NULL);

if (*running_task != NULL)
{
(*running_task)->xcp.regs = regs;
}

/* Current regs non-zero indicates that we are processing an interrupt;
* current_regs is also used to manage interrupt level context switches.
*/

tcb->xcp.regs = regs;
up_set_current_regs(regs);

/* The SYSCALL command is in R0 on entry. Parameters follow in R1..R7 */
Expand Down Expand Up @@ -118,11 +122,6 @@ uint32_t *arm_syscall(uint32_t *regs)
*/

case SYS_switch_context:
{
DEBUGASSERT(regs[REG_R1] != 0 && regs[REG_R2] != 0);
*(uint32_t **)regs[REG_R1] = regs;
up_set_current_regs((uint32_t *)regs[REG_R2]);
}
break;

default:
Expand All @@ -134,7 +133,7 @@ uint32_t *arm_syscall(uint32_t *regs)
break;
}

if (regs != tcb->xcp.regs)
if (*running_task != tcb)
{
#ifdef CONFIG_ARCH_ADDRENV
/* Make sure that the address environment for the previously
Expand All @@ -145,25 +144,16 @@ uint32_t *arm_syscall(uint32_t *regs)

addrenv_switch(NULL);
#endif

/* Record the new "running" task. g_running_tasks[] is only used by
* assertion logic for reporting crashes.
*/

cpu = this_cpu();
tcb = current_task(cpu);

/* Update scheduler parameters */

nxsched_suspend_scheduler(g_running_tasks[cpu]);
nxsched_suspend_scheduler(*running_task);
nxsched_resume_scheduler(tcb);

g_running_tasks[cpu] = tcb;
*running_task = tcb;

/* Restore the cpu lock */

restore_critical_section(tcb, cpu);
regs = up_current_regs();
restore_critical_section(tcb, this_cpu());
}

/* Set current_regs to NULL to indicate that we are no longer in an
Expand Down
Loading

0 comments on commit 805cc30

Please sign in to comment.