Skip to content

Commit 7c904ec

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 75bd6fc + 54bfff3 commit 7c904ec

Some content is hidden

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

104 files changed

+1250
-1219
lines changed

.github/bors.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
block_labels = ["needs-decision"]
22
delete_merged_branches = true
33
required_approvals = 1
4-
status = ["continuous-integration/travis-ci/push"]
4+
status = [
5+
"ci-linux (stable)",
6+
"ci-linux (1.59.0)",
7+
"build-other (macOS-latest)",
8+
"build-other (windows-latest)",
9+
"Rustfmt"
10+
]

.github/workflows/ci.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
on:
2+
push:
3+
branches: [ staging, trying, master ]
4+
pull_request:
5+
6+
name: Continuous integration
7+
8+
jobs:
9+
ci-linux:
10+
runs-on: ubuntu-20.04
11+
continue-on-error: ${{ matrix.experimental || false }}
12+
strategy:
13+
matrix:
14+
# All generated code should be running on stable now, MRSV is 1.59.0
15+
rust: [nightly, stable, 1.59.0]
16+
17+
include:
18+
# Nightly is only for reference and allowed to fail
19+
- rust: nightly
20+
experimental: true
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
- uses: actions-rs/toolchain@v1
25+
with:
26+
profile: minimal
27+
toolchain: ${{ matrix.rust }}
28+
override: true
29+
- name: Install all Rust targets for ${{ matrix.rust }}
30+
run: rustup target install --toolchain=${{ matrix.rust }} x86_64-unknown-linux-gnu riscv32imac-unknown-none-elf riscv64imac-unknown-none-elf riscv64gc-unknown-none-elf
31+
- name: Install riscv gcc
32+
run: sudo apt-get update && sudo apt-get install -y gcc-riscv64-unknown-elf
33+
- name: Run CI script for x86_64-unknown-linux-gnu under ${{ matrix.rust }}
34+
run: cargo check --target x86_64-unknown-linux-gnu
35+
- name: Run CI script for riscv32imac-unknown-none-elf under ${{ matrix.rust }}
36+
run: cargo check --target riscv32imac-unknown-none-elf
37+
- name: Run CI script for riscv64imac-unknown-none-elf under ${{ matrix.rust }}
38+
run: cargo check --target riscv64imac-unknown-none-elf
39+
- name: Run CI script for riscv64gc-unknown-none-elf under ${{ matrix.rust }}
40+
run: cargo check --target riscv64gc-unknown-none-elf
41+
42+
# On macOS and Windows, we at least make sure that the crate builds and links.
43+
build-other:
44+
strategy:
45+
matrix:
46+
os:
47+
- macOS-latest
48+
- windows-latest
49+
runs-on: ${{ matrix.os }}
50+
51+
steps:
52+
- uses: actions/checkout@v2
53+
- uses: actions-rs/toolchain@v1
54+
with:
55+
profile: minimal
56+
toolchain: stable
57+
override: true
58+
- name: Build crate for host OS
59+
run: cargo build

.github/workflows/rustfmt.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
on:
3+
push:
4+
branches: [ staging, trying, master ]
5+
pull_request:
6+
7+
name: Code formatting check
8+
9+
jobs:
10+
fmt:
11+
name: Rustfmt
12+
runs-on: ubuntu-20.04
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions-rs/toolchain@v1
16+
with:
17+
profile: minimal
18+
toolchain: stable
19+
override: true
20+
components: rustfmt
21+
- uses: actions-rs/cargo@v1
22+
with:
23+
command: fmt
24+
args: --all -- --check

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
Cargo.lock
22
target/
3-
bin/*.after
4-
bin/*.before
5-
bin/*.o

.travis.yml

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

CHANGELOG.md

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,56 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- Fix `asm::delay()` to ensure count register is always reloaded
13+
14+
## [v0.8.0] - 2022-04-20
15+
16+
### Added
17+
18+
- Add `#[cfg(riscv32)]` to `pmpcfg1` and `pmpcfg3` modules
19+
- Add enums `Range`, `Permission` for PMP configuration
20+
- Add `set_pmp()` and `clear_pmp()` functions to pmpcfg(x) modules
21+
- Add struct `Pmpcsr` and is returned from `pmpcfgx::read()`
22+
- Add `singleton!` macro
23+
- Add delay structure and methods using embedded-hal traits and `mcycle` register
24+
- Add `asm::delay()` function for assembly-based busy-loops
25+
- Add `asm::nop()`, a wrapper for implementing a `nop` instruction
26+
- Add missing `#[inline]` attribute to register reads, type conversations and `interrupt::free`
27+
28+
### Changed
29+
30+
- Use new `asm!` instead of `llvm_asm!`
31+
- Change `pmpcfgx::read()` macro to `read_csr_as!()` from `read_csr_as_usize!()`
32+
- Inline assembly is now always used
33+
- Update Minimum Supported Rust Version to 1.59
34+
35+
### Fixed
36+
37+
- Fix `sfence.vma` operand order
38+
39+
### Removed
40+
41+
- Remove `inline-asm` feature which is now always enabled
42+
43+
## [v0.7.0] - 2021-07-29
44+
45+
### Added
46+
47+
- Add `medeleg` register
48+
- Add `cycle[h]`, `instret[h]` and `mcounteren`
49+
- Add additional binaries for floating-point ABIs
50+
- Add support for `mxr`
51+
- Add support for `mprv`
52+
53+
### Changed
54+
55+
- Fix `scause::set`
56+
- Various formatting and comment fixes
57+
- Update `bare-metal` to `v1.0.0` removing `Nr` trait
58+
- Build targets on `docs.rs` are now RISC-V targets other than default ones
59+
1060
## [v0.6.0] - 2020-06-20
1161

1262
### Changed
@@ -39,7 +89,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
3989

4090
- Fixed MSRV by restricting the upper bound of `bare-metal` version
4191

42-
[Unreleased]: https://github.com/rust-embedded/riscv/compare/v0.6.0...HEAD
92+
[Unreleased]: https://github.com/rust-embedded/riscv/compare/v0.8.0...HEAD
93+
[v0.8.0]: https://github.com/rust-embedded/riscv/compare/v0.7.0...v0.8.0
94+
[v0.7.0]: https://github.com/rust-embedded/riscv/compare/v0.6.0...v0.7.0
4395
[v0.6.0]: https://github.com/rust-embedded/riscv/compare/v0.5.6...v0.6.0
4496
[v0.5.6]: https://github.com/rust-embedded/riscv/compare/v0.5.5...v0.5.6
4597
[v0.5.5]: https://github.com/rust-embedded/riscv/compare/v0.5.4...v0.5.5

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Conduct
44

5-
**Contact**: [RISC-V team](https://github.com/rust-embedded/wg#the-riscv-team)
5+
**Contact**: [RISC-V team](https://github.com/rust-embedded/wg#the-risc-v-team)
66

77
* We are committed to providing a friendly, safe and welcoming environment for all, regardless of level of experience, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other similar characteristic.
88
* On IRC, please avoid using overtly sexual nicknames or other nicknames that might detract from a friendly, safe and welcoming environment for all.

Cargo.toml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
[package]
22
name = "riscv"
3-
version = "0.6.0"
3+
version = "0.8.0"
4+
edition = "2021"
5+
rust-version = "1.59"
46
repository = "https://github.com/rust-embedded/riscv"
57
authors = ["The RISC-V Team <[email protected]>"]
68
categories = ["embedded", "hardware-support", "no-std"]
79
description = "Low level access to RISC-V processors"
810
keywords = ["riscv", "register", "peripheral"]
911
license = "ISC"
1012

13+
[package.metadata.docs.rs]
14+
default-target = "riscv64imac-unknown-none-elf"
15+
targets = [
16+
"riscv32i-unknown-none-elf", "riscv32imc-unknown-none-elf", "riscv32imac-unknown-none-elf",
17+
"riscv64imac-unknown-none-elf", "riscv64gc-unknown-none-elf",
18+
]
19+
1120
[dependencies]
12-
bare-metal = "0.2.5"
21+
bare-metal = "1.0.0"
1322
bitflags = "1.0"
1423
bit_field = "0.10.0"
1524
log = "0.4"
16-
17-
[build-dependencies]
18-
riscv-target = "0.1.2"
19-
20-
[features]
21-
inline-asm = []
25+
embedded-hal = "0.2.6"

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ This project is developed and maintained by the [RISC-V team][team].
1212

1313
## Minimum Supported Rust Version (MSRV)
1414

15-
This crate is guaranteed to compile on stable Rust 1.42.0 and up. It *might*
15+
This crate is guaranteed to compile on stable Rust 1.59 and up. It *might*
1616
compile with older versions but that may change in any new patch release.
1717

1818
## License
1919

20-
Copyright 2019-2020 [RISC-V team][team]
20+
Copyright 2019-2022 [RISC-V team][team]
2121

2222
Permission to use, copy, modify, and/or distribute this software for any purpose
2323
with or without fee is hereby granted, provided that the above copyright notice
@@ -38,4 +38,4 @@ Conduct][CoC], the maintainer of this crate, the [RISC-V team][team], promises
3838
to intervene to uphold that code of conduct.
3939

4040
[CoC]: CODE_OF_CONDUCT.md
41-
[team]: https://github.com/rust-embedded/wg#the-riscv-team
41+
[team]: https://github.com/rust-embedded/wg#the-risc-v-team

0 commit comments

Comments
 (0)