kgdb_stubs.c 1005 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * U-Boot - stub functions for common kgdb code,
  3. * can be overridden in board specific files
  4. *
  5. * Copyright 2009 Analog Devices Inc.
  6. *
  7. * Licensed under the GPL-2 or later.
  8. */
  9. #include <common.h>
  10. #include <kgdb.h>
  11. int (*debugger_exception_handler)(struct pt_regs *);
  12. __attribute__((weak))
  13. void kgdb_serial_init(void)
  14. {
  15. puts("[on serial] ");
  16. }
  17. __attribute__((weak))
  18. void putDebugChar(int c)
  19. {
  20. serial_putc(c);
  21. }
  22. __attribute__((weak))
  23. void putDebugStr(const char *str)
  24. {
  25. #ifdef DEBUG
  26. serial_puts(str);
  27. #endif
  28. }
  29. __attribute__((weak))
  30. int getDebugChar(void)
  31. {
  32. return serial_getc();
  33. }
  34. __attribute__((weak))
  35. void kgdb_interruptible(int yes)
  36. {
  37. return;
  38. }
  39. __attribute__((weak))
  40. void kgdb_flush_cache_range(void *from, void *to)
  41. {
  42. flush_cache((unsigned long)from, (unsigned long)(to - from));
  43. }
  44. __attribute__((weak))
  45. void kgdb_flush_cache_all(void)
  46. {
  47. if (dcache_status()) {
  48. dcache_disable();
  49. dcache_enable();
  50. }
  51. if (icache_status()) {
  52. icache_disable();
  53. icache_enable();
  54. }
  55. }