2 * thunks.S - assembly helpers for mixed-bitness code
3 * Copyright (c) 2015 Andrew Lutomirski
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * These are little helpers that make it easier to switch bitness on
20 .global call32_from_64
21 .type call32_from_64, @function
24 // esi: function to call
39 // Switch to compatibility mode
40 pushq $0x23 /* USER32_CS */
48 // Switch back to long mode
67 .size call32_from_64, .-call32_from_64