firmware: move {ProtoRead,ProtoWrite} to the root of libio.

This commit is contained in:
whitequark 2018-05-15 08:16:09 +00:00
parent 4416c04ae1
commit ce0593315b
11 changed files with 15 additions and 16 deletions

View File

@ -204,6 +204,8 @@ dependencies = [
"byteorder 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"cslice 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"dyld 0.0.0",
"failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"failure_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"io 0.0.0",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
]

View File

@ -127,7 +127,7 @@ extern fn rpc_send_async(service: u32, tag: CSlice<u8>, data: *const *const ())
rpc_proto::send_args(&mut writer, service, tag.as_ref(), data)?;
writer.position()
};
io::proto::ProtoWrite::write_u32(&mut slice, length as u32)
io::ProtoWrite::write_u32(&mut slice, length as u32)
}).unwrap_or_else(|err| {
assert!(err == io::Error::UnexpectedEof);

View File

@ -15,9 +15,11 @@ use core::result;
mod cursor;
#[cfg(feature = "byteorder")]
pub mod proto;
mod proto;
pub use cursor::Cursor;
#[cfg(feature = "byteorder")]
pub use proto::{ProtoRead, ProtoWrite};
pub type Result<T, E> = result::Result<T, Error<E>>;

View File

@ -8,6 +8,8 @@ name = "proto_artiq"
path = "lib.rs"
[dependencies]
failure = { version = "0.1", default-features = false }
failure_derive = { version = "0.1", default-features = false }
byteorder = { version = "1.0", default-features = false }
cslice = { version = "0.3" }
log = { version = "0.4", default-features = false, optional = true }

View File

@ -1,5 +1,4 @@
use io::{Write, Result};
use io::proto::{ProtoWrite};
use io::{Write, ProtoWrite, Result};
#[derive(Debug)]
pub struct Header {

View File

@ -1,5 +1,4 @@
use io::{Read, Write, Error, Result};
use io::proto::{ProtoRead, ProtoWrite};
use io::{Read, ProtoRead, Write, ProtoWrite, Error, Result};
#[derive(Debug)]
pub enum Packet {

View File

@ -2,8 +2,7 @@ use alloc::Vec;
#[cfg(feature = "log")]
use log;
use io::{Read, Write, Error, Result};
use io::proto::{ProtoRead, ProtoWrite};
use io::{Read, ProtoRead, Write, ProtoWrite, Error, Result};
#[derive(Debug)]
pub enum Request {

View File

@ -1,5 +1,4 @@
use io::{Read, Write, Error, Result};
use io::proto::{ProtoRead, ProtoWrite};
use io::{Read, ProtoRead, Write, ProtoWrite, Error, Result};
#[derive(Debug)]
pub enum HostMessage {

View File

@ -1,9 +1,7 @@
use core::str;
use cslice::{CSlice, CMutSlice};
use io::{Read, Write, Result};
use io::proto::{ProtoRead, ProtoWrite};
use io::{ProtoRead, Read, Write, ProtoWrite, Result};
use self::tag::{Tag, TagIterator, split_tag};
unsafe fn recv_value<T>(reader: &mut T, tag: Tag, data: &mut *mut (),

View File

@ -1,7 +1,6 @@
use alloc::{Vec, String};
use io::{Read, Write, Error, Result};
use io::proto::{ProtoRead, ProtoWrite};
use io::{Read, ProtoRead, Write, ProtoWrite, Error, Result};
fn read_sync<T: Read + ?Sized>(reader: &mut T) -> Result<(), T::ReadError> {
let mut sync = [0; 4];

View File

@ -1,6 +1,6 @@
use log::{self, LevelFilter};
use io::{self, Read, Write, proto::ProtoWrite};
use io::{self, Read, Write, ProtoWrite};
use board_misoc::boot;
use logger_artiq::BufferLogger;
use sched::Io;