summaryrefslogtreecommitdiffstats
path: root/freebsd-userspace/rtems/generate_kvm_symbols
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2012-10-24 15:38:22 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2012-10-24 15:38:22 -0500
commit34e1fb2c5a0141161dcd1b5fb419e43cae20681e (patch)
treeb76f22996d80002c6d64ad08ac240012d9cb2d6f /freebsd-userspace/rtems/generate_kvm_symbols
parentTool patches: Add newlib patch needed (diff)
downloadrtems-libbsd-34e1fb2c5a0141161dcd1b5fb419e43cae20681e.tar.bz2
Add support for kvm.h in RTEMS terms
The implementation uses an array of strings and variable names. The names are weak symbolic references to the items we have seen calls to kvm services with.
Diffstat (limited to 'freebsd-userspace/rtems/generate_kvm_symbols')
-rwxr-xr-xfreebsd-userspace/rtems/generate_kvm_symbols108
1 files changed, 108 insertions, 0 deletions
diff --git a/freebsd-userspace/rtems/generate_kvm_symbols b/freebsd-userspace/rtems/generate_kvm_symbols
new file mode 100755
index 00000000..b26259c7
--- /dev/null
+++ b/freebsd-userspace/rtems/generate_kvm_symbols
@@ -0,0 +1,108 @@
+#! /bin/sh
+#
+# This file generates the symbol table for the kvm subsystem. The
+# table is limited to the ones we believe are needed.
+
+symbols=""
+while read sym
+do
+ symbols="${symbols} ${sym}"
+done <<EOF
+_ifnet
+_rtstat
+_rt_tables
+_mrtstat
+_mfchashtbl
+_viftable
+_ipxpcb_list
+_ipxstat
+_spx_istat
+_ddpstat
+_ddpcb
+_ngsocklist
+_ip6stat
+_icmp6stat
+_ipsec4stat
+_ipsec6stat
+_pim6stat
+_mrt6stat
+_mf6ctable
+_mif6table
+_pfkeystat
+_mbstat
+_mbtypes
+_nmbclusters
+_nmbufs
+_mbuf_hiwm
+_clust_hiwm
+_smp_cpus
+_pagesize
+_mb_statpcpu
+_rttrash
+_mbuf_lowm
+_clust_lowm
+_carpstats
+_pfsyncstats
+_ahstat
+_espstat
+_ipcompstat
+_tcpstat
+_udpstat
+_ipstat
+_icmpstat
+_igmpstat
+_pimstat
+_tcbinfo
+_udbinfo
+_divcbinfo
+_ripcbinfo
+_unp_count
+_unp_gencnt
+_unp_dhead
+_unp_shead
+_rip6stat
+_sctpstat
+_mfctablesize
+_arpstat
+EOF
+
+cat <<EOF
+/**** THIS FILE IS GENERATED BY A SCRIPT ****/
+
+/*
+ * This file contains the known list of symbols for the kvm subsystem.
+ */
+
+#include "kvm_private.h"
+#include "stdio.h"
+
+/*
+ * The following is the known list of symbols that may be passed
+ * to the kvm family of calls.
+ */
+
+EOF
+for sym in ${symbols}
+do
+ no_underscore=`echo $sym | sed -e 's/^_//' `
+ echo "extern int ${no_underscore} __attribute((weak));"
+done
+
+cat <<EOF
+/*
+ * The following is the known list of symbols that may be passed
+ * to the kvm family of calls.
+ */
+
+kvm_symval_t rtems_kvm_symbols[] = {
+EOF
+for sym in ${symbols}
+do
+ no_underscore=`echo $sym | sed -e 's/^_//' `
+ echo " { \"${sym}\", &${no_underscore} },"
+done
+
+cat <<EOF
+ { "", NULL }
+};
+EOF