also eliminates references, copying and locking of items in the
sorted btreemap.
turns out that ... sorting is much cheaper than copying or maintaining
references, because copies to heap items require allocs which are
under the hoood several sorts to find the place to stick the alloc
memory, and shared references require locks.
ssid scans can now be in-progress, and they also record
the time elapsed since the last scan was performed.
this allows the network manager to be a bit smarter about when
it decides to kick off a scan.
the ssid scan dialog box is also updated to show
the scan results in progress. This addresses #336.
seems they refactored the way rust workspaces are handled and
deprecated previous keywords and added some other features that
break cargo check.
This overrides all of that and manually configures cargo
check to be harmonized with the hardware target environment.
use the same API call used by `status` as in `shellchat`.
this should also fix the status bar reflecting the correct state.
code fixed but not explicitly tested; if I got this wrong
please re-open!
- 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.
Adds a menu item (defaults to 0 or off) for autosleep timeout in
minutes.
Once the autosleep timeout is hit, the system tries to suspend.
- It will not try to sleep if the system is plugged in.
- It will reset the timer if the power state changes (plug/unplug).
- It will reset the timer every time a key is pressed.
- The timer is reset on suspend, so it does not try to immedaitely re-sleep on wake.
The autosleep handler is domiciled in the "pump" loop which is
responsible for updating the uptime timestamp in the status bar.
It is pinged at a 1 second interval.
Therefore, the sleep timeout has a +/-1 second variability in it,
and also, a quick plug-unplug event (< 1 second) will likely go
unnoticed.
this should fix the issue on #382. The behavior is now:
*device not plugged in*
1. select "Lock device (reboot)"
2. device reboots
3. device goes to sleep
4. user wakes up the device
5. user is challenged with the unlock PIN
*device is plugged in*
1. select "Lock device (reboot)"
2. device reboots
3. user is challenged with the unlock PIN
I think this should be the "least surprising" outcome given
the description of the menu item.
this is some bit-rot that happened to the `ball` demo because
it's currently the only application that uses the framebuffer
canvas.
the trust level of the framebuffer canvas has to be lower than
that of the modals, otherwise a modals box is not allowed to
draw on top of the framebuffer.
in this case, a patch that was applied when trust levels were
refactored was missed on the framebuffer canvas, which caused
the trust level of the canvas to be higher than that of a modals.
Thus, when a modal attempts to pop up over the ball demo,
one just sees the defacement lines but no actal content.
TextEntry boxes can now specify "growable" as an option; if this
is set true, then, the fields within are considered to be multi-line
fields that can grow to fill the screen (even pushing lower ui
elements off the screen...); however a text line is limited to
256 characters so generally the overflow issue is hopefully rare-ish.
Left/right arrow keys conjure up an insertion point to allow for
deleting and inserting text in the middle of a field.
The main quirk is that if you enter text that causes a field to grow in
size, the overall dialog box can't grow any larger, so the text simply
overflows into the UI element above the current line, without limit.
Need to check for interactions with other elements that should
not be affected but it passes some simple test cases in `vault`.
If the "notes" field starts with the characters
"bip39" (case insensitive), then, the password field is
interpreted as a hexadecimal encoding of BIP39 entropy.
To create a BIP-39 entry, leave the password field blank,
and then start the Notes field with the characters 'bip39',
and this will trigger a dialog box that will only allow
valid bip39 entry and check the checksum etc.
To view the BIP-39, after opening up the entry for "edit",
close it, and it will pop up a second dialog box that interprets
the hex data as BIP-39 words.
You could also in theory enter the hex digits yourself into
the password field, if you're masochist.
Instead of always doing bytewise accesses, support 2- and 4-byte access.
Additionally, recognize when multiple 4-byte reads are required.
Note that an additional optimization may be made here in the future to
prevent having to check every address, but this is left for a future
optimization.
Signed-off-by: Sean Cross <sean@xobs.io>
Instead of remapping the page to allow the kernel to access a process'
memory, simply set the SUM bit. This makes it no longer an error for the
kernel to access userspace.
Keep setting the `W` bit when we poke, to allow for updating program
memory with breakpoints.
Signed-off-by: Sean Cross <sean@xobs.io>