###############################################################################1#2# MN10300 Low-level gdbstub routines3#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/cache.h>17#include <asm/cpu-regs.h>18#include <asm/exceptions.h>19#include <asm/frame.inc>20#include <asm/serial-regs.h>2122.text2324###############################################################################25#26# GDB stub read memory with guard27# - D0 holds the memory address to read28# - D1 holds the address to store the byte into29#30###############################################################################31.globl gdbstub_read_byte_guard32.globl gdbstub_read_byte_cont33ENTRY(gdbstub_read_byte)34mov d0,a035mov d1,a136clr d037gdbstub_read_byte_guard:38movbu (a0),d139gdbstub_read_byte_cont:40movbu d1,(a1)41ret [],04243.globl gdbstub_read_word_guard44.globl gdbstub_read_word_cont45ENTRY(gdbstub_read_word)46mov d0,a047mov d1,a148clr d049gdbstub_read_word_guard:50movhu (a0),d151gdbstub_read_word_cont:52movhu d1,(a1)53ret [],05455.globl gdbstub_read_dword_guard56.globl gdbstub_read_dword_cont57ENTRY(gdbstub_read_dword)58mov d0,a059mov d1,a160clr d061gdbstub_read_dword_guard:62mov (a0),d163gdbstub_read_dword_cont:64mov d1,(a1)65ret [],06667###############################################################################68#69# GDB stub write memory with guard70# - D0 holds the byte to store71# - D1 holds the memory address to write72#73###############################################################################74.globl gdbstub_write_byte_guard75.globl gdbstub_write_byte_cont76ENTRY(gdbstub_write_byte)77mov d0,a078mov d1,a179clr d080gdbstub_write_byte_guard:81movbu a0,(a1)82gdbstub_write_byte_cont:83ret [],08485.globl gdbstub_write_word_guard86.globl gdbstub_write_word_cont87ENTRY(gdbstub_write_word)88mov d0,a089mov d1,a190clr d091gdbstub_write_word_guard:92movhu a0,(a1)93gdbstub_write_word_cont:94ret [],09596.globl gdbstub_write_dword_guard97.globl gdbstub_write_dword_cont98ENTRY(gdbstub_write_dword)99mov d0,a0100mov d1,a1101clr d0102gdbstub_write_dword_guard:103mov a0,(a1)104gdbstub_write_dword_cont:105ret [],0106107###############################################################################108#109# GDB stub BUG() trap110#111###############################################################################112ENTRY(__gdbstub_bug_trap)113.byte 0xF7,0xF7 # don't use 0xFF as the JTAG unit preempts that114ret [],0115116117