Implement an optimization for INTREN/INTRDIS that bde pointed out last
time I tinkered around here. Since INTREN is called from the interrupt critical path now, it should not be too expensive. In this case, we look at the bits being changed to decide which 8 bit IO port to write to rather than unconditionally writing to both. I could probably have gone further and only done the write if the bits actually changed, but that seemed overkill for the usual case in interrupt threads. [an outb is rather expensive when it has to cross the ISA bus]
This commit is contained in:
parent
10185bdc57
commit
194b08ffc3
@ -55,19 +55,33 @@ _imen: .long HWI_MASK
|
||||
|
||||
ENTRY(INTREN)
|
||||
movl 4(%esp), %eax
|
||||
movl %eax, %ecx
|
||||
notl %eax
|
||||
andl %eax, imen
|
||||
movl imen, %eax
|
||||
testb %cl, %cl
|
||||
je 1f
|
||||
outb %al, $(IO_ICU1 + MASK_OFFSET)
|
||||
1:
|
||||
testb %ch, %ch
|
||||
je 2f
|
||||
shrl $8, %eax
|
||||
outb %al, $(IO_ICU2 + MASK_OFFSET)
|
||||
2:
|
||||
ret
|
||||
|
||||
ENTRY(INTRDIS)
|
||||
movl 4(%esp), %eax
|
||||
movl %eax, %ecx
|
||||
orl %eax, imen
|
||||
movl imen, %eax
|
||||
testb %cl, %cl
|
||||
je 1f
|
||||
outb %al, $(IO_ICU1 + MASK_OFFSET)
|
||||
1:
|
||||
testb %ch, %ch
|
||||
je 2f
|
||||
shrl $8, %eax
|
||||
outb %al, $(IO_ICU2 + MASK_OFFSET)
|
||||
2:
|
||||
ret
|
||||
|
@ -55,19 +55,33 @@ _imen: .long HWI_MASK
|
||||
|
||||
ENTRY(INTREN)
|
||||
movl 4(%esp), %eax
|
||||
movl %eax, %ecx
|
||||
notl %eax
|
||||
andl %eax, imen
|
||||
movl imen, %eax
|
||||
testb %cl, %cl
|
||||
je 1f
|
||||
outb %al, $(IO_ICU1 + MASK_OFFSET)
|
||||
1:
|
||||
testb %ch, %ch
|
||||
je 2f
|
||||
shrl $8, %eax
|
||||
outb %al, $(IO_ICU2 + MASK_OFFSET)
|
||||
2:
|
||||
ret
|
||||
|
||||
ENTRY(INTRDIS)
|
||||
movl 4(%esp), %eax
|
||||
movl %eax, %ecx
|
||||
orl %eax, imen
|
||||
movl imen, %eax
|
||||
testb %cl, %cl
|
||||
je 1f
|
||||
outb %al, $(IO_ICU1 + MASK_OFFSET)
|
||||
1:
|
||||
testb %ch, %ch
|
||||
je 2f
|
||||
shrl $8, %eax
|
||||
outb %al, $(IO_ICU2 + MASK_OFFSET)
|
||||
2:
|
||||
ret
|
||||
|
@ -55,19 +55,33 @@ _imen: .long HWI_MASK
|
||||
|
||||
ENTRY(INTREN)
|
||||
movl 4(%esp), %eax
|
||||
movl %eax, %ecx
|
||||
notl %eax
|
||||
andl %eax, imen
|
||||
movl imen, %eax
|
||||
testb %cl, %cl
|
||||
je 1f
|
||||
outb %al, $(IO_ICU1 + MASK_OFFSET)
|
||||
1:
|
||||
testb %ch, %ch
|
||||
je 2f
|
||||
shrl $8, %eax
|
||||
outb %al, $(IO_ICU2 + MASK_OFFSET)
|
||||
2:
|
||||
ret
|
||||
|
||||
ENTRY(INTRDIS)
|
||||
movl 4(%esp), %eax
|
||||
movl %eax, %ecx
|
||||
orl %eax, imen
|
||||
movl imen, %eax
|
||||
testb %cl, %cl
|
||||
je 1f
|
||||
outb %al, $(IO_ICU1 + MASK_OFFSET)
|
||||
1:
|
||||
testb %ch, %ch
|
||||
je 2f
|
||||
shrl $8, %eax
|
||||
outb %al, $(IO_ICU2 + MASK_OFFSET)
|
||||
2:
|
||||
ret
|
||||
|
Loading…
x
Reference in New Issue
Block a user