Merge branch 'edition-upgrade' into 'redox-unix'

Edition upgrade and build fixes

See merge request redox-os/drivers!42
This commit is contained in:
Jeremy Soller
2019-07-01 22:34:52 +00:00
37 changed files with 102 additions and 94 deletions
Generated
+32 -35
View File
@@ -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)" = "<none>"
"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)" = "<none>"
"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)" = "<none>"
"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)" = "<none>"
"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)" = "<none>"
"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)" = "<none>"
@@ -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)" = "<none>"
"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)" = "<none>"
"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"
+1
View File
@@ -1,6 +1,7 @@
[package]
name = "ahcid"
version = "0.1.0"
edition = "2018"
[dependencies]
bitflags = "0.7"
+3 -3
View File
@@ -18,18 +18,18 @@ pub trait Disk {
fn block_length(&mut self) -> Result<u32>;
}
pub fn disks(base: usize, name: &str) -> (&'static mut HbaMem, Vec<Box<Disk>>) {
pub fn disks(base: usize, name: &str) -> (&'static mut HbaMem, Vec<Box<dyn Disk>>) {
let hba_mem = unsafe { &mut *(base as *mut HbaMem) };
hba_mem.init();
let pi = hba_mem.pi.read();
let disks: Vec<Box<Disk>> = (0..hba_mem.ports.len())
let disks: Vec<Box<dyn Disk>> = (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<Box<Disk>> = match port_type {
let disk: Option<Box<dyn Disk>> = match port_type {
HbaPortType::SATA => {
match DiskATA::new(i, port) {
Ok(disk) => Some(Box::new(disk)),
+1 -1
View File
@@ -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;
+8 -8
View File
@@ -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<Disk>]>,
disks: Box<[Box<dyn Disk>]>,
handles: BTreeMap<usize, Handle>,
next_id: usize
}
impl DiskScheme {
pub fn new(scheme_name: String, hba_mem: &'static mut HbaMem, disks: Vec<Box<Disk>>) -> DiskScheme {
pub fn new(scheme_name: String, hba_mem: &'static mut HbaMem, disks: Vec<Box<dyn Disk>>) -> 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),
+1
View File
@@ -1,6 +1,7 @@
[package]
name = "alxd"
version = "0.1.0"
edition = "2018"
[dependencies]
bitflags = "0.7"
+3 -3
View File
@@ -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<usize> {
fn read(&mut self, id: usize, _buf: &mut [u8]) -> Result<usize> {
/*
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<usize> {
fn write(&mut self, _id: usize, _buf: &[u8]) -> Result<usize> {
/*
loop {
let head = unsafe { self.read(TDH) };
+1
View File
@@ -1,6 +1,7 @@
[package]
name = "bgad"
version = "0.1.0"
edition = "2018"
[dependencies]
orbclient = "0.3"
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -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,
+1
View File
@@ -1,6 +1,7 @@
[package]
name = "e1000d"
version = "0.1.0"
edition = "2018"
[dependencies]
bitflags = "0.7"
+3 -3
View File
@@ -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() {
+1 -1
View File
@@ -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;
+1
View File
@@ -1,6 +1,7 @@
[package]
name = "ihdad"
version = "0.1.0"
edition = "2018"
[dependencies]
bitflags = "0.7"
+5 -5
View File
@@ -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<Option<usize>> {
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<Option<usize>> {
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:";
+2 -2
View File
@@ -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);
}
+1
View File
@@ -1,6 +1,7 @@
[package]
name = "nvmed"
version = "0.1.0"
edition = "2018"
[dependencies]
bitflags = "0.7"
+3 -3
View File
@@ -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;
+1
View File
@@ -1,6 +1,7 @@
[package]
name = "pcid"
version = "0.1.0"
edition = "2018"
[dependencies]
bitflags = "1.0"
+2 -3
View File
@@ -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;
+1
View File
@@ -1,6 +1,7 @@
[package]
name = "ps2d"
version = "0.1.0"
edition = "2018"
[dependencies]
bitflags = "0.7"
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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 {
+1
View File
@@ -1,6 +1,7 @@
[package]
name = "rtl8168d"
version = "0.1.0"
edition = "2018"
[dependencies]
bitflags = "0.7"
+1
View File
@@ -1,6 +1,7 @@
[package]
name = "vboxd"
version = "0.1.0"
edition = "2018"
[dependencies]
orbclient = "0.3"
+1 -1
View File
@@ -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;
+1
View File
@@ -1,6 +1,7 @@
[package]
name = "vesad"
version = "0.1.0"
edition = "2018"
[dependencies]
orbclient = "0.3"
+1 -1
View File
@@ -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};
+3 -3
View File
@@ -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;
+5 -5
View File
@@ -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<usize, Box<Screen>>,
pub screens: BTreeMap<usize, Box<dyn Screen>>,
next_id: usize,
pub handles: BTreeMap<usize, Handle>,
}
impl DisplayScheme {
pub fn new(width: usize, height: usize, onscreen: usize, spec: &[bool]) -> DisplayScheme {
let mut screens: BTreeMap<usize, Box<Screen>> = BTreeMap::new();
let mut screens: BTreeMap<usize, Box<dyn Screen>> = 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
+3 -3
View File
@@ -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,
+4 -4
View File
@@ -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
};
+1
View File
@@ -1,6 +1,7 @@
[package]
name = "xhcid"
version = "0.1.0"
edition = "2018"
[dependencies]
bitflags = "0.7"
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -1,5 +1,5 @@
use syscall::error::Result;
use syscall::io::Dma;
use super::event::EventRing;
use super::ring::Ring;
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -1,6 +1,6 @@
use std::{fmt, mem};
use syscall::io::{Io, Mmio};
use usb;
use crate::usb;
#[repr(u8)]
pub enum TrbType {