]> Cypherpunks repositories - gostls13.git/commit
runtime: refactor os-specific code
authorRuss Cox <rsc@golang.org>
Thu, 14 Mar 2013 18:35:13 +0000 (11:35 -0700)
committerRuss Cox <rsc@golang.org>
Thu, 14 Mar 2013 18:35:13 +0000 (11:35 -0700)
commite9d62a6d81ee380acda593edec0d3a05295254ec
tree73c96106c0dd08a7d1bfd1c867ac36d0e212aec4
parentcdc642453bacfad6561eb4275bc55d752a9e92fb
runtime: refactor os-specific code

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
55 files changed:
src/cmd/dist/build.c
src/pkg/runtime/os_darwin.c [moved from src/pkg/runtime/thread_darwin.c with 94% similarity]
src/pkg/runtime/os_darwin.h
src/pkg/runtime/os_freebsd.c [moved from src/pkg/runtime/thread_freebsd.c with 82% similarity]
src/pkg/runtime/os_freebsd.h
src/pkg/runtime/os_freebsd_arm.c [new file with mode: 0644]
src/pkg/runtime/os_linux.c [moved from src/pkg/runtime/thread_linux.c with 84% similarity]
src/pkg/runtime/os_linux.h
src/pkg/runtime/os_linux_386.c [new file with mode: 0644]
src/pkg/runtime/os_linux_arm.c [new file with mode: 0644]
src/pkg/runtime/os_netbsd.c [moved from src/pkg/runtime/thread_netbsd.c with 86% similarity]
src/pkg/runtime/os_netbsd.h
src/pkg/runtime/os_netbsd_386.c [new file with mode: 0644]
src/pkg/runtime/os_netbsd_amd64.c [new file with mode: 0644]
src/pkg/runtime/os_netbsd_arm.c [new file with mode: 0644]
src/pkg/runtime/os_openbsd.c [moved from src/pkg/runtime/thread_openbsd.c with 84% similarity]
src/pkg/runtime/os_openbsd.h
src/pkg/runtime/os_plan9.c [moved from src/pkg/runtime/thread_plan9.c with 100% similarity]
src/pkg/runtime/os_plan9.h
src/pkg/runtime/os_plan9_386.c [moved from src/pkg/runtime/signal_plan9_386.c with 100% similarity]
src/pkg/runtime/os_plan9_amd64.c [moved from src/pkg/runtime/signal_plan9_amd64.c with 100% similarity]
src/pkg/runtime/os_windows.c [moved from src/pkg/runtime/thread_windows.c with 100% similarity]
src/pkg/runtime/os_windows_386.c [moved from src/pkg/runtime/signal_windows_386.c with 100% similarity]
src/pkg/runtime/os_windows_amd64.c [moved from src/pkg/runtime/signal_windows_amd64.c with 100% similarity]
src/pkg/runtime/signal_386.c [new file with mode: 0644]
src/pkg/runtime/signal_amd64.c [new file with mode: 0644]
src/pkg/runtime/signal_arm.c [new file with mode: 0644]
src/pkg/runtime/signal_darwin_386.c [deleted file]
src/pkg/runtime/signal_darwin_386.h [new file with mode: 0644]
src/pkg/runtime/signal_darwin_amd64.c [deleted file]
src/pkg/runtime/signal_darwin_amd64.h [new file with mode: 0644]
src/pkg/runtime/signal_freebsd_386.c [deleted file]
src/pkg/runtime/signal_freebsd_386.h [new file with mode: 0644]
src/pkg/runtime/signal_freebsd_amd64.c [deleted file]
src/pkg/runtime/signal_freebsd_amd64.h [new file with mode: 0644]
src/pkg/runtime/signal_freebsd_arm.c [deleted file]
src/pkg/runtime/signal_freebsd_arm.h [new file with mode: 0644]
src/pkg/runtime/signal_linux_386.c [deleted file]
src/pkg/runtime/signal_linux_386.h [new file with mode: 0644]
src/pkg/runtime/signal_linux_amd64.c [deleted file]
src/pkg/runtime/signal_linux_amd64.h [new file with mode: 0644]
src/pkg/runtime/signal_linux_arm.c [deleted file]
src/pkg/runtime/signal_linux_arm.h [new file with mode: 0644]
src/pkg/runtime/signal_netbsd_386.c [deleted file]
src/pkg/runtime/signal_netbsd_386.h [new file with mode: 0644]
src/pkg/runtime/signal_netbsd_amd64.c [deleted file]
src/pkg/runtime/signal_netbsd_amd64.h [new file with mode: 0644]
src/pkg/runtime/signal_netbsd_arm.c [deleted file]
src/pkg/runtime/signal_netbsd_arm.h [new file with mode: 0644]
src/pkg/runtime/signal_openbsd_386.c [deleted file]
src/pkg/runtime/signal_openbsd_386.h [new file with mode: 0644]
src/pkg/runtime/signal_openbsd_amd64.c [deleted file]
src/pkg/runtime/signal_openbsd_amd64.h [new file with mode: 0644]
src/pkg/runtime/signal_unix.c
src/pkg/runtime/signal_unix.h [new file with mode: 0644]