M7350v1_en_gpl

This commit is contained in:
T
2024-09-09 08:52:07 +00:00
commit f9cc65cfda
65988 changed files with 26357421 additions and 0 deletions
@@ -0,0 +1,86 @@
From de01f17a2cb88dc5ff53cc321342b888c33b120a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lo=C3=AFc=20Minier?= <lool@dooz.org>
Date: Thu, 11 Feb 2010 17:42:33 +0100
Subject: [PATCH] Detect and use GCC atomic builtins for locking
---
configure | 17 +++++++++++++++++
qemu-lock.h | 13 +++++++++++++
2 files changed, 30 insertions(+), 0 deletions(-)
Upstream-Status: Pending
Index: qemu-0.14.0/configure
===================================================================
--- qemu-0.14.0.orig/configure
+++ qemu-0.14.0/configure
@@ -2243,6 +2243,20 @@ fi
##########################################
##########################################
+# check if we have gcc atomic built-ins
+gcc_atomic_builtins=no
+cat > $TMPC << EOF
+int main(void) {
+ int i;
+ __sync_lock_test_and_set(&i, 1);
+ __sync_lock_release(&i);
+}
+EOF
+if compile_prog "" ""; then
+ gcc_atomic_builtins=yes
+fi
+
+##########################################
# check if we have fdatasync
fdatasync=no
@@ -2731,6 +2745,9 @@ fi
if test "$gcc_attribute_warn_unused_result" = "yes" ; then
echo "CONFIG_GCC_ATTRIBUTE_WARN_UNUSED_RESULT=y" >> $config_host_mak
fi
+if test "$gcc_atomic_builtins" = "yes" ; then
+ echo "CONFIG_GCC_ATOMIC_BUILTINS=y" >> $config_host_mak
+fi
if test "$fdatasync" = "yes" ; then
echo "CONFIG_FDATASYNC=y" >> $config_host_mak
fi
Index: qemu-0.14.0/qemu-lock.h
===================================================================
--- qemu-0.14.0.orig/qemu-lock.h
+++ qemu-0.14.0/qemu-lock.h
@@ -33,6 +33,14 @@
#else
+#ifdef CONFIG_GCC_ATOMIC_BUILTINS
+typedef int spinlock_t;
+
+#define SPIN_LOCK_UNLOCKED 0
+
+#define resetlock(p) __sync_lock_release((p))
+#else /* CONFIG_GCC_ATOMIC_BUILTINS */
+
#if defined(__hppa__)
typedef int spinlock_t[4];
@@ -56,7 +64,11 @@ static inline void resetlock (spinlock_t
}
#endif
+#endif /* !CONFIG_GCC_ATOMIC_BUILTINS */
+#ifdef CONFIG_GCC_ATOMIC_BUILTINS
+#define testandset(p) __sync_lock_test_and_set((p), 1)
+#else /* CONFIG_GCC_ATOMIC_BUILTINS */
#if defined(_ARCH_PPC)
static inline int testandset (int *p)
{
@@ -213,6 +225,7 @@ static inline int testandset (int *p)
#else
#error unimplemented CPU support
#endif
+#endif /* !CONFIG_GCC_ATOMIC_BUILTINS */
#if defined(CONFIG_USER_ONLY)
static inline void spin_lock(spinlock_t *lock)
@@ -0,0 +1,30 @@
After kernel commit:
http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-3.0/commit/?h=meta&id=9728c1b6a724daefc413b44e10253cdbb5e06d08
It appears that the emulated colours in qemu are incorrect and that
the red and blue channels are reversed. This patch reverses that logic
so the colours are correctly displayed on the versatile platform which
doesn't support the BGR bit.
RP 16/9/2011
Upstream-Status: Pending
Index: qemu-0.14.0/hw/pl110.c
===================================================================
--- qemu-0.14.0.orig/hw/pl110.c 2011-09-16 14:45:34.228668514 +0100
+++ qemu-0.14.0/hw/pl110.c 2011-09-16 15:17:22.458671206 +0100
@@ -141,7 +141,11 @@
fprintf(stderr, "pl110: Bad color depth\n");
exit(1);
}
- if (s->cr & PL110_CR_BGR)
+
+ if (s->versatile && s->bpp == BPP_16)
+ /* Code assumes BPP_16 == 565 and BGR is never set on the versatile in 565 mode */
+ bpp_offset = 0;
+ else if (s->cr & PL110_CR_BGR)
bpp_offset = 0;
else
bpp_offset = 18;
@@ -0,0 +1,55 @@
Enable i386-linux-user
Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
Upstream-Status: Inappropriate [configuration]
Index: qemu-0.14.0/Makefile.target
===================================================================
--- qemu-0.14.0.orig/Makefile.target
+++ qemu-0.14.0/Makefile.target
@@ -78,8 +78,13 @@ ifeq ($(TARGET_BASE_ARCH), i386)
libobj-y += cpuid.o
endif
libobj-$(CONFIG_NEED_MMU) += mmu.o
+ifndef CONFIG_LINUX_USER
libobj-$(TARGET_I386) += helper_opengl.o opengl_exec.o
libobj-$(TARGET_X86_64) += helper_opengl.o opengl_exec.o
+else
+libobj-$(TARGET_I386) += dummygl.o
+libobj-$(TARGET_X86_64) += dummygl.o
+endif #CONFIG_LINUX_USER
libobj-$(TARGET_ARM) += dummygl.o
libobj-$(TARGET_MIPS) += dummygl.o
libobj-$(TARGET_PPC) += dummygl.o
Index: qemu-0.14.0/target-i386/dummygl.c
===================================================================
--- /dev/null
+++ qemu-0.14.0/target-i386/dummygl.c
@@ -0,0 +1,26 @@
+#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)
+{
+
+}
+
+void helper_opengl(void)
+{
+}
@@ -0,0 +1,39 @@
From c313f89c33217ac0e471554dace2144718f86669 Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Thu, 13 May 2010 12:23:40 +0200
Subject: [PATCH] linux-user: use default mmap_min_addr 65536 when /proc/sys/vm/mmap_min_addr cannot be read
* 65536 is default at least for ubuntu and fedora.
---
linux-user/main.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
Upstream-Status: Pending
Index: qemu-0.14.0/linux-user/main.c
===================================================================
--- qemu-0.14.0.orig/linux-user/main.c
+++ qemu-0.14.0/linux-user/main.c
@@ -36,6 +36,7 @@
#include "envlist.h"
#define DEBUG_LOGFILE "/tmp/qemu.log"
+#define MMAP_MIN_ADDR_DEFAULT 65536
char *exec_path;
@@ -3010,8 +3011,14 @@ int main(int argc, char **argv, char **e
if (fscanf(fp, "%lu", &tmp) == 1) {
mmap_min_addr = tmp;
qemu_log("host mmap_min_addr=0x%lx\n", mmap_min_addr);
+ } else {
+ qemu_log("cannot read value from /proc/sys/vm/mmap_min_addr, assuming %d\n", MMAP_MIN_ADDR_DEFAULT);
+ mmap_min_addr = MMAP_MIN_ADDR_DEFAULT;
}
fclose(fp);
+ } else {
+ qemu_log("cannot open /proc/sys/vm/mmap_min_addr for reading, assuming %d\n", MMAP_MIN_ADDR_DEFAULT);
+ mmap_min_addr = MMAP_MIN_ADDR_DEFAULT;
}
}
@@ -0,0 +1,22 @@
In native builds, qemu can fail to find zlib development files in the native
sysroot and the build machine might not have zlib-dev packages installed.
Add CFLAGS to qemu's CFLAGS which in the native case means BUILD_CFLAGS are
added and files in the sysroot can be found.
Patch from Paul Eggleton, Comments by RP 28/11/10
Upstream-Status: Inappropriate [embedded specific]
Index: qemu-0.14.0/configure
===================================================================
--- qemu-0.14.0.orig/configure
+++ qemu-0.14.0/configure
@@ -229,6 +229,7 @@ QEMU_CFLAGS="-Wstrict-prototypes -Wredun
QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
QEMU_CFLAGS="-D_FORTIFY_SOURCE=2 $QEMU_CFLAGS"
QEMU_INCLUDES="-I. -I\$(SRC_PATH)"
+QEMU_CFLAGS="$QEMU_CFLAGS $CFLAGS"
LDFLAGS="-g $LDFLAGS"
# make source path absolute
@@ -0,0 +1,127 @@
Upstream-Status: Inappropriate [configuration]
Index: qemu-0.14.0/Makefile.target
===================================================================
--- qemu-0.14.0.orig/Makefile.target
+++ qemu-0.14.0/Makefile.target
@@ -79,6 +79,12 @@ libobj-y += cpuid.o
endif
libobj-$(CONFIG_NEED_MMU) += mmu.o
libobj-$(TARGET_I386) += helper_opengl.o opengl_exec.o
+libobj-$(TARGET_X86_64) += helper_opengl.o opengl_exec.o
+libobj-$(TARGET_ARM) += dummygl.o
+libobj-$(TARGET_MIPS) += dummygl.o
+libobj-$(TARGET_MIPS64) += dummygl.o
+libobj-$(TARGET_PPC) += dummygl.o
+libobj-$(TARGET_SH4) += dummygl.o
libobj-$(TARGET_ARM) += neon_helper.o iwmmxt_helper.o
libobj-y += disas.o
Index: qemu-0.14.0/target-arm/dummygl.c
===================================================================
--- /dev/null
+++ qemu-0.14.0/target-arm/dummygl.c
@@ -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)
+{
+
+}
Index: qemu-0.14.0/target-mips/dummygl.c
===================================================================
--- /dev/null
+++ qemu-0.14.0/target-mips/dummygl.c
@@ -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)
+{
+
+}
Index: qemu-0.14.0/target-ppc/dummygl.c
===================================================================
--- /dev/null
+++ qemu-0.14.0/target-ppc/dummygl.c
@@ -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)
+{
+
+}
Index: qemu-0.14.0/target-sh4/dummygl.c
===================================================================
--- /dev/null
+++ qemu-0.14.0/target-sh4/dummygl.c
@@ -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)
+{
+
+}
@@ -0,0 +1,15 @@
Upstream-Status: Inappropriate [configuration]
Index: qemu-0.14.0/Makefile.target
===================================================================
--- qemu-0.14.0.orig/Makefile.target 2011-04-04 12:12:19.142871742 +0100
+++ qemu-0.14.0/Makefile.target 2011-04-04 12:12:21.772871742 +0100
@@ -362,7 +362,7 @@
monitor.o: hmp-commands.h qmp-commands.h
-LIBS += -lGL -lGLU
+LIBS += -lGL
$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS)
@@ -0,0 +1,18 @@
# This is a workaround to the crashes seen on Ubuntu. Setting info to zero
# makes info.info.x11.display zero and avoids the calls to
# opengl_exec_set_parent_window, one of which is crashing.
Upstream-Status: Pending
Index: qemu-0.14.0/ui/sdl.c
===================================================================
--- qemu-0.14.0.orig/ui/sdl.c
+++ qemu-0.14.0/ui/sdl.c
@@ -863,6 +863,7 @@ void sdl_display_init(DisplayState *ds,
vi = SDL_GetVideoInfo();
host_format = *(vi->vfmt);
+ bzero(&info, sizeof(info));
SDL_GetWMInfo(&info);
if (info.subsystem == SDL_SYSWM_X11 && info.info.x11.display)
opengl_exec_set_parent_window(info.info.x11.display,
@@ -0,0 +1,22 @@
This patch is taken from debian. 128M is too less sometimes if distro
with lot of packages is booted so this patch raises the default to 384M
It has not been applied to upstream qemu
Khem Raj <raj.khem@gmail.com>
Upstream-Status: Pending
Index: qemu-0.14.0/vl.c
===================================================================
--- qemu-0.14.0.orig/vl.c
+++ qemu-0.14.0/vl.c
@@ -168,7 +168,7 @@ int main(int argc, char **argv)
//#define DEBUG_NET
//#define DEBUG_SLIRP
-#define DEFAULT_RAM_SIZE 128
+#define DEFAULT_RAM_SIZE 384
#define MAX_VIRTIO_CONSOLES 1
@@ -0,0 +1,25 @@
Fedora 13 switched the default behaviour of the linker to no longer
indirectly link to required libraries (i.e. dependencies of a library
already linked to). Therefore we need to explicitly pass the depended on
libraries into the linker for building to work on Fedora 13.
More information is available on the Fedora Wiki:
https://fedoraproject.org/wiki/UnderstandingDSOLinkChange
JL - 15/06/10
Upstream-Status: Inappropriate [configuration]
Index: qemu-0.14.0/Makefile.target
===================================================================
--- qemu-0.14.0.orig/Makefile.target
+++ qemu-0.14.0/Makefile.target
@@ -218,7 +218,7 @@ obj-$(CONFIG_REALLY_VIRTFS) += virtio-9p
obj-y += rwhandler.o
obj-$(CONFIG_KVM) += kvm.o kvm-all.o
obj-$(CONFIG_NO_KVM) += kvm-stub.o
-LIBS+=-lz
+LIBS+=-lz -lX11 -ldl
QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
QEMU_CFLAGS += $(VNC_SASL_CFLAGS)
@@ -0,0 +1,15 @@
Upstream-Status: Inappropriate [configuration]
Index: qemu-0.14.0/Makefile
===================================================================
--- qemu-0.14.0.orig/Makefile
+++ qemu-0.14.0/Makefile
@@ -235,7 +235,7 @@ install-sysconfig:
install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig
$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
ifneq ($(TOOLS),)
- $(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
+ $(INSTALL_PROG) $(TOOLS) "$(DESTDIR)$(bindir)"
endif
ifneq ($(BLOBS),)
$(INSTALL_DIR) "$(DESTDIR)$(datadir)"
@@ -0,0 +1,43 @@
Upstream-Status: Inappropriate [configuration]
diff -u -r qemu-0.14.0/Makefile.target qemu-0.14.0-fixed/Makefile.target
--- qemu-0.14.0/Makefile.target 2011-04-26 21:22:17.627637741 -0700
+++ qemu-0.14.0-fixed/Makefile.target 2011-04-26 21:23:02.767637747 -0700
@@ -82,8 +82,10 @@
libobj-$(TARGET_I386) += helper_opengl.o opengl_exec.o
libobj-$(TARGET_X86_64) += helper_opengl.o opengl_exec.o
else
+ifdef CONFIG_SDL
libobj-$(TARGET_I386) += dummygl.o
libobj-$(TARGET_X86_64) += dummygl.o
+endif
endif #CONFIG_LINUX_USER
libobj-$(TARGET_ARM) += dummygl.o
libobj-$(TARGET_MIPS) += dummygl.o
Only in qemu-0.14.0-fixed: config.log
diff -u -r qemu-0.14.0/target-i386/helper.h qemu-0.14.0-fixed/target-i386/helper.h
--- qemu-0.14.0/target-i386/helper.h 2011-04-26 21:22:11.418637742 -0700
+++ qemu-0.14.0-fixed/target-i386/helper.h 2011-04-26 21:23:02.539637747 -0700
@@ -217,6 +217,9 @@
DEF_HELPER_2(rcrq, tl, tl, tl)
#endif
+#ifdef CONFIG_SDL
DEF_HELPER_0(opengl, void)
+#endif
+
#include "def-helper.h"
diff -u -r qemu-0.14.0/target-i386/translate.c qemu-0.14.0-fixed/target-i386/translate.c
--- qemu-0.14.0/target-i386/translate.c 2011-04-26 21:22:21.600637743 -0700
+++ qemu-0.14.0-fixed/target-i386/translate.c 2011-04-26 21:23:02.538637747 -0700
@@ -2659,7 +2659,7 @@
static void gen_interrupt(DisasContext *s, int intno,
target_ulong cur_eip, target_ulong next_eip)
{
-#if !defined(CONFIG_USER_ONLY)
+#if !defined(CONFIG_USER_ONLY) && defined(CONFIG_SDL)
if (enable_gl && intno == 0x99) {
gen_helper_opengl();
return;
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,118 @@
# fix VMware VGA driver depth calculation error, which may cause segmentation fault
#
# ktian1, 06/29/2010
Upstream-Status: Pending
Index: qemu-0.14.0/console.h
===================================================================
--- qemu-0.14.0.orig/console.h
+++ qemu-0.14.0/console.h
@@ -171,6 +171,12 @@ struct DisplayAllocator {
void (*free_displaysurface)(DisplaySurface *surface);
};
+struct DisplayPostCallback {
+ void (*postcall) (void *);
+ void *parm;
+ struct DisplayPostCallback *next;
+};
+
struct DisplayState {
struct DisplaySurface *surface;
void *opaque;
@@ -178,6 +184,7 @@ struct DisplayState {
struct DisplayAllocator* allocator;
struct DisplayChangeListener* listeners;
+ struct DisplayPostCallback* postcalls;
void (*mouse_set)(int x, int y, int on);
void (*cursor_define)(QEMUCursor *cursor);
@@ -229,6 +236,12 @@ static inline void register_displaychang
ds->listeners = dcl;
}
+static inline void register_displaypostcallback(DisplayState *ds, DisplayPostCallback *dpc)
+{
+ dpc->next = ds->postcalls;
+ ds->postcalls = dpc;
+}
+
static inline void dpy_update(DisplayState *s, int x, int y, int w, int h)
{
struct DisplayChangeListener *dcl = s->listeners;
Index: qemu-0.14.0/hw/vmware_vga.c
===================================================================
--- qemu-0.14.0.orig/hw/vmware_vga.c
+++ qemu-0.14.0/hw/vmware_vga.c
@@ -1001,8 +1001,9 @@ static void vmsvga_update_display(void *
}
}
-static void vmsvga_reset(struct vmsvga_state_s *s)
+static void vmsvga_reset(void *parm)
{
+ struct vmsvga_state_s *s = (struct vmsvga_state_s *)parm;
s->index = 0;
s->enable = 0;
s->config = 0;
@@ -1207,6 +1208,8 @@ static const VMStateDescription vmstate_
static void vmsvga_init(struct vmsvga_state_s *s, int vga_ram_size)
{
+ DisplayPostCallback *dpc;
+
s->scratch_size = SVGA_SCRATCH_SIZE;
s->scratch = qemu_malloc(s->scratch_size * 4);
@@ -1224,7 +1227,10 @@ static void vmsvga_init(struct vmsvga_st
vga_init(&s->vga);
vmstate_register(NULL, 0, &vmstate_vga_common, &s->vga);
- vmsvga_reset(s);
+ dpc = qemu_mallocz(sizeof(DisplayPostCallback));
+ dpc->postcall = vmsvga_reset;
+ dpc->parm = s;
+ register_displaypostcallback(s->vga.ds, dpc);
}
static void pci_vmsvga_map_ioport(PCIDevice *pci_dev, int region_num,
Index: qemu-0.14.0/qemu-common.h
===================================================================
--- qemu-0.14.0.orig/qemu-common.h
+++ qemu-0.14.0/qemu-common.h
@@ -241,6 +241,7 @@ typedef struct DisplayState DisplayState
typedef struct DisplayChangeListener DisplayChangeListener;
typedef struct DisplaySurface DisplaySurface;
typedef struct DisplayAllocator DisplayAllocator;
+typedef struct DisplayPostCallback DisplayPostCallback;
typedef struct PixelFormat PixelFormat;
typedef struct TextConsole TextConsole;
typedef TextConsole QEMUConsole;
Index: qemu-0.14.0/vl.c
===================================================================
--- qemu-0.14.0.orig/vl.c
+++ qemu-0.14.0/vl.c
@@ -1920,6 +1920,7 @@ int main(int argc, char **argv, char **e
char boot_devices[33] = "cad"; /* default to HD->floppy->CD-ROM */
DisplayState *ds;
DisplayChangeListener *dcl;
+ DisplayPostCallback *dpc;
int cyls, heads, secs, translation;
QemuOpts *hda_opts = NULL, *opts;
QemuOptsList *olist;
@@ -3101,6 +3102,13 @@ int main(int argc, char **argv, char **e
/* display setup */
dpy_resize(ds);
+ dpc = ds->postcalls;
+ while (dpc != NULL) {
+ if (dpc->postcall != NULL)
+ dpc->postcall(dpc->parm);
+ dpc = dpc->next;
+ }
+
dcl = ds->listeners;
while (dcl != NULL) {
if (dcl->dpy_refresh != NULL) {
@@ -0,0 +1,65 @@
Allow releasing the GLXContext/Drawable with glXMakeCurrent.
---
commit d942ed4e853e08d2298f3e11e9a952c1d952bff5
tree f0a934efd8a8ff48e2d96f0d6fc7d70bef106bfe
parent 93619e6be184f8de08759d347825ee0d678a6f9c
author Andrzej Zaborowski <andrew.zaborowski@intel.com> Tue, 16 Jun 2009 22:22:05 +0200
committer Andrzej Zaborowski <andrew.zaborowski@intel.com> Tue, 16 Jun 2009 22:22:05 +0200
target-i386/opengl_exec.c | 31 ++++++++++++++++---------------
1 files changed, 16 insertions(+), 15 deletions(-)
Upstream-Status: Inappropriate [configuration]
Index: qemu-0.14.0/target-i386/opengl_exec.c
===================================================================
--- qemu-0.14.0.orig/target-i386/opengl_exec.c
+++ qemu-0.14.0/target-i386/opengl_exec.c
@@ -1600,10 +1600,9 @@ int do_function_call(int func_number, ar
fprintf(stderr, "client_drawable=%p fake_ctx=%d\n",
(void *) client_drawable, fake_ctxt);
- if (client_drawable == 0 && fake_ctxt == 0) {
+ if (client_drawable == 0 && fake_ctxt == 0)
ret_int = glXMakeCurrent(dpy, 0, NULL);
- process->current_state = &process->default_state;
- } else if ((drawable = (GLXDrawable)
+ else if ((drawable = (GLXDrawable)
get_association_fakepbuffer_pbuffer(
process, client_drawable))) {
GLXContext ctxt = get_association_fakecontext_glxcontext(
@@ -1651,19 +1650,21 @@ int do_function_call(int func_number, ar
}
if (ret_int) {
- for (i = 0; i < process->nb_states; i ++) {
- if (process->glstates[i]->fake_ctxt == fake_ctxt) {
- /* HACK !!! REMOVE */
- process->current_state = process->glstates[i];
- process->current_state->drawable = drawable;
- break;
- }
- }
+ if (fake_ctxt) {
+ for (i = 0; i < process->nb_states; i ++)
+ if (process->glstates[i]->fake_ctxt == fake_ctxt) {
+ /* HACK !!! REMOVE */
+ process->current_state = process->glstates[i];
+ process->current_state->drawable = drawable;
+ break;
+ }
- if (i == process->nb_states) {
- fprintf(stderr, "error remembering the new context\n");
- exit(-1);
- }
+ if (i == process->nb_states) {
+ fprintf(stderr, "error remembering the new context\n");
+ exit(-1);
+ }
+ } else
+ process->current_state = &process->default_state;
}
break;
}
@@ -0,0 +1,74 @@
This patch fix GL application start failure on qemu 0.14.0.
Some turn-on macro/variable are re-arranged, buffer pointer is extended to
support 32/64b combination of target/host.
This is not perfect fix, and we need consider other GL alternatives in future.
Upstream-Status: Inappropriate [other] - depends on qemu gl patch
Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
Index: qemu-0.14.0/target-i386/opengl_func.h
===================================================================
--- qemu-0.14.0.orig/target-i386/opengl_func.h 2011-04-08 16:43:46.000000000 +0800
+++ qemu-0.14.0/target-i386/opengl_func.h 2011-04-08 16:45:55.000000000 +0800
@@ -26,8 +26,9 @@
#include "mesa_glext.h"
/* Argument list are internally of a type that can hold a target pointer
- * or a host pointer. */
-typedef target_phys_addr_t arg_t;
+ * or a host pointer. If 32b target runs on 64b host, it should be big enough
+ * to hold host pointer */
+typedef long unsigned int arg_t;
enum {
TYPE_NONE,
Index: qemu-0.14.0/target-i386/translate.c
===================================================================
--- qemu-0.14.0.orig/target-i386/translate.c 2011-04-08 16:19:15.000000000 +0800
+++ qemu-0.14.0/target-i386/translate.c 2011-04-08 16:22:03.000000000 +0800
@@ -2652,17 +2652,19 @@
s->is_jmp = DISAS_TB_JUMP;
}
-int enable_gl = 0;
+extern int enable_gl;
/* an interrupt is different from an exception because of the
privilege checks */
static void gen_interrupt(DisasContext *s, int intno,
target_ulong cur_eip, target_ulong next_eip)
{
+#if !defined(CONFIG_USER_ONLY)
if (enable_gl && intno == 0x99) {
gen_helper_opengl();
return;
}
+#endif
if (s->cc_op != CC_OP_DYNAMIC)
gen_op_set_cc_op(s->cc_op);
Index: qemu-0.14.0/vl.c
===================================================================
--- qemu-0.14.0.orig/vl.c 2011-04-08 16:11:43.000000000 +0800
+++ qemu-0.14.0/vl.c 2011-04-08 16:20:05.000000000 +0800
@@ -229,7 +229,7 @@
unsigned int nb_prom_envs = 0;
const char *prom_envs[MAX_PROM_ENVS];
int boot_menu;
-extern int enable_gl;
+int enable_gl = 0;
typedef struct FWBootEntry FWBootEntry;
@@ -1909,6 +1909,7 @@
return popt;
}
+#define TARGET_OPENGL_OK
int main(int argc, char **argv, char **envp)
{
const char *gdbstub_dev = NULL;
@@ -0,0 +1,152 @@
Description: spice/qxl: locking fix for qemu-kvm
Author: Gerd Hoffmann <kraxel@redhat.com>
Source: upstream, http://patchwork.ozlabs.org/patch/84704/
Forwarding: not-needed
Upstream-Status: Pending
Index: qemu-0.14.0/hw/qxl.c
===================================================================
--- qemu-0.14.0.orig/hw/qxl.c
+++ qemu-0.14.0/hw/qxl.c
@@ -125,6 +125,27 @@ static void qxl_reset_memslots(PCIQXLDev
static void qxl_reset_surfaces(PCIQXLDevice *d);
static void qxl_ring_set_dirty(PCIQXLDevice *qxl);
+/* qemu-kvm locking ... */
+void qxl_unlock_iothread(SimpleSpiceDisplay *ssd)
+{
+ if (cpu_single_env) {
+ assert(ssd->env == NULL);
+ ssd->env = cpu_single_env;
+ cpu_single_env = NULL;
+ }
+ qemu_mutex_unlock_iothread();
+}
+
+void qxl_lock_iothread(SimpleSpiceDisplay *ssd)
+{
+ qemu_mutex_lock_iothread();
+ if (ssd->env) {
+ assert(cpu_single_env == NULL);
+ cpu_single_env = ssd->env;
+ ssd->env = NULL;
+ }
+}
+
static inline uint32_t msb_mask(uint32_t val)
{
uint32_t mask;
@@ -662,10 +683,10 @@ static void qxl_hard_reset(PCIQXLDevice
dprint(d, 1, "%s: start%s\n", __FUNCTION__,
loadvm ? " (loadvm)" : "");
- qemu_mutex_unlock_iothread();
+ qxl_unlock_iothread(&d->ssd);
d->ssd.worker->reset_cursor(d->ssd.worker);
d->ssd.worker->reset_image_cache(d->ssd.worker);
- qemu_mutex_lock_iothread();
+ qxl_lock_iothread(&d->ssd);
qxl_reset_surfaces(d);
qxl_reset_memslots(d);
@@ -795,9 +816,9 @@ static void qxl_reset_surfaces(PCIQXLDev
{
dprint(d, 1, "%s:\n", __FUNCTION__);
d->mode = QXL_MODE_UNDEFINED;
- qemu_mutex_unlock_iothread();
+ qxl_unlock_iothread(&d->ssd);
d->ssd.worker->destroy_surfaces(d->ssd.worker);
- qemu_mutex_lock_iothread();
+ qxl_lock_iothread(&d->ssd);
memset(&d->guest_surfaces.cmds, 0, sizeof(d->guest_surfaces.cmds));
}
@@ -866,9 +887,9 @@ static void qxl_destroy_primary(PCIQXLDe
dprint(d, 1, "%s\n", __FUNCTION__);
d->mode = QXL_MODE_UNDEFINED;
- qemu_mutex_unlock_iothread();
+ qxl_unlock_iothread(&d->ssd);
d->ssd.worker->destroy_primary_surface(d->ssd.worker, 0);
- qemu_mutex_lock_iothread();
+ qxl_lock_iothread(&d->ssd);
}
static void qxl_set_mode(PCIQXLDevice *d, int modenr, int loadvm)
@@ -938,10 +959,10 @@ static void ioport_write(void *opaque, u
case QXL_IO_UPDATE_AREA:
{
QXLRect update = d->ram->update_area;
- qemu_mutex_unlock_iothread();
+ qxl_unlock_iothread(&d->ssd);
d->ssd.worker->update_area(d->ssd.worker, d->ram->update_surface,
&update, NULL, 0, 0);
- qemu_mutex_lock_iothread();
+ qxl_lock_iothread(&d->ssd);
break;
}
case QXL_IO_NOTIFY_CMD:
Index: qemu-0.14.0/ui/spice-display.c
===================================================================
--- qemu-0.14.0.orig/ui/spice-display.c
+++ qemu-0.14.0/ui/spice-display.c
@@ -186,18 +186,18 @@ void qemu_spice_create_host_primary(Simp
surface.mem = (intptr_t)ssd->buf;
surface.group_id = MEMSLOT_GROUP_HOST;
- qemu_mutex_unlock_iothread();
+ qxl_unlock_iothread(ssd);
ssd->worker->create_primary_surface(ssd->worker, 0, &surface);
- qemu_mutex_lock_iothread();
+ qxl_lock_iothread(ssd);
}
void qemu_spice_destroy_host_primary(SimpleSpiceDisplay *ssd)
{
dprint(1, "%s:\n", __FUNCTION__);
- qemu_mutex_unlock_iothread();
+ qxl_unlock_iothread(ssd);
ssd->worker->destroy_primary_surface(ssd->worker, 0);
- qemu_mutex_lock_iothread();
+ qxl_lock_iothread(ssd);
}
void qemu_spice_vm_change_state_handler(void *opaque, int running, int reason)
@@ -207,9 +207,9 @@ void qemu_spice_vm_change_state_handler(
if (running) {
ssd->worker->start(ssd->worker);
} else {
- qemu_mutex_unlock_iothread();
+ qxl_unlock_iothread(ssd);
ssd->worker->stop(ssd->worker);
- qemu_mutex_lock_iothread();
+ qxl_lock_iothread(ssd);
}
ssd->running = running;
}
Index: qemu-0.14.0/ui/spice-display.h
===================================================================
--- qemu-0.14.0.orig/ui/spice-display.h
+++ qemu-0.14.0/ui/spice-display.h
@@ -43,6 +43,9 @@ typedef struct SimpleSpiceDisplay {
QXLRect dirty;
int notify;
int running;
+
+ /* qemu-kvm locking ... */
+ void *env;
} SimpleSpiceDisplay;
typedef struct SimpleSpiceUpdate {
@@ -52,6 +55,9 @@ typedef struct SimpleSpiceUpdate {
uint8_t *bitmap;
} SimpleSpiceUpdate;
+void qxl_unlock_iothread(SimpleSpiceDisplay *ssd);
+void qxl_lock_iothread(SimpleSpiceDisplay *ssd);
+
int qemu_spice_rect_is_empty(const QXLRect* r);
void qemu_spice_rect_union(QXLRect *dest, const QXLRect *r);
@@ -0,0 +1,30 @@
After kernel commit:
http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-3.0/commit/?h=meta&id=9728c1b6a724daefc413b44e10253cdbb5e06d08
It appears that the emulated colours in qemu are incorrect and that
the red and blue channels are reversed. This patch reverses that logic
so the colours are correctly displayed on the versatile platform which
doesn't support the BGR bit.
RP 16/9/2011
Upstream-Status: Pending
Index: qemu-0.14.0/hw/pl110.c
===================================================================
--- qemu-0.14.0.orig/hw/pl110.c 2011-09-16 14:45:34.228668514 +0100
+++ qemu-0.14.0/hw/pl110.c 2011-09-16 15:17:22.458671206 +0100
@@ -141,7 +141,11 @@
fprintf(stderr, "pl110: Bad color depth\n");
exit(1);
}
- if (s->cr & PL110_CR_BGR)
+
+ if (s->versatile && s->bpp == BPP_16)
+ /* Code assumes BPP_16 == 565 and BGR is never set on the versatile in 565 mode */
+ bpp_offset = 0;
+ else if (s->cr & PL110_CR_BGR)
bpp_offset = 0;
else
bpp_offset = 18;
@@ -0,0 +1,55 @@
Enable i386-linux-user
Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
Upstream-Status: Inappropriate [configuration]
Index: qemu-0.14.0/Makefile.target
===================================================================
--- qemu-0.14.0.orig/Makefile.target
+++ qemu-0.14.0/Makefile.target
@@ -78,8 +78,13 @@ ifeq ($(TARGET_BASE_ARCH), i386)
libobj-y += cpuid.o
endif
libobj-$(CONFIG_NEED_MMU) += mmu.o
+ifndef CONFIG_LINUX_USER
libobj-$(TARGET_I386) += helper_opengl.o opengl_exec.o
libobj-$(TARGET_X86_64) += helper_opengl.o opengl_exec.o
+else
+libobj-$(TARGET_I386) += dummygl.o
+libobj-$(TARGET_X86_64) += dummygl.o
+endif #CONFIG_LINUX_USER
libobj-$(TARGET_ARM) += dummygl.o
libobj-$(TARGET_MIPS) += dummygl.o
libobj-$(TARGET_PPC) += dummygl.o
Index: qemu-0.14.0/target-i386/dummygl.c
===================================================================
--- /dev/null
+++ qemu-0.14.0/target-i386/dummygl.c
@@ -0,0 +1,26 @@
+#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)
+{
+
+}
+
+void helper_opengl(void)
+{
+}
@@ -0,0 +1,39 @@
From c313f89c33217ac0e471554dace2144718f86669 Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Thu, 13 May 2010 12:23:40 +0200
Subject: [PATCH] linux-user: use default mmap_min_addr 65536 when /proc/sys/vm/mmap_min_addr cannot be read
* 65536 is default at least for ubuntu and fedora.
---
linux-user/main.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
Upstream-Status: Pending
Index: qemu-0.14.0/linux-user/main.c
===================================================================
--- qemu-0.14.0.orig/linux-user/main.c
+++ qemu-0.14.0/linux-user/main.c
@@ -36,6 +36,7 @@
#include "envlist.h"
#define DEBUG_LOGFILE "/tmp/qemu.log"
+#define MMAP_MIN_ADDR_DEFAULT 65536
char *exec_path;
@@ -3010,8 +3011,14 @@ int main(int argc, char **argv, char **e
if (fscanf(fp, "%lu", &tmp) == 1) {
mmap_min_addr = tmp;
qemu_log("host mmap_min_addr=0x%lx\n", mmap_min_addr);
+ } else {
+ qemu_log("cannot read value from /proc/sys/vm/mmap_min_addr, assuming %d\n", MMAP_MIN_ADDR_DEFAULT);
+ mmap_min_addr = MMAP_MIN_ADDR_DEFAULT;
}
fclose(fp);
+ } else {
+ qemu_log("cannot open /proc/sys/vm/mmap_min_addr for reading, assuming %d\n", MMAP_MIN_ADDR_DEFAULT);
+ mmap_min_addr = MMAP_MIN_ADDR_DEFAULT;
}
}
@@ -0,0 +1,22 @@
In native builds, qemu can fail to find zlib development files in the native
sysroot and the build machine might not have zlib-dev packages installed.
Add CFLAGS to qemu's CFLAGS which in the native case means BUILD_CFLAGS are
added and files in the sysroot can be found.
Patch from Paul Eggleton, Comments by RP 28/11/10
Upstream-Status: Inappropriate [embedded specific]
Index: qemu-0.14.0/configure
===================================================================
--- qemu-0.14.0.orig/configure
+++ qemu-0.14.0/configure
@@ -229,6 +229,7 @@ QEMU_CFLAGS="-Wstrict-prototypes -Wredun
QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
QEMU_CFLAGS="-D_FORTIFY_SOURCE=2 $QEMU_CFLAGS"
QEMU_INCLUDES="-I. -I\$(SRC_PATH)"
+QEMU_CFLAGS="$QEMU_CFLAGS $CFLAGS"
LDFLAGS="-g $LDFLAGS"
# make source path absolute
@@ -0,0 +1,127 @@
Upstream-Status: Inappropriate [configuration]
Index: qemu-0.14.0/Makefile.target
===================================================================
--- qemu-0.14.0.orig/Makefile.target
+++ qemu-0.14.0/Makefile.target
@@ -79,6 +79,12 @@ libobj-y += cpuid.o
endif
libobj-$(CONFIG_NEED_MMU) += mmu.o
libobj-$(TARGET_I386) += helper_opengl.o opengl_exec.o
+libobj-$(TARGET_X86_64) += helper_opengl.o opengl_exec.o
+libobj-$(TARGET_ARM) += dummygl.o
+libobj-$(TARGET_MIPS) += dummygl.o
+libobj-$(TARGET_MIPS64) += dummygl.o
+libobj-$(TARGET_PPC) += dummygl.o
+libobj-$(TARGET_SH4) += dummygl.o
libobj-$(TARGET_ARM) += neon_helper.o iwmmxt_helper.o
libobj-y += disas.o
Index: qemu-0.14.0/target-arm/dummygl.c
===================================================================
--- /dev/null
+++ qemu-0.14.0/target-arm/dummygl.c
@@ -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)
+{
+
+}
Index: qemu-0.14.0/target-mips/dummygl.c
===================================================================
--- /dev/null
+++ qemu-0.14.0/target-mips/dummygl.c
@@ -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)
+{
+
+}
Index: qemu-0.14.0/target-ppc/dummygl.c
===================================================================
--- /dev/null
+++ qemu-0.14.0/target-ppc/dummygl.c
@@ -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)
+{
+
+}
Index: qemu-0.14.0/target-sh4/dummygl.c
===================================================================
--- /dev/null
+++ qemu-0.14.0/target-sh4/dummygl.c
@@ -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)
+{
+
+}
@@ -0,0 +1,15 @@
Upstream-Status: Inappropriate [configuration]
Index: qemu-0.14.0/Makefile.target
===================================================================
--- qemu-0.14.0.orig/Makefile.target 2011-04-04 12:12:19.142871742 +0100
+++ qemu-0.14.0/Makefile.target 2011-04-04 12:12:21.772871742 +0100
@@ -362,7 +362,7 @@
monitor.o: hmp-commands.h qmp-commands.h
-LIBS += -lGL -lGLU
+LIBS += -lGL
$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS)
@@ -0,0 +1,18 @@
# This is a workaround to the crashes seen on Ubuntu. Setting info to zero
# makes info.info.x11.display zero and avoids the calls to
# opengl_exec_set_parent_window, one of which is crashing.
Upstream-Status: Pending
Index: qemu-0.14.0/ui/sdl.c
===================================================================
--- qemu-0.14.0.orig/ui/sdl.c
+++ qemu-0.14.0/ui/sdl.c
@@ -863,6 +863,7 @@ void sdl_display_init(DisplayState *ds,
vi = SDL_GetVideoInfo();
host_format = *(vi->vfmt);
+ bzero(&info, sizeof(info));
SDL_GetWMInfo(&info);
if (info.subsystem == SDL_SYSWM_X11 && info.info.x11.display)
opengl_exec_set_parent_window(info.info.x11.display,
@@ -0,0 +1,22 @@
This patch is taken from debian. 128M is too less sometimes if distro
with lot of packages is booted so this patch raises the default to 384M
It has not been applied to upstream qemu
Khem Raj <raj.khem@gmail.com>
Upstream-Status: Pending
Index: qemu-0.14.0/vl.c
===================================================================
--- qemu-0.14.0.orig/vl.c
+++ qemu-0.14.0/vl.c
@@ -168,7 +168,7 @@ int main(int argc, char **argv)
//#define DEBUG_NET
//#define DEBUG_SLIRP
-#define DEFAULT_RAM_SIZE 128
+#define DEFAULT_RAM_SIZE 384
#define MAX_VIRTIO_CONSOLES 1
@@ -0,0 +1,25 @@
Fedora 13 switched the default behaviour of the linker to no longer
indirectly link to required libraries (i.e. dependencies of a library
already linked to). Therefore we need to explicitly pass the depended on
libraries into the linker for building to work on Fedora 13.
More information is available on the Fedora Wiki:
https://fedoraproject.org/wiki/UnderstandingDSOLinkChange
JL - 15/06/10
Upstream-Status: Inappropriate [configuration]
Index: qemu-0.14.0/Makefile.target
===================================================================
--- qemu-0.14.0.orig/Makefile.target
+++ qemu-0.14.0/Makefile.target
@@ -218,7 +218,7 @@ obj-$(CONFIG_REALLY_VIRTFS) += virtio-9p
obj-y += rwhandler.o
obj-$(CONFIG_KVM) += kvm.o kvm-all.o
obj-$(CONFIG_NO_KVM) += kvm-stub.o
-LIBS+=-lz
+LIBS+=-lz -lX11 -ldl
QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
QEMU_CFLAGS += $(VNC_SASL_CFLAGS)
@@ -0,0 +1,15 @@
Upstream-Status: Inappropriate [configuration]
Index: qemu-0.14.0/Makefile
===================================================================
--- qemu-0.14.0.orig/Makefile
+++ qemu-0.14.0/Makefile
@@ -235,7 +235,7 @@ install-sysconfig:
install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig
$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
ifneq ($(TOOLS),)
- $(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
+ $(INSTALL_PROG) $(TOOLS) "$(DESTDIR)$(bindir)"
endif
ifneq ($(BLOBS),)
$(INSTALL_DIR) "$(DESTDIR)$(datadir)"
@@ -0,0 +1,43 @@
Upstream-Status: Inappropriate [configuration]
diff -u -r qemu-0.14.0/Makefile.target qemu-0.14.0-fixed/Makefile.target
--- qemu-0.14.0/Makefile.target 2011-04-26 21:22:17.627637741 -0700
+++ qemu-0.14.0-fixed/Makefile.target 2011-04-26 21:23:02.767637747 -0700
@@ -82,8 +82,10 @@
libobj-$(TARGET_I386) += helper_opengl.o opengl_exec.o
libobj-$(TARGET_X86_64) += helper_opengl.o opengl_exec.o
else
+ifdef CONFIG_SDL
libobj-$(TARGET_I386) += dummygl.o
libobj-$(TARGET_X86_64) += dummygl.o
+endif
endif #CONFIG_LINUX_USER
libobj-$(TARGET_ARM) += dummygl.o
libobj-$(TARGET_MIPS) += dummygl.o
Only in qemu-0.14.0-fixed: config.log
diff -u -r qemu-0.14.0/target-i386/helper.h qemu-0.14.0-fixed/target-i386/helper.h
--- qemu-0.14.0/target-i386/helper.h 2011-04-26 21:22:11.418637742 -0700
+++ qemu-0.14.0-fixed/target-i386/helper.h 2011-04-26 21:23:02.539637747 -0700
@@ -217,6 +217,9 @@
DEF_HELPER_2(rcrq, tl, tl, tl)
#endif
+#ifdef CONFIG_SDL
DEF_HELPER_0(opengl, void)
+#endif
+
#include "def-helper.h"
diff -u -r qemu-0.14.0/target-i386/translate.c qemu-0.14.0-fixed/target-i386/translate.c
--- qemu-0.14.0/target-i386/translate.c 2011-04-26 21:22:21.600637743 -0700
+++ qemu-0.14.0-fixed/target-i386/translate.c 2011-04-26 21:23:02.538637747 -0700
@@ -2659,7 +2659,7 @@
static void gen_interrupt(DisasContext *s, int intno,
target_ulong cur_eip, target_ulong next_eip)
{
-#if !defined(CONFIG_USER_ONLY)
+#if !defined(CONFIG_USER_ONLY) && defined(CONFIG_SDL)
if (enable_gl && intno == 0x99) {
gen_helper_opengl();
return;
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,118 @@
# fix VMware VGA driver depth calculation error, which may cause segmentation fault
#
# ktian1, 06/29/2010
Upstream-Status: Pending
Index: qemu-0.14.0/console.h
===================================================================
--- qemu-0.14.0.orig/console.h
+++ qemu-0.14.0/console.h
@@ -171,6 +171,12 @@ struct DisplayAllocator {
void (*free_displaysurface)(DisplaySurface *surface);
};
+struct DisplayPostCallback {
+ void (*postcall) (void *);
+ void *parm;
+ struct DisplayPostCallback *next;
+};
+
struct DisplayState {
struct DisplaySurface *surface;
void *opaque;
@@ -178,6 +184,7 @@ struct DisplayState {
struct DisplayAllocator* allocator;
struct DisplayChangeListener* listeners;
+ struct DisplayPostCallback* postcalls;
void (*mouse_set)(int x, int y, int on);
void (*cursor_define)(QEMUCursor *cursor);
@@ -229,6 +236,12 @@ static inline void register_displaychang
ds->listeners = dcl;
}
+static inline void register_displaypostcallback(DisplayState *ds, DisplayPostCallback *dpc)
+{
+ dpc->next = ds->postcalls;
+ ds->postcalls = dpc;
+}
+
static inline void dpy_update(DisplayState *s, int x, int y, int w, int h)
{
struct DisplayChangeListener *dcl = s->listeners;
Index: qemu-0.14.0/hw/vmware_vga.c
===================================================================
--- qemu-0.14.0.orig/hw/vmware_vga.c
+++ qemu-0.14.0/hw/vmware_vga.c
@@ -1001,8 +1001,9 @@ static void vmsvga_update_display(void *
}
}
-static void vmsvga_reset(struct vmsvga_state_s *s)
+static void vmsvga_reset(void *parm)
{
+ struct vmsvga_state_s *s = (struct vmsvga_state_s *)parm;
s->index = 0;
s->enable = 0;
s->config = 0;
@@ -1207,6 +1208,8 @@ static const VMStateDescription vmstate_
static void vmsvga_init(struct vmsvga_state_s *s, int vga_ram_size)
{
+ DisplayPostCallback *dpc;
+
s->scratch_size = SVGA_SCRATCH_SIZE;
s->scratch = qemu_malloc(s->scratch_size * 4);
@@ -1224,7 +1227,10 @@ static void vmsvga_init(struct vmsvga_st
vga_init(&s->vga);
vmstate_register(NULL, 0, &vmstate_vga_common, &s->vga);
- vmsvga_reset(s);
+ dpc = qemu_mallocz(sizeof(DisplayPostCallback));
+ dpc->postcall = vmsvga_reset;
+ dpc->parm = s;
+ register_displaypostcallback(s->vga.ds, dpc);
}
static void pci_vmsvga_map_ioport(PCIDevice *pci_dev, int region_num,
Index: qemu-0.14.0/qemu-common.h
===================================================================
--- qemu-0.14.0.orig/qemu-common.h
+++ qemu-0.14.0/qemu-common.h
@@ -241,6 +241,7 @@ typedef struct DisplayState DisplayState
typedef struct DisplayChangeListener DisplayChangeListener;
typedef struct DisplaySurface DisplaySurface;
typedef struct DisplayAllocator DisplayAllocator;
+typedef struct DisplayPostCallback DisplayPostCallback;
typedef struct PixelFormat PixelFormat;
typedef struct TextConsole TextConsole;
typedef TextConsole QEMUConsole;
Index: qemu-0.14.0/vl.c
===================================================================
--- qemu-0.14.0.orig/vl.c
+++ qemu-0.14.0/vl.c
@@ -1920,6 +1920,7 @@ int main(int argc, char **argv, char **e
char boot_devices[33] = "cad"; /* default to HD->floppy->CD-ROM */
DisplayState *ds;
DisplayChangeListener *dcl;
+ DisplayPostCallback *dpc;
int cyls, heads, secs, translation;
QemuOpts *hda_opts = NULL, *opts;
QemuOptsList *olist;
@@ -3101,6 +3102,13 @@ int main(int argc, char **argv, char **e
/* display setup */
dpy_resize(ds);
+ dpc = ds->postcalls;
+ while (dpc != NULL) {
+ if (dpc->postcall != NULL)
+ dpc->postcall(dpc->parm);
+ dpc = dpc->next;
+ }
+
dcl = ds->listeners;
while (dcl != NULL) {
if (dcl->dpy_refresh != NULL) {
@@ -0,0 +1,65 @@
Allow releasing the GLXContext/Drawable with glXMakeCurrent.
---
commit d942ed4e853e08d2298f3e11e9a952c1d952bff5
tree f0a934efd8a8ff48e2d96f0d6fc7d70bef106bfe
parent 93619e6be184f8de08759d347825ee0d678a6f9c
author Andrzej Zaborowski <andrew.zaborowski@intel.com> Tue, 16 Jun 2009 22:22:05 +0200
committer Andrzej Zaborowski <andrew.zaborowski@intel.com> Tue, 16 Jun 2009 22:22:05 +0200
target-i386/opengl_exec.c | 31 ++++++++++++++++---------------
1 files changed, 16 insertions(+), 15 deletions(-)
Upstream-Status: Inappropriate [configuration]
Index: qemu-0.14.0/target-i386/opengl_exec.c
===================================================================
--- qemu-0.14.0.orig/target-i386/opengl_exec.c
+++ qemu-0.14.0/target-i386/opengl_exec.c
@@ -1600,10 +1600,9 @@ int do_function_call(int func_number, ar
fprintf(stderr, "client_drawable=%p fake_ctx=%d\n",
(void *) client_drawable, fake_ctxt);
- if (client_drawable == 0 && fake_ctxt == 0) {
+ if (client_drawable == 0 && fake_ctxt == 0)
ret_int = glXMakeCurrent(dpy, 0, NULL);
- process->current_state = &process->default_state;
- } else if ((drawable = (GLXDrawable)
+ else if ((drawable = (GLXDrawable)
get_association_fakepbuffer_pbuffer(
process, client_drawable))) {
GLXContext ctxt = get_association_fakecontext_glxcontext(
@@ -1651,19 +1650,21 @@ int do_function_call(int func_number, ar
}
if (ret_int) {
- for (i = 0; i < process->nb_states; i ++) {
- if (process->glstates[i]->fake_ctxt == fake_ctxt) {
- /* HACK !!! REMOVE */
- process->current_state = process->glstates[i];
- process->current_state->drawable = drawable;
- break;
- }
- }
+ if (fake_ctxt) {
+ for (i = 0; i < process->nb_states; i ++)
+ if (process->glstates[i]->fake_ctxt == fake_ctxt) {
+ /* HACK !!! REMOVE */
+ process->current_state = process->glstates[i];
+ process->current_state->drawable = drawable;
+ break;
+ }
- if (i == process->nb_states) {
- fprintf(stderr, "error remembering the new context\n");
- exit(-1);
- }
+ if (i == process->nb_states) {
+ fprintf(stderr, "error remembering the new context\n");
+ exit(-1);
+ }
+ } else
+ process->current_state = &process->default_state;
}
break;
}
@@ -0,0 +1,74 @@
This patch fix GL application start failure on qemu 0.14.0.
Some turn-on macro/variable are re-arranged, buffer pointer is extended to
support 32/64b combination of target/host.
This is not perfect fix, and we need consider other GL alternatives in future.
Upstream-Status: Inappropriate [other] - depends on qemu gl patch
Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
Index: qemu-0.14.0/target-i386/opengl_func.h
===================================================================
--- qemu-0.14.0.orig/target-i386/opengl_func.h 2011-04-08 16:43:46.000000000 +0800
+++ qemu-0.14.0/target-i386/opengl_func.h 2011-04-08 16:45:55.000000000 +0800
@@ -26,8 +26,9 @@
#include "mesa_glext.h"
/* Argument list are internally of a type that can hold a target pointer
- * or a host pointer. */
-typedef target_phys_addr_t arg_t;
+ * or a host pointer. If 32b target runs on 64b host, it should be big enough
+ * to hold host pointer */
+typedef long unsigned int arg_t;
enum {
TYPE_NONE,
Index: qemu-0.14.0/target-i386/translate.c
===================================================================
--- qemu-0.14.0.orig/target-i386/translate.c 2011-04-08 16:19:15.000000000 +0800
+++ qemu-0.14.0/target-i386/translate.c 2011-04-08 16:22:03.000000000 +0800
@@ -2652,17 +2652,19 @@
s->is_jmp = DISAS_TB_JUMP;
}
-int enable_gl = 0;
+extern int enable_gl;
/* an interrupt is different from an exception because of the
privilege checks */
static void gen_interrupt(DisasContext *s, int intno,
target_ulong cur_eip, target_ulong next_eip)
{
+#if !defined(CONFIG_USER_ONLY)
if (enable_gl && intno == 0x99) {
gen_helper_opengl();
return;
}
+#endif
if (s->cc_op != CC_OP_DYNAMIC)
gen_op_set_cc_op(s->cc_op);
Index: qemu-0.14.0/vl.c
===================================================================
--- qemu-0.14.0.orig/vl.c 2011-04-08 16:11:43.000000000 +0800
+++ qemu-0.14.0/vl.c 2011-04-08 16:20:05.000000000 +0800
@@ -229,7 +229,7 @@
unsigned int nb_prom_envs = 0;
const char *prom_envs[MAX_PROM_ENVS];
int boot_menu;
-extern int enable_gl;
+int enable_gl = 0;
typedef struct FWBootEntry FWBootEntry;
@@ -1909,6 +1909,7 @@
return popt;
}
+#define TARGET_OPENGL_OK
int main(int argc, char **argv, char **envp)
{
const char *gdbstub_dev = NULL;
@@ -0,0 +1,55 @@
Enable i386-linux-user
Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
Upstream-Status: Inappropriate [configuration]
Index: qemu-0.14.0/Makefile.target
===================================================================
--- qemu-0.14.0.orig/Makefile.target
+++ qemu-0.14.0/Makefile.target
@@ -78,8 +78,13 @@ ifeq ($(TARGET_BASE_ARCH), i386)
libobj-y += cpuid.o
endif
libobj-$(CONFIG_NEED_MMU) += mmu.o
+ifndef CONFIG_LINUX_USER
libobj-$(TARGET_I386) += helper_opengl.o opengl_exec.o
libobj-$(TARGET_X86_64) += helper_opengl.o opengl_exec.o
+else
+libobj-$(TARGET_I386) += dummygl.o
+libobj-$(TARGET_X86_64) += dummygl.o
+endif #CONFIG_LINUX_USER
libobj-$(TARGET_ARM) += dummygl.o
libobj-$(TARGET_MIPS) += dummygl.o
libobj-$(TARGET_PPC) += dummygl.o
Index: qemu-0.14.0/target-i386/dummygl.c
===================================================================
--- /dev/null
+++ qemu-0.14.0/target-i386/dummygl.c
@@ -0,0 +1,26 @@
+#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)
+{
+
+}
+
+void helper_opengl(void)
+{
+}
@@ -0,0 +1,127 @@
Upstream-Status: Inappropriate [configuration]
Index: qemu-0.14.0/Makefile.target
===================================================================
--- qemu-0.14.0.orig/Makefile.target
+++ qemu-0.14.0/Makefile.target
@@ -79,6 +79,12 @@ libobj-y += cpuid.o
endif
libobj-$(CONFIG_NEED_MMU) += mmu.o
libobj-$(TARGET_I386) += helper_opengl.o opengl_exec.o
+libobj-$(TARGET_X86_64) += helper_opengl.o opengl_exec.o
+libobj-$(TARGET_ARM) += dummygl.o
+libobj-$(TARGET_MIPS) += dummygl.o
+libobj-$(TARGET_MIPS64) += dummygl.o
+libobj-$(TARGET_PPC) += dummygl.o
+libobj-$(TARGET_SH4) += dummygl.o
libobj-$(TARGET_ARM) += neon_helper.o iwmmxt_helper.o
libobj-y += disas.o
Index: qemu-0.14.0/target-arm/dummygl.c
===================================================================
--- /dev/null
+++ qemu-0.14.0/target-arm/dummygl.c
@@ -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)
+{
+
+}
Index: qemu-0.14.0/target-mips/dummygl.c
===================================================================
--- /dev/null
+++ qemu-0.14.0/target-mips/dummygl.c
@@ -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)
+{
+
+}
Index: qemu-0.14.0/target-ppc/dummygl.c
===================================================================
--- /dev/null
+++ qemu-0.14.0/target-ppc/dummygl.c
@@ -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)
+{
+
+}
Index: qemu-0.14.0/target-sh4/dummygl.c
===================================================================
--- /dev/null
+++ qemu-0.14.0/target-sh4/dummygl.c
@@ -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)
+{
+
+}
@@ -0,0 +1,25 @@
Fedora 13 switched the default behaviour of the linker to no longer
indirectly link to required libraries (i.e. dependencies of a library
already linked to). Therefore we need to explicitly pass the depended on
libraries into the linker for building to work on Fedora 13.
More information is available on the Fedora Wiki:
https://fedoraproject.org/wiki/UnderstandingDSOLinkChange
JL - 15/06/10
Upstream-Status: Inappropriate [configuration]
Index: qemu-0.14.0/Makefile.target
===================================================================
--- qemu-0.14.0.orig/Makefile.target
+++ qemu-0.14.0/Makefile.target
@@ -218,7 +218,7 @@ obj-$(CONFIG_REALLY_VIRTFS) += virtio-9p
obj-y += rwhandler.o
obj-$(CONFIG_KVM) += kvm.o kvm-all.o
obj-$(CONFIG_NO_KVM) += kvm-stub.o
-LIBS+=-lz
+LIBS+=-lz -lX11 -ldl
QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
QEMU_CFLAGS += $(VNC_SASL_CFLAGS)
@@ -0,0 +1,15 @@
Upstream-Status: Inappropriate [configuration]
Index: qemu-0.14.0/Makefile
===================================================================
--- qemu-0.14.0.orig/Makefile
+++ qemu-0.14.0/Makefile
@@ -235,7 +235,7 @@ install-sysconfig:
install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig
$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
ifneq ($(TOOLS),)
- $(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
+ $(INSTALL_PROG) $(TOOLS) "$(DESTDIR)$(bindir)"
endif
ifneq ($(BLOBS),)
$(INSTALL_DIR) "$(DESTDIR)$(datadir)"
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,118 @@
# fix VMware VGA driver depth calculation error, which may cause segmentation fault
#
# ktian1, 06/29/2010
Upstream-Status: Pending
Index: qemu-0.14.0/console.h
===================================================================
--- qemu-0.14.0.orig/console.h
+++ qemu-0.14.0/console.h
@@ -171,6 +171,12 @@ struct DisplayAllocator {
void (*free_displaysurface)(DisplaySurface *surface);
};
+struct DisplayPostCallback {
+ void (*postcall) (void *);
+ void *parm;
+ struct DisplayPostCallback *next;
+};
+
struct DisplayState {
struct DisplaySurface *surface;
void *opaque;
@@ -178,6 +184,7 @@ struct DisplayState {
struct DisplayAllocator* allocator;
struct DisplayChangeListener* listeners;
+ struct DisplayPostCallback* postcalls;
void (*mouse_set)(int x, int y, int on);
void (*cursor_define)(QEMUCursor *cursor);
@@ -229,6 +236,12 @@ static inline void register_displaychang
ds->listeners = dcl;
}
+static inline void register_displaypostcallback(DisplayState *ds, DisplayPostCallback *dpc)
+{
+ dpc->next = ds->postcalls;
+ ds->postcalls = dpc;
+}
+
static inline void dpy_update(DisplayState *s, int x, int y, int w, int h)
{
struct DisplayChangeListener *dcl = s->listeners;
Index: qemu-0.14.0/hw/vmware_vga.c
===================================================================
--- qemu-0.14.0.orig/hw/vmware_vga.c
+++ qemu-0.14.0/hw/vmware_vga.c
@@ -1001,8 +1001,9 @@ static void vmsvga_update_display(void *
}
}
-static void vmsvga_reset(struct vmsvga_state_s *s)
+static void vmsvga_reset(void *parm)
{
+ struct vmsvga_state_s *s = (struct vmsvga_state_s *)parm;
s->index = 0;
s->enable = 0;
s->config = 0;
@@ -1207,6 +1208,8 @@ static const VMStateDescription vmstate_
static void vmsvga_init(struct vmsvga_state_s *s, int vga_ram_size)
{
+ DisplayPostCallback *dpc;
+
s->scratch_size = SVGA_SCRATCH_SIZE;
s->scratch = qemu_malloc(s->scratch_size * 4);
@@ -1224,7 +1227,10 @@ static void vmsvga_init(struct vmsvga_st
vga_init(&s->vga);
vmstate_register(NULL, 0, &vmstate_vga_common, &s->vga);
- vmsvga_reset(s);
+ dpc = qemu_mallocz(sizeof(DisplayPostCallback));
+ dpc->postcall = vmsvga_reset;
+ dpc->parm = s;
+ register_displaypostcallback(s->vga.ds, dpc);
}
static void pci_vmsvga_map_ioport(PCIDevice *pci_dev, int region_num,
Index: qemu-0.14.0/qemu-common.h
===================================================================
--- qemu-0.14.0.orig/qemu-common.h
+++ qemu-0.14.0/qemu-common.h
@@ -241,6 +241,7 @@ typedef struct DisplayState DisplayState
typedef struct DisplayChangeListener DisplayChangeListener;
typedef struct DisplaySurface DisplaySurface;
typedef struct DisplayAllocator DisplayAllocator;
+typedef struct DisplayPostCallback DisplayPostCallback;
typedef struct PixelFormat PixelFormat;
typedef struct TextConsole TextConsole;
typedef TextConsole QEMUConsole;
Index: qemu-0.14.0/vl.c
===================================================================
--- qemu-0.14.0.orig/vl.c
+++ qemu-0.14.0/vl.c
@@ -1920,6 +1920,7 @@ int main(int argc, char **argv, char **e
char boot_devices[33] = "cad"; /* default to HD->floppy->CD-ROM */
DisplayState *ds;
DisplayChangeListener *dcl;
+ DisplayPostCallback *dpc;
int cyls, heads, secs, translation;
QemuOpts *hda_opts = NULL, *opts;
QemuOptsList *olist;
@@ -3101,6 +3102,13 @@ int main(int argc, char **argv, char **e
/* display setup */
dpy_resize(ds);
+ dpc = ds->postcalls;
+ while (dpc != NULL) {
+ if (dpc->postcall != NULL)
+ dpc->postcall(dpc->parm);
+ dpc = dpc->next;
+ }
+
dcl = ds->listeners;
while (dcl != NULL) {
if (dcl->dpy_refresh != NULL) {
@@ -0,0 +1,65 @@
Allow releasing the GLXContext/Drawable with glXMakeCurrent.
---
commit d942ed4e853e08d2298f3e11e9a952c1d952bff5
tree f0a934efd8a8ff48e2d96f0d6fc7d70bef106bfe
parent 93619e6be184f8de08759d347825ee0d678a6f9c
author Andrzej Zaborowski <andrew.zaborowski@intel.com> Tue, 16 Jun 2009 22:22:05 +0200
committer Andrzej Zaborowski <andrew.zaborowski@intel.com> Tue, 16 Jun 2009 22:22:05 +0200
target-i386/opengl_exec.c | 31 ++++++++++++++++---------------
1 files changed, 16 insertions(+), 15 deletions(-)
Upstream-Status: Inappropriate [configuration]
Index: qemu-0.14.0/target-i386/opengl_exec.c
===================================================================
--- qemu-0.14.0.orig/target-i386/opengl_exec.c
+++ qemu-0.14.0/target-i386/opengl_exec.c
@@ -1600,10 +1600,9 @@ int do_function_call(int func_number, ar
fprintf(stderr, "client_drawable=%p fake_ctx=%d\n",
(void *) client_drawable, fake_ctxt);
- if (client_drawable == 0 && fake_ctxt == 0) {
+ if (client_drawable == 0 && fake_ctxt == 0)
ret_int = glXMakeCurrent(dpy, 0, NULL);
- process->current_state = &process->default_state;
- } else if ((drawable = (GLXDrawable)
+ else if ((drawable = (GLXDrawable)
get_association_fakepbuffer_pbuffer(
process, client_drawable))) {
GLXContext ctxt = get_association_fakecontext_glxcontext(
@@ -1651,19 +1650,21 @@ int do_function_call(int func_number, ar
}
if (ret_int) {
- for (i = 0; i < process->nb_states; i ++) {
- if (process->glstates[i]->fake_ctxt == fake_ctxt) {
- /* HACK !!! REMOVE */
- process->current_state = process->glstates[i];
- process->current_state->drawable = drawable;
- break;
- }
- }
+ if (fake_ctxt) {
+ for (i = 0; i < process->nb_states; i ++)
+ if (process->glstates[i]->fake_ctxt == fake_ctxt) {
+ /* HACK !!! REMOVE */
+ process->current_state = process->glstates[i];
+ process->current_state->drawable = drawable;
+ break;
+ }
- if (i == process->nb_states) {
- fprintf(stderr, "error remembering the new context\n");
- exit(-1);
- }
+ if (i == process->nb_states) {
+ fprintf(stderr, "error remembering the new context\n");
+ exit(-1);
+ }
+ } else
+ process->current_state = &process->default_state;
}
break;
}
@@ -0,0 +1,73 @@
This patch fix GL application start failure on qemu 0.14.0.
Some turn-on macro/variable are re-arranged, buffer pointer is extended to
support 32/64b combination of target/host.
This is not perfect fix, and we need consider other GL alternatives in future.
Upstream-Status: Inappropriate [other (logical part of qemu-git-qemugl-host.patch)]
Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
Index: qemu-0.14.0/target-i386/opengl_func.h
===================================================================
--- qemu-0.14.0.orig/target-i386/opengl_func.h 2011-04-08 16:43:46.000000000 +0800
+++ qemu-0.14.0/target-i386/opengl_func.h 2011-04-08 16:45:55.000000000 +0800
@@ -26,8 +26,9 @@
#include "mesa_glext.h"
/* Argument list are internally of a type that can hold a target pointer
- * or a host pointer. */
-typedef target_phys_addr_t arg_t;
+ * or a host pointer. If 32b target runs on 64b host, it should be big enough
+ * to hold host pointer */
+typedef long unsigned int arg_t;
enum {
TYPE_NONE,
Index: qemu-0.14.0/target-i386/translate.c
===================================================================
--- qemu-0.14.0.orig/target-i386/translate.c 2011-04-08 16:19:15.000000000 +0800
+++ qemu-0.14.0/target-i386/translate.c 2011-04-08 16:22:03.000000000 +0800
@@ -2652,17 +2652,19 @@
s->is_jmp = DISAS_TB_JUMP;
}
-int enable_gl = 0;
+extern int enable_gl;
/* an interrupt is different from an exception because of the
privilege checks */
static void gen_interrupt(DisasContext *s, int intno,
target_ulong cur_eip, target_ulong next_eip)
{
+#if !defined(CONFIG_USER_ONLY)
if (enable_gl && intno == 0x99) {
gen_helper_opengl();
return;
}
+#endif
if (s->cc_op != CC_OP_DYNAMIC)
gen_op_set_cc_op(s->cc_op);
Index: qemu-0.14.0/vl.c
===================================================================
--- qemu-0.14.0.orig/vl.c 2011-04-08 16:11:43.000000000 +0800
+++ qemu-0.14.0/vl.c 2011-04-08 16:20:05.000000000 +0800
@@ -229,7 +229,7 @@
unsigned int nb_prom_envs = 0;
const char *prom_envs[MAX_PROM_ENVS];
int boot_menu;
-extern int enable_gl;
+int enable_gl = 0;
typedef struct FWBootEntry FWBootEntry;
@@ -1909,6 +1909,7 @@
return popt;
}
+#define TARGET_OPENGL_OK
int main(int argc, char **argv, char **envp)
{
const char *gdbstub_dev = NULL;
@@ -0,0 +1,23 @@
DESCRIPTION = "Qemu helper utilities from Poky"
LICENSE = "GPLv2"
RDEPENDS_${PN} = "qemu-native"
PR = "r1"
LIC_FILES_CHKSUM = "file://${WORKDIR}/tunctl.c;endline=4;md5=ff3a09996bc5fff6bc5d4e0b4c28f999"
FILESPATH = "${FILE_DIRNAME}/qemu-helper"
SRC_URI = "file://tunctl.c"
S = "${WORKDIR}"
inherit native
do_compile() {
${CC} tunctl.c -o tunctl
}
do_install() {
install -d ${D}${bindir}
install tunctl ${D}${bindir}/
}
@@ -0,0 +1,49 @@
SUMMARY = "Qemu helper scripts"
DESCRIPTION = "Qemu helper scripts"
LICENSE = "GPLv2"
RDEPENDS_${PN} = "qemu-nativesdk"
PR = "r9"
FILESPATH = "${FILE_DIRNAME}/qemu-helper"
LIC_FILES_CHKSUM = "file://${WORKDIR}/tunctl.c;endline=4;md5=ff3a09996bc5fff6bc5d4e0b4c28f999 \
file://${COREBASE}/scripts/runqemu;endline=18;md5=77fbe442a88b1bcdc29c3ba67733b21b"
SRC_URI = "file://${COREBASE}/scripts/runqemu \
file://${COREBASE}/scripts/runqemu-internal \
file://${COREBASE}/scripts/runqemu-addptable2image \
file://${COREBASE}/scripts/runqemu-gen-tapdevs \
file://${COREBASE}/scripts/runqemu-ifup \
file://${COREBASE}/scripts/runqemu-ifdown \
file://${COREBASE}/scripts/oe-find-native-sysroot \
file://${COREBASE}/scripts/runqemu-extract-sdk \
file://${COREBASE}/scripts/runqemu-export-rootfs \
file://tunctl.c \
file://raw2flash.c \
"
S = "${WORKDIR}"
inherit nativesdk
do_compile() {
${CC} tunctl.c -o tunctl
${CC} raw2flash.c -o raw2flash.spitz
${CC} raw2flash.c -o flash2raw.spitz -Dflash2raw
}
do_install() {
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}${COREBASE}/scripts/oe-* ${D}${bindir}/
install -m 0755 ${WORKDIR}${COREBASE}/scripts/runqemu* ${D}${bindir}/
install tunctl ${D}${bindir}/
install raw2flash.spitz ${D}${bindir}/
install flash2raw.spitz ${D}${bindir}/
ln -fs raw2flash.spitz ${D}${bindir}/raw2flash.akita
ln -fs raw2flash.spitz ${D}${bindir}/raw2flash.borzoi
ln -fs raw2flash.spitz ${D}${bindir}/raw2flash.terrier
ln -fs flash2raw.spitz ${D}${bindir}/flash2raw.akita
ln -fs flash2raw.spitz ${D}${bindir}/flash2raw.borzoi
ln -fs flash2raw.spitz ${D}${bindir}/flash2raw.terrier
}
@@ -0,0 +1,370 @@
/*
* Copyright (c) 2006 OpenedHand Ltd.
*
* This file is licensed under GNU GPL v2.
*/
#include <string.h>
#include <unistd.h>
#include <stdint.h>
#include <stdio.h>
#include <sys/types.h>
#include <stdlib.h>
#define TFR(_) _
#define VERBOSE
#define PBAR_LEN 40
#define PARTITION_START 0x00700000
static const int ecc_pos8[] = {
0x0, 0x1, 0x2,
};
static const int ecc_pos16[] = {
0x0, 0x1, 0x2, 0x3, 0x6, 0x7,
};
static const int ecc_pos64[] = {
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
};
static const int ecc_akita[] = {
0x05, 0x01, 0x02, 0x03, 0x06, 0x07, 0x15, 0x11,
0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23,
0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37,
};
struct jffs_marker_s {
int pos;
uint8_t value;
};
static const struct jffs_marker_s free_pos8[] = {
{ 0x03, 0xff }, { 0x04, 0xff }, { 0x06, 0x85 }, { 0x07, 0x19 },
{ -1 },
};
static const struct jffs_marker_s free_pos16[] = {
{ 0x08, 0x85 }, { 0x09, 0x19 }, { 0x0a, 0x03 }, { 0x0b, 0x20 },
{ 0x0c, 0x08 }, { 0x0d, 0x00 }, { 0x0e, 0x00 }, { 0x0f, 0x00 },
{ -1 },
};
static const struct jffs_marker_s free_pos64[] = {
{ 0x02, 0xff }, { 0x03, 0xff }, { 0x04, 0xff }, { 0x05, 0xff },
{ 0x06, 0xff }, { 0x07, 0xff }, { 0x08, 0xff }, { 0x09, 0xff },
{ 0x0a, 0xff }, { 0x0b, 0xff }, { 0x0c, 0xff }, { 0x0d, 0xff },
{ 0x0e, 0xff }, { 0x0f, 0xff }, { 0x10, 0x85 }, { 0x11, 0x19 },
{ 0x12, 0x03 }, { 0x13, 0x20 }, { 0x14, 0x08 }, { 0x15, 0x00 },
{ 0x16, 0x00 }, { 0x17, 0x00 }, { 0x18, 0xff }, { 0x19, 0xff },
{ 0x1a, 0xff }, { 0x1b, 0xff }, { 0x1c, 0xff }, { 0x1d, 0xff },
{ 0x1e, 0xff }, { 0x1f, 0xff }, { 0x20, 0xff }, { 0x21, 0xff },
{ 0x22, 0xff }, { 0x23, 0xff }, { 0x24, 0xff }, { 0x25, 0xff },
{ 0x26, 0xff }, { 0x27, 0xff },
{ -1 },
};
static const struct jffs_marker_s free_akita[] = {
{ 0x08, 0x85 }, { 0x09, 0x19 }, { 0x0a, 0x03 }, { 0x0b, 0x20 },
{ 0x0c, 0x08 }, { 0x0d, 0x00 }, { 0x0e, 0x00 }, { 0x0f, 0x00 },
{ 0x10, 0xff },
{ -1 },
};
#define LEN(array) (sizeof(array) / sizeof(*array))
static const struct ecc_style_s {
int page_size;
int oob_size;
int eccbytes;
int eccsize;
const int *eccpos;
int romsize;
const struct jffs_marker_s *freepos;
} spitz = {
0x200, 0x10, 0x100, LEN(ecc_pos16), ecc_pos16, 0x01000000, free_pos16
}, akita = {
0x800, 0x40, 0x100, LEN(ecc_akita), ecc_akita, 0x08000000, free_akita
}, borzoi = {
0x800, 0x40, 0x100, LEN(ecc_akita), ecc_akita, 0x08000000, free_akita
}, terrier = {
0x800, 0x40, 0x100, LEN(ecc_akita), ecc_akita, 0x08000000, free_akita
};
struct ecc_state_s {
int count;
uint8_t cp;
uint8_t lp[2];
const struct ecc_style_s *style;
};
#ifndef flash2raw
/*
* Pre-calculated 256-way 1 byte column parity. Table borrowed from Linux.
*/
static const uint8_t ecc_precalc_table[] = {
0x00, 0x55, 0x56, 0x03, 0x59, 0x0c, 0x0f, 0x5a,
0x5a, 0x0f, 0x0c, 0x59, 0x03, 0x56, 0x55, 0x00,
0x65, 0x30, 0x33, 0x66, 0x3c, 0x69, 0x6a, 0x3f,
0x3f, 0x6a, 0x69, 0x3c, 0x66, 0x33, 0x30, 0x65,
0x66, 0x33, 0x30, 0x65, 0x3f, 0x6a, 0x69, 0x3c,
0x3c, 0x69, 0x6a, 0x3f, 0x65, 0x30, 0x33, 0x66,
0x03, 0x56, 0x55, 0x00, 0x5a, 0x0f, 0x0c, 0x59,
0x59, 0x0c, 0x0f, 0x5a, 0x00, 0x55, 0x56, 0x03,
0x69, 0x3c, 0x3f, 0x6a, 0x30, 0x65, 0x66, 0x33,
0x33, 0x66, 0x65, 0x30, 0x6a, 0x3f, 0x3c, 0x69,
0x0c, 0x59, 0x5a, 0x0f, 0x55, 0x00, 0x03, 0x56,
0x56, 0x03, 0x00, 0x55, 0x0f, 0x5a, 0x59, 0x0c,
0x0f, 0x5a, 0x59, 0x0c, 0x56, 0x03, 0x00, 0x55,
0x55, 0x00, 0x03, 0x56, 0x0c, 0x59, 0x5a, 0x0f,
0x6a, 0x3f, 0x3c, 0x69, 0x33, 0x66, 0x65, 0x30,
0x30, 0x65, 0x66, 0x33, 0x69, 0x3c, 0x3f, 0x6a,
0x6a, 0x3f, 0x3c, 0x69, 0x33, 0x66, 0x65, 0x30,
0x30, 0x65, 0x66, 0x33, 0x69, 0x3c, 0x3f, 0x6a,
0x0f, 0x5a, 0x59, 0x0c, 0x56, 0x03, 0x00, 0x55,
0x55, 0x00, 0x03, 0x56, 0x0c, 0x59, 0x5a, 0x0f,
0x0c, 0x59, 0x5a, 0x0f, 0x55, 0x00, 0x03, 0x56,
0x56, 0x03, 0x00, 0x55, 0x0f, 0x5a, 0x59, 0x0c,
0x69, 0x3c, 0x3f, 0x6a, 0x30, 0x65, 0x66, 0x33,
0x33, 0x66, 0x65, 0x30, 0x6a, 0x3f, 0x3c, 0x69,
0x03, 0x56, 0x55, 0x00, 0x5a, 0x0f, 0x0c, 0x59,
0x59, 0x0c, 0x0f, 0x5a, 0x00, 0x55, 0x56, 0x03,
0x66, 0x33, 0x30, 0x65, 0x3f, 0x6a, 0x69, 0x3c,
0x3c, 0x69, 0x6a, 0x3f, 0x65, 0x30, 0x33, 0x66,
0x65, 0x30, 0x33, 0x66, 0x3c, 0x69, 0x6a, 0x3f,
0x3f, 0x6a, 0x69, 0x3c, 0x66, 0x33, 0x30, 0x65,
0x00, 0x55, 0x56, 0x03, 0x59, 0x0c, 0x0f, 0x5a,
0x5a, 0x0f, 0x0c, 0x59, 0x03, 0x56, 0x55, 0x00,
};
/* Update ECC parity count */
static inline uint8_t ecc_digest(struct ecc_state_s *s, uint8_t sample) {
uint8_t idx = ecc_precalc_table[sample];
s->cp ^= idx & 0x3f;
if (idx & 0x40) {
s->lp[0] ^= ~(s->count & 0xff);
s->lp[1] ^= s->count & 0xff;
}
s->count ++;
return sample;
}
static void buffer_digest(struct ecc_state_s *ecc,
const uint8_t *buf, uint8_t *out) {
int i, lp_a[2];
ecc->lp[0] = 0x00;
ecc->lp[1] = 0x00;
ecc->cp = 0x00;
ecc->count = 0;
for (i = 0; i < ecc->style->eccbytes; i ++)
ecc_digest(ecc, buf[i]);
# define BSHR(byte, from, to) ((ecc->lp[byte] >> (from - to)) & (1 << to))
lp_a[0] =
BSHR(0, 4, 0) | BSHR(0, 5, 2) |
BSHR(0, 6, 4) | BSHR(0, 7, 6) |
BSHR(1, 4, 1) | BSHR(1, 5, 3) |
BSHR(1, 6, 5) | BSHR(1, 7, 7);
# define BSHL(byte, from, to) ((ecc->lp[byte] << (to - from)) & (1 << to))
lp_a[1] =
BSHL(0, 0, 0) | BSHL(0, 1, 2) |
BSHL(0, 2, 4) | BSHL(0, 3, 6) |
BSHL(1, 0, 1) | BSHL(1, 1, 3) |
BSHL(1, 2, 5) | BSHL(1, 3, 7);
out[0] = ~lp_a[1];
out[1] = ~lp_a[0];
out[2] = (~ecc->cp << 2) | 0x03;
}
static void jffs2_format(const struct ecc_state_s *ecc, uint8_t oob[]) {
const struct jffs_marker_s *byte;
for (byte = ecc->style->freepos; byte->pos >= 0; byte ++)
oob[byte->pos] = byte->value;
}
static void buffer_fill(const struct ecc_state_s *ecc, uint8_t buffer[],
int *len, int *partition, int count, uint8_t jffs_buffer[]) {
int ret;
switch (*partition) {
case 0:
if (count < PARTITION_START) {
memcpy(buffer, jffs_buffer + count,
ecc->style->eccbytes);
*len = ecc->style->eccbytes;
break;
}
*partition = 1;
case 1:
if (count - PARTITION_START < PARTITION_START) {
memcpy(buffer, jffs_buffer + count - PARTITION_START,
ecc->style->eccbytes);
*len = ecc->style->eccbytes;
break;
}
while (*len < ecc->style->eccbytes) {
ret = TFR(read(0, buffer + *len, 0x800 - *len));
if (ret <= 0)
break;
*len += ret;
}
if (*len == 0)
*partition = 2;
else if (*len < ecc->style->eccbytes) {
fprintf(stderr, "\nWarning: %i stray bytes\n", *len);
memset(buffer + *len, 0xff,
ecc->style->eccbytes - *len);
*len = ecc->style->eccbytes;
break;
} else
break;
case 2:
memset(buffer, 0xff, ecc->style->eccbytes);
*len = ecc->style->eccbytes;
break;
}
}
int main(int argc, char *argv[], char *envp[]) {
struct ecc_state_s ecc;
uint8_t buffer[0x1000], ecc_payload[0x40], regs[3], *jffs;
int ret, len, eccbyte, count, partition;
/* Check if we're called by "raw2flash.spitz" or similar */
len = strlen(argv[0]);
if (!strcasecmp(argv[0] + len - 5, "akita"))
ecc.style = &akita;
else if (!strcasecmp(argv[0] + len - 6, "borzoi"))
ecc.style = &borzoi;
else if (!strcasecmp(argv[0] + len - 7, "terrier"))
ecc.style = &terrier;
else
ecc.style = &spitz;
# ifdef VERBOSE
fprintf(stderr, "[");
# endif
/* Skip first 10 bytes */
TFR(read(0, buffer, 0x10));
len = 0;
jffs = (uint8_t *) malloc(PARTITION_START);
while (len < PARTITION_START) {
ret = TFR(read(0, jffs + len, PARTITION_START - len));
if (ret <= 0)
break;
len += ret;
}
/* Convert data from stdin */
partition = len = eccbyte = count = 0;
memset(ecc_payload, 0xff, ecc.style->oob_size);
jffs2_format(&ecc, ecc_payload);
while (count < ecc.style->romsize) {
buffer_fill(&ecc, buffer, &len, &partition, count, jffs);
buffer_digest(&ecc, buffer, regs);
ecc_payload[ecc.style->eccpos[eccbyte ++]] = regs[0];
ecc_payload[ecc.style->eccpos[eccbyte ++]] = regs[1];
ecc_payload[ecc.style->eccpos[eccbyte ++]] = regs[2];
TFR(write(1, buffer, ecc.style->eccbytes));
count += ecc.style->eccbytes;
len -= ecc.style->eccbytes;
memmove(buffer, buffer + ecc.style->eccbytes, len);
if (eccbyte >= ecc.style->eccsize) {
TFR(write(1, ecc_payload, ecc.style->oob_size));
eccbyte = 0;
memset(ecc_payload, 0xff, ecc.style->oob_size);
if (partition < 2)
jffs2_format(&ecc, ecc_payload);
}
# ifdef VERBOSE
if (count * PBAR_LEN / ecc.style->romsize >
(count - ecc.style->eccbytes) *
PBAR_LEN / ecc.style->romsize)
fprintf(stderr, "#");
# endif
}
# ifdef VERBOSE
fprintf(stderr, "]\n");
# endif
free(jffs);
return 0;
}
#else
int main(int argc, char *argv[], char *envp[]) {
struct ecc_state_s ecc;
uint8_t buffer[0x1000];
int ret, len, count;
/* Check if we're called by "flash2raw.spitz" or similar */
len = strlen(argv[0]);
if (!strcasecmp(argv[0] + len - 5, "akita"))
ecc.style = &akita;
else if (!strcasecmp(argv[0] + len - 6, "borzoi"))
ecc.style = &borzoi;
else if (!strcasecmp(argv[0] + len - 7, "terrier"))
ecc.style = &terrier;
else
ecc.style = &spitz;
# ifdef VERBOSE
fprintf(stderr, "[");
# endif
/* Convert data from stdin */
count = 0;
while (count < ecc.style->romsize) {
len = 0;
while (len < ecc.style->page_size) {
ret = TFR(read(0, buffer + len,
ecc.style->page_size - len));
if (ret <= 0)
break;
len += ret;
}
if (len == 0)
break;
if (len < ecc.style->page_size) {
fprintf(stderr, "\nWarning: %i stray bytes\n", len);
}
TFR(write(1, buffer, ecc.style->page_size));
count += len;
len = 0;
while (len < ecc.style->oob_size) {
ret = TFR(read(0, buffer, ecc.style->oob_size - len));
if (ret <= 0)
break;
len += ret;
}
# ifdef VERBOSE
if (count * PBAR_LEN / ecc.style->romsize >
(count - ecc.style->page_size) *
PBAR_LEN / ecc.style->romsize)
fprintf(stderr, "#");
# endif
}
# ifdef VERBOSE
fprintf(stderr, "]\n");
# endif
return 0;
}
#endif
@@ -0,0 +1,156 @@
/* Copyright 2002 Jeff Dike
* Licensed under the GPL
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <pwd.h>
#include <grp.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <linux/if_tun.h>
/* TUNSETGROUP appeared in 2.6.23 */
#ifndef TUNSETGROUP
#define TUNSETGROUP _IOW('T', 206, int)
#endif
static void Usage(char *name)
{
fprintf(stderr, "Create: %s [-b] [-u owner] [-g group] [-t device-name] "
"[-f tun-clone-device]\n", name);
fprintf(stderr, "Delete: %s -d device-name [-f tun-clone-device]\n\n",
name);
fprintf(stderr, "The default tun clone device is /dev/net/tun - some systems"
" use\n/dev/misc/net/tun instead\n\n");
fprintf(stderr, "-b will result in brief output (just the device name)\n");
exit(1);
}
int main(int argc, char **argv)
{
struct ifreq ifr;
struct passwd *pw;
struct group *gr;
uid_t owner = -1;
gid_t group = -1;
int tap_fd, opt, delete = 0, brief = 0;
char *tun = "", *file = "/dev/net/tun", *name = argv[0], *end;
while((opt = getopt(argc, argv, "bd:f:t:u:g:")) > 0){
switch(opt) {
case 'b':
brief = 1;
break;
case 'd':
delete = 1;
tun = optarg;
break;
case 'f':
file = optarg;
break;
case 'u':
pw = getpwnam(optarg);
if(pw != NULL){
owner = pw->pw_uid;
break;
}
owner = strtol(optarg, &end, 0);
if(*end != '\0'){
fprintf(stderr, "'%s' is neither a username nor a numeric uid.\n",
optarg);
Usage(name);
}
break;
case 'g':
gr = getgrnam(optarg);
if(gr != NULL){
group = gr->gr_gid;
break;
}
group = strtol(optarg, &end, 0);
if(*end != '\0'){
fprintf(stderr, "'%s' is neither a groupname nor a numeric group.\n",
optarg);
Usage(name);
}
break;
case 't':
tun = optarg;
break;
case 'h':
default:
Usage(name);
}
}
argv += optind;
argc -= optind;
if(argc > 0)
Usage(name);
if((tap_fd = open(file, O_RDWR)) < 0){
fprintf(stderr, "Failed to open '%s' : ", file);
perror("");
exit(1);
}
memset(&ifr, 0, sizeof(ifr));
ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
strncpy(ifr.ifr_name, tun, sizeof(ifr.ifr_name) - 1);
if(ioctl(tap_fd, TUNSETIFF, (void *) &ifr) < 0){
perror("TUNSETIFF");
exit(1);
}
if(delete){
if(ioctl(tap_fd, TUNSETPERSIST, 0) < 0){
perror("disabling TUNSETPERSIST");
exit(1);
}
printf("Set '%s' nonpersistent\n", ifr.ifr_name);
}
else {
/* emulate behaviour prior to TUNSETGROUP */
if(owner == -1 && group == -1) {
owner = geteuid();
}
if(owner != -1) {
if(ioctl(tap_fd, TUNSETOWNER, owner) < 0){
perror("TUNSETOWNER");
exit(1);
}
}
if(group != -1) {
if(ioctl(tap_fd, TUNSETGROUP, group) < 0){
perror("TUNSETGROUP");
exit(1);
}
}
if(ioctl(tap_fd, TUNSETPERSIST, 1) < 0){
perror("enabling TUNSETPERSIST");
exit(1);
}
if(brief)
printf("%s\n", ifr.ifr_name);
else {
printf("Set '%s' persistent and owned by", ifr.ifr_name);
if(owner != -1)
printf(" uid %d", owner);
if(group != -1)
printf(" gid %d", group);
printf("\n");
}
}
return(0);
}
@@ -0,0 +1,18 @@
# possible arch values are arm mips mipsel mips64 mips64el ppc ppc64 ppc64abi32
# ppcemb armeb alpha sparc32plus i386 x86_64 cris m68k microblaze sparc sparc32
# sparc32plus
def get_qemu_target_list(d):
import bb
archs = d.getVar('QEMU_TARGETS', True).split()
targets = ""
for arch in ['mips64', 'mips64el', 'ppcemb']:
if arch in archs:
targets += arch + "-softmmu,"
archs.remove(arch)
for arch in ['armeb', 'alpha', 'ppc64abi32', 'sparc32plus']:
if arch in archs:
targets += arch + "-linux-user,"
archs.remove(arch)
return targets + ''.join([arch + "-linux-user" + "," + arch + "-softmmu" + "," for arch in archs]).rstrip(',')
@@ -0,0 +1,70 @@
DESCRIPTION = "open source processor emulator"
HOMEPAGE = "http://qemu.org"
LICENSE = "GPLv2 & LGPLv2.1"
DEPENDS = "zlib alsa-lib virtual/libx11"
# QEMU_TARGETS is overridable variable
QEMU_TARGETS ?= "arm i386 mips mipsel mips64 mips64el ppc sh4 x86_64"
require qemu-targets.inc
SDL ?= "--disable-sdl"
SDL_virtclass-native ?= ""
SDL_virtclass-nativesdk ?= ""
EXTRA_OECONF += "--target-list=${@get_qemu_target_list(d)} --disable-werror --disable-vnc-tls --audio-drv-list=oss,alsa --audio-card-list=ac97,es1370 ${SDL}"
#EXTRA_OECONF += "--disable-sdl"
inherit autotools
# For our gl powered QEMU you need libGL and SDL headers
do_configure_prepend_virtclass-native() {
libgl='no'
libsdl='no'
test -e /usr/lib/libGL.so -a -e /usr/lib/libGLU.so && libgl='yes'
test -e /usr/lib64/libGL.so -a -e /usr/lib64/libGLU.so && libgl='yes'
test -e /usr/lib/*-linux-gnu/libGL.so -a -e /usr/lib/*-linux-gnu/libGLU.so && libgl='yes'
test -e /usr/lib/pkgconfig/sdl.pc -o -e /usr/lib64/pkgconfig/sdl.pc -o -e /usr/include/SDL/SDL.h && libsdl='yes'
if [ "$libsdl" != 'yes' -o "$libgl" != 'yes' ]; then
echo "You need libGL.so and libGLU.so to exist in your library path and the development headers for SDL installed to build qemu-native.
Ubuntu package names are: libgl1-mesa-dev, libglu1-mesa-dev and libsdl1.2-dev"
exit 1;
fi
}
do_configure() {
# Handle distros such as CentOS 5 32-bit that do not have kvm support
KVMOPTS="--disable-kvm"
if [ "${PN}" != "qemu-native" ] || [ -f /usr/include/linux/kvm.h ] ; then
KVMOPTS="--enable-kvm"
fi
${S}/configure --prefix=${prefix} --sysconfdir=${sysconfdir} --disable-strip ${EXTRA_OECONF} $KVMOPTS
test ! -e ${S}/target-i386/beginend_funcs.sh || chmod a+x ${S}/target-i386/beginend_funcs.sh
}
do_install () {
export STRIP="true"
autotools_do_install
install -d ${D}${datadir}/qemu
install -m 0755 ${WORKDIR}/powerpc_rom.bin ${D}${datadir}/qemu
}
DEPENDS_virtclass-native = "zlib-native alsa-lib-native glib-2.0-native"
DEPENDS_virtclass-nativesdk = "zlib-nativesdk libsdl-nativesdk qemugl-nativesdk glib-2.0-nativesdk"
RDEPENDS_virtclass-nativesdk = "libsdl-nativesdk"
EXTRA_OECONF_virtclass-nativesdk += "--target-list=${@get_qemu_target_list(d)} --disable-werror --disable-vnc-tls"
BBCLASSEXTEND = "native nativesdk"
# Qemu target will not build in world build for ARM or Mips
BROKEN_qemuarm = "1"
BROKEN_qemumips = "1"
INSANE_SKIP_${PN} = "arch"
@@ -0,0 +1,48 @@
require qemu.inc
LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913"
PR = "r6"
FILESPATH = "${FILE_DIRNAME}/qemu-${PV}"
FILESDIR = "${WORKDIR}"
SRC_URI = "\
http://download.savannah.gnu.org/releases/qemu/qemu-${PV}.tar.gz \
file://powerpc_rom.bin \
file://no-strip.patch \
file://linker-flags.patch \
file://qemu-vmware-vga-depth.patch \
file://fix-configure-checks.patch \
file://fallback-to-safe-mmap_min_addr.patch \
file://spice-qxl-locking-fix-for-qemu-kvm.patch \
file://Detect-and-use-GCC-atomic-builtins-for-locking.patch \
file://larger_default_ram_size.patch \
file://arm-bgr.patch \
"
# Only use the GL passthrough patches for native/nativesdk versions
QEMUGLPATCHES = "\
file://qemu-git-qemugl-host.patch \
file://fix-nogl.patch \
file://qemugl-allow-glxcontext-release.patch \
file://init-info.patch \
file://enable-i386-linux-user.patch \
file://qemugl-fix.patch \
file://opengl-sdl-fix.patch \
"
SRC_URI_append_virtclass-native = "\
${QEMUGLPATCHES} \
"
SRC_URI_append_virtclass-nativesdk = "\
${QEMUGLPATCHES} \
file://glflags.patch \
"
SRC_URI[md5sum] = "f9d145d5c09de9f0984ffe9bd1229970"
SRC_URI[sha256sum] = "ba21e84d7853217830e167dae9999cdbff481189c6a0bb600ac7fb7201453108"
S = "${WORKDIR}/qemu-${PV}"
@@ -0,0 +1,45 @@
require qemu.inc
LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913"
PR = "r2"
FILESPATH = "${FILE_DIRNAME}/qemu-${PV}"
FILESDIR = "${WORKDIR}"
SRC_URI = "\
http://wiki.qemu.org/download/qemu-${PV}.tar.gz \
file://powerpc_rom.bin \
file://no-strip.patch \
file://linker-flags.patch \
file://qemu-vmware-vga-depth.patch \
file://fix-configure-checks.patch \
file://fallback-to-safe-mmap_min_addr.patch \
file://larger_default_ram_size.patch \
file://arm-bgr.patch \
"
# Only use the GL passthrough patches for native/nativesdk versions
QEMUGLPATCHES = "\
file://qemu-git-qemugl-host.patch \
file://fix-nogl.patch \
file://qemugl-allow-glxcontext-release.patch \
file://init-info.patch \
file://enable-i386-linux-user.patch \
file://qemugl-fix.patch \
file://opengl-sdl-fix.patch \
"
SRC_URI_append_virtclass-native = "\
${QEMUGLPATCHES} \
"
SRC_URI_append_virtclass-nativesdk = "\
${QEMUGLPATCHES} \
file://glflags.patch \
"
SRC_URI[md5sum] = "34f17737baaf1b3495c89cd6d4a607ed"
SRC_URI[sha256sum] = "7705b14d9b8e4df4a0b1790980e618084261e8daef0672a1aa7a830a0f3db5ba"
S = "${WORKDIR}/qemu-${PV}"
@@ -0,0 +1,28 @@
require qemu.inc
SRCREV = "56a60dd6d619877e9957ba06b92d2f276e3c229d"
LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913"
PV = "0.14.0"
PR = "r3"
FILESPATH = "${FILE_DIRNAME}/qemu-${PV}/:${FILE_DIRNAME}/qemu-git/"
FILESDIR = "${WORKDIR}"
SRC_URI = "\
git://git.qemu.org/qemu.git;protocol=git \
file://qemu-git-qemugl-host.patch \
file://no-strip.patch \
file://fix-nogl.patch \
file://qemugl-allow-glxcontext-release.patch \
file://linker-flags.patch \
file://qemu-vmware-vga-depth.patch \
file://enable-i386-linux-user.patch"
S = "${WORKDIR}/git"
DEFAULT_PREFERENCE = "-1"