5 #ifndef __MONO_UTILS_HWCAP_H__
6 #define __MONO_UTILS_HWCAP_H__
13 #include "mono/utils/mono-compiler.h"
15 #define MONO_HWCAP_VAR(NAME) extern gboolean mono_hwcap_ ## NAME;
16 #include "mono/utils/mono-hwcap-vars.h"
19 /* Call this function to perform hardware feature detection. Until
20 * this function has been called, all feature variables will be
23 * While this function can be called multiple times, doing so from
24 * several threads at the same time is not supported as it will
25 * result in an inconsistent state of the variables. Further,
26 * feature variables should not be read *while* this function is
29 void mono_hwcap_init (void);
31 /* Implemented in mono-hwcap-$TARGET.c. Do not call. */
32 void mono_hwcap_arch_init (void);
34 /* Print detected features to stdout. */
35 void mono_hwcap_print (void);
37 /* Please note: If you're going to use the Linux auxiliary vector
38 * to detect CPU features, don't use any of the constant names in
39 * the hwcap.h header. This ties us to a particular version of the
40 * header, and since the values are guaranteed to be stable, hard-
41 * coding them is not that terrible.
43 * Also, please do not add assumptions to mono-hwcap. The code here
44 * is meant to *discover* facts about the hardware, not assume that
45 * some feature exists because of $arbitrary_preprocessor_define.
46 * If you have to make assumptions, do so elsewhere, e.g. in the
47 * Mini back end you're modifying.
49 * Finally, be conservative. If you can't determine precisely if a
50 * feature is present, assume that it isn't. In the rare cases where
51 * the hardware or operating system are lying, work around that in
52 * a different place, as with the rule above.
55 #endif /* __MONO_UTILS_HWCAP_H__ */