Verified Commit e58dd539 authored by jD91mZM2's avatar jD91mZM2
Browse files

Update redox_syscall

parent ff7c058d
......@@ -369,7 +369,7 @@ dependencies = [
"orbclient 0.3.27 (registry+https://github.com/rust-lang/crates.io-index)",
"orbfont 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"orbital-core 0.1.0",
"redox_syscall 0.1.57 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.2.0 (git+https://gitlab.redox-os.org/redox-os/syscall?rev=4115e0f43547449ce56f7d7749732813e9505955)",
"serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -384,7 +384,7 @@ dependencies = [
"orbclient 0.3.27 (registry+https://github.com/rust-lang/crates.io-index)",
"orbimage 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_event 0.1.0 (git+https://github.com/redox-os/event.git)",
"redox_syscall 0.1.57 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.2.0 (git+https://gitlab.redox-os.org/redox-os/syscall?rev=4115e0f43547449ce56f7d7749732813e9505955)",
]
[[package]]
......@@ -575,6 +575,14 @@ name = "redox_syscall"
version = "0.1.57"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "redox_syscall"
version = "0.2.0"
source = "git+https://gitlab.redox-os.org/redox-os/syscall?rev=4115e0f43547449ce56f7d7749732813e9505955#4115e0f43547449ce56f7d7749732813e9505955"
dependencies = [
"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "resize"
version = "0.3.1"
......@@ -836,6 +844,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"
"checksum redox_event 0.1.0 (git+https://github.com/redox-os/event.git)" = "<none>"
"checksum redox_syscall 0.1.57 (registry+https://github.com/rust-lang/crates.io-index)" = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
"checksum redox_syscall 0.2.0 (git+https://gitlab.redox-os.org/redox-os/syscall?rev=4115e0f43547449ce56f7d7749732813e9505955)" = "<none>"
"checksum resize 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b9e653e390eafbfebb2b3c5fcfbc90d801bc410d0de1f44f266ffbf2151d28aa"
"checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783"
"checksum rusttype 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d8d729e72445ad579171b01a9231657736b3793a2cf423078e687e20ecb8695a"
......
......@@ -11,7 +11,7 @@ version = "0.1.0"
failure = "0.1.1"
orbclient = "0.3.27"
orbfont = "0.1"
redox_syscall = "0.1"
redox_syscall = { git = "https://gitlab.redox-os.org/redox-os/syscall", rev = "4115e0f43547449ce56f7d7749732813e9505955" }
serde = "0.9"
serde_derive = "0.9"
toml = "0.3"
......
......@@ -10,7 +10,7 @@ failure = "0.1.1"
libc = "0.2.48"
orbclient = "0.3"
orbimage = "0.1"
redox_syscall = "0.1"
redox_syscall = { git = "https://gitlab.redox-os.org/redox-os/syscall", rev = "4115e0f43547449ce56f7d7749732813e9505955" }
[dependencies.redox_event]
git = "https://github.com/redox-os/event.git"
......@@ -74,13 +74,14 @@ unsafe fn display_fd_map(width: i32, height: i32, display_fd: usize) -> ImageRef
offset: 0,
size: (width * height * 4) as usize,
flags: syscall::PROT_READ | syscall::PROT_WRITE,
address: 0,
}).unwrap();
let display_slice = slice::from_raw_parts_mut(display_ptr as *mut Color, (width * height) as usize);
ImageRef::from_data(width, height, display_slice)
}
unsafe fn display_fd_unmap(image: &mut ImageRef) {
let _ = syscall::funmap(image.data().as_ptr() as usize);
let _ = syscall::funmap(image.data().as_ptr() as usize, (image.width() * image.height() * 4) as usize);
}
pub const PROPERTY_ASYNC: u8 = 1 << 0;
......@@ -459,9 +460,10 @@ impl<H: Handler> SchemeMut for OrbitalHandler<H> {
Err(syscall::Error::new(EINVAL))
}
}
fn fevent(&mut self, id: usize, _flags: usize) -> syscall::Result<usize> {
self.handler.handle_window_clear_notified(&mut self.orb, id)
.and(Ok(0))
fn fevent(&mut self, id: usize, _flags: syscall::EventFlags) -> syscall::Result<syscall::EventFlags> {
self.handler
.handle_window_clear_notified(&mut self.orb, id)
.and(Ok(syscall::EventFlags::empty()))
}
fn fmap(&mut self, id: usize, map: &syscall::Map) -> syscall::Result<usize> {
let page_size = 4096;
......@@ -476,7 +478,7 @@ impl<H: Handler> SchemeMut for OrbitalHandler<H> {
Err(syscall::Error::new(EINVAL))
}
}
fn funmap(&mut self, address: usize) -> syscall::Result<usize> {
fn funmap(&mut self, _address: usize, _size: usize) -> syscall::Result<usize> {
// TODO
Ok(0)
}
......
......@@ -26,7 +26,7 @@ mod window;
fn main() {
// Daemonize
if unsafe { syscall::clone(0).unwrap() } == 0 {
if unsafe { syscall::clone(syscall::CloneFlags::empty()).unwrap() } == 0 {
let mut args = env::args().skip(1);
let display_path = args.next().expect("orbital: no display argument");
......
......@@ -1011,7 +1011,7 @@ impl<'a> OrbitalSchemeEvent<'a> {
gid: 0,
a: syscall::number::SYS_FEVENT,
b: *id,
c: syscall::flag::EVENT_READ,
c: syscall::flag::EVENT_READ.bits(),
d: window.events.len() * mem::size_of::<Event>()
})?;
}
......@@ -1037,7 +1037,7 @@ impl<'a> OrbitalSchemeEvent<'a> {
gid: 0,
a: syscall::number::SYS_FEVENT,
b: *id,
c: syscall::flag::EVENT_READ,
c: syscall::flag::EVENT_READ.bits(),
d: window.events.len() * mem::size_of::<Event>()
})?;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment