blob: e0f6889f04b78e9e6d1ba063cf62593248fdecb6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
$NetBSD: patch-ae,v 1.1 2008/02/28 19:28:24 drochner Exp $
--- liboil/liboilcpu-arm.c.orig 2008-02-28 20:07:11.000000000 +0100
+++ liboil/liboilcpu-arm.c
@@ -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 @@ oil_cpu_arm_getflags_cpuinfo (char *cpui
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 @@ oil_cpu_detect_mips(void)
}
#endif
-static void
+void
oil_cpu_detect_arch(void)
{
#if defined(__i386__) || defined(__amd64__)
|