Go to the source code of this file.
|
#define | __data16(variable) variable |
|
#define | __data16_array(variable, array) variable array |
|
#define | __bss16(variable) variable |
|
#define | __bss16_array(variable, array) variable array |
|
#define | __text16(variable) variable |
|
#define | __text16_array(variable, array) variable array |
|
#define | __use_data16(variable) variable |
|
#define | __use_text16(variable) variable |
|
#define | __from_data16(pointer) pointer |
|
#define | __from_text16(pointer) pointer |
|
#define | rm_cs ( _rm_cs() ) |
|
#define | rm_ds ( _rm_ds() ) |
|
#define | copy_to_real copy_to_real_libkir |
|
#define | copy_from_real copy_from_real_libkir |
|
#define | put_real_kir_const_off(var, seg, off) |
|
#define | put_real_kir_nonconst_off(var, seg, off) |
|
#define | put_real_kir(var, seg, off) |
|
#define | get_real_kir_const_off(var, seg, off) |
|
#define | get_real_kir_nonconst_off(var, seg, off) |
|
#define | get_real_kir(var, seg, off) |
|
#define | put_real put_real_kir |
|
#define | get_real get_real_kir |
|
#define | TEXT16_CODE(asm_code_str) |
|
#define | REAL_CODE(asm_code_str) |
|
◆ __data16
#define __data16 |
( |
|
variable | ) |
variable |
◆ __data16_array
#define __data16_array |
( |
|
variable, |
|
|
|
array |
|
) |
| variable array |
◆ __bss16
#define __bss16 |
( |
|
variable | ) |
variable |
◆ __bss16_array
#define __bss16_array |
( |
|
variable, |
|
|
|
array |
|
) |
| variable array |
◆ __text16
#define __text16 |
( |
|
variable | ) |
variable |
◆ __text16_array
#define __text16_array |
( |
|
variable, |
|
|
|
array |
|
) |
| variable array |
◆ __use_data16
#define __use_data16 |
( |
|
variable | ) |
variable |
◆ __use_text16
#define __use_text16 |
( |
|
variable | ) |
variable |
◆ __from_data16
#define __from_data16 |
( |
|
pointer | ) |
pointer |
◆ __from_text16
#define __from_text16 |
( |
|
pointer | ) |
pointer |
◆ rm_cs
#define rm_cs ( _rm_cs() ) |
◆ rm_ds
#define rm_ds ( _rm_ds() ) |
◆ copy_to_real
◆ copy_from_real
◆ put_real_kir_const_off
#define put_real_kir_const_off |
( |
|
var, |
|
|
|
seg, |
|
|
|
off |
|
) |
| |
Value: "mov %0, %%es:%c2\n\t" \
"pushw %%ds\n\t" \
"popw %%es\n\t" \
: \
:
"r,r" ( var ),
"rm,rm" (
seg ),
"i,!r" ( off ) \
)
__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")
struct golan_mkey_seg seg
Definition at line 98 of file libkir.h.
◆ put_real_kir_nonconst_off
#define put_real_kir_nonconst_off |
( |
|
var, |
|
|
|
seg, |
|
|
|
off |
|
) |
| |
Value: "mov %0, %%es:(%2)\n\t" \
"pushw %%ds\n\t" \
"popw %%es\n\t" \
: \
:
"r" ( var ),
"rm" (
seg ),
"r" ( off ) \
)
__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")
struct golan_mkey_seg seg
Definition at line 107 of file libkir.h.
◆ put_real_kir
#define put_real_kir |
( |
|
var, |
|
|
|
seg, |
|
|
|
off |
|
) |
| |
Value:do { \
if ( __builtin_constant_p ( off ) ) \
put_real_kir_const_off ( var,
seg, off );
\ } while ( 0 )
#define put_real_kir_nonconst_off(var, seg, off)
struct golan_mkey_seg seg
Definition at line 116 of file libkir.h.
◆ get_real_kir_const_off
#define get_real_kir_const_off |
( |
|
var, |
|
|
|
seg, |
|
|
|
off |
|
) |
| |
Value: "mov %%es:%c2, %0\n\t" \
"pushw %%ds\n\t" \
"popw %%es\n\t" \
: "=r,r" ( var ) \
:
"rm,rm" (
seg ),
"i,!r" ( off ) \
)
__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")
struct golan_mkey_seg seg
Definition at line 124 of file libkir.h.
◆ get_real_kir_nonconst_off
#define get_real_kir_nonconst_off |
( |
|
var, |
|
|
|
seg, |
|
|
|
off |
|
) |
| |
Value: "mov %%es:(%2), %0\n\t" \
"pushw %%ds\n\t" \
"popw %%es\n\t" \
: "=r" ( var ) \
:
"rm" (
seg ),
"r" ( off ) \
)
__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")
struct golan_mkey_seg seg
Definition at line 133 of file libkir.h.
◆ get_real_kir
#define get_real_kir |
( |
|
var, |
|
|
|
seg, |
|
|
|
off |
|
) |
| |
Value:do { \
if ( __builtin_constant_p ( off ) ) \
get_real_kir_const_off ( var,
seg, off );
\ } while ( 0 )
struct golan_mkey_seg seg
#define get_real_kir_nonconst_off(var, seg, off)
Definition at line 142 of file libkir.h.
◆ put_real
◆ get_real
◆ TEXT16_CODE
#define TEXT16_CODE |
( |
|
asm_code_str | ) |
|
Value:".section \".text16\", \"ax\", @progbits\n\t" \
".code16\n\t" \
".arch i386\n\t" \
asm_code_str "\n\t" \
".code16gcc\n\t" \
".previous\n\t"
Definition at line 217 of file libkir.h.
◆ REAL_CODE
#define REAL_CODE |
( |
|
asm_code_str | ) |
|
Value:".code16\n\t" \
asm_code_str "\n\t" \
".code16gcc\n\t"
Definition at line 226 of file libkir.h.
◆ userptr_t
A pointer to a user buffer.
This is actually a struct segoff, but encoded as a uint32_t to ensure that gcc passes it around efficiently.
Definition at line 159 of file libkir.h.
◆ __attribute__()
Copy data to user buffer.
Convert virtual address to user buffer.
Convert segment:offset address to user buffer.
Copy data from user buffer.
- Parameters
-
buffer | User buffer |
offset | Offset within user buffer |
src | Source |
len | Length |
dest | Destination |
buffer | User buffer |
offset | Offset within user buffer |
len | Length |
segment | Real-mode segment |
offset | Real-mode offset |
- Return values
-
- Parameters
-
- Return values
-
This constructs a user buffer from an ordinary pointer. Use it when you need to pass a pointer to an internal buffer to a function that expects a userptr_t
.
Definition at line 26 of file libkir.h.
__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))
__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")
References __asm__(), __volatile__(), and cs.
◆ copy_to_real_libkir()
static void copy_to_real_libkir |
( |
unsigned int |
dest_seg, |
|
|
unsigned int |
dest_off, |
|
|
const void * |
src, |
|
|
size_t |
n |
|
) |
| |
|
inlinestatic |
Definition at line 43 of file libkir.h.
54 :
"r" ( dest_seg ),
"D" (
dest_off ),
static off_t const void * src
__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))
static __always_inline void off_t dest_off
__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")
References __asm__(), __volatile__(), dest_off, discard_c, discard_D, discard_S, and src.
◆ copy_from_real_libkir()
static void copy_from_real_libkir |
( |
void * |
dest, |
|
|
unsigned int |
src_seg, |
|
|
unsigned int |
src_off, |
|
|
size_t |
n |
|
) |
| |
|
inlinestatic |
Definition at line 60 of file libkir.h.
73 "r" ( src_seg ),
"S" (
src_off ),
static __always_inline void off_t userptr_t off_t src_off
__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))
__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")
if(len >=6 *4) __asm__ __volatile__("movsl" if(len >=5 *4) __asm__ __volatile__("movsl" if(len >=4 *4) __asm__ __volatile__("movsl" if(len >=3 *4) __asm__ __volatile__("movsl" if(len >=2 *4) __asm__ __volatile__("movsl" if(len >=1 *4) __asm__ __volatile__("movsl" if((len % 4) >=2) __asm__ __volatile__("movsw" if((len % 2) >=1) __asm__ __volatile__("movsb" return dest
References __asm__(), __volatile__(), dest, discard_c, discard_D, discard_S, and src_off.
◆ offset
Initial value:{
uint16_t segment
Code segment.
Definition at line 170 of file libkir.h.
◆ src
◆ len
Initial value:{
static off_t const void * src
static off_t const void size_t len
Definition at line 170 of file libkir.h.
◆ buffer