Skip to content

Commit 7c90347

Browse files
ebiedermLinus Torvalds
authored andcommitted
[PATCH] Add emergency_restart()
When the kernel is working well and we want to restart cleanly kernel_restart is the function to use. But in many instances the kernel wants to reboot when thing are expected to be working very badly such as from panic or a software watchdog handler. This patch adds the function emergency_restart() so that callers can be clear what semantics they expect when calling restart. emergency_restart() is expected to be callable from interrupt context and possibly reliable in even more trying circumstances. This is an initial generic implementation for all architectures. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent abcd9e5 commit 7c90347

27 files changed

Lines changed: 166 additions & 0 deletions
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef _ASM_EMERGENCY_RESTART_H
2+
#define _ASM_EMERGENCY_RESTART_H
3+
4+
#include <asm-generic/emergency-restart.h>
5+
6+
#endif /* _ASM_EMERGENCY_RESTART_H */
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef _ASM_EMERGENCY_RESTART_H
2+
#define _ASM_EMERGENCY_RESTART_H
3+
4+
#include <asm-generic/emergency-restart.h>
5+
6+
#endif /* _ASM_EMERGENCY_RESTART_H */
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef _ASM_EMERGENCY_RESTART_H
2+
#define _ASM_EMERGENCY_RESTART_H
3+
4+
#include <asm-generic/emergency-restart.h>
5+
6+
#endif /* _ASM_EMERGENCY_RESTART_H */
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef _ASM_EMERGENCY_RESTART_H
2+
#define _ASM_EMERGENCY_RESTART_H
3+
4+
#include <asm-generic/emergency-restart.h>
5+
6+
#endif /* _ASM_EMERGENCY_RESTART_H */
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef _ASM_EMERGENCY_RESTART_H
2+
#define _ASM_EMERGENCY_RESTART_H
3+
4+
#include <asm-generic/emergency-restart.h>
5+
6+
#endif /* _ASM_EMERGENCY_RESTART_H */
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#ifndef _ASM_GENERIC_EMERGENCY_RESTART_H
2+
#define _ASM_GENERIC_EMERGENCY_RESTART_H
3+
4+
static inline void machine_emergency_restart(void)
5+
{
6+
machine_restart(NULL);
7+
}
8+
9+
#endif /* _ASM_GENERIC_EMERGENCY_RESTART_H */
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef _ASM_EMERGENCY_RESTART_H
2+
#define _ASM_EMERGENCY_RESTART_H
3+
4+
#include <asm-generic/emergency-restart.h>
5+
6+
#endif /* _ASM_EMERGENCY_RESTART_H */
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef _ASM_EMERGENCY_RESTART_H
2+
#define _ASM_EMERGENCY_RESTART_H
3+
4+
#include <asm-generic/emergency-restart.h>
5+
6+
#endif /* _ASM_EMERGENCY_RESTART_H */
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef _ASM_EMERGENCY_RESTART_H
2+
#define _ASM_EMERGENCY_RESTART_H
3+
4+
#include <asm-generic/emergency-restart.h>
5+
6+
#endif /* _ASM_EMERGENCY_RESTART_H */
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef _ASM_EMERGENCY_RESTART_H
2+
#define _ASM_EMERGENCY_RESTART_H
3+
4+
#include <asm-generic/emergency-restart.h>
5+
6+
#endif /* _ASM_EMERGENCY_RESTART_H */

0 commit comments

Comments
 (0)