aboutsummaryrefslogtreecommitdiffstats
path: root/sys/fuchsia
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-03-16 08:14:39 +0100
committerDmitry Vyukov <dvyukov@google.com>2020-03-17 21:19:13 +0100
commit1ea952c9ffd767584c60a91d6f6d8ca603817c50 (patch)
tree3a495458a9fed4e4bfc0488a34f65dde34b9eac0 /sys/fuchsia
parent8bec3911ad478b6fef8df96e4dc89f8080229133 (diff)
pkg/compiler: calculate more precise sizes for arguments
If we have: ioctl(fd fd, cmd int32) ioctl$FOO(fd fd, cmd const[FOO]) Currently we assume that cmd size in ioctl$FOO is sizeof(void*). However, we know that in ioctl it's specified as int32, so we can infer that the actual syscall size is 4. This massively reduces sizes of socket/setsockopt/getsockopt/ioctl and some other syscalls, which is good because we now use physical size in mutation/hints and some other places. This will also enable not morphing ioctl's into other ioctl's. Update #477 Update #502
Diffstat (limited to 'sys/fuchsia')
-rw-r--r--sys/fuchsia/gen/amd64.go6
-rw-r--r--sys/fuchsia/gen/arm64.go6
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/fuchsia/gen/amd64.go b/sys/fuchsia/gen/amd64.go
index 523755247..ee86c8229 100644
--- a/sys/fuchsia/gen/amd64.go
+++ b/sys/fuchsia/gen/amd64.go
@@ -7089,7 +7089,7 @@ var syscalls_amd64 = []*Syscall{
}},
{Name: "zx_thread_read_state$0", CallName: "zx_thread_read_state", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "zx_thread", FldName: "handle", TypeSize: 4}},
- &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "kind", TypeSize: 8}}},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "kind", TypeSize: 4}}},
&PtrType{TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, &ArrayType{TypeCommon{TypeName: "array", TypeSize: 144, ArgDir: 1}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 1}}}, 1, 18, 18}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "len", TypeSize: 8}}, BitSize: 8, Path: []string{"buffer"}},
}},
@@ -7108,7 +7108,7 @@ var syscalls_amd64 = []*Syscall{
}},
{Name: "zx_thread_write_state$0", CallName: "zx_thread_write_state", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "zx_thread", FldName: "handle", TypeSize: 4}},
- &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "kind", TypeSize: 8}}},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "kind", TypeSize: 4}}},
&PtrType{TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, &ArrayType{TypeCommon{TypeName: "array", TypeSize: 144}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8}}}, 1, 18, 18}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "len", TypeSize: 8}}, BitSize: 8, Path: []string{"buffer"}},
}},
@@ -7475,4 +7475,4 @@ var consts_amd64 = []ConstValue{
{Name: "fuchsia_power_Status_OK"},
}
-const revision_amd64 = "0246d352fea863da96a885f340a5b13a9b741cdd"
+const revision_amd64 = "01d1f2350d7c83f7ad219975ca337bfad4aaadf5"
diff --git a/sys/fuchsia/gen/arm64.go b/sys/fuchsia/gen/arm64.go
index 27a429b92..2db5fa3b4 100644
--- a/sys/fuchsia/gen/arm64.go
+++ b/sys/fuchsia/gen/arm64.go
@@ -7089,7 +7089,7 @@ var syscalls_arm64 = []*Syscall{
}},
{Name: "zx_thread_read_state$0", CallName: "zx_thread_read_state", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "zx_thread", FldName: "handle", TypeSize: 4}},
- &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "kind", TypeSize: 8}}},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "kind", TypeSize: 4}}},
&PtrType{TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, &ArrayType{TypeCommon{TypeName: "array", TypeSize: 144, ArgDir: 1}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 1}}}, 1, 18, 18}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "len", TypeSize: 8}}, BitSize: 8, Path: []string{"buffer"}},
}},
@@ -7108,7 +7108,7 @@ var syscalls_arm64 = []*Syscall{
}},
{Name: "zx_thread_write_state$0", CallName: "zx_thread_write_state", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "zx_thread", FldName: "handle", TypeSize: 4}},
- &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "kind", TypeSize: 8}}},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "kind", TypeSize: 4}}},
&PtrType{TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, &ArrayType{TypeCommon{TypeName: "array", TypeSize: 144}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8}}}, 1, 18, 18}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "len", TypeSize: 8}}, BitSize: 8, Path: []string{"buffer"}},
}},
@@ -7475,4 +7475,4 @@ var consts_arm64 = []ConstValue{
{Name: "fuchsia_power_Status_OK"},
}
-const revision_arm64 = "8269e2f2a47f7746691962e284c4299cfe4bcae7"
+const revision_arm64 = "0b12855de96876bdb3b2df33f3a3debcd9f74b2c"