j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
Author: mcayland Date: Wed May 13 01:04:17 2015 New Revision: 1338 URL: http://tracker.coreboot.org/trac/openbios/changeset/1338
Log: OFMEM: remove ofmem_arch_get_phys_top() implementation
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
Modified: trunk/openbios-devel/arch/ppc/qemu/ofmem.c trunk/openbios-devel/arch/sparc32/ofmem_sparc32.c trunk/openbios-devel/arch/sparc64/ofmem_sparc64.c trunk/openbios-devel/include/libopenbios/ofmem.h trunk/openbios-devel/libopenbios/ofmem_common.c
Modified: trunk/openbios-devel/arch/ppc/qemu/ofmem.c ============================================================================== --- trunk/openbios-devel/arch/ppc/qemu/ofmem.c Wed May 13 01:04:14 2015 (r1337) +++ trunk/openbios-devel/arch/ppc/qemu/ofmem.c Wed May 13 01:04:17 2015 (r1338) @@ -117,13 +117,6 @@ 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 */
Modified: trunk/openbios-devel/arch/sparc32/ofmem_sparc32.c ============================================================================== --- trunk/openbios-devel/arch/sparc32/ofmem_sparc32.c Wed May 13 01:04:14 2015 (r1337) +++ trunk/openbios-devel/arch/sparc32/ofmem_sparc32.c Wed May 13 01:04:17 2015 (r1338) @@ -66,13 +66,6 @@ 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);
Modified: trunk/openbios-devel/arch/sparc64/ofmem_sparc64.c ============================================================================== --- trunk/openbios-devel/arch/sparc64/ofmem_sparc64.c Wed May 13 01:04:14 2015 (r1337) +++ trunk/openbios-devel/arch/sparc64/ofmem_sparc64.c Wed May 13 01:04:17 2015 (r1338) @@ -65,13 +65,6 @@ 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 */
Modified: trunk/openbios-devel/include/libopenbios/ofmem.h ============================================================================== --- trunk/openbios-devel/include/libopenbios/ofmem.h Wed May 13 01:04:14 2015 (r1337) +++ trunk/openbios-devel/include/libopenbios/ofmem.h Wed May 13 01:04:17 2015 (r1338) @@ -63,7 +63,6 @@ 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);
Modified: trunk/openbios-devel/libopenbios/ofmem_common.c ============================================================================== --- trunk/openbios-devel/libopenbios/ofmem_common.c Wed May 13 01:04:14 2015 (r1337) +++ trunk/openbios-devel/libopenbios/ofmem_common.c Wed May 13 01:04:17 2015 (r1338) @@ -348,7 +348,7 @@ 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 @@ " 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 @@ } 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");