[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAMe9rOoM5DDs+vVNA1Z4DnL8zUnm2ZZ8wN-1a8EJyyRo9w7uSw@mail.gmail.com>
Date: Wed, 21 Aug 2013 13:20:48 -0700
From: "H.J. Lu" <hjl.tools@...il.com>
To: LKML <linux-kernel@...r.kernel.org>
Cc: "H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>, tiwai@...e.de,
perex@...ex.cz, alsa-devel@...a-project.org
Subject: [PATCH 1/2] Add __compat_aligned_s64 and __compat_aligned_u64
X32 uses the 32-bit compat layer for 32-bit kernel interface, which is
also used by ia32. But long long is 4-byte aligned for ia32 and 8-byte
aligned for x32. When the long long field in a system call struct has
different offsets between ia32 and x32 due to alignment padding, like
struct snd_ctl_elem_value in include/uapi/sound/asound.h, we need to
either add a special case for x32 or we can use 4-byte aligned long
long in the system call struct so that x32 can share the same compat
system cal with ia32. This patch adds __compat_aligned_s64 and
__compat_aligned_u64 to include/uapi/asm-generic/int-ll64.h. By
default, they are the same as __s64/__u64. It does the following
things:
1. Add default __compat_aligned_s64/__compat_aligned_u64 to
include/uapi/asm-generic/int-ll64.h.
2. Add arch/x86/include/asm/types.h for kernel internal use, which is the
same as before, i.e., <asm-generic/types.h>.
3. Change arch/x86/include/uapi/asm/types.h not to use the default
include/uapi/asm-generic/int-ll64.h. Instead, it has a modified copy
of include/uapi/asm-generic/int-ll64.h with 4-byte aligned
__compat_aligned_s64 and __compat_aligned_u64 for x32 and ia32.
When building x86 kernel, nothing is changed. The difference is
x32 can use 4-byte aligned long long for system calls so that it
can share the same 32-bit compat system call with ia32.
--
H.J.
Download attachment "0001-Add-__compat_aligned_s64-and-__compat_aligned_u64.patch" of type "application/octet-stream" (3812 bytes)
Powered by blists - more mailing lists