diff options
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/dl-procinfo.h | 36 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.h | 8 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.h | 8 |
3 files changed, 52 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/dl-procinfo.h b/sysdeps/unix/sysv/linux/i386/dl-procinfo.h index c4a4e324e6..55bd830011 100644 --- a/sysdeps/unix/sysv/linux/i386/dl-procinfo.h +++ b/sysdeps/unix/sysv/linux/i386/dl-procinfo.h @@ -32,6 +32,18 @@ static const char x86_cap_flags[][7] = }; #define _DL_HWCAP_COUNT 32 +static const char x86_platforms[][5] = + { + "i386", "i486", "i586", "i686" + }; +#define _DL_PLATFORMS_COUNT 4 + +/* Start at 48 to reserve some space. */ +#define _DL_FIRST_PLATFORM 48 +/* Mask to filter out platforms. */ +#define _DL_HWCAP_PLATFORM (7ULL << _DL_FIRST_PLATFORM) + + static inline int __attribute__ ((unused)) _dl_procinfo (int word) @@ -58,6 +70,13 @@ _dl_hwcap_string (int idx) return x86_cap_flags[idx]; }; +static inline const char * +__attribute__ ((unused)) +_dl_platform_string (int idx) +{ + return x86_platforms [idx - _DL_FIRST_PLATFORM]; +}; + enum { HWCAP_I386_FPU = 1 << 0, @@ -82,6 +101,7 @@ enum /* XXX Which others to add here? */ HWCAP_IMPORTANT = (HWCAP_I386_MMX) + }; static inline int @@ -98,4 +118,20 @@ _dl_string_hwcap (const char *str) return -1; }; + +static inline int +__attribute__ ((unused)) +_dl_string_platform (const char *str) +{ + int i; + + if (str != NULL) + for (i = 0; i < _DL_PLATFORMS_COUNT; ++i) + { + if (strcmp (str, x86_platforms[i]) == 0) + return _DL_FIRST_PLATFORM + i; + } + return -1; +}; + #endif /* dl-procinfo.h */ diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.h b/sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.h index 8a825a64c5..adfe4be05c 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.h @@ -68,4 +68,12 @@ _dl_string_hwcap (const char *str) #define HWCAP_IMPORTANT (HWCAP_SPARC_V9) +/* There are no different platforms defined. */ +#define _dl_platform_string(idx) "" + +/* There're no platforms to filter out. */ +#define _DL_HWCAP_PLATFORM 0 + +#define _dl_string_platform(str) (-1) + #endif /* dl-procinfo.h */ diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.h b/sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.h index 7825937733..78bd5c883c 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.h @@ -69,4 +69,12 @@ _dl_string_hwcap (const char *str) #define HWCAP_IMPORTANT (0) +/* There are no different platforms defined. */ +#define _dl_platform_string(idx) "" + +/* There're no platforms to filter out. */ +#define _DL_HWCAP_PLATFORM 0 + +#define _dl_string_platform(str) (-1) + #endif /* dl-procinfo.h */ |