master
h 36 lines 1006 Bytes
Raw
1 /*
2 * i386 thread support
3 *
4 * Copyright (c) 2013 Stacey D. Son
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8 #ifndef TARGET_ARCH_THREAD_H
9 #define TARGET_ARCH_THREAD_H
10
11 /* Compare to vm_machdep.c cpu_set_upcall_kse() */
12 static inline void target_thread_set_upcall(CPUX86State *regs, abi_ulong entry,
13 abi_ulong arg, abi_ulong stack_base, abi_ulong stack_size)
14 {
15 /* XXX */
16 }
17
18 static inline void target_thread_init(struct target_pt_regs *regs,
19 struct image_info *infop)
20 {
21 regs->esp = infop->start_stack;
22 regs->eip = infop->entry;
23
24 /*
25 * SVR4/i386 ABI (pages 3-31, 3-32) says that when the program starts %edx
26 * contains a pointer to a function which might be registered using
27 * `atexit'. This provides a mean for the dynamic linker to call DT_FINI
28 * functions for shared libraries that have been loaded before the code
29 * runs.
30 *
31 * A value of 0 tells we have no such handler.
32 */
33 regs->edx = 0;
34 }
35
36 #endif /* TARGET_ARCH_THREAD_H */