firmware: DmaPlayback → DMARetrieve

This commit is contained in:
Sebastien Bourdeauducq 2017-04-19 11:11:42 +08:00
parent badbd72beb
commit fe05aede78
3 changed files with 8 additions and 8 deletions

View File

@ -369,8 +369,8 @@ struct DmaTrace {
extern fn dma_retrieve(name: CSlice<u8>) -> DmaTrace {
let name = str::from_utf8(name.as_ref()).unwrap();
send(&DmaPlaybackRequest { name: name });
recv!(&DmaPlaybackReply { trace, duration } => {
send(&DmaRetrieveRequest { name: name });
recv!(&DmaRetrieveReply { trace, duration } => {
match trace {
Some(bytes) => Ok(DmaTrace {
address: bytes.as_ptr() as i32,

View File

@ -38,10 +38,10 @@ pub enum Message<'a> {
name: &'a str
},
DmaPlaybackRequest {
DmaRetrieveRequest {
name: &'a str
},
DmaPlaybackReply {
DmaRetrieveReply {
trace: Option<&'a [u8]>,
duration: u64
},

View File

@ -128,9 +128,9 @@ fn host_write(stream: &mut Write, reply: host::Reply) -> io::Result<()> {
fn kern_send(io: &Io, request: &kern::Message) -> io::Result<()> {
match request {
&kern::LoadRequest(_) => debug!("comm->kern LoadRequest(...)"),
&kern::DmaPlaybackReply { trace, duration } => {
&kern::DmaRetrieveReply { trace, duration } => {
if trace.map(|data| data.len() > 100).unwrap_or(false) {
debug!("comm->kern DmaPlaybackReply {{ trace: ..., duration: {:?} }}", duration)
debug!("comm->kern DmaRetrieveReply {{ trace: ..., duration: {:?} }}", duration)
} else {
debug!("comm->kern {:?}", request)
}
@ -410,9 +410,9 @@ fn process_kern_message(io: &Io, mut stream: Option<&mut TcpStream>,
session.congress.dma_manager.erase(name);
kern_acknowledge()
}
&kern::DmaPlaybackRequest { name } => {
&kern::DmaRetrieveRequest { name } => {
session.congress.dma_manager.with_trace(name, |trace, duration| {
kern_send(io, &kern::DmaPlaybackReply {
kern_send(io, &kern::DmaRetrieveReply {
trace: trace,
duration: duration
})