From 581707811c1c24bb0676e7582c671548b8851436 Mon Sep 17 00:00:00 2001 From: Myles Watson Date: Wed, 28 Oct 2009 16:13:28 +0000 Subject: Create lib.h for homeless prototypes. Signed-off-by: Myles Watson Acked-by: Ronald G. Minnich git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4878 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/arch/i386/boot/gdt.c | 2 +- src/arch/i386/boot/tables.c | 2 +- src/boot/selfboot.c | 2 +- src/console/vsprintf.c | 3 +-- src/include/lib.h | 30 ++++++++++++++++++++++++++++++ src/lib/cbfs.c | 3 +-- src/lib/clog2.c | 4 ++-- src/lib/lzma.c | 3 +-- src/lib/xmodem.c | 5 +---- 9 files changed, 39 insertions(+), 15 deletions(-) create mode 100644 src/include/lib.h (limited to 'src') diff --git a/src/arch/i386/boot/gdt.c b/src/arch/i386/boot/gdt.c index 0230acf208..069d7b3577 100644 --- a/src/arch/i386/boot/gdt.c +++ b/src/arch/i386/boot/gdt.c @@ -20,6 +20,7 @@ #include #include #include +#include #include // 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; diff --git a/src/arch/i386/boot/tables.c b/src/arch/i386/boot/tables.c index 03ebda60f7..8000162573 100644 --- a/src/arch/i386/boot/tables.c +++ b/src/arch/i386/boot/tables.c @@ -30,11 +30,11 @@ #include #include "coreboot_table.h" #include +#include uint64_t high_tables_base = 0; uint64_t high_tables_size; -void move_gdt(void); void cbmem_arch_init(void) { /* defined in gdt.c */ diff --git a/src/boot/selfboot.c b/src/boot/selfboot.c index fa3e29a97d..bee6135915 100644 --- a/src/boot/selfboot.c +++ b/src/boot/selfboot.c @@ -28,6 +28,7 @@ #include #include #include +#include #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; } diff --git a/src/console/vsprintf.c b/src/console/vsprintf.c index 7f3e33c3cc..c4c91115c2 100644 --- a/src/console/vsprintf.c +++ b/src/console/vsprintf.c @@ -20,6 +20,7 @@ */ #include +#include #include #include @@ -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 index 0000000000..8afa12880e --- /dev/null +++ b/src/include/lib.h @@ -0,0 +1,30 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2009, Myles Watson + * + * 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); + diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c index 876f6352e0..5f24faf20f 100644 --- a/src/lib/cbfs.c +++ b/src/lib/cbfs.c @@ -21,6 +21,7 @@ #include #include #include +#include #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) { diff --git a/src/lib/clog2.c b/src/lib/clog2.c index f7c6e59284..740b8d9f74 100644 --- a/src/lib/clog2.c +++ b/src/lib/clog2.c @@ -4,11 +4,11 @@ #include #endif +#include + /* 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. diff --git a/src/lib/lzma.c b/src/lib/lzma.c index 03ca16399a..fc533c03f1 100644 --- a/src/lib/lzma.c +++ b/src/lib/lzma.c @@ -13,8 +13,7 @@ SDK 4.42, which is written and distributed to public domain by Igor Pavlov. #include "lzmadecode.c" #include #include - -unsigned long ulzma(unsigned char * src, unsigned char * dst); +#include unsigned long ulzma(unsigned char * src, unsigned char * dst) { diff --git a/src/lib/xmodem.c b/src/lib/xmodem.c index bcbe23274b..465d6670a3 100644 --- a/src/lib/xmodem.c +++ b/src/lib/xmodem.c @@ -19,10 +19,7 @@ #include #include - -extern void uart8250_tx_byte(unsigned, unsigned char); -extern int uart8250_can_rx_byte(unsigned); -extern unsigned char uart8250_rx_byte(unsigned); +#include static int _inbyte(int msec) { -- cgit v1.2.3