162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * lib/bust_spinlocks.c 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * Provides a minimal bust_spinlocks for architectures which don't 662306a36Sopenharmony_ci * have one of their own. 762306a36Sopenharmony_ci * 862306a36Sopenharmony_ci * bust_spinlocks() clears any spinlocks which would prevent oops, die(), BUG() 962306a36Sopenharmony_ci * and panic() information from reaching the user. 1062306a36Sopenharmony_ci */ 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci#include <linux/kernel.h> 1362306a36Sopenharmony_ci#include <linux/printk.h> 1462306a36Sopenharmony_ci#include <linux/spinlock.h> 1562306a36Sopenharmony_ci#include <linux/tty.h> 1662306a36Sopenharmony_ci#include <linux/wait.h> 1762306a36Sopenharmony_ci#include <linux/vt_kern.h> 1862306a36Sopenharmony_ci#include <linux/console.h> 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_civoid bust_spinlocks(int yes) 2162306a36Sopenharmony_ci{ 2262306a36Sopenharmony_ci if (yes) { 2362306a36Sopenharmony_ci ++oops_in_progress; 2462306a36Sopenharmony_ci } else { 2562306a36Sopenharmony_ci console_unblank(); 2662306a36Sopenharmony_ci if (--oops_in_progress == 0) 2762306a36Sopenharmony_ci wake_up_klogd(); 2862306a36Sopenharmony_ci } 2962306a36Sopenharmony_ci} 30