Skip to content

Commit 9816097

Browse files
committed
feat: build the bouffalo-hal project under stable Rustc 1.85.0
Signed-off-by: Zhouqi Jiang <luojia@hust.edu.cn>
1 parent 7b5929c commit 9816097

File tree

8 files changed

+21
-16
lines changed

8 files changed

+21
-16
lines changed

.github/workflows/Cargo.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@v4
1616
- uses: actions-rust-lang/setup-rust-toolchain@v1
1717
with:
18-
toolchain: nightly
18+
toolchain: stable
1919
components: rustfmt
2020
- name: Rustfmt Check
2121
uses: actions-rust-lang/rustfmt@v1
@@ -31,7 +31,7 @@ jobs:
3131
- uses: actions/checkout@v4
3232
- uses: actions-rust-lang/setup-rust-toolchain@v1
3333
with:
34-
toolchain: nightly
34+
toolchain: stable
3535
- name: Run tests
3636
run: cargo test -p ${{ MATRIX.PACKAGE }}
3737

@@ -42,7 +42,7 @@ jobs:
4242
strategy:
4343
matrix:
4444
TARGET: [riscv64imac-unknown-none-elf]
45-
TOOLCHAIN: [nightly]
45+
TOOLCHAIN: [stable]
4646
EXAMPLES: [gpio-demo, i2c-demo, jtag-demo, lz4d-demo, pwm-demo,
4747
sdcard-demo, sdcard-gpt-demo, spi-demo, uart-demo, uart-async-demo, uart-cli-demo]
4848
steps:

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ members = [
2222
"examples/peripherals/psram-demo",
2323
"examples/peripherals/sdh-demo",
2424
]
25-
resolver = "2"
25+
resolver = "3"

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
This repository contains `bouffalo-hal` and `bouffalo-rt` packages.
44

5+
## Minimum supported Rust version
6+
7+
To compile the `bouffalo-hal` crates, you need at least stable Rust version of `rustc 1.85.0`.
8+
59
## License
610

711
Project is dual licensed under MIT or Mulan-PSL v2.

bouffalo-rt/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ cfg-if = "1.0.0"
1313
embedded-time = "0.12.1"
1414
plic = "0.0.2"
1515
xuantie-riscv = { git = "https://github.com/rustsbi/xuantie", rev = "fe7ec712" }
16+
# FIXME: remove this dependency once `#![feature(naked_functions)]` is stablized
17+
naked-function = "0.1.5"
1618

1719
[dev-dependencies]
1820
memoffset = "0.9.1"

bouffalo-rt/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//! Bouffalo chip ROM runtime library.
2-
#![feature(naked_functions)]
32
#![no_std]
43

54
#[macro_use]

bouffalo-rt/src/soc/bl616.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::{HalBasicConfig, HalFlashConfig, HalPatchCfg};
44
use core::ops::Deref;
55

66
#[cfg(all(feature = "bl616", target_arch = "riscv32"))]
7-
#[naked]
7+
#[naked_function::naked]
88
#[link_section = ".text.entry"]
99
#[export_name = "_start"]
1010
unsafe extern "C" fn start() -> ! {

bouffalo-rt/src/soc/bl702.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use core::ops::Deref;
1515
const LEN_STACK: usize = 1 * 1024;
1616

1717
#[cfg(feature = "bl702")]
18-
#[naked]
18+
#[naked_function::naked]
1919
#[unsafe(link_section = ".text.entry")]
2020
#[unsafe(export_name = "_start")]
2121
unsafe extern "C" fn start() -> ! {

bouffalo-rt/src/soc/bl808.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::{HalBasicConfig, HalFlashConfig, HalPatchCfg};
44
use core::ops::Deref;
55

66
#[cfg(all(feature = "bl808-mcu", target_arch = "riscv32"))]
7-
#[naked]
7+
#[naked_function::naked]
88
#[unsafe(link_section = ".text.entry")]
99
#[unsafe(export_name = "_start")]
1010
unsafe extern "C" fn start() -> ! {
@@ -58,7 +58,7 @@ unsafe extern "C" fn start() -> ! {
5858
}
5959

6060
#[cfg(all(feature = "bl808-dsp", target_arch = "riscv64"))]
61-
#[naked]
61+
#[naked_function::naked]
6262
#[unsafe(link_section = ".text.entry")]
6363
#[unsafe(export_name = "_start")]
6464
unsafe extern "C" fn start() -> ! {
@@ -112,7 +112,7 @@ unsafe extern "C" fn start() -> ! {
112112
}
113113

114114
#[cfg(all(feature = "bl808-lp", target_arch = "riscv32"))]
115-
#[naked]
115+
#[naked_function::naked]
116116
#[unsafe(link_section = ".text.entry")]
117117
#[unsafe(export_name = "_start")]
118118
unsafe extern "C" fn start() -> ! {
@@ -168,7 +168,7 @@ unsafe extern "Rust" {
168168
all(feature = "bl808-dsp", target_arch = "riscv64")
169169
))]
170170
#[unsafe(link_section = ".trap.trap-entry")]
171-
#[naked]
171+
#[naked_function::naked]
172172
unsafe extern "C" fn trap_vectored() -> ! {
173173
unsafe {
174174
core::arch::naked_asm!(
@@ -208,7 +208,7 @@ unsafe extern "C" fn trap_vectored() -> ! {
208208
all(feature = "bl808-mcu", target_arch = "riscv32"),
209209
all(feature = "bl808-dsp", target_arch = "riscv64")
210210
))]
211-
#[naked]
211+
#[naked_function::naked]
212212
unsafe extern "C" fn reserved() -> ! {
213213
unsafe { core::arch::naked_asm!("1: j 1b") }
214214
}
@@ -220,13 +220,13 @@ unsafe extern "C" {
220220

221221
// TODO exceptions_trampoline for bl808-mcu
222222
#[cfg(all(feature = "bl808-mcu", target_arch = "riscv32"))]
223-
#[naked]
223+
#[naked_function::naked]
224224
unsafe extern "C" fn exceptions_trampoline() -> ! {
225225
unsafe { core::arch::naked_asm!("") }
226226
}
227227

228228
#[cfg(all(feature = "bl808-dsp", target_arch = "riscv64"))]
229-
#[naked]
229+
#[naked_function::naked]
230230
unsafe extern "C" fn exceptions_trampoline() -> ! {
231231
unsafe {
232232
core::arch::naked_asm!(
@@ -287,13 +287,13 @@ unsafe extern "C" fn exceptions_trampoline() -> ! {
287287

288288
// TODO machine_external_trampoline for bl808-mcu
289289
#[cfg(all(feature = "bl808-mcu", target_arch = "riscv32"))]
290-
#[naked]
290+
#[naked_function::naked]
291291
unsafe extern "C" fn machine_external_trampoline() -> ! {
292292
unsafe { core::arch::naked_asm!("") }
293293
}
294294

295295
#[cfg(all(feature = "bl808-dsp", target_arch = "riscv64"))]
296-
#[naked]
296+
#[naked_function::naked]
297297
unsafe extern "C" fn machine_external_trampoline() -> ! {
298298
unsafe {
299299
core::arch::naked_asm!(

0 commit comments

Comments
 (0)