[OpenBIOS] [PATCH 6/6] OFMEM: Fix bogus tail entry added to the end of the virtual memory available list.

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Sun Jan 9 18:56:35 CET 2011


Since top_address is 64-bit, the existing code would incorrectly think that the end of
virtual memory had not been reached and so add a bogus tail entry. Casting -1 to ucell
should ensure that we pass the correct top address for virtual memory.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at siriusit.co.uk>
---
 openbios-devel/libopenbios/ofmem_common.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/openbios-devel/libopenbios/ofmem_common.c b/openbios-devel/libopenbios/ofmem_common.c
index a2c69f8..ac36fca 100644
--- a/openbios-devel/libopenbios/ofmem_common.c
+++ b/openbios-devel/libopenbios/ofmem_common.c
@@ -347,7 +347,7 @@ static void ofmem_update_translations( void )
 	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());
 	ofmem_update_memory_available(s_phandle_mmu, ofmem->virt_range, 
-			&virt_range_prop, &virt_range_prop_size, &virt_range_prop_used, -1ULL);
+			&virt_range_prop, &virt_range_prop_size, &virt_range_prop_used, (ucell)-1);
 	ofmem_update_mmu_translations();
 }
 
-- 
1.7.2.3




More information about the OpenBIOS mailing list