#endif
static const char *interp_prefix = CONFIG_QEMU_INTERP_PREFIX;
-const char *qemu_uname_release = CONFIG_UNAME_RELEASE;
+const char *qemu_uname_release;
extern char **environ;
enum BSDType bsd_type;
#endif
default:
pc = env->segs[R_CS].base + env->eip;
- fprintf(stderr, "qemu: 0x%08lx: unhandled CPU exception 0x%x - aborting\n",
- (long)pc, trapnr);
+ error_report("qemu: 0x%08lx: unhandled CPU exception 0x%x"
+ " - aborting", (long)pc, trapnr);
abort();
}
process_pending_signals(env);
module_call_init(MODULE_INIT_QOM);
if ((envlist = envlist_create()) == NULL) {
- (void) fprintf(stderr, "Unable to allocate envlist\n");
+ error_report("Unable to allocate envlist");
exit(1);
}
} else if (!strcmp(r, "ignore-environment")) {
envlist_free(envlist);
if ((envlist = envlist_create()) == NULL) {
- (void) fprintf(stderr, "Unable to allocate envlist\n");
+ error_report("Unable to allocate envlist");
exit(1);
}
} else if (!strcmp(r, "U")) {
qemu_host_page_size = atoi(argv[optind++]);
if (qemu_host_page_size == 0 ||
(qemu_host_page_size & (qemu_host_page_size - 1)) != 0) {
- fprintf(stderr, "page size must be a power of two\n");
+ error_report("page size must be a power of two");
exit(1);
}
} else if (!strcmp(r, "g")) {
qemu_host_page_size */
env = cpu_init(cpu_model);
if (!env) {
- fprintf(stderr, "Unable to find CPU definition\n");
+ error_report("Unable to find CPU definition");
exit(1);
}
cpu = ENV_GET_CPU(env);
memset(ts, 0, sizeof(TaskState));
init_task_state(ts);
ts->info = info;
- env->opaque = ts;
+ cpu->opaque = ts;
#if defined(TARGET_I386)
- cpu_x86_set_cpl(env, 3);
-
env->cr[0] = CR0_PG_MASK | CR0_WP_MASK | CR0_PE_MASK;
env->hflags |= HF_PE_MASK;
if (env->features[FEAT_1_EDX] & CPUID_SSE) {
#ifndef TARGET_ABI32
/* enable 64 bit mode if possible */
if (!(env->features[FEAT_8000_0001_EDX] & CPUID_EXT2_LM)) {
- fprintf(stderr, "The selected x86 CPU does not support 64 bit mode\n");
+ error_report("The selected x86 CPU does not support 64 bit mode");
exit(1);
}
env->cr[4] |= CR4_PAE_MASK;