blob: 90ec8cc7d0972e0d7c792733cde1bd7e960f2b88 [file] [log] [blame]
// 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.
// TODO #include "../../cmd/ld/textflag.h"
#define NOSPLIT 4
// Functions that return details about our address space.
// They use the C-defined symbols like edata and also know
// a little about the heap and memory layout.
// From the linker. Well-known but might change.
// TODO: Is there a better way to know this?
#define INITTEXT 0x2000
// base of the address space.
TEXT ·base(SB), NOSPLIT, $0
// end of the text segment.
TEXT ·etext(SB), NOSPLIT, $0
LEAQ etext+0(SB), BX
MOVQ BX, ret+0(FP)
// end of the data segment.
TEXT ·edata(SB), NOSPLIT, $0
LEAQ edata+0(SB), BX
MOVQ BX, ret+0(FP)
// end of the pre-defined address space.
TEXT ·end(SB), NOSPLIT, $0
LEAQ end+0(SB), BX
MOVQ BX, ret+0(FP)