6#ifndef ZEPHYR_INCLUDE_ARCH_X86_INTEL64_ARCH_H_
7#define ZEPHYR_INCLUDE_ARCH_X86_INTEL64_ARCH_H_
11#if defined(CONFIG_PCIE) && !defined(_ASMLANGUAGE)
15#if CONFIG_ISR_STACK_SIZE != (CONFIG_ISR_SUBSTACK_SIZE * CONFIG_ISR_DEPTH)
16#error "Check ISR stack configuration (CONFIG_ISR_*)"
19#if CONFIG_ISR_SUBSTACK_SIZE % ARCH_STACK_PTR_ALIGN
20#error "CONFIG_ISR_SUBSTACK_SIZE must be a multiple of 16"
27 __asm__
volatile(
"movq %0, %1"
29 :
"r"(data),
"m" (*(
volatile uint64_t *)
38 __asm__
volatile(
"movq %1, %0"
50 __asm__
volatile (
"pushfq; cli; popq %0" :
"=g" (key) : :
"memory");
52 return (
unsigned int) key;
60#ifdef CONFIG_EXCEPTION_DEBUG
95typedef struct x86_esf z_arch_esf_t;
110#define ARCH_EXCEPT(reason_p) do { \
112 "movq %[reason], %%rax\n\t" \
115 : [reason] "i" (reason_p)); \
120#define X86_RESERVE_IRQ(irq_p, name) \
121 static TYPE_SECTION_ITERABLE(uint8_t, name, irq_alloc, name) = irq_p
123#define X86_RESERVE_IRQ(irq_p, name)
132#define ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p) \
133 X86_RESERVE_IRQ(irq_p, _CONCAT(_irq_alloc_fixed, __COUNTER__)); \
134 arch_irq_connect_dynamic(irq_p, priority_p, \
135 (void (*)(const void *))isr_p, \
136 isr_param_p, flags_p)
140#define ARCH_PCIE_IRQ_CONNECT(bdf_p, irq_p, priority_p, \
141 isr_p, isr_param_p, flags_p) \
142 X86_RESERVE_IRQ(irq_p, _CONCAT(_irq_alloc_fixed, __COUNTER__)); \
143 pcie_connect_dynamic_irq(bdf_p, irq_p, priority_p, \
144 (void (*)(const void *))isr_p, \
145 isr_param_p, flags_p)
152#define ARCH_DYNAMIC_OBJ_K_THREAD_ALIGNMENT 16
#define X86_FXSAVE_SIZE
Definition: thread.h:37
#define ALWAYS_INLINE
Definition: common.h:129
static ALWAYS_INLINE unsigned int arch_irq_lock(void)
Definition: arch.h:63
__UINT64_TYPE__ uint64_t
Definition: stdint.h:91
__UINTPTR_TYPE__ uintptr_t
Definition: stdint.h:105
unsigned long rsp
Definition: arch.h:91
unsigned long r11
Definition: arch.h:83
unsigned long vector
Definition: arch.h:86
unsigned long cs
Definition: arch.h:89
unsigned long rip
Definition: arch.h:88
unsigned long ss
Definition: arch.h:92
unsigned long r8
Definition: arch.h:76
unsigned long rbp
Definition: arch.h:68
unsigned long r10
Definition: arch.h:78
unsigned long rcx
Definition: arch.h:72
unsigned long code
Definition: arch.h:87
unsigned long r9
Definition: arch.h:77
unsigned long rdx
Definition: arch.h:73
unsigned long rsi
Definition: arch.h:74
unsigned long rdi
Definition: arch.h:75
unsigned long rax
Definition: arch.h:71
char fxsave[X86_FXSAVE_SIZE]
Definition: arch.h:82
unsigned long rflags
Definition: arch.h:90
unsigned long rsp
Definition: arch.h:107
unsigned long r8
Definition: arch.h:102
unsigned long r9
Definition: arch.h:101
unsigned long r10
Definition: arch.h:100
unsigned long rdx
Definition: arch.h:103
unsigned long rflags
Definition: arch.h:99
char fxsave[X86_FXSAVE_SIZE]
Definition: arch.h:105
unsigned long rdi
Definition: arch.h:106
unsigned long rip
Definition: arch.h:98
unsigned long rsi
Definition: arch.h:104
uintptr_t mm_reg_t
Definition: sys_io.h:20
static ALWAYS_INLINE uint64_t sys_read64(mm_reg_t addr)
Definition: arch.h:34
static ALWAYS_INLINE void sys_write64(uint64_t data, mm_reg_t addr)
Definition: arch.h:25