libwine: Do not export any of the LDT support on non-i386 platforms.

This commit is contained in:
Alexandre Julliard 2009-12-29 22:18:01 +01:00
parent 82f393dda1
commit 442512d59f
4 changed files with 5 additions and 37 deletions

View File

@ -82,6 +82,8 @@ extern int wine_mmap_is_in_reserved_area( void *addr, size_t size );
extern int wine_mmap_enum_reserved_areas( int (*enum_func)(void *base, size_t size, void *arg), extern int wine_mmap_enum_reserved_areas( int (*enum_func)(void *base, size_t size, void *arg),
void *arg, int top_down ); void *arg, int top_down );
#ifdef __i386__
/* LDT management */ /* LDT management */
extern void wine_ldt_init_locking( void (*lock_func)(void), void (*unlock_func)(void) ); extern void wine_ldt_init_locking( void (*lock_func)(void), void (*unlock_func)(void) );
@ -92,15 +94,9 @@ extern void *wine_ldt_get_ptr( unsigned short sel, unsigned long offset );
extern unsigned short wine_ldt_alloc_entries( int count ); extern unsigned short wine_ldt_alloc_entries( int count );
extern unsigned short wine_ldt_realloc_entries( unsigned short sel, int oldcount, int newcount ); extern unsigned short wine_ldt_realloc_entries( unsigned short sel, int oldcount, int newcount );
extern void wine_ldt_free_entries( unsigned short sel, int count ); extern void wine_ldt_free_entries( unsigned short sel, int count );
#if defined(__i386__) && !defined(__MINGW32__) && !defined(_MSC_VER)
extern unsigned short wine_ldt_alloc_fs(void); extern unsigned short wine_ldt_alloc_fs(void);
extern void wine_ldt_init_fs( unsigned short sel, const LDT_ENTRY *entry ); extern void wine_ldt_init_fs( unsigned short sel, const LDT_ENTRY *entry );
extern void wine_ldt_free_fs( unsigned short sel ); extern void wine_ldt_free_fs( unsigned short sel );
#else /* __i386__ */
static inline unsigned short wine_ldt_alloc_fs(void) { return 0x0b; /* pseudo GDT selector */ }
static inline void wine_ldt_init_fs( unsigned short sel, const LDT_ENTRY *entry ) { }
static inline void wine_ldt_free_fs( unsigned short sel ) { }
#endif /* __i386__ */
/* the local copy of the LDT */ /* the local copy of the LDT */
extern struct __wine_ldt_copy extern struct __wine_ldt_copy
@ -123,9 +119,6 @@ static inline void wine_ldt_set_base( LDT_ENTRY *ent, const void *base )
ent->BaseLow = (WORD)(ULONG_PTR)base; ent->BaseLow = (WORD)(ULONG_PTR)base;
ent->HighWord.Bits.BaseMid = (BYTE)((ULONG_PTR)base >> 16); ent->HighWord.Bits.BaseMid = (BYTE)((ULONG_PTR)base >> 16);
ent->HighWord.Bits.BaseHi = (BYTE)((ULONG_PTR)base >> 24); ent->HighWord.Bits.BaseHi = (BYTE)((ULONG_PTR)base >> 24);
#ifdef _WIN64
ent->BaseHigh = (ULONG_PTR)base >> 32;
#endif
} }
static inline void wine_ldt_set_limit( LDT_ENTRY *ent, unsigned int limit ) static inline void wine_ldt_set_limit( LDT_ENTRY *ent, unsigned int limit )
{ {
@ -136,9 +129,6 @@ static inline void wine_ldt_set_limit( LDT_ENTRY *ent, unsigned int limit )
static inline void *wine_ldt_get_base( const LDT_ENTRY *ent ) static inline void *wine_ldt_get_base( const LDT_ENTRY *ent )
{ {
return (void *)(ent->BaseLow | return (void *)(ent->BaseLow |
#ifdef _WIN64
(ULONG_PTR)ent->BaseHigh << 32 |
#endif
(ULONG_PTR)ent->HighWord.Bits.BaseMid << 16 | (ULONG_PTR)ent->HighWord.Bits.BaseMid << 16 |
(ULONG_PTR)ent->HighWord.Bits.BaseHi << 24); (ULONG_PTR)ent->HighWord.Bits.BaseHi << 24);
} }
@ -171,7 +161,6 @@ static inline int wine_ldt_is_empty( const LDT_ENTRY *ent )
/* segment register access */ /* segment register access */
#ifdef __i386__
# ifdef __MINGW32__ # ifdef __MINGW32__
# define __DEFINE_GET_SEG(seg) \ # define __DEFINE_GET_SEG(seg) \
static inline unsigned short wine_get_##seg(void); \ static inline unsigned short wine_get_##seg(void); \
@ -200,10 +189,6 @@ static inline int wine_ldt_is_empty( const LDT_ENTRY *ent )
# define __DEFINE_GET_SEG(seg) extern unsigned short wine_get_##seg(void); # define __DEFINE_GET_SEG(seg) extern unsigned short wine_get_##seg(void);
# define __DEFINE_SET_SEG(seg) extern void wine_set_##seg(unsigned int); # define __DEFINE_SET_SEG(seg) extern void wine_set_##seg(unsigned int);
# endif /* __GNUC__ || _MSC_VER */ # endif /* __GNUC__ || _MSC_VER */
#else /* __i386__ */
# define __DEFINE_GET_SEG(seg) static inline unsigned short wine_get_##seg(void) { return 0; }
# define __DEFINE_SET_SEG(seg) static inline void wine_set_##seg(int val) { /* nothing */ }
#endif /* __i386__ */
__DEFINE_GET_SEG(cs) __DEFINE_GET_SEG(cs)
__DEFINE_GET_SEG(ds) __DEFINE_GET_SEG(ds)
@ -216,6 +201,8 @@ __DEFINE_SET_SEG(gs)
#undef __DEFINE_GET_SEG #undef __DEFINE_GET_SEG
#undef __DEFINE_SET_SEG #undef __DEFINE_SET_SEG
#endif /* __i386__ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -866,9 +866,6 @@ typedef struct _LDT_ENTRY {
unsigned BaseHi : 8; unsigned BaseHi : 8;
} Bits; } Bits;
} HighWord; } HighWord;
#ifdef _WIN64 /* FIXME: 64-bit code should not be using the LDT */
DWORD BaseHigh;
#endif
} LDT_ENTRY, *PLDT_ENTRY; } LDT_ENTRY, *PLDT_ENTRY;
/* x86-64 context definitions */ /* x86-64 context definitions */

View File

@ -33,7 +33,7 @@
#include "winbase.h" #include "winbase.h"
#include "wine/library.h" #include "wine/library.h"
#ifdef __i386__ #if defined(__i386__) && !defined(__MINGW32__) && !defined(_MSC_VER)
#ifdef __linux__ #ifdef __linux__
@ -118,8 +118,6 @@ static inline int set_thread_area( struct modify_ldt_s *ptr )
#include <i386/user_ldt.h> #include <i386/user_ldt.h>
#endif #endif
#endif /* __i386__ */
/* local copy of the LDT */ /* local copy of the LDT */
#ifdef __APPLE__ #ifdef __APPLE__
struct __wine_ldt_copy wine_ldt_copy = { { 0, 0, 0 } }; struct __wine_ldt_copy wine_ldt_copy = { { 0, 0, 0 } };
@ -190,8 +188,6 @@ static int internal_set_entry( unsigned short sel, const LDT_ENTRY *entry )
if (index < LDT_FIRST_ENTRY) return 0; /* cannot modify reserved entries */ if (index < LDT_FIRST_ENTRY) return 0; /* cannot modify reserved entries */
#ifdef __i386__
#ifdef linux #ifdef linux
{ {
struct modify_ldt_s ldt_info; struct modify_ldt_s ldt_info;
@ -234,8 +230,6 @@ static int internal_set_entry( unsigned short sel, const LDT_ENTRY *entry )
exit(1); exit(1);
#endif #endif
#endif /* __i386__ */
if (ret >= 0) if (ret >= 0)
{ {
wine_ldt_copy.base[index] = wine_ldt_get_base(entry); wine_ldt_copy.base[index] = wine_ldt_get_base(entry);
@ -384,8 +378,6 @@ void wine_ldt_free_entries( unsigned short sel, int count )
} }
#if defined(__i386__) && !defined(__MINGW32__) && !defined(_MSC_VER)
static int global_fs_sel = -1; /* global selector for %fs shared among all threads */ static int global_fs_sel = -1; /* global selector for %fs shared among all threads */
/*********************************************************************** /***********************************************************************

View File

@ -86,14 +86,6 @@ EXPORTS
wine_init wine_init
wine_init_argv0_path wine_init_argv0_path
wine_is_dbcs_leadbyte wine_is_dbcs_leadbyte
wine_ldt_alloc_entries
wine_ldt_free_entries
wine_ldt_get_entry
wine_ldt_get_ptr
wine_ldt_init_locking
wine_ldt_is_system
wine_ldt_realloc_entries
wine_ldt_set_entry
wine_pthread_get_functions wine_pthread_get_functions
wine_pthread_set_functions wine_pthread_set_functions
wine_switch_to_stack wine_switch_to_stack