diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 0398177d69..cc8c9c005e 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -83,12 +83,11 @@ $(obj)/stage0.init: $(Q)# other lib parts $(Q)$(CC) $(INITCFLAGS) -c $(src)/lib/mem.c -o $(obj)/mem.o $(Q)$(CC) $(INITCFLAGS) -c $(src)/lib/newelfboot.c -o $(obj)/newelfboot.o - $(Q)$(CC) $(INITCFLAGS) -c $(src)/lib/compute_ip_checksum.c -o $(obj)/compute_ip_checksum.o $(Q)cd $(obj); $(CC) -m32 -nostdlib -static \ -T $(src)/arch/x86/ldscript.ld cachemain.o \ console.o uart8250.o serial.o archelfboot.o vtxprintf.o \ - vsprintf.o lar.o newelfboot.o compute_ip_checksum.o mem.o stage0_i586.o -o stage0.o + vsprintf.o lar.o newelfboot.o mem.o stage0_i586.o -o stage0.o $(Q)objcopy -O binary $(obj)/stage0.o $(obj)/stage0.init.pre diff --git a/arch/x86/archelfboot.c b/arch/x86/archelfboot.c index 519272e3df..b868f6d93f 100644 --- a/arch/x86/archelfboot.c +++ b/arch/x86/archelfboot.c @@ -1,5 +1,5 @@ #include -#include +// #include #include #include #include diff --git a/include/elf.h b/include/elf.h index 9f143bc23e..fcec4c7bf6 100644 --- a/include/elf.h +++ b/include/elf.h @@ -1,3 +1,22 @@ +/* + * Copright (C) 2003 Eric Biederman + * + * 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 may be dual licensed with the new BSD license. + */ + #ifndef ELF_H #define ELF_H diff --git a/include/elf_boot.h b/include/elf_boot.h index ee6750d293..377cff957c 100644 --- a/include/elf_boot.h +++ b/include/elf_boot.h @@ -1,3 +1,23 @@ +/* + * Copright (C) 2003 Eric Biederman + * + * 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 may be dual licensed with the new BSD license. + */ + + #ifndef ELF_BOOT_H #define ELF_BOOT_H diff --git a/include/fallback.h b/include/fallback.h deleted file mode 100644 index 057681bfc1..0000000000 --- a/include/fallback.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef PART_FALLBACK_BOOT_H -#define PART_FALLBACK_BOOT_H - -#ifndef ASSEMBLY - -#if HAVE_FALLBACK_BOOT == 1 -void set_boot_successful(void); -#else -#define set_boot_successful() -#endif - -void boot_successful(void); - -#endif /* ASSEMBLY */ - -#define RTC_BOOT_BYTE 48 - -#endif /* PART_FALLBACK_BOOT_H */ diff --git a/include/ip_checksum.h b/include/ip_checksum.h deleted file mode 100644 index c2cb938294..0000000000 --- a/include/ip_checksum.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef IP_CHECKSUM_H -#define IP_CHECKSUM_H - -unsigned long compute_ip_checksum(void *addr, unsigned long length); -unsigned long add_ip_checksums(unsigned long offset, unsigned long sum, unsigned long new); - -#endif /* IP_CHECKSUM_H */ diff --git a/include/linuxbios_tables.h b/include/linuxbios_tables.h index 527c44d5fc..321ed12bd5 100644 --- a/include/linuxbios_tables.h +++ b/include/linuxbios_tables.h @@ -1,3 +1,23 @@ +/* + * Copright (C) 2000 Eric Biederman + * + * 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 may be dual licensed with the new BSD license. + */ + + #ifndef LINUXBIOS_TABLES_H #define LINUXBIOS_TABLES_H diff --git a/include/string.h b/include/string.h index e69fbaca3d..9d2dc87604 100644 --- a/include/string.h +++ b/include/string.h @@ -1,3 +1,22 @@ +/* + * Derived from the Linux kernel + * + * 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 may be dual licensed with the new BSD license. + */ + #ifndef STRING_H #define STRING_H diff --git a/lib/compute_ip_checksum.c b/lib/compute_ip_checksum.c deleted file mode 100644 index 0b8eb90f85..0000000000 --- a/lib/compute_ip_checksum.c +++ /dev/null @@ -1,53 +0,0 @@ -#include -#include - -unsigned long compute_ip_checksum(void *addr, unsigned long length) -{ - uint8_t *ptr; - volatile union { - uint8_t byte[2]; - uint16_t word; - } value; - unsigned long sum; - unsigned long i; - /* In the most straight forward way possible, - * compute an ip style checksum. - */ - sum = 0; - ptr = addr; - for(i = 0; i < length; i++) { - unsigned long value; - value = ptr[i]; - if (i & 1) { - value <<= 8; - } - /* Add the new value */ - sum += value; - /* Wrap around the carry */ - if (sum > 0xFFFF) { - sum = (sum + (sum >> 16)) & 0xFFFF; - } - } - value.byte[0] = sum & 0xff; - value.byte[1] = (sum >> 8) & 0xff; - return (~value.word) & 0xFFFF; -} - -unsigned long add_ip_checksums(unsigned long offset, unsigned long sum, unsigned long new) -{ - unsigned long checksum; - sum = ~sum & 0xFFFF; - new = ~new & 0xFFFF; - if (offset & 1) { - /* byte swap the sum if it came from an odd offset - * since the computation is endian independant this - * works. - */ - new = ((new >> 8) & 0xff) | ((new << 8) & 0xff00); - } - checksum = sum + new; - if (checksum > 0xFFFF) { - checksum -= 0xFFFF; - } - return (~checksum) & 0xFFFF; -} diff --git a/lib/newelfboot.c b/lib/newelfboot.c index 2f88dd0450..b970af7d4c 100644 --- a/lib/newelfboot.c +++ b/lib/newelfboot.c @@ -3,7 +3,7 @@ #include #include #include -#include +//#include #include #include #include