| // Copyright 2013 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. |
| |
| // +build amd64 386 |
| |
| #include "runtime.h" |
| |
| // adjust Gobuf as it if executed a call to fn with context ctxt |
| // and then did an immediate gosave. |
| void |
| runtimeยทgostartcall(Gobuf *gobuf, void (*fn)(void), void *ctxt) |
| { |
| uintptr *sp; |
| |
| sp = (uintptr*)gobuf->sp; |
| *--sp = (uintptr)gobuf->pc; |
| gobuf->sp = (uintptr)sp; |
| gobuf->pc = (uintptr)fn; |
| gobuf->ctxt = ctxt; |
| } |