Author: myles Date: 2009-10-28 17:13:28 +0100 (Wed, 28 Oct 2009) New Revision: 4878
Added: trunk/coreboot-v2/src/include/lib.h Modified: trunk/coreboot-v2/src/arch/i386/boot/gdt.c trunk/coreboot-v2/src/arch/i386/boot/tables.c trunk/coreboot-v2/src/boot/selfboot.c trunk/coreboot-v2/src/console/vsprintf.c trunk/coreboot-v2/src/lib/cbfs.c trunk/coreboot-v2/src/lib/clog2.c trunk/coreboot-v2/src/lib/lzma.c trunk/coreboot-v2/src/lib/xmodem.c Log: Create lib.h for homeless prototypes. Signed-off-by: Myles Watson <myle...@gmail.com> Acked-by: Ronald G. Minnich <rminn...@gmail.com> Modified: trunk/coreboot-v2/src/arch/i386/boot/gdt.c =================================================================== --- trunk/coreboot-v2/src/arch/i386/boot/gdt.c 2009-10-28 15:30:11 UTC (rev 4877) +++ trunk/coreboot-v2/src/arch/i386/boot/gdt.c 2009-10-28 16:13:28 UTC (rev 4878) @@ -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 @@ } __attribute__((packed)); // Copy GDT to new location and reload it -void move_gdt(void); void move_gdt(void) { void *newgdt; Modified: trunk/coreboot-v2/src/arch/i386/boot/tables.c =================================================================== --- trunk/coreboot-v2/src/arch/i386/boot/tables.c 2009-10-28 15:30:11 UTC (rev 4877) +++ trunk/coreboot-v2/src/arch/i386/boot/tables.c 2009-10-28 16:13:28 UTC (rev 4878) @@ -30,11 +30,11 @@ #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 */ Modified: trunk/coreboot-v2/src/boot/selfboot.c =================================================================== --- trunk/coreboot-v2/src/boot/selfboot.c 2009-10-28 15:30:11 UTC (rev 4877) +++ trunk/coreboot-v2/src/boot/selfboot.c 2009-10-28 16:13:28 UTC (rev 4878) @@ -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 @@ 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; } Modified: trunk/coreboot-v2/src/console/vsprintf.c =================================================================== --- trunk/coreboot-v2/src/console/vsprintf.c 2009-10-28 15:30:11 UTC (rev 4877) +++ trunk/coreboot-v2/src/console/vsprintf.c 2009-10-28 16:13:28 UTC (rev 4878) @@ -20,6 +20,7 @@ */ #include <stdarg.h> +#include <string.h> #include <smp/spinlock.h> #include <console/vtxprintf.h> @@ -48,8 +49,6 @@ return i; } -int sprintf(char *buf, const char *fmt, ...); - int sprintf(char *buf, const char *fmt, ...) { va_list args; Added: trunk/coreboot-v2/src/include/lib.h =================================================================== --- trunk/coreboot-v2/src/include/lib.h (rev 0) +++ trunk/coreboot-v2/src/include/lib.h 2009-10-28 16:13:28 UTC (rev 4878) @@ -0,0 +1,30 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2009, Myles Watson <myle...@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); + Modified: trunk/coreboot-v2/src/lib/cbfs.c =================================================================== --- trunk/coreboot-v2/src/lib/cbfs.c 2009-10-28 15:30:11 UTC (rev 4877) +++ trunk/coreboot-v2/src/lib/cbfs.c 2009-10-28 16:13:28 UTC (rev 4878) @@ -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) { Modified: trunk/coreboot-v2/src/lib/clog2.c =================================================================== --- trunk/coreboot-v2/src/lib/clog2.c 2009-10-28 15:30:11 UTC (rev 4877) +++ trunk/coreboot-v2/src/lib/clog2.c 2009-10-28 16:13:28 UTC (rev 4878) @@ -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. Modified: trunk/coreboot-v2/src/lib/lzma.c =================================================================== --- trunk/coreboot-v2/src/lib/lzma.c 2009-10-28 15:30:11 UTC (rev 4877) +++ trunk/coreboot-v2/src/lib/lzma.c 2009-10-28 16:13:28 UTC (rev 4878) @@ -13,9 +13,8 @@ #include "lzmadecode.c" #include <console/console.h> #include <string.h> +#include <lib.h> -unsigned long ulzma(unsigned char * src, unsigned char * dst); - unsigned long ulzma(unsigned char * src, unsigned char * dst) { unsigned char properties[LZMA_PROPERTIES_SIZE]; Modified: trunk/coreboot-v2/src/lib/xmodem.c =================================================================== --- trunk/coreboot-v2/src/lib/xmodem.c 2009-10-28 15:30:11 UTC (rev 4877) +++ trunk/coreboot-v2/src/lib/xmodem.c 2009-10-28 16:13:28 UTC (rev 4878) @@ -19,11 +19,8 @@ #include <string.h> #include <delay.h> +#include <uart8250.h> -extern void uart8250_tx_byte(unsigned, unsigned char); -extern int uart8250_can_rx_byte(unsigned); -extern unsigned char uart8250_rx_byte(unsigned); - static int _inbyte(int msec) { while (!uart8250_can_rx_byte(CONFIG_TTYS0_BASE)) { -- coreboot mailing list: coreboot@coreboot.org http://www.coreboot.org/mailman/listinfo/coreboot