14#ifndef ZEPHYR_INCLUDE_ARCH_X86_INTEL64_ARCH_H_
15#define ZEPHYR_INCLUDE_ARCH_X86_INTEL64_ARCH_H_
22#if defined(CONFIG_PCIE) && !defined(_ASMLANGUAGE)
26#if CONFIG_ISR_STACK_SIZE != (CONFIG_ISR_SUBSTACK_SIZE * CONFIG_ISR_DEPTH)
27#error "Check ISR stack configuration (CONFIG_ISR_*)"
30#if CONFIG_ISR_SUBSTACK_SIZE % ARCH_STACK_PTR_ALIGN
31#error "CONFIG_ISR_SUBSTACK_SIZE must be a multiple of 16"
38 __asm__
volatile(
"movq %0, %1"
40 :
"r"(data),
"m" (*(
volatile uint64_t *)
49 __asm__
volatile(
"movq %1, %0"
61 __asm__
volatile (
"pushfq; cli; popq %0" :
"=g" (key) : :
"memory");
63 return (
unsigned int) key;
71 __asm__
volatile (
"pushfq; popq %0" :
"=g" (
flags) : :
"memory");
72 return (
flags & 0x200UL) != 0;
75#define ARCH_EXCEPT(reason_p) do { \
77 "movq %[reason], %%rax\n\t" \
80 : [reason] "i" (reason_p) \
86#define X86_RESERVE_IRQ(irq_p, name) \
87 static TYPE_SECTION_ITERABLE(uint8_t, name, irq_alloc, name) = irq_p
89#define X86_RESERVE_IRQ(irq_p, name)
98#define ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p) \
99 X86_RESERVE_IRQ(irq_p, _CONCAT(_irq_alloc_fixed, __COUNTER__)); \
100 arch_irq_connect_dynamic(irq_p, priority_p, \
101 (void (*)(const void *))isr_p, \
102 isr_param_p, flags_p)
106#define ARCH_PCIE_IRQ_CONNECT(bdf_p, irq_p, priority_p, \
107 isr_p, isr_param_p, flags_p) \
108 X86_RESERVE_IRQ(irq_p, _CONCAT(_irq_alloc_fixed, __COUNTER__)); \
109 pcie_connect_dynamic_irq(bdf_p, irq_p, priority_p, \
110 (void (*)(const void *))isr_p, \
111 isr_param_p, flags_p)
118#define ARCH_DYNAMIC_OBJ_K_THREAD_ALIGNMENT 16
flags
Definition parser.h:97
static ALWAYS_INLINE unsigned int arch_irq_lock(void)
Definition arch.h:66
static ALWAYS_INLINE bool arch_cpu_irqs_are_enabled(void)
Implementation of arch_cpu_irqs_are_enabled.
Definition arch.h:78
__UINT64_TYPE__ uint64_t
Definition stdint.h:91
__UINTPTR_TYPE__ uintptr_t
Definition stdint.h:105
uintptr_t mm_reg_t
Definition sys_io.h:20
static ALWAYS_INLINE uint64_t sys_read64(mm_reg_t addr)
Definition arch.h:45
static ALWAYS_INLINE void sys_write64(uint64_t data, mm_reg_t addr)
Definition arch.h:36