3 # Copyright 2018 The Go Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style
5 # license that can be found in the LICENSE file.
7 # Code in Makefile.am will invoke this script with two arguments.
8 # The first is a GOARCH value. The second is a keyword.
9 # The script will print the value of that keyword for that GOARCH.
11 # - bigendian: true or false
12 # - cachelinesize: the cache line size in bytes
13 # (for performance only; it's not essential to get this right)
14 # - defaultphyspagesize: the default physical page size in bytes
15 # (not currently used, but maybe some day)
16 # - family: the processor family, from ALLGOARCHFAMILY in configure.ac
17 # - hugepagesize: size of a huge page in bytes
18 # (used only to decide when to use madvise with MADV_[NO]HUGEPAGE)
19 # (set to 0 if there are no huge pages)
20 # - int64align: alignment of int64 type in bytes
21 # - maxalign: maximum alignment of values of Go types in bytes
22 # - minframesize: size of smallest possible function frame in bytes
23 # (not currently used, may never be used)
24 # - pcquantum: minimum size of a single instruction in bytes
25 # - ptrsize: size of a pointer in bytes
27 if test $# -ne 2; then
28 echo 1>&2 "usage: goarch <goarch> <keyword>"
38 defaultphyspagesize
=4096
50 hugepagesize
="1 << 21"
57 defaultphyspagesize=8192
62 hugepagesize="1 << 21"
79 defaultphyspagesize=65536
91 defaultphyspagesize=65536
102 mips | mipsle | mips64p32 | mips64p32le)
106 defaultphyspagesize=16384
120 defaultphyspagesize=16384
132 defaultphyspagesize=65536
140 defaultphyspagesize=65536
180 defaultphyspagesize=8192
187 defaultphyspagesize=8192
191 echo 1>&2 "unrecognized goarch value \"$goarch\""
196 if test "$family" = "unknown"; then
197 echo 1>&2 "internal error: no family for goarch value \"$goarch\""
209 echo $defaultphyspagesize
233 echo 1>&2 "unrecognized keyword \"$keyword\""