我发现 clk_get_rate() 返回当前频率,但是有没有任何函数或方法可以找出 Linux 内核空间支持的最大频率?
我正在用ISO C90编写代码,它禁止混合声明和代码.所以我有这样的事情:
int function(int something)
{
int foo, ret;
int bar = function_to_get_bar();
some_typedef_t foobar = get_this_guy(something);
spin_lock_irqsave(lock);
/*
Here is code that does a lot of things
*/
spin_unlock_irqrestore(lock);
return ret;
}
Run Code Online (Sandbox Code Playgroud)
问题是硬件或软件中断是否发生,它可以在哪个地方中断我的功能,它是否也可以在变量声明中发生?
为什么我问这是因为我需要这个函数不被中断打断.我想使用spin_lock_irqsave()来确保,但我想知道中断是否可以在变量声明中中断我的函数?