[OpenBIOS] [commit] r1122 - trunk/openbios-devel/arch/sparc32

repository service svn at openbios.org
Fri Apr 19 09:04:25 CEST 2013


Author: mcayland
Date: Fri Apr 19 09:04:25 2013
New Revision: 1122
URL: http://tracker.coreboot.org/trac/openbios/changeset/1122

Log:
SPARC32: Remove manual fix for bad alignments passed into the romvec malloc() functions

Since the handling of bad alignments is now internal to OFMEM, there is no need for
the SPARC32 malloc() functions to have to do this any more.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>

Modified:
   trunk/openbios-devel/arch/sparc32/lib.c

Modified: trunk/openbios-devel/arch/sparc32/lib.c
==============================================================================
--- trunk/openbios-devel/arch/sparc32/lib.c	Fri Apr 19 09:03:59 2013	(r1121)
+++ trunk/openbios-devel/arch/sparc32/lib.c	Fri Apr 19 09:04:25 2013	(r1122)
@@ -285,28 +285,14 @@
 
 char *obp_dumb_memalloc(char *va, unsigned int size)
 {
-    unsigned long align;
-    int i;
+    unsigned long align = size;
     
     DPRINTF("obp_dumb_memalloc: virta 0x%x, sz %d\n", (unsigned int)va, size);    
     
-    /* Solaris seems to assume that the returned value is physically aligned to size. For
-       example, not having this here causes the Solaris 8 kernel to fault because the 
-       IOMMU page table base address is calculated incorrectly. */
-
-    /* Enforce a minimum alignment of CONFIG_OFMEM_MALLOC_ALIGN, and choose an alignment 
-       which is the next power of 2 higher than the specified size */
-    align = size;
-    if (align <= CONFIG_OFMEM_MALLOC_ALIGN) {
-        align = CONFIG_OFMEM_MALLOC_ALIGN;
-    } else {
-        align--;
-        for (i = 1; i < sizeof(unsigned long) * 8; i<<=1) {
-            align |= align >> i;
-        }
-        align++;
-    }
-
+    /* Solaris seems to assume that the returned value is physically aligned to size.
+       e.g. it is used for setting up page tables. Fortunately this is now handled by 
+       ofmem_claim_phys() above. */
+    
     return obp_memalloc(va, size, align);
 }
 



More information about the OpenBIOS mailing list