main.c (ab129972c8b41e15b0521895a46fd9c752b68a5e) main.c (2bfe11c8fac96db4f94abbe818fbc964a6744130)
1/*
2 * qemu user main
3 *
4 * Copyright (c) 2003-2008 Fabrice Bellard
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 53 unchanged lines hidden (view full) ---

62
63#if defined(TARGET_I386)
64int cpu_get_pic_interrupt(CPUX86State *env)
65{
66 return -1;
67}
68#endif
69
1/*
2 * qemu user main
3 *
4 * Copyright (c) 2003-2008 Fabrice Bellard
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 53 unchanged lines hidden (view full) ---

62
63#if defined(TARGET_I386)
64int cpu_get_pic_interrupt(CPUX86State *env)
65{
66 return -1;
67}
68#endif
69
70/* These are no-ops because we are not threadsafe. */
71static inline void cpu_exec_start(CPUArchState *env)
72{
73}
74
75static inline void cpu_exec_end(CPUArchState *env)
76{
77}
78
79static inline void start_exclusive(void)
80{
81}
82
83static inline void end_exclusive(void)
84{
85}
86
70void fork_start(void)
71{
72}
73
74void fork_end(int child)
75{
76 if (child) {
77 gdbserver_fork(thread_cpu);
78 }
79}
80
87void fork_start(void)
88{
89}
90
91void fork_end(int child)
92{
93 if (child) {
94 gdbserver_fork(thread_cpu);
95 }
96}
97
98void cpu_list_lock(void)
99{
100}
101
102void cpu_list_unlock(void)
103{
104}
105
81#ifdef TARGET_I386
82/***********************************************************/
83/* CPUX86 core interface */
84
85uint64_t cpu_get_tsc(CPUX86State *env)
86{
87 return cpu_get_host_ticks();
88}

--- 53 unchanged lines hidden (view full) ---

142{
143 X86CPU *cpu = x86_env_get_cpu(env);
144 CPUState *cs = CPU(cpu);
145 int trapnr;
146 abi_ulong pc;
147 //target_siginfo_t info;
148
149 for(;;) {
106#ifdef TARGET_I386
107/***********************************************************/
108/* CPUX86 core interface */
109
110uint64_t cpu_get_tsc(CPUX86State *env)
111{
112 return cpu_get_host_ticks();
113}

--- 53 unchanged lines hidden (view full) ---

167{
168 X86CPU *cpu = x86_env_get_cpu(env);
169 CPUState *cs = CPU(cpu);
170 int trapnr;
171 abi_ulong pc;
172 //target_siginfo_t info;
173
174 for(;;) {
150 cpu_exec_start(cs);
151 trapnr = cpu_exec(cs);
175 trapnr = cpu_exec(cs);
152 cpu_exec_end(cs);
153 process_queued_cpu_work(cs);
154
155 switch(trapnr) {
156 case 0x80:
157 /* syscall from int $0x80 */
158 if (bsd_type == target_freebsd) {
159 abi_ulong params = (abi_ulong) env->regs[R_ESP] +
160 sizeof(int32_t);
161 int32_t syscall_nr = env->regs[R_EAX];
162 int32_t arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8;

--- 324 unchanged lines hidden (view full) ---

487
488void cpu_loop(CPUSPARCState *env)
489{
490 CPUState *cs = CPU(sparc_env_get_cpu(env));
491 int trapnr, ret, syscall_nr;
492 //target_siginfo_t info;
493
494 while (1) {
176 switch(trapnr) {
177 case 0x80:
178 /* syscall from int $0x80 */
179 if (bsd_type == target_freebsd) {
180 abi_ulong params = (abi_ulong) env->regs[R_ESP] +
181 sizeof(int32_t);
182 int32_t syscall_nr = env->regs[R_EAX];
183 int32_t arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8;

--- 324 unchanged lines hidden (view full) ---

508
509void cpu_loop(CPUSPARCState *env)
510{
511 CPUState *cs = CPU(sparc_env_get_cpu(env));
512 int trapnr, ret, syscall_nr;
513 //target_siginfo_t info;
514
515 while (1) {
495 cpu_exec_start(cs);
496 trapnr = cpu_exec(cs);
516 trapnr = cpu_exec(cs);
497 cpu_exec_end(cs);
498 process_queued_cpu_work(cs);
499
500 switch (trapnr) {
501#ifndef TARGET_SPARC64
502 case 0x80:
503#else
504 /* FreeBSD uses 0x141 for syscalls too */
505 case 0x141:
506 if (bsd_type != target_freebsd)

--- 218 unchanged lines hidden (view full) ---

725 char **target_environ, **wrk;
726 envlist_t *envlist = NULL;
727 char *trace_file = NULL;
728 bsd_type = target_openbsd;
729
730 if (argc <= 1)
731 usage();
732
517
518 switch (trapnr) {
519#ifndef TARGET_SPARC64
520 case 0x80:
521#else
522 /* FreeBSD uses 0x141 for syscalls too */
523 case 0x141:
524 if (bsd_type != target_freebsd)

--- 218 unchanged lines hidden (view full) ---

743 char **target_environ, **wrk;
744 envlist_t *envlist = NULL;
745 char *trace_file = NULL;
746 bsd_type = target_openbsd;
747
748 if (argc <= 1)
749 usage();
750
733 qemu_init_cpu_list();
734 module_call_init(MODULE_INIT_QOM);
735
736 if ((envlist = envlist_create()) == NULL) {
737 (void) fprintf(stderr, "Unable to allocate envlist\n");
738 exit(1);
739 }
740
741 /* add current environment into the list */

--- 369 unchanged lines hidden (view full) ---

1111#else
1112#error unsupported target CPU
1113#endif
1114
1115 if (gdbstub_port) {
1116 gdbserver_start (gdbstub_port);
1117 gdb_handlesig(cpu, 0);
1118 }
751 module_call_init(MODULE_INIT_QOM);
752
753 if ((envlist = envlist_create()) == NULL) {
754 (void) fprintf(stderr, "Unable to allocate envlist\n");
755 exit(1);
756 }
757
758 /* add current environment into the list */

--- 369 unchanged lines hidden (view full) ---

1128#else
1129#error unsupported target CPU
1130#endif
1131
1132 if (gdbstub_port) {
1133 gdbserver_start (gdbstub_port);
1134 gdb_handlesig(cpu, 0);
1135 }
1119 trace_init_vcpu_events();
1120 cpu_loop(env);
1121 /* never exits */
1122 return 0;
1123}
1136 cpu_loop(env);
1137 /* never exits */
1138 return 0;
1139}