xous: return buffer offset as part of MemoryMessages

When a MemoryMessage goes out of scope, update the buffer offset and
valid fields. This allows the caller to see what's changed.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2021-03-26 12:14:16 +08:00
parent fd255d8f53
commit cf1fc44f7e

View file

@ -500,7 +500,7 @@ impl Drop for MessageEnvelope {
fn drop(&mut self) {
match &self.body {
Message::Borrow(x) | Message::MutableBorrow(x) => {
crate::syscall::return_memory(self.sender, x.buf).expect("couldn't return memory")
crate::syscall::return_memory_offset(self.sender, x.buf, x.offset).expect("couldn't return memory")
}
Message::Move(msg) => {
crate::syscall::unmap_memory(msg.buf).expect("couldn't free memory message")