blob: 4c38f6b6a8d3abceb3c2b9db608405afa0560bd0 (
plain) (
tree)
|
|
# -*- sh -*-
# See LICENSE file for copyright and license details.
#in this test, we are assuming that char is 8 bits
intsizes="8 16 32 64"
cat > $b <<.
8Little 0
16Little 0 8
32Little 0 8 16 24
64Little 0 8 16 24 32 40 48 56
8Big 0
16Big 8 0
32Big 24 16 8 0
64Big 56 48 40 32 24 16 8 0
.
byteorders="$(cat $b)"
getbyteorder () {
printf '%s\n' "$byteorders" | grep "^$1$2 " | cut -d ' ' -f 2-
}
sed '1,/LIST_ARCH_SPECS/d' < libsyscalls_get_datatype_description.c \
| sed '/#include/q' \
| sed 's/\(TO''DO\)\s*([^)]*)/\1/g' \
| sed -n 's/^\s*[A-Z_]\+(LIBSYSCALLS_ARCH_\([^)]*\)).*$/\1/p' \
| sed 's/,\s*/ /g' > $b
archinfo="$(cat $b)"
getbytesize () {
printf '%s\n' "$archinfo" | grep "^$1 " | cut -d ' ' -f 2
}
getaddrsize () {
printf '%s\n' "$archinfo" | grep "^$1 " | cut -d ' ' -f 3
}
getsizesize () {
printf '%s\n' "$archinfo" | grep "^$1 " | cut -d ' ' -f 4
}
getendian () {
printf '%s\n' "$archinfo" | grep "^$1 " | cut -d ' ' -f 5
}
getsign () {
printf '%s\n' "$archinfo" | grep "^$1 " | cut -d ' ' -f 6
}
|