From 951e32daa473b62acd8774a27cab3e09fa4db6ae Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Sun, 8 Oct 2006 14:02:12 +0000 Subject: 2006-10-08 Thomas Schwinge * linux/dev/drivers/scsi/scsi.h: Move file... * linux/src/drivers/scsi/scsi.h: ... here. --- linux/src/drivers/scsi/scsi.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'linux/src/drivers/scsi') diff --git a/linux/src/drivers/scsi/scsi.h b/linux/src/drivers/scsi/scsi.h index c3dfcd4..13052ba 100644 --- a/linux/src/drivers/scsi/scsi.h +++ b/linux/src/drivers/scsi/scsi.h @@ -591,6 +591,24 @@ static Scsi_Cmnd * end_scsi_request(Scsi_Cmnd * SCpnt, int uptodate, int sectors } #endif +#ifdef MACH +#define SCSI_SLEEP(QUEUE, CONDITION) { \ + if (CONDITION) { \ + struct wait_queue wait = { NULL, NULL}; \ + add_wait_queue(QUEUE, &wait); \ + for(;;) { \ + if (CONDITION) { \ + if (intr_count) \ + panic("scsi: trying to call schedule() in interrupt" \ + ", file %s, line %d.\n", __FILE__, __LINE__); \ + schedule(); \ + } \ + else \ + break; \ + } \ + remove_wait_queue(QUEUE, &wait);\ + }; } +#else /* !MACH */ #define SCSI_SLEEP(QUEUE, CONDITION) { \ if (CONDITION) { \ struct wait_queue wait = { current, NULL}; \ @@ -609,7 +627,7 @@ static Scsi_Cmnd * end_scsi_request(Scsi_Cmnd * SCpnt, int uptodate, int sectors remove_wait_queue(QUEUE, &wait);\ current->state = TASK_RUNNING; \ }; } - +#endif /* !MACH */ #endif /* -- cgit v1.2.3