Signed-off-by: Ian Campbell <ijc@xxxxxxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: H. Peter Anvin <hpa@xxxxxxxxx>
---
Documentation/i386/boot.txt | 7 +++
arch/x86/boot/tools/build.c | 88 ++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 94 insertions(+), 1 deletions(-)
diff --git a/Documentation/i386/boot.txt b/Documentation/i386/boot.txt
index b5f5ba1..b567fb5 100644
--- a/Documentation/i386/boot.txt
+++ b/Documentation/i386/boot.txt
@@ -531,6 +531,13 @@ Protocol: 2.08+
The length of the compressed payload.
+**** THE IMAGE CHECKSUM
+
+The CRC-32 is calculated over the entire file using an initial
+remainder of 0xffffffff. The checksum is appended to the file;
+therefore the CRC of the file up to the limit specified in the syssize
+field of the header is always 0.
+
**** THE KERNEL COMMAND LINE
The kernel command line has become an important way for the boot
diff --git a/arch/x86/boot/tools/build.c b/arch/x86/boot/tools/build.c
index b424874..2ba22e8 100644
--- a/arch/x86/boot/tools/build.c
+++ b/arch/x86/boot/tools/build.c
@@ -50,6 +50,75 @@ typedef unsigned long u32;
u8 buf[SETUP_SECT_MAX*512];
int is_big_kernel;
+/*----------------------------------------------------------------------*/
+
+static const unsigned int crctab32[] = {
+ 0x00000000U, 0x77073096U, 0xee0e612cU, 0x990951baU, 0x076dc419U,