Skip to content
Permalink
Browse files

pkg/compiler: add vma64 type

8-byte vma is needed in several places in linux descriptions.
  • Loading branch information...
dvyukov committed Nov 17, 2018
1 parent 993f4bb commit d8004ff2dc60902bdee1eea0ccc4ffaa04dc1e45
Showing with 13 additions and 2 deletions.
  1. +2 −1 docs/syscall_descriptions_syntax.md
  2. +7 −0 pkg/compiler/testdata/all.txt
  3. +4 −1 pkg/compiler/types.go
@@ -52,8 +52,9 @@ rest of the type-options are type-specific:
argname of the object
"bitsize": similar to "len", but always denotes the size in bits, type-options:
argname of the object
"vma": a pointer to a set of pages (used as input for mmap/munmap/mremap/madvise), type-options:
"vma"/"vma64": a pointer to a set of pages (used as input for mmap/munmap/mremap/madvise), type-options:
optional number of pages (e.g. vma[7]), or a range of pages (e.g. vma[2-4])
vma64 has size of 8 bytes regardless of target pointer size
"proc": per process int (see description below), type-options:
value range start, how many values per process, underlying type
"text": machine code of the specified type, type-options:
@@ -68,6 +68,13 @@ foo$len_templ(a ptr[in, len_templ1[int8, int16]])
foo$len_var0(a ptr[in, array[string]], b len[a])
foo$len_var1(a ptr[in, array[string]], b ptr[in, len[a, int32]])

# Pointer type.

foo$ptr(a ptr[in, int64])
foo$ptr64(a ptr64[in, int64])
foo$vma(a vma)
foo$vma64(a vma64)

# Void type.

void0 {
@@ -288,7 +288,7 @@ var typeFileoff = &typeDesc{
}

var typeVMA = &typeDesc{
Names: []string{"vma"},
Names: []string{"vma", "vma64"},
CanBeArgRet: canBeArg,
OptArgs: 1,
Args: []namedArg{{Name: "size range", Type: typeArgSizeRange}},
@@ -298,6 +298,9 @@ var typeVMA = &typeDesc{
begin, end = args[0].Value, args[0].Value2
}
base.TypeSize = comp.ptrSize
if t.Ident == "vma64" {
base.TypeSize = 8
}
return &prog.VmaType{
TypeCommon: base.TypeCommon,
RangeBegin: begin,

0 comments on commit d8004ff

Please sign in to comment.
You can’t perform that action at this time.