[OpenBIOS] [commit] r904 - trunk/openbios-devel/arch/ppc/qemu

repository service svn at openbios.org
Sat Oct 16 19:36:05 CEST 2010


Author: blueswirl
Date: Sat Oct 16 19:36:04 2010
New Revision: 904
URL: http://tracker.coreboot.org/trac/openbios/changeset/904

Log:
ppc: Claim memory used by OpenBIOS

OpenBIOS kept getting overwritten in RAM by clients such as Haiku.

Make sure memory used by OpenBIOS cannot accidentally be claimed
by someone else.
This also sets up the "available" property as expected.

Note that we avoid ofmem_claim() as it would map the pages using a
default mode, followed by a remap with the desired mode.

v2:
* Reordered.
* Added spacing.

Signed-off-by: Andreas Färber <andreas.faerber at web.de>
Signed-off-by: Blue Swirl <blauwirbel at gmail.com>

Modified:
   trunk/openbios-devel/arch/ppc/qemu/ofmem.c

Modified: trunk/openbios-devel/arch/ppc/qemu/ofmem.c
==============================================================================
--- trunk/openbios-devel/arch/ppc/qemu/ofmem.c	Sat Oct 16 19:36:00 2010	(r903)
+++ trunk/openbios-devel/arch/ppc/qemu/ofmem.c	Sat Oct 16 19:36:04 2010	(r904)
@@ -429,6 +429,11 @@
 {
 	ofmem_t *ofmem = ofmem_arch_get_private();
 
+	ofmem_claim_phys(0, get_ram_bottom(), 0);
+	ofmem_claim_virt(0, get_ram_bottom(), 0);
 	ofmem_map( 0, 0, get_ram_bottom(), 0 );
+
+	ofmem_claim_phys(get_ram_top(), ofmem->ramsize - get_ram_top(), 0);
+	ofmem_claim_virt(get_ram_top(), ofmem->ramsize - get_ram_top(), 0);
 	ofmem_map( get_ram_top(), get_ram_top(), ofmem->ramsize - get_ram_top(), 0);
 }



More information about the OpenBIOS mailing list