blob: 87aac8d24554a632a6470940a374ecc39ce9d1c4 [file] [log] [blame]
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -07001/*
2 * Copyright (c) 2008 Travis Geiselbrecht
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files
6 * (the "Software"), to deal in the Software without restriction,
7 * including without limitation the rights to use, copy, modify, merge,
8 * publish, distribute, sublicense, and/or sell copies of the Software,
9 * and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 */
23#include <stdarg.h>
24#include <reg.h>
25#include <debug.h>
26#include <printf.h>
27#include <kernel/thread.h>
28#include <platform/debug.h>
29#include <arch/ops.h>
30#include <dev/uart.h>
31#include <target/debugconfig.h>
32
Travis Geiselbrechteb946052008-09-07 22:32:49 -070033void _dputc(char c)
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -070034{
35 if (c == '\n')
36 uart_putc(DEBUG_UART, '\r');
37 uart_putc(DEBUG_UART, c);
38}
39
Travis Geiselbrechtdbc2c682009-06-28 12:18:39 -070040int dgetc(char *c, bool wait)
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -070041{
42 int _c;
43
44 if ((_c = uart_getc(DEBUG_UART, false)) < 0)
45 return -1;
46
47 *c = _c;
48 return 0;
49}
50
51void debug_dump_regs(void)
52{
53 PANIC_UNIMPLEMENTED;
54}
55
Travis Geiselbrechteb946052008-09-07 22:32:49 -070056void platform_halt(void)
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -070057{
Travis Geiselbrechteb946052008-09-07 22:32:49 -070058 dprintf(ALWAYS, "HALT: spinning forever...\n");
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -070059 for(;;);
60}
61
62void debug_dump_memory_bytes(void *mem, int len)
63{
64 PANIC_UNIMPLEMENTED;
65}
66
67void debug_dump_memory_halfwords(void *mem, int len)
68{
69 PANIC_UNIMPLEMENTED;
70}
71
72void debug_dump_memory_words(void *mem, int len)
73{
74 PANIC_UNIMPLEMENTED;
75}
76
77void debug_set_trace_level(int trace_type, int level)
78{
79 PANIC_UNIMPLEMENTED;
80}
81