Compare commits
139 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f826560aa | ||
|
|
21008182be | ||
|
|
5e578e5967 | ||
|
|
88487a2dee | ||
|
|
f2cae5145d | ||
|
|
9366238a33 | ||
|
|
33f30745a5 | ||
|
|
275dc8275f | ||
|
|
ae757fb704 | ||
|
|
5e1dc921b0 | ||
|
|
5ccffff5b0 | ||
|
|
dd460a9410 | ||
|
|
7e5ac1bfe6 | ||
|
|
f215361e1c | ||
|
|
7e7d71ebda | ||
|
|
6939183a58 | ||
|
|
6f045c1166 | ||
|
|
d9eb21aa1e | ||
|
|
2b8079aa38 | ||
|
|
81136cbc79 | ||
|
|
42276f5bbd | ||
|
|
36bec3599d | ||
|
|
587ad45686 | ||
|
|
169b85c1e3 | ||
|
|
a9aba82522 | ||
|
|
e7df33e8b7 | ||
|
|
29b52a81c9 | ||
|
|
af4c3bc983 | ||
|
|
257df9a236 | ||
|
|
b60b5b97a2 | ||
|
|
8a97c83040 | ||
|
|
42144217be | ||
|
|
4ba168dc4d | ||
|
|
d760c5e322 | ||
|
|
7b880f11f8 | ||
|
|
592c6b1db2 | ||
|
|
f52dce1ee3 | ||
|
|
7f3562bfe4 | ||
|
|
fcc69bf015 | ||
|
|
c140604510 | ||
|
|
d229d45ddd | ||
|
|
8790789c5f | ||
|
|
7bc1deeeae | ||
|
|
6c4fc0226d | ||
|
|
31dbdca2ab | ||
|
|
3bceb73861 | ||
|
|
79bf23c5ac | ||
|
|
7fec8b280d | ||
|
|
706104bdf8 | ||
|
|
a39340a1f8 | ||
|
|
7a2b9586fa | ||
|
|
708ba30959 | ||
|
|
903b5d78d8 | ||
|
|
2df7257bec | ||
|
|
9f903eeb50 | ||
|
|
886d04860f | ||
|
|
311aeef4d5 | ||
|
|
8dacd0f873 | ||
|
|
2d0d093627 | ||
|
|
0689e106c6 | ||
|
|
0d81d97bb0 | ||
|
|
cb2ea25e14 | ||
|
|
50d357d77e | ||
|
|
9877834c95 | ||
|
|
ea2bbb8b9e | ||
|
|
b0667a80b1 | ||
|
|
e2ae4ec78c | ||
|
|
1f09c9269d | ||
|
|
aa8c3fa22e | ||
|
|
5a5eaa3c58 | ||
|
|
efd77e0958 | ||
|
|
b3affe6b94 | ||
|
|
5969c3b941 | ||
|
|
6db7778c81 | ||
|
|
bd6523195c | ||
|
|
701c560901 | ||
|
|
b24bbad815 | ||
|
|
a7baa3628d | ||
|
|
7aee51ea82 | ||
|
|
7c62429a75 | ||
|
|
82f3165b79 | ||
|
|
e858321f83 | ||
|
|
d2c5f05b1b | ||
|
|
708951ecd2 | ||
|
|
ad2b77e7f8 | ||
|
|
eb85f9a47e | ||
|
|
9ad64e8809 | ||
|
|
cf112e2a06 | ||
|
|
0ad4b4438a | ||
|
|
f7d0ae5e6c | ||
|
|
a084ec5483 | ||
|
|
c3fac651ee | ||
|
|
30eadf758a | ||
|
|
1a42926317 | ||
|
|
30b24920e8 | ||
|
|
41654b0dba | ||
|
|
17c5a7c89e | ||
|
|
0d4db6b952 | ||
|
|
e24df5272a | ||
|
|
a3e8f83e6b | ||
|
|
e8929c3360 | ||
|
|
7597eef8b3 | ||
|
|
9ff7cb60fc | ||
|
|
71420c6b76 | ||
|
|
519f412ce8 | ||
|
|
c0e44d9462 | ||
|
|
47f4ddafdd | ||
|
|
1a15d367e2 | ||
|
|
7ac8c2f51b | ||
|
|
4c52fb9fd1 | ||
|
|
cb657057b3 | ||
|
|
69996900c8 | ||
|
|
70979b9047 | ||
|
|
e601ca8e11 | ||
|
|
369d5d038f | ||
|
|
27a2271093 | ||
|
|
f4a03dfa32 | ||
|
|
192cad6cda | ||
|
|
1e2c698e95 | ||
|
|
0c0a990c4b | ||
|
|
dbf08a18c3 | ||
|
|
6c4d190493 | ||
|
|
5d0100e12c | ||
|
|
b11983d71a | ||
|
|
8691e3e0d2 | ||
|
|
c1fa585917 | ||
|
|
8a9c1e7721 | ||
|
|
8a0dc430b2 | ||
|
|
e6638715d9 | ||
|
|
5b78f62138 | ||
|
|
01be872f01 | ||
|
|
317749e1e8 | ||
|
|
7d3606a74a | ||
|
|
08917e0708 | ||
|
|
b868419ac7 | ||
|
|
16efab0493 | ||
|
|
916dbab23a | ||
|
|
62680344a6 | ||
|
|
d8ee47459c |
35
.buildkite/daily.yml
Normal file
35
.buildkite/daily.yml
Normal file
@@ -0,0 +1,35 @@
|
||||
steps:
|
||||
- command:
|
||||
- .buildkite/run.sh
|
||||
env:
|
||||
ZEPHYR_TOOLCHAIN_VARIANT: "zephyr"
|
||||
ZEPHYR_SDK_INSTALL_DIR: "/opt/toolchains/zephyr-sdk-0.13.1"
|
||||
parallelism: 475
|
||||
timeout_in_minutes: 210
|
||||
retry:
|
||||
manual: true
|
||||
plugins:
|
||||
- docker#v3.5.0:
|
||||
image: "zephyrprojectrtos/ci:v0.18.4"
|
||||
propagate-environment: true
|
||||
volumes:
|
||||
- "/var/lib/buildkite-agent/git-mirrors:/var/lib/buildkite-agent/git-mirrors"
|
||||
- "/var/lib/buildkite-agent/zephyr-module-cache:/var/lib/buildkite-agent/zephyr-module-cache"
|
||||
- "/var/lib/buildkite-agent/zephyr-ccache:/root/.ccache"
|
||||
workdir: "/workdir/zephyr"
|
||||
agents:
|
||||
- "queue=default"
|
||||
|
||||
- wait: ~
|
||||
continue_on_failure: true
|
||||
|
||||
- plugins:
|
||||
- junit-annotate#v1.7.0:
|
||||
artifacts: twister-*.xml
|
||||
|
||||
- command:
|
||||
- .buildkite/mergejunit.sh
|
||||
|
||||
notify:
|
||||
- email: "builds+int+399+7809482394022958124@lists.zephyrproject.org"
|
||||
if: build.state != "passed"
|
||||
8
.buildkite/hooks/post-command
Executable file
8
.buildkite/hooks/post-command
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2020 Linaro Limited
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# report disk usage:
|
||||
echo "--- $0 disk usage"
|
||||
df -h
|
||||
44
.buildkite/hooks/pre-command
Executable file
44
.buildkite/hooks/pre-command
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2020 Linaro Limited
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Save off where we started so we can go back there
|
||||
WORKDIR=${PWD}
|
||||
|
||||
echo "--- $0 disk usage"
|
||||
df -h
|
||||
du -hs /var/lib/buildkite-agent/*
|
||||
docker images -a
|
||||
docker system df -v
|
||||
|
||||
if [ -n "${BUILDKITE_PULL_REQUEST_BASE_BRANCH}" ]; then
|
||||
git fetch -v origin ${BUILDKITE_PULL_REQUEST_BASE_BRANCH}
|
||||
git checkout FETCH_HEAD
|
||||
git config --local user.email "builds@zephyrproject.org"
|
||||
git config --local user.name "Zephyr CI"
|
||||
git merge --no-edit "${BUILDKITE_COMMIT}" || {
|
||||
local merge_result=$?
|
||||
echo "Merge failed: ${merge_result}"
|
||||
git merge --abort
|
||||
exit $merge_result
|
||||
}
|
||||
fi
|
||||
|
||||
mkdir -p /var/lib/buildkite-agent/zephyr-ccache/
|
||||
|
||||
# create cache dirs, no-op if they already exist
|
||||
mkdir -p /var/lib/buildkite-agent/zephyr-module-cache/modules
|
||||
mkdir -p /var/lib/buildkite-agent/zephyr-module-cache/tools
|
||||
mkdir -p /var/lib/buildkite-agent/zephyr-module-cache/bootloader
|
||||
|
||||
# Clean cache - if it already exists
|
||||
cd /var/lib/buildkite-agent/zephyr-module-cache
|
||||
find -type f -not -path "*/.git/*" -not -name ".git" -delete
|
||||
|
||||
# Remove any stale locks
|
||||
find -name index.lock -delete
|
||||
|
||||
# return from where we started so we can find pipeline files from
|
||||
# git repo
|
||||
cd ${WORKDIR}
|
||||
19
.buildkite/mergejunit.sh
Executable file
19
.buildkite/mergejunit.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2021 Linaro Limited
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
set -eE
|
||||
|
||||
buildkite-agent artifact download twister-*.xml .
|
||||
|
||||
xmls=""
|
||||
|
||||
for f in twister-*xml; do [ -s ${f} ] && xmls+="${f} "; done
|
||||
|
||||
if [ "${xmls}" ]; then
|
||||
junitparser merge ${xmls} junit.xml
|
||||
buildkite-agent artifact upload junit.xml
|
||||
junit2html junit.xml
|
||||
buildkite-agent artifact upload junit.xml.html
|
||||
buildkite-agent annotate --style "info" "Read the <a href=\"artifact://junit.xml.html\">JUnit test report</a>"
|
||||
fi
|
||||
31
.buildkite/pipeline.yml
Normal file
31
.buildkite/pipeline.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
steps:
|
||||
- command:
|
||||
- .buildkite/run.sh
|
||||
env:
|
||||
ZEPHYR_TOOLCHAIN_VARIANT: "zephyr"
|
||||
ZEPHYR_SDK_INSTALL_DIR: "/opt/toolchains/zephyr-sdk-0.13.1"
|
||||
parallelism: 20
|
||||
timeout_in_minutes: 180
|
||||
retry:
|
||||
manual: true
|
||||
plugins:
|
||||
- docker#v3.5.0:
|
||||
image: "zephyrprojectrtos/ci:v0.18.4"
|
||||
propagate-environment: true
|
||||
volumes:
|
||||
- "/var/lib/buildkite-agent/git-mirrors:/var/lib/buildkite-agent/git-mirrors"
|
||||
- "/var/lib/buildkite-agent/zephyr-module-cache:/var/lib/buildkite-agent/zephyr-module-cache"
|
||||
- "/var/lib/buildkite-agent/zephyr-ccache:/root/.ccache"
|
||||
workdir: "/workdir/zephyr"
|
||||
agents:
|
||||
- "queue=default"
|
||||
|
||||
- wait: ~
|
||||
continue_on_failure: true
|
||||
|
||||
- plugins:
|
||||
- junit-annotate#v1.7.0:
|
||||
artifacts: twister-*.xml
|
||||
|
||||
- command:
|
||||
- .buildkite/mergejunit.sh
|
||||
78
.buildkite/run.sh
Executable file
78
.buildkite/run.sh
Executable file
@@ -0,0 +1,78 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2020 Linaro Limited
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
set -eE
|
||||
|
||||
function cleanup()
|
||||
{
|
||||
# Rename twister junit xml for use with junit-annotate-buildkite-plugin
|
||||
# create dummy file if twister did nothing
|
||||
if [ ! -f twister-out/twister.xml ]; then
|
||||
touch twister-out/twister.xml
|
||||
fi
|
||||
mv twister-out/twister.xml twister-${BUILDKITE_JOB_ID}.xml
|
||||
buildkite-agent artifact upload twister-${BUILDKITE_JOB_ID}.xml
|
||||
|
||||
|
||||
# Upload test_file to get list of tests that are build/run
|
||||
if [ -f test_file.txt ]; then
|
||||
buildkite-agent artifact upload test_file.txt
|
||||
fi
|
||||
|
||||
# ccache stats
|
||||
echo "--- ccache stats at finish"
|
||||
ccache -s
|
||||
|
||||
# Cleanup on exit
|
||||
rm -fr *
|
||||
|
||||
# disk usage
|
||||
echo "--- disk usage at finish"
|
||||
df -h
|
||||
}
|
||||
|
||||
trap cleanup ERR
|
||||
|
||||
echo "--- run $0"
|
||||
|
||||
git log -n 5 --oneline --decorate --abbrev=12
|
||||
|
||||
# Setup module cache
|
||||
cd /workdir
|
||||
ln -s /var/lib/buildkite-agent/zephyr-module-cache/modules
|
||||
ln -s /var/lib/buildkite-agent/zephyr-module-cache/tools
|
||||
ln -s /var/lib/buildkite-agent/zephyr-module-cache/bootloader
|
||||
cd /workdir/zephyr
|
||||
|
||||
export JOB_NUM=$((${BUILDKITE_PARALLEL_JOB}+1))
|
||||
|
||||
# ccache stats
|
||||
echo ""
|
||||
echo "--- ccache stats at start"
|
||||
ccache -s
|
||||
|
||||
|
||||
if [ -n "${DAILY_BUILD}" ]; then
|
||||
TWISTER_OPTIONS=" --inline-logs -M -N --build-only --all --retry-failed 3 -v "
|
||||
echo "--- DAILY BUILD"
|
||||
west init -l .
|
||||
west update 1> west.update.log || west update 1> west.update-2.log
|
||||
west forall -c 'git reset --hard HEAD'
|
||||
source zephyr-env.sh
|
||||
./scripts/twister --subset ${JOB_NUM}/${BUILDKITE_PARALLEL_JOB_COUNT} ${TWISTER_OPTIONS}
|
||||
else
|
||||
if [ -n "${BUILDKITE_PULL_REQUEST_BASE_BRANCH}" ]; then
|
||||
./scripts/ci/run_ci.sh -c -b ${BUILDKITE_PULL_REQUEST_BASE_BRANCH} -r origin \
|
||||
-m ${JOB_NUM} -M ${BUILDKITE_PARALLEL_JOB_COUNT} -p ${BUILDKITE_PULL_REQUEST}
|
||||
else
|
||||
./scripts/ci/run_ci.sh -c -b ${BUILDKITE_BRANCH} -r origin \
|
||||
-m ${JOB_NUM} -M ${BUILDKITE_PARALLEL_JOB_COUNT};
|
||||
fi
|
||||
fi
|
||||
|
||||
TWISTER_EXIT_STATUS=$?
|
||||
|
||||
cleanup
|
||||
|
||||
exit ${TWISTER_EXIT_STATUS}
|
||||
@@ -28,4 +28,4 @@
|
||||
--ignore COMPLEX_MACRO
|
||||
--ignore MULTISTATEMENT_MACRO_USE_DO_WHILE
|
||||
--ignore ENOSYS
|
||||
--ignore IS_ENABLED_CONFIG
|
||||
--exclude ext
|
||||
|
||||
157
.clang-format
157
.clang-format
@@ -1,41 +1,76 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
#
|
||||
# Note: The list of ForEachMacros can be obtained using:
|
||||
# clang-format configuration file. Intended for clang-format >= 4.
|
||||
#
|
||||
# git grep -h '^#define [^[:space:]]*FOR_EACH[^[:space:]]*(' include/ \
|
||||
# | sed "s,^#define \([^[:space:]]*FOR_EACH[^[:space:]]*\)(.*$, - '\1'," \
|
||||
# | sort | uniq
|
||||
# For more information, see:
|
||||
#
|
||||
# Documentation/process/clang-format.rst
|
||||
# https://clang.llvm.org/docs/ClangFormat.html
|
||||
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
|
||||
#
|
||||
# References:
|
||||
# - https://clang.llvm.org/docs/ClangFormatStyleOptions.html
|
||||
|
||||
---
|
||||
BasedOnStyle: LLVM
|
||||
AlignConsecutiveMacros: AcrossComments
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
#AlignEscapedNewlines: Left # Unknown to clang-format-4.0
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: false
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortEnumsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AttributeMacros:
|
||||
- __aligned
|
||||
- __deprecated
|
||||
- __packed
|
||||
- __printf_like
|
||||
- __syscall
|
||||
- __subsystem
|
||||
BitFieldColonSpacing: After
|
||||
BreakBeforeBraces: Linux
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: false
|
||||
BinPackArguments: true
|
||||
BinPackParameters: true
|
||||
BraceWrapping:
|
||||
AfterClass: false
|
||||
AfterControlStatement: false
|
||||
AfterEnum: false
|
||||
AfterFunction: true
|
||||
AfterNamespace: true
|
||||
AfterObjCDeclaration: false
|
||||
AfterStruct: false
|
||||
AfterUnion: false
|
||||
#AfterExternBlock: false # Unknown to clang-format-5.0
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
IndentBraces: false
|
||||
#SplitEmptyFunction: true # Unknown to clang-format-4.0
|
||||
#SplitEmptyRecord: true # Unknown to clang-format-4.0
|
||||
#SplitEmptyNamespace: true # Unknown to clang-format-4.0
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeBraces: Custom
|
||||
#BreakBeforeInheritanceComma: false # Unknown to clang-format-4.0
|
||||
BreakBeforeTernaryOperators: false
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
#BreakConstructorInitializers: BeforeComma # Unknown to clang-format-4.0
|
||||
BreakAfterJavaFieldAnnotations: false
|
||||
BreakStringLiterals: false
|
||||
ColumnLimit: 100
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
#CompactNamespaces: false # Unknown to clang-format-4.0
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
ConstructorInitializerIndentWidth: 8
|
||||
ContinuationIndentWidth: 8
|
||||
Cpp11BracedListStyle: false
|
||||
DerivePointerAlignment: false
|
||||
DisableFormat: false
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
#FixNamespaceComments: false # Unknown to clang-format-4.0
|
||||
|
||||
# Taken from:
|
||||
# git grep -h '^#define [^[:space:]]*FOR_EACH[^[:space:]]*(' include/ \
|
||||
# | sed "s,^#define \([^[:space:]]*FOR_EACH[^[:space:]]*\)(.*$, - '\1'," \
|
||||
# | sort | uniq
|
||||
ForEachMacros:
|
||||
- 'FOR_EACH'
|
||||
- 'FOR_EACH_FIXED_ARG'
|
||||
- 'FOR_EACH_IDX'
|
||||
- 'FOR_EACH_IDX_FIXED_ARG'
|
||||
- 'FOR_EACH_NONEMPTY_TERM'
|
||||
- 'RB_FOR_EACH'
|
||||
- 'RB_FOR_EACH_CONTAINER'
|
||||
- 'SYS_DLIST_FOR_EACH_CONTAINER'
|
||||
@@ -50,37 +85,61 @@ ForEachMacros:
|
||||
- 'SYS_SLIST_FOR_EACH_CONTAINER_SAFE'
|
||||
- 'SYS_SLIST_FOR_EACH_NODE'
|
||||
- 'SYS_SLIST_FOR_EACH_NODE_SAFE'
|
||||
- '_WAIT_Q_FOR_EACH'
|
||||
- 'Z_FOR_EACH'
|
||||
- 'Z_FOR_EACH_ENGINE'
|
||||
- 'Z_FOR_EACH_EXEC'
|
||||
- 'Z_FOR_EACH_FIXED_ARG'
|
||||
- 'Z_FOR_EACH_FIXED_ARG_EXEC'
|
||||
- 'Z_FOR_EACH_IDX'
|
||||
- 'Z_FOR_EACH_IDX_EXEC'
|
||||
- 'Z_FOR_EACH_IDX_FIXED_ARG'
|
||||
- 'Z_FOR_EACH_IDX_FIXED_ARG_EXEC'
|
||||
- 'Z_GENLIST_FOR_EACH_CONTAINER'
|
||||
- 'Z_GENLIST_FOR_EACH_CONTAINER_SAFE'
|
||||
- 'Z_GENLIST_FOR_EACH_NODE'
|
||||
- 'Z_GENLIST_FOR_EACH_NODE_SAFE'
|
||||
# Disabled for now, see bug https://github.com/zephyrproject-rtos/zephyr/issues/48520
|
||||
#IncludeBlocks: Regroup
|
||||
- '_WAIT_Q_FOR_EACH'
|
||||
|
||||
#IncludeBlocks: Preserve # Unknown to clang-format-5.0
|
||||
IncludeCategories:
|
||||
- Regex: '^".*\.h"$'
|
||||
Priority: 0
|
||||
- Regex: '^<(assert|complex|ctype|errno|fenv|float|inttypes|limits|locale|math|setjmp|signal|stdarg|stdbool|stddef|stdint|stdio|stdlib|string|tgmath|time|wchar|wctype)\.h>$'
|
||||
Priority: 1
|
||||
- Regex: '^\<zephyr/.*\.h\>$'
|
||||
Priority: 2
|
||||
- Regex: '.*'
|
||||
Priority: 3
|
||||
Priority: 1
|
||||
IncludeIsMainRegex: '(Test)?$'
|
||||
IndentCaseLabels: false
|
||||
#IndentPPDirectives: None # Unknown to clang-format-5.0
|
||||
IndentWidth: 8
|
||||
InsertBraces: true
|
||||
SpaceBeforeParens: ControlStatementsExceptControlMacros
|
||||
SortIncludes: Never
|
||||
IndentWrappedFunctionNames: false
|
||||
JavaScriptQuotes: Leave
|
||||
JavaScriptWrapImports: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
MacroBlockBegin: ''
|
||||
MacroBlockEnd: ''
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: Inner
|
||||
#ObjCBinPackProtocolList: Auto # Unknown to clang-format-5.0
|
||||
ObjCBlockIndentWidth: 8
|
||||
ObjCSpaceAfterProperty: true
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
|
||||
# Taken from git's rules
|
||||
#PenaltyBreakAssignment: 10 # Unknown to clang-format-4.0
|
||||
PenaltyBreakBeforeFirstCallParameter: 30
|
||||
PenaltyBreakComment: 10
|
||||
PenaltyBreakFirstLessLess: 0
|
||||
PenaltyBreakString: 10
|
||||
PenaltyExcessCharacter: 100
|
||||
PenaltyReturnTypeOnItsOwnLine: 60
|
||||
|
||||
PointerAlignment: Right
|
||||
ReflowComments: false
|
||||
SortIncludes: false
|
||||
#SortUsingDeclarations: false # Unknown to clang-format-4.0
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterTemplateKeyword: true
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
#SpaceBeforeCtorInitializerColon: true # Unknown to clang-format-5.0
|
||||
#SpaceBeforeInheritanceColon: true # Unknown to clang-format-5.0
|
||||
SpaceBeforeParens: ControlStatements
|
||||
#SpaceBeforeRangeBasedForLoopColon: true # Unknown to clang-format-5.0
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
SpacesInAngles: false
|
||||
SpacesInContainerLiterals: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: Cpp03
|
||||
TabWidth: 8
|
||||
UseTab: Always
|
||||
WhitespaceSensitiveMacros:
|
||||
- STRINGIFY
|
||||
- Z_STRINGIFY
|
||||
...
|
||||
|
||||
@@ -12,10 +12,10 @@ coverage:
|
||||
patch: yes
|
||||
changes: no
|
||||
|
||||
# ignore:
|
||||
# - "tests/**/*"
|
||||
# - "samples/**/*"
|
||||
# - "ext/hal/**/*"
|
||||
#ignore:
|
||||
# - "tests/**/*"
|
||||
# - "samples/**/*"
|
||||
# - "ext/hal/**/*"
|
||||
|
||||
parsers:
|
||||
gcov:
|
||||
|
||||
@@ -9,7 +9,7 @@ charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
max_line_length = 100
|
||||
max_line_length = 80
|
||||
|
||||
# Assembly
|
||||
[*.S]
|
||||
@@ -21,16 +21,6 @@ indent_size = 8
|
||||
indent_style = tab
|
||||
indent_size = 8
|
||||
|
||||
# C++
|
||||
[*.{cpp,hpp}]
|
||||
indent_style = tab
|
||||
indent_size = 8
|
||||
|
||||
# Linker Script
|
||||
[*.ld]
|
||||
indent_style = tab
|
||||
indent_size = 8
|
||||
|
||||
# Python
|
||||
[*.py]
|
||||
indent_style = space
|
||||
@@ -41,11 +31,6 @@ indent_size = 4
|
||||
indent_style = tab
|
||||
indent_size = 8
|
||||
|
||||
# reStructuredText
|
||||
[*.rst]
|
||||
indent_style = space
|
||||
indent_size = 3
|
||||
|
||||
# YAML
|
||||
[*.{yml,yaml}]
|
||||
indent_style = space
|
||||
@@ -75,7 +60,6 @@ indent_size = 2
|
||||
# Makefile
|
||||
[Makefile]
|
||||
indent_style = tab
|
||||
indent_size = 8
|
||||
|
||||
# Device tree
|
||||
[*.{dts,dtsi,overlay}]
|
||||
@@ -84,9 +68,8 @@ indent_size = 8
|
||||
|
||||
# Git commit messages
|
||||
[COMMIT_EDITMSG]
|
||||
max_line_length = 75
|
||||
max_line_length = 72
|
||||
|
||||
# Kconfig
|
||||
[Kconfig*]
|
||||
indent_style = tab
|
||||
indent_size = 8
|
||||
indent_style=tab
|
||||
|
||||
6
.gitattributes
vendored
6
.gitattributes
vendored
@@ -4,10 +4,6 @@
|
||||
.gitignore export-ignore
|
||||
.mailmap export-ignore
|
||||
|
||||
# Tell git to not diff certain files
|
||||
*.svg -diff
|
||||
|
||||
# Tell linguist that generated test pattern files should not be included in the
|
||||
# language statistics.
|
||||
*.pat linguist-generated
|
||||
*.svg linguist-generated
|
||||
*.pat linguist-generated=true
|
||||
|
||||
41
.github/ISSUE_TEMPLATE/bin-blobs.md
vendored
41
.github/ISSUE_TEMPLATE/bin-blobs.md
vendored
@@ -1,41 +0,0 @@
|
||||
---
|
||||
name: Binary blobs
|
||||
about: Submit a proposal to integrate binary blob(s)
|
||||
title: ''
|
||||
labels: TSC
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
## Origin
|
||||
|
||||
Describe where the binary blob(s) originate from
|
||||
|
||||
## Type
|
||||
|
||||
- [ ] Precompiled library
|
||||
- [ ] Firmware image
|
||||
|
||||
## Module
|
||||
|
||||
The Zephyr module that this blob(s) will be referenced from
|
||||
|
||||
## Purpose
|
||||
|
||||
Brief description of what the blob(s) do. It is especially important to describe
|
||||
the functionality that the blob(s) provide, to the largest extent possible
|
||||
|
||||
## Pull Request
|
||||
|
||||
Link to the Pull request with the actual implementation of the integration. If
|
||||
you are submitting this as part of a new module you may link to the same Pull
|
||||
Request that introduced the new module.
|
||||
|
||||
## Dependencies
|
||||
|
||||
What other components do the blob(s) depend on, if any?
|
||||
|
||||
## License
|
||||
|
||||
Document the license the blob(s) are distributed under
|
||||
|
||||
13
.github/ISSUE_TEMPLATE/bug_report.md
vendored
13
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -9,14 +9,7 @@ assignees: ''
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
Please also mention any information which could help others to understand
|
||||
the problem you're facing:
|
||||
- What target platform are you using?
|
||||
- What have you tried to diagnose or workaround this issue?
|
||||
- Is this a regression? If yes, have you been able to "git bisect" it to a
|
||||
specific commit?
|
||||
- ...
|
||||
What have you tried to diagnose or workaround this issue?
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
@@ -42,6 +35,6 @@ explain the issue. (if unable to obtain text log, add a screenshot)
|
||||
- Toolchain (e.g Zephyr SDK, ...)
|
||||
- Commit SHA or Version used
|
||||
|
||||
|
||||
**Additional context**
|
||||
Add any other context that could be relevant to your issue, such as pin setting,
|
||||
target configuration, ...
|
||||
Add any other context about the problem here.
|
||||
|
||||
10
.github/ISSUE_TEMPLATE/ext-source.md
vendored
10
.github/ISSUE_TEMPLATE/ext-source.md
vendored
@@ -18,16 +18,10 @@ Brief description of what this software does
|
||||
|
||||
## Mode of integration
|
||||
|
||||
Describe whether you'd like to integrate this external component in the main tree
|
||||
Describe whether you'd like to integrate this exernal component in the main tree
|
||||
or as a module, and why. If the mode of integration is a module, suggest a
|
||||
repository name for the module
|
||||
|
||||
## Maintainership
|
||||
|
||||
List the person(s) that will be maintaining the integration of this external code
|
||||
for the foreseeable future. Please use GitHub IDs to identify them. You can
|
||||
choose to identify a single maintainer only or add collaborators as well
|
||||
|
||||
## Pull Request
|
||||
|
||||
Pull request (if any) with the actual implementation of the integration, be it
|
||||
@@ -49,7 +43,7 @@ required to maintain ...)
|
||||
Why is this the right component to solve it (e.g., SQLite is small,
|
||||
easy to use, and has a very liberal license.)
|
||||
|
||||
## Dependencies
|
||||
# Dependencies
|
||||
|
||||
What other components does this package depend on?
|
||||
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/feature_request.md
vendored
2
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -2,7 +2,7 @@
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: Feature Request
|
||||
labels: feature request
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
42
.github/ISSUE_TEMPLATE/nomination.md
vendored
42
.github/ISSUE_TEMPLATE/nomination.md
vendored
@@ -1,42 +0,0 @@
|
||||
---
|
||||
name: Contributor Nomination
|
||||
about: Nominate a GitHub user for additional rights on the Zephyr Project
|
||||
title: ''
|
||||
labels: Role Nomination
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
# Background
|
||||
|
||||
The [TSC Project Roles] defines the main roles for the Zephyr Project, including
|
||||
Maintainer, Collaborator, and Contributor.
|
||||
|
||||
By default anyone that contributes code or documentation is a Contributor, but
|
||||
with the lowest [GitHub Permission Level] of Read. For example, Contributors
|
||||
with Read permission do not have the permission to add reviewers to a pull
|
||||
request.
|
||||
|
||||
Use this template to nominate a GitHub user for the Contributor role with
|
||||
Triage permission level, which allows the user to add reviewers to a pull
|
||||
request and be added as a reviewer by other users.
|
||||
|
||||
# Nomination
|
||||
|
||||
## GitHub User
|
||||
|
||||
Provide the following information about the GitHub user:
|
||||
|
||||
1. Full Name
|
||||
1. GitHub username
|
||||
1. Organization (optional)
|
||||
|
||||
## Supporting Documents
|
||||
|
||||
Add links to 3-5 GitHub pull requests, in the Zephyr project, authored or
|
||||
reviewed by the GitHub user that demonstrate the user's dedication to the
|
||||
Zephyr project.
|
||||
|
||||
|
||||
[TSC Project Roles]: <https://docs.zephyrproject.org/latest/project/project_roles.html>
|
||||
[GitHub Permission Level]: <https://docs.github.com/en/organizations/managing-access-to-your-organizations-repositories/repository-roles-for-an-organization>
|
||||
8
.github/SECURITY.md
vendored
8
.github/SECURITY.md
vendored
@@ -8,12 +8,12 @@ updates:
|
||||
- The most recent release, and the release prior to that.
|
||||
- Active LTS releases.
|
||||
|
||||
At this time, with the latest release of v3.2.0, the supported
|
||||
At this time, with the latest release of v2.5.0, the supported
|
||||
versions are:
|
||||
|
||||
- v2.7.0: Current LTS
|
||||
- v3.1.0: Prior release
|
||||
- v3.2.0: Current release
|
||||
- 1.14.2: Current LTS
|
||||
- v2.5.0: Prior release
|
||||
- v2.6.0: Current release
|
||||
|
||||
## Reporting process
|
||||
|
||||
|
||||
168
.github/labeler.yml
vendored
Normal file
168
.github/labeler.yml
vendored
Normal file
@@ -0,0 +1,168 @@
|
||||
"Release Notes":
|
||||
- "doc/releases/**/*"
|
||||
"area: Modem":
|
||||
- "drivers/modem/**/*"
|
||||
"area: PWM":
|
||||
- "drivers/pwm/**/*"
|
||||
"area: Watchdog":
|
||||
- "drivers/watchdog/**/*"
|
||||
"area: Sensors":
|
||||
- "drivers/sensors/**/*"
|
||||
"area: ADC":
|
||||
- "drivers/adc/**/*"
|
||||
"area: Counter":
|
||||
- "drivers/counter/**/*"
|
||||
"area: CAN":
|
||||
- "include/drivers/can.h"
|
||||
- "include/canbus/*/**"
|
||||
- "drivers/can/**/*"
|
||||
- "subsys/canbus/*/**"
|
||||
"area: EEPROM":
|
||||
- "include/drivers/eeprom.h"
|
||||
- "drivers/eeprom/**/*"
|
||||
"area: Timer":
|
||||
- "drivers/timer/**/*"
|
||||
"area: I2S":
|
||||
- "drivers/i2s/**/*"
|
||||
"area: C Library":
|
||||
- "lib/libc/**/*"
|
||||
"area: Devicetree":
|
||||
- "dts/**/*"
|
||||
- "**/*.dts"
|
||||
- "**/*.dtsi"
|
||||
- "include/devicetree.h"
|
||||
- "include/devicetree/*"
|
||||
- "doc/guides/dts/**/*"
|
||||
"area: Devicetree Binding":
|
||||
- "include/dt-bindings/**/*"
|
||||
- "dts/bindings/**/*"
|
||||
"area: Devicetree Tooling":
|
||||
- "scripts/dts/**/*"
|
||||
"area: I2C":
|
||||
- "drivers/i2c/**/*"
|
||||
"area: SPI":
|
||||
- "drivers/spi/**/*"
|
||||
"area: Boards":
|
||||
- "boards/**/*"
|
||||
"area: POSIX":
|
||||
- "lib/posix/**/*"
|
||||
"area: native port":
|
||||
- "arch/posix/**/*"
|
||||
- "include/arch/posix/**/*"
|
||||
- "soc/posix/**/*"
|
||||
- "**/*native_posix*"
|
||||
"area: X86":
|
||||
- "arch/x86/**/*"
|
||||
- "include/arch/x86/**/*"
|
||||
"area: ARM":
|
||||
- "arch/arm/**/*"
|
||||
- "include/arch/arm/**/*"
|
||||
"area: ARM64":
|
||||
- "arch/arm64/**/*"
|
||||
- "include/arch/arm64/**/*"
|
||||
"area: NIOS2":
|
||||
- "arch/nios2/**/*"
|
||||
- "include/arch/nios2/**/*"
|
||||
"area: Xtensa":
|
||||
- "arch/xtensa/**/*"
|
||||
- "include/arch/xtensa/**/*"
|
||||
"area: RISCV":
|
||||
- "arch/risv/**/*"
|
||||
- "include/arch/riscv/**/*"
|
||||
"area: ARC":
|
||||
- "arch/arc/**/*"
|
||||
- "include/arch/arc/**/*"
|
||||
"area: Networking":
|
||||
- "subsys/net/**/*"
|
||||
- "samples/net/**/*"
|
||||
- "tests/net/**/*"
|
||||
- "include/net/**/*"
|
||||
- "include/drivers/ieee802154/**/*"
|
||||
- "drivers/ethernet/**/*"
|
||||
- "drivers/ieee802154/**/*"
|
||||
- "drivers/wifi/**/*"
|
||||
- "drivers/ptp_clock/**/*"
|
||||
- "drivers/net/**/*"
|
||||
"area: Logging":
|
||||
- "subsys/logging/**/*"
|
||||
"area: Shell":
|
||||
- "subsys/shell/**/*"
|
||||
"area: Console":
|
||||
- "subsys/console/**/*"
|
||||
"area: Test Framework":
|
||||
- "subsys/testsuite/**/*"
|
||||
"area: Settings":
|
||||
- "subsys/settings/**/*"
|
||||
"area: File System":
|
||||
- "subsys/fs/**/*"
|
||||
"area: Storage":
|
||||
- "subsys/storage/**/*"
|
||||
"area: Bluetooth":
|
||||
- "subsys/bluetooth/**/*"
|
||||
- "**/*bluetooth*"
|
||||
"area: Bluetooth Mesh":
|
||||
- "subsys/bluetooth/mesh/**/*"
|
||||
"area: Bluetooth Audio":
|
||||
- "subsys/bluetooth/audio/**/*"
|
||||
"area: Bluetooth Controller":
|
||||
- "subsys/bluetooth/controller/**/*"
|
||||
"area: Bluetooth Host":
|
||||
- "subsys/bluetooth/host/**/*"
|
||||
- "subsys/bluetooth/services/**/*"
|
||||
"area: API":
|
||||
- "include/**/*"
|
||||
"area: Samples":
|
||||
- "samples/**/*"
|
||||
"area: Tests":
|
||||
- "tests/**/*"
|
||||
"area: Kernel":
|
||||
- "kernel/**/*"
|
||||
- "tests/kernel/**/*"
|
||||
"area: Documentation":
|
||||
- "**/*.rst"
|
||||
- "**/*.md"
|
||||
"area: Build System":
|
||||
- "cmake/**/*"
|
||||
- "CmakeLists.txt"
|
||||
"area: Kconfig":
|
||||
- "scripts/kconfig/**/*"
|
||||
- "Kconfig"
|
||||
- "Kconfig.zephyr"
|
||||
"area: Twister":
|
||||
- "scripts/twister"
|
||||
- "scripts/pylib/twister/**/*"
|
||||
"area: Modules":
|
||||
- "west.yml"
|
||||
- "modules/**/*"
|
||||
"area: Shields":
|
||||
- "boards/shields/**"
|
||||
- "samples/shields/**"
|
||||
"area: Power Management":
|
||||
- "subsys/pm/**/*"
|
||||
- "include/pm/**/*"
|
||||
- "tests/subsys/pm/**/*"
|
||||
- "samples/subsys/pm/**/*"
|
||||
"platform: NXP":
|
||||
- "boards/arm/frdm*/**"
|
||||
- "boards/arm/hexiwear*/**"
|
||||
- "boards/arm/lpcxpresso*/**"
|
||||
- "boards/arm/*imx*/**"
|
||||
- "drivers/**/*imx*"
|
||||
- "drivers/**/*mcux*"
|
||||
- "dts/arm/nxp/*/*"
|
||||
- "dts/bindings/**/nxp*"
|
||||
- "soc/arm/nxp*/**"
|
||||
"platform: STM32":
|
||||
- "boards/arm/nucleo_*/**"
|
||||
- "boards/arm/*stm32*/**"
|
||||
- "drivers/**/*stm32*"
|
||||
- "dts/arm/st/*/*"
|
||||
- "include/drivers/*/*stm32*"
|
||||
- "soc/arm/st_stm32/**"
|
||||
"platform: SiLabs":
|
||||
- "boards/arm/efr32_*/**/*"
|
||||
- "boards/arm/efm32_*/**/*"
|
||||
- "drivers/**/*gecko*"
|
||||
- "dts/arm/silabs/**/*"
|
||||
- "dts/bindings/**/silabs,gecko*"
|
||||
- "soc/arm/silabs_exx32/**/*"
|
||||
38
.github/workflows/assigner.yml
vendored
38
.github/workflows/assigner.yml
vendored
@@ -1,38 +0,0 @@
|
||||
name: Pull Request Assigner
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- reopened
|
||||
- ready_for_review
|
||||
branches:
|
||||
- main
|
||||
- v*-branch
|
||||
|
||||
jobs:
|
||||
assignment:
|
||||
name: Pull Request Assignment
|
||||
if: github.event.pull_request.draft == false
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- name: Install Python dependencies
|
||||
run: |
|
||||
sudo pip3 install -U setuptools wheel pip
|
||||
pip3 install -U PyGithub>=1.55
|
||||
|
||||
- name: Check out source code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Run assignment script
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.ZB_GITHUB_TOKEN }}
|
||||
run: |
|
||||
python3 scripts/set_assignees.py \
|
||||
-v \
|
||||
-o ${{ github.event.repository.owner.login }} \
|
||||
-r ${{ github.event.repository.name }} \
|
||||
-M MAINTAINERS.yml \
|
||||
-P ${{ github.event.pull_request.number }}
|
||||
4
.github/workflows/backport.yml
vendored
4
.github/workflows/backport.yml
vendored
@@ -9,11 +9,11 @@ on:
|
||||
|
||||
jobs:
|
||||
backport:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-18.04
|
||||
name: Backport
|
||||
steps:
|
||||
- name: Backport
|
||||
uses: zephyrproject-rtos/action-backport@v1.1.1-3
|
||||
uses: zephyrproject-rtos/action-backport@v1.1.1-1
|
||||
with:
|
||||
github_token: ${{ secrets.ZB_GITHUB_TOKEN }}
|
||||
issue_labels: backport
|
||||
|
||||
31
.github/workflows/backport_issue_check.yml
vendored
31
.github/workflows/backport_issue_check.yml
vendored
@@ -1,31 +0,0 @@
|
||||
name: Backport Issue Check
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
branches:
|
||||
- v*-branch
|
||||
|
||||
jobs:
|
||||
backport:
|
||||
name: Backport Issue Check
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.repository == 'zephyrproject-rtos/zephyr'
|
||||
|
||||
steps:
|
||||
- name: Check out source code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Python dependencies
|
||||
run: |
|
||||
sudo pip3 install -U setuptools wheel pip
|
||||
pip3 install -U pygithub
|
||||
|
||||
- name: Run backport issue checker
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.ZB_GITHUB_TOKEN }}
|
||||
run: |
|
||||
./scripts/release/list_backports.py \
|
||||
-o ${{ github.event.repository.owner.login }} \
|
||||
-r ${{ github.event.repository.name }} \
|
||||
-b ${{ github.event.pull_request.base.ref }} \
|
||||
-p ${{ github.event.pull_request.number }}
|
||||
29
.github/workflows/bluetooth-tests-publish.yaml
vendored
29
.github/workflows/bluetooth-tests-publish.yaml
vendored
@@ -1,29 +0,0 @@
|
||||
name: Publish Bluetooth Tests Results
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Bluetooth Tests"]
|
||||
types:
|
||||
- completed
|
||||
jobs:
|
||||
bluetooth-test-results:
|
||||
name: "Publish Bluetooth Test Results"
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event.workflow_run.conclusion != 'skipped'
|
||||
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
uses: dawidd6/action-download-artifact@v2
|
||||
with:
|
||||
workflow: bluetooth-tests.yaml
|
||||
run_id: ${{ github.event.workflow_run.id }}
|
||||
|
||||
- name: Publish Bluetooth Test Results
|
||||
uses: EnricoMi/publish-unit-test-result-action@v1
|
||||
with:
|
||||
check_name: Bluetooth Test Results
|
||||
comment_mode: off
|
||||
commit: ${{ github.event.workflow_run.head_sha }}
|
||||
event_file: event/event.json
|
||||
event_name: ${{ github.event.workflow_run.event }}
|
||||
files: "bluetooth-test-results/**/bsim_results.xml"
|
||||
97
.github/workflows/bluetooth-tests.yaml
vendored
97
.github/workflows/bluetooth-tests.yaml
vendored
@@ -1,97 +0,0 @@
|
||||
name: Bluetooth Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- ".github/workflows/bluetooth-test*.yaml"
|
||||
- "west.yml"
|
||||
- "subsys/bluetooth/**"
|
||||
- "tests/bluetooth/bsim_bt/**"
|
||||
- "boards/posix/**"
|
||||
- "soc/posix/**"
|
||||
- "arch/posix/**"
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
bluetooth-test:
|
||||
if: github.repository_owner == 'zephyrproject-rtos'
|
||||
runs-on: zephyr-runner-linux-x64-4xlarge
|
||||
container:
|
||||
image: ghcr.io/zephyrproject-rtos/ci:v0.24.11
|
||||
options: '--entrypoint /bin/bash'
|
||||
volumes:
|
||||
- /repo-cache/zephyrproject:/github/cache/zephyrproject
|
||||
env:
|
||||
ZEPHYR_TOOLCHAIN_VARIANT: zephyr
|
||||
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.2
|
||||
BSIM_OUT_PATH: /opt/bsim/
|
||||
BSIM_COMPONENTS_PATH: /opt/bsim/components
|
||||
EDTT_PATH: ../tools/edtt
|
||||
bsim_bt_test_results_file: ./bsim_bt_out/bsim_results.xml
|
||||
steps:
|
||||
- name: Apply container owner mismatch workaround
|
||||
run: |
|
||||
# FIXME: The owner UID of the GITHUB_WORKSPACE directory may not
|
||||
# match the container user UID because of the way GitHub
|
||||
# Actions runner is implemented. Remove this workaround when
|
||||
# GitHub comes up with a fundamental fix for this problem.
|
||||
git config --global --add safe.directory ${GITHUB_WORKSPACE}
|
||||
|
||||
- name: Clone cached Zephyr repository
|
||||
continue-on-error: true
|
||||
run: |
|
||||
git clone --shared /github/cache/zephyrproject/zephyr .
|
||||
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Environment Setup
|
||||
env:
|
||||
BASE_REF: ${{ github.base_ref }}
|
||||
run: |
|
||||
git config --global user.email "bot@zephyrproject.org"
|
||||
git config --global user.name "Zephyr Bot"
|
||||
rm -fr ".git/rebase-apply"
|
||||
git rebase origin/${BASE_REF}
|
||||
git log --pretty=oneline | head -n 10
|
||||
west init -l . || true
|
||||
west config manifest.group-filter -- +ci
|
||||
west config --global update.narrow true
|
||||
west update --path-cache /github/cache/zephyrproject 2>&1 1> west.update.log || west update --path-cache /github/cache/zephyrproject 2>&1 1> west.update.log || ( rm -rf ../modules ../bootloader ../tools && west update --path-cache /github/cache/zephyrproject)
|
||||
west forall -c 'git reset --hard HEAD'
|
||||
|
||||
- name: Install parallel
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y parallel
|
||||
parallel --version
|
||||
|
||||
- name: Run Bluetooth Tests with BSIM
|
||||
run: |
|
||||
export ZEPHYR_BASE=${PWD}
|
||||
WORK_DIR=${ZEPHYR_BASE}/bsim_bt_out tests/bluetooth/bsim_bt/compile.sh
|
||||
RESULTS_FILE=${ZEPHYR_BASE}/${bsim_bt_test_results_file} \
|
||||
SEARCH_PATH=tests/bluetooth/bsim_bt/ tests/bluetooth/bsim_bt/run_parallel.sh
|
||||
|
||||
- name: Upload Test Results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: bluetooth-test-results
|
||||
path: |
|
||||
./bsim_bt_out/bsim_results.xml
|
||||
${{ github.event_path }}
|
||||
|
||||
- name: Upload Event Details
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: event
|
||||
path: |
|
||||
${{ github.event_path }}
|
||||
85
.github/workflows/bsim.yaml
vendored
Normal file
85
.github/workflows/bsim.yaml
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
name: Bluetooth Tests
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
paths:
|
||||
- "west.yml"
|
||||
- "subsys/bluetooth/**"
|
||||
- "tests/bluetooth/bsim_bt/**"
|
||||
- "boards/posix/**"
|
||||
- "soc/posix/**"
|
||||
- "arch/posix/**"
|
||||
|
||||
jobs:
|
||||
bsim-build-cancel:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Cancel Previous Runs
|
||||
uses: styfle/cancel-workflow-action@0.6.0
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
bsim-build:
|
||||
runs-on: ubuntu-latest
|
||||
needs: bsim-build-cancel
|
||||
container:
|
||||
image: zephyrprojectrtos/ci:v0.18.4
|
||||
options: '--entrypoint /bin/bash'
|
||||
env:
|
||||
ZEPHYR_TOOLCHAIN_VARIANT: zephyr
|
||||
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.13.1
|
||||
CLANG_ROOT_DIR: /usr/lib/llvm-12
|
||||
BSIM_OUT_PATH: /opt/bsim/
|
||||
BSIM_COMPONENTS_PATH: /opt/bsim/components
|
||||
EDTT_PATH: ../tools/edtt
|
||||
bsim_bt_test_results_file: ./bsim_bt_out/bsim_results.xml
|
||||
steps:
|
||||
- name: Update PATH for west
|
||||
run: |
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: west setup
|
||||
run: |
|
||||
west init -l . || true
|
||||
west update
|
||||
|
||||
- name: Run Bluetooth Tests with BSIM
|
||||
run: |
|
||||
#source zephyr-env.sh
|
||||
export ZEPHYR_BASE=${PWD}
|
||||
WORK_DIR=${ZEPHYR_BASE}/bsim_bt_out tests/bluetooth/bsim_bt/compile.sh
|
||||
RESULTS_FILE=${ZEPHYR_BASE}/${bsim_bt_test_results_file} \
|
||||
SEARCH_PATH=tests/bluetooth/bsim_bt/ tests/bluetooth/bsim_bt/run_parallel.sh
|
||||
|
||||
- name: Upload Test Results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Bluetooth Test Results
|
||||
path: ./bsim_bt_out/bsim_results.xml
|
||||
|
||||
publish-test-results:
|
||||
name: "Publish Unit Tests Results"
|
||||
needs: bsim-build
|
||||
runs-on: ubuntu-20.04
|
||||
# the build-and-test job might be skipped, we don't need to run this job then
|
||||
if: success() || failure()
|
||||
|
||||
steps:
|
||||
- name: Download Artifacts
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
path: artifacts
|
||||
|
||||
- name: Publish Unit Test Results
|
||||
uses: EnricoMi/publish-unit-test-result-action@v1.12
|
||||
with:
|
||||
check_name: Bluetooth Test Results
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
files: "**/bsim_results.xml"
|
||||
comment_on_pr: false
|
||||
67
.github/workflows/bug_snapshot.yaml
vendored
67
.github/workflows/bug_snapshot.yaml
vendored
@@ -1,67 +0,0 @@
|
||||
# Copyright (c) 2021, 2022 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Make a snapshot of open bugs as a python pickle file, compressed
|
||||
# using xz. Upload the xz file to Amazon S3.
|
||||
|
||||
name: Bug Snapshot
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
branches: [main]
|
||||
schedule:
|
||||
# Run daily at 14:05
|
||||
- cron: '5 14 * * *'
|
||||
|
||||
jobs:
|
||||
make_bugs_pickle:
|
||||
name: Make bugs pickle
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.repository_owner == 'zephyrproject-rtos'
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Python dependencies
|
||||
run: |
|
||||
sudo pip3 install -U setuptools wheel pip
|
||||
pip3 install -U pygithub
|
||||
|
||||
- name: Snapshot bugs
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
BUGS_PICKLE_FILENAME="zephyr-bugs-$(date -I).pickle.xz"
|
||||
BUGS_PICKLE_PATH="${RUNNER_TEMP}/${BUGS_PICKLE_FILENAME}"
|
||||
|
||||
set -euo pipefail
|
||||
python3 scripts/make_bugs_pickle.py | xz > ${BUGS_PICKLE_PATH}
|
||||
|
||||
echo "BUGS_PICKLE_FILENAME=${BUGS_PICKLE_FILENAME}" >> ${GITHUB_ENV}
|
||||
echo "BUGS_PICKLE_PATH=${BUGS_PICKLE_PATH}" >> ${GITHUB_ENV}
|
||||
|
||||
- name: Configure AWS Credentials
|
||||
uses: aws-actions/configure-aws-credentials@v1
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_BUILDS_ZEPHYR_BUG_SNAPSHOT_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_BUILDS_ZEPHYR_BUG_SNAPSHOT_SECRET_ACCESS_KEY }}
|
||||
aws-region: us-east-1
|
||||
|
||||
- name: Upload to AWS S3
|
||||
run: |
|
||||
REPOSITORY_NAME="${GITHUB_REPOSITORY#*/}"
|
||||
|
||||
PUBLISH_BUCKET="builds.zephyrproject.org"
|
||||
PUBLISH_DOMAIN="builds.zephyrproject.io"
|
||||
if [ "${{github.event_name}}" = "schedule" ]; then
|
||||
PUBLISH_ROOT="${REPOSITORY_NAME}/bug-snapshot/daily"
|
||||
else
|
||||
PUBLISH_ROOT="${REPOSITORY_NAME}/bug-snapshot"
|
||||
fi
|
||||
|
||||
PUBLISH_UPLOAD_URI="s3://${PUBLISH_BUCKET}/${PUBLISH_ROOT}/${BUGS_PICKLE_FILENAME}"
|
||||
PUBLISH_DOWNLOAD_URI="https://${PUBLISH_DOMAIN}/${PUBLISH_ROOT}/${BUGS_PICKLE_FILENAME}"
|
||||
|
||||
aws s3 cp --quiet ${BUGS_PICKLE_PATH} ${PUBLISH_UPLOAD_URI}
|
||||
echo "Bug pickle is available at: ${PUBLISH_DOWNLOAD_URI}" >> ${GITHUB_STEP_SUMMARY}
|
||||
147
.github/workflows/clang.yaml
vendored
147
.github/workflows/clang.yaml
vendored
@@ -2,160 +2,89 @@ name: Build with Clang/LLVM
|
||||
|
||||
on: pull_request_target
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
clang-build-cancel:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Cancel Previous Runs
|
||||
uses: styfle/cancel-workflow-action@0.6.0
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
clang-build:
|
||||
if: github.repository_owner == 'zephyrproject-rtos'
|
||||
runs-on: zephyr-runner-linux-x64-4xlarge
|
||||
runs-on: ubuntu-latest
|
||||
needs: clang-build-cancel
|
||||
container:
|
||||
image: ghcr.io/zephyrproject-rtos/ci:v0.24.11
|
||||
image: zephyrprojectrtos/ci:v0.18.4
|
||||
options: '--entrypoint /bin/bash'
|
||||
volumes:
|
||||
- /repo-cache/zephyrproject:/github/cache/zephyrproject
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: ["native_posix"]
|
||||
subset: [1, 2, 3, 4, 5]
|
||||
env:
|
||||
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.2
|
||||
LLVM_TOOLCHAIN_PATH: /usr/lib/llvm-15
|
||||
COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
|
||||
BASE_REF: ${{ github.base_ref }}
|
||||
outputs:
|
||||
report_needed: ${{ steps.twister.outputs.report_needed }}
|
||||
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.13.1
|
||||
CLANG_ROOT_DIR: /usr/lib/llvm-12
|
||||
MATRIX_SIZE: 5
|
||||
steps:
|
||||
- name: Apply container owner mismatch workaround
|
||||
- name: Cancel Previous Runs
|
||||
uses: styfle/cancel-workflow-action@0.6.0
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
- name: Update PATH for west
|
||||
run: |
|
||||
# FIXME: The owner UID of the GITHUB_WORKSPACE directory may not
|
||||
# match the container user UID because of the way GitHub
|
||||
# Actions runner is implemented. Remove this workaround when
|
||||
# GitHub comes up with a fundamental fix for this problem.
|
||||
git config --global --add safe.directory ${GITHUB_WORKSPACE}
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Clone cached Zephyr repository
|
||||
continue-on-error: true
|
||||
run: |
|
||||
git clone --shared /github/cache/zephyrproject/zephyr .
|
||||
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Environment Setup
|
||||
- name: west setup
|
||||
run: |
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
git config --global user.email "bot@zephyrproject.org"
|
||||
git config --global user.name "Zephyr Bot"
|
||||
rm -fr ".git/rebase-apply"
|
||||
git rebase origin/${BASE_REF}
|
||||
git log --pretty=oneline | head -n 10
|
||||
west init -l . || true
|
||||
west config --global update.narrow true
|
||||
# In some cases modules are left in a state where they can't be
|
||||
# updated (i.e. when we cancel a job and the builder is killed),
|
||||
# So first retry to update, if that does not work, remove all modules
|
||||
# and start over. (Workaround until we implement more robust module
|
||||
# west caching).
|
||||
west update --path-cache /github/cache/zephyrproject 2>&1 1> west.log || west update --path-cache /github/cache/zephyrproject 2>&1 1> west2.log || ( rm -rf ../modules ../bootloader ../tools && west update --path-cache /github/cache/zephyrproject)
|
||||
west update
|
||||
|
||||
- name: Check Environment
|
||||
run: |
|
||||
cmake --version
|
||||
${LLVM_TOOLCHAIN_PATH}/bin/clang --version
|
||||
${CLANG_ROOT_DIR}/bin/clang --version
|
||||
gcc --version
|
||||
ls -la
|
||||
|
||||
- name: Prepare ccache timestamp/data
|
||||
id: ccache_cache_timestamp
|
||||
shell: cmake -P {0}
|
||||
run: |
|
||||
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
|
||||
string(REPLACE "/" "_" repo ${{github.repository}})
|
||||
string(REPLACE "-" "_" repo2 ${repo})
|
||||
file(APPEND $ENV{GITHUB_OUTPUT} "repo=${repo2}\n")
|
||||
- name: use cache
|
||||
id: cache-ccache
|
||||
uses: zephyrproject-rtos/action-s3-cache@v1
|
||||
with:
|
||||
key: ${{ steps.ccache_cache_timestamp.outputs.repo }}-${{ github.ref_name }}-clang-${{ matrix.platform }}-ccache
|
||||
path: /github/home/.ccache
|
||||
aws-s3-bucket: ccache.zephyrproject.org
|
||||
aws-access-key-id: ${{ secrets.CCACHE_S3_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.CCACHE_S3_SECRET_ACCESS_KEY }}
|
||||
aws-region: us-east-2
|
||||
|
||||
- name: ccache stats initial
|
||||
run: |
|
||||
test -d github/home/.ccache && rm -rf /github/home/.ccache && mv github/home/.ccache /github/home/.ccache
|
||||
ccache -M 10G -s
|
||||
|
||||
- name: Run Tests with Twister
|
||||
id: twister
|
||||
run: |
|
||||
#source zephyr-env.sh
|
||||
export ZEPHYR_BASE=${PWD}
|
||||
export ZEPHYR_TOOLCHAIN_VARIANT=llvm
|
||||
|
||||
# check if we need to run a full twister or not based on files changed
|
||||
python3 ./scripts/ci/test_plan.py --platform ${{ matrix.platform }} -c origin/${BASE_REF}..
|
||||
|
||||
# We can limit scope to just what has changed
|
||||
if [ -s testplan.json ]; then
|
||||
echo "report_needed=1" >> $GITHUB_OUTPUT
|
||||
# Full twister but with options based on changes
|
||||
./scripts/twister --force-color --inline-logs -M -N -v --load-tests testplan.json --retry-failed 2
|
||||
else
|
||||
# if nothing is run, skip reporting step
|
||||
echo "report_needed=0" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: ccache stats post
|
||||
run: |
|
||||
ccache -s
|
||||
./scripts/twister --inline-logs -M -N -v -p native_posix --subset ${{matrix.subset}}/${MATRIX_SIZE} --retry-failed 3
|
||||
|
||||
- name: Upload Unit Test Results
|
||||
if: always() && steps.twister.outputs.report_needed != 0
|
||||
uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Unit Test Results (Subset ${{ matrix.platform }})
|
||||
name: Unit Test Results (Subset ${{ matrix.subset }})
|
||||
path: twister-out/twister.xml
|
||||
|
||||
clang-build-results:
|
||||
publish-test-results:
|
||||
name: "Publish Unit Tests Results"
|
||||
needs: clang-build
|
||||
runs-on: ubuntu-20.04
|
||||
if: (success() || failure() ) && needs.clang-build.outputs.report_needed != 0
|
||||
# the build-and-test job might be skipped, we don't need to run this job then
|
||||
if: success() || failure()
|
||||
|
||||
steps:
|
||||
- name: Download Artifacts
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
path: artifacts
|
||||
- name: Merge Test Results
|
||||
run: |
|
||||
pip3 install junitparser junit2html
|
||||
junitparser merge artifacts/*/twister.xml junit.xml
|
||||
junit2html junit.xml junit-clang.html
|
||||
|
||||
- name: Upload Unit Test Results in HTML
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: HTML Unit Test Results
|
||||
if-no-files-found: ignore
|
||||
path: |
|
||||
junit-clang.html
|
||||
- name: Display structure of downloaded files
|
||||
run: ls -R
|
||||
|
||||
- name: Publish Unit Test Results
|
||||
uses: EnricoMi/publish-unit-test-result-action@v1
|
||||
if: always()
|
||||
uses: EnricoMi/publish-unit-test-result-action@v1.12
|
||||
with:
|
||||
check_name: Unit Test Results
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
files: "**/twister.xml"
|
||||
comment_mode: off
|
||||
comment_on_pr: false
|
||||
|
||||
174
.github/workflows/codecov.yaml
vendored
174
.github/workflows/codecov.yaml
vendored
@@ -1,174 +0,0 @@
|
||||
name: Code Coverage with codecov
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '25 */3 * * 1-5'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
codecov:
|
||||
if: github.repository == 'zephyrproject-rtos/zephyr'
|
||||
runs-on: zephyr-runner-linux-x64-4xlarge
|
||||
container:
|
||||
image: ghcr.io/zephyrproject-rtos/ci:v0.24.11
|
||||
options: '--entrypoint /bin/bash'
|
||||
volumes:
|
||||
- /repo-cache/zephyrproject:/github/cache/zephyrproject
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: ["native_posix", "qemu_x86", "unit_testing"]
|
||||
env:
|
||||
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.2
|
||||
steps:
|
||||
- name: Apply container owner mismatch workaround
|
||||
run: |
|
||||
# FIXME: The owner UID of the GITHUB_WORKSPACE directory may not
|
||||
# match the container user UID because of the way GitHub
|
||||
# Actions runner is implemented. Remove this workaround when
|
||||
# GitHub comes up with a fundamental fix for this problem.
|
||||
git config --global --add safe.directory ${GITHUB_WORKSPACE}
|
||||
|
||||
- name: Update PATH for west
|
||||
run: |
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Clone cached Zephyr repository
|
||||
continue-on-error: true
|
||||
run: |
|
||||
git clone --shared /github/cache/zephyrproject/zephyr .
|
||||
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
|
||||
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: west setup
|
||||
run: |
|
||||
west init -l . || true
|
||||
west update 1> west.update.log || west update 1> west.update-2.log
|
||||
|
||||
- name: Check Environment
|
||||
run: |
|
||||
cmake --version
|
||||
gcc --version
|
||||
ls -la
|
||||
- name: Prepare ccache keys
|
||||
id: ccache_cache_prop
|
||||
shell: cmake -P {0}
|
||||
run: |
|
||||
string(REPLACE "/" "_" repo ${{github.repository}})
|
||||
string(REPLACE "-" "_" repo2 ${repo})
|
||||
file(APPEND $ENV{GITHUB_OUTPUT} "repo=${repo2}\n")
|
||||
|
||||
- name: use cache
|
||||
id: cache-ccache
|
||||
uses: zephyrproject-rtos/action-s3-cache@v1
|
||||
with:
|
||||
key: ${{ steps.ccache_cache_prop.outputs.repo }}-${{github.event_name}}-${{matrix.platform}}-codecov-ccache
|
||||
path: /github/home/.ccache
|
||||
aws-s3-bucket: ccache.zephyrproject.org
|
||||
aws-access-key-id: ${{ secrets.CCACHE_S3_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.CCACHE_S3_SECRET_ACCESS_KEY }}
|
||||
aws-region: us-east-2
|
||||
|
||||
- name: ccache stats initial
|
||||
run: |
|
||||
test -d github/home/.ccache && mv github/home/.ccache /github/home/.ccache
|
||||
ccache -M 10G -s
|
||||
|
||||
- name: Run Tests with Twister (Push)
|
||||
continue-on-error: true
|
||||
run: |
|
||||
export ZEPHYR_BASE=${PWD}
|
||||
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
|
||||
mkdir -p coverage/reports
|
||||
./scripts/twister --force-color -N -v --filter runnable -p ${{ matrix.platform }} --coverage -T tests
|
||||
|
||||
- name: Generate Coverage Report
|
||||
run: |
|
||||
mv twister-out/coverage.info lcov.pre.info
|
||||
lcov -q --remove lcov.pre.info mylib.c --remove lcov.pre.info tests/\* \
|
||||
--remove lcov.pre.info samples/\* --remove lcov.pre.info ext/\* \
|
||||
--remove lcov.pre.info *generated* \
|
||||
-o coverage/reports/${{ matrix.platform }}.info --rc lcov_branch_coverage=1
|
||||
|
||||
- name: ccache stats post
|
||||
run: |
|
||||
ccache -s
|
||||
|
||||
- name: Upload Coverage Results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Coverage Data (Subset ${{ matrix.platform }})
|
||||
path: coverage/reports/${{ matrix.platform }}.info
|
||||
|
||||
codecov-results:
|
||||
name: "Publish Coverage Results"
|
||||
needs: codecov
|
||||
runs-on: ubuntu-20.04
|
||||
# the codecov job might be skipped, we don't need to run this job then
|
||||
if: success() || failure()
|
||||
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Download Artifacts
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
path: coverage/reports
|
||||
|
||||
- name: Move coverage files
|
||||
run: |
|
||||
mv ./coverage/reports/*/*.info ./coverage/reports
|
||||
ls -la ./coverage/reports
|
||||
|
||||
- name: Generate list of coverage files
|
||||
id: get-coverage-files
|
||||
shell: cmake -P {0}
|
||||
run: |
|
||||
file(GLOB INPUT_FILES_LIST "coverage/reports/*.info")
|
||||
set(MERGELIST "")
|
||||
set(FILELIST "")
|
||||
foreach(ITEM ${INPUT_FILES_LIST})
|
||||
get_filename_component(f ${ITEM} NAME)
|
||||
if(FILELIST STREQUAL "")
|
||||
set(FILELIST "${f}")
|
||||
else()
|
||||
set(FILELIST "${FILELIST},${f}")
|
||||
endif()
|
||||
endforeach()
|
||||
foreach(ITEM ${INPUT_FILES_LIST})
|
||||
get_filename_component(f ${ITEM} NAME)
|
||||
if(MERGELIST STREQUAL "")
|
||||
set(MERGELIST "-a ${f}")
|
||||
else()
|
||||
set(MERGELIST "${MERGELIST} -a ${f}")
|
||||
endif()
|
||||
endforeach()
|
||||
file(APPEND $ENV{GITHUB_OUTPUT} "mergefiles=${MERGELIST}\n")
|
||||
file(APPEND $ENV{GITHUB_OUTPUT} "covfiles=${FILELIST}\n")
|
||||
|
||||
- name: Merge coverage files
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y lcov
|
||||
cd ./coverage/reports
|
||||
lcov ${{ steps.get-coverage-files.outputs.mergefiles }} -o merged.info --rc lcov_branch_coverage=1
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
if: always()
|
||||
uses: codecov/codecov-action@v2
|
||||
with:
|
||||
directory: ./coverage/reports
|
||||
env_vars: OS,PYTHON
|
||||
fail_ci_if_error: false
|
||||
verbose: true
|
||||
files: merged.info
|
||||
7
.github/workflows/coding_guidelines.yml
vendored
7
.github/workflows/coding_guidelines.yml
vendored
@@ -4,17 +4,17 @@ on: pull_request
|
||||
|
||||
jobs:
|
||||
compliance_job:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
name: Run coding guidelines checks on patch series (PR)
|
||||
steps:
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: cache-pip
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-doc-pip
|
||||
@@ -27,7 +27,6 @@ jobs:
|
||||
|
||||
- name: Install Packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install ocaml-base-nox
|
||||
wget https://launchpad.net/~npalix/+archive/ubuntu/coccinelle/+files/coccinelle_1.0.8~20.04npalix1_amd64.deb
|
||||
sudo dpkg -i coccinelle_1.0.8~20.04npalix1_amd64.deb
|
||||
|
||||
52
.github/workflows/compliance.yml
vendored
52
.github/workflows/compliance.yml
vendored
@@ -1,10 +1,26 @@
|
||||
name: Compliance Checks
|
||||
name: Compliance
|
||||
|
||||
on: pull_request
|
||||
|
||||
jobs:
|
||||
check_compliance:
|
||||
runs-on: ubuntu-20.04
|
||||
maintainer_check:
|
||||
runs-on: ubuntu-latest
|
||||
name: Check MAINTAINERS file
|
||||
steps:
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
- name: Run Maintainers Script
|
||||
id: maintainer
|
||||
env:
|
||||
BASE_REF: ${{ github.base_ref }}
|
||||
run: |
|
||||
python3 ./scripts/get_maintainer.py path CMakeLists.txt
|
||||
|
||||
compliance_job:
|
||||
runs-on: ubuntu-latest
|
||||
name: Run compliance checks on patch series (PR)
|
||||
steps:
|
||||
- name: Update PATH for west
|
||||
@@ -12,13 +28,13 @@ jobs:
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: cache-pip
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-doc-pip
|
||||
@@ -27,7 +43,7 @@ jobs:
|
||||
run: |
|
||||
pip3 install setuptools
|
||||
pip3 install wheel
|
||||
pip3 install python-magic lxml junitparser gitlint pylint pykwalify yamllint
|
||||
pip3 install python-magic junitparser==1.6.3 gitlint pylint pykwalify
|
||||
pip3 install west
|
||||
|
||||
- name: west setup
|
||||
@@ -37,14 +53,11 @@ jobs:
|
||||
git config --global user.email "you@example.com"
|
||||
git config --global user.name "Your Name"
|
||||
git remote -v
|
||||
# Ensure there's no merge commits in the PR
|
||||
[[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \
|
||||
(echo "::error ::Merge commits not allowed, rebase instead";false)
|
||||
git rebase origin/${BASE_REF}
|
||||
# debug
|
||||
git log --pretty=oneline | head -n 10
|
||||
west init -l . || true
|
||||
west update 2>&1 1> west.update.log || west update 2>&1 1> west.update2.log
|
||||
west update
|
||||
|
||||
- name: Run Compliance Tests
|
||||
continue-on-error: true
|
||||
@@ -56,12 +69,11 @@ jobs:
|
||||
# debug
|
||||
ls -la
|
||||
git log --pretty=oneline | head -n 10
|
||||
./scripts/ci/check_compliance.py --annotate -e KconfigBasic \
|
||||
-c origin/${BASE_REF}..
|
||||
./scripts/ci/check_compliance.py -m Codeowners -m Devicetree -m Gitlint -m Identity -m Nits -m pylint -m checkpatch -m Kconfig -c origin/${BASE_REF}..
|
||||
|
||||
- name: upload-results
|
||||
uses: actions/upload-artifact@v3
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact@master
|
||||
continue-on-error: True
|
||||
with:
|
||||
name: compliance.xml
|
||||
path: compliance.xml
|
||||
@@ -72,19 +84,17 @@ jobs:
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
files=($(./scripts/ci/check_compliance.py -l))
|
||||
for file in "${files[@]}"; do
|
||||
f="${file}.txt"
|
||||
if [[ -s $f ]]; then
|
||||
errors=$(cat $f)
|
||||
for file in Nits.txt checkpatch.txt Identity.txt Gitlint.txt pylint.txt Devicetree.txt Kconfig.txt Codeowners.txt; do
|
||||
if [[ -s $file ]]; then
|
||||
errors=$(cat $file)
|
||||
errors="${errors//'%'/'%25'}"
|
||||
errors="${errors//$'\n'/'%0A'}"
|
||||
errors="${errors//$'\r'/'%0D'}"
|
||||
echo "::error file=${f}::$errors"
|
||||
echo "::error file=${file}::$errors"
|
||||
exit=1
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "${exit}" == "1" ]; then
|
||||
if [ ${exit} == 1 ]; then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
14
.github/workflows/conflict.yml
vendored
Normal file
14
.github/workflows/conflict.yml
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
name: Conflict Finder
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- '**'
|
||||
jobs:
|
||||
conflict:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: mschilde/auto-label-merge-conflicts@master
|
||||
with:
|
||||
CONFLICT_LABEL_NAME: "has conflicts"
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
8
.github/workflows/daily_test_version.yml
vendored
8
.github/workflows/daily_test_version.yml
vendored
@@ -5,14 +5,14 @@ name: Publish commit for daily testing
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '50 22 * * *'
|
||||
- cron: '50 22 * * *'
|
||||
push:
|
||||
branches:
|
||||
- refs/tags/*
|
||||
- refs/tags/*
|
||||
|
||||
jobs:
|
||||
get_version:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'zephyrproject-rtos/zephyr'
|
||||
|
||||
steps:
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
pip3 install gitpython
|
||||
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
|
||||
26
.github/workflows/devicetree_checks.yml
vendored
26
.github/workflows/devicetree_checks.yml
vendored
@@ -6,16 +6,10 @@ name: Devicetree script tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- v*-branch
|
||||
paths:
|
||||
- 'scripts/dts/**'
|
||||
- '.github/workflows/devicetree_checks.yml'
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- v*-branch
|
||||
paths:
|
||||
- 'scripts/dts/**'
|
||||
- '.github/workflows/devicetree_checks.yml'
|
||||
@@ -26,23 +20,21 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.8, 3.9, '3.10']
|
||||
os: [ubuntu-20.04, macos-11, windows-2022]
|
||||
python-version: [3.6, 3.7, 3.8]
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
exclude:
|
||||
- os: macos-11
|
||||
python-version: 3.6
|
||||
- os: windows-2022
|
||||
python-version: 3.6
|
||||
- os: macos-latest
|
||||
python-version: 3.6
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: cache-pip-linux
|
||||
if: startsWith(runner.os, 'Linux')
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
|
||||
@@ -50,7 +42,7 @@ jobs:
|
||||
${{ runner.os }}-pip-${{ matrix.python-version }}
|
||||
- name: cache-pip-mac
|
||||
if: startsWith(runner.os, 'macOS')
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/Library/Caches/pip
|
||||
# Trailing '-' was just to get a different cache name
|
||||
@@ -59,7 +51,7 @@ jobs:
|
||||
${{ runner.os }}-pip-${{ matrix.python-version }}-
|
||||
- name: cache-pip-win
|
||||
if: startsWith(runner.os, 'Windows')
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~\AppData\Local\pip\Cache
|
||||
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
|
||||
|
||||
17
.github/workflows/do_not_merge.yml
vendored
17
.github/workflows/do_not_merge.yml
vendored
@@ -1,17 +0,0 @@
|
||||
name: Do Not Merge
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [synchronize, opened, reopened, labeled, unlabeled]
|
||||
|
||||
jobs:
|
||||
do-not-merge:
|
||||
if: ${{ contains(github.event.*.labels.*.name, 'DNM') }}
|
||||
name: Prevent Merging
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Check for label
|
||||
run: |
|
||||
echo "Pull request is labeled as 'DNM'"
|
||||
echo "This workflow fails so that the pull request cannot be merged"
|
||||
exit 1
|
||||
63
.github/workflows/doc-build.yml
vendored
63
.github/workflows/doc-build.yml
vendored
@@ -5,10 +5,10 @@ name: Documentation Build
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 */3 * * *'
|
||||
- cron: '0 */3 * * *'
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
- v*
|
||||
pull_request:
|
||||
paths:
|
||||
- 'doc/**'
|
||||
@@ -26,35 +26,26 @@ on:
|
||||
|
||||
env:
|
||||
# NOTE: west docstrings will be extracted from the version listed here
|
||||
WEST_VERSION: 0.14.0
|
||||
WEST_VERSION: 0.11.1
|
||||
# The latest CMake available directly with apt is 3.18, but we need >=3.20
|
||||
# so we fetch that through pip.
|
||||
CMAKE_VERSION: 3.20.5
|
||||
DOXYGEN_VERSION: 1.9.6
|
||||
|
||||
jobs:
|
||||
doc-build-html:
|
||||
name: "Documentation Build (HTML)"
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 45
|
||||
concurrency:
|
||||
group: doc-build-html-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: install-pkgs
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ninja-build graphviz
|
||||
wget --no-verbose "https://github.com/doxygen/doxygen/releases/download/Release_${DOXYGEN_VERSION//./_}/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz"
|
||||
tar xf doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz
|
||||
echo "${PWD}/doxygen-${DOXYGEN_VERSION}/bin" >> $GITHUB_PATH
|
||||
sudo apt-get install -y ninja-build doxygen graphviz
|
||||
|
||||
- name: cache-pip
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: pip-${{ hashFiles('scripts/requirements-doc.txt') }}
|
||||
@@ -78,54 +69,26 @@ jobs:
|
||||
DOC_TAG="development"
|
||||
fi
|
||||
|
||||
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||
DOC_TARGET="html-fast"
|
||||
else
|
||||
DOC_TARGET="html"
|
||||
fi
|
||||
|
||||
DOC_TAG=${DOC_TAG} SPHINXOPTS="-q -W -t publish" make -C doc ${DOC_TARGET}
|
||||
DOC_TAG=${DOC_TAG} SPHINXOPTS="-q -W -j auto" make -C doc html
|
||||
|
||||
- name: compress-docs
|
||||
run: |
|
||||
tar cfJ html-output.tar.xz --directory=doc/_build html
|
||||
|
||||
- name: upload-build
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: html-output
|
||||
path: html-output.tar.xz
|
||||
|
||||
- name: process-pr
|
||||
if: github.event_name == 'pull_request'
|
||||
run: |
|
||||
REPO_NAME="${{ github.event.repository.name }}"
|
||||
PR_NUM="${{ github.event.pull_request.number }}"
|
||||
DOC_URL="https://builds.zephyrproject.io/${REPO_NAME}/pr/${PR_NUM}/docs/"
|
||||
|
||||
echo "${PR_NUM}" > pr_num
|
||||
echo "Documentation will be available shortly at: ${DOC_URL}" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
- name: upload-pr-number
|
||||
uses: actions/upload-artifact@v3
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
name: pr_num
|
||||
path: pr_num
|
||||
|
||||
doc-build-pdf:
|
||||
name: "Documentation Build (PDF)"
|
||||
if: github.event_name != 'pull_request'
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
container: texlive/texlive:latest
|
||||
timeout-minutes: 60
|
||||
concurrency:
|
||||
group: doc-build-pdf-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: install-pkgs
|
||||
run: |
|
||||
@@ -133,7 +96,7 @@ jobs:
|
||||
apt-get install -y python3-pip ninja-build doxygen graphviz librsvg2-bin
|
||||
|
||||
- name: cache-pip
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: pip-${{ hashFiles('scripts/requirements-doc.txt') }}
|
||||
@@ -160,7 +123,7 @@ jobs:
|
||||
DOC_TAG=${DOC_TAG} SPHINXOPTS="-q -j auto" LATEXMKOPTS="-quiet -halt-on-error" make -C doc pdf
|
||||
|
||||
- name: upload-build
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: pdf-output
|
||||
path: doc/_build/latex/zephyr.pdf
|
||||
|
||||
63
.github/workflows/doc-publish-pr.yml
vendored
63
.github/workflows/doc-publish-pr.yml
vendored
@@ -1,63 +0,0 @@
|
||||
# Copyright (c) 2020 Linaro Limited.
|
||||
# Copyright (c) 2021 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
name: Documentation Publish (Pull Request)
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Documentation Build"]
|
||||
types:
|
||||
- completed
|
||||
|
||||
jobs:
|
||||
doc-publish:
|
||||
name: Publish Documentation
|
||||
runs-on: ubuntu-22.04
|
||||
if: |
|
||||
github.event.workflow_run.event == 'pull_request' &&
|
||||
github.event.workflow_run.conclusion == 'success' &&
|
||||
github.repository == 'zephyrproject-rtos/zephyr'
|
||||
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
uses: dawidd6/action-download-artifact@v2
|
||||
with:
|
||||
workflow: doc-build.yml
|
||||
run_id: ${{ github.event.workflow_run.id }}
|
||||
|
||||
- name: Load PR number
|
||||
run: |
|
||||
echo "PR_NUM=$(<pr_num/pr_num)" >> $GITHUB_ENV
|
||||
|
||||
- name: Check PR number
|
||||
id: check-pr
|
||||
uses: carpentries/actions/check-valid-pr@v0.8
|
||||
with:
|
||||
pr: ${{ env.PR_NUM }}
|
||||
sha: ${{ github.event.workflow_run.head_sha }}
|
||||
|
||||
- name: Validate PR number
|
||||
if: steps.check-pr.outputs.VALID != 'true'
|
||||
run: |
|
||||
echo "ABORT: PR number validation failed!"
|
||||
exit 1
|
||||
|
||||
- name: Uncompress HTML docs
|
||||
run: |
|
||||
tar xf html-output/html-output.tar.xz -C html-output
|
||||
|
||||
- name: Configure AWS Credentials
|
||||
uses: aws-actions/configure-aws-credentials@v1
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_BUILDS_ZEPHYR_PR_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_BUILDS_ZEPHYR_PR_SECRET_ACCESS_KEY }}
|
||||
aws-region: us-east-1
|
||||
|
||||
- name: Upload to AWS S3
|
||||
env:
|
||||
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
|
||||
run: |
|
||||
aws s3 sync --quiet html-output/html \
|
||||
s3://builds.zephyrproject.org/${{ github.event.repository.name }}/pr/${PR_NUM}/docs \
|
||||
--delete
|
||||
18
.github/workflows/doc-publish.yml
vendored
18
.github/workflows/doc-publish.yml
vendored
@@ -2,32 +2,30 @@
|
||||
# Copyright (c) 2021 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
name: Documentation Publish
|
||||
name: Publish Documentation
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Documentation Build"]
|
||||
branches:
|
||||
- main
|
||||
- v*
|
||||
- main
|
||||
- v*
|
||||
tags:
|
||||
- v*
|
||||
types:
|
||||
- completed
|
||||
- completed
|
||||
|
||||
jobs:
|
||||
doc-publish:
|
||||
name: Publish Documentation
|
||||
runs-on: ubuntu-22.04
|
||||
if: |
|
||||
github.event.workflow_run.event != 'pull_request' &&
|
||||
github.event.workflow_run.conclusion == 'success' &&
|
||||
github.repository == 'zephyrproject-rtos/zephyr'
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
uses: dawidd6/action-download-artifact@v2
|
||||
with:
|
||||
workflow: doc-build.yml
|
||||
run_id: ${{ github.event.workflow_run.id }}
|
||||
|
||||
- name: Uncompress HTML docs
|
||||
run: |
|
||||
|
||||
18
.github/workflows/errno.yml
vendored
18
.github/workflows/errno.yml
vendored
@@ -2,29 +2,17 @@ name: Error numbers
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/errno.yml'
|
||||
- 'lib/libc/minimal/include/errno.h'
|
||||
- 'scripts/ci/errno.py'
|
||||
|
||||
jobs:
|
||||
check-errno:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/zephyrproject-rtos/ci:v0.24.11
|
||||
env:
|
||||
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.2
|
||||
image: zephyrprojectrtos/ci:v0.18.4
|
||||
|
||||
steps:
|
||||
- name: Apply container owner mismatch workaround
|
||||
run: |
|
||||
# FIXME: The owner UID of the GITHUB_WORKSPACE directory may not
|
||||
# match the container user UID because of the way GitHub
|
||||
# Actions runner is implemented. Remove this workaround when
|
||||
# GitHub comes up with a fundamental fix for this problem.
|
||||
git config --global --add safe.directory ${GITHUB_WORKSPACE}
|
||||
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Run errno.py
|
||||
run: |
|
||||
|
||||
35
.github/workflows/footprint-tracking.yml
vendored
35
.github/workflows/footprint-tracking.yml
vendored
@@ -13,31 +13,29 @@ on:
|
||||
# same commit
|
||||
- 'v*'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
footprint-tracking:
|
||||
runs-on: ubuntu-20.04
|
||||
footprint-tracking-cancel:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'zephyrproject-rtos/zephyr'
|
||||
steps:
|
||||
- name: Cancel Previous Runs
|
||||
uses: styfle/cancel-workflow-action@0.6.0
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
footprint-tracking:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'zephyrproject-rtos/zephyr'
|
||||
needs: footprint-tracking-cancel
|
||||
container:
|
||||
image: ghcr.io/zephyrproject-rtos/ci:v0.24.11
|
||||
image: zephyrprojectrtos/ci:v0.18.4
|
||||
options: '--entrypoint /bin/bash'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
env:
|
||||
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.2
|
||||
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.13.1
|
||||
CLANG_ROOT_DIR: /usr/lib/llvm-12
|
||||
ZEPHYR_TOOLCHAIN_VARIANT: zephyr
|
||||
steps:
|
||||
- name: Apply container owner mismatch workaround
|
||||
run: |
|
||||
# FIXME: The owner UID of the GITHUB_WORKSPACE directory may not
|
||||
# match the container user UID because of the way GitHub
|
||||
# Actions runner is implemented. Remove this workaround when
|
||||
# GitHub comes up with a fundamental fix for this problem.
|
||||
git config --global --add safe.directory ${GITHUB_WORKSPACE}
|
||||
|
||||
- name: Update PATH for west
|
||||
run: |
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
@@ -46,7 +44,7 @@ jobs:
|
||||
sudo pip3 install -U setuptools wheel pip gitpython
|
||||
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
@@ -54,8 +52,7 @@ jobs:
|
||||
- name: west setup
|
||||
run: |
|
||||
west init -l . || true
|
||||
west config --global update.narrow true
|
||||
west update 2>&1 1> west.update.log || west update 2>&1 1> west.update2.log
|
||||
west update
|
||||
|
||||
- name: Configure AWS Credentials
|
||||
uses: aws-actions/configure-aws-credentials@v1
|
||||
|
||||
40
.github/workflows/footprint.yml
vendored
40
.github/workflows/footprint.yml
vendored
@@ -2,37 +2,39 @@ name: Footprint Delta
|
||||
|
||||
on: pull_request
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
footprint-delta:
|
||||
runs-on: ubuntu-20.04
|
||||
footprint-cancel:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'zephyrproject-rtos/zephyr'
|
||||
steps:
|
||||
- name: Cancel Previous Runs
|
||||
uses: styfle/cancel-workflow-action@0.6.0
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
footprint-delta:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'zephyrproject-rtos/zephyr'
|
||||
needs: footprint-cancel
|
||||
container:
|
||||
image: ghcr.io/zephyrproject-rtos/ci:v0.24.11
|
||||
image: zephyrprojectrtos/ci:v0.18.4
|
||||
options: '--entrypoint /bin/bash'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
env:
|
||||
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.2
|
||||
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.13.1
|
||||
CLANG_ROOT_DIR: /usr/lib/llvm-12
|
||||
ZEPHYR_TOOLCHAIN_VARIANT: zephyr
|
||||
steps:
|
||||
- name: Apply container owner mismatch workaround
|
||||
run: |
|
||||
# FIXME: The owner UID of the GITHUB_WORKSPACE directory may not
|
||||
# match the container user UID because of the way GitHub
|
||||
# Actions runner is implemented. Remove this workaround when
|
||||
# GitHub comes up with a fundamental fix for this problem.
|
||||
git config --global --add safe.directory ${GITHUB_WORKSPACE}
|
||||
|
||||
- name: Cancel Previous Runs
|
||||
uses: styfle/cancel-workflow-action@0.6.0
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
- name: Update PATH for west
|
||||
run: |
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
@@ -40,8 +42,7 @@ jobs:
|
||||
- name: west setup
|
||||
run: |
|
||||
west init -l . || true
|
||||
west config --global update.narrow true
|
||||
west update 2>&1 1> west.update.log || west update 2>&1 1> west.update.log
|
||||
west update
|
||||
|
||||
- name: Detect Changes in Footprint
|
||||
env:
|
||||
@@ -53,7 +54,6 @@ jobs:
|
||||
git remote -v
|
||||
git rebase origin/${BASE_REF}
|
||||
git checkout -b this_pr
|
||||
west update
|
||||
west build -b frdm_k64f tests/benchmarks/footprints -t ram_report
|
||||
cp build/ram.json ram2.json
|
||||
west build -b frdm_k64f tests/benchmarks/footprints -t rom_report
|
||||
|
||||
11
.github/workflows/issue_count.yml
vendored
11
.github/workflows/issue_count.yml
vendored
@@ -2,7 +2,7 @@ name: Issue Tracker
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '*/10 * * * *'
|
||||
- cron: '*/10 * * * *'
|
||||
|
||||
env:
|
||||
OUTPUT_FILE_NAME: IssuesReport.md
|
||||
@@ -14,17 +14,16 @@ env:
|
||||
jobs:
|
||||
track-issues:
|
||||
name: "Collect Issue Stats"
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'zephyrproject-rtos/zephyr'
|
||||
|
||||
steps:
|
||||
- name: Download configuration file
|
||||
run: |
|
||||
wget -q https://raw.githubusercontent.com/$GITHUB_REPOSITORY/main/.github/workflows/issues-report-config.json
|
||||
wget -q https://raw.githubusercontent.com/$GITHUB_REPOSITORY/master/.github/workflows/issues-report-config.json
|
||||
|
||||
- name: install-packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install discount
|
||||
|
||||
- uses: brcrista/summarize-issues@v3
|
||||
@@ -35,8 +34,8 @@ jobs:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: upload-stats
|
||||
uses: actions/upload-artifact@v3
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact@master
|
||||
continue-on-error: True
|
||||
with:
|
||||
name: ${{ env.OUTPUT_FILE_NAME }}
|
||||
path: ${{ env.OUTPUT_FILE_NAME }}
|
||||
|
||||
12
.github/workflows/labeler.yml
vendored
Normal file
12
.github/workflows/labeler.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
name: 'Pull Request Labeler'
|
||||
on:
|
||||
- pull_request_target
|
||||
|
||||
jobs:
|
||||
labeler:
|
||||
name: Pull Request Labeler
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/labeler@v2.1.1
|
||||
with:
|
||||
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||
6
.github/workflows/license_check.yml
vendored
6
.github/workflows/license_check.yml
vendored
@@ -4,18 +4,18 @@ on: [pull_request]
|
||||
|
||||
jobs:
|
||||
scancode_job:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
name: Scan code for licenses
|
||||
steps:
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v1
|
||||
- name: Scan the code
|
||||
id: scancode
|
||||
uses: zephyrproject-rtos/action_scancode@v4
|
||||
uses: zephyrproject-rtos/action_scancode@v3
|
||||
with:
|
||||
directory-to-scan: 'scan/'
|
||||
- name: Artifact Upload
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: scancode
|
||||
path: ./artifacts
|
||||
|
||||
13
.github/workflows/manifest.yml
vendored
13
.github/workflows/manifest.yml
vendored
@@ -1,27 +1,28 @@
|
||||
name: Manifest
|
||||
on:
|
||||
pull_request_target:
|
||||
paths:
|
||||
- 'west.yml'
|
||||
|
||||
jobs:
|
||||
contribs:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
name: Manifest
|
||||
steps:
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: zephyrproject/zephyr
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Manifest
|
||||
uses: zephyrproject-rtos/action-manifest@a6d0c6e52bbbb7d6df23ceb42842edcb4582b8dc
|
||||
uses: zephyrproject-rtos/action-manifest@2f1ad2908599d4fe747f886f9d733dd7eebae4ef
|
||||
with:
|
||||
github-token: ${{ secrets.ZB_GITHUB_TOKEN }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
manifest-path: 'west.yml'
|
||||
checkout-path: 'zephyrproject/zephyr'
|
||||
label-prefix: 'manifest-'
|
||||
verbosity-level: '1'
|
||||
labels: 'manifest'
|
||||
labels: 'manifest, west'
|
||||
dnm-labels: 'DNM'
|
||||
|
||||
23
.github/workflows/release.yml
vendored
23
.github/workflows/release.yml
vendored
@@ -4,21 +4,18 @@ on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
- '!v*rc*'
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Get the version
|
||||
id: get_version
|
||||
run: |
|
||||
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
||||
echo "TRIMMED_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
|
||||
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
|
||||
|
||||
- name: REUSE Compliance Check
|
||||
uses: fsfe/reuse-action@v1
|
||||
@@ -26,15 +23,19 @@ jobs:
|
||||
args: spdx -o zephyr-${{ steps.get_version.outputs.VERSION }}.spdx
|
||||
|
||||
- name: upload-results
|
||||
uses: actions/upload-artifact@v3
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact@master
|
||||
continue-on-error: True
|
||||
with:
|
||||
name: zephyr-${{ steps.get_version.outputs.VERSION }}.spdx
|
||||
path: zephyr-${{ steps.get_version.outputs.VERSION }}.spdx
|
||||
|
||||
- name: Create empty release notes body
|
||||
- name: Get Diff since last tag
|
||||
run: |
|
||||
echo "TODO: add release overview and notes link" > release-notes.txt
|
||||
oldtag=$(git describe --abbrev=0 ${{ github.ref }}^)
|
||||
echo "Changes since ${oldtag}:" > release-notes.txt
|
||||
echo "" >> release-notes.txt
|
||||
echo "" >> release-notes.txt
|
||||
git shortlog ${oldtag}..${{ github.ref }} >> release-notes.txt
|
||||
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
@@ -43,7 +44,7 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: Zephyr ${{ steps.get_version.outputs.TRIMMED_VERSION }}
|
||||
release_name: Zephyr ${{ github.ref }}
|
||||
body_path: release-notes.txt
|
||||
draft: true
|
||||
prerelease: true
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
name: Stale Workflow Queue Cleanup
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
branches: [main]
|
||||
schedule:
|
||||
# everyday at 15:00
|
||||
- cron: '0 15 * * *'
|
||||
|
||||
concurrency:
|
||||
group: stale-workflow-queue-cleanup
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
cleanup:
|
||||
name: Cleanup
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- name: Delete stale queued workflow runs
|
||||
uses: MajorScruffy/delete-old-workflow-runs@v0.3.0
|
||||
with:
|
||||
repository: ${{ github.repository }}
|
||||
# Remove any workflow runs in "queued" state for more than 1 day
|
||||
older-than-seconds: 86400
|
||||
status: queued
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
14
.github/workflows/stale_issue.yml
vendored
14
.github/workflows/stale_issue.yml
vendored
@@ -6,24 +6,18 @@ on:
|
||||
jobs:
|
||||
stale:
|
||||
name: Find Stale issues and PRs
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'zephyrproject-rtos/zephyr'
|
||||
steps:
|
||||
- uses: actions/stale@v3
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-pr-message: 'This pull request has been marked as stale because it has been open (more
|
||||
than) 60 days with no activity. Remove the stale label or add a comment saying that you
|
||||
would like to have the label removed otherwise this pull request will automatically be
|
||||
closed in 14 days. Note, that you can always re-open a closed pull request at any time.'
|
||||
stale-issue-message: 'This issue has been marked as stale because it has been open (more
|
||||
than) 60 days with no activity. Remove the stale label or add a comment saying that you
|
||||
would like to have the label removed otherwise this issue will automatically be closed in
|
||||
14 days. Note, that you can always re-open a closed issue at any time.'
|
||||
stale-pr-message: 'This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.'
|
||||
stale-issue-message: 'This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.'
|
||||
days-before-stale: 60
|
||||
days-before-close: 14
|
||||
stale-issue-label: 'Stale'
|
||||
stale-pr-label: 'Stale'
|
||||
exempt-pr-labels: 'Blocked,In progress'
|
||||
exempt-issue-labels: 'In progress,Enhancement,Feature,Feature Request,RFC,Meta,Process'
|
||||
exempt-issue-labels: 'In progress,Enhancement,Feature,Feature Request,RFC,Meta'
|
||||
operations-per-run: 400
|
||||
|
||||
322
.github/workflows/twister.yaml
vendored
322
.github/workflows/twister.yaml
vendored
@@ -1,322 +0,0 @@
|
||||
name: Run tests with twister
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- v*-branch
|
||||
pull_request_target:
|
||||
branches:
|
||||
- main
|
||||
- v*-branch
|
||||
schedule:
|
||||
# Run at 00:00 on Wednesday and Saturday
|
||||
- cron: '0 0 * * 3,6'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
twister-build-prep:
|
||||
if: github.repository_owner == 'zephyrproject-rtos'
|
||||
runs-on: zephyr-runner-linux-x64-4xlarge
|
||||
container:
|
||||
image: ghcr.io/zephyrproject-rtos/ci:v0.24.11
|
||||
options: '--entrypoint /bin/bash'
|
||||
volumes:
|
||||
- /repo-cache/zephyrproject:/github/cache/zephyrproject
|
||||
outputs:
|
||||
subset: ${{ steps.output-services.outputs.subset }}
|
||||
size: ${{ steps.output-services.outputs.size }}
|
||||
fullrun: ${{ steps.output-services.outputs.fullrun }}
|
||||
env:
|
||||
MATRIX_SIZE: 10
|
||||
PUSH_MATRIX_SIZE: 15
|
||||
DAILY_MATRIX_SIZE: 80
|
||||
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.2
|
||||
TESTS_PER_BUILDER: 700
|
||||
COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
|
||||
BASE_REF: ${{ github.base_ref }}
|
||||
steps:
|
||||
- name: Apply container owner mismatch workaround
|
||||
run: |
|
||||
# FIXME: The owner UID of the GITHUB_WORKSPACE directory may not
|
||||
# match the container user UID because of the way GitHub
|
||||
# Actions runner is implemented. Remove this workaround when
|
||||
# GitHub comes up with a fundamental fix for this problem.
|
||||
git config --global --add safe.directory ${GITHUB_WORKSPACE}
|
||||
|
||||
- name: Clone cached Zephyr repository
|
||||
if: github.event_name == 'pull_request_target'
|
||||
continue-on-error: true
|
||||
run: |
|
||||
git clone --shared /github/cache/zephyrproject/zephyr .
|
||||
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
|
||||
|
||||
- name: Checkout
|
||||
if: github.event_name == 'pull_request_target'
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Environment Setup
|
||||
if: github.event_name == 'pull_request_target'
|
||||
run: |
|
||||
git config --global user.email "bot@zephyrproject.org"
|
||||
git config --global user.name "Zephyr Bot"
|
||||
rm -fr ".git/rebase-apply"
|
||||
git rebase origin/${BASE_REF}
|
||||
git log --pretty=oneline | head -n 10
|
||||
west init -l . || true
|
||||
west config manifest.group-filter -- +ci
|
||||
west config --global update.narrow true
|
||||
west update --path-cache /github/cache/zephyrproject 2>&1 1> west.update.log || west update --path-cache /github/cache/zephyrproject 2>&1 1> west.update.log || ( rm -rf ../modules ../bootloader ../tools && west update --path-cache /github/cache/zephyrproject)
|
||||
west forall -c 'git reset --hard HEAD'
|
||||
|
||||
- name: Generate Test Plan with Twister
|
||||
if: github.event_name == 'pull_request_target'
|
||||
id: test-plan
|
||||
run: |
|
||||
export ZEPHYR_BASE=${PWD}
|
||||
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
|
||||
python3 ./scripts/ci/test_plan.py -c origin/${BASE_REF}.. --pull-request -t $TESTS_PER_BUILDER
|
||||
if [ -s .testplan ]; then
|
||||
cat .testplan >> $GITHUB_ENV
|
||||
else
|
||||
echo "TWISTER_NODES=${MATRIX_SIZE}" >> $GITHUB_ENV
|
||||
fi
|
||||
rm -f testplan.json .testplan
|
||||
|
||||
- name: Determine matrix size
|
||||
id: output-services
|
||||
run: |
|
||||
if [ "${{github.event_name}}" = "pull_request_target" ]; then
|
||||
if [ -n "${TWISTER_NODES}" ]; then
|
||||
subset="[$(seq -s',' 1 ${TWISTER_NODES})]"
|
||||
else
|
||||
subset="[$(seq -s',' 1 ${MATRIX_SIZE})]"
|
||||
fi
|
||||
size=${TWISTER_NODES}
|
||||
elif [ "${{github.event_name}}" = "push" ]; then
|
||||
subset="[$(seq -s',' 1 ${PUSH_MATRIX_SIZE})]"
|
||||
size=${MATRIX_SIZE}
|
||||
elif [ "${{github.event_name}}" = "schedule" -a "${{github.repository}}" = "zephyrproject-rtos/zephyr" ]; then
|
||||
subset="[$(seq -s',' 1 ${DAILY_MATRIX_SIZE})]"
|
||||
size=${DAILY_MATRIX_SIZE}
|
||||
else
|
||||
size=0
|
||||
fi
|
||||
echo "subset=${subset}" >> $GITHUB_OUTPUT
|
||||
echo "size=${size}" >> $GITHUB_OUTPUT
|
||||
echo "fullrun=${TWISTER_FULL}" >> $GITHUB_OUTPUT
|
||||
|
||||
twister-build:
|
||||
runs-on: zephyr-runner-linux-x64-4xlarge
|
||||
needs: twister-build-prep
|
||||
if: needs.twister-build-prep.outputs.size != 0
|
||||
container:
|
||||
image: ghcr.io/zephyrproject-rtos/ci:v0.24.11
|
||||
options: '--entrypoint /bin/bash'
|
||||
volumes:
|
||||
- /repo-cache/zephyrproject:/github/cache/zephyrproject
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
subset: ${{fromJSON(needs.twister-build-prep.outputs.subset)}}
|
||||
env:
|
||||
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.2
|
||||
TWISTER_COMMON: ' --force-color --inline-logs -v -N -M --retry-failed 3 '
|
||||
DAILY_OPTIONS: ' -M --build-only --all --show-footprint'
|
||||
PR_OPTIONS: ' --clobber-output --integration'
|
||||
PUSH_OPTIONS: ' --clobber-output -M --show-footprint'
|
||||
COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
|
||||
BASE_REF: ${{ github.base_ref }}
|
||||
steps:
|
||||
- name: Apply container owner mismatch workaround
|
||||
run: |
|
||||
# FIXME: The owner UID of the GITHUB_WORKSPACE directory may not
|
||||
# match the container user UID because of the way GitHub
|
||||
# Actions runner is implemented. Remove this workaround when
|
||||
# GitHub comes up with a fundamental fix for this problem.
|
||||
git config --global --add safe.directory ${GITHUB_WORKSPACE}
|
||||
|
||||
- name: Clone cached Zephyr repository
|
||||
continue-on-error: true
|
||||
run: |
|
||||
git clone --shared /github/cache/zephyrproject/zephyr .
|
||||
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Environment Setup
|
||||
run: |
|
||||
if [ "${{github.event_name}}" = "pull_request_target" ]; then
|
||||
git config --global user.email "bot@zephyrproject.org"
|
||||
git config --global user.name "Zephyr Builder"
|
||||
rm -fr ".git/rebase-apply"
|
||||
git rebase origin/${BASE_REF}
|
||||
git log --pretty=oneline | head -n 10
|
||||
fi
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
|
||||
west init -l . || true
|
||||
west config --global update.narrow true
|
||||
west update --path-cache /github/cache/zephyrproject 2>&1 1> west.update.log || west update --path-cache /github/cache/zephyrproject 2>&1 1> west.update.log || ( rm -rf ../modules ../bootloader ../tools && west update --path-cache /github/cache/zephyrproject)
|
||||
west forall -c 'git reset --hard HEAD'
|
||||
|
||||
- name: Check Environment
|
||||
run: |
|
||||
cmake --version
|
||||
gcc --version
|
||||
ls -la
|
||||
echo "github.ref: ${{ github.ref }}"
|
||||
echo "github.base_ref: ${{ github.base_ref }}"
|
||||
echo "github.ref_name: ${{ github.ref_name }}"
|
||||
|
||||
- name: Prepare ccache timestamp/data
|
||||
id: ccache_cache_timestamp
|
||||
shell: cmake -P {0}
|
||||
run: |
|
||||
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
|
||||
string(REPLACE "/" "_" repo ${{github.repository}})
|
||||
string(REPLACE "-" "_" repo2 ${repo})
|
||||
file(APPEND $ENV{GITHUB_OUTPUT} "repo=${repo2}\n")
|
||||
|
||||
- name: use cache
|
||||
id: cache-ccache
|
||||
uses: zephyrproject-rtos/action-s3-cache@v1
|
||||
continue-on-error: true
|
||||
with:
|
||||
key: ${{ steps.ccache_cache_timestamp.outputs.repo }}-${{ github.ref_name }}-${{github.event_name}}-${{ matrix.subset }}-ccache
|
||||
path: /github/home/.ccache
|
||||
aws-s3-bucket: ccache.zephyrproject.org
|
||||
aws-access-key-id: ${{ secrets.CCACHE_S3_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.CCACHE_S3_SECRET_ACCESS_KEY }}
|
||||
aws-region: us-east-2
|
||||
|
||||
- name: ccache stats initial
|
||||
run: |
|
||||
test -d github/home/.ccache && rm -rf /github/home/.ccache && mv github/home/.ccache /github/home/.ccache
|
||||
ccache -M 10G -s
|
||||
|
||||
- if: github.event_name == 'push'
|
||||
name: Run Tests with Twister (Push)
|
||||
run: |
|
||||
export ZEPHYR_BASE=${PWD}
|
||||
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
|
||||
./scripts/twister --subset ${{matrix.subset}}/${{ strategy.job-total }} ${TWISTER_COMMON} ${PUSH_OPTIONS}
|
||||
if [ "${{matrix.subset}}" = "1" ]; then
|
||||
./scripts/zephyr_module.py --twister-out module_tests.args
|
||||
if [ -s module_tests.args ]; then
|
||||
./scripts/twister +module_tests.args --outdir module_tests ${TWISTER_COMMON} ${PUSH_OPTIONS}
|
||||
fi
|
||||
fi
|
||||
|
||||
- if: github.event_name == 'pull_request_target'
|
||||
name: Run Tests with Twister (Pull Request)
|
||||
run: |
|
||||
rm -f testplan.json
|
||||
export ZEPHYR_BASE=${PWD}
|
||||
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
|
||||
python3 ./scripts/ci/test_plan.py -c origin/${BASE_REF}.. --pull-request
|
||||
./scripts/twister --subset ${{matrix.subset}}/${{ strategy.job-total }} --load-tests testplan.json ${TWISTER_COMMON} ${PR_OPTIONS}
|
||||
if [ "${{matrix.subset}}" = "1" -a ${{needs.twister-build-prep.outputs.fullrun}} = 'True' ]; then
|
||||
./scripts/zephyr_module.py --twister-out module_tests.args
|
||||
if [ -s module_tests.args ]; then
|
||||
./scripts/twister +module_tests.args --outdir module_tests ${TWISTER_COMMON} ${PR_OPTIONS}
|
||||
fi
|
||||
fi
|
||||
|
||||
- if: github.event_name == 'schedule'
|
||||
name: Run Tests with Twister (Daily)
|
||||
run: |
|
||||
export ZEPHYR_BASE=${PWD}
|
||||
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
|
||||
./scripts/twister --subset ${{matrix.subset}}/${{ strategy.job-total }} ${TWISTER_COMMON} ${DAILY_OPTIONS}
|
||||
if [ "${{matrix.subset}}" = "1" ]; then
|
||||
./scripts/zephyr_module.py --twister-out module_tests.args
|
||||
if [ -s module_tests.args ]; then
|
||||
./scripts/twister +module_tests.args --outdir module_tests ${TWISTER_COMMON} ${DAILY_OPTIONS}
|
||||
fi
|
||||
fi
|
||||
|
||||
- name: ccache stats post
|
||||
run: |
|
||||
ccache -s
|
||||
|
||||
- name: Upload Unit Test Results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Unit Test Results (Subset ${{ matrix.subset }})
|
||||
if-no-files-found: ignore
|
||||
path: |
|
||||
twister-out/twister.xml
|
||||
twister-out/twister.json
|
||||
module_tests/twister.xml
|
||||
testplan.json
|
||||
|
||||
twister-test-results:
|
||||
name: "Publish Unit Tests Results"
|
||||
env:
|
||||
ELASTICSEARCH_KEY: ${{ secrets.ELASTICSEARCH_KEY }}
|
||||
ELASTICSEARCH_SERVER: "https://elasticsearch.zephyrproject.io:443"
|
||||
needs: twister-build
|
||||
runs-on: ubuntu-20.04
|
||||
# the build-and-test job might be skipped, we don't need to run this job then
|
||||
if: success() || failure()
|
||||
|
||||
steps:
|
||||
# Needed for opensearch and upload script
|
||||
- if: github.event_name == 'push' || github.event_name == 'schedule'
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Download Artifacts
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
path: artifacts
|
||||
|
||||
- if: github.event_name == 'push' || github.event_name == 'schedule'
|
||||
name: Upload to opensearch
|
||||
run: |
|
||||
pip3 install elasticsearch
|
||||
if [ "${{github.event_name}}" = "push" ]; then
|
||||
python3 ./scripts/ci/upload_test_results_es.py --index zephyr-main-ci-push-1 artifacts/*/*/twister.json
|
||||
elif [ "${{github.event_name}}" = "schedule" ]; then
|
||||
python3 ./scripts/ci/upload_test_results_es.py --index zephyr-main-ci-weekly-1 artifacts/*/*/twister.json
|
||||
fi
|
||||
|
||||
- name: Merge Test Results
|
||||
run: |
|
||||
pip3 install junitparser junit2html
|
||||
junitparser merge artifacts/*/*/twister.xml junit.xml
|
||||
junit2html junit.xml junit.html
|
||||
|
||||
- name: Upload Unit Test Results in HTML
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: HTML Unit Test Results
|
||||
if-no-files-found: ignore
|
||||
path: |
|
||||
junit.html
|
||||
|
||||
- name: Publish Unit Test Results
|
||||
uses: EnricoMi/publish-unit-test-result-action@v1
|
||||
with:
|
||||
check_name: Unit Test Results
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
files: "**/twister.xml"
|
||||
comment_mode: off
|
||||
18
.github/workflows/twister_tests.yml
vendored
18
.github/workflows/twister_tests.yml
vendored
@@ -5,18 +5,12 @@ name: Twister TestSuite
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- v*-branch
|
||||
paths:
|
||||
- 'scripts/pylib/twister/**'
|
||||
- 'scripts/twister'
|
||||
- 'scripts/tests/twister/**'
|
||||
- '.github/workflows/twister_tests.yml'
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- v*-branch
|
||||
paths:
|
||||
- 'scripts/pylib/twister/**'
|
||||
- 'scripts/twister'
|
||||
@@ -29,18 +23,18 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.8, 3.9, '3.10']
|
||||
os: [ubuntu-20.04]
|
||||
python-version: [3.6, 3.7, 3.8]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: cache-pip-linux
|
||||
if: startsWith(runner.os, 'Linux')
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
|
||||
@@ -48,7 +42,7 @@ jobs:
|
||||
${{ runner.os }}-pip-${{ matrix.python-version }}
|
||||
- name: install-packages
|
||||
run: |
|
||||
pip3 install -r scripts/requirements-base.txt -r scripts/requirements-build-test.txt
|
||||
pip3 install pytest colorama pyyaml ply mock
|
||||
- name: Run pytest
|
||||
env:
|
||||
ZEPHYR_BASE: ./
|
||||
|
||||
28
.github/workflows/west_cmds.yml
vendored
28
.github/workflows/west_cmds.yml
vendored
@@ -5,17 +5,11 @@ name: Zephyr West Command Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- v*-branch
|
||||
paths:
|
||||
- 'scripts/west-commands.yml'
|
||||
- 'scripts/west_commands/**'
|
||||
- '.github/workflows/west_cmds.yml'
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- v*-branch
|
||||
paths:
|
||||
- 'scripts/west-commands.yml'
|
||||
- 'scripts/west_commands/**'
|
||||
@@ -27,23 +21,21 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.8, 3.9, '3.10']
|
||||
os: [ubuntu-20.04, macos-11, windows-2022]
|
||||
python-version: [3.6, 3.7, 3.8]
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
exclude:
|
||||
- os: macos-11
|
||||
python-version: 3.6
|
||||
- os: windows-2022
|
||||
python-version: 3.6
|
||||
- os: macos-latest
|
||||
python-version: 3.6
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: cache-pip-linux
|
||||
if: startsWith(runner.os, 'Linux')
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
|
||||
@@ -51,7 +43,7 @@ jobs:
|
||||
${{ runner.os }}-pip-${{ matrix.python-version }}
|
||||
- name: cache-pip-mac
|
||||
if: startsWith(runner.os, 'macOS')
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/Library/Caches/pip
|
||||
# Trailing '-' was just to get a different cache name
|
||||
@@ -60,7 +52,7 @@ jobs:
|
||||
${{ runner.os }}-pip-${{ matrix.python-version }}-
|
||||
- name: cache-pip-win
|
||||
if: startsWith(runner.os, 'Windows')
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~\AppData\Local\pip\Cache
|
||||
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
|
||||
@@ -69,7 +61,7 @@ jobs:
|
||||
- name: install pytest
|
||||
run: |
|
||||
pip3 install wheel
|
||||
pip3 install pytest west pyelftools canopen progress mypy intelhex psutil ply pyserial
|
||||
pip3 install pytest west pyelftools canopen progress mypy intelhex psutil
|
||||
- name: run pytest-win
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
|
||||
26
.gitignore
vendored
26
.gitignore
vendored
@@ -7,13 +7,9 @@
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
.\#*
|
||||
\#*\#
|
||||
build*/
|
||||
!doc/build/
|
||||
!scripts/build
|
||||
!doc/guides/build
|
||||
!tests/drivers/build_all
|
||||
!scripts/pylib/build_helpers
|
||||
cscope.*
|
||||
.dir
|
||||
|
||||
@@ -48,12 +44,6 @@ doc/doc.warnings
|
||||
hide-defaults-note
|
||||
venv
|
||||
.venv
|
||||
.DS_Store
|
||||
.clangd
|
||||
|
||||
# CI output
|
||||
compliance.xml
|
||||
_error.types
|
||||
|
||||
# Tag files
|
||||
GPATH
|
||||
@@ -63,17 +53,3 @@ TAGS
|
||||
tags
|
||||
|
||||
.idea
|
||||
|
||||
# from check_compliance.py
|
||||
BinaryFiles.txt
|
||||
Checkpatch.txt
|
||||
DevicetreeBindings.txt
|
||||
Gitlint.txt
|
||||
Identity.txt
|
||||
ImageSize.txt
|
||||
Kconfig.txt
|
||||
KconfigBasic.txt
|
||||
MaintainersFormat.txt
|
||||
Nits.txt
|
||||
Pylint.txt
|
||||
YAMLLint.txt
|
||||
|
||||
7
.gitlint
7
.gitlint
@@ -4,10 +4,7 @@ ignore=title-trailing-punctuation, T3, title-max-length, T1, body-hard-tab, B3,
|
||||
# verbosity should be a value between 1 and 3, the commandline -v flags take precedence over this
|
||||
verbosity = 3
|
||||
# By default gitlint will ignore merge commits. Set to 'false' to disable.
|
||||
ignore-merge-commits=false
|
||||
ignore-revert-commits=false
|
||||
ignore-fixup-commits=false
|
||||
ignore-squash-commits=false
|
||||
ignore-merge-commits=true
|
||||
# Enable debug mode (prints more output). Disabled by default
|
||||
debug = false
|
||||
|
||||
@@ -42,7 +39,7 @@ words=wip
|
||||
|
||||
[max-line-length-with-exceptions]
|
||||
# B1 = body-max-line-length
|
||||
line-length=75
|
||||
line-length=72
|
||||
|
||||
[body-min-length]
|
||||
min-length=3
|
||||
|
||||
80
.uncrustify.cfg
Normal file
80
.uncrustify.cfg
Normal file
@@ -0,0 +1,80 @@
|
||||
indent_with_tabs = 2 # 1=indent to level only, 2=indent with tabs
|
||||
input_tab_size = 8 # original tab size
|
||||
output_tab_size = 8 # new tab size
|
||||
indent_columns = output_tab_size
|
||||
indent_label = 1 # pos: absolute col, neg: relative column
|
||||
indent_switch_case = 0 # number
|
||||
|
||||
#
|
||||
# inter-symbol newlines
|
||||
#
|
||||
|
||||
nl_enum_brace = remove # "enum {" vs "enum \n {"
|
||||
nl_union_brace = remove # "union {" vs "union \n {"
|
||||
nl_struct_brace = remove # "struct {" vs "struct \n {"
|
||||
nl_do_brace = remove # "do {" vs "do \n {"
|
||||
nl_if_brace = remove # "if () {" vs "if () \n {"
|
||||
nl_for_brace = remove # "for () {" vs "for () \n {"
|
||||
nl_else_brace = remove # "else {" vs "else \n {"
|
||||
nl_while_brace = remove # "while () {" vs "while () \n {"
|
||||
nl_switch_brace = remove # "switch () {" vs "switch () \n {"
|
||||
nl_brace_while = remove # "} while" vs "} \n while" - cuddle while
|
||||
nl_brace_else = remove # "} \n else" vs "} else"
|
||||
nl_func_var_def_blk = 1
|
||||
nl_fcall_brace = remove # "list_for_each() {" vs "list_for_each()\n{"
|
||||
nl_fdef_brace = add # "int foo() {" vs "int foo()\n{"
|
||||
|
||||
#
|
||||
# Source code modifications
|
||||
#
|
||||
|
||||
mod_paren_on_return = ignore # "return 1;" vs "return (1);"
|
||||
mod_full_brace_if = add # "if() { } else { }" vs "if() else"
|
||||
|
||||
#
|
||||
# inter-character spacing options
|
||||
#
|
||||
|
||||
sp_sizeof_paren = remove # "sizeof (int)" vs "sizeof(int)"
|
||||
sp_before_sparen = force # "if (" vs "if("
|
||||
sp_after_sparen = force # "if () {" vs "if (){"
|
||||
sp_inside_braces = add # "{ 1 }" vs "{1}"
|
||||
sp_inside_braces_struct = add # "{ 1 }" vs "{1}"
|
||||
sp_inside_braces_enum = add # "{ 1 }" vs "{1}"
|
||||
sp_assign = add
|
||||
sp_arith = add
|
||||
sp_bool = add
|
||||
sp_compare = add
|
||||
sp_assign = add
|
||||
sp_after_comma = add
|
||||
sp_func_def_paren = remove # "int foo (){" vs "int foo(){"
|
||||
sp_func_call_paren = remove # "foo (" vs "foo("
|
||||
sp_func_proto_paren = remove # "int foo ();" vs "int foo();"
|
||||
sp_inside_fparen = remove # "func( arg )" vs "func(arg)"
|
||||
sp_else_brace = add # ignore/add/remove/force
|
||||
sp_before_ptr_star = add # ignore/add/remove/force
|
||||
sp_after_ptr_star = remove # ignore/add/remove/force
|
||||
sp_between_ptr_star = remove # ignore/add/remove/force
|
||||
sp_inside_paren = remove # remove spaces inside parens
|
||||
sp_paren_paren = remove # remove spaces between nested parens
|
||||
sp_inside_sparen = remove # remove spaces inside parens for if, while and the like
|
||||
sp_brace_else = add # ignore/add/remove/force
|
||||
sp_before_nl_cont = ignore
|
||||
sp_cmt_cpp_start = add
|
||||
sp_brace_typedef = add # }typedefd_name -> } typedefd_name
|
||||
|
||||
cmt_sp_after_star_cont = 1
|
||||
#
|
||||
# Aligning stuff
|
||||
#
|
||||
|
||||
align_with_tabs = FALSE # use tabs to align
|
||||
align_on_tabstop = TRUE # align on tabstops
|
||||
align_enum_equ_span = 4 # '=' in enum definition
|
||||
align_struct_init_span = 0 # align stuff in a structure init '= { }'
|
||||
align_right_cmt_span = 3
|
||||
align_nl_cont = TRUE
|
||||
|
||||
|
||||
|
||||
sp_pp_concat = ignore # ignore/add/remove/force
|
||||
16
.yamllint
16
.yamllint
@@ -1,16 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
extends: default
|
||||
|
||||
rules:
|
||||
line-length:
|
||||
max: 100
|
||||
comments:
|
||||
min-spaces-from-content: 1
|
||||
indentation:
|
||||
spaces: 2
|
||||
indent-sequences: consistent
|
||||
document-start:
|
||||
present: false
|
||||
truthy:
|
||||
check-keys: false
|
||||
1051
CMakeLists.txt
1051
CMakeLists.txt
File diff suppressed because it is too large
Load Diff
664
CODEOWNERS
664
CODEOWNERS
File diff suppressed because it is too large
Load Diff
266
Kconfig.zephyr
266
Kconfig.zephyr
@@ -27,12 +27,6 @@ osource "$(KCONFIG_BINARY_DIR)/Kconfig.soc.defconfig"
|
||||
osource "soc/$(ARCH)/*/Kconfig.defconfig"
|
||||
# This loads the toolchain defconfigs
|
||||
osource "$(TOOLCHAIN_KCONFIG_DIR)/Kconfig.defconfig"
|
||||
# This loads the testsuite defconfig
|
||||
source "subsys/testsuite/Kconfig.defconfig"
|
||||
|
||||
# This should be early since the autogen Kconfig.dts symbols may get
|
||||
# used by modules
|
||||
source "dts/Kconfig"
|
||||
|
||||
menu "Modules"
|
||||
|
||||
@@ -44,6 +38,7 @@ source "boards/Kconfig"
|
||||
source "soc/Kconfig"
|
||||
source "arch/Kconfig"
|
||||
source "kernel/Kconfig"
|
||||
source "dts/Kconfig"
|
||||
source "drivers/Kconfig"
|
||||
source "lib/Kconfig"
|
||||
source "subsys/Kconfig"
|
||||
@@ -167,13 +162,6 @@ config CMAKE_LINKER_GENERATOR
|
||||
|
||||
endchoice
|
||||
|
||||
config LLVM_USE_LD
|
||||
bool "LLVM use ld linker"
|
||||
depends on "${ZEPHYR_TOOLCHAIN_VARIANT}" = "llvm"
|
||||
default y
|
||||
help
|
||||
Use binutils ld linker instead of LLVM built-in lld linker.
|
||||
|
||||
config HAVE_CUSTOM_LINKER_SCRIPT
|
||||
bool "Custom linker script provided"
|
||||
help
|
||||
@@ -233,7 +221,7 @@ config SRAM_OFFSET
|
||||
menu "Linker Sections"
|
||||
|
||||
config LINKER_USE_BOOT_SECTION
|
||||
bool "Use Boot Linker Section"
|
||||
bool "Enable Usage of Boot Linker Section"
|
||||
help
|
||||
If enabled, the symbols which are needed for the boot process
|
||||
will be put into another linker section reserved for these
|
||||
@@ -243,7 +231,7 @@ config LINKER_USE_BOOT_SECTION
|
||||
board or custom linker script.
|
||||
|
||||
config LINKER_USE_PINNED_SECTION
|
||||
bool "Use Pinned Linker Section"
|
||||
bool "Enable Usage of Pinned Linker Section"
|
||||
help
|
||||
If enabled, the symbols which need to be pinned in memory
|
||||
will be put into another linker section reserved for pinned
|
||||
@@ -266,49 +254,6 @@ config LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT
|
||||
|
||||
If unsure, say Y.
|
||||
|
||||
config LINKER_LAST_SECTION_ID
|
||||
bool "Last section identifier"
|
||||
default y
|
||||
depends on ARM || ARM64 || RISCV
|
||||
help
|
||||
If enabled, the last section will contain an identifier.
|
||||
This ensures that the '_flash_used' linker symbol will always be
|
||||
correctly calculated, even in cases where the location counter may
|
||||
have been incremented for alignment purposes but no data is placed
|
||||
after alignment.
|
||||
|
||||
Note: in cases where the flash is fully used, for example application
|
||||
specific data is written at the end of the flash area, then writing a
|
||||
last section identifier may cause rom region overflow.
|
||||
In such cases this setting should be disabled.
|
||||
|
||||
config LINKER_LAST_SECTION_ID_PATTERN
|
||||
hex "Last section identifier pattern"
|
||||
default "0xE015E015"
|
||||
depends on LINKER_LAST_SECTION_ID
|
||||
help
|
||||
Pattern to fill into last section as identifier.
|
||||
Default pattern is 0xE015 (end of last section), but any pattern can
|
||||
be used.
|
||||
The size of the pattern must not exceed 4 bytes.
|
||||
|
||||
config LINKER_USE_NO_RELAX
|
||||
bool
|
||||
help
|
||||
Hidden symbol to allow features to force the use of no relax.
|
||||
|
||||
config LINKER_USE_RELAX
|
||||
bool "Linker optimization of call addressing"
|
||||
depends on !LINKER_USE_NO_RELAX
|
||||
default y
|
||||
help
|
||||
This option performs global optimizations that become possible when the linker resolves
|
||||
addressing in the program, such as relaxing address modes and synthesizing new
|
||||
instructions in the output object file. For ld and lld, this enables `--relax`.
|
||||
On platforms where this is not supported, `--relax' is accepted, but ignored.
|
||||
Disabling it can reduce performance, as the linker is no longer able to substiture long /
|
||||
in-effective jump calls to shorter / more effective instructions.
|
||||
|
||||
endmenu # "Linker Sections"
|
||||
|
||||
endmenu
|
||||
@@ -327,7 +272,7 @@ config NATIVE_APPLICATION
|
||||
Build as a native application that can run on the host and using
|
||||
resources and libraries provided by the host.
|
||||
|
||||
choice COMPILER_OPTIMIZATIONS
|
||||
choice
|
||||
prompt "Optimization level"
|
||||
default NO_OPTIMIZATIONS if COVERAGE
|
||||
default DEBUG_OPTIMIZATIONS if DEBUG
|
||||
@@ -364,43 +309,11 @@ config NO_OPTIMIZATIONS
|
||||
endchoice
|
||||
|
||||
config COMPILER_COLOR_DIAGNOSTICS
|
||||
bool "Colored diagnostics"
|
||||
bool "Enable colored diganostics"
|
||||
default y
|
||||
help
|
||||
Compiler diagnostic messages are colorized.
|
||||
|
||||
choice COMPILER_SECURITY_FORTIFY
|
||||
prompt "Detect buffer overflows in libc calls"
|
||||
default FORTIFY_SOURCE_NONE if NO_OPTIMIZATIONS || MINIMAL_LIBC || NATIVE_APPLICATION
|
||||
default FORTIFY_SOURCE_COMPILE_TIME
|
||||
help
|
||||
Buffer overflow checking in libc calls. Supported by Clang and
|
||||
GCC when using Picolibc or Newlib. Requires compiler optimization
|
||||
to be enabled.
|
||||
|
||||
config FORTIFY_SOURCE_NONE
|
||||
bool "No detection"
|
||||
help
|
||||
Disables both compile-time and run-time checking.
|
||||
|
||||
config FORTIFY_SOURCE_COMPILE_TIME
|
||||
bool "Compile-time detection"
|
||||
help
|
||||
Enables only compile-time checking. Compile-time checking
|
||||
doesn't increase executable size or reduce performance, it
|
||||
limits checking to what can be done with information available
|
||||
at compile time.
|
||||
|
||||
config FORTIFY_SOURCE_RUN_TIME
|
||||
bool "Compile-time and run-time detection"
|
||||
help
|
||||
Enables both compile-time and run-time checking. Run-time
|
||||
checking increases coverage at the expense of additional code,
|
||||
and means that applications will raise a runtime exception
|
||||
when buffer overflow is detected.
|
||||
|
||||
endchoice
|
||||
|
||||
config COMPILER_OPT
|
||||
string "Custom compiler options"
|
||||
help
|
||||
@@ -436,7 +349,7 @@ config NO_RUNTIME_CHECKS
|
||||
Do not do any runtime checks or asserts when using the CHECK macro.
|
||||
|
||||
config RUNTIME_ERROR_CHECKS
|
||||
bool "Runtime error checks"
|
||||
bool "Enable runtime error checks"
|
||||
help
|
||||
Always perform runtime checks covered with the CHECK macro. This
|
||||
option is the default and the only option used during testing.
|
||||
@@ -457,11 +370,6 @@ config OUTPUT_STAT
|
||||
help
|
||||
Create a stat file using readelf -e <elf>
|
||||
|
||||
config OUTPUT_SYMBOLS
|
||||
bool "Create a symbol file"
|
||||
help
|
||||
Create a symbol file using nm <elf>
|
||||
|
||||
config OUTPUT_DISASSEMBLY
|
||||
bool "Create a disassembly file"
|
||||
default y
|
||||
@@ -551,11 +459,9 @@ if BUILD_OUTPUT_UF2
|
||||
config BUILD_OUTPUT_UF2_FAMILY_ID
|
||||
string "UF2 device family ID"
|
||||
default "0x1c5f21b0" if SOC_ESP32
|
||||
default "0x621e937a" if SOC_NRF52833_QIAA
|
||||
default "0xada52840" if SOC_NRF52840_QIAA
|
||||
default "0x4fb2d5bd" if SOC_SERIES_IMX_RT
|
||||
default "0x2abc77ec" if SOC_SERIES_LPC55XXX
|
||||
default "0xe48bff56" if SOC_SERIES_RP2XXX
|
||||
default "0x68ed2b88" if SOC_SERIES_SAMD21
|
||||
default "0x55114460" if SOC_SERIES_SAMD51
|
||||
default "0x647824b6" if SOC_SERIES_STM32F0X
|
||||
@@ -571,7 +477,7 @@ config BUILD_OUTPUT_UF2_FAMILY_ID
|
||||
default "0x04240bdf" if SOC_SERIES_STM32L5X
|
||||
default "0x70d16653" if SOC_SERIES_STM32WBX
|
||||
default "0x5ee21072" if SOC_STM32F103XE
|
||||
default "0x57755a57" if SOC_SERIES_STM32F4X && (!SOC_STM32F407XE) && (!SOC_STM32F407XG)
|
||||
default "0x57755a57" if SOC_STM32F401XC || SOC_STM32F401XE
|
||||
default "0x6d0922fa" if SOC_STM32F407XE
|
||||
default "0x8fb060fe" if SOC_STM32F407XG
|
||||
help
|
||||
@@ -580,14 +486,6 @@ config BUILD_OUTPUT_UF2_FAMILY_ID
|
||||
name string. If the SoC in use is known by UF2, the Family ID will
|
||||
be pre-filled with the known value.
|
||||
|
||||
config BUILD_OUTPUT_UF2_USE_FLASH_BASE
|
||||
bool
|
||||
default n
|
||||
|
||||
config BUILD_OUTPUT_UF2_USE_FLASH_OFFSET
|
||||
bool
|
||||
default n
|
||||
|
||||
endif # BUILD_OUTPUT_UF2
|
||||
|
||||
config BUILD_OUTPUT_STRIPPED
|
||||
@@ -596,41 +494,6 @@ config BUILD_OUTPUT_STRIPPED
|
||||
Build a stripped binary zephyr/zephyr.strip in the build directory.
|
||||
The name of this file can be customized with CONFIG_KERNEL_BIN_NAME.
|
||||
|
||||
config BUILD_OUTPUT_ADJUST_LMA
|
||||
string
|
||||
help
|
||||
This will adjust the LMA address in the final ELF and hex files with
|
||||
the value provided.
|
||||
This will not affect the internal address symbols inside the image but
|
||||
can be useful when adjusting the LMA address for flash tools or multi
|
||||
stage loaders where a pre-loader may copy image to a second location
|
||||
before booting a second core.
|
||||
The value will be evaluated as a math expression, this means that
|
||||
following are valid expression
|
||||
- 1024
|
||||
- 0x1000
|
||||
- -0x1000
|
||||
- 0x20000000 - 0x10000000
|
||||
Note: negative numbers are valid.
|
||||
To adjust according to a chosen flash partition one can specify a
|
||||
default as:
|
||||
DT_CHOSEN_IMAGE_<name> := <name>,<name>-partition
|
||||
DT_CHOSEN_Z_FLASH := zephyr,flash
|
||||
config BUILD_OUTPUT_ADJUST_LMA
|
||||
default "$(dt_chosen_reg_addr_hex,$(DT_CHOSEN_IMAGE_M4))-\
|
||||
$(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))"
|
||||
|
||||
config BUILD_OUTPUT_INFO_HEADER
|
||||
bool "Create a image information header"
|
||||
help
|
||||
Create an image information header which will contain image
|
||||
information from the Zephyr binary.
|
||||
Example of information contained in the header file:
|
||||
- Number of segments in the image
|
||||
- LMA address of each segment
|
||||
- VMA address of each segment
|
||||
- Size of each segment
|
||||
|
||||
config APPLICATION_DEFINED_SYSCALL
|
||||
bool "Scan application folder for any syscall definition"
|
||||
help
|
||||
@@ -643,92 +506,7 @@ config MAKEFILE_EXPORTS
|
||||
Generates a file with build information that can be read by
|
||||
third party Makefile-based build systems.
|
||||
|
||||
config BUILD_OUTPUT_META
|
||||
bool "Create a build meta file"
|
||||
help
|
||||
Create a build meta file in the build directory containing lists of:
|
||||
- Zephyr: path and revision (if git repo)
|
||||
- Zephyr modules: name, path, and revision (if git repo)
|
||||
- West:
|
||||
- manifest: path and revision
|
||||
- projects: path and revision
|
||||
- Workspace:
|
||||
- dirty: one or more repositories are marked dirty
|
||||
- extra: extra Zephyr modules are manually included in the build
|
||||
- off: the SHA of one or more west projects are not what the manifest
|
||||
defined when `west update` was run the last time (`manifest-rev`).
|
||||
The off state is only present if a west workspace is found.
|
||||
File extension is .meta
|
||||
|
||||
config BUILD_OUTPUT_META_STATE_PROPAGATE
|
||||
bool "Propagate module and project state"
|
||||
depends on BUILD_OUTPUT_META
|
||||
help
|
||||
Propagate to state of each module to the Zephyr revision field.
|
||||
If west is used the state of each west project is also propagated to
|
||||
the Zephyr revision field.
|
||||
West manifest repo revision field will also
|
||||
be marked with the same state as the Zephyr revision.
|
||||
The final revision will become: <SHA>-<state1>-<state2>-<state3>...
|
||||
If no states are appended to the SHA it means the build is of a clean
|
||||
tree.
|
||||
- dirty: one or more repositories are marked dirty
|
||||
- extra: extra Zephyr modules are manually included in the build
|
||||
- off: the SHA of one or more west projects are not what the manifest
|
||||
defined when `west update` was run the last time (`manifest-rev`).
|
||||
The off state is only present if a west workspace is found.
|
||||
|
||||
endmenu
|
||||
|
||||
config DEPRECATED
|
||||
bool
|
||||
help
|
||||
Symbol that must be selected by a feature or module if it is
|
||||
considered to be deprecated.
|
||||
|
||||
config WARN_DEPRECATED
|
||||
bool
|
||||
default y
|
||||
prompt "Warn on deprecated usage"
|
||||
help
|
||||
Print a warning when the Kconfig tree is parsed if any deprecated
|
||||
features are enabled.
|
||||
|
||||
config EXPERIMENTAL
|
||||
bool
|
||||
help
|
||||
Symbol that must be selected by a feature if it is considered to be
|
||||
at an experimental implementation stage.
|
||||
|
||||
config WARN_EXPERIMENTAL
|
||||
bool
|
||||
prompt "Warn on experimental usage"
|
||||
help
|
||||
Print a warning when the Kconfig tree is parsed if any experimental
|
||||
features are enabled.
|
||||
|
||||
config TAINT
|
||||
bool
|
||||
help
|
||||
Symbol that must be selected by a feature or module if the Zephyr
|
||||
build is considered tainted.
|
||||
|
||||
config ENFORCE_ZEPHYR_STDINT
|
||||
bool
|
||||
prompt "Enforce Zephyr convention for stdint"
|
||||
depends on !ARCH_POSIX
|
||||
default y
|
||||
help
|
||||
This enforces the Zephyr stdint convention where int32_t = int,
|
||||
int64_t = long long, and intptr_t = long so that short string
|
||||
format length modifiers can be used universally across ILP32
|
||||
and LP64 architectures. Sometimes this is not possible e.g. when
|
||||
linking against a binary-only C++ library whose type mangling
|
||||
is incompatible with the Zephyr convention, or if the build
|
||||
environment doesn't allow such enforcement, in which case this
|
||||
should be turned off with the caveat that argument type validation
|
||||
on Zephyr code will be skipped.
|
||||
|
||||
endmenu
|
||||
|
||||
|
||||
@@ -787,7 +565,6 @@ if BOOTLOADER_MCUBOOT
|
||||
config MCUBOOT_SIGNATURE_KEY_FILE
|
||||
string "Path to the mcuboot signing key file"
|
||||
default ""
|
||||
depends on !MCUBOOT_GENERATE_UNSIGNED_IMAGE
|
||||
help
|
||||
The file contains a key pair whose public half is verified
|
||||
by your target's MCUboot image. The file is in PEM format.
|
||||
@@ -839,19 +616,12 @@ config MCUBOOT_ENCRYPTION_KEY_FILE
|
||||
If left empty, you must encrypt the Zephyr binaries manually.
|
||||
|
||||
config MCUBOOT_EXTRA_IMGTOOL_ARGS
|
||||
string "Extra arguments to pass to imgtool when signing"
|
||||
string "Extra arguments to pass to imgtool"
|
||||
default ""
|
||||
help
|
||||
When signing (CONFIG_MCUBOOT_SIGNATURE_KEY_FILE is a non-empty
|
||||
string) you can use this option to pass extra options to
|
||||
imgtool. For example, you could set this to "--version 1.2".
|
||||
|
||||
config MCUBOOT_GENERATE_UNSIGNED_IMAGE
|
||||
bool "Generate unsigned binary image bootable with MCUboot"
|
||||
help
|
||||
Enabling this configuration allows automatic unsigned binary image
|
||||
generation when MCUboot signing key is not provided,
|
||||
i.e., MCUBOOT_SIGNATURE_KEY_FILE is left empty.
|
||||
If CONFIG_MCUBOOT_SIGNATURE_KEY_FILE is a non-empty string,
|
||||
you can use this option to pass extra options to imgtool.
|
||||
For example, you could set this to "--version 1.2".
|
||||
|
||||
config MCUBOOT_GENERATE_CONFIRMED_IMAGE
|
||||
bool "Also generate a padded, confirmed image"
|
||||
@@ -868,8 +638,7 @@ endif # BOOTLOADER_MCUBOOT
|
||||
|
||||
config BOOTLOADER_ESP_IDF
|
||||
bool "ESP-IDF bootloader support"
|
||||
depends on (SOC_ESP32 || SOC_ESP32S2 || SOC_ESP32C3) && !BOOTLOADER_MCUBOOT
|
||||
default y
|
||||
depends on SOC_ESP32 || SOC_ESP32S2
|
||||
help
|
||||
This option will trigger the compilation of the ESP-IDF bootloader
|
||||
inside the build folder.
|
||||
@@ -928,14 +697,3 @@ config COMPAT_INCLUDES
|
||||
deprecated header files.
|
||||
|
||||
endmenu
|
||||
|
||||
config LEGACY_INCLUDE_PATH
|
||||
bool "Allow for the legacy include paths (without the zephyr/ prefix) (DEPRECATED)"
|
||||
select DEPRECATED
|
||||
help
|
||||
DEPRECATED: Allow applications and libraries to use the Zephyr legacy
|
||||
include path which does not use the zephyr/ prefix. For example, the
|
||||
preferred way to include a Zephyr header is to use <zephyr/kernel.h>,
|
||||
but enabling CONFIG_LEGACY_INCLUDE_PATH will allow developers to use
|
||||
<kernel.h> instead. This (without the zephyr/ prefix) is deprecated
|
||||
and should be avoided. Eventually, it will not be supported.
|
||||
|
||||
3980
MAINTAINERS.yml
3980
MAINTAINERS.yml
File diff suppressed because it is too large
Load Diff
24
README.rst
24
README.rst
@@ -2,20 +2,15 @@
|
||||
|
||||
<a href="https://www.zephyrproject.org">
|
||||
<p align="center">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="doc/_static/images/logo-readme-dark.svg">
|
||||
<source media="(prefers-color-scheme: light)" srcset="doc/_static/images/logo-readme-light.svg">
|
||||
<img src="doc/_static/images/logo-readme-light.svg">
|
||||
</picture>
|
||||
<img src="doc/_static/images/logo-readme.png">
|
||||
</p>
|
||||
</a>
|
||||
|
||||
<a href="https://bestpractices.coreinfrastructure.org/projects/74"><img
|
||||
src="https://bestpractices.coreinfrastructure.org/projects/74/badge"></a>
|
||||
<a
|
||||
href="https://github.com/zephyrproject-rtos/zephyr/actions/workflows/twister.yaml?query=branch%3Amain">
|
||||
<a href="https://buildkite.com/zephyr/zephyr">
|
||||
<img
|
||||
src="https://github.com/zephyrproject-rtos/zephyr/actions/workflows/twister.yaml/badge.svg?event=push"></a>
|
||||
src="https://badge.buildkite.com/f5bd0dc88306cee17c9b38e78d11bb74a6291e3f40e7d13f31.svg?branch=main"></a>
|
||||
|
||||
|
||||
The Zephyr Project is a scalable real-time operating system (RTOS) supporting
|
||||
@@ -26,9 +21,9 @@ The Zephyr OS is based on a small-footprint kernel designed for use on
|
||||
resource-constrained systems: from simple embedded environmental sensors and
|
||||
LED wearables to sophisticated smart watches and IoT wireless gateways.
|
||||
|
||||
The Zephyr kernel supports multiple architectures, including ARM (Cortex-A,
|
||||
Cortex-R, Cortex-M), Intel x86, ARC, Nios II, Tensilica Xtensa, and RISC-V,
|
||||
SPARC, MIPS, and a large number of `supported boards`_.
|
||||
The Zephyr kernel supports multiple architectures, including ARM Cortex-M,
|
||||
Intel x86, ARC, Nios II, Tensilica Xtensa, and RISC-V, and a large number of
|
||||
`supported boards`_.
|
||||
|
||||
.. below included in doc/introduction/introduction.rst
|
||||
|
||||
@@ -67,7 +62,8 @@ Here's a quick summary of resources to help you find your way around:
|
||||
`Zephyr Development mailing list`_. The other `Zephyr mailing list
|
||||
subgroups`_ have their own archives and sign-up pages.
|
||||
* **Nightly CI Build Status**: https://lists.zephyrproject.org/g/builds
|
||||
The builds@lists.zephyrproject.org mailing list archives the CI nightly build results.
|
||||
The builds@lists.zephyrproject.org mailing list archives the CI
|
||||
(buildkite) nightly build results.
|
||||
* **Chat**: Real-time chat happens in Zephyr's Discord Server. Use
|
||||
this `Discord Invite`_ to register.
|
||||
* **Contributing**: see the `Contribution Guide`_
|
||||
@@ -82,11 +78,11 @@ Here's a quick summary of resources to help you find your way around:
|
||||
.. _supported boards: http://docs.zephyrproject.org/latest/boards/index.html
|
||||
.. _Zephyr Documentation: http://docs.zephyrproject.org
|
||||
.. _Introduction to Zephyr: http://docs.zephyrproject.org/latest/introduction/index.html
|
||||
.. _Getting Started Guide: http://docs.zephyrproject.org/latest/develop/getting_started/index.html
|
||||
.. _Getting Started Guide: http://docs.zephyrproject.org/latest/getting_started/index.html
|
||||
.. _Contribution Guide: http://docs.zephyrproject.org/latest/contribute/index.html
|
||||
.. _Zephyr GitHub wiki: https://github.com/zephyrproject-rtos/zephyr/wiki
|
||||
.. _Zephyr Development mailing list: https://lists.zephyrproject.org/g/devel
|
||||
.. _Zephyr mailing list subgroups: https://lists.zephyrproject.org/g/main/subgroups
|
||||
.. _Sample and Demo Code Examples: http://docs.zephyrproject.org/latest/samples/index.html
|
||||
.. _Security: http://docs.zephyrproject.org/latest/security/index.html
|
||||
.. _Asking for Help Tips: https://docs.zephyrproject.org/latest/develop/getting_started/index.html#asking-for-help
|
||||
.. _Asking for Help Tips: https://docs.zephyrproject.org/latest/getting_started/index.html#asking-for-help
|
||||
|
||||
4
VERSION
4
VERSION
@@ -1,5 +1,5 @@
|
||||
VERSION_MAJOR = 3
|
||||
VERSION_MINOR = 3
|
||||
VERSION_MAJOR = 2
|
||||
VERSION_MINOR = 7
|
||||
PATCHLEVEL = 0
|
||||
VERSION_TWEAK = 0
|
||||
EXTRAVERSION =
|
||||
|
||||
355
arch/Kconfig
355
arch/Kconfig
@@ -33,7 +33,7 @@ config ARM
|
||||
# FIXME: current state of the code for all ARM requires this, but
|
||||
# is really only necessary for Cortex-M with ARM MPU!
|
||||
select GEN_PRIV_STACKS
|
||||
select ARCH_HAS_THREAD_LOCAL_STORAGE if CPU_AARCH32_CORTEX_R || CPU_CORTEX_M || CPU_AARCH32_CORTEX_A
|
||||
select ARCH_HAS_THREAD_LOCAL_STORAGE if CPU_CORTEX_R || CPU_CORTEX_M
|
||||
help
|
||||
ARM architecture
|
||||
|
||||
@@ -46,18 +46,9 @@ config ARM64
|
||||
select ARCH_HAS_THREAD_LOCAL_STORAGE
|
||||
select USE_SWITCH
|
||||
select USE_SWITCH_SUPPORTED
|
||||
select IRQ_OFFLOAD_NESTED if IRQ_OFFLOAD
|
||||
help
|
||||
ARM64 (AArch64) architecture
|
||||
|
||||
config MIPS
|
||||
bool
|
||||
select ARCH_IS_SET
|
||||
select ATOMIC_OPERATIONS_C
|
||||
select HAS_DTS
|
||||
help
|
||||
MIPS architecture
|
||||
|
||||
config SPARC
|
||||
bool
|
||||
select ARCH_IS_SET
|
||||
@@ -85,7 +76,6 @@ config X86
|
||||
select ARCH_HAS_TIMING_FUNCTIONS
|
||||
select ARCH_HAS_THREAD_LOCAL_STORAGE
|
||||
select ARCH_HAS_DEMAND_PAGING
|
||||
select IRQ_OFFLOAD_NESTED if IRQ_OFFLOAD
|
||||
select NEED_LIBC_MEM_PARTITION if USERSPACE && TIMING_FUNCTIONS \
|
||||
&& !BOARD_HAS_TIMING_FUNCTIONS \
|
||||
&& !SOC_HAS_TIMING_FUNCTIONS
|
||||
@@ -106,13 +96,7 @@ config RISCV
|
||||
bool
|
||||
select ARCH_IS_SET
|
||||
select HAS_DTS
|
||||
select ARCH_SUPPORTS_COREDUMP
|
||||
select ARCH_HAS_CODE_DATA_RELOCATION
|
||||
select ARCH_HAS_THREAD_LOCAL_STORAGE
|
||||
select IRQ_OFFLOAD_NESTED if IRQ_OFFLOAD
|
||||
select USE_SWITCH_SUPPORTED
|
||||
select USE_SWITCH
|
||||
select SCHED_IPI_SUPPORTED if SMP
|
||||
imply XIP
|
||||
help
|
||||
RISCV architecture
|
||||
@@ -123,9 +107,6 @@ config XTENSA
|
||||
select HAS_DTS
|
||||
select USE_SWITCH
|
||||
select USE_SWITCH_SUPPORTED
|
||||
select IRQ_OFFLOAD_NESTED if IRQ_OFFLOAD
|
||||
select ARCH_HAS_CODE_DATA_RELOCATION
|
||||
select ARCH_HAS_TIMING_FUNCTIONS
|
||||
imply ATOMIC_OPERATIONS_ARCH
|
||||
help
|
||||
Xtensa architecture
|
||||
@@ -151,12 +132,14 @@ config ARCH_IS_SET
|
||||
|
||||
menu "General Architecture Options"
|
||||
|
||||
source "arch/common/Kconfig"
|
||||
|
||||
module = ARCH
|
||||
module-str = arch
|
||||
source "subsys/logging/Kconfig.template.log_config"
|
||||
|
||||
module = MPU
|
||||
module-str = mpu
|
||||
source "subsys/logging/Kconfig.template.log_config"
|
||||
|
||||
config BIG_ENDIAN
|
||||
bool
|
||||
help
|
||||
@@ -167,14 +150,6 @@ config BIG_ENDIAN
|
||||
modifying it. The option is used to select linker script OUTPUT_FORMAT
|
||||
and command line option for gen_isr_tables.py.
|
||||
|
||||
config LITTLE_ENDIAN
|
||||
# Hidden Kconfig option representing the default little-endian architecture
|
||||
# This is just the opposite of BIG_ENDIAN and is used for non-negative
|
||||
# conditional compilation
|
||||
bool
|
||||
depends on !BIG_ENDIAN
|
||||
default y
|
||||
|
||||
config 64BIT
|
||||
bool
|
||||
help
|
||||
@@ -274,7 +249,6 @@ config USERSPACE
|
||||
depends on RUNTIME_ERROR_CHECKS
|
||||
depends on SRAM_REGION_PERMISSIONS
|
||||
select THREAD_STACK_INFO
|
||||
select LINKER_USE_NO_RELAX
|
||||
help
|
||||
When enabled, threads may be created or dropped down to user mode,
|
||||
which has significantly restricted permissions and must interact
|
||||
@@ -390,7 +364,7 @@ config NOCACHE_MEMORY
|
||||
menu "Interrupt Configuration"
|
||||
|
||||
config DYNAMIC_INTERRUPTS
|
||||
bool "Installation of IRQs at runtime"
|
||||
bool "Enable installation of IRQs at runtime"
|
||||
help
|
||||
Enable installation of interrupts at runtime, which will move some
|
||||
interrupt-related data structures to RAM instead of ROM, and
|
||||
@@ -415,35 +389,6 @@ config GEN_IRQ_VECTOR_TABLE
|
||||
indexed by IRQ line. In the latter case, the vector table must be
|
||||
supplied by the application or architecture code.
|
||||
|
||||
config ARCH_IRQ_VECTOR_TABLE_ALIGN
|
||||
int "Alignment size of the interrupt vector table"
|
||||
default 4
|
||||
depends on GEN_IRQ_VECTOR_TABLE
|
||||
help
|
||||
This option controls alignment size of generated
|
||||
_irq_vector_table. Some architecture needs an IRQ vector table
|
||||
to be aligned to architecture specific size. The default
|
||||
size is 0 for no alignment.
|
||||
|
||||
choice IRQ_VECTOR_TABLE_TYPE
|
||||
prompt "IRQ vector table type"
|
||||
depends on GEN_IRQ_VECTOR_TABLE
|
||||
default IRQ_VECTOR_TABLE_JUMP_BY_CODE if (RISCV && !RISCV_HAS_CLIC)
|
||||
default IRQ_VECTOR_TABLE_JUMP_BY_ADDRESS
|
||||
|
||||
config IRQ_VECTOR_TABLE_JUMP_BY_ADDRESS
|
||||
bool "Jump by address"
|
||||
help
|
||||
The IRQ vector table contains the address of the interrupt handler.
|
||||
|
||||
config IRQ_VECTOR_TABLE_JUMP_BY_CODE
|
||||
bool "Jump by code"
|
||||
help
|
||||
The IRQ vector table contains the opcode of a jump instruction to the
|
||||
interrupt handler address.
|
||||
|
||||
endchoice
|
||||
|
||||
config GEN_SW_ISR_TABLE
|
||||
bool "Generate a software ISR table"
|
||||
default y
|
||||
@@ -456,7 +401,7 @@ config GEN_SW_ISR_TABLE
|
||||
|
||||
config ARCH_SW_ISR_TABLE_ALIGN
|
||||
int "Alignment size of a software ISR table"
|
||||
default 4
|
||||
default 0
|
||||
depends on GEN_SW_ISR_TABLE
|
||||
help
|
||||
This option controls alignment size of generated
|
||||
@@ -477,21 +422,13 @@ config GEN_IRQ_START_VECTOR
|
||||
left alone.
|
||||
|
||||
config IRQ_OFFLOAD
|
||||
bool "IRQ offload"
|
||||
bool "Enable IRQ offload"
|
||||
depends on TEST
|
||||
help
|
||||
Enable irq_offload() API which allows functions to be synchronously
|
||||
run in interrupt context. Only useful for test cases that need
|
||||
to validate the correctness of kernel objects in IRQ context.
|
||||
|
||||
config IRQ_OFFLOAD_NESTED
|
||||
bool "irq_offload() supports nested IRQs"
|
||||
depends on IRQ_OFFLOAD
|
||||
help
|
||||
When set by the arch layer, indicates that irq_offload() may
|
||||
legally be called in interrupt context to cause a
|
||||
synchronous nested interrupt on the current CPU. Not all
|
||||
hardware is capable.
|
||||
|
||||
config EXTRA_EXCEPTION_INFO
|
||||
bool "Collect extra exception info"
|
||||
@@ -501,18 +438,6 @@ config EXTRA_EXCEPTION_INFO
|
||||
register state, when a fault occurs. This information can be useful
|
||||
to collect for post-mortem analysis and debug of issues.
|
||||
|
||||
config SIMPLIFIED_EXCEPTION_CODES
|
||||
bool "Convert arch specific exception codes to K_ERR_CPU_EXCEPTION"
|
||||
default y if ZTEST
|
||||
help
|
||||
The same piece of faulty code (NULL dereference, etc) can result in
|
||||
a multitude of potential exception codes at the CPU level, depending
|
||||
upon whether addresses exist, an MPU is configured, the particular
|
||||
implementation of the CPU or any number of other reasons. Enabling
|
||||
this option collapses all the architecture specific exception codes
|
||||
down to the generic K_ERR_CPU_EXCEPTION, which makes testing code
|
||||
much more portable.
|
||||
|
||||
endmenu # Interrupt configuration
|
||||
|
||||
config INIT_ARCH_HW_AT_BOOT
|
||||
@@ -588,11 +513,6 @@ config ARCH_HAS_COHERENCE
|
||||
config ARCH_HAS_THREAD_LOCAL_STORAGE
|
||||
bool
|
||||
|
||||
config ARCH_HAS_SUSPEND_TO_RAM
|
||||
bool
|
||||
help
|
||||
When selected, the architecture supports suspend-to-RAM (S2RAM).
|
||||
|
||||
#
|
||||
# Other architecture related options
|
||||
#
|
||||
@@ -600,12 +520,6 @@ config ARCH_HAS_SUSPEND_TO_RAM
|
||||
config ARCH_HAS_THREAD_ABORT
|
||||
bool
|
||||
|
||||
config ARCH_HAS_CODE_DATA_RELOCATION
|
||||
bool
|
||||
help
|
||||
When selected, the architecture/SoC implements support for
|
||||
CODE_DATA_RELOCATION in its linker scripts.
|
||||
|
||||
#
|
||||
# Hidden CPU family configs
|
||||
#
|
||||
@@ -620,7 +534,7 @@ config CPU_HAS_TEE
|
||||
config CPU_HAS_DCLS
|
||||
bool
|
||||
help
|
||||
This option is enabled when the processor hardware has support for
|
||||
This option is enabled when the processor hardware is configured in
|
||||
Dual-redundant Core Lock-step (DCLS) topology.
|
||||
|
||||
config CPU_HAS_FPU
|
||||
@@ -661,16 +575,6 @@ config ARCH_HAS_RESERVED_PAGE_FRAMES
|
||||
memory mappings. The architecture will need to implement
|
||||
arch_reserved_pages_update().
|
||||
|
||||
config CPU_HAS_DCACHE
|
||||
bool
|
||||
help
|
||||
This hidden configuration should be selected when the CPU has a d-cache.
|
||||
|
||||
config CPU_HAS_ICACHE
|
||||
bool
|
||||
help
|
||||
This hidden configuration should be selected when the CPU has an i-cache.
|
||||
|
||||
config ARCH_MAPS_ALL_RAM
|
||||
bool
|
||||
help
|
||||
@@ -691,28 +595,180 @@ config ARCH_MAPS_ALL_RAM
|
||||
this mapping at all; non-kernel pages will be considered free (unless marked
|
||||
as reserved) and Z_PAGE_FRAME_MAPPED will not be set.
|
||||
|
||||
config DCLS
|
||||
bool "Processor is configured in DCLS mode"
|
||||
depends on CPU_HAS_DCLS
|
||||
default y
|
||||
menuconfig MMU
|
||||
bool "Enable MMU features"
|
||||
depends on CPU_HAS_MMU
|
||||
help
|
||||
This option is enabled when the processor hardware is configured in
|
||||
Dual-redundant Core Lock-step (DCLS) topology. For the processor that
|
||||
supports DCLS, but is configured in split-lock mode (by default or
|
||||
changed at flash time), this option should be disabled.
|
||||
This option is enabled when the CPU's memory management unit is active
|
||||
and the arch_mem_map() API is available.
|
||||
|
||||
if MMU
|
||||
config MMU_PAGE_SIZE
|
||||
hex "Size of smallest granularity MMU page"
|
||||
default 0x1000
|
||||
help
|
||||
Size of memory pages. Varies per MMU but 4K is common. For MMUs that
|
||||
support multiple page sizes, put the smallest one here.
|
||||
|
||||
config KERNEL_VM_BASE
|
||||
hex "Virtual address space base address"
|
||||
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_SRAM))
|
||||
help
|
||||
Define the base of the kernel's address space.
|
||||
|
||||
By default, this is the same as the DT_CHOSEN_Z_SRAM physical base SRAM
|
||||
address from DTS, in which case RAM will be identity-mapped. Some
|
||||
architectures may require RAM to be mapped in this way; they may have
|
||||
just one RAM region and doing this makes linking much simpler, as
|
||||
at least when the kernel boots all virtual RAM addresses are the same
|
||||
as their physical address (demand paging at runtime may later modify
|
||||
this for non-pinned page frames).
|
||||
|
||||
Otherwise, if RAM isn't identity-mapped:
|
||||
1. It is the architecture's responsibility to transition the
|
||||
instruction pointer to virtual addresses at early boot before
|
||||
entering the kernel at z_cstart().
|
||||
2. The underlying architecture may impose constraints on the bounds of
|
||||
the kernel's address space, such as not overlapping physical RAM
|
||||
regions if RAM is not identity-mapped, or the virtual and physical
|
||||
base addresses being aligned to some common value (which allows
|
||||
double-linking of paging structures to make the instruction pointer
|
||||
transition simpler).
|
||||
|
||||
Zephyr does not implement a split address space and if multiple
|
||||
page tables are in use, they all have the same virtual-to-physical
|
||||
mappings (with potentially different permissions).
|
||||
|
||||
config KERNEL_VM_OFFSET
|
||||
hex "Kernel offset within address space"
|
||||
default 0
|
||||
help
|
||||
Offset that the kernel image begins within its address space,
|
||||
if this is not the same offset from the beginning of RAM.
|
||||
|
||||
Some care may need to be taken in selecting this value. In certain
|
||||
build-time cases, or when a physical address cannot be looked up
|
||||
in page tables, the equation:
|
||||
|
||||
virt = phys + ((KERNEL_VM_BASE + KERNEL_VM_OFFSET) -
|
||||
(SRAM_BASE_ADDRESS + SRAM_OFFSET))
|
||||
|
||||
Will be used to convert between physical and virtual addresses for
|
||||
memory that is mapped at boot.
|
||||
|
||||
This uncommon and is only necessary if the beginning of VM and
|
||||
physical memory have dissimilar alignment.
|
||||
|
||||
config KERNEL_VM_SIZE
|
||||
hex "Size of kernel address space in bytes"
|
||||
default 0x800000
|
||||
help
|
||||
Size of the kernel's address space. Constraining this helps control
|
||||
how much total memory can be used for page tables.
|
||||
|
||||
The difference between KERNEL_VM_BASE and KERNEL_VM_SIZE indicates the
|
||||
size of the virtual region for runtime memory mappings. This is needed
|
||||
for mapping driver MMIO regions, as well as special RAM mapping use-cases
|
||||
such as VSDO pages, memory mapped thread stacks, and anonymous memory
|
||||
mappings. The kernel itself will be mapped in here as well at boot.
|
||||
|
||||
Systems with very large amounts of memory (such as 512M or more)
|
||||
will want to use a 64-bit build of Zephyr, there are no plans to
|
||||
implement a notion of "high" memory in Zephyr to work around physical
|
||||
RAM size larger than the defined bounds of the virtual address space.
|
||||
|
||||
menuconfig DEMAND_PAGING
|
||||
bool "Enable demand paging [EXPERIMENTAL]"
|
||||
depends on ARCH_HAS_DEMAND_PAGING
|
||||
help
|
||||
Enable demand paging. Requires architecture support in how the kernel
|
||||
is linked and the implementation of an eviction algorithm and a
|
||||
backing store for evicted pages.
|
||||
|
||||
if DEMAND_PAGING
|
||||
config DEMAND_PAGING_ALLOW_IRQ
|
||||
bool "Allow interrupts during page-ins/outs"
|
||||
help
|
||||
Allow interrupts to be serviced while pages are being evicted or
|
||||
retrieved from the backing store. This is much better for system
|
||||
latency, but any code running in interrupt context that page faults
|
||||
will cause a kernel panic. Such code must work with exclusively pinned
|
||||
code and data pages.
|
||||
|
||||
The scheduler is still disabled during this operation.
|
||||
|
||||
If this option is disabled, the page fault servicing logic
|
||||
runs with interrupts disabled for the entire operation. However,
|
||||
ISRs may also page fault.
|
||||
|
||||
config DEMAND_PAGING_PAGE_FRAMES_RESERVE
|
||||
int "Number of page frames reserved for paging"
|
||||
default 32 if !LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT
|
||||
default 0
|
||||
help
|
||||
This sets the number of page frames that will be reserved for
|
||||
paging that do not count towards free memory. This is to
|
||||
ensure that there are some page frames available for paging
|
||||
code and data. Otherwise, it would be possible to exhaust
|
||||
all page frames via anonymous memory mappings.
|
||||
|
||||
config DEMAND_PAGING_STATS
|
||||
bool "Gather Demand Paging Statistics"
|
||||
help
|
||||
This enables gathering various statistics related to demand paging,
|
||||
e.g. number of pagefaults. This is useful for tuning eviction
|
||||
algorithms and optimizing backing store.
|
||||
|
||||
Should say N in production system as this is not without cost.
|
||||
|
||||
config DEMAND_PAGING_STATS_USING_TIMING_FUNCTIONS
|
||||
bool "Use Timing Functions to Gather Demand Paging Statistics"
|
||||
select TIMING_FUNCTIONS_NEED_AT_BOOT
|
||||
help
|
||||
Use timing functions to gather various demand paging statistics.
|
||||
|
||||
config DEMAND_PAGING_THREAD_STATS
|
||||
bool "Gather per Thread Demand Paging Statistics"
|
||||
depends on DEMAND_PAGING_STATS
|
||||
help
|
||||
This enables gathering per thread statistics related to demand
|
||||
paging.
|
||||
|
||||
Should say N in production system as this is not without cost.
|
||||
|
||||
config DEMAND_PAGING_TIMING_HISTOGRAM
|
||||
bool "Gather Demand Paging Execution Timing Histogram"
|
||||
depends on DEMAND_PAGING_STATS
|
||||
help
|
||||
This gathers the histogram of execution time on page eviction
|
||||
selection, and backing store page in and page out.
|
||||
|
||||
Should say N in production system as this is not without cost.
|
||||
|
||||
config DEMAND_PAGING_TIMING_HISTOGRAM_NUM_BINS
|
||||
int "Number of bins (buckets) in Demand Paging Timing Histogrm"
|
||||
depends on DEMAND_PAGING_TIMING_HISTOGRAM
|
||||
default 10
|
||||
help
|
||||
Defines the number of bins (buckets) in the histogram used for
|
||||
gathering execution timing information for demand paging.
|
||||
|
||||
This requires k_mem_paging_eviction_histogram_bounds[] and
|
||||
k_mem_paging_backing_store_histogram_bounds[] to define
|
||||
the upper bounds for each bin. See kernel/statistics.c for
|
||||
information.
|
||||
|
||||
endif # DEMAND_PAGING
|
||||
endif # MMU
|
||||
|
||||
menuconfig MPU
|
||||
bool "MPU features"
|
||||
bool "Enable MPU features"
|
||||
depends on CPU_HAS_MPU
|
||||
help
|
||||
This option, when enabled, indicates to the core kernel that an MPU
|
||||
is enabled.
|
||||
|
||||
if MPU
|
||||
module = MPU
|
||||
module-str = mpu
|
||||
source "subsys/logging/Kconfig.template.log_config"
|
||||
|
||||
config MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT
|
||||
bool
|
||||
help
|
||||
@@ -784,19 +840,10 @@ config SRAM_REGION_PERMISSIONS
|
||||
paging, do not need memory protection, and would rather not use up
|
||||
RAM for the alignment between regions.
|
||||
|
||||
config CODE_DATA_RELOCATION
|
||||
bool "Support code/data section relocation"
|
||||
depends on ARCH_HAS_CODE_DATA_RELOCATION
|
||||
help
|
||||
Enable support for relocating .text, data and .bss sections from specified
|
||||
files and placing them in a chosen memory region. Files to relocate and
|
||||
the target regions should be specified in CMakeLists.txt using
|
||||
zephyr_code_relocate().
|
||||
|
||||
menu "Floating Point Options"
|
||||
|
||||
config FPU
|
||||
bool "Floating point unit (FPU)"
|
||||
bool "Enable floating point unit (FPU)"
|
||||
depends on CPU_HAS_FPU
|
||||
help
|
||||
This option enables the hardware Floating Point Unit (FPU), in order to
|
||||
@@ -836,30 +883,15 @@ endmenu
|
||||
|
||||
menu "Cache Options"
|
||||
|
||||
config DCACHE
|
||||
bool "Data cache (d-cache) support"
|
||||
depends on CPU_HAS_DCACHE
|
||||
default y
|
||||
help
|
||||
This option enables the support for the data cache (d-cache).
|
||||
|
||||
config ICACHE
|
||||
bool "Instruction cache (i-cache) support"
|
||||
depends on CPU_HAS_ICACHE
|
||||
default y
|
||||
help
|
||||
This option enables the support for the instruction cache (i-cache).
|
||||
|
||||
config CACHE_MANAGEMENT
|
||||
bool "Cache management features"
|
||||
depends on DCACHE || ICACHE
|
||||
bool "Enable cache management features"
|
||||
help
|
||||
This option enables the cache management functions backed by arch or
|
||||
driver code.
|
||||
This links in the cache management functions (for d-cache and i-cache
|
||||
where possible).
|
||||
|
||||
config DCACHE_LINE_SIZE_DETECT
|
||||
bool "Detect d-cache line size at runtime"
|
||||
depends on CACHE_MANAGEMENT && DCACHE
|
||||
depends on CACHE_MANAGEMENT
|
||||
help
|
||||
This option enables querying some architecture-specific hardware for
|
||||
finding the d-cache line size at the expense of taking more memory and
|
||||
@@ -870,8 +902,8 @@ config DCACHE_LINE_SIZE_DETECT
|
||||
using the 'd-cache-line-size' property.
|
||||
|
||||
config DCACHE_LINE_SIZE
|
||||
int "d-cache line size"
|
||||
depends on CACHE_MANAGEMENT && DCACHE && !DCACHE_LINE_SIZE_DETECT
|
||||
int "d-cache line size" if !DCACHE_LINE_SIZE_DETECT
|
||||
depends on CACHE_MANAGEMENT
|
||||
default 0
|
||||
help
|
||||
Size in bytes of a CPU d-cache line. If this is set to 0 the value is
|
||||
@@ -882,7 +914,7 @@ config DCACHE_LINE_SIZE
|
||||
|
||||
config ICACHE_LINE_SIZE_DETECT
|
||||
bool "Detect i-cache line size at runtime"
|
||||
depends on CACHE_MANAGEMENT && ICACHE
|
||||
depends on CACHE_MANAGEMENT
|
||||
help
|
||||
This option enables querying some architecture-specific hardware for
|
||||
finding the i-cache line size at the expense of taking more memory and
|
||||
@@ -893,8 +925,8 @@ config ICACHE_LINE_SIZE_DETECT
|
||||
using the 'i-cache-line-size' property.
|
||||
|
||||
config ICACHE_LINE_SIZE
|
||||
int "i-cache line size"
|
||||
depends on CACHE_MANAGEMENT && ICACHE && !ICACHE_LINE_SIZE_DETECT
|
||||
int "i-cache line size" if !ICACHE_LINE_SIZE_DETECT
|
||||
depends on CACHE_MANAGEMENT
|
||||
default 0
|
||||
help
|
||||
Size in bytes of a CPU i-cache line. If this is set to 0 the value is
|
||||
@@ -905,17 +937,17 @@ config ICACHE_LINE_SIZE
|
||||
choice CACHE_TYPE
|
||||
prompt "Cache type"
|
||||
depends on CACHE_MANAGEMENT
|
||||
default ARCH_CACHE
|
||||
default HAS_ARCH_CACHE
|
||||
|
||||
config ARCH_CACHE
|
||||
config HAS_ARCH_CACHE
|
||||
bool "Integrated cache controller"
|
||||
help
|
||||
Integrated on-core cache controller
|
||||
"Integrade on-core cache controller"
|
||||
|
||||
config EXTERNAL_CACHE
|
||||
config HAS_EXTERNAL_CACHE
|
||||
bool "External cache controller"
|
||||
help
|
||||
External cache controller
|
||||
"External cache controller or cache management system"
|
||||
|
||||
endchoice
|
||||
|
||||
@@ -947,6 +979,15 @@ config SOC_FAMILY
|
||||
This option holds the directory name used by the build system to locate
|
||||
the correct linker and header files.
|
||||
|
||||
config BOARD
|
||||
string
|
||||
help
|
||||
This option holds the name of the board and is used to locate the files
|
||||
related to the board in the source tree (under boards/).
|
||||
The Board is the first location where we search for a linker.ld file,
|
||||
if not found we look for the linker file in
|
||||
soc/<arch>/<family>/<series>
|
||||
|
||||
config TOOLCHAIN_HAS_BUILTIN_FFS
|
||||
bool
|
||||
default y if !(64BIT && RISCV)
|
||||
|
||||
@@ -12,36 +12,15 @@ zephyr_cc_option(-fno-delete-null-pointer-checks)
|
||||
|
||||
zephyr_cc_option_ifdef(CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS -munaligned-access)
|
||||
|
||||
if(NOT COMPILER STREQUAL arcmwdt)
|
||||
if(CONFIG_THREAD_LOCAL_STORAGE)
|
||||
# Instruct compiler to use proper register as cached thread pointer for thread local storage.
|
||||
# For ARCv2 the default register is usually not specified - so we need to specify it
|
||||
# For ARCv3 the register is fixed to r30, so we don't need to specify it
|
||||
zephyr_compile_options_ifdef(CONFIG_ISA_ARCV2 -mtp-regno=26)
|
||||
else()
|
||||
# If thread local storage isn't used - we can safely schedule thread pointer register
|
||||
zephyr_compile_options_ifdef(CONFIG_ISA_ARCV2 -mtp-regno=none)
|
||||
endif()
|
||||
if(CONFIG_ISA_ARCV2)
|
||||
# Instruct compiler to use register R26 as thread pointer
|
||||
# for thread local storage.
|
||||
# For ARCv3 the register is fixed to r30, so we don't need to specify it
|
||||
zephyr_cc_option_ifdef(CONFIG_THREAD_LOCAL_STORAGE -mtp-regno=26)
|
||||
endif()
|
||||
|
||||
add_subdirectory(core)
|
||||
|
||||
if(COMPILER STREQUAL arcmwdt)
|
||||
add_subdirectory(arcmwdt)
|
||||
|
||||
if(CONFIG_64BIT)
|
||||
zephyr_compile_options(-Ml)
|
||||
# Instruct MWDT assembler not to warn when we load only lower half (32bit) of symbol
|
||||
# instead of full 64bit address in ASM code. It is valid as we don't support Zephyr
|
||||
# linkage to high addresses for 64bit ARC platforms.
|
||||
zephyr_compile_options(-Wa,-offwarn=168)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_ISA_ARCV3 AND CONFIG_64BIT)
|
||||
set_property(GLOBAL PROPERTY PROPERTY_OUTPUT_FORMAT elf64-littlearc64)
|
||||
elseif(CONFIG_ISA_ARCV3 AND NOT CONFIG_64BIT)
|
||||
set_property(GLOBAL PROPERTY PROPERTY_OUTPUT_FORMAT elf32-littlearc64)
|
||||
else()
|
||||
set_property(GLOBAL PROPERTY PROPERTY_OUTPUT_FORMAT elf32-littlearc)
|
||||
endif()
|
||||
|
||||
@@ -31,7 +31,6 @@ config ISA_ARCV2
|
||||
bool "ARC ISA v2"
|
||||
select ARCH_HAS_STACK_PROTECTION if ARC_HAS_STACK_CHECKING || (ARC_MPU && ARC_MPU_VER !=2)
|
||||
select ARCH_HAS_USERSPACE if ARC_MPU
|
||||
select ARCH_HAS_SINGLE_THREAD_SUPPORT if !SMP
|
||||
select USE_SWITCH
|
||||
select USE_SWITCH_SUPPORTED
|
||||
help
|
||||
@@ -39,7 +38,6 @@ config ISA_ARCV2
|
||||
|
||||
config ISA_ARCV3
|
||||
bool "ARC ISA v3"
|
||||
select ARCH_HAS_SINGLE_THREAD_SUPPORT if !SMP
|
||||
select USE_SWITCH
|
||||
select USE_SWITCH_SUPPORTED
|
||||
|
||||
@@ -76,16 +74,12 @@ config CPU_EM4_FPUDA
|
||||
config CPU_EM6
|
||||
bool
|
||||
select CPU_ARCEM
|
||||
select CPU_HAS_DCACHE
|
||||
select CPU_HAS_ICACHE
|
||||
help
|
||||
If y, the SoC uses an ARC EM6 CPU
|
||||
|
||||
config CPU_HS3X
|
||||
bool
|
||||
select CPU_ARCHS
|
||||
select CPU_HAS_DCACHE
|
||||
select CPU_HAS_ICACHE
|
||||
help
|
||||
If y, the SoC uses an ARC HS3x or HS4x CPU
|
||||
|
||||
@@ -93,20 +87,10 @@ endif #ISA_ARCV2
|
||||
|
||||
if ISA_ARCV3
|
||||
|
||||
config CPU_HS5X
|
||||
bool
|
||||
select CPU_ARCHS
|
||||
select CPU_HAS_DCACHE
|
||||
select CPU_HAS_ICACHE
|
||||
help
|
||||
If y, the SoC uses an ARC HS6x CPU
|
||||
|
||||
config CPU_HS6X
|
||||
bool
|
||||
select CPU_ARCHS
|
||||
select 64BIT
|
||||
select CPU_HAS_DCACHE
|
||||
select CPU_HAS_ICACHE
|
||||
help
|
||||
If y, the SoC uses an ARC HS6x CPU
|
||||
|
||||
@@ -152,7 +136,6 @@ config NUM_IRQS
|
||||
config RGF_NUM_BANKS
|
||||
int "Number of General Purpose Register Banks"
|
||||
depends on ARC_FIRQ
|
||||
depends on NUM_IRQ_PRIO_LEVELS > 1
|
||||
range 1 2
|
||||
default 2
|
||||
help
|
||||
@@ -162,16 +145,10 @@ config RGF_NUM_BANKS
|
||||
If fast interrupts are supported but there is only 1
|
||||
register bank, the fast interrupt handler must save
|
||||
and restore general purpose registers.
|
||||
NOTE: it's required to have more than one interrupt priority level
|
||||
to use second register bank - otherwise all interrupts will use
|
||||
same register bank. Such configuration isn't supported in software
|
||||
and it is not beneficial from the performance point of view.
|
||||
|
||||
config ARC_FIRQ
|
||||
bool "FIRQ enable"
|
||||
depends on ISA_ARCV2
|
||||
depends on NUM_IRQ_PRIO_LEVELS > 1
|
||||
depends on !ARC_HAS_SECURE
|
||||
default y
|
||||
help
|
||||
Fast interrupts are supported (FIRQ). If FIRQ enabled, for interrupts
|
||||
@@ -179,13 +156,9 @@ config ARC_FIRQ
|
||||
other regs will be saved according to the number of register bank;
|
||||
If FIRQ is disabled, the handle of interrupts with highest priority
|
||||
will be same with other interrupts.
|
||||
NOTE: we don't allow the configuration with FIRQ enabled and only one
|
||||
interrupt priority level (so all interrupts are FIRQ). Such
|
||||
configuration isn't supported in software and it is not beneficial
|
||||
from the performance point of view.
|
||||
|
||||
config ARC_FIRQ_STACK
|
||||
bool "Separate firq stack"
|
||||
bool "Enable separate firq stack"
|
||||
depends on ARC_FIRQ && RGF_NUM_BANKS > 1
|
||||
help
|
||||
Use separate stack for FIRQ handing. When the fast irq is also a direct
|
||||
@@ -237,7 +210,7 @@ config ARC_STACK_PROTECTION
|
||||
prioritized over the MPU-based stack guard.
|
||||
|
||||
config ARC_USE_UNALIGNED_MEM_ACCESS
|
||||
bool "Unaligned access in HW"
|
||||
bool "Enable unaligned access in HW"
|
||||
default y if CPU_ARCHS
|
||||
depends on (CPU_ARCEM && !ARC_HAS_SECURE) || CPU_ARCHS
|
||||
help
|
||||
@@ -279,7 +252,8 @@ config CODE_DENSITY
|
||||
|
||||
config ARC_HAS_ACCL_REGS
|
||||
bool "Reg Pair ACCL:ACCH (FPU and/or MPY > 6)"
|
||||
default y if CPU_HS3X || CPU_HS5X || CPU_HS6X
|
||||
default y if CPU_HS3X
|
||||
default y if FPU
|
||||
help
|
||||
Depending on the configuration, CPU can contain accumulator reg-pair
|
||||
(also referred to as r58:r59). These can also be used by gcc as GPR so
|
||||
@@ -338,13 +312,11 @@ config ARC_NORMAL_FIRMWARE
|
||||
resources of the ARC processors, and, therefore, it shall avoid
|
||||
accessing them.
|
||||
|
||||
source "arch/arc/core/dsp/Kconfig"
|
||||
|
||||
menu "ARC MPU Options"
|
||||
depends on CPU_HAS_MPU
|
||||
|
||||
config ARC_MPU_ENABLE
|
||||
bool "Memory Protection Unit (MPU)"
|
||||
bool "Enable MPU"
|
||||
select ARC_MPU
|
||||
help
|
||||
Enable MPU
|
||||
@@ -394,7 +366,7 @@ config IDLE_STACK_SIZE
|
||||
config IPM_CONSOLE_STACK_SIZE
|
||||
default 2048 if 64BIT
|
||||
|
||||
config TEST_EXTRA_STACK_SIZE
|
||||
config TEST_EXTRA_STACKSIZE
|
||||
default 2048 if 64BIT
|
||||
|
||||
config CMSIS_THREAD_MAX_STACK_SIZE
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if(CONFIG_ARCMWDT_LIBC OR CONFIG_CPP)
|
||||
if(CONFIG_ARCMWDT_LIBC OR CONFIG_CPLUSPLUS)
|
||||
zephyr_sources(arcmwdt-dtr-stubs.c)
|
||||
endif()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <toolchain.h>
|
||||
|
||||
__weak void *__dso_handle;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ zephyr_library_sources(
|
||||
vector_table.c
|
||||
)
|
||||
|
||||
zephyr_library_sources_ifdef(CONFIG_ARCH_CACHE cache.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_CACHE_MANAGEMENT cache.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_ARC_FIRQ fast_irq.S)
|
||||
|
||||
zephyr_library_sources_ifdef(CONFIG_IRQ_OFFLOAD irq_offload.c)
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/arch/cpu.h>
|
||||
#include <zephyr/spinlock.h>
|
||||
#include <kernel.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <spinlock.h>
|
||||
#include <kernel_internal.h>
|
||||
|
||||
static struct k_spinlock arc_connect_spinlock;
|
||||
|
||||
@@ -9,18 +9,24 @@
|
||||
* @brief codes required for ARC multicore and Zephyr smp support
|
||||
*
|
||||
*/
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/kernel_structs.h>
|
||||
#include <device.h>
|
||||
#include <kernel.h>
|
||||
#include <kernel_structs.h>
|
||||
#include <ksched.h>
|
||||
#include <zephyr/init.h>
|
||||
#include <zephyr/irq.h>
|
||||
#include <arc_irq_offload.h>
|
||||
#include <soc.h>
|
||||
#include <init.h>
|
||||
|
||||
|
||||
#ifndef IRQ_ICI
|
||||
#define IRQ_ICI 19
|
||||
#endif
|
||||
|
||||
#define ARCV2_ICI_IRQ_PRIORITY 1
|
||||
|
||||
volatile struct {
|
||||
arch_cpustart_t fn;
|
||||
void *arg;
|
||||
} arc_cpu_init[CONFIG_MP_MAX_NUM_CPUS];
|
||||
} arc_cpu_init[CONFIG_MP_NUM_CPUS];
|
||||
|
||||
/*
|
||||
* arc_cpu_wake_flag is used to sync up master core and slave cores
|
||||
@@ -36,7 +42,7 @@ volatile char *arc_cpu_sp;
|
||||
* _curr_cpu is used to record the struct of _cpu_t of each cpu.
|
||||
* for efficient usage in assembly
|
||||
*/
|
||||
volatile _cpu_t *_curr_cpu[CONFIG_MP_MAX_NUM_CPUS];
|
||||
volatile _cpu_t *_curr_cpu[CONFIG_MP_NUM_CPUS];
|
||||
|
||||
/* Called from Zephyr initialization */
|
||||
void arch_start_cpu(int cpu_num, k_thread_stack_t *stack, int sz,
|
||||
@@ -50,7 +56,7 @@ void arch_start_cpu(int cpu_num, k_thread_stack_t *stack, int sz,
|
||||
* arc_cpu_wake_flag will protect arc_cpu_sp that
|
||||
* only one slave cpu can read it per time
|
||||
*/
|
||||
arc_cpu_sp = Z_KERNEL_STACK_BUFFER(stack) + sz;
|
||||
arc_cpu_sp = Z_THREAD_STACK_BUFFER(stack) + sz;
|
||||
|
||||
arc_cpu_wake_flag = cpu_num;
|
||||
|
||||
@@ -65,14 +71,7 @@ static void arc_connect_debug_mask_update(int cpu_num)
|
||||
{
|
||||
uint32_t core_mask = 1 << cpu_num;
|
||||
|
||||
/*
|
||||
* MDB debugger may modify debug_select and debug_mask registers on start, so we can't
|
||||
* rely on debug_select reset value.
|
||||
*/
|
||||
if (cpu_num != ARC_MP_PRIMARY_CPU_ID) {
|
||||
core_mask |= z_arc_connect_debug_select_read();
|
||||
}
|
||||
|
||||
core_mask |= z_arc_connect_debug_select_read();
|
||||
z_arc_connect_debug_select_set(core_mask);
|
||||
/* Debugger halts cores at all conditions:
|
||||
* ARC_CONNECT_CMD_DEBUG_MASK_H: Core global halt.
|
||||
@@ -86,8 +85,6 @@ static void arc_connect_debug_mask_update(int cpu_num)
|
||||
}
|
||||
#endif
|
||||
|
||||
void arc_core_private_intc_init(void);
|
||||
|
||||
/* the C entry of slave cores */
|
||||
void z_arc_slave_start(int cpu_num)
|
||||
{
|
||||
@@ -105,14 +102,9 @@ void z_arc_slave_start(int cpu_num)
|
||||
|
||||
z_irq_setup();
|
||||
|
||||
arc_core_private_intc_init();
|
||||
|
||||
arc_irq_offload_init_smp();
|
||||
|
||||
z_arc_connect_ici_clear();
|
||||
z_irq_priority_set(DT_IRQN(DT_NODELABEL(ici)),
|
||||
DT_IRQ(DT_NODELABEL(ici), priority), 0);
|
||||
irq_enable(DT_IRQN(DT_NODELABEL(ici)));
|
||||
z_irq_priority_set(IRQ_ICI, ARCV2_ICI_IRQ_PRIORITY, 0);
|
||||
irq_enable(IRQ_ICI);
|
||||
#endif
|
||||
/* call the function set by arch_start_cpu */
|
||||
fn = arc_cpu_init[cpu_num].fn;
|
||||
@@ -138,9 +130,7 @@ void arch_sched_ipi(void)
|
||||
/* broadcast sched_ipi request to other cores
|
||||
* if the target is current core, hardware will ignore it
|
||||
*/
|
||||
unsigned int num_cpus = arch_num_cpus();
|
||||
|
||||
for (i = 0U; i < num_cpus; i++) {
|
||||
for (i = 0U; i < CONFIG_MP_NUM_CPUS; i++) {
|
||||
z_arc_connect_ici_generate(i);
|
||||
}
|
||||
}
|
||||
@@ -157,17 +147,16 @@ static int arc_smp_init(const struct device *dev)
|
||||
|
||||
if (bcr.dbg) {
|
||||
/* configure inter-core debug unit if available */
|
||||
arc_connect_debug_mask_update(ARC_MP_PRIMARY_CPU_ID);
|
||||
arc_connect_debug_mask_update(0);
|
||||
}
|
||||
|
||||
if (bcr.ipi) {
|
||||
/* register ici interrupt, just need master core to register once */
|
||||
z_arc_connect_ici_clear();
|
||||
IRQ_CONNECT(DT_IRQN(DT_NODELABEL(ici)),
|
||||
DT_IRQ(DT_NODELABEL(ici), priority),
|
||||
sched_ipi_handler, NULL, 0);
|
||||
IRQ_CONNECT(IRQ_ICI, ARCV2_ICI_IRQ_PRIORITY,
|
||||
sched_ipi_handler, NULL, 0);
|
||||
|
||||
irq_enable(DT_IRQN(DT_NODELABEL(ici)));
|
||||
irq_enable(IRQ_ICI);
|
||||
} else {
|
||||
__ASSERT(0,
|
||||
"ARC connect has no inter-core interrupt\n");
|
||||
@@ -179,7 +168,7 @@ static int arc_smp_init(const struct device *dev)
|
||||
z_arc_connect_gfrc_enable();
|
||||
|
||||
/* when all cores halt, gfrc halt */
|
||||
z_arc_connect_gfrc_core_set((1 << arch_num_cpus()) - 1);
|
||||
z_arc_connect_gfrc_core_set((1 << CONFIG_MP_NUM_CPUS) - 1);
|
||||
z_arc_connect_gfrc_clear();
|
||||
} else {
|
||||
__ASSERT(0,
|
||||
|
||||
@@ -13,16 +13,16 @@
|
||||
* This module contains functions for manipulation of the d-cache.
|
||||
*/
|
||||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/arch/cpu.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <zephyr/cache.h>
|
||||
#include <zephyr/linker/linker-defs.h>
|
||||
#include <zephyr/arch/arc/v2/aux_regs.h>
|
||||
#include <kernel.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <sys/util.h>
|
||||
#include <toolchain.h>
|
||||
#include <cache.h>
|
||||
#include <linker/linker-defs.h>
|
||||
#include <arch/arc/v2/aux_regs.h>
|
||||
#include <kernel_internal.h>
|
||||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/init.h>
|
||||
#include <sys/__assert.h>
|
||||
#include <init.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#if defined(CONFIG_DCACHE_LINE_SIZE_DETECT)
|
||||
@@ -40,6 +40,7 @@ size_t sys_cache_line_size;
|
||||
#define DC_CTRL_INDIRECT_ACCESS 0x20 /* indirect access mode */
|
||||
#define DC_CTRL_OP_SUCCEEDED 0x4 /* d-cache operation succeeded */
|
||||
|
||||
|
||||
static bool dcache_available(void)
|
||||
{
|
||||
unsigned long val = z_arc_v2_aux_reg_read(_ARC_V2_D_CACHE_BUILD);
|
||||
@@ -60,12 +61,7 @@ void arch_dcache_enable(void)
|
||||
dcache_dc_ctrl(DC_CTRL_DC_ENABLE);
|
||||
}
|
||||
|
||||
void arch_dcache_disable(void)
|
||||
{
|
||||
/* nothing */
|
||||
}
|
||||
|
||||
int arch_dcache_flush_range(void *start_addr_ptr, size_t size)
|
||||
static void arch_dcache_flush(void *start_addr_ptr, size_t size)
|
||||
{
|
||||
size_t line_size = sys_cache_data_line_size_get();
|
||||
uintptr_t start_addr = (uintptr_t)start_addr_ptr;
|
||||
@@ -73,7 +69,7 @@ int arch_dcache_flush_range(void *start_addr_ptr, size_t size)
|
||||
unsigned int key;
|
||||
|
||||
if (!dcache_available() || (size == 0U) || line_size == 0U) {
|
||||
return -ENOTSUP;
|
||||
return;
|
||||
}
|
||||
|
||||
end_addr = start_addr + size;
|
||||
@@ -99,10 +95,9 @@ int arch_dcache_flush_range(void *start_addr_ptr, size_t size)
|
||||
|
||||
arch_irq_unlock(key); /* --exit critical section-- */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int arch_dcache_invd_range(void *start_addr_ptr, size_t size)
|
||||
static void arch_dcache_invd(void *start_addr_ptr, size_t size)
|
||||
{
|
||||
size_t line_size = sys_cache_data_line_size_get();
|
||||
uintptr_t start_addr = (uintptr_t)start_addr_ptr;
|
||||
@@ -110,7 +105,7 @@ int arch_dcache_invd_range(void *start_addr_ptr, size_t size)
|
||||
unsigned int key;
|
||||
|
||||
if (!dcache_available() || (size == 0U) || line_size == 0U) {
|
||||
return -ENOTSUP;
|
||||
return;
|
||||
}
|
||||
end_addr = start_addr + size;
|
||||
start_addr = ROUND_DOWN(start_addr, line_size);
|
||||
@@ -125,30 +120,25 @@ int arch_dcache_invd_range(void *start_addr_ptr, size_t size)
|
||||
start_addr += line_size;
|
||||
} while (start_addr < end_addr);
|
||||
irq_unlock(key); /* -exit critical section- */
|
||||
}
|
||||
|
||||
int arch_dcache_range(void *addr, size_t size, int op)
|
||||
{
|
||||
if (op == K_CACHE_INVD) {
|
||||
/*
|
||||
* TODO: On invalidate we can contextually flush by setting the
|
||||
* DC_CTRL_INVALID_FLUSH bit
|
||||
*/
|
||||
arch_dcache_invd(addr, size);
|
||||
} else if (op == K_CACHE_WB) {
|
||||
arch_dcache_flush(addr, size);
|
||||
} else {
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int arch_dcache_flush_and_invd_range(void *start_addr_ptr, size_t size)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
int arch_dcache_flush_all(void)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
int arch_dcache_invd_all(void)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
int arch_dcache_flush_and_invd_all(void)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_DCACHE_LINE_SIZE_DETECT)
|
||||
static void init_dcache_line_size(void)
|
||||
{
|
||||
@@ -167,55 +157,6 @@ size_t arch_dcache_line_size_get(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
void arch_icache_enable(void)
|
||||
{
|
||||
/* nothing */
|
||||
}
|
||||
|
||||
void arch_icache_disable(void)
|
||||
{
|
||||
/* nothing */
|
||||
}
|
||||
|
||||
int arch_icache_flush_all(void)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
int arch_icache_invd_all(void)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
int arch_icache_flush_and_invd_all(void)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
int arch_icache_flush_range(void *addr, size_t size)
|
||||
{
|
||||
ARG_UNUSED(addr);
|
||||
ARG_UNUSED(size);
|
||||
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
int arch_icache_invd_range(void *addr, size_t size)
|
||||
{
|
||||
ARG_UNUSED(addr);
|
||||
ARG_UNUSED(size);
|
||||
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
int arch_icache_flush_and_invd_range(void *addr, size_t size)
|
||||
{
|
||||
ARG_UNUSED(addr);
|
||||
ARG_UNUSED(size);
|
||||
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int init_dcache(const struct device *unused)
|
||||
{
|
||||
ARG_UNUSED(unused);
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
* CPU power management routines.
|
||||
*/
|
||||
|
||||
#include <zephyr/kernel_structs.h>
|
||||
#include <kernel_structs.h>
|
||||
#include <offsets_short.h>
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <zephyr/linker/sections.h>
|
||||
#include <zephyr/arch/cpu.h>
|
||||
#include <zephyr/arch/arc/asm-compat/assembler.h>
|
||||
#include <toolchain.h>
|
||||
#include <linker/sections.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <arch/arc/asm-compat/assembler.h>
|
||||
|
||||
GTEXT(arch_cpu_idle)
|
||||
GTEXT(arch_cpu_atomic_idle)
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
# Digital Signal Processing (DSP) configuration options
|
||||
|
||||
# Copyright (c) 2022 Synopsys
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config ARC_HAS_DSP
|
||||
bool
|
||||
help
|
||||
This option is enabled when the ARC CPU has hardware DSP unit.
|
||||
|
||||
menu "ARC DSP Options"
|
||||
depends on ARC_HAS_DSP
|
||||
|
||||
config ARC_DSP
|
||||
bool "digital signal processing (DSP)"
|
||||
help
|
||||
This option enables DSP and DSP instructions.
|
||||
|
||||
config ARC_DSP_SHARING
|
||||
bool "DSP register sharing"
|
||||
depends on ARC_DSP && MULTITHREADING
|
||||
select ARC_HAS_ACCL_REGS
|
||||
help
|
||||
This option enables preservation of the hardware DSP registers
|
||||
across context switches to allow multiple threads to perform concurrent
|
||||
DSP operations.
|
||||
|
||||
config ARC_DSP_BFLY_SHARING
|
||||
bool "ARC complex DSP operation"
|
||||
depends on ARC_DSP && CPU_ARCEM
|
||||
help
|
||||
This option is to enable Zephyr to store and restore DSP_BFLY0
|
||||
and FFT_CTRL registers during context switch. This option is
|
||||
only required when butterfly instructions are used in
|
||||
multi-thread.
|
||||
|
||||
config ARC_XY_ENABLE
|
||||
bool "ARC address generation unit registers"
|
||||
help
|
||||
Processors with XY memory and AGU registers can configure this
|
||||
option to accelerate DSP instrctions.
|
||||
|
||||
config ARC_AGU_SHARING
|
||||
bool "ARC address generation unit register sharing"
|
||||
depends on ARC_XY_ENABLE && MULTITHREADING
|
||||
default y if ARC_DSP_SHARING
|
||||
help
|
||||
This option enables preservation of the hardware AGU registers
|
||||
across context switches to allow multiple threads to perform concurrent
|
||||
operations on XY memory. Save and restore small size AGU registers is
|
||||
set as default, including 4 address pointers regs, 2 address offset regs
|
||||
and 4 modifiers regs.
|
||||
|
||||
config ARC_AGU_MEDIUM
|
||||
bool "ARC AGU medium size register"
|
||||
depends on ARC_AGU_SHARING
|
||||
help
|
||||
Save and restore medium AGU registers, including 8 address pointers regs,
|
||||
4 address offset regs and 12 modifiers regs.
|
||||
|
||||
config ARC_AGU_LARGE
|
||||
bool "ARC AGU large size register"
|
||||
depends on ARC_AGU_SHARING
|
||||
select ARC_AGU_MEDIUM
|
||||
help
|
||||
Save and restore large AGU registers, including 12 address pointers regs,
|
||||
8 address offset regs and 24 modifiers regs.
|
||||
|
||||
endmenu
|
||||
@@ -1,70 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Synopsys.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief ARCv2 DSP and AGU structure member offset definition file
|
||||
*
|
||||
*/
|
||||
#ifdef CONFIG_ARC_DSP_SHARING
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, dsp_ctrl);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, acc0_glo);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, acc0_ghi);
|
||||
#ifdef CONFIG_ARC_DSP_BFLY_SHARING
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, dsp_bfly0);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, dsp_fft_ctrl);
|
||||
#endif
|
||||
#endif
|
||||
#ifdef CONFIG_ARC_AGU_SHARING
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_ap0);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_ap1);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_ap2);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_ap3);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_os0);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_os1);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_mod0);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_mod1);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_mod2);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_mod3);
|
||||
#ifdef CONFIG_ARC_AGU_MEDIUM
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_ap4);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_ap5);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_ap6);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_ap7);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_os2);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_os3);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_mod4);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_mod5);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_mod6);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_mod7);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_mod8);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_mod9);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_mod10);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_mod11);
|
||||
#endif
|
||||
#ifdef CONFIG_ARC_AGU_LARGE
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_ap8);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_ap9);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_ap10);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_ap11);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_os4);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_os5);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_os6);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_os7);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_mod12);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_mod13);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_mod14);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_mod15);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_mod16);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_mod17);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_mod18);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_mod19);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_mod20);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_mod21);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_mod22);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, agu_mod23);
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,262 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Synopsys.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief save and load macro for ARCv2 DSP and AGU regs
|
||||
*
|
||||
*/
|
||||
.macro _save_dsp_regs
|
||||
#ifdef CONFIG_ARC_DSP_SHARING
|
||||
ld_s r13, [r2, ___thread_base_t_user_options_OFFSET]
|
||||
bbit0 r13, K_DSP_IDX, dsp_skip_save
|
||||
lr r13, [_ARC_V2_DSP_CTRL]
|
||||
st_s r13, [sp, ___callee_saved_stack_t_dsp_ctrl_OFFSET]
|
||||
lr r13, [_ARC_V2_ACC0_GLO]
|
||||
st_s r13, [sp, ___callee_saved_stack_t_acc0_glo_OFFSET]
|
||||
lr r13, [_ARC_V2_ACC0_GHI]
|
||||
st_s r13, [sp, ___callee_saved_stack_t_acc0_ghi_OFFSET]
|
||||
#ifdef CONFIG_ARC_DSP_BFLY_SHARING
|
||||
lr r13, [_ARC_V2_DSP_BFLY0]
|
||||
st_s r13, [sp, ___callee_saved_stack_t_dsp_bfly0_OFFSET]
|
||||
lr r13, [_ARC_V2_DSP_FFT_CTRL]
|
||||
st_s r13, [sp, ___callee_saved_stack_t_dsp_fft_ctrl_OFFSET]
|
||||
#endif
|
||||
#endif
|
||||
dsp_skip_save :
|
||||
#ifdef CONFIG_ARC_AGU_SHARING
|
||||
_save_agu_regs
|
||||
#endif
|
||||
.endm
|
||||
|
||||
.macro _save_agu_regs
|
||||
#ifdef CONFIG_ARC_AGU_SHARING
|
||||
ld_s r13, [r2, ___thread_base_t_user_options_OFFSET]
|
||||
btst r13, K_AGU_IDX
|
||||
|
||||
jeq agu_skip_save
|
||||
|
||||
lr r13, [_ARC_V2_AGU_AP0]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_ap0_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_AP1]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_ap1_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_AP2]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_ap2_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_AP3]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_ap3_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_OS0]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_os0_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_OS1]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_os1_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_MOD0]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_mod0_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_MOD1]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_mod1_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_MOD2]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_mod2_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_MOD3]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_mod3_OFFSET]
|
||||
#ifdef CONFIG_ARC_AGU_MEDIUM
|
||||
lr r13, [_ARC_V2_AGU_AP4]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_ap4_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_AP5]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_ap5_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_AP6]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_ap6_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_AP7]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_ap7_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_OS2]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_os2_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_OS3]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_os3_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_MOD4]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_mod4_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_MOD5]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_mod5_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_MOD6]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_mod6_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_MOD7]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_mod7_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_MOD8]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_mod8_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_MOD9]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_mod9_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_MOD10]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_mod10_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_MOD11]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_mod11_OFFSET]
|
||||
#endif
|
||||
#ifdef CONFIG_ARC_AGU_LARGE
|
||||
lr r13, [_ARC_V2_AGU_AP8]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_ap8_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_AP9]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_ap9_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_AP10]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_ap10_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_AP11]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_ap11_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_OS4]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_os4_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_OS5]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_os5_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_OS6]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_os6_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_OS7]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_os7_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_MOD12]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_mod12_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_MOD13]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_mod13_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_MOD14]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_mod14_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_MOD15]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_mod15_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_MOD16]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_mod16_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_MOD17]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_mod17_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_MOD18]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_mod18_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_MOD19]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_mod19_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_MOD20]
|
||||
st r13, [sp, ___callee_saved_stack_t_agu_mod20_OFFSET]
|
||||
lr r13, [_ARC_V2_AGU_MOD21]
|
||||
_st32_huge_offset r13, sp, ___callee_saved_stack_t_agu_mod21_OFFSET, r1
|
||||
lr r13, [_ARC_V2_AGU_MOD22]
|
||||
_st32_huge_offset r13, sp, ___callee_saved_stack_t_agu_mod22_OFFSET, r1
|
||||
lr r13, [_ARC_V2_AGU_MOD23]
|
||||
_st32_huge_offset r13, sp, ___callee_saved_stack_t_agu_mod23_OFFSET, r1
|
||||
#endif
|
||||
#endif
|
||||
agu_skip_save :
|
||||
.endm
|
||||
|
||||
.macro _load_dsp_regs
|
||||
#ifdef CONFIG_ARC_DSP_SHARING
|
||||
ld_s r13, [r2, ___thread_base_t_user_options_OFFSET]
|
||||
bbit0 r13, K_DSP_IDX, dsp_skip_load
|
||||
ld_s r13, [sp, ___callee_saved_stack_t_dsp_ctrl_OFFSET]
|
||||
sr r13, [_ARC_V2_DSP_CTRL]
|
||||
ld_s r13, [sp, ___callee_saved_stack_t_acc0_glo_OFFSET]
|
||||
sr r13, [_ARC_V2_ACC0_GLO]
|
||||
ld_s r13, [sp, ___callee_saved_stack_t_acc0_ghi_OFFSET]
|
||||
sr r13, [_ARC_V2_ACC0_GHI]
|
||||
#ifdef CONFIG_ARC_DSP_BFLY_SHARING
|
||||
ld_s r13, [sp, ___callee_saved_stack_t_dsp_bfly0_OFFSET]
|
||||
sr r13, [_ARC_V2_DSP_BFLY0]
|
||||
ld_s r13, [sp, ___callee_saved_stack_t_dsp_fft_ctrl_OFFSET]
|
||||
sr r13, [_ARC_V2_DSP_FFT_CTRL]
|
||||
#endif
|
||||
#endif
|
||||
dsp_skip_load :
|
||||
#ifdef CONFIG_ARC_AGU_SHARING
|
||||
_load_agu_regs
|
||||
#endif
|
||||
.endm
|
||||
|
||||
.macro _load_agu_regs
|
||||
#ifdef CONFIG_ARC_AGU_SHARING
|
||||
ld_s r13, [r2, ___thread_base_t_user_options_OFFSET]
|
||||
btst r13, K_AGU_IDX
|
||||
|
||||
jeq agu_skip_load
|
||||
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_ap0_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_AP0]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_ap1_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_AP1]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_ap2_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_AP2]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_ap3_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_AP3]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_os0_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_OS0]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_os1_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_OS1]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_mod0_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_MOD0]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_mod1_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_MOD1]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_mod2_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_MOD2]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_mod3_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_MOD3]
|
||||
#ifdef CONFIG_ARC_AGU_MEDIUM
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_ap4_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_AP4]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_ap5_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_AP5]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_ap6_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_AP6]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_ap7_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_AP7]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_os2_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_OS2]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_os3_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_OS3]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_mod4_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_MOD4]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_mod5_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_MOD5]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_mod6_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_MOD6]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_mod7_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_MOD7]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_mod8_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_MOD8]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_mod9_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_MOD9]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_mod10_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_MOD10]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_mod11_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_MOD11]
|
||||
#endif
|
||||
#ifdef CONFIG_ARC_AGU_LARGE
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_ap8_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_AP8]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_ap9_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_AP9]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_ap10_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_AP10]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_ap11_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_AP11]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_os4_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_OS4]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_os5_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_OS5]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_os6_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_OS6]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_os7_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_OS7]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_mod12_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_MOD12]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_mod13_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_MOD13]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_mod14_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_MOD14]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_mod15_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_MOD15]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_mod16_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_MOD16]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_mod17_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_MOD17]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_mod18_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_MOD18]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_mod19_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_MOD19]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_mod20_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_MOD20]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_mod21_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_MOD21]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_mod22_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_MOD22]
|
||||
ld r13, [sp, ___callee_saved_stack_t_agu_mod23_OFFSET]
|
||||
sr r13, [_ARC_V2_AGU_MOD23]
|
||||
#endif
|
||||
#endif
|
||||
agu_skip_load :
|
||||
.endm
|
||||
@@ -13,17 +13,18 @@
|
||||
* See isr_wrapper.S for details.
|
||||
*/
|
||||
|
||||
#include <zephyr/kernel_structs.h>
|
||||
#include <kernel_structs.h>
|
||||
#include <offsets_short.h>
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <zephyr/linker/sections.h>
|
||||
#include <zephyr/arch/cpu.h>
|
||||
#include <toolchain.h>
|
||||
#include <linker/sections.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <swap_macros.h>
|
||||
|
||||
GTEXT(_firq_enter)
|
||||
GTEXT(_firq_exit)
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Work to be done before handing control to a FIRQ ISR
|
||||
*
|
||||
* The processor switches to a second register bank so registers from the
|
||||
@@ -40,6 +41,8 @@ GTEXT(_firq_exit)
|
||||
* interrupt. An exception, however, can be taken.
|
||||
*
|
||||
* Assumption by _isr_demux: r3 is untouched by _firq_enter.
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
|
||||
SECTION_FUNC(TEXT, _firq_enter)
|
||||
@@ -128,7 +131,10 @@ firq_nest:
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Work to be done exiting a FIRQ
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
|
||||
SECTION_FUNC(TEXT, _firq_exit)
|
||||
@@ -145,13 +151,14 @@ SECTION_FUNC(TEXT, _firq_exit)
|
||||
|
||||
jne _firq_no_switch
|
||||
|
||||
/* sp is struct k_thread **old of z_arc_switch_in_isr which is a wrapper of
|
||||
* z_get_next_switch_handle. r0 contains the 1st thread in ready queue. If it isn't NULL,
|
||||
* then do switch to this thread.
|
||||
/* sp is struct k_thread **old of z_arc_switch_in_isr
|
||||
* which is a wrapper of z_get_next_switch_handle.
|
||||
* r0 contains the 1st thread in ready queue. if
|
||||
* it equals _current(r2) ,then do swap, or no swap.
|
||||
*/
|
||||
_get_next_switch_handle
|
||||
|
||||
CMPR r0, 0
|
||||
cmp r0, r2
|
||||
bne _firq_switch
|
||||
|
||||
/* fall to no switch */
|
||||
@@ -238,10 +245,10 @@ _firq_create_irq_stack_frame:
|
||||
ld r2, [r1, -8]
|
||||
#endif
|
||||
/* r2 is old thread */
|
||||
st _CAUSE_FIRQ, [r2, _thread_offset_to_relinquish_cause]
|
||||
|
||||
_irq_store_old_thread_callee_regs
|
||||
|
||||
st _CAUSE_FIRQ, [r2, _thread_offset_to_relinquish_cause]
|
||||
|
||||
/* mov new thread (r0) to r2 */
|
||||
|
||||
mov r2, r0
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
* ARCv2 CPUs.
|
||||
*/
|
||||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <kernel.h>
|
||||
#include <offsets_short.h>
|
||||
#include <zephyr/arch/cpu.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <logging/log.h>
|
||||
#include <kernel_arch_data.h>
|
||||
#include <zephyr/arch/arc/v2/exc.h>
|
||||
#include <arch/arc/v2/exc.h>
|
||||
|
||||
LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL);
|
||||
|
||||
|
||||
@@ -11,15 +11,15 @@
|
||||
* Common fault handler for ARCv2 processors.
|
||||
*/
|
||||
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <zephyr/linker/sections.h>
|
||||
#include <toolchain.h>
|
||||
#include <linker/sections.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <kernel.h>
|
||||
#include <kernel_internal.h>
|
||||
#include <zephyr/kernel_structs.h>
|
||||
#include <zephyr/exc_handle.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
#include <kernel_structs.h>
|
||||
#include <exc_handle.h>
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL);
|
||||
|
||||
#ifdef CONFIG_USERSPACE
|
||||
@@ -51,10 +51,8 @@ static const struct z_exc_handle exceptions[] = {
|
||||
*/
|
||||
static bool z_check_thread_stack_fail(const uint32_t fault_addr, uint32_t sp)
|
||||
{
|
||||
uint32_t guard_end, guard_start;
|
||||
|
||||
#if defined(CONFIG_MULTITHREADING)
|
||||
const struct k_thread *thread = _current;
|
||||
uint32_t guard_end, guard_start;
|
||||
|
||||
if (!thread) {
|
||||
/* TODO: Under what circumstances could we get here ? */
|
||||
@@ -88,7 +86,6 @@ static bool z_check_thread_stack_fail(const uint32_t fault_addr, uint32_t sp)
|
||||
guard_end = thread->stack_info.start;
|
||||
guard_start = guard_end - Z_ARC_STACK_GUARD_SIZE;
|
||||
}
|
||||
#endif /* CONFIG_MULTITHREADING */
|
||||
|
||||
/* treat any MPU exceptions within the guard region as a stack
|
||||
* overflow.As some instrustions
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
* Fault handlers for ARCv2 processors.
|
||||
*/
|
||||
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <zephyr/linker/sections.h>
|
||||
#include <zephyr/arch/cpu.h>
|
||||
#include <toolchain.h>
|
||||
#include <linker/sections.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <swap_macros.h>
|
||||
#include <zephyr/syscall.h>
|
||||
#include <zephyr/arch/arc/asm-compat/assembler.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/arc/asm-compat/assembler.h>
|
||||
|
||||
GTEXT(_Fault)
|
||||
GTEXT(__reset)
|
||||
@@ -34,6 +34,9 @@ GTEXT(__ev_extension)
|
||||
GTEXT(__ev_div_zero)
|
||||
GTEXT(__ev_dc_error)
|
||||
GTEXT(__ev_maligned)
|
||||
#ifdef CONFIG_IRQ_OFFLOAD
|
||||
GTEXT(z_irq_do_offload);
|
||||
#endif
|
||||
|
||||
.macro _save_exc_regs_into_stack
|
||||
#ifdef CONFIG_ARC_HAS_SECURE
|
||||
@@ -116,7 +119,7 @@ _exc_return:
|
||||
|
||||
_get_next_switch_handle
|
||||
|
||||
BREQR r0, 0, _exc_return_from_exc
|
||||
BREQR r0, r2, _exc_return_from_exc
|
||||
|
||||
MOVR r2, r0
|
||||
|
||||
@@ -228,4 +231,38 @@ valid_syscall_id:
|
||||
|
||||
_do_non_syscall_trap:
|
||||
#endif /* CONFIG_USERSPACE */
|
||||
#ifdef CONFIG_IRQ_OFFLOAD
|
||||
/*
|
||||
* IRQ_OFFLOAD is to simulate interrupt handling through exception,
|
||||
* so its entry is different with normal exception handling, it is
|
||||
* handled in isr stack
|
||||
*/
|
||||
CMPR ilink, _TRAP_S_SCALL_IRQ_OFFLOAD
|
||||
bne _exc_entry
|
||||
/* save caller saved registers */
|
||||
_create_irq_stack_frame
|
||||
|
||||
_save_exc_regs_into_stack
|
||||
|
||||
/* check whether irq stack is used */
|
||||
_check_and_inc_int_nest_counter r0, r1
|
||||
|
||||
bne.d exc_nest_handle
|
||||
MOVR r0, sp
|
||||
|
||||
_get_curr_cpu_irq_stack sp
|
||||
exc_nest_handle:
|
||||
PUSHR r0
|
||||
|
||||
jl z_irq_do_offload
|
||||
|
||||
POPR sp
|
||||
|
||||
_dec_int_nest_counter r0, r1
|
||||
|
||||
_pop_irq_stack_frame
|
||||
|
||||
/* ERSTATUS, ERET are not changed, so ok to rtie */
|
||||
rtie
|
||||
#endif /* CONFIG_IRQ_OFFLOAD */
|
||||
b _exc_entry
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
* number from 16 to last IRQ number on the platform.
|
||||
*/
|
||||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/arch/cpu.h>
|
||||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <zephyr/linker/sections.h>
|
||||
#include <zephyr/sw_isr_table.h>
|
||||
#include <zephyr/irq.h>
|
||||
#include <zephyr/sys/printk.h>
|
||||
#include <kernel.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <sys/__assert.h>
|
||||
#include <toolchain.h>
|
||||
#include <linker/sections.h>
|
||||
#include <sw_isr_table.h>
|
||||
#include <irq.h>
|
||||
#include <sys/printk.h>
|
||||
|
||||
|
||||
/*
|
||||
@@ -32,14 +32,16 @@
|
||||
*/
|
||||
#if defined(CONFIG_ARC_FIRQ_STACK)
|
||||
#if defined(CONFIG_SMP)
|
||||
K_KERNEL_STACK_ARRAY_DEFINE(_firq_interrupt_stack, CONFIG_MP_MAX_NUM_CPUS,
|
||||
K_KERNEL_STACK_ARRAY_DEFINE(_firq_interrupt_stack, CONFIG_MP_NUM_CPUS,
|
||||
CONFIG_ARC_FIRQ_STACK_SIZE);
|
||||
#else
|
||||
K_KERNEL_STACK_DEFINE(_firq_interrupt_stack, CONFIG_ARC_FIRQ_STACK_SIZE);
|
||||
#endif
|
||||
|
||||
/**
|
||||
/*
|
||||
* @brief Set the stack pointer for firq handling
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
void z_arc_firq_stack_set(void)
|
||||
{
|
||||
@@ -82,68 +84,33 @@ void z_arc_firq_stack_set(void)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ARC CPU interrupt controllers hierarchy.
|
||||
*
|
||||
* Single-core (UP) case:
|
||||
*
|
||||
* --------------------------
|
||||
* | CPU core 0 |
|
||||
* --------------------------
|
||||
* | core 0 (private) |
|
||||
* | interrupt controller |
|
||||
* --------------------------
|
||||
* |
|
||||
* [internal interrupts]
|
||||
* [external interrupts]
|
||||
*
|
||||
*
|
||||
* Multi-core (SMP) case:
|
||||
*
|
||||
* -------------------------- --------------------------
|
||||
* | CPU core 0 | | CPU core 1 |
|
||||
* -------------------------- --------------------------
|
||||
* | core 0 (private) | | core 1 (private) |
|
||||
* | interrupt controller | | interrupt controller |
|
||||
* -------------------------- --------------------------
|
||||
* | | | | | |
|
||||
* | | [core 0 private internal interrupts] | | [core 1 private internal interrupts]
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | ------------------------------------------- |
|
||||
* | | IDU (Interrupt Distribution Unit) | |
|
||||
* | ------------------------------------------- |
|
||||
* | | |
|
||||
* | [common (shared) interrupts] |
|
||||
* | |
|
||||
* | |
|
||||
* [core 0 private external interrupts] [core 1 private external interrupts]
|
||||
*
|
||||
*
|
||||
*
|
||||
* The interrupts are grouped in HW in the same order - firstly internal interrupts
|
||||
* (with lowest line numbers in IVT), than common interrupts (if present), than external
|
||||
* interrupts (with highest line numbers in IVT).
|
||||
*
|
||||
* NOTE: in case of SMP system we currently support in Zephyr only private internal and common
|
||||
* interrupts, so the core-private external interrupts are currently not supported for SMP.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Enable an interrupt line
|
||||
*
|
||||
* Clear possible pending interrupts on the line, and enable the interrupt
|
||||
* line. After this call, the CPU will receive interrupts for the specified
|
||||
* @a irq.
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
void arch_irq_enable(unsigned int irq);
|
||||
|
||||
/**
|
||||
void arch_irq_enable(unsigned int irq)
|
||||
{
|
||||
z_arc_v2_irq_unit_int_enable(irq);
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief Disable an interrupt line
|
||||
*
|
||||
* Disable an interrupt line. After this call, the CPU will stop receiving
|
||||
* interrupts for the specified @a irq.
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
void arch_irq_disable(unsigned int irq);
|
||||
|
||||
void arch_irq_disable(unsigned int irq)
|
||||
{
|
||||
z_arc_v2_irq_unit_int_disable(irq);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return IRQ enable state
|
||||
@@ -151,57 +118,12 @@ void arch_irq_disable(unsigned int irq);
|
||||
* @param irq IRQ line
|
||||
* @return interrupt enable state, true or false
|
||||
*/
|
||||
int arch_irq_is_enabled(unsigned int irq);
|
||||
|
||||
#ifdef CONFIG_ARC_CONNECT
|
||||
|
||||
#define IRQ_NUM_TO_IDU_NUM(id) ((id) - ARC_CONNECT_IDU_IRQ_START)
|
||||
#define IRQ_IS_COMMON(id) ((id) >= ARC_CONNECT_IDU_IRQ_START)
|
||||
|
||||
void arch_irq_enable(unsigned int irq)
|
||||
{
|
||||
if (IRQ_IS_COMMON(irq)) {
|
||||
z_arc_connect_idu_set_mask(IRQ_NUM_TO_IDU_NUM(irq), 0x0);
|
||||
} else {
|
||||
z_arc_v2_irq_unit_int_enable(irq);
|
||||
}
|
||||
}
|
||||
|
||||
void arch_irq_disable(unsigned int irq)
|
||||
{
|
||||
if (IRQ_IS_COMMON(irq)) {
|
||||
z_arc_connect_idu_set_mask(IRQ_NUM_TO_IDU_NUM(irq), 0x1);
|
||||
} else {
|
||||
z_arc_v2_irq_unit_int_disable(irq);
|
||||
}
|
||||
}
|
||||
|
||||
int arch_irq_is_enabled(unsigned int irq)
|
||||
{
|
||||
if (IRQ_IS_COMMON(irq)) {
|
||||
return !z_arc_connect_idu_read_mask(IRQ_NUM_TO_IDU_NUM(irq));
|
||||
} else {
|
||||
return z_arc_v2_irq_unit_int_enabled(irq);
|
||||
}
|
||||
}
|
||||
#else
|
||||
void arch_irq_enable(unsigned int irq)
|
||||
{
|
||||
z_arc_v2_irq_unit_int_enable(irq);
|
||||
}
|
||||
|
||||
void arch_irq_disable(unsigned int irq)
|
||||
{
|
||||
z_arc_v2_irq_unit_int_disable(irq);
|
||||
}
|
||||
|
||||
int arch_irq_is_enabled(unsigned int irq)
|
||||
{
|
||||
return z_arc_v2_irq_unit_int_enabled(irq);
|
||||
}
|
||||
#endif /* CONFIG_ARC_CONNECT */
|
||||
|
||||
/**
|
||||
/*
|
||||
* @internal
|
||||
*
|
||||
* @brief Set an interrupt's priority
|
||||
@@ -211,6 +133,8 @@ int arch_irq_is_enabled(unsigned int irq)
|
||||
|
||||
* The priority is verified if ASSERT_ON is enabled; max priority level
|
||||
* depends on CONFIG_NUM_IRQ_PRIO_LEVELS.
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
|
||||
void z_irq_priority_set(unsigned int irq, unsigned int prio, uint32_t flags)
|
||||
@@ -219,7 +143,7 @@ void z_irq_priority_set(unsigned int irq, unsigned int prio, uint32_t flags)
|
||||
|
||||
__ASSERT(prio < CONFIG_NUM_IRQ_PRIO_LEVELS,
|
||||
"invalid priority %d for irq %d", prio, irq);
|
||||
/* 0 -> CONFIG_NUM_IRQ_PRIO_LEVELS allocated to secure world
|
||||
/* 0 -> CONFIG_NUM_IRQ_PRIO_LEVELS allocted to secure world
|
||||
* left prio levels allocated to normal world
|
||||
*/
|
||||
#if defined(CONFIG_ARC_SECURE_FIRMWARE)
|
||||
@@ -232,11 +156,13 @@ void z_irq_priority_set(unsigned int irq, unsigned int prio, uint32_t flags)
|
||||
z_arc_v2_irq_unit_prio_set(irq, prio);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* @brief Spurious interrupt handler
|
||||
*
|
||||
* Installed in all dynamic interrupt slots at boot time. Throws an error if
|
||||
* called.
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
|
||||
void z_irq_spurious(const void *unused)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Intel corporation
|
||||
* Copyright (c) 2022 Synopsys
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -9,64 +8,26 @@
|
||||
* @file Software interrupts utility code - ARC implementation
|
||||
*/
|
||||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/irq_offload.h>
|
||||
#include <zephyr/init.h>
|
||||
#include <kernel.h>
|
||||
#include <irq_offload.h>
|
||||
|
||||
/* Choose a reasonable default for interrupt line which is used for irq_offload with the option
|
||||
* to override it by setting interrupt line via device tree.
|
||||
*/
|
||||
#if DT_NODE_EXISTS(DT_NODELABEL(test_irq_offload_line_0))
|
||||
#define IRQ_OFFLOAD_LINE DT_IRQN(DT_NODELABEL(test_irq_offload_line_0))
|
||||
#else
|
||||
/* Last two lined are already used in the IRQ tests, so we choose 3rd from the end line */
|
||||
#define IRQ_OFFLOAD_LINE (CONFIG_NUM_IRQS - 3)
|
||||
#endif
|
||||
static irq_offload_routine_t offload_routine;
|
||||
static const void *offload_param;
|
||||
|
||||
#define IRQ_OFFLOAD_PRIO 0
|
||||
|
||||
#define CURR_CPU (IS_ENABLED(CONFIG_SMP) ? arch_curr_cpu()->id : 0)
|
||||
|
||||
static struct {
|
||||
volatile irq_offload_routine_t fn;
|
||||
const void *volatile arg;
|
||||
} offload_params[CONFIG_MP_MAX_NUM_CPUS];
|
||||
|
||||
static void arc_irq_offload_handler(const void *unused)
|
||||
/* Called by trap_s exception handler */
|
||||
void z_irq_do_offload(void)
|
||||
{
|
||||
ARG_UNUSED(unused);
|
||||
|
||||
offload_params[CURR_CPU].fn(offload_params[CURR_CPU].arg);
|
||||
offload_routine(offload_param);
|
||||
}
|
||||
|
||||
void arch_irq_offload(irq_offload_routine_t routine, const void *parameter)
|
||||
{
|
||||
offload_params[CURR_CPU].fn = routine;
|
||||
offload_params[CURR_CPU].arg = parameter;
|
||||
compiler_barrier();
|
||||
|
||||
z_arc_v2_aux_reg_write(_ARC_V2_AUX_IRQ_HINT, IRQ_OFFLOAD_LINE);
|
||||
offload_routine = routine;
|
||||
offload_param = parameter;
|
||||
|
||||
__asm__ volatile("sync");
|
||||
__asm__ volatile ("trap_s %[id]"
|
||||
:
|
||||
: [id] "i"(_TRAP_S_SCALL_IRQ_OFFLOAD) : );
|
||||
|
||||
/* If _current was aborted in the offload routine, we shouldn't be here */
|
||||
__ASSERT_NO_MSG((_current->base.thread_state & _THREAD_DEAD) == 0);
|
||||
}
|
||||
|
||||
/* need to be executed on every core in the system */
|
||||
int arc_irq_offload_init(const struct device *unused)
|
||||
{
|
||||
ARG_UNUSED(unused);
|
||||
|
||||
IRQ_CONNECT(IRQ_OFFLOAD_LINE, IRQ_OFFLOAD_PRIO, arc_irq_offload_handler, NULL, 0);
|
||||
|
||||
/* The line is triggered and controlled with core private interrupt controller,
|
||||
* so even in case common (IDU) interrupt line usage on SMP we need to enable it not
|
||||
* with generic irq_enable() but via z_arc_v2_irq_unit_int_enable().
|
||||
*/
|
||||
z_arc_v2_irq_unit_int_enable(IRQ_OFFLOAD_LINE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
SYS_INIT(arc_irq_offload_init, POST_KERNEL, 0);
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
*/
|
||||
|
||||
#include <offsets_short.h>
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <zephyr/linker/sections.h>
|
||||
#include <zephyr/sw_isr_table.h>
|
||||
#include <zephyr/kernel_structs.h>
|
||||
#include <zephyr/arch/cpu.h>
|
||||
#include <toolchain.h>
|
||||
#include <linker/sections.h>
|
||||
#include <sw_isr_table.h>
|
||||
#include <kernel_structs.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <swap_macros.h>
|
||||
#include <zephyr/arch/arc/asm-compat/assembler.h>
|
||||
#include <arch/arc/asm-compat/assembler.h>
|
||||
|
||||
GTEXT(_isr_wrapper)
|
||||
GTEXT(_isr_demux)
|
||||
@@ -249,6 +249,8 @@ rirq_path:
|
||||
#if defined(CONFIG_PM)
|
||||
clri r0 /* do not interrupt exiting tickless idle operations */
|
||||
MOVR r1, _kernel
|
||||
/* z_kernel.idle is 32 bit despite of platform bittnes */
|
||||
ld_s r3, [r1, _kernel_offset_to_idle] /* requested idle duration */
|
||||
breq r3, 0, _skip_pm_save_idle_exit
|
||||
|
||||
st 0, [r1, _kernel_offset_to_idle] /* zero idle duration */
|
||||
@@ -272,13 +274,7 @@ SECTION_FUNC(TEXT, _isr_demux)
|
||||
PUSHR r30
|
||||
#ifdef CONFIG_ARC_HAS_ACCL_REGS
|
||||
PUSHR r58
|
||||
#ifndef CONFIG_64BIT
|
||||
PUSHR r59
|
||||
#endif /* !CONFIG_64BIT */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SCHED_THREAD_USAGE
|
||||
bl z_sched_usage_stop
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TRACING_ISR
|
||||
@@ -312,9 +308,7 @@ irq_hint_handled:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARC_HAS_ACCL_REGS
|
||||
#ifndef CONFIG_64BIT
|
||||
POPR r59
|
||||
#endif /* !CONFIG_64BIT */
|
||||
POPR r58
|
||||
#endif
|
||||
|
||||
|
||||
@@ -4,11 +4,12 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/init.h>
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/arch/arc/v2/mpu/arc_core_mpu.h>
|
||||
#include <zephyr/kernel_structs.h>
|
||||
#include <device.h>
|
||||
#include <init.h>
|
||||
#include <kernel.h>
|
||||
#include <soc.h>
|
||||
#include <arch/arc/v2/mpu/arc_core_mpu.h>
|
||||
#include <kernel_structs.h>
|
||||
|
||||
/*
|
||||
* @brief Configure MPU for the thread
|
||||
|
||||
@@ -4,16 +4,17 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/init.h>
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/arch/arc/v2/aux_regs.h>
|
||||
#include <zephyr/arch/arc/v2/mpu/arc_mpu.h>
|
||||
#include <zephyr/arch/arc/v2/mpu/arc_core_mpu.h>
|
||||
#include <zephyr/linker/linker-defs.h>
|
||||
#include <device.h>
|
||||
#include <init.h>
|
||||
#include <kernel.h>
|
||||
#include <soc.h>
|
||||
#include <arch/arc/v2/aux_regs.h>
|
||||
#include <arch/arc/v2/mpu/arc_mpu.h>
|
||||
#include <arch/arc/v2/mpu/arc_core_mpu.h>
|
||||
#include <linker/linker-defs.h>
|
||||
|
||||
#define LOG_LEVEL CONFIG_MPU_LOG_LEVEL
|
||||
#include <zephyr/logging/log.h>
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(mpu);
|
||||
|
||||
/**
|
||||
|
||||
@@ -132,7 +132,7 @@ static inline bool _is_user_accessible_region(uint32_t r_index, int write)
|
||||
return false;
|
||||
}
|
||||
#else /* CONFIG_ARC_NORMAL_FIRMWARE */
|
||||
/* the following functions are prepared for SECURE_FIRMWARE */
|
||||
/* the following functions are prepared for SECURE_FRIMWARE */
|
||||
static inline void _region_init(uint32_t index, uint32_t region_addr, uint32_t size,
|
||||
uint32_t region_attr)
|
||||
{
|
||||
|
||||
@@ -22,13 +22,10 @@
|
||||
* completeness.
|
||||
*/
|
||||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <kernel.h>
|
||||
#include <kernel_arch_data.h>
|
||||
#include <gen_offset.h>
|
||||
#include <kernel_offsets.h>
|
||||
#ifdef CONFIG_ARC_DSP_SHARING
|
||||
#include "../dsp/dsp_offsets.c"
|
||||
#endif
|
||||
|
||||
GEN_OFFSET_SYM(_thread_arch_t, relinquish_cause);
|
||||
#ifdef CONFIG_ARC_STACK_CHECKING
|
||||
@@ -107,9 +104,7 @@ GEN_OFFSET_SYM(_callee_saved_stack_t, user_sp);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, r30);
|
||||
#ifdef CONFIG_ARC_HAS_ACCL_REGS
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, r58);
|
||||
#ifndef CONFIG_64BIT
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, r59);
|
||||
#endif /* !CONFIG_64BIT */
|
||||
#endif
|
||||
#ifdef CONFIG_FPU_SHARING
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, fpu_status);
|
||||
@@ -120,8 +115,8 @@ GEN_OFFSET_SYM(_callee_saved_stack_t, dpfp2l);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, dpfp1h);
|
||||
GEN_OFFSET_SYM(_callee_saved_stack_t, dpfp1l);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
GEN_ABSOLUTE_SYM(___callee_saved_stack_t_SIZEOF, sizeof(_callee_saved_stack_t));
|
||||
|
||||
GEN_ABSOLUTE_SYM(_K_THREAD_NO_FLOAT_SIZEOF, sizeof(struct k_thread));
|
||||
|
||||
@@ -17,20 +17,23 @@
|
||||
*/
|
||||
|
||||
#include <zephyr/types.h>
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <zephyr/linker/linker-defs.h>
|
||||
#include <zephyr/arch/arc/v2/aux_regs.h>
|
||||
#include <zephyr/kernel_structs.h>
|
||||
#include <toolchain.h>
|
||||
#include <linker/linker-defs.h>
|
||||
#include <arch/arc/v2/aux_regs.h>
|
||||
#include <kernel_structs.h>
|
||||
#include <kernel_internal.h>
|
||||
|
||||
|
||||
/* XXX - keep for future use in full-featured cache APIs */
|
||||
#if 0
|
||||
/**
|
||||
*
|
||||
* @brief Disable the i-cache if present
|
||||
*
|
||||
* For those ARC CPUs that have a i-cache present,
|
||||
* invalidate the i-cache and then disable it.
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
|
||||
static void disable_icache(void)
|
||||
@@ -48,10 +51,13 @@ static void disable_icache(void)
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Invalidate the data cache if present
|
||||
*
|
||||
* For those ARC CPUs that have a data cache present,
|
||||
* invalidate the data cache.
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
|
||||
static void invalidate_dcache(void)
|
||||
@@ -69,9 +75,12 @@ static void invalidate_dcache(void)
|
||||
|
||||
extern FUNC_NORETURN void z_cstart(void);
|
||||
/**
|
||||
*
|
||||
* @brief Prepare to and run C code
|
||||
*
|
||||
* This routine prepares for the execution of and runs C code.
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
|
||||
void _PrepC(void)
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
* See isr_wrapper.S for details.
|
||||
*/
|
||||
|
||||
#include <zephyr/kernel_structs.h>
|
||||
#include <kernel_structs.h>
|
||||
#include <offsets_short.h>
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <zephyr/linker/sections.h>
|
||||
#include <zephyr/arch/cpu.h>
|
||||
#include <toolchain.h>
|
||||
#include <linker/sections.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <swap_macros.h>
|
||||
#include <zephyr/arch/arc/asm-compat/assembler.h>
|
||||
#include <arch/arc/asm-compat/assembler.h>
|
||||
|
||||
GTEXT(_rirq_enter)
|
||||
GTEXT(_rirq_exit)
|
||||
@@ -190,6 +190,7 @@ will be corrupted.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Work to be done before handing control to an IRQ ISR
|
||||
*
|
||||
* The processor pushes automatically all registers that need to be saved.
|
||||
@@ -197,6 +198,8 @@ will be corrupted.
|
||||
* automatic switch to the IRQ stack: this must be done in software.
|
||||
*
|
||||
* Assumption by _isr_demux: r3 is untouched by _rirq_enter.
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
|
||||
SECTION_FUNC(TEXT, _rirq_enter)
|
||||
@@ -225,7 +228,10 @@ rirq_nest:
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Work to be done exiting an IRQ
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
|
||||
SECTION_FUNC(TEXT, _rirq_exit)
|
||||
@@ -239,13 +245,14 @@ SECTION_FUNC(TEXT, _rirq_exit)
|
||||
|
||||
jne _rirq_no_switch
|
||||
|
||||
/* sp is struct k_thread **old of z_arc_switch_in_isr which is a wrapper of
|
||||
* z_get_next_switch_handle. r0 contains the 1st thread in ready queue. If it isn't NULL,
|
||||
* then do switch to this thread.
|
||||
/* sp is struct k_thread **old of z_arc_switch_in_isr
|
||||
* which is a wrapper of z_get_next_switch_handle.
|
||||
* r0 contains the 1st thread in ready queue. if
|
||||
* it equals _current(r2) ,then do swap, or no swap.
|
||||
*/
|
||||
_get_next_switch_handle
|
||||
|
||||
CMPR r0, 0
|
||||
CMPR r0, r2
|
||||
beq _rirq_no_switch
|
||||
|
||||
#ifdef CONFIG_ARC_SECURE_FIRMWARE
|
||||
@@ -254,13 +261,12 @@ SECTION_FUNC(TEXT, _rirq_exit)
|
||||
push_s r3
|
||||
#endif
|
||||
|
||||
/* r2 is old thread
|
||||
* _thread_arch.relinquish_cause is 32 bit despite of platform bittnes
|
||||
*/
|
||||
_st32_huge_offset _CAUSE_RIRQ, r2, _thread_offset_to_relinquish_cause, r1
|
||||
|
||||
/* r2 is old thread */
|
||||
_irq_store_old_thread_callee_regs
|
||||
|
||||
/* _thread_arch.relinquish_cause is 32 bit despite of platform bittnes */
|
||||
_st32_huge_offset _CAUSE_RIRQ, r2, _thread_offset_to_relinquish_cause, r2
|
||||
|
||||
/* mov new thread (r0) to r2 */
|
||||
MOVR r2, r0
|
||||
|
||||
|
||||
@@ -11,11 +11,11 @@
|
||||
* Reset handler that prepares the system for running C code.
|
||||
*/
|
||||
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <zephyr/linker/sections.h>
|
||||
#include <zephyr/arch/cpu.h>
|
||||
#include <toolchain.h>
|
||||
#include <linker/sections.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <swap_macros.h>
|
||||
#include <zephyr/arch/arc/asm-compat/assembler.h>
|
||||
#include <arch/arc/asm-compat/assembler.h>
|
||||
|
||||
GDATA(z_interrupt_stacks)
|
||||
GDATA(z_main_stack)
|
||||
@@ -31,6 +31,7 @@ GTEXT(__reset)
|
||||
GTEXT(__start)
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Reset vector
|
||||
*
|
||||
* Ran when the system comes out of reset. The processor is at supervisor level.
|
||||
@@ -39,6 +40,8 @@ GTEXT(__start)
|
||||
*
|
||||
* When these steps are completed, jump to _PrepC(), which will finish setting
|
||||
* up the system for running C code.
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
|
||||
SECTION_SUBSEC_FUNC(TEXT,_reset_and__start,__reset)
|
||||
@@ -142,7 +145,7 @@ done_mpu_regions_reset:
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SMP) || CONFIG_MP_MAX_NUM_CPUS > 1
|
||||
#if defined(CONFIG_SMP) || CONFIG_MP_NUM_CPUS > 1
|
||||
_get_cpu_id r0
|
||||
breq r0, 0, _master_core_startup
|
||||
|
||||
@@ -150,7 +153,7 @@ done_mpu_regions_reset:
|
||||
* Non-masters wait for master core (core 0) to boot enough
|
||||
*/
|
||||
_slave_core_wait:
|
||||
#if CONFIG_MP_MAX_NUM_CPUS == 1
|
||||
#if CONFIG_MP_NUM_CPUS == 1
|
||||
kflag 1
|
||||
#endif
|
||||
ld r1, [arc_cpu_wake_flag]
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <zephyr/linker/sections.h>
|
||||
#include <zephyr/arch/cpu.h>
|
||||
#include <toolchain.h>
|
||||
#include <linker/sections.h>
|
||||
#include <arch/cpu.h>
|
||||
|
||||
.macro clear_scratch_regs
|
||||
mov r1, 0
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/kernel.h>
|
||||
#include <device.h>
|
||||
#include <kernel.h>
|
||||
#include <errno.h>
|
||||
#include <zephyr/types.h>
|
||||
#include <zephyr/init.h>
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <init.h>
|
||||
#include <toolchain.h>
|
||||
|
||||
#include <zephyr/arch/arc/v2/secureshield/arc_secure.h>
|
||||
#include <arch/arc/v2/secureshield/arc_secure.h>
|
||||
|
||||
static void _default_sjli_entry(void);
|
||||
/*
|
||||
@@ -34,7 +34,7 @@ static void _default_sjli_entry(void)
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief initialization of sjli related functions
|
||||
* @brief initializaiton of sjli related functions
|
||||
*
|
||||
*/
|
||||
static void sjli_table_init(void)
|
||||
@@ -46,7 +46,7 @@ static void sjli_table_init(void)
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief initialization of secureshield related functions.
|
||||
* @brief initializaiton of secureshield related functions.
|
||||
*/
|
||||
static int arc_secureshield_init(const struct device *arg)
|
||||
{
|
||||
|
||||
@@ -4,12 +4,13 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include <errno.h>
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/arch/cpu.h>
|
||||
#include <kernel.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <zephyr/types.h>
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <soc.h>
|
||||
#include <toolchain.h>
|
||||
|
||||
#include <zephyr/arch/arc/v2/secureshield/arc_secure.h>
|
||||
#include <arch/arc/v2/secureshield/arc_secure.h>
|
||||
|
||||
#define IRQ_PRIO_MASK (0xffff << ARC_N_IRQ_START_LEVEL)
|
||||
/*
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
* See isr_wrapper.S for details.
|
||||
*/
|
||||
|
||||
#include <zephyr/kernel_structs.h>
|
||||
#include <kernel_structs.h>
|
||||
#include <offsets_short.h>
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <zephyr/linker/sections.h>
|
||||
#include <zephyr/arch/cpu.h>
|
||||
#include <toolchain.h>
|
||||
#include <linker/sections.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <v2/irq.h>
|
||||
#include <swap_macros.h>
|
||||
#include <zephyr/arch/arc/asm-compat/assembler.h>
|
||||
#include <arch/arc/asm-compat/assembler.h>
|
||||
|
||||
GTEXT(z_arc_switch)
|
||||
|
||||
|
||||
@@ -11,19 +11,15 @@
|
||||
* Core thread related primitives for the ARCv2 processor architecture.
|
||||
*/
|
||||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <kernel.h>
|
||||
#include <ksched.h>
|
||||
#include <offsets_short.h>
|
||||
#include <zephyr/wait_q.h>
|
||||
#include <wait_q.h>
|
||||
|
||||
#ifdef CONFIG_USERSPACE
|
||||
#include <zephyr/arch/arc/v2/mpu/arc_core_mpu.h>
|
||||
#include <arch/arc/v2/mpu/arc_core_mpu.h>
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_ARC_DSP) && defined(CONFIG_ARC_DSP_SHARING)
|
||||
#include <zephyr/arch/arc/v2/dsp/arc_dsp.h>
|
||||
static struct k_spinlock lock;
|
||||
#endif
|
||||
/* initial stack frame */
|
||||
struct init_stack_frame {
|
||||
uintptr_t pc;
|
||||
@@ -125,15 +121,10 @@ static inline void arch_setup_callee_saved_regs(struct k_thread *thread,
|
||||
|
||||
ARG_UNUSED(regs);
|
||||
|
||||
/* GCC uses tls pointer cached in register, MWDT just call for _mwget_tls */
|
||||
#if defined(CONFIG_THREAD_LOCAL_STORAGE) && !defined(__CCAC__)
|
||||
#ifdef CONFIG_THREAD_LOCAL_STORAGE
|
||||
#ifdef CONFIG_ISA_ARCV2
|
||||
#if __ARC_TLS_REGNO__ <= 0
|
||||
#error Compiler not configured for thread local storage
|
||||
#endif
|
||||
#define TLSREG _CONCAT(r, __ARC_TLS_REGNO__)
|
||||
/* __ARC_TLS_REGNO__ is used for thread pointer for ARCv2 */
|
||||
regs->TLSREG = thread->tls;
|
||||
/* R26 is used for thread pointer for ARCv2 */
|
||||
regs->r26 = thread->tls;
|
||||
#else
|
||||
/* R30 is used for thread pointer for ARCv3 */
|
||||
regs->r30 = thread->tls;
|
||||
@@ -203,21 +194,12 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
|
||||
/* initial values in all other regs/k_thread entries are irrelevant */
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MULTITHREADING
|
||||
void *z_arch_get_next_switch_handle(struct k_thread **old_thread)
|
||||
{
|
||||
*old_thread = _current;
|
||||
|
||||
return z_get_next_switch_handle(NULL);
|
||||
return z_get_next_switch_handle(*old_thread);
|
||||
}
|
||||
#else
|
||||
void *z_arch_get_next_switch_handle(struct k_thread **old_thread)
|
||||
{
|
||||
ARG_UNUSED(old_thread);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USERSPACE
|
||||
FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry,
|
||||
@@ -271,53 +253,3 @@ int arch_float_enable(struct k_thread *thread, unsigned int options)
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_FPU && CONFIG_FPU_SHARING */
|
||||
|
||||
#if !defined(CONFIG_MULTITHREADING)
|
||||
|
||||
K_KERNEL_STACK_ARRAY_DECLARE(z_interrupt_stacks, CONFIG_MP_MAX_NUM_CPUS, CONFIG_ISR_STACK_SIZE);
|
||||
K_THREAD_STACK_DECLARE(z_main_stack, CONFIG_MAIN_STACK_SIZE);
|
||||
|
||||
extern void z_main_no_multithreading_entry_wrapper(void *p1, void *p2, void *p3,
|
||||
void *main_stack, void *main_entry);
|
||||
|
||||
FUNC_NORETURN void z_arc_switch_to_main_no_multithreading(k_thread_entry_t main_entry,
|
||||
void *p1, void *p2, void *p3)
|
||||
{
|
||||
_kernel.cpus[0].id = 0;
|
||||
_kernel.cpus[0].irq_stack = (Z_KERNEL_STACK_BUFFER(z_interrupt_stacks[0]) +
|
||||
K_KERNEL_STACK_SIZEOF(z_interrupt_stacks[0]));
|
||||
|
||||
void *main_stack = (Z_THREAD_STACK_BUFFER(z_main_stack) +
|
||||
K_THREAD_STACK_SIZEOF(z_main_stack));
|
||||
|
||||
arch_irq_unlock(_ARC_V2_INIT_IRQ_LOCK_KEY);
|
||||
|
||||
z_main_no_multithreading_entry_wrapper(p1, p2, p3, main_stack, main_entry);
|
||||
|
||||
CODE_UNREACHABLE; /* LCOV_EXCL_LINE */
|
||||
}
|
||||
#endif /* !CONFIG_MULTITHREADING */
|
||||
|
||||
#if defined(CONFIG_ARC_DSP) && defined(CONFIG_ARC_DSP_SHARING)
|
||||
void arc_dsp_disable(struct k_thread *thread, unsigned int options)
|
||||
{
|
||||
/* Ensure a preemptive context switch does not occur */
|
||||
k_spinlock_key_t key = k_spin_lock(&lock);
|
||||
|
||||
/* Disable DSP or AGU capabilities for the thread */
|
||||
thread->base.user_options &= ~(uint8_t)options;
|
||||
|
||||
k_spin_unlock(&lock, key);
|
||||
}
|
||||
|
||||
void arc_dsp_enable(struct k_thread *thread, unsigned int options)
|
||||
{
|
||||
/* Ensure a preemptive context switch does not occur */
|
||||
k_spinlock_key_t key = k_spin_lock(&lock);
|
||||
|
||||
/* Enable dsp or agu capabilities for the thread */
|
||||
thread->base.user_options |= (uint8_t)options;
|
||||
|
||||
k_spin_unlock(&lock, key);
|
||||
}
|
||||
#endif /* CONFIG_ARC_DSP && CONFIG_ARC_DSP_SHARING */
|
||||
|
||||
@@ -11,19 +11,21 @@
|
||||
* Wrapper for z_thread_entry routine when called from the initial context.
|
||||
*/
|
||||
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <zephyr/linker/sections.h>
|
||||
#include <toolchain.h>
|
||||
#include <linker/sections.h>
|
||||
#include <v2/irq.h>
|
||||
#include <zephyr/arch/arc/asm-compat/assembler.h>
|
||||
#include <arch/arc/asm-compat/assembler.h>
|
||||
|
||||
GTEXT(z_thread_entry_wrapper)
|
||||
GTEXT(z_thread_entry_wrapper1)
|
||||
|
||||
/**
|
||||
/*
|
||||
* @brief Wrapper for z_thread_entry
|
||||
*
|
||||
* The routine pops parameters for the z_thread_entry from stack frame, prepared
|
||||
* by the arch_new_thread() routine.
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
|
||||
SECTION_FUNC(TEXT, z_thread_entry_wrapper)
|
||||
@@ -35,24 +37,3 @@ z_thread_entry_wrapper1:
|
||||
POPR r0
|
||||
j z_thread_entry
|
||||
nop
|
||||
|
||||
|
||||
#if !defined(CONFIG_MULTITHREADING)
|
||||
GTEXT(z_main_no_multithreading_entry_wrapper)
|
||||
|
||||
/* void z_main_no_multithreading_entry_wrapper(*p1, *p2, *p3, *main_stack, *main_entry) */
|
||||
SECTION_FUNC(TEXT, z_main_no_multithreading_entry_wrapper)
|
||||
MOVR sp, r3
|
||||
|
||||
/* *p1, *p2, *p3 are in r0, r1, r2 already */
|
||||
jl [r4]
|
||||
nop
|
||||
|
||||
/*
|
||||
* If we return from main we'll return from main wrapper and appear here.
|
||||
* Go to infinite loop as there is nothing more to do.
|
||||
*/
|
||||
z_main_no_multithreading_entry_wrapper_end:
|
||||
b z_main_no_multithreading_entry_wrapper_end
|
||||
|
||||
#endif /* !CONFIG_MULTITHREADING */
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
* Provide 64-bit time stamp API
|
||||
*/
|
||||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <zephyr/kernel_structs.h>
|
||||
#include <kernel.h>
|
||||
#include <toolchain.h>
|
||||
#include <kernel_structs.h>
|
||||
|
||||
/*
|
||||
* @brief Read 64-bit timestamp value
|
||||
|
||||
@@ -4,35 +4,12 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/kernel_structs.h>
|
||||
#include <kernel.h>
|
||||
#include <kernel_structs.h>
|
||||
#include <kernel_internal.h>
|
||||
#include <kernel_tls.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
#include <sys/util.h>
|
||||
|
||||
#ifdef __CCAC__
|
||||
extern char _arcmwdt_tls_start[];
|
||||
extern char _arcmwdt_tls_size[];
|
||||
|
||||
size_t arch_tls_stack_setup(struct k_thread *new_thread, char *stack_ptr)
|
||||
{
|
||||
size_t tls_size = (size_t)_arcmwdt_tls_size;
|
||||
size_t tls_size_aligned = ROUND_UP(tls_size, ARCH_STACK_PTR_ALIGN);
|
||||
|
||||
stack_ptr -= tls_size_aligned;
|
||||
memcpy(stack_ptr, _arcmwdt_tls_start, tls_size);
|
||||
|
||||
new_thread->tls = POINTER_TO_UINT(stack_ptr);
|
||||
|
||||
return tls_size_aligned;
|
||||
}
|
||||
|
||||
void *_Preserve_flags _mwget_tls(void)
|
||||
{
|
||||
return (void *)(_current->tls);
|
||||
}
|
||||
|
||||
#else
|
||||
size_t arch_tls_stack_setup(struct k_thread *new_thread, char *stack_ptr)
|
||||
{
|
||||
/*
|
||||
@@ -63,4 +40,3 @@ size_t arch_tls_stack_setup(struct k_thread *new_thread, char *stack_ptr)
|
||||
|
||||
return (z_tls_data_size() + (sizeof(uintptr_t) * 2));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
*/
|
||||
|
||||
#include <offsets_short.h>
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <zephyr/linker/sections.h>
|
||||
#include <zephyr/kernel_structs.h>
|
||||
#include <zephyr/arch/cpu.h>
|
||||
#include <zephyr/syscall.h>
|
||||
#include <toolchain.h>
|
||||
#include <linker/sections.h>
|
||||
#include <kernel_structs.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <syscall.h>
|
||||
#include <swap_macros.h>
|
||||
#include <v2/irq.h>
|
||||
|
||||
@@ -52,11 +52,11 @@ GTEXT(arch_user_string_nlen)
|
||||
GTEXT(z_arc_user_string_nlen_fault_start)
|
||||
GTEXT(z_arc_user_string_nlen_fault_end)
|
||||
GTEXT(z_arc_user_string_nlen_fixup)
|
||||
|
||||
/**
|
||||
/*
|
||||
* @brief Wrapper for z_thread_entry in the case of user thread
|
||||
*
|
||||
* The init parameters are in privileged stack
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
SECTION_FUNC(TEXT, z_user_thread_entry_wrapper)
|
||||
seti _ARC_V2_INIT_IRQ_LOCK_KEY
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
#include <zephyr/types.h>
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <toolchain.h>
|
||||
#include "vector_table.h"
|
||||
|
||||
struct vector_table {
|
||||
|
||||
@@ -8,3 +8,4 @@
|
||||
|
||||
KEEP(*(.exc_vector_table))
|
||||
KEEP(*(".exc_vector_table.*"))
|
||||
KEEP(*(_IRQ_VECTOR_TABLE_SECTION_SYMS))
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Synopsys.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef ZEPHYR_ARCH_ARC_INCLUDE_ARC_IRQ_OFFLOAD_H_
|
||||
#define ZEPHYR_ARCH_ARC_INCLUDE_ARC_IRQ_OFFLOAD_H_
|
||||
|
||||
#ifdef CONFIG_IRQ_OFFLOAD
|
||||
|
||||
int arc_irq_offload_init(const struct device *unused);
|
||||
|
||||
static inline void arc_irq_offload_init_smp(void)
|
||||
{
|
||||
arc_irq_offload_init(NULL);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static inline void arc_irq_offload_init_smp(void) {}
|
||||
|
||||
#endif /* CONFIG_IRQ_OFFLOAD */
|
||||
|
||||
#endif /* ZEPHYR_ARCH_ARC_INCLUDE_ARC_IRQ_OFFLOAD_H_ */
|
||||
@@ -20,16 +20,16 @@
|
||||
#ifndef ZEPHYR_ARCH_ARC_INCLUDE_KERNEL_ARCH_DATA_H_
|
||||
#define ZEPHYR_ARCH_ARC_INCLUDE_KERNEL_ARCH_DATA_H_
|
||||
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <zephyr/linker/sections.h>
|
||||
#include <zephyr/arch/cpu.h>
|
||||
#include <toolchain.h>
|
||||
#include <linker/sections.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <vector_table.h>
|
||||
|
||||
#ifndef _ASMLANGUAGE
|
||||
#include <zephyr/kernel.h>
|
||||
#include <kernel.h>
|
||||
#include <zephyr/types.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
#include <zephyr/sys/dlist.h>
|
||||
#include <sys/util.h>
|
||||
#include <sys/dlist.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -144,9 +144,7 @@ struct _callee_saved_stack {
|
||||
|
||||
#ifdef CONFIG_ARC_HAS_ACCL_REGS
|
||||
uintptr_t r58;
|
||||
#ifndef CONFIG_64BIT
|
||||
uintptr_t r59;
|
||||
#endif /* !CONFIG_64BIT */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FPU_SHARING
|
||||
@@ -158,70 +156,10 @@ struct _callee_saved_stack {
|
||||
uintptr_t dpfp1h;
|
||||
uintptr_t dpfp1l;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARC_DSP_SHARING
|
||||
#ifdef CONFIG_ARC_DSP_BFLY_SHARING
|
||||
uintptr_t dsp_fft_ctrl;
|
||||
uintptr_t dsp_bfly0;
|
||||
#endif
|
||||
uintptr_t acc0_ghi;
|
||||
uintptr_t acc0_glo;
|
||||
uintptr_t dsp_ctrl;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARC_AGU_SHARING
|
||||
uintptr_t agu_ap0;
|
||||
uintptr_t agu_ap1;
|
||||
uintptr_t agu_ap2;
|
||||
uintptr_t agu_ap3;
|
||||
uintptr_t agu_os0;
|
||||
uintptr_t agu_os1;
|
||||
uintptr_t agu_mod0;
|
||||
uintptr_t agu_mod1;
|
||||
uintptr_t agu_mod2;
|
||||
uintptr_t agu_mod3;
|
||||
#ifdef CONFIG_ARC_AGU_MEDIUM
|
||||
uintptr_t agu_ap4;
|
||||
uintptr_t agu_ap5;
|
||||
uintptr_t agu_ap6;
|
||||
uintptr_t agu_ap7;
|
||||
uintptr_t agu_os2;
|
||||
uintptr_t agu_os3;
|
||||
uintptr_t agu_mod4;
|
||||
uintptr_t agu_mod5;
|
||||
uintptr_t agu_mod6;
|
||||
uintptr_t agu_mod7;
|
||||
uintptr_t agu_mod8;
|
||||
uintptr_t agu_mod9;
|
||||
uintptr_t agu_mod10;
|
||||
uintptr_t agu_mod11;
|
||||
#endif
|
||||
#ifdef CONFIG_ARC_AGU_LARGE
|
||||
uintptr_t agu_ap8;
|
||||
uintptr_t agu_ap9;
|
||||
uintptr_t agu_ap10;
|
||||
uintptr_t agu_ap11;
|
||||
uintptr_t agu_os4;
|
||||
uintptr_t agu_os5;
|
||||
uintptr_t agu_os6;
|
||||
uintptr_t agu_os7;
|
||||
uintptr_t agu_mod12;
|
||||
uintptr_t agu_mod13;
|
||||
uintptr_t agu_mod14;
|
||||
uintptr_t agu_mod15;
|
||||
uintptr_t agu_mod16;
|
||||
uintptr_t agu_mod17;
|
||||
uintptr_t agu_mod18;
|
||||
uintptr_t agu_mod19;
|
||||
uintptr_t agu_mod20;
|
||||
uintptr_t agu_mod21;
|
||||
uintptr_t agu_mod22;
|
||||
uintptr_t agu_mod23;
|
||||
#endif
|
||||
#endif
|
||||
/*
|
||||
* No need to save r31 (blink), it's either already pushed as the pc or
|
||||
* No need to save r31 (blink), it's either alread pushed as the pc or
|
||||
* blink on an irq stack frame.
|
||||
*/
|
||||
};
|
||||
|
||||
@@ -73,16 +73,6 @@ static inline void arch_switch(void *switch_to, void **switched_from)
|
||||
z_arc_switch(switch_to, switched_from);
|
||||
}
|
||||
|
||||
#if !defined(CONFIG_MULTITHREADING)
|
||||
extern FUNC_NORETURN void z_arc_switch_to_main_no_multithreading(
|
||||
k_thread_entry_t main_func, void *p1, void *p2, void *p3);
|
||||
|
||||
#define ARCH_SWITCH_TO_MAIN_NO_MULTITHREADING \
|
||||
z_arc_switch_to_main_no_multithreading
|
||||
|
||||
#endif /* !CONFIG_MULTITHREADING */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user