1 #include <linux/config.h> /* CONFIG_HEARTBEAT */
2 #include <linux/errno.h>
3 #include <linux/sched.h>
4 #include <linux/kernel.h>
5 #include <linux/param.h>
6 #include <linux/string.h>
9 #include <asm/machdep.h>
12 #include <linux/timex.h>
14 unsigned long m68k_get_rtc_time(void)
16 unsigned int year
, mon
, day
, hour
, min
, sec
;
18 extern void arch_gettod(int *year
, int *mon
, int *day
, int *hour
,
21 arch_gettod (&year
, &mon
, &day
, &hour
, &min
, &sec
);
23 if ((year
+= 1900) < 1970)
26 return mktime(year
, mon
, day
, hour
, min
, sec
);
29 int m68k_set_rtc_time(unsigned long nowtime
)
31 if (mach_set_clock_mmss
)
32 return mach_set_clock_mmss (nowtime
);
36 void apus_heartbeat (void)
38 #ifdef CONFIG_HEARTBEAT
39 static unsigned cnt
= 0, period
= 0, dist
= 0;
41 if (cnt
== 0 || cnt
== dist
)
43 else if (cnt
== 7 || cnt
== dist
+7)
48 /* The hyperbolic function below modifies the heartbeat period
49 * length in dependency of the current (5min) load. It goes
50 * through the points f(0)=126, f(1)=86, f(5)=51,
52 period
= ((672<<FSHIFT
)/(5*avenrun
[0]+(7<<FSHIFT
))) + 30;
56 /* should be made smarter */
57 ppc_md
.heartbeat_count
= 1;