58#ifdef Clock_driver_nanoseconds_since_last_tick
59#error "Update driver to use the timecounter instead of nanoseconds extension"
62#if CLOCK_DRIVER_USE_FAST_IDLE && CLOCK_DRIVER_ISRS_PER_TICK
63#error "Fast Idle PLUS n ISRs per tick is not supported"
69#ifndef Clock_driver_support_install_isr
70 #define Clock_driver_support_install_isr(isr)
76#ifndef Clock_driver_support_find_timer
77 #define Clock_driver_support_find_timer()
83#ifndef Clock_driver_support_at_tick
84 #define Clock_driver_support_at_tick()
90#ifndef Clock_driver_support_set_interrupt_affinity
91 #define Clock_driver_support_set_interrupt_affinity(online_processors)
98#ifndef Clock_driver_timecounter_tick
99static void Clock_driver_timecounter_tick(
void )
101#if defined(CLOCK_DRIVER_USE_DUMMY_TIMECOUNTER)
103#elif defined(RTEMS_SMP) && defined(CLOCK_DRIVER_USE_ONLY_BOOT_PROCESSOR)
107 cpu_max = _SMP_Get_processor_maximum();
109 for ( cpu_index = 0 ; cpu_index < cpu_max ; ++cpu_index ) {
112 cpu = _Per_CPU_Get_by_index( cpu_index );
114 if ( _Per_CPU_Is_boot_processor( cpu ) ) {
115 rtems_timecounter_tick();
116 }
else if ( _Processor_mask_Is_set( _SMP_Get_online_processors(), cpu_index ) ) {
121 rtems_timecounter_tick();
129#if CLOCK_DRIVER_ISRS_PER_TICK
130 volatile uint32_t Clock_driver_isrs;
138#ifdef Clock_driver_support_shutdown_hardware
139#error "Clock_driver_support_shutdown_hardware() is no longer supported"
149#if defined(BSP_FEATURE_IRQ_EXTENSION) || \
150 (CPU_SIMPLE_VECTORED_INTERRUPTS != TRUE)
151void Clock_isr(
void *arg);
152void Clock_isr(
void *arg)
166 #if CLOCK_DRIVER_USE_FAST_IDLE
168 Clock_driver_timecounter_tick();
170 if (_SMP_Get_processor_maximum() == 1) {
172 uint64_t us_per_tick;
176 cpu_self = _Per_CPU_Get();
179 interval = (uint32_t) ((tc->tc_frequency * us_per_tick) / 1000000);
191 (*tc->tc_get_timecount)(tc),
207 #if CLOCK_DRIVER_ISRS_PER_TICK
211 if ( !Clock_driver_isrs ) {
212 Clock_driver_timecounter_tick();
214 Clock_driver_isrs = CLOCK_DRIVER_ISRS_PER_TICK_VALUE;
221 Clock_driver_timecounter_tick();
242 _SMP_Get_online_processors()
249 Clock_driver_support_initialize_hardware();
254 #if CLOCK_DRIVER_ISRS_PER_TICK
255 Clock_driver_isrs = CLOCK_DRIVER_ISRS_PER_TICK_VALUE;
#define Clock_driver_support_find_timer()
This method is rarely used so default it.
Definition: clockimpl.h:77
#define Clock_driver_support_set_interrupt_affinity(online_processors)
Do nothing by default.
Definition: clockimpl.h:91
#define Clock_driver_support_install_isr(isr)
Do nothing by default.
Definition: clockimpl.h:70
#define Clock_driver_support_at_tick()
Do nothing by default.
Definition: clockimpl.h:84
This header file defines the Clock Driver API.
rtems_status_code rtems_clock_tick(void)
Announces a clock tick.
Definition: clocktick.c:46
ISR_Handler rtems_isr
This type defines the return type of interrupt service routines.
Definition: intr.h:123
ISR_Vector_number rtems_vector_number
This integer type represents interrupt vector numbers.
Definition: intr.h:102
#define rtems_configuration_get_microseconds_per_tick()
Gets the number of microseconds per clock tick configured for this application.
Definition: config.h:527
volatile uint32_t Clock_driver_ticks
ISRs until next clock tick.
Definition: clockimpl.h:136
void _Clock_Initialize(void)
Initialize the clock driver.
Definition: clockimpl.h:226
void _Timecounter_Tick_simple(uint32_t delta, uint32_t offset, ISR_lock_Context *lock_context)
Performs a simple timecounter tick.
#define _Timecounter_Acquire(lock_context)
Lock to protect the timecounter mechanic.
Definition: timecounter.h:215
struct timecounter * _Timecounter
The current timecounter.
void _Watchdog_Tick(struct Per_CPU_Control *cpu)
Performs a watchdog tick.
Definition: watchdogtick.c:76
This header file provides the interfaces of the Per-CPU Information.
This header file provides interfaces of the Thread Handler which are used by the implementation and t...
This header file provides interfaces of the Timecounter Handler which are used by the implementation ...
This header file provides interfaces of the SMP Support which are only used by the implementation.
Local ISR lock context for acquire and release pairs.
Definition: isrlock.h:81
Per CPU Core Structure.
Definition: percpu.h:384
struct _Thread_Control * heir
This is the heir thread for this processor.
Definition: percpu.h:473
volatile uint32_t thread_dispatch_disable_level
The thread dispatch critical section nesting counter which is used to prevent context switches at ino...
Definition: percpu.h:422
struct _Thread_Control * executing
This is the thread executing on this processor.
Definition: percpu.h:457
uint32_t isr_nest_level
Definition: percpu.h:406
bool is_idle
Definition: thread.h:883
This header file provides interfaces of the Watchdog Handler which are only used by the implementatio...