Commit graph

10340 commits

Author SHA1 Message Date
Sean Cross
2575d13acd cargo: update lock file
Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-23 10:59:38 +08:00
Sean Cross
10526c6be9 examples: add blockingscalar to message types
Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-23 10:59:12 +08:00
Sean Cross
4a8590d336 graphics-server: fix to change in send_message syntax
Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-23 10:58:09 +08:00
Sean Cross
9010c07fe1 Merge branch 'master' of github.com:betrusted-io/xous-core into master 2020-09-23 10:54:42 +08:00
Sean Cross
e5583a7646 kernel: fix message sender parameter
The `sender` was, previously, somewhat mislabeled. It was a combination
of PID and TID, except when it wasn't.

Instead, make this value a combination of ConnectionID and queue index.
This makes it easier to reason about which connection we're responding
to.

Additionally, don't expose teh global Server Index Table to userspace
programs.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-23 10:52:22 +08:00
Sean Cross
ad154e998e xous: add NewServerID return value
This is used when creating a new Server. In addition to the ServerID, it
also returns the ConnectionID. This is the ID that can be expected when
receiving messages.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-23 10:51:27 +08:00
bunnie
6838e6a1cc
Update README.md 2020-09-22 23:54:32 +08:00
Sean Cross
d8edcb8b9e xous: implement ReturnScalar and ReturnScalar2
Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-22 23:36:11 +08:00
Sean Cross
446fe17273 xous: add syscall for BlockingScalar
This enables this to be passed to the kernel.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-22 22:21:21 +08:00
Sean Cross
435612a370 kernel: syscall: use new is_blocking() call
This removes the need to manually specify whether a call is blocking.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-22 22:14:03 +08:00
Sean Cross
43002b8627 kernel: add blocking scalars
Add a new type: BlockingScalar, that can be used to do blocking scalar
calls such as sleep().

Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-22 22:05:18 +08:00
Sean Cross
673577a10e xous: syscall: add BlockingScalar to syscall handling
Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-22 21:33:09 +08:00
Sean Cross
81a927e31f xous: definitions: Message: add has_memory()
This function can be used to determine if a function has any memory
attached to the message.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-22 21:25:28 +08:00
Sean Cross
6c941855be xous: definitions: add is_blocking() to Message
This function can be used to determine if a Message will block when sent
to the host.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-22 21:23:18 +08:00
Sean Cross
799c1c3822 xous: definitions: add Scalar1 and Scalar2 return values
These return values can be used to return something other than "Success"
from a blocking call.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-22 21:19:37 +08:00
Sean Cross
6d931ccc33 kernel: irq: disable irqs during handler
This fixes issue #1, which correctly noted the comment was correct but
the code implementation was not correct.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-22 21:13:56 +08:00
Sean
f1353e8ff0 xous: hosted: free MemoryMessage::Move after send
This ensures that these messages aren't leaked. In a native system, this
memory would be "freed" by the kernel as it is attached to the new
memory space.

Signed-off-by: Sean <xobs@ci.betrusted.io>
2020-09-03 13:22:13 +08:00
Sean
5b45382489 xous: make SysCallNumber pub
Signed-off-by: Sean <xobs@ci.betrusted.io>
2020-09-03 13:21:52 +08:00
Sean
eb725ec57f xous: carton: leak memory when converting into_message()
When converting into a message, the associated memory should be leaked
and not freed when the Carton is dropped. This is because the Message
can outlive the MemoryMessage, and the Carton is then immediately
dropped.

Signed-off-by: Sean <xobs@ci.betrusted.io>
2020-09-03 13:20:36 +08:00
Sean
1b59719a74 kernel: hosted: support per-thread memory messages
Previously, each process could return one chunk of memory. With this
change, processes can now return one chunk of memory per thread. This
enables multiple threads to lend memory to a server.

Signed-off-by: Sean <xobs@ci.betrusted.io>
2020-09-03 13:20:16 +08:00
Sean
3e6d3904fb kernel: hosted: handle TrySendMessage the same as SendMessage
With the introduction of TrySendMessage, the kernel needs to know that
this data structure should be transmitted over the wire in the same
manner as SendMessage. Previously it was not special-casing this, which
resulted in memory errors.

Signed-off-by: Sean <xobs@ci.betrusted.io>
2020-09-03 13:17:01 +08:00
Sean
2dc0545eaa kernel: test: print informative error when kernel data changes
When the message coming in from the client to a server changes, print
an informative message rather than just "left != right".

Signed-off-by: Sean <xobs@ci.betrusted.io>
2020-09-03 13:13:44 +08:00
Sean Cross
77426aaf56 kernel: hosted: ignore errors from shutting down network socket
When running on Linux, attempting to shut down a network socket that
has already been closed results in an error. That is, if the client
disconnects, then the server will throw an error when it also attempts
to disconnect.

Ignore errors to `.shutdown()` to fix `cargo test` on Linux.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-03 10:19:05 +08:00
Sean Cross
019d520b26 xtask: print message when building the kernel
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 17:54:58 +08:00
Sean Cross
b6f1bf2079 log-server: use try_ calls
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 17:41:15 +08:00
Sean Cross
60e652bd51 shell: use try_ calls for messaging
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 17:41:02 +08:00
Sean Cross
8d438e4796 examples: graphics-server: use try_ calls for messaging
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 17:40:29 +08:00
Sean Cross
d057cba0fb xous: add "logging" feature
This will connect to a logging server to allow for log messages.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 17:39:58 +08:00
Sean Cross
cd7f8f67fc kernel: rename Connect/SendMessage to TryConnect/TrySendMessage
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 17:39:29 +08:00
Sean Cross
1a0bb99890 xous: hosted: read back memory for TrySendMessage
Like SendMessage, the TrySendMessage requires us to read back memory.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 17:38:24 +08:00
Sean Cross
7a2e5fbde8 xous: add try_ variants for connect/send_message
These will return if the server is full. Note that the previous variants
are now unimplemented.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 17:37:39 +08:00
Sean Cross
ae6dda0ad3 kernel: fix tests after message body rename
The test suite hadn't been updated to work with the new naming
convention.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 10:47:10 +08:00
Sean Cross
fbda077aff kernel: remove excess println() statements
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 10:46:48 +08:00
Sean Cross
9862977523 graphics-server: add missing files
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 01:17:56 +08:00
Sean Cross
96c5739cdd kernel: fix remaining warnings
This fixes all remaining warnings in the kernel. For now.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 01:17:35 +08:00
Sean Cross
bd851923cc xtask: add "renode-image-debug"
This enables debug for all Renode projects.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 00:37:46 +08:00
Sean Cross
98854d8e2f xous: rename message body from "message" to "body"
This makes more sense since we already have a "header" field.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 00:37:21 +08:00
Sean Cross
eaf2b038c1 xous: be more generous in specifying bitflags crate
Presumably it won't change much.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 00:36:57 +08:00
Sean Cross
bc92f4b042 kernel: services: fix build on riscv
Somehow the build broke. Oops.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 00:36:39 +08:00
Sean Cross
25824df335 kernel: services: print fewer diagnostic messages
These were printed a lot, which is not a thing we want right now.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 00:36:11 +08:00
Sean Cross
d87b59d47c kernel: riscv: print fewer debug messages
The IRQ handler was very noisy, which generated a lot of spew.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 00:35:28 +08:00
Sean Cross
9af28d0a90 kernel: irq: fix build
We were missing some packages when building on riscv.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 00:34:49 +08:00
Sean Cross
b78a71c495 kernel: print-panics: implement this feature in debug.rs
With this feature enabled, claim the kernel UART for panic printing.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 00:34:41 +08:00
Sean Cross
750f05c322 kernel: cargo: add print-panics feature
With this feature enabled, the kernel will claim a UART and print panics
when they occur.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 00:33:30 +08:00
Sean Cross
f2156b19bd graphics-server: comment out println (for now)
When building for bare metal hardware, we don't yet have println.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 00:32:46 +08:00
Sean Cross
cdc9cc71d3 Cargo: add graphics-server to cargo manifest
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 00:32:14 +08:00
Sean Cross
776fd72483 xous: syscall: work around clippy warnings on Result::Ok
clippy warns that "Result::Ok" is redundant. Work around clippy by using
the fully-qualified path.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 00:05:02 +08:00
Sean Cross
8f70c0640c kernel: fix server indexing
Server IDs were being improperly indexed, resulting in a
probably-invalid server index being returned.

Adjust these so that correct server indices are returned.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-29 22:10:24 +08:00
Sean Cross
7d8f589830 examples: get three-process IPC working
The log, graphics, and shell processes now all talk to one another. This
illustrates how multiple processes can communicate regardless of what is
going on underneath.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-29 22:09:20 +08:00
Sean Cross
bb4efbe531 xtask: add "debug" command
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-29 20:50:22 +08:00