irq.h File Reference

#include <linux/segment.h>
#include <linux/linkage.h>

Go to the source code of this file.

Defines

#define __STR(x)   #x
#define STR(x)   __STR(x)
#define SAVE_ALL
#define SAVE_MOST
#define RESTORE_MOST
#define ACK_FIRST(mask)
#define ACK_SECOND(mask)
#define UNBLK_FIRST(mask)
#define UNBLK_SECOND(mask)
#define IRQ_NAME2(nr)   nr##_interrupt(void)
#define IRQ_NAME(nr)   IRQ_NAME2(IRQ##nr)
#define FAST_IRQ_NAME(nr)   IRQ_NAME2(fast_IRQ##nr)
#define BAD_IRQ_NAME(nr)   IRQ_NAME2(bad_IRQ##nr)
#define BUILD_IRQ(chip, nr, mask)

Functions

void disable_irq (unsigned int)
void enable_irq (unsigned int)


Define Documentation

#define __STR (  )     #x

Definition at line 20 of file irq.h.

#define ACK_FIRST ( mask   ) 

Value:

"inb $0x21,%al\n\t" \
        "jmp 1f\n" \
        "1:\tjmp 1f\n" \
        "1:\torb $" #mask ",_cache_21\n\t" \
        "movb _cache_21,%al\n\t" \
        "outb %al,$0x21\n\t" \
        "jmp 1f\n" \
        "1:\tjmp 1f\n" \
        "1:\tmovb $0x20,%al\n\t" \
        "outb %al,$0x20\n\t"
The "inb" instructions are not needed, but seem to change the timings a bit - without them it seems that the harddisk driver won't work on all hardware. Arghh.

Definition at line 90 of file irq.h.

#define ACK_SECOND ( mask   ) 

Value:

"inb $0xA1,%al\n\t" \
        "jmp 1f\n" \
        "1:\tjmp 1f\n" \
        "1:\torb $" #mask ",_cache_A1\n\t" \
        "movb _cache_A1,%al\n\t" \
        "outb %al,$0xA1\n\t" \
        "jmp 1f\n" \
        "1:\tjmp 1f\n" \
        "1:\tmovb $0x20,%al\n\t" \
        "outb %al,$0xA0\n\t" \
        "jmp 1f\n" \
        "1:\tjmp 1f\n" \
        "1:\toutb %al,$0x20\n\t"

Definition at line 102 of file irq.h.

#define BAD_IRQ_NAME ( nr   )     IRQ_NAME2(bad_IRQ##nr)

Definition at line 136 of file irq.h.

#define BUILD_IRQ ( chip,
nr,
mask   ) 

Definition at line 138 of file irq.h.

#define FAST_IRQ_NAME ( nr   )     IRQ_NAME2(fast_IRQ##nr)

Definition at line 135 of file irq.h.

#define IRQ_NAME ( nr   )     IRQ_NAME2(IRQ##nr)

Definition at line 134 of file irq.h.

#define IRQ_NAME2 ( nr   )     nr##_interrupt(void)

Definition at line 133 of file irq.h.

#define RESTORE_MOST

Value:

"popl %ecx\n\t" \
        "popl %edx\n\t" \
        "popl %eax\n\t" \
        "pop %ds\n\t" \
        "pop %es\n\t" \
        "iret"

Definition at line 73 of file irq.h.

#define SAVE_ALL

Value:

"cld\n\t" \
        "push %gs\n\t" \
        "push %fs\n\t" \
        "push %es\n\t" \
        "push %ds\n\t" \
        "pushl %eax\n\t" \
        "pushl %ebp\n\t" \
        "pushl %edi\n\t" \
        "pushl %esi\n\t" \
        "pushl %edx\n\t" \
        "pushl %ecx\n\t" \
        "pushl %ebx\n\t" \
        "movl $" STR(KERNEL_DS) ",%edx\n\t" \
        "mov %dx,%ds\n\t" \
        "mov %dx,%es\n\t" \
        "movl $" STR(USER_DS) ",%edx\n\t" \
        "mov %dx,%fs\n\t"   \
        "movl $0,%edx\n\t"  \
        "movl %edx,%db7\n\t"

Definition at line 23 of file irq.h.

#define SAVE_MOST

Value:

"cld\n\t" \
        "push %es\n\t" \
        "push %ds\n\t" \
        "pushl %eax\n\t" \
        "pushl %edx\n\t" \
        "pushl %ecx\n\t" \
        "movl $" STR(KERNEL_DS) ",%edx\n\t" \
        "mov %dx,%ds\n\t" \
        "mov %dx,%es\n\t"
SAVE_MOST/RESTORE_MOST is used for the faster version of IRQ handlers, installed by using the SA_INTERRUPT flag. These kinds of IRQ's don't call the routines that do signal handling etc on return, and can have more relaxed register-saving etc. They are also atomic, and are thus suited for small, fast interrupts like the serial lines or the harddisk drivers, which don't actually need signal handling etc.

Also note that we actually save only those registers that are used in C subroutines (eax, edx and ecx), so if you do something weird, you're on your own. The only segments that are saved (not counting the automatic stack and code segment handling) are ds and es, and they point to kernel space. No messing around with fs here.

Definition at line 62 of file irq.h.

#define STR (  )     __STR(x)

Definition at line 21 of file irq.h.

#define UNBLK_FIRST ( mask   ) 

Value:

"inb $0x21,%al\n\t" \
        "jmp 1f\n" \
        "1:\tjmp 1f\n" \
        "1:\tandb $~(" #mask "),_cache_21\n\t" \
        "movb _cache_21,%al\n\t" \
        "outb %al,$0x21\n\t"

Definition at line 117 of file irq.h.

#define UNBLK_SECOND ( mask   ) 

Value:

"inb $0xA1,%al\n\t" \
        "jmp 1f\n" \
        "1:\tjmp 1f\n" \
        "1:\tandb $~(" #mask "),_cache_A1\n\t" \
        "movb _cache_A1,%al\n\t" \
        "outb %al,$0xA1\n\t"

Definition at line 125 of file irq.h.


Function Documentation

void disable_irq ( unsigned  int  ) 

linux/include/asm/irq.h

(C) 1992, 1993 Linus Torvalds

void enable_irq ( unsigned  int  ) 


Generated on Mon May 1 21:47:00 2006 for KernelAPI by  doxygen 1.4.6-5