This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add ipc.h for aarch64



On 24/10/2014 15:33, "Carlos O'Donell" <carlos@redhat.com> wrote:

>On 10/21/2014 11:30 AM, Alan Hayward wrote:
>> For this patch I would just make the changes Marcus suggested.
>> 
>> Does that make sense?
>
>Yes.
>
>Though the cleanup and single ipc.h is where I'd like to see us go.
>
>c.

Iâve spent some more time investigating this, and I now no longer think we
can easily reduce the number of ipc.h files.

There were a couple of things I didnât appreciate previously:

* There are 8 architectures which currently use the common file.
* We canât just start switching between, say __uid_t and unsigned int,
even if in the general case for a particular architecture these types are
exactly the same size.
* A change in a file might not break any test cases, but itâs an ABI
change and could subtly break existing external applications that might
depend on exact structure orders and pad names.
* This will require regressions testing on all architectures, which is
going to very tricky.


I could only reasonably create a new common file if the structure was
identical for many architectures. But we do have subtle differences
between each of the 64bit targets.
i.e. - mips/alpha uses unsigned ints instead of typedefs; hppa has
different explicit named padding; power pc has extra defines at the end of
the file; the __WORDSIZE == 32 checks mean different architectures match
on 32bit than they do on 64bit
This results in no one common format between them. In the end the most
common version of the file is the one which currently common version. Even
if I added #if __WORDSIZE == 32 checks into the common file then I could
break existing 64bit architectures.

For the benefit of reducing a few files, this is going to carry a lot of
hidden risk.



As a reference, here they all are:


	hppa-*-linux-gnu	Not currently functional without patches.
struct ipc_perm
  {
    __key_t __key;			/* Key.  */
    __uid_t uid;			/* Owner's user ID.  */
    __gid_t gid;			/* Owner's group ID.  */
    __uid_t cuid;			/* Creator's user ID.  */
    __gid_t cgid;			/* Creator's group ID.  */
#if __WORDSIZE == 32
    unsigned short int __pad1;
    unsigned short int mode;		/* Read/write permission.  */
    unsigned short int __pad2;
#else
    __mode_t mode;			/* Read/write permission.  */
    unsigned short int __pad2;
#endif
    unsigned short int __seq;		/* Sequence number.  */
    unsigned int __pad3;
    __extension__ unsigned long long int __glibc_reserved1;
    __extension__ unsigned long long int __glibc_reserved2;
  };


	ia64-*-linux-gnu
struct ipc_perm
  {
    __key_t __key;			/* Key.  */
    __uid_t uid;			/* Owner's user ID.  */
    __gid_t gid;			/* Owner's group ID.  */
    __uid_t cuid;			/* Creator's user ID.  */
    __gid_t cgid;			/* Creator's group ID.  */
    __mode_t mode;			/* Read/write permission.  */
    unsigned short int __seq;		/* Sequence number.  */
    unsigned short int __pad1;
    unsigned long int __glibc_reserved1;
    unsigned long int __glibc_reserved2;
  };


	mips-*-linux-gnu
	mips64-*-linux-gnu
	alpha*-*-linux-gnu
struct ipc_perm
  {
    __key_t __key;			/* Key.  */
    unsigned int uid;			/* Owner's user ID.  */
    unsigned int gid;			/* Owner's group ID.  */
    unsigned int cuid;			/* Creator's user ID.  */
    unsigned int cgid;			/* Creator's group ID.	*/
    unsigned int mode;			/* Read/write permission.  */
    unsigned short int __seq;		/* Sequence number.  */
    unsigned short int __pad1;
    unsigned long int __glibc_reserved1;
    unsigned long int __glibc_reserved2;
};


	sparc*-*-linux-gnu
	sparc64*-*-linux-gnu
struct ipc_perm
  {
    __key_t __key;			/* Key.  */
    __uid_t uid;			/* Owner's user ID.  */
    __gid_t gid;			/* Owner's group ID.  */
    __uid_t cuid;			/* Creator's user ID.  */
    __gid_t cgid;			/* Creator's group ID.  */
#if __WORDSIZE == 32
    unsigned short int __pad1;
    unsigned short int mode;		/* Read/write permission.  */
    unsigned short int __pad2;
#else
    __mode_t mode;			/* Read/write permission.  */
    unsigned short int __pad1;
#endif
    unsigned short int __seq;		/* Sequence number.  */
    __extension__ unsigned long long int __glibc_reserved1;
    __extension__ unsigned long long int __glibc_reserved2;
  };


powerpc-*-linux-gnu
powerpc64*-*-linux-gnu
struct ipc_perm
{
__key_t __key;	 /* Key. */
__uid_t uid;	 /* Owner's user ID. */
__gid_t gid;	 /* Owner's group ID. */
__uid_t cuid;	 /* Creator's user ID. */
__gid_t cgid;	 /* Creator's group ID. */
__mode_t mode;	 /* Read/write permission. */
__uint32_t __seq;	 /* Sequence number. */
__uint32_t __pad1;
__uint64_t __glibc_reserved1;
__uint64_t __glibc_reserved2;
};
...also includes extra ipc and semop defines



	s390-*-linux-gnu
	s390x-*-linux-gnu
struct ipc_perm
  {
    __key_t __key;			/* Key.	 */
    __uid_t uid;			/* Owner's user ID.  */
    __gid_t gid;			/* Owner's group ID.  */
    __uid_t cuid;			/* Creator's user ID.  */
    __gid_t cgid;			/* Creator's group ID.	*/
#if __WORDSIZE == 64
    __mode_t mode;			/* Read/write permission.  */
#else
    unsigned short int mode;		/* Read/write permission.  */
    unsigned short int __pad1;
#endif
    unsigned short int __seq;		/* Sequence number.  */
    unsigned short int __pad2;
    unsigned long int __glibc_reserved1;
    unsigned long int __glibc_reserved2;
  };


	aarch64*-*-linux-gnu
struct ipc_perm
  {
    __key_t __key;                     /* Key.  */
    __uid_t uid;                       /* Owner's user ID.  */
    __gid_t gid;                       /* Owner's group ID.  */
    __uid_t cuid;                      /* Creator's user ID.  */
    __gid_t cgid;                      /* Creator's group ID.  */
    unsigned int mode;                 /* Read/write permission.  */
    unsigned short int __seq;          /* Sequence number.  */
    unsigned short int __pad1;
    __syscall_ulong_t __glibc_reserved1;
    __syscall_ulong_t __glibc_reserved2;
  };


Common version

	arm-*-linux-gnueabi
	i[4567]86-*-linux-gnu
	x86_64-*-linux-gnu	Can build either x86_64 or x32
	m68k-*-linux-gnu
	microblaze*-*-linux-gnu
	sh[34]-*-linux-gnu
	tilegx-*-linux-gnu
	tilepro-*-linux-gnu
struct ipc_perm
  {
    __key_t __key;			/* Key.  */
    __uid_t uid;			/* Owner's user ID.  */
    __gid_t gid;			/* Owner's group ID.  */
    __uid_t cuid;			/* Creator's user ID.  */
    __gid_t cgid;			/* Creator's group ID.  */
    unsigned short int mode;		/* Read/write permission.  */
    unsigned short int __pad1;
    unsigned short int __seq;		/* Sequence number.  */
    unsigned short int __pad2;
    __syscall_ulong_t __glibc_reserved1;
    __syscall_ulong_t __glibc_reserved2;
  };



Alan.





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]