[vlc-commits] Detect ARMv6 on Linux
Rémi Denis-Courmont
git at videolan.org
Sat Aug 4 17:35:59 CEST 2012
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Aug 4 18:35:28 2012 +0300| [f6c77658e4ccf9683c9a2b61d44517bb5a74e2ef] | committer: Rémi Denis-Courmont
Detect ARMv6 on Linux
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f6c77658e4ccf9683c9a2b61d44517bb5a74e2ef
---
src/posix/linux_cpu.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/posix/linux_cpu.c b/src/posix/linux_cpu.c
index c3ca15b..9c71a6c 100644
--- a/src/posix/linux_cpu.c
+++ b/src/posix/linux_cpu.c
@@ -54,12 +54,17 @@ static void vlc_CPU_init (void)
while (getline (&line, &linelen, info) != -1)
{
- if (strncmp (line, CPU_FLAGS, strlen (CPU_FLAGS)))
- continue;
-
char *p = line, *cap;
uint_fast32_t core_caps = 0;
+#if defined (__arm__)
+ unsigned ver;
+ if (sscanf (line, "Processor\t: ARMv%u", &ver) >= 1 && ver >= 6)
+ core_caps |= VLC_CPU_ARMv6;
+#endif
+ if (strncmp (line, CPU_FLAGS, strlen (CPU_FLAGS)))
+ continue;
+
while ((cap = strsep (&p, " ")) != NULL)
{
#if defined (__arm__)
More information about the vlc-commits
mailing list