Index: oldkernel/linux/arch/i386/kernel/apm.c
diff -u linux/arch/i386/kernel/apm.c:1.1.1.1 linux/arch/i386/kernel/apm.c:1.2
--- linux/arch/i386/kernel/apm.c:1.1.1.1	Wed May 31 12:33:53 2000
+++ linux/arch/i386/kernel/apm.c	Wed May 31 14:49:03 2000
@@ -133,6 +133,10 @@
 #include <asm/uaccess.h>
 #include <asm/desc.h>
 
+#ifdef CONFIG_RTC
+#include <linux/mc146818rtc.h>
+#endif
+
 EXPORT_SYMBOL(apm_register_callback);
 EXPORT_SYMBOL(apm_unregister_callback);
 
@@ -1286,6 +1290,32 @@
 	}
 }
 
+static void __init apm_sanity_check(void)
+{
+#ifdef CONFIG_RTC
+	/* We cannot turn on the RTC update interrupt on Intel BI440ZX
+	 * MB. Otherwise, the APM power off will reboot the machine
+	 * instead of turn it off. */
+	if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL
+	    && boot_cpu_data.x86 == 6
+	    && boot_cpu_data.x86_model == 6
+	    && boot_cpu_data.x86_cache_size == 128
+	    && apm_bios_info.version == 0x102
+	    && apm_bios_info.flags == 0x3
+	    && apm_bios_info.cseg == 0xf000
+	    && apm_bios_info.offset == 0xef50 
+	    && apm_bios_info.cseg_16 == 0xf000
+	    && apm_bios_info.dseg == 0x40
+	    && apm_bios_info.cseg_len == 0xffff
+	    && apm_bios_info.dseg_len == 0x100
+	    && apm_bios_info.cseg_16_len == 0x1) {
+	    	printk(KERN_INFO "Disable RTC update interrupt on"
+				 " Intel BI440ZX MB for APM.\n");
+		rtc_operation_disabed |= RTC_UPDATE_INTERRUPT_DISABLED;
+	}
+#endif
+}
+
 void __init apm_bios_init(void)
 {
 	unsigned short	bx;
@@ -1471,6 +1501,8 @@
 		ent->get_info = apm_get_info;
 
 	misc_register(&apm_device);
+
+	apm_sanity_check ();
 
 	apm_enabled = 1;
 }
Index: oldkernel/linux/drivers/char/rtc.c
diff -u linux/drivers/char/rtc.c:1.1.1.1 linux/drivers/char/rtc.c:1.2
--- linux/drivers/char/rtc.c:1.1.1.1	Wed May 31 12:33:51 2000
+++ linux/drivers/char/rtc.c	Wed May 31 14:49:03 2000
@@ -102,6 +102,7 @@
 unsigned char rtc_status = 0;		/* bitmapped status byte.	*/
 unsigned long rtc_freq = 0;		/* Current periodic IRQ rate	*/
 unsigned long rtc_irq_data = 0;		/* our output to the world	*/
+unsigned long rtc_operation_disabed = 0;/* Operations disabled. */
 
 /*
  *	If this driver ever becomes modularised, it will be really nice
@@ -193,16 +194,22 @@
 	switch (cmd) {
 	case RTC_AIE_OFF:	/* Mask alarm int. enab. bit	*/
 	{
+		if (rtc_operation_disabed & RTC_ALARM_INTERRUPT_DISABLED)
+			return -EINVAL;
 		mask_rtc_irq_bit(RTC_AIE);
 		return 0;
 	}
 	case RTC_AIE_ON:	/* Allow alarm interrupts.	*/
 	{
+		if (rtc_operation_disabed & RTC_ALARM_INTERRUPT_DISABLED)
+			return -EINVAL;
 		set_rtc_irq_bit(RTC_AIE);
 		return 0;
 	}
 	case RTC_PIE_OFF:	/* Mask periodic int. enab. bit	*/
 	{
+		if (rtc_operation_disabed & RTC_PERIODIC_INTERRUPT_DISABLED)
+			return -EINVAL;
 		mask_rtc_irq_bit(RTC_PIE);
 		if (rtc_status & RTC_TIMER_ON) {
 			del_timer(&rtc_irq_timer);
@@ -213,6 +220,8 @@
 	case RTC_PIE_ON:	/* Allow periodic ints		*/
 	{
 
+		if (rtc_operation_disabed & RTC_PERIODIC_INTERRUPT_DISABLED)
+			return -EINVAL;
 		/*
 		 * We don't really want Joe User enabling more
 		 * than 64Hz of interrupts on a multi-user machine.
@@ -230,11 +239,15 @@
 	}
 	case RTC_UIE_OFF:	/* Mask ints from RTC updates.	*/
 	{
+		if (rtc_operation_disabed & RTC_UPDATE_INTERRUPT_DISABLED)
+			return -EINVAL;
 		mask_rtc_irq_bit(RTC_UIE);
 		return 0;
 	}
 	case RTC_UIE_ON:	/* Allow ints for RTC updates.	*/
 	{
+		if (rtc_operation_disabed & RTC_UPDATE_INTERRUPT_DISABLED)
+			return -EINVAL;
 		set_rtc_irq_bit(RTC_UIE);
 		return 0;
 	}
Index: oldkernel/linux/include/linux/mc146818rtc.h
diff -u linux/include/linux/mc146818rtc.h:1.1.1.1 linux/include/linux/mc146818rtc.h:1.2
--- linux/include/linux/mc146818rtc.h:1.1.1.1	Wed May 31 12:33:49 2000
+++ linux/include/linux/mc146818rtc.h	Wed May 31 14:49:03 2000
@@ -145,5 +145,11 @@
 #define RTC_EPOCH_READ	_IOR('p', 0x0d, unsigned long)	 /* Read epoch      */
 #define RTC_EPOCH_SET	_IOW('p', 0x0e, unsigned long)	 /* Set epoch       */
 
+/* Operations disabled. */
+extern unsigned long rtc_operation_disabed;
+
+#define RTC_ALARM_INTERRUPT_DISABLED	0x0001
+#define RTC_PERIODIC_INTERRUPT_DISABLED	0x0002
+#define RTC_UPDATE_INTERRUPT_DISABLED	0x0004
 
 #endif /* _MC146818RTC_H */
