Unify common parts of i8259.c
Merge common parts of i8259_{32,64} into i8259.c.
---
commit 4544eda7dd9bc73061bc308130ed03e8b81f4f61
tree 6a4adc5a6661136352f6ff362d9574142ab0c246
parent 3576982b19d0fbd81f8d31d0475bf7b374010cb5
author Pavel <[email protected]> Tue, 20 May 2008 17:14:29 +0200 committer Pavel <[email protected]> Tue, 20 May 2008 17:14:29 +0200
arch/x86/kernel/Makefile | 2 arch/x86/kernel/i8259.c | 323 +++++++++++++++++++++++++++++++++++++++++++ arch/x86/kernel/i8259_32.c | 297 ---------------------------------------- arch/x86/kernel/i8259_64.c | 312 ------------------------------------------ include/asm-x86/hw_irq_32.h | 20 +++ include/asm-x86/i8259.h | 2 6 files changed, 347 insertions(+), 609 deletions(-)
arch/x86/kernel/Makefile +1 -1
@@ -18,7 +18,7 @@ CFLAGS_tsc_64.o := $(nostackp) obj-y := process_$(BITS).o signal_$(BITS).o entry_$(BITS).o obj-y += traps_$(BITS).o irq_$(BITS).o obj-y += time_$(BITS).o ioport.o ldt.o -obj-y += setup_$(BITS).o i8259_$(BITS).o setup.o +obj-y += setup_$(BITS).o i8259.o i8259_$(BITS).o setup.o obj-$(CONFIG_X86_32) += sys_i386_32.o i386_ksyms_32.o obj-$(CONFIG_X86_64) += sys_x86_64.o x8664_ksyms_64.o obj-$(CONFIG_X86_64) += syscall_64.o vsyscall_64.o setup64.o
arch/x86/kernel/i8259.c new file +323 -0
323 lines not on this page · raw message
arch/x86/kernel/i8259_32.c +1 -296
309 lines not on this page · raw message
arch/x86/kernel/i8259_64.c +0 -312
318 lines not on this page · raw message
include/asm-x86/hw_irq_32.h +20 -0
@@ -20,6 +20,26 @@ #include <asm/sections.h>#define NMI_VECTOR 0x02/* +* Vectors 0x20-0x2f are used for ISA interrupts. +*/ +#define IRQ0_VECTOR (0x20) +#define IRQ1_VECTOR (IRQ0_VECTOR + 1) +#define IRQ2_VECTOR (IRQ0_VECTOR + 2) +#define IRQ3_VECTOR (IRQ0_VECTOR + 3) +#define IRQ4_VECTOR (IRQ0_VECTOR + 4) +#define IRQ5_VECTOR (IRQ0_VECTOR + 5) +#define IRQ6_VECTOR (IRQ0_VECTOR + 6) +#define IRQ7_VECTOR (IRQ0_VECTOR + 7) +#define IRQ8_VECTOR (IRQ0_VECTOR + 8) +#define IRQ9_VECTOR (IRQ0_VECTOR + 9) +#define IRQ10_VECTOR (IRQ0_VECTOR + 10) +#define IRQ11_VECTOR (IRQ0_VECTOR + 11) +#define IRQ12_VECTOR (IRQ0_VECTOR + 12) +#define IRQ13_VECTOR (IRQ0_VECTOR + 13) +#define IRQ14_VECTOR (IRQ0_VECTOR + 14) +#define IRQ15_VECTOR (IRQ0_VECTOR + 15) + +/* * Various low-level irq details needed by irq.c, process.c, * time.c, io_apic.c and smp.c *
include/asm-x86/i8259.h +2 -0
@@ -55,4 +55,6 @@ static inline void outb_pic(unsigned cha udelay(2); } +extern struct irq_chip i8259A_chip; +#endif /* __ASM_I8259_H__ */
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 1 line · Pavel Machek
Merge common parts of i8259_{32,64} into
i8259.c.
hm, did you intend this to be a 'mechanic' (i.e. no functionality changes expected) unification?
i stuck it into -tip for testing and it caused a boot failure after a couple of bootups, with this config:
http://redhat.com/~mingo/misc/config-Tue_May_20_22_15_40_CEST_2008.bad
the hang is during early bootup, after SLUB init:
SLUB: Genslabs=12, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ hard hang ]
full bootlog below. Reverting your patch fixes the bootup. The next line would be:
Calibrating delay using timer specific routine.. 4023.05 BogoMIPS (lpj=8046112)
so somewhere between that and the SLUB init is it hanging.
If this change is intentionally not mechanic then please split this into the mechanic and non-mechanic portions, to make it all bisectable. If it's supposed to be mechanic then there's a bug in it - in that case a more gradual conversion is useful too.
We'd prefer to have 10 or 20 small commits instead one large commit - because in -tip we can bisect any problems to the exact change that caused it - while now we are left to guess about a rather large change:
6 files changed, 347 insertions(+), 609 deletions(-)
in fact such a big change might warrant 30 or 50 small changes as well - the smaller the changes, the better. Such a 1000-lines change we cannot reasonably bisect.
Ingo
-------------->
Linux version 2.6.26-rc3-sched-devel.git (mingo@dione) (gcc version 4.2.2) #483 Tue May 20 22:16:05 CEST 2008 BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 000000000009f800 (usable)
BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved)
BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 000000003fff0000 (usable)
BIOS-e820: 000000003fff0000 - 000000003fff3000 (ACPI NVS)
BIOS-e820: 000000003fff3000 - 0000000040000000 (ACPI data)
BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved)
BIOS-e820: 00000000fec00000 - 0000000100000000 (reserved)
debug: ignoring loglevel setting.
127MB HIGHMEM available.
896MB LOWMEM available.
early res: 0 [0-fff] BIOS data page
early res: 1 [100000-487a8b] TEXT DATA BSS
early res: 2 [487a8c-48afff] INIT_PG_TABLE
early res: 3 [9f800-fffff] BIOS reserved
Entering add_active_range(0, 0, 262128) 0 entries of 256 used
Zone PFN ranges:
DMA 0 -> 4096
Normal 4096 -> 229376
HighMem 229376 -> 262128
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0 -> 262128
On node 0 totalpages: 262128
DMA zone: 32 pages used for memmap
DMA zone: 0 pages reserved
DMA zone: 4064 pages, LIFO batch:0
Normal zone: 1760 pages used for memmap
Normal zone: 223520 pages, LIFO batch:31
HighMem zone: 255 pages used for memmap
HighMem zone: 32497 pages, LIFO batch:7
Movable zone: 0 pages used for memmap
DMI 2.3 present.
Allocating PCI resources starting at 50000000 (gap: 40000000:a0000000)
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 260081
Kernel command line: root=/dev/sda1 console=ttyS0,115200 console=tty debug initcall_debug enforcing=0 apic=verbose ignore_loglevel sysrq_always_enabled selinux=0 nmi_watchdog=0
debug: sysrq always enabled.
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Initializing CPU#0
PID hash table entries: 4096 (order: 12, 16384 bytes)
Detected 2010.291 MHz processor.
Console: colour VGA+ 80x25
console [tty0] enabled
console [ttyS0] enabled
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 1035232k/1048512k available (1788k kernel code, 12628k reserved, 562k data, 140k init, 131008k highmem)
virtual kernel memory layout:
fixmap : 0xfffee000 - 0xfffff000 ( 68 kB)
pkmap : 0xff800000 - 0xffc00000 (4096 kB)
vmalloc : 0xf8800000 - 0xff7fe000 ( 111 MB)
lowmem : 0xc0000000 - 0xf8000000 ( 896 MB)
.init : 0xc034e000 - 0xc0371000 ( 140 kB)
.data : 0xc02bf20c - 0xc034bcf0 ( 562 kB)
.text : 0xc0100000 - 0xc02bf20c (1788 kB)Checking if this processor honours the WP bit even in supervisor mode...Ok.
CPA: page pool initialized 1 of 1 pages preallocated
SLUB: Genslabs=12, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ hard hang ]
Hi!
Quoted 6 lines · Pavel Machek
Quoted 2 lines
Merge common parts of i8259_{32,64} into
i8259.c.hm, did you intend this to be a 'mechanic' (i.e. no functionality changes expected) unification?
Yes, it should have been mechanic, but I guess I was not careful enough.
Quoted 4 lines
We'd prefer to have 10 or 20 small commits instead one large commit - because in -tip we can bisect any problems to the exact change that caused it - while now we are left to guess about a rather large change:
I don't think I can split it into 20 changes, but I should be able to split it into 3 or so, and make them trivial enough to be bug free. (In fact, there were only about 20 lines of "real" changes in this, but it is impossible to see
Quoted 1 line
6 files changed, 347 insertions(+), 609 deletions(-)
in this huge changelog). I'll produce better patches.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Automatical unification of i8259.c
In reply to Ingo MolnarMake conversion of i8259 very mechanical -- i8259 was generated by diff -D, with too different parts left in i8259_32 and i8259_64.c. Only "by hand" changes were removal of #ifdef from middle of the comment (prevented compilation) and removal of one static to allow splitting into files.
Of course, it will need some cleanups now, and those will follow.
arch/x86/kernel/Makefile +1 -1
@@ -18,7 +18,7 @@ CFLAGS_tsc_64.o := $(nostackp) obj-y := process_$(BITS).o signal_$(BITS).o entry_$(BITS).o obj-y += traps_$(BITS).o irq_$(BITS).o obj-y += time_$(BITS).o ioport.o ldt.o -obj-y += setup_$(BITS).o i8259_$(BITS).o setup.o +obj-y += setup_$(BITS).o i8259.o i8259_$(BITS).o setup.o obj-$(CONFIG_X86_32) += sys_i386_32.o i386_ksyms_32.o obj-$(CONFIG_X86_64) += sys_x86_64.o x8664_ksyms_64.o obj-$(CONFIG_X86_64) += syscall_64.o vsyscall_64.o setup64.o
arch/x86/kernel/i8259.c new file +368 -0
368 lines not on this page · raw message
arch/x86/kernel/i8259_32.c +0 -295
302 lines not on this page · raw message
arch/x86/kernel/i8259_64.c +0 -309
315 lines not on this page · raw message
include/asm-x86/i8259.h +2 -0
@@ -55,4 +55,6 @@ static inline void outb_pic(unsigned cha udelay(2); } +extern struct irq_chip i8259A_chip; +#endif /* __ASM_I8259_H__ */
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Thomas Gleixner
AppliedRe: Automatical unification of i8259.c
Quoted 7 lines · Pavel Machek
Make conversion of i8259 very mechanical -- i8259 was generated by diff -D, with too different parts left in
i8259_32andi8259_64.c. Only "by hand" changes were removal of #ifdef from middle of the comment (prevented compilation) and removal of one static to allow splitting into files.Of course, it will need some cleanups now, and those will follow.
Applied. Thanks,
tglx
Re: Automatical unification of i8259.c
Hi!
Quoted 9 lines
Quoted 7 lines
Make conversion of i8259 very mechanical -- i8259 was generated by diff -D, with too different parts left in
i8259_32andi8259_64.c. Only "by hand" changes were removal of #ifdef from middle of the comment (prevented compilation) and removal of one static to allow splitting into files.Of course, it will need some cleanups now, and those will follow.
Applied. Thanks,
Does that mean that followup patches are in, too? This is really too ugly to live alone ;-).
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: Automatical unification of i8259.c
Quoted 8 lines · Pavel Machek
Hi!
Quoted 6 lines
Quoted 6 lines
Make conversion of i8259 very mechanical -- i8259 was generated by diff -D, with too different parts left in
i8259_32andi8259_64.c. Only "by hand" changes were removal of #ifdef from middle of the comment (prevented compilation) and removal of one static to allow splitting into files.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Of course, it will need some cleanups now, and those will follow.
Applied. Thanks,
Does that mean that followup patches are in, too? This is really too ugly to live alone ;-).
Hint:
Look at:
http://git.kernel.org/?p=linux/kernel/git/x86/linux-2.6-tip.git;a=shortlog;h=x86/i8259
Sam
i8259: fix final uglyness
In reply to Thomas GleixnerIntroduce IRQx_VECTOR on 32-bit, so that #ifdef noise is kept down. There should be no object code change.
---
commit e9f4353b46ec2b05f73e1a84085c305de211bd3e
tree 560080f09144090fe5caa17f6740f6710bb6421b
parent 81657c7907691cd20f40747563bfc9eb9e79f7e2
author Pavel <[email protected]> Thu, 22 May 2008 22:36:59 +0200 committer Pavel <[email protected]> Thu, 22 May 2008 22:36:59 +0200
arch/x86/kernel/i8259.c | 19 ++++++------------- include/asm-x86/hw_irq_32.h | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 13 deletions(-)
arch/x86/kernel/i8259.c +6 -13
@@ -297,26 +297,20 @@ void init_8259A(int auto_eoi)* outb_pic - this has to work on a wide range of PC hardware. */ outb_pic (0x11 ,PIC_MASTER_CMD );/* ICW1: select 8259A-1 init */ -#ifndef CONFIG_X86_64 -outb_pic (0x20 +0 ,PIC_MASTER_IMR );/* ICW2: 8259A-1 IR0-7 mapped to 0x20-0x27 */ -outb_pic (1U <<PIC_CASCADE_IR ,PIC_MASTER_IMR );/* 8259A-1 (the master) has a slave on IR2 */ -#else /* CONFIG_X86_64 */ -/* ICW2: 8259A-1 IR0-7 mapped to 0x30-0x37 */ +/* ICW2: 8259A-1 IR0-7 mapped to 0x30-0x37 on x86-64, +to 0x20-0x27 on i386 */ outb_pic (IRQ0_VECTOR ,PIC_MASTER_IMR ); +/* 8259A-1 (the master) has a slave on IR2 */ -outb_pic (0x04 ,PIC_MASTER_IMR ); -#endif /* CONFIG_X86_64 */ +outb_pic (1U <<PIC_CASCADE_IR ,PIC_MASTER_IMR ); +if (auto_eoi)/* master does Auto EOI */ outb_pic (MASTER_ICW4_DEFAULT |PIC_ICW4_AEOI ,PIC_MASTER_IMR );else /* master expects normal EOI */ outb_pic (MASTER_ICW4_DEFAULT ,PIC_MASTER_IMR );outb_pic (0x11 ,PIC_SLAVE_CMD );/* ICW1: select 8259A-2 init */ -#ifndef CONFIG_X86_64 -outb_pic (0x20 +8 ,PIC_SLAVE_IMR );/* ICW2: 8259A-2 IR0-7 mapped to 0x28-0x2f */ -outb_pic (PIC_CASCADE_IR ,PIC_SLAVE_IMR );/* 8259A-2 is a slave on master's IR2 */ -outb_pic (SLAVE_ICW4_DEFAULT ,PIC_SLAVE_IMR );/* (slave's support for AEOI in flat mode is to be investigated) */ -#else /* CONFIG_X86_64 */ +/* ICW2: 8259A-2 IR0-7 mapped to IRQ8_VECTOR.. */ outb_pic (IRQ8_VECTOR ,PIC_SLAVE_IMR );/* 8259A-2 is a slave on master's IR2 */
@@ -324,7 +318,6 @@ #else /* CONFIG_X86_64 *//* (slave's support for AEOI in flat mode is to be investigated) */ outb_pic (SLAVE_ICW4_DEFAULT ,PIC_SLAVE_IMR ); -#endif /* CONFIG_X86_64 */ if (auto_eoi)/* * In AEOI mode we just have to mask the interrupt
include/asm-x86/hw_irq_32.h +17 -0
@@ -19,6 +19,23 @@ #include <asm/sections.h>#define NMI_VECTOR 0x02 +#define IRQ0_VECTOR (0x20) +#define IRQ1_VECTOR (IRQ0_VECTOR + 1) +#define IRQ2_VECTOR (IRQ0_VECTOR + 2) +#define IRQ3_VECTOR (IRQ0_VECTOR + 3) +#define IRQ4_VECTOR (IRQ0_VECTOR + 4) +#define IRQ5_VECTOR (IRQ0_VECTOR + 5) +#define IRQ6_VECTOR (IRQ0_VECTOR + 6) +#define IRQ7_VECTOR (IRQ0_VECTOR + 7) +#define IRQ8_VECTOR (IRQ0_VECTOR + 8) +#define IRQ9_VECTOR (IRQ0_VECTOR + 9) +#define IRQ10_VECTOR (IRQ0_VECTOR + 10) +#define IRQ11_VECTOR (IRQ0_VECTOR + 11) +#define IRQ12_VECTOR (IRQ0_VECTOR + 12) +#define IRQ13_VECTOR (IRQ0_VECTOR + 13) +#define IRQ14_VECTOR (IRQ0_VECTOR + 14) +#define IRQ15_VECTOR (IRQ0_VECTOR + 15) +/* * Various low-level irq details needed by irq.c, process.c, * time.c, io_apic.c and smp.c
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: i8259: fix final uglyness
Quoted 3 lines · Pavel Machek
Introduce
IRQx_VECTORon 32-bit, so that #ifdef noise is kept down. There should be no object code change.
Pavel,
thanks for doing this. The patch fails due to other changes in this area (especially the hw_irq.h unification). Can you please redo against:
http://git.kernel.org/?p=linux/kernel/git/x86/linux-2.6-x86.git;a=shortlog;h=x86/irq
Thanks,
tglx
Re: i8259: fix final uglyness
Quoted 6 lines · Thomas Gleixner
Quoted 3 lines · Pavel Machek
Introduce
IRQx_VECTORon 32-bit, so that #ifdef noise is kept down. There should be no object code change.
Quoted 7 lines
Pavel,
thanks for doing this. The patch fails due to other changes in this area (especially the
hw_irq.hunification). Can you please redo against:http://git.kernel.org/?p=linux/kernel/git/x86/linux-2.6-x86.git;a=shortlog;h=x86/irq
Will redoing against linux-x86-tip work?
tip git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: i8259: fix final uglyness
Quoted 12 lines · Pavel Machek
Quoted 11 lines · Thomas Gleixner
Quoted 3 lines · Pavel Machek
Introduce
IRQx_VECTORon 32-bit, so that #ifdef noise is kept down. There should be no object code change.Pavel,
thanks for doing this. The patch fails due to other changes in this area (especially the
hw_irq.hunification). Can you please redo against:
Quoted 6 lines
Will redoing against linux-x86-tip work?
tip
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git
Sure, sorry had the wrong bookmark, but x86 points to tip now.
Thanks,
tglx
Re: i8259: fix final uglyness
Hi!
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
Introduce
IRQx_VECTORon 32-bit, so that #ifdef noise is kept down. There should be no object code change.thanks for doing this. The patch fails due to other changes in this area (especially the
hw_irq.hunification). Can you please redo against:
Done.
---
Introduce IRQx_VECTOR on 32-bit, so that #ifdef noise is kept down. There should be no object code change.
arch/x86/kernel/i8259.c +8 -14
@@ -297,34 +297,28 @@ void init_8259A(int auto_eoi)* outb_pic - this has to work on a wide range of PC hardware. */ outb_pic (0x11 ,PIC_MASTER_CMD );/* ICW1: select 8259A-1 init */ -#ifndef CONFIG_X86_64 -outb_pic (0x20 +0 ,PIC_MASTER_IMR );/* ICW2: 8259A-1 IR0-7 mapped to 0x20-0x27 */ -outb_pic (1U <<PIC_CASCADE_IR ,PIC_MASTER_IMR );/* 8259A-1 (the master) has a slave on IR2 */ -#else /* CONFIG_X86_64 */ -/* ICW2: 8259A-1 IR0-7 mapped to 0x30-0x37 */ + +/* ICW2: 8259A-1 IR0-7 mapped to 0x30-0x37 on x86-64, +to 0x20-0x27 on i386 */ outb_pic (IRQ0_VECTOR ,PIC_MASTER_IMR ); +/* 8259A-1 (the master) has a slave on IR2 */ -outb_pic (0x04 ,PIC_MASTER_IMR ); -#endif /* CONFIG_X86_64 */ +outb_pic (1U <<PIC_CASCADE_IR ,PIC_MASTER_IMR ); +if (auto_eoi)/* master does Auto EOI */ outb_pic (MASTER_ICW4_DEFAULT |PIC_ICW4_AEOI ,PIC_MASTER_IMR );else /* master expects normal EOI */ outb_pic (MASTER_ICW4_DEFAULT ,PIC_MASTER_IMR );outb_pic (0x11 ,PIC_SLAVE_CMD );/* ICW1: select 8259A-2 init */ -#ifndef CONFIG_X86_64 -outb_pic (0x20 +8 ,PIC_SLAVE_IMR );/* ICW2: 8259A-2 IR0-7 mapped to 0x28-0x2f */ -outb_pic (PIC_CASCADE_IR ,PIC_SLAVE_IMR );/* 8259A-2 is a slave on master's IR2 */ -outb_pic (SLAVE_ICW4_DEFAULT ,PIC_SLAVE_IMR );/* (slave's support for AEOI in flat mode is to be investigated) */ -#else /* CONFIG_X86_64 */ -/* ICW2: 8259A-2 IR0-7 mapped to 0x38-0x3f */ + +/* ICW2: 8259A-2 IR0-7 mapped to IRQ8_VECTOR */ outb_pic (IRQ8_VECTOR ,PIC_SLAVE_IMR );/* 8259A-2 is a slave on master's IR2 */ outb_pic (PIC_CASCADE_IR ,PIC_SLAVE_IMR );/* (slave's support for AEOI in flat mode is to be investigated) */ outb_pic (SLAVE_ICW4_DEFAULT ,PIC_SLAVE_IMR ); -#endif /* CONFIG_X86_64 */ if (auto_eoi)/* * In AEOI mode we just have to mask the interrupt
include/asm-x86/irq_vectors.h +6 -3
@@ -18,17 +18,20 @@ # define IA32_SYSCALL_VECTOR 0x80#endif /* -* Vectors 0x20-0x2f are used for ISA interrupts on 32 bit. -* * Reserve the lowest usable priority level 0x20 - 0x2f for triggering * cleanup after irq migration on 64 bit. */ #define IRQ_MOVE_CLEANUP_VECTOR FIRST_EXTERNAL_VECTOR/* -* Vectors 0x30-0x3f are used for ISA interrupts on 64 bit +* Vectors 0x20-0x2f are used for ISA interrupts on 32 bit. +* Vectors 0x30-0x3f are used for ISA interrupts on 64 bit. */ +#ifdef CONFIG_X86_32 +#define IRQ0_VECTOR (FIRST_EXTERNAL_VECTOR) +#else #define IRQ0_VECTOR (FIRST_EXTERNAL_VECTOR + 0x10) +#endif #define IRQ1_VECTOR (IRQ0_VECTOR + 1)#define IRQ2_VECTOR (IRQ0_VECTOR + 2)#define IRQ3_VECTOR (IRQ0_VECTOR + 3)
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Ingo Molnar
AppliedRe: i8259: fix final uglyness
Quoted 8 lines · Pavel Machek
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
Introduce
IRQx_VECTORon 32-bit, so that #ifdef noise is kept down. There should be no object code change.thanks for doing this. The patch fails due to other changes in this area (especially the
hw_irq.hunification). Can you please redo against:Done.
applied to tip/x86/irq, thanks Pavel.
Ingo
i8259.c: remove #ifdefs around includes
In reply to Ingo MolnarRemove #ifdefs around includes; including too much should be always safe.
---
commit 06f12eb6da33da70dbdccbee5a687d5353782e1d
tree 62b9b1a785bbc5a9daa22512ec95601d54aa004d
parent 44b4ec2247971ba1a1906752208182146fc5974c
author Pavel <[email protected]> Wed, 21 May 2008 11:46:46 +0200 committer Pavel <[email protected]> Wed, 21 May 2008 11:46:46 +0200
arch/x86/kernel/i8259.c | 11 ----------- 1 files changed, 0 insertions(+), 11 deletions(-)
arch/x86/kernel/i8259.c +0 -11
@@ -1,14 +1,10 @@ -#ifdef CONFIG_X86_64 #include <linux/linkage.h> -#endif /* CONFIG_X86_64 */ #include <linux/errno.h> #include <linux/signal.h> #include <linux/sched.h> #include <linux/ioport.h> #include <linux/interrupt.h> -#ifdef CONFIG_X86_64 #include <linux/timex.h> -#endif /* CONFIG_X86_64 */ #include <linux/slab.h> #include <linux/random.h> #include <linux/init.h>
@@ -16,24 +12,17 @@ #include <linux/kernel_stat.h>#include <linux/sysdev.h> #include <linux/bitops.h> -#ifdef CONFIG_X86_64 #include <asm/acpi.h> -#endif /* CONFIG_X86_64 */ #include <asm/atomic.h> #include <asm/system.h> #include <asm/io.h> -#ifndef CONFIG_X86_64 #include <asm/timer.h> -#else /* CONFIG_X86_64 */ #include <asm/hw_irq.h> -#endif /* CONFIG_X86_64 */ #include <asm/pgtable.h> #include <asm/delay.h> #include <asm/desc.h> #include <asm/apic.h> -#ifndef CONFIG_X86_64 #include <asm/arch_hooks.h> -#endif /* ! CONFIG_X86_64 */ #include <asm/i8259.h> /*
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
i8259.c: remove trivial ifdefs
In reply to Ingo MolnarRemove #ifdefs where the only difference is formatting of comments.
---
commit 800e1add46a2686995af98432a7971150318676d
tree 5daa71306ceb60b0fb7e5707ec4d9701c06197de
parent 06f12eb6da33da70dbdccbee5a687d5353782e1d
author Pavel <[email protected]> Wed, 21 May 2008 11:52:11 +0200 committer Pavel <[email protected]> Wed, 21 May 2008 11:52:11 +0200
arch/x86/kernel/i8259.c | 20 +++----------------- 1 files changed, 3 insertions(+), 17 deletions(-)
arch/x86/kernel/i8259.c +3 -17
@@ -175,24 +175,14 @@ handle_real_irq:if (irq &8 ) {inb (PIC_SLAVE_IMR );/* DUMMY - (do we need this?) */ outb (cached_slave_mask,PIC_SLAVE_IMR ); -#ifndef CONFIG_X86_64 -outb (0x60 +(irq&7 ),PIC_SLAVE_CMD );/* 'Specific EOI' to slave */ -outb (0x60 +PIC_CASCADE_IR ,PIC_MASTER_CMD );/* 'Specific EOI' to master-IRQ2 */ -#else /* CONFIG_X86_64 */ /* 'Specific EOI' to slave */ -outb (0x60 +(irq&7 ),PIC_SLAVE_CMD ); +outb (0x60 +(irq&7 ),PIC_SLAVE_CMD );/* 'Specific EOI' to master-IRQ2 */ -outb (0x60 +PIC_CASCADE_IR ,PIC_MASTER_CMD ); -#endif /* CONFIG_X86_64 */ +outb (0x60 +PIC_CASCADE_IR ,PIC_MASTER_CMD ); }else {inb (PIC_MASTER_IMR );/* DUMMY - (do we need this?) */ outb (cached_master_mask,PIC_MASTER_IMR ); -#ifndef CONFIG_X86_64 -outb (0x60 +irq,PIC_MASTER_CMD );/* 'Specific EOI to master */ -#else /* CONFIG_X86_64 */ -/* 'Specific EOI' to master */ -outb (0x60 +irq,PIC_MASTER_CMD ); -#endif /* CONFIG_X86_64 */ +outb (0x60 +irq,PIC_MASTER_CMD );/* 'Specific EOI to master */ }spin_unlock_irqrestore (&i8259A_lock, flags);return ;
@@ -215,12 +205,8 @@ spurious_8259A_irq:* lets ACK and report it. [once per IRQ] */ if (!(spurious_irq_mask & irqmask)) { -#ifndef CONFIG_X86_64 -printk (KERN_DEBUG "spurious 8259A interrupt: IRQ%d.\n" , irq); -#else /* CONFIG_X86_64 */ printk (KERN_DEBUG "spurious 8259A interrupt: IRQ%d.\n" , irq); -#endif /* CONFIG_X86_64 */ spurious_irq_mask |= irqmask; }atomic_inc (&irq_err_count);
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
i8259: cleanup codingstyle
In reply to Ingo Molnari8259: trivial codingstyle cleanup.
---
commit 3333c67ab415a0debec8e178c563e81b49f73bf9
tree 9f868e4422e7d58bfe398541335b8574ea4c11ee
parent 800e1add46a2686995af98432a7971150318676d
author Pavel <[email protected]> Wed, 21 May 2008 11:57:12 +0200 committer Pavel <[email protected]> Wed, 21 May 2008 11:57:12 +0200
arch/x86/kernel/i8259.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
arch/x86/kernel/i8259.c +4 -4
@@ -129,14 +129,14 @@ static inline int i8259A_irq_real(unsignint irqmask =1 <<irq;if (irq <8 ) { -outb (0x0B ,PIC_MASTER_CMD );/* ISR register */ +outb (0x0B ,PIC_MASTER_CMD );/* ISR register */ value =inb (PIC_MASTER_CMD ) & irqmask; -outb (0x0A ,PIC_MASTER_CMD );/* back to the IRR register */ +outb (0x0A ,PIC_MASTER_CMD );/* back to the IRR register */ return value; } -outb (0x0B ,PIC_SLAVE_CMD );/* ISR register */ +outb (0x0B ,PIC_SLAVE_CMD );/* ISR register */ value =inb (PIC_SLAVE_CMD ) & (irqmask >>8 ); -outb (0x0A ,PIC_SLAVE_CMD );/* back to the IRR register */ +outb (0x0A ,PIC_SLAVE_CMD );/* back to the IRR register */ return value; }
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html