Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 1 | From 8d40b4c286e005e82fa50b66fbbbde22b7e65e15 Mon Sep 17 00:00:00 2001 |
| 2 | From: Koen Kooi <koen@dominion.thruhere.net> |
| 3 | Date: Sun, 20 May 2012 21:35:34 +0200 |
| 4 | Subject: [PATCH 1/2] svg: add rudimentary support for ARM cpuinfo |
| 5 | |
| 6 | On ARM /proc/cpuinfo looks like this: |
| 7 | |
| 8 | root@beagleboneA3-0428:~# cat /proc/cpuinfo |
| 9 | Processor : ARMv7 Processor rev 2 (v7l) |
| 10 | BogoMIPS : 498.89 |
| 11 | Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls |
| 12 | CPU implementer : 0x41 |
| 13 | CPU architecture: 7 |
| 14 | CPU variant : 0x3 |
| 15 | CPU part : 0xc08 |
| 16 | CPU revision : 2 |
| 17 | |
| 18 | Hardware : am335xevm |
| 19 | Revision : 0000 |
| 20 | Serial : 0000000000000000 |
| 21 | |
| 22 | So no real way to get the actual SoC name, TI AM3359, but a lot better than 'Unknown' |
| 23 | |
| 24 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> |
| 25 | --- |
| 26 | |
| 27 | Upstream-Status: submitted |
| 28 | |
| 29 | svg.c | 4 ++++ |
| 30 | 1 file changed, 4 insertions(+) |
| 31 | |
| 32 | diff --git a/svg.c b/svg.c |
| 33 | index 80e0292..53724b2 100644 |
| 34 | --- a/svg.c |
| 35 | +++ b/svg.c |
| 36 | @@ -178,6 +178,10 @@ void svg_title(void) |
| 37 | strncpy(cpu, &buf[13], 255); |
| 38 | break; |
| 39 | } |
| 40 | + if (strstr(buf, "Processor")) { |
| 41 | + strncpy(cpu, &buf[12], 255); |
| 42 | + break; |
| 43 | + } |
| 44 | } |
| 45 | fclose(f); |
| 46 | } |
| 47 | -- |
| 48 | 1.7.10 |
| 49 | |