1
0
mirror of https://github.com/rcore-os/rCore.git synced 2024-11-22 08:06:17 +04:00

Fix mgba merge

This commit is contained in:
Jiajie Chen 2019-06-03 09:46:27 +08:00
parent a42d4b4d26
commit d8ea224283
3 changed files with 25 additions and 25 deletions

View File

@ -13,8 +13,8 @@ pub fn putfmt(fmt: Arguments) {
unsafe { SERIAL_PORT.force_unlock() }
SERIAL_PORT.lock().write_fmt(fmt).unwrap();
//unsafe { CONSOLE.force_unlock() }
//if let Some(console) = CONSOLE.lock().as_mut() {
//console.write_fmt(fmt).unwrap();
//}
unsafe { CONSOLE.force_unlock() }
if let Some(console) = CONSOLE.lock().as_mut() {
console.write_fmt(fmt).unwrap();
}
}

View File

@ -1,6 +1,6 @@
//! Framebuffer
use crate::fs::vga::{fb_bitfield, fb_var_screeninfo};
use crate::fs::vga::{fb_bitfield, fb_fix_screeninfo, fb_var_screeninfo};
use alloc::string::String;
use core::fmt;
use lazy_static::lazy_static;
@ -254,7 +254,7 @@ impl Framebuffer {
var_info.bits_per_pixel = self.fb_info.depth;
}
pub fn fill_fix_screeninfo(&self, fix_info : &mut fb_fix_screeninfo) {
pub fn fill_fix_screeninfo(&self, fix_info: &mut fb_fix_screeninfo) {
fix_info.line_length = self.fb_info.pitch;
}
}

View File

@ -76,7 +76,7 @@ impl INode for Vga {
info!("cmd {:#x} , data {:#x} vga not support ioctl !", cmd, data);
match cmd {
FBIOGET_FSCREENINFO => {
let fb_fix_info = unsafe{ &mut *(data as *mut fb_fix_screeninfo) };
let fb_fix_info = unsafe { &mut *(data as *mut fb_fix_screeninfo) };
if let Some(fb) = FRAME_BUFFER.lock().as_ref() {
fb.fill_fix_screeninfo(fb_fix_info);
}
@ -105,24 +105,24 @@ const FBIOGET_VSCREENINFO: u32 = 0x4600;
#[repr(C)]
pub struct fb_fix_screeninfo {
pub id : [u8;16], /* identification string eg "TT Builtin" */
pub smem_start : u64, /* Start of frame buffer mem */
/* (physical address) */
pub smem_len : u32, /* Length of frame buffer mem */
pub _type : u32, /* see FB_TYPE_* */
pub type_aux : u32, /* Interleave for interleaved Planes */
pub visual : u32, /* see FB_VISUAL_* */
pub xpanstep : u16, /* zero if no hardware panning */
pub ypanstep : u16, /* zero if no hardware panning */
pub ywrapstep : u16, /* zero if no hardware ywrap */
pub line_length : u32, /* length of a line in bytes */
pub mmio_start : u64, /* Start of Memory Mapped I/O */
/* (physical address) */
pub mmio_len : u32, /* Length of Memory Mapped I/O */
pub accel : u32, /* Indicate to driver which */
/* specific chip/card we have */
pub capabilities : u16, /* see FB_CAP_* */
pub reserved : [u16;2], /* Reserved for future compatibility */
pub id: [u8; 16], /* identification string eg "TT Builtin" */
pub smem_start: u64, /* Start of frame buffer mem */
/* (physical address) */
pub smem_len: u32, /* Length of frame buffer mem */
pub _type: u32, /* see FB_TYPE_* */
pub type_aux: u32, /* Interleave for interleaved Planes */
pub visual: u32, /* see FB_VISUAL_* */
pub xpanstep: u16, /* zero if no hardware panning */
pub ypanstep: u16, /* zero if no hardware panning */
pub ywrapstep: u16, /* zero if no hardware ywrap */
pub line_length: u32, /* length of a line in bytes */
pub mmio_start: u64, /* Start of Memory Mapped I/O */
/* (physical address) */
pub mmio_len: u32, /* Length of Memory Mapped I/O */
pub accel: u32, /* Indicate to driver which */
/* specific chip/card we have */
pub capabilities: u16, /* see FB_CAP_* */
pub reserved: [u16; 2], /* Reserved for future compatibility */
}
#[repr(C)]