Commit graph

262 commits

Author SHA1 Message Date
bunnie
5280d232e5 figuring out which way is up on the RootKeys implementation 2021-07-21 19:47:09 +08:00
bunnie
01d3455a16 Merge branch 'main' into bunnie-dev 2021-07-18 12:33:16 +08:00
bunnie
8cb4362824 trying to merge...what are all these changes? 2021-07-18 12:31:29 +08:00
bunnie
91fe69ca27 add some real-hardware tests for spinor writes
definitely still bugs.

need to sleep on it.
2021-07-18 02:36:31 +08:00
bunnie
cc0f37a80e rewrite the spinor services
- you can only "patch" regions of memory. caller provides a slice
to the region of data they are patching, so that patches can be
computed by the lib-side code of the server.

- erasing is done with a "patch" with all 0xff's as the write data.
a sequence of pure 0xff for a page does not actually cause a write,
the condition is detected and the write is skipped after an erase.

- patches attempt to be somewhat intelligent and not re-write unchnaged
data, or erase blocks that don't need udpating. However, if a user
submits a "sparse patch" with just a couple bytes modified in a
megabyte region they can expect bad performance. Ideally, in that
scenario, each of the smaller modifications are submitted as
individual calls to the patch function, instead of regurgitating
all the data and hoping that hthe patch function does some intelligent
diffing to be as light-fingered as possible about updating the flash.

In other words, the onus is on the calling server to format
patches intelligently. The patch server does only the simplest,
safest optimizations. You don't want to be shuttling megabytes of
redundant data anyways between servers for many other reasons....!
2021-07-17 02:04:22 +08:00
bunnie
7e7ae82156 pivot spinor implementation
realizing some core assumptions were wrong, so, scrapping and
restarting
2021-07-15 23:00:50 +08:00
Sean Cross
7b7be0fe9e hosted: fix MemoryRange refactor
This fixes the MemoryRange refactor where `.addr` and `.size` are now
private fields.

Previously it had only been tested on baremetal mode.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-24 18:02:28 +08:00
Sean Cross
a99839ecd6 xous: mark MemoryRange fields as private
Mark the private fields in a `MemoryRange` struct as being private. This
allows us to perform operations on the memory range armed with the
knowledge that the entire range is valid and unaliased.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-24 17:41:16 +08:00
Sean Cross
023918082b xous: add as_slice() and as_mut_slice() to MemoryRange
Add functions to obtain various slices from a `MemoryRange`. These
functions are safe because we know that the memory in the range is
valid, and we know the size of the type.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-24 17:02:47 +08:00
Sean Cross
977a175bb5 xous: mark MemoryRange::new() as unsafe
This function allows for creating arbitrary memory ranges. Mark this
function as `unsafe` in order to warn users that this can be used to
create invalid memory regions.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-24 17:02:02 +08:00
Sean Cross
80860f0a51 Merge remote-tracking branch 'origin/main' into debugger 2021-06-21 13:22:51 +08:00
Sean Cross
13204d1714 Merge branch 'master' into debugger
Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-18 10:56:30 +08:00
bunnie
799bae0386 Merge remote-tracking branch 'origin/master' into ux-refactor 2021-06-16 18:38:50 +08:00
Sean Cross
00e9ead818 xous: definitions: dispose of Vec on hosted
When running on Hosted mode, reconstitute the Vec and dispose of it
rather than freeing the memory by passing it back to the kernel.

This is because the data was previously allocated by way of a vec, and
only a reconstituted vec knows how to properly dispose of the data.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-16 18:35:18 +08:00
Sean Cross
486d993c4c xous: hosted: don't over-allocate memory messages
Call `shrink_to_fit()` on the array that contains memory messages. This
is beacuse we throw away the `capacity` field, and we want to make sure
we can reconstitute the vector at a later stage.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-16 18:35:17 +08:00
Sean Cross
62623f995c Merge branch 'master' of github.com:betrusted-io/xous-core 2021-06-16 16:54:06 +08:00
bunnie
5301f4af20 major refactor of the Ux -- can create, redirect I/O contexts
getting ready for Precursor to do more than just one thing.
2021-06-16 04:50:26 +08:00
Sean Cross
651844ba20 Merge remote-tracking branch 'origin/master' into debugger 2021-06-06 19:21:18 +08:00
bunnie
bbfe0fb605 Merge remote-tracking branch 'betrusted/aes' into bunnie-dev 2021-06-02 14:49:11 +08:00
bunnie
fadc9c29ab Merge remote-tracking branch 'origin/master' into bunnie-dev 2021-06-02 03:59:25 +08:00
Sean Cross
b22ec0369e xous: asm: add aes calls for vexriscv
VexRiscv has accelerated AES instructions. This adds ASM hooks for these
instructions so they can be called from Rust.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-01 19:52:37 +08:00
Sean Cross
bbda4365ae wip commit
Signed-off-by: Sean Cross <sean@xobs.io>
2021-06-01 17:57:01 +08:00
bunnie
7c55925926 intermediate check-in on wfi 2021-05-30 23:07:16 +08:00
bunnie
7529628053 partial progress on EC updater 2021-05-24 04:34:50 +08:00
Sean Cross
a83cf9fe48 xous: document some more functions
Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-21 16:40:33 +08:00
Sean Cross
ca53abbd25 xous: wire up wait_thread for baremetal
Now that we have a `JoinThread`, connect the `wait_thread` syscall.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-21 16:37:19 +08:00
Sean Cross
091a655a0a xous: document disconnect
Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-21 16:32:27 +08:00
Sean Cross
6b70922381 xous: add JoinThread syscall
The `JoinThread` call will eventually be used to let one thread wait on
another.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-21 13:01:03 +08:00
Sean Cross
eb7895d601 xous: add a return code to TerminateProcess
As part of this refactor, make `terminate_process()` a divergent call.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-20 11:01:00 +08:00
Sean Cross
c516919479 xous: run cargo fmt
Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-19 14:20:47 +08:00
Sean Cross
a1b16a74cb xous: definitions: add default constructors for Message
Enable creating new_lend() and new_scalar() messages.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-19 14:14:21 +08:00
Sean Cross
7fe10b6463 xous: stringbuffer: fix build in libstd
When building as part of libstd, we need to manually specify flags.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-19 14:13:38 +08:00
Sean Cross
04055c1bf5 xous: add StringBuffer
This is a simple lendable StringBuffer variant of String that is
suitable for sending across process boundaries.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-12 21:22:15 +08:00
Sean Cross
b74396cfe7 syscall: add return_memory_offset_valid()
This sets the `valid` field in addition to the `offset` field when
returning a MemoryMessage.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-12 21:22:15 +08:00
Sean Cross
32d740aa15 xous: run cargo fmt on definitions
Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-12 21:22:15 +08:00
Sean Cross
0962453812 xous: definitions: make SID a [u32; 4]
This has a well-defined C representation, and is more portable than the
tuple format.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-10 14:37:33 +08:00
bunnie
fe86207469 make docs reflect the error message actually thrown 2021-05-06 00:41:38 +08:00
bunnie
e7e7711f2d remove unused buffer package 2021-05-05 01:37:03 +08:00
bunnie
cad9c15849 intermediate save of suspend resume
building an awful rube-goldberg contraption of a "clean-suspend"
record.
2021-04-28 19:28:04 +08:00
bunnie
ac40075140 add keyboard input via UART 2021-04-16 04:11:25 +08:00
bunnie
06f7f6ff7f add a define for the maximum CID 2021-04-14 03:20:30 +08:00
bunnie
01a0fcc73f Merge branch 'master' of github.com:betrusted-io/xous-core into bunnie-dev 2021-04-07 18:30:13 +08:00
bunnie
0f9eea10d9 flesh out callback handling of events in LLIO 2021-04-07 18:29:50 +08:00
Sean Cross
c497cd4864 Revert "remove legacy buffer/string from xous-rs"
This reverts commit 628be639f6.

This file is still in use by at least one project, and will be used by
the libstd implementation.
2021-04-07 16:30:08 +08:00
bunnie
628be639f6 remove legacy buffer/string from xous-rs 2021-04-07 00:50:11 +08:00
bunnie
35353f38dd bring benchmarks to v0.8 and record benchmark results 2021-04-07 00:45:11 +08:00
bunnie
ea43e236ee refactor fcc-agent for v0.8 2021-04-06 23:09:33 +08:00
bunnie
b9162fda3d gettin' there! major modules now mostly working under v0.8 2021-04-06 19:32:35 +08:00
bunnie
9ba2fb134c refactor most major modules, but Xous now crashes 2021-04-05 23:50:00 +08:00
Sean Cross
03bed02393 xous: make terminate_process divergent
This allows for terminating a process when something goes wrong.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-04-05 18:19:33 +08:00