From 132dcea0af0f14166783f0fd4b0df32bfb91f24a Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 18 Jan 2020 13:03:35 +0100 Subject: pkg/compiler: generate const[0] for flags w/o values Generate const[0] for flags without values and for flags with a single value which is 0. This is the intention in all existing cases (e.g. an enum with types of something, but there is really only 1 type exists). --- sys/linux/gen/amd64.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'sys/linux/gen/amd64.go') diff --git a/sys/linux/gen/amd64.go b/sys/linux/gen/amd64.go index 29a24f526..9ee939357 100644 --- a/sys/linux/gen/amd64.go +++ b/sys/linux/gen/amd64.go @@ -2683,7 +2683,7 @@ var structDescs_amd64 = []*KeyedStruct{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "provider_out_words", TypeSize: 2, ArgDir: 2}}, Val: 1}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd_hdr_reserved", TypeSize: 4, ArgDir: 2}}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "comp_mask", TypeSize: 4, ArgDir: 2}}}, - &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "wq_type", FldName: "wq_type", TypeSize: 4, ArgDir: 2}}, Vals: []uint64{0}, BitMask: true}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "wq_type", FldName: "wq_type", TypeSize: 4, ArgDir: 2}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "user_handle", TypeSize: 8, ArgDir: 2}}}, &ResourceType{TypeCommon: TypeCommon{TypeName: "pd_handle", FldName: "pd_handle", TypeSize: 4, ArgDir: 2}}, &ResourceType{TypeCommon: TypeCommon{TypeName: "cq_handle", FldName: "cq_handle", TypeSize: 4, ArgDir: 2}}, @@ -12703,7 +12703,7 @@ var structDescs_amd64 = []*KeyedStruct{ }}}, {Key: StructKey{Name: "kvm_setup_opt_feature"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "kvm_setup_opt_feature", TypeSize: 16}, Fields: []Type{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "typ", TypeSize: 8}}, Val: 1}, - &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "kvm_vcpu_features_arm64", FldName: "val", TypeSize: 8}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "kvm_vcpu_features_arm64", FldName: "val", TypeSize: 8}}}, }}}, {Key: StructKey{Name: "kvm_setup_opt_flags"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "kvm_setup_opt_flags", TypeSize: 16}, Fields: []Type{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "typ", TypeSize: 8}}, Val: 3}, @@ -13391,7 +13391,7 @@ var structDescs_amd64 = []*KeyedStruct{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cqe_size", TypeSize: 4, ArgDir: 2}}, Val: 64}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "cqe_comp_en", TypeSize: 1, ArgDir: 2}}, Kind: 1, RangeEnd: 1}, &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "mlx5_comp_cqe_res_format", FldName: "cqe_comp_res_format", TypeSize: 1, ArgDir: 2}}, Vals: []uint64{1, 2}, BitMask: true}, - &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "mlx5_create_cq_flags", FldName: "flags", TypeSize: 2, ArgDir: 2}}, Vals: []uint64{0}, BitMask: true}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "mlx5_create_cq_flags", FldName: "flags", TypeSize: 2, ArgDir: 2}}}, }}}, {Key: StructKey{Name: "mlx5_create_dv_qp_cmd", Dir: 2}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "mlx5_create_dv_qp_cmd", ArgDir: 2, IsVarlen: true}, Fields: []Type{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "command", TypeSize: 4, ArgDir: 2}}, Val: 24}, @@ -13495,7 +13495,7 @@ var structDescs_amd64 = []*KeyedStruct{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "provider_out_words", TypeSize: 2, ArgDir: 2}}, Val: 1}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd_hdr_reserved", TypeSize: 4, ArgDir: 2}}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "comp_mask", TypeSize: 4, ArgDir: 2}}}, - &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "wq_type", FldName: "wq_type", TypeSize: 4, ArgDir: 2}}, Vals: []uint64{0}, BitMask: true}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "wq_type", FldName: "wq_type", TypeSize: 4, ArgDir: 2}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "user_handle", TypeSize: 8, ArgDir: 2}}}, &ResourceType{TypeCommon: TypeCommon{TypeName: "pd_handle", FldName: "pd_handle", TypeSize: 4, ArgDir: 2}}, &ResourceType{TypeCommon: TypeCommon{TypeName: "cq_handle", FldName: "cq_handle", TypeSize: 4, ArgDir: 2}}, @@ -42663,15 +42663,15 @@ var structDescs_amd64 = []*KeyedStruct{ &ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "raw_data", TypeSize: 64, ArgDir: 2}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4, ArgDir: 2}}}, Kind: 1, RangeBegin: 16, RangeEnd: 16}, }}}, {Key: StructKey{Name: "v4l2_dv_timings", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "v4l2_dv_timings", TypeSize: 132, ArgDir: 1}, Fields: []Type{ - &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "v4l2_dv_timings_type", FldName: "type", TypeSize: 4, ArgDir: 1}}, Vals: []uint64{0}, BitMask: true}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "v4l2_dv_timings_type", FldName: "type", TypeSize: 4, ArgDir: 1}}}, &UnionType{Key: StructKey{Name: "v4l2_dv_timings_union", Dir: 1}, FldName: "union"}, }}}, {Key: StructKey{Name: "v4l2_dv_timings", Dir: 2}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "v4l2_dv_timings", TypeSize: 132, ArgDir: 2}, Fields: []Type{ - &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "v4l2_dv_timings_type", FldName: "type", TypeSize: 4, ArgDir: 2}}, Vals: []uint64{0}, BitMask: true}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "v4l2_dv_timings_type", FldName: "type", TypeSize: 4, ArgDir: 2}}}, &UnionType{Key: StructKey{Name: "v4l2_dv_timings_union", Dir: 2}, FldName: "union"}, }}}, {Key: StructKey{Name: "v4l2_dv_timings_cap", Dir: 2}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "v4l2_dv_timings_cap", TypeSize: 144, ArgDir: 2}, Fields: []Type{ - &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "v4l2_dv_timings_type", FldName: "type", TypeSize: 4, ArgDir: 2}}, Vals: []uint64{0}, BitMask: true}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "v4l2_dv_timings_type", FldName: "type", TypeSize: 4, ArgDir: 2}}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "pad", TypeSize: 4, ArgDir: 2}}}, &ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "reserved", TypeSize: 8, ArgDir: 2}, Type: &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", TypeSize: 4, ArgDir: 2}}}, Kind: 1, RangeBegin: 2, RangeEnd: 2}, &UnionType{Key: StructKey{Name: "v4l2_dv_timings_cap_u", Dir: 2}, FldName: "u"}, @@ -73753,4 +73753,4 @@ var consts_amd64 = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_amd64 = "b1385c2034cc0bcfde8a1cd1e08575f9d1e51071" +const revision_amd64 = "1c236e48879762fd8b99cc37ad8f10be76f5e996" -- cgit mrf-deployment