[OpenBIOS] [PATCH] fix ppc native build

Aurelien Jarno aurelien at aurel32.net
Tue Jan 13 17:32:18 CET 2009


The patch belows changes ppc/io.h the same way as sparc32/io.h to
correctly define in* and out* functions for the unix build. Without it
gcc outputs the following error messages and bails out:

arch/unix/unix.c:156: error: no previous prototype for ‘inb’
arch/unix/unix.c:168: error: no previous prototype for ‘inw’
arch/unix/unix.c:180: error: no previous prototype for ‘inl’
arch/unix/unix.c:192: error: no previous prototype for ‘outb’
arch/unix/unix.c:205: error: no previous prototype for ‘outw’
arch/unix/unix.c:217: error: no previous prototype for ‘outl’

Index: include/ppc/io.h
===================================================================
--- include/ppc/io.h	(révision 399)
+++ include/ppc/io.h	(copie de travail)
@@ -141,6 +141,23 @@
 		ns--;
 	}
 }
+#else /* BOOTSTRAP */
+#ifdef FCOMPILER
+#define inb(reg) ((u8)0xff)
+#define inw(reg) ((u16)0xffff)
+#define inl(reg) ((u32)0xffffffff)
+#define outb(reg, val) do{} while(0)
+#define outw(reg, val) do{} while(0)
+#define outl(reg, val) do{} while(0)
+#else
+extern u8 inb(u32 reg);
+extern u16 inw(u32 reg);
+extern u32 inl(u32 reg);
+extern void insw(u32 reg, void *addr, unsigned long count);
+extern void outb(u32 reg, u8 val);
+extern void outw(u32 reg, u16 val);
+extern void outl(u32 reg, u32 val);
+extern void outsw(u32 reg, const void *addr, unsigned long count);
 #endif
-
+#endif
 #endif /* _ASM_IO_H */


-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32 at debian.org         | aurelien at aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net



More information about the OpenBIOS mailing list