xref: /csrg-svn/sys/tahoe/vba/psreg.h (revision 37752)
134406Skarels /*
235514Sbostic  * Copyright (c) 1986 The Regents of the University of California.
335514Sbostic  * All rights reserved.
435514Sbostic  *
535514Sbostic  * Redistribution and use in source and binary forms are permitted
635514Sbostic  * provided that the above copyright notice and this paragraph are
735514Sbostic  * duplicated in all such forms and that any documentation,
835514Sbostic  * advertising materials, and other materials related to such
935514Sbostic  * distribution and use acknowledge that the software was developed
1035514Sbostic  * by the University of California, Berkeley.  The name of the
1135514Sbostic  * University may not be used to endorse or promote products derived
1235514Sbostic  * from this software without specific prior written permission.
1335514Sbostic  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
1435514Sbostic  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
1535514Sbostic  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1635514Sbostic  *
17*37752Smckusick  *	@(#)psreg.h	7.3 (Berkeley) 05/09/89
1834406Skarels  */
1930224Ssam 
2030224Ssam #ifndef _PSREG_
2130224Ssam #define _PSREG_
2230224Ssam /*
2330224Ssam  * PS300 definitions.
2430224Ssam  */
2530224Ssam #ifndef KERNEL
2630224Ssam #include <sys/ioctl.h>
2730224Ssam #else
28*37752Smckusick #include "ioctl.h"
2930224Ssam #endif
3030224Ssam 
3130224Ssam struct  pslookup {
3230224Ssam         int     pl_len;                 /* length of name string */
3330224Ssam         char    *pl_name;               /* address of name string */
3430224Ssam         u_long  pl_addr;                /* symbol's address */
3530224Ssam };
3630224Ssam 
3730224Ssam /*
3830224Ssam  * Maximum string which may be supplied for lookup.
3930224Ssam  */
4030224Ssam #define PS_MAXNAMELEN   256             /* must be <= PSMAXDMA */
4130224Ssam 
4230224Ssam /*
4330224Ssam  * When doing physical i/o, one may specify the address
4430224Ssam  * and whether or not refresh sync should is required with
4530224Ssam  * a null iovec descriptor (iov_len = 0).
4630224Ssam  */
4730224Ssam #define PSIO_SYNC       1               /* do physical write w/ refresh sync */
4830224Ssam 
4930224Ssam /*
5030224Ssam  * Ioctl requests.
5130224Ssam  */
5233094Sbostic #define PSIOGETERROR    _IOR('p', 0, int)                 /* get last error */
5333094Sbostic #define PSIOLOOKUP      _IOWR('p', 1, struct pslookup)    /* do name lookup */
5433094Sbostic #define PSIORWLOGICAL   _IOWR('p', 2, int)                /* set i/o mode */
5530224Ssam 
5630224Ssam /*
5730224Ssam  * Error codes returned by PSIOGETERROR are either
5830224Ssam  * returned by the PS300 or, from the list below,
5930224Ssam  * generated by the device driver.
6030224Ssam  */
6130224Ssam #define PSERROR_DIOTIMO         1       /* timeout during dioread/diowrite */
6230224Ssam #define PSERROR_INVALBC         2       /* invalid byte count for read/write */
6330224Ssam #define PSERROR_BADADDR         3       /* invalid address for read/write */
6430224Ssam #define PSERROR_BADCMD          4       /* invalid command in ikstart */
6530224Ssam #define PSERROR_NAMETIMO        5       /* timeout during nameaddr dioread */
6630224Ssam #define PSERROR_CMDTIMO         6       /* operation timed out */
6730224Ssam #endif
68