gdb-low.S 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. ###############################################################################
  2. #
  3. # MN10300 Low-level gdbstub routines
  4. #
  5. # Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
  6. # Written by David Howells (dhowells@redhat.com)
  7. #
  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.
  12. #
  13. ###############################################################################
  14. #include <linux/sys.h>
  15. #include <linux/linkage.h>
  16. #include <asm/smp.h>
  17. #include <asm/cache.h>
  18. #include <asm/cpu-regs.h>
  19. #include <asm/exceptions.h>
  20. #include <asm/frame.inc>
  21. #include <asm/serial-regs.h>
  22. .text
  23. ###############################################################################
  24. #
  25. # GDB stub read memory with guard
  26. # - D0 holds the memory address to read
  27. # - D1 holds the address to store the byte into
  28. #
  29. ###############################################################################
  30. .globl gdbstub_read_byte_guard
  31. .globl gdbstub_read_byte_cont
  32. ENTRY(gdbstub_read_byte)
  33. mov d0,a0
  34. mov d1,a1
  35. clr d0
  36. gdbstub_read_byte_guard:
  37. movbu (a0),d1
  38. gdbstub_read_byte_cont:
  39. movbu d1,(a1)
  40. ret [],0
  41. .globl gdbstub_read_word_guard
  42. .globl gdbstub_read_word_cont
  43. ENTRY(gdbstub_read_word)
  44. mov d0,a0
  45. mov d1,a1
  46. clr d0
  47. gdbstub_read_word_guard:
  48. movhu (a0),d1
  49. gdbstub_read_word_cont:
  50. movhu d1,(a1)
  51. ret [],0
  52. .globl gdbstub_read_dword_guard
  53. .globl gdbstub_read_dword_cont
  54. ENTRY(gdbstub_read_dword)
  55. mov d0,a0
  56. mov d1,a1
  57. clr d0
  58. gdbstub_read_dword_guard:
  59. mov (a0),d1
  60. gdbstub_read_dword_cont:
  61. mov d1,(a1)
  62. ret [],0
  63. ###############################################################################
  64. #
  65. # GDB stub write memory with guard
  66. # - D0 holds the byte to store
  67. # - D1 holds the memory address to write
  68. #
  69. ###############################################################################
  70. .globl gdbstub_write_byte_guard
  71. .globl gdbstub_write_byte_cont
  72. ENTRY(gdbstub_write_byte)
  73. mov d0,a0
  74. mov d1,a1
  75. clr d0
  76. gdbstub_write_byte_guard:
  77. movbu a0,(a1)
  78. gdbstub_write_byte_cont:
  79. ret [],0
  80. .globl gdbstub_write_word_guard
  81. .globl gdbstub_write_word_cont
  82. ENTRY(gdbstub_write_word)
  83. mov d0,a0
  84. mov d1,a1
  85. clr d0
  86. gdbstub_write_word_guard:
  87. movhu a0,(a1)
  88. gdbstub_write_word_cont:
  89. ret [],0
  90. .globl gdbstub_write_dword_guard
  91. .globl gdbstub_write_dword_cont
  92. ENTRY(gdbstub_write_dword)
  93. mov d0,a0
  94. mov d1,a1
  95. clr d0
  96. gdbstub_write_dword_guard:
  97. mov a0,(a1)
  98. gdbstub_write_dword_cont:
  99. ret [],0
  100. ###############################################################################
  101. #
  102. # GDB stub BUG() trap
  103. #
  104. ###############################################################################
  105. ENTRY(__gdbstub_bug_trap)
  106. .byte 0xF7,0xF7 # don't use 0xFF as the JTAG unit preempts that
  107. ret [],0