From 62d3ec4876c205e466ce15bd3c59fe1ea601bd10 Mon Sep 17 00:00:00 2001 From: Anton Lindqvist Date: Sun, 11 Aug 2019 14:53:38 +0200 Subject: sys/openbsd: add speaker descriptions --- sys/openbsd/dev_speaker.txt | 20 ++++++++++++++++++++ sys/openbsd/dev_speaker_amd64.const | 6 ++++++ sys/openbsd/gen/amd64.go | 25 ++++++++++++++++++++++++- 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 sys/openbsd/dev_speaker.txt create mode 100644 sys/openbsd/dev_speaker_amd64.const (limited to 'sys') 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 +include +include + +include + +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" -- cgit mrf-deployment