diff --git a/ahcid/Cargo.toml b/ahcid/Cargo.toml index 324ea857b2..f7183317cb 100644 --- a/ahcid/Cargo.toml +++ b/ahcid/Cargo.toml @@ -7,4 +7,4 @@ bitflags = "*" dma = { path = "../../crates/dma/" } io = { path = "../../crates/io/" } spin = "*" -syscall = { path = "../../syscall/" } +redox_syscall = { path = "../../syscall/" } diff --git a/e1000d/Cargo.toml b/e1000d/Cargo.toml index 9a9f2ab0a9..ec8c45e1ab 100644 --- a/e1000d/Cargo.toml +++ b/e1000d/Cargo.toml @@ -8,4 +8,4 @@ dma = { path = "../../crates/dma/" } event = { path = "../../crates/event/" } io = { path = "../../crates/io/" } netutils = { path = "../../programs/netutils/" } -syscall = { path = "../../syscall/" } +redox_syscall = { path = "../../syscall/" } diff --git a/pcid/Cargo.toml b/pcid/Cargo.toml index 222032c14b..a64211d070 100644 --- a/pcid/Cargo.toml +++ b/pcid/Cargo.toml @@ -3,11 +3,9 @@ name = "pcid" version = "0.1.0" [dependencies] +redox_syscall = { path = "../../syscall/" } rustc-serialize = { git = "https://github.com/redox-os/rustc-serialize.git" } toml = "*" -[dependencies.syscall] -path = "../../syscall/" - [replace] "rustc-serialize:0.3.19" = { git = "https://github.com/redox-os/rustc-serialize.git" } diff --git a/ps2d/Cargo.toml b/ps2d/Cargo.toml index 0c10180c45..98ebbf218f 100644 --- a/ps2d/Cargo.toml +++ b/ps2d/Cargo.toml @@ -7,4 +7,4 @@ bitflags = "*" event = { path = "../../crates/event/" } io = { path = "../../crates/io/" } orbclient = "0.1" -syscall = { path = "../../syscall/" } +redox_syscall = { path = "../../syscall/" } diff --git a/rtl8168d/Cargo.toml b/rtl8168d/Cargo.toml index a4243e736d..e72a130458 100644 --- a/rtl8168d/Cargo.toml +++ b/rtl8168d/Cargo.toml @@ -8,4 +8,4 @@ dma = { path = "../../crates/dma/" } event = { path = "../../crates/event/" } io = { path = "../../crates/io/" } netutils = { path = "../../programs/netutils/" } -syscall = { path = "../../syscall/" } +redox_syscall = { path = "../../syscall/" } diff --git a/vesad/Cargo.toml b/vesad/Cargo.toml index 8045332cc5..db87c0d1f9 100644 --- a/vesad/Cargo.toml +++ b/vesad/Cargo.toml @@ -4,9 +4,9 @@ version = "0.1.0" [dependencies] orbclient = "0.1" -ransid = { git = "https://github.com/redox-os/ransid.git" } +ransid = "0.2" rusttype = { git = "https://github.com/dylanede/rusttype.git", optional = true } -syscall = { path = "../../syscall/" } +redox_syscall = "0.1" [features] default = [] diff --git a/vesad/src/scheme.rs b/vesad/src/scheme.rs index c81f558c99..a58e7fd112 100644 --- a/vesad/src/scheme.rs +++ b/vesad/src/scheme.rs @@ -72,6 +72,14 @@ impl SchemeMut for DisplayScheme { } } + fn fmap(&mut self, id: usize, offset: usize, size: usize) -> Result { + if let Some(screen) = self.screens.get(&id) { + screen.map(offset, size) + } else { + Err(Error::new(EBADF)) + } + } + fn fpath(&mut self, id: usize, buf: &mut [u8]) -> Result { let path_str = if id == 0 { format!("display:input") diff --git a/vesad/src/screen/graphic.rs b/vesad/src/screen/graphic.rs index 11a6e2e935..b91192267a 100644 --- a/vesad/src/screen/graphic.rs +++ b/vesad/src/screen/graphic.rs @@ -45,6 +45,14 @@ impl Screen for GraphicScreen { Ok(0) } + fn map(&self, offset: usize, size: usize) -> Result { + if offset + size <= self.display.offscreen.len() * 4 { + Ok(self.display.offscreen.as_ptr() as usize + offset) + } else { + Err(Error::new(EINVAL)) + } + } + fn input(&mut self, event: &Event) { if let EventOption::Mouse(mut mouse_event) = event.to_option() { let x = cmp::max(0, cmp::min(self.display.width as i32, self.mouse_x + mouse_event.x)); diff --git a/vesad/src/screen/mod.rs b/vesad/src/screen/mod.rs index 6a0d5fdfad..9909694a99 100644 --- a/vesad/src/screen/mod.rs +++ b/vesad/src/screen/mod.rs @@ -14,6 +14,8 @@ pub trait Screen { fn event(&mut self, flags: usize) -> Result; + fn map(&self, offset: usize, size: usize) -> Result; + fn input(&mut self, event: &Event); fn read(&mut self, buf: &mut [u8]) -> Result; diff --git a/vesad/src/screen/text.rs b/vesad/src/screen/text.rs index 1fcb988fcd..6d267d7e24 100644 --- a/vesad/src/screen/text.rs +++ b/vesad/src/screen/text.rs @@ -3,7 +3,7 @@ extern crate ransid; use std::collections::{BTreeSet, VecDeque}; use orbclient::{Event, EventOption}; -use syscall::Result; +use syscall::error::*; use display::Display; use screen::Screen; @@ -48,6 +48,10 @@ impl Screen for TextScreen { Ok(0) } + fn map(&self, offset: usize, size: usize) -> Result { + Err(Error::new(EBADF)) + } + fn input(&mut self, event: &Event) { let mut buf = vec![];