28 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
29 |
* |
* |
30 |
* |
* |
31 |
* $Id: misc.h,v 1.251 2007/03/16 14:45:30 debug Exp $ |
* $Id: misc.h,v 1.257 2007/06/15 17:12:31 debug Exp $ |
32 |
* |
* |
33 |
* Misc. definitions for gxemul. |
* Misc. definitions for gxemul. |
34 |
*/ |
*/ |
162 |
#define DEBUG_INDENTATION 4 |
#define DEBUG_INDENTATION 4 |
163 |
|
|
164 |
|
|
165 |
|
#ifdef HAVE___FUNCTION__ |
166 |
|
|
167 |
|
#define FAILURE(error_msg) { \ |
168 |
|
char where_msg[400]; \ |
169 |
|
snprintf(where_msg, sizeof(where_msg), \ |
170 |
|
"%s, line %i, function '%s'\n", \ |
171 |
|
__FILE__, __LINE__, __FUNCTION__); \ |
172 |
|
fprintf(stderr, "%s: %s\n", error_msg, where_msg); \ |
173 |
|
exit(1); \ |
174 |
|
} |
175 |
|
|
176 |
|
#else |
177 |
|
|
178 |
|
#define FAILURE(error_msg) { \ |
179 |
|
char where_msg[400]; \ |
180 |
|
snprintf(where_msg, sizeof(where_msg), \ |
181 |
|
"%s, line %i\n", __FILE__, __LINE__); \ |
182 |
|
fprintf(stderr, "%s: %s\n", error_msg, where_msg); \ |
183 |
|
exit(1); \ |
184 |
|
} |
185 |
|
|
186 |
|
#endif /* !HAVE___FUNCTION__ */ |
187 |
|
|
188 |
|
|
189 |
|
#define CHECK_ALLOCATION(ptr) { \ |
190 |
|
if ((ptr) == NULL) \ |
191 |
|
FAILURE("Out of memory"); \ |
192 |
|
} |
193 |
|
|
194 |
|
|
195 |
/* bootblock.c: */ |
/* bootblock.c: */ |
196 |
int load_bootblock(struct machine *m, struct cpu *cpu, |
int load_bootblock(struct machine *m, struct cpu *cpu, |
197 |
int *n_loadp, char ***load_namesp); |
int *n_loadp, char ***load_namesp); |
241 |
size_t mystrlcpy(char *dst, const char *src, size_t size); |
size_t mystrlcpy(char *dst, const char *src, size_t size); |
242 |
size_t mystrlcat(char *dst, const char *src, size_t size); |
size_t mystrlcat(char *dst, const char *src, size_t size); |
243 |
#endif |
#endif |
244 |
|
void print_separator_line(void); |
245 |
|
|
246 |
|
|
247 |
/* pc_bios.c: */ |
/* mvmeprom.c: */ |
248 |
void pc_bios_simple_pmode_setup(struct cpu *cpu); |
void mvmeprom_init(struct machine *machine); |
249 |
void pc_bios_init(struct cpu *cpu); |
int mvmeprom_emul(struct cpu *cpu); |
|
int pc_bios_emul(struct cpu *cpu); |
|
250 |
|
|
251 |
|
|
252 |
/* ps2_bios.c: */ |
/* ps2_bios.c: */ |
258 |
int sh_ipl_g_emul(struct cpu *); |
int sh_ipl_g_emul(struct cpu *); |
259 |
|
|
260 |
|
|
|
/* useremul.c: */ |
|
|
void useremul_setup(struct cpu *, int, char **); |
|
|
void useremul_syscall(struct cpu *cpu, uint32_t code); |
|
|
void useremul_name_to_useremul(struct cpu *, char *name, |
|
|
int *arch, char **machine_name, char **cpu_name); |
|
|
void useremul_list_emuls(void); |
|
|
void useremul_init(void); |
|
|
|
|
|
|
|
261 |
/* yamon.c: */ |
/* yamon.c: */ |
262 |
void yamon_machine_setup(struct machine *machine, uint64_t env); |
void yamon_machine_setup(struct machine *machine, uint64_t env); |
263 |
int yamon_emul(struct cpu *); |
int yamon_emul(struct cpu *); |