From c47c68f44cec4fe7f8fd94c542e68afbe81d75aa Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Fri, 28 Dec 2018 16:19:09 -0700 Subject: [PATCH] Update fmap support --- Cargo.lock | 70 ++++++++++++++++++++--------------------- ahcid/src/main.rs | 4 +-- alxd/src/main.rs | 4 +-- e1000d/src/main.rs | 4 +-- ihdad/src/HDA/device.rs | 6 ++-- ihdad/src/HDA/stream.rs | 4 +-- ihdad/src/main.rs | 4 +-- nvmed/src/main.rs | 4 +-- rtl8168d/src/main.rs | 4 +-- vboxd/src/main.rs | 4 +-- vesad/src/main.rs | 4 +-- vesad/src/scheme.rs | 6 ++-- xhcid/src/main.rs | 2 +- 13 files changed, 60 insertions(+), 60 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c5b9eb8f01..73ebdf2aa3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = "0.1.0" dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.45 (registry+https://github.com/rust-lang/crates.io-index)", "spin 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -15,7 +15,7 @@ dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "netutils 0.1.0 (git+https://gitlab.redox-os.org/redox-os/netutils.git)", "redox_event 0.1.0 (git+https://gitlab.redox-os.org/redox-os/event.git)", - "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.45 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -44,8 +44,8 @@ dependencies = [ name = "bgad" version = "0.1.0" dependencies = [ - "orbclient 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "orbclient 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.45 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -132,7 +132,7 @@ dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "netutils 0.1.0 (git+https://gitlab.redox-os.org/redox-os/netutils.git)", "redox_event 0.1.0 (git+https://gitlab.redox-os.org/redox-os/event.git)", - "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.45 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -209,7 +209,7 @@ version = "0.1.0" dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "redox_event 0.1.0 (git+https://gitlab.redox-os.org/redox-os/event.git)", - "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.45 (registry+https://github.com/rust-lang/crates.io-index)", "spin 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -312,7 +312,7 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.45 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -351,7 +351,7 @@ dependencies = [ [[package]] name = "netutils" version = "0.1.0" -source = "git+https://gitlab.redox-os.org/redox-os/netutils.git#91dd30c5ffe5902ec40c8d08b2f9769b62da57b7" +source = "git+https://gitlab.redox-os.org/redox-os/netutils.git#03d76ff3b5c4a42e300e3016f42fd632193bbc9d" dependencies = [ "arg_parser 0.1.0 (git+https://gitlab.redox-os.org/redox-os/arg-parser.git)", "extra 0.1.0 (git+https://gitlab.redox-os.org/redox-os/libextra.git)", @@ -362,7 +362,7 @@ dependencies = [ "ntpclient 0.0.1 (git+https://github.com/willem66745/ntpclient-rust)", "pbr 1.0.1 (git+https://github.com/a8m/pb)", "redox_event 0.1.0 (git+https://gitlab.redox-os.org/redox-os/event.git)", - "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.45 (registry+https://github.com/rust-lang/crates.io-index)", "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.13 (git+https://gitlab.redox-os.org/redox-os/tokio)", @@ -429,16 +429,16 @@ name = "nvmed" version = "0.1.0" dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.45 (registry+https://github.com/rust-lang/crates.io-index)", "spin 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "orbclient" -version = "0.3.19" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.45 (registry+https://github.com/rust-lang/crates.io-index)", "sdl2 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -488,9 +488,9 @@ version = "0.1.0" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.45 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.83 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.83 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -517,9 +517,9 @@ name = "ps2d" version = "0.1.0" dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "orbclient 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", + "orbclient 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)", "redox_event 0.1.0 (git+https://gitlab.redox-os.org/redox-os/event.git)", - "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.45 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -629,12 +629,12 @@ name = "redox_event" version = "0.1.0" source = "git+https://gitlab.redox-os.org/redox-os/event.git#c31e3d3d5f44d60ff9fec2b1ee58b982e72c0d77" dependencies = [ - "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.45 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "redox_syscall" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -642,7 +642,7 @@ name = "redox_termios" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.45 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -663,7 +663,7 @@ dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "netutils 0.1.0 (git+https://gitlab.redox-os.org/redox-os/netutils.git)", "redox_event 0.1.0 (git+https://gitlab.redox-os.org/redox-os/event.git)", - "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.45 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -752,12 +752,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde_derive" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", @@ -812,7 +812,7 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.45 (registry+https://github.com/rust-lang/crates.io-index)", "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -822,7 +822,7 @@ version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.45 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -986,7 +986,7 @@ name = "toml" version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.83 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1057,9 +1057,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "vboxd" version = "0.1.0" dependencies = [ - "orbclient 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", + "orbclient 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)", "redox_event 0.1.0 (git+https://gitlab.redox-os.org/redox-os/event.git)", - "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.45 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1071,9 +1071,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "vesad" version = "0.1.0" dependencies = [ - "orbclient 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", + "orbclient 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)", "ransid 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.45 (registry+https://github.com/rust-lang/crates.io-index)", "rusttype 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1153,7 +1153,7 @@ dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "plain 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "redox_event 0.1.0 (git+https://gitlab.redox-os.org/redox-os/event.git)", - "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.45 (registry+https://github.com/rust-lang/crates.io-index)", "spin 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1205,7 +1205,7 @@ dependencies = [ "checksum num-iter 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "af3fdbbc3291a5464dc57b03860ec37ca6bf915ed6ee385e7c6c052c422b2124" "checksum num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1" "checksum num_cpus 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5a69d464bdc213aaaff628444e99578ede64e9c854025aa43b9796530afa9238" -"checksum orbclient 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)" = "0a35fa1b5d90c19bc174dd4b392e29e8eecf6cf794a7626d9b115b1f40237526" +"checksum orbclient 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)" = "e9209ac5081710688c453af03a9e92b3d4e1e445cd4c60052692758e08e47c5e" "checksum owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49a4b8ea2179e6a2e27411d3bca09ca6dd630821cf6894c6c7c8467a8ee7ef13" "checksum parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9723236a9525c757d9725b993511e3fc941e33f27751942232f0058298297edf" "checksum parking_lot_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94c8c7923936b28d546dfd14d4472eaf34c99b14e1c973a32b3e6d4eb04298c9" @@ -1225,7 +1225,7 @@ dependencies = [ "checksum rand_xorshift 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "effa3fcaa47e18db002bdde6060944b6d2f9cfd8db471c30e873448ad9187be3" "checksum ransid 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "e02b6e263e6d8ab6a7a7637268785506f26860f0c4be83d8d940014d2b3e1601" "checksum redox_event 0.1.0 (git+https://gitlab.redox-os.org/redox-os/event.git)" = "" -"checksum redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)" = "a84bcd297b87a545980a2d25a0beb72a1f490c31f0a9fde52fca35bfbb1ceb70" +"checksum redox_syscall 0.1.45 (registry+https://github.com/rust-lang/crates.io-index)" = "7b7aac97a11cf928b13c97f726b1bfe8542969fcbc39007ce566a888da5964a3" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" "checksum ring 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2c4db68a2e35f3497146b7e4563df7d4773a2433230c5e4b448328e31740458a" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" @@ -1238,8 +1238,8 @@ dependencies = [ "checksum sdl2-sys 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5c543ce8a6e33a30cb909612eeeb22e693848211a84558d5a00bb11e791b7ab7" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)" = "6fa52f19aee12441d5ad11c9a00459122bd8f98707cadf9778c540674f1935b6" -"checksum serde_derive 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)" = "96a7f9496ac65a2db5929afa087b54f8fc5008dcfbe48a8874ed20049b0d6154" +"checksum serde 1.0.83 (registry+https://github.com/rust-lang/crates.io-index)" = "157e12af46859e968da75dea9845530e13d03bcab2009a41b9b7bb3cf4eb3ec2" +"checksum serde_derive 1.0.83 (registry+https://github.com/rust-lang/crates.io-index)" = "9469829702497daf2daf3c190e130c3fa72f719920f73c86160d43e8f8d76951" "checksum slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5f9776d6b986f77b35c6cf846c11ad986ff128fe0b2b63a3628e3755e8d3102d" "checksum smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b73ea3738b47563803ef814925e69be00799a8c07420be8b996f8e98fb2336db" "checksum spin 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ceac490aa12c567115b40b7b7fceca03a6c9d53d5defea066123debc83c5dc1f" diff --git a/ahcid/src/main.rs b/ahcid/src/main.rs index 1ceaad116c..916c72569a 100644 --- a/ahcid/src/main.rs +++ b/ahcid/src/main.rs @@ -9,7 +9,7 @@ use std::{env, usize}; use std::fs::File; use std::io::{Read, Write}; use std::os::unix::io::FromRawFd; -use syscall::{EVENT_READ, MAP_WRITE, Event, Packet, Scheme}; +use syscall::{EVENT_READ, PHYSMAP_WRITE, Event, Packet, Scheme}; use scheme::DiskScheme; @@ -32,7 +32,7 @@ fn main() { // Daemonize if unsafe { syscall::clone(0).unwrap() } == 0 { - let address = unsafe { syscall::physmap(bar, 4096, MAP_WRITE).expect("ahcid: failed to map address") }; + let address = unsafe { syscall::physmap(bar, 4096, PHYSMAP_WRITE).expect("ahcid: failed to map address") }; { let scheme_name = format!("disk/{}", name); let socket_fd = syscall::open( diff --git a/alxd/src/main.rs b/alxd/src/main.rs index 196eff7280..828e24e48a 100644 --- a/alxd/src/main.rs +++ b/alxd/src/main.rs @@ -16,7 +16,7 @@ use std::os::unix::io::{AsRawFd, FromRawFd}; use std::sync::Arc; use event::EventQueue; -use syscall::{Packet, SchemeMut, MAP_WRITE}; +use syscall::{Packet, SchemeMut, PHYSMAP_WRITE}; use syscall::error::EWOULDBLOCK; pub mod device; @@ -43,7 +43,7 @@ fn main() { let mut irq_file = File::open(format!("irq:{}", irq)).expect("alxd: failed to open IRQ file"); - let address = unsafe { syscall::physmap(bar, 128*1024, MAP_WRITE).expect("alxd: failed to map address") }; + let address = unsafe { syscall::physmap(bar, 128*1024, PHYSMAP_WRITE).expect("alxd: failed to map address") }; { let device = Arc::new(RefCell::new(unsafe { device::Alx::new(address).expect("alxd: failed to allocate device") })); diff --git a/e1000d/src/main.rs b/e1000d/src/main.rs index 41e8e4d198..96c8eff59e 100644 --- a/e1000d/src/main.rs +++ b/e1000d/src/main.rs @@ -12,7 +12,7 @@ use std::os::unix::io::{AsRawFd, FromRawFd}; use std::sync::Arc; use event::EventQueue; -use syscall::{Packet, SchemeMut, MAP_WRITE}; +use syscall::{Packet, SchemeMut, PHYSMAP_WRITE}; use syscall::error::EWOULDBLOCK; pub mod device; @@ -38,7 +38,7 @@ fn main() { let mut irq_file = File::open(format!("irq:{}", irq)).expect("e1000d: failed to open IRQ file"); - let address = unsafe { syscall::physmap(bar, 128*1024, MAP_WRITE).expect("e1000d: failed to map address") }; + let address = unsafe { syscall::physmap(bar, 128*1024, PHYSMAP_WRITE).expect("e1000d: failed to map address") }; { let device = Arc::new(RefCell::new(unsafe { device::Intel8254x::new(address).expect("e1000d: failed to allocate device") })); diff --git a/ihdad/src/HDA/device.rs b/ihdad/src/HDA/device.rs index 567933730a..f17c79f08c 100755 --- a/ihdad/src/HDA/device.rs +++ b/ihdad/src/HDA/device.rs @@ -14,7 +14,7 @@ use std::sync::atomic::{AtomicUsize, Ordering}; extern crate syscall; -use syscall::MAP_WRITE; +use syscall::PHYSMAP_WRITE; use syscall::error::{Error, EACCES, EBADF, Result, EINVAL}; use syscall::flag::{SEEK_SET, SEEK_CUR, SEEK_END}; use syscall::io::{Mmio, Io}; @@ -184,7 +184,7 @@ impl IntelHDA { let buff_desc_virt = unsafe { - syscall::physmap(buff_desc_phys, 0x1000, MAP_WRITE) + syscall::physmap(buff_desc_phys, 0x1000, PHYSMAP_WRITE) .expect("ihdad: failed to map address for buffer descriptor list.") }; @@ -201,7 +201,7 @@ impl IntelHDA { }; - let cmd_buff_virt = unsafe { syscall::physmap(cmd_buff_address, 0x1000, MAP_WRITE).expect("ihdad: failed to map address for CORB/RIRB buff") }; + let cmd_buff_virt = unsafe { syscall::physmap(cmd_buff_address, 0x1000, PHYSMAP_WRITE).expect("ihdad: failed to map address for CORB/RIRB buff") }; print!("Virt: {:016X}, Phys: {:016X}\n", cmd_buff_virt, cmd_buff_address); let mut module = IntelHDA { diff --git a/ihdad/src/HDA/stream.rs b/ihdad/src/HDA/stream.rs index fb8f1cd75e..b905f8d24c 100644 --- a/ihdad/src/HDA/stream.rs +++ b/ihdad/src/HDA/stream.rs @@ -1,7 +1,7 @@ -use syscall::MAP_WRITE; +use syscall::PHYSMAP_WRITE; use syscall::error::{Error, EACCES, EWOULDBLOCK, EIO, Result}; use syscall::flag::O_NONBLOCK; use syscall::io::{Dma, Mmio, Io, ReadOnly}; @@ -310,7 +310,7 @@ impl StreamBuffer { }; let addr = match unsafe { - syscall::physmap(phys, block_length * block_count, MAP_WRITE) + syscall::physmap(phys, block_length * block_count, PHYSMAP_WRITE) } { Ok(addr) => addr, Err(err) => { diff --git a/ihdad/src/main.rs b/ihdad/src/main.rs index 027a592ff8..87374bb66a 100755 --- a/ihdad/src/main.rs +++ b/ihdad/src/main.rs @@ -10,7 +10,7 @@ use std::{env, usize, u16, thread}; use std::fs::File; use std::io::{Read, Write, Result}; use std::os::unix::io::{AsRawFd, FromRawFd, RawFd}; -use syscall::{EVENT_READ, MAP_WRITE, Event, Packet, Scheme, SchemeMut}; +use syscall::{EVENT_READ, PHYSMAP_WRITE, Event, Packet, Scheme, SchemeMut}; use std::cell::RefCell; use std::sync::Arc; @@ -52,7 +52,7 @@ fn main() { // Daemonize if unsafe { syscall::clone(0).unwrap() } == 0 { - let address = unsafe { syscall::physmap(bar, 0x4000, MAP_WRITE).expect("ihdad: failed to map address") }; + let address = unsafe { syscall::physmap(bar, 0x4000, PHYSMAP_WRITE).expect("ihdad: failed to map address") }; { let mut irq_file = File::open(format!("irq:{}", irq)).expect("IHDA: failed to open IRQ file"); diff --git a/nvmed/src/main.rs b/nvmed/src/main.rs index 531fc74c9d..9aea3c3501 100644 --- a/nvmed/src/main.rs +++ b/nvmed/src/main.rs @@ -9,7 +9,7 @@ use std::{env, usize}; use std::fs::File; use std::io::{Read, Write}; use std::os::unix::io::{AsRawFd, FromRawFd, RawFd}; -use syscall::{EVENT_READ, MAP_WRITE, Event, Packet, Result, Scheme}; +use syscall::{EVENT_READ, PHYSMAP_WRITE, Event, Packet, Result, Scheme}; use self::nvme::Nvme; @@ -42,7 +42,7 @@ fn main() { // Daemonize if unsafe { syscall::clone(0).unwrap() } == 0 { - let address = unsafe { syscall::physmap(bar, 4096, MAP_WRITE).expect("nvmed: failed to map address") }; + let address = unsafe { syscall::physmap(bar, 4096, PHYSMAP_WRITE).expect("nvmed: failed to map address") }; { let mut nvme = Nvme::new(address); nvme.init(); diff --git a/rtl8168d/src/main.rs b/rtl8168d/src/main.rs index 460da0ac57..39433a8531 100644 --- a/rtl8168d/src/main.rs +++ b/rtl8168d/src/main.rs @@ -12,7 +12,7 @@ use std::os::unix::io::{AsRawFd, FromRawFd}; use std::sync::Arc; use event::EventQueue; -use syscall::{Packet, SchemeMut, MAP_WRITE}; +use syscall::{Packet, SchemeMut, PHYSMAP_WRITE}; use syscall::error::EWOULDBLOCK; pub mod device; @@ -38,7 +38,7 @@ fn main() { let mut irq_file = File::open(format!("irq:{}", irq)).expect("rtl8168d: failed to open IRQ file"); - let address = unsafe { syscall::physmap(bar, 256, MAP_WRITE).expect("rtl8168d: failed to map address") }; + let address = unsafe { syscall::physmap(bar, 256, PHYSMAP_WRITE).expect("rtl8168d: failed to map address") }; { let device = Arc::new(RefCell::new(unsafe { device::Rtl8168::new(address).expect("rtl8168d: failed to allocate device") })); diff --git a/vboxd/src/main.rs b/vboxd/src/main.rs index 6b8d181b68..90ca4aa105 100644 --- a/vboxd/src/main.rs +++ b/vboxd/src/main.rs @@ -9,7 +9,7 @@ use std::{env, mem}; use std::os::unix::io::AsRawFd; use std::fs::File; use std::io::{Result, Read, Write}; -use syscall::flag::MAP_WRITE; +use syscall::flag::PHYSMAP_WRITE; use syscall::io::{Dma, Io, Mmio, Pio}; use syscall::iopl; @@ -217,7 +217,7 @@ fn main() { let mut irq_file = File::open(format!("irq:{}", irq)).expect("vboxd: failed to open IRQ file"); let mut port = Pio::::new(bar0 as u16); - let address = unsafe { syscall::physmap(bar1, 4096, MAP_WRITE).expect("vboxd: failed to map address") }; + let address = unsafe { syscall::physmap(bar1, 4096, PHYSMAP_WRITE).expect("vboxd: failed to map address") }; { let vmmdev = unsafe { &mut *(address as *mut VboxVmmDev) }; diff --git a/vesad/src/main.rs b/vesad/src/main.rs index 008417fc6e..b5ec9cd7b8 100644 --- a/vesad/src/main.rs +++ b/vesad/src/main.rs @@ -8,7 +8,7 @@ extern crate syscall; use std::env; use std::fs::File; use std::io::{Read, Write}; -use syscall::{physmap, physunmap, Packet, SchemeMut, EVENT_READ, MAP_WRITE, MAP_WRITE_COMBINE}; +use syscall::{physmap, physunmap, Packet, SchemeMut, EVENT_READ, PHYSMAP_WRITE, PHYSMAP_WRITE_COMBINE}; use mode_info::VBEModeInfo; use primitive::fast_set64; @@ -55,7 +55,7 @@ fn main() { let size = width * height; //TODO: Remap on resize let largest_size = 8 * 1024 * 1024; - let onscreen = unsafe { physmap(physbaseptr, largest_size * 4, MAP_WRITE | MAP_WRITE_COMBINE).expect("vesad: failed to map VBE LFB") }; + let onscreen = unsafe { physmap(physbaseptr, largest_size * 4, PHYSMAP_WRITE | PHYSMAP_WRITE_COMBINE).expect("vesad: failed to map VBE LFB") }; unsafe { fast_set64(onscreen as *mut u64, 0, size/2) }; let mut scheme = DisplayScheme::new(width, height, onscreen, &spec); diff --git a/vesad/src/scheme.rs b/vesad/src/scheme.rs index c43f2b5b4c..23902152b7 100644 --- a/vesad/src/scheme.rs +++ b/vesad/src/scheme.rs @@ -2,7 +2,7 @@ use std::collections::BTreeMap; use std::{mem, slice, str}; use orbclient::{Event, EventOption}; -use syscall::{Result, Error, EACCES, EBADF, EINVAL, ENOENT, O_NONBLOCK, SchemeMut}; +use syscall::{Result, Error, EACCES, EBADF, EINVAL, ENOENT, O_NONBLOCK, Map, SchemeMut}; use display::Display; use screen::{Screen, GraphicScreen, TextScreen}; @@ -145,12 +145,12 @@ impl SchemeMut for DisplayScheme { } } - fn fmap(&mut self, id: usize, offset: usize, size: usize) -> Result { + fn fmap(&mut self, id: usize, map: &Map) -> Result { let handle = self.handles.get(&id).ok_or(Error::new(EBADF))?; if let HandleKind::Screen(screen_i) = handle.kind { if let Some(screen) = self.screens.get(&screen_i) { - return screen.map(offset, size); + return screen.map(map.offset, map.size); } } diff --git a/xhcid/src/main.rs b/xhcid/src/main.rs index 5616583908..2974555369 100644 --- a/xhcid/src/main.rs +++ b/xhcid/src/main.rs @@ -41,7 +41,7 @@ fn main() { let mut irq_file = File::open(format!("irq:{}", irq)).expect("xhcid: failed to open IRQ file"); - let address = unsafe { syscall::physmap(bar, 65536, syscall::MAP_WRITE).expect("xhcid: failed to map address") }; + let address = unsafe { syscall::physmap(bar, 65536, syscall::PHYSMAP_WRITE).expect("xhcid: failed to map address") }; { let hci = Arc::new(RefCell::new(Xhci::new(address).expect("xhcid: failed to allocate device")));