From 23f86f316abf9b839cf1f20af2c694047158721a Mon Sep 17 00:00:00 2001 From: Ragav Sachdeva Date: Tue, 15 Oct 2019 16:20:11 -0700 Subject: [PATCH 1/2] Dockerd.exe builds Added a few files to allow for dockerd.exe to successfully build. These files were copied directly from Go win/arm64 port. --- .../x/sys/windows/asm_windows_arm64.s | 15 +++++++++ .../golang.org/x/sys/windows/svc/sys_arm64.s | 33 +++++++++++++++++++ .../x/sys/windows/types_windows_arm64.go | 22 +++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 vendor/golang.org/x/sys/windows/asm_windows_arm64.s create mode 100644 vendor/golang.org/x/sys/windows/svc/sys_arm64.s create mode 100644 vendor/golang.org/x/sys/windows/types_windows_arm64.go diff --git a/vendor/golang.org/x/sys/windows/asm_windows_arm64.s b/vendor/golang.org/x/sys/windows/asm_windows_arm64.s new file mode 100644 index 0000000000000..81b2ef889b96a --- /dev/null +++ b/vendor/golang.org/x/sys/windows/asm_windows_arm64.s @@ -0,0 +1,15 @@ +// Copyright 2019 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 arm64, Windows are implemented in runtime/syscall_windows.goc +// + +#include "textflag.h" + +TEXT ·getprocaddress(SB),NOSPLIT,$0 + B syscall·getprocaddress(SB) + +TEXT ·loadlibrary(SB),NOSPLIT,$0 + B syscall·loadlibrary(SB) diff --git a/vendor/golang.org/x/sys/windows/svc/sys_arm64.s b/vendor/golang.org/x/sys/windows/svc/sys_arm64.s new file mode 100644 index 0000000000000..5aa0693c48772 --- /dev/null +++ b/vendor/golang.org/x/sys/windows/svc/sys_arm64.s @@ -0,0 +1,33 @@ +// Copyright 2019 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 windows + +#include "textflag.h" + +// func servicemain(argc uint32, argv **uint16) +TEXT ·servicemain(SB),NOSPLIT|NOFRAME,$0 + MOVD R0, ·sArgc(SB) + MOVD R1, ·sArgv(SB) + + MOVD ·sName(SB), R0 + MOVD ·ctlHandlerExProc(SB), R1 + MOVD $0, R2 + MOVD ·cRegisterServiceCtrlHandlerExW(SB), R3 + BL (R3) + CMP $0, R0 + BEQ exit + MOVD R0, ·ssHandle(SB) + + MOVD ·goWaitsH(SB), R0 + MOVD ·cSetEvent(SB), R1 + BL (R1) + + MOVD ·cWaitsH(SB), R0 + MOVD $-1, R1 + MOVD ·cWaitForSingleObject(SB), R2 + BL (R2) + + exit: + RET diff --git a/vendor/golang.org/x/sys/windows/types_windows_arm64.go b/vendor/golang.org/x/sys/windows/types_windows_arm64.go new file mode 100644 index 0000000000000..70208417007d0 --- /dev/null +++ b/vendor/golang.org/x/sys/windows/types_windows_arm64.go @@ -0,0 +1,22 @@ +// Copyright 2019 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 windows + +type WSAData struct { + Version uint16 + HighVersion uint16 + MaxSockets uint16 + MaxUdpDg uint16 + VendorInfo *byte + Description [WSADESCRIPTION_LEN + 1]byte + SystemStatus [WSASYS_STATUS_LEN + 1]byte +} + +type Servent struct { + Name *byte + Aliases **byte + Proto *byte + Port uint16 +} From c5035fedbac7eb3c0c79584fe3f93700ad3ddf17 Mon Sep 17 00:00:00 2001 From: Ragav Sachdeva Date: Thu, 17 Oct 2019 13:22:20 -0700 Subject: [PATCH 2/2] added arm64 processor arch flags --- pkg/platform/architecture_windows.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkg/platform/architecture_windows.go b/pkg/platform/architecture_windows.go index a25f1bc516bb9..be1bdbb158386 100644 --- a/pkg/platform/architecture_windows.go +++ b/pkg/platform/architecture_windows.go @@ -30,10 +30,11 @@ type systeminfo struct { // Constants const ( - ProcessorArchitecture64 = 9 // PROCESSOR_ARCHITECTURE_AMD64 - ProcessorArchitectureIA64 = 6 // PROCESSOR_ARCHITECTURE_IA64 - ProcessorArchitecture32 = 0 // PROCESSOR_ARCHITECTURE_INTEL - ProcessorArchitectureArm = 5 // PROCESSOR_ARCHITECTURE_ARM + ProcessorArchitecture64 = 9 // PROCESSOR_ARCHITECTURE_AMD64 + ProcessorArchitectureIA64 = 6 // PROCESSOR_ARCHITECTURE_IA64 + ProcessorArchitecture32 = 0 // PROCESSOR_ARCHITECTURE_INTEL + ProcessorArchitectureArm = 5 // PROCESSOR_ARCHITECTURE_ARM + ProcessorArchitectureArm64 = 12 // PROCESSOR_ARCHITECTURE_ARM64 ) // runtimeArchitecture gets the name of the current architecture (x86, x86_64, …) @@ -47,6 +48,8 @@ func runtimeArchitecture() (string, error) { return "i686", nil case ProcessorArchitectureArm: return "arm", nil + case ProcessorArchitectureArm64: + return "arm64", nil default: return "", fmt.Errorf("Unknown processor architecture") }