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