[Feature][ZXW-452]merge P54U02 version
Only Configure: No
Affected branch: master
Affected module: unknow
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No
Change-Id: I17e6795ab66e2b9d1cbbfec4b7c0028d666e177d
diff --git a/ap/os/linux/linux-3.4.x/kernel/exit.c b/ap/os/linux/linux-3.4.x/kernel/exit.c
old mode 100644
new mode 100755
index 320ab35..c2fbc09
--- a/ap/os/linux/linux-3.4.x/kernel/exit.c
+++ b/ap/os/linux/linux-3.4.x/kernel/exit.c
@@ -59,6 +59,11 @@
#include <asm/pgtable.h>
#include <asm/mmu_context.h>
+#ifdef CONFIG_FLAGS_UTILS
+#include <linux/reboot.h>
+#include "pub_flags.h"
+#endif
+
static void exit_mm(struct task_struct * tsk);
static void __unhash_process(struct task_struct *p, bool group_dead)
@@ -714,6 +719,16 @@
if (unlikely(pid_ns->child_reaper == father)) {
write_unlock_irq(&tasklist_lock);
if (unlikely(pid_ns == &init_pid_ns)) {
+#ifdef CONFIG_FLAGS_UTILS
+ extern int flags_sys_switch(void);
+ printk(KERN_EMERG "Attempted to kill init! exitcode=0x%08x\n",
+ father->signal->group_exit_code ?:
+ father->exit_code);
+ if (flags_sys_switch() < 0)
+ panic("init: flags_sys_switch fail");
+ else
+ kernel_restart("init: Switch to another system, please reset machine");
+#endif
panic("Attempted to kill init! exitcode=0x%08x\n",
father->signal->group_exit_code ?:
father->exit_code);