Sean Cross
a36ceb00c2
kernel: use crossbeam for tests
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-30 16:51:21 +08:00
Sean Cross
c9cb50b579
kernel: use crossbeam-channel internally
...
This provides better performance than MPSC.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-30 16:50:28 +08:00
bunnie
ed5624635b
Merge branch 'master' of https://github.com/betrusted-io/xous-core into hardware
2020-12-14 17:58:39 +08:00
bunnie
c9a18125df
add hardware TRNG support to kernel (issue #16 )
2020-12-14 17:57:29 +08:00
Sean Cross
ddd57c30bd
kernel: fix compile error when debug-print enabled
...
This tracks a variable that has been renamed, and was preventing the
kernel from compiling when debug printing is enabled.
This fixes #19 .
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-14 17:02:58 +08:00
hasheddan
1953c0f9d9
Update kernel README.md links to other docs
...
Fixes links in kernel directory README.md to top-level documentation.
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-12-06 10:41:53 -06:00
Sean Cross
f49518f7d5
kernel: add connect_for_process()
...
This allows one process to establish a connection to a server on behalf
of another process.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-04 23:25:41 +08:00
Sean Cross
b094f1147b
xous: implement sender.pid()
...
This is mostly an implementation detail, but appears to work.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-04 22:38:35 +08:00
Sean Cross
1fa83d1d94
xous: make MessageSender a struct
...
This is now an object instead of an alias for `usize`, in preparation
for adding a `.pid()` function.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-04 22:16:24 +08:00
Sean Cross
1f1a535801
kernel: fix pid generation for non-test case
...
When compiling under non-test scenarios, the `rand` create conflicts
with the new `rand` module.
Disambiguate this field.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-04 21:12:18 +08:00
Sean Cross
168ffe004e
kernel: use create_server() for some tests
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-04 20:59:21 +08:00
Sean Cross
85b6357d26
kernel: implement CreateServer
...
This implements CreateServer, which creates a server with a random name.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-04 20:58:14 +08:00
Sean Cross
25e4d16de3
xous-os: rename CreateServer to CreateServerWithAddress
...
Servers will, by default, get randomly-assigned SIDs. Certain servers
will want to have well-known SIDs, such as the log server or the
nameserver. These will use a separate call in order to perform this
priveledged operation.
A subsequent patch will add `CreateServer`.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-04 20:33:33 +08:00
Sean Cross
f2e2505d4b
kernel: server: remove bounds checks from take_waiting_message
...
This function has been rewritten to no longer have a bounds check.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-01 13:27:30 +08:00
Sean Cross
e4f7c7286d
kernel: fix commented code in server
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-01 13:20:34 +08:00
Sean Cross
d5f82b7972
kernel: test: fix message ordering test
...
It turns out that it was working fine, the test was just broken.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-01 13:18:49 +08:00
Sean Cross
e7744b25ec
kernel: services: format document
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-01 11:54:23 +08:00
Sean Cross
8c994e0397
kernel: add test for message ordering
...
Messages are arriving out-of-order, which is considered a bug.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-01 10:29:46 +08:00
bunnie
19a7a9ce98
get threaded version of COM handler working
2020-11-27 01:32:10 +08:00
bunnie
99d8f2a525
version with threads compiles, but doesn't work yet
2020-11-27 00:35:29 +08:00
Sean Cross
f0db281c7d
kernel: add test for try_receive_message()
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-25 20:52:13 +08:00
Sean Cross
8927ef00a2
kernel: add TryReceiveMessage support
...
This is a nonblocking form of ReceiveMessage.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-25 20:26:21 +08:00
bunnie
db25b05a14
Merge branch 'master' of github.com:betrusted-io/xous-core
2020-11-24 22:46:24 +08:00
bunnie
772bceeb2d
fix interrupt pending clear issue in debug module
...
during conversion to documented interrupts from Litex a case was
missed.
2020-11-24 22:46:10 +08:00
Sean Cross
59b108f0d2
Cargo: update to latest lockfiles
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-24 22:30:40 +08:00
Sean Cross
f3a2c31067
kernel: add test for out-of-order blockingscalars
...
This already works, we just want to make sure it works.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-24 15:35:54 +08:00
Sean Cross
e3cb05baf5
kernel: syscall: send WouldBlock to retry messages
...
This is handled by the client library to re-send the request.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-23 20:04:37 +08:00
bunnie
1aa01fdf5d
confirm sleep works, some minor fixup to UTRA style usage
2020-11-23 19:02:02 +08:00
Sean Cross
65c8c6eef5
kernel: implement and use klog!() macro
...
This replaces the majority of println!() and print!() calls, and works
on baremetal and hosted modes.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-23 17:24:28 +08:00
Sean Cross
eecd9c2367
kernel: syscall: return Ok for yield() on hosted
...
When running in Hosted mode, a yield shouldn't do anything.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-23 17:23:53 +08:00
Sean Cross
dfa20cc1b1
kernel: test: rename send_repeat_mutableborrow_message
...
This function would previously clash with the other name.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-23 17:22:59 +08:00
Sean Cross
657604a199
kernel: test: use as_ptr() for memory messages
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-23 17:22:37 +08:00
Sean Cross
1291a2b3aa
kernel: hosted: fix unused variable warnings
...
These only appear when not printing messages.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-23 17:21:57 +08:00
Sean Cross
6041269033
kernel: Cargo: minor spacing reformat
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-23 17:14:39 +08:00
Sean Cross
8a3f6a2b43
kernel: fix mutableborrow message returning
...
We weren't properly updating the packet when a mutableborrow was getting
returned.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-23 15:19:02 +08:00
Sean Cross
be1687ffdd
Merge branch 'master' of github.com:betrusted-io/xous-core
2020-11-23 14:20:27 +08:00
bunnie
2d5bd20c16
bouncing ball "招财猫"-like totem now working
2020-11-23 03:18:43 +08:00
bunnie
710abce418
fixup to latest soc.svd register documentation standard
2020-11-22 03:45:44 +08:00
Sean Cross
5186594f17
kernel: remove excess debug output from hosted mode
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-11 16:22:29 +08:00
Sean Cross
b8d9d1e1b3
Revert "kernel: hosted: don't send responses twice"
...
This causes problems, and fixes an issue that doesn't actually exist.
Revert it.
This reverts commit fc9f597092 .
2020-11-11 16:18:39 +08:00
Sean Cross
4e6a189e4e
kernel: fix returning scalars in interrupt context
...
This is now allowed.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-11 16:06:08 +08:00
Sean Cross
4b83edc43b
kernel: server: replace ctx with tid
...
Threads haven't been called contexts for a very long time.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-11 16:04:35 +08:00
Sean Cross
7156ab5e79
kernel: mem: match riscv printf with rest of formatting
...
We don't use `println` anymore, we use `print`.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-11 16:03:52 +08:00
Sean Cross
aee42bf264
kernel: print message when idling
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-11 16:03:29 +08:00
Sean Cross
fc9f597092
kernel: hosted: don't send responses twice
...
If we've already sent a response, don't send a second response.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-11 12:55:58 +08:00
Sean Cross
2698333382
kernel: allow making syscalls from an interrupt
...
This enables calling some syscalls from within an interrupt context.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-01 17:59:26 +08:00
Sean Cross
c6e12a5ecd
kernel: remove dead code from hosted/irq.rs
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-01 16:29:36 +08:00
Sean Cross
7ab2338ff3
kernel: add in_irq parameter to syscall::handle()
...
This parameter will determine whether a syscall is being handled from
within an interrupt context. This is because certain calls cannot be
called from such a context.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-01 16:27:39 +08:00
Sean Cross
719549a2cb
xous: rename ReturnToParentI -> ReturnToParent
...
This syscall isn't the only one that can be called from an interrupt
context.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-01 16:26:19 +08:00
Sean Cross
d76832dada
kernel: services: return ServerNotFound when server isn't found
...
This is more intuitive than `OutOfMemory`.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 20:43:59 +08:00