blob: 2091a90dcaf8f5fe688d6f044e0b9549a98a9a8e [file] [log] [blame]
Bob Badour77c910d2021-06-07 22:20:50 -07001//
2// Copyright (C) 2021 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16package {
Alan Stokes87048612024-02-08 17:08:31 +000017 default_team: "trendy_team_virtualization",
Alan Stokes94475b82023-10-25 15:54:21 +010018 default_applicable_licenses: ["Android-Apache-2.0"],
Bob Badour77c910d2021-06-07 22:20:50 -070019}
Nikita Ioffe3973d382023-08-31 17:53:25 +010020
21soong_config_module_type {
22 name: "avf_flag_aware_rust_defaults",
23 module_type: "rust_defaults",
24 config_namespace: "ANDROID",
25 bool_variables: [
Nikita Ioffe94a8a182023-11-16 16:37:48 +000026 "release_avf_enable_device_assignment",
Alan Stokes7f27c0d2023-09-07 16:22:58 +010027 "release_avf_enable_dice_changes",
Shikha Panwar95084df2023-07-22 11:47:45 +000028 "release_avf_enable_llpvm_changes",
Nikita Ioffe3973d382023-08-31 17:53:25 +010029 "release_avf_enable_multi_tenant_microdroid_vm",
Alice Wange9ac2db2023-09-08 15:13:13 +000030 "release_avf_enable_remote_attestation",
Nikita Ioffe631717e2023-09-05 13:38:07 +010031 "release_avf_enable_vendor_modules",
David Daie6f5bb02024-01-25 19:17:02 -080032 "release_avf_enable_virt_cpufreq",
Nikita Ioffe3973d382023-08-31 17:53:25 +010033 ],
34 properties: [
35 "cfgs",
36 ],
37}
38
39avf_flag_aware_rust_defaults {
40 name: "avf_build_flags_rust",
41 soong_config_variables: {
Nikita Ioffe94a8a182023-11-16 16:37:48 +000042 release_avf_enable_device_assignment: {
43 cfgs: ["device_assignment"],
44 },
Alan Stokes7f27c0d2023-09-07 16:22:58 +010045 release_avf_enable_dice_changes: {
46 cfgs: ["dice_changes"],
47 },
Shikha Panwar95084df2023-07-22 11:47:45 +000048 release_avf_enable_llpvm_changes: {
49 cfgs: ["llpvm_changes"],
50 },
Nikita Ioffe3973d382023-08-31 17:53:25 +010051 release_avf_enable_multi_tenant_microdroid_vm: {
Alan Stokes27f3ef02023-09-29 15:09:35 +010052 cfgs: ["multi_tenant"],
Nikita Ioffe3973d382023-08-31 17:53:25 +010053 },
Alice Wange9ac2db2023-09-08 15:13:13 +000054 release_avf_enable_remote_attestation: {
55 cfgs: ["remote_attestation"],
56 },
Nikita Ioffe631717e2023-09-05 13:38:07 +010057 release_avf_enable_vendor_modules: {
58 cfgs: ["vendor_modules"],
59 },
David Daie6f5bb02024-01-25 19:17:02 -080060 release_avf_enable_virt_cpufreq: {
61 cfgs: ["virt_cpufreq"],
62 },
Nikita Ioffe3973d382023-08-31 17:53:25 +010063 },
64}
Jaewan Kim0df5fb12023-09-24 23:33:54 +090065
Nikita Ioffe38b9e712024-02-08 15:55:07 +000066soong_config_module_type {
67 name: "avf_flag_aware_cc_defaults",
68 module_type: "cc_defaults",
69 config_namespace: "ANDROID",
70 bool_variables: [
Nikita Ioffefd109532024-03-04 13:58:01 +000071 "release_avf_enable_dice_changes",
Nikita Ioffe38b9e712024-02-08 15:55:07 +000072 "release_avf_enable_virt_cpufreq",
73 ],
74 properties: [
75 "cflags",
76 ],
77}
78
79avf_flag_aware_cc_defaults {
80 name: "avf_build_flags_cc",
81 soong_config_variables: {
Nikita Ioffefd109532024-03-04 13:58:01 +000082 release_avf_enable_dice_changes: {
83 cflags: ["-DAVF_OPEN_DICE_CHANGES=1"],
84 },
Nikita Ioffe38b9e712024-02-08 15:55:07 +000085 release_avf_enable_virt_cpufreq: {
86 cflags: ["-DAVF_ENABLE_VIRT_CPUFREQ=1"],
87 },
88 },
89}
90
Jaewan Kim0df5fb12023-09-24 23:33:54 +090091genrule_defaults {
92 name: "dts_to_dtb",
93 tools: ["dtc"],
Jaewan Kima232ed02024-02-25 16:08:14 +000094 cmd: "FILES=($(in)) && $(location dtc) -@ -I dts -O dtb $${FILES[-1]} -o $(out)",
Jaewan Kim0df5fb12023-09-24 23:33:54 +090095}
Nikita Ioffee3a049f2024-02-15 15:47:23 +000096
97// This is a temporary workaround until b/309090563 is implemented.
98aconfig_declarations {
99 name: "avf_aconfig_flags",
100 package: "com.android.system.virtualmachine.flags",
101 srcs: [
102 "avf_flags.aconfig",
103 ],
104}
105
106java_aconfig_library {
107 name: "avf_aconfig_flags_java",
108 aconfig_declarations: "avf_aconfig_flags",
109 sdk_version: "module_current",
110 apex_available: ["com.android.virt"],
111}