summaryrefslogblamecommitdiffstats
path: root/rtemsbsd/rtems/generate_kvm_symbols
blob: b26259c71d990b471cfe3c60b8f7330f0bff7c02 (plain) (tree)











































































































                                                                      
#! /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