summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2001-10-19 08:18:31 +0000
committermarcel <marcel@FreeBSD.org>2001-10-19 08:18:31 +0000
commitcde63d9d91871bb8092bf245f7da47d201194bf2 (patch)
tree8fa2c5154215ce7d27ad45a299be106bec1aca76 /sys/compat
parent1b131bca2f74efdc3627f5ad1fce812c67b57975 (diff)
downloadFreeBSD-src-cde63d9d91871bb8092bf245f7da47d201194bf2.zip
FreeBSD-src-cde63d9d91871bb8092bf245f7da47d201194bf2.tar.gz
Fix Alpha related brokenness. We used to have a MD linux_ioctl.h
that appeared to be very different from the MI version. These differences were mostly bogus and caused by copying octal definitions and write them as hexadecimal values without doing any base conversion (ie 010 was copied to 0x10). After filtering out these differences, any remaining (real) incompatibilities have been merged into the MI header file to make them more visible. While here, fix the termios <-> termio conversion WRT to the c_cc field for Alpha. The termios values do not match the termio values and thus prevents us from copying. By eliminating the Alpha MD copy of linux_ioctl.h we also fixed the recent build breakage caused by putting new bits in the MI header and not in the MD header.
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linux/linux_ioctl.c36
-rw-r--r--sys/compat/linux/linux_ioctl.h181
2 files changed, 209 insertions, 8 deletions
diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c
index e81448d..1164063 100644
--- a/sys/compat/linux/linux_ioctl.c
+++ b/sys/compat/linux/linux_ioctl.c
@@ -55,11 +55,7 @@
#include <machine/../linux/linux.h>
#include <machine/../linux/linux_proto.h>
-#ifdef __alpha__
-#include <machine/../linux/linux_ioctl.h>
-#else
#include <compat/linux/linux_ioctl.h>
-#endif
#include <compat/linux/linux_mib.h>
#include <compat/linux/linux_util.h>
@@ -497,7 +493,20 @@ bsd_to_linux_termio(struct termios *bios, struct linux_termio *lio)
lio->c_cflag = lios.c_cflag;
lio->c_lflag = lios.c_lflag;
lio->c_line = lios.c_line;
+#ifdef __alpha__
+ lio->c_cc[LINUX__VINTR] = lios.c_cc[LINUX_VINTR];
+ lio->c_cc[LINUX__VQUIT] = lios.c_cc[LINUX_VQUIT];
+ lio->c_cc[LINUX__VERASE] = lios.c_cc[LINUX_VERASE];
+ lio->c_cc[LINUX__VKILL] = lios.c_cc[LINUX_VKILL];
+ lio->c_cc[LINUX__VEOF] =
+ lios.c_cc[(lios.c_lflag & ICANON) ? LINUX_VEOF : LINUX_VMIN];
+ lio->c_cc[LINUX__VEOL] =
+ lios.c_cc[(lios.c_lflag & ICANON) ? LINUX_VEOL : LINUX_VTIME];
+ lio->c_cc[LINUX__VEOL2] = lios.c_cc[LINUX_VEOL2];
+ lio->c_cc[LINUX__VSWTC] = lios.c_cc[LINUX_VSWTC];
+#else
memcpy(lio->c_cc, lios.c_cc, LINUX_NCC);
+#endif
}
static void
@@ -510,9 +519,24 @@ linux_to_bsd_termio(struct linux_termio *lio, struct termios *bios)
lios.c_oflag = lio->c_oflag;
lios.c_cflag = lio->c_cflag;
lios.c_lflag = lio->c_lflag;
+#ifdef __alpha__
+ for (i=0; i<LINUX_NCCS; i++)
+ lios.c_cc[i] = LINUX_POSIX_VDISABLE;
+ lios.c_cc[LINUX_VINTR] = lio->c_cc[LINUX__VINTR];
+ lios.c_cc[LINUX_VQUIT] = lio->c_cc[LINUX__VQUIT];
+ lios.c_cc[LINUX_VERASE] = lio->c_cc[LINUX__VERASE];
+ lios.c_cc[LINUX_VKILL] = lio->c_cc[LINUX__VKILL];
+ lios.c_cc[LINUX_VEOL2] = lio->c_cc[LINUX__VEOL2];
+ lios.c_cc[LINUX_VSWTC] = lio->c_cc[LINUX__VSWTC];
+ lios.c_cc[(lio->c_lflag & ICANON) ? LINUX_VEOF : LINUX_VMIN] =
+ lio->c_cc[LINUX__VEOF];
+ lios.c_cc[(lio->c_lflag & ICANON) ? LINUX_VEOL : LINUX_VTIME] =
+ lio->c_cc[LINUX__VEOL];
+#else
for (i=LINUX_NCC; i<LINUX_NCCS; i++)
lios.c_cc[i] = LINUX_POSIX_VDISABLE;
memcpy(lios.c_cc, lio->c_cc, LINUX_NCC);
+#endif
linux_to_bsd_termios(&lios, bios);
}
@@ -1344,7 +1368,7 @@ linux_ifname(struct ifnet *ifp, char *name, size_t size)
* bsdname and lxname need to be least IFNAMSIZ bytes long, but
* can point to the same buffer.
*/
-
+#if 0
static struct ifnet *
ifname_bsd_to_linux(const char *bsdname, char *lxname)
{
@@ -1370,6 +1394,7 @@ ifname_bsd_to_linux(const char *bsdname, char *lxname)
return (ifp);
}
+#endif
/*
* Translate a Linux interface name to a FreeBSD interface name,
@@ -1377,7 +1402,6 @@ ifname_bsd_to_linux(const char *bsdname, char *lxname)
* bsdname and lxname need to be least IFNAMSIZ bytes long, but
* can point to the same buffer.
*/
-
static struct ifnet *
ifname_linux_to_bsd(const char *lxname, char *bsdname)
{
diff --git a/sys/compat/linux/linux_ioctl.h b/sys/compat/linux/linux_ioctl.h
index 2e3a06c..f933d67 100644
--- a/sys/compat/linux/linux_ioctl.h
+++ b/sys/compat/linux/linux_ioctl.h
@@ -1,4 +1,4 @@
-/*-
+/*
* Copyright (c) 1999 Marcel Moolenaar
* All rights reserved.
*
@@ -216,6 +216,19 @@
/*
* termio
*/
+#ifdef __alpha__
+#define LINUX_TCGETS 0x7413
+#define LINUX_TCSETS 0x7414
+#define LINUX_TCSETSW 0x7415
+#define LINUX_TCSETSF 0x7416
+#define LINUX_TCGETA 0x7417
+#define LINUX_TCSETA 0x7418
+#define LINUX_TCSETAW 0x7419
+#define LINUX_TCSETAF 0x741c
+#define LINUX_TCSBRK 0x741d
+#define LINUX_TCXONC 0x741e
+#define LINUX_TCFLSH 0x741f
+#else
#define LINUX_TCGETS 0x5401
#define LINUX_TCSETS 0x5402
#define LINUX_TCSETSW 0x5403
@@ -227,45 +240,86 @@
#define LINUX_TCSBRK 0x5409
#define LINUX_TCXONC 0x540A
#define LINUX_TCFLSH 0x540B
+#endif
+
#define LINUX_TIOCEXCL 0x540C
#define LINUX_TIOCNXCL 0x540D
#define LINUX_TIOCSCTTY 0x540E
+
+#ifdef __alpha__
+#define LINUX_TIOCSPGRP 0x7476
+#define LINUX_TIOCGPGRP 0x7477
+#else
#define LINUX_TIOCGPGRP 0x540F
#define LINUX_TIOCSPGRP 0x5410
+#endif
+
#define LINUX_TIOCOUTQ 0x5411
#define LINUX_TIOCSTI 0x5412
+
+#ifdef __alpha__
+#define LINUX_TIOCSWINSZ 0x7467
+#define LINUX_TIOCGWINSZ 0x7468
+#else
#define LINUX_TIOCGWINSZ 0x5413
#define LINUX_TIOCSWINSZ 0x5414
+#endif
+
#define LINUX_TIOCMGET 0x5415
#define LINUX_TIOCMBIS 0x5416
#define LINUX_TIOCMBIC 0x5417
#define LINUX_TIOCMSET 0x5418
#define LINUX_TIOCGSOFTCAR 0x5419
#define LINUX_TIOCSSOFTCAR 0x541A
+
+#ifdef __alpha__
+#define LINUX_FIONREAD 0x667f
+#else
#define LINUX_FIONREAD 0x541B
+#endif
+
#define LINUX_TIOCINQ FIONREAD
#define LINUX_TIOCLINUX 0x541C
#define LINUX_TIOCCONS 0x541D
#define LINUX_TIOCGSERIAL 0x541E
#define LINUX_TIOCSSERIAL 0x541F
#define LINUX_TIOCPKT 0x5420
+
+#ifdef __alpha__
+#define LINUX_FIONBIO 0x667e
+#else
#define LINUX_FIONBIO 0x5421
+#endif
+
#define LINUX_TIOCNOTTY 0x5422
#define LINUX_TIOCSETD 0x5423
#define LINUX_TIOCGETD 0x5424
#define LINUX_TCSBRKP 0x5425
#define LINUX_TIOCTTYGSTRUCT 0x5426
+
+#ifdef __alpha__
+#define LINUX_FIOCLEX 0x6601
+#define LINUX_FIONCLEX 0x6602
+#define LINUX_FIOASYNC 0x667d
+#else
#define LINUX_FIONCLEX 0x5450
#define LINUX_FIOCLEX 0x5451
#define LINUX_FIOASYNC 0x5452
+#endif
+
#define LINUX_TIOCSERCONFIG 0x5453
#define LINUX_TIOCSERGWILD 0x5454
#define LINUX_TIOCSERSWILD 0x5455
#define LINUX_TIOCGLCKTRMIOS 0x5456
#define LINUX_TIOCSLCKTRMIOS 0x5457
+#ifdef __alpha__
+#define LINUX_IOCTL_TERMIO_MIN LINUX_TIOCEXCL
+#define LINUX_IOCTL_TERMIO_MAX LINUX_TIOCGPGRP
+#else
#define LINUX_IOCTL_TERMIO_MIN LINUX_TCGETS
#define LINUX_IOCTL_TERMIO_MAX LINUX_TIOCSLCKTRMIOS
+#endif
/* arguments for tcflow() and LINUX_TCXONC */
#define LINUX_TCOOFF 0
@@ -285,6 +339,18 @@
#define LINUX_N_PPP 3
/* Linux termio c_cc values */
+#ifdef __alpha__
+#define LINUX__VINTR 0
+#define LINUX__VQUIT 1
+#define LINUX__VERASE 2
+#define LINUX__VKILL 3
+#define LINUX__VEOF 4
+#define LINUX__VMIN 4
+#define LINUX__VEOL 5
+#define LINUX__VTIME 5
+#define LINUX__VEOL2 6
+#define LINUX__VSWTC 7
+#else
#define LINUX_VINTR 0
#define LINUX_VQUIT 1
#define LINUX_VERASE 2
@@ -293,9 +359,30 @@
#define LINUX_VTIME 5
#define LINUX_VMIN 6
#define LINUX_VSWTC 7
+#endif
#define LINUX_NCC 8
/* Linux termios c_cc values */
+#ifdef __alpha__
+#define LINUX_VEOF 0
+#define LINUX_VEOL 1
+#define LINUX_VEOL2 2
+#define LINUX_VERASE 3
+#define LINUX_VWERASE 4
+#define LINUX_VKILL 5
+#define LINUX_VREPRINT 6
+#define LINUX_VSWTC 7
+#define LINUX_VINTR 8
+#define LINUX_VQUIT 9
+#define LINUX_VSUSP 10
+#define LINUX_VSTART 12
+#define LINUX_VSTOP 13
+#define LINUX_VLNEXT 14
+#define LINUX_VDISCARD 15
+#define LINUX_VMIN 16
+#define LINUX_VTIME 17
+#else
+/* In addition to the termio values */
#define LINUX_VSTART 8
#define LINUX_VSTOP 9
#define LINUX_VSUSP 10
@@ -305,6 +392,7 @@
#define LINUX_VWERASE 14
#define LINUX_VLNEXT 15
#define LINUX_VEOL2 16
+#endif
#define LINUX_NCCS 19
#define LINUX_POSIX_VDISABLE '\0'
@@ -319,23 +407,66 @@
#define LINUX_INLCR 0x0000040
#define LINUX_IGNCR 0x0000080
#define LINUX_ICRNL 0x0000100
+
+#ifdef __alpha__
+#define LINUX_IXON 0x0000200
+#define LINUX_IXOFF 0x0000400
+#define LINUX_IXANY 0x0000800
+#define LINUX_IUCLC 0x0001000
+#else
#define LINUX_IUCLC 0x0000200
#define LINUX_IXON 0x0000400
#define LINUX_IXANY 0x0000800
#define LINUX_IXOFF 0x0001000
+#endif
+
#define LINUX_IMAXBEL 0x0002000
/* Linux c_oflag masks */
#define LINUX_OPOST 0x0000001
+
+#ifdef __alpha__
+#define LINUX_ONLCR 0x0000002
+#define LINUX_OLCUC 0x0000004
+#else
#define LINUX_OLCUC 0x0000002
#define LINUX_ONLCR 0x0000004
+#endif
+
#define LINUX_OCRNL 0x0000008
#define LINUX_ONOCR 0x0000010
#define LINUX_ONLRET 0x0000020
#define LINUX_OFILL 0x0000040
#define LINUX_OFDEL 0x0000080
-#define LINUX_NLDLY 0x0000100
+#ifdef __alpha__
+#define LINUX_NLDLY 0x0000300
+#define LINUX_NL0 0x0000000
+#define LINUX_NL1 0x0000100
+#define LINUX_NL2 0x0000200
+#define LINUX_NL3 0x0000300
+#define LINUX_TABDLY 0x000C000
+#define LINUX_TAB0 0x0000000
+#define LINUX_TAB1 0x0004000
+#define LINUX_TAB2 0x0008000
+#define LINUX_TAB3 0x000C000
+#define LINUX_CRDLY 0x0030000
+#define LINUX_CR0 0x0000000
+#define LINUX_CR1 0x0010000
+#define LINUX_CR2 0x0020000
+#define LINUX_CR3 0x0030000
+#define LINUX_FFDLY 0x0040000
+#define LINUX_FF0 0x0000000
+#define LINUX_FF1 0x0040000
+#define LINUX_BSDLY 0x0080000
+#define LINUX_BS0 0x0000000
+#define LINUX_BS1 0x0080000
+#define LINUX_VTDLY 0x0100000
+#define LINUX_VT0 0x0000000
+#define LINUX_VT1 0x0100000
+#define LINUX_XTABS 0x0200000
+#else
+#define LINUX_NLDLY 0x0000100
#define LINUX_NL0 0x0000000
#define LINUX_NL1 0x0000100
#define LINUX_CRDLY 0x0000600
@@ -358,8 +489,14 @@
#define LINUX_FFDLY 0x0008000
#define LINUX_FF0 0x0000000
#define LINUX_FF1 0x0008000
+#endif
+#ifdef __alpha__
+#define LINUX_CBAUD 0x0000001f
+#else
#define LINUX_CBAUD 0x0000100f
+#endif
+
#define LINUX_B0 0x00000000
#define LINUX_B50 0x00000001
#define LINUX_B75 0x00000002
@@ -378,10 +515,30 @@
#define LINUX_B38400 0x0000000f
#define LINUX_EXTA LINUX_B19200
#define LINUX_EXTB LINUX_B38400
+
+#ifdef __alpha__
+#define LINUX_CBAUDEX 0x00000000
+#define LINUX_B57600 0x00000010
+#define LINUX_B115200 0x00000011
+#else
#define LINUX_CBAUDEX 0x00001000
#define LINUX_B57600 0x00001001
#define LINUX_B115200 0x00001002
+#endif
+#ifdef __alpha__
+#define LINUX_CSIZE 0x00000300
+#define LINUX_CS5 0x00000000
+#define LINUX_CS6 0x00000100
+#define LINUX_CS7 0x00000200
+#define LINUX_CS8 0x00000300
+#define LINUX_CSTOPB 0x00000400
+#define LINUX_CREAD 0x00000800
+#define LINUX_PARENB 0x00001000
+#define LINUX_PARODD 0x00002000
+#define LINUX_HUPCL 0x00004000
+#define LINUX_CLOCAL 0x00008000
+#else
#define LINUX_CSIZE 0x00000030
#define LINUX_CS5 0x00000000
#define LINUX_CS6 0x00000010
@@ -393,9 +550,28 @@
#define LINUX_PARODD 0x00000200
#define LINUX_HUPCL 0x00000400
#define LINUX_CLOCAL 0x00000800
+#endif
+
#define LINUX_CRTSCTS 0x80000000
/* Linux c_lflag masks */
+#ifdef __alpha__
+#define LINUX_ECHOKE 0x00000001
+#define LINUX_ECHOE 0x00000002
+#define LINUX_ECHOK 0x00000004
+#define LINUX_ECHO 0x00000008
+#define LINUX_ECHONL 0x00000010
+#define LINUX_ECHOPRT 0x00000020
+#define LINUX_ECHOCTL 0x00000040
+#define LINUX_ISIG 0x00000080
+#define LINUX_ICANON 0x00000100
+#define LINUX_IEXTEN 0x00000400
+#define LINUX_XCASE 0x00004000
+#define LINUX_TOSTOP 0x00400000
+#define LINUX_FLUSHO 0x00800000
+#define LINUX_PENDIN 0x20000000
+#define LINUX_NOFLSH 0x80000000
+#else
#define LINUX_ISIG 0x00000001
#define LINUX_ICANON 0x00000002
#define LINUX_XCASE 0x00000004
@@ -411,6 +587,7 @@
#define LINUX_FLUSHO 0x00001000
#define LINUX_PENDIN 0x00002000
#define LINUX_IEXTEN 0x00008000
+#endif
/* serial_struct values for TIOC[GS]SERIAL ioctls */
#define LINUX_ASYNC_CLOSING_WAIT_INF 0
OpenPOWER on IntegriCloud