Make i8259_64 more _32-like and remove io_ports.h
Subsystems (2)
PATCH 1/1 Make i8259_64 more _32-like and remove io_ports.h
This patch mainly hinges around two includes and their ramifications:
#include <i8259.h>
#include <io_ports.h>
io_ports.h is very short, and contains only #defs relating to i8259 code. Rolling the contents of io_ports.h into i8259.h (where it seems more fitting anyway) removed 140+ lines of diffs between i8259_32.c and i8259_64.c, thus making it easier for the real substantitive differences between them to show up, and hopefully therefore making it easier to eventually merge the two.
Also, there's some cleanup of i8259_* code to make checkpatch happier.
---
This replaces a previous version of this patch that tried to be more conservative but ended up not building under x86_64 with allnoconfig.
arch/x86/kernel/apic_32.c | 2 - arch/x86/kernel/apm_32.c | 2 - arch/x86/kernel/i8259_32.c | 16 ++-- arch/x86/kernel/i8259_64.c | 141 +++++++++++++++---------------- arch/x86/kernel/io_apic_32.c | 2 - arch/x86/kernel/time_32.c | 2 - arch/x86/kernel/vmiclock_32.c | 1 - include/asm-x86/i8259.h | 15 ++++ include/asm-x86/mach-default/io_ports.h | 25 ------ 9 files changed, 92 insertions(+), 114 deletions(-) delete mode 100644 include/asm-x86/mach-default/io_ports.h
arch/x86/kernel/apic_32.c +0 -2
@@ -43,8 +43,6 @@#include <mach_apicdef.h> #include <mach_ipi.h> -#include "io_ports.h" -/* * Sanity check */
arch/x86/kernel/apm_32.c +0 -2
@@ -235,8 +235,6 @@#include <asm/paravirt.h> #include <asm/reboot.h> -#include "io_ports.h" -#if defined(CONFIG_APM_DISPLAY_BLANK ) && defined(CONFIG_VT )extern int (*console_blank_hook)(int );#endif
arch/x86/kernel/i8259_32.c +7 -9
@@ -21,8 +21,6 @@#include <asm/arch_hooks.h> #include <asm/i8259.h> -#include <io_ports.h> -/* * This is the 'legacy' 8259A Programmable Interrupt Controller, * present in the majority of PC/AT boxes.
@@ -129,14 +127,14 @@ static inline int i8259A_irq_real(unsigned int irq)int 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; }
@@ -175,12 +173,12 @@ handle_real_irq:if (irq &8 ) {inb (PIC_SLAVE_IMR );/* DUMMY - (do we need this?) */ outb (cached_slave_mask,PIC_SLAVE_IMR ); -outb (0x60 +(irq&7 ),PIC_SLAVE_CMD );/* 'Specific EOI' to slave */ -outb (0x60 +PIC_CASCADE_IR ,PIC_MASTER_CMD );/* 'Specific EOI' to master-IRQ2 */ +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 {inb (PIC_MASTER_IMR );/* DUMMY - (do we need this?) */ outb (cached_master_mask,PIC_MASTER_IMR ); -outb (0x60 +irq,PIC_MASTER_CMD );/* 'Specific EOI to master */ +outb (0x60 +irq,PIC_MASTER_CMD );/* 'Specific EOI' to master */ }spin_unlock_irqrestore (&i8259A_lock, flags);return ;
arch/x86/kernel/i8259_64.c +70 -71
207 lines not on this page · raw message
arch/x86/kernel/io_apic_32.c +0 -2
@@ -48,8 +48,6 @@#include <mach_apic.h> #include <mach_apicdef.h> -#include "io_ports.h" -int (*ioapic_renumber_irq)(int ioapic,int irq);atomic_t irq_mis_count;
arch/x86/kernel/time_32.c +0 -2
@@ -64,8 +64,6 @@#include <asm/arch_hooks.h> -#include "io_ports.h" -#include <asm/i8259.h> #include "do_timer.h"
arch/x86/kernel/vmiclock_32.c +0 -1
@@ -35,7 +35,6 @@#include <asm/i8253.h> #include <irq_vectors.h> -#include "io_ports.h" #define VMI_ONESHOT (VMI_ALARM_IS_ONESHOT | VMI_CYCLES_REAL | vmi_get_alarm_wiring())#define VMI_PERIODIC (VMI_ALARM_IS_PERIODIC | VMI_CYCLES_REAL | vmi_get_alarm_wiring())
include/asm-x86/i8259.h +15 -0
@@ -1,6 +1,21 @@#ifndef __ASM_I8259_H__#define __ASM_I8259_H__ +/* i8259A PIC registers */ +#define PIC_MASTER_CMD 0x20 +#define PIC_MASTER_IMR 0x21 +#define PIC_MASTER_ISR PIC_MASTER_CMD +#define PIC_MASTER_POLL PIC_MASTER_ISR +#define PIC_MASTER_OCW3 PIC_MASTER_ISR +#define PIC_SLAVE_CMD 0xa0 +#define PIC_SLAVE_IMR 0xa1 + +/* i8259A PIC related value */ +#define PIC_CASCADE_IR 2 +#define MASTER_ICW4_DEFAULT 0x01 +#define SLAVE_ICW4_DEFAULT 0x01 +#define PIC_ICW4_AEOI 2 +extern unsigned int cached_irq_mask;#define __byte (x,y) (((unsigned char *) &(y))[x])
include/asm-x86/mach-default/io_ports.h deleted +0 -25
@@ -1,25 +0,0 @@ -/* -* arch/i386/mach-generic/io_ports.h -* -* Machine specific IO port address definition for generic. -* Written by Osamu Tomita <[email protected]> -*/ -#ifndef _MACH_IO_PORTS_H -#define _MACH_IO_PORTS_H - -/* i8259A PIC registers */ -#define PIC_MASTER_CMD 0x20 -#define PIC_MASTER_IMR 0x21 -#define PIC_MASTER_ISR PIC_MASTER_CMD -#define PIC_MASTER_POLL PIC_MASTER_ISR -#define PIC_MASTER_OCW3 PIC_MASTER_ISR -#define PIC_SLAVE_CMD 0xa0 -#define PIC_SLAVE_IMR 0xa1 - -/* i8259A PIC related value */ -#define PIC_CASCADE_IR 2 -#define MASTER_ICW4_DEFAULT 0x01 -#define SLAVE_ICW4_DEFAULT 0x01 -#define PIC_ICW4_AEOI 2 - -#endif /* !_MACH_IO_PORTS_H */
Signature · 1 line
1.5.2.5