source: libcaca/trunk/kernel/drivers/processor.h @ 4158

Last change on this file since 4158 was 4158, checked in by Jean-Yves Lamoureux, 10 years ago
  • Fix indentation and add licensing and copyright headers to kernel
File size: 2.9 KB
Line 
1/*
2 *  libcaca       
3 *  libcaca       Colour ASCII-Art library
4 *  Copyright (c) 2006 Sam Hocevar <sam@hocevar.net>
5 *                2009 Jean-Yves Lamoureux <jylam@lnxscene.org>
6 *                All Rights Reserved
7 *
8 *  $Id: kernel.h 4154 2009-12-20 13:33:11Z jylam $
9 *
10 *  This library is free software. It comes without any warranty, to
11 *  the extent permitted by applicable law. You can redistribute it
12 *  and/or modify it under the terms of the Do What The Fuck You Want
13 *  To Public License, Version 2, as published by Sam Hocevar. See
14 *  http://sam.zoy.org/wtfpl/COPYING for more details.
15 */
16
17enum cpuid_requests
18{
19    CPUID_GETVENDORSTRING,
20    CPUID_GETFEATURES,
21    CPUID_GETTLB,
22    CPUID_GETSERIAL,
23
24    CPUID_INTELEXTENDED = 0x80000000,
25    CPUID_INTELFEATURES,
26    CPUID_INTELBRANDSTRING,
27    CPUID_INTELBRANDSTRINGMORE,
28    CPUID_INTELBRANDSTRINGEND,
29};
30
31enum
32{
33    CPUID_FEAT_ECX_SSE3 = 1 << 0,
34    CPUID_FEAT_ECX_PCLMUL = 1 << 1,
35    CPUID_FEAT_ECX_DTES64 = 1 << 2,
36    CPUID_FEAT_ECX_MONITOR = 1 << 3,
37    CPUID_FEAT_ECX_DS_CPL = 1 << 4,
38    CPUID_FEAT_ECX_VMX = 1 << 5,
39    CPUID_FEAT_ECX_SMX = 1 << 6,
40    CPUID_FEAT_ECX_EST = 1 << 7,
41    CPUID_FEAT_ECX_TM2 = 1 << 8,
42    CPUID_FEAT_ECX_SSSE3 = 1 << 9,
43    CPUID_FEAT_ECX_CID = 1 << 10,
44    CPUID_FEAT_ECX_FMA = 1 << 12,
45    CPUID_FEAT_ECX_CX16 = 1 << 13,
46    CPUID_FEAT_ECX_ETPRD = 1 << 14,
47    CPUID_FEAT_ECX_PDCM = 1 << 15,
48    CPUID_FEAT_ECX_DCA = 1 << 18,
49    CPUID_FEAT_ECX_SSE4_1 = 1 << 19,
50    CPUID_FEAT_ECX_SSE4_2 = 1 << 20,
51    CPUID_FEAT_ECX_x2APIC = 1 << 21,
52    CPUID_FEAT_ECX_MOVBE = 1 << 22,
53    CPUID_FEAT_ECX_POPCNT = 1 << 23,
54    CPUID_FEAT_ECX_XSAVE = 1 << 26,
55    CPUID_FEAT_ECX_OSXSAVE = 1 << 27,
56    CPUID_FEAT_ECX_AVX = 1 << 28,
57
58    CPUID_FEAT_EDX_FPU = 1 << 0,
59    CPUID_FEAT_EDX_VME = 1 << 1,
60    CPUID_FEAT_EDX_DE = 1 << 2,
61    CPUID_FEAT_EDX_PSE = 1 << 3,
62    CPUID_FEAT_EDX_TSC = 1 << 4,
63    CPUID_FEAT_EDX_MSR = 1 << 5,
64    CPUID_FEAT_EDX_PAE = 1 << 6,
65    CPUID_FEAT_EDX_MCE = 1 << 7,
66    CPUID_FEAT_EDX_CX8 = 1 << 8,
67    CPUID_FEAT_EDX_APIC = 1 << 9,
68    CPUID_FEAT_EDX_SEP = 1 << 11,
69    CPUID_FEAT_EDX_MTRR = 1 << 12,
70    CPUID_FEAT_EDX_PGE = 1 << 13,
71    CPUID_FEAT_EDX_MCA = 1 << 14,
72    CPUID_FEAT_EDX_CMOV = 1 << 15,
73    CPUID_FEAT_EDX_PAT = 1 << 16,
74    CPUID_FEAT_EDX_PSE36 = 1 << 17,
75    CPUID_FEAT_EDX_PSN = 1 << 18,
76    CPUID_FEAT_EDX_CLF = 1 << 19,
77    CPUID_FEAT_EDX_DTES = 1 << 21,
78    CPUID_FEAT_EDX_ACPI = 1 << 22,
79    CPUID_FEAT_EDX_MMX = 1 << 23,
80    CPUID_FEAT_EDX_FXSR = 1 << 24,
81    CPUID_FEAT_EDX_SSE = 1 << 25,
82    CPUID_FEAT_EDX_SSE2 = 1 << 26,
83    CPUID_FEAT_EDX_SS = 1 << 27,
84    CPUID_FEAT_EDX_HTT = 1 << 28,
85    CPUID_FEAT_EDX_TM1 = 1 << 29,
86    CPUID_FEAT_EDX_IA64 = 1 << 30,
87    CPUID_FEAT_EDX_PBE = 1 << 31
88};
89
90struct processor_info
91{
92    int id;
93    char vendor[13];
94    unsigned int features;
95};
96
97
98int processor_get_info(struct processor_info *processor_info);
99void processor_print_info(struct processor_info *processor_info);
Note: See TracBrowser for help on using the repository browser.