This ensures that the physical and virtual addresses for OpenBIOS itself are marked as in use, and also appear in the translations property so they can be maintained by client programs.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk --- openbios-devel/arch/sparc32/ofmem_sparc32.c | 6 ++++-- openbios-devel/include/arch/sparc32/ofmem_sparc32.h | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/openbios-devel/arch/sparc32/ofmem_sparc32.c b/openbios-devel/arch/sparc32/ofmem_sparc32.c index e2f4159..a6557df 100644 --- a/openbios-devel/arch/sparc32/ofmem_sparc32.c +++ b/openbios-devel/arch/sparc32/ofmem_sparc32.c @@ -241,6 +241,8 @@ void ofmem_init( void ) /* Claim reserved physical addresses at top of RAM */ ofmem_claim_phys(ofmem_arch_get_phys_top(), s_ofmem_data.ofmem.ramsize - ofmem_arch_get_phys_top(), 0); - /* Claim OpenBIOS reserved space */ - ofmem_claim_virt(0xffd00000, 0x300000, 0); + /* Map OpenBIOS ROM in RAM copy */ + ofmem_claim_phys(va2pa(OF_CODE_START), s_ofmem_data.ofmem.ramsize - va2pa(OF_CODE_START), 0); + ofmem_claim_virt(OF_CODE_START, (ucell)-1, 0); + ofmem_map_page_range(va2pa(OF_CODE_START), OF_CODE_START, s_ofmem_data.ofmem.ramsize - va2pa(OF_CODE_START), ofmem_arch_default_translation_mode(OF_CODE_START)); } diff --git a/openbios-devel/include/arch/sparc32/ofmem_sparc32.h b/openbios-devel/include/arch/sparc32/ofmem_sparc32.h index 7a35b44..6ffa172 100644 --- a/openbios-devel/include/arch/sparc32/ofmem_sparc32.h +++ b/openbios-devel/include/arch/sparc32/ofmem_sparc32.h @@ -16,6 +16,8 @@
#include "libopenbios/ofmem.h"
+#define OF_CODE_START 0xffd00000 + struct mem; extern struct mem cdvmem;
@@ -25,4 +27,4 @@ extern unsigned long find_pte(unsigned long va, int alloc); void mem_init(struct mem *t, char *begin, char *limit); void *mem_alloc(struct mem *t, int size, int align);
-#endif /* _H_OFMEM_SPARC32 */ \ No newline at end of file +#endif /* _H_OFMEM_SPARC32 */