Commit 1df912cf9e3dc0c3352fca1200c4bdc3477bf9f4
1 parent
43518323
VL license of the day is MIT/BSD
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@281 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
24 additions
and
6 deletions
vl.c
| 1 | /* | 1 | /* |
| 2 | - * QEMU based User Mode Linux | 2 | + * QEMU PC System Emulator |
| 3 | * | 3 | * |
| 4 | - * This file is part of proprietary software - it is published here | ||
| 5 | - * only for demonstration and information purposes. | 4 | + * Copyright (c) 2003 Fabrice Bellard |
| 6 | * | 5 | * |
| 7 | - * Copyright (c) 2003 Fabrice Bellard | 6 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | + * of this software and associated documentation files (the "Software"), to deal | ||
| 8 | + * in the Software without restriction, including without limitation the rights | ||
| 9 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| 10 | + * copies of the Software, and to permit persons to whom the Software is | ||
| 11 | + * furnished to do so, subject to the following conditions: | ||
| 12 | + * | ||
| 13 | + * The above copyright notice and this permission notice shall be included in | ||
| 14 | + * all copies or substantial portions of the Software. | ||
| 15 | + * | ||
| 16 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 17 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 18 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| 19 | + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 20 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| 21 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| 22 | + * THE SOFTWARE. | ||
| 8 | */ | 23 | */ |
| 9 | #include <stdlib.h> | 24 | #include <stdlib.h> |
| 10 | #include <stdio.h> | 25 | #include <stdio.h> |
| 26 | +#include <stdarg.h> | ||
| 11 | #include <string.h> | 27 | #include <string.h> |
| 12 | #include <getopt.h> | 28 | #include <getopt.h> |
| 13 | #include <inttypes.h> | 29 | #include <inttypes.h> |
| @@ -163,6 +179,7 @@ typedef uint32_t (IOPortReadFunc)(CPUX86State *env, uint32_t address); | @@ -163,6 +179,7 @@ typedef uint32_t (IOPortReadFunc)(CPUX86State *env, uint32_t address); | ||
| 163 | 179 | ||
| 164 | char phys_ram_file[1024]; | 180 | char phys_ram_file[1024]; |
| 165 | CPUX86State *global_env; | 181 | CPUX86State *global_env; |
| 182 | +CPUX86State *cpu_single_env; | ||
| 166 | FILE *logfile = NULL; | 183 | FILE *logfile = NULL; |
| 167 | int loglevel; | 184 | int loglevel; |
| 168 | IOPortReadFunc *ioport_readb_table[MAX_IOPORTS]; | 185 | IOPortReadFunc *ioport_readb_table[MAX_IOPORTS]; |
| @@ -1658,7 +1675,7 @@ static int timer_irq_pending; | @@ -1658,7 +1675,7 @@ static int timer_irq_pending; | ||
| 1658 | static void host_alarm_handler(int host_signum, siginfo_t *info, | 1675 | static void host_alarm_handler(int host_signum, siginfo_t *info, |
| 1659 | void *puc) | 1676 | void *puc) |
| 1660 | { | 1677 | { |
| 1661 | - /* just exit from the cpu to have a change to handle timers */ | 1678 | + /* just exit from the cpu to have a chance to handle timers */ |
| 1662 | cpu_x86_interrupt(global_env); | 1679 | cpu_x86_interrupt(global_env); |
| 1663 | timer_irq_pending = 1; | 1680 | timer_irq_pending = 1; |
| 1664 | } | 1681 | } |
| @@ -1811,6 +1828,7 @@ int main(int argc, char **argv) | @@ -1811,6 +1828,7 @@ int main(int argc, char **argv) | ||
| 1811 | /* init CPU state */ | 1828 | /* init CPU state */ |
| 1812 | env = cpu_init(); | 1829 | env = cpu_init(); |
| 1813 | global_env = env; | 1830 | global_env = env; |
| 1831 | + cpu_single_env = env; | ||
| 1814 | 1832 | ||
| 1815 | /* setup basic memory access */ | 1833 | /* setup basic memory access */ |
| 1816 | env->cr[0] = 0x00000033; | 1834 | env->cr[0] = 0x00000033; |
| @@ -1893,7 +1911,7 @@ int main(int argc, char **argv) | @@ -1893,7 +1911,7 @@ int main(int argc, char **argv) | ||
| 1893 | } | 1911 | } |
| 1894 | } | 1912 | } |
| 1895 | 1913 | ||
| 1896 | - /* just for testing */ | 1914 | + /* timer IRQ */ |
| 1897 | if (timer_irq_pending) { | 1915 | if (timer_irq_pending) { |
| 1898 | pic_set_irq(0, 1); | 1916 | pic_set_irq(0, 1); |
| 1899 | pic_set_irq(0, 0); | 1917 | pic_set_irq(0, 0); |