RTEMS 6.1-rc2
Loading...
Searching...
No Matches
cpuModel.h
1/*
2 * This file contains declaration for variables and code
3 * that may be used to get the Intel Cpu identification
4 * that has been performed by checkCPUtypeSetCr0 function.
5 */
6
7/*
8 * COPYRIGHT (c) 1998 valette@crf.canon.fr
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15#ifndef libcpu_cpuModel_h
16#define libcpu_cpuModel_h
17
18/*
19 * Tell us the machine setup..
20 */
21
22extern char hard_math; /* floating point coprocessor present indicator */
23extern char x86; /* type of cpu (3 = 386, 4 =486, ...) */
24extern char x86_model;
25extern char x86_mask;
26extern int x86_capability; /* cpuid:EDX */
27extern int x86_capability_x; /* cpuid:ECX */
28extern int x86_capability_ebx; /* cpuid:EBX */
29extern int x86_capability_cores; /* cpuid.(EAX=4, ECX=0) - physical cores */
30extern char x86_vendor_id[13];
31extern int have_cpuid;
32extern unsigned char Cx86_step; /* cyrix processor identification */
33
34/* Display this information on console in ascii form */
35extern void printCpuInfo(void);
36
37/* determine if the CPU has a TSC */
38#define x86_has_tsc() \
39 (x86_capability & (1 << 4))
40
41static inline unsigned long long
42rdtsc(void)
43{
44 /* Return the value of the on-chip cycle counter. */
45 unsigned long long result;
46 __asm__ volatile(".byte 0x0F, 0x31" : "=A" (result));
47 return result;
48} /* rdtsc */
49
50
51#endif
Definition: em86.c:52