Back to index

glibc  2.9
dl-procinfo.h
Go to the documentation of this file.
00001 /* Linux/sparc version of processor capability information handling macros.
00002    Copyright (C) 1999,2000,2001,2002,2003,2004,2006
00003        Free Software Foundation, Inc.
00004    This file is part of the GNU C Library.
00005    Contributed by Jakub Jelinek <jj@ultra.linux.cz>, 1999.
00006 
00007    The GNU C Library is free software; you can redistribute it and/or
00008    modify it under the terms of the GNU Lesser General Public
00009    License as published by the Free Software Foundation; either
00010    version 2.1 of the License, or (at your option) any later version.
00011 
00012    The GNU C Library is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015    Lesser General Public License for more details.
00016 
00017    You should have received a copy of the GNU Lesser General Public
00018    License along with the GNU C Library; if not, write to the Free
00019    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00020    02111-1307 USA.  */
00021 
00022 #ifndef _DL_PROCINFO_H
00023 #define _DL_PROCINFO_H      1
00024 
00025 #include <ldsodefs.h>
00026 
00027 #define _DL_HWCAP_COUNT 8
00028 
00029 static inline int
00030 __attribute__ ((unused))
00031 _dl_procinfo (int word)
00032 {
00033   int i;
00034 
00035   _dl_printf ("AT_HWCAP:   ");
00036 
00037   for (i = 0; i < _DL_HWCAP_COUNT; ++i)
00038     if (word & (1 << i))
00039       _dl_printf (" %s", GLRO(dl_sparc_cap_flags)[i]);
00040 
00041   _dl_printf ("\n");
00042 
00043   return 0;
00044 }
00045 
00046 static inline const char *
00047 __attribute__ ((unused))
00048 _dl_hwcap_string (int idx)
00049 {
00050   return GLRO(dl_sparc_cap_flags)[idx];
00051 };
00052 
00053 static inline int
00054 __attribute__ ((unused, always_inline))
00055 _dl_string_hwcap (const char *str)
00056 {
00057   int i;
00058   for (i = 0; i < _DL_HWCAP_COUNT; i++)
00059     {
00060       if (strcmp (str, GLRO(dl_sparc_cap_flags) [i]) == 0)
00061        return i;
00062     }
00063   return -1;
00064 };
00065 
00066 #include <bits/wordsize.h>
00067 #define HWCAP_IMPORTANT_V9  (__WORDSIZE == 64 ? 0 : HWCAP_SPARC_V9)
00068 #define HWCAP_IMPORTANT            (HWCAP_IMPORTANT_V9 | HWCAP_SPARC_ULTRA3 \
00069                              | HWCAP_SPARC_BLKINIT | HWCAP_SPARC_N2)
00070 
00071 /* There are no different platforms defined.  */
00072 #define _dl_platform_string(idx) ""
00073 
00074 /* There're no platforms to filter out.  */
00075 #define _DL_HWCAP_PLATFORM 0
00076 
00077 #define _dl_string_platform(str) (-1)
00078 
00079 #endif /* dl-procinfo.h */