]> git.sesse.net Git - vlc/commitdiff
* ALL: x86-64 fixes.
authorChristophe Massiot <massiot@videolan.org>
Fri, 15 Apr 2005 18:06:51 +0000 (18:06 +0000)
committerChristophe Massiot <massiot@videolan.org>
Fri, 15 Apr 2005 18:06:51 +0000 (18:06 +0000)
modules/codec/libmpeg2.c
modules/services_discovery/sap.c
modules/video_output/sdl.c
src/libvlc.c
src/libvlc.h
src/misc/cpu.c

index 167c754b22a2b4b9f4206261865079d6538d83ea..bde31deb766fbd420063629afa83897d0dd1fff6 100644 (file)
@@ -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;
index 193345182aee5b884ef47314a74033fdd8314af6..9259103b6132f724ff9586ac1edc8a05da754269 100644 (file)
@@ -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 * );
index 5935745640b34c559e8b8155fb9a97edf66dcc1a..0ba2cbb989c0109dc09fbd19a2bebdf56db7efe5 100644 (file)
@@ -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
index 5218c81358c99f87ba3f8ce9e4d79e60763f640a..fde02c25202a88aea1ef29f0e2ac739266c9f982 100644 (file)
@@ -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" ) )
index 29564bbc65759de17718c5e7b21645fd8ab2d7a9..501e7f3b7055b5ff3d681ea2138758cba45e51c0 100644 (file)
@@ -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 );
index 6c5a292bf42771cc8355313d2eadb9059abac945..6ee32c3605578f13fa1afe2d816c49cd1edca7de 100644 (file)
@@ -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 )
                  :