Commit e71fc0c1 authored by Alex Brainman's avatar Alex Brainman

syscall: rearrange windows code so 386 and amd64 can share files

R=golang-dev, r
CC=golang-dev, vcc.163
https://golang.org/cl/4641093
parent ae19943e
...@@ -84,5 +84,5 @@ include ../../Make.pkg ...@@ -84,5 +84,5 @@ include ../../Make.pkg
signal_unix.go: ../syscall/zerrors_$(GOOS)_$(GOARCH).go signal_unix.go: ../syscall/zerrors_$(GOOS)_$(GOARCH).go
./mkunixsignals.sh $< > $@ || rm -f $@ ./mkunixsignals.sh $< > $@ || rm -f $@
signal_windows.go: ../syscall/ztypes_$(GOOS)_$(GOARCH).go signal_windows.go: ../syscall/ztypes_$(GOOS).go
./mkunixsignals.sh $< > $@ || rm -f $@ ./mkunixsignals.sh $< > $@ || rm -f $@
...@@ -41,6 +41,8 @@ GOFILES_linux=\ ...@@ -41,6 +41,8 @@ GOFILES_linux=\
GOFILES_windows=\ GOFILES_windows=\
exec_windows.go\ exec_windows.go\
zerrors_windows.go\
ztypes_windows.go\
GOFILES_plan9=\ GOFILES_plan9=\
exec_plan9.go\ exec_plan9.go\
......
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// //
// System calls for 386, Windows are implemented in ../runtime/windows/syscall.cgo // System calls for 386, Windows are implemented in ../runtime/windows/syscall.goc
// //
// 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.
//
// System calls for amd64, Windows are implemented in ../runtime/windows/syscall.goc
//
...@@ -78,6 +78,7 @@ GOOSARCH="${GOOS}_${GOARCH}" ...@@ -78,6 +78,7 @@ GOOSARCH="${GOOS}_${GOARCH}"
# defaults # defaults
mksyscall="./mksyscall.pl" mksyscall="./mksyscall.pl"
mkerrors="./mkerrors.sh" mkerrors="./mkerrors.sh"
zerrors="zerrors_$GOOSARCH.go"
run="sh" run="sh"
case "$1" in case "$1" in
...@@ -150,6 +151,14 @@ windows_386) ...@@ -150,6 +151,14 @@ windows_386)
mksysnum= mksysnum=
mktypes= mktypes=
mkerrors="./mkerrors_windows.sh -f -m32" mkerrors="./mkerrors_windows.sh -f -m32"
zerrors="zerrors_windows.go"
;;
windows_amd64)
mksyscall="./mksyscall_windows.pl"
mksysnum=
mktypes=
mkerrors="./mkerrors_windows.sh -f -m32"
zerrors="zerrors_windows.go"
;; ;;
plan9_386) plan9_386)
mkerrors= mkerrors=
...@@ -164,7 +173,7 @@ plan9_386) ...@@ -164,7 +173,7 @@ plan9_386)
esac esac
( (
if [ -n "$mkerrors" ]; then echo "$mkerrors |gofmt >zerrors_$GOOSARCH.go"; fi if [ -n "$mkerrors" ]; then echo "$mkerrors |gofmt >$zerrors"; fi
syscall_goos="syscall_$GOOS.go" syscall_goos="syscall_$GOOS.go"
case "$GOOS" in case "$GOOS" in
darwin | freebsd) darwin | freebsd)
......
...@@ -100,6 +100,8 @@ func getSysProcAddr(m uintptr, pname string) uintptr { ...@@ -100,6 +100,8 @@ func getSysProcAddr(m uintptr, pname string) uintptr {
return p return p
} }
func Getpagesize() int { return 4096 }
// Converts a Go function to a function pointer conforming // Converts a Go function to a function pointer conforming
// to the stdcall calling convention. This is useful when // to the stdcall calling convention. This is useful when
// interoperating with Windows code requiring callbacks. // interoperating with Windows code requiring callbacks.
......
...@@ -3,5 +3,3 @@ ...@@ -3,5 +3,3 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
package syscall package syscall
func Getpagesize() int { return 4096 }
// 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.
package syscall
This diff is collapsed.
This diff is collapsed.
// Copyright 2011 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.
package syscall
// mksyscall_windows.pl // mksyscall_windows.pl -l32 syscall_windows.go syscall_windows_386.go
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
package syscall package syscall
......
This diff is collapsed.
// nothing to see here
package syscall
This diff is collapsed.
This diff is collapsed.
// Copyright 2011 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.
package syscall
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment