From 959f887aaf4e81fa8a18556a2d390dd6bc283c3d Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 3 Dec 2008 17:28:10 +0000 Subject: 2008-12-03 Joel Sherrill Michael South PR 1344/bsps * configure.ac, clock/ckinit.c, timer/timer.c: Add use of TSC for nanoseconds granularity. i8254 is very slow on some systems. TSC use is auto-detected by default. --- c/src/lib/libbsp/i386/pc386/configure.ac | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'c/src/lib/libbsp/i386/pc386/configure.ac') diff --git a/c/src/lib/libbsp/i386/pc386/configure.ac b/c/src/lib/libbsp/i386/pc386/configure.ac index 729e7cd1e7..9988c1a4a0 100644 --- a/c/src/lib/libbsp/i386/pc386/configure.ac +++ b/c/src/lib/libbsp/i386/pc386/configure.ac @@ -46,6 +46,41 @@ RTEMS_BSPOPTS_HELP([BSP_PRESS_KEY_FOR_RESET], before rebooting the PC. This is useful for unattended PC deployments ]) +RTEMS_BSPOPTS_SET([CLOCK_DRIVER_USE_TSC],[*],[0]) +RTEMS_BSPOPTS_HELP([CLOCK_DRIVER_USE_TSC], +[If enabled, the clock driver will use the TSC register available + with Pentium-class CPUs to report close to nanosecond-accuracy + clock times. + Enable it, if: + - you have nanosecond timing enabled (you do NOT have + USE_TICKS_FOR_CPU_USAGE_STATISTICS enabled) + - you do NOT have CLOCK_DRIVER_USE_8254 enabled (use one, the other, + or neither) + - you have a Pentium which supports TSC (all Intels, and probably + all or most clones) + - you do not have a variable-speed CPU clock. Note that some + motherboard BIOS will automatically vary clock speed for thermal + control. Note also, however, that really new Pentium-class chips + from Intel and AMD will maintain a constant-rate TSC regardless. +]) + +RTEMS_BSPOPTS_SET([CLOCK_DRIVER_USE_8254],[*],[0]) +RTEMS_BSPOPTS_HELP([CLOCK_DRIVER_USE_8254], +[If enabled, the clock driver will use the good old 8254 chip + to report microsecond-accuracy clock times. + Enable it, if: + - you have nanosecond timing enabled (you do NOT have + USE_TICKS_FOR_CPU_USAGE_STATISTICS enabled) + - you do NOT have CLOCK_DRIVER_USE_TSC enabled (use one, the other, + or neither) + - you do not mind adding roughly 5 microseconds to each context switch. +]) + +if test X${CLOCK_DRIVER_USE_TSC} = X1 -a X${CLOCK_DRIVER_USE_8254} = X1 ; then + AC_MSG_ERROR([pc386 both TSC and 8254 specified for clock driver]) +fi + +#define CLOCK_DRIVER_USE_8254 $CLOCK_DRIVER_USE_8254 ## if this is an i386, does gas have good code16 support? RTEMS_I386_GAS_CODE16 AM_CONDITIONAL(RTEMS_GAS_CODE16,[test "$RTEMS_GAS_CODE16" = "yes"]) -- cgit v1.2.3