/*
 * Copyright (c) 1996-2003 MIPS Technologies, Inc.
 * 
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 
 *      * Redistributions of source code must retain the above copyright
 *        notice, this list of conditions and the following disclaimer.
 *      * Redistributions in binary form must reproduce the above
 *      copyright
 *        notice, this list of conditions and the following disclaimer
 *        in the documentation and/or other materials provided with
 *        the distribution.
 *      * Neither the name of MIPS Technologies Inc. nor the names of its
 *        contributors may be used to endorse or promote products derived
 *        from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * lsi/termio.h: ioctl/ttctl definitions for LSI PMON 
 */


#ifndef _LSI_TERMIO_H
#define _LSI_TERMIO_H

/* operation codes for ioctl */
#define TCGETA		1
#define TCSETAF		2
#define TCSETAW		3
/* SDE setjmp() incompatible with LSI */
/*#define SETINTR		4*/
#define SETSANE		5
#define FIONREAD	6
/*#define GETINTR		7*/
#define GETTERM		8
#define SETTERM		9
#define SETNCNE		10
#define CBREAK		11
#define TERMTYPE	12

/* iflags */
#define ISTRIP		0x0020
#define ICRNL		0x0040
#define IXON		0x0400
#define IXANY		0x0800
#define IXOFF		0x1000

/* oflags */
#define ONLCR		0x0004

/* lflags */
#define ISIG   		0x0001
#define ICANON		0x0002
#define ECHO		0x0008
#define ECHOE		0x0010

/* cflags */
#define	CBAUD		0000017		
#define	B0		0000000
#define	B50		0000001	
#define	B75		0000002
#define	B110		0000003
#define	B134		0000004
#define	B150		0000005
#define	B200		0000006
#define	B300		0000007
#define	B600		0000010
#define	B1200		0000011
#define	B1800		0000012
#define	B2400		0000013
#define	B4800		0000014
#define	B9600		0000015
#define	B19200		0000016
#define	B38400		0000017

/* cc definitions */
#define VINTR		0
#define VERASE		2
#define VEOL		5
#define VEOL2		6
#define V_START		8
#define V_STOP		9

/* operation codes for ttctl */
#define TT_CM		1	/* cursor movement */
#define TT_CLR		2	/* clear screen */
#define TT_CUROFF	3	/* switch cursor off */
#define TT_CURON	4	/* switch cursor on */

#ifndef __ASSEMBLER__

#define CNTRL(x) 	(x&0x1f)

#define NCC 23
struct termio {
    unsigned short	c_iflag;
    unsigned short	c_oflag;
    unsigned short	c_cflag;
    unsigned short	c_lflag;
    unsigned char	c_cc[NCC];
};

#endif /* !ASSEMBLER */

#endif /* _LSI_TERMIO_H */
