162306a36Sopenharmony_ci#!/bin/sh
262306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
362306a36Sopenharmony_ciout="$1"
462306a36Sopenharmony_cishift
562306a36Sopenharmony_ciin="$@"
662306a36Sopenharmony_ci
762306a36Sopenharmony_cifor i in $in; do
862306a36Sopenharmony_ci	eval $CPP $LINUXINCLUDE -dD -imacros "$i" -x c /dev/null
962306a36Sopenharmony_cidone | \
1062306a36Sopenharmony_ciawk '$1 == "#define" && $2 ~ /__HYPERVISOR_[a-z][a-z_0-9]*/ { v[$3] = $2 }
1162306a36Sopenharmony_ci	END {   print "/* auto-generated by scripts/xen-hypercall.sh */"
1262306a36Sopenharmony_ci		for (i in v) if (!(v[i] in v))
1362306a36Sopenharmony_ci			print "HYPERCALL("substr(v[i], 14)")"}' | sort -u >$out
14