xref: /netbsd-src/sys/arch/hppa/stand/common/dev_hppa.h (revision 6d3ceb1d619615401b17c9aa3e4bc674a1cb048b)
1*6d3ceb1dSskrll /*	$NetBSD: dev_hppa.h,v 1.1 2014/02/24 07:23:43 skrll Exp $	*/
2*6d3ceb1dSskrll 
3*6d3ceb1dSskrll /*	$OpenBSD: dev_hppa.h,v 1.3 1999/04/20 20:01:01 mickey Exp $	*/
4*6d3ceb1dSskrll 
5*6d3ceb1dSskrll 
6*6d3ceb1dSskrll #define IOPGSHIFT	11
7*6d3ceb1dSskrll #define	IONBPG		(1 << IOPGSHIFT)
8*6d3ceb1dSskrll #define IOPGOFSET	(IONBPG - 1)
9*6d3ceb1dSskrll 
10*6d3ceb1dSskrll struct disklabel;
11*6d3ceb1dSskrll struct hppa_dev {
12*6d3ceb1dSskrll 	btdev_t	bootdev;
13*6d3ceb1dSskrll 	struct pz_device *pz_dev;	/* device descriptor */
14*6d3ceb1dSskrll 	u_long	last_blk;		/* byte offset for last read blk */
15*6d3ceb1dSskrll 	size_t	last_read;		/* amount read last time */
16*6d3ceb1dSskrll 	u_long	part_off;		/* byte offset of boot partition */
17*6d3ceb1dSskrll 	/* buffer to cache data (aligned properly) */
18*6d3ceb1dSskrll 	char	*buf;
19*6d3ceb1dSskrll 	char	ua_buf[IODC_MAXIOSIZ + IODC_MINIOSIZ];
20*6d3ceb1dSskrll 
21*6d3ceb1dSskrll };
22*6d3ceb1dSskrll 
23*6d3ceb1dSskrll #ifdef PDCDEBUG
24*6d3ceb1dSskrll #define	DEVPATH_PRINT(dp) \
25*6d3ceb1dSskrll 	printf("%x, %d.%d.%d.%d.%d.%d, 0x%x, %x.%x.%x.%x.%x.%x\n", \
26*6d3ceb1dSskrll 	       (dp)->dp_flags, (dp)->dp_bc[0], (dp)->dp_bc[1], (dp)->dp_bc[2], \
27*6d3ceb1dSskrll 	       (dp)->dp_bc[3], (dp)->dp_bc[4], (dp)->dp_bc[5], (dp)->dp_mod, \
28*6d3ceb1dSskrll 	       (dp)->dp_layers[0], (dp)->dp_layers[1], (dp)->dp_layers[2], \
29*6d3ceb1dSskrll 	       (dp)->dp_layers[3], (dp)->dp_layers[4], (dp)->dp_layers[5]);
30*6d3ceb1dSskrll #define	PZDEV_PRINT(dp) \
31*6d3ceb1dSskrll 	printf("devpath={%x, %d.%d.%d.%d.%d.%d, 0x%x, %x.%x.%x.%x.%x.%x}," \
32*6d3ceb1dSskrll 	       "\n\thpa=%p, spa=%p, io=%p, class=%u\n", \
33*6d3ceb1dSskrll 	       (dp)->pz_flags, (dp)->pz_bc[0], (dp)->pz_bc[1], (dp)->pz_bc[2], \
34*6d3ceb1dSskrll 	       (dp)->pz_bc[3], (dp)->pz_bc[4], (dp)->pz_bc[5], (dp)->pz_mod, \
35*6d3ceb1dSskrll 	       (dp)->pz_layers[0], (dp)->pz_layers[1], (dp)->pz_layers[2], \
36*6d3ceb1dSskrll 	       (dp)->pz_layers[3], (dp)->pz_layers[4], (dp)->pz_layers[5], \
37*6d3ceb1dSskrll 	       (dp)->pz_hpa, (dp)->pz_spa, (dp)->pz_iodc_io, (dp)->pz_class);
38*6d3ceb1dSskrll #endif
39*6d3ceb1dSskrll 
40*6d3ceb1dSskrll extern pdcio_t pdc;
41*6d3ceb1dSskrll extern int pdcbuf[];			/* PDC returns, pdc.c */
42*6d3ceb1dSskrll extern struct  pz_device ctdev;		/* cartridge tape (boot) device path */
43*6d3ceb1dSskrll 
44*6d3ceb1dSskrll int iodc_rw(char *, u_int, u_int, int func, struct pz_device *);
45