カーネルモジュールでのポーリング

static ssize_t h_write(struct file * file, const char * buf,
                        size_t count, loff_t *ppos)
{
 unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev);
 int i,n;
 printk("LKM-hello:write minor=%d¥n", minor);
 if(count == 0) return 0;

 n= *buf & 0xF;
 for(i=0; i<n; i++){
    outb(0xF0, 0x3f2); /* Motor ON */
    h_timer();
    outb(0x00, 0x3f2); /* Motor OFF */
    h_timer();
 }
 return count;
}