函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\printk\printk.c Create Date:2022-07-27 11:06:41
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:sole_trylock_spinning - try to get console_lock by busy waiting* This allows to busy wait for the console_lock when the current* owner is running in specially marked sections. It means that* the current owner is running and cannot reschedule until it

函数原型:static int console_trylock_spinning(void)

返回类型:int

参数:

1711  struct task_struct * owner = NULL
1713  bool spin = false
1716  如果sole_trylock - try to lock the console system for exclusive use.* Try to acquire a lock which guarantees that the caller has exclusive* access to the console system and the console_drivers list.* returns 1 on success, and 0 on failure to acquire the lock.则返回:1
1719  printk_safe_enter_irqsave(flags)
1721  raw_spin_lock( & console_owner_lock)
1722  owner等于READ_ONCE(console_owner)
1723  waiter等于READ_ONCE(console_waiter)
1724  如果非waiterownerowner不等于当前进程
1725  WRITE_ONCE(console_waiter, true)
1726  spin = true
1728  raw_spin_unlock( & console_owner_lock)
1739  如果非spin
1740  printk_safe_exit_irqrestore(flags)
1741  返回:0
1745  spin_acquire( & console_owner_dep_map, 0, 0, _THIS_IP_)
1747 READ_ONCE(console_waiter)循环
1748  cpu_relax()
1749  spin_release( & console_owner_dep_map, _THIS_IP_)
1751  printk_safe_exit_irqrestore(flags)
1758  mutex_acquire( & console_lock_dep_map, 0, 1, _THIS_IP_)
1760  返回:1
调用者
名称描述
vprintk_emit