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
|
--- includes/os/class.Linux.inc.php.orig 2005-04-02 06:55:28.000000000 +0000
+++ includes/os/class.Linux.inc.php 2005-04-02 06:55:50.000000000 +0000
@@ -176,6 +176,38 @@
fclose($fd);
}
+ // sparc64 specific code follows
+ // This adds the ability to display the cache that a CPU has
+ // Originally made by Sven Blumenstein <bazik@gentoo.org> in 2004
+ // Modified by Tom Weustink <freshy98@gmx.net> in 2004
+
+ if ($fd = fopen('/proc/openprom/SUNW,UltraSPARC@0,0/ecache-size', 'r')) {
+ $results['cache'] = base_convert(fgets($fd, 32), 16, 10)/1024 . ' KB';
+ fclose($fd);
+ }
+
+ if ($fd = fopen('/proc/openprom/SUNW,UltraSPARC-II@0,0/ecache-size', 'r')) {
+ $results['cache'] = base_convert(fgets($fd, 32), 16, 10)/1024 . ' KB';
+ fclose($fd);
+ }
+
+ if ($fd = fopen('/proc/openprom/SUNW,UltraSPARC@1c,0/ecache-size', 'r')) {
+ $results['cache'] = base_convert(fgets($fd, 32), 16, 10)/1024 . ' KB';
+ fclose($fd);
+ }
+
+ if ($fd = fopen('/proc/openprom/SUNW,UltraSPARC-IIi@1c,0/ecache-size', 'r')) {
+ $results['cache'] = base_convert(fgets($fd, 32), 16, 10)/1024 . ' KB';
+ fclose($fd);
+ }
+
+ if ($fd = fopen('/proc/openprom/SUNW,UltraSPARC-II@1c,0/ecache-size', 'r')) {
+ $results['cache'] = base_convert(fgets($fd, 32), 16, 10)/1024 . ' KB';
+ fclose($fd);
+ }
+
+ // sparc64 specific code ends
+
$keys = array_keys($results);
$keys2be = array('model', 'mhz', 'cache', 'bogomips', 'cpus');
|