Beispiel #1
0
void
x_cgo_munmap(void *addr, uintptr_t length) {
	int r;

	_cgo_tsan_acquire();
	r = munmap(addr, length);
	_cgo_tsan_release();
	if (r < 0) {
		/* The Go runtime is not prepared for munmap to fail.  */
		abort();
	}
}
CGO_NO_SANITIZE_THREAD
void helloSlice(GoSlice p0)
{
	__SIZE_TYPE__ _cgo_ctxt = _cgo_wait_runtime_init_done();
	struct {
		GoSlice p0;
	} __attribute__((__packed__)) a;
	a.p0 = p0;
	_cgo_tsan_release();
	crosscall2(_cgoexp_16f1900c27a8_helloSlice, &a, 24, _cgo_ctxt);
	_cgo_tsan_acquire();
	_cgo_release_context(_cgo_ctxt);
}
Beispiel #3
0
uintptr_t
x_cgo_mmap(void *addr, uintptr_t length, int32_t prot, int32_t flags, int32_t fd, uint32_t offset) {
	void *p;

	_cgo_tsan_acquire();
	p = mmap(addr, length, prot, flags, fd, offset);
	_cgo_tsan_release();
	if (p == MAP_FAILED) {
		/* This is what the Go code expects on failure.  */
		return (uintptr_t)errno;
	}
	return (uintptr_t)p;
}
CGO_NO_SANITIZE_THREAD
void
_cgo_506f45f9fa85_Cfunc_sum(void *v)
{
	struct {
		int p0;
		int p1;
		int r;
		char __pad12[4];
	} __attribute__((__packed__)) *a = v;
	char *stktop = _cgo_topofstack();
	__typeof__(a->r) r;
	_cgo_tsan_acquire();
	r = sum(a->p0, a->p1);
	_cgo_tsan_release();
	a = (void*)((char*)a + (_cgo_topofstack() - stktop));
	a->r = r;
}