Skip to content

Commit

Permalink
Merge branch 'master' into vela
Browse files Browse the repository at this point in the history
Change-Id: If7ed53cfbd43a5926c1682aa71147fd725a19cdd
  • Loading branch information
GUIDINGLI authored and openvela-robot committed Nov 20, 2024
1 parent 048bb32 commit 98c6017
Show file tree
Hide file tree
Showing 301 changed files with 80,280 additions and 1,867 deletions.
22 changes: 20 additions & 2 deletions Application.mk
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ RUSTOBJS = $(RUSTSRCS:%=$(PREFIX)%$(SUFFIX)$(OBJEXT))
ZIGOBJS = $(ZIGSRCS:%=$(PREFIX)%$(SUFFIX)$(OBJEXT))
DOBJS = $(DSRCS:%=$(PREFIX)%$(SUFFIX)$(OBJEXT))
SWIFTOBJS = $(SWIFTSRCS:%=$(PREFIX)%$(SUFFIX)$(OBJEXT))
AIDLOBJS = $(patsubst %$(AIDLEXT),%$(CXXEXT),$(AIDLSRCS))

MAINCXXSRCS = $(filter %$(CXXEXT),$(MAINSRC))
MAINCSRCS = $(filter %.c,$(MAINSRC))
Expand Down Expand Up @@ -225,6 +226,18 @@ define RENAMEMAIN
$(ECHO_END)
endef

define COMPILEAIDL
$(ECHO_BEGIN)"AIDL: $1 "
$(Q) $(AIDL) $(AIDLFLAGS) $($(strip $1)_AIDLFLAGS) $1
$(ECHO_END)
endef

define DELAIDLOUT
$(ECHO_BEGIN)"DELAIDLOUT: $1 "
$(Q) $(AIDL) $(AIDLFLAGS) $($(strip $1)_AIDLFLAGS) $1 --delete
$(ECHO_END)
endef

$(RAOBJS): $(PREFIX)%.s$(SUFFIX)$(OBJEXT): %.s
$(if $(and $(CONFIG_MODULES),$(MODAELFFLAGS)), \
$(call ELFASSEMBLE, $<, $@), $(call ASSEMBLE, $<, $@))
Expand Down Expand Up @@ -257,6 +270,9 @@ $(SWIFTOBJS): $(PREFIX)%$(SWIFTEXT)$(SUFFIX)$(OBJEXT): %$(SWIFTEXT)
$(if $(and $(CONFIG_MODULES), $(CELFFLAGS)), \
$(call ELFCOMPILESWIFT, $<, $@), $(call COMPILESWIFT, $<, $@))

$(AIDLOBJS): %$(CXXEXT): %$(AIDLEXT)
$(call COMPILEAIDL, $<)

AROBJS :=
ifneq ($(OBJS),)
SORTOBJS := $(sort $(OBJS))
Expand Down Expand Up @@ -350,7 +366,8 @@ endif # BUILD_MODULE
postinstall::
@:

context::
context:: $(AIDLOBJS)
@:

ifeq ($(DO_REGISTRATION),y)

Expand All @@ -370,7 +387,7 @@ register::
endif

$(PREFIX).depend: Makefile $(wildcard $(foreach SRC, $(SRCS), $(addsuffix /$(SRC), $(subst :, ,$(VPATH))))) $(DEPCONFIG)
$(shell echo "# Gen Make.dep automatically" >Make.dep)
$(shell echo "# Gen Make.dep automatically" >$(PREFIX)Make.dep)
$(call SPLITVARIABLE,ALL_DEP_OBJS,$^,100)
$(foreach BATCH, $(ALL_DEP_OBJS_TOTAL), \
$(shell $(MKDEP) $(DEPPATH) --obj-suffix .c$(SUFFIX)$(OBJEXT) "$(CC)" -- $(CFLAGS) -- $(filter %.c,$(ALL_DEP_OBJS_$(BATCH))) >>$(PREFIX)Make.dep) \
Expand All @@ -389,6 +406,7 @@ clean::
distclean:: clean
$(call DELFILE, Make.dep)
$(call DELFILE, .depend)
$(foreach AIDLSRC,$(AIDLSRCS),$(call DELAIDLOUT,$(AIDLSRC)))

-include $(PREFIX)Make.dep

Expand Down
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
if(CONFIG_APPS_DIR)
# add apps cmake modules
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
include(nuttx_add_aidl)
include(nuttx_add_jidl)
include(nuttx_add_makefile)
include(nuttx_add_luamod)
include(nuttx_add_wamrmod)
nuttx_add_library(apps)
Expand Down Expand Up @@ -73,6 +76,18 @@ if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/external)
add_subdirectory(external)
endif()

if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/tests/CMakeLists.txt)
add_subdirectory(tests)
endif()

if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/frameworks/CMakeLists.txt)
add_subdirectory(frameworks)
endif()

if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/vendor/CMakeLists.txt)
add_subdirectory(vendor)
endif()

add_subdirectory(builtin) # must be last

nuttx_generate_kconfig()
9 changes: 7 additions & 2 deletions Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ RUSTEXT ?= .rs
ZIGEXT ?= .zig
DEXT ?= .d
SWIFTEXT ?= .swift
AIDLEXT ?= .aidl

# Tools

AIDL ?= aidl

# Library path

Expand Down Expand Up @@ -163,7 +168,7 @@ endef

define AROBJSRULES
$(1) : $(2)
cp $(2) $(1)
@ cp $(2) $(1)
endef

# CLEANAROBJS - del AR target files exclusively
Expand All @@ -184,4 +189,4 @@ define CLEANAROBJS
$(shell rm -rf $(CLEAN_OBJS_$(BATCH))))
$(eval OBJS :=)
endef
endif
endif
1 change: 1 addition & 0 deletions benchmarks/coremark-pro/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/coremark-pro
1 change: 1 addition & 0 deletions benchmarks/fio/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/fio
2 changes: 2 additions & 0 deletions benchmarks/rt-tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/rt-tests
/*.zip
43 changes: 43 additions & 0 deletions benchmarks/rt-tests/0001-rt-tests-cyclictest-Port-for-NuttX.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
From cbd7831e20f387a35e94a50b95e0b8db5c5e63dd Mon Sep 17 00:00:00 2001
From: ouyangxiangzhen <[email protected]>
Date: Mon, 8 Jul 2024 10:43:14 +0800
Subject: [PATCH] rt-tests/cyclictest: Port for NuttX

VELAPLATFO-37815

This patch ports cyclictest for NuttX.

Change-Id: I918da053887aaba78910e230db0169239dba3b73
Signed-off-by: ouyangxiangzhen <[email protected]>
---
src/cyclictest/cyclictest.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index c5c3389..0edb684 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -847,7 +847,11 @@ static void display_help(int error)
static int use_nanosleep = MODE_CLOCK_NANOSLEEP;
static int timermode = TIMER_ABSTIME;
static int use_system;
+#ifdef RTTESTS_PRIORITY
+static int priority = RTTESTS_PRIORITY;
+#else
static int priority;
+#endif
static int policy = SCHED_OTHER; /* default policy if not specified */
static int num_threads = 1;
static int max_cycles;
@@ -1224,7 +1228,7 @@ static void process_options(int argc, char *argv[], int max_cpus)
if (distance == -1)
distance = DEFAULT_DISTANCE;

- if (priority < 0 || priority > 99)
+ if (priority < 0 || priority > 255)
error = 1;

if (num_threads == -1)
--
2.34.1

80 changes: 80 additions & 0 deletions benchmarks/rt-tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#
# Copyright (C) 2024 Xiaomi Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#

if(CONFIG_BENCHMARK_RTTESTS)

if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/rt-tests/.git)
set(RTTESTS_URL
"https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git")
set(RTTESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/rt-tests)

execute_process(
COMMAND git clone ${RTTESTS_URL} ${RTTESTS_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE GIT_CLONE_RESULT)

if(NOT ${GIT_CLONE_RESULT} EQUAL 0)
message(FATAL_ERROR "Failed to clone rt-tests repository")
endif()

execute_process(
COMMAND cd ${RTTESTS_DIR} && git checkout -q ${RTTESTS_VERSION} && patch
-p1 < ../0001-rt-tests-cyclictest-Port-for-NuttX.patch
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

add_custom_target(distclean COMMAND ${CMAKE_COMMAND} -E remove_directory
${RTTESTS_DIR})
endif()

list(
APPEND
SRCS
rt-tests/src/cyclictest/cyclictest.c
rt-tests/src/lib/rt-error.c
rt-tests/src/lib/histogram.c
rt-tests/src/lib/rt-utils.c
rt-tests/src/lib/rt-numa.c)

list(
APPEND
CFLAGS
-Irt-tests/src/include
-I.
-DVERSION=0.1
-DSYS_gettid=0
-Dgettid=rttest_gettid
-D'syscall
(x)
=
((pid_t) (x))
'
-w
-DRTTESTS_PRIORITY=${CONFIG_BENCHMARK_RTTESTS_PRIORITY}+1)

nuttx_add_application(
NAME
cyclictest
PRIORITY
${CONFIG_BENCHMARK_RTTESTS_PRIORITY}
STACKSIZE
${CONFIG_BENCHMARK_RTTESTS_STACKSIZE}
MODULE
${CONFIG_BENCHMARK_RTTESTS}
COMPILE_FLAGS
${CFLAGS}
SRCS
${SRCS})
endif()
33 changes: 33 additions & 0 deletions benchmarks/rt-tests/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Copyright (C) 2024 Xiaomi Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
config BENCHMARK_RTTESTS
tristate "RT-Tests"
default n
depends on PIPES && ALLOW_GPL_COMPONENTS
---help---
Measure the timer jitter

if BENCHMARK_RTTESTS

config BENCHMARK_RTTESTS_PRIORITY
int "RT-Tests task priority"
default 200

config BENCHMARK_RTTESTS_STACKSIZE
int "RT-Tests stack size"
default DEFAULT_TASK_STACKSIZE

endif
19 changes: 19 additions & 0 deletions benchmarks/rt-tests/Make.defs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#
# Copyright (C) 2024 Xiaomi Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

ifneq ($(CONFIG_BENCHMARK_RTTESTS),)
CONFIGURED_APPS += $(APPDIR)/benchmarks/rt-tests
endif
59 changes: 59 additions & 0 deletions benchmarks/rt-tests/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#
# Copyright (C) 2024 Xiaomi Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

############################################################################
# Targets
############################################################################


include $(APPDIR)/Make.defs

PROGNAME = cyclictest
PRIORITY = $(CONFIG_BENCHMARK_RTTESTS_PRIORITY)
STACKSIZE = $(CONFIG_BENCHMARK_RTTESTS_STACKSIZE)
MODULE = $(CONFIG_BENCHMARK_RTTESTS)

RTTESTS_PATH = $(APPDIR)/benchmarks/rt-tests/rt-tests
RTTESTS_URL = https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git
RTTESTS_VERSION = cadd661f984c0e6717e681fdaca1ce589b0ed964
RTTESTS_GIT = rt-tests

ifeq ($(wildcard rt-tests/.git),)
rt-tests:
@echo "Git Cloning: $(RTTESTS_URL)"
$(Q) git clone $(RTTESTS_URL)
@echo "Checkout commit: $(RTTESTS_VERSION)"
$(Q) cd $(RTTESTS_PATH) && \
git checkout -q $(RTTESTS_VERSION)
@echo "Patching: Applying patch"
$(Q) cd $(RTTESTS_PATH) && \
patch -p1 < ../0001-rt-tests-cyclictest-Port-for-NuttX.patch

context:: rt-tests
endif

distclean::
$(call DELDIR, $(RTTESTS_GIT))

MAINSRC = rt-tests/src/cyclictest/cyclictest.c
CSRCS = rt-tests/src/lib/rt-error.c rt-tests/src/lib/histogram.c
CSRCS += rt-tests/src/lib/rt-utils.c rt-tests/src/lib/rt-numa.c

CFLAGS += -Irt-tests/src/include -I. -DVERSION=0.1
CFLAGS += -DSYS_gettid=0 -Dgettid=rttest_gettid -D'syscall(x)=((pid_t)(x))'
CFLAGS += -w -DRTTESTS_PRIORITY=$(CONFIG_BENCHMARK_RTTESTS_PRIORITY)+1

include $(APPDIR)/Application.mk
Loading

0 comments on commit 98c6017

Please sign in to comment.