当前位置: 技术问答>linux和unix
关于LDD3中short代码的分析
来源: 互联网 发布时间:2016-12-01
本文导语: 在LDD3中的第10章的“实现一个中断处理(Implementing a Handler)”中,作者提到了short_i_write函数,其函数原型如下: ssize_t short_i_write (struct file *filp, const char __user *buf, size_t count, loff_t *f_pos) { int written = 0, o...
在LDD3中的第10章的“实现一个中断处理(Implementing a Handler)”中,作者提到了short_i_write函数,其函数原型如下:
ssize_t short_i_write (struct file *filp, const char __user *buf, size_t count,
loff_t *f_pos)
{
int written = 0, odd = *f_pos & 1;
unsigned long port = short_base; /* output to the parallel data latch */
void *address = (void *) short_base;
if (use_mem) {
while (written
ssize_t short_i_write (struct file *filp, const char __user *buf, size_t count,
loff_t *f_pos)
{
int written = 0, odd = *f_pos & 1;
unsigned long port = short_base; /* output to the parallel data latch */
void *address = (void *) short_base;
if (use_mem) {
while (written