From 658bb54ed1b665648a62b61b331b85f063d1963c Mon Sep 17 00:00:00 2001 From: Peter Mitsis Date: Mon, 27 Jul 2015 14:45:41 -0400 Subject: [PATCH] Use LOAPIC timer Kconfig options Removes the LOAPIC timer macros from board.h as they are no longer required since appropriate Kconfig options exist to use in their stead. Change-Id: Id0b509eba7cce1839b400f95b989bf886322e1a8 Signed-off-by: Peter Mitsis --- arch/x86/platforms/ia32/board.h | 6 ------ arch/x86/platforms/ia32_pci/board.h | 1 - drivers/timer/loapic_timer.c | 13 ++++++------- samples/nanokernel/test/test_context/src/context.c | 2 +- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/arch/x86/platforms/ia32/board.h b/arch/x86/platforms/ia32/board.h index 20254be7cf7..7c70c1aaf1d 100644 --- a/arch/x86/platforms/ia32/board.h +++ b/arch/x86/platforms/ia32/board.h @@ -93,12 +93,6 @@ the 'ia32' platform. #define LOAPIC_BASE_ADRS LOAPIC_BASE_ADRS_PHYS -/* local APIC timer definitions */ -#define LOAPIC_TIMER_IRQ IOAPIC_NUM_RTES -#define LOAPIC_TIMER_INT_PRI 2 -#define LOAPIC_VEC_BASE(x) (x + 32 + IOAPIC_NUM_RTES) -#define LOAPIC_TIMER_VEC LOAPIC_VEC_BASE(0) - /* serial port (aka COM port) information */ #define COM1_BASE_ADRS 0x3f8 diff --git a/arch/x86/platforms/ia32_pci/board.h b/arch/x86/platforms/ia32_pci/board.h index d91505dab2e..96885eef494 100644 --- a/arch/x86/platforms/ia32_pci/board.h +++ b/arch/x86/platforms/ia32_pci/board.h @@ -113,7 +113,6 @@ the 'ia32_pci' platform. * IRQ28 -> LOAPIC_LINT1 * IRQ29 -> LOAPIC_ERROR */ -#define LOAPIC_VEC_BASE(x) (x + INT_VEC_IRQ0 + IOAPIC_NUM_RTES) /* PCI definitions */ #define PCI_BUS_NUMBERS 2 diff --git a/drivers/timer/loapic_timer.c b/drivers/timer/loapic_timer.c index 2ac9714cb05..1d2dc16c278 100644 --- a/drivers/timer/loapic_timer.c +++ b/drivers/timer/loapic_timer.c @@ -59,8 +59,6 @@ After reset, the timer is initialized to zero. * following constants: * * LOAPIC_BASE_ADRS - * LOAPIC_TIMER_IRQ - * LOAPIC_TIMER_INT_PRI * * NOTE: CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC must be provided by either the * platform configuration file or the project configuration file. @@ -110,8 +108,9 @@ After reset, the timer is initialized to zero. extern int32_t _sys_idle_elapsed_ticks; #endif /* TIMER_SUPPORTS_TICKLESS */ -IRQ_CONNECT_STATIC(loapic, LOAPIC_TIMER_IRQ, LOAPIC_TIMER_INT_PRI, - _timer_int_handler, 0); +IRQ_CONNECT_STATIC(loapic, CONFIG_LOAPIC_TIMER_IRQ, + CONFIG_LOAPIC_TIMER_IRQ_PRIORITY, + _timer_int_handler, 0); static uint32_t __noinit counterLoadVal; /* computed counter 0 initial count value */ @@ -560,13 +559,13 @@ int _sys_clock_driver_init(struct device *device) * still * has to be programmed into the interrupt controller. */ - IRQ_CONFIG(loapic, LOAPIC_TIMER_IRQ); + IRQ_CONFIG(loapic, CONFIG_LOAPIC_TIMER_IRQ); _loApicTimerTicklessIdleSkew(); /* Everything has been configured. It is now safe to enable the * interrupt */ - irq_enable(LOAPIC_TIMER_IRQ); + irq_enable(CONFIG_LOAPIC_TIMER_IRQ); return 0; } @@ -624,7 +623,7 @@ void timer_disable(void) /* disable interrupt in the interrupt controller */ - irq_disable(LOAPIC_TIMER_IRQ); + irq_disable(CONFIG_LOAPIC_TIMER_IRQ); } #endif /* CONFIG_SYSTEM_TIMER_DISABLE */ diff --git a/samples/nanokernel/test/test_context/src/context.c b/samples/nanokernel/test/test_context/src/context.c index 59fda5234dd..2b7e6001e6a 100644 --- a/samples/nanokernel/test/test_context/src/context.c +++ b/samples/nanokernel/test/test_context/src/context.c @@ -74,7 +74,7 @@ This module tests the following CPU and context related routines: #if defined(CONFIG_HPET_TIMER) #define TICK_IRQ CONFIG_HPET_TIMER_IRQ #elif defined(CONFIG_LOAPIC_TIMER) - #define TICK_IRQ LOAPIC_TIMER_IRQ + #define TICK_IRQ CONFIG_LOAPIC_TIMER_IRQ #elif defined(CONFIG_PIT) #define TICK_IRQ PIT_INT_LVL #elif defined(CONFIG_CPU_CORTEX_M3_M4)