static struct ipipe_domain this_domain;
int counter = 0;
void handler(unsigned irq)
{
printk(">>> PARALLEL PORT INT HANDLED: counter=%d\n", counter);
counter++;
ipipe_control_irq(PAR_INT,0,IPIPE_ENABLE_MASK);
ipipe_propagate_irq(PAR_INT);
}
void domain_entry (void)
{
int a,k;
printk("Domain %s has start!\n",ipipe_current_domain->name);
ipipe_virtualize_irq(ipipe_current_domain,PAR_INT,(ipipe_irq_handler_t)&handler,NULL,NULL,IPIPE_DYNAMIC_MASK);
printk("handler has registered!\n");
printk("Set interrupt mode of this irq\n") ;
//set port to interrupt mode; pins are output
outb_p(0x10, BASEPORT + 2);
ipipe_control_irq(PAR_INT,0,IPIPE_ENABLE_MASK);
k = 10;
while(k--)
{
outb_p(0x00,BASEPORT);
a = inb(BASEPORT);
printk("ACK : %d\n",a);
// udelay(5);
outb_p(0xff,BASEPORT);
a = inb(BASEPORT);
printk("ACK : %d\n",a);
}