| /* SPDX-License-Identifier: GPL-2.0-or-later */ |
| /* ----------------------------------------------------------------------- |
| * Copyright 2009-2014 Intel Corporation; author H. Peter Anvin |
| * ----------------------------------------------------------------------- */ |
| * "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 */ |