these are just sync'd to the asm.S and checked in.
Eventually, we should migrate that .S file into using
in-line assembly macros, but now that I look at it, I remember
why it hasn't been done yet -- there are some fancy conditionals
used to enable compatibility with different architectures that
I don't know off the top of my head how to translate into
in-line assembly syntax.
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 "_zicsr_zifencei" to "rv32imac" when describing the CPU core. This
is required by newer versions of the spec, and will eventually be a
requirement of Renode.
Signed-off-by: Sean Cross <sean@xobs.io>
The riscv foundation changed the descriptor of riscv cores. We must now
add "_zicsr_zifencei" to the "rv32i" designation in order to ensure we
have access to CSRs and the "FENCE.I" instruction.
Signed-off-by: Sean Cross <sean@xobs.io>
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>
When enumerating processes, the `find_process()` process didn't consult
whether a process was actually free. This resulted in a crash,
particularly when attaching a debugger to a crashed process.
Signed-off-by: Sean Cross <sean@xobs.io>
This command ensures memory is all owned by the correct process and is
unique in its ownership.
It takes a long time to run, so ensure the watchdog timer is disabled.
Signed-off-by: Sean Cross <sean@xobs.io>
Add a function to ensure mappings are unique across the whole system.
This takes a very long time and can crash if the watchdog timer isn't
paused.
Signed-off-by: Sean Cross <sean@xobs.io>
The phys_to_virt function can be used to determine what physical address
page is mapped to a virtual address page.
This throws an error when a page is mapped twice, which shouldn't
happen.
Signed-off-by: Sean Cross <sean@xobs.io>
The kernel stack offset should be aligned to 16 bytes. Previously it was
aligned to 8 bytes. It's unclear if this was the cause of any issues,
but it is best practice to keep things aligned to 16 bytes.
As part of this, key the atomic instructions off of the CPP macro
presence of atomic instructions.
Signed-off-by: Sean Cross <sean@xobs.io>
Regenerate the font files after adjusting the template to generate files
that will not get changed by rustfmt.
Signed-off-by: Sean Cross <sean@xobs.io>
Generate code that can be put through rustfmt without being altered.
This removes an issue where the font tables can be rearraged by simply
running `rustfmt` on the repository.
Signed-off-by: Sean Cross <sean@xobs.io>
Fix memory zeroing when requesting a physical pointer. Previously, only
the first 25% of a page was zeroed due to a bug when casting between
*mut u8 and *mut usize.
This now uses `write_volatile` to ensure the memory clear isn't
optimized out, and uses `usize` pointers everywhere.
Signed-off-by: Sean Cross <sean@xobs.io>
The register set should be cleared already, however it is possible
(though remote) that register values are not cleared when a thread is
created.
Ordinarily threads are zeroed when destroyed, but this makes sure
they're zeroed upon creation as well.
Signed-off-by: Sean Cross <sean@xobs.io>
The `codec` seems to hang sometimes during `Setup8kStereo` at boot.
Did not get to the bottom of it, but suspect that the RTC I2C init
sequence is interfering with the codec init sequence. This might
be resolved while also fixing #467, but for now, a short delay
on boot works around the problem.