Commit f3feceb8 authored by Christophe Massiot's avatar Christophe Massiot

* ALL: x86-64 fixes.

parent 1506a36c
......@@ -141,7 +141,7 @@ static int OpenDecoder( vlc_object_t *p_this )
p_sys->b_skip = 0;
p_sys->b_preroll = VLC_FALSE;
#if defined( __i386__ )
#if defined( __i386__ ) || defined( __x86_64__ )
if( p_dec->p_libvlc->i_cpu & CPU_CAPABILITY_MMX )
{
i_accel |= MPEG2_ACCEL_X86_MMX;
......
......@@ -258,8 +258,8 @@ struct demux_sys_t
static int InitSocket( services_discovery_t *p_sd, char *psz_address, int i_port );
#ifdef HAVE_ZLIB_H
static int Decompress( unsigned char *psz_src, unsigned char **_dst, int i_len );
static void FreeSDP( sdp_t *p_sdp );
#endif
static void FreeSDP( sdp_t *p_sdp );
/* Detect multicast addresses */
static int ismult( char * );
......
......@@ -107,7 +107,7 @@ vlc_module_begin();
set_callbacks( Open, Close );
/* XXX: check for conflicts with the SDL audio output */
var_Create( p_module->p_libvlc, "sdl", VLC_VAR_MUTEX );
#if defined( __i386__ )
#if defined( __i386__ ) || defined( __x86_64__ )
/* On i386, SDL is linked against svgalib */
linked_with_a_crap_library_which_uses_atexit();
#endif
......
......@@ -574,7 +574,7 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
if( !config_GetInt( p_vlc, "fpu" ) )
libvlc.i_cpu &= ~CPU_CAPABILITY_FPU;
#if defined( __i386__ )
#if defined( __i386__ ) || defined( __x86_64__ )
if( !config_GetInt( p_vlc, "mmx" ) )
libvlc.i_cpu &= ~CPU_CAPABILITY_MMX;
if( !config_GetInt( p_vlc, "3dn" ) )
......
......@@ -1165,7 +1165,7 @@ vlc_module_begin();
set_subcategory( SUBCAT_ADVANCED_CPU );
add_category_hint( N_("CPU"), CPU_CAT_LONGTEXT, VLC_TRUE );
add_bool( "fpu", 1, NULL, FPU_TEXT, FPU_LONGTEXT, VLC_TRUE );
#if defined( __i386__ )
#if defined( __i386__ ) || defined( __x86_64__ )
add_bool( "mmx", 1, NULL, MMX_TEXT, MMX_LONGTEXT, VLC_TRUE );
add_bool( "3dn", 1, NULL, THREE_DN_TEXT, THREE_DN_LONGTEXT, VLC_TRUE );
add_bool( "mmxext", 1, NULL, MMXEXT_TEXT, MMXEXT_LONGTEXT, VLC_TRUE );
......
......@@ -52,7 +52,7 @@ static void SigHandler ( int );
#ifdef HAVE_SIGNAL_H
static jmp_buf env;
static int i_illegal;
#if defined( __i386__ )
#if defined( __i386__ ) || defined( __x86_64__ )
static char *psz_capability;
#endif
#endif
......@@ -79,16 +79,16 @@ uint32_t CPUCapabilities( void )
return i_capabilities;
#elif defined( __i386__ )
#elif defined( __i386__ ) || defined( __x86_64__ )
volatile unsigned int i_eax, i_ebx, i_ecx, i_edx;
volatile vlc_bool_t b_amd;
/* Needed for x86 CPU capabilities detection */
# define cpuid( reg ) \
asm volatile ( "pushl %%ebx\n\t" \
asm volatile ( "push %%ebx\n\t" \
"cpuid\n\t" \
"movl %%ebx,%1\n\t" \
"popl %%ebx\n\t" \
"pop %%ebx\n\t" \
: "=a" ( i_eax ), \
"=r" ( i_ebx ), \
"=c" ( i_ecx ), \
......@@ -103,18 +103,17 @@ uint32_t CPUCapabilities( void )
i_capabilities |= CPU_CAPABILITY_FPU;
/* test for a 486 CPU */
asm volatile ( "pushl %%ebx\n\t"
"pushfl\n\t"
"popl %%eax\n\t"
asm volatile ( "push %%ebx\n\t"
"pushf\n\t"
"pop %%eax\n\t"
"movl %%eax, %%ebx\n\t"
"xorl $0x200000, %%eax\n\t"
"pushl %%eax\n\t"
"popfl\n\t"
"pushfl\n\t"
"popl %%eax\n\t"
"push %%eax\n\t"
"popf\n\t"
"pushf\n\t"
"pop %%eax\n\t"
"movl %%ebx,%1\n\t"
"popl %%ebx\n\t"
"pop %%ebx\n\t"
: "=a" ( i_eax ),
"=r" ( i_ebx )
:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment