2 * X680x0 ROM IOCS access definitions.
3 * based on Project C Library X68000 Programing Interface Definition
4 * /usr/include/sys/scsi.h
5 * $Id: scsi.h,v 1.2 2005/12/24 20:07:41 perry Exp $
8 * PROJECT C Library, X68000 PROGRAMMING INTERFACE DEFINITION
9 * --------------------------------------------------------------------
10 * This file is written by the Project C Library Group, and completely
11 * in public domain. You can freely use, copy, modify, and redistribute
12 * the whole contents, without this notice.
13 * --------------------------------------------------------------------
14 * from RCS Id: scsi.h,v 1.3 1994/07/31 17:21:50 mura Exp
17 #ifndef __INLINE_SCSI_H__
18 #define __INLINE_SCSI_H__
29 unsigned char reserve
;
31 unsigned char buff
[0];
34 static inline int _scsi_inquiry (int n
, int id
, struct _inquiry
*buf
)
36 register int reg_d0
__asm ("%d0");
38 __asm
volatile ("moveml %%d3-%%d4,%%sp@-\n\t"
42 "movel #0x20,%%d1\n\t"
43 "movel #0xf5,%%d0\n\t"
45 "moveml %%sp@+,%%d3-%%d4"
46 : "=d" (reg_d0
), "=m" (*buf
)
47 : "ri" (n
), "ri" (id
), "g" ((int) buf
)
48 : "%d1", "%d2", "%a1");
52 static inline int _scsi_modesense (int page
, int n
, int id
, void *buf
)
54 register int reg_d0
__asm ("%d0");
56 __asm
volatile ("moveml %%d3-%%d4,%%sp@-\n\t"
61 "movel #0x29,%%d1\n\t"
62 "movel #0xf5,%%d0\n\t"
64 "moveml %%sp@+,%%d3-%%d4"
65 : "=d" (reg_d0
), "=m" (*(char*) buf
)
66 : "ri" (page
), "ri" (n
), "ri" (id
), "g" ((int) buf
)
67 : "%d1", "%d2", "%a1");
72 static inline int _scsi_read (int pos
, int blk
, int id
, int size
, void *buf
)
74 register int reg_d0
__asm ("%d0");
76 __asm
volatile ("moveml %%d3-%%d5,%%sp@-\n\t"
82 "movel #0x21,%%d1\n\t"
83 "movel #0xf5,%%d0\n\t"
85 "moveml %%sp@+,%%d3-%%d5"
86 : "=d" (reg_d0
), "=m" (*(char*) buf
)
87 : "ri" (pos
), "ri" (blk
), "ri" (id
), "ri" (size
), "g" ((int) buf
)
88 : "%d1", "%d2", "%a1");
93 static inline int _scsi_readcap (int id
, struct _readcap
*buf
)
95 register int reg_d0
__asm ("%d0");
97 __asm
volatile ("moveml %%d4,%%sp@-\n\t"
100 "movel #0x25,%%d1\n\t"
101 "movel #0xf5,%%d0\n\t"
104 : "=d" (reg_d0
), "=m" (*buf
)
105 : "ri" (id
), "g" ((int) buf
)
111 static inline int _scsi_seek (int pos
, int id
)
113 register int reg_d0
__asm ("%d0");
115 __asm
volatile ("moveml %%d4,%%sp@-\n\t"
118 "movel #0x2d,%%d1\n\t"
119 "movel #0xf5,%%d0\n\t"
123 : "ri" (pos
), "ri" (id
)
129 static inline int _scsi_testunit (int id
)
131 register int reg_d0
__asm ("%d0");
133 __asm
volatile ("moveml %%d4,%%sp@-\n\t"
135 "movel #0x24,%%d1\n\t"
136 "movel #0xf5,%%d0\n\t"
146 static inline int _scsi_write (int pos
, int blk
, int id
, int size
, void *buf
)
148 register int reg_d0
__asm ("%d0");
150 __asm
volatile ("moveml %%d3-%%d5,%%sp@-\n\t"
156 "movel #0x22,%%d1\n\t"
157 "movel #0xf5,%%d0\n\t"
159 "moveml %%sp@+,%%d3-%%d5"
161 : "ri" (pos
), "ri" (blk
), "ri" (id
), "ri" (size
), "g" ((int) buf
)
162 : "%d1", "%d2", "%a1");
167 static inline void _scsi_reset (void)
169 __asm
volatile ("movel #0,%%d1\n\t"
170 "movel #0xf5,%%d0\n\t"