Create lib.h for homeless prototypes.
authorMyles Watson <mylesgw@gmail.com>
Wed, 28 Oct 2009 16:13:28 +0000 (16:13 +0000)
committerMyles Watson <mylesgw@gmail.com>
Wed, 28 Oct 2009 16:13:28 +0000 (16:13 +0000)
Signed-off-by: Myles Watson <mylesgw@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4878 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

src/arch/i386/boot/gdt.c
src/arch/i386/boot/tables.c
src/boot/selfboot.c
src/console/vsprintf.c
src/include/lib.h [new file with mode: 0644]
src/lib/cbfs.c
src/lib/clog2.c
src/lib/lzma.c
src/lib/xmodem.c

index 0230acf2087874d74d414ebe2bead82eae07679a..069d7b357736d92f5c8fc850a89a0c8f25acc58c 100644 (file)
@@ -20,6 +20,7 @@
 #include <types.h>
 #include <string.h>
 #include <cbmem.h>
+#include <lib.h>
 #include <console/console.h>
 
 // Global Descriptor Table, defined in c_start.S
@@ -33,7 +34,6 @@ struct gdtarg {
 } __attribute__((packed));
 
 // Copy GDT to new location and reload it
-void move_gdt(void);
 void move_gdt(void)
 {
        void *newgdt;
index 03ebda60f7c11d33828c0ec61b562c339a042cbd..8000162573457de76a399e0016bf66c043bea6d8 100644 (file)
 #include <cpu/x86/multiboot.h>
 #include "coreboot_table.h"
 #include <cbmem.h>
+#include <lib.h>
 
 uint64_t high_tables_base = 0;
 uint64_t high_tables_size;
 
-void move_gdt(void);
 void cbmem_arch_init(void)
 {
        /* defined in gdt.c */
index fa3e29a97d1f049bc34f0d907f4cb094537b7af2..bee6135915105dcff0c94ab594ab0d9c292bb8aa 100644 (file)
@@ -28,6 +28,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <cbfs.h>
+#include <lib.h>
 
 #ifndef CONFIG_BIG_ENDIAN
 #define ntohl(x) ( ((x&0xff)<<24) | ((x&0xff00)<<8) | \
@@ -462,7 +463,6 @@ static int load_self_segments(
                        switch(ptr->compression) {
                                case CBFS_COMPRESS_LZMA: {
                                        printk_debug("using LZMA\n");
-                                       unsigned long ulzma(unsigned char *src, unsigned char *dst);            
                                        len = ulzma(src, dest);
                                        break;
                                }
index 7f3e33c3cc8c13c27b775324a4415284a1de0687..c4c91115c2e1ddc3076f0c3dce855489a4f05adc 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 #include <stdarg.h>
+#include <string.h>
 #include <smp/spinlock.h>
 #include <console/vtxprintf.h>
 
@@ -48,8 +49,6 @@ static int vsprintf(char *buf, const char *fmt, va_list args)
        return i;
 }
 
-int sprintf(char *buf, const char *fmt, ...);
-
 int sprintf(char *buf, const char *fmt, ...)
 {
        va_list args;
diff --git a/src/include/lib.h b/src/include/lib.h
new file mode 100644 (file)
index 0000000..8afa128
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2009, Myles Watson <mylesgw@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
+ */
+
+/* This file is for "nuisance prototypes" that have no other home. */
+
+/* Defined in src/lib/clog2.c */
+unsigned long log2(unsigned long x);
+
+/* Defined in src/lib/lzma.c */
+unsigned long ulzma(unsigned char *src, unsigned char *dst);
+
+/* Defined in src/arch/i386/boot/gdt.c */
+void move_gdt(void);
+
index 876f6352e0d3400c2b1e21ce39352b84c3cac647..5f24faf20f6bb2754b18659bb2a64a95a90a8340 100644 (file)
@@ -21,6 +21,7 @@
 #include <string.h>
 #include <console/console.h>
 #include <cbfs.h>
+#include <lib.h>
 
 #ifndef CONFIG_BIG_ENDIAN
 #define ntohl(x) ( ((x&0xff)<<24) | ((x&0xff00)<<8) | \
@@ -29,8 +30,6 @@
 #define ntohl(x) (x)
 #endif
 
-unsigned long ulzma(unsigned char *src, unsigned char *dst);
-
 int cbfs_decompress(int algo, void *src, void *dst, int len)
 {
        switch(algo) {
index f7c6e592845fd672bbaae7c45e35b57762ad914c..740b8d9f74d8656d8aaeea19f216a04651aa882d 100644 (file)
@@ -4,11 +4,11 @@
 #include <console/console.h>
 #endif
 
+#include <lib.h>
+
 /* Assume 8 bits per byte */
 #define CHAR_BIT 8
 
-unsigned long log2(unsigned long x);
-
 unsigned long log2(unsigned long x)
 {
         // assume 8 bits per byte.
index 03ca16399a0014e0eae66c83c34e92ff6c297cfa..fc533c03f101256f2d7de621a43c30aec6151813 100644 (file)
@@ -13,8 +13,7 @@ SDK 4.42, which is written and distributed to public domain by Igor Pavlov.
 #include "lzmadecode.c"
 #include <console/console.h>
 #include <string.h>
-
-unsigned long ulzma(unsigned char * src, unsigned char * dst);
+#include <lib.h>
 
 unsigned long ulzma(unsigned char * src, unsigned char * dst)
 {
index bcbe23274b459bfc196455e0c9c3d367d22c92ee..465d6670a3029f8e6401b1cdf1678c4189ab098d 100644 (file)
 
 #include <string.h>
 #include <delay.h>
-
-extern void uart8250_tx_byte(unsigned, unsigned char);
-extern int uart8250_can_rx_byte(unsigned);
-extern unsigned char uart8250_rx_byte(unsigned);
+#include <uart8250.h>
 
 static int _inbyte(int msec)
 {