Fixing a build error when CONFIG_KERNEL_KEXEC is enabled:

make[5]: Entering directory 
'/home/bjorn/tmp/tmp-lede/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/linux-5.4.28'
  CALL    scripts/checksyscalls.sh
  CALL    scripts/atomic/check-atomics.sh
  CHK     include/generated/compile.h
  CC      arch/mips/kernel/machine_kexec.o
arch/mips/kernel/machine_kexec.c: In function 'kexec_nonboot_cpu_jump':
arch/mips/kernel/machine_kexec.c:268:27: error: 'relocate_new_kernel_size' 
undeclared (first use in this function); did you mean 
'kexec_relocate_new_kernel_end'?
      reboot_code_buffer + relocate_new_kernel_size);
                           ^~~~~~~~~~~~~~~~~~~~~~~~
                           kexec_relocate_new_kernel_end
arch/mips/kernel/machine_kexec.c:268:27: note: each undeclared identifier is 
reported only once for each function it appears in
arch/mips/kernel/machine_kexec.c: In function 'kexec_reboot':
arch/mips/kernel/machine_kexec.c:306:27: error: 'relocate_new_kernel_size' 
undeclared (first use in this function); did you mean 
'kexec_relocate_new_kernel_end'?
      reboot_code_buffer + relocate_new_kernel_size);
                           ^~~~~~~~~~~~~~~~~~~~~~~~
                           kexec_relocate_new_kernel_end
make[7]: *** [scripts/Makefile.build:266: arch/mips/kernel/machine_kexec.o] 
Error 1

Signed-off-by: Bjørn Mork <[email protected]>
---
 ...pt-command-line-parameters-from-users.patch | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git 
a/target/linux/generic/pending-5.4/330-MIPS-kexec-Accept-command-line-parameters-from-users.patch
 
b/target/linux/generic/pending-5.4/330-MIPS-kexec-Accept-command-line-parameters-from-users.patch
index a182684c16e3..2808c9532296 100644
--- 
a/target/linux/generic/pending-5.4/330-MIPS-kexec-Accept-command-line-parameters-from-users.patch
+++ 
b/target/linux/generic/pending-5.4/330-MIPS-kexec-Accept-command-line-parameters-from-users.patch
@@ -150,6 +150,24 @@ Signed-off-by: Yousong Zhou <[email protected]>
  
        if (_machine_kexec_prepare)
                return _machine_kexec_prepare(kimage);
+@@ -161,7 +265,7 @@ machine_crash_shutdown(struct pt_regs *r
+ void kexec_nonboot_cpu_jump(void)
+ {
+       local_flush_icache_range((unsigned long)relocated_kexec_smp_wait,
+-                               reboot_code_buffer + relocate_new_kernel_size);
++                               reboot_code_buffer + 
KEXEC_RELOCATE_NEW_KERNEL_SIZE);
+ 
+       relocated_kexec_smp_wait(NULL);
+ }
+@@ -199,7 +303,7 @@ void kexec_reboot(void)
+        * machine_kexec() CPU.
+        */
+       local_flush_icache_range(reboot_code_buffer,
+-                               reboot_code_buffer + relocate_new_kernel_size);
++                               reboot_code_buffer + 
KEXEC_RELOCATE_NEW_KERNEL_SIZE);
+ 
+       do_kexec = (void *)reboot_code_buffer;
+       do_kexec();
 @@ -212,10 +316,12 @@ machine_kexec(struct kimage *image)
        unsigned long *ptr;
  
-- 
2.20.1


_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to