Skip to content

Commit

Permalink
fix: Fix device tree parsing error.
Browse files Browse the repository at this point in the history
fmt the code.

The serial device identifier in the device tree of the latest version of
qemu is changed to "serial".
  • Loading branch information
Godones committed Jan 10, 2024
1 parent ede4e72 commit be861e2
Show file tree
Hide file tree
Showing 45 changed files with 454 additions and 546 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ tools/redis-3.2.9
tools/sqlite-amalgamation-3410100
alien-*
alien.bin
rust
rust

subsystems
3 changes: 1 addition & 2 deletions apps/egui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl GpuDevice {
}
}

impl GPUDevice for GpuDevice{
impl GPUDevice for GpuDevice {
fn flush(&self) {
flush_frame_buffer();
}
Expand All @@ -38,7 +38,6 @@ impl GPUDevice for GpuDevice{
}
}


#[no_mangle]
fn main() {
println!("embedded graphics demo");
Expand Down
2 changes: 1 addition & 1 deletion apps/ls/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn main(_: usize, argv: Vec<String>) -> isize {
}
0
}
const BUF_SIZE:usize = 512;
const BUF_SIZE: usize = 512;
fn parse_args(path: &str) {
let fd = open(path, OpenFlags::O_RDONLY);
assert!(fd >= 0, "open failed");
Expand Down
10 changes: 5 additions & 5 deletions apps/memory-game/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ use rand::prelude::{SliceRandom, SmallRng};
use rand::SeedableRng;
use slint::platform::WindowEvent;
use slint::{Model, VecModel};
use virt2slint::Converter;
use slint_helper::{MyPlatform, SwapBuffer};
use virt2slint::Converter;
use Mstd::io::{keyboard_or_mouse_event, VIRTGPU_XRES, VIRTGPU_YRES};
use Mstd::time::get_time_ms;

Expand Down Expand Up @@ -86,7 +86,7 @@ fn main() {
loop {
// Let Slint run the timer hooks and update animations.
slint::platform::update_timers_and_animations();
let events = checkout_event(&mut converter,&mut x, &mut y);
let events = checkout_event(&mut converter, &mut x, &mut y);
events.iter().for_each(|event| {
window.dispatch_event(event.clone());
});
Expand All @@ -99,17 +99,17 @@ fn main() {
});
}
}
fn checkout_event(converter: &mut Converter,x: &mut isize, y: &mut isize) -> Vec<WindowEvent> {
fn checkout_event(converter: &mut Converter, x: &mut isize, y: &mut isize) -> Vec<WindowEvent> {
let mut events = [0; 100];
let event_num = keyboard_or_mouse_event(&mut events);
let mut res = Vec::new();
for i in 0..event_num as usize {
let event = events[i];
// let window_event = input2event(event, x, y);
let window_event = converter.convert(event, x, y);
window_event.map(|e|{
window_event.map(|e| {
res.push(e);
});
}
res
}
}
10 changes: 5 additions & 5 deletions apps/printdemo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use alloc::vec::Vec;

use slint::platform::WindowEvent;
use slint::Model;
use virt2slint::Converter;
use slint_helper::{MyPlatform, SwapBuffer};
use virt2slint::Converter;
use Mstd::io::{keyboard_or_mouse_event, VIRTGPU_XRES, VIRTGPU_YRES};

#[no_mangle]
Expand Down Expand Up @@ -142,7 +142,7 @@ fn main() -> ! {
loop {
// Let Slint run the timer hooks and update animations.
slint::platform::update_timers_and_animations();
let events = checkout_event(&mut converter,&mut x, &mut y);
let events = checkout_event(&mut converter, &mut x, &mut y);
events.iter().for_each(|event| {
window.dispatch_event(event.clone());
});
Expand All @@ -156,17 +156,17 @@ fn main() -> ! {
}
}

fn checkout_event(converter: &mut Converter,x: &mut isize, y: &mut isize) -> Vec<WindowEvent> {
fn checkout_event(converter: &mut Converter, x: &mut isize, y: &mut isize) -> Vec<WindowEvent> {
let mut events = [0; 100];
let event_num = keyboard_or_mouse_event(&mut events);
let mut res = Vec::new();
for i in 0..event_num as usize {
let event = events[i];
// let window_event = input2event(event, x, y);
let window_event = converter.convert(event, x, y);
window_event.map(|e|{
window_event.map(|e| {
res.push(e);
});
}
res
}
}
6 changes: 3 additions & 3 deletions apps/slint/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fn main() {
loop {
// Let Slint run the timer hooks and update animations.
slint::platform::update_timers_and_animations();
let events = checkout_event(&mut converter,&mut x, &mut y);
let events = checkout_event(&mut converter, &mut x, &mut y);
events.iter().for_each(|event| {
window.dispatch_event(event.clone());
});
Expand All @@ -55,15 +55,15 @@ fn main() {
}
}

fn checkout_event(converter: &mut Converter,x: &mut isize, y: &mut isize) -> Vec<WindowEvent> {
fn checkout_event(converter: &mut Converter, x: &mut isize, y: &mut isize) -> Vec<WindowEvent> {
let mut events = [0; 100];
let event_num = keyboard_or_mouse_event(&mut events);
let mut res = Vec::new();
for i in 0..event_num as usize {
let event = events[i];
// let window_event = input2event(event, x, y);
let window_event = converter.convert(event, x, y);
window_event.map(|e|{
window_event.map(|e| {
res.push(e);
});
}
Expand Down
11 changes: 5 additions & 6 deletions apps/sysinfo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use alloc::vec::Vec;

use slint::platform::WindowEvent;
use slint::SharedString;
use virt2slint::Converter;
use slint_helper::{MyPlatform, SwapBuffer};
use virt2slint::Converter;
use Mstd::io::{keyboard_or_mouse_event, VIRTGPU_XRES, VIRTGPU_YRES};

slint::include_modules!();
Expand Down Expand Up @@ -62,7 +62,7 @@ fn main() {
loop {
// Let Slint run the timer hooks and update animations.
slint::platform::update_timers_and_animations();
let events = checkout_event(&mut converter,&mut x, &mut y);
let events = checkout_event(&mut converter, &mut x, &mut y);
events.iter().for_each(|event| {
window.dispatch_event(event.clone());
});
Expand All @@ -76,18 +76,17 @@ fn main() {
}
}


fn checkout_event(converter: &mut Converter,x: &mut isize, y: &mut isize) -> Vec<WindowEvent> {
fn checkout_event(converter: &mut Converter, x: &mut isize, y: &mut isize) -> Vec<WindowEvent> {
let mut events = [0; 100];
let event_num = keyboard_or_mouse_event(&mut events);
let mut res = Vec::new();
for i in 0..event_num as usize {
let event = events[i];
// let window_event = input2event(event, x, y);
let window_event = converter.convert(event, x, y);
window_event.map(|e|{
window_event.map(|e| {
res.push(e);
});
}
res
}
}
8 changes: 4 additions & 4 deletions apps/todo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use core::default::Default;
use core::iter::Iterator;
use slint::platform::WindowEvent;
use slint::{FilterModel, Model, SortModel};
use virt2slint::Converter;
use slint_helper::{MyPlatform, SwapBuffer};
use virt2slint::Converter;
use Mstd::io::{keyboard_or_mouse_event, VIRTGPU_XRES, VIRTGPU_YRES};

slint::include_modules!();
Expand Down Expand Up @@ -147,7 +147,7 @@ fn main() {
loop {
// Let Slint run the timer hooks and update animations.
slint::platform::update_timers_and_animations();
let events = checkout_event(&mut converter,&mut x, &mut y);
let events = checkout_event(&mut converter, &mut x, &mut y);
events.iter().for_each(|event| {
window.dispatch_event(event.clone());
});
Expand All @@ -161,15 +161,15 @@ fn main() {
}
}

fn checkout_event(converter: &mut Converter,x: &mut isize, y: &mut isize) -> Vec<WindowEvent> {
fn checkout_event(converter: &mut Converter, x: &mut isize, y: &mut isize) -> Vec<WindowEvent> {
let mut events = [0; 100];
let event_num = keyboard_or_mouse_event(&mut events);
let mut res = Vec::new();
for i in 0..event_num as usize {
let event = events[i];
// let window_event = input2event(event, x, y);
let window_event = converter.convert(event, x, y);
window_event.map(|e|{
window_event.map(|e| {
res.push(e);
});
}
Expand Down
38 changes: 0 additions & 38 deletions kernel/src/board/common.rs

This file was deleted.

49 changes: 0 additions & 49 deletions kernel/src/board/cv1811.rs

This file was deleted.

Loading

0 comments on commit be861e2

Please sign in to comment.