From 6df85e6083823f3ee592e908099b93ebcf92bc9d Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Mon, 30 Oct 2006 21:52:23 +0000 Subject: [PATCH] Add SCSIStat() --- libmacos/macos/scsi.h | 19 +++++++++++++++++++ libmacos/macos/traps.h | 1 + 2 files changed, 20 insertions(+) diff --git a/libmacos/macos/scsi.h b/libmacos/macos/scsi.h index f865fe3..d21b685 100644 --- a/libmacos/macos/scsi.h +++ b/libmacos/macos/scsi.h @@ -27,6 +27,14 @@ enum { scCompareErr = 6, /* Comparison error from scComp instruction */ }; +enum { + scsiErrorBase = -7936 +}; + +enum { + scsiBusy = scsiErrorBase + 49, +}; + typedef struct TIB { /* Transfer Instruction Block */ short opcode; /* operation code */ int param1; /* 1st parameter */ @@ -107,4 +115,15 @@ static inline OSErr SCSISelect(short targetID) return ret; } + +static inline OSErr SCSIStat(void) +{ + register OSErr ret asm("%%d0"); + + asm("clr.w -(%%sp)\n" + SCSIDispatch(_SCSIStat) + : "=d" (ret) :: UNPRESERVED_REGS ); + + return ret; +} #endif /* __MACOS_SCSI_H__ */ diff --git a/libmacos/macos/traps.h b/libmacos/macos/traps.h index fd9c6a3..5283aa3 100644 --- a/libmacos/macos/traps.h +++ b/libmacos/macos/traps.h @@ -77,6 +77,7 @@ #define _SCSIComplete 0x0004 #define _SCSIRead 0x0005 #define _SCSIWrite 0x0006 +#define _SCSIStat 0x000A #define SCSIDispatchSelector(a) " move.w #"#a", -(%%sp)"