#include <stdint.h>
#include <realmode.h>
#include <comboot.h>
#include <assert.h>
#include <ipxe/uaccess.h>
Go to the source code of this file.
◆ com32_regs
◆ com32_int_vector
◆ com32_farcall_proc
| #define com32_farcall_proc __use_data16 ( com32_farcall_proc ) |
◆ FILE_LICENCE()
| FILE_LICENCE |
( |
GPL2_OR_LATER |
| ) |
|
◆ __bss16() [1/4]
◆ __bss16() [2/4]
◆ __bss16() [3/4]
◆ __bss16() [4/4]
◆ com32_intcall()
Interrupt call helper.
Definition at line 47 of file com32_call.c.
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 ),
void * memcpy(void *dest, const void *src, size_t len) __nonnull
__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")
#define REAL_CODE(asm_code_str)
void interrupt(int intr, struct interrupt_frame32 *frame32, struct interrupt_frame64 *frame64)
Interrupt handler.
References __asm__(), __volatile__(), com32_int_vector, com32_regs, DBGC, interrupt(), memcpy(), and REAL_CODE.
◆ com32_farcall()
Farcall helper.
Definition at line 118 of file com32_call.c.
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 ),
void * memcpy(void *dest, const void *src, size_t len) __nonnull
#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))
__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)
References __asm__(), __volatile__(), com32_farcall_proc, com32_regs, DBGC, memcpy(), and REAL_CODE.
◆ com32_cfarcall()
CDECL farcall helper.
Definition at line 178 of file com32_call.c.
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 remove_from_rm_stack(void *data, size_t size)
Deallocate space on the real-mode stack, optionally copying back data.
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))
__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 *)
References __asm__(), __volatile__(), com32_farcall_proc, com32_regs, copy_to_rm_stack(), DBGC, eax, NULL, REAL_CODE, and remove_from_rm_stack().