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