kgdb_stubs.c 1.0 KB

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