From: Andrew Morton Signed-off-by: Andrew Morton --- arch/i386/lib/kgdb_serial.c | 48 ++++++++++++++++------------------ 1 files changed, 23 insertions(+), 25 deletions(-) diff -puN arch/i386/lib/kgdb_serial.c~kgdb-serial-cleanup arch/i386/lib/kgdb_serial.c --- devel/arch/i386/lib/kgdb_serial.c~kgdb-serial-cleanup 2006-02-27 02:43:52.000000000 -0800 +++ devel-akpm/arch/i386/lib/kgdb_serial.c 2006-02-27 02:43:52.000000000 -0800 @@ -59,8 +59,6 @@ static int gdb_buf_out_inx; struct async_struct *gdb_async_info; static int gdb_async_irq; -#define outb_px(a,b) outb_p(b,a) - static void program_uart(struct async_struct *info); static void write_char(struct async_struct *info, int chr); /* @@ -254,10 +252,10 @@ gdb_hook_interrupt(struct async_struct * /* Should not need all this, but just in case.... */ scratch = inb_p(port + UART_IER); - outb_px(port + UART_IER, 0); - outb_px(0xff, 0x080); + outb_p(0, port + UART_IER); + outb_p(0x080, 0xff); scratch2 = inb_p(port + UART_IER); - outb_px(port + UART_IER, scratch); + outb_p(scratch, port + UART_IER); if (scratch2) { printk ("gdb_hook_interrupt: Could not clear IER, not a UART!\n"); @@ -265,10 +263,10 @@ gdb_hook_interrupt(struct async_struct * return 1; /* We failed; there's nothing here */ } scratch2 = inb_p(port + UART_LCR); - outb_px(port + UART_LCR, 0xBF); /* set up for StarTech test */ - outb_px(port + UART_EFR, 0); /* EFR is the same as FCR */ - outb_px(port + UART_LCR, 0); - outb_px(port + UART_FCR, UART_FCR_ENABLE_FIFO); + outb_p(0xBF, port + UART_LCR); /* set up for StarTech test */ + outb_p(0, port + UART_EFR); /* EFR is the same as FCR */ + outb_p(0, port + UART_LCR); + outb_p(UART_FCR_ENABLE_FIFO, port + UART_FCR); scratch = inb_p(port + UART_IIR) >> 6; if (scratch == 1) { printk("gdb_hook_interrupt: Undefined UART type!" @@ -280,10 +278,10 @@ gdb_hook_interrupt(struct async_struct * "is %d where 0=16450, 2=16550 3=16550A\n", scratch)); } scratch = inb_p(port + UART_MCR); - outb_px(port + UART_MCR, UART_MCR_LOOP | scratch); - outb_px(port + UART_MCR, UART_MCR_LOOP | 0x0A); + outb_p(UART_MCR_LOOP | scratch, port + UART_MCR); + outb_p(UART_MCR_LOOP | 0x0A, port + UART_MCR); scratch2 = inb_p(port + UART_MSR) & 0xF0; - outb_px(port + UART_MCR, scratch); + outb_p(scratch, port + UART_MCR); if (scratch2 != 0x90) { printk("gdb_hook_interrupt: " "Loop back test failed! Not a UART!\n"); @@ -304,24 +302,24 @@ program_uart(struct async_struct *info) int port = info->port; (void) inb_p(port + UART_RX); - outb_px(port + UART_IER, 0); + outb_p(0, port + UART_IER); (void) inb_p(port + UART_RX); /* serial driver comments say */ (void) inb_p(port + UART_IIR); /* this clears the interrupt regs */ (void) inb_p(port + UART_MSR); - outb_px(port + UART_LCR, UART_LCR_WLEN8 | UART_LCR_DLAB); - outb_px(port + UART_DLL, info->state->custom_divisor & 0xff); /* LS */ - outb_px(port + UART_DLM, info->state->custom_divisor >> 8); /* MS */ - outb_px(port + UART_MCR, info->MCR); - - outb_px(port + UART_FCR, UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_1 | UART_FCR_CLEAR_XMIT | UART_FCR_CLEAR_RCVR); /* set fcr */ - outb_px(port + UART_LCR, UART_LCR_WLEN8); /* reset DLAB */ - outb_px(port + UART_FCR, UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_1); /* set fcr */ + outb_p(UART_LCR_WLEN8 | UART_LCR_DLAB, port + UART_LCR); + outb_p(info->state->custom_divisor & 0xff, port + UART_DLL); /* LS */ + outb_p(info->state->custom_divisor >> 8, port + UART_DLM); /* MS */ + outb_p(info->MCR, port + UART_MCR); + + outb_p(UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_1 | UART_FCR_CLEAR_XMIT | UART_FCR_CLEAR_RCVR, port + UART_FCR); /* set fcr */ + outb_p(UART_LCR_WLEN8, port + UART_LCR); /* reset DLAB */ + outb_p(UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_1, port + UART_FCR); /* set fcr */ if (!ints_disabled) { intprintk(("KGDB: Sending %d to port %x offset %d\n", gdb_async_info->IER, (int) gdb_async_info->port, UART_IER)); - outb_px(gdb_async_info->port + UART_IER, gdb_async_info->IER); + outb_p(gdb_async_info->IER, gdb_async_info->port + UART_IER); } return; } @@ -430,7 +428,7 @@ kgdb_enable_ints_now(void) intprintk(("KGDB: Sending %d to port %x offset %d\n", gdb_async_info->IER, (int) gdb_async_info->port, UART_IER)); - outb_px(gdb_async_info->port + UART_IER, gdb_async_info->IER); + outb_p(gdb_async_info->IER, gdb_async_info->port + UART_IER); } exit: spin_unlock(&one_at_atime); @@ -468,8 +466,8 @@ putDebugChar(int chr) * but this. */ if (!ints_disabled) { - outb_px(gdb_async_info->port + UART_IER, - gdb_async_info->IER); + outb_p(gdb_async_info->IER, + gdb_async_info->port + UART_IER); } } _