This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: __need macros for communication with compiler-provided headers
- From: Chris Metcalf <cmetcalf at mellanox dot com>
- To: Zack Weinberg <zackw at panix dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 22 Mar 2017 14:08:51 -0400
- Subject: Re: __need macros for communication with compiler-provided headers
- Authentication-results: sourceware.org; auth=none
- Authentication-results: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=mellanox.com;
- References: <CAKCAbMibcYpoYMMLWY=R6_uz1NqAt+v9zapU=VpOD-+Xi4eZMw@mail.gmail.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On 3/22/2017 11:21 AM, Zack Weinberg wrote:
__need_int_reg_t requests a single definition from
the Tile-specific arch/abi.h (I don't_know_ that this is provided by
the compiler, but it's not in our source tree).
It's provided in the Linux tree, as arch/tile/include/uapi/arch/abi.h .
In retrospect I'm not sure this was the cleanest possible approach,
but it's the one we ended up using.
The int_reg_t type (and related, uint_reg_t, INT_REG_FMT, and
INT_REG_BITS) tell you whether the architecture fundamentally has
32-bit types (tilepro) or 64-bit types (tilegx). This avoids various
issues with ILP32 mode on tilegx, where we might be tempted to assume
registers were only 32-bits, even though they are in fact 64 bits. We
use the type for registers in sigcontext.h and ptrace.h in the kernel,
and similarly ucontext.h, setjmp.h, etc in glibc.
--
Chris Metcalf, Mellanox Technologies
http://www.mellanox.com