]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/9/bcm/devarch.c
devarch: restrict i/o port access to 64K, disallow msr 32-bit wrap arround (thanks...
[plan9front.git] / sys / src / 9 / bcm / devarch.c
index 3ef0cdc089f1a40dbef05f755602ec7c27fbac4c..a9b51c2730fed0ab251fee8386207696c63fb658 100644 (file)
@@ -156,8 +156,17 @@ cputyperead(Chan*, void *a, long n, vlong offset)
        return readstr(offset, a, n, str);
 }
 
+static long
+cputempread(Chan*, void *a, long n, vlong offset)
+{
+       char str[128];
+       snprint(str, sizeof str, "%d±%d\n", gettemp(0) / 1000, 1);
+       return readstr(offset, a, n, str);
+}
+
 void
 archinit(void)
 {
        addarchfile("cputype", 0444, cputyperead, nil);
+       addarchfile("cputemp", 0444, cputempread, nil);
 }