xref: /csrg-svn/sys/tahoe/vba/psreg.h (revision 45798)
134406Skarels /*
235514Sbostic  * Copyright (c) 1986 The Regents of the University of California.
335514Sbostic  * All rights reserved.
435514Sbostic  *
544534Sbostic  * %sccs.include.redist.c%
635514Sbostic  *
7*45798Sbostic  *	@(#)psreg.h	7.5 (Berkeley) 12/16/90
834406Skarels  */
930224Ssam 
1030224Ssam #ifndef _PSREG_
1130224Ssam #define _PSREG_
1230224Ssam /*
1330224Ssam  * PS300 definitions.
1430224Ssam  */
1530224Ssam #include <sys/ioctl.h>
1630224Ssam 
1730224Ssam struct  pslookup {
1830224Ssam         int     pl_len;                 /* length of name string */
1930224Ssam         char    *pl_name;               /* address of name string */
2030224Ssam         u_long  pl_addr;                /* symbol's address */
2130224Ssam };
2230224Ssam 
2330224Ssam /*
2430224Ssam  * Maximum string which may be supplied for lookup.
2530224Ssam  */
2630224Ssam #define PS_MAXNAMELEN   256             /* must be <= PSMAXDMA */
2730224Ssam 
2830224Ssam /*
2930224Ssam  * When doing physical i/o, one may specify the address
3030224Ssam  * and whether or not refresh sync should is required with
3130224Ssam  * a null iovec descriptor (iov_len = 0).
3230224Ssam  */
3330224Ssam #define PSIO_SYNC       1               /* do physical write w/ refresh sync */
3430224Ssam 
3530224Ssam /*
3630224Ssam  * Ioctl requests.
3730224Ssam  */
3833094Sbostic #define PSIOGETERROR    _IOR('p', 0, int)                 /* get last error */
3933094Sbostic #define PSIOLOOKUP      _IOWR('p', 1, struct pslookup)    /* do name lookup */
4033094Sbostic #define PSIORWLOGICAL   _IOWR('p', 2, int)                /* set i/o mode */
4130224Ssam 
4230224Ssam /*
4330224Ssam  * Error codes returned by PSIOGETERROR are either
4430224Ssam  * returned by the PS300 or, from the list below,
4530224Ssam  * generated by the device driver.
4630224Ssam  */
4730224Ssam #define PSERROR_DIOTIMO         1       /* timeout during dioread/diowrite */
4830224Ssam #define PSERROR_INVALBC         2       /* invalid byte count for read/write */
4930224Ssam #define PSERROR_BADADDR         3       /* invalid address for read/write */
5030224Ssam #define PSERROR_BADCMD          4       /* invalid command in ikstart */
5130224Ssam #define PSERROR_NAMETIMO        5       /* timeout during nameaddr dioread */
5230224Ssam #define PSERROR_CMDTIMO         6       /* operation timed out */
5330224Ssam #endif
54