2010-06-05 Mark Probst <mark.probst@gmail.com>
[mono.git] / mono / metadata / sgen-protocol.h
1 /*
2  * Copyright 2001-2003 Ximian, Inc
3  * Copyright 2003-2010 Novell, Inc.
4  * 
5  * Permission is hereby granted, free of charge, to any person obtaining
6  * a copy of this software and associated documentation files (the
7  * "Software"), to deal in the Software without restriction, including
8  * without limitation the rights to use, copy, modify, merge, publish,
9  * distribute, sublicense, and/or sell copies of the Software, and to
10  * permit persons to whom the Software is furnished to do so, subject to
11  * the following conditions:
12  * 
13  * The above copyright notice and this permission notice shall be
14  * included in all copies or substantial portions of the Software.
15  * 
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  */
24 enum {
25         SGEN_PROTOCOL_COLLECTION,
26         SGEN_PROTOCOL_ALLOC,
27         SGEN_PROTOCOL_COPY,
28         SGEN_PROTOCOL_PIN,
29         SGEN_PROTOCOL_MARK,
30         SGEN_PROTOCOL_WBARRIER,
31         SGEN_PROTOCOL_GLOBAL_REMSET,
32         SGEN_PROTOCOL_PTR_UPDATE,
33         SGEN_PROTOCOL_CLEANUP,
34         SGEN_PROTOCOL_EMPTY,
35         SGEN_PROTOCOL_THREAD_RESTART,
36         SGEN_PROTOCOL_THREAD_REGISTER,
37         SGEN_PROTOCOL_THREAD_UNREGISTER,
38         SGEN_PROTOCOL_MISSING_REMSET,
39         SGEN_PROTOCOL_ALLOC_PINNED,
40         SGEN_PROTOCOL_ALLOC_DEGRADED
41 };
42
43 typedef struct {
44         int generation;
45 } SGenProtocolCollection;
46
47 typedef struct {
48         gpointer obj;
49         gpointer vtable;
50         int size;
51 } SGenProtocolAlloc;
52
53 typedef struct {
54         gpointer from;
55         gpointer to;
56         gpointer vtable;
57         int size;
58 } SGenProtocolCopy;
59
60 typedef struct {
61         gpointer obj;
62         gpointer vtable;
63         int size;
64 } SGenProtocolPin;
65
66 typedef struct {
67         gpointer obj;
68         gpointer vtable;
69         int size;
70 } SGenProtocolMark;
71
72 typedef struct {
73         gpointer ptr;
74         gpointer value;
75         gpointer value_vtable;
76 } SGenProtocolWBarrier;
77
78 typedef struct {
79         gpointer ptr;
80         gpointer value;
81         gpointer value_vtable;
82 } SGenProtocolGlobalRemset;
83
84 typedef struct {
85         gpointer ptr;
86         gpointer old_value;
87         gpointer new_value;
88         gpointer vtable;
89         int size;
90 } SGenProtocolPtrUpdate;
91
92 typedef struct {
93         gpointer ptr;
94         gpointer vtable;
95         int size;
96 } SGenProtocolCleanup;
97
98 typedef struct {
99         gpointer start;
100         int size;
101 } SGenProtocolEmpty;
102
103 typedef struct {
104         gpointer thread;
105 } SGenProtocolThreadRestart;
106
107 typedef struct {
108         gpointer thread;
109 } SGenProtocolThreadRegister;
110
111 typedef struct {
112         gpointer thread;
113 } SGenProtocolThreadUnregister;
114
115 typedef struct {
116         gpointer obj;
117         gpointer obj_vtable;
118         int offset;
119         gpointer value;
120         gpointer value_vtable;
121         int value_pinned;
122 } SGenProtocolMissingRemset;
123
124 /* missing: finalizers, dislinks, roots, non-store wbarriers */