First cut of formal ABI definition, so that the same definition can be

used to generate the function table in lsi as the header file which
code can include to get a matching ABI definition.
This commit is contained in:
2007-04-29 13:15:34 +00:00
parent bc76cfe623
commit 10ac321771
5 changed files with 142 additions and 68 deletions

50
src/lsi/makeabi Executable file
View File

@@ -0,0 +1,50 @@
#!/bin/sh
INFILE=$1
if [ "X${INFILE}" = "X" ]
then
echo "Usage: $0 abispec"
exit 1
fi
ABI=abi.c
HEADER=abi.lh
FNCOUNT=0
do_function()
{
echo " vm_intfn_${ARG1}," >>${ABI}
echo "fndefint ${ARG1} ${FNCOUNT};" >>${HEADER}
FNCOUNT=$((${FNCOUNT}+1))
}
cat <<EOF >${ABI}
/* abi.c */
/* autogenerated - do not edit */
#include "abi.h"
vm_intfn vm_intfn_table[] = {
EOF
cat <<EOF >${HEADER}
/* abi.lh */
/* autogenerated - do not edit */
EOF
while read TYPE ARG1 ARG2
do
case "$TYPE" in
function) do_function
;;
esac
done <${INFILE}
cat <<EOF >>${ABI}
};
const int vm_intfn_size = sizeof(vm_intfn_table) / sizeof(vm_intfn);
EOF