2014-03-12 19:12:25 -06:00
|
|
|
// Copyright 2014 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 "../../cmd/ld/textflag.h"
|
|
|
|
|
|
|
|
// void runtime·memclr(void*, uintptr)
|
liblink, runtime: preliminary support for plan9/amd64
A TLS slot is reserved by _rt0_.*_plan9 as an automatic and
its address (which is static on Plan 9) is saved in the
global _privates symbol. The startup linkage now is exactly
like that from Plan 9 libc, and the way we access g is
exactly as if we'd have used privalloc(2).
Aside from making the code more standard, this change
drastically simplifies it, both for 386 and for amd64, and
makes the Plan 9 code in liblink common for both 386 and
amd64.
The amd64 runtime code was cleared of nxm assumptions, and
now runs on the standard Plan 9 kernel.
Note handling fixes will follow in a separate CL.
LGTM=rsc
R=golang-codereviews, rsc, bradfitz, dave
CC=0intro, ality, golang-codereviews, jas, minux.ma, mischief
https://golang.org/cl/101510049
2014-07-02 05:04:10 -06:00
|
|
|
TEXT runtime·memclr(SB),NOSPLIT,$0-16
|
|
|
|
MOVQ addr+0(FP), DI
|
|
|
|
MOVQ count+8(FP), CX
|
|
|
|
MOVQ CX, BX
|
|
|
|
ANDQ $7, BX
|
|
|
|
SHRQ $3, CX
|
|
|
|
MOVQ $0, AX
|
|
|
|
CLD
|
2014-03-12 19:12:25 -06:00
|
|
|
REP
|
|
|
|
STOSQ
|
liblink, runtime: preliminary support for plan9/amd64
A TLS slot is reserved by _rt0_.*_plan9 as an automatic and
its address (which is static on Plan 9) is saved in the
global _privates symbol. The startup linkage now is exactly
like that from Plan 9 libc, and the way we access g is
exactly as if we'd have used privalloc(2).
Aside from making the code more standard, this change
drastically simplifies it, both for 386 and for amd64, and
makes the Plan 9 code in liblink common for both 386 and
amd64.
The amd64 runtime code was cleared of nxm assumptions, and
now runs on the standard Plan 9 kernel.
Note handling fixes will follow in a separate CL.
LGTM=rsc
R=golang-codereviews, rsc, bradfitz, dave
CC=0intro, ality, golang-codereviews, jas, minux.ma, mischief
https://golang.org/cl/101510049
2014-07-02 05:04:10 -06:00
|
|
|
MOVQ BX, CX
|
|
|
|
REP
|
|
|
|
STOSB
|
2014-03-12 19:12:25 -06:00
|
|
|
RET
|