diff --git a/Cargo.lock b/Cargo.lock index 4712e5aeda..e8f68a1aea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -124,7 +124,7 @@ name = "iovec" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.51 (git+https://gitlab.redox-os.org/redox-os/liblibc.git?branch=redox-unix)", + "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -144,8 +144,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.51" -source = "git+https://gitlab.redox-os.org/redox-os/liblibc.git?branch=redox-unix#5c5373d530b61d9fdd7e2dee0dff55003e9268a8" +version = "0.2.58" +source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "linked-hash-map" @@ -167,18 +167,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "mio" -version = "0.6.16" -source = "git+https://gitlab.redox-os.org/redox-os/mio#439a559b2aa734e0970d37b3375889a57a465360" +version = "0.6.19" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.51 (git+https://gitlab.redox-os.org/redox-os/liblibc.git?branch=redox-unix)", + "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", "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 (git+https://gitlab.redox-os.org/redox-os/net2-rs.git?branch=redox-unix)", - "redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -189,7 +188,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "net2 0.2.33 (git+https://gitlab.redox-os.org/redox-os/net2-rs.git?branch=redox-unix)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -197,10 +196,10 @@ dependencies = [ [[package]] name = "net2" version = "0.2.33" -source = "git+https://gitlab.redox-os.org/redox-os/net2-rs.git?branch=redox-unix#b2c7c1e7773f13eebd9b4421172d9e4b5b806ce6" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.51 (git+https://gitlab.redox-os.org/redox-os/liblibc.git?branch=redox-unix)", + "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -211,10 +210,10 @@ source = "git+https://gitlab.redox-os.org/redox-os/netutils.git?branch=redox-uni 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)", - "libc 0.2.51 (git+https://gitlab.redox-os.org/redox-os/liblibc.git?branch=redox-unix)", - "mio 0.6.16 (git+https://gitlab.redox-os.org/redox-os/mio)", + "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", "ntpclient 0.0.1 (git+https://github.com/willem66745/ntpclient-rust)", - "pbr 1.0.1 (git+https://gitlab.redox-os.org/redox-os/pb.git?branch=redox-unix)", + "pbr 1.0.1 (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.54 (registry+https://github.com/rust-lang/crates.io-index)", "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -233,7 +232,7 @@ version = "0.0.1" source = "git+https://github.com/willem66745/ntpclient-rust#7e3bdf60eb940825789a8da5181025320e3050b0" dependencies = [ "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.42 (git+https://gitlab.redox-os.org/redox-os/time.git?branch=redox-unix)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -294,11 +293,13 @@ dependencies = [ [[package]] name = "pbr" version = "1.0.1" -source = "git+https://gitlab.redox-os.org/redox-os/pb.git?branch=redox-unix#743300cf9566f77962a5b550db1ba27cc922b6a5" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.51 (git+https://gitlab.redox-os.org/redox-os/liblibc.git?branch=redox-unix)", - "time 0.1.42 (git+https://gitlab.redox-os.org/redox-os/time.git?branch=redox-unix)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "termion 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -354,7 +355,7 @@ name = "rand" version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.51 (git+https://gitlab.redox-os.org/redox-os/liblibc.git?branch=redox-unix)", + "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -364,7 +365,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.51 (git+https://gitlab.redox-os.org/redox-os/liblibc.git?branch=redox-unix)", + "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -448,7 +449,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.51 (git+https://gitlab.redox-os.org/redox-os/liblibc.git?branch=redox-unix)", + "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", "sdl2-sys 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -515,7 +516,7 @@ name = "termion" version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.51 (git+https://gitlab.redox-os.org/redox-os/liblibc.git?branch=redox-unix)", + "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", "numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)", "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -524,9 +525,10 @@ dependencies = [ [[package]] name = "time" version = "0.1.42" -source = "git+https://gitlab.redox-os.org/redox-os/time.git?branch=redox-unix#fc118e5752aaac833808a25f0850606b675b32ec" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.51 (git+https://gitlab.redox-os.org/redox-os/liblibc.git?branch=redox-unix)", + "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -650,11 +652,6 @@ dependencies = [ "spin 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[patch.unused]] -name = "ring" -version = "0.14.6" -source = "git+https://gitlab.redox-os.org/redox-os/ring.git?branch=redox-unix#1e177479981854cb7d06bea12e0a6514d26e09a6" - [metadata] "checksum arg_parser 0.1.0 (git+https://gitlab.redox-os.org/redox-os/arg-parser.git)" = "" "checksum arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "92c7fb76bc8826a8b33b4ee5bb07a247a81e76764ab4d55e8f73e3a4d8808c71" @@ -671,13 +668,13 @@ source = "git+https://gitlab.redox-os.org/redox-os/ring.git?branch=redox-unix#1e "checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" -"checksum libc 0.2.51 (git+https://gitlab.redox-os.org/redox-os/liblibc.git?branch=redox-unix)" = "" +"checksum libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "6281b86796ba5e4366000be6e9e18bf35580adf9e63fbe2294aadb587613a319" "checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" "checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" -"checksum mio 0.6.16 (git+https://gitlab.redox-os.org/redox-os/mio)" = "" +"checksum mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)" = "83f51996a3ed004ef184e16818edc51fadffe8e7ca68be67f9dee67d84d0ff23" "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" -"checksum net2 0.2.33 (git+https://gitlab.redox-os.org/redox-os/net2-rs.git?branch=redox-unix)" = "" +"checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" "checksum netutils 0.1.0 (git+https://gitlab.redox-os.org/redox-os/netutils.git?branch=redox-unix)" = "" "checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945" "checksum ntpclient 0.0.1 (git+https://github.com/willem66745/ntpclient-rust)" = "" @@ -687,7 +684,7 @@ source = "git+https://gitlab.redox-os.org/redox-os/ring.git?branch=redox-unix#1e "checksum num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1" "checksum numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" "checksum orbclient 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "1d0e398a001ca5f52b252d1cf5679d52ddd347d3130ac9ded98549f16537c546" -"checksum pbr 1.0.1 (git+https://gitlab.redox-os.org/redox-os/pb.git?branch=redox-unix)" = "" +"checksum pbr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "deb73390ab68d81992bd994d145f697451bb0b54fd39738e72eef32458ad6907" "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" "checksum plain 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" "checksum proc-macro2 0.4.28 (registry+https://github.com/rust-lang/crates.io-index)" = "ba92c84f814b3f9a44c5cfca7d2ad77fa10710867d2bbb1b3d175ab5f47daa12" @@ -712,7 +709,7 @@ source = "git+https://gitlab.redox-os.org/redox-os/ring.git?branch=redox-unix#1e "checksum stb_truetype 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "69b7df505db8e81d54ff8be4693421e5b543e08214bd8d99eb761fcb4d5668ba" "checksum syn 0.15.32 (registry+https://github.com/rust-lang/crates.io-index)" = "846620ec526c1599c070eff393bfeeeb88a93afa2513fc3b49f1fea84cf7b0ed" "checksum termion 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dde0593aeb8d47accea5392b39350015b5eccb12c0d98044d856983d89548dea" -"checksum time 0.1.42 (git+https://gitlab.redox-os.org/redox-os/time.git?branch=redox-unix)" = "" +"checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" "checksum toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" "checksum unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "141339a08b982d942be2ca06ff8b076563cbe223d1befd5450716790d44e2426" diff --git a/ahcid/Cargo.toml b/ahcid/Cargo.toml index 0e9644e386..789f7e0b38 100644 --- a/ahcid/Cargo.toml +++ b/ahcid/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "ahcid" version = "0.1.0" +edition = "2018" [dependencies] bitflags = "0.7" diff --git a/ahcid/src/ahci/mod.rs b/ahcid/src/ahci/mod.rs index 05792712fd..b72aa59ac5 100644 --- a/ahcid/src/ahci/mod.rs +++ b/ahcid/src/ahci/mod.rs @@ -18,18 +18,18 @@ pub trait Disk { fn block_length(&mut self) -> Result; } -pub fn disks(base: usize, name: &str) -> (&'static mut HbaMem, Vec>) { +pub fn disks(base: usize, name: &str) -> (&'static mut HbaMem, Vec>) { let hba_mem = unsafe { &mut *(base as *mut HbaMem) }; hba_mem.init(); let pi = hba_mem.pi.read(); - let disks: Vec> = (0..hba_mem.ports.len()) + let disks: Vec> = (0..hba_mem.ports.len()) .filter(|&i| pi & 1 << i as i32 == 1 << i as i32) .filter_map(|i| { let port = unsafe { &mut *hba_mem.ports.as_mut_ptr().add(i) }; let port_type = port.probe(); print!("{}", format!("{}-{}: {:?}\n", name, i, port_type)); - let disk: Option> = match port_type { + let disk: Option> = match port_type { HbaPortType::SATA => { match DiskATA::new(i, port) { Ok(disk) => Some(Box::new(disk)), diff --git a/ahcid/src/main.rs b/ahcid/src/main.rs index 43ac054e43..370b593723 100644 --- a/ahcid/src/main.rs +++ b/ahcid/src/main.rs @@ -9,7 +9,7 @@ use std::io::{Read, Write}; use std::os::unix::io::{FromRawFd, RawFd}; use syscall::{EVENT_READ, PHYSMAP_NO_CACHE, PHYSMAP_WRITE, Event, Packet, SchemeBlockMut}; -use scheme::DiskScheme; +use crate::scheme::DiskScheme; pub mod ahci; pub mod scheme; diff --git a/ahcid/src/scheme.rs b/ahcid/src/scheme.rs index b8374f8ce8..28684b2cbc 100644 --- a/ahcid/src/scheme.rs +++ b/ahcid/src/scheme.rs @@ -7,8 +7,8 @@ use syscall::{ Io, SchemeBlockMut, Stat, MODE_DIR, MODE_FILE, O_DIRECTORY, O_STAT, SEEK_CUR, SEEK_END, SEEK_SET}; -use ahci::Disk; -use ahci::hba::HbaMem; +use crate::ahci::Disk; +use crate::ahci::hba::HbaMem; #[derive(Clone)] enum Handle { @@ -19,13 +19,13 @@ enum Handle { pub struct DiskScheme { scheme_name: String, hba_mem: &'static mut HbaMem, - disks: Box<[Box]>, + disks: Box<[Box]>, handles: BTreeMap, next_id: usize } impl DiskScheme { - pub fn new(scheme_name: String, hba_mem: &'static mut HbaMem, disks: Vec>) -> DiskScheme { + pub fn new(scheme_name: String, hba_mem: &'static mut HbaMem, disks: Vec>) -> DiskScheme { DiskScheme { scheme_name: scheme_name, hba_mem: hba_mem, @@ -117,7 +117,7 @@ impl SchemeBlockMut for DiskScheme { Ok(Some(0)) }, Handle::Disk(number, _) => { - let mut disk = self.disks.get_mut(number).ok_or(Error::new(EBADF))?; + let disk = self.disks.get_mut(number).ok_or(Error::new(EBADF))?; stat.st_mode = MODE_FILE; stat.st_size = disk.size(); Ok(Some(0)) @@ -168,7 +168,7 @@ impl SchemeBlockMut for DiskScheme { Ok(Some(count)) }, Handle::Disk(number, ref mut size) => { - let mut disk = self.disks.get_mut(number).ok_or(Error::new(EBADF))?; + let disk = self.disks.get_mut(number).ok_or(Error::new(EBADF))?; let blk_len = disk.block_length()?; if let Some(count) = disk.read((*size as u64)/(blk_len as u64), buf)? { *size += count; @@ -186,7 +186,7 @@ impl SchemeBlockMut for DiskScheme { Err(Error::new(EBADF)) }, Handle::Disk(number, ref mut size) => { - let mut disk = self.disks.get_mut(number).ok_or(Error::new(EBADF))?; + let disk = self.disks.get_mut(number).ok_or(Error::new(EBADF))?; let blk_len = disk.block_length()?; if let Some(count) = disk.write((*size as u64)/(blk_len as u64), buf)? { *size += count; @@ -212,7 +212,7 @@ impl SchemeBlockMut for DiskScheme { Ok(Some(*size)) }, Handle::Disk(number, ref mut size) => { - let mut disk = self.disks.get_mut(number).ok_or(Error::new(EBADF))?; + let disk = self.disks.get_mut(number).ok_or(Error::new(EBADF))?; let len = disk.size() as usize; *size = match whence { SEEK_SET => cmp::min(len, pos), diff --git a/alxd/Cargo.toml b/alxd/Cargo.toml index 764df5c39d..f4466be864 100644 --- a/alxd/Cargo.toml +++ b/alxd/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "alxd" version = "0.1.0" +edition = "2018" [dependencies] bitflags = "0.7" diff --git a/alxd/src/device/mod.rs b/alxd/src/device/mod.rs index 2afdbdaf8a..143f1e48a4 100644 --- a/alxd/src/device/mod.rs +++ b/alxd/src/device/mod.rs @@ -1721,7 +1721,7 @@ impl Alx { } unsafe fn open(&mut self) -> usize { - let mut err: usize = 0; + let _err: usize = 0; macro_rules! goto_out { () => {{ @@ -1805,7 +1805,7 @@ impl scheme::SchemeMut for Alx { Ok(id) } - fn read(&mut self, id: usize, buf: &mut [u8]) -> Result { + fn read(&mut self, id: usize, _buf: &mut [u8]) -> Result { /* let head = unsafe { self.read(RDH) }; let mut tail = unsafe { self.read(RDT) }; @@ -1842,7 +1842,7 @@ impl scheme::SchemeMut for Alx { } } - fn write(&mut self, _id: usize, buf: &[u8]) -> Result { + fn write(&mut self, _id: usize, _buf: &[u8]) -> Result { /* loop { let head = unsafe { self.read(TDH) }; diff --git a/bgad/Cargo.toml b/bgad/Cargo.toml index 289f65cd54..f240b720fc 100644 --- a/bgad/Cargo.toml +++ b/bgad/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "bgad" version = "0.1.0" +edition = "2018" [dependencies] orbclient = "0.3" diff --git a/bgad/src/main.rs b/bgad/src/main.rs index e326899aba..0c8f2835e5 100644 --- a/bgad/src/main.rs +++ b/bgad/src/main.rs @@ -10,8 +10,8 @@ use syscall::iopl; use syscall::data::Packet; use syscall::scheme::SchemeMut; -use bga::Bga; -use scheme::BgaScheme; +use crate::bga::Bga; +use crate::scheme::BgaScheme; mod bga; mod scheme; diff --git a/bgad/src/scheme.rs b/bgad/src/scheme.rs index e4ce64eced..bad949c717 100644 --- a/bgad/src/scheme.rs +++ b/bgad/src/scheme.rs @@ -5,7 +5,7 @@ use std::str; use syscall::{Error, Result, SchemeMut, EACCES, EINVAL, MODE_CHR}; use syscall::data::Stat; -use bga::Bga; +use crate::bga::Bga; pub struct BgaScheme { pub bga: Bga, diff --git a/e1000d/Cargo.toml b/e1000d/Cargo.toml index fd1f0a48dd..bdd4a8844a 100644 --- a/e1000d/Cargo.toml +++ b/e1000d/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "e1000d" version = "0.1.0" +edition = "2018" [dependencies] bitflags = "0.7" diff --git a/e1000d/src/device.rs b/e1000d/src/device.rs index b4b675fd33..72e066b063 100644 --- a/e1000d/src/device.rs +++ b/e1000d/src/device.rs @@ -55,7 +55,7 @@ const RDT: u32 = 0x2818; const RAL0: u32 = 0x5400; const RAH0: u32 = 0x5404; -#[derive(Debug)] +#[derive(Debug, Copy, Clone)] #[repr(packed)] struct Rd { buffer: u64, @@ -78,7 +78,7 @@ const TDLEN: u32 = 0x3808; const TDH: u32 = 0x3810; const TDT: u32 = 0x3818; -#[derive(Debug)] +#[derive(Debug, Copy, Clone)] #[repr(packed)] struct Td { buffer: u64, @@ -190,7 +190,7 @@ impl SchemeBlockMut for Intel8254x { td.length = (cmp::min(buf.len(), 0x3FFF)) as u16; - let mut data = unsafe { slice::from_raw_parts_mut(self.transmit_buffer[old_tail as usize].as_ptr() as *mut u8, td.length as usize) }; + let data = unsafe { slice::from_raw_parts_mut(self.transmit_buffer[old_tail as usize].as_ptr() as *mut u8, td.length as usize) }; let mut i = 0; while i < buf.len() && i < data.len() { diff --git a/e1000d/src/main.rs b/e1000d/src/main.rs index 719685c9e4..755bff8d89 100644 --- a/e1000d/src/main.rs +++ b/e1000d/src/main.rs @@ -13,7 +13,7 @@ use std::sync::Arc; use event::EventQueue; use syscall::{Packet, SchemeBlockMut, PHYSMAP_NO_CACHE, PHYSMAP_WRITE}; -use syscall::error::EWOULDBLOCK; + pub mod device; diff --git a/ihdad/Cargo.toml b/ihdad/Cargo.toml index 23e365aa01..ec6d85b871 100755 --- a/ihdad/Cargo.toml +++ b/ihdad/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "ihdad" version = "0.1.0" +edition = "2018" [dependencies] bitflags = "0.7" diff --git a/ihdad/src/hda/device.rs b/ihdad/src/hda/device.rs index dd74824a97..ae77fe5b98 100755 --- a/ihdad/src/hda/device.rs +++ b/ihdad/src/hda/device.rs @@ -790,21 +790,21 @@ impl IntelHDA { for i in 0..iss { if ((sis >> i) & 1 ) == 1 { - let mut input = self.get_input_stream_descriptor(i).unwrap(); + let input = self.get_input_stream_descriptor(i).unwrap(); input.clear_interrupts(); } } for i in 0..oss { if ((sis >> (i + iss)) & 1 ) == 1 { - let mut output = self.get_output_stream_descriptor(i).unwrap(); + let output = self.get_output_stream_descriptor(i).unwrap(); output.clear_interrupts(); } } for i in 0..bss { if ((sis >> (i + iss + oss)) & 1 ) == 1 { - let mut bid = self.get_bidirectional_stream_descriptor(i).unwrap(); + let bid = self.get_bidirectional_stream_descriptor(i).unwrap(); bid.clear_interrupts(); } } @@ -897,7 +897,7 @@ impl SchemeBlockMut for IntelHDA { fn write(&mut self, id: usize, buf: &[u8]) -> Result> { let index = { let mut handles = self.handles.lock(); - let handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?; + let _handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?; 0 }; @@ -926,7 +926,7 @@ impl SchemeBlockMut for IntelHDA { fn fpath(&mut self, id: usize, buf: &mut [u8]) -> Result> { let mut handles = self.handles.lock(); - let handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?; + let _handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?; let mut i = 0; let scheme_path = b"hda:"; diff --git a/ihdad/src/hda/stream.rs b/ihdad/src/hda/stream.rs index ecb791aacc..0f46da305a 100644 --- a/ihdad/src/hda/stream.rs +++ b/ihdad/src/hda/stream.rs @@ -295,7 +295,7 @@ impl StreamBuffer { syscall::physalloc(block_length * block_count) } { Ok(phys) => phys, - Err(err) => { + Err(_err) => { return Err("Could not allocate physical memory for buffer."); } }; @@ -304,7 +304,7 @@ impl StreamBuffer { syscall::physmap(phys, block_length * block_count, PHYSMAP_WRITE | PHYSMAP_NO_CACHE) } { Ok(addr) => addr, - Err(err) => { + Err(_err) => { unsafe { syscall::physfree(phys, block_length * block_count); } diff --git a/nvmed/Cargo.toml b/nvmed/Cargo.toml index fbdc36977d..7bd235dc99 100644 --- a/nvmed/Cargo.toml +++ b/nvmed/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "nvmed" version = "0.1.0" +edition = "2018" [dependencies] bitflags = "0.7" diff --git a/nvmed/src/main.rs b/nvmed/src/main.rs index 6035739dd3..bacc3878e6 100644 --- a/nvmed/src/main.rs +++ b/nvmed/src/main.rs @@ -6,9 +6,9 @@ extern crate spin; extern crate syscall; 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, PHYSMAP_NO_CACHE, PHYSMAP_WRITE, Event, Packet, Result, Scheme}; use self::nvme::Nvme; diff --git a/pcid/Cargo.toml b/pcid/Cargo.toml index 56465ba9fd..e35303f094 100644 --- a/pcid/Cargo.toml +++ b/pcid/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "pcid" version = "0.1.0" +edition = "2018" [dependencies] bitflags = "1.0" diff --git a/pcid/src/main.rs b/pcid/src/main.rs index 259664612a..dbad37c1c2 100644 --- a/pcid/src/main.rs +++ b/pcid/src/main.rs @@ -1,5 +1,4 @@ #![feature(asm)] -#![feature(iterator_step_by)] #[macro_use] extern crate bitflags; extern crate byteorder; @@ -13,8 +12,8 @@ use std::io::Read; use std::process::Command; use syscall::iopl; -use config::Config; -use pci::{Pci, PciClass, PciHeader, PciHeaderError, PciHeaderType}; +use crate::config::Config; +use crate::pci::{Pci, PciClass, PciHeader, PciHeaderError, PciHeaderType}; mod config; mod pci; diff --git a/ps2d/Cargo.toml b/ps2d/Cargo.toml index 559e6340c8..f8ac54ebb9 100644 --- a/ps2d/Cargo.toml +++ b/ps2d/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "ps2d" version = "0.1.0" +edition = "2018" [dependencies] bitflags = "0.7" diff --git a/ps2d/src/main.rs b/ps2d/src/main.rs index 0dc1c9bd4c..9fd7922d62 100644 --- a/ps2d/src/main.rs +++ b/ps2d/src/main.rs @@ -17,7 +17,7 @@ use std::sync::Arc; use event::EventQueue; use syscall::iopl; -use state::Ps2d; +use crate::state::Ps2d; mod controller; mod keymap; diff --git a/ps2d/src/state.rs b/ps2d/src/state.rs index 11472767a0..eb428dc309 100644 --- a/ps2d/src/state.rs +++ b/ps2d/src/state.rs @@ -5,8 +5,8 @@ use std::io::Write; use std::os::unix::io::AsRawFd; use syscall; -use controller::Ps2; -use vm; +use crate::controller::Ps2; +use crate::vm; bitflags! { flags MousePacketFlags: u8 { diff --git a/rtl8168d/Cargo.toml b/rtl8168d/Cargo.toml index 9f5859c1e8..0ad6373cb3 100644 --- a/rtl8168d/Cargo.toml +++ b/rtl8168d/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "rtl8168d" version = "0.1.0" +edition = "2018" [dependencies] bitflags = "0.7" diff --git a/vboxd/Cargo.toml b/vboxd/Cargo.toml index 99d1448cf9..dfb5bbe505 100644 --- a/vboxd/Cargo.toml +++ b/vboxd/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "vboxd" version = "0.1.0" +edition = "2018" [dependencies] orbclient = "0.3" diff --git a/vboxd/src/main.rs b/vboxd/src/main.rs index 6d30b4763e..74ee1612b4 100644 --- a/vboxd/src/main.rs +++ b/vboxd/src/main.rs @@ -13,7 +13,7 @@ use syscall::flag::{PHYSMAP_NO_CACHE, PHYSMAP_WRITE}; use syscall::io::{Dma, Io, Mmio, Pio}; use syscall::iopl; -use bga::Bga; +use crate::bga::Bga; mod bga; diff --git a/vesad/Cargo.toml b/vesad/Cargo.toml index 76a4553d3f..4e12f77657 100644 --- a/vesad/Cargo.toml +++ b/vesad/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "vesad" version = "0.1.0" +edition = "2018" [dependencies] orbclient = "0.3" diff --git a/vesad/src/display.rs b/vesad/src/display.rs index bb25dcb841..1b4f2cb8bb 100644 --- a/vesad/src/display.rs +++ b/vesad/src/display.rs @@ -5,7 +5,7 @@ use std::alloc::{Alloc, Global, Layout}; use std::{cmp, slice}; use std::ptr::NonNull; -use primitive::{fast_set32, fast_set64, fast_copy}; +use crate::primitive::{fast_set32, fast_set64, fast_copy}; #[cfg(feature="rusttype")] use self::rusttype::{Font, FontCollection, Scale, point}; diff --git a/vesad/src/main.rs b/vesad/src/main.rs index b5ec9cd7b8..b8aaceabb6 100644 --- a/vesad/src/main.rs +++ b/vesad/src/main.rs @@ -10,9 +10,9 @@ use std::fs::File; use std::io::{Read, Write}; use syscall::{physmap, physunmap, Packet, SchemeMut, EVENT_READ, PHYSMAP_WRITE, PHYSMAP_WRITE_COMBINE}; -use mode_info::VBEModeInfo; -use primitive::fast_set64; -use scheme::{DisplayScheme, HandleKind}; +use crate::mode_info::VBEModeInfo; +use crate::primitive::fast_set64; +use crate::scheme::{DisplayScheme, HandleKind}; pub mod display; pub mod mode_info; diff --git a/vesad/src/scheme.rs b/vesad/src/scheme.rs index 65fec1585b..46eff7639a 100644 --- a/vesad/src/scheme.rs +++ b/vesad/src/scheme.rs @@ -4,8 +4,8 @@ use std::{mem, slice, str}; use orbclient::{Event, EventOption}; use syscall::{Result, Error, EACCES, EBADF, EINVAL, ENOENT, O_NONBLOCK, Map, SchemeMut}; -use display::Display; -use screen::{Screen, GraphicScreen, TextScreen}; +use crate::display::Display; +use crate::screen::{Screen, GraphicScreen, TextScreen}; #[derive(Clone)] pub enum HandleKind { @@ -25,14 +25,14 @@ pub struct DisplayScheme { width: usize, height: usize, active: usize, - pub screens: BTreeMap>, + pub screens: BTreeMap>, next_id: usize, pub handles: BTreeMap, } impl DisplayScheme { pub fn new(width: usize, height: usize, onscreen: usize, spec: &[bool]) -> DisplayScheme { - let mut screens: BTreeMap> = BTreeMap::new(); + let mut screens: BTreeMap> = BTreeMap::new(); let mut screen_i = 1; for &screen_type in spec.iter() { @@ -227,7 +227,7 @@ impl SchemeMut for DisplayScheme { let mut new_active_opt = None; match event.to_option() { EventOption::Key(key_event) => match key_event.scancode { - f @ 0x3B ... 0x44 => { // F1 through F10 + f @ 0x3B ..= 0x44 => { // F1 through F10 new_active_opt = Some((f - 0x3A) as usize); }, 0x57 => { // F11 diff --git a/vesad/src/screen/graphic.rs b/vesad/src/screen/graphic.rs index f428099c7a..0cb6739594 100644 --- a/vesad/src/screen/graphic.rs +++ b/vesad/src/screen/graphic.rs @@ -5,9 +5,9 @@ use orbclient::{Event, ResizeEvent}; use syscall::error::*; use syscall::flag::{SEEK_SET, SEEK_CUR, SEEK_END}; -use display::Display; -use primitive::fast_copy; -use screen::Screen; +use crate::display::Display; +use crate::primitive::fast_copy; +use crate::screen::Screen; pub struct GraphicScreen { pub display: Display, diff --git a/vesad/src/screen/text.rs b/vesad/src/screen/text.rs index 34e794ff17..38b7a2976f 100644 --- a/vesad/src/screen/text.rs +++ b/vesad/src/screen/text.rs @@ -6,8 +6,8 @@ use std::ptr; use orbclient::{Event, EventOption}; use syscall::error::*; -use display::Display; -use screen::Screen; +use crate::display::Display; +use crate::screen::Screen; pub struct TextScreen { pub console: ransid::Console, @@ -92,8 +92,8 @@ impl Screen for TextScreen { }, _ => { let c = match key_event.character { - c @ 'A' ... 'Z' if self.ctrl => ((c as u8 - b'A') + b'\x01') as char, - c @ 'a' ... 'z' if self.ctrl => ((c as u8 - b'a') + b'\x01') as char, + c @ 'A' ..= 'Z' if self.ctrl => ((c as u8 - b'A') + b'\x01') as char, + c @ 'a' ..= 'z' if self.ctrl => ((c as u8 - b'a') + b'\x01') as char, c => c }; diff --git a/xhcid/Cargo.toml b/xhcid/Cargo.toml index f7eca3c226..9d8b2e7bd1 100644 --- a/xhcid/Cargo.toml +++ b/xhcid/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "xhcid" version = "0.1.0" +edition = "2018" [dependencies] bitflags = "0.7" diff --git a/xhcid/src/main.rs b/xhcid/src/main.rs index 41ec4b6118..4fa3e5ea3a 100644 --- a/xhcid/src/main.rs +++ b/xhcid/src/main.rs @@ -16,7 +16,7 @@ use syscall::flag::{PHYSMAP_NO_CACHE, PHYSMAP_WRITE}; use syscall::error::EWOULDBLOCK; use syscall::scheme::SchemeMut; -use xhci::Xhci; +use crate::xhci::Xhci; mod usb; mod xhci; diff --git a/xhcid/src/xhci/command.rs b/xhcid/src/xhci/command.rs index 76ba0e6b4e..56449a66e3 100644 --- a/xhcid/src/xhci/command.rs +++ b/xhcid/src/xhci/command.rs @@ -1,5 +1,5 @@ use syscall::error::Result; -use syscall::io::Dma; + use super::event::EventRing; use super::ring::Ring; diff --git a/xhcid/src/xhci/mod.rs b/xhcid/src/xhci/mod.rs index 795d9a7169..64bd94e539 100644 --- a/xhcid/src/xhci/mod.rs +++ b/xhcid/src/xhci/mod.rs @@ -2,7 +2,7 @@ use plain::Plain; use std::{mem, slice}; use syscall::error::Result; use syscall::io::{Dma, Io}; -use usb; +use crate::usb; mod capability; mod command; diff --git a/xhcid/src/xhci/trb.rs b/xhcid/src/xhci/trb.rs index c4193422ae..459fdc6b4a 100644 --- a/xhcid/src/xhci/trb.rs +++ b/xhcid/src/xhci/trb.rs @@ -1,6 +1,6 @@ use std::{fmt, mem}; use syscall::io::{Io, Mmio}; -use usb; +use crate::usb; #[repr(u8)] pub enum TrbType {