diff options
author | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2014-08-21 08:38:24 -0500 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2014-08-21 09:07:29 -0500 |
commit | 46265063e3300ab613c03151d7aaade580b10554 (patch) | |
tree | d294fe54086282d41091131eb7b65cf755902364 /c/src/lib/libbsp/arm/tms570/misc/cpucounterread.c | |
parent | Add configuration to detect toolset has sigaltstack() prototype (diff) | |
download | rtems-46265063e3300ab613c03151d7aaade580b10554.tar.bz2 |
bsp/tms570: implemented support functions to satisfy complete tests build requirements.
This patch enables to build all RTEMS tests for tms570ls3137_hdk_sdram
BSP variant in in default build. Debug build with --enable-rtems-debug set
has succeed for samples subset of tests as well.
Diffstat (limited to 'c/src/lib/libbsp/arm/tms570/misc/cpucounterread.c')
-rw-r--r-- | c/src/lib/libbsp/arm/tms570/misc/cpucounterread.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/arm/tms570/misc/cpucounterread.c b/c/src/lib/libbsp/arm/tms570/misc/cpucounterread.c new file mode 100644 index 0000000000..f25380cc85 --- /dev/null +++ b/c/src/lib/libbsp/arm/tms570/misc/cpucounterread.c @@ -0,0 +1,44 @@ +/** + * @file + * + * @ingroup tms570_clocks + * + * @brief System clocks. + */ + +/* + * Copyright (c) 2014 Pavel Pisa <pisa@cmp.felk.cvut.cz> + * + * Czech Technical University in Prague + * Zikova 1903/4 + * 166 36 Praha 6 + * Czech Republic + * + * Based on LPC24xx and LPC1768 BSP + * by embedded brains GmbH and others + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include <stdlib.h> + +#include <rtems.h> +#include <bsp.h> + + +/** + * @brief returns the actual value of Cortex-R cycle counter register + * + * The register is incremented at each core clock period + * + * @retval x actual core clock counter value + * + */ +CPU_Counter_ticks _CPU_Counter_read(void) +{ + uint32_t ticks; + asm volatile ("mrc p15, 0, %0, c9, c13, 0\n": "=r" (ticks)); + return ticks; +} |