Btrfs: fix unclosed transaction handle in btrfs_cont_expand
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / mn10300 / kernel / gdb-io-serial-low.S
blobb1d0152e96cb95741b0e31fd2ebf0782bbb0283e
1 ###############################################################################
3 # 16550 serial Rx interrupt handler for gdbstub I/O
5 # Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
6 # Written by David Howells (dhowells@redhat.com)
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public Licence
10 # as published by the Free Software Foundation; either version
11 # 2 of the Licence, or (at your option) any later version.
13 ###############################################################################
14 #include <linux/sys.h>
15 #include <linux/linkage.h>
16 #include <asm/smp.h>
17 #include <asm/cpu-regs.h>
18 #include <asm/thread_info.h>
19 #include <asm/frame.inc>
20 #include <asm/intctl-regs.h>
21 #include <asm/irqflags.h>
22 #include <unit/serial.h>
24         .text
26 ###############################################################################
28 # GDB stub serial receive interrupt entry point
29 # - intended to run at interrupt priority 0
31 ###############################################################################
32         .globl  gdbstub_io_rx_handler
33         .type   gdbstub_io_rx_handler,@function
34 gdbstub_io_rx_handler:
35         movm    [d2,d3,a2,a3],(sp)
37 #if 1
38         movbu   (GDBPORT_SERIAL_IIR),d2
39 #endif
41         mov     (gdbstub_rx_inp),a3
42 gdbstub_io_rx_more:
43         mov     a3,a2
44         add     2,a3
45         and     0x00000fff,a3
46         mov     (gdbstub_rx_outp),d3
47         cmp     a3,d3
48         beq     gdbstub_io_rx_overflow
50         movbu   (GDBPORT_SERIAL_LSR),d3
51         btst    UART_LSR_DR,d3
52         beq     gdbstub_io_rx_done
53         movbu   (GDBPORT_SERIAL_RX),d2
54         movbu   d3,(gdbstub_rx_buffer+1,a2)
55         movbu   d2,(gdbstub_rx_buffer,a2)
56         mov     a3,(gdbstub_rx_inp)
57         bra     gdbstub_io_rx_more
59 gdbstub_io_rx_done:
60         mov     GxICR_DETECT,d2
61         movbu   d2,(XIRQxICR(GDBPORT_SERIAL_IRQ))       # ACK the interrupt
62         movhu   (XIRQxICR(GDBPORT_SERIAL_IRQ)),d2       # flush
63         movm    (sp),[d2,d3,a2,a3]
64         bset    0x01,(gdbstub_busy)
65         beq     gdbstub_io_rx_enter
66         rti
68 gdbstub_io_rx_overflow:
69         bset    0x01,(gdbstub_rx_overflow)
70         bra     gdbstub_io_rx_done
72 gdbstub_io_rx_enter:
73         LOCAL_CHANGE_INTR_MASK_LEVEL(NUM2EPSW_IM(CONFIG_GDBSTUB_IRQ_LEVEL+1))
74         add     -4,sp
75         SAVE_ALL
77         mov     0xffffffff,d0
78         mov     d0,(REG_ORIG_D0,fp)
79         mov     0x280,d1
81         mov     fp,d0
82         call    gdbstub_rx_irq[],0      # gdbstub_rx_irq(regs,excep)
84         LOCAL_CLI
85         bclr    0x01,(gdbstub_busy)
87         .globl gdbstub_return
88 gdbstub_return:
89         RESTORE_ALL
91         .size   gdbstub_io_rx_handler,.-gdbstub_io_rx_handler