mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
xous: definitions: add default constructors for Message
Enable creating new_lend() and new_scalar() messages. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
7fe10b6463
commit
a1b16a74cb
1 changed files with 28 additions and 0 deletions
|
|
@ -408,6 +408,34 @@ impl Message {
|
|||
})
|
||||
}
|
||||
|
||||
pub fn new_lend(
|
||||
id: usize,
|
||||
buf: MemoryRange,
|
||||
offset: Option<MemoryAddress>,
|
||||
valid: Option<MemorySize>,
|
||||
) -> crate::Message {
|
||||
Message::Borrow(crate::MemoryMessage {
|
||||
id,
|
||||
buf,
|
||||
offset,
|
||||
valid,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn new_lend_mut(
|
||||
id: usize,
|
||||
buf: MemoryRange,
|
||||
offset: Option<MemoryAddress>,
|
||||
valid: Option<MemorySize>,
|
||||
) -> crate::Message {
|
||||
Message::MutableBorrow(crate::MemoryMessage {
|
||||
id,
|
||||
buf,
|
||||
offset,
|
||||
valid,
|
||||
})
|
||||
}
|
||||
|
||||
/// Determine whether the specified Message will block
|
||||
pub fn is_blocking(&self) -> bool {
|
||||
match *self {
|
||||
|
|
|
|||
Loading…
Reference in a new issue