diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-03-09 23:03:14 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-03-09 23:03:14 +0200 |
commit | 36e7a20e695b376287310d602b44d6719f82a021 (patch) | |
tree | 75070d702043e875c947fccaa2de7a419331de22 /loader/ldt_keeper.c | |
parent | 70fb003a9f2d9dc764e320f3ca64b0af1c68fdfb (diff) | |
parent | 93abb4f09229730c30e5bbdd6c54d4b981995eee (diff) | |
download | mpv-36e7a20e695b376287310d602b44d6719f82a021.tar.bz2 mpv-36e7a20e695b376287310d602b44d6719f82a021.tar.xz |
Merge svn changes up to r30550
Diffstat (limited to 'loader/ldt_keeper.c')
-rw-r--r-- | loader/ldt_keeper.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/loader/ldt_keeper.c b/loader/ldt_keeper.c index 35025888ca..c5fa434e80 100644 --- a/loader/ldt_keeper.c +++ b/loader/ldt_keeper.c @@ -43,19 +43,12 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,47) #define modify_ldt_ldt_s user_desc #endif -/* prototype it here, so we won't depend on kernel headers */ -#ifdef __cplusplus -extern "C" { -#endif /// declare modify_ldt with the _syscall3 macro for older glibcs #if defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 0)) _syscall3( int, modify_ldt, int, func, void *, ptr, unsigned long, bytecount ); #else int modify_ldt(int func, void *ptr, unsigned long bytecount); #endif -#ifdef __cplusplus -} -#endif #else #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) #include <machine/segments.h> @@ -69,13 +62,7 @@ int modify_ldt(int func, void *ptr, unsigned long bytecount); /* solaris x86: add missing prototype for sysi86(), but only when sysi86(int, void*) is known to be valid */ #ifdef HAVE_SYSI86_iv -#ifdef __cplusplus -extern "C" { -#endif int sysi86(int, void*); -#ifdef __cplusplus -} -#endif #endif #ifndef NUMSYSLDTS /* SunOS 2.5.1 does not define NUMSYSLDTS */ @@ -127,9 +114,6 @@ static unsigned int fs_ldt = TEB_SEL_IDX; * in C++ we use static class for this... */ -#ifdef __cplusplus -extern "C" -#endif void Setup_FS_Segment(void) { unsigned int ldt_desc = LDT_SEL(fs_ldt); @@ -271,6 +255,9 @@ ldt_fs_t* Setup_LDT_Keeper(void) printf("Couldn't install fs segment, expect segfault\n"); } } +#elif defined(__OS2__) + /* convert flat addr to sel idx for LDT_SEL() */ + fs_ldt = (uintptr_t)fs_seg >> 16; #endif Setup_FS_Segment(); |