1 | /* $Id: kCpus.h 2 2007-11-16 16:07:14Z bird $ */
|
---|
2 | /** @file
|
---|
3 | * kCpus - CPU Identifiers.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (c) 2007 knut st. osmundsen <bird-src-spam@anduin.net>
|
---|
8 | *
|
---|
9 | * This file is part of kStuff.
|
---|
10 | *
|
---|
11 | * kStuff is free software; you can redistribute it and/or
|
---|
12 | * modify it under the terms of the GNU Lesser General Public
|
---|
13 | * License as published by the Free Software Foundation; either
|
---|
14 | * version 2.1 of the License, or (at your option) any later version.
|
---|
15 | *
|
---|
16 | * kStuff is distributed in the hope that it will be useful,
|
---|
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
19 | * Lesser General Public License for more details.
|
---|
20 | *
|
---|
21 | * You should have received a copy of the GNU Lesser General Public
|
---|
22 | * License along with kStuff; if not, write to the Free Software
|
---|
23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
---|
24 | *
|
---|
25 | */
|
---|
26 |
|
---|
27 | #ifndef ___k_kCpus_h___
|
---|
28 | #define ___k_kCpus_h___
|
---|
29 |
|
---|
30 | /** @defgroup grp_kCpus kCpus - CPU Identifiers
|
---|
31 | * @see the kCpu API for functions operating on the CPU type.
|
---|
32 | * @{
|
---|
33 | */
|
---|
34 |
|
---|
35 | /**
|
---|
36 | * CPU Architectures.
|
---|
37 | *
|
---|
38 | * The constants used by this enum has the same values as
|
---|
39 | * the K_ARCH_* #defines defined by k/kDefs.h.
|
---|
40 | */
|
---|
41 | typedef enum KCPUARCH
|
---|
42 | {
|
---|
43 | /** @copydoc K_ARCH_UNKNOWN */
|
---|
44 | KCPUARCH_UNKNOWN = K_ARCH_UNKNOWN,
|
---|
45 | /** @copydoc K_ARCH_X86_16 */
|
---|
46 | KCPUARCH_X86_16 = K_ARCH_X86_16,
|
---|
47 | /** @copydoc K_ARCH_X86_32 */
|
---|
48 | KCPUARCH_X86_32 = K_ARCH_X86_32,
|
---|
49 | /** @copydoc K_ARCH_AMD64 */
|
---|
50 | KCPUARCH_AMD64 = K_ARCH_AMD64,
|
---|
51 | /** @copydoc K_ARCH_IA64 */
|
---|
52 | KCPUARCH_IA64 = K_ARCH_IA64,
|
---|
53 | /** @copydoc K_ARCH_ALPHA */
|
---|
54 | KCPUARCH_ALPHA = K_ARCH_ALPHA,
|
---|
55 | /** @copydoc K_ARCH_ALPHA_32 */
|
---|
56 | KCPUARCH_ALPHA_32 = K_ARCH_ALPHA_32,
|
---|
57 | /** @copydoc K_ARCH_ARM_32 */
|
---|
58 | KCPUARCH_ARM_32 = K_ARCH_ARM_32,
|
---|
59 | /** @copydoc K_ARCH_ARM_64 */
|
---|
60 | KCPUARCH_ARM_64 = K_ARCH_ARM_64,
|
---|
61 | /** @copydoc K_ARCH_MIPS_32 */
|
---|
62 | KCPUARCH_MIPS_32 = K_ARCH_MIPS_32,
|
---|
63 | /** @copydoc K_ARCH_MIPS_64 */
|
---|
64 | KCPUARCH_MIPS_64 = K_ARCH_MIPS_64,
|
---|
65 | /** @copydoc K_ARCH_POWERPC_32 */
|
---|
66 | KCPUARCH_POWERPC_32 = K_ARCH_POWERPC_32,
|
---|
67 | /** @copydoc K_ARCH_POWERPC_64 */
|
---|
68 | KCPUARCH_POWERPC_64 = K_ARCH_POWERPC_64,
|
---|
69 | /** @copydoc K_ARCH_SPARC_32 */
|
---|
70 | KCPUARCH_SPARC_32 = K_ARCH_SPARC_32,
|
---|
71 | /** @copydoc K_ARCH_SPARC_64 */
|
---|
72 | KCPUARCH_SPARC_64 = K_ARCH_SPARC_64,
|
---|
73 |
|
---|
74 | /** Hack to blow the type up to 32-bit. */
|
---|
75 | KCPUARCH_32BIT_HACK = 0x7fffffff
|
---|
76 | } KCPUARCH;
|
---|
77 |
|
---|
78 | /** Pointer to a CPU architecture type. */
|
---|
79 | typedef KCPUARCH *PKCPUARCH;
|
---|
80 | /** Pointer to a const CPU architecture type. */
|
---|
81 | typedef const KCPUARCH *PCKCPUARCH;
|
---|
82 |
|
---|
83 |
|
---|
84 | /**
|
---|
85 | * CPU models.
|
---|
86 | */
|
---|
87 | typedef enum KCPU
|
---|
88 | {
|
---|
89 | /** The usual invalid cpu. */
|
---|
90 | KCPU_INVALID = 0,
|
---|
91 |
|
---|
92 | /** @name K_ARCH_X86_16
|
---|
93 | * @{ */
|
---|
94 | KCPU_I8086,
|
---|
95 | KCPU_I8088,
|
---|
96 | KCPU_I80186,
|
---|
97 | KCPU_I80286,
|
---|
98 | KCPU_I386_16,
|
---|
99 | KCPU_I486_16,
|
---|
100 | KCPU_I486SX_16,
|
---|
101 | KCPU_I586_16,
|
---|
102 | KCPU_I686_16,
|
---|
103 | KCPU_P4_16,
|
---|
104 | KCPU_CORE2_16,
|
---|
105 | KCPU_K6_16,
|
---|
106 | KCPU_K7_16,
|
---|
107 | KCPU_K8_16,
|
---|
108 | KCPU_FIRST_X86_16 = KCPU_I8086,
|
---|
109 | KCPU_LAST_X86_16 = KCPU_K8_16,
|
---|
110 | /** @} */
|
---|
111 |
|
---|
112 | /** @name K_ARCH_X86_32
|
---|
113 | * @{ */
|
---|
114 | KCPU_X86_32_BLEND,
|
---|
115 | KCPU_I386,
|
---|
116 | KCPU_I486,
|
---|
117 | KCPU_I486SX,
|
---|
118 | KCPU_I586,
|
---|
119 | KCPU_I686,
|
---|
120 | KCPU_P4,
|
---|
121 | KCPU_CORE2_32,
|
---|
122 | KCPU_K6,
|
---|
123 | KCPU_K7,
|
---|
124 | KCPU_K8_32,
|
---|
125 | KCPU_FIRST_X86_32 = KCPU_I386,
|
---|
126 | KCPU_LAST_X86_32 = KCPU_K8_32,
|
---|
127 | /** @} */
|
---|
128 |
|
---|
129 | /** @name K_ARCH_AMD64
|
---|
130 | * @{ */
|
---|
131 | KCPU_AMD64_BLEND,
|
---|
132 | KCPU_K8,
|
---|
133 | KCPU_P4_64,
|
---|
134 | KCPU_CORE2,
|
---|
135 | KCPU_FIRST_AMD64 = KCPU_K8,
|
---|
136 | KCPU_LAST_AMD64 = KCPU_CORE2,
|
---|
137 | /** @} */
|
---|
138 |
|
---|
139 | /** The end of the valid cpu values (exclusive). */
|
---|
140 | KCPU_END,
|
---|
141 | /** Hack to blow the type up to 32-bit. */
|
---|
142 | KCPU_32BIT_HACK = 0x7fffffff
|
---|
143 | } KCPU;
|
---|
144 |
|
---|
145 | /** Pointer to a CPU type. */
|
---|
146 | typedef KCPU *PKCPU;
|
---|
147 | /** Pointer to a const CPU type. */
|
---|
148 | typedef const KCPU *PCKCPU;
|
---|
149 |
|
---|
150 | /** @} */
|
---|
151 |
|
---|
152 | #endif
|
---|
153 |
|
---|