Subversion Repositories shark

Rev

Rev 514 | Rev 526 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
495 giacomo 1
#include <linuxcomp.h>
2
 
3
#include <asm/ptrace.h>
4
#include <asm-generic/errno-base.h>
5
#include <linux/kernel.h>
6
 
514 giacomo 7
extern void *int_arg_table[64];
8
extern void *int_func_table[64];
513 giacomo 9
int intr_count = 0;
495 giacomo 10
 
11
/*
12
 * Generic Linux interrupt handler.
13
 */
513 giacomo 14
void linux_intr(int irq)
495 giacomo 15
{
513 giacomo 16
        struct pt_regs regs;
17
 
18
        intr_count++;  
521 mauro 19
 
513 giacomo 20
        if (int_func_table[irq] != NULL)
21
                (* (void (*)(int, void *dev_id, struct pt_regs *))int_func_table[irq])(irq, int_arg_table[irq], &regs);
22
 
23
        intr_count--;
24
 
495 giacomo 25
}
26
 
27
/*
28
 * Attach a handler to an IRQ.
29
 */
30
int request_irq(unsigned int irq, void (*handler)(int, void *dev_id, struct pt_regs *), unsigned long flags, const char *device, void *dev_id)
31
{
513 giacomo 32
        shark_handler_set(irq, (void *)(handler), dev_id);
495 giacomo 33
        return 0;
34
}
35
 
36
/*
37
 * Deallocate an irq.
38
 */
39
void free_irq(unsigned int irq, void *a)
40
{
513 giacomo 41
 
495 giacomo 42
        shark_handler_remove(irq);
513 giacomo 43
 
495 giacomo 44
}