[OpenBIOS] [commit] r1016 - trunk/openbios-devel/arch/sparc64

repository service svn at openbios.org
Sun Jan 30 14:07:35 CET 2011


Author: blueswirl
Date: Sun Jan 30 14:07:34 2011
New Revision: 1016
URL: http://tracker.coreboot.org/trac/openbios/changeset/1016

Log:
sparc64: avoid runtime relocations

Signed-off-by: Blue Swirl <blauwirbel at gmail.com>

Modified:
   trunk/openbios-devel/arch/sparc64/build.xml
   trunk/openbios-devel/arch/sparc64/builtin.c
   trunk/openbios-devel/arch/sparc64/ofmem_sparc64.c
   trunk/openbios-devel/arch/sparc64/openbios.c

Modified: trunk/openbios-devel/arch/sparc64/build.xml
==============================================================================
--- trunk/openbios-devel/arch/sparc64/build.xml	Sun Jan 30 14:07:31 2011	(r1015)
+++ trunk/openbios-devel/arch/sparc64/build.xml	Sun Jan 30 14:07:34 2011	(r1016)
@@ -40,11 +40,7 @@
 
  <executable name="target/include/static-dict.h" target="target" condition="IMAGE_ELF_EMBEDDED">
   <rule><![CDATA[
-	$(call quiet-command,true, "  GEN   $(TARGET_DIR)$@")
-	@echo "static const char forth_dictionary[] = {" > $@
-	@cat $< | hexdump -ve '1/0 "\t" 8/1 "0x%02x, " 1/0 "\n"' \
-					| sed 's/0x  ,//g' >> $@
-	@echo "};" >> $@]]></rule>
+	$(call quiet-command,$(ODIR)/forthstrap -x -D $@ -d $< </dev/null, "  GEN   $(TARGET_DIR)$@")]]></rule>
   <external-object source="openbios-sparc64.dict"/>
  </executable>
 

Modified: trunk/openbios-devel/arch/sparc64/builtin.c
==============================================================================
--- trunk/openbios-devel/arch/sparc64/builtin.c	Sun Jan 30 14:07:31 2011	(r1015)
+++ trunk/openbios-devel/arch/sparc64/builtin.c	Sun Jan 30 14:07:34 2011	(r1016)
@@ -14,12 +14,20 @@
  * wrap an array around the hex'ed dictionary file
  */
 
+/* 512K for the dictionary */
+#define DICTIONARY_SIZE (512 * 1024 / sizeof(ucell))
+#define DICTIONARY_BASE ((ucell)((char *)&forth_dictionary))
+
+static ucell forth_dictionary[DICTIONARY_SIZE] = {
 #include "static-dict.h"
+};
 
 void collect_multiboot_info(struct sys_info *info);
 void collect_multiboot_info(struct sys_info *info)
 {
 	info->dict_start=(unsigned long *)forth_dictionary;
-	info->dict_end=(unsigned long *)((ucell)forth_dictionary +
-			sizeof(forth_dictionary));
+        info->dict_end = (unsigned long *)FORTH_DICTIONARY_END;
+        info->dict_last = (ucell *)((unsigned char *)forth_dictionary +
+                                            FORTH_DICTIONARY_LAST);
+        info->dict_limit = sizeof(forth_dictionary);
 }

Modified: trunk/openbios-devel/arch/sparc64/ofmem_sparc64.c
==============================================================================
--- trunk/openbios-devel/arch/sparc64/ofmem_sparc64.c	Sun Jan 30 14:07:31 2011	(r1015)
+++ trunk/openbios-devel/arch/sparc64/ofmem_sparc64.c	Sun Jan 30 14:07:34 2011	(r1016)
@@ -20,7 +20,7 @@
 
 #define OF_MALLOC_BASE		((char*)OFMEM + ALIGN_SIZE(sizeof(ofmem_t), 8))
 
-#define MEMSIZE ((256 + 512 + 512) * 1024)
+#define MEMSIZE ((256 + 512) * 1024)
 static union {
 	char memory[MEMSIZE];
 	ofmem_t ofmem;

Modified: trunk/openbios-devel/arch/sparc64/openbios.c
==============================================================================
--- trunk/openbios-devel/arch/sparc64/openbios.c	Sun Jan 30 14:07:31 2011	(r1015)
+++ trunk/openbios-devel/arch/sparc64/openbios.c	Sun Jan 30 14:07:34 2011	(r1016)
@@ -33,7 +33,6 @@
 #define APB_MEM_BASE         0x1ff00000000ULL
 
 #define MEMORY_SIZE     (512*1024)      /* 512K ram for hosted system */
-#define DICTIONARY_SIZE (512*1024)      /* 512K for the dictionary   */
 
 static ucell *memory;
 
@@ -617,12 +616,11 @@
 
         collect_sys_info(&sys_info);
 
-        dict = malloc(DICTIONARY_SIZE);
-        dictlimit = DICTIONARY_SIZE;
+        dict = (unsigned char *)sys_info.dict_start;
+        dicthead = (cell)sys_info.dict_end;
+        last = sys_info.dict_last;
+        dictlimit = sys_info.dict_limit;
 
-	load_dictionary((char *)sys_info.dict_start,
-			(unsigned long)sys_info.dict_end
-                        - (unsigned long)sys_info.dict_start);
 	forth_init();
 
 #ifdef CONFIG_DEBUG_BOOT



More information about the OpenBIOS mailing list