summaryrefslogtreecommitdiffstats
path: root/rtemsbsd/rtems/generate_kvm_symbols
blob: 5be75664ff33025f3d516c9c29d5abc3146a391f (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
110
111
112
113
114
115
116
117
118
119
120
121
#! /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
_ahstat
_arpstat
_carpstats
_clust_hiwm
_clust_lowm
_ddpcb
_ddpstat
_divcbinfo
_espstat
_icmp6stat
_icmpstat
_ifnet
_igmpstat
_ip6stat
_ipcompstat
_ipsec4stat
_ipsec6stat
_ipstat
_ipxpcb_list
_ipxstat
_mbstat
_mb_statpcpu
_mbtypes
_mbuf_hiwm
_mbuf_lowm
_mf6ctable
_mfchashtbl
_mfctablesize
_mif6table
_mrt6stat
_mrtstat
_netisr_bindthreads
_netisr_defaultqlimit
_netisr_dispatch_policy
_netisr_maxprot
_netisr_maxqlimit
_netisr_maxthreads
_netisr_proto
_ngsocklist
_nmbclusters
_nmbufs
_nws
_nws_array
_nws_count
_pagesize
_pfkeystat
_pfsyncstats
_pim6stat
_pimstat
_rip6stat
_ripcbinfo
_rtree
_rtstat
_rt_tables
_rttrash
_sctpstat
_sfstat
_smp_cpus
_spx_istat
_tcbinfo
_tcps_states
_tcpstat
_udbinfo
_udpstat
_unp_count
_unp_dhead
_unp_gencnt
_unp_shead
_unp_sphead
_viftable
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
  echo "extern int _bsd${sym} __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
  echo "  { \"${sym}\", (uintptr_t) &_bsd${sym} },"
done

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