#include #include #include #include #include #include #include #include #include #include static irq_handler_t dn_irqs[16]; extern void write_keyb_cmd(u_short length, u_char *cmd); static char BellOnCommand[] = { 0xFF, 0x21, 0x81 }, BellOffCommand[] = { 0xFF, 0x21, 0x82 }; extern void dn_serial_print (const char *str); void dn_process_int(int irq, struct pt_regs *fp) { if(dn_irqs[irq-160].handler) { dn_irqs[irq-160].handler(irq,dn_irqs[irq-160].dev_id,fp); } else { printk("spurious irq %d occured\n",irq); } *(volatile unsigned char *)(pica)=0x20; *(volatile unsigned char *)(picb)=0x20; } void dn_init_IRQ(void) { int i; for(i=0;i<16;i++) { dn_irqs[i].handler=NULL; dn_irqs[i].flags=IRQ_FLG_STD; dn_irqs[i].dev_id=NULL; dn_irqs[i].devname=NULL; } } int dn_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id) { if((irq<0) || (irq>15)) { printk("Trying to request illegal IRQ\n"); return -ENXIO; } if(!dn_irqs[irq].handler) { dn_irqs[irq].handler=handler; dn_irqs[irq].flags=IRQ_FLG_STD; dn_irqs[irq].dev_id=dev_id; dn_irqs[irq].devname=devname; if(irq<8) *(volatile unsigned char *)(pica+1)&=~(1<15)) { printk("Trying to free illegal IRQ\n"); return ; } if(irq<8) *(volatile unsigned char *)(pica+1)|=(1<