mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH 00/16] sys/ioctl.h and termios.h cleanups
@ 2016-04-10 12:09 Szabolcs Nagy
  2016-04-10 12:10 ` [PATCH 01/16] use the generic ioctl.h for x86_64, x32 and aarch64 Szabolcs Nagy
                   ` (15 more replies)
  0 siblings, 16 replies; 19+ messages in thread
From: Szabolcs Nagy @ 2016-04-10 12:09 UTC (permalink / raw)
  To: musl

the contents of sys/ioctl.h is linux specific and not defined by any
standard, the defacto standard is whatever glibc sys/ioctl.h does.

glibc includes asm/ioctl.h and asm/ioctls.h linux uapi headers and
contains a copy of most linux/sockios.h, linux/tty.h and asm/termios.h
definitions (does not seem to be updated regularly so some recent
linux macros are missing) and also includes sys/ttydefaults.h.

in musl the sys/ttydefaults.h include, struct termio and struct termios2
related definitions are omitted, otherwise glibc is followed.

termios.h is defined by posix, but there are various extensions.
glibc does not include linux uapi headers, but contains a copy of
most asm/termbits.h definitions and includes sys/ttydefaults.h
in non-standard mode.

musl termios.h follows glibc except the sys/ttydefaults.h include,
the termios struct definition and _HAVE_STRUCT_TERMIOS_C_{I,O}SPEED
macros.

these patches are not tested, but compared against preprocessed
glibc headers on all targets.

Szabolcs Nagy (16):
  use the generic ioctl.h for x86_64, x32 and aarch64
  remove linux asm/sockios.h macros from ioctl.h
  remove ioctl macros that were removed from linux uapi
  add missing SIOCSIFNAME from linux/sockios.h to ioctl.h
  add missing TIOC* macros to ioctl.h
  remove mips and powerpc ioctls that are missing from linux uapi
  fix mips and mips64 TIOCM_* macros in ioctl.h
  fix TIOCMSET in mips ioctl.h
  remove termios2 related ioctls from sh ioctl.h
  fix FIOQSIZE in arm ioctl.h
  fix generic termios.h to be more consistent with glibc
  fix powerpc termios.h to be more consistent with glibc
  fix mips termios.h to be more consistent with glibc
  fix TCS* definitions in mips termios.h
  fix CBAUDEX in powerpc termios.h
  fix struct termios in mips termios.h

 arch/aarch64/bits/ioctl.h     | 213 ------------------------------------------
 arch/arm/bits/ioctl_fix.h     |   2 +
 arch/generic/bits/ioctl.h     |  22 ++---
 arch/generic/bits/ioctl_fix.h |   0
 arch/generic/bits/termios.h   |  23 +++--
 arch/mips/bits/ioctl.h        |  55 +++++------
 arch/mips/bits/termios.h      |  40 ++++----
 arch/mips64/bits/ioctl.h      |  55 +++++------
 arch/mips64/bits/termios.h    |  35 ++++---
 arch/powerpc/bits/ioctl.h     |  26 +-----
 arch/powerpc/bits/termios.h   |  26 +++---
 arch/sh/bits/ioctl.h          |  17 +---
 arch/x32/bits/ioctl.h         | 197 --------------------------------------
 arch/x86_64/bits/ioctl.h      | 197 --------------------------------------
 14 files changed, 130 insertions(+), 778 deletions(-)
 delete mode 100644 arch/aarch64/bits/ioctl.h
 create mode 100644 arch/arm/bits/ioctl_fix.h
 create mode 100644 arch/generic/bits/ioctl_fix.h
 delete mode 100644 arch/x32/bits/ioctl.h
 delete mode 100644 arch/x86_64/bits/ioctl.h

-- 
2.7.2



^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 01/16] use the generic ioctl.h for x86_64, x32 and aarch64
  2016-04-10 12:09 [PATCH 00/16] sys/ioctl.h and termios.h cleanups Szabolcs Nagy
@ 2016-04-10 12:10 ` Szabolcs Nagy
  2016-04-10 12:10 ` [PATCH 02/16] remove linux asm/sockios.h macros from ioctl.h Szabolcs Nagy
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Szabolcs Nagy @ 2016-04-10 12:10 UTC (permalink / raw)
  To: musl

they were slightly different in musl, but should be the same:
the linux uapi and glibc headers are not different.
---
 arch/aarch64/bits/ioctl.h | 213 ----------------------------------------------
 arch/x32/bits/ioctl.h     | 197 ------------------------------------------
 arch/x86_64/bits/ioctl.h  | 197 ------------------------------------------
 3 files changed, 607 deletions(-)
 delete mode 100644 arch/aarch64/bits/ioctl.h
 delete mode 100644 arch/x32/bits/ioctl.h
 delete mode 100644 arch/x86_64/bits/ioctl.h

diff --git a/arch/aarch64/bits/ioctl.h b/arch/aarch64/bits/ioctl.h
deleted file mode 100644
index 0345077..0000000
--- a/arch/aarch64/bits/ioctl.h
+++ /dev/null
@@ -1,213 +0,0 @@
-#define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) )
-#define _IOC_NONE  0U
-#define _IOC_WRITE 1U
-#define _IOC_READ  2U
-
-#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0)
-#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c))
-#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c))
-#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c))
-
-#define TCGETS		0x5401
-#define TCSETS		0x5402
-#define TCSETSW		0x5403
-#define TCSETSF		0x5404
-#define TCGETA		0x5405
-#define TCSETA		0x5406
-#define TCSETAW		0x5407
-#define TCSETAF		0x5408
-#define TCSBRK		0x5409
-#define TCXONC		0x540A
-#define TCFLSH		0x540B
-#define TIOCEXCL	0x540C
-#define TIOCNXCL	0x540D
-#define TIOCSCTTY	0x540E
-#define TIOCGPGRP	0x540F
-#define TIOCSPGRP	0x5410
-#define TIOCOUTQ	0x5411
-#define TIOCSTI		0x5412
-#define TIOCGWINSZ	0x5413
-#define TIOCSWINSZ	0x5414
-#define TIOCMGET	0x5415
-#define TIOCMBIS	0x5416
-#define TIOCMBIC	0x5417
-#define TIOCMSET	0x5418
-#define TIOCGSOFTCAR	0x5419
-#define TIOCSSOFTCAR	0x541A
-#define FIONREAD	0x541B
-#define TIOCINQ		FIONREAD
-#define TIOCLINUX	0x541C
-#define TIOCCONS	0x541D
-#define TIOCGSERIAL	0x541E
-#define TIOCSSERIAL	0x541F
-#define TIOCPKT		0x5420
-#define FIONBIO		0x5421
-#define TIOCNOTTY	0x5422
-#define TIOCSETD	0x5423
-#define TIOCGETD	0x5424
-#define TCSBRKP		0x5425
-#define TIOCTTYGSTRUCT	0x5426
-#define TIOCSBRK	0x5427
-#define TIOCCBRK	0x5428
-#define TIOCGSID	0x5429
-#define TIOCGRS485      0x542E
-#define TIOCSRS485      0x542F
-#define TIOCGPTN        _IOR('T', 0x30, unsigned int)
-#define TIOCSPTLCK      _IOW('T', 0x31, int)
-#define TIOCGDEV        _IOR('T', 0x32, unsigned int)
-#define TCGETX		0x5432
-#define TCSETX		0x5433
-#define TCSETXF		0x5434
-#define TCSETXW		0x5435
-#define TIOCSIG         0x40045436
-#define TIOCVHANGUP     0x5437
-#define TIOCGPKT        0x80045438
-#define TIOCGPTLCK      0x80045439
-#define TIOCGEXCL       0x80045440
-
-#define FIONCLEX	0x5450
-#define FIOCLEX		0x5451
-#define FIOASYNC	0x5452
-#define TIOCSERCONFIG	0x5453
-#define TIOCSERGWILD	0x5454
-#define TIOCSERSWILD	0x5455
-#define TIOCGLCKTRMIOS	0x5456
-#define TIOCSLCKTRMIOS	0x5457
-#define TIOCSERGSTRUCT	0x5458
-#define TIOCSERGETLSR   0x5459
-#define TIOCSERGETMULTI 0x545A
-#define TIOCSERSETMULTI 0x545B
-
-#define TIOCMIWAIT	0x545C
-#define TIOCGICOUNT	0x545D
-#define FIOQSIZE	0x5460
-
-#define TIOCPKT_DATA		 0
-#define TIOCPKT_FLUSHREAD	 1
-#define TIOCPKT_FLUSHWRITE	 2
-#define TIOCPKT_STOP		 4
-#define TIOCPKT_START		 8
-#define TIOCPKT_NOSTOP		16
-#define TIOCPKT_DOSTOP		32
-#define TIOCPKT_IOCTL		64
-
-#define TIOCSER_TEMT    0x01
-
-struct winsize {
-	unsigned short ws_row;
-	unsigned short ws_col;
-	unsigned short ws_xpixel;
-	unsigned short ws_ypixel;
-};
-
-#define TIOCM_LE        0x001
-#define TIOCM_DTR       0x002
-#define TIOCM_RTS       0x004
-#define TIOCM_ST        0x008
-#define TIOCM_SR        0x010
-#define TIOCM_CTS       0x020
-#define TIOCM_CAR       0x040
-#define TIOCM_RNG       0x080
-#define TIOCM_DSR       0x100
-#define TIOCM_CD        TIOCM_CAR
-#define TIOCM_RI        TIOCM_RNG
-#define TIOCM_OUT1      0x2000
-#define TIOCM_OUT2      0x4000
-#define TIOCM_LOOP      0x8000
-#define TIOCM_MODEM_BITS TIOCM_OUT2
-
-#define N_TTY           0
-#define N_SLIP          1
-#define N_MOUSE         2
-#define N_PPP           3
-#define N_STRIP         4
-#define N_AX25          5
-#define N_X25           6
-#define N_6PACK         7
-#define N_MASC          8
-#define N_R3964         9
-#define N_PROFIBUS_FDL  10
-#define N_IRDA          11
-#define N_SMSBLOCK      12
-#define N_HDLC          13
-#define N_SYNC_PPP      14
-#define N_HCI           15
-#define N_GIGASET_M101  16
-#define N_SLCAN         17
-#define N_PPS           18
-#define N_V253          19
-#define N_CAIF          20
-#define N_GSM0710       21
-#define N_TI_WL         22
-#define N_TRACESINK     23
-#define N_TRACEROUTER   24
-
-#define FIOSETOWN       0x8901
-#define SIOCSPGRP       0x8902
-#define FIOGETOWN       0x8903
-#define SIOCGPGRP       0x8904
-#define SIOCATMARK      0x8905
-#define SIOCGSTAMP      0x8906
-#define SIOCGSTAMPNS	0x8907
-
-#define SIOCADDRT       0x890B
-#define SIOCDELRT       0x890C
-#define SIOCRTMSG       0x890D
-
-#define SIOCGIFNAME     0x8910
-#define SIOCSIFLINK     0x8911
-#define SIOCGIFCONF     0x8912
-#define SIOCGIFFLAGS    0x8913
-#define SIOCSIFFLAGS    0x8914
-#define SIOCGIFADDR     0x8915
-#define SIOCSIFADDR     0x8916
-#define SIOCGIFDSTADDR  0x8917
-#define SIOCSIFDSTADDR  0x8918
-#define SIOCGIFBRDADDR  0x8919
-#define SIOCSIFBRDADDR  0x891a
-#define SIOCGIFNETMASK  0x891b
-#define SIOCSIFNETMASK  0x891c
-#define SIOCGIFMETRIC   0x891d
-#define SIOCSIFMETRIC   0x891e
-#define SIOCGIFMEM      0x891f
-#define SIOCSIFMEM      0x8920
-#define SIOCGIFMTU      0x8921
-#define SIOCSIFMTU      0x8922
-#define SIOCSIFHWADDR   0x8924
-#define SIOCGIFENCAP    0x8925
-#define SIOCSIFENCAP    0x8926
-#define SIOCGIFHWADDR   0x8927
-#define SIOCGIFSLAVE    0x8929
-#define SIOCSIFSLAVE    0x8930
-#define SIOCADDMULTI    0x8931
-#define SIOCDELMULTI    0x8932
-#define SIOCGIFINDEX    0x8933
-#define SIOGIFINDEX     SIOCGIFINDEX
-#define SIOCSIFPFLAGS   0x8934
-#define SIOCGIFPFLAGS   0x8935
-#define SIOCDIFADDR     0x8936
-#define SIOCSIFHWBROADCAST 0x8937
-#define SIOCGIFCOUNT    0x8938
-
-#define SIOCGIFBR       0x8940
-#define SIOCSIFBR       0x8941
-
-#define SIOCGIFTXQLEN   0x8942
-#define SIOCSIFTXQLEN   0x8943
-
-#define SIOCDARP        0x8953
-#define SIOCGARP        0x8954
-#define SIOCSARP        0x8955
-
-#define SIOCDRARP       0x8960
-#define SIOCGRARP       0x8961
-#define SIOCSRARP       0x8962
-
-#define SIOCGIFMAP      0x8970
-#define SIOCSIFMAP      0x8971
-
-#define SIOCADDDLCI     0x8980
-#define SIOCDELDLCI     0x8981
-
-#define SIOCDEVPRIVATE		0x89F0
-#define SIOCPROTOPRIVATE	0x89E0
diff --git a/arch/x32/bits/ioctl.h b/arch/x32/bits/ioctl.h
deleted file mode 100644
index 77a9455..0000000
--- a/arch/x32/bits/ioctl.h
+++ /dev/null
@@ -1,197 +0,0 @@
-#define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) )
-#define _IOC_NONE  0U
-#define _IOC_WRITE 1U
-#define _IOC_READ  2U
-
-#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0)
-#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c))
-#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c))
-#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c))
-
-#define TCGETS		0x5401
-#define TCSETS		0x5402
-#define TCSETSW		0x5403
-#define TCSETSF		0x5404
-#define TCGETA		0x5405
-#define TCSETA		0x5406
-#define TCSETAW		0x5407
-#define TCSETAF		0x5408
-#define TCSBRK		0x5409
-#define TCXONC		0x540A
-#define TCFLSH		0x540B
-#define TIOCEXCL	0x540C
-#define TIOCNXCL	0x540D
-#define TIOCSCTTY	0x540E
-#define TIOCGPGRP	0x540F
-#define TIOCSPGRP	0x5410
-#define TIOCOUTQ	0x5411
-#define TIOCSTI		0x5412
-#define TIOCGWINSZ	0x5413
-#define TIOCSWINSZ	0x5414
-#define TIOCMGET	0x5415
-#define TIOCMBIS	0x5416
-#define TIOCMBIC	0x5417
-#define TIOCMSET	0x5418
-#define TIOCGSOFTCAR	0x5419
-#define TIOCSSOFTCAR	0x541A
-#define FIONREAD	0x541B
-#define TIOCINQ		FIONREAD
-#define TIOCLINUX	0x541C
-#define TIOCCONS	0x541D
-#define TIOCGSERIAL	0x541E
-#define TIOCSSERIAL	0x541F
-#define TIOCPKT		0x5420
-#define FIONBIO		0x5421
-#define TIOCNOTTY	0x5422
-#define TIOCSETD	0x5423
-#define TIOCGETD	0x5424
-#define TCSBRKP		0x5425
-#define TIOCTTYGSTRUCT	0x5426
-#define TIOCSBRK	0x5427
-#define TIOCCBRK	0x5428
-#define TIOCGSID	0x5429
-#define TIOCGPTN	0x80045430
-#define TIOCSPTLCK	0x40045431
-#define TCGETX          0x5432
-#define TCSETX          0x5433
-#define TCSETXF         0x5434
-#define TCSETXW         0x5435
-
-#define FIONCLEX	0x5450
-#define FIOCLEX		0x5451
-#define FIOASYNC	0x5452
-#define TIOCSERCONFIG	0x5453
-#define TIOCSERGWILD	0x5454
-#define TIOCSERSWILD	0x5455
-#define TIOCGLCKTRMIOS	0x5456
-#define TIOCSLCKTRMIOS	0x5457
-#define TIOCSERGSTRUCT	0x5458
-#define TIOCSERGETLSR   0x5459
-#define TIOCSERGETMULTI 0x545A
-#define TIOCSERSETMULTI 0x545B
-
-#define TIOCMIWAIT	0x545C
-#define TIOCGICOUNT	0x545D
-#define TIOCGHAYESESP   0x545E
-#define TIOCSHAYESESP   0x545F
-#define FIOQSIZE	0x5460
-
-#define TIOCPKT_DATA		 0
-#define TIOCPKT_FLUSHREAD	 1
-#define TIOCPKT_FLUSHWRITE	 2
-#define TIOCPKT_STOP		 4
-#define TIOCPKT_START		 8
-#define TIOCPKT_NOSTOP		16
-#define TIOCPKT_DOSTOP		32
-#define TIOCPKT_IOCTL           64
-
-#define TIOCSER_TEMT    0x01
-
-struct winsize {
-	unsigned short ws_row;
-	unsigned short ws_col;
-	unsigned short ws_xpixel;
-	unsigned short ws_ypixel;
-};
-
-#define TIOCM_LE        0x001
-#define TIOCM_DTR       0x002
-#define TIOCM_RTS       0x004
-#define TIOCM_ST        0x008
-#define TIOCM_SR        0x010
-#define TIOCM_CTS       0x020
-#define TIOCM_CAR       0x040
-#define TIOCM_RNG       0x080
-#define TIOCM_DSR       0x100
-#define TIOCM_CD        TIOCM_CAR
-#define TIOCM_RI        TIOCM_RNG
-#define TIOCM_OUT1      0x2000
-#define TIOCM_OUT2      0x4000
-#define TIOCM_LOOP      0x8000
-#define TIOCM_MODEM_BITS TIOCM_OUT2
-
-#define N_TTY           0
-#define N_SLIP          1
-#define N_MOUSE         2
-#define N_PPP           3
-#define N_STRIP         4
-#define N_AX25          5
-#define N_X25           6
-#define N_6PACK         7
-#define N_MASC          8
-#define N_R3964         9
-#define N_PROFIBUS_FDL  10
-#define N_IRDA          11
-#define N_SMSBLOCK      12
-#define N_HDLC          13
-#define N_SYNC_PPP      14
-#define N_HCI           15
-
-#define FIOSETOWN       0x8901
-#define SIOCSPGRP       0x8902
-#define FIOGETOWN       0x8903
-#define SIOCGPGRP       0x8904
-#define SIOCATMARK      0x8905
-#define SIOCGSTAMP      0x8906
-
-#define SIOCADDRT       0x890B
-#define SIOCDELRT       0x890C
-#define SIOCRTMSG       0x890D
-
-#define SIOCGIFNAME     0x8910
-#define SIOCSIFLINK     0x8911
-#define SIOCGIFCONF     0x8912
-#define SIOCGIFFLAGS    0x8913
-#define SIOCSIFFLAGS    0x8914
-#define SIOCGIFADDR     0x8915
-#define SIOCSIFADDR     0x8916
-#define SIOCGIFDSTADDR  0x8917
-#define SIOCSIFDSTADDR  0x8918
-#define SIOCGIFBRDADDR  0x8919
-#define SIOCSIFBRDADDR  0x891a
-#define SIOCGIFNETMASK  0x891b
-#define SIOCSIFNETMASK  0x891c
-#define SIOCGIFMETRIC   0x891d
-#define SIOCSIFMETRIC   0x891e
-#define SIOCGIFMEM      0x891f
-#define SIOCSIFMEM      0x8920
-#define SIOCGIFMTU      0x8921
-#define SIOCSIFMTU      0x8922
-#define SIOCSIFHWADDR   0x8924
-#define SIOCGIFENCAP    0x8925
-#define SIOCSIFENCAP    0x8926
-#define SIOCGIFHWADDR   0x8927
-#define SIOCGIFSLAVE    0x8929
-#define SIOCSIFSLAVE    0x8930
-#define SIOCADDMULTI    0x8931
-#define SIOCDELMULTI    0x8932
-#define SIOCGIFINDEX    0x8933
-#define SIOGIFINDEX     SIOCGIFINDEX
-#define SIOCSIFPFLAGS   0x8934
-#define SIOCGIFPFLAGS   0x8935
-#define SIOCDIFADDR     0x8936
-#define SIOCSIFHWBROADCAST 0x8937
-#define SIOCGIFCOUNT    0x8938
-
-#define SIOCGIFBR       0x8940
-#define SIOCSIFBR       0x8941
-
-#define SIOCGIFTXQLEN   0x8942
-#define SIOCSIFTXQLEN   0x8943
-
-#define SIOCDARP        0x8953
-#define SIOCGARP        0x8954
-#define SIOCSARP        0x8955
-
-#define SIOCDRARP       0x8960
-#define SIOCGRARP       0x8961
-#define SIOCSRARP       0x8962
-
-#define SIOCGIFMAP      0x8970
-#define SIOCSIFMAP      0x8971
-
-#define SIOCADDDLCI     0x8980
-#define SIOCDELDLCI     0x8981
-
-#define SIOCDEVPRIVATE  0x89F0
-#define SIOCPROTOPRIVATE 0x89E0
diff --git a/arch/x86_64/bits/ioctl.h b/arch/x86_64/bits/ioctl.h
deleted file mode 100644
index 77a9455..0000000
--- a/arch/x86_64/bits/ioctl.h
+++ /dev/null
@@ -1,197 +0,0 @@
-#define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) )
-#define _IOC_NONE  0U
-#define _IOC_WRITE 1U
-#define _IOC_READ  2U
-
-#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0)
-#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c))
-#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c))
-#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c))
-
-#define TCGETS		0x5401
-#define TCSETS		0x5402
-#define TCSETSW		0x5403
-#define TCSETSF		0x5404
-#define TCGETA		0x5405
-#define TCSETA		0x5406
-#define TCSETAW		0x5407
-#define TCSETAF		0x5408
-#define TCSBRK		0x5409
-#define TCXONC		0x540A
-#define TCFLSH		0x540B
-#define TIOCEXCL	0x540C
-#define TIOCNXCL	0x540D
-#define TIOCSCTTY	0x540E
-#define TIOCGPGRP	0x540F
-#define TIOCSPGRP	0x5410
-#define TIOCOUTQ	0x5411
-#define TIOCSTI		0x5412
-#define TIOCGWINSZ	0x5413
-#define TIOCSWINSZ	0x5414
-#define TIOCMGET	0x5415
-#define TIOCMBIS	0x5416
-#define TIOCMBIC	0x5417
-#define TIOCMSET	0x5418
-#define TIOCGSOFTCAR	0x5419
-#define TIOCSSOFTCAR	0x541A
-#define FIONREAD	0x541B
-#define TIOCINQ		FIONREAD
-#define TIOCLINUX	0x541C
-#define TIOCCONS	0x541D
-#define TIOCGSERIAL	0x541E
-#define TIOCSSERIAL	0x541F
-#define TIOCPKT		0x5420
-#define FIONBIO		0x5421
-#define TIOCNOTTY	0x5422
-#define TIOCSETD	0x5423
-#define TIOCGETD	0x5424
-#define TCSBRKP		0x5425
-#define TIOCTTYGSTRUCT	0x5426
-#define TIOCSBRK	0x5427
-#define TIOCCBRK	0x5428
-#define TIOCGSID	0x5429
-#define TIOCGPTN	0x80045430
-#define TIOCSPTLCK	0x40045431
-#define TCGETX          0x5432
-#define TCSETX          0x5433
-#define TCSETXF         0x5434
-#define TCSETXW         0x5435
-
-#define FIONCLEX	0x5450
-#define FIOCLEX		0x5451
-#define FIOASYNC	0x5452
-#define TIOCSERCONFIG	0x5453
-#define TIOCSERGWILD	0x5454
-#define TIOCSERSWILD	0x5455
-#define TIOCGLCKTRMIOS	0x5456
-#define TIOCSLCKTRMIOS	0x5457
-#define TIOCSERGSTRUCT	0x5458
-#define TIOCSERGETLSR   0x5459
-#define TIOCSERGETMULTI 0x545A
-#define TIOCSERSETMULTI 0x545B
-
-#define TIOCMIWAIT	0x545C
-#define TIOCGICOUNT	0x545D
-#define TIOCGHAYESESP   0x545E
-#define TIOCSHAYESESP   0x545F
-#define FIOQSIZE	0x5460
-
-#define TIOCPKT_DATA		 0
-#define TIOCPKT_FLUSHREAD	 1
-#define TIOCPKT_FLUSHWRITE	 2
-#define TIOCPKT_STOP		 4
-#define TIOCPKT_START		 8
-#define TIOCPKT_NOSTOP		16
-#define TIOCPKT_DOSTOP		32
-#define TIOCPKT_IOCTL           64
-
-#define TIOCSER_TEMT    0x01
-
-struct winsize {
-	unsigned short ws_row;
-	unsigned short ws_col;
-	unsigned short ws_xpixel;
-	unsigned short ws_ypixel;
-};
-
-#define TIOCM_LE        0x001
-#define TIOCM_DTR       0x002
-#define TIOCM_RTS       0x004
-#define TIOCM_ST        0x008
-#define TIOCM_SR        0x010
-#define TIOCM_CTS       0x020
-#define TIOCM_CAR       0x040
-#define TIOCM_RNG       0x080
-#define TIOCM_DSR       0x100
-#define TIOCM_CD        TIOCM_CAR
-#define TIOCM_RI        TIOCM_RNG
-#define TIOCM_OUT1      0x2000
-#define TIOCM_OUT2      0x4000
-#define TIOCM_LOOP      0x8000
-#define TIOCM_MODEM_BITS TIOCM_OUT2
-
-#define N_TTY           0
-#define N_SLIP          1
-#define N_MOUSE         2
-#define N_PPP           3
-#define N_STRIP         4
-#define N_AX25          5
-#define N_X25           6
-#define N_6PACK         7
-#define N_MASC          8
-#define N_R3964         9
-#define N_PROFIBUS_FDL  10
-#define N_IRDA          11
-#define N_SMSBLOCK      12
-#define N_HDLC          13
-#define N_SYNC_PPP      14
-#define N_HCI           15
-
-#define FIOSETOWN       0x8901
-#define SIOCSPGRP       0x8902
-#define FIOGETOWN       0x8903
-#define SIOCGPGRP       0x8904
-#define SIOCATMARK      0x8905
-#define SIOCGSTAMP      0x8906
-
-#define SIOCADDRT       0x890B
-#define SIOCDELRT       0x890C
-#define SIOCRTMSG       0x890D
-
-#define SIOCGIFNAME     0x8910
-#define SIOCSIFLINK     0x8911
-#define SIOCGIFCONF     0x8912
-#define SIOCGIFFLAGS    0x8913
-#define SIOCSIFFLAGS    0x8914
-#define SIOCGIFADDR     0x8915
-#define SIOCSIFADDR     0x8916
-#define SIOCGIFDSTADDR  0x8917
-#define SIOCSIFDSTADDR  0x8918
-#define SIOCGIFBRDADDR  0x8919
-#define SIOCSIFBRDADDR  0x891a
-#define SIOCGIFNETMASK  0x891b
-#define SIOCSIFNETMASK  0x891c
-#define SIOCGIFMETRIC   0x891d
-#define SIOCSIFMETRIC   0x891e
-#define SIOCGIFMEM      0x891f
-#define SIOCSIFMEM      0x8920
-#define SIOCGIFMTU      0x8921
-#define SIOCSIFMTU      0x8922
-#define SIOCSIFHWADDR   0x8924
-#define SIOCGIFENCAP    0x8925
-#define SIOCSIFENCAP    0x8926
-#define SIOCGIFHWADDR   0x8927
-#define SIOCGIFSLAVE    0x8929
-#define SIOCSIFSLAVE    0x8930
-#define SIOCADDMULTI    0x8931
-#define SIOCDELMULTI    0x8932
-#define SIOCGIFINDEX    0x8933
-#define SIOGIFINDEX     SIOCGIFINDEX
-#define SIOCSIFPFLAGS   0x8934
-#define SIOCGIFPFLAGS   0x8935
-#define SIOCDIFADDR     0x8936
-#define SIOCSIFHWBROADCAST 0x8937
-#define SIOCGIFCOUNT    0x8938
-
-#define SIOCGIFBR       0x8940
-#define SIOCSIFBR       0x8941
-
-#define SIOCGIFTXQLEN   0x8942
-#define SIOCSIFTXQLEN   0x8943
-
-#define SIOCDARP        0x8953
-#define SIOCGARP        0x8954
-#define SIOCSARP        0x8955
-
-#define SIOCDRARP       0x8960
-#define SIOCGRARP       0x8961
-#define SIOCSRARP       0x8962
-
-#define SIOCGIFMAP      0x8970
-#define SIOCSIFMAP      0x8971
-
-#define SIOCADDDLCI     0x8980
-#define SIOCDELDLCI     0x8981
-
-#define SIOCDEVPRIVATE  0x89F0
-#define SIOCPROTOPRIVATE 0x89E0
-- 
2.7.2



^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 02/16] remove linux asm/sockios.h macros from ioctl.h
  2016-04-10 12:09 [PATCH 00/16] sys/ioctl.h and termios.h cleanups Szabolcs Nagy
  2016-04-10 12:10 ` [PATCH 01/16] use the generic ioctl.h for x86_64, x32 and aarch64 Szabolcs Nagy
@ 2016-04-10 12:10 ` Szabolcs Nagy
  2016-04-10 12:11 ` [PATCH 03/16] remove ioctl macros that were removed from linux uapi Szabolcs Nagy
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Szabolcs Nagy @ 2016-04-10 12:10 UTC (permalink / raw)
  To: musl

these are not exposed by glibc ioctl.h
---
 arch/generic/bits/ioctl.h | 7 -------
 arch/mips/bits/ioctl.h    | 7 -------
 arch/mips64/bits/ioctl.h  | 7 -------
 arch/powerpc/bits/ioctl.h | 7 -------
 arch/sh/bits/ioctl.h      | 8 --------
 5 files changed, 36 deletions(-)

diff --git a/arch/generic/bits/ioctl.h b/arch/generic/bits/ioctl.h
index 9d75118..df0d944 100644
--- a/arch/generic/bits/ioctl.h
+++ b/arch/generic/bits/ioctl.h
@@ -127,13 +127,6 @@ struct winsize {
 #define N_SYNC_PPP      14
 #define N_HCI           15
 
-#define FIOSETOWN       0x8901
-#define SIOCSPGRP       0x8902
-#define FIOGETOWN       0x8903
-#define SIOCGPGRP       0x8904
-#define SIOCATMARK      0x8905
-#define SIOCGSTAMP      0x8906
-
 #define SIOCADDRT       0x890B
 #define SIOCDELRT       0x890C
 #define SIOCRTMSG       0x890D
diff --git a/arch/mips/bits/ioctl.h b/arch/mips/bits/ioctl.h
index 83fb167..4687d21 100644
--- a/arch/mips/bits/ioctl.h
+++ b/arch/mips/bits/ioctl.h
@@ -140,13 +140,6 @@ struct winsize {
 #define N_SYNC_PPP      14
 #define N_HCI           15
 
-#define FIOSETOWN       0x8901
-#define SIOCSPGRP       0x8902
-#define FIOGETOWN       0x8903
-#define SIOCGPGRP       0x8904
-#define SIOCATMARK      0x8905
-#define SIOCGSTAMP      0x8906
-
 #define SIOCADDRT       0x890B
 #define SIOCDELRT       0x890C
 #define SIOCRTMSG       0x890D
diff --git a/arch/mips64/bits/ioctl.h b/arch/mips64/bits/ioctl.h
index 041be56..60c99ba 100644
--- a/arch/mips64/bits/ioctl.h
+++ b/arch/mips64/bits/ioctl.h
@@ -140,13 +140,6 @@ struct winsize {
 #define N_SYNC_PPP      14
 #define N_HCI           15
 
-#define FIOSETOWN       0x8901
-#define SIOCSPGRP       0x8902
-#define FIOGETOWN       0x8903
-#define SIOCGPGRP       0x8904
-#define SIOCATMARK      0x8905
-#define SIOCGSTAMP      0x8906
-
 #define SIOCADDRT       0x890B
 #define SIOCDELRT       0x890C
 #define SIOCRTMSG       0x890D
diff --git a/arch/powerpc/bits/ioctl.h b/arch/powerpc/bits/ioctl.h
index 0c903dc..a2a845a 100644
--- a/arch/powerpc/bits/ioctl.h
+++ b/arch/powerpc/bits/ioctl.h
@@ -156,13 +156,6 @@ struct winsize {
 #define N_SYNC_PPP      14
 #define N_HCI           15
 
-#define FIOSETOWN       0x8901
-#define SIOCSPGRP       0x8902
-#define FIOGETOWN       0x8903
-#define SIOCGPGRP       0x8904
-#define SIOCATMARK      0x8905
-#define SIOCGSTAMP      0x8906
-
 #define SIOCADDRT       0x890B
 #define SIOCDELRT       0x890C
 #define SIOCRTMSG       0x890D
diff --git a/arch/sh/bits/ioctl.h b/arch/sh/bits/ioctl.h
index 2f63d06..73fb55c 100644
--- a/arch/sh/bits/ioctl.h
+++ b/arch/sh/bits/ioctl.h
@@ -138,14 +138,6 @@ struct winsize {
 #define N_SYNC_PPP      14
 #define N_HCI           15
 
-#define FIOGETOWN       _IOR('f', 123, int)
-#define FIOSETOWN       _IOW('f', 124, int)
-
-#define SIOCATMARK      _IOR('s', 7, int)
-#define SIOCSPGRP       _IOW('s', 8, int)
-#define SIOCGPGRP       _IOW('s', 9, int)
-#define SIOCGSTAMP      _IOR('s', 100, char[8])
-
 #define SIOCADDRT       0x890B
 #define SIOCDELRT       0x890C
 #define SIOCRTMSG       0x890D
-- 
2.7.2



^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 03/16] remove ioctl macros that were removed from linux uapi
  2016-04-10 12:09 [PATCH 00/16] sys/ioctl.h and termios.h cleanups Szabolcs Nagy
  2016-04-10 12:10 ` [PATCH 01/16] use the generic ioctl.h for x86_64, x32 and aarch64 Szabolcs Nagy
  2016-04-10 12:10 ` [PATCH 02/16] remove linux asm/sockios.h macros from ioctl.h Szabolcs Nagy
@ 2016-04-10 12:11 ` Szabolcs Nagy
  2016-04-10 12:11 ` [PATCH 04/16] add missing SIOCSIFNAME from linux/sockios.h to ioctl.h Szabolcs Nagy
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Szabolcs Nagy @ 2016-04-10 12:11 UTC (permalink / raw)
  To: musl

TIOCTTYGSTRUCT, TIOCGHAYESESP, TIOCSHAYESESP and TIOCM_MODEM_BITS
were removed from the linux uapi and not present in glibc ioctl.h
---
 arch/generic/bits/ioctl.h | 4 ----
 arch/mips/bits/ioctl.h    | 4 ----
 arch/mips64/bits/ioctl.h  | 4 ----
 arch/powerpc/bits/ioctl.h | 7 -------
 arch/sh/bits/ioctl.h      | 2 --
 5 files changed, 21 deletions(-)

diff --git a/arch/generic/bits/ioctl.h b/arch/generic/bits/ioctl.h
index df0d944..acd9965 100644
--- a/arch/generic/bits/ioctl.h
+++ b/arch/generic/bits/ioctl.h
@@ -46,7 +46,6 @@
 #define TIOCSETD	0x5423
 #define TIOCGETD	0x5424
 #define TCSBRKP		0x5425
-#define TIOCTTYGSTRUCT	0x5426
 #define TIOCSBRK	0x5427
 #define TIOCCBRK	0x5428
 #define TIOCGSID	0x5429
@@ -72,8 +71,6 @@
 
 #define TIOCMIWAIT	0x545C
 #define TIOCGICOUNT	0x545D
-#define TIOCGHAYESESP   0x545E
-#define TIOCSHAYESESP   0x545F
 #define FIOQSIZE	0x5460
 
 #define TIOCPKT_DATA		 0
@@ -108,7 +105,6 @@ struct winsize {
 #define TIOCM_OUT1      0x2000
 #define TIOCM_OUT2      0x4000
 #define TIOCM_LOOP      0x8000
-#define TIOCM_MODEM_BITS TIOCM_OUT2
 
 #define N_TTY           0
 #define N_SLIP          1
diff --git a/arch/mips/bits/ioctl.h b/arch/mips/bits/ioctl.h
index 4687d21..ee9cdb1 100644
--- a/arch/mips/bits/ioctl.h
+++ b/arch/mips/bits/ioctl.h
@@ -80,10 +80,7 @@
 #define TIOCSERSETMULTI 0x5490
 #define TIOCMIWAIT	0x5491
 #define TIOCGICOUNT	0x5492
-#define TIOCGHAYESESP   0x5493
-#define TIOCSHAYESESP   0x5494
 
-#define TIOCTTYGSTRUCT	0x5426          // RICH: Not sure about these.
 #define TCGETX		0x5432          // RICH: Not sure about these.
 #define TCSETX		0x5433          // RICH: Not sure about these.
 #define TCSETXF		0x5434          // RICH: Not sure about these.
@@ -121,7 +118,6 @@ struct winsize {
 #define TIOCM_OUT1      0x2000
 #define TIOCM_OUT2      0x4000
 #define TIOCM_LOOP      0x8000
-#define TIOCM_MODEM_BITS TIOCM_OUT2
 
 #define N_TTY           0
 #define N_SLIP          1
diff --git a/arch/mips64/bits/ioctl.h b/arch/mips64/bits/ioctl.h
index 60c99ba..e00e3d4 100644
--- a/arch/mips64/bits/ioctl.h
+++ b/arch/mips64/bits/ioctl.h
@@ -80,10 +80,7 @@
 #define TIOCSERSETMULTI 0x5490
 #define TIOCMIWAIT	0x5491
 #define TIOCGICOUNT	0x5492
-#define TIOCGHAYESESP   0x5493
-#define TIOCSHAYESESP   0x5494
 
-#define TIOCTTYGSTRUCT	0x5426
 #define TCGETX		0x5432
 #define TCSETX		0x5433
 #define TCSETXF		0x5434
@@ -121,7 +118,6 @@ struct winsize {
 #define TIOCM_OUT1      0x2000
 #define TIOCM_OUT2      0x4000
 #define TIOCM_LOOP      0x8000
-#define TIOCM_MODEM_BITS TIOCM_OUT2
 
 #define N_TTY           0
 #define N_SLIP          1
diff --git a/arch/powerpc/bits/ioctl.h b/arch/powerpc/bits/ioctl.h
index a2a845a..94b9ed0 100644
--- a/arch/powerpc/bits/ioctl.h
+++ b/arch/powerpc/bits/ioctl.h
@@ -120,16 +120,11 @@
 /* end kernel header ioctls.h */
 
 
-#define TIOCTTYGSTRUCT	0x5426
-
 #define TCGETX		0x5432
 #define TCSETX		0x5433
 #define TCSETXF		0x5434
 #define TCSETXW		0x5435
 
-#define TIOCGHAYESESP   0x545E
-#define TIOCSHAYESESP   0x545F
-
 struct winsize {
 	unsigned short ws_row;
 	unsigned short ws_col;
@@ -137,8 +132,6 @@ struct winsize {
 	unsigned short ws_ypixel;
 };
 
-#define TIOCM_MODEM_BITS TIOCM_OUT2
-
 #define N_TTY           0
 #define N_SLIP          1
 #define N_MOUSE         2
diff --git a/arch/sh/bits/ioctl.h b/arch/sh/bits/ioctl.h
index 73fb55c..6157983 100644
--- a/arch/sh/bits/ioctl.h
+++ b/arch/sh/bits/ioctl.h
@@ -119,8 +119,6 @@ struct winsize {
     unsigned short ws_ypixel;
 };
 
-#define TIOCM_MODEM_BITS TIOCM_OUT2
-
 #define N_TTY           0
 #define N_SLIP          1
 #define N_MOUSE         2
-- 
2.7.2



^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 04/16] add missing SIOCSIFNAME from linux/sockios.h to ioctl.h
  2016-04-10 12:09 [PATCH 00/16] sys/ioctl.h and termios.h cleanups Szabolcs Nagy
                   ` (2 preceding siblings ...)
  2016-04-10 12:11 ` [PATCH 03/16] remove ioctl macros that were removed from linux uapi Szabolcs Nagy
@ 2016-04-10 12:11 ` Szabolcs Nagy
  2016-04-10 12:11 ` [PATCH 05/16] add missing TIOC* macros " Szabolcs Nagy
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Szabolcs Nagy @ 2016-04-10 12:11 UTC (permalink / raw)
  To: musl

glibc ioctl.h has it too.
---
 arch/generic/bits/ioctl.h | 1 +
 arch/mips/bits/ioctl.h    | 1 +
 arch/mips64/bits/ioctl.h  | 1 +
 arch/powerpc/bits/ioctl.h | 1 +
 arch/sh/bits/ioctl.h      | 1 +
 5 files changed, 5 insertions(+)

diff --git a/arch/generic/bits/ioctl.h b/arch/generic/bits/ioctl.h
index acd9965..d5ac69a 100644
--- a/arch/generic/bits/ioctl.h
+++ b/arch/generic/bits/ioctl.h
@@ -146,6 +146,7 @@ struct winsize {
 #define SIOCSIFMEM      0x8920
 #define SIOCGIFMTU      0x8921
 #define SIOCSIFMTU      0x8922
+#define SIOCSIFNAME     0x8923
 #define SIOCSIFHWADDR   0x8924
 #define SIOCGIFENCAP    0x8925
 #define SIOCSIFENCAP    0x8926
diff --git a/arch/mips/bits/ioctl.h b/arch/mips/bits/ioctl.h
index ee9cdb1..c414f5c 100644
--- a/arch/mips/bits/ioctl.h
+++ b/arch/mips/bits/ioctl.h
@@ -159,6 +159,7 @@ struct winsize {
 #define SIOCSIFMEM      0x8920
 #define SIOCGIFMTU      0x8921
 #define SIOCSIFMTU      0x8922
+#define SIOCSIFNAME     0x8923
 #define SIOCSIFHWADDR   0x8924
 #define SIOCGIFENCAP    0x8925
 #define SIOCSIFENCAP    0x8926
diff --git a/arch/mips64/bits/ioctl.h b/arch/mips64/bits/ioctl.h
index e00e3d4..476b7b7 100644
--- a/arch/mips64/bits/ioctl.h
+++ b/arch/mips64/bits/ioctl.h
@@ -159,6 +159,7 @@ struct winsize {
 #define SIOCSIFMEM      0x8920
 #define SIOCGIFMTU      0x8921
 #define SIOCSIFMTU      0x8922
+#define SIOCSIFNAME     0x8923
 #define SIOCSIFHWADDR   0x8924
 #define SIOCGIFENCAP    0x8925
 #define SIOCSIFENCAP    0x8926
diff --git a/arch/powerpc/bits/ioctl.h b/arch/powerpc/bits/ioctl.h
index 94b9ed0..cf15580 100644
--- a/arch/powerpc/bits/ioctl.h
+++ b/arch/powerpc/bits/ioctl.h
@@ -172,6 +172,7 @@ struct winsize {
 #define SIOCSIFMEM      0x8920
 #define SIOCGIFMTU      0x8921
 #define SIOCSIFMTU      0x8922
+#define SIOCSIFNAME     0x8923
 #define SIOCSIFHWADDR   0x8924
 #define SIOCGIFENCAP    0x8925
 #define SIOCSIFENCAP    0x8926
diff --git a/arch/sh/bits/ioctl.h b/arch/sh/bits/ioctl.h
index 6157983..9a87ad3 100644
--- a/arch/sh/bits/ioctl.h
+++ b/arch/sh/bits/ioctl.h
@@ -159,6 +159,7 @@ struct winsize {
 #define SIOCSIFMEM      0x8920
 #define SIOCGIFMTU      0x8921
 #define SIOCSIFMTU      0x8922
+#define SIOCSIFNAME     0x8923
 #define SIOCSIFHWADDR   0x8924
 #define SIOCGIFENCAP    0x8925
 #define SIOCSIFENCAP    0x8926
-- 
2.7.2



^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 05/16] add missing TIOC* macros to ioctl.h
  2016-04-10 12:09 [PATCH 00/16] sys/ioctl.h and termios.h cleanups Szabolcs Nagy
                   ` (3 preceding siblings ...)
  2016-04-10 12:11 ` [PATCH 04/16] add missing SIOCSIFNAME from linux/sockios.h to ioctl.h Szabolcs Nagy
@ 2016-04-10 12:11 ` Szabolcs Nagy
  2016-04-10 12:12 ` [PATCH 06/16] remove mips and powerpc ioctls that are missing from linux uapi Szabolcs Nagy
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Szabolcs Nagy @ 2016-04-10 12:11 UTC (permalink / raw)
  To: musl

these are defined in linux asm/ioctls.h.
---
 arch/generic/bits/ioctl.h | 8 ++++++++
 arch/mips/bits/ioctl.h    | 8 ++++++++
 arch/mips64/bits/ioctl.h  | 8 ++++++++
 arch/powerpc/bits/ioctl.h | 3 +++
 arch/sh/bits/ioctl.h      | 2 ++
 5 files changed, 29 insertions(+)

diff --git a/arch/generic/bits/ioctl.h b/arch/generic/bits/ioctl.h
index d5ac69a..649cdfc 100644
--- a/arch/generic/bits/ioctl.h
+++ b/arch/generic/bits/ioctl.h
@@ -49,12 +49,20 @@
 #define TIOCSBRK	0x5427
 #define TIOCCBRK	0x5428
 #define TIOCGSID	0x5429
+#define TIOCGRS485	0x542E
+#define TIOCSRS485	0x542F
 #define TIOCGPTN	0x80045430
 #define TIOCSPTLCK	0x40045431
+#define TIOCGDEV	0x80045432
 #define TCGETX		0x5432
 #define TCSETX		0x5433
 #define TCSETXF		0x5434
 #define TCSETXW		0x5435
+#define TIOCSIG		0x40045436
+#define TIOCVHANGUP	0x5437
+#define TIOCGPKT	0x80045438
+#define TIOCGPTLCK	0x80045439
+#define TIOCGEXCL	0x80045440
 
 #define FIONCLEX	0x5450
 #define FIOCLEX		0x5451
diff --git a/arch/mips/bits/ioctl.h b/arch/mips/bits/ioctl.h
index c414f5c..4e41f2a 100644
--- a/arch/mips/bits/ioctl.h
+++ b/arch/mips/bits/ioctl.h
@@ -58,8 +58,16 @@
 #define TIOCSBRK	0x5427
 #define TIOCCBRK	0x5428
 #define TIOCGSID	0x7416
+#define TIOCGRS485	_IOR('T', 0x2E, char[32])
+#define TIOCSRS485	_IOWR('T', 0x2F, char[32])
 #define TIOCGPTN	_IOR('T', 0x30, unsigned int)
 #define TIOCSPTLCK	_IOW('T', 0x31, int)
+#define TIOCGDEV	_IOR('T', 0x32, unsigned int)
+#define TIOCSIG		_IOW('T', 0x36, int)
+#define TIOCVHANGUP	0x5437
+#define TIOCGPKT	_IOR('T', 0x38, int)
+#define TIOCGPTLCK	_IOR('T', 0x39, int)
+#define TIOCGEXCL	_IOR('T', 0x40, int)
 
 #define TIOCSCTTY	0x5480
 #define TIOCGSOFTCAR	0x5481
diff --git a/arch/mips64/bits/ioctl.h b/arch/mips64/bits/ioctl.h
index 476b7b7..da43000 100644
--- a/arch/mips64/bits/ioctl.h
+++ b/arch/mips64/bits/ioctl.h
@@ -58,8 +58,16 @@
 #define TIOCSBRK	0x5427
 #define TIOCCBRK	0x5428
 #define TIOCGSID	0x7416
+#define TIOCGRS485	_IOR('T', 0x2E, char[32])
+#define TIOCSRS485	_IOWR('T', 0x2F, char[32])
 #define TIOCGPTN	_IOR('T', 0x30, unsigned int)
 #define TIOCSPTLCK	_IOW('T', 0x31, int)
+#define TIOCGDEV	_IOR('T', 0x32, unsigned int)
+#define TIOCSIG		_IOW('T', 0x36, int)
+#define TIOCVHANGUP	0x5437
+#define TIOCGPKT	_IOR('T', 0x38, int)
+#define TIOCGPTLCK	_IOR('T', 0x39, int)
+#define TIOCGEXCL	_IOR('T', 0x40, int)
 
 #define TIOCSCTTY	0x5480
 #define TIOCGSOFTCAR	0x5481
diff --git a/arch/powerpc/bits/ioctl.h b/arch/powerpc/bits/ioctl.h
index cf15580..671c633 100644
--- a/arch/powerpc/bits/ioctl.h
+++ b/arch/powerpc/bits/ioctl.h
@@ -101,6 +101,9 @@
 #define TIOCGDEV	_IOR('T',0x32, unsigned int)
 #define TIOCSIG		_IOW('T',0x36, int)
 #define TIOCVHANGUP	0x5437
+#define TIOCGPKT	_IOR('T', 0x38, int)
+#define TIOCGPTLCK	_IOR('T', 0x39, int)
+#define TIOCGEXCL	_IOR('T', 0x40, int)
 
 #define TIOCSERCONFIG	0x5453
 #define TIOCSERGWILD	0x5454
diff --git a/arch/sh/bits/ioctl.h b/arch/sh/bits/ioctl.h
index 9a87ad3..439f04e 100644
--- a/arch/sh/bits/ioctl.h
+++ b/arch/sh/bits/ioctl.h
@@ -89,6 +89,8 @@
 #define TCSETS2             _IOW('T', 43, char[44])
 #define TCSETSW2            _IOW('T', 44, char[44])
 #define TCSETSF2            _IOW('T', 45, char[44])
+#define TIOCGRS485          _IOR('T', 46, char[32])
+#define TIOCSRS485          _IOWR('T', 47, char[32])
 #define TIOCGPTN            _IOR('T', 48, unsigned int)
 #define TIOCSPTLCK          _IOW('T', 49, int)
 #define TIOCGDEV            _IOR('T', 50, unsigned int)
-- 
2.7.2



^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 06/16] remove mips and powerpc ioctls that are missing from linux uapi
  2016-04-10 12:09 [PATCH 00/16] sys/ioctl.h and termios.h cleanups Szabolcs Nagy
                   ` (4 preceding siblings ...)
  2016-04-10 12:11 ` [PATCH 05/16] add missing TIOC* macros " Szabolcs Nagy
@ 2016-04-10 12:12 ` Szabolcs Nagy
  2016-04-10 12:12 ` [PATCH 07/16] fix mips and mips64 TIOCM_* macros in ioctl.h Szabolcs Nagy
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Szabolcs Nagy @ 2016-04-10 12:12 UTC (permalink / raw)
  To: musl

mips and powerpc use their own asm/ioctls.h, not the asm-generic/ioctls.h
and they lack termiox macros that are available on other targets.
see kernel commit 1d65b4a088de407e99714fdc27862449db04fb5c
---
 arch/mips/bits/ioctl.h    | 5 -----
 arch/mips64/bits/ioctl.h  | 5 -----
 arch/powerpc/bits/ioctl.h | 8 --------
 3 files changed, 18 deletions(-)

diff --git a/arch/mips/bits/ioctl.h b/arch/mips/bits/ioctl.h
index 4e41f2a..18bfeba 100644
--- a/arch/mips/bits/ioctl.h
+++ b/arch/mips/bits/ioctl.h
@@ -89,11 +89,6 @@
 #define TIOCMIWAIT	0x5491
 #define TIOCGICOUNT	0x5492
 
-#define TCGETX		0x5432          // RICH: Not sure about these.
-#define TCSETX		0x5433          // RICH: Not sure about these.
-#define TCSETXF		0x5434          // RICH: Not sure about these.
-#define TCSETXW		0x5435          // RICH: Not sure about these.
-
 #define TIOCPKT_DATA		 0
 #define TIOCPKT_FLUSHREAD	 1
 #define TIOCPKT_FLUSHWRITE	 2
diff --git a/arch/mips64/bits/ioctl.h b/arch/mips64/bits/ioctl.h
index da43000..18bfeba 100644
--- a/arch/mips64/bits/ioctl.h
+++ b/arch/mips64/bits/ioctl.h
@@ -89,11 +89,6 @@
 #define TIOCMIWAIT	0x5491
 #define TIOCGICOUNT	0x5492
 
-#define TCGETX		0x5432
-#define TCSETX		0x5433
-#define TCSETXF		0x5434
-#define TCSETXW		0x5435
-
 #define TIOCPKT_DATA		 0
 #define TIOCPKT_FLUSHREAD	 1
 #define TIOCPKT_FLUSHWRITE	 2
diff --git a/arch/powerpc/bits/ioctl.h b/arch/powerpc/bits/ioctl.h
index 671c633..7b100ab 100644
--- a/arch/powerpc/bits/ioctl.h
+++ b/arch/powerpc/bits/ioctl.h
@@ -120,14 +120,6 @@
 #define TIOCGICOUNT	0x545D
 
 
-/* end kernel header ioctls.h */
-
-
-#define TCGETX		0x5432
-#define TCSETX		0x5433
-#define TCSETXF		0x5434
-#define TCSETXW		0x5435
-
 struct winsize {
 	unsigned short ws_row;
 	unsigned short ws_col;
-- 
2.7.2



^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 07/16] fix mips and mips64 TIOCM_* macros in ioctl.h
  2016-04-10 12:09 [PATCH 00/16] sys/ioctl.h and termios.h cleanups Szabolcs Nagy
                   ` (5 preceding siblings ...)
  2016-04-10 12:12 ` [PATCH 06/16] remove mips and powerpc ioctls that are missing from linux uapi Szabolcs Nagy
@ 2016-04-10 12:12 ` Szabolcs Nagy
  2016-04-10 12:12 ` [PATCH 08/16] fix TIOCMSET in mips ioctl.h Szabolcs Nagy
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Szabolcs Nagy @ 2016-04-10 12:12 UTC (permalink / raw)
  To: musl

TIOCM_ macros were wrongly using the asm-generic/termios.h definitions
instead of the mips specific ones from asm/termios.h
---
 arch/mips/bits/ioctl.h   | 28 ++++++++++++++--------------
 arch/mips64/bits/ioctl.h | 28 ++++++++++++++--------------
 2 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/arch/mips/bits/ioctl.h b/arch/mips/bits/ioctl.h
index 18bfeba..a9e39d4 100644
--- a/arch/mips/bits/ioctl.h
+++ b/arch/mips/bits/ioctl.h
@@ -107,20 +107,20 @@ struct winsize {
 	unsigned short ws_ypixel;
 };
 
-#define TIOCM_LE        0x001
-#define TIOCM_DTR       0x002
-#define TIOCM_RTS       0x004
-#define TIOCM_ST        0x008
-#define TIOCM_SR        0x010
-#define TIOCM_CTS       0x020
-#define TIOCM_CAR       0x040
-#define TIOCM_RNG       0x080
-#define TIOCM_DSR       0x100
-#define TIOCM_CD        TIOCM_CAR
-#define TIOCM_RI        TIOCM_RNG
-#define TIOCM_OUT1      0x2000
-#define TIOCM_OUT2      0x4000
-#define TIOCM_LOOP      0x8000
+#define TIOCM_LE	0x001
+#define TIOCM_DTR	0x002
+#define TIOCM_RTS	0x004
+#define TIOCM_ST	0x010
+#define TIOCM_SR	0x020
+#define TIOCM_CTS	0x040
+#define TIOCM_CAR	0x100
+#define TIOCM_CD	TIOCM_CAR
+#define TIOCM_RNG	0x200
+#define TIOCM_RI	TIOCM_RNG
+#define TIOCM_DSR	0x400
+#define TIOCM_OUT1	0x2000
+#define TIOCM_OUT2	0x4000
+#define TIOCM_LOOP	0x8000
 
 #define N_TTY           0
 #define N_SLIP          1
diff --git a/arch/mips64/bits/ioctl.h b/arch/mips64/bits/ioctl.h
index 18bfeba..a9e39d4 100644
--- a/arch/mips64/bits/ioctl.h
+++ b/arch/mips64/bits/ioctl.h
@@ -107,20 +107,20 @@ struct winsize {
 	unsigned short ws_ypixel;
 };
 
-#define TIOCM_LE        0x001
-#define TIOCM_DTR       0x002
-#define TIOCM_RTS       0x004
-#define TIOCM_ST        0x008
-#define TIOCM_SR        0x010
-#define TIOCM_CTS       0x020
-#define TIOCM_CAR       0x040
-#define TIOCM_RNG       0x080
-#define TIOCM_DSR       0x100
-#define TIOCM_CD        TIOCM_CAR
-#define TIOCM_RI        TIOCM_RNG
-#define TIOCM_OUT1      0x2000
-#define TIOCM_OUT2      0x4000
-#define TIOCM_LOOP      0x8000
+#define TIOCM_LE	0x001
+#define TIOCM_DTR	0x002
+#define TIOCM_RTS	0x004
+#define TIOCM_ST	0x010
+#define TIOCM_SR	0x020
+#define TIOCM_CTS	0x040
+#define TIOCM_CAR	0x100
+#define TIOCM_CD	TIOCM_CAR
+#define TIOCM_RNG	0x200
+#define TIOCM_RI	TIOCM_RNG
+#define TIOCM_DSR	0x400
+#define TIOCM_OUT1	0x2000
+#define TIOCM_OUT2	0x4000
+#define TIOCM_LOOP	0x8000
 
 #define N_TTY           0
 #define N_SLIP          1
-- 
2.7.2



^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 08/16] fix TIOCMSET in mips ioctl.h
  2016-04-10 12:09 [PATCH 00/16] sys/ioctl.h and termios.h cleanups Szabolcs Nagy
                   ` (6 preceding siblings ...)
  2016-04-10 12:12 ` [PATCH 07/16] fix mips and mips64 TIOCM_* macros in ioctl.h Szabolcs Nagy
@ 2016-04-10 12:12 ` Szabolcs Nagy
  2016-04-10 12:13 ` [PATCH 09/16] remove termios2 related ioctls from sh ioctl.h Szabolcs Nagy
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Szabolcs Nagy @ 2016-04-10 12:12 UTC (permalink / raw)
  To: musl

it seems it was a typo.
---
 arch/mips/bits/ioctl.h   | 2 +-
 arch/mips64/bits/ioctl.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/bits/ioctl.h b/arch/mips/bits/ioctl.h
index a9e39d4..2a6141f 100644
--- a/arch/mips/bits/ioctl.h
+++ b/arch/mips/bits/ioctl.h
@@ -27,7 +27,7 @@
 #define TIOCMGET	0x741D
 #define TIOCMBIS	0x741B
 #define TIOCMBIC	0x741C
-#define TIOCMSET	0x741D
+#define TIOCMSET	0x741A
 
 #define TIOCPKT		0x5470
 #define TIOCSWINSZ	_IOW('t', 103, struct winsize)
diff --git a/arch/mips64/bits/ioctl.h b/arch/mips64/bits/ioctl.h
index a9e39d4..2a6141f 100644
--- a/arch/mips64/bits/ioctl.h
+++ b/arch/mips64/bits/ioctl.h
@@ -27,7 +27,7 @@
 #define TIOCMGET	0x741D
 #define TIOCMBIS	0x741B
 #define TIOCMBIC	0x741C
-#define TIOCMSET	0x741D
+#define TIOCMSET	0x741A
 
 #define TIOCPKT		0x5470
 #define TIOCSWINSZ	_IOW('t', 103, struct winsize)
-- 
2.7.2



^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 09/16] remove termios2 related ioctls from sh ioctl.h
  2016-04-10 12:09 [PATCH 00/16] sys/ioctl.h and termios.h cleanups Szabolcs Nagy
                   ` (7 preceding siblings ...)
  2016-04-10 12:12 ` [PATCH 08/16] fix TIOCMSET in mips ioctl.h Szabolcs Nagy
@ 2016-04-10 12:13 ` Szabolcs Nagy
  2016-04-10 12:13 ` [PATCH 10/16] fix FIOQSIZE in arm ioctl.h Szabolcs Nagy
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Szabolcs Nagy @ 2016-04-10 12:13 UTC (permalink / raw)
  To: musl

musl does not define these on other targets either.
---
 arch/sh/bits/ioctl.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/arch/sh/bits/ioctl.h b/arch/sh/bits/ioctl.h
index 439f04e..0ed5e13 100644
--- a/arch/sh/bits/ioctl.h
+++ b/arch/sh/bits/ioctl.h
@@ -85,10 +85,6 @@
 #define TCSETS              _IO('T', 2)
 #define TCSETSW             _IO('T', 3)
 #define TCSETSF             _IO('T', 4)
-#define TCGETS2             _IOR('T', 42, char[44])
-#define TCSETS2             _IOW('T', 43, char[44])
-#define TCSETSW2            _IOW('T', 44, char[44])
-#define TCSETSF2            _IOW('T', 45, char[44])
 #define TIOCGRS485          _IOR('T', 46, char[32])
 #define TIOCSRS485          _IOWR('T', 47, char[32])
 #define TIOCGPTN            _IOR('T', 48, unsigned int)
-- 
2.7.2



^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 10/16] fix FIOQSIZE in arm ioctl.h
  2016-04-10 12:09 [PATCH 00/16] sys/ioctl.h and termios.h cleanups Szabolcs Nagy
                   ` (8 preceding siblings ...)
  2016-04-10 12:13 ` [PATCH 09/16] remove termios2 related ioctls from sh ioctl.h Szabolcs Nagy
@ 2016-04-10 12:13 ` Szabolcs Nagy
  2016-04-10 12:14 ` [PATCH 11/16] fix generic termios.h to be more consistent with glibc Szabolcs Nagy
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Szabolcs Nagy @ 2016-04-10 12:13 UTC (permalink / raw)
  To: musl

arm ioctl.h is the same as the generic one except this macro,
so a workaround solution is used to avoid another ioctl.h copy.
---
 arch/arm/bits/ioctl_fix.h     | 2 ++
 arch/generic/bits/ioctl.h     | 2 ++
 arch/generic/bits/ioctl_fix.h | 0
 3 files changed, 4 insertions(+)
 create mode 100644 arch/arm/bits/ioctl_fix.h
 create mode 100644 arch/generic/bits/ioctl_fix.h

diff --git a/arch/arm/bits/ioctl_fix.h b/arch/arm/bits/ioctl_fix.h
new file mode 100644
index 0000000..ebb383d
--- /dev/null
+++ b/arch/arm/bits/ioctl_fix.h
@@ -0,0 +1,2 @@
+#undef FIOQSIZE
+#define FIOQSIZE 0x545e
diff --git a/arch/generic/bits/ioctl.h b/arch/generic/bits/ioctl.h
index 649cdfc..ad5b6d6 100644
--- a/arch/generic/bits/ioctl.h
+++ b/arch/generic/bits/ioctl.h
@@ -193,3 +193,5 @@ struct winsize {
 
 #define SIOCDEVPRIVATE		0x89F0
 #define SIOCPROTOPRIVATE	0x89E0
+
+#include <bits/ioctl_fix.h>
diff --git a/arch/generic/bits/ioctl_fix.h b/arch/generic/bits/ioctl_fix.h
new file mode 100644
index 0000000..e69de29
-- 
2.7.2



^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 11/16] fix generic termios.h to be more consistent with glibc
  2016-04-10 12:09 [PATCH 00/16] sys/ioctl.h and termios.h cleanups Szabolcs Nagy
                   ` (9 preceding siblings ...)
  2016-04-10 12:13 ` [PATCH 10/16] fix FIOQSIZE in arm ioctl.h Szabolcs Nagy
@ 2016-04-10 12:14 ` Szabolcs Nagy
  2016-04-10 12:14 ` [PATCH 12/16] fix powerpc " Szabolcs Nagy
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Szabolcs Nagy @ 2016-04-10 12:14 UTC (permalink / raw)
  To: musl

add EXTA, EXTB, CIBAUD, CMSPAR, XCASE macros and hide them as well as
CBAUD, ECHOCTL, ECHOPRT, ECHOKE, FLUSHO, PENDIN in standard mode.

the new macros are both in glibc termios.h and in linux asm/termbits.h,
the later also contains IBSHIFT and BOTHER, those were not added.

these are not standard macros, but some of them are in the reserved
namespace so could be exposed, the ones which are not reserved are
CIBAUD, CMSPAR and XCASE (which was removed in issue 6), the rest
got hidden to be consistent with glibc.
---
 arch/generic/bits/termios.h | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/arch/generic/bits/termios.h b/arch/generic/bits/termios.h
index f0d81b1..941de7b 100644
--- a/arch/generic/bits/termios.h
+++ b/arch/generic/bits/termios.h
@@ -109,8 +109,6 @@ struct termios
 #define B3500000 0010016
 #define B4000000 0010017
 
-#define CBAUD    0010017
-
 #define CSIZE  0000060
 #define CS5    0000000
 #define CS6    0000020
@@ -133,12 +131,6 @@ struct termios
 #define TOSTOP 0000400
 #define IEXTEN 0100000
 
-#define ECHOCTL 0001000
-#define ECHOPRT 0002000
-#define ECHOKE 0004000
-#define FLUSHO 0010000
-#define PENDIN 0040000
-
 #define TCOOFF 0
 #define TCOON  1
 #define TCIOFF 2
@@ -153,8 +145,21 @@ struct termios
 #define TCSAFLUSH 2
 
 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+#define EXTA    0000016
+#define EXTB    0000017
+#define CBAUD   0010017
 #define CBAUDEX 0010000
-#define CRTSCTS  020000000000
+#define CIBAUD  002003600000
+#define CMSPAR  010000000000
+#define CRTSCTS 020000000000
+
+#define XCASE   0000004
+#define ECHOCTL 0001000
+#define ECHOPRT 0002000
+#define ECHOKE  0004000
+#define FLUSHO  0010000
+#define PENDIN  0040000
 #define EXTPROC 0200000
+
 #define XTABS  0014000
 #endif
-- 
2.7.2



^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 12/16] fix powerpc termios.h to be more consistent with glibc
  2016-04-10 12:09 [PATCH 00/16] sys/ioctl.h and termios.h cleanups Szabolcs Nagy
                   ` (10 preceding siblings ...)
  2016-04-10 12:14 ` [PATCH 11/16] fix generic termios.h to be more consistent with glibc Szabolcs Nagy
@ 2016-04-10 12:14 ` Szabolcs Nagy
  2016-04-10 12:15 ` [PATCH 13/16] fix mips " Szabolcs Nagy
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Szabolcs Nagy @ 2016-04-10 12:14 UTC (permalink / raw)
  To: musl

same changes as in the generic header.

and BOTHER and IBSHIFT were removed (present in linux uapi but not
in glibc) and TIOCSER_TEMT was added (present in glibc).
---
 arch/powerpc/bits/termios.h | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/arch/powerpc/bits/termios.h b/arch/powerpc/bits/termios.h
index 7feaf49..d2fc297 100644
--- a/arch/powerpc/bits/termios.h
+++ b/arch/powerpc/bits/termios.h
@@ -96,8 +96,6 @@ struct termios
 #define B9600    0000015
 #define B19200   0000016
 #define B38400   0000017
-#define EXTA     0000016
-#define EXTB     0000017
 
 #define B57600   00020
 #define B115200  00021
@@ -114,9 +112,6 @@ struct termios
 #define B3000000 00034
 #define B3500000 00035
 #define B4000000 00036
-#define BOTHER   00037
-
-#define CBAUD    00377
 
 #define CSIZE  00001400
 #define CS5    00000000
@@ -130,20 +125,14 @@ struct termios
 #define HUPCL  00040000
 #define CLOCAL 00100000
 
-#define ECHOKE  0x00000001
 #define ECHOE   0x00000002
 #define ECHOK   0x00000004
 #define ECHO    0x00000008
 #define ECHONL  0x00000010
-#define ECHOPRT 0x00000020
-#define ECHOCTL 0x00000040
 #define ISIG    0x00000080
 #define ICANON  0x00000100
 #define IEXTEN  0x00000400
-#define XCASE   0x00004000
 #define TOSTOP  0x00400000
-#define FLUSHO  0x00800000
-#define PENDIN  0x20000000
 #define NOFLSH  0x80000000
 
 #define TCOOFF 0
@@ -160,11 +149,22 @@ struct termios
 #define TCSAFLUSH 2
 
 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+#define EXTA    0000016
+#define EXTB    0000017
+#define CBAUD   00377
 #define CBAUDEX 0000000
 #define CIBAUD  077600000
-#define IBSHIFT 16
 #define CMSPAR  010000000000
 #define CRTSCTS 020000000000
+
+#define XCASE   0x00004000
+#define ECHOCTL 0x00000040
+#define ECHOPRT 0x00000020
+#define ECHOKE  0x00000001
+#define FLUSHO  0x00800000
+#define PENDIN  0x20000000
 #define EXTPROC 0x10000000
+
 #define XTABS   00006000
+#define TIOCSER_TEMT 1
 #endif
-- 
2.7.2



^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 13/16] fix mips termios.h to be more consistent with glibc
  2016-04-10 12:09 [PATCH 00/16] sys/ioctl.h and termios.h cleanups Szabolcs Nagy
                   ` (11 preceding siblings ...)
  2016-04-10 12:14 ` [PATCH 12/16] fix powerpc " Szabolcs Nagy
@ 2016-04-10 12:15 ` Szabolcs Nagy
  2016-04-10 12:15 ` [PATCH 14/16] fix TCS* definitions in mips termios.h Szabolcs Nagy
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Szabolcs Nagy @ 2016-04-10 12:15 UTC (permalink / raw)
  To: musl

same changes to the defined macros as in powerpc and generic bits.
---
 arch/mips/bits/termios.h   | 29 ++++++++++++++---------------
 arch/mips64/bits/termios.h | 29 ++++++++++++++---------------
 2 files changed, 28 insertions(+), 30 deletions(-)

diff --git a/arch/mips/bits/termios.h b/arch/mips/bits/termios.h
index 487c1d4..55ba132 100644
--- a/arch/mips/bits/termios.h
+++ b/arch/mips/bits/termios.h
@@ -93,10 +93,7 @@ struct termios
 #define B9600    0000015
 #define B19200   0000016
 #define B38400   0000017
-#define EXTA     0000016
-#define EXTB     0000017
 
-#define BOTHER   0010000
 #define B57600   0010001
 #define B115200  0010002
 #define B230400  0010003
@@ -113,8 +110,6 @@ struct termios
 #define B3500000 0010016
 #define B4000000 0010017
 
-#define CBAUD    0010017
-
 #define CSIZE  0000060
 #define CS5    0000000
 #define CS6    0000020
@@ -129,18 +124,12 @@ struct termios
 
 #define ISIG   0000001
 #define ICANON 0000002
-#define XCASE  0000004
 #define ECHO   0000010
 #define ECHOE  0000020
 #define ECHOK  0000040
 #define ECHONL 0000100
 #define NOFLSH 0000200
 #define IEXTEN 0000400
-#define ECHOCTL 0001000
-#define ECHOPRT 0002000
-#define ECHOKE 0004000
-#define FLUSHO 0020000
-#define PENDIN 0040000
 #define TOSTOP 0100000
 #define ITOSTOP 0100000
 
@@ -158,12 +147,22 @@ struct termios
 #define TCSAFLUSH 2
 
 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+#define EXTA    0000016
+#define EXTB    0000017
+#define CBAUD   0010017
 #define CBAUDEX 0010000
-#define CIBAUD   002003600000
-#define IBSHIFT 16
-#define CMSPAR   010000000000
-#define CRTSCTS  020000000000
+#define CIBAUD  002003600000
+#define CMSPAR  010000000000
+#define CRTSCTS 020000000000
+
+#define XCASE   0000004
+#define ECHOCTL 0001000
+#define ECHOPRT 0002000
+#define ECHOKE  0004000
+#define FLUSHO  0020000
+#define PENDIN  0040000
 #define EXTPROC 0200000
+
 #define XTABS  0014000
 #define TIOCSER_TEMT 1
 #endif
diff --git a/arch/mips64/bits/termios.h b/arch/mips64/bits/termios.h
index 3a7d5a1..d831cfa 100644
--- a/arch/mips64/bits/termios.h
+++ b/arch/mips64/bits/termios.h
@@ -90,10 +90,7 @@ struct termios {
 #define B9600    0000015
 #define B19200   0000016
 #define B38400   0000017
-#define EXTA     0000016
-#define EXTB     0000017
 
-#define BOTHER   0010000
 #define B57600   0010001
 #define B115200  0010002
 #define B230400  0010003
@@ -110,8 +107,6 @@ struct termios {
 #define B3500000 0010016
 #define B4000000 0010017
 
-#define CBAUD    0010017
-
 #define CSIZE  0000060
 #define CS5    0000000
 #define CS6    0000020
@@ -126,18 +121,12 @@ struct termios {
 
 #define ISIG   0000001
 #define ICANON 0000002
-#define XCASE  0000004
 #define ECHO   0000010
 #define ECHOE  0000020
 #define ECHOK  0000040
 #define ECHONL 0000100
 #define NOFLSH 0000200
 #define IEXTEN 0000400
-#define ECHOCTL 0001000
-#define ECHOPRT 0002000
-#define ECHOKE 0004000
-#define FLUSHO 0020000
-#define PENDIN 0040000
 #define TOSTOP 0100000
 #define ITOSTOP 0100000
 
@@ -155,12 +144,22 @@ struct termios {
 #define TCSAFLUSH 2
 
 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+#define EXTA    0000016
+#define EXTB    0000017
+#define CBAUD   0010017
 #define CBAUDEX 0010000
-#define CIBAUD   002003600000
-#define IBSHIFT 16
-#define CMSPAR   010000000000
-#define CRTSCTS  020000000000
+#define CIBAUD  002003600000
+#define CMSPAR  010000000000
+#define CRTSCTS 020000000000
+
+#define XCASE   0000004
+#define ECHOCTL 0001000
+#define ECHOPRT 0002000
+#define ECHOKE  0004000
+#define FLUSHO  0020000
+#define PENDIN  0040000
 #define EXTPROC 0200000
+
 #define XTABS  0014000
 #define TIOCSER_TEMT 1
 #endif
-- 
2.7.2



^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 14/16] fix TCS* definitions in mips termios.h
  2016-04-10 12:09 [PATCH 00/16] sys/ioctl.h and termios.h cleanups Szabolcs Nagy
                   ` (12 preceding siblings ...)
  2016-04-10 12:15 ` [PATCH 13/16] fix mips " Szabolcs Nagy
@ 2016-04-10 12:15 ` Szabolcs Nagy
  2016-04-10 12:16 ` [PATCH 15/16] fix CBAUDEX in powerpc termios.h Szabolcs Nagy
  2016-04-10 12:16 ` [PATCH 16/16] fix struct termios in mips termios.h Szabolcs Nagy
  15 siblings, 0 replies; 19+ messages in thread
From: Szabolcs Nagy @ 2016-04-10 12:15 UTC (permalink / raw)
  To: musl

these were incorrectly using the generic definitions.
---
 arch/mips/bits/termios.h   | 6 +++---
 arch/mips64/bits/termios.h | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/mips/bits/termios.h b/arch/mips/bits/termios.h
index 55ba132..29b4b22 100644
--- a/arch/mips/bits/termios.h
+++ b/arch/mips/bits/termios.h
@@ -142,9 +142,9 @@ struct termios
 #define TCOFLUSH  1
 #define TCIOFLUSH 2
 
-#define TCSANOW   0
-#define TCSADRAIN 1
-#define TCSAFLUSH 2
+#define TCSANOW 0x540e
+#define TCSADRAIN 0x540f
+#define TCSAFLUSH 0x5410
 
 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
 #define EXTA    0000016
diff --git a/arch/mips64/bits/termios.h b/arch/mips64/bits/termios.h
index d831cfa..d97df8c 100644
--- a/arch/mips64/bits/termios.h
+++ b/arch/mips64/bits/termios.h
@@ -139,9 +139,9 @@ struct termios {
 #define TCOFLUSH  1
 #define TCIOFLUSH 2
 
-#define TCSANOW   0
-#define TCSADRAIN 1
-#define TCSAFLUSH 2
+#define TCSANOW 0x540e
+#define TCSADRAIN 0x540f
+#define TCSAFLUSH 0x5410
 
 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
 #define EXTA    0000016
-- 
2.7.2



^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 15/16] fix CBAUDEX in powerpc termios.h
  2016-04-10 12:09 [PATCH 00/16] sys/ioctl.h and termios.h cleanups Szabolcs Nagy
                   ` (13 preceding siblings ...)
  2016-04-10 12:15 ` [PATCH 14/16] fix TCS* definitions in mips termios.h Szabolcs Nagy
@ 2016-04-10 12:16 ` Szabolcs Nagy
  2016-04-10 12:16 ` [PATCH 16/16] fix struct termios in mips termios.h Szabolcs Nagy
  15 siblings, 0 replies; 19+ messages in thread
From: Szabolcs Nagy @ 2016-04-10 12:16 UTC (permalink / raw)
  To: musl

it seems it was a typo.
---
 arch/powerpc/bits/termios.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/bits/termios.h b/arch/powerpc/bits/termios.h
index d2fc297..7f67baf 100644
--- a/arch/powerpc/bits/termios.h
+++ b/arch/powerpc/bits/termios.h
@@ -152,7 +152,7 @@ struct termios
 #define EXTA    0000016
 #define EXTB    0000017
 #define CBAUD   00377
-#define CBAUDEX 0000000
+#define CBAUDEX 0000020
 #define CIBAUD  077600000
 #define CMSPAR  010000000000
 #define CRTSCTS 020000000000
-- 
2.7.2



^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 16/16] fix struct termios in mips termios.h
  2016-04-10 12:09 [PATCH 00/16] sys/ioctl.h and termios.h cleanups Szabolcs Nagy
                   ` (14 preceding siblings ...)
  2016-04-10 12:16 ` [PATCH 15/16] fix CBAUDEX in powerpc termios.h Szabolcs Nagy
@ 2016-04-10 12:16 ` Szabolcs Nagy
  2016-07-01 19:00   ` Rich Felker
  15 siblings, 1 reply; 19+ messages in thread
From: Szabolcs Nagy @ 2016-04-10 12:16 UTC (permalink / raw)
  To: musl

mips termios struct has no ispeed and ospeed members in glibc,
mips64 is already consistent with glibc.

this is an abi change.
---
 arch/mips/bits/termios.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/mips/bits/termios.h b/arch/mips/bits/termios.h
index 29b4b22..d97df8c 100644
--- a/arch/mips/bits/termios.h
+++ b/arch/mips/bits/termios.h
@@ -1,13 +1,10 @@
-struct termios
-{
+struct termios {
 	tcflag_t c_iflag;
 	tcflag_t c_oflag;
 	tcflag_t c_cflag;
 	tcflag_t c_lflag;
 	cc_t c_line;
 	cc_t c_cc[NCCS];
-	speed_t __c_ispeed;
-	speed_t __c_ospeed;
 };
 
 #define VINTR     0
-- 
2.7.2



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 16/16] fix struct termios in mips termios.h
  2016-04-10 12:16 ` [PATCH 16/16] fix struct termios in mips termios.h Szabolcs Nagy
@ 2016-07-01 19:00   ` Rich Felker
  0 siblings, 0 replies; 19+ messages in thread
From: Rich Felker @ 2016-07-01 19:00 UTC (permalink / raw)
  To: musl

On Sun, Apr 10, 2016 at 02:16:24PM +0200, Szabolcs Nagy wrote:
> mips termios struct has no ispeed and ospeed members in glibc,
> mips64 is already consistent with glibc.
> 
> this is an abi change.
> ---
>  arch/mips/bits/termios.h | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/arch/mips/bits/termios.h b/arch/mips/bits/termios.h
> index 29b4b22..d97df8c 100644
> --- a/arch/mips/bits/termios.h
> +++ b/arch/mips/bits/termios.h
> @@ -1,13 +1,10 @@
> -struct termios
> -{
> +struct termios {
>  	tcflag_t c_iflag;
>  	tcflag_t c_oflag;
>  	tcflag_t c_cflag;
>  	tcflag_t c_lflag;
>  	cc_t c_line;
>  	cc_t c_cc[NCCS];
> -	speed_t __c_ispeed;
> -	speed_t __c_ospeed;
>  };

This patch (and the whole series) have been pending for a long time
because I did not remember all the motivations behind what musl is
doing now vs what glibc and the kernel do. I've finally gotten around
to digging it up, and here's what the situation seems to be:

While the kernel has lots of nasty legacy arch-specific termios
variants, glibc unifies them (mostly, with some minor exceptions like
omitting the speed fields on mips) and performs userspace
translations.

musl matches the glibc ABI on x86 and other "important ABI targets",
but does not perform any translation. Instead we allow cc_line to
move, and NCCS to vary (only if needed to make other members line up
with the ABI!), on a per-arch basis so that the kernel interfaces can
be used directly without translation. However, space for the unused
speed fields (and for most archs, the excessive NCCS value) were kept
around _in case_ we ever want to switch to doing some level of
translation to provide these facilities. The space for these things is
not to match existing kernel ABIs, but as safety room for
extensibility. So I do not want to be removing them or introducing new
archs that lack them.

What I'd like to do is go ahead and add them back to mips64/n32 (where
they were omitted) and drop this patch. Most of the rest of the
patches in this series are probably okay; I'll continue reviewing
them. The other mips64 ones need to be duplicated for n32, I think.

Rich


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 14/16] fix TCS* definitions in mips termios.h
  2016-07-03 15:01 [PATCH 00/16] sys/ioctl.h and termios.h cleanups Szabolcs Nagy
@ 2016-07-03 15:09 ` Szabolcs Nagy
  0 siblings, 0 replies; 19+ messages in thread
From: Szabolcs Nagy @ 2016-07-03 15:09 UTC (permalink / raw)
  To: musl

these were incorrectly using the generic definitions.
---
 arch/mips/bits/termios.h    | 6 +++---
 arch/mips64/bits/termios.h  | 6 +++---
 arch/mipsn32/bits/termios.h | 6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/mips/bits/termios.h b/arch/mips/bits/termios.h
index 55ba132..29b4b22 100644
--- a/arch/mips/bits/termios.h
+++ b/arch/mips/bits/termios.h
@@ -142,9 +142,9 @@ struct termios
 #define TCOFLUSH  1
 #define TCIOFLUSH 2
 
-#define TCSANOW   0
-#define TCSADRAIN 1
-#define TCSAFLUSH 2
+#define TCSANOW 0x540e
+#define TCSADRAIN 0x540f
+#define TCSAFLUSH 0x5410
 
 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
 #define EXTA    0000016
diff --git a/arch/mips64/bits/termios.h b/arch/mips64/bits/termios.h
index d831cfa..d97df8c 100644
--- a/arch/mips64/bits/termios.h
+++ b/arch/mips64/bits/termios.h
@@ -139,9 +139,9 @@ struct termios {
 #define TCOFLUSH  1
 #define TCIOFLUSH 2
 
-#define TCSANOW   0
-#define TCSADRAIN 1
-#define TCSAFLUSH 2
+#define TCSANOW 0x540e
+#define TCSADRAIN 0x540f
+#define TCSAFLUSH 0x5410
 
 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
 #define EXTA    0000016
diff --git a/arch/mipsn32/bits/termios.h b/arch/mipsn32/bits/termios.h
index d831cfa..d97df8c 100644
--- a/arch/mipsn32/bits/termios.h
+++ b/arch/mipsn32/bits/termios.h
@@ -139,9 +139,9 @@ struct termios {
 #define TCOFLUSH  1
 #define TCIOFLUSH 2
 
-#define TCSANOW   0
-#define TCSADRAIN 1
-#define TCSAFLUSH 2
+#define TCSANOW 0x540e
+#define TCSADRAIN 0x540f
+#define TCSAFLUSH 0x5410
 
 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
 #define EXTA    0000016
-- 
2.8.1



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2016-07-03 15:09 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-10 12:09 [PATCH 00/16] sys/ioctl.h and termios.h cleanups Szabolcs Nagy
2016-04-10 12:10 ` [PATCH 01/16] use the generic ioctl.h for x86_64, x32 and aarch64 Szabolcs Nagy
2016-04-10 12:10 ` [PATCH 02/16] remove linux asm/sockios.h macros from ioctl.h Szabolcs Nagy
2016-04-10 12:11 ` [PATCH 03/16] remove ioctl macros that were removed from linux uapi Szabolcs Nagy
2016-04-10 12:11 ` [PATCH 04/16] add missing SIOCSIFNAME from linux/sockios.h to ioctl.h Szabolcs Nagy
2016-04-10 12:11 ` [PATCH 05/16] add missing TIOC* macros " Szabolcs Nagy
2016-04-10 12:12 ` [PATCH 06/16] remove mips and powerpc ioctls that are missing from linux uapi Szabolcs Nagy
2016-04-10 12:12 ` [PATCH 07/16] fix mips and mips64 TIOCM_* macros in ioctl.h Szabolcs Nagy
2016-04-10 12:12 ` [PATCH 08/16] fix TIOCMSET in mips ioctl.h Szabolcs Nagy
2016-04-10 12:13 ` [PATCH 09/16] remove termios2 related ioctls from sh ioctl.h Szabolcs Nagy
2016-04-10 12:13 ` [PATCH 10/16] fix FIOQSIZE in arm ioctl.h Szabolcs Nagy
2016-04-10 12:14 ` [PATCH 11/16] fix generic termios.h to be more consistent with glibc Szabolcs Nagy
2016-04-10 12:14 ` [PATCH 12/16] fix powerpc " Szabolcs Nagy
2016-04-10 12:15 ` [PATCH 13/16] fix mips " Szabolcs Nagy
2016-04-10 12:15 ` [PATCH 14/16] fix TCS* definitions in mips termios.h Szabolcs Nagy
2016-04-10 12:16 ` [PATCH 15/16] fix CBAUDEX in powerpc termios.h Szabolcs Nagy
2016-04-10 12:16 ` [PATCH 16/16] fix struct termios in mips termios.h Szabolcs Nagy
2016-07-01 19:00   ` Rich Felker
2016-07-03 15:01 [PATCH 00/16] sys/ioctl.h and termios.h cleanups Szabolcs Nagy
2016-07-03 15:09 ` [PATCH 14/16] fix TCS* definitions in mips termios.h Szabolcs Nagy

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).