Commit be995c27640a82c7056b6f53d02ec823570114e5
1 parent
6b1575b7
removed unused code - init timers earlier
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2011 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
10 additions
and
118 deletions
vl.c
@@ -92,11 +92,7 @@ | @@ -92,11 +92,7 @@ | ||
92 | //#define DEBUG_UNUSED_IOPORT | 92 | //#define DEBUG_UNUSED_IOPORT |
93 | //#define DEBUG_IOPORT | 93 | //#define DEBUG_IOPORT |
94 | 94 | ||
95 | -#if !defined(CONFIG_SOFTMMU) | ||
96 | -#define PHYS_RAM_MAX_SIZE (256 * 1024 * 1024) | ||
97 | -#else | ||
98 | #define PHYS_RAM_MAX_SIZE (2047 * 1024 * 1024) | 95 | #define PHYS_RAM_MAX_SIZE (2047 * 1024 * 1024) |
99 | -#endif | ||
100 | 96 | ||
101 | #ifdef TARGET_PPC | 97 | #ifdef TARGET_PPC |
102 | #define DEFAULT_RAM_SIZE 144 | 98 | #define DEFAULT_RAM_SIZE 144 |
@@ -3860,20 +3856,6 @@ void dumb_display_init(DisplayState *ds) | @@ -3860,20 +3856,6 @@ void dumb_display_init(DisplayState *ds) | ||
3860 | ds->dpy_refresh = dumb_refresh; | 3856 | ds->dpy_refresh = dumb_refresh; |
3861 | } | 3857 | } |
3862 | 3858 | ||
3863 | -#if !defined(CONFIG_SOFTMMU) | ||
3864 | -/***********************************************************/ | ||
3865 | -/* cpu signal handler */ | ||
3866 | -static void host_segv_handler(int host_signum, siginfo_t *info, | ||
3867 | - void *puc) | ||
3868 | -{ | ||
3869 | - if (cpu_signal_handler(host_signum, info, puc)) | ||
3870 | - return; | ||
3871 | - if (stdio_nb_clients > 0) | ||
3872 | - term_exit(); | ||
3873 | - abort(); | ||
3874 | -} | ||
3875 | -#endif | ||
3876 | - | ||
3877 | /***********************************************************/ | 3859 | /***********************************************************/ |
3878 | /* I/O handling */ | 3860 | /* I/O handling */ |
3879 | 3861 | ||
@@ -5133,23 +5115,13 @@ void help(void) | @@ -5133,23 +5115,13 @@ void help(void) | ||
5133 | "\n" | 5115 | "\n" |
5134 | "When using -nographic, press 'ctrl-a h' to get some help.\n" | 5116 | "When using -nographic, press 'ctrl-a h' to get some help.\n" |
5135 | , | 5117 | , |
5136 | -#ifdef CONFIG_SOFTMMU | ||
5137 | "qemu", | 5118 | "qemu", |
5138 | -#else | ||
5139 | - "qemu-fast", | ||
5140 | -#endif | ||
5141 | DEFAULT_RAM_SIZE, | 5119 | DEFAULT_RAM_SIZE, |
5142 | #ifndef _WIN32 | 5120 | #ifndef _WIN32 |
5143 | DEFAULT_NETWORK_SCRIPT, | 5121 | DEFAULT_NETWORK_SCRIPT, |
5144 | #endif | 5122 | #endif |
5145 | DEFAULT_GDBSTUB_PORT, | 5123 | DEFAULT_GDBSTUB_PORT, |
5146 | "/tmp/qemu.log"); | 5124 | "/tmp/qemu.log"); |
5147 | -#ifndef CONFIG_SOFTMMU | ||
5148 | - printf("\n" | ||
5149 | - "NOTE: this version of QEMU is faster but it needs slightly patched OSes to\n" | ||
5150 | - "work. Please use the 'qemu' executable to have a more accurate (but slower)\n" | ||
5151 | - "PC emulation.\n"); | ||
5152 | -#endif | ||
5153 | exit(1); | 5125 | exit(1); |
5154 | } | 5126 | } |
5155 | 5127 | ||
@@ -5512,10 +5484,17 @@ int main(int argc, char **argv) | @@ -5512,10 +5484,17 @@ int main(int argc, char **argv) | ||
5512 | int usb_devices_index; | 5484 | int usb_devices_index; |
5513 | 5485 | ||
5514 | LIST_INIT (&vm_change_state_head); | 5486 | LIST_INIT (&vm_change_state_head); |
5515 | -#if !defined(CONFIG_SOFTMMU) | ||
5516 | - /* we never want that malloc() uses mmap() */ | ||
5517 | - mallopt(M_MMAP_THRESHOLD, 4096 * 1024); | 5487 | +#ifndef _WIN32 |
5488 | + { | ||
5489 | + struct sigaction act; | ||
5490 | + sigfillset(&act.sa_mask); | ||
5491 | + act.sa_flags = 0; | ||
5492 | + act.sa_handler = SIG_IGN; | ||
5493 | + sigaction(SIGPIPE, &act, NULL); | ||
5494 | + } | ||
5518 | #endif | 5495 | #endif |
5496 | + init_timers(); | ||
5497 | + | ||
5519 | register_machines(); | 5498 | register_machines(); |
5520 | machine = first_machine; | 5499 | machine = first_machine; |
5521 | initrd_filename = NULL; | 5500 | initrd_filename = NULL; |
@@ -5922,15 +5901,7 @@ int main(int argc, char **argv) | @@ -5922,15 +5901,7 @@ int main(int argc, char **argv) | ||
5922 | boot_device = 'd'; | 5901 | boot_device = 'd'; |
5923 | } | 5902 | } |
5924 | 5903 | ||
5925 | -#if !defined(CONFIG_SOFTMMU) | ||
5926 | - /* must avoid mmap() usage of glibc by setting a buffer "by hand" */ | ||
5927 | - { | ||
5928 | - static uint8_t stdout_buf[4096]; | ||
5929 | - setvbuf(stdout, stdout_buf, _IOLBF, sizeof(stdout_buf)); | ||
5930 | - } | ||
5931 | -#else | ||
5932 | setvbuf(stdout, NULL, _IOLBF, 0); | 5904 | setvbuf(stdout, NULL, _IOLBF, 0); |
5933 | -#endif | ||
5934 | 5905 | ||
5935 | #ifdef _WIN32 | 5906 | #ifdef _WIN32 |
5936 | socket_init(); | 5907 | socket_init(); |
@@ -5954,45 +5925,11 @@ int main(int argc, char **argv) | @@ -5954,45 +5925,11 @@ int main(int argc, char **argv) | ||
5954 | /* init the memory */ | 5925 | /* init the memory */ |
5955 | phys_ram_size = ram_size + vga_ram_size + bios_size; | 5926 | phys_ram_size = ram_size + vga_ram_size + bios_size; |
5956 | 5927 | ||
5957 | -#ifdef CONFIG_SOFTMMU | ||
5958 | phys_ram_base = qemu_vmalloc(phys_ram_size); | 5928 | phys_ram_base = qemu_vmalloc(phys_ram_size); |
5959 | if (!phys_ram_base) { | 5929 | if (!phys_ram_base) { |
5960 | fprintf(stderr, "Could not allocate physical memory\n"); | 5930 | fprintf(stderr, "Could not allocate physical memory\n"); |
5961 | exit(1); | 5931 | exit(1); |
5962 | } | 5932 | } |
5963 | -#else | ||
5964 | - /* as we must map the same page at several addresses, we must use | ||
5965 | - a fd */ | ||
5966 | - { | ||
5967 | - const char *tmpdir; | ||
5968 | - | ||
5969 | - tmpdir = getenv("QEMU_TMPDIR"); | ||
5970 | - if (!tmpdir) | ||
5971 | - tmpdir = "/tmp"; | ||
5972 | - snprintf(phys_ram_file, sizeof(phys_ram_file), "%s/vlXXXXXX", tmpdir); | ||
5973 | - if (mkstemp(phys_ram_file) < 0) { | ||
5974 | - fprintf(stderr, "Could not create temporary memory file '%s'\n", | ||
5975 | - phys_ram_file); | ||
5976 | - exit(1); | ||
5977 | - } | ||
5978 | - phys_ram_fd = open(phys_ram_file, O_CREAT | O_TRUNC | O_RDWR, 0600); | ||
5979 | - if (phys_ram_fd < 0) { | ||
5980 | - fprintf(stderr, "Could not open temporary memory file '%s'\n", | ||
5981 | - phys_ram_file); | ||
5982 | - exit(1); | ||
5983 | - } | ||
5984 | - ftruncate(phys_ram_fd, phys_ram_size); | ||
5985 | - unlink(phys_ram_file); | ||
5986 | - phys_ram_base = mmap(get_mmap_addr(phys_ram_size), | ||
5987 | - phys_ram_size, | ||
5988 | - PROT_WRITE | PROT_READ, MAP_SHARED | MAP_FIXED, | ||
5989 | - phys_ram_fd, 0); | ||
5990 | - if (phys_ram_base == MAP_FAILED) { | ||
5991 | - fprintf(stderr, "Could not map physical memory\n"); | ||
5992 | - exit(1); | ||
5993 | - } | ||
5994 | - } | ||
5995 | -#endif | ||
5996 | 5933 | ||
5997 | /* we always create the cdrom drive, even if no disk is there */ | 5934 | /* we always create the cdrom drive, even if no disk is there */ |
5998 | bdrv_init(); | 5935 | bdrv_init(); |
@@ -6097,51 +6034,6 @@ int main(int argc, char **argv) | @@ -6097,51 +6034,6 @@ int main(int argc, char **argv) | ||
6097 | } | 6034 | } |
6098 | } | 6035 | } |
6099 | 6036 | ||
6100 | - /* setup cpu signal handlers for MMU / self modifying code handling */ | ||
6101 | -#if !defined(CONFIG_SOFTMMU) | ||
6102 | - | ||
6103 | -#if defined (TARGET_I386) && defined(USE_CODE_COPY) | ||
6104 | - { | ||
6105 | - stack_t stk; | ||
6106 | - signal_stack = memalign(16, SIGNAL_STACK_SIZE); | ||
6107 | - stk.ss_sp = signal_stack; | ||
6108 | - stk.ss_size = SIGNAL_STACK_SIZE; | ||
6109 | - stk.ss_flags = 0; | ||
6110 | - | ||
6111 | - if (sigaltstack(&stk, NULL) < 0) { | ||
6112 | - perror("sigaltstack"); | ||
6113 | - exit(1); | ||
6114 | - } | ||
6115 | - } | ||
6116 | -#endif | ||
6117 | - { | ||
6118 | - struct sigaction act; | ||
6119 | - | ||
6120 | - sigfillset(&act.sa_mask); | ||
6121 | - act.sa_flags = SA_SIGINFO; | ||
6122 | -#if defined (TARGET_I386) && defined(USE_CODE_COPY) | ||
6123 | - act.sa_flags |= SA_ONSTACK; | ||
6124 | -#endif | ||
6125 | - act.sa_sigaction = host_segv_handler; | ||
6126 | - sigaction(SIGSEGV, &act, NULL); | ||
6127 | - sigaction(SIGBUS, &act, NULL); | ||
6128 | -#if defined (TARGET_I386) && defined(USE_CODE_COPY) | ||
6129 | - sigaction(SIGFPE, &act, NULL); | ||
6130 | -#endif | ||
6131 | - } | ||
6132 | -#endif | ||
6133 | - | ||
6134 | -#ifndef _WIN32 | ||
6135 | - { | ||
6136 | - struct sigaction act; | ||
6137 | - sigfillset(&act.sa_mask); | ||
6138 | - act.sa_flags = 0; | ||
6139 | - act.sa_handler = SIG_IGN; | ||
6140 | - sigaction(SIGPIPE, &act, NULL); | ||
6141 | - } | ||
6142 | -#endif | ||
6143 | - init_timers(); | ||
6144 | - | ||
6145 | machine->init(ram_size, vga_ram_size, boot_device, | 6037 | machine->init(ram_size, vga_ram_size, boot_device, |
6146 | ds, fd_filename, snapshot, | 6038 | ds, fd_filename, snapshot, |
6147 | kernel_filename, kernel_cmdline, initrd_filename); | 6039 | kernel_filename, kernel_cmdline, initrd_filename); |