1/*
2 * Copyright 2011, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 *
5 * Dump of x86_signal_frame_function() in arch/x86/32/signals.cpp
6 */
7
8
9#include <asm_defs.h>
10
11
12// TODO: build from arch/x86/32/signals.cpp with the x86 compiler
13FUNCTION(x86_64_signal_handler_compat):
14	.byte	0x55						// push   %ebp
15	.byte	0x89,0xe5					// mov    %esp,%ebp
16	.byte	0x83,0xec,0x14				// sub    $0x14,%esp
17	.byte	0x53						// push   %ebx
18	.byte	0x8b,0x5d,0x08				// mov    0x8(%ebp),%ebx
19	.byte	0x80,0xbb,0x74,0x2,0x0,0x0,0x0	// cmpb   $0x0,0x274(%ebx)
20	.byte	0x74,0x19					// je     <x86_64_signal_frame_function_compat+0x2c>
21	.byte	0x8b,0x93,0x70,0x2,0x0,0x0	// mov    0x270(%ebx),%edx
22	.byte	0x8b,0x83,0x6c,0x2,0x0,0x0	// mov    0x26c(%ebx),%eax
23	.byte	0x50						// push   %eax
24	.byte	0x8d,0x43,0x24				// lea    0x24(%ebx),%eax
25	.byte	0x50						// push   %eax
26	.byte	0x53						// push   %ebx
27	.byte	0x8b,0x3					// mov    (%ebx),%eax
28	.byte	0x50						// push   %eax
29	.byte	0xff,0xd2					// call   *%edx
30	.byte	0xeb,0x19					// jmp    <x86_64_signal_frame_function_compat+0x45>
31	.byte	0x8b,0x93,0x70,0x2,0x0,0x0	// mov    0x270(%ebx),%edx
32	.byte	0x83,0xc4,0xfc				// add    $0xfffffffc,%esp
33	.byte	0x8d,0x43,0x3c				// lea    0x3c(%ebx),%eax
34	.byte	0x50						// push   %eax
35	.byte	0x8b,0x83,0x6c,0x2,0x0,0x0	// mov    0x26c(%ebx),%eax
36	.byte	0x50						// push   %eax
37	.byte	0x8b,0x03					// mov    (%ebx),%eax
38	.byte	0x50						// push   %eax
39	.byte	0xff,0xd2					// call   *%edx
40	.byte	0x53						// push   %ebx
41	.byte	0x6a,0x0					// push   $0
42	.byte	0xb8,0x3f,0x0,0x0,0x0		// movl $ TO_STRING_LITERAL(SYSCALL_RESTORE_SIGNAL_FRAME) , %%eax;
43	.byte	0xcd,0x63					// int    $99
44	.byte	0x8b,0x5d,0xe8				// mov    -0x18(%ebp),%ebx
45	.byte	0x89,0xec					// mov    %ebp,%esp
46	.byte	0x5d						// pop    %ebp
47	.byte	0xc3						// ret
48FUNCTION_END(x86_64_signal_handler_compat)
49SYMBOL(x86_64_signal_handler_compat_end):
50