mirror of
https://github.com/golang/go
synced 2024-11-08 05:56:12 -07:00
e8d417d272
Changes include: 1. open compilation option -msan for arm64 2. modify doc to explain -msan is also supported on linux/arm64 3. wrap msan lib API in msan_arm64.s 4. use libc for sigaction syscalls when cgo is enabled 5. use libc for mmap syscalls when cgo is enabled Change-Id: I26ebe61ff7ce1906125f54a0182a720f9d58ec11 Reviewed-on: https://go-review.googlesource.com/109255 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
63 lines
1.6 KiB
ArmAsm
63 lines
1.6 KiB
ArmAsm
// 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.
|
|
|
|
// +build msan
|
|
|
|
#include "go_asm.h"
|
|
#include "textflag.h"
|
|
|
|
#define RARG0 R0
|
|
#define RARG1 R1
|
|
#define FARG R3
|
|
|
|
// func runtime·domsanread(addr unsafe.Pointer, sz uintptr)
|
|
// Called from msanread.
|
|
TEXT runtime·domsanread(SB), NOSPLIT, $0-16
|
|
MOVD addr+0(FP), RARG0
|
|
MOVD size+8(FP), RARG1
|
|
// void __msan_read_go(void *addr, uintptr_t sz);
|
|
MOVD $__msan_read_go(SB), FARG
|
|
JMP msancall<>(SB)
|
|
|
|
// func runtime·msanwrite(addr unsafe.Pointer, sz uintptr)
|
|
// Called from instrumented code.
|
|
TEXT runtime·msanwrite(SB), NOSPLIT, $0-16
|
|
MOVD addr+0(FP), RARG0
|
|
MOVD size+8(FP), RARG1
|
|
// void __msan_write_go(void *addr, uintptr_t sz);
|
|
MOVD $__msan_write_go(SB), FARG
|
|
JMP msancall<>(SB)
|
|
|
|
// func runtime·msanmalloc(addr unsafe.Pointer, sz uintptr)
|
|
TEXT runtime·msanmalloc(SB), NOSPLIT, $0-16
|
|
MOVD addr+0(FP), RARG0
|
|
MOVD size+8(FP), RARG1
|
|
// void __msan_malloc_go(void *addr, uintptr_t sz);
|
|
MOVD $__msan_malloc_go(SB), FARG
|
|
JMP msancall<>(SB)
|
|
|
|
// func runtime·msanfree(addr unsafe.Pointer, sz uintptr)
|
|
TEXT runtime·msanfree(SB), NOSPLIT, $0-16
|
|
MOVD addr+0(FP), RARG0
|
|
MOVD size+8(FP), RARG1
|
|
// void __msan_free_go(void *addr, uintptr_t sz);
|
|
MOVD $__msan_free_go(SB), FARG
|
|
JMP msancall<>(SB)
|
|
|
|
// Switches SP to g0 stack and calls (FARG). Arguments already set.
|
|
TEXT msancall<>(SB), NOSPLIT, $0-0
|
|
MOVD g_m(g), R10
|
|
MOVD m_g0(R10), R11
|
|
MOVD RSP, R19 // callee-saved
|
|
CMP R11, g
|
|
BEQ g0stack
|
|
|
|
MOVD (g_sched+gobuf_sp)(R11), R4
|
|
MOVD R4, RSP
|
|
|
|
g0stack:
|
|
BL (FARG)
|
|
MOVD R19, RSP
|
|
RET
|