Blame sysdeps/s390/dl-procinfo.h

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