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