- 博客(13)
- 资源 (9)
- 收藏
- 关注
原创 EXPORT_SYMBOL 与 extern的区别
这两种方法都可以让被 修饰的函数 能被内核其他程序调用。简单地说说区别,EXPORT_SYMBOL是通过宏,建立一个新的这个函数的入口,包括它址,名称。这个函数会被放到kernel image的__ksymtab section中。当用到这个函数的模块在runtime时被加载的时候,loader就会从__ksymtab section解析这个函数。extern 是将 非
2012-08-31 15:16:35 3693
转载 宏(#define),枚举型(enum)和const常量
源出处:http://eetimes.com/discussion/programming-pointers/4023858/Symbolic-ConstantsThere's more than one way to define symbolic constants in C and C++. It helps to know what all of your choices
2012-08-23 15:39:32 2954
原创 【整理】struct device的初始化
/** * struct device - The basic device structure * @parent: The device's "parent" device, the device to which it is attached. * In most cases, a parent device is some sort of bu
2012-08-17 15:11:24 1777
原创 英语写作, 句子
support...so that...be adequately served... 例句:A single chip package(SCP) is a package that supports a single microelectronic device so that its electrical, mechanical, thermal, and chemical p
2012-08-16 09:03:29 1051
原创 自旋锁使用的注意点
1. 自旋锁保护的临界区里,不能有引起睡眠的函数,如kmalloc,copy_from_user等。 因为如果某进(线)程获得锁并进入了临界区,但它却在临界区里睡着了,那么别的需要这把锁的进(线)程将可能要等待一段很久的时间,最坏的情况是死锁。 所以,在自旋锁里的临界区代码应是原子性的,不可睡眠的。2. 在LDD3里说到这样的一种情况: 在单CPU环境里,如果某进(线)程获
2012-08-14 11:27:01 1473
转载 解析Linux内核的同步与互斥机制(七)
源出处:http://www.startos.com/linux/tips/2011011921499_7.html5.3 手工休眠的具体函数执行流 特殊睡眠要求程序员手动处理所有上面的步骤. 它是一个繁琐的过程, 包含相当多的易出错的样板式的代码. 程序员如果愿意还是可能用那种方式手动睡眠。 (1)创建和初始化一个等待队列。常由宏定义完成: DEFINE_
2012-08-10 15:11:49 1755
转载 解析Linux内核的同步与互斥机制(六)
源出处: http://www.startos.com/linux/tips/2011011921499_6.html4.2 wake_up 的实现细节 \kernel \sched.c /* * The core wakeup function. Non-exclusive wakeups (nr_exclusive == 0) just
2012-08-10 15:10:57 1802
转载 解析Linux内核的同步与互斥机制(五)
源出处:http://www.startos.com/linux/tips/2011011921499_5.html/** * wait_event_interruptible - sleep until a condition gets true * @wq: the waitqueue to wait on * @condition: a C expres
2012-08-10 15:09:48 886
转载 解析Linux内核的同步与互斥机制(四)
源出处:http://www.startos.com/linux/tips/2011011921499_4.html2.3.3 prepare_to_wait和finish_wait /* * Used to distinguish between sync and async io wait context: * sync i/o typical
2012-08-10 15:08:50 1215
转载 解析Linux内核的同步与互斥机制(三)
源出处:http://www.startos.com/linux/tips/2011011921499_3.html在决定调用sleep_on系列函数到真正调用schedule系列函数期间,若等待的条件为真,若此时继续schedule,相当于丢失了一次唤醒机会。因此sleep_on系列函数会引入竞态,导致系统的不安全。 另外对于interruptible系列函数,其返
2012-08-10 15:08:06 1507
转载 解析Linux内核的同步与互斥机制(二)
源出处:http://www.startos.com/linux/tips/2011011921499_2.html全局或者在栈中定义一个wait_queue_t类型变量的同时对其初始化,这保证了系统的可靠性,避免因用户忘记初始化时导致的问题。通用的初始化宏,tsk为任意指针。分两步: 1) 内部宏__WAITQUEUE_INITIALIZER初始化相应成员;当wq内嵌在别的结构
2012-08-10 15:07:21 1433
转载 解析Linux内核的同步与互斥机制(一)
源出处:http://www.startos.com/linux/tips/2011011921499.html1 休眠与同步 一个驱动当它无法立刻满足请求应当如何响应? 一个对 read 的调用可能当没有数据时到来, 而以后会期待更多的数据。或者一个进程可能试图写, 但是你的设备没有准备好接受数据, 因为你的输出缓冲满了。调用进程往往不关心这种问题; 程序员只希望调用 read
2012-08-10 15:06:25 942
原创 linux内核常用头文件作用简介
与framebuffer相关的宏定义如FB_EVENT_BLANK, extern一些常用的函数如fb_blank(), 结构体定义如 struct fb_fix_screeninfo,fb_var_screeninfo 定义了一些用于判断某一个字符是否为大写字母、小写字母、数字、控制字符、标点符号等宏,如,isdigit(c)判定参数c是否为数字,此外还有大小写转换宏,如tolower(c)
2012-08-10 13:42:55 5328
Principles of mobile communication second edition
2008-10-09
数字信号处理 原理 算法 与应用
2008-09-30
NeXt generation/dynamic spectrum access/cognitive radio wireless networks
2008-09-20
计算机程序设计艺术(第二卷)
2008-09-16
数字通信—基础与应用 答案
2008-09-15
WIRELESS COMMUNICATIONS
2008-09-09
数字通信—基础与应用(第二版)
2008-09-02
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人