bust_spinlocks.c 905 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * lib/bust_spinlocks.c
  3. *
  4. * Provides a minimal bust_spinlocks for architectures which don't have one of their own.
  5. *
  6. * bust_spinlocks() clears any spinlocks which would prevent oops, die(), BUG()
  7. * and panic() information from reaching the user.
  8. */
  9. #include <linux/kernel.h>
  10. #include <linux/spinlock.h>
  11. #include <linux/tty.h>
  12. #include <linux/wait.h>
  13. #include <linux/vt_kern.h>
  14. void bust_spinlocks(int yes)
  15. {
  16. if (yes) {
  17. oops_in_progress = 1;
  18. } else {
  19. int loglevel_save = console_loglevel;
  20. #ifdef CONFIG_VT
  21. unblank_screen();
  22. #endif
  23. oops_in_progress = 0;
  24. /*
  25. * OK, the message is on the console. Now we call printk()
  26. * without oops_in_progress set so that printk() will give klogd
  27. * and the blanked console a poke. Hold onto your hats...
  28. */
  29. console_loglevel = 15; /* NMI oopser may have shut the console up */
  30. printk(" ");
  31. console_loglevel = loglevel_save;
  32. }
  33. }