diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/x86/boot/compressed/mkpiggy.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'arch/x86/boot/compressed/mkpiggy.c')
-rw-r--r-- | arch/x86/boot/compressed/mkpiggy.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/x86/boot/compressed/mkpiggy.c b/arch/x86/boot/compressed/mkpiggy.c index 5c228129d175..46a823882437 100644 --- a/arch/x86/boot/compressed/mkpiggy.c +++ b/arch/x86/boot/compressed/mkpiggy.c | |||
@@ -62,7 +62,12 @@ int main(int argc, char *argv[]) | |||
62 | if (fseek(f, -4L, SEEK_END)) { | 62 | if (fseek(f, -4L, SEEK_END)) { |
63 | perror(argv[1]); | 63 | perror(argv[1]); |
64 | } | 64 | } |
65 | fread(&olen, sizeof olen, 1, f); | 65 | |
66 | if (fread(&olen, sizeof(olen), 1, f) != 1) { | ||
67 | perror(argv[1]); | ||
68 | return 1; | ||
69 | } | ||
70 | |||
66 | ilen = ftell(f); | 71 | ilen = ftell(f); |
67 | olen = getle32(&olen); | 72 | olen = getle32(&olen); |
68 | fclose(f); | 73 | fclose(f); |
@@ -74,7 +79,7 @@ int main(int argc, char *argv[]) | |||
74 | 79 | ||
75 | offs = (olen > ilen) ? olen - ilen : 0; | 80 | offs = (olen > ilen) ? olen - ilen : 0; |
76 | offs += olen >> 12; /* Add 8 bytes for each 32K block */ | 81 | offs += olen >> 12; /* Add 8 bytes for each 32K block */ |
77 | offs += 32*1024 + 18; /* Add 32K + 18 bytes slack */ | 82 | offs += 64*1024 + 128; /* Add 64K + 128 bytes slack */ |
78 | offs = (offs+4095) & ~4095; /* Round to a 4K boundary */ | 83 | offs = (offs+4095) & ~4095; /* Round to a 4K boundary */ |
79 | 84 | ||
80 | printf(".section \".rodata..compressed\",\"a\",@progbits\n"); | 85 | printf(".section \".rodata..compressed\",\"a\",@progbits\n"); |