mirror of
https://github.com/golang/go
synced 2024-10-04 22:21:22 -06:00
e9d62a6d81
thread_GOOS.c becomes os_GOOS.c. signal_GOOS_GOARCH.c becomes os_GOOS_GOARCH.c, but with non-GOARCH-specific code moved into os_GOOS.c. The actual arch-specific signal handler moves into signal_GOARCH.c to avoid per-GOOS duplication. New files signal_GOOS_GOARCH.h provide macros for accessing fields of the very system-specific signal info structs. Lots moving, but nothing changing. This is a preliminarly cleanup so I can work on the signal handling code to fix some open issues without having to make each change 13 times. Tested on Linux and OS X, 386 and amd64. Will fix Plan 9, Windows, and ARM after the fact if necessary. (Plan 9 and Windows should be fine; ARM will probably have some typos.) Net effect: -1081 lines of code. R=golang-dev, r CC=golang-dev https://golang.org/cl/7565048
18 lines
529 B
C
18 lines
529 B
C
// Copyright 2009 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.
|
|
|
|
#include "runtime.h"
|
|
#include "defs_GOOS_GOARCH.h"
|
|
#include "os_GOOS.h"
|
|
|
|
void
|
|
runtime·lwp_mcontext_init(McontextT *mc, void *stack, M *mp, G *gp, void (*fn)(void))
|
|
{
|
|
mc->__gregs[REG_EIP] = (uint32)runtime·lwp_tramp;
|
|
mc->__gregs[REG_UESP] = (uint32)stack;
|
|
mc->__gregs[REG_EBX] = (uint32)mp;
|
|
mc->__gregs[REG_EDX] = (uint32)gp;
|
|
mc->__gregs[REG_ESI] = (uint32)fn;
|
|
}
|