[patch] liboil: make oil_cpu_detect_arch() un-static

Robert Schwebel <[email protected]>
Newsgroups gmane.comp.video.gstreamer.announce
Message-ID <20080223001623.GJ25138__17748.8678288229$1203961444$gmane$org@pengutronix.de>
From: Robert Schwebel <[email protected]>

Looks like ARM was forgotten while converting oil_cpu_detect_arch().
Additionally, arm still needs get_rpoc_cpuinfo().

Signed-off-by: Robert Schwebel <[email protected]>

---
 liboil/liboilcpu-arm.c |   35 ++++++++++++++++++++++++++++++-----
 1 file changed, 30 insertions(+), 5 deletions(-)

Index: liboil-0.3.13/liboil/liboilcpu-arm.c
===================================================================
--- liboil-0.3.13.orig/liboil/liboilcpu-arm.c	2008-02-22 20:59:17.000000000 +0100
+++ liboil-0.3.13/liboil/liboilcpu-arm.c	2008-02-23 01:01:48.000000000 +0100
@@ -60,10 +60,6 @@
  *
  */
 
-static void oil_cpu_detect_arch(void);
-
-static unsigned long oil_cpu_flags;
-
 extern unsigned long (*_oil_profile_stamp)(void);
 
 #if defined(__arm__)
@@ -126,6 +122,35 @@
   free (cpuinfo_flags);
 }
 
+static char *
+get_proc_cpuinfo (void)
+{
+  char *cpuinfo;
+  int fd;
+  int n;
+
+  cpuinfo = malloc(4096);
+  if (cpuinfo == NULL) return NULL;
+
+  fd = open("/proc/cpuinfo", O_RDONLY);
+  if (fd < 0) {
+    free (cpuinfo);
+    return NULL;
+  }
+
+  n = read(fd, cpuinfo, 4095);
+  if (n < 0) {
+    free (cpuinfo);
+    close (fd);
+    return NULL;
+  }
+  cpuinfo[n] = 0;
+
+  close (fd);
+
+  return cpuinfo;
+}
+
 static void
 oil_cpu_detect_arm(void)
 {
@@ -249,7 +274,7 @@
 }
 #endif
 
-static void
+void
 oil_cpu_detect_arch(void)
 {
 #if defined(__i386__) || defined(__amd64__)

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.