27#ifndef _RTEMS_SCORE_CPU_ASM_H
28#define _RTEMS_SCORE_CPU_ASM_H
34static inline uint8_t inport_byte(uint16_t port)
37 __asm__
volatile (
"inb %1, %0"
43static inline void outport_byte(uint16_t port, uint8_t val)
45 __asm__
volatile (
"outb %0, %1" : :
"a" (val),
"Nd" (port) );
48static inline uint16_t amd64_get_cs(
void)
52 __asm__
volatile (
"movw %%cs, %0" :
"=r" (segment) :
"0" (segment) );
57static inline void amd64_set_cr3(uint64_t segment)
59 __asm__
volatile (
"movq %0, %%cr3" :
"=r" (segment) :
"0" (segment) );
62static inline void cpuid(
63 uint32_t
code, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx
65 __asm__
volatile (
"cpuid"
66 :
"=a" (*eax),
"=b" (*ebx),
"=c" (*ecx),
"=d" (*edx)
70static inline uint64_t rdmsr(uint32_t msr)
73 __asm__
volatile (
"rdmsr" :
74 "=a" (low),
"=d" (high) :
76 return low | (uint64_t) high << 32;
79static inline void wrmsr(uint32_t msr, uint32_t low, uint32_t high)
81 __asm__
volatile (
"wrmsr" : :
82 "a" (low),
"d" (high),
"c" (msr) );
85static inline void amd64_enable_interrupts(
void)
87 __asm__
volatile (
"sti" );
90static inline void amd64_disable_interrupts(
void)
92 __asm__
volatile (
"cli" );
95static inline void stub_io_wait(
void)
This header file provides basic definitions used by the API and the implementation.
Definition: inftrees.h:24