1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /* -----------------------------------------------------------------------
4 * Copyright 2009-2014 Intel Corporation; author H. Peter Anvin
6 * ----------------------------------------------------------------------- */
9 * "Glove box" for BIOS calls. Avoids the constant problems with BIOSes
10 * touching registers they shouldn't be.
14 .section ".inittext","ax"
16 .type intcall, @function
18 /* Self-modify the INT instruction. Ugly, but works. */
22 jmp 1f /* Synchronize pipeline */
30 /* Copy input state to stack frame */
37 /* Pop full state from the stack */
46 .byte 0xcd /* INT opcode */
49 /* Push full state to the stack */
57 /* Re-establish C environment invariants */
64 /* Copy output state from stack frame */
65 movw 68(%esp), %di /* Original %cx == 3rd argument */
73 /* Restore state and return */
79 .size intcall, .-intcall