kernel: add memory from Results to network packets

If a Result contains attached memory, add that memory on to the network
packet that gets sent by the kernel.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2020-10-30 10:14:43 +08:00
parent 702676031e
commit 74b3fde198

View file

@ -570,6 +570,10 @@ pub fn idle() -> bool {
for word in response.to_args().iter_mut() {
response_vec.extend_from_slice(&word.to_le_bytes());
}
if let Some(mem) = response.memory() {
let s = unsafe { core::slice::from_raw_parts(mem.as_ptr(), mem.len()) };
response_vec.extend_from_slice(s);
}
process.send(&response_vec).unwrap_or_else(|_e| {
// If we're unable to send data to the process, assume it's dead and terminate it.
eprintln!(