From eff8b06effbe41fa4881f724ef73e70ef5eebb40 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 17 Aug 2007 19:51:08 +0100 Subject: [PATCH 1/4] Separate out arch-independent parts of stdint.h --- src/arch/i386/include/{ => bits}/stdint.h | 24 +++-------------------- src/include/stdint.h | 24 +++++++++++++++++++++++ 2 files changed, 27 insertions(+), 21 deletions(-) rename src/arch/i386/include/{ => bits}/stdint.h (50%) create mode 100644 src/include/stdint.h diff --git a/src/arch/i386/include/stdint.h b/src/arch/i386/include/bits/stdint.h similarity index 50% rename from src/arch/i386/include/stdint.h rename to src/arch/i386/include/bits/stdint.h index 34bea8b4..a2947cda 100644 --- a/src/arch/i386/include/stdint.h +++ b/src/arch/i386/include/bits/stdint.h @@ -1,5 +1,5 @@ -#ifndef STDINT_H -#define STDINT_H +#ifndef _BITS_STDINT_H +#define _BITS_STDINT_H typedef typeof(sizeof(int)) size_t; typedef signed long ssize_t; @@ -18,22 +18,4 @@ typedef signed long long int64_t; typedef unsigned long physaddr_t; typedef unsigned long intptr_t; -typedef int8_t s8; -typedef uint8_t u8; -typedef int16_t s16; -typedef uint16_t u16; -typedef int32_t s32; -typedef uint32_t u32; -typedef int64_t s64; -typedef uint64_t u64; - -typedef int8_t int8; -typedef uint8_t uint8; -typedef int16_t int16; -typedef uint16_t uint16; -typedef int32_t int32; -typedef uint32_t uint32; -typedef int64_t int64; -typedef uint64_t uint64; - -#endif /* STDINT_H */ +#endif /* _BITS_STDINT_H */ diff --git a/src/include/stdint.h b/src/include/stdint.h new file mode 100644 index 00000000..4b0e44f2 --- /dev/null +++ b/src/include/stdint.h @@ -0,0 +1,24 @@ +#ifndef _STDINT_H +#define _STDINT_H + +#include + +typedef int8_t s8; +typedef uint8_t u8; +typedef int16_t s16; +typedef uint16_t u16; +typedef int32_t s32; +typedef uint32_t u32; +typedef int64_t s64; +typedef uint64_t u64; + +typedef int8_t int8; +typedef uint8_t uint8; +typedef int16_t int16; +typedef uint16_t uint16; +typedef int32_t int32; +typedef uint32_t uint32; +typedef int64_t int64; +typedef uint64_t uint64; + +#endif /* _STDINT_H */ From a895fd0c15ed6213e6a2ef43e5bf1b1a3c335514 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Sat, 18 Aug 2007 18:04:50 +0100 Subject: [PATCH 2/4] Add barrier() primitive (was present in Eb5.4), used by some currently out-of-tree driver code. --- src/include/compiler.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/include/compiler.h b/src/include/compiler.h index b130f28f..2151fc6a 100644 --- a/src/include/compiler.h +++ b/src/include/compiler.h @@ -311,6 +311,11 @@ extern void dbg_hex_dump_da ( unsigned long dispaddr, */ #define __shared __asm__ ( "_shared_bss" ) +/** + * Optimisation barrier + */ +#define barrier() __asm__ __volatile__ ( "" : : : "memory" ) + #endif /* ASSEMBLY */ #endif /* COMPILER_H */ From 8ad8804f7a30a1427da499a810ff2f2ee828117d Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Sat, 18 Aug 2007 19:05:06 +0100 Subject: [PATCH 3/4] Fix building on distros which use dash as the default shell. --- src/Makefile.housekeeping | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping index 1f054d53..ee652b0a 100644 --- a/src/Makefile.housekeeping +++ b/src/Makefile.housekeeping @@ -39,6 +39,14 @@ version : @$(TOUCH) $@ VERYCLEANUP += .toolcheck +# Check for correct syntax for echo -e +# +ifeq ($(shell echo '\0101'),A) +ECHO_E = echo +else +ECHO_E = echo -e +endif + # Build verbosity # ifeq ($(V),1) @@ -121,7 +129,7 @@ define obj_template @$(CPP) $(CFLAGS) $(CFLAGS_$(3)) $(CFLAGS_$(4)) -DOBJECT=$(4) \ -Wno-error -M $(1) -MT "$(4)_DEPS" -MG -MP | \ sed 's/_DEPS\s*:/_DEPS =/' >> $(2) - @echo -e '\n$$(BIN)/$(4).o : $(1) $$(MAKEDEPS) $$($(4)_DEPS)' \ + @$(ECHO_E) '\n$$(BIN)/$(4).o : $(1) $$(MAKEDEPS) $$($(4)_DEPS)' \ '\n\t$$(QM)echo " [BUILD] $$@"\n' \ '\n\t$$(RULE_$(3))\n' \ '\nBOBJS += $$(BIN)/$(4).o\n' \ @@ -368,7 +376,7 @@ define media_template @$(MKDIR) -p $(dir $(2)) @$(RM) $(2) @$(TOUCH) $(2) - @echo -e '$$(BIN)/%$(1) : $$(BIN)/%$(1).zbin' \ + @$(ECHO_E) '$$(BIN)/%$(1) : $$(BIN)/%$(1).zbin' \ '\n\t$$(QM)echo " [FINISH] $$@"' \ '\n\t$$(Q)$$(CP) $$< $$@' \ '\n\t$$(Q)$$(FINALISE_$(1))' \ From db61b0a577390a508ee8b01d308649fe3b4223e4 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Sun, 19 Aug 2007 00:29:27 +0100 Subject: [PATCH 4/4] Added error IDs for all files in drivers/net; they're likely to need them. --- src/include/gpxe/errfile.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/include/gpxe/errfile.h b/src/include/gpxe/errfile.h index 48db1dc1..4f9e7bc6 100644 --- a/src/include/gpxe/errfile.h +++ b/src/include/gpxe/errfile.h @@ -75,6 +75,32 @@ #define ERRFILE_rtl8139 ( ERRFILE_DRIVER | 0x002a0000 ) #define ERRFILE_smc9000 ( ERRFILE_DRIVER | 0x002b0000 ) #define ERRFILE_tg3 ( ERRFILE_DRIVER | 0x002c0000 ) +#define ERRFILE_3c509_eisa ( ERRFILE_DRIVER | 0x002d0000 ) +#define ERRFILE_3c515 ( ERRFILE_DRIVER | 0x002e0000 ) +#define ERRFILE_3c529 ( ERRFILE_DRIVER | 0x002f0000 ) +#define ERRFILE_3c595 ( ERRFILE_DRIVER | 0x00300000 ) +#define ERRFILE_3c5x9 ( ERRFILE_DRIVER | 0x00310000 ) +#define ERRFILE_3c90x ( ERRFILE_DRIVER | 0x00320000 ) +#define ERRFILE_amd8111e ( ERRFILE_DRIVER | 0x00330000 ) +#define ERRFILE_davicom ( ERRFILE_DRIVER | 0x00340000 ) +#define ERRFILE_depca ( ERRFILE_DRIVER | 0x00350000 ) +#define ERRFILE_dmfe ( ERRFILE_DRIVER | 0x00360000 ) +#define ERRFILE_e1000 ( ERRFILE_DRIVER | 0x00370000 ) +#define ERRFILE_eepro100 ( ERRFILE_DRIVER | 0x00380000 ) +#define ERRFILE_epic100 ( ERRFILE_DRIVER | 0x00390000 ) +#define ERRFILE_forcedeth ( ERRFILE_DRIVER | 0x003a0000 ) +#define ERRFILE_mtd80x ( ERRFILE_DRIVER | 0x003b0000 ) +#define ERRFILE_ns83820 ( ERRFILE_DRIVER | 0x003c0000 ) +#define ERRFILE_ns8390 ( ERRFILE_DRIVER | 0x003d0000 ) +#define ERRFILE_pcnet32 ( ERRFILE_DRIVER | 0x003e0000 ) +#define ERRFILE_r8169 ( ERRFILE_DRIVER | 0x003f0000 ) +#define ERRFILE_sis900 ( ERRFILE_DRIVER | 0x00400000 ) +#define ERRFILE_sundance ( ERRFILE_DRIVER | 0x00410000 ) +#define ERRFILE_tlan ( ERRFILE_DRIVER | 0x00420000 ) +#define ERRFILE_tulip ( ERRFILE_DRIVER | 0x00430000 ) +#define ERRFILE_via_rhine ( ERRFILE_DRIVER | 0x00440000 ) +#define ERRFILE_via_velocity ( ERRFILE_DRIVER | 0x00450000 ) +#define ERRFILE_w89c840 ( ERRFILE_DRIVER | 0x00460000 ) #define ERRFILE_scsi ( ERRFILE_DRIVER | 0x00700000 )