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