xref: /original-bsd/sys/tahoe/vba/psreg.h (revision da818fbb)
1 /*
2  * Copyright (c) 1986 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms are permitted
6  * provided that the above copyright notice and this paragraph are
7  * duplicated in all such forms and that any documentation,
8  * advertising materials, and other materials related to such
9  * distribution and use acknowledge that the software was developed
10  * by the University of California, Berkeley.  The name of the
11  * University may not be used to endorse or promote products derived
12  * from this software without specific prior written permission.
13  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16  *
17  *	@(#)psreg.h	7.3 (Berkeley) 05/09/89
18  */
19 
20 #ifndef _PSREG_
21 #define _PSREG_
22 /*
23  * PS300 definitions.
24  */
25 #ifndef KERNEL
26 #include <sys/ioctl.h>
27 #else
28 #include "ioctl.h"
29 #endif
30 
31 struct  pslookup {
32         int     pl_len;                 /* length of name string */
33         char    *pl_name;               /* address of name string */
34         u_long  pl_addr;                /* symbol's address */
35 };
36 
37 /*
38  * Maximum string which may be supplied for lookup.
39  */
40 #define PS_MAXNAMELEN   256             /* must be <= PSMAXDMA */
41 
42 /*
43  * When doing physical i/o, one may specify the address
44  * and whether or not refresh sync should is required with
45  * a null iovec descriptor (iov_len = 0).
46  */
47 #define PSIO_SYNC       1               /* do physical write w/ refresh sync */
48 
49 /*
50  * Ioctl requests.
51  */
52 #define PSIOGETERROR    _IOR('p', 0, int)                 /* get last error */
53 #define PSIOLOOKUP      _IOWR('p', 1, struct pslookup)    /* do name lookup */
54 #define PSIORWLOGICAL   _IOWR('p', 2, int)                /* set i/o mode */
55 
56 /*
57  * Error codes returned by PSIOGETERROR are either
58  * returned by the PS300 or, from the list below,
59  * generated by the device driver.
60  */
61 #define PSERROR_DIOTIMO         1       /* timeout during dioread/diowrite */
62 #define PSERROR_INVALBC         2       /* invalid byte count for read/write */
63 #define PSERROR_BADADDR         3       /* invalid address for read/write */
64 #define PSERROR_BADCMD          4       /* invalid command in ikstart */
65 #define PSERROR_NAMETIMO        5       /* timeout during nameaddr dioread */
66 #define PSERROR_CMDTIMO         6       /* operation timed out */
67 #endif
68