sparc: boot mmu support

Get enough of the mmu working to be able to allocate memory.

Unlike on PowerPC, we get both address and size as 64bit values. So
adjust of_region to allow this.

Also unlike the PPC port, we do not drive the hardware directly, instead we
rely on the openboot primitives to manage the translation table. This
allows staying independant of the hardware, which is a good idea at
least for the bootloader (we can do actual hardware things in the
kernel)

Change-Id: Ifa57619d3a09b8f707e1f8640d8b4f71bb717e2a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1482
Reviewed-by: Alex von Gluck IV <[email protected]>
This commit is contained in:
PulkoMandy
2020-01-18 03:32:29 +00:00
committed by waddlesplash
parent 011b188df0
commit 56f9c76088
9 changed files with 440 additions and 79 deletions
@@ -12,4 +12,19 @@
#include <arch_cpu.h>
struct TsbEntry {
public:
bool IsValid();
void SetTo(int64_t tag, void* physicalAddress, uint64 mode);
public:
uint64_t fTag;
uint64_t fData;
};
extern void sparc_get_instruction_tsb(TsbEntry **_pageTable, size_t *_size);
extern void sparc_get_data_tsb(TsbEntry **_pageTable, size_t *_size);
#endif /* _KERNEL_ARCH_SPARC_MMU_H */
@@ -17,10 +17,10 @@
extern intptr_t gChosen;
template<typename AddressType>
template<typename AddressType, typename SizeType>
struct of_region {
AddressType base;
uint32 size;
SizeType size;
} _PACKED;
struct of_arguments {