1 #ifndef __MONO_UTILS_HWCAP_H__
2 #define __MONO_UTILS_HWCAP_H__
9 #include "mono/utils/mono-compiler.h"
11 /* Call this function to perform hardware feature detection. Until
12 * this function has been called, all feature variables will be
15 * While this function can be called multiple times, doing so from
16 * several threads at the same time is not supported as it will
17 * result in an inconsistent state of the variables. Further,
18 * feature variables should not be read *while* this function is
21 * To get at feature variables, include the appropriate header,
22 * e.g. mono-hwcap-x86.h for x86(-64).
24 void mono_hwcap_init (void) MONO_INTERNAL
;
26 /* Implemented in mono-hwcap-$TARGET.c. Do not call. */
27 void mono_hwcap_arch_init (void) MONO_INTERNAL
;
29 /* Print detected features to the given file. */
30 void mono_hwcap_print (FILE *f
) MONO_INTERNAL
;
32 /* Please note: If you're going to use the Linux auxiliary vector
33 * to detect CPU features, don't use any of the constant names in
34 * the hwcap.h header. This ties us to a particular version of the
35 * header, and since the values are guaranteed to be stable, hard-
36 * coding them is not that terrible.
38 * Also, please do not add assumptions to mono-hwcap. The code here
39 * is meant to *discover* facts about the hardware, not assume that
40 * some feature exists because of $arbitrary_preprocessor_define.
41 * If you have to make assumptions, do so elsewhere, e.g. in the
42 * Mini back end you're modifying.
44 * Finally, be conservative. If you can't determine precisely if a
45 * feature is present, assume that it isn't. In the rare cases where
46 * the hardware or operating system are lying, work around that in
47 * a different place, as with the rule above.
50 #endif /* __MONO_UTILS_HWCAP_H__ */