mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-09-04 09:11:57 +00:00
Update reserved function names starting with one underscore, replacing them as follows: '_k_' with 'z_' '_K_' with 'Z_' '_handler_' with 'z_handl_' '_Cstart' with 'z_cstart' '_Swap' with 'z_swap' This renaming is done on both global and those static function names in kernel/include and include/. Other static function names in kernel/ are renamed by removing the leading underscore. Other function names not starting with any prefix listed above are renamed starting with a 'z_' or 'Z_' prefix. Function names starting with two or three leading underscores are not automatcally renamed since these names will collide with the variants with two or three leading underscores. Various generator scripts have also been updated as well as perf, linker and usb files. These are drivers/serial/uart_handlers.c include/linker/kobject-text.ld kernel/include/syscall_handler.h scripts/gen_kobject_list.py scripts/gen_syscall_header.py Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
104 lines
2.6 KiB
C
104 lines
2.6 KiB
C
/*
|
|
* Copyright (c) 2013-2015, Wind River Systems, Inc.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/**
|
|
* @file
|
|
* @brief system module for variants with LOAPIC
|
|
*
|
|
*/
|
|
|
|
#include <misc/__assert.h>
|
|
#include <kernel.h>
|
|
#include <arch/cpu.h>
|
|
#include <drivers/ioapic.h>
|
|
#include <drivers/loapic.h>
|
|
#include <drivers/sysapic.h>
|
|
#include <irq.h>
|
|
|
|
#define IS_IOAPIC_IRQ(irq) (irq < LOAPIC_IRQ_BASE)
|
|
#define HARDWARE_IRQ_LIMIT ((LOAPIC_IRQ_BASE + LOAPIC_IRQ_COUNT) - 1)
|
|
|
|
/**
|
|
*
|
|
* @brief Program interrupt controller
|
|
*
|
|
* This routine programs the interrupt controller with the given vector
|
|
* based on the given IRQ parameter.
|
|
*
|
|
* Drivers call this routine instead of IRQ_CONNECT() when interrupts are
|
|
* configured statically.
|
|
*
|
|
* The Galileo board virtualizes IRQs as follows:
|
|
*
|
|
* - The first CONFIG_IOAPIC_NUM_RTES IRQs are provided by the IOAPIC so the
|
|
* IOAPIC is programmed for these IRQs
|
|
* - The remaining IRQs are provided by the LOAPIC and hence the LOAPIC is
|
|
* programmed.
|
|
*
|
|
* @param vector the vector number
|
|
* @param irq the virtualized IRQ
|
|
* @param flags interrupt flags
|
|
*
|
|
*/
|
|
void __irq_controller_irq_config(unsigned int vector, unsigned int irq,
|
|
u32_t flags)
|
|
{
|
|
__ASSERT(irq <= HARDWARE_IRQ_LIMIT, "invalid irq line");
|
|
|
|
if (IS_IOAPIC_IRQ(irq)) {
|
|
z_ioapic_irq_set(irq, vector, flags);
|
|
} else {
|
|
z_loapic_int_vec_set(irq - LOAPIC_IRQ_BASE, vector);
|
|
}
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @brief Enable an individual interrupt (IRQ)
|
|
*
|
|
* The public interface for enabling/disabling a specific IRQ for the IA-32
|
|
* architecture is defined as follows in include/arch/x86/arch.h
|
|
*
|
|
* extern void irq_enable (unsigned int irq);
|
|
* extern void irq_disable (unsigned int irq);
|
|
*
|
|
* The irq_enable() routine is provided by the interrupt controller driver due
|
|
* to the IRQ virtualization that is performed by this platform. See the
|
|
* comments in _interrupt_vector_allocate() for more information regarding IRQ
|
|
* virtualization.
|
|
*
|
|
* @return N/A
|
|
*/
|
|
void z_arch_irq_enable(unsigned int irq)
|
|
{
|
|
if (IS_IOAPIC_IRQ(irq)) {
|
|
z_ioapic_irq_enable(irq);
|
|
} else {
|
|
z_loapic_irq_enable(irq - LOAPIC_IRQ_BASE);
|
|
}
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @brief Disable an individual interrupt (IRQ)
|
|
*
|
|
* The irq_disable() routine is provided by the interrupt controller driver due
|
|
* to the IRQ virtualization that is performed by this platform. See the
|
|
* comments in _interrupt_vector_allocate() for more information regarding IRQ
|
|
* virtualization.
|
|
*
|
|
* @return N/A
|
|
*/
|
|
void z_arch_irq_disable(unsigned int irq)
|
|
{
|
|
if (IS_IOAPIC_IRQ(irq)) {
|
|
z_ioapic_irq_disable(irq);
|
|
} else {
|
|
z_loapic_irq_disable(irq - LOAPIC_IRQ_BASE);
|
|
}
|
|
}
|
|
|