Skip to content

Commit

Permalink
Make purgatory a signed char buffer
Browse files Browse the repository at this point in the history
The consumer of the purgatory buffer, elf_rel_build_load()
expects a signed char buffer.

Signed-off-by: Simon Horman <[email protected]>
  • Loading branch information
horms committed Feb 2, 2010
1 parent 77ee5cf commit 3fb7c2b
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions kexec/arch/i386/kexec-bzImage.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,10 @@ int do_bzImage_load(struct kexec_info *info,
* overflow takes place while applying relocations.
*/
if (!real_mode_entry && relocatable_kernel)
elf_rel_build_load(info, &info->rhdr, (char *) purgatory, purgatory_size,
elf_rel_build_load(info, &info->rhdr, purgatory, purgatory_size,
0x3000, 0x7fffffff, -1, 0);
else
elf_rel_build_load(info, &info->rhdr, (char *) purgatory, purgatory_size,
elf_rel_build_load(info, &info->rhdr, purgatory, purgatory_size,
0x3000, 640*1024, -1, 0);
dbgprintf("Loaded purgatory at addr 0x%lx\n", info->rhdr.rel_addr);
/* The argument/parameter segment */
Expand Down
2 changes: 1 addition & 1 deletion kexec/arch/i386/kexec-elf-x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ int elf_x86_load(int argc, char **argv, const char *buf, off_t len,
/* Do we want arguments? */
if (arg_style != ARG_STYLE_NONE) {
/* Load the setup code */
elf_rel_build_load(info, &info->rhdr, (char *) purgatory, purgatory_size,
elf_rel_build_load(info, &info->rhdr, purgatory, purgatory_size,
0, ULONG_MAX, 1, 0);
}
if (arg_style == ARG_STYLE_NONE) {
Expand Down
2 changes: 1 addition & 1 deletion kexec/arch/i386/kexec-multiboot-x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ int multiboot_x86_load(int argc, char **argv, const char *buf, off_t len,
elf_exec_build_load(info, &ehdr, buf, len, 0);

/* Load the setup code */
elf_rel_build_load(info, &info->rhdr, (char *) purgatory, purgatory_size, 0,
elf_rel_build_load(info, &info->rhdr, purgatory, purgatory_size, 0,
ULONG_MAX, 1, 0);

/* The first segment will contain the multiboot headers:
Expand Down
2 changes: 1 addition & 1 deletion kexec/arch/ppc64/kexec-elf-ppc64.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ int elf_ppc64_load(int argc, char **argv, const char *buf, off_t len,
}

/* Add v2wrap to the current image */
elf_rel_build_load(info, &info->rhdr, (const char *)purgatory,
elf_rel_build_load(info, &info->rhdr, purgatory,
purgatory_size, 0, max_addr, 1, 0);

/* Add a ram-disk to the current image
Expand Down
2 changes: 1 addition & 1 deletion kexec/kexec.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ extern void arch_reuse_initrd(void);

extern int ifdown(void);

extern unsigned char purgatory[];
extern char purgatory[];
extern size_t purgatory_size;

#define BOOTLOADER "kexec"
Expand Down
2 changes: 1 addition & 1 deletion util/bin-to-hex.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ int main(int argc, char **argv)
int i;
const char *name = argv[1];
printf("#include <stddef.h>\n");
printf("const unsigned char %s[] = {\n", name);
printf("const char %s[] = {\n", name);
i = 0;
while((c = getchar()) != EOF) {
if ((i % 16) != 0) {
Expand Down

0 comments on commit 3fb7c2b

Please sign in to comment.