Commit graph

1026 commits

Author SHA1 Message Date
bunnie
e889765caf refactor the Ticktimer API. 2021-03-28 18:14:41 +08:00
Sean Cross
45239c61ef rkyv-test-server: use xous-ipc buffer
Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-26 20:25:02 +08:00
Sean Cross
fdce58d06e ipc: convert project to use xous-ipc
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>
2021-03-26 20:22:33 +08:00
Sean Cross
7bbcd951fe xous-ipc: add an initial implementation
This adds a first draft of `xous-ipc`, which specializes the IPC
features of Xous.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-26 20:22:06 +08:00
Sean Cross
8c947377d7 Merge branch 'master' of github.com:betrusted-io/xous-core 2021-03-26 17:17:41 +08:00
Sean Cross
fa23a7fa21 xtask: build renode-test with rkyv-test-*
Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-26 17:17:20 +08:00
Sean Cross
f6c2ee4410 rkyv-test-client: use new log_message_send()
Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-26 17:17:03 +08:00
Sean Cross
8760de0406 rkyv-test-server: add log_message_send to test Send messages
This uncovered a bug in the kernel where Send messages didn't work.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-26 17:16:21 +08:00
Sean Cross
5ae39de7da kernel: riscv: run rustfmt on mem.rs
Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-26 17:14:26 +08:00
Sean Cross
16ea102e94 xous: string: allow any stringlike thing to be used
Anything that can be turned into a string can now be used in
`from_str()`.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-26 17:14:26 +08:00
Sean Cross
af5598d2dc kernel: move memory owner when a Move occurs
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>
2021-03-26 17:14:26 +08:00
bunnie
92656724f5 add minimal image as a build option 2021-03-26 15:53:38 +08:00
bunnie
850cd809b1 Merge branch 'master' of https://github.com/betrusted-io/xous-core 2021-03-26 15:37:09 +08:00
Sean Cross
f58f82a40d rkyv-test-server: support multiple callbacks for one client
There doesn't seem to be a compelling reason to limit clients to just
one callback.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-26 12:42:35 +08:00
Sean Cross
c1fe20c06b services: allow for multiple callbacks
This means we can have multiple clients requesting a callback.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-26 12:41:15 +08:00
Sean Cross
561a0c3e27 rkyv-test-client: make doubling string dynamic
This tests for emoji as well as making sure it's working as intended.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-26 12:40:47 +08:00
Sean Cross
22b50d080b rkyv-test-client: dynamically generate log message string
By dynamically generating the log message string, we ensure dynamic
buffer adjustments are accepted.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-26 12:33:30 +08:00
Sean Cross
e27db818ef rkyv-test-server: accept any string-like arguments
As long as we can turn an argument into a string, that's good enough for
us.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-26 12:32:42 +08:00
Sean Cross
32ebee0b8f xous: String: implement AsRef<str>
This allows xous Strings to be used in functions that expect to be able
to stringify arguments.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-26 12:31:59 +08:00
Sean Cross
0f455a9a02 rkyv-test-client: use new double_string call
Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-26 12:16:26 +08:00
Sean Cross
ff180ca737 rkyv-test-server: add DoubleString api call
This demonstrates how we might use strings in syscalls.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-26 12:15:57 +08:00
Sean Cross
461f5c5f8d rkyv-test-server: buffer: add from_memory_message_mut()
This enables passing data back to the caller by modifying the original
message `offset` field.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-26 12:15:13 +08:00
Sean Cross
cf1fc44f7e 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>
2021-03-26 12:14:16 +08:00
bunnie
387d3aeefc Merge branch 'master' of https://github.com/betrusted-io/xous-core 2021-03-25 23:43:13 +08:00
Sean Cross
fd255d8f53 services: add rkyv-test-client and rkyv-test-server
These servers demonstrate how we might use rkyv in the future.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 23:39:35 +08:00
Sean Cross
364cd94326 xous: definitions: don't allow mutable refs to lends
lends are non-mutable, so don't allow them to be mutably borrowed.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 23:38:20 +08:00
bunnie
f329221e07 Merge branch 'master' of https://github.com/betrusted-io/xous-core 2021-03-25 16:16:53 +08:00
Sean Cross
078f6ba625 kernel: services: be more proactive about updating current_thread
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>
2021-03-25 16:15:19 +08:00
Sean Cross
6efc6bdfd5 services: kernel-test: add loopback test
Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 16:01:57 +08:00
bunnie
12a06d8d80 Merge branch 'master' of https://github.com/betrusted-io/xous-core 2021-03-25 15:03:23 +08:00
Sean Cross
a5993f0445 kernel: fix hosted representation of ReturnMemory
Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 14:56:40 +08:00
bunnie
f61d8d3a8f Merge branch 'master' of github.com:betrusted-io/xous-core 2021-03-25 14:23:11 +08:00
Sean Cross
c7b2b2cab0 xous: add offset and valid to returned memory
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>
2021-03-25 13:16:15 +08:00
Sean Cross
52c993556f services: gam: use create_thread_4
This replaces create_thread_simple() which is unsound and has been
deprecated.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 13:15:42 +08:00
Sean Cross
006101835e services: shellchat: use create_thread_0
This replaces create_thread_simple() which is deprecated.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 13:15:16 +08:00
Sean Cross
d3879d36ac xous: use try_into when converting messages to syscalls
This moves message internals back into the message struct.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 11:58:50 +08:00
Sean Cross
6cdd9b4b4c services: use shorter timeout for thread 4
Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 11:31:50 +08:00
Sean Cross
5367697b54 services: kernel-test: use create_thread_n
Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 11:12:44 +08:00
Sean Cross
4cbfe5f90f services: log-server: use create_thread_1()
This moves away from the deprecated `create_thread_simple()` call.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 10:54:22 +08:00
Sean Cross
5410d62ef5 xous: fix create_thread_[2..4] arg count
These functions assumed there was only one argument, which was
incorrect.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 10:53:50 +08:00
Sean Cross
cecd78fd61 xous: hosted: implement create_thread_n()
Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 10:53:32 +08:00
Sean Cross
2b97ea25ab xous: add create_thread_n functions
These are used to create threads with between 0 and 4 arguments.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 10:42:49 +08:00
Sean Cross
568d1263a3 kernel: syscall: remove variables that never change
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>
2021-03-25 09:14:43 +08:00
Sean Cross
eb2014bc80 kernel: hosted: fix kernel tests
We don't need to re-create the PID1 process, since it is done
immediately now.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 09:13:27 +08:00
bunnie
10d66c799f fix typo in script 2021-03-25 03:25:26 +08:00
bunnie
ef3653bf36 add updated SVD files for WDT interrupt rev 2021-03-25 02:40:18 +08:00
bunnie
0940894b27 add a minimal target 2021-03-25 02:40:00 +08:00
bunnie
bb3d96de27 Merge branch 'master' of https://github.com/betrusted-io/xous-core into HEAD 2021-03-25 02:37:58 +08:00
bunnie
8763cf3133 stash before merge 2021-03-24 22:48:23 +08:00
Sean Cross
455bd4ccfb kernel: services: add more debug print crumbs
These could be useful in finding out what's gone wrong.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-24 22:12:29 +08:00