Skip to content
This repository was archived by the owner on Mar 7, 2021. It is now read-only.

Commit 2165751

Browse files
authored
Refs #150 -- document println (#166)
* Refs #150 -- document println * trailing space * Link to println
1 parent 12d2aa5 commit 2165751

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/printk.rs

+7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ extern "C" {
99
fn printk_helper(s: *const u8, len: c_int) -> c_int;
1010
}
1111

12+
#[doc(hidden)]
1213
pub fn printk(s: &[u8]) {
1314
// TODO: I believe printk never fails
1415
unsafe { printk_helper(s.as_ptr(), s.len() as c_int) };
@@ -17,6 +18,7 @@ pub fn printk(s: &[u8]) {
1718
// From kernel/print/printk.c
1819
const LOG_LINE_MAX: usize = 1024 - 32;
1920

21+
#[doc(hidden)]
2022
pub struct LogLineWriter {
2123
data: [u8; LOG_LINE_MAX],
2224
pos: usize,
@@ -45,6 +47,11 @@ impl fmt::Write for LogLineWriter {
4547
}
4648
}
4749

50+
/// [`println!`] functions the same as it does in `std`, except instead of
51+
/// printing to `stdout`, it writes to the kernel console at the `KERN_INFO`
52+
/// level.
53+
///
54+
/// [`println!`]: https://doc.rust-lang.org/stable/std/macro.println.html
4855
#[macro_export]
4956
macro_rules! println {
5057
() => ({

0 commit comments

Comments
 (0)