Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: debug_log.c | |
5 | * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. | |
6 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES. | |
7 | * | |
8 | * The above named program is free software; you can redistribute it and/or | |
9 | * modify it under the terms of the GNU General Public | |
10 | * License version 2 as published by the Free Software Foundation. | |
11 | * | |
12 | * The above named program is distributed in the hope that it will be | |
13 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | * General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public | |
18 | * License along with this work; if not, write to the Free Software | |
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. | |
20 | * | |
21 | * ========== Copyright Header End ============================================ | |
22 | */ | |
23 | /* | |
24 | * Copyright 2006 Sun Microsystems, Inc. All rights reserved. | |
25 | * Use is subject to license terms. | |
26 | */ | |
27 | #pragma ident "@(#)debug_log.c 1.3 06/10/25 SMI" | |
28 | ||
29 | #include <stdio.h> | |
30 | #include <stdlib.h> | |
31 | #include <unistd.h> | |
32 | #include <sys/types.h> | |
33 | #include <sys/ipc.h> | |
34 | #include <sys/shm.h> | |
35 | #include <assert.h> | |
36 | #include <string.h> | |
37 | #include <strings.h> | |
38 | ||
39 | #include "ss_common.h" | |
40 | #include "niagara.h" | |
41 | ||
42 | #if 1 | |
43 | #define DBGP(s) do { s } while (0) | |
44 | #endif | |
45 | ||
46 | void dbg_debug_log(simcpu_t *sp, uint32_t rawi); | |
47 | void dbg_debug_log_parse(void); | |
48 | void dbg_debug_log_dump(void); | |
49 | ||
50 | extern void debug_log(simcpu_t *sp, uint32_t rawi); | |
51 | extern void debug_log_print(void); | |
52 | ||
53 | /* | |
54 | * Will be called while parsing the conf file | |
55 | * to allow this hook to parse specific options from | |
56 | * the conf file. | |
57 | * | |
58 | * Format of debug_log directive is: | |
59 | * debug_hook debug_log | |
60 | * XXX FIXME: we could add a token here to specify the | |
61 | * size of the debug_log | |
62 | * XXX FIXME: we could add a token here to specify the | |
63 | * the %pc or instn count to start the debug_log | |
64 | * | |
65 | */ | |
66 | void | |
67 | dbg_debug_log_parse(void) | |
68 | { | |
69 | DBGP(printf("\nInside dbg_debug_log_parse();");); | |
70 | } | |
71 | ||
72 | /* | |
73 | * This function will get called before each instruction | |
74 | * gets executed. | |
75 | */ | |
76 | void | |
77 | dbg_debug_log(simcpu_t *sp, uint32_t rawi) | |
78 | { | |
79 | /* | |
80 | * call back to legions existing debug_log routine | |
81 | */ | |
82 | debug_log(sp, rawi); | |
83 | } | |
84 | ||
85 | /* | |
86 | * This function will get called when ~l is input on the console | |
87 | */ | |
88 | void | |
89 | dbg_debug_log_dump(void) | |
90 | { | |
91 | ||
92 | DBGP(printf("\ndebug_log_dump() - calling debug_log_print()\n");); | |
93 | /* | |
94 | * call back to legions existing debug_log_print routine | |
95 | */ | |
96 | debug_log_print(); | |
97 | } |