Commit graph

101 commits

Author SHA1 Message Date
bunnie
d6b33159a5 stage version pin bump 2024-04-01 15:46:26 +08:00
bunnie
315d9b96d4 Merge branch 'main' into dalek_to_v4 2024-02-07 22:52:24 +08:00
bunnie
699004e7b0 bump xous pins 2024-02-06 14:49:10 +08:00
David Kotval
a70832b3ce wip: dumping deps to get curve25519 to 4.1.1 2024-02-04 14:12:36 -06:00
bunnie
0267a56989 format Cargo.tomls
because apparently cargo fmt doesn't format Cargo.toml files???
2024-01-15 00:14:39 +08:00
bunnie
913beaa791 format services/xous-ticktimer 2024-01-14 22:58:20 +08:00
bunnie
fda782663a bump version pins for xous change 2023-12-26 00:13:10 +08:00
bunnie
fa3f349a0a bump pins as xous-rs has changed 2023-12-01 21:20:01 +08:00
bunnie
6ab88117f6 bump xous-api-log version & fix version pins 2023-10-31 20:07:28 +08:00
bunnie
d457f8b555 add assert around sleep_heap() discipline in ticktimer
Every entry into the sleep_heap() should be unique. Any insert()
call that returns a value means we're going to drop a wake-up event.

Add an assert()! that will trigger a panic if this invariant is not
met.
2023-10-10 22:22:30 +08:00
bunnie
bc18c7e629 port changes to cramium platform 2023-10-10 17:21:34 +08:00
bunnie
d63b5912b1 absorb new xous-rs version 2023-10-10 16:50:00 +08:00
bunnie
13e01fd823 corrections and improvements to the current PR
- set slack to 0
- change panic to advisory statement

reasons are commented in the code.
2023-10-10 16:35:53 +08:00
Sean Cross
18f3ac5507 xous-ticktimer: add back in mutex unlocking
Add back in the ability to pre-unlock a Mutex. This is used for slow
path unlocking without needing to wait for a response.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-10-09 19:27:42 +08:00
Sean Cross
c96514d365 xous-ticktimer: rewrite mutex and condvar implementations
This rewrites the Mutex and Condvar backends after gaining a better
understanding of how they're supposed to work.

Additionally, the Ticktimer backend implementation has changed:

* There is now a `recalculate_sleep_offline()` call that skips starting
  and stopping the ticktimer. This is an unsafe function because the
  user must manually manage the ticktimer state. It is used to perform
  multiple operations while the ticktimer is unscheduled.
* Ticktimers now deal in `TimerRequest` types rather than raw `i64`
  types. This is a newtype that is distinct from the previous `i64`, but
  should behave largely the same.
* Waking a Condvar now reports the number of items that were awoken,
  provided the requester sends a blocking scalar value. This allows for
  backwards compatibility.
* Attempting to wake 0 Condvars now wakes all pending Condvars.
* We no longer keep track of lock-then-unlock for Mutexes, nor
  notify-then-wait for Condvars. This makes those cases undefined
  behavior, which puts us in line with Posix. Don't unlock mutexes that
  haven't been locked, or notify Condvar recipients when nobody is
  waiting.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-10-09 17:41:46 +08:00
bunnie
83256257e1 bump xous-rs crate to absorb Send derives on Messages
this is necessary for the smoltcp port
2023-10-03 20:54:14 +08:00
bunnie
478a612c02 commit version bump 2023-09-12 16:25:10 +08:00
bunnie
53469a68d0 publish package updates, sync to release tag 2023-08-08 14:35:49 +08:00
bunnie
b127cd093f bump version pins for change to xous-rs 2023-08-03 13:29:39 +08:00
bunnie
51278451a0 update version pins to pull in cramium target 2023-07-19 21:07:56 +08:00
bunnie
96b2d74e57 add cramium targets to xous-ticktimer 2023-07-17 18:25:30 +08:00
bunnie
6ef684fd8c split reset/init routines apart
this removes the initialized flag and hazard of double-calling
the interrupt hook when you really meant to reset the block.
2023-07-16 22:06:39 +08:00
bunnie
11155df21c note naming convention deviation in xous-ticktimer
all other functions have a .init() routine that handles interrupt
binding.

ticktimer rolls that into a routine that also resets the time
of the ticktimer. A comment is added for maintaner sanity down
the road.
2023-07-16 17:37:46 +08:00
Sean Cross
539ca0cb56 xous-ticktimer: delay installing irq handler
Wait until the outside of `new()` in order to install the irq handler.
This is due to a change in the optimizer for 1.71.0 which has exposed
unsoundness.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-07-16 15:31:09 +08:00
bunnie
4ac979f0ab update pins, again 2023-07-04 11:20:12 +08:00
bunnie
c9f8f2681b update version pins 2023-07-04 11:09:13 +08:00
bunnie
952ba18fba commit vesrion pin bumps 2023-06-16 01:30:18 +08:00
bunnie
fbe3cb2a3d bump package numbers to absorb PR #388 2023-05-28 15:58:11 +08:00
bunnie
5a2df4432c technical debt: cleanup UTRA package
- make the "base" field no longer public. It is accessible, but only
through an `unsafe` method, because, it is unsafe.
- add accessors to offest/mask fields. Because, it's not at all
unsafe to access these, and it can be useful for bit-ops that are
not part of the generic set of UTRA.
- add Arc to AtomicCSR, and require `std` for AtomicCSR types.
This should not break anything, I checked inside @foundation-devices
keyOS and they don't seem to be using AtomicCSR anywhere.

The Arc makes it a bit safer to clone the AtomicCSR base pointer
and share it between threads, but it will have an impact on performance.
The USB stack (which requires AtomicCSR) was regression testing and the
impact seems minimal.

Recall that the main purpose of AtomicCSR is to provide a CSR accessor
that does not require a mutable reference to the base object. This
can make certain Rust idioms a bit cleaner. We wrap the base accessor
in Arc+Atomic to try and improve the safety of throwing the borrow
checker under the bus, but it's still not perfect because hardware
mutable state can have side-effects within hardware itself that cannot
be modeled or checked by Rust's borrow checker.
2023-05-23 18:11:24 +08:00
bunnie
697d44de3d bump version pins to absorb changes to svd2utra etc. 2023-05-03 23:11:12 +08:00
bunnie
8a574f937f bump for xous-rs version pin update 2023-04-27 22:18:30 +08:00
eupn
e80a2072a6
ticktimer: add an extra counter as a base reference for delays 2023-04-21 19:21:25 +04:00
eupn
ab2ea4d313
ticktimer: move some functions into impl modules
It will allow implementations to override these functions when desired.
2023-04-21 19:18:59 +04:00
bunnie
1392fdcf33 bump pins for updated log API 2023-04-16 02:27:37 +08:00
bunnie
849c136b90 bump versions because API crate changed 2023-04-12 23:02:30 +08:00
bunnie
8357ab31a5 bump all pins because utralib got updated 2023-04-09 00:48:35 +08:00
bunnie
9c94d6b4c0 bump versions because xous-rs API changed for gdb-stub 2023-04-08 23:49:24 +08:00
bunnie
e469eba167 bump version for utralib patch 2023-04-04 02:13:02 +08:00
eupn
495f81ef33
xous-ticktimer: fix default log level 2023-03-30 00:28:36 +04:00
eupn
2a52359065
xous-ticktimer: add SAMA5D2 implementation 2023-03-30 00:22:33 +04:00
eupn
1bbf5621fd
xous-ticktimer: split platform impls 2023-03-30 00:21:53 +04:00
bunnie
704aaf98af bump versions for kernel interface changes 2023-03-22 02:48:55 +08:00
bunnie
303f595d6f bump versions to cleanup renode.rs sync issue 2023-03-14 16:34:53 +08:00
bunnie
82e3aa322f bump toml files in prep for publish 2023-03-08 03:54:37 +08:00
bunnie
9256e7cc09 bump versions to absorb xous-names fix 2023-01-31 15:07:32 +08:00
bunnie
84368c3f3a bump versions for publication 2023-01-31 02:18:12 +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