1 /* -----------------------------------------------------------------------
3 * Copyright 2009-2014 Intel Corporation; author H. Peter Anvin
5 * This file is part of the Linux kernel, and is made available under
6 * the terms of the GNU General Public License version 2 or (at your
7 * option) any later version; incorporated herein by reference.
9 * ----------------------------------------------------------------------- */
12 * "Glove box" for BIOS calls. Avoids the constant problems with BIOSes
13 * touching registers they shouldn't be.
17 .section ".inittext","ax"
19 .type intcall, @function
21 /* Self-modify the INT instruction. Ugly, but works. */
25 jmp 1f /* Synchronize pipeline */
33 /* Copy input state to stack frame */
40 /* Pop full state from the stack */
49 .byte 0xcd /* INT opcode */
52 /* Push full state to the stack */
60 /* Re-establish C environment invariants */
67 /* Copy output state from stack frame */
68 movw 68(%esp), %di /* Original %cx == 3rd argument */
76 /* Restore state and return */
82 .size intcall, .-intcall