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,58 @@
Save registers via local variables instead of simple "push", so that gcc become
aware of this operation and avoid stack disorder.
opengl calling (in call_opengl_qemu) includes 4 steps:
1. prepare opengl parameters on stack
2. save some "input" register by push
3. load "input" register with parameters on stack via same index as step 1
4. issue "int 0x99" to trap into qemu, who will get parameter in the registers
New gcc uses "%esp" rather than "%ebp" to index local variable in stack, which
leads wrong index in step 3, as push decrease "%esp" automatically. Saving
registers via local variables to fix it.
Upstream-Status: Pending
Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
Index: git/opengl_client.c
===================================================================
--- git.orig/opengl_client.c 2011-09-19 19:44:51.000000000 +0800
+++ git/opengl_client.c 2011-09-22 10:11:04.000000000 +0800
@@ -1076,23 +1076,29 @@
{
#if defined(__i386__)
int ret;
+ int bx, cx, dx, si;
#ifdef WIN32
__asm__ ("pushl %0;pushl %%fs:0;movl %%esp,%%fs:0;" : : "g" (win32_sigsegv_handler));
#endif
- __asm__ ("push %ebx");
- __asm__ ("push %ecx");
- __asm__ ("push %edx");
- __asm__ ("push %esi");
+ /* save registers before opengl call */
+ __asm__ ("mov %%ebx, %0"::"m"(bx));
+ __asm__ ("mov %%ecx, %0"::"m"(cx));
+ __asm__ ("mov %%edx, %0"::"m"(dx));
+ __asm__ ("mov %%esi, %0"::"m"(si));
+
__asm__ ("mov %0, %%eax"::"m"(func_number));
__asm__ ("mov %0, %%ebx"::"m"(pid));
__asm__ ("mov %0, %%ecx"::"m"(ret_string));
__asm__ ("mov %0, %%edx"::"m"(args));
__asm__ ("mov %0, %%esi"::"m"(args_size));
__asm__ ("int $0x99");
- __asm__ ("pop %esi");
- __asm__ ("pop %edx");
- __asm__ ("pop %ecx");
- __asm__ ("pop %ebx");
+
+ /* restore registers */
+ __asm__ ("mov %0, %%ebx"::"m"(bx));
+ __asm__ ("mov %0, %%ecx"::"m"(cx));
+ __asm__ ("mov %0, %%edx"::"m"(dx));
+ __asm__ ("mov %0, %%esi"::"m"(si));
+
__asm__ ("mov %%eax, %0"::"m"(ret));
#ifdef WIN32
__asm__ ("movl (%%esp),%%ecx;movl %%ecx,%%fs:0;addl $8,%%esp;" : : : "%ecx");
@@ -0,0 +1,21 @@
Remove X11R6 lib directory
"-L/usr/X11R6/lib" is obsolate in poky. Poky currently use Xserver from X.org (X11R7.x), which puts lib in standard /usr/lib, so no need to specify the extra -L/usr/X11R6/lib. Meanwhile, the -L/usr/X11R6/lib will cause warning: library search path "/usr/X11R6/lib" is unsafe for cross-compilation. so better to remove it.
Upstream-Status: Pending
Signed-off-by: Yu Ke <ke.yu@intel.com>
diff --git a/Makefile b/Makefile
index 9e5a8ea..f3a082a 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ GL_CFLAGS := -Wall -g -O2 -fno-strict-aliasing
all: libGL.so.1.2
libGL.so.1.2: client_stub.c opengl_client.c glgetv_cst.h opengl_func.h opengl_utils.h opengl_client_xfonts.c mesa_gl.h mesa_glext.h mesa_glx.h mesa_glxext.h
- $(CC) -fPIC $(GL_CFLAGS) opengl_client.c -shared -o libGL.so.1.2 -lX11 -lXfixes -lm -L$(D)/usr/X11R6/lib -lpthread -I.
+ $(CC) -fPIC $(GL_CFLAGS) opengl_client.c -shared -o libGL.so.1.2 -lX11 -lXfixes -lm -lpthread -I.
opengl_func.h: gl_func.h
@@ -0,0 +1,32 @@
Upstream-Status: Pending
Index: git/Makefile
===================================================================
--- git.orig/Makefile 2009-01-19 23:37:36.000000000 +0000
+++ git/Makefile 2009-06-09 20:30:37.000000000 +0100
@@ -1,9 +1,9 @@
GL_CFLAGS := -Wall -g -O2 -fno-strict-aliasing
-all: libGL.so
+all: libGL.so.1.2
-libGL.so: client_stub.c opengl_client.c glgetv_cst.h opengl_func.h opengl_utils.h opengl_client_xfonts.c mesa_gl.h mesa_glext.h mesa_glx.h mesa_glxext.h
- $(CC) -fPIC $(GL_CFLAGS) opengl_client.c -shared -o libGL.so -lX11 -lXfixes -lm -L$(D)/usr/X11R6/lib -lpthread -I.
+libGL.so.1.2: client_stub.c opengl_client.c glgetv_cst.h opengl_func.h opengl_utils.h opengl_client_xfonts.c mesa_gl.h mesa_glext.h mesa_glx.h mesa_glxext.h
+ $(CC) -fPIC $(GL_CFLAGS) opengl_client.c -shared -o libGL.so.1.2 -lX11 -lXfixes -lm -L$(D)/usr/X11R6/lib -lpthread -I.
opengl_func.h: gl_func.h
Index: git/opengl_client.c
===================================================================
--- git.orig/opengl_client.c 2009-06-09 21:07:15.000000000 +0100
+++ git/opengl_client.c 2009-06-09 21:07:33.000000000 +0100
@@ -11578,7 +11578,7 @@
tab_assoc = calloc(tabSize, sizeof(AssocProcAdress));
#ifndef WIN32
- handle = dlopen(getenv("REAL_LIBGL") ? getenv("REAL_LIBGL") : "libGL.so" ,RTLD_LAZY);
+ handle = dlopen(getenv("REAL_LIBGL") ? getenv("REAL_LIBGL") : "libGL.so.1.2" ,RTLD_LAZY);
if (!handle) {
log_gl("%s\n", dlerror());
exit(1);