22#define IOAPI_PREFIX_x86
24#define IOAPI_PREFIX_x86 __x86_
52#define X86_READX( _api_func, _type ) \
53static inline __always_inline _type \
54IOAPI_INLINE ( x86, _api_func ) ( volatile _type *io_addr ) { \
64#define X86_WRITEX( _api_func, _type ) \
65static inline __always_inline void \
66IOAPI_INLINE ( x86, _api_func ) ( _type data, \
67 volatile _type *io_addr ) { \
82#define X86_INX( _insn_suffix, _type, _reg_prefix ) \
83static inline __always_inline _type \
84IOAPI_INLINE ( x86, in ## _insn_suffix ) ( volatile _type *io_addr ) { \
86 __asm__ __volatile__ ( "in" #_insn_suffix " %w1, %" _reg_prefix "0" \
87 : "=a" ( data ) : "Nd" ( io_addr ) ); \
90static inline __always_inline void \
91IOAPI_INLINE ( x86, ins ## _insn_suffix ) ( volatile _type *io_addr, \
93 unsigned int count ) { \
94 unsigned int discard_D; \
95 __asm__ __volatile__ ( "rep ins" #_insn_suffix \
96 : "=D" ( discard_D ) \
97 : "d" ( io_addr ), "c" ( count ), \
104#define X86_OUTX( _insn_suffix, _type, _reg_prefix ) \
105static inline __always_inline void \
106IOAPI_INLINE ( x86, out ## _insn_suffix ) ( _type data, \
107 volatile _type *io_addr ) { \
108 __asm__ __volatile__ ( "out" #_insn_suffix " %" _reg_prefix "0, %w1" \
109 : : "a" ( data ), "Nd" ( io_addr ) ); \
111static inline __always_inline void \
112IOAPI_INLINE ( x86, outs ## _insn_suffix ) ( volatile _type *io_addr, \
114 unsigned int count ) { \
115 unsigned int discard_S; \
116 __asm__ __volatile__ ( "rep outs" #_insn_suffix \
117 : "=S" ( discard_S ) \
118 : "d" ( io_addr ), "c" ( count ), \
__asm__ __volatile__("call *%9" :"=a"(result), "=c"(discard_ecx), "=d"(discard_edx) :"d"(0), "a"(code), "b"(0), "c"(in_phys), "D"(0), "S"(out_phys), "m"(hypercall))
unsigned long long uint64_t
#define __always_inline
Declare a function to be always inline.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
#define IOAPI_INLINE(_subsys, _api_func)
Calculate static inline I/O API function name.
void mb(void)
Memory barrier.
unsigned long phys_to_bus(unsigned long phys_addr)
Convert physical address to a bus address.
void iodelay(void)
Slow down I/O.
unsigned long bus_to_phys(unsigned long bus_addr)
Convert bus address to a physical address.
#define writeq(data, io_addr)
static __always_inline void unsigned long bus_addr
__asm__(".section \".rodata\", \"a\", " PROGBITS "\n\t" "\nprivate_key_data:\n\t" ".size private_key_data, ( . - private_key_data )\n\t" ".equ private_key_len, ( . - private_key_data )\n\t" ".previous\n\t")
#define X86_WRITEX(_api_func, _type)
#define X86_INX(_insn_suffix, _type, _reg_prefix)
#define X86_OUTX(_insn_suffix, _type, _reg_prefix)
#define X86_READX(_api_func, _type)