From b837a62ca91b25e3fa78f386ba7bc0101abc4a54 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Sat, 6 Sep 2014 10:07:23 -0700 Subject: runtime: get rid of other Go->C calls in test exports. testSchedLocal* tests need to malloc now because their stack frames are too big to fit on the G0 stack. LGTM=iant R=golang-codereviews, iant, khr CC=golang-codereviews https://codereview.appspot.com/133660043 --- misc/cgo/test/backdoor/runtime.c | 14 -------------- misc/cgo/test/backdoor/thunk.s | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 misc/cgo/test/backdoor/thunk.s (limited to 'misc/cgo') diff --git a/misc/cgo/test/backdoor/runtime.c b/misc/cgo/test/backdoor/runtime.c index 7e6b44872..87ee44eb6 100644 --- a/misc/cgo/test/backdoor/runtime.c +++ b/misc/cgo/test/backdoor/runtime.c @@ -10,20 +10,6 @@ typedef char bool; -bool runtime·lockedOSThread(void); - -static void -FLUSH(void*) -{ -} - -void -·LockedOSThread(bool b) -{ - b = runtime·lockedOSThread(); - FLUSH(&b); -} - // This is what a cgo-compiled stub declaration looks like. void ·Issue7695(struct{void *y[8*sizeof(void*)];}p) diff --git a/misc/cgo/test/backdoor/thunk.s b/misc/cgo/test/backdoor/thunk.s new file mode 100644 index 000000000..ae735c8a3 --- /dev/null +++ b/misc/cgo/test/backdoor/thunk.s @@ -0,0 +1,16 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Assembly to get into package runtime without using exported symbols. + +// +build amd64 amd64p32 arm 386 + +#include "textflag.h" + +#ifdef GOARCH_arm +#define JMP B +#endif + +TEXT ·LockedOSThread(SB),NOSPLIT,$0-0 + JMP runtime·lockedOSThread(SB) -- cgit v1.2.1