mirror of
https://github.com/golang/go
synced 2024-10-04 04:31:21 -06:00
22 lines
525 B
C
22 lines
525 B
C
|
// 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;
|
||
|
}
|