2005-12-13 09:26:19 +00:00
|
|
|
/* Processor capability information handling macros. PowerPC version.
|
2024-01-01 18:12:26 +00:00
|
|
|
Copyright (C) 2005-2024 Free Software Foundation, Inc.
|
2005-12-13 09:26:19 +00:00
|
|
|
This file is part of the GNU C Library.
|
|
|
|
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2013-06-11 14:32:41 +00:00
|
|
|
License along with the GNU C Library. If not, see
|
Prefer https to http for gnu.org and fsf.org URLs
Also, change sources.redhat.com to sourceware.org.
This patch was automatically generated by running the following shell
script, which uses GNU sed, and which avoids modifying files imported
from upstream:
sed -ri '
s,(http|ftp)(://(.*\.)?(gnu|fsf|sourceware)\.org($|[^.]|\.[^a-z])),https\2,g
s,(http|ftp)(://(.*\.)?)sources\.redhat\.com($|[^.]|\.[^a-z]),https\2sourceware.org\4,g
' \
$(find $(git ls-files) -prune -type f \
! -name '*.po' \
! -name 'ChangeLog*' \
! -path COPYING ! -path COPYING.LIB \
! -path manual/fdl-1.3.texi ! -path manual/lgpl-2.1.texi \
! -path manual/texinfo.tex ! -path scripts/config.guess \
! -path scripts/config.sub ! -path scripts/install-sh \
! -path scripts/mkinstalldirs ! -path scripts/move-if-change \
! -path INSTALL ! -path locale/programs/charmap-kw.h \
! -path po/libc.pot ! -path sysdeps/gnu/errlist.c \
! '(' -name configure \
-execdir test -f configure.ac -o -f configure.in ';' ')' \
! '(' -name preconfigure \
-execdir test -f preconfigure.ac ';' ')' \
-print)
and then by running 'make dist-prepare' to regenerate files built
from the altered files, and then executing the following to cleanup:
chmod a+x sysdeps/unix/sysv/linux/riscv/configure
# Omit irrelevant whitespace and comment-only changes,
# perhaps from a slightly-different Autoconf version.
git checkout -f \
sysdeps/csky/configure \
sysdeps/hppa/configure \
sysdeps/riscv/configure \
sysdeps/unix/sysv/linux/csky/configure
# Omit changes that caused a pre-commit check to fail like this:
# remote: *** error: sysdeps/powerpc/powerpc64/ppc-mcount.S: trailing lines
git checkout -f \
sysdeps/powerpc/powerpc64/ppc-mcount.S \
sysdeps/unix/sysv/linux/s390/s390-64/syscall.S
# Omit change that caused a pre-commit check to fail like this:
# remote: *** error: sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: last line does not end in newline
git checkout -f sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
2019-09-07 05:40:42 +00:00
|
|
|
<https://www.gnu.org/licenses/>. */
|
2005-12-13 09:26:19 +00:00
|
|
|
|
|
|
|
#ifndef _DL_PROCINFO_H
|
2013-06-11 14:32:41 +00:00
|
|
|
#define _DL_PROCINFO_H 1
|
2005-12-13 09:26:19 +00:00
|
|
|
|
|
|
|
#include <ldsodefs.h>
|
2013-06-28 21:52:49 +00:00
|
|
|
#include <sysdep.h> /* This defines the PPC_FEATURE[2]_* macros. */
|
2005-12-13 09:26:19 +00:00
|
|
|
|
2024-03-19 20:29:48 +00:00
|
|
|
/* Feature masks are all 32-bits in size. */
|
|
|
|
#define _DL_HWCAP_SIZE 32
|
2013-06-28 21:52:49 +00:00
|
|
|
|
2024-03-19 20:29:48 +00:00
|
|
|
/* AT_HWCAP2 feature strings follow the AT_HWCAP feature strings. */
|
|
|
|
#define _DL_HWCAP2_OFFSET _DL_HWCAP_SIZE
|
2013-06-28 21:52:49 +00:00
|
|
|
|
2024-03-19 20:29:48 +00:00
|
|
|
/* AT_HWCAP3 feature strings follow the AT_HWCAP2 feature strings. */
|
|
|
|
#define _DL_HWCAP3_OFFSET (_DL_HWCAP2_OFFSET + _DL_HWCAP_SIZE)
|
|
|
|
|
|
|
|
/* AT_HWCAP4 feature strings follow the AT_HWCAP3 feature strings. */
|
|
|
|
#define _DL_HWCAP4_OFFSET (_DL_HWCAP3_OFFSET + _DL_HWCAP_SIZE)
|
2005-12-13 09:26:19 +00:00
|
|
|
|
|
|
|
|
2013-06-11 14:32:41 +00:00
|
|
|
#define _DL_FIRST_PLATFORM 32
|
2005-12-13 09:26:19 +00:00
|
|
|
|
2006-12-19 15:30:39 +00:00
|
|
|
/* Platform bits (relative to _DL_FIRST_PLATFORM). */
|
|
|
|
#define PPC_PLATFORM_POWER4 0
|
|
|
|
#define PPC_PLATFORM_PPC970 1
|
|
|
|
#define PPC_PLATFORM_POWER5 2
|
|
|
|
#define PPC_PLATFORM_POWER5_PLUS 3
|
|
|
|
#define PPC_PLATFORM_POWER6 4
|
|
|
|
#define PPC_PLATFORM_CELL_BE 5
|
|
|
|
#define PPC_PLATFORM_POWER6X 6
|
2008-08-08 04:51:57 +00:00
|
|
|
#define PPC_PLATFORM_POWER7 7
|
2010-10-25 01:47:33 +00:00
|
|
|
#define PPC_PLATFORM_PPCA2 8
|
2013-06-11 14:32:41 +00:00
|
|
|
#define PPC_PLATFORM_PPC405 9
|
|
|
|
#define PPC_PLATFORM_PPC440 10
|
|
|
|
#define PPC_PLATFORM_PPC464 11
|
|
|
|
#define PPC_PLATFORM_PPC476 12
|
2013-06-24 20:33:32 +00:00
|
|
|
#define PPC_PLATFORM_POWER8 13
|
2015-11-04 21:30:49 +00:00
|
|
|
#define PPC_PLATFORM_POWER9 14
|
2020-06-24 21:04:41 +00:00
|
|
|
#define PPC_PLATFORM_POWER10 15
|
2024-03-20 00:08:47 +00:00
|
|
|
#define PPC_PLATFORM_POWER11 16
|
2006-12-19 15:30:39 +00:00
|
|
|
|
2005-12-13 09:26:19 +00:00
|
|
|
static inline const char *
|
|
|
|
__attribute__ ((unused))
|
|
|
|
_dl_hwcap_string (int idx)
|
|
|
|
{
|
2015-12-28 18:36:46 +00:00
|
|
|
return GLRO(dl_powerpc_cap_flags)[idx];
|
2006-09-15 07:48:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline int
|
|
|
|
__attribute__ ((unused, always_inline))
|
|
|
|
_dl_string_platform (const char *str)
|
|
|
|
{
|
|
|
|
if (str == NULL)
|
|
|
|
return -1;
|
|
|
|
|
2016-11-21 16:40:01 +00:00
|
|
|
if (strncmp (str, "power", 5) == 0)
|
2006-09-15 07:48:10 +00:00
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
str += 5;
|
|
|
|
switch (*str)
|
|
|
|
{
|
2020-06-24 21:04:41 +00:00
|
|
|
case '1':
|
|
|
|
if (str[1] == '0')
|
|
|
|
{
|
|
|
|
ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER10;
|
2020-07-21 21:01:39 +00:00
|
|
|
str++;
|
2020-06-24 21:04:41 +00:00
|
|
|
}
|
2024-03-20 00:08:47 +00:00
|
|
|
else if (str[1] == '1')
|
|
|
|
{
|
|
|
|
ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER11;
|
|
|
|
str++;
|
|
|
|
}
|
2020-06-24 21:04:41 +00:00
|
|
|
else
|
|
|
|
return -1;
|
|
|
|
break;
|
2006-09-15 07:48:10 +00:00
|
|
|
case '4':
|
2006-12-19 15:30:39 +00:00
|
|
|
ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER4;
|
2006-09-15 07:48:10 +00:00
|
|
|
break;
|
|
|
|
case '5':
|
2006-12-19 15:30:39 +00:00
|
|
|
ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER5;
|
2006-09-15 07:48:10 +00:00
|
|
|
if (str[1] == '+')
|
2006-12-19 15:30:39 +00:00
|
|
|
{
|
|
|
|
ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER5_PLUS;
|
|
|
|
++str;
|
|
|
|
}
|
2006-09-15 07:48:10 +00:00
|
|
|
break;
|
|
|
|
case '6':
|
2006-12-19 15:30:39 +00:00
|
|
|
ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER6;
|
|
|
|
if (str[1] == 'x')
|
|
|
|
{
|
|
|
|
ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER6X;
|
|
|
|
++str;
|
|
|
|
}
|
2006-09-15 07:48:10 +00:00
|
|
|
break;
|
2008-08-08 04:51:57 +00:00
|
|
|
case '7':
|
|
|
|
ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER7;
|
|
|
|
break;
|
2013-06-24 20:33:32 +00:00
|
|
|
case '8':
|
|
|
|
ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER8;
|
|
|
|
break;
|
2015-11-04 21:30:49 +00:00
|
|
|
case '9':
|
|
|
|
ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER9;
|
|
|
|
break;
|
2006-09-15 07:48:10 +00:00
|
|
|
default:
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if (str[1] == '\0')
|
2013-06-11 14:32:41 +00:00
|
|
|
return ret;
|
2006-09-15 07:48:10 +00:00
|
|
|
}
|
2016-11-21 16:40:01 +00:00
|
|
|
else if (strncmp (str, "ppc", 3) == 0)
|
2006-09-15 07:48:10 +00:00
|
|
|
{
|
2016-11-21 16:40:01 +00:00
|
|
|
if (strcmp (str + 3, "970") == 0)
|
2006-12-19 15:30:39 +00:00
|
|
|
return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC970;
|
2016-11-21 16:40:01 +00:00
|
|
|
else if (strcmp (str + 3, "-cell-be") == 0)
|
2006-12-19 15:30:39 +00:00
|
|
|
return _DL_FIRST_PLATFORM + PPC_PLATFORM_CELL_BE;
|
2016-11-21 16:40:01 +00:00
|
|
|
else if (strcmp (str + 3, "a2") == 0)
|
2010-10-25 01:47:33 +00:00
|
|
|
return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPCA2;
|
2016-11-21 16:40:01 +00:00
|
|
|
else if (strcmp (str + 3, "405") == 0)
|
2013-06-11 14:32:41 +00:00
|
|
|
return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC405;
|
2016-11-21 16:40:01 +00:00
|
|
|
else if (strcmp (str + 3, "440") == 0)
|
2013-06-11 14:32:41 +00:00
|
|
|
return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC440;
|
2016-11-21 16:40:01 +00:00
|
|
|
else if (strcmp (str + 3, "464") == 0)
|
2013-06-11 14:32:41 +00:00
|
|
|
return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC464;
|
2016-11-21 16:40:01 +00:00
|
|
|
else if (strcmp (str + 3, "476") == 0)
|
2013-06-11 14:32:41 +00:00
|
|
|
return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC476;
|
2006-09-15 07:48:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
2005-12-13 09:26:19 +00:00
|
|
|
|
2014-11-20 15:39:43 +00:00
|
|
|
#if IS_IN (rtld)
|
Print cache size and geometry auxv types on LD_SHOW_AUXV=1
Add support for AT_L1I_CACHESIZE, AT_L1I_CACHEGEOMETRY,
AT_L1D_CACHESIZE, AT_L1D_CACHEGEOMETRY, AT_L2_CACHESIZE,
AT_L2_CACHEGEOMETRY, AT_L3_CACHESIZE and AT_L3_CACHEGEOMETRY when
LD_SHOW_AUXV=1.
AT_L*_CACHESIZE is printed as decimal and represent the number of
bytes of the cache.
AT_L*_CACHEGEOMETRY is treated in order to specify the cache line size
and its associativity.
Example output from a POWER8:
AT_L1I_CACHESIZE: 32768
AT_L1I_CACHEGEOMETRY: 128B line size, 8-way set associative
AT_L1D_CACHESIZE: 65536
AT_L1D_CACHEGEOMETRY: 128B line size, 8-way set associative
AT_L2_CACHESIZE: 524288
AT_L2_CACHEGEOMETRY: 128B line size, 8-way set associative
AT_L3_CACHESIZE: 8388608
AT_L3_CACHEGEOMETRY: 128B line size, 8-way set associative
Some of the new types are longer than the previous ones, requiring to
increase the indentation in order to keep the values aligned.
* elf/dl-sysdep.c (auxvars): Add AT_L1I_CACHESIZE,
AT_L1I_CACHEGEOMETRY, AT_L1D_CACHESIZE, AT_L1D_CACHEGEOMETRY,
AT_L2_CACHESIZE, AT_L2_CACHEGEOMETRY, AT_L3_CACHESIZE and
AT_L3_CACHEGEOMETRY. Fix indentation when printing the other
fields.
(_dl_show_auxv): Give a special treatment to
AT_L1I_CACHEGEOMETRY, AT_L1D_CACHEGEOMETRY, AT_L2_CACHEGEOMETRY
and AT_L3_CACHEGEOMETRY.
* sysdeps/powerpc/dl-procinfo.h (cache_geometry): New function.
(_dl_procinfo): Fix indentation when printing AT_HWCAP and
AT_HWCAP2. Add support for AT_L1I_CACHEGEOMETRY,
AT_L1D_CACHEGEOMETRY, AT_L2_CACHEGEOMETRY and AT_L3_CACHEGEOMETRY.
Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
2018-12-19 21:03:12 +00:00
|
|
|
static inline void
|
|
|
|
cache_geometry (const char * name, unsigned long int geometry)
|
|
|
|
{
|
|
|
|
unsigned long int assocty, line;
|
|
|
|
|
|
|
|
_dl_printf ("%s", name);
|
|
|
|
|
|
|
|
line = geometry & 0xffff;
|
|
|
|
assocty = (geometry >> 16) & 0xffff;
|
|
|
|
|
|
|
|
if (line == 0)
|
|
|
|
_dl_printf ("Unknown line size, ");
|
|
|
|
else
|
|
|
|
_dl_printf ("%luB line size, ", line);
|
|
|
|
|
|
|
|
switch (assocty)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
_dl_printf ("Unknown associativity");
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
_dl_printf ("Directly mapped");
|
|
|
|
break;
|
|
|
|
case 0xffff:
|
|
|
|
_dl_printf ("Fully associative");
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
_dl_printf ("%lu-way set associative", assocty);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-12-13 09:26:19 +00:00
|
|
|
static inline int
|
|
|
|
__attribute__ ((unused))
|
2013-06-28 21:50:48 +00:00
|
|
|
_dl_procinfo (unsigned int type, unsigned long int word)
|
2005-12-13 09:26:19 +00:00
|
|
|
{
|
2013-06-28 21:52:49 +00:00
|
|
|
switch(type)
|
|
|
|
{
|
|
|
|
case AT_HWCAP:
|
Print cache size and geometry auxv types on LD_SHOW_AUXV=1
Add support for AT_L1I_CACHESIZE, AT_L1I_CACHEGEOMETRY,
AT_L1D_CACHESIZE, AT_L1D_CACHEGEOMETRY, AT_L2_CACHESIZE,
AT_L2_CACHEGEOMETRY, AT_L3_CACHESIZE and AT_L3_CACHEGEOMETRY when
LD_SHOW_AUXV=1.
AT_L*_CACHESIZE is printed as decimal and represent the number of
bytes of the cache.
AT_L*_CACHEGEOMETRY is treated in order to specify the cache line size
and its associativity.
Example output from a POWER8:
AT_L1I_CACHESIZE: 32768
AT_L1I_CACHEGEOMETRY: 128B line size, 8-way set associative
AT_L1D_CACHESIZE: 65536
AT_L1D_CACHEGEOMETRY: 128B line size, 8-way set associative
AT_L2_CACHESIZE: 524288
AT_L2_CACHEGEOMETRY: 128B line size, 8-way set associative
AT_L3_CACHESIZE: 8388608
AT_L3_CACHEGEOMETRY: 128B line size, 8-way set associative
Some of the new types are longer than the previous ones, requiring to
increase the indentation in order to keep the values aligned.
* elf/dl-sysdep.c (auxvars): Add AT_L1I_CACHESIZE,
AT_L1I_CACHEGEOMETRY, AT_L1D_CACHESIZE, AT_L1D_CACHEGEOMETRY,
AT_L2_CACHESIZE, AT_L2_CACHEGEOMETRY, AT_L3_CACHESIZE and
AT_L3_CACHEGEOMETRY. Fix indentation when printing the other
fields.
(_dl_show_auxv): Give a special treatment to
AT_L1I_CACHEGEOMETRY, AT_L1D_CACHEGEOMETRY, AT_L2_CACHEGEOMETRY
and AT_L3_CACHEGEOMETRY.
* sysdeps/powerpc/dl-procinfo.h (cache_geometry): New function.
(_dl_procinfo): Fix indentation when printing AT_HWCAP and
AT_HWCAP2. Add support for AT_L1I_CACHEGEOMETRY,
AT_L1D_CACHEGEOMETRY, AT_L2_CACHEGEOMETRY and AT_L3_CACHEGEOMETRY.
Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
2018-12-19 21:03:12 +00:00
|
|
|
_dl_printf ("AT_HWCAP: ");
|
2013-06-28 21:52:49 +00:00
|
|
|
|
2024-03-19 20:29:48 +00:00
|
|
|
for (int i = 0; i < _DL_HWCAP_SIZE; ++i)
|
2013-06-28 21:52:49 +00:00
|
|
|
if (word & (1 << i))
|
|
|
|
_dl_printf (" %s", _dl_hwcap_string (i));
|
|
|
|
break;
|
|
|
|
case AT_HWCAP2:
|
|
|
|
{
|
|
|
|
|
Print cache size and geometry auxv types on LD_SHOW_AUXV=1
Add support for AT_L1I_CACHESIZE, AT_L1I_CACHEGEOMETRY,
AT_L1D_CACHESIZE, AT_L1D_CACHEGEOMETRY, AT_L2_CACHESIZE,
AT_L2_CACHEGEOMETRY, AT_L3_CACHESIZE and AT_L3_CACHEGEOMETRY when
LD_SHOW_AUXV=1.
AT_L*_CACHESIZE is printed as decimal and represent the number of
bytes of the cache.
AT_L*_CACHEGEOMETRY is treated in order to specify the cache line size
and its associativity.
Example output from a POWER8:
AT_L1I_CACHESIZE: 32768
AT_L1I_CACHEGEOMETRY: 128B line size, 8-way set associative
AT_L1D_CACHESIZE: 65536
AT_L1D_CACHEGEOMETRY: 128B line size, 8-way set associative
AT_L2_CACHESIZE: 524288
AT_L2_CACHEGEOMETRY: 128B line size, 8-way set associative
AT_L3_CACHESIZE: 8388608
AT_L3_CACHEGEOMETRY: 128B line size, 8-way set associative
Some of the new types are longer than the previous ones, requiring to
increase the indentation in order to keep the values aligned.
* elf/dl-sysdep.c (auxvars): Add AT_L1I_CACHESIZE,
AT_L1I_CACHEGEOMETRY, AT_L1D_CACHESIZE, AT_L1D_CACHEGEOMETRY,
AT_L2_CACHESIZE, AT_L2_CACHEGEOMETRY, AT_L3_CACHESIZE and
AT_L3_CACHEGEOMETRY. Fix indentation when printing the other
fields.
(_dl_show_auxv): Give a special treatment to
AT_L1I_CACHEGEOMETRY, AT_L1D_CACHEGEOMETRY, AT_L2_CACHEGEOMETRY
and AT_L3_CACHEGEOMETRY.
* sysdeps/powerpc/dl-procinfo.h (cache_geometry): New function.
(_dl_procinfo): Fix indentation when printing AT_HWCAP and
AT_HWCAP2. Add support for AT_L1I_CACHEGEOMETRY,
AT_L1D_CACHEGEOMETRY, AT_L2_CACHEGEOMETRY and AT_L3_CACHEGEOMETRY.
Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
2018-12-19 21:03:12 +00:00
|
|
|
_dl_printf ("AT_HWCAP2: ");
|
2013-06-28 21:52:49 +00:00
|
|
|
|
2024-03-19 20:29:48 +00:00
|
|
|
/* We have to go through them all because the kernel added the
|
|
|
|
AT_HWCAP2 features starting with the high bits. */
|
|
|
|
for (int i = 0; i < _DL_HWCAP_SIZE; ++i)
|
|
|
|
if (word & (1 << i))
|
|
|
|
_dl_printf (" %s", _dl_hwcap_string (_DL_HWCAP2_OFFSET + i));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case AT_HWCAP3:
|
|
|
|
{
|
|
|
|
_dl_printf ("AT_HWCAP3: ");
|
|
|
|
|
|
|
|
/* We have to go through them all because the kernel added the
|
|
|
|
AT_HWCAP3 features starting with the high bits. */
|
|
|
|
for (int i = 0; i < _DL_HWCAP_SIZE; ++i)
|
|
|
|
if (word & (1 << i))
|
|
|
|
_dl_printf (" %s", _dl_hwcap_string (_DL_HWCAP3_OFFSET + i));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case AT_HWCAP4:
|
|
|
|
{
|
|
|
|
_dl_printf ("AT_HWCAP4: ");
|
|
|
|
|
|
|
|
/* We have to go through them all because the kernel added the
|
|
|
|
AT_HWCAP4 features starting with the high bits. */
|
|
|
|
for (int i = 0; i <= _DL_HWCAP_SIZE; ++i)
|
|
|
|
if (word & (1 << i))
|
|
|
|
_dl_printf (" %s", _dl_hwcap_string (_DL_HWCAP4_OFFSET + i));
|
2013-06-28 21:52:49 +00:00
|
|
|
break;
|
|
|
|
}
|
Print cache size and geometry auxv types on LD_SHOW_AUXV=1
Add support for AT_L1I_CACHESIZE, AT_L1I_CACHEGEOMETRY,
AT_L1D_CACHESIZE, AT_L1D_CACHEGEOMETRY, AT_L2_CACHESIZE,
AT_L2_CACHEGEOMETRY, AT_L3_CACHESIZE and AT_L3_CACHEGEOMETRY when
LD_SHOW_AUXV=1.
AT_L*_CACHESIZE is printed as decimal and represent the number of
bytes of the cache.
AT_L*_CACHEGEOMETRY is treated in order to specify the cache line size
and its associativity.
Example output from a POWER8:
AT_L1I_CACHESIZE: 32768
AT_L1I_CACHEGEOMETRY: 128B line size, 8-way set associative
AT_L1D_CACHESIZE: 65536
AT_L1D_CACHEGEOMETRY: 128B line size, 8-way set associative
AT_L2_CACHESIZE: 524288
AT_L2_CACHEGEOMETRY: 128B line size, 8-way set associative
AT_L3_CACHESIZE: 8388608
AT_L3_CACHEGEOMETRY: 128B line size, 8-way set associative
Some of the new types are longer than the previous ones, requiring to
increase the indentation in order to keep the values aligned.
* elf/dl-sysdep.c (auxvars): Add AT_L1I_CACHESIZE,
AT_L1I_CACHEGEOMETRY, AT_L1D_CACHESIZE, AT_L1D_CACHEGEOMETRY,
AT_L2_CACHESIZE, AT_L2_CACHEGEOMETRY, AT_L3_CACHESIZE and
AT_L3_CACHEGEOMETRY. Fix indentation when printing the other
fields.
(_dl_show_auxv): Give a special treatment to
AT_L1I_CACHEGEOMETRY, AT_L1D_CACHEGEOMETRY, AT_L2_CACHEGEOMETRY
and AT_L3_CACHEGEOMETRY.
* sysdeps/powerpc/dl-procinfo.h (cache_geometry): New function.
(_dl_procinfo): Fix indentation when printing AT_HWCAP and
AT_HWCAP2. Add support for AT_L1I_CACHEGEOMETRY,
AT_L1D_CACHEGEOMETRY, AT_L2_CACHEGEOMETRY and AT_L3_CACHEGEOMETRY.
Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
2018-12-19 21:03:12 +00:00
|
|
|
case AT_L1I_CACHEGEOMETRY:
|
|
|
|
{
|
|
|
|
cache_geometry ("AT_L1I_CACHEGEOMETRY: ", word);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case AT_L1D_CACHEGEOMETRY:
|
|
|
|
{
|
|
|
|
cache_geometry ("AT_L1D_CACHEGEOMETRY: ", word);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case AT_L2_CACHEGEOMETRY:
|
|
|
|
{
|
|
|
|
cache_geometry ("AT_L2_CACHEGEOMETRY: ", word);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case AT_L3_CACHEGEOMETRY:
|
|
|
|
{
|
|
|
|
cache_geometry ("AT_L3_CACHEGEOMETRY: ", word);
|
|
|
|
break;
|
|
|
|
}
|
2013-06-28 21:52:49 +00:00
|
|
|
default:
|
2019-03-13 09:45:35 +00:00
|
|
|
/* Fallback to generic output mechanism. */
|
2013-06-28 21:52:49 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
_dl_printf ("\n");
|
2005-12-13 09:26:19 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* dl-procinfo.h */
|