Path: blob/master/arch/mn10300/kernel/gdb-io-ttysm-low.S
10817 views
###############################################################################1#2# MN10300 On-chip serial Rx interrupt handler for GDB stub 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/thread_info.h>17#include <asm/cpu-regs.h>18#include <asm/frame.inc>19#include <asm/intctl-regs.h>20#include <unit/serial.h>21#include "mn10300-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)3536mov (gdbstub_rx_inp),a337gdbstub_io_rx_more:38mov a3,a239add 2,a340and PAGE_SIZE_asm-1,a341mov (gdbstub_rx_outp),d342cmp a3,d343beq gdbstub_io_rx_overflow4445movbu (SCgSTR),d346btst SC01STR_RBF,d347beq gdbstub_io_rx_done48movbu (SCgRXB),d249movbu d3,(gdbstub_rx_buffer+1,a2)50movbu d2,(gdbstub_rx_buffer,a2)51mov a3,(gdbstub_rx_inp)52bra gdbstub_io_rx_more5354gdbstub_io_rx_done:55mov GxICR_DETECT,d256movbu d2,(GxICR(SCgRXIRQ)) # ACK the interrupt57movhu (GxICR(SCgRXIRQ)),d2 # flush5859movm (sp),[d2,d3,a2,a3]60bset 0x01,(gdbstub_busy)61beq gdbstub_io_rx_enter62rti6364gdbstub_io_rx_overflow:65bset 0x01,(gdbstub_rx_overflow)66bra gdbstub_io_rx_done6768###############################################################################69#70# debugging interrupt - enter the GDB stub proper71#72###############################################################################73gdbstub_io_rx_enter:74or EPSW_IE|EPSW_IM_1,epsw75add -4,sp76SAVE_ALL7778mov 0xffffffff,d079mov d0,(REG_ORIG_D0,fp)80mov 0x280,d18182mov fp,d083call gdbstub_rx_irq[],0 # gdbstub_io_rx_irq(regs,excep)8485and ~EPSW_IE,epsw86bclr 0x01,(gdbstub_busy)8788.globl gdbstub_return89gdbstub_return:90RESTORE_ALL9192.size gdbstub_io_rx_handler,.-gdbstub_io_rx_handler939495