1 From 940c3a1e1a304fbecc850c593a272215b0f52eab Mon Sep 17 00:00:00 2001
2 From: Kairui Song <kasong@redhat.com>
3 Date: Wed, 31 Jul 2019 16:30:47 +0800
4 Subject: [PATCH] x86: Fix broken multiboot2 buliding for i386
6 When building for i386, an error occured:
8 kexec/arch/i386/kexec-x86.c:39:22: error: 'multiboot2_x86_probe'
9 undeclared here (not in a function); did you mean 'multiboot_x86_probe'?
10 39 | { "multiboot2-x86", multiboot2_x86_probe, multiboot2_x86_load,
11 | ^~~~~~~~~~~~~~~~~~~~
14 kexec/arch/i386/kexec-x86.c:39:44: error: 'multiboot2_x86_load'
15 undeclared here (not in a function); did you mean 'multiboot_x86_load'?
16 39 | { "multiboot2-x86", multiboot2_x86_probe, multiboot2_x86_load,
19 kexec/arch/i386/kexec-x86.c:40:4: error: 'multiboot2_x86_usage'
20 undeclared here (not in a function); did you mean 'multiboot_x86_usage'?
21 40 | multiboot2_x86_usage },
22 | ^~~~~~~~~~~~~~~~~~~~
25 Fix this issue by putting the definition in the right header, also tidy
28 Fixes: 22a2ed55132e ("x86: Support multiboot2 images")
29 Signed-off-by: Kairui Song <kasong@redhat.com>
31 kexec/arch/i386/Makefile | 2 +-
32 kexec/arch/i386/kexec-x86.h | 5 +++++
33 kexec/arch/x86_64/kexec-x86_64.h | 5 -----
34 3 files changed, 6 insertions(+), 6 deletions(-)
36 diff --git a/kexec/arch/i386/Makefile b/kexec/arch/i386/Makefile
37 index 105cefd..f486103 100644
38 --- a/kexec/arch/i386/Makefile
39 +++ b/kexec/arch/i386/Makefile
40 @@ -7,6 +7,7 @@ i386_KEXEC_SRCS += kexec/arch/i386/kexec-elf-x86.c
41 i386_KEXEC_SRCS += kexec/arch/i386/kexec-elf-rel-x86.c
42 i386_KEXEC_SRCS += kexec/arch/i386/kexec-bzImage.c
43 i386_KEXEC_SRCS += kexec/arch/i386/kexec-multiboot-x86.c
44 +i386_KEXEC_SRCS += kexec/arch/i386/kexec-mb2-x86.c
45 i386_KEXEC_SRCS += kexec/arch/i386/kexec-beoboot-x86.c
46 i386_KEXEC_SRCS += kexec/arch/i386/kexec-nbi.c
47 i386_KEXEC_SRCS += kexec/arch/i386/x86-linux-setup.c
48 @@ -14,7 +15,6 @@ i386_KEXEC_SRCS += kexec/arch/i386/crashdump-x86.c
50 dist += kexec/arch/i386/Makefile $(i386_KEXEC_SRCS) \
51 kexec/arch/i386/crashdump-x86.h \
52 - kexec/arch/i386/kexec-mb2-x86.c \
53 kexec/arch/i386/kexec-x86.h \
54 kexec/arch/i386/x86-linux-setup.h \
55 kexec/arch/i386/include/arch/options.h
56 diff --git a/kexec/arch/i386/kexec-x86.h b/kexec/arch/i386/kexec-x86.h
57 index 1b58c3b..16d0f6c 100644
58 --- a/kexec/arch/i386/kexec-x86.h
59 +++ b/kexec/arch/i386/kexec-x86.h
60 @@ -60,6 +60,11 @@ int multiboot_x86_load(int argc, char **argv, const char *buf, off_t len,
61 struct kexec_info *info);
62 void multiboot_x86_usage(void);
64 +int multiboot2_x86_load(int argc, char **argv, const char *buf, off_t len,
65 + struct kexec_info *info);
66 +void multiboot2_x86_usage(void);
67 +int multiboot2_x86_probe(const char *buf, off_t buf_len);
69 int elf_x86_probe(const char *buf, off_t len);
70 int elf_x86_load(int argc, char **argv, const char *buf, off_t len,
71 struct kexec_info *info);
72 diff --git a/kexec/arch/x86_64/kexec-x86_64.h b/kexec/arch/x86_64/kexec-x86_64.h
73 index 21c3a73..4cdeffb 100644
74 --- a/kexec/arch/x86_64/kexec-x86_64.h
75 +++ b/kexec/arch/x86_64/kexec-x86_64.h
76 @@ -33,9 +33,4 @@ int bzImage64_load(int argc, char **argv, const char *buf, off_t len,
77 struct kexec_info *info);
78 void bzImage64_usage(void);
80 -int multiboot2_x86_load(int argc, char **argv, const char *buf, off_t len,
81 - struct kexec_info *info);
82 -void multiboot2_x86_usage(void);
83 -int multiboot2_x86_probe(const char *buf, off_t buf_len);
85 #endif /* KEXEC_X86_64_H */