Commit graph

10340 commits

Author SHA1 Message Date
bunnie
d581bd4a33 port apps/repl to xous-ipc 0.10 2024-09-23 14:25:05 +08:00
bunnie
f4a4dfbc53 reflect flatipc usage in lockfile 2024-09-23 14:19:35 +08:00
bunnie
e5bd1cffb9 port apps/vault to use xous-ipc 0.10 2024-09-23 14:19:13 +08:00
bunnie
cdc841124d fix a xous-ipc change but now conflated with reformatting 2024-09-23 14:18:45 +08:00
bunnie
ec43c4622c print the debug info for trng pump 2024-09-23 14:18:16 +08:00
bunnie
9ebb61c68c update test on cram side too 2024-09-23 14:17:56 +08:00
bunnie
e9ab865e09 port trng server to use flatipc 2024-09-23 14:17:31 +08:00
bunnie
489c614ec6 port getrandom to use flatipc 2024-09-23 14:17:10 +08:00
bunnie
cbe9aa05be redo lib api to use flatipc; has a question for xobs 2024-09-23 13:38:38 +08:00
bunnie
838bd58024 commit bumped version pins 2024-09-23 01:53:18 +08:00
bunnie
d39ca54684 lose the local patches 2024-09-23 01:47:55 +08:00
bunnie
e01326c8ee update verifier pins 2024-09-23 01:47:26 +08:00
bunnie
75954de8d6 commit the version bump 2024-09-23 01:46:25 +08:00
bunnie
bb7209508b update formatting on the published crates
not doing a reformat of the entire project to match
nightly formatting changes, but capturing the published
crates so we can maybe save a version bump later on to get
the project clean.
2024-09-23 01:43:02 +08:00
bunnie
7d69e16c39
Merge branch 'main' into rkyv-0.8-migration 2024-09-23 01:36:33 +08:00
bunnie
222f86d709
Merge pull request #579 from betrusted-io/rustfmt
Rustfmt to 2024 version
2024-09-23 01:35:46 +08:00
bunnie
e290615a80 bump lockfile while we're at it 2024-09-23 01:34:29 +08:00
bunnie
e51ad1ae73 2024 style is the least disruptive to the code base... 2024-09-23 01:34:12 +08:00
bunnie
888cd2252e
Merge branch 'main' into rkyv-0.8-migration 2024-09-23 01:23:12 +08:00
bunnie
d422bc3dc0
Merge pull request #578 from betrusted-io/rustfmt
change rustfmt to track changes in nightly
2024-09-23 01:22:54 +08:00
bunnie
80f0118ead change rustfmt to track changes in nightly
this latest change to nightly looks like it's going to wreak
havoc on the code base :(

i wish they would stabilize more formatting options, ugh.
2024-09-23 01:20:07 +08:00
bunnie
a3933a7465 formatting to new rust nightly and remove debug print 2024-09-23 01:17:45 +08:00
bunnie
2f8604299c remove test for deprecated rkyv 2024-09-23 01:17:17 +08:00
bunnie
5973e48bf4 missed a case that is in hosted mode 2024-09-23 01:16:59 +08:00
bunnie
44b9041d0d attempt to update rkyv use in TLS library
@nworbnhoj would love it if you could have a look at
the implementation and let me know if I've ported this correctly.

I think what was going on is you were using rkyv to serialize
a structure to the PDDB. I've just updated the ser/de to use
the latest `alloc` API (which is much simpler than the API used
in xous-ipc because it is no-alloc).

I'll try and run some tests that involve the TLS crate too down
the road under the theory that it would suss out any porting
errors.
2024-09-23 01:14:41 +08:00
bunnie
89bc7c1b68 update rustfmt to latest standard 2024-09-23 01:14:07 +08:00
bunnie
65e3a0386b update pin for xous-ipc verifier 2024-09-23 00:42:14 +08:00
bunnie
d78cbffec7 update some of the references to published packages 2024-09-23 00:36:27 +08:00
bunnie
840964d33b track xous-tt-backend release bump 2024-09-23 00:33:03 +08:00
bunnie
ada196dc5f clarify some variable names 2024-09-23 00:27:28 +08:00
bunnie
4c7c9312c1 change xous-ipc api to 0.10.0 2024-09-23 00:24:48 +08:00
bunnie
3ce9ae86ab
Merge pull request #576 from betrusted-io/xobs/add-flatipc
libs: add flatipc implementation
2024-09-23 00:22:14 +08:00
bunnie
5cad1a3bcf more xous_ipc cleanup 2024-09-23 00:03:49 +08:00
bunnie
3c0140bf2d final cleanup on shellchat xous-ipc abstractions
the implementation relied on a quirk of xous-ipc where the message
ID is 0 for string send/receives. This cleans it up so that the API
is transparent and consistent with other API calls in the system.
2024-09-23 00:01:32 +08:00
bunnie
8424d19ea9 fixup API to not rely on copy, instead use borrow
also some more regex fixup
2024-09-23 00:00:41 +08:00
bunnie
ef718853b2 cleanup borrow issues in com 2024-09-22 23:59:52 +08:00
bunnie
1bd8be2393 cleanup replace, and make into_inner/from_inner methods
the into/from inner methods are useful for using the Buffer
abstraction as a way to invoke rkyv on a structure to serialize
it and then manipulate the serialized data directly
2024-09-22 23:58:11 +08:00
bunnie
95a31a369c fix Copy derive and related issues in net 2024-09-22 21:55:20 +08:00
bunnie
e423bfd347 fix lines that missed the regex in DNS 2024-09-22 21:54:58 +08:00
bunnie
15aaf55e93 fix borrow for argument parsing 2024-09-22 21:54:24 +08:00
Sean Cross
3eb54d2cc9 flatipc: add more checks to vec and string
These are required as this goes across the IPC boundary.

Signed-off-by: Sean Cross <sean@xobs.io>
2024-09-22 19:26:48 +08:00
Sean Cross
0c5b011fcf flatipc-derive: remove outdated header
Signed-off-by: Sean Cross <sean@xobs.io>
2024-09-22 18:51:40 +08:00
bunnie
4eb504bb43 more typecast cleanup 2024-09-22 18:51:06 +08:00
bunnie
839923967c git rid of a .clone() that crept in, now fixed by prior commit 2024-09-22 18:50:38 +08:00
Sean Cross
c8d70aae6a flatipc: run cargo +nightly fmt -p flatipc
Signed-off-by: Sean Cross <sean@xobs.io>
2024-09-22 18:49:56 +08:00
bunnie
7141a02e10 ah yes. This was the kind of xous-ipc abuse I was worried I would have done.
And I did it! and it's now fixed.

I was using xous-ipc String to make a fixed-length string in a
structure that's not strictly an IPC structure.

The solution to this is to just implement a fixed length string
directly.
2024-09-22 18:49:26 +08:00
bunnie
6e4eec99a3 more cleanup on usb crate 2024-09-22 18:48:55 +08:00
Sean Cross
a77fdac6f0 libs: add flatipc implementation
flatipc is a new method for doing IPC. This is a zero-copy approach
where structs are given `repr(C)` implementations that are well-defined
and work across process boundaries.

If the same struct or enum is used in two processes that has the same
layout, then data can be freely passed between the two processes without
incurring a serialization or deserialization penalty, provided the
following hold:

1. The buffer must be page-aligned and be a multiple of the page size
2. The item must be `#[repr(C)]`
3. There must be no pointers or references of any kind

If these three things hold, then the object is safe to sling across the
process boundary.

This crate adds the ability to annotate structs with
`#[derive(flatipc::Ipc)]` to provide them with this functionality. When
doing so, objects gain the `.into_ipc()` call that turns them into
something that can be sent across process boundaries.

The resulting object has `.lend()`, `.lend_mut()`, `.try_lend()`, and
`.try_lend_mut()` as functions.

Signed-off-by: Sean Cross <sean@xobs.io>
2024-09-22 18:32:58 +08:00
bunnie
1b5eacdb68 manually cleanup a flat accessor in USB crate 2024-09-22 15:49:39 +08:00
bunnie
be227adde1 removed sized strings from pddb interchange structures
I think this is safe to do because no strings can be directly
serialized into the PDDB's structures. The place to check for
this is inside the backend/ directory. For example, `DictName`
is where the name field is serialized into a structure that
goes onto the disk. It's explicitly length-checked.

What this means is that we could have calls into the pddb crate
with invalid length strings, however, if you check the lib
implementation, all of the APIs also pre-flight the length of
arguments to ensure they fit into the destination string.

So mostly what we're losing is the constraints on the intermediate
IPC representation, but the length is still checked on either side.
2024-09-22 15:44:05 +08:00