aboutsummaryrefslogtreecommitdiffstats
path: root/sys/openbsd
diff options
context:
space:
mode:
authorAnton Lindqvist <anton@basename.se>2019-08-11 14:53:38 +0200
committerDmitry Vyukov <dvyukov@google.com>2019-08-12 11:16:16 +0200
commit62d3ec4876c205e466ce15bd3c59fe1ea601bd10 (patch)
tree40ec77f50e719364db89c02589d398757d387a24 /sys/openbsd
parentacb51638141ff960f547431757130749bc176bc0 (diff)
sys/openbsd: add speaker descriptions
Diffstat (limited to 'sys/openbsd')
-rw-r--r--sys/openbsd/dev_speaker.txt20
-rw-r--r--sys/openbsd/dev_speaker_amd64.const6
-rw-r--r--sys/openbsd/gen/amd64.go25
3 files changed, 50 insertions, 1 deletions
diff --git a/sys/openbsd/dev_speaker.txt b/sys/openbsd/dev_speaker.txt
new file mode 100644
index 000000000..9da2c2253
--- /dev/null
+++ b/sys/openbsd/dev_speaker.txt
@@ -0,0 +1,20 @@
+# Copyright 2019 syzkaller project authors. All rights reserved.
+# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
+
+include <sys/param.h>
+include <sys/ioctl.h>
+include <sys/fcntl.h>
+
+include <dev/isa/spkrio.h>
+
+resource fd_speaker[fd]
+
+openat$speaker(fd const[AT_FDCWD], file ptr[in, string["/dev/speaker"]], flags flags[open_flags], mode const[0]) fd_speaker
+
+ioctl$SPKRTONE(fd fd_diskmap, cmd const[SPKRTONE], arg ptr[in, tone])
+ioctl$SPKRTUNE(fd fd_diskmap, cmd const[SPKRTUNE], arg ptr[in, tone])
+
+tone {
+ frequency int32
+ duration int32
+}
diff --git a/sys/openbsd/dev_speaker_amd64.const b/sys/openbsd/dev_speaker_amd64.const
new file mode 100644
index 000000000..15aae8d44
--- /dev/null
+++ b/sys/openbsd/dev_speaker_amd64.const
@@ -0,0 +1,6 @@
+# AUTOGENERATED FILE
+AT_FDCWD = 18446744073709551516
+SPKRTONE = 2148029185
+SPKRTUNE = 536892162
+SYS_ioctl = 54
+SYS_openat = 321
diff --git a/sys/openbsd/gen/amd64.go b/sys/openbsd/gen/amd64.go
index 3ff9c8dd3..bc00a0639 100644
--- a/sys/openbsd/gen/amd64.go
+++ b/sys/openbsd/gen/amd64.go
@@ -19,6 +19,7 @@ var resources_amd64 = []*ResourceDesc{
{Name: "fd_klog", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_klog"}, Values: []uint64{18446744073709551615, 18446744073709551516}},
{Name: "fd_kqueue", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_kqueue"}, Values: []uint64{18446744073709551615, 18446744073709551516}},
{Name: "fd_pci", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_pci"}, Values: []uint64{18446744073709551615, 18446744073709551516}},
+ {Name: "fd_speaker", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_speaker"}, Values: []uint64{18446744073709551615, 18446744073709551516}},
{Name: "fd_tty", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_tty"}, Values: []uint64{18446744073709551615, 18446744073709551516}},
{Name: "fd_vmm", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_vmm"}, Values: []uint64{18446744073709551615, 18446744073709551516}},
{Name: "fd_wsdisplay", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_wsdisplay"}, Values: []uint64{18446744073709551615, 18446744073709551516}},
@@ -471,6 +472,10 @@ var structDescs_amd64 = []*KeyedStruct{
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "sec", TypeSize: 8, ArgDir: 2}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "usec", TypeSize: 8, ArgDir: 2}}},
}}},
+ {Key: StructKey{Name: "tone"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "tone", TypeSize: 8}, Fields: []Type{
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "frequency", TypeSize: 4}}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "duration", TypeSize: 4}}},
+ }}},
{Key: StructKey{Name: "tstamps"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "tstamps", TypeSize: 8}, Fields: []Type{
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "set", TypeSize: 4}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "clr", TypeSize: 4}}},
@@ -1292,6 +1297,16 @@ var syscalls_amd64 = []*Syscall{
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 3222302723},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "arg", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "pci_io"}}},
}},
+ {NR: 54, Name: "ioctl$SPKRTONE", CallName: "ioctl", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_diskmap", FldName: "fd", TypeSize: 4}},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 2148029185},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "arg", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "tone"}}},
+ }},
+ {NR: 54, Name: "ioctl$SPKRTUNE", CallName: "ioctl", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_diskmap", FldName: "fd", TypeSize: 4}},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 536892162},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "arg", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "tone"}}},
+ }},
{NR: 54, Name: "ioctl$TIOCCBRK", CallName: "ioctl", MissingArgs: 1, Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd_tty", FldName: "fd", TypeSize: 4}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 536900730},
@@ -1873,6 +1888,12 @@ var syscalls_amd64 = []*Syscall{
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{0, 1, 2, 8, 512, 1024, 2048, 16, 32, 256, 65536, 128, 128, 128, 32768, 131072, 64}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 8}}},
}, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_pci", FldName: "ret", TypeSize: 4, ArgDir: 1}}},
+ {NR: 321, Name: "openat$speaker", CallName: "openat", Args: []Type{
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "fd", TypeSize: 8}}, Val: 18446744073709551516},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", TypeSize: 13}, Kind: 2, Values: []string{"/dev/speaker\x00"}}},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{0, 1, 2, 8, 512, 1024, 2048, 16, 32, 256, 65536, 128, 128, 128, 32768, 131072, 64}},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 8}}},
+ }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_speaker", FldName: "ret", TypeSize: 4, ArgDir: 1}}},
{NR: 321, Name: "openat$tty", CallName: "openat", Args: []Type{
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "fd", TypeSize: 8}}, Val: 18446744073709551516},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", TypeSize: 9}, Kind: 2, Values: []string{"/dev/tty\x00"}}},
@@ -2686,6 +2707,8 @@ var consts_amd64 = []ConstValue{
{Name: "SO_SNDTIMEO", Value: 4101},
{Name: "SO_TIMESTAMP", Value: 2048},
{Name: "SO_TYPE", Value: 4104},
+ {Name: "SPKRTONE", Value: 2148029185},
+ {Name: "SPKRTUNE", Value: 536892162},
{Name: "SYS_accept", Value: 30},
{Name: "SYS_bind", Value: 104},
{Name: "SYS_chdir", Value: 12},
@@ -3001,4 +3024,4 @@ var consts_amd64 = []ConstValue{
{Name: "__MAP_NOREPLACE", Value: 2048},
}
-const revision_amd64 = "33de16487cc0a0d25eaa32ea4166bbbc75d2994e"
+const revision_amd64 = "a3f9985253a0a8760aad5942057cf56e9fc5a5ed"