summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 @@
1#DPATCHLEVEL=0
2---
3# linux-user/main.c | 8 ++++----
4# 1 file changed, 4 insertions(+), 4 deletions(-)
5#
6Index: linux-user/main.c
7===================================================================
8--- linux-user/main.c.orig 2007-12-03 23:47:25.000000000 +0000
9+++ linux-user/main.c 2007-12-03 23:47:41.000000000 +0000
10@@ -714,7 +714,7 @@ void cpu_loop (CPUSPARCState *env)
11 default:
12 printf ("Unhandled trap: 0x%x\n", trapnr);
13 cpu_dump_state(env, stderr, fprintf, 0);
14- exit (1);
15+ _exit (1);
16 }
17 process_pending_signals (env);
18 }
19@@ -1634,7 +1634,7 @@ void cpu_loop (CPUState *env)
20 default:
21 printf ("Unhandled trap: 0x%x\n", trapnr);
22 cpu_dump_state(env, stderr, fprintf, 0);
23- exit (1);
24+ _exit (1);
25 }
26 process_pending_signals (env);
27 }
28@@ -1954,7 +1954,7 @@ int main(int argc, char **argv)
29 for(item = cpu_log_items; item->mask != 0; item++) {
30 printf("%-10s %s\n", item->name, item->help);
31 }
32- exit(1);
33+ _exit(1);
34 }
35 cpu_set_log(mask);
36 } else if (!strcmp(r, "s")) {
37@@ -1973,7 +1973,7 @@ int main(int argc, char **argv)
38 if (qemu_host_page_size == 0 ||
39 (qemu_host_page_size & (qemu_host_page_size - 1)) != 0) {
40 fprintf(stderr, "page size must be a power of two\n");
41- exit(1);
42+ _exit(1);
43 }
44 } else if (!strcmp(r, "g")) {
45 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 @@
1#DPATCHLEVEL=0
2---
3# linux-user/signal.c | 5 +++++
4# 1 file changed, 5 insertions(+)
5#
6Index: linux-user/signal.c
7===================================================================
8--- linux-user/signal.c.orig 2007-12-03 23:47:44.000000000 +0000
9+++ linux-user/signal.c 2007-12-03 23:47:46.000000000 +0000
10@@ -512,6 +512,11 @@ int do_sigaction(int sig, const struct t
11
12 if (sig < 1 || sig > TARGET_NSIG || sig == SIGKILL || sig == SIGSTOP)
13 return -EINVAL;
14+
15+ /* no point doing the stuff as those are not allowed for sigaction */
16+ if ((sig == TARGET_SIGKILL) || (sig == TARGET_SIGSTOP))
17+ return -EINVAL;
18+
19 k = &sigact_table[sig - 1];
20 #if defined(DEBUG_SIGNAL)
21 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 @@
1#DPATCHLEVEL=0
2---
3# vl.c | 2 +-
4# 1 file changed, 1 insertion(+), 1 deletion(-)
5#
6Index: net.c
7===================================================================
8--- net.c.orig 2009-01-05 11:27:29.000000000 +0000
9+++ net.c 2009-01-05 11:27:40.000000000 +0000
10@@ -852,7 +852,7 @@
11 return -1;
12 }
13 memset(&ifr, 0, sizeof(ifr));
14- ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
15+ ifr.ifr_flags = IFF_TAP | IFF_NO_PI | IFF_ONE_QUEUE;;
16 if (ifname[0] != '\0')
17 pstrcpy(ifr.ifr_name, IFNAMSIZ, ifname);
18 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 @@
1#DPATCHLEVEL=0
2---
3# linux-user/syscall.c | 11 ++++++++---
4# 1 file changed, 8 insertions(+), 3 deletions(-)
5#
6Index: linux-user/syscall.c
7===================================================================
8--- linux-user/syscall.c.orig 2009-01-05 12:32:37.000000000 +0000
9+++ linux-user/syscall.c 2009-01-05 12:32:37.000000000 +0000
10@@ -298,6 +298,7 @@
11 extern int setfsuid(int);
12 extern int setfsgid(int);
13 extern int setgroups(int, gid_t *);
14+extern int uselib(const char*);
15
16 #define ERRNO_TABLE_SIZE 1200
17
18@@ -4397,7 +4398,8 @@
19 #endif
20 #ifdef TARGET_NR_uselib
21 case TARGET_NR_uselib:
22- goto unimplemented;
23+ ret = get_errno(uselib(path((const char*)arg1)));
24+ break;
25 #endif
26 #ifdef TARGET_NR_swapon
27 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 @@
1---
2 hw/ne2000.c | 2 +-
3 1 file changed, 1 insertion(+), 1 deletion(-)
4
5Index: qemu/hw/ne2000.c
6===================================================================
7--- qemu.orig/hw/ne2000.c 2007-12-03 19:32:52.000000000 +0000
8+++ qemu/hw/ne2000.c 2007-12-03 19:33:55.000000000 +0000
9@@ -217,7 +217,7 @@ static int ne2000_can_receive(void *opaq
10 NE2000State *s = opaque;
11
12 if (s->cmd & E8390_STOP)
13- return 1;
14+ return 0;
15 return !ne2000_buffer_full(s);
16 }
17
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 @@
1#DPATCHLEVEL=0
2---
3# sparc.ld | 2 +-
4# 1 file changed, 1 insertion(+), 1 deletion(-)
5#
6Index: sparc.ld
7===================================================================
8--- sparc.ld.orig 2007-12-03 15:40:26.000000000 +0000
9+++ sparc.ld 2007-12-03 16:05:06.000000000 +0000
10@@ -6,7 +6,7 @@ ENTRY(_start)
11 SECTIONS
12 {
13 /* Read-only sections, merged into text segment: */
14- . = 0x60000000 + SIZEOF_HEADERS;
15+ . = 0x60000000 + 0x400;
16 .interp : { *(.interp) }
17 .hash : { *(.hash) }
18 .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 @@
1#DPATCHLEVEL=1
2---
3# cpu-all.h | 2 +-
4# 1 file changed, 1 insertion(+), 1 deletion(-)
5#
6Index: qemu/cpu-all.h
7===================================================================
8--- qemu.orig/cpu-all.h 2007-06-13 11:48:22.000000000 +0100
9+++ qemu/cpu-all.h 2007-06-13 11:51:56.000000000 +0100
10@@ -250,7 +250,7 @@ static inline void stw_le_p(void *ptr, i
11 static inline void stl_le_p(void *ptr, int v)
12 {
13 #ifdef __powerpc__
14- __asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*(uint32_t *)ptr) : "r" (v), "r" (ptr));
15+ __asm__ __volatile__ ("stwbrx %0,0,%1" : : "r" (v), "r" (ptr) : "memory");
16 #else
17 uint8_t *p = ptr;
18 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 @@
1---
2 arm.ld | 7 +++++++
3 i386.ld | 7 +++++++
4 2 files changed, 14 insertions(+)
5
6Index: arm.ld
7===================================================================
8--- arm.ld.orig 2007-06-13 11:48:22.000000000 +0100
9+++ arm.ld 2007-06-13 11:51:56.000000000 +0100
10@@ -26,6 +26,10 @@ SECTIONS
11 { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
12 .rela.rodata :
13 { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
14+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
15+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
16+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
17+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
18 .rel.got : { *(.rel.got) }
19 .rela.got : { *(.rela.got) }
20 .rel.ctors : { *(.rel.ctors) }
21@@ -58,6 +62,9 @@ SECTIONS
22 .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) }
23 __exidx_end = .;
24 .reginfo : { *(.reginfo) }
25+ /* Thread Local Storage sections */
26+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
27+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
28 /* Adjust the address for the data segment. We want to adjust up to
29 the same address within the page on the next page up. */
30 . = ALIGN(0x100000) + (. & (0x100000 - 1));
31Index: i386.ld
32===================================================================
33--- i386.ld.orig 2007-06-13 11:48:22.000000000 +0100
34+++ i386.ld 2007-06-13 11:51:56.000000000 +0100
35@@ -28,6 +28,10 @@ SECTIONS
36 { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
37 .rela.rodata :
38 { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
39+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
40+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
41+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
42+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
43 .rel.got : { *(.rel.got) }
44 .rela.got : { *(.rela.got) }
45 .rel.ctors : { *(.rel.ctors) }
46@@ -53,6 +57,9 @@ SECTIONS
47 _etext = .;
48 PROVIDE (etext = .);
49 .fini : { *(.fini) } =0x47ff041f
50+ /* Thread Local Storage sections */
51+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
52+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
53 . = ALIGN(32 / 8);
54 PROVIDE (__preinit_array_start = .);
55 .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 @@
1=== modified file 'sdl.c'
2---
3 sdl.c | 2 +-
4 1 file changed, 1 insertion(+), 1 deletion(-)
5
6Index: sdl.c
7===================================================================
8--- sdl.c.orig 2007-12-03 19:32:15.000000000 +0000
9+++ sdl.c 2007-12-03 19:34:04.000000000 +0000
10@@ -247,7 +247,7 @@ static void sdl_hide_cursor(void)
11
12 if (kbd_mouse_is_absolute()) {
13 SDL_ShowCursor(1);
14- SDL_SetCursor(sdl_cursor_hidden);
15+ /* SDL_SetCursor(sdl_cursor_hidden); */
16 } else {
17 SDL_ShowCursor(0);
18 }
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 @@
1Index: git/Makefile.target
2===================================================================
3--- git.orig/Makefile.target 2009-06-09 22:05:27.000000000 +0100
4+++ git/Makefile.target 2009-06-09 22:05:28.000000000 +0100
5@@ -155,6 +155,8 @@
6
7 ifeq ($(TARGET_BASE_ARCH), i386)
8 LIBOBJS+=helper_opengl.o opengl_exec.o
9+else
10+LIBOBJS+=dummygl.o
11 endif
12
13 ifeq ($(TARGET_BASE_ARCH), arm)
14Index: git/target-arm/dummygl.c
15===================================================================
16--- /dev/null 1970-01-01 00:00:00.000000000 +0000
17+++ git/target-arm/dummygl.c 2009-06-09 22:15:55.000000000 +0100
18@@ -0,0 +1,22 @@
19+#include <string.h>
20+#include <stdlib.h>
21+#include <assert.h>
22+#include <stdint.h>
23+#include <X11/Xlib.h>
24+#include <X11/Xutil.h>
25+
26+void opengl_exec_set_parent_window(Display* _dpy, Window _parent_window)
27+{
28+
29+}
30+
31+void opengl_process_enable(void)
32+{
33+
34+}
35+
36+
37+void mem_opengl(uint64_t ptr)
38+{
39+
40+}
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 @@
1---
2 linux-user/mmap.c | 8 ++++++--
3 1 file changed, 6 insertions(+), 2 deletions(-)
4
5Index: trunk/linux-user/mmap.c
6===================================================================
7--- trunk.orig/linux-user/mmap.c 2009-01-05 11:09:58.000000000 +0000
8+++ trunk/linux-user/mmap.c 2009-01-05 12:46:33.000000000 +0000
9@@ -122,6 +122,10 @@
10 munmap(p, *p);
11 }
12
13+#ifndef MAP_32BIT
14+#define MAP_32BIT 0
15+#endif
16+
17 /* NOTE: all the constants are the HOST ones, but addresses are target. */
18 int target_mprotect(abi_ulong start, abi_ulong len, int prot)
19 {
20@@ -365,7 +369,7 @@
21 especially important if qemu_host_page_size >
22 qemu_real_host_page_size */
23 p = mmap(g2h(mmap_start),
24- host_len, prot, flags | MAP_FIXED, fd, host_offset);
25+ host_len, prot, flags | MAP_FIXED | MAP_32BIT, fd, host_offset);
26 if (p == MAP_FAILED)
27 goto fail;
28 /* update start so that it points to the file position at 'offset' */
29@@ -567,7 +571,7 @@
30 flags | MREMAP_FIXED,
31 g2h(mmap_start));
32 } else {
33- host_addr = mremap(g2h(old_addr), old_size, new_size, flags);
34+ host_addr = mremap(g2h(old_addr), old_size, new_size, flags | MAP_32BIT);
35 /* Check if address fits target address space */
36 if ((unsigned long)host_addr + new_size > (abi_ulong)-1) {
37 /* 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 @@
1Index: git/Makefile.target 1diff --git a/Makefile.target b/Makefile.target
2=================================================================== 2index f33f762..d1eb876 100644
3--- git.orig/Makefile.target 2009-05-23 11:22:16.000000000 +0100 3--- a/Makefile.target
4+++ git/Makefile.target 2009-05-23 11:59:35.000000000 +0100 4+++ b/Makefile.target
5@@ -153,6 +153,12 @@ 5@@ -153,6 +153,10 @@ endif
6 CPPFLAGS+=-I$(SRC_PATH)/fpu 6 CPPFLAGS+=-I$(SRC_PATH)/fpu
7 LIBOBJS+= op_helper.o helper.o 7 LIBOBJS+= op_helper.o helper.o
8 8
9+ifeq ($(TARGET_BASE_ARCH), i386) 9+ifeq ($(TARGET_BASE_ARCH), i386)
10+LIBOBJS+=helper_opengl.o opengl_exec.o 10+LIBOBJS+=helper_opengl.o opengl_exec.o
11+else
12+LIBOBJS+=opengl_dummy.o
13+endif 11+endif
14+ 12+
15 ifeq ($(TARGET_BASE_ARCH), arm) 13 ifeq ($(TARGET_BASE_ARCH), arm)
16 LIBOBJS+= neon_helper.o iwmmxt_helper.o 14 LIBOBJS+= neon_helper.o iwmmxt_helper.o
17 endif 15 endif
18@@ -224,6 +230,21 @@ 16@@ -224,6 +228,21 @@ op_helper.o: CFLAGS += $(HELPER_CFLAGS) $(I386_CFLAGS)
19 17
20 cpu-exec.o: CFLAGS += $(HELPER_CFLAGS) 18 cpu-exec.o: CFLAGS += $(HELPER_CFLAGS)
21 19
@@ -37,20 +35,46 @@ Index: git/Makefile.target
37 ######################################################### 35 #########################################################
38 # Linux user emulator target 36 # Linux user emulator target
39 37
40@@ -724,7 +745,7 @@ 38@@ -584,7 +603,7 @@ OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
41 main.o: CFLAGS+=-p 39 OBJS+= cirrus_vga.o apic.o parallel.o acpi.o piix_pci.o
40 OBJS+= usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o
41 OBJS += device-hotplug.o pci-hotplug.o
42-CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
43+CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE -DTARGET_OPENGL_OK
42 endif 44 endif
43 45 ifeq ($(TARGET_BASE_ARCH), ppc)
44-$(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) 46 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
45+$(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) -lGL -lGLU 47@@ -727,7 +746,7 @@ endif
48 $(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS)
46 49
47 $(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a 50 $(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a
48 $(LINK) 51- $(LINK)
49Index: git/hw/vmware_vga.c 52+ $(LINK) -lGL -lGLU
50=================================================================== 53
51--- git.orig/hw/vmware_vga.c 2009-05-23 11:22:16.000000000 +0100 54 endif # !CONFIG_USER_ONLY
52+++ git/hw/vmware_vga.c 2009-05-23 11:22:17.000000000 +0100 55
53@@ -484,6 +484,8 @@ 56diff --git a/hw/pixel_ops.h b/hw/pixel_ops.h
57index d390adf..9100b5c 100644
58--- a/hw/pixel_ops.h
59+++ b/hw/pixel_ops.h
60@@ -4,6 +4,12 @@ static inline unsigned int rgb_to_pixel8(unsigned int r, unsigned int g,
61 return ((r >> 5) << 5) | ((g >> 5) << 2) | (b >> 6);
62 }
63
64+static inline unsigned int rgb_to_pixel8bgr(unsigned int r, unsigned int g,
65+ unsigned int b)
66+{
67+ return ((b >> 5) << 5) | ((g >> 5) << 2) | (r >> 6);
68+}
69+
70 static inline unsigned int rgb_to_pixel15(unsigned int r, unsigned int g,
71 unsigned int b)
72 {
73diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
74index d1cba28..c918afb 100644
75--- a/hw/vmware_vga.c
76+++ b/hw/vmware_vga.c
77@@ -484,6 +484,8 @@ static inline void vmsvga_cursor_define(struct vmsvga_state_s *s,
54 78
55 #define CMD(f) le32_to_cpu(s->cmd->f) 79 #define CMD(f) le32_to_cpu(s->cmd->f)
56 80
@@ -59,7 +83,7 @@ Index: git/hw/vmware_vga.c
59 static inline int vmsvga_fifo_empty(struct vmsvga_state_s *s) 83 static inline int vmsvga_fifo_empty(struct vmsvga_state_s *s)
60 { 84 {
61 if (!s->config || !s->enable) 85 if (!s->config || !s->enable)
62@@ -493,11 +495,18 @@ 86@@ -493,11 +495,18 @@ static inline int vmsvga_fifo_empty(struct vmsvga_state_s *s)
63 87
64 static inline uint32_t vmsvga_fifo_read_raw(struct vmsvga_state_s *s) 88 static inline uint32_t vmsvga_fifo_read_raw(struct vmsvga_state_s *s)
65 { 89 {
@@ -82,7 +106,7 @@ Index: git/hw/vmware_vga.c
82 } 106 }
83 107
84 static inline uint32_t vmsvga_fifo_read(struct vmsvga_state_s *s) 108 static inline uint32_t vmsvga_fifo_read(struct vmsvga_state_s *s)
85@@ -507,12 +516,12 @@ 109@@ -507,12 +516,12 @@ static inline uint32_t vmsvga_fifo_read(struct vmsvga_state_s *s)
86 110
87 static void vmsvga_fifo_run(struct vmsvga_state_s *s) 111 static void vmsvga_fifo_run(struct vmsvga_state_s *s)
88 { 112 {
@@ -97,7 +121,7 @@ Index: git/hw/vmware_vga.c
97 case SVGA_CMD_UPDATE: 121 case SVGA_CMD_UPDATE:
98 case SVGA_CMD_UPDATE_VERBOSE: 122 case SVGA_CMD_UPDATE_VERBOSE:
99 x = vmsvga_fifo_read(s); 123 x = vmsvga_fifo_read(s);
100@@ -612,7 +621,7 @@ 124@@ -612,7 +621,7 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s)
101 while (args --) 125 while (args --)
102 vmsvga_fifo_read(s); 126 vmsvga_fifo_read(s);
103 printf("%s: Unknown command 0x%02x in SVGA command FIFO\n", 127 printf("%s: Unknown command 0x%02x in SVGA command FIFO\n",
@@ -106,11 +130,35 @@ Index: git/hw/vmware_vga.c
106 break; 130 break;
107 } 131 }
108 132
109Index: git/kqemu.c 133@@ -914,8 +923,9 @@ static void vmsvga_reset(struct vmsvga_state_s *s)
110=================================================================== 134 s->width = -1;
111--- git.orig/kqemu.c 2009-05-23 11:22:16.000000000 +0100 135 s->height = -1;
112+++ git/kqemu.c 2009-05-23 11:22:17.000000000 +0100 136 s->svgaid = SVGA_ID;
113@@ -93,6 +93,8 @@ 137- s->depth = 24;
138+ s->depth = 32;
139 s->bypp = (s->depth + 7) >> 3;
140+ s->bypp = 4; /* XXX: until we can get host's actual depth */
141 s->cursor.on = 0;
142 s->redraw_fifo_first = 0;
143 s->redraw_fifo_last = 0;
144@@ -1140,6 +1150,12 @@ static void vmsvga_init(struct vmsvga_state_s *s,
145 /* XXX: use optimized standard vga accesses */
146 cpu_register_physical_memory(VBE_DISPI_LFB_PHYSICAL_ADDRESS,
147 vga_ram_size, vga_ram_offset);
148+
149+#ifdef EMBED_STDVGA
150+ s->map_addr = VBE_DISPI_LFB_PHYSICAL_ADDRESS;
151+ s->map_end = VBE_DISPI_LFB_PHYSICAL_ADDRESS + vga_ram_size;
152+ vga_dirty_log_start((VGAState *) s);
153+#endif
154 #endif
155 }
156
157diff --git a/kqemu.c b/kqemu.c
158index 25f4ea7..09c761a 100644
159--- a/kqemu.c
160+++ b/kqemu.c
161@@ -93,6 +93,8 @@ uint8_t *modified_ram_pages_table;
114 int qpi_io_memory; 162 int qpi_io_memory;
115 uint32_t kqemu_comm_base; /* physical address of the QPI communication page */ 163 uint32_t kqemu_comm_base; /* physical address of the QPI communication page */
116 164
@@ -119,7 +167,7 @@ Index: git/kqemu.c
119 #define cpuid(index, eax, ebx, ecx, edx) \ 167 #define cpuid(index, eax, ebx, ecx, edx) \
120 asm volatile ("cpuid" \ 168 asm volatile ("cpuid" \
121 : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) \ 169 : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) \
122@@ -860,6 +862,22 @@ 170@@ -860,6 +862,22 @@ int kqemu_cpu_exec(CPUState *env)
123 else 171 else
124 env->hflags &= ~HF_OSFXSR_MASK; 172 env->hflags &= ~HF_OSFXSR_MASK;
125 173
@@ -134,7 +182,7 @@ Index: git/kqemu.c
134+ 182+
135+ if (env->tlb_table[1][index].addend) { 183+ if (env->tlb_table[1][index].addend) {
136+ unsigned char *ptr = env->eip + env->tlb_table[1][index].addend; 184+ unsigned char *ptr = env->eip + env->tlb_table[1][index].addend;
137+ if (ptr[0] == 0xCD && ptr[1] == 0x99) 185+ if (ptr[0] == 0xcd && ptr[1] == 0x99)
138+ helper_opengl(); 186+ helper_opengl();
139+ } 187+ }
140+ } 188+ }
@@ -142,10 +190,271 @@ Index: git/kqemu.c
142 LOG_INT("kqemu: kqemu_cpu_exec: ret=0x%x\n", ret); 190 LOG_INT("kqemu: kqemu_cpu_exec: ret=0x%x\n", ret);
143 if (ret == KQEMU_RET_SYSCALL) { 191 if (ret == KQEMU_RET_SYSCALL) {
144 /* syscall instruction */ 192 /* syscall instruction */
145Index: git/target-i386/beginend_funcs.sh 193diff --git a/qemu-char.c b/qemu-char.c
146=================================================================== 194index 64d41d0..424ea9b 100644
147--- /dev/null 1970-01-01 00:00:00.000000000 +0000 195--- a/qemu-char.c
148+++ git/target-i386/beginend_funcs.sh 2009-05-23 11:22:17.000000000 +0100 196+++ b/qemu-char.c
197@@ -2112,6 +2112,69 @@ static CharDriverState *qemu_chr_open_tcp(const char *host_str,
198 return NULL;
199 }
200
201+#define TARGET_OPENGL_OK
202+#if defined(TARGET_OPENGL_OK)
203+static uint8_t buffer[32];
204+static int buffer_len;
205+static int hexdigit[128] = {
206+ ['0'] = 0x0,
207+ ['1'] = 0x1,
208+ ['2'] = 0x2,
209+ ['3'] = 0x3,
210+ ['4'] = 0x4,
211+ ['5'] = 0x5,
212+ ['6'] = 0x6,
213+ ['7'] = 0x7,
214+ ['8'] = 0x8,
215+ ['9'] = 0x9,
216+ ['a'] = 0xa,
217+ ['b'] = 0xb,
218+ ['c'] = 0xc,
219+ ['d'] = 0xd,
220+ ['e'] = 0xe,
221+ ['f'] = 0xf,
222+};
223+
224+static int opengl_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
225+{
226+ uint64_t ptr = 0;
227+ int i;
228+
229+ if (memchr(buf, 'x', len))
230+ opengl_process_enable();
231+ return len;
232+ memcpy(buffer + buffer_len, buf, len);
233+ buffer_len += len;
234+
235+ if (buffer_len >= 16) {
236+ for (i = 0; i < 16; i ++)
237+ ptr = (ptr << 4) + hexdigit[buffer[i]];
238+
239+ buffer_len -= 16;
240+ if (buffer_len)
241+ memcpy(buffer, buffer + 16, buffer_len);
242+
243+ mem_opengl(ptr);
244+ }
245+
246+ return len;
247+}
248+
249+CharDriverState *qemu_chr_open_opengl(void)
250+{
251+ CharDriverState *chr = qemu_mallocz(sizeof(CharDriverState));
252+
253+ chr->opaque = chr;
254+ chr->chr_write = opengl_chr_write;
255+
256+ qemu_chr_reset(chr);
257+
258+ return chr;
259+}
260+#else
261+#define qemu_chr_open_opengl() 0
262+#endif
263+
264 CharDriverState *qemu_chr_open(const char *label, const char *filename, void (*init)(struct CharDriverState *s))
265 {
266 const char *p;
267@@ -2192,6 +2255,9 @@ CharDriverState *qemu_chr_open(const char *label, const char *filename, void (*i
268 chr = chr_baum_init();
269 } else
270 #endif
271+ if (!strcmp(filename, "opengl")) {
272+ chr = qemu_chr_open_opengl();
273+ } else
274 {
275 chr = NULL;
276 }
277diff --git a/sdl.c b/sdl.c
278index 74f084c..b78f754 100644
279--- a/sdl.c
280+++ b/sdl.c
281@@ -54,6 +54,8 @@ static int guest_cursor = 0;
282 static int guest_x, guest_y;
283 static SDL_Cursor *guest_sprite = 0;
284
285+extern void opengl_exec_set_parent_window(Display* _dpy, Window _parent_window);
286+
287 static void sdl_update(DisplayState *ds, int x, int y, int w, int h)
288 {
289 SDL_Rect rec;
290@@ -85,7 +87,9 @@ static void sdl_setdata(DisplayState *ds)
291
292 static void sdl_resize(DisplayState *ds)
293 {
294+ SDL_SysWMinfo info;
295 int flags;
296+ static Display *dpy;
297
298 // printf("resizing to %d %d\n", w, h);
299
300@@ -104,6 +108,13 @@ static void sdl_resize(DisplayState *ds)
301 }
302
303 sdl_setdata(ds);
304+
305+ SDL_GetWMInfo(&info);
306+ if (info.subsystem == SDL_SYSWM_X11 && info.info.x11.display &&
307+ (!dpy || dpy == info.info.x11.display)) {
308+ dpy = info.info.x11.display;
309+ opengl_exec_set_parent_window(dpy, info.info.x11.window);
310+ }
311 }
312
313 /* generic keyboard conversion */
314@@ -320,7 +331,7 @@ static void sdl_show_cursor(void)
315
316 if (!kbd_mouse_is_absolute()) {
317 SDL_ShowCursor(1);
318- if (guest_cursor &&
319+ if (guest_cursor && !force_pointer &&
320 (gui_grab || kbd_mouse_is_absolute() || absolute_enabled))
321 SDL_SetCursor(guest_sprite);
322 else
323@@ -331,7 +342,8 @@ static void sdl_show_cursor(void)
324 static void sdl_grab_start(void)
325 {
326 if (guest_cursor) {
327- SDL_SetCursor(guest_sprite);
328+ if (!force_pointer)
329+ SDL_SetCursor(guest_sprite);
330 if (!kbd_mouse_is_absolute() && !absolute_enabled)
331 SDL_WarpMouse(guest_x, guest_y);
332 } else
333@@ -372,8 +384,8 @@ static void sdl_send_mouse_event(int dx, int dy, int dz, int x, int y, int state
334 absolute_enabled = 1;
335 }
336
337- dx = x * 0x7FFF / (width - 1);
338- dy = y * 0x7FFF / (height - 1);
339+ dx = x * 0x7FFF / (width - 1);
340+ dy = y * 0x7FFF / (height - 1);
341 } else if (absolute_enabled) {
342 sdl_show_cursor();
343 absolute_enabled = 0;
344@@ -603,7 +615,8 @@ static void sdl_mouse_warp(int x, int y, int on)
345 if (!guest_cursor)
346 sdl_show_cursor();
347 if (gui_grab || kbd_mouse_is_absolute() || absolute_enabled) {
348- SDL_SetCursor(guest_sprite);
349+ if (!force_pointer)
350+ SDL_SetCursor(guest_sprite);
351 if (!kbd_mouse_is_absolute() && !absolute_enabled)
352 SDL_WarpMouse(x, y);
353 }
354@@ -628,6 +641,10 @@ static void sdl_mouse_define(int width, int height, int bpp,
355 line = image;
356 for (x = 0; x < width; x ++, dst ++) {
357 switch (bpp) {
358+ case 32:
359+ src = *(line ++); src |= *(line ++);
360+ src = *(line ++); src |= *(line ++);
361+ break;
362 case 24:
363 src = *(line ++); src |= *(line ++); src |= *(line ++);
364 break;
365@@ -654,7 +671,7 @@ static void sdl_mouse_define(int width, int height, int bpp,
366 }
367 guest_sprite = SDL_CreateCursor(sprite, mask, width, height, hot_x, hot_y);
368
369- if (guest_cursor &&
370+ if (guest_cursor && !force_pointer &&
371 (gui_grab || kbd_mouse_is_absolute() || absolute_enabled))
372 SDL_SetCursor(guest_sprite);
373 }
374@@ -670,6 +687,7 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
375 {
376 int flags;
377 uint8_t data = 0;
378+ SDL_SysWMinfo info;
379
380 #if defined(__APPLE__)
381 /* always use generic keymaps */
382@@ -691,6 +709,12 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
383 exit(1);
384 }
385
386+ SDL_GetWMInfo(&info);
387+ if (info.subsystem == SDL_SYSWM_X11 && info.info.x11.display)
388+ opengl_exec_set_parent_window(info.info.x11.display,
389+ RootWindow(info.info.x11.display,
390+ DefaultScreen(info.info.x11.display)));
391+
392 dcl = qemu_mallocz(sizeof(DisplayChangeListener));
393 dcl->dpy_update = sdl_update;
394 dcl->dpy_resize = sdl_resize;
395@@ -714,4 +738,9 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
396 gui_fullscreen_initial_grab = 1;
397 sdl_grab_start();
398 }
399+
400+ SDL_GetWMInfo(&info);
401+ if (info.subsystem == SDL_SYSWM_X11 && info.info.x11.display)
402+ opengl_exec_set_parent_window(info.info.x11.display,
403+ info.info.x11.window);
404 }
405diff --git a/slirp/ctl.h b/slirp/ctl.h
406index 4a8576d..201ae4b 100644
407--- a/slirp/ctl.h
408+++ b/slirp/ctl.h
409@@ -2,6 +2,7 @@
410 #define CTL_EXEC 1
411 #define CTL_ALIAS 2
412 #define CTL_DNS 3
413+#define CTL_OPENGL 6
414
415 #define CTL_SPECIAL "10.0.2.0"
416 #define CTL_LOCAL "10.0.2.15"
417diff --git a/slirp/udp.c b/slirp/udp.c
418index 8d3bdd2..e5f40cc 100644
419--- a/slirp/udp.c
420+++ b/slirp/udp.c
421@@ -40,6 +40,7 @@
422
423 #include <slirp.h>
424 #include "ip_icmp.h"
425+#include "bswap.h"
426
427 #ifdef LOG_ENABLED
428 struct udpstat udpstat;
429@@ -153,6 +154,11 @@ udp_input(m, iphlen)
430 goto bad;
431 }
432
433+ if (ntohs(uh->uh_dport) == 9999 && m->m_len - iphlen == 16) {
434+ mem_opengl(le64_to_cpup((uint64_t *) (m->m_data + iphlen + 8)));
435+ goto bad;
436+ }
437+
438 if (slirp_restrict)
439 goto bad;
440
441diff --git a/sysemu.h b/sysemu.h
442index 57217c1..f0a48cd 100644
443--- a/sysemu.h
444+++ b/sysemu.h
445@@ -96,6 +96,7 @@ extern int graphic_rotate;
446 extern int no_quit;
447 extern int semihosting_enabled;
448 extern int old_param;
449+extern int force_pointer;
450 extern const char *bootp_filename;
451
452 #ifdef USE_KQEMU
453diff --git a/target-i386/beginend_funcs.sh b/target-i386/beginend_funcs.sh
454new file mode 100755
455index 0000000..bdd7684
456--- /dev/null
457+++ b/target-i386/beginend_funcs.sh
149@@ -0,0 +1,23 @@ 458@@ -0,0 +1,23 @@
150+#! /bin/sh 459+#! /bin/sh
151+# Copyright 2008 (C) Intel Corporation 460+# Copyright 2008 (C) Intel Corporation
@@ -170,10 +479,11 @@ Index: git/target-i386/beginend_funcs.sh
170+echo -e MAGIC_MACRO\(glCallList\)\\n 479+echo -e MAGIC_MACRO\(glCallList\)\\n
171+echo -e MAGIC_MACRO\(glCallLists\)\\n 480+echo -e MAGIC_MACRO\(glCallLists\)\\n
172+echo -e MAGIC_MACRO\(glEdgeFlag{,v}\)\\n 481+echo -e MAGIC_MACRO\(glEdgeFlag{,v}\)\\n
173Index: git/target-i386/ghash.c 482diff --git a/target-i386/ghash.c b/target-i386/ghash.c
174=================================================================== 483new file mode 100644
175--- /dev/null 1970-01-01 00:00:00.000000000 +0000 484index 0000000..1f0c380
176+++ git/target-i386/ghash.c 2009-05-23 11:22:17.000000000 +0100 485--- /dev/null
486+++ b/target-i386/ghash.c
177@@ -0,0 +1,347 @@ 487@@ -0,0 +1,347 @@
178+/* This is a modified and simplified version of original ghash.c */ 488+/* This is a modified and simplified version of original ghash.c */
179+ 489+
@@ -522,10 +832,11 @@ Index: git/target-i386/ghash.c
522+ hash_node = next; 832+ hash_node = next;
523+ } 833+ }
524+} 834+}
525Index: git/target-i386/ghash.h 835diff --git a/target-i386/ghash.h b/target-i386/ghash.h
526=================================================================== 836new file mode 100644
527--- /dev/null 1970-01-01 00:00:00.000000000 +0000 837index 0000000..7f34436
528+++ git/target-i386/ghash.h 2009-05-23 11:22:17.000000000 +0100 838--- /dev/null
839+++ b/target-i386/ghash.h
529@@ -0,0 +1,59 @@ 840@@ -0,0 +1,59 @@
530+/* This is a modified and simplified version of original ghash.h */ 841+/* This is a modified and simplified version of original ghash.h */
531+ 842+
@@ -586,10 +897,11 @@ Index: git/target-i386/ghash.h
586+ 897+
587+#endif /* __SIMPLE_HASH_H__ */ 898+#endif /* __SIMPLE_HASH_H__ */
588+ 899+
589Index: git/target-i386/gl_func_perso.h 900diff --git a/target-i386/gl_func_perso.h b/target-i386/gl_func_perso.h
590=================================================================== 901new file mode 100644
591--- /dev/null 1970-01-01 00:00:00.000000000 +0000 902index 0000000..401c0a8
592+++ git/target-i386/gl_func_perso.h 2009-05-23 11:22:17.000000000 +0100 903--- /dev/null
904+++ b/target-i386/gl_func_perso.h
593@@ -0,0 +1,135 @@ 905@@ -0,0 +1,135 @@
594+/* 906+/*
595+ * Hand-implemented GL/GLX API 907+ * Hand-implemented GL/GLX API
@@ -726,22 +1038,36 @@ Index: git/target-i386/gl_func_perso.h
726+MAGIC_MACRO(_glGetSelectBuffer_fake), 1038+MAGIC_MACRO(_glGetSelectBuffer_fake),
727+MAGIC_MACRO(_glFeedbackBuffer_fake), 1039+MAGIC_MACRO(_glFeedbackBuffer_fake),
728+MAGIC_MACRO(_glGetFeedbackBuffer_fake), 1040+MAGIC_MACRO(_glGetFeedbackBuffer_fake),
729Index: git/target-i386/helper.h 1041diff --git a/target-i386/helper.c b/target-i386/helper.c
730=================================================================== 1042index e714994..7354220 100644
731--- git.orig/target-i386/helper.h 2009-05-23 11:22:16.000000000 +0100 1043--- a/target-i386/helper.c
732+++ git/target-i386/helper.h 2009-05-23 11:22:17.000000000 +0100 1044+++ b/target-i386/helper.c
733@@ -214,4 +214,6 @@ 1045@@ -1320,7 +1320,7 @@ target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
1046 }
1047
1048 page_offset = (addr & TARGET_PAGE_MASK) & (page_size - 1);
1049- paddr = (pte & TARGET_PAGE_MASK) + page_offset;
1050+ paddr = (pte & PHYS_ADDR_MASK) + page_offset;
1051 return paddr;
1052 }
1053
1054diff --git a/target-i386/helper.h b/target-i386/helper.h
1055index 0c36783..b247b35 100644
1056--- a/target-i386/helper.h
1057+++ b/target-i386/helper.h
1058@@ -214,4 +214,6 @@ DEF_HELPER_2(rclq, tl, tl, tl)
734 DEF_HELPER_2(rcrq, tl, tl, tl) 1059 DEF_HELPER_2(rcrq, tl, tl, tl)
735 #endif 1060 #endif
736 1061
737+DEF_HELPER_0(opengl, void) 1062+DEF_HELPER_0(opengl, void)
738+ 1063+
739 #include "def-helper.h" 1064 #include "def-helper.h"
740Index: git/target-i386/helper_opengl.c 1065diff --git a/target-i386/helper_opengl.c b/target-i386/helper_opengl.c
741=================================================================== 1066new file mode 100644
742--- /dev/null 1970-01-01 00:00:00.000000000 +0000 1067index 0000000..f83d02b
743+++ git/target-i386/helper_opengl.c 2009-05-23 11:22:17.000000000 +0100 1068--- /dev/null
744@@ -0,0 +1,979 @@ 1069+++ b/target-i386/helper_opengl.c
1070@@ -0,0 +1,1205 @@
745+/* 1071+/*
746+ * Host-side implementation of GL/GLX API 1072+ * Host-side implementation of GL/GLX API
747+ * 1073+ *
@@ -796,13 +1122,16 @@ Index: git/target-i386/helper_opengl.c
796+static int last_process_id = 0; 1122+static int last_process_id = 0;
797+static int must_save = 0; 1123+static int must_save = 0;
798+ 1124+
1125+static int allow_kernel = 0;
1126+
799+static inline void *get_phys_mem_addr(const CPUState *env, target_ulong addr) 1127+static inline void *get_phys_mem_addr(const CPUState *env, target_ulong addr)
800+{ 1128+{
801+ int is_user, index; 1129+ int is_user, index;
802+ 1130+
803+ index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1); 1131+ index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
804+ is_user = ((env->hflags & HF_CPL_MASK) == 3); 1132+ is_user = ((env->hflags & HF_CPL_MASK) == 3);
805+ if (is_user == 0) { 1133+ /* A sanity check for the int0x99 case */
1134+ if (unlikely(is_user == 0 && !allow_kernel)) {
806+ fprintf(stderr, "not in userland !!!\n"); 1135+ fprintf(stderr, "not in userland !!!\n");
807+ return NULL; 1136+ return NULL;
808+ } 1137+ }
@@ -830,7 +1159,7 @@ Index: git/target-i386/helper_opengl.c
830+ } else { 1159+ } else {
831+ fprintf(stderr, 1160+ fprintf(stderr,
832+ "cpu_get_phys_page_debug(env, " TARGET_FMT_lx ") == " 1161+ "cpu_get_phys_page_debug(env, " TARGET_FMT_lx ") == "
833+ TARGET_FMT_lx "p\n", addr, ret); 1162+ TARGET_FMT_lx "\n", addr, ret);
834+ fprintf(stderr, 1163+ fprintf(stderr,
835+ "ret=" TARGET_FMT_lx " phys_ram_size= " TARGET_FMT_lx 1164+ "ret=" TARGET_FMT_lx " phys_ram_size= " TARGET_FMT_lx
836+ "\n", ret, (target_ulong) phys_ram_size); 1165+ "\n", ret, (target_ulong) phys_ram_size);
@@ -1222,7 +1551,19 @@ Index: git/target-i386/helper_opengl.c
1222+ if (unlikely(func_number == _exit_process_func)) 1551+ if (unlikely(func_number == _exit_process_func))
1223+ last_process_id = 0; 1552+ last_process_id = 0;
1224+ 1553+
1225+ argcpy: 1554+ if (!wordsize) {
1555+ if (func_number == _init32_func || func_number == _init64_func) {
1556+ if (func_number == _init32_func) {
1557+ wordsize = 32;
1558+ argcpy_target_to_host = memcpy_target32_to_host;
1559+ } else {
1560+ wordsize = 64;
1561+ argcpy_target_to_host = memcpy_target64_to_host;
1562+ }
1563+ } else
1564+ fprintf(stderr, "commands submitted before initialisation done\n");
1565+ }
1566+
1226+ reset_host_offset(); 1567+ reset_host_offset();
1227+ 1568+
1228+ if (nb_args) { 1569+ if (nb_args) {
@@ -1606,24 +1947,12 @@ Index: git/target-i386/helper_opengl.c
1606+ 1947+
1607+ if (func_number == _init32_func || func_number == _init64_func) { 1948+ if (func_number == _init32_func || func_number == _init64_func) {
1608+ if (func_number == _init32_func) { 1949+ if (func_number == _init32_func) {
1609+ if (!wordsize) {
1610+ wordsize = 32;
1611+ argcpy_target_to_host = memcpy_target32_to_host;
1612+ goto argcpy;
1613+ }
1614+
1615+ if (wordsize != 32) { 1950+ if (wordsize != 32) {
1616+ fprintf(stderr, 1951+ fprintf(stderr,
1617+ "clients with different ABIs not supported\n"); 1952+ "clients with different ABIs not supported\n");
1618+ exit(-1); 1953+ exit(-1);
1619+ } 1954+ }
1620+ } else { 1955+ } else {
1621+ if (!wordsize) {
1622+ wordsize = 64;
1623+ argcpy_target_to_host = memcpy_target64_to_host;
1624+ goto argcpy;
1625+ }
1626+
1627+ if (wordsize != 64) { 1956+ if (wordsize != 64) {
1628+ fprintf(stderr, 1957+ fprintf(stderr,
1629+ "clients with different ABIs not supported\n"); 1958+ "clients with different ABIs not supported\n");
@@ -1720,11 +2049,248 @@ Index: git/target-i386/helper_opengl.c
1720+ env->regs[R_EDX], env->regs[R_ESI]); 2049+ env->regs[R_EDX], env->regs[R_ESI]);
1721+ doing_opengl = 0; 2050+ doing_opengl = 0;
1722+} 2051+}
2052+
2053+void mem_opengl(uint64_t ptr)
2054+{
2055+ uint64_t *params = get_phys_mem_addr(env, ptr);
2056+ int ret;
2057+
2058+ /* Execute */
2059+ doing_opengl = 1;
2060+ ret = decode_call(env, le64_to_cpu(params[0]),
2061+ le64_to_cpu(params[1]), le64_to_cpu(params[2]),
2062+ le64_to_cpu(params[3]), le64_to_cpu(params[4]));
2063+ doing_opengl = 0;
2064+
2065+ params[0] = cpu_to_le64(ret);
2066+ params[5] = 0;
2067+}
2068+
2069+#define THREADINFO_TASK_OFFSET 0x0 //// 0x0
2070+#define THREADSTRUCT_IOPL_OFFSET 0x78 //// 0x80
2071+#define TASKSTRUCT_NEXT_OFFSET 0x1a0 //// 0x1e8
2072+#define TASKSTRUCT_PREV_OFFSET 0x1a4 //// 0x1ec
2073+#define TASKSTRUCT_RCRED_OFFSET 0x29c //// 0x2b4
2074+#define TASKSTRUCT_CRED_OFFSET 0x2a0 //// 0x2b8
2075+#define TASKSTRUCT_COMM_OFFSET 0x2c0 //// 0x2fc
2076+#define TASKSTRUCT_THREAD_OFFSET 0x2e4 //// 0x318
2077+#define TASKSTRUCT_IO_CTX_OFFSET 0x40c //// 0x428
2078+#define CRED_CAPINH_OFFSET 0x28
2079+#define CRED_CAPPER_OFFSET 0x30
2080+#define CRED_CAPEFF_OFFSET 0x38
2081+#define CRED_CAPBST_OFFSET 0x40
2082+/* How to obtain the numbers:
2083+ * $ gbd vmlinux
2084+ * ...
2085+ * (gdb) print &((struct task_struct *) 0)->real_cred
2086+ * $22 = (const struct cred **) 0x29c
2087+ * (gdb) print &((struct task_struct *) 0)->cred
2088+ * $23 = (const struct cred **) 0x2a0
2089+ * (gbd) ...
2090+ * ...
2091+ * (gdb) ^D
2092+ * $ vim target-i386/helper_opengl.c
2093+ * ...
2094+ * :wq
2095+ * $ make
2096+ * ...
2097+ *
2098+ * Testing:
2099+ * $ x86_64-softmmu/qemu-system-x86_64 -s -hda ...
2100+ * ^Z
2101+ * [1]+ Stopped x86_64-softmmu/qemu-system-x86_64 -s -hda ...
2102+ * $ bg
2103+ * [1]+ x86_64-softmmu/qemu-system-x86_64 -s -hda ...
2104+ * $ gdb
2105+ * ...
2106+ * (gdb) target remote localhost:1234
2107+ * ...
2108+ * (gdb) print ((char *) *(unsigned int *) ((unsigned int) $rsp & ~8191)) +
2109+ * 0x2c0
2110+ * $9 = 0xc094062c "swapper"
2111+ * (gdb) print (char *) (*(unsigned int *) (((char *) *(unsigned int *)
2112+ * ((unsigned int) $rsp & ~8191)) + 0x1a0) - 0x1a0) + 0x2c0
2113+ * $10 = 0xdf87cee0 "init"
2114+ * ...
2115+ */
2116+
2117+#define CAP_SYS_RAWIO 17
2118+
2119+#define THREAD_SIZE (TARGET_PAGE_SIZE << 1)
2120+static ram_addr_t x86_current_thread(void)
2121+{
2122+ return env->regs[R_ESP] & ~(THREAD_SIZE - 1);
2123+}
2124+
2125+static ram_addr_t x86_current_task(void)
2126+{
2127+ return *(uint32_t *) get_phys_mem_addr(env,
2128+ x86_current_thread() + THREADINFO_TASK_OFFSET);
2129+}
2130+
2131+static ram_addr_t x86_current_io_ctx(void)
2132+{
2133+ return *(uint32_t *) get_phys_mem_addr(env,
2134+ x86_current_task() + TASKSTRUCT_IO_CTX_OFFSET);
2135+}
2136+
2137+static ram_addr_t x86_task_name(ram_addr_t proc)
2138+{
2139+ return x86_current_task() + TASKSTRUCT_COMM_OFFSET;
2140+}
2141+
2142+static ram_addr_t x86_task_next(ram_addr_t proc)
2143+{
2144+ return *(uint32_t *) get_phys_mem_addr(env,
2145+ x86_current_task() + TASKSTRUCT_NEXT_OFFSET) -
2146+ TASKSTRUCT_NEXT_OFFSET;
2147+}
2148+
2149+static void x86_cap_set(ram_addr_t caps, int cap)
2150+{
2151+ int offset = cap >> 5;
2152+ int mask = 1 << (cap & 31);
2153+
2154+ *(uint32_t *) get_phys_mem_addr(env, caps + offset) |= mask;
2155+}
2156+
2157+static void x86_cred_cap_set(ram_addr_t creds, int cap)
2158+{
2159+ x86_cap_set(creds + CRED_CAPINH_OFFSET, cap);
2160+ x86_cap_set(creds + CRED_CAPPER_OFFSET, cap);
2161+ x86_cap_set(creds + CRED_CAPEFF_OFFSET, cap);
2162+ x86_cap_set(creds + CRED_CAPBST_OFFSET, cap);
2163+}
2164+
2165+static void x86_task_cap_set(ram_addr_t proc, int cap)
2166+{
2167+ x86_cred_cap_set(*(uint32_t *) get_phys_mem_addr(env,
2168+ proc + TASKSTRUCT_RCRED_OFFSET), cap);
2169+ x86_cred_cap_set(*(uint32_t *) get_phys_mem_addr(env,
2170+ proc + TASKSTRUCT_CRED_OFFSET), cap);
2171+}
2172+
2173+#include "kvm.h"
2174+
2175+/* The putting and getting of the register set seems to incure a too
2176+ * high overhead. It's at least 4 ioctl's each. */
2177+#if 0
2178+static void opengl_ioport_write(void *data, uint32_t addr, uint32_t val)
2179+{
2180+ /* Ignore the first outb after iopl which is emulated by the kernel. */
2181+ if (val == (uint8_t) -1)
2182+ return;
2183+
2184+ if (kvm_enabled())
2185+ kvm_arch_get_registers(env);
2186+ doing_opengl = 1;
2187+ env->regs[R_EAX] =
2188+ decode_call(env, env->regs[R_EAX], env->regs[R_EBX], env->regs[R_ECX],
2189+ env->regs[R_ESI], env->regs[R_EDI]);
2190+ doing_opengl = 0;
2191+ if (kvm_enabled())
2192+ kvm_arch_put_registers(env);
2193+}
2194+#else
2195+static void get_regs(void)
2196+{
2197+ /* We only really need the eflags and cr[0..4] */
2198+ if (kvm_enabled())
2199+ kvm_get_sregs(env);
2200+}
2201+
2202+static void opengl_ioport_write(void *data, uint32_t addr, uint32_t val)
2203+{
2204+ uint64_t *params;
2205+ int ret;
2206+
2207+ /* Only need to fetch the registers after a guest's context switch...
2208+ * the problem is, to find out about context switches we already need
2209+ * to fetch rsp
2210+ * TODO: pass the pid in val. the params pointer doesn't need to be
2211+ * passed on all calls because it can be a global and be constant.
2212+ */
2213+ get_regs();
2214+
2215+ params = get_phys_mem_addr(env, (target_ulong) val);
2216+
2217+ /* Execute */
2218+ doing_opengl = 1;
2219+ ret = decode_call(env, le64_to_cpu(params[0]),
2220+ le64_to_cpu(params[1]), le64_to_cpu(params[2]),
2221+ le64_to_cpu(params[3]), le64_to_cpu(params[4]));
2222+ doing_opengl = 0;
2223+
2224+ params[0] = cpu_to_le64(ret);
2225+ params[5] = 0;
2226+}
1723+#endif 2227+#endif
1724Index: git/target-i386/mesa_enums.c 2228+
1725=================================================================== 2229+static void opengl_ioport_write_first(void *data, uint32_t addr, uint32_t val)
1726--- /dev/null 1970-01-01 00:00:00.000000000 +0000 2230+{
1727+++ git/target-i386/mesa_enums.c 2009-05-23 11:22:17.000000000 +0100 2231+ if (val != (uint32_t) -1)
2232+ return;
2233+
2234+ /* Ignore the first outb after iopl which is emulated by the kernel. */
2235+
2236+ register_ioport_write(9996, 4, 4, opengl_ioport_write, (void *) 1);
2237+}
2238+
2239+void io_register(void)
2240+{
2241+ register_ioport_write(9996, 4, 4, opengl_ioport_write_first, (void *) 1);
2242+}
2243+
2244+void opengl_process_enable(void)
2245+{
2246+ ram_addr_t task;
2247+ char *name;
2248+ int newlevel = 3;
2249+ uint32_t iopl = newlevel << 12;
2250+ void *ioplptr;
2251+
2252+ if (kvm_enabled())
2253+ kvm_arch_get_registers(env);
2254+ allow_kernel = 1;
2255+
2256+ task = x86_current_task();
2257+ x86_task_cap_set(task, CAP_SYS_RAWIO);
2258+ name = get_phys_mem_addr(env, x86_task_name(task));
2259+
2260+ ioplptr = get_phys_mem_addr(env, task +
2261+ TASKSTRUCT_THREAD_OFFSET + THREADSTRUCT_IOPL_OFFSET);
2262+ ((uint32_t *) ioplptr)[0] = cpu_to_le32(iopl);
2263+
2264+ env->eflags &= ~0x3000;
2265+ env->eflags |= newlevel << 12;
2266+
2267+ allow_kernel = 0;
2268+ if (kvm_enabled())
2269+ kvm_arch_put_registers(env);
2270+
2271+ printf("Granted OpenGL access to process '%s'\n", name);
2272+
2273+ io_register();
2274+}
2275+#endif
2276diff --git a/target-i386/kvm.c b/target-i386/kvm.c
2277index eb61598..5c6fbae 100644
2278--- a/target-i386/kvm.c
2279+++ b/target-i386/kvm.c
2280@@ -480,7 +480,7 @@ static int kvm_get_fpu(CPUState *env)
2281 return 0;
2282 }
2283
2284-static int kvm_get_sregs(CPUState *env)
2285+int kvm_get_sregs(CPUState *env)
2286 {
2287 struct kvm_sregs sregs;
2288 uint32_t hflags;
2289diff --git a/target-i386/mesa_enums.c b/target-i386/mesa_enums.c
2290new file mode 100644
2291index 0000000..61a540c
2292--- /dev/null
2293+++ b/target-i386/mesa_enums.c
1728@@ -0,0 +1,4890 @@ 2294@@ -0,0 +1,4890 @@
1729+/* DO NOT EDIT - This file generated automatically by gl_enums.py (from Mesa) script */ 2295+/* DO NOT EDIT - This file generated automatically by gl_enums.py (from Mesa) script */
1730+ 2296+
@@ -6616,10 +7182,11 @@ Index: git/target-i386/mesa_enums.c
6616+} 7182+}
6617+ 7183+
6618+ 7184+
6619Index: git/target-i386/mesa_get.c 7185diff --git a/target-i386/mesa_get.c b/target-i386/mesa_get.c
6620=================================================================== 7186new file mode 100644
6621--- /dev/null 1970-01-01 00:00:00.000000000 +0000 7187index 0000000..3b4c9aa
6622+++ git/target-i386/mesa_get.c 2009-05-23 11:22:17.000000000 +0100 7188--- /dev/null
7189+++ b/target-i386/mesa_get.c
6623@@ -0,0 +1,5563 @@ 7190@@ -0,0 +1,5563 @@
6624+ 7191+
6625+/*** 7192+/***
@@ -12184,10 +12751,11 @@ Index: git/target-i386/mesa_get.c
12184+ params[i] = (GLdouble) values[i]; 12751+ params[i] = (GLdouble) values[i];
12185+} 12752+}
12186+ 12753+
12187Index: git/target-i386/mesa_gl.h 12754diff --git a/target-i386/mesa_gl.h b/target-i386/mesa_gl.h
12188=================================================================== 12755new file mode 100644
12189--- /dev/null 1970-01-01 00:00:00.000000000 +0000 12756index 0000000..dc2047c
12190+++ git/target-i386/mesa_gl.h 2009-05-23 11:22:17.000000000 +0100 12757--- /dev/null
12758+++ b/target-i386/mesa_gl.h
12191@@ -0,0 +1,2251 @@ 12759@@ -0,0 +1,2251 @@
12192+/* 12760+/*
12193+ * Mesa 3-D graphics library 12761+ * Mesa 3-D graphics library
@@ -14440,10 +15008,11 @@ Index: git/target-i386/mesa_gl.h
14440+#endif 15008+#endif
14441+ 15009+
14442+#endif /* __gl_h_ */ 15010+#endif /* __gl_h_ */
14443Index: git/target-i386/mesa_glext.h 15011diff --git a/target-i386/mesa_glext.h b/target-i386/mesa_glext.h
14444=================================================================== 15012new file mode 100644
14445--- /dev/null 1970-01-01 00:00:00.000000000 +0000 15013index 0000000..f8cf2d2
14446+++ git/target-i386/mesa_glext.h 2009-05-23 11:22:17.000000000 +0100 15014--- /dev/null
15015+++ b/target-i386/mesa_glext.h
14447@@ -0,0 +1,7279 @@ 15016@@ -0,0 +1,7279 @@
14448+#ifndef __glext_h_ 15017+#ifndef __glext_h_
14449+#define __glext_h_ 15018+#define __glext_h_
@@ -21724,10 +22293,11 @@ Index: git/target-i386/mesa_glext.h
21724+ 22293+
21725+/* ERO */ 22294+/* ERO */
21726+GLAPI void GLAPIENTRY fake_gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *data); 22295+GLAPI void GLAPIENTRY fake_gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *data);
21727Index: git/target-i386/mesa_glu.h 22296diff --git a/target-i386/mesa_glu.h b/target-i386/mesa_glu.h
21728=================================================================== 22297new file mode 100644
21729--- /dev/null 1970-01-01 00:00:00.000000000 +0000 22298index 0000000..f1a704b
21730+++ git/target-i386/mesa_glu.h 2009-05-23 11:22:17.000000000 +0100 22299--- /dev/null
22300+++ b/target-i386/mesa_glu.h
21731@@ -0,0 +1,354 @@ 22301@@ -0,0 +1,354 @@
21732+/* 22302+/*
21733+** License Applicability. Except to the extent portions of this file are 22303+** License Applicability. Except to the extent portions of this file are
@@ -22083,10 +22653,11 @@ Index: git/target-i386/mesa_glu.h
22083+#endif 22653+#endif
22084+ 22654+
22085+#endif /* __glu_h__ */ 22655+#endif /* __glu_h__ */
22086Index: git/target-i386/mesa_glx.h 22656diff --git a/target-i386/mesa_glx.h b/target-i386/mesa_glx.h
22087=================================================================== 22657new file mode 100644
22088--- /dev/null 1970-01-01 00:00:00.000000000 +0000 22658index 0000000..2930461
22089+++ git/target-i386/mesa_glx.h 2009-05-23 11:22:17.000000000 +0100 22659--- /dev/null
22660+++ b/target-i386/mesa_glx.h
22090@@ -0,0 +1,510 @@ 22661@@ -0,0 +1,510 @@
22091+/* 22662+/*
22092+ * Mesa 3-D graphics library 22663+ * Mesa 3-D graphics library
@@ -22598,10 +23169,11 @@ Index: git/target-i386/mesa_glx.h
22598+#endif 23169+#endif
22599+ 23170+
22600+#endif 23171+#endif
22601Index: git/target-i386/mesa_glxext.h 23172diff --git a/target-i386/mesa_glxext.h b/target-i386/mesa_glxext.h
22602=================================================================== 23173new file mode 100644
22603--- /dev/null 1970-01-01 00:00:00.000000000 +0000 23174index 0000000..0f66df6
22604+++ git/target-i386/mesa_glxext.h 2009-05-23 11:22:17.000000000 +0100 23175--- /dev/null
23176+++ b/target-i386/mesa_glxext.h
22605@@ -0,0 +1,785 @@ 23177@@ -0,0 +1,785 @@
22606+#ifndef __glxext_h_ 23178+#ifndef __glxext_h_
22607+#define __glxext_h_ 23179+#define __glxext_h_
@@ -23388,10 +23960,11 @@ Index: git/target-i386/mesa_glxext.h
23388+#endif 23960+#endif
23389+ 23961+
23390+#endif 23962+#endif
23391Index: git/target-i386/mesa_mipmap.c 23963diff --git a/target-i386/mesa_mipmap.c b/target-i386/mesa_mipmap.c
23392=================================================================== 23964new file mode 100644
23393--- /dev/null 1970-01-01 00:00:00.000000000 +0000 23965index 0000000..f623ea1
23394+++ git/target-i386/mesa_mipmap.c 2009-05-23 11:22:17.000000000 +0100 23966--- /dev/null
23967+++ b/target-i386/mesa_mipmap.c
23395@@ -0,0 +1,824 @@ 23968@@ -0,0 +1,824 @@
23396+ 23969+
23397+/* 23970+/*
@@ -24217,10 +24790,11 @@ Index: git/target-i386/mesa_mipmap.c
24217+ 24790+
24218+ return retval; 24791+ return retval;
24219+} 24792+}
24220Index: git/target-i386/opengl_exec.c 24793diff --git a/target-i386/opengl_exec.c b/target-i386/opengl_exec.c
24221=================================================================== 24794new file mode 100644
24222--- /dev/null 1970-01-01 00:00:00.000000000 +0000 24795index 0000000..4a69b9b
24223+++ git/target-i386/opengl_exec.c 2009-05-23 11:22:17.000000000 +0100 24796--- /dev/null
24797+++ b/target-i386/opengl_exec.c
24224@@ -0,0 +1,3931 @@ 24798@@ -0,0 +1,3931 @@
24225+/* 24799+/*
24226+ * Host-side implementation of GL/GLX API 24800+ * Host-side implementation of GL/GLX API
@@ -28153,10 +28727,11 @@ Index: git/target-i386/opengl_exec.c
28153+ 28727+
28154+ return ret_int; 28728+ return ret_int;
28155+} 28729+}
28156Index: git/target-i386/opengl_func.h 28730diff --git a/target-i386/opengl_func.h b/target-i386/opengl_func.h
28157=================================================================== 28731new file mode 100644
28158--- /dev/null 1970-01-01 00:00:00.000000000 +0000 28732index 0000000..d1b50fd
28159+++ git/target-i386/opengl_func.h 2009-05-23 11:22:17.000000000 +0100 28733--- /dev/null
28734+++ b/target-i386/opengl_func.h
28160@@ -0,0 +1,1108 @@ 28735@@ -0,0 +1,1108 @@
28161+/* 28736+/*
28162+ * Main header for both host and guest sides 28737+ * Main header for both host and guest sides
@@ -29266,10 +29841,11 @@ Index: git/target-i386/opengl_func.h
29266+#error Unsupported ABI 29841+#error Unsupported ABI
29267+#endif 29842+#endif
29268+#endif 29843+#endif
29269Index: git/target-i386/opengl_player.c 29844diff --git a/target-i386/opengl_player.c b/target-i386/opengl_player.c
29270=================================================================== 29845new file mode 100644
29271--- /dev/null 1970-01-01 00:00:00.000000000 +0000 29846index 0000000..f071b7f
29272+++ git/target-i386/opengl_player.c 2009-05-23 11:22:17.000000000 +0100 29847--- /dev/null
29848+++ b/target-i386/opengl_player.c
29273@@ -0,0 +1,1461 @@ 29849@@ -0,0 +1,1461 @@
29274+/* 29850+/*
29275+ * Plays a sequence of OpenGL calls recorded either under qemu or with opengl_server 29851+ * Plays a sequence of OpenGL calls recorded either under qemu or with opengl_server
@@ -30732,10 +31308,11 @@ Index: git/target-i386/opengl_player.c
30732+ } 31308+ }
30733+ return 0; 31309+ return 0;
30734+} 31310+}
30735Index: git/target-i386/opengl_server.c 31311diff --git a/target-i386/opengl_server.c b/target-i386/opengl_server.c
30736=================================================================== 31312new file mode 100644
30737--- /dev/null 1970-01-01 00:00:00.000000000 +0000 31313index 0000000..80060ba
30738+++ git/target-i386/opengl_server.c 2009-05-23 11:22:17.000000000 +0100 31314--- /dev/null
31315+++ b/target-i386/opengl_server.c
30739@@ -0,0 +1,826 @@ 31316@@ -0,0 +1,826 @@
30740+/* 31317+/*
30741+ * TCP/IP OpenGL server 31318+ * TCP/IP OpenGL server
@@ -31563,10 +32140,11 @@ Index: git/target-i386/opengl_server.c
31563+ 32140+
31564+ return 0; 32141+ return 0;
31565+} 32142+}
31566Index: git/target-i386/opengl_utils.h 32143diff --git a/target-i386/opengl_utils.h b/target-i386/opengl_utils.h
31567=================================================================== 32144new file mode 100644
31568--- /dev/null 1970-01-01 00:00:00.000000000 +0000 32145index 0000000..01077ff
31569+++ git/target-i386/opengl_utils.h 2009-05-23 11:22:17.000000000 +0100 32146--- /dev/null
32147+++ b/target-i386/opengl_utils.h
31570@@ -0,0 +1,453 @@ 32148@@ -0,0 +1,453 @@
31571+/* 32149+/*
31572+ * Functions used by host & client sides 32150+ * Functions used by host & client sides
@@ -32021,10 +32599,11 @@ Index: git/target-i386/opengl_utils.h
32021+} 32599+}
32022+ 32600+
32023+#endif 32601+#endif
32024Index: git/target-i386/parse_gl_h.c 32602diff --git a/target-i386/parse_gl_h.c b/target-i386/parse_gl_h.c
32025=================================================================== 32603new file mode 100644
32026--- /dev/null 1970-01-01 00:00:00.000000000 +0000 32604index 0000000..f1e93ec
32027+++ git/target-i386/parse_gl_h.c 2009-05-23 11:22:17.000000000 +0100 32605--- /dev/null
32606+++ b/target-i386/parse_gl_h.c
32028@@ -0,0 +1,1496 @@ 32607@@ -0,0 +1,1496 @@
32029+/* 32608+/*
32030+ * Parse gl.h et glx.h to auto-generate source code 32609+ * Parse gl.h et glx.h to auto-generate source code
@@ -33522,10 +34101,11 @@ Index: git/target-i386/parse_gl_h.c
33522+ 34101+
33523+ return 0; 34102+ return 0;
33524+} 34103+}
33525Index: git/target-i386/parse_mesa_get_c.c 34104diff --git a/target-i386/parse_mesa_get_c.c b/target-i386/parse_mesa_get_c.c
33526=================================================================== 34105new file mode 100644
33527--- /dev/null 1970-01-01 00:00:00.000000000 +0000 34106index 0000000..b214358
33528+++ git/target-i386/parse_mesa_get_c.c 2009-05-23 11:22:17.000000000 +0100 34107--- /dev/null
34108+++ b/target-i386/parse_mesa_get_c.c
33529@@ -0,0 +1,225 @@ 34109@@ -0,0 +1,225 @@
33530+/* 34110+/*
33531+ * Parse the "get.c" from mesa source tree to generate "glgetv_cst.h" 34111+ * Parse the "get.c" from mesa source tree to generate "glgetv_cst.h"
@@ -33752,11 +34332,20 @@ Index: git/target-i386/parse_mesa_get_c.c
33752+ fclose(outf); 34332+ fclose(outf);
33753+ return 0; 34333+ return 0;
33754+} 34334+}
33755Index: git/target-i386/translate.c 34335diff --git a/target-i386/translate.c b/target-i386/translate.c
33756=================================================================== 34336index 4b894fd..10920a7 100644
33757--- git.orig/target-i386/translate.c 2009-05-23 11:22:16.000000000 +0100 34337--- a/target-i386/translate.c
33758+++ git/target-i386/translate.c 2009-05-23 11:22:17.000000000 +0100 34338+++ b/target-i386/translate.c
33759@@ -2592,11 +2592,18 @@ 34339@@ -741,6 +741,8 @@ static void gen_check_io(DisasContext *s, int ot, target_ulong cur_eip,
34340 int state_saved;
34341 target_ulong next_eip;
34342
34343+ return;
34344+
34345 state_saved = 0;
34346 if (s->pe && (s->cpl > s->iopl || s->vm86)) {
34347 if (s->cc_op != CC_OP_DYNAMIC)
34348@@ -2592,11 +2594,18 @@ static void gen_exception(DisasContext *s, int trapno, target_ulong cur_eip)
33760 s->is_jmp = 3; 34349 s->is_jmp = 3;
33761 } 34350 }
33762 34351
@@ -33775,11 +34364,19 @@ Index: git/target-i386/translate.c
33775 if (s->cc_op != CC_OP_DYNAMIC) 34364 if (s->cc_op != CC_OP_DYNAMIC)
33776 gen_op_set_cc_op(s->cc_op); 34365 gen_op_set_cc_op(s->cc_op);
33777 gen_jmp_im(cur_eip); 34366 gen_jmp_im(cur_eip);
33778Index: git/vl.c 34367diff --git a/vl.c b/vl.c
33779=================================================================== 34368index 56623fb..095da54 100644
33780--- git.orig/vl.c 2009-05-23 11:22:16.000000000 +0100 34369--- a/vl.c
33781+++ git/vl.c 2009-05-23 11:23:18.000000000 +0100 34370+++ b/vl.c
33782@@ -253,6 +253,7 @@ 34371@@ -245,6 +245,7 @@ int semihosting_enabled = 0;
34372 #ifdef TARGET_ARM
34373 int old_param = 0;
34374 #endif
34375+int force_pointer = 0;
34376 const char *qemu_name;
34377 int alt_grab = 0;
34378 #if defined(TARGET_SPARC) || defined(TARGET_PPC)
34379@@ -253,6 +254,7 @@ const char *prom_envs[MAX_PROM_ENVS];
33783 #endif 34380 #endif
33784 int nb_drives_opt; 34381 int nb_drives_opt;
33785 struct drive_opt drives_opt[MAX_DRIVES]; 34382 struct drive_opt drives_opt[MAX_DRIVES];
@@ -33787,23 +34384,68 @@ Index: git/vl.c
33787 34384
33788 static CPUState *cur_cpu; 34385 static CPUState *cur_cpu;
33789 static CPUState *next_cpu; 34386 static CPUState *next_cpu;
33790@@ -4214,6 +4215,7 @@ 34387@@ -4208,12 +4210,14 @@ enum {
34388 QEMU_OPTION_clock,
34389 QEMU_OPTION_localtime,
34390 QEMU_OPTION_startdate,
34391+ QEMU_OPTION_enable_gl,
34392 QEMU_OPTION_icount,
34393 QEMU_OPTION_echr,
34394 QEMU_OPTION_virtiocon,
33791 QEMU_OPTION_show_cursor, 34395 QEMU_OPTION_show_cursor,
33792 QEMU_OPTION_semihosting, 34396 QEMU_OPTION_semihosting,
33793 QEMU_OPTION_old_param, 34397 QEMU_OPTION_old_param,
33794+ QEMU_OPTION_enable_gl, 34398+ QEMU_OPTION_force_pointer,
33795 QEMU_OPTION_tb_size, 34399 QEMU_OPTION_tb_size,
33796 QEMU_OPTION_incoming, 34400 QEMU_OPTION_incoming,
33797 QEMU_OPTION_chroot, 34401 QEMU_OPTION_chroot,
33798@@ -4345,6 +4347,7 @@ 34402@@ -4344,6 +4348,8 @@ static const QEMUOption qemu_options[] = {
34403 #if defined(TARGET_ARM)
33799 { "old-param", 0, QEMU_OPTION_old_param }, 34404 { "old-param", 0, QEMU_OPTION_old_param },
33800 #endif 34405 #endif
33801 { "tb-size", HAS_ARG, QEMU_OPTION_tb_size }, 34406+ { "force-pointer", 0, QEMU_OPTION_force_pointer },
33802+ { "enable-gl", 0, QEMU_OPTION_enable_gl }, 34407+ { "enable-gl", 0, QEMU_OPTION_enable_gl },
34408 { "tb-size", HAS_ARG, QEMU_OPTION_tb_size },
33803 { "incoming", HAS_ARG, QEMU_OPTION_incoming }, 34409 { "incoming", HAS_ARG, QEMU_OPTION_incoming },
33804 { "chroot", HAS_ARG, QEMU_OPTION_chroot }, 34410 { "chroot", HAS_ARG, QEMU_OPTION_chroot },
33805 { "runas", HAS_ARG, QEMU_OPTION_runas }, 34411@@ -4496,22 +4502,17 @@ static void select_vgahw (const char *p)
33806@@ -5261,6 +5264,11 @@ 34412 {
34413 const char *opts;
34414
34415+ std_vga_enabled = 0;
34416+ cirrus_vga_enabled = 0;
34417+ vmsvga_enabled = 0;
34418+
34419 if (strstart(p, "std", &opts)) {
34420 std_vga_enabled = 1;
34421- cirrus_vga_enabled = 0;
34422- vmsvga_enabled = 0;
34423 } else if (strstart(p, "cirrus", &opts)) {
34424 cirrus_vga_enabled = 1;
34425- std_vga_enabled = 0;
34426- vmsvga_enabled = 0;
34427 } else if (strstart(p, "vmware", &opts)) {
34428- cirrus_vga_enabled = 0;
34429- std_vga_enabled = 0;
34430 vmsvga_enabled = 1;
34431 } else if (strstart(p, "none", &opts)) {
34432- cirrus_vga_enabled = 0;
34433- std_vga_enabled = 0;
34434- vmsvga_enabled = 0;
34435 } else {
34436 invalid_vga:
34437 fprintf(stderr, "Unknown vga type: %s\n", p);
34438@@ -5220,6 +5221,9 @@ int main(int argc, char **argv, char **envp)
34439 old_param = 1;
34440 break;
34441 #endif
34442+ case QEMU_OPTION_force_pointer:
34443+ force_pointer = 1;
34444+ break;
34445 case QEMU_OPTION_clock:
34446 configure_alarms(optarg);
34447 break;
34448@@ -5261,6 +5265,11 @@ int main(int argc, char **argv, char **envp)
33807 } 34449 }
33808 } 34450 }
33809 break; 34451 break;
@@ -33815,17 +34457,21 @@ Index: git/vl.c
33815 case QEMU_OPTION_tb_size: 34457 case QEMU_OPTION_tb_size:
33816 tb_size = strtol(optarg, NULL, 0); 34458 tb_size = strtol(optarg, NULL, 0);
33817 if (tb_size < 0) 34459 if (tb_size < 0)
33818Index: git/hw/opengl_dummy.c 34460@@ -5545,6 +5554,17 @@ int main(int argc, char **argv, char **envp)
33819=================================================================== 34461 exit(1);
33820--- /dev/null 1970-01-01 00:00:00.000000000 +0000 34462 }
33821+++ git/hw/opengl_dummy.c 2009-05-23 11:22:17.000000000 +0100 34463 }
33822@@ -0,0 +1,9 @@ 34464+#ifdef TARGET_OPENGL_OK
33823+#include "../qemu-common.h" 34465+ if (enable_gl) {
33824+ 34466+ /* Use second serial port */
33825+#include <X11/Xlib.h> 34467+ int opengl_serial = 1;
33826+#include <X11/Xutil.h> 34468+
33827+ 34469+ if (serial_devices[opengl_serial])
33828+void opengl_exec_set_parent_window(Display *_dpy, Window _parent_window) 34470+ fprintf(stderr, "overriding second serial "
33829+{ 34471+ "port for OpenGL use\n");
33830+ return; 34472+ serial_devices[opengl_serial] = "opengl";
33831+} 34473+ }
34474+#endif
34475
34476 if (monitor_device) {
34477 monitor_hd = qemu_chr_open("monitor", monitor_device, NULL);
diff --git a/meta/packages/qemu/qemu_git.bb b/meta/packages/qemu/qemu_git.bb
index b92ecf5520..bdd18e8fc6 100644
--- a/meta/packages/qemu/qemu_git.bb
+++ b/meta/packages/qemu/qemu_git.bb
@@ -1,28 +1,19 @@
1LICENSE = "GPL" 1LICENSE = "GPL"
2DEPENDS = "zlib" 2DEPENDS = "zlib"
3PV = "0.10.2+git${SRCREV}" 3PV = "0.10.2+git${SRCREV}"
4PR = "r1" 4PR = "r4"
5 5
6FILESPATH = "${FILE_DIRNAME}/qemu-${PV}/:${FILE_DIRNAME}/qemu-git/" 6FILESPATH = "${FILE_DIRNAME}/qemu-${PV}/:${FILE_DIRNAME}/qemu-git/"
7 7
8SRC_URI = "\ 8SRC_URI = "\
9 git://git.sv.gnu.org/qemu.git;protocol=git \ 9 git://git.sv.gnu.org/qemu.git;protocol=git \
10 file://06_exit_segfault.patch;patch=1;pnum=0 \
11 file://11_signal_sigaction.patch;patch=1;pnum=0 \
12 file://22_net_tuntap_stall.patch;patch=1;pnum=0 \
13 file://31_syscalls.patch;patch=1;pnum=0 \
14 file://52_ne2000_return.patch;patch=1;pnum=1 \
15 file://63_sparc_build.patch;patch=1;pnum=0 \
16 file://66_tls_ld.patch;patch=1;pnum=0 \
17 file://91-oh-sdl-cursor.patch;patch=1;pnum=0 \
18 file://workaround_bad_futex_headers.patch;patch=1 \ 10 file://workaround_bad_futex_headers.patch;patch=1 \
19 file://qemu-add-gl-host-code.patch;patch=1 \ 11 file://qemu-git-qemugl-host.patch;patch=1 \
20 file://no-strip.patch;patch=1 \ 12 file://no-strip.patch;patch=1 \
21 file://fix-dirent.patch;patch=1 \ 13 file://fix-dirent.patch;patch=1 \
14 file://fix-nogl.patch;patch=1 \
22 file://zlibsearch.patch;patch=1 " 15 file://zlibsearch.patch;patch=1 "
23 16
24# file://qemu-amd64-32b-mapping-0.9.0.patch;patch=1
25
26S = "${WORKDIR}/git" 17S = "${WORKDIR}/git"
27 18
28#EXTRA_OECONF += "--disable-sdl" 19#EXTRA_OECONF += "--disable-sdl"