xref: /kvmtool/x86/bios/macro.S (revision af7b08685968ff8f6ffdf5cac1ef067688bce8c6)
1/*
2 * handy BIOS macros
3 */
4
5/*
6 * switch to BIOS stack
7 */
8.macro stack_swap
9	movw %ss, %cs:(__CALLER_SS)
10	movl %esp, %cs:(__CALLER_SP)
11	movl %edx, %cs:(__CALLER_CLOBBER)
12	movw $MB_BIOS_SS, %dx
13	movw %dx, %ss
14	movw $MB_BIOS_SP, %sp
15	movl %cs:(__CALLER_CLOBBER), %edx
16.endm
17
18/*
19 * restore the original stack
20 */
21.macro stack_restore
22	movl %cs:(__CALLER_SP), %esp
23	movw %cs:(__CALLER_SS), %ss
24.endm
25
26