Rebase.
[official-gcc.git] / libgo / runtime / race.h
blob0f4718aa8aaf7d51e8c9394feb0bb62ec06eff3f
1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // Definitions related to data race detection.
7 #ifdef RACE
8 enum { raceenabled = 1 };
9 #else
10 enum { raceenabled = 0 };
11 #endif
13 // Initialize race detection subsystem.
14 uintptr runtime_raceinit(void);
15 // Finalize race detection subsystem, does not return.
16 void runtime_racefini(void);
18 void runtime_racemapshadow(void *addr, uintptr size);
19 void runtime_racemalloc(void *p, uintptr sz);
20 uintptr runtime_racegostart(void *pc);
21 void runtime_racegoend(void);
22 void runtime_racewritepc(void *addr, void *callpc, void *pc);
23 void runtime_racereadpc(void *addr, void *callpc, void *pc);
24 void runtime_racewriterangepc(void *addr, uintptr sz, void *callpc, void *pc);
25 void runtime_racereadrangepc(void *addr, uintptr sz, void *callpc, void *pc);
26 void runtime_racereadobjectpc(void *addr, const Type *t, void *callpc, void *pc);
27 void runtime_racewriteobjectpc(void *addr, const Type *t, void *callpc, void *pc);
28 void runtime_racefingo(void);
29 void runtime_raceacquire(void *addr);
30 void runtime_raceacquireg(G *gp, void *addr);
31 void runtime_racerelease(void *addr);
32 void runtime_racereleaseg(G *gp, void *addr);
33 void runtime_racereleasemerge(void *addr);
34 void runtime_racereleasemergeg(G *gp, void *addr);