mailing list of musl libc
 help / color / mirror / code / Atom feed
* mips64/n32 struct termios
@ 2016-04-26 17:27 Rich Felker
  2016-04-26 18:44 ` Szabolcs Nagy
  0 siblings, 1 reply; 3+ messages in thread
From: Rich Felker @ 2016-04-26 17:27 UTC (permalink / raw)
  To: musl; +Cc: Jaydeep Patil

I noticed that the mips64/n32 versions of struct termios have omitted
the two speed_t fields at the end, which other archs (including mips)
all have. It's dubious whether these make sense or are useful for
anything, and I don't even recall the whole history of why we have
them, but as long as we do have them for all the other archs I kind of
think it makes sense to put them back for mips64/n32 in case we ever
need them for something (or for expansion) or want generic code to be
able to access them.

Was there a reason they were omitted in the new ports? Any objection
to adding them back?

Rich


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

* Re: mips64/n32 struct termios
  2016-04-26 17:27 mips64/n32 struct termios Rich Felker
@ 2016-04-26 18:44 ` Szabolcs Nagy
  2016-04-27  4:44   ` Jaydeep Patil
  0 siblings, 1 reply; 3+ messages in thread
From: Szabolcs Nagy @ 2016-04-26 18:44 UTC (permalink / raw)
  To: musl; +Cc: Jaydeep Patil

* Rich Felker <dalias@libc.org> [2016-04-26 13:27:04 -0400]:
> I noticed that the mips64/n32 versions of struct termios have omitted
> the two speed_t fields at the end, which other archs (including mips)
> all have. It's dubious whether these make sense or are useful for
> anything, and I don't even recall the whole history of why we have
> them, but as long as we do have them for all the other archs I kind of
> think it makes sense to put them back for mips64/n32 in case we ever
> need them for something (or for expansion) or want generic code to be
> able to access them.
> 
> Was there a reason they were omitted in the new ports? Any objection
> to adding them back?

see my [PATCH 16/16] fix struct termios in mips termios.h
(that can be done in the other direction fixing mips64,n32)

termios struct is special on mips and ppc:

mips glibc: NCCS = 32, no speed fields
mips linux: NCCS = 23

ppc glibc: NCCS = 32, speed fields
ppc linux: NCCS = 19, c_line swapped, only termios, no termios2

other glibc: NCCS = 32, speed fields
other linux: NCCS = 19

the kernel side only has speed fields in termios2 except on ppc
where termios has them, in glibc termios has speed fields except
on mips.  (the __ prefixed fields are only present in musl probably
to match the termios struct size on x86.)

i don't know why there are these differences and how it can work
in practice, but e.g. util-linux ldattach seems to use them with
BOTHER cflag and probably one can query them with TCGETS(2).

glibc tcsetattr/tcgetattr translates glibc termios to kernel
termios, so one can set/get the fields that way too and there
is further powerpc specific magic in that translation.

> 
> Rich


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

* RE: mips64/n32 struct termios
  2016-04-26 18:44 ` Szabolcs Nagy
@ 2016-04-27  4:44   ` Jaydeep Patil
  0 siblings, 0 replies; 3+ messages in thread
From: Jaydeep Patil @ 2016-04-27  4:44 UTC (permalink / raw)
  To: Szabolcs Nagy, musl

>-----Original Message-----
>From: Szabolcs Nagy [mailto:nsz@port70.net]
>Sent: 27 April 2016 AM 12:14
>To: musl@lists.openwall.com
>Cc: Jaydeep Patil
>Subject: Re: [musl] mips64/n32 struct termios
>
>* Rich Felker <dalias@libc.org> [2016-04-26 13:27:04 -0400]:
>> I noticed that the mips64/n32 versions of struct termios have omitted
>> the two speed_t fields at the end, which other archs (including mips)
>> all have. It's dubious whether these make sense or are useful for
>> anything, and I don't even recall the whole history of why we have
>> them, but as long as we do have them for all the other archs I kind of
>> think it makes sense to put them back for mips64/n32 in case we ever
>> need them for something (or for expansion) or want generic code to be
>> able to access them.
>>
>> Was there a reason they were omitted in the new ports? Any objection
>> to adding them back?
>
>see my [PATCH 16/16] fix struct termios in mips termios.h (that can be done in
>the other direction fixing mips64,n32)
>
>termios struct is special on mips and ppc:
>
>mips glibc: NCCS = 32, no speed fields
>mips linux: NCCS = 23
>
>ppc glibc: NCCS = 32, speed fields
>ppc linux: NCCS = 19, c_line swapped, only termios, no termios2
>
>other glibc: NCCS = 32, speed fields
>other linux: NCCS = 19
>
>the kernel side only has speed fields in termios2 except on ppc where termios
>has them, in glibc termios has speed fields except on mips.  (the __ prefixed
>fields are only present in musl probably to match the termios struct size on
>x86.)
>
>i don't know why there are these differences and how it can work in practice,
>but e.g. util-linux ldattach seems to use them with BOTHER cflag and probably
>one can query them with TCGETS(2).
>
>glibc tcsetattr/tcgetattr translates glibc termios to kernel termios, so one can
>set/get the fields that way too and there is further powerpc specific magic in
>that translation.

I don't see any significance/reference to input/output speed fields of the struct termios in mips linux/glibc. 
We can omit these fields.

>>
>> Rich


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

end of thread, other threads:[~2016-04-27  4:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-26 17:27 mips64/n32 struct termios Rich Felker
2016-04-26 18:44 ` Szabolcs Nagy
2016-04-27  4:44   ` Jaydeep Patil

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).