Significant improvements for events - switch to event queue in orbital

This commit is contained in:
Jeremy Soller 2016-10-14 20:12:21 -06:00
commit 77810d6713

View file

@ -6,10 +6,10 @@ extern crate alloc;
extern crate orbclient;
extern crate syscall;
use std::{env, thread};
use std::{env, mem, thread};
use std::fs::File;
use std::io::{Read, Write};
use syscall::{physmap, physunmap, Packet, Scheme, MAP_WRITE, MAP_WRITE_COMBINE};
use syscall::{physmap, physunmap, Packet, Scheme, EVENT_READ, MAP_WRITE, MAP_WRITE_COMBINE};
use mode_info::VBEModeInfo;
use primitive::fast_set64;
@ -87,22 +87,22 @@ fn main() {
}
}
// If there are requested events, and data is available, send a notification
/* TODO
if (! scheme.screen.borrow().input.is_empty() || scheme.screen.borrow().end_of_input) && scheme.screen.borrow().requested & EVENT_READ == EVENT_READ {
let event_packet = Packet {
id: 0,
pid: 0,
uid: 0,
gid: 0,
a: syscall::number::SYS_FEVENT,
b: 0,
c: EVENT_READ,
d: scheme.screen.borrow().input.len()
};
socket.write(&event_packet).expect("vesad: failed to write display scheme");
for (screen_id, screen) in scheme.screens.borrow().iter() {
if ! screen.will_block() {
let event_packet = Packet {
id: 0,
pid: 0,
uid: 0,
gid: 0,
a: syscall::number::SYS_FEVENT,
b: *screen_id,
c: EVENT_READ,
d: mem::size_of::<Packet>()
};
socket.write(&event_packet).expect("vesad: failed to write display event");
}
}
*/
}
});
}