Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 111 lines (92 sloc) 2.943 kB
fca9d8e * sysdeps/mach/hurd/bits/libc-lock.h
Roland McGrath authored
1 /* i386 version of processor capability information handling macros.
2 Copyright (C) 1998, 2000, 2003 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
5
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, write to the Free
18 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA. */
20
21 #ifndef _DL_PROCINFO_H
22 #define _DL_PROCINFO_H 1
23 #include <ldsodefs.h>
24
25 #define _DL_HWCAP_COUNT 32
26
27 #define _DL_PLATFORMS_COUNT 4
28
29 /* Start at 48 to reserve some space. */
30 #define _DL_FIRST_PLATFORM 48
31 /* Mask to filter out platforms. */
32 #define _DL_HWCAP_PLATFORM (((1ULL << _DL_PLATFORMS_COUNT) - 1) \
33 << _DL_FIRST_PLATFORM)
34
35 enum
36 {
37 HWCAP_I386_FPU = 1 << 0,
38 HWCAP_I386_VME = 1 << 1,
39 HWCAP_I386_DE = 1 << 2,
40 HWCAP_I386_PSE = 1 << 3,
41 HWCAP_I386_TSC = 1 << 4,
42 HWCAP_I386_MSR = 1 << 5,
43 HWCAP_I386_PAE = 1 << 6,
44 HWCAP_I386_MCE = 1 << 7,
45 HWCAP_I386_CX8 = 1 << 8,
46 HWCAP_I386_APIC = 1 << 9,
47 HWCAP_I386_SEP = 1 << 11,
48 HWCAP_I386_MTRR = 1 << 12,
49 HWCAP_I386_PGE = 1 << 13,
50 HWCAP_I386_MCA = 1 << 14,
51 HWCAP_I386_CMOV = 1 << 15,
52 HWCAP_I386_FCMOV = 1 << 16,
53 HWCAP_I386_MMX = 1 << 23,
54 HWCAP_I386_OSFXSR = 1 << 24,
55 HWCAP_I386_XMM = 1 << 25,
56 HWCAP_I386_XMM2 = 1 << 26,
57 HWCAP_I386_AMD3D = 1 << 31,
58
59 /* XXX Which others to add here? */
60 HWCAP_IMPORTANT = (HWCAP_I386_MMX)
61
62 };
63
64 /* We cannot provide a general printing function. */
65 #define _dl_procinfo(word) -1
66
67 static inline const char *
68 __attribute__ ((unused))
69 _dl_hwcap_string (int idx)
70 {
71 return GL(dl_x86_cap_flags)[idx];
72 };
73
74 static inline const char *
75 __attribute__ ((unused))
76 _dl_platform_string (int idx)
77 {
78 return GL(dl_x86_platforms)[idx - _DL_FIRST_PLATFORM];
79 };
80
81 static inline int
82 __attribute__ ((unused, always_inline))
83 _dl_string_hwcap (const char *str)
84 {
85 int i;
86
87 for (i = 0; i < _DL_HWCAP_COUNT; i++)
88 {
89 if (strcmp (str, GL(dl_x86_cap_flags)[i]) == 0)
90 return i;
91 }
92 return -1;
93 };
94
95 static inline int
96 __attribute__ ((unused, always_inline))
97 _dl_string_platform (const char *str)
98 {
99 int i;
100
101 if (str != NULL)
102 for (i = 0; i < _DL_PLATFORMS_COUNT; ++i)
103 {
104 if (strcmp (str, GL(dl_x86_platforms)[i]) == 0)
105 return _DL_FIRST_PLATFORM + i;
106 }
107 return -1;
108 };
109
110 #endif /* dl-procinfo.h */
Something went wrong with that request. Please try again.