pub fn init(
    params: LfbParameters,
    mapping: &mut ActiveMapping,
    start: VirtAddr,
) -> Option<VirtAddr> {
    if params.bpp != 32 {
        return None;
    }

    let size = params.pitch * params.height * (params.bpp as u32);
    let flags = EntryFlags::PRESENT | EntryFlags::WRITABLE | EntryFlags::NX | EntryFlags::CACHE_WC;

    mapping
        .map_range_physical(start, params.address, size as _, flags)
        .ok()?;

    LFB_TEXT.call_once(|| {
        IrqSpinlock::new(LfbText {
            address: start,
            x: 0,
            y: 0,
            width: params.width,
            height: params.height,
            pitch: params.pitch / 4,
        })
    });

    Some((start + size as _).align_up())
}
/// Initializes the LFB text output.
Initializes the LFB text output.
Initializes the LFB text output .
pub fn init(
    params: LfbParameters,
    mapping: &mut ActiveMapping,
    start: VirtAddr,
) -> Option<VirtAddr> {
    if params.bpp != 32 {
        return None;
    }
    let size = params.pitch * params.height * (params.bpp as u32);
    let flags = EntryFlags::PRESENT | EntryFlags::WRITABLE | EntryFlags::NX | EntryFlags::CACHE_WC;
    mapping
        .map_range_physical(start, params.address, size as _, flags)
        .ok()?;
    LFB_TEXT.call_once(|| {
        IrqSpinlock::new(LfbText {
            address: start,
            x: 0,
            y: 0,
            width: params.width,
            height: params.height,
            pitch: params.pitch / 4,
        })
    });
    Some((start + size as _).align_up())
}
pub fn init ( params : LfbParameters , mapping : & mut ActiveMapping , start : VirtAddr , ) -> Option < VirtAddr > { if params . bpp != 32 { return None ; } let size = params . pitch * params . height * ( params . bpp as u32 ) ; let flags = EntryFlags :: PRESENT | EntryFlags :: WRITABLE | EntryFlags :: NX | EntryFlags :: CACHE_WC ; mapping . map_range_physical ( start , params . address , size as _ , flags ) . ok ( ) ? ; LFB_TEXT . call_once ( | | { IrqSpinlock :: new ( LfbText { address : start , x : 0 , y : 0 , width : params . width , height : params . height , pitch : params . pitch / 4 , } ) } ) ; Some ( ( start + size as _ ) . align_up ( ) ) }
Initializes the LFB text output.
Initializes the LFB text output .
params
LfbParameters
mapping
&mut ActiveMapping
start
VirtAddr
params
LfbParameters
mapping
&mut ActiveMapping
start
VirtAddr