blob: 973287b67f303addc932ed9f4e5a58544091c060 [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
33void dputc(char c)
34{
35 if (c == '\n')
36 uart_putc(DEBUG_UART, '\r');
37 uart_putc(DEBUG_UART, c);
38}
39
40int dgetc(char *c)
41{
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
56void debug_halt(void)
57{
58 dprintf("HALT: spinning forever...\n");
59 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
82uint32_t debug_cycle_count(void)
83{
84// PANIC_UNIMPLEMENTED;
85 return 0;
86}