aboutsummaryrefslogtreecommitdiff
path: root/scripts/common
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/common')
-rw-r--r--scripts/common11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/common b/scripts/common
index 68938be..25c0412 100644
--- a/scripts/common
+++ b/scripts/common
@@ -13,6 +13,9 @@
tmp_files=()
tmp_dirs=()
+# Highest valid phandle. Will be decremented with each call to get_next_phandle
+phandle_next="0xfffffffe"
+
function remove_tmp_files()
{
for i in "${tmp_files[@]}"
@@ -26,6 +29,14 @@ function remove_tmp_files()
done
}
+# Get next phandle and set it as a value (in hex) of a variable whose name is
+# passed as a first argument. Decrement global counter phandle_next.
+function get_next_phandle()
+{
+ eval "$1=$(printf "0x%x" $phandle_next)"
+ phandle_next=$(( $phandle_next - 1 ))
+}
+
function sanity_check_partial_dts()
{
local domU_passthrough_path="$1"