Skip to content

Commit

Permalink
add arm bindings for res_search
Browse files Browse the repository at this point in the history
Signed-off-by: grant <[email protected]>
  • Loading branch information
grantseltzer committed Mar 8, 2019
1 parent 75578bc commit b9747ec
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/net/lookup_darwin_arm.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright 2015 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 and other sys.stuff for ARM64, Darwin
// System calls are implemented in libSystem, this file contains
// trampolines that convert from Go to C calling convention.

#include "go_asm.h"
#include "go_tls.h"
#include "textflag.h"

TEXT runtime·res_search_trampoline(SB),NOSPLIT,$0
MOVW 16(R0). R4 // arg 5 anslen
MOVW 12(R0), R3 // arg 4 answer
MOVW 4(R0), R1 // arg 2 class
MOVW 8(R0), R2 // arg 3 type
MOVW 0(R0), R0 // arg 1 name
BL libc_res_search
RET
17 changes: 17 additions & 0 deletions src/net/lookup_darwin_arm64.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// 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.

#include "go_asm.h"
#include "go_tls.h"
#include "textflag.h"

TEXT runtime·res_search_trampoline(SB),NOSPLIT,$0
SUB $16, RSP
MOVW 24(R0), R4 // arg 5 anslen
MOVD 16(R0), R3 // arg 4 answer
MOVW 8(R0), R1 // arg 2 class
MOVD 12(R0), R2 // arg 3 type
MOVD 0(R0), R0 // arg 1 name
BL libc_res_search(SB)
RET

0 comments on commit b9747ec

Please sign in to comment.