Add _CPU_Counter_frequency()

Add rtems_counter_frequency() API function.  Use it to initialize the
counter value converter via the new system initialization step
(RTEMS_SYSINIT_CPU_COUNTER).  This decouples the counter implementation
and the counter converter.  It avoids an unnecessary pull in of the
64-bit integer division from libgcc.

Update #3456.
This commit is contained in:
Sebastian Huber
2018-05-23 14:17:25 +02:00
parent 4c7b18e358
commit 65f868cac6
80 changed files with 293 additions and 86 deletions

View File

@@ -13,7 +13,6 @@
*/
#include <bsp/bootcard.h>
#include <bsp/arm-a9mpcore-clock.h>
#include <bsp/fdt.h>
#include <bsp/irq-generic.h>
#include <bsp/linker-symbols.h>
@@ -95,7 +94,6 @@ static void update_clocks(void)
void bsp_start(void)
{
update_clocks();
a9mpcore_clock_initialize_early();
bsp_interrupt_initialize();
rtems_cache_coherent_add_area(
bsp_section_nocacheheap_begin,

View File

@@ -22,15 +22,6 @@ extern "C" {
*/
uint32_t a9mpcore_clock_periphclk(void);
/**
* @brief Do early clock initialization so that the CPU counter conversion
* works.
*/
static inline void a9mpcore_clock_initialize_early(void)
{
rtems_counter_initialize_converter(a9mpcore_clock_periphclk());
}
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@@ -109,6 +109,11 @@ unsigned lpc176x_cclk( void )
return cclk;
}
uint32_t _CPU_Counter_frequency(void)
{
return LPC176X_PCLK;
}
CPU_Counter_ticks _CPU_Counter_read( void )
{
return lpc176x_get_timer1();

View File

@@ -61,8 +61,11 @@ void lpc24xx_timer_initialize(void)
/* Start timer */
T1TCR = TCR_EN;
}
rtems_counter_initialize_converter(LPC24XX_PCLK);
uint32_t _CPU_Counter_frequency(void)
{
return LPC24XX_PCLK;
}
CPU_Counter_ticks _CPU_Counter_read(void)

View File

@@ -26,6 +26,11 @@
#include <bsp/bootcard.h>
#include <bsp/irq-generic.h>
uint32_t _CPU_Counter_frequency(void)
{
return LPC32XX_PERIPH_CLK;
}
CPU_Counter_ticks _CPU_Counter_read(void)
{
return lpc32xx_timer();
@@ -33,6 +38,5 @@ CPU_Counter_ticks _CPU_Counter_read(void)
void bsp_start(void)
{
rtems_counter_initialize_converter(LPC32XX_PERIPH_CLK);
bsp_interrupt_initialize();
}

View File

@@ -14,11 +14,9 @@
#include <bsp.h>
#include <bsp/bootcard.h>
#include <bsp/arm-a9mpcore-clock.h>
#include <bsp/irq-generic.h>
void bsp_start(void)
{
a9mpcore_clock_initialize_early();
bsp_interrupt_initialize();
}

View File

@@ -157,6 +157,11 @@ static void a9mpcore_clock_initialize(void)
rtems_timecounter_install(&a9mpcore_tc);
}
uint32_t _CPU_Counter_frequency(void)
{
return a9mpcore_clock_periphclk();
}
CPU_Counter_ticks _CPU_Counter_read(void)
{
volatile a9mpcore_gt *gt = A9MPCORE_GT;

View File

@@ -166,6 +166,11 @@ static void arm_gt_clock_initialize(void)
rtems_timecounter_install(tc);
}
uint32_t _CPU_Counter_frequency(void)
{
return arm_gt_clock_instance.interval;
}
CPU_Counter_ticks _CPU_Counter_read(void)
{
return (uint32_t) arm_gt_clock_get_count();
@@ -179,14 +184,12 @@ static void arm_gt_clock_early_init(void)
&arm_gt_clock_instance.interval,
&arm_gt_clock_instance.irq
);
rtems_counter_initialize_converter(arm_gt_clock_instance.interval);
}
RTEMS_SYSINIT_ITEM(
arm_gt_clock_early_init,
RTEMS_SYSINIT_BSP_START,
RTEMS_SYSINIT_ORDER_LAST
RTEMS_SYSINIT_CPU_COUNTER,
RTEMS_SYSINIT_ORDER_FIRST
);
#define Clock_driver_support_at_tick() \

View File

@@ -19,6 +19,16 @@
#include <bsp.h>
#include <bsp/fatal.h>
uint32_t _CPU_Counter_frequency(void)
{
#ifdef BSP_ARMV7M_SYSTICK_FREQUENCY
return = BSP_ARMV7M_SYSTICK_FREQUENCY;
#else
volatile ARMV7M_Systick *systick = _ARMV7M_Systick;
return ARMV7M_SYSTICK_CALIB_TENMS_GET(systick->calib) * 100;
#endif
}
CPU_Counter_ticks _CPU_Counter_read(void)
{
volatile ARMV7M_DWT *dwt = _ARMV7M_DWT;
@@ -32,22 +42,13 @@ static void armv7m_cpu_counter_initialize(void)
cyccnt_enabled = _ARMV7M_DWT_Enable_CYCCNT();
if (cyccnt_enabled) {
#ifdef BSP_ARMV7M_SYSTICK_FREQUENCY
uint64_t freq = BSP_ARMV7M_SYSTICK_FREQUENCY;
#else
volatile ARMV7M_Systick *systick = _ARMV7M_Systick;
uint64_t freq = ARMV7M_SYSTICK_CALIB_TENMS_GET(systick->calib) * 100ULL;
#endif
rtems_counter_initialize_converter(freq);
} else {
if (!cyccnt_enabled) {
bsp_fatal(BSP_ARM_ARMV7M_CPU_COUNTER_INIT);
}
}
RTEMS_SYSINIT_ITEM(
armv7m_cpu_counter_initialize,
RTEMS_SYSINIT_BSP_START,
RTEMS_SYSINIT_CPU_COUNTER,
RTEMS_SYSINIT_ORDER_FIRST
);

View File

@@ -46,8 +46,11 @@ static void tms570_cpu_counter_initialize(void)
pmcr &= ~ARM_CP15_PMCR_D;
pmcr |= ARM_CP15_PMCR_E;
arm_cp15_set_performance_monitors_control(pmcr);
}
rtems_counter_initialize_converter(2 * BSP_PLL_OUT_CLOCK);
uint32_t _CPU_Counter_frequency(void)
{
return 2 * BSP_PLL_OUT_CLOCK;
}
CPU_Counter_ticks _CPU_Counter_read(void)
@@ -57,6 +60,6 @@ CPU_Counter_ticks _CPU_Counter_read(void)
RTEMS_SYSINIT_ITEM(
tms570_cpu_counter_initialize,
RTEMS_SYSINIT_BSP_START,
RTEMS_SYSINIT_CPU_COUNTER,
RTEMS_SYSINIT_ORDER_FIRST
);

View File

@@ -14,7 +14,6 @@
#include <bsp.h>
#include <bsp/bootcard.h>
#include <bsp/arm-a9mpcore-clock.h>
#include <bsp/irq-generic.h>
#include <bsp/linker-symbols.h>
@@ -25,7 +24,6 @@ __attribute__ ((weak)) uint32_t zynq_clock_cpu_1x(void)
void bsp_start(void)
{
a9mpcore_clock_initialize_early();
bsp_interrupt_initialize();
rtems_cache_coherent_add_area(
bsp_section_nocacheheap_begin,

View File

@@ -162,6 +162,11 @@ BSP_getBoardType( void )
return board_type;
}
uint32_t _CPU_Counter_frequency(void)
{
return BSP_bus_frequency / (BSP_time_base_divisor / 1000);
}
/*
* bsp_start
*
@@ -330,9 +335,6 @@ void bsp_start( void )
*/
bsp_clicks_per_usec = BSP_bus_frequency/(BSP_time_base_divisor * 1000);
rtems_counter_initialize_converter(
BSP_bus_frequency / (BSP_time_base_divisor / 1000)
);
#ifdef SHOW_MORE_INIT_SETTINGS
printk(

View File

@@ -112,6 +112,11 @@ uint32_t bsp_time_base_frequency;
/* Legacy */
uint32_t bsp_clicks_per_usec;
uint32_t _CPU_Counter_frequency(void)
{
return bsp_time_base_frequency;
}
void bsp_start(void)
{
/*
@@ -145,7 +150,6 @@ void bsp_start(void)
bsp_time_base_frequency = XLB_CLOCK / 4;
bsp_clicks_per_usec = (XLB_CLOCK/4000000);
rtems_counter_initialize_converter(bsp_time_base_frequency);
/* Initialize exception handler */
ppc_exc_cache_wb_check = 0;

View File

@@ -51,6 +51,11 @@ static int mpc83xx_decrementer_exception_handler( BSP_Exception_frame *frame, un
return 0;
}
uint32_t _CPU_Counter_frequency(void)
{
return bsp_time_base_frequency;
}
void bsp_start( void)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
@@ -92,7 +97,6 @@ void bsp_start( void)
#endif /* HAS_UBOOT */
bsp_time_base_frequency = BSP_bus_frequency / 4;
bsp_clicks_per_usec = bsp_time_base_frequency / 1000000;
rtems_counter_initialize_converter(bsp_time_base_frequency);
/* Initialize some console parameters */
for (i = 0; i < console_device_count; ++i) {

View File

@@ -153,6 +153,11 @@ DirectUARTWrite(const char c)
BSP_output_char_function_type BSP_output_char = DirectUARTWrite;
BSP_polling_getchar_function_type BSP_poll_char = NULL;
uint32_t _CPU_Counter_frequency(void)
{
return bsp_clicks_per_usec * 1000000;
}
/*===================================================================*/
void bsp_start( void )
@@ -178,7 +183,6 @@ void bsp_start( void )
/* Set globals visible to clock.c */
/* timebase register ticks/microsecond = CPU Clk in MHz */
bsp_clicks_per_usec = 400;
rtems_counter_initialize_converter(bsp_clicks_per_usec * 1000000);
/*
* Initialize default raw exception handlers.

View File

@@ -119,6 +119,11 @@ static unsigned int get_eumbbar(void) {
}
#endif
uint32_t _CPU_Counter_frequency(void)
{
return BSP_bus_frequency / (BSP_time_base_divisor / 1000);
}
/*
* bsp_start
*
@@ -346,9 +351,6 @@ void bsp_start( void )
* initialize the device driver parameters
*/
bsp_clicks_per_usec = BSP_bus_frequency/(BSP_time_base_divisor * 1000);
rtems_counter_initialize_converter(
BSP_bus_frequency / (BSP_time_base_divisor / 1000)
);
/*
* Initalize RTEMS IRQ system

View File

@@ -63,6 +63,11 @@ static void null_pointer_protection(void)
#endif
}
uint32_t _CPU_Counter_frequency(void)
{
return bsp_clock_speed;
}
void bsp_start(void)
{
null_pointer_protection();
@@ -82,7 +87,6 @@ void bsp_start(void)
/* Time reference value */
bsp_clicks_per_usec = bsp_clock_speed / 1000000;
rtems_counter_initialize_converter(bsp_clock_speed);
/* Initialize exceptions */
ppc_exc_initialize_with_vector_base(

View File

@@ -114,6 +114,11 @@ static void _BSP_Uart2_enable(void)
csr->bcsr1 &= ~UART2_E; /* Enable Uart2 */
}
uint32_t _CPU_Counter_frequency(void)
{
return bsp_clock_speed;
}
void bsp_start(void)
{
/* Set MPC8260ADS board LEDS and Uart enable lines */
@@ -171,7 +176,6 @@ void bsp_start(void)
bsp_serial_cts_rts = 0;
bsp_serial_rate = 9600;
bsp_clock_speed = 40000000;
rtems_counter_initialize_converter(bsp_clock_speed);
#ifdef REV_0_2
/* set up some board specific registers */

View File

@@ -192,6 +192,11 @@ BSP_calc_freqs( void )
printk("CPU Clock Freq: %10u Hz\n", BSP_processor_frequency);
}
uint32_t _CPU_Counter_frequency(void)
{
return BSP_bus_frequency / (BSP_time_base_divisor / 1000);
}
/*
* bsp_start
*
@@ -367,9 +372,6 @@ VpdBufRec vpdData [] = {
_BSP_clear_hostbridge_errors(0 /* enableMCP */, 0/*quiet*/);
bsp_clicks_per_usec = BSP_bus_frequency/(BSP_time_base_divisor * 1000);
rtems_counter_initialize_converter(
BSP_bus_frequency / (BSP_time_base_divisor / 1000)
);
/*
* Initalize RTEMS IRQ system

View File

@@ -169,6 +169,11 @@ save_boot_params(
return cmdline_buf;
}
uint32_t _CPU_Counter_frequency(void)
{
return BSP_bus_frequency / (BSP_time_base_divisor / 1000);
}
void bsp_start( void )
{
#ifdef CONF_VPD
@@ -265,9 +270,6 @@ void bsp_start( void )
/* P94 : 7455 TB/DECR is clocked by the system bus clock frequency */
bsp_clicks_per_usec = BSP_bus_frequency/(BSP_time_base_divisor * 1000);
rtems_counter_initialize_converter(
BSP_bus_frequency / (BSP_time_base_divisor / 1000)
);
/*
* Initalize RTEMS IRQ system

View File

@@ -60,6 +60,11 @@ unsigned int BSP_time_base_divisor;
extern unsigned long __rtems_end[];
uint32_t _CPU_Counter_frequency(void)
{
return bsp_clicks_per_usec * 1000000;
}
/*
* bsp_start
*
@@ -81,7 +86,6 @@ void bsp_start( void )
BSP_bus_frequency = (unsigned int)PSIM_INSTRUCTIONS_PER_MICROSECOND;
bsp_clicks_per_usec = BSP_bus_frequency;
BSP_time_base_divisor = 1;
rtems_counter_initialize_converter(bsp_clicks_per_usec * 1000000);
/*
* Initialize default raw exception handlers.

View File

@@ -54,6 +54,11 @@ static int default_decrementer_exception_handler( BSP_Exception_frame *frame, un
return 0;
}
uint32_t _CPU_Counter_frequency(void)
{
return bsp_time_base_frequency;
}
/*
* bsp_start
*
@@ -80,7 +85,6 @@ void bsp_start( void )
BSP_bus_frequency = 20;
bsp_time_base_frequency = 20000000;
bsp_clicks_per_usec = BSP_bus_frequency;
rtems_counter_initialize_converter(bsp_time_base_frequency);
/*
* Initialize the interrupt related settings.

View File

@@ -54,6 +54,15 @@ uint32_t bsp_time_base_frequency;
uint32_t qoriq_clock_frequency;
uint32_t _CPU_Counter_frequency(void)
{
#ifdef __PPC_CPU_E6500__
return qoriq_clock_frequency;
#else
return bsp_time_base_frequency;
#endif
}
static void initialize_frequency_parameters(void)
{
const void *fdt = bsp_fdt_get();
@@ -82,7 +91,6 @@ static void initialize_frequency_parameters(void)
}
qoriq_clock_frequency = fdt32_to_cpu(*val_fdt);
#endif
rtems_counter_initialize_converter(fdt32_to_cpu(*val_fdt));
}
#define MTIVPR(base) \

View File

@@ -40,6 +40,11 @@ extern unsigned long intrStackPtr;
uint32_t bsp_clicks_per_usec;
uint32_t bsp_clock_speed; /* Serial clocks per second */
uint32_t _CPU_Counter_frequency(void)
{
return BSP_CRYSTAL_HZ / 4;
}
/*
* bsp_start()
*
@@ -88,7 +93,6 @@ void bsp_start(void)
*/
bsp_clicks_per_usec = BSP_CRYSTAL_HZ / 4 / 1000000;
bsp_clock_speed = BSP_CLOCK_HZ; /* for SCI baud rate generator */
rtems_counter_initialize_converter(BSP_CRYSTAL_HZ / 4);
/*
* Initalize RTEMS IRQ system

View File

@@ -77,13 +77,15 @@ static void t32mppc_initialize_exceptions(void *interrupt_stack_begin)
MTIVOR(BOOKE_IVOR35, addr);
}
uint32_t _CPU_Counter_frequency(void)
{
return bsp_time_base_frequency;
}
void bsp_start(void)
{
get_ppc_cpu_type();
get_ppc_cpu_revision();
rtems_counter_initialize_converter(bsp_time_base_frequency);
t32mppc_initialize_exceptions(bsp_section_work_begin);
bsp_interrupt_initialize();
}

View File

@@ -92,6 +92,11 @@ static rtems_status_code bsp_tqm_get_cib_uint32( const char *cib_id,
return RTEMS_SUCCESSFUL;
}
uint32_t _CPU_Counter_frequency(void)
{
return bsp_time_base_frequency;
}
void bsp_start( void)
{
@@ -142,7 +147,6 @@ void bsp_start( void)
bsp_time_base_frequency = BSP_bus_frequency / 16;
bsp_clicks_per_usec = bsp_time_base_frequency / 1000000;
rtems_counter_initialize_converter(bsp_time_base_frequency);
/* Initialize exception handler */
ppc_exc_initialize(interrupt_stack_start, interrupt_stack_size);

View File

@@ -74,6 +74,11 @@ LINKER_SYMBOL(virtex_exc_vector_base);
*/
uint32_t bsp_time_base_frequency = XPAR_CPU_PPC405_CORE_CLOCK_FREQ_HZ;
uint32_t _CPU_Counter_frequency(void)
{
return bsp_time_base_frequency;
}
/*
* bsp_start
*
@@ -89,8 +94,6 @@ void bsp_start( void )
get_ppc_cpu_type();
get_ppc_cpu_revision();
rtems_counter_initialize_converter(bsp_time_base_frequency);
/*
* Initialize default raw exception handlers.
*/

View File

@@ -130,6 +130,10 @@ void BSP_ask_for_reset(void)
for(;;);
}
uint32_t _CPU_Counter_frequency(void)
{
return bsp_clicks_per_usec * 1000000;
}
/*===================================================================*/
@@ -166,7 +170,6 @@ void bsp_start(void)
/* Timebase register ticks/microsecond; The application may override these */
bsp_clicks_per_usec = 350;
rtems_counter_initialize_converter(bsp_clicks_per_usec * 1000000);
/*
* Initialize the interrupt related settings.

View File

@@ -144,6 +144,10 @@ void BSP_ask_for_reset(void)
for(;;);
}
uint32_t _CPU_Counter_frequency(void)
{
return BSP_bus_frequency / (BSP_time_base_divisor / 1000);
}
/*===================================================================*/
@@ -185,9 +189,6 @@ void bsp_start(void)
/* Timebase register ticks/microsecond; The application may override these */
bsp_clicks_per_usec = BSP_bus_frequency/(BSP_time_base_divisor * 1000);
rtems_counter_initialize_converter(
BSP_bus_frequency / (BSP_time_base_divisor / 1000)
);
/*
* Initialize the interrupt related settings.

View File

@@ -0,0 +1,20 @@
/*
* Copyright (c) 2018 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
* Dornierstr. 4
* 82178 Puchheim
* Germany
* <rtems@embedded-brains.de>
*
* 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 <rtems/score/cpu.h>
uint32_t _CPU_Counter_frequency( void )
{
return 1000000000;
}

View File

@@ -28,6 +28,8 @@
#include <rtems/timecounter.h>
#include <rtems/score/sparcimpl.h>
#define ERC32_REAL_TIME_CLOCK_FREQUENCY 1000000
/*
* The Real Time Clock Counter Timer uses this trap type.
*/
@@ -78,19 +80,22 @@ static void erc32_tc_tick( void )
);
}
static void erc32_counter_initialize( uint32_t frequency )
static void erc32_counter_initialize( void )
{
_SPARC_Counter_initialize(
_SPARC_Counter_read_address,
_SPARC_Counter_difference_clock_period,
&ERC32_MEC.Real_Time_Clock_Counter
);
rtems_counter_initialize_converter( frequency );
}
uint32_t _CPU_Counter_frequency(void)
{
return ERC32_REAL_TIME_CLOCK_FREQUENCY;
}
#define Clock_driver_support_initialize_hardware() \
do { \
uint32_t frequency = 1000000; \
/* approximately 1 us per countdown */ \
ERC32_MEC.Real_Time_Clock_Scalar = CLOCK_SPEED - 1; \
ERC32_MEC.Real_Time_Clock_Counter = \
@@ -108,11 +113,11 @@ static void erc32_counter_initialize( uint32_t frequency )
); \
rtems_timecounter_simple_install( \
&erc32_tc, \
frequency, \
ERC32_REAL_TIME_CLOCK_FREQUENCY, \
rtems_configuration_get_microseconds_per_tick(), \
erc32_tc_get_timecount \
); \
erc32_counter_initialize( frequency ); \
erc32_counter_initialize(); \
} while (0)
#define Clock_driver_timecounter_tick() erc32_tc_tick()

View File

@@ -18,11 +18,17 @@
#include <rtems/sysinit.h>
#include <rtems/score/sparcimpl.h>
static uint32_t leon3_counter_frequency = 1000000000;
uint32_t _CPU_Counter_frequency(void)
{
return leon3_up_counter_frequency;
}
static void leon3_counter_initialize(void)
{
volatile struct irqmp_timestamp_regs *irqmp_ts;
volatile struct gptimer_regs *gpt;
unsigned int freq;
irqmp_ts = &LEON3_IrqCtrl_Regs->timestamp[0];
gpt = LEON3_Timer_Regs;
@@ -38,8 +44,7 @@ static void leon3_counter_initialize(void)
NULL
);
freq = leon3_up_counter_frequency();
rtems_counter_initialize_converter(freq);
leon3_counter_frequency = leon3_up_counter_frequency();
} else if (leon3_irqmp_has_timestamp(irqmp_ts)) {
/* Use the interrupt controller timestamp counter if available */
@@ -52,8 +57,7 @@ static void leon3_counter_initialize(void)
(volatile const uint32_t *) &irqmp_ts->counter
);
freq = ambapp_freq_get(&ambapp_plb, LEON3_IrqCtrl_Adev);
rtems_counter_initialize_converter(freq);
leon3_counter_frequency = ambapp_freq_get(&ambapp_plb, LEON3_IrqCtrl_Adev);
} else if (gpt != NULL) {
/* Fall back to the first GPTIMER if available */
@@ -66,15 +70,15 @@ static void leon3_counter_initialize(void)
(volatile const uint32_t *) &gpt->timer[LEON3_CLOCK_INDEX].value
);
freq = ambapp_freq_get(&ambapp_plb, LEON3_Timer_Adev);
rtems_counter_initialize_converter(freq / (gpt->scaler_reload - 1));
leon3_counter_frequency = ambapp_freq_get(&ambapp_plb, LEON3_Timer_Adev) /
(gpt->scaler_reload - 1);
}
}
RTEMS_SYSINIT_ITEM(
leon3_counter_initialize,
RTEMS_SYSINIT_BSP_START,
RTEMS_SYSINIT_ORDER_THIRD
RTEMS_SYSINIT_CPU_COUNTER,
RTEMS_SYSINIT_ORDER_FIRST
);
SPARC_COUNTER_DEFINITION;

View File

@@ -46,6 +46,7 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/gpio/gpio-support.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterdiff.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/btimer/btimer-stub.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterfrequency.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterread.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/start/bsp-start-memcpy.S
librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/cp15/arm-cp15-set-exception-handler.c

View File

@@ -25,6 +25,7 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-empty.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/csb336/start/memmap.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/getentropy/getentropy-cpucounter.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/sbrk.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterfrequency.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterread.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterdiff.c
librtemsbsp_a_SOURCES +=../../../../../../bsps/arm/csb336/clock/clockdrv.c

View File

@@ -34,6 +34,7 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/csb337/start/bspreset.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/csb337/start/memmap.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/sbrk.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/getentropy/getentropy-cpucounter.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterfrequency.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterread.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterdiff.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/csb337/start/pmc.c

View File

@@ -23,6 +23,7 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/sbrk.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/getentropy/getentropy-cpucounter.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/edb7312/start/bspreset.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterfrequency.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterread.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterdiff.c

View File

@@ -25,6 +25,7 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/gdbarmsim/start/bspreset.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/getentropy/getentropy-cpucounter.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/sbrk.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/gdbarmsim/start/syscalls.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterfrequency.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterread.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterdiff.c
# console

View File

@@ -24,6 +24,7 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/gumstix/start/bspstart.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/gumstix/start/bspreset.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/gumstix/start/memmap.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterfrequency.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterread.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterdiff.c
librtemsbsp_a_SOURCES +=../../../../../../bsps/arm/gumstix/clock/clock.c

View File

@@ -34,6 +34,7 @@ librtemsbsp_a_SOURCES =
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/getentropy/getentropy-cpucounter.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterfrequency.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterread.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterdiff.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/sbrk.c

View File

@@ -39,6 +39,7 @@ librtemsbsp_a_SOURCES =
# Shared
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/getentropy/getentropy-cpucounter.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterfrequency.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterread.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterdiff.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/sbrk.c

View File

@@ -25,6 +25,7 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/rtl22xx/start/bspreset.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/sbrk.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/getentropy/getentropy-cpucounter.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterfrequency.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterread.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterdiff.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/rtl22xx/btimer/btimer.c

View File

@@ -25,6 +25,7 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/getentropy/getentropy
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/sbrk.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterfrequency.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterread.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterdiff.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/smdk2410/btimer/btimer.c

View File

@@ -33,6 +33,7 @@ librtemsbsp_a_SOURCES =
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/getentropy/getentropy-cpucounter.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterfrequency.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterread.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterdiff.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/sbrk.c

View File

@@ -26,6 +26,7 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-empty.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/leon2/start/bspstart.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/shared/start/bspgetworkarea.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterfrequency.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/getentropy/getentropy-cpucounter.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/sbrk.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/leon2/start/setvec.c

View File

@@ -7,7 +7,7 @@
*/
/*
* Copyright (c) 2014 embedded brains GmbH. All rights reserved.
* Copyright (c) 2014, 2018 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
* Dornierstr. 4
@@ -61,6 +61,16 @@ extern "C" {
*/
typedef CPU_Counter_ticks rtems_counter_ticks;
/**
* @brief Returns the current counter frequency in Hz.
*
* @return The current counter frequency in Hz.
*/
static inline uint32_t rtems_counter_frequency( void )
{
return _CPU_Counter_frequency();
}
/**
* @brief Reads the current counter values.
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014 embedded brains GmbH. All rights reserved.
* Copyright (c) 2014, 2018 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
* Dornierstr. 4
@@ -13,12 +13,13 @@
*/
#include <rtems/counter.h>
#include <rtems/sysinit.h>
RTEMS_STATIC_ASSERT(sizeof(rtems_counter_ticks) <= sizeof(uint32_t), type);
static uint64_t to_ns_scaler = UINT64_C(1) << 32;
static uint64_t to_ns_scaler;
static uint64_t from_ns_scaler = UINT64_C(1) << 32;
static uint64_t from_ns_scaler;
uint64_t rtems_counter_ticks_to_nanoseconds( rtems_counter_ticks counter )
{
@@ -37,3 +38,14 @@ void rtems_counter_initialize_converter( uint32_t frequency )
to_ns_scaler = ((ns_per_s << 32) + frequency - 1) / frequency;
from_ns_scaler = ((UINT64_C(1) << 32) * frequency + ns_per_s - 1) / ns_per_s;
}
static void rtems_counter_sysinit( void )
{
rtems_counter_initialize_converter( rtems_counter_frequency() );
}
RTEMS_SYSINIT_ITEM(
rtems_counter_sysinit,
RTEMS_SYSINIT_CPU_COUNTER,
RTEMS_SYSINIT_ORDER_LAST
);

View File

@@ -596,6 +596,8 @@ static inline uint16_t CPU_swap_u16( uint16_t value )
typedef uint32_t CPU_Counter_ticks;
uint32_t _CPU_Counter_frequency( void );
CPU_Counter_ticks _CPU_Counter_read( void );
CPU_Counter_ticks _CPU_Counter_difference(

View File

@@ -2,6 +2,7 @@ include $(top_srcdir)/automake/compile.am
noinst_LIBRARIES = libscorecpu.a
libscorecpu_a_SOURCES = cpu.c cpu_asm.S
libscorecpu_a_SOURCES += ../no_cpu/cpucounterfrequency.c
libscorecpu_a_SOURCES += ../no_cpu/cpucounterread.c
libscorecpu_a_SOURCES += bfin-exception-frame-print.c
libscorecpu_a_CPPFLAGS = $(AM_CPPFLAGS)

View File

@@ -982,6 +982,8 @@ static inline uint32_t CPU_swap_u32(
typedef uint32_t CPU_Counter_ticks;
uint32_t _CPU_Counter_frequency( void );
CPU_Counter_ticks _CPU_Counter_read( void );
static inline CPU_Counter_ticks _CPU_Counter_difference(

View File

@@ -8,6 +8,7 @@ libscorecpu_a_SOURCES = cpu.c
libscorecpu_a_SOURCES += epiphany-exception-handler.S
libscorecpu_a_SOURCES += epiphany-context-switch.S
libscorecpu_a_SOURCES += epiphany-context-initialize.c
libscorecpu_a_SOURCES += ../no_cpu/cpucounterfrequency.c
libscorecpu_a_SOURCES += setjmp.S
libscorecpu_a_CPPFLAGS = $(AM_CPPFLAGS)

View File

@@ -854,6 +854,8 @@ static inline void _CPU_Context_validate( uintptr_t pattern )
typedef uint32_t CPU_Counter_ticks;
uint32_t _CPU_Counter_frequency( void );
CPU_Counter_ticks _CPU_Counter_read( void );
static inline CPU_Counter_ticks _CPU_Counter_difference(

View File

@@ -2,6 +2,7 @@ include $(top_srcdir)/automake/compile.am
noinst_LIBRARIES = libscorecpu.a
libscorecpu_a_SOURCES = cpu.c cpu_asm.S
libscorecpu_a_SOURCES += ../no_cpu/cpucounterfrequency.c
libscorecpu_a_SOURCES += ../no_cpu/cpucounterread.c
libscorecpu_a_CPPFLAGS = $(AM_CPPFLAGS)

View File

@@ -697,6 +697,8 @@ void _CPU_Exception_frame_print( const CPU_Exception_frame *frame );
typedef uint32_t CPU_Counter_ticks;
uint32_t _CPU_Counter_frequency( void );
CPU_Counter_ticks _CPU_Counter_read( void );
static inline CPU_Counter_ticks _CPU_Counter_difference(

View File

@@ -2,6 +2,7 @@ include $(top_srcdir)/automake/compile.am
noinst_LIBRARIES = libscorecpu.a
libscorecpu_a_SOURCES = cpu.c cpu_asm.S irq.c
libscorecpu_a_SOURCES += ../no_cpu/cpucounterfrequency.c
libscorecpu_a_SOURCES += ../no_cpu/cpucounterread.c
libscorecpu_a_SOURCES += lm32-exception-frame-print.c
libscorecpu_a_CPPFLAGS = $(AM_CPPFLAGS)

View File

@@ -1018,6 +1018,8 @@ static inline uint16_t CPU_swap_u16(uint16_t v)
typedef uint32_t CPU_Counter_ticks;
uint32_t _CPU_Counter_frequency( void );
CPU_Counter_ticks _CPU_Counter_read( void );
static inline CPU_Counter_ticks _CPU_Counter_difference(

View File

@@ -3,6 +3,7 @@ include $(top_srcdir)/automake/compile.am
noinst_LIBRARIES = libscorecpu.a
libscorecpu_a_SOURCES = cpu.c cpu_asm.c context_switch.S context_init.c \
varvects.S
libscorecpu_a_SOURCES += ../no_cpu/cpucounterfrequency.c
libscorecpu_a_SOURCES += ../no_cpu/cpucounterread.c
libscorecpu_a_SOURCES += m32c-exception-frame-print.c
libscorecpu_a_CPPFLAGS = $(AM_CPPFLAGS)

View File

@@ -968,6 +968,8 @@ static inline uint32_t CPU_swap_u32(
typedef uint32_t CPU_Counter_ticks;
uint32_t _CPU_Counter_frequency( void );
CPU_Counter_ticks _CPU_Counter_read( void );
static inline CPU_Counter_ticks _CPU_Counter_difference(

View File

@@ -4,6 +4,7 @@ noinst_LIBRARIES = libscorecpu.a
libscorecpu_a_CPPFLAGS = $(AM_CPPFLAGS)
libscorecpu_a_SOURCES = cpu.c cpu_asm.S
libscorecpu_a_SOURCES += ../no_cpu/cpucounterfrequency.c
libscorecpu_a_SOURCES += ../no_cpu/cpucounterread.c
libscorecpu_a_SOURCES += m68k-exception-frame-print.c
libscorecpu_a_SOURCES += __m68k_read_tp.c

View File

@@ -679,6 +679,8 @@ void _CPU_Exception_frame_print(
typedef uint32_t CPU_Counter_ticks;
uint32_t _CPU_Counter_frequency( void );
CPU_Counter_ticks _CPU_Counter_read( void );
static inline CPU_Counter_ticks _CPU_Counter_difference(

View File

@@ -2,6 +2,7 @@ include $(top_srcdir)/automake/compile.am
noinst_LIBRARIES = libscorecpu.a
libscorecpu_a_SOURCES = cpu.c cpu_asm.S
libscorecpu_a_SOURCES += ../no_cpu/cpucounterfrequency.c
libscorecpu_a_SOURCES += ../no_cpu/cpucounterread.c
libscorecpu_a_CPPFLAGS = $(AM_CPPFLAGS)

View File

@@ -988,6 +988,8 @@ static inline uint32_t CPU_swap_u32(
typedef uint32_t CPU_Counter_ticks;
uint32_t _CPU_Counter_frequency( void );
CPU_Counter_ticks _CPU_Counter_read( void );
static inline CPU_Counter_ticks _CPU_Counter_difference(

View File

@@ -6,6 +6,7 @@ include $(top_srcdir)/automake/compile.am
noinst_LIBRARIES = libscorecpu.a
libscorecpu_a_SOURCES = cpu.c moxie-exception-frame-print.c cpu_asm.S
libscorecpu_a_SOURCES += ../no_cpu/cpucounterfrequency.c
libscorecpu_a_SOURCES += ../no_cpu/cpucounterread.c
libscorecpu_a_CPPFLAGS = $(AM_CPPFLAGS)

View File

@@ -835,6 +835,8 @@ static inline uint32_t CPU_swap_u32(
typedef uint32_t CPU_Counter_ticks;
uint32_t _CPU_Counter_frequency( void );
CPU_Counter_ticks _CPU_Counter_read( void );
static inline CPU_Counter_ticks _CPU_Counter_difference(

View File

@@ -5,6 +5,7 @@ CLEANFILES =
noinst_LIBRARIES = libscorecpu.a
libscorecpu_a_SOURCES =
libscorecpu_a_SOURCES += ../no_cpu/cpucounterfrequency.c
libscorecpu_a_SOURCES += ../no_cpu/cpucounterread.c
libscorecpu_a_SOURCES += nios2-context-initialize.c
libscorecpu_a_SOURCES += nios2-context-switch.S

View File

@@ -353,6 +353,8 @@ static inline uint32_t CPU_swap_u32( uint32_t value )
typedef uint32_t CPU_Counter_ticks;
uint32_t _CPU_Counter_frequency( void );
CPU_Counter_ticks _CPU_Counter_read( void );
static inline CPU_Counter_ticks _CPU_Counter_difference(

View File

@@ -2,6 +2,7 @@ include $(top_srcdir)/automake/compile.am
noinst_LIBRARIES = libscorecpu.a
libscorecpu_a_SOURCES = cpu.c cpu_asm.c
libscorecpu_a_SOURCES += cpucounterfrequency.c
libscorecpu_a_SOURCES += cpucounterread.c
libscorecpu_a_CPPFLAGS = $(AM_CPPFLAGS)

View File

@@ -0,0 +1,20 @@
/*
* Copyright (c) 2018 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
* Dornierstr. 4
* 82178 Puchheim
* Germany
* <rtems@embedded-brains.de>
*
* 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 <rtems/score/cpu.h>
uint32_t _CPU_Counter_frequency( void )
{
return 1000000000;
}

View File

@@ -1328,6 +1328,13 @@ static inline uint32_t CPU_swap_u32(
*/
typedef uint32_t CPU_Counter_ticks;
/**
* @brief Returns the current CPU counter frequency in Hz.
*
* @return The current CPU counter frequency in Hz.
*/
uint32_t _CPU_Counter_frequency( void );
/**
* @brief Returns the current CPU counter value.
*

View File

@@ -6,8 +6,9 @@ noinst_LIBRARIES = libscorecpu.a
libscorecpu_a_SOURCES =
libscorecpu_a_SOURCES += cpu.c
libscorecpu_a_SOURCES += or1k-context-switch.S
libscorecpu_a_SOURCES += ../no_cpu/cpucounterfrequency.c
libscorecpu_a_SOURCES += or1k-context-initialize.c
libscorecpu_a_SOURCES += or1k-context-switch.S
libscorecpu_a_SOURCES += or1k-context-validate.S
libscorecpu_a_SOURCES += or1k-context-volatile-clobber.S
libscorecpu_a_SOURCES += or1k-exception-default.c

View File

@@ -665,8 +665,6 @@ void _CPU_Context_Initialize(
#define CPU_MAXIMUM_PROCESSORS 32
#ifndef ASM
typedef uint32_t CPU_Counter_ticks;
typedef struct {
uint32_t r[32];
@@ -856,6 +854,8 @@ static inline unsigned int CPU_swap_u32(
typedef uint32_t CPU_Counter_ticks;
uint32_t _CPU_Counter_frequency( void );
CPU_Counter_ticks _CPU_Counter_read( void );
CPU_Counter_ticks _CPU_Counter_difference(

View File

@@ -803,6 +803,8 @@ static inline uint32_t CPU_swap_u32(
typedef uint32_t CPU_Counter_ticks;
uint32_t _CPU_Counter_frequency( void );
static inline CPU_Counter_ticks _CPU_Counter_read( void )
{
CPU_Counter_ticks value;

View File

@@ -2,6 +2,7 @@ include $(top_srcdir)/automake/compile.am
noinst_LIBRARIES = libscorecpu.a
libscorecpu_a_CPPFLAGS = $(AM_CPPFLAGS)
libscorecpu_a_SOURCES = cpu.c
libscorecpu_a_SOURCES += ../no_cpu/cpucounterfrequency.c
libscorecpu_a_SOURCES += riscv-exception-handler.S
libscorecpu_a_SOURCES += riscv-exception-default.c
libscorecpu_a_SOURCES += riscv-exception-frame-print.c

View File

@@ -474,6 +474,8 @@ static inline void _CPU_Context_validate( uintptr_t pattern )
typedef uint32_t CPU_Counter_ticks;
uint32_t _CPU_Counter_frequency( void );
CPU_Counter_ticks _CPU_Counter_read( void );
#ifdef RTEMS_SMP

View File

@@ -2,6 +2,7 @@ include $(top_srcdir)/automake/compile.am
noinst_LIBRARIES = libscorecpu.a
libscorecpu_a_SOURCES = cpu.c context.c
libscorecpu_a_SOURCES += ../no_cpu/cpucounterfrequency.c
libscorecpu_a_SOURCES += ../no_cpu/cpucounterread.c
libscorecpu_a_SOURCES += sh-exception-frame-print.c
libscorecpu_a_CPPFLAGS = $(AM_CPPFLAGS)

View File

@@ -721,6 +721,8 @@ void _CPU_Exception_frame_print( const CPU_Exception_frame *frame );
typedef uint32_t CPU_Counter_ticks;
uint32_t _CPU_Counter_frequency( void );
CPU_Counter_ticks _CPU_Counter_read( void );
static inline CPU_Counter_ticks _CPU_Counter_difference(

View File

@@ -1158,6 +1158,8 @@ static inline uint32_t CPU_swap_u32(
typedef uint32_t CPU_Counter_ticks;
uint32_t _CPU_Counter_frequency( void );
typedef CPU_Counter_ticks ( *SPARC_Counter_read )( void );
typedef CPU_Counter_ticks ( *SPARC_Counter_difference )(

View File

@@ -5,6 +5,7 @@ libscorecpu_a_SOURCES =
libscorecpu_a_SOURCES += context.S
libscorecpu_a_SOURCES += cpu.c
libscorecpu_a_SOURCES += interrupt.S
libscorecpu_a_SOURCES += ../no_cpu/cpucounterfrequency.c
libscorecpu_a_SOURCES += ../no_cpu/cpucounterread.c
libscorecpu_a_SOURCES += sparc64-exception-frame-print.c
libscorecpu_a_SOURCES += sparc64-syscall.S

View File

@@ -1032,6 +1032,8 @@ static inline uint32_t CPU_swap_u32(
typedef uint32_t CPU_Counter_ticks;
uint32_t _CPU_Counter_frequency( void );
CPU_Counter_ticks _CPU_Counter_read( void );
static inline CPU_Counter_ticks _CPU_Counter_difference(

View File

@@ -3,6 +3,7 @@ include $(top_srcdir)/automake/compile.am
noinst_LIBRARIES = libscorecpu.a
libscorecpu_a_SOURCES = cpu.c
libscorecpu_a_SOURCES += cpu_asm.S
libscorecpu_a_SOURCES += ../no_cpu/cpucounterfrequency.c
libscorecpu_a_SOURCES += ../no_cpu/cpucounterread.c
libscorecpu_a_SOURCES += v850-exception-frame-print.c
libscorecpu_a_CPPFLAGS = $(AM_CPPFLAGS)

View File

@@ -934,6 +934,8 @@ static inline uint16_t CPU_swap_u16( uint16_t value )
typedef uint32_t CPU_Counter_ticks;
uint32_t _CPU_Counter_frequency( void );
CPU_Counter_ticks _CPU_Counter_read( void );
static inline CPU_Counter_ticks _CPU_Counter_difference(