bust_spinlocks.c 931 B

123456789101112131415161718192021222324252627282930313233343536373839
  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/config.h>
  10. #include <linux/kernel.h>
  11. #include <linux/spinlock.h>
  12. #include <linux/tty.h>
  13. #include <linux/wait.h>
  14. #include <linux/vt_kern.h>
  15. void bust_spinlocks(int yes)
  16. {
  17. if (yes) {
  18. oops_in_progress = 1;
  19. } else {
  20. int loglevel_save = console_loglevel;
  21. #ifdef CONFIG_VT
  22. unblank_screen();
  23. #endif
  24. oops_in_progress = 0;
  25. /*
  26. * OK, the message is on the console. Now we call printk()
  27. * without oops_in_progress set so that printk() will give klogd
  28. * and the blanked console a poke. Hold onto your hats...
  29. */
  30. console_loglevel = 15; /* NMI oopser may have shut the console up */
  31. printk(" ");
  32. console_loglevel = loglevel_save;
  33. }
  34. }