linux tasklet
http://blog.chinaunix.net/u/24474/showart_227121.html
驱动程序使用tasklet机制
转自:http://blog.chinaunix.net/u/15169/showart.php?id=82989
驱
动程序在初始化时,通过函数task_init建立一个tasklet,然后调用函数tasklet_schedule将这个tasklet放在
tasklet_vec链表的头部,并唤醒后台线程ksoftirqd。当后台线程ksoftirqd运行调用__do_softirq时,会执行在中断
向量表softirq_vec里中断号TASKLET_SOFTIRQ对应的tasklet_action函数,然后tasklet_action遍历
tasklet_vec链表,调用每个tasklet的函数完成软中断操作。
下面对函数tasklet_init和tasklet_schedule分析:
函数tasklet_init初始化一个tasklet,其参数t是tasklet_struct结构描述的tasklet,参数(*func)是软中断响应函数。
void tasklet_init(struct tasklet_struct *t,
void (*func)(unsigned long), unsigned long data)
{
t->next = NULL;
t->state = 0;
atomic_set(&t->count, 0);
t->func = func;
t->data = data;
}
驱动程序调用函数tasklet_schedule来运行tasklet。
static inline void tasklet_schedule(struct tasklet_struct *t)
{
if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state))
__tasklet_schedule(t);
}
函数__tasklet_schedule得到当前CPU的tasklet_vec链表,并执行TASKLET_SOFTIRQ软中断。
void fastcall __tasklet_schedule(struct tasklet_struct *t)
{
unsigned long flags;
local_irq_save(flags);
t->next = __get_cpu_var(tasklet_vec).list;
__get_cpu_var(tasklet_vec).list = t;
raise_softirq_irqoff(TASKLET_SOFTIRQ);
local_irq_restore(flags);
}
函数raise_softirq_irqoff设置软中断nr为挂起状态,并在没有中断时唤醒线程ksoftirqd。函数raise_softirq_irqoff必须在关中断情况下运行。
inline fastcall void raise_softirq_irqoff(unsigned int nr)
{
__raise_softirq_irqoff(nr);
/*
* If we're in an interrupt or softirq, we're done
* (this also catches softirq-disabled code). We will
* actually run the softirq once we return from
* the irq or softirq.
*
*
相关文档:
一、下载jpeg库
二、配置编译,生成Makefile文件。
#./configure --prefix=/usr/arm/arm-linux --exec-prefix=/usr/arm/arm-linux \
--enable-shared --enable-static
注意:prefix是最后安装时库存放的文件,shared是编译成动态库,static是编译成静态库
三、修改生成的Makefile。
使用gedit Makefile
将CC ......
linux 上的oracle sqlplus 不能利用 上, 下 键来查看命令,搜索到解决问题的办法,整理如下
安装软件rlwrap可以解决这个问题,该软件是用c写的程序
官方下载地址:http://utopia.knoware.nl/~hlub/uck/rlwrap/
安装过程:
我们也可以查看解压后的tar包,查看README帮助文件
shell>tar -zxvf rlwrap-0.36.tar.gz
sh ......
man就是manual的缩写,用来查看系统中自带的各种参考手册。
一、说明
1,手册页分为好几个部分,如下所示:
1 Executable programs or shell commands
2 System calls (functions provided by the kernel)
3 Library calls (functions within program libraries)
4 Special files (usually found in /dev)
5 File fo ......
ip 是个命令, ip 命令的功能很多!基本上它整合了 ifconfig 与 route 这两个命令,不过ip 的功能更强大! 如果您有兴趣的话,请自行 vi /sbin/ifup 就知道整个 ifup 就是利用 ip 这个命令来实现的。下面介绍一下使用方法
[root@linux ~]# ip [option] [动作] [命令]
参数:
option :设定的参数,主要有:
  ......
linux启动流程:
系统预处理程序->GRUB (此阶段可以理解为bootloader阶段)
->kernel (此阶段为kernel)
->initrd->init启动->inittab->rc.sysinit->functions(PATH)->modules->rcX.d(读配置文件)
1.->字符模式->tty->bash
2.->图形模式->进入X Window-> ......