Since the previous commit, the value of ofmem_arch_get_phys_top() is now the same across all architectures. Hence we can now remove this and just use the physical memory size directly.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk --- openbios-devel/arch/ppc/qemu/ofmem.c | 7 ------- openbios-devel/arch/sparc32/ofmem_sparc32.c | 7 ------- openbios-devel/arch/sparc64/ofmem_sparc64.c | 7 ------- openbios-devel/include/libopenbios/ofmem.h | 1 - openbios-devel/libopenbios/ofmem_common.c | 6 +++--- 5 files changed, 3 insertions(+), 25 deletions(-)
diff --git a/openbios-devel/arch/ppc/qemu/ofmem.c b/openbios-devel/arch/ppc/qemu/ofmem.c index e03beaa..6f346a3 100644 --- a/openbios-devel/arch/ppc/qemu/ofmem.c +++ b/openbios-devel/arch/ppc/qemu/ofmem.c @@ -117,13 +117,6 @@ ucell ofmem_arch_get_virt_top(void) return IO_BASE; }
-phys_addr_t ofmem_arch_get_phys_top(void) -{ - ofmem_t *ofmem = ofmem_arch_get_private(); - - return ofmem->ramsize; -} - void ofmem_arch_unmap_pages(ucell virt, ucell size) { /* kill page mappings in provided range */ diff --git a/openbios-devel/arch/sparc32/ofmem_sparc32.c b/openbios-devel/arch/sparc32/ofmem_sparc32.c index bc3efaf..1003c01 100644 --- a/openbios-devel/arch/sparc32/ofmem_sparc32.c +++ b/openbios-devel/arch/sparc32/ofmem_sparc32.c @@ -66,13 +66,6 @@ ucell ofmem_arch_get_virt_top(void) return (ucell)OFMEM_VIRT_TOP; }
-phys_addr_t ofmem_arch_get_phys_top(void) -{ - ofmem_t *ofmem = ofmem_arch_get_private(); - - return (uintptr_t)ofmem->ramsize - 0x1000000; -} - ucell ofmem_arch_get_iomem_base(void) { return pointer2cell(&_end); diff --git a/openbios-devel/arch/sparc64/ofmem_sparc64.c b/openbios-devel/arch/sparc64/ofmem_sparc64.c index 6e1bb05..bdfaf56 100644 --- a/openbios-devel/arch/sparc64/ofmem_sparc64.c +++ b/openbios-devel/arch/sparc64/ofmem_sparc64.c @@ -65,13 +65,6 @@ ucell ofmem_arch_get_virt_top(void) return (ucell)TOP_OF_RAM; }
-phys_addr_t ofmem_arch_get_phys_top(void) -{ - ofmem_t *ofmem = ofmem_arch_get_private(); - - return ofmem->ramsize; -} - ucell ofmem_arch_get_iomem_base(void) { /* Currently unused */ diff --git a/openbios-devel/include/libopenbios/ofmem.h b/openbios-devel/include/libopenbios/ofmem.h index f2445e7..0b19db1 100644 --- a/openbios-devel/include/libopenbios/ofmem.h +++ b/openbios-devel/include/libopenbios/ofmem.h @@ -63,7 +63,6 @@ extern ofmem_t* ofmem_arch_get_private(void); extern void* ofmem_arch_get_malloc_base(void); extern ucell ofmem_arch_get_heap_top(void); extern ucell ofmem_arch_get_virt_top(void); -extern phys_addr_t ofmem_arch_get_phys_top(void); extern ucell ofmem_arch_get_iomem_base(void); extern ucell ofmem_arch_get_iomem_top(void); extern retain_t* ofmem_arch_get_retained(void); diff --git a/openbios-devel/libopenbios/ofmem_common.c b/openbios-devel/libopenbios/ofmem_common.c index 3b8ca15..ef91119 100644 --- a/openbios-devel/libopenbios/ofmem_common.c +++ b/openbios-devel/libopenbios/ofmem_common.c @@ -348,7 +348,7 @@ static void ofmem_update_translations( void ) ofmem_t *ofmem = ofmem_arch_get_private();
ofmem_update_memory_available(s_phandle_memory, ofmem->phys_range, - &phys_range_prop, &phys_range_prop_size, &phys_range_prop_used, ofmem_arch_get_phys_top()); + &phys_range_prop, &phys_range_prop_size, &phys_range_prop_used, get_ram_size()); ofmem_update_memory_available(s_phandle_mmu, ofmem->virt_range, &virt_range_prop, &virt_range_prop_size, &virt_range_prop_used, (ucell)-1); ofmem_update_mmu_translations(); @@ -521,7 +521,7 @@ phys_addr_t ofmem_claim_phys( phys_addr_t phys, ucell size, ucell align ) " align=" FMT_ucellx "\n", phys, size, align);
- return ofmem_claim_phys_( phys, size, align, 0, ofmem_arch_get_phys_top(), 1 ); + return ofmem_claim_phys_( phys, size, align, 0, get_ram_size(), 1 ); }
static ucell ofmem_claim_virt_( ucell virt, ucell size, ucell align, @@ -634,7 +634,7 @@ ucell ofmem_claim( ucell addr, ucell size, ucell align ) } else { if( align < PAGE_SIZE ) align = PAGE_SIZE; - phys = ofmem_claim_phys_( -1, size, align, 0, ofmem_arch_get_phys_top(), 1 /* reverse */ ); + phys = ofmem_claim_phys_( -1, size, align, 0, get_ram_size(), 1 /* reverse */ ); virt = ofmem_claim_virt_( phys, size, 0, 0, 0, 0 ); if( phys == -1 || virt == -1 ) { OFMEM_TRACE("ofmem_claim failed\n");