Commit graph

5139 commits

Author SHA1 Message Date
bunnie
cc97f157e4 bump kernel rev for publication 2023-01-31 16:10:53 +08:00
bunnie
6b0257b5d5 make the fence operation stronger on susres 2023-01-31 16:05:28 +08:00
bunnie
2a6679668b Merge branch 'main' of github.com:betrusted-io/xous-core into main 2023-01-31 16:05:05 +08:00
bunnie
d1f59a68e9 induce pddb-ci to exit
it exits with a panic, but at least it exits now!
2023-01-31 16:04:10 +08:00
Sean Cross
1303e6416d kernel: fixup current_thread==0 on resume
For some reason, the current thread becomes 0 during suspend or resume.
This causes an error during boot.

Patch this up while we figure out what's causing it.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-31 16:01:35 +08:00
Sean Cross
abb1455fe6 fix previous commit
Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-31 15:51:31 +08:00
bunnie
d5b5a83445
Merge pull request #311 from betrusted-io/unify-kernel-scalar-return
Unify kernel scalar return
2023-01-31 15:48:59 +08:00
bunnie
11c987c5f6 this loader commit was accidentally pulled into a previous mass-commit 2023-01-31 15:14:47 +08:00
bunnie
e5fdd0fec7 commit new versions to verifiers 2023-01-31 15:12:19 +08:00
bunnie
9256e7cc09 bump versions to absorb xous-names fix 2023-01-31 15:07:32 +08:00
bunnie
f2068f2c89 fix regression in xous-names blocking connect
The `libstd` implementation has a bug where it was going through
a vector and mutating it by removing items from the vector,
but not updating the indices.

This fix goes through the vector in reverse order, so that removed
items don't affect the position of the next items in iteration order.

This seems to make the blocking connect much more stable.
2023-01-31 15:06:27 +08:00
Sean Cross
778e217de8 kernel: unify scalar return calls
Unify scalar return calls so that we only have one return path rather
than three.

We can almost unify memory returning as well, but it's not quite there.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-31 14:46:38 +08:00
Sean Cross
673d08b297 Merge branch 'main' of github.com:betrusted-io/xous-core 2023-01-31 13:57:41 +08:00
bunnie
21778f5895
Merge pull request #307 from betrusted-io/time-testing
move pddb dependencies to a feature flag for testing purposes
2023-01-31 13:42:51 +08:00
bunnie
0960e7f8fc
Merge pull request #309 from betrusted-io/hosted-mode-fixes
kernel: fix hosted mode
2023-01-31 13:42:23 +08:00
Sean Cross
fc8d78c2ec kernel: fix hosted mode
The process scheduler changed in subtle ways taht completely broke
hosted mode.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-31 11:24:09 +08:00
bunnie
ca2a47e67f fix hosted mode again 2023-01-31 03:27:28 +08:00
bunnie
215f15f138 add missing feature flags to usb device crate 2023-01-31 03:19:17 +08:00
bunnie
b7c4587505 remove the hack to work around ms config issues 2023-01-31 03:19:00 +08:00
bunnie
f40462dc90 fix tts build 2023-01-31 02:46:00 +08:00
bunnie
b18230def4 move pddb dependencies to a feature flag for testing purposes 2023-01-31 02:34:12 +08:00
bunnie
583198af07 bump verifiers and cargo.lock 2023-01-31 02:28:38 +08:00
bunnie
84368c3f3a bump versions for publication 2023-01-31 02:18:12 +08:00
bunnie
ea5d8acd3d Merge branch 'main' of github.com:betrusted-io/xous-core into main 2023-01-31 02:17:42 +08:00
bunnie
c193d20e55
Merge pull request #306 from betrusted-io/libstd-fixups
Libstd fixups
2023-01-31 02:17:17 +08:00
bunnie
801d164cf4 bump release notes 2023-01-31 02:07:59 +08:00
bunnie
a85c0f336c add missing feature dependency to transientdisk 2023-01-31 02:06:56 +08:00
bunnie
2e10c181b5 Merge branch 'main' of github.com:betrusted-io/xous-core into main 2023-01-31 01:35:47 +08:00
bunnie
c48f88ab93
Merge pull request #302 from gsora/feat/apps-block-device
feat: user-space USB block devices
2023-01-31 01:34:08 +08:00
bunnie
5113c8e18d refactor xous-api-names to properly block (fix #303)
This refactors the lib function to use the existing
`std` call for blocking if at first a regular connection
attempt does not succeed.
2023-01-31 01:31:42 +08:00
bunnie
c87ed72736 chore: fix typos 2023-01-31 01:31:15 +08:00
bunnie
2191503f0c fix #304
this adds a "kicker" thread that gets updated with a target time
to kick the UX by the FIDO2 USB handler. When the target time is
met, an "update" command is issued to the UX.

This hopefully creates an efficient mechanism for triggering a
UX redraw that also has an acceptable delay.
2023-01-30 23:14:16 +08:00
bunnie
ea31e50de7 fix typo on feature flag 2023-01-30 23:14:06 +08:00
Sean Cross
32e78f66c5 Merge branch 'main' of github.com:betrusted-io/xous-core 2023-01-30 22:24:08 +08:00
Sean Cross
bf33196b6b Merge branch 'libstd-fixups' of github.com:betrusted-io/xous-core into libstd-fixups 2023-01-30 22:16:11 +08:00
Sean Cross
ba5cde1169 fixup cargo
Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-30 22:15:01 +08:00
Sean Cross
adcca270b2 emulation: ticktimer: fix higher bits of ticktimer
The ticktimer wasn't properly adjusting the upper bits, meaning delays
of more than 42 days did not function properly. This was discovered as
part of the libstd tests.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-30 22:15:01 +08:00
Sean Cross
d645f00d5b emulation: timer0: adapt timer0 to custom precursor
Precursor has a custom TIMER0 module that is different from other LiteX
timers. Adapt the Renode model to match the hardware.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-30 22:15:01 +08:00
Sean Cross
8875d9b4b4 kernel: services: fix corner cases on thread selection
There were a few corner cases when it came to thread selection. Namely,
the same thread had a higher chance of repeatedly being executed.

Clean up these corner cases, and as a result get libstd tests to pass.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-30 22:15:01 +08:00
Sean Cross
af3f89d245 kernel: syscall: add notes for handing mem to user
Add notes on how to properly hand memory to userspace. This does not yet
work, but is committed here as a work-in-progress.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-30 22:15:01 +08:00
Sean Cross
1d6c1e34de kernel: mem: increase default mem size
The default mem size got shrunk down to 4 MB earlier, but there is a
lingering issue that prevents specifying virtual addresses. As a result,
pddb and others don't work.

Temporarily revert this change.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-30 22:15:01 +08:00
Sean Cross
a75d030d77 kernel: main: simplify process search
The process search now uses iterators properly. It's still not ideal
because it needs to investigate every process, but it's better than it
was.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-30 22:15:01 +08:00
Sean Cross
7f7142d948 kernel: riscv: print processes from tid #0
Start numbering threads from index 0. This matches up with what the rest
of the system uses.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-30 22:15:01 +08:00
Sean Cross
8c82736524 kernel: syscall: short-circuit return_scalar irq
When in an IRQ, short-circuit the return logic. This should make
interrupt returns slightly faster.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-30 22:15:01 +08:00
Sean Cross
502223ec9b kernel: syscall: rename context to tid
The word `context` is an older word. We now use "thread" or "tid".

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-30 22:15:01 +08:00
Sean Cross
a24291b462 xous: use asm!() macro for syscalls
Previously we used externally-linked assembly in order to make syscalls.
Now that `asm!()` is stable, use this macro.

This will help to optimize IPC between programs and the kernel.
Additionally, it resolves an unsoundness issue where we were filling in
values on the stack and hoping that Rust didn't reorder the structs.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-30 22:15:01 +08:00
Sean Cross
5185b2ee07 xous-ticktimer: overhaul condvars
The previous condvar implementation was unsound, and didn't do the right
thing. Overhaul condvars so that they now pass the libstd tests.

As part of this, function calls were added to free the mutex and condvar
objects that may have been allocated.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-30 22:15:01 +08:00
Sean Cross
2cb44cdfc2 kernel: services: optimize find_next_thread()
Use a multiply-based algorithm to count the number of leading zeroes.
This results in a function that's just 20 instructions long.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-30 22:15:01 +08:00
Sean Cross
153736810b Revert "renode: remove custom LiteX_Timer_32"
The custom litex timer is more custom than we thought.

This reverts commit 46fab8cbc8.
2023-01-30 22:15:01 +08:00
Sean Cross
a75bc4f54c kernel: minor formatting cleanups
These files have had rustfmt run on them.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-30 22:15:00 +08:00