Debian Codegraph @

external/bdwgc/include/private/pthread_stop_world.h

raw
1 /*
2 * Copyright (c) 1994 by Xerox Corporation. All rights reserved.
3 * Copyright (c) 1996 by Silicon Graphics. All rights reserved.
4 * Copyright (c) 1998 by Fergus Henderson. All rights reserved.
5 * Copyright (c) 2000-2009 by Hewlett-Packard Development Company.
6 * All rights reserved.
7 *
8 * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
9 * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
10 *
11 * Permission is hereby granted to use or copy this program
12 * for any purpose, provided the above notices are retained on all copies.
13 * Permission to modify the code and to distribute modified code is granted,
14 * provided the above notices are retained, and a notice that the code was
15 * modified is included with the above copyright notice.
16 */
17
18 #ifndef GC_PTHREAD_STOP_WORLD_H
19 #define GC_PTHREAD_STOP_WORLD_H
20
21 EXTERN_C_BEGIN
22
23 struct thread_stop_info {
24 # if !defined(GC_OPENBSD_UTHREADS) && !defined(NACL)
25 # ifdef GC_ATOMIC_OPS_H
26 volatile AO_t last_stop_count;
27 # else
28 word last_stop_count;
29 # endif
30 /* The value of GC_stop_count when the thread */
31 /* last successfully handled a suspend signal. */
32 # endif
33
34 ptr_t stack_ptr; /* Valid only when stopped. */
35
36 # ifdef NACL
37 /* Grab NACL_GC_REG_STORAGE_SIZE pointers off the stack when */
38 /* going into a syscall. 20 is more than we need, but it's an */
39 /* overestimate in case the instrumented function uses any callee */
40 /* saved registers, they may be pushed to the stack much earlier. */
41 /* Also, on amd64 'push' puts 8 bytes on the stack even though */
42 /* our pointers are 4 bytes. */
43 # ifdef ARM32
44 /* Space for r4-r8, r10-r12, r14. */
45 # define NACL_GC_REG_STORAGE_SIZE 9
46 # else
47 # define NACL_GC_REG_STORAGE_SIZE 20
48 # endif
49 ptr_t reg_storage[NACL_GC_REG_STORAGE_SIZE];
50 # endif
51
52 #if defined(PLATFORM_GC_REG_STORAGE_SIZE)
53 __uint64_t registers[PLATFORM_GC_REG_STORAGE_SIZE];
54 #endif
55 };
56
57 GC_INNER void GC_stop_init(void);
58
59 EXTERN_C_END
60
61 #endif