Skip to content

Commit f59bbc2

Browse files
authored
Merge pull request betrusted-io#266 from Foundation-Devices/driver-refactor
kernel: Drivers refactor.
2 parents ebc0739 + 6332bf1 commit f59bbc2

File tree

17 files changed

+555
-431
lines changed

17 files changed

+555
-431
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

kernel/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description = "Core kernel for Xous, including task switching and memory managem
44
license = "MIT OR Apache-2.0"
55
edition = "2018"
66
name = "xous-kernel"
7-
version = "0.9.17"
7+
version = "0.9.18"
88
resolver = "2"
99

1010
# Dependency versions enforced by Cargo.lock.

kernel/src/arch/riscv/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ pub mod exception;
77
pub mod irq;
88
pub mod mem;
99
pub mod process;
10-
pub mod rand;
1110
pub mod syscall;
1211

1312
pub use process::Thread;
@@ -49,7 +48,6 @@ pub fn init() {
4948
sie::set_ssoft();
5049
sie::set_sext();
5150
}
52-
rand::init();
5351
}
5452

5553
/// Put the core to sleep until an interrupt hits. Returns `true`

kernel/src/arch/riscv/rand.rs

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

kernel/src/debug/macros.rs

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// SPDX-FileCopyrightText: 2020 Sean Cross <[email protected]>
2+
// SPDX-FileCopyrightText: 2022 Foundation Devices, Inc. <[email protected]>
3+
// SPDX-License-Identifier: Apache-2.0
4+
5+
/// Prints to the debug output directly.
6+
#[cfg(baremetal)]
7+
#[macro_export]
8+
macro_rules! print {
9+
($($args:tt)+) => {{
10+
#[allow(unused_unsafe)]
11+
unsafe {
12+
use core::fmt::Write;
13+
if let Some(stream) = crate::debug::shell::OUTPUT.as_mut() {
14+
write!(stream, $($args)+).unwrap();
15+
}
16+
}
17+
}};
18+
}
19+
20+
/// Prints to the debug output directly, with a newline.
21+
#[cfg(baremetal)]
22+
#[macro_export]
23+
macro_rules! println {
24+
() => ({
25+
print!("\r\n")
26+
});
27+
($fmt:expr) => ({
28+
print!(concat!($fmt, "\r\n"))
29+
});
30+
($fmt:expr, $($args:tt)+) => ({
31+
print!(concat!($fmt, "\r\n"), $($args)+)
32+
});
33+
}
34+
35+
#[cfg(feature = "debug-print")]
36+
#[macro_export]
37+
macro_rules! klog {
38+
() => ({
39+
print!(" [{}:{}]", file!(), line!())
40+
});
41+
($fmt:expr) => ({
42+
print!(concat!(" [{}:{} ", $fmt, "]"), file!(), line!())
43+
});
44+
($fmt:expr, $($args:tt)+) => ({
45+
print!(concat!(" [{}:{} ", $fmt, "]"), file!(), line!(), $($args)+)
46+
});
47+
}
48+
49+
#[cfg(not(feature = "debug-print"))]
50+
#[macro_export]
51+
macro_rules! klog {
52+
($($args:tt)+) => {{}};
53+
}

0 commit comments

Comments
 (0)