bust_spinlocks.c 696 B

123456789101112131415161718192021222324252627282930313233
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * lib/bust_spinlocks.c
  4. *
  5. * Provides a minimal bust_spinlocks for architectures which don't have one of their own.
  6. *
  7. * bust_spinlocks() clears any spinlocks which would prevent oops, die(), BUG()
  8. * and panic() information from reaching the user.
  9. */
  10. #include <linux/kernel.h>
  11. #include <linux/printk.h>
  12. #include <linux/spinlock.h>
  13. #include <linux/tty.h>
  14. #include <linux/wait.h>
  15. #include <linux/vt_kern.h>
  16. #include <linux/console.h>
  17. void __attribute__((weak)) bust_spinlocks(int yes)
  18. {
  19. if (yes) {
  20. ++oops_in_progress;
  21. } else {
  22. #ifdef CONFIG_VT
  23. unblank_screen();
  24. #endif
  25. console_unblank();
  26. if (--oops_in_progress == 0)
  27. wake_up_klogd();
  28. }
  29. }