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"
66 hugepagesize="1 << 21"
84 defaultphyspagesize=65536
96 defaultphyspagesize=65536
107 mips | mipsle | mips64p32 | mips64p32le)
111 defaultphyspagesize=16384
125 defaultphyspagesize=16384
144 defaultphyspagesize=65536
152 defaultphyspagesize=65536
201 defaultphyspagesize=8192
208 defaultphyspagesize=8192
213 defaultphyspagesize=65536
216 echo 1>&2 "unrecognized goarch value \"$goarch\""
221 if test "$family" = "unknown"; then
222 echo 1>&2 "internal error: no family for goarch value \"$goarch\""
234 echo $defaultphyspagesize
258 echo 1>&2 "unrecognized keyword \"$keyword\""