[OpenBIOS] r67 - in openbios-devel: arch/sparc64 arch/unix config/examples config/scripts kernel modules

svn@openbios.org svn at openbios.org
Tue Jul 18 23:38:43 CEST 2006


Author: stepan
Date: 2006-07-18 23:38:42 +0200 (Tue, 18 Jul 2006)
New Revision: 67

Added:
   openbios-devel/config/scripts/crosscflags
Modified:
   openbios-devel/arch/sparc64/build.xml
   openbios-devel/arch/sparc64/context.c
   openbios-devel/arch/unix/blk.c
   openbios-devel/arch/unix/unix.c
   openbios-devel/config/examples/sparc64_rules.xml
   openbios-devel/kernel/internal.c
   openbios-devel/modules/disk-label.c
   openbios-devel/modules/nvram.c
Log:
- Cleanup compiler warnings etc.
- add crosscflags from previous patch ;)


Modified: openbios-devel/arch/sparc64/build.xml
===================================================================
--- openbios-devel/arch/sparc64/build.xml	2006-07-18 21:35:55 UTC (rev 66)
+++ openbios-devel/arch/sparc64/build.xml	2006-07-18 21:38:42 UTC (rev 67)
@@ -61,7 +61,6 @@
  <executable name="target/arch/sparc64/builtin.o" target="target" condition="IMAGE_ELF_EMBEDDED">
   <rule><![CDATA[ arch/sparc64/builtin.c
 	$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
-  <external-object source="target/include/static-dict.h"/>
  </executable>
  
  <!-- END OF HACK ALERT -->

Modified: openbios-devel/arch/sparc64/context.c
===================================================================
--- openbios-devel/arch/sparc64/context.c	2006-07-18 21:35:55 UTC (rev 66)
+++ openbios-devel/arch/sparc64/context.c	2006-07-18 21:38:42 UTC (rev 67)
@@ -20,7 +20,7 @@
  * It is placed at the bottom of our stack, and loaded by assembly routine
  * to start us up.
  */
-struct context main_ctx = {
+const struct context main_ctx = {
     .regs[REG_SP] = (uint64_t) &_estack - 96,
     .pc = (uint64_t) start_main,
     .npc = (uint64_t) start_main + 4,

Modified: openbios-devel/arch/unix/blk.c
===================================================================
--- openbios-devel/arch/unix/blk.c	2006-07-18 21:35:55 UTC (rev 66)
+++ openbios-devel/arch/unix/blk.c	2006-07-18 21:38:42 UTC (rev 67)
@@ -47,7 +47,7 @@
 }
 
 static void
-blk_close( blk_data_t *pb )
+blk_close( __attribute__((unused)) blk_data_t *pb )
 {
 	selfword("close-deblocker");
 }
@@ -80,20 +80,20 @@
 
 /* ( -- bs ) */
 static void
-blk_block_size( blk_data_t *pb )
+blk_block_size( __attribute__((unused)) blk_data_t *pb )
 {
 	PUSH( 512 );
 }
 
 /* ( -- maxbytes ) */
 static void
-blk_max_transfer( blk_data_t *pb )
+blk_max_transfer( __attribute__((unused)) blk_data_t *pb )
 {
 	PUSH( 1024*1024 );
 }
 
 static void
-blk_initialize( blk_data_t *pb )
+blk_initialize( __attribute__((unused)) blk_data_t *pb )
 {
 	fword("is-deblocker");
 }

Modified: openbios-devel/arch/unix/unix.c
===================================================================
--- openbios-devel/arch/unix/unix.c	2006-07-18 21:35:55 UTC (rev 66)
+++ openbios-devel/arch/unix/unix.c	2006-07-18 21:38:42 UTC (rev 67)
@@ -309,7 +309,7 @@
 	PUSH((ucell) memory + MEMORY_SIZE);
 }
 
-void exception(cell no)
+void exception(__attribute__((unused)) cell no)
 {
 	/* 
 	 * this is a noop since the dictionary has to take care 

Modified: openbios-devel/config/examples/sparc64_rules.xml
===================================================================
--- openbios-devel/config/examples/sparc64_rules.xml	2006-07-18 21:35:55 UTC (rev 66)
+++ openbios-devel/config/examples/sparc64_rules.xml	2006-07-18 21:38:42 UTC (rev 67)
@@ -26,7 +26,7 @@
 endif
 
 CFLAGS := -Os -Wall -W -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -fno-builtin -g
-CFLAGS+=  -Wa,-xarch=v9 -Wa,-64 -m64 -mcpu=ultrasparc -mcmodel=medany
+CFLAGS+= -Wa,-xarch=v9 -Wa,-64 -m64 -mcpu=ultrasparc -mcmodel=medany
 CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
 CFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing
 INCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include

Added: openbios-devel/config/scripts/crosscflags
===================================================================
--- openbios-devel/config/scripts/crosscflags	                        (rev 0)
+++ openbios-devel/config/scripts/crosscflags	2006-07-18 21:38:42 UTC (rev 67)
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+host=$1
+target=$2
+
+if test "$host" = "sparc"; then
+    host="sparc32"
+fi
+
+if test "$host" = "powerpc" -o "$host" = "mips" -o "$host" = "s390" -o "$host" = "sparc32" -o "$host" = "sparc64" -o "$host" = "m68k" -o "$host" = "armv4b"; then
+    hostbigendian="yes"
+else
+    hostbigendian="no"
+fi
+
+# host long bits test
+if test "$host" = "sparc64" -o "$host" = "ia64" -o "$host" = "x86_64" -o "$host" = "alpha"; then
+    hostlongbits="64"
+else
+    hostlongbits="32"
+fi
+
+if test "$target" = "powerpc" -o "$target" = "mips" -o "$target" = "s390" -o "$target" = "sparc32" -o "$target" = "sparc64" -o "$target" = "m68k" -o "$target" = "armv4b"; then
+    targetbigendian="yes"
+else
+    targetbigendian="no"
+fi
+
+# target long bits test
+if test "$target" = "sparc64" -o "$target" = "ia64" -o "$target" = "x86_64" -o "$target" = "alpha"; then
+    targetlongbits="64"
+else
+    targetlongbits="32"
+fi
+
+if test "$targetbigendian" = "$hostbigendian"; then
+    cflags="-USWAP_ENDIANNESS"
+else
+    cflags="-DSWAP_ENDIANNESS"
+fi
+
+if test "$targetlongbits" = "$hostlongbits"; then
+    cflags="$cflags -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH"
+elif test "$targetlongbits" -lt "$hostlongbits"; then
+    cflags="$cflags -DNATIVE_BITWIDTH_SMALLER_THAN_HOST_BITWIDTH"
+else
+    cflags="$cflags -DNATIVE_BITWIDTH_LARGER_THAN_HOST_BITWIDTH"
+fi
+
+if test "$host" = "x86" -a "$targetlongbits" = "64"; then
+    cflags="$cflags -DNEED_FAKE_INT128_T"
+fi
+
+echo "$cflags"

Modified: openbios-devel/kernel/internal.c
===================================================================
--- openbios-devel/kernel/internal.c	2006-07-18 21:35:55 UTC (rev 66)
+++ openbios-devel/kernel/internal.c	2006-07-18 21:38:42 UTC (rev 67)
@@ -178,9 +178,11 @@
 
 static void sysdebug(void)
 {
+#ifdef FCOMPILER
 	cell errorno=POP();
-#ifdef FCOMPILER
 	exception(errorno);
+#else
+        (void) POP();
 #endif
 }
 

Modified: openbios-devel/modules/disk-label.c
===================================================================
--- openbios-devel/modules/disk-label.c	2006-07-18 21:35:55 UTC (rev 66)
+++ openbios-devel/modules/disk-label.c	2006-07-18 21:38:42 UTC (rev 67)
@@ -168,7 +168,7 @@
 
 /* ( addr len -- actual ) */
 static void
-dlabel_write( dlabel_info_t *di )
+dlabel_write( __attribute__((unused)) dlabel_info_t *di )
 {
 	DDROP();
 	PUSH( -1 );
@@ -185,7 +185,7 @@
 
 /* ( addr -- size ) */
 static void
-dlabel_load( dlabel_info_t *di )
+dlabel_load( __attribute__((unused)) dlabel_info_t *di )
 {
 	/* XXX: try the load method of the part package */
 

Modified: openbios-devel/modules/nvram.c
===================================================================
--- openbios-devel/modules/nvram.c	2006-07-18 21:35:55 UTC (rev 66)
+++ openbios-devel/modules/nvram.c	2006-07-18 21:38:42 UTC (rev 67)
@@ -275,7 +275,7 @@
 
 /* ( -- size ) */
 static void
-nvram_size( nvram_ibuf_t *nd )
+nvram_size( __attribute__((unused)) nvram_ibuf_t *nd )
 {
 	PUSH( nvram.size );
 }




More information about the OpenBIOS mailing list