Blame view

lib/bust_spinlocks.c 676 Bytes
b24413180   Greg Kroah-Hartman   License cleanup: ...
1
  // SPDX-License-Identifier: GPL-2.0
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
2
3
4
  /*
   * lib/bust_spinlocks.c
   *
5b39fc049   Sergey Senozhatsky   s390: use common ...
5
6
   * Provides a minimal bust_spinlocks for architectures which don't
   * have one of their own.
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
7
8
9
10
   *
   * bust_spinlocks() clears any spinlocks which would prevent oops, die(), BUG()
   * and panic() information from reaching the user.
   */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
11
  #include <linux/kernel.h>
dc72c32e1   Frederic Weisbecker   printk: Provide a...
12
  #include <linux/printk.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
13
14
15
16
  #include <linux/spinlock.h>
  #include <linux/tty.h>
  #include <linux/wait.h>
  #include <linux/vt_kern.h>
b61312d35   Viktor Rosendahl   oops handling: en...
17
  #include <linux/console.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
18

5b39fc049   Sergey Senozhatsky   s390: use common ...
19
  void bust_spinlocks(int yes)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
20
21
  {
  	if (yes) {
004429956   Jan Beulich   handle recursive ...
22
  		++oops_in_progress;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
23
  	} else {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
24
25
26
  #ifdef CONFIG_VT
  		unblank_screen();
  #endif
b61312d35   Viktor Rosendahl   oops handling: en...
27
  		console_unblank();
004429956   Jan Beulich   handle recursive ...
28
29
  		if (--oops_in_progress == 0)
  			wake_up_klogd();
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
30
31
  	}
  }