Commit ab24be55 authored by Anas Nashif's avatar Anas Nashif Committed by Carles Cufi
Browse files

drivers: timer: provide timer irq to tests



As with previous commit, make the timer irq a simple integer variable
exported by the timer driver for the benefit of this one test
(tests/kernel/context).

Signed-off-by: default avatarAnas Nashif <anas.nashif@intel.com>
parent fb3b4344
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -24,6 +24,10 @@ static uint32_t accumulated_cycle_count;

static int32_t _sys_idle_elapsed_ticks = 1;

#if defined(CONFIG_TEST)
const int32_t z_sys_timer_irq_for_test = TIMER_0_IRQ;
#endif

static void wrapped_announce(int32_t ticks)
{
	driver_uptime += ticks;
+3 −0
Original line number Diff line number Diff line
@@ -48,6 +48,9 @@ BUILD_ASSERT(!IS_ENABLED(CONFIG_SMP), "APIC timer doesn't support SMP");
#define LVT_MODE_MASK		0x00060000	/* timer mode bits */
#define LVT_MODE		0x00000000	/* one-shot */

#if defined(CONFIG_TEST)
const int32_t z_sys_timer_irq_for_test = CONFIG_APIC_TIMER_IRQ;
#endif
/*
 * CYCLES_PER_TICK must always be at least '2', otherwise MAX_TICKS
 * will overflow int32_t, which is how 'ticks' are currently represented.
+3 −0
Original line number Diff line number Diff line
@@ -54,6 +54,9 @@

#define SMP_TIMER_DRIVER (CONFIG_SMP && CONFIG_MP_NUM_CPUS > 1)

#if defined(CONFIG_TEST)
const int32_t z_sys_timer_irq_for_test = IRQ_TIMER0;
#endif
static struct k_spinlock lock;


+3 −0
Original line number Diff line number Diff line
@@ -17,6 +17,9 @@

static struct k_spinlock lock;
static uint64_t last_cycle;
#if defined(CONFIG_TEST)
const int32_t z_sys_timer_irq_for_test = ARM_ARCH_TIMER_IRQ;
#endif

static void arm_arch_timer_compare_isr(const void *arg)
{
+2 −0
Original line number Diff line number Diff line
@@ -41,7 +41,9 @@ BUILD_ASSERT(COMPARATOR_IDX >= 0 && COMPARATOR_IDX <= 1);
static struct k_spinlock lock;
static uint64_t last_count;

#if defined(CONFIG_TEST)
const int32_t z_sys_timer_irq_for_test = TIMER_IRQ; /* See tests/kernel/context */
#endif

static void set_compare(uint64_t time)
{
Loading