Path: blob/master/arch/mn10300/kernel/gdb-io-serial-low.S
10817 views
###############################################################################1#2# 16550 serial Rx interrupt handler for gdbstub I/O3#4# Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.5# Written by David Howells ([email protected])6#7# This program is free software; you can redistribute it and/or8# modify it under the terms of the GNU General Public Licence9# as published by the Free Software Foundation; either version10# 2 of the Licence, or (at your option) any later version.11#12###############################################################################13#include <linux/sys.h>14#include <linux/linkage.h>15#include <asm/smp.h>16#include <asm/cpu-regs.h>17#include <asm/thread_info.h>18#include <asm/frame.inc>19#include <asm/intctl-regs.h>20#include <asm/irqflags.h>21#include <unit/serial.h>2223.text2425###############################################################################26#27# GDB stub serial receive interrupt entry point28# - intended to run at interrupt priority 029#30###############################################################################31.globl gdbstub_io_rx_handler32.type gdbstub_io_rx_handler,@function33gdbstub_io_rx_handler:34movm [d2,d3,a2,a3],(sp)3536#if 137movbu (GDBPORT_SERIAL_IIR),d238#endif3940mov (gdbstub_rx_inp),a341gdbstub_io_rx_more:42mov a3,a243add 2,a344and 0x00000fff,a345mov (gdbstub_rx_outp),d346cmp a3,d347beq gdbstub_io_rx_overflow4849movbu (GDBPORT_SERIAL_LSR),d350btst UART_LSR_DR,d351beq gdbstub_io_rx_done52movbu (GDBPORT_SERIAL_RX),d253movbu d3,(gdbstub_rx_buffer+1,a2)54movbu d2,(gdbstub_rx_buffer,a2)55mov a3,(gdbstub_rx_inp)56bra gdbstub_io_rx_more5758gdbstub_io_rx_done:59mov GxICR_DETECT,d260movbu d2,(XIRQxICR(GDBPORT_SERIAL_IRQ)) # ACK the interrupt61movhu (XIRQxICR(GDBPORT_SERIAL_IRQ)),d2 # flush62movm (sp),[d2,d3,a2,a3]63bset 0x01,(gdbstub_busy)64beq gdbstub_io_rx_enter65rti6667gdbstub_io_rx_overflow:68bset 0x01,(gdbstub_rx_overflow)69bra gdbstub_io_rx_done7071gdbstub_io_rx_enter:72LOCAL_CHANGE_INTR_MASK_LEVEL(NUM2EPSW_IM(CONFIG_GDBSTUB_IRQ_LEVEL+1))73add -4,sp74SAVE_ALL7576mov 0xffffffff,d077mov d0,(REG_ORIG_D0,fp)78mov 0x280,d17980mov fp,d081call gdbstub_rx_irq[],0 # gdbstub_rx_irq(regs,excep)8283LOCAL_CLI84bclr 0x01,(gdbstub_busy)8586.globl gdbstub_return87gdbstub_return:88RESTORE_ALL8990.size gdbstub_io_rx_handler,.-gdbstub_io_rx_handler919293