From 608403765d1d290045ddc14d10c6f5442cb2452d Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 9 Jan 2017 20:36:36 -0700 Subject: [PATCH] Refactor to move io into syscall, and use git for crate references --- ahcid/Cargo.toml | 4 +--- ahcid/src/ahci/disk.rs | 2 +- ahcid/src/ahci/fis.rs | 2 +- ahcid/src/ahci/hba.rs | 3 +-- ahcid/src/ahci/mod.rs | 2 +- ahcid/src/main.rs | 3 +-- bgad/src/main.rs | 2 ++ e1000d/Cargo.toml | 8 +++----- e1000d/src/device.rs | 2 +- e1000d/src/main.rs | 1 - pcid/Cargo.toml | 2 +- pcid/src/main.rs | 1 + ps2d/Cargo.toml | 5 ++--- ps2d/src/controller.rs | 2 +- ps2d/src/main.rs | 2 +- rtl8168d/Cargo.toml | 8 +++----- rtl8168d/src/device.rs | 3 +-- rtl8168d/src/main.rs | 2 -- vesad/Cargo.toml | 2 +- vesad/src/main.rs | 1 + vesad/src/screen/text.rs | 2 +- 21 files changed, 25 insertions(+), 34 deletions(-) diff --git a/ahcid/Cargo.toml b/ahcid/Cargo.toml index f7183317cb..ddd3fe1084 100644 --- a/ahcid/Cargo.toml +++ b/ahcid/Cargo.toml @@ -4,7 +4,5 @@ version = "0.1.0" [dependencies] bitflags = "*" -dma = { path = "../../crates/dma/" } -io = { path = "../../crates/io/" } spin = "*" -redox_syscall = { path = "../../syscall/" } +redox_syscall = { git = "https://github.com/redox-os/syscall.git" } diff --git a/ahcid/src/ahci/disk.rs b/ahcid/src/ahci/disk.rs index 4389425f5c..52170af710 100644 --- a/ahcid/src/ahci/disk.rs +++ b/ahcid/src/ahci/disk.rs @@ -1,6 +1,6 @@ use std::ptr; -use dma::Dma; +use syscall::io::Dma; use syscall::error::Result; use super::hba::{HbaPort, HbaCmdTable, HbaCmdHeader}; diff --git a/ahcid/src/ahci/fis.rs b/ahcid/src/ahci/fis.rs index 7dbe33c179..e91e4229e2 100644 --- a/ahcid/src/ahci/fis.rs +++ b/ahcid/src/ahci/fis.rs @@ -1,4 +1,4 @@ -use io::Mmio; +use syscall::io::Mmio; #[repr(u8)] pub enum FisType { diff --git a/ahcid/src/ahci/hba.rs b/ahcid/src/ahci/hba.rs index d22b7063a6..f294f14b0e 100644 --- a/ahcid/src/ahci/hba.rs +++ b/ahcid/src/ahci/hba.rs @@ -2,8 +2,7 @@ use std::mem::size_of; use std::ops::DerefMut; use std::{ptr, u32}; -use dma::Dma; -use io::{Io, Mmio}; +use syscall::io::{Dma, Io, Mmio}; use syscall::error::{Error, Result, EIO}; use super::fis::{FisType, FisRegH2D}; diff --git a/ahcid/src/ahci/mod.rs b/ahcid/src/ahci/mod.rs index fec9e0065f..072be72025 100644 --- a/ahcid/src/ahci/mod.rs +++ b/ahcid/src/ahci/mod.rs @@ -1,4 +1,4 @@ -use io::Io; +use syscall::io::Io; use self::disk::Disk; use self::hba::{HbaMem, HbaPortType}; diff --git a/ahcid/src/main.rs b/ahcid/src/main.rs index 4e8cbc98bd..0c960a22b6 100644 --- a/ahcid/src/main.rs +++ b/ahcid/src/main.rs @@ -1,9 +1,8 @@ +#![deny(warnings)] #![feature(asm)] #[macro_use] extern crate bitflags; -extern crate dma; -extern crate io; extern crate spin; extern crate syscall; diff --git a/bgad/src/main.rs b/bgad/src/main.rs index 48d75d763d..7475aaac46 100644 --- a/bgad/src/main.rs +++ b/bgad/src/main.rs @@ -1,3 +1,5 @@ +#![deny(warnings)] + use std::env; fn main() { diff --git a/e1000d/Cargo.toml b/e1000d/Cargo.toml index ec8c45e1ab..088fda764e 100644 --- a/e1000d/Cargo.toml +++ b/e1000d/Cargo.toml @@ -4,8 +4,6 @@ version = "0.1.0" [dependencies] bitflags = "*" -dma = { path = "../../crates/dma/" } -event = { path = "../../crates/event/" } -io = { path = "../../crates/io/" } -netutils = { path = "../../programs/netutils/" } -redox_syscall = { path = "../../syscall/" } +netutils = { git = "https://github.com/redox-os/netutils.git" } +redox_event = { git = "https://github.com/redox-os/event.git" } +redox_syscall = { git = "https://github.com/redox-os/syscall.git" } diff --git a/e1000d/src/device.rs b/e1000d/src/device.rs index 8cb46f31d5..76884e5ae1 100644 --- a/e1000d/src/device.rs +++ b/e1000d/src/device.rs @@ -1,9 +1,9 @@ use std::{cmp, mem, ptr, slice}; -use dma::Dma; use netutils::setcfg; use syscall::error::{Error, EACCES, EWOULDBLOCK, Result}; use syscall::flag::O_NONBLOCK; +use syscall::io::Dma; use syscall::scheme::Scheme; const CTRL: u32 = 0x00; diff --git a/e1000d/src/main.rs b/e1000d/src/main.rs index b690029c31..0d59ed52b7 100644 --- a/e1000d/src/main.rs +++ b/e1000d/src/main.rs @@ -1,6 +1,5 @@ #![feature(asm)] -extern crate dma; extern crate event; extern crate netutils; extern crate syscall; diff --git a/pcid/Cargo.toml b/pcid/Cargo.toml index f09b85a3a5..9e1965ceff 100644 --- a/pcid/Cargo.toml +++ b/pcid/Cargo.toml @@ -3,6 +3,6 @@ name = "pcid" version = "0.1.0" [dependencies] -redox_syscall = { path = "../../syscall/" } +redox_syscall = { git = "https://github.com/redox-os/syscall.git" } rustc-serialize = "0.3" toml = "0.2" diff --git a/pcid/src/main.rs b/pcid/src/main.rs index 8202d6fae8..935a8f1c02 100644 --- a/pcid/src/main.rs +++ b/pcid/src/main.rs @@ -1,3 +1,4 @@ +#![deny(warnings)] #![feature(asm)] extern crate rustc_serialize; diff --git a/ps2d/Cargo.toml b/ps2d/Cargo.toml index 22863b9ea2..3ccf4860be 100644 --- a/ps2d/Cargo.toml +++ b/ps2d/Cargo.toml @@ -4,7 +4,6 @@ version = "0.1.0" [dependencies] bitflags = "*" -event = { path = "../../crates/event/" } -io = { path = "../../crates/io/" } orbclient = "0.2" -redox_syscall = { path = "../../syscall/" } +redox_event = { git = "https://github.com/redox-os/event.git" } +redox_syscall = { git = "https://github.com/redox-os/syscall.git" } diff --git a/ps2d/src/controller.rs b/ps2d/src/controller.rs index e68d4f13ec..29738b5a66 100644 --- a/ps2d/src/controller.rs +++ b/ps2d/src/controller.rs @@ -1,4 +1,4 @@ -use io::{Io, Pio, ReadOnly, WriteOnly}; +use syscall::io::{Io, Pio, ReadOnly, WriteOnly}; bitflags! { flags StatusFlags: u8 { diff --git a/ps2d/src/main.rs b/ps2d/src/main.rs index 7c67bd3a2c..66e5d29754 100644 --- a/ps2d/src/main.rs +++ b/ps2d/src/main.rs @@ -1,9 +1,9 @@ +#![deny(warnings)] #![feature(asm)] #[macro_use] extern crate bitflags; extern crate event; -extern crate io; extern crate orbclient; extern crate syscall; diff --git a/rtl8168d/Cargo.toml b/rtl8168d/Cargo.toml index e72a130458..30846b0ba2 100644 --- a/rtl8168d/Cargo.toml +++ b/rtl8168d/Cargo.toml @@ -4,8 +4,6 @@ version = "0.1.0" [dependencies] bitflags = "*" -dma = { path = "../../crates/dma/" } -event = { path = "../../crates/event/" } -io = { path = "../../crates/io/" } -netutils = { path = "../../programs/netutils/" } -redox_syscall = { path = "../../syscall/" } +netutils = { git = "https://github.com/redox-os/netutils.git" } +redox_event = { git = "https://github.com/redox-os/event.git" } +redox_syscall = { git = "https://github.com/redox-os/syscall.git" } diff --git a/rtl8168d/src/device.rs b/rtl8168d/src/device.rs index 7ed7d59521..1f09f8372c 100644 --- a/rtl8168d/src/device.rs +++ b/rtl8168d/src/device.rs @@ -1,10 +1,9 @@ use std::mem; -use dma::Dma; -use io::{Mmio, Io, ReadOnly}; use netutils::setcfg; use syscall::error::{Error, EACCES, EWOULDBLOCK, Result}; use syscall::flag::O_NONBLOCK; +use syscall::io::{Dma, Mmio, Io, ReadOnly}; use syscall::scheme::SchemeMut; #[repr(packed)] diff --git a/rtl8168d/src/main.rs b/rtl8168d/src/main.rs index 46a1b86d6d..27ba048aa7 100644 --- a/rtl8168d/src/main.rs +++ b/rtl8168d/src/main.rs @@ -1,8 +1,6 @@ #![feature(asm)] -extern crate dma; extern crate event; -extern crate io; extern crate netutils; extern crate syscall; diff --git a/vesad/Cargo.toml b/vesad/Cargo.toml index a70dbf0d76..88acd5b284 100644 --- a/vesad/Cargo.toml +++ b/vesad/Cargo.toml @@ -6,7 +6,7 @@ version = "0.1.0" orbclient = "0.2" ransid = "0.2" rusttype = { version = "0.2", optional = true } -redox_syscall = { path = "../../syscall" } +redox_syscall = { git = "https://github.com/redox-os/syscall.git" } [features] default = [] diff --git a/vesad/src/main.rs b/vesad/src/main.rs index 7f4347a1e1..337f6a560b 100644 --- a/vesad/src/main.rs +++ b/vesad/src/main.rs @@ -1,3 +1,4 @@ +#![deny(warnings)] #![feature(alloc)] #![feature(asm)] #![feature(heap_api)] diff --git a/vesad/src/screen/text.rs b/vesad/src/screen/text.rs index ccc259d464..1ede48ebc0 100644 --- a/vesad/src/screen/text.rs +++ b/vesad/src/screen/text.rs @@ -48,7 +48,7 @@ impl Screen for TextScreen { Ok(0) } - fn map(&self, offset: usize, size: usize) -> Result { + fn map(&self, _offset: usize, _size: usize) -> Result { Err(Error::new(EBADF)) }