<pre style='margin:0'>
Rainer Müller (raimue) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/99640a256999526f771b1f70c4a595e2f567fc62">https://github.com/macports/macports-ports/commit/99640a256999526f771b1f70c4a595e2f567fc62</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 99640a2 qemu-usermode: Remove outdated port
</span>99640a2 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 99640a256999526f771b1f70c4a595e2f567fc62
</span>Author: Rainer Müller <raimue@macports.org>
AuthorDate: Fri Feb 10 11:15:33 2017 +0100
<span style='display:block; white-space:pre;color:#404040;'> qemu-usermode: Remove outdated port
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> This port is known to no longer work on recent versions of macOS. Newer
</span><span style='display:block; white-space:pre;color:#404040;'> versions of QEMU no longer support user mode on darwin. Remove the port
</span><span style='display:block; white-space:pre;color:#404040;'> as there is no chance to update it.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Closes: https://trac.macports.org/ticket/16822
</span><span style='display:block; white-space:pre;color:#404040;'> Closes: https://trac.macports.org/ticket/32414
</span>---
emulators/qemu-usermode/Portfile | 44 -
emulators/qemu-usermode/files/patch-configure | 11 -
emulators/qemu-usermode/files/patch-q-i386 | 1772 -------------------------
3 files changed, 1827 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/emulators/qemu-usermode/Portfile b/emulators/qemu-usermode/Portfile
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index b173c6b..0000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/emulators/qemu-usermode/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,44 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-PortSystem 1.0
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-name qemu-usermode
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-version 0.9.0
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-categories emulators
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-platforms darwin
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-maintainers nomaintainer
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-description x86 and PowerPC Emulator
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-long_description QEMU is a FAST! processor emulator using dynamic \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- translation to achieve good emulation speed. It \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- can emulate a Full PC System and has basic support \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- for PowerMac Emulation. This port has no GUI and only \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- supports user mode emulation (darwin/i386 and ppc).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-homepage http://fabrice.bellard.free.fr/
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-master_sites ${homepage}/qemu
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-checksums sha1 1e57e48a06eb8729913d92601000466eecef06cb \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- rmd160 4296542b6da18a6ac93d20787330d3c1c2ac0a19
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-distname qemu-${version}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-patchfiles patch-q-i386 patch-configure
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-set nprefix ${prefix}/lib/${name}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-configure.pre_args --prefix=${nprefix}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-configure.args \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- --enable-darwin-user --disable-system --disable-kqemu \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- --disable-cocoa --disable-adlib --disable-gfx-check \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- --target-list=i386-darwin-user,ppc-darwin-user \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- --interp-prefix=${nprefix}/%M
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-platform darwin 8 {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- configure.args-append \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- --disable-gcc-check \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- --cc=/usr/bin/gcc-4.0 --host-cc=/usr/bin/gcc-4.0
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-post-destroot {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- file delete -force ${destroot}${prefix}/lib/${name}/share/doc \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ${destroot}${prefix}/lib/${name}/share/man
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- system "cd ${destroot}${prefix}/bin && \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ln -sf ${nprefix}/bin/qemu-i386 && \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ln -sf ${nprefix}/bin/qemu-ppc"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-livecheck.name qemu
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/emulators/qemu-usermode/files/patch-configure b/emulators/qemu-usermode/files/patch-configure
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index ed3f9fe..0000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/emulators/qemu-usermode/files/patch-configure
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,11 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- configure 2007-02-06 00:01:54.000000000 +0100
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ configure 2007-07-25 20:03:03.000000000 +0200
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -236,6 +236,8 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ;;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ;;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ --disable-cocoa) cocoa="no" ; coreaudio="no" ; sdl="no"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ;;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- --disable-gfx-check) check_gfx="no"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ;;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- --disable-gcc-check) check_gcc="no"
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/emulators/qemu-usermode/files/patch-q-i386 b/emulators/qemu-usermode/files/patch-q-i386
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 66defb8..0000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/emulators/qemu-usermode/files/patch-q-i386
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,1772 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff -u -r Makefile.target Makefile.target
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- Makefile.target 2007-02-06 00:01:54.000000000 +0100
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ Makefile.target 2007-07-25 19:21:53.000000000 +0200
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -23,6 +23,9 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- BASE_CFLAGS=
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- BASE_LDFLAGS=
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ifeq ($(CONFIG_DARWIN),yes)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+CFLAGS+=-mdynamic-no-pic
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #CFLAGS+=-Werror
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- LIBS=
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- HELPER_CFLAGS=$(CFLAGS)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -68,13 +71,17 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ifdef CONFIG_STATIC
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- BASE_LDFLAGS+=-static
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ifeq ($(TARGET_ARCH), x86_64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# XXX globally save %ebx, %esi, %edi on entry to generated function
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+OP_CFLAGS+= -fcall-used-ebx -fcall-used-esi -fcall-used-edi
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # We require -O2 to avoid the stack setup prologue in EXIT_TB
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- OP_CFLAGS = -Wall -O2 -g -fno-strict-aliasing
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ifeq ($(ARCH),i386)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- HELPER_CFLAGS+=-fomit-frame-pointer
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+OP_CFLAGS+=-fomit-frame-pointer
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ifeq ($(HAVE_GCC3_OPTIONS),yes)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- OP_CFLAGS+= -falign-functions=0 -fno-gcse
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -415,8 +422,8 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- VL_OBJS+=vnc.o
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ifdef CONFIG_COCOA
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--VL_OBJS+=cocoa.o
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+VL_OBJS+=cocoaQemuMain.o cocoaQemuController.o cocoaQemu.o cocoaQemuProgressWindow.o cocoaQemuWindow.o cocoaQemuOpenGLView.o cocoaQemuQuartzView.o cocoaQemuQuickDrawView.o cocoaPopUpView.o cocoaCpuView.o FSController.o FSRoundedView.o FSToolbarController.o FSTransparentButton.o
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit -framework CoreFoundation -framework OpenGL -framework ApplicationServices
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ifdef CONFIG_COREAUDIO
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- COCOA_LIBS+=-framework CoreAudio
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -465,7 +472,11 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- $(QEMU_SYSTEM): $(VL_OBJS) libqemu.a
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--cocoa.o: cocoa.m
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+cocoa%.o: host-cocoa/cocoa%.m
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+FS%.o: host-cocoa/FSControls/FS%.m
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- sdl.o: sdl.c keymaps.c sdl_keysym.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff -u -r block-qcow2.c block-qcow2.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- block-qcow2.c 2007-02-06 00:01:54.000000000 +0100
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ block-qcow2.c 2007-07-25 19:21:53.000000000 +0200
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1886,6 +1886,8 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int64_t table_offset;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- uint64_t data64;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- uint32_t data32;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int old_table_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int64_t old_table_offset;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (min_size <= s->refcount_table_size)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1931,10 +1933,14 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- &data32, sizeof(data32)) != sizeof(data32))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- goto fail;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- qemu_free(s->refcount_table);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ old_table_offset = s->refcount_table_offset;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ old_table_size = s->refcount_table_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- s->refcount_table = new_table;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- s->refcount_table_size = new_table_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ s->refcount_table_offset = table_offset;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- update_refcount(bs, table_offset, new_table_size2, 1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ free_clusters(bs, old_table_offset, old_table_size * sizeof(uint64_t));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- fail:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- free_clusters(bs, table_offset, new_table_size2);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff -u -r block.c block.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- block.c 2007-02-06 00:01:54.000000000 +0100
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ block.c 2007-07-25 19:21:53.000000000 +0200
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -497,6 +497,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int bdrv_read(BlockDriverState *bs, int64_t sector_num,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- uint8_t *buf, int nb_sectors)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bs->activityLED = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- BlockDriver *drv = bs->drv;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (!drv)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -534,6 +535,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int bdrv_write(BlockDriverState *bs, int64_t sector_num,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const uint8_t *buf, int nb_sectors)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bs->activityLED = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- BlockDriver *drv = bs->drv;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (!bs->drv)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return -ENOMEDIUM;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1058,6 +1060,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- uint8_t *buf, int nb_sectors,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- BlockDriverCompletionFunc *cb, void *opaque)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bs->activityLED = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- BlockDriver *drv = bs->drv;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (!drv)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1078,6 +1081,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const uint8_t *buf, int nb_sectors,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- BlockDriverCompletionFunc *cb, void *opaque)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bs->activityLED = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- BlockDriver *drv = bs->drv;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (!drv)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff -u -r block_int.h block_int.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- block_int.h 2007-02-06 00:01:54.000000000 +0100
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ block_int.h 2007-07-25 19:21:53.000000000 +0200
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -87,6 +87,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int removable; /* if true, the media can be removed */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int locked; /* if true, the media cannot temporarily be ejected */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int encrypted; /* if true, the media is encrypted */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int activityLED; /* if true, the media is accessed atm */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* event callback when inserting/removing */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- void (*change_cb)(void *opaque);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- void *change_opaque;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff -u -r cpu-all.h cpu-all.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- cpu-all.h 2007-02-06 00:01:54.000000000 +0100
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ cpu-all.h 2007-07-25 19:21:53.000000000 +0200
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -339,7 +339,13 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static inline void stq_le_p(void *ptr, uint64_t v)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(__i386__) && __GNUC__ >= 4
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ const union { uint64_t v; uint32_t p[2]; } x = { .v = v };
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ((uint32_t *)ptr)[0] = x.p[0];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ((uint32_t *)ptr)[1] = x.p[1];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *(uint64_t *)ptr = v;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* float access */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff -u -r cpu-exec.c cpu-exec.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- cpu-exec.c 2007-02-06 00:01:54.000000000 +0100
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ cpu-exec.c 2007-07-25 19:21:53.000000000 +0200
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -652,6 +652,15 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- : /* no outputs */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- : "r" (gen_func)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- : "r1", "r2", "r3", "r8", "r9", "r10", "r12", "r14");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#elif defined(TARGET_X86_64) && defined(__i386__)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ asm volatile ("push %%ebx\n"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "push %%esi\n"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "push %%edi\n"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "call *%0\n"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "pop %%edi\n"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "pop %%esi\n"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "pop %%ebx\n"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ : : "r" (gen_func) : "ebx", "esi", "edi");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #elif defined(TARGET_I386) && defined(USE_CODE_COPY)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (!(tb->cflags & CF_CODE_COPY)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff -u -r dyngen-exec.h dyngen-exec.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- dyngen-exec.h 2007-02-06 00:01:54.000000000 +0100
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ dyngen-exec.h 2007-07-25 19:21:53.000000000 +0200
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -191,7 +191,12 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* force GCC to generate only one epilog at the end of the function */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(__i386__) || defined(__x86_64__)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/* Also add 4 bytes of padding so that we can replace the ret with a jmp. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define FORCE_RET() asm volatile ("nop;nop;nop;nop");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define FORCE_RET() __asm__ __volatile__("" : : : "memory");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #ifndef OPPROTO
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define OPPROTO
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -241,12 +246,26 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #ifdef __i386__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#define EXIT_TB() asm volatile ("ret")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#define GOTO_LABEL_PARAM(n) asm volatile ("jmp " ASM_NAME(__op_gen_label) #n)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/* Dyngen will replace hlt instructions with a ret instruction. Inserting a
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ret directly would confuse dyngen. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define EXIT_TB() asm volatile ("hlt")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/* Dyngen will replace cli with 0x9e (jmp).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ We generate the offset manually. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(__APPLE__)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/* XXX Different relocations are generated for MacOS X for Intel
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ (please as from cctools). */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define GOTO_LABEL_PARAM(n) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ asm volatile ("cli;.long " ASM_NAME(__op_gen_label) #n)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define GOTO_LABEL_PARAM(n) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ asm volatile ("cli;.long " ASM_NAME(__op_gen_label) #n " - 1f;1:")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #ifdef __x86_64__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#define EXIT_TB() asm volatile ("ret")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#define GOTO_LABEL_PARAM(n) asm volatile ("jmp " ASM_NAME(__op_gen_label) #n)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/* The same as i386. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define EXIT_TB() asm volatile ("hlt")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define GOTO_LABEL_PARAM(n) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ asm volatile ("cli;.long " ASM_NAME(__op_gen_label) #n " - 1f;1:")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #ifdef __powerpc__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define EXIT_TB() asm volatile ("blr")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff -u -r dyngen.c dyngen.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- dyngen.c 2007-02-06 00:01:54.000000000 +0100
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ dyngen.c 2007-07-25 19:21:53.000000000 +0200
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -32,6 +32,8 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "config-host.h"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+//#define DEBUG_OP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* NOTE: we test CONFIG_WIN32 instead of _WIN32 to enabled cross
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- compilation */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #if defined(CONFIG_WIN32)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -182,6 +184,20 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include <mach-o/reloc.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include <mach-o/ppc/reloc.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef HOST_PPC
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define MACH_CPU_TYPE CPU_TYPE_POWERPC
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define mach_check_cputype(x) ((x) == CPU_TYPE_POWERPC)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#elif defined(HOST_I386)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define MACH_CPU_TYPE CPU_TYPE_I386
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define mach_check_cputype(x) ((x) == CPU_TYPE_I386)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#error unsupported CPU - please update the code
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # define check_mach_header(x) (x.magic == MH_MAGIC)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- typedef int32_t host_long;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- typedef uint32_t host_ulong;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -938,22 +954,23 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- unsigned int tocindex, symindex, size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const char *name = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int section_type;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* Sanity check */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if(!( address >= sec_hdr->addr && address < (sec_hdr->addr + sec_hdr->size) ) )
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return (char*)0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- if( sec_hdr->flags & S_SYMBOL_STUBS ){
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ section_type = sec_hdr->flags & SECTION_TYPE;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if( section_type == S_SYMBOL_STUBS ){
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- size = sec_hdr->reserved2;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if(size == 0)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- error("size = 0");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- else if( sec_hdr->flags & S_LAZY_SYMBOL_POINTERS ||
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- sec_hdr->flags & S_NON_LAZY_SYMBOL_POINTERS)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ else if( section_type == S_LAZY_SYMBOL_POINTERS ||
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ section_type == S_NON_LAZY_SYMBOL_POINTERS)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- size = sizeof(unsigned long);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- return 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return NULL;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* Compute our index in toc */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- tocindex = (address - sec_hdr->addr)/size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -987,8 +1004,27 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* init the slide value */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *sslide = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- if(R_SCATTERED & rel->r_address)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- return (char *)find_reloc_name_given_its_address(sca_rel->r_value);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (R_SCATTERED & rel->r_address) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ char *name = (char *)find_reloc_name_given_its_address(sca_rel->r_value);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* search it in the full symbol list, if not found */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (!name) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int i;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ for (i = 0; i < nb_syms; i++) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ EXE_SYM *sym = &symtab[i];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (sym->st_value == sca_rel->r_value) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ name = get_sym_name(sym);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ switch (sca_rel->r_type) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case GENERIC_RELOC_VANILLA:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *sslide = *(uint32_t *)(text + sca_rel->r_address) - sca_rel->r_value;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return name;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if(rel->r_extern)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1020,14 +1056,21 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- sectoffset = ( *(uint32_t *)(text + rel->r_address) & 0x03fffffc );
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (sectoffset & 0x02000000) sectoffset |= 0xfc000000;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case GENERIC_RELOC_VANILLA:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ sectoffset = *(uint32_t *)(text + rel->r_address);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- default:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- error("switch(rel->type) not found");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ error("switch(rel->type=%d) not found", rel->r_type);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- if(rel->r_pcrel)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if(rel->r_pcrel) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- sectoffset += rel->r_address;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- if (rel->r_type == PPC_RELOC_BR24)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef HOST_I386
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ sectoffset += (1 << rel->r_length);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (rel->r_type == PPC_RELOC_BR24 || rel->r_pcrel)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- name = (char *)find_reloc_name_in_sec_ptr((int)sectoffset, §ion_hdr[sectnum-1]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* search it in the full symbol list, if not found */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1079,7 +1122,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- error("bad Mach header");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- if (mach_hdr.cputype != CPU_TYPE_POWERPC)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (!mach_check_cputype(mach_hdr.cputype))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- error("Unsupported CPU");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (mach_hdr.filetype != MH_OBJECT)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1414,6 +1457,677 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(HOST_I386) || defined(HOST_X86_64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/* This byte is the first byte of an instruction. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define FLAG_INSN (1 << 0)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/* This byte has been processed as part of an instruction. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define FLAG_SCANNED (1 << 1)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/* This instruction is a return instruction. Gcc cometimes generates prefix
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bytes, so may be more than one byte long. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define FLAG_RET (1 << 2)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/* This is either the target of a jump, or the preceeding instruction uses
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ a pc-relative offset. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define FLAG_TARGET (1 << 3)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/* This is a magic instruction that needs fixing up. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define FLAG_EXIT (1 << 4)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/* This instruction clobbers the stack pointer. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/* XXX only supports push, pop, add/sub $imm,%esp */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define FLAG_STACK (1 << 5)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define MAX_EXITS 5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+bad_opcode(const char *name, uint32_t op)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+{
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ error("Unsupported opcode %0*x in %s", (op > 0xff) ? 4 : 2, op, name);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/* Mark len bytes as scanned, Returns insn_size + len. Reports an error
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if these bytes have already been scanned. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static int
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+eat_bytes(const char *name, char *flags, int insn, int insn_size, int len)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+{
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ while (len > 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* This should never occur in sane code. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (flags[insn + insn_size] & FLAG_SCANNED)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ error ("Overlapping instructions in %s", name);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ flags[insn + insn_size] |= FLAG_SCANNED;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ insn_size++;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ len--;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return insn_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+trace_i386_insn (const char *name, uint8_t *start_p, char *flags, int insn,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int len)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+{
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ uint8_t *ptr;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ uint8_t op;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int modrm;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int is_prefix;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int op_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int addr_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int insn_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int is_ret;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int is_condjmp;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int is_jmp;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int is_exit;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int is_pcrel;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int is_stack;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int immed;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int seen_rexw;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int32_t disp;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ptr = start_p + insn;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* nonzero if this insn has a ModR/M byte. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* The size of the immediate value in this instruction. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* The operand size. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ op_size = 4;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* The address size */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ addr_size = 4;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* The total length of this instruction. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ insn_size = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_prefix = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_ret = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_condjmp = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_jmp = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_exit = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ seen_rexw = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_pcrel = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_stack = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ while (is_prefix) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ op = ptr[insn_size];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ insn_size = eat_bytes(name, flags, insn, insn_size, 1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_prefix = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ switch (op >> 4) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 0:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 1:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 2:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 3:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (op == 0x0f) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* two-byte opcode. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ op = ptr[insn_size];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ insn_size = eat_bytes(name, flags, insn, insn_size, 1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ switch (op >> 4) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 0:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if ((op & 0xf) > 3)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 1: /* vector move or prefetch */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 2: /* various moves and vector compares. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 4: /* cmov */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 5: /* vector instructions */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 6:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 13:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 14:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 15:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 7: /* mmx */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (op & 0x77) /* emms */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 3: /* wrmsr, rdtsc, rdmsr, rdpmc, sysenter, sysexit */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 8: /* long conditional jump */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_condjmp = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = op_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 9: /* setcc */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 10:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ switch (op & 0x7) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 0: /* push fs/gs */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 1: /* pop fs/gs */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_stack = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 2: /* cpuid/rsm */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 4: /* shld/shrd immediate */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ default: /* Normal instructions with a ModR/M byte. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 11:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ switch (op & 0xf) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 10: /* bt, bts, btr, btc */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ default:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* cmpxchg, lss, btr, lfs, lgs, movzx, btc, bsf, bsr
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ undefined, and movsx */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 12:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (op & 8) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* bswap */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ switch (op & 0x7) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 2:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 4:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 5:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 6:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ default:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else if ((op & 0x07) <= 0x3) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* General arithmentic ax. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else if ((op & 0x07) <= 0x5) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* General arithmetic ax, immediate. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (op & 0x01)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = op_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else if ((op & 0x23) == 0x22) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* Segment prefix. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_prefix = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* Segment register push/pop or DAA/AAA/DAS/AAS. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(HOST_X86_64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 4: /* rex prefix. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_prefix = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* The address/operand size is actually 64-bit, but the immediate
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ values in the instruction are still 32-bit. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ op_size = 4;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ addr_size = 4;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (op & 8)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ seen_rexw = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 4: /* inc/dec register. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 5: /* push/pop general register. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_stack = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 6:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ switch (op & 0x0f) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 0: /* pusha */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 1: /* popa */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_stack = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 2: /* bound */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 3: /* arpl */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 4: /* FS */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 5: /* GS */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_prefix = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 6: /* opcode size prefix. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ op_size = 2;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_prefix = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 7: /* Address size prefix. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ addr_size = 2;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_prefix = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 8: /* push immediate */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = op_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_stack = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 10: /* push 8-bit immediate */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_stack = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 9: /* imul immediate */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = op_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 11: /* imul 8-bit immediate */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 12: /* insb */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 13: /* insw */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 14: /* outsb */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 15: /* outsw */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 7: /* Short conditional jump. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_condjmp = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 8:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if ((op & 0xf) <= 3) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* arithmetic immediate. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if ((op & 3) == 1)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = op_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (op == 0x81 || op == 0x83) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* add, sub */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ op = ptr[insn_size];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ switch ((op >> 3) & 7) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 0:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 5:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_stack = (op & 7) == 4;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ else if ((op & 0xf) == 0xf) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* pop general. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_stack = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* else test, xchg, mov, lea. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 9:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* Various single-byte opcodes with no modrm byte. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (op == 10) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* Call */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 4;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 10:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ switch ((op & 0xe) >> 1) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 0: /* mov absoliute immediate. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 1:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (seen_rexw)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 8;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = addr_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 4: /* test immediate. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (op & 1)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = op_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ default: /* Various string ops. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 11: /* move immediate to register */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (op & 8) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (seen_rexw)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 8;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = op_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 12:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ switch (op & 0xf) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 0: /* shift immediate */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 1:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 2: /* ret immediate */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 2;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bad_opcode(name, op);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 3: /* ret */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_ret = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 4: /* les */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 5: /* lds */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 6: /* mov immediate byte */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 7: /* mov immediate */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = op_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 8: /* enter */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* TODO: Is this right? */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 3;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 10: /* retf immediate */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 2;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bad_opcode(name, op);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 13: /* int */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 11: /* retf */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 15: /* iret */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bad_opcode(name, op);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ default: /* leave, int3 or into */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 13:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if ((op & 0xf) >= 8) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* Coprocessor escape. For our purposes this is just a normal
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ instruction with a ModR/M byte. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else if ((op & 0xf) >= 4) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* AAM, AAD or XLAT */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* else shift instruction */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 14:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ switch ((op & 0xc) >> 2) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 0: /* loop or jcxz */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_condjmp = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 1: /* in/out immed */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 2: /* call or jmp */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ switch (op & 3) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 0: /* call */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = op_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 1: /* long jump */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 4;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_jmp = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 2: /* far jmp */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bad_opcode(name, op);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 3: /* short jmp */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_jmp = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 3: /* in/out register */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 15:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ switch ((op & 0xe) >> 1) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 0:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 1:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_prefix = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 2:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 4:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 5:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 6:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* Some privileged insns are used as markers. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ switch (op) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 0xf4: /* hlt: Exit translation block. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_exit = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 0xfa: /* cli: Jump to label. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_exit = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 4;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 0xfb: /* sti: TB patch jump. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* Mark the insn for patching, but continue sscanning. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ flags[insn] |= FLAG_EXIT;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 4;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 3: /* unary grp3 */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if ((ptr[insn_size] & 0x38) == 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (op == 0xf7)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = op_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ immed = 1; /* test immediate */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 7: /* inc/dec grp4/5 */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* TODO: This includes indirect jumps. We should fail if we
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ encounter one of these. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (modrm) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (addr_size != 4)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ error("16-bit addressing mode used in %s", name);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ disp = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm = ptr[insn_size];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ insn_size = eat_bytes(name, flags, insn, insn_size, 1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ modrm &= 0xc7;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ switch ((modrm & 0xc0) >> 6) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 0:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (modrm == 5)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ disp = 4;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 1:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ disp = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 2:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ disp = 4;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if ((modrm & 0xc0) != 0xc0 && (modrm & 0x7) == 4) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* SIB byte */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (modrm == 4 && (ptr[insn_size] & 0x7) == 5) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ disp = 4;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_pcrel = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ insn_size = eat_bytes(name, flags, insn, insn_size, 1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ insn_size = eat_bytes(name, flags, insn, insn_size, disp);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ insn_size = eat_bytes(name, flags, insn, insn_size, immed);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (is_condjmp || is_jmp) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (immed == 1) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ disp = (int8_t)*(ptr + insn_size - 1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ disp = (((int32_t)*(ptr + insn_size - 1)) << 24)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ | (((int32_t)*(ptr + insn_size - 2)) << 16)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ | (((int32_t)*(ptr + insn_size - 3)) << 8)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ | *(ptr + insn_size - 4);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ disp += insn_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* Jumps to external symbols point to the address of the offset
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ before relocation. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* ??? These are probably a tailcall. We could fix them up by
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ replacing them with jmp to EOB + call, but it's easier to just
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ prevent the compiler generating them. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (disp == 1)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ error("Unconditional jump (sibcall?) in %s", name);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ disp += insn;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (disp < 0 || disp > len)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ error("Jump outside instruction in %s", name);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if ((flags[disp] & (FLAG_INSN | FLAG_SCANNED)) == FLAG_SCANNED)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ error("Overlapping instructions in %s", name);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ flags[disp] |= (FLAG_INSN | FLAG_TARGET);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ is_pcrel = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (is_pcrel) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* Mark the following insn as a jump target. This will stop
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ this instruction being moved. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ flags[insn + insn_size] |= FLAG_TARGET;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (is_ret)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ flags[insn] |= FLAG_RET;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (is_exit)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ flags[insn] |= FLAG_EXIT;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (is_stack)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ flags[insn] |= FLAG_STACK;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (!(is_jmp || is_ret || is_exit))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ flags[insn + insn_size] |= FLAG_INSN;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/* Scan a function body. Returns the position of the return sequence.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Sets *patch_bytes to the number of bytes that need to be copied from that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ location. If no patching is required (ie. the return is the last insn)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *patch_bytes will be set to -1. *plen is the number of code bytes to copy.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static int trace_i386_op(const char * name, uint8_t *start_p, int *plen,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int *patch_bytes, int *exit_addrs)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+{
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ char *flags;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int more;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int insn;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int retpos;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int bytes;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int num_exits;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int len;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int last_insn;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int stack_clobbered;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ len = *plen;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ flags = malloc(len + 1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ memset(flags, 0, len + 1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ flags[0] |= FLAG_INSN;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ more = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ while (more) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ more = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ for (insn = 0; insn < len; insn++) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if ((flags[insn] & (FLAG_INSN | FLAG_SCANNED)) == FLAG_INSN) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ trace_i386_insn(name, start_p, flags, insn, len);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ more = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* Strip any unused code at the end of the function. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ while (len > 0 && flags[len - 1] == 0)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ len--;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ retpos = -1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ num_exits = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ last_insn = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stack_clobbered = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ for (insn = 0; insn < len; insn++) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (flags[insn] & FLAG_RET) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* ??? In theory it should be possible to handle multiple return
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ points. In practice it's not worth the effort. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (retpos != -1)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ error("Multiple return instructions in %s", name);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ retpos = insn;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (flags[insn] & FLAG_EXIT) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (stack_clobbered)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ error("Stack clobbered in %s", name);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (num_exits == MAX_EXITS)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ error("Too many block exits in %s", name);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ exit_addrs[num_exits] = insn;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ num_exits++;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (flags[insn] & FLAG_INSN)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ last_insn = insn;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (flags[insn] & FLAG_STACK)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stack_clobbered = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ exit_addrs[num_exits] = -1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (retpos == -1) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (num_exits == 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ error ("No return instruction found in %s", name);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ retpos = len;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ last_insn = len;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* If the return instruction is the last instruction we can just
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ remove it. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (retpos == last_insn)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *patch_bytes = -1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *patch_bytes = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* Back up over any nop instructions. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ while (retpos > 0
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ && (flags[retpos] & FLAG_TARGET) == 0
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ && (flags[retpos - 1] & FLAG_INSN) != 0
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ && start_p[retpos - 1] == 0x90) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ retpos--;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (*patch_bytes == -1) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *plen = retpos;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ free (flags);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return retpos;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *plen = len;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* The ret is in the middle of the function. Find four more bytes that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ so the ret can be replaced by a jmp. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* ??? Use a short jump where possible. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bytes = 4;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ insn = retpos + 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* We can clobber everything up to the next jump target. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ while (insn < len && bytes > 0 && (flags[insn] & FLAG_TARGET) == 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ insn++;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bytes--;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (bytes > 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* ???: Strip out nop blocks. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* We can't do the replacement without clobbering anything important.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Copy preceeding instructions(s) to give us some space. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ while (retpos > 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* If this byte is the target of a jmp we can't move it. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (flags[retpos] & FLAG_TARGET)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ (*patch_bytes)++;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bytes--;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ retpos--;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* Break out of the loop if we have enough space and this is either
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ the first byte of an instruction or a pad byte. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if ((flags[retpos] & (FLAG_INSN | FLAG_SCANNED)) != FLAG_SCANNED
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ && bytes <= 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (bytes > 0)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ error("Unable to replace ret with jmp in %s\n", name);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ free(flags);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return retpos;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define MAX_ARGS 3
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* generate op code */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1427,6 +2141,11 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- uint8_t args_present[MAX_ARGS];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const char *sym_name, *p;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- EXE_RELOC *rel;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(HOST_I386) || defined(HOST_X86_64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int patch_bytes;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int retpos;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int exit_addrs[MAX_EXITS];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* Compute exact size excluding prologue and epilogue instructions.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * Increment start_offset to skip epilogue instructions, then compute
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1437,33 +2156,12 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- p_end = p_start + size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- start_offset = offset;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #if defined(HOST_I386) || defined(HOST_X86_64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#ifdef CONFIG_FORMAT_COFF
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- uint8_t *p;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- p = p_end - 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- if (p == p_start)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- error("empty code for %s", name);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- while (*p != 0xc3) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- p--;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- if (p <= p_start)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- error("ret or jmp expected at the end of %s", name);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- copy_size = p - p_start;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int len;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- len = p_end - p_start;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- if (len == 0)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- error("empty code for %s", name);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- if (p_end[-1] == 0xc3) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- len--;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- error("ret or jmp expected at the end of %s", name);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ retpos = trace_i386_op(name, p_start, &len, &patch_bytes, exit_addrs);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- copy_size = len;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #elif defined(HOST_PPC)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- uint8_t *p;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1675,6 +2373,13 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (gen_switch == 2) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(HOST_I386) || defined(HOST_X86_64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (patch_bytes != -1)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ copy_size += patch_bytes;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef DEBUG_OP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ copy_size += 2;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- fprintf(outfile, "DEF(%s, %d, %d)\n", name + 3, nb_args, copy_size);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else if (gen_switch == 1) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1809,6 +2514,82 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* patch relocations */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #if defined(HOST_I386)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef CONFIG_FORMAT_MACH
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ struct scattered_relocation_info *scarel;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ struct relocation_info * rel;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ char final_sym_name[256];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ const char *sym_name;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ const char *p;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int slide, sslide;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int i;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ for (i = 0, rel = relocs; i < nb_relocs; i++, rel++) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ unsigned int offset, length, value = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ unsigned int type, pcrel, isym = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ unsigned int usesym = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (R_SCATTERED & rel->r_address) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ scarel = (struct scattered_relocation_info*)rel;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ offset = (unsigned int)scarel->r_address;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ length = scarel->r_length;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pcrel = scarel->r_pcrel;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ type = scarel->r_type;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ value = scarel->r_value;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ value = isym = rel->r_symbolnum;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ usesym = (rel->r_extern);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ offset = rel->r_address;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ length = rel->r_length;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pcrel = rel->r_pcrel;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ type = rel->r_type;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ slide = offset - start_offset;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (!(offset >= start_offset && offset < start_offset + size))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ continue; /* not in our range */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ sym_name = get_reloc_name(rel, &sslide);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (usesym && symtab[isym].n_type & N_STAB)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ continue; /* don't handle STAB (debug sym) */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (sym_name && strstart(sym_name, "__op_jmp", &p)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int n;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ n = strtol(p, NULL, 10);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fprintf(outfile, " jmp_offsets[%d] = %d + (gen_code_ptr - gen_code_buf);\n", n, slide);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ continue; /* Nothing more to do */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (!sym_name) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fprintf(outfile, "/* #warning relocation not handled in %s (value 0x%x, %s, offset 0x%x, length 0x%x, %s, type 0x%x) */\n",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ name, value, usesym ? "use sym" : "don't use sym", offset, length, pcrel ? "pcrel":"", type);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ continue; /* dunno how to handle without final_sym_name */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ get_reloc_expr(final_sym_name, sizeof(final_sym_name),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ sym_name);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (length != 2)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ error("unsupported %d-bit relocation", 8 * (1 << length));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ switch (type) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case GENERIC_RELOC_VANILLA:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (pcrel || strstart(sym_name,"__op_gen_label",&p)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = %s - (long)(gen_code_ptr + %d) - 4;\n",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ slide, final_sym_name, slide);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = (%s + %d);\n",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ slide, final_sym_name, sslide);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ default:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ error("unsupported i386 relocation (%d)", type);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- char name[256];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int type;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int addend;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1879,7 +2660,44 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #error unsupport object format
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* Replace the marker instructions with the actual opcodes. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ for (i = 0; exit_addrs[i] != -1; i++) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int op;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ switch (p_start[exit_addrs[i]])
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 0xf4: op = 0xc3; break; /* hlt -> ret */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 0xfa: op = 0xe9; break; /* cli -> jmp */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 0xfb: op = 0xe9; break; /* sti -> jmp */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ default: error("Internal error");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fprintf(outfile,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ " *(uint8_t *)(gen_code_ptr + %d) = 0x%x;\n",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ exit_addrs[i], op);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* Fix up the return instruction. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (patch_bytes != -1) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (patch_bytes) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fprintf(outfile, " memcpy(gen_code_ptr + %d,"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "gen_code_ptr + %d, %d);\n",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ copy_size, retpos, patch_bytes);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fprintf(outfile,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ " *(uint8_t *)(gen_code_ptr + %d) = 0xe9;\n",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ retpos);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fprintf(outfile,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ " *(uint32_t *)(gen_code_ptr + %d) = 0x%x;\n",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ retpos + 1, copy_size - (retpos + 5));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ copy_size += patch_bytes;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef DEBUG_OP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fprintf(outfile,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ " *(uint16_t *)(gen_code_ptr + %d) = 0x9090;\n",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ copy_size);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ copy_size += 2;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #elif defined(HOST_X86_64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1913,6 +2731,42 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* Replace the marker instructions with the actual opcodes. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ for (i = 0; exit_addrs[i] != -1; i++) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int op;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ switch (p_start[exit_addrs[i]])
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 0xf4: op = 0xc3; break; /* hlt -> ret */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 0xfa: op = 0xe9; break; /* cli -> jmp */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 0xfb: op = 0xe9; break; /* sti -> jmp */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ default: error("Internal error");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fprintf(outfile,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ " *(uint8_t *)(gen_code_ptr + %d) = 0x%x;\n",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ exit_addrs[i], op);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* Fix up the return instruction. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (patch_bytes != -1) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (patch_bytes) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fprintf(outfile, " memcpy(gen_code_ptr + %d,"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "gen_code_ptr + %d, %d);\n",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ copy_size, retpos, patch_bytes);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fprintf(outfile,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ " *(uint8_t *)(gen_code_ptr + %d) = 0xe9;\n",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ retpos);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fprintf(outfile,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ " *(uint32_t *)(gen_code_ptr + %d) = 0x%x;\n",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ retpos + 1, copy_size - (retpos + 5));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ copy_size += patch_bytes;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef DEBUG_OP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fprintf(outfile,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ " *(uint16_t *)(gen_code_ptr + %d) = 0x9090;\n",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ copy_size);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ copy_size += 2;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #elif defined(HOST_PPC)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff -u -r exec-all.h exec-all.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- exec-all.h 2007-02-06 00:01:54.000000000 +0100
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ exec-all.h 2007-07-25 19:21:53.000000000 +0200
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -326,16 +326,31 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #elif defined(__i386__) && defined(USE_DIRECT_JUMP)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--/* we patch the jump instruction directly */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/* we patch the jump instruction directly. Use sti in place of the actual
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ jmp instruction so that dyngen can patch in the correct result. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(__APPLE__)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/* XXX Different relocations are generated for MacOS X for Intel
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ (please as from cctools). */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define GOTO_TB(opname, tbparam, n)\
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- do {\
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- asm volatile (".section .data\n"\
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ asm volatile (ASM_DATA_SECTION\
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ASM_OP_LABEL_NAME(n, opname) ":\n"\
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ".long 1f\n"\
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ASM_PREVIOUS_SECTION \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- "jmp " ASM_NAME(__op_jmp) #n "\n"\
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "sti;.long " ASM_NAME(__op_jmp) #n "\n"\
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "1:\n");\
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } while (0)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define GOTO_TB(opname, tbparam, n)\
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+do {\
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ asm volatile (ASM_DATA_SECTION\
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ASM_OP_LABEL_NAME(n, opname) ":\n"\
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ".long 1f\n"\
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ASM_PREVIOUS_SECTION \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "sti;.long " ASM_NAME(__op_jmp) #n " - 1f\n"\
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "1:\n");\
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+} while (0)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff -u -r hw/pc.c hw/pc.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- hw/pc.c 2007-02-06 00:01:54.000000000 +0100
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ hw/pc.c 2007-07-25 19:21:53.000000000 +0200
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -154,7 +154,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* hd_table must contain 4 block drivers */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--static void cmos_init(int ram_size, int boot_device, BlockDriverState **hd_table)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void cmos_init(int ram_size, int boot_device, int boot_device_2, BlockDriverState **hd_table)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- RTCState *s = rtc_state;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int val;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -185,19 +185,32 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- rtc_set_memory(s, 0x34, val);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- rtc_set_memory(s, 0x35, val >> 8);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int bd2_val;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ switch(boot_device_2) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 'a':
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bd2_val = 0x10;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 'c':
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bd2_val = 0x20;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case 'd':
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bd2_val = 0x30;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- switch(boot_device) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- case 'a':
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- case 'b':
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- rtc_set_memory(s, 0x3d, 0x01); /* floppy boot */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ rtc_set_memory(s, 0x3d, bd2_val | 0x01); /* floppy boot */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (!fd_bootchk)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- rtc_set_memory(s, 0x38, 0x01); /* disable signature check */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ rtc_set_memory(s, 0x38, bd2_val | 0x01); /* disable signature check */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- default:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- case 'c':
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- rtc_set_memory(s, 0x3d, 0x02); /* hard drive boot */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ rtc_set_memory(s, 0x3d, bd2_val | 0x02); /* hard drive boot */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- case 'd':
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- rtc_set_memory(s, 0x3d, 0x03); /* CD-ROM boot */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ rtc_set_memory(s, 0x3d, bd2_val | 0x03); /* CD-ROM boot */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -443,7 +456,8 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* PC hardware initialisation */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--static void pc_init1(int ram_size, int vga_ram_size, int boot_device,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void pc_init1(int ram_size, int vga_ram_size,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int boot_device, int boot_device_2,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- DisplayState *ds, const char **fd_filename, int snapshot,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const char *kernel_filename, const char *kernel_cmdline,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const char *initrd_filename,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -692,7 +706,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- floppy_controller = fdctrl_init(6, 2, 0, 0x3f0, fd_table);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- cmos_init(ram_size, boot_device, bs_table);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ cmos_init(ram_size, boot_device, boot_device_2, bs_table);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (pci_enabled && usb_enabled) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- usb_uhci_init(pci_bus, piix3_devfn + 2);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -730,27 +744,29 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--static void pc_init_pci(int ram_size, int vga_ram_size, int boot_device,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void pc_init_pci(int ram_size, int vga_ram_size,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int boot_device, int boot_device_2,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- DisplayState *ds, const char **fd_filename,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int snapshot,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const char *kernel_filename,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const char *kernel_cmdline,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const char *initrd_filename)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- pc_init1(ram_size, vga_ram_size, boot_device,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pc_init1(ram_size, vga_ram_size, boot_device, boot_device_2,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ds, fd_filename, snapshot,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- kernel_filename, kernel_cmdline,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- initrd_filename, 1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--static void pc_init_isa(int ram_size, int vga_ram_size, int boot_device,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void pc_init_isa(int ram_size, int vga_ram_size,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int boot_device, int boot_device_2,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- DisplayState *ds, const char **fd_filename,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int snapshot,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const char *kernel_filename,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const char *kernel_cmdline,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const char *initrd_filename)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- pc_init1(ram_size, vga_ram_size, boot_device,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pc_init1(ram_size, vga_ram_size, boot_device, boot_device_2,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ds, fd_filename, snapshot,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- kernel_filename, kernel_cmdline,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- initrd_filename, 0);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff -u -r hw/vga.c hw/vga.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- hw/vga.c 2007-02-06 00:01:54.000000000 +0100
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ hw/vga.c 2007-07-25 19:21:53.000000000 +0200
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -814,22 +814,38 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static inline unsigned int rgb_to_pixel8(unsigned int r, unsigned int g, unsigned b)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if __LITTLE_ENDIAN__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return ((b >> 5) << 5) | ((g >> 5) << 2) | (r >> 6);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return ((r >> 5) << 5) | ((g >> 5) << 2) | (b >> 6);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static inline unsigned int rgb_to_pixel15(unsigned int r, unsigned int g, unsigned b)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if __LITTLE_ENDIAN__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return ((b >> 3) << 10) | ((g >> 3) << 5) | (r >> 3);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return ((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static inline unsigned int rgb_to_pixel16(unsigned int r, unsigned int g, unsigned b)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if __LITTLE_ENDIAN__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return ((b >> 3) << 11) | ((g >> 2) << 5) | (r >> 3);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static inline unsigned int rgb_to_pixel32(unsigned int r, unsigned int g, unsigned b)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if __LITTLE_ENDIAN__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return (b << 16) | (g << 8) | r;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return (r << 16) | (g << 8) | b;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static inline unsigned int rgb_to_pixel32bgr(unsigned int r, unsigned int g, unsigned b)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff -u -r softmmu_header.h softmmu_header.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- softmmu_header.h 2007-02-06 00:01:54.000000000 +0100
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ softmmu_header.h 2007-07-25 19:21:53.000000000 +0200
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -108,7 +108,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- void REGPARM(2) glue(glue(__st, SUFFIX), MMUSUFFIX)(target_ulong addr, DATA_TYPE v, int is_user);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #if (DATA_SIZE <= 4) && (TARGET_LONG_BITS == 32) && defined(__i386__) && \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- (ACCESS_TYPE <= 1) && defined(ASM_SOFTMMU)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ (ACCESS_TYPE <= 1) && defined(ASM_SOFTMMU) && (__GNUC__ < 4)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define CPU_TLB_ENTRY_BITS 4
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -150,7 +150,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "m" (*(uint32_t *)offsetof(CPUState, tlb_table[CPU_MEM_INDEX][0].addr_read)),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "i" (CPU_MEM_INDEX),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "m" (*(uint8_t *)&glue(glue(__ld, SUFFIX), MMUSUFFIX))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- : "%eax", "%ecx", "%edx", "memory", "cc");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ : "%eax", "%edx", "memory", "cc");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return res;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -197,13 +197,14 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "m" (*(uint32_t *)offsetof(CPUState, tlb_table[CPU_MEM_INDEX][0].addr_read)),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "i" (CPU_MEM_INDEX),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "m" (*(uint8_t *)&glue(glue(__ld, SUFFIX), MMUSUFFIX))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- : "%eax", "%ecx", "%edx", "memory", "cc");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ : "%eax", "%edx", "memory", "cc");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return res;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--static inline void glue(glue(st, SUFFIX), MEMSUFFIX)(target_ulong ptr, RES_TYPE v)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static inline void glue(glue(st, SUFFIX), MEMSUFFIX)(target_ulong ptr, RES_TYPE val)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ RES_TYPE v = val;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- asm volatile ("movl %0, %%edx\n"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "movl %0, %%eax\n"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "shrl %3, %%edx\n"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -240,16 +241,14 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "2:\n"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- :
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- : "r" (ptr),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--/* NOTE: 'q' would be needed as constraint, but we could not use it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- with T1 ! */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- "r" (v),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "q" (v),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "i" ((CPU_TLB_SIZE - 1) << CPU_TLB_ENTRY_BITS),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "i" (TARGET_PAGE_BITS - CPU_TLB_ENTRY_BITS),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "i" (TARGET_PAGE_MASK | (DATA_SIZE - 1)),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "m" (*(uint32_t *)offsetof(CPUState, tlb_table[CPU_MEM_INDEX][0].addr_write)),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "i" (CPU_MEM_INDEX),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "m" (*(uint8_t *)&glue(glue(__st, SUFFIX), MMUSUFFIX))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- : "%eax", "%ecx", "%edx", "memory", "cc");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ : "%eax", "%edx", "memory", "cc");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff -u -r target-i386/helper.c target-i386/helper.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- target-i386/helper.c 2007-02-06 00:01:54.000000000 +0100
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ target-i386/helper.c 2007-07-25 19:21:53.000000000 +0200
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -29,68 +29,6 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- (raise_exception_err)(a, b);\
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } while (0)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--const uint8_t parity_table[256] = {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--};
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--/* modulo 17 table */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--const uint8_t rclw_table[32] = {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 0, 1, 2, 3, 4, 5, 6, 7,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 8, 9,10,11,12,13,14,15,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 16, 0, 1, 2, 3, 4, 5, 6,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 7, 8, 9,10,11,12,13,14,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--};
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--/* modulo 9 table */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--const uint8_t rclb_table[32] = {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 0, 1, 2, 3, 4, 5, 6, 7,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 8, 0, 1, 2, 3, 4, 5, 6,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 7, 8, 0, 1, 2, 3, 4, 5,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 6, 7, 8, 0, 1, 2, 3, 4,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--};
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--const CPU86_LDouble f15rk[7] =
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--{
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 0.00000000000000000000L,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 1.00000000000000000000L,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 3.14159265358979323851L, /*pi*/
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 0.30102999566398119523L, /*lg2*/
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 0.69314718055994530943L, /*ln2*/
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 1.44269504088896340739L, /*l2e*/
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 3.32192809488736234781L, /*l2t*/
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--};
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* thread support */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -3452,8 +3390,15 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- nb_xmm_regs = 8 << data64;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- addr = ptr + 0xa0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- for(i = 0; i < nb_xmm_regs; i++) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(__i386__) && __GNUC__ >= 4
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ env->xmm_regs[i].XMM_L(0) = ldl(addr);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ env->xmm_regs[i].XMM_L(1) = ldl(addr + 4);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ env->xmm_regs[i].XMM_L(2) = ldl(addr + 8);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ env->xmm_regs[i].XMM_L(3) = ldl(addr + 12);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- env->xmm_regs[i].XMM_Q(0) = ldq(addr);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- env->xmm_regs[i].XMM_Q(1) = ldq(addr + 8);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- addr += 16;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff -u -r target-i386/op.c target-i386/op.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- target-i386/op.c 2007-02-06 00:01:54.000000000 +0100
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ target-i386/op.c 2007-07-25 19:21:53.000000000 +0200
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -21,6 +21,69 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define ASM_SOFTMMU
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "exec.h"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+const uint8_t parity_table[256] = {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+};
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/* modulo 17 table */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+const uint8_t rclw_table[32] = {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 0, 1, 2, 3, 4, 5, 6, 7,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 8, 9,10,11,12,13,14,15,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 16, 0, 1, 2, 3, 4, 5, 6,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 7, 8, 9,10,11,12,13,14,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+};
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/* modulo 9 table */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+const uint8_t rclb_table[32] = {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 0, 1, 2, 3, 4, 5, 6, 7,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 8, 0, 1, 2, 3, 4, 5, 6,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 7, 8, 0, 1, 2, 3, 4, 5,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 6, 7, 8, 0, 1, 2, 3, 4,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+};
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+const CPU86_LDouble f15rk[7] =
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+{
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 0.00000000000000000000L,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 1.00000000000000000000L,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 3.14159265358979323851L, /*pi*/
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 0.30102999566398119523L, /*lg2*/
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 0.69314718055994530943L, /*ln2*/
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 1.44269504088896340739L, /*l2e*/
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 3.32192809488736234781L, /*l2t*/
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+};
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* n must be a constant to be efficient */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static inline target_long lshift(target_long x, int n)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1531,6 +1594,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- eflags = cc_table[CC_OP].compute_all();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- eflags &= ~CC_C;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- CC_SRC = eflags;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ FORCE_RET();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- void OPPROTO op_stc(void)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1547,6 +1611,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- eflags = cc_table[CC_OP].compute_all();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- eflags ^= CC_C;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- CC_SRC = eflags;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ FORCE_RET();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- void OPPROTO op_salc(void)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff -u -r target-i386/ops_sse.h target-i386/ops_sse.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- target-i386/ops_sse.h 2007-02-06 00:01:54.000000000 +0100
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ target-i386/ops_sse.h 2007-07-25 19:21:53.000000000 +0200
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -34,6 +34,12 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define Q(n) XMM_Q(n)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define SUFFIX _xmm
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(__i386__) && __GNUC__ >= 4
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define RegCopy(d, s) __builtin_memcpy(&(d), &(s), sizeof(d))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifndef RegCopy
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define RegCopy(d, s) d = s
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- void OPPROTO glue(op_psrlw, SUFFIX)(void)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -589,7 +595,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- r.W(1) = s->W((order >> 2) & 3);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- r.W(2) = s->W((order >> 4) & 3);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- r.W(3) = s->W((order >> 6) & 3);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- *d = r;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ RegCopy(*d, r);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- void OPPROTO op_shufps(void)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff -u -r target-ppc/exec.h target-ppc/exec.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- target-ppc/exec.h 2007-02-06 00:01:54.000000000 +0100
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ target-ppc/exec.h 2007-07-25 19:21:53.000000000 +0200
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -37,11 +37,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define FT1 (env->ft1)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define FT2 (env->ft2)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#if defined (DEBUG_OP)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--# define RETURN() __asm__ __volatile__("nop" : : : "memory");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--# define RETURN() __asm__ __volatile__("" : : : "memory");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define RETURN() FORCE_RET()
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "cpu.h"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "exec-all.h"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff -u -r vl.c vl.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- vl.c 2007-02-06 00:01:54.000000000 +0100
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ vl.c 2007-07-25 19:21:53.000000000 +0200
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -131,6 +131,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const char* keyboard_layout = NULL;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int64_t ticks_per_sec;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int boot_device = 'c';
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+int boot_device_2 = 'd';
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int ram_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int pit_min_timer_count = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int nb_nics;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -6021,7 +6022,11 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "-hda/-hdb file use 'file' as IDE hard disk 0/1 image\n"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "-hdc/-hdd file use 'file' as IDE hard disk 2/3 image\n"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "-cdrom file use 'file' as IDE cdrom image (cdrom is ide1 master)\n"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef TARGET_I386
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "-boot d1(,d2) boot on floppy (a), hard disk (c), CD-ROM (d), or network (n)\n"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "-boot [a|c|d|n] boot on floppy (a), hard disk (c), CD-ROM (d), or network (n)\n"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "-snapshot write to temporary files instead of disk image files\n"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #ifdef CONFIG_SDL
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "-no-quit disable SDL window close capability\n"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -6721,6 +6726,15 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- case QEMU_OPTION_boot:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- boot_device = optarg[0];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef TARGET_I386
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (strlen(optarg) == 3) { //we have a second bootdevice
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ boot_device_2 = optarg[2];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (boot_device_2 != 'a' && boot_device_2 != 'c' && boot_device_2 != 'd') {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fprintf(stderr, "qemu: invalid second boot device '%c'\n", boot_device_2);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ exit(1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (boot_device != 'a' &&
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #if defined(TARGET_SPARC) || defined(TARGET_I386)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // Network boot
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -7199,8 +7213,11 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- qemu_chr_printf(parallel_hds[i], "parallel%d console\r\n", i);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef TARGET_I386
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ machine->init(ram_size, vga_ram_size, boot_device, boot_device_2,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- machine->init(ram_size, vga_ram_size, boot_device,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ds, fd_filename, snapshot,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- kernel_filename, kernel_cmdline, initrd_filename);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff -u -r vl.h vl.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- vl.h 2007-02-06 00:01:54.000000000 +0100
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ vl.h 2007-07-25 19:21:53.000000000 +0200
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -683,6 +683,9 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- typedef void QEMUMachineInitFunc(int ram_size, int vga_ram_size,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int boot_device,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef TARGET_I386
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int boot_device_2,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- DisplayState *ds, const char **fd_filename, int snapshot,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const char *kernel_filename, const char *kernel_cmdline,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const char *initrd_filename);
</span></pre><pre style='margin:0'>
</pre>