# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1509  -> 1.1510 
#	   drivers/ide/ide.c	1.104   -> 1.105  
#	drivers/ide/ide-iops.c	1.18    -> 1.19   
#	drivers/ide/ide-disk.c	1.62    -> 1.63   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/12/04	jbarnes@tomahawk.engr.sgi.com	1.1510
# ide hacks
# --------------------------------------------
#
diff -Nru a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
--- a/drivers/ide/ide-disk.c	Thu Dec  4 16:03:53 2003
+++ b/drivers/ide/ide-disk.c	Thu Dec  4 16:03:53 2003
@@ -68,6 +68,9 @@
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <asm/div64.h>
+#ifdef CONFIG_IA64_SGI_SIM
+#include <asm/sn/simulator.h>
+#endif
 
 /* FIXME: some day we shouldn't need to look in here! */
 
@@ -945,6 +948,12 @@
 {
 	ide_task_t args;
 	unsigned long addr = 0;
+
+#ifdef CONFIG_IA64_SGI_SIM
+	if (IS_RUNNING_ON_SIMULATOR() && !(drive->id->command_set_1 & 0x0400) &&
+	    !(drive->id->cfs_enable_2 & 0x0100))
+		return addr;
+#endif
 
 	/* Create IDE/ATA command request structure */
 	memset(&args, 0, sizeof(ide_task_t));
diff -Nru a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
--- a/drivers/ide/ide-iops.c	Thu Dec  4 16:03:53 2003
+++ b/drivers/ide/ide-iops.c	Thu Dec  4 16:03:53 2003
@@ -29,6 +29,9 @@
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <asm/bitops.h>
+#ifdef CONFIG_IA64_SGI_SN
+#include <asm/sn/simulator.h>
+#endif
 
 /*
  *	IDE operator we assign to an unplugged device so that
@@ -1057,7 +1060,12 @@
 	ide_hwif_t *hwif = HWIF(drive);
 	
 	spin_lock_irqsave(&ide_lock, flags);
-	
+
+#ifdef CONFIG_IA64_SGI_SN_SIM
+	        if (IS_RUNNING_ON_SIMULATOR())
+			timeout = 2;
+#endif
+
 	if(hwgroup->handler)
 		BUG();
 	hwgroup->handler	= handler;
diff -Nru a/drivers/ide/ide.c b/drivers/ide/ide.c
--- a/drivers/ide/ide.c	Thu Dec  4 16:03:53 2003
+++ b/drivers/ide/ide.c	Thu Dec  4 16:03:53 2003
@@ -160,6 +160,10 @@
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <asm/bitops.h>
+#ifdef CONFIG_IA64_SGI_SN
+#include <asm/sn/simulator.h>
+#endif
+
 
 
 /* default maximum number of failures */
@@ -1448,6 +1452,10 @@
 void ide_delay_50ms (void)
 {
 #ifndef CONFIG_BLK_DEV_IDECS
+#ifdef CONFIG_IA64_SGI_SN_SIM
+        SIMULATOR_SLEEP();
+	return;
+#endif
 	mdelay(50);
 #else
 	__set_current_state(TASK_UNINTERRUPTIBLE);
