When the kernel is processing an interrupt, use the exception stack.
This ensures that the kernel interrupt handler can switch processes
without having its stack go away.
This is used for debug information.
Signed-off-by: Sean Cross <sean@xobs.io>
These calls can be used to print out thread information for debugging.
This augments the existing `print_thread()` call, which has been renamed
to `print_current_thread()`.
Signed-off-by: Sean Cross <sean@xobs.io>
Due to several errors, multi-page lending did not work properly.
To begin with, if a page was not allocated then it would not be able to
be sent. That is, if you allocated 8192 bytes but only ever accessed the
first 4096 bytes, then an error would be encountered when lending the
unaccessed upper page.
Furthermore, due to a striding error in accessing pointers, half-pages
were treated as full pages.
Signed-off-by: Sean Cross <sean@xobs.io>
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>
This rewrites the entire project so that most runnable projects now use
`xous-ipc` instead of `xous::String` where possible.
This also removes `rkyv` from the list of dependencies in `xous-rs`.
Signed-off-by: Sean Cross <sean@xobs.io>
When moving memory between processes, update the owner of that page to
match the new PID. Otherwise, memory can never be released.
Signed-off-by: Sean Cross <sean@xobs.io>
The `current_thread` variable is used to determine which thread to
switch back to after a context switch occurs. Keep track of the thread
more closely.
Signed-off-by: Sean Cross <sean@xobs.io>
This will enable us to have more information about the result that is
returned when mutable memory is modified by a server.
Signed-off-by: Sean Cross <sean@xobs.io>
The `can_resume` variable doesn't change, and can be made a constant.
This slightly improves reasoning about what the function is doing.
Signed-off-by: Sean Cross <sean@xobs.io>
This reworks the server queue to add a "generation counter". This
counter ensures messages are removed from the queue in the order they
were added, even if they are jumbled up within the queue itself.
Signed-off-by: Sean Cross <sean@xobs.io>
Instead of queueing the client thread number inside the server, queue
the server's thread number inside the server.
This prevents many spooky messages that were occurring when server
queues got full.
Signed-off-by: Sean Cross <sean@xobs.io>