diff options
-rw-r--r-- | arch/x86/boot/compressed/Makefile | 1 | ||||
-rw-r--r-- | arch/x86/boot/compressed/mkpiggy.c | 11 |
2 files changed, 3 insertions, 9 deletions
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile index b123b9a8f5b3..fd55a2ff3ad8 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile | |||
@@ -22,6 +22,7 @@ LDFLAGS := -m elf_$(UTS_MACHINE) | |||
22 | LDFLAGS_vmlinux := -T | 22 | LDFLAGS_vmlinux := -T |
23 | 23 | ||
24 | hostprogs-y := mkpiggy | 24 | hostprogs-y := mkpiggy |
25 | HOST_EXTRACFLAGS += -I$(srctree)/tools/include | ||
25 | 26 | ||
26 | VMLINUX_OBJS = $(obj)/vmlinux.lds $(obj)/head_$(BITS).o $(obj)/misc.o \ | 27 | VMLINUX_OBJS = $(obj)/vmlinux.lds $(obj)/head_$(BITS).o $(obj)/misc.o \ |
27 | $(obj)/string.o $(obj)/cmdline.o $(obj)/early_serial_console.o \ | 28 | $(obj)/string.o $(obj)/cmdline.o $(obj)/early_serial_console.o \ |
diff --git a/arch/x86/boot/compressed/mkpiggy.c b/arch/x86/boot/compressed/mkpiggy.c index 46a823882437..958a641483dd 100644 --- a/arch/x86/boot/compressed/mkpiggy.c +++ b/arch/x86/boot/compressed/mkpiggy.c | |||
@@ -29,14 +29,7 @@ | |||
29 | #include <stdio.h> | 29 | #include <stdio.h> |
30 | #include <string.h> | 30 | #include <string.h> |
31 | #include <inttypes.h> | 31 | #include <inttypes.h> |
32 | 32 | #include <tools/le_byteshift.h> | |
33 | static uint32_t getle32(const void *p) | ||
34 | { | ||
35 | const uint8_t *cp = p; | ||
36 | |||
37 | return (uint32_t)cp[0] + ((uint32_t)cp[1] << 8) + | ||
38 | ((uint32_t)cp[2] << 16) + ((uint32_t)cp[3] << 24); | ||
39 | } | ||
40 | 33 | ||
41 | int main(int argc, char *argv[]) | 34 | int main(int argc, char *argv[]) |
42 | { | 35 | { |
@@ -69,7 +62,7 @@ int main(int argc, char *argv[]) | |||
69 | } | 62 | } |
70 | 63 | ||
71 | ilen = ftell(f); | 64 | ilen = ftell(f); |
72 | olen = getle32(&olen); | 65 | olen = get_unaligned_le32(&olen); |
73 | fclose(f); | 66 | fclose(f); |
74 | 67 | ||
75 | /* | 68 | /* |