error: implicit declaration of function 'acquire_console_sem'错误解决方法
来源:互联网 发布:图像压缩算法 编辑:程序博客网 时间:2024/06/06 00:33
ubuntu12.10下编译Android4.0内核源代码
1.问题:
kernel/power/consoleearlysuspend.c:28:2: error: implicit declaration of function 'acquire_console_sem'
2.解决方法:
修改源代码根目录下kernel/power/consoleearlysuspend.c文件,将acquire_console_sem()与release_console_sem()函数分别换为console_lock()与console_unlock()函数
3.分析:
函数acquire_console_sem()与release_console_sem()用来获得和释放互斥锁console_sem;新内核下这两个函数变成console_lock()与console_unlock(),故替换之便OK.
4.附:console_lock()与console_unlock()函数位置:内核源代码根目录下kernel/printk.c文件1222行
/**
* console_lock - lock the console system for exclusive use.
*
* Acquires a lock which guarantees that the caller has
* exclusive access to the console system and the console_drivers list.
*
* Can sleep, returns nothing.
*/
void console_lock(void)
{
BUG_ON(in_interrupt());
down(&console_sem);
if (console_suspended)
return;
console_locked = 1;
console_may_schedule = 1;
}
EXPORT_SYMBOL(console_lock);
/**
* console_unlock - unlock the console system
*
* Releases the console_lock which the caller holds on the console system
* and the console driver list.
*
* While the console_lock was held, console output may have been buffered
* by printk(). If this is the case, console_unlock(); emits
* the output prior to releasing the lock.
*
* If there is output waiting for klogd, we wake it up.
*
* console_unlock(); may be called from any context.
*/
void console_unlock(void)
{
unsigned long flags;
unsigned _con_start, _log_end;
unsigned wake_klogd = 0;
if (console_suspended) {
up(&console_sem);
return;
}
console_may_schedule = 0;
for ( ; ; ) {
spin_lock_irqsave(&logbuf_lock, flags);
wake_klogd |= log_start - log_end;
if (con_start == log_end)
break; /* Nothing to print */
_con_start = con_start;
_log_end = log_end;
con_start = log_end; /* Flush */
spin_unlock(&logbuf_lock);
stop_critical_timings(); /* don't trace print latency */
call_console_drivers(_con_start, _log_end);
start_critical_timings();
local_irq_restore(flags);
}
console_locked = 0;
/* Release the exclusive_console once it is used */
if (unlikely(exclusive_console))
exclusive_console = NULL;
up(&console_sem);
spin_unlock_irqrestore(&logbuf_lock, flags);
if (wake_klogd)
wake_up_klogd();
}
EXPORT_SYMBOL(console_unlock);
- error: implicit declaration of function 'acquire_console_sem'错误解决方法
- error: implicit declaration of function '********'
- 内核error: implicit declaration of function 'irq_to_gpio' 解决方法
- ubuntu错误提示 error: implicit declaration of function ‘kmalloc’
- 出现implicit declaration of function 'h1940_latch_control错误的解决方法
- init_MUTEX 發生 implicit declaration of function error
- error: implicit declaration of function ‘luaL_register’
- error: implicit declaration of function 'kmalloc'
- error: implicit declaration of function ‘class_device_create’
- error:implicit declaration of function "irq_to_gpio"
- error: implicit declaration of function 'xxx'
- error: implicit declaration of function 'gettimeofday'
- error:implicit declaration of function 'kmalloc'
- error: implicit declaration of function ‘elv_next_request’
- implicit declaration of function 'kzalloc' 解决方法
- implicit declaration of function 'kzalloc' 解决方法
- implicit declaration of function ‘malloc’的解决方法
- implicit declaration of function 'KBUILD_STR' 错误
- Qt中自定义槽和信号的简单示例
- js_Calendar控件使用
- 关于云计算
- 阿里的新难题------导购网站让人欢喜让人忧
- 永远不要对一个外行聊你的专业之程序员那点事
- error: implicit declaration of function 'acquire_console_sem'错误解决方法
- ABAP report 切换界面查询
- android模拟器运行镜像文件
- Java日期操作
- 2.5.3 配置域名解析服务
- Citrix虚拟化最新解决方案介绍
- Open source audit plug-in for MySQL
- Linux与Unix shell编程指南(完整版)
- VMware_产品概述2012最新官方PPT文档