{
static const struct
{
- const char label[17];
+ const char label[22];
enum { unknown = 0, dec, hex, str, ignore } form : 8;
} auxvars[] =
{
- [AT_EXECFD - 2] = { "EXECFD: ", dec },
- [AT_EXECFN - 2] = { "EXECFN: ", str },
- [AT_PHDR - 2] = { "PHDR: 0x", hex },
- [AT_PHENT - 2] = { "PHENT: ", dec },
- [AT_PHNUM - 2] = { "PHNUM: ", dec },
- [AT_PAGESZ - 2] = { "PAGESZ: ", dec },
- [AT_BASE - 2] = { "BASE: 0x", hex },
- [AT_FLAGS - 2] = { "FLAGS: 0x", hex },
- [AT_ENTRY - 2] = { "ENTRY: 0x", hex },
- [AT_NOTELF - 2] = { "NOTELF: ", hex },
- [AT_UID - 2] = { "UID: ", dec },
- [AT_EUID - 2] = { "EUID: ", dec },
- [AT_GID - 2] = { "GID: ", dec },
- [AT_EGID - 2] = { "EGID: ", dec },
- [AT_PLATFORM - 2] = { "PLATFORM: ", str },
- [AT_HWCAP - 2] = { "HWCAP: ", hex },
- [AT_CLKTCK - 2] = { "CLKTCK: ", dec },
- [AT_FPUCW - 2] = { "FPUCW: ", hex },
- [AT_DCACHEBSIZE - 2] = { "DCACHEBSIZE: 0x", hex },
- [AT_ICACHEBSIZE - 2] = { "ICACHEBSIZE: 0x", hex },
- [AT_UCACHEBSIZE - 2] = { "UCACHEBSIZE: 0x", hex },
+ [AT_EXECFD - 2] = { "EXECFD: ", dec },
+ [AT_EXECFN - 2] = { "EXECFN: ", str },
+ [AT_PHDR - 2] = { "PHDR: 0x", hex },
+ [AT_PHENT - 2] = { "PHENT: ", dec },
+ [AT_PHNUM - 2] = { "PHNUM: ", dec },
+ [AT_PAGESZ - 2] = { "PAGESZ: ", dec },
+ [AT_BASE - 2] = { "BASE: 0x", hex },
+ [AT_FLAGS - 2] = { "FLAGS: 0x", hex },
+ [AT_ENTRY - 2] = { "ENTRY: 0x", hex },
+ [AT_NOTELF - 2] = { "NOTELF: ", hex },
+ [AT_UID - 2] = { "UID: ", dec },
+ [AT_EUID - 2] = { "EUID: ", dec },
+ [AT_GID - 2] = { "GID: ", dec },
+ [AT_EGID - 2] = { "EGID: ", dec },
+ [AT_PLATFORM - 2] = { "PLATFORM: ", str },
+ [AT_HWCAP - 2] = { "HWCAP: ", hex },
+ [AT_CLKTCK - 2] = { "CLKTCK: ", dec },
+ [AT_FPUCW - 2] = { "FPUCW: ", hex },
+ [AT_DCACHEBSIZE - 2] = { "DCACHEBSIZE: 0x", hex },
+ [AT_ICACHEBSIZE - 2] = { "ICACHEBSIZE: 0x", hex },
+ [AT_UCACHEBSIZE - 2] = { "UCACHEBSIZE: 0x", hex },
[AT_IGNOREPPC - 2] = { "IGNOREPPC", ignore },
- [AT_SECURE - 2] = { "SECURE: ", dec },
- [AT_BASE_PLATFORM - 2] = { "BASE_PLATFORM:", str },
- [AT_SYSINFO - 2] = { "SYSINFO: 0x", hex },
- [AT_SYSINFO_EHDR - 2] = { "SYSINFO_EHDR: 0x", hex },
- [AT_RANDOM - 2] = { "RANDOM: 0x", hex },
- [AT_HWCAP2 - 2] = { "HWCAP2: 0x", hex },
+ [AT_SECURE - 2] = { "SECURE: ", dec },
+ [AT_BASE_PLATFORM - 2] = { "BASE_PLATFORM: ", str },
+ [AT_SYSINFO - 2] = { "SYSINFO: 0x", hex },
+ [AT_SYSINFO_EHDR - 2] = { "SYSINFO_EHDR: 0x", hex },
+ [AT_RANDOM - 2] = { "RANDOM: 0x", hex },
+ [AT_HWCAP2 - 2] = { "HWCAP2: 0x", hex },
+ [AT_L1I_CACHESIZE - 2] = { "L1I_CACHESIZE: ", dec },
+ [AT_L1I_CACHEGEOMETRY - 2] = { "L1I_CACHEGEOMETRY: 0x", hex },
+ [AT_L1D_CACHESIZE - 2] = { "L1D_CACHESIZE: ", dec },
+ [AT_L1D_CACHEGEOMETRY - 2] = { "L1D_CACHEGEOMETRY: 0x", hex },
+ [AT_L2_CACHESIZE - 2] = { "L2_CACHESIZE: ", dec },
+ [AT_L2_CACHEGEOMETRY - 2] = { "L2_CACHEGEOMETRY: 0x", hex },
+ [AT_L3_CACHESIZE - 2] = { "L3_CACHESIZE: ", dec },
+ [AT_L3_CACHEGEOMETRY - 2] = { "L3_CACHEGEOMETRY: 0x", hex },
};
unsigned int idx = (unsigned int) (av->a_type - 2);
assert (AT_NULL == 0);
assert (AT_IGNORE == 1);
- if (av->a_type == AT_HWCAP || av->a_type == AT_HWCAP2)
+ if (av->a_type == AT_HWCAP || av->a_type == AT_HWCAP2
+ || AT_L1I_CACHEGEOMETRY || AT_L1D_CACHEGEOMETRY
+ || AT_L2_CACHEGEOMETRY || AT_L3_CACHEGEOMETRY)
{
/* These are handled in a special way per platform. */
if (_dl_procinfo (av->a_type, av->a_un.a_val) == 0)
}
#if IS_IN (rtld)
+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);
+ }
+}
+
static inline int
__attribute__ ((unused))
_dl_procinfo (unsigned int type, unsigned long int word)
switch(type)
{
case AT_HWCAP:
- _dl_printf ("AT_HWCAP: ");
+ _dl_printf ("AT_HWCAP: ");
for (int i = 0; i <= _DL_HWCAP_LAST; ++i)
if (word & (1 << i))
{
unsigned int offset = _DL_HWCAP_LAST + 1;
- _dl_printf ("AT_HWCAP2: ");
+ _dl_printf ("AT_HWCAP2: ");
/* We have to go through them all because the kernel added the
AT_HWCAP2 features starting with the high bits. */
_dl_printf (" %s", _dl_hwcap_string (offset + i));
break;
}
+ 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;
+ }
default:
/* This should not happen. */
return -1;