source: rtems-libbsd/create-kernel-namespace.sh @ d61f731

5-freebsd-12
Last change on this file since d61f731 was c40e45b, checked in by Sebastian Huber <sebastian.huber@…>, on Oct 7, 2016 at 1:10:20 PM

Update to FreeBSD head 2016-08-23

Git mirror commit 9fe7c416e6abb28b1398fd3e5687099846800cfd.

  • Property mode set to 100755
File size: 4.2 KB
Line 
1#!/bin/sh -x
2
3#
4# Copyright (c) 2016 embedded brains GmbH.  All rights reserved.
5#
6#  embedded brains GmbH
7#  Dornierstr. 4
8#  82178 Puchheim
9#  Germany
10#  <rtems@embedded-brains.de>
11#
12# Redistribution and use in source and binary forms, with or without
13# modification, are permitted provided that the following conditions
14# are met:
15# 1. Redistributions of source code must retain the above copyright
16#    notice, this list of conditions and the following disclaimer.
17# 2. Redistributions in binary form must reproduce the above copyright
18#    notice, this list of conditions and the following disclaimer in the
19#    documentation and/or other materials provided with the distribution.
20#
21# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
22# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
25# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31# SUCH DAMAGE.
32#
33
34#
35# This script generates the kernel namespace header file
36# <machine/rtems-bsd-kernel-namespace.h>.
37#
38
39objdump --syms `for i in build/*rtems* ; do \
40        find $i/freebsd/sys/ -name '*.o' ; \
41        echo $i/rtemsbsd/rtems/rtems-kernel-*.o ; \
42        done` \
43        | awk '/^[0-9a-f]+[[:blank:]]+g/ {print $6}' \
44        | sed 's/^_bsd_//' \
45        | sed '/^accept$/d' \
46        | sed '/^arc4random$/d' \
47        | sed '/^bind$/d' \
48        | sed '/^blackhole$/d' \
49        | sed '/^bpf_filter$/d' \
50        | sed '/^bpf_jitter$/d' \
51        | sed '/^bpf_jitter_enable$/d' \
52        | sed '/^bpf_validate$/d' \
53        | sed '/^connect$/d' \
54        | sed '/^drop_redirect$/d' \
55        | sed '/^drop_synfin$/d' \
56        | sed '/^free$/d' \
57        | sed '/^getentropy$/d' \
58        | sed '/^getpeername$/d' \
59        | sed '/^getsockname$/d' \
60        | sed '/^getsockopt$/d' \
61        | sed '/^ifqmaxlen$/d' \
62        | sed '/^in6addr_any$/d' \
63        | sed '/^in6addr_loopback$/d' \
64        | sed '/^in6addr_nodelocal_allnodes$/d' \
65        | sed '/^in6addr_linklocal_allnodes$/d' \
66        | sed '/^kevent$/d' \
67        | sed '/^kqueue$/d' \
68        | sed '/^listen$/d' \
69        | sed '/^malloc$/d' \
70        | sed '/^max_datalen$/d' \
71        | sed '/^max_hdr$/d' \
72        | sed '/^max_linkhdr$/d' \
73        | sed '/^max_protohdr$/d' \
74        | sed '/^maxsockets$/d' \
75        | sed '/^nd6_debug$/d' \
76        | sed '/^nd6_delay$/d' \
77        | sed '/^nd6_gctimer$/d' \
78        | sed '/^nd6_maxnudhint$/d' \
79        | sed '/^nd6_mmaxtries$/d' \
80        | sed '/^nd6_onlink_ns_rfc4861$/d' \
81        | sed '/^nd6_prune$/d' \
82        | sed '/^nd6_umaxtries$/d' \
83        | sed '/^nd6_useloopback$/d' \
84        | sed '/^nmbclusters$/d' \
85        | sed '/^nmbjumbo16$/d' \
86        | sed '/^nmbjumbo9$/d' \
87        | sed '/^nmbjumbop$/d' \
88        | sed '/^nmbufs$/d' \
89        | sed '/^nolocaltimewait$/d' \
90        | sed '/^path_mtu_discovery$/d' \
91        | sed '/^pause$/d' \
92        | sed '/^pf_osfp_entry_pl$/d' \
93        | sed '/^pf_osfp_pl$/d' \
94        | sed '/^pipe$/d' \
95        | sed '/^poll$/d' \
96        | sed '/^random$/d' \
97        | sed '/^realloc$/d' \
98        | sed '/^reallocf$/d' \
99        | sed '/^recvfrom$/d' \
100        | sed '/^recvmsg$/d' \
101        | sed '/^rtems/d' \
102        | sed '/^select$/d' \
103        | sed '/^sendmsg$/d' \
104        | sed '/^sendto$/d' \
105        | sed '/^setfib$/d' \
106        | sed '/^setsockopt$/d' \
107        | sed '/^shutdown$/d' \
108        | sed '/^socket$/d' \
109        | sed '/^socketpair$/d' \
110        | sed '/^soreceive_stream$/d' \
111        | sed '/^srandom$/d' \
112        | sed '/^strdup$/d' \
113        | sed '/^sysctlbyname$/d' \
114        | sed '/^sysctl$/d' \
115        | sed '/^sysctlnametomib$/d' \
116        | sed '/sys_init/d' \
117        | sed '/^taskqueue_/d' \
118        | sed '/^tcp_offload_listen_start$/d' \
119        | sed '/^tcp_offload_listen_stop$/d' \
120        | sed '/^ticks$/d' \
121        | sed '/^useloopback$/d' \
122        | sed '/^_Watchdog_Ticks_since_boot$/d' \
123        | sort -u > symbols.txt
124
125cat << eof > rtems-bsd-kernel-namespace.h
126#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_KERNEL_SPACE_H_
127#error "the header file <machine/rtems-bsd-kernel-space.h> must be included first"
128#endif
129
130eof
131sed 's/^\(.*\)/#define  \1 _bsd_\1/' < symbols.txt >> rtems-bsd-kernel-namespace.h
132rm symbols.txt
133mv rtems-bsd-kernel-namespace.h rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h
Note: See TracBrowser for help on using the repository browser.