Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
0b4e5d22
Commit
0b4e5d22
authored
Aug 21, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CPU: fprintf is not safe inside a signal handler...
...and VLC does not quite work on Linux 2.2 anymore.
parent
59b1d53f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
21 deletions
+14
-21
src/misc/cpu.c
src/misc/cpu.c
+14
-21
No files found.
src/misc/cpu.c
View file @
0b4e5d22
...
@@ -51,8 +51,15 @@ static void SigHandler ( int );
...
@@ -51,8 +51,15 @@ static void SigHandler ( int );
*****************************************************************************/
*****************************************************************************/
static
jmp_buf
env
;
static
jmp_buf
env
;
static
int
i_illegal
;
static
int
i_illegal
;
#if defined( __i386__ ) || defined( __x86_64__ )
#if defined( __i386__ ) || defined( __x86_64__ )
static
const
char
*
psz_capability
;
static
void
warn_cap
(
const
char
*
psz_capability
)
{
fprintf
(
stderr
,
"warning: your CPU has %s instructions, but not your "
"operating system.
\n
"
,
psz_capability
);
fprintf
(
stderr
,
" some optimizations will be disabled unless "
"you upgrade your OS
\n
"
);
}
#endif
#endif
/*****************************************************************************
/*****************************************************************************
...
@@ -152,7 +159,6 @@ uint32_t CPUCapabilities( void )
...
@@ -152,7 +159,6 @@ uint32_t CPUCapabilities( void )
# ifdef CAN_COMPILE_SSE
# ifdef CAN_COMPILE_SSE
/* We test if OS supports the SSE instructions */
/* We test if OS supports the SSE instructions */
psz_capability
=
"SSE"
;
i_illegal
=
0
;
i_illegal
=
0
;
if
(
setjmp
(
env
)
==
0
)
if
(
setjmp
(
env
)
==
0
)
...
@@ -162,9 +168,9 @@ uint32_t CPUCapabilities( void )
...
@@ -162,9 +168,9 @@ uint32_t CPUCapabilities( void )
}
}
if
(
i_illegal
==
0
)
if
(
i_illegal
==
0
)
{
i_capabilities
|=
CPU_CAPABILITY_SSE
;
i_capabilities
|=
CPU_CAPABILITY_SSE
;
}
else
warn_cap
(
"SSE"
);
# endif
# endif
}
}
...
@@ -172,7 +178,6 @@ uint32_t CPUCapabilities( void )
...
@@ -172,7 +178,6 @@ uint32_t CPUCapabilities( void )
{
{
# if defined(CAN_COMPILE_SSE)
# if defined(CAN_COMPILE_SSE)
/* We test if OS supports the SSE instructions */
/* We test if OS supports the SSE instructions */
psz_capability
=
"SSE2"
;
i_illegal
=
0
;
i_illegal
=
0
;
if
(
setjmp
(
env
)
==
0
)
if
(
setjmp
(
env
)
==
0
)
...
@@ -182,9 +187,9 @@ uint32_t CPUCapabilities( void )
...
@@ -182,9 +187,9 @@ uint32_t CPUCapabilities( void )
}
}
if
(
i_illegal
==
0
)
if
(
i_illegal
==
0
)
{
i_capabilities
|=
CPU_CAPABILITY_SSE2
;
i_capabilities
|=
CPU_CAPABILITY_SSE2
;
}
else
warn_cap
(
"SSE2"
);
# endif
# endif
}
}
...
@@ -200,7 +205,6 @@ uint32_t CPUCapabilities( void )
...
@@ -200,7 +205,6 @@ uint32_t CPUCapabilities( void )
# ifdef CAN_COMPILE_3DNOW
# ifdef CAN_COMPILE_3DNOW
if
(
i_edx
&
0x80000000
)
if
(
i_edx
&
0x80000000
)
{
{
psz_capability
=
"3D Now!"
;
i_illegal
=
0
;
i_illegal
=
0
;
if
(
setjmp
(
env
)
==
0
)
if
(
setjmp
(
env
)
==
0
)
...
@@ -210,9 +214,9 @@ uint32_t CPUCapabilities( void )
...
@@ -210,9 +214,9 @@ uint32_t CPUCapabilities( void )
}
}
if
(
i_illegal
==
0
)
if
(
i_illegal
==
0
)
{
i_capabilities
|=
CPU_CAPABILITY_3DNOW
;
i_capabilities
|=
CPU_CAPABILITY_3DNOW
;
}
else
warn_cap
(
"3D Now!"
);
}
}
# endif
# endif
...
@@ -291,17 +295,6 @@ static void SigHandler( int i_signal )
...
@@ -291,17 +295,6 @@ static void SigHandler( int i_signal )
#else
#else
VLC_UNUSED
(
i_signal
);
VLC_UNUSED
(
i_signal
);
#endif
#endif
#if defined( __i386__ )
fprintf
(
stderr
,
"warning: your CPU has %s instructions, but not your "
"operating system.
\n
"
,
psz_capability
);
fprintf
(
stderr
,
" some optimizations will be disabled unless "
"you upgrade your OS
\n
"
);
# if defined( __linux__ )
fprintf
(
stderr
,
" (for instance Linux kernel 2.4.x or later)
\n
"
);
# endif
#endif
longjmp
(
env
,
1
);
longjmp
(
env
,
1
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment