File: pthread_stop_world.h

package info (click to toggle)
libgc 1%3A8.2.2-3
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 5,036 kB
  • sloc: ansic: 39,586; sh: 4,449; cpp: 1,046; makefile: 200; asm: 77
file content (64 lines) | stat: -rw-r--r-- 2,623 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
 * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
 * Copyright (c) 1996 by Silicon Graphics.  All rights reserved.
 * Copyright (c) 1998 by Fergus Henderson.  All rights reserved.
 * Copyright (c) 2000-2009 by Hewlett-Packard Development Company.
 * All rights reserved.
 *
 * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
 * OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
 *
 * Permission is hereby granted to use or copy this program
 * for any purpose,  provided the above notices are retained on all copies.
 * Permission to modify the code and to distribute modified code is granted,
 * provided the above notices are retained, and a notice that the code was
 * modified is included with the above copyright notice.
 */

#ifndef GC_PTHREAD_STOP_WORLD_H
#define GC_PTHREAD_STOP_WORLD_H

EXTERN_C_BEGIN

struct thread_stop_info {
#   if !defined(GC_OPENBSD_UTHREADS) && !defined(NACL) \
       && !defined(PLATFORM_STOP_WORLD) && !defined(SN_TARGET_PSP2)
      volatile AO_t last_stop_count;
                        /* The value of GC_stop_count when the thread   */
                        /* last successfully handled a suspend signal.  */
#     ifdef GC_ENABLE_SUSPEND_THREAD
        volatile AO_t ext_suspend_cnt;
                        /* An odd value means thread was suspended      */
                        /* externally.  Incremented on every call of    */
                        /* GC_suspend_thread() and GC_resume_thread().  */
                        /* Updated with the GC lock held, but could be  */
                        /* read from a signal handler.                  */
#     endif
#   endif

    ptr_t stack_ptr;            /* Valid only when stopped.             */

#   ifdef NACL
      /* Grab NACL_GC_REG_STORAGE_SIZE pointers off the stack when      */
      /* going into a syscall.  20 is more than we need, but it's an    */
      /* overestimate in case the instrumented function uses any callee */
      /* saved registers, they may be pushed to the stack much earlier. */
      /* Also, on amd64 'push' puts 8 bytes on the stack even though    */
      /* our pointers are 4 bytes.                                      */
#     ifdef ARM32
        /* Space for r4-r8, r10-r12, r14.       */
#       define NACL_GC_REG_STORAGE_SIZE 9
#     else
#       define NACL_GC_REG_STORAGE_SIZE 20
#     endif
      ptr_t reg_storage[NACL_GC_REG_STORAGE_SIZE];
#   elif defined(PLATFORM_HAVE_GC_REG_STORAGE_SIZE)
      word registers[PLATFORM_GC_REG_STORAGE_SIZE]; /* used externally */
#   endif
};

GC_INNER void GC_stop_init(void);

EXTERN_C_END

#endif