]> git.ozlabs.org Git - ccan/blob - ccan/cpuid/_info
Merge branch 'cpuid' of https://github.com/decltype/ccan
[ccan] / ccan / cpuid / _info
1 #include "cpuid.h"
2
3 /**
4  * cpuid - a CPUID instruction parser for x86/x86_64 CPUs.
5  *
6  * This module tries to keep-it-simple to get information about the CPU
7  * from the CPU.
8  *
9  * Example:
10  * #include <ccan/cpuid/cpuid.h>
11  *
12  * int main()
13  * {
14  *      int highest;
15  *      cpuid(CPU_HIGHEST_EXTENDED_FUNCTION_SUPPORTED, &highest);
16  *      printf ("Highest extended function supported: %d\n", highest);
17  *
18  *      return 0;
19  * }
20  *
21  * Author: Ahmed Samy <f.fallen45@gmail.com>
22  * License: MIT
23  * Version: 0.1
24  */
25
26 int main(int argc, char *argv[])
27 {
28         if (argc != 2)
29                 return 1;
30
31         if (strcmp(argv[1], "depends") == 0) {
32 #if defined(__i386__) || defined(__i386) || defined(__x86_64) \
33                 || defined(_M_AMD64) || defined(__M_X64)
34                 /* Nothing.  */
35 #else
36                 printf("ccan/build_assert\n");
37 #endif
38                 return 0;
39         }
40
41         return 1;
42 }
43