From e252a1492ca6f9830c98106d3c3ae7917446fadc Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Tue, 29 Jan 2013 09:44:58 +0000 Subject: [PATCH] generic: fix build failure in MIPS kexec code if SMP is enabled Fix it for older kernels as well. Signed-off-by: Gabor Juhos SVN-Revision: 35366 --- .../331-mips-kexec-enhanche-the-support.patch | 14 ++++++-------- ...it-the-arguments-for-the-new-kernel-image.patch | 2 +- ...ec-get-kernel-parameters-from-kexec-tools.patch | 8 ++++---- ...ec-cleanup-kexec-tools-parameter-handling.patch | 6 +++--- .../331-mips-kexec-enhanche-the-support.patch | 14 ++++++-------- ...it-the-arguments-for-the-new-kernel-image.patch | 2 +- ...ec-get-kernel-parameters-from-kexec-tools.patch | 8 ++++---- ...ec-cleanup-kexec-tools-parameter-handling.patch | 6 +++--- 8 files changed, 28 insertions(+), 32 deletions(-) diff --git a/target/linux/generic/patches-3.3/331-mips-kexec-enhanche-the-support.patch b/target/linux/generic/patches-3.3/331-mips-kexec-enhanche-the-support.patch index 5ffc2e29bd..21bbeed554 100644 --- a/target/linux/generic/patches-3.3/331-mips-kexec-enhanche-the-support.patch +++ b/target/linux/generic/patches-3.3/331-mips-kexec-enhanche-the-support.patch @@ -57,20 +57,18 @@ Signed-off-by: Wu Zhangjin extern int (*_machine_kexec_prepare)(struct kimage *); --- a/arch/mips/kernel/machine_kexec.c +++ b/arch/mips/kernel/machine_kexec.c -@@ -13,12 +13,6 @@ - #include +@@ -14,10 +14,6 @@ #include --extern const unsigned char relocate_new_kernel[]; + extern const unsigned char relocate_new_kernel[]; -extern const size_t relocate_new_kernel_size; - -extern unsigned long kexec_start_address; -extern unsigned long kexec_indirection_page; -- + int (*_machine_kexec_prepare)(struct kimage *) = NULL; void (*_machine_kexec_shutdown)(void) = NULL; - void (*_machine_crash_shutdown)(struct pt_regs *regs) = NULL; -@@ -61,21 +55,34 @@ typedef void (*noretfun_t)(void) __attri +@@ -61,21 +57,34 @@ typedef void (*noretfun_t)(void) __attri void machine_kexec(struct kimage *image) { @@ -107,7 +105,7 @@ Signed-off-by: Wu Zhangjin /* * The generic kexec code builds a page list with physical -@@ -96,8 +103,8 @@ machine_kexec(struct kimage *image) +@@ -96,8 +105,8 @@ machine_kexec(struct kimage *image) */ local_irq_disable(); @@ -118,7 +116,7 @@ Signed-off-by: Wu Zhangjin __flush_cache_all(); #ifdef CONFIG_SMP /* All secondary cpus now may jump to kexec_wait cycle */ -@@ -108,4 +115,3 @@ machine_kexec(struct kimage *image) +@@ -108,4 +117,3 @@ machine_kexec(struct kimage *image) #endif ((noretfun_t) reboot_code_buffer)(); } diff --git a/target/linux/generic/patches-3.3/332-mips-kexec-init-the-arguments-for-the-new-kernel-image.patch b/target/linux/generic/patches-3.3/332-mips-kexec-init-the-arguments-for-the-new-kernel-image.patch index 5507dde64d..07d0af9e71 100644 --- a/target/linux/generic/patches-3.3/332-mips-kexec-init-the-arguments-for-the-new-kernel-image.patch +++ b/target/linux/generic/patches-3.3/332-mips-kexec-init-the-arguments-for-the-new-kernel-image.patch @@ -19,7 +19,7 @@ Signed-off-by: Wu Zhangjin #include #include -@@ -21,9 +22,30 @@ void (*relocated_kexec_smp_wait) (void * +@@ -23,9 +24,30 @@ void (*relocated_kexec_smp_wait) (void * atomic_t kexec_ready_to_reboot = ATOMIC_INIT(0); #endif diff --git a/target/linux/generic/patches-3.3/333-mips-kexec-get-kernel-parameters-from-kexec-tools.patch b/target/linux/generic/patches-3.3/333-mips-kexec-get-kernel-parameters-from-kexec-tools.patch index 9da936314c..44380dae6f 100644 --- a/target/linux/generic/patches-3.3/333-mips-kexec-get-kernel-parameters-from-kexec-tools.patch +++ b/target/linux/generic/patches-3.3/333-mips-kexec-get-kernel-parameters-from-kexec-tools.patch @@ -19,9 +19,9 @@ Signed-off-by: Wu Zhangjin #include +#include - int (*_machine_kexec_prepare)(struct kimage *) = NULL; - void (*_machine_kexec_shutdown)(void) = NULL; -@@ -35,6 +36,56 @@ static void machine_kexec_init_args(void + extern const unsigned char relocate_new_kernel[]; + +@@ -37,6 +38,56 @@ static void machine_kexec_init_args(void pr_info("kexec_args[3] (desc): %p\n", (void *)kexec_args[3]); } @@ -78,7 +78,7 @@ Signed-off-by: Wu Zhangjin int machine_kexec_prepare(struct kimage *kimage) { -@@ -45,6 +96,7 @@ machine_kexec_prepare(struct kimage *kim +@@ -47,6 +98,7 @@ machine_kexec_prepare(struct kimage *kim * This can be overrided by _machine_kexec_prepare(). */ machine_kexec_init_args(); diff --git a/target/linux/generic/patches-3.3/335-mips-kexec-cleanup-kexec-tools-parameter-handling.patch b/target/linux/generic/patches-3.3/335-mips-kexec-cleanup-kexec-tools-parameter-handling.patch index f7a8eed000..e0a1103eb6 100644 --- a/target/linux/generic/patches-3.3/335-mips-kexec-cleanup-kexec-tools-parameter-handling.patch +++ b/target/linux/generic/patches-3.3/335-mips-kexec-cleanup-kexec-tools-parameter-handling.patch @@ -1,6 +1,6 @@ --- a/arch/mips/kernel/machine_kexec.c +++ b/arch/mips/kernel/machine_kexec.c -@@ -23,67 +23,104 @@ void (*relocated_kexec_smp_wait) (void * +@@ -25,67 +25,104 @@ void (*relocated_kexec_smp_wait) (void * atomic_t kexec_ready_to_reboot = ATOMIC_INIT(0); #endif @@ -151,7 +151,7 @@ } int -@@ -95,8 +132,14 @@ machine_kexec_prepare(struct kimage *kim +@@ -97,8 +134,14 @@ machine_kexec_prepare(struct kimage *kim * * This can be overrided by _machine_kexec_prepare(). */ @@ -168,7 +168,7 @@ if (_machine_kexec_prepare) return _machine_kexec_prepare(kimage); -@@ -152,11 +195,13 @@ machine_kexec(struct kimage *image) +@@ -154,11 +197,13 @@ machine_kexec(struct kimage *image) pr_info("kexec_indirection_page = %p\n", (void *)kexec_indirection_page); diff --git a/target/linux/generic/patches-3.6/331-mips-kexec-enhanche-the-support.patch b/target/linux/generic/patches-3.6/331-mips-kexec-enhanche-the-support.patch index c98fc24a47..eff28f3103 100644 --- a/target/linux/generic/patches-3.6/331-mips-kexec-enhanche-the-support.patch +++ b/target/linux/generic/patches-3.6/331-mips-kexec-enhanche-the-support.patch @@ -57,20 +57,18 @@ Signed-off-by: Wu Zhangjin extern int (*_machine_kexec_prepare)(struct kimage *); --- a/arch/mips/kernel/machine_kexec.c +++ b/arch/mips/kernel/machine_kexec.c -@@ -13,12 +13,6 @@ - #include +@@ -14,10 +14,6 @@ #include --extern const unsigned char relocate_new_kernel[]; + extern const unsigned char relocate_new_kernel[]; -extern const size_t relocate_new_kernel_size; - -extern unsigned long kexec_start_address; -extern unsigned long kexec_indirection_page; -- + int (*_machine_kexec_prepare)(struct kimage *) = NULL; void (*_machine_kexec_shutdown)(void) = NULL; - void (*_machine_crash_shutdown)(struct pt_regs *regs) = NULL; -@@ -61,21 +55,34 @@ typedef void (*noretfun_t)(void) __attri +@@ -61,21 +57,34 @@ typedef void (*noretfun_t)(void) __attri void machine_kexec(struct kimage *image) { @@ -107,7 +105,7 @@ Signed-off-by: Wu Zhangjin /* * The generic kexec code builds a page list with physical -@@ -96,8 +103,8 @@ machine_kexec(struct kimage *image) +@@ -96,8 +105,8 @@ machine_kexec(struct kimage *image) */ local_irq_disable(); @@ -118,7 +116,7 @@ Signed-off-by: Wu Zhangjin __flush_cache_all(); #ifdef CONFIG_SMP /* All secondary cpus now may jump to kexec_wait cycle */ -@@ -108,4 +115,3 @@ machine_kexec(struct kimage *image) +@@ -108,4 +117,3 @@ machine_kexec(struct kimage *image) #endif ((noretfun_t) reboot_code_buffer)(); } diff --git a/target/linux/generic/patches-3.6/332-mips-kexec-init-the-arguments-for-the-new-kernel-image.patch b/target/linux/generic/patches-3.6/332-mips-kexec-init-the-arguments-for-the-new-kernel-image.patch index 5507dde64d..07d0af9e71 100644 --- a/target/linux/generic/patches-3.6/332-mips-kexec-init-the-arguments-for-the-new-kernel-image.patch +++ b/target/linux/generic/patches-3.6/332-mips-kexec-init-the-arguments-for-the-new-kernel-image.patch @@ -19,7 +19,7 @@ Signed-off-by: Wu Zhangjin #include #include -@@ -21,9 +22,30 @@ void (*relocated_kexec_smp_wait) (void * +@@ -23,9 +24,30 @@ void (*relocated_kexec_smp_wait) (void * atomic_t kexec_ready_to_reboot = ATOMIC_INIT(0); #endif diff --git a/target/linux/generic/patches-3.6/333-mips-kexec-get-kernel-parameters-from-kexec-tools.patch b/target/linux/generic/patches-3.6/333-mips-kexec-get-kernel-parameters-from-kexec-tools.patch index 9da936314c..44380dae6f 100644 --- a/target/linux/generic/patches-3.6/333-mips-kexec-get-kernel-parameters-from-kexec-tools.patch +++ b/target/linux/generic/patches-3.6/333-mips-kexec-get-kernel-parameters-from-kexec-tools.patch @@ -19,9 +19,9 @@ Signed-off-by: Wu Zhangjin #include +#include - int (*_machine_kexec_prepare)(struct kimage *) = NULL; - void (*_machine_kexec_shutdown)(void) = NULL; -@@ -35,6 +36,56 @@ static void machine_kexec_init_args(void + extern const unsigned char relocate_new_kernel[]; + +@@ -37,6 +38,56 @@ static void machine_kexec_init_args(void pr_info("kexec_args[3] (desc): %p\n", (void *)kexec_args[3]); } @@ -78,7 +78,7 @@ Signed-off-by: Wu Zhangjin int machine_kexec_prepare(struct kimage *kimage) { -@@ -45,6 +96,7 @@ machine_kexec_prepare(struct kimage *kim +@@ -47,6 +98,7 @@ machine_kexec_prepare(struct kimage *kim * This can be overrided by _machine_kexec_prepare(). */ machine_kexec_init_args(); diff --git a/target/linux/generic/patches-3.6/335-mips-kexec-cleanup-kexec-tools-parameter-handling.patch b/target/linux/generic/patches-3.6/335-mips-kexec-cleanup-kexec-tools-parameter-handling.patch index f7a8eed000..e0a1103eb6 100644 --- a/target/linux/generic/patches-3.6/335-mips-kexec-cleanup-kexec-tools-parameter-handling.patch +++ b/target/linux/generic/patches-3.6/335-mips-kexec-cleanup-kexec-tools-parameter-handling.patch @@ -1,6 +1,6 @@ --- a/arch/mips/kernel/machine_kexec.c +++ b/arch/mips/kernel/machine_kexec.c -@@ -23,67 +23,104 @@ void (*relocated_kexec_smp_wait) (void * +@@ -25,67 +25,104 @@ void (*relocated_kexec_smp_wait) (void * atomic_t kexec_ready_to_reboot = ATOMIC_INIT(0); #endif @@ -151,7 +151,7 @@ } int -@@ -95,8 +132,14 @@ machine_kexec_prepare(struct kimage *kim +@@ -97,8 +134,14 @@ machine_kexec_prepare(struct kimage *kim * * This can be overrided by _machine_kexec_prepare(). */ @@ -168,7 +168,7 @@ if (_machine_kexec_prepare) return _machine_kexec_prepare(kimage); -@@ -152,11 +195,13 @@ machine_kexec(struct kimage *image) +@@ -154,11 +197,13 @@ machine_kexec(struct kimage *image) pr_info("kexec_indirection_page = %p\n", (void *)kexec_indirection_page); -- 2.30.2