6#ifndef ZEPHYR_INCLUDE_ARCH_X86_ARCH_H_
7#define ZEPHYR_INCLUDE_ARCH_X86_ARCH_H_
14#define Z_X86_OOPS_VECTOR 32
16#if !defined(_ASMLANGUAGE)
33struct x86_msi_vector {
36#ifdef CONFIG_INTEL_VTD_ICTL
42typedef struct x86_msi_vector arch_msi_vector_t;
48 if ((
key & 0x00000200U) != 0U) {
49 __asm__
volatile (
"sti" :::
"memory");
55 __asm__
volatile(
"outb %b0, %w1" ::
"a"(
data),
"Nd"(port));
62 __asm__
volatile(
"inb %w1, %b0" :
"=a"(
ret) :
"Nd"(port));
69 __asm__
volatile(
"outw %w0, %w1" ::
"a"(
data),
"Nd"(port));
76 __asm__
volatile(
"inw %w1, %w0" :
"=a"(
ret) :
"Nd"(port));
83 __asm__
volatile(
"outl %0, %w1" ::
"a"(
data),
"Nd"(port));
90 __asm__
volatile(
"inl %w1, %0" :
"=a"(
ret) :
"Nd"(port));
97 __asm__
volatile(
"movb %0, %1"
107 __asm__
volatile(
"movb %1, %0"
117 __asm__
volatile(
"movw %0, %1"
127 __asm__
volatile(
"movw %1, %0"
137 __asm__
volatile(
"movl %0, %1"
147 __asm__
volatile(
"movl %1, %0"
157 __asm__
volatile(
"btsl %1, %0"
158 :
"+m" (*(
volatile uint8_t *) (addr))
165 __asm__
volatile(
"btrl %1, %0"
166 :
"+m" (*(
volatile uint8_t *) (addr))
174 __asm__
volatile(
"btl %2, %1;"
176 :
"=r" (
ret),
"+m" (*(
volatile uint8_t *) (addr))
187 __asm__
volatile(
"btsl %2, %1;"
189 :
"=r" (
ret),
"+m" (*(
volatile uint8_t *) (addr))
200 __asm__
volatile(
"btrl %2, %1;"
202 :
"=r" (
ret),
"+m" (*(
volatile uint8_t *) (addr))
208#define sys_bitfield_set_bit sys_set_bit
209#define sys_bitfield_clear_bit sys_clear_bit
210#define sys_bitfield_test_bit sys_test_bit
211#define sys_bitfield_test_and_set_bit sys_test_and_set_bit
212#define sys_bitfield_test_and_clear_bit sys_test_and_clear_bit
219extern unsigned char _irq_to_interrupt_vector[];
221#define Z_IRQ_TO_INTERRUPT_VECTOR(irq) \
222 ((unsigned int) _irq_to_interrupt_vector[irq])
260 return (
key & 0x200) != 0;
271 __asm__
volatile(
"rdtsc" :
"=a" (
rv) : :
"%edx");
281static inline uint64_t z_tsc_read(
void)
299 __asm__
volatile (
"lfence");
307 :
"%eax",
"%ebx",
"%ecx",
"%edx"
316 __asm__
volatile (
"rdtsc" :
"=a" (
rv.lo),
"=d" (
rv.hi));
319 __asm__
volatile (
"rdtsc" :
"=A" (
rv.value));
327 __asm__
volatile(
"nop");
irp hi
Definition: asm-macro-32-bit-gnu.h:10
#define ALWAYS_INLINE
Definition: common.h:116
volatile int rv
Definition: main.c:45
static ZTEST_BMEM volatile int ret
Definition: k_float_disable.c:28
void arch_irq_disable(unsigned int irq)
uint32_t sys_clock_cycle_get_32(void)
void arch_irq_enable(unsigned int irq)
Definitions of various linker Sections.
static k_spinlock_key_t key
Definition: spinlock_error_case.c:14
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__UINT64_TYPE__ uint64_t
Definition: stdint.h:61
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58
__UINTPTR_TYPE__ uintptr_t
Definition: stdint.h:75
__UINT16_TYPE__ uint16_t
Definition: stdint.h:59
uint32_t io_port_t
Definition: sys_io.h:19
uintptr_t mm_reg_t
Definition: sys_io.h:20
uintptr_t mem_addr_t
Definition: sys_io.h:21
static fdata_t data[2]
Definition: test_fifo_contexts.c:15
static ALWAYS_INLINE int sys_test_and_set_bit(mem_addr_t addr, unsigned int bit)
Definition: arch.h:182
static ALWAYS_INLINE void sys_set_bit(mem_addr_t addr, unsigned int bit)
Definition: arch.h:155
static ALWAYS_INLINE void arch_nop(void)
Definition: arch.h:325
static ALWAYS_INLINE void arch_irq_unlock(unsigned int key)
Definition: arch.h:46
static ALWAYS_INLINE uint8_t sys_in8(io_port_t port)
Definition: arch.h:58
static ALWAYS_INLINE void sys_write8(uint8_t data, mm_reg_t addr)
Definition: arch.h:95
static ALWAYS_INLINE void sys_clear_bit(mem_addr_t addr, unsigned int bit)
Definition: arch.h:163
static ALWAYS_INLINE int sys_test_bit(mem_addr_t addr, unsigned int bit)
Definition: arch.h:170
static ALWAYS_INLINE void sys_out8(uint8_t data, io_port_t port)
Definition: arch.h:53
static ALWAYS_INLINE uint32_t sys_read32(mm_reg_t addr)
Definition: arch.h:143
static ALWAYS_INLINE void sys_out16(uint16_t data, io_port_t port)
Definition: arch.h:67
static ALWAYS_INLINE uint16_t sys_read16(mm_reg_t addr)
Definition: arch.h:123
static ALWAYS_INLINE uint16_t sys_in16(io_port_t port)
Definition: arch.h:72
static ALWAYS_INLINE void sys_write16(uint16_t data, mm_reg_t addr)
Definition: arch.h:115
static ALWAYS_INLINE int sys_test_and_clear_bit(mem_addr_t addr, unsigned int bit)
Definition: arch.h:195
static __pinned_func uint32_t arch_k_cycle_get_32(void)
Definition: arch.h:253
static ALWAYS_INLINE bool arch_irq_unlocked(unsigned int key)
Definition: arch.h:258
static ALWAYS_INLINE uint8_t sys_read8(mm_reg_t addr)
Definition: arch.h:103
static ALWAYS_INLINE void sys_out32(uint32_t data, io_port_t port)
Definition: arch.h:81
static ALWAYS_INLINE void sys_write32(uint32_t data, mm_reg_t addr)
Definition: arch.h:135
static ALWAYS_INLINE uint32_t sys_in32(io_port_t port)
Definition: arch.h:86
IA-32 specific kernel interface header This header contains the IA-32 specific kernel interface....