2 * arch/sh64/kernel/led.c
4 * Copyright (C) 2002 Stuart Menefy <stuart.menefy@st.com>
6 * May be copied or modified under the terms of the GNU General Public
7 * License. See linux/COPYING for more information.
11 #include <linux/config.h>
12 #include <linux/stddef.h>
13 #include <linux/sched.h>
15 void mach_alphanum(int pos, unsigned char val);
16 void mach_led(int pos, int val);
18 void print_seg(char *file, int line)
23 for (i = 0; i < 5; i++) {
24 mach_alphanum(i, file[i]);
27 for (i = 0; i < 3; i++) {
28 nibble = ((line >> (i * 4)) & 0xf);
29 mach_alphanum(7 - i, nibble + ((nibble > 9) ? 55 : 48));
33 void print_seg_num(unsigned num)
38 for (i = 0; i < 8; i++) {
39 nibble = ((num >> (i * 4)) & 0xf);
41 mach_alphanum(7 - i, nibble + ((nibble > 9) ? 55 : 48));
45 /* acts like an actual heart beat -- ie thump-thump-pause... */
48 static unsigned int cnt = 0, period = 0, dist = 0;
50 if (cnt == 0 || cnt == dist) {
52 } else if (cnt == 7 || cnt == dist + 7) {
60 * The hyperbolic function below modifies the heartbeat period
61 * length in dependency of the current (5min) load. It goes
62 * through the points f(0)=126, f(1)=86, f(5)=51, f(inf)->30.
64 period = ((672 << FSHIFT) / (5 * avenrun[0] +