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