21 #define IOAPI_PREFIX_x86 23 #define IOAPI_PREFIX_x86 __x86_ 54 #define X86_READX( _api_func, _type ) \ 55 static inline __always_inline _type \ 56 IOAPI_INLINE ( x86, _api_func ) ( volatile _type *io_addr ) { \ 66 #define X86_WRITEX( _api_func, _type ) \ 67 static inline __always_inline void \ 68 IOAPI_INLINE ( x86, _api_func ) ( _type data, \ 69 volatile _type *io_addr ) { \ 84 #define X86_INX( _insn_suffix, _type, _reg_prefix ) \ 85 static inline __always_inline _type \ 86 IOAPI_INLINE ( x86, in ## _insn_suffix ) ( volatile _type *io_addr ) { \ 88 __asm__ __volatile__ ( "in" #_insn_suffix " %w1, %" _reg_prefix "0" \ 89 : "=a" ( data ) : "Nd" ( io_addr ) ); \ 92 static inline __always_inline void \ 93 IOAPI_INLINE ( x86, ins ## _insn_suffix ) ( volatile _type *io_addr, \ 95 unsigned int count ) { \ 96 unsigned int discard_D; \ 97 __asm__ __volatile__ ( "rep ins" #_insn_suffix \ 98 : "=D" ( discard_D ) \ 99 : "d" ( io_addr ), "c" ( count ), \ 106 #define X86_OUTX( _insn_suffix, _type, _reg_prefix ) \ 107 static inline __always_inline void \ 108 IOAPI_INLINE ( x86, out ## _insn_suffix ) ( _type data, \ 109 volatile _type *io_addr ) { \ 110 __asm__ __volatile__ ( "out" #_insn_suffix " %" _reg_prefix "0, %w1" \ 111 : : "a" ( data ), "Nd" ( io_addr ) ); \ 113 static inline __always_inline void \ 114 IOAPI_INLINE ( x86, outs ## _insn_suffix ) ( volatile _type *io_addr, \ 116 unsigned int count ) { \ 117 unsigned int discard_S; \ 118 __asm__ __volatile__ ( "rep outs" #_insn_suffix \ 119 : "=S" ( discard_S ) \ 120 : "d" ( io_addr ), "c" ( count ), \
uint8_t readb(volatile uint8_t *io_addr)
Read byte from memory-mapped device.
#define X86_READX(_api_func, _type)
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
uint16_t readw(volatile uint16_t *io_addr)
Read 16-bit word from memory-mapped device.
uint32_t readl(volatile uint32_t *io_addr)
Read 32-bit dword from memory-mapped device.
unsigned long long uint64_t
void writeb(uint8_t data, volatile uint8_t *io_addr)
Write byte to memory-mapped device.
static __always_inline void unsigned long bus_addr
#define X86_WRITEX(_api_func, _type)
void writel(uint32_t data, volatile uint32_t *io_addr)
Write 32-bit dword to memory-mapped device.
#define X86_INX(_insn_suffix, _type, _reg_prefix)
static __always_inline unsigned long IOAPI_INLINE(x86, phys_to_bus)(unsigned long phys_addr)
#define __always_inline
Declare a function to be always inline.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
unsigned long phys_to_bus(unsigned long phys_addr)
Convert physical address to a bus address.
__asm__ __volatile__("\n1:\n\t" "movb -1(%2,%1), %%al\n\t" "stosb\n\t" "loop 1b\n\t" "xorl %%eax, %%eax\n\t" "mov %3, %1\n\t" "rep stosb\n\t" :"=&D"(discard_D), "=&c"(discard_c) :"r"(data), "g"(pad_len), "0"(value0), "1"(len) :"eax")
__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_OUTX(_insn_suffix, _type, _reg_prefix)
void mb(void)
Memory barrier.
void iodelay(void)
Slow down I/O.
unsigned long bus_to_phys(unsigned long bus_addr)
Convert bus address to a physical address.
void writeq(uint64_t data, volatile uint64_t *io_addr)
Write 64-bit qword to memory-mapped device.