1 /*
2  * Copyright (c) 2016 Intel Corporation
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef ZEPHYR_INCLUDE_DRIVERS_SYSAPIC_H_
8 #define ZEPHYR_INCLUDE_DRIVERS_SYSAPIC_H_
9 
10 #include <zephyr/drivers/interrupt_controller/loapic.h>
11 
12 #define IRQ_TRIGGER_EDGE	IOAPIC_EDGE
13 #define IRQ_TRIGGER_LEVEL	IOAPIC_LEVEL
14 
15 #define IRQ_POLARITY_HIGH	IOAPIC_HIGH
16 #define IRQ_POLARITY_LOW	IOAPIC_LOW
17 
18 #ifndef _ASMLANGUAGE
19 #include <zephyr/types.h>
20 
21 #define LOAPIC_IRQ_COUNT 6  /* Default to LOAPIC_TIMER to LOAPIC_ERROR */
22 
23 void z_irq_controller_irq_config(unsigned int vector, unsigned int irq,
24 				 uint32_t flags);
25 
26 int z_irq_controller_isr_vector_get(void);
27 
z_irq_controller_eoi(void)28 static inline void z_irq_controller_eoi(void)
29 {
30 	x86_write_loapic(LOAPIC_EOI, 0);
31 }
32 
33 #endif /* _ASMLANGUAGE */
34 
35 #endif /* ZEPHYR_INCLUDE_DRIVERS_SYSAPIC_H_ */
36