aboutsummaryrefslogtreecommitdiffstats
path: root/xen/tools
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-06-17 07:14:02 +0100
committerKeir Fraser <keir.fraser@citrix.com>2009-06-17 07:14:02 +0100
commitc93bd0e6ea2a0295f56abd4e58cbb0761f299f0d (patch)
tree50c4f5c7d108184b48a19ba941d56973912990d1 /xen/tools
parentc133cc38e21d21f36ae62685e7e64d3e07542814 (diff)
downloadxen-c93bd0e6ea2a0295f56abd4e58cbb0761f299f0d.tar.gz
xen-c93bd0e6ea2a0295f56abd4e58cbb0761f299f0d.tar.bz2
xen-c93bd0e6ea2a0295f56abd4e58cbb0761f299f0d.zip
tmem: fix 32-on-64 support
This implicitly required coverting the tmem_op structure from anonymous to standard struct/union sub-fields, and extending the get-fields.sh helper script to deal with typedef-ed guest handles used as types of translated compound type fields. Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/tools')
-rw-r--r--xen/tools/get-fields.sh60
1 files changed, 58 insertions, 2 deletions
diff --git a/xen/tools/get-fields.sh b/xen/tools/get-fields.sh
index 2537fc49a1..9b2c61f1d0 100644
--- a/xen/tools/get-fields.sh
+++ b/xen/tools/get-fields.sh
@@ -34,6 +34,34 @@ get_fields ()
done
}
+get_typedefs ()
+{
+ local level=1 state=
+ for token in $1
+ do
+ case "$token" in
+ typedef)
+ test $level != 1 || state=1
+ ;;
+ COMPAT_HANDLE\(*\))
+ test $level != 1 -o "$state" != 1 || state=2
+ ;;
+ [\{\[])
+ level=$(expr $level + 1)
+ ;;
+ [\}\]])
+ level=$(expr $level - 1)
+ ;;
+ ";")
+ test $level != 1 || state=
+ ;;
+ [a-zA-Z_]*)
+ test $level != 1 -o "$state" != 2 || echo "$token"
+ ;;
+ esac
+ done
+}
+
build_enums ()
{
local level=1 kind= fields= members= named= id= token
@@ -166,7 +194,21 @@ for line in sys.stdin.readlines():
fi
;;
[a-zA-Z]*)
- id=$token
+ if [ -z "$id" -a -z "$type" -a -z "$array_type" ]
+ then
+ for id in $typedefs
+ do
+ test $id != "$token" || type=$id
+ done
+ if [ -z "$type" ]
+ then
+ id=$token
+ else
+ id=
+ fi
+ else
+ id=$token
+ fi
;;
[\,\;])
if [ $level = 2 -a -n "$(echo $id | $SED 's,^_pad[[:digit:]]*,,')" ]
@@ -281,6 +323,18 @@ build_body ()
if [ -n "$array" ]
then
array="$array $token"
+ elif [ -z "$id" -a -z "$type" -a -z "$array_type" ]
+ then
+ for id in $typedefs
+ do
+ test $id != "$token" || type=$id
+ done
+ if [ -z "$type" ]
+ then
+ id=$token
+ else
+ id=
+ fi
else
id=$token
fi
@@ -419,7 +473,8 @@ build_check ()
echo ""
}
-fields="$(get_fields $(echo $2 | $SED 's,^compat_xen,compat_,') "$($SED -e 's,^[[:space:]]#.*,,' -e 's!\([]\[,;:{}]\)! \1 !g' $3)")"
+list="$($SED -e 's,^[[:space:]]#.*,,' -e 's!\([]\[,;:{}]\)! \1 !g' $3)"
+fields="$(get_fields $(echo $2 | $SED 's,^compat_xen,compat_,') "$list")"
if [ -z "$fields" ]
then
echo "Fields of '$2' not found in '$3'" >&2
@@ -429,6 +484,7 @@ name=${2#compat_}
name=${name#xen}
case "$1" in
"!")
+ typedefs="$(get_typedefs "$list")"
build_enums $name "$fields"
build_body $name "$fields"
;;