[PATCH v2 02/12] termios: Consolidate struct termios

Siddhesh Poyarekar siddhesh@gotplt.org
Mon Dec 31 15:39:00 GMT 2018


On 28/12/18 6:39 AM, Adhemerval Zanella wrote:
> This patch consolidates the struct termios definition on its own header
> and adds arch-defined ones for ABIs that deviate from generic
> implementation. They are:
> 
>    - alpha which has a slight different layout than generic one (c_cc
>      field is defined prior c_line).
> 
>    - sparc and mips which do not have the c_ispeed/c_ospeed fields.
> 
> No semantic change is expected, checked on a build against x86_64-linux-gnu,
> alpha-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu.
> 
> 	* sysdeps/unix/sysv/linux/alpha/bits/termios-struct.h: New file.
> 	* sysdeps/unix/sysv/linux/bits/termios-struct.h: Likewise.
> 	* sysdeps/unix/sysv/linux/mips/bits/termios-struct.h: Likewise.
> 	* sysdeps/unix/sysv/linux/sparc/bits/termios-struct.h: Likewise.
> 	* sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add
> 	termios-struct.h.
> 	* sysdeps/unix/sysv/linux/bits/termios.h (struct termios): Move to
> 	termios-struct.h.
> 	* sysdeps/unix/sysv/linux/alpha/bits/termios.h (struct termios):
> 	Likewise.
> 	* sysdeps/unix/sysv/linux/mips/bits/termios.h (struct termios):
> 	Likewise.
> 	* sysdeps/unix/sysv/linux/powerpc/bits/termios.h (struct termios):
> 	Likewise.
> 	* sysdeps/unix/sysv/linux/sparc/bits/termios.h (struct termios):
> 	Likewise.
> 	* sysdeps/unix/sysv/linux/kernel_termios.h (_HAVE_C_ISPEED,
> 	_HAVE_C_OSPEED): Define.
> 	* sysdeps/unix/sysv/linux/mips/kernel_termios.h (_HAVE_C_ISPEED,
> 	_HAVE_C_OSPEED): Likewise.
> 	* sysdeps/unix/sysv/linux/sparc/kernel_termios.h (_HAVE_C_ISPEED,
> 	_HAVE_C_OSPEED): Likewise.
> 	* sysdeps/unix/sysv/linux/speed.c [_HAVE_STRUCT_TERMIOS_C_OSPEED]
> 	(cfsetospeed): Check for define value instead of existence.
> 	[_HAVE_STRUCT_TERMIOS_C_ISPEED] (cfsetispeed): Likewise.
> 	* sysdeps/unix/sysv/linux/tcgetattr.c [_HAVE_STRUCT_TERMIOS_C_ISPEED
> 	&& _HAVE_C_ISPEED] (__tcgetattr): Likewise.
> 	* sysdeps/unix/sysv/linux/tcsetattr.c [_HAVE_STRUCT_TERMIOS_C_ISPEED
> 	&& _HAVE_C_ISPEED] (__tcsetattr): Likewise.

OK, I assume you've tested to ensure that there are no codegen changes 
due to this.  An easy way to do that is to compare output of objdump -d 
with and without the change.

Siddhesh



More information about the Libc-alpha mailing list