diff options
author | Ian Lance Taylor <iant@golang.org> | 2010-04-09 13:30:11 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2010-04-09 13:30:11 -0700 |
commit | 38bc93c1d883e5d1da94f0b049f47d6f0c788bba (patch) | |
tree | 206b58a0dc53127721598d710d1ebe89f0677e6d /src/libcgo/linux_amd64.c | |
parent | 5a8c02d10b2ac1094315c96a279cbfee11a34cd5 (diff) | |
download | golang-38bc93c1d883e5d1da94f0b049f47d6f0c788bba.tar.gz |
Support cgo export on amd64.
R=rsc
CC=golang-dev
http://codereview.appspot.com/857045
Diffstat (limited to 'src/libcgo/linux_amd64.c')
-rw-r--r-- | src/libcgo/linux_amd64.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/libcgo/linux_amd64.c b/src/libcgo/linux_amd64.c index 14a409f5e..fc4a239fb 100644 --- a/src/libcgo/linux_amd64.c +++ b/src/libcgo/linux_amd64.c @@ -44,3 +44,28 @@ threadentry(void *v) crosscall_amd64(ts.m, ts.g, ts.fn); return nil; } + +static __thread void *libcgo_m; +static __thread void *libcgo_g; + +void +libcgo_set_scheduler(void *m, void *g) +{ + libcgo_m = m; + libcgo_g = g; +} + +struct get_scheduler_args { + void *m; + void *g; +}; + +void libcgo_get_scheduler(struct get_scheduler_args *) + __attribute__ ((visibility("hidden"))); + +void +libcgo_get_scheduler(struct get_scheduler_args *p) +{ + p->m = libcgo_m; + p->g = libcgo_g; +} |