summaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/sys/windows/svc/sys_windows_arm64.s
blob: 3ca540e69078f0a89a1879be28d3b2c92a08ae53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright 2018 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 "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