xref: /csrg-svn/sys/tahoe/vba/psreg.h (revision 33094)
1*33094Sbostic /*	psreg.h	1.2	87/12/22	*/
230224Ssam 
330224Ssam #ifndef _PSREG_
430224Ssam #define _PSREG_
530224Ssam /*
630224Ssam  * PS300 definitions.
730224Ssam  */
830224Ssam #ifndef KERNEL
930224Ssam #include <sys/ioctl.h>
1030224Ssam #else
1130224Ssam #include "../h/ioctl.h"
1230224Ssam #endif
1330224Ssam 
1430224Ssam struct  pslookup {
1530224Ssam         int     pl_len;                 /* length of name string */
1630224Ssam         char    *pl_name;               /* address of name string */
1730224Ssam         u_long  pl_addr;                /* symbol's address */
1830224Ssam };
1930224Ssam 
2030224Ssam /*
2130224Ssam  * Maximum string which may be supplied for lookup.
2230224Ssam  */
2330224Ssam #define PS_MAXNAMELEN   256             /* must be <= PSMAXDMA */
2430224Ssam 
2530224Ssam /*
2630224Ssam  * When doing physical i/o, one may specify the address
2730224Ssam  * and whether or not refresh sync should is required with
2830224Ssam  * a null iovec descriptor (iov_len = 0).
2930224Ssam  */
3030224Ssam #define PSIO_SYNC       1               /* do physical write w/ refresh sync */
3130224Ssam 
3230224Ssam /*
3330224Ssam  * Ioctl requests.
3430224Ssam  */
35*33094Sbostic #define PSIOGETERROR    _IOR('p', 0, int)                 /* get last error */
36*33094Sbostic #define PSIOLOOKUP      _IOWR('p', 1, struct pslookup)    /* do name lookup */
37*33094Sbostic #define PSIORWLOGICAL   _IOWR('p', 2, int)                /* set i/o mode */
3830224Ssam 
3930224Ssam /*
4030224Ssam  * Error codes returned by PSIOGETERROR are either
4130224Ssam  * returned by the PS300 or, from the list below,
4230224Ssam  * generated by the device driver.
4330224Ssam  */
4430224Ssam #define PSERROR_DIOTIMO         1       /* timeout during dioread/diowrite */
4530224Ssam #define PSERROR_INVALBC         2       /* invalid byte count for read/write */
4630224Ssam #define PSERROR_BADADDR         3       /* invalid address for read/write */
4730224Ssam #define PSERROR_BADCMD          4       /* invalid command in ikstart */
4830224Ssam #define PSERROR_NAMETIMO        5       /* timeout during nameaddr dioread */
4930224Ssam #define PSERROR_CMDTIMO         6       /* operation timed out */
5030224Ssam #endif
51