]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/setup.c
x86: add periodic corruption check
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / setup.c
index ee89ebc5aabc7679e46bff29db43e062176c0a26..c239b378097395d3270eab23d64a08b92474375f 100644 (file)
@@ -623,6 +623,7 @@ static void __init setup_bios_corruption_check(void)
 }
 
 static int __read_mostly bios_corruption_check = 1;
+static struct timer_list periodic_check_timer;
 
 void check_for_bios_corruption(void)
 {
@@ -650,6 +651,22 @@ void check_for_bios_corruption(void)
                dump_stack();
 }
 
+static void periodic_check_for_corruption(unsigned long data)
+{
+       check_for_bios_corruption();
+       mod_timer(&periodic_check_timer, jiffies + 60*HZ);
+}
+
+void start_periodic_check_for_corruption(void)
+{
+       if (!bios_corruption_check)
+               return;
+
+       init_timer(&periodic_check_timer);
+       periodic_check_timer.function = &periodic_check_for_corruption;
+       periodic_check_for_corruption(0);
+}
+
 static int set_bios_corruption_check(char *arg)
 {
        char *end;