This patch refactors big chunks of the memory subsystem code.
Most of all, it does away with the the design being based around the raw pointer
type "*const Page". While raw pointers to an actual page seemed like a
compelling idea, in practice it turned out difficult. Rust feels a bit
inconsistent with respect to raw pointers. While it is safe to create them out
of nowhere (only dereferencing is unsafe), it gets weird when multi-threading
comes into picture.
For example, wrapping them into synchronization primitives caused issues because
they don't implement Send. For this reason, we switch to the PageAddress type
which is based on usize, which makes things a lot easier.
Other changes/benefits include:
- Gets rid of unsafe code in the removed PageSlice type.
- Decouple the translation table code and MMIO VA allocation.
- For the translation table tool, make better use of what the ELF format already
provides with respect to memory segmentation and translation. For example, the
tool now queries the ELF file for VA->PA translations and other segment
attributes. This has also the added benefit of reduced BSP code and more
generic code in the tool.
- Packs rbelftools in the Docker image now (used by translation table tool).
- In tutorials 14/15/16, rearrange the PA and VA layout.
The GCC versions of `objdump` and `nm` seem to have better out-of-the-box
support (for AArch64). Demangling works better, and instructions in objdump are
presented as 4 bytes instead of 4 * 1 bytes, which helps a lot.
Hence, switch to the GCC versions for now until LLVM has caught up.
20.04 comes with Ruby 2.7, which emits some annoying deprecation warnigs that
can't be silenced even when using the RUBYOPT variables suggested for doing so.
Work around that for now by reverting to Ubuntu 19.10 which still uses 2.5 and
does not have this bug.
This will require any non-standard use of this container to also
specify the rpi3.cfg path when invoking.
For example:
`docker run ... -f /openocd/tcl/interface/jlink.cfg -f /openocd/rpi3.cfg`
to work with JLink interface.