MCPcopy Create free account
hub / github.com/Ruddle/Fomos / new

Method new

bootloader/kernel/src/logger.rs:20–40  ·  view source on GitHub ↗

Create a new instance that logs to the given framebuffer.

(
        framebuffer: &'static mut [u8],
        info: FrameBufferInfo,
        frame_buffer_logger_status: bool,
        serial_logger_status: bool,
    )

Source from the content-addressed store, hash-verified

18impl LockedLogger {
19 /// Create a new instance that logs to the given framebuffer.
20 pub fn new(
21 framebuffer: &'static mut [u8],
22 info: FrameBufferInfo,
23 frame_buffer_logger_status: bool,
24 serial_logger_status: bool,
25 ) -> Self {
26 let framebuffer = match frame_buffer_logger_status {
27 true => Some(Spinlock::new(FrameBufferWriter::new(framebuffer, info))),
28 false => None,
29 };
30
31 let serial = match serial_logger_status {
32 true => Some(Spinlock::new(unsafe { SerialPort::init() })),
33 false => None,
34 };
35
36 LockedLogger {
37 framebuffer,
38 serial,
39 }
40 }
41
42 /// Force-unlocks the logger to prevent a deadlock.
43 ///

Callers

nothing calls this directly

Calls 1

initFunction · 0.70

Tested by

no test coverage detected