a lot of re-import warnings have cropped up. While I appreciate
their studiousness on this, the problem is that removing some
of these exports in the API crate could mean that future users
who want access to some API features that aren't used in this
configuration are now unaccessible.
I think it's not a huge problem at the moment, just spam-cleaning
the warnings because there are too many to deal with carefully
at the moment.
Add the pid as the page owner to `map_page()` calls. This ensures pages
are owned by their respective processes, and removes a lot of
`change_owner()` calls that immediately follow page mapping.
It also allows for superpages to be owned by their respective processes.
Signed-off-by: Sean Cross <sean@xobs.io>
The "susres" page should be owned by the "susres" server and not the
kernel. Avoid mapping this page to the kernel to prevent it from getting
double-mapped.
Signed-off-by: Sean Cross <sean@xobs.io>
this might want to get a more graceful feature option wrapped
around it but i'm hoping the unpleasantness of developing on
the FPGA board is...temporary??
- 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.
When a block of data perfectly fits we fail to allocate the
next page, violating the loop invariant that there's data available
to write.
However, we can't always allocate a new page when we run out
because if we're at the end of the process we shouldn't allocate
a new page (I think). Thus we track if the last section was
a perfect fit, and if it was, we force a new page allocation
before copying more data.
This is an edit in phase 1 of the loader.
in practice this has not been a useful indicator, and we
have stabilized the SVD format so that changes in the code don't
cause the SVD files to go incompatible anymore.
this should make maintenance a bit easier going forward, hopefully.
also merge in cramium support to harmonize the forks for easier
cross-patches in the future.
The kernel stack previously was located at the same relative offset as
all other programs. While this worked, it is poor form.
Move the kernel stack into the kernel memory region (located in the last
4 megabytes of virtual address).
Signed-off-by: Sean Cross <sean@xobs.io>
the precursor platform test is a RAM stress test. This patch
improves the test slightly by making it more parameterizeable,
and having it run a bit longer.