@@ -83,8 +83,8 @@ struct target_termios {
#define TARGET_B9600 0000015
#define TARGET_B19200 0000016
#define TARGET_B38400 0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA TARGET_B19200
+#define TARGET_EXTB TARGET_B38400
#define TARGET_CSIZE 0000060
#define TARGET_CS5 0000000
#define TARGET_CS6 0000020
@@ -83,8 +83,8 @@ struct target_termios {
#define TARGET_B9600 0000015
#define TARGET_B19200 0000016
#define TARGET_B38400 0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA TARGET_B19200
+#define TARGET_EXTB TARGET_B38400
#define TARGET_CSIZE 0000060
#define TARGET_CS5 0000000
#define TARGET_CS6 0000020
@@ -81,8 +81,8 @@ struct target_termios {
#define TARGET_B9600 0000015
#define TARGET_B19200 0000016
#define TARGET_B38400 0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA TARGET_B19200
+#define TARGET_EXTB TARGET_B38400
#define TARGET_CSIZE 0000060
#define TARGET_CS5 0000000
#define TARGET_CS6 0000020
@@ -82,8 +82,8 @@ struct target_termios {
#define TARGET_B9600 0000015
#define TARGET_B19200 0000016
#define TARGET_B38400 0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA TARGET_B19200
+#define TARGET_EXTB TARGET_B38400
#define TARGET_CSIZE 0000060
#define TARGET_CS5 0000000
#define TARGET_CS6 0000020
@@ -82,8 +82,8 @@ struct target_termios {
#define TARGET_B9600 0000015
#define TARGET_B19200 0000016
#define TARGET_B38400 0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA TARGET_B19200
+#define TARGET_EXTB TARGET_B38400
#define TARGET_CSIZE 0000060
#define TARGET_CS5 0000000
#define TARGET_CS6 0000020
@@ -83,8 +83,8 @@ struct target_termios {
#define TARGET_B9600 0000015
#define TARGET_B19200 0000016
#define TARGET_B38400 0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA TARGET_B19200
+#define TARGET_EXTB TARGET_B38400
#define TARGET_CSIZE 0000060
#define TARGET_CS5 0000000
#define TARGET_CS6 0000020
@@ -81,8 +81,8 @@ struct target_termios {
#define TARGET_B9600 0000015
#define TARGET_B19200 0000016
#define TARGET_B38400 0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA TARGET_B19200
+#define TARGET_EXTB TARGET_B38400
#define TARGET_CSIZE 0000060
#define TARGET_CS5 0000000
#define TARGET_CS6 0000020
@@ -83,8 +83,8 @@ struct target_termios {
#define TARGET_B9600 0000015
#define TARGET_B19200 0000016
#define TARGET_B38400 0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA TARGET_B19200
+#define TARGET_EXTB TARGET_B38400
#define TARGET_CSIZE 0000060
#define TARGET_CS5 0000000
#define TARGET_CS6 0000020
@@ -124,8 +124,8 @@ struct target_termios3 {
#define TARGET_B9600 0000015
#define TARGET_B19200 0000016
#define TARGET_B38400 0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA TARGET_B19200
+#define TARGET_EXTB TARGET_B38400
#define TARGET_CSIZE 0000060
#define TARGET_CS5 0000000
#define TARGET_CS6 0000020
@@ -222,7 +222,7 @@ struct target_termios3 {
#define TARGET_TIOCGSOFTCAR 0x5419
#define TARGET_TIOCSSOFTCAR 0x541A
#define TARGET_FIONREAD 0x541B
-#define TARGET_TIOCINQ FIONREAD
+#define TARGET_TIOCINQ TARGET_FIONREAD
#define TARGET_TIOCLINUX 0x541C
#define TARGET_TIOCCONS 0x541D
#define TARGET_TIOCGSERIAL 0x541E
@@ -236,10 +236,10 @@ struct target_termios3 {
#define TARGET_TIOCSBRK 0x5427 /* BSD compatibility */
#define TARGET_TIOCCBRK 0x5428 /* BSD compatibility */
#define TARGET_TIOCGSID 0x5429 /* Return the session ID of FD */
-#define TARGET_TCGETS2 TARGET_IOR('T', 0x2A, struct termios2)
-#define TARGET_TCSETS2 TARGET_IOW('T', 0x2B, struct termios2)
-#define TARGET_TCSETSW2 TARGET_IOW('T', 0x2C, struct termios2)
-#define TARGET_TCSETSF2 TARGET_IOW('T', 0x2D, struct termios2)
+#define TARGET_TCGETS2 TARGET_IOR('T', 0x2A, struct target_termios2)
+#define TARGET_TCSETS2 TARGET_IOW('T', 0x2B, struct target_termios2)
+#define TARGET_TCSETSW2 TARGET_IOW('T', 0x2C, struct target_termios2)
+#define TARGET_TCSETSF2 TARGET_IOW('T', 0x2D, struct target_termios2)
#define TARGET_TIOCGRS485 0x542E
#ifndef TARGET_TIOCSRS485
#define TARGET_TIOCSRS485 0x542F
@@ -107,8 +107,8 @@ struct target_termios {
#define TARGET_B9600 0000015
#define TARGET_B19200 0000016
#define TARGET_B38400 0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA TARGET_B19200
+#define TARGET_EXTB TARGET_B38400
#define TARGET_CBAUDEX 0000000
#define TARGET_B57600 00020
#define TARGET_B115200 00021
@@ -83,8 +83,8 @@ struct target_termios {
#define TARGET_B9600 0000015
#define TARGET_B19200 0000016
#define TARGET_B38400 0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA TARGET_B19200
+#define TARGET_EXTB TARGET_B38400
#define TARGET_CSIZE 0000060
#define TARGET_CS5 0000000
#define TARGET_CS6 0000020
@@ -128,8 +128,8 @@ struct target_ktermios {
#define TARGET_B9600 0000015
#define TARGET_B19200 0000016
#define TARGET_B38400 0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA TARGET_B19200
+#define TARGET_EXTB TARGET_B38400
#define TARGET_CSIZE 0000060
#define TARGET_CS5 0000000
#define TARGET_CS6 0000020
@@ -234,7 +234,7 @@ struct target_ktermios {
#define TARGET_TIOCGSOFTCAR 0x5419
#define TARGET_TIOCSSOFTCAR 0x541A
#define TARGET_FIONREAD 0x541B
-#define TARGET_TIOCINQ FIONREAD
+#define TARGET_TIOCINQ TARGET_FIONREAD
#define TARGET_TIOCLINUX 0x541C
#define TARGET_TIOCCONS 0x541D
#define TARGET_TIOCGSERIAL 0x541E
@@ -248,14 +248,18 @@ struct target_ktermios {
#define TARGET_TIOCSBRK 0x5427 /* BSD compatibility */
#define TARGET_TIOCCBRK 0x5428 /* BSD compatibility */
#define TARGET_TIOCGSID 0x5429 /* Return the session ID of FD */
-#define TARGET_TCGETS2 _IOR('T',0x2A, struct termios2)
-#define TARGET_TCSETS2 _IOW('T',0x2B, struct termios2)
-#define TARGET_TCSETSW2 _IOW('T',0x2C, struct termios2)
-#define TARGET_TCSETSF2 _IOW('T',0x2D, struct termios2)
-#define TARGET_TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
-#define TARGET_TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
-#define TARGET_TIOCGDEV _IOR('T',0x32, unsigned int) /* Get real dev no below /dev/console */
-#define TARGET_TIOCGPTPEER TARGET_IO('T', 0x41) /* Safely open the slave */
+#define TARGET_TCGETS2 TARGET_IOR('T', 0x2A, struct target_termios2)
+#define TARGET_TCSETS2 TARGET_IOW('T', 0x2B, struct target_termios2)
+#define TARGET_TCSETSW2 TARGET_IOW('T', 0x2C, struct target_termios2)
+#define TARGET_TCSETSF2 TARGET_IOW('T', 0x2D, struct target_termios2)
+/* Get Pty Number (of pty-mux device) */
+#define TARGET_TIOCGPTN TARGET_IOR('T', 0x30, unsigned int)
+/* Lock/unlock Pty */
+#define TARGET_TIOCSPTLCK TARGET_IOW('T', 0x31, int)
+/* Get real dev no below /dev/console */
+#define TARGET_TIOCGDEV TARGET_IOR('T', 0x32, unsigned int)
+/* Safely open the slave */
+#define TARGET_TIOCGPTPEER TARGET_IO('T', 0x41)
#define TARGET_FIONCLEX 0x5450 /* these numbers need to be adjusted. */
#define TARGET_FIOCLEX 0x5451
@@ -101,8 +101,8 @@ struct target_termios {
#define TARGET_B9600 0000015
#define TARGET_B19200 0000016
#define TARGET_B38400 0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA TARGET_B19200
+#define TARGET_EXTB TARGET_B38400
#define TARGET_CSIZE 0000060
#define TARGET_CS5 0000000
#define TARGET_CS6 0000020
@@ -109,8 +109,8 @@ struct target_termios {
#define TARGET_B9600 0x0000000d
#define TARGET_B19200 0x0000000e
#define TARGET_B38400 0x0000000f
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA TARGET_B19200
+#define TARGET_EXTB TARGET_B38400
#define TARGET_CSIZE 0x00000030
#define TARGET_CS5 0x00000000
#define TARGET_CS6 0x00000010
@@ -109,8 +109,8 @@ struct target_termios {
#define TARGET_B9600 0x0000000d
#define TARGET_B19200 0x0000000e
#define TARGET_B38400 0x0000000f
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA TARGET_B19200
+#define TARGET_EXTB TARGET_B38400
#define TARGET_CSIZE 0x00000030
#define TARGET_CS5 0x00000000
#define TARGET_CS6 0x00000010
@@ -224,10 +224,14 @@ struct target_termios2 {
#define TARGET_TIOCSBRK 0x5427
#define TARGET_TIOCCBRK 0x5428
#define TARGET_TIOCGSID 0x5429
-#define TARGET_TCGETS2 TARGET_IOR('T', 0x2A, struct termios2)
-#define TARGET_TCSETS2 TARGET_IOW('T', 0x2B, struct termios2)
-#define TARGET_TCSETSW2 TARGET_IOW('T', 0x2C, struct termios2)
-#define TARGET_TCSETSF2 TARGET_IOW('T', 0x2D, struct termios2)
+#define TARGET_TCGETS2 TARGET_IOR('T', 0x2A, \
+ struct target_termios2)
+#define TARGET_TCSETS2 TARGET_IOW('T', 0x2B, \
+ struct target_termios2)
+#define TARGET_TCSETSW2 TARGET_IOW('T', 0x2C, \
+ struct target_termios2)
+#define TARGET_TCSETSF2 TARGET_IOW('T', 0x2D, \
+ struct target_termios2)
#define TARGET_TIOCGRS485 0x542E
#define TARGET_TIOCSRS485 0x542F
#define TARGET_TIOCGPTN TARGET_IOR('T', 0x30, unsigned int)
@@ -6,6 +6,7 @@
typedef unsigned char target_cc_t;
typedef unsigned int target_speed_t;
typedef unsigned int target_tcflag_t;
+
struct target_termios {
target_tcflag_t c_iflag; /* input mode flags */
target_tcflag_t c_oflag; /* output mode flags */
@@ -15,6 +16,17 @@ struct target_termios {
target_cc_t c_cc[TARGET_NCCS]; /* control characters */
};
+struct target_termios2 {
+ target_tcflag_t c_iflag; /* input mode flags */
+ target_tcflag_t c_oflag; /* output mode flags */
+ target_tcflag_t c_cflag; /* control mode flags */
+ target_tcflag_t c_lflag; /* local mode flags */
+ target_cc_t c_line; /* line discipline */
+ target_cc_t c_cc[TARGET_NCCS]; /* control characters */
+ target_speed_t c_ispeed; /* input speed */
+ target_speed_t c_ospeed; /* output speed */
+};
+
/* c_cc characters */
#define TARGET_VINTR 0
#define TARGET_VQUIT 1
@@ -102,8 +114,8 @@ struct target_termios {
#define TARGET_B9600 0000015
#define TARGET_B19200 0000016
#define TARGET_B38400 0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA TARGET_B19200
+#define TARGET_EXTB TARGET_B38400
#define TARGET_CSIZE 0000060
#define TARGET_CS5 0000000
#define TARGET_CS6 0000020
@@ -198,7 +210,7 @@ struct target_termios {
#define TARGET_TIOCGSOFTCAR 0x5419
#define TARGET_TIOCSSOFTCAR 0x541A
#define TARGET_FIONREAD 0x541B
-#define TARGET_TIOCINQ FIONREAD
+#define TARGET_TIOCINQ TARGET_FIONREAD
#define TARGET_TIOCLINUX 0x541C
#define TARGET_TIOCCONS 0x541D
#define TARGET_TIOCGSERIAL 0x541E
@@ -212,10 +224,10 @@ struct target_termios {
#define TARGET_TIOCSBRK 0x5427 /* BSD compatibility */
#define TARGET_TIOCCBRK 0x5428 /* BSD compatibility */
#define TARGET_TIOCGSID 0x5429 /* Return the session ID of FD */
-#define TARGET_TCGETS2 TARGET_IOR('T',0x2A, struct termios2)
-#define TARGET_TCSETS2 TARGET_IOW('T',0x2B, struct termios2)
-#define TARGET_TCSETSW2 TARGET_IOW('T',0x2C, struct termios2)
-#define TARGET_TCSETSF2 TARGET_IOW('T',0x2D, struct termios2)
+#define TARGET_TCGETS2 TARGET_IOR('T', 0x2A, struct target_termios2)
+#define TARGET_TCSETS2 TARGET_IOW('T', 0x2B, struct target_termios2)
+#define TARGET_TCSETSW2 TARGET_IOW('T', 0x2C, struct target_termios2)
+#define TARGET_TCSETSF2 TARGET_IOW('T', 0x2D, struct target_termios2)
#define TARGET_TIOCGPTN TARGET_IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
#define TARGET_TIOCSPTLCK TARGET_IOW('T',0x31, int) /* Lock/unlock Pty */
#define TARGET_TIOCGPTPEER TARGET_IO('T', 0x41) /* Safely open the slave */