Blame sysdeps/s390/dl-procinfo.h

Packit 6c4009
/* s390 version of processor capability information handling macros.
Packit 6c4009
   Copyright (C) 2006-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
   Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2006.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef _DL_PROCINFO_H
Packit 6c4009
#define _DL_PROCINFO_H	1
Packit 6c4009
#include <ldsodefs.h>
Packit 6c4009
Packit Service 400445
#define _DL_HWCAP_COUNT 19
Packit 6c4009
Packit Service 9c5af0
#define _DL_PLATFORMS_COUNT	10
Packit 6c4009
Packit 6c4009
/* The kernel provides up to 32 capability bits with elf_hwcap.  */
Packit 6c4009
#define _DL_FIRST_PLATFORM	32
Packit 6c4009
/* Mask to filter out platforms.  */
Packit 6c4009
#define _DL_HWCAP_PLATFORM	(((1ULL << _DL_PLATFORMS_COUNT) - 1) \
Packit 6c4009
				 << _DL_FIRST_PLATFORM)
Packit 6c4009
Packit 6c4009
/* Hardware capability bit numbers are derived directly from the
Packit 6c4009
   facility indications as stored by the "store facility list" (STFL)
Packit 6c4009
   instruction.
Packit 6c4009
   highgprs is an alien in that list.  It describes a *kernel*
Packit 6c4009
   capability.  */
Packit 6c4009
Packit 6c4009
enum
Packit 6c4009
{
Packit 6c4009
  HWCAP_S390_ESAN3 = 1 << 0,
Packit 6c4009
  HWCAP_S390_ZARCH = 1 << 1,
Packit 6c4009
  HWCAP_S390_STFLE = 1 << 2,
Packit 6c4009
  HWCAP_S390_MSA = 1 << 3,
Packit 6c4009
  HWCAP_S390_LDISP = 1 << 4,
Packit 6c4009
  HWCAP_S390_EIMM = 1 << 5,
Packit 6c4009
  HWCAP_S390_DFP = 1 << 6,
Packit 6c4009
  HWCAP_S390_HPAGE = 1 << 7,
Packit 6c4009
  HWCAP_S390_ETF3EH = 1 << 8,
Packit 6c4009
  HWCAP_S390_HIGH_GPRS = 1 << 9,
Packit 6c4009
  HWCAP_S390_TE = 1 << 10,
Packit 6c4009
  HWCAP_S390_VX = 1 << 11,
Packit 6c4009
  HWCAP_S390_VXD = 1 << 12,
Packit 6c4009
  HWCAP_S390_VXE = 1 << 13,
Packit 6c4009
  HWCAP_S390_GS = 1 << 14,
Packit Service 400445
  HWCAP_S390_VXRS_EXT2 = 1 << 15,
Packit Service 400445
  HWCAP_S390_VXRS_PDE = 1 << 16,
Packit Service 400445
  HWCAP_S390_SORT = 1 << 17,
Packit Service 400445
  HWCAP_S390_DFLT = 1 << 18,
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
#define HWCAP_IMPORTANT (HWCAP_S390_ZARCH | HWCAP_S390_LDISP \
Packit Service 74a5d4
			 | HWCAP_S390_EIMM | HWCAP_S390_DFP  \
Packit Service 400445
			 | HWCAP_S390_VX | HWCAP_S390_VXE    \
Packit Service 400445
			 | HWCAP_S390_VXRS_EXT2)
Packit 6c4009
Packit 6c4009
/* We cannot provide a general printing function.  */
Packit 6c4009
#define _dl_procinfo(type, word) -1
Packit 6c4009
Packit 6c4009
static inline const char *
Packit 6c4009
__attribute__ ((unused))
Packit 6c4009
_dl_hwcap_string (int idx)
Packit 6c4009
{
Packit 6c4009
  return GLRO(dl_s390_cap_flags)[idx];
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
static inline int
Packit 6c4009
__attribute__ ((unused, always_inline))
Packit 6c4009
_dl_string_hwcap (const char *str)
Packit 6c4009
{
Packit 6c4009
  int i;
Packit 6c4009
Packit 6c4009
  for (i = 0; i < _DL_HWCAP_COUNT; i++)
Packit 6c4009
    {
Packit 6c4009
      if (strcmp (str, GLRO(dl_s390_cap_flags)[i]) == 0)
Packit 6c4009
	return i;
Packit 6c4009
    }
Packit 6c4009
  return -1;
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
static inline int
Packit 6c4009
__attribute__ ((unused, always_inline))
Packit 6c4009
_dl_string_platform (const char *str)
Packit 6c4009
{
Packit 6c4009
  int i;
Packit 6c4009
Packit 6c4009
  if (str != NULL)
Packit 6c4009
    for (i = 0; i < _DL_PLATFORMS_COUNT; ++i)
Packit 6c4009
      {
Packit 6c4009
	if (strcmp (str, GLRO(dl_s390_platforms)[i]) == 0)
Packit 6c4009
	  return _DL_FIRST_PLATFORM + i;
Packit 6c4009
      }
Packit 6c4009
  return -1;
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
#endif /* dl-procinfo.h */