Compare commits
267 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4da3e5280 | ||
|
|
604b40118f | ||
|
|
7eb6869b24 | ||
|
|
5c08f183f2 | ||
|
|
a74b652d52 | ||
|
|
5db25d9882 | ||
|
|
525c112ac3 | ||
|
|
38bd485a59 | ||
|
|
18b08740e7 | ||
|
|
edd1612388 | ||
|
|
142be60c2a | ||
|
|
b0618e11fc | ||
|
|
05318b5349 | ||
|
|
a14b830775 | ||
|
|
644ebe5494 | ||
|
|
d80eaa357a | ||
|
|
f66b26e28d | ||
|
|
078269364a | ||
|
|
9039be480b | ||
|
|
f9cafd218f | ||
|
|
9c23f6a2c9 | ||
|
|
9118a7a8be | ||
|
|
1d67f68ee1 | ||
|
|
f3169352fd | ||
|
|
d98d138b4b | ||
|
|
ea7c9116e6 | ||
|
|
ce3e0c9a42 | ||
|
|
7df4bffa19 | ||
|
|
72f8d81d57 | ||
|
|
43274af272 | ||
|
|
0abe60b1c2 | ||
|
|
c9e1bf4509 | ||
|
|
7c69cbc153 | ||
|
|
748bee1180 | ||
|
|
d8171312a4 | ||
|
|
652f04f6ca | ||
|
|
d72602d95b | ||
|
|
b156e0fadc | ||
|
|
422546623d | ||
|
|
07680b27d5 | ||
|
|
96d62441c3 | ||
|
|
136fc6ff28 | ||
|
|
fde888685f | ||
|
|
6a7cfe1a5f | ||
|
|
c8baa85fee | ||
|
|
7fde6f8ac2 | ||
|
|
7a8a9b6c99 | ||
|
|
9a6cb39c96 | ||
|
|
d290393388 | ||
|
|
28956534cd | ||
|
|
ea9a59f287 | ||
|
|
374d2d031a | ||
|
|
98bd6534a3 | ||
|
|
9fe9ff18ee | ||
|
|
fe8405271a | ||
|
|
a153645d46 | ||
|
|
89c052e1e5 | ||
|
|
faf0e21a66 | ||
|
|
95c41f6889 | ||
|
|
82e255bf2a | ||
|
|
552a0e1524 | ||
|
|
17e4ed1fd7 | ||
|
|
0b91e56939 | ||
|
|
e1e9fa6670 | ||
|
|
fe8efca309 | ||
|
|
328df98c40 | ||
|
|
7e2e9d612d | ||
|
|
6242d56255 | ||
|
|
8bb53d7dc8 | ||
|
|
7ae9f2fadb | ||
|
|
78fc03b07b | ||
|
|
93e0cc85f7 | ||
|
|
5f4707abe3 | ||
|
|
758bfe43da | ||
|
|
cdb27db36c | ||
|
|
9ff7a43035 | ||
|
|
be9d5426d7 | ||
|
|
ebee866639 | ||
|
|
d4dc4a9714 | ||
|
|
faf03b0092 | ||
|
|
126896153b | ||
|
|
bcc700d732 | ||
|
|
075ca208a0 | ||
|
|
8d9ac1c5a5 | ||
|
|
85dd671855 | ||
|
|
04b994883b | ||
|
|
2e89d2c73b | ||
|
|
83c12581c4 | ||
|
|
84dd113165 | ||
|
|
827e397988 | ||
|
|
a9a563fa55 | ||
|
|
0efda1c06f | ||
|
|
e2fe23a7cc | ||
|
|
3f24e7ddf5 | ||
|
|
3aff490e33 | ||
|
|
9d31c46861 | ||
|
|
27201bb1ad | ||
|
|
9727a2143f | ||
|
|
84abb58886 | ||
|
|
7bdf17756c | ||
|
|
961ee2115f | ||
|
|
053dc75720 | ||
|
|
b7954c9991 | ||
|
|
3a39b7824e | ||
|
|
9247efaba8 | ||
|
|
2fbb10c394 | ||
|
|
2f9ae20c60 | ||
|
|
8188fd3b5e | ||
|
|
8bc60390d0 | ||
|
|
f5d4fb40b5 | ||
|
|
c90e0c1197 | ||
|
|
53d9e942cf | ||
|
|
dd435b011f | ||
|
|
6a851f1f48 | ||
|
|
68a6a3e5c3 | ||
|
|
dff331a40c | ||
|
|
96a7b32e85 | ||
|
|
6f11b2d7f2 | ||
|
|
5166ff9fb1 | ||
|
|
16e3655739 | ||
|
|
b757110019 | ||
|
|
61730131c7 | ||
|
|
5455bf4ba7 | ||
|
|
c65645cc39 | ||
|
|
cef9cbeb60 | ||
|
|
ac0477f17c | ||
|
|
cb4ed62d98 | ||
|
|
df0c972787 | ||
|
|
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,5 +28,4 @@
|
||||
--ignore COMPLEX_MACRO
|
||||
--ignore MULTISTATEMENT_MACRO_USE_DO_WHILE
|
||||
--ignore ENOSYS
|
||||
--ignore IS_ENABLED_CONFIG
|
||||
--exclude ext
|
||||
|
||||
151
.clang-format
151
.clang-format
@@ -1,40 +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
|
||||
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
|
||||
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'
|
||||
@@ -49,34 +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'
|
||||
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
|
||||
# SpaceBeforeParens: ControlStatementsExceptControlMacros # clang-format >= 13.0
|
||||
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
|
||||
...
|
||||
|
||||
@@ -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.0.0, the supported
|
||||
At this time, with the latest release of v2.5.0, the supported
|
||||
versions are:
|
||||
|
||||
- v2.7.0: Current LTS
|
||||
- v2.7.0: Prior release
|
||||
- v3.0.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@v2
|
||||
|
||||
- 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
|
||||
|
||||
30
.github/workflows/backport_issue_check.yml
vendored
30
.github/workflows/backport_issue_check.yml
vendored
@@ -1,30 +0,0 @@
|
||||
name: Backport Issue Check
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
branches:
|
||||
- v*-branch
|
||||
|
||||
jobs:
|
||||
backport:
|
||||
name: Backport Issue Check
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- name: Check out source code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- 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"
|
||||
88
.github/workflows/bluetooth-tests.yaml
vendored
88
.github/workflows/bluetooth-tests.yaml
vendored
@@ -1,88 +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/**"
|
||||
|
||||
jobs:
|
||||
bluetooth-test-prep:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Cancel Previous Runs
|
||||
uses: styfle/cancel-workflow-action@0.6.0
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
bluetooth-test-build:
|
||||
runs-on: ubuntu-20.04
|
||||
needs: bluetooth-test-prep
|
||||
container:
|
||||
image: ghcr.io/zephyrproject-rtos/ci:v0.24.2
|
||||
options: '--entrypoint /bin/bash'
|
||||
env:
|
||||
ZEPHYR_TOOLCHAIN_VARIANT: zephyr
|
||||
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.0
|
||||
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: 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: checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: west setup
|
||||
env:
|
||||
BASE_REF: ${{ github.base_ref }}
|
||||
run: |
|
||||
git config --global user.email "you@example.com"
|
||||
git config --global user.name "Your Name"
|
||||
git remote -v
|
||||
git rebase origin/${BASE_REF}
|
||||
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
|
||||
|
||||
- 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@v2
|
||||
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@v2
|
||||
with:
|
||||
name: event
|
||||
path: |
|
||||
${{ github.event_path }}
|
||||
85
.github/workflows/bluetooth.yaml
vendored
Normal file
85
.github/workflows/bluetooth.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:
|
||||
bluetooth-test-prep:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Cancel Previous Runs
|
||||
uses: styfle/cancel-workflow-action@0.6.0
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
bluetooth-test-build:
|
||||
runs-on: ubuntu-latest
|
||||
needs: bluetooth-test-prep
|
||||
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 config --global update.narrow true
|
||||
west update 2>&1 1> west.update.log || west update 2>&1 1> west.update2.log
|
||||
|
||||
- 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@v2
|
||||
with:
|
||||
name: Bluetooth Test Results
|
||||
path: ./bsim_bt_out/bsim_results.xml
|
||||
|
||||
bluetooth-test-results:
|
||||
name: "Publish Bluetooth Test Results"
|
||||
needs: bluetooth-test-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 Bluetooth Test Results
|
||||
uses: EnricoMi/publish-unit-test-result-action@v1
|
||||
with:
|
||||
check_name: Bluetooth Test Results
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
files: "**/bsim_results.xml"
|
||||
comment_mode: off
|
||||
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@v2
|
||||
|
||||
- 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}
|
||||
39
.github/workflows/clang.yaml
vendored
39
.github/workflows/clang.yaml
vendored
@@ -4,7 +4,7 @@ on: pull_request_target
|
||||
|
||||
jobs:
|
||||
clang-build-prep:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Cancel Previous Runs
|
||||
uses: styfle/cancel-workflow-action@0.6.0
|
||||
@@ -14,7 +14,7 @@ jobs:
|
||||
runs-on: zephyr_runner
|
||||
needs: clang-build-prep
|
||||
container:
|
||||
image: ghcr.io/zephyrproject-rtos/ci:v0.24.2
|
||||
image: zephyrprojectrtos/ci:v0.18.4
|
||||
options: '--entrypoint /bin/bash'
|
||||
volumes:
|
||||
- /home/runners/zephyrproject:/github/cache/zephyrproject
|
||||
@@ -23,21 +23,13 @@ jobs:
|
||||
matrix:
|
||||
platform: ["native_posix"]
|
||||
env:
|
||||
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.0
|
||||
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.13.1
|
||||
CLANG_ROOT_DIR: /usr/lib/llvm-12
|
||||
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 }}
|
||||
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: Cleanup
|
||||
run: |
|
||||
# hotfix, until we have a better way to deal with existing data
|
||||
@@ -47,14 +39,13 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Environment Setup
|
||||
run: |
|
||||
pip3 install GitPython
|
||||
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
|
||||
@@ -64,7 +55,7 @@ jobs:
|
||||
# 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 --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 && west update --path-cache /github/cache/zephyrproject)
|
||||
|
||||
- name: Check Environment
|
||||
run: |
|
||||
@@ -83,7 +74,7 @@ jobs:
|
||||
message("::set-output name=repo::${repo2}")
|
||||
- name: use cache
|
||||
id: cache-ccache
|
||||
uses: zephyrproject-rtos/action-s3-cache@v1
|
||||
uses: nashif/action-s3-cache@master
|
||||
with:
|
||||
key: ${{ steps.ccache_cache_timestamp.outputs.repo }}-${{ github.ref_name }}-clang-${{ matrix.platform }}-ccache
|
||||
path: /github/home/.ccache
|
||||
@@ -107,10 +98,10 @@ jobs:
|
||||
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
|
||||
if [ -s testplan.csv ]; then
|
||||
echo "::set-output name=report_needed::1";
|
||||
# Full twister but with options based on changes
|
||||
./scripts/twister --force-color --inline-logs -M -N -v --load-tests testplan.json --retry-failed 2
|
||||
./scripts/twister --inline-logs -M -N -v --load-tests testplan.csv --retry-failed 2
|
||||
else
|
||||
# if nothing is run, skip reporting step
|
||||
echo "::set-output name=report_needed::0";
|
||||
@@ -137,20 +128,6 @@ jobs:
|
||||
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@v2
|
||||
with:
|
||||
name: HTML Unit Test Results
|
||||
if-no-files-found: ignore
|
||||
path: |
|
||||
junit-clang.html
|
||||
|
||||
- name: Publish Unit Test Results
|
||||
uses: EnricoMi/publish-unit-test-result-action@v1
|
||||
|
||||
21
.github/workflows/codecov.yaml
vendored
21
.github/workflows/codecov.yaml
vendored
@@ -6,7 +6,7 @@ on:
|
||||
|
||||
jobs:
|
||||
codecov-prep:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'zephyrproject-rtos/zephyr'
|
||||
steps:
|
||||
- name: Cancel Previous Runs
|
||||
@@ -18,24 +18,16 @@ jobs:
|
||||
runs-on: zephyr_runner
|
||||
needs: codecov-prep
|
||||
container:
|
||||
image: ghcr.io/zephyrproject-rtos/ci:v0.24.2
|
||||
image: zephyrprojectrtos/ci:v0.18.4
|
||||
options: '--entrypoint /bin/bash'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: ["native_posix", "qemu_x86", "unit_testing"]
|
||||
env:
|
||||
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.0
|
||||
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.13.1
|
||||
CLANG_ROOT_DIR: /usr/lib/llvm-12
|
||||
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
|
||||
@@ -66,7 +58,7 @@ jobs:
|
||||
|
||||
- name: use cache
|
||||
id: cache-ccache
|
||||
uses: zephyrproject-rtos/action-s3-cache@v1
|
||||
uses: nashif/action-s3-cache@master
|
||||
with:
|
||||
key: ${{ steps.ccache_cache_prop.outputs.repo }}-${{github.event_name}}-${{matrix.platform}}-codecov-ccache
|
||||
path: /github/home/.ccache
|
||||
@@ -86,7 +78,7 @@ jobs:
|
||||
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
|
||||
./scripts/twister -N -v --filter runnable -p ${{ matrix.platform }} --coverage -T tests
|
||||
|
||||
- name: Generate Coverage Report
|
||||
run: |
|
||||
@@ -110,7 +102,7 @@ jobs:
|
||||
codecov-results:
|
||||
name: "Publish Coverage Results"
|
||||
needs: codecov
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
# the codecov job might be skipped, we don't need to run this job then
|
||||
if: success() || failure()
|
||||
|
||||
@@ -157,7 +149,6 @@ jobs:
|
||||
|
||||
- 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
|
||||
|
||||
3
.github/workflows/coding_guidelines.yml
vendored
3
.github/workflows/coding_guidelines.yml
vendored
@@ -4,7 +4,7 @@ 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
|
||||
@@ -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
|
||||
|
||||
14
.github/workflows/compliance.yml
vendored
14
.github/workflows/compliance.yml
vendored
@@ -4,7 +4,7 @@ on: pull_request
|
||||
|
||||
jobs:
|
||||
maintainer_check:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
name: Check MAINTAINERS file
|
||||
steps:
|
||||
- name: Checkout the code
|
||||
@@ -20,7 +20,7 @@ jobs:
|
||||
python3 ./scripts/get_maintainer.py path CMakeLists.txt
|
||||
|
||||
check_compliance:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
name: Run compliance checks on patch series (PR)
|
||||
steps:
|
||||
- name: Update PATH for west
|
||||
@@ -43,7 +43,7 @@ jobs:
|
||||
run: |
|
||||
pip3 install setuptools
|
||||
pip3 install wheel
|
||||
pip3 install python-magic junitparser gitlint pylint pykwalify
|
||||
pip3 install python-magic junitparser==1.6.3 gitlint pylint pykwalify
|
||||
pip3 install west
|
||||
|
||||
- name: west setup
|
||||
@@ -69,10 +69,10 @@ jobs:
|
||||
# debug
|
||||
ls -la
|
||||
git log --pretty=oneline | head -n 10
|
||||
./scripts/ci/check_compliance.py -m Devicetree -m Gitlint -m Identity -m Nits -m pylint -m checkpatch -m Kconfig -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
|
||||
uses: actions/upload-artifact@master
|
||||
continue-on-error: True
|
||||
with:
|
||||
name: compliance.xml
|
||||
@@ -84,7 +84,7 @@ jobs:
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
for file in Nits.txt checkpatch.txt Identity.txt Gitlint.txt pylint.txt Devicetree.txt Kconfig.txt; do
|
||||
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'}"
|
||||
@@ -95,6 +95,6 @@ jobs:
|
||||
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@v2
|
||||
with:
|
||||
CONFLICT_LABEL_NAME: "has conflicts"
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
2
.github/workflows/daily_test_version.yml
vendored
2
.github/workflows/daily_test_version.yml
vendored
@@ -12,7 +12,7 @@ on:
|
||||
|
||||
jobs:
|
||||
get_version:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'zephyrproject-rtos/zephyr'
|
||||
|
||||
steps:
|
||||
|
||||
8
.github/workflows/devicetree_checks.yml
vendored
8
.github/workflows/devicetree_checks.yml
vendored
@@ -20,12 +20,10 @@ 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
|
||||
- os: macos-latest
|
||||
python-version: 3.6
|
||||
steps:
|
||||
- name: checkout
|
||||
|
||||
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
|
||||
54
.github/workflows/doc-build.yml
vendored
54
.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,20 +26,15 @@ 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.4
|
||||
|
||||
jobs:
|
||||
doc-build-html:
|
||||
name: "Documentation Build (HTML)"
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 45
|
||||
concurrency:
|
||||
group: doc-build-html-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: checkout
|
||||
@@ -47,11 +42,7 @@ jobs:
|
||||
|
||||
- name: install-pkgs
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ninja-build graphviz libclang1-9 libclang-cpp9
|
||||
wget --no-verbose https://downloads.sourceforge.net/project/doxygen/rel-${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@v1
|
||||
@@ -78,49 +69,22 @@ 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@v2
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
name: pr_num
|
||||
path: pr_num
|
||||
|
||||
doc-build-pdf:
|
||||
name: "Documentation Build (PDF)"
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
container: texlive/texlive:latest
|
||||
timeout-minutes: 45
|
||||
concurrency:
|
||||
group: doc-build-pdf-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
steps:
|
||||
- name: checkout
|
||||
@@ -159,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-20.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-20.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: |
|
||||
|
||||
16
.github/workflows/errno.yml
vendored
16
.github/workflows/errno.yml
vendored
@@ -2,27 +2,15 @@ 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.2
|
||||
env:
|
||||
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.0
|
||||
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@v2
|
||||
|
||||
|
||||
16
.github/workflows/footprint-tracking.yml
vendored
16
.github/workflows/footprint-tracking.yml
vendored
@@ -15,7 +15,7 @@ on:
|
||||
|
||||
jobs:
|
||||
footprint-tracking-cancel:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'zephyrproject-rtos/zephyr'
|
||||
steps:
|
||||
- name: Cancel Previous Runs
|
||||
@@ -23,27 +23,19 @@ jobs:
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
footprint-tracking:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'zephyrproject-rtos/zephyr'
|
||||
needs: footprint-tracking-cancel
|
||||
container:
|
||||
image: ghcr.io/zephyrproject-rtos/ci:v0.24.2
|
||||
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.0
|
||||
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
|
||||
|
||||
18
.github/workflows/footprint.yml
vendored
18
.github/workflows/footprint.yml
vendored
@@ -4,7 +4,7 @@ on: pull_request
|
||||
|
||||
jobs:
|
||||
footprint-cancel:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'zephyrproject-rtos/zephyr'
|
||||
steps:
|
||||
- name: Cancel Previous Runs
|
||||
@@ -12,16 +12,16 @@ jobs:
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
footprint-delta:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'zephyrproject-rtos/zephyr'
|
||||
needs: footprint-cancel
|
||||
container:
|
||||
image: ghcr.io/zephyrproject-rtos/ci:v0.24.2
|
||||
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.0
|
||||
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.13.1
|
||||
CLANG_ROOT_DIR: /usr/lib/llvm-12
|
||||
ZEPHYR_TOOLCHAIN_VARIANT: zephyr
|
||||
steps:
|
||||
@@ -29,15 +29,6 @@ jobs:
|
||||
uses: styfle/cancel-workflow-action@0.6.0
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
|
||||
- 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
|
||||
@@ -64,7 +55,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
|
||||
|
||||
7
.github/workflows/issue_count.yml
vendored
7
.github/workflows/issue_count.yml
vendored
@@ -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,7 +34,7 @@ jobs:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: upload-stats
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@master
|
||||
continue-on-error: True
|
||||
with:
|
||||
name: ${{ 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 }}'
|
||||
4
.github/workflows/license_check.yml
vendored
4
.github/workflows/license_check.yml
vendored
@@ -4,14 +4,14 @@ 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
|
||||
|
||||
7
.github/workflows/manifest.yml
vendored
7
.github/workflows/manifest.yml
vendored
@@ -6,7 +6,7 @@ on:
|
||||
|
||||
jobs:
|
||||
contribs:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
name: Manifest
|
||||
steps:
|
||||
- name: Checkout the code
|
||||
@@ -15,12 +15,11 @@ jobs:
|
||||
path: zephyrproject/zephyr
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Manifest
|
||||
uses: zephyrproject-rtos/action-manifest@f54422ea250adb7cc1b9f62bfe125978bb2c58ee
|
||||
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-'
|
||||
|
||||
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@@ -7,7 +7,7 @@ on:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
args: spdx -o zephyr-${{ steps.get_version.outputs.VERSION }}.spdx
|
||||
|
||||
- name: upload-results
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@master
|
||||
continue-on-error: True
|
||||
with:
|
||||
name: zephyr-${{ steps.get_version.outputs.VERSION }}.spdx
|
||||
|
||||
4
.github/workflows/stale_issue.yml
vendored
4
.github/workflows/stale_issue.yml
vendored
@@ -6,7 +6,7 @@ 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
|
||||
@@ -19,5 +19,5 @@ jobs:
|
||||
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
|
||||
|
||||
115
.github/workflows/twister.yaml
vendored
115
.github/workflows/twister.yaml
vendored
@@ -2,20 +2,14 @@ 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'
|
||||
# Run at 00:00 on Saturday
|
||||
- cron: '20 0 * * 6'
|
||||
|
||||
jobs:
|
||||
twister-build-cleanup:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Cancel Previous Runs
|
||||
uses: styfle/cancel-workflow-action@0.6.0
|
||||
@@ -27,32 +21,23 @@ jobs:
|
||||
runs-on: zephyr_runner
|
||||
needs: twister-build-cleanup
|
||||
container:
|
||||
image: ghcr.io/zephyrproject-rtos/ci:v0.24.2
|
||||
image: zephyrprojectrtos/ci:v0.18.4
|
||||
options: '--entrypoint /bin/bash'
|
||||
volumes:
|
||||
- /home/runners/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.0
|
||||
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.13.1
|
||||
CLANG_ROOT_DIR: /usr/lib/llvm-12
|
||||
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: Cleanup
|
||||
run: |
|
||||
# hotfix, until we have a better way to deal with existing data
|
||||
@@ -64,21 +49,17 @@ jobs:
|
||||
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: |
|
||||
pip3 install GitPython
|
||||
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'
|
||||
# no need for west update here
|
||||
|
||||
- name: Generate Test Plan with Twister
|
||||
if: github.event_name == 'pull_request_target'
|
||||
@@ -86,13 +67,20 @@ jobs:
|
||||
run: |
|
||||
export ZEPHYR_BASE=${PWD}
|
||||
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
|
||||
# temporary until we have all PRs rebased on top of this commit.
|
||||
git log -n 500 --oneline | grep -q "run twister using github action" || (
|
||||
echo "Your branch is not up to date, you need to rebase on top of latest HEAD of main branch"
|
||||
exit 1
|
||||
)
|
||||
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
|
||||
|
||||
|
||||
rm -f testplan.csv .testplan
|
||||
|
||||
- name: Determine matrix size
|
||||
id: output-services
|
||||
@@ -107,7 +95,7 @@ jobs:
|
||||
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
|
||||
elif [ "${{github.event_name}}" = "schedule" && "${{github.repository}}" = "zephyrproject-rtos/zephyr" ]; then
|
||||
subset="[$(seq -s',' 1 ${DAILY_MATRIX_SIZE})]"
|
||||
size=${DAILY_MATRIX_SIZE}
|
||||
else
|
||||
@@ -115,14 +103,13 @@ jobs:
|
||||
fi
|
||||
echo "::set-output name=subset::${subset}";
|
||||
echo "::set-output name=size::${size}";
|
||||
echo "::set-output name=fullrun::${TWISTER_FULL}";
|
||||
|
||||
twister-build:
|
||||
runs-on: zephyr_runner
|
||||
needs: twister-build-prep
|
||||
if: needs.twister-build-prep.outputs.size != 0
|
||||
container:
|
||||
image: ghcr.io/zephyrproject-rtos/ci:v0.24.2
|
||||
image: zephyrprojectrtos/ci:v0.18.4
|
||||
options: '--entrypoint /bin/bash'
|
||||
volumes:
|
||||
- /home/runners/zephyrproject:/github/cache/zephyrproject
|
||||
@@ -131,23 +118,15 @@ jobs:
|
||||
matrix:
|
||||
subset: ${{fromJSON(needs.twister-build-prep.outputs.subset)}}
|
||||
env:
|
||||
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.15.0
|
||||
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.13.1
|
||||
CLANG_ROOT_DIR: /usr/lib/llvm-12
|
||||
TWISTER_COMMON: ' --force-color --inline-logs -v -N -M --retry-failed 3 '
|
||||
DAILY_OPTIONS: ' -M --build-only --all'
|
||||
PR_OPTIONS: ' --clobber-output --integration'
|
||||
PUSH_OPTIONS: ' --clobber-output -M'
|
||||
TWISTER_COMMON: ' --inline-logs -v -N -M --retry-failed 3 '
|
||||
DAILY_OPTIONS: ' -M --build-only --all '
|
||||
PR_OPTIONS: ' --clobber-output --integration '
|
||||
PUSH_OPTIONS: ' --clobber-output -M '
|
||||
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: Cleanup
|
||||
run: |
|
||||
# hotfix, until we have a better way to deal with existing data
|
||||
@@ -158,14 +137,13 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Environment Setup
|
||||
run: |
|
||||
pip3 install GitPython
|
||||
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
|
||||
@@ -173,7 +151,7 @@ jobs:
|
||||
|
||||
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 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 && west update --path-cache /github/cache/zephyrproject)
|
||||
west forall -c 'git reset --hard HEAD'
|
||||
|
||||
- name: Check Environment
|
||||
@@ -197,8 +175,7 @@ jobs:
|
||||
|
||||
- name: use cache
|
||||
id: cache-ccache
|
||||
uses: zephyrproject-rtos/action-s3-cache@v1
|
||||
continue-on-error: true
|
||||
uses: nashif/action-s3-cache@master
|
||||
with:
|
||||
key: ${{ steps.ccache_cache_timestamp.outputs.repo }}-${{ github.ref_name }}-${{github.event_name}}-${{ matrix.subset }}-ccache
|
||||
path: /github/home/.ccache
|
||||
@@ -218,27 +195,15 @@ jobs:
|
||||
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
|
||||
rm -f testplan.csv
|
||||
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
|
||||
./scripts/twister --subset ${{matrix.subset}}/${{ strategy.job-total }} --load-tests testplan.csv ${TWISTER_COMMON} ${PR_OPTIONS}
|
||||
|
||||
- if: github.event_name == 'schedule'
|
||||
name: Run Tests with Twister (Daily)
|
||||
@@ -246,12 +211,6 @@ jobs:
|
||||
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: |
|
||||
@@ -265,13 +224,12 @@ jobs:
|
||||
if-no-files-found: ignore
|
||||
path: |
|
||||
twister-out/twister.xml
|
||||
module_tests/twister.xml
|
||||
testplan.json
|
||||
testplan.csv
|
||||
|
||||
twister-test-results:
|
||||
name: "Publish Unit Tests Results"
|
||||
needs: twister-build
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
# the build-and-test job might be skipped, we don't need to run this job then
|
||||
if: success() || failure()
|
||||
|
||||
@@ -281,21 +239,6 @@ jobs:
|
||||
with:
|
||||
path: artifacts
|
||||
|
||||
- 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@v2
|
||||
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:
|
||||
|
||||
6
.github/workflows/twister_tests.yml
vendored
6
.github/workflows/twister_tests.yml
vendored
@@ -23,8 +23,8 @@ 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@v2
|
||||
@@ -42,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: ./
|
||||
|
||||
8
.github/workflows/west_cmds.yml
vendored
8
.github/workflows/west_cmds.yml
vendored
@@ -21,12 +21,10 @@ 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
|
||||
- os: macos-latest
|
||||
python-version: 3.6
|
||||
steps:
|
||||
- name: checkout
|
||||
|
||||
11
.gitignore
vendored
11
.gitignore
vendored
@@ -7,11 +7,8 @@
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
.\#*
|
||||
\#*\#
|
||||
build*/
|
||||
!doc/build/
|
||||
!scripts/build
|
||||
!doc/guides/build
|
||||
!tests/drivers/build_all
|
||||
cscope.*
|
||||
.dir
|
||||
@@ -47,12 +44,6 @@ doc/doc.warnings
|
||||
hide-defaults-note
|
||||
venv
|
||||
.venv
|
||||
.DS_Store
|
||||
.clangd
|
||||
|
||||
# CI output
|
||||
compliance.xml
|
||||
_error.types
|
||||
|
||||
# Tag files
|
||||
GPATH
|
||||
|
||||
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
|
||||
1003
CMakeLists.txt
1003
CMakeLists.txt
File diff suppressed because it is too large
Load Diff
575
CODEOWNERS
575
CODEOWNERS
File diff suppressed because it is too large
Load Diff
181
Kconfig.zephyr
181
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
|
||||
@@ -284,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
|
||||
@@ -321,7 +309,7 @@ config NO_OPTIMIZATIONS
|
||||
endchoice
|
||||
|
||||
config COMPILER_COLOR_DIAGNOSTICS
|
||||
bool "Colored diagnostics"
|
||||
bool "Enable colored diganostics"
|
||||
default y
|
||||
help
|
||||
Compiler diagnostic messages are colorized.
|
||||
@@ -361,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.
|
||||
@@ -382,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
|
||||
@@ -476,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
|
||||
@@ -505,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
|
||||
@@ -521,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
|
||||
@@ -568,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
|
||||
|
||||
|
||||
@@ -712,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.
|
||||
@@ -771,13 +623,6 @@ config MCUBOOT_EXTRA_IMGTOOL_ARGS
|
||||
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.
|
||||
|
||||
config MCUBOOT_GENERATE_CONFIRMED_IMAGE
|
||||
bool "Also generate a padded, confirmed image"
|
||||
help
|
||||
@@ -793,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.
|
||||
@@ -853,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.
|
||||
|
||||
3762
MAINTAINERS.yml
3762
MAINTAINERS.yml
File diff suppressed because it is too large
Load Diff
12
README.rst
12
README.rst
@@ -2,7 +2,7 @@
|
||||
|
||||
<a href="https://www.zephyrproject.org">
|
||||
<p align="center">
|
||||
<img src="doc/_static/images/logo-readme.svg">
|
||||
<img src="doc/_static/images/logo-readme.png">
|
||||
</p>
|
||||
</a>
|
||||
|
||||
@@ -22,9 +22,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
|
||||
|
||||
@@ -78,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
|
||||
|
||||
6
VERSION
6
VERSION
@@ -1,5 +1,5 @@
|
||||
VERSION_MAJOR = 3
|
||||
VERSION_MINOR = 2
|
||||
PATCHLEVEL = 0
|
||||
VERSION_MAJOR = 2
|
||||
VERSION_MINOR = 7
|
||||
PATCHLEVEL = 1
|
||||
VERSION_TWEAK = 0
|
||||
EXTRAVERSION =
|
||||
|
||||
321
arch/Kconfig
321
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,8 +107,6 @@ config XTENSA
|
||||
select HAS_DTS
|
||||
select USE_SWITCH
|
||||
select USE_SWITCH_SUPPORTED
|
||||
select IRQ_OFFLOAD_NESTED if IRQ_OFFLOAD
|
||||
select ARCH_HAS_TIMING_FUNCTIONS
|
||||
imply ATOMIC_OPERATIONS_ARCH
|
||||
help
|
||||
Xtensa architecture
|
||||
@@ -150,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
|
||||
@@ -380,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
|
||||
@@ -405,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
|
||||
@@ -446,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
|
||||
@@ -467,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"
|
||||
@@ -566,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
|
||||
#
|
||||
@@ -578,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
|
||||
#
|
||||
@@ -598,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
|
||||
@@ -639,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
|
||||
@@ -669,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
|
||||
@@ -762,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
|
||||
@@ -814,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 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
|
||||
@@ -848,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
|
||||
@@ -860,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
|
||||
@@ -871,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
|
||||
@@ -888,7 +942,7 @@ choice CACHE_TYPE
|
||||
config HAS_ARCH_CACHE
|
||||
bool "Integrated cache controller"
|
||||
help
|
||||
"Integrated on-core cache controller"
|
||||
"Integrade on-core cache controller"
|
||||
|
||||
config HAS_EXTERNAL_CACHE
|
||||
bool "External cache controller"
|
||||
@@ -925,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)
|
||||
|
||||
@@ -23,20 +23,4 @@ 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
|
||||
|
||||
@@ -184,7 +168,7 @@ config ARC_FIRQ
|
||||
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
|
||||
@@ -236,7 +220,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
|
||||
@@ -278,7 +262,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
|
||||
@@ -341,7 +326,7 @@ 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
|
||||
@@ -391,7 +376,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
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <toolchain.h>
|
||||
|
||||
__weak void *__dso_handle;
|
||||
|
||||
|
||||
@@ -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,13 +9,19 @@
|
||||
* @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 <soc.h>
|
||||
#include <init.h>
|
||||
|
||||
#define MP_PRIMARY_CPU_ID 0
|
||||
|
||||
#ifndef IRQ_ICI
|
||||
#define IRQ_ICI 19
|
||||
#endif
|
||||
|
||||
#define ARCV2_ICI_IRQ_PRIORITY 1
|
||||
|
||||
volatile struct {
|
||||
arch_cpustart_t fn;
|
||||
@@ -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 != 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.
|
||||
@@ -104,9 +103,8 @@ void z_arc_slave_start(int cpu_num)
|
||||
z_irq_setup();
|
||||
|
||||
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;
|
||||
@@ -149,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(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");
|
||||
|
||||
@@ -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)
|
||||
@@ -139,21 +139,6 @@ int arch_dcache_range(void *addr, size_t size, int op)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int arch_icache_range(void *addr, size_t size, int op)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
int arch_dcache_all(int op)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
int arch_icache_all(int op)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_DCACHE_LINE_SIZE_DETECT)
|
||||
static void init_dcache_line_size(void)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
@@ -119,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
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
/*
|
||||
@@ -38,8 +38,10 @@ K_KERNEL_STACK_ARRAY_DEFINE(_firq_interrupt_stack, CONFIG_MP_NUM_CPUS,
|
||||
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)
|
||||
{
|
||||
@@ -81,12 +83,14 @@ void z_arc_firq_stack_set(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
/*
|
||||
* @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)
|
||||
@@ -94,11 +98,13 @@ 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)
|
||||
@@ -117,7 +123,7 @@ int arch_irq_is_enabled(unsigned int irq)
|
||||
return z_arc_v2_irq_unit_int_enabled(irq);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* @internal
|
||||
*
|
||||
* @brief Set an interrupt's priority
|
||||
@@ -127,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)
|
||||
@@ -135,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)
|
||||
@@ -148,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)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
* @file Software interrupts utility code - ARC implementation
|
||||
*/
|
||||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/irq_offload.h>
|
||||
#include <kernel.h>
|
||||
#include <irq_offload.h>
|
||||
|
||||
static irq_offload_routine_t offload_routine;
|
||||
static const void *offload_param;
|
||||
|
||||
@@ -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,7 +22,7 @@
|
||||
* completeness.
|
||||
*/
|
||||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <kernel.h>
|
||||
#include <kernel_arch_data.h>
|
||||
#include <gen_offset.h>
|
||||
#include <kernel_offsets.h>
|
||||
@@ -104,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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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,13 +11,13 @@
|
||||
* 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
|
||||
|
||||
/* initial stack frame */
|
||||
@@ -194,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,
|
||||
@@ -262,29 +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_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 */
|
||||
|
||||
@@ -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,11 +4,11 @@
|
||||
* 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>
|
||||
|
||||
size_t arch_tls_stack_setup(struct k_thread *new_thread, char *stack_ptr)
|
||||
{
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
@@ -161,7 +159,7 @@ struct _callee_saved_stack {
|
||||
|
||||
#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
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
#ifndef ZEPHYR_ARCH_ARC_INCLUDE_SWAP_MACROS_H_
|
||||
#define ZEPHYR_ARCH_ARC_INCLUDE_SWAP_MACROS_H_
|
||||
|
||||
#include <zephyr/kernel_structs.h>
|
||||
#include <kernel_structs.h>
|
||||
#include <offsets_short.h>
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <zephyr/arch/cpu.h>
|
||||
#include <zephyr/arch/arc/tool-compat.h>
|
||||
#include <zephyr/arch/arc/asm-compat/assembler.h>
|
||||
#include <toolchain.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <arch/arc/tool-compat.h>
|
||||
#include <arch/arc/asm-compat/assembler.h>
|
||||
|
||||
#ifdef _ASMLANGUAGE
|
||||
|
||||
@@ -62,9 +62,7 @@
|
||||
|
||||
#ifdef CONFIG_ARC_HAS_ACCL_REGS
|
||||
STR r58, sp, ___callee_saved_stack_t_r58_OFFSET
|
||||
#ifndef CONFIG_64BIT
|
||||
STR r59, sp, ___callee_saved_stack_t_r59_OFFSET
|
||||
#endif /* !CONFIG_64BIT */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FPU_SHARING
|
||||
@@ -100,9 +98,7 @@
|
||||
|
||||
#ifdef CONFIG_ARC_HAS_ACCL_REGS
|
||||
LDR r58, sp, ___callee_saved_stack_t_r58_OFFSET
|
||||
#ifndef CONFIG_64BIT
|
||||
LDR r59, sp, ___callee_saved_stack_t_r59_OFFSET
|
||||
#endif /* !CONFIG_64BIT */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FPU_SHARING
|
||||
@@ -416,15 +412,12 @@
|
||||
.macro _store_old_thread_callee_regs
|
||||
|
||||
_save_callee_saved_regs
|
||||
/* Save old thread into switch handle which is required by wait_for_switch.
|
||||
* NOTE: we shouldn't save anything related to old thread context after this point!
|
||||
* TODO: we should add SMP write-after-write data memory barrier here, as we want all
|
||||
* previous writes completed before setting switch_handle which is polled by other cores
|
||||
* in wait_for_switch in case of SMP. Though it's not likely that this issue
|
||||
* will reproduce in real world as there is some gap before reading switch_handle and
|
||||
* reading rest of the data we've stored before.
|
||||
#ifdef CONFIG_SMP
|
||||
/* save old thread into switch handle which is required by
|
||||
* wait_for_switch
|
||||
*/
|
||||
STR r2, r2, ___thread_t_switch_handle_OFFSET
|
||||
#endif
|
||||
.endm
|
||||
|
||||
/* macro to store old thread call regs in interrupt*/
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#ifndef ZEPHYR_ARCH_ARC_INCLUDE_V2_IRQ_H_
|
||||
#define ZEPHYR_ARCH_ARC_INCLUDE_V2_IRQ_H_
|
||||
|
||||
#include <zephyr/arch/cpu.h>
|
||||
#include <arch/cpu.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
|
||||
#ifdef _ASMLANGUAGE
|
||||
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <zephyr/linker/sections.h>
|
||||
#include <toolchain.h>
|
||||
#include <linker/sections.h>
|
||||
|
||||
GTEXT(__start)
|
||||
GTEXT(_VectorTable)
|
||||
|
||||
@@ -34,6 +34,15 @@ config ARM_CUSTOM_INTERRUPT_CONTROLLER
|
||||
family cores. The Cortex-M family cores are always equipped with
|
||||
the ARM Nested Vectored Interrupt Controller (NVIC).
|
||||
|
||||
config CODE_DATA_RELOCATION
|
||||
bool "Relocate code/data sections"
|
||||
depends on CPU_CORTEX_M
|
||||
help
|
||||
When selected this will relocate .text, data and .bss sections from
|
||||
the specified files and places it in the required memory region. The
|
||||
files should be specified in the CMakeList.txt file with
|
||||
a cmake API zephyr_code_relocate().
|
||||
|
||||
config CODE_DATA_RELOCATION_SRAM
|
||||
bool "Relocate code/data sections to SRAM"
|
||||
depends on CPU_CORTEX_M
|
||||
@@ -46,6 +55,5 @@ config CODE_DATA_RELOCATION_SRAM
|
||||
relocation.
|
||||
|
||||
rsource "core/aarch32/Kconfig"
|
||||
rsource "core/aarch32/Kconfig.vfp"
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -21,20 +21,13 @@ zephyr_library_sources_ifdef(CONFIG_SW_VECTOR_RELAY irq_relay.S)
|
||||
zephyr_library_sources_ifdef(CONFIG_THREAD_LOCAL_STORAGE ../common/tls.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_USERSPACE userspace.S)
|
||||
|
||||
if(CONFIG_HAS_ARCH_CACHE)
|
||||
zephyr_library_sources_ifdef(CONFIG_CACHE_MANAGEMENT cache.c)
|
||||
endif()
|
||||
|
||||
add_subdirectory_ifdef(CONFIG_CPU_CORTEX_M cortex_m)
|
||||
add_subdirectory_ifdef(CONFIG_CPU_CORTEX_M_HAS_CMSE cortex_m/cmse)
|
||||
add_subdirectory_ifdef(CONFIG_ARM_SECURE_FIRMWARE cortex_m/tz)
|
||||
add_subdirectory_ifdef(CONFIG_ARM_NONSECURE_FIRMWARE cortex_m/tz)
|
||||
|
||||
add_subdirectory_ifdef(CONFIG_ARM_MPU mpu)
|
||||
add_subdirectory_ifdef(CONFIG_ARM_AARCH32_MMU mmu)
|
||||
|
||||
add_subdirectory_ifdef(CONFIG_CPU_AARCH32_CORTEX_R cortex_a_r)
|
||||
add_subdirectory_ifdef(CONFIG_CPU_AARCH32_CORTEX_A cortex_a_r)
|
||||
add_subdirectory_ifdef(CONFIG_CPU_CORTEX_R cortex_a_r)
|
||||
|
||||
zephyr_linker_sources(ROM_START SORT_KEY 0x0vectors vector_table.ld)
|
||||
zephyr_linker_sources(ROM_START SORT_KEY 0x1vectors cortex_m/vector_table_pad.ld)
|
||||
|
||||
@@ -14,20 +14,18 @@ config CPU_CORTEX_M
|
||||
select ARCH_HAS_TRUSTED_EXECUTION if ARM_TRUSTZONE_M
|
||||
select ARCH_HAS_STACK_PROTECTION if (ARM_MPU && !ARMV6_M_ARMV8_M_BASELINE) || CPU_CORTEX_M_HAS_SPLIM
|
||||
select ARCH_HAS_USERSPACE if ARM_MPU
|
||||
select ARCH_HAS_NOCACHE_MEMORY_SUPPORT if ARM_MPU && CPU_HAS_ARM_MPU && CPU_HAS_DCACHE
|
||||
select ARCH_HAS_NOCACHE_MEMORY_SUPPORT if ARM_MPU && CPU_HAS_ARM_MPU && CPU_CORTEX_M7
|
||||
select ARCH_HAS_RAMFUNC_SUPPORT
|
||||
select ARCH_HAS_NESTED_EXCEPTION_DETECTION
|
||||
select SWAP_NONATOMIC
|
||||
select ARCH_HAS_EXTRA_EXCEPTION_INFO
|
||||
select ARCH_HAS_TIMING_FUNCTIONS if CPU_CORTEX_M_HAS_DWT
|
||||
select ARCH_SUPPORTS_ARCH_HW_INIT
|
||||
select ARCH_HAS_SUSPEND_TO_RAM
|
||||
select ARCH_HAS_CODE_DATA_RELOCATION
|
||||
imply XIP
|
||||
help
|
||||
This option signifies the use of a CPU of the Cortex-M family.
|
||||
|
||||
config CPU_AARCH32_CORTEX_R
|
||||
config CPU_CORTEX_R
|
||||
bool
|
||||
select CPU_CORTEX
|
||||
select HAS_CMSIS_CORE
|
||||
@@ -35,21 +33,9 @@ config CPU_AARCH32_CORTEX_R
|
||||
select HAS_FLASH_LOAD_OFFSET
|
||||
select ARCH_HAS_USERSPACE if ARM_MPU
|
||||
select ARCH_HAS_EXTRA_EXCEPTION_INFO
|
||||
select ARCH_HAS_CODE_DATA_RELOCATION
|
||||
help
|
||||
This option signifies the use of a CPU of the Cortex-R family.
|
||||
|
||||
config CPU_AARCH32_CORTEX_A
|
||||
bool
|
||||
select CPU_CORTEX
|
||||
select CPU_HAS_MMU
|
||||
select HAS_CMSIS_CORE
|
||||
select HAS_FLASH_LOAD_OFFSET
|
||||
select ARCH_HAS_EXTRA_EXCEPTION_INFO
|
||||
select ARCH_HAS_NOCACHE_MEMORY_SUPPORT
|
||||
help
|
||||
This option signifies the use of a CPU of the Cortex-A family.
|
||||
|
||||
config ISA_THUMB2
|
||||
bool
|
||||
help
|
||||
@@ -146,7 +132,7 @@ config RUNTIME_NMI
|
||||
needed, enable this option and attach it via _NmiHandlerSet().
|
||||
|
||||
config PLATFORM_SPECIFIC_INIT
|
||||
bool "Platform (SOC) specific startup hook"
|
||||
bool "Enable platform (SOC) specific startup hook"
|
||||
help
|
||||
The platform specific initialization code (z_arm_platform_init) is
|
||||
executed at the beginning of the startup code (__start).
|
||||
@@ -244,7 +230,7 @@ config ARM_NONSECURE_PREEMPTIBLE_SECURE_CALLS
|
||||
|
||||
config ARM_STORE_EXC_RETURN
|
||||
bool
|
||||
default y if CPU_CORTEX_M && (FPU_SHARING || ARM_NONSECURE_PREEMPTIBLE_SECURE_CALLS)
|
||||
default y if FPU_SHARING || ARM_NONSECURE_PREEMPTIBLE_SECURE_CALLS
|
||||
help
|
||||
Store the EXC_RETURN value when switching threads.
|
||||
This is needed when switching between threads that differ in either
|
||||
@@ -257,16 +243,14 @@ choice
|
||||
|
||||
config FP_HARDABI
|
||||
bool "Floating point Hard ABI"
|
||||
# TF-M build system does not build the NS app and libraries correctly with Hard ABI.
|
||||
# This limitation should be removed in the next TF-M synchronization.
|
||||
depends on !TFM_BUILD_NS
|
||||
depends on !(BUILD_WITH_TFM && !TFM_IPC)
|
||||
depends on !BUILD_WITH_TFM
|
||||
help
|
||||
This option selects the Floating point ABI in which hardware floating
|
||||
point instructions are generated and uses FPU-specific calling
|
||||
conventions.
|
||||
|
||||
Note: When building with TF-M enabled only the IPC mode is supported.
|
||||
Note: the option is disabled for Zephyr builds with TF-M, as TF-M
|
||||
does not currently support building with Hard ABI, hence linking
|
||||
Zephyr with TF-M libraries would not be possible.
|
||||
|
||||
config FP_SOFTABI
|
||||
bool "Floating point Soft ABI"
|
||||
@@ -311,4 +295,3 @@ rsource "cortex_m/Kconfig"
|
||||
rsource "cortex_a_r/Kconfig"
|
||||
|
||||
rsource "mpu/Kconfig"
|
||||
rsource "mmu/Kconfig"
|
||||
|
||||
@@ -1,201 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# Copyright (c) 2022 Lexmark International, Inc.
|
||||
|
||||
# ARM architecture VFP configuration options
|
||||
|
||||
# Math coprocessor symbols; these should be selected by the CPU symbol to
|
||||
# indicate that the CPU core can be configured with the specified
|
||||
# coprocessor(s).
|
||||
|
||||
config CPU_HAS_VFP
|
||||
bool
|
||||
select CPU_HAS_FPU
|
||||
help
|
||||
This option signifies the support for a Vectored Floating-Point (VFP)
|
||||
coprocessor.
|
||||
|
||||
config CPU_HAS_NEON
|
||||
bool
|
||||
select CPU_HAS_FPU
|
||||
help
|
||||
This option signifies the support for a NEON (Advanced SIMD) coprocessor.
|
||||
|
||||
# VFP type symbols; these should be selected by the SoC symbol to specify the
|
||||
# type of the VFP core instantiated by the SoC.
|
||||
|
||||
config VFP_SP_D16
|
||||
bool
|
||||
select CPU_HAS_VFP
|
||||
select VFP_FEATURE_SINGLE_PRECISION
|
||||
select VFP_FEATURE_REGS_S32_D16
|
||||
help
|
||||
This option signifies the use of a VFP floating-point coprocessor
|
||||
that supports only single-precision operations with 16 double-word
|
||||
registers.
|
||||
|
||||
config VFP_SP_D16_FP16
|
||||
bool
|
||||
select CPU_HAS_VFP
|
||||
select VFP_FEATURE_HALF_PRECISION
|
||||
select VFP_FEATURE_SINGLE_PRECISION
|
||||
select VFP_FEATURE_REGS_S32_D16
|
||||
help
|
||||
This option signifies the use of a VFP floating-point coprocessor
|
||||
that supports half- and single-precision operations with 16
|
||||
double-word registers.
|
||||
|
||||
config VFP_SP_D16_FP16_FMAC
|
||||
bool
|
||||
select CPU_HAS_VFP
|
||||
select VFP_FEATURE_HALF_PRECISION
|
||||
select VFP_FEATURE_SINGLE_PRECISION
|
||||
select VFP_FEATURE_FMAC
|
||||
select VFP_FEATURE_REGS_S32_D16
|
||||
help
|
||||
This option signifies the use of a VFP floating-point coprocessor
|
||||
that supports half- and single-precision operations (including fused
|
||||
multiply-accumulate) with 16 double-word registers.
|
||||
|
||||
config VFP_DP_D16
|
||||
bool
|
||||
select CPU_HAS_VFP
|
||||
select VFP_FEATURE_SINGLE_PRECISION
|
||||
select VFP_FEATURE_DOUBLE_PRECISION
|
||||
select VFP_FEATURE_REGS_S32_D16
|
||||
help
|
||||
This option signifies the use of a VFP floating-point coprocessor
|
||||
that supports single- and double-precision operations with 16
|
||||
double-word registers.
|
||||
|
||||
config VFP_DP_D16_FP16
|
||||
bool
|
||||
select CPU_HAS_VFP
|
||||
select VFP_FEATURE_HALF_PRECISION
|
||||
select VFP_FEATURE_SINGLE_PRECISION
|
||||
select VFP_FEATURE_DOUBLE_PRECISION
|
||||
select VFP_FEATURE_REGS_S32_D16
|
||||
help
|
||||
This option signifies the use of a VFP floating-point coprocessor
|
||||
that supports half-, single- and double-precision operations with 16
|
||||
double-word registers.
|
||||
|
||||
config VFP_DP_D16_FP16_FMAC
|
||||
bool
|
||||
select CPU_HAS_VFP
|
||||
select VFP_FEATURE_HALF_PRECISION
|
||||
select VFP_FEATURE_SINGLE_PRECISION
|
||||
select VFP_FEATURE_DOUBLE_PRECISION
|
||||
select VFP_FEATURE_FMAC
|
||||
select VFP_FEATURE_REGS_S32_D16
|
||||
help
|
||||
This option signifies the use of a VFP floating-point coprocessor
|
||||
that supports half-, single- and double-precision operations
|
||||
(including fused multiply-accumulate) with 16 double-word registers.
|
||||
|
||||
config VFP_U_DP_D16_FP16_FMAC
|
||||
bool
|
||||
select CPU_HAS_VFP
|
||||
select VFP_FEATURE_HALF_PRECISION
|
||||
select VFP_FEATURE_SINGLE_PRECISION
|
||||
select VFP_FEATURE_DOUBLE_PRECISION
|
||||
select VFP_FEATURE_FMAC
|
||||
select VFP_FEATURE_REGS_S32_D16
|
||||
select VFP_FEATURE_TRAP
|
||||
help
|
||||
This option signifies the use of a VFP floating-point coprocessor
|
||||
that supports half-, single-, double-precision operations (including
|
||||
fused multiply-accumulate) and floating-point exception trapping with 16
|
||||
double-word registers.
|
||||
|
||||
config VFP_DP_D32_FP16_FMAC
|
||||
bool
|
||||
select CPU_HAS_VFP
|
||||
select VFP_FEATURE_HALF_PRECISION
|
||||
select VFP_FEATURE_SINGLE_PRECISION
|
||||
select VFP_FEATURE_DOUBLE_PRECISION
|
||||
select VFP_FEATURE_FMAC
|
||||
select VFP_FEATURE_REGS_S64_D32
|
||||
help
|
||||
This option signifies the use of a VFP floating-point coprocessor
|
||||
that supports half-, single- and double-precision operations
|
||||
(including fused multiply-accumulate) with 32 double-word registers.
|
||||
|
||||
config VFP_U_DP_D32_FP16_FMAC
|
||||
bool
|
||||
select CPU_HAS_VFP
|
||||
select VFP_FEATURE_HALF_PRECISION
|
||||
select VFP_FEATURE_SINGLE_PRECISION
|
||||
select VFP_FEATURE_DOUBLE_PRECISION
|
||||
select VFP_FEATURE_FMAC
|
||||
select VFP_FEATURE_REGS_S64_D32
|
||||
select VFP_FEATURE_TRAP
|
||||
help
|
||||
This option signifies the use of a VFP floating-point coprocessor
|
||||
that supports half-, single-, double-precision operations (including
|
||||
fused multiply-accumulate) and floating-point exception trapping with 32
|
||||
double-word registers.
|
||||
|
||||
if CPU_HAS_VFP
|
||||
|
||||
# VFP feature symbols; these are the helper symbols used by the floating-point
|
||||
# support code to resolve the supported VFP features.
|
||||
|
||||
config VFP_FEATURE_HALF_PRECISION
|
||||
bool
|
||||
help
|
||||
This option signifies that the VFP coprocessor supports
|
||||
half-precision operations (half-precision extension).
|
||||
|
||||
config VFP_FEATURE_SINGLE_PRECISION
|
||||
bool
|
||||
help
|
||||
This option signifies that the VFP coprocessor supports
|
||||
single-precision operations.
|
||||
|
||||
config VFP_FEATURE_DOUBLE_PRECISION
|
||||
bool
|
||||
help
|
||||
This option signifies that the VFP coprocessor supports
|
||||
double-precision operations.
|
||||
|
||||
config VFP_FEATURE_VECTOR
|
||||
bool
|
||||
help
|
||||
This option signifies that the VFP coprocessor supports vector
|
||||
operations.
|
||||
|
||||
config VFP_FEATURE_FMAC
|
||||
bool
|
||||
help
|
||||
This option signifies that the VFP coprocessor supports the fused
|
||||
multiply-accumulate operations.
|
||||
|
||||
config VFP_FEATURE_REGS_S32_D16
|
||||
bool
|
||||
help
|
||||
This option signifies that the VFP coprocessor implements 16
|
||||
double-precision (32 single-precision) floating-point registers.
|
||||
|
||||
config VFP_FEATURE_REGS_S64_D32
|
||||
bool
|
||||
help
|
||||
This option signifies that the VFP coprocessor implements 32
|
||||
double-precision (64 single-precision) floating-point registers.
|
||||
|
||||
config VFP_FEATURE_TRAP
|
||||
bool
|
||||
help
|
||||
This option signifies that the VFP coprocessor supports the trapping
|
||||
of floating-point exceptions to allow software implementation of
|
||||
the unsupported VFP instructions.
|
||||
|
||||
endif # CPU_HAS_VFP
|
||||
|
||||
# Advanced SIMD type symbols; these should be selected by the SoC symbol to
|
||||
# specify the type of the VFP core instantiated by the SoC.
|
||||
|
||||
config NEON
|
||||
bool
|
||||
select CPU_HAS_NEON
|
||||
help
|
||||
This option signifies the use of a NEON Advanced SIMD coprocessor.
|
||||
@@ -9,7 +9,7 @@
|
||||
* @brief Basic C++ destructor module for globals for ARM
|
||||
*/
|
||||
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <toolchain.h>
|
||||
|
||||
EXTERN_C int __cxa_atexit(void (*destructor)(void *), void *objptr, void *dso);
|
||||
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2014 Wind River Systems, Inc.
|
||||
* Copyright (c) 2020-2022 Qualcomm Innovation Center, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
/**
|
||||
* @file
|
||||
* @brief Cache manipulation
|
||||
*
|
||||
* This module contains functions for manipulation caches.
|
||||
*/
|
||||
|
||||
#include <zephyr/arch/cpu.h>
|
||||
#include <zephyr/cache.h>
|
||||
#include <zephyr/arch/arm/aarch32/cortex_m/cmsis.h>
|
||||
|
||||
void arch_dcache_enable(void)
|
||||
{
|
||||
SCB_EnableDCache();
|
||||
}
|
||||
|
||||
void arch_dcache_disable(void)
|
||||
{
|
||||
SCB_DisableDCache();
|
||||
}
|
||||
|
||||
void arch_icache_enable(void)
|
||||
{
|
||||
SCB_EnableICache();
|
||||
}
|
||||
|
||||
void arch_icache_disable(void)
|
||||
{
|
||||
SCB_DisableICache();
|
||||
}
|
||||
|
||||
static void arch_dcache_flush(void *start_addr, size_t size)
|
||||
{
|
||||
SCB_CleanDCache_by_Addr(start_addr, size);
|
||||
}
|
||||
|
||||
static void arch_dcache_invd(void *start_addr, size_t size)
|
||||
{
|
||||
SCB_InvalidateDCache_by_Addr(start_addr, size);
|
||||
}
|
||||
|
||||
static void arch_dcache_flush_and_invd(void *start_addr, size_t size)
|
||||
{
|
||||
SCB_CleanInvalidateDCache_by_Addr(start_addr, size);
|
||||
}
|
||||
|
||||
static void arch_icache_invd(void *start_addr, size_t size)
|
||||
{
|
||||
SCB_InvalidateICache_by_Addr(start_addr, size);
|
||||
}
|
||||
|
||||
int arch_dcache_range(void *addr, size_t size, int op)
|
||||
{
|
||||
if (op == K_CACHE_INVD) {
|
||||
arch_dcache_invd(addr, size);
|
||||
} else if (op == K_CACHE_WB) {
|
||||
arch_dcache_flush(addr, size);
|
||||
} else if (op == K_CACHE_WB_INVD) {
|
||||
arch_dcache_flush_and_invd(addr, size);
|
||||
} else {
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int arch_dcache_all(int op)
|
||||
{
|
||||
if (op == K_CACHE_INVD) {
|
||||
SCB_InvalidateDCache();
|
||||
} else if (op == K_CACHE_WB) {
|
||||
SCB_CleanDCache();
|
||||
} else if (op == K_CACHE_WB_INVD) {
|
||||
SCB_CleanInvalidateDCache();
|
||||
} else {
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int arch_icache_all(int op)
|
||||
{
|
||||
if (op == K_CACHE_INVD) {
|
||||
SCB_InvalidateICache();
|
||||
} else {
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int arch_icache_range(void *addr, size_t size, int op)
|
||||
{
|
||||
if (op == K_CACHE_INVD) {
|
||||
arch_icache_invd(addr, size);
|
||||
} else {
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user