mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-09-07 17:11:56 +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>
114 lines
3.0 KiB
C
114 lines
3.0 KiB
C
/*
|
|
* Copyright (c) 2016 Wind River Systems, Inc.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/**
|
|
* @file
|
|
* @brief Abstraction layer for x86 interrupt controllers
|
|
*
|
|
* Most x86 just support APIC. However we are starting to see design
|
|
* variants such as MVIC or APICs with reduced feature sets. This
|
|
* interface provides a layer of abstraction between the core arch code
|
|
* and the interrupt controller implementation for x86
|
|
*/
|
|
|
|
#ifndef ZEPHYR_INCLUDE_ARCH_X86_IRQ_CONTROLLER_H_
|
|
#define ZEPHYR_INCLUDE_ARCH_X86_IRQ_CONTROLLER_H_
|
|
|
|
#ifdef CONFIG_MVIC
|
|
#include <drivers/mvic.h>
|
|
#else
|
|
#include <drivers/sysapic.h>
|
|
#endif
|
|
|
|
/* Triggering flags abstraction layer.
|
|
* If a particular set of triggers is not supported, leave undefined
|
|
*/
|
|
#define IRQ_TRIGGER_EDGE _IRQ_TRIGGER_EDGE
|
|
#define IRQ_TRIGGER_LEVEL _IRQ_TRIGGER_LEVEL
|
|
|
|
#define IRQ_POLARITY_HIGH _IRQ_POLARITY_HIGH
|
|
#define IRQ_POLARITY_LOW _IRQ_POLARITY_LOW
|
|
|
|
#ifndef _ASMLANGUAGE
|
|
#include <zephyr/types.h>
|
|
|
|
#if CONFIG_X86_FIXED_IRQ_MAPPING
|
|
/**
|
|
* @brief Return fixed mapping for an IRQ
|
|
*
|
|
* @param irq Interrupt line
|
|
* @return Vector this interrupt has been assigned to
|
|
*/
|
|
#define Z_IRQ_CONTROLLER_VECTOR_MAPPING(irq) \
|
|
__IRQ_CONTROLLER_VECTOR_MAPPING(irq)
|
|
#endif
|
|
|
|
/**
|
|
*
|
|
* @brief Program an interrupt
|
|
*
|
|
* This function sets the triggering options for an IRQ and also associates
|
|
* the IRQ with its vector in the IDT. This does not enable the interrupt
|
|
* line, it will be left masked.
|
|
*
|
|
* The flags parameter is limited to the IRQ_TRIGGER_* defines above. In
|
|
* addition, not all interrupt controllers support all flags.
|
|
*
|
|
* @param irq Virtualized IRQ
|
|
* @param vector Vector Number
|
|
* @param flags Interrupt flags
|
|
*
|
|
* @returns: N/A
|
|
*/
|
|
static inline void z_irq_controller_irq_config(unsigned int vector,
|
|
unsigned int irq, u32_t flags)
|
|
{
|
|
__irq_controller_irq_config(vector, irq, flags);
|
|
}
|
|
|
|
/**
|
|
* @brief Return the vector of the currently in-service ISR
|
|
*
|
|
* This function should be called in interrupt context.
|
|
* It is not expected for this function to reveal the identity of
|
|
* vectors triggered by a CPU exception or 'int' instruction.
|
|
*
|
|
* @return the vector of the interrupt that is currently being processed, or
|
|
* -1 if this can't be determined
|
|
*/
|
|
static inline int _irq_controller_isr_vector_get(void)
|
|
{
|
|
return __irq_controller_isr_vector_get();
|
|
}
|
|
|
|
|
|
static inline void _irq_controller_eoi(void)
|
|
{
|
|
__irq_controller_eoi();
|
|
}
|
|
|
|
#else /* _ASMLANGUAGE */
|
|
|
|
/**
|
|
* @brief Send EOI to the interrupt controller
|
|
*
|
|
* This macro is used by the core interrupt handling code. Interrupts
|
|
* will be locked when this gets called and will not be unlocked until
|
|
* 'iret' has been issued.
|
|
*
|
|
* This macro is used in exactly one spot in intStub.S, in _IntExitWithEoi.
|
|
* At the time this is called, implementations are free to use the caller-
|
|
* saved registers eax, edx, ecx for their own purposes with impunity but
|
|
* need to preserve all callee-saved registers.
|
|
*/
|
|
.macro _irq_controller_eoi_macro
|
|
__irq_controller_eoi_macro
|
|
.endm
|
|
|
|
#endif /* _ASMLANGUAGE */
|
|
|
|
#endif /* ZEPHYR_INCLUDE_ARCH_X86_IRQ_CONTROLLER_H_ */
|