[runtime] Remove the usage of MONO_INTERNAL, use MONO_API to mark exported functions...
[mono.git] / mono / utils / mono-hwcap.h
1 #ifndef __MONO_UTILS_HWCAP_H__
2 #define __MONO_UTILS_HWCAP_H__
3
4 #include <stdio.h>
5 #include <glib.h>
6
7 #include "config.h"
8
9 #include "mono/utils/mono-compiler.h"
10
11 /* Call this function to perform hardware feature detection. Until
12  * this function has been called, all feature variables will be
13  * FALSE as a default.
14  *
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
19  * executing.
20  *
21  * To get at feature variables, include the appropriate header,
22  * e.g. mono-hwcap-x86.h for x86(-64).
23  */
24 void mono_hwcap_init (void);
25
26 /* Implemented in mono-hwcap-$TARGET.c. Do not call. */
27 void mono_hwcap_arch_init (void);
28
29 /* Print detected features to the given file. */
30 void mono_hwcap_print (FILE *f);
31
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.
37  *
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.
43  *
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.
48  */
49
50 #endif /* __MONO_UTILS_HWCAP_H__ */