interrupts: new static IRQ API

The interrupt API has been redesigned:

- irq_connect() for dynamic interrupts renamed to irq_connect_dynamic().
  It will be used in situations where the new static irq_connect()
  won't work, i.e. the value of arguments can't be computed at build time
- a new API for static interrupts replaces irq_connect(). it is used
  exactly the same way as its dynamic counterpart. The old static irq
  macros will be removed
- Separate stub assembly files are no longer needed as the stubs are now
  generated inline with irq_connect()

ReST documentation updated for the changed API. Some detail about the
IDT in ROM added, and an oblique reference to the internal-only
_irq_handler_set() API removed; we don't talk about internal APIs in
the official documentation.

Change-Id: I280519993da0e0fe671eb537a876f67de33d3cd4
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2016-01-08 00:46:14 -08:00 committed by Anas Nashif
commit d9cfbd5a61
70 changed files with 347 additions and 923 deletions

View file

@ -1,5 +1,4 @@
ccflags-$(CONFIG_RTC_QMSI) += -I$(CONFIG_QMSI_INSTALL_PATH)/include
obj-$(CONFIG_RTC) += rtc_static_irq_stubs.o
obj-$(CONFIG_RTC_DW) += rtc_dw.o
obj-$(CONFIG_RTC_QMSI) += rtc_qmsi.o

View file

@ -189,23 +189,7 @@ static struct rtc_driver_api funcs = {
.set_alarm = rtc_dw_set_alarm,
};
/* IRQ_CONFIG needs the flags variable declared by IRQ_CONNECT_STATIC */
IRQ_CONNECT_STATIC(rtc, CONFIG_RTC_IRQ,
CONFIG_RTC_IRQ_PRI, rtc_dw_isr, 0, 0);
int rtc_dw_init(struct device *dev)
{
IRQ_CONFIG(rtc, CONFIG_RTC_IRQ);
irq_enable(CONFIG_RTC_IRQ);
_rtc_dw_int_unmask();
_rtc_dw_clock_config(dev);
dev->driver_api = &funcs;
return DEV_OK;
}
int rtc_dw_init(struct device *dev);
struct rtc_dw_runtime rtc_runtime;
@ -222,4 +206,18 @@ DECLARE_DEVICE_INIT_CONFIG(rtc, CONFIG_RTC_DRV_NAME,
SYS_DEFINE_DEVICE(rtc, &rtc_runtime, SECONDARY,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
struct device *rtc_dw_isr_dev = SYS_GET_DEVICE(rtc);
int rtc_dw_init(struct device *dev)
{
irq_connect(CONFIG_RTC_IRQ, CONFIG_RTC_IRQ_PRI, rtc_dw_isr,
SYS_GET_DEVICE(rtc), 0);
irq_enable(CONFIG_RTC_IRQ);
_rtc_dw_int_unmask();
_rtc_dw_clock_config(dev);
dev->driver_api = &funcs;
return DEV_OK;
}

View file

@ -22,9 +22,6 @@
#include "qm_rtc.h"
IRQ_CONNECT_STATIC(rtc, CONFIG_RTC_IRQ, CONFIG_RTC_IRQ_PRI, qm_rtc_isr_0,
0, IOAPIC_EDGE | IOAPIC_HIGH);
static struct device *rtc_qmsi_dev;
static void (*user_callback)(struct device *dev);
@ -82,7 +79,8 @@ static struct rtc_driver_api api = {
static int rtc_qmsi_init(struct device *dev)
{
IRQ_CONFIG(rtc, CONFIG_RTC_IRQ);
irq_connect(CONFIG_RTC_IRQ, CONFIG_RTC_IRQ_PRI, qm_rtc_isr_0, 0,
IOAPIC_EDGE | IOAPIC_HIGH);
/* Unmask RTC interrupt */
irq_enable(CONFIG_RTC_IRQ);

View file

@ -1,38 +0,0 @@
/*
* Copyright (c) 2015, Intel Corportation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define _ASMLANGUAGE
#include <arch/x86/asm.h>
#include <drivers/ioapic.h>
#if defined(CONFIG_RTC_DW)
#if defined(CONFIG_IOAPIC) || defined(CONFIG_MVIC)
ioapic_mkstub rtc rtc_dw_isr rtc_dw_isr_dev
#endif
#endif
#if defined(CONFIG_RTC_QMSI)
#if defined(CONFIG_IOAPIC) || defined(CONFIG_MVIC)
ioapic_mkstub rtc qm_rtc_isr_0 0
#endif
#endif /* CONFIG_RTC_QMSI */
/* externs (internal APIs) */
GTEXT(_IntEnt)
GTEXT(_IntExit)