[OpenBIOS] r60 - in openbios-devel: arch/sparc32 arch/sparc64 include/sparc64 modules

svn@openbios.org svn at openbios.org
Sat Jun 10 04:04:54 CEST 2006


Author: stepan
Date: 2006-06-10 04:04:54 +0200 (Sat, 10 Jun 2006)
New Revision: 60

Modified:
   openbios-devel/arch/sparc32/romvec.c
   openbios-devel/arch/sparc64/tree.fs
   openbios-devel/include/sparc64/types.h
   openbios-devel/modules/build.xml
Log:
get sparc64 almost building (fails due to my binutils at the moment)



Modified: openbios-devel/arch/sparc32/romvec.c
===================================================================
--- openbios-devel/arch/sparc32/romvec.c	2006-06-10 01:41:02 UTC (rev 59)
+++ openbios-devel/arch/sparc32/romvec.c	2006-06-10 02:04:54 UTC (rev 60)
@@ -52,6 +52,8 @@
 
 static struct linux_romvec romvec0;
 
+static unsigned long free_ram;
+
 static void doublewalk(__attribute__((unused)) unsigned int ptab1,
                        __attribute__((unused)) unsigned int va)
 {
@@ -367,18 +369,18 @@
     return ret;
 }
 
-static void obp_dumb_memfree(char *va, unsigned sz)
+static void obp_dumb_memfree(__attribute__((unused))char *va,
+                             __attribute__((unused))unsigned sz)
 {
     DPRINTF("obp_dumb_memfree 0x%x(%d)\n", va, sz);
 }
 
-static char * obp_dumb_memalloc(char *va, unsigned size)
+static char * obp_dumb_memalloc(char *va, unsigned int size)
 {
-    static char *pa = 0x4000000;
+    free_ram -= size;
+    DPRINTF("obp_dumb_memalloc req 0x%x of %d at 0x%x\n", va, size, free_ram);
+    obp_dumb_mmap(va, 1, free_ram, size);
 
-    DPRINTF("obp_dumb_memalloc req 0x%x of %d at 0x%x\n", va, size, pa);
-    obp_dumb_mmap(va, 1, pa, size);
-    pa += size;
     return va;
 }
 
@@ -444,6 +446,8 @@
 void *
 init_openprom(unsigned long memsize, const char *cmdline, char boot_device)
 {
+    free_ram = va2pa((int)&_data) - PAGE_SIZE;
+
     ptphys = totphys;
     ptmap = totmap;
     ptavail = totavail;
@@ -457,7 +461,7 @@
 
     totavail[0].theres_more = NULL;
     totavail[0].start_adr = (char *) 0;
-    totavail[0].num_bytes = va2pa((int)&_data) - PAGE_SIZE;
+    totavail[0].num_bytes = free_ram;
 
     totmap[0].theres_more = NULL;
     totmap[0].start_adr = &_start;

Modified: openbios-devel/arch/sparc64/tree.fs
===================================================================
--- openbios-devel/arch/sparc64/tree.fs	2006-06-10 01:41:02 UTC (rev 59)
+++ openbios-devel/arch/sparc64/tree.fs	2006-06-10 02:04:54 UTC (rev 60)
@@ -3,8 +3,8 @@
   2 encode-int " #address-cells" property
   1 encode-int " #size-cells" property
 
-  : encode-unit encode-unit-sbus ;
-  : decode-unit decode-unit-sbus ;
+  \ : encode-unit encode-unit-sbus ;
+  \ : decode-unit decode-unit-sbus ;
 
 new-device
   " memory" device-name

Modified: openbios-devel/include/sparc64/types.h
===================================================================
--- openbios-devel/include/sparc64/types.h	2006-06-10 01:41:02 UTC (rev 59)
+++ openbios-devel/include/sparc64/types.h	2006-06-10 02:04:54 UTC (rev 60)
@@ -16,8 +16,8 @@
 /* cell based types */
 typedef int64_t		 cell;
 typedef uint64_t	ucell;
-typedef long long	dcell;
-typedef unsigned long long ducell;
+typedef __int128_t	dcell;
+typedef __uint128_t    ducell;
 
 #define bitspercell	(sizeof(cell)<<3)
 #define bitsperdcell	(sizeof(dcell)<<3)

Modified: openbios-devel/modules/build.xml
===================================================================
--- openbios-devel/modules/build.xml	2006-06-10 01:41:02 UTC (rev 59)
+++ openbios-devel/modules/build.xml	2006-06-10 02:04:54 UTC (rev 60)
@@ -9,6 +9,7 @@
   <object source="elfnote.c" condition="X86"/>
   <object source="elfnote.c" condition="AMD64"/>
   <object source="elfnote.c" condition="SPARC32"/>
+  <object source="elfnote.c" condition="SPARC64"/>
   <object source="elfload.c" condition="PPC"/>
   <object source="linuxbios.c" condition="LINUXBIOS"/>
   <object source="cmdline.c" condition="CMDLINE"/>




More information about the OpenBIOS mailing list