Commit 73332e5ccdc760c9f0861dd8528dd7702afce088

Authored by bellard
1 parent 1f673135

qemu fast fix


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@706 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 26 additions and 28 deletions
... ... @@ -52,6 +52,17 @@
52 52 #define memalign(align, size) malloc(size)
53 53 #endif
54 54  
  55 +#ifdef CONFIG_SDL
  56 +/* SDL use the pthreads and they modify sigaction. We don't
  57 + want that. */
  58 +#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
  59 +extern void __libc_sigaction();
  60 +#define sigaction(sig, act, oact) __libc_sigaction(sig, act, oact)
  61 +#else
  62 +extern void __sigaction();
  63 +#define sigaction(sig, act, oact) __sigaction(sig, act, oact)
  64 +#endif
  65 +#endif /* CONFIG_SDL */
55 66  
56 67 #include "disas.h"
57 68  
... ... @@ -1544,7 +1555,7 @@ int main_loop(void)
1544 1555 }
1545 1556 ioh->max_size = max_size;
1546 1557 }
1547   -
  1558 +
1548 1559 ret = poll(ufds, pf - ufds, timeout);
1549 1560 if (ret > 0) {
1550 1561 /* XXX: better handling of removal */
... ... @@ -1669,18 +1680,6 @@ struct option long_options[] = {
1669 1680 { NULL, 0, NULL, 0 },
1670 1681 };
1671 1682  
1672   -#ifdef CONFIG_SDL
1673   -/* SDL use the pthreads and they modify sigaction. We don't
1674   - want that. */
1675   -#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
1676   -extern void __libc_sigaction();
1677   -#define sigaction(sig, act, oact) __libc_sigaction(sig, act, oact)
1678   -#else
1679   -extern void __sigaction();
1680   -#define sigaction(sig, act, oact) __sigaction(sig, act, oact)
1681   -#endif
1682   -#endif /* CONFIG_SDL */
1683   -
1684 1683 #if defined (TARGET_I386) && defined(USE_CODE_COPY)
1685 1684  
1686 1685 /* this stack is only used during signal handling */
... ... @@ -2045,8 +2044,6 @@ int main(int argc, char **argv)
2045 2044 }
2046 2045 }
2047 2046  
2048   - init_timers();
2049   -
2050 2047 /* init CPU state */
2051 2048 env = cpu_init();
2052 2049 global_env = env;
... ... @@ -2070,25 +2067,13 @@ int main(int argc, char **argv)
2070 2067 #endif
2071 2068 }
2072 2069  
2073   -#if defined(TARGET_I386)
2074   - pc_init(ram_size, vga_ram_size, boot_device,
2075   - ds, fd_filename, snapshot,
2076   - kernel_filename, kernel_cmdline, initrd_filename);
2077   -#elif defined(TARGET_PPC)
2078   - ppc_init();
2079   -#endif
2080   -
2081   - /* launched after the device init so that it can display or not a
2082   - banner */
2083   - monitor_init();
2084   -
2085 2070 /* setup cpu signal handlers for MMU / self modifying code handling */
2086 2071 #if !defined(CONFIG_SOFTMMU)
2087 2072  
2088 2073 #if defined (TARGET_I386) && defined(USE_CODE_COPY)
2089 2074 {
2090 2075 stack_t stk;
2091   - signal_stack = malloc(SIGNAL_STACK_SIZE);
  2076 + signal_stack = memalign(16, SIGNAL_STACK_SIZE);
2092 2077 stk.ss_sp = signal_stack;
2093 2078 stk.ss_size = SIGNAL_STACK_SIZE;
2094 2079 stk.ss_flags = 0;
... ... @@ -2125,6 +2110,19 @@ int main(int argc, char **argv)
2125 2110 sigaction(SIGPIPE, &act, NULL);
2126 2111 }
2127 2112 #endif
  2113 + init_timers();
  2114 +
  2115 +#if defined(TARGET_I386)
  2116 + pc_init(ram_size, vga_ram_size, boot_device,
  2117 + ds, fd_filename, snapshot,
  2118 + kernel_filename, kernel_cmdline, initrd_filename);
  2119 +#elif defined(TARGET_PPC)
  2120 + ppc_init();
  2121 +#endif
  2122 +
  2123 + /* launched after the device init so that it can display or not a
  2124 + banner */
  2125 + monitor_init();
2128 2126  
2129 2127 gui_timer = qemu_new_timer(rt_clock, gui_update, NULL);
2130 2128 qemu_mod_timer(gui_timer, qemu_get_clock(rt_clock));
... ...