Back to index

glibc  2.9
Defines | Functions
dl-procinfo.h File Reference
#include <ldsodefs.h>
#include <sysdep.h>

Go to the source code of this file.

Defines

#define _DL_HWCAP_FIRST   7
#define _DL_HWCAP_COUNT   32
#define HWCAP_IMPORTANT
#define _DL_PLATFORMS_COUNT   8
#define _DL_FIRST_PLATFORM   32
#define _DL_HWCAP_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
#define PPC_PLATFORM_POWER7   7

Functions

static const char * __attribute__ ((unused)) _dl_hwcap_string(int idx)
static int __attribute__ ((unused, always_inline)) _dl_string_platform(const char *str)

Define Documentation

#define _DL_FIRST_PLATFORM   32

Definition at line 36 of file dl-procinfo.h.

#define _DL_HWCAP_COUNT   32

Definition at line 28 of file dl-procinfo.h.

#define _DL_HWCAP_FIRST   7

Definition at line 27 of file dl-procinfo.h.

Value:
(((1ULL << _DL_PLATFORMS_COUNT) - 1) \
                                 << _DL_FIRST_PLATFORM)

Definition at line 38 of file dl-procinfo.h.

#define _DL_PLATFORMS_COUNT   8

Definition at line 34 of file dl-procinfo.h.

#define HWCAP_IMPORTANT
Value:

Definition at line 31 of file dl-procinfo.h.

#define PPC_PLATFORM_CELL_BE   5

Definition at line 47 of file dl-procinfo.h.

#define PPC_PLATFORM_POWER4   0

Definition at line 42 of file dl-procinfo.h.

#define PPC_PLATFORM_POWER5   2

Definition at line 44 of file dl-procinfo.h.

#define PPC_PLATFORM_POWER5_PLUS   3

Definition at line 45 of file dl-procinfo.h.

#define PPC_PLATFORM_POWER6   4

Definition at line 46 of file dl-procinfo.h.

#define PPC_PLATFORM_POWER6X   6

Definition at line 48 of file dl-procinfo.h.

#define PPC_PLATFORM_POWER7   7

Definition at line 49 of file dl-procinfo.h.

#define PPC_PLATFORM_PPC970   1

Definition at line 43 of file dl-procinfo.h.


Function Documentation

static const char* __attribute__ ( (unused)  ) [inline, static]

Definition at line 52 of file dl-procinfo.h.

{
  return GLRO(dl_powerpc_cap_flags)[idx - _DL_HWCAP_FIRST];
}
static int __attribute__ ( (unused, always_inline)  ) const [inline, static]

Definition at line 76 of file dl-procinfo.h.

{
  if (str == NULL)
    return -1;

  if (strncmp (str, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_POWER4], 5) == 0)
    {
      int ret;
      str += 5;
      switch (*str)
       {
       case '4':
         ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER4;
         break;
       case '5':
         ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER5;
         if (str[1] == '+')
           {
             ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER5_PLUS;
             ++str;
           }
         break;
       case '6':
         ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER6;
         if (str[1] == 'x')
           {
             ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER6X;
             ++str;
           }
         break;
       case '7':
         ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER7;
         break;
       default:
         return -1;
       }
      if (str[1] == '\0')
       return ret;
    }
  else if (strncmp (str, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC970],
                  3) == 0)
    {
      if (strcmp (str + 3, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC970]
                        + 3) == 0)
       return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC970;
      else if (strcmp (str + 3,
                     GLRO(dl_powerpc_platforms)[PPC_PLATFORM_CELL_BE] + 3)
              == 0)
       return _DL_FIRST_PLATFORM + PPC_PLATFORM_CELL_BE;
    }

  return -1;
}