aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorosa <osa@FreeBSD.org>2003-09-04 16:49:41 +0800
committerosa <osa@FreeBSD.org>2003-09-04 16:49:41 +0800
commit8c66dfe2cb9339a9c0c63715f64e3481b84dfb27 (patch)
tree04b25c071340fac96a47421d58da40f6f9b7c7f1
parentbd864b99d82d1dee3a156cb473a0a8309ac4d494 (diff)
downloadfreebsd-ports-gnome-8c66dfe2cb9339a9c0c63715f64e3481b84dfb27.tar.gz
freebsd-ports-gnome-8c66dfe2cb9339a9c0c63715f64e3481b84dfb27.tar.zst
freebsd-ports-gnome-8c66dfe2cb9339a9c0c63715f64e3481b84dfb27.zip
Fix operate with libkse/libthr (-CURRENT).
Submitted by: deischen Approved by: Thomas E. Zander <riggs@rrr.de> (maintainer) PR: 56358
-rw-r--r--multimedia/mplayer/files/patch-loader-ldt_keeper.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/multimedia/mplayer/files/patch-loader-ldt_keeper.c b/multimedia/mplayer/files/patch-loader-ldt_keeper.c
new file mode 100644
index 000000000000..16c205ff7830
--- /dev/null
+++ b/multimedia/mplayer/files/patch-loader-ldt_keeper.c
@@ -0,0 +1,55 @@
+--- loader/ldt_keeper.c.orig Sun Nov 17 12:41:19 2002
++++ loader/ldt_keeper.c Tue Sep 2 17:55:21 2003
+@@ -88,11 +88,16 @@
+ #define LDT_SEL(idx) ((idx) << 3 | 1 << 2 | 3)
+
+ /* i got this value from wine sources, it's the first free LDT entry */
++#if defined(__FreeBSD__) && defined(LDT_AUTO_ALLOC)
++#define TEB_SEL_IDX LDT_AUTO_ALLOC
++#endif
++
+ #ifndef TEB_SEL_IDX
+ #define TEB_SEL_IDX 17
+ #endif
+
+-#define TEB_SEL LDT_SEL(TEB_SEL_IDX)
++static unsigned int fs_ldt = TEB_SEL_IDX;
++
+
+ /**
+ * here is a small logical problem with Restore for multithreaded programs -
+@@ -104,8 +109,10 @@
+ #endif
+ void Setup_FS_Segment(void)
+ {
++ unsigned int ldt_desc = LDT_SEL(fs_ldt);
++
+ __asm__ __volatile__(
+- "movl %0,%%eax; movw %%ax, %%fs" : : "i" (TEB_SEL)
++ "movl %0,%%eax; movw %%ax, %%fs" : : "r" (ldt_desc)
+ );
+ }
+
+@@ -211,7 +218,13 @@
+ unsigned long d[2];
+
+ LDT_EntryToBytes( d, &array );
++#if defined(__FreeBSD__) && defined(LDT_AUTO_ALLOC)
++ ret = i386_set_ldt(LDT_AUTO_ALLOC, (union descriptor *)d, 1);
++ array.entry_number = ret;
++ fs_ldt = ret;
++#else
+ ret = i386_set_ldt(array.entry_number, (union descriptor *)d, 1);
++#endif
+ if (ret < 0)
+ {
+ perror("install_fs");
+@@ -224,7 +237,7 @@
+ #if defined(__svr4__)
+ {
+ struct ssd ssd;
+- ssd.sel = TEB_SEL;
++ ssd.sel = LDT_SEL(TEB_SEL_IDX);
+ ssd.bo = array.base_addr;
+ ssd.ls = array.limit - array.base_addr;
+ ssd.acc1 = ((array.read_exec_only == 0) << 1) |