kgdb_stubs.c 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. #include <serial.h>
  12. int (*debugger_exception_handler)(struct pt_regs *);
  13. __attribute__((weak))
  14. void kgdb_serial_init(void)
  15. {
  16. puts("[on serial] ");
  17. }
  18. __attribute__((weak))
  19. void putDebugChar(int c)
  20. {
  21. serial_putc(c);
  22. }
  23. __attribute__((weak))
  24. void putDebugStr(const char *str)
  25. {
  26. #ifdef DEBUG
  27. serial_puts(str);
  28. #endif
  29. }
  30. __attribute__((weak))
  31. int getDebugChar(void)
  32. {
  33. return serial_getc();
  34. }
  35. __attribute__((weak))
  36. void kgdb_interruptible(int yes)
  37. {
  38. return;
  39. }
  40. __attribute__((weak))
  41. void kgdb_flush_cache_range(void *from, void *to)
  42. {
  43. flush_cache((unsigned long)from, (unsigned long)(to - from));
  44. }
  45. __attribute__((weak))
  46. void kgdb_flush_cache_all(void)
  47. {
  48. if (dcache_status()) {
  49. dcache_disable();
  50. dcache_enable();
  51. }
  52. if (icache_status()) {
  53. icache_disable();
  54. icache_enable();
  55. }
  56. }