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