Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | // ========== Copyright Header Begin ========================================== |
2 | // | |
3 | // OpenSPARC T2 Processor File: sam_internal.cpp | |
4 | // Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved | |
5 | // 4150 Network Circle, Santa Clara, California 95054, U.S.A. | |
6 | // | |
7 | // * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
8 | // | |
9 | // This program is free software; you can redistribute it and/or modify | |
10 | // it under the terms of the GNU General Public License as published by | |
11 | // the Free Software Foundation; version 2 of the License. | |
12 | // | |
13 | // This program is distributed in the hope that it will be useful, | |
14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | // GNU General Public License for more details. | |
17 | // | |
18 | // You should have received a copy of the GNU General Public License | |
19 | // along with this program; if not, write to the Free Software | |
20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
21 | // | |
22 | // For the avoidance of doubt, and except that if any non-GPL license | |
23 | // choice is available it will apply instead, Sun elects to use only | |
24 | // the General Public License version 2 (GPLv2) at this time for any | |
25 | // software where a choice of GPL license versions is made | |
26 | // available with the language indicating that GPLv2 or any later version | |
27 | // may be used, or where a choice of which version of the GPL is applied is | |
28 | // otherwise unspecified. | |
29 | // | |
30 | // Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
31 | // CA 95054 USA or visit www.sun.com if you need additional information or | |
32 | // have any questions. | |
33 | // | |
34 | // ========== Copyright Header End ============================================ | |
35 | // ========== Copyright Header Begin ========================================== | |
36 | // | |
37 | // OpenSPARC T2 Processor File: sam_internal.cpp | |
38 | // Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved | |
39 | // 4150 Network Circle, Santa Clara, California 95054, U.S.A. | |
40 | // | |
41 | // * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
42 | // | |
43 | // This program is free software; you can redistribute it and/or modify | |
44 | // it under the terms of the GNU General Public License as published by | |
45 | // the Free Software Foundation; version 2 of the License. | |
46 | // | |
47 | // This program is distributed in the hope that it will be useful, | |
48 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
49 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
50 | // GNU General Public License for more details. | |
51 | // | |
52 | // You should have received a copy of the GNU General Public License | |
53 | // along with this program; if not, write to the Free Software | |
54 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
55 | // | |
56 | // For the avoidance of doubt, and except that if any non-GPL license | |
57 | // choice is available it will apply instead, Sun elects to use only | |
58 | // the General Public License version 2 (GPLv2) at this time for any | |
59 | // software where a choice of GPL license versions is made | |
60 | // available with the language indicating that GPLv2 or any later version | |
61 | // may be used, or where a choice of which version of the GPL is applied is | |
62 | // otherwise unspecified. | |
63 | // | |
64 | // Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
65 | // CA 95054 USA or visit www.sun.com if you need additional information or | |
66 | // have any questions. | |
67 | // | |
68 | // ========== Copyright Header End ============================================ | |
69 | #include "loader.h" | |
70 | ||
71 | void *g_vcpu; | |
72 | extern "C" { | |
73 | // Complains if this is missing | |
74 | void __1cRUI_register_cmd_26Fpc0pFpvip0_ipF_i_v_() {} | |
75 | }; | |
76 | ||
77 | // Trivial MMI APIs | |
78 | mmi_bool_t mmi_register_instance_creator (const char * _modname, mmi_instance_creator fn) { | |
79 | fprintf(stderr, "Registering %s\n", _modname); | |
80 | module_info.create_instance = fn; | |
81 | return mmi_true; | |
82 | } | |
83 | ||
84 | mmi_instance_t mmi_get_instance(const char * instancename) { | |
85 | return (mmi_instance_t)(&module_info); | |
86 | } | |
87 | ||
88 | int mmi_argc(mmi_instance_t instance) { | |
89 | return module_info.argc; | |
90 | } | |
91 | ||
92 | char* mmi_argv(mmi_instance_t instance, int index) { | |
93 | return module_info.argv[index]; | |
94 | } | |
95 | ||
96 | void mmi_register_start_stop(mmi_start_stop_cb start_action, mmi_start_stop_cb stop_action, void * userdata) { | |
97 | } | |
98 | ||
99 | mmi_bool_t mmi_register_dump_restore(const char *name, mmi_dump_cb dump_fn, mmi_restore_cb restore_fn, void *userdata) { | |
100 | return mmi_true; | |
101 | } | |
102 | ||
103 | mmi_instance_t mmi_register_instance (const char * modname, const char *instance_name, void * instance_data, const char * help) { | |
104 | module_info.cb_data = instance_data; | |
105 | return (mmi_instance_t)(&module_info); | |
106 | } | |
107 | ||
108 | mmi_bool_t mmi_register_modinfo_cb (mmi_instance_t instance, mmi_modinfo_cb fn) { | |
109 | module_info.modinfo_cb = fn; | |
110 | return mmi_true; | |
111 | } | |
112 | ||
113 | mmi_bool_t mmi_register_interface_cb (mmi_instance_t instance, mmi_interface_cb fn) { | |
114 | module_info.interface_cb = fn; | |
115 | return mmi_true; | |
116 | } | |
117 | ||
118 | mmi_bool_t | |
119 | mmi_register_config_cb (mmi_instance_t instance, mmi_config_cb fn) | |
120 | { | |
121 | module_info.config_cb = fn; | |
122 | return mmi_true; | |
123 | } | |
124 | ||
125 | int netsim_snoop (char * buf, int len, int dbglvl) { | |
126 | return 1; | |
127 | } | |
128 | ||
129 | void mmi_register_instance_cmd(mmi_instance_t instance, const char * helpstring, mmi_instance_cmd_fn fn) { | |
130 | return; | |
131 | } | |
132 | ||
133 | // New | |
134 | extern "C" bool SYSTEM_is_sync_on() { | |
135 | return false; | |
136 | } | |
137 | ||
138 | typedef enum { | |
139 | TW_CURRENT, | |
140 | TW_INTERVAL, | |
141 | TW_MARK, | |
142 | TW_LENGTH | |
143 | } timewhence_t; | |
144 | ||
145 | uint64_t SYSTEM_get_time (timewhence_t whence) { | |
146 | return 0; | |
147 | } | |
148 | ||
149 | void SYSTEM_register_event ( | |
150 | uint64_t stime, /* microsecs, simulated time */ | |
151 | void* callback, void * arg1, void * arg2, | |
152 | void* unloadfunc, | |
153 | const char * debugstring) { | |
154 | return; | |
155 | } |