Commit graph

2517 commits

Author SHA1 Message Date
bunnie
6b0257b5d5 make the fence operation stronger on susres 2023-01-31 16:05:28 +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
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
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
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
b18230def4 move pddb dependencies to a feature flag for testing purposes 2023-01-31 02:34:12 +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
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
c87ed72736 chore: fix typos 2023-01-31 01:31:15 +08:00
bunnie
ea31e50de7 fix typo on feature flag 2023-01-30 23:14:06 +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
841059e885 ticktimer: implement freemutex/freecondition
With these two API Calls, the ticktimer server will no longer grow
without bounds.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-30 22:15:00 +08:00
Sean Cross
17195f082f ticktimer: improve condvar handling
Improve condvar so that it is more reliable.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-30 22:15:00 +08:00
Sean Cross
511f77f897 ticktimer: only allow RecalculateSleep from ourselves
Rewrite the RecalculateSleep opcode handler so that it will only be
processed if sent by our own process.

As part of this rewrite, use the new `let else` pattern.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-30 22:15:00 +08:00
Sean Cross
3b7b49b4da ticktimer: use sleep_heap.pop_first()
This function was stabilized in Rust 1.66.0.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-30 22:15:00 +08:00
Sean Cross
c541c1b000 xous-ticktimer: don't panic in an interrupt
If we are unable to send a message in an interrupt, simply ignore it.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-30 22:15:00 +08:00
bunnie
a455f0ae1d add the evicted record and remove a debug line i forgot to trim 2023-01-30 22:15:00 +08:00
bunnie
1a60fe4aad fix bugs in key invalidation/eviction logic
1. track evictions as separate from cleanliness. not clean means
the data is dirty and needs writing back. eviction simply means
the data needs be re-retrieved from disk.

2. actually fill the data when we do a sync -- previously
we only copied the old data into the new page but then forgot
to allocate the data and assign it to the cache (oops)

3. sync the small pools after doing a remove inside the update()
command to make sure we've met invariants for future calls
to cache fills

so many corner cases, i'm going around in circles....
2023-01-30 22:15:00 +08:00
bunnie
5d926294be only invalidate the key entry if it is within the current range of interest
previously, we were invalidating at the first instance of
encountering the key; instead we should only invalidate once
we've processed it in our range of interest.
2023-01-30 22:15:00 +08:00
bunnie
1e9bfc00ba increase threshold for GC on PDDB
for some reason it's being called a bit earlier than i expected.
2023-01-30 22:15:00 +08:00
bunnie
4013ed0098 add api call to increase PDDB debug level at runtime 2023-01-30 22:15:00 +08:00
bunnie
6933150f63 add another test case to deltest
simulates a very typical pattern of remove an element
then populate it
2023-01-30 22:15:00 +08:00
bunnie
93477d38ba fix another edge case in key deletion
invalidated keys that were not dirty were not being removed
also added routine to fill keys that are evicted from the cache
during the update routine
2023-01-30 22:15:00 +08:00
bunnie
e8ab911c33 add some consistency check and repair facility to PDDB 2023-01-30 22:14:59 +08:00
bunnie
2a0135c781 add bulk deletion of keys from a single dictionary 2023-01-30 22:14:59 +08:00
bunnie
ab90b0044e fix bug where old key data was not being zeroized on delete
on valid pages were being updated in a dictionary entry as
it is updated; actually, entries that are invalid should also
be zeroized, otheriwse they "Stick around" as valid entries.
2023-01-30 22:14:59 +08:00
bunnie
9903aacbad add fscb sync and pruning to the delete test bench 2023-01-30 22:14:59 +08:00
bunnie
d70eeb2453 fix bug in small pool re-packing after delete
the new offset address was being used for copying data, instead
of the old offset, which was causing key data to refer to
an incorrect entry after deletion
2023-01-30 22:14:59 +08:00
bunnie
bce6fb2836 improve debug output on PDDB 2023-01-30 22:14:59 +08:00
bunnie
624705d169 add timeout variant for USB Rx -- note: not tested!
turns out we didn't need this variant for things to work
with the new OpenSK stack.
2023-01-30 22:14:59 +08:00
bunnie
bc3aac677f fix zero-length key readback error in bulk reads
zero-length keys return a data section of None, instead
of Some(<empty vec>), as the latter representation deserializes
to a null pointer panic.
2023-01-30 22:14:59 +08:00
bunnie
5c454d4382 chore: fix typos 2023-01-30 22:14:58 +08:00
bunnie
e8acb62d6d fix missing corner case in cache refill 2023-01-30 22:14:58 +08:00
bunnie
82a7d0c40f fix some more edge cases in PDDB key deletion 2023-01-30 22:14:58 +08:00
bunnie
8350095d36 fix initialization order so that CI can run 2023-01-30 22:14:58 +08:00
bunnie
2ef7dfd488 add test case for pddb delete keys 2023-01-30 22:14:58 +08:00
bunnie
408cc69ad9 note that lock device also has a reboot aspect to it in the menu 2023-01-30 22:14:58 +08:00
bunnie
f2dcea0834 add a missing sync after key deletion 2023-01-30 22:14:58 +08:00
bunnie
dafec3c2eb chore: fix another typo 2023-01-30 22:14:58 +08:00
Patryk Laurent
afd1570bbc type chars rather than bytes 2023-01-30 22:14:57 +08:00
Patryk Laurent
9ad45b6f2c add pddb edit (types pddb write <k> <v>) 2023-01-30 22:14:57 +08:00
bunnie
8e440609c2 add an extra test for checking if time server blocks on PDDB mount
gated with a feature so it doesn't bloat the shipping code base
2023-01-30 19:01:13 +08:00
bunnie
7cd2512e95 turn down some debug spew 2023-01-30 18:32:06 +08:00
bunnie
2b6e0d2b89 fix return code bug on bulk deletion 2023-01-29 17:32:41 +08:00
bunnie
004599543a add the evicted record and remove a debug line i forgot to trim 2023-01-29 04:26:08 +08:00