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

Commit a20968b

Browse files
authored
Refs #150 -- document println
1 parent 12d2aa5 commit a20968b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/printk.rs

+5
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,9 @@ 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.
4853
#[macro_export]
4954
macro_rules! println {
5055
() => ({

0 commit comments

Comments
 (0)