RTEMS  5.1
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 
22 extern char hard_math; /* floating point coprocessor present indicator */
23 extern char x86; /* type of cpu (3 = 386, 4 =486, ...) */
24 extern char x86_model;
25 extern char x86_mask;
26 extern int x86_capability; /* cpuid:EDX */
27 extern int x86_capability_x; /* cpuid:ECX */
28 extern int x86_capability_ebx; /* cpuid:EBX */
29 extern int x86_capability_cores; /* cpuid.(EAX=4, ECX=0) - physical cores */
30 extern char x86_vendor_id[13];
31 extern int have_cpuid;
32 extern unsigned char Cx86_step; /* cyrix processor identification */
33 
34 /* Display this information on console in ascii form */
35 extern void printCpuInfo(void);
36 
37 /* determine if the CPU has a TSC */
38 #define x86_has_tsc() \
39  (x86_capability & (1 << 4))
40 
41 static inline unsigned long long
42 rdtsc(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
register struct Per_CPU_Control *_SPARC_Per_CPU_current __asm__("g6")
The pointer to the current per-CPU control is available via register g6.