summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/packages/qemu/qemu-git/06_exit_segfault.patch45
-rw-r--r--meta/packages/qemu/qemu-git/11_signal_sigaction.patch21
-rw-r--r--meta/packages/qemu/qemu-git/22_net_tuntap_stall.patch18
-rw-r--r--meta/packages/qemu/qemu-git/31_syscalls.patch27
-rw-r--r--meta/packages/qemu/qemu-git/52_ne2000_return.patch17
-rw-r--r--meta/packages/qemu/qemu-git/63_sparc_build.patch18
-rw-r--r--meta/packages/qemu/qemu-git/64_ppc_asm_constraints.patch18
-rw-r--r--meta/packages/qemu/qemu-git/66_tls_ld.patch55
-rw-r--r--meta/packages/qemu/qemu-git/91-oh-sdl-cursor.patch18
-rw-r--r--meta/packages/qemu/qemu-git/fix-nogl.patch40
-rw-r--r--meta/packages/qemu/qemu-git/qemu-amd64-32b-mapping-0.9.0.patch37
-rw-r--r--meta/packages/qemu/qemu-git/qemu-git-qemugl-host.patch (renamed from meta/packages/qemu/qemu-git/qemu-add-gl-host-code.patch)966
-rw-r--r--meta/packages/qemu/qemu_git.bb15
13 files changed, 849 insertions, 446 deletions
diff --git a/meta/packages/qemu/qemu-git/06_exit_segfault.patch b/meta/packages/qemu/qemu-git/06_exit_segfault.patch
deleted file mode 100644
index 06123d0626..0000000000
--- a/meta/packages/qemu/qemu-git/06_exit_segfault.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-#DPATCHLEVEL=0
----
-# linux-user/main.c | 8 ++++----
-# 1 file changed, 4 insertions(+), 4 deletions(-)
-#
-Index: linux-user/main.c
-===================================================================
---- linux-user/main.c.orig 2007-12-03 23:47:25.000000000 +0000
-+++ linux-user/main.c 2007-12-03 23:47:41.000000000 +0000
-@@ -714,7 +714,7 @@ void cpu_loop (CPUSPARCState *env)
- default:
- printf ("Unhandled trap: 0x%x\n", trapnr);
- cpu_dump_state(env, stderr, fprintf, 0);
-- exit (1);
-+ _exit (1);
- }
- process_pending_signals (env);
- }
-@@ -1634,7 +1634,7 @@ void cpu_loop (CPUState *env)
- default:
- printf ("Unhandled trap: 0x%x\n", trapnr);
- cpu_dump_state(env, stderr, fprintf, 0);
-- exit (1);
-+ _exit (1);
- }
- process_pending_signals (env);
- }
-@@ -1954,7 +1954,7 @@ int main(int argc, char **argv)
- for(item = cpu_log_items; item->mask != 0; item++) {
- printf("%-10s %s\n", item->name, item->help);
- }
-- exit(1);
-+ _exit(1);
- }
- cpu_set_log(mask);
- } else if (!strcmp(r, "s")) {
-@@ -1973,7 +1973,7 @@ int main(int argc, char **argv)
- if (qemu_host_page_size == 0 ||
- (qemu_host_page_size & (qemu_host_page_size - 1)) != 0) {
- fprintf(stderr, "page size must be a power of two\n");
-- exit(1);
-+ _exit(1);
- }
- } else if (!strcmp(r, "g")) {
- gdbstub_port = atoi(argv[optind++]);
diff --git a/meta/packages/qemu/qemu-git/11_signal_sigaction.patch b/meta/packages/qemu/qemu-git/11_signal_sigaction.patch
deleted file mode 100644
index 33c5e8b12d..0000000000
--- a/meta/packages/qemu/qemu-git/11_signal_sigaction.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-#DPATCHLEVEL=0
----
-# linux-user/signal.c | 5 +++++
-# 1 file changed, 5 insertions(+)
-#
-Index: linux-user/signal.c
-===================================================================
---- linux-user/signal.c.orig 2007-12-03 23:47:44.000000000 +0000
-+++ linux-user/signal.c 2007-12-03 23:47:46.000000000 +0000
-@@ -512,6 +512,11 @@ int do_sigaction(int sig, const struct t
-
- if (sig < 1 || sig > TARGET_NSIG || sig == SIGKILL || sig == SIGSTOP)
- return -EINVAL;
-+
-+ /* no point doing the stuff as those are not allowed for sigaction */
-+ if ((sig == TARGET_SIGKILL) || (sig == TARGET_SIGSTOP))
-+ return -EINVAL;
-+
- k = &sigact_table[sig - 1];
- #if defined(DEBUG_SIGNAL)
- fprintf(stderr, "sigaction sig=%d act=0x%08x, oact=0x%08x\n",
diff --git a/meta/packages/qemu/qemu-git/22_net_tuntap_stall.patch b/meta/packages/qemu/qemu-git/22_net_tuntap_stall.patch
deleted file mode 100644
index f2bfbc9102..0000000000
--- a/meta/packages/qemu/qemu-git/22_net_tuntap_stall.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-#DPATCHLEVEL=0
----
-# vl.c | 2 +-
-# 1 file changed, 1 insertion(+), 1 deletion(-)
-#
-Index: net.c
-===================================================================
---- net.c.orig 2009-01-05 11:27:29.000000000 +0000
-+++ net.c 2009-01-05 11:27:40.000000000 +0000
-@@ -852,7 +852,7 @@
- return -1;
- }
- memset(&ifr, 0, sizeof(ifr));
-- ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
-+ ifr.ifr_flags = IFF_TAP | IFF_NO_PI | IFF_ONE_QUEUE;;
- if (ifname[0] != '\0')
- pstrcpy(ifr.ifr_name, IFNAMSIZ, ifname);
- else
diff --git a/meta/packages/qemu/qemu-git/31_syscalls.patch b/meta/packages/qemu/qemu-git/31_syscalls.patch
deleted file mode 100644
index df2aa84bb1..0000000000
--- a/meta/packages/qemu/qemu-git/31_syscalls.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-#DPATCHLEVEL=0
----
-# linux-user/syscall.c | 11 ++++++++---
-# 1 file changed, 8 insertions(+), 3 deletions(-)
-#
-Index: linux-user/syscall.c
-===================================================================
---- linux-user/syscall.c.orig 2009-01-05 12:32:37.000000000 +0000
-+++ linux-user/syscall.c 2009-01-05 12:32:37.000000000 +0000
-@@ -298,6 +298,7 @@
- extern int setfsuid(int);
- extern int setfsgid(int);
- extern int setgroups(int, gid_t *);
-+extern int uselib(const char*);
-
- #define ERRNO_TABLE_SIZE 1200
-
-@@ -4397,7 +4398,8 @@
- #endif
- #ifdef TARGET_NR_uselib
- case TARGET_NR_uselib:
-- goto unimplemented;
-+ ret = get_errno(uselib(path((const char*)arg1)));
-+ break;
- #endif
- #ifdef TARGET_NR_swapon
- case TARGET_NR_swapon:
diff --git a/meta/packages/qemu/qemu-git/52_ne2000_return.patch b/meta/packages/qemu/qemu-git/52_ne2000_return.patch
deleted file mode 100644
index e4ea33f2c6..0000000000
--- a/meta/packages/qemu/qemu-git/52_ne2000_return.patch
+++ /dev/null
@@ -1,17 +0,0 @@
----
- hw/ne2000.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-Index: qemu/hw/ne2000.c
-===================================================================
---- qemu.orig/hw/ne2000.c 2007-12-03 19:32:52.000000000 +0000
-+++ qemu/hw/ne2000.c 2007-12-03 19:33:55.000000000 +0000
-@@ -217,7 +217,7 @@ static int ne2000_can_receive(void *opaq
- NE2000State *s = opaque;
-
- if (s->cmd & E8390_STOP)
-- return 1;
-+ return 0;
- return !ne2000_buffer_full(s);
- }
-
diff --git a/meta/packages/qemu/qemu-git/63_sparc_build.patch b/meta/packages/qemu/qemu-git/63_sparc_build.patch
deleted file mode 100644
index 37b38f641b..0000000000
--- a/meta/packages/qemu/qemu-git/63_sparc_build.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-#DPATCHLEVEL=0
----
-# sparc.ld | 2 +-
-# 1 file changed, 1 insertion(+), 1 deletion(-)
-#
-Index: sparc.ld
-===================================================================
---- sparc.ld.orig 2007-12-03 15:40:26.000000000 +0000
-+++ sparc.ld 2007-12-03 16:05:06.000000000 +0000
-@@ -6,7 +6,7 @@ ENTRY(_start)
- SECTIONS
- {
- /* Read-only sections, merged into text segment: */
-- . = 0x60000000 + SIZEOF_HEADERS;
-+ . = 0x60000000 + 0x400;
- .interp : { *(.interp) }
- .hash : { *(.hash) }
- .dynsym : { *(.dynsym) }
diff --git a/meta/packages/qemu/qemu-git/64_ppc_asm_constraints.patch b/meta/packages/qemu/qemu-git/64_ppc_asm_constraints.patch
deleted file mode 100644
index e4858b79d7..0000000000
--- a/meta/packages/qemu/qemu-git/64_ppc_asm_constraints.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-#DPATCHLEVEL=1
----
-# cpu-all.h | 2 +-
-# 1 file changed, 1 insertion(+), 1 deletion(-)
-#
-Index: qemu/cpu-all.h
-===================================================================
---- qemu.orig/cpu-all.h 2007-06-13 11:48:22.000000000 +0100
-+++ qemu/cpu-all.h 2007-06-13 11:51:56.000000000 +0100
-@@ -250,7 +250,7 @@ static inline void stw_le_p(void *ptr, i
- static inline void stl_le_p(void *ptr, int v)
- {
- #ifdef __powerpc__
-- __asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*(uint32_t *)ptr) : "r" (v), "r" (ptr));
-+ __asm__ __volatile__ ("stwbrx %0,0,%1" : : "r" (v), "r" (ptr) : "memory");
- #else
- uint8_t *p = ptr;
- p[0] = v;
diff --git a/meta/packages/qemu/qemu-git/66_tls_ld.patch b/meta/packages/qemu/qemu-git/66_tls_ld.patch
deleted file mode 100644
index 54e02eff8b..0000000000
--- a/meta/packages/qemu/qemu-git/66_tls_ld.patch
+++ /dev/null
@@ -1,55 +0,0 @@
----
- arm.ld | 7 +++++++
- i386.ld | 7 +++++++
- 2 files changed, 14 insertions(+)
-
-Index: arm.ld
-===================================================================
---- arm.ld.orig 2007-06-13 11:48:22.000000000 +0100
-+++ arm.ld 2007-06-13 11:51:56.000000000 +0100
-@@ -26,6 +26,10 @@ SECTIONS
- { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
- .rela.rodata :
- { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
-+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
-+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
-+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
-+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
- .rel.got : { *(.rel.got) }
- .rela.got : { *(.rela.got) }
- .rel.ctors : { *(.rel.ctors) }
-@@ -58,6 +62,9 @@ SECTIONS
- .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) }
- __exidx_end = .;
- .reginfo : { *(.reginfo) }
-+ /* Thread Local Storage sections */
-+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
-+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
- /* Adjust the address for the data segment. We want to adjust up to
- the same address within the page on the next page up. */
- . = ALIGN(0x100000) + (. & (0x100000 - 1));
-Index: i386.ld
-===================================================================
---- i386.ld.orig 2007-06-13 11:48:22.000000000 +0100
-+++ i386.ld 2007-06-13 11:51:56.000000000 +0100
-@@ -28,6 +28,10 @@ SECTIONS
- { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
- .rela.rodata :
- { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
-+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
-+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
-+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
-+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
- .rel.got : { *(.rel.got) }
- .rela.got : { *(.rela.got) }
- .rel.ctors : { *(.rel.ctors) }
-@@ -53,6 +57,9 @@ SECTIONS
- _etext = .;
- PROVIDE (etext = .);
- .fini : { *(.fini) } =0x47ff041f
-+ /* Thread Local Storage sections */
-+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
-+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
- . = ALIGN(32 / 8);
- PROVIDE (__preinit_array_start = .);
- .preinit_array : { *(.preinit_array) }
diff --git a/meta/packages/qemu/qemu-git/91-oh-sdl-cursor.patch b/meta/packages/qemu/qemu-git/91-oh-sdl-cursor.patch
deleted file mode 100644
index 0d60c1c306..0000000000
--- a/meta/packages/qemu/qemu-git/91-oh-sdl-cursor.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-=== modified file 'sdl.c'
----
- sdl.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-Index: sdl.c
-===================================================================
---- sdl.c.orig 2007-12-03 19:32:15.000000000 +0000
-+++ sdl.c 2007-12-03 19:34:04.000000000 +0000
-@@ -247,7 +247,7 @@ static void sdl_hide_cursor(void)
-
- if (kbd_mouse_is_absolute()) {
- SDL_ShowCursor(1);
-- SDL_SetCursor(sdl_cursor_hidden);
-+ /* SDL_SetCursor(sdl_cursor_hidden); */
- } else {
- SDL_ShowCursor(0);
- }
diff --git a/meta/packages/qemu/qemu-git/fix-nogl.patch b/meta/packages/qemu/qemu-git/fix-nogl.patch
new file mode 100644
index 0000000000..f1f9bcf00b
--- /dev/null
+++ b/meta/packages/qemu/qemu-git/fix-nogl.patch
@@ -0,0 +1,40 @@
+Index: git/Makefile.target
+===================================================================
+--- git.orig/Makefile.target 2009-06-09 22:05:27.000000000 +0100
++++ git/Makefile.target 2009-06-09 22:05:28.000000000 +0100
+@@ -155,6 +155,8 @@
+
+ ifeq ($(TARGET_BASE_ARCH), i386)
+ LIBOBJS+=helper_opengl.o opengl_exec.o
++else
++LIBOBJS+=dummygl.o
+ endif
+
+ ifeq ($(TARGET_BASE_ARCH), arm)
+Index: git/target-arm/dummygl.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ git/target-arm/dummygl.c 2009-06-09 22:15:55.000000000 +0100
+@@ -0,0 +1,22 @@
++#include <string.h>
++#include <stdlib.h>
++#include <assert.h>
++#include <stdint.h>
++#include <X11/Xlib.h>
++#include <X11/Xutil.h>
++
++void opengl_exec_set_parent_window(Display* _dpy, Window _parent_window)
++{
++
++}
++
++void opengl_process_enable(void)
++{
++
++}
++
++
++void mem_opengl(uint64_t ptr)
++{
++
++}
diff --git a/meta/packages/qemu/qemu-git/qemu-amd64-32b-mapping-0.9.0.patch b/meta/packages/qemu/qemu-git/qemu-amd64-32b-mapping-0.9.0.patch
deleted file mode 100644
index 40ab59c762..0000000000
--- a/meta/packages/qemu/qemu-git/qemu-amd64-32b-mapping-0.9.0.patch
+++ /dev/null
@@ -1,37 +0,0 @@
----
- linux-user/mmap.c | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
-
-Index: trunk/linux-user/mmap.c
-===================================================================
---- trunk.orig/linux-user/mmap.c 2009-01-05 11:09:58.000000000 +0000
-+++ trunk/linux-user/mmap.c 2009-01-05 12:46:33.000000000 +0000
-@@ -122,6 +122,10 @@
- munmap(p, *p);
- }
-
-+#ifndef MAP_32BIT
-+#define MAP_32BIT 0
-+#endif
-+
- /* NOTE: all the constants are the HOST ones, but addresses are target. */
- int target_mprotect(abi_ulong start, abi_ulong len, int prot)
- {
-@@ -365,7 +369,7 @@
- especially important if qemu_host_page_size >
- qemu_real_host_page_size */
- p = mmap(g2h(mmap_start),
-- host_len, prot, flags | MAP_FIXED, fd, host_offset);
-+ host_len, prot, flags | MAP_FIXED | MAP_32BIT, fd, host_offset);
- if (p == MAP_FAILED)
- goto fail;
- /* update start so that it points to the file position at 'offset' */
-@@ -567,7 +571,7 @@
- flags | MREMAP_FIXED,
- g2h(mmap_start));
- } else {
-- host_addr = mremap(g2h(old_addr), old_size, new_size, flags);
-+ host_addr = mremap(g2h(old_addr), old_size, new_size, flags | MAP_32BIT);
- /* Check if address fits target address space */
- if ((unsigned long)host_addr + new_size > (abi_ulong)-1) {
- /* Revert mremap() changes */
diff --git a/meta/packages/qemu/qemu-git/qemu-add-gl-host-code.patch b/meta/packages/qemu/qemu-git/qemu-git-qemugl-host.patch
index 25ee379251..3ad5c081f1 100644
--- a/meta/packages/qemu/qemu-git/qemu-add-gl-host-code.patch
+++ b/meta/packages/qemu/qemu-git/qemu-git-qemugl-host.patch
@@ -1,21 +1,19 @@
-Index: git/Makefile.target
-===================================================================
---- git.orig/Makefile.target 2009-05-23 11:22:16.000000000 +0100
-+++ git/Makefile.target 2009-05-23 11:59:35.000000000 +0100
-@@ -153,6 +153,12 @@
+diff --git a/Makefile.target b/Makefile.target
+index f33f762..d1eb876 100644
+--- a/Makefile.target
++++ b/Makefile.target
+@@ -153,6 +153,10 @@ endif
CPPFLAGS+=-I$(SRC_PATH)/fpu
LIBOBJS+= op_helper.o helper.o
+ifeq ($(TARGET_BASE_ARCH), i386)
+LIBOBJS+=helper_opengl.o opengl_exec.o
-+else
-+LIBOBJS+=opengl_dummy.o
+endif
+
ifeq ($(TARGET_BASE_ARCH), arm)
LIBOBJS+= neon_helper.o iwmmxt_helper.o
endif
-@@ -224,6 +230,21 @@
+@@ -224,6 +228,21 @@ op_helper.o: CFLAGS += $(HELPER_CFLAGS) $(I386_CFLAGS)
cpu-exec.o: CFLAGS += $(HELPER_CFLAGS)
@@ -37,20 +35,46 @@ Index: git/Makefile.target
#########################################################
# Linux user emulator target
-@@ -724,7 +745,7 @@
- main.o: CFLAGS+=-p
+@@ -584,7 +603,7 @@ OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
+ OBJS+= cirrus_vga.o apic.o parallel.o acpi.o piix_pci.o
+ OBJS+= usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o
+ OBJS += device-hotplug.o pci-hotplug.o
+-CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
++CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE -DTARGET_OPENGL_OK
endif
-
--$(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS)
-+$(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) -lGL -lGLU
+ ifeq ($(TARGET_BASE_ARCH), ppc)
+ CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
+@@ -727,7 +746,7 @@ endif
+ $(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS)
$(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a
- $(LINK)
-Index: git/hw/vmware_vga.c
-===================================================================
---- git.orig/hw/vmware_vga.c 2009-05-23 11:22:16.000000000 +0100
-+++ git/hw/vmware_vga.c 2009-05-23 11:22:17.000000000 +0100
-@@ -484,6 +484,8 @@
+- $(LINK)
++ $(LINK) -lGL -lGLU
+
+ endif # !CONFIG_USER_ONLY
+
+diff --git a/hw/pixel_ops.h b/hw/pixel_ops.h
+index d390adf..9100b5c 100644
+--- a/hw/pixel_ops.h
++++ b/hw/pixel_ops.h
+@@ -4,6 +4,12 @@ static inline unsigned int rgb_to_pixel8(unsigned int r, unsigned int g,
+ return ((r >> 5) << 5) | ((g >> 5) << 2) | (b >> 6);
+ }
+
++static inline unsigned int rgb_to_pixel8bgr(unsigned int r, unsigned int g,
++ unsigned int b)
++{
++ return ((b >> 5) << 5) | ((g >> 5) << 2) | (r >> 6);
++}
++
+ static inline unsigned int rgb_to_pixel15(unsigned int r, unsigned int g,
+ unsigned int b)
+ {
+diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
+index d1cba28..c918afb 100644
+--- a/hw/vmware_vga.c
++++ b/hw/vmware_vga.c
+@@ -484,6 +484,8 @@ static inline void vmsvga_cursor_define(struct vmsvga_state_s *s,
#define CMD(f) le32_to_cpu(s->cmd->f)
@@ -59,7 +83,7 @@ Index: git/hw/vmware_vga.c
static inline int vmsvga_fifo_empty(struct vmsvga_state_s *s)
{
if (!s->config || !s->enable)
-@@ -493,11 +495,18 @@
+@@ -493,11 +495,18 @@ static inline int vmsvga_fifo_empty(struct vmsvga_state_s *s)
static inline uint32_t vmsvga_fifo_read_raw(struct vmsvga_state_s *s)
{
@@ -82,7 +106,7 @@ Index: git/hw/vmware_vga.c
}
static inline uint32_t vmsvga_fifo_read(struct vmsvga_state_s *s)
-@@ -507,12 +516,12 @@
+@@ -507,12 +516,12 @@ static inline uint32_t vmsvga_fifo_read(struct vmsvga_state_s *s)
static void vmsvga_fifo_run(struct vmsvga_state_s *s)
{
@@ -97,7 +121,7 @@ Index: git/hw/vmware_vga.c
case SVGA_CMD_UPDATE:
case SVGA_CMD_UPDATE_VERBOSE:
x = vmsvga_fifo_read(s);
-@@ -612,7 +621,7 @@
+@@ -612,7 +621,7 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s)
while (args --)
vmsvga_fifo_read(s);
printf("%s: Unknown command 0x%02x in SVGA command FIFO\n",
@@ -106,11 +130,35 @@ Index: git/hw/vmware_vga.c
break;
}
-Index: git/kqemu.c
-===================================================================
---- git.orig/kqemu.c 2009-05-23 11:22:16.000000000 +0100
-+++ git/kqemu.c 2009-05-23 11:22:17.000000000 +0100
-@@ -93,6 +93,8 @@
+@@ -914,8 +923,9 @@ static void vmsvga_reset(struct vmsvga_state_s *s)
+ s->width = -1;
+ s->height = -1;
+ s->svgaid = SVGA_ID;
+- s->depth = 24;
++ s->depth = 32;
+ s->bypp = (s->depth + 7) >> 3;
++ s->bypp = 4; /* XXX: until we can get host's actual depth */
+ s->cursor.on = 0;
+ s->redraw_fifo_first = 0;
+ s->redraw_fifo_last = 0;
+@@ -1140,6 +1150,12 @@ static void vmsvga_init(struct vmsvga_state_s *s,
+ /* XXX: use optimized standard vga accesses */
+ cpu_register_physical_memory(VBE_DISPI_LFB_PHYSICAL_ADDRESS,
+ vga_ram_size, vga_ram_offset);
++
++#ifdef EMBED_STDVGA
++ s->map_addr = VBE_DISPI_LFB_PHYSICAL_ADDRESS;
++ s->map_end = VBE_DISPI_LFB_PHYSICAL_ADDRESS + vga_ram_size;
++ vga_dirty_log_start((VGAState *) s);
++#endif
+ #endif
+ }
+
+diff --git a/kqemu.c b/kqemu.c
+index 25f4ea7..09c761a 100644
+--- a/kqemu.c
++++ b/kqemu.c
+@@ -93,6 +93,8 @@ uint8_t *modified_ram_pages_table;
int qpi_io_memory;
uint32_t kqemu_comm_base; /* physical address of the QPI communication page */
@@ -119,7 +167,7 @@ Index: git/kqemu.c
#define cpuid(index, eax, ebx, ecx, edx) \
asm volatile ("cpuid" \
: "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) \
-@@ -860,6 +862,22 @@
+@@ -860,6 +862,22 @@ int kqemu_cpu_exec(CPUState *env)
else
env->hflags &= ~HF_OSFXSR_MASK;
@@ -134,7 +182,7 @@ Index: git/kqemu.c
+
+ if (env->tlb_table[1][index].addend) {
+ unsigned char *ptr = env->eip + env->tlb_table[1][index].addend;
-+ if (ptr[0] == 0xCD && ptr[1] == 0x99)
++ if (ptr[0] == 0xcd && ptr[1] == 0x99)
+ helper_opengl();
+ }
+ }
@@ -142,10 +190,271 @@ Index: git/kqemu.c
LOG_INT("kqemu: kqemu_cpu_exec: ret=0x%x\n", ret);
if (ret == KQEMU_RET_SYSCALL) {
/* syscall instruction */
-Index: git/target-i386/beginend_funcs.sh
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ git/target-i386/beginend_funcs.sh 2009-05-23 11:22:17.000000000 +0100
+diff --git a/qemu-char.c b/qemu-char.c
+index 64d41d0..424ea9b 100644
+--- a/qemu-char.c
++++ b/qemu-char.c
+@@ -2112,6 +2112,69 @@ static CharDriverState *qemu_chr_open_tcp(const char *host_str,
+ return NULL;
+ }
+
++#define TARGET_OPENGL_OK
++#if defined(TARGET_OPENGL_OK)
++static uint8_t buffer[32];
++static int buffer_len;
++static int hexdigit[128] = {
++ ['0'] = 0x0,
++ ['1'] = 0x1,
++ ['2'] = 0x2,
++ ['3'] = 0x3,
++ ['4'] = 0x4,
++ ['5'] = 0x5,
++ ['6'] = 0x6,
++ ['7'] = 0x7,
++ ['8'] = 0x8,
++ ['9'] = 0x9,
++ ['a'] = 0xa,
++ ['b'] = 0xb,
++ ['c'] = 0xc,
++ ['d'] = 0xd,
++ ['e'] = 0xe,
++ ['f'] = 0xf,
++};
++
++static int opengl_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
++{
++ uint64_t ptr = 0;
++ int i;
++
++ if (memchr(buf, 'x', len))
++ opengl_process_enable();
++ return len;
++ memcpy(buffer + buffer_len, buf, len);
++ buffer_len += len;
++
++ if (buffer_len >= 16) {
++ for (i = 0; i < 16; i ++)
++ ptr = (ptr << 4) + hexdigit[buffer[i]];
++
++ buffer_len -= 16;
++ if (buffer_len)
++ memcpy(buffer, buffer + 16, buffer_len);
++
++ mem_opengl(ptr);
++ }
++
++ return len;
++}
++
++CharDriverState *qemu_chr_open_opengl(void)
++{
++ CharDriverState *chr = qemu_mallocz(sizeof(CharDriverState));
++
++ chr->opaque = chr;
++ chr->chr_write = opengl_chr_write;
++
++ qemu_chr_reset(chr);
++
++ return chr;
++}
++#else
++#define qemu_chr_open_opengl() 0
++#endif
++
+ CharDriverState *qemu_chr_open(const char *label, const char *filename, void (*init)(struct CharDriverState *s))
+ {
+ const char *p;
+@@ -2192,6 +2255,9 @@ CharDriverState *qemu_chr_open(const char *label, const char *filename, void (*i
+ chr = chr_baum_init();
+ } else
+ #endif
++ if (!strcmp(filename, "opengl")) {
++ chr = qemu_chr_open_opengl();
++ } else
+ {
+ chr = NULL;
+ }
+diff --git a/sdl.c b/sdl.c
+index 74f084c..b78f754 100644
+--- a/sdl.c
++++ b/sdl.c
+@@ -54,6 +54,8 @@ static int guest_cursor = 0;
+ static int guest_x, guest_y;
+ static SDL_Cursor *guest_sprite = 0;
+
++extern void opengl_exec_set_parent_window(Display* _dpy, Window _parent_window);
++
+ static void sdl_update(DisplayState *ds, int x, int y, int w, int h)
+ {
+ SDL_Rect rec;
+@@ -85,7 +87,9 @@ static void sdl_setdata(DisplayState *ds)
+
+ static void sdl_resize(DisplayState *ds)
+ {
++ SDL_SysWMinfo info;
+ int flags;
++ static Display *dpy;
+
+ // printf("resizing to %d %d\n", w, h);
+
+@@ -104,6 +108,13 @@ static void sdl_resize(DisplayState *ds)
+ }
+
+ sdl_setdata(ds);
++
++ SDL_GetWMInfo(&info);
++ if (info.subsystem == SDL_SYSWM_X11 && info.info.x11.display &&
++ (!dpy || dpy == info.info.x11.display)) {
++ dpy = info.info.x11.display;
++ opengl_exec_set_parent_window(dpy, info.info.x11.window);
++ }
+ }
+
+ /* generic keyboard conversion */
+@@ -320,7 +331,7 @@ static void sdl_show_cursor(void)
+
+ if (!kbd_mouse_is_absolute()) {
+ SDL_ShowCursor(1);
+- if (guest_cursor &&
++ if (guest_cursor && !force_pointer &&
+ (gui_grab || kbd_mouse_is_absolute() || absolute_enabled))
+ SDL_SetCursor(guest_sprite);
+ else
+@@ -331,7 +342,8 @@ static void sdl_show_cursor(void)
+ static void sdl_grab_start(void)
+ {
+ if (guest_cursor) {
+- SDL_SetCursor(guest_sprite);
++ if (!force_pointer)
++ SDL_SetCursor(guest_sprite);
+ if (!kbd_mouse_is_absolute() && !absolute_enabled)
+ SDL_WarpMouse(guest_x, guest_y);
+ } else
+@@ -372,8 +384,8 @@ static void sdl_send_mouse_event(int dx, int dy, int dz, int x, int y, int state
+ absolute_enabled = 1;
+ }
+
+- dx = x * 0x7FFF / (width - 1);
+- dy = y * 0x7FFF / (height - 1);
++ dx = x * 0x7FFF / (width - 1);
++ dy = y * 0x7FFF / (height - 1);
+ } else if (absolute_enabled) {
+ sdl_show_cursor();
+ absolute_enabled = 0;
+@@ -603,7 +615,8 @@ static void sdl_mouse_warp(int x, int y, int on)
+ if (!guest_cursor)
+ sdl_show_cursor();
+ if (gui_grab || kbd_mouse_is_absolute() || absolute_enabled) {
+- SDL_SetCursor(guest_sprite);
++ if (!force_pointer)
++ SDL_SetCursor(guest_sprite);
+ if (!kbd_mouse_is_absolute() && !absolute_enabled)
+ SDL_WarpMouse(x, y);
+ }
+@@ -628,6 +641,10 @@ static void sdl_mouse_define(int width, int height, int bpp,
+ line = image;
+ for (x = 0; x < width; x ++, dst ++) {
+ switch (bpp) {
++ case 32:
++ src = *(line ++); src |= *(line ++);
++ src = *(line ++); src |= *(line ++);
++ break;
+ case 24:
+ src = *(line ++); src |= *(line ++); src |= *(line ++);
+ break;
+@@ -654,7 +671,7 @@ static void sdl_mouse_define(int width, int height, int bpp,
+ }
+ guest_sprite = SDL_CreateCursor(sprite, mask, width, height, hot_x, hot_y);
+
+- if (guest_cursor &&
++ if (guest_cursor && !force_pointer &&
+ (gui_grab || kbd_mouse_is_absolute() || absolute_enabled))
+ SDL_SetCursor(guest_sprite);
+ }
+@@ -670,6 +687,7 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
+ {
+ int flags;
+ uint8_t data = 0;
++ SDL_SysWMinfo info;
+
+ #if defined(__APPLE__)
+ /* always use generic keymaps */
+@@ -691,6 +709,12 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
+ exit(1);
+ }
+
++ SDL_GetWMInfo(&info);
++ if (info.subsystem == SDL_SYSWM_X11 && info.info.x11.display)
++ opengl_exec_set_parent_window(info.info.x11.display,
++ RootWindow(info.info.x11.display,
++ DefaultScreen(info.info.x11.display)));
++
+ dcl = qemu_mallocz(sizeof(DisplayChangeListener));
+ dcl->dpy_update = sdl_update;
+ dcl->dpy_resize = sdl_resize;
+@@ -714,4 +738,9 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
+ gui_fullscreen_initial_grab = 1;
+ sdl_grab_start();
+ }
++
++ SDL_GetWMInfo(&info);
++ if (info.subsystem == SDL_SYSWM_X11 && info.info.x11.display)
++ opengl_exec_set_parent_window(info.info.x11.display,
++ info.info.x11.window);
+ }
+diff --git a/slirp/ctl.h b/slirp/ctl.h
+index 4a8576d..201ae4b 100644
+--- a/slirp/ctl.h
++++ b/slirp/ctl.h
+@@ -2,6 +2,7 @@
+ #define CTL_EXEC 1
+ #define CTL_ALIAS 2
+ #define CTL_DNS 3
++#define CTL_OPENGL 6
+
+ #define CTL_SPECIAL "10.0.2.0"
+ #define CTL_LOCAL "10.0.2.15"
+diff --git a/slirp/udp.c b/slirp/udp.c
+index 8d3bdd2..e5f40cc 100644
+--- a/slirp/udp.c
++++ b/slirp/udp.c
+@@ -40,6 +40,7 @@
+
+ #include <slirp.h>
+ #include "ip_icmp.h"
++#include "bswap.h"
+
+ #ifdef LOG_ENABLED
+ struct udpstat udpstat;
+@@ -153,6 +154,11 @@ udp_input(m, iphlen)
+ goto bad;
+ }
+
++ if (ntohs(uh->uh_dport) == 9999 && m->m_len - iphlen == 16) {
++ mem_opengl(le64_to_cpup((uint64_t *) (m->m_data + iphlen + 8)));
++ goto bad;
++ }
++
+ if (slirp_restrict)
+ goto bad;
+
+diff --git a/sysemu.h b/sysemu.h
+index 57217c1..f0a48cd 100644
+--- a/sysemu.h
++++ b/sysemu.h
+@@ -96,6 +96,7 @@ extern int graphic_rotate;
+ extern int no_quit;
+ extern int semihosting_enabled;
+ extern int old_param;
++extern int force_pointer;
+ extern const char *bootp_filename;
+
+ #ifdef USE_KQEMU
+diff --git a/target-i386/beginend_funcs.sh b/target-i386/beginend_funcs.sh
+new file mode 100755
+index 0000000..bdd7684
+--- /dev/null
++++ b/target-i386/beginend_funcs.sh
@@ -0,0 +1,23 @@
+#! /bin/sh
+# Copyright 2008 (C) Intel Corporation
@@ -170,10 +479,11 @@ Index: git/target-i386/beginend_funcs.sh
+echo -e MAGIC_MACRO\(glCallList\)\\n
+echo -e MAGIC_MACRO\(glCallLists\)\\n
+echo -e MAGIC_MACRO\(glEdgeFlag{,v}\)\\n
-Index: git/target-i386/ghash.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ git/target-i386/ghash.c 2009-05-23 11:22:17.000000000 +0100
+diff --git a/target-i386/ghash.c b/target-i386/ghash.c
+new file mode 100644
+index 0000000..1f0c380
+--- /dev/null
++++ b/target-i386/ghash.c
@@ -0,0 +1,347 @@
+/* This is a modified and simplified version of original ghash.c */
+
@@ -522,10 +832,11 @@ Index: git/target-i386/ghash.c
+ hash_node = next;
+ }
+}
-Index: git/target-i386/ghash.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ git/target-i386/ghash.h 2009-05-23 11:22:17.000000000 +0100
+diff --git a/target-i386/ghash.h b/target-i386/ghash.h
+new file mode 100644
+index 0000000..7f34436
+--- /dev/null
++++ b/target-i386/ghash.h
@@ -0,0 +1,59 @@
+/* This is a modified and simplified version of original ghash.h */
+
@@ -586,10 +897,11 @@ Index: git/target-i386/ghash.h
+
+#endif /* __SIMPLE_HASH_H__ */
+
-Index: git/target-i386/gl_func_perso.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ git/target-i386/gl_func_perso.h 2009-05-23 11:22:17.000000000 +0100
+diff --git a/target-i386/gl_func_perso.h b/target-i386/gl_func_perso.h
+new file mode 100644
+index 0000000..401c0a8
+--- /dev/null
++++ b/target-i386/gl_func_perso.h
@@ -0,0 +1,135 @@
+/*
+ * Hand-implemented GL/GLX API
@@ -726,22 +1038,36 @@ Index: git/target-i386/gl_func_perso.h
+MAGIC_MACRO(_glGetSelectBuffer_fake),
+MAGIC_MACRO(_glFeedbackBuffer_fake),
+MAGIC_MACRO(_glGetFeedbackBuffer_fake),
-Index: git/target-i386/helper.h
-===================================================================
---- git.orig/target-i386/helper.h 2009-05-23 11:22:16.000000000 +0100
-+++ git/target-i386/helper.h 2009-05-23 11:22:17.000000000 +0100
-@@ -214,4 +214,6 @@
+diff --git a/target-i386/helper.c b/target-i386/helper.c
+index e714994..7354220 100644
+--- a/target-i386/helper.c
++++ b/target-i386/helper.c
+@@ -1320,7 +1320,7 @@ target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
+ }
+
+ page_offset = (addr & TARGET_PAGE_MASK) & (page_size - 1);
+- paddr = (pte & TARGET_PAGE_MASK) + page_offset;
++ paddr = (pte & PHYS_ADDR_MASK) + page_offset;
+ return paddr;
+ }
+
+diff --git a/target-i386/helper.h b/target-i386/helper.h
+index 0c36783..b247b35 100644
+--- a/target-i386/helper.h
++++ b/target-i386/helper.h
+@@ -214,4 +214,6 @@ DEF_HELPER_2(rclq, tl, tl, tl)
DEF_HELPER_2(rcrq, tl, tl, tl)
#endif
+DEF_HELPER_0(opengl, void)
+
#include "def-helper.h"
-Index: git/target-i386/helper_opengl.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ git/target-i386/helper_opengl.c 2009-05-23 11:22:17.000000000 +0100
-@@ -0,0 +1,979 @@
+diff --git a/target-i386/helper_opengl.c b/target-i386/helper_opengl.c
+new file mode 100644
+index 0000000..f83d02b
+--- /dev/null
++++ b/target-i386/helper_opengl.c
+@@ -0,0 +1,1205 @@
+/*
+ * Host-side implementation of GL/GLX API
+ *
@@ -796,13 +1122,16 @@ Index: git/target-i386/helper_opengl.c
+static int last_process_id = 0;
+static int must_save = 0;
+