Bob Badour | 77c910d | 2021-06-07 22:20:50 -0700 | [diff] [blame] | 1 | // |
| 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 | |
| 16 | package { |
Alan Stokes | 8704861 | 2024-02-08 17:08:31 +0000 | [diff] [blame] | 17 | default_team: "trendy_team_virtualization", |
Alan Stokes | 94475b8 | 2023-10-25 15:54:21 +0100 | [diff] [blame] | 18 | default_applicable_licenses: ["Android-Apache-2.0"], |
Bob Badour | 77c910d | 2021-06-07 22:20:50 -0700 | [diff] [blame] | 19 | } |
Nikita Ioffe | 3973d38 | 2023-08-31 17:53:25 +0100 | [diff] [blame] | 20 | |
| 21 | soong_config_module_type { |
| 22 | name: "avf_flag_aware_rust_defaults", |
| 23 | module_type: "rust_defaults", |
| 24 | config_namespace: "ANDROID", |
| 25 | bool_variables: [ |
Nikita Ioffe | 94a8a18 | 2023-11-16 16:37:48 +0000 | [diff] [blame] | 26 | "release_avf_enable_device_assignment", |
Alan Stokes | 7f27c0d | 2023-09-07 16:22:58 +0100 | [diff] [blame] | 27 | "release_avf_enable_dice_changes", |
Shikha Panwar | 95084df | 2023-07-22 11:47:45 +0000 | [diff] [blame] | 28 | "release_avf_enable_llpvm_changes", |
Nikita Ioffe | 3973d38 | 2023-08-31 17:53:25 +0100 | [diff] [blame] | 29 | "release_avf_enable_multi_tenant_microdroid_vm", |
Alice Wang | e9ac2db | 2023-09-08 15:13:13 +0000 | [diff] [blame] | 30 | "release_avf_enable_remote_attestation", |
Nikita Ioffe | 631717e | 2023-09-05 13:38:07 +0100 | [diff] [blame] | 31 | "release_avf_enable_vendor_modules", |
David Dai | e6f5bb0 | 2024-01-25 19:17:02 -0800 | [diff] [blame] | 32 | "release_avf_enable_virt_cpufreq", |
Nikita Ioffe | 3973d38 | 2023-08-31 17:53:25 +0100 | [diff] [blame] | 33 | ], |
| 34 | properties: [ |
| 35 | "cfgs", |
| 36 | ], |
| 37 | } |
| 38 | |
| 39 | avf_flag_aware_rust_defaults { |
| 40 | name: "avf_build_flags_rust", |
| 41 | soong_config_variables: { |
Nikita Ioffe | 94a8a18 | 2023-11-16 16:37:48 +0000 | [diff] [blame] | 42 | release_avf_enable_device_assignment: { |
| 43 | cfgs: ["device_assignment"], |
| 44 | }, |
Alan Stokes | 7f27c0d | 2023-09-07 16:22:58 +0100 | [diff] [blame] | 45 | release_avf_enable_dice_changes: { |
| 46 | cfgs: ["dice_changes"], |
| 47 | }, |
Shikha Panwar | 95084df | 2023-07-22 11:47:45 +0000 | [diff] [blame] | 48 | release_avf_enable_llpvm_changes: { |
| 49 | cfgs: ["llpvm_changes"], |
| 50 | }, |
Nikita Ioffe | 3973d38 | 2023-08-31 17:53:25 +0100 | [diff] [blame] | 51 | release_avf_enable_multi_tenant_microdroid_vm: { |
Alan Stokes | 27f3ef0 | 2023-09-29 15:09:35 +0100 | [diff] [blame] | 52 | cfgs: ["multi_tenant"], |
Nikita Ioffe | 3973d38 | 2023-08-31 17:53:25 +0100 | [diff] [blame] | 53 | }, |
Alice Wang | e9ac2db | 2023-09-08 15:13:13 +0000 | [diff] [blame] | 54 | release_avf_enable_remote_attestation: { |
| 55 | cfgs: ["remote_attestation"], |
| 56 | }, |
Nikita Ioffe | 631717e | 2023-09-05 13:38:07 +0100 | [diff] [blame] | 57 | release_avf_enable_vendor_modules: { |
| 58 | cfgs: ["vendor_modules"], |
| 59 | }, |
David Dai | e6f5bb0 | 2024-01-25 19:17:02 -0800 | [diff] [blame] | 60 | release_avf_enable_virt_cpufreq: { |
| 61 | cfgs: ["virt_cpufreq"], |
| 62 | }, |
Nikita Ioffe | 3973d38 | 2023-08-31 17:53:25 +0100 | [diff] [blame] | 63 | }, |
| 64 | } |
Jaewan Kim | 0df5fb1 | 2023-09-24 23:33:54 +0900 | [diff] [blame] | 65 | |
Nikita Ioffe | 38b9e71 | 2024-02-08 15:55:07 +0000 | [diff] [blame] | 66 | soong_config_module_type { |
| 67 | name: "avf_flag_aware_cc_defaults", |
| 68 | module_type: "cc_defaults", |
| 69 | config_namespace: "ANDROID", |
| 70 | bool_variables: [ |
| 71 | "release_avf_enable_virt_cpufreq", |
| 72 | ], |
| 73 | properties: [ |
| 74 | "cflags", |
| 75 | ], |
| 76 | } |
| 77 | |
| 78 | avf_flag_aware_cc_defaults { |
| 79 | name: "avf_build_flags_cc", |
| 80 | soong_config_variables: { |
| 81 | release_avf_enable_virt_cpufreq: { |
| 82 | cflags: ["-DAVF_ENABLE_VIRT_CPUFREQ=1"], |
| 83 | }, |
| 84 | }, |
| 85 | } |
| 86 | |
Jaewan Kim | 0df5fb1 | 2023-09-24 23:33:54 +0900 | [diff] [blame] | 87 | genrule_defaults { |
| 88 | name: "dts_to_dtb", |
| 89 | tools: ["dtc"], |
Jaewan Kim | a232ed0 | 2024-02-25 16:08:14 +0000 | [diff] [blame] | 90 | cmd: "FILES=($(in)) && $(location dtc) -@ -I dts -O dtb $${FILES[-1]} -o $(out)", |
Jaewan Kim | 0df5fb1 | 2023-09-24 23:33:54 +0900 | [diff] [blame] | 91 | } |
Nikita Ioffe | e3a049f | 2024-02-15 15:47:23 +0000 | [diff] [blame] | 92 | |
| 93 | // This is a temporary workaround until b/309090563 is implemented. |
| 94 | aconfig_declarations { |
| 95 | name: "avf_aconfig_flags", |
| 96 | package: "com.android.system.virtualmachine.flags", |
| 97 | srcs: [ |
| 98 | "avf_flags.aconfig", |
| 99 | ], |
| 100 | } |
| 101 | |
| 102 | java_aconfig_library { |
| 103 | name: "avf_aconfig_flags_java", |
| 104 | aconfig_declarations: "avf_aconfig_flags", |
| 105 | sdk_version: "module_current", |
| 106 | apex_available: ["com.android.virt"], |
| 107 | } |