netx.S 795 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Debugging macro include header
  3. *
  4. * Copyright (C) 1994-1999 Russell King
  5. * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. *
  11. */
  12. #define UART_DATA 0
  13. #define UART_FLAG 0x18
  14. #define UART_FLAG_BUSY (1 << 3)
  15. .macro addruart, rp, rv, tmp
  16. ldr \rp, =CONFIG_DEBUG_UART_PHYS
  17. ldr \rv, =CONFIG_DEBUG_UART_VIRT
  18. .endm
  19. .macro senduart,rd,rx
  20. str \rd, [\rx, #UART_DATA]
  21. .endm
  22. .macro busyuart,rd,rx
  23. 1002: ldr \rd, [\rx, #UART_FLAG]
  24. tst \rd, #UART_FLAG_BUSY
  25. bne 1002b
  26. .endm
  27. .macro waituart,rd,rx
  28. 1001: ldr \rd, [\rx, #UART_FLAG]
  29. tst \rd, #UART_FLAG_BUSY
  30. bne 1001b
  31. .endm