summaryrefslogtreecommitdiffstats
path: root/rtemsbsd/rtems/generate_kvm_symbols
blob: 8097c516f2edc0d54ba7df5799d781302e8d63f9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#! /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 <machine/rtems-bsd-kernel-space.h>

#include "kvm_private.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.
 */

const kvm_symval_t rtems_kvm_symbols[] = {
EOF
for sym in ${symbols}
do
  no_underscore=`echo $sym | sed -e 's/^_//' `
  echo "  { \"${sym}\", (uintptr_t) &${no_underscore} },"
done

cat <<EOF
  { "", 0 }
};
EOF