Skip to content

Commit c3a6e22

Browse files
Comprehensively re-worked.
This is based off my copy at https://github.com/ferrous-systems/cortex-r/, which you can visit for the pre-history. My only changes in moving to this repository were removing the Ferrocene build (because you don't have a key for it), and adding some QEMU based tests.
1 parent 19c6b36 commit c3a6e22

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+2564
-184
lines changed

.cargo/config.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[target.armv8r-none-eabihf]
2+
# Note, this requires QEMU 9 or higher
3+
runner = "qemu-system-arm -machine mps3-an536 -cpu cortex-r52 -semihosting -nographic -kernel"
4+
5+
[target.armv7r-none-eabihf]
6+
runner = "qemu-system-arm -machine versatileab -cpu cortex-r5f -semihosting -nographic -kernel"
7+
8+
[target.armv7r-none-eabi]
9+
# change to '-mcpu=cortex-r5' to '-mcpu=cortex-r5f' if you use eabi-fpu feature, otherwise
10+
# qemu-system-arm will lock up
11+
runner = "qemu-system-arm -machine versatileab -cpu cortex-r5 -semihosting -nographic -kernel"

.github/bors.toml

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
on:
2+
push:
3+
branches: [ main ]
4+
pull_request:
5+
6+
name: Build
7+
8+
jobs:
9+
# Build the workspace for a target architecture
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
rust: [stable, 1.82]
15+
target:
16+
- armebv7r-none-eabi
17+
- armebv7r-none-eabihf
18+
- armv7r-none-eabi
19+
- armv7r-none-eabihf
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
- name: Install rust
24+
run: |
25+
rustup install ${{ matrix.rust }}
26+
rustup default ${{ matrix.rust }}
27+
rustup target add ${{ matrix.target }}
28+
- name: Build
29+
run: |
30+
cargo build --target ${{ matrix.target }}
31+
32+
# Build the host tools
33+
build-host:
34+
runs-on: ubuntu-latest
35+
strategy:
36+
matrix:
37+
rust: [stable, 1.82]
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v4
41+
- name: Install rust
42+
run: |
43+
rustup install ${{ matrix.rust }}
44+
rustup default ${{ matrix.rust }}
45+
- name: Build
46+
run: |
47+
cd arm-targets
48+
cargo build
49+
50+
# Build the workspace for the target architecture but using nightly to compile libcore
51+
build-tier3:
52+
runs-on: ubuntu-latest
53+
strategy:
54+
matrix:
55+
target:
56+
- armebv7r-none-eabi
57+
- armebv7r-none-eabihf
58+
- armv7r-none-eabi
59+
- armv7r-none-eabihf
60+
- armv8r-none-eabihf
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@v4
64+
- name: Install rust
65+
run: |
66+
rustup install nightly
67+
rustup default nightly
68+
rustup component add rust-src --toolchain nightly
69+
- name: Build
70+
run: |
71+
cargo build --target ${{ matrix.target }} -Zbuild-std=core
72+
73+
# Gather all the above build jobs together for the purposes of getting an overall pass-fail
74+
build-all:
75+
runs-on: ubuntu-latest
76+
needs: [build, build-tier3, build-host]
77+
steps:
78+
- run: /bin/true
79+
80+
# Build the docs for the workspace
81+
docs:
82+
runs-on: ubuntu-latest
83+
strategy:
84+
matrix:
85+
rust: [stable, 1.82]
86+
target:
87+
- armebv7r-none-eabi
88+
- armebv7r-none-eabihf
89+
- armv7r-none-eabi
90+
- armv7r-none-eabihf
91+
steps:
92+
- name: Checkout
93+
uses: actions/checkout@v4
94+
- name: Install rust
95+
run: |
96+
rustup install ${{ matrix.rust }}
97+
rustup default ${{ matrix.rust }}
98+
rustup target add ${{ matrix.target }}
99+
- name: Build docs
100+
run: |
101+
cargo doc --target ${{ matrix.target }}
102+
103+
# Build the docs for the host tools
104+
docs-host:
105+
runs-on: ubuntu-latest
106+
strategy:
107+
matrix:
108+
rust: [stable, 1.82]
109+
steps:
110+
- name: Checkout
111+
uses: actions/checkout@v4
112+
- name: Install rust
113+
run: |
114+
rustup install ${{ matrix.rust }}
115+
rustup default ${{ matrix.rust }}
116+
- name: Build docs
117+
run: |
118+
cd arm-targets
119+
cargo doc
120+
121+
# Gather all the above doc jobs together for the purposes of getting an overall pass-fail
122+
docs-all:
123+
runs-on: ubuntu-latest
124+
needs: [docs, docs-host]
125+
steps:
126+
- run: /bin/true
127+
128+
# Format the workspace
129+
fmt:
130+
runs-on: ubuntu-latest
131+
steps:
132+
- name: Checkout
133+
uses: actions/checkout@v4
134+
- name: Install rust
135+
run: |
136+
rustup install stable
137+
rustup default stable
138+
- name: Format
139+
run: |
140+
cargo fmt --check
141+
142+
# Format the host tools
143+
fmt-host:
144+
runs-on: ubuntu-latest
145+
steps:
146+
- name: Checkout
147+
uses: actions/checkout@v4
148+
- name: Install rust
149+
run: |
150+
rustup install stable
151+
rustup default stable
152+
- name: Format
153+
run: |
154+
cd arm-targets
155+
cargo fmt --check
156+
157+
# Gather all the above fmt jobs together for the purposes of getting an overall pass-fail
158+
fmt-all:
159+
runs-on: ubuntu-latest
160+
needs: [fmt, fmt-host]
161+
steps:
162+
- run: /bin/true
163+
164+
# Run clippy on the workpace
165+
clippy:
166+
runs-on: ubuntu-latest
167+
strategy:
168+
matrix:
169+
rust: [stable, 1.82]
170+
target:
171+
- armebv7r-none-eabi
172+
- armebv7r-none-eabihf
173+
- armv7r-none-eabi
174+
- armv7r-none-eabihf
175+
steps:
176+
- name: Checkout
177+
uses: actions/checkout@v4
178+
- name: Install rust
179+
run: |
180+
rustup install ${{ matrix.rust }}
181+
rustup default ${{ matrix.rust }}
182+
rustup target add ${{ matrix.target }}
183+
rustup component add clippy
184+
- name: Clippy
185+
run: |
186+
cargo clippy --target ${{ matrix.target }}
187+
188+
# Run clippy on the host tools
189+
clippy-host:
190+
runs-on: ubuntu-latest
191+
strategy:
192+
matrix:
193+
rust: [stable, 1.82]
194+
steps:
195+
- name: Checkout
196+
uses: actions/checkout@v4
197+
- name: Install rust
198+
run: |
199+
rustup install ${{ matrix.rust }}
200+
rustup default ${{ matrix.rust }}
201+
rustup component add clippy
202+
- name: Clippy
203+
run: |
204+
cd arm-targets
205+
cargo clippy
206+
207+
# Gather all the above clippy jobs together for the purposes of getting an overall pass-fail
208+
clippy-all:
209+
runs-on: ubuntu-latest
210+
needs: [clippy, clippy-host]
211+
steps:
212+
- run: /bin/true
213+
214+
# Run some programs in QEMU
215+
test:
216+
runs-on: ubuntu-latest
217+
needs: [build-all]
218+
steps:
219+
- run: sudo apt-get -y update && sudo apt-get -y install qemu-system-arm
220+
- name: Checkout
221+
uses: actions/checkout@v4
222+
- run: ./tests.sh
223+
224+
# Gather all the above xxx-all jobs together for the purposes of getting an overall pass-fail
225+
all:
226+
runs-on: ubuntu-latest
227+
needs: [docs-all, build-all, fmt-all, test] # not gating on clippy-all
228+
steps:
229+
- run: /bin/true

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
**/*.rs.bk
2-
.#*
3-
/target
1+
target
42
Cargo.lock

.travis.yml

Lines changed: 0 additions & 70 deletions
This file was deleted.

Cargo.toml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
[package]
2-
authors = ["Cortex-R team <[email protected]>"]
3-
edition = "2018"
4-
name = "cortex-r"
5-
version = "0.1.0-alpha"
6-
7-
[dependencies]
1+
[workspace]
2+
exclude = [
3+
"arm-targets",
4+
]
5+
members = [
6+
"cortex-r",
7+
"cortex-r-examples",
8+
"cortex-r-rt",
9+
]
10+
resolver = "2"

LICENSE-APACHE

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -174,28 +174,3 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
174174
of your accepting any such warranty or additional liability.
175175

176176
END OF TERMS AND CONDITIONS
177-
178-
APPENDIX: How to apply the Apache License to your work.
179-
180-
To apply the Apache License to your work, attach the following
181-
boilerplate notice, with the fields enclosed by brackets "[]"
182-
replaced with your own identifying information. (Don't include
183-
the brackets!) The text should be enclosed in the appropriate
184-
comment syntax for the file format. We also recommend that a
185-
file or class name and description of purpose be included on the
186-
same "printed page" as the copyright notice for easier
187-
identification within third-party archives.
188-
189-
Copyright [yyyy] [name of copyright owner]
190-
191-
Licensed under the Apache License, Version 2.0 (the "License");
192-
you may not use this file except in compliance with the License.
193-
You may obtain a copy of the License at
194-
195-
http://www.apache.org/licenses/LICENSE-2.0
196-
197-
Unless required by applicable law or agreed to in writing, software
198-
distributed under the License is distributed on an "AS IS" BASIS,
199-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200-
See the License for the specific language governing permissions and
201-
limitations under the License.

0 commit comments

Comments
 (0)