34 #define com32_regs __use_data16 ( com32_regs ) 37 #define com32_int_vector __use_data16 ( com32_int_vector ) 40 #define com32_farcall_proc __use_data16 ( com32_farcall_proc ) 65 "movl (com32_regs + 40), %%eax\n\t" 66 "andl $0x200cd7, %%eax\n\t" 67 "movl %%eax, (com32_regs + 40)\n\t" 69 "movw %%sp, %%ss:(com32_saved_sp)\n\t" 70 "movw $com32_regs, %%sp\n\t" 77 "movw %%ss:(com32_saved_sp), %%sp\n\t" 80 "movb %%ss:(com32_int_vector), %%al\n\t" 81 "movb %%al, %%cs:(com32_intcall_instr + 1)\n\t" 88 "com32_intcall_instr:\n\t" 92 "movw %%sp, %%ss:(com32_saved_sp)\n\t" 93 "movw $(com32_regs + 44), %%sp\n\t" 100 "movw %%ss:(com32_saved_sp), %%sp\n\t" 109 if ( outregs_phys ) {
110 memcpy ( phys_to_virt ( outregs_phys ),
120 DBGC ( &
com32_regs,
"COM32 farcall %04x:%04x in %#08lx out %#08lx\n",
121 ( proc >> 16 ), ( proc & 0xffff ), inregs_phys, outregs_phys );
136 "movl (com32_regs + 40), %%eax\n\t" 137 "andl $0x200cd7, %%eax\n\t" 138 "movl %%eax, (com32_regs + 40)\n\t" 140 "movw %%sp, %%ss:(com32_saved_sp)\n\t" 141 "movw $com32_regs, %%sp\n\t" 148 "movw %%ss:(com32_saved_sp), %%sp\n\t" 150 "lcall *%%ss:(com32_farcall_proc)\n\t" 152 "movw %%sp, %%ss:(com32_saved_sp)\n\t" 153 "movw $(com32_regs + 44), %%sp\n\t" 160 "movw %%ss:(com32_saved_sp), %%sp\n\t" 169 if ( outregs_phys ) {
170 memcpy ( phys_to_virt ( outregs_phys ),
181 DBGC ( &
com32_regs,
"COM32 cfarcall %04x:%04x params %#08lx+%#zx\n",
182 ( proc >> 16 ), ( proc & 0xffff ), stack, stacksz );
188 REAL_CODE (
"lcall *%%ss:(com32_farcall_proc)\n\t" )
void __asmcall com32_farcall(uint32_t proc, physaddr_t inregs_phys, physaddr_t outregs_phys)
Farcall helper.
static com32sys_t __bss16(com32_regs)
int __asmcall com32_cfarcall(uint32_t proc, physaddr_t stack, size_t stacksz)
CDECL farcall helper.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
#define __asmcall
Declare a function with standard calling conventions.
void remove_from_rm_stack(void *data, size_t size)
Deallocate space on the real-mode stack, optionally copying back data.
Access to external ("user") memory.
uint16_t copy_to_rm_stack(const void *data, size_t size)
Allocate space on the real-mode stack and copy data there.
#define com32_farcall_proc
__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))
FILE_LICENCE(GPL2_OR_LATER)
__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 REAL_CODE(asm_code_str)
#define NULL
NULL pointer (VOID *)
void interrupt(int intr, struct interrupt_frame32 *frame32, struct interrupt_frame64 *frame64)
Interrupt handler.
void __asmcall com32_intcall(uint8_t interrupt, physaddr_t inregs_phys, physaddr_t outregs_phys)
Interrupt call helper.