All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: monstr@monstr.eu
Cc: microblaze-uclinux@itee.uq.edu.au,
	LKML <linux-kernel@vger.kernel.org>,
	Remis Lima Baima <remis.developer@googlemail.com>
Subject: Re: [microblaze-uclinux] [PATCH 03/11] microblaze: fall back on generic header files for the ABI
Date: Wed, 1 Jul 2009 15:41:55 +0200	[thread overview]
Message-ID: <200907011541.56225.arnd@arndb.de> (raw)
In-Reply-To: <4A4B5213.9060003@monstr.eu>

On Wednesday 01 July 2009, Michal Simek wrote:
> I did this change because of problem with inconsistency between kernel/glibc.
> 
> Current our glibc ipc_perm struct - mode is short - that's why I have setup kernel_mode_t to short too.
> 
> /* Data structure used to pass permission information to IPC operations.  */
> 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 __seq;           /* Sequence number.  */
>     unsigned short int __pad1;
>     unsigned long int __unused1;
>     unsigned long int __unused2;
>   };
> 
> Does it make more sense to define it as int?

It's more complex than this.

AFAICT, it does not matter at all whether you define it as 16 or 32 bits,
as long as it all fits together. For the generic ABI, I used 32 bits where
they were commonly used by some architectures, because there are processors
that can more efficiently access 32 bit words than 16 bit words.

One major reason for starting the asm-generic ABI definitions was to make
sure that all architectures that don't have their ABI set in stone can
use the exact same ABI, and if you change just a small thing, you would still
diverge from the common ABI.

Now the definition you give above matches neither the one from your current
kernel header nor the one from the asm-generic file, because of the location
of the padding. Worse, the __pad1 field actually causes implicit padding instead
of preventing it.

I think you should just update your glibc files to match the generic kernel
headers, because changing the ABI means that you have to change other parts
of glibc anyway and to recompile every single user space program anyway.
Doing one more change won't hurt that much either.

	Arnd <><

  reply	other threads:[~2009-07-01 13:42 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-18 17:55 [PATCH 00/11] microblaze: use generic headers Arnd Bergmann
2009-06-18 17:55 ` [PATCH 01/11] ipc: use __ARCH_WANT_IPC_PARSE_VERSION in ipc/util.h Arnd Bergmann
2009-06-18 17:55   ` [PATCH 02/11] microblaze: remove init_mm Arnd Bergmann
2009-06-18 17:55   ` [PATCH 03/11] microblaze: fall back on generic header files for the ABI Arnd Bergmann
2009-07-01 11:34     ` [microblaze-uclinux] " Michal Simek
2009-07-01 11:42       ` Arnd Bergmann
2009-07-01 12:09         ` Michal Simek
2009-07-01 13:41           ` Arnd Bergmann [this message]
2009-07-01 22:52       ` John Williams
2009-07-02  9:36         ` Arnd Bergmann
2009-07-03  5:55           ` Michal Simek
2009-07-03 17:16             ` Arnd Bergmann
2009-06-18 17:55   ` [PATCH 04/11] microblaze: use generic unistd.h syscall list Arnd Bergmann
2009-06-18 17:55   ` [PATCH 05/11] microblaze: clean up signal handling Arnd Bergmann
2009-06-18 17:55   ` [PATCH 06/11] microblaze: use generic syscalls.h Arnd Bergmann
2009-06-18 17:55   ` [PATCH 07/11] microblaze: make syscall_table implementation generic Arnd Bergmann
2009-06-18 17:55   ` [PATCH 08/11] microblaze: use the generic lib/checksum.c Arnd Bergmann
2009-07-01 11:35     ` [microblaze-uclinux] " Michal Simek
2009-06-18 17:55   ` [PATCH 09/11] microblaze: convert all simple headers to use asm-generic Arnd Bergmann
2009-07-01 11:35     ` [microblaze-uclinux] " Michal Simek
2009-06-18 17:55   ` [PATCH 10/11] microblaze: use generic system.h Arnd Bergmann
2009-07-01 11:19     ` [microblaze-uclinux] " Michal Simek
2009-07-01 11:39       ` Arnd Bergmann
2009-07-01 11:51         ` Michal Simek
2009-06-18 17:55   ` [PATCH 11/11] microblaze: remove sys_ipc Arnd Bergmann
2009-06-18 22:31   ` [PATCH 01/11] ipc: use __ARCH_WANT_IPC_PARSE_VERSION in ipc/util.h Arnd Bergmann
2009-06-20  1:09     ` [patch] ipc: unbreak 32-bit shmctl/semctl/msgctl Johannes Weiner
2009-06-20  8:20       ` Arnd Bergmann
2009-06-21 19:01         ` Johannes Weiner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200907011541.56225.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=microblaze-uclinux@itee.uq.edu.au \
    --cc=monstr@monstr.eu \
    --cc=remis.developer@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.