This brings intra-process lending in-line with intra-process sending,
where memory is not remapped the pointer is simply reused.
We may change this at a later point in order to further enforce the
concept of lent-memory-is-inaccessible, so do not rely in this behavior.
Signed-off-by: Sean Cross <sean@xobs.io>
This implements a syscall to shut down a server. Servers may not be shut
down if they have outstanding messages that they have seen but not
responded to.
Signed-off-by: Sean Cross <sean@xobs.io>
- debounce is now in hardware (requires latest version of betrusted-soc)
- key events originate from an interrupt context and propagate through
to the listeners as messages
- attempt to reduce the use of heapless::Vec; there is an awkward
interposer step still between the array methodology and the Vec
methodology
I'm not sure if trying to eliminate the Vec is a good idea,
because...I'm finding that we're just re-implementing Vec, but
much worse.
However, for the purpose of movement of data across
IPC boundaries, it's more robust to use primitive types,
because serializing Vec is not possible without either
forking the heapless crate to derive the rkyv traits; or, we'd
have to do some probably quite dangerous conversion of the Vec
to a raw slice which also doesn't feel nice.
The syntax to pattern-match a message is a pretty heavy cognitive
burden. Try to ease that by introducing a macro.
The main coin-toss here is whether to include the "what you do
with the message" expression within the macro, or to allow it to
be a block that trails it.
The main benefit of including the body inside the macro is that
we can append an "else" clause that spits out an error message
in case the template didn't match. The drawback is the awkwardness
of putting curly braces inside the parens of the macro expansion.
I think Rust coders are probably more OK with that awkwardness,
even though I find it visually unappealing; and the benefit is that
scalars sent to opcodes expecting blockingscalars (and vice versa)
don't go to a "black hole" -- you'll get an error message.
This error message will probably save someone an hour of debugging
someday, so we'll go with the awkwardness.