mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-11-16 12:34:45 +00:00
2008-12-03 Joel Sherrill <joel.sherrill@OARcorp.com>
Michael South <msouth@msouth.org> PR 1344/bsps * cpuModel.h: Add use of TSC for nanoseconds granularity. i8254 is very slow on some systems. TSC use is auto-detected by default.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2008-12-03 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
Michael South <msouth@msouth.org>
|
||||
|
||||
PR 1344/bsps
|
||||
* cpuModel.h: Add use of TSC for nanoseconds granularity. i8254 is very
|
||||
slow on some systems. TSC use is auto-detected by default.
|
||||
|
||||
2008-08-16 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||
|
||||
* cache.c, displayCpu.c, page.c: Add missing prototypes.
|
||||
|
||||
@@ -31,4 +31,18 @@ extern unsigned char Cx86_step; /* cyrix processor identification */
|
||||
|
||||
extern void printCpuInfo(); /* Display this information on console in ascii form */
|
||||
|
||||
/* determine if the CPU has a TSC */
|
||||
#define x86_has_tsc() \
|
||||
(x86_capability & (1 << 4))
|
||||
|
||||
static inline unsigned long long
|
||||
rdtsc(void)
|
||||
{
|
||||
/* Return the value of the on-chip cycle counter. */
|
||||
unsigned long long result;
|
||||
asm volatile(".byte 0x0F, 0x31" : "=A" (result));
|
||||
return result;
|
||||
} /* rdtsc */
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user