OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [asm-or32/] [termios.h] - Diff between revs 1765 and 1782

Only display areas with differences | Details | Blame | View Log

Rev 1765 Rev 1782
#ifndef _OR32_TERMIOS_H
#ifndef _OR32_TERMIOS_H
#define _OR32_TERMIOS_H
#define _OR32_TERMIOS_H
 
 
#include <linux/string.h>
#include <linux/string.h>
#include <asm/termbits.h>
#include <asm/termbits.h>
#include <asm/ioctls.h>
#include <asm/ioctls.h>
 
 
struct winsize {
struct winsize {
        unsigned short ws_row;
        unsigned short ws_row;
        unsigned short ws_col;
        unsigned short ws_col;
        unsigned short ws_xpixel;
        unsigned short ws_xpixel;
        unsigned short ws_ypixel;
        unsigned short ws_ypixel;
};
};
 
 
#define NCC 8
#define NCC 8
struct termio {
struct termio {
        unsigned short c_iflag;         /* input mode flags */
        unsigned short c_iflag;         /* input mode flags */
        unsigned short c_oflag;         /* output mode flags */
        unsigned short c_oflag;         /* output mode flags */
        unsigned short c_cflag;         /* control mode flags */
        unsigned short c_cflag;         /* control mode flags */
        unsigned short c_lflag;         /* local mode flags */
        unsigned short c_lflag;         /* local mode flags */
        unsigned char c_line;           /* line discipline */
        unsigned char c_line;           /* line discipline */
        unsigned char c_cc[NCC];        /* control characters */
        unsigned char c_cc[NCC];        /* control characters */
};
};
 
 
#ifdef __KERNEL__
#ifdef __KERNEL__
/*      intr=^C         quit=^|         erase=del       kill=^U
/*      intr=^C         quit=^|         erase=del       kill=^U
        eof=^D          vtime=\0        vmin=\1         sxtc=\0
        eof=^D          vtime=\0        vmin=\1         sxtc=\0
        start=^Q        stop=^S         susp=^Z         eol=\0
        start=^Q        stop=^S         susp=^Z         eol=\0
        reprint=^R      discard=^U      werase=^W       lnext=^V
        reprint=^R      discard=^U      werase=^W       lnext=^V
        eol2=\0
        eol2=\0
*/
*/
#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
#endif
#endif
 
 
/* modem lines */
/* modem lines */
#define TIOCM_LE        0x001
#define TIOCM_LE        0x001
#define TIOCM_DTR       0x002
#define TIOCM_DTR       0x002
#define TIOCM_RTS       0x004
#define TIOCM_RTS       0x004
#define TIOCM_ST        0x008
#define TIOCM_ST        0x008
#define TIOCM_SR        0x010
#define TIOCM_SR        0x010
#define TIOCM_CTS       0x020
#define TIOCM_CTS       0x020
#define TIOCM_CAR       0x040
#define TIOCM_CAR       0x040
#define TIOCM_RNG       0x080
#define TIOCM_RNG       0x080
#define TIOCM_DSR       0x100
#define TIOCM_DSR       0x100
#define TIOCM_CD        TIOCM_CAR
#define TIOCM_CD        TIOCM_CAR
#define TIOCM_RI        TIOCM_RNG
#define TIOCM_RI        TIOCM_RNG
 
 
/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
 
 
/* line disciplines */
/* line disciplines */
#define N_TTY           0
#define N_TTY           0
#define N_SLIP          1
#define N_SLIP          1
#define N_MOUSE         2
#define N_MOUSE         2
#define N_PPP           3
#define N_PPP           3
#define N_STRIP         4
#define N_STRIP         4
 
 
#ifdef __KERNEL__
#ifdef __KERNEL__
 
 
/*
/*
 * Translate a "termio" structure into a "termios". Ugh.
 * Translate a "termio" structure into a "termios". Ugh.
 */
 */
extern inline void trans_from_termio(struct termio * termio,
extern inline void trans_from_termio(struct termio * termio,
        struct termios * termios)
        struct termios * termios)
{
{
#define SET_LOW_BITS(x,y)       ((x) = (0xffff0000 & (x)) | (y))
#define SET_LOW_BITS(x,y)       ((x) = (0xffff0000 & (x)) | (y))
        SET_LOW_BITS(termios->c_iflag, termio->c_iflag);
        SET_LOW_BITS(termios->c_iflag, termio->c_iflag);
        SET_LOW_BITS(termios->c_oflag, termio->c_oflag);
        SET_LOW_BITS(termios->c_oflag, termio->c_oflag);
        SET_LOW_BITS(termios->c_cflag, termio->c_cflag);
        SET_LOW_BITS(termios->c_cflag, termio->c_cflag);
        SET_LOW_BITS(termios->c_lflag, termio->c_lflag);
        SET_LOW_BITS(termios->c_lflag, termio->c_lflag);
#undef SET_LOW_BITS
#undef SET_LOW_BITS
        memcpy(termios->c_cc, termio->c_cc, NCC);
        memcpy(termios->c_cc, termio->c_cc, NCC);
}
}
 
 
/*
/*
 * Translate a "termios" structure into a "termio". Ugh.
 * Translate a "termios" structure into a "termio". Ugh.
 */
 */
extern inline void trans_to_termio(struct termios * termios,
extern inline void trans_to_termio(struct termios * termios,
        struct termio * termio)
        struct termio * termio)
{
{
        termio->c_iflag = termios->c_iflag;
        termio->c_iflag = termios->c_iflag;
        termio->c_oflag = termios->c_oflag;
        termio->c_oflag = termios->c_oflag;
        termio->c_cflag = termios->c_cflag;
        termio->c_cflag = termios->c_cflag;
        termio->c_lflag = termios->c_lflag;
        termio->c_lflag = termios->c_lflag;
        termio->c_line  = termios->c_line;
        termio->c_line  = termios->c_line;
        memcpy(termio->c_cc, termios->c_cc, NCC);
        memcpy(termio->c_cc, termios->c_cc, NCC);
}
}
 
 
#endif  /* __KERNEL__ */
#endif  /* __KERNEL__ */
 
 
#endif /* _OR32_TERMIOS_H */
#endif /* _OR32_TERMIOS_H */
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.