aboutsummaryrefslogtreecommitdiffstats
path: root/sysgen
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2016-01-16 00:23:47 +0100
committerDmitry Vyukov <dvyukov@google.com>2016-01-16 00:23:47 +0100
commit9c277c79744a9cb6dd9174fccbde52b65803530f (patch)
tree97f005ac11dd47a702565687cbaffd8fffd328c0 /sysgen
parentb1f7eb0c307c7f098b07b5cc4d6012b269fe8b3b (diff)
sys: describe more dri syscalls
Diffstat (limited to 'sysgen')
-rw-r--r--sysgen/sysgen.go20
1 files changed, 17 insertions, 3 deletions
diff --git a/sysgen/sysgen.go b/sysgen/sysgen.go
index 6f5c9d727..669e617f5 100644
--- a/sysgen/sysgen.go
+++ b/sysgen/sysgen.go
@@ -160,6 +160,11 @@ func generateArg(name, typ string, a []string, structs map[string]Struct, unname
failf("wrong number of arguments for %v arg %v want %v, got %v", typ, name, want, len(a))
}
fmt.Fprintf(out, "ResourceType{%v, Kind: ResGid}", common())
+ case "drmctx":
+ if want := 0; len(a) != want {
+ failf("wrong number of arguments for %v arg %v want %v, got %v", typ, name, want, len(a))
+ }
+ fmt.Fprintf(out, "ResourceType{%v, Kind: ResDrmCtx}", common())
case "fileoff":
var size uint64
if isField {
@@ -303,7 +308,10 @@ func generateArg(name, typ string, a []string, structs map[string]Struct, unname
}
sz := "0"
if len(a) == 2 {
- sz = a[1]
+ sz = flagVals[a[1]]
+ if sz == "" {
+ sz = a[1]
+ }
}
fmt.Fprintf(out, "ArrayType{%v, Type: %v, Len: %v}", common(), generateType(a[0], structs, unnamed, flags, flagVals), sz)
case "ptr":
@@ -723,11 +731,17 @@ func parseType1(p *Parser, unnamed map[string][]string, flags map[string][]strin
}
p.Parse(']')
}
- if name == "const" && len(typ) == 2 {
+ if name == "const" && len(typ) > 1 {
+ // Create a fake flag with the const value.
+ id := fmt.Sprintf("const_flag_%v", constSeq)
+ constSeq++
+ flags[id] = typ[1:2]
+ }
+ if name == "array" && len(typ) > 2 {
// Create a fake flag with the const value.
id := fmt.Sprintf("const_flag_%v", constSeq)
constSeq++
- flags[id] = typ[1:]
+ flags[id] = typ[2:3]
}
return typ
}