26 asm volatile(
"pause");
36 asm volatile(
".byte 0xf1");
44 :
"=a" (lo),
"=d" (hi));
54 :
"=a" (lo),
"=d" (hi),
"=c" (proc));
64 asm volatile(
"lidt (%0)"
72 asm volatile(
"lgdt (%0)"
91 :
"=a" (a),
"=b" (b),
"=c" (c),
"=d" (d)
111 :
"a" (eax),
"c" (
addr),
"d" (edx));
119 :
"=a" (eax),
"=d" (edx)
122 return edx << 32 | eax;
133 asm volatile(
"movq %%cr0, %0"
141 asm volatile(
"movq %0, %%cr0"
150 asm volatile(
"movq %%cr2, %0"
160 asm volatile(
"movq %%cr3, %0"
168 asm volatile(
"movq %0, %%cr3"
177 asm volatile(
"movq %%cr4, %0"
185 asm volatile(
"movq %0, %%cr4"
198 asm volatile(
"movq %%dr0, %0"
206 asm volatile(
"movq %0, %%dr0"
215 asm volatile(
"movq %%dr1, %0"
223 asm volatile(
"movq %0, %%dr1"
232 asm volatile(
"movq %%dr2, %0"
240 asm volatile(
"movq %0, %%dr2"
249 asm volatile(
"movq %%dr3, %0"
257 asm volatile(
"movq %0, %%dr3"
266 asm volatile(
"movq %%dr6, %0"
274 asm volatile(
"movq %0, %%dr6"
283 asm volatile(
"movq %%dr7, %0"
291 asm volatile(
"movq %0, %%dr7"
304 asm volatile(
"movw %%ds, %0"
312 asm volatile(
"movw %0, %%ds"
321 asm volatile(
"movw %%es, %0"
329 asm volatile(
"movw %0, %%es"
338 asm volatile(
"movw %%fs, %0"
346 asm volatile(
"movw %0, %%fs"
355 asm volatile(
"movw %%gs, %0"
363 asm volatile(
"movw %0, %%gs"
374 asm volatile(
"clts");
379 asm volatile(
"fxsave %0"
388 asm volatile(
"fxrstor %0"
399 asm volatile(
"xsave %0"
410 asm volatile(
"xsaveopt %0"
421 asm volatile(
"xrstor %0"
423 :
"m" (*xsa),
"a" (lo),
"d" (hi)
433 asm volatile(
"outb %0, %1"
435 :
"a" (data),
"d" (port));
440 asm volatile(
"outw %0, %1"
442 :
"a" (data),
"d" (port));
447 asm volatile(
"outl %0, %1"
449 :
"a" (data),
"d" (port));
456 asm volatile(
"inb %1, %0"
467 asm volatile(
"inw %1, %0"
478 asm volatile(
"inl %1, %0"
static INLINE uint64_t rdtscp(uint32_t *procno)
static INLINE uint64_t read_dr1()
static INLINE void write_dr0(uint64_t val)
static INLINE void xsaveopt(struct XSAVEArea *xsa, uint64_t mask)
static INLINE uint8_t inb(uint16_t port)
static INLINE void disable_interrupts()
static INLINE uint16_t read_es()
static INLINE void write_gs(uint16_t val)
static INLINE void ltr(uint16_t tss)
static INLINE uint16_t read_ds()
static INLINE void write_ds(uint16_t val)
static INLINE uint64_t read_cr2()
static INLINE void write_dr1(uint64_t val)
static INLINE uint16_t read_fs()
static INLINE uint64_t rdtsc()
static INLINE void outw(uint16_t port, uint16_t data)
static INLINE void write_cr3(uint64_t val)
static INLINE uint64_t read_cr3()
static INLINE uint64_t rdmsr(uint32_t addr)
static INLINE void lgdt(PseudoDescriptor *gdt)
static INLINE uint64_t read_dr3()
static INLINE void write_dr7(uint64_t val)
static INLINE void fxrstor(struct XSAVEArea *xsa)
static INLINE void outb(uint16_t port, uint8_t data)
static INLINE uint64_t read_dr7()
static INLINE void write_cr4(uint64_t val)
static INLINE void write_fs(uint16_t val)
static INLINE void wrmsr(uint32_t addr, uint64_t val)
static INLINE void clts()
static INLINE void write_dr2(uint64_t val)
static INLINE uint16_t inw(uint16_t port)
static INLINE uint64_t read_dr6()
static INLINE void write_dr6(uint64_t val)
static INLINE void pause()
static INLINE void outl(uint16_t port, uint32_t data)
static INLINE uint16_t read_gs()
static INLINE uint32_t inl(uint16_t port)
static INLINE void write_dr3(uint64_t val)
static INLINE void enable_interrupts()
static INLINE uint64_t read_cr4()
static INLINE void lidt(PseudoDescriptor *idt)
static INLINE uint64_t read_cr0()
static INLINE void icebp()
static INLINE void write_es(uint16_t val)
static INLINE void xsave(struct XSAVEArea *xsa, uint64_t mask)
static INLINE void breakpoint()
static INLINE uint64_t read_dr0()
static INLINE void xrstor(struct XSAVEArea *xsa, uint64_t mask)
static INLINE void cpuid(uint32_t info, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
static INLINE uint64_t read_dr2()
static INLINE void write_cr0(uint64_t val)
static INLINE void fxsave(struct XSAVEArea *xsa)
static InteruptGate64 idt[256]