summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore82
-rw-r--r--Makefile1736
-rw-r--r--config.inc5
-rwxr-xr-xfreebsd-to-rtems.py2967
-rw-r--r--freebsd-userspace/Makefile357
-rw-r--r--freebsd-userspace/README11
-rw-r--r--freebsd-userspace/commands/sbin/dhclient/dhclient-script384
-rw-r--r--freebsd-userspace/commands/sbin/dhclient/dhclient-script.8297
-rw-r--r--freebsd-userspace/commands/sbin/dhclient/dhclient.8191
-rw-r--r--freebsd-userspace/commands/sbin/dhclient/dhclient.conf39
-rw-r--r--freebsd-userspace/commands/sbin/dhclient/dhclient.conf.5544
-rw-r--r--freebsd-userspace/commands/sbin/dhclient/dhclient.leases.595
-rw-r--r--freebsd-userspace/commands/sbin/dhclient/dhcp-options.5606
-rw-r--r--freebsd-userspace/commands/sbin/ifconfig/af_ipx.c122
-rw-r--r--freebsd-userspace/commands/sbin/ifconfig/ifconfig.82555
-rw-r--r--freebsd-userspace/commands/sbin/ifconfig/regdomain.c705
-rw-r--r--freebsd-userspace/commands/sbin/ping/ping.8554
-rw-r--r--freebsd-userspace/commands/sbin/ping6/ping6.8532
-rw-r--r--freebsd-userspace/commands/sbin/route/route.8411
-rw-r--r--freebsd-userspace/commands/usr.bin/netstat/ipx.c354
-rw-r--r--freebsd-userspace/commands/usr.bin/netstat/netgraph.c196
-rw-r--r--freebsd-userspace/commands/usr.bin/netstat/netstat.1523
-rwxr-xr-xfreebsd-userspace/from-freebsd.sh288
-rw-r--r--freebsd-userspace/include/net/in.h2
-rw-r--r--freebsd-userspace/lib/libc/gen/err.3233
-rw-r--r--freebsd-userspace/lib/libc/net/Makefile12
-rw-r--r--freebsd-userspace/lib/libc/net/nsparser.h14
-rw-r--r--freebsd-userspace/lib/libc/stdio/fgetln.3125
-rw-r--r--freebsd-userspace/lib/libc/stdlib/strtonum.3155
-rw-r--r--freebsd-userspace/lib/libc_r/uthread/uthread_kern.c1157
-rw-r--r--freebsd-userspace/lib/libc_r/uthread/uthread_select.c240
-rw-r--r--freebsd-userspace/lib/libipsec/Makefile11
-rw-r--r--freebsd-userspace/lib/libipsec/ipsec_set_policy.3332
-rw-r--r--freebsd-userspace/lib/libipsec/ipsec_strerror.390
-rw-r--r--freebsd-userspace/lib/libipsec/test-policy.c334
-rw-r--r--freebsd-userspace/lib/libkvm/kvm.3120
-rw-r--r--freebsd-userspace/lib/libkvm/kvm_getcptime.377
-rw-r--r--freebsd-userspace/lib/libkvm/kvm_geterr.378
-rw-r--r--freebsd-userspace/lib/libkvm/kvm_getfiles.387
-rw-r--r--freebsd-userspace/lib/libkvm/kvm_getloadavg.362
-rw-r--r--freebsd-userspace/lib/libkvm/kvm_getpcpu.3101
-rw-r--r--freebsd-userspace/lib/libkvm/kvm_getprocs.3181
-rw-r--r--freebsd-userspace/lib/libkvm/kvm_getswapinfo.3111
-rw-r--r--freebsd-userspace/lib/libkvm/kvm_nlist.385
-rw-r--r--freebsd-userspace/lib/libkvm/kvm_open.3205
-rw-r--r--freebsd-userspace/lib/libkvm/kvm_read.392
-rw-r--r--freebsd-userspace/lib/libmemstat/libmemstat.3496
-rw-r--r--freebsd-userspace/lib/libutil/expand_number.386
-rw-r--r--freebsd-userspace/lib/libutil/humanize_number.3157
-rw-r--r--freebsd-userspace/lib/libutil/trimdomain.385
-rw-r--r--freebsd-userspace/local/pthread_np.h2
-rw-r--r--freebsd-userspace/rtems/include/freebsd/stdint.h1
-rw-r--r--freebsd-userspace/rtems/include/isc/app.h212
-rw-r--r--freebsd-userspace/rtems/include/isc/assertions.h120
-rw-r--r--freebsd-userspace/rtems/include/isc/boolean.h29
-rw-r--r--freebsd-userspace/rtems/include/isc/buffer.h800
-rw-r--r--freebsd-userspace/rtems/include/isc/dst.h0
-rw-r--r--freebsd-userspace/rtems/include/isc/error.h55
-rw-r--r--freebsd-userspace/rtems/include/isc/formatcheck.h34
-rw-r--r--freebsd-userspace/rtems/include/isc/int.h53
-rw-r--r--freebsd-userspace/rtems/include/isc/interfaceiter.h139
-rw-r--r--freebsd-userspace/rtems/include/isc/ipv6.h155
-rw-r--r--freebsd-userspace/rtems/include/isc/lang.h31
-rw-r--r--freebsd-userspace/rtems/include/isc/lib.h39
-rw-r--r--freebsd-userspace/rtems/include/isc/magic.h40
-rw-r--r--freebsd-userspace/rtems/include/isc/mem.h31
-rw-r--r--freebsd-userspace/rtems/include/isc/msgcat.h132
-rw-r--r--freebsd-userspace/rtems/include/isc/msgs.h183
-rw-r--r--freebsd-userspace/rtems/include/isc/mutex.h39
-rw-r--r--freebsd-userspace/rtems/include/isc/net.h329
-rw-r--r--freebsd-userspace/rtems/include/isc/netaddr.h149
-rw-r--r--freebsd-userspace/rtems/include/isc/netscope.h40
-rw-r--r--freebsd-userspace/rtems/include/isc/offset.h44
-rw-r--r--freebsd-userspace/rtems/include/isc/once.h32
-rw-r--r--freebsd-userspace/rtems/include/isc/print.h69
-rw-r--r--freebsd-userspace/rtems/include/isc/region.h95
-rw-r--r--freebsd-userspace/rtems/include/isc/result.h106
-rw-r--r--freebsd-userspace/rtems/include/isc/sockaddr.h202
-rw-r--r--freebsd-userspace/rtems/include/isc/strerror.h42
-rw-r--r--freebsd-userspace/rtems/include/isc/string.h56
-rw-r--r--freebsd-userspace/rtems/include/isc/types.h102
-rw-r--r--freebsd-userspace/rtems/include/isc/util.h225
-rw-r--r--freebsd-userspace/rtems/include/pthread_private.h158
-rw-r--r--freebsd-userspace/rtems/rtems-get_curthread.c72
-rw-r--r--freebsd-userspace/rtems/rtems-uthread_init.c8
-rw-r--r--freebsd-userspace/sys/net/ethernet.h405
-rw-r--r--freebsd/include/arpa/inet.h2
-rw-r--r--freebsd/include/arpa/nameser.h4
-rw-r--r--freebsd/include/arpa/nameser_compat.h2
-rw-r--r--freebsd/include/db.h2
-rw-r--r--freebsd/include/err.h7
-rw-r--r--freebsd/include/netdb.h2
-rw-r--r--freebsd/include/nsswitch.h2
-rw-r--r--freebsd/include/res_update.h2
-rw-r--r--freebsd/include/resolv.h4
-rw-r--r--freebsd/include/rpcsvc/nis_db.h135
-rw-r--r--freebsd/include/rpcsvc/nis_tags.h137
-rw-r--r--freebsd/include/rpcsvc/nislib.h188
-rw-r--r--freebsd/include/rpcsvc/yp_prot.h329
-rw-r--r--freebsd/include/rpcsvc/ypclnt.h93
-rw-r--r--freebsd/kern/kern_condvar.c455
-rw-r--r--freebsd/lib/libc/db/btree/bt_close.c2
-rw-r--r--freebsd/lib/libc/db/btree/bt_conv.c2
-rw-r--r--freebsd/lib/libc/db/btree/bt_debug.c2
-rw-r--r--freebsd/lib/libc/db/btree/bt_delete.c2
-rw-r--r--freebsd/lib/libc/db/btree/bt_get.c2
-rw-r--r--freebsd/lib/libc/db/btree/bt_open.c2
-rw-r--r--freebsd/lib/libc/db/btree/bt_overflow.c2
-rw-r--r--freebsd/lib/libc/db/btree/bt_page.c2
-rw-r--r--freebsd/lib/libc/db/btree/bt_put.c2
-rw-r--r--freebsd/lib/libc/db/btree/bt_search.c2
-rw-r--r--freebsd/lib/libc/db/btree/bt_seq.c2
-rw-r--r--freebsd/lib/libc/db/btree/bt_split.c2
-rw-r--r--freebsd/lib/libc/db/btree/bt_utils.c2
-rw-r--r--freebsd/lib/libc/db/db/db.c9
-rw-r--r--freebsd/lib/libc/db/mpool/mpool.c2
-rw-r--r--freebsd/lib/libc/db/recno/rec_close.c2
-rw-r--r--freebsd/lib/libc/db/recno/rec_delete.c2
-rw-r--r--freebsd/lib/libc/db/recno/rec_get.c2
-rw-r--r--freebsd/lib/libc/db/recno/rec_open.c2
-rw-r--r--freebsd/lib/libc/db/recno/rec_put.c2
-rw-r--r--freebsd/lib/libc/db/recno/rec_search.c2
-rw-r--r--freebsd/lib/libc/db/recno/rec_seq.c2
-rw-r--r--freebsd/lib/libc/db/recno/rec_utils.c2
-rw-r--r--freebsd/lib/libc/gen/gethostname.c2
-rw-r--r--freebsd/lib/libc/include/isc/eventlib.h4
-rw-r--r--freebsd/lib/libc/include/isc/platform.h51
-rw-r--r--freebsd/lib/libc/include/libc_private.h6
-rw-r--r--freebsd/lib/libc/include/port_before.h39
-rw-r--r--freebsd/lib/libc/include/resolv_mt.h2
-rw-r--r--freebsd/lib/libc/include/spinlock.h2
-rw-r--r--freebsd/lib/libc/inet/inet_addr.c4
-rw-r--r--freebsd/lib/libc/inet/inet_cidr_ntop.c2
-rw-r--r--freebsd/lib/libc/inet/inet_cidr_pton.c2
-rw-r--r--freebsd/lib/libc/inet/inet_lnaof.c2
-rw-r--r--freebsd/lib/libc/inet/inet_makeaddr.c2
-rw-r--r--freebsd/lib/libc/inet/inet_net_ntop.c2
-rw-r--r--freebsd/lib/libc/inet/inet_net_pton.c2
-rw-r--r--freebsd/lib/libc/inet/inet_neta.c2
-rw-r--r--freebsd/lib/libc/inet/inet_netof.c2
-rw-r--r--freebsd/lib/libc/inet/inet_network.c2
-rw-r--r--freebsd/lib/libc/inet/inet_ntoa.c2
-rw-r--r--freebsd/lib/libc/inet/inet_ntop.c4
-rw-r--r--freebsd/lib/libc/inet/inet_pton.c4
-rw-r--r--freebsd/lib/libc/inet/nsap_addr.c4
-rw-r--r--freebsd/lib/libc/isc/ev_streams.c2
-rw-r--r--freebsd/lib/libc/isc/eventlib_p.h4
-rw-r--r--freebsd/lib/libc/nameser/ns_name.c2
-rw-r--r--freebsd/lib/libc/nameser/ns_parse.c2
-rw-r--r--freebsd/lib/libc/nameser/ns_print.c2
-rw-r--r--freebsd/lib/libc/nameser/ns_samedomain.c2
-rw-r--r--freebsd/lib/libc/net/base64.c4
-rw-r--r--freebsd/lib/libc/net/ether_addr.c4
-rw-r--r--freebsd/lib/libc/net/gai_strerror.c5
-rw-r--r--freebsd/lib/libc/net/getaddrinfo.c11
-rw-r--r--freebsd/lib/libc/net/gethostbydns.c4
-rw-r--r--freebsd/lib/libc/net/gethostbyht.c2
-rw-r--r--freebsd/lib/libc/net/gethostbynis.c2
-rw-r--r--freebsd/lib/libc/net/gethostnamadr.c2
-rw-r--r--freebsd/lib/libc/net/getifaddrs.c4
-rw-r--r--freebsd/lib/libc/net/getifmaddrs.c2
-rw-r--r--freebsd/lib/libc/net/getnameinfo.c2
-rw-r--r--freebsd/lib/libc/net/getnetbydns.c2
-rw-r--r--freebsd/lib/libc/net/getnetbyht.c2
-rw-r--r--freebsd/lib/libc/net/getnetbynis.c2
-rw-r--r--freebsd/lib/libc/net/getnetnamadr.c2
-rw-r--r--freebsd/lib/libc/net/getprotoent.c4
-rw-r--r--freebsd/lib/libc/net/getservent.c4
-rw-r--r--freebsd/lib/libc/net/if_indextoname.c2
-rw-r--r--freebsd/lib/libc/net/if_nameindex.c2
-rw-r--r--freebsd/lib/libc/net/if_nametoindex.c5
-rw-r--r--freebsd/lib/libc/net/linkaddr.c2
-rw-r--r--freebsd/lib/libc/net/map_v4v6.c4
-rw-r--r--freebsd/lib/libc/net/name6.c11
-rw-r--r--freebsd/lib/libc/net/nsdispatch.c6
-rw-r--r--freebsd/lib/libc/net/rcmd.c2
-rw-r--r--freebsd/lib/libc/net/recv.c2
-rw-r--r--freebsd/lib/libc/net/send.c2
-rw-r--r--freebsd/lib/libc/resolv/h_errno.c2
-rw-r--r--freebsd/lib/libc/resolv/herror.c4
-rw-r--r--freebsd/lib/libc/resolv/mtctxres.c2
-rw-r--r--freebsd/lib/libc/resolv/res_comp.c4
-rw-r--r--freebsd/lib/libc/resolv/res_data.c6
-rw-r--r--freebsd/lib/libc/resolv/res_debug.c4
-rw-r--r--freebsd/lib/libc/resolv/res_findzonecut.c4
-rw-r--r--freebsd/lib/libc/resolv/res_init.c6
-rw-r--r--freebsd/lib/libc/resolv/res_mkquery.c4
-rw-r--r--freebsd/lib/libc/resolv/res_mkupdate.c4
-rw-r--r--freebsd/lib/libc/resolv/res_query.c4
-rw-r--r--freebsd/lib/libc/resolv/res_send.c10
-rw-r--r--freebsd/lib/libc/resolv/res_state.c2
-rw-r--r--freebsd/lib/libc/resolv/res_update.c7
-rw-r--r--freebsd/lib/libc/stdio/local.h2
-rw-r--r--freebsd/lib/libipsec/ipsec_dump_policy.c10
-rw-r--r--freebsd/lib/libipsec/ipsec_get_policylen.c10
-rw-r--r--freebsd/lib/libipsec/ipsec_strerror.c8
-rw-r--r--freebsd/lib/libipsec/pfkey.c11
-rw-r--r--freebsd/lib/libipsec/pfkey_dump.c16
-rw-r--r--freebsd/lib/libipsec/policy_parse.y4
-rw-r--r--freebsd/lib/libipsec/policy_token.l9
-rw-r--r--freebsd/lib/libkvm/kvm.h2
-rw-r--r--freebsd/lib/libmemstat/memstat.c2
-rw-r--r--freebsd/lib/libmemstat/memstat.h4
-rw-r--r--freebsd/lib/libmemstat/memstat_all.c2
-rw-r--r--freebsd/lib/libmemstat/memstat_malloc.c6
-rw-r--r--freebsd/lib/libmemstat/memstat_uma.c12
-rw-r--r--freebsd/lib/libutil/expand_number.c2
-rw-r--r--freebsd/lib/libutil/humanize_number.c2
-rw-r--r--freebsd/lib/libutil/trimdomain.c5
-rw-r--r--freebsd/net/ethernet.h405
-rw-r--r--freebsd/net/if.h470
-rw-r--r--freebsd/net/if_arp.h138
-rw-r--r--freebsd/net/if_dl.h82
-rw-r--r--freebsd/net/if_types.h254
-rw-r--r--freebsd/net/route.h446
-rw-r--r--freebsd/netatalk/at.h86
-rw-r--r--freebsd/netinet/icmp6.h741
-rw-r--r--freebsd/netinet/if_ether.h122
-rw-r--r--freebsd/netinet/igmp.h148
-rw-r--r--freebsd/netinet/in.h794
-rw-r--r--freebsd/netinet/in_cksum.c148
-rw-r--r--freebsd/netinet/ip.h196
-rw-r--r--freebsd/netinet/ip6.h352
-rw-r--r--freebsd/netinet/ip_icmp.h214
-rw-r--r--freebsd/netinet/tcp.h226
-rw-r--r--freebsd/sbin/dhclient/bpf.c5
-rw-r--r--freebsd/sbin/dhclient/dhclient.c8
-rw-r--r--freebsd/sbin/dhclient/dhcpd.h4
-rw-r--r--freebsd/sbin/dhclient/dispatch.c4
-rw-r--r--freebsd/sbin/dhclient/privsep.h2
-rw-r--r--freebsd/sbin/ifconfig/af_atalk.c2
-rw-r--r--freebsd/sbin/ifconfig/af_inet.c11
-rw-r--r--freebsd/sbin/ifconfig/af_inet6.c11
-rw-r--r--freebsd/sbin/ifconfig/af_link.c6
-rw-r--r--freebsd/sbin/ifconfig/af_nd6.c11
-rw-r--r--freebsd/sbin/ifconfig/ifbridge.c10
-rw-r--r--freebsd/sbin/ifconfig/ifcarp.c6
-rw-r--r--freebsd/sbin/ifconfig/ifclone.c6
-rw-r--r--freebsd/sbin/ifconfig/ifconfig.c17
-rw-r--r--freebsd/sbin/ifconfig/ifconfig.h4
-rw-r--r--freebsd/sbin/ifconfig/ifgif.c6
-rw-r--r--freebsd/sbin/ifconfig/ifgre.c6
-rw-r--r--freebsd/sbin/ifconfig/ifgroup.c2
-rw-r--r--freebsd/sbin/ifconfig/ifieee80211.c16
-rw-r--r--freebsd/sbin/ifconfig/iflagg.c6
-rw-r--r--freebsd/sbin/ifconfig/ifmac.c6
-rw-r--r--freebsd/sbin/ifconfig/ifmedia.c13
-rw-r--r--freebsd/sbin/ifconfig/ifpfsync.c7
-rw-r--r--freebsd/sbin/ifconfig/ifvlan.c7
-rw-r--r--freebsd/sbin/ifconfig/regdomain.h5
-rw-r--r--freebsd/sbin/ping/ping.c19
-rw-r--r--freebsd/sbin/ping6/ping6.c9
-rw-r--r--freebsd/sbin/route/route.c13
-rw-r--r--freebsd/sys/arm/arm/in_cksum.c163
-rw-r--r--freebsd/sys/arm/arm/legacy.c347
-rw-r--r--freebsd/sys/arm/include/machine/cpufunc.h14
-rw-r--r--freebsd/sys/arm/include/machine/in_cksum.h63
-rw-r--r--freebsd/sys/arm/include/machine/legacyvar.h6
-rw-r--r--freebsd/sys/arm/pci/pci_bus.c38
-rw-r--r--freebsd/sys/avr/avr/in_cksum.c255
-rw-r--r--freebsd/sys/avr/avr/legacy.c347
-rw-r--r--freebsd/sys/avr/include/machine/in_cksum.h93
-rw-r--r--freebsd/sys/avr/include/machine/legacyvar.h57
-rw-r--r--freebsd/sys/avr/include/machine/pci_cfgreg.h (renamed from freebsd/sys/_null.h)43
-rw-r--r--freebsd/sys/avr/pci/pci_bus.c754
-rw-r--r--freebsd/sys/bfin/bfin/in_cksum.c255
-rw-r--r--freebsd/sys/bfin/bfin/legacy.c347
-rw-r--r--freebsd/sys/bfin/include/machine/in_cksum.h8
-rw-r--r--freebsd/sys/bfin/include/machine/legacyvar.h57
-rw-r--r--freebsd/sys/bfin/include/machine/pci_cfgreg.h52
-rw-r--r--freebsd/sys/bfin/pci/pci_bus.c729
-rw-r--r--freebsd/sys/bsm/audit.h6
-rw-r--r--freebsd/sys/bsm/audit_kevents.h6
-rw-r--r--freebsd/sys/cam/ata/ata_all.h2
-rw-r--r--freebsd/sys/cam/cam.c32
-rw-r--r--freebsd/sys/cam/cam.h6
-rw-r--r--freebsd/sys/cam/cam_ccb.h16
-rw-r--r--freebsd/sys/cam/cam_periph.h6
-rw-r--r--freebsd/sys/cam/cam_xpt_sim.h4
-rw-r--r--freebsd/sys/cam/scsi/scsi_all.c40
-rw-r--r--freebsd/sys/cam/scsi/scsi_all.h2
-rw-r--r--freebsd/sys/cam/scsi/scsi_da.h2
-rw-r--r--freebsd/sys/contrib/altq/altq/altq.h16
-rw-r--r--freebsd/sys/contrib/altq/altq/altq_cbq.c40
-rw-r--r--freebsd/sys/contrib/altq/altq/altq_cbq.h14
-rw-r--r--freebsd/sys/contrib/altq/altq/altq_cdnr.c48
-rw-r--r--freebsd/sys/contrib/altq/altq/altq_cdnr.h8
-rw-r--r--freebsd/sys/contrib/altq/altq/altq_classq.h6
-rw-r--r--freebsd/sys/contrib/altq/altq/altq_hfsc.c40
-rw-r--r--freebsd/sys/contrib/altq/altq/altq_hfsc.h14
-rw-r--r--freebsd/sys/contrib/altq/altq/altq_priq.c44
-rw-r--r--freebsd/sys/contrib/altq/altq/altq_priq.h14
-rw-r--r--freebsd/sys/contrib/altq/altq/altq_red.c50
-rw-r--r--freebsd/sys/contrib/altq/altq/altq_red.h8
-rw-r--r--freebsd/sys/contrib/altq/altq/altq_rio.c48
-rw-r--r--freebsd/sys/contrib/altq/altq/altq_rio.h8
-rw-r--r--freebsd/sys/contrib/altq/altq/altq_rmclass.c42
-rw-r--r--freebsd/sys/contrib/altq/altq/altq_rmclass.h8
-rw-r--r--freebsd/sys/contrib/altq/altq/altq_rmclass_debug.h6
-rw-r--r--freebsd/sys/contrib/altq/altq/altq_subr.c78
-rw-r--r--freebsd/sys/contrib/altq/altq/altq_var.h16
-rw-r--r--freebsd/sys/contrib/altq/altq/altqconf.h4
-rw-r--r--freebsd/sys/contrib/altq/altq/if_altq.h14
-rw-r--r--freebsd/sys/contrib/pf/net/if_pflog.c66
-rw-r--r--freebsd/sys/contrib/pf/net/if_pflog.h6
-rw-r--r--freebsd/sys/contrib/pf/net/if_pfsync.c90
-rw-r--r--freebsd/sys/contrib/pf/net/if_pfsync.h6
-rw-r--r--freebsd/sys/contrib/pf/net/pf.c128
-rw-r--r--freebsd/sys/contrib/pf/net/pf_if.c48
-rw-r--r--freebsd/sys/contrib/pf/net/pf_ioctl.c110
-rw-r--r--freebsd/sys/contrib/pf/net/pf_mtag.h6
-rw-r--r--freebsd/sys/contrib/pf/net/pf_norm.c68
-rw-r--r--freebsd/sys/contrib/pf/net/pf_osfp.c42
-rw-r--r--freebsd/sys/contrib/pf/net/pf_ruleset.c38
-rw-r--r--freebsd/sys/contrib/pf/net/pf_subr.c66
-rw-r--r--freebsd/sys/contrib/pf/net/pf_table.c34
-rw-r--r--freebsd/sys/contrib/pf/net/pfvar.h36
-rw-r--r--freebsd/sys/contrib/pf/netinet/in4_cksum.c18
-rw-r--r--freebsd/sys/crypto/blowfish/bf_ecb.c10
-rw-r--r--freebsd/sys/crypto/blowfish/bf_enc.c10
-rw-r--r--freebsd/sys/crypto/blowfish/bf_skey.c16
-rw-r--r--freebsd/sys/crypto/camellia/camellia-api.c10
-rw-r--r--freebsd/sys/crypto/camellia/camellia.c16
-rw-r--r--freebsd/sys/crypto/des/des_ecb.c12
-rw-r--r--freebsd/sys/crypto/des/des_enc.c8
-rw-r--r--freebsd/sys/crypto/des/des_locl.h2
-rw-r--r--freebsd/sys/crypto/des/des_setkey.c14
-rw-r--r--freebsd/sys/crypto/rc4/rc4.c14
-rw-r--r--freebsd/sys/crypto/rc4/rc4.h4
-rw-r--r--freebsd/sys/crypto/rijndael/rijndael-alg-fst.c18
-rw-r--r--freebsd/sys/crypto/rijndael/rijndael-api-fst.c14
-rw-r--r--freebsd/sys/crypto/rijndael/rijndael-api-fst.h2
-rw-r--r--freebsd/sys/crypto/rijndael/rijndael-api.c10
-rw-r--r--freebsd/sys/crypto/sha1.c14
-rw-r--r--freebsd/sys/crypto/sha1.h6
-rw-r--r--freebsd/sys/crypto/sha2/sha2.c16
-rw-r--r--freebsd/sys/crypto/sha2/sha2.h2
-rw-r--r--freebsd/sys/dev/bce/if_bce.c10
-rw-r--r--freebsd/sys/dev/bce/if_bcereg.h92
-rw-r--r--freebsd/sys/dev/bfe/if_bfe.c66
-rw-r--r--freebsd/sys/dev/bge/if_bge.c96
-rw-r--r--freebsd/sys/dev/dc/dcphy.c46
-rw-r--r--freebsd/sys/dev/dc/if_dc.c74
-rw-r--r--freebsd/sys/dev/dc/pnphy.c44
-rw-r--r--freebsd/sys/dev/e1000/e1000_80003es2lan.c6
-rw-r--r--freebsd/sys/dev/e1000/e1000_80003es2lan.h4
-rw-r--r--freebsd/sys/dev/e1000/e1000_82540.c6
-rw-r--r--freebsd/sys/dev/e1000/e1000_82541.c6
-rw-r--r--freebsd/sys/dev/e1000/e1000_82541.h4
-rw-r--r--freebsd/sys/dev/e1000/e1000_82542.c6
-rw-r--r--freebsd/sys/dev/e1000/e1000_82543.c6
-rw-r--r--freebsd/sys/dev/e1000/e1000_82543.h4
-rw-r--r--freebsd/sys/dev/e1000/e1000_82571.c6
-rw-r--r--freebsd/sys/dev/e1000/e1000_82571.h4
-rw-r--r--freebsd/sys/dev/e1000/e1000_82575.c6
-rw-r--r--freebsd/sys/dev/e1000/e1000_82575.h6
-rw-r--r--freebsd/sys/dev/e1000/e1000_api.c6
-rw-r--r--freebsd/sys/dev/e1000/e1000_api.h8
-rw-r--r--freebsd/sys/dev/e1000/e1000_defines.h6
-rw-r--r--freebsd/sys/dev/e1000/e1000_hw.h60
-rw-r--r--freebsd/sys/dev/e1000/e1000_ich8lan.c6
-rw-r--r--freebsd/sys/dev/e1000/e1000_ich8lan.h4
-rw-r--r--freebsd/sys/dev/e1000/e1000_mac.c6
-rw-r--r--freebsd/sys/dev/e1000/e1000_mac.h4
-rw-r--r--freebsd/sys/dev/e1000/e1000_manage.c6
-rw-r--r--freebsd/sys/dev/e1000/e1000_manage.h4
-rw-r--r--freebsd/sys/dev/e1000/e1000_mbx.c6
-rw-r--r--freebsd/sys/dev/e1000/e1000_mbx.h10
-rw-r--r--freebsd/sys/dev/e1000/e1000_nvm.c6
-rw-r--r--freebsd/sys/dev/e1000/e1000_nvm.h4
-rw-r--r--freebsd/sys/dev/e1000/e1000_osdep.c6
-rw-r--r--freebsd/sys/dev/e1000/e1000_osdep.h46
-rw-r--r--freebsd/sys/dev/e1000/e1000_phy.c6
-rw-r--r--freebsd/sys/dev/e1000/e1000_phy.h4
-rw-r--r--freebsd/sys/dev/e1000/e1000_regs.h4
-rw-r--r--freebsd/sys/dev/e1000/e1000_vf.c6
-rw-r--r--freebsd/sys/dev/e1000/e1000_vf.h22
-rw-r--r--freebsd/sys/dev/e1000/if_em.c100
-rw-r--r--freebsd/sys/dev/e1000/if_igb.c110
-rw-r--r--freebsd/sys/dev/e1000/if_lem.c94
-rw-r--r--freebsd/sys/dev/fxp/if_fxp.c92
-rw-r--r--freebsd/sys/dev/led/led.c28
-rw-r--r--freebsd/sys/dev/mii/brgphy.c44
-rw-r--r--freebsd/sys/dev/mii/brgphyreg.h6
-rw-r--r--freebsd/sys/dev/mii/icsphy.c30
-rw-r--r--freebsd/sys/dev/mii/icsphyreg.h6
-rw-r--r--freebsd/sys/dev/mii/mii.c28
-rw-r--r--freebsd/sys/dev/mii/mii.h6
-rw-r--r--freebsd/sys/dev/mii/mii_physubr.c28
-rw-r--r--freebsd/sys/dev/mii/miivar.h8
-rw-r--r--freebsd/sys/dev/pci/pci.c78
-rw-r--r--freebsd/sys/dev/pci/pci_pci.c30
-rw-r--r--freebsd/sys/dev/pci/pci_private.h6
-rw-r--r--freebsd/sys/dev/pci/pci_user.c58
-rw-r--r--freebsd/sys/dev/pci/pcivar.h16
-rw-r--r--freebsd/sys/dev/random/harvest.c34
-rw-r--r--freebsd/sys/dev/re/if_re.c80
-rw-r--r--freebsd/sys/dev/smc/if_smc.c78
-rw-r--r--freebsd/sys/dev/smc/if_smcreg.h6
-rw-r--r--freebsd/sys/dev/smc/if_smcvar.h6
-rw-r--r--freebsd/sys/dev/usb/controller/ehci.c74
-rw-r--r--freebsd/sys/dev/usb/controller/ehci.h6
-rw-r--r--freebsd/sys/dev/usb/controller/ehcireg.h6
-rw-r--r--freebsd/sys/dev/usb/controller/ohci.c74
-rw-r--r--freebsd/sys/dev/usb/controller/ohci.h6
-rw-r--r--freebsd/sys/dev/usb/controller/ohcireg.h6
-rw-r--r--freebsd/sys/dev/usb/controller/usb_controller.c68
-rw-r--r--freebsd/sys/dev/usb/quirk/usb_quirk.c56
-rw-r--r--freebsd/sys/dev/usb/quirk/usb_quirk.h6
-rw-r--r--freebsd/sys/dev/usb/storage/umass.c74
-rw-r--r--freebsd/sys/dev/usb/ufm_ioctl.h2
-rw-r--r--freebsd/sys/dev/usb/usb.h14
-rw-r--r--freebsd/sys/dev/usb/usb_bus.h6
-rw-r--r--freebsd/sys/dev/usb/usb_busdma.c66
-rw-r--r--freebsd/sys/dev/usb/usb_busdma.h12
-rw-r--r--freebsd/sys/dev/usb/usb_cdc.h6
-rw-r--r--freebsd/sys/dev/usb/usb_controller.h6
-rw-r--r--freebsd/sys/dev/usb/usb_core.c44
-rw-r--r--freebsd/sys/dev/usb/usb_core.h6
-rw-r--r--freebsd/sys/dev/usb/usb_debug.c66
-rw-r--r--freebsd/sys/dev/usb/usb_debug.h6
-rw-r--r--freebsd/sys/dev/usb/usb_dev.c92
-rw-r--r--freebsd/sys/dev/usb/usb_dev.h16
-rw-r--r--freebsd/sys/dev/usb/usb_device.c94
-rw-r--r--freebsd/sys/dev/usb/usb_device.h6
-rw-r--r--freebsd/sys/dev/usb/usb_dynamic.c56
-rw-r--r--freebsd/sys/dev/usb/usb_dynamic.h6
-rw-r--r--freebsd/sys/dev/usb/usb_endian.h10
-rw-r--r--freebsd/sys/dev/usb/usb_error.c44
-rw-r--r--freebsd/sys/dev/usb/usb_freebsd.h6
-rw-r--r--freebsd/sys/dev/usb/usb_generic.c84
-rw-r--r--freebsd/sys/dev/usb/usb_generic.h6
-rw-r--r--freebsd/sys/dev/usb/usb_handle_request.c72
-rw-r--r--freebsd/sys/dev/usb/usb_hid.c62
-rw-r--r--freebsd/sys/dev/usb/usb_hub.c76
-rw-r--r--freebsd/sys/dev/usb/usb_hub.h6
-rw-r--r--freebsd/sys/dev/usb/usb_ioctl.h12
-rw-r--r--freebsd/sys/dev/usb/usb_lookup.c44
-rw-r--r--freebsd/sys/dev/usb/usb_mbuf.c48
-rw-r--r--freebsd/sys/dev/usb/usb_mbuf.h6
-rw-r--r--freebsd/sys/dev/usb/usb_msctest.c68
-rw-r--r--freebsd/sys/dev/usb/usb_msctest.h6
-rw-r--r--freebsd/sys/dev/usb/usb_parse.c48
-rw-r--r--freebsd/sys/dev/usb/usb_process.c62
-rw-r--r--freebsd/sys/dev/usb/usb_process.h8
-rw-r--r--freebsd/sys/dev/usb/usb_request.c78
-rw-r--r--freebsd/sys/dev/usb/usb_request.h6
-rw-r--r--freebsd/sys/dev/usb/usb_transfer.c68
-rw-r--r--freebsd/sys/dev/usb/usb_transfer.h6
-rw-r--r--freebsd/sys/dev/usb/usb_util.c68
-rw-r--r--freebsd/sys/dev/usb/usb_util.h6
-rw-r--r--freebsd/sys/dev/usb/usbdi.h8
-rw-r--r--freebsd/sys/dev/usb/usbdi_util.h6
-rw-r--r--freebsd/sys/dev/usb/usbhid.h8
-rw-r--r--freebsd/sys/fs/devfs/devfs_int.h8
-rw-r--r--freebsd/sys/h8300/h8300/in_cksum.c255
-rw-r--r--freebsd/sys/h8300/h8300/legacy.c347
-rw-r--r--freebsd/sys/h8300/include/machine/in_cksum.h27
-rw-r--r--freebsd/sys/h8300/include/machine/legacyvar.h57
-rw-r--r--freebsd/sys/h8300/include/machine/pci_cfgreg.h52
-rw-r--r--freebsd/sys/h8300/pci/pci_bus.c729
-rw-r--r--freebsd/sys/i386/i386/in_cksum.c18
-rw-r--r--freebsd/sys/i386/i386/legacy.c34
-rw-r--r--freebsd/sys/i386/include/machine/cpufunc.h8
-rw-r--r--freebsd/sys/i386/include/machine/in_cksum.h193
-rw-r--r--freebsd/sys/i386/include/machine/legacyvar.h57
-rw-r--r--freebsd/sys/i386/include/machine/md_var.h6
-rw-r--r--freebsd/sys/i386/include/machine/pci_cfgreg.h52
-rw-r--r--freebsd/sys/i386/include/machine/specialreg.h6
-rw-r--r--freebsd/sys/i386/pci/pci_bus.c729
-rw-r--r--freebsd/sys/ioccom.h80
-rw-r--r--freebsd/sys/isa/isavar.h12
-rw-r--r--freebsd/sys/isa/pnpvar.h6
-rw-r--r--freebsd/sys/kern/init_main.c92
-rw-r--r--freebsd/sys/kern/kern_descrip.c216
-rw-r--r--freebsd/sys/kern/kern_environment.c36
-rw-r--r--freebsd/sys/kern/kern_event.c72
-rw-r--r--freebsd/sys/kern/kern_intr.c68
-rw-r--r--freebsd/sys/kern/kern_linker.c66
-rw-r--r--freebsd/sys/kern/kern_mbuf.c50
-rw-r--r--freebsd/sys/kern/kern_mib.c46
-rw-r--r--freebsd/sys/kern/kern_module.c44
-rw-r--r--freebsd/sys/kern/kern_mtxpool.c20
-rw-r--r--freebsd/sys/kern/kern_ntptime.c44
-rw-r--r--freebsd/sys/kern/kern_proc.c92
-rw-r--r--freebsd/sys/kern/kern_prot.c110
-rw-r--r--freebsd/sys/kern/kern_resource.c72
-rw-r--r--freebsd/sys/kern/kern_subr.c48
-rw-r--r--freebsd/sys/kern/kern_sysctl.c48
-rw-r--r--freebsd/sys/kern/kern_tc.c22
-rw-r--r--freebsd/sys/kern/kern_time.c76
-rw-r--r--freebsd/sys/kern/kern_timeout.c40
-rw-r--r--freebsd/sys/kern/subr_bufring.c16
-rw-r--r--freebsd/sys/kern/subr_bus.c62
-rw-r--r--freebsd/sys/kern/subr_eventhandler.c20
-rw-r--r--freebsd/sys/kern/subr_hints.c14
-rw-r--r--freebsd/sys/kern/subr_kobj.c22
-rw-r--r--freebsd/sys/kern/subr_module.c10
-rw-r--r--freebsd/sys/kern/subr_rman.c30
-rw-r--r--freebsd/sys/kern/subr_sbuf.c30
-rw-r--r--freebsd/sys/kern/subr_unit.c28
-rw-r--r--freebsd/sys/kern/sys_generic.c86
-rw-r--r--freebsd/sys/kern/uipc_accf.c34
-rw-r--r--freebsd/sys/kern/uipc_domain.c34
-rw-r--r--freebsd/sys/kern/uipc_mbuf.c34
-rw-r--r--freebsd/sys/kern/uipc_mbuf2.c20
-rw-r--r--freebsd/sys/kern/uipc_sockbuf.c36
-rw-r--r--freebsd/sys/kern/uipc_socket.c98
-rw-r--r--freebsd/sys/libkern/arc4random.c20
-rw-r--r--freebsd/sys/libkern/fls.c6
-rw-r--r--freebsd/sys/libkern/inet_ntoa.c10
-rw-r--r--freebsd/sys/libkern/random.c6
-rw-r--r--freebsd/sys/lm32/include/machine/in_cksum.h (renamed from freebsd/netinet/in_systm.h)59
-rw-r--r--freebsd/sys/lm32/include/machine/legacyvar.h57
-rw-r--r--freebsd/sys/lm32/include/machine/pci_cfgreg.h52
-rw-r--r--freebsd/sys/lm32/lm32/in_cksum.c255
-rw-r--r--freebsd/sys/lm32/lm32/legacy.c347
-rw-r--r--freebsd/sys/lm32/pci/pci_bus.c729
-rw-r--r--freebsd/sys/m32c/include/machine/in_cksum.h (renamed from rtemsbsd/freebsd/machine/endian.h)92
-rw-r--r--freebsd/sys/m32c/include/machine/legacyvar.h57
-rw-r--r--freebsd/sys/m32c/include/machine/pci_cfgreg.h52
-rw-r--r--freebsd/sys/m32c/m32c/in_cksum.c255
-rw-r--r--freebsd/sys/m32c/m32c/legacy.c347
-rw-r--r--freebsd/sys/m32c/pci/pci_bus.c729
-rw-r--r--freebsd/sys/m32r/include/machine/in_cksum.h77
-rw-r--r--freebsd/sys/m32r/include/machine/legacyvar.h57
-rw-r--r--freebsd/sys/m32r/include/machine/pci_cfgreg.h52
-rw-r--r--freebsd/sys/m32r/m32r/in_cksum.c255
-rw-r--r--freebsd/sys/m32r/m32r/legacy.c347
-rw-r--r--freebsd/sys/m32r/pci/pci_bus.c729
-rw-r--r--freebsd/sys/m68k/include/machine/in_cksum.h77
-rw-r--r--freebsd/sys/m68k/include/machine/legacyvar.h57
-rw-r--r--freebsd/sys/m68k/include/machine/pci_cfgreg.h52
-rw-r--r--freebsd/sys/m68k/m68k/in_cksum.c255
-rw-r--r--freebsd/sys/m68k/m68k/legacy.c347
-rw-r--r--freebsd/sys/m68k/pci/pci_bus.c729
-rw-r--r--freebsd/sys/mips/include/machine/cpufunc.h10
-rw-r--r--freebsd/sys/mips/include/machine/cpuregs.h12
-rw-r--r--freebsd/sys/mips/include/machine/in_cksum.h77
-rw-r--r--freebsd/sys/mips/include/machine/legacyvar.h57
-rw-r--r--freebsd/sys/mips/include/machine/pci_cfgreg.h52
-rw-r--r--freebsd/sys/mips/mips/in_cksum.c18
-rw-r--r--freebsd/sys/mips/mips/legacy.c347
-rw-r--r--freebsd/sys/mips/pci/pci_bus.c729
-rw-r--r--freebsd/sys/mman.h238
-rw-r--r--freebsd/sys/net/bpf.c90
-rw-r--r--freebsd/sys/net/bpf.h6
-rw-r--r--freebsd/sys/net/bpf_buffer.c28
-rw-r--r--freebsd/sys/net/bpf_buffer.h6
-rw-r--r--freebsd/sys/net/bpf_filter.c14
-rw-r--r--freebsd/sys/net/bpf_jitter.c26
-rw-r--r--freebsd/sys/net/bpf_jitter.h6
-rw-r--r--freebsd/sys/net/bpf_zerocopy.h6
-rw-r--r--freebsd/sys/net/bpfdesc.h14
-rw-r--r--freebsd/sys/net/bridgestp.c54
-rw-r--r--freebsd/sys/net/bridgestp.h4
-rw-r--r--freebsd/sys/net/ethernet.h407
-rw-r--r--freebsd/sys/net/fddi.h6
-rw-r--r--freebsd/sys/net/firewire.h6
-rw-r--r--freebsd/sys/net/flowtable.h4
-rw-r--r--freebsd/sys/net/ieee8023ad_lacp.c44
-rw-r--r--freebsd/sys/net/if.c102
-rw-r--r--freebsd/sys/net/if.h472
-rw-r--r--freebsd/sys/net/if_arc.h6
-rw-r--r--freebsd/sys/net/if_arcsubr.c68
-rw-r--r--freebsd/sys/net/if_arp.h140
-rw-r--r--freebsd/sys/net/if_atmsubr.c60
-rw-r--r--freebsd/sys/net/if_bridge.c106
-rw-r--r--freebsd/sys/net/if_bridgevar.h6
-rw-r--r--freebsd/sys/net/if_clone.c38
-rw-r--r--freebsd/sys/net/if_clone.h6
-rw-r--r--freebsd/sys/net/if_dead.c14
-rw-r--r--freebsd/sys/net/if_disc.c36
-rw-r--r--freebsd/sys/net/if_dl.h84
-rw-r--r--freebsd/sys/net/if_edsc.c32
-rw-r--r--freebsd/sys/net/if_ef.c58
-rw-r--r--freebsd/sys/net/if_enc.c66
-rw-r--r--freebsd/sys/net/if_epair.c44
-rw-r--r--freebsd/sys/net/if_ethersubr.c98
-rw-r--r--freebsd/sys/net/if_faith.c64
-rw-r--r--freebsd/sys/net/if_fddisubr.c74
-rw-r--r--freebsd/sys/net/if_fwsubr.c54
-rw-r--r--freebsd/sys/net/if_gif.c96
-rw-r--r--freebsd/sys/net/if_gif.h12
-rw-r--r--freebsd/sys/net/if_gre.c66
-rw-r--r--freebsd/sys/net/if_gre.h4
-rw-r--r--freebsd/sys/net/if_iso88025subr.c66
-rw-r--r--freebsd/sys/net/if_lagg.c82
-rw-r--r--freebsd/sys/net/if_llatbl.c60
-rw-r--r--freebsd/sys/net/if_llatbl.h12
-rw-r--r--freebsd/sys/net/if_llc.h6
-rw-r--r--freebsd/sys/net/if_loop.c68
-rw-r--r--freebsd/sys/net/if_media.c20
-rw-r--r--freebsd/sys/net/if_media.h8
-rw-r--r--freebsd/sys/net/if_mib.c18
-rw-r--r--freebsd/sys/net/if_sppp.h6
-rw-r--r--freebsd/sys/net/if_spppfr.c68
-rw-r--r--freebsd/sys/net/if_spppsubr.c66
-rw-r--r--freebsd/sys/net/if_stf.c92
-rw-r--r--freebsd/sys/net/if_stf.h6
-rw-r--r--freebsd/sys/net/if_tap.c74
-rw-r--r--freebsd/sys/net/if_tap.h6
-rw-r--r--freebsd/sys/net/if_tapvar.h6
-rw-r--r--freebsd/sys/net/if_tun.c82
-rw-r--r--freebsd/sys/net/if_tun.h6
-rw-r--r--freebsd/sys/net/if_types.h256
-rw-r--r--freebsd/sys/net/if_var.h30
-rw-r--r--freebsd/sys/net/if_vlan.c50
-rw-r--r--freebsd/sys/net/if_vlan_var.h6
-rw-r--r--freebsd/sys/net/iso88025.h4
-rw-r--r--freebsd/sys/net/netisr.c52
-rw-r--r--freebsd/sys/net/netisr.h6
-rw-r--r--freebsd/sys/net/pfil.c34
-rw-r--r--freebsd/sys/net/pfil.h18
-rw-r--r--freebsd/sys/net/pfkeyv2.h6
-rw-r--r--freebsd/sys/net/ppp_defs.h6
-rw-r--r--freebsd/sys/net/radix.c30
-rw-r--r--freebsd/sys/net/radix.h12
-rw-r--r--freebsd/sys/net/radix_mpath.c32
-rw-r--r--freebsd/sys/net/radix_mpath.h6
-rw-r--r--freebsd/sys/net/raw_cb.c30
-rw-r--r--freebsd/sys/net/raw_cb.h6
-rw-r--r--freebsd/sys/net/raw_usrreq.c36
-rw-r--r--freebsd/sys/net/route.c58
-rw-r--r--freebsd/sys/net/route.h448
-rw-r--r--freebsd/sys/net/rtsock.c76
-rw-r--r--freebsd/sys/net/slcompress.c18
-rw-r--r--freebsd/sys/net/slcompress.h6
-rw-r--r--freebsd/sys/net/vnet.h20
-rw-r--r--freebsd/sys/net/zlib.c90
-rw-r--r--freebsd/sys/net/zlib.h2
-rw-r--r--freebsd/sys/net80211/_ieee80211.h6
-rw-r--r--freebsd/sys/net80211/ieee80211.c34
-rw-r--r--freebsd/sys/net80211/ieee80211.h6
-rw-r--r--freebsd/sys/net80211/ieee80211_acl.c30
-rw-r--r--freebsd/sys/net80211/ieee80211_action.c28
-rw-r--r--freebsd/sys/net80211/ieee80211_action.h6
-rw-r--r--freebsd/sys/net80211/ieee80211_adhoc.c60
-rw-r--r--freebsd/sys/net80211/ieee80211_adhoc.h6
-rw-r--r--freebsd/sys/net80211/ieee80211_ageq.c22
-rw-r--r--freebsd/sys/net80211/ieee80211_ageq.h6
-rw-r--r--freebsd/sys/net80211/ieee80211_amrr.c30
-rw-r--r--freebsd/sys/net80211/ieee80211_amrr.h6
-rw-r--r--freebsd/sys/net80211/ieee80211_crypto.c24
-rw-r--r--freebsd/sys/net80211/ieee80211_crypto.h6
-rw-r--r--freebsd/sys/net80211/ieee80211_crypto_ccmp.c30
-rw-r--r--freebsd/sys/net80211/ieee80211_crypto_none.c26
-rw-r--r--freebsd/sys/net80211/ieee80211_crypto_tkip.c30
-rw-r--r--freebsd/sys/net80211/ieee80211_crypto_wep.c30
-rw-r--r--freebsd/sys/net80211/ieee80211_ddb.c42
-rw-r--r--freebsd/sys/net80211/ieee80211_dfs.c44
-rw-r--r--freebsd/sys/net80211/ieee80211_dfs.h6
-rw-r--r--freebsd/sys/net80211/ieee80211_freebsd.c56
-rw-r--r--freebsd/sys/net80211/ieee80211_freebsd.h20
-rw-r--r--freebsd/sys/net80211/ieee80211_hostap.c60
-rw-r--r--freebsd/sys/net80211/ieee80211_hostap.h6
-rw-r--r--freebsd/sys/net80211/ieee80211_ht.c30
-rw-r--r--freebsd/sys/net80211/ieee80211_ht.h6
-rw-r--r--freebsd/sys/net80211/ieee80211_hwmp.c58
-rw-r--r--freebsd/sys/net80211/ieee80211_input.c46
-rw-r--r--freebsd/sys/net80211/ieee80211_input.h6
-rw-r--r--freebsd/sys/net80211/ieee80211_ioctl.c50
-rw-r--r--freebsd/sys/net80211/ieee80211_ioctl.h12
-rw-r--r--freebsd/sys/net80211/ieee80211_mesh.c54
-rw-r--r--freebsd/sys/net80211/ieee80211_mesh.h6
-rw-r--r--freebsd/sys/net80211/ieee80211_monitor.c54
-rw-r--r--freebsd/sys/net80211/ieee80211_monitor.h6
-rw-r--r--freebsd/sys/net80211/ieee80211_node.c40
-rw-r--r--freebsd/sys/net80211/ieee80211_node.h10
-rw-r--r--freebsd/sys/net80211/ieee80211_output.c60
-rw-r--r--freebsd/sys/net80211/ieee80211_phy.c22
-rw-r--r--freebsd/sys/net80211/ieee80211_phy.h6
-rw-r--r--freebsd/sys/net80211/ieee80211_power.c24
-rw-r--r--freebsd/sys/net80211/ieee80211_power.h6
-rw-r--r--freebsd/sys/net80211/ieee80211_proto.c40
-rw-r--r--freebsd/sys/net80211/ieee80211_proto.h6
-rw-r--r--freebsd/sys/net80211/ieee80211_radiotap.c32
-rw-r--r--freebsd/sys/net80211/ieee80211_radiotap.h6
-rw-r--r--freebsd/sys/net80211/ieee80211_ratectl.c20
-rw-r--r--freebsd/sys/net80211/ieee80211_ratectl_none.c28
-rw-r--r--freebsd/sys/net80211/ieee80211_regdomain.c22
-rw-r--r--freebsd/sys/net80211/ieee80211_regdomain.h6
-rw-r--r--freebsd/sys/net80211/ieee80211_rssadapt.c24
-rw-r--r--freebsd/sys/net80211/ieee80211_rssadapt.h6
-rw-r--r--freebsd/sys/net80211/ieee80211_scan.c28
-rw-r--r--freebsd/sys/net80211/ieee80211_scan.h6
-rw-r--r--freebsd/sys/net80211/ieee80211_scan_sta.c34
-rw-r--r--freebsd/sys/net80211/ieee80211_sta.c60
-rw-r--r--freebsd/sys/net80211/ieee80211_sta.h6
-rw-r--r--freebsd/sys/net80211/ieee80211_superg.c38
-rw-r--r--freebsd/sys/net80211/ieee80211_superg.h6
-rw-r--r--freebsd/sys/net80211/ieee80211_tdma.c58
-rw-r--r--freebsd/sys/net80211/ieee80211_tdma.h6
-rw-r--r--freebsd/sys/net80211/ieee80211_var.h36
-rw-r--r--freebsd/sys/net80211/ieee80211_wds.c58
-rw-r--r--freebsd/sys/net80211/ieee80211_wds.h6
-rw-r--r--freebsd/sys/net80211/ieee80211_xauth.c28
-rw-r--r--freebsd/sys/netatalk/aarp.c36
-rw-r--r--freebsd/sys/netatalk/aarp.h6
-rw-r--r--freebsd/sys/netatalk/at.h88
-rw-r--r--freebsd/sys/netatalk/at_control.c36
-rw-r--r--freebsd/sys/netatalk/at_extern.h6
-rw-r--r--freebsd/sys/netatalk/at_proto.c20
-rw-r--r--freebsd/sys/netatalk/at_rmx.c10
-rw-r--r--freebsd/sys/netatalk/at_var.h6
-rw-r--r--freebsd/sys/netatalk/ddp.h6
-rw-r--r--freebsd/sys/netatalk/ddp_input.c42
-rw-r--r--freebsd/sys/netatalk/ddp_output.c28
-rw-r--r--freebsd/sys/netatalk/ddp_pcb.c36
-rw-r--r--freebsd/sys/netatalk/ddp_pcb.h6
-rw-r--r--freebsd/sys/netatalk/ddp_usrreq.c34
-rw-r--r--freebsd/sys/netatalk/ddp_var.h6
-rw-r--r--freebsd/sys/netatalk/endian.h8
-rw-r--r--freebsd/sys/netatalk/phase2.h2
-rw-r--r--freebsd/sys/netinet/accf_data.c16
-rw-r--r--freebsd/sys/netinet/accf_dns.c16
-rw-r--r--freebsd/sys/netinet/accf_http.c18
-rw-r--r--freebsd/sys/netinet/icmp6.h743
-rw-r--r--freebsd/sys/netinet/icmp_var.h4
-rw-r--r--freebsd/sys/netinet/if_atm.c38
-rw-r--r--freebsd/sys/netinet/if_ether.c64
-rw-r--r--freebsd/sys/netinet/if_ether.h124
-rw-r--r--freebsd/sys/netinet/igmp.c60
-rw-r--r--freebsd/sys/netinet/igmp.h150
-rw-r--r--freebsd/sys/netinet/igmp_var.h4
-rw-r--r--freebsd/sys/netinet/in.c66
-rw-r--r--freebsd/sys/netinet/in.h796
-rw-r--r--freebsd/sys/netinet/in_gif.c64
-rw-r--r--freebsd/sys/netinet/in_gif.h6
-rw-r--r--freebsd/sys/netinet/in_mcast.c52
-rw-r--r--freebsd/sys/netinet/in_pcb.c74
-rw-r--r--freebsd/sys/netinet/in_pcb.h22
-rw-r--r--freebsd/sys/netinet/in_proto.c84
-rw-r--r--freebsd/sys/netinet/in_rmx.c36
-rw-r--r--freebsd/sys/netinet/in_systm.h60
-rw-r--r--freebsd/sys/netinet/in_var.h14
-rw-r--r--freebsd/sys/netinet/ip.h198
-rw-r--r--freebsd/sys/netinet/ip6.h354
-rw-r--r--freebsd/sys/netinet/ip_carp.c106
-rw-r--r--freebsd/sys/netinet/ip_divert.c74
-rw-r--r--freebsd/sys/netinet/ip_divert.h6
-rw-r--r--freebsd/sys/netinet/ip_ecn.c28
-rw-r--r--freebsd/sys/netinet/ip_ecn.h6
-rw-r--r--freebsd/sys/netinet/ip_encap.c52
-rw-r--r--freebsd/sys/netinet/ip_encap.h6
-rw-r--r--freebsd/sys/netinet/ip_fastfwd.c62
-rw-r--r--freebsd/sys/netinet/ip_gre.c68
-rw-r--r--freebsd/sys/netinet/ip_icmp.c70
-rw-r--r--freebsd/sys/netinet/ip_icmp.h216
-rw-r--r--freebsd/sys/netinet/ip_id.c32
-rw-r--r--freebsd/sys/netinet/ip_input.c94
-rw-r--r--freebsd/sys/netinet/ip_ipsec.c60
-rw-r--r--freebsd/sys/netinet/ip_ipsec.h4
-rw-r--r--freebsd/sys/netinet/ip_mroute.c90
-rw-r--r--freebsd/sys/netinet/ip_mroute.h6
-rw-r--r--freebsd/sys/netinet/ip_options.c72
-rw-r--r--freebsd/sys/netinet/ip_options.h6
-rw-r--r--freebsd/sys/netinet/ip_output.c88
-rw-r--r--freebsd/sys/netinet/ip_var.h10
-rw-r--r--freebsd/sys/netinet/ipfw/dn_heap.c22
-rw-r--r--freebsd/sys/netinet/ipfw/dn_sched_fifo.c32
-rw-r--r--freebsd/sys/netinet/ipfw/dn_sched_prio.c32
-rw-r--r--freebsd/sys/netinet/ipfw/dn_sched_qfq.c32
-rw-r--r--freebsd/sys/netinet/ipfw/dn_sched_rr.c32
-rw-r--r--freebsd/sys/netinet/ipfw/dn_sched_wf2q.c32
-rw-r--r--freebsd/sys/netinet/ipfw/ip_dn_glue.c52
-rw-r--r--freebsd/sys/netinet/ipfw/ip_dn_io.c66
-rw-r--r--freebsd/sys/netinet/ipfw/ip_dummynet.c54
-rw-r--r--freebsd/sys/netinet/ipfw/ip_fw2.c108
-rw-r--r--freebsd/sys/netinet/ipfw/ip_fw_log.c70
-rw-r--r--freebsd/sys/netinet/ipfw/ip_fw_nat.c42
-rw-r--r--freebsd/sys/netinet/ipfw/ip_fw_pfil.c64
-rw-r--r--freebsd/sys/netinet/ipfw/ip_fw_sockopt.c62
-rw-r--r--freebsd/sys/netinet/ipfw/ip_fw_table.c54
-rw-r--r--freebsd/sys/netinet/libalias/alias.c52
-rw-r--r--freebsd/sys/netinet/libalias/alias.h12
-rw-r--r--freebsd/sys/netinet/libalias/alias_cuseeme.c34
-rw-r--r--freebsd/sys/netinet/libalias/alias_db.c56
-rw-r--r--freebsd/sys/netinet/libalias/alias_dummy.c32
-rw-r--r--freebsd/sys/netinet/libalias/alias_ftp.c42
-rw-r--r--freebsd/sys/netinet/libalias/alias_irc.c48
-rw-r--r--freebsd/sys/netinet/libalias/alias_local.h28
-rw-r--r--freebsd/sys/netinet/libalias/alias_mod.c34
-rw-r--r--freebsd/sys/netinet/libalias/alias_mod.h8
-rw-r--r--freebsd/sys/netinet/libalias/alias_nbt.c36
-rw-r--r--freebsd/sys/netinet/libalias/alias_pptp.c34
-rw-r--r--freebsd/sys/netinet/libalias/alias_proxy.c38
-rw-r--r--freebsd/sys/netinet/libalias/alias_sctp.c40
-rw-r--r--freebsd/sys/netinet/libalias/alias_sctp.h50
-rw-r--r--freebsd/sys/netinet/libalias/alias_skinny.c30
-rw-r--r--freebsd/sys/netinet/libalias/alias_smedia.c38
-rw-r--r--freebsd/sys/netinet/libalias/alias_util.c28
-rw-r--r--freebsd/sys/netinet/pim.h8
-rw-r--r--freebsd/sys/netinet/pim_var.h6
-rw-r--r--freebsd/sys/netinet/raw_ip.c74
-rw-r--r--freebsd/sys/netinet/sctp.h12
-rw-r--r--freebsd/sys/netinet/sctp_asconf.c22
-rw-r--r--freebsd/sys/netinet/sctp_asconf.h8
-rw-r--r--freebsd/sys/netinet/sctp_auth.c24
-rw-r--r--freebsd/sys/netinet/sctp_auth.h2
-rw-r--r--freebsd/sys/netinet/sctp_bsd_addr.c32
-rw-r--r--freebsd/sys/netinet/sctp_bsd_addr.h4
-rw-r--r--freebsd/sys/netinet/sctp_cc_functions.c32
-rw-r--r--freebsd/sys/netinet/sctp_cc_functions.h2
-rw-r--r--freebsd/sys/netinet/sctp_constants.h2
-rw-r--r--freebsd/sys/netinet/sctp_crc32.c12
-rw-r--r--freebsd/sys/netinet/sctp_crc32.h2
-rw-r--r--freebsd/sys/netinet/sctp_header.h8
-rw-r--r--freebsd/sys/netinet/sctp_indata.c26
-rw-r--r--freebsd/sys/netinet/sctp_indata.h2
-rw-r--r--freebsd/sys/netinet/sctp_input.c34
-rw-r--r--freebsd/sys/netinet/sctp_input.h2
-rw-r--r--freebsd/sys/netinet/sctp_lock_bsd.h2
-rw-r--r--freebsd/sys/netinet/sctp_os.h4
-rw-r--r--freebsd/sys/netinet/sctp_os_bsd.h122
-rw-r--r--freebsd/sys/netinet/sctp_output.c42
-rw-r--r--freebsd/sys/netinet/sctp_output.h4
-rw-r--r--freebsd/sys/netinet/sctp_pcb.c30
-rw-r--r--freebsd/sys/netinet/sctp_pcb.h16
-rw-r--r--freebsd/sys/netinet/sctp_peeloff.c26
-rw-r--r--freebsd/sys/netinet/sctp_peeloff.h2
-rw-r--r--freebsd/sys/netinet/sctp_structs.h8
-rw-r--r--freebsd/sys/netinet/sctp_sysctl.c20
-rw-r--r--freebsd/sys/netinet/sctp_sysctl.h6
-rw-r--r--freebsd/sys/netinet/sctp_timer.c32
-rw-r--r--freebsd/sys/netinet/sctp_timer.h2
-rw-r--r--freebsd/sys/netinet/sctp_uio.h14
-rw-r--r--freebsd/sys/netinet/sctp_usrreq.c36
-rw-r--r--freebsd/sys/netinet/sctp_var.h10
-rw-r--r--freebsd/sys/netinet/sctputil.c40
-rw-r--r--freebsd/sys/netinet/sctputil.h2
-rw-r--r--freebsd/sys/netinet/tcp.h228
-rw-r--r--freebsd/sys/netinet/tcp_debug.c48
-rw-r--r--freebsd/sys/netinet/tcp_debug.h6
-rw-r--r--freebsd/sys/netinet/tcp_fsm.h4
-rw-r--r--freebsd/sys/netinet/tcp_hostcache.c62
-rw-r--r--freebsd/sys/netinet/tcp_hostcache.h6
-rw-r--r--freebsd/sys/netinet/tcp_input.c110
-rw-r--r--freebsd/sys/netinet/tcp_lro.c40
-rw-r--r--freebsd/sys/netinet/tcp_lro.h6
-rw-r--r--freebsd/sys/netinet/tcp_offload.c50
-rw-r--r--freebsd/sys/netinet/tcp_offload.h10
-rw-r--r--freebsd/sys/netinet/tcp_output.c84
-rw-r--r--freebsd/sys/netinet/tcp_reass.c82
-rw-r--r--freebsd/sys/netinet/tcp_sack.c94
-rw-r--r--freebsd/sys/netinet/tcp_seq.h6
-rw-r--r--freebsd/sys/netinet/tcp_subr.c122
-rw-r--r--freebsd/sys/netinet/tcp_syncache.c108
-rw-r--r--freebsd/sys/netinet/tcp_syncache.h6
-rw-r--r--freebsd/sys/netinet/tcp_timer.c62
-rw-r--r--freebsd/sys/netinet/tcp_timer.h6
-rw-r--r--freebsd/sys/netinet/tcp_timewait.c98
-rw-r--r--freebsd/sys/netinet/tcp_usrreq.c80
-rw-r--r--freebsd/sys/netinet/tcp_var.h16
-rw-r--r--freebsd/sys/netinet/tcpip.h4
-rw-r--r--freebsd/sys/netinet/toedev.h6
-rw-r--r--freebsd/sys/netinet/udp.h69
-rw-r--r--freebsd/sys/netinet/udp_usrreq.c94
-rw-r--r--freebsd/sys/netinet/udp_var.h4
-rw-r--r--freebsd/sys/netinet6/dest6.c42
-rw-r--r--freebsd/sys/netinet6/frag6.c54
-rw-r--r--freebsd/sys/netinet6/icmp6.c92
-rw-r--r--freebsd/sys/netinet6/in6.c88
-rw-r--r--freebsd/sys/netinet6/in6.h6
-rw-r--r--freebsd/sys/netinet6/in6_cksum.c16
-rw-r--r--freebsd/sys/netinet6/in6_gif.c66
-rw-r--r--freebsd/sys/netinet6/in6_gif.h6
-rw-r--r--freebsd/sys/netinet6/in6_ifattach.c72
-rw-r--r--freebsd/sys/netinet6/in6_ifattach.h6
-rw-r--r--freebsd/sys/netinet6/in6_mcast.c68
-rw-r--r--freebsd/sys/netinet6/in6_pcb.c82
-rw-r--r--freebsd/sys/netinet6/in6_pcb.h6
-rw-r--r--freebsd/sys/netinet6/in6_proto.c106
-rw-r--r--freebsd/sys/netinet6/in6_rmx.c64
-rw-r--r--freebsd/sys/netinet6/in6_src.c86
-rw-r--r--freebsd/sys/netinet6/in6_var.h10
-rw-r--r--freebsd/sys/netinet6/ip6_forward.c80
-rw-r--r--freebsd/sys/netinet6/ip6_id.c26
-rw-r--r--freebsd/sys/netinet6/ip6_input.c90
-rw-r--r--freebsd/sys/netinet6/ip6_ipsec.c66
-rw-r--r--freebsd/sys/netinet6/ip6_ipsec.h4
-rw-r--r--freebsd/sys/netinet6/ip6_mroute.c86
-rw-r--r--freebsd/sys/netinet6/ip6_mroute.h10
-rw-r--r--freebsd/sys/netinet6/ip6_output.c86
-rw-r--r--freebsd/sys/netinet6/ip6_var.h6
-rw-r--r--freebsd/sys/netinet6/ip6protosw.h6
-rw-r--r--freebsd/sys/netinet6/mld6.c64
-rw-r--r--freebsd/sys/netinet6/mld6.h6
-rw-r--r--freebsd/sys/netinet6/mld6_var.h6
-rw-r--r--freebsd/sys/netinet6/nd6.c84
-rw-r--r--freebsd/sys/netinet6/nd6.h10
-rw-r--r--freebsd/sys/netinet6/nd6_nbr.c78
-rw-r--r--freebsd/sys/netinet6/nd6_rtr.c70
-rw-r--r--freebsd/sys/netinet6/pim6_var.h6
-rw-r--r--freebsd/sys/netinet6/raw_ip6.c84
-rw-r--r--freebsd/sys/netinet6/raw_ip6.h4
-rw-r--r--freebsd/sys/netinet6/route6.c32
-rw-r--r--freebsd/sys/netinet6/scope6.c32
-rw-r--r--freebsd/sys/netinet6/scope6_var.h6
-rw-r--r--freebsd/sys/netinet6/sctp6_usrreq.c46
-rw-r--r--freebsd/sys/netinet6/sctp6_var.h6
-rw-r--r--freebsd/sys/netinet6/tcp6_var.h6
-rw-r--r--freebsd/sys/netinet6/udp6_usrreq.c94
-rw-r--r--freebsd/sys/netinet6/udp6_var.h6
-rw-r--r--freebsd/sys/netipsec/ah.h6
-rw-r--r--freebsd/sys/netipsec/ah_var.h6
-rw-r--r--freebsd/sys/netipsec/esp.h6
-rw-r--r--freebsd/sys/netipsec/esp_var.h6
-rw-r--r--freebsd/sys/netipsec/ipcomp.h6
-rw-r--r--freebsd/sys/netipsec/ipcomp_var.h6
-rw-r--r--freebsd/sys/netipsec/ipip_var.h6
-rw-r--r--freebsd/sys/netipsec/ipsec.c104
-rw-r--r--freebsd/sys/netipsec/ipsec.h14
-rw-r--r--freebsd/sys/netipsec/ipsec6.h10
-rw-r--r--freebsd/sys/netipsec/ipsec_input.c90
-rw-r--r--freebsd/sys/netipsec/ipsec_mbuf.c20
-rw-r--r--freebsd/sys/netipsec/ipsec_output.c86
-rw-r--r--freebsd/sys/netipsec/key.c98
-rw-r--r--freebsd/sys/netipsec/key.h6
-rw-r--r--freebsd/sys/netipsec/key_debug.c40
-rw-r--r--freebsd/sys/netipsec/key_debug.h6
-rw-r--r--freebsd/sys/netipsec/key_var.h6
-rw-r--r--freebsd/sys/netipsec/keydb.h8
-rw-r--r--freebsd/sys/netipsec/keysock.c66
-rw-r--r--freebsd/sys/netipsec/keysock.h6
-rw-r--r--freebsd/sys/netipsec/xform.h12
-rw-r--r--freebsd/sys/netipsec/xform_ah.c64
-rw-r--r--freebsd/sys/netipsec/xform_esp.c72
-rw-r--r--freebsd/sys/netipsec/xform_ipcomp.c66
-rw-r--r--freebsd/sys/netipsec/xform_ipip.c76
-rw-r--r--freebsd/sys/netipsec/xform_tcp.c58
-rw-r--r--freebsd/sys/nios2/include/machine/in_cksum.h77
-rw-r--r--freebsd/sys/nios2/include/machine/legacyvar.h57
-rw-r--r--freebsd/sys/nios2/include/machine/pci_cfgreg.h52
-rw-r--r--freebsd/sys/nios2/nios2/in_cksum.c255
-rw-r--r--freebsd/sys/nios2/nios2/legacy.c347
-rw-r--r--freebsd/sys/nios2/pci/pci_bus.c729
-rw-r--r--freebsd/sys/opencrypto/cast.c10
-rw-r--r--freebsd/sys/opencrypto/cast.h6
-rw-r--r--freebsd/sys/opencrypto/criov.c22
-rw-r--r--freebsd/sys/opencrypto/crypto.c48
-rw-r--r--freebsd/sys/opencrypto/cryptodev.c52
-rw-r--r--freebsd/sys/opencrypto/cryptodev.h8
-rw-r--r--freebsd/sys/opencrypto/cryptosoft.c54
-rw-r--r--freebsd/sys/opencrypto/cryptosoft.h6
-rw-r--r--freebsd/sys/opencrypto/deflate.c26
-rw-r--r--freebsd/sys/opencrypto/deflate.h8
-rw-r--r--freebsd/sys/opencrypto/rmd160.c12
-rw-r--r--freebsd/sys/opencrypto/skipjack.c8
-rw-r--r--freebsd/sys/opencrypto/xform.c52
-rw-r--r--freebsd/sys/opencrypto/xform.h16
-rw-r--r--freebsd/sys/powerpc/include/machine/cpufunc.h12
-rw-r--r--freebsd/sys/powerpc/include/machine/in_cksum.h (renamed from freebsd/netinet/udp.h)65
-rw-r--r--freebsd/sys/powerpc/include/machine/legacyvar.h57
-rw-r--r--freebsd/sys/powerpc/include/machine/pci_cfgreg.h52
-rw-r--r--freebsd/sys/powerpc/include/machine/psl.h6
-rw-r--r--freebsd/sys/powerpc/include/machine/spr.h6
-rw-r--r--freebsd/sys/powerpc/pci/pci_bus.c729
-rw-r--r--freebsd/sys/powerpc/powerpc/in_cksum.c18
-rw-r--r--freebsd/sys/powerpc/powerpc/legacy.c347
-rw-r--r--freebsd/sys/rpc/types.h4
-rw-r--r--freebsd/sys/security/mac/mac_framework.h10
-rw-r--r--freebsd/sys/sh/include/machine/in_cksum.h77
-rw-r--r--freebsd/sys/sh/include/machine/legacyvar.h57
-rw-r--r--freebsd/sys/sh/include/machine/pci_cfgreg.h52
-rw-r--r--freebsd/sys/sh/pci/pci_bus.c729
-rw-r--r--freebsd/sys/sh/sh/in_cksum.c255
-rw-r--r--freebsd/sys/sh/sh/legacy.c347
-rw-r--r--freebsd/sys/socket.h691
-rw-r--r--freebsd/sys/socketvar.h393
-rw-r--r--freebsd/sys/sparc/include/machine/in_cksum.h77
-rw-r--r--freebsd/sys/sparc/include/machine/legacyvar.h57
-rw-r--r--freebsd/sys/sparc/include/machine/pci_cfgreg.h52
-rw-r--r--freebsd/sys/sparc/pci/pci_bus.c729
-rw-r--r--freebsd/sys/sparc/sparc/in_cksum.c255
-rw-r--r--freebsd/sys/sparc/sparc/legacy.c347
-rw-r--r--freebsd/sys/sparc64/include/machine/asi.h6
-rw-r--r--freebsd/sys/sparc64/include/machine/cpufunc.h10
-rw-r--r--freebsd/sys/sparc64/include/machine/in_cksum.h171
-rw-r--r--freebsd/sys/sparc64/include/machine/legacyvar.h57
-rw-r--r--freebsd/sys/sparc64/include/machine/pci_cfgreg.h52
-rw-r--r--freebsd/sys/sparc64/include/machine/pstate.h6
-rw-r--r--freebsd/sys/sparc64/pci/pci_bus.c729
-rw-r--r--freebsd/sys/sparc64/sparc64/in_cksum.c18
-rw-r--r--freebsd/sys/sparc64/sparc64/legacy.c347
-rw-r--r--freebsd/sys/sys/_bus_dma.h6
-rw-r--r--freebsd/sys/sys/_lock.h10
-rw-r--r--freebsd/sys/sys/_lockmgr.h6
-rw-r--r--freebsd/sys/sys/_mutex.h6
-rw-r--r--freebsd/sys/sys/_rmlock.h10
-rw-r--r--freebsd/sys/sys/_rwlock.h6
-rw-r--r--freebsd/sys/sys/_semaphore.h8
-rw-r--r--freebsd/sys/sys/_sigset.h6
-rw-r--r--freebsd/sys/sys/_sx.h6
-rw-r--r--freebsd/sys/sys/_task.h8
-rw-r--r--freebsd/sys/sys/_timeval.h57
-rw-r--r--freebsd/sys/sys/acl.h12
-rw-r--r--freebsd/sys/sys/aio.h8
-rw-r--r--freebsd/sys/sys/ata.h8
-rw-r--r--freebsd/sys/sys/bitstring.h6
-rw-r--r--freebsd/sys/sys/buf.h20
-rw-r--r--freebsd/sys/sys/buf_ring.h10
-rw-r--r--freebsd/sys/sys/bufobj.h12
-rw-r--r--freebsd/sys/sys/bus.h18
-rw-r--r--freebsd/sys/sys/bus_dma.h8
-rw-r--r--freebsd/sys/sys/callout.h8
-rw-r--r--freebsd/sys/sys/condvar.h12
-rw-r--r--freebsd/sys/sys/conf.h10
-rw-r--r--freebsd/sys/sys/cpu.h8
-rw-r--r--freebsd/sys/sys/ctype.h6
-rw-r--r--freebsd/sys/sys/domain.h6
-rw-r--r--freebsd/sys/sys/endian.h12
-rw-r--r--freebsd/sys/sys/event.h10
-rw-r--r--freebsd/sys/sys/eventhandler.h8
-rw-r--r--freebsd/sys/sys/eventvar.h8
-rw-r--r--freebsd/sys/sys/fcntl.h10
-rw-r--r--freebsd/sys/sys/file.h18
-rw-r--r--freebsd/sys/sys/filedesc.h18
-rw-r--r--freebsd/sys/sys/filio.h8
-rw-r--r--freebsd/sys/sys/hash.h8
-rw-r--r--freebsd/sys/sys/interrupt.h8
-rw-r--r--freebsd/sys/sys/jail.h18
-rw-r--r--freebsd/sys/sys/kenv.h6
-rw-r--r--freebsd/sys/sys/kernel.h10
-rw-r--r--freebsd/sys/sys/kobj.h6
-rw-r--r--freebsd/sys/sys/kthread.h8
-rw-r--r--freebsd/sys/sys/ktr.h6
-rw-r--r--freebsd/sys/sys/libkern.h12
-rw-r--r--freebsd/sys/sys/limits.h105
-rw-r--r--freebsd/sys/sys/linker.h12
-rw-r--r--freebsd/sys/sys/linker_set.h6
-rw-r--r--freebsd/sys/sys/lock_profile.h10
-rw-r--r--freebsd/sys/sys/lockmgr.h16
-rw-r--r--freebsd/sys/sys/mac.h6
-rw-r--r--freebsd/sys/sys/malloc.h14
-rw-r--r--freebsd/sys/sys/mbuf.h14
-rw-r--r--freebsd/sys/sys/md5.h8
-rw-r--r--freebsd/sys/sys/mman.h239
-rw-r--r--freebsd/sys/sys/module.h10
-rw-r--r--freebsd/sys/sys/mount.h20
-rw-r--r--freebsd/sys/sys/mqueue.h4
-rw-r--r--freebsd/sys/sys/mutex.h26
-rw-r--r--freebsd/sys/sys/osd.h8
-rw-r--r--freebsd/sys/sys/pciio.h8
-rw-r--r--freebsd/sys/sys/pcpu.h14
-rw-r--r--freebsd/sys/sys/poll.h8
-rw-r--r--freebsd/sys/sys/priority.h6
-rw-r--r--freebsd/sys/sys/priv.h6
-rw-r--r--freebsd/sys/sys/proc.h48
-rw-r--r--freebsd/sys/sys/protosw.h4
-rw-r--r--freebsd/sys/sys/queue.h8
-rw-r--r--freebsd/sys/sys/random.h6
-rw-r--r--freebsd/sys/sys/reboot.h4
-rw-r--r--freebsd/sys/sys/refcount.h4
-rw-r--r--freebsd/sys/sys/resourcevar.h14
-rw-r--r--freebsd/sys/sys/rman.h12
-rw-r--r--freebsd/sys/sys/rmlock.h14
-rw-r--r--freebsd/sys/sys/rtprio.h10
-rw-r--r--freebsd/sys/sys/runq.h6
-rw-r--r--freebsd/sys/sys/rwlock.h20
-rw-r--r--freebsd/sys/sys/sbuf.h6
-rw-r--r--freebsd/sys/sys/select.h115
-rw-r--r--freebsd/sys/sys/selinfo.h8
-rw-r--r--freebsd/sys/sys/sf_buf.h8
-rw-r--r--freebsd/sys/sys/sigio.h6
-rw-r--r--freebsd/sys/sys/smp.h6
-rw-r--r--freebsd/sys/sys/sockbuf.h14
-rw-r--r--freebsd/sys/sys/socket.h693
-rw-r--r--freebsd/sys/sys/socketvar.h395
-rw-r--r--freebsd/sys/sys/sockio.h8
-rw-r--r--freebsd/sys/sys/sockopt.h6
-rw-r--r--freebsd/sys/sys/sockstate.h6
-rw-r--r--freebsd/sys/sys/stddef.h14
-rw-r--r--freebsd/sys/sys/stdint.h14
-rw-r--r--freebsd/sys/sys/sx.h20
-rw-r--r--freebsd/sys/sys/sysctl.h764
-rw-r--r--freebsd/sys/sys/syslog.h6
-rw-r--r--freebsd/sys/sys/systm.h20
-rw-r--r--freebsd/sys/sys/taskqueue.h10
-rw-r--r--freebsd/sys/sys/timepps.h10
-rw-r--r--freebsd/sys/sys/timetc.h6
-rw-r--r--freebsd/sys/sys/timex.h16
-rw-r--r--freebsd/sys/sys/tree.h8
-rw-r--r--freebsd/sys/sys/tty.h32
-rw-r--r--freebsd/sys/sys/ttycom.h8
-rw-r--r--freebsd/sys/sys/ttydevsw.h10
-rw-r--r--freebsd/sys/sys/ttydisc.h10
-rw-r--r--freebsd/sys/sys/ttyhook.h10
-rw-r--r--freebsd/sys/sys/ttyqueue.h10
-rw-r--r--freebsd/sys/sys/ucred.h8
-rw-r--r--freebsd/sys/sys/un.h2
-rw-r--r--freebsd/sys/sys/user.h44
-rw-r--r--freebsd/sys/sys/vmmeter.h4
-rw-r--r--freebsd/sys/sysctl.h762
-rw-r--r--freebsd/sys/syslimits.h1
-rw-r--r--freebsd/sys/syslog.h203
-rw-r--r--freebsd/sys/uio.h117
-rw-r--r--freebsd/sys/v850/include/machine/in_cksum.h77
-rw-r--r--freebsd/sys/v850/include/machine/legacyvar.h57
-rw-r--r--freebsd/sys/v850/include/machine/pci_cfgreg.h52
-rw-r--r--freebsd/sys/v850/pci/pci_bus.c729
-rw-r--r--freebsd/sys/v850/v850/in_cksum.c255
-rw-r--r--freebsd/sys/v850/v850/legacy.c347
-rw-r--r--freebsd/sys/vm/uma.h4
-rw-r--r--freebsd/sys/vm/uma_core.c67
-rw-r--r--freebsd/sys/vm/vm.h2
-rw-r--r--freebsd/time.h1
-rw-r--r--freebsd/usr.bin/netstat/atalk.c6
-rw-r--r--freebsd/usr.bin/netstat/bpf.c16
-rw-r--r--freebsd/usr.bin/netstat/if.c24
-rw-r--r--freebsd/usr.bin/netstat/inet.c32
-rw-r--r--freebsd/usr.bin/netstat/inet6.c22
-rw-r--r--freebsd/usr.bin/netstat/ipsec.c9
-rw-r--r--freebsd/usr.bin/netstat/main.c6
-rw-r--r--freebsd/usr.bin/netstat/mbuf.c8
-rw-r--r--freebsd/usr.bin/netstat/mroute.c16
-rw-r--r--freebsd/usr.bin/netstat/mroute6.c23
-rw-r--r--freebsd/usr.bin/netstat/netstat.h7
-rw-r--r--freebsd/usr.bin/netstat/pfkey.c6
-rw-r--r--freebsd/usr.bin/netstat/route.c28
-rw-r--r--freebsd/usr.bin/netstat/sctp.c17
-rw-r--r--freebsd/usr.bin/netstat/unix.c12
-rw-r--r--rtemsbsd/bfin/include/freebsd/machine/cpufunc.h1
-rw-r--r--rtemsbsd/freebsd/machine/_align.h33
-rw-r--r--rtemsbsd/freebsd/machine/_stdint.h30
-rw-r--r--rtemsbsd/freebsd/machine/_types.h30
-rw-r--r--rtemsbsd/freebsd/machine/param.h42
-rw-r--r--rtemsbsd/freebsd/machine/resource.h30
-rw-r--r--rtemsbsd/freebsd/machine/rtems-bsd-select.h76
-rw-r--r--rtemsbsd/freebsd/sys/_iovec.h2
-rw-r--r--rtemsbsd/freebsd/sys/cdefs.h7
-rw-r--r--rtemsbsd/freebsd/sys/signal.h2
-rw-r--r--rtemsbsd/freebsd/sys/uio.h2
-rw-r--r--rtemsbsd/h8300/include/freebsd/machine/cpufunc.h1
-rw-r--r--rtemsbsd/include/machine/_bus.h2
-rw-r--r--rtemsbsd/include/machine/_limits.h35
-rw-r--r--rtemsbsd/include/machine/bus.h8
-rw-r--r--rtemsbsd/include/machine/bus_dma.h2
-rw-r--r--rtemsbsd/include/machine/bus_space-i386.h6
-rw-r--r--rtemsbsd/include/machine/elf.h1
-rw-r--r--rtemsbsd/include/machine/mutex.h31
-rw-r--r--rtemsbsd/include/machine/pcb.h1
-rw-r--r--rtemsbsd/include/machine/resource.h38
-rw-r--r--rtemsbsd/include/machine/rtems-bsd-bus-dma.h12
-rw-r--r--rtemsbsd/include/machine/rtems-bsd-config.h.in137
-rw-r--r--rtemsbsd/include/machine/rtems-bsd-devicet.h2
-rw-r--r--rtemsbsd/include/machine/rtems-bsd-endian.h107
-rw-r--r--rtemsbsd/include/machine/rtems-bsd-param.h (renamed from freebsd/sys/_iovec.h)75
-rw-r--r--rtemsbsd/include/machine/rtems-bsd-symbols.h1
-rw-r--r--rtemsbsd/include/machine/rtems-bsd-syscall-api.h59
-rw-r--r--rtemsbsd/include/machine/rtems-bsd-sysinit.h6
-rw-r--r--rtemsbsd/include/machine/smp.h1
-rw-r--r--rtemsbsd/include/machine/vm.h1
-rw-r--r--rtemsbsd/include/poll.h3
-rw-r--r--rtemsbsd/include/pthread_np.h (renamed from freebsd/machine/sf_buf.h)0
-rw-r--r--rtemsbsd/include/rtems/bsd/bsd.h37
-rw-r--r--rtemsbsd/include/rtems/bsd/local/vnode_if.h4
-rw-r--r--rtemsbsd/include/rtems/bsd/sys/_types.h116
-rw-r--r--rtemsbsd/include/rtems/bsd/sys/errno.h8
-rw-r--r--rtemsbsd/include/rtems/bsd/sys/lock.h10
-rw-r--r--rtemsbsd/include/rtems/bsd/sys/param.h33
-rw-r--r--rtemsbsd/include/rtems/bsd/sys/resource.h16
-rw-r--r--rtemsbsd/include/rtems/bsd/sys/time.h21
-rw-r--r--rtemsbsd/include/rtems/bsd/sys/timespec.h90
-rw-r--r--rtemsbsd/include/rtems/bsd/sys/types.h18
-rw-r--r--rtemsbsd/include/rtems/bsd/sys/unistd.h12
-rw-r--r--rtemsbsd/include/sys/_pthreadtypes.h2
-rw-r--r--rtemsbsd/include/sys/signalvar.h2
-rw-r--r--rtemsbsd/include/vm/vm_extern.h (renamed from freebsd/sys/_pthreadtypes.h)0
-rw-r--r--rtemsbsd/include/vm/vm_kern.h (renamed from freebsd/sys/sched.h)0
-rw-r--r--rtemsbsd/include/vm/vm_object.h (renamed from freebsd/sys/select.h)0
-rw-r--r--rtemsbsd/include/vm/vm_page.h (renamed from freebsd/sys/stat.h)0
-rw-r--r--rtemsbsd/lm32/include/freebsd/machine/cpufunc.h1
-rw-r--r--rtemsbsd/local/bus_if.c18
-rw-r--r--rtemsbsd/local/cryptodev_if.c16
-rw-r--r--rtemsbsd/local/device_if.c14
-rw-r--r--rtemsbsd/local/miibus_if.c14
-rw-r--r--rtemsbsd/local/pci_if.c14
-rw-r--r--rtemsbsd/local/pcib_if.c16
-rw-r--r--rtemsbsd/local/usb_if.c14
-rw-r--r--rtemsbsd/m32c/include/freebsd/machine/cpufunc.h1
-rw-r--r--rtemsbsd/m32r/include/freebsd/machine/cpufunc.h1
-rw-r--r--rtemsbsd/m68k/include/freebsd/machine/cpufunc.h1
-rw-r--r--rtemsbsd/nios2/include/freebsd/machine/cpufunc.h1
-rw-r--r--rtemsbsd/rtems/ipsec_get_policylen.c4
-rw-r--r--rtemsbsd/rtems/kvm_private.h2
-rw-r--r--rtemsbsd/rtems/rtems-bsd-assert.c6
-rw-r--r--rtemsbsd/rtems/rtems-bsd-autoconf.c12
-rw-r--r--rtemsbsd/rtems/rtems-bsd-bus-dma-mbuf.c6
-rw-r--r--rtemsbsd/rtems/rtems-bsd-bus-dma.c10
-rw-r--r--rtemsbsd/rtems/rtems-bsd-cam.c36
-rw-r--r--rtemsbsd/rtems/rtems-bsd-condvar.c14
-rw-r--r--rtemsbsd/rtems/rtems-bsd-conf.c6
-rw-r--r--rtemsbsd/rtems/rtems-bsd-copyinout.c2
-rw-r--r--rtemsbsd/rtems/rtems-bsd-delay.c10
-rw-r--r--rtemsbsd/rtems/rtems-bsd-descrip.c38
-rw-r--r--rtemsbsd/rtems/rtems-bsd-generic.c30
-rw-r--r--rtemsbsd/rtems/rtems-bsd-init-with-irq.c4
-rw-r--r--rtemsbsd/rtems/rtems-bsd-init.c18
-rw-r--r--rtemsbsd/rtems/rtems-bsd-jail.c60
-rw-r--r--rtemsbsd/rtems/rtems-bsd-lock.c20
-rw-r--r--rtemsbsd/rtems/rtems-bsd-log.c6
-rw-r--r--rtemsbsd/rtems/rtems-bsd-malloc.c12
-rw-r--r--rtemsbsd/rtems/rtems-bsd-mutex.c14
-rw-r--r--rtemsbsd/rtems/rtems-bsd-nexus.c32
-rw-r--r--rtemsbsd/rtems/rtems-bsd-page.c8
-rw-r--r--rtemsbsd/rtems/rtems-bsd-panic.c16
-rw-r--r--rtemsbsd/rtems/rtems-bsd-pci_bus.c71
-rw-r--r--rtemsbsd/rtems/rtems-bsd-pci_cfgreg.c22
-rw-r--r--rtemsbsd/rtems/rtems-bsd-rwlock.c17
-rw-r--r--rtemsbsd/rtems/rtems-bsd-shell.c24
-rw-r--r--rtemsbsd/rtems/rtems-bsd-signal.c8
-rw-r--r--rtemsbsd/rtems/rtems-bsd-smp.c10
-rw-r--r--rtemsbsd/rtems/rtems-bsd-subr_param.c2
-rw-r--r--rtemsbsd/rtems/rtems-bsd-support.c10
-rw-r--r--rtemsbsd/rtems/rtems-bsd-sx.c12
-rw-r--r--rtemsbsd/rtems/rtems-bsd-synch.c20
-rw-r--r--rtemsbsd/rtems/rtems-bsd-syscall-api.c32
-rw-r--r--rtemsbsd/rtems/rtems-bsd-syscalls.c36
-rw-r--r--rtemsbsd/rtems/rtems-bsd-sysctl.c7
-rw-r--r--rtemsbsd/rtems/rtems-bsd-sysctlbyname.c8
-rw-r--r--rtemsbsd/rtems/rtems-bsd-sysctlnametomib.c8
-rw-r--r--rtemsbsd/rtems/rtems-bsd-taskqueue.c2
-rw-r--r--rtemsbsd/rtems/rtems-bsd-thread.c26
-rw-r--r--rtemsbsd/rtems/rtems-bsd-thread0-ucred.c16
-rw-r--r--rtemsbsd/rtems/rtems-bsd-timesupport.c2
-rw-r--r--rtemsbsd/rtems/rtems-bsd-vm_glue.c18
-rw-r--r--rtemsbsd/rtems/rtems-net-setup.c3
-rw-r--r--rtemsbsd/rtems/rtems-syspoll.c2
-rw-r--r--rtemsbsd/rtems/rtems-uthread_kqueue.c2
-rw-r--r--rtemsbsd/rtems/syslog.c2
-rw-r--r--rtemsbsd/sh/include/freebsd/machine/cpufunc.h1
-rw-r--r--rtemsbsd/sparc/include/freebsd/machine/cpufunc.h1
-rw-r--r--rtemsbsd/sys/dev/usb/controller/ehci_mpc83xx.c66
-rw-r--r--rtemsbsd/sys/dev/usb/controller/ohci_lpc24xx.c66
-rw-r--r--rtemsbsd/sys/dev/usb/controller/ohci_lpc32xx.c66
-rw-r--r--rtemsbsd/v850/include/freebsd/machine/cpufunc.h1
-rw-r--r--services/librpc/src/rpc/auth_none.c1
-rw-r--r--services/librpc/src/rpc/auth_unix.c1
-rw-r--r--services/librpc/src/rpc/authunix_prot.c1
-rw-r--r--services/librpc/src/rpc/bindresvport.c1
-rw-r--r--services/librpc/src/rpc/clnt_generic.c1
-rw-r--r--services/librpc/src/rpc/clnt_perror.c1
-rw-r--r--services/librpc/src/rpc/clnt_raw.c1
-rw-r--r--services/librpc/src/rpc/clnt_simple.c1
-rw-r--r--services/librpc/src/rpc/clnt_tcp.c1
-rw-r--r--services/librpc/src/rpc/clnt_udp.c1
-rw-r--r--services/librpc/src/rpc/get_myaddress.c1
-rw-r--r--services/librpc/src/rpc/getrpcent.c1
-rw-r--r--services/librpc/src/rpc/getrpcport.c1
-rw-r--r--services/librpc/src/rpc/netname.c1
-rw-r--r--services/librpc/src/rpc/netnamer.c1
-rw-r--r--services/librpc/src/rpc/pmap_clnt.c1
-rw-r--r--services/librpc/src/rpc/pmap_getmaps.c1
-rw-r--r--services/librpc/src/rpc/pmap_getport.c1
-rw-r--r--services/librpc/src/rpc/pmap_prot.c1
-rw-r--r--services/librpc/src/rpc/pmap_prot2.c1
-rw-r--r--services/librpc/src/rpc/rpc_callmsg.c1
-rw-r--r--services/librpc/src/rpc/rpc_commondata.c1
-rw-r--r--services/librpc/src/rpc/rpc_dtablesize.c1
-rw-r--r--services/librpc/src/rpc/rpc_prot.c1
-rw-r--r--services/librpc/src/rpc/rpcdname.c1
-rw-r--r--services/librpc/src/rpc/rtems_portmapper.c1
-rw-r--r--services/librpc/src/rpc/rtems_rpc.c1
-rw-r--r--services/librpc/src/rpc/rtime.c1
-rw-r--r--services/librpc/src/rpc/svc.c1
-rw-r--r--services/librpc/src/rpc/svc_auth.c1
-rw-r--r--services/librpc/src/rpc/svc_auth_unix.c1
-rw-r--r--services/librpc/src/rpc/svc_raw.c1
-rw-r--r--services/librpc/src/rpc/svc_run.c1
-rw-r--r--services/librpc/src/rpc/svc_simple.c1
-rw-r--r--services/librpc/src/rpc/svc_tcp.c1
-rw-r--r--services/librpc/src/rpc/svc_udp.c1
-rw-r--r--services/librpc/src/xdr/xdr.c1
-rw-r--r--services/librpc/src/xdr/xdr_array.c1
-rw-r--r--services/librpc/src/xdr/xdr_float.c1
-rw-r--r--services/librpc/src/xdr/xdr_mem.c1
-rw-r--r--services/librpc/src/xdr/xdr_rec.c1
-rw-r--r--services/librpc/src/xdr/xdr_reference.c1
-rw-r--r--services/librpc/src/xdr/xdr_sizeof.c1
-rw-r--r--services/librpc/src/xdr/xdr_stdio.c1
-rw-r--r--testsuite/Makefile20
-rw-r--r--testsuite/include/rtems/bsd/test/default-init.h (renamed from testsuite/init01/init.c)17
-rw-r--r--testsuite/include/rtems/bsd/test/nic-sysinit.h2
-rw-r--r--testsuite/init01/.gitignore1
-rw-r--r--testsuite/init01/Makefile30
-rw-r--r--testsuite/init01/test_main.c13
-rw-r--r--testsuite/loopback01/.gitignore1
-rw-r--r--testsuite/loopback01/Makefile34
-rw-r--r--testsuite/loopback01/test_main.c20
-rw-r--r--testsuite/mghttpd01/.gitignore1
-rw-r--r--testsuite/mghttpd01/Makefile37
-rw-r--r--testsuite/netshell01/.gitignore1
-rw-r--r--testsuite/netshell01/Makefile30
-rw-r--r--testsuite/netshell01/test_main.c11
-rw-r--r--testsuite/swi01/Makefile27
-rw-r--r--testsuite/swi01/init.c2
-rw-r--r--testsuite/swi01/swi_test.c26
-rw-r--r--testsuite/timeout01/Makefile27
-rw-r--r--testsuite/timeout01/init.c2
-rw-r--r--testsuite/timeout01/timeout_helper.c6
-rw-r--r--testsuite/timeout01/timeout_test.c14
-rw-r--r--testsuite/usb01/Makefile33
-rw-r--r--testsuite/usb01/init.c16
-rw-r--r--testsuite/usb01/usb-sysinit.h2
1305 files changed, 44208 insertions, 41143 deletions
diff --git a/.gitignore b/.gitignore
index 00d95a67..5c27dbc2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,73 +1,19 @@
+*.a
*.d
-*.rel
*.o
-*.dep
*.exe
*.map
-o-optimize
-copied
libbsd.html
-freebsd-userspace/commands/sbin/route/keywords.h
-freebsd-userspace/include/rpc/rpcb_prot.h
-freebsd-userspace/lib/libipsec/y.tab.h
-freebsd-userspace/lib/libc/net/y.tab.h
-freebsd-userspace/lib/libipsec/policy_parse.c
-freebsd-userspace/lib/libipsec/policy_token.c
-freebsd-userspace/lib/libipsec/y.tab.h
-rtemsbsd/freebsd/machine/rtems-bsd-config.h
-rtemsbsd/avr/avr/in_cksum.c
-rtemsbsd/avr/include/freebsd/machine/in_cksum.h
-rtemsbsd/bfin/bfin/in_cksum.c
-rtemsbsd/bfin/include/freebsd/machine/in_cksum.h
-rtemsbsd/h8300/h8300/in_cksum.c
-rtemsbsd/h8300/include/freebsd/machine/in_cksum.h
-rtemsbsd/lm32/lm32/in_cksum.c
-rtemsbsd/lm32/include/freebsd/machine/in_cksum.h
-rtemsbsd/m32c/m32c/in_cksum.c
-rtemsbsd/m32c/include/freebsd/machine/in_cksum.h
-rtemsbsd/m32r/m32r/in_cksum.c
-rtemsbsd/m32r/include/freebsd/machine/in_cksum.h
-rtemsbsd/m68k/m68k/in_cksum.c
-rtemsbsd/m68k/include/freebsd/machine/in_cksum.h
-rtemsbsd/nios2/nios2/in_cksum.c
-rtemsbsd/nios2/include/freebsd/machine/in_cksum.h
-rtemsbsd/sh/sh/in_cksum.c
-rtemsbsd/sh/include/freebsd/machine/in_cksum.h
-rtemsbsd/sparc/sparc/in_cksum.c
-rtemsbsd/sparc/include/freebsd/machine/in_cksum.h
-rtemsbsd/v850/v850/in_cksum.c
-rtemsbsd/v850/include/freebsd/machine/in_cksum.h
-rtemsbsd/arm/include/freebsd/machine/legacyvar.h
-rtemsbsd/arm/include/freebsd/machine/pci_cfgreg.h
-rtemsbsd/avr/include/freebsd/machine/legacyvar.h
-rtemsbsd/avr/include/freebsd/machine/pci_cfgreg.hs
-rtemsbsd/bfin/include/freebsd/machine/legacyvar.h
-rtemsbsd/bfin/include/freebsd/machine/pci_cfgreg.h
-rtemsbsd/h8300/include/freebsd/machine/legacyvar.h
-rtemsbsd/h8300/include/freebsd/machine/pci_cfgreg.h
-rtemsbsd/lm32/include/freebsd/machine/legacyvar.h
-rtemsbsd/lm32/include/freebsd/machine/pci_cfgreg.h
-rtemsbsd/m32c/include/freebsd/machine/legacyvar.h
-rtemsbsd/m32c/include/freebsd/machine/pci_cfgreg.h
-rtemsbsd/m32r/include/freebsd/machine/legacyvar.h
-rtemsbsd/m32r/include/freebsd/machine/pci_cfgreg.h
-rtemsbsd/m68k/include/freebsd/machine/legacyvar.h
-rtemsbsd/m68k/include/freebsd/machine/pci_cfgreg.h
-rtemsbsd/mips/include/freebsd/machine/legacyvar.h
-rtemsbsd/mips/include/freebsd/machine/pci_cfgreg.h
-rtemsbsd/nios2/include/freebsd/machine/legacyvar.h
-rtemsbsd/nios2/include/freebsd/machine/pci_cfgreg.h
-rtemsbsd/powerpc/include/freebsd/machine/legacyvar.h
-rtemsbsd/powerpc/include/freebsd/machine/pci_cfgreg.h
-rtemsbsd/sh/include/freebsd/machine/legacyvar.h
-rtemsbsd/sh/include/freebsd/machine/pci_cfgreg.h
-rtemsbsd/sparc/include/freebsd/machine/legacyvar.h
-rtemsbsd/sparc/include/freebsd/machine/pci_cfgreg.h
-rtemsbsd/sparc64/include/freebsd/machine/legacyvar.h
-rtemsbsd/sparc64/include/freebsd/machine/pci_cfgreg.h
-rtemsbsd/v850/include/freebsd/machine/legacyvar.h
-rtemsbsd/v850/include/freebsd/machine/pci_cfgreg.h
-freebsd-userspace/lib/libc/net/nslexer.c
-freebsd-userspace/lib/libc/net/nsparser.c
-freebsd-userspace/lib/libc/net/nsparser.i
-freebsd-userspace/rtems/rtems-kvm-symbols.c
+freebsd/sbin/route/keywords.h
+freebsd/include/rpc/rpcb_prot.h
+freebsd/lib/libipsec/y.tab.h
+freebsd/lib/libipsec/policy_parse.c
+freebsd/lib/libipsec/policy_token.c
+freebsd/lib/libc/net/nsparser.h
+freebsd/lib/libc/net/nslexer.c
+freebsd/lib/libc/net/nsparser.c
+rtemsbsd/rtems/rtems-kvm-symbols.c
+rtemsbsd/include/machine/rtems-bsd-config.h
+/*.i
+/*.s
+/log
diff --git a/Makefile b/Makefile
index eaa2ad2d..0aee1d06 100644
--- a/Makefile
+++ b/Makefile
@@ -4,999 +4,885 @@ include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
include $(RTEMS_CUSTOM)
include $(PROJECT_ROOT)/make/leaf.cfg
-CFLAGS += -ffreestanding
-CFLAGS += -I .
-CFLAGS += -I rtemsbsd
-CFLAGS += -I rtemsbsd/$(RTEMS_CPU)/include
-CFLAGS += -I freebsd/$(RTEMS_CPU)/include
-CFLAGS += -I contrib/altq
-CFLAGS += -I contrib/pf
-CFLAGS += -I copied/rtemsbsd/$(RTEMS_CPU)/include
-CFLAGS += -w
+CFLAGS += -ffreestanding
+CFLAGS += -Irtemsbsd/include
+CFLAGS += -Irtemsbsd/$(RTEMS_CPU)/include
+CFLAGS += -Ifreebsd/sys
+CFLAGS += -Ifreebsd/sys/$(RTEMS_CPU)/include
+CFLAGS += -Ifreebsd/sys/contrib/altq
+CFLAGS += -Ifreebsd/sys/contrib/pf
+CFLAGS += -Icopied/rtemsbsd/$(RTEMS_CPU)/include
+CFLAGS += -Ifreebsd/include
+CFLAGS += -Ifreebsd/lib/libc/include
+CFLAGS += -Ifreebsd/lib/libc/isc/include
+CFLAGS += -Ifreebsd/lib/libc/resolv
+CFLAGS += -Ifreebsd/lib/libutil
+CFLAGS += -Ifreebsd/lib/libkvm
+CFLAGS += -Ifreebsd/lib/libmemstat
+CFLAGS += -Ifreebsd/lib/libipsec
+CFLAGS += -Itestsuite/include
+CFLAGS += -D__FreeBSD__
+CFLAGS += -D__DBINTERFACE_PRIVATE
+CFLAGS += -w
CFLAGS += -std=gnu99
CFLAGS += -MT $@ -MD -MP -MF $(basename $@).d
NEED_DUMMY_PIC_IRQ=yes
# do nothing default so sed on rtems-bsd-config.h always works.
SED_PATTERN += -e 's/^//'
-GENERATED_FILES = rtemsbsd/freebsd/machine/rtems-bsd-config.h
-C_FILES =
-C_FILES += rtemsbsd/dev/usb/controller/ohci_lpc24xx.c
-C_FILES += rtemsbsd/dev/usb/controller/ohci_lpc32xx.c
-C_FILES += rtemsbsd/dev/usb/controller/ehci_mpc83xx.c
-C_FILES += rtemsbsd/src/rtems-bsd-thread0-ucred.c
-C_FILES += rtemsbsd/src/rtems-bsd-cam.c
-C_FILES += rtemsbsd/src/rtems-bsd-nexus.c
-C_FILES += rtemsbsd/src/rtems-bsd-autoconf.c
-C_FILES += rtemsbsd/src/rtems-bsd-delay.c
-C_FILES += rtemsbsd/src/rtems-bsd-mutex.c
-C_FILES += rtemsbsd/src/rtems-bsd-thread.c
-C_FILES += rtemsbsd/src/rtems-bsd-condvar.c
-C_FILES += rtemsbsd/src/rtems-bsd-lock.c
-C_FILES += rtemsbsd/src/rtems-bsd-log.c
-C_FILES += rtemsbsd/src/rtems-bsd-sx.c
-C_FILES += rtemsbsd/src/rtems-bsd-rwlock.c
-C_FILES += rtemsbsd/src/rtems-bsd-page.c
-C_FILES += rtemsbsd/src/rtems-bsd-panic.c
-C_FILES += rtemsbsd/src/rtems-bsd-synch.c
-C_FILES += rtemsbsd/src/rtems-bsd-signal.c
-C_FILES += rtemsbsd/src/rtems-bsd-init.c
-C_FILES += rtemsbsd/src/rtems-bsd-init-with-irq.c
-C_FILES += rtemsbsd/src/rtems-bsd-assert.c
-C_FILES += rtemsbsd/src/rtems-bsd-jail.c
-C_FILES += rtemsbsd/src/rtems-bsd-shell.c
-C_FILES += rtemsbsd/src/rtems-bsd-syscalls.c
-C_FILES += rtemsbsd/src/rtems-bsd-smp.c
-C_FILES += rtemsbsd/src/rtems-bsd-malloc.c
-C_FILES += rtemsbsd/src/rtems-bsd-support.c
-C_FILES += rtemsbsd/src/rtems-bsd-bus-dma.c
-C_FILES += rtemsbsd/src/rtems-bsd-bus-dma-mbuf.c
-C_FILES += rtemsbsd/src/rtems-bsd-sysctl.c
-C_FILES += rtemsbsd/src/rtems-bsd-sysctlbyname.c
-C_FILES += rtemsbsd/src/rtems-bsd-sysctlnametomib.c
-C_FILES += rtemsbsd/src/rtems-bsd-taskqueue.c
-C_FILES += rtemsbsd/src/rtems-bsd-timesupport.c
-C_FILES += rtemsbsd/src/rtems-bsd-newproc.c
-C_FILES += rtemsbsd/src/rtems-bsd-vm_glue.c
-C_FILES += rtemsbsd/src/rtems-bsd-copyinout.c
-C_FILES += rtemsbsd/src/rtems-bsd-descrip.c
-C_FILES += rtemsbsd/src/rtems-bsd-conf.c
-C_FILES += rtemsbsd/src/rtems-bsd-subr_param.c
-C_FILES += rtemsbsd/src/rtems-bsd-pci_cfgreg.c
-C_FILES += rtemsbsd/src/rtems-bsd-pci_bus.c
-C_FILES += freebsd/kern/subr_eventhandler.c
-C_FILES += freebsd/kern/kern_subr.c
-C_FILES += freebsd/kern/kern_tc.c
-C_FILES += freebsd/libkern/fls.c
-C_FILES += freebsd/net/bridgestp.c
-C_FILES += freebsd/net/ieee8023ad_lacp.c
-C_FILES += freebsd/net/if_atmsubr.c
-C_FILES += freebsd/net/if.c
-C_FILES += freebsd/net/if_clone.c
-C_FILES += freebsd/net/if_dead.c
-C_FILES += freebsd/net/if_disc.c
-C_FILES += freebsd/net/if_edsc.c
-C_FILES += freebsd/net/if_ef.c
-C_FILES += freebsd/net/if_enc.c
-C_FILES += freebsd/net/if_epair.c
-C_FILES += freebsd/net/if_faith.c
-C_FILES += freebsd/net/if_fddisubr.c
-C_FILES += freebsd/net/if_fwsubr.c
-C_FILES += freebsd/net/if_gif.c
-C_FILES += freebsd/net/if_gre.c
-C_FILES += freebsd/net/if_iso88025subr.c
-C_FILES += freebsd/net/if_lagg.c
-C_FILES += freebsd/net/if_llatbl.c
-C_FILES += freebsd/net/if_loop.c
-C_FILES += freebsd/net/if_media.c
-C_FILES += freebsd/net/if_mib.c
-C_FILES += freebsd/net/if_spppfr.c
-C_FILES += freebsd/net/if_spppsubr.c
-C_FILES += freebsd/net/if_tap.c
-C_FILES += freebsd/net/if_tun.c
-C_FILES += freebsd/net/if_vlan.c
-C_FILES += freebsd/net/pfil.c
-C_FILES += freebsd/net/radix.c
-C_FILES += freebsd/net/radix_mpath.c
-C_FILES += freebsd/net/raw_cb.c
-C_FILES += freebsd/net/raw_usrreq.c
-C_FILES += freebsd/net/route.c
-C_FILES += freebsd/net/rtsock.c
-C_FILES += freebsd/net/slcompress.c
-C_FILES += freebsd/net/zlib.c
-C_FILES += freebsd/net/bpf_buffer.c
-C_FILES += freebsd/net/bpf.c
-C_FILES += freebsd/net/bpf_filter.c
-C_FILES += freebsd/net/bpf_jitter.c
-C_FILES += freebsd/net/if_arcsubr.c
-C_FILES += freebsd/net/if_bridge.c
-C_FILES += freebsd/net/if_ethersubr.c
-C_FILES += freebsd/net/netisr.c
-C_FILES += freebsd/netinet/accf_data.c
-C_FILES += freebsd/netinet/accf_dns.c
-C_FILES += freebsd/netinet/accf_http.c
-C_FILES += freebsd/netinet/if_atm.c
-C_FILES += freebsd/netinet/if_ether.c
-C_FILES += freebsd/netinet/igmp.c
-C_FILES += freebsd/netinet/in.c
-C_FILES += freebsd/netinet/in_gif.c
-C_FILES += freebsd/netinet/in_mcast.c
-C_FILES += freebsd/netinet/in_pcb.c
-C_FILES += freebsd/netinet/in_proto.c
-C_FILES += freebsd/netinet/in_rmx.c
-C_FILES += freebsd/netinet/ip_carp.c
-C_FILES += freebsd/netinet/ip_divert.c
-C_FILES += freebsd/netinet/ip_ecn.c
-C_FILES += freebsd/netinet/ip_encap.c
-C_FILES += freebsd/netinet/ip_fastfwd.c
-C_FILES += freebsd/netinet/ip_gre.c
-C_FILES += freebsd/netinet/ip_icmp.c
-C_FILES += freebsd/netinet/ip_id.c
-C_FILES += freebsd/netinet/ip_input.c
-C_FILES += freebsd/netinet/ip_ipsec.c
-C_FILES += freebsd/netinet/ip_mroute.c
-C_FILES += freebsd/netinet/ip_options.c
-C_FILES += freebsd/netinet/ip_output.c
-C_FILES += freebsd/netinet/raw_ip.c
-C_FILES += freebsd/netinet/sctp_asconf.c
-C_FILES += freebsd/netinet/sctp_auth.c
-C_FILES += freebsd/netinet/sctp_bsd_addr.c
-C_FILES += freebsd/netinet/sctp_cc_functions.c
-C_FILES += freebsd/netinet/sctp_crc32.c
-C_FILES += freebsd/netinet/sctp_indata.c
-C_FILES += freebsd/netinet/sctp_input.c
-C_FILES += freebsd/netinet/sctp_output.c
-C_FILES += freebsd/netinet/sctp_pcb.c
-C_FILES += freebsd/netinet/sctp_peeloff.c
-C_FILES += freebsd/netinet/sctp_sysctl.c
-C_FILES += freebsd/netinet/sctp_timer.c
-C_FILES += freebsd/netinet/sctp_usrreq.c
-C_FILES += freebsd/netinet/sctputil.c
-C_FILES += freebsd/netinet/tcp_debug.c
-C_FILES += freebsd/netinet/tcp_input.c
-C_FILES += freebsd/netinet/tcp_lro.c
-C_FILES += freebsd/netinet/tcp_offload.c
-C_FILES += freebsd/netinet/tcp_output.c
-C_FILES += freebsd/netinet/tcp_reass.c
-C_FILES += freebsd/netinet/tcp_sack.c
-C_FILES += freebsd/netinet/tcp_subr.c
-C_FILES += freebsd/netinet/tcp_syncache.c
-C_FILES += freebsd/netinet/tcp_timer.c
-C_FILES += freebsd/netinet/tcp_timewait.c
-C_FILES += freebsd/netinet/tcp_usrreq.c
-C_FILES += freebsd/netinet/udp_usrreq.c
-C_FILES += freebsd/netinet/ipfw/dn_sched_fifo.c
-C_FILES += freebsd/netinet/ipfw/dn_sched_rr.c
-C_FILES += freebsd/netinet/ipfw/ip_fw_log.c
-C_FILES += freebsd/netinet/ipfw/dn_sched_qfq.c
-C_FILES += freebsd/netinet/ipfw/dn_sched_prio.c
-C_FILES += freebsd/netinet/ipfw/ip_dn_glue.c
-C_FILES += freebsd/netinet/ipfw/ip_fw2.c
-C_FILES += freebsd/netinet/ipfw/dn_heap.c
-C_FILES += freebsd/netinet/ipfw/ip_dummynet.c
-C_FILES += freebsd/netinet/ipfw/ip_fw_sockopt.c
-C_FILES += freebsd/netinet/ipfw/dn_sched_wf2q.c
-C_FILES += freebsd/netinet/ipfw/ip_fw_nat.c
-C_FILES += freebsd/netinet/ipfw/ip_fw_pfil.c
-C_FILES += freebsd/netinet/ipfw/ip_dn_io.c
-C_FILES += freebsd/netinet/ipfw/ip_fw_table.c
-C_FILES += freebsd/netinet/libalias/alias_dummy.c
-C_FILES += freebsd/netinet/libalias/alias_pptp.c
-C_FILES += freebsd/netinet/libalias/alias_smedia.c
-C_FILES += freebsd/netinet/libalias/alias_mod.c
-C_FILES += freebsd/netinet/libalias/alias_cuseeme.c
-C_FILES += freebsd/netinet/libalias/alias_nbt.c
-C_FILES += freebsd/netinet/libalias/alias_irc.c
-C_FILES += freebsd/netinet/libalias/alias_util.c
-C_FILES += freebsd/netinet/libalias/alias_db.c
-C_FILES += freebsd/netinet/libalias/alias_ftp.c
-C_FILES += freebsd/netinet/libalias/alias_proxy.c
-C_FILES += freebsd/netinet/libalias/alias.c
-C_FILES += freebsd/netinet/libalias/alias_skinny.c
-C_FILES += freebsd/netinet/libalias/alias_sctp.c
+TESTS =
+RUN_TESTS =
+O_FILES =
+D_FILES =
+
+LIB = libbsd.a
+LIB_GEN_FILES = rtemsbsd/include/machine/rtems-bsd-config.h
+LIB_C_FILES =
+LIB_C_FILES += rtemsbsd/local/bus_if.c
+LIB_C_FILES += rtemsbsd/local/cryptodev_if.c
+LIB_C_FILES += rtemsbsd/local/device_if.c
+LIB_C_FILES += rtemsbsd/local/miibus_if.c
+LIB_C_FILES += rtemsbsd/local/pcib_if.c
+LIB_C_FILES += rtemsbsd/local/pci_if.c
+LIB_C_FILES += rtemsbsd/local/usb_if.c
+LIB_C_FILES += rtemsbsd/rtems/ipsec_get_policylen.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-assert.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-autoconf.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-bus-dma.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-bus-dma-mbuf.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-cam.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-condvar.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-conf.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-copyinout.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-delay.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-descrip.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-init.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-init-with-irq.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-jail.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-lock.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-log.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-malloc.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-mutex.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-newproc.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-nexus.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-page.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-panic.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-pci_bus.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-pci_cfgreg.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-rwlock.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-shell.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-signal.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-smp.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-subr_param.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-support.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-sx.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-synch.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-syscall-api.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-syscalls.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-sysctlbyname.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-sysctl.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-sysctlnametomib.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-taskqueue.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-thread0-ucred.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-thread.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-timesupport.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-vm_glue.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-getprogname.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-kvm.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-net-setup.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-shell.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-syslog-initialize.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-syspoll.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-uthread_kevent.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-uthread_kqueue.c
+LIB_C_FILES += rtemsbsd/rtems/syslog.c
+LIB_C_FILES += rtemsbsd/sys/dev/usb/controller/ehci_mpc83xx.c
+LIB_C_FILES += rtemsbsd/sys/dev/usb/controller/ohci_lpc24xx.c
+LIB_C_FILES += rtemsbsd/sys/dev/usb/controller/ohci_lpc32xx.c
+LIB_GEN_FILES += rtemsbsd/rtems/rtems-kvm-symbols.c
+LIB_C_FILES += rtemsbsd/rtems/rtems-kvm-symbols.c
+rtemsbsd/rtems/rtems-kvm-symbols.c: rtemsbsd/rtems/generate_kvm_symbols
+ ./$< > $@
+LIB_GEN_FILES += freebsd/lib/libc/net/nslexer.c
+LIB_C_FILES += freebsd/lib/libc/net/nslexer.c
+freebsd/lib/libc/net/nslexer.c: freebsd/lib/libc/net/nslexer.l freebsd/lib/libc/net/nsparser.c
+ ${LEX} -P _nsyy -t $< | sed -e '/YY_BUF_SIZE/s/16384/1024/' > $@
+LIB_GEN_FILES += freebsd/lib/libc/net/nsparser.c
+LIB_C_FILES += freebsd/lib/libc/net/nsparser.c
+freebsd/lib/libc/net/nsparser.c: freebsd/lib/libc/net/nsparser.y
+ yacc -b _nsyy -d -p _nsyy $<
+ sed -e /YY_BUF_SIZE/s/16384/1024/ < _nsyy.tab.c > $@
+ rm -f _nsyy.tab.c
+ mv _nsyy.tab.h freebsd/lib/libc/net/nsparser.h
+LIB_GEN_FILES += freebsd/lib/libipsec/policy_token.c
+LIB_C_FILES += freebsd/lib/libipsec/policy_token.c
+freebsd/lib/libipsec/policy_token.c: freebsd/lib/libipsec/policy_token.l freebsd/lib/libipsec/policy_parse.c
+ ${LEX} -P __libipsecyy -t $< | sed -e '/YY_BUF_SIZE/s/16384/1024/' > $@
+LIB_GEN_FILES += freebsd/lib/libipsec/policy_parse.c
+LIB_C_FILES += freebsd/lib/libipsec/policy_parse.c
+freebsd/lib/libipsec/policy_parse.c: freebsd/lib/libipsec/policy_parse.y
+ yacc -b __libipsecyy -d -p __libipsecyy $<
+ sed -e /YY_BUF_SIZE/s/16384/1024/ < __libipsecyy.tab.c > $@
+ rm -f __libipsecyy.tab.c
+ mv __libipsecyy.tab.h freebsd/lib/libipsec/y.tab.h
+LIB_C_FILES += freebsd/sys/kern/init_main.c
+LIB_C_FILES += freebsd/sys/kern/kern_descrip.c
+LIB_C_FILES += freebsd/sys/kern/kern_environment.c
+LIB_C_FILES += freebsd/sys/kern/kern_event.c
+LIB_C_FILES += freebsd/sys/kern/kern_intr.c
+LIB_C_FILES += freebsd/sys/kern/kern_linker.c
+LIB_C_FILES += freebsd/sys/kern/kern_mbuf.c
+LIB_C_FILES += freebsd/sys/kern/kern_mib.c
+LIB_C_FILES += freebsd/sys/kern/kern_module.c
+LIB_C_FILES += freebsd/sys/kern/kern_mtxpool.c
+LIB_C_FILES += freebsd/sys/kern/kern_ntptime.c
+LIB_C_FILES += freebsd/sys/kern/kern_proc.c
+LIB_C_FILES += freebsd/sys/kern/kern_prot.c
+LIB_C_FILES += freebsd/sys/kern/kern_resource.c
+LIB_C_FILES += freebsd/sys/kern/kern_subr.c
+LIB_C_FILES += freebsd/sys/kern/kern_sysctl.c
+LIB_C_FILES += freebsd/sys/kern/kern_tc.c
+LIB_C_FILES += freebsd/sys/kern/kern_time.c
+LIB_C_FILES += freebsd/sys/kern/kern_timeout.c
+LIB_C_FILES += freebsd/sys/kern/subr_bufring.c
+LIB_C_FILES += freebsd/sys/kern/subr_bus.c
+LIB_C_FILES += freebsd/sys/kern/subr_eventhandler.c
+LIB_C_FILES += freebsd/sys/kern/subr_hints.c
+LIB_C_FILES += freebsd/sys/kern/subr_kobj.c
+LIB_C_FILES += freebsd/sys/kern/subr_module.c
+LIB_C_FILES += freebsd/sys/kern/subr_rman.c
+LIB_C_FILES += freebsd/sys/kern/subr_sbuf.c
+LIB_C_FILES += freebsd/sys/kern/subr_unit.c
+LIB_C_FILES += freebsd/sys/kern/sys_generic.c
+LIB_C_FILES += freebsd/sys/kern/uipc_accf.c
+LIB_C_FILES += freebsd/sys/kern/uipc_domain.c
+LIB_C_FILES += freebsd/sys/kern/uipc_mbuf2.c
+LIB_C_FILES += freebsd/sys/kern/uipc_mbuf.c
+LIB_C_FILES += freebsd/sys/kern/uipc_sockbuf.c
+LIB_C_FILES += freebsd/sys/kern/uipc_socket.c
+LIB_C_FILES += freebsd/sys/libkern/arc4random.c
+LIB_C_FILES += freebsd/sys/libkern/fls.c
+LIB_C_FILES += freebsd/sys/libkern/inet_ntoa.c
+LIB_C_FILES += freebsd/sys/libkern/random.c
+LIB_C_FILES += freebsd/sys/vm/uma_core.c
+LIB_C_FILES += freebsd/sys/net/bridgestp.c
+LIB_C_FILES += freebsd/sys/net/ieee8023ad_lacp.c
+LIB_C_FILES += freebsd/sys/net/if_atmsubr.c
+LIB_C_FILES += freebsd/sys/net/if.c
+LIB_C_FILES += freebsd/sys/net/if_clone.c
+LIB_C_FILES += freebsd/sys/net/if_dead.c
+LIB_C_FILES += freebsd/sys/net/if_disc.c
+LIB_C_FILES += freebsd/sys/net/if_edsc.c
+LIB_C_FILES += freebsd/sys/net/if_ef.c
+LIB_C_FILES += freebsd/sys/net/if_enc.c
+LIB_C_FILES += freebsd/sys/net/if_epair.c
+LIB_C_FILES += freebsd/sys/net/if_faith.c
+LIB_C_FILES += freebsd/sys/net/if_fddisubr.c
+LIB_C_FILES += freebsd/sys/net/if_fwsubr.c
+LIB_C_FILES += freebsd/sys/net/if_gif.c
+LIB_C_FILES += freebsd/sys/net/if_gre.c
+LIB_C_FILES += freebsd/sys/net/if_iso88025subr.c
+LIB_C_FILES += freebsd/sys/net/if_lagg.c
+LIB_C_FILES += freebsd/sys/net/if_llatbl.c
+LIB_C_FILES += freebsd/sys/net/if_loop.c
+LIB_C_FILES += freebsd/sys/net/if_media.c
+LIB_C_FILES += freebsd/sys/net/if_mib.c
+LIB_C_FILES += freebsd/sys/net/if_spppfr.c
+LIB_C_FILES += freebsd/sys/net/if_spppsubr.c
+LIB_C_FILES += freebsd/sys/net/if_tap.c
+LIB_C_FILES += freebsd/sys/net/if_tun.c
+LIB_C_FILES += freebsd/sys/net/if_vlan.c
+LIB_C_FILES += freebsd/sys/net/pfil.c
+LIB_C_FILES += freebsd/sys/net/radix.c
+LIB_C_FILES += freebsd/sys/net/radix_mpath.c
+LIB_C_FILES += freebsd/sys/net/raw_cb.c
+LIB_C_FILES += freebsd/sys/net/raw_usrreq.c
+LIB_C_FILES += freebsd/sys/net/route.c
+LIB_C_FILES += freebsd/sys/net/rtsock.c
+LIB_C_FILES += freebsd/sys/net/slcompress.c
+LIB_C_FILES += freebsd/sys/net/zlib.c
+LIB_C_FILES += freebsd/sys/net/bpf_buffer.c
+LIB_C_FILES += freebsd/sys/net/bpf.c
+LIB_C_FILES += freebsd/sys/net/bpf_filter.c
+LIB_C_FILES += freebsd/sys/net/bpf_jitter.c
+LIB_C_FILES += freebsd/sys/net/if_arcsubr.c
+LIB_C_FILES += freebsd/sys/net/if_bridge.c
+LIB_C_FILES += freebsd/sys/net/if_ethersubr.c
+LIB_C_FILES += freebsd/sys/net/netisr.c
+LIB_C_FILES += freebsd/sys/netinet/accf_data.c
+LIB_C_FILES += freebsd/sys/netinet/accf_dns.c
+LIB_C_FILES += freebsd/sys/netinet/accf_http.c
+LIB_C_FILES += freebsd/sys/netinet/if_atm.c
+LIB_C_FILES += freebsd/sys/netinet/if_ether.c
+LIB_C_FILES += freebsd/sys/netinet/igmp.c
+LIB_C_FILES += freebsd/sys/netinet/in.c
+LIB_C_FILES += freebsd/sys/netinet/in_gif.c
+LIB_C_FILES += freebsd/sys/netinet/in_mcast.c
+LIB_C_FILES += freebsd/sys/netinet/in_pcb.c
+LIB_C_FILES += freebsd/sys/netinet/in_proto.c
+LIB_C_FILES += freebsd/sys/netinet/in_rmx.c
+LIB_C_FILES += freebsd/sys/netinet/ip_carp.c
+LIB_C_FILES += freebsd/sys/netinet/ip_divert.c
+LIB_C_FILES += freebsd/sys/netinet/ip_ecn.c
+LIB_C_FILES += freebsd/sys/netinet/ip_encap.c
+LIB_C_FILES += freebsd/sys/netinet/ip_fastfwd.c
+LIB_C_FILES += freebsd/sys/netinet/ip_gre.c
+LIB_C_FILES += freebsd/sys/netinet/ip_icmp.c
+LIB_C_FILES += freebsd/sys/netinet/ip_id.c
+LIB_C_FILES += freebsd/sys/netinet/ip_input.c
+LIB_C_FILES += freebsd/sys/netinet/ip_ipsec.c
+LIB_C_FILES += freebsd/sys/netinet/ip_mroute.c
+LIB_C_FILES += freebsd/sys/netinet/ip_options.c
+LIB_C_FILES += freebsd/sys/netinet/ip_output.c
+LIB_C_FILES += freebsd/sys/netinet/raw_ip.c
+LIB_C_FILES += freebsd/sys/netinet/sctp_asconf.c
+LIB_C_FILES += freebsd/sys/netinet/sctp_auth.c
+LIB_C_FILES += freebsd/sys/netinet/sctp_bsd_addr.c
+LIB_C_FILES += freebsd/sys/netinet/sctp_cc_functions.c
+LIB_C_FILES += freebsd/sys/netinet/sctp_crc32.c
+LIB_C_FILES += freebsd/sys/netinet/sctp_indata.c
+LIB_C_FILES += freebsd/sys/netinet/sctp_input.c
+LIB_C_FILES += freebsd/sys/netinet/sctp_output.c
+LIB_C_FILES += freebsd/sys/netinet/sctp_pcb.c
+LIB_C_FILES += freebsd/sys/netinet/sctp_peeloff.c
+LIB_C_FILES += freebsd/sys/netinet/sctp_sysctl.c
+LIB_C_FILES += freebsd/sys/netinet/sctp_timer.c
+LIB_C_FILES += freebsd/sys/netinet/sctp_usrreq.c
+LIB_C_FILES += freebsd/sys/netinet/sctputil.c
+LIB_C_FILES += freebsd/sys/netinet/tcp_debug.c
+LIB_C_FILES += freebsd/sys/netinet/tcp_input.c
+LIB_C_FILES += freebsd/sys/netinet/tcp_lro.c
+LIB_C_FILES += freebsd/sys/netinet/tcp_offload.c
+LIB_C_FILES += freebsd/sys/netinet/tcp_output.c
+LIB_C_FILES += freebsd/sys/netinet/tcp_reass.c
+LIB_C_FILES += freebsd/sys/netinet/tcp_sack.c
+LIB_C_FILES += freebsd/sys/netinet/tcp_subr.c
+LIB_C_FILES += freebsd/sys/netinet/tcp_syncache.c
+LIB_C_FILES += freebsd/sys/netinet/tcp_timer.c
+LIB_C_FILES += freebsd/sys/netinet/tcp_timewait.c
+LIB_C_FILES += freebsd/sys/netinet/tcp_usrreq.c
+LIB_C_FILES += freebsd/sys/netinet/udp_usrreq.c
+LIB_C_FILES += freebsd/sys/netinet/ipfw/dn_sched_fifo.c
+LIB_C_FILES += freebsd/sys/netinet/ipfw/dn_sched_rr.c
+LIB_C_FILES += freebsd/sys/netinet/ipfw/ip_fw_log.c
+LIB_C_FILES += freebsd/sys/netinet/ipfw/dn_sched_qfq.c
+LIB_C_FILES += freebsd/sys/netinet/ipfw/dn_sched_prio.c
+LIB_C_FILES += freebsd/sys/netinet/ipfw/ip_dn_glue.c
+LIB_C_FILES += freebsd/sys/netinet/ipfw/ip_fw2.c
+LIB_C_FILES += freebsd/sys/netinet/ipfw/dn_heap.c
+LIB_C_FILES += freebsd/sys/netinet/ipfw/ip_dummynet.c
+LIB_C_FILES += freebsd/sys/netinet/ipfw/ip_fw_sockopt.c
+LIB_C_FILES += freebsd/sys/netinet/ipfw/dn_sched_wf2q.c
+LIB_C_FILES += freebsd/sys/netinet/ipfw/ip_fw_nat.c
+LIB_C_FILES += freebsd/sys/netinet/ipfw/ip_fw_pfil.c
+LIB_C_FILES += freebsd/sys/netinet/ipfw/ip_dn_io.c
+LIB_C_FILES += freebsd/sys/netinet/ipfw/ip_fw_table.c
+LIB_C_FILES += freebsd/sys/netinet/libalias/alias_dummy.c
+LIB_C_FILES += freebsd/sys/netinet/libalias/alias_pptp.c
+LIB_C_FILES += freebsd/sys/netinet/libalias/alias_smedia.c
+LIB_C_FILES += freebsd/sys/netinet/libalias/alias_mod.c
+LIB_C_FILES += freebsd/sys/netinet/libalias/alias_cuseeme.c
+LIB_C_FILES += freebsd/sys/netinet/libalias/alias_nbt.c
+LIB_C_FILES += freebsd/sys/netinet/libalias/alias_irc.c
+LIB_C_FILES += freebsd/sys/netinet/libalias/alias_util.c
+LIB_C_FILES += freebsd/sys/netinet/libalias/alias_db.c
+LIB_C_FILES += freebsd/sys/netinet/libalias/alias_ftp.c
+LIB_C_FILES += freebsd/sys/netinet/libalias/alias_proxy.c
+LIB_C_FILES += freebsd/sys/netinet/libalias/alias.c
+LIB_C_FILES += freebsd/sys/netinet/libalias/alias_skinny.c
+LIB_C_FILES += freebsd/sys/netinet/libalias/alias_sctp.c
ifneq ($(DISABLE_IPV6),yes)
-C_FILES += freebsd/net/if_stf.c
-C_FILES += freebsd/netinet6/dest6.c
-C_FILES += freebsd/netinet6/frag6.c
-C_FILES += freebsd/netinet6/icmp6.c
-C_FILES += freebsd/netinet6/in6.c
-C_FILES += freebsd/netinet6/in6_cksum.c
-C_FILES += freebsd/netinet6/in6_gif.c
-C_FILES += freebsd/netinet6/in6_ifattach.c
-C_FILES += freebsd/netinet6/in6_mcast.c
-C_FILES += freebsd/netinet6/in6_pcb.c
-C_FILES += freebsd/netinet6/in6_proto.c
-C_FILES += freebsd/netinet6/in6_rmx.c
-C_FILES += freebsd/netinet6/in6_src.c
-C_FILES += freebsd/netinet6/ip6_forward.c
-C_FILES += freebsd/netinet6/ip6_id.c
-C_FILES += freebsd/netinet6/ip6_input.c
-C_FILES += freebsd/netinet6/ip6_ipsec.c
-C_FILES += freebsd/netinet6/ip6_mroute.c
-C_FILES += freebsd/netinet6/ip6_output.c
-C_FILES += freebsd/netinet6/mld6.c
-C_FILES += freebsd/netinet6/nd6.c
-C_FILES += freebsd/netinet6/nd6_nbr.c
-C_FILES += freebsd/netinet6/nd6_rtr.c
-C_FILES += freebsd/netinet6/raw_ip6.c
-C_FILES += freebsd/netinet6/route6.c
-C_FILES += freebsd/netinet6/scope6.c
-C_FILES += freebsd/netinet6/sctp6_usrreq.c
-C_FILES += freebsd/netinet6/udp6_usrreq.c
+LIB_C_FILES += freebsd/sys/net/if_stf.c
+LIB_C_FILES += freebsd/sys/netinet6/dest6.c
+LIB_C_FILES += freebsd/sys/netinet6/frag6.c
+LIB_C_FILES += freebsd/sys/netinet6/icmp6.c
+LIB_C_FILES += freebsd/sys/netinet6/in6.c
+LIB_C_FILES += freebsd/sys/netinet6/in6_cksum.c
+LIB_C_FILES += freebsd/sys/netinet6/in6_gif.c
+LIB_C_FILES += freebsd/sys/netinet6/in6_ifattach.c
+LIB_C_FILES += freebsd/sys/netinet6/in6_mcast.c
+LIB_C_FILES += freebsd/sys/netinet6/in6_pcb.c
+LIB_C_FILES += freebsd/sys/netinet6/in6_proto.c
+LIB_C_FILES += freebsd/sys/netinet6/in6_rmx.c
+LIB_C_FILES += freebsd/sys/netinet6/in6_src.c
+LIB_C_FILES += freebsd/sys/netinet6/ip6_forward.c
+LIB_C_FILES += freebsd/sys/netinet6/ip6_id.c
+LIB_C_FILES += freebsd/sys/netinet6/ip6_input.c
+LIB_C_FILES += freebsd/sys/netinet6/ip6_ipsec.c
+LIB_C_FILES += freebsd/sys/netinet6/ip6_mroute.c
+LIB_C_FILES += freebsd/sys/netinet6/ip6_output.c
+LIB_C_FILES += freebsd/sys/netinet6/mld6.c
+LIB_C_FILES += freebsd/sys/netinet6/nd6.c
+LIB_C_FILES += freebsd/sys/netinet6/nd6_nbr.c
+LIB_C_FILES += freebsd/sys/netinet6/nd6_rtr.c
+LIB_C_FILES += freebsd/sys/netinet6/raw_ip6.c
+LIB_C_FILES += freebsd/sys/netinet6/route6.c
+LIB_C_FILES += freebsd/sys/netinet6/scope6.c
+LIB_C_FILES += freebsd/sys/netinet6/sctp6_usrreq.c
+LIB_C_FILES += freebsd/sys/netinet6/udp6_usrreq.c
else
SED_PATTERN += -e 's/^\#define INET6 1/\/\/ \#define INET6 1/'
endif # DISABLE_IPV6
-C_FILES += freebsd/netipsec/ipsec.c
-C_FILES += freebsd/netipsec/ipsec_input.c
-C_FILES += freebsd/netipsec/ipsec_mbuf.c
-C_FILES += freebsd/netipsec/ipsec_output.c
-C_FILES += freebsd/netipsec/key.c
-C_FILES += freebsd/netipsec/key_debug.c
-C_FILES += freebsd/netipsec/keysock.c
-C_FILES += freebsd/netipsec/xform_ah.c
-C_FILES += freebsd/netipsec/xform_esp.c
-C_FILES += freebsd/netipsec/xform_ipcomp.c
-C_FILES += freebsd/netipsec/xform_ipip.c
-C_FILES += freebsd/netipsec/xform_tcp.c
-C_FILES += freebsd/net80211/ieee80211_acl.c
-C_FILES += freebsd/net80211/ieee80211_action.c
-C_FILES += freebsd/net80211/ieee80211_adhoc.c
-C_FILES += freebsd/net80211/ieee80211_ageq.c
-C_FILES += freebsd/net80211/ieee80211_amrr.c
-C_FILES += freebsd/net80211/ieee80211.c
-C_FILES += freebsd/net80211/ieee80211_crypto.c
-C_FILES += freebsd/net80211/ieee80211_crypto_ccmp.c
-C_FILES += freebsd/net80211/ieee80211_crypto_none.c
-C_FILES += freebsd/net80211/ieee80211_crypto_tkip.c
-C_FILES += freebsd/net80211/ieee80211_crypto_wep.c
-C_FILES += freebsd/net80211/ieee80211_ddb.c
-C_FILES += freebsd/net80211/ieee80211_dfs.c
-C_FILES += freebsd/net80211/ieee80211_freebsd.c
-C_FILES += freebsd/net80211/ieee80211_hostap.c
-C_FILES += freebsd/net80211/ieee80211_ht.c
-C_FILES += freebsd/net80211/ieee80211_hwmp.c
-C_FILES += freebsd/net80211/ieee80211_input.c
-C_FILES += freebsd/net80211/ieee80211_ioctl.c
-C_FILES += freebsd/net80211/ieee80211_mesh.c
-C_FILES += freebsd/net80211/ieee80211_monitor.c
-C_FILES += freebsd/net80211/ieee80211_node.c
-C_FILES += freebsd/net80211/ieee80211_output.c
-C_FILES += freebsd/net80211/ieee80211_phy.c
-C_FILES += freebsd/net80211/ieee80211_power.c
-C_FILES += freebsd/net80211/ieee80211_proto.c
-C_FILES += freebsd/net80211/ieee80211_radiotap.c
-C_FILES += freebsd/net80211/ieee80211_ratectl.c
-C_FILES += freebsd/net80211/ieee80211_ratectl_none.c
-C_FILES += freebsd/net80211/ieee80211_regdomain.c
-C_FILES += freebsd/net80211/ieee80211_rssadapt.c
-C_FILES += freebsd/net80211/ieee80211_scan.c
-C_FILES += freebsd/net80211/ieee80211_scan_sta.c
-C_FILES += freebsd/net80211/ieee80211_sta.c
-C_FILES += freebsd/net80211/ieee80211_superg.c
-C_FILES += freebsd/net80211/ieee80211_tdma.c
-C_FILES += freebsd/net80211/ieee80211_wds.c
-C_FILES += freebsd/net80211/ieee80211_xauth.c
-C_FILES += freebsd/opencrypto/crypto.c
-C_FILES += freebsd/opencrypto/deflate.c
-C_FILES += freebsd/opencrypto/cryptosoft.c
-C_FILES += freebsd/opencrypto/criov.c
-C_FILES += freebsd/opencrypto/rmd160.c
-C_FILES += freebsd/opencrypto/xform.c
-C_FILES += freebsd/opencrypto/skipjack.c
-C_FILES += freebsd/opencrypto/cast.c
-C_FILES += freebsd/opencrypto/cryptodev.c
-C_FILES += freebsd/crypto/sha1.c
-C_FILES += freebsd/crypto/sha2/sha2.c
-C_FILES += freebsd/crypto/rijndael/rijndael-alg-fst.c
-C_FILES += freebsd/crypto/rijndael/rijndael-api.c
-C_FILES += freebsd/crypto/rijndael/rijndael-api-fst.c
-C_FILES += freebsd/crypto/des/des_setkey.c
-C_FILES += freebsd/crypto/des/des_enc.c
-C_FILES += freebsd/crypto/des/des_ecb.c
-C_FILES += freebsd/crypto/blowfish/bf_enc.c
-C_FILES += freebsd/crypto/blowfish/bf_skey.c
-C_FILES += freebsd/crypto/blowfish/bf_ecb.c
-C_FILES += freebsd/crypto/rc4/rc4.c
-C_FILES += freebsd/crypto/camellia/camellia-api.c
-C_FILES += freebsd/crypto/camellia/camellia.c
-C_FILES += contrib/altq/freebsd/altq/altq_rmclass.c
-C_FILES += contrib/altq/freebsd/altq/altq_rio.c
-C_FILES += contrib/altq/freebsd/altq/altq_subr.c
-C_FILES += contrib/altq/freebsd/altq/altq_cdnr.c
-C_FILES += contrib/altq/freebsd/altq/altq_priq.c
-C_FILES += contrib/altq/freebsd/altq/altq_cbq.c
-C_FILES += contrib/altq/freebsd/altq/altq_hfsc.c
-C_FILES += contrib/altq/freebsd/altq/altq_red.c
-C_FILES += contrib/pf/freebsd/netinet/in4_cksum.c
-C_FILES += contrib/pf/freebsd/net/pf.c
-C_FILES += contrib/pf/freebsd/net/if_pflog.c
-C_FILES += contrib/pf/freebsd/net/pf_subr.c
-C_FILES += contrib/pf/freebsd/net/pf_ioctl.c
-C_FILES += contrib/pf/freebsd/net/pf_table.c
-C_FILES += contrib/pf/freebsd/net/pf_if.c
-C_FILES += contrib/pf/freebsd/net/pf_osfp.c
-C_FILES += contrib/pf/freebsd/net/pf_norm.c
-C_FILES += contrib/pf/freebsd/net/pf_ruleset.c
-C_FILES += contrib/pf/freebsd/net/if_pfsync.c
-C_FILES += freebsd/dev/mii/mii.c
-C_FILES += freebsd/dev/mii/mii_physubr.c
-C_FILES += freebsd/dev/mii/icsphy.c
-C_FILES += freebsd/dev/mii/brgphy.c
-C_FILES += freebsd/local/usb_if.c
-C_FILES += freebsd/local/bus_if.c
-C_FILES += freebsd/local/device_if.c
-C_FILES += freebsd/local/cryptodev_if.c
-C_FILES += freebsd/local/miibus_if.c
-C_FILES += freebsd/local/pci_if.c
-C_FILES += freebsd/local/pcib_if.c
-C_FILES += freebsd/kern/init_main.c
-C_FILES += freebsd/kern/kern_linker.c
-C_FILES += freebsd/kern/kern_mib.c
-C_FILES += freebsd/kern/kern_timeout.c
-C_FILES += freebsd/kern/kern_mbuf.c
-C_FILES += freebsd/kern/kern_module.c
-C_FILES += freebsd/kern/kern_sysctl.c
-C_FILES += freebsd/kern/subr_bus.c
-C_FILES += freebsd/kern/subr_kobj.c
-C_FILES += freebsd/kern/uipc_mbuf.c
-C_FILES += freebsd/kern/uipc_mbuf2.c
-C_FILES += freebsd/kern/uipc_socket.c
-C_FILES += freebsd/kern/uipc_sockbuf.c
-C_FILES += freebsd/kern/uipc_domain.c
-C_FILES += freebsd/vm/uma_core.c
-C_FILES += freebsd/dev/usb/usb_busdma.c
-C_FILES += freebsd/dev/usb/usb_core.c
-C_FILES += freebsd/dev/usb/usb_debug.c
-C_FILES += freebsd/dev/usb/usb_dev.c
-C_FILES += freebsd/dev/usb/usb_device.c
-C_FILES += freebsd/dev/usb/usb_dynamic.c
-C_FILES += freebsd/dev/usb/usb_error.c
-C_FILES += freebsd/dev/usb/usb_generic.c
-C_FILES += freebsd/dev/usb/usb_handle_request.c
-C_FILES += freebsd/dev/usb/usb_hid.c
-C_FILES += freebsd/dev/usb/usb_hub.c
-C_FILES += freebsd/dev/usb/usb_lookup.c
-C_FILES += freebsd/dev/usb/usb_mbuf.c
-C_FILES += freebsd/dev/usb/usb_msctest.c
-C_FILES += freebsd/dev/usb/usb_parse.c
-C_FILES += freebsd/dev/usb/usb_process.c
-C_FILES += freebsd/dev/usb/usb_request.c
-C_FILES += freebsd/dev/usb/usb_transfer.c
-C_FILES += freebsd/dev/usb/usb_util.c
-C_FILES += freebsd/dev/usb/quirk/usb_quirk.c
-C_FILES += freebsd/dev/usb/controller/ohci.c
-C_FILES += freebsd/dev/usb/controller/ehci.c
-C_FILES += freebsd/dev/usb/controller/usb_controller.c
-C_FILES += freebsd/cam/cam.c
-C_FILES += freebsd/cam/scsi/scsi_all.c
-C_FILES += freebsd/dev/usb/storage/umass.c
-C_FILES += freebsd/kern/subr_hints.c
-C_FILES += freebsd/dev/random/harvest.c
-C_FILES += freebsd/libkern/random.c
-C_FILES += freebsd/libkern/arc4random.c
-C_FILES += freebsd/kern/subr_sbuf.c
-C_FILES += freebsd/kern/subr_rman.c
-C_FILES += freebsd/kern/subr_module.c
-C_FILES += freebsd/libkern/inet_ntoa.c
-C_FILES += freebsd/kern/kern_prot.c
-C_FILES += freebsd/kern/kern_proc.c
-C_FILES += freebsd/kern/kern_time.c
-C_FILES += freebsd/kern/kern_event.c
-C_FILES += freebsd/netinet/tcp_hostcache.c
-C_FILES += freebsd/dev/pci/pci.c
-C_FILES += freebsd/dev/pci/pci_user.c
-C_FILES += freebsd/kern/uipc_accf.c
-C_FILES += freebsd/kern/kern_ntptime.c
-C_FILES += freebsd/kern/kern_environment.c
-C_FILES += freebsd/kern/kern_intr.c
-C_FILES += freebsd/kern/kern_resource.c
-C_FILES += freebsd/kern/subr_bufring.c
-C_FILES += freebsd/dev/led/led.c
-C_FILES += freebsd/kern/subr_unit.c
-C_FILES += freebsd/dev/pci/pci_pci.c
-C_FILES += freebsd/netatalk/aarp.c
-C_FILES += freebsd/netatalk/at_control.c
-C_FILES += freebsd/netatalk/at_rmx.c
-C_FILES += freebsd/netatalk/ddp_input.c
-C_FILES += freebsd/netatalk/ddp_pcb.c
-C_FILES += freebsd/netatalk/ddp_usrreq.c
-C_FILES += freebsd/netatalk/at_proto.c
-C_FILES += freebsd/netatalk/ddp_output.c
-C_FILES += freebsd/kern/sys_generic.c
-C_FILES += freebsd/kern/kern_descrip.c
-C_FILES += freebsd/kern/kern_mtxpool.c
-ifeq ($(RTEMS_CPU), i386)
-C_FILES += freebsd/i386/pci/pci_bus.c
-C_FILES += freebsd/i386/i386/legacy.c
-NEED_DUMMY_PIC_IRQ=no
-endif
-C_FILES += freebsd/dev/re/if_re.c
-C_FILES += freebsd/dev/fxp/if_fxp.c
-C_FILES += freebsd/dev/e1000/e1000_80003es2lan.c
-C_FILES += freebsd/dev/e1000/e1000_82542.c
-C_FILES += freebsd/dev/e1000/e1000_82575.c
-C_FILES += freebsd/dev/e1000/e1000_mac.c
-C_FILES += freebsd/dev/e1000/e1000_nvm.c
-C_FILES += freebsd/dev/e1000/e1000_vf.c
-C_FILES += freebsd/dev/e1000/if_lem.c
-C_FILES += freebsd/dev/e1000/e1000_82540.c
-C_FILES += freebsd/dev/e1000/e1000_82543.c
-C_FILES += freebsd/dev/e1000/e1000_api.c
-C_FILES += freebsd/dev/e1000/e1000_manage.c
-C_FILES += freebsd/dev/e1000/e1000_osdep.c
-C_FILES += freebsd/dev/e1000/if_em.c
-C_FILES += freebsd/dev/e1000/e1000_82541.c
-C_FILES += freebsd/dev/e1000/e1000_82571.c
-C_FILES += freebsd/dev/e1000/e1000_ich8lan.c
-C_FILES += freebsd/dev/e1000/e1000_mbx.c
-C_FILES += freebsd/dev/e1000/e1000_phy.c
-C_FILES += freebsd/dev/e1000/if_igb.c
-C_FILES += freebsd/dev/dc/dcphy.c
-C_FILES += freebsd/dev/dc/if_dc.c
-C_FILES += freebsd/dev/dc/pnphy.c
-C_FILES += freebsd/dev/smc/if_smc.c
-C_FILES += freebsd/dev/bce/if_bce.c
-C_FILES += freebsd/dev/bfe/if_bfe.c
-C_FILES += freebsd/dev/bge/if_bge.c
+LIB_C_FILES += freebsd/sys/netipsec/ipsec.c
+LIB_C_FILES += freebsd/sys/netipsec/ipsec_input.c
+LIB_C_FILES += freebsd/sys/netipsec/ipsec_mbuf.c
+LIB_C_FILES += freebsd/sys/netipsec/ipsec_output.c
+LIB_C_FILES += freebsd/sys/netipsec/key.c
+LIB_C_FILES += freebsd/sys/netipsec/key_debug.c
+LIB_C_FILES += freebsd/sys/netipsec/keysock.c
+LIB_C_FILES += freebsd/sys/netipsec/xform_ah.c
+LIB_C_FILES += freebsd/sys/netipsec/xform_esp.c
+LIB_C_FILES += freebsd/sys/netipsec/xform_ipcomp.c
+LIB_C_FILES += freebsd/sys/netipsec/xform_ipip.c
+LIB_C_FILES += freebsd/sys/netipsec/xform_tcp.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_acl.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_action.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_adhoc.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_ageq.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_amrr.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_crypto.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_crypto_ccmp.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_crypto_none.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_crypto_tkip.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_crypto_wep.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_ddb.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_dfs.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_freebsd.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_hostap.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_ht.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_hwmp.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_input.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_ioctl.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_mesh.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_monitor.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_node.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_output.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_phy.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_power.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_proto.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_radiotap.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_ratectl.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_ratectl_none.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_regdomain.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_rssadapt.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_scan.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_scan_sta.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_sta.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_superg.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_tdma.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_wds.c
+LIB_C_FILES += freebsd/sys/net80211/ieee80211_xauth.c
+LIB_C_FILES += freebsd/sys/opencrypto/crypto.c
+LIB_C_FILES += freebsd/sys/opencrypto/deflate.c
+LIB_C_FILES += freebsd/sys/opencrypto/cryptosoft.c
+LIB_C_FILES += freebsd/sys/opencrypto/criov.c
+LIB_C_FILES += freebsd/sys/opencrypto/rmd160.c
+LIB_C_FILES += freebsd/sys/opencrypto/xform.c
+LIB_C_FILES += freebsd/sys/opencrypto/skipjack.c
+LIB_C_FILES += freebsd/sys/opencrypto/cast.c
+LIB_C_FILES += freebsd/sys/opencrypto/cryptodev.c
+LIB_C_FILES += freebsd/sys/crypto/sha1.c
+LIB_C_FILES += freebsd/sys/crypto/sha2/sha2.c
+LIB_C_FILES += freebsd/sys/crypto/rijndael/rijndael-alg-fst.c
+LIB_C_FILES += freebsd/sys/crypto/rijndael/rijndael-api.c
+LIB_C_FILES += freebsd/sys/crypto/rijndael/rijndael-api-fst.c
+LIB_C_FILES += freebsd/sys/crypto/des/des_setkey.c
+LIB_C_FILES += freebsd/sys/crypto/des/des_enc.c
+LIB_C_FILES += freebsd/sys/crypto/des/des_ecb.c
+LIB_C_FILES += freebsd/sys/crypto/blowfish/bf_enc.c
+LIB_C_FILES += freebsd/sys/crypto/blowfish/bf_skey.c
+LIB_C_FILES += freebsd/sys/crypto/blowfish/bf_ecb.c
+LIB_C_FILES += freebsd/sys/crypto/rc4/rc4.c
+LIB_C_FILES += freebsd/sys/crypto/camellia/camellia-api.c
+LIB_C_FILES += freebsd/sys/crypto/camellia/camellia.c
+LIB_C_FILES += freebsd/sys/contrib/altq/altq/altq_rmclass.c
+LIB_C_FILES += freebsd/sys/contrib/altq/altq/altq_rio.c
+LIB_C_FILES += freebsd/sys/contrib/altq/altq/altq_subr.c
+LIB_C_FILES += freebsd/sys/contrib/altq/altq/altq_cdnr.c
+LIB_C_FILES += freebsd/sys/contrib/altq/altq/altq_priq.c
+LIB_C_FILES += freebsd/sys/contrib/altq/altq/altq_cbq.c
+LIB_C_FILES += freebsd/sys/contrib/altq/altq/altq_hfsc.c
+LIB_C_FILES += freebsd/sys/contrib/altq/altq/altq_red.c
+LIB_C_FILES += freebsd/sys/contrib/pf/netinet/in4_cksum.c
+LIB_C_FILES += freebsd/sys/contrib/pf/net/pf.c
+LIB_C_FILES += freebsd/sys/contrib/pf/net/if_pflog.c
+LIB_C_FILES += freebsd/sys/contrib/pf/net/pf_subr.c
+LIB_C_FILES += freebsd/sys/contrib/pf/net/pf_ioctl.c
+LIB_C_FILES += freebsd/sys/contrib/pf/net/pf_table.c
+LIB_C_FILES += freebsd/sys/contrib/pf/net/pf_if.c
+LIB_C_FILES += freebsd/sys/contrib/pf/net/pf_osfp.c
+LIB_C_FILES += freebsd/sys/contrib/pf/net/pf_norm.c
+LIB_C_FILES += freebsd/sys/contrib/pf/net/pf_ruleset.c
+LIB_C_FILES += freebsd/sys/contrib/pf/net/if_pfsync.c
+LIB_C_FILES += freebsd/sys/dev/mii/mii.c
+LIB_C_FILES += freebsd/sys/dev/mii/mii_physubr.c
+LIB_C_FILES += freebsd/sys/dev/mii/icsphy.c
+LIB_C_FILES += freebsd/sys/dev/mii/brgphy.c
+LIB_C_FILES += freebsd/sys/dev/usb/usb_busdma.c
+LIB_C_FILES += freebsd/sys/dev/usb/usb_core.c
+LIB_C_FILES += freebsd/sys/dev/usb/usb_debug.c
+LIB_C_FILES += freebsd/sys/dev/usb/usb_dev.c
+LIB_C_FILES += freebsd/sys/dev/usb/usb_device.c
+LIB_C_FILES += freebsd/sys/dev/usb/usb_dynamic.c
+LIB_C_FILES += freebsd/sys/dev/usb/usb_error.c
+LIB_C_FILES += freebsd/sys/dev/usb/usb_generic.c
+LIB_C_FILES += freebsd/sys/dev/usb/usb_handle_request.c
+LIB_C_FILES += freebsd/sys/dev/usb/usb_hid.c
+LIB_C_FILES += freebsd/sys/dev/usb/usb_hub.c
+LIB_C_FILES += freebsd/sys/dev/usb/usb_lookup.c
+LIB_C_FILES += freebsd/sys/dev/usb/usb_mbuf.c
+LIB_C_FILES += freebsd/sys/dev/usb/usb_msctest.c
+LIB_C_FILES += freebsd/sys/dev/usb/usb_parse.c
+LIB_C_FILES += freebsd/sys/dev/usb/usb_process.c
+LIB_C_FILES += freebsd/sys/dev/usb/usb_request.c
+LIB_C_FILES += freebsd/sys/dev/usb/usb_transfer.c
+LIB_C_FILES += freebsd/sys/dev/usb/usb_util.c
+LIB_C_FILES += freebsd/sys/dev/usb/quirk/usb_quirk.c
+LIB_C_FILES += freebsd/sys/dev/usb/controller/ohci.c
+LIB_C_FILES += freebsd/sys/dev/usb/controller/ehci.c
+LIB_C_FILES += freebsd/sys/dev/usb/controller/usb_controller.c
+LIB_C_FILES += freebsd/sys/cam/cam.c
+LIB_C_FILES += freebsd/sys/cam/scsi/scsi_all.c
+LIB_C_FILES += freebsd/sys/dev/usb/storage/umass.c
+LIB_C_FILES += freebsd/sys/dev/pci/pci.c
+LIB_C_FILES += freebsd/sys/dev/pci/pci_user.c
+LIB_C_FILES += freebsd/sys/dev/pci/pci_pci.c
ifeq ($(RTEMS_CPU), arm)
-C_FILES += freebsd/arm/arm/in_cksum.c
-NEED_DUMMY_PIC_IRQ=no
-endif
-ifeq ($(RTEMS_CPU), i386)
-C_FILES += freebsd/i386/i386/in_cksum.c
-NEED_DUMMY_PIC_IRQ=no
-endif
-ifeq ($(RTEMS_CPU), mips)
-C_FILES += freebsd/mips/mips/in_cksum.c
-NEED_DUMMY_PIC_IRQ=no
-endif
-ifeq ($(RTEMS_CPU), powerpc)
-C_FILES += freebsd/powerpc/powerpc/in_cksum.c
-NEED_DUMMY_PIC_IRQ=no
-endif
-ifeq ($(RTEMS_CPU), sparc)
-C_FILES += freebsd/mips/mips/in_cksum.c
+LIB_C_FILES += freebsd/sys/arm/pci/pci_bus.c
+LIB_C_FILES += freebsd/sys/arm/arm/legacy.c
NEED_DUMMY_PIC_IRQ=no
endif
-ifeq ($(RTEMS_CPU), sparc64)
-C_FILES += freebsd/sparc64/sparc64/in_cksum.c
-endif
ifeq ($(RTEMS_CPU), avr)
-GENERATED_FILES += copied/rtemsbsd/avr/avr/in_cksum.c
-GENERATED_FILES += copied/rtemsbsd/avr/include/freebsd/machine/in_cksum.h
-GENERATED_FILES += copied/rtemsbsd/avr/avr/in_cksum.c
-C_FILES += copied/rtemsbsd/avr/avr/in_cksum.c
+LIB_C_FILES += freebsd/sys/avr/pci/pci_bus.c
+LIB_C_FILES += freebsd/sys/avr/avr/legacy.c
endif
ifeq ($(RTEMS_CPU), bfin)
-GENERATED_FILES += copied/rtemsbsd/bfin/bfin/in_cksum.c
-GENERATED_FILES += copied/rtemsbsd/bfin/include/freebsd/machine/in_cksum.h
-GENERATED_FILES += copied/rtemsbsd/bfin/bfin/in_cksum.c
-C_FILES += copied/rtemsbsd/bfin/bfin/in_cksum.c
+LIB_C_FILES += freebsd/sys/bfin/pci/pci_bus.c
+LIB_C_FILES += freebsd/sys/bfin/bfin/legacy.c
endif
ifeq ($(RTEMS_CPU), h8300)
-GENERATED_FILES += copied/rtemsbsd/h8300/h8300/in_cksum.c
-GENERATED_FILES += copied/rtemsbsd/h8300/include/freebsd/machine/in_cksum.h
-GENERATED_FILES += copied/rtemsbsd/h8300/h8300/in_cksum.c
-C_FILES += copied/rtemsbsd/h8300/h8300/in_cksum.c
+LIB_C_FILES += freebsd/sys/h8300/pci/pci_bus.c
+LIB_C_FILES += freebsd/sys/h8300/h8300/legacy.c
+endif
+ifeq ($(RTEMS_CPU), i386)
+LIB_C_FILES += freebsd/sys/i386/pci/pci_bus.c
+LIB_C_FILES += freebsd/sys/i386/i386/legacy.c
+NEED_DUMMY_PIC_IRQ=no
endif
ifeq ($(RTEMS_CPU), lm32)
-GENERATED_FILES += copied/rtemsbsd/lm32/lm32/in_cksum.c
-GENERATED_FILES += copied/rtemsbsd/lm32/include/freebsd/machine/in_cksum.h
-GENERATED_FILES += copied/rtemsbsd/lm32/lm32/in_cksum.c
-C_FILES += copied/rtemsbsd/lm32/lm32/in_cksum.c
+LIB_C_FILES += freebsd/sys/lm32/pci/pci_bus.c
+LIB_C_FILES += freebsd/sys/lm32/lm32/legacy.c
+NEED_DUMMY_PIC_IRQ=no
endif
ifeq ($(RTEMS_CPU), m32c)
-GENERATED_FILES += copied/rtemsbsd/m32c/m32c/in_cksum.c
-GENERATED_FILES += copied/rtemsbsd/m32c/include/freebsd/machine/in_cksum.h
-GENERATED_FILES += copied/rtemsbsd/m32c/m32c/in_cksum.c
-C_FILES += copied/rtemsbsd/m32c/m32c/in_cksum.c
+LIB_C_FILES += freebsd/sys/m32c/pci/pci_bus.c
+LIB_C_FILES += freebsd/sys/m32c/m32c/legacy.c
endif
ifeq ($(RTEMS_CPU), m32r)
-GENERATED_FILES += copied/rtemsbsd/m32r/m32r/in_cksum.c
-GENERATED_FILES += copied/rtemsbsd/m32r/include/freebsd/machine/in_cksum.h
-GENERATED_FILES += copied/rtemsbsd/m32r/m32r/in_cksum.c
-C_FILES += copied/rtemsbsd/m32r/m32r/in_cksum.c
+LIB_C_FILES += freebsd/sys/m32r/pci/pci_bus.c
+LIB_C_FILES += freebsd/sys/m32r/m32r/legacy.c
endif
ifeq ($(RTEMS_CPU), m68k)
-GENERATED_FILES += copied/rtemsbsd/m68k/m68k/in_cksum.c
-GENERATED_FILES += copied/rtemsbsd/m68k/include/freebsd/machine/in_cksum.h
-GENERATED_FILES += copied/rtemsbsd/m68k/m68k/in_cksum.c
-C_FILES += copied/rtemsbsd/m68k/m68k/in_cksum.c
+LIB_C_FILES += freebsd/sys/m68k/pci/pci_bus.c
+LIB_C_FILES += freebsd/sys/m68k/m68k/legacy.c
+endif
+ifeq ($(RTEMS_CPU), mips)
+LIB_C_FILES += freebsd/sys/mips/pci/pci_bus.c
+LIB_C_FILES += freebsd/sys/mips/mips/legacy.c
+NEED_DUMMY_PIC_IRQ=no
endif
ifeq ($(RTEMS_CPU), nios2)
-GENERATED_FILES += copied/rtemsbsd/nios2/nios2/in_cksum.c
-GENERATED_FILES += copied/rtemsbsd/nios2/include/freebsd/machine/in_cksum.h
-GENERATED_FILES += copied/rtemsbsd/nios2/nios2/in_cksum.c
-C_FILES += copied/rtemsbsd/nios2/nios2/in_cksum.c
+LIB_C_FILES += freebsd/sys/nios2/pci/pci_bus.c
+LIB_C_FILES += freebsd/sys/nios2/nios2/legacy.c
+endif
+ifeq ($(RTEMS_CPU), powerpc)
+LIB_C_FILES += freebsd/sys/powerpc/pci/pci_bus.c
+LIB_C_FILES += freebsd/sys/powerpc/powerpc/legacy.c
+NEED_DUMMY_PIC_IRQ=no
endif
ifeq ($(RTEMS_CPU), sh)
-GENERATED_FILES += copied/rtemsbsd/sh/sh/in_cksum.c
-GENERATED_FILES += copied/rtemsbsd/sh/include/freebsd/machine/in_cksum.h
-GENERATED_FILES += copied/rtemsbsd/sh/sh/in_cksum.c
-C_FILES += copied/rtemsbsd/sh/sh/in_cksum.c
+LIB_C_FILES += freebsd/sys/sh/pci/pci_bus.c
+LIB_C_FILES += freebsd/sys/sh/sh/legacy.c
endif
ifeq ($(RTEMS_CPU), sparc)
-GENERATED_FILES += copied/rtemsbsd/sparc/sparc/in_cksum.c
-GENERATED_FILES += copied/rtemsbsd/sparc/include/freebsd/machine/in_cksum.h
-GENERATED_FILES += copied/rtemsbsd/sparc/sparc/in_cksum.c
-C_FILES += copied/rtemsbsd/sparc/sparc/in_cksum.c
+LIB_C_FILES += freebsd/sys/sparc/pci/pci_bus.c
+LIB_C_FILES += freebsd/sys/sparc/sparc/legacy.c
+NEED_DUMMY_PIC_IRQ=no
endif
-ifeq ($(RTEMS_CPU), v850)
-GENERATED_FILES += copied/rtemsbsd/v850/v850/in_cksum.c
-GENERATED_FILES += copied/rtemsbsd/v850/include/freebsd/machine/in_cksum.h
-GENERATED_FILES += copied/rtemsbsd/v850/v850/in_cksum.c
-C_FILES += copied/rtemsbsd/v850/v850/in_cksum.c
+ifeq ($(RTEMS_CPU), sparc64)
+LIB_C_FILES += freebsd/sys/sparc64/pci/pci_bus.c
+LIB_C_FILES += freebsd/sys/sparc64/sparc64/legacy.c
endif
+ifeq ($(RTEMS_CPU), v850)
+LIB_C_FILES += freebsd/sys/v850/pci/pci_bus.c
+LIB_C_FILES += freebsd/sys/v850/v850/legacy.c
+endif
+LIB_C_FILES += freebsd/sys/dev/random/harvest.c
+LIB_C_FILES += freebsd/sys/netinet/tcp_hostcache.c
+LIB_C_FILES += freebsd/sys/dev/led/led.c
+LIB_C_FILES += freebsd/sys/netatalk/aarp.c
+LIB_C_FILES += freebsd/sys/netatalk/at_control.c
+LIB_C_FILES += freebsd/sys/netatalk/at_rmx.c
+LIB_C_FILES += freebsd/sys/netatalk/ddp_input.c
+LIB_C_FILES += freebsd/sys/netatalk/ddp_pcb.c
+LIB_C_FILES += freebsd/sys/netatalk/ddp_usrreq.c
+LIB_C_FILES += freebsd/sys/netatalk/at_proto.c
+LIB_C_FILES += freebsd/sys/netatalk/ddp_output.c
+LIB_C_FILES += freebsd/sys/dev/re/if_re.c
+LIB_C_FILES += freebsd/sys/dev/fxp/if_fxp.c
+LIB_C_FILES += freebsd/sys/dev/e1000/e1000_80003es2lan.c
+LIB_C_FILES += freebsd/sys/dev/e1000/e1000_82542.c
+LIB_C_FILES += freebsd/sys/dev/e1000/e1000_82575.c
+LIB_C_FILES += freebsd/sys/dev/e1000/e1000_mac.c
+LIB_C_FILES += freebsd/sys/dev/e1000/e1000_nvm.c
+LIB_C_FILES += freebsd/sys/dev/e1000/e1000_vf.c
+LIB_C_FILES += freebsd/sys/dev/e1000/if_lem.c
+LIB_C_FILES += freebsd/sys/dev/e1000/e1000_82540.c
+LIB_C_FILES += freebsd/sys/dev/e1000/e1000_82543.c
+LIB_C_FILES += freebsd/sys/dev/e1000/e1000_api.c
+LIB_C_FILES += freebsd/sys/dev/e1000/e1000_manage.c
+LIB_C_FILES += freebsd/sys/dev/e1000/e1000_osdep.c
+LIB_C_FILES += freebsd/sys/dev/e1000/if_em.c
+LIB_C_FILES += freebsd/sys/dev/e1000/e1000_82541.c
+LIB_C_FILES += freebsd/sys/dev/e1000/e1000_82571.c
+LIB_C_FILES += freebsd/sys/dev/e1000/e1000_ich8lan.c
+LIB_C_FILES += freebsd/sys/dev/e1000/e1000_mbx.c
+LIB_C_FILES += freebsd/sys/dev/e1000/e1000_phy.c
+LIB_C_FILES += freebsd/sys/dev/e1000/if_igb.c
+LIB_C_FILES += freebsd/sys/dev/dc/dcphy.c
+LIB_C_FILES += freebsd/sys/dev/dc/if_dc.c
+LIB_C_FILES += freebsd/sys/dev/dc/pnphy.c
+LIB_C_FILES += freebsd/sys/dev/smc/if_smc.c
+LIB_C_FILES += freebsd/sys/dev/bce/if_bce.c
+LIB_C_FILES += freebsd/sys/dev/bfe/if_bfe.c
+LIB_C_FILES += freebsd/sys/dev/bge/if_bge.c
ifeq ($(RTEMS_CPU), arm)
-GENERATED_FILES += copied/rtemsbsd/arm/include/freebsd/machine/legacyvar.h
-GENERATED_FILES += copied/rtemsbsd/arm/include/freebsd/machine/pci_cfgreg.h
-GENERATED_FILES += copied/freebsd/arm/pci/pci_bus.c
-GENERATED_FILES += copied/freebsd/arm/arm/legacy.c
-C_FILES += copied/freebsd/arm/pci/pci_bus.c
-C_FILES += copied/freebsd/arm/arm/legacy.c
+LIB_C_FILES += freebsd/sys/arm/arm/in_cksum.c
+NEED_DUMMY_PIC_IRQ=no
endif
ifeq ($(RTEMS_CPU), avr)
-GENERATED_FILES += copied/rtemsbsd/avr/include/freebsd/machine/legacyvar.h
-GENERATED_FILES += copied/rtemsbsd/avr/include/freebsd/machine/pci_cfgreg.h
-GENERATED_FILES += copied/freebsd/avr/pci/pci_bus.c
-GENERATED_FILES += copied/freebsd/avr/avr/legacy.c
-C_FILES += copied/freebsd/avr/pci/pci_bus.c
-C_FILES += copied/freebsd/avr/avr/legacy.c
+LIB_C_FILES += freebsd/sys/avr/avr/in_cksum.c
endif
ifeq ($(RTEMS_CPU), bfin)
-GENERATED_FILES += copied/rtemsbsd/bfin/include/freebsd/machine/legacyvar.h
-GENERATED_FILES += copied/rtemsbsd/bfin/include/freebsd/machine/pci_cfgreg.h
-GENERATED_FILES += copied/freebsd/bfin/pci/pci_bus.c
-GENERATED_FILES += copied/freebsd/bfin/bfin/legacy.c
-C_FILES += copied/freebsd/bfin/pci/pci_bus.c
-C_FILES += copied/freebsd/bfin/bfin/legacy.c
+LIB_C_FILES += freebsd/sys/bfin/bfin/in_cksum.c
endif
ifeq ($(RTEMS_CPU), h8300)
-GENERATED_FILES += copied/rtemsbsd/h8300/include/freebsd/machine/legacyvar.h
-GENERATED_FILES += copied/rtemsbsd/h8300/include/freebsd/machine/pci_cfgreg.h
-GENERATED_FILES += copied/freebsd/h8300/pci/pci_bus.c
-GENERATED_FILES += copied/freebsd/h8300/h8300/legacy.c
-C_FILES += copied/freebsd/h8300/pci/pci_bus.c
-C_FILES += copied/freebsd/h8300/h8300/legacy.c
+LIB_C_FILES += freebsd/sys/h8300/h8300/in_cksum.c
+endif
+ifeq ($(RTEMS_CPU), i386)
+LIB_C_FILES += freebsd/sys/i386/i386/in_cksum.c
+NEED_DUMMY_PIC_IRQ=no
endif
ifeq ($(RTEMS_CPU), lm32)
-GENERATED_FILES += copied/rtemsbsd/lm32/include/freebsd/machine/legacyvar.h
-GENERATED_FILES += copied/rtemsbsd/lm32/include/freebsd/machine/pci_cfgreg.h
-GENERATED_FILES += copied/freebsd/lm32/pci/pci_bus.c
-GENERATED_FILES += copied/freebsd/lm32/lm32/legacy.c
-C_FILES += copied/freebsd/lm32/pci/pci_bus.c
-C_FILES += copied/freebsd/lm32/lm32/legacy.c
+LIB_C_FILES += freebsd/sys/lm32/lm32/in_cksum.c
+NEED_DUMMY_PIC_IRQ=no
endif
ifeq ($(RTEMS_CPU), m32c)
-GENERATED_FILES += copied/rtemsbsd/m32c/include/freebsd/machine/legacyvar.h
-GENERATED_FILES += copied/rtemsbsd/m32c/include/freebsd/machine/pci_cfgreg.h
-GENERATED_FILES += copied/freebsd/m32c/pci/pci_bus.c
-GENERATED_FILES += copied/freebsd/m32c/m32c/legacy.c
-C_FILES += copied/freebsd/m32c/pci/pci_bus.c
-C_FILES += copied/freebsd/m32c/m32c/legacy.c
+LIB_C_FILES += freebsd/sys/m32c/m32c/in_cksum.c
endif
ifeq ($(RTEMS_CPU), m32r)
-GENERATED_FILES += copied/rtemsbsd/m32r/include/freebsd/machine/legacyvar.h
-GENERATED_FILES += copied/rtemsbsd/m32r/include/freebsd/machine/pci_cfgreg.h
-GENERATED_FILES += copied/freebsd/m32r/pci/pci_bus.c
-GENERATED_FILES += copied/freebsd/m32r/m32r/legacy.c
-C_FILES += copied/freebsd/m32r/pci/pci_bus.c
-C_FILES += copied/freebsd/m32r/m32r/legacy.c
+LIB_C_FILES += freebsd/sys/m32r/m32r/in_cksum.c
endif
ifeq ($(RTEMS_CPU), m68k)
-GENERATED_FILES += copied/rtemsbsd/m68k/include/freebsd/machine/legacyvar.h
-GENERATED_FILES += copied/rtemsbsd/m68k/include/freebsd/machine/pci_cfgreg.h
-GENERATED_FILES += copied/freebsd/m68k/pci/pci_bus.c
-GENERATED_FILES += copied/freebsd/m68k/m68k/legacy.c
-C_FILES += copied/freebsd/m68k/pci/pci_bus.c
-C_FILES += copied/freebsd/m68k/m68k/legacy.c
+LIB_C_FILES += freebsd/sys/m68k/m68k/in_cksum.c
endif
ifeq ($(RTEMS_CPU), mips)
-GENERATED_FILES += copied/rtemsbsd/mips/include/freebsd/machine/legacyvar.h
-GENERATED_FILES += copied/rtemsbsd/mips/include/freebsd/machine/pci_cfgreg.h
-GENERATED_FILES += copied/freebsd/mips/pci/pci_bus.c
-GENERATED_FILES += copied/freebsd/mips/mips/legacy.c
-C_FILES += copied/freebsd/mips/pci/pci_bus.c
-C_FILES += copied/freebsd/mips/mips/legacy.c
+LIB_C_FILES += freebsd/sys/mips/mips/in_cksum.c
+NEED_DUMMY_PIC_IRQ=no
endif
ifeq ($(RTEMS_CPU), nios2)
-GENERATED_FILES += copied/rtemsbsd/nios2/include/freebsd/machine/legacyvar.h
-GENERATED_FILES += copied/rtemsbsd/nios2/include/freebsd/machine/pci_cfgreg.h
-GENERATED_FILES += copied/freebsd/nios2/pci/pci_bus.c
-GENERATED_FILES += copied/freebsd/nios2/nios2/legacy.c
-C_FILES += copied/freebsd/nios2/pci/pci_bus.c
-C_FILES += copied/freebsd/nios2/nios2/legacy.c
+LIB_C_FILES += freebsd/sys/nios2/nios2/in_cksum.c
endif
ifeq ($(RTEMS_CPU), powerpc)
-GENERATED_FILES += copied/rtemsbsd/powerpc/include/freebsd/machine/legacyvar.h
-GENERATED_FILES += copied/rtemsbsd/powerpc/include/freebsd/machine/pci_cfgreg.h
-GENERATED_FILES += copied/freebsd/powerpc/pci/pci_bus.c
-GENERATED_FILES += copied/freebsd/powerpc/powerpc/legacy.c
-C_FILES += copied/freebsd/powerpc/pci/pci_bus.c
-C_FILES += copied/freebsd/powerpc/powerpc/legacy.c
+LIB_C_FILES += freebsd/sys/powerpc/powerpc/in_cksum.c
+NEED_DUMMY_PIC_IRQ=no
endif
ifeq ($(RTEMS_CPU), sh)
-GENERATED_FILES += copied/rtemsbsd/sh/include/freebsd/machine/legacyvar.h
-GENERATED_FILES += copied/rtemsbsd/sh/include/freebsd/machine/pci_cfgreg.h
-GENERATED_FILES += copied/freebsd/sh/pci/pci_bus.c
-GENERATED_FILES += copied/freebsd/sh/sh/legacy.c
-C_FILES += copied/freebsd/sh/pci/pci_bus.c
-C_FILES += copied/freebsd/sh/sh/legacy.c
+LIB_C_FILES += freebsd/sys/sh/sh/in_cksum.c
endif
ifeq ($(RTEMS_CPU), sparc)
-GENERATED_FILES += copied/rtemsbsd/sparc/include/freebsd/machine/legacyvar.h
-GENERATED_FILES += copied/rtemsbsd/sparc/include/freebsd/machine/pci_cfgreg.h
-GENERATED_FILES += copied/freebsd/sparc/pci/pci_bus.c
-GENERATED_FILES += copied/freebsd/sparc/sparc/legacy.c
-C_FILES += copied/freebsd/sparc/pci/pci_bus.c
-C_FILES += copied/freebsd/sparc/sparc/legacy.c
+LIB_C_FILES += freebsd/sys/sparc/sparc/in_cksum.c
+LIB_C_FILES += freebsd/sys/mips/mips/in_cksum.c
+NEED_DUMMY_PIC_IRQ=no
endif
ifeq ($(RTEMS_CPU), sparc64)
-GENERATED_FILES += copied/rtemsbsd/sparc64/include/freebsd/machine/legacyvar.h
-GENERATED_FILES += copied/rtemsbsd/sparc64/include/freebsd/machine/pci_cfgreg.h
-GENERATED_FILES += copied/freebsd/sparc64/pci/pci_bus.c
-GENERATED_FILES += copied/freebsd/sparc64/sparc64/legacy.c
-C_FILES += copied/freebsd/sparc64/pci/pci_bus.c
-C_FILES += copied/freebsd/sparc64/sparc64/legacy.c
+LIB_C_FILES += freebsd/sys/sparc64/sparc64/in_cksum.c
endif
ifeq ($(RTEMS_CPU), v850)
-GENERATED_FILES += copied/rtemsbsd/v850/include/freebsd/machine/legacyvar.h
-GENERATED_FILES += copied/rtemsbsd/v850/include/freebsd/machine/pci_cfgreg.h
-GENERATED_FILES += copied/freebsd/v850/pci/pci_bus.c
-GENERATED_FILES += copied/freebsd/v850/v850/legacy.c
-C_FILES += copied/freebsd/v850/pci/pci_bus.c
-C_FILES += copied/freebsd/v850/v850/legacy.c
-endif
+LIB_C_FILES += freebsd/sys/v850/v850/in_cksum.c
+endif
+LIB_GEN_FILES += freebsd/include/rpc/rpcb_prot.h
+freebsd/include/rpc/rpcb_prot.h: freebsd/include/rpc/rpcb_prot.x
+ rm -f $@
+ rpcgen -h -o $@ $<
+LIB_GEN_FILES += freebsd/sbin/route/keywords.h
+freebsd/sbin/route/keywords.h: freebsd/sbin/route/keywords
+ sed -e '/^#/d' -e '/^$$/d' $< > freebsd/sbin/route/keywords.tmp
+ LC_ALL=C tr 'a-z' 'A-Z' < freebsd/sbin/route/keywords.tmp | paste freebsd/sbin/route/keywords.tmp - | \
+ awk '{ if (NF > 1) printf "#define\tK_%s\t%d\n\t{\"%s\", K_%s},\n", $$2, NR, $$1, $$2 }' > $@
+ rm -f freebsd/sbin/route/keywords.tmp
+LIB_C_FILES += freebsd/lib/libc/db/btree/bt_close.c
+LIB_C_FILES += freebsd/lib/libc/db/btree/bt_conv.c
+LIB_C_FILES += freebsd/lib/libc/db/btree/bt_debug.c
+LIB_C_FILES += freebsd/lib/libc/db/btree/bt_delete.c
+LIB_C_FILES += freebsd/lib/libc/db/btree/bt_get.c
+LIB_C_FILES += freebsd/lib/libc/db/btree/bt_open.c
+LIB_C_FILES += freebsd/lib/libc/db/btree/bt_overflow.c
+LIB_C_FILES += freebsd/lib/libc/db/btree/bt_page.c
+LIB_C_FILES += freebsd/lib/libc/db/btree/bt_put.c
+LIB_C_FILES += freebsd/lib/libc/db/btree/bt_search.c
+LIB_C_FILES += freebsd/lib/libc/db/btree/bt_seq.c
+LIB_C_FILES += freebsd/lib/libc/db/btree/bt_split.c
+LIB_C_FILES += freebsd/lib/libc/db/btree/bt_utils.c
+LIB_C_FILES += freebsd/lib/libc/db/db/db.c
+LIB_C_FILES += freebsd/lib/libc/db/mpool/mpool.c
+LIB_C_FILES += freebsd/lib/libc/db/mpool/mpool-compat.c
+LIB_C_FILES += freebsd/lib/libc/db/recno/rec_close.c
+LIB_C_FILES += freebsd/lib/libc/db/recno/rec_delete.c
+LIB_C_FILES += freebsd/lib/libc/db/recno/rec_get.c
+LIB_C_FILES += freebsd/lib/libc/db/recno/rec_open.c
+LIB_C_FILES += freebsd/lib/libc/db/recno/rec_put.c
+LIB_C_FILES += freebsd/lib/libc/db/recno/rec_search.c
+LIB_C_FILES += freebsd/lib/libc/db/recno/rec_seq.c
+LIB_C_FILES += freebsd/lib/libc/db/recno/rec_utils.c
+LIB_C_FILES += freebsd/lib/libc/gen/err.c
+LIB_C_FILES += freebsd/lib/libc/gen/gethostname.c
+LIB_C_FILES += freebsd/lib/libc/inet/inet_addr.c
+LIB_C_FILES += freebsd/lib/libc/inet/inet_cidr_ntop.c
+LIB_C_FILES += freebsd/lib/libc/inet/inet_cidr_pton.c
+LIB_C_FILES += freebsd/lib/libc/inet/inet_lnaof.c
+LIB_C_FILES += freebsd/lib/libc/inet/inet_makeaddr.c
+LIB_C_FILES += freebsd/lib/libc/inet/inet_neta.c
+LIB_C_FILES += freebsd/lib/libc/inet/inet_net_ntop.c
+LIB_C_FILES += freebsd/lib/libc/inet/inet_netof.c
+LIB_C_FILES += freebsd/lib/libc/inet/inet_net_pton.c
+LIB_C_FILES += freebsd/lib/libc/inet/inet_network.c
+LIB_C_FILES += freebsd/lib/libc/inet/inet_ntoa.c
+LIB_C_FILES += freebsd/lib/libc/inet/inet_ntop.c
+LIB_C_FILES += freebsd/lib/libc/inet/inet_pton.c
+LIB_C_FILES += freebsd/lib/libc/inet/nsap_addr.c
+LIB_C_FILES += freebsd/lib/libc/isc/ev_streams.c
+LIB_C_FILES += freebsd/lib/libc/isc/ev_timers.c
+LIB_C_FILES += freebsd/lib/libc/nameser/ns_name.c
+LIB_C_FILES += freebsd/lib/libc/nameser/ns_netint.c
+LIB_C_FILES += freebsd/lib/libc/nameser/ns_parse.c
+LIB_C_FILES += freebsd/lib/libc/nameser/ns_print.c
+LIB_C_FILES += freebsd/lib/libc/nameser/ns_samedomain.c
+LIB_C_FILES += freebsd/lib/libc/nameser/ns_ttl.c
+LIB_C_FILES += freebsd/lib/libc/net/base64.c
+LIB_C_FILES += freebsd/lib/libc/net/ether_addr.c
+LIB_C_FILES += freebsd/lib/libc/net/gai_strerror.c
+LIB_C_FILES += freebsd/lib/libc/net/getaddrinfo.c
+LIB_C_FILES += freebsd/lib/libc/net/gethostbydns.c
+LIB_C_FILES += freebsd/lib/libc/net/gethostbyht.c
+LIB_C_FILES += freebsd/lib/libc/net/gethostbynis.c
+LIB_C_FILES += freebsd/lib/libc/net/gethostnamadr.c
+LIB_C_FILES += freebsd/lib/libc/net/getifaddrs.c
+LIB_C_FILES += freebsd/lib/libc/net/getifmaddrs.c
+LIB_C_FILES += freebsd/lib/libc/net/getnameinfo.c
+LIB_C_FILES += freebsd/lib/libc/net/getnetbydns.c
+LIB_C_FILES += freebsd/lib/libc/net/getnetbyht.c
+LIB_C_FILES += freebsd/lib/libc/net/getnetbynis.c
+LIB_C_FILES += freebsd/lib/libc/net/getnetnamadr.c
+LIB_C_FILES += freebsd/lib/libc/net/getproto.c
+LIB_C_FILES += freebsd/lib/libc/net/getprotoent.c
+LIB_C_FILES += freebsd/lib/libc/net/getprotoname.c
+LIB_C_FILES += freebsd/lib/libc/net/getservent.c
+LIB_C_FILES += freebsd/lib/libc/net/if_indextoname.c
+LIB_C_FILES += freebsd/lib/libc/net/if_nameindex.c
+LIB_C_FILES += freebsd/lib/libc/net/if_nametoindex.c
+LIB_C_FILES += freebsd/lib/libc/net/linkaddr.c
+LIB_C_FILES += freebsd/lib/libc/net/map_v4v6.c
+LIB_C_FILES += freebsd/lib/libc/net/name6.c
+LIB_C_FILES += freebsd/lib/libc/net/nsdispatch.c
+LIB_C_FILES += freebsd/lib/libc/net/rcmd.c
+LIB_C_FILES += freebsd/lib/libc/net/recv.c
+LIB_C_FILES += freebsd/lib/libc/net/send.c
+LIB_C_FILES += freebsd/lib/libc/resolv/h_errno.c
+LIB_C_FILES += freebsd/lib/libc/resolv/herror.c
+LIB_C_FILES += freebsd/lib/libc/resolv/mtctxres.c
+LIB_C_FILES += freebsd/lib/libc/resolv/res_comp.c
+LIB_C_FILES += freebsd/lib/libc/resolv/res_data.c
+LIB_C_FILES += freebsd/lib/libc/resolv/res_debug.c
+LIB_C_FILES += freebsd/lib/libc/resolv/res_findzonecut.c
+LIB_C_FILES += freebsd/lib/libc/resolv/res_init.c
+LIB_C_FILES += freebsd/lib/libc/resolv/res_mkquery.c
+LIB_C_FILES += freebsd/lib/libc/resolv/res_mkupdate.c
+LIB_C_FILES += freebsd/lib/libc/resolv/res_query.c
+LIB_C_FILES += freebsd/lib/libc/resolv/res_send.c
+LIB_C_FILES += freebsd/lib/libc/resolv/res_state.c
+LIB_C_FILES += freebsd/lib/libc/resolv/res_update.c
+LIB_C_FILES += freebsd/lib/libc/stdio/fgetln.c
+LIB_C_FILES += freebsd/lib/libc/stdlib/strtonum.c
+LIB_C_FILES += freebsd/lib/libc/string/strsep.c
+LIB_C_FILES += freebsd/lib/libipsec/ipsec_dump_policy.c
+LIB_C_FILES += freebsd/lib/libipsec/ipsec_get_policylen.c
+LIB_C_FILES += freebsd/lib/libipsec/ipsec_strerror.c
+LIB_C_FILES += freebsd/lib/libipsec/pfkey.c
+LIB_C_FILES += freebsd/lib/libipsec/pfkey_dump.c
+LIB_C_FILES += freebsd/lib/libmemstat/memstat_all.c
+LIB_C_FILES += freebsd/lib/libmemstat/memstat.c
+LIB_C_FILES += freebsd/lib/libmemstat/memstat_malloc.c
+LIB_C_FILES += freebsd/lib/libmemstat/memstat_uma.c
+LIB_C_FILES += freebsd/lib/libutil/expand_number.c
+LIB_C_FILES += freebsd/lib/libutil/humanize_number.c
+LIB_C_FILES += freebsd/lib/libutil/trimdomain.c
+LIB_C_FILES += freebsd/sbin/dhclient/alloc.c
+LIB_C_FILES += freebsd/sbin/dhclient/bpf.c
+LIB_C_FILES += freebsd/sbin/dhclient/clparse.c
+LIB_C_FILES += freebsd/sbin/dhclient/conflex.c
+LIB_C_FILES += freebsd/sbin/dhclient/convert.c
+LIB_C_FILES += freebsd/sbin/dhclient/dhclient.c
+LIB_C_FILES += freebsd/sbin/dhclient/dispatch.c
+LIB_C_FILES += freebsd/sbin/dhclient/errwarn.c
+LIB_C_FILES += freebsd/sbin/dhclient/hash.c
+LIB_C_FILES += freebsd/sbin/dhclient/inet.c
+LIB_C_FILES += freebsd/sbin/dhclient/options.c
+LIB_C_FILES += freebsd/sbin/dhclient/packet.c
+LIB_C_FILES += freebsd/sbin/dhclient/parse.c
+LIB_C_FILES += freebsd/sbin/dhclient/privsep.c
+LIB_C_FILES += freebsd/sbin/dhclient/tables.c
+LIB_C_FILES += freebsd/sbin/dhclient/tree.c
+LIB_C_FILES += freebsd/sbin/ifconfig/af_atalk.c
+LIB_C_FILES += freebsd/sbin/ifconfig/af_inet6.c
+LIB_C_FILES += freebsd/sbin/ifconfig/af_inet.c
+LIB_C_FILES += freebsd/sbin/ifconfig/af_link.c
+LIB_C_FILES += freebsd/sbin/ifconfig/af_nd6.c
+LIB_C_FILES += freebsd/sbin/ifconfig/ifbridge.c
+LIB_C_FILES += freebsd/sbin/ifconfig/ifcarp.c
+LIB_C_FILES += freebsd/sbin/ifconfig/ifclone.c
+LIB_C_FILES += freebsd/sbin/ifconfig/ifconfig.c
+LIB_C_FILES += freebsd/sbin/ifconfig/ifgif.c
+LIB_C_FILES += freebsd/sbin/ifconfig/ifgre.c
+LIB_C_FILES += freebsd/sbin/ifconfig/ifgroup.c
+LIB_C_FILES += freebsd/sbin/ifconfig/ifieee80211.c
+LIB_C_FILES += freebsd/sbin/ifconfig/iflagg.c
+LIB_C_FILES += freebsd/sbin/ifconfig/ifmac.c
+LIB_C_FILES += freebsd/sbin/ifconfig/ifmedia.c
+LIB_C_FILES += freebsd/sbin/ifconfig/ifpfsync.c
+LIB_C_FILES += freebsd/sbin/ifconfig/ifvlan.c
+LIB_C_FILES += freebsd/sbin/ping6/ping6.c
+LIB_C_FILES += freebsd/sbin/ping/ping.c
+LIB_C_FILES += freebsd/sbin/route/route.c
+LIB_C_FILES += freebsd/usr.bin/netstat/atalk.c
+LIB_C_FILES += freebsd/usr.bin/netstat/bpf.c
+LIB_C_FILES += freebsd/usr.bin/netstat/if.c
+LIB_C_FILES += freebsd/usr.bin/netstat/inet6.c
+LIB_C_FILES += freebsd/usr.bin/netstat/inet.c
+LIB_C_FILES += freebsd/usr.bin/netstat/ipsec.c
+LIB_C_FILES += freebsd/usr.bin/netstat/main.c
+LIB_C_FILES += freebsd/usr.bin/netstat/mbuf.c
+LIB_C_FILES += freebsd/usr.bin/netstat/mroute6.c
+LIB_C_FILES += freebsd/usr.bin/netstat/mroute.c
+LIB_C_FILES += freebsd/usr.bin/netstat/route.c
+LIB_C_FILES += freebsd/usr.bin/netstat/pfkey.c
+LIB_C_FILES += freebsd/usr.bin/netstat/sctp.c
+LIB_C_FILES += freebsd/usr.bin/netstat/unix.c
+
+TEST_USB01 = testsuite/usb01/usb01.exe
+TEST_USB01_O_FILES =
+TEST_USB01_D_FILES =
+TEST_USB01_O_FILES += testsuite/usb01/init.o
+TEST_USB01_D_FILES += testsuite/usb01/init.d
+TEST_USB01_O_FILES += testsuite/usb01/test-file-system.o
+TEST_USB01_D_FILES += testsuite/usb01/test-file-system.d
+$(TEST_USB01): $(TEST_USB01_O_FILES) $(LIB)
+ $(LINK.c) $^ -lm -o $@
+TESTS += $(TEST_USB01)
+O_FILES += $(TEST_USB01_O_FILES)
+D_FILES += $(TEST_USB01_D_FILES)
+
+TEST_LOOPBACK01 = testsuite/loopback01/loopback01.exe
+TEST_LOOPBACK01_O_FILES =
+TEST_LOOPBACK01_D_FILES =
+TEST_LOOPBACK01_O_FILES += testsuite/loopback01/test_main.o
+TEST_LOOPBACK01_D_FILES += testsuite/loopback01/test_main.d
+$(TEST_LOOPBACK01): $(TEST_LOOPBACK01_O_FILES) $(LIB)
+ $(LINK.c) $^ -lm -o $@
+TESTS += $(TEST_LOOPBACK01)
+O_FILES += $(TEST_LOOPBACK01_O_FILES)
+D_FILES += $(TEST_LOOPBACK01_D_FILES)
+RUN_TESTS += $(TEST_LOOPBACK01)
+
+TEST_NETSHELL01 = testsuite/netshell01/netshell01.exe
+TEST_NETSHELL01_O_FILES =
+TEST_NETSHELL01_D_FILES =
+TEST_NETSHELL01_O_FILES += testsuite/netshell01/test_main.o
+TEST_NETSHELL01_D_FILES += testsuite/netshell01/test_main.d
+TEST_NETSHELL01_O_FILES += testsuite/netshell01/shellconfig.o
+TEST_NETSHELL01_D_FILES += testsuite/netshell01/shellconfig.d
+TEST_NETSHELL01_O_FILES += testsuite/netshell01/ns_parser_vars.o
+TEST_NETSHELL01_D_FILES += testsuite/netshell01/ns_parser_vars.d
+$(TEST_NETSHELL01): $(TEST_NETSHELL01_O_FILES) $(LIB)
+ $(LINK.c) $^ -lm -o $@
+TESTS += $(TEST_NETSHELL01)
+O_FILES += $(TEST_NETSHELL01_O_FILES)
+D_FILES += $(TEST_NETSHELL01_D_FILES)
+RUN_TESTS += $(TEST_NETSHELL01)
+
+TEST_SWI01 = testsuite/swi01/swi01.exe
+TEST_SWI01_O_FILES =
+TEST_SWI01_D_FILES =
+TEST_SWI01_O_FILES += testsuite/swi01/init.o
+TEST_SWI01_D_FILES += testsuite/swi01/init.d
+TEST_SWI01_O_FILES += testsuite/swi01/swi_test.o
+TEST_SWI01_D_FILES += testsuite/swi01/swi_test.d
+$(TEST_SWI01): $(TEST_SWI01_O_FILES) $(LIB)
+ $(LINK.c) $^ -lm -o $@
+TESTS += $(TEST_SWI01)
+O_FILES += $(TEST_SWI01_O_FILES)
+D_FILES += $(TEST_SWI01_D_FILES)
+RUN_TESTS += $(TEST_SWI01)
+
+TEST_TIMEOUT01 = testsuite/timeout01/timeout01.exe
+TEST_TIMEOUT01_O_FILES =
+TEST_TIMEOUT01_D_FILES =
+TEST_TIMEOUT01_O_FILES += testsuite/timeout01/init.o
+TEST_TIMEOUT01_D_FILES += testsuite/timeout01/init.d
+TEST_TIMEOUT01_O_FILES += testsuite/timeout01/timeout_test.o
+TEST_TIMEOUT01_D_FILES += testsuite/timeout01/timeout_test.d
+TEST_TIMEOUT01_O_FILES += testsuite/timeout01/timeout_helper.o
+TEST_TIMEOUT01_D_FILES += testsuite/timeout01/timeout_helper.d
+$(TEST_TIMEOUT01): $(TEST_TIMEOUT01_O_FILES) $(LIB)
+ $(LINK.c) $^ -lm -o $@
+TESTS += $(TEST_TIMEOUT01)
+O_FILES += $(TEST_TIMEOUT01_O_FILES)
+D_FILES += $(TEST_TIMEOUT01_D_FILES)
+RUN_TESTS += $(TEST_TIMEOUT01)
+
+TEST_INIT01 = testsuite/init01/init01.exe
+TEST_INIT01_O_FILES =
+TEST_INIT01_D_FILES =
+TEST_INIT01_O_FILES += testsuite/init01/test_main.o
+TEST_INIT01_D_FILES += testsuite/init01/test_main.d
+$(TEST_INIT01): $(TEST_INIT01_O_FILES) $(LIB)
+ $(LINK.c) $^ -lm -o $@
+TESTS += $(TEST_INIT01)
+O_FILES += $(TEST_INIT01_O_FILES)
+D_FILES += $(TEST_INIT01_D_FILES)
+RUN_TESTS += $(TEST_INIT01)
ifeq ($(NEED_DUMMY_PIC_IRQ),yes)
CFLAGS += -I rtems-dummy-pic-irq/include
endif
-C_O_FILES = $(C_FILES:%.c=%.o)
-C_D_FILES = $(C_FILES:%.c=%.d)
-
-LIB = libbsd.a
+LIB_O_FILES = $(LIB_C_FILES:%.c=%.o)
+O_FILES += $(LIB_O_FILES)
+D_FILES += $(LIB_C_FILES:%.c=%.d)
-all: $(LIB) lib_user
+all: $(LIB) $(TESTS)
-$(LIB): $(GENERATED_FILES) $(C_O_FILES)
+$(LIB): $(LIB_GEN_FILES) $(LIB_O_FILES)
$(AR) rcu $@ $^
-
-lib_user: $(LIB) install_bsd
- $(MAKE) -C freebsd-userspace
+run_tests: $(RUN_TESTS)
+ $(TEST_RUNNER) $^
+ check_endof
# The following targets use the MIPS Generic in_cksum routine
-rtemsbsd/freebsd/machine/rtems-bsd-config.h: rtemsbsd/freebsd/machine/rtems-bsd-config.h.in
+rtemsbsd/include/machine/rtems-bsd-config.h: rtemsbsd/include/machine/rtems-bsd-config.h.in
sed $(SED_PATTERN) <$< >$@
-copied/rtemsbsd/avr/avr/in_cksum.c: freebsd/mips/mips/in_cksum.c
- test -d copied/rtemsbsd/avr/avr/ || mkdir -p copied/rtemsbsd/avr/avr/
- cp $< $@
-
-copied/rtemsbsd/avr/include/freebsd/machine/in_cksum.h: freebsd/mips/include/freebsd/machine/in_cksum.h
- test -d copied/rtemsbsd/avr/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/avr/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/bfin/bfin/in_cksum.c: freebsd/mips/mips/in_cksum.c
- test -d copied/rtemsbsd/bfin/bfin/ || mkdir -p copied/rtemsbsd/bfin/bfin/
- cp $< $@
-
-copied/rtemsbsd/bfin/include/freebsd/machine/in_cksum.h: freebsd/mips/include/freebsd/machine/in_cksum.h
- test -d copied/rtemsbsd/bfin/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/bfin/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/h8300/h8300/in_cksum.c: freebsd/mips/mips/in_cksum.c
- test -d copied/rtemsbsd/h8300/h8300/ || mkdir -p copied/rtemsbsd/h8300/h8300/
- cp $< $@
-
-copied/rtemsbsd/h8300/include/freebsd/machine/in_cksum.h: freebsd/mips/include/freebsd/machine/in_cksum.h
- test -d copied/rtemsbsd/h8300/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/h8300/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/lm32/lm32/in_cksum.c: freebsd/mips/mips/in_cksum.c
- test -d copied/rtemsbsd/lm32/lm32/ || mkdir -p copied/rtemsbsd/lm32/lm32/
- cp $< $@
-
-copied/rtemsbsd/lm32/include/freebsd/machine/in_cksum.h: freebsd/mips/include/freebsd/machine/in_cksum.h
- test -d copied/rtemsbsd/lm32/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/lm32/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/m32c/m32c/in_cksum.c: freebsd/mips/mips/in_cksum.c
- test -d copied/rtemsbsd/m32c/m32c/ || mkdir -p copied/rtemsbsd/m32c/m32c/
- cp $< $@
-
-copied/rtemsbsd/m32c/include/freebsd/machine/in_cksum.h: freebsd/mips/include/freebsd/machine/in_cksum.h
- test -d copied/rtemsbsd/m32c/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/m32c/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/m32r/m32r/in_cksum.c: freebsd/mips/mips/in_cksum.c
- test -d copied/rtemsbsd/m32r/m32r/ || mkdir -p copied/rtemsbsd/m32r/m32r/
- cp $< $@
-
-copied/rtemsbsd/m32r/include/freebsd/machine/in_cksum.h: freebsd/mips/include/freebsd/machine/in_cksum.h
- test -d copied/rtemsbsd/m32r/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/m32r/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/m68k/m68k/in_cksum.c: freebsd/mips/mips/in_cksum.c
- test -d copied/rtemsbsd/m68k/m68k/ || mkdir -p copied/rtemsbsd/m68k/m68k/
- cp $< $@
-
-copied/rtemsbsd/m68k/include/freebsd/machine/in_cksum.h: freebsd/mips/include/freebsd/machine/in_cksum.h
- test -d copied/rtemsbsd/m68k/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/m68k/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/nios2/nios2/in_cksum.c: freebsd/mips/mips/in_cksum.c
- test -d copied/rtemsbsd/nios2/nios2/ || mkdir -p copied/rtemsbsd/nios2/nios2/
- cp $< $@
-
-copied/rtemsbsd/nios2/include/freebsd/machine/in_cksum.h: freebsd/mips/include/freebsd/machine/in_cksum.h
- test -d copied/rtemsbsd/nios2/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/nios2/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/sh/sh/in_cksum.c: freebsd/mips/mips/in_cksum.c
- test -d copied/rtemsbsd/sh/sh/ || mkdir -p copied/rtemsbsd/sh/sh/
- cp $< $@
-
-copied/rtemsbsd/sh/include/freebsd/machine/in_cksum.h: freebsd/mips/include/freebsd/machine/in_cksum.h
- test -d copied/rtemsbsd/sh/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/sh/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/sparc/sparc/in_cksum.c: freebsd/mips/mips/in_cksum.c
- test -d copied/rtemsbsd/sparc/sparc/ || mkdir -p copied/rtemsbsd/sparc/sparc/
- cp $< $@
-
-copied/rtemsbsd/sparc/include/freebsd/machine/in_cksum.h: freebsd/mips/include/freebsd/machine/in_cksum.h
- test -d copied/rtemsbsd/sparc/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/sparc/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/v850/v850/in_cksum.c: freebsd/mips/mips/in_cksum.c
- test -d copied/rtemsbsd/v850/v850/ || mkdir -p copied/rtemsbsd/v850/v850/
- cp $< $@
-
-copied/rtemsbsd/v850/include/freebsd/machine/in_cksum.h: freebsd/mips/include/freebsd/machine/in_cksum.h
- test -d copied/rtemsbsd/v850/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/v850/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/arm/include/freebsd/machine/legacyvar.h: freebsd/i386/include/freebsd/machine/legacyvar.h
- test -d copied/rtemsbsd/arm/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/arm/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/arm/include/freebsd/machine/pci_cfgreg.h: freebsd/i386/include/freebsd/machine/pci_cfgreg.h
- test -d copied/rtemsbsd/arm/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/arm/include/freebsd/machine/
- cp $< $@
-
-copied/freebsd/arm/pci/pci_bus.c: freebsd/i386/pci/pci_bus.c
- test -d copied/freebsd/arm/pci/ || mkdir -p copied/freebsd/arm/pci/
- cp $< $@
-
-copied/freebsd/arm/arm/legacy.c: freebsd/i386/i386/legacy.c
- test -d copied/freebsd/arm/arm/ || mkdir -p copied/freebsd/arm/arm/
- cp $< $@
-
-copied/rtemsbsd/avr/include/freebsd/machine/legacyvar.h: freebsd/i386/include/freebsd/machine/legacyvar.h
- test -d copied/rtemsbsd/avr/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/avr/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/avr/include/freebsd/machine/pci_cfgreg.h: freebsd/i386/include/freebsd/machine/pci_cfgreg.h
- test -d copied/rtemsbsd/avr/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/avr/include/freebsd/machine/
- cp $< $@
-
-copied/freebsd/avr/pci/pci_bus.c: freebsd/i386/pci/pci_bus.c
- test -d copied/freebsd/avr/pci/ || mkdir -p copied/freebsd/avr/pci/
- cp $< $@
-
-copied/freebsd/avr/avr/legacy.c: freebsd/i386/i386/legacy.c
- test -d copied/freebsd/avr/avr/ || mkdir -p copied/freebsd/avr/avr/
- cp $< $@
-
-copied/rtemsbsd/bfin/include/freebsd/machine/legacyvar.h: freebsd/i386/include/freebsd/machine/legacyvar.h
- test -d copied/rtemsbsd/bfin/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/bfin/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/bfin/include/freebsd/machine/pci_cfgreg.h: freebsd/i386/include/freebsd/machine/pci_cfgreg.h
- test -d copied/rtemsbsd/bfin/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/bfin/include/freebsd/machine/
- cp $< $@
-
-copied/freebsd/bfin/pci/pci_bus.c: freebsd/i386/pci/pci_bus.c
- test -d copied/freebsd/bfin/pci/ || mkdir -p copied/freebsd/bfin/pci/
- cp $< $@
-
-copied/freebsd/bfin/bfin/legacy.c: freebsd/i386/i386/legacy.c
- test -d copied/freebsd/bfin/bfin/ || mkdir -p copied/freebsd/bfin/bfin/
- cp $< $@
-
-copied/rtemsbsd/h8300/include/freebsd/machine/legacyvar.h: freebsd/i386/include/freebsd/machine/legacyvar.h
- test -d copied/rtemsbsd/h8300/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/h8300/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/h8300/include/freebsd/machine/pci_cfgreg.h: freebsd/i386/include/freebsd/machine/pci_cfgreg.h
- test -d copied/rtemsbsd/h8300/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/h8300/include/freebsd/machine/
- cp $< $@
-
-copied/freebsd/h8300/pci/pci_bus.c: freebsd/i386/pci/pci_bus.c
- test -d copied/freebsd/h8300/pci/ || mkdir -p copied/freebsd/h8300/pci/
- cp $< $@
-
-copied/freebsd/h8300/h8300/legacy.c: freebsd/i386/i386/legacy.c
- test -d copied/freebsd/h8300/h8300/ || mkdir -p copied/freebsd/h8300/h8300/
- cp $< $@
-
-copied/rtemsbsd/lm32/include/freebsd/machine/legacyvar.h: freebsd/i386/include/freebsd/machine/legacyvar.h
- test -d copied/rtemsbsd/lm32/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/lm32/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/lm32/include/freebsd/machine/pci_cfgreg.h: freebsd/i386/include/freebsd/machine/pci_cfgreg.h
- test -d copied/rtemsbsd/lm32/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/lm32/include/freebsd/machine/
- cp $< $@
-
-copied/freebsd/lm32/pci/pci_bus.c: freebsd/i386/pci/pci_bus.c
- test -d copied/freebsd/lm32/pci/ || mkdir -p copied/freebsd/lm32/pci/
- cp $< $@
-
-copied/freebsd/lm32/lm32/legacy.c: freebsd/i386/i386/legacy.c
- test -d copied/freebsd/lm32/lm32/ || mkdir -p copied/freebsd/lm32/lm32/
- cp $< $@
-
-copied/rtemsbsd/m32c/include/freebsd/machine/legacyvar.h: freebsd/i386/include/freebsd/machine/legacyvar.h
- test -d copied/rtemsbsd/m32c/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/m32c/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/m32c/include/freebsd/machine/pci_cfgreg.h: freebsd/i386/include/freebsd/machine/pci_cfgreg.h
- test -d copied/rtemsbsd/m32c/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/m32c/include/freebsd/machine/
- cp $< $@
-
-copied/freebsd/m32c/pci/pci_bus.c: freebsd/i386/pci/pci_bus.c
- test -d copied/freebsd/m32c/pci/ || mkdir -p copied/freebsd/m32c/pci/
- cp $< $@
-
-copied/freebsd/m32c/m32c/legacy.c: freebsd/i386/i386/legacy.c
- test -d copied/freebsd/m32c/m32c/ || mkdir -p copied/freebsd/m32c/m32c/
- cp $< $@
-
-copied/rtemsbsd/m32r/include/freebsd/machine/legacyvar.h: freebsd/i386/include/freebsd/machine/legacyvar.h
- test -d copied/rtemsbsd/m32r/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/m32r/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/m32r/include/freebsd/machine/pci_cfgreg.h: freebsd/i386/include/freebsd/machine/pci_cfgreg.h
- test -d copied/rtemsbsd/m32r/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/m32r/include/freebsd/machine/
- cp $< $@
-
-copied/freebsd/m32r/pci/pci_bus.c: freebsd/i386/pci/pci_bus.c
- test -d copied/freebsd/m32r/pci/ || mkdir -p copied/freebsd/m32r/pci/
- cp $< $@
-
-copied/freebsd/m32r/m32r/legacy.c: freebsd/i386/i386/legacy.c
- test -d copied/freebsd/m32r/m32r/ || mkdir -p copied/freebsd/m32r/m32r/
- cp $< $@
-
-copied/rtemsbsd/m68k/include/freebsd/machine/legacyvar.h: freebsd/i386/include/freebsd/machine/legacyvar.h
- test -d copied/rtemsbsd/m68k/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/m68k/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/m68k/include/freebsd/machine/pci_cfgreg.h: freebsd/i386/include/freebsd/machine/pci_cfgreg.h
- test -d copied/rtemsbsd/m68k/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/m68k/include/freebsd/machine/
- cp $< $@
-
-copied/freebsd/m68k/pci/pci_bus.c: freebsd/i386/pci/pci_bus.c
- test -d copied/freebsd/m68k/pci/ || mkdir -p copied/freebsd/m68k/pci/
- cp $< $@
-
-copied/freebsd/m68k/m68k/legacy.c: freebsd/i386/i386/legacy.c
- test -d copied/freebsd/m68k/m68k/ || mkdir -p copied/freebsd/m68k/m68k/
- cp $< $@
-
-copied/rtemsbsd/mips/include/freebsd/machine/legacyvar.h: freebsd/i386/include/freebsd/machine/legacyvar.h
- test -d copied/rtemsbsd/mips/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/mips/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/mips/include/freebsd/machine/pci_cfgreg.h: freebsd/i386/include/freebsd/machine/pci_cfgreg.h
- test -d copied/rtemsbsd/mips/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/mips/include/freebsd/machine/
- cp $< $@
-
-copied/freebsd/mips/pci/pci_bus.c: freebsd/i386/pci/pci_bus.c
- test -d copied/freebsd/mips/pci/ || mkdir -p copied/freebsd/mips/pci/
- cp $< $@
-
-copied/freebsd/mips/mips/legacy.c: freebsd/i386/i386/legacy.c
- test -d copied/freebsd/mips/mips/ || mkdir -p copied/freebsd/mips/mips/
- cp $< $@
-
-copied/rtemsbsd/nios2/include/freebsd/machine/legacyvar.h: freebsd/i386/include/freebsd/machine/legacyvar.h
- test -d copied/rtemsbsd/nios2/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/nios2/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/nios2/include/freebsd/machine/pci_cfgreg.h: freebsd/i386/include/freebsd/machine/pci_cfgreg.h
- test -d copied/rtemsbsd/nios2/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/nios2/include/freebsd/machine/
- cp $< $@
-
-copied/freebsd/nios2/pci/pci_bus.c: freebsd/i386/pci/pci_bus.c
- test -d copied/freebsd/nios2/pci/ || mkdir -p copied/freebsd/nios2/pci/
- cp $< $@
-
-copied/freebsd/nios2/nios2/legacy.c: freebsd/i386/i386/legacy.c
- test -d copied/freebsd/nios2/nios2/ || mkdir -p copied/freebsd/nios2/nios2/
- cp $< $@
-
-copied/rtemsbsd/powerpc/include/freebsd/machine/legacyvar.h: freebsd/i386/include/freebsd/machine/legacyvar.h
- test -d copied/rtemsbsd/powerpc/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/powerpc/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/powerpc/include/freebsd/machine/pci_cfgreg.h: freebsd/i386/include/freebsd/machine/pci_cfgreg.h
- test -d copied/rtemsbsd/powerpc/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/powerpc/include/freebsd/machine/
- cp $< $@
-
-copied/freebsd/powerpc/pci/pci_bus.c: freebsd/i386/pci/pci_bus.c
- test -d copied/freebsd/powerpc/pci/ || mkdir -p copied/freebsd/powerpc/pci/
- cp $< $@
-
-copied/freebsd/powerpc/powerpc/legacy.c: freebsd/i386/i386/legacy.c
- test -d copied/freebsd/powerpc/powerpc/ || mkdir -p copied/freebsd/powerpc/powerpc/
- cp $< $@
-
-copied/rtemsbsd/sh/include/freebsd/machine/legacyvar.h: freebsd/i386/include/freebsd/machine/legacyvar.h
- test -d copied/rtemsbsd/sh/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/sh/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/sh/include/freebsd/machine/pci_cfgreg.h: freebsd/i386/include/freebsd/machine/pci_cfgreg.h
- test -d copied/rtemsbsd/sh/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/sh/include/freebsd/machine/
- cp $< $@
-
-copied/freebsd/sh/pci/pci_bus.c: freebsd/i386/pci/pci_bus.c
- test -d copied/freebsd/sh/pci/ || mkdir -p copied/freebsd/sh/pci/
- cp $< $@
-
-copied/freebsd/sh/sh/legacy.c: freebsd/i386/i386/legacy.c
- test -d copied/freebsd/sh/sh/ || mkdir -p copied/freebsd/sh/sh/
- cp $< $@
-
-copied/rtemsbsd/sparc/include/freebsd/machine/legacyvar.h: freebsd/i386/include/freebsd/machine/legacyvar.h
- test -d copied/rtemsbsd/sparc/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/sparc/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/sparc/include/freebsd/machine/pci_cfgreg.h: freebsd/i386/include/freebsd/machine/pci_cfgreg.h
- test -d copied/rtemsbsd/sparc/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/sparc/include/freebsd/machine/
- cp $< $@
-
-copied/freebsd/sparc/pci/pci_bus.c: freebsd/i386/pci/pci_bus.c
- test -d copied/freebsd/sparc/pci/ || mkdir -p copied/freebsd/sparc/pci/
- cp $< $@
-
-copied/freebsd/sparc/sparc/legacy.c: freebsd/i386/i386/legacy.c
- test -d copied/freebsd/sparc/sparc/ || mkdir -p copied/freebsd/sparc/sparc/
- cp $< $@
-
-copied/rtemsbsd/sparc64/include/freebsd/machine/legacyvar.h: freebsd/i386/include/freebsd/machine/legacyvar.h
- test -d copied/rtemsbsd/sparc64/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/sparc64/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/sparc64/include/freebsd/machine/pci_cfgreg.h: freebsd/i386/include/freebsd/machine/pci_cfgreg.h
- test -d copied/rtemsbsd/sparc64/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/sparc64/include/freebsd/machine/
- cp $< $@
-
-copied/freebsd/sparc64/pci/pci_bus.c: freebsd/i386/pci/pci_bus.c
- test -d copied/freebsd/sparc64/pci/ || mkdir -p copied/freebsd/sparc64/pci/
- cp $< $@
-
-copied/freebsd/sparc64/sparc64/legacy.c: freebsd/i386/i386/legacy.c
- test -d copied/freebsd/sparc64/sparc64/ || mkdir -p copied/freebsd/sparc64/sparc64/
- cp $< $@
-
-copied/rtemsbsd/v850/include/freebsd/machine/legacyvar.h: freebsd/i386/include/freebsd/machine/legacyvar.h
- test -d copied/rtemsbsd/v850/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/v850/include/freebsd/machine/
- cp $< $@
-
-copied/rtemsbsd/v850/include/freebsd/machine/pci_cfgreg.h: freebsd/i386/include/freebsd/machine/pci_cfgreg.h
- test -d copied/rtemsbsd/v850/include/freebsd/machine/ || mkdir -p copied/rtemsbsd/v850/include/freebsd/machine/
- cp $< $@
-
-copied/freebsd/v850/pci/pci_bus.c: freebsd/i386/pci/pci_bus.c
- test -d copied/freebsd/v850/pci/ || mkdir -p copied/freebsd/v850/pci/
- cp $< $@
-
-copied/freebsd/v850/v850/legacy.c: freebsd/i386/i386/legacy.c
- test -d copied/freebsd/v850/v850/ || mkdir -p copied/freebsd/v850/v850/
- cp $< $@
-
CPU_SED = sed
CPU_SED += -e '/arm/d'
CPU_SED += -e '/i386/d'
@@ -1004,9 +890,7 @@ CPU_SED += -e '/powerpc/d'
CPU_SED += -e '/mips/d'
CPU_SED += -e '/sparc64/d'
-install: $(LIB) install_bsd lib_user install_user
-
-install_bsd: $(LIB)
+install: $(LIB)
install -d $(INSTALL_BASE)/include
install -c -m 644 $(LIB) $(INSTALL_BASE)
cd rtemsbsd; for i in `find freebsd -name '*.h'` ; do \
@@ -1025,17 +909,11 @@ install_bsd: $(LIB)
-cd copied/rtemsbsd/$(RTEMS_CPU)/include && for i in `find . -name '*.h'` ; do \
install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done
-install_user:
- $(MAKE) -C freebsd-userspace install
-
clean:
- rm -f -r $(PROJECT_INCLUDE)/rtems/freebsd
- rm -f $(LIB) $(C_O_FILES) $(C_D_FILES) $(GENERATED_FILES)
+ rm -f $(LIB_GEN_FILES) $(LIB) $(TESTS) $(O_FILES) $(D_FILES)
rm -f libbsd.html
- rm -rf copied
- $(MAKE) -C freebsd-userspace clean
--include $(C_D_FILES)
+-include $(D_FILES)
doc: libbsd.html
diff --git a/config.inc b/config.inc
index 63eddb10..a88420b4 100644
--- a/config.inc
+++ b/config.inc
@@ -1,4 +1,5 @@
-RTEMS_MAKEFILE_PATH = ${HOME}/newbsd/bsp-install/mips-rtems4.11/jmr3904/
+BSP = jmr3904
+RTEMS_MAKEFILE_PATH = ${HOME}/newbsd/bsp-install/mips-rtems4.11/$(BSP)
INSTALL_BASE = ${HOME}/newbsd/install
DISABLE_IPV6=yes
-
+TEST_RUNNER = $(BSP)
diff --git a/freebsd-to-rtems.py b/freebsd-to-rtems.py
index b33703d5..6d4668d1 100755
--- a/freebsd-to-rtems.py
+++ b/freebsd-to-rtems.py
@@ -1,9 +1,9 @@
-#! /usr/bin/python
+#!/usr/bin/python
#
-# Copyright (c) 2009-2012 embedded brains GmbH. All rights reserved.
+# Copyright (c) 2009-2013 embedded brains GmbH. All rights reserved.
#
# embedded brains GmbH
-# Obere Lagerstr. 30
+# Dornierstr. 4
# 82178 Puchheim
# Germany
# <info@embedded-brains.de>
@@ -52,40 +52,6 @@ isOnlyMakefile = False
tempFile = "/tmp/tmp_FBRT"
filesProcessed = 0
-# currently these all use the MIPS in_cksum method
-CPUsNeedingGenericIncksum = [
- "avr",
- "bfin",
- "h8300",
- "lm32",
- "m32c",
- "m32r",
- "m68k",
- "nios2",
- "sh",
- "sparc",
- "v850",
-]
-
-# currently these all use the MIPS in_cksum method
-CPUsSharingPCICodeFromX86 = [
- 'arm',
- 'avr',
- 'bfin',
- 'h8300',
- 'lm32',
- 'm32c',
- 'm32r',
- 'm68k',
- 'mips',
- 'nios2',
- 'powerpc',
- 'sh',
- 'sparc',
- 'sparc64',
- 'v850',
-]
-
def usage():
print "freebsd-to-rtems.py [args]"
print " -?|-h|--help print this and exit"
@@ -180,20 +146,10 @@ else:
if isEarlyExit == True:
print "Early exit at user request"
sys.exit(0)
-
-# Prefix added to FreeBSD files as they are copied into the RTEMS
-# build tree.
-PREFIX = 'freebsd'
-
-def mapContribPath(path):
- m = re.match('(.*)(' + PREFIX + '/)(contrib/\\w+/)(.*)', path)
- if m:
- path = m.group(1) + m.group(3) + m.group(2) + m.group(4)
- return path
# Move target dependent files under a machine directory
def mapCPUDependentPath(path):
- return path.replace("include/", "include/freebsd/machine/")
+ return path.replace("include/", "include/machine/")
# compare and process file only if different
# + copy or diff depending on execution mode
@@ -216,20 +172,31 @@ def processIfDifferent(new, old, src):
old_contents, new_contents, fromfile=src, tofile=new, n=5):
sys.stdout.write(line)
-# fix include paths inside a C or .h file
def fixIncludes(data):
- data = re.sub('#([ \t]*)include <', '#\\1include <' + PREFIX + '/', data)
- data = re.sub('#include <' + PREFIX + '/rtems', '#include <rtems', data)
- data = re.sub('#include <' + PREFIX + '/bsp', '#include <bsp', data)
- data = re.sub('#include "([^"]*)"', '#include <' + PREFIX + '/local/\\1>', data)
- data = re.sub('_H_', '_HH_', data)
+ data = re.sub('#include <sys/lock.h>', '#include <rtems/bsd/sys/lock.h>', data)
+ data = re.sub('#include <sys/time.h>', '#include <rtems/bsd/sys/time.h>', data)
+ data = re.sub('#include <sys/errno.h>', '#include <rtems/bsd/sys/errno.h>', data)
+ data = re.sub('#include <sys/param.h>', '#include <rtems/bsd/sys/param.h>', data)
+ data = re.sub('#include <sys/types.h>', '#include <rtems/bsd/sys/types.h>', data)
+ data = re.sub('#include <sys/resource.h>', '#include <rtems/bsd/sys/resource.h>', data)
+ data = re.sub('#include <sys/unistd.h>', '#include <rtems/bsd/sys/unistd.h>', data)
+ data = re.sub('#include <sys/timespec.h>', '#include <rtems/bsd/sys/timespec.h>', data)
+ data = re.sub('#include <sys/_types.h>', '#include <rtems/bsd/sys/_types.h>', data)
return data
# revert fixing the include paths inside a C or .h file
def revertFixIncludes(data):
- data = re.sub('_HH_', '_H_', data)
- data = re.sub('#include <' + PREFIX + '/local/([^>]*)>', '#include "\\1"', data)
- data = re.sub('#([ \t]*)include <' + PREFIX + '/', '#\\1include <', data)
+ data = re.sub('#include <rtems/bsd/', '#include <', data)
+ return data
+
+# fix include paths inside a C or .h file
+def fixLocalIncludes(data):
+ data = re.sub('#include "([^"]*)"', '#include <rtems/bsd/local/\\1>', data)
+ return data
+
+# revert fixing the include paths inside a C or .h file
+def revertFixLocalIncludes(data):
+ data = re.sub('#include <rtems/bsd/local/([^>]*)>', '#include "\\1"', data)
return data
class Converter(object):
@@ -253,24 +220,42 @@ class EmptyConverter(Converter):
class FromFreeBSDToRTEMSHeaderConverter(Converter):
def convert(self, src):
data = super(FromFreeBSDToRTEMSHeaderConverter, self).convert(src)
- return fixIncludes(data)
+ data = fixLocalIncludes(data)
+ data = fixIncludes(data)
+ return data
-class FromRTEMSToFreeBSDHeaderConverter(Converter):
+class FromFreeBSDToRTEMSUserSpaceHeaderConverter(Converter):
def convert(self, src):
- data = super(FromRTEMSToFreeBSDHeaderConverter, self).convert(src)
- return revertFixIncludes(data)
+ data = super(FromFreeBSDToRTEMSUserSpaceHeaderConverter, self).convert(src)
+ data = fixIncludes(data)
+ return data
class FromFreeBSDToRTEMSSourceConverter(Converter):
def convert(self, src):
data = super(FromFreeBSDToRTEMSSourceConverter, self).convert(src)
+ data = fixLocalIncludes(data)
+ data = fixIncludes(data)
+ data = '#include <machine/rtems-bsd-config.h>\n\n' + data
+ return data
+
+class FromFreeBSDToRTEMSUserSpaceSourceConverter(Converter):
+ def convert(self, src):
+ data = super(FromFreeBSDToRTEMSUserSpaceSourceConverter, self).convert(src)
data = fixIncludes(data)
- data = '#include <' + PREFIX + '/machine/rtems-bsd-config.h>\n\n' + data
+ return data
+
+class FromRTEMSToFreeBSDHeaderConverter(Converter):
+ def convert(self, src):
+ data = super(FromRTEMSToFreeBSDHeaderConverter, self).convert(src)
+ data = revertFixLocalIncludes(data)
+ data = revertFixIncludes(data)
return data
class FromRTEMSToFreeBSDSourceConverter(Converter):
def convert(self, src):
data = super(FromRTEMSToFreeBSDSourceConverter, self).convert(src)
- data = re.sub('#include <' + PREFIX + '/machine/rtems-bsd-config.h>\n\n', '', data)
+ data = re.sub('#include <machine/rtems-bsd-config.h>\n\n', '', data)
+ data = revertFixLocalIncludes(data)
data = revertFixIncludes(data)
return data
@@ -279,11 +264,9 @@ class PathComposer(object):
return FreeBSD_DIR + '/' + path
def composeRTEMSPath(self, path, prefix):
- path = prefix + PREFIX + '/' + path
- path = mapContribPath(path)
- return path
+ return prefix + 'freebsd/' + path
-class RTEMSPathComposer(object):
+class RTEMSPathComposer(PathComposer):
def composeFreeBSDPath(self, path):
return path
@@ -297,12 +280,58 @@ class CPUDependentPathComposer(PathComposer):
path = mapCPUDependentPath(path)
return path
+class TargetSourceCPUDependentPathComposer(CPUDependentPathComposer):
+ def __init__(self, targetCPU, sourceCPU):
+ self.targetCPU = targetCPU
+ self.sourceCPU = sourceCPU
+
+ def composeRTEMSPath(self, path, prefix):
+ path = super(TargetSourceCPUDependentPathComposer, self).composeRTEMSPath(path, prefix)
+ path = path.replace(self.sourceCPU, self.targetCPU)
+ return path
+
+class MakefileFragmentComposer(object):
+ def compose(self, path):
+ return ''
+
+class SourceFileMakefileFragmentComposer(MakefileFragmentComposer):
+ def compose(self, path):
+ return 'LIB_C_FILES += ' + path + '\n'
+
+class TestMakefileFragementComposer(MakefileFragmentComposer):
+ def __init__(self, testName, fileFragments, runTest):
+ self.testName = testName
+ self.fileFragments = fileFragments
+ self.runTest = runTest
+
+ def compose(self, path):
+ testPrefix = 'TEST_' + self.testName.upper()
+ testOFiles = testPrefix + '_O_FILES'
+ testDFiles = testPrefix + '_D_FILES'
+ testDir = 'testsuite/' + self.testName
+ testExe = testDir + '/' + self.testName + '.exe'
+ makefileFragment = '\n' + testPrefix + ' = ' + testExe + '\n' \
+ + testOFiles + ' =\n' \
+ + testDFiles + ' =\n'
+ for fileFragment in self.fileFragments:
+ makefileFragment = makefileFragment + testOFiles + ' += ' + testDir + '/' + fileFragment + '.o\n' \
+ + testDFiles + ' += ' + testDir + '/' + fileFragment + '.d\n'
+ makefileFragment = makefileFragment + '$(' + testPrefix + '): $(' + testOFiles + ') $(LIB)\n' \
+ '\t$(LINK.c) $^ -lm -o $@\n' \
+ 'TESTS += $(' + testPrefix + ')\n' \
+ 'O_FILES += $(' + testOFiles + ')\n' \
+ 'D_FILES += $(' + testDFiles + ')\n'
+ if self.runTest:
+ makefileFragment = makefileFragment + 'RUN_TESTS += $(' + testPrefix + ')\n'
+ return makefileFragment
+
class File(object):
- def __init__(self, path, pathComposer, fromFreeBSDToRTEMSConverter, fromRTEMSToFreeBSDConverter):
+ def __init__(self, path, pathComposer, fromFreeBSDToRTEMSConverter, fromRTEMSToFreeBSDConverter, makefileFragmentComposer):
self.path = path
self.pathComposer = pathComposer
self.fromFreeBSDToRTEMSConverter = fromFreeBSDToRTEMSConverter
self.fromRTEMSToFreeBSDConverter = fromRTEMSToFreeBSDConverter
+ self.makefileFragmentComposer = makefileFragmentComposer
def copy(self, dst, src, converter):
if converter.isConvertible():
@@ -329,21 +358,7 @@ class File(object):
self.copy(dst, src, self.fromRTEMSToFreeBSDConverter)
def getMakefileFragment(self):
- return self.pathComposer.composeRTEMSPath(self.path, '')
-
-# Remove the output directory
-def deleteOutputDirectory():
- try:
- if isVerbose == True:
- print "Delete Directory - " + RTEMS_DIR + "/freebsd"
- if isVerbose == True:
- print "Delete Directory - " + RTEMS_DIR + "/contrib"
- if isDryRun == True:
- return
- shutil.rmtree(RTEMS_DIR + "/freebsd" )
- shutil.rmtree(RTEMS_DIR + "/contrib" )
- except OSError:
- pass
+ return self.makefileFragmentComposer.compose(self.pathComposer.composeRTEMSPath(self.path, ''))
# Module Manager - Collection of Modules
class ModuleManager:
@@ -369,34 +384,51 @@ class ModuleManager:
'include $(RTEMS_CUSTOM)\n' \
'include $(PROJECT_ROOT)/make/leaf.cfg\n' \
'\n' \
- 'CFLAGS += -ffreestanding \n' \
- 'CFLAGS += -I . \n' \
- 'CFLAGS += -I rtemsbsd \n' \
- 'CFLAGS += -I rtemsbsd/$(RTEMS_CPU)/include \n' \
- 'CFLAGS += -I freebsd/$(RTEMS_CPU)/include \n' \
- 'CFLAGS += -I contrib/altq \n' \
- 'CFLAGS += -I contrib/pf \n' \
- 'CFLAGS += -I copied/rtemsbsd/$(RTEMS_CPU)/include \n' \
- 'CFLAGS += -w \n' \
+ 'CFLAGS += -ffreestanding\n' \
+ 'CFLAGS += -Irtemsbsd/include\n' \
+ 'CFLAGS += -Irtemsbsd/$(RTEMS_CPU)/include\n' \
+ 'CFLAGS += -Ifreebsd/sys\n' \
+ 'CFLAGS += -Ifreebsd/sys/$(RTEMS_CPU)/include\n' \
+ 'CFLAGS += -Ifreebsd/sys/contrib/altq\n' \
+ 'CFLAGS += -Ifreebsd/sys/contrib/pf\n' \
+ 'CFLAGS += -Icopied/rtemsbsd/$(RTEMS_CPU)/include\n' \
+ 'CFLAGS += -Ifreebsd/include\n' \
+ 'CFLAGS += -Ifreebsd/lib/libc/include\n' \
+ 'CFLAGS += -Ifreebsd/lib/libc/isc/include\n' \
+ 'CFLAGS += -Ifreebsd/lib/libc/resolv\n' \
+ 'CFLAGS += -Ifreebsd/lib/libutil\n' \
+ 'CFLAGS += -Ifreebsd/lib/libkvm\n' \
+ 'CFLAGS += -Ifreebsd/lib/libmemstat\n' \
+ 'CFLAGS += -Ifreebsd/lib/libipsec\n' \
+ 'CFLAGS += -Itestsuite/include\n' \
+ 'CFLAGS += -D__FreeBSD__\n' \
+ 'CFLAGS += -D__DBINTERFACE_PRIVATE\n' \
+ 'CFLAGS += -w\n' \
'CFLAGS += -std=gnu99\n' \
'CFLAGS += -MT $@ -MD -MP -MF $(basename $@).d\n' \
'NEED_DUMMY_PIC_IRQ=yes\n' \
'\n' \
'# do nothing default so sed on rtems-bsd-config.h always works.\n' \
'SED_PATTERN += -e \'s/^//\'\n' \
- 'GENERATED_FILES = rtemsbsd/freebsd/machine/rtems-bsd-config.h\n' \
- '\n'
- data += 'C_FILES =\n'
+ '\n' \
+ 'TESTS =\n' \
+ 'RUN_TESTS =\n' \
+ 'O_FILES =\n' \
+ 'D_FILES =\n' \
+ '\n' \
+ 'LIB = libbsd.a\n' \
+ 'LIB_GEN_FILES = rtemsbsd/include/machine/rtems-bsd-config.h\n' \
+ 'LIB_C_FILES =\n'
for m in self.modules:
if m.conditionalOn != "none":
data += 'ifneq ($(' + m.conditionalOn + '),yes)\n'
- for file in m.sourceFiles:
- data += 'C_FILES += ' + file.getMakefileFragment() + '\n'
+ for f in m.files:
+ data += f.getMakefileFragment()
for cpu, files in sorted(m.cpuDependentSourceFiles.items()):
data += 'ifeq ($(RTEMS_CPU), ' + cpu + ')\n'
- for file in files:
- data += 'C_FILES += ' + file.getMakefileFragment() + '\n'
+ for f in files:
+ data += f.getMakefileFragment()
if cpu in ("arm", "i386", "lm32", "mips", "powerpc", "sparc"):
data += 'NEED_DUMMY_PIC_IRQ=no\n'
data += 'endif\n'
@@ -404,91 +436,34 @@ class ModuleManager:
data += 'else\n'
data += 'SED_PATTERN += -e \'' + m.cppPattern +'\'\n'
data += 'endif # ' + m.conditionalOn +'\n'
- for cpu in CPUsNeedingGenericIncksum:
- data += 'ifeq ($(RTEMS_CPU), ' + cpu + ')\n' \
- 'GENERATED_FILES += copied/rtemsbsd/' + cpu + '/' + cpu + '/in_cksum.c\n' \
- 'GENERATED_FILES += copied/rtemsbsd/' + cpu + '/include/freebsd/machine/in_cksum.h\n' \
- 'GENERATED_FILES += copied/rtemsbsd/' + cpu + '/' + cpu + '/in_cksum.c\n' \
- 'C_FILES += copied/rtemsbsd/' + cpu + '/' + cpu + '/in_cksum.c\n' \
- 'endif\n'
- for cpu in CPUsSharingPCICodeFromX86:
- data += 'ifeq ($(RTEMS_CPU), ' + cpu + ')\n' \
- 'GENERATED_FILES += copied/rtemsbsd/' + cpu + '/include/freebsd/machine/legacyvar.h\n' \
- 'GENERATED_FILES += copied/rtemsbsd/' + cpu + '/include/freebsd/machine/pci_cfgreg.h\n' \
- 'GENERATED_FILES += copied/freebsd/' + cpu + '/pci/pci_bus.c\n' \
- 'GENERATED_FILES += copied/freebsd/' + cpu + '/' + cpu + '/legacy.c\n' \
- 'C_FILES += copied/freebsd/' + cpu + '/pci/pci_bus.c\n' \
- 'C_FILES += copied/freebsd/' + cpu + '/' + cpu + '/legacy.c\n' \
- 'endif\n'
data += '\n' \
'ifeq ($(NEED_DUMMY_PIC_IRQ),yes)\n' \
'CFLAGS += -I rtems-dummy-pic-irq/include\n' \
'endif\n' \
- 'C_O_FILES = $(C_FILES:%.c=%.o)\n' \
- 'C_D_FILES = $(C_FILES:%.c=%.d)\n' \
+ 'LIB_O_FILES = $(LIB_C_FILES:%.c=%.o)\n' \
+ 'O_FILES += $(LIB_O_FILES)\n' \
+ 'D_FILES += $(LIB_C_FILES:%.c=%.d)\n' \
'\n' \
- 'LIB = libbsd.a\n' \
- '\n' \
- 'all: $(LIB) lib_user\n' \
+ 'all: $(LIB) $(TESTS)\n' \
'\n' \
- '$(LIB): $(GENERATED_FILES) $(C_O_FILES)\n' \
+ '$(LIB): $(LIB_GEN_FILES) $(LIB_O_FILES)\n' \
'\t$(AR) rcu $@ $^\n' \
+ 'run_tests: $(RUN_TESTS)\n' \
+ '\t$(TEST_RUNNER) $^\n' \
+ '\tcheck_endof\n' \
'\n' \
- 'lib_user: $(LIB) install_bsd\n' \
- '\t$(MAKE) -C freebsd-userspace\n' \
+ '# The following targets use the MIPS Generic in_cksum routine\n' \
+ 'rtemsbsd/include/machine/rtems-bsd-config.h: rtemsbsd/include/machine/rtems-bsd-config.h.in\n' \
+ '\tsed $(SED_PATTERN) <$< >$@\n' \
'\n' \
- '# The following targets use the MIPS Generic in_cksum routine\n'
- data += 'rtemsbsd/freebsd/machine/rtems-bsd-config.h: rtemsbsd/freebsd/machine/rtems-bsd-config.h.in\n'
- data += '\tsed $(SED_PATTERN) <$< >$@\n'
- data += '\n'
- for cpu in CPUsNeedingGenericIncksum:
- dDir = 'copied/rtemsbsd/' + cpu + '/' + cpu + '/'
- sDir = 'freebsd/mips/mips/'
- data += dDir + 'in_cksum.c: ' + sDir + 'in_cksum.c\n' \
- '\ttest -d ' + dDir + ' || mkdir -p ' + dDir + '\n' \
- '\tcp $< $@\n' \
- '\n'
- dDir = 'copied/rtemsbsd/' + cpu + '/include/freebsd/machine/'
- sDir = 'freebsd/mips/include/freebsd/machine/'
- data += dDir + 'in_cksum.h: ' + sDir + 'in_cksum.h\n' \
- '\ttest -d ' + dDir + ' || mkdir -p ' + dDir + '\n' \
- '\tcp $< $@\n' \
- '\n' \
-
- for cpu in CPUsSharingPCICodeFromX86:
- dDir = 'copied/rtemsbsd/' + cpu + '/include/freebsd/machine/'
- sDir = 'freebsd/i386/include/freebsd/machine/'
- data += dDir + 'legacyvar.h: ' + sDir + 'legacyvar.h\n' \
- '\ttest -d ' + dDir + ' || mkdir -p ' + dDir + '\n' \
- '\tcp $< $@\n' \
- '\n' + \
- dDir + 'pci_cfgreg.h: ' + sDir + 'pci_cfgreg.h\n' \
- '\ttest -d ' + dDir + ' || mkdir -p ' + dDir + '\n' \
- '\tcp $< $@\n' \
- '\n'
- dDir = 'copied/freebsd/' + cpu + '/pci/'
- sDir = 'freebsd/i386/pci/'
- data += dDir + 'pci_bus.c: ' + sDir + 'pci_bus.c\n' \
- '\ttest -d ' + dDir + ' || mkdir -p ' + dDir + '\n' \
- '\tcp $< $@\n' \
- '\n'
- dDir = 'copied/freebsd/' + cpu + '/' + cpu + '/'
- sDir = 'freebsd/i386/i386/'
- data += dDir + 'legacy.c: ' + sDir + 'legacy.c\n' \
- '\ttest -d ' + dDir + ' || mkdir -p ' + dDir + '\n' \
- '\tcp $< $@\n' \
- '\n'
-
- data += 'CPU_SED = sed\n' \
+ 'CPU_SED = sed\n' \
'CPU_SED += -e \'/arm/d\'\n' \
'CPU_SED += -e \'/i386/d\'\n' \
'CPU_SED += -e \'/powerpc/d\'\n' \
'CPU_SED += -e \'/mips/d\'\n' \
'CPU_SED += -e \'/sparc64/d\'\n' \
'\n' \
- 'install: $(LIB) install_bsd lib_user install_user\n' \
- '\n' \
- 'install_bsd: $(LIB)\n' \
+ 'install: $(LIB)\n' \
'\tinstall -d $(INSTALL_BASE)/include\n' \
'\tinstall -c -m 644 $(LIB) $(INSTALL_BASE)\n' \
'\tcd rtemsbsd; for i in `find freebsd -name \'*.h\'` ; do \\\n' \
@@ -507,17 +482,11 @@ class ModuleManager:
'\t-cd copied/rtemsbsd/$(RTEMS_CPU)/include && for i in `find . -name \'*.h\'` ; do \\\n' \
'\t install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done\n' \
'\n' \
- 'install_user:\n' \
- '\t$(MAKE) -C freebsd-userspace install\n' \
- '\n' \
'clean:\n' \
- '\trm -f -r $(PROJECT_INCLUDE)/rtems/freebsd\n' \
- '\trm -f $(LIB) $(C_O_FILES) $(C_D_FILES) $(GENERATED_FILES)\n' \
+ '\trm -f $(LIB_GEN_FILES) $(LIB) $(TESTS) $(O_FILES) $(D_FILES)\n' \
'\trm -f libbsd.html\n' \
- '\trm -rf copied\n' \
- '\t$(MAKE) -C freebsd-userspace clean\n' \
'\n' \
- '-include $(C_D_FILES)\n' \
+ '-include $(D_FILES)\n' \
'\n' \
'doc: libbsd.html\n' \
'\n' \
@@ -548,57 +517,73 @@ class Module:
self.name = name
self.conditionalOn = "none"
self.cppPattern = "s///"
- self.headerFiles = []
- self.sourceFiles = []
+ self.files = []
self.cpuDependentSourceFiles = {}
self.dependencies = []
+ def initCPUDependencies(self, cpu):
+ if not self.cpuDependentSourceFiles.has_key(cpu):
+ self.cpuDependentSourceFiles [cpu] = []
+
def copyFromFreeBSDToRTEMS(self):
- for file in self.headerFiles:
- file.copyFromFreeBSDToRTEMS()
- for file in self.sourceFiles:
- file.copyFromFreeBSDToRTEMS()
+ for f in self.files:
+ f.copyFromFreeBSDToRTEMS()
for cpu, files in self.cpuDependentSourceFiles.items():
- for file in files:
- file.copyFromFreeBSDToRTEMS()
+ for f in files:
+ f.copyFromFreeBSDToRTEMS()
def copyFromRTEMSToFreeBSD(self):
- for file in self.headerFiles:
- file.copyFromRTEMSToFreeBSD()
- for file in self.sourceFiles:
- file.copyFromRTEMSToFreeBSD()
+ for f in self.files:
+ f.copyFromRTEMSToFreeBSD()
for cpu, files in self.cpuDependentSourceFiles.items():
- for file in files:
- file.copyFromRTEMSToFreeBSD()
+ for f in files:
+ f.copyFromRTEMSToFreeBSD()
- def addFiles(self, currentFiles, newFiles, pathComposer, fromFreeBSDToRTEMSConverter, fromRTEMSToFreeBSDConverter, assertFile):
- for file in newFiles:
- assertFile(file)
- currentFiles.append(File(file, pathComposer, fromFreeBSDToRTEMSConverter, fromRTEMSToFreeBSDConverter))
+ def addFiles(self, currentFiles, newFiles, pathComposer, fromFreeBSDToRTEMSConverter, fromRTEMSToFreeBSDConverter, assertFile, makefileFragmentComposer = MakefileFragmentComposer()):
+ for newFile in newFiles:
+ assertFile(newFile)
+ currentFiles.append(File(newFile, pathComposer, fromFreeBSDToRTEMSConverter, fromRTEMSToFreeBSDConverter, makefileFragmentComposer))
return currentFiles
+ def addFile(self, f):
+ self.files.append(f)
+
def addHeaderFiles(self, files):
- self.headerFiles = self.addFiles(self.headerFiles, files, PathComposer(), FromFreeBSDToRTEMSHeaderConverter(), FromRTEMSToFreeBSDHeaderConverter(), assertHeaderFile)
+ self.files = self.addFiles(self.files, files, PathComposer(), FromFreeBSDToRTEMSHeaderConverter(), FromRTEMSToFreeBSDHeaderConverter(), assertHeaderFile)
- def addEmptyHeaderFiles(self, files):
- self.headerFiles = self.addFiles(self.headerFiles, files, PathComposer(), EmptyConverter(), NoConverter(), assertHeaderFile)
+ def addUserSpaceHeaderFiles(self, files):
+ self.files = self.addFiles(self.files, files, PathComposer(), FromFreeBSDToRTEMSUserSpaceHeaderConverter(), FromRTEMSToFreeBSDHeaderConverter(), assertHeaderFile)
def addRTEMSHeaderFiles(self, files):
- self.headerFiles = self.addFiles(self.headerFiles, files, RTEMSPathComposer(), NoConverter(), NoConverter(), assertHeaderFile)
+ self.files = self.addFiles(self.files, files, RTEMSPathComposer(), NoConverter(), NoConverter(), assertHeaderFile)
def addCPUDependentHeaderFiles(self, files):
- self.headerFiles = self.addFiles(self.headerFiles, files, CPUDependentPathComposer(), FromFreeBSDToRTEMSHeaderConverter(), FromRTEMSToFreeBSDHeaderConverter(), assertHeaderFile)
+ self.files = self.addFiles(self.files, files, CPUDependentPathComposer(), FromFreeBSDToRTEMSHeaderConverter(), FromRTEMSToFreeBSDHeaderConverter(), assertHeaderFile)
+
+ def addTargetSourceCPUDependentHeaderFiles(self, targetCPUs, sourceCPU, files):
+ for cpu in targetCPUs:
+ self.files = self.addFiles(self.files, files, TargetSourceCPUDependentPathComposer(cpu, sourceCPU), FromFreeBSDToRTEMSHeaderConverter(), NoConverter(), assertHeaderFile)
def addSourceFiles(self, files):
- self.sourceFiles = self.addFiles(self.sourceFiles, files, PathComposer(), FromFreeBSDToRTEMSSourceConverter(), FromRTEMSToFreeBSDSourceConverter(), assertSourceFile)
+ self.files = self.addFiles(self.files, files, PathComposer(), FromFreeBSDToRTEMSSourceConverter(), FromRTEMSToFreeBSDSourceConverter(), assertSourceFile, SourceFileMakefileFragmentComposer())
+
+ def addUserSpaceSourceFiles(self, files):
+ self.files = self.addFiles(self.files, files, PathComposer(), FromFreeBSDToRTEMSUserSpaceSourceConverter(), FromRTEMSToFreeBSDSourceConverter(), assertSourceFile, SourceFileMakefileFragmentComposer())
def addRTEMSSourceFiles(self, files):
- self.sourceFiles = self.addFiles(self.sourceFiles, files, RTEMSPathComposer(), NoConverter(), NoConverter(), assertSourceFile)
+ self.files = self.addFiles(self.files, files, RTEMSPathComposer(), NoConverter(), NoConverter(), assertSourceFile, SourceFileMakefileFragmentComposer())
def addCPUDependentSourceFiles(self, cpu, files):
- if not self.cpuDependentSourceFiles.has_key(cpu):
- self.cpuDependentSourceFiles [cpu] = []
- self.cpuDependentSourceFiles [cpu] = self.addFiles(self.cpuDependentSourceFiles [cpu], files, CPUDependentPathComposer(), FromFreeBSDToRTEMSSourceConverter(), FromRTEMSToFreeBSDSourceConverter(), assertSourceFile)
+ self.initCPUDependencies(cpu)
+ self.cpuDependentSourceFiles [cpu] = self.addFiles(self.cpuDependentSourceFiles [cpu], files, CPUDependentPathComposer(), FromFreeBSDToRTEMSSourceConverter(), FromRTEMSToFreeBSDSourceConverter(), assertSourceFile, SourceFileMakefileFragmentComposer())
+
+ def addTargetSourceCPUDependentSourceFiles(self, targetCPUs, sourceCPU, files):
+ for cpu in targetCPUs:
+ self.initCPUDependencies(cpu)
+ self.cpuDependentSourceFiles [cpu] = self.addFiles(self.cpuDependentSourceFiles [cpu], files, TargetSourceCPUDependentPathComposer(cpu, sourceCPU), FromFreeBSDToRTEMSSourceConverter(), NoConverter(), assertSourceFile, SourceFileMakefileFragmentComposer())
+
+ def addTest(self, testName, fileFragments, runTest = True):
+ self.files.append(File(testName, PathComposer(), NoConverter(), NoConverter(), TestMakefileFragementComposer(testName, fileFragments, runTest)))
def addDependency(self, dep):
self.dependencies.append(dep)
@@ -608,300 +593,303 @@ class Module:
mm = ModuleManager()
rtems = Module('rtems')
-rtems.addRTEMSHeaderFiles(
- [
- 'rtems/machine/atomic.h',
- 'rtems/machine/_bus.h',
- 'rtems/machine/bus.h',
- 'rtems/machine/bus_dma.h',
- 'rtems/machine/rtems-bsd-config.h',
- 'rtems/machine/clock.h',
- 'rtems/machine/endian.h',
- 'rtems/macpue/_limits.h',
- 'rtems/machine/_align.h',
- 'rtems/machine/mutex.h',
- 'rtems/machine/param.h',
- 'rtems/machine/pcpu.h',
- 'rtems/machine/pmap.h',
- 'rtems/machine/proc.h',
- 'rtems/machine/resource.h',
- 'rtems/machine/runq.h',
- 'rtems/machine/signal.h',
- 'rtems/machine/stdarg.h',
- 'rtems/machine/_stdint.h',
- 'rtems/machine/_types.h',
- 'rtems/machine/ucontext.h',
- 'rtems/machine/cpu.h',
- 'rtems/machine/rtems-bsd-symbols.h',
- 'rtems/machine/rtems-bsd-cache.h',
- 'rtems/machine/rtems-bsd-sysinit.h',
- 'rtems/machine/rtems-bsd-select.h',
- 'rtems/machine/rtems-bsd-taskqueue.h',
- 'rtems/machine/rtems-bsd-bus-dma.h',
- 'rtems/machine/rtems-bsd-bus-devicet.h',
- 'bsd.h',
- ]
-)
rtems.addRTEMSSourceFiles(
[
- 'dev/usb/controller/ohci_lpc24xx.c',
- 'dev/usb/controller/ohci_lpc32xx.c',
- 'dev/usb/controller/ehci_mpc83xx.c',
- 'src/rtems-bsd-thread0-ucred.c',
- 'src/rtems-bsd-cam.c',
- 'src/rtems-bsd-nexus.c',
- 'src/rtems-bsd-autoconf.c',
- 'src/rtems-bsd-delay.c',
- 'src/rtems-bsd-mutex.c',
- 'src/rtems-bsd-thread.c',
- 'src/rtems-bsd-condvar.c',
- 'src/rtems-bsd-lock.c',
- 'src/rtems-bsd-log.c',
- 'src/rtems-bsd-sx.c',
- 'src/rtems-bsd-rwlock.c',
- #'src/rtems-bsd-generic.c',
- 'src/rtems-bsd-page.c',
- 'src/rtems-bsd-panic.c',
- 'src/rtems-bsd-synch.c',
- 'src/rtems-bsd-signal.c',
- 'src/rtems-bsd-init.c',
- 'src/rtems-bsd-init-with-irq.c',
- 'src/rtems-bsd-assert.c',
- 'src/rtems-bsd-jail.c',
- 'src/rtems-bsd-shell.c',
- 'src/rtems-bsd-syscalls.c',
- 'src/rtems-bsd-smp.c',
- #'src/rtems-bsd-socket.c',
- #'src/rtems-bsd-mbuf.c',
- 'src/rtems-bsd-malloc.c',
- 'src/rtems-bsd-support.c',
- 'src/rtems-bsd-bus-dma.c',
- 'src/rtems-bsd-bus-dma-mbuf.c',
- 'src/rtems-bsd-sysctl.c',
- 'src/rtems-bsd-sysctlbyname.c',
- 'src/rtems-bsd-sysctlnametomib.c',
- 'src/rtems-bsd-taskqueue.c',
- 'src/rtems-bsd-timesupport.c',
- 'src/rtems-bsd-newproc.c',
- 'src/rtems-bsd-vm_glue.c',
- 'src/rtems-bsd-copyinout.c',
- 'src/rtems-bsd-descrip.c',
- 'src/rtems-bsd-conf.c',
- 'src/rtems-bsd-subr_param.c',
- 'src/rtems-bsd-pci_cfgreg.c',
- 'src/rtems-bsd-pci_bus.c',
- ]
-)
-rtems.addEmptyHeaderFiles(
- [
- 'cam/cam_queue.h',
- 'ddb/db_sym.h',
- 'ddb/ddb.h',
- 'machine/elf.h',
- 'machine/sf_buf.h',
- 'machine/smp.h',
- 'machine/vm.h',
- #'machine/vmparam.h',
- 'local/linker_if.h',
- 'local/opt_bce.h',
- 'local/opt_ntp.h',
- 'security/audit/audit.h',
- 'sys/bio.h',
- 'sys/copyright.h',
- 'sys/cpuset.h',
- 'sys/exec.h',
- 'sys/fail.h',
- #'sys/limits.h',
- 'sys/sleepqueue.h',
- 'sys/namei.h',
- 'sys/_pthreadtypes.h',
- #'sys/resourcevar.h',
- 'sys/sched.h',
- #'sys/select.h',
- 'sys/syscallsubr.h',
- 'sys/sysent.h',
- 'sys/syslimits.h',
- 'sys/sysproto.h',
- 'sys/stat.h',
- 'sys/ucontext.h',
- #'sys/time.h',
- 'time.h',
- #'sys/timespec.h',
- 'sys/_timeval.h',
- #'sys/vmmeter.h',
- #'sys/vnode.h',
- 'vm/pmap.h',
- #'vm/uma_int.h',
- #'vm/uma_dbg.h',
- #'vm/vm_extern.h',
- 'vm/vm_map.h',
- #'vm/vm_object.h',
- #'vm/vm_page.h',
- 'vm/vm_param.h',
- #'vm/vm_kern.h',
- 'geom/geom_disk.h',
- #'sys/kdb.h',
- #'libkern/jenkins.h',
- 'machine/pcb.h',
- #'net80211/ieee80211_freebsd.h',
- 'netgraph/ng_ipfw.h',
- #'sys/sf_buf.h',
- ]
-)
-
-local = Module('local')
-# RTEMS has its own local/pmap.h
-local.addHeaderFiles(
- [
- 'local/bus_if.h',
- 'local/device_if.h',
- 'local/opt_bus.h',
- 'local/opt_cam.h',
- 'local/opt_compat.h',
- 'local/opt_ddb.h',
- 'local/opt_hwpmc_hooks.h',
- 'local/opt_init_path.h',
- 'local/opt_ktrace.h',
- 'local/opt_printf.h',
- 'local/opt_scsi.h',
- 'local/opt_usb.h',
- 'local/opt_inet.h',
- 'local/opt_inet6.h',
- 'local/opt_altq.h',
- 'local/opt_atalk.h',
- 'local/opt_bootp.h',
- 'local/opt_bpf.h',
- 'local/opt_bus.h',
- 'local/opt_cam.h',
- 'local/opt_carp.h',
- 'local/opt_compat.h',
- 'local/opt_config.h',
- 'local/opt_cpu.h',
- 'local/opt_ddb.h',
- 'local/opt_device_polling.h',
- 'local/opt_ef.h',
- 'local/opt_enc.h',
- 'local/opt_hwpmc_hooks.h',
- 'local/opt_inet6.h',
- 'local/opt_inet.h',
- 'local/opt_init_path.h',
- 'local/opt_ipdivert.h',
- 'local/opt_ipdn.h',
- 'local/opt_ipfw.h',
- 'local/opt_ipsec.h',
- 'local/opt_ipstealth.h',
- 'local/opt_ipx.h',
- 'local/opt_kdb.h',
- 'local/opt_kdtrace.h',
- 'local/opt_ktrace.h',
- 'local/opt_mbuf_profiling.h',
- 'local/opt_mbuf_stress_test.h',
- 'local/opt_mpath.h',
- 'local/opt_mrouting.h',
- 'local/opt_natm.h',
- 'local/opt_netgraph.h',
- 'local/opt_param.h',
- 'local/opt_posix.h',
- 'local/opt_pf.h',
- 'local/opt_printf.h',
- 'local/opt_route.h',
- 'local/opt_scsi.h',
- 'local/opt_sctp.h',
- 'local/opt_tcpdebug.h',
- 'local/opt_tdma.h',
- 'local/opt_usb.h',
- 'local/opt_vlan.h',
- 'local/opt_wlan.h',
- 'local/opt_zero.h',
- 'local/usbdevs_data.h',
- 'local/usbdevs.h',
- 'local/usb_if.h',
- 'local/vnode_if.h',
- 'local/vnode_if_newproto.h',
- 'local/vnode_if_typedef.h',
- 'local/cryptodev_if.h',
- 'local/miibus_if.h',
- 'local/miidevs.h',
- 'local/pci_if.h',
- 'local/pcib_if.h',
- ]
-)
-local.addSourceFiles(
- [
- 'local/usb_if.c',
'local/bus_if.c',
- 'local/device_if.c',
'local/cryptodev_if.c',
+ 'local/device_if.c',
'local/miibus_if.c',
- 'local/pci_if.c',
'local/pcib_if.c',
+ 'local/pci_if.c',
+ 'local/usb_if.c',
+ 'rtems/ipsec_get_policylen.c',
+ 'rtems/rtems-bsd-assert.c',
+ 'rtems/rtems-bsd-autoconf.c',
+ 'rtems/rtems-bsd-bus-dma.c',
+ 'rtems/rtems-bsd-bus-dma-mbuf.c',
+ 'rtems/rtems-bsd-cam.c',
+ 'rtems/rtems-bsd-condvar.c',
+ 'rtems/rtems-bsd-conf.c',
+ 'rtems/rtems-bsd-copyinout.c',
+ 'rtems/rtems-bsd-delay.c',
+ 'rtems/rtems-bsd-descrip.c',
+ 'rtems/rtems-bsd-init.c',
+ 'rtems/rtems-bsd-init-with-irq.c',
+ 'rtems/rtems-bsd-jail.c',
+ 'rtems/rtems-bsd-lock.c',
+ 'rtems/rtems-bsd-log.c',
+ 'rtems/rtems-bsd-malloc.c',
+ 'rtems/rtems-bsd-mutex.c',
+ 'rtems/rtems-bsd-newproc.c',
+ 'rtems/rtems-bsd-nexus.c',
+ 'rtems/rtems-bsd-page.c',
+ 'rtems/rtems-bsd-panic.c',
+ 'rtems/rtems-bsd-pci_bus.c',
+ 'rtems/rtems-bsd-pci_cfgreg.c',
+ 'rtems/rtems-bsd-rwlock.c',
+ 'rtems/rtems-bsd-shell.c',
+ 'rtems/rtems-bsd-signal.c',
+ 'rtems/rtems-bsd-smp.c',
+ 'rtems/rtems-bsd-subr_param.c',
+ 'rtems/rtems-bsd-support.c',
+ 'rtems/rtems-bsd-sx.c',
+ 'rtems/rtems-bsd-synch.c',
+ 'rtems/rtems-bsd-syscall-api.c',
+ 'rtems/rtems-bsd-syscalls.c',
+ 'rtems/rtems-bsd-sysctlbyname.c',
+ 'rtems/rtems-bsd-sysctl.c',
+ 'rtems/rtems-bsd-sysctlnametomib.c',
+ 'rtems/rtems-bsd-taskqueue.c',
+ 'rtems/rtems-bsd-thread0-ucred.c',
+ 'rtems/rtems-bsd-thread.c',
+ 'rtems/rtems-bsd-timesupport.c',
+ 'rtems/rtems-bsd-vm_glue.c',
+ 'rtems/rtems-getprogname.c',
+ 'rtems/rtems-kvm.c',
+ 'rtems/rtems-net-setup.c',
+ 'rtems/rtems-shell.c',
+ 'rtems/rtems-syslog-initialize.c',
+ 'rtems/rtems-syspoll.c',
+ 'rtems/rtems-uthread_kevent.c',
+ 'rtems/rtems-uthread_kqueue.c',
+ 'rtems/syslog.c',
+ 'sys/dev/usb/controller/ehci_mpc83xx.c',
+ 'sys/dev/usb/controller/ohci_lpc24xx.c',
+ 'sys/dev/usb/controller/ohci_lpc32xx.c',
+ ]
+)
+
+class KVMSymbolsMakefileFragmentComposer(MakefileFragmentComposer):
+ def compose(self, path):
+ return 'LIB_GEN_FILES += ' + path + '\n' \
+ 'LIB_C_FILES += ' + path + '\n' \
+ + path + ': rtemsbsd/rtems/generate_kvm_symbols\n' \
+ '\t./$< > $@\n'
+
+rtems.addFile(File('rtems/rtems-kvm-symbols.c', RTEMSPathComposer(), NoConverter(), NoConverter(), KVMSymbolsMakefileFragmentComposer()))
+
+base = Module('base')
+base.addHeaderFiles(
+ [
+ 'sys/bsm/audit.h',
+ 'sys/bsm/audit_kevents.h',
+ 'sys/fs/devfs/devfs_int.h',
+ 'sys/security/mac/mac_framework.h',
+ 'sys/sys/acl.h',
+ 'sys/sys/aio.h',
+ 'sys/sys/bitstring.h',
+ 'sys/sys/bufobj.h',
+ 'sys/sys/buf_ring.h',
+ 'sys/sys/_bus_dma.h',
+ 'sys/sys/bus_dma.h',
+ 'sys/sys/bus.h',
+ 'sys/sys/callout.h',
+ 'sys/sys/condvar.h',
+ 'sys/sys/conf.h',
+ 'sys/sys/cpu.h',
+ 'sys/sys/ctype.h',
+ 'sys/sys/domain.h',
+ 'sys/sys/endian.h',
+ 'sys/sys/event.h',
+ 'sys/sys/eventhandler.h',
+ 'sys/sys/fcntl.h',
+ 'sys/sys/filedesc.h',
+ 'sys/sys/file.h',
+ 'sys/sys/filio.h',
+ 'sys/sys/fnv_hash.h',
+ 'sys/sys/hash.h',
+ 'sys/sys/interrupt.h',
+ 'sys/sys/jail.h',
+ 'sys/sys/kernel.h',
+ 'sys/sys/kobj.h',
+ 'sys/sys/kthread.h',
+ 'sys/sys/ktr.h',
+ 'sys/sys/libkern.h',
+ 'sys/sys/limits.h',
+ 'sys/sys/linker.h',
+ 'sys/sys/linker_set.h',
+ 'sys/sys/_lock.h',
+ 'sys/sys/_lockmgr.h',
+ 'sys/sys/lockmgr.h',
+ 'sys/sys/lock_profile.h',
+ 'sys/sys/lockstat.h',
+ 'sys/sys/mac.h',
+ 'sys/sys/malloc.h',
+ 'sys/sys/mbuf.h',
+ 'sys/sys/module.h',
+ 'sys/sys/mount.h',
+ 'sys/sys/_mutex.h',
+ 'sys/sys/mutex.h',
+ 'sys/sys/_null.h',
+ 'sys/sys/osd.h',
+ 'sys/sys/pcpu.h',
+ 'sys/sys/poll.h',
+ 'sys/sys/priority.h',
+ 'sys/sys/priv.h',
+ 'sys/sys/proc.h',
+ 'sys/sys/protosw.h',
+ 'sys/sys/queue.h',
+ 'sys/sys/random.h',
+ 'sys/sys/reboot.h',
+ 'sys/sys/refcount.h',
+ 'sys/sys/resourcevar.h',
+ 'sys/sys/rman.h',
+ 'sys/sys/_rmlock.h',
+ 'sys/sys/rmlock.h',
+ 'sys/sys/rtprio.h',
+ 'sys/sys/runq.h',
+ 'sys/sys/_rwlock.h',
+ 'sys/sys/rwlock.h',
+ 'sys/sys/sbuf.h',
+ 'sys/sys/sdt.h',
+ 'sys/sys/select.h',
+ 'sys/sys/selinfo.h',
+ 'sys/sys/_semaphore.h',
+ 'sys/sys/sf_buf.h',
+ 'sys/sys/sigio.h',
+ 'sys/sys/_sigset.h',
+ 'sys/sys/smp.h',
+ 'sys/sys/sockbuf.h',
+ 'sys/sys/socket.h',
+ 'sys/sys/socketvar.h',
+ 'sys/sys/sockio.h',
+ 'sys/sys/sockopt.h',
+ 'sys/sys/sockstate.h',
+ 'sys/sys/stddef.h',
+ 'sys/sys/stdint.h',
+ 'sys/sys/_sx.h',
+ 'sys/sys/sx.h',
+ 'sys/sys/sysctl.h',
+ 'sys/sys/syslog.h',
+ 'sys/sys/systm.h',
+ 'sys/sys/_task.h',
+ 'sys/sys/taskqueue.h',
+ 'sys/sys/nlist_aout.h',
+ 'sys/rpc/types.h',
+ 'sys/sys/timepps.h',
+ 'sys/sys/timetc.h',
+ 'sys/sys/_timeval.h',
+ 'sys/sys/timex.h',
+ 'sys/sys/tree.h',
+ 'sys/sys/ttycom.h',
+ 'sys/sys/ucred.h',
+ 'sys/sys/un.h',
+ 'sys/sys/vmmeter.h',
+ 'sys/vm/uma_dbg.h',
+ 'sys/vm/uma.h',
+ 'sys/vm/uma_int.h',
+ 'sys/vm/vm.h',
+ ]
+)
+base.addSourceFiles(
+ [
+ 'sys/kern/init_main.c',
+ 'sys/kern/kern_descrip.c',
+ 'sys/kern/kern_environment.c',
+ 'sys/kern/kern_event.c',
+ 'sys/kern/kern_intr.c',
+ 'sys/kern/kern_linker.c',
+ 'sys/kern/kern_mbuf.c',
+ 'sys/kern/kern_mib.c',
+ 'sys/kern/kern_module.c',
+ 'sys/kern/kern_mtxpool.c',
+ 'sys/kern/kern_ntptime.c',
+ 'sys/kern/kern_proc.c',
+ 'sys/kern/kern_prot.c',
+ 'sys/kern/kern_resource.c',
+ 'sys/kern/kern_subr.c',
+ 'sys/kern/kern_sysctl.c',
+ 'sys/kern/kern_tc.c',
+ 'sys/kern/kern_time.c',
+ 'sys/kern/kern_timeout.c',
+ 'sys/kern/subr_bufring.c',
+ 'sys/kern/subr_bus.c',
+ 'sys/kern/subr_eventhandler.c',
+ 'sys/kern/subr_hints.c',
+ 'sys/kern/subr_kobj.c',
+ 'sys/kern/subr_module.c',
+ 'sys/kern/subr_rman.c',
+ 'sys/kern/subr_sbuf.c',
+ 'sys/kern/subr_unit.c',
+ 'sys/kern/sys_generic.c',
+ 'sys/kern/uipc_accf.c',
+ 'sys/kern/uipc_domain.c',
+ 'sys/kern/uipc_mbuf2.c',
+ 'sys/kern/uipc_mbuf.c',
+ 'sys/kern/uipc_sockbuf.c',
+ 'sys/kern/uipc_socket.c',
+ 'sys/libkern/arc4random.c',
+ 'sys/libkern/fls.c',
+ 'sys/libkern/inet_ntoa.c',
+ 'sys/libkern/random.c',
+ 'sys/vm/uma_core.c',
]
)
devUsb = Module('dev_usb')
devUsb.addHeaderFiles(
[
- 'dev/usb/ufm_ioctl.h',
- 'dev/usb/usb_busdma.h',
- 'dev/usb/usb_bus.h',
- 'dev/usb/usb_cdc.h',
- 'dev/usb/usb_controller.h',
- 'dev/usb/usb_core.h',
- 'dev/usb/usb_debug.h',
- 'dev/usb/usb_dev.h',
- 'dev/usb/usb_device.h',
- 'dev/usb/usbdi.h',
- 'dev/usb/usbdi_util.h',
- 'dev/usb/usb_dynamic.h',
- 'dev/usb/usb_endian.h',
- 'dev/usb/usb_freebsd.h',
- 'dev/usb/usb_generic.h',
- 'dev/usb/usb.h',
- 'dev/usb/usbhid.h',
- 'dev/usb/usb_hub.h',
- 'dev/usb/usb_ioctl.h',
- 'dev/usb/usb_mbuf.h',
- 'dev/usb/usb_msctest.h',
- 'dev/usb/usb_process.h',
- 'dev/usb/usb_request.h',
- 'dev/usb/usb_transfer.h',
- 'dev/usb/usb_util.h',
+ 'sys/dev/usb/ufm_ioctl.h',
+ 'sys/dev/usb/usb_busdma.h',
+ 'sys/dev/usb/usb_bus.h',
+ 'sys/dev/usb/usb_cdc.h',
+ 'sys/dev/usb/usb_controller.h',
+ 'sys/dev/usb/usb_core.h',
+ 'sys/dev/usb/usb_debug.h',
+ 'sys/dev/usb/usb_dev.h',
+ 'sys/dev/usb/usb_device.h',
+ 'sys/dev/usb/usbdi.h',
+ 'sys/dev/usb/usbdi_util.h',
+ 'sys/dev/usb/usb_dynamic.h',
+ 'sys/dev/usb/usb_endian.h',
+ 'sys/dev/usb/usb_freebsd.h',
+ 'sys/dev/usb/usb_generic.h',
+ 'sys/dev/usb/usb.h',
+ 'sys/dev/usb/usbhid.h',
+ 'sys/dev/usb/usb_hub.h',
+ 'sys/dev/usb/usb_ioctl.h',
+ 'sys/dev/usb/usb_mbuf.h',
+ 'sys/dev/usb/usb_msctest.h',
+ 'sys/dev/usb/usb_process.h',
+ 'sys/dev/usb/usb_request.h',
+ 'sys/dev/usb/usb_transfer.h',
+ 'sys/dev/usb/usb_util.h',
]
)
devUsb.addSourceFiles(
[
- 'dev/usb/usb_busdma.c',
- 'dev/usb/usb_core.c',
- 'dev/usb/usb_debug.c',
- 'dev/usb/usb_dev.c',
- 'dev/usb/usb_device.c',
- 'dev/usb/usb_dynamic.c',
- 'dev/usb/usb_error.c',
- 'dev/usb/usb_generic.c',
- 'dev/usb/usb_handle_request.c',
- 'dev/usb/usb_hid.c',
- 'dev/usb/usb_hub.c',
- 'dev/usb/usb_lookup.c',
- 'dev/usb/usb_mbuf.c',
- 'dev/usb/usb_msctest.c',
- 'dev/usb/usb_parse.c',
- 'dev/usb/usb_process.c',
- 'dev/usb/usb_request.c',
- 'dev/usb/usb_transfer.c',
- 'dev/usb/usb_util.c',
+ 'sys/dev/usb/usb_busdma.c',
+ 'sys/dev/usb/usb_core.c',
+ 'sys/dev/usb/usb_debug.c',
+ 'sys/dev/usb/usb_dev.c',
+ 'sys/dev/usb/usb_device.c',
+ 'sys/dev/usb/usb_dynamic.c',
+ 'sys/dev/usb/usb_error.c',
+ 'sys/dev/usb/usb_generic.c',
+ 'sys/dev/usb/usb_handle_request.c',
+ 'sys/dev/usb/usb_hid.c',
+ 'sys/dev/usb/usb_hub.c',
+ 'sys/dev/usb/usb_lookup.c',
+ 'sys/dev/usb/usb_mbuf.c',
+ 'sys/dev/usb/usb_msctest.c',
+ 'sys/dev/usb/usb_parse.c',
+ 'sys/dev/usb/usb_process.c',
+ 'sys/dev/usb/usb_request.c',
+ 'sys/dev/usb/usb_transfer.c',
+ 'sys/dev/usb/usb_util.c',
]
)
devUsbAddOn = Module('dev_usb_add_on')
devUsbAddOn.addHeaderFiles(
[
- 'dev/usb/usb_pci.h',
- 'dev/usb/usb_compat_linux.h',
+ 'sys/dev/usb/usb_pci.h',
+ 'sys/dev/usb/usb_compat_linux.h',
]
)
devUsbAddOn.addSourceFiles(
[
- 'dev/usb/usb_compat_linux.c',
+ 'sys/dev/usb/usb_compat_linux.c',
]
)
@@ -909,13 +897,13 @@ devUsbBluetooth = Module('dev_usb_bluetooth')
devUsbBluetooth.addDependency(devUsb)
devUsbBluetooth.addHeaderFiles(
[
- 'dev/usb/bluetooth/ng_ubt_var.h',
+ 'sys/dev/usb/bluetooth/ng_ubt_var.h',
]
)
devUsbBluetooth.addSourceFiles(
[
- 'dev/usb/bluetooth/ng_ubt.c',
- 'dev/usb/bluetooth/ubtbcmfw.c',
+ 'sys/dev/usb/bluetooth/ng_ubt.c',
+ 'sys/dev/usb/bluetooth/ubtbcmfw.c',
]
)
@@ -923,17 +911,17 @@ devUsbController = Module('dev_usb_controller')
devUsbController.addDependency(devUsb)
devUsbController.addHeaderFiles(
[
- 'dev/usb/controller/ohci.h',
- 'dev/usb/controller/ohcireg.h',
- 'dev/usb/controller/ehci.h',
- 'dev/usb/controller/ehcireg.h',
+ 'sys/dev/usb/controller/ohci.h',
+ 'sys/dev/usb/controller/ohcireg.h',
+ 'sys/dev/usb/controller/ehci.h',
+ 'sys/dev/usb/controller/ehcireg.h',
]
)
devUsbController.addSourceFiles(
[
- 'dev/usb/controller/ohci.c',
- 'dev/usb/controller/ehci.c',
- 'dev/usb/controller/usb_controller.c',
+ 'sys/dev/usb/controller/ohci.c',
+ 'sys/dev/usb/controller/ehci.c',
+ 'sys/dev/usb/controller/usb_controller.c',
]
)
@@ -941,28 +929,28 @@ devUsbControllerAddOn = Module('dev_usb_controller_add_on')
devUsbControllerAddOn.addDependency(devUsb)
devUsbControllerAddOn.addHeaderFiles(
[
- 'dev/usb/controller/at91dci.h',
- 'dev/usb/controller/atmegadci.h',
- 'dev/usb/controller/musb_otg.h',
- 'dev/usb/controller/uss820dci.h',
+ 'sys/dev/usb/controller/at91dci.h',
+ 'sys/dev/usb/controller/atmegadci.h',
+ 'sys/dev/usb/controller/musb_otg.h',
+ 'sys/dev/usb/controller/uss820dci.h',
]
)
devUsbControllerAddOn.addSourceFiles(
[
- 'dev/usb/controller/at91dci_atmelarm.c',
- 'dev/usb/controller/at91dci.c',
- 'dev/usb/controller/atmegadci_atmelarm.c',
- 'dev/usb/controller/atmegadci.c',
- 'dev/usb/controller/ehci_ixp4xx.c',
- 'dev/usb/controller/ehci_pci.c',
- 'dev/usb/controller/musb_otg.c',
- 'dev/usb/controller/ehci_mbus.c',
- 'dev/usb/controller/musb_otg_atmelarm.c',
- 'dev/usb/controller/ohci_atmelarm.c',
- 'dev/usb/controller/ohci_pci.c',
- 'dev/usb/controller/uhci_pci.c',
- 'dev/usb/controller/uss820dci_atmelarm.c',
- 'dev/usb/controller/uss820dci.c',
+ 'sys/dev/usb/controller/at91dci_atmelarm.c',
+ 'sys/dev/usb/controller/at91dci.c',
+ 'sys/dev/usb/controller/atmegadci_atmelarm.c',
+ 'sys/dev/usb/controller/atmegadci.c',
+ 'sys/dev/usb/controller/ehci_ixp4xx.c',
+ 'sys/dev/usb/controller/ehci_pci.c',
+ 'sys/dev/usb/controller/musb_otg.c',
+ 'sys/dev/usb/controller/ehci_mbus.c',
+ 'sys/dev/usb/controller/musb_otg_atmelarm.c',
+ 'sys/dev/usb/controller/ohci_atmelarm.c',
+ 'sys/dev/usb/controller/ohci_pci.c',
+ 'sys/dev/usb/controller/uhci_pci.c',
+ 'sys/dev/usb/controller/uss820dci_atmelarm.c',
+ 'sys/dev/usb/controller/uss820dci.c',
]
)
@@ -970,13 +958,13 @@ devUsbInput = Module('dev_usb_input')
devUsbInput.addDependency(devUsb)
devUsbInput.addHeaderFiles(
[
- 'dev/usb/input/usb_rdesc.h',
+ 'sys/dev/usb/input/usb_rdesc.h',
]
)
devUsbInput.addSourceFiles(
[
- 'dev/usb/input/uhid.c',
- 'dev/usb/input/ukbd.c',
+ 'sys/dev/usb/input/uhid.c',
+ 'sys/dev/usb/input/ukbd.c',
]
)
@@ -984,18 +972,18 @@ devUsbInputMouse = Module('dev_usb_mouse')
devUsbInputMouse.addDependency(devUsb)
devUsbInputMouse.addHeaderFiles(
[
- 'sys/tty.h',
- 'sys/mouse.h',
- 'sys/ttyqueue.h',
- 'sys/ttydefaults.h',
- 'sys/ttydisc.h',
- 'sys/ttydevsw.h',
- 'sys/ttyhook.h',
+ 'sys/sys/tty.h',
+ 'sys/sys/mouse.h',
+ 'sys/sys/ttyqueue.h',
+ 'sys/sys/ttydefaults.h',
+ 'sys/sys/ttydisc.h',
+ 'sys/sys/ttydevsw.h',
+ 'sys/sys/ttyhook.h',
]
)
devUsbInputMouse.addSourceFiles(
[
- 'dev/usb/input/ums.c',
+ 'sys/dev/usb/input/ums.c',
]
)
@@ -1003,13 +991,13 @@ devUsbMisc = Module('dev_usb_misc')
devUsbMisc.addDependency(devUsb)
devUsbMisc.addHeaderFiles(
[
- 'dev/usb/misc/udbp.h',
+ 'sys/dev/usb/misc/udbp.h',
]
)
devUsbMisc.addSourceFiles(
[
- 'dev/usb/misc/udbp.c',
- 'dev/usb/misc/ufm.c',
+ 'sys/dev/usb/misc/udbp.c',
+ 'sys/dev/usb/misc/ufm.c',
]
)
@@ -1017,25 +1005,16 @@ devUsbNet = Module('dev_usb_net')
devUsbNet.addDependency(devUsb)
devUsbNet.addHeaderFiles(
[
- 'dev/mii/mii.h',
- 'dev/mii/miivar.h',
- 'net/bpf.h',
- 'net/ethernet.h',
- 'net/if_arp.h',
- 'net/if_dl.h',
- 'net/if.h',
- 'net/if_media.h',
- 'net/if_types.h',
- 'net/if_var.h',
- 'net/vnet.h',
- 'dev/usb/net/if_cdcereg.h',
- 'dev/usb/net/usb_ethernet.h',
+ 'sys/dev/mii/mii.h',
+ 'sys/dev/mii/miivar.h',
+ 'sys/dev/usb/net/if_cdcereg.h',
+ 'sys/dev/usb/net/usb_ethernet.h',
]
)
devUsbNet.addSourceFiles(
[
- 'dev/usb/net/if_cdce.c',
- 'dev/usb/net/usb_ethernet.c',
+ 'sys/dev/usb/net/if_cdce.c',
+ 'sys/dev/usb/net/usb_ethernet.c',
]
)
@@ -1043,12 +1022,12 @@ devUsbQuirk = Module('dev_usb_quirk')
devUsbQuirk.addDependency(devUsb)
devUsbQuirk.addHeaderFiles(
[
- 'dev/usb/quirk/usb_quirk.h',
+ 'sys/dev/usb/quirk/usb_quirk.h',
]
)
devUsbQuirk.addSourceFiles(
[
- 'dev/usb/quirk/usb_quirk.c',
+ 'sys/dev/usb/quirk/usb_quirk.c',
]
)
@@ -1056,31 +1035,31 @@ devUsbSerial = Module('dev_usb_serial')
devUsbSerial.addDependency(devUsb)
devUsbSerial.addHeaderFiles(
[
- 'dev/usb/serial/uftdi_reg.h',
- 'dev/usb/serial/usb_serial.h',
+ 'sys/dev/usb/serial/uftdi_reg.h',
+ 'sys/dev/usb/serial/usb_serial.h',
]
)
devUsbSerial.addSourceFiles(
[
- 'dev/usb/serial/u3g.c',
- 'dev/usb/serial/uark.c',
- 'dev/usb/serial/ubsa.c',
- 'dev/usb/serial/ubser.c',
- 'dev/usb/serial/uchcom.c',
- 'dev/usb/serial/ucycom.c',
- 'dev/usb/serial/ufoma.c',
- 'dev/usb/serial/uftdi.c',
- 'dev/usb/serial/ugensa.c',
- 'dev/usb/serial/uipaq.c',
- 'dev/usb/serial/ulpt.c',
- 'dev/usb/serial/umct.c',
- 'dev/usb/serial/umodem.c',
- 'dev/usb/serial/umoscom.c',
- 'dev/usb/serial/uplcom.c',
- 'dev/usb/serial/usb_serial.c',
- 'dev/usb/serial/uslcom.c',
- 'dev/usb/serial/uvisor.c',
- 'dev/usb/serial/uvscom.c',
+ 'sys/dev/usb/serial/u3g.c',
+ 'sys/dev/usb/serial/uark.c',
+ 'sys/dev/usb/serial/ubsa.c',
+ 'sys/dev/usb/serial/ubser.c',
+ 'sys/dev/usb/serial/uchcom.c',
+ 'sys/dev/usb/serial/ucycom.c',
+ 'sys/dev/usb/serial/ufoma.c',
+ 'sys/dev/usb/serial/uftdi.c',
+ 'sys/dev/usb/serial/ugensa.c',
+ 'sys/dev/usb/serial/uipaq.c',
+ 'sys/dev/usb/serial/ulpt.c',
+ 'sys/dev/usb/serial/umct.c',
+ 'sys/dev/usb/serial/umodem.c',
+ 'sys/dev/usb/serial/umoscom.c',
+ 'sys/dev/usb/serial/uplcom.c',
+ 'sys/dev/usb/serial/usb_serial.c',
+ 'sys/dev/usb/serial/uslcom.c',
+ 'sys/dev/usb/serial/uvisor.c',
+ 'sys/dev/usb/serial/uvscom.c',
]
)
@@ -1088,7 +1067,7 @@ devUsbStorage = Module('dev_usb_storage')
devUsbStorage.addDependency(devUsb)
devUsbStorage.addSourceFiles(
[
- 'dev/usb/storage/umass.c',
+ 'sys/dev/usb/storage/umass.c',
]
)
@@ -1096,13 +1075,13 @@ devUsbStorageAddOn = Module('dev_usb_storage_add_on')
devUsbStorageAddOn.addDependency(devUsb)
devUsbStorageAddOn.addHeaderFiles(
[
- 'dev/usb/storage/rio500_usb.h',
+ 'sys/dev/usb/storage/rio500_usb.h',
]
)
devUsbStorageAddOn.addSourceFiles(
[
- 'dev/usb/storage/urio.c',
- 'dev/usb/storage/ustorage_fs.c',
+ 'sys/dev/usb/storage/urio.c',
+ 'sys/dev/usb/storage/ustorage_fs.c',
]
)
@@ -1110,15 +1089,15 @@ devUsbTemplate = Module('dev_usb_template')
devUsbTemplate.addDependency(devUsb)
devUsbTemplate.addHeaderFiles(
[
- 'dev/usb/template/usb_template.h',
+ 'sys/dev/usb/template/usb_template.h',
]
)
devUsbTemplate.addSourceFiles(
[
- 'dev/usb/template/usb_template.c',
- 'dev/usb/template/usb_template_cdce.c',
- 'dev/usb/template/usb_template_msc.c',
- 'dev/usb/template/usb_template_mtp.c',
+ 'sys/dev/usb/template/usb_template.c',
+ 'sys/dev/usb/template/usb_template_cdce.c',
+ 'sys/dev/usb/template/usb_template_msc.c',
+ 'sys/dev/usb/template/usb_template_mtp.c',
]
)
@@ -1126,201 +1105,76 @@ devUsbWlan = Module('dev_usb_wlan')
devUsbWlan.addDependency(devUsb)
devUsbWlan.addHeaderFiles(
[
- 'dev/usb/wlan/if_rumfw.h',
- 'dev/usb/wlan/if_rumreg.h',
- 'dev/usb/wlan/if_rumvar.h',
- 'dev/usb/wlan/if_uathreg.h',
- 'dev/usb/wlan/if_uathvar.h',
- 'dev/usb/wlan/if_upgtvar.h',
- 'dev/usb/wlan/if_uralreg.h',
- 'dev/usb/wlan/if_uralvar.h',
- 'dev/usb/wlan/if_zydfw.h',
- 'dev/usb/wlan/if_zydreg.h',
+ 'sys/dev/usb/wlan/if_rumfw.h',
+ 'sys/dev/usb/wlan/if_rumreg.h',
+ 'sys/dev/usb/wlan/if_rumvar.h',
+ 'sys/dev/usb/wlan/if_uathreg.h',
+ 'sys/dev/usb/wlan/if_uathvar.h',
+ 'sys/dev/usb/wlan/if_upgtvar.h',
+ 'sys/dev/usb/wlan/if_uralreg.h',
+ 'sys/dev/usb/wlan/if_uralvar.h',
+ 'sys/dev/usb/wlan/if_zydfw.h',
+ 'sys/dev/usb/wlan/if_zydreg.h',
]
)
devUsbWlan.addSourceFiles(
[
- 'dev/usb/wlan/if_rum.c',
- 'dev/usb/wlan/if_uath.c',
- 'dev/usb/wlan/if_upgt.c',
- 'dev/usb/wlan/if_ural.c',
- 'dev/usb/wlan/if_zyd.c',
- ]
-)
-
-devPci = Module('dev_pci')
-devPci.addHeaderFiles(
- [
- 'dev/pci/pcireg.h',
- 'dev/pci/pcivar.h',
- ]
-)
-
-devUsbBase = Module('dev_usb_base')
-devUsbBase.addHeaderFiles(
- [
- 'bsm/audit.h',
- 'bsm/audit_kevents.h',
- 'sys/acl.h',
- 'sys/bufobj.h',
- 'sys/_bus_dma.h',
- 'sys/bus_dma.h',
- 'sys/bus.h',
- 'sys/callout.h',
- 'sys/condvar.h',
- 'sys/conf.h',
- #'sys/cpuset.h',
- 'sys/ctype.h',
- 'sys/endian.h',
- 'sys/errno.h',
- 'sys/event.h',
- 'sys/eventhandler.h',
- 'sys/fcntl.h',
- 'sys/filedesc.h',
- 'sys/file.h',
- 'sys/filio.h',
- 'sys/ioccom.h',
- # FreeBSD version is in RTEMS since used by readv/writev
- # 'sys/_iovec.h',
- 'sys/kernel.h',
- 'sys/kobj.h',
- 'sys/kthread.h',
- 'sys/ktr.h',
- 'sys/libkern.h',
- 'sys/linker_set.h',
- 'sys/_lock.h',
- 'sys/lock.h',
- 'sys/_lockmgr.h',
- 'sys/lockmgr.h',
- 'sys/lock_profile.h',
- 'sys/lockstat.h',
- 'sys/mac.h',
- 'sys/malloc.h',
- 'sys/mbuf.h',
- 'sys/module.h',
- 'sys/mount.h',
- 'sys/_mutex.h',
- 'sys/mutex.h',
- 'sys/_null.h',
- 'sys/osd.h',
- 'sys/param.h',
- 'sys/pcpu.h',
- 'sys/poll.h',
- 'sys/priority.h',
- 'sys/priv.h',
- 'sys/proc.h',
- 'sys/queue.h',
- 'sys/refcount.h',
- 'sys/resource.h',
- 'sys/resourcevar.h',
- 'sys/rtprio.h',
- 'sys/runq.h',
- 'sys/_rwlock.h',
- 'sys/rwlock.h',
- 'sys/_semaphore.h',
- 'sys/selinfo.h',
- 'sys/sigio.h',
- 'sys/_sigset.h',
- #'sys/sleepqueue.h',
- 'sys/socket.h',
- 'sys/stddef.h',
- 'sys/stdint.h',
- 'sys/_sx.h',
- 'sys/sx.h',
- 'sys/sysctl.h',
- 'sys/systm.h',
- 'sys/ttycom.h',
- 'sys/_types.h',
- 'sys/types.h',
- 'sys/ucred.h',
- # FreeBSD version is in RTEMS since used by readv/writev
- # 'sys/uio.h',
- 'sys/aio.h',
- 'sys/unistd.h',
- 'sys/vmmeter.h',
- #'sys/vnode.h',
- 'sys/rman.h',
- 'sys/reboot.h',
- 'sys/bitstring.h',
- 'sys/linker.h',
- 'vm/uma.h',
- 'vm/uma_int.h',
- 'vm/uma_dbg.h',
- 'vm/vm.h',
- #'vm/vm_page.h',
- 'fs/devfs/devfs_int.h',
- ]
-)
-devUsbBase.addSourceFiles(
- [
- 'kern/init_main.c',
- 'kern/kern_linker.c',
- 'kern/kern_mib.c',
- 'kern/kern_timeout.c',
- 'kern/kern_mbuf.c',
- 'kern/kern_module.c',
- 'kern/kern_sysctl.c',
- 'kern/subr_bus.c',
- 'kern/subr_kobj.c',
- #'kern/subr_sleepqueue.c',
- 'kern/uipc_mbuf.c',
- 'kern/uipc_mbuf2.c',
- 'kern/uipc_socket.c',
- 'kern/uipc_sockbuf.c',
- 'kern/uipc_domain.c',
- #'kern/uipc_syscalls.c',
- 'vm/uma_core.c',
+ 'sys/dev/usb/wlan/if_rum.c',
+ 'sys/dev/usb/wlan/if_uath.c',
+ 'sys/dev/usb/wlan/if_upgt.c',
+ 'sys/dev/usb/wlan/if_ural.c',
+ 'sys/dev/usb/wlan/if_zyd.c',
]
)
cam = Module('cam')
cam.addHeaderFiles(
[
- 'sys/ata.h',
- 'cam/cam.h',
- 'cam/cam_ccb.h',
- 'cam/cam_sim.h',
- 'cam/cam_xpt_sim.h',
- 'cam/scsi/scsi_all.h',
- 'cam/scsi/scsi_da.h',
- 'cam/ata/ata_all.h',
- 'cam/cam_periph.h',
- 'cam/cam_debug.h',
- 'cam/cam_xpt.h',
+ 'sys/sys/ata.h',
+ 'sys/cam/cam.h',
+ 'sys/cam/cam_ccb.h',
+ 'sys/cam/cam_sim.h',
+ 'sys/cam/cam_xpt_sim.h',
+ 'sys/cam/scsi/scsi_all.h',
+ 'sys/cam/scsi/scsi_da.h',
+ 'sys/cam/ata/ata_all.h',
+ 'sys/cam/cam_periph.h',
+ 'sys/cam/cam_debug.h',
+ 'sys/cam/cam_xpt.h',
]
)
cam.addSourceFiles(
[
- 'cam/cam.c',
- 'cam/scsi/scsi_all.c',
+ 'sys/cam/cam.c',
+ 'sys/cam/scsi/scsi_all.c',
]
)
devNet = Module('dev_net')
devNet.addHeaderFiles(
[
- 'dev/mii/mii.h',
- 'dev/mii/miivar.h',
- 'dev/mii/brgphyreg.h',
- 'dev/mii/icsphyreg.h',
- 'dev/led/led.h',
- 'net/bpf.h',
- 'net/ethernet.h',
- 'net/if_arp.h',
- 'net/if_dl.h',
- 'net/if.h',
- 'net/if_media.h',
- 'net/if_types.h',
- 'net/if_var.h',
- 'net/vnet.h',
+ 'sys/dev/mii/mii.h',
+ 'sys/dev/mii/miivar.h',
+ 'sys/dev/mii/brgphyreg.h',
+ 'sys/dev/mii/icsphyreg.h',
+ 'sys/dev/led/led.h',
+ 'sys/net/bpf.h',
+ 'sys/net/ethernet.h',
+ 'sys/net/if_arp.h',
+ 'sys/net/if_dl.h',
+ 'sys/net/if.h',
+ 'sys/net/if_media.h',
+ 'sys/net/if_types.h',
+ 'sys/net/if_var.h',
+ 'sys/net/vnet.h',
]
)
devNet.addSourceFiles(
[
- 'dev/mii/mii.c',
- 'dev/mii/mii_physubr.c',
- 'dev/mii/icsphy.c',
- 'dev/mii/brgphy.c',
+ 'sys/dev/mii/mii.c',
+ 'sys/dev/mii/mii_physubr.c',
+ 'sys/dev/mii/icsphy.c',
+ 'sys/dev/mii/brgphy.c',
]
)
@@ -1328,175 +1182,138 @@ devNic = Module('dev_nic')
devNic.addHeaderFiles(
[
# 'sys/taskqueue.h',
- 'sys/pciio.h',
- 'dev/random/randomdev_soft.h',
- 'sys/eventvar.h',
- 'sys/kenv.h',
- 'dev/pci/pci_private.h',
- 'dev/pci/pcib_private.h',
- 'isa/isavar.h',
- 'isa/pnpvar.h',
- 'netatalk/at.h',
- 'netatalk/endian.h',
- 'netatalk/aarp.h',
- 'netatalk/at_extern.h',
- 'netatalk/at_var.h',
- 'netatalk/ddp.h',
- 'netatalk/ddp_pcb.h',
- 'netatalk/ddp_var.h',
- 'netatalk/phase2.h',
- 'sys/mman.h',
- 'sys/buf.h',
- 'sys/mqueue.h',
- 'sys/tty.h',
- 'sys/ttyqueue.h',
- 'sys/ttydisc.h',
- 'sys/ttydevsw.h',
- 'sys/ttyhook.h',
- 'sys/user.h',
+ 'sys/sys/pciio.h',
+ 'sys/dev/random/randomdev_soft.h',
+ 'sys/sys/eventvar.h',
+ 'sys/sys/kenv.h',
+ 'sys/isa/isavar.h',
+ 'sys/isa/pnpvar.h',
+ 'sys/netatalk/at.h',
+ 'sys/netatalk/endian.h',
+ 'sys/netatalk/aarp.h',
+ 'sys/netatalk/at_extern.h',
+ 'sys/netatalk/at_var.h',
+ 'sys/netatalk/ddp.h',
+ 'sys/netatalk/ddp_pcb.h',
+ 'sys/netatalk/ddp_var.h',
+ 'sys/netatalk/phase2.h',
+ 'sys/sys/mman.h',
+ 'sys/sys/buf.h',
+ 'sys/sys/mqueue.h',
+ 'sys/sys/tty.h',
+ 'sys/sys/ttyqueue.h',
+ 'sys/sys/ttydisc.h',
+ 'sys/sys/ttydevsw.h',
+ 'sys/sys/ttyhook.h',
+ 'sys/sys/user.h',
]
)
devNic.addCPUDependentHeaderFiles(
[
- 'arm/include/cpufunc.h',
- 'i386/include/specialreg.h',
- 'i386/include/md_var.h',
- 'i386/include/intr_machdep.h',
- 'i386/include/legacyvar.h',
- 'i386/include/pci_cfgreg.h',
- 'i386/include/cpufunc.h',
- 'mips/include/cpufunc.h',
- 'mips/include/cpuregs.h',
- 'powerpc/include/cpufunc.h',
- 'powerpc/include/psl.h',
- 'powerpc/include/spr.h',
- 'sparc64/include/cpufunc.h',
- 'sparc64/include/asi.h',
- 'sparc64/include/pstate.h',
- ]
-)
-
-devNic.addCPUDependentSourceFiles(
- 'i386',
- [
- 'i386/pci/pci_bus.c',
- 'i386/i386/legacy.c',
+ 'sys/arm/include/cpufunc.h',
+ 'sys/i386/include/specialreg.h',
+ 'sys/i386/include/md_var.h',
+ 'sys/i386/include/intr_machdep.h',
+ 'sys/i386/include/cpufunc.h',
+ 'sys/mips/include/cpufunc.h',
+ 'sys/mips/include/cpuregs.h',
+ 'sys/powerpc/include/cpufunc.h',
+ 'sys/powerpc/include/psl.h',
+ 'sys/powerpc/include/spr.h',
+ 'sys/sparc64/include/cpufunc.h',
+ 'sys/sparc64/include/asi.h',
+ 'sys/sparc64/include/pstate.h',
]
)
devNic.addSourceFiles(
[
- # 'kern/subr_taskqueue.c',
- 'kern/subr_hints.c',
- 'dev/random/harvest.c',
- 'libkern/random.c',
- 'libkern/arc4random.c',
- 'kern/subr_sbuf.c',
- 'kern/subr_rman.c',
- 'kern/subr_module.c',
- 'libkern/inet_ntoa.c',
- 'kern/kern_prot.c',
- 'kern/kern_proc.c',
- 'kern/kern_time.c',
- 'kern/kern_event.c',
- 'netinet/tcp_hostcache.c',
- 'dev/pci/pci.c',
- 'dev/pci/pci_user.c',
- 'kern/uipc_accf.c',
- 'kern/kern_ntptime.c',
- 'kern/kern_environment.c',
- 'kern/kern_intr.c',
- 'kern/kern_resource.c',
- 'kern/subr_bufring.c',
- 'dev/led/led.c',
- 'kern/subr_unit.c',
- 'dev/pci/pci_pci.c',
- 'netatalk/aarp.c',
- 'netatalk/at_control.c',
- 'netatalk/at_rmx.c',
- 'netatalk/ddp_input.c',
- 'netatalk/ddp_pcb.c',
- 'netatalk/ddp_usrreq.c',
- 'netatalk/at_proto.c',
- 'netatalk/ddp_output.c',
- 'kern/sys_generic.c',
- 'kern/kern_descrip.c',
- 'kern/kern_mtxpool.c',
+ 'sys/dev/random/harvest.c',
+ 'sys/netinet/tcp_hostcache.c',
+ 'sys/dev/led/led.c',
+ 'sys/netatalk/aarp.c',
+ 'sys/netatalk/at_control.c',
+ 'sys/netatalk/at_rmx.c',
+ 'sys/netatalk/ddp_input.c',
+ 'sys/netatalk/ddp_pcb.c',
+ 'sys/netatalk/ddp_usrreq.c',
+ 'sys/netatalk/at_proto.c',
+ 'sys/netatalk/ddp_output.c',
]
)
devNic_re = Module('dev_nic_re')
devNic_re.addHeaderFiles(
[
- 'pci/if_rlreg.h',
+ 'sys/pci/if_rlreg.h',
]
)
devNic_re.addSourceFiles(
[
- 'dev/re/if_re.c',
+ 'sys/dev/re/if_re.c',
]
)
devNic_fxp = Module('dev_nic_fxp')
devNic_fxp.addHeaderFiles(
[
- 'dev/fxp/if_fxpreg.h',
- 'dev/fxp/if_fxpvar.h',
- 'dev/fxp/rcvbundl.h',
+ 'sys/dev/fxp/if_fxpreg.h',
+ 'sys/dev/fxp/if_fxpvar.h',
+ 'sys/dev/fxp/rcvbundl.h',
]
)
devNic_fxp.addSourceFiles(
[
- 'dev/fxp/if_fxp.c',
+ 'sys/dev/fxp/if_fxp.c',
]
)
devNic_e1000 = Module('dev_nic_e1000')
devNic_e1000.addHeaderFiles(
[
- 'dev/e1000/e1000_80003es2lan.h',
- 'dev/e1000/e1000_82571.h',
- 'dev/e1000/e1000_defines.h',
- 'dev/e1000/e1000_mac.h',
- 'dev/e1000/e1000_nvm.h',
- 'dev/e1000/e1000_regs.h',
- 'dev/e1000/if_igb.h',
- 'dev/e1000/e1000_82541.h',
- 'dev/e1000/e1000_82575.h',
- 'dev/e1000/e1000_hw.h',
- 'dev/e1000/e1000_manage.h',
- 'dev/e1000/e1000_osdep.h',
- 'dev/e1000/e1000_vf.h',
- 'dev/e1000/if_lem.h',
- 'dev/e1000/e1000_82543.h',
- 'dev/e1000/e1000_api.h',
- 'dev/e1000/e1000_ich8lan.h',
- 'dev/e1000/e1000_mbx.h',
- 'dev/e1000/e1000_phy.h',
- 'dev/e1000/if_em.h',
+ 'sys/dev/e1000/e1000_80003es2lan.h',
+ 'sys/dev/e1000/e1000_82571.h',
+ 'sys/dev/e1000/e1000_defines.h',
+ 'sys/dev/e1000/e1000_mac.h',
+ 'sys/dev/e1000/e1000_nvm.h',
+ 'sys/dev/e1000/e1000_regs.h',
+ 'sys/dev/e1000/if_igb.h',
+ 'sys/dev/e1000/e1000_82541.h',
+ 'sys/dev/e1000/e1000_82575.h',
+ 'sys/dev/e1000/e1000_hw.h',
+ 'sys/dev/e1000/e1000_manage.h',
+ 'sys/dev/e1000/e1000_osdep.h',
+ 'sys/dev/e1000/e1000_vf.h',
+ 'sys/dev/e1000/if_lem.h',
+ 'sys/dev/e1000/e1000_82543.h',
+ 'sys/dev/e1000/e1000_api.h',
+ 'sys/dev/e1000/e1000_ich8lan.h',
+ 'sys/dev/e1000/e1000_mbx.h',
+ 'sys/dev/e1000/e1000_phy.h',
+ 'sys/dev/e1000/if_em.h',
]
)
devNic_e1000.addSourceFiles(
[
- 'dev/e1000/e1000_80003es2lan.c',
- 'dev/e1000/e1000_82542.c',
- 'dev/e1000/e1000_82575.c',
- 'dev/e1000/e1000_mac.c',
- 'dev/e1000/e1000_nvm.c',
- 'dev/e1000/e1000_vf.c',
- 'dev/e1000/if_lem.c',
- 'dev/e1000/e1000_82540.c',
- 'dev/e1000/e1000_82543.c',
- 'dev/e1000/e1000_api.c',
- 'dev/e1000/e1000_manage.c',
- 'dev/e1000/e1000_osdep.c',
- 'dev/e1000/if_em.c',
- 'dev/e1000/e1000_82541.c',
- 'dev/e1000/e1000_82571.c',
- 'dev/e1000/e1000_ich8lan.c',
- 'dev/e1000/e1000_mbx.c',
- 'dev/e1000/e1000_phy.c',
- 'dev/e1000/if_igb.c',
+ 'sys/dev/e1000/e1000_80003es2lan.c',
+ 'sys/dev/e1000/e1000_82542.c',
+ 'sys/dev/e1000/e1000_82575.c',
+ 'sys/dev/e1000/e1000_mac.c',
+ 'sys/dev/e1000/e1000_nvm.c',
+ 'sys/dev/e1000/e1000_vf.c',
+ 'sys/dev/e1000/if_lem.c',
+ 'sys/dev/e1000/e1000_82540.c',
+ 'sys/dev/e1000/e1000_82543.c',
+ 'sys/dev/e1000/e1000_api.c',
+ 'sys/dev/e1000/e1000_manage.c',
+ 'sys/dev/e1000/e1000_osdep.c',
+ 'sys/dev/e1000/if_em.c',
+ 'sys/dev/e1000/e1000_82541.c',
+ 'sys/dev/e1000/e1000_82571.c',
+ 'sys/dev/e1000/e1000_ich8lan.c',
+ 'sys/dev/e1000/e1000_mbx.c',
+ 'sys/dev/e1000/e1000_phy.c',
+ 'sys/dev/e1000/if_igb.c',
]
)
@@ -1504,14 +1321,14 @@ devNic_e1000.addSourceFiles(
devNic_dc = Module('dev_nic_dc')
devNic_dc.addHeaderFiles(
[
- 'dev/dc/if_dcreg.h',
+ 'sys/dev/dc/if_dcreg.h',
]
)
devNic_dc.addSourceFiles(
[
- 'dev/dc/dcphy.c',
- 'dev/dc/if_dc.c',
- 'dev/dc/pnphy.c',
+ 'sys/dev/dc/dcphy.c',
+ 'sys/dev/dc/if_dc.c',
+ 'sys/dev/dc/pnphy.c',
]
)
@@ -1519,13 +1336,13 @@ devNic_dc.addSourceFiles(
devNic_smc = Module('dev_nic_smc')
devNic_smc.addHeaderFiles(
[
- 'dev/smc/if_smcreg.h',
- 'dev/smc/if_smcvar.h',
+ 'sys/dev/smc/if_smcreg.h',
+ 'sys/dev/smc/if_smcvar.h',
]
)
devNic_smc.addSourceFiles(
[
- 'dev/smc/if_smc.c',
+ 'sys/dev/smc/if_smc.c',
]
)
@@ -1533,15 +1350,15 @@ devNic_smc.addSourceFiles(
devNic_cs = Module('dev_nic_cs')
devNic_cs.addHeaderFiles(
[
- 'dev/cs/if_csreg.h',
- 'dev/cs/if_csvar.h',
+ 'sys/dev/cs/if_csreg.h',
+ 'sys/dev/cs/if_csvar.h',
]
)
devNic_cs.addSourceFiles(
[
- 'dev/cs/if_cs.c',
- 'dev/cs/if_cs_isa.c',
- 'dev/cs/if_cs_pccard.c',
+ 'sys/dev/cs/if_cs.c',
+ 'sys/dev/cs/if_cs_isa.c',
+ 'sys/dev/cs/if_cs_pccard.c',
]
)
@@ -1549,324 +1366,283 @@ devNic_cs.addSourceFiles(
devNic_broadcomm = Module('dev_nic_broadcomm')
devNic_broadcomm.addHeaderFiles(
[
- 'dev/bce/if_bcefw.h',
- 'dev/bce/if_bcereg.h',
- 'dev/bfe/if_bfereg.h',
- 'dev/bge/if_bgereg.h',
+ 'sys/dev/bce/if_bcefw.h',
+ 'sys/dev/bce/if_bcereg.h',
+ 'sys/dev/bfe/if_bfereg.h',
+ 'sys/dev/bge/if_bgereg.h',
]
)
devNic_broadcomm.addSourceFiles(
[
- 'dev/bce/if_bce.c',
- 'dev/bfe/if_bfe.c',
- 'dev/bge/if_bge.c',
- ]
-)
-
-netDeps = Module('netDeps')
-netDeps.addHeaderFiles(
- [
- 'security/mac/mac_framework.h',
- 'sys/cpu.h',
- 'sys/interrupt.h',
- 'sys/fnv_hash.h',
- 'sys/tree.h',
- 'sys/buf_ring.h',
- 'sys/rwlock.h',
- 'sys/_rmlock.h',
- 'sys/sockio.h',
- 'sys/sdt.h',
- 'sys/_task.h',
- 'sys/sbuf.h',
- 'sys/smp.h',
- 'sys/syslog.h',
- 'sys/jail.h',
- 'sys/protosw.h',
- 'sys/random.h',
- 'sys/rmlock.h',
- 'sys/hash.h',
- #'sys/select.h',
- 'sys/sf_buf.h',
- 'sys/socketvar.h',
- 'sys/sockbuf.h',
- #'sys/sysproto.h',
- 'sys/sockstate.h',
- 'sys/sockopt.h',
- 'sys/domain.h',
- 'sys/time.h',
+ 'sys/dev/bce/if_bce.c',
+ 'sys/dev/bfe/if_bfe.c',
+ 'sys/dev/bge/if_bge.c',
]
)
net = Module('net')
net.addHeaderFiles(
[
- 'net/bpf_buffer.h',
- 'net/bpfdesc.h',
- 'net/bpf.h',
- 'net/bpf_jitter.h',
- 'net/bpf_zerocopy.h',
- 'net/bridgestp.h',
- 'net/ethernet.h',
- 'net/fddi.h',
- 'net/firewire.h',
- 'net/flowtable.h',
- 'net/ieee8023ad_lacp.h',
- 'net/if_arc.h',
- 'net/if_arp.h',
- 'net/if_atm.h',
- 'net/if_bridgevar.h',
- 'net/if_clone.h',
- 'net/if_dl.h',
- 'net/if_enc.h',
- 'net/if_gif.h',
- 'net/if_gre.h',
- 'net/if.h',
- 'net/if_lagg.h',
- 'net/if_llatbl.h',
- 'net/if_llc.h',
- 'net/if_media.h',
- 'net/if_mib.h',
- 'net/if_sppp.h',
- 'net/if_stf.h',
- 'net/if_tap.h',
- 'net/if_tapvar.h',
- 'net/if_tun.h',
- 'net/if_types.h',
- 'net/if_var.h',
- 'net/if_vlan_var.h',
- 'net/iso88025.h',
- 'net/netisr.h',
- 'net/pfil.h',
- 'net/pfkeyv2.h',
- 'net/ppp_defs.h',
- 'net/radix.h',
- 'net/radix_mpath.h',
- 'net/raw_cb.h',
- 'net/route.h',
- 'net/slcompress.h',
- 'net/vnet.h',
- 'net/zlib.h',
- 'sys/timepps.h',
- 'sys/timetc.h',
- 'sys/timex.h',
+ 'sys/net/bpf_buffer.h',
+ 'sys/net/bpfdesc.h',
+ 'sys/net/bpf.h',
+ 'sys/net/bpf_jitter.h',
+ 'sys/net/bpf_zerocopy.h',
+ 'sys/net/bridgestp.h',
+ 'sys/net/ethernet.h',
+ 'sys/net/fddi.h',
+ 'sys/net/firewire.h',
+ 'sys/net/flowtable.h',
+ 'sys/net/ieee8023ad_lacp.h',
+ 'sys/net/if_arc.h',
+ 'sys/net/if_arp.h',
+ 'sys/net/if_atm.h',
+ 'sys/net/if_bridgevar.h',
+ 'sys/net/if_clone.h',
+ 'sys/net/if_dl.h',
+ 'sys/net/if_enc.h',
+ 'sys/net/if_gif.h',
+ 'sys/net/if_gre.h',
+ 'sys/net/if.h',
+ 'sys/net/if_lagg.h',
+ 'sys/net/if_llatbl.h',
+ 'sys/net/if_llc.h',
+ 'sys/net/if_media.h',
+ 'sys/net/if_mib.h',
+ 'sys/net/if_sppp.h',
+ 'sys/net/if_stf.h',
+ 'sys/net/if_tap.h',
+ 'sys/net/if_tapvar.h',
+ 'sys/net/if_tun.h',
+ 'sys/net/if_types.h',
+ 'sys/net/if_var.h',
+ 'sys/net/if_vlan_var.h',
+ 'sys/net/iso88025.h',
+ 'sys/net/netisr.h',
+ 'sys/net/pfil.h',
+ 'sys/net/pfkeyv2.h',
+ 'sys/net/ppp_defs.h',
+ 'sys/net/radix.h',
+ 'sys/net/radix_mpath.h',
+ 'sys/net/raw_cb.h',
+ 'sys/net/route.h',
+ 'sys/net/slcompress.h',
+ 'sys/net/vnet.h',
+ 'sys/net/zlib.h',
]
)
net.addSourceFiles(
[
- 'kern/subr_eventhandler.c',
- 'kern/kern_subr.c',
- 'kern/kern_tc.c',
- 'libkern/fls.c',
- 'net/bridgestp.c',
- 'net/ieee8023ad_lacp.c',
- 'net/if_atmsubr.c',
- 'net/if.c',
- 'net/if_clone.c',
- 'net/if_dead.c',
- 'net/if_disc.c',
- 'net/if_edsc.c',
- 'net/if_ef.c',
- 'net/if_enc.c',
- 'net/if_epair.c',
- 'net/if_faith.c',
- 'net/if_fddisubr.c',
- 'net/if_fwsubr.c',
- 'net/if_gif.c',
- 'net/if_gre.c',
- 'net/if_iso88025subr.c',
- 'net/if_lagg.c',
- 'net/if_llatbl.c',
- 'net/if_loop.c',
- 'net/if_media.c',
- 'net/if_mib.c',
- 'net/if_spppfr.c',
- 'net/if_spppsubr.c',
- 'net/if_tap.c',
- 'net/if_tun.c',
- 'net/if_vlan.c',
- 'net/pfil.c',
- 'net/radix.c',
- 'net/radix_mpath.c',
- 'net/raw_cb.c',
- 'net/raw_usrreq.c',
- 'net/route.c',
- 'net/rtsock.c',
- 'net/slcompress.c',
- 'net/zlib.c',
- 'net/bpf_buffer.c',
- 'net/bpf.c',
- 'net/bpf_filter.c',
- 'net/bpf_jitter.c',
- 'net/if_arcsubr.c',
- 'net/if_bridge.c',
- 'net/if_ethersubr.c',
- 'net/netisr.c',
+ 'sys/net/bridgestp.c',
+ 'sys/net/ieee8023ad_lacp.c',
+ 'sys/net/if_atmsubr.c',
+ 'sys/net/if.c',
+ 'sys/net/if_clone.c',
+ 'sys/net/if_dead.c',
+ 'sys/net/if_disc.c',
+ 'sys/net/if_edsc.c',
+ 'sys/net/if_ef.c',
+ 'sys/net/if_enc.c',
+ 'sys/net/if_epair.c',
+ 'sys/net/if_faith.c',
+ 'sys/net/if_fddisubr.c',
+ 'sys/net/if_fwsubr.c',
+ 'sys/net/if_gif.c',
+ 'sys/net/if_gre.c',
+ 'sys/net/if_iso88025subr.c',
+ 'sys/net/if_lagg.c',
+ 'sys/net/if_llatbl.c',
+ 'sys/net/if_loop.c',
+ 'sys/net/if_media.c',
+ 'sys/net/if_mib.c',
+ 'sys/net/if_spppfr.c',
+ 'sys/net/if_spppsubr.c',
+ 'sys/net/if_tap.c',
+ 'sys/net/if_tun.c',
+ 'sys/net/if_vlan.c',
+ 'sys/net/pfil.c',
+ 'sys/net/radix.c',
+ 'sys/net/radix_mpath.c',
+ 'sys/net/raw_cb.c',
+ 'sys/net/raw_usrreq.c',
+ 'sys/net/route.c',
+ 'sys/net/rtsock.c',
+ 'sys/net/slcompress.c',
+ 'sys/net/zlib.c',
+ 'sys/net/bpf_buffer.c',
+ 'sys/net/bpf.c',
+ 'sys/net/bpf_filter.c',
+ 'sys/net/bpf_jitter.c',
+ 'sys/net/if_arcsubr.c',
+ 'sys/net/if_bridge.c',
+ 'sys/net/if_ethersubr.c',
+ 'sys/net/netisr.c',
]
)
netinet = Module('netinet')
netinet.addHeaderFiles(
[
- 'netinet/icmp6.h',
- 'netinet/icmp_var.h',
- 'netinet/if_atm.h',
- 'netinet/if_ether.h',
- 'netinet/igmp.h',
- 'netinet/igmp_var.h',
- 'netinet/in_gif.h',
- 'netinet/in.h',
- 'netinet/in_pcb.h',
- 'netinet/in_systm.h',
- 'netinet/in_var.h',
- 'netinet/ip6.h',
- 'netinet/ip_carp.h',
- 'netinet/ip_divert.h',
- 'netinet/ip_dummynet.h',
- 'netinet/ip_ecn.h',
- 'netinet/ip_encap.h',
- 'netinet/ip_fw.h',
- 'netinet/ip_gre.h',
- 'netinet/ip.h',
- 'netinet/ip_icmp.h',
- 'netinet/ip_ipsec.h',
- 'netinet/ip_mroute.h',
- 'netinet/ip_options.h',
- 'netinet/ip_var.h',
- 'netinet/ipfw/ip_dn_private.h',
- 'netinet/ipfw/ip_fw_private.h',
- 'netinet/ipfw/dn_sched.h',
- 'netinet/ipfw/dn_heap.h',
- 'netinet/pim.h',
- 'netinet/pim_var.h',
- 'netinet/sctp_asconf.h',
- 'netinet/sctp_auth.h',
- 'netinet/sctp_bsd_addr.h',
- 'netinet/sctp_cc_functions.h',
- 'netinet/sctp_constants.h',
- 'netinet/sctp_crc32.h',
- 'netinet/sctp.h',
- 'netinet/sctp_header.h',
- 'netinet/sctp_indata.h',
- 'netinet/sctp_input.h',
- 'netinet/sctp_lock_bsd.h',
- 'netinet/sctp_os_bsd.h',
- 'netinet/sctp_os.h',
- 'netinet/sctp_output.h',
- 'netinet/sctp_pcb.h',
- 'netinet/sctp_peeloff.h',
- 'netinet/sctp_structs.h',
- 'netinet/sctp_sysctl.h',
- 'netinet/sctp_timer.h',
- 'netinet/sctp_uio.h',
- 'netinet/sctputil.h',
- 'netinet/sctp_var.h',
- 'netinet/tcp_debug.h',
- 'netinet/tcp_fsm.h',
- 'netinet/tcp.h',
- 'netinet/tcp_hostcache.h',
- 'netinet/tcpip.h',
- 'netinet/tcp_lro.h',
- 'netinet/tcp_offload.h',
- 'netinet/tcp_seq.h',
- 'netinet/tcp_syncache.h',
- 'netinet/tcp_timer.h',
- 'netinet/tcp_var.h',
- 'netinet/toedev.h',
- 'netinet/udp.h',
- 'netinet/udp_var.h',
- 'netinet/libalias/alias_local.h',
- 'netinet/libalias/alias.h',
- 'netinet/libalias/alias_mod.h',
- 'netinet/libalias/alias_sctp.h',
+ 'sys/netinet/icmp6.h',
+ 'sys/netinet/icmp_var.h',
+ 'sys/netinet/if_atm.h',
+ 'sys/netinet/if_ether.h',
+ 'sys/netinet/igmp.h',
+ 'sys/netinet/igmp_var.h',
+ 'sys/netinet/in_gif.h',
+ 'sys/netinet/in.h',
+ 'sys/netinet/in_pcb.h',
+ 'sys/netinet/in_systm.h',
+ 'sys/netinet/in_var.h',
+ 'sys/netinet/ip6.h',
+ 'sys/netinet/ip_carp.h',
+ 'sys/netinet/ip_divert.h',
+ 'sys/netinet/ip_dummynet.h',
+ 'sys/netinet/ip_ecn.h',
+ 'sys/netinet/ip_encap.h',
+ 'sys/netinet/ip_fw.h',
+ 'sys/netinet/ip_gre.h',
+ 'sys/netinet/ip.h',
+ 'sys/netinet/ip_icmp.h',
+ 'sys/netinet/ip_ipsec.h',
+ 'sys/netinet/ip_mroute.h',
+ 'sys/netinet/ip_options.h',
+ 'sys/netinet/ip_var.h',
+ 'sys/netinet/ipfw/ip_dn_private.h',
+ 'sys/netinet/ipfw/ip_fw_private.h',
+ 'sys/netinet/ipfw/dn_sched.h',
+ 'sys/netinet/ipfw/dn_heap.h',
+ 'sys/netinet/pim.h',
+ 'sys/netinet/pim_var.h',
+ 'sys/netinet/sctp_asconf.h',
+ 'sys/netinet/sctp_auth.h',
+ 'sys/netinet/sctp_bsd_addr.h',
+ 'sys/netinet/sctp_cc_functions.h',
+ 'sys/netinet/sctp_constants.h',
+ 'sys/netinet/sctp_crc32.h',
+ 'sys/netinet/sctp.h',
+ 'sys/netinet/sctp_header.h',
+ 'sys/netinet/sctp_indata.h',
+ 'sys/netinet/sctp_input.h',
+ 'sys/netinet/sctp_lock_bsd.h',
+ 'sys/netinet/sctp_os_bsd.h',
+ 'sys/netinet/sctp_os.h',
+ 'sys/netinet/sctp_output.h',
+ 'sys/netinet/sctp_pcb.h',
+ 'sys/netinet/sctp_peeloff.h',
+ 'sys/netinet/sctp_structs.h',
+ 'sys/netinet/sctp_sysctl.h',
+ 'sys/netinet/sctp_timer.h',
+ 'sys/netinet/sctp_uio.h',
+ 'sys/netinet/sctputil.h',
+ 'sys/netinet/sctp_var.h',
+ 'sys/netinet/tcp_debug.h',
+ 'sys/netinet/tcp_fsm.h',
+ 'sys/netinet/tcp.h',
+ 'sys/netinet/tcp_hostcache.h',
+ 'sys/netinet/tcpip.h',
+ 'sys/netinet/tcp_lro.h',
+ 'sys/netinet/tcp_offload.h',
+ 'sys/netinet/tcp_seq.h',
+ 'sys/netinet/tcp_syncache.h',
+ 'sys/netinet/tcp_timer.h',
+ 'sys/netinet/tcp_var.h',
+ 'sys/netinet/toedev.h',
+ 'sys/netinet/udp.h',
+ 'sys/netinet/udp_var.h',
+ 'sys/netinet/libalias/alias_local.h',
+ 'sys/netinet/libalias/alias.h',
+ 'sys/netinet/libalias/alias_mod.h',
+ 'sys/netinet/libalias/alias_sctp.h',
]
)
# in_cksum.c is architecture dependent
netinet.addSourceFiles(
[
- 'netinet/accf_data.c',
- 'netinet/accf_dns.c',
- 'netinet/accf_http.c',
- 'netinet/if_atm.c',
- 'netinet/if_ether.c',
- 'netinet/igmp.c',
- 'netinet/in.c',
- 'netinet/in_gif.c',
- 'netinet/in_mcast.c',
- 'netinet/in_pcb.c',
- 'netinet/in_proto.c',
- 'netinet/in_rmx.c',
- 'netinet/ip_carp.c',
- 'netinet/ip_divert.c',
- 'netinet/ip_ecn.c',
- 'netinet/ip_encap.c',
- 'netinet/ip_fastfwd.c',
- 'netinet/ip_gre.c',
- 'netinet/ip_icmp.c',
- 'netinet/ip_id.c',
- 'netinet/ip_input.c',
- 'netinet/ip_ipsec.c',
- 'netinet/ip_mroute.c',
- 'netinet/ip_options.c',
- 'netinet/ip_output.c',
- 'netinet/raw_ip.c',
- 'netinet/sctp_asconf.c',
- 'netinet/sctp_auth.c',
- 'netinet/sctp_bsd_addr.c',
- 'netinet/sctp_cc_functions.c',
- 'netinet/sctp_crc32.c',
- 'netinet/sctp_indata.c',
- 'netinet/sctp_input.c',
- 'netinet/sctp_output.c',
- 'netinet/sctp_pcb.c',
- 'netinet/sctp_peeloff.c',
- 'netinet/sctp_sysctl.c',
- 'netinet/sctp_timer.c',
- 'netinet/sctp_usrreq.c',
- 'netinet/sctputil.c',
- 'netinet/tcp_debug.c',
+ 'sys/netinet/accf_data.c',
+ 'sys/netinet/accf_dns.c',
+ 'sys/netinet/accf_http.c',
+ 'sys/netinet/if_atm.c',
+ 'sys/netinet/if_ether.c',
+ 'sys/netinet/igmp.c',
+ 'sys/netinet/in.c',
+ 'sys/netinet/in_gif.c',
+ 'sys/netinet/in_mcast.c',
+ 'sys/netinet/in_pcb.c',
+ 'sys/netinet/in_proto.c',
+ 'sys/netinet/in_rmx.c',
+ 'sys/netinet/ip_carp.c',
+ 'sys/netinet/ip_divert.c',
+ 'sys/netinet/ip_ecn.c',
+ 'sys/netinet/ip_encap.c',
+ 'sys/netinet/ip_fastfwd.c',
+ 'sys/netinet/ip_gre.c',
+ 'sys/netinet/ip_icmp.c',
+ 'sys/netinet/ip_id.c',
+ 'sys/netinet/ip_input.c',
+ 'sys/netinet/ip_ipsec.c',
+ 'sys/netinet/ip_mroute.c',
+ 'sys/netinet/ip_options.c',
+ 'sys/netinet/ip_output.c',
+ 'sys/netinet/raw_ip.c',
+ 'sys/netinet/sctp_asconf.c',
+ 'sys/netinet/sctp_auth.c',
+ 'sys/netinet/sctp_bsd_addr.c',
+ 'sys/netinet/sctp_cc_functions.c',
+ 'sys/netinet/sctp_crc32.c',
+ 'sys/netinet/sctp_indata.c',
+ 'sys/netinet/sctp_input.c',
+ 'sys/netinet/sctp_output.c',
+ 'sys/netinet/sctp_pcb.c',
+ 'sys/netinet/sctp_peeloff.c',
+ 'sys/netinet/sctp_sysctl.c',
+ 'sys/netinet/sctp_timer.c',
+ 'sys/netinet/sctp_usrreq.c',
+ 'sys/netinet/sctputil.c',
+ 'sys/netinet/tcp_debug.c',
#'netinet/tcp_hostcache.c',
- 'netinet/tcp_input.c',
- 'netinet/tcp_lro.c',
- 'netinet/tcp_offload.c',
- 'netinet/tcp_output.c',
- 'netinet/tcp_reass.c',
- 'netinet/tcp_sack.c',
- 'netinet/tcp_subr.c',
- 'netinet/tcp_syncache.c',
- 'netinet/tcp_timer.c',
- 'netinet/tcp_timewait.c',
- 'netinet/tcp_usrreq.c',
- 'netinet/udp_usrreq.c',
- 'netinet/ipfw/dn_sched_fifo.c',
- 'netinet/ipfw/dn_sched_rr.c',
- 'netinet/ipfw/ip_fw_log.c',
- 'netinet/ipfw/dn_sched_qfq.c',
- 'netinet/ipfw/dn_sched_prio.c',
+ 'sys/netinet/tcp_input.c',
+ 'sys/netinet/tcp_lro.c',
+ 'sys/netinet/tcp_offload.c',
+ 'sys/netinet/tcp_output.c',
+ 'sys/netinet/tcp_reass.c',
+ 'sys/netinet/tcp_sack.c',
+ 'sys/netinet/tcp_subr.c',
+ 'sys/netinet/tcp_syncache.c',
+ 'sys/netinet/tcp_timer.c',
+ 'sys/netinet/tcp_timewait.c',
+ 'sys/netinet/tcp_usrreq.c',
+ 'sys/netinet/udp_usrreq.c',
+ 'sys/netinet/ipfw/dn_sched_fifo.c',
+ 'sys/netinet/ipfw/dn_sched_rr.c',
+ 'sys/netinet/ipfw/ip_fw_log.c',
+ 'sys/netinet/ipfw/dn_sched_qfq.c',
+ 'sys/netinet/ipfw/dn_sched_prio.c',
#'netinet/ipfw/ip_fw_dynamic.c',
- 'netinet/ipfw/ip_dn_glue.c',
- 'netinet/ipfw/ip_fw2.c',
- 'netinet/ipfw/dn_heap.c',
- 'netinet/ipfw/ip_dummynet.c',
- 'netinet/ipfw/ip_fw_sockopt.c',
- 'netinet/ipfw/dn_sched_wf2q.c',
- 'netinet/ipfw/ip_fw_nat.c',
- 'netinet/ipfw/ip_fw_pfil.c',
- 'netinet/ipfw/ip_dn_io.c',
- 'netinet/ipfw/ip_fw_table.c',
- 'netinet/libalias/alias_dummy.c',
- 'netinet/libalias/alias_pptp.c',
- 'netinet/libalias/alias_smedia.c',
- 'netinet/libalias/alias_mod.c',
- 'netinet/libalias/alias_cuseeme.c',
- 'netinet/libalias/alias_nbt.c',
- 'netinet/libalias/alias_irc.c',
- 'netinet/libalias/alias_util.c',
- 'netinet/libalias/alias_db.c',
- 'netinet/libalias/alias_ftp.c',
- 'netinet/libalias/alias_proxy.c',
- 'netinet/libalias/alias.c',
- 'netinet/libalias/alias_skinny.c',
- 'netinet/libalias/alias_sctp.c',
+ 'sys/netinet/ipfw/ip_dn_glue.c',
+ 'sys/netinet/ipfw/ip_fw2.c',
+ 'sys/netinet/ipfw/dn_heap.c',
+ 'sys/netinet/ipfw/ip_dummynet.c',
+ 'sys/netinet/ipfw/ip_fw_sockopt.c',
+ 'sys/netinet/ipfw/dn_sched_wf2q.c',
+ 'sys/netinet/ipfw/ip_fw_nat.c',
+ 'sys/netinet/ipfw/ip_fw_pfil.c',
+ 'sys/netinet/ipfw/ip_dn_io.c',
+ 'sys/netinet/ipfw/ip_fw_table.c',
+ 'sys/netinet/libalias/alias_dummy.c',
+ 'sys/netinet/libalias/alias_pptp.c',
+ 'sys/netinet/libalias/alias_smedia.c',
+ 'sys/netinet/libalias/alias_mod.c',
+ 'sys/netinet/libalias/alias_cuseeme.c',
+ 'sys/netinet/libalias/alias_nbt.c',
+ 'sys/netinet/libalias/alias_irc.c',
+ 'sys/netinet/libalias/alias_util.c',
+ 'sys/netinet/libalias/alias_db.c',
+ 'sys/netinet/libalias/alias_ftp.c',
+ 'sys/netinet/libalias/alias_proxy.c',
+ 'sys/netinet/libalias/alias.c',
+ 'sys/netinet/libalias/alias_skinny.c',
+ 'sys/netinet/libalias/alias_sctp.c',
]
)
@@ -1875,202 +1651,202 @@ netinet6.conditionalOn = "DISABLE_IPV6"
netinet6.cppPattern = 's/^\#define INET6 1/\/\/ \#define INET6 1/'
netinet6.addHeaderFiles(
[
- 'netinet6/icmp6.h',
- 'netinet6/in6_gif.h',
- 'netinet6/in6.h',
- 'netinet6/in6_ifattach.h',
- 'netinet6/in6_pcb.h',
- 'netinet6/in6_var.h',
- 'netinet6/ip6_ecn.h',
- 'netinet6/ip6.h',
- 'netinet6/ip6_ipsec.h',
- 'netinet6/ip6_mroute.h',
- 'netinet6/ip6protosw.h',
- 'netinet6/ip6_var.h',
- 'netinet6/mld6.h',
- 'netinet6/mld6_var.h',
- 'netinet6/nd6.h',
- 'netinet6/pim6.h',
- 'netinet6/pim6_var.h',
- 'netinet6/raw_ip6.h',
- 'netinet6/scope6_var.h',
- 'netinet6/sctp6_var.h',
- 'netinet6/tcp6_var.h',
- 'netinet6/udp6_var.h',
+ 'sys/netinet6/icmp6.h',
+ 'sys/netinet6/in6_gif.h',
+ 'sys/netinet6/in6.h',
+ 'sys/netinet6/in6_ifattach.h',
+ 'sys/netinet6/in6_pcb.h',
+ 'sys/netinet6/in6_var.h',
+ 'sys/netinet6/ip6_ecn.h',
+ 'sys/netinet6/ip6.h',
+ 'sys/netinet6/ip6_ipsec.h',
+ 'sys/netinet6/ip6_mroute.h',
+ 'sys/netinet6/ip6protosw.h',
+ 'sys/netinet6/ip6_var.h',
+ 'sys/netinet6/mld6.h',
+ 'sys/netinet6/mld6_var.h',
+ 'sys/netinet6/nd6.h',
+ 'sys/netinet6/pim6.h',
+ 'sys/netinet6/pim6_var.h',
+ 'sys/netinet6/raw_ip6.h',
+ 'sys/netinet6/scope6_var.h',
+ 'sys/netinet6/sctp6_var.h',
+ 'sys/netinet6/tcp6_var.h',
+ 'sys/netinet6/udp6_var.h',
]
)
netinet6.addSourceFiles(
[
- 'net/if_stf.c',
- 'netinet6/dest6.c',
- 'netinet6/frag6.c',
- 'netinet6/icmp6.c',
- 'netinet6/in6.c',
- 'netinet6/in6_cksum.c',
- 'netinet6/in6_gif.c',
- 'netinet6/in6_ifattach.c',
- 'netinet6/in6_mcast.c',
- 'netinet6/in6_pcb.c',
- 'netinet6/in6_proto.c',
- 'netinet6/in6_rmx.c',
- 'netinet6/in6_src.c',
- 'netinet6/ip6_forward.c',
- 'netinet6/ip6_id.c',
- 'netinet6/ip6_input.c',
- 'netinet6/ip6_ipsec.c',
- 'netinet6/ip6_mroute.c',
- 'netinet6/ip6_output.c',
- 'netinet6/mld6.c',
- 'netinet6/nd6.c',
- 'netinet6/nd6_nbr.c',
- 'netinet6/nd6_rtr.c',
- 'netinet6/raw_ip6.c',
- 'netinet6/route6.c',
- 'netinet6/scope6.c',
- 'netinet6/sctp6_usrreq.c',
- 'netinet6/udp6_usrreq.c',
+ 'sys/net/if_stf.c',
+ 'sys/netinet6/dest6.c',
+ 'sys/netinet6/frag6.c',
+ 'sys/netinet6/icmp6.c',
+ 'sys/netinet6/in6.c',
+ 'sys/netinet6/in6_cksum.c',
+ 'sys/netinet6/in6_gif.c',
+ 'sys/netinet6/in6_ifattach.c',
+ 'sys/netinet6/in6_mcast.c',
+ 'sys/netinet6/in6_pcb.c',
+ 'sys/netinet6/in6_proto.c',
+ 'sys/netinet6/in6_rmx.c',
+ 'sys/netinet6/in6_src.c',
+ 'sys/netinet6/ip6_forward.c',
+ 'sys/netinet6/ip6_id.c',
+ 'sys/netinet6/ip6_input.c',
+ 'sys/netinet6/ip6_ipsec.c',
+ 'sys/netinet6/ip6_mroute.c',
+ 'sys/netinet6/ip6_output.c',
+ 'sys/netinet6/mld6.c',
+ 'sys/netinet6/nd6.c',
+ 'sys/netinet6/nd6_nbr.c',
+ 'sys/netinet6/nd6_rtr.c',
+ 'sys/netinet6/raw_ip6.c',
+ 'sys/netinet6/route6.c',
+ 'sys/netinet6/scope6.c',
+ 'sys/netinet6/sctp6_usrreq.c',
+ 'sys/netinet6/udp6_usrreq.c',
]
)
netipsec = Module('netipsec')
netipsec.addHeaderFiles(
[
- 'netipsec/ah.h',
- 'netipsec/ah_var.h',
- 'netipsec/esp.h',
- 'netipsec/esp_var.h',
- 'netipsec/ipcomp.h',
- 'netipsec/ipcomp_var.h',
- 'netipsec/ipip_var.h',
- 'netipsec/ipsec6.h',
- 'netipsec/ipsec.h',
- 'netipsec/keydb.h',
- 'netipsec/key_debug.h',
- 'netipsec/key.h',
- 'netipsec/keysock.h',
- 'netipsec/key_var.h',
- 'netipsec/xform.h',
+ 'sys/netipsec/ah.h',
+ 'sys/netipsec/ah_var.h',
+ 'sys/netipsec/esp.h',
+ 'sys/netipsec/esp_var.h',
+ 'sys/netipsec/ipcomp.h',
+ 'sys/netipsec/ipcomp_var.h',
+ 'sys/netipsec/ipip_var.h',
+ 'sys/netipsec/ipsec6.h',
+ 'sys/netipsec/ipsec.h',
+ 'sys/netipsec/keydb.h',
+ 'sys/netipsec/key_debug.h',
+ 'sys/netipsec/key.h',
+ 'sys/netipsec/keysock.h',
+ 'sys/netipsec/key_var.h',
+ 'sys/netipsec/xform.h',
]
)
netipsec.addSourceFiles(
[
- 'netipsec/ipsec.c',
- 'netipsec/ipsec_input.c',
- 'netipsec/ipsec_mbuf.c',
- 'netipsec/ipsec_output.c',
- 'netipsec/key.c',
- 'netipsec/key_debug.c',
- 'netipsec/keysock.c',
- 'netipsec/xform_ah.c',
- 'netipsec/xform_esp.c',
- 'netipsec/xform_ipcomp.c',
- 'netipsec/xform_ipip.c',
- 'netipsec/xform_tcp.c',
+ 'sys/netipsec/ipsec.c',
+ 'sys/netipsec/ipsec_input.c',
+ 'sys/netipsec/ipsec_mbuf.c',
+ 'sys/netipsec/ipsec_output.c',
+ 'sys/netipsec/key.c',
+ 'sys/netipsec/key_debug.c',
+ 'sys/netipsec/keysock.c',
+ 'sys/netipsec/xform_ah.c',
+ 'sys/netipsec/xform_esp.c',
+ 'sys/netipsec/xform_ipcomp.c',
+ 'sys/netipsec/xform_ipip.c',
+ 'sys/netipsec/xform_tcp.c',
]
)
net80211 = Module('net80211')
net80211.addHeaderFiles(
[
- 'net80211/ieee80211_action.h',
- 'net80211/ieee80211_adhoc.h',
- 'net80211/ieee80211_ageq.h',
- 'net80211/ieee80211_amrr.h',
- 'net80211/ieee80211_crypto.h',
- 'net80211/ieee80211_dfs.h',
- 'net80211/ieee80211_freebsd.h',
- 'net80211/_ieee80211.h',
- 'net80211/ieee80211.h',
- 'net80211/ieee80211_hostap.h',
- 'net80211/ieee80211_ht.h',
- 'net80211/ieee80211_input.h',
- 'net80211/ieee80211_ioctl.h',
- 'net80211/ieee80211_mesh.h',
- 'net80211/ieee80211_monitor.h',
- 'net80211/ieee80211_node.h',
- 'net80211/ieee80211_phy.h',
- 'net80211/ieee80211_power.h',
- 'net80211/ieee80211_proto.h',
- 'net80211/ieee80211_radiotap.h',
- 'net80211/ieee80211_ratectl.h',
- 'net80211/ieee80211_regdomain.h',
- 'net80211/ieee80211_rssadapt.h',
- 'net80211/ieee80211_scan.h',
- 'net80211/ieee80211_sta.h',
- 'net80211/ieee80211_superg.h',
- 'net80211/ieee80211_tdma.h',
- 'net80211/ieee80211_var.h',
- 'net80211/ieee80211_wds.h',
+ 'sys/net80211/ieee80211_action.h',
+ 'sys/net80211/ieee80211_adhoc.h',
+ 'sys/net80211/ieee80211_ageq.h',
+ 'sys/net80211/ieee80211_amrr.h',
+ 'sys/net80211/ieee80211_crypto.h',
+ 'sys/net80211/ieee80211_dfs.h',
+ 'sys/net80211/ieee80211_freebsd.h',
+ 'sys/net80211/_ieee80211.h',
+ 'sys/net80211/ieee80211.h',
+ 'sys/net80211/ieee80211_hostap.h',
+ 'sys/net80211/ieee80211_ht.h',
+ 'sys/net80211/ieee80211_input.h',
+ 'sys/net80211/ieee80211_ioctl.h',
+ 'sys/net80211/ieee80211_mesh.h',
+ 'sys/net80211/ieee80211_monitor.h',
+ 'sys/net80211/ieee80211_node.h',
+ 'sys/net80211/ieee80211_phy.h',
+ 'sys/net80211/ieee80211_power.h',
+ 'sys/net80211/ieee80211_proto.h',
+ 'sys/net80211/ieee80211_radiotap.h',
+ 'sys/net80211/ieee80211_ratectl.h',
+ 'sys/net80211/ieee80211_regdomain.h',
+ 'sys/net80211/ieee80211_rssadapt.h',
+ 'sys/net80211/ieee80211_scan.h',
+ 'sys/net80211/ieee80211_sta.h',
+ 'sys/net80211/ieee80211_superg.h',
+ 'sys/net80211/ieee80211_tdma.h',
+ 'sys/net80211/ieee80211_var.h',
+ 'sys/net80211/ieee80211_wds.h',
]
)
netipsec.addSourceFiles(
[
- 'net80211/ieee80211_acl.c',
- 'net80211/ieee80211_action.c',
- 'net80211/ieee80211_adhoc.c',
- 'net80211/ieee80211_ageq.c',
- 'net80211/ieee80211_amrr.c',
- 'net80211/ieee80211.c',
- 'net80211/ieee80211_crypto.c',
- 'net80211/ieee80211_crypto_ccmp.c',
- 'net80211/ieee80211_crypto_none.c',
- 'net80211/ieee80211_crypto_tkip.c',
- 'net80211/ieee80211_crypto_wep.c',
- 'net80211/ieee80211_ddb.c',
- 'net80211/ieee80211_dfs.c',
- 'net80211/ieee80211_freebsd.c',
- 'net80211/ieee80211_hostap.c',
- 'net80211/ieee80211_ht.c',
- 'net80211/ieee80211_hwmp.c',
- 'net80211/ieee80211_input.c',
- 'net80211/ieee80211_ioctl.c',
- 'net80211/ieee80211_mesh.c',
- 'net80211/ieee80211_monitor.c',
- 'net80211/ieee80211_node.c',
- 'net80211/ieee80211_output.c',
- 'net80211/ieee80211_phy.c',
- 'net80211/ieee80211_power.c',
- 'net80211/ieee80211_proto.c',
- 'net80211/ieee80211_radiotap.c',
- 'net80211/ieee80211_ratectl.c',
- 'net80211/ieee80211_ratectl_none.c',
- 'net80211/ieee80211_regdomain.c',
- 'net80211/ieee80211_rssadapt.c',
- 'net80211/ieee80211_scan.c',
- 'net80211/ieee80211_scan_sta.c',
- 'net80211/ieee80211_sta.c',
- 'net80211/ieee80211_superg.c',
- 'net80211/ieee80211_tdma.c',
- 'net80211/ieee80211_wds.c',
- 'net80211/ieee80211_xauth.c',
+ 'sys/net80211/ieee80211_acl.c',
+ 'sys/net80211/ieee80211_action.c',
+ 'sys/net80211/ieee80211_adhoc.c',
+ 'sys/net80211/ieee80211_ageq.c',
+ 'sys/net80211/ieee80211_amrr.c',
+ 'sys/net80211/ieee80211.c',
+ 'sys/net80211/ieee80211_crypto.c',
+ 'sys/net80211/ieee80211_crypto_ccmp.c',
+ 'sys/net80211/ieee80211_crypto_none.c',
+ 'sys/net80211/ieee80211_crypto_tkip.c',
+ 'sys/net80211/ieee80211_crypto_wep.c',
+ 'sys/net80211/ieee80211_ddb.c',
+ 'sys/net80211/ieee80211_dfs.c',
+ 'sys/net80211/ieee80211_freebsd.c',
+ 'sys/net80211/ieee80211_hostap.c',
+ 'sys/net80211/ieee80211_ht.c',
+ 'sys/net80211/ieee80211_hwmp.c',
+ 'sys/net80211/ieee80211_input.c',
+ 'sys/net80211/ieee80211_ioctl.c',
+ 'sys/net80211/ieee80211_mesh.c',
+ 'sys/net80211/ieee80211_monitor.c',
+ 'sys/net80211/ieee80211_node.c',
+ 'sys/net80211/ieee80211_output.c',
+ 'sys/net80211/ieee80211_phy.c',
+ 'sys/net80211/ieee80211_power.c',
+ 'sys/net80211/ieee80211_proto.c',
+ 'sys/net80211/ieee80211_radiotap.c',
+ 'sys/net80211/ieee80211_ratectl.c',
+ 'sys/net80211/ieee80211_ratectl_none.c',
+ 'sys/net80211/ieee80211_regdomain.c',
+ 'sys/net80211/ieee80211_rssadapt.c',
+ 'sys/net80211/ieee80211_scan.c',
+ 'sys/net80211/ieee80211_scan_sta.c',
+ 'sys/net80211/ieee80211_sta.c',
+ 'sys/net80211/ieee80211_superg.c',
+ 'sys/net80211/ieee80211_tdma.c',
+ 'sys/net80211/ieee80211_wds.c',
+ 'sys/net80211/ieee80211_xauth.c',
]
)
opencrypto = Module('opencrypto')
opencrypto.addHeaderFiles(
[
- 'sys/md5.h',
- 'opencrypto/deflate.h',
- 'opencrypto/xform.h',
- 'opencrypto/cryptosoft.h',
- 'opencrypto/rmd160.h',
- 'opencrypto/cryptodev.h',
- 'opencrypto/castsb.h',
- 'opencrypto/skipjack.h',
- 'opencrypto/cast.h',
+ 'sys/sys/md5.h',
+ 'sys/opencrypto/deflate.h',
+ 'sys/opencrypto/xform.h',
+ 'sys/opencrypto/cryptosoft.h',
+ 'sys/opencrypto/rmd160.h',
+ 'sys/opencrypto/cryptodev.h',
+ 'sys/opencrypto/castsb.h',
+ 'sys/opencrypto/skipjack.h',
+ 'sys/opencrypto/cast.h',
]
)
opencrypto.addSourceFiles(
[
- 'opencrypto/crypto.c',
- 'opencrypto/deflate.c',
- 'opencrypto/cryptosoft.c',
- 'opencrypto/criov.c',
- 'opencrypto/rmd160.c',
- 'opencrypto/xform.c',
- 'opencrypto/skipjack.c',
- 'opencrypto/cast.c',
- 'opencrypto/cryptodev.c',
+ 'sys/opencrypto/crypto.c',
+ 'sys/opencrypto/deflate.c',
+ 'sys/opencrypto/cryptosoft.c',
+ 'sys/opencrypto/criov.c',
+ 'sys/opencrypto/rmd160.c',
+ 'sys/opencrypto/xform.c',
+ 'sys/opencrypto/skipjack.c',
+ 'sys/opencrypto/cast.c',
+ 'sys/opencrypto/cryptodev.c',
]
)
@@ -2078,76 +1854,76 @@ crypto = Module('crypto')
crypto.addHeaderFiles(
[
#'crypto/aesni/aesni.h',
- 'crypto/sha1.h',
- 'crypto/sha2/sha2.h',
- 'crypto/rijndael/rijndael.h',
- 'crypto/rijndael/rijndael_local.h',
- 'crypto/rijndael/rijndael-api-fst.h',
- 'crypto/des/des.h',
- 'crypto/des/spr.h',
- 'crypto/des/podd.h',
- 'crypto/des/sk.h',
- 'crypto/des/des_locl.h',
- 'crypto/blowfish/bf_pi.h',
- 'crypto/blowfish/bf_locl.h',
- 'crypto/blowfish/blowfish.h',
- 'crypto/rc4/rc4.h',
+ 'sys/crypto/sha1.h',
+ 'sys/crypto/sha2/sha2.h',
+ 'sys/crypto/rijndael/rijndael.h',
+ 'sys/crypto/rijndael/rijndael_local.h',
+ 'sys/crypto/rijndael/rijndael-api-fst.h',
+ 'sys/crypto/des/des.h',
+ 'sys/crypto/des/spr.h',
+ 'sys/crypto/des/podd.h',
+ 'sys/crypto/des/sk.h',
+ 'sys/crypto/des/des_locl.h',
+ 'sys/crypto/blowfish/bf_pi.h',
+ 'sys/crypto/blowfish/bf_locl.h',
+ 'sys/crypto/blowfish/blowfish.h',
+ 'sys/crypto/rc4/rc4.h',
#'crypto/via/padlock.h',
- 'crypto/camellia/camellia.h',
+ 'sys/crypto/camellia/camellia.h',
]
)
crypto.addSourceFiles(
[
#'crypto/aesni/aesni.c',
#'crypto/aesni/aesni_wrap.c',
- 'crypto/sha1.c',
- 'crypto/sha2/sha2.c',
- 'crypto/rijndael/rijndael-alg-fst.c',
- 'crypto/rijndael/rijndael-api.c',
- 'crypto/rijndael/rijndael-api-fst.c',
- 'crypto/des/des_setkey.c',
- 'crypto/des/des_enc.c',
- 'crypto/des/des_ecb.c',
- 'crypto/blowfish/bf_enc.c',
- 'crypto/blowfish/bf_skey.c',
- 'crypto/blowfish/bf_ecb.c',
- 'crypto/rc4/rc4.c',
+ 'sys/crypto/sha1.c',
+ 'sys/crypto/sha2/sha2.c',
+ 'sys/crypto/rijndael/rijndael-alg-fst.c',
+ 'sys/crypto/rijndael/rijndael-api.c',
+ 'sys/crypto/rijndael/rijndael-api-fst.c',
+ 'sys/crypto/des/des_setkey.c',
+ 'sys/crypto/des/des_enc.c',
+ 'sys/crypto/des/des_ecb.c',
+ 'sys/crypto/blowfish/bf_enc.c',
+ 'sys/crypto/blowfish/bf_skey.c',
+ 'sys/crypto/blowfish/bf_ecb.c',
+ 'sys/crypto/rc4/rc4.c',
#'crypto/via/padlock.c',
#'crypto/via/padlock_cipher.c',
#'crypto/via/padlock_hash.c',
- 'crypto/camellia/camellia-api.c',
- 'crypto/camellia/camellia.c',
+ 'sys/crypto/camellia/camellia-api.c',
+ 'sys/crypto/camellia/camellia.c',
]
)
altq = Module('altq')
altq.addHeaderFiles(
[
- 'contrib/altq/altq/altq_rmclass.h',
- 'contrib/altq/altq/altq_cbq.h',
- 'contrib/altq/altq/altq_var.h',
- 'contrib/altq/altq/altqconf.h',
- 'contrib/altq/altq/altq.h',
- 'contrib/altq/altq/altq_hfsc.h',
- 'contrib/altq/altq/altq_red.h',
- 'contrib/altq/altq/altq_classq.h',
- 'contrib/altq/altq/altq_priq.h',
- 'contrib/altq/altq/altq_rmclass_debug.h',
- 'contrib/altq/altq/altq_cdnr.h',
- 'contrib/altq/altq/altq_rio.h',
- 'contrib/altq/altq/if_altq.h',
+ 'sys/contrib/altq/altq/altq_rmclass.h',
+ 'sys/contrib/altq/altq/altq_cbq.h',
+ 'sys/contrib/altq/altq/altq_var.h',
+ 'sys/contrib/altq/altq/altqconf.h',
+ 'sys/contrib/altq/altq/altq.h',
+ 'sys/contrib/altq/altq/altq_hfsc.h',
+ 'sys/contrib/altq/altq/altq_red.h',
+ 'sys/contrib/altq/altq/altq_classq.h',
+ 'sys/contrib/altq/altq/altq_priq.h',
+ 'sys/contrib/altq/altq/altq_rmclass_debug.h',
+ 'sys/contrib/altq/altq/altq_cdnr.h',
+ 'sys/contrib/altq/altq/altq_rio.h',
+ 'sys/contrib/altq/altq/if_altq.h',
]
)
altq.addSourceFiles(
[
- 'contrib/altq/altq/altq_rmclass.c',
- 'contrib/altq/altq/altq_rio.c',
- 'contrib/altq/altq/altq_subr.c',
- 'contrib/altq/altq/altq_cdnr.c',
- 'contrib/altq/altq/altq_priq.c',
- 'contrib/altq/altq/altq_cbq.c',
- 'contrib/altq/altq/altq_hfsc.c',
- 'contrib/altq/altq/altq_red.c',
+ 'sys/contrib/altq/altq/altq_rmclass.c',
+ 'sys/contrib/altq/altq/altq_rio.c',
+ 'sys/contrib/altq/altq/altq_subr.c',
+ 'sys/contrib/altq/altq/altq_cdnr.c',
+ 'sys/contrib/altq/altq/altq_priq.c',
+ 'sys/contrib/altq/altq/altq_cbq.c',
+ 'sys/contrib/altq/altq/altq_hfsc.c',
+ 'sys/contrib/altq/altq/altq_red.c',
]
)
@@ -2155,25 +1931,369 @@ altq.addSourceFiles(
pf = Module('pf')
pf.addHeaderFiles(
[
- 'contrib/pf/net/pf_mtag.h',
- 'contrib/pf/net/if_pfsync.h',
- 'contrib/pf/net/pfvar.h',
- 'contrib/pf/net/if_pflog.h',
+ 'sys/contrib/pf/net/pf_mtag.h',
+ 'sys/contrib/pf/net/if_pfsync.h',
+ 'sys/contrib/pf/net/pfvar.h',
+ 'sys/contrib/pf/net/if_pflog.h',
]
)
pf.addSourceFiles(
[
- 'contrib/pf/netinet/in4_cksum.c',
- 'contrib/pf/net/pf.c',
- 'contrib/pf/net/if_pflog.c',
- 'contrib/pf/net/pf_subr.c',
- 'contrib/pf/net/pf_ioctl.c',
- 'contrib/pf/net/pf_table.c',
- 'contrib/pf/net/pf_if.c',
- 'contrib/pf/net/pf_osfp.c',
- 'contrib/pf/net/pf_norm.c',
- 'contrib/pf/net/pf_ruleset.c',
- 'contrib/pf/net/if_pfsync.c',
+ 'sys/contrib/pf/netinet/in4_cksum.c',
+ 'sys/contrib/pf/net/pf.c',
+ 'sys/contrib/pf/net/if_pflog.c',
+ 'sys/contrib/pf/net/pf_subr.c',
+ 'sys/contrib/pf/net/pf_ioctl.c',
+ 'sys/contrib/pf/net/pf_table.c',
+ 'sys/contrib/pf/net/pf_if.c',
+ 'sys/contrib/pf/net/pf_osfp.c',
+ 'sys/contrib/pf/net/pf_norm.c',
+ 'sys/contrib/pf/net/pf_ruleset.c',
+ 'sys/contrib/pf/net/if_pfsync.c',
+ ]
+)
+
+pci = Module('pci')
+pci.addSourceFiles(
+ [
+ 'sys/dev/pci/pci.c',
+ 'sys/dev/pci/pci_user.c',
+ 'sys/dev/pci/pci_pci.c',
+ ]
+)
+pci.addHeaderFiles(
+ [
+ 'sys/dev/pci/pcib_private.h',
+ 'sys/dev/pci/pci_private.h',
+ 'sys/dev/pci/pcireg.h',
+ 'sys/dev/pci/pcivar.h',
+ ]
+)
+pci.addCPUDependentHeaderFiles(
+ [
+ 'sys/i386/include/legacyvar.h',
+ 'sys/i386/include/pci_cfgreg.h',
+ ]
+)
+pci.addTargetSourceCPUDependentHeaderFiles(
+ [ 'arm', 'avr', 'bfin', 'h8300', 'lm32', 'm32c', 'm32r', 'm68k', 'mips', 'nios2', 'powerpc', 'sh', 'sparc', 'sparc64', 'v850' ],
+ 'i386',
+ [
+ 'sys/i386/include/legacyvar.h',
+ 'sys/i386/include/pci_cfgreg.h',
+ ]
+)
+pci.addCPUDependentSourceFiles(
+ 'i386',
+ [
+ 'sys/i386/pci/pci_bus.c',
+ 'sys/i386/i386/legacy.c',
+ ]
+)
+pci.addTargetSourceCPUDependentSourceFiles(
+ [ 'arm', 'avr', 'bfin', 'h8300', 'lm32', 'm32c', 'm32r', 'm68k', 'mips', 'nios2', 'powerpc', 'sh', 'sparc', 'sparc64', 'v850' ],
+ 'i386',
+ [
+ 'sys/i386/pci/pci_bus.c',
+ 'sys/i386/i386/legacy.c',
+ ]
+)
+
+userSpace = Module('userSpace')
+userSpace.addUserSpaceHeaderFiles(
+ [
+ 'include/arpa/ftp.h',
+ 'include/arpa/inet.h',
+ 'include/arpa/nameser_compat.h',
+ 'include/arpa/nameser.h',
+ 'include/db.h',
+ 'include/err.h',
+ 'include/ifaddrs.h',
+ 'include/mpool.h',
+ 'include/netconfig.h',
+ 'include/netdb.h',
+ 'include/nlist.h',
+ 'include/nsswitch.h',
+ 'include/resolv.h',
+ 'include/res_update.h',
+ 'include/rpc/auth_des.h',
+ 'include/rpc/auth.h',
+ 'include/rpc/auth_unix.h',
+ 'include/rpc/clnt.h',
+ 'include/rpc/clnt_soc.h',
+ 'include/rpc/clnt_stat.h',
+ 'include/rpc/pmap_clnt.h',
+ 'include/rpc/pmap_prot.h',
+ 'include/rpc/rpcb_clnt.h',
+ 'include/rpc/rpcent.h',
+ 'include/rpc/rpc.h',
+ 'include/rpc/rpc_msg.h',
+ 'include/rpc/svc_auth.h',
+ 'include/rpc/svc.h',
+ 'include/rpcsvc/nis_db.h',
+ 'include/rpcsvc/nislib.h',
+ 'include/rpcsvc/nis_tags.h',
+ 'include/rpc/svc_soc.h',
+ 'include/rpcsvc/ypclnt.h',
+ 'include/rpcsvc/yp_prot.h',
+ 'include/rpc/xdr.h',
+ 'include/sysexits.h',
+ 'lib/libc/db/btree/btree.h',
+ 'lib/libc/db/btree/extern.h',
+ 'lib/libc/db/recno/extern.h',
+ 'lib/libc/db/recno/recno.h',
+ 'lib/libc/include/isc/eventlib.h',
+ 'lib/libc/include/isc/list.h',
+ 'lib/libc/include/isc/platform.h',
+ 'lib/libc/include/libc_private.h',
+ 'lib/libc/include/namespace.h',
+ 'lib/libc/include/nss_tls.h',
+ 'lib/libc/include/port_after.h',
+ 'lib/libc/include/port_before.h',
+ 'lib/libc/include/reentrant.h',
+ 'lib/libc/include/resolv_mt.h',
+ 'lib/libc/include/spinlock.h',
+ 'lib/libc/include/un-namespace.h',
+ 'lib/libc/isc/eventlib_p.h',
+ 'lib/libc/net/netdb_private.h',
+ 'lib/libc/net/nss_backends.h',
+ 'lib/libc/net/res_config.h',
+ 'lib/libc/resolv/res_debug.h',
+ 'lib/libc/resolv/res_private.h',
+ 'lib/libc/stdio/local.h',
+ 'lib/libipsec/ipsec_strerror.h',
+ 'lib/libipsec/libpfkey.h',
+ 'lib/libkvm/kvm.h',
+ 'lib/libmemstat/memstat.h',
+ 'lib/libmemstat/memstat_internal.h',
+ 'lib/libutil/libutil.h',
+ 'sbin/dhclient/dhcpd.h',
+ 'sbin/dhclient/dhcp.h',
+ 'sbin/dhclient/dhctoken.h',
+ 'sbin/dhclient/privsep.h',
+ 'sbin/dhclient/tree.h',
+ 'sbin/ifconfig/ifconfig.h',
+ 'sbin/ifconfig/regdomain.h',
+ 'usr.bin/netstat/netstat.h',
+ ]
+)
+
+class RPCGENMakefileFragmentComposer(MakefileFragmentComposer):
+ def compose(self, path):
+ headerPath = path[:-2] + '.h'
+ return 'LIB_GEN_FILES += ' + headerPath + '\n' \
+ + headerPath + ': ' + path + '\n' \
+ '\t rm -f $@\n' \
+ '\t rpcgen -h -o $@ $<\n'
+
+userSpace.addFile(File('include/rpc/rpcb_prot.x', PathComposer(), Converter(), Converter(), RPCGENMakefileFragmentComposer()))
+
+class RouteKeywordsMakefileFragmentComposer(MakefileFragmentComposer):
+ def compose(self, path):
+ headerPath = path + '.h'
+ tmpPath = path + '.tmp'
+ return 'LIB_GEN_FILES += ' + headerPath + '\n' \
+ + headerPath + ': ' + path + '\n' \
+ '\tsed -e \'/^#/d\' -e \'/^$$/d\' $< > ' + tmpPath + '\n' \
+ '\tLC_ALL=C tr \'a-z\' \'A-Z\' < ' + tmpPath + ' | paste ' + tmpPath + ' - | \\\n' \
+ '\tawk \'{ if (NF > 1) printf "#define\\tK_%s\\t%d\\n\\t{\\"%s\\", K_%s},\\n", $$2, NR, $$1, $$2 }\' > $@\n' \
+ '\trm -f ' + tmpPath + '\n'
+
+userSpace.addFile(File('sbin/route/keywords', PathComposer(), Converter(), Converter(), RouteKeywordsMakefileFragmentComposer()))
+
+class LexMakefileFragmentComposer(MakefileFragmentComposer):
+ def __init__(self, sym, dep):
+ self.sym = sym
+ self.dep = dep
+
+ def compose(self, path):
+ src = path[:-2] + '.c'
+ dep = path[:path.rfind('/')] + '/' + self.dep
+ return 'LIB_GEN_FILES += ' + src + '\n' \
+ 'LIB_C_FILES += ' + src + '\n' \
+ + src + ': ' + path + ' ' + dep + '\n' \
+ '\t${LEX} -P ' + self.sym + ' -t $< | sed -e \'/YY_BUF_SIZE/s/16384/1024/\' > $@\n'
+
+class YaccMakefileFragmentComposer(MakefileFragmentComposer):
+ def __init__(self, sym, header):
+ self.sym = sym
+ self.header = header
+
+ def compose(self, path):
+ src = path[:-2] + '.c'
+ hdr = path[:path.rfind('/')] + '/' + self.header
+ return 'LIB_GEN_FILES += ' + src + '\n' \
+ 'LIB_C_FILES += ' + src + '\n' \
+ + src + ': ' + path + '\n' \
+ '\tyacc -b ' + self.sym + ' -d -p ' + self.sym + ' $<\n' \
+ '\tsed -e ''/YY_BUF_SIZE/s/16384/1024/'' < ' + self.sym + '.tab.c > $@\n' \
+ '\trm -f ' + self.sym + '.tab.c\n' \
+ '\tmv ' + self.sym + '.tab.h ' + hdr + '\n'
+
+rtems.addFile(File('lib/libc/net/nslexer.l', PathComposer(), Converter(), Converter(), LexMakefileFragmentComposer('_nsyy', 'nsparser.c')))
+rtems.addFile(File('lib/libc/net/nsparser.y', PathComposer(), Converter(), Converter(), YaccMakefileFragmentComposer('_nsyy', 'nsparser.h')))
+rtems.addFile(File('lib/libipsec/policy_token.l', PathComposer(), Converter(), Converter(), LexMakefileFragmentComposer('__libipsecyy', 'policy_parse.c')))
+rtems.addFile(File('lib/libipsec/policy_parse.y', PathComposer(), Converter(), Converter(), YaccMakefileFragmentComposer('__libipsecyy', 'y.tab.h')))
+
+userSpace.addUserSpaceSourceFiles(
+ [
+ 'lib/libc/db/btree/bt_close.c',
+ 'lib/libc/db/btree/bt_conv.c',
+ 'lib/libc/db/btree/bt_debug.c',
+ 'lib/libc/db/btree/bt_delete.c',
+ 'lib/libc/db/btree/bt_get.c',
+ 'lib/libc/db/btree/bt_open.c',
+ 'lib/libc/db/btree/bt_overflow.c',
+ 'lib/libc/db/btree/bt_page.c',
+ 'lib/libc/db/btree/bt_put.c',
+ 'lib/libc/db/btree/bt_search.c',
+ 'lib/libc/db/btree/bt_seq.c',
+ 'lib/libc/db/btree/bt_split.c',
+ 'lib/libc/db/btree/bt_utils.c',
+ 'lib/libc/db/db/db.c',
+ 'lib/libc/db/mpool/mpool.c',
+ 'lib/libc/db/mpool/mpool-compat.c',
+ 'lib/libc/db/recno/rec_close.c',
+ 'lib/libc/db/recno/rec_delete.c',
+ 'lib/libc/db/recno/rec_get.c',
+ 'lib/libc/db/recno/rec_open.c',
+ 'lib/libc/db/recno/rec_put.c',
+ 'lib/libc/db/recno/rec_search.c',
+ 'lib/libc/db/recno/rec_seq.c',
+ 'lib/libc/db/recno/rec_utils.c',
+ 'lib/libc/gen/err.c',
+ 'lib/libc/gen/gethostname.c',
+ 'lib/libc/inet/inet_addr.c',
+ 'lib/libc/inet/inet_cidr_ntop.c',
+ 'lib/libc/inet/inet_cidr_pton.c',
+ 'lib/libc/inet/inet_lnaof.c',
+ 'lib/libc/inet/inet_makeaddr.c',
+ 'lib/libc/inet/inet_neta.c',
+ 'lib/libc/inet/inet_net_ntop.c',
+ 'lib/libc/inet/inet_netof.c',
+ 'lib/libc/inet/inet_net_pton.c',
+ 'lib/libc/inet/inet_network.c',
+ 'lib/libc/inet/inet_ntoa.c',
+ 'lib/libc/inet/inet_ntop.c',
+ 'lib/libc/inet/inet_pton.c',
+ 'lib/libc/inet/nsap_addr.c',
+ 'lib/libc/isc/ev_streams.c',
+ 'lib/libc/isc/ev_timers.c',
+ 'lib/libc/nameser/ns_name.c',
+ 'lib/libc/nameser/ns_netint.c',
+ 'lib/libc/nameser/ns_parse.c',
+ 'lib/libc/nameser/ns_print.c',
+ 'lib/libc/nameser/ns_samedomain.c',
+ 'lib/libc/nameser/ns_ttl.c',
+ 'lib/libc/net/base64.c',
+ 'lib/libc/net/ether_addr.c',
+ 'lib/libc/net/gai_strerror.c',
+ 'lib/libc/net/getaddrinfo.c',
+ 'lib/libc/net/gethostbydns.c',
+ 'lib/libc/net/gethostbyht.c',
+ 'lib/libc/net/gethostbynis.c',
+ 'lib/libc/net/gethostnamadr.c',
+ 'lib/libc/net/getifaddrs.c',
+ 'lib/libc/net/getifmaddrs.c',
+ 'lib/libc/net/getnameinfo.c',
+ 'lib/libc/net/getnetbydns.c',
+ 'lib/libc/net/getnetbyht.c',
+ 'lib/libc/net/getnetbynis.c',
+ 'lib/libc/net/getnetnamadr.c',
+ 'lib/libc/net/getproto.c',
+ 'lib/libc/net/getprotoent.c',
+ 'lib/libc/net/getprotoname.c',
+ 'lib/libc/net/getservent.c',
+ 'lib/libc/net/if_indextoname.c',
+ 'lib/libc/net/if_nameindex.c',
+ 'lib/libc/net/if_nametoindex.c',
+ 'lib/libc/net/linkaddr.c',
+ 'lib/libc/net/map_v4v6.c',
+ 'lib/libc/net/name6.c',
+ 'lib/libc/net/nsdispatch.c',
+ 'lib/libc/net/rcmd.c',
+ 'lib/libc/net/recv.c',
+ 'lib/libc/net/send.c',
+ 'lib/libc/resolv/h_errno.c',
+ 'lib/libc/resolv/herror.c',
+ 'lib/libc/resolv/mtctxres.c',
+ 'lib/libc/resolv/res_comp.c',
+ 'lib/libc/resolv/res_data.c',
+ 'lib/libc/resolv/res_debug.c',
+ 'lib/libc/resolv/res_findzonecut.c',
+ 'lib/libc/resolv/res_init.c',
+ 'lib/libc/resolv/res_mkquery.c',
+ 'lib/libc/resolv/res_mkupdate.c',
+ 'lib/libc/resolv/res_query.c',
+ 'lib/libc/resolv/res_send.c',
+ 'lib/libc/resolv/res_state.c',
+ 'lib/libc/resolv/res_update.c',
+ 'lib/libc/stdio/fgetln.c',
+ 'lib/libc/stdlib/strtonum.c',
+ 'lib/libc/string/strsep.c',
+ 'lib/libipsec/ipsec_dump_policy.c',
+ 'lib/libipsec/ipsec_get_policylen.c',
+ 'lib/libipsec/ipsec_strerror.c',
+ 'lib/libipsec/pfkey.c',
+ 'lib/libipsec/pfkey_dump.c',
+ 'lib/libmemstat/memstat_all.c',
+ 'lib/libmemstat/memstat.c',
+ 'lib/libmemstat/memstat_malloc.c',
+ 'lib/libmemstat/memstat_uma.c',
+ 'lib/libutil/expand_number.c',
+ 'lib/libutil/humanize_number.c',
+ 'lib/libutil/trimdomain.c',
+ 'sbin/dhclient/alloc.c',
+ 'sbin/dhclient/bpf.c',
+ 'sbin/dhclient/clparse.c',
+ 'sbin/dhclient/conflex.c',
+ 'sbin/dhclient/convert.c',
+ 'sbin/dhclient/dhclient.c',
+ 'sbin/dhclient/dispatch.c',
+ 'sbin/dhclient/errwarn.c',
+ 'sbin/dhclient/hash.c',
+ 'sbin/dhclient/inet.c',
+ 'sbin/dhclient/options.c',
+ 'sbin/dhclient/packet.c',
+ 'sbin/dhclient/parse.c',
+ 'sbin/dhclient/privsep.c',
+ 'sbin/dhclient/tables.c',
+ 'sbin/dhclient/tree.c',
+ 'sbin/ifconfig/af_atalk.c',
+ 'sbin/ifconfig/af_inet6.c',
+ 'sbin/ifconfig/af_inet.c',
+ 'sbin/ifconfig/af_link.c',
+ 'sbin/ifconfig/af_nd6.c',
+ 'sbin/ifconfig/ifbridge.c',
+ 'sbin/ifconfig/ifcarp.c',
+ 'sbin/ifconfig/ifclone.c',
+ 'sbin/ifconfig/ifconfig.c',
+ 'sbin/ifconfig/ifgif.c',
+ 'sbin/ifconfig/ifgre.c',
+ 'sbin/ifconfig/ifgroup.c',
+ 'sbin/ifconfig/ifieee80211.c',
+ 'sbin/ifconfig/iflagg.c',
+ 'sbin/ifconfig/ifmac.c',
+ 'sbin/ifconfig/ifmedia.c',
+ 'sbin/ifconfig/ifpfsync.c',
+ 'sbin/ifconfig/ifvlan.c',
+ 'sbin/ping6/ping6.c',
+ 'sbin/ping/ping.c',
+ 'sbin/route/route.c',
+ 'usr.bin/netstat/atalk.c',
+ 'usr.bin/netstat/bpf.c',
+ 'usr.bin/netstat/if.c',
+ 'usr.bin/netstat/inet6.c',
+ 'usr.bin/netstat/inet.c',
+ 'usr.bin/netstat/ipsec.c',
+ 'usr.bin/netstat/main.c',
+ 'usr.bin/netstat/mbuf.c',
+ 'usr.bin/netstat/mroute6.c',
+ 'usr.bin/netstat/mroute.c',
+ 'usr.bin/netstat/route.c',
+ 'usr.bin/netstat/pfkey.c',
+ 'usr.bin/netstat/sctp.c',
+ 'usr.bin/netstat/unix.c',
]
)
@@ -2185,53 +2305,68 @@ in_cksum.addRTEMSHeaderFiles(
)
in_cksum.addCPUDependentHeaderFiles(
[
- 'arm/include/in_cksum.h',
- 'i386/include/in_cksum.h',
- 'mips/include/in_cksum.h',
- 'powerpc/include/in_cksum.h',
- 'sparc64/include/in_cksum.h',
+ 'sys/i386/include/in_cksum.h',
+ 'sys/mips/include/in_cksum.h',
+ 'sys/powerpc/include/in_cksum.h',
+ 'sys/sparc64/include/in_cksum.h',
]
)
-in_cksum.addCPUDependentSourceFiles(
- 'arm',
+in_cksum.addTargetSourceCPUDependentHeaderFiles(
+ [ 'arm', 'avr', 'bfin', 'h8300', 'lm32', 'm32c', 'm32r', 'm68k', 'nios2', 'sh', 'sparc', 'v850' ],
+ 'mips',
+ [
+ 'sys/mips/include/in_cksum.h',
+ ]
+)
+in_cksum.addTargetSourceCPUDependentSourceFiles(
+ [ 'arm', 'avr', 'bfin', 'h8300', 'lm32', 'm32c', 'm32r', 'm68k', 'nios2', 'sh', 'sparc', 'v850' ],
+ 'mips',
[
- 'arm/arm/in_cksum.c',
+ 'sys/mips/mips/in_cksum.c',
]
)
in_cksum.addCPUDependentSourceFiles(
'i386',
[
- 'i386/i386/in_cksum.c',
+ 'sys/i386/i386/in_cksum.c',
]
)
in_cksum.addCPUDependentSourceFiles(
'mips',
[
- 'mips/mips/in_cksum.c',
+ 'sys/mips/mips/in_cksum.c',
]
)
in_cksum.addCPUDependentSourceFiles(
'powerpc',
[
- 'powerpc/powerpc/in_cksum.c',
+ 'sys/powerpc/powerpc/in_cksum.c',
]
)
in_cksum.addCPUDependentSourceFiles(
'sparc',
[
- 'mips/mips/in_cksum.c',
+ 'sys/mips/mips/in_cksum.c',
]
)
in_cksum.addCPUDependentSourceFiles(
'sparc64',
[
- 'sparc64/sparc64/in_cksum.c',
+ 'sys/sparc64/sparc64/in_cksum.c',
]
)
+tests = Module('tests')
+tests.addTest('usb01', ['init', 'test-file-system'], False)
+tests.addTest('loopback01', ['test_main'])
+tests.addTest('netshell01', ['test_main', 'shellconfig', 'ns_parser_vars'])
+tests.addTest('swi01', ['init', 'swi_test'])
+tests.addTest('timeout01', ['init', 'timeout_test', 'timeout_helper'])
+tests.addTest('init01', ['test_main'])
+
# Register all the Module instances with the Module Manager
mm.addModule(rtems)
-mm.addModule(netDeps)
+mm.addModule(base)
mm.addModule(net)
mm.addModule(netinet)
mm.addModule(netinet6)
@@ -2243,8 +2378,6 @@ mm.addModule(altq)
mm.addModule(pf)
mm.addModule(devNet)
-mm.addModule(local)
-mm.addModule(devUsbBase)
mm.addModule(devUsb)
mm.addModule(devUsbQuirk)
mm.addModule(devUsbController)
@@ -2254,7 +2387,7 @@ mm.addModule(devUsbStorage)
#mm.addModule(devUsbNet)
# Add PCI
-mm.addModule(devPci)
+mm.addModule(pci)
# Add NIC devices
mm.addModule(devNic)
@@ -2270,16 +2403,20 @@ mm.addModule(devNic_broadcomm)
# Add in_chksum
mm.addModule(in_cksum)
+mm.addModule(userSpace)
+
+mm.addModule(tests)
+
# XXX TODO Check that no file is also listed in empty
# XXX TODO Check that no file in in two modules
# Perform the actual file manipulation
-if isForward == True:
- if isOnlyMakefile == False:
- mm.copyFromFreeBSDToRTEMS()
- mm.createMakefile()
+if isForward:
+ if not isOnlyMakefile:
+ mm.copyFromFreeBSDToRTEMS()
+ mm.createMakefile()
else:
- mm.copyFromRTEMSToFreeBSD()
+ mm.copyFromRTEMSToFreeBSD()
# Print a summary if changing files
if isDiffMode == False:
diff --git a/freebsd-userspace/Makefile b/freebsd-userspace/Makefile
deleted file mode 100644
index 7ff8ed5c..00000000
--- a/freebsd-userspace/Makefile
+++ /dev/null
@@ -1,357 +0,0 @@
-include ../config.inc
-
-include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
-include $(RTEMS_CUSTOM)
-include $(PROJECT_ROOT)/make/leaf.cfg
-
-CFLAGS += -Iinclude
-CFLAGS += -Irtems/include
-CFLAGS += -Ilib/libc/include
-CFLAGS += -Ilib/libc/resolv
-CFLAGS += -Ilib/netgraph
-CFLAGS += -Ilib/libmemstat
-CFLAGS += -Ilib/libutil
-CFLAGS += -Ilib/libkvm
-CFLAGS += -Isys
-CFLAGS += -Ilocal
-# XXX hack to find rpc
-CFLAGS += -I../services/librpc/include
-# nsparser needs this
-CFLAGS += -Ilib/libc/net
-
-CFLAGS += -I$(INSTALL_BASE)/include
-
-#Only needed for route
-# CFLAGS += -D__BSD_VISIBLE=1
-#Only Needed for db files
-CFLAGS += -D__DBINTERFACE_PRIVATE
-
-CFLAGS += -g
-CFLAGS += -w
-CFLAGS += -std=gnu99
-CFLAGS += -MT $@ -MD -MP -MF $(basename $@).d
-
-C_FILES =
-C_FILES += lib/libc/inet/inet_addr.c
-C_FILES += lib/libc/inet/inet_cidr_ntop.c
-C_FILES += lib/libc/inet/inet_cidr_pton.c
-C_FILES += lib/libc/inet/inet_lnaof.c
-C_FILES += lib/libc/inet/inet_makeaddr.c
-C_FILES += lib/libc/inet/inet_net_pton.c
-C_FILES += lib/libc/inet/inet_ntop.c
-C_FILES += lib/libc/inet/inet_neta.c
-C_FILES += lib/libc/inet/inet_net_ntop.c
-C_FILES += lib/libc/inet/inet_netof.c
-C_FILES += lib/libc/inet/inet_network.c
-C_FILES += lib/libc/inet/inet_ntoa.c
-C_FILES += lib/libc/inet/inet_pton.c
-C_FILES += lib/libc/inet/nsap_addr.c
-
-C_FILES += lib/libc/net/base64.c
-C_FILES += lib/libc/net/ether_addr.c
-C_FILES += lib/libc/net/getaddrinfo.c
-C_FILES += lib/libc/net/gethostbydns.c
-C_FILES += lib/libc/net/gethostbyht.c
-C_FILES += lib/libc/net/gethostbynis.c
-C_FILES += lib/libc/net/gethostnamadr.c
-C_FILES += lib/libc/net/getifaddrs.c
-C_FILES += lib/libc/net/getifmaddrs.c
-C_FILES += lib/libc/net/getnameinfo.c
-C_FILES += lib/libc/net/getnetbydns.c
-C_FILES += lib/libc/net/getnetbyht.c
-C_FILES += lib/libc/net/getnetbynis.c
-C_FILES += lib/libc/net/getnetnamadr.c
-C_FILES += lib/libc/net/getproto.c
-C_FILES += lib/libc/net/getprotoent.c
-C_FILES += lib/libc/net/getprotoname.c
-C_FILES += lib/libc/net/getservent.c
-C_FILES += lib/libc/net/nsdispatch.c
-C_FILES += lib/libc/net/gai_strerror.c
-# The following two /net files are generated
-C_FILES += lib/libc/net/nslexer.c
-C_FILES += lib/libc/net/nsparser.c
-C_FILES += lib/libc/gen/err.c
-C_FILES += lib/libc/gen/gethostname.c
-C_FILES += lib/libc/nameser/ns_name.c
-C_FILES += lib/libc/nameser/ns_netint.c
-C_FILES += lib/libc/nameser/ns_parse.c
-C_FILES += lib/libc/nameser/ns_print.c
-C_FILES += lib/libc/nameser/ns_samedomain.c
-C_FILES += lib/libc/nameser/ns_ttl.c
-C_FILES += lib/libc/net/if_indextoname.c
-C_FILES += lib/libc/net/if_nameindex.c
-C_FILES += lib/libc/net/if_nametoindex.c
-C_FILES += lib/libc/net/linkaddr.c
-ifneq ($(DISABLE_IPV6),yes)
-C_FILES += lib/libc/net/map_v4v6.c
-endif
-# This file is not IPV6 specific
-C_FILES += lib/libc/net/name6.c
-C_FILES += lib/libc/net/rcmd.c
-C_FILES += lib/libc/net/recv.c
-# C_FILES += lib/libc/net/send.c
-C_FILES += lib/libc/resolv/herror.c
-C_FILES += lib/libc/resolv/h_errno.c
-C_FILES += lib/libc/resolv/res_comp.c
-C_FILES += lib/libc/resolv/res_data.c
-C_FILES += lib/libc/resolv/res_debug.c
-C_FILES += lib/libc/resolv/res_findzonecut.c
-C_FILES += lib/libc/resolv/res_init.c
-C_FILES += lib/libc/resolv/res_mkquery.c
-C_FILES += lib/libc/resolv/res_mkupdate.c
-C_FILES += lib/libc/resolv/res_query.c
-C_FILES += lib/libc/resolv/res_send.c
-C_FILES += lib/libc/resolv/res_state.c
-C_FILES += lib/libc/resolv/res_update.c
-C_FILES += lib/libc/resolv/mtctxres.c
-C_FILES += lib/libc/string/strsep.c
-C_FILES += lib/libc/stdlib/strtonum.c
-
-C_FILES += lib/libc/isc/ev_streams.c
-C_FILES += lib/libc/isc/ev_timers.c
-
-C_FILES += lib/libc/stdio/fgetln.c
-
-C_FILES += lib/libc/db/db/db.c
-C_FILES += lib/libc/db/btree/bt_close.c
-C_FILES += lib/libc/db/btree/bt_get.c
-C_FILES += lib/libc/db/btree/bt_put.c
-C_FILES += lib/libc/db/btree/bt_utils.c
-C_FILES += lib/libc/db/btree/bt_conv.c
-C_FILES += lib/libc/db/btree/bt_open.c
-C_FILES += lib/libc/db/btree/bt_search.c
-C_FILES += lib/libc/db/btree/bt_debug.c
-C_FILES += lib/libc/db/btree/bt_overflow.c
-C_FILES += lib/libc/db/btree/bt_seq.c
-C_FILES += lib/libc/db/btree/bt_delete.c
-C_FILES += lib/libc/db/btree/bt_page.c
-C_FILES += lib/libc/db/btree/bt_split.c
-C_FILES += lib/libc/db/recno/rec_close.c
-C_FILES += lib/libc/db/recno/rec_get.c
-C_FILES += lib/libc/db/recno/rec_put.c
-C_FILES += lib/libc/db/recno/rec_seq.c
-C_FILES += lib/libc/db/recno/rec_delete.c
-C_FILES += lib/libc/db/recno/rec_open.c
-C_FILES += lib/libc/db/recno/rec_search.c
-C_FILES += lib/libc/db/recno/rec_utils.c
-
-C_FILES += lib/libc/db/mpool/mpool.c
-
-# libmemstat
-C_FILES += lib/libmemstat/memstat_all.c
-C_FILES += lib/libmemstat/memstat.c
-C_FILES += lib/libmemstat/memstat_malloc.c
-C_FILES += lib/libmemstat/memstat_uma.c
-
-# libutil
-C_FILES += lib/libutil/expand_number.c
-C_FILES += lib/libutil/humanize_number.c
-C_FILES += lib/libutil/trimdomain.c
-
-# libipsec files
-C_FILES += lib/libipsec/pfkey_dump.c
-# Has a main and may or may not be needed
-# C_FILES += lib/libipsec/test-policy.c
-C_FILES += lib/libipsec/pfkey.c
-C_FILES += lib/libipsec/ipsec_strerror.c
-C_FILES += lib/libipsec/ipsec_get_policylen.c
-C_FILES += lib/libipsec/ipsec_dump_policy.c
-# The following two /net files are generated
-C_FILES += lib/libipsec/policy_token.c
-C_FILES += lib/libipsec/policy_parse.c
-
-C_FILES += lib/libc_r/uthread/uthread_select.c
-C_FILES += lib/libc_r/uthread/uthread_kern.c
-
-# RTEMS Specific Files
-# C_FILES += rtems/rtems-net-setup.c
-C_FILES += rtems/syslog.c
-C_FILES += rtems/rtems-kvm.c
-C_FILES += rtems/rtems-kvm-symbols.c
-C_FILES += rtems/rtems-syslog-initialize.c
-C_FILES += rtems/rtems-getprogname.c
-C_FILES += rtems/rtems-uthread_kevent.c
-C_FILES += rtems/rtems-uthread_kqueue.c
-C_FILES += rtems/rtems-shell.c
-C_FILES += rtems/rtems-syspoll.c
-C_FILES += rtems/rtems-uthread_init.c
-C_FILES += rtems/rtems-get_curthread.c
-
-# ping command sources
-C_FILES += commands/sbin/ping/ping.c
-ifneq ($(DISABLE_IPV6),yes)
-C_FILES += commands/sbin/ping6/ping6.c
-endif
-
-# route command sources
-C_FILES += commands/sbin/route/route.c
-
-# dhclient command sources
-C_FILES += commands/sbin/dhclient/alloc.c
-C_FILES += commands/sbin/dhclient/bpf.c
-C_FILES += commands/sbin/dhclient/clparse.c
-C_FILES += commands/sbin/dhclient/conflex.c
-C_FILES += commands/sbin/dhclient/convert.c
-C_FILES += commands/sbin/dhclient/dhclient.c
-C_FILES += commands/sbin/dhclient/dispatch.c
-C_FILES += commands/sbin/dhclient/errwarn.c
-C_FILES += commands/sbin/dhclient/hash.c
-C_FILES += commands/sbin/dhclient/inet.c
-C_FILES += commands/sbin/dhclient/options.c
-C_FILES += commands/sbin/dhclient/packet.c
-C_FILES += commands/sbin/dhclient/parse.c
-C_FILES += commands/sbin/dhclient/privsep.c
-C_FILES += commands/sbin/dhclient/tables.c
-C_FILES += commands/sbin/dhclient/tree.c
-
-# ifconfig command sources
-# UNUSED IFCONFIG_C_FILES += commands/sbin/ifconfig/af_atalk.c
-IFCONFIG_C_FILES += commands/sbin/ifconfig/af_inet.c
-IFCONFIG_C_FILES += commands/sbin/ifconfig/af_link.c
-IFCONFIG_C_FILES += commands/sbin/ifconfig/ifbridge.c
-IFCONFIG_C_FILES += commands/sbin/ifconfig/ifclone.c
-IFCONFIG_C_FILES += commands/sbin/ifconfig/ifgif.c
-IFCONFIG_C_FILES += commands/sbin/ifconfig/ifgroup.c
-IFCONFIG_C_FILES += commands/sbin/ifconfig/iflagg.c
-IFCONFIG_C_FILES += commands/sbin/ifconfig/ifmedia.c
-IFCONFIG_C_FILES += commands/sbin/ifconfig/ifvlan.c
-ifneq ($(DISABLE_IPV6),yes)
-IFCONFIG_C_FILES += commands/sbin/ifconfig/af_inet6.c
-IFCONFIG_C_FILES += commands/sbin/ifconfig/af_nd6.c
-endif
-IFCONFIG_C_FILES += commands/sbin/ifconfig/ifcarp.c
-IFCONFIG_C_FILES += commands/sbin/ifconfig/ifconfig.c
-IFCONFIG_C_FILES += commands/sbin/ifconfig/ifgre.c
-# UNUSED IFCONFIG_C_FILES += commands/sbin/ifconfig/ifieee80211.c
-# UNUSED IFCONFIG_C_FILES += commands/sbin/ifconfig/ifmac.c
-IFCONFIG_C_FILES += commands/sbin/ifconfig/ifpfsync.c
-
-# The following two files were left out to avoid
-# porting issues. regdomain uses an xml parser
-# that is not part of the standard release and
-# af_ipx uses thread0 which we are trying to avoid
-# pulling in.
-#
-# C_FILES += commands/sbin/ifconfig/regdomain.c
-# C_FILES += commands/sbin/ifconfig/af_ipx.c
-
-# netstat command sources
-# no need to support AppleTalk yet
-# NETSTAT_C_FILES += commands/usr.bin/netstat/atalk.c
-NETSTAT_C_FILES += commands/usr.bin/netstat/bpf.c
-NETSTAT_C_FILES += commands/usr.bin/netstat/if.c
-ifneq ($(DISABLE_IPV6),yes)
-NETSTAT_C_FILES += commands/usr.bin/netstat/inet6.c
-endif
-NETSTAT_C_FILES += commands/usr.bin/netstat/inet.c
-NETSTAT_C_FILES += commands/usr.bin/netstat/ipsec.c
-# no need to support IPX yet
-# NETSTAT_C_FILES += commands/usr.bin/netstat/ipx.c
-NETSTAT_C_FILES += commands/usr.bin/netstat/main.c
-# XXX does not compile yet
-NETSTAT_C_FILES += commands/usr.bin/netstat/mbuf.c
-ifneq ($(DISABLE_IPV6),yes)
-NETSTAT_C_FILES += commands/usr.bin/netstat/mroute6.c
-endif
-NETSTAT_C_FILES += commands/usr.bin/netstat/mroute.c
-# Disable netgraph support - this is a long thread to pull
-# NETSTAT_C_FILES += commands/usr.bin/netstat/netgraph.c
-NETSTAT_C_FILES += commands/usr.bin/netstat/pfkey.c
-# Actually just route.c in FreeBSD
-NETSTAT_C_FILES += commands/usr.bin/netstat/netstat_route.c
-NETSTAT_C_FILES += commands/usr.bin/netstat/sctp.c
-NETSTAT_C_FILES += commands/usr.bin/netstat/unix.c
-
-C_O_FILES = $(C_FILES:%.c=%.o)
-C_D_FILES = $(C_FILES:%.c=%.d)
-
-IFCONFIG_C_O_FILES = $(IFCONFIG_C_FILES:%.c=%.o)
-IFCONFIG_C_D_FILES = $(IFCONFIG_C_FILES:%.c=%.d)
-
-NETSTAT_C_O_FILES = $(NETSTAT_C_FILES:%.c=%.o)
-NETSTAT_C_D_FILES = $(NETSTAT_C_FILES:%.c=%.d)
-
-LIB = libbsdc.a
-IFCONFIG = commands/sbin/ifconfig/ifconfig.rel
-NETSTAT = commands/usr.bin/netstat/netstat.rel
-
-COMMAND_RELS = $(NETSTAT) $(IFCONFIG)
-
-GEN_FILES = rtems/rtems-kvm-symbols.c
-GEN_FILES += include/rpc/rpcb_prot.h
-GEN_FILES += commands/sbin/route/keywords.h
-# lib/libc/net
-GEN_FILES += lib/libc/net/nslexer.c
-GEN_FILES += lib/libc/net/nsparser.c
-CLEAN_FILES = lib/libc/net/nsparser.i
-CLEAN_FILES += lib/libc/net/y.tab.h
-
-# lib/libipsec
-GEN_FILES += lib/libipsec/policy_token.c
-GEN_FILES += lib/libipsec/policy_parse.c
-CLEAN_FILES += lib/libipsec/policy_parse.i
-CLEAN_FILES += lib/libipsec/y.tab.h
-
-all: $(LIB)
-
-$(LIB): $(GEN_FILES) $(C_O_FILES) $(COMMAND_RELS)
- $(AR) rcu $@ $^
-
-$(IFCONFIG): $(IFCONFIG_C_O_FILES)
- $(LD) -r -o $@ $^
-
-$(NETSTAT): $(NETSTAT_C_O_FILES)
- $(LD) -r -o $@ $^
-
-rtems/rtems-kvm-symbols.c: rtems/generate_kvm_symbols
- ./rtems/generate_kvm_symbols >rtems/rtems-kvm-symbols.c
-
-include/rpc/rpcb_prot.h: include/rpc/rpcb_prot.x
- rm -f include/rpc/rpcb_prot.h
- rpcgen -h -o include/rpc/rpcb_prot.h include/rpc/rpcb_prot.x
-
-commands/sbin/route/keywords.h: commands/sbin/route/keywords
- sed -e '/^#/d' -e '/^$$/d' commands/sbin/route//keywords > _keywords.tmp
- LC_ALL=C tr 'a-z' 'A-Z' < _keywords.tmp | paste _keywords.tmp - | \
- awk '{ \
- if (NF > 1) \
- printf "#define\tK_%s\t%d\n\t{\"%s\", K_%s},\n", \
- $$2, NR, $$1, $$2 }' \
- > commands/sbin/route/keywords.h
- rm -f _keywords.tmp
-
-# lib/libc/net Yacc and lex files
-lib/libc/net/nslexer.c: lib/libc/net/nslexer.l
- make -C lib/libc/net nslexer.c
-
-lib/libc/net/nsparser.c: lib/libc/net/nsparser.y
- make -C lib/libc/net nsparser.c
-
-# libipsec Yacc and lex files
-lib/libipsec/policy_token.c: lib/libipsec/policy_token.l
- make -C lib/libipsec policy_token.c
-
-lib/libipsec/policy_parse.c: lib/libipsec/policy_parse.y
- make -C lib/libipsec policy_parse.c
-
-install: $(LIB)
- install -d $(INSTALL_BASE)/include
- cd include; for i in `find . -name '*.h'` ; do \
- install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done
- cd rtems/include; for i in `find . -name '*.h'` ; do \
- install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done
- cd local; for i in `find . -name '*.h'` ; do \
- install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done
- cd sys; for i in `find . -name '*.h'` ; do \
- install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done
- install -c -m 644 $(LIB) $(INSTALL_BASE)
-
-clean:
- rm -f $(LIB) $(GEN_FILES) $(CLEAN_FILES)
- rm -f $(C_O_FILES) $(IFCONFIG_C_O_FILES) $(NETSTAT_C_O_FILES)
- rm -f $(C_D_FILES) $(IFCONFIG_C_D_FILES) $(NETSTAT_C_D_FILES)
-
--include $(C_D_FILES)
-
-doc:
-
diff --git a/freebsd-userspace/README b/freebsd-userspace/README
deleted file mode 100644
index 9aca0187..00000000
--- a/freebsd-userspace/README
+++ /dev/null
@@ -1,11 +0,0 @@
-
-The following describes the contents of this directory:
-
-from-freebsd.sh - this script
-include - From FreeBSD 8.2 include
-lib - From FreeBSD 8.2 lib
-local - Mix of hand and autogenerated
-Makefile - Hand written Makefile
-sys - From FreeBSD 8.2 sys
-
-
diff --git a/freebsd-userspace/commands/sbin/dhclient/dhclient-script b/freebsd-userspace/commands/sbin/dhclient/dhclient-script
deleted file mode 100644
index c457bf46..00000000
--- a/freebsd-userspace/commands/sbin/dhclient/dhclient-script
+++ /dev/null
@@ -1,384 +0,0 @@
-#!/bin/sh
-#
-# $OpenBSD: dhclient-script,v 1.6 2004/05/06 18:22:41 claudio Exp $
-# $FreeBSD$
-#
-# Copyright (c) 2003 Kenneth R Westerback <krw@openbsd.org>
-#
-# Permission to use, copy, modify, and distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#
-#
-
-ARP=/usr/sbin/arp
-HOSTNAME=/bin/hostname
-IFCONFIG='/sbin/ifconfig -n'
-
-LOCALHOST=127.0.0.1
-
-if [ -x /usr/bin/logger ]; then
- LOGGER="/usr/bin/logger -s -p user.notice -t dhclient"
-else
- LOGGER=echo
-fi
-
-#
-# Helper functions that implement common actions.
-#
-
-check_hostname() {
- current_hostname=`$HOSTNAME`
- if [ -z "$current_hostname" ]; then
- $LOGGER "New Hostname ($interface): $new_host_name"
- $HOSTNAME $new_host_name
- elif [ "$current_hostname" = "$old_host_name" -a \
- "$new_host_name" != "$old_host_name" ]; then
- $LOGGER "New Hostname ($interface): $new_host_name"
- $HOSTNAME $new_host_name
- fi
-}
-
-arp_flush() {
- arp -an -i $interface | \
- sed -n -e 's/^.*(\(.*\)) at .*$/arp -d \1/p' | \
- sh >/dev/null 2>&1
-}
-
-delete_old_address() {
- eval "$IFCONFIG $interface inet -alias $old_ip_address $medium"
-}
-
-add_new_address() {
- eval "$IFCONFIG $interface \
- inet $new_ip_address \
- netmask $new_subnet_mask \
- broadcast $new_broadcast_address \
- $medium"
-
- $LOGGER "New IP Address ($interface): $new_ip_address"
- $LOGGER "New Subnet Mask ($interface): $new_subnet_mask"
- $LOGGER "New Broadcast Address ($interface): $new_broadcast_address"
- $LOGGER "New Routers ($interface): $new_routers"
-}
-
-delete_old_alias() {
- if [ -n "$alias_ip_address" ]; then
- $IFCONFIG $interface inet -alias $alias_ip_address > /dev/null 2>&1
- #route delete $alias_ip_address $LOCALHOST > /dev/null 2>&1
- fi
-}
-
-add_new_alias() {
- if [ -n "$alias_ip_address" ]; then
- $IFCONFIG $interface inet alias $alias_ip_address netmask \
- $alias_subnet_mask
- #route add $alias_ip_address $LOCALHOST
- fi
-}
-
-fill_classless_routes() {
- set $1
- while [ $# -ge 5 ]; do
- if [ $1 -eq 0 ]; then
- route="default"
- elif [ $1 -le 8 ]; then
- route="$2.0.0.0/$1"
- shift
- elif [ $1 -le 16 ]; then
- route="$2.$3.0.0/$1"
- shift; shift
- elif [ $1 -le 24 ]; then
- route="$2.$3.$4.0/$1"
- shift; shift; shift
- else
- route="$2.$3.$4.$5/$1"
- shift; shift; shift; shift
- fi
- shift
- router="$1.$2.$3.$4"
- classless_routes="$classless_routes $route $router"
- shift; shift; shift; shift
- done
-}
-
-delete_old_routes() {
- #route delete "$old_ip_address" $LOCALHOST >/dev/null 2>&1
- if [ -n "$old_classless_routes" ]; then
- fill_classless_routes "$old_classless_routes"
- set $classless_routes
- while [ $# -gt 1 ]; do
- route delete "$1" "$2"
- shift; shift
- done
- return 0;
- fi
-
- # If we supported multiple default routes, we'd be removing each
- # one here. We don't so just delete the default route if it's
- # through our interface.
- if is_default_interface; then
- route delete default >/dev/null 2>&1
- fi
-
- if [ -n "$old_static_routes" ]; then
- set $old_static_routes
- while [ $# -gt 1 ]; do
- route delete "$1" "$2"
- shift; shift
- done
- fi
-
- arp_flush
-}
-
-add_new_routes() {
- #route add $new_ip_address $LOCALHOST >/dev/null 2>&1
-
- # RFC 3442: If the DHCP server returns both a Classless Static
- # Routes option and a Router option, the DHCP client MUST ignore
- # the Router option.
- #
- # DHCP clients that support this option (Classless Static Routes)
- # MUST NOT install the routes specified in the Static Routes
- # option (option code 33) if both a Static Routes option and the
- # Classless Static Routes option are provided.
-
- if [ -n "$new_classless_routes" ]; then
- fill_classless_routes "$new_classless_routes"
- $LOGGER "New Classless Static Routes ($interface): $classless_routes"
- set $classless_routes
- while [ $# -gt 1 ]; do
- if [ "0.0.0.0" = "$2" ]; then
- route add "$1" -iface "$interface"
- else
- route add "$1" "$2"
- fi
- shift; shift
- done
- return
- fi
-
- for router in $new_routers; do
- if is_default_interface; then
-
- if [ "$new_ip_address" = "$router" ]; then
- route add default -iface $router >/dev/null 2>&1
- else
- route add default $router >/dev/null 2>&1
- fi
- fi
- # 2nd and subsequent default routers error out, so explicitly
- # stop processing the list after the first one.
- break
- done
-
- if [ -n "$new_static_routes" ]; then
- $LOGGER "New Static Routes ($interface): $new_static_routes"
- set $new_static_routes
- while [ $# -gt 1 ]; do
- route add $1 $2
- shift; shift
- done
- fi
-}
-
-add_new_resolv_conf() {
- # XXX Old code did not create/update resolv.conf unless both
- # $new_domain_name and $new_domain_name_servers were provided. PR
- # #3135 reported some ISP's only provide $new_domain_name_servers and
- # thus broke the script. This code creates the resolv.conf if either
- # are provided.
-
- local tmpres=/var/run/resolv.conf.${interface}
- rm -f $tmpres
-
- if [ -n "$new_domain_name" ]; then
- echo "search $new_domain_name" >>$tmpres
- fi
-
- if [ -n "$new_domain_name_servers" ]; then
- for nameserver in $new_domain_name_servers; do
- echo "nameserver $nameserver" >>$tmpres
- done
- fi
-
- if [ -f $tmpres ]; then
- if [ -f /etc/resolv.conf.tail ]; then
- cat /etc/resolv.conf.tail >>$tmpres
- fi
-
- # When resolv.conf is not changed actually, we don't
- # need to update it.
- # If /usr is not mounted yet, we cannot use cmp, then
- # the following test fails. In such case, we simply
- # ignore an error and do update resolv.conf.
- if cmp -s $tmpres /etc/resolv.conf; then
- rm -f $tmpres
- return 0
- fi 2>/dev/null
-
- # In case (e.g. during OpenBSD installs) /etc/resolv.conf
- # is a symbolic link, take care to preserve the link and write
- # the new data in the correct location.
-
- if [ -f /etc/resolv.conf ]; then
- cat /etc/resolv.conf > /etc/resolv.conf.save
- fi
- cat $tmpres > /etc/resolv.conf
- rm -f $tmpres
-
- # Try to ensure correct ownership and permissions.
- chown -RL root:wheel /etc/resolv.conf
- chmod -RL 644 /etc/resolv.conf
-
- return 0
- fi
-
- return 1
-}
-
-# Must be used on exit. Invokes the local dhcp client exit hooks, if any.
-exit_with_hooks() {
- exit_status=$1
- if [ -f /etc/dhclient-exit-hooks ]; then
- . /etc/dhclient-exit-hooks
- fi
- # probably should do something with exit status of the local script
- exit $exit_status
-}
-
-# Get the interface with the current ipv4 default route on it using only
-# commands that are available prior to /usr being mounted.
-is_default_interface()
-{
- routeget="`route -n get -inet default`"
- oldifs="$IFS"
- IFS="
-"
- defif=
- for line in $routeget ; do
- case $line in
- *interface:*)
- defif=${line##*: }
- ;;
- esac
- done
- IFS=${oldifs}
-
- if [ -z "$defif" -o "$defif" = "$interface" ]; then
- return 0
- else
- return 1
- fi
-}
-
-#
-# Start of active code.
-#
-
-# Invoke the local dhcp client enter hooks, if they exist.
-if [ -f /etc/dhclient-enter-hooks ]; then
- exit_status=0
- . /etc/dhclient-enter-hooks
- # allow the local script to abort processing of this state
- # local script must set exit_status variable to nonzero.
- if [ $exit_status -ne 0 ]; then
- exit $exit_status
- fi
-fi
-
-case $reason in
-MEDIUM)
- eval "$IFCONFIG $interface $medium"
- eval "$IFCONFIG $interface inet -alias 0.0.0.0 $medium" >/dev/null 2>&1
- sleep 1
- ;;
-
-PREINIT)
- delete_old_alias
- $IFCONFIG $interface inet alias 0.0.0.0 netmask 0.0.0.0 broadcast 255.255.255.255 up
- ;;
-
-ARPCHECK|ARPSEND)
- ;;
-
-BOUND|RENEW|REBIND|REBOOT)
- check_hostname
- if [ -n "$old_ip_address" ]; then
- if [ "$old_ip_address" != "$alias_ip_address" ]; then
- delete_old_alias
- fi
- if [ "$old_ip_address" != "$new_ip_address" ]; then
- delete_old_address
- delete_old_routes
- fi
- fi
- if [ "$reason" = BOUND ] || \
- [ "$reason" = REBOOT ] || \
- [ -z "$old_ip_address" ] || \
- [ "$old_ip_address" != "$new_ip_address" ]; then
- add_new_address
- add_new_routes
- fi
- if [ "$new_ip_address" != "$alias_ip_address" ]; then
- add_new_alias
- fi
- if is_default_interface; then
- add_new_resolv_conf
- fi
- ;;
-
-EXPIRE|FAIL)
- delete_old_alias
- if [ -n "$old_ip_address" ]; then
- delete_old_address
- delete_old_routes
- fi
- if [ -x $ARP ]; then
- $ARP -d -a -i $interface
- fi
- # XXX Why add alias we just deleted above?
- add_new_alias
- if is_default_interface; then
- if [ -f /etc/resolv.conf.save ]; then
- cat /etc/resolv.conf.save > /etc/resolv.conf
- fi
- fi
- ;;
-
-TIMEOUT)
- delete_old_alias
- add_new_address
- sleep 1
- if [ -n "$new_routers" ]; then
- $LOGGER "New Routers ($interface): $new_routers"
- set "$new_routers"
- if ping -q -c 1 -t 1 "$1"; then
- if [ "$new_ip_address" != "$alias_ip_address" ]; then
- add_new_alias
- fi
- add_new_routes
- if ! is_default_interface; then
- exit_with_hooks 0
- fi
- if add_new_resolv_conf; then
- exit_with_hooks 0
- fi
- fi
- fi
- eval "$IFCONFIG $interface inet -alias $new_ip_address $medium"
- delete_old_routes
- exit_with_hooks 1
- ;;
-esac
-
-exit_with_hooks 0
diff --git a/freebsd-userspace/commands/sbin/dhclient/dhclient-script.8 b/freebsd-userspace/commands/sbin/dhclient/dhclient-script.8
deleted file mode 100644
index 89d43cb7..00000000
--- a/freebsd-userspace/commands/sbin/dhclient/dhclient-script.8
+++ /dev/null
@@ -1,297 +0,0 @@
-.\" $OpenBSD: dhclient-script.8,v 1.2 2004/04/09 18:30:15 jmc Exp $
-.\"
-.\" Copyright (c) 1997 The Internet Software Consortium.
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of The Internet Software Consortium nor the names
-.\" of its contributors may be used to endorse or promote products derived
-.\" from this software without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
-.\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
-.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-.\" DISCLAIMED. IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
-.\" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" This software has been written for the Internet Software Consortium
-.\" by Ted Lemon <mellon@fugue.com> in cooperation with Vixie
-.\" Enterprises. To learn more about the Internet Software Consortium,
-.\" see ``http://www.isc.org/isc''. To learn more about Vixie
-.\" Enterprises, see ``http://www.vix.com''.
-.\"
-.\" $FreeBSD$
-.\"
-.Dd September 6, 2010
-.Dt DHCLIENT-SCRIPT 8
-.Os
-.Sh NAME
-.Nm dhclient-script
-.Nd DHCP client network configuration script
-.Sh DESCRIPTION
-The DHCP client network configuration script is invoked from time to
-time by
-.Xr dhclient 8 .
-This script is used by the DHCP client to set each interface's initial
-configuration prior to requesting an address, to test the address once it
-has been offered, and to set the interface's final configuration once a
-lease has been acquired.
-If no lease is acquired, the script is used to test predefined leases, if
-any, and also called once if no valid lease can be identified.
-.Pp
-.\" No standard client script exists for some operating systems, even though
-.\" the actual client may work, so a pioneering user may well need to create
-.\" a new script or modify an existing one.
-In general, customizations specific to a particular computer should be done
-in the
-.Pa /etc/dhclient.conf
-file.
-.Sh OPERATION
-When
-.Xr dhclient 8
-needs to invoke the client configuration script, it sets up a number of
-environment variables and runs
-.Nm .
-In all cases,
-.Va $reason
-is set to the name of the reason why the script has been invoked.
-The following reasons are currently defined:
-.Li MEDIUM , PREINIT , ARPCHECK , ARPSEND , BOUND , RENEW , REBIND , REBOOT ,
-.Li EXPIRE , FAIL
-and
-.Li TIMEOUT .
-.Bl -tag -width ".Li ARPCHECK"
-.It Li MEDIUM
-The DHCP client is requesting that an interface's media type be set.
-The interface name is passed in
-.Va $interface ,
-and the media type is passed in
-.Va $medium .
-.It Li PREINIT
-The DHCP client is requesting that an interface be configured as
-required in order to send packets prior to receiving an actual address.
-.\" For clients which use the BSD socket library,
-This means configuring the interface with an IP address of 0.0.0.0
-and a broadcast address of 255.255.255.255.
-.\" For other clients, it may be possible to simply configure the interface up
-.\" without actually giving it an IP address at all.
-The interface name is passed in
-.Va $interface ,
-and the media type in
-.Va $medium .
-.Pp
-If an IP alias has been declared in
-.Xr dhclient.conf 5 ,
-its address will be passed in
-.Va $alias_ip_address ,
-and that IP alias should be deleted from the interface,
-along with any routes to it.
-.It Li ARPSEND
-The DHCP client is requesting that an address that has been offered to
-it be checked to see if somebody else is using it, by sending an ARP
-request for that address.
-It is not clear how to implement this, so no examples exist yet.
-The IP address to check is passed in
-.Va $new_ip_address ,
-and the interface name is passed in
-.Va $interface .
-.It Li ARPCHECK
-The DHCP client wants to know if a response to the ARP request sent
-using
-.Li ARPSEND
-has been received.
-If one has, the script should exit with a nonzero status, indicating that
-the offered address has already been requested and should be declined.
-The
-.Va $new_ip_address
-and
-.Va $interface
-variables are set as with
-.Li ARPSEND .
-.It Li BOUND
-The DHCP client has done an initial binding to a new address.
-The new IP address is passed in
-.Va $new_ip_address ,
-and the interface name is passed in
-.Va $interface .
-The media type is passed in
-.Va $medium .
-Any options acquired from the server are passed using the option name
-described in
-.Xr dhcp-options 5 ,
-except that dashes
-.Pq Ql -
-are replaced by underscores
-.Pq Ql _
-in order to make valid shell variables, and the variable names start with
-.Dq Li new_ .
-So for example, the new subnet mask would be passed in
-.Va $new_subnet_mask .
-.Pp
-When a binding has been completed, a lot of network parameters are
-likely to need to be set up.
-A new
-.Pa /etc/resolv.conf
-needs to be created, using the values of
-.Va $new_domain_name
-and
-.Va $new_domain_name_servers
-(which may list more than one server, separated by spaces).
-A default route should be set using
-.Va $new_routers ,
-and static routes may need to be set up using
-.Va $new_static_routes .
-.Pp
-If an IP alias has been declared, it must be set up here.
-The alias IP address will be written as
-.Va $alias_ip_address ,
-and other DHCP options that are set for the alias (e.g., subnet mask)
-will be passed in variables named as described previously except starting with
-.Dq Li $alias_
-instead of
-.Dq Li $new_ .
-Care should be taken that the alias IP address not be used if it is identical
-to the bound IP address
-.Pq Va $new_ip_address ,
-since the other alias parameters may be incorrect in this case.
-.It Li RENEW
-When a binding has been renewed, the script is called as in
-.Li BOUND ,
-except that in addition to all the variables starting with
-.Dq Li $new_ ,
-there is another set of variables starting with
-.Dq Li $old_ .
-Persistent settings that may have changed need to be deleted - for example,
-if a local route to the bound address is being configured, the old local
-route should be deleted.
-If the default route has changed, the old default route should be deleted.
-If the static routes have changed, the old ones should be deleted.
-Otherwise, processing can be done as with
-.Li BOUND .
-.It Li REBIND
-The DHCP client has rebound to a new DHCP server.
-This can be handled as with
-.Li RENEW ,
-except that if the IP address has changed,
-the ARP table should be cleared.
-.It Li REBOOT
-The DHCP client has successfully reacquired its old address after a reboot.
-This can be processed as with
-.Li BOUND .
-.It Li EXPIRE
-The DHCP client has failed to renew its lease or acquire a new one,
-and the lease has expired.
-The IP address must be relinquished, and all related parameters should be
-deleted, as in
-.Li RENEW
-and
-.Li REBIND .
-.It Li FAIL
-The DHCP client has been unable to contact any DHCP servers, and any
-leases that have been tested have not proved to be valid.
-The parameters from the last lease tested should be deconfigured.
-This can be handled in the same way as
-.Li EXPIRE .
-.It Li TIMEOUT
-The DHCP client has been unable to contact any DHCP servers.
-However, an old lease has been identified, and its parameters have
-been passed in as with
-.Li BOUND .
-The client configuration script should test these parameters and,
-if it has reason to believe they are valid, should exit with a value of zero.
-If not, it should exit with a nonzero value.
-.El
-.Pp
-Before taking action according to
-.Va $reason ,
-.Nm
-will check for the existence of
-.Pa /etc/dhclient-enter-hooks .
-If found, it will be sourced
-.Pq see Xr sh 1 .
-After taking action according to
-.Va $reason ,
-.Nm
-will check for the existence of
-.Pa /etc/dhclient-exit-hooks .
-If found, it will be sourced
-.Pq see Xr sh 1 .
-These hooks scripts can be used to dynamically modify the enviornment at
-appropriate times during the DHCP negotiations.
-For example, if the administrator wishes to disable alias IP numbers on
-the DHCP interface, they might want to put the following in
-.Pa /etc/dhclient-enter-hooks :
-.Bd -literal -offset indent
-[ ."$reason" = .PREINIT ] && ifconfig $interface 0.0.0.0
-.Ed
-.Pp
-The usual way to test a lease is to set up the network as with
-.Li REBIND
-(since this may be called to test more than one lease) and then ping
-the first router defined in
-.Va $routers .
-If a response is received, the lease must be valid for the network to
-which the interface is currently connected.
-It would be more complete to try to ping all of the routers listed in
-.Va $new_routers ,
-as well as those listed in
-.Va $new_static_routes ,
-but current scripts do not do this.
-.\" .Sh FILES
-.\" Each operating system should generally have its own script file,
-.\" although the script files for similar operating systems may be similar
-.\" or even identical.
-.\" The script files included in the Internet Software Consortium DHCP
-.\" distribution appear in the distribution tree under client/scripts,
-.\" and bear the names of the operating systems on which they are intended
-.\" to work.
-.Sh SEE ALSO
-.Xr sh 1 ,
-.Xr dhclient.conf 5 ,
-.Xr dhclient.leases 5 ,
-.Xr dhclient 8 ,
-.Xr dhcpd 8 ,
-.Xr dhcrelay 8
-.Sh AUTHORS
-.An -nosplit
-The original version of
-.Nm
-was written for the Internet Software Consortium by
-.An Ted Lemon Aq mellon@fugue.com
-in cooperation with Vixie Enterprises.
-.Pp
-The
-.Ox
-implementation of
-.Nm
-was written by
-.An Kenneth R. Westerback Aq krw@openbsd.org .
-.Sh BUGS
-If more than one interface is being used, there is no obvious way to
-avoid clashes between server-supplied configuration parameters - for
-example, the stock
-.Nm
-rewrites
-.Pa /etc/resolv.conf .
-If more than one interface is being configured,
-.Pa /etc/resolv.conf
-will be repeatedly initialized to the values provided by one server, and then
-the other.
-Assuming the information provided by both servers is valid, this should not
-cause any real problems, but it could be confusing.
diff --git a/freebsd-userspace/commands/sbin/dhclient/dhclient.8 b/freebsd-userspace/commands/sbin/dhclient/dhclient.8
deleted file mode 100644
index 58f5ddd3..00000000
--- a/freebsd-userspace/commands/sbin/dhclient/dhclient.8
+++ /dev/null
@@ -1,191 +0,0 @@
-.\" $OpenBSD: dhclient.8,v 1.3 2004/04/09 18:30:15 jmc Exp $
-.\"
-.\" Copyright (c) 1997 The Internet Software Consortium.
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of The Internet Software Consortium nor the names
-.\" of its contributors may be used to endorse or promote products derived
-.\" from this software without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
-.\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
-.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-.\" DISCLAIMED. IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
-.\" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" This software has been written for the Internet Software Consortium
-.\" by Ted Lemon <mellon@fugue.com> in cooperation with Vixie
-.\" Enterprises. To learn more about the Internet Software Consortium,
-.\" see ``http://www.isc.org/isc''. To learn more about Vixie
-.\" Enterprises, see ``http://www.vix.com''.
-.\"
-.\" $FreeBSD$
-.\"
-.Dd August 13, 2007
-.Dt DHCLIENT 8
-.Os
-.Sh NAME
-.Nm dhclient
-.Nd "Dynamic Host Configuration Protocol (DHCP) client"
-.Sh SYNOPSIS
-.Nm
-.Op Fl bdqu
-.Op Fl c Ar file
-.Op Fl l Ar file
-.Ar interface
-.Sh DESCRIPTION
-The
-.Nm
-utility provides a means for configuring network interfaces using DHCP, BOOTP,
-or if these protocols fail, by statically assigning an address.
-.Pp
-The name of the network interface that
-.Nm
-should attempt to
-configure must be specified on the command line.
-.Pp
-The options are as follows:
-.Bl -tag -width ".Fl c Ar file"
-.It Fl b
-Forces
-.Nm
-to immediately move to the background.
-.It Fl c Ar file
-Specify an alternate location,
-.Ar file ,
-for the configuration file.
-.It Fl d
-Forces
-.Nm
-to always run as a foreground process.
-By default,
-.Nm
-runs in the foreground until it has configured the interface, and then
-will revert to running in the background.
-.It Fl l Ar file
-Specify an alternate location,
-.Ar file ,
-for the leases file.
-.It Fl q
-Forces
-.Nm
-to be less verbose on startup.
-.It Fl u
-Forces
-.Nm
-to reject leases with unknown options in them.
-The default behaviour is to accept such lease offers.
-.El
-.Pp
-The DHCP protocol allows a host to contact a central server which
-maintains a list of IP addresses which may be assigned on one or more
-subnets.
-A DHCP client may request an address from this pool, and
-then use it on a temporary basis for communication on the network.
-The DHCP protocol also provides a mechanism whereby a client can learn
-important details about the network to which it is attached, such as
-the location of a default router, the location of a name server, and
-so on.
-.Pp
-On startup,
-.Nm
-reads
-.Pa /etc/dhclient.conf
-for configuration instructions.
-It then gets a list of all the
-network interfaces that are configured in the current system.
-It then attempts to configure each interface with DHCP.
-.Pp
-In order to keep track of leases across system reboots and server
-restarts,
-.Nm
-keeps a list of leases it has been assigned in the
-.Pa /var/db/dhclient.leases. Ns Ar IFNAME
-file.
-.Ar IFNAME
-represents the network interface of the DHCP client
-(e.g.,
-.Li em0 ) ,
-one for each interface.
-On startup, after reading the
-.Xr dhclient.conf 5
-file,
-.Nm
-reads the leases file to refresh its memory about what leases it has been
-assigned.
-.Pp
-Old leases are kept around in case the DHCP server is unavailable when
-.Nm
-is first invoked (generally during the initial system boot
-process).
-In that event, old leases from the
-.Pa dhclient.leases. Ns Ar IFNAME
-file which have not yet expired are tested, and if they are determined to
-be valid, they are used until either they expire or the DHCP server
-becomes available.
-.Pp
-A mobile host which may sometimes need to access a network on which no
-DHCP server exists may be preloaded with a lease for a fixed
-address on that network.
-When all attempts to contact a DHCP server have failed,
-.Nm
-will try to validate the static lease, and if it
-succeeds, it will use that lease until it is restarted.
-.Pp
-A mobile host may also travel to some networks on which DHCP is not
-available but BOOTP is.
-In that case, it may be advantageous to
-arrange with the network administrator for an entry on the BOOTP
-database, so that the host can boot quickly on that network rather
-than cycling through the list of old leases.
-.Sh NOTES
-You must have the Berkeley Packet Filter (BPF) configured in your kernel.
-The
-.Nm
-utility
-requires at least one
-.Pa /dev/bpf*
-device for each broadcast network interface that is attached to your system.
-See
-.Xr bpf 4
-for more information.
-.Sh FILES
-.Bl -tag -width ".Pa /var/db/dhclient.leases. Ns Ar IFNAME" -compact
-.It Pa /etc/dhclient.conf
-DHCP client configuration file
-.It Pa /var/db/dhclient.leases. Ns Ar IFNAME
-database of acquired leases
-.El
-.Sh SEE ALSO
-.Xr dhclient.conf 5 ,
-.Xr dhclient.leases 5 ,
-.Xr dhclient-script 8
-.Sh AUTHORS
-.An -nosplit
-The
-.Nm
-utility
-was written by
-.An Ted Lemon Aq mellon@fugue.com
-and
-.An Elliot Poger Aq elliot@poger.com .
-.Pp
-The current implementation was reworked by
-.An Henning Brauer Aq henning@openbsd.org .
diff --git a/freebsd-userspace/commands/sbin/dhclient/dhclient.conf b/freebsd-userspace/commands/sbin/dhclient/dhclient.conf
deleted file mode 100644
index 7eaeeb8e..00000000
--- a/freebsd-userspace/commands/sbin/dhclient/dhclient.conf
+++ /dev/null
@@ -1,39 +0,0 @@
-# $FreeBSD$
-
-send host-name "andare.fugue.com";
-send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
-send dhcp-lease-time 3600;
-supersede domain-name "fugue.com home.vix.com";
-prepend domain-name-servers 127.0.0.1;
-request subnet-mask, broadcast-address, time-offset,
- classless-routes, routers, domain-name,
- domain-name-servers, host-name;
-require subnet-mask, domain-name-servers;
-timeout 60;
-retry 60;
-reboot 10;
-select-timeout 5;
-initial-interval 2;
-script "/etc/dhclient-script";
-media "-link0 -link1 -link2", "link0 link1";
-reject 192.33.137.209;
-
-alias {
- interface "ep0";
- fixed-address 192.5.5.213;
- option subnet-mask 255.255.255.255;
-}
-
-lease {
- interface "ep0";
- fixed-address 192.33.137.200;
- medium "link0 link1";
- option host-name "andare.swiftmedia.com";
- option subnet-mask 255.255.255.0;
- option broadcast-address 192.33.137.255;
- option routers 192.33.137.250;
- option domain-name-servers 127.0.0.1;
- renew 2 2000/1/12 00:00:01;
- rebind 2 2000/1/12 00:00:01;
- expire 2 2000/1/12 00:00:01;
-}
diff --git a/freebsd-userspace/commands/sbin/dhclient/dhclient.conf.5 b/freebsd-userspace/commands/sbin/dhclient/dhclient.conf.5
deleted file mode 100644
index 167239ef..00000000
--- a/freebsd-userspace/commands/sbin/dhclient/dhclient.conf.5
+++ /dev/null
@@ -1,544 +0,0 @@
-.\" $OpenBSD: dhclient.conf.5,v 1.5 2004/11/01 23:10:18 henning Exp $
-.\"
-.\" Copyright (c) 1997 The Internet Software Consortium.
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of The Internet Software Consortium nor the names
-.\" of its contributors may be used to endorse or promote products derived
-.\" from this software without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
-.\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
-.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-.\" DISCLAIMED. IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
-.\" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" This software has been written for the Internet Software Consortium
-.\" by Ted Lemon <mellon@fugue.com> in cooperation with Vixie
-.\" Enterprises. To learn more about the Internet Software Consortium,
-.\" see ``http://www.isc.org/isc''. To learn more about Vixie
-.\" Enterprises, see ``http://www.vix.com''.
-.\"
-.\" $FreeBSD$
-.\"
-.Dd January 1, 1997
-.Dt DHCLIENT.CONF 5
-.Os
-.Sh NAME
-.Nm dhclient.conf
-.Nd DHCP client configuration file
-.Sh DESCRIPTION
-The
-.Nm
-file contains configuration information for
-.Xr dhclient 8 ,
-the Internet Software Consortium DHCP Client.
-.Pp
-The
-.Nm
-file is a free-form ASCII text file.
-It is parsed by the recursive-descent parser built into
-.Xr dhclient 8 .
-The file may contain extra tabs and newlines for formatting purposes.
-Keywords in the file are case-insensitive.
-Comments may be placed anywhere within the file (except within quotes).
-Comments begin with the
-.Ql #
-character and end at the end of the line.
-.Pp
-The
-.Nm
-file can be used to configure the behaviour of the client in a wide variety
-of ways: protocol timing, information requested from the server, information
-required of the server, defaults to use if the server does not provide
-certain information, values with which to override information provided by
-the server, or values to prepend or append to information provided by the
-server.
-The configuration file can also be preinitialized with addresses to
-use on networks that do not have DHCP servers.
-.Sh PROTOCOL TIMING
-The timing behaviour of the client need not be configured by the user.
-If no timing configuration is provided by the user, a fairly
-reasonable timing behaviour will be used by default - one which
-results in fairly timely updates without placing an inordinate load on
-the server.
-.Pp
-The following statements can be used to adjust the timing behaviour of
-the DHCP client if required, however:
-.Bl -tag -width indent
-.It Ic timeout Ar time ;
-The
-.Ic timeout
-statement determines the amount of time that must pass between the
-time that the client begins to try to determine its address and the
-time that it decides that it is not going to be able to contact a server.
-By default, this timeout is sixty seconds.
-After the timeout has passed, if there are any static leases defined in the
-configuration file, or any leases remaining in the lease database that
-have not yet expired, the client will loop through these leases
-attempting to validate them, and if it finds one that appears to be
-valid, it will use that lease's address.
-If there are no valid static leases or unexpired leases in the lease database,
-the client will restart the protocol after the defined retry interval.
-.It Ic retry Ar time ;
-The
-.Ic retry
-statement determines the time that must pass after the client has
-determined that there is no DHCP server present before it tries again
-to contact a DHCP server.
-By default, this is five minutes.
-.It Ic select-timeout Ar time ;
-It is possible (some might say desirable) for there to be more than
-one DHCP server serving any given network.
-In this case, it is possible that a client may be sent more than one offer
-in response to its initial lease discovery message.
-It may be that one of these offers is preferable to the other
-(e.g., one offer may have the address the client previously used,
-and the other may not).
-.Pp
-The
-.Ic select-timeout
-is the time after the client sends its first lease discovery request
-at which it stops waiting for offers from servers, assuming that it
-has received at least one such offer.
-If no offers have been received by the time the
-.Ic select-timeout
-has expired, the client will accept the first offer that arrives.
-.Pp
-By default, the
-.Ic select-timeout
-is zero seconds - that is, the client will take the first offer it sees.
-.It Ic reboot Ar time ;
-When the client is restarted, it first tries to reacquire the last
-address it had.
-This is called the INIT-REBOOT state.
-If it is still attached to the same network it was attached to when it last
-ran, this is the quickest way to get started.
-The
-.Ic reboot
-statement sets the time that must elapse after the client first tries
-to reacquire its old address before it gives up and tries to discover
-a new address.
-By default, the reboot timeout is ten seconds.
-.It Ic backoff-cutoff Ar time ;
-The client uses an exponential backoff algorithm with some randomness,
-so that if many clients try to configure themselves at the same time,
-they will not make their requests in lockstep.
-The
-.Ic backoff-cutoff
-statement determines the maximum amount of time that the client is
-allowed to back off.
-It defaults to two minutes.
-.It Ic initial-interval Ar time ;
-The
-.Ic initial-interval
-statement sets the amount of time between the first attempt to reach a
-server and the second attempt to reach a server.
-Each time a message is sent, the interval between messages is incremented by
-twice the current interval multiplied by a random number between zero and one.
-If it is greater than the
-.Ic backoff-cutoff
-amount, it is set to that
-amount.
-It defaults to ten seconds.
-.El
-.Sh LEASE REQUIREMENTS AND REQUESTS
-The DHCP protocol allows the client to request that the server send it
-specific information, and not send it other information that it is not
-prepared to accept.
-The protocol also allows the client to reject offers from servers if they
-do not contain information the client needs, or if the information provided
-is not satisfactory.
-.Pp
-There is a variety of data contained in offers that DHCP servers send
-to DHCP clients.
-The data that can be specifically requested is what are called
-.Em DHCP Options .
-DHCP Options are defined in
-.Xr dhcp-options 5 .
-.Bl -tag -width indent
-.It Ic request Oo Ar option Oc Oo , Ar ... option Oc ;
-The
-.Ic request
-statement causes the client to request that any server responding to the
-client send the client its values for the specified options.
-Only the option names should be specified in the request statement - not
-option parameters.
-.It Ic require Oo Ar option Oc Oo , Ar ... option Oc ;
-The
-.Ic require
-statement lists options that must be sent in order for an offer to be accepted.
-Offers that do not contain all the listed options will be ignored.
-.It Ic send No { Oo Ar option declaration Oc Oo , Ar ... option declaration Oc }
-The
-.Ic send
-statement causes the client to send the specified options to the server with
-the specified values.
-These are full option declarations as described in
-.Xr dhcp-options 5 .
-Options that are always sent in the DHCP protocol should not be specified
-here, except that the client can specify a
-.Ar dhcp-lease-time
-option other than the default requested lease time, which is two hours.
-The other obvious use for this statement is to send information to the server
-that will allow it to differentiate between this client and other
-clients or kinds of clients.
-.El
-.Sh OPTION MODIFIERS
-In some cases, a client may receive option data from the server which
-is not really appropriate for that client, or may not receive
-information that it needs, and for which a useful default value exists.
-It may also receive information which is useful, but which needs to be
-supplemented with local information.
-To handle these needs, several option modifiers are available.
-.Bl -tag -width indent
-.It Xo
-.Ic default No { Op Ar option declaration
-.Oo , Ar ... option declaration Oc }
-.Xc
-If for some set of options the client should use the value supplied by
-the server, but needs to use some default value if no value was supplied
-by the server, these values can be defined in the
-.Ic default
-statement.
-.It Xo
-.Ic supersede No { Op Ar option declaration
-.Oo , Ar ... option declaration Oc }
-.Xc
-If for some set of options the client should always use its own value
-rather than any value supplied by the server, these values can be defined
-in the
-.Ic supersede
-statement.
-.It Xo
-.Ic prepend No { Op Ar option declaration
-.Oo , Ar ... option declaration Oc }
-.Xc
-If for some set of options the client should use a value you supply,
-and then use the values supplied by the server, if any,
-these values can be defined in the
-.Ic prepend
-statement.
-The
-.Ic prepend
-statement can only be used for options which allow more than one value to
-be given.
-This restriction is not enforced - if violated, the results are unpredictable.
-.It Xo
-.Ic append No { Op Ar option declaration
-.Oo , Ar ... option declaration Oc }
-.Xc
-If for some set of options the client should first use the values
-supplied by the server, if any, and then use values you supply, these
-values can be defined in the
-.Ic append
-statement.
-The
-.Ic append
-statement can only be used for options which allow more than one value to
-be given.
-This restriction is not enforced - if you ignore it,
-the behaviour will be unpredictable.
-.El
-.Sh LEASE DECLARATIONS
-The lease declaration:
-.Pp
-.D1 Ic lease No { Ar lease-declaration Oo Ar ... lease-declaration Oc }
-.Pp
-The DHCP client may decide after some period of time (see
-.Sx PROTOCOL TIMING )
-that it is not going to succeed in contacting a server.
-At that time, it consults its own database of old leases and tests each one
-that has not yet timed out by pinging the listed router for that lease to
-see if that lease could work.
-It is possible to define one or more
-.Em fixed
-leases in the client configuration file for networks where there is no DHCP
-or BOOTP service, so that the client can still automatically configure its
-address.
-This is done with the
-.Ic lease
-statement.
-.Pp
-NOTE: the lease statement is also used in the
-.Pa dhclient.leases
-file in order to record leases that have been received from DHCP servers.
-Some of the syntax for leases as described below is only needed in the
-.Pa dhclient.leases
-file.
-Such syntax is documented here for completeness.
-.Pp
-A lease statement consists of the
-.Ic lease
-keyword, followed by a left
-curly brace, followed by one or more lease declaration statements,
-followed by a right curly brace.
-The following lease declarations are possible:
-.Bl -tag -width indent
-.It Ic bootp ;
-The
-.Ic bootp
-statement is used to indicate that the lease was acquired using the
-BOOTP protocol rather than the DHCP protocol.
-It is never necessary to specify this in the client configuration file.
-The client uses this syntax in its lease database file.
-.It Ic interface Qq Ar string ;
-The
-.Ic interface
-lease statement is used to indicate the interface on which the lease is valid.
-If set, this lease will only be tried on a particular interface.
-When the client receives a lease from a server, it always records the
-interface number on which it received that lease.
-If predefined leases are specified in the
-.Nm
-file, the interface should also be specified, although this is not required.
-.It Ic fixed-address Ar ip-address ;
-The
-.Ic fixed-address
-statement is used to set the IP address of a particular lease.
-This is required for all lease statements.
-The IP address must be specified as a dotted quad (e.g.,
-.Li 12.34.56.78 ) .
-.It Ic filename Qq Ar string ;
-The
-.Ic filename
-statement specifies the name of the boot filename to use.
-This is not used by the standard client configuration script, but is
-included for completeness.
-.It Ic server-name Qq Ar string ;
-The
-.Ic server-name
-statement specifies the name of the boot server name to use.
-This is also not used by the standard client configuration script.
-.It Ic option Ar option-declaration ;
-The
-.Ic option
-statement is used to specify the value of an option supplied by the server,
-or, in the case of predefined leases declared in
-.Nm ,
-the value that the user wishes the client configuration script to use if the
-predefined lease is used.
-.It Ic script Qq Ar script-name ;
-The
-.Ic script
-statement is used to specify the pathname of the DHCP client configuration
-script.
-This script is used by the DHCP client to set each interface's initial
-configuration prior to requesting an address, to test the address once it
-has been offered, and to set the interface's final configuration once a
-lease has been acquired.
-If no lease is acquired, the script is used to test predefined leases, if
-any, and also called once if no valid lease can be identified.
-For more information, see
-.Xr dhclient.leases 5 .
-.It Ic medium Qq Ar "media setup" ;
-The
-.Ic medium
-statement can be used on systems where network interfaces cannot
-automatically determine the type of network to which they are connected.
-The
-.Ar "media setup"
-string is a system-dependent parameter which is passed
-to the DHCP client configuration script when initializing the interface.
-On
-.Ux
-and
-.Ux Ns -like
-systems, the argument is passed on the
-.Xr ifconfig 8
-command line
-when configuring the interface.
-.Pp
-The DHCP client automatically declares this parameter if it used a
-media type (see the
-.Ic media
-statement) when configuring the interface in order to obtain a lease.
-This statement should be used in predefined leases only if the network
-interface requires media type configuration.
-.It Ic renew Ar date ;
-.It Ic rebind Ar date ;
-.It Ic expire Ar date ;
-The
-.Ic renew
-statement defines the time at which the DHCP client should begin trying to
-contact its server to renew a lease that it is using.
-The
-.Ic rebind
-statement defines the time at which the DHCP client should begin to try to
-contact
-.Em any
-DHCP server in order to renew its lease.
-The
-.Ic expire
-statement defines the time at which the DHCP client must stop using a lease
-if it has not been able to contact a server in order to renew it.
-.El
-.Pp
-These declarations are automatically set in leases acquired by the
-DHCP client, but must also be configured in predefined leases - a
-predefined lease whose expiry time has passed will not be used by the
-DHCP client.
-.Pp
-Dates are specified as follows:
-.Bd -ragged -offset indent
-.Ar <weekday>
-.Sm off
-.Ar <year> No / Ar <month> No / Ar <day>
-.Ar <hour> : <minute> : <second>
-.Sm on
-.Ed
-.Pp
-The weekday is present to make it easy for a human to tell when a
-lease expires - it is specified as a number from zero to six, with zero
-being Sunday.
-When declaring a predefined lease, it can always be specified as zero.
-The year is specified with the century, so it should generally be four
-digits except for really long leases.
-The month is specified as a number starting with 1 for January.
-The day of the month is likewise specified starting with 1.
-The hour is a number between 0 and 23,
-the minute a number between 0 and 59,
-and the second also a number between 0 and 59.
-.Sh ALIAS DECLARATIONS
-.Ic alias No { Ar declarations ... No }
-.Pp
-Some DHCP clients running TCP/IP roaming protocols may require that in
-addition to the lease they may acquire via DHCP, their interface also
-be configured with a predefined IP alias so that they can have a
-permanent IP address even while roaming.
-The Internet Software Consortium DHCP client does not support roaming with
-fixed addresses directly, but in order to facilitate such experimentation,
-the DHCP client can be set up to configure an IP alias using the
-.Ic alias
-declaration.
-.Pp
-The
-.Ic alias
-declaration resembles a lease declaration, except that options other than
-the subnet-mask option are ignored by the standard client configuration
-script, and expiry times are ignored.
-A typical alias declaration includes an interface declaration, a fixed-address
-declaration for the IP alias address, and a subnet-mask option declaration.
-A medium statement should never be included in an alias declaration.
-.Sh OTHER DECLARATIONS
-.Bl -tag -width indent
-.It Ic reject Ar ip-address ;
-The
-.Ic reject
-statement causes the DHCP client to reject offers from servers who use
-the specified address as a server identifier.
-This can be used to avoid being configured by rogue or misconfigured DHCP
-servers, although it should be a last resort - better to track down
-the bad DHCP server and fix it.
-.It Ic interface Qo Ar name Qc { Ar declarations ... No }
-A client with more than one network interface may require different
-behaviour depending on which interface is being configured.
-All timing parameters and declarations other than lease and alias
-declarations can be enclosed in an interface declaration, and those
-parameters will then be used only for the interface that matches the
-specified name.
-Interfaces for which there is no interface declaration will use the
-parameters declared outside of any interface declaration,
-or the default settings.
-.It Ic media Qo Ar "media setup" Qc Oo , Qo Ar "media setup" Qc , Ar ... Oc ;
-The
-.Ic media
-statement defines one or more media configuration parameters which may
-be tried while attempting to acquire an IP address.
-The DHCP client will cycle through each media setup string on the list,
-configuring the interface using that setup and attempting to boot,
-and then trying the next one.
-This can be used for network interfaces which are not capable of sensing
-the media type unaided - whichever media type succeeds in getting a request
-to the server and hearing the reply is probably right (no guarantees).
-.Pp
-The media setup is only used for the initial phase of address
-acquisition (the DHCPDISCOVER and DHCPOFFER packets).
-Once an address has been acquired, the DHCP client will record it in its
-lease database and will record the media type used to acquire the address.
-Whenever the client tries to renew the lease, it will use that same media type.
-The lease must expire before the client will go back to cycling through media
-types.
-.El
-.Sh EXAMPLES
-The following configuration file is used on a laptop
-which has an IP alias of
-.Li 192.5.5.213 ,
-and has one interface,
-.Li ep0
-(a 3Com 3C589C).
-Booting intervals have been shortened somewhat from the default, because
-the client is known to spend most of its time on networks with little DHCP
-activity.
-The laptop does roam to multiple networks.
-.Bd -literal -offset indent
-timeout 60;
-retry 60;
-reboot 10;
-select-timeout 5;
-initial-interval 2;
-reject 192.33.137.209;
-
-interface "ep0" {
- send host-name "andare.fugue.com";
- send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
- send dhcp-lease-time 3600;
- supersede domain-name "fugue.com rc.vix.com home.vix.com";
- prepend domain-name-servers 127.0.0.1;
- request subnet-mask, broadcast-address, time-offset, routers,
- domain-name, domain-name-servers, host-name;
- require subnet-mask, domain-name-servers;
- script "/etc/dhclient-script";
- media "media 10baseT/UTP", "media 10base2/BNC";
-}
-
-alias {
- interface "ep0";
- fixed-address 192.5.5.213;
- option subnet-mask 255.255.255.255;
-}
-.Ed
-.Pp
-This is a very complicated
-.Nm
-file - in general, yours should be much simpler.
-In many cases, it is sufficient to just create an empty
-.Nm
-file - the defaults are usually fine.
-.Sh SEE ALSO
-.Xr dhclient.leases 5 ,
-.Xr dhcpd.conf 5 ,
-.Xr dhcp-options 5 ,
-.Xr dhclient 8 ,
-.Xr dhcpd 8
-.Rs
-.%R "RFC 2132, RFC 2131"
-.Re
-.Sh AUTHORS
-.An -nosplit
-The
-.Xr dhclient 8
-utility
-was written by
-.An Ted Lemon Aq mellon@vix.com
-under a contract with Vixie Labs.
-.Pp
-The current implementation was reworked by
-.An Henning Brauer Aq henning@openbsd.org .
diff --git a/freebsd-userspace/commands/sbin/dhclient/dhclient.leases.5 b/freebsd-userspace/commands/sbin/dhclient/dhclient.leases.5
deleted file mode 100644
index b1f0f3d8..00000000
--- a/freebsd-userspace/commands/sbin/dhclient/dhclient.leases.5
+++ /dev/null
@@ -1,95 +0,0 @@
-.\" $OpenBSD: dhclient.leases.5,v 1.4 2004/04/15 08:59:47 jmc Exp $
-.\"
-.\" Copyright (c) 1997 The Internet Software Consortium.
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of The Internet Software Consortium nor the names
-.\" of its contributors may be used to endorse or promote products derived
-.\" from this software without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
-.\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
-.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-.\" DISCLAIMED. IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
-.\" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" This software has been written for the Internet Software Consortium
-.\" by Ted Lemon <mellon@fugue.com> in cooperation with Vixie
-.\" Enterprises. To learn more about the Internet Software Consortium,
-.\" see ``http://www.isc.org/isc''. To learn more about Vixie
-.\" Enterprises, see ``http://www.vix.com''.
-.\"
-.\" $FreeBSD$
-.\"
-.Dd January 1, 1997
-.Dt DHCLIENT.LEASES 5
-.Os
-.Sh NAME
-.Nm dhclient.leases
-.Nd DHCP client lease database
-.Sh DESCRIPTION
-The Internet Software Consortium DHCP client keeps a persistent
-database of leases that it has acquired that are still valid.
-The database is a free-form ASCII file containing one valid declaration
-per lease.
-If more than one declaration appears for a given lease,
-the last one in the file is used.
-The file is written as a log, so this is not an unusual occurrence.
-.Pp
-The lease file is named
-.Pa dhclient.leases. Ns Ar IFNAME ,
-where
-.Ar IFNAME
-represents the network interface the DHCP client acquired the lease on.
-For example, if
-.Xr dhclient 8
-is configured for the
-.Li em0
-network device,
-the lease file will be named
-.Pa dhclient.leases.em0 .
-.Pp
-The format of the lease declarations is described in
-.Xr dhclient.conf 5 .
-.Sh FILES
-.Bl -tag -width ".Pa /var/db/dhclient.leases. Ns Ar IFNAME"
-.It Pa /var/db/dhclient.leases. Ns Ar IFNAME
-Current lease file.
-.El
-.Sh SEE ALSO
-.Xr dhclient.conf 5 ,
-.Xr dhcpd.conf 5 ,
-.Xr dhcp-options 5 ,
-.Xr dhclient 8 ,
-.Xr dhcpd 8
-.Rs
-.%R "RFC 2132, RFC 2131"
-.Re
-.Sh AUTHORS
-.An -nosplit
-The
-.Xr dhclient 8
-utility
-was written by
-.An Ted Lemon Aq mellon@vix.com
-under a contract with Vixie Labs.
-.Pp
-The current implementation was reworked by
-.An Henning Brauer Aq henning@openbsd.org .
diff --git a/freebsd-userspace/commands/sbin/dhclient/dhcp-options.5 b/freebsd-userspace/commands/sbin/dhclient/dhcp-options.5
deleted file mode 100644
index 37356062..00000000
--- a/freebsd-userspace/commands/sbin/dhclient/dhcp-options.5
+++ /dev/null
@@ -1,606 +0,0 @@
-.\" $OpenBSD: dhcp-options.5,v 1.5 2005/03/02 15:30:42 jmc Exp $
-.\"
-.\" Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium.
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of The Internet Software Consortium nor the names
-.\" of its contributors may be used to endorse or promote products derived
-.\" from this software without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
-.\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
-.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-.\" DISCLAIMED. IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
-.\" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" This software has been written for the Internet Software Consortium
-.\" by Ted Lemon <mellon@fugue.com> in cooperation with Vixie
-.\" Enterprises. To learn more about the Internet Software Consortium,
-.\" see ``http://www.isc.org/isc''. To learn more about Vixie
-.\" Enterprises, see ``http://www.vix.com''.
-.\"
-.\" $FreeBSD$
-.\"
-.Dd January 1, 1995
-.Dt DHCP-OPTIONS 5
-.Os
-.Sh NAME
-.Nm dhcp-options
-.Nd Dynamic Host Configuration Protocol options
-.Sh DESCRIPTION
-The Dynamic Host Configuration protocol allows the client to receive
-.Ic options
-from the DHCP server describing the network configuration and various
-services that are available on the network.
-When configuring
-.Xr dhcpd 8
-or
-.Xr dhclient 8 ,
-options must often be declared.
-The syntax for declaring options, and the names and formats of the options
-that can be declared, are documented here.
-.Sh REFERENCE: OPTION STATEMENTS
-DHCP
-.Ic option
-statements always start with the
-.Ic option
-keyword, followed by an option name, followed by option data.
-The option names and data formats are described below.
-It is not necessary to exhaustively specify all DHCP options -
-only those options which are needed by clients must be specified.
-.Pp
-Option data comes in a variety of formats, as defined below:
-.Pp
-The
-.Ar ip-address
-data type can be entered either as an explicit IP address
-(e.g.,
-.Li 239.254.197.10 )
-or as a domain name (e.g.,
-.Li haagen.isc.org ) .
-A domain name must resolve to a single IP address.
-.Pp
-The
-.Ar int32
-data type specifies a signed 32-bit integer.
-The
-.Ar uint32
-data type specifies an unsigned 32-bit integer.
-The
-.Ar int16
-and
-.Ar uint16
-data types specify signed and unsigned 16-bit integers.
-The
-.Ar int8
-and
-.Ar uint8
-data types specify signed and unsigned 8-bit integers.
-Unsigned 8-bit integers are also sometimes referred to as octets.
-.Pp
-The
-.Ar string
-data type specifies an
-.Tn NVT
-.Pq Network Virtual Terminal
-.Tn ASCII
-string, which must be enclosed in double quotes - for example,
-to specify a domain-name option, the syntax would be
-.Pp
-.Dl option domain-name \&"isc.org";
-.Pp
-The
-.Ar flag
-data type specifies a boolean value.
-Booleans can be either
-.Li true
-or
-.Li false
-(or
-.Li on
-or
-.Li off ,
-if that makes more sense to you).
-.Pp
-The
-.Ar data-string
-data type specifies either an
-.Tn NVT ASCII
-string enclosed in double quotes, or a series of octets specified in
-hexadecimal, separated by colons.
-For example:
-.Pp
-.Dl option dhcp-client-identifier \&"CLIENT-FOO";
-or
-.Dl option dhcp-client-identifier 43:4c:49:45:54:2d:46:4f:4f;
-.Pp
-The documentation for the various options mentioned below is taken
-from the IETF draft document on DHCP options, RFC 2132.
-Options which are not listed by name may be defined by the name
-.Li option- Ns Ar nnn ,
-where
-.Ar nnn
-is the decimal number of the option code.
-These options may be followed either by a string, enclosed in quotes, or by
-a series of octets, expressed as two-digit hexadecimal numbers separated
-by colons.
-For example:
-.Bd -literal -offset indent
-option option-133 "my-option-133-text";
-option option-129 1:54:c9:2b:47;
-.Ed
-.Pp
-Because
-.Xr dhcpd 8
-does not know the format of these undefined option codes,
-no checking is done to ensure the correctness of the entered data.
-.Pp
-The standard options are:
-.Ss RFC 1497 Vendor Extensions
-.Bl -tag -width indent
-.It Ic option subnet-mask Ar ip-address ;
-The
-.Ic subnet-mask
-option specifies the client's subnet mask as per RFC 950.
-If no subnet-mask option is provided anywhere in scope, as a last resort
-.Xr dhcpd 8
-will use the subnet mask from the subnet declaration for the network on
-which an address is being assigned.
-However,
-.Em any
-subnet-mask option declaration that is in scope for the address being
-assigned will override the subnet mask specified in the subnet declaration.
-.It Ic option time-offset Ar int32 ;
-The
-.Ic time-offset
-option specifies the offset of the client's subnet in seconds from
-Coordinated Universal Time (UTC).
-.It Xo
-.Ic option routers Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-The
-.Ic routers
-option specifies a list of IP addresses for routers on the client's subnet.
-Routers should be listed in order of preference.
-.It Xo
-.Ic option time-servers Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-The
-.Ic time-server
-option specifies a list of RFC 868 time servers available to the client.
-Servers should be listed in order of preference.
-.It Xo
-.Ic option ien116-name-servers Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-The
-.Ic ien116-name-servers
-option specifies a list of IEN 116 name servers available to the client.
-Servers should be listed in order of preference.
-.It Xo
-.Ic option domain-name-servers Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-The
-.Ic domain-name-servers
-option specifies a list of Domain Name System (STD 13, RFC 1035) name servers
-available to the client.
-Servers should be listed in order of preference.
-.It Xo
-.Ic option log-servers Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-The
-.Ic log-servers
-option specifies a list of MIT-LCS UDP log servers available to the client.
-Servers should be listed in order of preference.
-.It Xo
-.Ic option cookie-servers Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-The
-.Ic cookie-servers
-option specifies a list of RFC 865 cookie servers available to the client.
-Servers should be listed in order of preference.
-.It Xo
-.Ic option lpr-servers Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-The
-.Ic lpr-servers
-option specifies a list of RFC 1179 line printer servers available to the
-client.
-Servers should be listed in order of preference.
-.It Xo
-.Ic option impress-servers Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-The
-.Ic impress-servers
-option specifies a list of Imagen Impress servers available to the client.
-Servers should be listed in order of preference.
-.It Xo
-.Ic option resource-location-servers Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-This option specifies a list of RFC 887 Resource Location servers available
-to the client.
-Servers should be listed in order of preference.
-.It Ic option host-name Ar string ;
-This option specifies the name of the client.
-The name may or may not be qualified with the local domain name
-(it is preferable to use the
-.Ic domain-name
-option to specify the domain name).
-See RFC 1035 for character set restrictions.
-.It Ic option boot-size Ar uint16 ;
-This option specifies the length in 512-octet blocks of the default
-boot image for the client.
-.It Ic option merit-dump Ar string ;
-This option specifies the pathname of a file to which the client's
-core image should be dumped in the event the client crashes.
-The path is formatted as a character string consisting of characters from
-the
-.Tn NVT ASCII
-character set.
-.It Ic option domain-name Ar string ;
-This option specifies the domain name that the client should use when
-resolving hostnames via the Domain Name System.
-.It Ic option swap-server Ar ip-address ;
-This specifies the IP address of the client's swap server.
-.It Ic option root-path Ar string ;
-This option specifies the pathname that contains the client's root disk.
-The path is formatted as a character string consisting of characters from
-the
-.Tn NVT ASCII
-character set.
-.El
-.Ss IP Layer Parameters per Host
-.Bl -tag -width indent
-.It Ic option ip-forwarding Ar flag ;
-This option specifies whether the client should configure its IP layer
-for packet forwarding.
-A value of 0 means disable IP forwarding, and a value of 1 means enable
-IP forwarding.
-.It Ic option non-local-source-routing Ar flag ;
-This option specifies whether the client should configure its IP
-layer to allow forwarding of datagrams with non-local source routes
-(see Section 3.3.5 of [4] for a discussion of this topic).
-A value of 0 means disallow forwarding of such datagrams, and a value of 1
-means allow forwarding.
-.It Xo
-.Ic option policy-filter Ar ip-address ip-address
-.Oo , Ar ip-address ip-address ... Oc ;
-.Xc
-This option specifies policy filters for non-local source routing.
-The filters consist of a list of IP addresses and masks which specify
-destination/mask pairs with which to filter incoming source routes.
-.Pp
-Any source-routed datagram whose next-hop address does not match one
-of the filters should be discarded by the client.
-.Pp
-See STD 3 (RFC 1122) for further information.
-.It Ic option max-dgram-reassembly Ar uint16 ;
-This option specifies the maximum size datagram that the client should be
-prepared to reassemble.
-The minimum legal value is 576.
-.It Ic option default-ip-ttl Ar uint8 ;
-This option specifies the default time-to-live that the client should
-use on outgoing datagrams.
-.It Ic option path-mtu-aging-timeout Ar uint32 ;
-This option specifies the timeout (in seconds) to use when aging Path
-MTU values discovered by the mechanism defined in RFC 1191.
-.It Xo
-.Ic option path-mtu-plateau-table Ar uint16
-.Oo , Ar uint16 ... Oc ;
-.Xc
-This option specifies a table of MTU sizes to use when performing
-Path MTU Discovery as defined in RFC 1191.
-The table is formatted as a list of 16-bit unsigned integers,
-ordered from smallest to largest.
-The minimum MTU value cannot be smaller than 68.
-.El
-.Ss IP Layer Parameters per Interface
-.Bl -tag -width indent
-.It Ic option interface-mtu Ar uint16 ;
-This option specifies the MTU to use on this interface.
-The minimum legal value for the MTU is 68.
-.It Ic option all-subnets-local Ar flag ;
-This option specifies whether or not the client may assume that all subnets
-of the IP network to which the client is connected use the same MTU as the
-subnet of that network to which the client is directly connected.
-A value of 1 indicates that all subnets share the same MTU.
-A value of 0 means that the client should assume that some subnets of the
-directly connected network may have smaller MTUs.
-.It Ic option broadcast-address Ar ip-address ;
-This option specifies the broadcast address in use on the client's subnet.
-Legal values for broadcast addresses are specified in section 3.2.1.3 of
-STD 3 (RFC 1122).
-.It Ic option perform-mask-discovery Ar flag ;
-This option specifies whether or not the client should perform subnet mask
-discovery using ICMP.
-A value of 0 indicates that the client should not perform mask discovery.
-A value of 1 means that the client should perform mask discovery.
-.It Ic option mask-supplier Ar flag ;
-This option specifies whether or not the client should respond to subnet mask
-requests using ICMP.
-A value of 0 indicates that the client should not respond.
-A value of 1 means that the client should respond.
-.It Ic option router-discovery Ar flag ;
-This option specifies whether or not the client should solicit routers using
-the Router Discovery mechanism defined in RFC 1256.
-A value of 0 indicates that the client should not perform router discovery.
-A value of 1 means that the client should perform router discovery.
-.It Ic option router-solicitation-address Ar ip-address ;
-This option specifies the address to which the client should transmit
-router solicitation requests.
-.It Xo
-.Ic option static-routes Ar ip-address ip-address
-.Oo , Ar ip-address ip-address ... Oc ;
-.Xc
-This option specifies a list of static routes that the client should
-install in its routing cache.
-If multiple routes to the same destination are specified, they are listed
-in descending order of priority.
-.Pp
-The routes consist of a list of IP address pairs.
-The first address is the destination address,
-and the second address is the router for the destination.
-.Pp
-The default route (0.0.0.0) is an illegal destination for a static route.
-To specify the default route, use the
-.Ic routers
-option.
-.El
-.Ss Link Layer Parameters per Interface
-.Bl -tag -width indent
-.It Ic option trailer-encapsulation Ar flag ;
-This option specifies whether or not the client should negotiate the
-use of trailers (RFC 893 [14]) when using the ARP protocol.
-A value of 0 indicates that the client should not attempt to use trailers.
-A value of 1 means that the client should attempt to use trailers.
-.It Ic option arp-cache-timeout Ar uint32 ;
-This option specifies the timeout in seconds for ARP cache entries.
-.It Ic option ieee802-3-encapsulation Ar flag ;
-This option specifies whether or not the client should use Ethernet
-Version 2 (RFC 894) or IEEE 802.3 (RFC 1042) encapsulation if the
-interface is an Ethernet.
-A value of 0 indicates that the client should use RFC 894 encapsulation.
-A value of 1 means that the client should use RFC 1042 encapsulation.
-.El
-.Ss TCP Parameters
-.Bl -tag -width indent
-.It Ic option default-tcp-ttl Ar uint8 ;
-This option specifies the default TTL that the client should use when
-sending TCP segments.
-The minimum value is 1.
-.It Ic option tcp-keepalive-interval Ar uint32 ;
-This option specifies the interval (in seconds) that the client TCP
-should wait before sending a keepalive message on a TCP connection.
-The time is specified as a 32-bit unsigned integer.
-A value of zero indicates that the client should not generate keepalive
-messages on connections unless specifically requested by an application.
-.It Ic option tcp-keepalive-garbage Ar flag ;
-This option specifies whether or not the client should send TCP keepalive
-messages with an octet of garbage for compatibility with older implementations.
-A value of 0 indicates that a garbage octet should not be sent.
-A value of 1 indicates that a garbage octet should be sent.
-.El
-.Ss Application and Service Parameters
-.Bl -tag -width indent
-.It Ic option nis-domain Ar string ;
-This option specifies the name of the client's NIS (Sun Network Information
-Services) domain.
-The domain is formatted as a character string consisting of characters
-from the
-.Tn NVT ASCII
-character set.
-.It Xo
-.Ic option nis-servers Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-This option specifies a list of IP addresses indicating NIS servers
-available to the client.
-Servers should be listed in order of preference.
-.It Xo
-.Ic option ntp-servers Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-This option specifies a list of IP addresses indicating NTP (RFC 1305)
-servers available to the client.
-Servers should be listed in order of preference.
-.It Xo
-.Ic option netbios-name-servers Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-The NetBIOS name server (NBNS) option specifies a list of RFC 1001/1002
-NBNS name servers listed in order of preference.
-NetBIOS Name Service is currently more commonly referred to as WINS.
-WINS servers can be specified using the
-.Ic netbios-name-servers
-option.
-.It Xo
-.Ic option netbios-dd-server Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-The NetBIOS datagram distribution server (NBDD) option specifies a
-list of RFC 1001/1002 NBDD servers listed in order of preference.
-.It Ic option netbios-node-type Ar uint8 ;
-The NetBIOS node type option allows NetBIOS over TCP/IP clients which
-are configurable to be configured as described in RFC 1001/1002.
-The value is specified as a single octet which identifies the client type.
-.Pp
-Possible node types are:
-.Bl -tag -width indent
-.It 1
-B-node: Broadcast - no WINS
-.It 2
-P-node: Peer - WINS only
-.It 4
-M-node: Mixed - broadcast, then WINS
-.It 8
-H-node: Hybrid - WINS, then broadcast
-.El
-.It Ic option netbios-scope Ar string ;
-The NetBIOS scope option specifies the NetBIOS over TCP/IP scope
-parameter for the client as specified in RFC 1001/1002.
-See RFC 1001, RFC 1002, and RFC 1035 for character-set restrictions.
-.It Xo
-.Ic option font-servers Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-This option specifies a list of X Window System Font servers available
-to the client.
-Servers should be listed in order of preference.
-.It Xo
-.Ic option x-display-manager Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-This option specifies a list of systems that are running the X Window
-System Display Manager and are available to the client.
-Addresses should be listed in order of preference.
-.It Ic option dhcp-client-identifier Ar data-string ;
-This option can be used to specify a DHCP client identifier in a
-host declaration, so that
-.Xr dhcpd 8
-can find the host record by matching against the client identifier.
-.It Ic option nisplus-domain Ar string ;
-This option specifies the name of the client's NIS+ domain.
-The domain is formatted as a character string consisting of characters
-from the
-.Tn NVT ASCII
-character set.
-.It Xo
-.Ic option nisplus-servers Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-This option specifies a list of IP addresses indicating NIS+ servers
-available to the client.
-Servers should be listed in order of preference.
-.It Ic option tftp-server-name Ar string ;
-This option is used to identify a TFTP server and, if supported by the
-client, should have the same effect as the
-.Ic server-name
-declaration.
-BOOTP clients are unlikely to support this option.
-Some DHCP clients will support it, and others actually require it.
-.It Ic option bootfile-name Ar string ;
-This option is used to identify a bootstrap file.
-If supported by the client, it should have the same effect as the
-.Ic filename
-declaration.
-BOOTP clients are unlikely to support this option.
-Some DHCP clients will support it, and others actually require it.
-.It Xo
-.Ic option mobile-ip-home-agent Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-This option specifies a list of IP addresses indicating mobile IP
-home agents available to the client.
-Agents should be listed in order of preference, although normally there
-will be only one such agent.
-.It Xo
-.Ic option smtp-server Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-The
-.Ic smtp-server
-option specifies a list of SMTP servers available to the client.
-Servers should be listed in order of preference.
-.It Xo
-.Ic option pop-server Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-The
-.Ic pop-server
-option specifies a list of POP3 servers available to the client.
-Servers should be listed in order of preference.
-.It Xo
-.Ic option nntp-server Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-The
-.Ic nntp-server
-option specifies a list of NNTP servers available to the client.
-Servers should be listed in order of preference.
-.It Xo
-.Ic option www-server Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-The
-.Ic www-server
-option specifies a list of WWW servers available to the client.
-Servers should be listed in order of preference.
-.It Xo
-.Ic option finger-server Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-The
-.Ic finger-server
-option specifies a list of
-.Xr finger 1
-servers available to the client.
-Servers should be listed in order of preference.
-.It Xo
-.Ic option irc-server Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-The
-.Ic irc-server
-option specifies a list of IRC servers available to the client.
-Servers should be listed in order of preference.
-.It Xo
-.Ic option streettalk-server Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-The
-.Ic streettalk-server
-option specifies a list of StreetTalk servers available to the client.
-Servers should be listed in order of preference.
-.It Xo
-.Ic option streettalk-directory-assistance-server Ar ip-address
-.Oo , Ar ip-address ... Oc ;
-.Xc
-The StreetTalk Directory Assistance (STDA) server option specifies a
-list of STDA servers available to the client.
-Servers should be listed in order of preference.
-.El
-.Sh SEE ALSO
-.Xr dhclient.conf 5 ,
-.Xr dhcpd.conf 5 ,
-.Xr dhcpd.leases 5 ,
-.Xr dhclient 8 ,
-.Xr dhcpd 8
-.Rs
-.%R "RFC 2131, RFC 2132"
-.Re
-.Sh AUTHORS
-.An -nosplit
-The
-.Xr dhcpd 8
-utility
-was written by
-.An Ted Lemon Aq mellon@vix.com
-under a contract with Vixie Labs.
-.Pp
-The current implementation was reworked by
-.An Henning Brauer Aq henning@openbsd.org .
diff --git a/freebsd-userspace/commands/sbin/ifconfig/af_ipx.c b/freebsd-userspace/commands/sbin/ifconfig/af_ipx.c
deleted file mode 100644
index c7b718aa..00000000
--- a/freebsd-userspace/commands/sbin/ifconfig/af_ipx.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 1983, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef lint
-static const char rcsid[] =
- "$FreeBSD$";
-#endif /* not lint */
-
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <err.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ifaddrs.h>
-
-#ifdef __rtems__
-#include <freebsd/net/if_var.h>
-#else
-#include <net/if_var.h>
-#endif
-#define IPTUNNEL
-#include <netipx/ipx.h>
-#include <netipx/ipx_if.h>
-
-#include "ifconfig.h"
-
-static struct ifaliasreq ipx_addreq;
-static struct ifreq ipx_ridreq;
-
-static void
-ipx_status(int s __unused, const struct ifaddrs *ifa)
-{
- struct sockaddr_ipx *sipx, null_sipx;
-
- sipx = (struct sockaddr_ipx *)ifa->ifa_addr;
- if (sipx == NULL)
- return;
-
- printf("\tipx %s ", ipx_ntoa(sipx->sipx_addr));
-
- if (ifa->ifa_flags & IFF_POINTOPOINT) {
- sipx = (struct sockaddr_ipx *)ifa->ifa_dstaddr;
- if (sipx == NULL) {
- memset(&null_sipx, 0, sizeof(null_sipx));
- sipx = &null_sipx;
- }
- printf("--> %s ", ipx_ntoa(sipx->sipx_addr));
- }
- putchar('\n');
-}
-
-#define SIPX(x) ((struct sockaddr_ipx *) &(x))
-struct sockaddr_ipx *sipxtab[] = {
- SIPX(ipx_ridreq.ifr_addr), SIPX(ipx_addreq.ifra_addr),
- SIPX(ipx_addreq.ifra_mask), SIPX(ipx_addreq.ifra_broadaddr)
-};
-
-static void
-ipx_getaddr(const char *addr, int which)
-{
- struct sockaddr_ipx *sipx = sipxtab[which];
-
- sipx->sipx_family = AF_IPX;
- sipx->sipx_len = sizeof(*sipx);
- sipx->sipx_addr = ipx_addr(addr);
- if (which == MASK)
- printf("Attempt to set IPX netmask will be ineffectual\n");
-}
-
-static void
-ipx_postproc(int s, const struct afswtch *afp)
-{
-
-}
-
-static struct afswtch af_ipx = {
- .af_name = "ipx",
- .af_af = AF_IPX,
- .af_status = ipx_status,
- .af_getaddr = ipx_getaddr,
- .af_postproc = ipx_postproc,
- .af_difaddr = SIOCDIFADDR,
- .af_aifaddr = SIOCAIFADDR,
- .af_ridreq = &ipx_ridreq,
- .af_addreq = &ipx_addreq,
-};
-
-static __constructor void
-ipx_ctor(void)
-{
- af_register(&af_ipx);
-}
diff --git a/freebsd-userspace/commands/sbin/ifconfig/ifconfig.8 b/freebsd-userspace/commands/sbin/ifconfig/ifconfig.8
deleted file mode 100644
index eaab8fa4..00000000
--- a/freebsd-userspace/commands/sbin/ifconfig/ifconfig.8
+++ /dev/null
@@ -1,2555 +0,0 @@
-.\" Copyright (c) 1983, 1991, 1993
-.\" The Regents of the University of California. All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94
-.\" $FreeBSD$
-.\"
-.Dd May 14, 2010
-.Dt IFCONFIG 8
-.Os
-.Sh NAME
-.Nm ifconfig
-.Nd configure network interface parameters
-.Sh SYNOPSIS
-.Nm
-.Op Fl L
-.Op Fl k
-.Op Fl m
-.Op Fl n
-.Ar interface
-.Op Cm create
-.Op Ar address_family
-.Oo
-.Ar address
-.Op Ar dest_address
-.Oc
-.Op Ar parameters
-.Nm
-.Ar interface
-.Cm destroy
-.Nm
-.Fl a
-.Op Fl L
-.Op Fl d
-.Op Fl m
-.Op Fl u
-.Op Fl v
-.Op Ar address_family
-.Nm
-.Fl l
-.Op Fl d
-.Op Fl u
-.Op Ar address_family
-.Nm
-.Op Fl L
-.Op Fl d
-.Op Fl k
-.Op Fl m
-.Op Fl u
-.Op Fl v
-.Op Fl C
-.Nm
-.Op Fl g Ar groupname
-.Sh DESCRIPTION
-The
-.Nm
-utility is used to assign an address
-to a network interface and/or configure
-network interface parameters.
-The
-.Nm
-utility must be used at boot time to define the network address
-of each interface present on a machine; it may also be used at
-a later time to redefine an interface's address
-or other operating parameters.
-.Pp
-The following options are available:
-.Bl -tag -width indent
-.It Ar address
-For the
-.Tn DARPA Ns -Internet
-family,
-the address is either a host name present in the host name data
-base,
-.Xr hosts 5 ,
-or a
-.Tn DARPA
-Internet address expressed in the Internet standard
-.Dq dot notation .
-.Pp
-It is also possible to use the CIDR notation (also known as the
-slash notation) to include the netmask.
-That is, one can specify an address like
-.Li 192.168.0.1/16 .
-.Pp
-For the
-.Dq inet6
-family, it is also possible to specify the prefix length using the slash
-notation, like
-.Li ::1/128 .
-See the
-.Cm prefixlen
-parameter below for more information.
-.\" For the Xerox Network Systems(tm) family,
-.\" addresses are
-.\" .Ar net:a.b.c.d.e.f ,
-.\" where
-.\" .Ar net
-.\" is the assigned network number (in decimal),
-.\" and each of the six bytes of the host number,
-.\" .Ar a
-.\" through
-.\" .Ar f ,
-.\" are specified in hexadecimal.
-.\" The host number may be omitted on IEEE 802 protocol
-.\" (Ethernet, FDDI, and Token Ring) interfaces,
-.\" which use the hardware physical address,
-.\" and on interfaces other than the first.
-.\" For the
-.\" .Tn ISO
-.\" family, addresses are specified as a long hexadecimal string,
-.\" as in the Xerox family.
-.\" However, two consecutive dots imply a zero
-.\" byte, and the dots are optional, if the user wishes to (carefully)
-.\" count out long strings of digits in network byte order.
-.Pp
-The link-level
-.Pq Dq link
-address
-is specified as a series of colon-separated hex digits.
-This can be used to
-e.g.\& set a new MAC address on an ethernet interface, though the
-mechanism used is not ethernet-specific.
-If the interface is already
-up when this option is used, it will be briefly brought down and
-then brought back up again in order to ensure that the receive
-filter in the underlying ethernet hardware is properly reprogrammed.
-.It Ar address_family
-Specify the
-address family
-which affects interpretation of the remaining parameters.
-Since an interface can receive transmissions in differing protocols
-with different naming schemes, specifying the address family is recommended.
-The address or protocol families currently
-supported are
-.Dq inet ,
-.Dq inet6 ,
-.Dq atalk ,
-.Dq ipx ,
-.\" .Dq iso ,
-and
-.Dq link .
-.\" and
-.\" .Dq ns .
-The default is
-.Dq inet .
-.Dq ether
-and
-.Dq lladdr
-are synonyms for
-.Dq link .
-.It Ar dest_address
-Specify the address of the correspondent on the other end
-of a point to point link.
-.It Ar interface
-This
-parameter is a string of the form
-.Dq name unit ,
-for example,
-.Dq Li ed0 .
-.It Ar groupname
-List the interfaces in the given group.
-.El
-.Pp
-The following parameters may be set with
-.Nm :
-.Bl -tag -width indent
-.It Cm add
-Another name for the
-.Cm alias
-parameter.
-Introduced for compatibility
-with
-.Bsx .
-.It Cm alias
-Establish an additional network address for this interface.
-This is sometimes useful when changing network numbers, and
-one wishes to accept packets addressed to the old interface.
-If the address is on the same subnet as the first network address
-for this interface, a non-conflicting netmask must be given.
-Usually
-.Li 0xffffffff
-is most appropriate.
-.It Fl alias
-Remove the network address specified.
-This would be used if you incorrectly specified an alias, or it
-was no longer needed.
-If you have incorrectly set an NS address having the side effect
-of specifying the host portion, removing all NS addresses will
-allow you to respecify the host portion.
-.It Cm anycast
-(Inet6 only.)
-Specify that the address configured is an anycast address.
-Based on the current specification,
-only routers may configure anycast addresses.
-Anycast address will not be used as source address of any of outgoing
-IPv6 packets.
-.It Cm arp
-Enable the use of the Address Resolution Protocol
-.Pq Xr arp 4
-in mapping
-between network level addresses and link level addresses (default).
-This is currently implemented for mapping between
-.Tn DARPA
-Internet
-addresses and
-.Tn IEEE
-802 48-bit MAC addresses (Ethernet, FDDI, and Token Ring addresses).
-.It Fl arp
-Disable the use of the Address Resolution Protocol
-.Pq Xr arp 4 .
-.It Cm staticarp
-If the Address Resolution Protocol is enabled,
-the host will only reply to requests for its addresses,
-and will never send any requests.
-.It Fl staticarp
-If the Address Resolution Protocol is enabled,
-the host will perform normally,
-sending out requests and listening for replies.
-.It Cm broadcast
-(Inet only.)
-Specify the address to use to represent broadcasts to the
-network.
-The default broadcast address is the address with a host part of all 1's.
-.It Cm debug
-Enable driver dependent debugging code; usually, this turns on
-extra console error logging.
-.It Fl debug
-Disable driver dependent debugging code.
-.It Cm promisc
-Put interface into permanently promiscuous mode.
-.It Fl promisc
-Disable permanently promiscuous mode.
-.It Cm delete
-Another name for the
-.Fl alias
-parameter.
-.It Cm description Ar value , Cm descr Ar value
-Specify a description of the interface.
-This can be used to label interfaces in situations where they may
-otherwise be difficult to distinguish.
-.It Cm -description , Cm -descr
-Clear the interface description.
-.It Cm down
-Mark an interface
-.Dq down .
-When an interface is marked
-.Dq down ,
-the system will not attempt to
-transmit messages through that interface.
-If possible, the interface will be reset to disable reception as well.
-This action does not automatically disable routes using the interface.
-.It Cm group Ar group-name
-Assign the interface to a
-.Dq group .
-Any interface can be in multiple groups.
-.Pp
-Cloned interfaces are members of their interface family group by default.
-For example, a PPP interface such as
-.Em ppp0
-is a member of the PPP interface family group,
-.Em ppp .
-.\" The interface(s) the default route(s) point to are members of the
-.\" .Em egress
-.\" interface group.
-.It Cm -group Ar group-name
-Remove the interface from the given
-.Dq group .
-.It Cm eui64
-(Inet6 only.)
-Fill interface index
-(lowermost 64bit of an IPv6 address)
-automatically.
-.It Cm ipdst
-This is used to specify an Internet host who is willing to receive
-IP packets encapsulating IPX packets bound for a remote network.
-An apparent point to point link is constructed, and
-the address specified will be taken as the IPX address and network
-of the destination.
-.It Cm maclabel Ar label
-If Mandatory Access Control support is enabled in the kernel,
-set the MAC label to
-.Ar label .
-.\" (see
-.\" .Xr maclabel 7 ) .
-.It Cm media Ar type
-If the driver supports the media selection system, set the media type
-of the interface to
-.Ar type .
-Some interfaces support the mutually exclusive use of one of several
-different physical media connectors.
-For example, a 10Mbit/s Ethernet
-interface might support the use of either
-.Tn AUI
-or twisted pair connectors.
-Setting the media type to
-.Cm 10base5/AUI
-would change the currently active connector to the AUI port.
-Setting it to
-.Cm 10baseT/UTP
-would activate twisted pair.
-Refer to the interfaces' driver
-specific documentation or man page for a complete list of the
-available types.
-.It Cm mediaopt Ar opts
-If the driver supports the media selection system, set the specified
-media options on the interface.
-The
-.Ar opts
-argument
-is a comma delimited list of options to apply to the interface.
-Refer to the interfaces' driver specific man page for a complete
-list of available options.
-.It Fl mediaopt Ar opts
-If the driver supports the media selection system, disable the
-specified media options on the interface.
-.It Cm mode Ar mode
-If the driver supports the media selection system, set the specified
-operating mode on the interface to
-.Ar mode .
-For IEEE 802.11 wireless interfaces that support multiple operating modes
-this directive is used to select between 802.11a
-.Pq Cm 11a ,
-802.11b
-.Pq Cm 11b ,
-and 802.11g
-.Pq Cm 11g
-operating modes.
-.It Cm inst Ar minst , Cm instance Ar minst
-Set the media instance to
-.Ar minst .
-This is useful for devices which have multiple physical layer interfaces
-.Pq PHYs .
-.It Cm name Ar name
-Set the interface name to
-.Ar name .
-.It Cm rxcsum , txcsum
-If the driver supports user-configurable checksum offloading,
-enable receive (or transmit) checksum offloading on the interface.
-Some drivers may not be able to enable these flags independently
-of each other, so setting one may also set the other.
-The driver will offload as much checksum work as it can reliably
-support, the exact level of offloading varies between drivers.
-.It Fl rxcsum , txcsum
-If the driver supports user-configurable checksum offloading,
-disable receive (or transmit) checksum offloading on the interface.
-These settings may not always be independent of each other.
-.It Cm tso
-If the driver supports
-.Xr tcp 4
-segmentation offloading, enable TSO on the interface.
-Some drivers may not be able to support TSO for
-.Xr ip 4
-and
-.Xr ip6 4
-packets, so they may enable only one of them.
-.It Fl tso
-If the driver supports
-.Xr tcp 4
-segmentation offloading, disable TSO on the interface.
-It will always disable TSO for
-.Xr ip 4
-and
-.Xr ip6 4 .
-.It Cm lro
-If the driver supports
-.Xr tcp 4
-large receive offloading, enable LRO on the interface.
-.It Fl lro
-If the driver supports
-.Xr tcp 4
-large receive offloading, disable LRO on the interface.
-.It Cm wol , wol_ucast , wol_mcast , wol_magic
-Enable Wake On Lan (WOL) support, if available.
-WOL is a facility whereby a machine in a low power state may be woken
-in response to a received packet.
-There are three types of packets that may wake a system:
-ucast (directed solely to the machine's mac address),
-mcast (directed to a broadcast or multicast address),
-or
-magic (unicast or multicast frames with a ``magic contents'').
-Not all devices support WOL, those that do indicate the mechanisms
-they support in their capabilities.
-.Cm wol
-is a synonym for enabling all available WOL mechanisms.
-To disable WOL use
-.Fl wol .
-.It Cm vlanmtu , vlanhwtag, vlanhwfilter, vlanhwtso
-If the driver offers user-configurable VLAN support, enable
-reception of extended frames, tag processing in hardware,
-frame filtering in hardware, or TSO on VLAN,
-respectively.
-Note that this must be issued on a physical interface associated with
-.Xr vlan 4 ,
-not on a
-.Xr vlan 4
-interface itself.
-.It Fl vlanmtu , vlanhwtag, vlanhwfilter, vlanhwtso
-If the driver offers user-configurable VLAN support, disable
-reception of extended frames, tag processing in hardware,
-frame filtering in hardware, or TSO on VLAN,
-respectively.
-.It Cm vnet Ar jail
-Move the interface to the
-.Xr jail 8 ,
-specified by name or JID.
-If the jail has a virtual network stack, the interface will disappear
-from the current environment and become visible to the jail.
-.It Fl vnet Ar jail
-Reclaim the interface from the
-.Xr jail 8 ,
-specified by name or JID.
-If the jail has a virtual network stack, the interface will disappear
-from the jail, and become visible to the current network environment.
-.It Cm polling
-Turn on
-.Xr polling 4
-feature and disable interrupts on the interface, if driver supports
-this mode.
-.It Fl polling
-Turn off
-.Xr polling 4
-feature and enable interrupt mode on the interface.
-.It Cm create
-Create the specified network pseudo-device.
-If the interface is given without a unit number, try to create a new
-device with an arbitrary unit number.
-If creation of an arbitrary device is successful, the new device name is
-printed to standard output unless the interface is renamed or destroyed
-in the same
-.Nm
-invocation.
-.It Cm destroy
-Destroy the specified network pseudo-device.
-.It Cm plumb
-Another name for the
-.Cm create
-parameter.
-Included for
-.Tn Solaris
-compatibility.
-.It Cm unplumb
-Another name for the
-.Cm destroy
-parameter.
-Included for
-.Tn Solaris
-compatibility.
-.It Cm metric Ar n
-Set the routing metric of the interface to
-.Ar n ,
-default 0.
-The routing metric is used by the routing protocol
-.Pq Xr routed 8 .
-Higher metrics have the effect of making a route
-less favorable; metrics are counted as additional hops
-to the destination network or host.
-.It Cm mtu Ar n
-Set the maximum transmission unit of the interface to
-.Ar n ,
-default is interface specific.
-The MTU is used to limit the size of packets that are transmitted on an
-interface.
-Not all interfaces support setting the MTU, and some interfaces have
-range restrictions.
-.It Cm netmask Ar mask
-.\" (Inet and ISO.)
-(Inet only.)
-Specify how much of the address to reserve for subdividing
-networks into sub-networks.
-The mask includes the network part of the local address
-and the subnet part, which is taken from the host field of the address.
-The mask can be specified as a single hexadecimal number
-with a leading
-.Ql 0x ,
-with a dot-notation Internet address,
-or with a pseudo-network name listed in the network table
-.Xr networks 5 .
-The mask contains 1's for the bit positions in the 32-bit address
-which are to be used for the network and subnet parts,
-and 0's for the host part.
-The mask should contain at least the standard network portion,
-and the subnet field should be contiguous with the network
-portion.
-.Pp
-The netmask can also be specified in CIDR notation after the address.
-See the
-.Ar address
-option above for more information.
-.It Cm prefixlen Ar len
-(Inet6 only.)
-Specify that
-.Ar len
-bits are reserved for subdividing networks into sub-networks.
-The
-.Ar len
-must be integer, and for syntactical reason it must be between 0 to 128.
-It is almost always 64 under the current IPv6 assignment rule.
-If the parameter is omitted, 64 is used.
-.Pp
-The prefix can also be specified using the slash notation after the address.
-See the
-.Ar address
-option above for more information.
-.\" see
-.\" Xr eon 5 .
-.\" .It Cm nsellength Ar n
-.\" .Pf ( Tn ISO
-.\" only)
-.\" This specifies a trailing number of bytes for a received
-.\" .Tn NSAP
-.\" used for local identification, the remaining leading part of which is
-.\" taken to be the
-.\" .Tn NET
-.\" (Network Entity Title).
-.\" The default value is 1, which is conformant to US
-.\" .Tn GOSIP .
-.\" When an ISO address is set in an ifconfig command,
-.\" it is really the
-.\" .Tn NSAP
-.\" which is being specified.
-.\" For example, in
-.\" .Tn US GOSIP ,
-.\" 20 hex digits should be
-.\" specified in the
-.\" .Tn ISO NSAP
-.\" to be assigned to the interface.
-.\" There is some evidence that a number different from 1 may be useful
-.\" for
-.\" .Tn AFI
-.\" 37 type addresses.
-.It Cm range Ar netrange
-Under appletalk, set the interface to respond to a
-.Ar netrange
-of the form
-.Ar startnet Ns - Ns Ar endnet .
-Appletalk uses this scheme instead of
-netmasks though
-.Fx
-implements it internally as a set of netmasks.
-.It Cm remove
-Another name for the
-.Fl alias
-parameter.
-Introduced for compatibility
-with
-.Bsx .
-.It Cm phase
-The argument following this specifies the version (phase) of the
-Appletalk network attached to the interface.
-Values of 1 or 2 are permitted.
-.Sm off
-.It Cm link Op Cm 0 No - Cm 2
-.Sm on
-Enable special processing of the link level of the interface.
-These three options are interface specific in actual effect, however,
-they are in general used to select special modes of operation.
-An example
-of this is to enable SLIP compression, or to select the connector type
-for some Ethernet cards.
-Refer to the man page for the specific driver
-for more information.
-.Sm off
-.It Fl link Op Cm 0 No - Cm 2
-.Sm on
-Disable special processing at the link level with the specified interface.
-.It Cm monitor
-Put the interface in monitor mode.
-No packets are transmitted, and received packets are discarded after
-.Xr bpf 4
-processing.
-.It Fl monitor
-Take the interface out of monitor mode.
-.It Cm up
-Mark an interface
-.Dq up .
-This may be used to enable an interface after an
-.Dq Nm Cm down .
-It happens automatically when setting the first address on an interface.
-If the interface was reset when previously marked down,
-the hardware will be re-initialized.
-.El
-.Pp
-The following parameters are for ICMPv6 Neightbor Discovery Protocol:
-.Bl -tag -width indent
-.It Cm accept_rtadv
-Set a flag to enable accepting ICMPv6 Router Advertisement messages.
-.It Cm -accept_rtadv
-Clear a flag
-.Cm accept_rtadv .
-.It Cm defaultif
-Set the specified interface as the default route when there is no
-default router.
-.It Cm -defaultif
-Clear a flag
-.Cm defaultif .
-.It Cm ifdisabled
-Set a flag to disable all of IPv6 network communications on the
-specified interface.
-.It Cm -ifdisabled
-Clear a flag
-.Cm ifdisabled .
-.It Cm nud
-Set a flag to enable Neighbor Unreachability Detection.
-.It Cm -nud
-Clear a flag
-.Cm nud .
-.It Cm prefer_source
-Set a flag to prefer addesses on the interface as candidates of the
-source address for outgoing packets.
-.It Cm -prefer_source
-Clear a flag
-.Cm prefer_source .
-.El
-.Pp
-The following parameters are specific to cloning
-IEEE 802.11 wireless interfaces with the
-.Cm create
-request:
-.Bl -tag -width indent
-.It Cm wlandev Ar device
-Use
-.Ar device
-as the parent for the cloned device.
-.It Cm wlanmode Ar mode
-Specify the operating mode for this cloned device.
-.Ar mode
-is one of
-.Cm sta ,
-.Cm ahdemo
-(or
-.Cm adhoc-demo ),
-.Cm ibss ,
-(or
-.Cm adhoc ),
-.Cm ap ,
-(or
-.Cm hostap ),
-.Cm wds ,
-.Cm tdma ,
-.Cm mesh ,
-and
-.Cm monitor .
-The operating mode of a cloned interface cannot be changed.
-The
-.Cm tdma
-mode is actually implemented as an
-.Cm adhoc-demo
-interface with special properties.
-.It Cm wlanbssid Ar bssid
-The 802.11 mac address to use for the bssid.
-This must be specified at create time for a legacy
-.Cm wds
-device.
-.It Cm wlanaddr Ar address
-The local mac address.
-If this is not specified then a mac address will automatically be assigned
-to the cloned device.
-Typically this address is the same as the address of the parent device
-but if the
-.Cm bssid
-parameter is specified then the driver will craft a unique address for
-the device (if supported).
-.It Cm wdslegacy
-Mark a
-.Cm wds
-device as operating in ``legacy mode''.
-Legacy
-.Cm wds
-devices have a fixed peer relationship and do not, for example, roam
-if their peer stops communicating.
-For completeness a Dynamic WDS (DWDS) interface may marked as
-.Fl wdslegacy .
-.It Cm bssid
-Request a unique local mac address for the cloned device.
-This is only possible if the device supports multiple mac addresses.
-To force use of the parent's mac address use
-.Fl bssid .
-.It Cm beacons
-Mark the cloned interface as depending on hardware support to
-track received beacons.
-To have beacons tracked in software use
-.Fl beacons .
-For
-.Cm hostap
-mode
-.Fl beacons
-can also be used to indicate no beacons should
-be transmitted; this can be useful when creating a WDS configuration but
-.Cm wds
-interfaces can only be created as companions to an access point.
-.El
-.Pp
-The following parameters are specific to IEEE 802.11 wireless interfaces
-cloned with a
-.Cm create
-operation:
-.Bl -tag -width indent
-.It Cm ampdu
-Enable sending and receiving AMPDU frames when using 802.11n (default).
-The 802.11n specification states a compliant station must be capable
-of receiving AMPDU frames but transmision is optional.
-Use
-.Fl ampdu
-to disable all use of AMPDU with 802.11n.
-For testing and/or to work around interoperability problems one can use
-.Cm ampdutx
-and
-.Cm ampdurx
-to control use of AMPDU in one direction.
-.It Cm ampdudensity Ar density
-Set the AMPDU density parameter used when operating with 802.11n.
-This parameter controls the inter-packet gap for AMPDU frames.
-The sending device normally controls this setting but a receiving station
-may request wider gaps.
-Legal values for
-.Ar density
-are 0, .25, .5, 1, 2, 4, 8, and 16 (microseconds).
-A value of
-.Cm -
-is treated the same as 0.
-.It Cm ampdulimit Ar limit
-Set the limit on packet size for receiving AMPDU frames when operating
-with 802.11n.
-Legal values for
-.Ar limit
-are 8192, 16384, 32768, and 65536 but one can also specify
-just the unique prefix: 8, 16, 32, 64.
-Note the sender may limit the size of AMPDU frames to be less
-than the maximum specified by the receiving station.
-.It Cm amsdu
-Enable sending and receiving AMSDU frames when using 802.11n.
-By default AMSDU is received but not transmitted.
-Use
-.Fl amsdu
-to disable all use of AMSDU with 802.11n.
-For testing and/or to work around interoperability problems one can use
-.Cm amsdutx
-and
-.Cm amsdurx
-to control use of AMSDU in one direction.
-.It Cm amsdulimit Ar limit
-Set the limit on packet size for sending and receiving AMSDU frames
-when operating with 802.11n.
-Legal values for
-.Ar limit
-are 7935 and 3839 (bytes).
-Note the sender may limit the size of AMSDU frames to be less
-than the maximum specified by the receiving station.
-Note also that devices are not required to support the 7935 limit,
-only 3839 is required by the specification and the larger value
-may require more memory to be dedicated to support functionality
-that is rarely used.
-.It Cm apbridge
-When operating as an access point, pass packets between
-wireless clients directly (default).
-To instead let them pass up through the
-system and be forwarded using some other mechanism, use
-.Fl apbridge .
-Disabling the internal bridging
-is useful when traffic is to be processed with
-packet filtering.
-.It Cm authmode Ar mode
-Set the desired authentication mode in infrastructure mode.
-Not all adapters support all modes.
-The set of
-valid modes is
-.Cm none , open , shared
-(shared key),
-.Cm 8021x
-(IEEE 802.1x),
-and
-.Cm wpa
-(IEEE WPA/WPA2/802.11i).
-The
-.Cm 8021x
-and
-.Cm wpa
-modes are only useful when using an authentication service
-(a supplicant for client operation or an authenticator when
-operating as an access point).
-Modes are case insensitive.
-.It Cm bgscan
-Enable background scanning when operating as a station.
-Background scanning is a technique whereby a station associated to
-an access point will temporarily leave the channel to scan for
-neighboring stations.
-This allows a station to maintain a cache of nearby access points
-so that roaming between access points can be done without
-a lengthy scan operation.
-Background scanning is done only when a station is not busy and
-any outbound traffic will cancel a scan operation.
-Background scanning should never cause packets to be lost though
-there may be some small latency if outbound traffic interrupts a
-scan operation.
-By default background scanning is enabled if the device is capable.
-To disable background scanning, use
-.Fl bgscan .
-Background scanning is controlled by the
-.Cm bgscanidle
-and
-.Cm bgscanintvl
-parameters.
-Background scanning must be enabled for roaming; this is an artifact
-of the current implementation and may not be required in the future.
-.It Cm bgscanidle Ar idletime
-Set the minimum time a station must be idle (not transmitting or
-receiving frames) before a background scan is initiated.
-The
-.Ar idletime
-parameter is specified in milliseconds.
-By default a station must be idle at least 250 milliseconds before
-a background scan is initiated.
-The idle time may not be set to less than 100 milliseconds.
-.It Cm bgscanintvl Ar interval
-Set the interval at which background scanning is attempted.
-The
-.Ar interval
-parameter is specified in seconds.
-By default a background scan is considered every 300 seconds (5 minutes).
-The
-.Ar interval
-may not be set to less than 15 seconds.
-.It Cm bintval Ar interval
-Set the interval at which beacon frames are sent when operating in
-ad-hoc or ap mode.
-The
-.Ar interval
-parameter is specified in TU's (1024 usecs).
-By default beacon frames are transmitted every 100 TU's.
-.It Cm bmissthreshold Ar count
-Set the number of consecutive missed beacons at which the station
-will attempt to roam (i.e., search for a new access point).
-The
-.Ar count
-parameter must be in the range 1 to 255; though the
-upper bound may be reduced according to device capabilities.
-The default threshold is 7 consecutive missed beacons; but
-this may be overridden by the device driver.
-Another name for the
-.Cm bmissthreshold
-parameter is
-.Cm bmiss .
-.It Cm bssid Ar address
-Specify the MAC address of the access point to use when operating
-as a station in a BSS network.
-This overrides any automatic selection done by the system.
-To disable a previously selected access point, supply
-.Cm any , none ,
-or
-.Cm -
-for the address.
-This option is useful when more than one access point uses the same SSID.
-Another name for the
-.Cm bssid
-parameter is
-.Cm ap .
-.It Cm burst
-Enable packet bursting.
-Packet bursting is a transmission technique whereby the wireless
-medium is acquired once to send multiple frames and the interframe
-spacing is reduced.
-This technique can significantly increase throughput by reducing
-transmission overhead.
-Packet bursting is supported by the 802.11e QoS specification
-and some devices that do not support QoS may still be capable.
-By default packet bursting is enabled if a device is capable
-of doing it.
-To disable packet bursting, use
-.Fl burst .
-.It Cm chanlist Ar channels
-Set the desired channels to use when scanning for access
-points, neighbors in an IBSS network, or looking for unoccupied
-channels when operating as an access point.
-The set of channels is specified as a comma-separated list with
-each element in the list representing either a single channel number or a range
-of the form
-.Dq Li a-b .
-Channel numbers must be in the range 1 to 255 and be permissible
-according to the operating characteristics of the device.
-.It Cm channel Ar number
-Set a single desired channel.
-Channels range from 1 to 255, but the exact selection available
-depends on the region your adaptor was manufactured for.
-Setting
-the channel to
-.Li any ,
-or
-.Cm -
-will clear any desired channel and, if the device is marked up,
-force a scan for a channel to operate on.
-Alternatively the frequency, in megahertz, may be specified
-instead of the channel number.
-.Pp
-When there are several ways to use a channel the channel
-number/frequency may be appended with attributes to clarify.
-For example, if a device is capable of operating on channel 6
-with 802.11n and 802.11g then one can specify that g-only use
-should be used by specifying ``6:g''.
-Similarly the channel width can be specified by appending it
-with ``/''; e.g. ``6/40'' specifies a 40MHz wide channel,
-These attributes can be combined as in: ``6:ht/40''.
-The full set of flags specified following a `:'' are:
-.Cm a
-(802.11a),
-.Cm b
-(802.11b),
-.Cm d
-(Atheros Dynamic Turbo mode),
-.Cm g
-(802.11g),
-.Cm h
-or
-.Cm n
-(802.11n aka HT),
-.Cm s
-(Atheros Static Turbo mode),
-and
-.Cm t
-(Atheros Dynamic Turbo mode, or appended to ``st'' and ``dt'').
-The full set of channel widths following a '/' are:
-.Cm 5
-(5MHz aka quarter-rate channel),
-.Cm 10
-(10MHz aka half-rate channel),
-.Cm 20
-(20MHz mostly for use in specifying ht20),
-and
-.Cm 40
-(40MHz mostly for use in specifying ht40),
-In addition,
-a 40MHz HT channel specification may include the location
-of the extension channel by appending ``+'' or ``-'' for above and below,
-respectively; e.g. ``2437:ht/40+'' specifies 40MHz wide HT operation
-with the center channel at frequency 2437 and the extension channel above.
-.It Cm country Ar name
-Set the country code to use in calculating the regulatory constraints
-for operation.
-In particular the set of available channels, how the wireless device
-will operation on the channels, and the maximum transmit power that
-can be used on a channel are defined by this setting.
-Country/Region codes are specified as a 2-character abbreviation
-defined by ISO 3166 or using a longer, but possibly ambiguous, spelling;
-e.g. "ES" and "Spain".
-The set of country codes are taken from /etc/regdomain.xml and can also
-be viewed with the ``list countries'' request.
-Note that not all devices support changing the country code from a default
-setting; typically stored in EEPROM.
-See also
-.Cm regdomain ,
-.Cm indoor ,
-.Cm outdoor ,
-and
-.Cm anywhere .
-.It Cm dfs
-Enable Dynamic Frequency Selection (DFS) as specified in 802.11h.
-DFS embodies several facilities including detection of overlapping
-radar signals, dynamic transmit power control, and channel selection
-according to a least-congested criteria.
-DFS support is mandatory for some 5Ghz frequencies in certain
-locales (e.g. ETSI).
-By default DFS is enabled according to the regulatory definitions
-specified in /etc/regdomain.xml and the curent country code, regdomain,
-and channel.
-Note the underlying device (and driver) must support radar detection
-for full DFS support to work.
-To be fully compliant with the local regulatory agency frequencies that
-require DFS should not be used unless it is fully supported.
-Use
-.Fl dfs
-to disable this functionality for testing.
-.It Cm dotd
-Enable support for the 802.11d specification (default).
-When this support is enabled in station mode, beacon frames that advertise
-a country code different than the currently configured country code will
-cause an event to be dispatched to user applications.
-This event can be used by the station to adopt that country code and
-operate according to the associated regulatory constraints.
-When operating as an access point with 802.11d enabled the beacon and
-probe response frames transmitted will advertise the current regulatory
-domain settings.
-To disable 802.11d use
-.Fl dotd .
-.It Cm doth
-Enable 802.11h support including spectrum management.
-When 802.11h is enabled beacon and probe response frames will have
-the SpectrumMgt bit set in the capabilities field and
-country and power constraint information elements will be present.
-802.11h support also includes handling Channel Switch Announcements (CSA)
-which are a mechanism to coordinate channel changes by an access point.
-By default 802.11h is enabled if the device is capable.
-To disable 802.11h use
-.Fl doth .
-.It Cm deftxkey Ar index
-Set the default key to use for transmission.
-Typically this is only set when using WEP encryption.
-Note that you must set a default transmit key
-for the system to know which key to use in encrypting outbound traffic.
-The
-.Cm weptxkey
-is an alias for this request; it is provided for backwards compatibility.
-.It Cm dtimperiod Ar period
-Set the
-DTIM
-period for transmitting buffered multicast data frames when
-operating in ap mode.
-The
-.Ar period
-specifies the number of beacon intervals between DTIM
-and must be in the range 1 to 15.
-By default DTIM is 1 (i.e., DTIM occurs at each beacon).
-.It Cm dturbo
-Enable the use of Atheros Dynamic Turbo mode when communicating with
-another Dynamic Turbo-capable station.
-Dynamic Turbo mode is an Atheros-specific mechanism by which
-stations switch between normal 802.11 operation and a ``boosted''
-mode in which a 40MHz wide channel is used for communication.
-Stations using Dynamic Turbo mode operate boosted only when the
-channel is free of non-dturbo stations; when a non-dturbo station
-is identified on the channel all stations will automatically drop
-back to normal operation.
-By default, Dynamic Turbo mode is not enabled, even if the device is capable.
-Note that turbo mode (dynamic or static) is only allowed on some
-channels depending on the regulatory constraints; use the
-.Cm list chan
-command to identify the channels where turbo mode may be used.
-To disable Dynamic Turbo mode use
-.Fl dturbo .
-.It Cm dwds
-Enable Dynamic WDS (DWDS) support.
-DWDS is a facility by which 4-address traffic can be carried between
-stations operating in infrastructure mode.
-A station first associates to an access point and authenticates using
-normal procedures (e.g. WPA).
-Then 4-address frames are passed to carry traffic for stations
-operating on either side of the wireless link.
-DWDS extends the normal WDS mechanism by leveraging existing security
-protocols and eliminating static binding.
-.Pp
-When DWDS is enabled on an access point 4-address frames received from
-an authorized station will generate a ``DWDS discovery'' event to user
-applications.
-This event should be used to create a WDS interface that is bound
-to the remote station (and usually plumbed into a bridge).
-Once the WDS interface is up and running 4-address traffic then logically
-flows through that interface.
-.Pp
-When DWDS is enabled on a station, traffic with a destination address
-different from the peer station are encapsulated in a 4-address frame
-and transmitted to the peer.
-All 4-address traffic uses the security information of the stations
-(e.g. cryptographic keys).
-A station is associated using 802.11n facilities may transport
-4-address traffic using these same mechanisms; this depends on available
-resources and capabilities of the device.
-The DWDS implementation guards against layer 2 routing loops of
-multicast traffic.
-.It Cm ff
-Enable the use of Atheros Fast Frames when communicating with
-another Fast Frames-capable station.
-Fast Frames are an encapsulation technique by which two 802.3
-frames are transmitted in a single 802.11 frame.
-This can noticeably improve throughput but requires that the
-receiving station understand how to decapsulate the frame.
-Fast frame use is negotiated using the Atheros 802.11 vendor-specific
-protocol extension so enabling use is safe when communicating with
-non-Atheros devices.
-By default, use of fast frames is enabled if the device is capable.
-To explicitly disable fast frames, use
-.Fl ff .
-.It Cm fragthreshold Ar length
-Set the threshold for which transmitted frames are broken into fragments.
-The
-.Ar length
-argument is the frame size in bytes and must be in the range 256 to 2346.
-Setting
-.Ar length
-to
-.Li 2346 ,
-.Cm any ,
-or
-.Cm -
-disables transmit fragmentation.
-Not all adapters honor the fragmentation threshold.
-.It Cm hidessid
-When operating as an access point, do not broadcast the SSID
-in beacon frames or respond to probe request frames unless
-they are directed to the ap (i.e., they include the ap's SSID).
-By default, the SSID is included in beacon frames and
-undirected probe request frames are answered.
-To re-enable the broadcast of the SSID etc., use
-.Fl hidessid .
-.It Cm ht
-Enable use of High Throughput (HT) when using 802.11n (default).
-The 802.11n specification includes mechanisms for operation
-on 20MHz and 40MHz wide channels using different signalling mechanisms
-than specified in 802.11b, 802.11g, and 802.11a.
-Stations negotiate use of these facilities, termed HT20 and HT40,
-when they associate.
-To disable all use of 802.11n use
-.Fl ht .
-To disable use of HT20 (e.g. to force only HT40 use) use
-.Fl ht20 .
-To disable use of HT40 use
-.Fl ht40 .
-.Pp
-HT configuration is used to ``auto promote'' operation
-when several choices are available.
-For example, if a station associates to an 11n-capable access point
-it controls whether the station uses legacy operation, HT20, or HT40.
-When an 11n-capable device is setup as an access point and
-Auto Channel Selection is used to locate a channel to operate on,
-HT configuration controls whether legacy, HT20, or HT40 operation is setup
-on the selected channel.
-If a fixed channel is specified for a station then HT configuration can
-be given as part of the channel specification; e.g. 6:ht/20 to setup
-HT20 operation on channel 6.
-.It Cm htcompat
-Enable use of compatibility support for pre-802.11n devices (default).
-The 802.11n protocol specification went through several incompatible iterations.
-Some vendors implemented 11n support to older specifications that
-will not interoperate with a purely 11n-compliant station.
-In particular the information elements included in management frames
-for old devices are different.
-When compatibility support is enabled both standard and compatible data
-will be provided.
-Stations that associate using the compatiblity mechanisms are flagged
-in ``list sta''.
-To disable compatiblity support use
-.Fl htcompat .
-.It Cm htprotmode Ar technique
-For interfaces operating in 802.11n, use the specified
-.Ar technique
-for protecting HT frames in a mixed legacy/HT network.
-The set of valid techniques is
-.Cm off ,
-and
-.Cm rts
-(RTS/CTS, default).
-Technique names are case insensitive.
-.It Cm inact
-Enable inactivity processing for stations associated to an
-access point (default).
-When operating as an access point the 802.11 layer monitors
-the activity of each associated station.
-When a station is inactive for 5 minutes it will send several
-``probe frames'' to see if the station is still present.
-If no response is received then the station is deauthenticated.
-Applications that prefer to handle this work can disable this
-facility by using
-.Fl inact .
-.It Cm indoor
-Set the location to use in calculating regulatory constraints.
-The location is also advertised in beacon and probe response frames
-when 802.11d is enabled with
-.Cm dotd .
-See also
-.Cm outdoor ,
-.Cm anywhere ,
-.Cm country ,
-and
-.Cm regdomain .
-.It Cm list active
-Display the list of channels available for use taking into account
-any restrictions set with the
-.Cm chanlist
-directive.
-See the description of
-.Cm list chan
-for more information.
-.It Cm list caps
-Display the adaptor's capabilities, including the operating
-modes supported.
-.It Cm list chan
-Display the list of channels available for use.
-Channels are shown with their IEEE channel number, equivalent
-frequency, and usage modes.
-Channels identified as
-.Ql 11g
-are also usable in
-.Ql 11b
-mode.
-Channels identified as
-.Ql 11a Turbo
-may be used only for Atheros' Static Turbo mode
-(specified with
-. Cm mediaopt turbo ) .
-Channels marked with a
-.Ql *
-have a regulatory constraint that they be passively scanned.
-This means a station is not permitted to transmit on the channel until
-it identifies the channel is being used for 802.11 communication;
-typically by hearing a beacon frame from an access point operating
-on the channel.
-.Cm list freq
-is another way of requesting this information.
-By default a compacted list of channels is displayed; if the
-.Fl v
-option is specified then all channels are shown.
-.It Cm list countries
-Display the set of country codes and regulatory domains that can be
-used in regulatory configuration.
-.It Cm list mac
-Display the current MAC Access Control List state.
-Each address is prefixed with a character that indicates the
-current policy applied to it:
-.Ql +
-indicates the address is allowed access,
-.Ql -
-indicates the address is denied access,
-.Ql *
-indicates the address is present but the current policy open
-(so the ACL is not consulted).
-.It Cm list mesh
-Displays the mesh routing table, used for forwarding packets on a mesh
-network.
-.It Cm list regdomain
-Display the current regulatory settings including the available channels
-and transmit power caps.
-.It Cm list roam
-Display the parameters that govern roaming operation.
-.It Cm list txparam
-Display the parameters that govern transmit operation.
-.It Cm list txpower
-Display the transmit power caps for each channel.
-.It Cm list scan
-Display the access points and/or ad-hoc neighbors
-located in the vicinity.
-This information may be updated automatically by the adapter
-with a
-.Cm scan
-request or through background scanning.
-Depending on the capabilities of the stations the following
-flags can be included in the output:
-.Bl -tag -width 3n
-.It Li A
-Authorized.
-Indicates that the station is permitted to send/receive data frames.
-.It Li E
-Extended Rate Phy (ERP).
-Indicates that the station is operating in an 802.11g network
-using extended transmit rates.
-.It Li H
-High Throughput (HT).
-Indicates that the station is using HT transmit rates.
-If a `+' follows immediately after then the station associated
-using deprecated mechanisms supported only when
-.Cm htcompat
-is enabled.
-.It Li P
-Power Save.
-Indicates that the station is operating in power save mode.
-.It Li Q
-Quality of Service (QoS).
-Indicates that the station is using QoS encapsulation for
-data frame.
-QoS encapsulation is enabled only when WME mode is enabled.
-.It Li S
-Short Preamble.
-Indicates that the station is doing short preamble to optionally
-improve throughput performance with 802.11g and 802.11b.
-.It Li T
-Transitional Security Network (TSN).
-Indicates that the station associated using TSN; see also
-.Cm tsn
-below.
-.It Li W
-Wi-Fi Protected Setup (WPS).
-Indicates that the station associated using WPS.
-.El
-.Pp
-By default interesting information elements captured from the neighboring
-stations are displayed at the end of each row.
-Possible elements include:
-.Cm WME
-(station supports WME),
-.Cm WPA
-(station supports WPA),
-.Cm WPS
-(station supports WPS),
-.Cm RSN
-(station supports 802.11i/RSN),
-.Cm HTCAP
-(station supports 802.11n/HT communication),
-.Cm ATH
-(station supports Atheros protocol extensions),
-.Cm VEN
-(station supports unknown vendor-specific extensions).
-If the
-.Fl v
-flag is used all the information elements and their
-contents will be shown.
-Specifying the
-.Fl v
-flag also enables display of long SSIDs.
-The
-.Cm list ap
-command is another way of requesting this information.
-.It Cm list sta
-When operating as an access point display the stations that are
-currently associated.
-When operating in ad-hoc mode display stations identified as
-neighbors in the IBSS.
-When operating in mesh mode display stations identified as
-neighbors in the MBSS.
-When operating in station mode display the access point.
-Capabilities advertised by the stations are described under
-the
-.Cm scan
-request.
-Depending on the capabilities of the stations the following
-flags can be included in the output:
-.Bl -tag -width 3n
-.It Li A
-Authorized.
-Indicates that the station is permitted to send/receive data frames.
-.It Li E
-Extended Rate Phy (ERP).
-Indicates that the station is operating in an 802.11g network
-using extended transmit rates.
-.It Li H
-High Throughput (HT).
-Indicates that the station is using HT transmit rates.
-If a `+' follows immediately after then the station associated
-using deprecated mechanisms supported only when
-.Cm htcompat
-is enabled.
-.It Li P
-Power Save.
-Indicates that the station is operating in power save mode.
-.It Li Q
-Quality of Service (QoS).
-Indicates that the station is using QoS encapsulation for
-data frame.
-QoS encapsulation is enabled only when WME mode is enabled.
-.It Li S
-Short Preamble.
-Indicates that the station is doing short preamble to optionally
-improve throughput performance with 802.11g and 802.11b.
-.It Li T
-Transitional Security Network (TSN).
-Indicates that the station associated using TSN; see also
-.Cm tsn
-below.
-.It Li W
-Wi-Fi Protected Setup (WPS).
-Indicates that the station associated using WPS.
-.El
-.Pp
-By default information elements received from associated stations
-are displayed in a short form; the
-.Fl v
-flag causes this information to be displayed symbolically.
-.It Cm list wme
-Display the current channel parameters to use when operating in WME mode.
-If the
-.Fl v
-option is specified then both channel and BSS parameters are displayed
-for each AC (first channel, then BSS).
-When WME mode is enabled for an adaptor this information will be
-displayed with the regular status; this command is mostly useful
-for examining parameters when WME mode is disabled.
-See the description of the
-.Cm wme
-directive for information on the various parameters.
-.It Cm maxretry Ar count
-Set the maximum number of tries to use in sending unicast frames.
-The default setting is 6 but drivers may override this with a value
-they choose.
-.It Cm mcastrate Ar rate
-Set the rate for transmitting multicast/broadcast frames.
-Rates are specified as megabits/second in decimal; e.g.\& 5.5 for 5.5 Mb/s.
-This rate should be valid for the current operating conditions;
-if an invalid rate is specified drivers are free to chose an
-appropriate rate.
-.It Cm mgtrate Ar rate
-Set the rate for transmitting management and/or control frames.
-Rates are specified as megabits/second in decimal; e.g.\& 5.5 for 5.5 Mb/s.
-.It Cm outdoor
-Set the location to use in calculating regulatory constraints.
-The location is also advertised in beacon and probe response frames
-when 802.11d is enabled with
-.Cm dotd .
-See also
-.Cm anywhere ,
-.Cm country ,
-.Cm indoor ,
-and
-.Cm regdomain .
-.It Cm powersave
-Enable powersave operation.
-When operating as a client, the station will conserve power by
-periodically turning off the radio and listening for
-messages from the access point telling it there are packets waiting.
-The station must then retrieve the packets.
-Not all devices support power save operation as a client.
-The 802.11 specification requires that all access points support
-power save but some drivers do not.
-Use
-.Fl powersave
-to disable powersave operation when operating as a client.
-.It Cm powersavesleep Ar sleep
-Set the desired max powersave sleep time in TU's (1024 usecs).
-By default the max powersave sleep time is 100 TU's.
-.It Cm protmode Ar technique
-For interfaces operating in 802.11g, use the specified
-.Ar technique
-for protecting OFDM frames in a mixed 11b/11g network.
-The set of valid techniques is
-.Cm off , cts
-(CTS to self),
-and
-.Cm rtscts
-(RTS/CTS).
-Technique names are case insensitive.
-Not all devices support
-.Cm cts
-as a protection technique.
-.It Cm pureg
-When operating as an access point in 802.11g mode allow only
-11g-capable stations to associate (11b-only stations are not
-permitted to associate).
-To allow both 11g and 11b-only stations to associate, use
-.Fl pureg .
-.It Cm puren
-When operating as an access point in 802.11n mode allow only
-HT-capable stations to associate (legacy stations are not
-permitted to associate).
-To allow both HT and legacy stations to associate, use
-.Fl puren .
-.It Cm regdomain Ar sku
-Set the regulatory domain to use in calculating the regulatory constraints
-for operation.
-In particular the set of available channels, how the wireless device
-will operation on the channels, and the maximum transmit power that
-can be used on a channel are defined by this setting.
-Regdomain codes (SKU's) are taken from /etc/regdomain.xml and can also
-be viewed with the ``list countries'' request.
-Note that not all devices support changing the regdomain from a default
-setting; typically stored in EEPROM.
-See also
-.Cm country ,
-.Cm indoor ,
-.Cm outdoor ,
-and
-.Cm anywhere .
-.It Cm rifs
-Enable use of Reduced InterFrame Spacing (RIFS) when operating in 802.11n
-on an HT channel.
-Note that RIFS must be supported by both the station and access point
-for it to be used.
-To disable RIFS use
-.Fl rifs .
-.It Cm roam:rate Ar rate
-Set the threshold for controlling roaming when operating in a BSS.
-The
-.Ar rate
-parameter specifies the transmit rate in megabits
-at which roaming should be considered.
-If the current transmit rate drops below this setting and background scanning
-is enabled, then the system will check if a more desirable access point is
-available and switch over to it.
-The current scan cache contents are used if they are considered
-valid according to the
-.Cm scanvalid
-parameter; otherwise a background scan operation is triggered before
-any selection occurs.
-Each channel type has a separate rate threshold; the default values are:
-12 Mb/s (11a), 2 Mb/s (11b), 2 Mb/s (11g), MCS 1 (11na, 11ng).
-.It Cm roam:rssi Ar rssi
-Set the threshold for controlling roaming when operating in a BSS.
-The
-.Ar rssi
-parameter specifies the receive signal strength in dBm units
-at which roaming should be considered.
-If the current rssi drops below this setting and background scanning
-is enabled, then the system will check if a more desirable access point is
-available and switch over to it.
-The current scan cache contents are used if they are considered
-valid according to the
-.Cm scanvalid
-parameter; otherwise a background scan operation is triggered before
-any selection occurs.
-Each channel type has a separate rssi threshold; the default values are
-all 7 dBm.
-.It Cm roaming Ar mode
-When operating as a station, control how the system will
-behave when communication with the current access point
-is broken.
-The
-.Ar mode
-argument may be one of
-.Cm device
-(leave it to the hardware device to decide),
-.Cm auto
-(handle either in the device or the operating system\[em]as appropriate),
-.Cm manual
-(do nothing until explicitly instructed).
-By default, the device is left to handle this if it is
-capable; otherwise, the operating system will automatically
-attempt to reestablish communication.
-Manual mode is used by applications such as
-.Xr wpa_supplicant 8
-that want to control the selection of an access point.
-.It Cm rtsthreshold Ar length
-Set the threshold for which
-transmitted frames are preceded by transmission of an
-RTS
-control frame.
-The
-.Ar length
-argument
-is the frame size in bytes and must be in the range 1 to 2346.
-Setting
-.Ar length
-to
-.Li 2346 ,
-.Cm any ,
-or
-.Cm -
-disables transmission of RTS frames.
-Not all adapters support setting the RTS threshold.
-.It Cm scan
-Initiate a scan of neighboring stations, wait for it to complete, and
-display all stations found.
-Only the super-user can initiate a scan.
-See
-.Cm list scan
-for information on the display.
-By default a background scan is done; otherwise a foreground
-scan is done and the station may roam to a different access point.
-The
-.Cm list scan
-request can be used to show recent scan results without
-initiating a new scan.
-.It Cm scanvalid Ar threshold
-Set the maximum time the scan cache contents are considered valid;
-i.e. will be used without first triggering a scan operation to
-refresh the data.
-The
-.Ar threshold
-parameter is specified in seconds and defaults to 60 seconds.
-The minimum setting for
-.Ar threshold
-is 10 seconds.
-One should take care setting this threshold; if it is set too low
-then attempts to roam to another access point may trigger unnecessary
-background scan operations.
-.It Cm shortgi
-Enable use of Short Guard Interval when operating in 802.11n
-on an HT channel.
-NB: this currently enables Short GI on both HT40 and HT20 channels.
-To disable Short GI use
-.Fl shortgi .
-.It Cm smps
-Enable use of Static Spatial Multiplexing Power Save (SMPS)
-when operating in 802.11n.
-A station operating with Static SMPS maintains only a single
-receive chain active (this can significantly reduce power consumption).
-To disable SMPS use
-.Fl smps .
-.It Cm smpsdyn
-Enable use of Dynamic Spatial Multiplexing Power Save (SMPS)
-when operating in 802.11n.
-A station operating with Dynamic SMPS maintains only a single
-receive chain active but switches to multiple receive chains when it
-receives an RTS frame (this can significantly reduce power consumption).
-Note that stations cannot distinguish between RTS/CTS intended to
-enable multiple receive chains and those used for other purposes.
-To disable SMPS use
-.Fl smps .
-.It Cm ssid Ar ssid
-Set the desired Service Set Identifier (aka network name).
-The SSID is a string up to 32 characters
-in length and may be specified as either a normal string or in
-hexadecimal when preceded by
-.Ql 0x .
-Additionally, the SSID may be cleared by setting it to
-.Ql - .
-.It Cm tdmaslot Ar slot
-When operating with TDMA, use the specified
-.Ar slot
-configuration.
-The
-.Ar slot
-is a number between 0 and the maximum number of slots in the BSS.
-Note that a station configured as slot 0 is a master and
-will broadcast beacon frames advertising the BSS;
-stations configured to use other slots will always
-scan to locate a master before they ever transmit.
-By default
-.Cm tdmaslot
-is set to 1.
-.It Cm tdmaslotcnt Ar cnt
-When operating with TDMA, setup a BSS with
-.Ar cnt
-slots.
-The slot count may be at most 8.
-The current implementation is only tested with two stations
-(i.e. point to point applications).
-This setting is only meaningful when a station is configured as slot 0;
-other stations adopt this setting from the BSS they join.
-By default
-.Cm tdmaslotcnt
-is set to 2.
-.It Cm tdmaslotlen Ar len
-When operating with TDMA, setup a BSS such that each station has a slot
-.Ar len
-microseconds long.
-The slot length must be at least 150 microseconds (1/8 TU)
-and no more than 65 milliseconds.
-Note that setting too small a slot length may result in poor channel
-bandwidth utilization due to factors such as timer granularity and
-guard time.
-This setting is only meaningful when a station is configured as slot 0;
-other stations adopt this setting from the BSS they join.
-By default
-.Cm tdmaslotlen
-is set to 10 milliseconds.
-.It Cm tdmabintval Ar intval
-When operating with TDMA, setup a BSS such that beacons are transmitted every
-.Ar intval
-superframes to synchronize the TDMA slot timing.
-A superframe is defined as the number of slots times the slot length; e.g.
-a BSS with two slots of 10 milliseconds has a 20 millisecond superframe.
-The beacon interval may not be zero.
-A lower setting of
-.Cm tdmabintval
-causes the timers to be resynchronized more often; this can be help if
-significant timer drift is observed.
-By default
-.Cm tdmabintval
-is set to 5.
-.It Cm tsn
-When operating as an access point with WPA/802.11i allow legacy
-stations to associate using static key WEP and open authentication.
-To disallow legacy station use of WEP, use
-.Fl tsn .
-.It Cm txpower Ar power
-Set the power used to transmit frames.
-The
-.Ar power
-argument is specified in .5 dBm units.
-Out of range values are truncated.
-Typically only a few discreet power settings are available and
-the driver will use the setting closest to the specified value.
-Not all adapters support changing the transmit power.
-.It Cm ucastrate Ar rate
-Set a fixed rate for transmitting unicast frames.
-Rates are specified as megabits/second in decimal; e.g.\& 5.5 for 5.5 Mb/s.
-This rate should be valid for the current operating conditions;
-if an invalid rate is specified drivers are free to chose an
-appropriate rate.
-.It Cm wepmode Ar mode
-Set the desired WEP mode.
-Not all adapters support all modes.
-The set of valid modes is
-.Cm off , on ,
-and
-.Cm mixed .
-The
-.Cm mixed
-mode explicitly tells the adaptor to allow association with access
-points which allow both encrypted and unencrypted traffic.
-On these adapters,
-.Cm on
-means that the access point must only allow encrypted connections.
-On other adapters,
-.Cm on
-is generally another name for
-.Cm mixed .
-Modes are case insensitive.
-.It Cm weptxkey Ar index
-Set the WEP key to be used for transmission.
-This is the same as setting the default transmission key with
-.Cm deftxkey .
-.It Cm wepkey Ar key Ns | Ns Ar index : Ns Ar key
-Set the selected WEP key.
-If an
-.Ar index
-is not given, key 1 is set.
-A WEP key will be either 5 or 13
-characters (40 or 104 bits) depending of the local network and the
-capabilities of the adaptor.
-It may be specified either as a plain
-string or as a string of hexadecimal digits preceded by
-.Ql 0x .
-For maximum portability, hex keys are recommended;
-the mapping of text keys to WEP encryption is usually driver-specific.
-In particular, the
-.Tn Windows
-drivers do this mapping differently to
-.Fx .
-A key may be cleared by setting it to
-.Ql - .
-If WEP is supported then there are at least four keys.
-Some adapters support more than four keys.
-If that is the case, then the first four keys
-(1-4) will be the standard temporary keys and any others will be adaptor
-specific keys such as permanent keys stored in NVRAM.
-.Pp
-Note that you must set a default transmit key with
-.Cm deftxkey
-for the system to know which key to use in encrypting outbound traffic.
-.It Cm wme
-Enable Wireless Multimedia Extensions (WME) support, if available,
-for the specified interface.
-WME is a subset of the IEEE 802.11e standard to support the
-efficient communication of realtime and multimedia data.
-To disable WME support, use
-.Fl wme .
-Another name for this parameter is
-.Cm wmm .
-.Pp
-The following parameters are meaningful only when WME support is in use.
-Parameters are specified per-AC (Access Category) and
-split into those that are used by a station when acting
-as an access point and those for client stations in the BSS.
-The latter are received from the access point and may not be changed
-(at the station).
-The following Access Categories are recognized:
-.Pp
-.Bl -tag -width ".Cm AC_BK" -compact
-.It Cm AC_BE
-(or
-.Cm BE )
-best effort delivery,
-.It Cm AC_BK
-(or
-.Cm BK )
-background traffic,
-.It Cm AC_VI
-(or
-.Cm VI )
-video traffic,
-.It Cm AC_VO
-(or
-.Cm VO )
-voice traffic.
-.El
-.Pp
-AC parameters are case-insensitive.
-Traffic classification is done in the operating system using the
-vlan priority associated with data frames or the
-ToS (Type of Service) indication in IP-encapsulated frames.
-If neither information is present, traffic is assigned to the
-Best Effort (BE) category.
-.Bl -tag -width indent
-.It Cm ack Ar ac
-Set the ACK policy for QoS transmissions by the local station;
-this controls whether or not data frames transmitted by a station
-require an ACK response from the receiving station.
-To disable waiting for an ACK use
-.Fl ack .
-This parameter is applied only to the local station.
-.It Cm acm Ar ac
-Enable the Admission Control Mandatory (ACM) mechanism
-for transmissions by the local station.
-To disable the ACM use
-.Fl acm .
-On stations in a BSS this parameter is read-only and indicates
-the setting received from the access point.
-NB: ACM is not supported right now.
-.It Cm aifs Ar ac Ar count
-Set the Arbitration Inter Frame Spacing (AIFS)
-channel access parameter to use for transmissions
-by the local station.
-On stations in a BSS this parameter is read-only and indicates
-the setting received from the access point.
-.It Cm cwmin Ar ac Ar count
-Set the CWmin channel access parameter to use for transmissions
-by the local station.
-On stations in a BSS this parameter is read-only and indicates
-the setting received from the access point.
-.It Cm cwmax Ar ac Ar count
-Set the CWmax channel access parameter to use for transmissions
-by the local station.
-On stations in a BSS this parameter is read-only and indicates
-the setting received from the access point.
-.It Cm txoplimit Ar ac Ar limit
-Set the Transmission Opportunity Limit channel access parameter
-to use for transmissions by the local station.
-This parameter defines an interval of time when a WME station
-has the right to initiate transmissions onto the wireless medium.
-On stations in a BSS this parameter is read-only and indicates
-the setting received from the access point.
-.It Cm bss:aifs Ar ac Ar count
-Set the AIFS channel access parameter to send to stations in a BSS.
-This parameter is meaningful only when operating in ap mode.
-.It Cm bss:cwmin Ar ac Ar count
-Set the CWmin channel access parameter to send to stations in a BSS.
-This parameter is meaningful only when operating in ap mode.
-.It Cm bss:cwmax Ar ac Ar count
-Set the CWmax channel access parameter to send to stations in a BSS.
-This parameter is meaningful only when operating in ap mode.
-.It Cm bss:txoplimit Ar ac Ar limit
-Set the TxOpLimit channel access parameter to send to stations in a BSS.
-This parameter is meaningful only when operating in ap mode.
-.El
-.It Cm wps
-Enable Wireless Privacy Subscriber support.
-Note that WPS support requires a WPS-capable supplicant.
-To disable this function use
-.Fl wps .
-.El
-.Pp
-The following parameters support an optional access control list
-feature available with some adapters when operating in ap mode; see
-.Xr wlan_acl 4 .
-This facility allows an access point to accept/deny association
-requests based on the MAC address of the station.
-Note that this feature does not significantly enhance security
-as MAC address spoofing is easy to do.
-.Bl -tag -width indent
-.It Cm mac:add Ar address
-Add the specified MAC address to the database.
-Depending on the policy setting association requests from the
-specified station will be allowed or denied.
-.It Cm mac:allow
-Set the ACL policy to permit association only by
-stations registered in the database.
-.It Cm mac:del Ar address
-Delete the specified MAC address from the database.
-.It Cm mac:deny
-Set the ACL policy to deny association only by
-stations registered in the database.
-.It Cm mac:kick Ar address
-Force the specified station to be deauthenticated.
-This typically is done to block a station after updating the
-address database.
-.It Cm mac:open
-Set the ACL policy to allow all stations to associate.
-.It Cm mac:flush
-Delete all entries in the database.
-.It Cm mac:radius
-Set the ACL policy to permit association only by
-stations approved by a RADIUS server.
-Note that this feature requires the
-.Xr hostapd 8
-program be configured to do the right thing
-as it handles the RADIUS processing
-(and marks stations as authorized).
-.El
-.Pp
-The following parameters are related to a wireless interface operating in mesh
-mode:
-.Bl -tag -width indent
-.It Cm meshid Ar meshid
-Set the desired Mesh Identifier.
-The Mesh ID is a string up to 32 characters in length.
-A mesh interface must have a Mesh Identifier specified
-to reach an operational state.
-.It Cm meshttl Ar ttl
-Set the desired ``time to live'' for mesh forwarded packets;
-this is the number of hops a packet may be forwarded before
-it is discarded.
-The default setting for
-.Cm meshttl
-is 31.
-.It Cm meshpeering
-Enable or disable peering with neighbor mesh stations.
-Stations must peer before any data packets can be exchanged.
-By default
-.Cm meshpeering
-is enabled.
-.It Cm meshforward
-Enable or disable forwarding packets by a mesh interface.
-By default
-.Cm meshforward
-is enabled.
-.It Cm meshmetric Ar protocol
-Set the specified
-.Ar protocol
-as the link metric protocol used on a mesh network.
-The default protocol is called
-.Ar AIRTIME .
-The mesh interface will restart after changing this setting.
-.It Cm meshpath Ar protocol
-Set the specified
-.Ar protocol
-as the path selection protocol used on a mesh network.
-The only available protocol at the moment is called
-.Ar HWMP
-(Hybrid Wireless Mesh Protocol).
-The mesh interface will restart after changing this setting.
-.It Cm hwmprootmode Ar mode
-Stations on a mesh network can operate as ``root nodes.''
-Root nodes try to find paths to all mesh nodes and advertise themselves
-regularly.
-When there is a root mesh node on a network, other mesh nodes can setup
-paths between themselves faster because they can use the root node
-to find the destination.
-This path may not be the best, but on-demand
-routing will eventually find the best path.
-The following modes are recognized:
-.Pp
-.Bl -tag -width ".Cm PROACTIVE" -compact
-.It Cm DISABLED
-Disable root mode.
-.It Cm NORMAL
-Send broadcast path requests every two seconds.
-Nodes on the mesh without a path to this root mesh station with try to
-discover a path to us.
-.It Cm PROACTIVE
-Send broadcast path requests every two seconds and every node must reply with
-with a path reply even if it already has a path to this root mesh station,
-.It Cm RANN
-Send broadcast root annoucement (RANN) frames.
-Nodes on the mesh without a path to this root mesh station with try to
-discover a path to us.
-.El
-By default
-.Cm hwmprootmode
-is set to
-.Ar DISABLED .
-.It Cm hwmpmaxhops Ar cnt
-Set the maximum number of hops allowed in an HMWP path to
-.Ar cnt .
-The default setting for
-.Cm hwmpmaxhops
-is 31.
-.El
-.Pp
-The following parameters are for compatibility with other systems:
-.Bl -tag -width indent
-.It Cm nwid Ar ssid
-Another name for the
-.Cm ssid
-parameter.
-Included for
-.Nx
-compatibility.
-.It Cm stationname Ar name
-Set the name of this station.
-The station name is not part of the IEEE 802.11
-protocol though some interfaces support it.
-As such it only
-seems to be meaningful to identical or virtually identical equipment.
-Setting the station name is identical in syntax to setting the SSID.
-One can also use
-.Cm station
-for
-.Bsx
-compatibility.
-.It Cm wep
-Another way of saying
-.Cm wepmode on .
-Included for
-.Bsx
-compatibility.
-.It Fl wep
-Another way of saying
-.Cm wepmode off .
-Included for
-.Bsx
-compatibility.
-.It Cm nwkey key
-Another way of saying:
-.Dq Li "wepmode on weptxkey 1 wepkey 1:key wepkey 2:- wepkey 3:- wepkey 4:-" .
-Included for
-.Nx
-compatibility.
-.It Cm nwkey Xo
-.Sm off
-.Ar n : k1 , k2 , k3 , k4
-.Sm on
-.Xc
-Another way of saying
-.Dq Li "wepmode on weptxkey n wepkey 1:k1 wepkey 2:k2 wepkey 3:k3 wepkey 4:k4" .
-Included for
-.Nx
-compatibility.
-.It Fl nwkey
-Another way of saying
-.Cm wepmode off .
-Included for
-.Nx
-compatibility.
-.El
-.Pp
-The following parameters are specific to bridge interfaces:
-.Bl -tag -width indent
-.It Cm addm Ar interface
-Add the interface named by
-.Ar interface
-as a member of the bridge.
-The interface is put into promiscuous mode
-so that it can receive every packet sent on the network.
-.It Cm deletem Ar interface
-Remove the interface named by
-.Ar interface
-from the bridge.
-Promiscuous mode is disabled on the interface when
-it is removed from the bridge.
-.It Cm maxaddr Ar size
-Set the size of the bridge address cache to
-.Ar size .
-The default is 100 entries.
-.It Cm timeout Ar seconds
-Set the timeout of address cache entries to
-.Ar seconds
-seconds.
-If
-.Ar seconds
-is zero, then address cache entries will not be expired.
-The default is 240 seconds.
-.It Cm addr
-Display the addresses that have been learned by the bridge.
-.It Cm static Ar interface-name Ar address
-Add a static entry into the address cache pointing to
-.Ar interface-name .
-Static entries are never aged out of the cache or re-placed, even if the
-address is seen on a different interface.
-.It Cm deladdr Ar address
-Delete
-.Ar address
-from the address cache.
-.It Cm flush
-Delete all dynamically-learned addresses from the address cache.
-.It Cm flushall
-Delete all addresses, including static addresses, from the address cache.
-.It Cm discover Ar interface
-Mark an interface as a
-.Dq discovering
-interface.
-When the bridge has no address cache entry
-(either dynamic or static)
-for the destination address of a packet,
-the bridge will forward the packet to all
-member interfaces marked as
-.Dq discovering .
-This is the default for all interfaces added to a bridge.
-.It Cm -discover Ar interface
-Clear the
-.Dq discovering
-attribute on a member interface.
-For packets without the
-.Dq discovering
-attribute, the only packets forwarded on the interface are broadcast
-or multicast packets and packets for which the destination address
-is known to be on the interface's segment.
-.It Cm learn Ar interface
-Mark an interface as a
-.Dq learning
-interface.
-When a packet arrives on such an interface, the source
-address of the packet is entered into the address cache as being a
-destination address on the interface's segment.
-This is the default for all interfaces added to a bridge.
-.It Cm -learn Ar interface
-Clear the
-.Dq learning
-attribute on a member interface.
-.It Cm sticky Ar interface
-Mark an interface as a
-.Dq sticky
-interface.
-Dynamically learned address entries are treated at static once entered into
-the cache.
-Sticky entries are never aged out of the cache or replaced, even if the
-address is seen on a different interface.
-.It Cm -sticky Ar interface
-Clear the
-.Dq sticky
-attribute on a member interface.
-.It Cm private Ar interface
-Mark an interface as a
-.Dq private
-interface.
-A private interface does not forward any traffic to any other port that is also
-a private interface.
-.It Cm -private Ar interface
-Clear the
-.Dq private
-attribute on a member interface.
-.It Cm span Ar interface
-Add the interface named by
-.Ar interface
-as a span port on the bridge.
-Span ports transmit a copy of every frame received by the bridge.
-This is most useful for snooping a bridged network passively on
-another host connected to one of the span ports of the bridge.
-.It Cm -span Ar interface
-Delete the interface named by
-.Ar interface
-from the list of span ports of the bridge.
-.It Cm stp Ar interface
-Enable Spanning Tree protocol on
-.Ar interface .
-The
-.Xr if_bridge 4
-driver has support for the IEEE 802.1D Spanning Tree protocol (STP).
-Spanning Tree is used to detect and remove loops in a network topology.
-.It Cm -stp Ar interface
-Disable Spanning Tree protocol on
-.Ar interface .
-This is the default for all interfaces added to a bridge.
-.It Cm edge Ar interface
-Set
-.Ar interface
-as an edge port.
-An edge port connects directly to end stations cannot create bridging
-loops in the network, this allows it to transition straight to forwarding.
-.It Cm -edge Ar interface
-Disable edge status on
-.Ar interface .
-.It Cm autoedge Ar interface
-Allow
-.Ar interface
-to automatically detect edge status.
-This is the default for all interfaces added to a bridge.
-.It Cm -autoedge Ar interface
-Disable automatic edge status on
-.Ar interface .
-.It Cm ptp Ar interface
-Set the
-.Ar interface
-as a point to point link.
-This is required for straight transitions to forwarding and
-should be enabled on a direct link to another RSTP capable switch.
-.It Cm -ptp Ar interface
-Disable point to point link status on
-.Ar interface .
-This should be disabled for a half duplex link and for an interface
-connected to a shared network segment,
-like a hub or a wireless network.
-.It Cm autoptp Ar interface
-Automatically detect the point to point status on
-.Ar interface
-by checking the full duplex link status.
-This is the default for interfaces added to the bridge.
-.It Cm -autoptp Ar interface
-Disable automatic point to point link detection on
-.Ar interface .
-.It Cm maxage Ar seconds
-Set the time that a Spanning Tree protocol configuration is valid.
-The default is 20 seconds.
-The minimum is 6 seconds and the maximum is 40 seconds.
-.It Cm fwddelay Ar seconds
-Set the time that must pass before an interface begins forwarding
-packets when Spanning Tree is enabled.
-The default is 15 seconds.
-The minimum is 4 seconds and the maximum is 30 seconds.
-.It Cm hellotime Ar seconds
-Set the time between broadcasting of Spanning Tree protocol
-configuration messages.
-The hello time may only be changed when operating in legacy stp mode.
-The default is 2 seconds.
-The minimum is 1 second and the maximum is 2 seconds.
-.It Cm priority Ar value
-Set the bridge priority for Spanning Tree.
-The default is 32768.
-The minimum is 0 and the maximum is 61440.
-.It Cm proto Ar value
-Set the Spanning Tree protocol.
-The default is rstp.
-The available options are stp and rstp.
-.It Cm holdcnt Ar value
-Set the transmit hold count for Spanning Tree.
-This is the number of packets transmitted before being rate limited.
-The default is 6.
-The minimum is 1 and the maximum is 10.
-.It Cm ifpriority Ar interface Ar value
-Set the Spanning Tree priority of
-.Ar interface
-to
-.Ar value .
-The default is 128.
-The minimum is 0 and the maximum is 240.
-.It Cm ifpathcost Ar interface Ar value
-Set the Spanning Tree path cost of
-.Ar interface
-to
-.Ar value .
-The default is calculated from the link speed.
-To change a previously selected path cost back to automatic, set the
-cost to 0.
-The minimum is 1 and the maximum is 200000000.
-.It Cm ifmaxaddr Ar interface Ar size
-Set the maximum number of hosts allowed from an interface, packets with unknown
-source addresses are dropped until an existing host cache entry expires or is
-removed.
-Set to 0 to disable.
-.El
-.Pp
-The following parameters are specific to lagg interfaces:
-.Bl -tag -width indent
-.It Cm laggport Ar interface
-Add the interface named by
-.Ar interface
-as a port of the aggregation interface.
-.It Cm -laggport Ar interface
-Remove the interface named by
-.Ar interface
-from the aggregation interface.
-.It Cm laggproto Ar proto
-Set the aggregation protocol.
-The default is failover.
-The available options are failover, fec, lacp, loadbalance, roundrobin and
-none.
-.El
-.Pp
-The following parameters are specific to IP tunnel interfaces,
-.Xr gif 4 :
-.Bl -tag -width indent
-.It Cm tunnel Ar src_addr dest_addr
-Configure the physical source and destination address for IP tunnel
-interfaces.
-The arguments
-.Ar src_addr
-and
-.Ar dest_addr
-are interpreted as the outer source/destination for the encapsulating
-IPv4/IPv6 header.
-.It Fl tunnel
-Unconfigure the physical source and destination address for IP tunnel
-interfaces previously configured with
-.Cm tunnel .
-.It Cm deletetunnel
-Another name for the
-.Fl tunnel
-parameter.
-.It Cm accept_rev_ethip_ver
-Set a flag to acccept both correct EtherIP packets and ones
-with reversed version field. Enabled by default.
-This is for backward compatibility with
-.Fx 6.1 ,
-6.2, 6.3, 7.0, and 7.1.
-.It Cm -accept_rev_ethip_ver
-Clear a flag
-.Cm accept_rev_ethip_ver .
-.It Cm send_rev_ethip_ver
-Set a flag to send EtherIP packets with reversed version
-field intentionally. Disabled by default.
-This is for backward compatibility with
-.Fx 6.1 ,
-6.2, 6.3, 7.0, and 7.1.
-.It Cm -send_rev_ethip_ver
-Clear a flag
-.Cm send_rev_ethip_ver .
-.El
-.Pp
-The following parameters are specific to GRE tunnel interfaces,
-.Xr gre 4 :
-.Bl -tag -width indent
-.It Cm grekey Ar key
-Configure the GRE key to be used for outgoing packets.
-Note that
-.Xr gre 4 will always accept GRE packets with invalid or absent keys.
-This command will result in a four byte MTU reduction on the interface.
-.El
-.Pp
-The following parameters are specific to
-.Xr pfsync 4
-interfaces:
-.Bl -tag -width indent
-.It Cm maxupd Ar n
-Set the maximum number of updates for a single state which
-can be collapsed into one.
-This is an 8-bit number; the default value is 128.
-.El
-.Pp
-The following parameters are specific to
-.Xr vlan 4
-interfaces:
-.Bl -tag -width indent
-.It Cm vlan Ar vlan_tag
-Set the VLAN tag value to
-.Ar vlan_tag .
-This value is a 16-bit number which is used to create an 802.1Q
-VLAN header for packets sent from the
-.Xr vlan 4
-interface.
-Note that
-.Cm vlan
-and
-.Cm vlandev
-must both be set at the same time.
-.It Cm vlandev Ar iface
-Associate the physical interface
-.Ar iface
-with a
-.Xr vlan 4
-interface.
-Packets transmitted through the
-.Xr vlan 4
-interface will be
-diverted to the specified physical interface
-.Ar iface
-with 802.1Q VLAN encapsulation.
-Packets with 802.1Q encapsulation received
-by the parent interface with the correct VLAN tag will be diverted to
-the associated
-.Xr vlan 4
-pseudo-interface.
-The
-.Xr vlan 4
-interface is assigned a
-copy of the parent interface's flags and the parent's ethernet address.
-The
-.Cm vlandev
-and
-.Cm vlan
-must both be set at the same time.
-If the
-.Xr vlan 4
-interface already has
-a physical interface associated with it, this command will fail.
-To
-change the association to another physical interface, the existing
-association must be cleared first.
-.Pp
-Note: if the hardware tagging capability
-is set on the parent interface, the
-.Xr vlan 4
-pseudo
-interface's behavior changes:
-the
-.Xr vlan 4
-interface recognizes that the
-parent interface supports insertion and extraction of VLAN tags on its
-own (usually in firmware) and that it should pass packets to and from
-the parent unaltered.
-.It Fl vlandev Op Ar iface
-If the driver is a
-.Xr vlan 4
-pseudo device, disassociate the parent interface from it.
-This breaks the link between the
-.Xr vlan 4
-interface and its parent,
-clears its VLAN tag, flags and its link address and shuts the interface down.
-The
-.Ar iface
-argument is useless and hence deprecated.
-.El
-.Pp
-The following parameters are specific to
-.Xr carp 4
-interfaces:
-.Bl -tag -width indent
-.It Cm advbase Ar seconds
-Specifies the base of the advertisement interval in seconds.
-The acceptable values are 1 to 255.
-The default value is 1.
-.\" The default value is
-.\" .Dv CARP_DFLTINTV .
-.It Cm advskew Ar interval
-Specifies the skew to add to the base advertisement interval to
-make one host advertise slower than another host.
-It is specified in 1/256 of seconds.
-The acceptable values are 1 to 254.
-The default value is 0.
-.It Cm pass Ar phrase
-Set the authentication key to
-.Ar phrase .
-.It Cm vhid Ar n
-Set the virtual host ID.
-This is a required setting.
-Acceptable values are 1 to 255.
-.El
-.Pp
-The
-.Nm
-utility displays the current configuration for a network interface
-when no optional parameters are supplied.
-If a protocol family is specified,
-.Nm
-will report only the details specific to that protocol family.
-.Pp
-If the
-.Fl m
-flag is passed before an interface name,
-.Nm
-will display the capability list and all
-of the supported media for the specified interface.
-If
-.Fl L
-flag is supplied, address lifetime is displayed for IPv6 addresses,
-as time offset string.
-.Pp
-Optionally, the
-.Fl a
-flag may be used instead of an interface name.
-This flag instructs
-.Nm
-to display information about all interfaces in the system.
-The
-.Fl d
-flag limits this to interfaces that are down, and
-.Fl u
-limits this to interfaces that are up.
-When no arguments are given,
-.Fl a
-is implied.
-.Pp
-The
-.Fl l
-flag may be used to list all available interfaces on the system, with
-no other additional information.
-Use of this flag is mutually exclusive
-with all other flags and commands, except for
-.Fl d
-(only list interfaces that are down)
-and
-.Fl u
-(only list interfaces that are up).
-.Pp
-The
-.Fl v
-flag may be used to get more verbose status for an interface.
-.Pp
-The
-.Fl C
-flag may be used to list all of the interface cloners available on
-the system, with no additional information.
-Use of this flag is mutually exclusive with all other flags and commands.
-.Pp
-The
-.Fl k
-flag causes keying information for the interface, if available, to be
-printed.
-For example, the values of 802.11 WEP keys will be printed, if accessible to
-the current user.
-This information is not printed by default, as it may be considered
-sensitive.
-.Pp
-If the network interface driver is not present in the kernel then
-.Nm
-will attempt to load it.
-The
-.Fl n
-flag disables this behavior.
-.Pp
-Only the super-user may modify the configuration of a network interface.
-.Sh NOTES
-The media selection system is relatively new and only some drivers support
-it (or have need for it).
-.Sh EXAMPLES
-Assign the IPv4 address
-.Li 192.0.2.10 ,
-with a network mask of
-.Li 255.255.255.0 ,
-to the interface
-.Li fxp0 :
-.Dl # ifconfig fxp0 inet 192.0.2.10 netmask 255.255.255.0
-.Pp
-Add the IPv4 address
-.Li 192.0.2.45 ,
-with the CIDR network prefix
-.Li /28 ,
-to the interface
-.Li ed0 ,
-using
-.Cm add
-as a synonym for the canonical form of the option
-.Cm alias :
-.Dl # ifconfig ed0 inet 192.0.2.45/28 add
-.Pp
-Remove the IPv4 address
-.Li 192.0.2.45
-from the interface
-.Li ed0 :
-.Dl # ifconfig ed0 inet 192.0.2.45 -alias
-.Pp
-Add the IPv6 address
-.Li 2001:DB8:DBDB::123/48
-to the interface
-.Li em0 :
-.Dl # ifconfig em0 inet6 2001:db8:bdbd::123 prefixlen 48 alias
-Note that lower case hexadecimal IPv6 addresses are acceptable.
-.Pp
-Remove the IPv6 address added in the above example,
-using the
-.Li /
-character as shorthand for the network prefix,
-and using
-.Cm delete
-as a synonym for the canonical form of the option
-.Fl alias :
-.Dl # ifconfig em0 inet6 2001:db8:bdbd::123/48 delete
-.Pp
-Configure the interface
-.Li xl0 ,
-to use 100baseTX, full duplex Ethernet media options:
-.Dl # ifconfig xl0 media 100baseTX mediaopt full-duplex
-.Pp
-Label the em0 interface as an uplink:
-.Pp
-.Dl # ifconfig em0 description \&"Uplink to Gigabit Switch 2\&"
-.Pp
-Create the software network interface
-.Li gif1 :
-.Dl # ifconfig gif1 create
-.Pp
-Destroy the software network interface
-.Li gif1 :
-.Dl # ifconfig gif1 destroy
-.Sh DIAGNOSTICS
-Messages indicating the specified interface does not exist, the
-requested address is unknown, or the user is not privileged and
-tried to alter an interface's configuration.
-.Sh SEE ALSO
-.Xr netstat 1 ,
-.Xr carp 4 ,
-.Xr gif 4 ,
-.Xr netintro 4 ,
-.Xr pfsync 4 ,
-.Xr polling 4 ,
-.Xr vlan 4 ,
-.\" .Xr eon 5 ,
-.Xr rc 8 ,
-.Xr routed 8 ,
-.Xr jail 8 ,
-.Xr sysctl 8
-.Sh HISTORY
-The
-.Nm
-utility appeared in
-.Bx 4.2 .
-.Sh BUGS
-Basic IPv6 node operation requires a link-local address on each
-interface configured for IPv6.
-Normally, such an address is automatically configured by the
-kernel on each interface added to the system; this behaviour may
-be disabled by setting the sysctl MIB variable
-.Va net.inet6.ip6.auto_linklocal
-to 0.
-.Pp
-If you delete such an address using
-.Nm ,
-the kernel may act very odd.
-Do this at your own risk.
diff --git a/freebsd-userspace/commands/sbin/ifconfig/regdomain.c b/freebsd-userspace/commands/sbin/ifconfig/regdomain.c
deleted file mode 100644
index 41402895..00000000
--- a/freebsd-userspace/commands/sbin/ifconfig/regdomain.c
+++ /dev/null
@@ -1,705 +0,0 @@
-/*-
- * Copyright (c) 2008 Sam Leffler, Errno Consulting
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef lint
-static const char rcsid[] = "$FreeBSD$";
-#endif /* not lint */
-
-#include <sys/types.h>
-#include <sys/errno.h>
-#include <sys/mman.h>
-#include <sys/sbuf.h>
-#include <sys/stat.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <fcntl.h>
-#include <err.h>
-#include <unistd.h>
-
-#include <bsdxml.h>
-
-#include "regdomain.h"
-
-#include <net80211/_ieee80211.h>
-
-#define MAXLEVEL 20
-
-struct mystate {
- XML_Parser parser;
- struct regdata *rdp;
- struct regdomain *rd; /* current domain */
- struct netband *netband; /* current netband */
- struct freqband *freqband; /* current freqband */
- struct country *country; /* current country */
- netband_head *curband; /* current netband list */
- int level;
- struct sbuf *sbuf[MAXLEVEL];
- int nident;
-};
-
-struct ident {
- const void *id;
- void *p;
- enum { DOMAIN, COUNTRY, FREQBAND } type;
-};
-
-static void
-start_element(void *data, const char *name, const char **attr)
-{
-#define iseq(a,b) (strcasecmp(a,b) == 0)
- struct mystate *mt;
- const void *id, *ref, *mode;
- int i;
-
- mt = data;
- if (++mt->level == MAXLEVEL) {
- /* XXX force parser to abort */
- return;
- }
- mt->sbuf[mt->level] = sbuf_new_auto();
- id = ref = mode = NULL;
- for (i = 0; attr[i] != NULL; i += 2) {
- if (iseq(attr[i], "id")) {
- id = attr[i+1];
- } else if (iseq(attr[i], "ref")) {
- ref = attr[i+1];
- } else if (iseq(attr[i], "mode")) {
- mode = attr[i+1];
- } else
- printf("%*.*s[%s = %s]\n", mt->level + 1,
- mt->level + 1, "", attr[i], attr[i+1]);
- }
- if (iseq(name, "rd") && mt->rd == NULL) {
- if (mt->country == NULL) {
- mt->rd = calloc(1, sizeof(struct regdomain));
- mt->rd->name = strdup(id);
- mt->nident++;
- LIST_INSERT_HEAD(&mt->rdp->domains, mt->rd, next);
- } else
- mt->country->rd = (void *)strdup(ref);
- return;
- }
- if (iseq(name, "defcc") && mt->rd != NULL) {
- mt->rd->cc = (void *)strdup(ref);
- return;
- }
- if (iseq(name, "netband") && mt->curband == NULL && mt->rd != NULL) {
- if (mode == NULL) {
- warnx("no mode for netband at line %ld",
- XML_GetCurrentLineNumber(mt->parser));
- return;
- }
- if (iseq(mode, "11b"))
- mt->curband = &mt->rd->bands_11b;
- else if (iseq(mode, "11g"))
- mt->curband = &mt->rd->bands_11g;
- else if (iseq(mode, "11a"))
- mt->curband = &mt->rd->bands_11a;
- else if (iseq(mode, "11ng"))
- mt->curband = &mt->rd->bands_11ng;
- else if (iseq(mode, "11na"))
- mt->curband = &mt->rd->bands_11na;
- else
- warnx("unknown mode \"%s\" at line %ld",
- __DECONST(char *, mode),
- XML_GetCurrentLineNumber(mt->parser));
- return;
- }
- if (iseq(name, "band") && mt->netband == NULL) {
- if (mt->curband == NULL) {
- warnx("band without enclosing netband at line %ld",
- XML_GetCurrentLineNumber(mt->parser));
- return;
- }
- mt->netband = calloc(1, sizeof(struct netband));
- LIST_INSERT_HEAD(mt->curband, mt->netband, next);
- return;
- }
- if (iseq(name, "freqband") && mt->freqband == NULL && mt->netband != NULL) {
- /* XXX handle inlines and merge into table? */
- if (mt->netband->band != NULL) {
- warnx("duplicate freqband at line %ld ignored",
- XML_GetCurrentLineNumber(mt->parser));
- /* XXX complain */
- } else
- mt->netband->band = (void *)strdup(ref);
- return;
- }
-
- if (iseq(name, "country") && mt->country == NULL) {
- mt->country = calloc(1, sizeof(struct country));
- mt->country->isoname = strdup(id);
- mt->country->code = NO_COUNTRY;
- mt->nident++;
- LIST_INSERT_HEAD(&mt->rdp->countries, mt->country, next);
- return;
- }
-
- if (iseq(name, "freqband") && mt->freqband == NULL) {
- mt->freqband = calloc(1, sizeof(struct freqband));
- mt->freqband->id = strdup(id);
- mt->nident++;
- LIST_INSERT_HEAD(&mt->rdp->freqbands, mt->freqband, next);
- return;
- }
-#undef iseq
-}
-
-static int
-decode_flag(struct mystate *mt, const char *p, int len)
-{
-#define iseq(a,b) (strcasecmp(a,b) == 0)
- static const struct {
- const char *name;
- int len;
- uint32_t value;
- } flags[] = {
-#define FLAG(x) { #x, sizeof(#x)-1, x }
- FLAG(IEEE80211_CHAN_A),
- FLAG(IEEE80211_CHAN_B),
- FLAG(IEEE80211_CHAN_G),
- FLAG(IEEE80211_CHAN_HT20),
- FLAG(IEEE80211_CHAN_HT40),
- FLAG(IEEE80211_CHAN_ST),
- FLAG(IEEE80211_CHAN_TURBO),
- FLAG(IEEE80211_CHAN_PASSIVE),
- FLAG(IEEE80211_CHAN_DFS),
- FLAG(IEEE80211_CHAN_CCK),
- FLAG(IEEE80211_CHAN_OFDM),
- FLAG(IEEE80211_CHAN_2GHZ),
- FLAG(IEEE80211_CHAN_5GHZ),
- FLAG(IEEE80211_CHAN_DYN),
- FLAG(IEEE80211_CHAN_GFSK),
- FLAG(IEEE80211_CHAN_GSM),
- FLAG(IEEE80211_CHAN_STURBO),
- FLAG(IEEE80211_CHAN_HALF),
- FLAG(IEEE80211_CHAN_QUARTER),
- FLAG(IEEE80211_CHAN_HT40U),
- FLAG(IEEE80211_CHAN_HT40D),
- FLAG(IEEE80211_CHAN_4MSXMIT),
- FLAG(IEEE80211_CHAN_NOADHOC),
- FLAG(IEEE80211_CHAN_NOHOSTAP),
- FLAG(IEEE80211_CHAN_11D),
- FLAG(IEEE80211_CHAN_FHSS),
- FLAG(IEEE80211_CHAN_PUREG),
- FLAG(IEEE80211_CHAN_108A),
- FLAG(IEEE80211_CHAN_108G),
-#undef FLAG
- { "ECM", 3, REQ_ECM },
- { "INDOOR", 6, REQ_INDOOR },
- { "OUTDOOR", 7, REQ_OUTDOOR },
- };
- int i;
-
- for (i = 0; i < sizeof(flags)/sizeof(flags[0]); i++)
- if (len == flags[i].len && iseq(p, flags[i].name))
- return flags[i].value;
- warnx("unknown flag \"%.*s\" at line %ld ignored",
- len, p, XML_GetCurrentLineNumber(mt->parser));
- return 0;
-#undef iseq
-}
-
-static void
-end_element(void *data, const char *name)
-{
-#define iseq(a,b) (strcasecmp(a,b) == 0)
- struct mystate *mt;
- int len;
- char *p;
-
- mt = data;
- sbuf_finish(mt->sbuf[mt->level]);
- p = sbuf_data(mt->sbuf[mt->level]);
- len = sbuf_len(mt->sbuf[mt->level]);
-
- /* <freqband>...</freqband> */
- if (iseq(name, "freqstart") && mt->freqband != NULL) {
- mt->freqband->freqStart = strtoul(p, NULL, 0);
- goto done;
- }
- if (iseq(name, "freqend") && mt->freqband != NULL) {
- mt->freqband->freqEnd = strtoul(p, NULL, 0);
- goto done;
- }
- if (iseq(name, "chanwidth") && mt->freqband != NULL) {
- mt->freqband->chanWidth = strtoul(p, NULL, 0);
- goto done;
- }
- if (iseq(name, "chansep") && mt->freqband != NULL) {
- mt->freqband->chanSep = strtoul(p, NULL, 0);
- goto done;
- }
- if (iseq(name, "flags")) {
- if (mt->freqband != NULL)
- mt->freqband->flags |= decode_flag(mt, p, len);
- else if (mt->netband != NULL)
- mt->netband->flags |= decode_flag(mt, p, len);
- else {
- warnx("flags without freqband or netband at line %ld ignored",
- XML_GetCurrentLineNumber(mt->parser));
- }
- goto done;
- }
-
- /* <rd> ... </rd> */
- if (iseq(name, "name") && mt->rd != NULL) {
- mt->rd->name = strdup(p);
- goto done;
- }
- if (iseq(name, "sku") && mt->rd != NULL) {
- mt->rd->sku = strtoul(p, NULL, 0);
- goto done;
- }
- if (iseq(name, "netband") && mt->rd != NULL) {
- mt->curband = NULL;
- goto done;
- }
-
- /* <band> ... </band> */
- if (iseq(name, "freqband") && mt->netband != NULL) {
- /* XXX handle inline freqbands */
- goto done;
- }
- if (iseq(name, "maxpower") && mt->netband != NULL) {
- mt->netband->maxPower = strtoul(p, NULL, 0);
- goto done;
- }
- if (iseq(name, "maxpowerdfs") && mt->netband != NULL) {
- mt->netband->maxPowerDFS = strtoul(p, NULL, 0);
- goto done;
- }
- if (iseq(name, "maxantgain") && mt->netband != NULL) {
- mt->netband->maxAntGain = strtoul(p, NULL, 0);
- goto done;
- }
-
- /* <country>...</country> */
- if (iseq(name, "isocc") && mt->country != NULL) {
- mt->country->code = strtoul(p, NULL, 0);
- goto done;
- }
- if (iseq(name, "name") && mt->country != NULL) {
- mt->country->name = strdup(p);
- goto done;
- }
-
- if (len != 0) {
- warnx("unexpected XML token \"%s\" data \"%s\" at line %ld",
- name, p, XML_GetCurrentLineNumber(mt->parser));
- /* XXX goto done? */
- }
- /* </freqband> */
- if (iseq(name, "freqband") && mt->freqband != NULL) {
- /* XXX must have start/end frequencies */
- /* XXX must have channel width/sep */
- mt->freqband = NULL;
- goto done;
- }
- /* </rd> */
- if (iseq(name, "rd") && mt->rd != NULL) {
- mt->rd = NULL;
- goto done;
- }
- /* </band> */
- if (iseq(name, "band") && mt->netband != NULL) {
- if (mt->netband->band == NULL) {
- warnx("no freqbands for band at line %ld",
- XML_GetCurrentLineNumber(mt->parser));
- }
- if (mt->netband->maxPower == 0) {
- warnx("no maxpower for band at line %ld",
- XML_GetCurrentLineNumber(mt->parser));
- }
- /* default max power w/ DFS to max power */
- if (mt->netband->maxPowerDFS == 0)
- mt->netband->maxPowerDFS = mt->netband->maxPower;
- mt->netband = NULL;
- goto done;
- }
- /* </netband> */
- if (iseq(name, "netband") && mt->netband != NULL) {
- mt->curband = NULL;
- goto done;
- }
- /* </country> */
- if (iseq(name, "country") && mt->country != NULL) {
- if (mt->country->code == NO_COUNTRY) {
- warnx("no ISO cc for country at line %ld",
- XML_GetCurrentLineNumber(mt->parser));
- }
- if (mt->country->name == NULL) {
- warnx("no name for country at line %ld",
- XML_GetCurrentLineNumber(mt->parser));
- }
- if (mt->country->rd == NULL) {
- warnx("no regdomain reference for country at line %ld",
- XML_GetCurrentLineNumber(mt->parser));
- }
- mt->country = NULL;
- goto done;
- }
-done:
- sbuf_delete(mt->sbuf[mt->level]);
- mt->sbuf[mt->level--] = NULL;
-#undef iseq
-}
-
-static void
-char_data(void *data, const XML_Char *s, int len)
-{
- struct mystate *mt;
- const char *b, *e;
-
- mt = data;
-
- b = s;
- e = s + len-1;
- for (; isspace(*b) && b < e; b++)
- ;
- for (; isspace(*e) && e > b; e++)
- ;
- if (e != b || (*b != '\0' && !isspace(*b)))
- sbuf_bcat(mt->sbuf[mt->level], b, e-b+1);
-}
-
-static void *
-findid(struct regdata *rdp, const void *id, int type)
-{
- struct ident *ip;
-
- for (ip = rdp->ident; ip->id != NULL; ip++)
- if (ip->type == type && strcasecmp(ip->id, id) == 0)
- return ip->p;
- return NULL;
-}
-
-/*
- * Parse an regdomain XML configuration and build the internal representation.
- */
-int
-lib80211_regdomain_readconfig(struct regdata *rdp, const void *p, size_t len)
-{
- struct mystate *mt;
- struct regdomain *dp;
- struct country *cp;
- struct freqband *fp;
- struct netband *nb;
- const void *id;
- int i, errors;
-
- memset(rdp, 0, sizeof(struct regdata));
- mt = calloc(1, sizeof(struct mystate));
- if (mt == NULL)
- return ENOMEM;
- /* parse the XML input */
- mt->rdp = rdp;
- mt->parser = XML_ParserCreate(NULL);
- XML_SetUserData(mt->parser, mt);
- XML_SetElementHandler(mt->parser, start_element, end_element);
- XML_SetCharacterDataHandler(mt->parser, char_data);
- if (XML_Parse(mt->parser, p, len, 1) != XML_STATUS_OK) {
- warnx("%s: %s at line %ld", __func__,
- XML_ErrorString(XML_GetErrorCode(mt->parser)),
- XML_GetCurrentLineNumber(mt->parser));
- return -1;
- }
- XML_ParserFree(mt->parser);
-
- /* setup the identifer table */
- rdp->ident = calloc(sizeof(struct ident), mt->nident + 1);
- if (rdp->ident == NULL)
- return ENOMEM;
- free(mt);
-
- errors = 0;
- i = 0;
- LIST_FOREACH(dp, &rdp->domains, next) {
- rdp->ident[i].id = dp->name;
- rdp->ident[i].p = dp;
- rdp->ident[i].type = DOMAIN;
- i++;
- }
- LIST_FOREACH(fp, &rdp->freqbands, next) {
- rdp->ident[i].id = fp->id;
- rdp->ident[i].p = fp;
- rdp->ident[i].type = FREQBAND;
- i++;
- }
- LIST_FOREACH(cp, &rdp->countries, next) {
- rdp->ident[i].id = cp->isoname;
- rdp->ident[i].p = cp;
- rdp->ident[i].type = COUNTRY;
- i++;
- }
-
- /* patch references */
- LIST_FOREACH(dp, &rdp->domains, next) {
- if (dp->cc != NULL) {
- id = dp->cc;
- dp->cc = findid(rdp, id, COUNTRY);
- if (dp->cc == NULL) {
- warnx("undefined country \"%s\"",
- __DECONST(char *, id));
- errors++;
- }
- free(__DECONST(char *, id));
- }
- LIST_FOREACH(nb, &dp->bands_11b, next) {
- id = findid(rdp, nb->band, FREQBAND);
- if (id == NULL) {
- warnx("undefined 11b band \"%s\"",
- __DECONST(char *, nb->band));
- errors++;
- }
- nb->band = id;
- }
- LIST_FOREACH(nb, &dp->bands_11g, next) {
- id = findid(rdp, nb->band, FREQBAND);
- if (id == NULL) {
- warnx("undefined 11g band \"%s\"",
- __DECONST(char *, nb->band));
- errors++;
- }
- nb->band = id;
- }
- LIST_FOREACH(nb, &dp->bands_11a, next) {
- id = findid(rdp, nb->band, FREQBAND);
- if (id == NULL) {
- warnx("undefined 11a band \"%s\"",
- __DECONST(char *, nb->band));
- errors++;
- }
- nb->band = id;
- }
- LIST_FOREACH(nb, &dp->bands_11ng, next) {
- id = findid(rdp, nb->band, FREQBAND);
- if (id == NULL) {
- warnx("undefined 11ng band \"%s\"",
- __DECONST(char *, nb->band));
- errors++;
- }
- nb->band = id;
- }
- LIST_FOREACH(nb, &dp->bands_11na, next) {
- id = findid(rdp, nb->band, FREQBAND);
- if (id == NULL) {
- warnx("undefined 11na band \"%s\"",
- __DECONST(char *, nb->band));
- errors++;
- }
- nb->band = id;
- }
- }
- LIST_FOREACH(cp, &rdp->countries, next) {
- id = cp->rd;
- cp->rd = findid(rdp, id, DOMAIN);
- if (cp->rd == NULL) {
- warnx("undefined country \"%s\"",
- __DECONST(char *, id));
- errors++;
- }
- free(__DECONST(char *, id));
- }
-
- return errors ? EINVAL : 0;
-}
-
-static void
-cleanup_bands(netband_head *head)
-{
- struct netband *nb;
-
- for (;;) {
- nb = LIST_FIRST(head);
- if (nb == NULL)
- break;
- free(nb);
- }
-}
-
-/*
- * Cleanup state/resources for a previously parsed regdomain database.
- */
-void
-lib80211_regdomain_cleanup(struct regdata *rdp)
-{
-
- free(rdp->ident);
- rdp->ident = NULL;
- for (;;) {
- struct regdomain *dp = LIST_FIRST(&rdp->domains);
- if (dp == NULL)
- break;
- LIST_REMOVE(dp, next);
- cleanup_bands(&dp->bands_11b);
- cleanup_bands(&dp->bands_11g);
- cleanup_bands(&dp->bands_11a);
- cleanup_bands(&dp->bands_11ng);
- cleanup_bands(&dp->bands_11na);
- if (dp->name != NULL)
- free(__DECONST(char *, dp->name));
- }
- for (;;) {
- struct country *cp = LIST_FIRST(&rdp->countries);
- if (cp == NULL)
- break;
- LIST_REMOVE(cp, next);
- if (cp->name != NULL)
- free(__DECONST(char *, cp->name));
- free(cp);
- }
- for (;;) {
- struct freqband *fp = LIST_FIRST(&rdp->freqbands);
- if (fp == NULL)
- break;
- LIST_REMOVE(fp, next);
- free(fp);
- }
-}
-
-struct regdata *
-lib80211_alloc_regdata(void)
-{
- struct regdata *rdp;
- struct stat sb;
- void *xml;
- int fd;
-
- rdp = calloc(1, sizeof(struct regdata));
-
- fd = open(_PATH_REGDOMAIN, O_RDONLY);
- if (fd < 0) {
-#ifdef DEBUG
- warn("%s: open(%s)", __func__, _PATH_REGDOMAIN);
-#endif
- free(rdp);
- return NULL;
- }
- if (fstat(fd, &sb) < 0) {
-#ifdef DEBUG
- warn("%s: fstat(%s)", __func__, _PATH_REGDOMAIN);
-#endif
- close(fd);
- free(rdp);
- return NULL;
- }
- xml = mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
- if (xml == MAP_FAILED) {
-#ifdef DEBUG
- warn("%s: mmap", __func__);
-#endif
- close(fd);
- free(rdp);
- return NULL;
- }
- if (lib80211_regdomain_readconfig(rdp, xml, sb.st_size) != 0) {
-#ifdef DEBUG
- warn("%s: error reading regulatory database", __func__);
-#endif
- munmap(xml, sb.st_size);
- close(fd);
- free(rdp);
- return NULL;
- }
- munmap(xml, sb.st_size);
- close(fd);
-
- return rdp;
-}
-
-void
-lib80211_free_regdata(struct regdata *rdp)
-{
- lib80211_regdomain_cleanup(rdp);
- free(rdp);
-}
-
-/*
- * Lookup a regdomain by SKU.
- */
-const struct regdomain *
-lib80211_regdomain_findbysku(const struct regdata *rdp, enum RegdomainCode sku)
-{
- const struct regdomain *dp;
-
- LIST_FOREACH(dp, &rdp->domains, next) {
- if (dp->sku == sku)
- return dp;
- }
- return NULL;
-}
-
-/*
- * Lookup a regdomain by name.
- */
-const struct regdomain *
-lib80211_regdomain_findbyname(const struct regdata *rdp, const char *name)
-{
- const struct regdomain *dp;
-
- LIST_FOREACH(dp, &rdp->domains, next) {
- if (strcasecmp(dp->name, name) == 0)
- return dp;
- }
- return NULL;
-}
-
-/*
- * Lookup a country by ISO country code.
- */
-const struct country *
-lib80211_country_findbycc(const struct regdata *rdp, enum ISOCountryCode cc)
-{
- const struct country *cp;
-
- LIST_FOREACH(cp, &rdp->countries, next) {
- if (cp->code == cc)
- return cp;
- }
- return NULL;
-}
-
-/*
- * Lookup a country by ISO/long name.
- */
-const struct country *
-lib80211_country_findbyname(const struct regdata *rdp, const char *name)
-{
- const struct country *cp;
- int len;
-
- len = strlen(name);
- LIST_FOREACH(cp, &rdp->countries, next) {
- if (strcasecmp(cp->isoname, name) == 0)
- return cp;
- }
- LIST_FOREACH(cp, &rdp->countries, next) {
- if (strncasecmp(cp->name, name, len) == 0)
- return cp;
- }
- return NULL;
-}
diff --git a/freebsd-userspace/commands/sbin/ping/ping.8 b/freebsd-userspace/commands/sbin/ping/ping.8
deleted file mode 100644
index 76175855..00000000
--- a/freebsd-userspace/commands/sbin/ping/ping.8
+++ /dev/null
@@ -1,554 +0,0 @@
-.\" Copyright (c) 1985, 1991, 1993
-.\" The Regents of the University of California. All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" @(#)ping.8 8.2 (Berkeley) 12/11/93
-.\" $FreeBSD$
-.\"
-.Dd April 4, 2006
-.Dt PING 8
-.Os
-.Sh NAME
-.Nm ping
-.Nd send
-.Tn ICMP ECHO_REQUEST
-packets to network hosts
-.Sh SYNOPSIS
-.Nm
-.Op Fl AaDdfnoQqRrv
-.Op Fl c Ar count
-.Op Fl G Ar sweepmaxsize
-.Op Fl g Ar sweepminsize
-.Op Fl h Ar sweepincrsize
-.Op Fl i Ar wait
-.Op Fl l Ar preload
-.Op Fl M Cm mask | time
-.Op Fl m Ar ttl
-.Op Fl P Ar policy
-.Op Fl p Ar pattern
-.Op Fl S Ar src_addr
-.Op Fl s Ar packetsize
-.Op Fl t Ar timeout
-.Op Fl W Ar waittime
-.Op Fl z Ar tos
-.Ar host
-.Nm
-.Op Fl AaDdfLnoQqRrv
-.Op Fl c Ar count
-.Op Fl I Ar iface
-.Op Fl i Ar wait
-.Op Fl l Ar preload
-.Op Fl M Cm mask | time
-.Op Fl m Ar ttl
-.Op Fl P Ar policy
-.Op Fl p Ar pattern
-.Op Fl S Ar src_addr
-.Op Fl s Ar packetsize
-.Op Fl T Ar ttl
-.Op Fl t Ar timeout
-.Op Fl W Ar waittime
-.Op Fl z Ar tos
-.Ar mcast-group
-.Sh DESCRIPTION
-The
-.Nm
-utility uses the
-.Tn ICMP
-.No protocol Ap s mandatory
-.Tn ECHO_REQUEST
-datagram to elicit an
-.Tn ICMP ECHO_RESPONSE
-from a host or gateway.
-.Tn ECHO_REQUEST
-datagrams
-.Pq Dq pings
-have an IP and
-.Tn ICMP
-header, followed by a
-.Dq struct timeval
-and then an arbitrary number of
-.Dq pad
-bytes used to fill out the packet.
-The options are as follows:
-.Bl -tag -width indent
-.It Fl A
-Audible.
-Output a bell
-.Tn ( ASCII
-0x07)
-character when no packet is received before the next packet
-is transmitted.
-To cater for round-trip times that are longer than the interval
-between transmissions, further missing packets cause a bell only
-if the maximum number of unreceived packets has increased.
-.It Fl a
-Audible.
-Include a bell
-.Tn ( ASCII
-0x07)
-character in the output when any packet is received.
-This option is ignored
-if other format options are present.
-.It Fl c Ar count
-Stop after sending
-(and receiving)
-.Ar count
-.Tn ECHO_RESPONSE
-packets.
-If this option is not specified,
-.Nm
-will operate until interrupted.
-If this option is specified in conjunction with ping sweeps,
-each sweep will consist of
-.Ar count
-packets.
-.It Fl D
-Set the Don't Fragment bit.
-.It Fl d
-Set the
-.Dv SO_DEBUG
-option on the socket being used.
-.It Fl f
-Flood ping.
-Outputs packets as fast as they come back or one hundred times per second,
-whichever is more.
-For every
-.Tn ECHO_REQUEST
-sent a period
-.Dq .\&
-is printed, while for every
-.Tn ECHO_REPLY
-received a backspace is printed.
-This provides a rapid display of how many packets are being dropped.
-Only the super-user may use this option.
-.Bf -emphasis
-This can be very hard on a network and should be used with caution.
-.Ef
-.It Fl G Ar sweepmaxsize
-Specify the maximum size of
-.Tn ICMP
-payload when sending sweeping pings.
-This option is required for ping sweeps.
-.It Fl g Ar sweepminsize
-Specify the size of
-.Tn ICMP
-payload to start with when sending sweeping pings.
-The default value is 0.
-.It Fl h Ar sweepincrsize
-Specify the number of bytes to increment the size of
-.Tn ICMP
-payload after
-each sweep when sending sweeping pings.
-The default value is 1.
-.It Fl I Ar iface
-Source multicast packets with the given interface address.
-This flag only applies if the ping destination is a multicast address.
-.It Fl i Ar wait
-Wait
-.Ar wait
-seconds
-.Em between sending each packet .
-The default is to wait for one second between each packet.
-The wait time may be fractional, but only the super-user may specify
-values less than 1 second.
-This option is incompatible with the
-.Fl f
-option.
-.It Fl L
-Suppress loopback of multicast packets.
-This flag only applies if the ping destination is a multicast address.
-.It Fl l Ar preload
-If
-.Ar preload
-is specified,
-.Nm
-sends that many packets as fast as possible before falling into its normal
-mode of behavior.
-Only the super-user may use this option.
-.It Fl M Cm mask | time
-Use
-.Dv ICMP_MASKREQ
-or
-.Dv ICMP_TSTAMP
-instead of
-.Dv ICMP_ECHO .
-For
-.Cm mask ,
-print the netmask of the remote machine.
-Set the
-.Va net.inet.icmp.maskrepl
-MIB variable to enable
-.Dv ICMP_MASKREPLY .
-For
-.Cm time ,
-print the origination, reception and transmission timestamps.
-.It Fl m Ar ttl
-Set the IP Time To Live for outgoing packets.
-If not specified, the kernel uses the value of the
-.Va net.inet.ip.ttl
-MIB variable.
-.It Fl n
-Numeric output only.
-No attempt will be made to lookup symbolic names for host addresses.
-.It Fl o
-Exit successfully after receiving one reply packet.
-.It Fl P Ar policy
-.Ar policy
-specifies IPsec policy for the ping session.
-For details please refer to
-.Xr ipsec 4
-and
-.Xr ipsec_set_policy 3 .
-.It Fl p Ar pattern
-You may specify up to 16
-.Dq pad
-bytes to fill out the packet you send.
-This is useful for diagnosing data-dependent problems in a network.
-For example,
-.Dq Li \-p ff
-will cause the sent packet to be filled with all
-ones.
-.It Fl Q
-Somewhat quiet output.
-.No Don Ap t
-display ICMP error messages that are in response to our query messages.
-Originally, the
-.Fl v
-flag was required to display such errors, but
-.Fl v
-displays all ICMP error messages.
-On a busy machine, this output can be overbearing.
-Without the
-.Fl Q
-flag,
-.Nm
-prints out any ICMP error messages caused by its own ECHO_REQUEST
-messages.
-.It Fl q
-Quiet output.
-Nothing is displayed except the summary lines at startup time and
-when finished.
-.It Fl R
-Record route.
-Includes the
-.Tn RECORD_ROUTE
-option in the
-.Tn ECHO_REQUEST
-packet and displays
-the route buffer on returned packets.
-Note that the IP header is only large enough for nine such routes;
-the
-.Xr traceroute 8
-command is usually better at determining the route packets take to a
-particular destination.
-If more routes come back than should, such as due to an illegal spoofed
-packet, ping will print the route list and then truncate it at the correct
-spot.
-Many hosts ignore or discard the
-.Tn RECORD_ROUTE
-option.
-.It Fl r
-Bypass the normal routing tables and send directly to a host on an attached
-network.
-If the host is not on a directly-attached network, an error is returned.
-This option can be used to ping a local host through an interface
-that has no route through it
-(e.g., after the interface was dropped by
-.Xr routed 8 ) .
-.It Fl S Ar src_addr
-Use the following IP address as the source address in outgoing packets.
-On hosts with more than one IP address, this option can be used to
-force the source address to be something other than the IP address
-of the interface the probe packet is sent on.
-If the IP address
-is not one of this machine's interface addresses, an error is
-returned and nothing is sent.
-.It Fl s Ar packetsize
-Specify the number of data bytes to be sent.
-The default is 56, which translates into 64
-.Tn ICMP
-data bytes when combined
-with the 8 bytes of
-.Tn ICMP
-header data.
-Only the super-user may specify values more than default.
-This option cannot be used with ping sweeps.
-.It Fl T Ar ttl
-Set the IP Time To Live for multicasted packets.
-This flag only applies if the ping destination is a multicast address.
-.It Fl t Ar timeout
-Specify a timeout, in seconds, before ping exits regardless of how
-many packets have been received.
-.It Fl v
-Verbose output.
-.Tn ICMP
-packets other than
-.Tn ECHO_RESPONSE
-that are received are listed.
-.It Fl W Ar waittime
-Time in milliseconds to wait for a reply for each packet sent.
-If a reply arrives later, the packet is not printed as replied, but
-considered as replied when calculating statistics.
-.It Fl z Ar tos
-Use the specified type of service.
-.El
-.Pp
-When using
-.Nm
-for fault isolation, it should first be run on the local host, to verify
-that the local network interface is up and running.
-Then, hosts and gateways further and further away should be
-.Dq pinged .
-Round-trip times and packet loss statistics are computed.
-If duplicate packets are received, they are not included in the packet
-loss calculation, although the round trip time of these packets is used
-in calculating the round-trip time statistics.
-When the specified number of packets have been sent
-(and received)
-or if the program is terminated with a
-.Dv SIGINT ,
-a brief summary is displayed, showing the number of packets sent and
-received, and the minimum, mean, maximum, and standard deviation of
-the round-trip times.
-.Pp
-If
-.Nm
-receives a
-.Dv SIGINFO
-(see the
-.Cm status
-argument for
-.Xr stty 1 )
-signal, the current number of packets sent and received, and the
-minimum, mean, and maximum of the round-trip times will be written to
-the standard error output.
-.Pp
-This program is intended for use in network testing, measurement and
-management.
-Because of the load it can impose on the network, it is unwise to use
-.Nm
-during normal operations or from automated scripts.
-.Sh ICMP PACKET DETAILS
-An IP header without options is 20 bytes.
-An
-.Tn ICMP
-.Tn ECHO_REQUEST
-packet contains an additional 8 bytes worth of
-.Tn ICMP
-header followed by an arbitrary amount of data.
-When a
-.Ar packetsize
-is given, this indicated the size of this extra piece of data
-(the default is 56).
-Thus the amount of data received inside of an IP packet of type
-.Tn ICMP
-.Tn ECHO_REPLY
-will always be 8 bytes more than the requested data space
-(the
-.Tn ICMP
-header).
-.Pp
-If the data space is at least eight bytes large,
-.Nm
-uses the first eight bytes of this space to include a timestamp which
-it uses in the computation of round trip times.
-If less than eight bytes of pad are specified, no round trip times are
-given.
-.Sh DUPLICATE AND DAMAGED PACKETS
-The
-.Nm
-utility will report duplicate and damaged packets.
-Duplicate packets should never occur when pinging a unicast address,
-and seem to be caused by
-inappropriate link-level retransmissions.
-Duplicates may occur in many situations and are rarely
-(if ever)
-a good sign, although the presence of low levels of duplicates may not
-always be cause for alarm.
-Duplicates are expected when pinging a broadcast or multicast address,
-since they are not really duplicates but replies from different hosts
-to the same request.
-.Pp
-Damaged packets are obviously serious cause for alarm and often
-indicate broken hardware somewhere in the
-.Nm
-packet's path (in the network or in the hosts).
-.Sh TRYING DIFFERENT DATA PATTERNS
-The
-(inter)network
-layer should never treat packets differently depending on the data
-contained in the data portion.
-Unfortunately, data-dependent problems have been known to sneak into
-networks and remain undetected for long periods of time.
-In many cases the particular pattern that will have problems is something
-that does not have sufficient
-.Dq transitions ,
-such as all ones or all zeros, or a pattern right at the edge, such as
-almost all zeros.
-It is not
-necessarily enough to specify a data pattern of all zeros (for example)
-on the command line because the pattern that is of interest is
-at the data link level, and the relationship between what you type and
-what the controllers transmit can be complicated.
-.Pp
-This means that if you have a data-dependent problem you will probably
-have to do a lot of testing to find it.
-If you are lucky, you may manage to find a file that either
-cannot
-be sent across your network or that takes much longer to transfer than
-other similar length files.
-You can then examine this file for repeated patterns that you can test
-using the
-.Fl p
-option of
-.Nm .
-.Sh TTL DETAILS
-The
-.Tn TTL
-value of an IP packet represents the maximum number of IP routers
-that the packet can go through before being thrown away.
-In current practice you can expect each router in the Internet to decrement
-the
-.Tn TTL
-field by exactly one.
-.Pp
-The
-.Tn TCP/IP
-specification recommends setting the
-.Tn TTL
-field for
-.Tn IP
-packets to 64, but many systems use smaller values
-.No ( Bx 4.3
-uses 30,
-.Bx 4.2
-used 15).
-.Pp
-The maximum possible value of this field is 255, and most
-.Ux
-systems set
-the
-.Tn TTL
-field of
-.Tn ICMP ECHO_REQUEST
-packets to 255.
-This is why you will find you can
-.Dq ping
-some hosts, but not reach them with
-.Xr telnet 1
-or
-.Xr ftp 1 .
-.Pp
-In normal operation
-.Nm
-prints the ttl value from the packet it receives.
-When a remote system receives a ping packet, it can do one of three things
-with the
-.Tn TTL
-field in its response:
-.Bl -bullet
-.It
-Not change it; this is what
-.Bx
-systems did before the
-.Bx 4.3 tahoe
-release.
-In this case the
-.Tn TTL
-value in the received packet will be 255 minus the
-number of routers in the round-trip path.
-.It
-Set it to 255; this is what current
-.Bx
-systems do.
-In this case the
-.Tn TTL
-value in the received packet will be 255 minus the
-number of routers in the path
-.Em from
-the remote system
-.Em to
-the
-.Nm Ns Em ing
-host.
-.It
-Set it to some other value.
-Some machines use the same value for
-.Tn ICMP
-packets that they use for
-.Tn TCP
-packets, for example either 30 or 60.
-Others may use completely wild values.
-.El
-.Sh EXIT STATUS
-The
-.Nm
-utility exits with one of the following values:
-.Bl -tag -width indent
-.It 0
-At least one response was heard from the specified
-.Ar host .
-.It 2
-The transmission was successful but no responses were received.
-.It any other value
-An error occurred.
-These values are defined in
-.In sysexits.h .
-.El
-.Sh SEE ALSO
-.Xr netstat 1 ,
-.Xr ifconfig 8 ,
-.Xr routed 8 ,
-.Xr traceroute 8
-.Sh HISTORY
-The
-.Nm
-utility appeared in
-.Bx 4.3 .
-.Sh AUTHORS
-The original
-.Nm
-utility was written by
-.An Mike Muuss
-while at the US Army Ballistics
-Research Laboratory.
-.Sh BUGS
-Many Hosts and Gateways ignore the
-.Tn RECORD_ROUTE
-option.
-.Pp
-The maximum IP header length is too small for options like
-.Tn RECORD_ROUTE
-to be completely useful.
-.No There Ap s
-not much that can be done about this, however.
-.Pp
-Flood pinging is not recommended in general, and flood pinging the
-broadcast address should only be done under very controlled conditions.
-.Pp
-The
-.Fl v
-option is not worth much on busy hosts.
diff --git a/freebsd-userspace/commands/sbin/ping6/ping6.8 b/freebsd-userspace/commands/sbin/ping6/ping6.8
deleted file mode 100644
index 3298deaa..00000000
--- a/freebsd-userspace/commands/sbin/ping6/ping6.8
+++ /dev/null
@@ -1,532 +0,0 @@
-.\" $KAME: ping6.8,v 1.58 2003/06/20 12:00:22 itojun Exp $
-.\"
-.\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of the project nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $FreeBSD$
-.\"
-.Dd April 20, 2010
-.Dt PING6 8
-.Os
-.Sh NAME
-.Nm ping6
-.Nd send
-.Tn ICMPv6 ECHO_REQUEST
-packets to network hosts
-.Sh SYNOPSIS
-.Nm
-.\" without ipsec, or new ipsec
-.Op Fl DdfHmnNoqrRtvwW
-.\" old ipsec
-.\" .Op Fl ADdEfmnNqRtvwW
-.Bk -words
-.Op Fl a Ar addrtype
-.Ek
-.Bk -words
-.Op Fl b Ar bufsiz
-.Ek
-.Bk -words
-.Op Fl c Ar count
-.Ek
-.Bk -words
-.Op Fl g Ar gateway
-.Ek
-.Bk -words
-.Op Fl h Ar hoplimit
-.Ek
-.Bk -words
-.Op Fl I Ar interface
-.Ek
-.Bk -words
-.Op Fl i Ar wait
-.Ek
-.Bk -words
-.Op Fl l Ar preload
-.Ek
-.Bk -words
-.\" new ipsec
-.Op Fl P Ar policy
-.Ek
-.Bk -words
-.Op Fl p Ar pattern
-.Ek
-.Bk -words
-.Op Fl S Ar sourceaddr
-.Ek
-.Bk -words
-.Op Fl s Ar packetsize
-.Ek
-.Bk -words
-.Op Ar hops ...
-.Ek
-.Bk -words
-.Ar host
-.Ek
-.Sh DESCRIPTION
-The
-.Nm
-utility uses the
-.Tn ICMPv6
-protocol's mandatory
-.Tn ICMP6_ECHO_REQUEST
-datagram to elicit an
-.Tn ICMP6_ECHO_REPLY
-from a host or gateway.
-.Tn ICMP6_ECHO_REQUEST
-datagrams (``pings'') have an IPv6 header,
-and
-.Tn ICMPv6
-header formatted as documented in RFC2463.
-The options are as follows:
-.Bl -tag -width Ds
-.\" old ipsec
-.\" .It Fl A
-.\" Enables transport-mode IPsec authentication header
-.\" (experimental).
-.It Fl a Ar addrtype
-Generate ICMPv6 Node Information Node Addresses query, rather than echo-request.
-.Ar addrtype
-must be a string constructed of the following characters.
-.Bl -tag -width Ds -compact
-.It Ic a
-requests unicast addresses from all of the responder's interfaces.
-If the character is omitted,
-only those addresses which belong to the interface which has the
-responder's address are requests.
-.It Ic c
-requests responder's IPv4-compatible and IPv4-mapped addresses.
-.It Ic g
-requests responder's global-scope addresses.
-.It Ic s
-requests responder's site-local addresses.
-.It Ic l
-requests responder's link-local addresses.
-.It Ic A
-requests responder's anycast addresses.
-Without this character, the responder will return unicast addresses only.
-With this character, the responder will return anycast addresses only.
-Note that the specification does not specify how to get responder's
-anycast addresses.
-This is an experimental option.
-.El
-.It Fl b Ar bufsiz
-Set socket buffer size.
-.It Fl c Ar count
-Stop after sending
-(and receiving)
-.Ar count
-.Tn ECHO_RESPONSE
-packets.
-.It Fl D
-Disable IPv6 fragmentation.
-.It Fl d
-Set the
-.Dv SO_DEBUG
-option on the socket being used.
-.\" .It Fl E
-.\" Enables transport-mode IPsec encapsulated security payload
-.\" (experimental).
-.It Fl f
-Flood ping.
-Outputs packets as fast as they come back or one hundred times per second,
-whichever is more.
-For every
-.Tn ECHO_REQUEST
-sent a period
-.Dq \&.
-is printed, while for every
-.Tn ECHO_REPLY
-received a backspace is printed.
-This provides a rapid display of how many packets are being dropped.
-Only the super-user may use this option.
-.Bf -emphasis
-This can be very hard on a network and should be used with caution.
-.Ef
-.It Fl g Ar gateway
-Specifies to use
-.Ar gateway
-as the next hop to the destination.
-The gateway must be a neighbor of the sending node.
-.It Fl H
-Specifies to try reverse-lookup of IPv6 addresses.
-The
-.Nm
-utility does not try reverse-lookup unless the option is specified.
-.It Fl h Ar hoplimit
-Set the IPv6 hoplimit.
-.It Fl I Ar interface
-Source packets with the given interface address.
-This flag applies if the ping destination is a multicast address,
-or link-local/site-local unicast address.
-.It Fl i Ar wait
-Wait
-.Ar wait
-seconds
-.Em between sending each packet .
-The default is to wait for one second between each packet.
-This option is incompatible with the
-.Fl f
-option.
-.It Fl l Ar preload
-If
-.Ar preload
-is specified,
-.Nm
-sends that many packets as fast as possible before falling into its normal
-mode of behavior.
-Only the super-user may use this option.
-.It Fl m
-By default,
-.Nm
-asks the kernel to fragment packets to fit into the minimum IPv6 MTU.
-The
-.Fl m
-option
-will suppress the behavior in the following two levels:
-when the option is specified once, the behavior will be disabled for
-unicast packets.
-When the option is more than once, it will be disabled for both
-unicast and multicast packets.
-.It Fl n
-Numeric output only.
-No attempt will be made to lookup symbolic names from addresses in the reply.
-.It Fl N
-Probe node information multicast group
-.Pq Li ff02::2:xxxx:xxxx .
-.Ar host
-must be string hostname of the target
-(must not be a numeric IPv6 address).
-Node information multicast group will be computed based on given
-.Ar host ,
-and will be used as the final destination.
-Since node information multicast group is a link-local multicast group,
-outgoing interface needs to be specified by
-.Fl I
-option.
-.It Fl o
-Exit successfully after receiving one reply packet.
-.It Fl p Ar pattern
-You may specify up to 16
-.Dq pad
-bytes to fill out the packet you send.
-This is useful for diagnosing data-dependent problems in a network.
-For example,
-.Dq Li \-p ff
-will cause the sent packet to be filled with all
-ones.
-.\" new ipsec
-.It Fl P Ar policy
-.Ar policy
-specifies IPsec policy to be used for the probe.
-.It Fl q
-Quiet output.
-Nothing is displayed except the summary lines at startup time and
-when finished.
-.It Fl r
-Audible.
-Include a bell
-.Tn ( ASCII
-0x07)
-character in the output when any packet is received.
-.It Fl R
-Audible.
-Output a bell
-.Tn ( ASCII
-0x07)
-character when no packet is received before the next packet
-is transmitted.
-To cater for round-trip times that are longer than the interval
-between transmissions, further missing packets cause a bell only
-if the maximum number of unreceived packets has increased.
-.It Fl S Ar sourceaddr
-Specifies the source address of request packets.
-The source address must be one of the unicast addresses of the sending node,
-and must be numeric.
-.It Fl s Ar packetsize
-Specifies the number of data bytes to be sent.
-The default is 56, which translates into 64
-.Tn ICMP
-data bytes when combined
-with the 8 bytes of
-.Tn ICMP
-header data.
-You may need to specify
-.Fl b
-as well to extend socket buffer size.
-.It Fl t
-Generate ICMPv6 Node Information supported query types query,
-rather than echo-request.
-.Fl s
-has no effect if
-.Fl t
-is specified.
-.It Fl v
-Verbose output.
-.Tn ICMP
-packets other than
-.Tn ECHO_RESPONSE
-that are received are listed.
-.It Fl w
-Generate ICMPv6 Node Information DNS Name query, rather than echo-request.
-.Fl s
-has no effect if
-.Fl w
-is specified.
-.It Fl W
-Same as
-.Fl w ,
-but with old packet format based on 03 draft.
-This option is present for backward compatibility.
-.Fl s
-has no effect if
-.Fl w
-is specified.
-.It Ar hops
-IPv6 addresses for intermediate nodes,
-which will be put into type 0 routing header.
-.It Ar host
-IPv6 address of the final destination node.
-.El
-.Pp
-When using
-.Nm
-for fault isolation, it should first be run on the local host, to verify
-that the local network interface is up and running.
-Then, hosts and gateways further and further away should be
-.Dq pinged .
-Round-trip times and packet loss statistics are computed.
-If duplicate packets are received, they are not included in the packet
-loss calculation, although the round trip time of these packets is used
-in calculating the round-trip time statistics.
-When the specified number of packets have been sent
-(and received)
-or if the program is terminated with a
-.Dv SIGINT ,
-a brief summary is displayed, showing the number of packets sent and
-received, and the minimum, mean, maximum, and standard deviation of
-the round-trip times.
-.Pp
-If
-.Nm
-receives a
-.Dv SIGINFO
-(see the
-.Cm status
-argument for
-.Xr stty 1 )
-signal, the current number of packets sent and received, and the
-minimum, mean, maximum, and standard deviation of the round-trip times
-will be written to the standard output in the same format as the
-standard completion message.
-.Pp
-This program is intended for use in network testing, measurement and
-management.
-Because of the load it can impose on the network, it is unwise to use
-.Nm
-during normal operations or from automated scripts.
-.\" .Sh ICMP PACKET DETAILS
-.\" An IP header without options is 20 bytes.
-.\" An
-.\" .Tn ICMP
-.\" .Tn ECHO_REQUEST
-.\" packet contains an additional 8 bytes worth of
-.\" .Tn ICMP
-.\" header followed by an arbitrary amount of data.
-.\" When a
-.\" .Ar packetsize
-.\" is given, this indicated the size of this extra piece of data
-.\" (the default is 56).
-.\" Thus the amount of data received inside of an IP packet of type
-.\" .Tn ICMP
-.\" .Tn ECHO_REPLY
-.\" will always be 8 bytes more than the requested data space
-.\" (the
-.\" .Tn ICMP
-.\" header).
-.\" .Pp
-.\" If the data space is at least eight bytes large,
-.\" .Nm
-.\" uses the first eight bytes of this space to include a timestamp which
-.\" it uses in the computation of round trip times.
-.\" If less than eight bytes of pad are specified, no round trip times are
-.\" given.
-.Sh DUPLICATE AND DAMAGED PACKETS
-The
-.Nm
-utility will report duplicate and damaged packets.
-Duplicate packets should never occur when pinging a unicast address,
-and seem to be caused by
-inappropriate link-level retransmissions.
-Duplicates may occur in many situations and are rarely
-(if ever)
-a good sign, although the presence of low levels of duplicates may not
-always be cause for alarm.
-Duplicates are expected when pinging a broadcast or multicast address,
-since they are not really duplicates but replies from different hosts
-to the same request.
-.Pp
-Damaged packets are obviously serious cause for alarm and often
-indicate broken hardware somewhere in the
-.Nm
-packet's path
-(in the network or in the hosts).
-.Sh TRYING DIFFERENT DATA PATTERNS
-The
-(inter)network
-layer should never treat packets differently depending on the data
-contained in the data portion.
-Unfortunately, data-dependent problems have been known to sneak into
-networks and remain undetected for long periods of time.
-In many cases the particular pattern that will have problems is something
-that does not have sufficient
-.Dq transitions ,
-such as all ones or all zeros, or a pattern right at the edge, such as
-almost all zeros.
-It is not
-necessarily enough to specify a data pattern of all zeros (for example)
-on the command line because the pattern that is of interest is
-at the data link level, and the relationship between what you type and
-what the controllers transmit can be complicated.
-.Pp
-This means that if you have a data-dependent problem you will probably
-have to do a lot of testing to find it.
-If you are lucky, you may manage to find a file that either
-cannot
-be sent across your network or that takes much longer to transfer than
-other similar length files.
-You can then examine this file for repeated patterns that you can test
-using the
-.Fl p
-option of
-.Nm .
-.Sh EXIT STATUS
-The
-.Nm
-utility returns 0 on success (the host is alive),
-2 if the transmission was successful but no responses were received,
-any other non-zero value if the arguments are incorrect or
-another error has occured.
-.Sh EXAMPLES
-Normally,
-.Nm
-works just like
-.Xr ping 8
-would work; the following will send ICMPv6 echo request to
-.Li dst.foo.com .
-.Bd -literal -offset indent
-ping6 -n dst.foo.com
-.Ed
-.Pp
-The following will probe hostnames for all nodes on the network link attached to
-.Li wi0
-interface.
-The address
-.Li ff02::1
-is named the link-local all-node multicast address, and the packet would
-reach every node on the network link.
-.Bd -literal -offset indent
-ping6 -w ff02::1%wi0
-.Ed
-.Pp
-The following will probe addresses assigned to the destination node,
-.Li dst.foo.com .
-.Bd -literal -offset indent
-ping6 -a agl dst.foo.com
-.Ed
-.Sh SEE ALSO
-.Xr netstat 1 ,
-.Xr icmp6 4 ,
-.Xr inet6 4 ,
-.Xr ip6 4 ,
-.Xr ifconfig 8 ,
-.Xr ping 8 ,
-.Xr routed 8 ,
-.Xr traceroute 8 ,
-.Xr traceroute6 8
-.Rs
-.%A A. Conta
-.%A S. Deering
-.%T "Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6) Specification"
-.%N RFC2463
-.%D December 1998
-.Re
-.Rs
-.%A Matt Crawford
-.%T "IPv6 Node Information Queries"
-.%N draft-ietf-ipngwg-icmp-name-lookups-09.txt
-.%D May 2002
-.%O work in progress material
-.Re
-.Sh HISTORY
-The
-.Xr ping 8
-utility appeared in
-.Bx 4.3 .
-The
-.Nm
-utility with IPv6 support first appeared in the WIDE Hydrangea IPv6
-protocol stack kit.
-.Pp
-IPv6 and IPsec support based on the KAME Project
-.Pq Pa http://www.kame.net/
-stack was initially integrated into
-.Fx 4.0 .
-.Sh BUGS
-The
-.Nm
-utility
-is intentionally separate from
-.Xr ping 8 .
-.Pp
-There have been many discussions on why we separate
-.Nm
-and
-.Xr ping 8 .
-Some people argued that it would be more convenient to uniform the
-ping command for both IPv4 and IPv6.
-The followings are an answer to the request.
-.Pp
-From a developer's point of view:
-since the underling raw sockets API is totally different between IPv4
-and IPv6, we would end up having two types of code base.
-There would actually be less benefit to uniform the two commands
-into a single command from the developer's standpoint.
-.Pp
-From an operator's point of view: unlike ordinary network applications
-like remote login tools, we are usually aware of address family when using
-network management tools.
-We do not just want to know the reachability to the host, but want to know the
-reachability to the host via a particular network protocol such as
-IPv6.
-Thus, even if we had a unified
-.Xr ping 8
-command for both IPv4 and IPv6, we would usually type a
-.Fl 6
-or
-.Fl 4
-option (or something like those) to specify the particular address family.
-This essentially means that we have two different commands.
diff --git a/freebsd-userspace/commands/sbin/route/route.8 b/freebsd-userspace/commands/sbin/route/route.8
deleted file mode 100644
index 59567865..00000000
--- a/freebsd-userspace/commands/sbin/route/route.8
+++ /dev/null
@@ -1,411 +0,0 @@
-.\" Copyright (c) 1983, 1991, 1993
-.\" The Regents of the University of California. All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" @(#)route.8 8.3 (Berkeley) 3/19/94
-.\" $FreeBSD$
-.\"
-.Dd October 2, 2005
-.Dt ROUTE 8
-.Os
-.Sh NAME
-.Nm route
-.Nd manually manipulate the routing tables
-.Sh SYNOPSIS
-.Nm
-.Op Fl dnqtv
-.Ar command
-.Oo
-.Op Ar modifiers
-.Ar args
-.Oc
-.Sh DESCRIPTION
-The
-.Nm
-utility is used to manually manipulate the network
-routing tables.
-It normally is not needed, as a
-system routing table management daemon, such as
-.Xr routed 8 ,
-should tend to this task.
-.Pp
-The
-.Nm
-utility supports a limited number of general options,
-but a rich command language, enabling the user to specify
-any arbitrary request that could be delivered via the
-programmatic interface discussed in
-.Xr route 4 .
-.Pp
-The following options are available:
-.Bl -tag -width indent
-.It Fl d
-Run in debug-only mode, i.e., do not actually modify the routing table.
-.It Fl n
-Bypass attempts to print host and network names symbolically
-when reporting actions.
-(The process of translating between symbolic
-names and numerical equivalents can be quite time consuming, and
-may require correct operation of the network; thus it may be expedient
-to forget this, especially when attempting to repair networking operations).
-.It Fl t
-Run in test-only mode.
-.Pa /dev/null
-is used instead of a socket.
-.It Fl v
-(verbose) Print additional details.
-.It Fl q
-Suppress all output from the
-.Cm add , change , delete ,
-and
-.Cm flush
-commands.
-.El
-.Pp
-The
-.Nm
-utility provides the following commands:
-.Pp
-.Bl -tag -width Fl -compact
-.It Cm add
-Add a route.
-.It Cm flush
-Remove all routes.
-.It Cm delete
-Delete a specific route.
-.It Cm del
-Another name for the
-.Cm delete
-command.
-.It Cm change
-Change aspects of a route (such as its gateway).
-.It Cm get
-Lookup and display the route for a destination.
-.It Cm monitor
-Continuously report any changes to the routing information base,
-routing lookup misses, or suspected network partitionings.
-.El
-.Pp
-The monitor command has the syntax:
-.Pp
-.Bd -ragged -offset indent -compact
-.Nm
-.Op Fl n
-.Cm monitor
-.Ed
-.Pp
-The flush command has the syntax:
-.Pp
-.Bd -ragged -offset indent -compact
-.Nm
-.Op Fl n
-.Cm flush
-.Op Ar family
-.Ed
-.Pp
-If the
-.Cm flush
-command is specified,
-.Nm
-will ``flush'' the routing tables of all gateway entries.
-When the address family may is specified by any of the
-.Fl osi ,
-.Fl xns ,
-.Fl atalk ,
-.Fl inet6 ,
-or
-.Fl inet
-modifiers, only routes having destinations with addresses in the
-delineated family will be deleted.
-.Pp
-The other commands have the following syntax:
-.Pp
-.Bd -ragged -offset indent -compact
-.Nm
-.Op Fl n
-.Ar command
-.Op Fl net No \&| Fl host
-.Ar destination gateway
-.Op Ar netmask
-.Ed
-.Pp
-where
-.Ar destination
-is the destination host or network,
-.Ar gateway
-is the next-hop intermediary via which packets should be routed.
-Routes to a particular host may be distinguished from those to
-a network by interpreting the Internet address specified as the
-.Ar destination
-argument.
-The optional modifiers
-.Fl net
-and
-.Fl host
-force the destination to be interpreted as a network or a host, respectively.
-Otherwise, if the
-.Ar destination
-has a
-.Dq local address part
-of
-INADDR_ANY
-.Pq Li 0.0.0.0 ,
-or if the
-.Ar destination
-is the symbolic name of a network, then the route is
-assumed to be to a network; otherwise, it is presumed to be a
-route to a host.
-Optionally, the
-.Ar destination
-could also be specified in the
-.Ar net Ns / Ns Ar bits
-format.
-.Pp
-For example,
-.Li 128.32
-is interpreted as
-.Fl host Li 128.0.0.32 ;
-.Li 128.32.130
-is interpreted as
-.Fl host Li 128.32.0.130 ;
-.Fl net Li 128.32
-is interpreted as
-.Li 128.32.0.0;
-.Fl net Li 128.32.130
-is interpreted as
-.Li 128.32.130.0;
-and
-.Li 192.168.64/20
-is interpreted as
-.Fl net Li 192.168.64 Fl netmask Li 255.255.240.0 .
-.Pp
-A
-.Ar destination
-of
-.Ar default
-is a synonym for
-.Fl net Li 0.0.0.0 ,
-which is the default route.
-.Pp
-If the destination is directly reachable
-via an interface requiring
-no intermediary system to act as a gateway, the
-.Fl interface
-modifier should be specified;
-the gateway given is the address of this host on the common network,
-indicating the interface to be used for transmission.
-Alternately, if the interface is point to point the name of the interface
-itself may be given, in which case the route remains valid even
-if the local or remote addresses change.
-.Pp
-The optional modifiers
-.Fl xns ,
-.Fl osi ,
-.Fl atalk ,
-and
-.Fl link
-specify that all subsequent addresses are in the
-.Tn XNS ,
-.Tn OSI ,
-or
-.Tn AppleTalk
-address families,
-or are specified as link-level addresses,
-and the names must be numeric specifications rather than
-symbolic names.
-.Pp
-The optional
-.Fl netmask
-modifier is intended
-to achieve the effect of an
-.Tn OSI
-.Tn ESIS
-redirect with the netmask option,
-or to manually add subnet routes with
-netmasks different from that of the implied network interface
-(as would otherwise be communicated using the OSPF or ISIS routing protocols).
-One specifies an additional ensuing address parameter
-(to be interpreted as a network mask).
-The implicit network mask generated in the AF_INET case
-can be overridden by making sure this option follows the destination parameter.
-.Pp
-For
-.Dv AF_INET6 ,
-the
-.Fl prefixlen
-qualifier
-is available instead of the
-.Fl mask
-qualifier because non-continuous masks are not allowed in IPv6.
-For example,
-.Fl prefixlen Li 32
-specifies network mask of
-.Li ffff:ffff:0000:0000:0000:0000:0000:0000
-to be used.
-The default value of prefixlen is 64 to get along with
-the aggregatable address.
-But 0 is assumed if
-.Cm default
-is specified.
-Note that the qualifier works only for
-.Dv AF_INET6
-address family.
-.Pp
-Routes have associated flags which influence operation of the protocols
-when sending to destinations matched by the routes.
-These flags may be set (or sometimes cleared)
-by indicating the following corresponding modifiers:
-.Bd -literal
--xresolve RTF_XRESOLVE - emit mesg on use (for external lookup)
--iface ~RTF_GATEWAY - destination is directly reachable
--static RTF_STATIC - manually added route
--nostatic ~RTF_STATIC - pretend route added by kernel or daemon
--reject RTF_REJECT - emit an ICMP unreachable when matched
--blackhole RTF_BLACKHOLE - silently discard pkts (during updates)
--proto1 RTF_PROTO1 - set protocol specific routing flag #1
--proto2 RTF_PROTO2 - set protocol specific routing flag #2
-.Ed
-.Pp
-The optional modifiers
-.Fl rtt ,
-.Fl rttvar ,
-.Fl sendpipe ,
-.Fl recvpipe ,
-.Fl mtu ,
-.Fl hopcount ,
-.Fl expire ,
-and
-.Fl ssthresh
-provide initial values to quantities maintained in the routing entry
-by transport level protocols, such as TCP or TP4.
-These may be individually locked by preceding each such modifier to
-be locked by
-the
-.Fl lock
-meta-modifier, or one can
-specify that all ensuing metrics may be locked by the
-.Fl lockrest
-meta-modifier.
-.Pp
-In a
-.Cm change
-or
-.Cm add
-command where the destination and gateway are not sufficient to specify
-the route (as in the
-.Tn ISO
-case where several interfaces may have the
-same address), the
-.Fl ifp
-or
-.Fl ifa
-modifiers may be used to determine the interface or interface address.
-.Pp
-All symbolic names specified for a
-.Ar destination
-or
-.Ar gateway
-are looked up first as a host name using
-.Xr gethostbyname 3 .
-If this lookup fails,
-.Xr getnetbyname 3
-is then used to interpret the name as that of a network.
-.Pp
-The
-.Nm
-utility uses a routing socket and the new message types
-.Dv RTM_ADD , RTM_DELETE , RTM_GET ,
-and
-.Dv RTM_CHANGE .
-As such, only the super-user may modify
-the routing tables.
-.Sh EXIT STATUS
-.Ex -std
-.Sh DIAGNOSTICS
-.Bl -diag
-.It "add [host \&| network ] %s: gateway %s flags %x"
-The specified route is being added to the tables.
-The
-values printed are from the routing table entry supplied
-in the
-.Xr ioctl 2
-call.
-If the gateway address used was not the primary address of the gateway
-(the first one returned by
-.Xr gethostbyname 3 ) ,
-the gateway address is printed numerically as well as symbolically.
-.It "delete [ host \&| network ] %s: gateway %s flags %x"
-As above, but when deleting an entry.
-.It "%s %s done"
-When the
-.Cm flush
-command is specified, each routing table entry deleted
-is indicated with a message of this form.
-.It "Network is unreachable"
-An attempt to add a route failed because the gateway listed was not
-on a directly-connected network.
-The next-hop gateway must be given.
-.It "not in table"
-A delete operation was attempted for an entry which
-was not present in the tables.
-.It "routing table overflow"
-An add operation was attempted, but the system was
-low on resources and was unable to allocate memory
-to create the new entry.
-.It "gateway uses the same route"
-A
-.Cm change
-operation resulted in a route whose gateway uses the
-same route as the one being changed.
-The next-hop gateway should be reachable through a different route.
-.El
-.Sh SEE ALSO
-.\".Xr esis 4 ,
-.Xr netintro 4 ,
-.Xr route 4 ,
-.Xr arp 8 ,
-.Xr IPXrouted 8 ,
-.Xr routed 8
-.\".Xr XNSrouted 8
-.Sh HISTORY
-The
-.Nm
-utility appeared in
-.Bx 4.2 .
-.Sh BUGS
-The first paragraph may have slightly exaggerated
-.Xr routed 8 Ns 's
-abilities.
-.Pp
-Currently, routes with the
-.Dv RTF_BLACKHOLE
-flag set need to have the gateway set to an instance of the
-.Xr lo 4
-driver, using the
-.Fl iface
-option, for the flag to have any effect; unless IP fast forwarding
-is enabled, in which case the meaning of the flag will always
-be honored.
diff --git a/freebsd-userspace/commands/usr.bin/netstat/ipx.c b/freebsd-userspace/commands/usr.bin/netstat/ipx.c
deleted file mode 100644
index b78b1514..00000000
--- a/freebsd-userspace/commands/usr.bin/netstat/ipx.c
+++ /dev/null
@@ -1,354 +0,0 @@
-/*-
- * Copyright (c) 2004, Robert N. M. Watson
- * Copyright (c) 1983, 1988, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if 0
-#ifndef lint
-static char sccsid[] = "@(#)ns.c 8.1 (Berkeley) 6/6/93";
-#endif /* not lint */
-#endif
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#ifdef __rtems__
-#include <freebsd/sys/protosw.h>
-#else
-#include <sys/protosw.h>
-#endif
-
-#include <net/route.h>
-
-#define TCPSTATES
-#include <netinet/tcp_fsm.h>
-
-#include <netipx/ipx.h>
-#include <netipx/ipx_pcb.h>
-#include <netipx/ipx_var.h>
-#ifdef IPXERRORMSGS
-#include <netipx/ipx_error.h>
-#endif
-#include <netipx/spx.h>
-#include <netipx/spx_timer.h>
-#include <netipx/spx_var.h>
-#define SANAMES
-#include <netipx/spx_debug.h>
-
-#include <nlist.h>
-#include <errno.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-#include "netstat.h"
-
-static char *ipx_prpr(struct ipx_addr *);
-
-/*
- * Print a summary of connections related to a Network Systems
- * protocol. For SPX, also give state of connection.
- * Listening processes (aflag) are suppressed unless the
- * -a (all) flag is specified.
- */
-
-void
-ipxprotopr(u_long off, const char *name, int af1 __unused, int proto __unused)
-{
- struct ipxpcbhead cb;
- struct ipxpcb *ipxp;
- struct ipxpcb ipxpcb;
- struct spxpcb spxpcb;
- struct socket sockb;
- static int first = 1;
- int isspx;
-
- if (off == 0)
- return;
-
- isspx = strcmp(name, "spx") == 0;
- kread(off, (char *)&cb, sizeof (struct ipxpcbhead));
- ipxp = LIST_FIRST(&cb);
- while (ipxp != NULL) {
- u_long ppcb;
-
- kread((u_long)ipxp, (char *)&ipxpcb, sizeof (ipxpcb));
- ipxp = LIST_NEXT(&ipxpcb, ipxp_list);
-
- if (!aflag && ipx_nullhost(ipxpcb.ipxp_faddr) ) {
- continue;
- }
- kread((u_long)ipxpcb.ipxp_socket,
- (char *)&sockb, sizeof (sockb));
- ppcb = (u_long) ipxpcb.ipxp_pcb;
- if (ppcb) {
- if (isspx) {
- kread(ppcb, (char *)&spxpcb, sizeof (spxpcb));
- } else continue;
- } else
- if (isspx) continue;
- if (first) {
- printf("Active IPX connections");
- if (aflag)
- printf(" (including servers)");
- putchar('\n');
- if (Aflag)
- printf("%-8.8s ", "PCB");
- printf(Aflag ?
- "%-5.5s %-6.6s %-6.6s %-18.18s %-18.18s %s\n" :
- "%-5.5s %-6.6s %-6.6s %-22.22s %-22.22s %s\n",
- "Proto", "Recv-Q", "Send-Q",
- "Local Address", "Foreign Address", "(state)");
- first = 0;
- }
- if (Aflag)
- printf("%8lx ", ppcb);
- printf("%-5.5s %6u %6u ", name, sockb.so_rcv.sb_cc,
- sockb.so_snd.sb_cc);
- printf(Aflag?" %-18.18s":" %-22.22s", ipx_prpr(&ipxpcb.ipxp_laddr));
- printf(Aflag?" %-18.18s":" %-22.22s", ipx_prpr(&ipxpcb.ipxp_faddr));
- if (isspx) {
- if (spxpcb.s_state >= TCP_NSTATES)
- printf(" %d", spxpcb.s_state);
- else
- printf(" %s", tcpstates[spxpcb.s_state]);
- }
- putchar('\n');
- }
-}
-
-#define ANY(x,y,z) \
- if (x || sflag <= 1) printf("\t%u %s%s%s\n", x, y, plural(x), z)
-#define ANYl(x,y,z) \
- if (x || sflag <= 1) printf("\t%lu %s%s%s\n", x, y, plural(x), z)
-
-/*
- * Dump SPX statistics structure.
- */
-void
-spx_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
-{
- struct spx_istat spx_istat;
-#define spxstat spx_istat.newstats
-
- if (off == 0)
- return;
- kread(off, (char *)&spx_istat, sizeof (spx_istat));
- printf("%s:\n", name);
- ANY(spx_istat.nonucn, "connection", " dropped due to no new sockets ");
- ANY(spx_istat.gonawy, "connection", " terminated due to our end dying");
- ANY(spx_istat.nonucn, "connection",
- " dropped due to inability to connect");
- ANY(spx_istat.noconn, "connection",
- " dropped due to inability to connect");
- ANY(spx_istat.notme, "connection",
- " incompleted due to mismatched id's");
- ANY(spx_istat.wrncon, "connection", " dropped due to mismatched id's");
- ANY(spx_istat.bdreas, "packet", " dropped out of sequence");
- ANY(spx_istat.lstdup, "packet", " duplicating the highest packet");
- ANY(spx_istat.notyet, "packet", " refused as exceeding allocation");
- ANYl(spxstat.spxs_connattempt, "connection", " initiated");
- ANYl(spxstat.spxs_accepts, "connection", " accepted");
- ANYl(spxstat.spxs_connects, "connection", " established");
- ANYl(spxstat.spxs_drops, "connection", " dropped");
- ANYl(spxstat.spxs_conndrops, "embryonic connection", " dropped");
- ANYl(spxstat.spxs_closed, "connection", " closed (includes drops)");
- ANYl(spxstat.spxs_segstimed, "packet", " where we tried to get rtt");
- ANYl(spxstat.spxs_rttupdated, "time", " we got rtt");
- ANYl(spxstat.spxs_delack, "delayed ack", " sent");
- ANYl(spxstat.spxs_timeoutdrop, "connection",
- " dropped in rxmt timeout");
- ANYl(spxstat.spxs_rexmttimeo, "retransmit timeout", "");
- ANYl(spxstat.spxs_persisttimeo, "persist timeout", "");
- ANYl(spxstat.spxs_keeptimeo, "keepalive timeout", "");
- ANYl(spxstat.spxs_keepprobe, "keepalive probe", " sent");
- ANYl(spxstat.spxs_keepdrops, "connection", " dropped in keepalive");
- ANYl(spxstat.spxs_sndtotal, "total packet", " sent");
- ANYl(spxstat.spxs_sndpack, "data packet", " sent");
- ANYl(spxstat.spxs_sndbyte, "data byte", " sent");
- ANYl(spxstat.spxs_sndrexmitpack, "data packet", " retransmitted");
- ANYl(spxstat.spxs_sndrexmitbyte, "data byte", " retransmitted");
- ANYl(spxstat.spxs_sndacks, "ack-only packet", " sent");
- ANYl(spxstat.spxs_sndprobe, "window probe", " sent");
- ANYl(spxstat.spxs_sndurg, "packet", " sent with URG only");
- ANYl(spxstat.spxs_sndwinup, "window update-only packet", " sent");
- ANYl(spxstat.spxs_sndctrl, "control (SYN|FIN|RST) packet", " sent");
- ANYl(spxstat.spxs_sndvoid, "request", " to send a non-existant packet");
- ANYl(spxstat.spxs_rcvtotal, "total packet", " received");
- ANYl(spxstat.spxs_rcvpack, "packet", " received in sequence");
- ANYl(spxstat.spxs_rcvbyte, "byte", " received in sequence");
- ANYl(spxstat.spxs_rcvbadsum, "packet", " received with ccksum errs");
- ANYl(spxstat.spxs_rcvbadoff, "packet", " received with bad offset");
- ANYl(spxstat.spxs_rcvshort, "packet", " received too short");
- ANYl(spxstat.spxs_rcvduppack, "duplicate-only packet", " received");
- ANYl(spxstat.spxs_rcvdupbyte, "duplicate-only byte", " received");
- ANYl(spxstat.spxs_rcvpartduppack, "packet",
- " with some duplicate data");
- ANYl(spxstat.spxs_rcvpartdupbyte, "dup. byte", " in part-dup. packet");
- ANYl(spxstat.spxs_rcvoopack, "out-of-order packet", " received");
- ANYl(spxstat.spxs_rcvoobyte, "out-of-order byte", " received");
- ANYl(spxstat.spxs_rcvpackafterwin, "packet", " with data after window");
- ANYl(spxstat.spxs_rcvbyteafterwin, "byte", " rcvd after window");
- ANYl(spxstat.spxs_rcvafterclose, "packet", " rcvd after 'close'");
- ANYl(spxstat.spxs_rcvwinprobe, "rcvd window probe packet", "");
- ANYl(spxstat.spxs_rcvdupack, "rcvd duplicate ack", "");
- ANYl(spxstat.spxs_rcvacktoomuch, "rcvd ack", " for unsent data");
- ANYl(spxstat.spxs_rcvackpack, "rcvd ack packet", "");
- ANYl(spxstat.spxs_rcvackbyte, "byte", " acked by rcvd acks");
- ANYl(spxstat.spxs_rcvwinupd, "rcvd window update packet", "");
-}
-
-/*
- * Dump IPX statistics structure.
- */
-void
-ipx_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
-{
- struct ipxstat ipxstat;
-
- if (off == 0)
- return;
- kread(off, (char *)&ipxstat, sizeof (ipxstat));
- printf("%s:\n", name);
- ANYl(ipxstat.ipxs_total, "total packet", " received");
- ANYl(ipxstat.ipxs_badsum, "packet", " with bad checksums");
- ANYl(ipxstat.ipxs_tooshort, "packet", " smaller than advertised");
- ANYl(ipxstat.ipxs_toosmall, "packet", " smaller than a header");
- ANYl(ipxstat.ipxs_forward, "packet", " forwarded");
- ANYl(ipxstat.ipxs_cantforward, "packet", " not forwardable");
- ANYl(ipxstat.ipxs_delivered, "packet", " for this host");
- ANYl(ipxstat.ipxs_localout, "packet", " sent from this host");
- ANYl(ipxstat.ipxs_odropped, "packet", " dropped due to no bufs, etc.");
- ANYl(ipxstat.ipxs_noroute, "packet", " discarded due to no route");
- ANYl(ipxstat.ipxs_mtutoosmall, "packet", " too big");
-}
-
-#ifdef IPXERRORMSGS
-static struct {
- u_short code;
- char *name;
- char *where;
-} ipx_errnames[] = {
- {0, "Unspecified Error", " at Destination"},
- {1, "Bad Checksum", " at Destination"},
- {2, "No Listener", " at Socket"},
- {3, "Packet", " Refused due to lack of space at Destination"},
- {01000, "Unspecified Error", " while gatewayed"},
- {01001, "Bad Checksum", " while gatewayed"},
- {01002, "Packet", " forwarded too many times"},
- {01003, "Packet", " too large to be forwarded"},
- {-1, 0, 0},
-};
-
-/*
- * Dump IPX Error statistics structure.
- */
-/*ARGSUSED*/
-void
-ipxerr_stats(u_long off, const char *name, int af __unused, int proto __unused)
-{
- struct ipx_errstat ipx_errstat;
- int j;
- int histoprint = 1;
- int z;
-
- if (off == 0)
- return;
- kread(off, (char *)&ipx_errstat, sizeof (ipx_errstat));
- printf("IPX error statistics:\n");
- ANY(ipx_errstat.ipx_es_error, "call", " to ipx_error");
- ANY(ipx_errstat.ipx_es_oldshort, "error",
- " ignored due to insufficient addressing");
- ANY(ipx_errstat.ipx_es_oldipx_err, "error request",
- " in response to error packets");
- ANY(ipx_errstat.ipx_es_tooshort, "error packet",
- " received incomplete");
- ANY(ipx_errstat.ipx_es_badcode, "error packet",
- " received of unknown type");
- for(j = 0; j < IPX_ERR_MAX; j ++) {
- z = ipx_errstat.ipx_es_outhist[j];
- if (z && histoprint) {
- printf("Output Error Histogram:\n");
- histoprint = 0;
- }
- ipx_erputil(z, ipx_errstat.ipx_es_codes[j]);
- }
- histoprint = 1;
- for(j = 0; j < IPX_ERR_MAX; j ++) {
- z = ipx_errstat.ipx_es_inhist[j];
- if (z && histoprint) {
- printf("Input Error Histogram:\n");
- histoprint = 0;
- }
- ipx_erputil(z, ipx_errstat.ipx_es_codes[j]);
- }
-}
-
-static void
-ipx_erputil(int z, int c)
-{
- int j;
- char codebuf[30];
- char *name, *where;
-
- for(j = 0;; j ++) {
- if ((name = ipx_errnames[j].name) == 0)
- break;
- if (ipx_errnames[j].code == c)
- break;
- }
- if (name == 0) {
- if (c > 01000)
- where = "in transit";
- else
- where = "at destination";
- sprintf(codebuf, "Unknown IPX error code 0%o", c);
- name = codebuf;
- } else
- where = ipx_errnames[j].where;
- ANY(z, name, where);
-}
-#endif /* IPXERRORMSGS */
-
-static struct sockaddr_ipx ssipx = { .sipx_family = AF_IPX };
-
-static
-char *ipx_prpr(struct ipx_addr *x)
-{
- struct sockaddr_ipx *sipx = &ssipx;
-
- sipx->sipx_addr = *x;
- return(ipx_print((struct sockaddr *)sipx));
-}
diff --git a/freebsd-userspace/commands/usr.bin/netstat/netgraph.c b/freebsd-userspace/commands/usr.bin/netstat/netgraph.c
deleted file mode 100644
index 06a244ff..00000000
--- a/freebsd-userspace/commands/usr.bin/netstat/netgraph.c
+++ /dev/null
@@ -1,196 +0,0 @@
-/*-
- * Copyright (c) 1996-1999 Whistle Communications, Inc.
- * All rights reserved.
- *
- * Subject to the following obligations and disclaimer of warranty, use and
- * redistribution of this software, in source or object code forms, with or
- * without modifications are expressly permitted by Whistle Communications;
- * provided, however, that:
- * 1. Any and all reproductions of the source or object code must include the
- * copyright notice above and the following disclaimer of warranties; and
- * 2. No rights are granted, in any manner or form, to use Whistle
- * Communications, Inc. trademarks, including the mark "WHISTLE
- * COMMUNICATIONS" on advertising, endorsements, or otherwise except as
- * such appears in the above copyright notice or in the software.
- *
- * THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND
- * TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO
- * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE,
- * INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
- * WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY
- * REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS
- * SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE.
- * IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES
- * RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING
- * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
- * OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#ifdef __rtems__
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/linker.h>
-#else
-#include <sys/protosw.h>
-#include <sys/linker.h>
-#endif
-
-#include <net/route.h>
-
-#include <netgraph.h>
-#include <netgraph/ng_message.h>
-#include <netgraph/ng_socket.h>
-#include <netgraph/ng_socketvar.h>
-
-#include <nlist.h>
-#include <errno.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <err.h>
-#include "netstat.h"
-
-static int first = 1;
-static int csock = -1;
-
-void
-netgraphprotopr(u_long off, const char *name, int af1 __unused,
- int proto __unused)
-{
- struct ngpcb *this, *next;
- struct ngpcb ngpcb;
- struct ngsock info;
- struct socket sockb;
- int debug = 1;
-
- /* If symbol not found, try looking in the KLD module */
- if (off == 0) {
- const char *const modname = "ng_socket.ko";
-/* XXX We should get "mpath" from "sysctl kern.module_path" */
- const char *mpath[] = { "/", "/boot/", "/modules/", NULL };
- struct nlist sym[] = { { .n_name = "_ngsocklist" },
- { .n_name = NULL } };
- const char **pre;
- struct kld_file_stat ks;
- int fileid;
-
- /* Can't do this for core dumps. */
- if (!live)
- return;
-
- /* See if module is loaded */
- if ((fileid = kldfind(modname)) < 0) {
- if (debug)
- warn("kldfind(%s)", modname);
- return;
- }
-
- /* Get module info */
- memset(&ks, 0, sizeof(ks));
- ks.version = sizeof(struct kld_file_stat);
- if (kldstat(fileid, &ks) < 0) {
- if (debug)
- warn("kldstat(%d)", fileid);
- return;
- }
-
- /* Get symbol table from module file */
- for (pre = mpath; *pre; pre++) {
- char path[MAXPATHLEN];
-
- snprintf(path, sizeof(path), "%s%s", *pre, modname);
- if (nlist(path, sym) == 0)
- break;
- }
-
- /* Did we find it? */
- if (sym[0].n_value == 0) {
- if (debug)
- warnx("%s not found", modname);
- return;
- }
-
- /* Symbol found at load address plus symbol offset */
- off = (u_long) ks.address + sym[0].n_value;
- }
-
- /* Get pointer to first socket */
- kread(off, (char *)&this, sizeof(this));
-
- /* Get my own socket node */
- if (csock == -1)
- NgMkSockNode(NULL, &csock, NULL);
-
- for (; this != NULL; this = next) {
- u_char rbuf[sizeof(struct ng_mesg) + sizeof(struct nodeinfo)];
- struct ng_mesg *resp = (struct ng_mesg *) rbuf;
- struct nodeinfo *ni = (struct nodeinfo *) resp->data;
- char path[64];
-
- /* Read in ngpcb structure */
- kread((u_long)this, (char *)&ngpcb, sizeof(ngpcb));
- next = LIST_NEXT(&ngpcb, socks);
-
- /* Read in socket structure */
- kread((u_long)ngpcb.ng_socket, (char *)&sockb, sizeof(sockb));
-
- /* Check type of socket */
- if (strcmp(name, "ctrl") == 0 && ngpcb.type != NG_CONTROL)
- continue;
- if (strcmp(name, "data") == 0 && ngpcb.type != NG_DATA)
- continue;
-
- /* Do headline */
- if (first) {
- printf("Netgraph sockets\n");
- if (Aflag)
- printf("%-8.8s ", "PCB");
- printf("%-5.5s %-6.6s %-6.6s %-14.14s %s\n",
- "Type", "Recv-Q", "Send-Q",
- "Node Address", "#Hooks");
- first = 0;
- }
-
- /* Show socket */
- if (Aflag)
- printf("%8lx ", (u_long) this);
- printf("%-5.5s %6u %6u ",
- name, sockb.so_rcv.sb_cc, sockb.so_snd.sb_cc);
-
- /* Get ngsock structure */
- if (ngpcb.sockdata == NULL) /* unconnected data socket */
- goto finish;
- kread((u_long)ngpcb.sockdata, (char *)&info, sizeof(info));
-
- /* Get info on associated node */
- if (info.node_id == 0 || csock == -1)
- goto finish;
- snprintf(path, sizeof(path), "[%x]:", info.node_id);
- if (NgSendMsg(csock, path,
- NGM_GENERIC_COOKIE, NGM_NODEINFO, NULL, 0) < 0)
- goto finish;
- if (NgRecvMsg(csock, resp, sizeof(rbuf), NULL) < 0)
- goto finish;
-
- /* Display associated node info */
- if (*ni->name != '\0')
- snprintf(path, sizeof(path), "%s:", ni->name);
- printf("%-14.14s %4d", path, ni->hooks);
-finish:
- putchar('\n');
- }
-}
-
diff --git a/freebsd-userspace/commands/usr.bin/netstat/netstat.1 b/freebsd-userspace/commands/usr.bin/netstat/netstat.1
deleted file mode 100644
index 872ff954..00000000
--- a/freebsd-userspace/commands/usr.bin/netstat/netstat.1
+++ /dev/null
@@ -1,523 +0,0 @@
-.\" Copyright (c) 1983, 1990, 1992, 1993
-.\" The Regents of the University of California. All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by the University of
-.\" California, Berkeley and its contributors.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" @(#)netstat.1 8.8 (Berkeley) 4/18/94
-.\" $FreeBSD$
-.\"
-.Dd January 10, 2010
-.Dt NETSTAT 1
-.Os
-.Sh NAME
-.Nm netstat
-.Nd show network status
-.Sh DESCRIPTION
-The
-.Nm
-command symbolically displays the contents of various network-related
-data structures.
-There are a number of output formats,
-depending on the options for the information presented.
-.Bl -tag -width indent
-.It Xo
-.Bk -words
-.Nm
-.Op Fl AaLnSWx
-.Op Fl f Ar protocol_family | Fl p Ar protocol
-.Op Fl M Ar core
-.Op Fl N Ar system
-.Ek
-.Xc
-Display a list of active sockets
-(protocol control blocks)
-for each network protocol,
-for a particular
-.Ar protocol_family ,
-or for a single
-.Ar protocol .
-If
-.Fl A
-is also present,
-show the address of a protocol control block (PCB)
-associated with a socket; used for debugging.
-If
-.Fl a
-is also present,
-show the state of all sockets;
-normally sockets used by server processes are not shown.
-If
-.Fl L
-is also present,
-show the size of the various listen queues.
-The first count shows the number of unaccepted connections,
-the second count shows the amount of unaccepted incomplete connections,
-and the third count is the maximum number of queued connections.
-If
-.Fl S
-is also present,
-show network addresses as numbers (as with
-.Fl n )
-but show ports symbolically.
-If
-.Fl x
-is present display full socket buffer statistics for each internet socket.
-.It Xo
-.Bk -words
-.Nm
-.Fl i | I Ar interface
-.Op Fl abdhntW
-.Op Fl f Ar address_family
-.Op Fl M Ar core
-.Op Fl N Ar system
-.Ek
-.Xc
-Show the state of all network interfaces or a single
-.Ar interface
-which have been auto-configured
-(interfaces statically configured into a system, but not
-located at boot time are not shown).
-An asterisk
-.Pq Dq Li *
-after an interface name indicates that the interface is
-.Dq down .
-If
-.Fl a
-is also present, multicast addresses currently in use are shown
-for each Ethernet interface and for each IP interface address.
-Multicast addresses are shown on separate lines following the interface
-address with which they are associated.
-If
-.Fl b
-is also present, show the number of bytes in and out.
-If
-.Fl d
-is also present, show the number of dropped packets.
-If
-.Fl h
-is also present, print all counters in human readable form.
-If
-.Fl t
-is also present, show the contents of watchdog timers.
-If
-.Fl W
-is also present, print interface names using a wider field size.
-.It Xo
-.Bk -words
-.Nm
-.Fl w Ar wait
-.Op Fl I Ar interface
-.Op Fl d
-.Op Fl M Ar core
-.Op Fl N Ar system
-.Op Fl q Ar howmany
-.Ek
-.Xc
-At intervals of
-.Ar wait
-seconds,
-display the information regarding packet
-traffic on all configured network interfaces
-or a single
-.Ar interface .
-If
-.Fl q
-is also present, exit after
-.Ar howmany
-outputs.
-If
-.Fl d
-is also present, show the number of dropped packets.
-.It Xo
-.Bk -words
-.Nm
-.Fl s Op Fl s
-.Op Fl z
-.Op Fl f Ar protocol_family | Fl p Ar protocol
-.Op Fl M Ar core
-.Op Fl N Ar system
-.Ek
-.Xc
-Display system-wide statistics for each network protocol,
-for a particular
-.Ar protocol_family ,
-or for a single
-.Ar protocol .
-If
-.Fl s
-is repeated, counters with a value of zero are suppressed.
-If
-.Fl z
-is also present, reset statistic counters after displaying them.
-.It Xo
-.Bk -words
-.Nm
-.Fl i | I Ar interface Fl s
-.Op Fl f Ar protocol_family | Fl p Ar protocol
-.Op Fl M Ar core
-.Op Fl N Ar system
-.Ek
-.Xc
-Display per-interface statistics for each network protocol,
-for a particular
-.Ar protocol_family ,
-or for a single
-.Ar protocol .
-.It Xo
-.Bk -words
-.Nm
-.Fl m
-.Op Fl M Ar core
-.Op Fl N Ar system
-.Ek
-.Xc
-Show statistics recorded by the memory management routines
-.Pq Xr mbuf 9 .
-The network manages a private pool of memory buffers.
-.It Xo
-.Bk -words
-.Nm
-.Fl B
-.Op Fl z
-.Op Fl I Ar interface
-.Ek
-.Xc
-Show statistics about
-.Xr bpf 4
-peers.
-This includes information like
-how many packets have been matched, dropped and received by the
-bpf device, also information about current buffer sizes and device
-states.
-.It Xo
-.Bk -words
-.Nm
-.Fl r
-.Op Fl AanW
-.Op Fl f Ar address_family
-.Op Fl M Ar core
-.Op Fl N Ar system
-.Ek
-.Xc
-Display the contents of all routing tables,
-or a routing table for a particular
-.Ar address_family .
-If
-.Fl A
-is also present,
-show the contents of the internal Patricia tree
-structures; used for debugging.
-If
-.Fl a
-is also present,
-show protocol-cloned routes
-(routes generated by an
-.Dv RTF_PRCLONING
-parent route);
-normally these routes are not shown.
-When
-.Fl W
-is also present,
-show the path MTU
-for each route,
-and print interface
-names with a wider
-field size.
-.It Xo
-.Bk -words
-.Nm
-.Fl rs
-.Op Fl s
-.Op Fl M Ar core
-.Op Fl N Ar system
-.Ek
-.Xc
-Display routing statistics.
-If
-.Fl s
-is repeated, counters with a value of zero are suppressed.
-.It Xo
-.Bk -words
-.Nm
-.Fl g
-.Op Fl W
-.Op Fl f Ar address_family
-.Op Fl M Ar core
-.Op Fl N Ar system
-.Ek
-.Xc
-Display the contents of the multicast virtual interface tables,
-and multicast forwarding caches.
-Entries in these tables will appear only when the kernel is
-actively forwarding multicast sessions.
-This option is applicable only to the
-.Cm inet
-and
-.Cm inet6
-address families.
-.It Xo
-.Bk -words
-.Nm
-.Fl gs
-.Op Fl s
-.Op Fl f Ar address_family
-.Op Fl M Ar core
-.Op Fl N Ar system
-.Ek
-.Xc
-Show multicast routing statistics.
-If
-.Fl s
-is repeated, counters with a value of zero are suppressed.
-.El
-.Pp
-Some options have the general meaning:
-.Bl -tag -width flag
-.It Fl f Ar address_family , Fl p Ar protocol
-Limit display to those records
-of the specified
-.Ar address_family
-or a single
-.Ar protocol .
-The following address families and protocols are recognized:
-.Pp
-.Bl -tag -width ".Cm netgraph , ng Pq Dv AF_NETGRAPH" -compact
-.It Em Family
-.Em Protocols
-.It Cm inet Pq Dv AF_INET
-.Cm divert , icmp , igmp , ip , ipsec , pim, sctp , tcp , udp
-.It Cm inet6 Pq Dv AF_INET6
-.Cm icmp6 , ip6 , ipsec6 , rip6 , tcp , udp
-.It Cm pfkey Pq Dv PF_KEY
-.Cm pfkey
-.It Cm atalk Pq Dv AF_APPLETALK
-.Cm ddp
-.It Cm netgraph , ng Pq Dv AF_NETGRAPH
-.Cm ctrl , data
-.It Cm ipx Pq Dv AF_IPX
-.Cm ipx , spx
-.\".It Cm ns Pq Dv AF_NS
-.\".Cm idp , ns_err , spp
-.\".It Cm iso Pq Dv AF_ISO
-.\".Cm clnp , cltp , esis , tp
-.It Cm unix Pq Dv AF_UNIX
-.It Cm link Pq Dv AF_LINK
-.El
-.Pp
-The program will complain if
-.Ar protocol
-is unknown or if there is no statistics routine for it.
-.It Fl M
-Extract values associated with the name list from the specified core
-instead of the default
-.Pa /dev/kmem .
-.It Fl N
-Extract the name list from the specified system instead of the default,
-which is the kernel image the system has booted from.
-.It Fl n
-Show network addresses and ports as numbers.
-Normally
-.Nm
-attempts to resolve addresses and ports,
-and display them symbolically.
-.It Fl W
-In certain displays, avoid truncating addresses even if this causes
-some fields to overflow.
-.El
-.Pp
-The default display, for active sockets, shows the local
-and remote addresses, send and receive queue sizes (in bytes), protocol,
-and the internal state of the protocol.
-Address formats are of the form
-.Dq host.port
-or
-.Dq network.port
-if a socket's address specifies a network but no specific host address.
-When known, the host and network addresses are displayed symbolically
-according to the databases
-.Xr hosts 5
-and
-.Xr networks 5 ,
-respectively.
-If a symbolic name for an address is unknown, or if
-the
-.Fl n
-option is specified, the address is printed numerically, according
-to the address family.
-For more information regarding
-the Internet IPv4
-.Dq dot format ,
-refer to
-.Xr inet 3 .
-Unspecified,
-or
-.Dq wildcard ,
-addresses and ports appear as
-.Dq Li * .
-.Pp
-The interface display provides a table of cumulative
-statistics regarding packets transferred, errors, and collisions.
-The network addresses of the interface
-and the maximum transmission unit
-.Pq Dq mtu
-are also displayed.
-.Pp
-The routing table display indicates the available routes and their status.
-Each route consists of a destination host or network, and a gateway to use
-in forwarding packets.
-The flags field shows a collection of information about the route stored
-as binary choices.
-The individual flags are discussed in more detail in the
-.Xr route 8
-and
-.Xr route 4
-manual pages.
-The mapping between letters and flags is:
-.Bl -column ".Li W" ".Dv RTF_WASCLONED"
-.It Li 1 Ta Dv RTF_PROTO1 Ta "Protocol specific routing flag #1"
-.It Li 2 Ta Dv RTF_PROTO2 Ta "Protocol specific routing flag #2"
-.It Li 3 Ta Dv RTF_PROTO3 Ta "Protocol specific routing flag #3"
-.It Li B Ta Dv RTF_BLACKHOLE Ta "Just discard pkts (during updates)"
-.It Li b Ta Dv RTF_BROADCAST Ta "The route represents a broadcast address"
-.It Li C Ta Dv RTF_CLONING Ta "Generate new routes on use"
-.It Li c Ta Dv RTF_PRCLONING Ta "Protocol-specified generate new routes on use"
-.It Li D Ta Dv RTF_DYNAMIC Ta "Created dynamically (by redirect)"
-.It Li G Ta Dv RTF_GATEWAY Ta "Destination requires forwarding by intermediary"
-.It Li H Ta Dv RTF_HOST Ta "Host entry (net otherwise)"
-.It Li L Ta Dv RTF_LLINFO Ta "Valid protocol to link address translation"
-.It Li M Ta Dv RTF_MODIFIED Ta "Modified dynamically (by redirect)"
-.It Li R Ta Dv RTF_REJECT Ta "Host or net unreachable"
-.It Li S Ta Dv RTF_STATIC Ta "Manually added"
-.It Li U Ta Dv RTF_UP Ta "Route usable"
-.It Li W Ta Dv RTF_WASCLONED Ta "Route was generated as a result of cloning"
-.It Li X Ta Dv RTF_XRESOLVE Ta "External daemon translates proto to link address"
-.El
-.Pp
-Direct routes are created for each
-interface attached to the local host;
-the gateway field for such entries shows the address of the outgoing interface.
-The refcnt field gives the
-current number of active uses of the route.
-Connection oriented
-protocols normally hold on to a single route for the duration of
-a connection while connectionless protocols obtain a route while sending
-to the same destination.
-The use field provides a count of the number of packets
-sent using that route.
-The interface entry indicates the network interface utilized for the route.
-.Pp
-When
-.Nm
-is invoked with the
-.Fl w
-option and a
-.Ar wait
-interval argument, it displays a running count of statistics related to
-network interfaces.
-An obsolescent version of this option used a numeric parameter
-with no option, and is currently supported for backward compatibility.
-By default, this display summarizes information for all interfaces.
-Information for a specific interface may be displayed with the
-.Fl I
-option.
-.Pp
-The
-.Xr bpf 4
-flags displayed when
-.Nm
-is invoked with the
-.Fl B
-option represent the underlying parameters of the bpf peer.
-Each flag is
-represented as a single lower case letter.
-The mapping between the letters and flags in order of appearance are:
-.Bl -column ".Li i"
-.It Li p Ta Set if listening promiscuously
-.It Li i Ta Dv BIOCIMMEDIATE No has been set on the device
-.It Li f Ta Dv BIOCGHDRCMPLT No status: source link addresses are being
-filled automatically
-.It Li s Ta Dv BIOCGSEESENT No status: see packets originating locally and
-remotely on the interface.
-.It Li a Ta Packet reception generates a signal
-.It Li l Ta Dv BIOCLOCK No status: descriptor has been locked
-.El
-.Pp
-For more information about these flags, please refer to
-.Xr bpf 4 .
-.Pp
-The
-.Fl x
-flag causes
-.Nm
-to output all the information recorded about data
-stored in the socket buffers.
-The fields are:
-.Bl -column ".Li R-MBUF"
-.It Li R-MBUF Ta Number of mbufs in the receive queue.
-.It Li S-MBUF Ta Number of mbufs in the send queue.
-.It Li R-CLUS Ta Number of clusters, of any type, in the receive
-queue.
-.It Li S-CLUS Ta Number of clusters, of any type, in the send queue.
-.It Li R-HIWA Ta Receive buffer high water mark, in bytes.
-.It Li S-HIWA Ta Send buffer high water mark, in bytes.
-.It Li R-LOWA Ta Receive buffer low water mark, in bytes.
-.It Li S-LOWA Ta Send buffer low water mark, in bytes.
-.It Li R-BCNT Ta Receive buffer byte count.
-.It Li S-BCNT Ta Send buffer byte count.
-.It Li R-BMAX Ta Maximum bytes that can be used in the receive buffer.
-.It Li S-BMAX Ta Maximum bytes that can be used in the send buffer.
-.El
-.Sh SEE ALSO
-.Xr fstat 1 ,
-.Xr nfsstat 1 ,
-.Xr procstat 1 ,
-.Xr ps 1 ,
-.Xr sockstat 1 ,
-.Xr bpf 4 ,
-.Xr inet 4 ,
-.Xr route 4 ,
-.Xr unix 4 ,
-.Xr hosts 5 ,
-.Xr networks 5 ,
-.Xr protocols 5 ,
-.Xr services 5 ,
-.Xr iostat 8 ,
-.Xr route 8 ,
-.Xr trpt 8 ,
-.Xr vmstat 8 ,
-.Xr mbuf 9
-.Sh HISTORY
-The
-.Nm
-command appeared in
-.Bx 4.2 .
-.Pp
-IPv6 support was added by WIDE/KAME project.
-.Sh BUGS
-The notion of errors is ill-defined.
diff --git a/freebsd-userspace/from-freebsd.sh b/freebsd-userspace/from-freebsd.sh
deleted file mode 100755
index 00799fab..00000000
--- a/freebsd-userspace/from-freebsd.sh
+++ /dev/null
@@ -1,288 +0,0 @@
-#! /bin/bash
-#
-# Temporary hack of a script to get FreeBSD user space header
-# files and network libc source code into this tree.
-#
-# NOTE: libc and include are NOT in the FreeBSD checkout used for the
-# USB and TCP/IP stacks. This has to be addressed.
-#
-# This probably could be integrated into the main Python script.
-# But so far, there are no real transformations needed and the
-# script just performs two tasks:
-#
-# + copies source files from FreeBSD libc and include files into this tree
-# + generates "wrapper" header files for the public network .h files
-#
-src=/home/joel/newbsd/git/freebsd-8.2
-dest=/home/joel/newbsd/git/rtems-libbsd/freebsd-userspace
-
-progname=${0##*/} # fast basename hack for ksh, bash
-
-USAGE=\
-"usage: $progname [ -opts ]
- -v -- verbose
- -f DIR -- FreeBSD directory
- -r DIR -- rtems-libbsd top directory
-"
-
-check_status()
-{
- if [ $1 -ne 0 ] ; then
- shift
- echo "$USAGE" >&2
- echo >&2
- echo "FAILED: " "$*" >&2
- exit 1
- fi
-}
-
-usage()
-{
- echo "$USAGE" >&2
- exit 1
-}
-
-#
-# process the options
-#
-# defaults for getopt vars
-#
-
-src=NOTSET
-dest=NOTSET
-verbose="no"
-
-while getopts "vf:r:" OPT
-do
- case "$OPT" in
- v) verbose="yes";;
- f) src="$OPTARG";;
- r) dest="$OPTARG";;
- *) usage;;
- esac
-done
-
-# Check arguments specified
-test ${src} != "NOTSET"
-check_status $? "FreeBSD source directory not specified"
-
-test ${dest} != "NOTSET"
-check_status $? "rtems-libbsd source directory not specified"
-
-# Check that they are directories
-test -d ${src}
-check_status $? "FreeBSD source directory is not a directory"
-
-test -d ${dest}
-check_status $? "rtems-libbsd source directory is not a directory"
-
-# Check that they appear to be the right directories
-test -d ${src}/include
-check_status $? "FreeBSD source directory does not have include directory"
-
-test -d ${src}/lib/libc
-check_status $? "FreeBSD source directory does not have libc directory"
-
-test -d ${dest}/freebsd-userspace
-check_status $? "rtems-libbsd source directory does not have freebsd-userspace directory"
-
-dest=${dest}/freebsd-userspace
-
-# source files to simply copy
-while read f
-do
- d=`dirname $f`
- test -d ${dest}/${d} || mkdir -p ${dest}/${d}
- test -r ${src}/${f}
- check_status $? "${src}/${f} is not present"
-
- test ${verbose} = "yes" && echo "Simple copy $f"
- cp ${src}/${f} ${dest}/${d}
-done <<EOF
-include/db.h
-include/err.h
-include/ifaddrs.h
-include/netconfig.h
-include/nsswitch.h
-include/resolv.h
-include/sysexit.h
-include/res_update.h
-include/rpc/auth.h
-include/rpc/auth_unix.h
-include/rpc/auth_des.h
-include/rpc/clnt.h
-include/rpc/clnt_soc.h
-include/rpc/clnt_stat.h
-include/rpc/pmap_clnt.h
-include/rpc/pmap_prot.h
-include/rpc/rpcent.h
-include/rpc/rpc_msg.h
-include/rpc/rpcb_clnt.h
-include/rpc/rpcb_prot.x
-include/rpc/svc.h
-include/rpc/svc_auth.h
-include/rpc/svc_soc.h
-include/rpc/xdr.h
-include/arpa/ftp.h
-include/arpa/inet.h
-include/arpa/nameser.h
-sys/net/ethernet.h
-sys/rpc/types.h
-sys/sys/_null.h
-sys/sys/un.h
-lib/libc/include/libc_private.h
-lib/libc/include/namespace.h
-lib/libc/include/nss_tls.h
-lib/libc/include/reentrant.h
-lib/libc/include/resolv_mt.h
-lib/libc/include/un-namespace.h
-lib/libc/inet/inet_addr.c
-lib/libc/inet/inet_cidr_ntop.c
-lib/libc/inet/inet_cidr_pton.c
-lib/libc/inet/inet_lnaof.c
-lib/libc/inet/inet_makeaddr.c
-lib/libc/inet/inet_neta.c
-lib/libc/inet/inet_net_ntop.c
-lib/libc/inet/inet_netof.c
-lib/libc/inet/inet_net_pton.c
-lib/libc/inet/inet_network.c
-lib/libc/inet/inet_ntoa.c
-lib/libc/inet/inet_ntop.c
-lib/libc/inet/inet_pton.c
-lib/libc/inet/nsap_addr.c
-lib/libc/nameser/ns_samedomain.c
-lib/libc/net/netdb_private.h
-lib/libc/net/res_config.h
-EOF
-# processed by hand
-# include/arpa/nameser_compat.h
-
-# disable BIND_4_COMPAT since it trips a weird endian issue in nameser_compat.h
-#sed -e 's/#define BIND_4_COMPAT/\/* #define BIND_4_COMPAT *\//' \
-# >${dest}/include/arpa/nameser.h
-# <${src}/include/arpa/nameser.h \
-
-# fix include so it sees FreeBSD endian definitions
-sed -e 's/<machine\/endian.h>/<freebsd\/machine\/endian.h>/' \
- <${src}/include/arpa/nameser_compat.h \
- >${dest}/include/arpa/nameser_compat.h
-
-
-# source files to prepend "include of local/port_before.h"
-while read f
-do
- d=`dirname $f`
- test -d ${dest}/${d} || mkdir -p ${dest}/${d}
- test -r ${src}/${f}
- check_status $? "${src}/${f} is not present"
-
- test ${verbose} = "yes" && echo "Copy with prepend $f"
-
- ( echo "#include \"port_before.h\""; echo ; cat ${src}/${f} ) >${dest}/${f}
-done <<EOF
-lib/libc/net/base64.c
-lib/libc/net/ether_addr.c
-lib/libc/net/getaddrinfo.c
-lib/libc/net/gethostbydns.c
-lib/libc/net/gethostbyht.c
-lib/libc/net/gethostbynis.c
-lib/libc/net/gethostnamadr.c
-lib/libc/net/getifaddrs.c
-lib/libc/net/getifmaddrs.c
-lib/libc/net/getnameinfo.c
-lib/libc/net/getnetbydns.c
-lib/libc/net/getnetbyht.c
-lib/libc/net/getnetbynis.c
-lib/libc/net/getnetnamadr.c
-lib/libc/net/getproto.c
-lib/libc/net/getprotoent.c
-lib/libc/net/getprotoname.c
-lib/libc/net/getservent.c
-lib/libc/gen/gethostname.c
-lib/libc/nameser/ns_name.c
-lib/libc/nameser/ns_netint.c
-lib/libc/nameser/ns_parse.c
-lib/libc/nameser/ns_print.c
-lib/libc/nameser/ns_ttl.c
-lib/libc/net/if_indextoname.c
-lib/libc/net/if_nameindex.c
-lib/libc/net/linkaddr.c
-lib/libc/net/map_v4v6.c
-lib/libc/net/name6.c
-lib/libc/net/rcmd.c
-lib/libc/net/recv.c
-lib/libc/net/send.c
-lib/libc/resolv/res_private.h
-lib/libc/resolv/herror.c
-lib/libc/resolv/res_comp.c
-lib/libc/resolv/res_data.c
-lib/libc/resolv/res_debug.c
-lib/libc/resolv/res_init.c
-lib/libc/resolv/res_mkquery.c
-lib/libc/resolv/res_mkupdate.c
-lib/libc/resolv/res_query.c
-lib/libc/resolv/res_send.c
-lib/libc/resolv/res_update.c
-lib/libc/string/strsep.c
-EOF
-
-# This file includes a private "dprintf" which conflicts with stdio.h
-sed -e 's/dprintf/DPRINTF/g' <${dest}/lib/libc/net/gethostbydns.c >XXX
-mv XXX ${dest}/lib/libc/net/gethostbydns.c
-
-
-# files to "include with freebsd"
-while read f
-do
- d=`dirname $f`
- test -d include/${d}/${d} || mkdir -p include/${d}/${d}
-
- test ${verbose} = "yes" && echo "Generate wrapper $f"
- ( echo "#include <freebsd/bsd.h>" ;
- echo "#include <freebsd/${f}>" ) > include/${f}
-done <<EOF
-poll.h
-net/ethernet.h
-net/if.h
-net/if_arp.h
-net/if_dl.h
-net/if_types.h
-net/in.h
-net/route.h
-netatalk/at.h
-netinet/if_ether.h
-netinet/in.h
-netinet/icmp6.h
-netinet/igmp.h
-netinet/in_systm.h
-netinet/ip.h
-netinet/ip_icmp.h
-netinet/tcp.h
-netinet/udp.h
-sys/socket.h
-sys/socketvar.h
-sys/sysctl.h
-sys/mman.h
-EOF
-
-
-# empty files
-while read f
-do
- test ${verbose} = "yes" && echo "Generate empty file $f"
- echo "/* empty file */" > ${f}
-done <<EOF
-local/pthread_np.h
-local/sys/_pthreadtypes.h
-EOF
-
-
-# Fix syslog.h issues...
-echo "#include <sys/syslog.h>" > local/syslog.h
-# Should be able to copy this except for printflike issue
-# sys/sys/syslog.h
-
-# netdb.h has an issue with __socklen_t which needs to be run down
-# for now, a manually edited copy is in rtems/include
-# include/rpc/rpc.h has issue with internal methods changing from
-# old implementation to current day. We need to update our RPC
diff --git a/freebsd-userspace/include/net/in.h b/freebsd-userspace/include/net/in.h
deleted file mode 100644
index 76f4667e..00000000
--- a/freebsd-userspace/include/net/in.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#include <freebsd/bsd.h>
-#include <freebsd/net/in.h>
diff --git a/freebsd-userspace/lib/libc/gen/err.3 b/freebsd-userspace/lib/libc/gen/err.3
deleted file mode 100644
index 4871bcc1..00000000
--- a/freebsd-userspace/lib/libc/gen/err.3
+++ /dev/null
@@ -1,233 +0,0 @@
-.\" Copyright (c) 1993
-.\" The Regents of the University of California. All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" From: @(#)err.3 8.1 (Berkeley) 6/9/93
-.\" $FreeBSD$
-.\"
-.Dd March 6, 1999
-.Dt ERR 3
-.Os
-.Sh NAME
-.Nm err ,
-.Nm verr ,
-.Nm errc ,
-.Nm verrc ,
-.Nm errx ,
-.Nm verrx ,
-.Nm warn ,
-.Nm vwarn ,
-.Nm warnc ,
-.Nm vwarnc ,
-.Nm warnx ,
-.Nm vwarnx ,
-.Nm err_set_exit ,
-.Nm err_set_file
-.Nd formatted error messages
-.Sh LIBRARY
-.Lb libc
-.Sh SYNOPSIS
-.In err.h
-.Ft void
-.Fn err "int eval" "const char *fmt" "..."
-.Ft void
-.Fn err_set_exit "void (*exitf)(int)"
-.Ft void
-.Fn err_set_file "void *vfp"
-.Ft void
-.Fn errc "int eval" "int code" "const char *fmt" "..."
-.Ft void
-.Fn errx "int eval" "const char *fmt" "..."
-.Ft void
-.Fn warn "const char *fmt" "..."
-.Ft void
-.Fn warnc "int code" "const char *fmt" "..."
-.Ft void
-.Fn warnx "const char *fmt" "..."
-.In stdarg.h
-.Ft void
-.Fn verr "int eval" "const char *fmt" "va_list args"
-.Ft void
-.Fn verrc "int eval" "int code" "const char *fmt" "va_list args"
-.Ft void
-.Fn verrx "int eval" "const char *fmt" "va_list args"
-.Ft void
-.Fn vwarn "const char *fmt" "va_list args"
-.Ft void
-.Fn vwarnc "int code" "const char *fmt" "va_list args"
-.Ft void
-.Fn vwarnx "const char *fmt" "va_list args"
-.Sh DESCRIPTION
-The
-.Fn err
-and
-.Fn warn
-family of functions display a formatted error message on the standard
-error output, or on another file specified using the
-.Fn err_set_file
-function.
-In all cases, the last component of the program name, a colon character,
-and a space are output.
-If the
-.Fa fmt
-argument is not NULL, the
-.Xr printf 3 Ns
--like formatted error message is output.
-The output is terminated by a newline character.
-.Pp
-The
-.Fn err ,
-.Fn errc ,
-.Fn verr ,
-.Fn verrc ,
-.Fn warn ,
-.Fn warnc ,
-.Fn vwarn ,
-and
-.Fn vwarnc
-functions append an error message obtained from
-.Xr strerror 3
-based on a supplied error code value or the global variable
-.Va errno ,
-preceded by another colon and space unless the
-.Fa fmt
-argument is
-.Dv NULL .
-.Pp
-In the case of the
-.Fn errc ,
-.Fn verrc ,
-.Fn warnc ,
-and
-.Fn vwarnc
-functions,
-the
-.Fa code
-argument is used to look up the error message.
-.Pp
-The
-.Fn err ,
-.Fn verr ,
-.Fn warn ,
-and
-.Fn vwarn
-functions use the global variable
-.Va errno
-to look up the error message.
-.Pp
-The
-.Fn errx
-and
-.Fn warnx
-functions do not append an error message.
-.Pp
-The
-.Fn err ,
-.Fn verr ,
-.Fn errc ,
-.Fn verrc ,
-.Fn errx ,
-and
-.Fn verrx
-functions do not return, but exit with the value of the argument
-.Fa eval .
-It is recommended that the standard values defined in
-.Xr sysexits 3
-be used for the value of
-.Fa eval .
-The
-.Fn err_set_exit
-function can be used to specify a function which is called before
-.Xr exit 3
-to perform any necessary cleanup; passing a null function pointer for
-.Va exitf
-resets the hook to do nothing.
-The
-.Fn err_set_file
-function sets the output stream used by the other functions.
-Its
-.Fa vfp
-argument must be either a pointer to an open stream
-(possibly already converted to void *)
-or a null pointer
-(in which case the output stream is set to standard error).
-.Sh EXAMPLES
-Display the current errno information string and exit:
-.Bd -literal -offset indent
-if ((p = malloc(size)) == NULL)
- err(EX_OSERR, NULL);
-if ((fd = open(file_name, O_RDONLY, 0)) == -1)
- err(EX_NOINPUT, "%s", file_name);
-.Ed
-.Pp
-Display an error message and exit:
-.Bd -literal -offset indent
-if (tm.tm_hour < START_TIME)
- errx(EX_DATAERR, "too early, wait until %s",
- start_time_string);
-.Ed
-.Pp
-Warn of an error:
-.Bd -literal -offset indent
-if ((fd = open(raw_device, O_RDONLY, 0)) == -1)
- warnx("%s: %s: trying the block device",
- raw_device, strerror(errno));
-if ((fd = open(block_device, O_RDONLY, 0)) == -1)
- err(EX_OSFILE, "%s", block_device);
-.Ed
-.Pp
-Warn of an error without using the global variable
-.Va errno :
-.Bd -literal -offset indent
-error = my_function(); /* returns a value from <errno.h> */
-if (error != 0)
- warnc(error, "my_function");
-.Ed
-.Sh SEE ALSO
-.Xr exit 3 ,
-.Xr fmtmsg 3 ,
-.Xr printf 3 ,
-.Xr strerror 3 ,
-.Xr sysexits 3
-.Sh HISTORY
-The
-.Fn err
-and
-.Fn warn
-functions first appeared in
-.Bx 4.4 .
-The
-.Fn err_set_exit
-and
-.Fn err_set_file
-functions first appeared in
-.Fx 2.1 .
-The
-.Fn errc
-and
-.Fn warnc
-functions first appeared in
-.Fx 3.0 .
diff --git a/freebsd-userspace/lib/libc/net/Makefile b/freebsd-userspace/lib/libc/net/Makefile
deleted file mode 100644
index 895d167c..00000000
--- a/freebsd-userspace/lib/libc/net/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# lib/libc/net Yacc and lex files
-
-nslexer.c: nslexer.l
- ${LEX} -P _nsyy -t $^ | \
- sed -e '/YY_BUF_SIZE/s/16384/1024/' >$@
-
-nsparser.c: nsparser.y
- yacc -d -p_nsyy -o nsparser.i $^
- cat nsparser.i | \
- sed -e '/YY_BUF_SIZE/s/16384/1024/' >$@
- rm -f nsparser.i
-
diff --git a/freebsd-userspace/lib/libc/net/nsparser.h b/freebsd-userspace/lib/libc/net/nsparser.h
deleted file mode 100644
index 96fd9a88..00000000
--- a/freebsd-userspace/lib/libc/net/nsparser.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#define NL 257
-#define SUCCESS 258
-#define UNAVAIL 259
-#define NOTFOUND 260
-#define TRYAGAIN 261
-#define RETURN 262
-#define CONTINUE 263
-#define ERRORTOKEN 264
-#define STRING 265
-typedef union {
- char *str;
- int mapval;
-} YYSTYPE;
-extern YYSTYPE _nsyylval;
diff --git a/freebsd-userspace/lib/libc/stdio/fgetln.3 b/freebsd-userspace/lib/libc/stdio/fgetln.3
deleted file mode 100644
index 4b83664d..00000000
--- a/freebsd-userspace/lib/libc/stdio/fgetln.3
+++ /dev/null
@@ -1,125 +0,0 @@
-.\" Copyright (c) 1990, 1991, 1993
-.\" The Regents of the University of California. All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" @(#)fgetln.3 8.3 (Berkeley) 4/19/94
-.\" $FreeBSD$
-.\"
-.Dd April 19, 1994
-.Dt FGETLN 3
-.Os
-.Sh NAME
-.Nm fgetln
-.Nd get a line from a stream
-.Sh LIBRARY
-.Lb libc
-.Sh SYNOPSIS
-.In stdio.h
-.Ft char *
-.Fn fgetln "FILE *stream" "size_t *len"
-.Sh DESCRIPTION
-The
-.Fn fgetln
-function
-returns a pointer to the next line from the stream referenced by
-.Fa stream .
-This line is
-.Em not
-a C string as it does not end with a terminating
-.Dv NUL
-character.
-The length of the line, including the final newline,
-is stored in the memory location to which
-.Fa len
-points.
-(Note, however, that if the line is the last
-in a file that does not end in a newline,
-the returned text will not contain a newline.)
-.Sh RETURN VALUES
-Upon successful completion a pointer is returned;
-this pointer becomes invalid after the next
-.Tn I/O
-operation on
-.Fa stream
-(whether successful or not)
-or as soon as the stream is closed.
-Otherwise,
-.Dv NULL
-is returned.
-The
-.Fn fgetln
-function
-does not distinguish between end-of-file and error; the routines
-.Xr feof 3
-and
-.Xr ferror 3
-must be used
-to determine which occurred.
-If an error occurs, the global variable
-.Va errno
-is set to indicate the error.
-The end-of-file condition is remembered, even on a terminal, and all
-subsequent attempts to read will return
-.Dv NULL
-until the condition is
-cleared with
-.Xr clearerr 3 .
-.Pp
-The text to which the returned pointer points may be modified,
-provided that no changes are made beyond the returned size.
-These changes are lost as soon as the pointer becomes invalid.
-.Sh ERRORS
-.Bl -tag -width Er
-.It Bq Er EBADF
-The argument
-.Fa stream
-is not a stream open for reading.
-.El
-.Pp
-The
-.Fn fgetln
-function
-may also fail and set
-.Va errno
-for any of the errors specified for the routines
-.Xr fflush 3 ,
-.Xr malloc 3 ,
-.Xr read 2 ,
-.Xr stat 2 ,
-or
-.Xr realloc 3 .
-.Sh SEE ALSO
-.Xr ferror 3 ,
-.Xr fgets 3 ,
-.Xr fgetwln 3 ,
-.Xr fopen 3 ,
-.Xr getline 3 ,
-.Xr putc 3
-.Sh HISTORY
-The
-.Fn fgetln
-function first appeared in
-.Bx 4.4 .
diff --git a/freebsd-userspace/lib/libc/stdlib/strtonum.3 b/freebsd-userspace/lib/libc/stdlib/strtonum.3
deleted file mode 100644
index b83aadda..00000000
--- a/freebsd-userspace/lib/libc/stdlib/strtonum.3
+++ /dev/null
@@ -1,155 +0,0 @@
-.\" Copyright (c) 2004 Ted Unangst
-.\"
-.\" Permission to use, copy, modify, and distribute this software for any
-.\" purpose with or without fee is hereby granted, provided that the above
-.\" copyright notice and this permission notice appear in all copies.
-.\"
-.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-.\"
-.\" $OpenBSD: strtonum.3,v 1.13 2006/04/25 05:15:42 tedu Exp $
-.\" $FreeBSD$
-.\"
-.Dd April 29, 2004
-.Dt STRTONUM 3
-.Os
-.Sh NAME
-.Nm strtonum
-.Nd "reliably convert string value to an integer"
-.Sh SYNOPSIS
-.In stdlib.h
-.Ft long long
-.Fo strtonum
-.Fa "const char *nptr"
-.Fa "long long minval"
-.Fa "long long maxval"
-.Fa "const char **errstr"
-.Fc
-.Sh DESCRIPTION
-The
-.Fn strtonum
-function converts the string in
-.Fa nptr
-to a
-.Vt "long long"
-value.
-The
-.Fn strtonum
-function was designed to facilitate safe, robust programming
-and overcome the shortcomings of the
-.Xr atoi 3
-and
-.Xr strtol 3
-family of interfaces.
-.Pp
-The string may begin with an arbitrary amount of whitespace
-(as determined by
-.Xr isspace 3 )
-followed by a single optional
-.Ql +
-or
-.Ql -
-sign.
-.Pp
-The remainder of the string is converted to a
-.Vt "long long"
-value according to base 10.
-.Pp
-The value obtained is then checked against the provided
-.Fa minval
-and
-.Fa maxval
-bounds.
-If
-.Fa errstr
-is non-null,
-.Fn strtonum
-stores an error string in
-.Fa *errstr
-indicating the failure.
-.Sh RETURN VALUES
-The
-.Fn strtonum
-function returns the result of the conversion,
-unless the value would exceed the provided bounds or is invalid.
-On error, 0 is returned,
-.Va errno
-is set, and
-.Fa errstr
-will point to an error message.
-On success,
-.Fa *errstr
-will be set to
-.Dv NULL ;
-this fact can be used to differentiate
-a successful return of 0 from an error.
-.Sh EXAMPLES
-Using
-.Fn strtonum
-correctly is meant to be simpler than the alternative functions.
-.Bd -literal -offset indent
-int iterations;
-const char *errstr;
-
-iterations = strtonum(optarg, 1, 64, &errstr);
-if (errstr)
- errx(1, "number of iterations is %s: %s", errstr, optarg);
-.Ed
-.Pp
-The above example will guarantee that the value of iterations is between
-1 and 64 (inclusive).
-.Sh ERRORS
-.Bl -tag -width Er
-.It Bq Er ERANGE
-The given string was out of range.
-.It Bq Er EINVAL
-The given string did not consist solely of digit characters.
-.It Bq Er EINVAL
-The supplied
-.Fa minval
-was larger than
-.Fa maxval .
-.El
-.Pp
-If an error occurs,
-.Fa errstr
-will be set to one of the following strings:
-.Pp
-.Bl -tag -width ".Li too large" -compact
-.It Li "too large"
-The result was larger than the provided maximum value.
-.It Li "too small"
-The result was smaller than the provided minimum value.
-.It Li invalid
-The string did not consist solely of digit characters.
-.El
-.Sh SEE ALSO
-.Xr atof 3 ,
-.Xr atoi 3 ,
-.Xr atol 3 ,
-.Xr atoll 3 ,
-.Xr sscanf 3 ,
-.Xr strtod 3 ,
-.Xr strtol 3 ,
-.Xr strtoul 3
-.Sh STANDARDS
-The
-.Fn strtonum
-function is a
-.Bx
-extension.
-The existing alternatives, such as
-.Xr atoi 3
-and
-.Xr strtol 3 ,
-are either impossible or difficult to use safely.
-.Sh HISTORY
-The
-.Fn strtonum
-function first appeared in
-.Ox 3.6 .
diff --git a/freebsd-userspace/lib/libc_r/uthread/uthread_kern.c b/freebsd-userspace/lib/libc_r/uthread/uthread_kern.c
deleted file mode 100644
index a8c8720d..00000000
--- a/freebsd-userspace/lib/libc_r/uthread/uthread_kern.c
+++ /dev/null
@@ -1,1157 +0,0 @@
-/*
- * Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- *
- */
-#include <errno.h>
-#include <poll.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <unistd.h>
-#include <setjmp.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#ifdef __rtems__
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/timespec.h>
-#else
-#include <sys/signalvar.h>
-#endif
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <sys/uio.h>
-#ifndef __rtems__
-#include <sys/syscall.h>
-#endif
-#include <fcntl.h>
-#include <pthread.h>
-#include "pthread_private.h"
-
-#ifdef __rtems__
-#include <rtems.h>
-#endif
-
-/* #define DEBUG_THREAD_KERN */
-#ifdef DEBUG_THREAD_KERN
-#define DBG_MSG stdout_debug
-#else
-#define DBG_MSG(x...)
-#endif
-
-/* Static function prototype definitions: */
-static void
-thread_kern_poll(int wait_reqd);
-
-static void
-dequeue_signals(void);
-
-static inline void
-thread_run_switch_hook(pthread_t thread_out, pthread_t thread_in);
-
-/* Static variables: */
-static int last_tick = 0;
-static int called_from_handler = 0;
-
-#ifndef __rtems__
-/*
- * This is called when a signal handler finishes and wants to
- * return to a previous frame.
- */
-void
-_thread_kern_sched_frame(struct pthread_signal_frame *psf)
-{
- struct pthread *curthread = _get_curthread();
-
- /*
- * Flag the pthread kernel as executing scheduler code
- * to avoid a signal from interrupting this execution and
- * corrupting the (soon-to-be) current frame.
- */
- _thread_kern_in_sched = 1;
-
- /* Restore the signal frame: */
- _thread_sigframe_restore(curthread, psf);
-
- /* The signal mask was restored; check for any pending signals: */
- curthread->check_pending = 1;
-
- /* Switch to the thread scheduler: */
- ___longjmp(_thread_kern_sched_jb, 1);
-}
-
-
-void
-_thread_kern_sched(ucontext_t *ucp)
-{
- struct pthread *curthread = _get_curthread();
-
- /*
- * Flag the pthread kernel as executing scheduler code
- * to avoid a scheduler signal from interrupting this
- * execution and calling the scheduler again.
- */
- _thread_kern_in_sched = 1;
-
- /* Check if this function was called from the signal handler: */
- if (ucp != NULL) {
- called_from_handler = 1;
- DBG_MSG("Entering scheduler due to signal\n");
- }
-
- /* Save the state of the current thread: */
- if (_setjmp(curthread->ctx.jb) != 0) {
- DBG_MSG("Returned from ___longjmp, thread %p\n",
- curthread);
- /*
- * This point is reached when a longjmp() is called
- * to restore the state of a thread.
- *
- * This is the normal way out of the scheduler.
- */
- _thread_kern_in_sched = 0;
-
- if (curthread->sig_defer_count == 0) {
- if (((curthread->cancelflags &
- PTHREAD_AT_CANCEL_POINT) == 0) &&
- ((curthread->cancelflags &
- PTHREAD_CANCEL_ASYNCHRONOUS) != 0))
- /*
- * Cancellations override signals.
- *
- * Stick a cancellation point at the
- * start of each async-cancellable
- * thread's resumption.
- *
- * We allow threads woken at cancel
- * points to do their own checks.
- */
- pthread_testcancel();
- }
-
- if (_sched_switch_hook != NULL) {
- /* Run the installed switch hook: */
- thread_run_switch_hook(_last_user_thread, curthread);
- }
- if (ucp == NULL)
- return;
- else {
- /*
- * Set the process signal mask in the context; it
- * could have changed by the handler.
- */
- ucp->uc_sigmask = _process_sigmask;
-
- /* Resume the interrupted thread: */
- __sys_sigreturn(ucp);
- }
- }
- /* Switch to the thread scheduler: */
- ___longjmp(_thread_kern_sched_jb, 1);
-}
-
-void
-_thread_kern_sched_sig(void)
-{
- struct pthread *curthread = _get_curthread();
-
- curthread->check_pending = 1;
- _thread_kern_sched(NULL);
-}
-
-
-void
-_thread_kern_scheduler(void)
-{
- struct timespec ts;
- struct timeval tv;
- struct pthread *curthread = _get_curthread();
- pthread_t pthread, pthread_h;
- unsigned int current_tick;
- int add_to_prioq;
-
- /* If the currently running thread is a user thread, save it: */
- if ((curthread->flags & PTHREAD_FLAGS_PRIVATE) == 0)
- _last_user_thread = curthread;
-
- if (called_from_handler != 0) {
- called_from_handler = 0;
-
- /*
- * We were called from a signal handler; restore the process
- * signal mask.
- */
- if (__sys_sigprocmask(SIG_SETMASK,
- &_process_sigmask, NULL) != 0)
- PANIC("Unable to restore process mask after signal");
- }
-
- /*
- * Enter a scheduling loop that finds the next thread that is
- * ready to run. This loop completes when there are no more threads
- * in the global list or when a thread has its state restored by
- * either a sigreturn (if the state was saved as a sigcontext) or a
- * longjmp (if the state was saved by a setjmp).
- */
- while (!(TAILQ_EMPTY(&_thread_list))) {
- /* Get the current time of day: */
- GET_CURRENT_TOD(tv);
- TIMEVAL_TO_TIMESPEC(&tv, &ts);
- current_tick = _sched_ticks;
-
- /*
- * Protect the scheduling queues from access by the signal
- * handler.
- */
- _queue_signals = 1;
- add_to_prioq = 0;
-
- if (curthread != &_thread_kern_thread) {
- /*
- * This thread no longer needs to yield the CPU.
- */
- curthread->yield_on_sig_undefer = 0;
-
- if (curthread->state != PS_RUNNING) {
- /*
- * Save the current time as the time that the
- * thread became inactive:
- */
- curthread->last_inactive = (long)current_tick;
- if (curthread->last_inactive <
- curthread->last_active) {
- /* Account for a rollover: */
- curthread->last_inactive =+
- UINT_MAX + 1;
- }
- }
-
- /*
- * Place the currently running thread into the
- * appropriate queue(s).
- */
- switch (curthread->state) {
- case PS_DEAD:
- case PS_STATE_MAX: /* to silence -Wall */
- case PS_SUSPENDED:
- /*
- * Dead and suspended threads are not placed
- * in any queue:
- */
- break;
-
- case PS_RUNNING:
- /*
- * Runnable threads can't be placed in the
- * priority queue until after waiting threads
- * are polled (to preserve round-robin
- * scheduling).
- */
- add_to_prioq = 1;
- break;
-
- /*
- * States which do not depend on file descriptor I/O
- * operations or timeouts:
- */
- case PS_DEADLOCK:
- case PS_FDLR_WAIT:
- case PS_FDLW_WAIT:
- case PS_FILE_WAIT:
- case PS_JOIN:
- case PS_MUTEX_WAIT:
- case PS_SIGSUSPEND:
- case PS_SIGTHREAD:
- case PS_SIGWAIT:
- case PS_WAIT_WAIT:
- /* No timeouts for these states: */
- curthread->wakeup_time.tv_sec = -1;
- curthread->wakeup_time.tv_nsec = -1;
-
- /* Restart the time slice: */
- curthread->slice_usec = -1;
-
- /* Insert into the waiting queue: */
- PTHREAD_WAITQ_INSERT(curthread);
- break;
-
- /* States which can timeout: */
- case PS_COND_WAIT:
- case PS_SLEEP_WAIT:
- /* Restart the time slice: */
- curthread->slice_usec = -1;
-
- /* Insert into the waiting queue: */
- PTHREAD_WAITQ_INSERT(curthread);
- break;
-
- /* States that require periodic work: */
- case PS_SPINBLOCK:
- /* No timeouts for this state: */
- curthread->wakeup_time.tv_sec = -1;
- curthread->wakeup_time.tv_nsec = -1;
-
- /* Increment spinblock count: */
- _spinblock_count++;
-
- /* FALLTHROUGH */
- case PS_FDR_WAIT:
- case PS_FDW_WAIT:
- case PS_POLL_WAIT:
- case PS_SELECT_WAIT:
- /* Restart the time slice: */
- curthread->slice_usec = -1;
-
- /* Insert into the waiting queue: */
- PTHREAD_WAITQ_INSERT(curthread);
-
- /* Insert into the work queue: */
- PTHREAD_WORKQ_INSERT(curthread);
- break;
- }
-
- /*
- * Are there pending signals for this thread?
- *
- * This check has to be performed after the thread
- * has been placed in the queue(s) appropriate for
- * its state. The process of adding pending signals
- * can change a threads state, which in turn will
- * attempt to add or remove the thread from any
- * scheduling queue to which it belongs.
- */
- if (curthread->check_pending != 0) {
- curthread->check_pending = 0;
- _thread_sig_check_pending(curthread);
- }
- }
-
- /*
- * Avoid polling file descriptors if there are none
- * waiting:
- */
- if (TAILQ_EMPTY(&_workq) != 0) {
- }
- /*
- * Poll file descriptors only if a new scheduling signal
- * has occurred or if we have no more runnable threads.
- */
- else if (((current_tick = _sched_ticks) != last_tick) ||
- ((curthread->state != PS_RUNNING) &&
- (PTHREAD_PRIOQ_FIRST() == NULL))) {
- /* Unprotect the scheduling queues: */
- _queue_signals = 0;
-
- /*
- * Poll file descriptors to update the state of threads
- * waiting on file I/O where data may be available:
- */
- thread_kern_poll(0);
-
- /* Protect the scheduling queues: */
- _queue_signals = 1;
- }
- last_tick = current_tick;
-
- /*
- * Wake up threads that have timedout. This has to be
- * done after polling in case a thread does a poll or
- * select with zero time.
- */
- PTHREAD_WAITQ_SETACTIVE();
- while (((pthread = TAILQ_FIRST(&_waitingq)) != NULL) &&
- (pthread->wakeup_time.tv_sec != -1) &&
- (((pthread->wakeup_time.tv_sec == 0) &&
- (pthread->wakeup_time.tv_nsec == 0)) ||
- (pthread->wakeup_time.tv_sec < ts.tv_sec) ||
- ((pthread->wakeup_time.tv_sec == ts.tv_sec) &&
- (pthread->wakeup_time.tv_nsec <= ts.tv_nsec)))) {
- switch (pthread->state) {
- case PS_POLL_WAIT:
- case PS_SELECT_WAIT:
- /* Return zero file descriptors ready: */
- pthread->data.poll_data->nfds = 0;
- /* FALLTHROUGH */
- default:
- /*
- * Remove this thread from the waiting queue
- * (and work queue if necessary) and place it
- * in the ready queue.
- */
- PTHREAD_WAITQ_CLEARACTIVE();
- if (pthread->flags & PTHREAD_FLAGS_IN_WORKQ)
- PTHREAD_WORKQ_REMOVE(pthread);
- PTHREAD_NEW_STATE(pthread, PS_RUNNING);
- PTHREAD_WAITQ_SETACTIVE();
- break;
- }
- /*
- * Flag the timeout in the thread structure:
- */
- pthread->timeout = 1;
- }
- PTHREAD_WAITQ_CLEARACTIVE();
-
- /*
- * Check to see if the current thread needs to be added
- * to the priority queue:
- */
- if (add_to_prioq != 0) {
- /*
- * Save the current time as the time that the
- * thread became inactive:
- */
- current_tick = _sched_ticks;
- curthread->last_inactive = (long)current_tick;
- if (curthread->last_inactive <
- curthread->last_active) {
- /* Account for a rollover: */
- curthread->last_inactive =+ UINT_MAX + 1;
- }
-
- if ((curthread->slice_usec != -1) &&
- (curthread->attr.sched_policy != SCHED_FIFO)) {
- /*
- * Accumulate the number of microseconds for
- * which the current thread has run:
- */
- curthread->slice_usec +=
- (curthread->last_inactive -
- curthread->last_active) *
- (long)_clock_res_usec;
- /* Check for time quantum exceeded: */
- if (curthread->slice_usec > TIMESLICE_USEC)
- curthread->slice_usec = -1;
- }
-
- if (curthread->slice_usec == -1) {
- /*
- * The thread exceeded its time
- * quantum or it yielded the CPU;
- * place it at the tail of the
- * queue for its priority.
- */
- PTHREAD_PRIOQ_INSERT_TAIL(curthread);
- } else {
- /*
- * The thread hasn't exceeded its
- * interval. Place it at the head
- * of the queue for its priority.
- */
- PTHREAD_PRIOQ_INSERT_HEAD(curthread);
- }
- }
-
- /*
- * Get the highest priority thread in the ready queue.
- */
- pthread_h = PTHREAD_PRIOQ_FIRST();
-
- /* Check if there are no threads ready to run: */
- if (pthread_h == NULL) {
- /*
- * Lock the pthread kernel by changing the pointer to
- * the running thread to point to the global kernel
- * thread structure:
- */
- _set_curthread(&_thread_kern_thread);
- curthread = &_thread_kern_thread;
-
- DBG_MSG("No runnable threads, using kernel thread %p\n",
- curthread);
-
- /* Unprotect the scheduling queues: */
- _queue_signals = 0;
-
- /*
- * There are no threads ready to run, so wait until
- * something happens that changes this condition:
- */
- thread_kern_poll(1);
-
- /*
- * This process' usage will likely be very small
- * while waiting in a poll. Since the scheduling
- * clock is based on the profiling timer, it is
- * unlikely that the profiling timer will fire
- * and update the time of day. To account for this,
- * get the time of day after polling with a timeout.
- */
- gettimeofday((struct timeval *) &_sched_tod, NULL);
-
- /* Check once more for a runnable thread: */
- _queue_signals = 1;
- pthread_h = PTHREAD_PRIOQ_FIRST();
- _queue_signals = 0;
- }
-
- if (pthread_h != NULL) {
- /* Remove the thread from the ready queue: */
- PTHREAD_PRIOQ_REMOVE(pthread_h);
-
- /* Unprotect the scheduling queues: */
- _queue_signals = 0;
-
- /*
- * Check for signals queued while the scheduling
- * queues were protected:
- */
- while (_sigq_check_reqd != 0) {
- /* Clear before handling queued signals: */
- _sigq_check_reqd = 0;
-
- /* Protect the scheduling queues again: */
- _queue_signals = 1;
-
- dequeue_signals();
-
- /*
- * Check for a higher priority thread that
- * became runnable due to signal handling.
- */
- if (((pthread = PTHREAD_PRIOQ_FIRST()) != NULL) &&
- (pthread->active_priority > pthread_h->active_priority)) {
- /* Remove the thread from the ready queue: */
- PTHREAD_PRIOQ_REMOVE(pthread);
-
- /*
- * Insert the lower priority thread
- * at the head of its priority list:
- */
- PTHREAD_PRIOQ_INSERT_HEAD(pthread_h);
-
- /* There's a new thread in town: */
- pthread_h = pthread;
- }
-
- /* Unprotect the scheduling queues: */
- _queue_signals = 0;
- }
-
- /* Make the selected thread the current thread: */
- _set_curthread(pthread_h);
- curthread = pthread_h;
-
- /*
- * Save the current time as the time that the thread
- * became active:
- */
- current_tick = _sched_ticks;
- curthread->last_active = (long) current_tick;
-
- /*
- * Check if this thread is running for the first time
- * or running again after using its full time slice
- * allocation:
- */
- if (curthread->slice_usec == -1) {
- /* Reset the accumulated time slice period: */
- curthread->slice_usec = 0;
- }
-
- /*
- * If we had a context switch, run any
- * installed switch hooks.
- */
- if ((_sched_switch_hook != NULL) &&
- (_last_user_thread != curthread)) {
- thread_run_switch_hook(_last_user_thread,
- curthread);
- }
- /*
- * Continue the thread at its current frame:
- */
-#if NOT_YET
- _setcontext(&curthread->ctx.uc);
-#else
- ___longjmp(curthread->ctx.jb, 1);
-#endif
- /* This point should not be reached. */
- PANIC("Thread has returned from sigreturn or longjmp");
- }
- }
-
- /* There are no more threads, so exit this process: */
- exit(0);
-}
-#endif /* __rtems__ */
-
-void
-_thread_kern_sched_state(enum pthread_state state, char *fname, int lineno)
-{
-#ifdef __rtems__
- rtems_task_wake_after(RTEMS_YIELD_PROCESSOR);
-#else
-
- struct pthread *curthread = _get_curthread();
-
- /*
- * Flag the pthread kernel as executing scheduler code
- * to avoid a scheduler signal from interrupting this
- * execution and calling the scheduler again.
- */
- _thread_kern_in_sched = 1;
-
- /*
- * Prevent the signal handler from fiddling with this thread
- * before its state is set and is placed into the proper queue.
- */
- _queue_signals = 1;
-
- /* Change the state of the current thread: */
- curthread->state = state;
- curthread->fname = fname;
- curthread->lineno = lineno;
-
- /* Schedule the next thread that is ready: */
- _thread_kern_sched(NULL);
-#endif /* __rtems__ */
-}
-
-#ifndef __rtems__
-void
-_thread_kern_sched_state_unlock(enum pthread_state state,
- spinlock_t *lock, char *fname, int lineno)
-{
- struct pthread *curthread = _get_curthread();
-
- /*
- * Flag the pthread kernel as executing scheduler code
- * to avoid a scheduler signal from interrupting this
- * execution and calling the scheduler again.
- */
- _thread_kern_in_sched = 1;
-
- /*
- * Prevent the signal handler from fiddling with this thread
- * before its state is set and it is placed into the proper
- * queue(s).
- */
- _queue_signals = 1;
-
- /* Change the state of the current thread: */
- curthread->state = state;
- curthread->fname = fname;
- curthread->lineno = lineno;
-
- _SPINUNLOCK(lock);
-
- /* Schedule the next thread that is ready: */
- _thread_kern_sched(NULL);
-}
-
-static void
-thread_kern_poll(int wait_reqd)
-{
- int count = 0;
- int i, found;
- int kern_pipe_added = 0;
- int nfds = 0;
- int timeout_ms = 0;
- struct pthread *pthread;
- struct timespec ts;
- struct timeval tv;
-
- /* Check if the caller wants to wait: */
- if (wait_reqd == 0) {
- timeout_ms = 0;
- }
- else {
- /* Get the current time of day: */
- GET_CURRENT_TOD(tv);
- TIMEVAL_TO_TIMESPEC(&tv, &ts);
-
- _queue_signals = 1;
- pthread = TAILQ_FIRST(&_waitingq);
- _queue_signals = 0;
-
- if ((pthread == NULL) || (pthread->wakeup_time.tv_sec == -1)) {
- /*
- * Either there are no threads in the waiting queue,
- * or there are no threads that can timeout.
- */
- timeout_ms = INFTIM;
- }
- else if (pthread->wakeup_time.tv_sec - ts.tv_sec > 60000)
- /* Limit maximum timeout to prevent rollover. */
- timeout_ms = 60000;
- else {
- /*
- * Calculate the time left for the next thread to
- * timeout:
- */
- timeout_ms = ((pthread->wakeup_time.tv_sec - ts.tv_sec) *
- 1000) + ((pthread->wakeup_time.tv_nsec - ts.tv_nsec) /
- 1000000);
- /*
- * Don't allow negative timeouts:
- */
- if (timeout_ms < 0)
- timeout_ms = 0;
- }
- }
-
- /* Protect the scheduling queues: */
- _queue_signals = 1;
-
- /*
- * Check to see if the signal queue needs to be walked to look
- * for threads awoken by a signal while in the scheduler.
- */
- if (_sigq_check_reqd != 0) {
- /* Reset flag before handling queued signals: */
- _sigq_check_reqd = 0;
-
- dequeue_signals();
- }
-
- /*
- * Check for a thread that became runnable due to a signal:
- */
- if (PTHREAD_PRIOQ_FIRST() != NULL) {
- /*
- * Since there is at least one runnable thread,
- * disable the wait.
- */
- timeout_ms = 0;
- }
-
- /*
- * Form the poll table:
- */
- nfds = 0;
- if (timeout_ms != 0) {
- /* Add the kernel pipe to the poll table: */
- _thread_pfd_table[nfds].fd = _thread_kern_pipe[0];
- _thread_pfd_table[nfds].events = POLLRDNORM;
- _thread_pfd_table[nfds].revents = 0;
- nfds++;
- kern_pipe_added = 1;
- }
-
- PTHREAD_WAITQ_SETACTIVE();
- TAILQ_FOREACH(pthread, &_workq, qe) {
- switch (pthread->state) {
- case PS_SPINBLOCK:
- /*
- * If the lock is available, let the thread run.
- */
- if (pthread->data.spinlock->access_lock == 0) {
- PTHREAD_WAITQ_CLEARACTIVE();
- PTHREAD_WORKQ_REMOVE(pthread);
- PTHREAD_NEW_STATE(pthread,PS_RUNNING);
- PTHREAD_WAITQ_SETACTIVE();
- /* One less thread in a spinblock state: */
- _spinblock_count--;
- /*
- * Since there is at least one runnable
- * thread, disable the wait.
- */
- timeout_ms = 0;
- }
- break;
-
- /* File descriptor read wait: */
- case PS_FDR_WAIT:
- /* Limit number of polled files to table size: */
- if (nfds < _thread_dtablesize) {
- _thread_pfd_table[nfds].events = POLLRDNORM;
- _thread_pfd_table[nfds].fd = pthread->data.fd.fd;
- nfds++;
- }
- break;
-
- /* File descriptor write wait: */
- case PS_FDW_WAIT:
- /* Limit number of polled files to table size: */
- if (nfds < _thread_dtablesize) {
- _thread_pfd_table[nfds].events = POLLWRNORM;
- _thread_pfd_table[nfds].fd = pthread->data.fd.fd;
- nfds++;
- }
- break;
-
- /* File descriptor poll or select wait: */
- case PS_POLL_WAIT:
- case PS_SELECT_WAIT:
- /* Limit number of polled files to table size: */
- if (pthread->data.poll_data->nfds + nfds <
- _thread_dtablesize) {
- for (i = 0; i < pthread->data.poll_data->nfds; i++) {
- _thread_pfd_table[nfds + i].fd =
- pthread->data.poll_data->fds[i].fd;
- _thread_pfd_table[nfds + i].events =
- pthread->data.poll_data->fds[i].events;
- }
- nfds += pthread->data.poll_data->nfds;
- }
- break;
-
- /* Other states do not depend on file I/O. */
- default:
- break;
- }
- }
- PTHREAD_WAITQ_CLEARACTIVE();
-
- /*
- * Wait for a file descriptor to be ready for read, write, or
- * an exception, or a timeout to occur:
- */
- count = __sys_poll(_thread_pfd_table, nfds, timeout_ms);
-
- if (kern_pipe_added != 0)
- /*
- * Remove the pthread kernel pipe file descriptor
- * from the pollfd table:
- */
- nfds = 1;
- else
- nfds = 0;
-
- /*
- * Check if it is possible that there are bytes in the kernel
- * read pipe waiting to be read:
- */
- if (count < 0 || ((kern_pipe_added != 0) &&
- (_thread_pfd_table[0].revents & POLLRDNORM))) {
- /*
- * If the kernel read pipe was included in the
- * count:
- */
- if (count > 0) {
- /* Decrement the count of file descriptors: */
- count--;
- }
-
- if (_sigq_check_reqd != 0) {
- /* Reset flag before handling signals: */
- _sigq_check_reqd = 0;
-
- dequeue_signals();
- }
- }
-
- /*
- * Check if any file descriptors are ready:
- */
- if (count > 0) {
- /*
- * Enter a loop to look for threads waiting on file
- * descriptors that are flagged as available by the
- * _poll syscall:
- */
- PTHREAD_WAITQ_SETACTIVE();
- TAILQ_FOREACH(pthread, &_workq, qe) {
- switch (pthread->state) {
- case PS_SPINBLOCK:
- /*
- * If the lock is available, let the thread run.
- */
- if (pthread->data.spinlock->access_lock == 0) {
- PTHREAD_WAITQ_CLEARACTIVE();
- PTHREAD_WORKQ_REMOVE(pthread);
- PTHREAD_NEW_STATE(pthread,PS_RUNNING);
- PTHREAD_WAITQ_SETACTIVE();
-
- /*
- * One less thread in a spinblock state:
- */
- _spinblock_count--;
- }
- break;
-
- /* File descriptor read wait: */
- case PS_FDR_WAIT:
- if ((nfds < _thread_dtablesize) &&
- (_thread_pfd_table[nfds].revents
- & (POLLRDNORM|POLLERR|POLLHUP|POLLNVAL))
- != 0) {
- PTHREAD_WAITQ_CLEARACTIVE();
- PTHREAD_WORKQ_REMOVE(pthread);
- PTHREAD_NEW_STATE(pthread,PS_RUNNING);
- PTHREAD_WAITQ_SETACTIVE();
- }
- nfds++;
- break;
-
- /* File descriptor write wait: */
- case PS_FDW_WAIT:
- if ((nfds < _thread_dtablesize) &&
- (_thread_pfd_table[nfds].revents
- & (POLLWRNORM|POLLERR|POLLHUP|POLLNVAL))
- != 0) {
- PTHREAD_WAITQ_CLEARACTIVE();
- PTHREAD_WORKQ_REMOVE(pthread);
- PTHREAD_NEW_STATE(pthread,PS_RUNNING);
- PTHREAD_WAITQ_SETACTIVE();
- }
- nfds++;
- break;
-
- /* File descriptor poll or select wait: */
- case PS_POLL_WAIT:
- case PS_SELECT_WAIT:
- if (pthread->data.poll_data->nfds + nfds <
- _thread_dtablesize) {
- /*
- * Enter a loop looking for I/O
- * readiness:
- */
- found = 0;
- for (i = 0; i < pthread->data.poll_data->nfds; i++) {
- if (_thread_pfd_table[nfds + i].revents != 0) {
- pthread->data.poll_data->fds[i].revents =
- _thread_pfd_table[nfds + i].revents;
- found++;
- }
- }
-
- /* Increment before destroying: */
- nfds += pthread->data.poll_data->nfds;
-
- if (found != 0) {
- pthread->data.poll_data->nfds = found;
- PTHREAD_WAITQ_CLEARACTIVE();
- PTHREAD_WORKQ_REMOVE(pthread);
- PTHREAD_NEW_STATE(pthread,PS_RUNNING);
- PTHREAD_WAITQ_SETACTIVE();
- }
- }
- else
- nfds += pthread->data.poll_data->nfds;
- break;
-
- /* Other states do not depend on file I/O. */
- default:
- break;
- }
- }
- PTHREAD_WAITQ_CLEARACTIVE();
- }
- else if (_spinblock_count != 0) {
- /*
- * Enter a loop to look for threads waiting on a spinlock
- * that is now available.
- */
- PTHREAD_WAITQ_SETACTIVE();
- TAILQ_FOREACH(pthread, &_workq, qe) {
- if (pthread->state == PS_SPINBLOCK) {
- /*
- * If the lock is available, let the thread run.
- */
- if (pthread->data.spinlock->access_lock == 0) {
- PTHREAD_WAITQ_CLEARACTIVE();
- PTHREAD_WORKQ_REMOVE(pthread);
- PTHREAD_NEW_STATE(pthread,PS_RUNNING);
- PTHREAD_WAITQ_SETACTIVE();
-
- /*
- * One less thread in a spinblock state:
- */
- _spinblock_count--;
- }
- }
- }
- PTHREAD_WAITQ_CLEARACTIVE();
- }
-
- /* Unprotect the scheduling queues: */
- _queue_signals = 0;
-
- while (_sigq_check_reqd != 0) {
- /* Handle queued signals: */
- _sigq_check_reqd = 0;
-
- /* Protect the scheduling queues: */
- _queue_signals = 1;
-
- dequeue_signals();
-
- /* Unprotect the scheduling queues: */
- _queue_signals = 0;
- }
-}
-#endif /* __rtems__ */
-
-void
-_thread_kern_set_timeout(const struct timespec * timeout)
-{
- struct pthread *curthread = _get_curthread();
- struct timespec current_time;
- struct timeval tv;
-
- /* Reset the timeout flag for the running thread: */
- curthread->timeout = 0;
-
- /* Check if the thread is to wait forever: */
- if (timeout == NULL) {
- /*
- * Set the wakeup time to something that can be recognised as
- * different to an actual time of day:
- */
- curthread->wakeup_time.tv_sec = -1;
- curthread->wakeup_time.tv_nsec = -1;
- }
- /* Check if no waiting is required: */
- else if (timeout->tv_sec == 0 && timeout->tv_nsec == 0) {
- /* Set the wake up time to 'immediately': */
- curthread->wakeup_time.tv_sec = 0;
- curthread->wakeup_time.tv_nsec = 0;
- } else {
- /* Get the current time: */
- GET_CURRENT_TOD(tv);
- TIMEVAL_TO_TIMESPEC(&tv, &current_time);
-
- /* Calculate the time for the current thread to wake up: */
- curthread->wakeup_time.tv_sec = current_time.tv_sec + timeout->tv_sec;
- curthread->wakeup_time.tv_nsec = current_time.tv_nsec + timeout->tv_nsec;
-
- /* Check if the nanosecond field needs to wrap: */
- if (curthread->wakeup_time.tv_nsec >= 1000000000) {
- /* Wrap the nanosecond field: */
- curthread->wakeup_time.tv_sec += 1;
- curthread->wakeup_time.tv_nsec -= 1000000000;
- }
- }
-}
-
-#ifndef __rtems__
-void
-_thread_kern_sig_defer(void)
-{
- struct pthread *curthread = _get_curthread();
-
- /* Allow signal deferral to be recursive. */
- curthread->sig_defer_count++;
-}
-
-void
-_thread_kern_sig_undefer(void)
-{
- struct pthread *curthread = _get_curthread();
-
- /*
- * Perform checks to yield only if we are about to undefer
- * signals.
- */
- if (curthread->sig_defer_count > 1) {
- /* Decrement the signal deferral count. */
- curthread->sig_defer_count--;
- }
- else if (curthread->sig_defer_count == 1) {
- /* Reenable signals: */
- curthread->sig_defer_count = 0;
-
- /*
- * Check if there are queued signals:
- */
- if (_sigq_check_reqd != 0)
- _thread_kern_sched(NULL);
-
- /*
- * Check for asynchronous cancellation before delivering any
- * pending signals:
- */
- if (((curthread->cancelflags & PTHREAD_AT_CANCEL_POINT) == 0) &&
- ((curthread->cancelflags & PTHREAD_CANCEL_ASYNCHRONOUS) != 0))
- pthread_testcancel();
-
- /*
- * If there are pending signals or this thread has
- * to yield the CPU, call the kernel scheduler:
- *
- * XXX - Come back and revisit the pending signal problem
- */
- if ((curthread->yield_on_sig_undefer != 0) ||
- SIGNOTEMPTY(curthread->sigpend)) {
- curthread->yield_on_sig_undefer = 0;
- _thread_kern_sched(NULL);
- }
- }
-}
-
-static void
-dequeue_signals(void)
-{
- char bufr[128];
- int num;
-
- /*
- * Enter a loop to clear the pthread kernel pipe:
- */
- while (((num = __sys_read(_thread_kern_pipe[0], bufr,
- sizeof(bufr))) > 0) || (num == -1 && errno == EINTR)) {
- }
- if ((num < 0) && (errno != EAGAIN)) {
- /*
- * The only error we should expect is if there is
- * no data to read.
- */
- PANIC("Unable to read from thread kernel pipe");
- }
- /* Handle any pending signals: */
- _thread_sig_handle_pending();
-}
-
-static inline void
-thread_run_switch_hook(pthread_t thread_out, pthread_t thread_in)
-{
- pthread_t tid_out = thread_out;
- pthread_t tid_in = thread_in;
-
- if ((tid_out != NULL) &&
- (tid_out->flags & PTHREAD_FLAGS_PRIVATE) != 0)
- tid_out = NULL;
- if ((tid_in != NULL) &&
- (tid_in->flags & PTHREAD_FLAGS_PRIVATE) != 0)
- tid_in = NULL;
-
- if ((_sched_switch_hook != NULL) && (tid_out != tid_in)) {
- /* Run the scheduler switch hook: */
- _sched_switch_hook(tid_out, tid_in);
- }
-}
-
-struct pthread *
-_get_curthread(void)
-{
- if (_thread_initial == NULL)
- _thread_init();
-
- return (_thread_run);
-}
-
-void
-_set_curthread(struct pthread *newthread)
-{
- _thread_run = newthread;
-}
-#endif /* __rtems__ */
diff --git a/freebsd-userspace/lib/libc_r/uthread/uthread_select.c b/freebsd-userspace/lib/libc_r/uthread/uthread_select.c
deleted file mode 100644
index 632f44d2..00000000
--- a/freebsd-userspace/lib/libc_r/uthread/uthread_select.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#include <unistd.h>
-#include <errno.h>
-#include <poll.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/fcntl.h>
-#include <pthread.h>
-#include "pthread_private.h"
-
-__weak_reference(__select, select);
-
-#ifdef __rtems__
-#include <freebsd/sys/timespec.h>
-#define realloc _bsd_realloc
-#endif
-
-
-int
-_select(int numfds, fd_set * readfds, fd_set * writefds, fd_set * exceptfds,
- struct timeval * timeout)
-{
- struct pthread *curthread = _get_curthread();
- struct timespec ts;
- int i, ret = 0, f_wait = 1;
- int pfd_index, got_events = 0, fd_count = 0;
- struct pthread_poll_data data;
-
-#ifndef __rtems__ /* XXX - NOT SURE WHAT TO DEFINE _thread_dtablesize TO. */
- if (numfds > _thread_dtablesize) {
- numfds = _thread_dtablesize;
- }
-#endif
- /* Count the number of file descriptors to be polled: */
- if (readfds || writefds || exceptfds) {
- for (i = 0; i < numfds; i++) {
- if ((readfds && FD_ISSET(i, readfds)) ||
- (exceptfds && FD_ISSET(i, exceptfds)) ||
- (writefds && FD_ISSET(i, writefds))) {
- fd_count++;
- }
- }
- }
-
- /*
- * Allocate memory for poll data if it hasn't already been
- * allocated or if previously allocated memory is insufficient.
- */
- if ((curthread->poll_data.fds == NULL) ||
- (curthread->poll_data.nfds < fd_count)) {
- data.fds = (struct pollfd *) realloc(curthread->poll_data.fds,
- sizeof(struct pollfd) * MAX(128, fd_count));
- if (data.fds == NULL) {
- errno = ENOMEM;
- ret = -1;
- }
- else {
- /*
- * Note that the threads poll data always
- * indicates what is allocated, not what is
- * currently being polled.
- */
- curthread->poll_data.fds = data.fds;
- curthread->poll_data.nfds = MAX(128, fd_count);
- }
- }
- /* Check if a timeout was specified: */
- if (timeout) {
- if (timeout->tv_sec < 0 ||
- timeout->tv_usec < 0 || timeout->tv_usec >= 1000000) {
- errno = EINVAL;
- return (-1);
- }
-
- /* Convert the timeval to a timespec: */
- TIMEVAL_TO_TIMESPEC(timeout, &ts);
-
- /* Set the wake up time: */
- _thread_kern_set_timeout(&ts);
- if (ts.tv_sec == 0 && ts.tv_nsec == 0)
- f_wait = 0;
- } else {
- /* Wait for ever: */
- _thread_kern_set_timeout(NULL);
- }
-
- if (ret == 0) {
- /* Setup the wait data. */
- data.fds = curthread->poll_data.fds;
- data.nfds = fd_count;
-
- /*
- * Setup the array of pollfds. Optimize this by
- running the loop in reverse and stopping when
- * the number of selected file descriptors is reached.
- */
- for (i = numfds - 1, pfd_index = fd_count - 1;
- (i >= 0) && (pfd_index >= 0); i--) {
- data.fds[pfd_index].events = 0;
- if (readfds && FD_ISSET(i, readfds)) {
- data.fds[pfd_index].events = POLLRDNORM;
- }
- if (exceptfds && FD_ISSET(i, exceptfds)) {
- data.fds[pfd_index].events |= POLLRDBAND;
- }
- if (writefds && FD_ISSET(i, writefds)) {
- data.fds[pfd_index].events |= POLLWRNORM;
- }
- if (data.fds[pfd_index].events != 0) {
- /*
- * Set the file descriptor to be polled and
- * clear revents in case of a timeout which
- * leaves fds unchanged:
- */
- data.fds[pfd_index].fd = i;
- data.fds[pfd_index].revents = 0;
- pfd_index--;
- }
- }
- if (((ret = __sys_poll(data.fds, data.nfds, 0)) == 0) &&
- (f_wait != 0)) {
- curthread->data.poll_data = &data;
- curthread->interrupted = 0;
- _thread_kern_sched_state(PS_SELECT_WAIT, __FILE__, __LINE__);
- if (curthread->interrupted) {
- errno = EINTR;
- data.nfds = 0;
- ret = -1;
- } else
- ret = data.nfds;
- }
- }
-
- if (ret >= 0) {
- numfds = 0;
- for (i = 0; i < fd_count; i++) {
- /*
- * Check the results of the poll and clear
- * this file descriptor from the fdset if
- * the requested event wasn't ready.
- */
-
- /*
- * First check for invalid descriptor.
- * If found, set errno and return -1.
- */
- if (data.fds[i].revents & POLLNVAL) {
- errno = EBADF;
- return -1;
- }
-
- got_events = 0;
- if (readfds != NULL) {
- if (FD_ISSET(data.fds[i].fd, readfds)) {
- if ((data.fds[i].revents & (POLLIN
- | POLLRDNORM | POLLERR
- | POLLHUP | POLLNVAL)) != 0)
- got_events++;
- else
- FD_CLR(data.fds[i].fd, readfds);
- }
- }
- if (writefds != NULL) {
- if (FD_ISSET(data.fds[i].fd, writefds)) {
- if ((data.fds[i].revents & (POLLOUT
- | POLLWRNORM | POLLWRBAND | POLLERR
- | POLLHUP | POLLNVAL)) != 0)
- got_events++;
- else
- FD_CLR(data.fds[i].fd,
- writefds);
- }
- }
- if (exceptfds != NULL) {
- if (FD_ISSET(data.fds[i].fd, exceptfds)) {
- if (data.fds[i].revents & (POLLRDBAND |
- POLLPRI))
- got_events++;
- else
- FD_CLR(data.fds[i].fd,
- exceptfds);
- }
- }
- if (got_events != 0)
- numfds+=got_events;
- }
- ret = numfds;
- }
-
- return (ret);
-}
-
-int
-__select(int numfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
- struct timeval *timeout)
-{
- int ret;
-
-#ifndef __rtems__
- _thread_enter_cancellation_point();
-#endif
- ret = _select(numfds, readfds, writefds, exceptfds, timeout);
-#ifndef __rtems__
- _thread_leave_cancellation_point();
-#endif
-
- return ret;
-}
diff --git a/freebsd-userspace/lib/libipsec/Makefile b/freebsd-userspace/lib/libipsec/Makefile
deleted file mode 100644
index 1fe90b12..00000000
--- a/freebsd-userspace/lib/libipsec/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# libipsec Yacc and lex files
-
-policy_token.c: policy_token.l
- ${LEX} -P __libipsecyy -t $^ | \
- sed -e '/YY_BUF_SIZE/s/16384/1024/' >$@
-
-policy_parse.c: policy_parse.y
- yacc -d -p __libipsecyy $^
- cat y.tab.c | \
- sed -e '/YY_BUF_SIZE/s/16384/1024/' >$@
- rm y.tab.c
diff --git a/freebsd-userspace/lib/libipsec/ipsec_set_policy.3 b/freebsd-userspace/lib/libipsec/ipsec_set_policy.3
deleted file mode 100644
index 1e24b63e..00000000
--- a/freebsd-userspace/lib/libipsec/ipsec_set_policy.3
+++ /dev/null
@@ -1,332 +0,0 @@
-.\" $KAME: ipsec_set_policy.3,v 1.15 2001/08/17 07:21:36 itojun Exp $
-.\"
-.\" Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of the project nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $FreeBSD$
-.\"
-.Dd February 14, 2006
-.Dt IPSEC_SET_POLICY 3
-.Os
-.Sh NAME
-.Nm ipsec_set_policy ,
-.Nm ipsec_get_policylen ,
-.Nm ipsec_dump_policy
-.Nd create an IPsec policy structure from a human readable string
-.\"
-.Sh LIBRARY
-.Lb libipsec
-.Sh SYNOPSIS
-.In netipsec/ipsec.h
-.Ft "char *"
-.Fn ipsec_set_policy "char *policy" "int len"
-.Ft int
-.Fn ipsec_get_policylen "char *buf"
-.Ft "char *"
-.Fn ipsec_dump_policy "char *buf" "char *delim"
-.Sh DESCRIPTION
-The
-.Fn ipsec_set_policy
-function generates an IPsec policy specification structure,
-.Li struct sadb_x_policy
-and/or
-.Li struct sadb_x_ipsecrequest
-from a human-readable policy specification.
-The policy specification must be given as a C string,
-passed in the
-.Fa policy
-argument and the length of the string, given as
-.Fa len .
-The
-.Fn ipsec_set_policy
-function returns pointer to a buffer which contains a properly formed
-IPsec policy specification structure.
-The buffer is dynamically allocated, and must be freed by using the
-.Xr free 3
-library function.
-.Pp
-The
-.Fn ipsec_get_policylen
-function will returns the of the buffer which is needed when passing
-the specification structure to the
-.Xr setsockopt 2
-system call.
-.Pp
-The
-.Fn ipsec_dump_policy
-function converts an IPsec policy structure into a human readable form.
-The
-.Fa buf
-argument points to an IPsec policy structure,
-.Li struct sadb_x_policy .
-.Fa delim
-is a delimiter string, which is usually a blank character.
-If you set
-.Fa delim
-to
-.Dv NULL ,
-a single white space is assumed.
-The
-.Fn ipsec_dump_policy
-function returns a pointer to dynamically allocated string.
-It is the caller's responsibility to free the returned pointer using the
-.Xr free 3
-library call.
-.Pp
-A
-.Fa policy
-is given in the following way:
-.Bl -tag -width "discard"
-.It Ar direction Li discard
-The
-.Ar direction
-must be
-.Li in
-or
-.Li out
-and
-specifies which direction the policy needs to be applied, either on
-inbound or outbound packets.
-When the
-.Li discard
-policy is selected, packets will be dropped if they match the policy.
-.It Ar direction Li entrust
-.Li entrust
-means to consult the security policy database
-(SPD)
-in the kernel, as controlled by
-.Xr setkey 8 .
-.It Ar direction Li bypass
-A direction of
-.Li bypass
-indicates that IPsec processing should not occur and that the
-packet will be transmitted in clear.
-The bypass option is only
-available to privileged sockets.
-.It Xo
-.Ar direction
-.Li ipsec
-.Ar request ...
-.Xc
-A direction of
-.Li ipsec
-means that matching packets are processed by IPsec.
-.Li ipsec
-can be followed by one or more
-.Ar request
-string, which is formatted as:
-.Bl -tag -width "discard"
-.It Xo
-.Ar protocol
-.Li /
-.Ar mode
-.Li /
-.Ar src
-.Li -
-.Ar dst
-.Op Ar /level
-.Xc
-The
-.Ar protocol
-is one of:
-.Li ah ,
-.Li esp
-or
-.Li ipcomp
-indicating Authentication Header, Encapsulating Security Protocol or
-IP Compression protocol is used.
-.Pp
-The
-.Ar mode
-is either
-.Li transport
-or
-.Li tunnel
-the meanings of both modes are described in
-.Xr ipsec 4 .
-.Pp
-The
-.Ar src
-and
-.Ar dst
-specify the IP address, either v4 or v6, of the source and destination systems.
-The
-.Ar src
-always stands for the
-.Dq sending node
-and
-.Ar dst
-always stands for the
-.Dq receiving node .
-When
-.Ar direction
-is
-.Li in ,
-.Ar dst
-is this local node
-and
-.Ar src
-is the remote node or peer.
-If
-.Ar mode
-is
-.Li transport ,
-both
-.Ar src
-and
-.Ar dst
-can be omitted.
-.Pp
-The
-.Ar level
-must be set to one of the following:
-.Li default , use , require
-or
-.Li unique .
-.Li default
-means that the kernel should consult the default security policies as
-defined by a set of
-.Xr sysctl 8 ,
-variables.
-The relevant
-.Xr sysctl 8
-variables are described in
-.Xr ipsec 4 .
-.Pp
-When
-.Li use
-is selected a relevant security association
-(SA)
-can be used when available but is not necessary.
-If the SA is available then packets will be handled by IPsec,
-i.e., encrypted and/or authenticated but if an SA is not available then
-packets will be transmitted in the clear.
-The
-.Li use
-option is not recommended because it allows for accidental
-mis-configurations where encrypted or authenticated link becomes
-unencrypted or unauthenticated, the
-.Li require
-keyword is recommended instead of
-.Li use
-where possible.
-Using the
-.Li require
-keyword means that a relevant SA is required,
-and that the kernel must perform IPsec processing on all matching
-packets.
-.Pp
-The
-.Li unique
-keyword has the same effect as
-.Li require ,
-but adds the restriction that the SA for outbound traffic is used
-only for this policy.
-You may need the identifier in order to relate the policy and the SA
-when you define the SA by manual keying using
-.Xr setkey 8 .
-Put the decimal number as the identifier after the
-.Li unique
-keyword in this way:
-.Li unique : number ,
-where
-.Li number
-must be between 1 and 32767.
-.Pp
-If the
-.Ar request
-string is kept unambiguous,
-.Ar level
-and the slash prior to
-.Ar level
-can be omitted but you are encouraged to specify them explicitly
-to avoid unintended behaviors.
-If
-.Ar level
-is omitted, it will be interpreted as
-.Li default .
-.El
-.El
-.Pp
-Note that there is a difference between the specification allowed here
-and in
-.Xr setkey 8 .
-When specifying security policies with
-.Xr setkey 8 ,
-neither entrust nor bypass are used.
-Refer to
-.Xr setkey 8
-for details.
-.Sh RETURN VALUES
-The
-.Fn ipsec_set_policy
-function returns a pointer to the allocated buffer containing a the
-policy specification if successful; otherwise a NULL pointer is
-returned.
-.Pp
-The
-.Fn ipsec_get_policylen
-function returns a positive value,
-indicating the buffer size,
-on success, and a negative value on error.
-.Pp
-The
-.Fn ipsec_dump_policy
-function returns a pointer to a dynamically allocated region
-containing a human readable security policy on success, and
-.Dv NULL
-on error.
-.Sh EXAMPLES
-Set a policy that all inbound packets are discarded.
-.Pp
-.Dl "in discard"
-.Pp
-.\"
-All outbound packets are required to be processed by IPsec and
-transported using ESP.
-.Pp
-.Dl "out ipsec esp/transport//require"
-.Pp
-.\"
-All inbound packets are required to be authenticated using the AH protocol.
-.Pp
-.Dl "in ipsec ah/transport//require"
-.Pp
-.\"
-Tunnel packets outbound through the endpoints at 10.1.1.2 and 10.1.1.1.
-.Pp
-.Dl "out ipsec esp/tunnel/10.1.1.2-10.1.1.1/require"
-.Sh SEE ALSO
-.Xr ipsec_strerror 3 ,
-.Xr ipsec 4 ,
-.Xr setkey 8
-.Sh HISTORY
-These functions first appeared in WIDE/KAME IPv6 protocol stack kit.
-.Pp
-IPv6 and IPsec support based on the KAME Project (http://www.kame.net/) stack
-was initially integrated into
-.Fx 4.0 .
diff --git a/freebsd-userspace/lib/libipsec/ipsec_strerror.3 b/freebsd-userspace/lib/libipsec/ipsec_strerror.3
deleted file mode 100644
index 73fe68dc..00000000
--- a/freebsd-userspace/lib/libipsec/ipsec_strerror.3
+++ /dev/null
@@ -1,90 +0,0 @@
-.\" $KAME: ipsec_strerror.3,v 1.9 2001/08/17 07:21:36 itojun Exp $
-.\"
-.\" Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of the project nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $FreeBSD$
-.\"
-.Dd February 14, 2006
-.Dt IPSEC_STRERROR 3
-.Os
-.\"
-.Sh NAME
-.Nm ipsec_strerror
-.Nd error messages for the IPsec policy manipulation library
-.\"
-.Sh SYNOPSIS
-.In netipsec/ipsec.h
-.Ft "const char *"
-.Fn ipsec_strerror
-.\"
-.Sh DESCRIPTION
-.In netipsec/ipsec.h
-declares
-.Pp
-.Dl extern int ipsec_errcode;
-.Pp
-which is used to pass an error code from IPsec policy manipulation library
-to a user program.
-The
-.Fn ipsec_strerror
-function can be used to obtain the error message string for the error code.
-.Pp
-The array pointed to is not to be modified by the program.
-Since
-.Fn ipsec_strerror
-uses
-.Xr strerror 3
-as an underlying function, calling
-.Xr strerror 3
-after
-.Fn ipsec_strerror
-would overwrite the the return value from
-.Fn ipsec_strerror
-and make it invalid.
-.\"
-.Sh RETURN VALUES
-The
-.Fn ipsec_strerror
-function always returns a pointer to C string.
-The C string must not be overwritten by the caller.
-.\"
-.Sh SEE ALSO
-.Xr ipsec_set_policy 3
-.\"
-.Sh HISTORY
-The
-.Fn ipsec_strerror
-function first appeared in WIDE/KAME IPv6 protocol stack kit.
-.\"
-.Sh BUGS
-The
-.Fn ipsec_strerror
-function will return its result which may be overwritten by subsequent calls.
-.Pp
-.Va ipsec_errcode
-is not thread safe.
diff --git a/freebsd-userspace/lib/libipsec/test-policy.c b/freebsd-userspace/lib/libipsec/test-policy.c
deleted file mode 100644
index c1dfc796..00000000
--- a/freebsd-userspace/lib/libipsec/test-policy.c
+++ /dev/null
@@ -1,334 +0,0 @@
-/* $KAME: test-policy.c,v 1.16 2003/08/26 03:24:08 itojun Exp $ */
-
-/*
- * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-#include <net/pfkeyv2.h>
-#include <netipsec/key_debug.h>
-#include <netipsec/ipsec.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <err.h>
-
-#include "libpfkey.h"
-
-struct req_t {
- int result; /* expected result; 0:ok 1:ng */
- char *str;
-} reqs[] = {
-{ 0, "out ipsec" },
-{ 1, "must_error" },
-{ 1, "in ipsec must_error" },
-{ 1, "out ipsec esp/must_error" },
-{ 1, "out discard" },
-{ 1, "out none" },
-{ 0, "in entrust" },
-{ 0, "out entrust" },
-{ 1, "out ipsec esp" },
-{ 0, "in ipsec ah/transport" },
-{ 1, "in ipsec ah/tunnel" },
-{ 0, "out ipsec ah/transport/" },
-{ 1, "out ipsec ah/tunnel/" },
-{ 0, "in ipsec esp / transport / 10.0.0.1-10.0.0.2" },
-{ 0, "in ipsec esp/tunnel/::1-::2" },
-{ 1, "in ipsec esp/tunnel/10.0.0.1-::2" },
-{ 0, "in ipsec esp/tunnel/::1-::2/require" },
-{ 0, "out ipsec ah/transport//use" },
-{ 1, "out ipsec ah/transport esp/use" },
-{ 1, "in ipsec ah/transport esp/tunnel" },
-{ 0, "in ipsec ah/transport esp/tunnel/::1-::1" },
-{ 0, "in ipsec
- ah / transport
- esp / tunnel / ::1-::2" },
-{ 0, "out ipsec
- ah/transport/::1-::2 esp/tunnel/::3-::4/use ah/transport/::5-::6/require
- ah/transport/::1-::2 esp/tunnel/::3-::4/use ah/transport/::5-::6/require
- ah/transport/::1-::2 esp/tunnel/::3-::4/use ah/transport/::5-::6/require
- " },
-{ 0, "out ipsec esp/transport/fec0::10-fec0::11/use" },
-};
-
-int test1(void);
-int test1sub1(struct req_t *);
-int test1sub2(char *, int);
-int test2(void);
-int test2sub(int);
-
-int
-main(ac, av)
- int ac;
- char **av;
-{
- test1();
- test2();
-
- exit(0);
-}
-
-int
-test1()
-{
- int i;
- int result;
-
- printf("TEST1\n");
- for (i = 0; i < sizeof(reqs)/sizeof(reqs[0]); i++) {
- printf("#%d [%s]\n", i + 1, reqs[i].str);
-
- result = test1sub1(&reqs[i]);
- if (result == 0 && reqs[i].result == 1) {
- warnx("ERROR: expecting failure.");
- } else if (result == 1 && reqs[i].result == 0) {
- warnx("ERROR: expecting success.");
- }
- }
-
- return 0;
-}
-
-int
-test1sub1(req)
- struct req_t *req;
-{
- char *buf;
-
- buf = ipsec_set_policy(req->str, strlen(req->str));
- if (buf == NULL) {
- printf("ipsec_set_policy: %s\n", ipsec_strerror());
- return 1;
- }
-
- if (test1sub2(buf, PF_INET) != 0
- || test1sub2(buf, PF_INET6) != 0) {
- free(buf);
- return 1;
- }
-#if 0
- kdebug_sadb_x_policy((struct sadb_ext *)buf);
-#endif
-
- free(buf);
- return 0;
-}
-
-int
-test1sub2(policy, family)
- char *policy;
- int family;
-{
- int so;
- int proto = 0, optname = 0;
- int len;
- char getbuf[1024];
-
- switch (family) {
- case PF_INET:
- proto = IPPROTO_IP;
- optname = IP_IPSEC_POLICY;
- break;
- case PF_INET6:
- proto = IPPROTO_IPV6;
- optname = IPV6_IPSEC_POLICY;
- break;
- }
-
- if ((so = socket(family, SOCK_DGRAM, 0)) < 0)
- err(1, "socket");
-
- len = ipsec_get_policylen(policy);
-#if 0
- printf("\tsetlen:%d\n", len);
-#endif
-
- if (setsockopt(so, proto, optname, policy, len) < 0) {
- printf("fail to set sockopt; %s\n", strerror(errno));
- close(so);
- return 1;
- }
-
- memset(getbuf, 0, sizeof(getbuf));
- memcpy(getbuf, policy, sizeof(struct sadb_x_policy));
- if (getsockopt(so, proto, optname, getbuf, &len) < 0) {
- printf("fail to get sockopt; %s\n", strerror(errno));
- close(so);
- return 1;
- }
-
- {
- char *buf = NULL;
-
-#if 0
- printf("\tgetlen:%d\n", len);
-#endif
-
- if ((buf = ipsec_dump_policy(getbuf, NULL)) == NULL) {
- printf("%s\n", ipsec_strerror());
- close(so);
- return 1;
- }
-#if 0
- printf("\t[%s]\n", buf);
-#endif
- free(buf);
- }
-
- close (so);
- return 0;
-}
-
-char addr[] = {
- 28, 28, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0,
-};
-
-int
-test2()
-{
- int so;
- char *pol1 = "out ipsec";
- char *pol2 = "out ipsec ah/transport//use";
- char *sp1, *sp2;
- int splen1, splen2;
- int spid;
- struct sadb_msg *m;
-
- printf("TEST2\n");
- if (getuid() != 0)
- errx(1, "root privilege required.");
-
- sp1 = ipsec_set_policy(pol1, strlen(pol1));
- splen1 = ipsec_get_policylen(sp1);
- sp2 = ipsec_set_policy(pol2, strlen(pol2));
- splen2 = ipsec_get_policylen(sp2);
-
- if ((so = pfkey_open()) < 0)
- errx(1, "ERROR: %s", ipsec_strerror());
-
- printf("spdflush()\n");
- if (pfkey_send_spdflush(so) < 0)
- errx(1, "ERROR: %s", ipsec_strerror());
- m = pfkey_recv(so);
- free(m);
-
- printf("spdsetidx()\n");
- if (pfkey_send_spdsetidx(so, (struct sockaddr *)addr, 128,
- (struct sockaddr *)addr, 128,
- 255, sp1, splen1, 0) < 0)
- errx(1, "ERROR: %s", ipsec_strerror());
- m = pfkey_recv(so);
- free(m);
-
- printf("spdupdate()\n");
- if (pfkey_send_spdupdate(so, (struct sockaddr *)addr, 128,
- (struct sockaddr *)addr, 128,
- 255, sp2, splen2, 0) < 0)
- errx(1, "ERROR: %s", ipsec_strerror());
- m = pfkey_recv(so);
- free(m);
-
- printf("sleep(4)\n");
- sleep(4);
-
- printf("spddelete()\n");
- if (pfkey_send_spddelete(so, (struct sockaddr *)addr, 128,
- (struct sockaddr *)addr, 128,
- 255, sp1, splen1, 0) < 0)
- errx(1, "ERROR: %s", ipsec_strerror());
- m = pfkey_recv(so);
- free(m);
-
- printf("spdadd()\n");
- if (pfkey_send_spdadd(so, (struct sockaddr *)addr, 128,
- (struct sockaddr *)addr, 128,
- 255, sp2, splen2, 0) < 0)
- errx(1, "ERROR: %s", ipsec_strerror());
- spid = test2sub(so);
-
- printf("spdget(%u)\n", spid);
- if (pfkey_send_spdget(so, spid) < 0)
- errx(1, "ERROR: %s", ipsec_strerror());
- m = pfkey_recv(so);
- free(m);
-
- printf("sleep(4)\n");
- sleep(4);
-
- printf("spddelete2()\n");
- if (pfkey_send_spddelete2(so, spid) < 0)
- errx(1, "ERROR: %s", ipsec_strerror());
- m = pfkey_recv(so);
- free(m);
-
- printf("spdadd() with lifetime's 10(s)\n");
- if (pfkey_send_spdadd2(so, (struct sockaddr *)addr, 128,
- (struct sockaddr *)addr, 128,
- 255, 0, 10, sp2, splen2, 0) < 0)
- errx(1, "ERROR: %s", ipsec_strerror());
- spid = test2sub(so);
-
- /* expecting failure */
- printf("spdupdate()\n");
- if (pfkey_send_spdupdate(so, (struct sockaddr *)addr, 128,
- (struct sockaddr *)addr, 128,
- 255, sp2, splen2, 0) == 0) {
- warnx("ERROR: expecting failure.");
- }
-
- return 0;
-}
-
-int
-test2sub(so)
- int so;
-{
- struct sadb_msg *msg;
- caddr_t mhp[SADB_EXT_MAX + 1];
-
- if ((msg = pfkey_recv(so)) == NULL)
- errx(1, "ERROR: pfkey_recv failure.");
- if (pfkey_align(msg, mhp) < 0)
- errx(1, "ERROR: pfkey_align failure.");
-
- return ((struct sadb_x_policy *)mhp[SADB_X_EXT_POLICY])->sadb_x_policy_id;
-}
-
diff --git a/freebsd-userspace/lib/libkvm/kvm.3 b/freebsd-userspace/lib/libkvm/kvm.3
deleted file mode 100644
index 9dcd772d..00000000
--- a/freebsd-userspace/lib/libkvm/kvm.3
+++ /dev/null
@@ -1,120 +0,0 @@
-.\" Copyright (c) 1992, 1993
-.\" The Regents of the University of California. All rights reserved.
-.\"
-.\" This code is derived from software developed by the Computer Systems
-.\" Engineering group at Lawrence Berkeley Laboratory under DARPA contract
-.\" BG 91-66 and contributed to Berkeley.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" @(#)kvm.3 8.1 (Berkeley) 6/4/93
-.\" $FreeBSD$
-.\"
-.Dd April 25, 2010
-.Dt KVM 3
-.Os
-.Sh NAME
-.Nm kvm
-.Nd kernel memory interface
-.Sh LIBRARY
-.Lb libkvm
-.Sh DESCRIPTION
-The
-.Nm
-library provides a uniform interface for accessing kernel virtual memory
-images, including live systems and crash dumps.
-Access to live systems is via
-.Xr sysctl 3
-for some functions, and
-.Xr mem 4
-and
-.Xr kmem 4
-for other functions,
-while crash dumps can be examined via the core file generated by
-.Xr savecore 8 .
-The interface behaves similarly in both cases.
-Memory can be read and written, kernel symbol addresses can be
-looked up efficiently, and information about user processes can
-be gathered.
-.Pp
-The
-.Fn kvm_open
-function is first called to obtain a descriptor for all subsequent calls.
-.Sh COMPATIBILITY
-The kvm interface was first introduced in SunOS.
-A considerable
-number of programs have been developed that use this interface,
-making backward compatibility highly desirable.
-In most respects, the Sun kvm interface is consistent and clean.
-Accordingly, the generic portion of the interface (i.e.,
-.Fn kvm_open ,
-.Fn kvm_close ,
-.Fn kvm_read ,
-.Fn kvm_write ,
-and
-.Fn kvm_nlist )
-has been incorporated into the
-.Bx
-interface.
-Indeed, many kvm
-applications (i.e., debuggers and statistical monitors) use only
-this subset of the interface.
-.Pp
-The process interface was not kept.
-This is not a portability
-issue since any code that manipulates processes is inherently
-machine dependent.
-.Pp
-Finally, the Sun kvm error reporting semantics are poorly defined.
-The library can be configured either to print errors to
-.Dv stderr
-automatically,
-or to print no error messages at all.
-In the latter case, the nature of the error cannot be determined.
-To overcome this, the
-.Bx
-interface includes a
-routine,
-.Xr kvm_geterr 3 ,
-to return (not print out) the error message
-corresponding to the most recent error condition on the
-given descriptor.
-.Sh SEE ALSO
-.Xr kvm_close 3 ,
-.Xr kvm_getargv 3 ,
-.Xr kvm_getenvv 3 ,
-.Xr kvm_geterr 3 ,
-.Xr kvm_getfiles 3 ,
-.Xr kvm_getloadavg 3 ,
-.Xr kvm_getprocs 3 ,
-.Xr kvm_getswapinfo 3 ,
-.Xr kvm_nlist 3 ,
-.Xr kvm_open 3 ,
-.Xr kvm_openfiles 3 ,
-.Xr kvm_read 3 ,
-.Xr kvm_write 3 ,
-.Xr sysctl 3 ,
-.Xr kmem 4 ,
-.Xr mem 4
diff --git a/freebsd-userspace/lib/libkvm/kvm_getcptime.3 b/freebsd-userspace/lib/libkvm/kvm_getcptime.3
deleted file mode 100644
index 2ddc272d..00000000
--- a/freebsd-userspace/lib/libkvm/kvm_getcptime.3
+++ /dev/null
@@ -1,77 +0,0 @@
-.\" Copyright (c) 2008 Yahoo!, Inc.
-.\" All rights reserved.
-.\" Written by: John Baldwin <jhb@FreeBSD.org>
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of the author nor the names of any co-contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $FreeBSD$
-.\"
-.Dd August 19, 2008
-.Dt KVM_GETCPTIME 3
-.Os
-.Sh NAME
-.Nm kvm_getcptime
-.Nd fetch global CPU time statistics
-.Sh LIBRARY
-.Lb libkvm
-.Sh SYNOPSIS
-.In sys/param.h
-.In sys/resource.h
-.In sys/sysctl.h
-.In kvm.h
-.Ft int
-.Fn kvm_getcptime "kvm_t *kd" "long *cp_time"
-.Sh DESCRIPTION
-The
-.Fn kvm_getcptime
-function stores the global CPU time statistics from the kernel
-.Fa kd
-in the array of counters pointed to by
-.Fa cp_time .
-Note that
-.Fa cp_time
-should point to an array of
-.Dv CPUSTATES
-long integers.
-The format of the counters is identical to that output by the
-.Va kern.cp_time
-sysctl.
-.Sh CACHING
-This function caches the nlist values for various kernel variables which it
-reuses in successive calls.
-You may call the function with
-.Fa kd
-set to
-.Dv NULL
-to clear this cache.
-.Sh RETURN VALUES
-The
-.Nm kvm_getcptime
-function returns 0 on success and -1 on failure.
-If an error occurs,
-then an error message may be retrieved via
-.Xr kvm_geterr 3 .
-.Sh SEE ALSO
-.Xr kvm 3
diff --git a/freebsd-userspace/lib/libkvm/kvm_geterr.3 b/freebsd-userspace/lib/libkvm/kvm_geterr.3
deleted file mode 100644
index 3ce5c72a..00000000
--- a/freebsd-userspace/lib/libkvm/kvm_geterr.3
+++ /dev/null
@@ -1,78 +0,0 @@
-.\" Copyright (c) 1992, 1993
-.\" The Regents of the University of California. All rights reserved.
-.\"
-.\" This code is derived from software developed by the Computer Systems
-.\" Engineering group at Lawrence Berkeley Laboratory under DARPA contract
-.\" BG 91-66 and contributed to Berkeley.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" @(#)kvm_geterr.3 8.1 (Berkeley) 6/4/93
-.\" $FreeBSD$
-.\"
-.Dd June 4, 1993
-.Dt KVM_GETERR 3
-.Os
-.Sh NAME
-.Nm kvm_geterr
-.Nd get error message on kvm descriptor
-.Sh LIBRARY
-.Lb libkvm
-.Sh SYNOPSIS
-.In kvm.h
-.Ft char *
-.Fn kvm_geterr "kvm_t *kd"
-.Sh DESCRIPTION
-This function returns a string describing the most recent error condition
-on the descriptor
-.Fa kd .
-The results are undefined if the most recent
-.Xr kvm 3
-library call did not produce an error.
-The string returned is stored in memory owned by
-.Xr kvm 3
-so the message should be copied out and saved elsewhere if necessary.
-.Sh SEE ALSO
-.Xr kvm 3 ,
-.Xr kvm_close 3 ,
-.Xr kvm_getargv 3 ,
-.Xr kvm_getenvv 3 ,
-.Xr kvm_getprocs 3 ,
-.Xr kvm_nlist 3 ,
-.Xr kvm_open 3 ,
-.Xr kvm_openfiles 3 ,
-.Xr kvm_read 3 ,
-.Xr kvm_write 3
-.Sh BUGS
-This routine cannot be used to access error conditions due to a failed
-.Fn kvm_openfiles
-call, since failure is indicated by returning a
-.Dv NULL
-descriptor.
-Therefore, errors on open are output to the special error buffer
-passed to
-.Fn kvm_openfiles .
-This option is not available to
-.Fn kvm_open .
diff --git a/freebsd-userspace/lib/libkvm/kvm_getfiles.3 b/freebsd-userspace/lib/libkvm/kvm_getfiles.3
deleted file mode 100644
index 22bfd92d..00000000
--- a/freebsd-userspace/lib/libkvm/kvm_getfiles.3
+++ /dev/null
@@ -1,87 +0,0 @@
-.\" Copyright (c) 1992, 1993
-.\" The Regents of the University of California. All rights reserved.
-.\"
-.\" This code is derived from software developed by the Computer Systems
-.\" Engineering group at Lawrence Berkeley Laboratory under DARPA contract
-.\" BG 91-66 and contributed to Berkeley.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" @(#)kvm_getfiles.3 8.2 (Berkeley) 4/19/94
-.\" $FreeBSD$
-.\"
-.Dd April 19, 1994
-.Dt KVM_GETFILES 3
-.Os
-.Sh NAME
-.Nm kvm_getfiles
-.Nd survey open files
-.Sh LIBRARY
-.Lb libkvm
-.Sh SYNOPSIS
-.In kvm.h
-.In sys/types.h
-.Fd #define _KERNEL
-.In sys/file.h
-.Fd #undef _KERNEL
-.\" .Fa kvm_t *kd
-.Ft char *
-.Fn kvm_getfiles "kvm_t *kd" "int op" "int arg" "int *cnt"
-.Sh DESCRIPTION
-The
-.Fn kvm_getfiles
-function returns a (sub-)set of the open files in the kernel indicated by
-.Fa kd .
-The
-.Fa op
-and
-.Fa arg
-arguments constitute a predicate which limits the set of files
-returned.
-No predicates are currently defined.
-.Pp
-The number of files found is returned in the reference parameter
-.Fa cnt .
-The files are returned as a contiguous array of file structures,
-preceded by the address of the first file entry in the kernel.
-This memory is owned by kvm and is not guaranteed to be persistent across
-subsequent kvm library calls.
-Data should be copied out if it needs to be
-saved.
-.Sh RETURN VALUES
-The
-.Fn kvm_getfiles
-function will return NULL on failure.
-.Sh SEE ALSO
-.Xr kvm 3 ,
-.Xr kvm_close 3 ,
-.Xr kvm_geterr 3 ,
-.Xr kvm_nlist 3 ,
-.Xr kvm_open 3 ,
-.Xr kvm_openfiles 3 ,
-.Xr kvm_read 3 ,
-.Xr kvm_write 3
-.Sh BUGS
-This routine does not belong in the kvm interface.
diff --git a/freebsd-userspace/lib/libkvm/kvm_getloadavg.3 b/freebsd-userspace/lib/libkvm/kvm_getloadavg.3
deleted file mode 100644
index 6587b1a9..00000000
--- a/freebsd-userspace/lib/libkvm/kvm_getloadavg.3
+++ /dev/null
@@ -1,62 +0,0 @@
-.\" Copyright (c) 1992, 1993
-.\" The Regents of the University of California. All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" @(#)kvm_getloadavg.3 8.1 (Berkeley) 6/4/93
-.\" $FreeBSD$
-.\"
-.Dd June 4, 1993
-.Dt KVM_GETLOADAVG 3
-.Os
-.Sh NAME
-.Nm kvm_getloadavg
-.Nd get load average of the system
-.Sh LIBRARY
-.Lb libkvm
-.Sh SYNOPSIS
-.In kvm.h
-.Ft int
-.Fn kvm_getloadavg "kvm_t *kd" "double loadavg[]" "int nelem"
-.Sh DESCRIPTION
-The
-.Fn kvm_getloadavg
-function returns the number of processes in the system run queue
-of the kernel indicated by
-.Fa kd ,
-averaged over various periods of time.
-Up to
-.Fa nelem
-samples are retrieved and assigned to successive elements of
-.Fa loadavg Ns Bq .
-The system imposes a maximum of 3 samples, representing averages
-over the last 1, 5, and 15 minutes, respectively.
-.Sh DIAGNOSTICS
-If the load average was unobtainable, \-1 is returned; otherwise,
-the number of samples actually retrieved is returned.
-.Sh SEE ALSO
-.Xr uptime 1 ,
-.Xr getloadavg 3 ,
-.Xr kvm 3
diff --git a/freebsd-userspace/lib/libkvm/kvm_getpcpu.3 b/freebsd-userspace/lib/libkvm/kvm_getpcpu.3
deleted file mode 100644
index 40f16ac7..00000000
--- a/freebsd-userspace/lib/libkvm/kvm_getpcpu.3
+++ /dev/null
@@ -1,101 +0,0 @@
-.\" Copyright (c) 2008 Yahoo!, Inc.
-.\" All rights reserved.
-.\" Written by: John Baldwin <jhb@FreeBSD.org>
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of the author nor the names of any co-contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $FreeBSD$
-.\"
-.Dd August 19, 2008
-.Dt KVM_GETPCPU 3
-.Os
-.Sh NAME
-.Nm kvm_getmaxcpu ,
-.Nm kvm_getpcpu
-.Nd access per-CPU data
-.Sh LIBRARY
-.Lb libkvm
-.Sh SYNOPSIS
-.In sys/param.h
-.In sys/pcpu.h
-.In sys/sysctl.h
-.In kvm.h
-.Ft int
-.Fn kvm_getmaxcpu "kvm_t *kd"
-.Ft void *
-.Fn kvm_getpcpu "kvm_t *kd" "int cpu"
-.Sh DESCRIPTION
-The
-.Fn kvm_getmaxcpu
-and
-.Fn kvm_getpcpu
-functions are used to access the per-CPU data of active processors in the
-kernel indicated by
-.Fa kd .
-The
-.Fn kvm_getmaxcpu
-function returns the maximum number of CPUs supported by the kernel.
-The
-.Fn kvm_getpcpu
-function returns a buffer holding the per-CPU data for a single CPU.
-This buffer is described by the
-.Vt "struct pcpu"
-type.
-The caller is responsible for releasing the buffer via a call to
-.Xr free 3
-when it is no longer needed.
-If
-.Fa cpu
-is not active, then
-.Dv NULL
-is returned instead.
-.Sh CACHING
-These functions cache the nlist values for various kernel variables which are
-reused in successive calls.
-You may call either function with
-.Fa kd
-set to
-.Dv NULL
-to clear this cache.
-.Sh RETURN VALUES
-On success, the
-.Fn kvm_getmaxcpu
-function returns the maximum number of CPUs supported by the kernel.
-If an error occurs,
-it returns -1 instead.
-.Pp
-On success, the
-.Fn kvm_getpcpu
-function returns a pointer to an allocated buffer or
-.Dv NULL.
-If an error occurs,
-it returns -1 instead.
-.Pp
-If either function encounters an error,
-then an error message may be retrieved via
-.Xr kvm_geterr 3.
-.Sh SEE ALSO
-.Xr free 3 ,
-.Xr kvm 3
diff --git a/freebsd-userspace/lib/libkvm/kvm_getprocs.3 b/freebsd-userspace/lib/libkvm/kvm_getprocs.3
deleted file mode 100644
index 92e858e3..00000000
--- a/freebsd-userspace/lib/libkvm/kvm_getprocs.3
+++ /dev/null
@@ -1,181 +0,0 @@
-.\" Copyright (c) 1992, 1993
-.\" The Regents of the University of California. All rights reserved.
-.\"
-.\" This code is derived from software developed by the Computer Systems
-.\" Engineering group at Lawrence Berkeley Laboratory under DARPA contract
-.\" BG 91-66 and contributed to Berkeley.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" @(#)kvm_getprocs.3 8.1 (Berkeley) 6/4/93
-.\" $FreeBSD$
-.\"
-.Dd September 27, 2003
-.Dt KVM_GETPROCS 3
-.Os
-.Sh NAME
-.Nm kvm_getprocs ,
-.Nm kvm_getargv ,
-.Nm kvm_getenvv
-.Nd access user process state
-.Sh LIBRARY
-.Lb libkvm
-.Sh SYNOPSIS
-.In kvm.h
-.In sys/param.h
-.In sys/sysctl.h
-.In sys/user.h
-.\" .Fa kvm_t *kd
-.Ft struct kinfo_proc *
-.Fn kvm_getprocs "kvm_t *kd" "int op" "int arg" "int *cnt"
-.Ft char **
-.Fn kvm_getargv "kvm_t *kd" "const struct kinfo_proc *p" "int nchr"
-.Ft char **
-.Fn kvm_getenvv "kvm_t *kd" "const struct kinfo_proc *p" "int nchr"
-.Sh DESCRIPTION
-The
-.Fn kvm_getprocs
-function returns a (sub-)set of active processes in the kernel indicated by
-.Fa kd .
-The
-.Fa op
-and
-.Fa arg
-arguments constitute a predicate which limits the set of processes
-returned.
-The value of
-.Fa op
-describes the filtering predicate as follows:
-.Pp
-.Bl -tag -width 20n -offset indent -compact
-.It Dv KERN_PROC_ALL
-all processes and kernel visible threads
-.It Dv KERN_PROC_PROC
-all processes, without threads
-.It Dv KERN_PROC_PID
-processes with process ID
-.Fa arg
-.It Dv KERN_PROC_PGRP
-processes with process group
-.Fa arg
-.It Dv KERN_PROC_SESSION
-processes with session
-.Fa arg
-.It Dv KERN_PROC_TTY
-processes with TTY
-.Fa arg
-.It Dv KERN_PROC_UID
-processes with effective user ID
-.Fa arg
-.It Dv KERN_PROC_RUID
-processes with real user ID
-.Fa arg
-.It Dv KERN_PROC_INC_THREAD
-modifier to return all kernel visible threads when filtering
-by process ID, process group, TTY, user ID, and real user ID
-.El
-.Pp
-The number of processes found is returned in the reference parameter
-.Fa cnt .
-The processes are returned as a contiguous array of kinfo_proc structures.
-This memory is locally allocated, and subsequent calls to
-.Fn kvm_getprocs
-and
-.Fn kvm_close
-will overwrite this storage.
-.Pp
-The
-.Fn kvm_getargv
-function returns a null-terminated argument vector that corresponds to the
-command line arguments passed to process indicated by
-.Fa p .
-Most likely, these arguments correspond to the values passed to
-.Xr exec 3
-on process creation.
-This information is, however,
-deliberately under control of the process itself.
-Note that the original command name can be found, unaltered,
-in the p_comm field of the process structure returned by
-.Fn kvm_getprocs .
-.Pp
-The
-.Fa nchr
-argument indicates the maximum number of characters, including null bytes,
-to use in building the strings.
-If this amount is exceeded, the string
-causing the overflow is truncated and the partial result is returned.
-This is handy for programs like
-.Xr ps 1
-and
-.Xr w 1
-that print only a one line summary of a command and should not copy
-out large amounts of text only to ignore it.
-If
-.Fa nchr
-is zero, no limit is imposed and all argument strings are returned in
-their entirety.
-.Pp
-The memory allocated to the argv pointers and string storage
-is owned by the kvm library.
-Subsequent
-.Fn kvm_getprocs
-and
-.Xr kvm_close 3
-calls will clobber this storage.
-.Pp
-The
-.Fn kvm_getenvv
-function is similar to
-.Fn kvm_getargv
-but returns the vector of environment strings.
-This data is
-also alterable by the process.
-.Sh RETURN VALUES
-The
-.Fn kvm_getprocs ,
-.Fn kvm_getargv ,
-and
-.Fn kvm_getenvv
-functions return
-.Dv NULL
-on failure.
-.Sh SEE ALSO
-.Xr kvm 3 ,
-.Xr kvm_close 3 ,
-.Xr kvm_geterr 3 ,
-.Xr kvm_nlist 3 ,
-.Xr kvm_open 3 ,
-.Xr kvm_openfiles 3 ,
-.Xr kvm_read 3 ,
-.Xr kvm_write 3
-.Sh BUGS
-These routines do not belong in the kvm interface.
-.Pp
-In order for
-.Xr kvm_getenvv 3
-to function correctly,
-.Xr procfs 5
-must be mounted on
-.Pa /proc .
diff --git a/freebsd-userspace/lib/libkvm/kvm_getswapinfo.3 b/freebsd-userspace/lib/libkvm/kvm_getswapinfo.3
deleted file mode 100644
index edd2068d..00000000
--- a/freebsd-userspace/lib/libkvm/kvm_getswapinfo.3
+++ /dev/null
@@ -1,111 +0,0 @@
-.\" Copyright (C) 1999 Matthew Dillon. All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $FreeBSD$
-.\"
-.Dd January 22, 1999
-.Dt KVM_SWAPINFO 3
-.Os
-.Sh NAME
-.Nm kvm_getswapinfo
-.Nd return swap summary statistics for the system
-.Sh LIBRARY
-.Lb libkvm
-.Sh SYNOPSIS
-.In kvm.h
-.Ft int
-.Fn kvm_getswapinfo "kvm_t *kd" "struct kvm_swap *" "int maxswap" "int flags"
-.Sh DESCRIPTION
-The
-.Fn kvm_getswapinfo
-function fills an array of
-.Vt kvm_swap
-structures with swap summary
-information for each swap device, for up to
-.Fa maxswap
-\- 1 devices.
-The number of devices, up to
-.Fa maxswap
-\- 1, is returned.
-A grand
-total of all swap devices (including any devices that go beyond
-.Fa maxswap
-\- 1) is returned in one additional array entry.
-This
-entry is not counted in the return value.
-Thus, if you specify a
-.Fa maxswap
-value of 1, the function will typically return the
-value 0 and the single
-.Vt kvm_swap
-structure will be filled with
-the grand total over all swap devices.
-The grand total is calculated
-from all available swap devices whether or not you made room
-for them all in the array.
-The grand total is returned.
-.Pp
-The flags argument is currently unused and must be passed as 0.
-.Pp
-If an error occurs, -1 is returned.
-.Pp
-Each swap partition and the grand total is summarized in the
-.Vt kvm_swap
-structure.
-This structure contains the following fields:
-.Pp
-.Bl -item -offset indent -compact
-.It
-.Va char ksw_devname[] ;
-.It
-.Va int ksw_total ;
-.It
-.Va int ksw_used ;
-.It
-.Va int ksw_flags ;
-.El
-.Pp
-Values are in
-.Dv PAGE_SIZE Ns 'd
-chunks (see
-.Xr getpagesize 3 ) .
-.Va ksw_flags
-contains
-a copy of the swap device flags.
-.Sh CACHING
-This function caches the nlist values for various kernel variables which
-it reuses in successive calls.
-You may call the function with
-.Fa kd
-==
-.Dv NULL
-to clear the cache.
-.Sh DIAGNOSTICS
-If the load average was unobtainable, \-1 is returned; otherwise,
-the number of swap devices actually retrieved is returned.
-.Pp
-If the name of the swap device does not fit in the static char buffer
-in the structure, it is truncated.
-The buffer is always zero terminated.
-.Sh SEE ALSO
-.Xr kvm 3
diff --git a/freebsd-userspace/lib/libkvm/kvm_nlist.3 b/freebsd-userspace/lib/libkvm/kvm_nlist.3
deleted file mode 100644
index a151a3b2..00000000
--- a/freebsd-userspace/lib/libkvm/kvm_nlist.3
+++ /dev/null
@@ -1,85 +0,0 @@
-.\" Copyright (c) 1992, 1993
-.\" The Regents of the University of California. All rights reserved.
-.\"
-.\" This code is derived from software developed by the Computer Systems
-.\" Engineering group at Lawrence Berkeley Laboratory under DARPA contract
-.\" BG 91-66 and contributed to Berkeley.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" @(#)kvm_nlist.3 8.1 (Berkeley) 6/4/93
-.\" $FreeBSD$
-.\"
-.Dd June 4, 1993
-.Dt KVM_NLIST 3
-.Os
-.Sh NAME
-.Nm kvm_nlist
-.Nd retrieve symbol table names from a kernel image
-.Sh LIBRARY
-.Lb libkvm
-.Sh SYNOPSIS
-.In kvm.h
-.In nlist.h
-.Ft int
-.Fn kvm_nlist "kvm_t *kd" "struct nlist *nl"
-.Sh DESCRIPTION
-The
-.Fn kvm_nlist
-function retrieves the symbol table entries indicated by the name list argument
-.Fa \&nl .
-This argument points to an array of nlist structures, terminated by
-an entry whose n_name field is
-.Dv NULL
-(see
-.Xr nlist 3 ) .
-Each symbol is looked up using the n_name field, and if found, the
-corresponding n_type and n_value fields are filled in.
-These fields are set
-to 0 if the symbol is not found.
-.Pp
-The
-.Xr kldsym 2
-system call is used to locate the symbol.
-This is a less than perfect
-emulation of the nlist values but has the advantage of being aware of kernel
-modules and is reasonably fast.
-.Sh RETURN VALUES
-The
-.Fn kvm_nlist
-function returns the number of invalid entries found.
-If the kernel symbol table was unreadable, -1 is returned.
-.Sh SEE ALSO
-.Xr kldsym 2 ,
-.Xr kvm 3 ,
-.Xr kvm_close 3 ,
-.Xr kvm_getargv 3 ,
-.Xr kvm_getenvv 3 ,
-.Xr kvm_geterr 3 ,
-.Xr kvm_getprocs 3 ,
-.Xr kvm_open 3 ,
-.Xr kvm_openfiles 3 ,
-.Xr kvm_read 3 ,
-.Xr kvm_write 3
diff --git a/freebsd-userspace/lib/libkvm/kvm_open.3 b/freebsd-userspace/lib/libkvm/kvm_open.3
deleted file mode 100644
index 1b62482d..00000000
--- a/freebsd-userspace/lib/libkvm/kvm_open.3
+++ /dev/null
@@ -1,205 +0,0 @@
-.\" Copyright (c) 1992, 1993
-.\" The Regents of the University of California. All rights reserved.
-.\"
-.\" This code is derived from software developed by the Computer Systems
-.\" Engineering group at Lawrence Berkeley Laboratory under DARPA contract
-.\" BG 91-66 and contributed to Berkeley.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" @(#)kvm_open.3 8.3 (Berkeley) 4/19/94
-.\" $FreeBSD$
-.\"
-.Dd January 29, 2004
-.Dt KVM_OPEN 3
-.Os
-.Sh NAME
-.Nm kvm_open ,
-.Nm kvm_openfiles ,
-.Nm kvm_close
-.Nd initialize kernel virtual memory access
-.Sh LIBRARY
-.Lb libkvm
-.Sh SYNOPSIS
-.In fcntl.h
-.In kvm.h
-.Ft kvm_t *
-.Fn kvm_open "const char *execfile" "const char *corefile" "const char *swapfile" "int flags" "const char *errstr"
-.Ft kvm_t *
-.Fn kvm_openfiles "const char *execfile" "const char *corefile" "const char *swapfile" "int flags" "char *errbuf"
-.Ft int
-.Fn kvm_close "kvm_t *kd"
-.Sh DESCRIPTION
-The functions
-.Fn kvm_open
-and
-.Fn kvm_openfiles
-return a descriptor used to access kernel virtual memory
-via the
-.Xr kvm 3
-library routines.
-Both active kernels and crash dumps are accessible
-through this interface.
-.Pp
-The
-.Fa execfile
-argument is the executable image of the kernel being examined.
-This file must contain a symbol table.
-If this argument is
-.Dv NULL ,
-the currently running system is assumed,
-as determined from
-.Xr getbootfile 3 .
-.Pp
-The
-.Fa corefile
-argument is the kernel memory device file.
-It can be either
-.Pa /dev/mem
-or a crash dump core generated by
-.Xr savecore 8 .
-If
-.Fa corefile
-is
-.Dv NULL ,
-the default indicated by
-.Dv _PATH_MEM
-from
-.In paths.h
-is used.
-It can also be set to a special value
-.Pa /dev/null
-by utilities like
-.Xr ps 1
-that do not directly access kernel memory.
-.Pp
-The
-.Fa swapfile
-argument is currently unused.
-.Pp
-The
-.Fa flags
-argument indicates read/write access as in
-.Xr open 2
-and applies only to the core file.
-Only
-.Dv O_RDONLY ,
-.Dv O_WRONLY ,
-and
-.Dv O_RDWR
-are permitted.
-.Pp
-There are two open routines which differ only with respect to
-the error mechanism.
-One provides backward compatibility with the SunOS kvm library, while the
-other provides an improved error reporting framework.
-.Pp
-The
-.Fn kvm_open
-function is the Sun kvm compatible open call.
-Here, the
-.Fa errstr
-argument indicates how errors should be handled.
-If it is
-.Dv NULL ,
-no errors are reported and the application cannot know the
-specific nature of the failed kvm call.
-If it is not
-.Dv NULL ,
-errors are printed to
-.Dv stderr
-with
-.Fa errstr
-prepended to the message, as in
-.Xr perror 3 .
-Normally, the name of the program is used here.
-The string is assumed to persist at least until the corresponding
-.Fn kvm_close
-call.
-.Pp
-The
-.Fn kvm_openfiles
-function provides
-.Bx
-style error reporting.
-Here, error messages are not printed out by the library.
-Instead, the application obtains the error message
-corresponding to the most recent kvm library call using
-.Fn kvm_geterr
-(see
-.Xr kvm_geterr 3 ) .
-The results are undefined if the most recent kvm call did not produce
-an error.
-Since
-.Fn kvm_geterr
-requires a kvm descriptor, but the open routines return
-.Dv NULL
-on failure,
-.Fn kvm_geterr
-cannot be used to get the error message if open fails.
-Thus,
-.Fn kvm_openfiles
-will place any error message in the
-.Fa errbuf
-argument.
-This buffer should be _POSIX2_LINE_MAX characters large (from
-<limits.h>).
-.Sh RETURN VALUES
-The
-.Fn kvm_open
-and
-.Fn kvm_openfiles
-functions both return a descriptor to be used
-in all subsequent kvm library calls.
-The library is fully re-entrant.
-On failure,
-.Dv NULL
-is returned, in which case
-.Fn kvm_openfiles
-writes the error message into
-.Fa errbuf .
-.Pp
-The
-.Fn kvm_close
-function returns 0 on success and -1 on failure.
-.Sh SEE ALSO
-.Xr open 2 ,
-.Xr kvm 3 ,
-.Xr kvm_getargv 3 ,
-.Xr kvm_getenvv 3 ,
-.Xr kvm_geterr 3 ,
-.Xr kvm_getprocs 3 ,
-.Xr kvm_nlist 3 ,
-.Xr kvm_read 3 ,
-.Xr kvm_write 3 ,
-.Xr kmem 4 ,
-.Xr mem 4
-.Sh BUGS
-There should not be two open calls.
-The ill-defined error semantics
-of the Sun library and the desire to have a backward-compatible library
-for
-.Bx
-left little choice.
diff --git a/freebsd-userspace/lib/libkvm/kvm_read.3 b/freebsd-userspace/lib/libkvm/kvm_read.3
deleted file mode 100644
index a2efd3c2..00000000
--- a/freebsd-userspace/lib/libkvm/kvm_read.3
+++ /dev/null
@@ -1,92 +0,0 @@
-.\" Copyright (c) 1992, 1993
-.\" The Regents of the University of California. All rights reserved.
-.\"
-.\" This code is derived from software developed by the Computer Systems
-.\" Engineering group at Lawrence Berkeley Laboratory under DARPA contract
-.\" BG 91-66 and contributed to Berkeley.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" @(#)kvm_read.3 8.1 (Berkeley) 6/4/93
-.\" $FreeBSD$
-.\"
-.Dd June 4, 1993
-.Dt KVM_READ 3
-.Os
-.Sh NAME
-.Nm kvm_read ,
-.Nm kvm_write
-.Nd read or write kernel virtual memory
-.Sh LIBRARY
-.Lb libkvm
-.Sh SYNOPSIS
-.In kvm.h
-.Ft ssize_t
-.Fn kvm_read "kvm_t *kd" "unsigned long addr" "void *buf" "size_t nbytes"
-.Ft ssize_t
-.Fn kvm_write "kvm_t *kd" "unsigned long addr" "const void *buf" "size_t nbytes"
-.Sh DESCRIPTION
-The
-.Fn kvm_read
-and
-.Fn kvm_write
-functions are used to read and write kernel virtual memory (or a crash
-dump file).
-See
-.Fn kvm_open 3
-or
-.Fn kvm_openfiles 3
-for information regarding opening kernel virtual memory and crash dumps.
-.Pp
-The
-.Fn kvm_read
-function transfers
-.Fa nbytes
-bytes of data from
-the kernel space address
-.Fa addr
-to
-.Fa buf .
-Conversely,
-.Fn kvm_write
-transfers data from
-.Fa buf
-to
-.Fa addr .
-Unlike their SunOS counterparts, these functions cannot be used to
-read or write process address spaces.
-.Sh RETURN VALUES
-Upon success, the number of bytes actually transferred is returned.
-Otherwise, -1 is returned.
-.Sh SEE ALSO
-.Xr kvm 3 ,
-.Xr kvm_close 3 ,
-.Xr kvm_getargv 3 ,
-.Xr kvm_getenvv 3 ,
-.Xr kvm_geterr 3 ,
-.Xr kvm_getprocs 3 ,
-.Xr kvm_nlist 3 ,
-.Xr kvm_open 3 ,
-.Xr kvm_openfiles 3
diff --git a/freebsd-userspace/lib/libmemstat/libmemstat.3 b/freebsd-userspace/lib/libmemstat/libmemstat.3
deleted file mode 100644
index 9a4877b0..00000000
--- a/freebsd-userspace/lib/libmemstat/libmemstat.3
+++ /dev/null
@@ -1,496 +0,0 @@
-.\" Copyright (c) 2005 Robert N. M. Watson
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $FreeBSD$
-.\"
-.Dd June 27, 2005
-.Dt LIBMEMSTAT 3
-.Os
-.Sh NAME
-.Nm libmemstat
-.Nd "library interface to retrieve kernel memory allocator statistics"
-.Sh LIBRARY
-.Lb libmemstat
-.Sh SYNOPSIS
-.In sys/types.h
-.In memstat.h
-.Ss General Functions
-.Ft "const char *"
-.Fn memstat_strerror "int error"
-.Ss Memory Type List Management Functions
-.Ft "struct memory_type_list *"
-.Fn memstat_mtl_alloc "void"
-.Ft "struct memory_type *"
-.Fn memstat_mtl_first "struct memory_type_list *list"
-.Ft "struct memory_type *"
-.Fn memstat_mtl_next "struct memory_type *mtp"
-.Ft "struct memory_type *"
-.Fo memstat_mtl_find
-.Fa "struct memory_type_list *list" "int allocator" "const char *name"
-.Fc
-.Ft void
-.Fn memstat_mtl_free "struct memory_type_list *list"
-.Ft int
-.Fn memstat_mtl_geterror "struct memory_type_list *list"
-.Ss Allocator Query Functions
-.Ft int
-.Fn memstat_kvm_all "struct memory_type_list *list" "void *kvm_handle"
-.Ft int
-.Fn memstat_kvm_malloc "struct memory_type_list *list" "void *kvm_handle"
-.Ft int
-.Fn memstat_kvm_uma "struct memory_type_list *list" "void *kvm_handle"
-.Ft int
-.Fn memstat_sysctl_all "struct memory_type_list *list" "int flags"
-.Ft int
-.Fn memstat_sysctl_malloc "struct memory_type_list *list" "int flags"
-.Ft int
-.Fn memstat_sysctl_uma "struct memory_type_list *list" "int flags"
-.Ss Memory Type Accessor Methods
-.Ft "const char *"
-.Fn memstat_get_name "const struct memory_type *mtp"
-.Ft int
-.Fn memstat_get_allocator "const struct memory_type *mtp"
-.Ft uint64_t
-.Fn memstat_get_countlimit "const struct memory_type *mtp"
-.Ft uint64_t
-.Fn memstat_get_byteslimit "const struct memory_type *mtp"
-.Ft uint64_t
-.Fn memstat_get_sizemask "const struct memory_type *mtp"
-.Ft uint64_t
-.Fn memstat_get_size "const struct memory_type *mtp"
-.Ft uint64_t
-.Fn memstat_get_memalloced "const struct memory_type *mtp"
-.Ft uint64_t
-.Fn memstat_get_memfreed "const struct memory_type *mtp"
-.Ft uint64_t
-.Fn memstat_get_numallocs "const struct memory_type *mtp"
-.Ft uint64_t
-.Fn memstat_get_numfrees "const struct memory_type *mtp"
-.Ft uint64_t
-.Fn memstat_get_bytes "const struct memory_type *mtp"
-.Ft uint64_t
-.Fn memstat_get_count "const struct memory_type *mtp"
-.Ft uint64_t
-.Fn memstat_get_free "const struct memory_type *mtp"
-.Ft uint64_t
-.Fn memstat_get_failures "const struct memory_type *mtp"
-.Ft "void *"
-.Fn memstat_get_caller_pointer "const struct memory_type *mtp" "int index"
-.Ft void
-.Fo memstat_set_caller_pointer
-.Fa "struct memory_type *mtp" "int index" "void *value"
-.Fc
-.Ft uint64_t
-.Fn memstat_get_caller_uint64 "const struct memory_type *mtp" "int index"
-.Ft void
-.Fo memstat_set_caller_uint64
-.Fa "struct memory_type *mtp" "int index" "uint64_t value"
-.Fc
-.Ft uint64_t
-.Fn memstat_get_zonefree "const struct memory_type *mtp"
-.Ft uint64_t
-.Fn memstat_get_kegfree "const struct memory_type *mtp"
-.Ft uint64_t
-.Fn memstat_get_percpu_memalloced "const struct memory_type *mtp" "int cpu"
-.Ft uint64_t
-.Fn memstat_get_percpu_memfreed "const struct memory_type *mtp" "int cpu"
-.Ft uint64_t
-.Fn memstat_get_percpu_numallocs "const struct memory_type *mtp" "int cpu"
-.Ft uint64_t
-.Fn memstat_get_percpu_numfrees "const struct memory_type *mtp" "int cpu"
-.Ft uint64_t
-.Fn memstat_get_percpu_sizemask "const struct memory_type *mtp" "int cpu"
-.Ft "void *"
-.Fo memstat_get_percpu_caller_pointer
-.Fa "const struct memory_type *mtp" "int cpu" "int index"
-.Fc
-.Ft void
-.Fo memstat_set_percpu_caller_pointer
-.Fa "struct memory_type *mtp" "int cpu" "int index" "void *value"
-.Fc
-.Ft uint64_t
-.Fo memstat_get_percpu_caller_uint64
-.Fa "const struct memory_type *mtp" "int cpu" "int index"
-.Fc
-.Ft void
-.Fo memstat_set_percpu_caller_uint64
-.Fa "struct memory_type *mtp" "int cpu" "int index" "uint64_t value"
-.Fc
-.Ft uint64_t
-.Fn memstat_get_percpu_free "const struct memory_type *mtp" "int cpu"
-.Sh DESCRIPTION
-.Nm
-provides an interface to retrieve kernel memory allocator statistics, for
-the purposes of debugging and system monitoring, insulating applications
-from implementation details of the allocators, and allowing a tool to
-transparently support multiple allocators.
-.Nm
-supports both retrieving a single statistics snapshot, as well as
-incrementally updating statistics for long-term monitoring.
-.Pp
-.Nm
-describes each memory type using a
-.Vt "struct memory_type" ,
-an opaque memory type accessed by the application using accessor functions
-in the library.
-.Nm
-returns and updates chains of
-.Vt "struct memory_type"
-via a
-.Vt "struct memory_type_list" ,
-which will be allocated by calling
-.Fn memstat_mtl_alloc ,
-and freed on completion using
-.Fn memstat_mtl_free .
-Lists of memory types are populated via calls that query the kernel for
-statistics information; currently:
-.Fn memstat_kvm_all ,
-.Fn memstat_kvm_malloc ,
-.Fn memstat_kvm_uma ,
-.Fn memstat_sysctl_all ,
-.Fn memstat_sysctl_uma ,
-and
-.Fn memstat_sysctl_malloc .
-Repeated calls will incrementally update the list of memory types, permitting
-tracking over time without recreating all list state.
-If an error is detected during a query call, error condition information may
-be retrieved using
-.Fn memstat_mtl_geterror ,
-and converted to a user-readable string using
-.Fn memstat_strerror .
-.Pp
-Freeing the list will free all memory type data in the list, and so
-invalidates any outstanding pointers to entries in the list.
-.Vt "struct memory_type"
-entries in the list may be iterated over using
-.Fn memstat_mtl_first
-and
-.Fn memstat_mtl_next ,
-which respectively return the first entry in a list, and the next entry in a
-list.
-.Fn memstat_mtl_find ,
-which will return a pointer to the first entry matching the passed
-parameters.
-.Pp
-A series of accessor methods is provided to access fields of the structure,
-including retrieving statistics and properties, as well as setting of caller
-owned fields.
-Direct application access to the data structure fields is not supported.
-.Ss Library Vt memory_type Ss Fields
-Each
-.Vt "struct memory_type"
-holds a description of the memory type, including its name and the allocator
-it is managed by, as well as current statistics on use.
-Some statistics are directly measured, others are derived from directly
-measured statistics.
-Certain high level statistics are present across all available allocators,
-such as the number of allocation and free operations; other measurements,
-such as the quantity of free items in per-CPU caches, or administrative
-limit on the number of allocations, is available only for specific
-allocators.
-.Ss Caller Vt memory_type Ss Fields
-.Vt "struct memory_type"
-includes fields to allow the application to store data, in the form of
-pointers and 64-bit integers, with memory types.
-For example, the application author might make use of one of the caller
-pointers to reference a more complex data structure tracking long-term
-behavior of the memory type, or a window system object that is used to
-render the state of the memory type.
-General and per-CPU storage is provided with each
-.Vt "struct memory_type"
-in the form of an array of pointers and integers.
-The array entries are accessed via the
-.Fa index
-argument to the get and set accessor methods.
-Possible values of
-.Fa index
-range between
-0
-and
-.Dv MEMSTAT_MAXCALLER .
-.Pp
-Caller-owned fields are initialized to
-0
-or
-.Dv NULL
-when a new
-.Vt "struct memory_type"
-is allocated and attached to a memory type list; these fields retain their
-values across queries that update library-owned fields.
-.Ss Allocator Types
-Currently,
-.Nm
-supports two kernel allocators:
-.Dv ALLOCATOR_UMA
-for
-.Xr uma 9 ,
-and
-.Dv ALLOCATOR_MALLOC
-for
-.Xr malloc 9 .
-These values may be passed to
-.Fn memstat_mtl_find ,
-and will be returned by
-.Fn memstat_get_allocator .
-Two additional constants in the allocator name space are defined:
-.Dv ALLOCATOR_UNKNOWN ,
-which will only be returned as a result of a library error, and
-.Dv ALLOCATOR_ANY ,
-which can be used to specify that returning types matching any allocator is
-permittible from
-.Fn memstat_mtl_find .
-.Ss Access Method List
-The following accessor methods are defined, of which some will be valid for
-a given memory type:
-.Bl -tag -width indent
-.It Fn memstat_get_name
-Return a pointer to the name of the memory type.
-Memory for the name is owned by
-.Nm
-and will be valid through a call to
-.Fn memstat_mtl_free .
-Note that names will be unique with respect to a single allocator, but that
-the same name might be used by different memory types owned by different
-memory allocators.
-.It Fn memstat_get_allocator
-Return an integer identifier for the memory allocator that owns the memory
-type.
-.It Fn memstat_get_countlimit
-If the memory type has an administrative limit on the number of simultaneous
-allocations, return it.
-.It Fn memstat_get_byteslimit
-If the memory type has an administrative limit on the number of bytes of
-memory that may be simultaenously allocated for the memory type, return it.
-.It Fn memstat_get_sizemask
-If the memory type supports variable allocation sizes, return a bitmask of
-sizes allocated for the memory type.
-.It Fn memstat_get_size
-If the memory type supports a fixed allocation size, return that size.
-.It Fn memstat_get_memalloced
-Return the total number of bytes allocated for the memory type over its
-lifetime.
-.It Fn memstat_get_memfreed
-Return the total number of bytes freed for the memory type over its lifetime.
-.It Fn memstat_get_numallocs
-Return the total number of allocations for the memory type over its lifetime.
-.It Fn memstat_get_numfrees
-Return the total number of frees for the memory type over its lifetime.
-.It Fn memstat_get_bytes
-Return the current number of bytes allocated to the memory type.
-.It Fn memstat_get_count
-Return the current number of allocations for the memory type.
-.It Fn memstat_get_free
-If the memory allocator supports a cache, return the number of items in the
-cache.
-.It Fn memstat_get_failures
-If the memory allocator and type permit allocation failures, return the
-number of allocation failures measured.
-.It Fn memstat_get_caller_pointer
-Return a caller-owned pointer for the memory type.
-.It Fn memstat_set_caller_pointer
-Set a caller-owned pointer for the memory type.
-.It Fn memstat_get_caller_uint64
-Return a caller-owned integer for the memory type.
-.It Fn memstat_set_caller_uint64
-Set a caller-owned integer for the memory type.
-.It Fn memstat_get_zonefree
-If the memory allocator supports a multi-level allocation structure, return
-the number of cached items in the zone.
-These items will be in a fully constructed state available for immediate
-use.
-.It Fn memstat_get_kegfree
-If the memory allocator supports a multi-level allocation structure, return
-the number of cached items in the keg.
-These items may be in a partially constructed state, and may require further
-processing before they can be made available for use.
-.It Fn memstat_get_percpu_memalloced
-If the memory allocator supports per-CPU statistics, return the number of
-bytes of memory allocated for the memory type on the CPU over its lifetime.
-.It Fn memstat_get_percpu_memfreed
-If the memory allocator supports per-CPU statistics, return the number of
-bytes of memory freed from the memory type on the CPU over its lifetime.
-.It Fn memstat_get_percpu_numallocs
-If the memory allocator supports per-CPU statistics, return the number of
-allocations for the memory type on the CPU over its lifetime.
-.It Fn memstat_get_percpu_numfrees
-If the memory allocator supports per-CPU statistics, return the number of
-frees for the memory type on the CPU over its lifetime.
-.It Fn memstat_get_percpu_sizemask
-If the memory allocator supports variable size memory allocation and per-CPU
-statistics, return the size bitmask for the memory type on the CPU.
-.It Fn memstat_get_percpu_caller_pointer
-Return a caller-owned per-CPU pointer for the memory type.
-.It Fn memstat_set_percpu_caller_pointer
-Set a caller-owned per-CPU pointer for the memory type.
-.It Fn memstat_get_percpu_caller_uint64
-Return a caller-owned per-CPU integer for the memory type.
-.It Fn memsttat_set_percpu_caller_uint64
-Set a caller-owned per-CPU integer for the memory type.
-.It Fn memstat_get_percpu_free
-If the memory allocator supports a per-CPU cache, return the number of free
-items in the per-CPU cache of the designated CPU.
-.El
-.Sh RETURN VALUES
-.Nm
-functions fall into three categories: functions returning a pointer to an
-object, functions returning an integer return value, and functions
-implementing accessor methods returning data from a
-.Vt "struct memory_type" .
-.Pp
-Functions returning a pointer to an object will generally return
-.Dv NULL
-on failure.
-.Fn memstat_mtl_alloc
-will return an error value via
-.Va errno ,
-which will consist of the value
-.Er ENOMEM .
-Functions
-.Fn memstat_mtl_first ,
-.Fn memstat_mtl_next ,
-and
-.Fn memstat_mtl_find
-will return
-.Dv NULL
-when there is no entry or match in the list; however, this is not considered
-a failure mode and no error value is available.
-.Pp
-Functions returning an integer success value will return
-0
-on success, or
-\-1
-on failure.
-If a failure is returned, the list error access method,
-.Fn memstat_mtl_geterror ,
-may be used to retrieve the error state.
-The string representation of the error may be retrieved using
-.Fn memstat_strerror .
-Possible error values are:
-.Bl -tag -width ".Dv MEMSTAT_ERROR_KVM_SHORTREAD"
-.It Dv MEMSTAT_ERROR_UNDEFINED
-Undefined error.
-Occurs if
-.Fn memstat_mtl_geterror
-is called on a list before an error associated with the list has occurred.
-.It Dv MEMSTAT_ERROR_NOMEMORY
-Insufficient memory.
-Occurs if library calls to
-.Xr malloc 3
-fail, or if a system call to retrieve kernel statistics fails with
-.Er ENOMEM .
-.It Dv MEMSTAT_ERROR_VERSION
-Returned if the current version of
-.Nm
-is unable to interpret the statistics data returned by the kernel due to an
-explicit version mismatch, or to differences in data structures that cannot
-be reconciled.
-.It Dv MEMSTAT_ERROR_PERMISSION
-Returned if a statistics source returns
-.Va errno
-values of
-.Er EACCES
-or
-.Er EPERM .
-.It Dv MEMSTAT_ERROR_TOOMANYCPUS
-Returned if the compile-time limit on the number of CPUs in
-.Nm
-is lower than the number of CPUs returned by a statistics data source.
-.It Dv MEMSTAT_ERROR_DATAERROR
-Returned if
-.Nm
-is unable to interpret statistics data returned by the data source, even
-though there does not appear to be a version problem.
-.It Dv MEMSTAT_ERROR_KVM
-Returned if
-.Nm
-experiences an error while using
-.Xr kvm 3
-interfaces to query statistics data.
-Use
-.Xr kvm_geterr 3
-to retrieve the error.
-.It Dv MEMSTAT_ERROR_KVM_NOSYMBOL
-Returned if
-.Nm
-is unable to read a required symbol from the kernel being operated on.
-.It Dv MEMSTAT_ERROR_KVM_SHORTREAD
-Returned if
-.Nm
-attempts to read data from a live memory image or kernel core dump and
-insufficient data is returned.
-.El
-.Pp
-Finally, functions returning data from a
-.Vt "struct memory_type"
-pointer are not permitted to fail, and directly return either a statistic
-or pointer to a string.
-.Sh EXAMPLES
-Create a memory type list, query the
-.Xr uma 9
-memory allocator for available statistics, and print out the number of
-allocations performed by the
-.Dv mbuf
-zone.
-.Bd -literal -offset indent
-struct memory_type_list *mtlp;
-struct memory_type *mtp;
-uint64_t mbuf_count;
-
-mtlp = memstat_mtl_alloc();
-if (mtlp == NULL)
- err(-1, "memstat_mtl_alloc");
-if (memstat_sysctl_uma(mtlp, 0) < 0)
- err(-1, "memstat_sysctl_uma");
-mtp = memstat_mtl_find(mtlp, ALLOCATOR_UMA, "mbuf");
-if (mtp == NULL)
- errx(-1, "memstat_mtl_find: mbuf not found");
-mbuf_count = memstat_get_count(mtp);
-memstat_mtl_free(mtlp);
-
-printf("mbufs: %llu\en", (unsigned long long)mbuf_count);
-.Ed
-.Sh SEE ALSO
-.Xr malloc 9 ,
-.Xr uma 9
-.Sh HISTORY
-The
-.Nm
-library appeared in
-.Fx 6.0 .
-.Sh AUTHORS
-The kernel memory allocator changes necessary to support a general purpose
-monitoring library, along with the library, were written by
-.An Robert Watson Aq rwatson@FreeBSD.org .
-.Sh BUGS
-There are memory allocators in the kernel, such as the VM page allocator
-and
-.Nm sf_buf
-allocator, which are not currently supported by
-.Nm .
-.Pp
-Once a memory type is present on a memory type list, it will not be removed
-even if the kernel no longer presents information on the type via its
-monitoring interfaces.
-In order to flush removed memory types, it is necessary to free the entire
-list and allocate a new one.
diff --git a/freebsd-userspace/lib/libutil/expand_number.3 b/freebsd-userspace/lib/libutil/expand_number.3
deleted file mode 100644
index 23e488d3..00000000
--- a/freebsd-userspace/lib/libutil/expand_number.3
+++ /dev/null
@@ -1,86 +0,0 @@
-.\" Copyright (c) 2007 Eric Anderson <anderson@FreeBSD.org>
-.\" Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $FreeBSD$
-.\"
-.Dd April 16, 2007
-.Dt EXPAND_NUMBER 3
-.Os
-.Sh NAME
-.Nm expand_number
-.Nd format a number from human readable form
-.Sh LIBRARY
-.Lb libutil
-.Sh SYNOPSIS
-.In libutil.h
-.Ft int
-.Fo expand_number
-.Fa "const char *buf" "int64_t *num"
-.Fc
-.Sh DESCRIPTION
-The
-.Fn expand_number
-function unformats the
-.Fa buf
-string and stores a signed 64-bit quantity at address pointed out by the
-.Fa num
-argument.
-.Pp
-The
-.Fn expand_number
-function
-follows the SI power of two convention.
-.Pp
-The prefixes are:
-.Bl -column "Prefix" "Description" "1000000000000000000" -offset indent
-.It Sy "Prefix" Ta Sy "Description" Ta Sy "Multiplier"
-.It Li k Ta No kilo Ta 1024
-.It Li M Ta No mega Ta 1048576
-.It Li G Ta No giga Ta 1073741824
-.It Li T Ta No tera Ta 1099511627776
-.It Li P Ta No peta Ta 1125899906842624
-.It Li E Ta No exa Ta 1152921504606846976
-.El
-.Sh RETURN VALUES
-.Rv -std
-.Sh ERRORS
-The
-.Fn expand_number
-function will fail if:
-.Bl -tag -width Er
-.It Bq Er EINVAL
-The given string contains no digits.
-.It Bq Er EINVAL
-An unrecognized prefix was given.
-.It Bq Er ERANGE
-Result doesn't fit into 64 bits.
-.El
-.Sh SEE ALSO
-.Xr humanize_number 3
-.Sh HISTORY
-The
-.Fn expand_number
-function first appeared in
-.Fx 6.3 .
diff --git a/freebsd-userspace/lib/libutil/humanize_number.3 b/freebsd-userspace/lib/libutil/humanize_number.3
deleted file mode 100644
index 76d5677c..00000000
--- a/freebsd-userspace/lib/libutil/humanize_number.3
+++ /dev/null
@@ -1,157 +0,0 @@
-.\" $NetBSD: humanize_number.3,v 1.4 2003/04/16 13:34:37 wiz Exp $
-.\" $FreeBSD$
-.\"
-.\" Copyright (c) 1999, 2002 The NetBSD Foundation, Inc.
-.\" All rights reserved.
-.\"
-.\" This code is derived from software contributed to The NetBSD Foundation
-.\" by Luke Mewburn and by Tomas Svensson.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by the NetBSD
-.\" Foundation, Inc. and its contributors.
-.\" 4. Neither the name of The NetBSD Foundation nor the names of its
-.\" contributors may be used to endorse or promote products derived
-.\" from this software without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
-.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
-.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-.\" POSSIBILITY OF SUCH DAMAGE.
-.\"
-.Dd May 25, 2004
-.Dt HUMANIZE_NUMBER 3
-.Os
-.Sh NAME
-.Nm humanize_number
-.Nd format a number into a human readable form
-.Sh LIBRARY
-.Lb libutil
-.Sh SYNOPSIS
-.In libutil.h
-.Ft int
-.Fo humanize_number
-.Fa "char *buf" "size_t len" "int64_t number" "const char *suffix"
-.Fa "int scale" "int flags"
-.Fc
-.Sh DESCRIPTION
-The
-.Fn humanize_number
-function formats the signed 64-bit quantity given in
-.Fa number
-into
-.Fa buffer .
-A space and then
-.Fa suffix
-is appended to the end.
-The buffer pointed to by
-.Fa buffer
-must be at least
-.Fa len
-bytes long.
-.Pp
-If the formatted number (including
-.Fa suffix )
-would be too long to fit into
-.Fa buffer ,
-then divide
-.Fa number
-by 1024 until it will.
-In this case, prefix
-.Fa suffix
-with the appropriate SI designator.
-The
-.Fn humanize_number
-function
-follows the traditional computer science conventions rather than the proposed
-SI power of two convention.
-.Pp
-The prefixes are:
-.Bl -column "Prefix" "Description" "1000000000000000000" -offset indent
-.It Sy "Prefix" Ta Sy "Description" Ta Sy "Multiplier" Ta Sy "Multiplier 1000x"
-.It Li k Ta No kilo Ta 1024 Ta 1000
-.It Li M Ta No mega Ta 1048576 Ta 1000000
-.It Li G Ta No giga Ta 1073741824 Ta 1000000000
-.It Li T Ta No tera Ta 1099511627776 Ta 1000000000000
-.It Li P Ta No peta Ta 1125899906842624 Ta 1000000000000000
-.It Li E Ta No exa Ta 1152921504606846976 Ta 1000000000000000000
-.El
-.Pp
-The
-.Fa len
-argument must be at least 4 plus the length of
-.Fa suffix ,
-in order to ensure a useful result is generated into
-.Fa buffer .
-To use a specific prefix, specify this as
-.Fa scale
-(multiplier = 1024 ^ scale).
-This cannot be combined with any of the
-.Fa scale
-flags below.
-.Pp
-The following flags may be passed in
-.Fa scale :
-.Bl -tag -width ".Dv HN_DIVISOR_1000" -offset indent
-.It Dv HN_AUTOSCALE
-Format the buffer using the lowest multiplier possible.
-.It Dv HN_GETSCALE
-Return the prefix index number (the number of times
-.Fa number
-must be divided to fit) instead of formatting it to the buffer.
-.El
-.Pp
-The following flags may be passed in
-.Fa flags :
-.Bl -tag -width ".Dv HN_DIVISOR_1000" -offset indent
-.It Dv HN_DECIMAL
-If the final result is less than 10, display it using one digit.
-.It Dv HN_NOSPACE
-Do not put a space between
-.Fa number
-and the prefix.
-.It Dv HN_B
-Use
-.Ql B
-(bytes) as prefix if the original result does not have a prefix.
-.It Dv HN_DIVISOR_1000
-Divide
-.Fa number
-with 1000 instead of 1024.
-.El
-.Sh RETURN VALUES
-The
-.Fn humanize_number
-function returns the number of characters stored in
-.Fa buffer
-(excluding the terminating
-.Dv NUL )
-upon success, or \-1 upon failure.
-If
-.Dv HN_GETSCALE
-is specified, the prefix index number will be returned instead.
-.Sh SEE ALSO
-.Xr expand_number 3
-.Sh HISTORY
-The
-.Fn humanize_number
-function first appeared in
-.Nx 2.0
-and then in
-.Fx 5.3 .
diff --git a/freebsd-userspace/lib/libutil/trimdomain.3 b/freebsd-userspace/lib/libutil/trimdomain.3
deleted file mode 100644
index 8d600c01..00000000
--- a/freebsd-userspace/lib/libutil/trimdomain.3
+++ /dev/null
@@ -1,85 +0,0 @@
-.\" Copyright (c) 1999 Brian Somers <brian@Awfulhak.org>
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $FreeBSD$
-.\"
-.Dd April 7, 1999
-.Dt TRIMDOMAIN 3
-.Os
-.Sh NAME
-.Nm trimdomain
-.Nd "trim the current domain name from a host name"
-.Sh LIBRARY
-.Lb libutil
-.Sh SYNOPSIS
-.In sys/types.h
-.In libutil.h
-.Ft void
-.Fn trimdomain "char *fullhost" "int hostsize"
-.Sh DESCRIPTION
-The function
-.Fn trimdomain
-removes the current domain name from the passed
-.Ar fullhost
-name by writing a
-.Dv NUL
-character over the first period of the passed name.
-The current domain
-name is determined by calling
-.Xr gethostname 3
-and removing everything up to the first period.
-The name is determined
-the first time this function is called and is cached for future use.
-.Pp
-The
-.Fn trimdomain
-function will only trim the domain name if the passed
-.Ar fullname
-ends with the current domain name and if the length of the resulting host
-name does not exceed
-.Ar hostsize .
-.Pp
-If the passed
-.Ar fullname
-is actually a
-.Dv DISPLAY
-specification of the form
-.Sm off
-.Ar host . domain : nn Oo .
-.Ar nn
-.Oc
-.Sm on
-and the domain name is the same as the local domain name,
-.Fn trimdomain
-will remove the embedded domain name, copying the screen and display
-numbers to the end of the base host name and resulting in
-.Sm off
-.Ar host : nn Op . Ar nn .
-.Sm on
-.Sh RETURN VALUES
-The
-.Fn trimdomain
-function does not return a value.
-.Sh SEE ALSO
-.Xr gethostname 3
diff --git a/freebsd-userspace/local/pthread_np.h b/freebsd-userspace/local/pthread_np.h
deleted file mode 100644
index 25bd4727..00000000
--- a/freebsd-userspace/local/pthread_np.h
+++ /dev/null
@@ -1,2 +0,0 @@
-/* empty file */
-extern rtems_id rtems_init_task_id;
diff --git a/freebsd-userspace/rtems/include/freebsd/stdint.h b/freebsd-userspace/rtems/include/freebsd/stdint.h
deleted file mode 100644
index b37bbfe4..00000000
--- a/freebsd-userspace/rtems/include/freebsd/stdint.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <freebsd/sys/stdint.h>
diff --git a/freebsd-userspace/rtems/include/isc/app.h b/freebsd-userspace/rtems/include/isc/app.h
deleted file mode 100644
index 5aa3d23a..00000000
--- a/freebsd-userspace/rtems/include/isc/app.h
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: app.h,v 1.1 2001/07/06 19:50:03 gson Exp $ */
-
-#ifndef ISC_APP_H
-#define ISC_APP_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*
- * ISC Application Support
- *
- * Dealing with program termination can be difficult, especially in a
- * multithreaded program. The routines in this module help coordinate
- * the shutdown process. They are used as follows by the initial (main)
- * thread of the application:
- *
- * isc_app_start(); Call very early in main(), before
- * any other threads have been created.
- *
- * isc_app_run(); This will post any on-run events,
- * and then block until application
- * shutdown is requested. A shutdown
- * request is made by calling
- * isc_app_shutdown(), or by sending
- * SIGINT or SIGTERM to the process.
- * After isc_app_run() returns, the
- * application should shutdown itself.
- *
- * isc_app_finish(); Call very late in main().
- *
- * Applications that want to use SIGHUP/isc_app_reload() to trigger reloading
- * should check the result of isc_app_run() and call the reload routine if
- * the result is ISC_R_RELOAD. They should then call isc_app_run() again
- * to resume waiting for reload or termination.
- *
- * Use of this module is not required. In particular, isc_app_start() is
- * NOT an ISC library initialization routine.
- *
- * MP:
- * Clients must ensure that isc_app_start(), isc_app_run(), and
- * isc_app_finish() are called at most once. isc_app_shutdown()
- * is safe to use by any thread (provided isc_app_start() has been
- * called previously).
- *
- * Reliability:
- * No anticipated impact.
- *
- * Resources:
- * None.
- *
- * Security:
- * No anticipated impact.
- *
- * Standards:
- * None.
- */
-
-#include <isc/eventclass.h>
-#include <isc/lang.h>
-#include <isc/result.h>
-
-typedef isc_event_t isc_appevent_t;
-
-#define ISC_APPEVENT_FIRSTEVENT (ISC_EVENTCLASS_APP + 0)
-#define ISC_APPEVENT_SHUTDOWN (ISC_EVENTCLASS_APP + 1)
-#define ISC_APPEVENT_LASTEVENT (ISC_EVENTCLASS_APP + 65535)
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-isc_app_start(void);
-/*
- * Start an ISC library application.
- *
- * Notes:
- * This call should be made before any other ISC library call, and as
- * close to the beginning of the application as possible.
- */
-
-isc_result_t
-isc_app_onrun(isc_mem_t *mctx, isc_task_t *task, isc_taskaction_t action,
- void *arg);
-/*
- * Request delivery of an event when the application is run.
- *
- * Requires:
- * isc_app_start() has been called.
- *
- * Returns:
- * ISC_R_SUCCESS
- * ISC_R_NOMEMORY
- */
-
-isc_result_t
-isc_app_run(void);
-/*
- * Run an ISC library application.
- *
- * Notes:
- * The caller (typically the initial thread of an application) will
- * block until shutdown is requested. When the call returns, the
- * caller should start shutting down the application.
- *
- * Requires:
- * isc_app_start() has been called.
- *
- * Ensures:
- * Any events requested via isc_app_onrun() will have been posted (in
- * FIFO order) before isc_app_run() blocks.
- *
- * Returns:
- * ISC_R_SUCCESS Shutdown has been requested.
- * ISC_R_RELOAD Reload has been requested.
- */
-
-isc_result_t
-isc_app_shutdown(void);
-/*
- * Request application shutdown.
- *
- * Notes:
- * It is safe to call isc_app_shutdown() multiple times. Shutdown will
- * only be triggered once.
- *
- * Requires:
- * isc_app_run() has been called.
- *
- * Returns:
- * ISC_R_SUCCESS
- * ISC_R_UNEXPECTED
- */
-
-isc_result_t
-isc_app_reload(void);
-/*
- * Request application reload.
- *
- * Requires:
- * isc_app_run() has been called.
- *
- * Returns:
- * ISC_R_SUCCESS
- * ISC_R_UNEXPECTED
- */
-
-void
-isc_app_finish(void);
-/*
- * Finish an ISC library application.
- *
- * Notes:
- * This call should be made at or near the end of main().
- *
- * Requires:
- * isc_app_start() has been called.
- *
- * Ensures:
- * Any resources allocated by isc_app_start() have been released.
- */
-
-void
-isc_app_block(void);
-/*
- * Indicate that a blocking operation will be performed.
- *
- * Notes:
- * If a blocking operation is in process, a call to isc_app_shutdown()
- * or an external signal will abort the program, rather than allowing
- * clean shutdown. This is primarily useful for reading user input.
- *
- * Requires:
- * isc_app_start() has been called.
- * No other blocking operations are in progress.
- */
-
-void
-isc_app_unblock(void);
-/*
- * Indicate that a blocking operation is complete.
- *
- * Notes:
- * When a blocking operation has completed, return the program to a
- * state where a call to isc_app_shutdown() or an external signal will
- * shutdown normally.
- *
- * Requires:
- * isc_app_start() has been called.
- * isc_app_block() has been called by the same thread.
- */
-
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_APP_H */
diff --git a/freebsd-userspace/rtems/include/isc/assertions.h b/freebsd-userspace/rtems/include/isc/assertions.h
deleted file mode 100644
index 45855c66..00000000
--- a/freebsd-userspace/rtems/include/isc/assertions.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (C) 1997-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
- * $Id: assertions.h,v 1.17 2001/07/12 05:58:21 mayer Exp $
- */
-
-#ifndef ISC_ASSERTIONS_H
-#define ISC_ASSERTIONS_H 1
-
-#include <isc/lang.h>
-#include <isc/platform.h>
-
-ISC_LANG_BEGINDECLS
-
-typedef enum {
- isc_assertiontype_require,
- isc_assertiontype_ensure,
- isc_assertiontype_insist,
- isc_assertiontype_invariant
-} isc_assertiontype_t;
-
-typedef void (*isc_assertioncallback_t)(const char *, int, isc_assertiontype_t,
- const char *);
-
-LIBISC_EXTERNAL_DATA extern isc_assertioncallback_t isc_assertion_failed;
-
-void
-isc_assertion_setcallback(isc_assertioncallback_t);
-
-const char *
-isc_assertion_typetotext(isc_assertiontype_t type);
-
-#ifdef ISC_CHECK_ALL
-#define ISC_CHECK_REQUIRE 1
-#define ISC_CHECK_ENSURE 1
-#define ISC_CHECK_INSIST 1
-#define ISC_CHECK_INVARIANT 1
-#endif
-
-#ifdef ISC_CHECK_NONE
-#define ISC_CHECK_REQUIRE 0
-#define ISC_CHECK_ENSURE 0
-#define ISC_CHECK_INSIST 0
-#define ISC_CHECK_INVARIANT 0
-#endif
-
-#ifndef ISC_CHECK_REQUIRE
-#define ISC_CHECK_REQUIRE 1
-#endif
-
-#ifndef ISC_CHECK_ENSURE
-#define ISC_CHECK_ENSURE 1
-#endif
-
-#ifndef ISC_CHECK_INSIST
-#define ISC_CHECK_INSIST 1
-#endif
-
-#ifndef ISC_CHECK_INVARIANT
-#define ISC_CHECK_INVARIANT 1
-#endif
-
-#if ISC_CHECK_REQUIRE != 0
-#define ISC_REQUIRE(cond) \
- ((void) ((cond) || \
- ((isc_assertion_failed)(__FILE__, __LINE__, \
- isc_assertiontype_require, \
- #cond), 0)))
-#else
-#define ISC_REQUIRE(cond) ((void) 0)
-#endif /* ISC_CHECK_REQUIRE */
-
-#if ISC_CHECK_ENSURE != 0
-#define ISC_ENSURE(cond) \
- ((void) ((cond) || \
- ((isc_assertion_failed)(__FILE__, __LINE__, \
- isc_assertiontype_ensure, \
- #cond), 0)))
-#else
-#define ISC_ENSURE(cond) ((void) 0)
-#endif /* ISC_CHECK_ENSURE */
-
-#if ISC_CHECK_INSIST != 0
-#define ISC_INSIST(cond) \
- ((void) ((cond) || \
- ((isc_assertion_failed)(__FILE__, __LINE__, \
- isc_assertiontype_insist, \
- #cond), 0)))
-#else
-#define ISC_INSIST(cond) ((void) 0)
-#endif /* ISC_CHECK_INSIST */
-
-#if ISC_CHECK_INVARIANT != 0
-#define ISC_INVARIANT(cond) \
- ((void) ((cond) || \
- ((isc_assertion_failed)(__FILE__, __LINE__, \
- isc_assertiontype_invariant, \
- #cond), 0)))
-#else
-#define ISC_INVARIANT(cond) ((void) 0)
-#endif /* ISC_CHECK_INVARIANT */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_ASSERTIONS_H */
diff --git a/freebsd-userspace/rtems/include/isc/boolean.h b/freebsd-userspace/rtems/include/isc/boolean.h
deleted file mode 100644
index d10007b5..00000000
--- a/freebsd-userspace/rtems/include/isc/boolean.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: boolean.h,v 1.12 2001/01/09 21:56:45 bwelling Exp $ */
-
-#ifndef ISC_BOOLEAN_H
-#define ISC_BOOLEAN_H 1
-
-typedef enum { isc_boolean_false = 0, isc_boolean_true = 1 } isc_boolean_t;
-
-#define ISC_FALSE isc_boolean_false
-#define ISC_TRUE isc_boolean_true
-#define ISC_TF(x) ((x) ? ISC_TRUE : ISC_FALSE)
-
-#endif /* ISC_BOOLEAN_H */
diff --git a/freebsd-userspace/rtems/include/isc/buffer.h b/freebsd-userspace/rtems/include/isc/buffer.h
deleted file mode 100644
index 47c8f0c9..00000000
--- a/freebsd-userspace/rtems/include/isc/buffer.h
+++ /dev/null
@@ -1,800 +0,0 @@
-/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: buffer.h,v 1.39.12.2 2004/03/08 09:04:51 marka Exp $ */
-
-#ifndef ISC_BUFFER_H
-#define ISC_BUFFER_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*
- * Buffers
- *
- * A buffer is a region of memory, together with a set of related subregions.
- * Buffers are used for parsing and I/O operations.
- *
- * The 'used region' and the 'available' region are disjoint, and their
- * union is the buffer's region. The used region extends from the beginning
- * of the buffer region to the last used byte. The available region
- * extends from one byte greater than the last used byte to the end of the
- * buffer's region. The size of the used region can be changed using various
- * buffer commands. Initially, the used region is empty.
- *
- * The used region is further subdivided into two disjoint regions: the
- * 'consumed region' and the 'remaining region'. The union of these two
- * regions is the used region. The consumed region extends from the beginning
- * of the used region to the byte before the 'current' offset (if any). The
- * 'remaining' region the current pointer to the end of the used
- * region. The size of the consumed region can be changed using various
- * buffer commands. Initially, the consumed region is empty.
- *
- * The 'active region' is an (optional) subregion of the remaining region.
- * It extends from the current offset to an offset in the remaining region
- * that is selected with isc_buffer_setactive(). Initially, the active region
- * is empty. If the current offset advances beyond the chosen offset, the
- * active region will also be empty.
- *
- * /------------entire length---------------\
- * /----- used region -----\/-- available --\
- * +----------------------------------------+
- * | consumed | remaining | |
- * +----------------------------------------+
- * a b c d e
- *
- * a == base of buffer.
- * b == current pointer. Can be anywhere between a and d.
- * c == active pointer. Meaningful between b and d.
- * d == used pointer.
- * e == length of buffer.
- *
- * a-e == entire length of buffer.
- * a-d == used region.
- * a-b == consumed region.
- * b-d == remaining region.
- * b-c == optional active region.
- *
- * The following invariants are maintained by all routines:
- *
- * length > 0
- *
- * base is a valid pointer to length bytes of memory
- *
- * 0 <= used <= length
- *
- * 0 <= current <= used
- *
- * 0 <= active <= used
- * (although active < current implies empty active region)
- *
- * MP:
- * Buffers have no synchronization. Clients must ensure exclusive
- * access.
- *
- * Reliability:
- * No anticipated impact.
- *
- * Resources:
- * Memory: 1 pointer + 6 unsigned integers per buffer.
- *
- * Security:
- * No anticipated impact.
- *
- * Standards:
- * None.
- */
-
-/***
- *** Imports
- ***/
-
-#include <isc/lang.h>
-#include <isc/magic.h>
-#include <isc/types.h>
-
-/*
- * To make many functions be inline macros (via #define) define this.
- * If it is undefined, a function will be used.
- */
-#define ISC_BUFFER_USEINLINE
-
-ISC_LANG_BEGINDECLS
-
-/***
- *** Magic numbers
- ***/
-#define ISC_BUFFER_MAGIC 0x42756621U /* Buf!. */
-#define ISC_BUFFER_VALID(b) ISC_MAGIC_VALID(b, ISC_BUFFER_MAGIC)
-
-/*
- * The following macros MUST be used only on valid buffers. It is the
- * caller's responsibility to ensure this by using the ISC_BUFFER_VALID
- * check above, or by calling another isc_buffer_*() function (rather than
- * another macro.)
- */
-
-/*
- * Fundamental buffer elements. (A through E in the introductory comment.)
- */
-#define isc_buffer_base(b) ((void *)(b)->base) /*a*/
-#define isc_buffer_current(b) \
- ((void *)((unsigned char *)(b)->base + (b)->current)) /*b*/
-#define isc_buffer_active(b) \
- ((void *)((unsigned char *)(b)->base + (b)->active)) /*c*/
-#define isc_buffer_used(b) \
- ((void *)((unsigned char *)(b)->base + (b)->used)) /*d*/
-#define isc_buffer_length(b) ((b)->length) /*e*/
-
-/*
- * Derived lengths. (Described in the introductory comment.)
- */
-#define isc_buffer_usedlength(b) ((b)->used) /* d-a */
-#define isc_buffer_consumedlength(b) ((b)->current) /* b-a */
-#define isc_buffer_remaininglength(b) ((b)->used - (b)->current) /* d-b */
-#define isc_buffer_activelength(b) ((b)->active - (b)->current) /* c-b */
-#define isc_buffer_availablelength(b) ((b)->length - (b)->used) /* e-d */
-
-/*
- * Note that the buffer structure is public. This is principally so buffer
- * operations can be implemented using macros. Applications are strongly
- * discouraged from directly manipulating the structure.
- */
-
-struct isc_buffer {
- unsigned int magic;
- void *base;
- /* The following integers are byte offsets from 'base'. */
- unsigned int length;
- unsigned int used;
- unsigned int current;
- unsigned int active;
- /* linkable */
- ISC_LINK(isc_buffer_t) link;
- /* private internal elements */
- isc_mem_t *mctx;
-};
-
-/***
- *** Functions
- ***/
-
-isc_result_t
-isc_buffer_allocate(isc_mem_t *mctx, isc_buffer_t **dynbuffer,
- unsigned int length);
-/*
- * Allocate a dynamic linkable buffer which has "length" bytes in the
- * data region.
- *
- * Requires:
- * "mctx" is valid.
- *
- * "dynbuffer" is non-NULL, and "*dynbuffer" is NULL.
- *
- * Returns:
- * ISC_R_SUCCESS - success
- * ISC_R_NOMEMORY - no memory available
- *
- * Note:
- * Changing the buffer's length field is not permitted.
- */
-
-void
-isc_buffer_free(isc_buffer_t **dynbuffer);
-/*
- * Release resources allocated for a dynamic buffer.
- *
- * Requires:
- * "dynbuffer" is not NULL.
- *
- * "*dynbuffer" is a valid dynamic buffer.
- *
- * Ensures:
- * "*dynbuffer" will be NULL on return, and all memory associated with
- * the dynamic buffer is returned to the memory context used in
- * isc_buffer_allocate().
- */
-
-void
-isc__buffer_init(isc_buffer_t *b, const void *base, unsigned int length);
-/*
- * Make 'b' refer to the 'length'-byte region starting at base.
- *
- * Requires:
- *
- * 'length' > 0
- *
- * 'base' is a pointer to a sequence of 'length' bytes.
- *
- */
-
-void
-isc__buffer_invalidate(isc_buffer_t *b);
-/*
- * Make 'b' an invalid buffer.
- *
- * Requires:
- * 'b' is a valid buffer.
- *
- * Ensures:
- * If assertion checking is enabled, future attempts to use 'b' without
- * calling isc_buffer_init() on it will cause an assertion failure.
- */
-
-void
-isc__buffer_region(isc_buffer_t *b, isc_region_t *r);
-/*
- * Make 'r' refer to the region of 'b'.
- *
- * Requires:
- *
- * 'b' is a valid buffer.
- *
- * 'r' points to a region structure.
- */
-
-void
-isc__buffer_usedregion(isc_buffer_t *b, isc_region_t *r);
-/*
- * Make 'r' refer to the used region of 'b'.
- *
- * Requires:
- *
- * 'b' is a valid buffer.
- *
- * 'r' points to a region structure.
- */
-
-void
-isc__buffer_availableregion(isc_buffer_t *b, isc_region_t *r);
-/*
- * Make 'r' refer to the available region of 'b'.
- *
- * Requires:
- *
- * 'b' is a valid buffer.
- *
- * 'r' points to a region structure.
- */
-
-void
-isc__buffer_add(isc_buffer_t *b, unsigned int n);
-/*
- * Increase the 'used' region of 'b' by 'n' bytes.
- *
- * Requires:
- *
- * 'b' is a valid buffer
- *
- * used + n <= length
- *
- */
-
-void
-isc__buffer_subtract(isc_buffer_t *b, unsigned int n);
-/*
- * Decrease the 'used' region of 'b' by 'n' bytes.
- *
- * Requires:
- *
- * 'b' is a valid buffer
- *
- * used >= n
- *
- */
-
-void
-isc__buffer_clear(isc_buffer_t *b);
-/*
- * Make the used region empty.
- *
- * Requires:
- *
- * 'b' is a valid buffer
- *
- * Ensures:
- *
- * used = 0
- *
- */
-
-void
-isc__buffer_consumedregion(isc_buffer_t *b, isc_region_t *r);
-/*
- * Make 'r' refer to the consumed region of 'b'.
- *
- * Requires:
- *
- * 'b' is a valid buffer.
- *
- * 'r' points to a region structure.
- */
-
-void
-isc__buffer_remainingregion(isc_buffer_t *b, isc_region_t *r);
-/*
- * Make 'r' refer to the remaining region of 'b'.
- *
- * Requires:
- *
- * 'b' is a valid buffer.
- *
- * 'r' points to a region structure.
- */
-
-void
-isc__buffer_activeregion(isc_buffer_t *b, isc_region_t *r);
-/*
- * Make 'r' refer to the active region of 'b'.
- *
- * Requires:
- *
- * 'b' is a valid buffer.
- *
- * 'r' points to a region structure.
- */
-
-void
-isc__buffer_setactive(isc_buffer_t *b, unsigned int n);
-/*
- * Sets the end of the active region 'n' bytes after current.
- *
- * Requires:
- *
- * 'b' is a valid buffer.
- *
- * current + n <= used
- */
-
-void
-isc__buffer_first(isc_buffer_t *b);
-/*
- * Make the consumed region empty.
- *
- * Requires:
- *
- * 'b' is a valid buffer
- *
- * Ensures:
- *
- * current == 0
- *
- */
-
-void
-isc__buffer_forward(isc_buffer_t *b, unsigned int n);
-/*
- * Increase the 'consumed' region of 'b' by 'n' bytes.
- *
- * Requires:
- *
- * 'b' is a valid buffer
- *
- * current + n <= used
- *
- */
-
-void
-isc__buffer_back(isc_buffer_t *b, unsigned int n);
-/*
- * Decrease the 'consumed' region of 'b' by 'n' bytes.
- *
- * Requires:
- *
- * 'b' is a valid buffer
- *
- * n <= current
- *
- */
-
-void
-isc_buffer_compact(isc_buffer_t *b);
-/*
- * Compact the used region by moving the remaining region so it occurs
- * at the start of the buffer. The used region is shrunk by the size of
- * the consumed region, and the consumed region is then made empty.
- *
- * Requires:
- *
- * 'b' is a valid buffer
- *
- * Ensures:
- *
- * current == 0
- *
- * The size of the used region is now equal to the size of the remaining
- * region (as it was before the call). The contents of the used region
- * are those of the remaining region (as it was before the call).
- */
-
-isc_uint8_t
-isc_buffer_getuint8(isc_buffer_t *b);
-/*
- * Read an unsigned 8-bit integer from 'b' and return it.
- *
- * Requires:
- *
- * 'b' is a valid buffer.
- *
- * The length of the available region of 'b' is at least 1.
- *
- * Ensures:
- *
- * The current pointer in 'b' is advanced by 1.
- *
- * Returns:
- *
- * A 8-bit unsigned integer.
- */
-
-void
-isc__buffer_putuint8(isc_buffer_t *b, isc_uint8_t val);
-/*
- * Store an unsigned 8-bit integer from 'val' into 'b'.
- *
- * Requires:
- * 'b' is a valid buffer.
- *
- * The length of the unused region of 'b' is at least 1.
- *
- * Ensures:
- * The used pointer in 'b' is advanced by 1.
- */
-
-isc_uint16_t
-isc_buffer_getuint16(isc_buffer_t *b);
-/*
- * Read an unsigned 16-bit integer in network byte order from 'b', convert
- * it to host byte order, and return it.
- *
- * Requires:
- *
- * 'b' is a valid buffer.
- *
- * The length of the available region of 'b' is at least 2.
- *
- * Ensures:
- *
- * The current pointer in 'b' is advanced by 2.
- *
- * Returns:
- *
- * A 16-bit unsigned integer.
- */
-
-void
-isc__buffer_putuint16(isc_buffer_t *b, isc_uint16_t val);
-/*
- * Store an unsigned 16-bit integer in host byte order from 'val'
- * into 'b' in network byte order.
- *
- * Requires:
- * 'b' is a valid buffer.
- *
- * The length of the unused region of 'b' is at least 2.
- *
- * Ensures:
- * The used pointer in 'b' is advanced by 2.
- */
-
-isc_uint32_t
-isc_buffer_getuint32(isc_buffer_t *b);
-/*
- * Read an unsigned 32-bit integer in network byte order from 'b', convert
- * it to host byte order, and return it.
- *
- * Requires:
- *
- * 'b' is a valid buffer.
- *
- * The length of the available region of 'b' is at least 4.
- *
- * Ensures:
- *
- * The current pointer in 'b' is advanced by 4.
- *
- * Returns:
- *
- * A 32-bit unsigned integer.
- */
-
-void
-isc__buffer_putuint32(isc_buffer_t *b, isc_uint32_t val);
-/*
- * Store an unsigned 32-bit integer in host byte order from 'val'
- * into 'b' in network byte order.
- *
- * Requires:
- * 'b' is a valid buffer.
- *
- * The length of the unused region of 'b' is at least 4.
- *
- * Ensures:
- * The used pointer in 'b' is advanced by 4.
- */
-
-void
-isc__buffer_putmem(isc_buffer_t *b, const unsigned char *base,
- unsigned int length);
-/*
- * Copy 'length' bytes of memory at 'base' into 'b'.
- *
- * Requires:
- * 'b' is a valid buffer.
- *
- * 'base' points to 'length' bytes of valid memory.
- *
- */
-
-void
-isc__buffer_putstr(isc_buffer_t *b, const char *source);
-/*
- * Copy 'source' into 'b', not including terminating NUL.
- *
- * Requires:
- * 'b' is a valid buffer.
- *
- * 'source' to be a valid NULL terminated string.
- *
- * strlen(source) <= isc_buffer_available(b)
- */
-
-isc_result_t
-isc_buffer_copyregion(isc_buffer_t *b, const isc_region_t *r);
-/*
- * Copy the contents of 'r' into 'b'.
- *
- * Requires:
- * 'b' is a valid buffer.
- *
- * 'r' is a valid region.
- *
- * Returns:
- *
- * ISC_R_SUCCESS
- * ISC_R_NOSPACE The available region of 'b' is not
- * big enough.
- */
-
-ISC_LANG_ENDDECLS
-
-/*
- * Inline macro versions of the functions. These should never be called
- * directly by an application, but will be used by the functions within
- * buffer.c. The callers should always use "isc_buffer_*()" names, never
- * ones beginning with "isc__"
- */
-
-/*
- * XXXDCL Something more could be done with initializing buffers that
- * point to const data. For example, a new function, isc_buffer_initconst,
- * could be used, and a new boolean flag in the buffer structure could
- * indicate whether the buffer was initialized with that function.
- * (isc_bufer_init itself would be reprototyped to *not* have its "base"
- * parameter be const.) Then if the boolean were true, the isc_buffer_put*
- * functions could assert a contractual requirement for a non-const buffer.
- * One drawback is that the isc_buffer_* functions (macros) that return
- * pointers would still need to return non-const pointers to avoid compiler
- * warnings, so it would be up to code that uses them to have to deal
- * with the possibility that the buffer was initialized as const --
- * a problem that they *already* have to deal with but have absolutely
- * no ability to. With a new isc_buffer_isconst() function returning
- * true/false, they could at least assert a contractual requirement for
- * non-const buffers when needed.
- */
-#define ISC__BUFFER_INIT(_b, _base, _length) \
- do { \
- union { \
- const void * konst; \
- void * var; \
- } _u; \
- _u.konst = (_base); \
- (_b)->base = _u.var; \
- (_b)->length = (_length); \
- (_b)->used = 0; \
- (_b)->current = 0; \
- (_b)->active = 0; \
- (_b)->mctx = NULL; \
- ISC_LINK_INIT(_b, link); \
- (_b)->magic = ISC_BUFFER_MAGIC; \
- } while (0)
-
-#define ISC__BUFFER_INVALIDATE(_b) \
- do { \
- (_b)->magic = 0; \
- (_b)->base = NULL; \
- (_b)->length = 0; \
- (_b)->used = 0; \
- (_b)->current = 0; \
- (_b)->active = 0; \
- } while (0)
-
-#define ISC__BUFFER_REGION(_b, _r) \
- do { \
- (_r)->base = (_b)->base; \
- (_r)->length = (_b)->length; \
- } while (0)
-
-#define ISC__BUFFER_USEDREGION(_b, _r) \
- do { \
- (_r)->base = (_b)->base; \
- (_r)->length = (_b)->used; \
- } while (0)
-
-#define ISC__BUFFER_AVAILABLEREGION(_b, _r) \
- do { \
- (_r)->base = isc_buffer_used(_b); \
- (_r)->length = isc_buffer_availablelength(_b); \
- } while (0)
-
-#define ISC__BUFFER_ADD(_b, _n) \
- do { \
- (_b)->used += (_n); \
- } while (0)
-
-#define ISC__BUFFER_SUBTRACT(_b, _n) \
- do { \
- (_b)->used -= (_n); \
- if ((_b)->current > (_b)->used) \
- (_b)->current = (_b)->used; \
- if ((_b)->active > (_b)->used) \
- (_b)->active = (_b)->used; \
- } while (0)
-
-#define ISC__BUFFER_CLEAR(_b) \
- do { \
- (_b)->used = 0; \
- (_b)->current = 0; \
- (_b)->active = 0; \
- } while (0)
-
-#define ISC__BUFFER_CONSUMEDREGION(_b, _r) \
- do { \
- (_r)->base = (_b)->base; \
- (_r)->length = (_b)->current; \
- } while (0)
-
-#define ISC__BUFFER_REMAININGREGION(_b, _r) \
- do { \
- (_r)->base = isc_buffer_current(_b); \
- (_r)->length = isc_buffer_remaininglength(_b); \
- } while (0)
-
-#define ISC__BUFFER_ACTIVEREGION(_b, _r) \
- do { \
- if ((_b)->current < (_b)->active) { \
- (_r)->base = isc_buffer_current(_b); \
- (_r)->length = isc_buffer_activelength(_b); \
- } else { \
- (_r)->base = NULL; \
- (_r)->length = 0; \
- } \
- } while (0)
-
-#define ISC__BUFFER_SETACTIVE(_b, _n) \
- do { \
- (_b)->active = (_b)->current + (_n); \
- } while (0)
-
-#define ISC__BUFFER_FIRST(_b) \
- do { \
- (_b)->current = 0; \
- } while (0)
-
-#define ISC__BUFFER_FORWARD(_b, _n) \
- do { \
- (_b)->current += (_n); \
- } while (0)
-
-#define ISC__BUFFER_BACK(_b, _n) \
- do { \
- (_b)->current -= (_n); \
- } while (0)
-
-#define ISC__BUFFER_PUTMEM(_b, _base, _length) \
- do { \
- memcpy(isc_buffer_used(_b), (_base), (_length)); \
- (_b)->used += (_length); \
- } while (0)
-
-#define ISC__BUFFER_PUTSTR(_b, _source) \
- do { \
- unsigned int _length; \
- unsigned char *_cp; \
- _length = strlen(_source); \
- _cp = isc_buffer_used(_b); \
- memcpy(_cp, (_source), _length); \
- (_b)->used += (_length); \
- } while (0)
-
-#define ISC__BUFFER_PUTUINT8(_b, _val) \
- do { \
- unsigned char *_cp; \
- isc_uint8_t _val2 = (_val); \
- _cp = isc_buffer_used(_b); \
- (_b)->used++; \
- _cp[0] = _val2 & 0x00ff; \
- } while (0)
-
-#define ISC__BUFFER_PUTUINT16(_b, _val) \
- do { \
- unsigned char *_cp; \
- isc_uint16_t _val2 = (_val); \
- _cp = isc_buffer_used(_b); \
- (_b)->used += 2; \
- _cp[0] = (unsigned char)((_val2 & 0xff00U) >> 8); \
- _cp[1] = (unsigned char)(_val2 & 0x00ffU); \
- } while (0)
-
-#define ISC__BUFFER_PUTUINT32(_b, _val) \
- do { \
- unsigned char *_cp; \
- isc_uint32_t _val2 = (_val); \
- _cp = isc_buffer_used(_b); \
- (_b)->used += 4; \
- _cp[0] = (unsigned char)((_val2 & 0xff000000) >> 24); \
- _cp[1] = (unsigned char)((_val2 & 0x00ff0000) >> 16); \
- _cp[2] = (unsigned char)((_val2 & 0x0000ff00) >> 8); \
- _cp[3] = (unsigned char)((_val2 & 0x000000ff)); \
- } while (0)
-
-#if defined(ISC_BUFFER_USEINLINE)
-#define isc_buffer_init ISC__BUFFER_INIT
-#define isc_buffer_invalidate ISC__BUFFER_INVALIDATE
-#define isc_buffer_region ISC__BUFFER_REGION
-#define isc_buffer_usedregion ISC__BUFFER_USEDREGION
-#define isc_buffer_availableregion ISC__BUFFER_AVAILABLEREGION
-#define isc_buffer_add ISC__BUFFER_ADD
-#define isc_buffer_subtract ISC__BUFFER_SUBTRACT
-#define isc_buffer_clear ISC__BUFFER_CLEAR
-#define isc_buffer_consumedregion ISC__BUFFER_CONSUMEDREGION
-#define isc_buffer_remainingregion ISC__BUFFER_REMAININGREGION
-#define isc_buffer_activeregion ISC__BUFFER_ACTIVEREGION
-#define isc_buffer_setactive ISC__BUFFER_SETACTIVE
-#define isc_buffer_first ISC__BUFFER_FIRST
-#define isc_buffer_forward ISC__BUFFER_FORWARD
-#define isc_buffer_back ISC__BUFFER_BACK
-#define isc_buffer_putmem ISC__BUFFER_PUTMEM
-#define isc_buffer_putstr ISC__BUFFER_PUTSTR
-#define isc_buffer_putuint8 ISC__BUFFER_PUTUINT8
-#define isc_buffer_putuint16 ISC__BUFFER_PUTUINT16
-#define isc_buffer_putuint32 ISC__BUFFER_PUTUINT32
-#else
-#define isc_buffer_init isc__buffer_init
-#define isc_buffer_invalidate isc__buffer_invalidate
-#define isc_buffer_region isc__buffer_region
-#define isc_buffer_usedregion isc__buffer_usedregion
-#define isc_buffer_availableregion isc__buffer_availableregion
-#define isc_buffer_add isc__buffer_add
-#define isc_buffer_subtract isc__buffer_subtract
-#define isc_buffer_clear isc__buffer_clear
-#define isc_buffer_consumedregion isc__buffer_consumedregion
-#define isc_buffer_remainingregion isc__buffer_remainingregion
-#define isc_buffer_activeregion isc__buffer_activeregion
-#define isc_buffer_setactive isc__buffer_setactive
-#define isc_buffer_first isc__buffer_first
-#define isc_buffer_forward isc__buffer_forward
-#define isc_buffer_back isc__buffer_back
-#define isc_buffer_putmem isc__buffer_putmem
-#define isc_buffer_putstr isc__buffer_putstr
-#define isc_buffer_putuint8 isc__buffer_putuint8
-#define isc_buffer_putuint16 isc__buffer_putuint16
-#define isc_buffer_putuint32 isc__buffer_putuint32
-#endif
-
-#endif /* ISC_BUFFER_H */
diff --git a/freebsd-userspace/rtems/include/isc/dst.h b/freebsd-userspace/rtems/include/isc/dst.h
deleted file mode 100644
index e69de29b..00000000
--- a/freebsd-userspace/rtems/include/isc/dst.h
+++ /dev/null
diff --git a/freebsd-userspace/rtems/include/isc/error.h b/freebsd-userspace/rtems/include/isc/error.h
deleted file mode 100644
index 1dc07748..00000000
--- a/freebsd-userspace/rtems/include/isc/error.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: error.h,v 1.13 2001/01/09 21:56:51 bwelling Exp $ */
-
-#ifndef ISC_ERROR_H
-#define ISC_ERROR_H 1
-
-#include <stdarg.h>
-
-#include <isc/formatcheck.h>
-#include <isc/lang.h>
-
-ISC_LANG_BEGINDECLS
-
-typedef void (*isc_errorcallback_t)(const char *, int, const char *, va_list);
-
-void
-isc_error_setunexpected(isc_errorcallback_t);
-
-void
-isc_error_setfatal(isc_errorcallback_t);
-
-void
-isc_error_unexpected(const char *, int, const char *, ...)
- ISC_FORMAT_PRINTF(3, 4);
-
-void
-isc_error_fatal(const char *, int, const char *, ...)
- ISC_FORMAT_PRINTF(3, 4);
-
-void
-isc_error_runtimecheck(const char *, int, const char *);
-
-#define ISC_ERROR_RUNTIMECHECK(cond) \
- ((void) ((cond) || \
- ((isc_error_runtimecheck)(__FILE__, __LINE__, #cond), 0)))
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_ERROR_H */
diff --git a/freebsd-userspace/rtems/include/isc/formatcheck.h b/freebsd-userspace/rtems/include/isc/formatcheck.h
deleted file mode 100644
index e9b91698..00000000
--- a/freebsd-userspace/rtems/include/isc/formatcheck.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: formatcheck.h,v 1.6 2001/01/09 21:56:55 bwelling Exp $ */
-
-#ifndef ISC_FORMATCHECK_H
-#define ISC_FORMATCHECK_H 1
-
-/*
- * fmt is the location of the format string parameter.
- * args is the location of the first argument (or 0 for no argument checking).
- * Note: the first parameter is 1, not 0.
- */
-#ifdef __GNUC__
-#define ISC_FORMAT_PRINTF(fmt, args) __attribute__((__format__(__printf__, fmt, args)))
-#else
-#define ISC_FORMAT_PRINTF(fmt, args)
-#endif
-
-#endif /* ISC_FORMATCHECK_H */
diff --git a/freebsd-userspace/rtems/include/isc/int.h b/freebsd-userspace/rtems/include/isc/int.h
deleted file mode 100644
index d30e6dcc..00000000
--- a/freebsd-userspace/rtems/include/isc/int.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: int.h,v 1.11 2001/01/09 21:58:39 bwelling Exp $ */
-
-#ifndef ISC_INT_H
-#define ISC_INT_H 1
-
-typedef char isc_int8_t;
-typedef unsigned char isc_uint8_t;
-typedef short isc_int16_t;
-typedef unsigned short isc_uint16_t;
-typedef int isc_int32_t;
-typedef unsigned int isc_uint32_t;
-typedef long long isc_int64_t;
-typedef unsigned long long isc_uint64_t;
-
-#define ISC_INT8_MIN -128
-#define ISC_INT8_MAX 127
-#define ISC_UINT8_MAX 255
-
-#define ISC_INT16_MIN -32768
-#define ISC_INT16_MAX 32767
-#define ISC_UINT16_MAX 65535
-
-/*
- * Note that "int" is 32 bits on all currently supported Unix-like operating
- * systems, but "long" can be either 32 bits or 64 bits, thus the 32 bit
- * constants are not qualified with "L".
- */
-#define ISC_INT32_MIN -2147483648
-#define ISC_INT32_MAX 2147483647
-#define ISC_UINT32_MAX 4294967295U
-
-#define ISC_INT64_MIN -9223372036854775808LL
-#define ISC_INT64_MAX 9223372036854775807LL
-#define ISC_UINT64_MAX 18446744073709551615ULL
-
-#endif /* ISC_INT_H */
diff --git a/freebsd-userspace/rtems/include/isc/interfaceiter.h b/freebsd-userspace/rtems/include/isc/interfaceiter.h
deleted file mode 100644
index f2d11ba8..00000000
--- a/freebsd-userspace/rtems/include/isc/interfaceiter.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: interfaceiter.h,v 1.10 2001/01/09 21:57:01 bwelling Exp $ */
-
-#ifndef ISC_INTERFACEITER_H
-#define ISC_INTERFACEITER_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*
- * Interface iterator
- *
- * Iterate over the list of network interfaces.
- *
- * Interfaces whose address family is not supported are ignored and never
- * returned by the iterator. Interfaces whose netmask, interface flags,
- * or similar cannot be obtained are also ignored, and the failure is logged.
- *
- * Standards:
- * The API for scanning varies greatly among operating systems.
- * This module attempts to hide the differences.
- */
-
-/***
- *** Imports
- ***/
-
-#include <isc/lang.h>
-#include <isc/netaddr.h>
-#include <isc/types.h>
-
-/*
- * Public structure describing a network interface.
- */
-
-struct isc_interface {
- char name[32]; /* Interface name, null-terminated. */
- unsigned int af; /* Address family. */
- isc_netaddr_t address; /* Local address. */
- isc_netaddr_t netmask; /* Network mask. */
- isc_netaddr_t broadcast; /* Broadcast address. */
- isc_netaddr_t dstaddress; /* Destination address
- (point-to-point only). */
- isc_uint32_t flags; /* Flags; see below. */
- unsigned int ifindex; /* Interface Index */
- unsigned int scopeid; /* Scope id for Multicasting */
-};
-
-/* Interface flags. */
-
-#define INTERFACE_F_UP 0x00000001U /* Interface is up */
-#define INTERFACE_F_POINTTOPOINT 0x00000002U /*this is point-to-point interface*/
-#define INTERFACE_F_LOOPBACK 0x00000004U /* this is loopback interface */
-#define INTERFACE_F_BROADCAST 0x00000008U /* Broadcast is supported */
-#define INTERFACE_F_MULTICAST 0x00000010U /* multicast is supported */
-
-/***
- *** Functions
- ***/
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp);
-/*
- * Create an iterator for traversing the operating system's list
- * of network interfaces.
- *
- * Returns:
- * ISC_R_SUCCESS
- * ISC_R_NOMEMORY
- * Various network-related errors
- */
-
-isc_result_t
-isc_interfaceiter_first(isc_interfaceiter_t *iter);
-/*
- * Position the iterator on the first interface.
- *
- * Returns:
- * ISC_R_SUCCESS Success.
- * ISC_R_NOMORE There are no interfaces.
- */
-
-isc_result_t
-isc_interfaceiter_current(isc_interfaceiter_t *iter,
- isc_interface_t *ifdata);
-/*
- * Get information about the interface the iterator is currently
- * positioned at and store it at *ifdata.
- *
- * Requires:
- * The iterator has been successfully positioned using
- * isc_interface_iter_first() / isc_interface_iter_next().
- *
- * Returns:
- * ISC_R_SUCCESS Success.
- */
-
-isc_result_t
-isc_interfaceiter_next(isc_interfaceiter_t *iter);
-/*
- * Position the iterator on the next interface.
- *
- * Requires:
- * The iterator has been successfully positioned using
- * isc_interface_iter_first() / isc_interface_iter_next().
- *
- * Returns:
- * ISC_R_SUCCESS Success.
- * ISC_R_NOMORE There are no more interfaces.
- */
-
-void
-isc_interfaceiter_destroy(isc_interfaceiter_t **iterp);
-/*
- * Destroy the iterator.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_INTERFACEITER_H */
diff --git a/freebsd-userspace/rtems/include/isc/ipv6.h b/freebsd-userspace/rtems/include/isc/ipv6.h
deleted file mode 100644
index 007de7c0..00000000
--- a/freebsd-userspace/rtems/include/isc/ipv6.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: ipv6.h,v 1.17.12.4 2004/03/09 05:21:09 marka Exp $ */
-
-#ifndef ISC_IPV6_H
-#define ISC_IPV6_H 1
-
-/*
- * Also define LWRES_IPV6_H to keep it from being included if liblwres is
- * being used, or redefinition errors will occur.
- */
-#define LWRES_IPV6_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*
- * IPv6 definitions for systems which do not support IPv6.
- *
- * MP:
- * No impact.
- *
- * Reliability:
- * No anticipated impact.
- *
- * Resources:
- * N/A.
- *
- * Security:
- * No anticipated impact.
- *
- * Standards:
- * RFC 2553.
- */
-
-/***
- *** Imports.
- ***/
-
-#include <isc/int.h>
-#include <isc/platform.h>
-
-/*
- * We probably don't need this on NTP
- */
-#ifdef ISC_ONLY_IPV6
-/***
- *** Types.
- ***/
-
-struct in6_addr {
- union {
- isc_uint8_t _S6_u8[16];
- isc_uint16_t _S6_u16[8];
- isc_uint32_t _S6_u32[4];
- } _S6_un;
-};
-#define s6_addr _S6_un._S6_u8
-#define s6_addr8 _S6_un._S6_u8
-#define s6_addr16 _S6_un._S6_u16
-#define s6_addr32 _S6_un._S6_u32
-
-#define IN6ADDR_ANY_INIT {{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }}
-#define IN6ADDR_LOOPBACK_INIT {{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }}
-
-LIBISC_EXTERNAL_DATA extern const struct in6_addr in6addr_any;
-LIBISC_EXTERNAL_DATA extern const struct in6_addr in6addr_loopback;
-
-struct sockaddr_in6 {
-#ifdef ISC_PLATFORM_HAVESALEN
- isc_uint8_t sin6_len;
- isc_uint8_t sin6_family;
-#else
- isc_uint16_t sin6_family;
-#endif
- isc_uint16_t sin6_port;
- isc_uint32_t sin6_flowinfo;
- struct in6_addr sin6_addr;
- isc_uint32_t sin6_scope_id;
-};
-
-#ifdef ISC_PLATFORM_HAVESALEN
-#define SIN6_LEN 1
-#endif
-
-/*
- * Unspecified
- */
-#ifndef IN6_IS_ADDR_UNSPECIFIED
-#define IN6_IS_ADDR_UNSPECIFIED(a) \
- (((a)->s6_addr32[0] == 0) && \
- ((a)->s6_addr32[1] == 0) && \
- ((a)->s6_addr32[2] == 0) && \
- ((a)->s6_addr32[3] == 0))
-#endif
-/*
- * Loopback
- */
-#define IN6_IS_ADDR_LOOPBACK(a) \
- (((a)->s6_addr32[0] == 0) && \
- ((a)->s6_addr32[1] == 0) && \
- ((a)->s6_addr32[2] == 0) && \
- ((a)->s6_addr32[3] == htonl(1)))
-
-/*
- * IPv4 compatible
- */
-#define IN6_IS_ADDR_V4COMPAT(a) \
- (((a)->s6_addr32[0] == 0) && \
- ((a)->s6_addr32[1] == 0) && \
- ((a)->s6_addr32[2] == 0) && \
- ((a)->s6_addr32[3] != 0) && \
- ((a)->s6_addr32[3] != htonl(1)))
-
-/*
- * Mapped
- */
-#define IN6_IS_ADDR_V4MAPPED(a) \
- (((a)->s6_addr32[0] == 0) && \
- ((a)->s6_addr32[1] == 0) && \
- ((a)->s6_addr32[2] == htonl(0x0000ffff)))
-
-/*
- * Multicast
- */
-#ifndef IN6_IS_ADDR_MULTICAST
-#define IN6_IS_ADDR_MULTICAST(a) \
- ((a)->s6_addr8[0] == 0xffU)
-#endif
-/*
- * Unicast link / site local.
- */
-#define IN6_IS_ADDR_LINKLOCAL(a) \
- (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80))
-#define IN6_IS_ADDR_SITELOCAL(a) \
- (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0))
-
-#endif /* ISC_ONLY_IPV6 */
-#endif /* ISC_IPV6_H */
diff --git a/freebsd-userspace/rtems/include/isc/lang.h b/freebsd-userspace/rtems/include/isc/lang.h
deleted file mode 100644
index b3ba5908..00000000
--- a/freebsd-userspace/rtems/include/isc/lang.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: lang.h,v 1.6 2001/01/09 21:57:03 bwelling Exp $ */
-
-#ifndef ISC_LANG_H
-#define ISC_LANG_H 1
-
-#ifdef __cplusplus
-#define ISC_LANG_BEGINDECLS extern "C" {
-#define ISC_LANG_ENDDECLS }
-#else
-#define ISC_LANG_BEGINDECLS
-#define ISC_LANG_ENDDECLS
-#endif
-
-#endif /* ISC_LANG_H */
diff --git a/freebsd-userspace/rtems/include/isc/lib.h b/freebsd-userspace/rtems/include/isc/lib.h
deleted file mode 100644
index 7feef43c..00000000
--- a/freebsd-userspace/rtems/include/isc/lib.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: lib.h,v 1.7 2001/11/19 03:08:25 mayer Exp $ */
-
-#ifndef ISC_LIB_H
-#define ISC_LIB_H 1
-
-#include <isc/types.h>
-#include <isc/lang.h>
-
-ISC_LANG_BEGINDECLS
-
-LIBISC_EXTERNAL_DATA extern isc_msgcat_t *isc_msgcat;
-
-void
-isc_lib_initmsgcat(void);
-/*
- * Initialize the ISC library's message catalog, isc_msgcat, if it
- * has not already been initialized.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_LIB_H */
diff --git a/freebsd-userspace/rtems/include/isc/magic.h b/freebsd-userspace/rtems/include/isc/magic.h
deleted file mode 100644
index ff3df24b..00000000
--- a/freebsd-userspace/rtems/include/isc/magic.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: magic.h,v 1.11 2001/01/09 21:57:10 bwelling Exp $ */
-
-#ifndef ISC_MAGIC_H
-#define ISC_MAGIC_H 1
-
-typedef struct {
- unsigned int magic;
-} isc__magic_t;
-
-
-/*
- * To use this macro the magic number MUST be the first thing in the
- * structure, and MUST be of type "unsigned int".
- *
- * The intent of this is to allow magic numbers to be checked even though
- * the object is otherwise opaque.
- */
-#define ISC_MAGIC_VALID(a,b) (((a) != NULL) && \
- (((const isc__magic_t *)(a))->magic == (b)))
-
-#define ISC_MAGIC(a, b, c, d) ((a) << 24 | (b) << 16 | (c) << 8 | (d))
-
-#endif /* ISC_MAGIC_H */
diff --git a/freebsd-userspace/rtems/include/isc/mem.h b/freebsd-userspace/rtems/include/isc/mem.h
deleted file mode 100644
index f8e73d0e..00000000
--- a/freebsd-userspace/rtems/include/isc/mem.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 1997-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: mem.h,v 1.58 2001/09/07 00:51:51 marka Exp $ */
-
-#ifndef ISC_MEM_H
-#define ISC_MEM_H 1
-
-#include <stdio.h>
-#include <isc/types.h>
-
-void *
-isc_mem_get(isc_mem_t *, size_t);
-void
-isc_mem_put(isc_mem_t *, void *, size_t);
-
-#endif /* ISC_MEM_H */
diff --git a/freebsd-userspace/rtems/include/isc/msgcat.h b/freebsd-userspace/rtems/include/isc/msgcat.h
deleted file mode 100644
index d2bf1e16..00000000
--- a/freebsd-userspace/rtems/include/isc/msgcat.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: msgcat.h,v 1.8 2001/01/09 21:57:13 bwelling Exp $ */
-
-#ifndef ISC_MSGCAT_H
-#define ISC_MSGCAT_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*
- * ISC Message Catalog
- *
- * Message catalogs aid internationalization of applications by allowing
- * messages to be retrieved from locale-specific files instead of
- * hardwiring them into the application. This allows translations of
- * messages appropriate to the locale to be supplied without recompiling
- * the application.
- *
- * Notes:
- * It's very important that message catalogs work, even if only the
- * default_text can be used.
- *
- * MP:
- * The caller must ensure appropriate synchronization of
- * isc_msgcat_open() and isc_msgcat_close(). isc_msgcat_get()
- * ensures appropriate synchronization.
- *
- * Reliability:
- * No anticipated impact.
- *
- * Resources:
- * <TBS>
- *
- * Security:
- * No anticipated impact.
- *
- * Standards:
- * None.
- */
-
-/*****
- ***** Imports
- *****/
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/*****
- ***** Methods
- *****/
-
-void
-isc_msgcat_open(const char *name, isc_msgcat_t **msgcatp);
-/*
- * Open a message catalog.
- *
- * Notes:
- *
- * If memory cannot be allocated or other failures occur, *msgcatp
- * will be set to NULL. If a NULL msgcat is given to isc_msgcat_get(),
- * the default_text will be returned, ensuring that some message text
- * will be available, no matter what's going wrong.
- *
- * Requires:
- *
- * 'name' is a valid string.
- *
- * msgcatp != NULL && *msgcatp == NULL
- */
-
-void
-isc_msgcat_close(isc_msgcat_t **msgcatp);
-/*
- * Close a message catalog.
- *
- * Notes:
- *
- * Any string pointers returned by prior calls to isc_msgcat_get() are
- * invalid after isc_msgcat_close() has been called and must not be
- * used.
- *
- * Requires:
- *
- * *msgcatp is a valid message catalog or is NULL.
- *
- * Ensures:
- *
- * All resources associated with the message catalog are released.
- *
- * *msgcatp == NULL
- */
-
-const char *
-isc_msgcat_get(isc_msgcat_t *msgcat, int set, int message,
- const char *default_text);
-/*
- * Get message 'message' from message set 'set' in 'msgcat'. If it
- * is not available, use 'default_text'.
- *
- * Requires:
- *
- * 'msgcat' is a valid message catalog or is NULL.
- *
- * set > 0
- *
- * message > 0
- *
- * 'default_text' is a valid string.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_MSGCAT_H */
diff --git a/freebsd-userspace/rtems/include/isc/msgs.h b/freebsd-userspace/rtems/include/isc/msgs.h
deleted file mode 100644
index 967005bf..00000000
--- a/freebsd-userspace/rtems/include/isc/msgs.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000-2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: msgs.h,v 1.5.2.2.8.3 2004/03/06 08:14:44 marka Exp $ */
-
-#ifndef ISC_MSGS_H
-#define ISC_MSGS_H 1
-
-#include <isc/lib.h> /* Provide isc_msgcat global variable. */
-#include <isc/msgcat.h> /* Provide isc_msgcat_*() functions. */
-
-/*
- * Message sets, named per source file, excepting "GENERAL".
- * IMPORTANT: The original list is alphabetical, but any new sets must
- * be added to the end.
- */
-#define ISC_MSGSET_GENERAL 1
-/* ISC_RESULT_RESULTSET 2 */ /* XXX */
-/* ISC_RESULT_UNAVAILABLESET 3 */ /* XXX */
-#define ISC_MSGSET_APP 4
-#define ISC_MSGSET_COMMANDLINE 5
-#define ISC_MSGSET_ENTROPY 6
-#define ISC_MSGSET_IFITERIOCTL 7
-#define ISC_MSGSET_IFITERSYSCTL 8
-#define ISC_MSGSET_LEX 9
-#define ISC_MSGSET_LOG 10
-#define ISC_MSGSET_MEM 11
-#define ISC_MSGSET_NETADDR 12
-#define ISC_MSGSET_PRINT 13
-#define ISC_MSGSET_RESULT 14
-#define ISC_MSGSET_RWLOCK 15
-#define ISC_MSGSET_SOCKADDR 16
-#define ISC_MSGSET_SOCKET 17
-#define ISC_MSGSET_TASK 18
-#define ISC_MSGSET_TIMER 19
-#define ISC_MSGSET_UTIL 20
-#define ISC_MSGSET_IFITERGETIFADDRS 21
-
-/*
- * Message numbers. They are only required to be unique per message set,
- * but are unique throughout the entire catalog to not be as confusing when
- * debugging.
- *
- * The initial numbering was done by multiply by 100 the set number the
- * message appears in then adding the incremental message number.
- */
-#define ISC_MSG_FAILED 101 /* "failed" */
-#define ISC_MSG_SUCCEEDED 102 /* Compatible with "failed" */
-#define ISC_MSG_SUCCESS 103 /* More usual way to say "success" */
-#define ISC_MSG_STARTING 104 /* As in "daemon: starting" */
-#define ISC_MSG_STOPING 105 /* As in "daemon: stopping" */
-#define ISC_MSG_ENTERING 106 /* As in "some_subr: entering" */
-#define ISC_MSG_EXITING 107 /* As in "some_subr: exiting" */
-#define ISC_MSG_CALLING 108 /* As in "calling some_subr()" */
-#define ISC_MSG_RETURNED 109 /* As in "some_subr: returned <foo>" */
-#define ISC_MSG_FATALERROR 110 /* "fatal error" */
-#define ISC_MSG_SHUTTINGDOWN 111 /* "shutting down" */
-#define ISC_MSG_RUNNING 112 /* "running" */
-#define ISC_MSG_WAIT 113 /* "wait" */
-#define ISC_MSG_WAITUNTIL 114 /* "waituntil" */
-
-#define ISC_MSG_SIGNALSETUP 201 /* "handle_signal() %d setup: %s" */
-
-#define ISC_MSG_ILLEGALOPT 301 /* "illegal option" */
-#define ISC_MSG_OPTNEEDARG 302 /* "option requires an argument" */
-
-#define ISC_MSG_ENTROPYSTATS 401 /* "Entropy pool %p: refcnt %u ..." */
-
-#define ISC_MSG_MAKESCANSOCKET 501 /* "making interface scan socket: %s" */
-#define ISC_MSG_GETIFCONFIG 502 /* "get interface configuration: %s" */
-#define ISC_MSG_BUFFERMAX 503 /* "... maximum buffer size exceeded" */
-#define ISC_MSG_GETDESTADDR 504 /* "%s: getting destination address: %s" */
-#define ISC_MSG_GETNETMASK 505 /* "%s: getting netmask: %s" */
-
-#define ISC_MSG_GETIFLISTSIZE 601 /* "getting interface list size: ..." */
-#define ISC_MSG_GETIFLIST 602 /* "getting interface list: ..." */
-#define ISC_MSG_UNEXPECTEDTYPE 603 /* "... unexpected ... message type" */
-
-#define ISC_MSG_UNEXPECTEDSTATE 701 /* "Unexpected state %d" */
-
-#define ISC_MSG_BADTIME 801 /* "Bad 00 99:99:99.999 " */
-#define ISC_MSG_LEVEL 802 /* "level %d: " */
-
-#define ISC_MSG_ADDTRACE 901 /* "add %p size %u " */
-#define ISC_MSG_DELTRACE 902 /* "del %p size %u " */
-#define ISC_MSG_POOLSTATS 903 /* "[Pool statistics]\n" */
-#define ISC_MSG_POOLNAME 904 /* "name" */
-#define ISC_MSG_POOLSIZE 905 /* "size" */
-#define ISC_MSG_POOLMAXALLOC 906 /* "maxalloc" */
-#define ISC_MSG_POOLALLOCATED 907 /* "allocated" */
-#define ISC_MSG_POOLFREECOUNT 908 /* "freecount" */
-#define ISC_MSG_POOLFREEMAX 909 /* "freemax" */
-#define ISC_MSG_POOLFILLCOUNT 910 /* "fillcount" */
-#define ISC_MSG_POOLGETS 911 /* "gets" */
-#define ISC_MSG_DUMPALLOC 912 /* "DUMP OF ALL OUTSTANDING MEMORY ..." */
-#define ISC_MSG_NONE 913 /* "\tNone.\n" */
-#define ISC_MSG_PTRFILELINE 914 /* "\tptr %p file %s line %u\n" */
-
-#define ISC_MSG_UNKNOWNADDR 1001 /* "<unknown address, family %u>" */
-
-#define ISC_MSG_NOLONGDBL 1104 /* "long doubles are not supported" */
-
-#define ISC_MSG_PRINTLOCK 1201 /* "rwlock %p thread %lu ..." */
-#define ISC_MSG_READ 1202 /* "read" */
-#define ISC_MSG_WRITE 1203 /* "write" */
-#define ISC_MSG_READING 1204 /* "reading" */
-#define ISC_MSG_WRITING 1205 /* "writing" */
-#define ISC_MSG_PRELOCK 1206 /* "prelock" */
-#define ISC_MSG_POSTLOCK 1207 /* "postlock" */
-#define ISC_MSG_PREUNLOCK 1208 /* "preunlock" */
-#define ISC_MSG_POSTUNLOCK 1209 /* "postunlock" */
-
-#define ISC_MSG_UNKNOWNFAMILY 1301 /* "unknown address family: %d" */
-
-#define ISC_MSG_WRITEFAILED 1401 /* "write() failed during watcher ..." */
-#define ISC_MSG_READFAILED 1402 /* "read() failed during watcher ... " */
-#define ISC_MSG_PROCESSCMSG 1403 /* "processing cmsg %p" */
-#define ISC_MSG_IFRECEIVED 1404 /* "interface received on ifindex %u" */
-#define ISC_MSG_SENDTODATA 1405 /* "sendto pktinfo data, ifindex %u" */
-#define ISC_MSG_DOIORECV 1406 /* "doio_recv: recvmsg(%d) %d bytes ..." */
-#define ISC_MSG_PKTRECV 1407 /* "packet received correctly" */
-#define ISC_MSG_DESTROYING 1408 /* "destroying" */
-#define ISC_MSG_CREATED 1409 /* "created" */
-#define ISC_MSG_ACCEPTLOCK 1410 /* "internal_accept called, locked ..." */
-#define ISC_MSG_ACCEPTEDCXN 1411 /* "accepted connection, new socket %p" */
-#define ISC_MSG_INTERNALRECV 1412 /* "internal_recv: task %p got event %p" */
-#define ISC_MSG_INTERNALSEND 1413 /* "internal_send: task %p got event %p" */
-#define ISC_MSG_WATCHERMSG 1414 /* "watcher got message %d" */
-#define ISC_MSG_SOCKETSREMAIN 1415 /* "sockets exist" */
-#define ISC_MSG_PKTINFOPROVIDED 1416 /* "pktinfo structure provided, ..." */
-#define ISC_MSG_BOUND 1417 /* "bound" */
-#define ISC_MSG_ACCEPTRETURNED 1418 /* accept() returned %d/%s */
-#define ISC_MSG_TOOMANYFDS 1419 /* %s: too many open file descriptors */
-#define ISC_MSG_ZEROPORT 1420 /* dropping source port zero packet */
-#define ISC_MSG_FILTER 1420 /* setsockopt(SO_ACCEPTFILTER): %s */
-
-#define ISC_MSG_AWAKE 1502 /* "awake" */
-#define ISC_MSG_WORKING 1503 /* "working" */
-#define ISC_MSG_EXECUTE 1504 /* "execute action" */
-#define ISC_MSG_EMPTY 1505 /* "empty" */
-#define ISC_MSG_DONE 1506 /* "done" */
-#define ISC_MSG_QUANTUM 1507 /* "quantum" */
-
-#define ISC_MSG_SCHEDULE 1601 /* "schedule" */
-#define ISC_MSG_SIGNALSCHED 1602 /* "signal (schedule)" */
-#define ISC_MSG_SIGNALDESCHED 1603 /* "signal (deschedule)" */
-#define ISC_MSG_SIGNALDESTROY 1604 /* "signal (destroy)" */
-#define ISC_MSG_IDLERESCHED 1605 /* "idle reschedule" */
-#define ISC_MSG_EVENTNOTALLOC 1606 /* "couldn't allocate event" */
-#define ISC_MSG_SCHEDFAIL 1607 /* "couldn't schedule timer: %u" */
-#define ISC_MSG_POSTING 1608 /* "posting" */
-#define ISC_MSG_WAKEUP 1609 /* "wakeup" */
-
-#define ISC_MSG_LOCK 1701 /* "LOCK" */
-#define ISC_MSG_LOCKING 1702 /* "LOCKING" */
-#define ISC_MSG_LOCKED 1703 /* "LOCKED" */
-#define ISC_MSG_UNLOCKED 1704 /* "UNLOCKED" */
-#define ISC_MSG_RWLOCK 1705 /* "RWLOCK" */
-#define ISC_MSG_RWLOCKED 1706 /* "RWLOCKED" */
-#define ISC_MSG_RWUNLOCK 1707 /* "RWUNLOCK" */
-#define ISC_MSG_BROADCAST 1708 /* "BROADCAST" */
-#define ISC_MSG_SIGNAL 1709 /* "SIGNAL" */
-#define ISC_MSG_UTILWAIT 1710 /* "WAIT" */
-#define ISC_MSG_WAITED 1711 /* "WAITED" */
-
-#define ISC_MSG_GETIFADDRS 1801 /* "getting interface addresses: ..." */
-
-
-#endif /* ISC_MSGS_H */
diff --git a/freebsd-userspace/rtems/include/isc/mutex.h b/freebsd-userspace/rtems/include/isc/mutex.h
deleted file mode 100644
index fd6f3ec5..00000000
--- a/freebsd-userspace/rtems/include/isc/mutex.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: mutex.h,v 1.3 2001/01/09 21:57:55 bwelling Exp $ */
-
-#ifndef ISC_MUTEX_H
-#define ISC_MUTEX_H 1
-
-#include <isc/result.h> /* for ISC_R_ codes */
-
-typedef int isc_mutex_t;
-
-#define isc_mutex_init(mp) \
- (*(mp) = 0, ISC_R_SUCCESS)
-#define isc_mutex_lock(mp) \
- ((*(mp))++ == 0 ? ISC_R_SUCCESS : ISC_R_UNEXPECTED)
-#define isc_mutex_unlock(mp) \
- (--(*(mp)) == 0 ? ISC_R_SUCCESS : ISC_R_UNEXPECTED)
-#define isc_mutex_trylock(mp) \
- (*(mp) == 0 ? ((*(mp))++, ISC_R_SUCCESS) : ISC_R_LOCKBUSY)
-#define isc_mutex_destroy(mp) \
- (*(mp) == 0 ? (*(mp) = -1, ISC_R_SUCCESS) : ISC_R_UNEXPECTED)
-#define isc_mutex_stats(fp)
-
-#endif /* ISC_MUTEX_H */
diff --git a/freebsd-userspace/rtems/include/isc/net.h b/freebsd-userspace/rtems/include/isc/net.h
deleted file mode 100644
index dae59780..00000000
--- a/freebsd-userspace/rtems/include/isc/net.h
+++ /dev/null
@@ -1,329 +0,0 @@
-/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: net.h,v 1.31.2.2.10.8 2004/04/29 01:31:23 marka Exp $ */
-
-#ifndef ISC_NET_H
-#define ISC_NET_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*
- * Basic Networking Types
- *
- * This module is responsible for defining the following basic networking
- * types:
- *
- * struct in_addr
- * struct in6_addr
- * struct in6_pktinfo
- * struct sockaddr
- * struct sockaddr_in
- * struct sockaddr_in6
- * in_port_t
- *
- * It ensures that the AF_ and PF_ macros are defined.
- *
- * It declares ntoh[sl]() and hton[sl]().
- *
- * It declares inet_aton(), inet_ntop(), and inet_pton().
- *
- * It ensures that INADDR_LOOPBACK, INADDR_ANY, IN6ADDR_ANY_INIT,
- * in6addr_any, and in6addr_loopback are available.
- *
- * It ensures that IN_MULTICAST() is available to check for multicast
- * addresses.
- *
- * MP:
- * No impact.
- *
- * Reliability:
- * No anticipated impact.
- *
- * Resources:
- * N/A.
- *
- * Security:
- * No anticipated impact.
- *
- * Standards:
- * BSD Socket API
- * RFC 2553
- */
-
-/***
- *** Imports.
- ***/
-#include <isc/platform.h>
-
-#include <sys/types.h>
-#include <sys/socket.h> /* Contractual promise. */
-
-#include <net/if.h>
-
-#include <netinet/in.h> /* Contractual promise. */
-#include <arpa/inet.h> /* Contractual promise. */
-#ifdef ISC_PLATFORM_NEEDNETINETIN6H
-#include <netinet/in6.h> /* Required on UnixWare. */
-#endif
-#ifdef ISC_PLATFORM_NEEDNETINET6IN6H
-#include <netinet6/in6.h> /* Required on BSD/OS for in6_pktinfo. */
-#endif
-
-#ifndef ISC_PLATFORM_HAVEIPV6
-#include <isc/ipv6.h> /* Contractual promise. */
-#endif
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-#ifdef ISC_PLATFORM_HAVEINADDR6
-#define in6_addr in_addr6 /* Required for pre RFC2133 implementations. */
-#endif
-
-#ifdef ISC_PLATFORM_HAVEIPV6
-/*
- * Required for some pre RFC2133 implementations.
- * IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT were added in
- * draft-ietf-ipngwg-bsd-api-04.txt or draft-ietf-ipngwg-bsd-api-05.txt.
- * If 's6_addr' is defined then assume that there is a union and three
- * levels otherwise assume two levels required.
- */
-#ifndef IN6ADDR_ANY_INIT
-#ifdef s6_addr
-#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
-#else
-#define IN6ADDR_ANY_INIT { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }
-#endif
-#endif
-
-#ifndef IN6ADDR_LOOPBACK_INIT
-#ifdef s6_addr
-#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
-#else
-#define IN6ADDR_LOOPBACK_INIT { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } }
-#endif
-#endif
-
-#ifndef IN6_IS_ADDR_V4MAPPED
-#define IN6_IS_ADDR_V4MAPPED(x) \
- (memcmp((x)->s6_addr, in6addr_any.s6_addr, 10) == 0 && \
- (x)->s6_addr[10] == 0xff && (x)->s6_addr[11] == 0xff)
-#endif
-
-#ifndef IN6_IS_ADDR_V4COMPAT
-#define IN6_IS_ADDR_V4COMPAT(x) \
- (memcmp((x)->s6_addr, in6addr_any.s6_addr, 12) == 0 && \
- ((x)->s6_addr[12] != 0 || (x)->s6_addr[13] != 0 || \
- (x)->s6_addr[14] != 0 || \
- ((x)->s6_addr[15] != 0 && (x)->s6_addr[15] != 1)))
-#endif
-
-#ifndef IN6_IS_ADDR_MULTICAST
-#define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff)
-#endif
-
-#ifndef IN6_IS_ADDR_LINKLOCAL
-#define IN6_IS_ADDR_LINKLOCAL(a) \
- (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80))
-#endif
-
-#ifndef IN6_IS_ADDR_SITELOCAL
-#define IN6_IS_ADDR_SITELOCAL(a) \
- (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0))
-#endif
-
-
-#ifndef IN6_IS_ADDR_LOOPBACK
-#define IN6_IS_ADDR_LOOPBACK(x) \
- (memcmp((x)->s6_addr, in6addr_loopback.s6_addr, 16) == 0)
-#endif
-#endif
-
-#ifndef AF_INET6
-#define AF_INET6 99
-#endif
-
-#ifndef PF_INET6
-#define PF_INET6 AF_INET6
-#endif
-
-#ifndef INADDR_LOOPBACK
-#define INADDR_LOOPBACK 0x7f000001UL
-#endif
-
-#if 0
-#ifndef ISC_PLATFORM_HAVEIN6PKTINFO
-struct in6_pktinfo {
- struct in6_addr ipi6_addr; /* src/dst IPv6 address */
- unsigned int ipi6_ifindex; /* send/recv interface index */
-};
-#endif
-#endif
-
-/*
- * Cope with a missing in6addr_any and in6addr_loopback.
- */
-#if defined(ISC_PLATFORM_HAVEIPV6) && defined(ISC_PLATFORM_NEEDIN6ADDRANY)
-extern const struct in6_addr isc_net_in6addrany;
-#define in6addr_any isc_net_in6addrany
-#endif
-
-#if defined(ISC_PLATFORM_HAVEIPV6) && defined(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK)
-extern const struct in6_addr isc_net_in6addrloop;
-#define in6addr_loopback isc_net_in6addrloop
-#endif
-
-/*
- * Fix UnixWare 7.1.1's broken IN6_IS_ADDR_* definitions.
- */
-#ifdef ISC_PLATFORM_FIXIN6ISADDR
-#undef IN6_IS_ADDR_GEOGRAPHIC
-#define IN6_IS_ADDR_GEOGRAPHIC(a) (((a)->S6_un.S6_l[0] & 0xE0) == 0x80)
-#undef IN6_IS_ADDR_IPX
-#define IN6_IS_ADDR_IPX(a) (((a)->S6_un.S6_l[0] & 0xFE) == 0x04)
-#undef IN6_IS_ADDR_LINKLOCAL
-#define IN6_IS_ADDR_LINKLOCAL(a) (((a)->S6_un.S6_l[0] & 0xC0FF) == 0x80FE)
-#undef IN6_IS_ADDR_MULTICAST
-#define IN6_IS_ADDR_MULTICAST(a) (((a)->S6_un.S6_l[0] & 0xFF) == 0xFF)
-#undef IN6_IS_ADDR_NSAP
-#define IN6_IS_ADDR_NSAP(a) (((a)->S6_un.S6_l[0] & 0xFE) == 0x02)
-#undef IN6_IS_ADDR_PROVIDER
-#define IN6_IS_ADDR_PROVIDER(a) (((a)->S6_un.S6_l[0] & 0xE0) == 0x40)
-#undef IN6_IS_ADDR_SITELOCAL
-#define IN6_IS_ADDR_SITELOCAL(a) (((a)->S6_un.S6_l[0] & 0xC0FF) == 0xC0FE)
-#endif /* ISC_PLATFORM_FIXIN6ISADDR */
-
-/*
- * Ensure type in_port_t is defined.
- */
-#ifdef ISC_PLATFORM_NEEDPORTT
-typedef isc_uint16_t in_port_t;
-#endif
-
-/*
- * If this system does not have MSG_TRUNC (as returned from recvmsg())
- * ISC_PLATFORM_RECVOVERFLOW will be defined. This will enable the MSG_TRUNC
- * faking code in socket.c.
- */
-#ifndef MSG_TRUNC
-#define ISC_PLATFORM_RECVOVERFLOW
-#endif
-
-#define ISC__IPADDR(x) ((isc_uint32_t)htonl((isc_uint32_t)(x)))
-
-#define ISC_IPADDR_ISMULTICAST(i) \
- (((isc_uint32_t)(i) & ISC__IPADDR(0xf0000000)) \
- == ISC__IPADDR(0xe0000000))
-
-#define ISC_IPADDR_ISEXPERIMENTAL(i) \
- (((isc_uint32_t)(i) & ISC__IPADDR(0xf0000000)) \
- == ISC__IPADDR(0xf0000000))
-
-/***
- *** Functions.
- ***/
-
-ISC_LANG_BEGINDECLS
-
-isc_result_t
-isc_net_probeipv4(void);
-/*
- * Check if the system's kernel supports IPv4.
- *
- * Returns:
- *
- * ISC_R_SUCCESS IPv4 is supported.
- * ISC_R_NOTFOUND IPv4 is not supported.
- * ISC_R_DISABLED IPv4 is disabled.
- * ISC_R_UNEXPECTED
- */
-
-isc_result_t
-isc_net_probeipv6(void);
-/*
- * Check if the system's kernel supports IPv6.
- *
- * Returns:
- *
- * ISC_R_SUCCESS IPv6 is supported.
- * ISC_R_NOTFOUND IPv6 is not supported.
- * ISC_R_DISABLED IPv6 is disabled.
- * ISC_R_UNEXPECTED
- */
-
-isc_result_t
-isc_net_probe_ipv6only(void);
-/*
- * Check if the system's kernel supports the IPV6_V6ONLY socket option.
- *
- * Returns:
- *
- * ISC_R_SUCCESS the option is supported for both TCP and UDP.
- * ISC_R_NOTFOUND IPv6 itself or the option is not supported.
- * ISC_R_UNEXPECTED
- */
-
-isc_result_t
-isc_net_probe_ipv6pktinfo(void);
-/*
- * Check if the system's kernel supports the IPV6_(RECV)PKTINFO socket option
- * for UDP sockets.
- *
- * Returns:
- *
- * ISC_R_SUCCESS the option is supported.
- * ISC_R_NOTFOUND IPv6 itself or the option is not supported.
- * ISC_R_UNEXPECTED
- */
-
-void
-isc_net_disableipv4(void);
-
-void
-isc_net_disableipv6(void);
-
-void
-isc_net_enableipv4(void);
-
-void
-isc_net_enableipv6(void);
-
-#ifdef ISC_PLATFORM_NEEDNTOP
-const char *
-isc_net_ntop(int af, const void *src, char *dst, size_t size);
-#define inet_ntop isc_net_ntop
-#endif
-
-#ifdef ISC_PLATFORM_NEEDPTON
-int
-isc_net_pton(int af, const char *src, void *dst);
-#undef inet_pton
-#define inet_pton isc_net_pton
-#endif
-
-#ifdef ISC_PLATFORM_NEEDATON
-int
-isc_net_aton(const char *cp, struct in_addr *addr);
-#define inet_aton isc_net_aton
-#endif
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_NET_H */
diff --git a/freebsd-userspace/rtems/include/isc/netaddr.h b/freebsd-userspace/rtems/include/isc/netaddr.h
deleted file mode 100644
index e209a9fa..00000000
--- a/freebsd-userspace/rtems/include/isc/netaddr.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: netaddr.h,v 1.18.12.7 2004/03/08 09:04:52 marka Exp $ */
-
-#ifndef ISC_NETADDR_H
-#define ISC_NETADDR_H 1
-
-#include <isc/lang.h>
-#include <isc/net.h>
-#include <isc/types.h>
-
-ISC_LANG_BEGINDECLS
-
-struct isc_netaddr {
- unsigned int family;
- union {
- struct in_addr in;
- struct in6_addr in6;
- } type;
- isc_uint32_t zone;
-};
-
-isc_boolean_t
-isc_netaddr_equal(const isc_netaddr_t *a, const isc_netaddr_t *b);
-
-isc_boolean_t
-isc_netaddr_eqprefix(const isc_netaddr_t *a, const isc_netaddr_t *b,
- unsigned int prefixlen);
-/*
- * Compare the 'prefixlen' most significant bits of the network
- * addresses 'a' and 'b'. Return ISC_TRUE if they are equal,
- * ISC_FALSE if not.
- */
-
-isc_result_t
-isc_netaddr_masktoprefixlen(const isc_netaddr_t *s, unsigned int *lenp);
-/*
- * Convert a netmask in 's' into a prefix length in '*lenp'.
- * The mask should consist of zero or more '1' bits in the most
- * most significant part of the address, followed by '0' bits.
- * If this is not the case, ISC_R_MASKNONCONTIG is returned.
- *
- * Returns:
- * ISC_R_SUCCESS
- * ISC_R_MASKNONCONTIG
- */
-
-isc_result_t
-isc_netaddr_totext(const isc_netaddr_t *netaddr, isc_buffer_t *target);
-/*
- * Append a text representation of 'sockaddr' to the buffer 'target'.
- * The text is NOT null terminated. Handles IPv4 and IPv6 addresses.
- *
- * Returns:
- * ISC_R_SUCCESS
- * ISC_R_NOSPACE The text or the null termination did not fit.
- * ISC_R_FAILURE Unspecified failure
- */
-
-void
-isc_netaddr_format(const isc_netaddr_t *na, char *array, unsigned int size);
-/*
- * Format a human-readable representation of the network address '*na'
- * into the character array 'array', which is of size 'size'.
- * The resulting string is guaranteed to be null-terminated.
- */
-
-#define ISC_NETADDR_FORMATSIZE \
- sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:XXX.XXX.XXX.XXX")
-/*
- * Minimum size of array to pass to isc_netaddr_format().
- */
-
-void
-isc_netaddr_fromsockaddr(isc_netaddr_t *netaddr, const isc_sockaddr_t *source);
-
-void
-isc_netaddr_fromin(isc_netaddr_t *netaddr, const struct in_addr *ina);
-
-void
-isc_netaddr_fromin6(isc_netaddr_t *netaddr, const struct in6_addr *ina6);
-
-void
-isc_netaddr_setzone(isc_netaddr_t *netaddr, isc_uint32_t zone);
-
-isc_uint32_t
-isc_netaddr_getzone(const isc_netaddr_t *netaddr);
-
-void
-isc_netaddr_any(isc_netaddr_t *netaddr);
-/*
- * Return the IPv4 wildcard address.
- */
-
-void
-isc_netaddr_any6(isc_netaddr_t *netaddr);
-/*
- * Return the IPv6 wildcard address.
- */
-
-isc_boolean_t
-isc_netaddr_ismulticast(isc_netaddr_t *na);
-/*
- * Returns ISC_TRUE if the address is a multicast address.
- */
-
-isc_boolean_t
-isc_netaddr_isexperimental(isc_netaddr_t *na);
-/*
- * Returns ISC_TRUE if the address is a experimental (CLASS E) address.
- */
-
-isc_boolean_t
-isc_netaddr_islinklocal(isc_netaddr_t *na);
-/*
- * Returns ISC_TRUE if the address is a link local address.
- */
-
-isc_boolean_t
-isc_netaddr_issitelocal(isc_netaddr_t *na);
-/*
- * Returns ISC_TRUE if the address is a site local address.
- */
-
-void
-isc_netaddr_fromv4mapped(isc_netaddr_t *t, const isc_netaddr_t *s);
-/*
- * Convert an IPv6 v4mapped address into an IPv4 address.
- */
-
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_NETADDR_H */
diff --git a/freebsd-userspace/rtems/include/isc/netscope.h b/freebsd-userspace/rtems/include/isc/netscope.h
deleted file mode 100644
index 7cc0f182..00000000
--- a/freebsd-userspace/rtems/include/isc/netscope.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: netscope.h,v 1.4.142.5 2004/03/08 09:04:52 marka Exp $ */
-
-#ifndef ISC_NETSCOPE_H
-#define ISC_NETSCOPE_H 1
-
-ISC_LANG_BEGINDECLS
-
-/*
- * Convert a string of an IPv6 scope zone to zone index. If the conversion
- * succeeds, 'zoneid' will store the index value.
- * XXXJT: when a standard interface for this purpose is defined,
- * we should use it.
- *
- * Returns:
- * ISC_R_SUCCESS: conversion succeeds
- * ISC_R_FAILURE: conversion fails
- */
-isc_result_t
-isc_netscope_pton(int af, char *scopename, void *addr, isc_uint32_t *zoneid);
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_NETADDR_H */
diff --git a/freebsd-userspace/rtems/include/isc/offset.h b/freebsd-userspace/rtems/include/isc/offset.h
deleted file mode 100644
index 709bde4e..00000000
--- a/freebsd-userspace/rtems/include/isc/offset.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: offset.h,v 1.10 2001/01/09 21:58:43 bwelling Exp $ */
-
-#ifndef ISC_OFFSET_H
-#define ISC_OFFSET_H 1
-
-/*
- * File offsets are operating-system dependent.
- */
-#include <limits.h> /* Required for CHAR_BIT. */
-#include <sys/types.h>
-
-typedef off_t isc_offset_t;
-
-/*
- * POSIX says "Additionally, blkcnt_t and off_t are extended signed integral
- * types", so the maximum value is all 1s except for the high bit.
- * This definition is more complex than it really needs to be because it was
- * crafted to keep both the SunOS 5.6 and the HP/UX 11 compilers quiet about
- * integer overflow. For example, though this is equivalent to just left
- * shifting 1 to the high bit and then inverting the bits, the SunOS compiler
- * is unhappy about shifting a positive "1" to negative in a signed integer.
- */
-#define ISC_OFFSET_MAXIMUM \
- (~(((off_t)-1 >> (sizeof(off_t) * CHAR_BIT - 1)) \
- << (sizeof(off_t) * CHAR_BIT - 1)))
-
-#endif /* ISC_OFFSET_H */
diff --git a/freebsd-userspace/rtems/include/isc/once.h b/freebsd-userspace/rtems/include/isc/once.h
deleted file mode 100644
index f57d6215..00000000
--- a/freebsd-userspace/rtems/include/isc/once.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: once.h,v 1.3 2001/01/09 21:57:56 bwelling Exp $ */
-
-#ifndef ISC_ONCE_H
-#define ISC_ONCE_H 1
-
-#include <isc/result.h>
-
-typedef isc_boolean_t isc_once_t;
-
-#define ISC_ONCE_INIT ISC_FALSE
-
-#define isc_once_do(op, f) \
- (!*(op) ? (f(), *(op) = ISC_TRUE, ISC_R_SUCCESS) : ISC_R_SUCCESS)
-
-#endif /* ISC_ONCE_H */
diff --git a/freebsd-userspace/rtems/include/isc/print.h b/freebsd-userspace/rtems/include/isc/print.h
deleted file mode 100644
index 7a1bc83b..00000000
--- a/freebsd-userspace/rtems/include/isc/print.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: print.h,v 1.17 2001/02/27 02:19:33 gson Exp $ */
-
-#ifndef ISC_PRINT_H
-#define ISC_PRINT_H 1
-
-/***
- *** Imports
- ***/
-
-#include <isc/formatcheck.h> /* Required for ISC_FORMAT_PRINTF() macro. */
-#include <isc/lang.h>
-#include <isc/platform.h>
-
-/*
- * This block allows lib/isc/print.c to be cleanly compiled even if
- * the platform does not need it. The standard Makefile will still
- * not compile print.c or archive print.o, so this is just to make test
- * compilation ("make print.o") easier.
- */
-#if !defined(ISC_PLATFORM_NEEDVSNPRINTF) && defined(ISC__PRINT_SOURCE)
-#define ISC_PLATFORM_NEEDVSNPRINTF
-#endif
-
-/***
- *** Macros
- ***/
-#define ISC_PRINT_QUADFORMAT ISC_PLATFORM_QUADFORMAT
-
-/***
- *** Functions
- ***/
-
-#ifdef ISC_PLATFORM_NEEDVSNPRINTF
-#include <stdarg.h>
-#include <stddef.h>
-
-ISC_LANG_BEGINDECLS
-
-int
-isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap)
- ISC_FORMAT_PRINTF(3, 0);
-#define vsnprintf isc_print_vsnprintf
-
-int
-isc_print_snprintf(char *str, size_t size, const char *format, ...)
- ISC_FORMAT_PRINTF(3, 4);
-#define snprintf isc_print_snprintf
-
-ISC_LANG_ENDDECLS
-#endif /* ISC_PLATFORM_NEEDVSNPRINTF */
-
-#endif /* ISC_PRINT_H */
diff --git a/freebsd-userspace/rtems/include/isc/region.h b/freebsd-userspace/rtems/include/isc/region.h
deleted file mode 100644
index 5622394a..00000000
--- a/freebsd-userspace/rtems/include/isc/region.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: region.h,v 1.16.12.3 2004/03/08 09:04:53 marka Exp $ */
-
-#ifndef ISC_REGION_H
-#define ISC_REGION_H 1
-
-#include <isc/types.h>
-
-struct isc_region {
- unsigned char * base;
- unsigned int length;
-};
-
-struct isc_textregion {
- char * base;
- unsigned int length;
-};
-
-/* XXXDCL questionable ... bears discussion. we have been putting off
- * discussing the region api.
- */
-struct isc_constregion {
- const void * base;
- unsigned int length;
-};
-
-struct isc_consttextregion {
- const char * base;
- unsigned int length;
-};
-
-/*
- * The region structure is not opaque, and is usually directly manipulated.
- * Some macros are defined below for convenience.
- */
-
-#define isc_region_consume(r,l) \
- do { \
- isc_region_t *_r = (r); \
- unsigned int _l = (l); \
- INSIST(_r->length >= _l); \
- _r->base += _l; \
- _r->length -= _l; \
- } while (0)
-
-#define isc_textregion_consume(r,l) \
- do { \
- isc_textregion_t *_r = (r); \
- unsigned int _l = (l); \
- INSIST(_r->length >= _l); \
- _r->base += _l; \
- _r->length -= _l; \
- } while (0)
-
-#define isc_constregion_consume(r,l) \
- do { \
- isc_constregion_t *_r = (r); \
- unsigned int _l = (l); \
- INSIST(_r->length >= _l); \
- _r->base += _l; \
- _r->length -= _l; \
- } while (0)
-
-int
-isc_region_compare(isc_region_t *r1, isc_region_t *r2);
-/*
- * Compares the contents of two regions
- *
- * Requires:
- * 'r1' is a valid region
- * 'r2' is a valid region
- *
- * Returns:
- * < 0 if r1 is lexicographically less than r2
- * = 0 if r1 is lexicographically identical to r2
- * > 0 if r1 is lexicographically greater than r2
- */
-
-#endif /* ISC_REGION_H */
diff --git a/freebsd-userspace/rtems/include/isc/result.h b/freebsd-userspace/rtems/include/isc/result.h
deleted file mode 100644
index 93f7cefb..00000000
--- a/freebsd-userspace/rtems/include/isc/result.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1998-2001, 2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: result.h,v 1.57.2.2.8.5 2004/05/15 03:46:13 jinmei Exp $ */
-
-#ifndef ISC_RESULT_H
-#define ISC_RESULT_H 1
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-#define ISC_R_SUCCESS 0 /* success */
-#define ISC_R_NOMEMORY 1 /* out of memory */
-#define ISC_R_TIMEDOUT 2 /* timed out */
-#define ISC_R_NOTHREADS 3 /* no available threads */
-#define ISC_R_ADDRNOTAVAIL 4 /* address not available */
-#define ISC_R_ADDRINUSE 5 /* address in use */
-#define ISC_R_NOPERM 6 /* permission denied */
-#define ISC_R_NOCONN 7 /* no pending connections */
-#define ISC_R_NETUNREACH 8 /* network unreachable */
-#define ISC_R_HOSTUNREACH 9 /* host unreachable */
-#define ISC_R_NETDOWN 10 /* network down */
-#define ISC_R_HOSTDOWN 11 /* host down */
-#define ISC_R_CONNREFUSED 12 /* connection refused */
-#define ISC_R_NORESOURCES 13 /* not enough free resources */
-#define ISC_R_EOF 14 /* end of file */
-#define ISC_R_BOUND 15 /* socket already bound */
-#define ISC_R_RELOAD 16 /* reload */
-#define ISC_R_LOCKBUSY 17 /* lock busy */
-#define ISC_R_EXISTS 18 /* already exists */
-#define ISC_R_NOSPACE 19 /* ran out of space */
-#define ISC_R_CANCELED 20 /* operation canceled */
-#define ISC_R_NOTBOUND 21 /* socket is not bound */
-#define ISC_R_SHUTTINGDOWN 22 /* shutting down */
-#define ISC_R_NOTFOUND 23 /* not found */
-#define ISC_R_UNEXPECTEDEND 24 /* unexpected end of input */
-#define ISC_R_FAILURE 25 /* generic failure */
-#define ISC_R_IOERROR 26 /* I/O error */
-#define ISC_R_NOTIMPLEMENTED 27 /* not implemented */
-#define ISC_R_UNBALANCED 28 /* unbalanced parentheses */
-#define ISC_R_NOMORE 29 /* no more */
-#define ISC_R_INVALIDFILE 30 /* invalid file */
-#define ISC_R_BADBASE64 31 /* bad base64 encoding */
-#define ISC_R_UNEXPECTEDTOKEN 32 /* unexpected token */
-#define ISC_R_QUOTA 33 /* quota reached */
-#define ISC_R_UNEXPECTED 34 /* unexpected error */
-#define ISC_R_ALREADYRUNNING 35 /* already running */
-#define ISC_R_IGNORE 36 /* ignore */
-#define ISC_R_MASKNONCONTIG 37 /* addr mask not contiguous */
-#define ISC_R_FILENOTFOUND 38 /* file not found */
-#define ISC_R_FILEEXISTS 39 /* file already exists */
-#define ISC_R_NOTCONNECTED 40 /* socket is not connected */
-#define ISC_R_RANGE 41 /* out of range */
-#define ISC_R_NOENTROPY 42 /* out of entropy */
-#define ISC_R_MULTICAST 43 /* invalid use of multicast */
-#define ISC_R_NOTFILE 44 /* not a file */
-#define ISC_R_NOTDIRECTORY 45 /* not a directory */
-#define ISC_R_QUEUEFULL 46 /* queue is full */
-#define ISC_R_FAMILYMISMATCH 47 /* address family mismatch */
-#define ISC_R_FAMILYNOSUPPORT 48 /* AF not supported */
-#define ISC_R_BADHEX 49 /* bad hex encoding */
-#define ISC_R_TOOMANYOPENFILES 50 /* too many open files */
-#define ISC_R_NOTBLOCKING 51 /* not blocking */
-#define ISC_R_UNBALANCEDQUOTES 52 /* unbalanced quotes */
-#define ISC_R_INPROGRESS 53 /* operation in progress */
-#define ISC_R_CONNECTIONRESET 54 /* connection reset */
-#define ISC_R_SOFTQUOTA 55 /* soft quota reached */
-#define ISC_R_BADNUMBER 56 /* not a valid number */
-#define ISC_R_DISABLED 57 /* disabled */
-#define ISC_R_MAXSIZE 58 /* max size */
-#define ISC_R_BADADDRESSFORM 59 /* invalid address format */
-
-/*
- * Not a result code: the number of results.
- */
-#define ISC_R_NRESULTS 60
-
-ISC_LANG_BEGINDECLS
-
-const char *
-isc_result_totext(isc_result_t);
-/*
- * Convert an isc_result_t into a string message describing the result.
- */
-
-isc_result_t
-isc_result_register(unsigned int base, unsigned int nresults,
- const char **text, isc_msgcat_t *msgcat, int set);
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_RESULT_H */
diff --git a/freebsd-userspace/rtems/include/isc/sockaddr.h b/freebsd-userspace/rtems/include/isc/sockaddr.h
deleted file mode 100644
index 635af381..00000000
--- a/freebsd-userspace/rtems/include/isc/sockaddr.h
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Copyright (C) 1998-2002 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: sockaddr.h,v 1.39 2002/04/03 06:38:36 marka Exp $ */
-
-#ifndef ISC_SOCKADDR_H
-#define ISC_SOCKADDR_H 1
-
-#include <isc/lang.h>
-#include <isc/net.h>
-#include <isc/types.h>
-
-struct isc_sockaddr {
- union {
- struct sockaddr sa;
- struct sockaddr_in sin;
- struct sockaddr_in6 sin6;
- } type;
- unsigned int length; /* XXXRTH beginning? */
- ISC_LINK(struct isc_sockaddr) link;
-};
-
-typedef ISC_LIST(struct isc_sockaddr) isc_sockaddrlist_t;
-
-ISC_LANG_BEGINDECLS
-
-isc_boolean_t
-isc_sockaddr_equal(const isc_sockaddr_t *a, const isc_sockaddr_t *b);
-/*
- * Return ISC_TRUE iff the socket addresses 'a' and 'b' are equal.
- */
-
-isc_boolean_t
-isc_sockaddr_eqaddr(const isc_sockaddr_t *a, const isc_sockaddr_t *b);
-/*
- * Return ISC_TRUE iff the address parts of the socket addresses
- * 'a' and 'b' are equal, ignoring the ports.
- */
-
-isc_boolean_t
-isc_sockaddr_eqaddrprefix(const isc_sockaddr_t *a, const isc_sockaddr_t *b,
- unsigned int prefixlen);
-/*
- * Return ISC_TRUE iff the most significant 'prefixlen' bits of the
- * socket addresses 'a' and 'b' are equal, ignoring the ports.
- */
-
-unsigned int
-isc_sockaddr_hash(const isc_sockaddr_t *sockaddr, isc_boolean_t address_only);
-/*
- * Return a hash value for the socket address 'sockaddr'. If 'address_only'
- * is ISC_TRUE, the hash value will not depend on the port.
- *
- * IPv6 addresses containing mapped IPv4 addresses generate the same hash
- * value as the equivalent IPv4 address.
- */
-
-void
-isc_sockaddr_any(isc_sockaddr_t *sockaddr);
-/*
- * Return the IPv4 wildcard address.
- */
-
-void
-isc_sockaddr_any6(isc_sockaddr_t *sockaddr);
-/*
- * Return the IPv6 wildcard address.
- */
-
-void
-isc_sockaddr_anyofpf(isc_sockaddr_t *sockaddr, int family);
-/*
- * Set '*sockaddr' to the wildcard address of protocol family
- * 'family'.
- *
- * Requires:
- * 'family' is AF_INET or AF_INET6.
- */
-
-void
-isc_sockaddr_fromin(isc_sockaddr_t *sockaddr, const struct in_addr *ina,
- in_port_t port);
-/*
- * Construct an isc_sockaddr_t from an IPv4 address and port.
- */
-
-void
-isc_sockaddr_fromin6(isc_sockaddr_t *sockaddr, const struct in6_addr *ina6,
- in_port_t port);
-/*
- * Construct an isc_sockaddr_t from an IPv6 address and port.
- */
-
-void
-isc_sockaddr_v6fromin(isc_sockaddr_t *sockaddr, const struct in_addr *ina,
- in_port_t port);
-/*
- * Construct an IPv6 isc_sockaddr_t representing a mapped IPv4 address.
- */
-
-void
-isc_sockaddr_fromnetaddr(isc_sockaddr_t *sockaddr, const isc_netaddr_t *na,
- in_port_t port);
-/*
- * Construct an isc_sockaddr_t from an isc_netaddr_t and port.
- */
-
-int
-isc_sockaddr_pf(const isc_sockaddr_t *sockaddr);
-/*
- * Get the protocol family of 'sockaddr'.
- *
- * Requires:
- *
- * 'sockaddr' is a valid sockaddr with an address family of AF_INET
- * or AF_INET6.
- *
- * Returns:
- *
- * The protocol family of 'sockaddr', e.g. PF_INET or PF_INET6.
- */
-
-void
-isc_sockaddr_setport(isc_sockaddr_t *sockaddr, in_port_t port);
-/*
- * Set the port of 'sockaddr' to 'port'.
- */
-
-in_port_t
-isc_sockaddr_getport(isc_sockaddr_t *sockaddr);
-/*
- * Get the port stored in 'sockaddr'.
- */
-
-isc_result_t
-isc_sockaddr_totext(const isc_sockaddr_t *sockaddr, isc_buffer_t *target);
-/*
- * Append a text representation of 'sockaddr' to the buffer 'target'.
- * The text will include both the IP address (v4 or v6) and the port.
- * The text is null terminated, but the terminating null is not
- * part of the buffer's used region.
- *
- * Returns:
- * ISC_R_SUCCESS
- * ISC_R_NOSPACE The text or the null termination did not fit.
- */
-
-void
-isc_sockaddr_format(const isc_sockaddr_t *sa, char *array, unsigned int size);
-/*
- * Format a human-readable representation of the socket address '*sa'
- * into the character array 'array', which is of size 'size'.
- * The resulting string is guaranteed to be null-terminated.
- */
-
-isc_boolean_t
-isc_sockaddr_ismulticast(isc_sockaddr_t *sa);
-/*
- * Returns ISC_TRUE if the address is a multicast address.
- */
-
-isc_boolean_t
-isc_sockaddr_isexperimental(isc_sockaddr_t *sa);
-/*
- * Returns ISC_TRUE if the address is a experimental (CLASS E) address.
- */
-
-isc_boolean_t
-isc_sockaddr_islinklocal(isc_sockaddr_t *sa);
-/*
- * Returns ISC_TRUE if the address is a link local addresss.
- */
-
-isc_boolean_t
-isc_sockaddr_issitelocal(isc_sockaddr_t *sa);
-/*
- * Returns ISC_TRUE if the address is a sitelocal address.
- */
-
-#define ISC_SOCKADDR_FORMATSIZE \
- sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:XXX.XXX.XXX.XXX#YYYYY")
-/*
- * Minimum size of array to pass to isc_sockaddr_format().
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_SOCKADDR_H */
diff --git a/freebsd-userspace/rtems/include/isc/strerror.h b/freebsd-userspace/rtems/include/isc/strerror.h
deleted file mode 100644
index ca428af9..00000000
--- a/freebsd-userspace/rtems/include/isc/strerror.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: strerror.h,v 1.3 2001/11/20 01:45:47 gson Exp $ */
-
-#ifndef ISC_STRERROR_H
-#define ISC_STRERROR_H
-
-#include <sys/types.h>
-
-#include <isc/lang.h>
-
-ISC_LANG_BEGINDECLS
-
-#define ISC_STRERRORSIZE 128
-
-/*
- * Provide a thread safe wrapper to strerrror().
- *
- * Requires:
- * 'buf' to be non NULL.
- */
-void
-isc__strerror(int num, char *buf, size_t bufsize);
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_STRERROR_H */
diff --git a/freebsd-userspace/rtems/include/isc/string.h b/freebsd-userspace/rtems/include/isc/string.h
deleted file mode 100644
index e16219fd..00000000
--- a/freebsd-userspace/rtems/include/isc/string.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2000, 2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: string.h,v 1.9 2001/01/09 21:57:37 bwelling Exp $ */
-
-#ifndef ISC_STRING_H
-#define ISC_STRING_H 1
-
-#include <string.h>
-
-#include <isc/int.h>
-#include <isc/lang.h>
-#include <isc/platform.h>
-
-ISC_LANG_BEGINDECLS
-
-isc_uint64_t
-isc_string_touint64(char *source, char **endp, int base);
-/*
- * Convert the string pointed to by 'source' to isc_uint64_t.
- *
- * On successful conversion 'endp' points to the first character
- * after conversion is complete.
- *
- * 'base': 0 or 2..36
- *
- * If base is 0 the base is computed from the string type.
- *
- * On error 'endp' points to 'source'.
- */
-
-
-char *
-isc_string_separate(char **stringp, const char *delim);
-
-#ifdef ISC_PLATFORM_NEEDSTRSEP
-#define strsep isc_string_separate
-#endif
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_STRING_H */
diff --git a/freebsd-userspace/rtems/include/isc/types.h b/freebsd-userspace/rtems/include/isc/types.h
deleted file mode 100644
index b30f55ee..00000000
--- a/freebsd-userspace/rtems/include/isc/types.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: types.h,v 1.33 2002/07/19 03:39:44 marka Exp $ */
-
-#ifndef ISC_TYPES_H
-#define ISC_TYPES_H 1
-
-/*
- * OS-specific types, from the OS-specific include directories.
- */
-#include <isc/int.h>
-#include <isc/offset.h>
-
-/*
- * XXXDCL should isc_boolean_t be moved here, requiring an explicit include
- * of <isc/boolean.h> when ISC_TRUE/ISC_FALSE/ISC_TF() are desired?
- */
-#include <isc/boolean.h>
-/*
- * XXXDCL This is just for ISC_LIST and ISC_LINK, but gets all of the other
- * list macros too.
- */
-#include <isc/list.h>
-
-/***
- *** Core Types. Alphabetized by defined type.
- ***/
-
-typedef struct isc_bitstring isc_bitstring_t;
-typedef struct isc_buffer isc_buffer_t;
-typedef ISC_LIST(isc_buffer_t) isc_bufferlist_t;
-typedef struct isc_constregion isc_constregion_t;
-typedef struct isc_consttextregion isc_consttextregion_t;
-typedef struct isc_entropy isc_entropy_t;
-typedef struct isc_entropysource isc_entropysource_t;
-typedef struct isc_event isc_event_t;
-typedef ISC_LIST(isc_event_t) isc_eventlist_t;
-typedef unsigned int isc_eventtype_t;
-typedef isc_uint32_t isc_fsaccess_t;
-typedef struct isc_interface isc_interface_t;
-typedef struct isc_interfaceiter isc_interfaceiter_t;
-typedef struct isc_interval isc_interval_t;
-typedef struct isc_lex isc_lex_t;
-typedef struct isc_log isc_log_t;
-typedef struct isc_logcategory isc_logcategory_t;
-typedef struct isc_logconfig isc_logconfig_t;
-typedef struct isc_logmodule isc_logmodule_t;
-typedef struct isc_mem isc_mem_t;
-typedef struct isc_mempool isc_mempool_t;
-typedef struct isc_msgcat isc_msgcat_t;
-typedef struct isc_ondestroy isc_ondestroy_t;
-typedef struct isc_netaddr isc_netaddr_t;
-typedef struct isc_quota isc_quota_t;
-typedef struct isc_random isc_random_t;
-typedef struct isc_ratelimiter isc_ratelimiter_t;
-typedef struct isc_region isc_region_t;
-typedef isc_uint64_t isc_resourcevalue_t;
-typedef unsigned int isc_result_t;
-typedef struct isc_rwlock isc_rwlock_t;
-typedef struct isc_sockaddr isc_sockaddr_t;
-typedef struct isc_socket isc_socket_t;
-typedef struct isc_socketevent isc_socketevent_t;
-typedef struct isc_socketmgr isc_socketmgr_t;
-typedef struct isc_symtab isc_symtab_t;
-typedef struct isc_task isc_task_t;
-typedef ISC_LIST(isc_task_t) isc_tasklist_t;
-typedef struct isc_taskmgr isc_taskmgr_t;
-typedef struct isc_textregion isc_textregion_t;
-typedef struct isc_time isc_time_t;
-typedef struct isc_timer isc_timer_t;
-typedef struct isc_timermgr isc_timermgr_t;
-
-typedef void (*isc_taskaction_t)(isc_task_t *, isc_event_t *);
-
-typedef enum {
- isc_resource_coresize = 1,
- isc_resource_cputime,
- isc_resource_datasize,
- isc_resource_filesize,
- isc_resource_lockedmemory,
- isc_resource_openfiles,
- isc_resource_processes,
- isc_resource_residentsize,
- isc_resource_stacksize
-} isc_resource_t;
-
-#endif /* ISC_TYPES_H */
diff --git a/freebsd-userspace/rtems/include/isc/util.h b/freebsd-userspace/rtems/include/isc/util.h
deleted file mode 100644
index 6144e11b..00000000
--- a/freebsd-userspace/rtems/include/isc/util.h
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Copyright (C) 1998-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: util.h,v 1.23 2001/11/30 01:59:38 gson Exp $ */
-
-#ifndef ISC_UTIL_H
-#define ISC_UTIL_H 1
-
-/*
- * NOTE:
- *
- * This file is not to be included from any <isc/???.h> (or other) library
- * files.
- *
- * Including this file puts several macros in your name space that are
- * not protected (as all the other ISC functions/macros do) by prepending
- * ISC_ or isc_ to the name.
- */
-
-/***
- *** General Macros.
- ***/
-
-/*
- * Use this to hide unused function arguments.
- *
- * int
- * foo(char *bar)
- * {
- * UNUSED(bar);
- * }
- */
-#define UNUSED(x) (void)(x)
-
-#define ISC_MAX(a, b) ((a) > (b) ? (a) : (b))
-#define ISC_MIN(a, b) ((a) < (b) ? (a) : (b))
-
-/*
- * Use this to remove the const qualifier of a variable to assign it to
- * a non-const variable or pass it as a non-const function argument ...
- * but only when you are sure it won't then be changed!
- * This is necessary to sometimes shut up some compilers
- * (as with gcc -Wcast-qual) when there is just no other good way to avoid the
- * situation.
- */
-#define DE_CONST(konst, var) \
- do { \
- union { const void *k; void *v; } _u; \
- _u.k = konst; \
- var = _u.v; \
- } while (0)
-
-/*
- * Use this in translation units that would otherwise be empty, to
- * suppress compiler warnings.
- */
-#define EMPTY_TRANSLATION_UNIT static void isc__empty(void) { isc__empty(); }
-
-/*
- * We use macros instead of calling the routines directly because
- * the capital letters make the locking stand out.
- *
- * We RUNTIME_CHECK for success since in general there's no way
- * for us to continue if they fail.
- */
-
-#ifdef ISC_UTIL_TRACEON
-#define ISC_UTIL_TRACE(a) a
-#include <stdio.h> /* Required for fprintf/stderr when tracing. */
-#include <isc/msgs.h> /* Required for isc_msgcat when tracing. */
-#else
-#define ISC_UTIL_TRACE(a)
-#endif
-
-#include <isc/result.h> /* Contractual promise. */
-
-#define LOCK(lp) do { \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_LOCKING, "LOCKING"), \
- (lp), __FILE__, __LINE__)); \
- RUNTIME_CHECK(isc_mutex_lock((lp)) == ISC_R_SUCCESS); \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_LOCKED, "LOCKED"), \
- (lp), __FILE__, __LINE__)); \
- } while (0)
-#define UNLOCK(lp) do { \
- RUNTIME_CHECK(isc_mutex_unlock((lp)) == ISC_R_SUCCESS); \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_UNLOCKED, "UNLOCKED"), \
- (lp), __FILE__, __LINE__)); \
- } while (0)
-#define ISLOCKED(lp) (1)
-#define DESTROYLOCK(lp) \
- RUNTIME_CHECK(isc_mutex_destroy((lp)) == ISC_R_SUCCESS)
-
-
-#define BROADCAST(cvp) do { \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_BROADCAST, "BROADCAST"),\
- (cvp), __FILE__, __LINE__)); \
- RUNTIME_CHECK(isc_condition_broadcast((cvp)) == ISC_R_SUCCESS); \
- } while (0)
-#define SIGNAL(cvp) do { \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_SIGNAL, "SIGNAL"), \
- (cvp), __FILE__, __LINE__)); \
- RUNTIME_CHECK(isc_condition_signal((cvp)) == ISC_R_SUCCESS); \
- } while (0)
-#define WAIT(cvp, lp) do { \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %p %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_UTILWAIT, "WAIT"), \
- (cvp), \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_LOCK, "LOCK"), \
- (lp), __FILE__, __LINE__)); \
- RUNTIME_CHECK(isc_condition_wait((cvp), (lp)) == ISC_R_SUCCESS); \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %p %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_WAITED, "WAITED"), \
- (cvp), \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_LOCKED, "LOCKED"), \
- (lp), __FILE__, __LINE__)); \
- } while (0)
-
-/*
- * isc_condition_waituntil can return ISC_R_TIMEDOUT, so we
- * don't RUNTIME_CHECK the result.
- *
- * XXX Also, can't really debug this then...
- */
-
-#define WAITUNTIL(cvp, lp, tp) \
- isc_condition_waituntil((cvp), (lp), (tp))
-
-#define RWLOCK(lp, t) do { \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p, %d %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_RWLOCK, "RWLOCK"), \
- (lp), (t), __FILE__, __LINE__)); \
- RUNTIME_CHECK(isc_rwlock_lock((lp), (t)) == ISC_R_SUCCESS); \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p, %d %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_RWLOCKED, "RWLOCKED"), \
- (lp), (t), __FILE__, __LINE__)); \
- } while (0)
-#define RWUNLOCK(lp, t) do { \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p, %d %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_RWUNLOCK, "RWUNLOCK"), \
- (lp), (t), __FILE__, __LINE__)); \
- RUNTIME_CHECK(isc_rwlock_unlock((lp), (t)) == ISC_R_SUCCESS); \
- } while (0)
-
-#define DESTROYMUTEXBLOCK(bp, n) \
- RUNTIME_CHECK(isc_mutexblock_destroy((bp), (n)) == ISC_R_SUCCESS)
-
-/*
- * List Macros.
- */
-#include <isc/list.h> /* Contractual promise. */
-
-#define LIST(type) ISC_LIST(type)
-#define INIT_LIST(type) ISC_LIST_INIT(type)
-#define LINK(type) ISC_LINK(type)
-#define INIT_LINK(elt, link) ISC_LINK_INIT(elt, link)
-#define HEAD(list) ISC_LIST_HEAD(list)
-#define TAIL(list) ISC_LIST_TAIL(list)
-#define EMPTY(list) ISC_LIST_EMPTY(list)
-#define PREV(elt, link) ISC_LIST_PREV(elt, link)
-#define NEXT(elt, link) ISC_LIST_NEXT(elt, link)
-#define APPEND(list, elt, link) ISC_LIST_APPEND(list, elt, link)
-#define PREPEND(list, elt, link) ISC_LIST_PREPEND(list, elt, link)
-#define UNLINK(list, elt, link) ISC_LIST_UNLINK(list, elt, link)
-#define ENQUEUE(list, elt, link) ISC_LIST_APPEND(list, elt, link)
-#define DEQUEUE(list, elt, link) ISC_LIST_UNLINK(list, elt, link)
-#define INSERTBEFORE(li, b, e, ln) ISC_LIST_INSERTBEFORE(li, b, e, ln)
-#define INSERTAFTER(li, a, e, ln) ISC_LIST_INSERTAFTER(li, a, e, ln)
-#define APPENDLIST(list1, list2, link) ISC_LIST_APPENDLIST(list1, list2, link)
-
-/*
- * Assertions
- */
-#include <isc/assertions.h> /* Contractual promise. */
-
-#define REQUIRE(e) ISC_REQUIRE(e)
-#define ENSURE(e) ISC_ENSURE(e)
-#define INSIST(e) ISC_INSIST(e)
-#define INVARIANT(e) ISC_INVARIANT(e)
-
-/*
- * Errors
- */
-#include <isc/error.h> /* Contractual promise. */
-
-#define UNEXPECTED_ERROR isc_error_unexpected
-#define FATAL_ERROR isc_error_fatal
-#define RUNTIME_CHECK(cond) ISC_ERROR_RUNTIMECHECK(cond)
-
-/*
- * Time
- */
-#define TIME_NOW(tp) RUNTIME_CHECK(isc_time_now((tp)) == ISC_R_SUCCESS)
-
-#endif /* ISC_UTIL_H */
diff --git a/freebsd-userspace/rtems/include/pthread_private.h b/freebsd-userspace/rtems/include/pthread_private.h
deleted file mode 100644
index ce5ba6d8..00000000
--- a/freebsd-userspace/rtems/include/pthread_private.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Private thread definitions for the uthread kernel.
- *
- * $FreeBSD$
- */
-
-#ifndef _PTHREAD_PRIVATE_H
-#define _PTHREAD_PRIVATE_H
-
-/*
- * Evaluate the storage class specifier.
- */
-#ifdef GLOBAL_PTHREAD_PRIVATE
-#define SCLASS
-#else
-#define SCLASS extern
-#endif
-
-/*
- * Include files.
- */
-#include <setjmp.h>
-#include <signal.h>
-#include <stdio.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/cdefs.h>
-#include <sched.h>
-#include <spinlock.h>
-#include <pthread_np.h>
-#include <freebsd/sys/malloc.h>
-
-/*
- * Define a thread-safe macro to get the current time of day
- * which is updated at regular intervals by the scheduling signal
- * handler.
- */
-#define GET_CURRENT_TOD(tv) \
- do { \
- tv.tv_sec = _sched_tod.tv_sec; \
- tv.tv_usec = _sched_tod.tv_usec; \
- } while (tv.tv_sec != _sched_tod.tv_sec)
-
-
-/*
- * rtems uses the following structure to allow the method
- * _thread_kern_sched_state to be called. This function
- * is stubbed out to cause a processor yeild.
- */
-
-/*
- * Thread states.
- */
-enum pthread_state {
-#if 0
- PS_RUNNING,
- PS_SIGTHREAD,
- PS_MUTEX_WAIT,
- PS_COND_WAIT,
- PS_FDLR_WAIT,
- PS_FDLW_WAIT,
- PS_FDR_WAIT,
- PS_FDW_WAIT,
- PS_FILE_WAIT,
- PS_POLL_WAIT,
-#endif
- PS_SELECT_WAIT,
-#if 0
- PS_SLEEP_WAIT,
- PS_WAIT_WAIT,
- PS_SIGSUSPEND,
- PS_SIGWAIT,
- PS_SPINBLOCK,
- PS_JOIN,
- PS_SUSPENDED,
- PS_DEAD,
- PS_DEADLOCK,
-#endif
- PS_STATE_MAX
-};
-
-struct pthread_poll_data {
- int nfds;
- struct pollfd *fds;
-};
-
-struct pthread_wait_data {
- struct pthread_poll_data *poll_data;
-};
-
-/*
- * Thread structure.
- */
-struct pthread {
-
- /*
- * Time to wake up thread. This is used for sleeping threads and
- * for any operation which may time out (such as select).
- */
- struct timespec wakeup_time;
-
- /* TRUE if operation has timed out. */
- int timeout;
-
- /* Wait data. */
- struct pthread_wait_data data;
-
- /*
- * Allocated for converting select into poll.
- */
- struct pthread_poll_data poll_data;
-
- /*
- * Set to TRUE if a blocking operation was
- * interrupted by a signal:
- */
- int interrupted;
-};
-
-/* Time of day at last scheduling timer signal: */
-SCLASS struct timeval volatile _sched_tod
-#ifdef GLOBAL_PTHREAD_PRIVATE
-= { 0, 0 };
-#else
-;
-#endif
-struct pthread *_get_curthread(void);
-
-#endif /* !_PTHREAD_PRIVATE_H */
diff --git a/freebsd-userspace/rtems/rtems-get_curthread.c b/freebsd-userspace/rtems/rtems-get_curthread.c
deleted file mode 100644
index 263cac60..00000000
--- a/freebsd-userspace/rtems/rtems-get_curthread.c
+++ /dev/null
@@ -1,72 +0,0 @@
-#include <freebsd/machine/rtems-bsd-config.h>
-
-#include <freebsd/sys/malloc.h>
-
-#include <pthread.h>
-#include "pthread_private.h"
-
-
-static struct pthread *rtems_bsd_curpthread = NULL;
-
-
-static void rtems_bsd_pthread_descriptor_dtor(void *td)
-{
- // XXX are there other pieces to clean up?
- free(td, M_TEMP);
-}
-
-static struct pthread *
-rtems_bsd_pthread_init( rtems_id id )
-{
- rtems_status_code sc = RTEMS_SUCCESSFUL;
- unsigned index = 0;
- struct pthread *td;
-
- td = _bsd_malloc( sizeof(struct pthread), M_TEMP, M_WAITOK | M_ZERO);
- if (td == NULL)
- return NULL;
-
- td->timeout = 0;
- td->data.poll_data = NULL;
- td->poll_data.nfds = 0;
- td->poll_data.fds = NULL;
- td->interrupted = 0;
- rtems_bsd_curpthread = td;
-
- // Now add the task descriptor as a per-task variable
- sc = rtems_task_variable_add(
- id,
- &rtems_bsd_curpthread,
- rtems_bsd_pthread_descriptor_dtor
- );
- if (sc != RTEMS_SUCCESSFUL) {
- free(td, M_TEMP);
- return NULL;
- }
-
- return td;
-}
-
-/*
- */
-
-struct pthread *
-_get_curthread(void)
-{
- struct pthread *td;
-
- /*
- * If we already have a struct thread associated with this thread,
- * obtain it. Otherwise, allocate and initialize one.
- */
- td = rtems_bsd_curpthread;
- if ( td == NULL ) {
- td = rtems_bsd_pthread_init( rtems_task_self() );
- if ( td == NULL ){
- panic("_get_curthread: Unable to create pthread\n");
- }
- }
-
- return td;
-}
-
diff --git a/freebsd-userspace/rtems/rtems-uthread_init.c b/freebsd-userspace/rtems/rtems-uthread_init.c
deleted file mode 100644
index 3226ed62..00000000
--- a/freebsd-userspace/rtems/rtems-uthread_init.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <freebsd/machine/rtems-bsd-config.h>
-
-/* Allocate space for global thread variables here: */
-#define GLOBAL_PTHREAD_PRIVATE
-
-#include <freebsd/sys/types.h>
-#include <pthread.h>
-#include "pthread_private.h"
diff --git a/freebsd-userspace/sys/net/ethernet.h b/freebsd-userspace/sys/net/ethernet.h
deleted file mode 100644
index ae7341ee..00000000
--- a/freebsd-userspace/sys/net/ethernet.h
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
- * Fundamental constants relating to ethernet.
- *
- * $FreeBSD$
- *
- */
-
-#ifndef _NET_ETHERNET_H_
-#define _NET_ETHERNET_H_
-
-/*
- * Some basic Ethernet constants.
- */
-#define ETHER_ADDR_LEN 6 /* length of an Ethernet address */
-#define ETHER_TYPE_LEN 2 /* length of the Ethernet type field */
-#define ETHER_CRC_LEN 4 /* length of the Ethernet CRC */
-#define ETHER_HDR_LEN (ETHER_ADDR_LEN*2+ETHER_TYPE_LEN)
-#define ETHER_MIN_LEN 64 /* minimum frame len, including CRC */
-#define ETHER_MAX_LEN 1518 /* maximum frame len, including CRC */
-#define ETHER_MAX_LEN_JUMBO 9018 /* max jumbo frame len, including CRC */
-
-#define ETHER_VLAN_ENCAP_LEN 4 /* len of 802.1Q VLAN encapsulation */
-/*
- * Mbuf adjust factor to force 32-bit alignment of IP header.
- * Drivers should do m_adj(m, ETHER_ALIGN) when setting up a
- * receive so the upper layers get the IP header properly aligned
- * past the 14-byte Ethernet header.
- */
-#define ETHER_ALIGN 2 /* driver adjust for IP hdr alignment */
-
-/*
- * Compute the maximum frame size based on ethertype (i.e. possible
- * encapsulation) and whether or not an FCS is present.
- */
-#define ETHER_MAX_FRAME(ifp, etype, hasfcs) \
- ((ifp)->if_mtu + ETHER_HDR_LEN + \
- ((hasfcs) ? ETHER_CRC_LEN : 0) + \
- (((etype) == ETHERTYPE_VLAN) ? ETHER_VLAN_ENCAP_LEN : 0))
-
-/*
- * Ethernet-specific mbuf flags.
- */
-#define M_HASFCS M_PROTO5 /* FCS included at end of frame */
-
-/*
- * Ethernet CRC32 polynomials (big- and little-endian verions).
- */
-#define ETHER_CRC_POLY_LE 0xedb88320
-#define ETHER_CRC_POLY_BE 0x04c11db6
-
-/*
- * A macro to validate a length with
- */
-#define ETHER_IS_VALID_LEN(foo) \
- ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
-
-/*
- * Structure of a 10Mb/s Ethernet header.
- */
-struct ether_header {
- u_char ether_dhost[ETHER_ADDR_LEN];
- u_char ether_shost[ETHER_ADDR_LEN];
- u_short ether_type;
-} __packed;
-
-/*
- * Structure of a 48-bit Ethernet address.
- */
-struct ether_addr {
- u_char octet[ETHER_ADDR_LEN];
-} __packed;
-
-#define ETHER_IS_MULTICAST(addr) (*(addr) & 0x01) /* is address mcast/bcast? */
-
-/*
- * NOTE: 0x0000-0x05DC (0..1500) are generally IEEE 802.3 length fields.
- * However, there are some conflicts.
- */
-
-#define ETHERTYPE_8023 0x0004 /* IEEE 802.3 packet */
- /* 0x0101 .. 0x1FF Experimental */
-#define ETHERTYPE_PUP 0x0200 /* Xerox PUP protocol - see 0A00 */
-#define ETHERTYPE_PUPAT 0x0200 /* PUP Address Translation - see 0A01 */
-#define ETHERTYPE_SPRITE 0x0500 /* ??? */
- /* 0x0400 Nixdorf */
-#define ETHERTYPE_NS 0x0600 /* XNS */
-#define ETHERTYPE_NSAT 0x0601 /* XNS Address Translation (3Mb only) */
-#define ETHERTYPE_DLOG1 0x0660 /* DLOG (?) */
-#define ETHERTYPE_DLOG2 0x0661 /* DLOG (?) */
-#define ETHERTYPE_IP 0x0800 /* IP protocol */
-#define ETHERTYPE_X75 0x0801 /* X.75 Internet */
-#define ETHERTYPE_NBS 0x0802 /* NBS Internet */
-#define ETHERTYPE_ECMA 0x0803 /* ECMA Internet */
-#define ETHERTYPE_CHAOS 0x0804 /* CHAOSnet */
-#define ETHERTYPE_X25 0x0805 /* X.25 Level 3 */
-#define ETHERTYPE_ARP 0x0806 /* Address resolution protocol */
-#define ETHERTYPE_NSCOMPAT 0x0807 /* XNS Compatibility */
-#define ETHERTYPE_FRARP 0x0808 /* Frame Relay ARP (RFC1701) */
- /* 0x081C Symbolics Private */
- /* 0x0888 - 0x088A Xyplex */
-#define ETHERTYPE_UBDEBUG 0x0900 /* Ungermann-Bass network debugger */
-#define ETHERTYPE_IEEEPUP 0x0A00 /* Xerox IEEE802.3 PUP */
-#define ETHERTYPE_IEEEPUPAT 0x0A01 /* Xerox IEEE802.3 PUP Address Translation */
-#define ETHERTYPE_VINES 0x0BAD /* Banyan VINES */
-#define ETHERTYPE_VINESLOOP 0x0BAE /* Banyan VINES Loopback */
-#define ETHERTYPE_VINESECHO 0x0BAF /* Banyan VINES Echo */
-
-/* 0x1000 - 0x100F Berkeley Trailer */
-/*
- * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
- * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
- * by an ETHER type (as given above) and then the (variable-length) header.
- */
-#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
-#define ETHERTYPE_NTRAILER 16
-
-#define ETHERTYPE_DCA 0x1234 /* DCA - Multicast */
-#define ETHERTYPE_VALID 0x1600 /* VALID system protocol */
-#define ETHERTYPE_DOGFIGHT 0x1989 /* Artificial Horizons ("Aviator" dogfight simulator [on Sun]) */
-#define ETHERTYPE_RCL 0x1995 /* Datapoint Corporation (RCL lan protocol) */
-
- /* The following 3C0x types
- are unregistered: */
-#define ETHERTYPE_NBPVCD 0x3C00 /* 3Com NBP virtual circuit datagram (like XNS SPP) not registered */
-#define ETHERTYPE_NBPSCD 0x3C01 /* 3Com NBP System control datagram not registered */
-#define ETHERTYPE_NBPCREQ 0x3C02 /* 3Com NBP Connect request (virtual cct) not registered */
-#define ETHERTYPE_NBPCRSP 0x3C03 /* 3Com NBP Connect response not registered */
-#define ETHERTYPE_NBPCC 0x3C04 /* 3Com NBP Connect complete not registered */
-#define ETHERTYPE_NBPCLREQ 0x3C05 /* 3Com NBP Close request (virtual cct) not registered */
-#define ETHERTYPE_NBPCLRSP 0x3C06 /* 3Com NBP Close response not registered */
-#define ETHERTYPE_NBPDG 0x3C07 /* 3Com NBP Datagram (like XNS IDP) not registered */
-#define ETHERTYPE_NBPDGB 0x3C08 /* 3Com NBP Datagram broadcast not registered */
-#define ETHERTYPE_NBPCLAIM 0x3C09 /* 3Com NBP Claim NetBIOS name not registered */
-#define ETHERTYPE_NBPDLTE 0x3C0A /* 3Com NBP Delete NetBIOS name not registered */
-#define ETHERTYPE_NBPRAS 0x3C0B /* 3Com NBP Remote adaptor status request not registered */
-#define ETHERTYPE_NBPRAR 0x3C0C /* 3Com NBP Remote adaptor response not registered */
-#define ETHERTYPE_NBPRST 0x3C0D /* 3Com NBP Reset not registered */
-
-#define ETHERTYPE_PCS 0x4242 /* PCS Basic Block Protocol */
-#define ETHERTYPE_IMLBLDIAG 0x424C /* Information Modes Little Big LAN diagnostic */
-#define ETHERTYPE_DIDDLE 0x4321 /* THD - Diddle */
-#define ETHERTYPE_IMLBL 0x4C42 /* Information Modes Little Big LAN */
-#define ETHERTYPE_SIMNET 0x5208 /* BBN Simnet Private */
-#define ETHERTYPE_DECEXPER 0x6000 /* DEC Unassigned, experimental */
-#define ETHERTYPE_MOPDL 0x6001 /* DEC MOP dump/load */
-#define ETHERTYPE_MOPRC 0x6002 /* DEC MOP remote console */
-#define ETHERTYPE_DECnet 0x6003 /* DEC DECNET Phase IV route */
-#define ETHERTYPE_DN ETHERTYPE_DECnet /* libpcap, tcpdump */
-#define ETHERTYPE_LAT 0x6004 /* DEC LAT */
-#define ETHERTYPE_DECDIAG 0x6005 /* DEC diagnostic protocol (at interface initialization?) */
-#define ETHERTYPE_DECCUST 0x6006 /* DEC customer protocol */
-#define ETHERTYPE_SCA 0x6007 /* DEC LAVC, SCA */
-#define ETHERTYPE_AMBER 0x6008 /* DEC AMBER */
-#define ETHERTYPE_DECMUMPS 0x6009 /* DEC MUMPS */
- /* 0x6010 - 0x6014 3Com Corporation */
-#define ETHERTYPE_TRANSETHER 0x6558 /* Trans Ether Bridging (RFC1701)*/
-#define ETHERTYPE_RAWFR 0x6559 /* Raw Frame Relay (RFC1701) */
-#define ETHERTYPE_UBDL 0x7000 /* Ungermann-Bass download */
-#define ETHERTYPE_UBNIU 0x7001 /* Ungermann-Bass NIUs */
-#define ETHERTYPE_UBDIAGLOOP 0x7002 /* Ungermann-Bass diagnostic/loopback */
-#define ETHERTYPE_UBNMC 0x7003 /* Ungermann-Bass ??? (NMC to/from UB Bridge) */
-#define ETHERTYPE_UBBST 0x7005 /* Ungermann-Bass Bridge Spanning Tree */
-#define ETHERTYPE_OS9 0x7007 /* OS/9 Microware */
-#define ETHERTYPE_OS9NET 0x7009 /* OS/9 Net? */
- /* 0x7020 - 0x7029 LRT (England) (now Sintrom) */
-#define ETHERTYPE_RACAL 0x7030 /* Racal-Interlan */
-#define ETHERTYPE_PRIMENTS 0x7031 /* Prime NTS (Network Terminal Service) */
-#define ETHERTYPE_CABLETRON 0x7034 /* Cabletron */
-#define ETHERTYPE_CRONUSVLN 0x8003 /* Cronus VLN */
-#define ETHERTYPE_CRONUS 0x8004 /* Cronus Direct */
-#define ETHERTYPE_HP 0x8005 /* HP Probe */
-#define ETHERTYPE_NESTAR 0x8006 /* Nestar */
-#define ETHERTYPE_ATTSTANFORD 0x8008 /* AT&T/Stanford (local use) */
-#define ETHERTYPE_EXCELAN 0x8010 /* Excelan */
-#define ETHERTYPE_SG_DIAG 0x8013 /* SGI diagnostic type */
-#define ETHERTYPE_SG_NETGAMES 0x8014 /* SGI network games */
-#define ETHERTYPE_SG_RESV 0x8015 /* SGI reserved type */
-#define ETHERTYPE_SG_BOUNCE 0x8016 /* SGI bounce server */
-#define ETHERTYPE_APOLLODOMAIN 0x8019 /* Apollo DOMAIN */
-#define ETHERTYPE_TYMSHARE 0x802E /* Tymeshare */
-#define ETHERTYPE_TIGAN 0x802F /* Tigan, Inc. */
-#define ETHERTYPE_REVARP 0x8035 /* Reverse addr resolution protocol */
-#define ETHERTYPE_AEONIC 0x8036 /* Aeonic Systems */
-#define ETHERTYPE_IPXNEW 0x8037 /* IPX (Novell Netware?) */
-#define ETHERTYPE_LANBRIDGE 0x8038 /* DEC LANBridge */
-#define ETHERTYPE_DSMD 0x8039 /* DEC DSM/DDP */
-#define ETHERTYPE_ARGONAUT 0x803A /* DEC Argonaut Console */
-#define ETHERTYPE_VAXELN 0x803B /* DEC VAXELN */
-#define ETHERTYPE_DECDNS 0x803C /* DEC DNS Naming Service */
-#define ETHERTYPE_ENCRYPT 0x803D /* DEC Ethernet Encryption */
-#define ETHERTYPE_DECDTS 0x803E /* DEC Distributed Time Service */
-#define ETHERTYPE_DECLTM 0x803F /* DEC LAN Traffic Monitor */
-#define ETHERTYPE_DECNETBIOS 0x8040 /* DEC PATHWORKS DECnet NETBIOS Emulation */
-#define ETHERTYPE_DECLAST 0x8041 /* DEC Local Area System Transport */
- /* 0x8042 DEC Unassigned */
-#define ETHERTYPE_PLANNING 0x8044 /* Planning Research Corp. */
- /* 0x8046 - 0x8047 AT&T */
-#define ETHERTYPE_DECAM 0x8048 /* DEC Availability Manager for Distributed Systems DECamds (but someone at DEC says not) */
-#define ETHERTYPE_EXPERDATA 0x8049 /* ExperData */
-#define ETHERTYPE_VEXP 0x805B /* Stanford V Kernel exp. */
-#define ETHERTYPE_VPROD 0x805C /* Stanford V Kernel prod. */
-#define ETHERTYPE_ES 0x805D /* Evans & Sutherland */
-#define ETHERTYPE_LITTLE 0x8060 /* Little Machines */
-#define ETHERTYPE_COUNTERPOINT 0x8062 /* Counterpoint Computers */
- /* 0x8065 - 0x8066 Univ. of Mass @ Amherst */
-#define ETHERTYPE_VEECO 0x8067 /* Veeco Integrated Auto. */
-#define ETHERTYPE_GENDYN 0x8068 /* General Dynamics */
-#define ETHERTYPE_ATT 0x8069 /* AT&T */
-#define ETHERTYPE_AUTOPHON 0x806A /* Autophon */
-#define ETHERTYPE_COMDESIGN 0x806C /* ComDesign */
-#define ETHERTYPE_COMPUGRAPHIC 0x806D /* Compugraphic Corporation */
- /* 0x806E - 0x8077 Landmark Graphics Corp. */
-#define ETHERTYPE_MATRA 0x807A /* Matra */
-#define ETHERTYPE_DDE 0x807B /* Dansk Data Elektronik */
-#define ETHERTYPE_MERIT 0x807C /* Merit Internodal (or Univ of Michigan?) */
- /* 0x807D - 0x807F Vitalink Communications */
-#define ETHERTYPE_VLTLMAN 0x8080 /* Vitalink TransLAN III Management */
- /* 0x8081 - 0x8083 Counterpoint Computers */
- /* 0x8088 - 0x808A Xyplex */
-#define ETHERTYPE_ATALK 0x809B /* AppleTalk */
-#define ETHERTYPE_AT ETHERTYPE_ATALK /* old NetBSD */
-#define ETHERTYPE_APPLETALK ETHERTYPE_ATALK /* HP-UX */
- /* 0x809C - 0x809E Datability */
-#define ETHERTYPE_SPIDER 0x809F /* Spider Systems Ltd. */
- /* 0x80A3 Nixdorf */
- /* 0x80A4 - 0x80B3 Siemens Gammasonics Inc. */
- /* 0x80C0 - 0x80C3 DCA (Digital Comm. Assoc.) Data Exchange Cluster */
- /* 0x80C4 - 0x80C5 Banyan Systems */
-#define ETHERTYPE_PACER 0x80C6 /* Pacer Software */
-#define ETHERTYPE_APPLITEK 0x80C7 /* Applitek Corporation */
- /* 0x80C8 - 0x80CC Intergraph Corporation */
- /* 0x80CD - 0x80CE Harris Corporation */
- /* 0x80CF - 0x80D2 Taylor Instrument */
- /* 0x80D3 - 0x80D4 Rosemount Corporation */
-#define ETHERTYPE_SNA 0x80D5 /* IBM SNA Services over Ethernet */
-#define ETHERTYPE_VARIAN 0x80DD /* Varian Associates */
- /* 0x80DE - 0x80DF TRFS (Integrated Solutions Transparent Remote File System) */
- /* 0x80E0 - 0x80E3 Allen-Bradley */
- /* 0x80E4 - 0x80F0 Datability */
-#define ETHERTYPE_RETIX 0x80F2 /* Retix */
-#define ETHERTYPE_AARP 0x80F3 /* AppleTalk AARP */
- /* 0x80F4 - 0x80F5 Kinetics */
-#define ETHERTYPE_APOLLO 0x80F7 /* Apollo Computer */
-#define ETHERTYPE_VLAN 0x8100 /* IEEE 802.1Q VLAN tagging (XXX conflicts) */
- /* 0x80FF - 0x8101 Wellfleet Communications (XXX conflicts) */
-#define ETHERTYPE_BOFL 0x8102 /* Wellfleet; BOFL (Breath OF Life) pkts [every 5-10 secs.] */
-#define ETHERTYPE_WELLFLEET 0x8103 /* Wellfleet Communications */
- /* 0x8107 - 0x8109 Symbolics Private */
-#define ETHERTYPE_TALARIS 0x812B /* Talaris */
-#define ETHERTYPE_WATERLOO 0x8130 /* Waterloo Microsystems Inc. (XXX which?) */
-#define ETHERTYPE_HAYES 0x8130 /* Hayes Microcomputers (XXX which?) */
-#define ETHERTYPE_VGLAB 0x8131 /* VG Laboratory Systems */
- /* 0x8132 - 0x8137 Bridge Communications */
-#define ETHERTYPE_IPX 0x8137 /* Novell (old) NetWare IPX (ECONFIG E option) */
-#define ETHERTYPE_NOVELL 0x8138 /* Novell, Inc. */
- /* 0x8139 - 0x813D KTI */
-#define ETHERTYPE_MUMPS 0x813F /* M/MUMPS data sharing */
-#define ETHERTYPE_AMOEBA 0x8145 /* Vrije Universiteit (NL) Amoeba 4 RPC (obsolete) */
-#define ETHERTYPE_FLIP 0x8146 /* Vrije Universiteit (NL) FLIP (Fast Local Internet Protocol) */
-#define ETHERTYPE_VURESERVED 0x8147 /* Vrije Universiteit (NL) [reserved] */
-#define ETHERTYPE_LOGICRAFT 0x8148 /* Logicraft */
-#define ETHERTYPE_NCD 0x8149 /* Network Computing Devices */
-#define ETHERTYPE_ALPHA 0x814A /* Alpha Micro */
-#define ETHERTYPE_SNMP 0x814C /* SNMP over Ethernet (see RFC1089) */
- /* 0x814D - 0x814E BIIN */
-#define ETHERTYPE_TEC 0x814F /* Technically Elite Concepts */
-#define ETHERTYPE_RATIONAL 0x8150 /* Rational Corp */
- /* 0x8151 - 0x8153 Qualcomm */
- /* 0x815C - 0x815E Computer Protocol Pty Ltd */
- /* 0x8164 - 0x8166 Charles River Data Systems */
-#define ETHERTYPE_XTP 0x817D /* Protocol Engines XTP */
-#define ETHERTYPE_SGITW 0x817E /* SGI/Time Warner prop. */
-#define ETHERTYPE_HIPPI_FP 0x8180 /* HIPPI-FP encapsulation */
-#define ETHERTYPE_STP 0x8181 /* Scheduled Transfer STP, HIPPI-ST */
- /* 0x8182 - 0x8183 Reserved for HIPPI-6400 */
- /* 0x8184 - 0x818C SGI prop. */
-#define ETHERTYPE_MOTOROLA 0x818D /* Motorola */
-#define ETHERTYPE_NETBEUI 0x8191 /* PowerLAN NetBIOS/NetBEUI (PC) */
- /* 0x819A - 0x81A3 RAD Network Devices */
- /* 0x81B7 - 0x81B9 Xyplex */
- /* 0x81CC - 0x81D5 Apricot Computers */
- /* 0x81D6 - 0x81DD Artisoft Lantastic */
- /* 0x81E6 - 0x81EF Polygon */
- /* 0x81F0 - 0x81F2 Comsat Labs */
- /* 0x81F3 - 0x81F5 SAIC */
- /* 0x81F6 - 0x81F8 VG Analytical */
- /* 0x8203 - 0x8205 QNX Software Systems Ltd. */
- /* 0x8221 - 0x8222 Ascom Banking Systems */
- /* 0x823E - 0x8240 Advanced Encryption Systems */
- /* 0x8263 - 0x826A Charles River Data Systems */
- /* 0x827F - 0x8282 Athena Programming */
- /* 0x829A - 0x829B Inst Ind Info Tech */
- /* 0x829C - 0x82AB Taurus Controls */
- /* 0x82AC - 0x8693 Walker Richer & Quinn */
-#define ETHERTYPE_ACCTON 0x8390 /* Accton Technologies (unregistered) */
-#define ETHERTYPE_TALARISMC 0x852B /* Talaris multicast */
-#define ETHERTYPE_KALPANA 0x8582 /* Kalpana */
- /* 0x8694 - 0x869D Idea Courier */
- /* 0x869E - 0x86A1 Computer Network Tech */
- /* 0x86A3 - 0x86AC Gateway Communications */
-#define ETHERTYPE_SECTRA 0x86DB /* SECTRA */
-#define ETHERTYPE_IPV6 0x86DD /* IP protocol version 6 */
-#define ETHERTYPE_DELTACON 0x86DE /* Delta Controls */
-#define ETHERTYPE_ATOMIC 0x86DF /* ATOMIC */
- /* 0x86E0 - 0x86EF Landis & Gyr Powers */
- /* 0x8700 - 0x8710 Motorola */
-#define ETHERTYPE_RDP 0x8739 /* Control Technology Inc. RDP Without IP */
-#define ETHERTYPE_MICP 0x873A /* Control Technology Inc. Mcast Industrial Ctrl Proto. */
- /* 0x873B - 0x873C Control Technology Inc. Proprietary */
-#define ETHERTYPE_TCPCOMP 0x876B /* TCP/IP Compression (RFC1701) */
-#define ETHERTYPE_IPAS 0x876C /* IP Autonomous Systems (RFC1701) */
-#define ETHERTYPE_SECUREDATA 0x876D /* Secure Data (RFC1701) */
-#define ETHERTYPE_FLOWCONTROL 0x8808 /* 802.3x flow control packet */
-#define ETHERTYPE_SLOW 0x8809 /* 802.3ad link aggregation (LACP) */
-#define ETHERTYPE_PPP 0x880B /* PPP (obsolete by PPPoE) */
-#define ETHERTYPE_HITACHI 0x8820 /* Hitachi Cable (Optoelectronic Systems Laboratory) */
-#define ETHERTYPE_MPLS 0x8847 /* MPLS Unicast */
-#define ETHERTYPE_MPLS_MCAST 0x8848 /* MPLS Multicast */
-#define ETHERTYPE_AXIS 0x8856 /* Axis Communications AB proprietary bootstrap/config */
-#define ETHERTYPE_PPPOEDISC 0x8863 /* PPP Over Ethernet Discovery Stage */
-#define ETHERTYPE_PPPOE 0x8864 /* PPP Over Ethernet Session Stage */
-#define ETHERTYPE_LANPROBE 0x8888 /* HP LanProbe test? */
-#define ETHERTYPE_PAE 0x888e /* EAPOL PAE/802.1x */
-#define ETHERTYPE_LOOPBACK 0x9000 /* Loopback: used to test interfaces */
-#define ETHERTYPE_LBACK ETHERTYPE_LOOPBACK /* DEC MOP loopback */
-#define ETHERTYPE_XNSSM 0x9001 /* 3Com (Formerly Bridge Communications), XNS Systems Management */
-#define ETHERTYPE_TCPSM 0x9002 /* 3Com (Formerly Bridge Communications), TCP/IP Systems Management */
-#define ETHERTYPE_BCLOOP 0x9003 /* 3Com (Formerly Bridge Communications), loopback detection */
-#define ETHERTYPE_DEBNI 0xAAAA /* DECNET? Used by VAX 6220 DEBNI */
-#define ETHERTYPE_SONIX 0xFAF5 /* Sonix Arpeggio */
-#define ETHERTYPE_VITAL 0xFF00 /* BBN VITAL-LanBridge cache wakeups */
- /* 0xFF00 - 0xFFOF ISC Bunker Ramo */
-
-#define ETHERTYPE_MAX 0xFFFF /* Maximum valid ethernet type, reserved */
-
-/*
- * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
- * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
- * by an ETHER type (as given above) and then the (variable-length) header.
- */
-#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
-#define ETHERTYPE_NTRAILER 16
-
-#define ETHERMTU (ETHER_MAX_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
-#define ETHERMIN (ETHER_MIN_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
-#define ETHERMTU_JUMBO (ETHER_MAX_LEN_JUMBO - ETHER_HDR_LEN - ETHER_CRC_LEN)
-/*
- * The ETHER_BPF_MTAP macro should be used by drivers which support hardware
- * offload for VLAN tag processing. It will check the mbuf to see if it has
- * M_VLANTAG set, and if it does, will pass the packet along to
- * ether_vlan_mtap. This function will re-insert VLAN tags for the duration
- * of the tap, so they show up properly for network analyzers.
- */
-#define ETHER_BPF_MTAP(_ifp, _m) do { \
- if (bpf_peers_present((_ifp)->if_bpf)) { \
- M_ASSERTVALID(_m); \
- if (((_m)->m_flags & M_VLANTAG) != 0) \
- ether_vlan_mtap((_ifp)->if_bpf, (_m), NULL, 0); \
- else \
- bpf_mtap((_ifp)->if_bpf, (_m)); \
- } \
-} while (0)
-
-#ifdef _KERNEL
-
-struct ifnet;
-struct mbuf;
-struct route;
-struct sockaddr;
-struct bpf_if;
-
-extern uint32_t ether_crc32_le(const uint8_t *, size_t);
-extern uint32_t ether_crc32_be(const uint8_t *, size_t);
-extern void ether_demux(struct ifnet *, struct mbuf *);
-extern void ether_ifattach(struct ifnet *, const u_int8_t *);
-extern void ether_ifdetach(struct ifnet *);
-extern int ether_ioctl(struct ifnet *, u_long, caddr_t);
-extern int ether_output(struct ifnet *,
- struct mbuf *, struct sockaddr *, struct route *);
-extern int ether_output_frame(struct ifnet *, struct mbuf *);
-extern char *ether_sprintf(const u_int8_t *);
-void ether_vlan_mtap(struct bpf_if *, struct mbuf *,
- void *, u_int);
-struct mbuf *ether_vlanencap(struct mbuf *, uint16_t);
-
-#else /* _KERNEL */
-
-#include <sys/cdefs.h>
-
-/*
- * Ethernet address conversion/parsing routines.
- */
-__BEGIN_DECLS
-struct ether_addr *ether_aton(const char *);
-struct ether_addr *ether_aton_r(const char *, struct ether_addr *);
-int ether_hostton(const char *, struct ether_addr *);
-int ether_line(const char *, struct ether_addr *, char *);
-char *ether_ntoa(const struct ether_addr *);
-char *ether_ntoa_r(const struct ether_addr *, char *);
-int ether_ntohost(char *, const struct ether_addr *);
-__END_DECLS
-
-#endif /* !_KERNEL */
-
-#endif /* !_NET_ETHERNET_H_ */
diff --git a/freebsd/include/arpa/inet.h b/freebsd/include/arpa/inet.h
index 91733a9c..aaddbb9b 100644
--- a/freebsd/include/arpa/inet.h
+++ b/freebsd/include/arpa/inet.h
@@ -65,7 +65,7 @@
/* External definitions for functions in inet(3). */
#include <sys/cdefs.h>
-#include <sys/_types.h>
+#include <rtems/bsd/sys/_types.h>
/* Required for byteorder(3) functions. */
#include <machine/endian.h>
diff --git a/freebsd/include/arpa/nameser.h b/freebsd/include/arpa/nameser.h
index ce2f2e06..cef012dd 100644
--- a/freebsd/include/arpa/nameser.h
+++ b/freebsd/include/arpa/nameser.h
@@ -60,8 +60,8 @@
#define BIND_4_COMPAT
-#include <sys/param.h>
-#include <sys/types.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/cdefs.h>
/*%
diff --git a/freebsd/include/arpa/nameser_compat.h b/freebsd/include/arpa/nameser_compat.h
index c7c5b95a..64d05f82 100644
--- a/freebsd/include/arpa/nameser_compat.h
+++ b/freebsd/include/arpa/nameser_compat.h
@@ -41,7 +41,7 @@
#define __BIND 19950621 /*%< (DEAD) interface version stamp. */
-#include <freebsd/machine/endian.h>
+#include <machine/endian.h>
#if !defined(_BYTE_ORDER) || \
(_BYTE_ORDER != _BIG_ENDIAN && _BYTE_ORDER != _LITTLE_ENDIAN && \
diff --git a/freebsd/include/db.h b/freebsd/include/db.h
index e845fa8e..025a4228 100644
--- a/freebsd/include/db.h
+++ b/freebsd/include/db.h
@@ -37,7 +37,7 @@
#ifndef _DB_H_
#define _DB_H_
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/cdefs.h>
#include <limits.h>
diff --git a/freebsd/include/err.h b/freebsd/include/err.h
index 90c93da7..772d654f 100644
--- a/freebsd/include/err.h
+++ b/freebsd/include/err.h
@@ -44,13 +44,8 @@
* for utilities to have to include one of them to include err.h, so we get
* __va_list from <sys/_types.h> and use it.
*/
-#include <freebsd/bsd.h>
#include <sys/cdefs.h>
-#ifdef __rtems__
-#include <freebsd/sys/_types.h>
-#else
-#include <sys/_types.h>
-#endif
+#include <rtems/bsd/sys/_types.h>
#ifdef __rtems__
#include <setjmp.h>
diff --git a/freebsd/include/netdb.h b/freebsd/include/netdb.h
index c15b2845..52ab3933 100644
--- a/freebsd/include/netdb.h
+++ b/freebsd/include/netdb.h
@@ -62,7 +62,7 @@
#define _NETDB_H_
#include <sys/cdefs.h>
-#include <sys/_types.h>
+#include <rtems/bsd/sys/_types.h>
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
diff --git a/freebsd/include/nsswitch.h b/freebsd/include/nsswitch.h
index 8aea5ad1..85dfe296 100644
--- a/freebsd/include/nsswitch.h
+++ b/freebsd/include/nsswitch.h
@@ -40,7 +40,7 @@
#ifndef _NSSWITCH_H
#define _NSSWITCH_H 1
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <stdarg.h>
#define NSS_MODULE_INTERFACE_VERSION 1
diff --git a/freebsd/include/res_update.h b/freebsd/include/res_update.h
index f09d3a1a..704a9490 100644
--- a/freebsd/include/res_update.h
+++ b/freebsd/include/res_update.h
@@ -25,7 +25,7 @@
/*! \file */
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <arpa/nameser.h>
#include <resolv.h>
diff --git a/freebsd/include/resolv.h b/freebsd/include/resolv.h
index 20f7954e..b70ef300 100644
--- a/freebsd/include/resolv.h
+++ b/freebsd/include/resolv.h
@@ -57,8 +57,8 @@
#ifndef _RESOLV_H_
#define _RESOLV_H_
-#include <sys/param.h>
-#include <sys/types.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/cdefs.h>
#include <sys/socket.h>
#include <stdio.h>
diff --git a/freebsd/include/rpcsvc/nis_db.h b/freebsd/include/rpcsvc/nis_db.h
new file mode 100644
index 00000000..9dcc7837
--- /dev/null
+++ b/freebsd/include/rpcsvc/nis_db.h
@@ -0,0 +1,135 @@
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ *
+ * $FreeBSD$
+ */
+
+/*
+ * Copyright (c) 1991, by Sun Microsystems Inc.
+ */
+
+/*
+ * This header file defines the interface to the NIS database. All
+ * implementations of the database must export at least these routines.
+ * They must also follow the conventions set herein. See the implementors
+ * guide for specific semantics that are required.
+ */
+
+#ifndef _RPCSVC_NIS_DB_H
+#define _RPCSVC_NIS_DB_H
+
+
+/* From: #pragma ident "@(#)nis_db.h 1.8 94/05/03 SMI" */
+
+/*
+ * Note: although the version of <rpcsvc/nis_db.h> shipped with Solaris
+ * 2.5/2.5.x is actually older than this one (according to the ident
+ * string), it contains changes and a few added functions. Those changes
+ * have been hand merged into this file to bring it up to date.
+ */
+
+#include <rpc/rpc.h>
+#include <rpcsvc/nis.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum db_status {
+ DB_SUCCESS = 0,
+ DB_NOTFOUND = 1,
+ DB_NOTUNIQUE = 2,
+ DB_BADTABLE = 3,
+ DB_BADQUERY = 4,
+ DB_BADOBJECT = 5,
+ DB_MEMORY_LIMIT = 6,
+ DB_STORAGE_LIMIT = 7,
+ DB_INTERNAL_ERROR = 8
+};
+typedef enum db_status db_status;
+
+enum db_action {
+ DB_LOOKUP = 0,
+ DB_REMOVE = 1,
+ DB_ADD = 2,
+ DB_FIRST = 3,
+ DB_NEXT = 4,
+ DB_ALL = 5,
+ DB_RESET_NEXT = 6
+};
+typedef enum db_action db_action;
+
+typedef entry_obj *entry_object_p;
+
+typedef struct {
+ u_int db_next_desc_len;
+ char *db_next_desc_val;
+} db_next_desc;
+
+struct db_result {
+ db_status status;
+ db_next_desc nextinfo;
+ struct {
+ u_int objects_len;
+ entry_object_p *objects_val;
+ } objects;
+ long ticks;
+};
+typedef struct db_result db_result;
+
+/*
+ * Prototypes for the database functions.
+ */
+
+extern bool_t db_initialize(char *);
+#ifdef ORIGINAL_DECLS
+extern bool_t db_create_table(char *, table_obj *);
+extern bool_t db_destroy_table(char *);
+#else
+extern db_status db_create_table(char *, table_obj *);
+extern db_status db_destroy_table(char *);
+#endif
+extern db_result *db_first_entry(char *, int, nis_attr *);
+extern db_result *db_next_entry(char *, db_next_desc *);
+extern db_result *db_reset_next_entry(char *, db_next_desc *);
+extern db_result *db_list_entries(char *, int, nis_attr *);
+extern db_result *db_add_entry(char *, int, nis_attr *, entry_obj *);
+extern db_result *db_remove_entry(char *, int, nis_attr *);
+extern db_status db_checkpoint(char *);
+extern db_status db_standby(char *);
+#ifndef ORIGINAL_DECLS
+extern db_status db_table_exists(char *);
+extern db_status db_unload_table(char *);
+extern void db_free_result(db_result *);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RPCSVC_NIS_DB_H */
diff --git a/freebsd/include/rpcsvc/nis_tags.h b/freebsd/include/rpcsvc/nis_tags.h
new file mode 100644
index 00000000..0eaee6d4
--- /dev/null
+++ b/freebsd/include/rpcsvc/nis_tags.h
@@ -0,0 +1,137 @@
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * Copyright (c) 1991, Sun Microsystems Inc.
+ */
+
+/*
+ * nis_tags.h
+ *
+ * This file contains the tags and statistics definitions. It is
+ * automatically included by nis.h
+ */
+
+#ifndef _RPCSVC_NIS_TAGS_H
+#define _RPCSVC_NIS_TAGS_H
+
+/* From: #pragma ident "@(#)nis_tags.h 1.10 94/05/03 SMI" */
+/* from file: zns_tags.h 1.7 Copyright (c) 1990 Sun Microsystems */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef ORIGINAL_DECLS
+#define NIS_DIR "data"
+#endif
+
+/* Lookup and List function flags */
+#define FOLLOW_LINKS (1<<0) /* Follow link objects */
+#define FOLLOW_PATH (1<<1) /* Follow the path in a table */
+#define HARD_LOOKUP (1<<2) /* Block until successful */
+#define ALL_RESULTS (1<<3) /* Retrieve all results */
+#define NO_CACHE (1<<4) /* Do not return 'cached' results */
+#define MASTER_ONLY (1<<5) /* Get value only from master server */
+#define EXPAND_NAME (1<<6) /* Expand partitially qualified names */
+
+/* Semantic modification for table operations flags */
+#define RETURN_RESULT (1<<7) /* Return resulting object to client */
+#define ADD_OVERWRITE (1<<8) /* Allow overwrites on ADD */
+#define REM_MULTIPLE (1<<9) /* Allow wildcard deletes */
+#define MOD_SAMEOBJ (1<<10) /* Check modified object before write */
+#define ADD_RESERVED (1<<11) /* Spare ADD semantic */
+#define REM_RESERVED (1<<12) /* Spare REM semantic */
+#ifdef ORIGINAL_DECLS
+#define MOD_RESERVED (1<<13) /* Spare MOD semantic */
+#else
+#define MOD_EXCLUSIVE (1<<13) /* Modify no overwrite on modified keys */
+#endif
+
+/* Transport specific modifications to the operation */
+#define USE_DGRAM (1<<16) /* Use a datagram transport */
+#define NO_AUTHINFO (1<<17) /* Don't bother attaching auth info */
+
+/*
+ * Declarations for "standard" NIS+ tags
+ * State variable tags have values 0 - 2047
+ * Statistic tags have values 2048 - 65535
+ * User Tags have values >2^16
+ */
+#define TAG_DEBUG 1 /* set debug level */
+#define TAG_STATS 2 /* Enable/disable statistics */
+#define TAG_GCACHE 3 /* Flush the Group Cache */
+#ifndef ORIGINAL_DECLS
+#define TAG_GCACHE_ALL TAG_GCACHE
+#endif
+#define TAG_DCACHE 4 /* Flush the directory cache */
+#ifndef ORIGINAL_DECLS
+#define TAG_DCACHE_ONE TAG_DCACHE
+#endif
+#define TAG_OCACHE 5 /* Flush the Object Cache */
+#define TAG_SECURE 6 /* Set the security level */
+#ifndef ORIGINAL_DECLS
+#define TAG_TCACHE_ONE 7 /* Flush the table cache */
+#define TAG_DCACHE_ALL 8 /* Flush entire directory cache */
+#define TAG_TCACHE_ALL 9 /* Flush entire table cache */
+#define TAG_GCACHE_ONE 10 /* Flush one group object */
+#define TAG_DCACHE_ONE_REFRESH 11 /* Flush and refresh one DO */
+#endif
+
+#define TAG_OPSTATS 2048 /* NIS+ operations statistics */
+#define TAG_THREADS 2049 /* Child process/thread status */
+#define TAG_HEAP 2050 /* Heap usage statistics */
+#define TAG_UPDATES 2051 /* Updates to this service */
+#define TAG_VISIBLE 2052 /* First update that isn't replicated */
+#define TAG_S_DCACHE 2053 /* Directory cache statistics */
+#define TAG_S_OCACHE 2054 /* Object cache statistics */
+#define TAG_S_GCACHE 2055 /* Group cache statistics */
+#define TAG_S_STORAGE 2056 /* Group cache statistics */
+#define TAG_UPTIME 2057 /* Time that server has been up */
+#ifndef ORIGINAL_DECLS
+#define TAG_DIRLIST 2058 /* Dir served by this server */
+#define TAG_NISCOMPAT 2059 /* Whether supports NIS compat mode */
+#define TAG_DNSFORWARDING 2060 /* Whether DNS forwarding supported*/
+#define TAG_SECURITY_LEVEL 2061 /* Security level of the server */
+#define TAG_ROOTSERVER 2062 /* Whether root server */
+#endif
+
+/*
+ * Declarations for the Group object flags. Currently
+ * there are only 3.
+ */
+#define IMPMEM_GROUPS 1 /* Implicit Membership allowed */
+#define RECURS_GROUPS 2 /* Recursive Groups allowed */
+#define NEGMEM_GROUPS 4 /* Negative Groups allowed */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RPCSVC_NIS_TAGS_H */
diff --git a/freebsd/include/rpcsvc/nislib.h b/freebsd/include/rpcsvc/nislib.h
new file mode 100644
index 00000000..754affe9
--- /dev/null
+++ b/freebsd/include/rpcsvc/nislib.h
@@ -0,0 +1,188 @@
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ *
+ * $FreeBSD$
+ */
+
+/*
+ * Copyright (c) 1991, Sun Microsystems Inc.
+ */
+
+/*
+ * This file contains the interfaces that are visible in the SunOS 5.x
+ * implementation of NIS Plus.
+ */
+
+#ifndef _RPCSVC_NISLIB_H
+#define _RPCSVC_NISLIB_H
+
+/* From: #pragma ident "@(#)nislib.h 1.16 94/05/03 SMI" */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct signature {
+ int signature_len;
+ char *signature_val;
+};
+
+extern void nis_freeresult(nis_result *);
+extern nis_result * nis_lookup(nis_name, u_long);
+extern nis_result * nis_list(nis_name, u_long,
+ int (*)(nis_name, nis_object *, void *), void *);
+extern nis_result * nis_add(nis_name, nis_object *);
+extern nis_result * nis_remove(nis_name, nis_object *);
+extern nis_result * nis_modify(nis_name, nis_object *);
+
+extern nis_result * nis_add_entry(nis_name, nis_object *, u_long);
+extern nis_result * nis_remove_entry(nis_name, nis_object *, u_long);
+extern nis_result * nis_modify_entry(nis_name, nis_object *, u_long);
+extern nis_result * nis_first_entry(nis_name);
+extern nis_result * nis_next_entry(nis_name, netobj *);
+
+extern nis_error nis_mkdir(nis_name, nis_server *);
+extern nis_error nis_rmdir(nis_name, nis_server *);
+extern name_pos nis_dir_cmp(nis_name, nis_name);
+
+extern nis_name * nis_getnames(nis_name);
+extern void nis_freenames(nis_name *);
+extern nis_name nis_domain_of(nis_name);
+extern nis_name nis_leaf_of(nis_name);
+extern nis_name nis_leaf_of_r(const nis_name, char *, size_t);
+extern nis_name nis_name_of(nis_name);
+extern nis_name nis_local_group(void);
+extern nis_name nis_local_directory(void);
+extern nis_name nis_local_principal(void);
+extern nis_name nis_local_host(void);
+
+extern void nis_destroy_object(nis_object *);
+extern nis_object * nis_clone_object(nis_object *, nis_object *);
+extern void nis_print_object(nis_object *);
+
+extern char * nis_sperrno(nis_error);
+extern void nis_perror(nis_error, char *);
+extern char * nis_sperror(nis_error, char *);
+extern void nis_lerror(nis_error, char *);
+
+extern void nis_print_group_entry(nis_name);
+extern bool_t nis_ismember(nis_name, nis_name);
+extern nis_error nis_creategroup(nis_name, u_long);
+extern nis_error nis_destroygroup(nis_name);
+extern nis_error nis_addmember(nis_name, nis_name);
+extern nis_error nis_removemember(nis_name, nis_name);
+extern nis_error nis_verifygroup(nis_name);
+
+extern void nis_freeservlist(nis_server **);
+extern nis_server ** nis_getservlist(nis_name);
+extern nis_error nis_stats(nis_server *, nis_tag *, int, nis_tag **);
+extern nis_error nis_servstate(nis_server *, nis_tag *, int, nis_tag **);
+extern void nis_freetags(nis_tag *, int);
+
+extern nis_result * nis_checkpoint(nis_name);
+extern void nis_ping(nis_name, u_long, nis_object *);
+
+/*
+ * XXX: PLEASE NOTE THAT THE FOLLOWING FUNCTIONS ARE INTERNAL
+ * TO NIS+ AND SHOULD NOT BE USED BY ANY APPLICATION PROGRAM.
+ * THEIR SEMANTICS AND/OR SIGNATURE CAN CHANGE WITHOUT NOTICE.
+ * SO, PLEASE DO NOT USE THEM. YOU ARE WARNED!!!!
+ */
+
+extern char ** __break_name(nis_name, int *);
+extern int __name_distance(char **, char **);
+extern nis_result * nis_make_error(nis_error, u_long, u_long, u_long, u_long);
+extern nis_attr * __cvt2attr(int *, char **);
+extern void nis_free_request(ib_request *);
+extern nis_error nis_get_request(nis_name, nis_object *, netobj*, ib_request*);
+extern nis_object * nis_read_obj(char *);
+extern int nis_write_obj(char *, nis_object *);
+extern int nis_in_table(nis_name, NIS_HASH_TABLE *, int *);
+extern int nis_insert_item(NIS_HASH_ITEM *, NIS_HASH_TABLE *);
+extern NIS_HASH_ITEM * nis_find_item(nis_name, NIS_HASH_TABLE *);
+extern NIS_HASH_ITEM * nis_remove_item(nis_name, NIS_HASH_TABLE *);
+extern void nis_insert_name(nis_name, NIS_HASH_TABLE *);
+extern void nis_remove_name(nis_name, NIS_HASH_TABLE *);
+extern CLIENT * nis_make_rpchandle(nis_server *, int, u_long, u_long, u_long,
+ int, int);
+extern void * nis_get_static_storage(struct nis_sdata *, u_long, u_long);
+extern char * nis_data(char *);
+extern void nis_print_rights(u_long);
+extern void nis_print_directory(directory_obj *);
+extern void nis_print_group(group_obj *);
+extern void nis_print_table(table_obj *);
+extern void nis_print_link(link_obj *);
+extern void nis_print_entry(entry_obj *);
+extern nis_object * nis_get_object(char *, char *, char *, u_long, u_long,
+ zotypes);
+extern nis_server * __nis_init_callback(CLIENT *,
+ int (*)(nis_name, nis_object *, void *), void *);
+extern int nis_getdtblsize(void);
+extern int __nis_run_callback(netobj *, u_long, struct timeval *, CLIENT *);
+
+extern log_result *nis_dumplog(nis_server *, nis_name, u_long);
+extern log_result *nis_dump(nis_server *, nis_name,
+ int (*)(nis_name, nis_object *, void *));
+
+extern bool_t __do_ismember(nis_name, nis_name,
+ nis_result *(*)(nis_name, u_long));
+extern nis_name __nis_map_group(nis_name);
+extern nis_name __nis_map_group_r(nis_name, char*, size_t);
+
+extern nis_error __nis_CacheBind(char *, directory_obj *);
+extern nis_error __nis_CacheSearch(char *, directory_obj *);
+extern bool_t __nis_CacheRemoveEntry(directory_obj *);
+extern void __nis_CacheRestart(void);
+extern void __nis_CachePrint(void);
+extern void __nis_CacheDumpStatistics(void);
+extern bool_t writeColdStartFile(directory_obj *);
+
+extern CLIENT * __get_ti_clnt(char *, CLIENT *, char **, pid_t *);
+extern int __strcmp_case_insens(char *, char *);
+extern int __strncmp_case_insens(char *, char *);
+
+extern fd_result * nis_finddirectory(directory_obj *, nis_name);
+extern int __start_clock(int);
+extern u_long __stop_clock(int);
+
+/*
+ * This particular function is part of the FreeBSD NIS+ implementation
+ * only. Ideally it should be somewhere else, but it is used by both
+ * rpc.nisd and nis_cachemgr, and there aren't that many headers common
+ * to both programs.
+ */
+
+extern struct signature *__nis_calculate_encrypted_cksum(unsigned char *, unsigned int, char *, int);
+
+#define NUL '\0'
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RPCSVC_NISLIB_H */
diff --git a/freebsd/include/rpcsvc/yp_prot.h b/freebsd/include/rpcsvc/yp_prot.h
new file mode 100644
index 00000000..10d58289
--- /dev/null
+++ b/freebsd/include/rpcsvc/yp_prot.h
@@ -0,0 +1,329 @@
+/*
+ * Copyright (c) 1992/3 Theo de Raadt <deraadt@fsa.ca>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _RPCSVC_YP_PROT_H_
+#define _RPCSVC_YP_PROT_H_
+
+/*
+ * YPSERV PROTOCOL:
+ *
+ * ypserv supports the following procedures:
+ *
+ * YPPROC_NULL takes (void), returns (void).
+ * called to check if server is alive.
+ * YPPROC_DOMAIN takes (char *), returns (bool_t).
+ * true if ypserv serves the named domain.
+ * YPPROC_DOMAIN_NOACK takes (char *), returns (bool_t).
+ * true if ypserv serves the named domain.
+ * used for broadcasts, does not ack if ypserv
+ * doesn't handle named domain.
+ * YPPROC_MATCH takes (struct ypreq_key), returns (struct ypresp_val)
+ * does a lookup.
+ * YPPROC_FIRST takes (struct ypreq_nokey) returns (ypresp_key_val).
+ * gets the first key/datum from the map.
+ * YPPROC_NEXT takes (struct ypreq_key) returns (ypresp_key_val).
+ * gets the next key/datum from the map.
+ * YPPROC_XFR takes (struct ypreq_xfr), returns (void).
+ * tells ypserv to check if there is a new version of
+ * the map.
+ * YPPROC_CLEAR takes (void), returns (void).
+ * tells ypserv to flush it's file cache, so that
+ * newly transferred files will get read.
+ * YPPROC_ALL takes (struct ypreq_nokey), returns (bool_t and
+ * struct ypresp_key_val).
+ * returns an array of data, with the bool_t being
+ * false on the last datum. read the source, it's
+ * convoluted.
+ * YPPROC_MASTER takes (struct ypreq_nokey), returns (ypresp_master).
+ * YPPROC_ORDER takes (struct ypreq_nokey), returns (ypresp_order).
+ * YPPROC_MAPLIST takes (char *), returns (struct ypmaplist *).
+ */
+
+#ifndef BOOL_DEFINED
+typedef u_int bool;
+#define BOOL_DEFINED
+#endif
+
+/* Program and version symbols, magic numbers */
+
+#define YPPROG ((u_long)100004)
+#define YPVERS ((u_long)2)
+#define YPVERS_ORIG ((u_long)1)
+#define YPMAXRECORD ((u_long)1024)
+#define YPMAXDOMAIN ((u_long)64)
+#define YPMAXMAP ((u_long)64)
+#define YPMAXPEER ((u_long)256)
+
+/*
+ * I don't know if anything of sun's depends on this, or if they
+ * simply defined it so that their own code wouldn't try to send
+ * packets over the ethernet MTU. This YP code doesn't use it.
+ */
+#define YPMSGSZ 1600
+
+#ifndef DATUM
+typedef struct {
+ char *dptr;
+ int dsize;
+} datum;
+#define DATUM
+#endif
+
+struct ypmap_parms {
+ char *domain;
+ char *map;
+ u_int ordernum;
+ char *owner;
+};
+
+struct ypreq_key {
+ char *domain;
+ char *map;
+ datum keydat;
+};
+
+struct ypreq_nokey {
+ char *domain;
+ char *map;
+};
+
+struct ypreq_xfr {
+ struct ypmap_parms map_parms;
+ u_int transid;
+ u_int proto;
+ u_int port;
+};
+#define ypxfr_domain map_parms.domain
+#define ypxfr_map map_parms.map
+#define ypxfr_ordernum map_parms.ordernum
+#define ypxfr_owner map_parms.owner
+
+struct ypresp_val {
+ u_int status;
+ datum valdat;
+};
+
+struct ypresp_key_val {
+ u_int status;
+ datum keydat;
+ datum valdat;
+};
+
+struct ypresp_master {
+ u_int status;
+ char *master;
+};
+
+struct ypresp_order {
+ u_int status;
+ u_int ordernum;
+};
+
+struct ypmaplist {
+ char *ypml_name;
+ struct ypmaplist *ypml_next;
+};
+
+struct ypresp_maplist {
+ u_int status;
+ struct ypmaplist *list;
+};
+
+/* ypserv procedure numbers */
+#define YPPROC_NULL ((u_long)0)
+#define YPPROC_DOMAIN ((u_long)1)
+#define YPPROC_DOMAIN_NONACK ((u_long)2)
+#define YPPROC_MATCH ((u_long)3)
+#define YPPROC_FIRST ((u_long)4)
+#define YPPROC_NEXT ((u_long)5)
+#define YPPROC_XFR ((u_long)6)
+#define YPPROC_CLEAR ((u_long)7)
+#define YPPROC_ALL ((u_long)8)
+#define YPPROC_MASTER ((u_long)9)
+#define YPPROC_ORDER ((u_long)10)
+#define YPPROC_MAPLIST ((u_long)11)
+
+/* ypserv procedure return status values */
+#define YP_TRUE ((long)1) /* general purpose success code */
+#define YP_NOMORE ((long)2) /* no more entries in map */
+#define YP_FALSE ((long)0) /* general purpose failure code */
+#define YP_NOMAP ((long)-1) /* no such map in domain */
+#define YP_NODOM ((long)-2) /* domain not supported */
+#define YP_NOKEY ((long)-3) /* no such key in map */
+#define YP_BADOP ((long)-4) /* invalid operation */
+#define YP_BADDB ((long)-5) /* server data base is bad */
+#define YP_YPERR ((long)-6) /* YP server error */
+#define YP_BADARGS ((long)-7) /* request arguments bad */
+#define YP_VERS ((long)-8) /* YP server version mismatch */
+
+/*
+ * Sun's header file says:
+ * "Domain binding data structure, used by ypclnt package and ypserv modules.
+ * Users of the ypclnt package (or of this protocol) don't HAVE to know about
+ * it, but it must be available to users because _yp_dobind is a public
+ * interface."
+ *
+ * This is totally bogus! Nowhere else does Sun state that _yp_dobind() is
+ * a public interface, and I don't know any reason anyone would want to call
+ * it. But, just in case anyone does actually expect it to be available..
+ * we provide this.. exactly as Sun wants it.
+ */
+struct dom_binding {
+ struct dom_binding *dom_pnext;
+ char dom_domain[YPMAXDOMAIN + 1];
+ struct sockaddr_in dom_server_addr;
+ u_short dom_server_port;
+ int dom_socket;
+ CLIENT *dom_client;
+ u_short dom_local_port;
+ long dom_vers;
+};
+
+/*
+ * YPBIND PROTOCOL:
+ *
+ * ypbind supports the following procedures:
+ *
+ * YPBINDPROC_NULL takes (void), returns (void).
+ * to check if ypbind is running.
+ * YPBINDPROC_DOMAIN takes (char *), returns (struct ypbind_resp).
+ * requests that ypbind start to serve the
+ * named domain (if it doesn't already)
+ * YPBINDPROC_SETDOM takes (struct ypbind_setdom), returns (void).
+ * used by ypset.
+ */
+
+#define YPBINDPROG ((u_long)100007)
+#define YPBINDVERS ((u_long)2)
+#define YPBINDVERS_ORIG ((u_long)1)
+
+/* ypbind procedure numbers */
+#define YPBINDPROC_NULL ((u_long)0)
+#define YPBINDPROC_DOMAIN ((u_long)1)
+#define YPBINDPROC_SETDOM ((u_long)2)
+
+/* error code in ypbind_resp.ypbind_status */
+enum ypbind_resptype {
+ YPBIND_SUCC_VAL = 1,
+ YPBIND_FAIL_VAL = 2
+};
+
+/* network order, of course */
+struct ypbind_binding {
+ struct in_addr ypbind_binding_addr;
+ u_short ypbind_binding_port;
+};
+
+struct ypbind_resp {
+ enum ypbind_resptype ypbind_status;
+ union {
+ u_int ypbind_error;
+ struct ypbind_binding ypbind_bindinfo;
+ } ypbind_respbody;
+};
+
+/* error code in ypbind_resp.ypbind_respbody.ypbind_error */
+#define YPBIND_ERR_ERR 1 /* internal error */
+#define YPBIND_ERR_NOSERV 2 /* no bound server for passed domain */
+#define YPBIND_ERR_RESC 3 /* system resource allocation failure */
+
+/*
+ * Request data structure for ypbind "Set domain" procedure.
+ */
+struct ypbind_setdom {
+ char ypsetdom_domain[YPMAXDOMAIN + 1];
+ struct ypbind_binding ypsetdom_binding;
+ u_int ypsetdom_vers;
+};
+#define ypsetdom_addr ypsetdom_binding.ypbind_binding_addr
+#define ypsetdom_port ypsetdom_binding.ypbind_binding_port
+
+/*
+ * YPPUSH PROTOCOL:
+ *
+ * Sun says:
+ * "Protocol between clients (ypxfr, only) and yppush
+ * yppush speaks a protocol in the transient range, which
+ * is supplied to ypxfr as a command-line parameter when it
+ * is activated by ypserv."
+ *
+ * This protocol is not implemented, naturally, because this YP
+ * implementation only does the client side.
+ */
+#define YPPUSHVERS ((u_long)1)
+#define YPPUSHVERS_ORIG ((u_long)1)
+
+/* yppush procedure numbers */
+#define YPPUSHPROC_NULL ((u_long)0)
+#define YPPUSHPROC_XFRRESP ((u_long)1)
+
+struct yppushresp_xfr {
+ u_int transid;
+ u_int status;
+};
+
+/* yppush status value in yppushresp_xfr.status */
+#define YPPUSH_SUCC ((long)1) /* Success */
+#define YPPUSH_AGE ((long)2) /* Master's version not newer */
+#define YPPUSH_NOMAP ((long)-1) /* Can't find server for map */
+#define YPPUSH_NODOM ((long)-2) /* Domain not supported */
+#define YPPUSH_RSRC ((long)-3) /* Local resource alloc failure */
+#define YPPUSH_RPC ((long)-4) /* RPC failure talking to server */
+#define YPPUSH_MADDR ((long)-5) /* Can't get master address */
+#define YPPUSH_YPERR ((long)-6) /* YP server/map db error */
+#define YPPUSH_BADARGS ((long)-7) /* Request arguments bad */
+#define YPPUSH_DBM ((long)-8) /* Local dbm operation failed */
+#define YPPUSH_FILE ((long)-9) /* Local file I/O operation failed */
+#define YPPUSH_SKEW ((long)-10) /* Map version skew during transfer */
+#define YPPUSH_CLEAR ((long)-11) /* Can't send "Clear" req to local ypserv */
+#define YPPUSH_FORCE ((long)-12) /* No local order number in map - use -f */
+#define YPPUSH_XFRERR ((long)-13) /* ypxfr error */
+#define YPPUSH_REFUSED ((long)-14) /* Transfer request refused by ypserv */
+
+struct inaddr;
+__BEGIN_DECLS
+bool_t xdr_datum(XDR *, datum *);
+bool_t xdr_ypreq_key(XDR *, struct ypreq_key *);
+bool_t xdr_ypreq_nokey(XDR *, struct ypreq_nokey *);
+bool_t xdr_ypreq_xfr(XDR *, struct ypreq_xfr *);
+bool_t xdr_ypresp_val(XDR *, struct ypresp_val *);
+bool_t xdr_ypresp_key_val(XDR *, struct ypresp_key_val *);
+bool_t xdr_ypbind_resp(XDR *, struct ypbind_resp *);
+bool_t xdr_ypbind_setdom(XDR *, struct ypbind_setdom *);
+bool_t xdr_yp_inaddr(XDR *, struct inaddr *);
+bool_t xdr_ypmap_parms(XDR *, struct ypmap_parms *);
+bool_t xdr_yppushresp_xfr(XDR *, struct yppushresp_xfr *);
+bool_t xdr_ypresp_order(XDR *, struct ypresp_order *);
+bool_t xdr_ypresp_master(XDR *, struct ypresp_master *);
+bool_t xdr_ypresp_maplist(XDR *, struct ypresp_maplist *);
+__END_DECLS
+
+#endif /* _RPCSVC_YP_PROT_H_ */
diff --git a/freebsd/include/rpcsvc/ypclnt.h b/freebsd/include/rpcsvc/ypclnt.h
new file mode 100644
index 00000000..abde97c3
--- /dev/null
+++ b/freebsd/include/rpcsvc/ypclnt.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 1992/3 Theo de Raadt <deraadt@fsa.ca>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _RPCSVC_YPCLNT_H_
+#define _RPCSVC_YPCLNT_H_
+
+#include <sys/cdefs.h>
+
+#define YPERR_BADARGS 1 /* args to function are bad */
+#define YPERR_RPC 2 /* RPC failure */
+#define YPERR_DOMAIN 3 /* can't bind to a server for domain */
+#define YPERR_MAP 4 /* no such map in server's domain */
+#define YPERR_KEY 5 /* no such key in map */
+#define YPERR_YPERR 6 /* some internal YP server or client error */
+#define YPERR_RESRC 7 /* local resource allocation failure */
+#define YPERR_NOMORE 8 /* no more records in map database */
+#define YPERR_PMAP 9 /* can't communicate with portmapper */
+#define YPERR_YPBIND 10 /* can't communicate with ypbind */
+#define YPERR_YPSERV 11 /* can't communicate with ypserv */
+#define YPERR_NODOM 12 /* local domain name not set */
+#define YPERR_BADDB 13 /* YP data base is bad */
+#define YPERR_VERS 14 /* YP version mismatch */
+#define YPERR_ACCESS 15 /* access violation */
+#define YPERR_BUSY 16 /* database is busy */
+
+/*
+ * Types of update operations
+ */
+#define YPOP_CHANGE 1 /* change, do not add */
+#define YPOP_INSERT 2 /* add, do not change */
+#define YPOP_DELETE 3 /* delete this entry */
+#define YPOP_STORE 4 /* add, or change */
+
+struct ypall_callback {
+ /* return non-0 to stop getting called */
+ int (*foreach)(unsigned long, char *, int, char *, int, void *);
+ char *data; /* opaque pointer for use of callback fn */
+};
+
+struct dom_binding;
+struct ypmaplist;
+struct ypall_callback;
+
+__BEGIN_DECLS
+int yp_bind(char *dom);
+int _yp_dobind(char *dom, struct dom_binding **ypdb);
+void yp_unbind(char *dom);
+int yp_get_default_domain(char **domp);
+int yp_match(char *indomain, char *inmap, const char *inkey, int inkeylen,
+ char **outval, int *outvallen);
+int yp_first(char *indomain, char *inmap, char **outkey, int *outkeylen,
+ char **outval, int *outvallen);
+int yp_next(char *indomain, char *inmap, char *inkey, int inkeylen,
+ char **outkey, int *outkeylen, char **outval, int *outvallen);
+int yp_maplist(char *indomain, struct ypmaplist **outmaplist);
+int yp_master(char *indomain, char *inmap, char **outname);
+int yp_order(char *indomain, char *inmap, int *outorder);
+int yp_all(char *indomain, char *inmap, struct ypall_callback *incallback);
+const char *yperr_string(int incode);
+const char *ypbinderr_string(int incode);
+int ypprot_err(unsigned int incode);
+__END_DECLS
+
+#endif /* _RPCSVC_YPCLNT_H_ */
+
diff --git a/freebsd/kern/kern_condvar.c b/freebsd/kern/kern_condvar.c
deleted file mode 100644
index 34ec29cb..00000000
--- a/freebsd/kern/kern_condvar.c
+++ /dev/null
@@ -1,455 +0,0 @@
-#include <freebsd/machine/rtems-bsd-config.h>
-
-/*-
- * Copyright (c) 2000 Jake Burkholder <jake@freebsd.org>.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <freebsd/sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <freebsd/local/opt_ktrace.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/ktr.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sched.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/sleepqueue.h>
-#include <freebsd/sys/resourcevar.h>
-#ifdef KTRACE
-#include <freebsd/sys/uio.h>
-#include <freebsd/sys/ktrace.h>
-#endif
-
-/*
- * Common sanity checks for cv_wait* functions.
- */
-#define CV_ASSERT(cvp, lock, td) do { \
- KASSERT((td) != NULL, ("%s: curthread NULL", __func__)); \
- KASSERT(TD_IS_RUNNING(td), ("%s: not TDS_RUNNING", __func__)); \
- KASSERT((cvp) != NULL, ("%s: cvp NULL", __func__)); \
- KASSERT((lock) != NULL, ("%s: lock NULL", __func__)); \
-} while (0)
-
-/*
- * Initialize a condition variable. Must be called before use.
- */
-void
-cv_init(struct cv *cvp, const char *desc)
-{
-
- cvp->cv_description = desc;
- cvp->cv_waiters = 0;
-}
-
-/*
- * Destroy a condition variable. The condition variable must be re-initialized
- * in order to be re-used.
- */
-void
-cv_destroy(struct cv *cvp)
-{
-#ifdef INVARIANTS
- struct sleepqueue *sq;
-
- sleepq_lock(cvp);
- sq = sleepq_lookup(cvp);
- sleepq_release(cvp);
- KASSERT(sq == NULL, ("%s: associated sleep queue non-empty", __func__));
-#endif
-}
-
-/*
- * Wait on a condition variable. The current thread is placed on the condition
- * variable's wait queue and suspended. A cv_signal or cv_broadcast on the same
- * condition variable will resume the thread. The mutex is released before
- * sleeping and will be held on return. It is recommended that the mutex be
- * held when cv_signal or cv_broadcast are called.
- */
-void
-_cv_wait(struct cv *cvp, struct lock_object *lock)
-{
- WITNESS_SAVE_DECL(lock_witness);
- struct lock_class *class;
- struct thread *td;
- int lock_state;
-
- td = curthread;
- lock_state = 0;
-#ifdef KTRACE
- if (KTRPOINT(td, KTR_CSW))
- ktrcsw(1, 0);
-#endif
- CV_ASSERT(cvp, lock, td);
- WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock,
- "Waiting on \"%s\"", cvp->cv_description);
- class = LOCK_CLASS(lock);
-
- if (cold || panicstr) {
- /*
- * During autoconfiguration, just give interrupts
- * a chance, then just return. Don't run any other
- * thread or panic below, in case this is the idle
- * process and already asleep.
- */
- return;
- }
-
- sleepq_lock(cvp);
-
- cvp->cv_waiters++;
- if (lock == &Giant.lock_object)
- mtx_assert(&Giant, MA_OWNED);
- DROP_GIANT();
-
- sleepq_add(cvp, lock, cvp->cv_description, SLEEPQ_CONDVAR, 0);
- if (lock != &Giant.lock_object) {
- if (class->lc_flags & LC_SLEEPABLE)
- sleepq_release(cvp);
- WITNESS_SAVE(lock, lock_witness);
- lock_state = class->lc_unlock(lock);
- if (class->lc_flags & LC_SLEEPABLE)
- sleepq_lock(cvp);
- }
- sleepq_wait(cvp, 0);
-
-#ifdef KTRACE
- if (KTRPOINT(td, KTR_CSW))
- ktrcsw(0, 0);
-#endif
- PICKUP_GIANT();
- if (lock != &Giant.lock_object) {
- class->lc_lock(lock, lock_state);
- WITNESS_RESTORE(lock, lock_witness);
- }
-}
-
-/*
- * Wait on a condition variable. This function differs from cv_wait by
- * not aquiring the mutex after condition variable was signaled.
- */
-void
-_cv_wait_unlock(struct cv *cvp, struct lock_object *lock)
-{
- struct lock_class *class;
- struct thread *td;
-
- td = curthread;
-#ifdef KTRACE
- if (KTRPOINT(td, KTR_CSW))
- ktrcsw(1, 0);
-#endif
- CV_ASSERT(cvp, lock, td);
- WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock,
- "Waiting on \"%s\"", cvp->cv_description);
- KASSERT(lock != &Giant.lock_object,
- ("cv_wait_unlock cannot be used with Giant"));
- class = LOCK_CLASS(lock);
-
- if (cold || panicstr) {
- /*
- * During autoconfiguration, just give interrupts
- * a chance, then just return. Don't run any other
- * thread or panic below, in case this is the idle
- * process and already asleep.
- */
- class->lc_unlock(lock);
- return;
- }
-
- sleepq_lock(cvp);
-
- cvp->cv_waiters++;
- DROP_GIANT();
-
- sleepq_add(cvp, lock, cvp->cv_description, SLEEPQ_CONDVAR, 0);
- if (class->lc_flags & LC_SLEEPABLE)
- sleepq_release(cvp);
- class->lc_unlock(lock);
- if (class->lc_flags & LC_SLEEPABLE)
- sleepq_lock(cvp);
- sleepq_wait(cvp, 0);
-
-#ifdef KTRACE
- if (KTRPOINT(td, KTR_CSW))
- ktrcsw(0, 0);
-#endif
- PICKUP_GIANT();
-}
-
-/*
- * Wait on a condition variable, allowing interruption by signals. Return 0 if
- * the thread was resumed with cv_signal or cv_broadcast, EINTR or ERESTART if
- * a signal was caught. If ERESTART is returned the system call should be
- * restarted if possible.
- */
-int
-_cv_wait_sig(struct cv *cvp, struct lock_object *lock)
-{
- WITNESS_SAVE_DECL(lock_witness);
- struct lock_class *class;
- struct thread *td;
- int lock_state, rval;
-
- td = curthread;
- lock_state = 0;
-#ifdef KTRACE
- if (KTRPOINT(td, KTR_CSW))
- ktrcsw(1, 0);
-#endif
- CV_ASSERT(cvp, lock, td);
- WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock,
- "Waiting on \"%s\"", cvp->cv_description);
- class = LOCK_CLASS(lock);
-
- if (cold || panicstr) {
- /*
- * After a panic, or during autoconfiguration, just give
- * interrupts a chance, then just return; don't run any other
- * procs or panic below, in case this is the idle process and
- * already asleep.
- */
- return (0);
- }
-
- sleepq_lock(cvp);
-
- cvp->cv_waiters++;
- if (lock == &Giant.lock_object)
- mtx_assert(&Giant, MA_OWNED);
- DROP_GIANT();
-
- sleepq_add(cvp, lock, cvp->cv_description, SLEEPQ_CONDVAR |
- SLEEPQ_INTERRUPTIBLE, 0);
- if (lock != &Giant.lock_object) {
- if (class->lc_flags & LC_SLEEPABLE)
- sleepq_release(cvp);
- WITNESS_SAVE(lock, lock_witness);
- lock_state = class->lc_unlock(lock);
- if (class->lc_flags & LC_SLEEPABLE)
- sleepq_lock(cvp);
- }
- rval = sleepq_wait_sig(cvp, 0);
-
-#ifdef KTRACE
- if (KTRPOINT(td, KTR_CSW))
- ktrcsw(0, 0);
-#endif
- PICKUP_GIANT();
- if (lock != &Giant.lock_object) {
- class->lc_lock(lock, lock_state);
- WITNESS_RESTORE(lock, lock_witness);
- }
-
- return (rval);
-}
-
-/*
- * Wait on a condition variable for at most timo/hz seconds. Returns 0 if the
- * process was resumed by cv_signal or cv_broadcast, EWOULDBLOCK if the timeout
- * expires.
- */
-int
-_cv_timedwait(struct cv *cvp, struct lock_object *lock, int timo)
-{
- WITNESS_SAVE_DECL(lock_witness);
- struct lock_class *class;
- struct thread *td;
- int lock_state, rval;
-
- td = curthread;
- lock_state = 0;
-#ifdef KTRACE
- if (KTRPOINT(td, KTR_CSW))
- ktrcsw(1, 0);
-#endif
- CV_ASSERT(cvp, lock, td);
- WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock,
- "Waiting on \"%s\"", cvp->cv_description);
- class = LOCK_CLASS(lock);
-
- if (cold || panicstr) {
- /*
- * After a panic, or during autoconfiguration, just give
- * interrupts a chance, then just return; don't run any other
- * thread or panic below, in case this is the idle process and
- * already asleep.
- */
- return 0;
- }
-
- sleepq_lock(cvp);
-
- cvp->cv_waiters++;
- if (lock == &Giant.lock_object)
- mtx_assert(&Giant, MA_OWNED);
- DROP_GIANT();
-
- sleepq_add(cvp, lock, cvp->cv_description, SLEEPQ_CONDVAR, 0);
- sleepq_set_timeout(cvp, timo);
- if (lock != &Giant.lock_object) {
- if (class->lc_flags & LC_SLEEPABLE)
- sleepq_release(cvp);
- WITNESS_SAVE(lock, lock_witness);
- lock_state = class->lc_unlock(lock);
- if (class->lc_flags & LC_SLEEPABLE)
- sleepq_lock(cvp);
- }
- rval = sleepq_timedwait(cvp, 0);
-
-#ifdef KTRACE
- if (KTRPOINT(td, KTR_CSW))
- ktrcsw(0, 0);
-#endif
- PICKUP_GIANT();
- if (lock != &Giant.lock_object) {
- class->lc_lock(lock, lock_state);
- WITNESS_RESTORE(lock, lock_witness);
- }
-
- return (rval);
-}
-
-/*
- * Wait on a condition variable for at most timo/hz seconds, allowing
- * interruption by signals. Returns 0 if the thread was resumed by cv_signal
- * or cv_broadcast, EWOULDBLOCK if the timeout expires, and EINTR or ERESTART if
- * a signal was caught.
- */
-int
-_cv_timedwait_sig(struct cv *cvp, struct lock_object *lock, int timo)
-{
- WITNESS_SAVE_DECL(lock_witness);
- struct lock_class *class;
- struct thread *td;
- int lock_state, rval;
-
- td = curthread;
- lock_state = 0;
-#ifdef KTRACE
- if (KTRPOINT(td, KTR_CSW))
- ktrcsw(1, 0);
-#endif
- CV_ASSERT(cvp, lock, td);
- WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock,
- "Waiting on \"%s\"", cvp->cv_description);
- class = LOCK_CLASS(lock);
-
- if (cold || panicstr) {
- /*
- * After a panic, or during autoconfiguration, just give
- * interrupts a chance, then just return; don't run any other
- * thread or panic below, in case this is the idle process and
- * already asleep.
- */
- return 0;
- }
-
- sleepq_lock(cvp);
-
- cvp->cv_waiters++;
- if (lock == &Giant.lock_object)
- mtx_assert(&Giant, MA_OWNED);
- DROP_GIANT();
-
- sleepq_add(cvp, lock, cvp->cv_description, SLEEPQ_CONDVAR |
- SLEEPQ_INTERRUPTIBLE, 0);
- sleepq_set_timeout(cvp, timo);
- if (lock != &Giant.lock_object) {
- if (class->lc_flags & LC_SLEEPABLE)
- sleepq_release(cvp);
- WITNESS_SAVE(lock, lock_witness);
- lock_state = class->lc_unlock(lock);
- if (class->lc_flags & LC_SLEEPABLE)
- sleepq_lock(cvp);
- }
- rval = sleepq_timedwait_sig(cvp, 0);
-
-#ifdef KTRACE
- if (KTRPOINT(td, KTR_CSW))
- ktrcsw(0, 0);
-#endif
- PICKUP_GIANT();
- if (lock != &Giant.lock_object) {
- class->lc_lock(lock, lock_state);
- WITNESS_RESTORE(lock, lock_witness);
- }
-
- return (rval);
-}
-
-/*
- * Signal a condition variable, wakes up one waiting thread. Will also wakeup
- * the swapper if the process is not in memory, so that it can bring the
- * sleeping process in. Note that this may also result in additional threads
- * being made runnable. Should be called with the same mutex as was passed to
- * cv_wait held.
- */
-void
-cv_signal(struct cv *cvp)
-{
- int wakeup_swapper;
-
- wakeup_swapper = 0;
- sleepq_lock(cvp);
- if (cvp->cv_waiters > 0) {
- cvp->cv_waiters--;
- wakeup_swapper = sleepq_signal(cvp, SLEEPQ_CONDVAR, 0, 0);
- }
- sleepq_release(cvp);
- if (wakeup_swapper)
- kick_proc0();
-}
-
-/*
- * Broadcast a signal to a condition variable. Wakes up all waiting threads.
- * Should be called with the same mutex as was passed to cv_wait held.
- */
-void
-cv_broadcastpri(struct cv *cvp, int pri)
-{
- int wakeup_swapper;
-
- /*
- * XXX sleepq_broadcast pri argument changed from -1 meaning
- * no pri to 0 meaning no pri.
- */
- wakeup_swapper = 0;
- if (pri == -1)
- pri = 0;
- sleepq_lock(cvp);
- if (cvp->cv_waiters > 0) {
- cvp->cv_waiters = 0;
- wakeup_swapper = sleepq_broadcast(cvp, SLEEPQ_CONDVAR, pri, 0);
- }
- sleepq_release(cvp);
- if (wakeup_swapper)
- kick_proc0();
-}
diff --git a/freebsd/lib/libc/db/btree/bt_close.c b/freebsd/lib/libc/db/btree/bt_close.c
index b15d67ca..76220443 100644
--- a/freebsd/lib/libc/db/btree/bt_close.c
+++ b/freebsd/lib/libc/db/btree/bt_close.c
@@ -39,7 +39,7 @@ static char sccsid[] = "@(#)bt_close.c 8.7 (Berkeley) 8/17/94";
__FBSDID("$FreeBSD$");
#include "namespace.h"
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <errno.h>
#include <stdio.h>
diff --git a/freebsd/lib/libc/db/btree/bt_conv.c b/freebsd/lib/libc/db/btree/bt_conv.c
index d84da442..91cbf872 100644
--- a/freebsd/lib/libc/db/btree/bt_conv.c
+++ b/freebsd/lib/libc/db/btree/bt_conv.c
@@ -38,7 +38,7 @@ static char sccsid[] = "@(#)bt_conv.c 8.5 (Berkeley) 8/17/94";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <stdio.h>
diff --git a/freebsd/lib/libc/db/btree/bt_debug.c b/freebsd/lib/libc/db/btree/bt_debug.c
index ce7849a9..c8c5878c 100644
--- a/freebsd/lib/libc/db/btree/bt_debug.c
+++ b/freebsd/lib/libc/db/btree/bt_debug.c
@@ -38,7 +38,7 @@ static char sccsid[] = "@(#)bt_debug.c 8.5 (Berkeley) 8/17/94";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/freebsd/lib/libc/db/btree/bt_delete.c b/freebsd/lib/libc/db/btree/bt_delete.c
index ac295016..258e318b 100644
--- a/freebsd/lib/libc/db/btree/bt_delete.c
+++ b/freebsd/lib/libc/db/btree/bt_delete.c
@@ -38,7 +38,7 @@ static char sccsid[] = "@(#)bt_delete.c 8.13 (Berkeley) 7/28/94";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <errno.h>
#include <stdio.h>
diff --git a/freebsd/lib/libc/db/btree/bt_get.c b/freebsd/lib/libc/db/btree/bt_get.c
index b335e1ba..23f629b8 100644
--- a/freebsd/lib/libc/db/btree/bt_get.c
+++ b/freebsd/lib/libc/db/btree/bt_get.c
@@ -38,7 +38,7 @@ static char sccsid[] = "@(#)bt_get.c 8.6 (Berkeley) 7/20/94";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <errno.h>
#include <stddef.h>
diff --git a/freebsd/lib/libc/db/btree/bt_open.c b/freebsd/lib/libc/db/btree/bt_open.c
index 1e37c0e5..1be97b49 100644
--- a/freebsd/lib/libc/db/btree/bt_open.c
+++ b/freebsd/lib/libc/db/btree/bt_open.c
@@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$");
*/
#include "namespace.h"
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/stat.h>
#include <errno.h>
diff --git a/freebsd/lib/libc/db/btree/bt_overflow.c b/freebsd/lib/libc/db/btree/bt_overflow.c
index 7079453a..8d6ebc4d 100644
--- a/freebsd/lib/libc/db/btree/bt_overflow.c
+++ b/freebsd/lib/libc/db/btree/bt_overflow.c
@@ -38,7 +38,7 @@ static char sccsid[] = "@(#)bt_overflow.c 8.5 (Berkeley) 7/16/94";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/freebsd/lib/libc/db/btree/bt_page.c b/freebsd/lib/libc/db/btree/bt_page.c
index dc30566b..c04c1ca9 100644
--- a/freebsd/lib/libc/db/btree/bt_page.c
+++ b/freebsd/lib/libc/db/btree/bt_page.c
@@ -35,7 +35,7 @@ static char sccsid[] = "@(#)bt_page.c 8.3 (Berkeley) 7/14/94";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <stdio.h>
diff --git a/freebsd/lib/libc/db/btree/bt_put.c b/freebsd/lib/libc/db/btree/bt_put.c
index 51c241c7..ee1d22f9 100644
--- a/freebsd/lib/libc/db/btree/bt_put.c
+++ b/freebsd/lib/libc/db/btree/bt_put.c
@@ -38,7 +38,7 @@ static char sccsid[] = "@(#)bt_put.c 8.8 (Berkeley) 7/26/94";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <errno.h>
#include <stdio.h>
diff --git a/freebsd/lib/libc/db/btree/bt_search.c b/freebsd/lib/libc/db/btree/bt_search.c
index d5e859bc..68245d89 100644
--- a/freebsd/lib/libc/db/btree/bt_search.c
+++ b/freebsd/lib/libc/db/btree/bt_search.c
@@ -38,7 +38,7 @@ static char sccsid[] = "@(#)bt_search.c 8.8 (Berkeley) 7/31/94";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <stdio.h>
diff --git a/freebsd/lib/libc/db/btree/bt_seq.c b/freebsd/lib/libc/db/btree/bt_seq.c
index 5e92c855..0f294a83 100644
--- a/freebsd/lib/libc/db/btree/bt_seq.c
+++ b/freebsd/lib/libc/db/btree/bt_seq.c
@@ -38,7 +38,7 @@ static char sccsid[] = "@(#)bt_seq.c 8.7 (Berkeley) 7/20/94";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <errno.h>
#include <stddef.h>
diff --git a/freebsd/lib/libc/db/btree/bt_split.c b/freebsd/lib/libc/db/btree/bt_split.c
index e47de805..1957b636 100644
--- a/freebsd/lib/libc/db/btree/bt_split.c
+++ b/freebsd/lib/libc/db/btree/bt_split.c
@@ -38,7 +38,7 @@ static char sccsid[] = "@(#)bt_split.c 8.10 (Berkeley) 1/9/95";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <limits.h>
#include <stdio.h>
diff --git a/freebsd/lib/libc/db/btree/bt_utils.c b/freebsd/lib/libc/db/btree/bt_utils.c
index fbfff3ac..bdea59ae 100644
--- a/freebsd/lib/libc/db/btree/bt_utils.c
+++ b/freebsd/lib/libc/db/btree/bt_utils.c
@@ -38,7 +38,7 @@ static char sccsid[] = "@(#)bt_utils.c 8.8 (Berkeley) 7/20/94";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/freebsd/lib/libc/db/db/db.c b/freebsd/lib/libc/db/db/db.c
index e450c626..beecad8e 100644
--- a/freebsd/lib/libc/db/db/db.c
+++ b/freebsd/lib/libc/db/db/db.c
@@ -35,7 +35,7 @@ static char sccsid[] = "@(#)db.c 8.4 (Berkeley) 2/21/94";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <errno.h>
#include <fcntl.h>
@@ -51,6 +51,13 @@ dbopen(const char *fname, int flags, int mode, DBTYPE type, const void *openinfo
{
#define DB_FLAGS (DB_LOCK | DB_SHMEM | DB_TXN)
+#ifdef __rtems__
+/* FIXME: Add lock capabilities to RTEMS file system */
+#define O_EXLOCK 0
+#define O_SHLOCK 0
+/* FIXME: Add no symlink follow capabilities to RTEMS file system */
+#define O_NOFOLLOW 0
+#endif /* __rtems__ */
#define USE_OPEN_FLAGS \
(O_CREAT | O_EXCL | O_EXLOCK | O_NOFOLLOW | O_NONBLOCK | \
O_RDONLY | O_RDWR | O_SHLOCK | O_SYNC | O_TRUNC)
diff --git a/freebsd/lib/libc/db/mpool/mpool.c b/freebsd/lib/libc/db/mpool/mpool.c
index ee7e143d..44ec0278 100644
--- a/freebsd/lib/libc/db/mpool/mpool.c
+++ b/freebsd/lib/libc/db/mpool/mpool.c
@@ -36,7 +36,7 @@ static char sccsid[] = "@(#)mpool.c 8.7 (Berkeley) 11/2/95";
__FBSDID("$FreeBSD$");
#include "namespace.h"
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/queue.h>
#include <sys/stat.h>
diff --git a/freebsd/lib/libc/db/recno/rec_close.c b/freebsd/lib/libc/db/recno/rec_close.c
index 388ee4a9..32136bd7 100644
--- a/freebsd/lib/libc/db/recno/rec_close.c
+++ b/freebsd/lib/libc/db/recno/rec_close.c
@@ -36,7 +36,7 @@ static char sccsid[] = "@(#)rec_close.c 8.6 (Berkeley) 8/18/94";
__FBSDID("$FreeBSD$");
#include "namespace.h"
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/uio.h>
#include <sys/mman.h>
diff --git a/freebsd/lib/libc/db/recno/rec_delete.c b/freebsd/lib/libc/db/recno/rec_delete.c
index ffaa50bf..fbaf65d6 100644
--- a/freebsd/lib/libc/db/recno/rec_delete.c
+++ b/freebsd/lib/libc/db/recno/rec_delete.c
@@ -38,7 +38,7 @@ static char sccsid[] = "@(#)rec_delete.c 8.7 (Berkeley) 7/14/94";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <errno.h>
#include <stdio.h>
diff --git a/freebsd/lib/libc/db/recno/rec_get.c b/freebsd/lib/libc/db/recno/rec_get.c
index ef749add..40f5bb16 100644
--- a/freebsd/lib/libc/db/recno/rec_get.c
+++ b/freebsd/lib/libc/db/recno/rec_get.c
@@ -35,7 +35,7 @@ static char sccsid[] = "@(#)rec_get.c 8.9 (Berkeley) 8/18/94";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <errno.h>
#include <stddef.h>
diff --git a/freebsd/lib/libc/db/recno/rec_open.c b/freebsd/lib/libc/db/recno/rec_open.c
index a0248aca..fbd2d9ae 100644
--- a/freebsd/lib/libc/db/recno/rec_open.c
+++ b/freebsd/lib/libc/db/recno/rec_open.c
@@ -39,7 +39,7 @@ static char sccsid[] = "@(#)rec_open.c 8.10 (Berkeley) 9/1/94";
__FBSDID("$FreeBSD$");
#include "namespace.h"
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
diff --git a/freebsd/lib/libc/db/recno/rec_put.c b/freebsd/lib/libc/db/recno/rec_put.c
index 58c1f566..a4fef549 100644
--- a/freebsd/lib/libc/db/recno/rec_put.c
+++ b/freebsd/lib/libc/db/recno/rec_put.c
@@ -35,7 +35,7 @@ static char sccsid[] = "@(#)rec_put.c 8.7 (Berkeley) 8/18/94";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <errno.h>
#include <stdio.h>
diff --git a/freebsd/lib/libc/db/recno/rec_search.c b/freebsd/lib/libc/db/recno/rec_search.c
index 2d98b95e..ac49ab4f 100644
--- a/freebsd/lib/libc/db/recno/rec_search.c
+++ b/freebsd/lib/libc/db/recno/rec_search.c
@@ -35,7 +35,7 @@ static char sccsid[] = "@(#)rec_search.c 8.4 (Berkeley) 7/14/94";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <errno.h>
#include <stdio.h>
diff --git a/freebsd/lib/libc/db/recno/rec_seq.c b/freebsd/lib/libc/db/recno/rec_seq.c
index b6430aab..90f34b6c 100644
--- a/freebsd/lib/libc/db/recno/rec_seq.c
+++ b/freebsd/lib/libc/db/recno/rec_seq.c
@@ -36,7 +36,7 @@ static char sccsid[] __unused = "@(#)rec_seq.c 8.3 (Berkeley) 7/14/94";
#endif /* not lint */
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <errno.h>
#include <limits.h>
diff --git a/freebsd/lib/libc/db/recno/rec_utils.c b/freebsd/lib/libc/db/recno/rec_utils.c
index 4bd45301..a8952da1 100644
--- a/freebsd/lib/libc/db/recno/rec_utils.c
+++ b/freebsd/lib/libc/db/recno/rec_utils.c
@@ -35,7 +35,7 @@ static char sccsid[] = "@(#)rec_utils.c 8.6 (Berkeley) 7/16/94";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/freebsd/lib/libc/gen/gethostname.c b/freebsd/lib/libc/gen/gethostname.c
index f744652c..44c7770a 100644
--- a/freebsd/lib/libc/gen/gethostname.c
+++ b/freebsd/lib/libc/gen/gethostname.c
@@ -35,7 +35,7 @@ static char sccsid[] = "@(#)gethostname.c 8.1 (Berkeley) 6/4/93";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/sysctl.h>
#include <errno.h>
diff --git a/freebsd/lib/libc/include/isc/eventlib.h b/freebsd/lib/libc/include/isc/eventlib.h
index 50038231..9713be3c 100644
--- a/freebsd/lib/libc/include/isc/eventlib.h
+++ b/freebsd/lib/libc/include/isc/eventlib.h
@@ -24,9 +24,9 @@
#ifndef _EVENTLIB_H
#define _EVENTLIB_H
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/uio.h>
-#include <sys/time.h>
+#include <rtems/bsd/sys/time.h>
#include <stdio.h>
#include <isc/platform.h>
diff --git a/freebsd/lib/libc/include/isc/platform.h b/freebsd/lib/libc/include/isc/platform.h
index bd11a255..a0513be8 100644
--- a/freebsd/lib/libc/include/isc/platform.h
+++ b/freebsd/lib/libc/include/isc/platform.h
@@ -1,40 +1,37 @@
/*
- * Copyright (C) 1999-2001 Internet Software Consortium.
+ * Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC")
*
- * Permission to use, copy, modify, and distribute this software for any
+ * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: platform.h.in,v 1.28 2001/11/19 03:08:26 mayer Exp $ */
-
-#ifndef ISC_PLATFORM_H
-#define ISC_PLATFORM_H 1
+/* $Id: platform.h.in,v 1.2.6.2 2008/01/23 02:15:02 tbox Exp $ */
+/* $FreeBSD$ */
+/*! \file */
-#ifndef ISC_PLATFORM_USEDECLSPEC
-#define LIBISC_EXTERNAL_DATA
-#define LIBDNS_EXTERNAL_DATA
-#define LIBISCCC_EXTERNAL_DATA
-#define LIBISCCFG_EXTERNAL_DATA
-#define LIBBIND9_EXTERNAL_DATA
-#endif /* ISC_PLATFORM_USEDECLSPEC */
+#ifndef ISC_PLATFORM_H
+#define ISC_PLATFORM_H
/*
- * Tell emacs to use C mode for this file.
- *
- * Local Variables:
- * mode: c
- * End:
+ * Define if the OS does not define struct timespec.
*/
+#undef ISC_PLATFORM_NEEDTIMESPEC
+#ifdef ISC_PLATFORM_NEEDTIMESPEC
+#include <time.h> /* For time_t */
+struct timespec {
+ time_t tv_sec; /* seconds */
+ long tv_nsec; /* nanoseconds */
+};
+#endif
-#endif /* ISC_PLATFORM_H */
+#endif
diff --git a/freebsd/lib/libc/include/libc_private.h b/freebsd/lib/libc/include/libc_private.h
index 060f77e0..c72b41ee 100644
--- a/freebsd/lib/libc/include/libc_private.h
+++ b/freebsd/lib/libc/include/libc_private.h
@@ -43,9 +43,9 @@
*/
#ifdef __rtems__
#define __isthreaded 1
-#else
+#else /* __rtems__ */
extern int __isthreaded;
-#endif
+#endif /* __rtems__ */
/*
* libc should use libc_dlopen internally, which respects a global
@@ -203,7 +203,7 @@ extern void (*__cleanup)(void);
* for the wrapped "new" pad-less syscalls are here for now.
*/
extern int __getosreldate(void);
-#include <sys/_types.h>
+#include <rtems/bsd/sys/_types.h>
/* Without pad */
extern __off_t __sys_lseek(int, __off_t, int);
extern int __sys_ftruncate(int, __off_t);
diff --git a/freebsd/lib/libc/include/port_before.h b/freebsd/lib/libc/include/port_before.h
index 64075171..304dd66d 100644
--- a/freebsd/lib/libc/include/port_before.h
+++ b/freebsd/lib/libc/include/port_before.h
@@ -1,22 +1,15 @@
-#include <freebsd/bsd.h>
+/* $FreeBSD$ */
-#include <freebsd/sys/_types.h>
+#ifndef _PORT_BEFORE_H_
+#define _PORT_BEFORE_H_
-/*********************************************************************
- * These are also defined in the FreeBSD version of this file.
- *********************************************************************/
+#define _LIBC 1
+#define DO_PTHREADS 1
+#define USE_KQUEUE 1
-#define _LIBC 1
-/*
- * This is defined in the FreeBSD source but we have no code yet which
- * relies upon it.
- */
-/* #define DO_PTHREADS 1 */
-#define USE_KQUEUE 1
-
-#define ISC_SOCKLEN_T socklen_t
+#define ISC_SOCKLEN_T socklen_t
#define ISC_FORMAT_PRINTF(fmt, args) \
- __attribute__((__format__(__printf__, fmt, args)))
+ __attribute__((__format__(__printf__, fmt, args)))
#define DE_CONST(konst, var) \
do { \
union { const void *k; void *v; } _u; \
@@ -24,18 +17,6 @@
var = _u.v; \
} while (0)
-#define UNUSED(x) (x) = (x)
-
-
-/*********************************************************************
- * FROM HERE DOWN, THESE ARE NOT IN THE FreeBSD VERSION!!!
- *********************************************************************/
-#ifndef __ssize_t
-#define __ssize_t ssize_t
-#endif
-
-#include <freebsd/machine/_align.h>
+#define UNUSED(x) (void)(x)
-#ifdef __rtems__
-#include <freebsd/machine/endian.h>
-#endif
+#endif /* _PORT_BEFORE_H_ */
diff --git a/freebsd/lib/libc/include/resolv_mt.h b/freebsd/lib/libc/include/resolv_mt.h
index 27963a12..a12f2563 100644
--- a/freebsd/lib/libc/include/resolv_mt.h
+++ b/freebsd/lib/libc/include/resolv_mt.h
@@ -1,7 +1,7 @@
#ifndef _RESOLV_MT_H
#define _RESOLV_MT_H
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>
diff --git a/freebsd/lib/libc/include/spinlock.h b/freebsd/lib/libc/include/spinlock.h
index c9facc51..e55b569f 100644
--- a/freebsd/lib/libc/include/spinlock.h
+++ b/freebsd/lib/libc/include/spinlock.h
@@ -35,7 +35,7 @@
#ifndef _SPINLOCK_H_
#define _SPINLOCK_H_
#include <sys/cdefs.h>
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
/*
* Lock structure with room for debugging information.
diff --git a/freebsd/lib/libc/inet/inet_addr.c b/freebsd/lib/libc/inet/inet_addr.c
index e606d345..dba40ac5 100644
--- a/freebsd/lib/libc/inet/inet_addr.c
+++ b/freebsd/lib/libc/inet/inet_addr.c
@@ -73,8 +73,8 @@ __FBSDID("$FreeBSD$");
#include "port_before.h"
-#include <sys/types.h>
-#include <sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/freebsd/lib/libc/inet/inet_cidr_ntop.c b/freebsd/lib/libc/inet/inet_cidr_ntop.c
index 645b3cd5..482c831b 100644
--- a/freebsd/lib/libc/inet/inet_cidr_ntop.c
+++ b/freebsd/lib/libc/inet/inet_cidr_ntop.c
@@ -21,7 +21,7 @@ static const char rcsid[] = "$Id: inet_cidr_ntop.c,v 1.4.18.3 2006/10/11 02:32:4
#include "port_before.h"
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
diff --git a/freebsd/lib/libc/inet/inet_cidr_pton.c b/freebsd/lib/libc/inet/inet_cidr_pton.c
index b0586ff3..06b6b7ed 100644
--- a/freebsd/lib/libc/inet/inet_cidr_pton.c
+++ b/freebsd/lib/libc/inet/inet_cidr_pton.c
@@ -23,7 +23,7 @@ __FBSDID("$FreeBSD$");
#include "port_before.h"
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
diff --git a/freebsd/lib/libc/inet/inet_lnaof.c b/freebsd/lib/libc/inet/inet_lnaof.c
index 7cab8946..ac9df5a3 100644
--- a/freebsd/lib/libc/inet/inet_lnaof.c
+++ b/freebsd/lib/libc/inet/inet_lnaof.c
@@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$");
#include "port_before.h"
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/freebsd/lib/libc/inet/inet_makeaddr.c b/freebsd/lib/libc/inet/inet_makeaddr.c
index 04a37a03..449d7ddd 100644
--- a/freebsd/lib/libc/inet/inet_makeaddr.c
+++ b/freebsd/lib/libc/inet/inet_makeaddr.c
@@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$");
#include "port_before.h"
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/freebsd/lib/libc/inet/inet_net_ntop.c b/freebsd/lib/libc/inet/inet_net_ntop.c
index 867f441a..9c9f734c 100644
--- a/freebsd/lib/libc/inet/inet_net_ntop.c
+++ b/freebsd/lib/libc/inet/inet_net_ntop.c
@@ -23,7 +23,7 @@ __FBSDID("$FreeBSD$");
#include "port_before.h"
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/freebsd/lib/libc/inet/inet_net_pton.c b/freebsd/lib/libc/inet/inet_net_pton.c
index 74df38b9..03980a74 100644
--- a/freebsd/lib/libc/inet/inet_net_pton.c
+++ b/freebsd/lib/libc/inet/inet_net_pton.c
@@ -23,7 +23,7 @@ __FBSDID("$FreeBSD$");
#include "port_before.h"
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
diff --git a/freebsd/lib/libc/inet/inet_neta.c b/freebsd/lib/libc/inet/inet_neta.c
index 72ac549f..1d08d95b 100644
--- a/freebsd/lib/libc/inet/inet_neta.c
+++ b/freebsd/lib/libc/inet/inet_neta.c
@@ -23,7 +23,7 @@ __FBSDID("$FreeBSD$");
#include "port_before.h"
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/freebsd/lib/libc/inet/inet_netof.c b/freebsd/lib/libc/inet/inet_netof.c
index 8931c30f..a81b42eb 100644
--- a/freebsd/lib/libc/inet/inet_netof.c
+++ b/freebsd/lib/libc/inet/inet_netof.c
@@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$");
#include "port_before.h"
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/freebsd/lib/libc/inet/inet_network.c b/freebsd/lib/libc/inet/inet_network.c
index 254db41a..da3762b9 100644
--- a/freebsd/lib/libc/inet/inet_network.c
+++ b/freebsd/lib/libc/inet/inet_network.c
@@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$");
#include "port_before.h"
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <ctype.h>
diff --git a/freebsd/lib/libc/inet/inet_ntoa.c b/freebsd/lib/libc/inet/inet_ntoa.c
index f5d69fac..9b2e0e48 100644
--- a/freebsd/lib/libc/inet/inet_ntoa.c
+++ b/freebsd/lib/libc/inet/inet_ntoa.c
@@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$");
#include "port_before.h"
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/freebsd/lib/libc/inet/inet_ntop.c b/freebsd/lib/libc/inet/inet_ntop.c
index 6d210279..8984e8a4 100644
--- a/freebsd/lib/libc/inet/inet_ntop.c
+++ b/freebsd/lib/libc/inet/inet_ntop.c
@@ -23,8 +23,8 @@ __FBSDID("$FreeBSD$");
#include "port_before.h"
-#include <sys/param.h>
-#include <sys/types.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
diff --git a/freebsd/lib/libc/inet/inet_pton.c b/freebsd/lib/libc/inet/inet_pton.c
index ae650990..ab16ec8f 100644
--- a/freebsd/lib/libc/inet/inet_pton.c
+++ b/freebsd/lib/libc/inet/inet_pton.c
@@ -22,8 +22,8 @@ static const char rcsid[] = "$Id: inet_pton.c,v 1.3.18.2 2005/07/28 07:38:07 mar
__FBSDID("$FreeBSD$");
#include "port_before.h"
-#include <sys/param.h>
-#include <sys/types.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/freebsd/lib/libc/inet/nsap_addr.c b/freebsd/lib/libc/inet/nsap_addr.c
index 29474729..3554b229 100644
--- a/freebsd/lib/libc/inet/nsap_addr.c
+++ b/freebsd/lib/libc/inet/nsap_addr.c
@@ -23,8 +23,8 @@ __FBSDID("$FreeBSD$");
#include "port_before.h"
-#include <sys/types.h>
-#include <sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
diff --git a/freebsd/lib/libc/isc/ev_streams.c b/freebsd/lib/libc/isc/ev_streams.c
index 06bdfad5..4ecb07ed 100644
--- a/freebsd/lib/libc/isc/ev_streams.c
+++ b/freebsd/lib/libc/isc/ev_streams.c
@@ -30,7 +30,7 @@ __FBSDID("$FreeBSD$");
#include "fd_setsize.h"
#endif
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/uio.h>
#include <errno.h>
diff --git a/freebsd/lib/libc/isc/eventlib_p.h b/freebsd/lib/libc/isc/eventlib_p.h
index 951af003..aea5bd6a 100644
--- a/freebsd/lib/libc/isc/eventlib_p.h
+++ b/freebsd/lib/libc/isc/eventlib_p.h
@@ -26,8 +26,8 @@
#ifndef _EVENTLIB_P_H
#define _EVENTLIB_P_H
-#include <sys/param.h>
-#include <sys/types.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/un.h>
diff --git a/freebsd/lib/libc/nameser/ns_name.c b/freebsd/lib/libc/nameser/ns_name.c
index ce7ee4d6..862db328 100644
--- a/freebsd/lib/libc/nameser/ns_name.c
+++ b/freebsd/lib/libc/nameser/ns_name.c
@@ -23,7 +23,7 @@ static const char rcsid[] = "$Id: ns_name.c,v 1.8.18.2 2005/04/27 05:01:08 sra E
#include "port_before.h"
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
diff --git a/freebsd/lib/libc/nameser/ns_parse.c b/freebsd/lib/libc/nameser/ns_parse.c
index 2d794eab..a3ff3cd9 100644
--- a/freebsd/lib/libc/nameser/ns_parse.c
+++ b/freebsd/lib/libc/nameser/ns_parse.c
@@ -25,7 +25,7 @@ static const char rcsid[] = "$Id: ns_parse.c,v 1.5.18.4 2007/08/27 03:34:24 mark
#include "port_before.h"
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
diff --git a/freebsd/lib/libc/nameser/ns_print.c b/freebsd/lib/libc/nameser/ns_print.c
index a4095e00..7dc73b09 100644
--- a/freebsd/lib/libc/nameser/ns_print.c
+++ b/freebsd/lib/libc/nameser/ns_print.c
@@ -27,7 +27,7 @@ __FBSDID("$FreeBSD$");
#include "port_before.h"
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
diff --git a/freebsd/lib/libc/nameser/ns_samedomain.c b/freebsd/lib/libc/nameser/ns_samedomain.c
index 9c43c79e..93b06e83 100644
--- a/freebsd/lib/libc/nameser/ns_samedomain.c
+++ b/freebsd/lib/libc/nameser/ns_samedomain.c
@@ -23,7 +23,7 @@ __FBSDID("$FreeBSD$");
#include "port_before.h"
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <arpa/nameser.h>
#include <errno.h>
#include <string.h>
diff --git a/freebsd/lib/libc/net/base64.c b/freebsd/lib/libc/net/base64.c
index 6d3a79d6..70760b65 100644
--- a/freebsd/lib/libc/net/base64.c
+++ b/freebsd/lib/libc/net/base64.c
@@ -45,8 +45,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
-#include <sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
diff --git a/freebsd/lib/libc/net/ether_addr.c b/freebsd/lib/libc/net/ether_addr.c
index a16b97d3..f0f63941 100644
--- a/freebsd/lib/libc/net/ether_addr.c
+++ b/freebsd/lib/libc/net/ether_addr.c
@@ -42,8 +42,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
-#include <sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/socket.h>
#include <net/ethernet.h>
diff --git a/freebsd/lib/libc/net/gai_strerror.c b/freebsd/lib/libc/net/gai_strerror.c
index b1feb7b8..4f60f2db 100644
--- a/freebsd/lib/libc/net/gai_strerror.c
+++ b/freebsd/lib/libc/net/gai_strerror.c
@@ -27,11 +27,6 @@
* SUCH DAMAGE.
*/
-#ifdef __rtems__
-#include <freebsd/machine/rtems-bsd-config.h>
-#include <freebsd/sys/_types.h>
-#endif
-
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
diff --git a/freebsd/lib/libc/net/getaddrinfo.c b/freebsd/lib/libc/net/getaddrinfo.c
index b9b52794..aab02bf6 100644
--- a/freebsd/lib/libc/net/getaddrinfo.c
+++ b/freebsd/lib/libc/net/getaddrinfo.c
@@ -59,25 +59,18 @@
__FBSDID("$FreeBSD$");
#include "namespace.h"
-#include <sys/types.h>
-#include <sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
#include <sys/queue.h>
#ifdef INET6
-#ifdef __rtems__
-#include <freebsd/net/if_var.h>
-#include <sys/sysctl.h>
-#include <sys/ioctl.h>
-#include <freebsd/netinet6/in6_var.h> /* XXX */
-#else
#include <net/if_var.h>
#include <sys/sysctl.h>
#include <sys/ioctl.h>
#include <netinet6/in6_var.h> /* XXX */
#endif
-#endif
#include <arpa/inet.h>
#include <arpa/nameser.h>
#include <rpc/rpc.h>
diff --git a/freebsd/lib/libc/net/gethostbydns.c b/freebsd/lib/libc/net/gethostbydns.c
index 2993a678..ba59bbc3 100644
--- a/freebsd/lib/libc/net/gethostbydns.c
+++ b/freebsd/lib/libc/net/gethostbydns.c
@@ -58,8 +58,8 @@ static char fromrcsid[] = "From: Id: gethnamaddr.c,v 8.23 1998/04/07 04:59:46 vi
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
-#include <sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/freebsd/lib/libc/net/gethostbyht.c b/freebsd/lib/libc/net/gethostbyht.c
index eb995b96..c9990cc4 100644
--- a/freebsd/lib/libc/net/gethostbyht.c
+++ b/freebsd/lib/libc/net/gethostbyht.c
@@ -55,7 +55,7 @@ static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/freebsd/lib/libc/net/gethostbynis.c b/freebsd/lib/libc/net/gethostbynis.c
index 81f00932..5fa6725b 100644
--- a/freebsd/lib/libc/net/gethostbynis.c
+++ b/freebsd/lib/libc/net/gethostbynis.c
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/freebsd/lib/libc/net/gethostnamadr.c b/freebsd/lib/libc/net/gethostnamadr.c
index d663e286..412ad57d 100644
--- a/freebsd/lib/libc/net/gethostnamadr.c
+++ b/freebsd/lib/libc/net/gethostnamadr.c
@@ -30,7 +30,7 @@ __FBSDID("$FreeBSD$");
#include "namespace.h"
#include "reentrant.h"
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/freebsd/lib/libc/net/getifaddrs.c b/freebsd/lib/libc/net/getifaddrs.c
index 2eceadb7..ddb8f437 100644
--- a/freebsd/lib/libc/net/getifaddrs.c
+++ b/freebsd/lib/libc/net/getifaddrs.c
@@ -35,12 +35,12 @@
__FBSDID("$FreeBSD$");
#include "namespace.h"
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if.h>
#ifdef NET_RT_IFLIST
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <net/route.h>
#include <sys/sysctl.h>
#include <net/if_dl.h>
diff --git a/freebsd/lib/libc/net/getifmaddrs.c b/freebsd/lib/libc/net/getifmaddrs.c
index 708c7ae2..23cf96e7 100644
--- a/freebsd/lib/libc/net/getifmaddrs.c
+++ b/freebsd/lib/libc/net/getifmaddrs.c
@@ -36,7 +36,7 @@
__FBSDID("$FreeBSD$");
#include "namespace.h"
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/sysctl.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
diff --git a/freebsd/lib/libc/net/getnameinfo.c b/freebsd/lib/libc/net/getnameinfo.c
index 4abd11ff..4b4d24a2 100644
--- a/freebsd/lib/libc/net/getnameinfo.c
+++ b/freebsd/lib/libc/net/getnameinfo.c
@@ -49,7 +49,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/if_dl.h>
diff --git a/freebsd/lib/libc/net/getnetbydns.c b/freebsd/lib/libc/net/getnetbydns.c
index 7dd23837..8b7ccd4f 100644
--- a/freebsd/lib/libc/net/getnetbydns.c
+++ b/freebsd/lib/libc/net/getnetbydns.c
@@ -62,7 +62,7 @@ static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/freebsd/lib/libc/net/getnetbyht.c b/freebsd/lib/libc/net/getnetbyht.c
index 1076cf21..bfede4b9 100644
--- a/freebsd/lib/libc/net/getnetbyht.c
+++ b/freebsd/lib/libc/net/getnetbyht.c
@@ -46,7 +46,7 @@ static char orig_rcsid[] = "From: Id: getnetent.c,v 8.4 1997/06/01 20:34:37 vixi
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/freebsd/lib/libc/net/getnetbynis.c b/freebsd/lib/libc/net/getnetbynis.c
index 805bc9d1..1d256a81 100644
--- a/freebsd/lib/libc/net/getnetbynis.c
+++ b/freebsd/lib/libc/net/getnetbynis.c
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/freebsd/lib/libc/net/getnetnamadr.c b/freebsd/lib/libc/net/getnetnamadr.c
index 7ae162c3..c5100a32 100644
--- a/freebsd/lib/libc/net/getnetnamadr.c
+++ b/freebsd/lib/libc/net/getnetnamadr.c
@@ -30,7 +30,7 @@ __FBSDID("$FreeBSD$");
#include "namespace.h"
#include "reentrant.h"
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/freebsd/lib/libc/net/getprotoent.c b/freebsd/lib/libc/net/getprotoent.c
index c817cb5b..ae6584b0 100644
--- a/freebsd/lib/libc/net/getprotoent.c
+++ b/freebsd/lib/libc/net/getprotoent.c
@@ -35,8 +35,8 @@ static char sccsid[] = "@(#)getprotoent.c 8.1 (Berkeley) 6/4/93";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/param.h>
-#include <sys/types.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/socket.h>
#include <errno.h>
#include <limits.h>
diff --git a/freebsd/lib/libc/net/getservent.c b/freebsd/lib/libc/net/getservent.c
index 65ffb2cb..486249d6 100644
--- a/freebsd/lib/libc/net/getservent.c
+++ b/freebsd/lib/libc/net/getservent.c
@@ -35,8 +35,8 @@ static char sccsid[] = "@(#)getservent.c 8.1 (Berkeley) 6/4/93";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/param.h>
-#include <sys/types.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <db.h>
diff --git a/freebsd/lib/libc/net/if_indextoname.c b/freebsd/lib/libc/net/if_indextoname.c
index efbcae86..ef201c56 100644
--- a/freebsd/lib/libc/net/if_indextoname.c
+++ b/freebsd/lib/libc/net/if_indextoname.c
@@ -30,7 +30,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/socket.h>
#include <net/if_dl.h>
#include <net/if.h>
diff --git a/freebsd/lib/libc/net/if_nameindex.c b/freebsd/lib/libc/net/if_nameindex.c
index 85073759..5b299300 100644
--- a/freebsd/lib/libc/net/if_nameindex.c
+++ b/freebsd/lib/libc/net/if_nameindex.c
@@ -30,7 +30,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/socket.h>
#include <net/if_dl.h>
#include <net/if.h>
diff --git a/freebsd/lib/libc/net/if_nametoindex.c b/freebsd/lib/libc/net/if_nametoindex.c
index a278ca07..132501b8 100644
--- a/freebsd/lib/libc/net/if_nametoindex.c
+++ b/freebsd/lib/libc/net/if_nametoindex.c
@@ -29,7 +29,7 @@
__FBSDID("$FreeBSD$");
#include "namespace.h"
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/socket.h>
#include <sys/sockio.h>
#include <net/if.h>
@@ -40,9 +40,6 @@ __FBSDID("$FreeBSD$");
#include <errno.h>
#include <unistd.h>
#include "un-namespace.h"
-#ifdef __rtems__
-#include <freebsd/sys/sockio.h>
-#endif
/*
* From RFC 2553:
diff --git a/freebsd/lib/libc/net/linkaddr.c b/freebsd/lib/libc/net/linkaddr.c
index 761b5ae5..b2170444 100644
--- a/freebsd/lib/libc/net/linkaddr.c
+++ b/freebsd/lib/libc/net/linkaddr.c
@@ -35,7 +35,7 @@ static char sccsid[] = "@(#)linkaddr.c 8.1 (Berkeley) 6/4/93";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/socket.h>
#include <net/if_dl.h>
#include <string.h>
diff --git a/freebsd/lib/libc/net/map_v4v6.c b/freebsd/lib/libc/net/map_v4v6.c
index 000ed9e2..0436c763 100644
--- a/freebsd/lib/libc/net/map_v4v6.c
+++ b/freebsd/lib/libc/net/map_v4v6.c
@@ -57,8 +57,8 @@ static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
-#include <sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/freebsd/lib/libc/net/name6.c b/freebsd/lib/libc/net/name6.c
index 20763f88..a7abcb12 100644
--- a/freebsd/lib/libc/net/name6.c
+++ b/freebsd/lib/libc/net/name6.c
@@ -92,25 +92,18 @@
__FBSDID("$FreeBSD$");
#include "namespace.h"
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/socket.h>
-#include <sys/time.h>
+#include <rtems/bsd/sys/time.h>
#include <sys/queue.h>
#include <netinet/in.h>
#ifdef INET6
#include <net/if.h>
-#ifdef __rtems__
-#include <freebsd/net/if_var.h>
-#include <sys/sysctl.h>
-#include <sys/ioctl.h>
-#include <freebsd/netinet6/in6_var.h> /* XXX */
-#else
#include <net/if_var.h>
#include <sys/sysctl.h>
#include <sys/ioctl.h>
#include <netinet6/in6_var.h> /* XXX */
#endif
-#endif
#include <arpa/inet.h>
#include <arpa/nameser.h>
diff --git a/freebsd/lib/libc/net/nsdispatch.c b/freebsd/lib/libc/net/nsdispatch.c
index dcd7438f..9262d3a1 100644
--- a/freebsd/lib/libc/net/nsdispatch.c
+++ b/freebsd/lib/libc/net/nsdispatch.c
@@ -73,14 +73,12 @@
__FBSDID("$FreeBSD$");
#include "namespace.h"
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/stat.h>
#ifndef __rtems__
#include <dlfcn.h>
-#else
-#include <stdint.h>
-#endif
+#endif /* __rtems__ */
#include <errno.h>
#include <fcntl.h>
#define _NS_PRIVATE
diff --git a/freebsd/lib/libc/net/rcmd.c b/freebsd/lib/libc/net/rcmd.c
index 1045e88b..a5a7a0c6 100644
--- a/freebsd/lib/libc/net/rcmd.c
+++ b/freebsd/lib/libc/net/rcmd.c
@@ -36,7 +36,7 @@ static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94";
__FBSDID("$FreeBSD$");
#include "namespace.h"
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/socket.h>
#include <sys/stat.h>
diff --git a/freebsd/lib/libc/net/recv.c b/freebsd/lib/libc/net/recv.c
index c625c0ac..c0103711 100644
--- a/freebsd/lib/libc/net/recv.c
+++ b/freebsd/lib/libc/net/recv.c
@@ -36,7 +36,7 @@ static char sccsid[] = "@(#)recv.c 8.2 (Berkeley) 2/21/94";
__FBSDID("$FreeBSD$");
#include "namespace.h"
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/socket.h>
#include <stddef.h>
diff --git a/freebsd/lib/libc/net/send.c b/freebsd/lib/libc/net/send.c
index 0ba2f4bc..8ab06ec9 100644
--- a/freebsd/lib/libc/net/send.c
+++ b/freebsd/lib/libc/net/send.c
@@ -36,7 +36,7 @@ static char sccsid[] = "@(#)send.c 8.2 (Berkeley) 2/21/94";
__FBSDID("$FreeBSD$");
#include "namespace.h"
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/socket.h>
#include <stddef.h>
diff --git a/freebsd/lib/libc/resolv/h_errno.c b/freebsd/lib/libc/resolv/h_errno.c
index 88d15aee..f627ff9b 100644
--- a/freebsd/lib/libc/resolv/h_errno.c
+++ b/freebsd/lib/libc/resolv/h_errno.c
@@ -25,7 +25,7 @@
* $FreeBSD$
*/
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>
diff --git a/freebsd/lib/libc/resolv/herror.c b/freebsd/lib/libc/resolv/herror.c
index 5a6e020e..aa50d774 100644
--- a/freebsd/lib/libc/resolv/herror.c
+++ b/freebsd/lib/libc/resolv/herror.c
@@ -56,8 +56,8 @@ __FBSDID("$FreeBSD$");
#include "port_before.h"
#include "namespace.h"
-#include <sys/types.h>
-#include <sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/uio.h>
#include <netinet/in.h>
diff --git a/freebsd/lib/libc/resolv/mtctxres.c b/freebsd/lib/libc/resolv/mtctxres.c
index f02a7f50..4c915841 100644
--- a/freebsd/lib/libc/resolv/mtctxres.c
+++ b/freebsd/lib/libc/resolv/mtctxres.c
@@ -107,8 +107,10 @@ ___mtctxres(void) {
mtctxres_t *mt;
#ifdef _LIBC
+#ifndef __rtems__
if (pthread_main_np() != 0)
return (&sharedctx);
+#endif /* __rtems__ */
#endif
/*
diff --git a/freebsd/lib/libc/resolv/res_comp.c b/freebsd/lib/libc/resolv/res_comp.c
index cbddb6be..ac2a0752 100644
--- a/freebsd/lib/libc/resolv/res_comp.c
+++ b/freebsd/lib/libc/resolv/res_comp.c
@@ -74,8 +74,8 @@ static const char rcsid[] = "$Id: res_comp.c,v 1.3.18.2 2005/07/28 07:38:11 mark
__FBSDID("$FreeBSD$");
#include "port_before.h"
-#include <sys/types.h>
-#include <sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <ctype.h>
diff --git a/freebsd/lib/libc/resolv/res_data.c b/freebsd/lib/libc/resolv/res_data.c
index 20ffe188..3aa0a3d4 100644
--- a/freebsd/lib/libc/resolv/res_data.c
+++ b/freebsd/lib/libc/resolv/res_data.c
@@ -25,10 +25,10 @@ __FBSDID("$FreeBSD$");
#include "port_before.h"
-#include <sys/types.h>
-#include <sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/socket.h>
-#include <sys/time.h>
+#include <rtems/bsd/sys/time.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/freebsd/lib/libc/resolv/res_debug.c b/freebsd/lib/libc/resolv/res_debug.c
index 317319ee..61c89f97 100644
--- a/freebsd/lib/libc/resolv/res_debug.c
+++ b/freebsd/lib/libc/resolv/res_debug.c
@@ -100,8 +100,8 @@ __FBSDID("$FreeBSD$");
#include "port_before.h"
-#include <sys/types.h>
-#include <sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
diff --git a/freebsd/lib/libc/resolv/res_findzonecut.c b/freebsd/lib/libc/resolv/res_findzonecut.c
index 23c1af4f..2e868e93 100644
--- a/freebsd/lib/libc/resolv/res_findzonecut.c
+++ b/freebsd/lib/libc/resolv/res_findzonecut.c
@@ -26,9 +26,9 @@ __FBSDID("$FreeBSD$");
#include "port_before.h"
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/socket.h>
-#include <sys/time.h>
+#include <rtems/bsd/sys/time.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/freebsd/lib/libc/resolv/res_init.c b/freebsd/lib/libc/resolv/res_init.c
index ec74e5bd..0b7d4682 100644
--- a/freebsd/lib/libc/resolv/res_init.c
+++ b/freebsd/lib/libc/resolv/res_init.c
@@ -77,10 +77,10 @@ __FBSDID("$FreeBSD$");
#include "namespace.h"
-#include <sys/types.h>
-#include <sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/socket.h>
-#include <sys/time.h>
+#include <rtems/bsd/sys/time.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/freebsd/lib/libc/resolv/res_mkquery.c b/freebsd/lib/libc/resolv/res_mkquery.c
index 074817c4..f53caa39 100644
--- a/freebsd/lib/libc/resolv/res_mkquery.c
+++ b/freebsd/lib/libc/resolv/res_mkquery.c
@@ -74,8 +74,8 @@ static const char rcsid[] = "$Id: res_mkquery.c,v 1.5.18.2 2008/04/03 23:15:15 m
__FBSDID("$FreeBSD$");
#include "port_before.h"
-#include <sys/types.h>
-#include <sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <netdb.h>
diff --git a/freebsd/lib/libc/resolv/res_mkupdate.c b/freebsd/lib/libc/resolv/res_mkupdate.c
index 63f40cbe..98a21010 100644
--- a/freebsd/lib/libc/resolv/res_mkupdate.c
+++ b/freebsd/lib/libc/resolv/res_mkupdate.c
@@ -31,8 +31,8 @@ __FBSDID("$FreeBSD$");
#include "port_before.h"
-#include <sys/types.h>
-#include <sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
diff --git a/freebsd/lib/libc/resolv/res_query.c b/freebsd/lib/libc/resolv/res_query.c
index 734e043a..f0f7a531 100644
--- a/freebsd/lib/libc/resolv/res_query.c
+++ b/freebsd/lib/libc/resolv/res_query.c
@@ -74,8 +74,8 @@ static const char rcsid[] = "$Id: res_query.c,v 1.7.18.2 2008/04/03 23:15:15 mar
__FBSDID("$FreeBSD$");
#include "port_before.h"
-#include <sys/types.h>
-#include <sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <arpa/nameser.h>
diff --git a/freebsd/lib/libc/resolv/res_send.c b/freebsd/lib/libc/resolv/res_send.c
index 0d52762c..7f421bba 100644
--- a/freebsd/lib/libc/resolv/res_send.c
+++ b/freebsd/lib/libc/resolv/res_send.c
@@ -84,9 +84,9 @@ __FBSDID("$FreeBSD$");
#endif
#include "namespace.h"
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/time.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/time.h>
#include <sys/socket.h>
#include <sys/uio.h>
@@ -108,11 +108,7 @@ __FBSDID("$FreeBSD$");
#include "port_after.h"
#ifdef USE_KQUEUE
-#ifdef __rtems__
-#include <freebsd/sys/event.h>
-#else
#include <sys/event.h>
-#endif /* __rtems__ */
#else
#ifdef USE_POLL
#ifdef HAVE_STROPTS_H
diff --git a/freebsd/lib/libc/resolv/res_state.c b/freebsd/lib/libc/resolv/res_state.c
index 8a82db7e..f3fc63c1 100644
--- a/freebsd/lib/libc/resolv/res_state.c
+++ b/freebsd/lib/libc/resolv/res_state.c
@@ -27,7 +27,7 @@
* $FreeBSD$
*/
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>
diff --git a/freebsd/lib/libc/resolv/res_update.c b/freebsd/lib/libc/resolv/res_update.c
index 58faac9c..5853831a 100644
--- a/freebsd/lib/libc/resolv/res_update.c
+++ b/freebsd/lib/libc/resolv/res_update.c
@@ -32,9 +32,9 @@ __FBSDID("$FreeBSD$");
#include "port_before.h"
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/socket.h>
-#include <sys/time.h>
+#include <rtems/bsd/sys/time.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@@ -49,9 +49,6 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <string.h>
-#ifdef __rtems__
-#include <isc/print.h>
-#endif
#include <isc/list.h>
#include <resolv.h>
diff --git a/freebsd/lib/libc/stdio/local.h b/freebsd/lib/libc/stdio/local.h
index 986e8994..d1f4bdad 100644
--- a/freebsd/lib/libc/stdio/local.h
+++ b/freebsd/lib/libc/stdio/local.h
@@ -33,7 +33,7 @@
* $FreeBSD$
*/
-#include <sys/types.h> /* for off_t */
+#include <rtems/bsd/sys/types.h> /* for off_t */
#include <pthread.h>
#include <string.h>
#include <wchar.h>
diff --git a/freebsd/lib/libipsec/ipsec_dump_policy.c b/freebsd/lib/libipsec/ipsec_dump_policy.c
index 80cad7a0..c80fd04d 100644
--- a/freebsd/lib/libipsec/ipsec_dump_policy.c
+++ b/freebsd/lib/libipsec/ipsec_dump_policy.c
@@ -32,19 +32,13 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
-#include <sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/socket.h>
-#ifdef __rtems__
-#include <freebsd/netipsec/key_var.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netipsec/ipsec.h>
-#else
#include <netipsec/key_var.h>
#include <netinet/in.h>
#include <netipsec/ipsec.h>
-#endif
#include <arpa/inet.h>
diff --git a/freebsd/lib/libipsec/ipsec_get_policylen.c b/freebsd/lib/libipsec/ipsec_get_policylen.c
index d2d47980..56f19ab6 100644
--- a/freebsd/lib/libipsec/ipsec_get_policylen.c
+++ b/freebsd/lib/libipsec/ipsec_get_policylen.c
@@ -32,18 +32,12 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
-#include <sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
-#ifdef __rtems__
-#include <freebsd/netipsec/ipsec.h>
-
-#include <freebsd/net/pfkeyv2.h>
-#else
#include <netipsec/ipsec.h>
#include <net/pfkeyv2.h>
-#endif
#include "ipsec_strerror.h"
int
diff --git a/freebsd/lib/libipsec/ipsec_strerror.c b/freebsd/lib/libipsec/ipsec_strerror.c
index b51893eb..ca1176d3 100644
--- a/freebsd/lib/libipsec/ipsec_strerror.c
+++ b/freebsd/lib/libipsec/ipsec_strerror.c
@@ -32,15 +32,11 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
-#include <sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
#include <string.h>
-#ifdef __rtems__
-#include <freebsd/netipsec/ipsec.h>
-#else
#include <netipsec/ipsec.h>
-#endif
#include "ipsec_strerror.h"
diff --git a/freebsd/lib/libipsec/pfkey.c b/freebsd/lib/libipsec/pfkey.c
index 0bcea66d..0c914962 100644
--- a/freebsd/lib/libipsec/pfkey.c
+++ b/freebsd/lib/libipsec/pfkey.c
@@ -32,20 +32,13 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
-#include <sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/socket.h>
-#ifdef __rtems__
-#include <freebsd/net/pfkeyv2.h>
-#include <freebsd/netipsec/key_var.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netipsec/ipsec.h>
-#else
#include <net/pfkeyv2.h>
#include <netipsec/key_var.h>
#include <netinet/in.h>
#include <netipsec/ipsec.h>
-#endif
#include <stdlib.h>
#include <unistd.h>
diff --git a/freebsd/lib/libipsec/pfkey_dump.c b/freebsd/lib/libipsec/pfkey_dump.c
index 5d83d224..f6592ae4 100644
--- a/freebsd/lib/libipsec/pfkey_dump.c
+++ b/freebsd/lib/libipsec/pfkey_dump.c
@@ -32,27 +32,15 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
-#include <sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/socket.h>
-
-#ifdef __rtems__
-#include <freebsd/netipsec/ipsec.h>
-#include <freebsd/net/pfkeyv2.h>
-#include <freebsd/netipsec/key_var.h>
-#include <freebsd/netipsec/key_debug.h>
-
-#include <freebsd/netinet/in.h>
-#else
#include <netipsec/ipsec.h>
#include <net/pfkeyv2.h>
#include <netipsec/key_var.h>
#include <netipsec/key_debug.h>
#include <netinet/in.h>
-#endif
-
-#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdlib.h>
diff --git a/freebsd/lib/libipsec/policy_parse.y b/freebsd/lib/libipsec/policy_parse.y
index 9e290f41..9e2f979c 100644
--- a/freebsd/lib/libipsec/policy_parse.y
+++ b/freebsd/lib/libipsec/policy_parse.y
@@ -57,11 +57,7 @@ __FBSDID("$FreeBSD$");
#include <sys/socket.h>
#include <netinet/in.h>
-#ifdef __rtems__
-#include <freebsd/netipsec/ipsec.h>
-#else
#include <netipsec/ipsec.h>
-#endif
#include <stdlib.h>
#include <stdio.h>
diff --git a/freebsd/lib/libipsec/policy_token.l b/freebsd/lib/libipsec/policy_token.l
index d28ea727..d4167a4f 100644
--- a/freebsd/lib/libipsec/policy_token.l
+++ b/freebsd/lib/libipsec/policy_token.l
@@ -35,17 +35,10 @@
#include <sys/param.h>
#include <sys/socket.h>
#include <net/route.h>
-#ifdef __rtems__
-#include <freebsd/net/pfkeyv2.h>
-#include <freebsd/netipsec/keydb.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netipsec/ipsec.h>
-#else
#include <net/pfkeyv2.h>
#include <netipsec/keydb.h>
#include <netinet/in.h>
#include <netipsec/ipsec.h>
-#endif
#include <stdlib.h>
#include <limits.h>
@@ -55,7 +48,7 @@
#ifdef __rtems__
/* XXX - Jennifer doesn't know where to get this from */
-YY_BUFFER_STATE yy_current_buffer;
+static YY_BUFFER_STATE yy_current_buffer;
#endif
#include "y.tab.h"
diff --git a/freebsd/lib/libkvm/kvm.h b/freebsd/lib/libkvm/kvm.h
index 0427bd1c..d2132638 100644
--- a/freebsd/lib/libkvm/kvm.h
+++ b/freebsd/lib/libkvm/kvm.h
@@ -34,7 +34,7 @@
#define _KVM_H_
#include <sys/cdefs.h>
-#include <sys/_types.h>
+#include <rtems/bsd/sys/types.h>
#include <nlist.h>
/* Default version symbol. */
diff --git a/freebsd/lib/libmemstat/memstat.c b/freebsd/lib/libmemstat/memstat.c
index 28e48138..ec23d294 100644
--- a/freebsd/lib/libmemstat/memstat.c
+++ b/freebsd/lib/libmemstat/memstat.c
@@ -26,7 +26,7 @@
* $FreeBSD$
*/
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/sysctl.h>
#include <err.h>
diff --git a/freebsd/lib/libmemstat/memstat.h b/freebsd/lib/libmemstat/memstat.h
index 5991a8f2..aaa85702 100644
--- a/freebsd/lib/libmemstat/memstat.h
+++ b/freebsd/lib/libmemstat/memstat.h
@@ -29,10 +29,6 @@
#ifndef _MEMSTAT_H_
#define _MEMSTAT_H_
-#ifdef __rtems__
-#include <stdint.h>
-#endif
-
/*
* Number of CPU slots in library-internal data structures. This should be
* at least the value of MAXCPU from param.h.
diff --git a/freebsd/lib/libmemstat/memstat_all.c b/freebsd/lib/libmemstat/memstat_all.c
index a943e653..ec4313e9 100644
--- a/freebsd/lib/libmemstat/memstat_all.c
+++ b/freebsd/lib/libmemstat/memstat_all.c
@@ -26,7 +26,7 @@
* $FreeBSD$
*/
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/queue.h>
#include "memstat.h"
diff --git a/freebsd/lib/libmemstat/memstat_malloc.c b/freebsd/lib/libmemstat/memstat_malloc.c
index 96ff8a16..6cae8f76 100644
--- a/freebsd/lib/libmemstat/memstat_malloc.c
+++ b/freebsd/lib/libmemstat/memstat_malloc.c
@@ -28,12 +28,8 @@
*/
#include <sys/cdefs.h>
-#include <sys/param.h>
-#ifdef __rtems__
-#include <freebsd/sys/malloc.h>
-#else
+#include <rtems/bsd/sys/param.h>
#include <sys/malloc.h>
-#endif
#include <sys/sysctl.h>
#include <err.h>
diff --git a/freebsd/lib/libmemstat/memstat_uma.c b/freebsd/lib/libmemstat/memstat_uma.c
index deac50d7..6000a486 100644
--- a/freebsd/lib/libmemstat/memstat_uma.c
+++ b/freebsd/lib/libmemstat/memstat_uma.c
@@ -27,23 +27,15 @@
* $FreeBSD$
*/
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/sysctl.h>
#define LIBMEMSTAT /* Cause vm_page.h not to include opt_vmpage.h */
-#ifdef __rtems__
-#include <freebsd/sys/types.h>
-#include <freebsd/vm/vm.h>
-// #include <vm/vm_page.h>
-#include <freebsd/vm/uma.h>
-#include <freebsd/vm/uma_int.h>
-#else
#include <vm/vm.h>
#include <vm/vm_page.h>
+
#include <vm/uma.h>
#include <vm/uma_int.h>
-#endif
-
#include <err.h>
#include <errno.h>
diff --git a/freebsd/lib/libutil/expand_number.c b/freebsd/lib/libutil/expand_number.c
index 4c8d6f5b..6047bba5 100644
--- a/freebsd/lib/libutil/expand_number.c
+++ b/freebsd/lib/libutil/expand_number.c
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <ctype.h>
#include <errno.h>
#include <inttypes.h>
diff --git a/freebsd/lib/libutil/humanize_number.c b/freebsd/lib/libutil/humanize_number.c
index de985870..e58668b7 100644
--- a/freebsd/lib/libutil/humanize_number.c
+++ b/freebsd/lib/libutil/humanize_number.c
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <assert.h>
#include <inttypes.h>
#include <stdio.h>
diff --git a/freebsd/lib/libutil/trimdomain.c b/freebsd/lib/libutil/trimdomain.c
index 7ca6ab69..67d835f2 100644
--- a/freebsd/lib/libutil/trimdomain.c
+++ b/freebsd/lib/libutil/trimdomain.c
@@ -1,6 +1,3 @@
-#ifdef __rtems__
-#include "port_before.h"
-#endif
/*-
* Copyright (c) 2001 Brian Somers <brian@Awfulhak.org>
* Based on original work by Atsushi Murai <amurai@FreeBSD.org>
@@ -32,7 +29,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <libutil.h>
#include <string.h>
diff --git a/freebsd/net/ethernet.h b/freebsd/net/ethernet.h
deleted file mode 100644
index a39a86dd..00000000
--- a/freebsd/net/ethernet.h
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
- * Fundamental constants relating to ethernet.
- *
- * $FreeBSD$
- *
- */
-
-#ifndef _NET_ETHERNET_HH_
-#define _NET_ETHERNET_HH_
-
-/*
- * Some basic Ethernet constants.
- */
-#define ETHER_ADDR_LEN 6 /* length of an Ethernet address */
-#define ETHER_TYPE_LEN 2 /* length of the Ethernet type field */
-#define ETHER_CRC_LEN 4 /* length of the Ethernet CRC */
-#define ETHER_HDR_LEN (ETHER_ADDR_LEN*2+ETHER_TYPE_LEN)
-#define ETHER_MIN_LEN 64 /* minimum frame len, including CRC */
-#define ETHER_MAX_LEN 1518 /* maximum frame len, including CRC */
-#define ETHER_MAX_LEN_JUMBO 9018 /* max jumbo frame len, including CRC */
-
-#define ETHER_VLAN_ENCAP_LEN 4 /* len of 802.1Q VLAN encapsulation */
-/*
- * Mbuf adjust factor to force 32-bit alignment of IP header.
- * Drivers should do m_adj(m, ETHER_ALIGN) when setting up a
- * receive so the upper layers get the IP header properly aligned
- * past the 14-byte Ethernet header.
- */
-#define ETHER_ALIGN 2 /* driver adjust for IP hdr alignment */
-
-/*
- * Compute the maximum frame size based on ethertype (i.e. possible
- * encapsulation) and whether or not an FCS is present.
- */
-#define ETHER_MAX_FRAME(ifp, etype, hasfcs) \
- ((ifp)->if_mtu + ETHER_HDR_LEN + \
- ((hasfcs) ? ETHER_CRC_LEN : 0) + \
- (((etype) == ETHERTYPE_VLAN) ? ETHER_VLAN_ENCAP_LEN : 0))
-
-/*
- * Ethernet-specific mbuf flags.
- */
-#define M_HASFCS M_PROTO5 /* FCS included at end of frame */
-
-/*
- * Ethernet CRC32 polynomials (big- and little-endian verions).
- */
-#define ETHER_CRC_POLY_LE 0xedb88320
-#define ETHER_CRC_POLY_BE 0x04c11db6
-
-/*
- * A macro to validate a length with
- */
-#define ETHER_IS_VALID_LEN(foo) \
- ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
-
-/*
- * Structure of a 10Mb/s Ethernet header.
- */
-struct ether_header {
- u_char ether_dhost[ETHER_ADDR_LEN];
- u_char ether_shost[ETHER_ADDR_LEN];
- u_short ether_type;
-} __packed;
-
-/*
- * Structure of a 48-bit Ethernet address.
- */
-struct ether_addr {
- u_char octet[ETHER_ADDR_LEN];
-} __packed;
-
-#define ETHER_IS_MULTICAST(addr) (*(addr) & 0x01) /* is address mcast/bcast? */
-
-/*
- * NOTE: 0x0000-0x05DC (0..1500) are generally IEEE 802.3 length fields.
- * However, there are some conflicts.
- */
-
-#define ETHERTYPE_8023 0x0004 /* IEEE 802.3 packet */
- /* 0x0101 .. 0x1FF Experimental */
-#define ETHERTYPE_PUP 0x0200 /* Xerox PUP protocol - see 0A00 */
-#define ETHERTYPE_PUPAT 0x0200 /* PUP Address Translation - see 0A01 */
-#define ETHERTYPE_SPRITE 0x0500 /* ??? */
- /* 0x0400 Nixdorf */
-#define ETHERTYPE_NS 0x0600 /* XNS */
-#define ETHERTYPE_NSAT 0x0601 /* XNS Address Translation (3Mb only) */
-#define ETHERTYPE_DLOG1 0x0660 /* DLOG (?) */
-#define ETHERTYPE_DLOG2 0x0661 /* DLOG (?) */
-#define ETHERTYPE_IP 0x0800 /* IP protocol */
-#define ETHERTYPE_X75 0x0801 /* X.75 Internet */
-#define ETHERTYPE_NBS 0x0802 /* NBS Internet */
-#define ETHERTYPE_ECMA 0x0803 /* ECMA Internet */
-#define ETHERTYPE_CHAOS 0x0804 /* CHAOSnet */
-#define ETHERTYPE_X25 0x0805 /* X.25 Level 3 */
-#define ETHERTYPE_ARP 0x0806 /* Address resolution protocol */
-#define ETHERTYPE_NSCOMPAT 0x0807 /* XNS Compatibility */
-#define ETHERTYPE_FRARP 0x0808 /* Frame Relay ARP (RFC1701) */
- /* 0x081C Symbolics Private */
- /* 0x0888 - 0x088A Xyplex */
-#define ETHERTYPE_UBDEBUG 0x0900 /* Ungermann-Bass network debugger */
-#define ETHERTYPE_IEEEPUP 0x0A00 /* Xerox IEEE802.3 PUP */
-#define ETHERTYPE_IEEEPUPAT 0x0A01 /* Xerox IEEE802.3 PUP Address Translation */
-#define ETHERTYPE_VINES 0x0BAD /* Banyan VINES */
-#define ETHERTYPE_VINESLOOP 0x0BAE /* Banyan VINES Loopback */
-#define ETHERTYPE_VINESECHO 0x0BAF /* Banyan VINES Echo */
-
-/* 0x1000 - 0x100F Berkeley Trailer */
-/*
- * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
- * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
- * by an ETHER type (as given above) and then the (variable-length) header.
- */
-#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
-#define ETHERTYPE_NTRAILER 16
-
-#define ETHERTYPE_DCA 0x1234 /* DCA - Multicast */
-#define ETHERTYPE_VALID 0x1600 /* VALID system protocol */
-#define ETHERTYPE_DOGFIGHT 0x1989 /* Artificial Horizons ("Aviator" dogfight simulator [on Sun]) */
-#define ETHERTYPE_RCL 0x1995 /* Datapoint Corporation (RCL lan protocol) */
-
- /* The following 3C0x types
- are unregistered: */
-#define ETHERTYPE_NBPVCD 0x3C00 /* 3Com NBP virtual circuit datagram (like XNS SPP) not registered */
-#define ETHERTYPE_NBPSCD 0x3C01 /* 3Com NBP System control datagram not registered */
-#define ETHERTYPE_NBPCREQ 0x3C02 /* 3Com NBP Connect request (virtual cct) not registered */
-#define ETHERTYPE_NBPCRSP 0x3C03 /* 3Com NBP Connect response not registered */
-#define ETHERTYPE_NBPCC 0x3C04 /* 3Com NBP Connect complete not registered */
-#define ETHERTYPE_NBPCLREQ 0x3C05 /* 3Com NBP Close request (virtual cct) not registered */
-#define ETHERTYPE_NBPCLRSP 0x3C06 /* 3Com NBP Close response not registered */
-#define ETHERTYPE_NBPDG 0x3C07 /* 3Com NBP Datagram (like XNS IDP) not registered */
-#define ETHERTYPE_NBPDGB 0x3C08 /* 3Com NBP Datagram broadcast not registered */
-#define ETHERTYPE_NBPCLAIM 0x3C09 /* 3Com NBP Claim NetBIOS name not registered */
-#define ETHERTYPE_NBPDLTE 0x3C0A /* 3Com NBP Delete NetBIOS name not registered */
-#define ETHERTYPE_NBPRAS 0x3C0B /* 3Com NBP Remote adaptor status request not registered */
-#define ETHERTYPE_NBPRAR 0x3C0C /* 3Com NBP Remote adaptor response not registered */
-#define ETHERTYPE_NBPRST 0x3C0D /* 3Com NBP Reset not registered */
-
-#define ETHERTYPE_PCS 0x4242 /* PCS Basic Block Protocol */
-#define ETHERTYPE_IMLBLDIAG 0x424C /* Information Modes Little Big LAN diagnostic */
-#define ETHERTYPE_DIDDLE 0x4321 /* THD - Diddle */
-#define ETHERTYPE_IMLBL 0x4C42 /* Information Modes Little Big LAN */
-#define ETHERTYPE_SIMNET 0x5208 /* BBN Simnet Private */
-#define ETHERTYPE_DECEXPER 0x6000 /* DEC Unassigned, experimental */
-#define ETHERTYPE_MOPDL 0x6001 /* DEC MOP dump/load */
-#define ETHERTYPE_MOPRC 0x6002 /* DEC MOP remote console */
-#define ETHERTYPE_DECnet 0x6003 /* DEC DECNET Phase IV route */
-#define ETHERTYPE_DN ETHERTYPE_DECnet /* libpcap, tcpdump */
-#define ETHERTYPE_LAT 0x6004 /* DEC LAT */
-#define ETHERTYPE_DECDIAG 0x6005 /* DEC diagnostic protocol (at interface initialization?) */
-#define ETHERTYPE_DECCUST 0x6006 /* DEC customer protocol */
-#define ETHERTYPE_SCA 0x6007 /* DEC LAVC, SCA */
-#define ETHERTYPE_AMBER 0x6008 /* DEC AMBER */
-#define ETHERTYPE_DECMUMPS 0x6009 /* DEC MUMPS */
- /* 0x6010 - 0x6014 3Com Corporation */
-#define ETHERTYPE_TRANSETHER 0x6558 /* Trans Ether Bridging (RFC1701)*/
-#define ETHERTYPE_RAWFR 0x6559 /* Raw Frame Relay (RFC1701) */
-#define ETHERTYPE_UBDL 0x7000 /* Ungermann-Bass download */
-#define ETHERTYPE_UBNIU 0x7001 /* Ungermann-Bass NIUs */
-#define ETHERTYPE_UBDIAGLOOP 0x7002 /* Ungermann-Bass diagnostic/loopback */
-#define ETHERTYPE_UBNMC 0x7003 /* Ungermann-Bass ??? (NMC to/from UB Bridge) */
-#define ETHERTYPE_UBBST 0x7005 /* Ungermann-Bass Bridge Spanning Tree */
-#define ETHERTYPE_OS9 0x7007 /* OS/9 Microware */
-#define ETHERTYPE_OS9NET 0x7009 /* OS/9 Net? */
- /* 0x7020 - 0x7029 LRT (England) (now Sintrom) */
-#define ETHERTYPE_RACAL 0x7030 /* Racal-Interlan */
-#define ETHERTYPE_PRIMENTS 0x7031 /* Prime NTS (Network Terminal Service) */
-#define ETHERTYPE_CABLETRON 0x7034 /* Cabletron */
-#define ETHERTYPE_CRONUSVLN 0x8003 /* Cronus VLN */
-#define ETHERTYPE_CRONUS 0x8004 /* Cronus Direct */
-#define ETHERTYPE_HP 0x8005 /* HP Probe */
-#define ETHERTYPE_NESTAR 0x8006 /* Nestar */
-#define ETHERTYPE_ATTSTANFORD 0x8008 /* AT&T/Stanford (local use) */
-#define ETHERTYPE_EXCELAN 0x8010 /* Excelan */
-#define ETHERTYPE_SG_DIAG 0x8013 /* SGI diagnostic type */
-#define ETHERTYPE_SG_NETGAMES 0x8014 /* SGI network games */
-#define ETHERTYPE_SG_RESV 0x8015 /* SGI reserved type */
-#define ETHERTYPE_SG_BOUNCE 0x8016 /* SGI bounce server */
-#define ETHERTYPE_APOLLODOMAIN 0x8019 /* Apollo DOMAIN */
-#define ETHERTYPE_TYMSHARE 0x802E /* Tymeshare */
-#define ETHERTYPE_TIGAN 0x802F /* Tigan, Inc. */
-#define ETHERTYPE_REVARP 0x8035 /* Reverse addr resolution protocol */
-#define ETHERTYPE_AEONIC 0x8036 /* Aeonic Systems */
-#define ETHERTYPE_IPXNEW 0x8037 /* IPX (Novell Netware?) */
-#define ETHERTYPE_LANBRIDGE 0x8038 /* DEC LANBridge */
-#define ETHERTYPE_DSMD 0x8039 /* DEC DSM/DDP */
-#define ETHERTYPE_ARGONAUT 0x803A /* DEC Argonaut Console */
-#define ETHERTYPE_VAXELN 0x803B /* DEC VAXELN */
-#define ETHERTYPE_DECDNS 0x803C /* DEC DNS Naming Service */
-#define ETHERTYPE_ENCRYPT 0x803D /* DEC Ethernet Encryption */
-#define ETHERTYPE_DECDTS 0x803E /* DEC Distributed Time Service */
-#define ETHERTYPE_DECLTM 0x803F /* DEC LAN Traffic Monitor */
-#define ETHERTYPE_DECNETBIOS 0x8040 /* DEC PATHWORKS DECnet NETBIOS Emulation */
-#define ETHERTYPE_DECLAST 0x8041 /* DEC Local Area System Transport */
- /* 0x8042 DEC Unassigned */
-#define ETHERTYPE_PLANNING 0x8044 /* Planning Research Corp. */
- /* 0x8046 - 0x8047 AT&T */
-#define ETHERTYPE_DECAM 0x8048 /* DEC Availability Manager for Distributed Systems DECamds (but someone at DEC says not) */
-#define ETHERTYPE_EXPERDATA 0x8049 /* ExperData */
-#define ETHERTYPE_VEXP 0x805B /* Stanford V Kernel exp. */
-#define ETHERTYPE_VPROD 0x805C /* Stanford V Kernel prod. */
-#define ETHERTYPE_ES 0x805D /* Evans & Sutherland */
-#define ETHERTYPE_LITTLE 0x8060 /* Little Machines */
-#define ETHERTYPE_COUNTERPOINT 0x8062 /* Counterpoint Computers */
- /* 0x8065 - 0x8066 Univ. of Mass @ Amherst */
-#define ETHERTYPE_VEECO 0x8067 /* Veeco Integrated Auto. */
-#define ETHERTYPE_GENDYN 0x8068 /* General Dynamics */
-#define ETHERTYPE_ATT 0x8069 /* AT&T */
-#define ETHERTYPE_AUTOPHON 0x806A /* Autophon */
-#define ETHERTYPE_COMDESIGN 0x806C /* ComDesign */
-#define ETHERTYPE_COMPUGRAPHIC 0x806D /* Compugraphic Corporation */
- /* 0x806E - 0x8077 Landmark Graphics Corp. */
-#define ETHERTYPE_MATRA 0x807A /* Matra */
-#define ETHERTYPE_DDE 0x807B /* Dansk Data Elektronik */
-#define ETHERTYPE_MERIT 0x807C /* Merit Internodal (or Univ of Michigan?) */
- /* 0x807D - 0x807F Vitalink Communications */
-#define ETHERTYPE_VLTLMAN 0x8080 /* Vitalink TransLAN III Management */
- /* 0x8081 - 0x8083 Counterpoint Computers */
- /* 0x8088 - 0x808A Xyplex */
-#define ETHERTYPE_ATALK 0x809B /* AppleTalk */
-#define ETHERTYPE_AT ETHERTYPE_ATALK /* old NetBSD */
-#define ETHERTYPE_APPLETALK ETHERTYPE_ATALK /* HP-UX */
- /* 0x809C - 0x809E Datability */
-#define ETHERTYPE_SPIDER 0x809F /* Spider Systems Ltd. */
- /* 0x80A3 Nixdorf */
- /* 0x80A4 - 0x80B3 Siemens Gammasonics Inc. */
- /* 0x80C0 - 0x80C3 DCA (Digital Comm. Assoc.) Data Exchange Cluster */
- /* 0x80C4 - 0x80C5 Banyan Systems */
-#define ETHERTYPE_PACER 0x80C6 /* Pacer Software */
-#define ETHERTYPE_APPLITEK 0x80C7 /* Applitek Corporation */
- /* 0x80C8 - 0x80CC Intergraph Corporation */
- /* 0x80CD - 0x80CE Harris Corporation */
- /* 0x80CF - 0x80D2 Taylor Instrument */
- /* 0x80D3 - 0x80D4 Rosemount Corporation */
-#define ETHERTYPE_SNA 0x80D5 /* IBM SNA Services over Ethernet */
-#define ETHERTYPE_VARIAN 0x80DD /* Varian Associates */
- /* 0x80DE - 0x80DF TRFS (Integrated Solutions Transparent Remote File System) */
- /* 0x80E0 - 0x80E3 Allen-Bradley */
- /* 0x80E4 - 0x80F0 Datability */
-#define ETHERTYPE_RETIX 0x80F2 /* Retix */
-#define ETHERTYPE_AARP 0x80F3 /* AppleTalk AARP */
- /* 0x80F4 - 0x80F5 Kinetics */
-#define ETHERTYPE_APOLLO 0x80F7 /* Apollo Computer */
-#define ETHERTYPE_VLAN 0x8100 /* IEEE 802.1Q VLAN tagging (XXX conflicts) */
- /* 0x80FF - 0x8101 Wellfleet Communications (XXX conflicts) */
-#define ETHERTYPE_BOFL 0x8102 /* Wellfleet; BOFL (Breath OF Life) pkts [every 5-10 secs.] */
-#define ETHERTYPE_WELLFLEET 0x8103 /* Wellfleet Communications */
- /* 0x8107 - 0x8109 Symbolics Private */
-#define ETHERTYPE_TALARIS 0x812B /* Talaris */
-#define ETHERTYPE_WATERLOO 0x8130 /* Waterloo Microsystems Inc. (XXX which?) */
-#define ETHERTYPE_HAYES 0x8130 /* Hayes Microcomputers (XXX which?) */
-#define ETHERTYPE_VGLAB 0x8131 /* VG Laboratory Systems */
- /* 0x8132 - 0x8137 Bridge Communications */
-#define ETHERTYPE_IPX 0x8137 /* Novell (old) NetWare IPX (ECONFIG E option) */
-#define ETHERTYPE_NOVELL 0x8138 /* Novell, Inc. */
- /* 0x8139 - 0x813D KTI */
-#define ETHERTYPE_MUMPS 0x813F /* M/MUMPS data sharing */
-#define ETHERTYPE_AMOEBA 0x8145 /* Vrije Universiteit (NL) Amoeba 4 RPC (obsolete) */
-#define ETHERTYPE_FLIP 0x8146 /* Vrije Universiteit (NL) FLIP (Fast Local Internet Protocol) */
-#define ETHERTYPE_VURESERVED 0x8147 /* Vrije Universiteit (NL) [reserved] */
-#define ETHERTYPE_LOGICRAFT 0x8148 /* Logicraft */
-#define ETHERTYPE_NCD 0x8149 /* Network Computing Devices */
-#define ETHERTYPE_ALPHA 0x814A /* Alpha Micro */
-#define ETHERTYPE_SNMP 0x814C /* SNMP over Ethernet (see RFC1089) */
- /* 0x814D - 0x814E BIIN */
-#define ETHERTYPE_TEC 0x814F /* Technically Elite Concepts */
-#define ETHERTYPE_RATIONAL 0x8150 /* Rational Corp */
- /* 0x8151 - 0x8153 Qualcomm */
- /* 0x815C - 0x815E Computer Protocol Pty Ltd */
- /* 0x8164 - 0x8166 Charles River Data Systems */
-#define ETHERTYPE_XTP 0x817D /* Protocol Engines XTP */
-#define ETHERTYPE_SGITW 0x817E /* SGI/Time Warner prop. */
-#define ETHERTYPE_HIPPI_FP 0x8180 /* HIPPI-FP encapsulation */
-#define ETHERTYPE_STP 0x8181 /* Scheduled Transfer STP, HIPPI-ST */
- /* 0x8182 - 0x8183 Reserved for HIPPI-6400 */
- /* 0x8184 - 0x818C SGI prop. */
-#define ETHERTYPE_MOTOROLA 0x818D /* Motorola */
-#define ETHERTYPE_NETBEUI 0x8191 /* PowerLAN NetBIOS/NetBEUI (PC) */
- /* 0x819A - 0x81A3 RAD Network Devices */
- /* 0x81B7 - 0x81B9 Xyplex */
- /* 0x81CC - 0x81D5 Apricot Computers */
- /* 0x81D6 - 0x81DD Artisoft Lantastic */
- /* 0x81E6 - 0x81EF Polygon */
- /* 0x81F0 - 0x81F2 Comsat Labs */
- /* 0x81F3 - 0x81F5 SAIC */
- /* 0x81F6 - 0x81F8 VG Analytical */
- /* 0x8203 - 0x8205 QNX Software Systems Ltd. */
- /* 0x8221 - 0x8222 Ascom Banking Systems */
- /* 0x823E - 0x8240 Advanced Encryption Systems */
- /* 0x8263 - 0x826A Charles River Data Systems */
- /* 0x827F - 0x8282 Athena Programming */
- /* 0x829A - 0x829B Inst Ind Info Tech */
- /* 0x829C - 0x82AB Taurus Controls */
- /* 0x82AC - 0x8693 Walker Richer & Quinn */
-#define ETHERTYPE_ACCTON 0x8390 /* Accton Technologies (unregistered) */
-#define ETHERTYPE_TALARISMC 0x852B /* Talaris multicast */
-#define ETHERTYPE_KALPANA 0x8582 /* Kalpana */
- /* 0x8694 - 0x869D Idea Courier */
- /* 0x869E - 0x86A1 Computer Network Tech */
- /* 0x86A3 - 0x86AC Gateway Communications */
-#define ETHERTYPE_SECTRA 0x86DB /* SECTRA */
-#define ETHERTYPE_IPV6 0x86DD /* IP protocol version 6 */
-#define ETHERTYPE_DELTACON 0x86DE /* Delta Controls */
-#define ETHERTYPE_ATOMIC 0x86DF /* ATOMIC */
- /* 0x86E0 - 0x86EF Landis & Gyr Powers */
- /* 0x8700 - 0x8710 Motorola */
-#define ETHERTYPE_RDP 0x8739 /* Control Technology Inc. RDP Without IP */
-#define ETHERTYPE_MICP 0x873A /* Control Technology Inc. Mcast Industrial Ctrl Proto. */
- /* 0x873B - 0x873C Control Technology Inc. Proprietary */
-#define ETHERTYPE_TCPCOMP 0x876B /* TCP/IP Compression (RFC1701) */
-#define ETHERTYPE_IPAS 0x876C /* IP Autonomous Systems (RFC1701) */
-#define ETHERTYPE_SECUREDATA 0x876D /* Secure Data (RFC1701) */
-#define ETHERTYPE_FLOWCONTROL 0x8808 /* 802.3x flow control packet */
-#define ETHERTYPE_SLOW 0x8809 /* 802.3ad link aggregation (LACP) */
-#define ETHERTYPE_PPP 0x880B /* PPP (obsolete by PPPoE) */
-#define ETHERTYPE_HITACHI 0x8820 /* Hitachi Cable (Optoelectronic Systems Laboratory) */
-#define ETHERTYPE_MPLS 0x8847 /* MPLS Unicast */
-#define ETHERTYPE_MPLS_MCAST 0x8848 /* MPLS Multicast */
-#define ETHERTYPE_AXIS 0x8856 /* Axis Communications AB proprietary bootstrap/config */
-#define ETHERTYPE_PPPOEDISC 0x8863 /* PPP Over Ethernet Discovery Stage */
-#define ETHERTYPE_PPPOE 0x8864 /* PPP Over Ethernet Session Stage */
-#define ETHERTYPE_LANPROBE 0x8888 /* HP LanProbe test? */
-#define ETHERTYPE_PAE 0x888e /* EAPOL PAE/802.1x */
-#define ETHERTYPE_LOOPBACK 0x9000 /* Loopback: used to test interfaces */
-#define ETHERTYPE_LBACK ETHERTYPE_LOOPBACK /* DEC MOP loopback */
-#define ETHERTYPE_XNSSM 0x9001 /* 3Com (Formerly Bridge Communications), XNS Systems Management */
-#define ETHERTYPE_TCPSM 0x9002 /* 3Com (Formerly Bridge Communications), TCP/IP Systems Management */
-#define ETHERTYPE_BCLOOP 0x9003 /* 3Com (Formerly Bridge Communications), loopback detection */
-#define ETHERTYPE_DEBNI 0xAAAA /* DECNET? Used by VAX 6220 DEBNI */
-#define ETHERTYPE_SONIX 0xFAF5 /* Sonix Arpeggio */
-#define ETHERTYPE_VITAL 0xFF00 /* BBN VITAL-LanBridge cache wakeups */
- /* 0xFF00 - 0xFFOF ISC Bunker Ramo */
-
-#define ETHERTYPE_MAX 0xFFFF /* Maximum valid ethernet type, reserved */
-
-/*
- * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
- * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
- * by an ETHER type (as given above) and then the (variable-length) header.
- */
-#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
-#define ETHERTYPE_NTRAILER 16
-
-#define ETHERMTU (ETHER_MAX_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
-#define ETHERMIN (ETHER_MIN_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
-#define ETHERMTU_JUMBO (ETHER_MAX_LEN_JUMBO - ETHER_HDR_LEN - ETHER_CRC_LEN)
-/*
- * The ETHER_BPF_MTAP macro should be used by drivers which support hardware
- * offload for VLAN tag processing. It will check the mbuf to see if it has
- * M_VLANTAG set, and if it does, will pass the packet along to
- * ether_vlan_mtap. This function will re-insert VLAN tags for the duration
- * of the tap, so they show up properly for network analyzers.
- */
-#define ETHER_BPF_MTAP(_ifp, _m) do { \
- if (bpf_peers_present((_ifp)->if_bpf)) { \
- M_ASSERTVALID(_m); \
- if (((_m)->m_flags & M_VLANTAG) != 0) \
- ether_vlan_mtap((_ifp)->if_bpf, (_m), NULL, 0); \
- else \
- bpf_mtap((_ifp)->if_bpf, (_m)); \
- } \
-} while (0)
-
-#ifdef _KERNEL
-
-struct ifnet;
-struct mbuf;
-struct route;
-struct sockaddr;
-struct bpf_if;
-
-extern uint32_t ether_crc32_le(const uint8_t *, size_t);
-extern uint32_t ether_crc32_be(const uint8_t *, size_t);
-extern void ether_demux(struct ifnet *, struct mbuf *);
-extern void ether_ifattach(struct ifnet *, const u_int8_t *);
-extern void ether_ifdetach(struct ifnet *);
-extern int ether_ioctl(struct ifnet *, u_long, caddr_t);
-extern int ether_output(struct ifnet *,
- struct mbuf *, struct sockaddr *, struct route *);
-extern int ether_output_frame(struct ifnet *, struct mbuf *);
-extern char *ether_sprintf(const u_int8_t *);
-void ether_vlan_mtap(struct bpf_if *, struct mbuf *,
- void *, u_int);
-struct mbuf *ether_vlanencap(struct mbuf *, uint16_t);
-
-#else /* _KERNEL */
-
-#include <freebsd/sys/cdefs.h>
-
-/*
- * Ethernet address conversion/parsing routines.
- */
-__BEGIN_DECLS
-struct ether_addr *ether_aton(const char *);
-struct ether_addr *ether_aton_r(const char *, struct ether_addr *);
-int ether_hostton(const char *, struct ether_addr *);
-int ether_line(const char *, struct ether_addr *, char *);
-char *ether_ntoa(const struct ether_addr *);
-char *ether_ntoa_r(const struct ether_addr *, char *);
-int ether_ntohost(char *, const struct ether_addr *);
-__END_DECLS
-
-#endif /* !_KERNEL */
-
-#endif /* !_NET_ETHERNET_HH_ */
diff --git a/freebsd/net/if.h b/freebsd/net/if.h
deleted file mode 100644
index facdf157..00000000
--- a/freebsd/net/if.h
+++ /dev/null
@@ -1,470 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)if.h 8.1 (Berkeley) 6/10/93
- * $FreeBSD$
- */
-
-#ifndef _NET_IF_HH_
-#define _NET_IF_HH_
-
-#include <freebsd/sys/cdefs.h>
-
-#ifdef _KERNEL
-#include <freebsd/sys/queue.h>
-#endif
-
-#if __BSD_VISIBLE
-
-#ifdef __rtems__
-#include <freebsd/sys/time.h>
-#else
-#ifndef _KERNEL
-/*
- * <net/if.h> does not depend on <sys/time.h> on most other systems. This
- * helps userland compatibility. (struct timeval ifi_lastchange)
- */
-#include <freebsd/sys/time.h>
-#endif
-#endif /* __rtems__ */
-
-struct ifnet;
-#endif
-
-/*
- * Length of interface external name, including terminating '\0'.
- * Note: this is the same size as a generic device's external name.
- */
-#define IF_NAMESIZE 16
-#if __BSD_VISIBLE
-#define IFNAMSIZ IF_NAMESIZE
-#define IF_MAXUNIT 0x7fff /* historical value */
-#endif
-#if __BSD_VISIBLE
-
-/*
- * Structure used to query names of interface cloners.
- */
-
-struct if_clonereq {
- int ifcr_total; /* total cloners (out) */
- int ifcr_count; /* room for this many in user buffer */
- char *ifcr_buffer; /* buffer for cloner names */
-};
-
-/*
- * Structure describing information about an interface
- * which may be of interest to management entities.
- */
-struct if_data {
- /* generic interface information */
- u_char ifi_type; /* ethernet, tokenring, etc */
- u_char ifi_physical; /* e.g., AUI, Thinnet, 10base-T, etc */
- u_char ifi_addrlen; /* media address length */
- u_char ifi_hdrlen; /* media header length */
- u_char ifi_link_state; /* current link state */
- u_char ifi_spare_char1; /* spare byte */
- u_char ifi_spare_char2; /* spare byte */
- u_char ifi_datalen; /* length of this data struct */
- u_long ifi_mtu; /* maximum transmission unit */
- u_long ifi_metric; /* routing metric (external only) */
- u_long ifi_baudrate; /* linespeed */
- /* volatile statistics */
- u_long ifi_ipackets; /* packets received on interface */
- u_long ifi_ierrors; /* input errors on interface */
- u_long ifi_opackets; /* packets sent on interface */
- u_long ifi_oerrors; /* output errors on interface */
- u_long ifi_collisions; /* collisions on csma interfaces */
- u_long ifi_ibytes; /* total number of octets received */
- u_long ifi_obytes; /* total number of octets sent */
- u_long ifi_imcasts; /* packets received via multicast */
- u_long ifi_omcasts; /* packets sent via multicast */
- u_long ifi_iqdrops; /* dropped on input, this interface */
- u_long ifi_noproto; /* destined for unsupported protocol */
- u_long ifi_hwassist; /* HW offload capabilities, see IFCAP */
- time_t ifi_epoch; /* uptime at attach or stat reset */
- struct timeval ifi_lastchange; /* time of last administrative change */
-};
-
-/*-
- * Interface flags are of two types: network stack owned flags, and driver
- * owned flags. Historically, these values were stored in the same ifnet
- * flags field, but with the advent of fine-grained locking, they have been
- * broken out such that the network stack is responsible for synchronizing
- * the stack-owned fields, and the device driver the device-owned fields.
- * Both halves can perform lockless reads of the other half's field, subject
- * to accepting the involved races.
- *
- * Both sets of flags come from the same number space, and should not be
- * permitted to conflict, as they are exposed to user space via a single
- * field.
- *
- * The following symbols identify read and write requirements for fields:
- *
- * (i) if_flags field set by device driver before attach, read-only there
- * after.
- * (n) if_flags field written only by the network stack, read by either the
- * stack or driver.
- * (d) if_drv_flags field written only by the device driver, read by either
- * the stack or driver.
- */
-#define IFF_UP 0x1 /* (n) interface is up */
-#define IFF_BROADCAST 0x2 /* (i) broadcast address valid */
-#define IFF_DEBUG 0x4 /* (n) turn on debugging */
-#define IFF_LOOPBACK 0x8 /* (i) is a loopback net */
-#define IFF_POINTOPOINT 0x10 /* (i) is a point-to-point link */
-#define IFF_SMART 0x20 /* (i) interface manages own routes */
-#define IFF_DRV_RUNNING 0x40 /* (d) resources allocated */
-#define IFF_NOARP 0x80 /* (n) no address resolution protocol */
-#define IFF_PROMISC 0x100 /* (n) receive all packets */
-#define IFF_ALLMULTI 0x200 /* (n) receive all multicast packets */
-#define IFF_DRV_OACTIVE 0x400 /* (d) tx hardware queue is full */
-#define IFF_SIMPLEX 0x800 /* (i) can't hear own transmissions */
-#define IFF_LINK0 0x1000 /* per link layer defined bit */
-#define IFF_LINK1 0x2000 /* per link layer defined bit */
-#define IFF_LINK2 0x4000 /* per link layer defined bit */
-#define IFF_ALTPHYS IFF_LINK2 /* use alternate physical connection */
-#define IFF_MULTICAST 0x8000 /* (i) supports multicast */
-/* 0x10000 */
-#define IFF_PPROMISC 0x20000 /* (n) user-requested promisc mode */
-#define IFF_MONITOR 0x40000 /* (n) user-requested monitor mode */
-#define IFF_STATICARP 0x80000 /* (n) static ARP */
-#define IFF_DYING 0x200000 /* (n) interface is winding down */
-#define IFF_RENAMING 0x400000 /* (n) interface is being renamed */
-
-/*
- * Old names for driver flags so that user space tools can continue to use
- * the old (portable) names.
- */
-#ifndef _KERNEL
-#define IFF_RUNNING IFF_DRV_RUNNING
-#define IFF_OACTIVE IFF_DRV_OACTIVE
-#endif
-
-/* flags set internally only: */
-#define IFF_CANTCHANGE \
- (IFF_BROADCAST|IFF_POINTOPOINT|IFF_DRV_RUNNING|IFF_DRV_OACTIVE|\
- IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI|IFF_SMART|IFF_PROMISC|\
- IFF_DYING)
-
-/*
- * Values for if_link_state.
- */
-#define LINK_STATE_UNKNOWN 0 /* link invalid/unknown */
-#define LINK_STATE_DOWN 1 /* link is down */
-#define LINK_STATE_UP 2 /* link is up */
-
-/*
- * Some convenience macros used for setting ifi_baudrate.
- * XXX 1000 vs. 1024? --thorpej@netbsd.org
- */
-#define IF_Kbps(x) ((x) * 1000) /* kilobits/sec. */
-#define IF_Mbps(x) (IF_Kbps((x) * 1000)) /* megabits/sec. */
-#define IF_Gbps(x) (IF_Mbps((x) * 1000)) /* gigabits/sec. */
-
-/*
- * Capabilities that interfaces can advertise.
- *
- * struct ifnet.if_capabilities
- * contains the optional features & capabilities a particular interface
- * supports (not only the driver but also the detected hw revision).
- * Capabilities are defined by IFCAP_* below.
- * struct ifnet.if_capenable
- * contains the enabled (either by default or through ifconfig) optional
- * features & capabilities on this interface.
- * Capabilities are defined by IFCAP_* below.
- * struct if_data.ifi_hwassist in mbuf CSUM_ flag form, controlled by above
- * contains the enabled optional feature & capabilites that can be used
- * individually per packet and are specified in the mbuf pkthdr.csum_flags
- * field. IFCAP_* and CSUM_* do not match one to one and CSUM_* may be
- * more detailed or differenciated than IFCAP_*.
- * Hwassist features are defined CSUM_* in sys/mbuf.h
- */
-#define IFCAP_RXCSUM 0x00001 /* can offload checksum on RX */
-#define IFCAP_TXCSUM 0x00002 /* can offload checksum on TX */
-#define IFCAP_NETCONS 0x00004 /* can be a network console */
-#define IFCAP_VLAN_MTU 0x00008 /* VLAN-compatible MTU */
-#define IFCAP_VLAN_HWTAGGING 0x00010 /* hardware VLAN tag support */
-#define IFCAP_JUMBO_MTU 0x00020 /* 9000 byte MTU supported */
-#define IFCAP_POLLING 0x00040 /* driver supports polling */
-#define IFCAP_VLAN_HWCSUM 0x00080 /* can do IFCAP_HWCSUM on VLANs */
-#define IFCAP_TSO4 0x00100 /* can do TCP Segmentation Offload */
-#define IFCAP_TSO6 0x00200 /* can do TCP6 Segmentation Offload */
-#define IFCAP_LRO 0x00400 /* can do Large Receive Offload */
-#define IFCAP_WOL_UCAST 0x00800 /* wake on any unicast frame */
-#define IFCAP_WOL_MCAST 0x01000 /* wake on any multicast frame */
-#define IFCAP_WOL_MAGIC 0x02000 /* wake on any Magic Packet */
-#define IFCAP_TOE4 0x04000 /* interface can offload TCP */
-#define IFCAP_TOE6 0x08000 /* interface can offload TCP6 */
-#define IFCAP_VLAN_HWFILTER 0x10000 /* interface hw can filter vlan tag */
-#define IFCAP_POLLING_NOCOUNT 0x20000 /* polling ticks cannot be fragmented */
-#define IFCAP_VLAN_HWTSO 0x40000 /* can do IFCAP_TSO on VLANs */
-#define IFCAP_LINKSTATE 0x80000 /* the runtime link state is dynamic */
-
-#define IFCAP_HWCSUM (IFCAP_RXCSUM | IFCAP_TXCSUM)
-#define IFCAP_TSO (IFCAP_TSO4 | IFCAP_TSO6)
-#define IFCAP_WOL (IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC)
-#define IFCAP_TOE (IFCAP_TOE4 | IFCAP_TOE6)
-
-#define IFQ_MAXLEN 50
-#define IFNET_SLOWHZ 1 /* granularity is 1 second */
-
-/*
- * Message format for use in obtaining information about interfaces
- * from getkerninfo and the routing socket
- */
-struct if_msghdr {
- u_short ifm_msglen; /* to skip over non-understood messages */
- u_char ifm_version; /* future binary compatibility */
- u_char ifm_type; /* message type */
- int ifm_addrs; /* like rtm_addrs */
- int ifm_flags; /* value of if_flags */
- u_short ifm_index; /* index for associated ifp */
- struct if_data ifm_data;/* statistics and other data about if */
-};
-
-/*
- * Message format for use in obtaining information about interface addresses
- * from getkerninfo and the routing socket
- */
-struct ifa_msghdr {
- u_short ifam_msglen; /* to skip over non-understood messages */
- u_char ifam_version; /* future binary compatibility */
- u_char ifam_type; /* message type */
- int ifam_addrs; /* like rtm_addrs */
- int ifam_flags; /* value of ifa_flags */
- u_short ifam_index; /* index for associated ifp */
- int ifam_metric; /* value of ifa_metric */
-};
-
-/*
- * Message format for use in obtaining information about multicast addresses
- * from the routing socket
- */
-struct ifma_msghdr {
- u_short ifmam_msglen; /* to skip over non-understood messages */
- u_char ifmam_version; /* future binary compatibility */
- u_char ifmam_type; /* message type */
- int ifmam_addrs; /* like rtm_addrs */
- int ifmam_flags; /* value of ifa_flags */
- u_short ifmam_index; /* index for associated ifp */
-};
-
-/*
- * Message format announcing the arrival or departure of a network interface.
- */
-struct if_announcemsghdr {
- u_short ifan_msglen; /* to skip over non-understood messages */
- u_char ifan_version; /* future binary compatibility */
- u_char ifan_type; /* message type */
- u_short ifan_index; /* index for associated ifp */
- char ifan_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- u_short ifan_what; /* what type of announcement */
-};
-
-#define IFAN_ARRIVAL 0 /* interface arrival */
-#define IFAN_DEPARTURE 1 /* interface departure */
-
-/*
- * Buffer with length to be used in SIOCGIFDESCR/SIOCSIFDESCR requests
- */
-struct ifreq_buffer {
- size_t length;
- void *buffer;
-};
-
-/*
- * Interface request structure used for socket
- * ioctl's. All interface ioctl's must have parameter
- * definitions which begin with ifr_name. The
- * remainder may be interface specific.
- */
-struct ifreq {
- char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- union {
- struct sockaddr ifru_addr;
- struct sockaddr ifru_dstaddr;
- struct sockaddr ifru_broadaddr;
- struct ifreq_buffer ifru_buffer;
- short ifru_flags[2];
- short ifru_index;
- int ifru_jid;
- int ifru_metric;
- int ifru_mtu;
- int ifru_phys;
- int ifru_media;
- caddr_t ifru_data;
- int ifru_cap[2];
- } ifr_ifru;
-#define ifr_addr ifr_ifru.ifru_addr /* address */
-#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */
-#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
-#define ifr_buffer ifr_ifru.ifru_buffer /* user supplied buffer with its length */
-#define ifr_flags ifr_ifru.ifru_flags[0] /* flags (low 16 bits) */
-#define ifr_flagshigh ifr_ifru.ifru_flags[1] /* flags (high 16 bits) */
-#define ifr_jid ifr_ifru.ifru_jid /* jail/vnet */
-#define ifr_metric ifr_ifru.ifru_metric /* metric */
-#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
-#define ifr_phys ifr_ifru.ifru_phys /* physical wire */
-#define ifr_media ifr_ifru.ifru_media /* physical media */
-#define ifr_data ifr_ifru.ifru_data /* for use by interface */
-#define ifr_reqcap ifr_ifru.ifru_cap[0] /* requested capabilities */
-#define ifr_curcap ifr_ifru.ifru_cap[1] /* current capabilities */
-#define ifr_index ifr_ifru.ifru_index /* interface index */
-};
-
-#define _SIZEOF_ADDR_IFREQ(ifr) \
- ((ifr).ifr_addr.sa_len > sizeof(struct sockaddr) ? \
- (sizeof(struct ifreq) - sizeof(struct sockaddr) + \
- (ifr).ifr_addr.sa_len) : sizeof(struct ifreq))
-
-struct ifaliasreq {
- char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- struct sockaddr ifra_addr;
- struct sockaddr ifra_broadaddr;
- struct sockaddr ifra_mask;
-};
-
-struct ifmediareq {
- char ifm_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- int ifm_current; /* current media options */
- int ifm_mask; /* don't care mask */
- int ifm_status; /* media status */
- int ifm_active; /* active options */
- int ifm_count; /* # entries in ifm_ulist array */
- int *ifm_ulist; /* media words */
-};
-
-struct ifdrv {
- char ifd_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- unsigned long ifd_cmd;
- size_t ifd_len;
- void *ifd_data;
-};
-
-/*
- * Structure used to retrieve aux status data from interfaces.
- * Kernel suppliers to this interface should respect the formatting
- * needed by ifconfig(8): each line starts with a TAB and ends with
- * a newline. The canonical example to copy and paste is in if_tun.c.
- */
-
-#define IFSTATMAX 800 /* 10 lines of text */
-struct ifstat {
- char ifs_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- char ascii[IFSTATMAX + 1];
-};
-
-/*
- * Structure used in SIOCGIFCONF request.
- * Used to retrieve interface configuration
- * for machine (useful for programs which
- * must know all networks accessible).
- */
-struct ifconf {
- int ifc_len; /* size of associated buffer */
- union {
- caddr_t ifcu_buf;
- struct ifreq *ifcu_req;
- } ifc_ifcu;
-#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
-#define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */
-};
-
-/*
- * interface groups
- */
-
-#define IFG_ALL "all" /* group contains all interfaces */
-/* XXX: will we implement this? */
-#define IFG_EGRESS "egress" /* if(s) default route(s) point to */
-
-struct ifg_req {
- union {
- char ifgrqu_group[IFNAMSIZ];
- char ifgrqu_member[IFNAMSIZ];
- } ifgrq_ifgrqu;
-#define ifgrq_group ifgrq_ifgrqu.ifgrqu_group
-#define ifgrq_member ifgrq_ifgrqu.ifgrqu_member
-};
-
-/*
- * Used to lookup groups for an interface
- */
-struct ifgroupreq {
- char ifgr_name[IFNAMSIZ];
- u_int ifgr_len;
- union {
- char ifgru_group[IFNAMSIZ];
- struct ifg_req *ifgru_groups;
- } ifgr_ifgru;
-#define ifgr_group ifgr_ifgru.ifgru_group
-#define ifgr_groups ifgr_ifgru.ifgru_groups
-};
-
-/*
- * Structure for SIOC[AGD]LIFADDR
- */
-struct if_laddrreq {
- char iflr_name[IFNAMSIZ];
- u_int flags;
-#define IFLR_PREFIX 0x8000 /* in: prefix given out: kernel fills id */
- u_int prefixlen; /* in/out */
- struct sockaddr_storage addr; /* in/out */
- struct sockaddr_storage dstaddr; /* out */
-};
-
-#endif /* __BSD_VISIBLE */
-
-#ifdef _KERNEL
-#ifdef MALLOC_DECLARE
-MALLOC_DECLARE(M_IFADDR);
-MALLOC_DECLARE(M_IFMADDR);
-#endif
-#endif
-
-#ifndef _KERNEL
-struct if_nameindex {
- unsigned int if_index; /* 1, 2, ... */
- char *if_name; /* null terminated name: "le0", ... */
-};
-
-__BEGIN_DECLS
-void if_freenameindex(struct if_nameindex *);
-char *if_indextoname(unsigned int, char *);
-struct if_nameindex *if_nameindex(void);
-unsigned int if_nametoindex(const char *);
-__END_DECLS
-#endif
-
-#ifdef _KERNEL
-/* XXX - this should go away soon. */
-#include <freebsd/net/if_var.h>
-#endif
-
-#endif /* !_NET_IF_HH_ */
diff --git a/freebsd/net/if_arp.h b/freebsd/net/if_arp.h
deleted file mode 100644
index d2938fbd..00000000
--- a/freebsd/net/if_arp.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*-
- * Copyright (c) 1986, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)if_arp.h 8.1 (Berkeley) 6/10/93
- * $FreeBSD$
- */
-
-#ifndef _NET_IF_ARP_HH_
-#define _NET_IF_ARP_HH_
-
-/*
- * Address Resolution Protocol.
- *
- * See RFC 826 for protocol description. ARP packets are variable
- * in size; the arphdr structure defines the fixed-length portion.
- * Protocol type values are the same as those for 10 Mb/s Ethernet.
- * It is followed by the variable-sized fields ar_sha, arp_spa,
- * arp_tha and arp_tpa in that order, according to the lengths
- * specified. Field names used correspond to RFC 826.
- */
-struct arphdr {
- u_short ar_hrd; /* format of hardware address */
-#define ARPHRD_ETHER 1 /* ethernet hardware format */
-#define ARPHRD_IEEE802 6 /* token-ring hardware format */
-#define ARPHRD_ARCNET 7 /* arcnet hardware format */
-#define ARPHRD_FRELAY 15 /* frame relay hardware format */
-#define ARPHRD_IEEE1394 24 /* firewire hardware format */
- u_short ar_pro; /* format of protocol address */
- u_char ar_hln; /* length of hardware address */
- u_char ar_pln; /* length of protocol address */
- u_short ar_op; /* one of: */
-#define ARPOP_REQUEST 1 /* request to resolve address */
-#define ARPOP_REPLY 2 /* response to previous request */
-#define ARPOP_REVREQUEST 3 /* request protocol address given hardware */
-#define ARPOP_REVREPLY 4 /* response giving protocol address */
-#define ARPOP_INVREQUEST 8 /* request to identify peer */
-#define ARPOP_INVREPLY 9 /* response identifying peer */
-/*
- * The remaining fields are variable in size,
- * according to the sizes above.
- */
-#ifdef COMMENT_ONLY
- u_char ar_sha[]; /* sender hardware address */
- u_char ar_spa[]; /* sender protocol address */
- u_char ar_tha[]; /* target hardware address */
- u_char ar_tpa[]; /* target protocol address */
-#endif
-};
-
-#define ar_sha(ap) (((caddr_t)((ap)+1)) + 0)
-#define ar_spa(ap) (((caddr_t)((ap)+1)) + (ap)->ar_hln)
-#define ar_tha(ap) (((caddr_t)((ap)+1)) + (ap)->ar_hln + (ap)->ar_pln)
-#define ar_tpa(ap) (((caddr_t)((ap)+1)) + 2*(ap)->ar_hln + (ap)->ar_pln)
-
-#define arphdr_len2(ar_hln, ar_pln) \
- (sizeof(struct arphdr) + 2*(ar_hln) + 2*(ar_pln))
-#define arphdr_len(ap) (arphdr_len2((ap)->ar_hln, (ap)->ar_pln))
-
-/*
- * ARP ioctl request
- */
-struct arpreq {
- struct sockaddr arp_pa; /* protocol address */
- struct sockaddr arp_ha; /* hardware address */
- int arp_flags; /* flags */
-};
-/* arp_flags and at_flags field values */
-#define ATF_INUSE 0x01 /* entry in use */
-#define ATF_COM 0x02 /* completed entry (enaddr valid) */
-#define ATF_PERM 0x04 /* permanent entry */
-#define ATF_PUBL 0x08 /* publish entry (respond for other host) */
-#define ATF_USETRAILERS 0x10 /* has requested trailers */
-
-#ifdef _KERNEL
-/*
- * Structure shared between the ethernet driver modules and
- * the address resolution code.
- */
-struct arpcom {
- struct ifnet *ac_ifp; /* network-visible interface */
- void *ac_netgraph; /* ng_ether(4) netgraph node info */
-};
-#define IFP2AC(ifp) ((struct arpcom *)(ifp->if_l2com))
-#define AC2IFP(ac) ((ac)->ac_ifp)
-
-#endif /* _KERNEL */
-
-struct arpstat {
- /* Normal things that happen: */
- u_long txrequests; /* # of ARP requests sent by this host. */
- u_long txreplies; /* # of ARP replies sent by this host. */
- u_long rxrequests; /* # of ARP requests received by this host. */
- u_long rxreplies; /* # of ARP replies received by this host. */
- u_long received; /* # of ARP packets received by this host. */
-
- u_long arp_spares[4]; /* For either the upper or lower half. */
- /* Abnormal event and error counting: */
- u_long dropped; /* # of packets dropped waiting for a reply. */
- u_long timeouts; /* # of times with entries removed */
- /* due to timeout. */
- u_long dupips; /* # of duplicate IPs detected. */
-};
-
-/*
- * In-kernel consumers can use these accessor macros directly to update
- * stats.
- */
-#define ARPSTAT_ADD(name, val) V_arpstat.name += (val)
-#define ARPSTAT_SUB(name, val) V_arpstat.name -= (val)
-#define ARPSTAT_INC(name) ARPSTAT_ADD(name, 1)
-#define ARPSTAT_DEC(name) ARPSTAT_SUB(name, 1)
-
-#endif /* !_NET_IF_ARP_HH_ */
diff --git a/freebsd/net/if_dl.h b/freebsd/net/if_dl.h
deleted file mode 100644
index d17be69c..00000000
--- a/freebsd/net/if_dl.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)if_dl.h 8.1 (Berkeley) 6/10/93
- * $FreeBSD$
- */
-
-#ifndef _NET_IF_DL_HH_
-#define _NET_IF_DL_HH_
-
-/*
- * A Link-Level Sockaddr may specify the interface in one of two
- * ways: either by means of a system-provided index number (computed
- * anew and possibly differently on every reboot), or by a human-readable
- * string such as "il0" (for managerial convenience).
- *
- * Census taking actions, such as something akin to SIOCGCONF would return
- * both the index and the human name.
- *
- * High volume transactions (such as giving a link-level ``from'' address
- * in a recvfrom or recvmsg call) may be likely only to provide the indexed
- * form, (which requires fewer copy operations and less space).
- *
- * The form and interpretation of the link-level address is purely a matter
- * of convention between the device driver and its consumers; however, it is
- * expected that all drivers for an interface of a given if_type will agree.
- */
-
-/*
- * Structure of a Link-Level sockaddr:
- */
-struct sockaddr_dl {
- u_char sdl_len; /* Total length of sockaddr */
- u_char sdl_family; /* AF_LINK */
- u_short sdl_index; /* if != 0, system given index for interface */
- u_char sdl_type; /* interface type */
- u_char sdl_nlen; /* interface name length, no trailing 0 reqd. */
- u_char sdl_alen; /* link level address length */
- u_char sdl_slen; /* link layer selector length */
- char sdl_data[46]; /* minimum work area, can be larger;
- contains both if name and ll address */
-};
-
-#define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen))
-
-#ifndef _KERNEL
-
-#include <freebsd/sys/cdefs.h>
-
-__BEGIN_DECLS
-void link_addr(const char *, struct sockaddr_dl *);
-char *link_ntoa(const struct sockaddr_dl *);
-__END_DECLS
-
-#endif /* !_KERNEL */
-
-#endif
diff --git a/freebsd/net/if_types.h b/freebsd/net/if_types.h
deleted file mode 100644
index bb46d79b..00000000
--- a/freebsd/net/if_types.h
+++ /dev/null
@@ -1,254 +0,0 @@
-/*-
- * Copyright (c) 1989, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)if_types.h 8.3 (Berkeley) 4/28/95
- * $FreeBSD$
- * $NetBSD: if_types.h,v 1.16 2000/04/19 06:30:53 itojun Exp $
- */
-
-#ifndef _NET_IF_TYPES_HH_
-#define _NET_IF_TYPES_HH_
-
-/*
- * Interface types for benefit of parsing media address headers.
- * This list is derived from the SNMP list of ifTypes, originally
- * documented in RFC1573, now maintained as:
- *
- * http://www.iana.org/assignments/smi-numbers
- */
-
-#define IFT_OTHER 0x1 /* none of the following */
-#define IFT_1822 0x2 /* old-style arpanet imp */
-#define IFT_HDH1822 0x3 /* HDH arpanet imp */
-#define IFT_X25DDN 0x4 /* x25 to imp */
-#define IFT_X25 0x5 /* PDN X25 interface (RFC877) */
-#define IFT_ETHER 0x6 /* Ethernet CSMA/CD */
-#define IFT_ISO88023 0x7 /* CMSA/CD */
-#define IFT_ISO88024 0x8 /* Token Bus */
-#define IFT_ISO88025 0x9 /* Token Ring */
-#define IFT_ISO88026 0xa /* MAN */
-#define IFT_STARLAN 0xb
-#define IFT_P10 0xc /* Proteon 10MBit ring */
-#define IFT_P80 0xd /* Proteon 80MBit ring */
-#define IFT_HY 0xe /* Hyperchannel */
-#define IFT_FDDI 0xf
-#define IFT_LAPB 0x10
-#define IFT_SDLC 0x11
-#define IFT_T1 0x12
-#define IFT_CEPT 0x13 /* E1 - european T1 */
-#define IFT_ISDNBASIC 0x14
-#define IFT_ISDNPRIMARY 0x15
-#define IFT_PTPSERIAL 0x16 /* Proprietary PTP serial */
-#define IFT_PPP 0x17 /* RFC 1331 */
-#define IFT_LOOP 0x18 /* loopback */
-#define IFT_EON 0x19 /* ISO over IP */
-#define IFT_XETHER 0x1a /* obsolete 3MB experimental ethernet */
-#define IFT_NSIP 0x1b /* XNS over IP */
-#define IFT_SLIP 0x1c /* IP over generic TTY */
-#define IFT_ULTRA 0x1d /* Ultra Technologies */
-#define IFT_DS3 0x1e /* Generic T3 */
-#define IFT_SIP 0x1f /* SMDS */
-#define IFT_FRELAY 0x20 /* Frame Relay DTE only */
-#define IFT_RS232 0x21
-#define IFT_PARA 0x22 /* parallel-port */
-#define IFT_ARCNET 0x23
-#define IFT_ARCNETPLUS 0x24
-#define IFT_ATM 0x25 /* ATM cells */
-#define IFT_MIOX25 0x26
-#define IFT_SONET 0x27 /* SONET or SDH */
-#define IFT_X25PLE 0x28
-#define IFT_ISO88022LLC 0x29
-#define IFT_LOCALTALK 0x2a
-#define IFT_SMDSDXI 0x2b
-#define IFT_FRELAYDCE 0x2c /* Frame Relay DCE */
-#define IFT_V35 0x2d
-#define IFT_HSSI 0x2e
-#define IFT_HIPPI 0x2f
-#define IFT_MODEM 0x30 /* Generic Modem */
-#define IFT_AAL5 0x31 /* AAL5 over ATM */
-#define IFT_SONETPATH 0x32
-#define IFT_SONETVT 0x33
-#define IFT_SMDSICIP 0x34 /* SMDS InterCarrier Interface */
-#define IFT_PROPVIRTUAL 0x35 /* Proprietary Virtual/internal */
-#define IFT_PROPMUX 0x36 /* Proprietary Multiplexing */
-#define IFT_IEEE80212 0x37 /* 100BaseVG */
-#define IFT_FIBRECHANNEL 0x38 /* Fibre Channel */
-#define IFT_HIPPIINTERFACE 0x39 /* HIPPI interfaces */
-#define IFT_FRAMERELAYINTERCONNECT 0x3a /* Obsolete, use either 0x20 or 0x2c */
-#define IFT_AFLANE8023 0x3b /* ATM Emulated LAN for 802.3 */
-#define IFT_AFLANE8025 0x3c /* ATM Emulated LAN for 802.5 */
-#define IFT_CCTEMUL 0x3d /* ATM Emulated circuit */
-#define IFT_FASTETHER 0x3e /* Fast Ethernet (100BaseT) */
-#define IFT_ISDN 0x3f /* ISDN and X.25 */
-#define IFT_V11 0x40 /* CCITT V.11/X.21 */
-#define IFT_V36 0x41 /* CCITT V.36 */
-#define IFT_G703AT64K 0x42 /* CCITT G703 at 64Kbps */
-#define IFT_G703AT2MB 0x43 /* Obsolete see DS1-MIB */
-#define IFT_QLLC 0x44 /* SNA QLLC */
-#define IFT_FASTETHERFX 0x45 /* Fast Ethernet (100BaseFX) */
-#define IFT_CHANNEL 0x46 /* channel */
-#define IFT_IEEE80211 0x47 /* radio spread spectrum */
-#define IFT_IBM370PARCHAN 0x48 /* IBM System 360/370 OEMI Channel */
-#define IFT_ESCON 0x49 /* IBM Enterprise Systems Connection */
-#define IFT_DLSW 0x4a /* Data Link Switching */
-#define IFT_ISDNS 0x4b /* ISDN S/T interface */
-#define IFT_ISDNU 0x4c /* ISDN U interface */
-#define IFT_LAPD 0x4d /* Link Access Protocol D */
-#define IFT_IPSWITCH 0x4e /* IP Switching Objects */
-#define IFT_RSRB 0x4f /* Remote Source Route Bridging */
-#define IFT_ATMLOGICAL 0x50 /* ATM Logical Port */
-#define IFT_DS0 0x51 /* Digital Signal Level 0 */
-#define IFT_DS0BUNDLE 0x52 /* group of ds0s on the same ds1 */
-#define IFT_BSC 0x53 /* Bisynchronous Protocol */
-#define IFT_ASYNC 0x54 /* Asynchronous Protocol */
-#define IFT_CNR 0x55 /* Combat Net Radio */
-#define IFT_ISO88025DTR 0x56 /* ISO 802.5r DTR */
-#define IFT_EPLRS 0x57 /* Ext Pos Loc Report Sys */
-#define IFT_ARAP 0x58 /* Appletalk Remote Access Protocol */
-#define IFT_PROPCNLS 0x59 /* Proprietary Connectionless Protocol*/
-#define IFT_HOSTPAD 0x5a /* CCITT-ITU X.29 PAD Protocol */
-#define IFT_TERMPAD 0x5b /* CCITT-ITU X.3 PAD Facility */
-#define IFT_FRAMERELAYMPI 0x5c /* Multiproto Interconnect over FR */
-#define IFT_X213 0x5d /* CCITT-ITU X213 */
-#define IFT_ADSL 0x5e /* Asymmetric Digital Subscriber Loop */
-#define IFT_RADSL 0x5f /* Rate-Adapt. Digital Subscriber Loop*/
-#define IFT_SDSL 0x60 /* Symmetric Digital Subscriber Loop */
-#define IFT_VDSL 0x61 /* Very H-Speed Digital Subscrib. Loop*/
-#define IFT_ISO88025CRFPINT 0x62 /* ISO 802.5 CRFP */
-#define IFT_MYRINET 0x63 /* Myricom Myrinet */
-#define IFT_VOICEEM 0x64 /* voice recEive and transMit */
-#define IFT_VOICEFXO 0x65 /* voice Foreign Exchange Office */
-#define IFT_VOICEFXS 0x66 /* voice Foreign Exchange Station */
-#define IFT_VOICEENCAP 0x67 /* voice encapsulation */
-#define IFT_VOICEOVERIP 0x68 /* voice over IP encapsulation */
-#define IFT_ATMDXI 0x69 /* ATM DXI */
-#define IFT_ATMFUNI 0x6a /* ATM FUNI */
-#define IFT_ATMIMA 0x6b /* ATM IMA */
-#define IFT_PPPMULTILINKBUNDLE 0x6c /* PPP Multilink Bundle */
-#define IFT_IPOVERCDLC 0x6d /* IBM ipOverCdlc */
-#define IFT_IPOVERCLAW 0x6e /* IBM Common Link Access to Workstn */
-#define IFT_STACKTOSTACK 0x6f /* IBM stackToStack */
-#define IFT_VIRTUALIPADDRESS 0x70 /* IBM VIPA */
-#define IFT_MPC 0x71 /* IBM multi-protocol channel support */
-#define IFT_IPOVERATM 0x72 /* IBM ipOverAtm */
-#define IFT_ISO88025FIBER 0x73 /* ISO 802.5j Fiber Token Ring */
-#define IFT_TDLC 0x74 /* IBM twinaxial data link control */
-#define IFT_GIGABITETHERNET 0x75 /* Gigabit Ethernet */
-#define IFT_HDLC 0x76 /* HDLC */
-#define IFT_LAPF 0x77 /* LAP F */
-#define IFT_V37 0x78 /* V.37 */
-#define IFT_X25MLP 0x79 /* Multi-Link Protocol */
-#define IFT_X25HUNTGROUP 0x7a /* X25 Hunt Group */
-#define IFT_TRANSPHDLC 0x7b /* Transp HDLC */
-#define IFT_INTERLEAVE 0x7c /* Interleave channel */
-#define IFT_FAST 0x7d /* Fast channel */
-#define IFT_IP 0x7e /* IP (for APPN HPR in IP networks) */
-#define IFT_DOCSCABLEMACLAYER 0x7f /* CATV Mac Layer */
-#define IFT_DOCSCABLEDOWNSTREAM 0x80 /* CATV Downstream interface */
-#define IFT_DOCSCABLEUPSTREAM 0x81 /* CATV Upstream interface */
-#define IFT_A12MPPSWITCH 0x82 /* Avalon Parallel Processor */
-#define IFT_TUNNEL 0x83 /* Encapsulation interface */
-#define IFT_COFFEE 0x84 /* coffee pot */
-#define IFT_CES 0x85 /* Circiut Emulation Service */
-#define IFT_ATMSUBINTERFACE 0x86 /* (x) ATM Sub Interface */
-#define IFT_L2VLAN 0x87 /* Layer 2 Virtual LAN using 802.1Q */
-#define IFT_L3IPVLAN 0x88 /* Layer 3 Virtual LAN - IP Protocol */
-#define IFT_L3IPXVLAN 0x89 /* Layer 3 Virtual LAN - IPX Prot. */
-#define IFT_DIGITALPOWERLINE 0x8a /* IP over Power Lines */
-#define IFT_MEDIAMAILOVERIP 0x8b /* (xxx) Multimedia Mail over IP */
-#define IFT_DTM 0x8c /* Dynamic synchronous Transfer Mode */
-#define IFT_DCN 0x8d /* Data Communications Network */
-#define IFT_IPFORWARD 0x8e /* IP Forwarding Interface */
-#define IFT_MSDSL 0x8f /* Multi-rate Symmetric DSL */
-#define IFT_IEEE1394 0x90 /* IEEE1394 High Performance SerialBus*/
-#define IFT_IFGSN 0x91 /* HIPPI-6400 */
-#define IFT_DVBRCCMACLAYER 0x92 /* DVB-RCC MAC Layer */
-#define IFT_DVBRCCDOWNSTREAM 0x93 /* DVB-RCC Downstream Channel */
-#define IFT_DVBRCCUPSTREAM 0x94 /* DVB-RCC Upstream Channel */
-#define IFT_ATMVIRTUAL 0x95 /* ATM Virtual Interface */
-#define IFT_MPLSTUNNEL 0x96 /* MPLS Tunnel Virtual Interface */
-#define IFT_SRP 0x97 /* Spatial Reuse Protocol */
-#define IFT_VOICEOVERATM 0x98 /* Voice over ATM */
-#define IFT_VOICEOVERFRAMERELAY 0x99 /* Voice Over Frame Relay */
-#define IFT_IDSL 0x9a /* Digital Subscriber Loop over ISDN */
-#define IFT_COMPOSITELINK 0x9b /* Avici Composite Link Interface */
-#define IFT_SS7SIGLINK 0x9c /* SS7 Signaling Link */
-#define IFT_PROPWIRELESSP2P 0x9d /* Prop. P2P wireless interface */
-#define IFT_FRFORWARD 0x9e /* Frame forward Interface */
-#define IFT_RFC1483 0x9f /* Multiprotocol over ATM AAL5 */
-#define IFT_USB 0xa0 /* USB Interface */
-#define IFT_IEEE8023ADLAG 0xa1 /* IEEE 802.3ad Link Aggregate*/
-#define IFT_BGPPOLICYACCOUNTING 0xa2 /* BGP Policy Accounting */
-#define IFT_FRF16MFRBUNDLE 0xa3 /* FRF.16 Multilik Frame Relay*/
-#define IFT_H323GATEKEEPER 0xa4 /* H323 Gatekeeper */
-#define IFT_H323PROXY 0xa5 /* H323 Voice and Video Proxy */
-#define IFT_MPLS 0xa6 /* MPLS */
-#define IFT_MFSIGLINK 0xa7 /* Multi-frequency signaling link */
-#define IFT_HDSL2 0xa8 /* High Bit-Rate DSL, 2nd gen. */
-#define IFT_SHDSL 0xa9 /* Multirate HDSL2 */
-#define IFT_DS1FDL 0xaa /* Facility Data Link (4Kbps) on a DS1*/
-#define IFT_POS 0xab /* Packet over SONET/SDH Interface */
-#define IFT_DVBASILN 0xac /* DVB-ASI Input */
-#define IFT_DVBASIOUT 0xad /* DVB-ASI Output */
-#define IFT_PLC 0xae /* Power Line Communications */
-#define IFT_NFAS 0xaf /* Non-Facility Associated Signaling */
-#define IFT_TR008 0xb0 /* TROO8 */
-#define IFT_GR303RDT 0xb1 /* Remote Digital Terminal */
-#define IFT_GR303IDT 0xb2 /* Integrated Digital Terminal */
-#define IFT_ISUP 0xb3 /* ISUP */
-#define IFT_PROPDOCSWIRELESSMACLAYER 0xb4 /* prop/Wireless MAC Layer */
-#define IFT_PROPDOCSWIRELESSDOWNSTREAM 0xb5 /* prop/Wireless Downstream */
-#define IFT_PROPDOCSWIRELESSUPSTREAM 0xb6 /* prop/Wireless Upstream */
-#define IFT_HIPERLAN2 0xb7 /* HIPERLAN Type 2 Radio Interface */
-#define IFT_PROPBWAP2MP 0xb8 /* PropBroadbandWirelessAccess P2MP*/
-#define IFT_SONETOVERHEADCHANNEL 0xb9 /* SONET Overhead Channel */
-#define IFT_DIGITALWRAPPEROVERHEADCHANNEL 0xba /* Digital Wrapper Overhead */
-#define IFT_AAL2 0xbb /* ATM adaptation layer 2 */
-#define IFT_RADIOMAC 0xbc /* MAC layer over radio links */
-#define IFT_ATMRADIO 0xbd /* ATM over radio links */
-#define IFT_IMT 0xbe /* Inter-Machine Trunks */
-#define IFT_MVL 0xbf /* Multiple Virtual Lines DSL */
-#define IFT_REACHDSL 0xc0 /* Long Reach DSL */
-#define IFT_FRDLCIENDPT 0xc1 /* Frame Relay DLCI End Point */
-#define IFT_ATMVCIENDPT 0xc2 /* ATM VCI End Point */
-#define IFT_OPTICALCHANNEL 0xc3 /* Optical Channel */
-#define IFT_OPTICALTRANSPORT 0xc4 /* Optical Transport */
-#define IFT_BRIDGE 0xd1 /* Transparent bridge interface */
-
-#define IFT_STF 0xd7 /* 6to4 interface */
-
-/* not based on IANA assignments */
-#define IFT_GIF 0xf0
-#define IFT_PVC 0xf1
-#define IFT_FAITH 0xf2
-#define IFT_ENC 0xf4
-#define IFT_PFLOG 0xf6
-#define IFT_PFSYNC 0xf7
-#define IFT_CARP 0xf8 /* Common Address Redundancy Protocol */
-#define IFT_IPXIP 0xf9 /* IPX over IP tunneling; no longer used. */
-#endif /* !_NET_IF_TYPES_HH_ */
diff --git a/freebsd/net/route.h b/freebsd/net/route.h
deleted file mode 100644
index 1f75e4aa..00000000
--- a/freebsd/net/route.h
+++ /dev/null
@@ -1,446 +0,0 @@
-/*-
- * Copyright (c) 1980, 1986, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)route.h 8.4 (Berkeley) 1/9/95
- * $FreeBSD$
- */
-
-#ifndef _NET_ROUTE_HH_
-#define _NET_ROUTE_HH_
-
-/*
- * Kernel resident routing tables.
- *
- * The routing tables are initialized when interface addresses
- * are set by making entries for all directly connected interfaces.
- */
-
-/*
- * A route consists of a destination address, a reference
- * to a routing entry, and a reference to an llentry.
- * These are often held by protocols in their control
- * blocks, e.g. inpcb.
- */
-struct route {
- struct rtentry *ro_rt;
- struct llentry *ro_lle;
- struct sockaddr ro_dst;
-};
-
-/*
- * These numbers are used by reliable protocols for determining
- * retransmission behavior and are included in the routing structure.
- */
-struct rt_metrics_lite {
- u_long rmx_mtu; /* MTU for this path */
- u_long rmx_expire; /* lifetime for route, e.g. redirect */
- u_long rmx_pksent; /* packets sent using this route */
- u_long rmx_weight; /* absolute weight */
-};
-
-struct rt_metrics {
- u_long rmx_locks; /* Kernel must leave these values alone */
- u_long rmx_mtu; /* MTU for this path */
- u_long rmx_hopcount; /* max hops expected */
- u_long rmx_expire; /* lifetime for route, e.g. redirect */
- u_long rmx_recvpipe; /* inbound delay-bandwidth product */
- u_long rmx_sendpipe; /* outbound delay-bandwidth product */
- u_long rmx_ssthresh; /* outbound gateway buffer limit */
- u_long rmx_rtt; /* estimated round trip time */
- u_long rmx_rttvar; /* estimated rtt variance */
- u_long rmx_pksent; /* packets sent using this route */
- u_long rmx_weight; /* route weight */
- u_long rmx_filler[3]; /* will be used for T/TCP later */
-};
-
-/*
- * rmx_rtt and rmx_rttvar are stored as microseconds;
- * RTTTOPRHZ(rtt) converts to a value suitable for use
- * by a protocol slowtimo counter.
- */
-#define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */
-#define RTTTOPRHZ(r) ((r) / (RTM_RTTUNIT / PR_SLOWHZ))
-
-/* MRT compile-time constants */
-#ifdef _KERNEL
- #ifndef ROUTETABLES
- #define RT_NUMFIBS 1
- #define RT_MAXFIBS 1
- #else
- /* while we use 4 bits in the mbuf flags, we are limited to 16 */
- #define RT_MAXFIBS 16
- #if ROUTETABLES > RT_MAXFIBS
- #define RT_NUMFIBS RT_MAXFIBS
- #error "ROUTETABLES defined too big"
- #else
- #if ROUTETABLES == 0
- #define RT_NUMFIBS 1
- #else
- #define RT_NUMFIBS ROUTETABLES
- #endif
- #endif
- #endif
-#endif
-
-extern u_int rt_numfibs; /* number fo usable routing tables */
-extern u_int tunnel_fib; /* tunnels use these */
-extern u_int fwd_fib; /* packets being forwarded use these routes */
-/*
- * XXX kernel function pointer `rt_output' is visible to applications.
- */
-struct mbuf;
-
-/*
- * We distinguish between routes to hosts and routes to networks,
- * preferring the former if available. For each route we infer
- * the interface to use from the gateway address supplied when
- * the route was entered. Routes that forward packets through
- * gateways are marked so that the output routines know to address the
- * gateway rather than the ultimate destination.
- */
-#ifndef RNF_NORMAL
-#include <freebsd/net/radix.h>
-#ifdef RADIX_MPATH
-#include <freebsd/net/radix_mpath.h>
-#endif
-#endif
-struct rtentry {
- struct radix_node rt_nodes[2]; /* tree glue, and other values */
- /*
- * XXX struct rtentry must begin with a struct radix_node (or two!)
- * because the code does some casts of a 'struct radix_node *'
- * to a 'struct rtentry *'
- */
-#define rt_key(r) (*((struct sockaddr **)(&(r)->rt_nodes->rn_key)))
-#define rt_mask(r) (*((struct sockaddr **)(&(r)->rt_nodes->rn_mask)))
- struct sockaddr *rt_gateway; /* value */
- int rt_flags; /* up/down?, host/net */
- int rt_refcnt; /* # held references */
- struct ifnet *rt_ifp; /* the answer: interface to use */
- struct ifaddr *rt_ifa; /* the answer: interface address to use */
- struct rt_metrics_lite rt_rmx; /* metrics used by rx'ing protocols */
- u_int rt_fibnum; /* which FIB */
-#ifdef _KERNEL
- /* XXX ugly, user apps use this definition but don't have a mtx def */
- struct mtx rt_mtx; /* mutex for routing entry */
-#endif
-};
-
-/*
- * Following structure necessary for 4.3 compatibility;
- * We should eventually move it to a compat file.
- */
-struct ortentry {
- u_long rt_hash; /* to speed lookups */
- struct sockaddr rt_dst; /* key */
- struct sockaddr rt_gateway; /* value */
- short rt_flags; /* up/down?, host/net */
- short rt_refcnt; /* # held references */
- u_long rt_use; /* raw # packets forwarded */
- struct ifnet *rt_ifp; /* the answer: interface to use */
-};
-
-#define rt_use rt_rmx.rmx_pksent
-
-#define RTF_UP 0x1 /* route usable */
-#define RTF_GATEWAY 0x2 /* destination is a gateway */
-#define RTF_HOST 0x4 /* host entry (net otherwise) */
-#define RTF_REJECT 0x8 /* host or net unreachable */
-#define RTF_DYNAMIC 0x10 /* created dynamically (by redirect) */
-#define RTF_MODIFIED 0x20 /* modified dynamically (by redirect) */
-#define RTF_DONE 0x40 /* message confirmed */
-/* 0x80 unused, was RTF_DELCLONE */
-/* 0x100 unused, was RTF_CLONING */
-#define RTF_XRESOLVE 0x200 /* external daemon resolves name */
-#define RTF_LLINFO 0x400 /* DEPRECATED - exists ONLY for backward
- compatibility */
-#define RTF_LLDATA 0x400 /* used by apps to add/del L2 entries */
-#define RTF_STATIC 0x800 /* manually added */
-#define RTF_BLACKHOLE 0x1000 /* just discard pkts (during updates) */
-#define RTF_PROTO2 0x4000 /* protocol specific routing flag */
-#define RTF_PROTO1 0x8000 /* protocol specific routing flag */
-
-/* XXX: temporary to stay API/ABI compatible with userland */
-#ifndef _KERNEL
-#define RTF_PRCLONING 0x10000 /* unused, for compatibility */
-#endif
-
-/* 0x20000 unused, was RTF_WASCLONED */
-#define RTF_PROTO3 0x40000 /* protocol specific routing flag */
-/* 0x80000 unused */
-#define RTF_PINNED 0x100000 /* future use */
-#define RTF_LOCAL 0x200000 /* route represents a local address */
-#define RTF_BROADCAST 0x400000 /* route represents a bcast address */
-#define RTF_MULTICAST 0x800000 /* route represents a mcast address */
- /* 0x8000000 and up unassigned */
-#define RTF_STICKY 0x10000000 /* always route dst->src */
-
-#define RTF_RNH_LOCKED 0x40000000 /* radix node head is locked */
-
-/* Mask of RTF flags that are allowed to be modified by RTM_CHANGE. */
-#define RTF_FMASK \
- (RTF_PROTO1 | RTF_PROTO2 | RTF_PROTO3 | RTF_BLACKHOLE | \
- RTF_REJECT | RTF_STATIC | RTF_STICKY)
-
-/*
- * Routing statistics.
- */
-struct rtstat {
- short rts_badredirect; /* bogus redirect calls */
- short rts_dynamic; /* routes created by redirects */
- short rts_newgateway; /* routes modified by redirects */
- short rts_unreach; /* lookups which failed */
- short rts_wildcard; /* lookups satisfied by a wildcard */
-};
-/*
- * Structures for routing messages.
- */
-struct rt_msghdr {
- u_short rtm_msglen; /* to skip over non-understood messages */
- u_char rtm_version; /* future binary compatibility */
- u_char rtm_type; /* message type */
- u_short rtm_index; /* index for associated ifp */
- int rtm_flags; /* flags, incl. kern & message, e.g. DONE */
- int rtm_addrs; /* bitmask identifying sockaddrs in msg */
- pid_t rtm_pid; /* identify sender */
- int rtm_seq; /* for sender to identify action */
- int rtm_errno; /* why failed */
- int rtm_fmask; /* bitmask used in RTM_CHANGE message */
- u_long rtm_inits; /* which metrics we are initializing */
- struct rt_metrics rtm_rmx; /* metrics themselves */
-};
-
-#define RTM_VERSION 5 /* Up the ante and ignore older versions */
-
-/*
- * Message types.
- */
-#define RTM_ADD 0x1 /* Add Route */
-#define RTM_DELETE 0x2 /* Delete Route */
-#define RTM_CHANGE 0x3 /* Change Metrics or flags */
-#define RTM_GET 0x4 /* Report Metrics */
-#define RTM_LOSING 0x5 /* Kernel Suspects Partitioning */
-#define RTM_REDIRECT 0x6 /* Told to use different route */
-#define RTM_MISS 0x7 /* Lookup failed on this address */
-#define RTM_LOCK 0x8 /* fix specified metrics */
-#define RTM_OLDADD 0x9 /* caused by SIOCADDRT */
-#define RTM_OLDDEL 0xa /* caused by SIOCDELRT */
-#define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */
-#define RTM_NEWADDR 0xc /* address being added to iface */
-#define RTM_DELADDR 0xd /* address being removed from iface */
-#define RTM_IFINFO 0xe /* iface going up/down etc. */
-#define RTM_NEWMADDR 0xf /* mcast group membership being added to if */
-#define RTM_DELMADDR 0x10 /* mcast group membership being deleted */
-#define RTM_IFANNOUNCE 0x11 /* iface arrival/departure */
-#define RTM_IEEE80211 0x12 /* IEEE80211 wireless event */
-
-/*
- * Bitmask values for rtm_inits and rmx_locks.
- */
-#define RTV_MTU 0x1 /* init or lock _mtu */
-#define RTV_HOPCOUNT 0x2 /* init or lock _hopcount */
-#define RTV_EXPIRE 0x4 /* init or lock _expire */
-#define RTV_RPIPE 0x8 /* init or lock _recvpipe */
-#define RTV_SPIPE 0x10 /* init or lock _sendpipe */
-#define RTV_SSTHRESH 0x20 /* init or lock _ssthresh */
-#define RTV_RTT 0x40 /* init or lock _rtt */
-#define RTV_RTTVAR 0x80 /* init or lock _rttvar */
-#define RTV_WEIGHT 0x100 /* init or lock _weight */
-
-/*
- * Bitmask values for rtm_addrs.
- */
-#define RTA_DST 0x1 /* destination sockaddr present */
-#define RTA_GATEWAY 0x2 /* gateway sockaddr present */
-#define RTA_NETMASK 0x4 /* netmask sockaddr present */
-#define RTA_GENMASK 0x8 /* cloning mask sockaddr present */
-#define RTA_IFP 0x10 /* interface name sockaddr present */
-#define RTA_IFA 0x20 /* interface addr sockaddr present */
-#define RTA_AUTHOR 0x40 /* sockaddr for author of redirect */
-#define RTA_BRD 0x80 /* for NEWADDR, broadcast or p-p dest addr */
-
-/*
- * Index offsets for sockaddr array for alternate internal encoding.
- */
-#define RTAX_DST 0 /* destination sockaddr present */
-#define RTAX_GATEWAY 1 /* gateway sockaddr present */
-#define RTAX_NETMASK 2 /* netmask sockaddr present */
-#define RTAX_GENMASK 3 /* cloning mask sockaddr present */
-#define RTAX_IFP 4 /* interface name sockaddr present */
-#define RTAX_IFA 5 /* interface addr sockaddr present */
-#define RTAX_AUTHOR 6 /* sockaddr for author of redirect */
-#define RTAX_BRD 7 /* for NEWADDR, broadcast or p-p dest addr */
-#define RTAX_MAX 8 /* size of array to allocate */
-
-struct rt_addrinfo {
- int rti_addrs;
- struct sockaddr *rti_info[RTAX_MAX];
- int rti_flags;
- struct ifaddr *rti_ifa;
- struct ifnet *rti_ifp;
-};
-
-/*
- * This macro returns the size of a struct sockaddr when passed
- * through a routing socket. Basically we round up sa_len to
- * a multiple of sizeof(long), with a minimum of sizeof(long).
- * The check for a NULL pointer is just a convenience, probably never used.
- * The case sa_len == 0 should only apply to empty structures.
- */
-#define SA_SIZE(sa) \
- ( (!(sa) || ((struct sockaddr *)(sa))->sa_len == 0) ? \
- sizeof(long) : \
- 1 + ( (((struct sockaddr *)(sa))->sa_len - 1) | (sizeof(long) - 1) ) )
-
-#ifdef _KERNEL
-
-#define RT_LINK_IS_UP(ifp) (!((ifp)->if_capabilities & IFCAP_LINKSTATE) \
- || (ifp)->if_link_state == LINK_STATE_UP)
-
-#define RT_LOCK_INIT(_rt) \
- mtx_init(&(_rt)->rt_mtx, "rtentry", NULL, MTX_DEF | MTX_DUPOK)
-#define RT_LOCK(_rt) mtx_lock(&(_rt)->rt_mtx)
-#define RT_TRYLOCK(_rt) mtx_trylock(&(_rt)->rt_mtx)
-#define RT_UNLOCK(_rt) mtx_unlock(&(_rt)->rt_mtx)
-#define RT_LOCK_DESTROY(_rt) mtx_destroy(&(_rt)->rt_mtx)
-#define RT_LOCK_ASSERT(_rt) mtx_assert(&(_rt)->rt_mtx, MA_OWNED)
-
-#define RT_ADDREF(_rt) do { \
- RT_LOCK_ASSERT(_rt); \
- KASSERT((_rt)->rt_refcnt >= 0, \
- ("negative refcnt %d", (_rt)->rt_refcnt)); \
- (_rt)->rt_refcnt++; \
-} while (0)
-
-#define RT_REMREF(_rt) do { \
- RT_LOCK_ASSERT(_rt); \
- KASSERT((_rt)->rt_refcnt > 0, \
- ("bogus refcnt %d", (_rt)->rt_refcnt)); \
- (_rt)->rt_refcnt--; \
-} while (0)
-
-#define RTFREE_LOCKED(_rt) do { \
- if ((_rt)->rt_refcnt <= 1) \
- rtfree(_rt); \
- else { \
- RT_REMREF(_rt); \
- RT_UNLOCK(_rt); \
- } \
- /* guard against invalid refs */ \
- _rt = 0; \
-} while (0)
-
-#define RTFREE(_rt) do { \
- RT_LOCK(_rt); \
- RTFREE_LOCKED(_rt); \
-} while (0)
-
-#define RT_TEMP_UNLOCK(_rt) do { \
- RT_ADDREF(_rt); \
- RT_UNLOCK(_rt); \
-} while (0)
-
-#define RT_RELOCK(_rt) do { \
- RT_LOCK(_rt); \
- if ((_rt)->rt_refcnt <= 1) { \
- rtfree(_rt); \
- _rt = 0; /* signal that it went away */ \
- } else { \
- RT_REMREF(_rt); \
- /* note that _rt is still valid */ \
- } \
-} while (0)
-
-struct radix_node_head *rt_tables_get_rnh(int, int);
-
-struct ifmultiaddr;
-
-void rt_ieee80211msg(struct ifnet *, int, void *, size_t);
-void rt_ifannouncemsg(struct ifnet *, int);
-void rt_ifmsg(struct ifnet *);
-void rt_missmsg(int, struct rt_addrinfo *, int, int);
-void rt_newaddrmsg(int, struct ifaddr *, int, struct rtentry *);
-void rt_newmaddrmsg(int, struct ifmultiaddr *);
-int rt_setgate(struct rtentry *, struct sockaddr *, struct sockaddr *);
-void rt_maskedcopy(struct sockaddr *, struct sockaddr *, struct sockaddr *);
-
-/*
- * Note the following locking behavior:
- *
- * rtalloc_ign() and rtalloc() return ro->ro_rt unlocked
- *
- * rtalloc1() returns a locked rtentry
- *
- * rtfree() and RTFREE_LOCKED() require a locked rtentry
- *
- * RTFREE() uses an unlocked entry.
- */
-
-int rtexpunge(struct rtentry *);
-void rtfree(struct rtentry *);
-int rt_check(struct rtentry **, struct rtentry **, struct sockaddr *);
-
-/* XXX MRT COMPAT VERSIONS THAT SET UNIVERSE to 0 */
-/* Thes are used by old code not yet converted to use multiple FIBS */
-int rt_getifa(struct rt_addrinfo *);
-void rtalloc_ign(struct route *ro, u_long ignflags);
-void rtalloc(struct route *ro); /* XXX deprecated, use rtalloc_ign(ro, 0) */
-struct rtentry *rtalloc1(struct sockaddr *, int, u_long);
-int rtinit(struct ifaddr *, int, int);
-int rtioctl(u_long, caddr_t);
-void rtredirect(struct sockaddr *, struct sockaddr *,
- struct sockaddr *, int, struct sockaddr *);
-int rtrequest(int, struct sockaddr *,
- struct sockaddr *, struct sockaddr *, int, struct rtentry **);
-
-/* defaults to "all" FIBs */
-int rtinit_fib(struct ifaddr *, int, int);
-
-/* XXX MRT NEW VERSIONS THAT USE FIBs
- * For now the protocol indepedent versions are the same as the AF_INET ones
- * but this will change..
- */
-int rt_getifa_fib(struct rt_addrinfo *, u_int fibnum);
-void rtalloc_ign_fib(struct route *ro, u_long ignflags, u_int fibnum);
-void rtalloc_fib(struct route *ro, u_int fibnum);
-struct rtentry *rtalloc1_fib(struct sockaddr *, int, u_long, u_int);
-int rtioctl_fib(u_long, caddr_t, u_int);
-void rtredirect_fib(struct sockaddr *, struct sockaddr *,
- struct sockaddr *, int, struct sockaddr *, u_int);
-int rtrequest_fib(int, struct sockaddr *,
- struct sockaddr *, struct sockaddr *, int, struct rtentry **, u_int);
-int rtrequest1_fib(int, struct rt_addrinfo *, struct rtentry **, u_int);
-
-#include <freebsd/sys/eventhandler.h>
-typedef void (*rtevent_arp_update_fn)(void *, struct rtentry *, uint8_t *, struct sockaddr *);
-typedef void (*rtevent_redirect_fn)(void *, struct rtentry *, struct rtentry *, struct sockaddr *);
-EVENTHANDLER_DECLARE(route_arp_update_event, rtevent_arp_update_fn);
-EVENTHANDLER_DECLARE(route_redirect_event, rtevent_redirect_fn);
-#endif
-
-#endif
diff --git a/freebsd/netatalk/at.h b/freebsd/netatalk/at.h
deleted file mode 100644
index 5b4597a0..00000000
--- a/freebsd/netatalk/at.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*-
- * Copyright (c) 1990,1991 Regents of The University of Michigan.
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appears in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation, and that the name of The University
- * of Michigan not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. This software is supplied as is without expressed or
- * implied warranties of any kind.
- *
- * Research Systems Unix Group
- * The University of Michigan
- * c/o Mike Clark
- * 535 W. William Street
- * Ann Arbor, Michigan
- * +1-313-763-0525
- * netatalk@itd.umich.edu
- *
- * $FreeBSD$
- */
-
-#ifndef _NETATALK_AT_HH_
-#define _NETATALK_AT_HH_
-
-/*
- * Supported protocols
- */
-#define ATPROTO_DDP 0
-#define ATPROTO_AARP 254
-
-#define DDP_MAXSZ 587
-
-/*
- * If ATPORT_FIRST <= Port < ATPORT_RESERVED, the port was created by a
- * privileged process.
- *
- * If ATPORT_RESERVED <= Port < ATPORT_LAST, the port was not necessarily
- * created by a privileged process.
- */
-#define ATPORT_FIRST 1
-#define ATPORT_RESERVED 128
-#define ATPORT_LAST 255
-
-/*
- * AppleTalk address.
- */
-struct at_addr {
- u_short s_net;
- u_char s_node;
-};
-
-#define ATADDR_ANYNET (u_short)0x0000
-#define ATADDR_ANYNODE (u_char)0x00
-#define ATADDR_ANYPORT (u_char)0x00
-#define ATADDR_BCAST (u_char)0xff /* There is no BCAST for NET. */
-
-struct netrange {
- u_char nr_phase;
- u_short nr_firstnet;
- u_short nr_lastnet;
-};
-
-/*
- * Socket address, AppleTalk style. We keep magic information in the zero
- * bytes. There are three types, NONE, CONFIG which has the phase and a net
- * range, and IFACE which has the network address of an interface. IFACE may
- * be filled in by the client, and is filled in by the kernel.
- */
-struct sockaddr_at {
- u_char sat_len;
- u_char sat_family;
- u_char sat_port;
- struct at_addr sat_addr;
- union {
- struct netrange r_netrange;
- char r_zero[8]; /* Hide struct netrange here. */
- } sat_range;
-};
-
-#define sat_zero sat_range.r_zero
-
-#endif /* !_NETATALK_AT_HH_ */
diff --git a/freebsd/netinet/icmp6.h b/freebsd/netinet/icmp6.h
deleted file mode 100644
index f2f0577e..00000000
--- a/freebsd/netinet/icmp6.h
+++ /dev/null
@@ -1,741 +0,0 @@
-/* $FreeBSD$ */
-/* $KAME: icmp6.h,v 1.46 2001/04/27 15:09:48 itojun Exp $ */
-
-/*-
- * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*-
- * Copyright (c) 1982, 1986, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93
- */
-
-#ifndef _NETINET_ICMP6_HH_
-#define _NETINET_ICMP6_HH_
-
-#define ICMPV6_PLD_MAXLEN 1232 /* IPV6_MMTU - sizeof(struct ip6_hdr)
- - sizeof(struct icmp6_hdr) */
-
-struct icmp6_hdr {
- u_int8_t icmp6_type; /* type field */
- u_int8_t icmp6_code; /* code field */
- u_int16_t icmp6_cksum; /* checksum field */
- union {
- u_int32_t icmp6_un_data32[1]; /* type-specific field */
- u_int16_t icmp6_un_data16[2]; /* type-specific field */
- u_int8_t icmp6_un_data8[4]; /* type-specific field */
- } icmp6_dataun;
-} __packed;
-
-#define icmp6_data32 icmp6_dataun.icmp6_un_data32
-#define icmp6_data16 icmp6_dataun.icmp6_un_data16
-#define icmp6_data8 icmp6_dataun.icmp6_un_data8
-#define icmp6_pptr icmp6_data32[0] /* parameter prob */
-#define icmp6_mtu icmp6_data32[0] /* packet too big */
-#define icmp6_id icmp6_data16[0] /* echo request/reply */
-#define icmp6_seq icmp6_data16[1] /* echo request/reply */
-#define icmp6_maxdelay icmp6_data16[0] /* mcast group membership */
-
-#define ICMP6_DST_UNREACH 1 /* dest unreachable, codes: */
-#define ICMP6_PACKET_TOO_BIG 2 /* packet too big */
-#define ICMP6_TIME_EXCEEDED 3 /* time exceeded, code: */
-#define ICMP6_PARAM_PROB 4 /* ip6 header bad */
-
-#define ICMP6_ECHO_REQUEST 128 /* echo service */
-#define ICMP6_ECHO_REPLY 129 /* echo reply */
-#define MLD_LISTENER_QUERY 130 /* multicast listener query */
-#define MLD_LISTENER_REPORT 131 /* multicast listener report */
-#define MLD_LISTENER_DONE 132 /* multicast listener done */
-#define MLD_LISTENER_REDUCTION MLD_LISTENER_DONE /* RFC3542 definition */
-
-/* RFC2292 decls */
-#define ICMP6_MEMBERSHIP_QUERY 130 /* group membership query */
-#define ICMP6_MEMBERSHIP_REPORT 131 /* group membership report */
-#define ICMP6_MEMBERSHIP_REDUCTION 132 /* group membership termination */
-
-#ifndef _KERNEL
-/* the followings are for backward compatibility to old KAME apps. */
-#define MLD6_LISTENER_QUERY MLD_LISTENER_QUERY
-#define MLD6_LISTENER_REPORT MLD_LISTENER_REPORT
-#define MLD6_LISTENER_DONE MLD_LISTENER_DONE
-#endif
-
-#define ND_ROUTER_SOLICIT 133 /* router solicitation */
-#define ND_ROUTER_ADVERT 134 /* router advertisement */
-#define ND_NEIGHBOR_SOLICIT 135 /* neighbor solicitation */
-#define ND_NEIGHBOR_ADVERT 136 /* neighbor advertisement */
-#define ND_REDIRECT 137 /* redirect */
-
-#define ICMP6_ROUTER_RENUMBERING 138 /* router renumbering */
-
-#define ICMP6_WRUREQUEST 139 /* who are you request */
-#define ICMP6_WRUREPLY 140 /* who are you reply */
-#define ICMP6_FQDN_QUERY 139 /* FQDN query */
-#define ICMP6_FQDN_REPLY 140 /* FQDN reply */
-#define ICMP6_NI_QUERY 139 /* node information request */
-#define ICMP6_NI_REPLY 140 /* node information reply */
-#define MLDV2_LISTENER_REPORT 143 /* RFC3810 listener report */
-
-/* The definitions below are experimental. TBA */
-#define MLD_MTRACE_RESP 200 /* mtrace resp (to sender) */
-#define MLD_MTRACE 201 /* mtrace messages */
-
-#ifndef _KERNEL
-#define MLD6_MTRACE_RESP MLD_MTRACE_RESP
-#define MLD6_MTRACE MLD_MTRACE
-#endif
-
-#define ICMP6_MAXTYPE 201
-
-#define ICMP6_DST_UNREACH_NOROUTE 0 /* no route to destination */
-#define ICMP6_DST_UNREACH_ADMIN 1 /* administratively prohibited */
-#define ICMP6_DST_UNREACH_NOTNEIGHBOR 2 /* not a neighbor(obsolete) */
-#define ICMP6_DST_UNREACH_BEYONDSCOPE 2 /* beyond scope of source address */
-#define ICMP6_DST_UNREACH_ADDR 3 /* address unreachable */
-#define ICMP6_DST_UNREACH_NOPORT 4 /* port unreachable */
-
-#define ICMP6_TIME_EXCEED_TRANSIT 0 /* ttl==0 in transit */
-#define ICMP6_TIME_EXCEED_REASSEMBLY 1 /* ttl==0 in reass */
-
-#define ICMP6_PARAMPROB_HEADER 0 /* erroneous header field */
-#define ICMP6_PARAMPROB_NEXTHEADER 1 /* unrecognized next header */
-#define ICMP6_PARAMPROB_OPTION 2 /* unrecognized option */
-
-#define ICMP6_INFOMSG_MASK 0x80 /* all informational messages */
-
-#define ICMP6_NI_SUBJ_IPV6 0 /* Query Subject is an IPv6 address */
-#define ICMP6_NI_SUBJ_FQDN 1 /* Query Subject is a Domain name */
-#define ICMP6_NI_SUBJ_IPV4 2 /* Query Subject is an IPv4 address */
-
-#define ICMP6_NI_SUCCESS 0 /* node information successful reply */
-#define ICMP6_NI_REFUSED 1 /* node information request is refused */
-#define ICMP6_NI_UNKNOWN 2 /* unknown Qtype */
-
-#define ICMP6_ROUTER_RENUMBERING_COMMAND 0 /* rr command */
-#define ICMP6_ROUTER_RENUMBERING_RESULT 1 /* rr result */
-#define ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET 255 /* rr seq num reset */
-
-/* Used in kernel only */
-#define ND_REDIRECT_ONLINK 0 /* redirect to an on-link node */
-#define ND_REDIRECT_ROUTER 1 /* redirect to a better router */
-
-/*
- * Multicast Listener Discovery
- */
-struct mld_hdr {
- struct icmp6_hdr mld_icmp6_hdr;
- struct in6_addr mld_addr; /* multicast address */
-} __packed;
-
-/* definitions to provide backward compatibility to old KAME applications */
-#ifndef _KERNEL
-#define mld6_hdr mld_hdr
-#define mld6_type mld_type
-#define mld6_code mld_code
-#define mld6_cksum mld_cksum
-#define mld6_maxdelay mld_maxdelay
-#define mld6_reserved mld_reserved
-#define mld6_addr mld_addr
-#endif
-
-/* shortcut macro definitions */
-#define mld_type mld_icmp6_hdr.icmp6_type
-#define mld_code mld_icmp6_hdr.icmp6_code
-#define mld_cksum mld_icmp6_hdr.icmp6_cksum
-#define mld_maxdelay mld_icmp6_hdr.icmp6_data16[0]
-#define mld_reserved mld_icmp6_hdr.icmp6_data16[1]
-#define mld_v2_reserved mld_icmp6_hdr.icmp6_data16[0]
-#define mld_v2_numrecs mld_icmp6_hdr.icmp6_data16[1]
-
-/*
- * Neighbor Discovery
- */
-
-struct nd_router_solicit { /* router solicitation */
- struct icmp6_hdr nd_rs_hdr;
- /* could be followed by options */
-} __packed;
-
-#define nd_rs_type nd_rs_hdr.icmp6_type
-#define nd_rs_code nd_rs_hdr.icmp6_code
-#define nd_rs_cksum nd_rs_hdr.icmp6_cksum
-#define nd_rs_reserved nd_rs_hdr.icmp6_data32[0]
-
-struct nd_router_advert { /* router advertisement */
- struct icmp6_hdr nd_ra_hdr;
- u_int32_t nd_ra_reachable; /* reachable time */
- u_int32_t nd_ra_retransmit; /* retransmit timer */
- /* could be followed by options */
-} __packed;
-
-#define nd_ra_type nd_ra_hdr.icmp6_type
-#define nd_ra_code nd_ra_hdr.icmp6_code
-#define nd_ra_cksum nd_ra_hdr.icmp6_cksum
-#define nd_ra_curhoplimit nd_ra_hdr.icmp6_data8[0]
-#define nd_ra_flags_reserved nd_ra_hdr.icmp6_data8[1]
-#define ND_RA_FLAG_MANAGED 0x80
-#define ND_RA_FLAG_OTHER 0x40
-#define ND_RA_FLAG_HA 0x20
-
-/*
- * Router preference values based on draft-draves-ipngwg-router-selection-01.
- * These are non-standard definitions.
- */
-#define ND_RA_FLAG_RTPREF_MASK 0x18 /* 00011000 */
-
-#define ND_RA_FLAG_RTPREF_HIGH 0x08 /* 00001000 */
-#define ND_RA_FLAG_RTPREF_MEDIUM 0x00 /* 00000000 */
-#define ND_RA_FLAG_RTPREF_LOW 0x18 /* 00011000 */
-#define ND_RA_FLAG_RTPREF_RSV 0x10 /* 00010000 */
-
-#define nd_ra_router_lifetime nd_ra_hdr.icmp6_data16[1]
-
-struct nd_neighbor_solicit { /* neighbor solicitation */
- struct icmp6_hdr nd_ns_hdr;
- struct in6_addr nd_ns_target; /*target address */
- /* could be followed by options */
-} __packed;
-
-#define nd_ns_type nd_ns_hdr.icmp6_type
-#define nd_ns_code nd_ns_hdr.icmp6_code
-#define nd_ns_cksum nd_ns_hdr.icmp6_cksum
-#define nd_ns_reserved nd_ns_hdr.icmp6_data32[0]
-
-struct nd_neighbor_advert { /* neighbor advertisement */
- struct icmp6_hdr nd_na_hdr;
- struct in6_addr nd_na_target; /* target address */
- /* could be followed by options */
-} __packed;
-
-#define nd_na_type nd_na_hdr.icmp6_type
-#define nd_na_code nd_na_hdr.icmp6_code
-#define nd_na_cksum nd_na_hdr.icmp6_cksum
-#define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0]
-#if BYTE_ORDER == BIG_ENDIAN
-#define ND_NA_FLAG_ROUTER 0x80000000
-#define ND_NA_FLAG_SOLICITED 0x40000000
-#define ND_NA_FLAG_OVERRIDE 0x20000000
-#else
-#if BYTE_ORDER == LITTLE_ENDIAN
-#define ND_NA_FLAG_ROUTER 0x80
-#define ND_NA_FLAG_SOLICITED 0x40
-#define ND_NA_FLAG_OVERRIDE 0x20
-#endif
-#endif
-
-struct nd_redirect { /* redirect */
- struct icmp6_hdr nd_rd_hdr;
- struct in6_addr nd_rd_target; /* target address */
- struct in6_addr nd_rd_dst; /* destination address */
- /* could be followed by options */
-} __packed;
-
-#define nd_rd_type nd_rd_hdr.icmp6_type
-#define nd_rd_code nd_rd_hdr.icmp6_code
-#define nd_rd_cksum nd_rd_hdr.icmp6_cksum
-#define nd_rd_reserved nd_rd_hdr.icmp6_data32[0]
-
-struct nd_opt_hdr { /* Neighbor discovery option header */
- u_int8_t nd_opt_type;
- u_int8_t nd_opt_len;
- /* followed by option specific data*/
-} __packed;
-
-#define ND_OPT_SOURCE_LINKADDR 1
-#define ND_OPT_TARGET_LINKADDR 2
-#define ND_OPT_PREFIX_INFORMATION 3
-#define ND_OPT_REDIRECTED_HEADER 4
-#define ND_OPT_MTU 5
-
-#define ND_OPT_ROUTE_INFO 200 /* draft-ietf-ipngwg-router-preference, not officially assigned yet */
-
-struct nd_opt_prefix_info { /* prefix information */
- u_int8_t nd_opt_pi_type;
- u_int8_t nd_opt_pi_len;
- u_int8_t nd_opt_pi_prefix_len;
- u_int8_t nd_opt_pi_flags_reserved;
- u_int32_t nd_opt_pi_valid_time;
- u_int32_t nd_opt_pi_preferred_time;
- u_int32_t nd_opt_pi_reserved2;
- struct in6_addr nd_opt_pi_prefix;
-} __packed;
-
-#define ND_OPT_PI_FLAG_ONLINK 0x80
-#define ND_OPT_PI_FLAG_AUTO 0x40
-
-struct nd_opt_rd_hdr { /* redirected header */
- u_int8_t nd_opt_rh_type;
- u_int8_t nd_opt_rh_len;
- u_int16_t nd_opt_rh_reserved1;
- u_int32_t nd_opt_rh_reserved2;
- /* followed by IP header and data */
-} __packed;
-
-struct nd_opt_mtu { /* MTU option */
- u_int8_t nd_opt_mtu_type;
- u_int8_t nd_opt_mtu_len;
- u_int16_t nd_opt_mtu_reserved;
- u_int32_t nd_opt_mtu_mtu;
-} __packed;
-
-struct nd_opt_route_info { /* route info */
- u_int8_t nd_opt_rti_type;
- u_int8_t nd_opt_rti_len;
- u_int8_t nd_opt_rti_prefixlen;
- u_int8_t nd_opt_rti_flags;
- u_int32_t nd_opt_rti_lifetime;
- /* prefix follows */
-} __packed;
-
-/*
- * icmp6 namelookup
- */
-
-struct icmp6_namelookup {
- struct icmp6_hdr icmp6_nl_hdr;
- u_int8_t icmp6_nl_nonce[8];
- int32_t icmp6_nl_ttl;
-#if 0
- u_int8_t icmp6_nl_len;
- u_int8_t icmp6_nl_name[3];
-#endif
- /* could be followed by options */
-} __packed;
-
-/*
- * icmp6 node information
- */
-struct icmp6_nodeinfo {
- struct icmp6_hdr icmp6_ni_hdr;
- u_int8_t icmp6_ni_nonce[8];
- /* could be followed by reply data */
-} __packed;
-
-#define ni_type icmp6_ni_hdr.icmp6_type
-#define ni_code icmp6_ni_hdr.icmp6_code
-#define ni_cksum icmp6_ni_hdr.icmp6_cksum
-#define ni_qtype icmp6_ni_hdr.icmp6_data16[0]
-#define ni_flags icmp6_ni_hdr.icmp6_data16[1]
-
-#define NI_QTYPE_NOOP 0 /* NOOP */
-#define NI_QTYPE_SUPTYPES 1 /* Supported Qtypes */
-#define NI_QTYPE_FQDN 2 /* FQDN (draft 04) */
-#define NI_QTYPE_DNSNAME 2 /* DNS Name */
-#define NI_QTYPE_NODEADDR 3 /* Node Addresses */
-#define NI_QTYPE_IPV4ADDR 4 /* IPv4 Addresses */
-
-#if BYTE_ORDER == BIG_ENDIAN
-#define NI_SUPTYPE_FLAG_COMPRESS 0x1
-#define NI_FQDN_FLAG_VALIDTTL 0x1
-#elif BYTE_ORDER == LITTLE_ENDIAN
-#define NI_SUPTYPE_FLAG_COMPRESS 0x0100
-#define NI_FQDN_FLAG_VALIDTTL 0x0100
-#endif
-
-#ifdef NAME_LOOKUPS_04
-#if BYTE_ORDER == BIG_ENDIAN
-#define NI_NODEADDR_FLAG_LINKLOCAL 0x1
-#define NI_NODEADDR_FLAG_SITELOCAL 0x2
-#define NI_NODEADDR_FLAG_GLOBAL 0x4
-#define NI_NODEADDR_FLAG_ALL 0x8
-#define NI_NODEADDR_FLAG_TRUNCATE 0x10
-#define NI_NODEADDR_FLAG_ANYCAST 0x20 /* just experimental. not in spec */
-#elif BYTE_ORDER == LITTLE_ENDIAN
-#define NI_NODEADDR_FLAG_LINKLOCAL 0x0100
-#define NI_NODEADDR_FLAG_SITELOCAL 0x0200
-#define NI_NODEADDR_FLAG_GLOBAL 0x0400
-#define NI_NODEADDR_FLAG_ALL 0x0800
-#define NI_NODEADDR_FLAG_TRUNCATE 0x1000
-#define NI_NODEADDR_FLAG_ANYCAST 0x2000 /* just experimental. not in spec */
-#endif
-#else /* draft-ietf-ipngwg-icmp-name-lookups-05 (and later?) */
-#if BYTE_ORDER == BIG_ENDIAN
-#define NI_NODEADDR_FLAG_TRUNCATE 0x1
-#define NI_NODEADDR_FLAG_ALL 0x2
-#define NI_NODEADDR_FLAG_COMPAT 0x4
-#define NI_NODEADDR_FLAG_LINKLOCAL 0x8
-#define NI_NODEADDR_FLAG_SITELOCAL 0x10
-#define NI_NODEADDR_FLAG_GLOBAL 0x20
-#define NI_NODEADDR_FLAG_ANYCAST 0x40 /* just experimental. not in spec */
-#elif BYTE_ORDER == LITTLE_ENDIAN
-#define NI_NODEADDR_FLAG_TRUNCATE 0x0100
-#define NI_NODEADDR_FLAG_ALL 0x0200
-#define NI_NODEADDR_FLAG_COMPAT 0x0400
-#define NI_NODEADDR_FLAG_LINKLOCAL 0x0800
-#define NI_NODEADDR_FLAG_SITELOCAL 0x1000
-#define NI_NODEADDR_FLAG_GLOBAL 0x2000
-#define NI_NODEADDR_FLAG_ANYCAST 0x4000 /* just experimental. not in spec */
-#endif
-#endif
-
-struct ni_reply_fqdn {
- u_int32_t ni_fqdn_ttl; /* TTL */
- u_int8_t ni_fqdn_namelen; /* length in octets of the FQDN */
- u_int8_t ni_fqdn_name[3]; /* XXX: alignment */
-} __packed;
-
-/*
- * Router Renumbering. as router-renum-08.txt
- */
-struct icmp6_router_renum { /* router renumbering header */
- struct icmp6_hdr rr_hdr;
- u_int8_t rr_segnum;
- u_int8_t rr_flags;
- u_int16_t rr_maxdelay;
- u_int32_t rr_reserved;
-} __packed;
-
-#define ICMP6_RR_FLAGS_TEST 0x80
-#define ICMP6_RR_FLAGS_REQRESULT 0x40
-#define ICMP6_RR_FLAGS_FORCEAPPLY 0x20
-#define ICMP6_RR_FLAGS_SPECSITE 0x10
-#define ICMP6_RR_FLAGS_PREVDONE 0x08
-
-#define rr_type rr_hdr.icmp6_type
-#define rr_code rr_hdr.icmp6_code
-#define rr_cksum rr_hdr.icmp6_cksum
-#define rr_seqnum rr_hdr.icmp6_data32[0]
-
-struct rr_pco_match { /* match prefix part */
- u_int8_t rpm_code;
- u_int8_t rpm_len;
- u_int8_t rpm_ordinal;
- u_int8_t rpm_matchlen;
- u_int8_t rpm_minlen;
- u_int8_t rpm_maxlen;
- u_int16_t rpm_reserved;
- struct in6_addr rpm_prefix;
-} __packed;
-
-#define RPM_PCO_ADD 1
-#define RPM_PCO_CHANGE 2
-#define RPM_PCO_SETGLOBAL 3
-#define RPM_PCO_MAX 4
-
-struct rr_pco_use { /* use prefix part */
- u_int8_t rpu_uselen;
- u_int8_t rpu_keeplen;
- u_int8_t rpu_ramask;
- u_int8_t rpu_raflags;
- u_int32_t rpu_vltime;
- u_int32_t rpu_pltime;
- u_int32_t rpu_flags;
- struct in6_addr rpu_prefix;
-} __packed;
-#define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x80
-#define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x40
-
-#if BYTE_ORDER == BIG_ENDIAN
-#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80000000
-#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40000000
-#elif BYTE_ORDER == LITTLE_ENDIAN
-#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80
-#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40
-#endif
-
-struct rr_result { /* router renumbering result message */
- u_int16_t rrr_flags;
- u_int8_t rrr_ordinal;
- u_int8_t rrr_matchedlen;
- u_int32_t rrr_ifid;
- struct in6_addr rrr_prefix;
-} __packed;
-#if BYTE_ORDER == BIG_ENDIAN
-#define ICMP6_RR_RESULT_FLAGS_OOB 0x0002
-#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0001
-#elif BYTE_ORDER == LITTLE_ENDIAN
-#define ICMP6_RR_RESULT_FLAGS_OOB 0x0200
-#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0100
-#endif
-
-/*
- * icmp6 filter structures.
- */
-
-struct icmp6_filter {
- u_int32_t icmp6_filt[8];
-};
-
-#ifdef _KERNEL
-#define ICMP6_FILTER_SETPASSALL(filterp) \
-do { \
- int i; u_char *p; \
- p = (u_char *)filterp; \
- for (i = 0; i < sizeof(struct icmp6_filter); i++) \
- p[i] = 0xff; \
-} while (/*CONSTCOND*/ 0)
-#define ICMP6_FILTER_SETBLOCKALL(filterp) \
- bzero(filterp, sizeof(struct icmp6_filter))
-#else /* _KERNEL */
-#define ICMP6_FILTER_SETPASSALL(filterp) \
- memset(filterp, 0xff, sizeof(struct icmp6_filter))
-#define ICMP6_FILTER_SETBLOCKALL(filterp) \
- memset(filterp, 0x00, sizeof(struct icmp6_filter))
-#endif /* _KERNEL */
-
-#define ICMP6_FILTER_SETPASS(type, filterp) \
- (((filterp)->icmp6_filt[(type) >> 5]) |= (1 << ((type) & 31)))
-#define ICMP6_FILTER_SETBLOCK(type, filterp) \
- (((filterp)->icmp6_filt[(type) >> 5]) &= ~(1 << ((type) & 31)))
-#define ICMP6_FILTER_WILLPASS(type, filterp) \
- ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) != 0)
-#define ICMP6_FILTER_WILLBLOCK(type, filterp) \
- ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) == 0)
-
-/*
- * Variables related to this implementation
- * of the internet control message protocol version 6.
- */
-struct icmp6errstat {
- u_quad_t icp6errs_dst_unreach_noroute;
- u_quad_t icp6errs_dst_unreach_admin;
- u_quad_t icp6errs_dst_unreach_beyondscope;
- u_quad_t icp6errs_dst_unreach_addr;
- u_quad_t icp6errs_dst_unreach_noport;
- u_quad_t icp6errs_packet_too_big;
- u_quad_t icp6errs_time_exceed_transit;
- u_quad_t icp6errs_time_exceed_reassembly;
- u_quad_t icp6errs_paramprob_header;
- u_quad_t icp6errs_paramprob_nextheader;
- u_quad_t icp6errs_paramprob_option;
- u_quad_t icp6errs_redirect; /* we regard redirect as an error here */
- u_quad_t icp6errs_unknown;
-};
-
-struct icmp6stat {
-/* statistics related to icmp6 packets generated */
- u_quad_t icp6s_error; /* # of calls to icmp6_error */
- u_quad_t icp6s_canterror; /* no error 'cuz old was icmp */
- u_quad_t icp6s_toofreq; /* no error 'cuz rate limitation */
- u_quad_t icp6s_outhist[256];
-/* statistics related to input message processed */
- u_quad_t icp6s_badcode; /* icmp6_code out of range */
- u_quad_t icp6s_tooshort; /* packet < sizeof(struct icmp6_hdr) */
- u_quad_t icp6s_checksum; /* bad checksum */
- u_quad_t icp6s_badlen; /* calculated bound mismatch */
- /*
- * number of responses: this member is inherited from netinet code, but
- * for netinet6 code, it is already available in icp6s_outhist[].
- */
- u_quad_t icp6s_reflect;
- u_quad_t icp6s_inhist[256];
- u_quad_t icp6s_nd_toomanyopt; /* too many ND options */
- struct icmp6errstat icp6s_outerrhist;
-#define icp6s_odst_unreach_noroute \
- icp6s_outerrhist.icp6errs_dst_unreach_noroute
-#define icp6s_odst_unreach_admin icp6s_outerrhist.icp6errs_dst_unreach_admin
-#define icp6s_odst_unreach_beyondscope \
- icp6s_outerrhist.icp6errs_dst_unreach_beyondscope
-#define icp6s_odst_unreach_addr icp6s_outerrhist.icp6errs_dst_unreach_addr
-#define icp6s_odst_unreach_noport icp6s_outerrhist.icp6errs_dst_unreach_noport
-#define icp6s_opacket_too_big icp6s_outerrhist.icp6errs_packet_too_big
-#define icp6s_otime_exceed_transit \
- icp6s_outerrhist.icp6errs_time_exceed_transit
-#define icp6s_otime_exceed_reassembly \
- icp6s_outerrhist.icp6errs_time_exceed_reassembly
-#define icp6s_oparamprob_header icp6s_outerrhist.icp6errs_paramprob_header
-#define icp6s_oparamprob_nextheader \
- icp6s_outerrhist.icp6errs_paramprob_nextheader
-#define icp6s_oparamprob_option icp6s_outerrhist.icp6errs_paramprob_option
-#define icp6s_oredirect icp6s_outerrhist.icp6errs_redirect
-#define icp6s_ounknown icp6s_outerrhist.icp6errs_unknown
- u_quad_t icp6s_pmtuchg; /* path MTU changes */
- u_quad_t icp6s_nd_badopt; /* bad ND options */
- u_quad_t icp6s_badns; /* bad neighbor solicitation */
- u_quad_t icp6s_badna; /* bad neighbor advertisement */
- u_quad_t icp6s_badrs; /* bad router advertisement */
- u_quad_t icp6s_badra; /* bad router advertisement */
- u_quad_t icp6s_badredirect; /* bad redirect message */
-};
-
-#ifdef _KERNEL
-/*
- * In-kernel consumers can use these accessor macros directly to update
- * stats.
- */
-#define ICMP6STAT_ADD(name, val) V_icmp6stat.name += (val)
-#define ICMP6STAT_INC(name) ICMP6STAT_ADD(name, 1)
-
-/*
- * Kernel module consumers must use this accessor macro.
- */
-void kmod_icmp6stat_inc(int statnum);
-#define KMOD_ICMP6STAT_INC(name) \
- kmod_icmp6stat_inc(offsetof(struct icmp6stat, name) / sizeof(u_quad_t))
-#endif
-
-/*
- * Names for ICMP sysctl objects
- */
-#define ICMPV6CTL_STATS 1
-#define ICMPV6CTL_REDIRACCEPT 2 /* accept/process redirects */
-#define ICMPV6CTL_REDIRTIMEOUT 3 /* redirect cache time */
-#if 0 /*obsoleted*/
-#define ICMPV6CTL_ERRRATELIMIT 5 /* ICMPv6 error rate limitation */
-#endif
-#define ICMPV6CTL_ND6_PRUNE 6
-#define ICMPV6CTL_ND6_DELAY 8
-#define ICMPV6CTL_ND6_UMAXTRIES 9
-#define ICMPV6CTL_ND6_MMAXTRIES 10
-#define ICMPV6CTL_ND6_USELOOPBACK 11
-/*#define ICMPV6CTL_ND6_PROXYALL 12 obsoleted, do not reuse here */
-#define ICMPV6CTL_NODEINFO 13
-#define ICMPV6CTL_ERRPPSLIMIT 14 /* ICMPv6 error pps limitation */
-#define ICMPV6CTL_ND6_MAXNUDHINT 15
-#define ICMPV6CTL_MTUDISC_HIWAT 16
-#define ICMPV6CTL_MTUDISC_LOWAT 17
-#define ICMPV6CTL_ND6_DEBUG 18
-#define ICMPV6CTL_ND6_DRLIST 19
-#define ICMPV6CTL_ND6_PRLIST 20
-#define ICMPV6CTL_MLD_MAXSRCFILTER 21
-#define ICMPV6CTL_MLD_SOMAXSRC 22
-#define ICMPV6CTL_MLD_VERSION 23
-#define ICMPV6CTL_ND6_MAXQLEN 24
-#define ICMPV6CTL_MAXID 25
-
-#define RTF_PROBEMTU RTF_PROTO1
-
-#ifdef _KERNEL
-# ifdef __STDC__
-struct rtentry;
-struct rttimer;
-struct in6_multi;
-# endif
-void icmp6_paramerror(struct mbuf *, int);
-void icmp6_error(struct mbuf *, int, int, int);
-void icmp6_error2(struct mbuf *, int, int, int, struct ifnet *);
-int icmp6_input(struct mbuf **, int *, int);
-void icmp6_fasttimo(void);
-void icmp6_slowtimo(void);
-void icmp6_reflect(struct mbuf *, size_t);
-void icmp6_prepare(struct mbuf *);
-void icmp6_redirect_input(struct mbuf *, int);
-void icmp6_redirect_output(struct mbuf *, struct rtentry *);
-
-struct ip6ctlparam;
-void icmp6_mtudisc_update(struct ip6ctlparam *, int);
-
-/* XXX: is this the right place for these macros? */
-#define icmp6_ifstat_inc(ifp, tag) \
-do { \
- if (ifp) \
- ((struct in6_ifextra *)((ifp)->if_afdata[AF_INET6]))->icmp6_ifstat->tag++; \
-} while (/*CONSTCOND*/ 0)
-
-#define icmp6_ifoutstat_inc(ifp, type, code) \
-do { \
- icmp6_ifstat_inc(ifp, ifs6_out_msg); \
- if (type < ICMP6_INFOMSG_MASK) \
- icmp6_ifstat_inc(ifp, ifs6_out_error); \
- switch (type) { \
- case ICMP6_DST_UNREACH: \
- icmp6_ifstat_inc(ifp, ifs6_out_dstunreach); \
- if (code == ICMP6_DST_UNREACH_ADMIN) \
- icmp6_ifstat_inc(ifp, ifs6_out_adminprohib); \
- break; \
- case ICMP6_PACKET_TOO_BIG: \
- icmp6_ifstat_inc(ifp, ifs6_out_pkttoobig); \
- break; \
- case ICMP6_TIME_EXCEEDED: \
- icmp6_ifstat_inc(ifp, ifs6_out_timeexceed); \
- break; \
- case ICMP6_PARAM_PROB: \
- icmp6_ifstat_inc(ifp, ifs6_out_paramprob); \
- break; \
- case ICMP6_ECHO_REQUEST: \
- icmp6_ifstat_inc(ifp, ifs6_out_echo); \
- break; \
- case ICMP6_ECHO_REPLY: \
- icmp6_ifstat_inc(ifp, ifs6_out_echoreply); \
- break; \
- case MLD_LISTENER_QUERY: \
- icmp6_ifstat_inc(ifp, ifs6_out_mldquery); \
- break; \
- case MLD_LISTENER_REPORT: \
- icmp6_ifstat_inc(ifp, ifs6_out_mldreport); \
- break; \
- case MLD_LISTENER_DONE: \
- icmp6_ifstat_inc(ifp, ifs6_out_mlddone); \
- break; \
- case ND_ROUTER_SOLICIT: \
- icmp6_ifstat_inc(ifp, ifs6_out_routersolicit); \
- break; \
- case ND_ROUTER_ADVERT: \
- icmp6_ifstat_inc(ifp, ifs6_out_routeradvert); \
- break; \
- case ND_NEIGHBOR_SOLICIT: \
- icmp6_ifstat_inc(ifp, ifs6_out_neighborsolicit); \
- break; \
- case ND_NEIGHBOR_ADVERT: \
- icmp6_ifstat_inc(ifp, ifs6_out_neighboradvert); \
- break; \
- case ND_REDIRECT: \
- icmp6_ifstat_inc(ifp, ifs6_out_redirect); \
- break; \
- } \
-} while (/*CONSTCOND*/ 0)
-
-VNET_DECLARE(int, icmp6_rediraccept); /* accept/process redirects */
-VNET_DECLARE(int, icmp6_redirtimeout); /* cache time for redirect routes */
-
-#define V_icmp6_rediraccept VNET(icmp6_rediraccept)
-#define V_icmp6_redirtimeout VNET(icmp6_redirtimeout)
-
-#define ICMP6_NODEINFO_FQDNOK 0x1
-#define ICMP6_NODEINFO_NODEADDROK 0x2
-#define ICMP6_NODEINFO_TMPADDROK 0x4
-#define ICMP6_NODEINFO_GLOBALOK 0x8
-#endif /* _KERNEL */
-
-#endif /* not _NETINET_ICMP6_HH_ */
diff --git a/freebsd/netinet/if_ether.h b/freebsd/netinet/if_ether.h
deleted file mode 100644
index 0e9b2aa9..00000000
--- a/freebsd/netinet/if_ether.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)if_ether.h 8.3 (Berkeley) 5/2/95
- * $FreeBSD$
- */
-
-#ifndef _NETINET_IF_ETHER_HH_
-#define _NETINET_IF_ETHER_HH_
-
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if_arp.h>
-
-/*
- * Macro to map an IP multicast address to an Ethernet multicast address.
- * The high-order 25 bits of the Ethernet address are statically assigned,
- * and the low-order 23 bits are taken from the low end of the IP address.
- */
-#define ETHER_MAP_IP_MULTICAST(ipaddr, enaddr) \
- /* struct in_addr *ipaddr; */ \
- /* u_char enaddr[ETHER_ADDR_LEN]; */ \
-{ \
- (enaddr)[0] = 0x01; \
- (enaddr)[1] = 0x00; \
- (enaddr)[2] = 0x5e; \
- (enaddr)[3] = ((u_char *)ipaddr)[1] & 0x7f; \
- (enaddr)[4] = ((u_char *)ipaddr)[2]; \
- (enaddr)[5] = ((u_char *)ipaddr)[3]; \
-}
-/*
- * Macro to map an IP6 multicast address to an Ethernet multicast address.
- * The high-order 16 bits of the Ethernet address are statically assigned,
- * and the low-order 32 bits are taken from the low end of the IP6 address.
- */
-#define ETHER_MAP_IPV6_MULTICAST(ip6addr, enaddr) \
-/* struct in6_addr *ip6addr; */ \
-/* u_char enaddr[ETHER_ADDR_LEN]; */ \
-{ \
- (enaddr)[0] = 0x33; \
- (enaddr)[1] = 0x33; \
- (enaddr)[2] = ((u_char *)ip6addr)[12]; \
- (enaddr)[3] = ((u_char *)ip6addr)[13]; \
- (enaddr)[4] = ((u_char *)ip6addr)[14]; \
- (enaddr)[5] = ((u_char *)ip6addr)[15]; \
-}
-
-/*
- * Ethernet Address Resolution Protocol.
- *
- * See RFC 826 for protocol description. Structure below is adapted
- * to resolving internet addresses. Field names used correspond to
- * RFC 826.
- */
-struct ether_arp {
- struct arphdr ea_hdr; /* fixed-size header */
- u_char arp_sha[ETHER_ADDR_LEN]; /* sender hardware address */
- u_char arp_spa[4]; /* sender protocol address */
- u_char arp_tha[ETHER_ADDR_LEN]; /* target hardware address */
- u_char arp_tpa[4]; /* target protocol address */
-};
-#define arp_hrd ea_hdr.ar_hrd
-#define arp_pro ea_hdr.ar_pro
-#define arp_hln ea_hdr.ar_hln
-#define arp_pln ea_hdr.ar_pln
-#define arp_op ea_hdr.ar_op
-
-struct sockaddr_inarp {
- u_char sin_len;
- u_char sin_family;
- u_short sin_port;
- struct in_addr sin_addr;
- struct in_addr sin_srcaddr;
- u_short sin_tos;
- u_short sin_other;
-#define SIN_PROXY 1
-};
-/*
- * IP and ethernet specific routing flags
- */
-#define RTF_USETRAILERS RTF_PROTO1 /* use trailers */
-#define RTF_ANNOUNCE RTF_PROTO2 /* announce new arp entry */
-
-#ifdef _KERNEL
-extern u_char ether_ipmulticast_min[ETHER_ADDR_LEN];
-extern u_char ether_ipmulticast_max[ETHER_ADDR_LEN];
-
-struct llentry;
-struct ifaddr;
-
-int arpresolve(struct ifnet *ifp, struct rtentry *rt,
- struct mbuf *m, struct sockaddr *dst, u_char *desten,
- struct llentry **lle);
-void arp_ifinit(struct ifnet *, struct ifaddr *);
-void arp_ifinit2(struct ifnet *, struct ifaddr *, u_char *);
-#endif
-
-#endif
diff --git a/freebsd/netinet/igmp.h b/freebsd/netinet/igmp.h
deleted file mode 100644
index 3c7df0d3..00000000
--- a/freebsd/netinet/igmp.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/*-
- * Copyright (c) 1988 Stephen Deering.
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Stephen Deering of Stanford University.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)igmp.h 8.1 (Berkeley) 6/10/93
- * $FreeBSD$
- */
-
-#ifndef _NETINET_IGMP_HH_
-#define _NETINET_IGMP_HH_
-
-/*
- * Internet Group Management Protocol (IGMP) definitions.
- *
- * Written by Steve Deering, Stanford, May 1988.
- *
- * MULTICAST Revision: 3.5.1.2
- */
-
-/* Minimum length of any IGMP protocol message. */
-#define IGMP_MINLEN 8
-
-/*
- * IGMPv1/v2 query and host report format.
- */
-struct igmp {
- u_char igmp_type; /* version & type of IGMP message */
- u_char igmp_code; /* subtype for routing msgs */
- u_short igmp_cksum; /* IP-style checksum */
- struct in_addr igmp_group; /* group address being reported */
-}; /* (zero for queries) */
-
-/*
- * IGMP v3 query format.
- */
-struct igmpv3 {
- u_char igmp_type; /* version & type of IGMP message */
- u_char igmp_code; /* subtype for routing msgs */
- u_short igmp_cksum; /* IP-style checksum */
- struct in_addr igmp_group; /* group address being reported */
- /* (zero for queries) */
- u_char igmp_misc; /* reserved/suppress/robustness */
- u_char igmp_qqi; /* querier's query interval */
- u_short igmp_numsrc; /* number of sources */
- /*struct in_addr igmp_sources[1];*/ /* source addresses */
-};
-#define IGMP_V3_QUERY_MINLEN 12
-#define IGMP_EXP(x) (((x) >> 4) & 0x07)
-#define IGMP_MANT(x) ((x) & 0x0f)
-#define IGMP_QRESV(x) (((x) >> 4) & 0x0f)
-#define IGMP_SFLAG(x) (((x) >> 3) & 0x01)
-#define IGMP_QRV(x) ((x) & 0x07)
-
-struct igmp_grouprec {
- u_char ig_type; /* record type */
- u_char ig_datalen; /* length of auxiliary data */
- u_short ig_numsrc; /* number of sources */
- struct in_addr ig_group; /* group address being reported */
- /*struct in_addr ig_sources[1];*/ /* source addresses */
-};
-#define IGMP_GRPREC_HDRLEN 8
-
-/*
- * IGMPv3 host membership report header.
- */
-struct igmp_report {
- u_char ir_type; /* IGMP_v3_HOST_MEMBERSHIP_REPORT */
- u_char ir_rsv1; /* must be zero */
- u_short ir_cksum; /* checksum */
- u_short ir_rsv2; /* must be zero */
- u_short ir_numgrps; /* number of group records */
- /*struct igmp_grouprec ir_groups[1];*/ /* group records */
-};
-#define IGMP_V3_REPORT_MINLEN 8
-#define IGMP_V3_REPORT_MAXRECS 65535
-
-/*
- * Message types, including version number.
- */
-#define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* membership query */
-#define IGMP_v1_HOST_MEMBERSHIP_REPORT 0x12 /* Ver. 1 membership report */
-#define IGMP_DVMRP 0x13 /* DVMRP routing message */
-#define IGMP_PIM 0x14 /* PIMv1 message (historic) */
-#define IGMP_v2_HOST_MEMBERSHIP_REPORT 0x16 /* Ver. 2 membership report */
-#define IGMP_HOST_LEAVE_MESSAGE 0x17 /* Leave-group message */
-#define IGMP_MTRACE_REPLY 0x1e /* mtrace(8) reply */
-#define IGMP_MTRACE_QUERY 0x1f /* mtrace(8) probe */
-#define IGMP_v3_HOST_MEMBERSHIP_REPORT 0x22 /* Ver. 3 membership report */
-
-/*
- * IGMPv3 report modes.
- */
-#define IGMP_DO_NOTHING 0 /* don't send a record */
-#define IGMP_MODE_IS_INCLUDE 1 /* MODE_IN */
-#define IGMP_MODE_IS_EXCLUDE 2 /* MODE_EX */
-#define IGMP_CHANGE_TO_INCLUDE_MODE 3 /* TO_IN */
-#define IGMP_CHANGE_TO_EXCLUDE_MODE 4 /* TO_EX */
-#define IGMP_ALLOW_NEW_SOURCES 5 /* ALLOW_NEW */
-#define IGMP_BLOCK_OLD_SOURCES 6 /* BLOCK_OLD */
-
-/*
- * IGMPv3 query types.
- */
-#define IGMP_V3_GENERAL_QUERY 1
-#define IGMP_V3_GROUP_QUERY 2
-#define IGMP_V3_GROUP_SOURCE_QUERY 3
-
-/*
- * Maximum report interval for IGMP v1/v2 host membership reports [RFC 1112]
- */
-#define IGMP_V1V2_MAX_RI 10
-#define IGMP_MAX_HOST_REPORT_DELAY IGMP_V1V2_MAX_RI
-
-/*
- * IGMP_TIMER_SCALE denotes that the igmp code field specifies
- * time in tenths of a second.
- */
-#define IGMP_TIMER_SCALE 10
-
-#endif /* _NETINET_IGMP_HH_ */
diff --git a/freebsd/netinet/in.h b/freebsd/netinet/in.h
deleted file mode 100644
index 17dff53d..00000000
--- a/freebsd/netinet/in.h
+++ /dev/null
@@ -1,794 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)in.h 8.3 (Berkeley) 1/3/94
- * $FreeBSD$
- */
-
-#ifndef _NETINET_IN_HH_
-#define _NETINET_IN_HH_
-
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/_types.h>
-#include <freebsd/machine/endian.h>
-
-/* Protocols common to RFC 1700, POSIX, and X/Open. */
-#define IPPROTO_IP 0 /* dummy for IP */
-#define IPPROTO_ICMP 1 /* control message protocol */
-#define IPPROTO_TCP 6 /* tcp */
-#define IPPROTO_UDP 17 /* user datagram protocol */
-
-#define INADDR_ANY (u_int32_t)0x00000000
-#define INADDR_BROADCAST (u_int32_t)0xffffffff /* must be masked */
-
-#ifndef _UINT8_T_DECLARED
-typedef __uint8_t uint8_t;
-#define _UINT8_T_DECLARED
-#endif
-
-#ifndef _UINT16_T_DECLARED
-typedef __uint16_t uint16_t;
-#define _UINT16_T_DECLARED
-#endif
-
-#ifndef _UINT32_T_DECLARED
-typedef __uint32_t uint32_t;
-#define _UINT32_T_DECLARED
-#endif
-
-#ifndef _IN_ADDR_T_DECLARED
-typedef uint32_t in_addr_t;
-#define _IN_ADDR_T_DECLARED
-#endif
-
-#ifndef _IN_PORT_T_DECLARED
-typedef uint16_t in_port_t;
-#define _IN_PORT_T_DECLARED
-#endif
-
-#ifndef _SA_FAMILY_T_DECLARED
-typedef __sa_family_t sa_family_t;
-#define _SA_FAMILY_T_DECLARED
-#endif
-
-/* Internet address (a structure for historical reasons). */
-#ifndef _STRUCT_IN_ADDR_DECLARED
-struct in_addr {
- in_addr_t s_addr;
-};
-#define _STRUCT_IN_ADDR_DECLARED
-#endif
-
-#ifndef _SOCKLEN_T_DECLARED
-typedef __socklen_t socklen_t;
-#define _SOCKLEN_T_DECLARED
-#endif
-
-/* Avoid collision with original definition in sys/socket.h. */
-#ifndef _STRUCT_SOCKADDR_STORAGE_DECLARED
-/*
- * RFC 2553: protocol-independent placeholder for socket addresses
- */
-#define _SS_MAXSIZE 128U
-#define _SS_ALIGNSIZE (sizeof(__int64_t))
-#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(unsigned char) - \
- sizeof(sa_family_t))
-#define _SS_PAD2SIZE (_SS_MAXSIZE - sizeof(unsigned char) - \
- sizeof(sa_family_t) - _SS_PAD1SIZE - _SS_ALIGNSIZE)
-
-struct sockaddr_storage {
- unsigned char ss_len; /* address length */
- sa_family_t ss_family; /* address family */
- char __ss_pad1[_SS_PAD1SIZE];
- __int64_t __ss_align; /* force desired struct alignment */
- char __ss_pad2[_SS_PAD2SIZE];
-};
-#define _STRUCT_SOCKADDR_STORAGE_DECLARED
-#endif
-
-/* Socket address, internet style. */
-struct sockaddr_in {
- uint8_t sin_len;
- sa_family_t sin_family;
- in_port_t sin_port;
- struct in_addr sin_addr;
- char sin_zero[8];
-};
-
-#if !defined(_KERNEL) && __BSD_VISIBLE
-
-#ifndef _BYTEORDER_PROTOTYPED
-#define _BYTEORDER_PROTOTYPED
-__BEGIN_DECLS
-uint32_t htonl(uint32_t);
-uint16_t htons(uint16_t);
-uint32_t ntohl(uint32_t);
-uint16_t ntohs(uint16_t);
-__END_DECLS
-#endif
-
-#ifndef _BYTEORDER_FUNC_DEFINED
-#define _BYTEORDER_FUNC_DEFINED
-#define htonl(x) __htonl(x)
-#define htons(x) __htons(x)
-#define ntohl(x) __ntohl(x)
-#define ntohs(x) __ntohs(x)
-#endif
-
-#endif /* !_KERNEL && __BSD_VISIBLE */
-
-#if __POSIX_VISIBLE >= 200112
-#define IPPROTO_RAW 255 /* raw IP packet */
-#define INET_ADDRSTRLEN 16
-#endif
-
-#if __BSD_VISIBLE
-/*
- * Constants and structures defined by the internet system,
- * Per RFC 790, September 1981, and numerous additions.
- */
-
-/*
- * Protocols (RFC 1700)
- */
-#define IPPROTO_HOPOPTS 0 /* IP6 hop-by-hop options */
-#define IPPROTO_IGMP 2 /* group mgmt protocol */
-#define IPPROTO_GGP 3 /* gateway^2 (deprecated) */
-#define IPPROTO_IPV4 4 /* IPv4 encapsulation */
-#define IPPROTO_IPIP IPPROTO_IPV4 /* for compatibility */
-#define IPPROTO_ST 7 /* Stream protocol II */
-#define IPPROTO_EGP 8 /* exterior gateway protocol */
-#define IPPROTO_PIGP 9 /* private interior gateway */
-#define IPPROTO_RCCMON 10 /* BBN RCC Monitoring */
-#define IPPROTO_NVPII 11 /* network voice protocol*/
-#define IPPROTO_PUP 12 /* pup */
-#define IPPROTO_ARGUS 13 /* Argus */
-#define IPPROTO_EMCON 14 /* EMCON */
-#define IPPROTO_XNET 15 /* Cross Net Debugger */
-#define IPPROTO_CHAOS 16 /* Chaos*/
-#define IPPROTO_MUX 18 /* Multiplexing */
-#define IPPROTO_MEAS 19 /* DCN Measurement Subsystems */
-#define IPPROTO_HMP 20 /* Host Monitoring */
-#define IPPROTO_PRM 21 /* Packet Radio Measurement */
-#define IPPROTO_IDP 22 /* xns idp */
-#define IPPROTO_TRUNK1 23 /* Trunk-1 */
-#define IPPROTO_TRUNK2 24 /* Trunk-2 */
-#define IPPROTO_LEAF1 25 /* Leaf-1 */
-#define IPPROTO_LEAF2 26 /* Leaf-2 */
-#define IPPROTO_RDP 27 /* Reliable Data */
-#define IPPROTO_IRTP 28 /* Reliable Transaction */
-#define IPPROTO_TP 29 /* tp-4 w/ class negotiation */
-#define IPPROTO_BLT 30 /* Bulk Data Transfer */
-#define IPPROTO_NSP 31 /* Network Services */
-#define IPPROTO_INP 32 /* Merit Internodal */
-#define IPPROTO_SEP 33 /* Sequential Exchange */
-#define IPPROTO_3PC 34 /* Third Party Connect */
-#define IPPROTO_IDPR 35 /* InterDomain Policy Routing */
-#define IPPROTO_XTP 36 /* XTP */
-#define IPPROTO_DDP 37 /* Datagram Delivery */
-#define IPPROTO_CMTP 38 /* Control Message Transport */
-#define IPPROTO_TPXX 39 /* TP++ Transport */
-#define IPPROTO_IL 40 /* IL transport protocol */
-#define IPPROTO_IPV6 41 /* IP6 header */
-#define IPPROTO_SDRP 42 /* Source Demand Routing */
-#define IPPROTO_ROUTING 43 /* IP6 routing header */
-#define IPPROTO_FRAGMENT 44 /* IP6 fragmentation header */
-#define IPPROTO_IDRP 45 /* InterDomain Routing*/
-#define IPPROTO_RSVP 46 /* resource reservation */
-#define IPPROTO_GRE 47 /* General Routing Encap. */
-#define IPPROTO_MHRP 48 /* Mobile Host Routing */
-#define IPPROTO_BHA 49 /* BHA */
-#define IPPROTO_ESP 50 /* IP6 Encap Sec. Payload */
-#define IPPROTO_AH 51 /* IP6 Auth Header */
-#define IPPROTO_INLSP 52 /* Integ. Net Layer Security */
-#define IPPROTO_SWIPE 53 /* IP with encryption */
-#define IPPROTO_NHRP 54 /* Next Hop Resolution */
-#define IPPROTO_MOBILE 55 /* IP Mobility */
-#define IPPROTO_TLSP 56 /* Transport Layer Security */
-#define IPPROTO_SKIP 57 /* SKIP */
-#define IPPROTO_ICMPV6 58 /* ICMP6 */
-#define IPPROTO_NONE 59 /* IP6 no next header */
-#define IPPROTO_DSTOPTS 60 /* IP6 destination option */
-#define IPPROTO_AHIP 61 /* any host internal protocol */
-#define IPPROTO_CFTP 62 /* CFTP */
-#define IPPROTO_HELLO 63 /* "hello" routing protocol */
-#define IPPROTO_SATEXPAK 64 /* SATNET/Backroom EXPAK */
-#define IPPROTO_KRYPTOLAN 65 /* Kryptolan */
-#define IPPROTO_RVD 66 /* Remote Virtual Disk */
-#define IPPROTO_IPPC 67 /* Pluribus Packet Core */
-#define IPPROTO_ADFS 68 /* Any distributed FS */
-#define IPPROTO_SATMON 69 /* Satnet Monitoring */
-#define IPPROTO_VISA 70 /* VISA Protocol */
-#define IPPROTO_IPCV 71 /* Packet Core Utility */
-#define IPPROTO_CPNX 72 /* Comp. Prot. Net. Executive */
-#define IPPROTO_CPHB 73 /* Comp. Prot. HeartBeat */
-#define IPPROTO_WSN 74 /* Wang Span Network */
-#define IPPROTO_PVP 75 /* Packet Video Protocol */
-#define IPPROTO_BRSATMON 76 /* BackRoom SATNET Monitoring */
-#define IPPROTO_ND 77 /* Sun net disk proto (temp.) */
-#define IPPROTO_WBMON 78 /* WIDEBAND Monitoring */
-#define IPPROTO_WBEXPAK 79 /* WIDEBAND EXPAK */
-#define IPPROTO_EON 80 /* ISO cnlp */
-#define IPPROTO_VMTP 81 /* VMTP */
-#define IPPROTO_SVMTP 82 /* Secure VMTP */
-#define IPPROTO_VINES 83 /* Banyon VINES */
-#define IPPROTO_TTP 84 /* TTP */
-#define IPPROTO_IGP 85 /* NSFNET-IGP */
-#define IPPROTO_DGP 86 /* dissimilar gateway prot. */
-#define IPPROTO_TCF 87 /* TCF */
-#define IPPROTO_IGRP 88 /* Cisco/GXS IGRP */
-#define IPPROTO_OSPFIGP 89 /* OSPFIGP */
-#define IPPROTO_SRPC 90 /* Strite RPC protocol */
-#define IPPROTO_LARP 91 /* Locus Address Resoloution */
-#define IPPROTO_MTP 92 /* Multicast Transport */
-#define IPPROTO_AX25 93 /* AX.25 Frames */
-#define IPPROTO_IPEIP 94 /* IP encapsulated in IP */
-#define IPPROTO_MICP 95 /* Mobile Int.ing control */
-#define IPPROTO_SCCSP 96 /* Semaphore Comm. security */
-#define IPPROTO_ETHERIP 97 /* Ethernet IP encapsulation */
-#define IPPROTO_ENCAP 98 /* encapsulation header */
-#define IPPROTO_APES 99 /* any private encr. scheme */
-#define IPPROTO_GMTP 100 /* GMTP*/
-#define IPPROTO_IPCOMP 108 /* payload compression (IPComp) */
-#define IPPROTO_SCTP 132 /* SCTP */
-/* 101-254: Partly Unassigned */
-#define IPPROTO_PIM 103 /* Protocol Independent Mcast */
-#define IPPROTO_CARP 112 /* CARP */
-#define IPPROTO_PGM 113 /* PGM */
-#define IPPROTO_PFSYNC 240 /* PFSYNC */
-/* 255: Reserved */
-/* BSD Private, local use, namespace incursion, no longer used */
-#define IPPROTO_OLD_DIVERT 254 /* OLD divert pseudo-proto */
-#define IPPROTO_MAX 256
-
-/* last return value of *_input(), meaning "all job for this pkt is done". */
-#define IPPROTO_DONE 257
-
-/* Only used internally, so can be outside the range of valid IP protocols. */
-#define IPPROTO_DIVERT 258 /* divert pseudo-protocol */
-
-/*
- * Defined to avoid confusion. The master value is defined by
- * PROTO_SPACER in sys/protosw.h.
- */
-#define IPPROTO_SPACER 32767 /* spacer for loadable protos */
-
-/*
- * Local port number conventions:
- *
- * When a user does a bind(2) or connect(2) with a port number of zero,
- * a non-conflicting local port address is chosen.
- * The default range is IPPORT_HIFIRSTAUTO through
- * IPPORT_HILASTAUTO, although that is settable by sysctl.
- *
- * A user may set the IPPROTO_IP option IP_PORTRANGE to change this
- * default assignment range.
- *
- * The value IP_PORTRANGE_DEFAULT causes the default behavior.
- *
- * The value IP_PORTRANGE_HIGH changes the range of candidate port numbers
- * into the "high" range. These are reserved for client outbound connections
- * which do not want to be filtered by any firewalls.
- *
- * The value IP_PORTRANGE_LOW changes the range to the "low" are
- * that is (by convention) restricted to privileged processes. This
- * convention is based on "vouchsafe" principles only. It is only secure
- * if you trust the remote host to restrict these ports.
- *
- * The default range of ports and the high range can be changed by
- * sysctl(3). (net.inet.ip.port{hi,low}{first,last}_auto)
- *
- * Changing those values has bad security implications if you are
- * using a stateless firewall that is allowing packets outside of that
- * range in order to allow transparent outgoing connections.
- *
- * Such a firewall configuration will generally depend on the use of these
- * default values. If you change them, you may find your Security
- * Administrator looking for you with a heavy object.
- *
- * For a slightly more orthodox text view on this:
- *
- * ftp://ftp.isi.edu/in-notes/iana/assignments/port-numbers
- *
- * port numbers are divided into three ranges:
- *
- * 0 - 1023 Well Known Ports
- * 1024 - 49151 Registered Ports
- * 49152 - 65535 Dynamic and/or Private Ports
- *
- */
-
-/*
- * Ports < IPPORT_RESERVED are reserved for
- * privileged processes (e.g. root). (IP_PORTRANGE_LOW)
- */
-#define IPPORT_RESERVED 1024
-
-/*
- * Default local port range, used by IP_PORTRANGE_DEFAULT
- */
-#define IPPORT_EPHEMERALFIRST 10000
-#define IPPORT_EPHEMERALLAST 65535
-
-/*
- * Dynamic port range, used by IP_PORTRANGE_HIGH.
- */
-#define IPPORT_HIFIRSTAUTO 49152
-#define IPPORT_HILASTAUTO 65535
-
-/*
- * Scanning for a free reserved port return a value below IPPORT_RESERVED,
- * but higher than IPPORT_RESERVEDSTART. Traditionally the start value was
- * 512, but that conflicts with some well-known-services that firewalls may
- * have a fit if we use.
- */
-#define IPPORT_RESERVEDSTART 600
-
-#define IPPORT_MAX 65535
-
-/*
- * Definitions of bits in internet address integers.
- * On subnets, the decomposition of addresses to host and net parts
- * is done according to subnet mask, not the masks here.
- */
-#define IN_CLASSA(i) (((u_int32_t)(i) & 0x80000000) == 0)
-#define IN_CLASSA_NET 0xff000000
-#define IN_CLASSA_NSHIFT 24
-#define IN_CLASSA_HOST 0x00ffffff
-#define IN_CLASSA_MAX 128
-
-#define IN_CLASSB(i) (((u_int32_t)(i) & 0xc0000000) == 0x80000000)
-#define IN_CLASSB_NET 0xffff0000
-#define IN_CLASSB_NSHIFT 16
-#define IN_CLASSB_HOST 0x0000ffff
-#define IN_CLASSB_MAX 65536
-
-#define IN_CLASSC(i) (((u_int32_t)(i) & 0xe0000000) == 0xc0000000)
-#define IN_CLASSC_NET 0xffffff00
-#define IN_CLASSC_NSHIFT 8
-#define IN_CLASSC_HOST 0x000000ff
-
-#define IN_CLASSD(i) (((u_int32_t)(i) & 0xf0000000) == 0xe0000000)
-#define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */
-#define IN_CLASSD_NSHIFT 28 /* net and host fields, but */
-#define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */
-#define IN_MULTICAST(i) IN_CLASSD(i)
-
-#define IN_EXPERIMENTAL(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000)
-#define IN_BADCLASS(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000)
-
-#define IN_LINKLOCAL(i) (((u_int32_t)(i) & 0xffff0000) == 0xa9fe0000)
-#define IN_LOOPBACK(i) (((u_int32_t)(i) & 0xff000000) == 0x7f000000)
-#define IN_ZERONET(i) (((u_int32_t)(i) & 0xff000000) == 0)
-
-#define IN_PRIVATE(i) ((((u_int32_t)(i) & 0xff000000) == 0x0a000000) || \
- (((u_int32_t)(i) & 0xfff00000) == 0xac100000) || \
- (((u_int32_t)(i) & 0xffff0000) == 0xc0a80000))
-
-#define IN_LOCAL_GROUP(i) (((u_int32_t)(i) & 0xffffff00) == 0xe0000000)
-
-#define IN_ANY_LOCAL(i) (IN_LINKLOCAL(i) || IN_LOCAL_GROUP(i))
-
-#define INADDR_LOOPBACK (u_int32_t)0x7f000001
-#ifndef _KERNEL
-#define INADDR_NONE 0xffffffff /* -1 return */
-#endif
-
-#define INADDR_UNSPEC_GROUP (u_int32_t)0xe0000000 /* 224.0.0.0 */
-#define INADDR_ALLHOSTS_GROUP (u_int32_t)0xe0000001 /* 224.0.0.1 */
-#define INADDR_ALLRTRS_GROUP (u_int32_t)0xe0000002 /* 224.0.0.2 */
-#define INADDR_ALLRPTS_GROUP (u_int32_t)0xe0000016 /* 224.0.0.22, IGMPv3 */
-#define INADDR_CARP_GROUP (u_int32_t)0xe0000012 /* 224.0.0.18 */
-#define INADDR_PFSYNC_GROUP (u_int32_t)0xe00000f0 /* 224.0.0.240 */
-#define INADDR_ALLMDNS_GROUP (u_int32_t)0xe00000fb /* 224.0.0.251 */
-#define INADDR_MAX_LOCAL_GROUP (u_int32_t)0xe00000ff /* 224.0.0.255 */
-
-#define IN_LOOPBACKNET 127 /* official! */
-
-/*
- * Options for use with [gs]etsockopt at the IP level.
- * First word of comment is data type; bool is stored in int.
- */
-#define IP_OPTIONS 1 /* buf/ip_opts; set/get IP options */
-#define IP_HDRINCL 2 /* int; header is included with data */
-#define IP_TOS 3 /* int; IP type of service and preced. */
-#define IP_TTL 4 /* int; IP time to live */
-#define IP_RECVOPTS 5 /* bool; receive all IP opts w/dgram */
-#define IP_RECVRETOPTS 6 /* bool; receive IP opts for response */
-#define IP_RECVDSTADDR 7 /* bool; receive IP dst addr w/dgram */
-#define IP_SENDSRCADDR IP_RECVDSTADDR /* cmsg_type to set src addr */
-#define IP_RETOPTS 8 /* ip_opts; set/get IP options */
-#define IP_MULTICAST_IF 9 /* struct in_addr *or* struct ip_mreqn;
- * set/get IP multicast i/f */
-#define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */
-#define IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback */
-#define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */
-#define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */
-#define IP_MULTICAST_VIF 14 /* set/get IP mcast virt. iface */
-#define IP_RSVP_ON 15 /* enable RSVP in kernel */
-#define IP_RSVP_OFF 16 /* disable RSVP in kernel */
-#define IP_RSVP_VIF_ON 17 /* set RSVP per-vif socket */
-#define IP_RSVP_VIF_OFF 18 /* unset RSVP per-vif socket */
-#define IP_PORTRANGE 19 /* int; range to choose for unspec port */
-#define IP_RECVIF 20 /* bool; receive reception if w/dgram */
-/* for IPSEC */
-#define IP_IPSEC_POLICY 21 /* int; set/get security policy */
-#define IP_FAITH 22 /* bool; accept FAITH'ed connections */
-
-#define IP_ONESBCAST 23 /* bool: send all-ones broadcast */
-#define IP_BINDANY 24 /* bool: allow bind to any address */
-
-/*
- * Options for controlling the firewall and dummynet.
- * Historical options (from 40 to 64) will eventually be
- * replaced by only two options, IP_FW3 and IP_DUMMYNET3.
- */
-#define IP_FW_TABLE_ADD 40 /* add entry */
-#define IP_FW_TABLE_DEL 41 /* delete entry */
-#define IP_FW_TABLE_FLUSH 42 /* flush table */
-#define IP_FW_TABLE_GETSIZE 43 /* get table size */
-#define IP_FW_TABLE_LIST 44 /* list table contents */
-
-#define IP_FW3 48 /* generic ipfw v.3 sockopts */
-#define IP_DUMMYNET3 49 /* generic dummynet v.3 sockopts */
-
-#define IP_FW_ADD 50 /* add a firewall rule to chain */
-#define IP_FW_DEL 51 /* delete a firewall rule from chain */
-#define IP_FW_FLUSH 52 /* flush firewall rule chain */
-#define IP_FW_ZERO 53 /* clear single/all firewall counter(s) */
-#define IP_FW_GET 54 /* get entire firewall rule chain */
-#define IP_FW_RESETLOG 55 /* reset logging counters */
-
-#define IP_FW_NAT_CFG 56 /* add/config a nat rule */
-#define IP_FW_NAT_DEL 57 /* delete a nat rule */
-#define IP_FW_NAT_GET_CONFIG 58 /* get configuration of a nat rule */
-#define IP_FW_NAT_GET_LOG 59 /* get log of a nat rule */
-
-#define IP_DUMMYNET_CONFIGURE 60 /* add/configure a dummynet pipe */
-#define IP_DUMMYNET_DEL 61 /* delete a dummynet pipe from chain */
-#define IP_DUMMYNET_FLUSH 62 /* flush dummynet */
-#define IP_DUMMYNET_GET 64 /* get entire dummynet pipes */
-
-#define IP_RECVTTL 65 /* bool; receive IP TTL w/dgram */
-#define IP_MINTTL 66 /* minimum TTL for packet or drop */
-#define IP_DONTFRAG 67 /* don't fragment packet */
-
-/* IPv4 Source Filter Multicast API [RFC3678] */
-#define IP_ADD_SOURCE_MEMBERSHIP 70 /* join a source-specific group */
-#define IP_DROP_SOURCE_MEMBERSHIP 71 /* drop a single source */
-#define IP_BLOCK_SOURCE 72 /* block a source */
-#define IP_UNBLOCK_SOURCE 73 /* unblock a source */
-
-/* The following option is private; do not use it from user applications. */
-#define IP_MSFILTER 74 /* set/get filter list */
-
-/* Protocol Independent Multicast API [RFC3678] */
-#define MCAST_JOIN_GROUP 80 /* join an any-source group */
-#define MCAST_LEAVE_GROUP 81 /* leave all sources for group */
-#define MCAST_JOIN_SOURCE_GROUP 82 /* join a source-specific group */
-#define MCAST_LEAVE_SOURCE_GROUP 83 /* leave a single source */
-#define MCAST_BLOCK_SOURCE 84 /* block a source */
-#define MCAST_UNBLOCK_SOURCE 85 /* unblock a source */
-
-/*
- * Defaults and limits for options
- */
-#define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */
-#define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */
-
-/*
- * The imo_membership vector for each socket is now dynamically allocated at
- * run-time, bounded by USHRT_MAX, and is reallocated when needed, sized
- * according to a power-of-two increment.
- */
-#define IP_MIN_MEMBERSHIPS 31
-#define IP_MAX_MEMBERSHIPS 4095
-#define IP_MAX_SOURCE_FILTER 1024 /* XXX to be unused */
-
-/*
- * Default resource limits for IPv4 multicast source filtering.
- * These may be modified by sysctl.
- */
-#define IP_MAX_GROUP_SRC_FILTER 512 /* sources per group */
-#define IP_MAX_SOCK_SRC_FILTER 128 /* sources per socket/group */
-#define IP_MAX_SOCK_MUTE_FILTER 128 /* XXX no longer used */
-
-/*
- * Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP.
- */
-struct ip_mreq {
- struct in_addr imr_multiaddr; /* IP multicast address of group */
- struct in_addr imr_interface; /* local IP address of interface */
-};
-
-/*
- * Modified argument structure for IP_MULTICAST_IF, obtained from Linux.
- * This is used to specify an interface index for multicast sends, as
- * the IPv4 legacy APIs do not support this (unless IP_SENDIF is available).
- */
-struct ip_mreqn {
- struct in_addr imr_multiaddr; /* IP multicast address of group */
- struct in_addr imr_address; /* local IP address of interface */
- int imr_ifindex; /* Interface index; cast to uint32_t */
-};
-
-/*
- * Argument structure for IPv4 Multicast Source Filter APIs. [RFC3678]
- */
-struct ip_mreq_source {
- struct in_addr imr_multiaddr; /* IP multicast address of group */
- struct in_addr imr_sourceaddr; /* IP address of source */
- struct in_addr imr_interface; /* local IP address of interface */
-};
-
-/*
- * Argument structures for Protocol-Independent Multicast Source
- * Filter APIs. [RFC3678]
- */
-struct group_req {
- uint32_t gr_interface; /* interface index */
- struct sockaddr_storage gr_group; /* group address */
-};
-
-struct group_source_req {
- uint32_t gsr_interface; /* interface index */
- struct sockaddr_storage gsr_group; /* group address */
- struct sockaddr_storage gsr_source; /* source address */
-};
-
-#ifndef __MSFILTERREQ_DEFINED
-#define __MSFILTERREQ_DEFINED
-/*
- * The following structure is private; do not use it from user applications.
- * It is used to communicate IP_MSFILTER/IPV6_MSFILTER information between
- * the RFC 3678 libc functions and the kernel.
- */
-struct __msfilterreq {
- uint32_t msfr_ifindex; /* interface index */
- uint32_t msfr_fmode; /* filter mode for group */
- uint32_t msfr_nsrcs; /* # of sources in msfr_srcs */
- struct sockaddr_storage msfr_group; /* group address */
- struct sockaddr_storage *msfr_srcs; /* pointer to the first member
- * of a contiguous array of
- * sources to filter in full.
- */
-};
-#endif
-
-struct sockaddr;
-
-/*
- * Advanced (Full-state) APIs [RFC3678]
- * The RFC specifies uint_t for the 6th argument to [sg]etsourcefilter().
- * We use uint32_t here to be consistent.
- */
-int setipv4sourcefilter(int, struct in_addr, struct in_addr, uint32_t,
- uint32_t, struct in_addr *);
-int getipv4sourcefilter(int, struct in_addr, struct in_addr, uint32_t *,
- uint32_t *, struct in_addr *);
-int setsourcefilter(int, uint32_t, struct sockaddr *, socklen_t,
- uint32_t, uint32_t, struct sockaddr_storage *);
-int getsourcefilter(int, uint32_t, struct sockaddr *, socklen_t,
- uint32_t *, uint32_t *, struct sockaddr_storage *);
-
-/*
- * Filter modes; also used to represent per-socket filter mode internally.
- */
-#define MCAST_UNDEFINED 0 /* fmode: not yet defined */
-#define MCAST_INCLUDE 1 /* fmode: include these source(s) */
-#define MCAST_EXCLUDE 2 /* fmode: exclude these source(s) */
-
-/*
- * Argument for IP_PORTRANGE:
- * - which range to search when port is unspecified at bind() or connect()
- */
-#define IP_PORTRANGE_DEFAULT 0 /* default range */
-#define IP_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */
-#define IP_PORTRANGE_LOW 2 /* "low" - vouchsafe security */
-
-/*
- * Definitions for inet sysctl operations.
- *
- * Third level is protocol number.
- * Fourth level is desired variable within that protocol.
- */
-#define IPPROTO_MAXID (IPPROTO_AH + 1) /* don't list to IPPROTO_MAX */
-
-#define CTL_IPPROTO_NAMES { \
- { "ip", CTLTYPE_NODE }, \
- { "icmp", CTLTYPE_NODE }, \
- { "igmp", CTLTYPE_NODE }, \
- { "ggp", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "tcp", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { "egp", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "pup", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "udp", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "idp", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "ipsec", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "pim", CTLTYPE_NODE }, \
-}
-
-/*
- * Names for IP sysctl objects
- */
-#define IPCTL_FORWARDING 1 /* act as router */
-#define IPCTL_SENDREDIRECTS 2 /* may send redirects when forwarding */
-#define IPCTL_DEFTTL 3 /* default TTL */
-#ifdef notyet
-#define IPCTL_DEFMTU 4 /* default MTU */
-#endif
-#define IPCTL_RTEXPIRE 5 /* cloned route expiration time */
-#define IPCTL_RTMINEXPIRE 6 /* min value for expiration time */
-#define IPCTL_RTMAXCACHE 7 /* trigger level for dynamic expire */
-#define IPCTL_SOURCEROUTE 8 /* may perform source routes */
-#define IPCTL_DIRECTEDBROADCAST 9 /* may re-broadcast received packets */
-#define IPCTL_INTRQMAXLEN 10 /* max length of netisr queue */
-#define IPCTL_INTRQDROPS 11 /* number of netisr q drops */
-#define IPCTL_STATS 12 /* ipstat structure */
-#define IPCTL_ACCEPTSOURCEROUTE 13 /* may accept source routed packets */
-#define IPCTL_FASTFORWARDING 14 /* use fast IP forwarding code */
-#define IPCTL_KEEPFAITH 15 /* FAITH IPv4->IPv6 translater ctl */
-#define IPCTL_GIF_TTL 16 /* default TTL for gif encap packet */
-#define IPCTL_MAXID 17
-
-#define IPCTL_NAMES { \
- { 0, 0 }, \
- { "forwarding", CTLTYPE_INT }, \
- { "redirect", CTLTYPE_INT }, \
- { "ttl", CTLTYPE_INT }, \
- { "mtu", CTLTYPE_INT }, \
- { "rtexpire", CTLTYPE_INT }, \
- { "rtminexpire", CTLTYPE_INT }, \
- { "rtmaxcache", CTLTYPE_INT }, \
- { "sourceroute", CTLTYPE_INT }, \
- { "directed-broadcast", CTLTYPE_INT }, \
- { "intr-queue-maxlen", CTLTYPE_INT }, \
- { "intr-queue-drops", CTLTYPE_INT }, \
- { "stats", CTLTYPE_STRUCT }, \
- { "accept_sourceroute", CTLTYPE_INT }, \
- { "fastforwarding", CTLTYPE_INT }, \
-}
-
-#endif /* __BSD_VISIBLE */
-
-#ifdef _KERNEL
-
-struct ifnet; struct mbuf; /* forward declarations for Standard C */
-
-int in_broadcast(struct in_addr, struct ifnet *);
-int in_canforward(struct in_addr);
-int in_localaddr(struct in_addr);
-int in_localip(struct in_addr);
-int inet_aton(const char *, struct in_addr *); /* in libkern */
-char *inet_ntoa(struct in_addr); /* in libkern */
-char *inet_ntoa_r(struct in_addr ina, char *buf); /* in libkern */
-char *inet_ntop(int, const void *, char *, socklen_t); /* in libkern */
-int inet_pton(int af, const char *, void *); /* in libkern */
-void in_ifdetach(struct ifnet *);
-
-#define in_hosteq(s, t) ((s).s_addr == (t).s_addr)
-#define in_nullhost(x) ((x).s_addr == INADDR_ANY)
-#define in_allhosts(x) ((x).s_addr == htonl(INADDR_ALLHOSTS_GROUP))
-
-#define satosin(sa) ((struct sockaddr_in *)(sa))
-#define sintosa(sin) ((struct sockaddr *)(sin))
-#define ifatoia(ifa) ((struct in_ifaddr *)(ifa))
-
-/*
- * Historically, BSD keeps ip_len and ip_off in host format
- * when doing layer 3 processing, and this often requires
- * to translate the format back and forth.
- * To make the process explicit, we define a couple of macros
- * that also take into account the fact that at some point
- * we may want to keep those fields always in net format.
- */
-
-#if (BYTE_ORDER == BIG_ENDIAN) || defined(HAVE_NET_IPLEN)
-#define SET_NET_IPLEN(p) do {} while (0)
-#define SET_HOST_IPLEN(p) do {} while (0)
-#else
-#define SET_NET_IPLEN(p) do { \
- struct ip *h_ip = (p); \
- h_ip->ip_len = htons(h_ip->ip_len); \
- h_ip->ip_off = htons(h_ip->ip_off); \
- } while (0)
-
-#define SET_HOST_IPLEN(p) do { \
- struct ip *h_ip = (p); \
- h_ip->ip_len = ntohs(h_ip->ip_len); \
- h_ip->ip_off = ntohs(h_ip->ip_off); \
- } while (0)
-#endif /* !HAVE_NET_IPLEN */
-
-#endif /* _KERNEL */
-
-/* INET6 stuff */
-#if __POSIX_VISIBLE >= 200112
-#define __KAME_NETINET_IN_HH_INCLUDED_
-#include <freebsd/netinet6/in6.h>
-#undef __KAME_NETINET_IN_HH_INCLUDED_
-#endif
-
-#endif /* !_NETINET_IN_HH_*/
diff --git a/freebsd/netinet/in_cksum.c b/freebsd/netinet/in_cksum.c
deleted file mode 100644
index a684ace9..00000000
--- a/freebsd/netinet/in_cksum.c
+++ /dev/null
@@ -1,148 +0,0 @@
-#include <freebsd/machine/rtems-bsd-config.h>
-
-/*-
- * Copyright (c) 1988, 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)in_cksum.c 8.1 (Berkeley) 6/10/93
- */
-
-#include <freebsd/sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/mbuf.h>
-
-/*
- * Checksum routine for Internet Protocol family headers (Portable Version).
- *
- * This routine is very heavily used in the network
- * code and should be modified for each CPU to be as fast as possible.
- */
-
-#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x)
-#define REDUCE {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; ADDCARRY(sum);}
-
-int
-in_cksum(struct mbuf *m, int len)
-{
- register u_short *w;
- register int sum = 0;
- register int mlen = 0;
- int byte_swapped = 0;
-
- union {
- char c[2];
- u_short s;
- } s_util;
- union {
- u_short s[2];
- long l;
- } l_util;
-
- for (;m && len; m = m->m_next) {
- if (m->m_len == 0)
- continue;
- w = mtod(m, u_short *);
- if (mlen == -1) {
- /*
- * The first byte of this mbuf is the continuation
- * of a word spanning between this mbuf and the
- * last mbuf.
- *
- * s_util.c[0] is already saved when scanning previous
- * mbuf.
- */
- s_util.c[1] = *(char *)w;
- sum += s_util.s;
- w = (u_short *)((char *)w + 1);
- mlen = m->m_len - 1;
- len--;
- } else
- mlen = m->m_len;
- if (len < mlen)
- mlen = len;
- len -= mlen;
- /*
- * Force to even boundary.
- */
- if ((1 & (int) w) && (mlen > 0)) {
- REDUCE;
- sum <<= 8;
- s_util.c[0] = *(u_char *)w;
- w = (u_short *)((char *)w + 1);
- mlen--;
- byte_swapped = 1;
- }
- /*
- * Unroll the loop to make overhead from
- * branches &c small.
- */
- while ((mlen -= 32) >= 0) {
- sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3];
- sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7];
- sum += w[8]; sum += w[9]; sum += w[10]; sum += w[11];
- sum += w[12]; sum += w[13]; sum += w[14]; sum += w[15];
- w += 16;
- }
- mlen += 32;
- while ((mlen -= 8) >= 0) {
- sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3];
- w += 4;
- }
- mlen += 8;
- if (mlen == 0 && byte_swapped == 0)
- continue;
- REDUCE;
- while ((mlen -= 2) >= 0) {
- sum += *w++;
- }
- if (byte_swapped) {
- REDUCE;
- sum <<= 8;
- byte_swapped = 0;
- if (mlen == -1) {
- s_util.c[1] = *(char *)w;
- sum += s_util.s;
- mlen = 0;
- } else
- mlen = -1;
- } else if (mlen == -1)
- s_util.c[0] = *(char *)w;
- }
- if (len)
- printf("cksum: out of data\n");
- if (mlen == -1) {
- /* The last mbuf has odd # of bytes. Follow the
- standard (the odd byte may be shifted left by 8 bits
- or not as determined by endian-ness of the machine) */
- s_util.c[1] = 0;
- sum += s_util.s;
- }
- REDUCE;
- return (~sum & 0xffff);
-}
diff --git a/freebsd/netinet/ip.h b/freebsd/netinet/ip.h
deleted file mode 100644
index b7085fc4..00000000
--- a/freebsd/netinet/ip.h
+++ /dev/null
@@ -1,196 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1993
- * The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)ip.h 8.2 (Berkeley) 6/1/94
- * $FreeBSD$
- */
-
-#ifndef _NETINET_IP_HH_
-#define _NETINET_IP_HH_
-
-#include <freebsd/sys/cdefs.h>
-
-/*
- * Definitions for internet protocol version 4.
- *
- * Per RFC 791, September 1981.
- */
-#define IPVERSION 4
-
-/*
- * Structure of an internet header, naked of options.
- */
-struct ip {
-#if BYTE_ORDER == LITTLE_ENDIAN
- u_int ip_hl:4, /* header length */
- ip_v:4; /* version */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- u_int ip_v:4, /* version */
- ip_hl:4; /* header length */
-#endif
- u_char ip_tos; /* type of service */
- u_short ip_len; /* total length */
- u_short ip_id; /* identification */
- u_short ip_off; /* fragment offset field */
-#define IP_RF 0x8000 /* reserved fragment flag */
-#define IP_DF 0x4000 /* dont fragment flag */
-#define IP_MF 0x2000 /* more fragments flag */
-#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
- u_char ip_ttl; /* time to live */
- u_char ip_p; /* protocol */
- u_short ip_sum; /* checksum */
- struct in_addr ip_src,ip_dst; /* source and dest address */
-} __packed __aligned(4);
-
-#define IP_MAXPACKET 65535 /* maximum packet size */
-
-/*
- * Definitions for IP type of service (ip_tos).
- */
-#define IPTOS_LOWDELAY 0x10
-#define IPTOS_THROUGHPUT 0x08
-#define IPTOS_RELIABILITY 0x04
-#define IPTOS_MINCOST 0x02
-
-/*
- * Definitions for IP precedence (also in ip_tos) (hopefully unused).
- */
-#define IPTOS_PREC_NETCONTROL 0xe0
-#define IPTOS_PREC_INTERNETCONTROL 0xc0
-#define IPTOS_PREC_CRITIC_ECP 0xa0
-#define IPTOS_PREC_FLASHOVERRIDE 0x80
-#define IPTOS_PREC_FLASH 0x60
-#define IPTOS_PREC_IMMEDIATE 0x40
-#define IPTOS_PREC_PRIORITY 0x20
-#define IPTOS_PREC_ROUTINE 0x00
-
-/*
- * ECN (Explicit Congestion Notification) codepoints in RFC3168 mapped to the
- * lower 2 bits of the TOS field.
- */
-#define IPTOS_ECN_NOTECT 0x00 /* not-ECT */
-#define IPTOS_ECN_ECT1 0x01 /* ECN-capable transport (1) */
-#define IPTOS_ECN_ECT0 0x02 /* ECN-capable transport (0) */
-#define IPTOS_ECN_CE 0x03 /* congestion experienced */
-#define IPTOS_ECN_MASK 0x03 /* ECN field mask */
-
-/*
- * Definitions for options.
- */
-#define IPOPT_COPIED(o) ((o)&0x80)
-#define IPOPT_CLASS(o) ((o)&0x60)
-#define IPOPT_NUMBER(o) ((o)&0x1f)
-
-#define IPOPT_CONTROL 0x00
-#define IPOPT_RESERVED1 0x20
-#define IPOPT_DEBMEAS 0x40
-#define IPOPT_RESERVED2 0x60
-
-#define IPOPT_EOL 0 /* end of option list */
-#define IPOPT_NOP 1 /* no operation */
-
-#define IPOPT_RR 7 /* record packet route */
-#define IPOPT_TS 68 /* timestamp */
-#define IPOPT_SECURITY 130 /* provide s,c,h,tcc */
-#define IPOPT_LSRR 131 /* loose source route */
-#define IPOPT_ESO 133 /* extended security */
-#define IPOPT_CIPSO 134 /* commerical security */
-#define IPOPT_SATID 136 /* satnet id */
-#define IPOPT_SSRR 137 /* strict source route */
-#define IPOPT_RA 148 /* router alert */
-
-/*
- * Offsets to fields in options other than EOL and NOP.
- */
-#define IPOPT_OPTVAL 0 /* option ID */
-#define IPOPT_OLEN 1 /* option length */
-#define IPOPT_OFFSET 2 /* offset within option */
-#define IPOPT_MINOFF 4 /* min value of above */
-
-/*
- * Time stamp option structure.
- */
-struct ip_timestamp {
- u_char ipt_code; /* IPOPT_TS */
- u_char ipt_len; /* size of structure (variable) */
- u_char ipt_ptr; /* index of current entry */
-#if BYTE_ORDER == LITTLE_ENDIAN
- u_int ipt_flg:4, /* flags, see below */
- ipt_oflw:4; /* overflow counter */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- u_int ipt_oflw:4, /* overflow counter */
- ipt_flg:4; /* flags, see below */
-#endif
- union ipt_timestamp {
- uint32_t ipt_time[1]; /* network format */
- struct ipt_ta {
- struct in_addr ipt_addr;
- uint32_t ipt_time; /* network format */
- } ipt_ta[1];
- } ipt_timestamp;
-};
-
-/* Flag bits for ipt_flg. */
-#define IPOPT_TS_TSONLY 0 /* timestamps only */
-#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
-#define IPOPT_TS_PRESPEC 3 /* specified modules only */
-
-/* Bits for security (not byte swapped). */
-#define IPOPT_SECUR_UNCLASS 0x0000
-#define IPOPT_SECUR_CONFID 0xf135
-#define IPOPT_SECUR_EFTO 0x789a
-#define IPOPT_SECUR_MMMM 0xbc4d
-#define IPOPT_SECUR_RESTR 0xaf13
-#define IPOPT_SECUR_SECRET 0xd788
-#define IPOPT_SECUR_TOPSECRET 0x6bc5
-
-/*
- * Internet implementation parameters.
- */
-#define MAXTTL 255 /* maximum time to live (seconds) */
-#define IPDEFTTL 64 /* default ttl, from RFC 1340 */
-#define IPFRAGTTL 60 /* time to live for frags, slowhz */
-#define IPTTLDEC 1 /* subtracted when forwarding */
-#define IP_MSS 576 /* default maximum segment size */
-
-/*
- * This is the real IPv4 pseudo header, used for computing the TCP and UDP
- * checksums. For the Internet checksum, struct ipovly can be used instead.
- * For stronger checksums, the real thing must be used.
- */
-struct ippseudo {
- struct in_addr ippseudo_src; /* source internet address */
- struct in_addr ippseudo_dst; /* destination internet address */
- u_char ippseudo_pad; /* pad, must be zero */
- u_char ippseudo_p; /* protocol */
- u_short ippseudo_len; /* protocol length */
-};
-#endif
diff --git a/freebsd/netinet/ip6.h b/freebsd/netinet/ip6.h
deleted file mode 100644
index 26270d25..00000000
--- a/freebsd/netinet/ip6.h
+++ /dev/null
@@ -1,352 +0,0 @@
-/* $FreeBSD$ */
-/* $KAME: ip6.h,v 1.18 2001/03/29 05:34:30 itojun Exp $ */
-
-/*-
- * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*-
- * Copyright (c) 1982, 1986, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)ip.h 8.1 (Berkeley) 6/10/93
- */
-
-#ifndef _NETINET_IP6_HH_
-#define _NETINET_IP6_HH_
-
-/*
- * Definition for internet protocol version 6.
- * RFC 2460
- */
-
-struct ip6_hdr {
- union {
- struct ip6_hdrctl {
- u_int32_t ip6_un1_flow; /* 20 bits of flow-ID */
- u_int16_t ip6_un1_plen; /* payload length */
- u_int8_t ip6_un1_nxt; /* next header */
- u_int8_t ip6_un1_hlim; /* hop limit */
- } ip6_un1;
- u_int8_t ip6_un2_vfc; /* 4 bits version, top 4 bits class */
- } ip6_ctlun;
- struct in6_addr ip6_src; /* source address */
- struct in6_addr ip6_dst; /* destination address */
-} __packed;
-
-#define ip6_vfc ip6_ctlun.ip6_un2_vfc
-#define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow
-#define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen
-#define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt
-#define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim
-#define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim
-
-#define IPV6_VERSION 0x60
-#define IPV6_VERSION_MASK 0xf0
-
-#if BYTE_ORDER == BIG_ENDIAN
-#define IPV6_FLOWINFO_MASK 0x0fffffff /* flow info (28 bits) */
-#define IPV6_FLOWLABEL_MASK 0x000fffff /* flow label (20 bits) */
-#else
-#if BYTE_ORDER == LITTLE_ENDIAN
-#define IPV6_FLOWINFO_MASK 0xffffff0f /* flow info (28 bits) */
-#define IPV6_FLOWLABEL_MASK 0xffff0f00 /* flow label (20 bits) */
-#endif /* LITTLE_ENDIAN */
-#endif
-#if 1
-/* ECN bits proposed by Sally Floyd */
-#define IP6TOS_CE 0x01 /* congestion experienced */
-#define IP6TOS_ECT 0x02 /* ECN-capable transport */
-#endif
-
-/*
- * Extension Headers
- */
-
-struct ip6_ext {
- u_int8_t ip6e_nxt;
- u_int8_t ip6e_len;
-} __packed;
-
-/* Hop-by-Hop options header */
-/* XXX should we pad it to force alignment on an 8-byte boundary? */
-struct ip6_hbh {
- u_int8_t ip6h_nxt; /* next header */
- u_int8_t ip6h_len; /* length in units of 8 octets */
- /* followed by options */
-} __packed;
-
-/* Destination options header */
-/* XXX should we pad it to force alignment on an 8-byte boundary? */
-struct ip6_dest {
- u_int8_t ip6d_nxt; /* next header */
- u_int8_t ip6d_len; /* length in units of 8 octets */
- /* followed by options */
-} __packed;
-
-/* Option types and related macros */
-#define IP6OPT_PAD1 0x00 /* 00 0 00000 */
-#define IP6OPT_PADN 0x01 /* 00 0 00001 */
-#define IP6OPT_JUMBO 0xC2 /* 11 0 00010 = 194 */
-#define IP6OPT_NSAP_ADDR 0xC3 /* 11 0 00011 */
-#define IP6OPT_TUNNEL_LIMIT 0x04 /* 00 0 00100 */
-#ifndef _KERNEL
-#define IP6OPT_RTALERT 0x05 /* 00 0 00101 (KAME definition) */
-#endif
-#define IP6OPT_ROUTER_ALERT 0x05 /* 00 0 00101 (RFC3542, recommended) */
-
-#define IP6OPT_RTALERT_LEN 4
-#define IP6OPT_RTALERT_MLD 0 /* Datagram contains an MLD message */
-#define IP6OPT_RTALERT_RSVP 1 /* Datagram contains an RSVP message */
-#define IP6OPT_RTALERT_ACTNET 2 /* contains an Active Networks msg */
-#define IP6OPT_MINLEN 2
-
-#define IP6OPT_EID 0x8a /* 10 0 01010 */
-
-#define IP6OPT_TYPE(o) ((o) & 0xC0)
-#define IP6OPT_TYPE_SKIP 0x00
-#define IP6OPT_TYPE_DISCARD 0x40
-#define IP6OPT_TYPE_FORCEICMP 0x80
-#define IP6OPT_TYPE_ICMP 0xC0
-
-#define IP6OPT_MUTABLE 0x20
-
-/* IPv6 options: common part */
-struct ip6_opt {
- u_int8_t ip6o_type;
- u_int8_t ip6o_len;
-} __packed;
-
-/* Jumbo Payload Option */
-struct ip6_opt_jumbo {
- u_int8_t ip6oj_type;
- u_int8_t ip6oj_len;
- u_int8_t ip6oj_jumbo_len[4];
-} __packed;
-#define IP6OPT_JUMBO_LEN 6
-
-/* NSAP Address Option */
-struct ip6_opt_nsap {
- u_int8_t ip6on_type;
- u_int8_t ip6on_len;
- u_int8_t ip6on_src_nsap_len;
- u_int8_t ip6on_dst_nsap_len;
- /* followed by source NSAP */
- /* followed by destination NSAP */
-} __packed;
-
-/* Tunnel Limit Option */
-struct ip6_opt_tunnel {
- u_int8_t ip6ot_type;
- u_int8_t ip6ot_len;
- u_int8_t ip6ot_encap_limit;
-} __packed;
-
-/* Router Alert Option */
-struct ip6_opt_router {
- u_int8_t ip6or_type;
- u_int8_t ip6or_len;
- u_int8_t ip6or_value[2];
-} __packed;
-/* Router alert values (in network byte order) */
-#if BYTE_ORDER == BIG_ENDIAN
-#define IP6_ALERT_MLD 0x0000
-#define IP6_ALERT_RSVP 0x0001
-#define IP6_ALERT_AN 0x0002
-#else
-#if BYTE_ORDER == LITTLE_ENDIAN
-#define IP6_ALERT_MLD 0x0000
-#define IP6_ALERT_RSVP 0x0100
-#define IP6_ALERT_AN 0x0200
-#endif /* LITTLE_ENDIAN */
-#endif
-
-/* Routing header */
-struct ip6_rthdr {
- u_int8_t ip6r_nxt; /* next header */
- u_int8_t ip6r_len; /* length in units of 8 octets */
- u_int8_t ip6r_type; /* routing type */
- u_int8_t ip6r_segleft; /* segments left */
- /* followed by routing type specific data */
-} __packed;
-
-/* Type 0 Routing header, deprecated by RFC 5095. */
-struct ip6_rthdr0 {
- u_int8_t ip6r0_nxt; /* next header */
- u_int8_t ip6r0_len; /* length in units of 8 octets */
- u_int8_t ip6r0_type; /* always zero */
- u_int8_t ip6r0_segleft; /* segments left */
- u_int32_t ip6r0_reserved; /* reserved field */
- /* followed by up to 127 struct in6_addr */
-} __packed;
-
-/* Fragment header */
-struct ip6_frag {
- u_int8_t ip6f_nxt; /* next header */
- u_int8_t ip6f_reserved; /* reserved field */
- u_int16_t ip6f_offlg; /* offset, reserved, and flag */
- u_int32_t ip6f_ident; /* identification */
-} __packed;
-
-#if BYTE_ORDER == BIG_ENDIAN
-#define IP6F_OFF_MASK 0xfff8 /* mask out offset from _offlg */
-#define IP6F_RESERVED_MASK 0x0006 /* reserved bits in ip6f_offlg */
-#define IP6F_MORE_FRAG 0x0001 /* more-fragments flag */
-#else /* BYTE_ORDER == LITTLE_ENDIAN */
-#define IP6F_OFF_MASK 0xf8ff /* mask out offset from _offlg */
-#define IP6F_RESERVED_MASK 0x0600 /* reserved bits in ip6f_offlg */
-#define IP6F_MORE_FRAG 0x0100 /* more-fragments flag */
-#endif /* BYTE_ORDER == LITTLE_ENDIAN */
-
-/*
- * Internet implementation parameters.
- */
-#define IPV6_MAXHLIM 255 /* maximum hoplimit */
-#define IPV6_DEFHLIM 64 /* default hlim */
-#define IPV6_FRAGTTL 120 /* ttl for fragment packets, in slowtimo tick */
-#define IPV6_HLIMDEC 1 /* subtracted when forwarding */
-
-#define IPV6_MMTU 1280 /* minimal MTU and reassembly. 1024 + 256 */
-#define IPV6_MAXPACKET 65535 /* ip6 max packet size without Jumbo payload*/
-#define IPV6_MAXOPTHDR 2048 /* max option header size, 256 64-bit words */
-
-#ifdef _KERNEL
-/*
- * IP6_EXTHDR_CHECK ensures that region between the IP6 header and the
- * target header (including IPv6 itself, extension headers and
- * TCP/UDP/ICMP6 headers) are continuous. KAME requires drivers
- * to store incoming data into one internal mbuf or one or more external
- * mbufs(never into two or more internal mbufs). Thus, the third case is
- * supposed to never be matched but is prepared just in case.
- */
-
-#define IP6_EXTHDR_CHECK(m, off, hlen, ret) \
-do { \
- if ((m)->m_next != NULL) { \
- if (((m)->m_flags & M_LOOP) && \
- ((m)->m_len < (off) + (hlen)) && \
- (((m) = m_pullup((m), (off) + (hlen))) == NULL)) { \
- V_ip6stat.ip6s_exthdrtoolong++; \
- return ret; \
- } else if ((m)->m_flags & M_EXT) { \
- if ((m)->m_len < (off) + (hlen)) { \
- V_ip6stat.ip6s_exthdrtoolong++; \
- m_freem(m); \
- return ret; \
- } \
- } else { \
- if ((m)->m_len < (off) + (hlen)) { \
- V_ip6stat.ip6s_exthdrtoolong++; \
- m_freem(m); \
- return ret; \
- } \
- } \
- } else { \
- if ((m)->m_len < (off) + (hlen)) { \
- V_ip6stat.ip6s_tooshort++; \
- in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_truncated); \
- m_freem(m); \
- return ret; \
- } \
- } \
-} while (/*CONSTCOND*/ 0)
-
-/*
- * IP6_EXTHDR_GET ensures that intermediate protocol header (from "off" to
- * "len") is located in single mbuf, on contiguous memory region.
- * The pointer to the region will be returned to pointer variable "val",
- * with type "typ".
- * IP6_EXTHDR_GET0 does the same, except that it aligns the structure at the
- * very top of mbuf. GET0 is likely to make memory copy than GET.
- *
- * XXX we're now testing this, needs m_pulldown()
- */
-#define IP6_EXTHDR_GET(val, typ, m, off, len) \
-do { \
- struct mbuf *t; \
- int tmp; \
- if ((m)->m_len >= (off) + (len)) \
- (val) = (typ)(mtod((m), caddr_t) + (off)); \
- else { \
- t = m_pulldown((m), (off), (len), &tmp); \
- if (t) { \
- if (t->m_len < tmp + (len)) \
- panic("m_pulldown malfunction"); \
- (val) = (typ)(mtod(t, caddr_t) + tmp); \
- } else { \
- (val) = (typ)NULL; \
- (m) = NULL; \
- } \
- } \
-} while (/*CONSTCOND*/ 0)
-
-#define IP6_EXTHDR_GET0(val, typ, m, off, len) \
-do { \
- struct mbuf *t; \
- if ((off) == 0) \
- (val) = (typ)mtod(m, caddr_t); \
- else { \
- t = m_pulldown((m), (off), (len), NULL); \
- if (t) { \
- if (t->m_len < (len)) \
- panic("m_pulldown malfunction"); \
- (val) = (typ)mtod(t, caddr_t); \
- } else { \
- (val) = (typ)NULL; \
- (m) = NULL; \
- } \
- } \
-} while (/*CONSTCOND*/ 0)
-
-#endif /*_KERNEL*/
-
-#endif /* not _NETINET_IP6_HH_ */
diff --git a/freebsd/netinet/ip_icmp.h b/freebsd/netinet/ip_icmp.h
deleted file mode 100644
index 05579242..00000000
--- a/freebsd/netinet/ip_icmp.h
+++ /dev/null
@@ -1,214 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93
- * $FreeBSD$
- */
-
-#ifndef _NETINET_IP_ICMP_HH_
-#define _NETINET_IP_ICMP_HH_
-
-/*
- * Interface Control Message Protocol Definitions.
- * Per RFC 792, September 1981.
- */
-
-/*
- * Internal of an ICMP Router Advertisement
- */
-struct icmp_ra_addr {
- u_int32_t ira_addr;
- u_int32_t ira_preference;
-};
-
-/*
- * Structure of an icmp header.
- */
-struct icmphdr {
- u_char icmp_type; /* type of message, see below */
- u_char icmp_code; /* type sub code */
- u_short icmp_cksum; /* ones complement cksum of struct */
-};
-
-/*
- * Structure of an icmp packet.
- *
- * XXX: should start with a struct icmphdr.
- */
-struct icmp {
- u_char icmp_type; /* type of message, see below */
- u_char icmp_code; /* type sub code */
- u_short icmp_cksum; /* ones complement cksum of struct */
- union {
- u_char ih_pptr; /* ICMP_PARAMPROB */
- struct in_addr ih_gwaddr; /* ICMP_REDIRECT */
- struct ih_idseq {
- uint16_t icd_id; /* network format */
- uint16_t icd_seq; /* network format */
- } ih_idseq;
- int ih_void;
-
- /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
- struct ih_pmtu {
- uint16_t ipm_void; /* network format */
- uint16_t ipm_nextmtu; /* network format */
- } ih_pmtu;
-
- struct ih_rtradv {
- u_char irt_num_addrs;
- u_char irt_wpa;
- u_int16_t irt_lifetime;
- } ih_rtradv;
- } icmp_hun;
-#define icmp_pptr icmp_hun.ih_pptr
-#define icmp_gwaddr icmp_hun.ih_gwaddr
-#define icmp_id icmp_hun.ih_idseq.icd_id
-#define icmp_seq icmp_hun.ih_idseq.icd_seq
-#define icmp_void icmp_hun.ih_void
-#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void
-#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu
-#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs
-#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa
-#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime
- union {
- struct id_ts { /* ICMP Timestamp */
- /*
- * The next 3 fields are in network format,
- * milliseconds since 00:00 GMT
- */
- uint32_t its_otime; /* Originate */
- uint32_t its_rtime; /* Receive */
- uint32_t its_ttime; /* Transmit */
- } id_ts;
- struct id_ip {
- struct ip idi_ip;
- /* options and then 64 bits of data */
- } id_ip;
- struct icmp_ra_addr id_radv;
- u_int32_t id_mask;
- char id_data[1];
- } icmp_dun;
-#define icmp_otime icmp_dun.id_ts.its_otime
-#define icmp_rtime icmp_dun.id_ts.its_rtime
-#define icmp_ttime icmp_dun.id_ts.its_ttime
-#define icmp_ip icmp_dun.id_ip.idi_ip
-#define icmp_radv icmp_dun.id_radv
-#define icmp_mask icmp_dun.id_mask
-#define icmp_data icmp_dun.id_data
-};
-
-/*
- * Lower bounds on packet lengths for various types.
- * For the error advice packets must first insure that the
- * packet is large enough to contain the returned ip header.
- * Only then can we do the check to see if 64 bits of packet
- * data have been returned, since we need to check the returned
- * ip header length.
- */
-#define ICMP_MINLEN 8 /* abs minimum */
-#define ICMP_TSLEN (8 + 3 * sizeof (uint32_t)) /* timestamp */
-#define ICMP_MASKLEN 12 /* address mask */
-#define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */
-#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8)
- /* N.B.: must separately check that ip_hl >= 5 */
-
-/*
- * Definition of type and code field values.
- */
-#define ICMP_ECHOREPLY 0 /* echo reply */
-#define ICMP_UNREACH 3 /* dest unreachable, codes: */
-#define ICMP_UNREACH_NET 0 /* bad net */
-#define ICMP_UNREACH_HOST 1 /* bad host */
-#define ICMP_UNREACH_PROTOCOL 2 /* bad protocol */
-#define ICMP_UNREACH_PORT 3 /* bad port */
-#define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */
-#define ICMP_UNREACH_SRCFAIL 5 /* src route failed */
-#define ICMP_UNREACH_NET_UNKNOWN 6 /* unknown net */
-#define ICMP_UNREACH_HOST_UNKNOWN 7 /* unknown host */
-#define ICMP_UNREACH_ISOLATED 8 /* src host isolated */
-#define ICMP_UNREACH_NET_PROHIB 9 /* prohibited access */
-#define ICMP_UNREACH_HOST_PROHIB 10 /* ditto */
-#define ICMP_UNREACH_TOSNET 11 /* bad tos for net */
-#define ICMP_UNREACH_TOSHOST 12 /* bad tos for host */
-#define ICMP_UNREACH_FILTER_PROHIB 13 /* admin prohib */
-#define ICMP_UNREACH_HOST_PRECEDENCE 14 /* host prec vio. */
-#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 /* prec cutoff */
-#define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */
-#define ICMP_REDIRECT 5 /* shorter route, codes: */
-#define ICMP_REDIRECT_NET 0 /* for network */
-#define ICMP_REDIRECT_HOST 1 /* for host */
-#define ICMP_REDIRECT_TOSNET 2 /* for tos and net */
-#define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */
-#define ICMP_ALTHOSTADDR 6 /* alternate host address */
-#define ICMP_ECHO 8 /* echo service */
-#define ICMP_ROUTERADVERT 9 /* router advertisement */
-#define ICMP_ROUTERADVERT_NORMAL 0 /* normal advertisement */
-#define ICMP_ROUTERADVERT_NOROUTE_COMMON 16 /* selective routing */
-#define ICMP_ROUTERSOLICIT 10 /* router solicitation */
-#define ICMP_TIMXCEED 11 /* time exceeded, code: */
-#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */
-#define ICMP_TIMXCEED_REASS 1 /* ttl==0 in reass */
-#define ICMP_PARAMPROB 12 /* ip header bad */
-#define ICMP_PARAMPROB_ERRATPTR 0 /* error at param ptr */
-#define ICMP_PARAMPROB_OPTABSENT 1 /* req. opt. absent */
-#define ICMP_PARAMPROB_LENGTH 2 /* bad length */
-#define ICMP_TSTAMP 13 /* timestamp request */
-#define ICMP_TSTAMPREPLY 14 /* timestamp reply */
-#define ICMP_IREQ 15 /* information request */
-#define ICMP_IREQREPLY 16 /* information reply */
-#define ICMP_MASKREQ 17 /* address mask request */
-#define ICMP_MASKREPLY 18 /* address mask reply */
-#define ICMP_TRACEROUTE 30 /* traceroute */
-#define ICMP_DATACONVERR 31 /* data conversion error */
-#define ICMP_MOBILE_REDIRECT 32 /* mobile host redirect */
-#define ICMP_IPV6_WHEREAREYOU 33 /* IPv6 where-are-you */
-#define ICMP_IPV6_IAMHERE 34 /* IPv6 i-am-here */
-#define ICMP_MOBILE_REGREQUEST 35 /* mobile registration req */
-#define ICMP_MOBILE_REGREPLY 36 /* mobile registration reply */
-#define ICMP_SKIP 39 /* SKIP */
-#define ICMP_PHOTURIS 40 /* Photuris */
-#define ICMP_PHOTURIS_UNKNOWN_INDEX 1 /* unknown sec index */
-#define ICMP_PHOTURIS_AUTH_FAILED 2 /* auth failed */
-#define ICMP_PHOTURIS_DECRYPT_FAILED 3 /* decrypt failed */
-
-#define ICMP_MAXTYPE 40
-
-#define ICMP_INFOTYPE(type) \
- ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
- (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \
- (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \
- (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
- (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
-
-#ifdef _KERNEL
-void icmp_error(struct mbuf *, int, int, uint32_t, int);
-void icmp_input(struct mbuf *, int);
-int ip_next_mtu(int, int);
-#endif
-
-#endif
diff --git a/freebsd/netinet/tcp.h b/freebsd/netinet/tcp.h
deleted file mode 100644
index b4f21658..00000000
--- a/freebsd/netinet/tcp.h
+++ /dev/null
@@ -1,226 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)tcp.h 8.1 (Berkeley) 6/10/93
- * $FreeBSD$
- */
-
-#ifndef _NETINET_TCP_HH_
-#define _NETINET_TCP_HH_
-
-#include <freebsd/sys/cdefs.h>
-
-#if __BSD_VISIBLE
-
-typedef u_int32_t tcp_seq;
-
-#define tcp6_seq tcp_seq /* for KAME src sync over BSD*'s */
-#define tcp6hdr tcphdr /* for KAME src sync over BSD*'s */
-
-/*
- * TCP header.
- * Per RFC 793, September, 1981.
- */
-struct tcphdr {
- u_short th_sport; /* source port */
- u_short th_dport; /* destination port */
- tcp_seq th_seq; /* sequence number */
- tcp_seq th_ack; /* acknowledgement number */
-#if BYTE_ORDER == LITTLE_ENDIAN
- u_int th_x2:4, /* (unused) */
- th_off:4; /* data offset */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- u_int th_off:4, /* data offset */
- th_x2:4; /* (unused) */
-#endif
- u_char th_flags;
-#define TH_FIN 0x01
-#define TH_SYN 0x02
-#define TH_RST 0x04
-#define TH_PUSH 0x08
-#define TH_ACK 0x10
-#define TH_URG 0x20
-#define TH_ECE 0x40
-#define TH_CWR 0x80
-#define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_PUSH|TH_ACK|TH_URG|TH_ECE|TH_CWR)
-#define PRINT_TH_FLAGS "\20\1FIN\2SYN\3RST\4PUSH\5ACK\6URG\7ECE\10CWR"
-
- u_short th_win; /* window */
- u_short th_sum; /* checksum */
- u_short th_urp; /* urgent pointer */
-};
-
-#define TCPOPT_EOL 0
-#define TCPOLEN_EOL 1
-#define TCPOPT_PAD 0 /* padding after EOL */
-#define TCPOLEN_PAD 1
-#define TCPOPT_NOP 1
-#define TCPOLEN_NOP 1
-#define TCPOPT_MAXSEG 2
-#define TCPOLEN_MAXSEG 4
-#define TCPOPT_WINDOW 3
-#define TCPOLEN_WINDOW 3
-#define TCPOPT_SACK_PERMITTED 4
-#define TCPOLEN_SACK_PERMITTED 2
-#define TCPOPT_SACK 5
-#define TCPOLEN_SACKHDR 2
-#define TCPOLEN_SACK 8 /* 2*sizeof(tcp_seq) */
-#define TCPOPT_TIMESTAMP 8
-#define TCPOLEN_TIMESTAMP 10
-#define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */
-#define TCPOPT_SIGNATURE 19 /* Keyed MD5: RFC 2385 */
-#define TCPOLEN_SIGNATURE 18
-
-/* Miscellaneous constants */
-#define MAX_SACK_BLKS 6 /* Max # SACK blocks stored at receiver side */
-#define TCP_MAX_SACK 4 /* MAX # SACKs sent in any segment */
-
-
-/*
- * Default maximum segment size for TCP.
- * With an IP MTU of 576, this is 536,
- * but 512 is probably more convenient.
- * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)).
- */
-#define TCP_MSS 512
-/*
- * TCP_MINMSS is defined to be 216 which is fine for the smallest
- * link MTU (256 bytes, AX.25 packet radio) in the Internet.
- * However it is very unlikely to come across such low MTU interfaces
- * these days (anno dato 2003).
- * See tcp_subr.c tcp_minmss SYSCTL declaration for more comments.
- * Setting this to "0" disables the minmss check.
- */
-#define TCP_MINMSS 216
-
-/*
- * Default maximum segment size for TCP6.
- * With an IP6 MSS of 1280, this is 1220,
- * but 1024 is probably more convenient. (xxx kazu in doubt)
- * This should be defined as MIN(1024, IP6_MSS - sizeof (struct tcpip6hdr))
- */
-#define TCP6_MSS 1024
-
-#define TCP_MAXWIN 65535 /* largest value for (unscaled) window */
-#define TTCP_CLIENT_SND_WND 4096 /* dflt send window for T/TCP client */
-
-#define TCP_MAX_WINSHIFT 14 /* maximum window shift */
-
-#define TCP_MAXBURST 4 /* maximum segments in a burst */
-
-#define TCP_MAXHLEN (0xf<<2) /* max length of header in bytes */
-#define TCP_MAXOLEN (TCP_MAXHLEN - sizeof(struct tcphdr))
- /* max space left for options */
-#endif /* __BSD_VISIBLE */
-
-/*
- * User-settable options (used with setsockopt).
- */
-#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */
-#if __BSD_VISIBLE
-#define TCP_MAXSEG 0x02 /* set maximum segment size */
-#define TCP_NOPUSH 0x04 /* don't push last block of write */
-#define TCP_NOOPT 0x08 /* don't use TCP options */
-#define TCP_MD5SIG 0x10 /* use MD5 digests (RFC2385) */
-#define TCP_INFO 0x20 /* retrieve tcp_info structure */
-#define TCP_CONGESTION 0x40 /* get/set congestion control algorithm */
-
-#define TCP_CA_NAME_MAX 16 /* max congestion control name length */
-
-#define TCPI_OPT_TIMESTAMPS 0x01
-#define TCPI_OPT_SACK 0x02
-#define TCPI_OPT_WSCALE 0x04
-#define TCPI_OPT_ECN 0x08
-#define TCPI_OPT_TOE 0x10
-
-/*
- * The TCP_INFO socket option comes from the Linux 2.6 TCP API, and permits
- * the caller to query certain information about the state of a TCP
- * connection. We provide an overlapping set of fields with the Linux
- * implementation, but since this is a fixed size structure, room has been
- * left for growth. In order to maximize potential future compatibility with
- * the Linux API, the same variable names and order have been adopted, and
- * padding left to make room for omitted fields in case they are added later.
- *
- * XXX: This is currently an unstable ABI/API, in that it is expected to
- * change.
- */
-struct tcp_info {
- u_int8_t tcpi_state; /* TCP FSM state. */
- u_int8_t __tcpi_ca_state;
- u_int8_t __tcpi_retransmits;
- u_int8_t __tcpi_probes;
- u_int8_t __tcpi_backoff;
- u_int8_t tcpi_options; /* Options enabled on conn. */
- u_int8_t tcpi_snd_wscale:4, /* RFC1323 send shift value. */
- tcpi_rcv_wscale:4; /* RFC1323 recv shift value. */
-
- u_int32_t tcpi_rto; /* Retransmission timeout (usec). */
- u_int32_t __tcpi_ato;
- u_int32_t tcpi_snd_mss; /* Max segment size for send. */
- u_int32_t tcpi_rcv_mss; /* Max segment size for receive. */
-
- u_int32_t __tcpi_unacked;
- u_int32_t __tcpi_sacked;
- u_int32_t __tcpi_lost;
- u_int32_t __tcpi_retrans;
- u_int32_t __tcpi_fackets;
-
- /* Times; measurements in usecs. */
- u_int32_t __tcpi_last_data_sent;
- u_int32_t __tcpi_last_ack_sent; /* Also unimpl. on Linux? */
- u_int32_t tcpi_last_data_recv; /* Time since last recv data. */
- u_int32_t __tcpi_last_ack_recv;
-
- /* Metrics; variable units. */
- u_int32_t __tcpi_pmtu;
- u_int32_t __tcpi_rcv_ssthresh;
- u_int32_t tcpi_rtt; /* Smoothed RTT in usecs. */
- u_int32_t tcpi_rttvar; /* RTT variance in usecs. */
- u_int32_t tcpi_snd_ssthresh; /* Slow start threshold. */
- u_int32_t tcpi_snd_cwnd; /* Send congestion window. */
- u_int32_t __tcpi_advmss;
- u_int32_t __tcpi_reordering;
-
- u_int32_t __tcpi_rcv_rtt;
- u_int32_t tcpi_rcv_space; /* Advertised recv window. */
-
- /* FreeBSD extensions to tcp_info. */
- u_int32_t tcpi_snd_wnd; /* Advertised send window. */
- u_int32_t tcpi_snd_bwnd; /* Bandwidth send window. */
- u_int32_t tcpi_snd_nxt; /* Next egress seqno */
- u_int32_t tcpi_rcv_nxt; /* Next ingress seqno */
- u_int32_t tcpi_toe_tid; /* HWTID for TOE endpoints */
-
- /* Padding to grow without breaking ABI. */
- u_int32_t __tcpi_pad[29]; /* Padding. */
-};
-#endif
-
-#endif /* !_NETINET_TCP_HH_ */
diff --git a/freebsd/sbin/dhclient/bpf.c b/freebsd/sbin/dhclient/bpf.c
index 7f87ddf5..9f8e45fb 100644
--- a/freebsd/sbin/dhclient/bpf.c
+++ b/freebsd/sbin/dhclient/bpf.c
@@ -47,13 +47,8 @@ __FBSDID("$FreeBSD$");
#include <sys/ioctl.h>
#include <sys/uio.h>
-#ifdef __rtems__
-#include <freebsd/net/bpf.h>
-#include <freebsd/netinet/in_systm.h>
-#else
#include <net/bpf.h>
#include <netinet/in_systm.h>
-#endif
#include <netinet/ip.h>
#include <netinet/udp.h>
#include <netinet/if_ether.h>
diff --git a/freebsd/sbin/dhclient/dhclient.c b/freebsd/sbin/dhclient/dhclient.c
index f3c1259d..b72d5bff 100644
--- a/freebsd/sbin/dhclient/dhclient.c
+++ b/freebsd/sbin/dhclient/dhclient.c
@@ -59,11 +59,7 @@ __FBSDID("$FreeBSD$");
#include "dhcpd.h"
#include "privsep.h"
-#ifdef __rtems__
-#include <freebsd/net80211/ieee80211_freebsd.h>
-#else
#include <net80211/ieee80211_freebsd.h>
-#endif
#ifndef _PATH_VAREMPTY
#define _PATH_VAREMPTY "/var/empty"
@@ -422,6 +418,10 @@ main(int argc, char *argv[])
close(pipe_fd[0]);
privfd = pipe_fd[1];
+#ifdef __rtems__
+/* FIXME: Add O_EXLOCK capabilities to RTEMS file system */
+#define O_EXLOCK 0
+#endif /* __rtems__ */
if ((fd = open(path_dhclient_db, O_RDONLY|O_EXLOCK|O_CREAT, 0)) == -1)
error("can't open and lock %s: %m", path_dhclient_db);
read_client_leases();
diff --git a/freebsd/sbin/dhclient/dhcpd.h b/freebsd/sbin/dhclient/dhcpd.h
index bd4c9c0b..0c47a9f8 100644
--- a/freebsd/sbin/dhclient/dhcpd.h
+++ b/freebsd/sbin/dhclient/dhcpd.h
@@ -41,12 +41,12 @@
* $FreeBSD$
*/
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/socket.h>
#include <sys/sockio.h>
#include <sys/stat.h>
-#include <sys/time.h>
+#include <rtems/bsd/sys/time.h>
#include <sys/un.h>
#include <sys/wait.h>
diff --git a/freebsd/sbin/dhclient/dispatch.c b/freebsd/sbin/dhclient/dispatch.c
index b04d488f..3ee0cf6c 100644
--- a/freebsd/sbin/dhclient/dispatch.c
+++ b/freebsd/sbin/dhclient/dispatch.c
@@ -46,11 +46,7 @@ __FBSDID("$FreeBSD$");
#include <sys/ioctl.h>
-#ifdef __rtems__
-#include <freebsd/net/if_media.h>
-#else
#include <net/if_media.h>
-#endif
#include <ifaddrs.h>
#include <poll.h>
diff --git a/freebsd/sbin/dhclient/privsep.h b/freebsd/sbin/dhclient/privsep.h
index f30284ee..1f778bba 100644
--- a/freebsd/sbin/dhclient/privsep.h
+++ b/freebsd/sbin/dhclient/privsep.h
@@ -16,7 +16,7 @@
* OF OR IN CONNECTION WITH THE USE, ABUSE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <poll.h>
#include <pwd.h>
diff --git a/freebsd/sbin/ifconfig/af_atalk.c b/freebsd/sbin/ifconfig/af_atalk.c
index c50e0fd1..4890ded9 100644
--- a/freebsd/sbin/ifconfig/af_atalk.c
+++ b/freebsd/sbin/ifconfig/af_atalk.c
@@ -32,7 +32,7 @@ static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if.h>
diff --git a/freebsd/sbin/ifconfig/af_inet.c b/freebsd/sbin/ifconfig/af_inet.c
index 65488a35..3ef6c1a1 100644
--- a/freebsd/sbin/ifconfig/af_inet.c
+++ b/freebsd/sbin/ifconfig/af_inet.c
@@ -32,7 +32,7 @@ static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if.h>
@@ -46,22 +46,13 @@ static const char rcsid[] =
#include <ifaddrs.h>
#include <netinet/in.h>
-#ifdef __rtems__
-#include <freebsd/net/if_var.h> /* for struct ifaddr */
-#include <freebsd/netinet/in_var.h>
-#else
#include <net/if_var.h> /* for struct ifaddr */
#include <netinet/in_var.h>
-#endif
#include <arpa/inet.h>
#include <netdb.h>
#include "ifconfig.h"
-#ifdef __rtems__
-#include <freebsd/sys/sockio.h>
-#endif
-
static struct in_aliasreq in_addreq;
static struct ifreq in_ridreq;
diff --git a/freebsd/sbin/ifconfig/af_inet6.c b/freebsd/sbin/ifconfig/af_inet6.c
index ff0df5b0..9eadbec1 100644
--- a/freebsd/sbin/ifconfig/af_inet6.c
+++ b/freebsd/sbin/ifconfig/af_inet6.c
@@ -32,7 +32,7 @@ static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if.h>
@@ -47,21 +47,12 @@ static const char rcsid[] =
#include <arpa/inet.h>
#include <netinet/in.h>
-#ifdef __rtems__
-#include <freebsd/net/if_var.h> /* for struct ifaddr */
-#include <freebsd/netinet/in_var.h>
-#else
#include <net/if_var.h> /* for struct ifaddr */
#include <netinet/in_var.h>
-#endif
#include <arpa/inet.h>
#include <netdb.h>
-#ifdef __rtems__
-#include <freebsd/netinet6/nd6.h> /* Define ND6_INFINITE_LIFETIME */
-#else
#include <netinet6/nd6.h> /* Define ND6_INFINITE_LIFETIME */
-#endif
#include "ifconfig.h"
diff --git a/freebsd/sbin/ifconfig/af_link.c b/freebsd/sbin/ifconfig/af_link.c
index 2de85045..b7a7fecf 100644
--- a/freebsd/sbin/ifconfig/af_link.c
+++ b/freebsd/sbin/ifconfig/af_link.c
@@ -32,7 +32,7 @@ static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if.h>
@@ -49,10 +49,6 @@ static const char rcsid[] =
#include "ifconfig.h"
-#ifdef __rtems__
-#include <freebsd/sys/sockio.h>
-#endif
-
static struct ifreq link_ridreq;
static void
diff --git a/freebsd/sbin/ifconfig/af_nd6.c b/freebsd/sbin/ifconfig/af_nd6.c
index 74820732..55adba49 100644
--- a/freebsd/sbin/ifconfig/af_nd6.c
+++ b/freebsd/sbin/ifconfig/af_nd6.c
@@ -28,7 +28,7 @@ static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
@@ -46,21 +46,12 @@ static const char rcsid[] =
#include <arpa/inet.h>
#include <netinet/in.h>
-#ifdef __rtems__
-#include <freebsd/net/if_var.h>
-#include <freebsd/netinet/in_var.h>
-#else
#include <net/if_var.h>
#include <netinet/in_var.h>
-#endif
#include <arpa/inet.h>
#include <netdb.h>
-#ifdef __rtems__
-#include <freebsd/netinet6/nd6.h>
-#else
#include <netinet6/nd6.h>
-#endif
#include "ifconfig.h"
diff --git a/freebsd/sbin/ifconfig/ifbridge.c b/freebsd/sbin/ifconfig/ifbridge.c
index 049a0e7c..98df1820 100644
--- a/freebsd/sbin/ifconfig/ifbridge.c
+++ b/freebsd/sbin/ifconfig/ifbridge.c
@@ -38,7 +38,7 @@ static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/sockio.h>
@@ -48,11 +48,7 @@ static const char rcsid[] =
#include <net/ethernet.h>
#include <net/if.h>
-#ifdef __rtems__
-#include <freebsd/net/if_bridgevar.h>
-#else
#include <net/if_bridgevar.h>
-#endif
#include <net/route.h>
#include <ctype.h>
@@ -65,10 +61,6 @@ static const char rcsid[] =
#include "ifconfig.h"
-#ifdef __rtems__
-#include <freebsd/sys/sockio.h>
-#endif
-
#define PV2ID(pv, epri, eaddr) do { \
epri = pv >> 48; \
eaddr[0] = pv >> 40; \
diff --git a/freebsd/sbin/ifconfig/ifcarp.c b/freebsd/sbin/ifconfig/ifcarp.c
index 6c8c5a1b..89128a09 100644
--- a/freebsd/sbin/ifconfig/ifcarp.c
+++ b/freebsd/sbin/ifconfig/ifcarp.c
@@ -27,7 +27,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/sockio.h>
@@ -37,11 +37,7 @@
#include <net/ethernet.h>
#include <net/if.h>
-#ifdef __rtems__
-#include <freebsd/netinet/ip_carp.h>
-#else
#include <netinet/ip_carp.h>
-#endif
#include <net/route.h>
#include <ctype.h>
diff --git a/freebsd/sbin/ifconfig/ifclone.c b/freebsd/sbin/ifconfig/ifclone.c
index 7929208b..2d49780d 100644
--- a/freebsd/sbin/ifconfig/ifclone.c
+++ b/freebsd/sbin/ifconfig/ifclone.c
@@ -33,7 +33,7 @@ static const char rcsid[] =
#endif /* not lint */
#include <sys/queue.h>
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if.h>
@@ -46,10 +46,6 @@ static const char rcsid[] =
#include "ifconfig.h"
-#ifdef __rtems__
-#include <freebsd/sys/sockio.h>
-#endif
-
static void
list_cloners(void)
{
diff --git a/freebsd/sbin/ifconfig/ifconfig.c b/freebsd/sbin/ifconfig/ifconfig.c
index afc952af..5ea94671 100644
--- a/freebsd/sbin/ifconfig/ifconfig.c
+++ b/freebsd/sbin/ifconfig/ifconfig.c
@@ -45,36 +45,23 @@ static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
-#include <sys/time.h>
-#ifdef __rtems__
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/linker.h>
-#else
+#include <rtems/bsd/sys/time.h>
#include <sys/module.h>
#include <sys/linker.h>
-#endif
#include <net/ethernet.h>
#include <net/if.h>
-#ifdef __rtems__
-#include <freebsd/net/if_var.h>
-#else
#include <net/if_var.h>
-#endif
#include <net/if_dl.h>
#include <net/if_types.h>
#include <net/route.h>
/* IP */
#include <netinet/in.h>
-#ifdef __rtems__
-#include <freebsd/netinet/in_var.h>
-#else
#include <netinet/in_var.h>
-#endif
#include <arpa/inet.h>
#include <netdb.h>
diff --git a/freebsd/sbin/ifconfig/ifconfig.h b/freebsd/sbin/ifconfig/ifconfig.h
index 479bc2ad..150367f7 100644
--- a/freebsd/sbin/ifconfig/ifconfig.h
+++ b/freebsd/sbin/ifconfig/ifconfig.h
@@ -34,10 +34,6 @@
* $FreeBSD$
*/
-#ifdef __rtems__
-#include <freebsd/sys/sockio.h>
-#endif
-
#define __constructor __attribute__((constructor))
struct afswtch;
diff --git a/freebsd/sbin/ifconfig/ifgif.c b/freebsd/sbin/ifconfig/ifgif.c
index d23b384b..1fe6f426 100644
--- a/freebsd/sbin/ifconfig/ifgif.c
+++ b/freebsd/sbin/ifconfig/ifgif.c
@@ -28,7 +28,7 @@ static const char rcsid[] =
"$FreeBSD$";
#endif
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/sockio.h>
@@ -38,11 +38,7 @@ static const char rcsid[] =
#include <net/ethernet.h>
#include <net/if.h>
-#ifdef __rtems__
-#include <freebsd/net/if_gif.h>
-#else
#include <net/if_gif.h>
-#endif
#include <net/route.h>
#include <ctype.h>
diff --git a/freebsd/sbin/ifconfig/ifgre.c b/freebsd/sbin/ifconfig/ifgre.c
index 58d5bcf5..db871e3d 100644
--- a/freebsd/sbin/ifconfig/ifgre.c
+++ b/freebsd/sbin/ifconfig/ifgre.c
@@ -28,7 +28,7 @@ static const char rcsid[] =
"$FreeBSD$";
#endif
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/sockio.h>
@@ -38,11 +38,7 @@ static const char rcsid[] =
#include <net/ethernet.h>
#include <net/if.h>
-#ifdef __rtems__
-#include <freebsd/net/if_gre.h>
-#else
#include <net/if_gre.h>
-#endif
#include <net/route.h>
#include <ctype.h>
diff --git a/freebsd/sbin/ifconfig/ifgroup.c b/freebsd/sbin/ifconfig/ifgroup.c
index 2de03e73..0c328e94 100644
--- a/freebsd/sbin/ifconfig/ifgroup.c
+++ b/freebsd/sbin/ifconfig/ifgroup.c
@@ -28,7 +28,7 @@ static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if.h>
diff --git a/freebsd/sbin/ifconfig/ifieee80211.c b/freebsd/sbin/ifconfig/ifieee80211.c
index 57713ca4..a4bb59fb 100644
--- a/freebsd/sbin/ifconfig/ifieee80211.c
+++ b/freebsd/sbin/ifconfig/ifieee80211.c
@@ -64,36 +64,24 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
-#include <sys/time.h>
+#include <rtems/bsd/sys/time.h>
#include <net/ethernet.h>
#include <net/if.h>
#include <net/if_dl.h>
#include <net/if_types.h>
-#ifdef __rtems__
-#include <freebsd/net/if_media.h>
-#else
#include <net/if_media.h>
-#endif
#include <net/route.h>
-#ifdef __rtems__
-#include <freebsd/net80211/ieee80211_ioctl.h>
-#include <freebsd/net80211/ieee80211_freebsd.h>
-#include <freebsd/net80211/ieee80211_superg.h>
-#include <freebsd/net80211/ieee80211_tdma.h>
-#include <freebsd/net80211/ieee80211_mesh.h>
-#else
#include <net80211/ieee80211_ioctl.h>
#include <net80211/ieee80211_freebsd.h>
#include <net80211/ieee80211_superg.h>
#include <net80211/ieee80211_tdma.h>
#include <net80211/ieee80211_mesh.h>
-#endif
#include <assert.h>
#include <ctype.h>
diff --git a/freebsd/sbin/ifconfig/iflagg.c b/freebsd/sbin/ifconfig/iflagg.c
index 4204d929..d2b62122 100644
--- a/freebsd/sbin/ifconfig/iflagg.c
+++ b/freebsd/sbin/ifconfig/iflagg.c
@@ -6,7 +6,7 @@ static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/sockio.h>
@@ -16,11 +16,7 @@ static const char rcsid[] =
#include <net/ethernet.h>
#include <net/if.h>
-#ifdef __rtems__
-#include <freebsd/net/if_lagg.h>
-#else
#include <net/if_lagg.h>
-#endif
#include <net/route.h>
#include <ctype.h>
diff --git a/freebsd/sbin/ifconfig/ifmac.c b/freebsd/sbin/ifconfig/ifmac.c
index 31d40b13..be7787c0 100644
--- a/freebsd/sbin/ifconfig/ifmac.c
+++ b/freebsd/sbin/ifconfig/ifmac.c
@@ -34,13 +34,9 @@
* $FreeBSD$
*/
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/ioctl.h>
-#ifdef __rtems__
-#include <freebsd/sys/mac.h>
-#else
#include <sys/mac.h>
-#endif
#include <sys/socket.h>
#include <sys/sockio.h>
diff --git a/freebsd/sbin/ifconfig/ifmedia.c b/freebsd/sbin/ifconfig/ifmedia.c
index ebca67de..518bcc4f 100644
--- a/freebsd/sbin/ifconfig/ifmedia.c
+++ b/freebsd/sbin/ifconfig/ifmedia.c
@@ -66,25 +66,16 @@
* SUCH DAMAGE.
*/
-
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
-#include <sys/time.h>
+#include <rtems/bsd/sys/time.h>
#include <net/if.h>
#include <net/if_dl.h>
#include <net/if_types.h>
-
-#ifdef __rtems__
-#define _KERNEL
-#include <freebsd/net/if_media.h>
-#undef _KERNEL
-#else
#include <net/if_media.h>
-#endif
-
#include <net/route.h>
#include <ctype.h>
diff --git a/freebsd/sbin/ifconfig/ifpfsync.c b/freebsd/sbin/ifconfig/ifpfsync.c
index 886a75e6..c0b86a9b 100644
--- a/freebsd/sbin/ifconfig/ifpfsync.c
+++ b/freebsd/sbin/ifconfig/ifpfsync.c
@@ -26,19 +26,14 @@
* $FreeBSD$
*/
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
-#ifdef __rtems__
-#include <freebsd/net/pfvar.h>
-#include <freebsd/net/if_pfsync.h>
-#else
#include <net/pfvar.h>
#include <net/if_pfsync.h>
-#endif
#include <net/route.h>
#include <arpa/inet.h>
diff --git a/freebsd/sbin/ifconfig/ifvlan.c b/freebsd/sbin/ifconfig/ifvlan.c
index 8ec3766f..b8f761d4 100644
--- a/freebsd/sbin/ifconfig/ifvlan.c
+++ b/freebsd/sbin/ifconfig/ifvlan.c
@@ -30,7 +30,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/sockio.h>
@@ -40,13 +40,8 @@
#include <net/ethernet.h>
#include <net/if.h>
-#ifdef __rtems__
-#include <freebsd/net/if_var.h>
-#include <freebsd/net/if_vlan_var.h>
-#else
#include <net/if_var.h>
#include <net/if_vlan_var.h>
-#endif
#include <net/route.h>
#include <ctype.h>
diff --git a/freebsd/sbin/ifconfig/regdomain.h b/freebsd/sbin/ifconfig/regdomain.h
index 81588752..cfc2be02 100644
--- a/freebsd/sbin/ifconfig/regdomain.h
+++ b/freebsd/sbin/ifconfig/regdomain.h
@@ -30,12 +30,7 @@
#include <sys/cdefs.h>
#include <sys/queue.h>
-#ifdef __rtems__
-#include <freebsd/net80211/ieee80211_regdomain.h>
-#else
#include <net80211/ieee80211_regdomain.h>
-#endif
-
__BEGIN_DECLS
diff --git a/freebsd/sbin/ping/ping.c b/freebsd/sbin/ping/ping.c
index 34d86325..96d1c793 100644
--- a/freebsd/sbin/ping/ping.c
+++ b/freebsd/sbin/ping/ping.c
@@ -66,32 +66,21 @@ __FBSDID("$FreeBSD$");
* This program has to run SUID to ROOT to access the ICMP socket.
*/
-#include <sys/param.h> /* NB: we rely on this for <sys/types.h> */
+#include <rtems/bsd/sys/param.h> /* NB: we rely on this for <sys/types.h> */
#include <sys/socket.h>
#include <sys/sysctl.h>
-#include <sys/time.h>
+#include <rtems/bsd/sys/time.h>
#include <sys/uio.h>
#include <netinet/in.h>
-#ifdef __rtems__
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_icmp.h>
-#include <freebsd/netinet/ip_var.h>
-#else
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#include <netinet/ip_var.h>
-#endif
#include <arpa/inet.h>
#ifdef IPSEC
-#ifdef __rtems__
-#include <freebsd/netipsec/ipsec.h>
-#else
#include <netipsec/ipsec.h>
-#endif
#endif /*IPSEC*/
#include <ctype.h>
@@ -106,10 +95,6 @@ __FBSDID("$FreeBSD$");
#include <sysexits.h>
#include <unistd.h>
-#ifdef __rtems__
-#define select __select
-#endif
-
#define INADDR_LEN ((int)sizeof(in_addr_t))
#define TIMEVAL_LEN ((int)sizeof(struct tv32))
#define MASK_LEN (ICMP_MASKLEN - ICMP_MINLEN)
diff --git a/freebsd/sbin/ping6/ping6.c b/freebsd/sbin/ping6/ping6.c
index 20b5f7ba..e1392311 100644
--- a/freebsd/sbin/ping6/ping6.c
+++ b/freebsd/sbin/ping6/ping6.c
@@ -110,10 +110,10 @@ static const char rcsid[] =
* network attached to 1 or more interfaces)
*/
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/uio.h>
#include <sys/socket.h>
-#include <sys/time.h>
+#include <rtems/bsd/sys/time.h>
#include <net/if.h>
#include <net/route.h>
@@ -140,14 +140,9 @@ static const char rcsid[] =
#endif
#ifdef IPSEC
-#ifdef __rtems__
-#include <freebsd/netipsec/ah.h>
-#include <freebsd/netipsec/ipsec.h>
-#else
#include <netipsec/ah.h>
#include <netipsec/ipsec.h>
#endif
-#endif
#include <md5.h>
diff --git a/freebsd/sbin/route/route.c b/freebsd/sbin/route/route.c
index c0f2d50a..985d7303 100644
--- a/freebsd/sbin/route/route.c
+++ b/freebsd/sbin/route/route.c
@@ -45,21 +45,19 @@ static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/file.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/sysctl.h>
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <net/if.h>
#include <net/route.h>
#include <net/if_dl.h>
#include <netinet/in.h>
-
#include <netinet/if_ether.h>
#include <netatalk/at.h>
-
#include <arpa/inet.h>
#include <netdb.h>
@@ -74,13 +72,6 @@ static const char rcsid[] =
#include <unistd.h>
#include <ifaddrs.h>
-#ifdef __rtems__
-#ifndef _PATH_DEVNULL
-#define _PATH_DEVNULL "/dev/null"
-#endif
-#endif
-
-
struct keytab {
char *kt_cp;
int kt_i;
diff --git a/freebsd/sys/arm/arm/in_cksum.c b/freebsd/sys/arm/arm/in_cksum.c
index db98915d..c6f7b568 100644
--- a/freebsd/sys/arm/arm/in_cksum.c
+++ b/freebsd/sys/arm/arm/in_cksum.c
@@ -1,6 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
-
-/* $NetBSD: in_cksum.c,v 1.7 1997/09/02 13:18:15 thorpej Exp $ */
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1988, 1992, 1993
@@ -39,16 +37,16 @@
* @(#)in_cksum.c 8.1 (Berkeley) 6/10/93
*/
-#include <freebsd/sys/cdefs.h> /* RCS ID & Copyright macro defns */
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/machine/in_cksum.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/mbuf.h>
+#include <sys/systm.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <machine/in_cksum.h>
/*
* Checksum routine for Internet Protocol family headers
@@ -72,6 +70,22 @@ __FBSDID("$FreeBSD$");
ADDCARRY(sum); \
}
+static const u_int32_t in_masks[] = {
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
+ 0x00000000, 0x000000FF, 0x0000FFFF, 0x00FFFFFF, /* offset 0 */
+ 0x00000000, 0x0000FF00, 0x00FFFF00, 0xFFFFFF00, /* offset 1 */
+ 0x00000000, 0x00FF0000, 0xFFFF0000, 0xFFFF0000, /* offset 2 */
+ 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, /* offset 3 */
+#else
+ /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
+ 0x00000000, 0xFF000000, 0xFFFF0000, 0xFFFFFF00, /* offset 0 */
+ 0x00000000, 0x00FF0000, 0x00FFFF00, 0x00FFFFFF, /* offset 1 */
+ 0x00000000, 0x0000FF00, 0x0000FFFF, 0x0000FFFF, /* offset 2 */
+ 0x00000000, 0x000000FF, 0x000000FF, 0x000000FF, /* offset 3 */
+#endif
+};
+
union l_util {
u_int16_t s[2];
u_int32_t l;
@@ -82,6 +96,87 @@ union q_util {
u_int64_t q;
};
+static u_int64_t
+in_cksumdata(const void *buf, int len)
+{
+ const u_int32_t *lw = (const u_int32_t *) buf;
+ u_int64_t sum = 0;
+ u_int64_t prefilled;
+ int offset;
+ union q_util q_util;
+
+ if ((3 & (long) lw) == 0 && len == 20) {
+ sum = (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3] + lw[4];
+ REDUCE32;
+ return sum;
+ }
+
+ if ((offset = 3 & (long) lw) != 0) {
+ const u_int32_t *masks = in_masks + (offset << 2);
+ lw = (u_int32_t *) (((long) lw) - offset);
+ sum = *lw++ & masks[len >= 3 ? 3 : len];
+ len -= 4 - offset;
+ if (len <= 0) {
+ REDUCE32;
+ return sum;
+ }
+ }
+#if 0
+ /*
+ * Force to cache line boundary.
+ */
+ offset = 32 - (0x1f & (long) lw);
+ if (offset < 32 && len > offset) {
+ len -= offset;
+ if (4 & offset) {
+ sum += (u_int64_t) lw[0];
+ lw += 1;
+ }
+ if (8 & offset) {
+ sum += (u_int64_t) lw[0] + lw[1];
+ lw += 2;
+ }
+ if (16 & offset) {
+ sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
+ lw += 4;
+ }
+ }
+#endif
+ /*
+ * access prefilling to start load of next cache line.
+ * then add current cache line
+ * save result of prefilling for loop iteration.
+ */
+ prefilled = lw[0];
+ while ((len -= 32) >= 4) {
+ u_int64_t prefilling = lw[8];
+ sum += prefilled + lw[1] + lw[2] + lw[3]
+ + lw[4] + lw[5] + lw[6] + lw[7];
+ lw += 8;
+ prefilled = prefilling;
+ }
+ if (len >= 0) {
+ sum += prefilled + lw[1] + lw[2] + lw[3]
+ + lw[4] + lw[5] + lw[6] + lw[7];
+ lw += 8;
+ } else {
+ len += 32;
+ }
+ while ((len -= 16) >= 0) {
+ sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
+ lw += 4;
+ }
+ len += 16;
+ while ((len -= 4) >= 0) {
+ sum += (u_int64_t) *lw++;
+ }
+ len += 4;
+ if (len > 0)
+ sum += (u_int64_t) (in_masks[len] & *lw);
+ REDUCE32;
+ return sum;
+}
+
u_short
in_addword(u_short a, u_short b)
{
@@ -91,14 +186,20 @@ in_addword(u_short a, u_short b)
return (sum);
}
-static
-uint64_t _do_cksum(void *addr, int len)
+u_short
+#ifdef __rtems__
+/* Prototype does not match in FreeBSD code */
+in_pseudo(u_int a, u_int b, u_int c)
+#else
+in_pseudo(u_int32_t a, u_int32_t b, u_int32_t c)
+#endif
{
- uint64_t sum;
+ u_int64_t sum;
union q_util q_util;
+ union l_util l_util;
- sum = do_cksum(addr, len);
- REDUCE32;
+ sum = (u_int64_t) a + b + c;
+ REDUCE16;
return (sum);
}
@@ -112,16 +213,16 @@ in_cksum_skip(struct mbuf *m, int len, int skip)
union q_util q_util;
union l_util l_util;
- len -= skip;
- for (; skip && m; m = m->m_next) {
- if (m->m_len > skip) {
- mlen = m->m_len - skip;
+ len -= skip;
+ for (; skip && m; m = m->m_next) {
+ if (m->m_len > skip) {
+ mlen = m->m_len - skip;
addr = mtod(m, caddr_t) + skip;
- goto skip_start;
- } else {
- skip -= m->m_len;
- }
- }
+ goto skip_start;
+ } else {
+ skip -= m->m_len;
+ }
+ }
for (; m && len; m = m->m_next) {
if (m->m_len == 0)
@@ -132,10 +233,10 @@ skip_start:
if (len < mlen)
mlen = len;
- if ((clen ^ (int) addr) & 1)
- sum += _do_cksum(addr, mlen) << 8;
+ if ((clen ^ (uintptr_t) addr) & 1)
+ sum += in_cksumdata(addr, mlen) << 8;
else
- sum += _do_cksum(addr, mlen);
+ sum += in_cksumdata(addr, mlen);
clen += mlen;
len -= mlen;
@@ -146,9 +247,9 @@ skip_start:
u_int in_cksum_hdr(const struct ip *ip)
{
- u_int64_t sum = do_cksum(ip, sizeof(struct ip));
+ u_int64_t sum = in_cksumdata(ip, sizeof(struct ip));
union q_util q_util;
- union l_util l_util;
+ union l_util l_util;
REDUCE16;
return (~sum & 0xffff);
-}
+}
diff --git a/freebsd/sys/arm/arm/legacy.c b/freebsd/sys/arm/arm/legacy.c
new file mode 100644
index 00000000..2547990c
--- /dev/null
+++ b/freebsd/sys/arm/arm/legacy.c
@@ -0,0 +1,347 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright 1998 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby
+ * granted, provided that both the above copyright notice and this
+ * permission notice appear in all copies, that both the above
+ * copyright notice and this permission notice appear in all
+ * supporting documentation, and that the name of M.I.T. not be used
+ * in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission. M.I.T. makes
+ * no representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
+ * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
+ * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * This code implements a system driver for legacy systems that do not
+ * support ACPI or when ACPI support is not present in the kernel.
+ */
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <machine/bus.h>
+#include <sys/pcpu.h>
+#include <sys/rman.h>
+#include <sys/smp.h>
+
+#ifndef __rtems__
+#include <rtems/bsd/local/opt_mca.h>
+#endif /* __rtems__ */
+#ifdef DEV_MCA
+#include <i386/bios/mca_machdep.h>
+#endif
+
+#include <machine/legacyvar.h>
+#include <machine/resource.h>
+
+static MALLOC_DEFINE(M_LEGACYDEV, "legacydrv", "legacy system device");
+struct legacy_device {
+ int lg_pcibus;
+};
+
+#define DEVTOAT(dev) ((struct legacy_device *)device_get_ivars(dev))
+
+static int legacy_probe(device_t);
+static int legacy_attach(device_t);
+static int legacy_print_child(device_t, device_t);
+static device_t legacy_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static int legacy_read_ivar(device_t, device_t, int, uintptr_t *);
+static int legacy_write_ivar(device_t, device_t, int, uintptr_t);
+
+static device_method_t legacy_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, legacy_probe),
+ DEVMETHOD(device_attach, legacy_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, legacy_print_child),
+ DEVMETHOD(bus_add_child, legacy_add_child),
+ DEVMETHOD(bus_read_ivar, legacy_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_write_ivar),
+ DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t legacy_driver = {
+ "legacy",
+ legacy_methods,
+ 1, /* no softc */
+};
+static devclass_t legacy_devclass;
+
+DRIVER_MODULE(legacy, nexus, legacy_driver, legacy_devclass, 0, 0);
+
+static int
+legacy_probe(device_t dev)
+{
+
+ device_set_desc(dev, "legacy system");
+ device_quiet(dev);
+ return (0);
+}
+
+static int
+legacy_attach(device_t dev)
+{
+ device_t child;
+
+ /*
+ * Let our child drivers identify any child devices that they
+ * can find. Once that is done attach any devices that we
+ * found.
+ */
+ bus_generic_probe(dev);
+ bus_generic_attach(dev);
+
+#ifndef PC98
+ /*
+ * If we didn't see EISA or ISA on a pci bridge, create some
+ * connection points now so they show up "on motherboard".
+ */
+ if (!devclass_get_device(devclass_find("eisa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "eisa", 0);
+ if (child == NULL)
+ panic("legacy_attach eisa");
+ device_probe_and_attach(child);
+ }
+#endif
+#ifdef DEV_MCA
+ if (MCA_system && !devclass_get_device(devclass_find("mca"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "mca", 0);
+ if (child == 0)
+ panic("legacy_probe mca");
+ device_probe_and_attach(child);
+ }
+#endif
+ if (!devclass_get_device(devclass_find("isa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "isa", 0);
+ if (child == NULL)
+ panic("legacy_attach isa");
+ device_probe_and_attach(child);
+ }
+
+ return 0;
+}
+
+static int
+legacy_print_child(device_t bus, device_t child)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+ int retval = 0;
+
+ retval += bus_print_child_header(bus, child);
+ if (atdev->lg_pcibus != -1)
+ retval += printf(" pcibus %d", atdev->lg_pcibus);
+ retval += printf(" on motherboard\n"); /* XXX "motherboard", ick */
+
+ return (retval);
+}
+
+static device_t
+legacy_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ device_t child;
+ struct legacy_device *atdev;
+
+ atdev = malloc(sizeof(struct legacy_device), M_LEGACYDEV,
+ M_NOWAIT | M_ZERO);
+ if (atdev == NULL)
+ return(NULL);
+ atdev->lg_pcibus = -1;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child == NULL)
+ free(atdev, M_LEGACYDEV);
+ else
+ /* should we free this in legacy_child_detached? */
+ device_set_ivars(child, atdev);
+
+ return (child);
+}
+
+static int
+legacy_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ *result = 0;
+ break;
+ case LEGACY_IVAR_PCIBUS:
+ *result = atdev->lg_pcibus;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+
+static int
+legacy_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ return EINVAL;
+ case LEGACY_IVAR_PCIBUS:
+ atdev->lg_pcibus = value;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+/*
+ * Legacy CPU attachment when ACPI is not available. Drivers like
+ * cpufreq(4) hang off this.
+ */
+static void cpu_identify(driver_t *driver, device_t parent);
+static int cpu_read_ivar(device_t dev, device_t child, int index,
+ uintptr_t *result);
+static device_t cpu_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static struct resource_list *cpu_get_rlist(device_t dev, device_t child);
+
+struct cpu_device {
+ struct resource_list cd_rl;
+ struct pcpu *cd_pcpu;
+};
+
+static device_method_t cpu_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, cpu_identify),
+ DEVMETHOD(device_probe, bus_generic_probe),
+ DEVMETHOD(device_attach, bus_generic_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_add_child, cpu_add_child),
+ DEVMETHOD(bus_read_ivar, cpu_read_ivar),
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_get_resource_list, cpu_get_rlist),
+ DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
+ DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource),
+ DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource),
+ DEVMETHOD(bus_driver_added, bus_generic_driver_added),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t cpu_driver = {
+ "cpu",
+ cpu_methods,
+ 1, /* no softc */
+};
+static devclass_t cpu_devclass;
+DRIVER_MODULE(cpu, legacy, cpu_driver, cpu_devclass, 0, 0);
+
+static void
+cpu_identify(driver_t *driver, device_t parent)
+{
+ device_t child;
+ int i;
+
+ /*
+ * Attach a cpuX device for each CPU. We use an order of 150
+ * so that these devices are attached after the Host-PCI
+ * bridges (which are added at order 100).
+ */
+ for (i = 0; i <= mp_maxid; i++)
+ if (!CPU_ABSENT(i)) {
+ child = BUS_ADD_CHILD(parent, 150, "cpu", i);
+ if (child == NULL)
+ panic("legacy_attach cpu");
+ }
+}
+
+static device_t
+cpu_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ struct cpu_device *cd;
+ device_t child;
+ struct pcpu *pc;
+
+ if ((cd = malloc(sizeof(*cd), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL)
+ return (NULL);
+
+ resource_list_init(&cd->cd_rl);
+ pc = pcpu_find(device_get_unit(bus));
+ cd->cd_pcpu = pc;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child != NULL) {
+ pc->pc_device = child;
+ device_set_ivars(child, cd);
+ } else
+ free(cd, M_DEVBUF);
+ return (child);
+}
+
+static struct resource_list *
+cpu_get_rlist(device_t dev, device_t child)
+{
+ struct cpu_device *cpdev;
+
+ cpdev = device_get_ivars(child);
+ return (&cpdev->cd_rl);
+}
+
+static int
+cpu_read_ivar(device_t dev, device_t child, int index, uintptr_t *result)
+{
+ struct cpu_device *cpdev;
+
+ if (index != CPU_IVAR_PCPU)
+ return (ENOENT);
+ cpdev = device_get_ivars(child);
+ *result = (uintptr_t)cpdev->cd_pcpu;
+ return (0);
+}
diff --git a/freebsd/sys/arm/include/machine/cpufunc.h b/freebsd/sys/arm/include/machine/cpufunc.h
index 822fadb1..a4c1bc83 100644
--- a/freebsd/sys/arm/include/machine/cpufunc.h
+++ b/freebsd/sys/arm/include/machine/cpufunc.h
@@ -41,14 +41,15 @@
* $FreeBSD$
*/
-#ifndef _MACHINE_CPUFUNC_HH_
-#define _MACHINE_CPUFUNC_HH_
+#ifndef _MACHINE_CPUFUNC_H_
+#define _MACHINE_CPUFUNC_H_
#ifdef _KERNEL
+#ifndef __rtems__
-#include <freebsd/sys/types.h>
-#include <freebsd/machine/cpuconf.h>
-#include <freebsd/machine/katelib.h> /* For in[bwl] and out[bwl] */
+#include <rtems/bsd/sys/types.h>
+#include <machine/cpuconf.h>
+#include <machine/katelib.h> /* For in[bwl] and out[bwl] */
static __inline void
breakpoint(void)
@@ -612,7 +613,8 @@ extern int arm_pcache_unified;
extern int arm_dcache_align;
extern int arm_dcache_align_mask;
+#endif /* __rtems__ */
#endif /* _KERNEL */
-#endif /* _MACHINE_CPUFUNC_HH_ */
+#endif /* _MACHINE_CPUFUNC_H_ */
/* End of cpufunc.h */
diff --git a/freebsd/sys/arm/include/machine/in_cksum.h b/freebsd/sys/arm/include/machine/in_cksum.h
index 5e3e9333..37d88e2e 100644
--- a/freebsd/sys/arm/include/machine/in_cksum.h
+++ b/freebsd/sys/arm/include/machine/in_cksum.h
@@ -10,10 +10,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
@@ -33,34 +29,49 @@
* from tahoe: in_cksum.c 1.2 86/01/05
* from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91
* from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp
+ * from: src/sys/alpha/include/in_cksum.h,v 1.7 2005/03/02 21:33:20 joerg
* $FreeBSD$
*/
-#ifndef _MACHINE_IN_CKSUM_HH_
-#define _MACHINE_IN_CKSUM_HH_ 1
+#ifndef _MACHINE_IN_CKSUM_H_
+#define _MACHINE_IN_CKSUM_H_ 1
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
-#ifdef _KERNEL
-u_short in_cksum(struct mbuf *m, int len);
-u_short in_addword(u_short sum, u_short b);
-u_short in_cksum_skip(struct mbuf *m, int len, int skip);
-u_int do_cksum(const void *, int);
-u_int in_cksum_hdr(const struct ip *);
+#define in_cksum(m, len) in_cksum_skip(m, len, 0)
-static __inline u_short
-in_pseudo(u_int sum, u_int b, u_int c)
+/*
+ * It it useful to have an Internet checksum routine which is inlineable
+ * and optimized specifically for the task of computing IP header checksums
+ * in the normal case (where there are no options and the header length is
+ * therefore always exactly five 32-bit words.
+ */
+#ifdef __CC_SUPPORTS___INLINE
+
+static __inline void
+in_cksum_update(struct ip *ip)
{
- __asm __volatile("adds %0, %0, %1\n"
- "adcs %0, %0, %2\n"
- "adc %0, %0, #0\n"
- : "+r" (sum)
- : "r" (b), "r" (c));
- sum = (sum & 0xffff) + (sum >> 16);
- if (sum > 0xffff)
- sum -= 0xffff;
- return (sum);
+ int __tmpsum;
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256;
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16));
}
-#endif /* _KERNEL */
-#endif /* _MACHINE_IN_CKSUM_HH_ */
+#else
+
+#define in_cksum_update(ip) \
+ do { \
+ int __tmpsum; \
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256; \
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \
+ } while(0)
+
+#endif
+
+#ifdef _KERNEL
+u_int in_cksum_hdr(const struct ip *ip);
+u_short in_addword(u_short sum, u_short b);
+u_short in_pseudo(u_int sum, u_int b, u_int c);
+u_short in_cksum_skip(struct mbuf *m, int len, int skip);
+#endif
+
+#endif /* _MACHINE_IN_CKSUM_H_ */
diff --git a/freebsd/sys/arm/include/machine/legacyvar.h b/freebsd/sys/arm/include/machine/legacyvar.h
index 4771faf5..0b0fa433 100644
--- a/freebsd/sys/arm/include/machine/legacyvar.h
+++ b/freebsd/sys/arm/include/machine/legacyvar.h
@@ -26,8 +26,8 @@
* $FreeBSD$
*/
-#ifndef _MACHINE_LEGACYVAR_HH_
-#define _MACHINE_LEGACYVAR_HH_
+#ifndef _MACHINE_LEGACYVAR_H_
+#define _MACHINE_LEGACYVAR_H_
enum legacy_device_ivars {
LEGACY_IVAR_PCIDOMAIN,
@@ -54,4 +54,4 @@ int legacy_pcib_write_ivar(device_t dev, device_t child, int which,
struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child,
int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
-#endif /* !_MACHINE_LEGACYVAR_HH_ */
+#endif /* !_MACHINE_LEGACYVAR_H_ */
diff --git a/freebsd/sys/arm/pci/pci_bus.c b/freebsd/sys/arm/pci/pci_bus.c
index ec62ec14..6627db98 100644
--- a/freebsd/sys/arm/pci/pci_bus.c
+++ b/freebsd/sys/arm/pci/pci_bus.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1997, Stefan Esser <se@freebsd.org>
@@ -26,31 +26,31 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_cpu.h>
+#include <rtems/bsd/local/opt_cpu.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
-#include <freebsd/dev/pci/pcivar.h>
-#include <freebsd/dev/pci/pcireg.h>
-#include <freebsd/dev/pci/pcib_private.h>
-#include <freebsd/isa/isavar.h>
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcib_private.h>
+#include <isa/isavar.h>
#ifdef CPU_ELAN
-#include <freebsd/machine/md_var.h>
+#include <machine/md_var.h>
#endif
-#include <freebsd/machine/legacyvar.h>
-#include <freebsd/machine/pci_cfgreg.h>
-#include <freebsd/machine/resource.h>
+#include <machine/legacyvar.h>
+#include <machine/pci_cfgreg.h>
+#include <machine/resource.h>
-#include <freebsd/local/pcib_if.h>
+#include <rtems/bsd/local/pcib_if.h>
#ifndef __rtems__
static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev,
diff --git a/freebsd/sys/avr/avr/in_cksum.c b/freebsd/sys/avr/avr/in_cksum.c
new file mode 100644
index 00000000..c6f7b568
--- /dev/null
+++ b/freebsd/sys/avr/avr/in_cksum.c
@@ -0,0 +1,255 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1988, 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ * Copyright (c) 1996
+ * Matt Thomas <matt@3am-software.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)in_cksum.c 8.1 (Berkeley) 6/10/93
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/mbuf.h>
+#include <sys/systm.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <machine/in_cksum.h>
+
+/*
+ * Checksum routine for Internet Protocol family headers
+ * (Portable Alpha version).
+ *
+ * This routine is very heavily used in the network
+ * code and should be modified for each CPU to be as fast as possible.
+ */
+
+#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x)
+#define REDUCE32 \
+ { \
+ q_util.q = sum; \
+ sum = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
+ }
+#define REDUCE16 \
+ { \
+ q_util.q = sum; \
+ l_util.l = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
+ sum = l_util.s[0] + l_util.s[1]; \
+ ADDCARRY(sum); \
+ }
+
+static const u_int32_t in_masks[] = {
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
+ 0x00000000, 0x000000FF, 0x0000FFFF, 0x00FFFFFF, /* offset 0 */
+ 0x00000000, 0x0000FF00, 0x00FFFF00, 0xFFFFFF00, /* offset 1 */
+ 0x00000000, 0x00FF0000, 0xFFFF0000, 0xFFFF0000, /* offset 2 */
+ 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, /* offset 3 */
+#else
+ /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
+ 0x00000000, 0xFF000000, 0xFFFF0000, 0xFFFFFF00, /* offset 0 */
+ 0x00000000, 0x00FF0000, 0x00FFFF00, 0x00FFFFFF, /* offset 1 */
+ 0x00000000, 0x0000FF00, 0x0000FFFF, 0x0000FFFF, /* offset 2 */
+ 0x00000000, 0x000000FF, 0x000000FF, 0x000000FF, /* offset 3 */
+#endif
+};
+
+union l_util {
+ u_int16_t s[2];
+ u_int32_t l;
+};
+union q_util {
+ u_int16_t s[4];
+ u_int32_t l[2];
+ u_int64_t q;
+};
+
+static u_int64_t
+in_cksumdata(const void *buf, int len)
+{
+ const u_int32_t *lw = (const u_int32_t *) buf;
+ u_int64_t sum = 0;
+ u_int64_t prefilled;
+ int offset;
+ union q_util q_util;
+
+ if ((3 & (long) lw) == 0 && len == 20) {
+ sum = (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3] + lw[4];
+ REDUCE32;
+ return sum;
+ }
+
+ if ((offset = 3 & (long) lw) != 0) {
+ const u_int32_t *masks = in_masks + (offset << 2);
+ lw = (u_int32_t *) (((long) lw) - offset);
+ sum = *lw++ & masks[len >= 3 ? 3 : len];
+ len -= 4 - offset;
+ if (len <= 0) {
+ REDUCE32;
+ return sum;
+ }
+ }
+#if 0
+ /*
+ * Force to cache line boundary.
+ */
+ offset = 32 - (0x1f & (long) lw);
+ if (offset < 32 && len > offset) {
+ len -= offset;
+ if (4 & offset) {
+ sum += (u_int64_t) lw[0];
+ lw += 1;
+ }
+ if (8 & offset) {
+ sum += (u_int64_t) lw[0] + lw[1];
+ lw += 2;
+ }
+ if (16 & offset) {
+ sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
+ lw += 4;
+ }
+ }
+#endif
+ /*
+ * access prefilling to start load of next cache line.
+ * then add current cache line
+ * save result of prefilling for loop iteration.
+ */
+ prefilled = lw[0];
+ while ((len -= 32) >= 4) {
+ u_int64_t prefilling = lw[8];
+ sum += prefilled + lw[1] + lw[2] + lw[3]
+ + lw[4] + lw[5] + lw[6] + lw[7];
+ lw += 8;
+ prefilled = prefilling;
+ }
+ if (len >= 0) {
+ sum += prefilled + lw[1] + lw[2] + lw[3]
+ + lw[4] + lw[5] + lw[6] + lw[7];
+ lw += 8;
+ } else {
+ len += 32;
+ }
+ while ((len -= 16) >= 0) {
+ sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
+ lw += 4;
+ }
+ len += 16;
+ while ((len -= 4) >= 0) {
+ sum += (u_int64_t) *lw++;
+ }
+ len += 4;
+ if (len > 0)
+ sum += (u_int64_t) (in_masks[len] & *lw);
+ REDUCE32;
+ return sum;
+}
+
+u_short
+in_addword(u_short a, u_short b)
+{
+ u_int64_t sum = a + b;
+
+ ADDCARRY(sum);
+ return (sum);
+}
+
+u_short
+#ifdef __rtems__
+/* Prototype does not match in FreeBSD code */
+in_pseudo(u_int a, u_int b, u_int c)
+#else
+in_pseudo(u_int32_t a, u_int32_t b, u_int32_t c)
+#endif
+{
+ u_int64_t sum;
+ union q_util q_util;
+ union l_util l_util;
+
+ sum = (u_int64_t) a + b + c;
+ REDUCE16;
+ return (sum);
+}
+
+u_short
+in_cksum_skip(struct mbuf *m, int len, int skip)
+{
+ u_int64_t sum = 0;
+ int mlen = 0;
+ int clen = 0;
+ caddr_t addr;
+ union q_util q_util;
+ union l_util l_util;
+
+ len -= skip;
+ for (; skip && m; m = m->m_next) {
+ if (m->m_len > skip) {
+ mlen = m->m_len - skip;
+ addr = mtod(m, caddr_t) + skip;
+ goto skip_start;
+ } else {
+ skip -= m->m_len;
+ }
+ }
+
+ for (; m && len; m = m->m_next) {
+ if (m->m_len == 0)
+ continue;
+ mlen = m->m_len;
+ addr = mtod(m, caddr_t);
+skip_start:
+ if (len < mlen)
+ mlen = len;
+
+ if ((clen ^ (uintptr_t) addr) & 1)
+ sum += in_cksumdata(addr, mlen) << 8;
+ else
+ sum += in_cksumdata(addr, mlen);
+
+ clen += mlen;
+ len -= mlen;
+ }
+ REDUCE16;
+ return (~sum & 0xffff);
+}
+
+u_int in_cksum_hdr(const struct ip *ip)
+{
+ u_int64_t sum = in_cksumdata(ip, sizeof(struct ip));
+ union q_util q_util;
+ union l_util l_util;
+ REDUCE16;
+ return (~sum & 0xffff);
+}
diff --git a/freebsd/sys/avr/avr/legacy.c b/freebsd/sys/avr/avr/legacy.c
new file mode 100644
index 00000000..2547990c
--- /dev/null
+++ b/freebsd/sys/avr/avr/legacy.c
@@ -0,0 +1,347 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright 1998 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby
+ * granted, provided that both the above copyright notice and this
+ * permission notice appear in all copies, that both the above
+ * copyright notice and this permission notice appear in all
+ * supporting documentation, and that the name of M.I.T. not be used
+ * in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission. M.I.T. makes
+ * no representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
+ * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
+ * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * This code implements a system driver for legacy systems that do not
+ * support ACPI or when ACPI support is not present in the kernel.
+ */
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <machine/bus.h>
+#include <sys/pcpu.h>
+#include <sys/rman.h>
+#include <sys/smp.h>
+
+#ifndef __rtems__
+#include <rtems/bsd/local/opt_mca.h>
+#endif /* __rtems__ */
+#ifdef DEV_MCA
+#include <i386/bios/mca_machdep.h>
+#endif
+
+#include <machine/legacyvar.h>
+#include <machine/resource.h>
+
+static MALLOC_DEFINE(M_LEGACYDEV, "legacydrv", "legacy system device");
+struct legacy_device {
+ int lg_pcibus;
+};
+
+#define DEVTOAT(dev) ((struct legacy_device *)device_get_ivars(dev))
+
+static int legacy_probe(device_t);
+static int legacy_attach(device_t);
+static int legacy_print_child(device_t, device_t);
+static device_t legacy_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static int legacy_read_ivar(device_t, device_t, int, uintptr_t *);
+static int legacy_write_ivar(device_t, device_t, int, uintptr_t);
+
+static device_method_t legacy_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, legacy_probe),
+ DEVMETHOD(device_attach, legacy_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, legacy_print_child),
+ DEVMETHOD(bus_add_child, legacy_add_child),
+ DEVMETHOD(bus_read_ivar, legacy_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_write_ivar),
+ DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t legacy_driver = {
+ "legacy",
+ legacy_methods,
+ 1, /* no softc */
+};
+static devclass_t legacy_devclass;
+
+DRIVER_MODULE(legacy, nexus, legacy_driver, legacy_devclass, 0, 0);
+
+static int
+legacy_probe(device_t dev)
+{
+
+ device_set_desc(dev, "legacy system");
+ device_quiet(dev);
+ return (0);
+}
+
+static int
+legacy_attach(device_t dev)
+{
+ device_t child;
+
+ /*
+ * Let our child drivers identify any child devices that they
+ * can find. Once that is done attach any devices that we
+ * found.
+ */
+ bus_generic_probe(dev);
+ bus_generic_attach(dev);
+
+#ifndef PC98
+ /*
+ * If we didn't see EISA or ISA on a pci bridge, create some
+ * connection points now so they show up "on motherboard".
+ */
+ if (!devclass_get_device(devclass_find("eisa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "eisa", 0);
+ if (child == NULL)
+ panic("legacy_attach eisa");
+ device_probe_and_attach(child);
+ }
+#endif
+#ifdef DEV_MCA
+ if (MCA_system && !devclass_get_device(devclass_find("mca"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "mca", 0);
+ if (child == 0)
+ panic("legacy_probe mca");
+ device_probe_and_attach(child);
+ }
+#endif
+ if (!devclass_get_device(devclass_find("isa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "isa", 0);
+ if (child == NULL)
+ panic("legacy_attach isa");
+ device_probe_and_attach(child);
+ }
+
+ return 0;
+}
+
+static int
+legacy_print_child(device_t bus, device_t child)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+ int retval = 0;
+
+ retval += bus_print_child_header(bus, child);
+ if (atdev->lg_pcibus != -1)
+ retval += printf(" pcibus %d", atdev->lg_pcibus);
+ retval += printf(" on motherboard\n"); /* XXX "motherboard", ick */
+
+ return (retval);
+}
+
+static device_t
+legacy_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ device_t child;
+ struct legacy_device *atdev;
+
+ atdev = malloc(sizeof(struct legacy_device), M_LEGACYDEV,
+ M_NOWAIT | M_ZERO);
+ if (atdev == NULL)
+ return(NULL);
+ atdev->lg_pcibus = -1;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child == NULL)
+ free(atdev, M_LEGACYDEV);
+ else
+ /* should we free this in legacy_child_detached? */
+ device_set_ivars(child, atdev);
+
+ return (child);
+}
+
+static int
+legacy_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ *result = 0;
+ break;
+ case LEGACY_IVAR_PCIBUS:
+ *result = atdev->lg_pcibus;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+
+static int
+legacy_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ return EINVAL;
+ case LEGACY_IVAR_PCIBUS:
+ atdev->lg_pcibus = value;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+/*
+ * Legacy CPU attachment when ACPI is not available. Drivers like
+ * cpufreq(4) hang off this.
+ */
+static void cpu_identify(driver_t *driver, device_t parent);
+static int cpu_read_ivar(device_t dev, device_t child, int index,
+ uintptr_t *result);
+static device_t cpu_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static struct resource_list *cpu_get_rlist(device_t dev, device_t child);
+
+struct cpu_device {
+ struct resource_list cd_rl;
+ struct pcpu *cd_pcpu;
+};
+
+static device_method_t cpu_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, cpu_identify),
+ DEVMETHOD(device_probe, bus_generic_probe),
+ DEVMETHOD(device_attach, bus_generic_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_add_child, cpu_add_child),
+ DEVMETHOD(bus_read_ivar, cpu_read_ivar),
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_get_resource_list, cpu_get_rlist),
+ DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
+ DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource),
+ DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource),
+ DEVMETHOD(bus_driver_added, bus_generic_driver_added),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t cpu_driver = {
+ "cpu",
+ cpu_methods,
+ 1, /* no softc */
+};
+static devclass_t cpu_devclass;
+DRIVER_MODULE(cpu, legacy, cpu_driver, cpu_devclass, 0, 0);
+
+static void
+cpu_identify(driver_t *driver, device_t parent)
+{
+ device_t child;
+ int i;
+
+ /*
+ * Attach a cpuX device for each CPU. We use an order of 150
+ * so that these devices are attached after the Host-PCI
+ * bridges (which are added at order 100).
+ */
+ for (i = 0; i <= mp_maxid; i++)
+ if (!CPU_ABSENT(i)) {
+ child = BUS_ADD_CHILD(parent, 150, "cpu", i);
+ if (child == NULL)
+ panic("legacy_attach cpu");
+ }
+}
+
+static device_t
+cpu_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ struct cpu_device *cd;
+ device_t child;
+ struct pcpu *pc;
+
+ if ((cd = malloc(sizeof(*cd), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL)
+ return (NULL);
+
+ resource_list_init(&cd->cd_rl);
+ pc = pcpu_find(device_get_unit(bus));
+ cd->cd_pcpu = pc;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child != NULL) {
+ pc->pc_device = child;
+ device_set_ivars(child, cd);
+ } else
+ free(cd, M_DEVBUF);
+ return (child);
+}
+
+static struct resource_list *
+cpu_get_rlist(device_t dev, device_t child)
+{
+ struct cpu_device *cpdev;
+
+ cpdev = device_get_ivars(child);
+ return (&cpdev->cd_rl);
+}
+
+static int
+cpu_read_ivar(device_t dev, device_t child, int index, uintptr_t *result)
+{
+ struct cpu_device *cpdev;
+
+ if (index != CPU_IVAR_PCPU)
+ return (ENOENT);
+ cpdev = device_get_ivars(child);
+ *result = (uintptr_t)cpdev->cd_pcpu;
+ return (0);
+}
diff --git a/freebsd/sys/avr/include/machine/in_cksum.h b/freebsd/sys/avr/include/machine/in_cksum.h
index 1f7dbac7..37d88e2e 100644
--- a/freebsd/sys/avr/include/machine/in_cksum.h
+++ b/freebsd/sys/avr/include/machine/in_cksum.h
@@ -29,23 +29,16 @@
* from tahoe: in_cksum.c 1.2 86/01/05
* from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91
* from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp
+ * from: src/sys/alpha/include/in_cksum.h,v 1.7 2005/03/02 21:33:20 joerg
* $FreeBSD$
*/
-#ifndef _MACHINE_IN_CKSUM_HH_
-#define _MACHINE_IN_CKSUM_HH_ 1
+#ifndef _MACHINE_IN_CKSUM_H_
+#define _MACHINE_IN_CKSUM_H_ 1
-#ifndef _SYS_CDEFS_HH_
-#error this file needs sys/cdefs.h as a prerequisite
-#endif
-
-/*
- * MP safe (alfred)
- */
-
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
-#define in_cksum(m, len) in_cksum_skip(m, len, 0)
+#define in_cksum(m, len) in_cksum_skip(m, len, 0)
/*
* It it useful to have an Internet checksum routine which is inlineable
@@ -53,33 +46,7 @@
* in the normal case (where there are no options and the header length is
* therefore always exactly five 32-bit words.
*/
-#if defined(__GNUCLIKE_ASM) && !defined(__INTEL_COMPILER)
-static __inline u_int
-in_cksum_hdr(const struct ip *ip)
-{
- u_int sum = 0;
-
- __asm(
- "addl %1, %0\n"
- "adcl %2, %0\n"
- "adcl %3, %0\n"
- "adcl %4, %0\n"
- "adcl %5, %0\n"
- "adcl $0, %0"
- : "+r" (sum)
- : "g" (((const u_int32_t *)ip)[0]),
- "g" (((const u_int32_t *)ip)[1]),
- "g" (((const u_int32_t *)ip)[2]),
- "g" (((const u_int32_t *)ip)[3]),
- "g" (((const u_int32_t *)ip)[4])
- : "cc"
- );
- sum = (sum & 0xffff) + (sum >> 16);
- if (sum > 0xffff)
- sum -= 0xffff;
-
- return ~sum & 0xffff;
-}
+#ifdef __CC_SUPPORTS___INLINE
static __inline void
in_cksum_update(struct ip *ip)
@@ -89,54 +56,22 @@ in_cksum_update(struct ip *ip)
ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16));
}
-static __inline u_short
-in_addword(u_short sum, u_short b)
-{
- __asm(
- "addw %1, %0\n"
- "adcw $0, %0"
- : "+r" (sum)
- : "g" (b)
- : "cc"
- );
- return (sum);
-}
-
-static __inline u_short
-in_pseudo(u_int sum, u_int b, u_int c)
-{
- __asm(
- "addl %1, %0\n"
- "adcl %2, %0\n"
- "adcl $0, %0"
- : "+r" (sum)
- : "g" (b),
- "g" (c)
- : "cc"
- );
- sum = (sum & 0xffff) + (sum >> 16);
- if (sum > 0xffff)
- sum -= 0xffff;
- return (sum);
-}
-
#else
-#define in_cksum_update(ip) \
- do { \
- int __tmpsum; \
- __tmpsum = (int)ntohs(ip->ip_sum) + 256; \
- ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \
+
+#define in_cksum_update(ip) \
+ do { \
+ int __tmpsum; \
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256; \
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \
} while(0)
#endif
#ifdef _KERNEL
-#if !defined(__GNUCLIKE_ASM) || defined(__INTEL_COMPILER)
u_int in_cksum_hdr(const struct ip *ip);
u_short in_addword(u_short sum, u_short b);
u_short in_pseudo(u_int sum, u_int b, u_int c);
-#endif
u_short in_cksum_skip(struct mbuf *m, int len, int skip);
-#endif /* _KERNEL */
+#endif
-#endif /* _MACHINE_IN_CKSUM_HH_ */
+#endif /* _MACHINE_IN_CKSUM_H_ */
diff --git a/freebsd/sys/avr/include/machine/legacyvar.h b/freebsd/sys/avr/include/machine/legacyvar.h
new file mode 100644
index 00000000..0b0fa433
--- /dev/null
+++ b/freebsd/sys/avr/include/machine/legacyvar.h
@@ -0,0 +1,57 @@
+/*-
+ * Copyright (c) 2000 Peter Wemm <peter@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_LEGACYVAR_H_
+#define _MACHINE_LEGACYVAR_H_
+
+enum legacy_device_ivars {
+ LEGACY_IVAR_PCIDOMAIN,
+ LEGACY_IVAR_PCIBUS
+};
+
+#define LEGACY_ACCESSOR(var, ivar, type) \
+ __BUS_ACCESSOR(legacy, var, LEGACY, ivar, type)
+
+LEGACY_ACCESSOR(pcidomain, PCIDOMAIN, uint32_t)
+LEGACY_ACCESSOR(pcibus, PCIBUS, uint32_t)
+
+#undef LEGACY_ACCESSOR
+
+int legacy_pcib_maxslots(device_t dev);
+uint32_t legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes);
+int legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result);
+void legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes);
+int legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value);
+struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child,
+ int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
+
+#endif /* !_MACHINE_LEGACYVAR_H_ */
diff --git a/freebsd/sys/_null.h b/freebsd/sys/avr/include/machine/pci_cfgreg.h
index ed6804cc..bc72418d 100644
--- a/freebsd/sys/_null.h
+++ b/freebsd/sys/avr/include/machine/pci_cfgreg.h
@@ -1,13 +1,13 @@
/*-
- * Copyright (c) 2003 Marcel Moolenaar
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
@@ -24,22 +24,29 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $FreeBSD$
+ *
*/
-#ifndef NULL
+#define CONF1_ADDR_PORT 0x0cf8
+#define CONF1_DATA_PORT 0x0cfc
+
+#define CONF1_ENABLE 0x80000000ul
+#define CONF1_ENABLE_CHK 0x80000000ul
+#define CONF1_ENABLE_MSK 0x7f000000ul
+#define CONF1_ENABLE_CHK1 0xff000001ul
+#define CONF1_ENABLE_MSK1 0x80000001ul
+#define CONF1_ENABLE_RES1 0x80000000ul
+
+#define CONF2_ENABLE_PORT 0x0cf8
+#define CONF2_FORWARD_PORT 0x0cfa
-#if !defined(__cplusplus)
-#define NULL ((void *)0)
-#else
-#if defined(__GNUG__) && defined(__GNUC__) && __GNUC__ >= 4
-#define NULL __null
-#else
-#if defined(__LP64__)
-#define NULL (0L)
-#else
-#define NULL 0
-#endif /* __LP64__ */
-#endif /* __GNUG__ */
-#endif /* !__cplusplus */
+#define CONF2_ENABLE_CHK 0x0e
+#define CONF2_ENABLE_RES 0x0e
-#endif
+int pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus);
+int pci_cfgregopen(void);
+u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes);
+void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes);
+void pci_pir_open(void);
+int pci_pir_probe(int bus, int require_parse);
+int pci_pir_route_interrupt(int bus, int device, int func, int pin);
diff --git a/freebsd/sys/avr/pci/pci_bus.c b/freebsd/sys/avr/pci/pci_bus.c
index 62cd96c1..6627db98 100644
--- a/freebsd/sys/avr/pci/pci_bus.c
+++ b/freebsd/sys/avr/pci/pci_bus.c
@@ -1,71 +1,729 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-/**
- * @file
- *
- * @ingroup rtems_bsd_rtems
- *
- * @brief This file contains methods that are rtems specific implementation
- * of methods in pci_bus.c.
- */
-
-/*
- * COPYRIGHT (c) 2012. On-Line Applications Research Corporation (OAR).
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_cpu.h>
+#include <rtems/bsd/local/opt_cpu.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/kernel.h>
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcib_private.h>
+#include <isa/isavar.h>
+#ifdef CPU_ELAN
+#include <machine/md_var.h>
+#endif
+#include <machine/legacyvar.h>
+#include <machine/pci_cfgreg.h>
+#include <machine/resource.h>
-#include <freebsd/dev/pci/pcivar.h>
-#include <freebsd/dev/pci/pcireg.h>
-#include <freebsd/dev/pci/pcib_private.h>
-#include <freebsd/machine/resource.h>
+#include <rtems/bsd/local/pcib_if.h>
+
+#ifndef __rtems__
+static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev,
+ int pin);
+#else /* __rtems__ */
+int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin);
+#endif /* __rtems__ */
-#include <freebsd/local/pcib_if.h>
-#include <rtems/pci.h>
-#include <freebsd/machine/bus.h>
int
-pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
+legacy_pcib_maxslots(device_t dev)
+{
+ return 31;
+}
+
+/* read configuration space register */
+
+#ifdef __rtems__
+uint32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#else
+u_int32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#endif
+{
+ return(pci_cfgregread(bus, slot, func, reg, bytes));
+}
+
+/* write configuration space register */
+
+void
+legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes)
+{
+ pci_cfgregwrite(bus, slot, func, reg, data, bytes);
+}
+
+/* Pass MSI requests up to the nexus. */
+
+static int
+legacy_pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount,
+ int *irqs)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSI(device_get_parent(bus), dev, count, maxcount,
+ irqs));
+}
+
+static int
+legacy_pcib_alloc_msix(device_t pcib, device_t dev, int *irq)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq));
+}
+
+static int
+legacy_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr,
+ uint32_t *data)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data));
+}
+
+static const char *
+legacy_pcib_is_host_bridge(int bus, int slot, int func,
+ uint32_t id, uint8_t class, uint8_t subclass,
+ uint8_t *busnum)
{
- int bus;
- int slot;
- int func;
- uint8_t irq;
-
- bus = pci_get_bus(dev);
- slot = pci_get_slot(dev);
- func = pci_get_function(dev);
+ const char *s = NULL;
+ static uint8_t pxb[4]; /* hack for 450nx */
+
+ *busnum = 0;
+
+ switch (id) {
+ case 0x12258086:
+ s = "Intel 824?? host to PCI bridge";
+ /* XXX This is a guess */
+ /* *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x41, 1); */
+ *busnum = bus;
+ break;
+ case 0x71208086:
+ s = "Intel 82810 (i810 GMCH) Host To Hub bridge";
+ break;
+ case 0x71228086:
+ s = "Intel 82810-DC100 (i810-DC100 GMCH) Host To Hub bridge";
+ break;
+ case 0x71248086:
+ s = "Intel 82810E (i810E GMCH) Host To Hub bridge";
+ break;
+ case 0x11308086:
+ s = "Intel 82815 (i815 GMCH) Host To Hub bridge";
+ break;
+ case 0x71808086:
+ s = "Intel 82443LX (440 LX) host to PCI bridge";
+ break;
+ case 0x71908086:
+ s = "Intel 82443BX (440 BX) host to PCI bridge";
+ break;
+ case 0x71928086:
+ s = "Intel 82443BX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x71948086:
+ s = "Intel 82443MX host to PCI bridge";
+ break;
+ case 0x71a08086:
+ s = "Intel 82443GX host to PCI bridge";
+ break;
+ case 0x71a18086:
+ s = "Intel 82443GX host to AGP bridge";
+ break;
+ case 0x71a28086:
+ s = "Intel 82443GX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x84c48086:
+ s = "Intel 82454KX/GX (Orion) host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x4a, 1);
+ break;
+ case 0x84ca8086:
+ /*
+ * For the 450nx chipset, there is a whole bundle of
+ * things pretending to be host bridges. The MIOC will
+ * be seen first and isn't really a pci bridge (the
+ * actual busses are attached to the PXB's). We need to
+ * read the registers of the MIOC to figure out the
+ * bus numbers for the PXB channels.
+ *
+ * Since the MIOC doesn't have a pci bus attached, we
+ * pretend it wasn't there.
+ */
+ pxb[0] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd0, 1); /* BUSNO[0] */
+ pxb[1] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd1, 1) + 1; /* SUBA[0]+1 */
+ pxb[2] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd3, 1); /* BUSNO[1] */
+ pxb[3] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd4, 1) + 1; /* SUBA[1]+1 */
+ return NULL;
+ case 0x84cb8086:
+ switch (slot) {
+ case 0x12:
+ s = "Intel 82454NX PXB#0, Bus#A";
+ *busnum = pxb[0];
+ break;
+ case 0x13:
+ s = "Intel 82454NX PXB#0, Bus#B";
+ *busnum = pxb[1];
+ break;
+ case 0x14:
+ s = "Intel 82454NX PXB#1, Bus#A";
+ *busnum = pxb[2];
+ break;
+ case 0x15:
+ s = "Intel 82454NX PXB#1, Bus#B";
+ *busnum = pxb[3];
+ break;
+ }
+ break;
+ case 0x1A308086:
+ s = "Intel 82845 Host to PCI bridge";
+ break;
+
+ /* AMD -- vendor 0x1022 */
+ case 0x30001022:
+ s = "AMD Elan SC520 host to PCI bridge";
+#ifdef CPU_ELAN
+ init_AMD_Elan_sc520();
+#else
+ printf(
+"*** WARNING: missing CPU_ELAN -- timekeeping may be wrong\n");
+#endif
+ break;
+ case 0x70061022:
+ s = "AMD-751 host to PCI bridge";
+ break;
+ case 0x700e1022:
+ s = "AMD-761 host to PCI bridge";
+ break;
+
+ /* SiS -- vendor 0x1039 */
+ case 0x04961039:
+ s = "SiS 85c496";
+ break;
+ case 0x04061039:
+ s = "SiS 85c501";
+ break;
+ case 0x06011039:
+ s = "SiS 85c601";
+ break;
+ case 0x55911039:
+ s = "SiS 5591 host to PCI bridge";
+ break;
+ case 0x00011039:
+ s = "SiS 5591 host to AGP bridge";
+ break;
+
+ /* VLSI -- vendor 0x1004 */
+ case 0x00051004:
+ s = "VLSI 82C592 Host to PCI bridge";
+ break;
+
+ /* XXX Here is MVP3, I got the datasheet but NO M/B to test it */
+ /* totally. Please let me know if anything wrong. -F */
+ /* XXX need info on the MVP3 -- any takers? */
+ case 0x05981106:
+ s = "VIA 82C598MVP (Apollo MVP3) host bridge";
+ break;
+
+ /* AcerLabs -- vendor 0x10b9 */
+ /* Funny : The datasheet told me vendor id is "10b8",sub-vendor */
+ /* id is '10b9" but the register always shows "10b9". -Foxfair */
+ case 0x154110b9:
+ s = "AcerLabs M1541 (Aladdin-V) PCI host bridge";
+ break;
+
+ /* OPTi -- vendor 0x1045 */
+ case 0xc7011045:
+ s = "OPTi 82C700 host to PCI bridge";
+ break;
+ case 0xc8221045:
+ s = "OPTi 82C822 host to PCI Bridge";
+ break;
+
+ /* ServerWorks -- vendor 0x1166 */
+ case 0x00051166:
+ s = "ServerWorks NB6536 2.0HE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00061166:
+ /* FALLTHROUGH */
+ case 0x00081166:
+ /* FALLTHROUGH */
+ case 0x02011166:
+ /* FALLTHROUGH */
+ case 0x010f1014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00091166:
+ s = "ServerWorks NB6635 3.0LE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00101166:
+ s = "ServerWorks CIOB30 host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00111166:
+ /* FALLTHROUGH */
+ case 0x03021014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks CMIC-HE host to PCI-X bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* XXX unknown chipset, but working */
+ case 0x00171166:
+ /* FALLTHROUGH */
+ case 0x01011166:
+ case 0x01101166:
+ case 0x02251166:
+ s = "ServerWorks host to PCI bridge(unknown chipset)";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* Compaq/HP -- vendor 0x0e11 */
+ case 0x60100e11:
+ s = "Compaq/HP Model 6010 HotPlug PCI Bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0xc8, 1);
+ break;
+
+ /* Integrated Micro Solutions -- vendor 0x10e0 */
+ case 0x884910e0:
+ s = "Integrated Micro Solutions VL Bridge";
+ break;
+
+ default:
+ if (class == PCIC_BRIDGE && subclass == PCIS_BRIDGE_HOST)
+ s = "Host to PCI bridge";
+ break;
+ }
+
+ return s;
+}
+
+/*
+ * Scan the first pci bus for host-pci bridges and add pcib instances
+ * to the nexus for each bridge.
+ */
+static void
+legacy_pcib_identify(driver_t *driver, device_t parent)
+{
+ int bus, slot, func;
+ u_int8_t hdrtype;
+ int found = 0;
+ int pcifunchigh;
+ int found824xx = 0;
+ int found_orion = 0;
+ device_t child;
+ devclass_t pci_devclass;
+
+ if (pci_cfgregopen() == 0)
+ return;
+ /*
+ * Check to see if we haven't already had a PCI bus added
+ * via some other means. If we have, bail since otherwise
+ * we're going to end up duplicating it.
+ */
+ if ((pci_devclass = devclass_find("pci")) &&
+ devclass_get_device(pci_devclass, 0))
+ return;
+
+
+ bus = 0;
+ retry:
+ for (slot = 0; slot <= PCI_SLOTMAX; slot++) {
+ func = 0;
+ hdrtype = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_HDRTYPE, 1);
+ /*
+ * When enumerating bus devices, the standard says that
+ * one should check the header type and ignore the slots whose
+ * header types that the software doesn't know about. We use
+ * this to filter out devices.
+ */
+ if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE)
+ continue;
+ if ((hdrtype & PCIM_MFDEV) &&
+ (!found_orion || hdrtype != 0xff))
+ pcifunchigh = PCI_FUNCMAX;
+ else
+ pcifunchigh = 0;
+ for (func = 0; func <= pcifunchigh; func++) {
+ /*
+ * Read the IDs and class from the device.
+ */
+ u_int32_t id;
+ u_int8_t class, subclass, busnum;
+ const char *s;
+ device_t *devs;
+ int ndevs, i;
+
+ id = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_DEVVENDOR, 4);
+ if (id == -1)
+ continue;
+ class = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_CLASS, 1);
+ subclass = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_SUBCLASS, 1);
+
+ s = legacy_pcib_is_host_bridge(bus, slot, func,
+ id, class, subclass,
+ &busnum);
+ if (s == NULL)
+ continue;
+
+ /*
+ * Check to see if the physical bus has already
+ * been seen. Eg: hybrid 32 and 64 bit host
+ * bridges to the same logical bus.
+ */
+ if (device_get_children(parent, &devs, &ndevs) == 0) {
+ for (i = 0; s != NULL && i < ndevs; i++) {
+ if (strcmp(device_get_name(devs[i]),
+ "pcib") != 0)
+ continue;
+ if (legacy_get_pcibus(devs[i]) == busnum)
+ s = NULL;
+ }
+ free(devs, M_TEMP);
+ }
+
+ if (s == NULL)
+ continue;
+ /*
+ * Add at priority 100 to make sure we
+ * go after any motherboard resources
+ */
+ child = BUS_ADD_CHILD(parent, 100,
+ "pcib", busnum);
+ device_set_desc(child, s);
+ legacy_set_pcibus(child, busnum);
+
+ found = 1;
+ if (id == 0x12258086)
+ found824xx = 1;
+ if (id == 0x84c48086)
+ found_orion = 1;
+ }
+ }
+ if (found824xx && bus == 0) {
+ bus++;
+ goto retry;
+ }
- pci_read_config_byte(bus, slot, func, PCI_INTERRUPT_LINE, &irq);
- return irq;
+ /*
+ * Make sure we add at least one bridge since some old
+ * hardware doesn't actually have a host-pci bridge device.
+ * Note that pci_cfgregopen() thinks we have PCI devices..
+ */
+ if (!found) {
+ if (bootverbose)
+ printf(
+ "legacy_pcib_identify: no bridge found, adding pcib0 anyway\n");
+ child = BUS_ADD_CHILD(parent, 100, "pcib", 0);
+ legacy_set_pcibus(child, 0);
+ }
+}
+
+static int
+legacy_pcib_probe(device_t dev)
+{
+
+ if (pci_cfgregopen() == 0)
+ return ENXIO;
+ return -100;
+}
+
+static int
+legacy_pcib_attach(device_t dev)
+{
+ device_t pir;
+ int bus;
+
+ /*
+ * Look for a PCI BIOS interrupt routing table as that will be
+ * our method of routing interrupts if we have one.
+ */
+ bus = pcib_get_bus(dev);
+#ifndef __rtems__
+ if (pci_pir_probe(bus, 0)) {
+ pir = BUS_ADD_CHILD(device_get_parent(dev), 0, "pir", 0);
+ if (pir != NULL)
+ device_probe_and_attach(pir);
+ }
+#else /* __rtems__ */
+#endif /* __rtems__ */
+ device_add_child(dev, "pci", bus);
+ return bus_generic_attach(dev);
+}
+
+int
+legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ *result = 0;
+ return 0;
+ case PCIB_IVAR_BUS:
+ *result = legacy_get_pcibus(dev);
+ return 0;
+ }
+ return ENOENT;
+}
+
+int
+legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ return EINVAL;
+ case PCIB_IVAR_BUS:
+ legacy_set_pcibus(dev, value);
+ return 0;
+ }
+ return ENOENT;
+}
+
+SYSCTL_DECL(_hw_pci);
+
+static unsigned long legacy_host_mem_start = 0x80000000;
+TUNABLE_ULONG("hw.pci.host_mem_start", &legacy_host_mem_start);
+SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN,
+ &legacy_host_mem_start, 0x80000000,
+ "Limit the host bridge memory to being above this address. Must be\n\
+set at boot via a tunable.");
+
+struct resource *
+legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
+ u_long start, u_long end, u_long count, u_int flags)
+{
+ /*
+ * If no memory preference is given, use upper 32MB slot most
+ * bioses use for their memory window. Typically other bridges
+ * before us get in the way to assert their preferences on memory.
+ * Hardcoding like this sucks, so a more MD/MI way needs to be
+ * found to do it. This is typically only used on older laptops
+ * that don't have pci busses behind pci bridge, so assuming > 32MB
+ * is liekly OK.
+ *
+ * However, this can cause problems for other chipsets, so we make
+ * this tunable by hw.pci.host_mem_start.
+ */
+ if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL)
+ start = legacy_host_mem_start;
+ if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL)
+ start = 0x1000;
+ return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
+ count, flags));
+}
+
+static device_method_t legacy_pcib_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, legacy_pcib_identify),
+ DEVMETHOD(device_probe, legacy_pcib_probe),
+ DEVMETHOD(device_attach, legacy_pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, legacy_pcib_maxslots),
+ DEVMETHOD(pcib_read_config, legacy_pcib_read_config),
+ DEVMETHOD(pcib_write_config, legacy_pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, legacy_pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, legacy_pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, legacy_pcib_map_msi),
+
+ { 0, 0 }
+};
+
+static devclass_t hostb_devclass;
+
+DEFINE_CLASS_0(pcib, legacy_pcib_driver, legacy_pcib_methods, 1);
+DRIVER_MODULE(pcib, legacy, legacy_pcib_driver, hostb_devclass, 0, 0);
+
+
+#ifndef __rtems__
+/*
+ * Install placeholder to claim the resources owned by the
+ * PCI bus interface. This could be used to extract the
+ * config space registers in the extreme case where the PnP
+ * ID is available and the PCI BIOS isn't, but for now we just
+ * eat the PnP ID and do nothing else.
+ *
+ * XXX we should silence this probe, as it will generally confuse
+ * people.
+ */
+static struct isa_pnp_id pcibus_pnp_ids[] = {
+ { 0x030ad041 /* PNP0A03 */, "PCI Bus" },
+ { 0x080ad041 /* PNP0A08 */, "PCIe Bus" },
+ { 0 }
+};
+
+static int
+pcibus_pnp_probe(device_t dev)
+{
+ int result;
+
+ if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, pcibus_pnp_ids)) <= 0)
+ device_quiet(dev);
+ return(result);
+}
+
+static int
+pcibus_pnp_attach(device_t dev)
+{
+ return(0);
+}
+
+static device_method_t pcibus_pnp_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibus_pnp_probe),
+ DEVMETHOD(device_attach, pcibus_pnp_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+ { 0, 0 }
+};
+
+static devclass_t pcibus_pnp_devclass;
+
+DEFINE_CLASS_0(pcibus_pnp, pcibus_pnp_driver, pcibus_pnp_methods, 1);
+DRIVER_MODULE(pcibus_pnp, isa, pcibus_pnp_driver, pcibus_pnp_devclass, 0, 0);
+
+
+/*
+ * Provide a PCI-PCI bridge driver for PCI busses behind PCI-PCI bridges
+ * that appear in the PCIBIOS Interrupt Routing Table to use the routing
+ * table for interrupt routing when possible.
+ */
+static int pcibios_pcib_probe(device_t bus);
+
+static device_method_t pcibios_pcib_pci_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibios_pcib_probe),
+ DEVMETHOD(device_attach, pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, pcib_maxslots),
+ DEVMETHOD(pcib_read_config, pcib_read_config),
+ DEVMETHOD(pcib_write_config, pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, pcib_map_msi),
+
+ {0, 0}
+};
+
+static devclass_t pcib_devclass;
+
+DEFINE_CLASS_0(pcib, pcibios_pcib_driver, pcibios_pcib_pci_methods,
+ sizeof(struct pcib_softc));
+DRIVER_MODULE(pcibios_pcib, pci, pcibios_pcib_driver, pcib_devclass, 0, 0);
+
+static int
+pcibios_pcib_probe(device_t dev)
+{
+ int bus;
+
+ if ((pci_get_class(dev) != PCIC_BRIDGE) ||
+ (pci_get_subclass(dev) != PCIS_BRIDGE_PCI))
+ return (ENXIO);
+ bus = pci_read_config(dev, PCIR_SECBUS_1, 1);
+ if (bus == 0)
+ return (ENXIO);
+ if (!pci_pir_probe(bus, 1))
+ return (ENXIO);
+ device_set_desc(dev, "PCIBIOS PCI-PCI bridge");
+ return (-2000);
+}
+
+static int
+pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
+{
+ return (pci_pir_route_interrupt(pci_get_bus(dev), pci_get_slot(dev),
+ pci_get_function(dev), pin));
}
+#endif /* __rtems__ */
diff --git a/freebsd/sys/bfin/bfin/in_cksum.c b/freebsd/sys/bfin/bfin/in_cksum.c
new file mode 100644
index 00000000..c6f7b568
--- /dev/null
+++ b/freebsd/sys/bfin/bfin/in_cksum.c
@@ -0,0 +1,255 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1988, 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ * Copyright (c) 1996
+ * Matt Thomas <matt@3am-software.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)in_cksum.c 8.1 (Berkeley) 6/10/93
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/mbuf.h>
+#include <sys/systm.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <machine/in_cksum.h>
+
+/*
+ * Checksum routine for Internet Protocol family headers
+ * (Portable Alpha version).
+ *
+ * This routine is very heavily used in the network
+ * code and should be modified for each CPU to be as fast as possible.
+ */
+
+#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x)
+#define REDUCE32 \
+ { \
+ q_util.q = sum; \
+ sum = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
+ }
+#define REDUCE16 \
+ { \
+ q_util.q = sum; \
+ l_util.l = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
+ sum = l_util.s[0] + l_util.s[1]; \
+ ADDCARRY(sum); \
+ }
+
+static const u_int32_t in_masks[] = {
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
+ 0x00000000, 0x000000FF, 0x0000FFFF, 0x00FFFFFF, /* offset 0 */
+ 0x00000000, 0x0000FF00, 0x00FFFF00, 0xFFFFFF00, /* offset 1 */
+ 0x00000000, 0x00FF0000, 0xFFFF0000, 0xFFFF0000, /* offset 2 */
+ 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, /* offset 3 */
+#else
+ /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
+ 0x00000000, 0xFF000000, 0xFFFF0000, 0xFFFFFF00, /* offset 0 */
+ 0x00000000, 0x00FF0000, 0x00FFFF00, 0x00FFFFFF, /* offset 1 */
+ 0x00000000, 0x0000FF00, 0x0000FFFF, 0x0000FFFF, /* offset 2 */
+ 0x00000000, 0x000000FF, 0x000000FF, 0x000000FF, /* offset 3 */
+#endif
+};
+
+union l_util {
+ u_int16_t s[2];
+ u_int32_t l;
+};
+union q_util {
+ u_int16_t s[4];
+ u_int32_t l[2];
+ u_int64_t q;
+};
+
+static u_int64_t
+in_cksumdata(const void *buf, int len)
+{
+ const u_int32_t *lw = (const u_int32_t *) buf;
+ u_int64_t sum = 0;
+ u_int64_t prefilled;
+ int offset;
+ union q_util q_util;
+
+ if ((3 & (long) lw) == 0 && len == 20) {
+ sum = (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3] + lw[4];
+ REDUCE32;
+ return sum;
+ }
+
+ if ((offset = 3 & (long) lw) != 0) {
+ const u_int32_t *masks = in_masks + (offset << 2);
+ lw = (u_int32_t *) (((long) lw) - offset);
+ sum = *lw++ & masks[len >= 3 ? 3 : len];
+ len -= 4 - offset;
+ if (len <= 0) {
+ REDUCE32;
+ return sum;
+ }
+ }
+#if 0
+ /*
+ * Force to cache line boundary.
+ */
+ offset = 32 - (0x1f & (long) lw);
+ if (offset < 32 && len > offset) {
+ len -= offset;
+ if (4 & offset) {
+ sum += (u_int64_t) lw[0];
+ lw += 1;
+ }
+ if (8 & offset) {
+ sum += (u_int64_t) lw[0] + lw[1];
+ lw += 2;
+ }
+ if (16 & offset) {
+ sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
+ lw += 4;
+ }
+ }
+#endif
+ /*
+ * access prefilling to start load of next cache line.
+ * then add current cache line
+ * save result of prefilling for loop iteration.
+ */
+ prefilled = lw[0];
+ while ((len -= 32) >= 4) {
+ u_int64_t prefilling = lw[8];
+ sum += prefilled + lw[1] + lw[2] + lw[3]
+ + lw[4] + lw[5] + lw[6] + lw[7];
+ lw += 8;
+ prefilled = prefilling;
+ }
+ if (len >= 0) {
+ sum += prefilled + lw[1] + lw[2] + lw[3]
+ + lw[4] + lw[5] + lw[6] + lw[7];
+ lw += 8;
+ } else {
+ len += 32;
+ }
+ while ((len -= 16) >= 0) {
+ sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
+ lw += 4;
+ }
+ len += 16;
+ while ((len -= 4) >= 0) {
+ sum += (u_int64_t) *lw++;
+ }
+ len += 4;
+ if (len > 0)
+ sum += (u_int64_t) (in_masks[len] & *lw);
+ REDUCE32;
+ return sum;
+}
+
+u_short
+in_addword(u_short a, u_short b)
+{
+ u_int64_t sum = a + b;
+
+ ADDCARRY(sum);
+ return (sum);
+}
+
+u_short
+#ifdef __rtems__
+/* Prototype does not match in FreeBSD code */
+in_pseudo(u_int a, u_int b, u_int c)
+#else
+in_pseudo(u_int32_t a, u_int32_t b, u_int32_t c)
+#endif
+{
+ u_int64_t sum;
+ union q_util q_util;
+ union l_util l_util;
+
+ sum = (u_int64_t) a + b + c;
+ REDUCE16;
+ return (sum);
+}
+
+u_short
+in_cksum_skip(struct mbuf *m, int len, int skip)
+{
+ u_int64_t sum = 0;
+ int mlen = 0;
+ int clen = 0;
+ caddr_t addr;
+ union q_util q_util;
+ union l_util l_util;
+
+ len -= skip;
+ for (; skip && m; m = m->m_next) {
+ if (m->m_len > skip) {
+ mlen = m->m_len - skip;
+ addr = mtod(m, caddr_t) + skip;
+ goto skip_start;
+ } else {
+ skip -= m->m_len;
+ }
+ }
+
+ for (; m && len; m = m->m_next) {
+ if (m->m_len == 0)
+ continue;
+ mlen = m->m_len;
+ addr = mtod(m, caddr_t);
+skip_start:
+ if (len < mlen)
+ mlen = len;
+
+ if ((clen ^ (uintptr_t) addr) & 1)
+ sum += in_cksumdata(addr, mlen) << 8;
+ else
+ sum += in_cksumdata(addr, mlen);
+
+ clen += mlen;
+ len -= mlen;
+ }
+ REDUCE16;
+ return (~sum & 0xffff);
+}
+
+u_int in_cksum_hdr(const struct ip *ip)
+{
+ u_int64_t sum = in_cksumdata(ip, sizeof(struct ip));
+ union q_util q_util;
+ union l_util l_util;
+ REDUCE16;
+ return (~sum & 0xffff);
+}
diff --git a/freebsd/sys/bfin/bfin/legacy.c b/freebsd/sys/bfin/bfin/legacy.c
new file mode 100644
index 00000000..2547990c
--- /dev/null
+++ b/freebsd/sys/bfin/bfin/legacy.c
@@ -0,0 +1,347 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright 1998 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby
+ * granted, provided that both the above copyright notice and this
+ * permission notice appear in all copies, that both the above
+ * copyright notice and this permission notice appear in all
+ * supporting documentation, and that the name of M.I.T. not be used
+ * in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission. M.I.T. makes
+ * no representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
+ * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
+ * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * This code implements a system driver for legacy systems that do not
+ * support ACPI or when ACPI support is not present in the kernel.
+ */
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <machine/bus.h>
+#include <sys/pcpu.h>
+#include <sys/rman.h>
+#include <sys/smp.h>
+
+#ifndef __rtems__
+#include <rtems/bsd/local/opt_mca.h>
+#endif /* __rtems__ */
+#ifdef DEV_MCA
+#include <i386/bios/mca_machdep.h>
+#endif
+
+#include <machine/legacyvar.h>
+#include <machine/resource.h>
+
+static MALLOC_DEFINE(M_LEGACYDEV, "legacydrv", "legacy system device");
+struct legacy_device {
+ int lg_pcibus;
+};
+
+#define DEVTOAT(dev) ((struct legacy_device *)device_get_ivars(dev))
+
+static int legacy_probe(device_t);
+static int legacy_attach(device_t);
+static int legacy_print_child(device_t, device_t);
+static device_t legacy_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static int legacy_read_ivar(device_t, device_t, int, uintptr_t *);
+static int legacy_write_ivar(device_t, device_t, int, uintptr_t);
+
+static device_method_t legacy_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, legacy_probe),
+ DEVMETHOD(device_attach, legacy_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, legacy_print_child),
+ DEVMETHOD(bus_add_child, legacy_add_child),
+ DEVMETHOD(bus_read_ivar, legacy_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_write_ivar),
+ DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t legacy_driver = {
+ "legacy",
+ legacy_methods,
+ 1, /* no softc */
+};
+static devclass_t legacy_devclass;
+
+DRIVER_MODULE(legacy, nexus, legacy_driver, legacy_devclass, 0, 0);
+
+static int
+legacy_probe(device_t dev)
+{
+
+ device_set_desc(dev, "legacy system");
+ device_quiet(dev);
+ return (0);
+}
+
+static int
+legacy_attach(device_t dev)
+{
+ device_t child;
+
+ /*
+ * Let our child drivers identify any child devices that they
+ * can find. Once that is done attach any devices that we
+ * found.
+ */
+ bus_generic_probe(dev);
+ bus_generic_attach(dev);
+
+#ifndef PC98
+ /*
+ * If we didn't see EISA or ISA on a pci bridge, create some
+ * connection points now so they show up "on motherboard".
+ */
+ if (!devclass_get_device(devclass_find("eisa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "eisa", 0);
+ if (child == NULL)
+ panic("legacy_attach eisa");
+ device_probe_and_attach(child);
+ }
+#endif
+#ifdef DEV_MCA
+ if (MCA_system && !devclass_get_device(devclass_find("mca"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "mca", 0);
+ if (child == 0)
+ panic("legacy_probe mca");
+ device_probe_and_attach(child);
+ }
+#endif
+ if (!devclass_get_device(devclass_find("isa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "isa", 0);
+ if (child == NULL)
+ panic("legacy_attach isa");
+ device_probe_and_attach(child);
+ }
+
+ return 0;
+}
+
+static int
+legacy_print_child(device_t bus, device_t child)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+ int retval = 0;
+
+ retval += bus_print_child_header(bus, child);
+ if (atdev->lg_pcibus != -1)
+ retval += printf(" pcibus %d", atdev->lg_pcibus);
+ retval += printf(" on motherboard\n"); /* XXX "motherboard", ick */
+
+ return (retval);
+}
+
+static device_t
+legacy_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ device_t child;
+ struct legacy_device *atdev;
+
+ atdev = malloc(sizeof(struct legacy_device), M_LEGACYDEV,
+ M_NOWAIT | M_ZERO);
+ if (atdev == NULL)
+ return(NULL);
+ atdev->lg_pcibus = -1;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child == NULL)
+ free(atdev, M_LEGACYDEV);
+ else
+ /* should we free this in legacy_child_detached? */
+ device_set_ivars(child, atdev);
+
+ return (child);
+}
+
+static int
+legacy_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ *result = 0;
+ break;
+ case LEGACY_IVAR_PCIBUS:
+ *result = atdev->lg_pcibus;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+
+static int
+legacy_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ return EINVAL;
+ case LEGACY_IVAR_PCIBUS:
+ atdev->lg_pcibus = value;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+/*
+ * Legacy CPU attachment when ACPI is not available. Drivers like
+ * cpufreq(4) hang off this.
+ */
+static void cpu_identify(driver_t *driver, device_t parent);
+static int cpu_read_ivar(device_t dev, device_t child, int index,
+ uintptr_t *result);
+static device_t cpu_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static struct resource_list *cpu_get_rlist(device_t dev, device_t child);
+
+struct cpu_device {
+ struct resource_list cd_rl;
+ struct pcpu *cd_pcpu;
+};
+
+static device_method_t cpu_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, cpu_identify),
+ DEVMETHOD(device_probe, bus_generic_probe),
+ DEVMETHOD(device_attach, bus_generic_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_add_child, cpu_add_child),
+ DEVMETHOD(bus_read_ivar, cpu_read_ivar),
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_get_resource_list, cpu_get_rlist),
+ DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
+ DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource),
+ DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource),
+ DEVMETHOD(bus_driver_added, bus_generic_driver_added),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t cpu_driver = {
+ "cpu",
+ cpu_methods,
+ 1, /* no softc */
+};
+static devclass_t cpu_devclass;
+DRIVER_MODULE(cpu, legacy, cpu_driver, cpu_devclass, 0, 0);
+
+static void
+cpu_identify(driver_t *driver, device_t parent)
+{
+ device_t child;
+ int i;
+
+ /*
+ * Attach a cpuX device for each CPU. We use an order of 150
+ * so that these devices are attached after the Host-PCI
+ * bridges (which are added at order 100).
+ */
+ for (i = 0; i <= mp_maxid; i++)
+ if (!CPU_ABSENT(i)) {
+ child = BUS_ADD_CHILD(parent, 150, "cpu", i);
+ if (child == NULL)
+ panic("legacy_attach cpu");
+ }
+}
+
+static device_t
+cpu_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ struct cpu_device *cd;
+ device_t child;
+ struct pcpu *pc;
+
+ if ((cd = malloc(sizeof(*cd), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL)
+ return (NULL);
+
+ resource_list_init(&cd->cd_rl);
+ pc = pcpu_find(device_get_unit(bus));
+ cd->cd_pcpu = pc;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child != NULL) {
+ pc->pc_device = child;
+ device_set_ivars(child, cd);
+ } else
+ free(cd, M_DEVBUF);
+ return (child);
+}
+
+static struct resource_list *
+cpu_get_rlist(device_t dev, device_t child)
+{
+ struct cpu_device *cpdev;
+
+ cpdev = device_get_ivars(child);
+ return (&cpdev->cd_rl);
+}
+
+static int
+cpu_read_ivar(device_t dev, device_t child, int index, uintptr_t *result)
+{
+ struct cpu_device *cpdev;
+
+ if (index != CPU_IVAR_PCPU)
+ return (ENOENT);
+ cpdev = device_get_ivars(child);
+ *result = (uintptr_t)cpdev->cd_pcpu;
+ return (0);
+}
diff --git a/freebsd/sys/bfin/include/machine/in_cksum.h b/freebsd/sys/bfin/include/machine/in_cksum.h
index 4539d129..37d88e2e 100644
--- a/freebsd/sys/bfin/include/machine/in_cksum.h
+++ b/freebsd/sys/bfin/include/machine/in_cksum.h
@@ -33,10 +33,10 @@
* $FreeBSD$
*/
-#ifndef _MACHINE_IN_CKSUM_HH_
-#define _MACHINE_IN_CKSUM_HH_ 1
+#ifndef _MACHINE_IN_CKSUM_H_
+#define _MACHINE_IN_CKSUM_H_ 1
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
#define in_cksum(m, len) in_cksum_skip(m, len, 0)
@@ -74,4 +74,4 @@ u_short in_pseudo(u_int sum, u_int b, u_int c);
u_short in_cksum_skip(struct mbuf *m, int len, int skip);
#endif
-#endif /* _MACHINE_IN_CKSUM_HH_ */
+#endif /* _MACHINE_IN_CKSUM_H_ */
diff --git a/freebsd/sys/bfin/include/machine/legacyvar.h b/freebsd/sys/bfin/include/machine/legacyvar.h
new file mode 100644
index 00000000..0b0fa433
--- /dev/null
+++ b/freebsd/sys/bfin/include/machine/legacyvar.h
@@ -0,0 +1,57 @@
+/*-
+ * Copyright (c) 2000 Peter Wemm <peter@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_LEGACYVAR_H_
+#define _MACHINE_LEGACYVAR_H_
+
+enum legacy_device_ivars {
+ LEGACY_IVAR_PCIDOMAIN,
+ LEGACY_IVAR_PCIBUS
+};
+
+#define LEGACY_ACCESSOR(var, ivar, type) \
+ __BUS_ACCESSOR(legacy, var, LEGACY, ivar, type)
+
+LEGACY_ACCESSOR(pcidomain, PCIDOMAIN, uint32_t)
+LEGACY_ACCESSOR(pcibus, PCIBUS, uint32_t)
+
+#undef LEGACY_ACCESSOR
+
+int legacy_pcib_maxslots(device_t dev);
+uint32_t legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes);
+int legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result);
+void legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes);
+int legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value);
+struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child,
+ int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
+
+#endif /* !_MACHINE_LEGACYVAR_H_ */
diff --git a/freebsd/sys/bfin/include/machine/pci_cfgreg.h b/freebsd/sys/bfin/include/machine/pci_cfgreg.h
new file mode 100644
index 00000000..bc72418d
--- /dev/null
+++ b/freebsd/sys/bfin/include/machine/pci_cfgreg.h
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
+ */
+
+#define CONF1_ADDR_PORT 0x0cf8
+#define CONF1_DATA_PORT 0x0cfc
+
+#define CONF1_ENABLE 0x80000000ul
+#define CONF1_ENABLE_CHK 0x80000000ul
+#define CONF1_ENABLE_MSK 0x7f000000ul
+#define CONF1_ENABLE_CHK1 0xff000001ul
+#define CONF1_ENABLE_MSK1 0x80000001ul
+#define CONF1_ENABLE_RES1 0x80000000ul
+
+#define CONF2_ENABLE_PORT 0x0cf8
+#define CONF2_FORWARD_PORT 0x0cfa
+
+#define CONF2_ENABLE_CHK 0x0e
+#define CONF2_ENABLE_RES 0x0e
+
+int pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus);
+int pci_cfgregopen(void);
+u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes);
+void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes);
+void pci_pir_open(void);
+int pci_pir_probe(int bus, int require_parse);
+int pci_pir_route_interrupt(int bus, int device, int func, int pin);
diff --git a/freebsd/sys/bfin/pci/pci_bus.c b/freebsd/sys/bfin/pci/pci_bus.c
new file mode 100644
index 00000000..6627db98
--- /dev/null
+++ b/freebsd/sys/bfin/pci/pci_bus.c
@@ -0,0 +1,729 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/local/opt_cpu.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
+
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcib_private.h>
+#include <isa/isavar.h>
+#ifdef CPU_ELAN
+#include <machine/md_var.h>
+#endif
+#include <machine/legacyvar.h>
+#include <machine/pci_cfgreg.h>
+#include <machine/resource.h>
+
+#include <rtems/bsd/local/pcib_if.h>
+
+#ifndef __rtems__
+static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev,
+ int pin);
+#else /* __rtems__ */
+int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin);
+#endif /* __rtems__ */
+
+
+int
+legacy_pcib_maxslots(device_t dev)
+{
+ return 31;
+}
+
+/* read configuration space register */
+
+#ifdef __rtems__
+uint32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#else
+u_int32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#endif
+{
+ return(pci_cfgregread(bus, slot, func, reg, bytes));
+}
+
+/* write configuration space register */
+
+void
+legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes)
+{
+ pci_cfgregwrite(bus, slot, func, reg, data, bytes);
+}
+
+/* Pass MSI requests up to the nexus. */
+
+static int
+legacy_pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount,
+ int *irqs)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSI(device_get_parent(bus), dev, count, maxcount,
+ irqs));
+}
+
+static int
+legacy_pcib_alloc_msix(device_t pcib, device_t dev, int *irq)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq));
+}
+
+static int
+legacy_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr,
+ uint32_t *data)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data));
+}
+
+static const char *
+legacy_pcib_is_host_bridge(int bus, int slot, int func,
+ uint32_t id, uint8_t class, uint8_t subclass,
+ uint8_t *busnum)
+{
+ const char *s = NULL;
+ static uint8_t pxb[4]; /* hack for 450nx */
+
+ *busnum = 0;
+
+ switch (id) {
+ case 0x12258086:
+ s = "Intel 824?? host to PCI bridge";
+ /* XXX This is a guess */
+ /* *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x41, 1); */
+ *busnum = bus;
+ break;
+ case 0x71208086:
+ s = "Intel 82810 (i810 GMCH) Host To Hub bridge";
+ break;
+ case 0x71228086:
+ s = "Intel 82810-DC100 (i810-DC100 GMCH) Host To Hub bridge";
+ break;
+ case 0x71248086:
+ s = "Intel 82810E (i810E GMCH) Host To Hub bridge";
+ break;
+ case 0x11308086:
+ s = "Intel 82815 (i815 GMCH) Host To Hub bridge";
+ break;
+ case 0x71808086:
+ s = "Intel 82443LX (440 LX) host to PCI bridge";
+ break;
+ case 0x71908086:
+ s = "Intel 82443BX (440 BX) host to PCI bridge";
+ break;
+ case 0x71928086:
+ s = "Intel 82443BX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x71948086:
+ s = "Intel 82443MX host to PCI bridge";
+ break;
+ case 0x71a08086:
+ s = "Intel 82443GX host to PCI bridge";
+ break;
+ case 0x71a18086:
+ s = "Intel 82443GX host to AGP bridge";
+ break;
+ case 0x71a28086:
+ s = "Intel 82443GX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x84c48086:
+ s = "Intel 82454KX/GX (Orion) host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x4a, 1);
+ break;
+ case 0x84ca8086:
+ /*
+ * For the 450nx chipset, there is a whole bundle of
+ * things pretending to be host bridges. The MIOC will
+ * be seen first and isn't really a pci bridge (the
+ * actual busses are attached to the PXB's). We need to
+ * read the registers of the MIOC to figure out the
+ * bus numbers for the PXB channels.
+ *
+ * Since the MIOC doesn't have a pci bus attached, we
+ * pretend it wasn't there.
+ */
+ pxb[0] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd0, 1); /* BUSNO[0] */
+ pxb[1] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd1, 1) + 1; /* SUBA[0]+1 */
+ pxb[2] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd3, 1); /* BUSNO[1] */
+ pxb[3] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd4, 1) + 1; /* SUBA[1]+1 */
+ return NULL;
+ case 0x84cb8086:
+ switch (slot) {
+ case 0x12:
+ s = "Intel 82454NX PXB#0, Bus#A";
+ *busnum = pxb[0];
+ break;
+ case 0x13:
+ s = "Intel 82454NX PXB#0, Bus#B";
+ *busnum = pxb[1];
+ break;
+ case 0x14:
+ s = "Intel 82454NX PXB#1, Bus#A";
+ *busnum = pxb[2];
+ break;
+ case 0x15:
+ s = "Intel 82454NX PXB#1, Bus#B";
+ *busnum = pxb[3];
+ break;
+ }
+ break;
+ case 0x1A308086:
+ s = "Intel 82845 Host to PCI bridge";
+ break;
+
+ /* AMD -- vendor 0x1022 */
+ case 0x30001022:
+ s = "AMD Elan SC520 host to PCI bridge";
+#ifdef CPU_ELAN
+ init_AMD_Elan_sc520();
+#else
+ printf(
+"*** WARNING: missing CPU_ELAN -- timekeeping may be wrong\n");
+#endif
+ break;
+ case 0x70061022:
+ s = "AMD-751 host to PCI bridge";
+ break;
+ case 0x700e1022:
+ s = "AMD-761 host to PCI bridge";
+ break;
+
+ /* SiS -- vendor 0x1039 */
+ case 0x04961039:
+ s = "SiS 85c496";
+ break;
+ case 0x04061039:
+ s = "SiS 85c501";
+ break;
+ case 0x06011039:
+ s = "SiS 85c601";
+ break;
+ case 0x55911039:
+ s = "SiS 5591 host to PCI bridge";
+ break;
+ case 0x00011039:
+ s = "SiS 5591 host to AGP bridge";
+ break;
+
+ /* VLSI -- vendor 0x1004 */
+ case 0x00051004:
+ s = "VLSI 82C592 Host to PCI bridge";
+ break;
+
+ /* XXX Here is MVP3, I got the datasheet but NO M/B to test it */
+ /* totally. Please let me know if anything wrong. -F */
+ /* XXX need info on the MVP3 -- any takers? */
+ case 0x05981106:
+ s = "VIA 82C598MVP (Apollo MVP3) host bridge";
+ break;
+
+ /* AcerLabs -- vendor 0x10b9 */
+ /* Funny : The datasheet told me vendor id is "10b8",sub-vendor */
+ /* id is '10b9" but the register always shows "10b9". -Foxfair */
+ case 0x154110b9:
+ s = "AcerLabs M1541 (Aladdin-V) PCI host bridge";
+ break;
+
+ /* OPTi -- vendor 0x1045 */
+ case 0xc7011045:
+ s = "OPTi 82C700 host to PCI bridge";
+ break;
+ case 0xc8221045:
+ s = "OPTi 82C822 host to PCI Bridge";
+ break;
+
+ /* ServerWorks -- vendor 0x1166 */
+ case 0x00051166:
+ s = "ServerWorks NB6536 2.0HE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00061166:
+ /* FALLTHROUGH */
+ case 0x00081166:
+ /* FALLTHROUGH */
+ case 0x02011166:
+ /* FALLTHROUGH */
+ case 0x010f1014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00091166:
+ s = "ServerWorks NB6635 3.0LE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00101166:
+ s = "ServerWorks CIOB30 host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00111166:
+ /* FALLTHROUGH */
+ case 0x03021014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks CMIC-HE host to PCI-X bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* XXX unknown chipset, but working */
+ case 0x00171166:
+ /* FALLTHROUGH */
+ case 0x01011166:
+ case 0x01101166:
+ case 0x02251166:
+ s = "ServerWorks host to PCI bridge(unknown chipset)";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* Compaq/HP -- vendor 0x0e11 */
+ case 0x60100e11:
+ s = "Compaq/HP Model 6010 HotPlug PCI Bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0xc8, 1);
+ break;
+
+ /* Integrated Micro Solutions -- vendor 0x10e0 */
+ case 0x884910e0:
+ s = "Integrated Micro Solutions VL Bridge";
+ break;
+
+ default:
+ if (class == PCIC_BRIDGE && subclass == PCIS_BRIDGE_HOST)
+ s = "Host to PCI bridge";
+ break;
+ }
+
+ return s;
+}
+
+/*
+ * Scan the first pci bus for host-pci bridges and add pcib instances
+ * to the nexus for each bridge.
+ */
+static void
+legacy_pcib_identify(driver_t *driver, device_t parent)
+{
+ int bus, slot, func;
+ u_int8_t hdrtype;
+ int found = 0;
+ int pcifunchigh;
+ int found824xx = 0;
+ int found_orion = 0;
+ device_t child;
+ devclass_t pci_devclass;
+
+ if (pci_cfgregopen() == 0)
+ return;
+ /*
+ * Check to see if we haven't already had a PCI bus added
+ * via some other means. If we have, bail since otherwise
+ * we're going to end up duplicating it.
+ */
+ if ((pci_devclass = devclass_find("pci")) &&
+ devclass_get_device(pci_devclass, 0))
+ return;
+
+
+ bus = 0;
+ retry:
+ for (slot = 0; slot <= PCI_SLOTMAX; slot++) {
+ func = 0;
+ hdrtype = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_HDRTYPE, 1);
+ /*
+ * When enumerating bus devices, the standard says that
+ * one should check the header type and ignore the slots whose
+ * header types that the software doesn't know about. We use
+ * this to filter out devices.
+ */
+ if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE)
+ continue;
+ if ((hdrtype & PCIM_MFDEV) &&
+ (!found_orion || hdrtype != 0xff))
+ pcifunchigh = PCI_FUNCMAX;
+ else
+ pcifunchigh = 0;
+ for (func = 0; func <= pcifunchigh; func++) {
+ /*
+ * Read the IDs and class from the device.
+ */
+ u_int32_t id;
+ u_int8_t class, subclass, busnum;
+ const char *s;
+ device_t *devs;
+ int ndevs, i;
+
+ id = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_DEVVENDOR, 4);
+ if (id == -1)
+ continue;
+ class = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_CLASS, 1);
+ subclass = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_SUBCLASS, 1);
+
+ s = legacy_pcib_is_host_bridge(bus, slot, func,
+ id, class, subclass,
+ &busnum);
+ if (s == NULL)
+ continue;
+
+ /*
+ * Check to see if the physical bus has already
+ * been seen. Eg: hybrid 32 and 64 bit host
+ * bridges to the same logical bus.
+ */
+ if (device_get_children(parent, &devs, &ndevs) == 0) {
+ for (i = 0; s != NULL && i < ndevs; i++) {
+ if (strcmp(device_get_name(devs[i]),
+ "pcib") != 0)
+ continue;
+ if (legacy_get_pcibus(devs[i]) == busnum)
+ s = NULL;
+ }
+ free(devs, M_TEMP);
+ }
+
+ if (s == NULL)
+ continue;
+ /*
+ * Add at priority 100 to make sure we
+ * go after any motherboard resources
+ */
+ child = BUS_ADD_CHILD(parent, 100,
+ "pcib", busnum);
+ device_set_desc(child, s);
+ legacy_set_pcibus(child, busnum);
+
+ found = 1;
+ if (id == 0x12258086)
+ found824xx = 1;
+ if (id == 0x84c48086)
+ found_orion = 1;
+ }
+ }
+ if (found824xx && bus == 0) {
+ bus++;
+ goto retry;
+ }
+
+ /*
+ * Make sure we add at least one bridge since some old
+ * hardware doesn't actually have a host-pci bridge device.
+ * Note that pci_cfgregopen() thinks we have PCI devices..
+ */
+ if (!found) {
+ if (bootverbose)
+ printf(
+ "legacy_pcib_identify: no bridge found, adding pcib0 anyway\n");
+ child = BUS_ADD_CHILD(parent, 100, "pcib", 0);
+ legacy_set_pcibus(child, 0);
+ }
+}
+
+static int
+legacy_pcib_probe(device_t dev)
+{
+
+ if (pci_cfgregopen() == 0)
+ return ENXIO;
+ return -100;
+}
+
+static int
+legacy_pcib_attach(device_t dev)
+{
+ device_t pir;
+ int bus;
+
+ /*
+ * Look for a PCI BIOS interrupt routing table as that will be
+ * our method of routing interrupts if we have one.
+ */
+ bus = pcib_get_bus(dev);
+#ifndef __rtems__
+ if (pci_pir_probe(bus, 0)) {
+ pir = BUS_ADD_CHILD(device_get_parent(dev), 0, "pir", 0);
+ if (pir != NULL)
+ device_probe_and_attach(pir);
+ }
+#else /* __rtems__ */
+#endif /* __rtems__ */
+ device_add_child(dev, "pci", bus);
+ return bus_generic_attach(dev);
+}
+
+int
+legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ *result = 0;
+ return 0;
+ case PCIB_IVAR_BUS:
+ *result = legacy_get_pcibus(dev);
+ return 0;
+ }
+ return ENOENT;
+}
+
+int
+legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ return EINVAL;
+ case PCIB_IVAR_BUS:
+ legacy_set_pcibus(dev, value);
+ return 0;
+ }
+ return ENOENT;
+}
+
+SYSCTL_DECL(_hw_pci);
+
+static unsigned long legacy_host_mem_start = 0x80000000;
+TUNABLE_ULONG("hw.pci.host_mem_start", &legacy_host_mem_start);
+SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN,
+ &legacy_host_mem_start, 0x80000000,
+ "Limit the host bridge memory to being above this address. Must be\n\
+set at boot via a tunable.");
+
+struct resource *
+legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
+ u_long start, u_long end, u_long count, u_int flags)
+{
+ /*
+ * If no memory preference is given, use upper 32MB slot most
+ * bioses use for their memory window. Typically other bridges
+ * before us get in the way to assert their preferences on memory.
+ * Hardcoding like this sucks, so a more MD/MI way needs to be
+ * found to do it. This is typically only used on older laptops
+ * that don't have pci busses behind pci bridge, so assuming > 32MB
+ * is liekly OK.
+ *
+ * However, this can cause problems for other chipsets, so we make
+ * this tunable by hw.pci.host_mem_start.
+ */
+ if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL)
+ start = legacy_host_mem_start;
+ if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL)
+ start = 0x1000;
+ return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
+ count, flags));
+}
+
+static device_method_t legacy_pcib_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, legacy_pcib_identify),
+ DEVMETHOD(device_probe, legacy_pcib_probe),
+ DEVMETHOD(device_attach, legacy_pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, legacy_pcib_maxslots),
+ DEVMETHOD(pcib_read_config, legacy_pcib_read_config),
+ DEVMETHOD(pcib_write_config, legacy_pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, legacy_pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, legacy_pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, legacy_pcib_map_msi),
+
+ { 0, 0 }
+};
+
+static devclass_t hostb_devclass;
+
+DEFINE_CLASS_0(pcib, legacy_pcib_driver, legacy_pcib_methods, 1);
+DRIVER_MODULE(pcib, legacy, legacy_pcib_driver, hostb_devclass, 0, 0);
+
+
+#ifndef __rtems__
+/*
+ * Install placeholder to claim the resources owned by the
+ * PCI bus interface. This could be used to extract the
+ * config space registers in the extreme case where the PnP
+ * ID is available and the PCI BIOS isn't, but for now we just
+ * eat the PnP ID and do nothing else.
+ *
+ * XXX we should silence this probe, as it will generally confuse
+ * people.
+ */
+static struct isa_pnp_id pcibus_pnp_ids[] = {
+ { 0x030ad041 /* PNP0A03 */, "PCI Bus" },
+ { 0x080ad041 /* PNP0A08 */, "PCIe Bus" },
+ { 0 }
+};
+
+static int
+pcibus_pnp_probe(device_t dev)
+{
+ int result;
+
+ if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, pcibus_pnp_ids)) <= 0)
+ device_quiet(dev);
+ return(result);
+}
+
+static int
+pcibus_pnp_attach(device_t dev)
+{
+ return(0);
+}
+
+static device_method_t pcibus_pnp_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibus_pnp_probe),
+ DEVMETHOD(device_attach, pcibus_pnp_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+ { 0, 0 }
+};
+
+static devclass_t pcibus_pnp_devclass;
+
+DEFINE_CLASS_0(pcibus_pnp, pcibus_pnp_driver, pcibus_pnp_methods, 1);
+DRIVER_MODULE(pcibus_pnp, isa, pcibus_pnp_driver, pcibus_pnp_devclass, 0, 0);
+
+
+/*
+ * Provide a PCI-PCI bridge driver for PCI busses behind PCI-PCI bridges
+ * that appear in the PCIBIOS Interrupt Routing Table to use the routing
+ * table for interrupt routing when possible.
+ */
+static int pcibios_pcib_probe(device_t bus);
+
+static device_method_t pcibios_pcib_pci_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibios_pcib_probe),
+ DEVMETHOD(device_attach, pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, pcib_maxslots),
+ DEVMETHOD(pcib_read_config, pcib_read_config),
+ DEVMETHOD(pcib_write_config, pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, pcib_map_msi),
+
+ {0, 0}
+};
+
+static devclass_t pcib_devclass;
+
+DEFINE_CLASS_0(pcib, pcibios_pcib_driver, pcibios_pcib_pci_methods,
+ sizeof(struct pcib_softc));
+DRIVER_MODULE(pcibios_pcib, pci, pcibios_pcib_driver, pcib_devclass, 0, 0);
+
+static int
+pcibios_pcib_probe(device_t dev)
+{
+ int bus;
+
+ if ((pci_get_class(dev) != PCIC_BRIDGE) ||
+ (pci_get_subclass(dev) != PCIS_BRIDGE_PCI))
+ return (ENXIO);
+ bus = pci_read_config(dev, PCIR_SECBUS_1, 1);
+ if (bus == 0)
+ return (ENXIO);
+ if (!pci_pir_probe(bus, 1))
+ return (ENXIO);
+ device_set_desc(dev, "PCIBIOS PCI-PCI bridge");
+ return (-2000);
+}
+
+static int
+pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
+{
+ return (pci_pir_route_interrupt(pci_get_bus(dev), pci_get_slot(dev),
+ pci_get_function(dev), pin));
+}
+#endif /* __rtems__ */
diff --git a/freebsd/sys/bsm/audit.h b/freebsd/sys/bsm/audit.h
index 98ee45c8..42e1e171 100644
--- a/freebsd/sys/bsm/audit.h
+++ b/freebsd/sys/bsm/audit.h
@@ -33,8 +33,8 @@
#ifndef _BSM_AUDIT_H
#define _BSM_AUDIT_H
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
#define AUDIT_RECORD_MAGIC 0x828a0f1b
#define MAX_AUDIT_RECORDS 20
@@ -316,7 +316,7 @@ int getaudit_addr(struct auditinfo_addr *, int);
int setaudit_addr(const struct auditinfo_addr *, int);
#ifdef __APPLE_API_PRIVATE
-#include <freebsd/mach/port.h>
+#include <mach/port.h>
mach_port_name_t audit_session_self(void);
au_asid_t audit_session_join(mach_port_name_t port);
#endif /* __APPLE_API_PRIVATE */
diff --git a/freebsd/sys/bsm/audit_kevents.h b/freebsd/sys/bsm/audit_kevents.h
index 82580920..f4f77a55 100644
--- a/freebsd/sys/bsm/audit_kevents.h
+++ b/freebsd/sys/bsm/audit_kevents.h
@@ -30,8 +30,8 @@
* $FreeBSD$
*/
-#ifndef _BSM_AUDIT_KEVENTS_HH_
-#define _BSM_AUDIT_KEVENTS_HH_
+#ifndef _BSM_AUDIT_KEVENTS_H_
+#define _BSM_AUDIT_KEVENTS_H_
/*
* The reserved event numbers for kernel events are 1...2047 and 43001..44900.
@@ -796,4 +796,4 @@
#define AUE_WORKQOPEN AUE_NULL
#define AUE_WORKQOPS AUE_NULL
-#endif /* !_BSM_AUDIT_KEVENTS_HH_ */
+#endif /* !_BSM_AUDIT_KEVENTS_H_ */
diff --git a/freebsd/sys/cam/ata/ata_all.h b/freebsd/sys/cam/ata/ata_all.h
index 6b23bd79..2e838fdc 100644
--- a/freebsd/sys/cam/ata/ata_all.h
+++ b/freebsd/sys/cam/ata/ata_all.h
@@ -29,7 +29,7 @@
#ifndef CAM_ATA_ALL_H
#define CAM_ATA_ALL_H 1
-#include <freebsd/sys/ata.h>
+#include <sys/ata.h>
struct ccb_ataio;
struct cam_periph;
diff --git a/freebsd/sys/cam/cam.c b/freebsd/sys/cam/cam.c
index 852d1d5b..5b21ae8a 100644
--- a/freebsd/sys/cam/cam.c
+++ b/freebsd/sys/cam/cam.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Generic utility routines for the Common Access Method layer.
@@ -28,29 +28,29 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
+#include <rtems/bsd/sys/param.h>
#ifdef _KERNEL
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/sysctl.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
#else /* _KERNEL */
-#include <freebsd/stdlib.h>
-#include <freebsd/stdio.h>
-#include <freebsd/camlib.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <camlib.h>
#endif /* _KERNEL */
-#include <freebsd/cam/cam.h>
-#include <freebsd/cam/cam_ccb.h>
-#include <freebsd/cam/scsi/scsi_all.h>
-#include <freebsd/sys/sbuf.h>
+#include <cam/cam.h>
+#include <cam/cam_ccb.h>
+#include <cam/scsi/scsi_all.h>
+#include <sys/sbuf.h>
#ifdef _KERNEL
-#include <freebsd/sys/libkern.h>
-#include <freebsd/cam/cam_queue.h>
-#include <freebsd/cam/cam_xpt.h>
+#include <sys/libkern.h>
+#include <cam/cam_queue.h>
+#include <cam/cam_xpt.h>
#endif
static int camstatusentrycomp(const void *key, const void *member);
diff --git a/freebsd/sys/cam/cam.h b/freebsd/sys/cam/cam.h
index 6533fa42..5a58db6c 100644
--- a/freebsd/sys/cam/cam.h
+++ b/freebsd/sys/cam/cam.h
@@ -33,13 +33,13 @@
#ifdef _KERNEL
#ifndef __rtems__
-#include <freebsd/opt_cam.h>
+#include <opt_cam.h>
#else /* __rtems__ */
-#include <freebsd/local/opt_cam.h>
+#include <rtems/bsd/local/opt_cam.h>
#endif /* __rtems__ */
#endif
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
typedef u_int path_id_t;
typedef u_int target_id_t;
diff --git a/freebsd/sys/cam/cam_ccb.h b/freebsd/sys/cam/cam_ccb.h
index d8b14458..89042942 100644
--- a/freebsd/sys/cam/cam_ccb.h
+++ b/freebsd/sys/cam/cam_ccb.h
@@ -31,16 +31,16 @@
#ifndef _CAM_CAM_CCB_H
#define _CAM_CAM_CCB_H 1
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/limits.h>
+#include <sys/queue.h>
+#include <sys/cdefs.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/limits.h>
#ifndef _KERNEL
-#include <freebsd/sys/callout.h>
+#include <sys/callout.h>
#endif
-#include <freebsd/cam/cam_debug.h>
-#include <freebsd/cam/scsi/scsi_all.h>
-#include <freebsd/cam/ata/ata_all.h>
+#include <cam/cam_debug.h>
+#include <cam/scsi/scsi_all.h>
+#include <cam/ata/ata_all.h>
#ifdef __rtems__
#include <rtems/blkdev.h>
diff --git a/freebsd/sys/cam/cam_periph.h b/freebsd/sys/cam/cam_periph.h
index 8bf8fd21..33e9f758 100644
--- a/freebsd/sys/cam/cam_periph.h
+++ b/freebsd/sys/cam/cam_periph.h
@@ -31,8 +31,8 @@
#ifndef _CAM_CAM_PERIPH_H
#define _CAM_CAM_PERIPH_H 1
-#include <freebsd/sys/queue.h>
-#include <freebsd/cam/cam_sim.h>
+#include <sys/queue.h>
+#include <cam/cam_sim.h>
#ifdef _KERNEL
@@ -44,7 +44,7 @@ extern struct periph_driver **periph_drivers;
void periphdriver_register(void *);
void periphdriver_init(int level);
-#include <freebsd/sys/module.h>
+#include <sys/module.h>
#define PERIPHDRIVER_DECLARE(name, driver) \
static int name ## _modevent(module_t mod, int type, void *data) \
{ \
diff --git a/freebsd/sys/cam/cam_xpt_sim.h b/freebsd/sys/cam/cam_xpt_sim.h
index 32c3082b..323f786c 100644
--- a/freebsd/sys/cam/cam_xpt_sim.h
+++ b/freebsd/sys/cam/cam_xpt_sim.h
@@ -32,8 +32,8 @@
#ifndef _CAM_CAM_XPT_SIM_H
#define _CAM_CAM_XPT_SIM_H 1
-#include <freebsd/cam/cam_xpt.h>
-#include <freebsd/cam/cam_queue.h>
+#include <cam/cam_xpt.h>
+#include <cam/cam_queue.h>
/* Functions accessed by SIM drivers */
#ifdef _KERNEL
diff --git a/freebsd/sys/cam/scsi/scsi_all.c b/freebsd/sys/cam/scsi/scsi_all.c
index a25a20b8..324a8e3a 100644
--- a/freebsd/sys/cam/scsi/scsi_all.c
+++ b/freebsd/sys/cam/scsi/scsi_all.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Implementation of Utility functions for all SCSI device types.
@@ -29,37 +29,37 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
+#include <rtems/bsd/sys/param.h>
#ifdef _KERNEL
#ifndef __rtems__
-#include <freebsd/opt_scsi.h>
+#include <opt_scsi.h>
#else /* __rtems__ */
-#include <freebsd/local/opt_scsi.h>
+#include <rtems/bsd/local/opt_scsi.h>
#endif /* __rtems__ */
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/libkern.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/sysctl.h>
+#include <sys/systm.h>
+#include <sys/libkern.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
#else
-#include <freebsd/errno.h>
-#include <freebsd/stdio.h>
-#include <freebsd/stdlib.h>
-#include <freebsd/string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#endif
-#include <freebsd/cam/cam.h>
-#include <freebsd/cam/cam_ccb.h>
-#include <freebsd/cam/cam_queue.h>
-#include <freebsd/cam/cam_xpt.h>
-#include <freebsd/cam/scsi/scsi_all.h>
-#include <freebsd/sys/sbuf.h>
+#include <cam/cam.h>
+#include <cam/cam_ccb.h>
+#include <cam/cam_queue.h>
+#include <cam/cam_xpt.h>
+#include <cam/scsi/scsi_all.h>
+#include <sys/sbuf.h>
#ifndef _KERNEL
-#include <freebsd/camlib.h>
+#include <camlib.h>
#ifndef FALSE
#define FALSE 0
diff --git a/freebsd/sys/cam/scsi/scsi_all.h b/freebsd/sys/cam/scsi/scsi_all.h
index 47908b82..cddf4f9f 100644
--- a/freebsd/sys/cam/scsi/scsi_all.h
+++ b/freebsd/sys/cam/scsi/scsi_all.h
@@ -24,7 +24,7 @@
#ifndef _SCSI_SCSI_ALL_H
#define _SCSI_SCSI_ALL_H 1
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
#ifdef _KERNEL
/*
diff --git a/freebsd/sys/cam/scsi/scsi_da.h b/freebsd/sys/cam/scsi/scsi_da.h
index 69dafefc..da099f69 100644
--- a/freebsd/sys/cam/scsi/scsi_da.h
+++ b/freebsd/sys/cam/scsi/scsi_da.h
@@ -52,7 +52,7 @@
#ifndef _SCSI_SCSI_DA_H
#define _SCSI_SCSI_DA_H 1
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
struct scsi_rezero_unit
{
diff --git a/freebsd/sys/contrib/altq/altq/altq.h b/freebsd/sys/contrib/altq/altq/altq.h
index 2c9e3536..9319e44c 100644
--- a/freebsd/sys/contrib/altq/altq/altq.h
+++ b/freebsd/sys/contrib/altq/altq/altq.h
@@ -26,8 +26,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-#ifndef _ALTQ_ALTQ_HH_
-#define _ALTQ_ALTQ_HH_
+#ifndef _ALTQ_ALTQ_H_
+#define _ALTQ_ALTQ_H_
#if 0
/*
@@ -39,10 +39,10 @@
#endif
#ifdef ALTQ3_COMPAT
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/ioccom.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/netinet/in.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/ioccom.h>
+#include <sys/queue.h>
+#include <netinet/in.h>
#ifndef IFNAMSIZ
#define IFNAMSIZ 16
@@ -198,7 +198,7 @@ struct pktcntr {
#endif /* ALTQ3_COMPAT */
#ifdef _KERNEL
-#include <freebsd/altq/altq_var.h>
+#include <altq/altq_var.h>
#endif
-#endif /* _ALTQ_ALTQ_HH_ */
+#endif /* _ALTQ_ALTQ_H_ */
diff --git a/freebsd/sys/contrib/altq/altq/altq_cbq.c b/freebsd/sys/contrib/altq/altq/altq_cbq.c
index b5f21fb3..7991c0f5 100644
--- a/freebsd/sys/contrib/altq/altq/altq_cbq.c
+++ b/freebsd/sys/contrib/altq/altq/altq_cbq.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/* $KAME: altq_cbq.c,v 1.19 2003/09/17 14:23:25 kjc Exp $ */
@@ -34,37 +34,37 @@
*/
#if defined(__FreeBSD__) || defined(__NetBSD__)
-#include <freebsd/local/opt_altq.h>
+#include <rtems/bsd/local/opt_altq.h>
#if (__FreeBSD__ != 2)
-#include <freebsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet.h>
#ifdef __FreeBSD__
-#include <freebsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_inet6.h>
#endif
#endif
#endif /* __FreeBSD__ || __NetBSD__ */
#ifdef ALTQ_CBQ /* cbq is enabled by ALTQ_CBQ option in opt_altq.h */
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/time.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/systm.h>
+#include <sys/proc.h>
+#include <rtems/bsd/sys/errno.h>
+#include <rtems/bsd/sys/time.h>
#ifdef ALTQ3_COMPAT
-#include <freebsd/sys/uio.h>
-#include <freebsd/sys/kernel.h>
+#include <sys/uio.h>
+#include <sys/kernel.h>
#endif
-#include <freebsd/net/if.h>
-#include <freebsd/netinet/in.h>
+#include <net/if.h>
+#include <netinet/in.h>
-#include <freebsd/net/pfvar.h>
-#include <freebsd/altq/altq.h>
-#include <freebsd/altq/altq_cbq.h>
+#include <net/pfvar.h>
+#include <altq/altq.h>
+#include <altq/altq_cbq.h>
#ifdef ALTQ3_COMPAT
-#include <freebsd/altq/altq_conf.h>
+#include <altq/altq_conf.h>
#endif
#ifdef ALTQ3_COMPAT
diff --git a/freebsd/sys/contrib/altq/altq/altq_cbq.h b/freebsd/sys/contrib/altq/altq/altq_cbq.h
index 4b90beb4..30a15c73 100644
--- a/freebsd/sys/contrib/altq/altq/altq_cbq.h
+++ b/freebsd/sys/contrib/altq/altq/altq_cbq.h
@@ -30,13 +30,13 @@
* These notices must be retained in any copies of any part of this software.
*/
-#ifndef _ALTQ_ALTQ_CBQ_HH_
-#define _ALTQ_ALTQ_CBQ_HH_
+#ifndef _ALTQ_ALTQ_CBQ_H_
+#define _ALTQ_ALTQ_CBQ_H_
-#include <freebsd/altq/altq.h>
-#include <freebsd/altq/altq_rmclass.h>
-#include <freebsd/altq/altq_red.h>
-#include <freebsd/altq/altq_rio.h>
+#include <altq/altq.h>
+#include <altq/altq_rmclass.h>
+#include <altq/altq_red.h>
+#include <altq/altq_rio.h>
#ifdef __cplusplus
extern "C" {
@@ -218,4 +218,4 @@ typedef struct cbqstate {
}
#endif
-#endif /* !_ALTQ_ALTQ_CBQ_HH_ */
+#endif /* !_ALTQ_ALTQ_CBQ_H_ */
diff --git a/freebsd/sys/contrib/altq/altq/altq_cdnr.c b/freebsd/sys/contrib/altq/altq/altq_cdnr.c
index 66095acc..426e8ddf 100644
--- a/freebsd/sys/contrib/altq/altq/altq_cdnr.c
+++ b/freebsd/sys/contrib/altq/altq/altq_cdnr.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/* $KAME: altq_cdnr.c,v 1.14 2003/09/05 22:40:36 itojun Exp $ */
@@ -30,40 +30,40 @@
*/
#if defined(__FreeBSD__) || defined(__NetBSD__)
-#include <freebsd/local/opt_altq.h>
+#include <rtems/bsd/local/opt_altq.h>
#if (__FreeBSD__ != 2)
-#include <freebsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet.h>
#ifdef __FreeBSD__
-#include <freebsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_inet6.h>
#endif
#endif
#endif /* __FreeBSD__ || __NetBSD__ */
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/queue.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/systm.h>
+#include <sys/proc.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/kernel.h>
+#include <sys/queue.h>
+
+#include <net/if.h>
+#include <net/if_types.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
+#include <netinet/ip6.h>
#endif
-#include <freebsd/altq/altq.h>
+#include <altq/altq.h>
#ifdef ALTQ3_COMPAT
-#include <freebsd/altq/altq_conf.h>
+#include <altq/altq_conf.h>
#endif
-#include <freebsd/altq/altq_cdnr.h>
+#include <altq/altq_cdnr.h>
#ifdef ALTQ3_COMPAT
/*
diff --git a/freebsd/sys/contrib/altq/altq/altq_cdnr.h b/freebsd/sys/contrib/altq/altq/altq_cdnr.h
index b765833f..d55402f4 100644
--- a/freebsd/sys/contrib/altq/altq/altq_cdnr.h
+++ b/freebsd/sys/contrib/altq/altq/altq_cdnr.h
@@ -26,10 +26,10 @@
* SUCH DAMAGE.
*/
-#ifndef _ALTQ_ALTQ_CDNR_HH_
-#define _ALTQ_ALTQ_CDNR_HH_
+#ifndef _ALTQ_ALTQ_CDNR_H_
+#define _ALTQ_ALTQ_CDNR_H_
-#include <freebsd/altq/altq.h>
+#include <altq/altq.h>
/*
* traffic conditioner element types
@@ -332,4 +332,4 @@ struct tswtcm {
#endif /* _KERNEL */
-#endif /* _ALTQ_ALTQ_CDNR_HH_ */
+#endif /* _ALTQ_ALTQ_CDNR_H_ */
diff --git a/freebsd/sys/contrib/altq/altq/altq_classq.h b/freebsd/sys/contrib/altq/altq/altq_classq.h
index c3cfea37..dc5c646f 100644
--- a/freebsd/sys/contrib/altq/altq/altq_classq.h
+++ b/freebsd/sys/contrib/altq/altq/altq_classq.h
@@ -35,8 +35,8 @@
/*
* class queue definitions extracted from rm_class.h.
*/
-#ifndef _ALTQ_ALTQ_CLASSQ_HH_
-#define _ALTQ_ALTQ_CLASSQ_HH_
+#ifndef _ALTQ_ALTQ_CLASSQ_H_
+#define _ALTQ_ALTQ_CLASSQ_H_
#ifdef __cplusplus
extern "C" {
@@ -203,4 +203,4 @@ _flushq(class_queue_t *q)
}
#endif
-#endif /* _ALTQ_ALTQ_CLASSQ_HH_ */
+#endif /* _ALTQ_ALTQ_CLASSQ_H_ */
diff --git a/freebsd/sys/contrib/altq/altq/altq_hfsc.c b/freebsd/sys/contrib/altq/altq/altq_hfsc.c
index a559f006..c4648af3 100644
--- a/freebsd/sys/contrib/altq/altq/altq_hfsc.c
+++ b/freebsd/sys/contrib/altq/altq/altq_hfsc.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/* $KAME: altq_hfsc.c,v 1.24 2003/12/05 05:40:46 kjc Exp $ */
@@ -45,38 +45,38 @@
*/
#if defined(__FreeBSD__) || defined(__NetBSD__)
-#include <freebsd/local/opt_altq.h>
+#include <rtems/bsd/local/opt_altq.h>
#if (__FreeBSD__ != 2)
-#include <freebsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet.h>
#ifdef __FreeBSD__
-#include <freebsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_inet6.h>
#endif
#endif
#endif /* __FreeBSD__ || __NetBSD__ */
#ifdef ALTQ_HFSC /* hfsc is enabled by ALTQ_HFSC option in opt_altq.h */
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/queue.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/queue.h>
#if 1 /* ALTQ3_COMPAT */
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/kernel.h>
+#include <sys/sockio.h>
+#include <sys/proc.h>
+#include <sys/kernel.h>
#endif /* ALTQ3_COMPAT */
-#include <freebsd/net/if.h>
-#include <freebsd/netinet/in.h>
+#include <net/if.h>
+#include <netinet/in.h>
-#include <freebsd/net/pfvar.h>
-#include <freebsd/altq/altq.h>
-#include <freebsd/altq/altq_hfsc.h>
+#include <net/pfvar.h>
+#include <altq/altq.h>
+#include <altq/altq_hfsc.h>
#ifdef ALTQ3_COMPAT
-#include <freebsd/altq/altq_conf.h>
+#include <altq/altq_conf.h>
#endif
/*
diff --git a/freebsd/sys/contrib/altq/altq/altq_hfsc.h b/freebsd/sys/contrib/altq/altq/altq_hfsc.h
index fc983586..91ba3d18 100644
--- a/freebsd/sys/contrib/altq/altq/altq_hfsc.h
+++ b/freebsd/sys/contrib/altq/altq/altq_hfsc.h
@@ -29,13 +29,13 @@
* and to grant Carnegie Mellon the rights to redistribute these
* changes without encumbrance.
*/
-#ifndef _ALTQ_ALTQ_HFSC_HH_
-#define _ALTQ_ALTQ_HFSC_HH_
+#ifndef _ALTQ_ALTQ_HFSC_H_
+#define _ALTQ_ALTQ_HFSC_H_
-#include <freebsd/altq/altq.h>
-#include <freebsd/altq/altq_classq.h>
-#include <freebsd/altq/altq_red.h>
-#include <freebsd/altq/altq_rio.h>
+#include <altq/altq.h>
+#include <altq/altq_classq.h>
+#include <altq/altq_red.h>
+#include <altq/altq_rio.h>
#ifdef __cplusplus
extern "C" {
@@ -317,4 +317,4 @@ struct hfsc_if {
}
#endif
-#endif /* _ALTQ_ALTQ_HFSC_HH_ */
+#endif /* _ALTQ_ALTQ_HFSC_H_ */
diff --git a/freebsd/sys/contrib/altq/altq/altq_priq.c b/freebsd/sys/contrib/altq/altq/altq_priq.c
index d395a833..0bc6f453 100644
--- a/freebsd/sys/contrib/altq/altq/altq_priq.c
+++ b/freebsd/sys/contrib/altq/altq/altq_priq.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/* $KAME: altq_priq.c,v 1.11 2003/09/17 14:23:25 kjc Exp $ */
@@ -32,37 +32,37 @@
*/
#if defined(__FreeBSD__) || defined(__NetBSD__)
-#include <freebsd/local/opt_altq.h>
+#include <rtems/bsd/local/opt_altq.h>
#if (__FreeBSD__ != 2)
-#include <freebsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet.h>
#ifdef __FreeBSD__
-#include <freebsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_inet6.h>
#endif
#endif
#endif /* __FreeBSD__ || __NetBSD__ */
#ifdef ALTQ_PRIQ /* priq is enabled by ALTQ_PRIQ option in opt_altq.h */
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/queue.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/netinet/in.h>
-
-#include <freebsd/net/pfvar.h>
-#include <freebsd/altq/altq.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/systm.h>
+#include <sys/proc.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/kernel.h>
+#include <sys/queue.h>
+
+#include <net/if.h>
+#include <netinet/in.h>
+
+#include <net/pfvar.h>
+#include <altq/altq.h>
#ifdef ALTQ3_COMPAT
-#include <freebsd/altq/altq_conf.h>
+#include <altq/altq_conf.h>
#endif
-#include <freebsd/altq/altq_priq.h>
+#include <altq/altq_priq.h>
/*
* function prototypes
diff --git a/freebsd/sys/contrib/altq/altq/altq_priq.h b/freebsd/sys/contrib/altq/altq/altq_priq.h
index 7f553b8a..481d31b8 100644
--- a/freebsd/sys/contrib/altq/altq/altq_priq.h
+++ b/freebsd/sys/contrib/altq/altq/altq_priq.h
@@ -25,13 +25,13 @@
* SUCH DAMAGE.
*/
-#ifndef _ALTQ_ALTQ_PRIQ_HH_
-#define _ALTQ_ALTQ_PRIQ_HH_
+#ifndef _ALTQ_ALTQ_PRIQ_H_
+#define _ALTQ_ALTQ_PRIQ_H_
-#include <freebsd/altq/altq.h>
-#include <freebsd/altq/altq_classq.h>
-#include <freebsd/altq/altq_red.h>
-#include <freebsd/altq/altq_rio.h>
+#include <altq/altq.h>
+#include <altq/altq_classq.h>
+#include <altq/altq_red.h>
+#include <altq/altq_rio.h>
#ifdef __cplusplus
extern "C" {
@@ -167,4 +167,4 @@ struct priq_if {
}
#endif
-#endif /* _ALTQ_ALTQ_PRIQ_HH_ */
+#endif /* _ALTQ_ALTQ_PRIQ_H_ */
diff --git a/freebsd/sys/contrib/altq/altq/altq_red.c b/freebsd/sys/contrib/altq/altq/altq_red.c
index 18fa7209..7491c2f0 100644
--- a/freebsd/sys/contrib/altq/altq/altq_red.c
+++ b/freebsd/sys/contrib/altq/altq/altq_red.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/* $KAME: altq_red.c,v 1.18 2003/09/05 22:40:36 itojun Exp $ */
@@ -63,48 +63,48 @@
*/
#if defined(__FreeBSD__) || defined(__NetBSD__)
-#include <freebsd/local/opt_altq.h>
+#include <rtems/bsd/local/opt_altq.h>
#if (__FreeBSD__ != 2)
-#include <freebsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet.h>
#ifdef __FreeBSD__
-#include <freebsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_inet6.h>
#endif
#endif
#endif /* __FreeBSD__ || __NetBSD__ */
#ifdef ALTQ_RED /* red is enabled by ALTQ_RED option in opt_altq.h */
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/errno.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/errno.h>
#if 1 /* ALTQ3_COMPAT */
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/kernel.h>
+#include <sys/sockio.h>
+#include <sys/proc.h>
+#include <sys/kernel.h>
#ifdef ALTQ_FLOWVALVE
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/time.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/time.h>
#endif
#endif /* ALTQ3_COMPAT */
-#include <freebsd/net/if.h>
+#include <net/if.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
+#include <netinet/ip6.h>
#endif
-#include <freebsd/net/pfvar.h>
-#include <freebsd/altq/altq.h>
-#include <freebsd/altq/altq_red.h>
+#include <net/pfvar.h>
+#include <altq/altq.h>
+#include <altq/altq_red.h>
#ifdef ALTQ3_COMPAT
-#include <freebsd/altq/altq_conf.h>
+#include <altq/altq_conf.h>
#ifdef ALTQ_FLOWVALVE
-#include <freebsd/altq/altq_flowvalve.h>
+#include <altq/altq_flowvalve.h>
#endif
#endif
diff --git a/freebsd/sys/contrib/altq/altq/altq_red.h b/freebsd/sys/contrib/altq/altq/altq_red.h
index 2d267101..dc8ea0ac 100644
--- a/freebsd/sys/contrib/altq/altq/altq_red.h
+++ b/freebsd/sys/contrib/altq/altq/altq_red.h
@@ -26,10 +26,10 @@
* SUCH DAMAGE.
*/
-#ifndef _ALTQ_ALTQ_RED_HH_
-#define _ALTQ_ALTQ_RED_HH_
+#ifndef _ALTQ_ALTQ_RED_H_
+#define _ALTQ_ALTQ_RED_H_
-#include <freebsd/altq/altq_classq.h>
+#include <altq/altq_classq.h>
#ifdef ALTQ3_COMPAT
struct red_interface {
@@ -195,4 +195,4 @@ extern int32_t pow_w(struct wtab *, int);
#endif /* _KERNEL */
-#endif /* _ALTQ_ALTQ_RED_HH_ */
+#endif /* _ALTQ_ALTQ_RED_H_ */
diff --git a/freebsd/sys/contrib/altq/altq/altq_rio.c b/freebsd/sys/contrib/altq/altq/altq_rio.c
index 33a5fce6..a24c9006 100644
--- a/freebsd/sys/contrib/altq/altq/altq_rio.c
+++ b/freebsd/sys/contrib/altq/altq/altq_rio.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/* $KAME: altq_rio.c,v 1.17 2003/07/10 12:07:49 kjc Exp $ */
@@ -62,44 +62,44 @@
*/
#if defined(__FreeBSD__) || defined(__NetBSD__)
-#include <freebsd/local/opt_altq.h>
+#include <rtems/bsd/local/opt_altq.h>
#if (__FreeBSD__ != 2)
-#include <freebsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet.h>
#ifdef __FreeBSD__
-#include <freebsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_inet6.h>
#endif
#endif
#endif /* __FreeBSD__ || __NetBSD__ */
#ifdef ALTQ_RIO /* rio is enabled by ALTQ_RIO option in opt_altq.h */
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/errno.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/errno.h>
#if 1 /* ALTQ3_COMPAT */
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/kernel.h>
+#include <sys/proc.h>
+#include <sys/sockio.h>
+#include <sys/kernel.h>
#endif
-#include <freebsd/net/if.h>
+#include <net/if.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
+#include <netinet/ip6.h>
#endif
-#include <freebsd/net/pfvar.h>
-#include <freebsd/altq/altq.h>
-#include <freebsd/altq/altq_cdnr.h>
-#include <freebsd/altq/altq_red.h>
-#include <freebsd/altq/altq_rio.h>
+#include <net/pfvar.h>
+#include <altq/altq.h>
+#include <altq/altq_cdnr.h>
+#include <altq/altq_red.h>
+#include <altq/altq_rio.h>
#ifdef ALTQ3_COMPAT
-#include <freebsd/altq/altq_conf.h>
+#include <altq/altq_conf.h>
#endif
/*
diff --git a/freebsd/sys/contrib/altq/altq/altq_rio.h b/freebsd/sys/contrib/altq/altq/altq_rio.h
index e32d2ee2..83210f23 100644
--- a/freebsd/sys/contrib/altq/altq/altq_rio.h
+++ b/freebsd/sys/contrib/altq/altq/altq_rio.h
@@ -26,10 +26,10 @@
* SUCH DAMAGE.
*/
-#ifndef _ALTQ_ALTQ_RIO_HH_
-#define _ALTQ_ALTQ_RIO_HH_
+#ifndef _ALTQ_ALTQ_RIO_H_
+#define _ALTQ_ALTQ_RIO_H_
-#include <freebsd/altq/altq_classq.h>
+#include <altq/altq_classq.h>
/*
* RIO: RED with IN/OUT bit
@@ -141,4 +141,4 @@ extern struct mbuf *rio_getq(rio_t *, class_queue_t *);
#endif /* _KERNEL */
-#endif /* _ALTQ_ALTQ_RIO_HH_ */
+#endif /* _ALTQ_ALTQ_RIO_H_ */
diff --git a/freebsd/sys/contrib/altq/altq/altq_rmclass.c b/freebsd/sys/contrib/altq/altq/altq_rmclass.c
index 06f61bd3..390d7308 100644
--- a/freebsd/sys/contrib/altq/altq/altq_rmclass.c
+++ b/freebsd/sys/contrib/altq/altq/altq_rmclass.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/* $KAME: altq_rmclass.c,v 1.18 2003/11/06 06:32:53 kjc Exp $ */
@@ -42,39 +42,39 @@
#ident "@(#)rm_class.c 1.48 97/12/05 SMI"
#if defined(__FreeBSD__) || defined(__NetBSD__)
-#include <freebsd/local/opt_altq.h>
+#include <rtems/bsd/local/opt_altq.h>
#if (__FreeBSD__ != 2)
-#include <freebsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet.h>
#ifdef __FreeBSD__
-#include <freebsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_inet6.h>
#endif
#endif
#endif /* __FreeBSD__ || __NetBSD__ */
#ifdef ALTQ_CBQ /* cbq is enabled by ALTQ_CBQ option in opt_altq.h */
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/time.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/errno.h>
+#include <rtems/bsd/sys/time.h>
#ifdef ALTQ3_COMPAT
-#include <freebsd/sys/kernel.h>
+#include <sys/kernel.h>
#endif
-#include <freebsd/net/if.h>
+#include <net/if.h>
#ifdef ALTQ3_COMPAT
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
#endif
-#include <freebsd/altq/altq.h>
-#include <freebsd/altq/altq_rmclass.h>
-#include <freebsd/altq/altq_rmclass_debug.h>
-#include <freebsd/altq/altq_red.h>
-#include <freebsd/altq/altq_rio.h>
+#include <altq/altq.h>
+#include <altq/altq_rmclass.h>
+#include <altq/altq_rmclass_debug.h>
+#include <altq/altq_red.h>
+#include <altq/altq_rio.h>
/*
* Local Macros
diff --git a/freebsd/sys/contrib/altq/altq/altq_rmclass.h b/freebsd/sys/contrib/altq/altq/altq_rmclass.h
index feb30c1c..cf0ddf48 100644
--- a/freebsd/sys/contrib/altq/altq/altq_rmclass.h
+++ b/freebsd/sys/contrib/altq/altq/altq_rmclass.h
@@ -33,10 +33,10 @@
* SUCH DAMAGE.
*/
-#ifndef _ALTQ_ALTQ_RMCLASS_HH_
-#define _ALTQ_ALTQ_RMCLASS_HH_
+#ifndef _ALTQ_ALTQ_RMCLASS_H_
+#define _ALTQ_ALTQ_RMCLASS_H_
-#include <freebsd/altq/altq_classq.h>
+#include <altq/altq_classq.h>
/* #pragma ident "@(#)rm_class.h 1.20 97/10/23 SMI" */
@@ -263,4 +263,4 @@ extern int rmc_get_weight(struct rm_ifdat *, int);
}
#endif
-#endif /* _ALTQ_ALTQ_RMCLASS_HH_ */
+#endif /* _ALTQ_ALTQ_RMCLASS_H_ */
diff --git a/freebsd/sys/contrib/altq/altq/altq_rmclass_debug.h b/freebsd/sys/contrib/altq/altq/altq_rmclass_debug.h
index 6723a4b7..8f471b2f 100644
--- a/freebsd/sys/contrib/altq/altq/altq_rmclass_debug.h
+++ b/freebsd/sys/contrib/altq/altq/altq_rmclass_debug.h
@@ -30,8 +30,8 @@
* These notices must be retained in any copies of any part of this software.
*/
-#ifndef _ALTQ_ALTQ_RMCLASS_DEBUG_HH_
-#define _ALTQ_ALTQ_RMCLASS_DEBUG_HH_
+#ifndef _ALTQ_ALTQ_RMCLASS_DEBUG_H_
+#define _ALTQ_ALTQ_RMCLASS_DEBUG_H_
/* #pragma ident "@(#)rm_class_debug.h 1.7 98/05/04 SMI" */
@@ -109,4 +109,4 @@ extern int cbqtrace_count;
}
#endif
-#endif /* _ALTQ_ALTQ_RMCLASS_DEBUG_HH_ */
+#endif /* _ALTQ_ALTQ_RMCLASS_DEBUG_H_ */
diff --git a/freebsd/sys/contrib/altq/altq/altq_subr.c b/freebsd/sys/contrib/altq/altq/altq_subr.c
index f4bb6b47..b6e20082 100644
--- a/freebsd/sys/contrib/altq/altq/altq_subr.c
+++ b/freebsd/sys/contrib/altq/altq/altq_subr.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/* $KAME: altq_subr.c,v 1.21 2003/11/06 06:32:53 kjc Exp $ */
@@ -30,65 +30,65 @@
*/
#if defined(__FreeBSD__) || defined(__NetBSD__)
-#include <freebsd/local/opt_altq.h>
-#include <freebsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_altq.h>
+#include <rtems/bsd/local/opt_inet.h>
#ifdef __FreeBSD__
-#include <freebsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_inet6.h>
#endif
#endif /* __FreeBSD__ || __NetBSD__ */
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/queue.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_types.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/systm.h>
+#include <sys/proc.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/syslog.h>
+#include <sys/sysctl.h>
+#include <sys/queue.h>
+
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/if_types.h>
#ifdef __FreeBSD__
-#include <freebsd/net/vnet.h>
+#include <net/vnet.h>
#endif
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
+#include <netinet/ip6.h>
#endif
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/udp.h>
+#include <netinet/tcp.h>
+#include <netinet/udp.h>
-#include <freebsd/net/pfvar.h>
-#include <freebsd/altq/altq.h>
+#include <net/pfvar.h>
+#include <altq/altq.h>
#ifdef ALTQ3_COMPAT
-#include <freebsd/altq/altq_conf.h>
+#include <altq/altq_conf.h>
#endif
/* machine dependent clock related includes */
#ifdef __FreeBSD__
#if __FreeBSD__ < 3
-#include <freebsd/local/opt_cpu.h> /* for FreeBSD-2.2.8 to get i586_ctr_freq */
+#include <rtems/bsd/local/opt_cpu.h> /* for FreeBSD-2.2.8 to get i586_ctr_freq */
#endif
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/cpu.h>
-#include <freebsd/sys/eventhandler.h>
-#include <freebsd/machine/clock.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
+#include <sys/eventhandler.h>
+#include <machine/clock.h>
#endif
#if defined(__i386__)
-#include <freebsd/machine/cpufunc.h> /* for pentium tsc */
-#include <freebsd/machine/specialreg.h> /* for CPUID_TSC */
+#include <machine/cpufunc.h> /* for pentium tsc */
+#include <machine/specialreg.h> /* for CPUID_TSC */
#ifdef __FreeBSD__
-#include <freebsd/machine/md_var.h> /* for cpu_feature */
+#include <machine/md_var.h> /* for cpu_feature */
#elif defined(__NetBSD__) || defined(__OpenBSD__)
-#include <freebsd/machine/cpu.h> /* for cpu_feature */
+#include <machine/cpu.h> /* for cpu_feature */
#endif
#endif /* __i386__ */
diff --git a/freebsd/sys/contrib/altq/altq/altq_var.h b/freebsd/sys/contrib/altq/altq/altq_var.h
index 9ebfe2ed..6f37f182 100644
--- a/freebsd/sys/contrib/altq/altq/altq_var.h
+++ b/freebsd/sys/contrib/altq/altq/altq_var.h
@@ -26,14 +26,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-#ifndef _ALTQ_ALTQ_VAR_HH_
-#define _ALTQ_ALTQ_VAR_HH_
+#ifndef _ALTQ_ALTQ_VAR_H_
+#define _ALTQ_ALTQ_VAR_H_
#ifdef _KERNEL
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/queue.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/queue.h>
#ifdef ALTQ3_CLFIER_COMPAT
/*
@@ -167,7 +167,7 @@ typedef u_long ioctlcmd_t;
/* macro for timeout/untimeout */
#if (__FreeBSD_version > 300000) || defined(__NetBSD__)
/* use callout */
-#include <freebsd/sys/callout.h>
+#include <sys/callout.h>
#if (__FreeBSD_version > 500000)
#define CALLOUT_INIT(c) callout_init((c), 0)
@@ -180,7 +180,7 @@ typedef u_long ioctlcmd_t;
#define CALLOUT_INITIALIZER { { { NULL } }, 0, NULL, NULL, 0 }
#endif
#elif defined(__OpenBSD__)
-#include <freebsd/sys/timeout.h>
+#include <sys/timeout.h>
/* callout structure as a wrapper of struct timeout */
struct callout {
struct timeout c_to;
@@ -262,4 +262,4 @@ int hfsc_remove_queue(struct pf_altq *);
int hfsc_getqstats(struct pf_altq *, void *, int *);
#endif /* _KERNEL */
-#endif /* _ALTQ_ALTQ_VAR_HH_ */
+#endif /* _ALTQ_ALTQ_VAR_H_ */
diff --git a/freebsd/sys/contrib/altq/altq/altqconf.h b/freebsd/sys/contrib/altq/altq/altqconf.h
index b4d0f84e..1b4271eb 100644
--- a/freebsd/sys/contrib/altq/altq/altqconf.h
+++ b/freebsd/sys/contrib/altq/altq/altqconf.h
@@ -4,10 +4,10 @@
#if defined(_KERNEL_OPT) || defined(__OpenBSD__)
#if defined(_KERNEL_OPT)
-#include <freebsd/local/opt_altq_enabled.h>
+#include <rtems/bsd/local/opt_altq_enabled.h>
#endif
-#include <freebsd/sys/conf.h>
+#include <sys/conf.h>
#ifdef ALTQ
#define NALTQ 1
diff --git a/freebsd/sys/contrib/altq/altq/if_altq.h b/freebsd/sys/contrib/altq/altq/if_altq.h
index c2255b8c..50462e9e 100644
--- a/freebsd/sys/contrib/altq/altq/if_altq.h
+++ b/freebsd/sys/contrib/altq/altq/if_altq.h
@@ -26,17 +26,17 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-#ifndef _ALTQ_IF_ALTQ_HH_
-#define _ALTQ_IF_ALTQ_HH_
+#ifndef _ALTQ_IF_ALTQ_H_
+#define _ALTQ_IF_ALTQ_H_
#if (defined(__FreeBSD__) && __FreeBSD_version >= 500000)
-#include <freebsd/sys/lock.h> /* XXX */
-#include <freebsd/sys/mutex.h> /* XXX */
-#include <freebsd/sys/event.h> /* XXX */
+#include <rtems/bsd/sys/lock.h> /* XXX */
+#include <sys/mutex.h> /* XXX */
+#include <sys/event.h> /* XXX */
#endif
#ifdef _KERNEL_OPT
-#include <freebsd/altq/altqconf.h>
+#include <altq/altqconf.h>
#endif
struct altq_pktattr; struct tb_regulator; struct top_cdnr;
@@ -188,4 +188,4 @@ void altq_etherclassify(struct ifaltq *, struct mbuf *, struct altq_pktattr *);
#endif
#endif /* _KERNEL */
-#endif /* _ALTQ_IF_ALTQ_HH_ */
+#endif /* _ALTQ_IF_ALTQ_H_ */
diff --git a/freebsd/sys/contrib/pf/net/if_pflog.c b/freebsd/sys/contrib/pf/net/if_pflog.c
index 8ecc7cee..a05c6435 100644
--- a/freebsd/sys/contrib/pf/net/if_pflog.c
+++ b/freebsd/sys/contrib/pf/net/if_pflog.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $OpenBSD: if_pflog.c,v 1.22 2006/12/15 09:31:20 otto Exp $ */
/*
@@ -36,12 +36,12 @@
*/
#ifdef __FreeBSD__
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_bpf.h>
-#include <freebsd/local/opt_pf.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_bpf.h>
+#include <rtems/bsd/local/opt_pf.h>
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifdef DEV_BPF
@@ -57,53 +57,53 @@ __FBSDID("$FreeBSD$");
#endif
#else /* ! __FreeBSD__ */
-#include <freebsd/local/bpfilter.h>
-#include <freebsd/local/pflog.h>
+#include <rtems/bsd/local/bpfilter.h>
+#include <rtems/bsd/local/pflog.h>
#endif /* __FreeBSD__ */
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/socket.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/proc.h>
+#include <sys/socket.h>
#ifdef __FreeBSD__
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/limits.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/sockio.h>
+#include <sys/kernel.h>
+#include <sys/limits.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/sockio.h>
#else
-#include <freebsd/sys/ioctl.h>
+#include <sys/ioctl.h>
#endif
-#include <freebsd/net/if.h>
+#include <net/if.h>
#ifdef __FreeBSD__
-#include <freebsd/net/if_clone.h>
+#include <net/if_clone.h>
#endif
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/bpf.h>
+#include <net/if_types.h>
+#include <net/route.h>
+#include <net/bpf.h>
#ifdef INET
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
#endif
#ifdef INET6
#ifndef INET
-#include <freebsd/netinet/in.h>
+#include <netinet/in.h>
#endif
-#include <freebsd/netinet6/nd6.h>
+#include <netinet6/nd6.h>
#endif /* INET6 */
-#include <freebsd/net/pfvar.h>
-#include <freebsd/net/if_pflog.h>
+#include <net/pfvar.h>
+#include <net/if_pflog.h>
#ifdef INET
#ifdef __FreeBSD__
-#include <freebsd/machine/in_cksum.h>
+#include <machine/in_cksum.h>
#endif
#endif
diff --git a/freebsd/sys/contrib/pf/net/if_pflog.h b/freebsd/sys/contrib/pf/net/if_pflog.h
index 9e9efbef..a3c74d16 100644
--- a/freebsd/sys/contrib/pf/net/if_pflog.h
+++ b/freebsd/sys/contrib/pf/net/if_pflog.h
@@ -25,8 +25,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef _NET_IF_PFLOG_HH_
-#define _NET_IF_PFLOG_HH_
+#ifndef _NET_IF_PFLOG_H_
+#define _NET_IF_PFLOG_H_
#define PFLOGIFS_MAX 16
@@ -100,4 +100,4 @@ extern pflog_packet_t *pflog_packet_ptr;
#endif /* NPFLOG > 0 */
#endif /* __FreeBSD__ */
#endif /* _KERNEL */
-#endif /* _NET_IF_PFLOG_HH_ */
+#endif /* _NET_IF_PFLOG_H_ */
diff --git a/freebsd/sys/contrib/pf/net/if_pfsync.c b/freebsd/sys/contrib/pf/net/if_pfsync.c
index bc70adfe..c3b830be 100644
--- a/freebsd/sys/contrib/pf/net/if_pfsync.c
+++ b/freebsd/sys/contrib/pf/net/if_pfsync.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $OpenBSD: if_pfsync.c,v 1.73 2006/11/16 13:13:38 henning Exp $ */
@@ -29,13 +29,13 @@
*/
#ifdef __FreeBSD__
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_carp.h>
-#include <freebsd/local/opt_bpf.h>
-#include <freebsd/local/opt_pf.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_carp.h>
+#include <rtems/bsd/local/opt_bpf.h>
+#include <rtems/bsd/local/opt_pf.h>
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifdef DEV_BPF
@@ -57,66 +57,66 @@ __FBSDID("$FreeBSD$");
#endif
#endif /* __FreeBSD__ */
-#include <freebsd/sys/param.h>
+#include <rtems/bsd/sys/param.h>
#ifdef __FreeBSD__
-#include <freebsd/sys/priv.h>
+#include <sys/priv.h>
#endif
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
+#include <sys/proc.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
#ifdef __FreeBSD__
-#include <freebsd/sys/endian.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/taskqueue.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/sysctl.h>
+#include <sys/endian.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/sockio.h>
+#include <sys/taskqueue.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/sysctl.h>
#else
-#include <freebsd/sys/ioctl.h>
-#include <freebsd/sys/timeout.h>
+#include <sys/ioctl.h>
+#include <sys/timeout.h>
#endif
-#include <freebsd/sys/kernel.h>
+#include <sys/kernel.h>
-#include <freebsd/net/if.h>
+#include <net/if.h>
#ifdef __FreeBSD__
-#include <freebsd/net/if_clone.h>
+#include <net/if_clone.h>
#endif
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/bpf.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/if_ether.h>
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/tcp_seq.h>
+#include <net/if_types.h>
+#include <net/route.h>
+#include <net/bpf.h>
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
+#include <netinet/tcp.h>
+#include <netinet/tcp_seq.h>
#ifdef INET
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
#endif
#ifdef INET6
-#include <freebsd/netinet6/nd6.h>
+#include <netinet6/nd6.h>
#endif /* INET6 */
#ifndef __FreeBSD__
-#include <freebsd/local/carp.h>
+#include <rtems/bsd/local/carp.h>
#endif
#if NCARP > 0
-#include <freebsd/netinet/ip_carp.h>
+#include <netinet/ip_carp.h>
#endif
-#include <freebsd/net/pfvar.h>
-#include <freebsd/net/if_pfsync.h>
+#include <net/pfvar.h>
+#include <net/if_pfsync.h>
#ifndef __FreeBSD__
-#include <freebsd/local/bpfilter.h>
-#include <freebsd/local/pfsync.h>
+#include <rtems/bsd/local/bpfilter.h>
+#include <rtems/bsd/local/pfsync.h>
#endif
#define PFSYNC_MINMTU \
diff --git a/freebsd/sys/contrib/pf/net/if_pfsync.h b/freebsd/sys/contrib/pf/net/if_pfsync.h
index e3e6caf9..f306610f 100644
--- a/freebsd/sys/contrib/pf/net/if_pfsync.h
+++ b/freebsd/sys/contrib/pf/net/if_pfsync.h
@@ -27,8 +27,8 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef _NET_IF_PFSYNC_HH_
-#define _NET_IF_PFSYNC_HH_
+#ifndef _NET_IF_PFSYNC_H_
+#define _NET_IF_PFSYNC_H_
#define PFSYNC_ID_LEN sizeof(u_int64_t)
@@ -372,4 +372,4 @@ int pfsync_update_tdb(struct tdb *, int);
#endif
#endif
-#endif /* _NET_IF_PFSYNC_HH_ */
+#endif /* _NET_IF_PFSYNC_H_ */
diff --git a/freebsd/sys/contrib/pf/net/pf.c b/freebsd/sys/contrib/pf/net/pf.c
index 4ac395f1..bad7a1cd 100644
--- a/freebsd/sys/contrib/pf/net/pf.c
+++ b/freebsd/sys/contrib/pf/net/pf.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $OpenBSD: pf.c,v 1.527 2007/02/22 15:23:23 pyr Exp $ */
/* add: $OpenBSD: pf.c,v 1.559 2007/09/18 18:45:59 markus Exp $ */
@@ -39,16 +39,16 @@
*/
#ifdef __FreeBSD__
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#endif
#ifdef __FreeBSD__
-#include <freebsd/local/opt_bpf.h>
-#include <freebsd/local/opt_pf.h>
+#include <rtems/bsd/local/opt_bpf.h>
+#include <rtems/bsd/local/opt_pf.h>
#ifdef DEV_BPF
#define NBPFILTER DEV_BPF
@@ -69,84 +69,84 @@ __FBSDID("$FreeBSD$");
#endif
#else
-#include <freebsd/local/bpfilter.h>
-#include <freebsd/local/pflog.h>
-#include <freebsd/local/pfsync.h>
-#endif
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/filio.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/time.h>
-#ifdef __FreeBSD__
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/endian.h>
+#include <rtems/bsd/local/bpfilter.h>
+#include <rtems/bsd/local/pflog.h>
+#include <rtems/bsd/local/pfsync.h>
+#endif
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/filio.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/time.h>
+#ifdef __FreeBSD__
+#include <sys/sysctl.h>
+#include <sys/endian.h>
#else
-#include <freebsd/sys/pool.h>
+#include <sys/pool.h>
#endif
-#include <freebsd/sys/proc.h>
+#include <sys/proc.h>
#ifdef __FreeBSD__
-#include <freebsd/sys/kthread.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/sx.h>
+#include <sys/kthread.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/sx.h>
#else
-#include <freebsd/sys/rwlock.h>
+#include <sys/rwlock.h>
#endif
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/route.h>
+#include <net/if.h>
+#include <net/if_types.h>
+#include <net/bpf.h>
+#include <net/route.h>
#ifndef __FreeBSD__
-#include <freebsd/net/radix_mpath.h>
-#endif
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/tcp_seq.h>
-#include <freebsd/netinet/udp.h>
-#include <freebsd/netinet/ip_icmp.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/tcp_timer.h>
-#include <freebsd/netinet/tcp_var.h>
-#include <freebsd/netinet/udp_var.h>
-#include <freebsd/netinet/icmp_var.h>
-#include <freebsd/netinet/if_ether.h>
+#include <net/radix_mpath.h>
+#endif
+
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+#include <netinet/tcp.h>
+#include <netinet/tcp_seq.h>
+#include <netinet/udp.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/in_pcb.h>
+#include <netinet/tcp_timer.h>
+#include <netinet/tcp_var.h>
+#include <netinet/udp_var.h>
+#include <netinet/icmp_var.h>
+#include <netinet/if_ether.h>
#ifndef __FreeBSD__
-#include <freebsd/dev/rndvar.h>
+#include <dev/rndvar.h>
#endif
-#include <freebsd/net/pfvar.h>
-#include <freebsd/net/if_pflog.h>
+#include <net/pfvar.h>
+#include <net/if_pflog.h>
#if NPFSYNC > 0
-#include <freebsd/net/if_pfsync.h>
+#include <net/if_pfsync.h>
#endif /* NPFSYNC > 0 */
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/icmp6.h>
-#include <freebsd/netinet6/nd6.h>
+#include <netinet/ip6.h>
+#include <netinet/in_pcb.h>
+#include <netinet/icmp6.h>
+#include <netinet6/nd6.h>
#ifdef __FreeBSD__
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/in6_pcb.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/in6_pcb.h>
#endif
#endif /* INET6 */
#ifdef __FreeBSD__
-#include <freebsd/machine/in_cksum.h>
-#include <freebsd/sys/limits.h>
-#include <freebsd/sys/ucred.h>
-#include <freebsd/security/mac/mac_framework.h>
+#include <machine/in_cksum.h>
+#include <sys/limits.h>
+#include <sys/ucred.h>
+#include <security/mac/mac_framework.h>
extern int ip_optcopy(struct ip *, struct ip *);
extern int debug_pfugidhack;
diff --git a/freebsd/sys/contrib/pf/net/pf_if.c b/freebsd/sys/contrib/pf/net/pf_if.c
index e873a2ef..97c036cb 100644
--- a/freebsd/sys/contrib/pf/net/pf_if.c
+++ b/freebsd/sys/contrib/pf/net/pf_if.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $OpenBSD: pf_if.c,v 1.46 2006/12/13 09:01:59 itojun Exp $ */
@@ -35,44 +35,44 @@
*/
#if defined(__FreeBSD__)
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#endif
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
#ifdef __FreeBSD__
-#include <freebsd/sys/malloc.h>
+#include <sys/malloc.h>
#endif
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/filio.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/kernel.h>
+#include <sys/mbuf.h>
+#include <sys/filio.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/kernel.h>
#ifndef __FreeBSD__
-#include <freebsd/sys/device.h>
+#include <sys/device.h>
#endif
-#include <freebsd/sys/time.h>
+#include <rtems/bsd/sys/time.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_types.h>
+#include <net/if.h>
+#include <net/if_types.h>
#ifdef __FreeBSD__
-#include <freebsd/net/vnet.h>
+#include <net/vnet.h>
#endif
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
-#include <freebsd/net/pfvar.h>
+#include <net/pfvar.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
+#include <netinet/ip6.h>
#endif /* INET6 */
struct pfi_kif *pfi_all = NULL;
diff --git a/freebsd/sys/contrib/pf/net/pf_ioctl.c b/freebsd/sys/contrib/pf/net/pf_ioctl.c
index de612b4f..766268cf 100644
--- a/freebsd/sys/contrib/pf/net/pf_ioctl.c
+++ b/freebsd/sys/contrib/pf/net/pf_ioctl.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $OpenBSD: pf_ioctl.c,v 1.175 2007/02/26 22:47:43 deraadt Exp $ */
@@ -38,13 +38,13 @@
*/
#ifdef __FreeBSD__
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_bpf.h>
-#include <freebsd/local/opt_pf.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_bpf.h>
+#include <rtems/bsd/local/opt_pf.h>
#ifdef DEV_BPF
#define NBPFILTER DEV_BPF
@@ -65,79 +65,79 @@ __FBSDID("$FreeBSD$");
#endif
#else
-#include <freebsd/local/bpfilter.h>
-#include <freebsd/local/pflog.h>
-#include <freebsd/local/pfsync.h>
-#endif
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/filio.h>
-#include <freebsd/sys/fcntl.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/malloc.h>
-#ifdef __FreeBSD__
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/conf.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/local/bpfilter.h>
+#include <rtems/bsd/local/pflog.h>
+#include <rtems/bsd/local/pfsync.h>
+#endif
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/filio.h>
+#include <sys/fcntl.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/malloc.h>
+#ifdef __FreeBSD__
+#include <sys/module.h>
+#include <sys/conf.h>
+#include <sys/proc.h>
+#include <sys/sysctl.h>
#else
-#include <freebsd/sys/timeout.h>
-#include <freebsd/sys/pool.h>
+#include <sys/timeout.h>
+#include <sys/pool.h>
#endif
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kthread.h>
+#include <sys/proc.h>
+#include <sys/malloc.h>
+#include <sys/kthread.h>
#ifndef __FreeBSD__
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/uvm/uvm_extern.h>
+#include <sys/rwlock.h>
+#include <uvm/uvm_extern.h>
#endif
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_types.h>
+#include <net/if.h>
+#include <net/if_types.h>
#ifdef __FreeBSD__
-#include <freebsd/net/vnet.h>
+#include <net/vnet.h>
#endif
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_icmp.h>
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_icmp.h>
#ifdef __FreeBSD__
-#include <freebsd/sys/md5.h>
+#include <sys/md5.h>
#else
-#include <freebsd/dev/rndvar.h>
-#include <freebsd/crypto/md5.h>
+#include <dev/rndvar.h>
+#include <crypto/md5.h>
#endif
-#include <freebsd/net/pfvar.h>
+#include <net/pfvar.h>
#if NPFSYNC > 0
-#include <freebsd/net/if_pfsync.h>
+#include <net/if_pfsync.h>
#endif /* NPFSYNC > 0 */
-#include <freebsd/net/if_pflog.h>
+#include <net/if_pflog.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet/in_pcb.h>
+#include <netinet/ip6.h>
+#include <netinet/in_pcb.h>
#endif /* INET6 */
#ifdef ALTQ
-#include <freebsd/altq/altq.h>
+#include <altq/altq.h>
#endif
#ifdef __FreeBSD__
-#include <freebsd/sys/limits.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/net/pfil.h>
+#include <sys/limits.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <net/pfil.h>
#endif /* __FreeBSD__ */
#ifdef __FreeBSD__
diff --git a/freebsd/sys/contrib/pf/net/pf_mtag.h b/freebsd/sys/contrib/pf/net/pf_mtag.h
index 09aeb25c..a0ebf7ef 100644
--- a/freebsd/sys/contrib/pf/net/pf_mtag.h
+++ b/freebsd/sys/contrib/pf/net/pf_mtag.h
@@ -29,8 +29,8 @@
*
*/
-#ifndef _NET_PF_MTAG_HH_
-#define _NET_PF_MTAG_HH_
+#ifndef _NET_PF_MTAG_H_
+#define _NET_PF_MTAG_H_
#ifdef _KERNEL
@@ -79,4 +79,4 @@ pf_get_mtag(struct mbuf *m)
return ((struct pf_mtag *)(mtag + 1));
}
#endif /* _KERNEL */
-#endif /* _NET_PF_MTAG_HH_ */
+#endif /* _NET_PF_MTAG_H_ */
diff --git a/freebsd/sys/contrib/pf/net/pf_norm.c b/freebsd/sys/contrib/pf/net/pf_norm.c
index ea68ab50..bf0b6046 100644
--- a/freebsd/sys/contrib/pf/net/pf_norm.c
+++ b/freebsd/sys/contrib/pf/net/pf_norm.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $OpenBSD: pf_norm.c,v 1.107 2006/04/16 00:59:52 pascoe Exp $ */
@@ -28,11 +28,11 @@
*/
#ifdef __FreeBSD__
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_pf.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_pf.h>
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifdef DEV_PFLOG
@@ -41,46 +41,46 @@ __FBSDID("$FreeBSD$");
#define NPFLOG 0
#endif
#else
-#include <freebsd/local/pflog.h>
+#include <rtems/bsd/local/pflog.h>
#endif
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/filio.h>
-#include <freebsd/sys/fcntl.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/time.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/filio.h>
+#include <sys/fcntl.h>
+#include <sys/socket.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/time.h>
#ifndef __FreeBSD__
-#include <freebsd/sys/pool.h>
+#include <sys/pool.h>
-#include <freebsd/dev/rndvar.h>
+#include <dev/rndvar.h>
#endif
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/if_pflog.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/tcp_seq.h>
-#include <freebsd/netinet/udp.h>
-#include <freebsd/netinet/ip_icmp.h>
+#include <net/if.h>
+#include <net/if_types.h>
+#include <net/bpf.h>
+#include <net/route.h>
+#include <net/if_pflog.h>
+
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+#include <netinet/tcp.h>
+#include <netinet/tcp_seq.h>
+#include <netinet/udp.h>
+#include <netinet/ip_icmp.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
+#include <netinet/ip6.h>
#endif /* INET6 */
-#include <freebsd/net/pfvar.h>
+#include <net/pfvar.h>
#ifndef __FreeBSD__
-#include <freebsd/inttypes.h>
+#include <inttypes.h>
struct pf_frent {
LIST_ENTRY(pf_frent) fr_next;
diff --git a/freebsd/sys/contrib/pf/net/pf_osfp.c b/freebsd/sys/contrib/pf/net/pf_osfp.c
index dafeabf1..67486b2d 100644
--- a/freebsd/sys/contrib/pf/net/pf_osfp.c
+++ b/freebsd/sys/contrib/pf/net/pf_osfp.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $OpenBSD: pf_osfp.c,v 1.12 2006/12/13 18:14:10 itojun Exp $ */
@@ -20,28 +20,28 @@
*/
#ifdef __FreeBSD__
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#endif
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/socket.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/socket.h>
#ifdef _KERNEL
-# include <freebsd/sys/systm.h>
+# include <sys/systm.h>
#endif /* _KERNEL */
-#include <freebsd/sys/mbuf.h>
+#include <sys/mbuf.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/tcp.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/tcp.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/pfvar.h>
+#include <net/if.h>
+#include <net/pfvar.h>
-#include <freebsd/netinet/ip6.h>
+#include <netinet/ip6.h>
#ifdef _KERNEL
-#include <freebsd/netinet6/in6_var.h>
+#include <netinet6/in6_var.h>
#endif
#ifdef _KERNEL
@@ -57,12 +57,12 @@ typedef struct pool pool_t;
#else
/* Userland equivalents so we can lend code to tcpdump et al. */
-# include <freebsd/arpa/inet.h>
-# include <freebsd/errno.h>
-# include <freebsd/stdio.h>
-# include <freebsd/stdlib.h>
-# include <freebsd/string.h>
-# include <freebsd/netdb.h>
+# include <arpa/inet.h>
+# include <errno.h>
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
+# include <netdb.h>
# define pool_t int
# define pool_get(pool, flags) malloc(*(pool))
# define pool_put(pool, item) free(item)
@@ -73,7 +73,7 @@ typedef struct pool pool_t;
# endif
# ifdef PFDEBUG
-# include <freebsd/sys/stdarg.h>
+# include <sys/stdarg.h>
# define DPFPRINTF(format, x...) fprintf(stderr, format , ##x)
# else
# define DPFPRINTF(format, x...) ((void)0)
diff --git a/freebsd/sys/contrib/pf/net/pf_ruleset.c b/freebsd/sys/contrib/pf/net/pf_ruleset.c
index 8705d4ca..8e0b65c8 100644
--- a/freebsd/sys/contrib/pf/net/pf_ruleset.c
+++ b/freebsd/sys/contrib/pf/net/pf_ruleset.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $OpenBSD: pf_ruleset.c,v 1.1 2006/10/27 13:56:51 mcbride Exp $ */
@@ -38,27 +38,27 @@
*/
#ifdef __FreeBSD__
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#endif
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/socket.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/socket.h>
#ifdef _KERNEL
-# include <freebsd/sys/systm.h>
+# include <sys/systm.h>
#endif /* _KERNEL */
-#include <freebsd/sys/mbuf.h>
+#include <sys/mbuf.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/tcp.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/tcp.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/pfvar.h>
+#include <net/if.h>
+#include <net/pfvar.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
+#include <netinet/ip6.h>
#endif /* INET6 */
@@ -76,16 +76,16 @@ __FBSDID("$FreeBSD$");
#else
/* Userland equivalents so we can lend code to pfctl et al. */
-# include <freebsd/arpa/inet.h>
-# include <freebsd/errno.h>
-# include <freebsd/stdio.h>
-# include <freebsd/stdlib.h>
-# include <freebsd/string.h>
+# include <arpa/inet.h>
+# include <errno.h>
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
# define rs_malloc(x) malloc(x)
# define rs_free(x) free(x)
# ifdef PFDEBUG
-# include <freebsd/sys/stdarg.h>
+# include <sys/stdarg.h>
# define DPFPRINTF(format, x...) fprintf(stderr, format , ##x)
# else
# define DPFPRINTF(format, x...) ((void)0)
diff --git a/freebsd/sys/contrib/pf/net/pf_subr.c b/freebsd/sys/contrib/pf/net/pf_subr.c
index 14cf232e..c46d61f2 100644
--- a/freebsd/sys/contrib/pf/net/pf_subr.c
+++ b/freebsd/sys/contrib/pf/net/pf_subr.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
@@ -30,43 +30,43 @@
*
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/libkern.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/md5.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/random.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/time.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/libkern.h>
+#include <sys/mbuf.h>
+#include <sys/md5.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/random.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/time.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/route.h>
+#include <net/if.h>
+#include <net/if_types.h>
+#include <net/bpf.h>
+#include <net/route.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/tcp_seq.h>
-#include <freebsd/netinet/udp.h>
-#include <freebsd/netinet/ip_icmp.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/tcp_timer.h>
-#include <freebsd/netinet/tcp_var.h>
-#include <freebsd/netinet/if_ether.h>
-#include <freebsd/net/pfvar.h>
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+#include <netinet/tcp.h>
+#include <netinet/tcp_seq.h>
+#include <netinet/udp.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/in_pcb.h>
+#include <netinet/tcp_timer.h>
+#include <netinet/tcp_var.h>
+#include <netinet/if_ether.h>
+#include <net/pfvar.h>
/*
* Following is where TCP initial sequence number generation occurs.
diff --git a/freebsd/sys/contrib/pf/net/pf_table.c b/freebsd/sys/contrib/pf/net/pf_table.c
index b07fb7c0..bfe98b11 100644
--- a/freebsd/sys/contrib/pf/net/pf_table.c
+++ b/freebsd/sys/contrib/pf/net/pf_table.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $OpenBSD: pf_table.c,v 1.68 2006/05/02 10:08:45 dhartmei Exp $ */
@@ -33,32 +33,32 @@
*/
#ifdef __FreeBSD__
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#endif
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/rwlock.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/socket.h>
+#include <sys/mbuf.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/rwlock.h>
#ifdef __FreeBSD__
-#include <freebsd/sys/malloc.h>
+#include <sys/malloc.h>
#endif
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/netinet/in.h>
+#include <net/if.h>
+#include <net/route.h>
+#include <netinet/in.h>
#ifndef __FreeBSD__
-#include <freebsd/netinet/ip_ipsp.h>
+#include <netinet/ip_ipsp.h>
#endif
-#include <freebsd/net/pfvar.h>
+#include <net/pfvar.h>
#define ACCEPT_FLAGS(oklist) \
do { \
diff --git a/freebsd/sys/contrib/pf/net/pfvar.h b/freebsd/sys/contrib/pf/net/pfvar.h
index c6429781..0d711ffc 100644
--- a/freebsd/sys/contrib/pf/net/pfvar.h
+++ b/freebsd/sys/contrib/pf/net/pfvar.h
@@ -31,35 +31,35 @@
*
*/
-#ifndef _NET_PFVAR_HH_
-#define _NET_PFVAR_HH_
+#ifndef _NET_PFVAR_H_
+#define _NET_PFVAR_H_
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/tree.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/queue.h>
+#include <sys/tree.h>
#ifdef __FreeBSD__
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/sx.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/sx.h>
#else
-#include <freebsd/sys/rwlock.h>
+#include <sys/rwlock.h>
#endif
-#include <freebsd/net/radix.h>
-#include <freebsd/net/route.h>
+#include <net/radix.h>
+#include <net/route.h>
#ifdef __FreeBSD__
-#include <freebsd/net/if_clone.h>
-#include <freebsd/net/pf_mtag.h>
-#include <freebsd/vm/uma.h>
+#include <net/if_clone.h>
+#include <net/pf_mtag.h>
+#include <vm/uma.h>
#else
-#include <freebsd/netinet/ip_ipsp.h>
+#include <netinet/ip_ipsp.h>
#endif
#ifdef __FreeBSD__
-#include <freebsd/netinet/in.h>
+#include <netinet/in.h>
#endif
-#include <freebsd/netinet/tcp_fsm.h>
+#include <netinet/tcp_fsm.h>
struct ip;
struct ip6_hdr;
@@ -1863,4 +1863,4 @@ int pf_osfp_match(struct pf_osfp_enlist *, pf_osfp_t);
struct pf_os_fingerprint *
pf_osfp_validate(void);
-#endif /* _NET_PFVAR_HH_ */
+#endif /* _NET_PFVAR_H_ */
diff --git a/freebsd/sys/contrib/pf/netinet/in4_cksum.c b/freebsd/sys/contrib/pf/netinet/in4_cksum.c
index 105f26f0..de81173f 100644
--- a/freebsd/sys/contrib/pf/netinet/in4_cksum.c
+++ b/freebsd/sys/contrib/pf/netinet/in4_cksum.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/* $OpenBSD: in4_cksum.c,v 1.7 2003/06/02 23:28:13 millert Exp $ */
@@ -65,16 +65,16 @@
* @(#)in_cksum.c 8.1 (Berkeley) 6/10/93
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
-#include <freebsd/machine/in_cksum.h>
+#include <machine/in_cksum.h>
#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x)
#define REDUCE {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; ADDCARRY(sum);}
diff --git a/freebsd/sys/crypto/blowfish/bf_ecb.c b/freebsd/sys/crypto/blowfish/bf_ecb.c
index 50f26508..53b1c307 100644
--- a/freebsd/sys/crypto/blowfish/bf_ecb.c
+++ b/freebsd/sys/crypto/blowfish/bf_ecb.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* crypto/bf/bf_ecb.c */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
@@ -58,12 +58,12 @@
* [including the GNU Public Licence.]
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/types.h>
-#include <freebsd/crypto/blowfish/blowfish.h>
-#include <freebsd/crypto/blowfish/bf_locl.h>
+#include <rtems/bsd/sys/types.h>
+#include <crypto/blowfish/blowfish.h>
+#include <crypto/blowfish/bf_locl.h>
/* Blowfish as implemented from 'Blowfish: Springer-Verlag paper'
* (From LECTURE NOTES IN COMPUTER SCIENCE 809, FAST SOFTWARE ENCRYPTION,
diff --git a/freebsd/sys/crypto/blowfish/bf_enc.c b/freebsd/sys/crypto/blowfish/bf_enc.c
index 59cb399b..3629f433 100644
--- a/freebsd/sys/crypto/blowfish/bf_enc.c
+++ b/freebsd/sys/crypto/blowfish/bf_enc.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $KAME: bf_enc.c,v 1.7 2002/02/27 01:33:59 itojun Exp $ */
@@ -61,12 +61,12 @@
* [including the GNU Public Licence.]
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/types.h>
-#include <freebsd/crypto/blowfish/blowfish.h>
-#include <freebsd/crypto/blowfish/bf_locl.h>
+#include <rtems/bsd/sys/types.h>
+#include <crypto/blowfish/blowfish.h>
+#include <crypto/blowfish/bf_locl.h>
/* Blowfish as implemented from 'Blowfish: Springer-Verlag paper'
* (From LECTURE NOTES IN COIMPUTER SCIENCE 809, FAST SOFTWARE ENCRYPTION,
diff --git a/freebsd/sys/crypto/blowfish/bf_skey.c b/freebsd/sys/crypto/blowfish/bf_skey.c
index cc53ae55..86720555 100644
--- a/freebsd/sys/crypto/blowfish/bf_skey.c
+++ b/freebsd/sys/crypto/blowfish/bf_skey.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $KAME: bf_skey.c,v 1.7 2002/02/27 01:33:59 itojun Exp $ */
@@ -61,15 +61,15 @@
* [including the GNU Public Licence.]
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/crypto/blowfish/blowfish.h>
-#include <freebsd/crypto/blowfish/bf_locl.h>
-#include <freebsd/crypto/blowfish/bf_pi.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/systm.h>
+#include <crypto/blowfish/blowfish.h>
+#include <crypto/blowfish/bf_locl.h>
+#include <crypto/blowfish/bf_pi.h>
void
BF_set_key(key, len, data)
diff --git a/freebsd/sys/crypto/camellia/camellia-api.c b/freebsd/sys/crypto/camellia/camellia-api.c
index 1b749b48..82e7a61c 100644
--- a/freebsd/sys/crypto/camellia/camellia-api.c
+++ b/freebsd/sys/crypto/camellia/camellia-api.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
*
@@ -29,13 +29,13 @@
* $FreeBSD$
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
-#include <freebsd/sys/types.h>
+#include <rtems/bsd/sys/types.h>
#ifdef _KERNEL
-#include <freebsd/sys/systm.h>
+#include <sys/systm.h>
#endif
-#include <freebsd/crypto/camellia/camellia.h>
+#include <crypto/camellia/camellia.h>
void
camellia_set_key(camellia_ctx *ctx, const u_char *key, int bits)
diff --git a/freebsd/sys/crypto/camellia/camellia.c b/freebsd/sys/crypto/camellia/camellia.c
index 512dfd99..6d01a512 100644
--- a/freebsd/sys/crypto/camellia/camellia.c
+++ b/freebsd/sys/crypto/camellia/camellia.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* camellia.h ver 1.1.0
*
@@ -34,18 +34,18 @@
* http://info.isl.ntt.co.jp/crypt/eng/camellia/specifications.html
*/
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/endian.h>
+#include <sys/cdefs.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/endian.h>
#ifdef _KERNEL
-#include <freebsd/sys/systm.h>
+#include <sys/systm.h>
#else
-#include <freebsd/string.h>
-#include <freebsd/assert.h>
+#include <string.h>
+#include <assert.h>
#define KASSERT(exp, msg) assert(exp)
#endif
-#include <freebsd/crypto/camellia/camellia.h>
+#include <crypto/camellia/camellia.h>
/* key constants */
diff --git a/freebsd/sys/crypto/des/des_ecb.c b/freebsd/sys/crypto/des/des_ecb.c
index 7c4c8386..7b950e55 100644
--- a/freebsd/sys/crypto/des/des_ecb.c
+++ b/freebsd/sys/crypto/des/des_ecb.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $KAME: des_ecb.c,v 1.6 2001/09/10 04:03:58 itojun Exp $ */
@@ -50,13 +50,13 @@
* [including the GNU Public Licence.]
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/crypto/des/des_locl.h>
-#include <freebsd/crypto/des/spr.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <crypto/des/des_locl.h>
+#include <crypto/des/spr.h>
/* char *libdes_version="libdes v 3.24 - 20-Apr-1996 - eay"; */ /* wrong */
/* char *DES_version="DES part of SSLeay 0.6.4 30-Aug-1996"; */
diff --git a/freebsd/sys/crypto/des/des_enc.c b/freebsd/sys/crypto/des/des_enc.c
index ec5f96dd..fca59b3a 100644
--- a/freebsd/sys/crypto/des/des_enc.c
+++ b/freebsd/sys/crypto/des/des_enc.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $KAME: des_enc.c,v 1.1 2001/09/10 04:03:58 itojun Exp $ */
@@ -61,11 +61,11 @@
* [including the GNU Public Licence.]
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/types.h>
-#include <freebsd/crypto/des/des_locl.h>
+#include <rtems/bsd/sys/types.h>
+#include <crypto/des/des_locl.h>
extern const DES_LONG des_SPtrans[8][64];
diff --git a/freebsd/sys/crypto/des/des_locl.h b/freebsd/sys/crypto/des/des_locl.h
index 6c92eb74..2c3cacc1 100644
--- a/freebsd/sys/crypto/des/des_locl.h
+++ b/freebsd/sys/crypto/des/des_locl.h
@@ -51,7 +51,7 @@
#ifndef HEADER_DES_LOCL_H
#define HEADER_DES_LOCL_H
-#include <freebsd/crypto/des/des.h>
+#include <crypto/des/des.h>
#undef DES_PTR
diff --git a/freebsd/sys/crypto/des/des_setkey.c b/freebsd/sys/crypto/des/des_setkey.c
index 398a89d4..b8519ef2 100644
--- a/freebsd/sys/crypto/des/des_setkey.c
+++ b/freebsd/sys/crypto/des/des_setkey.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $KAME: des_setkey.c,v 1.7 2001/09/10 04:03:58 itojun Exp $ */
@@ -58,14 +58,14 @@
* 1.0 First working version
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/crypto/des/des_locl.h>
-#include <freebsd/crypto/des/podd.h>
-#include <freebsd/crypto/des/sk.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <crypto/des/des_locl.h>
+#include <crypto/des/podd.h>
+#include <crypto/des/sk.h>
int des_check_key=0;
diff --git a/freebsd/sys/crypto/rc4/rc4.c b/freebsd/sys/crypto/rc4/rc4.c
index 417c3b44..ce62c712 100644
--- a/freebsd/sys/crypto/rc4/rc4.c
+++ b/freebsd/sys/crypto/rc4/rc4.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* rc4.c
@@ -36,14 +36,14 @@
* OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/crypto/rc4/rc4.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/types.h>
+#include <crypto/rc4/rc4.h>
static __inline void
swap_bytes(u_char *a, u_char *b)
diff --git a/freebsd/sys/crypto/rc4/rc4.h b/freebsd/sys/crypto/rc4/rc4.h
index 90723ddb..670b1a00 100644
--- a/freebsd/sys/crypto/rc4/rc4.h
+++ b/freebsd/sys/crypto/rc4/rc4.h
@@ -37,8 +37,8 @@
* $FreeBSD$
*/
-#ifndef _SYS_CRYPTO_RC4_RC4_HH_
-#define _SYS_CRYPTO_RC4_RC4_HH_
+#ifndef _SYS_CRYPTO_RC4_RC4_H_
+#define _SYS_CRYPTO_RC4_RC4_H_
struct rc4_state {
u_char perm[256];
diff --git a/freebsd/sys/crypto/rijndael/rijndael-alg-fst.c b/freebsd/sys/crypto/rijndael/rijndael-alg-fst.c
index 351f6526..14ac56ba 100644
--- a/freebsd/sys/crypto/rijndael/rijndael-alg-fst.c
+++ b/freebsd/sys/crypto/rijndael/rijndael-alg-fst.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $KAME: rijndael-alg-fst.c,v 1.10 2003/07/15 10:47:16 itojun Exp $ */
/**
@@ -26,21 +26,21 @@
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/types.h>
+#include <sys/cdefs.h>
+#include <rtems/bsd/sys/types.h>
#ifdef _KERNEL
-#include <freebsd/sys/systm.h>
+#include <sys/systm.h>
#else
-#include <freebsd/string.h>
-#include <freebsd/assert.h>
+#include <string.h>
+#include <assert.h>
#define KASSERT(exp, msg) assert(exp)
#endif
-#include <freebsd/crypto/rijndael/rijndael.h>
-#include <freebsd/crypto/rijndael/rijndael_local.h>
+#include <crypto/rijndael/rijndael.h>
+#include <crypto/rijndael/rijndael_local.h>
/*
Te0[x] = S [x].[02, 01, 01, 03];
diff --git a/freebsd/sys/crypto/rijndael/rijndael-api-fst.c b/freebsd/sys/crypto/rijndael/rijndael-api-fst.c
index d63997e5..e715c9b7 100644
--- a/freebsd/sys/crypto/rijndael/rijndael-api-fst.c
+++ b/freebsd/sys/crypto/rijndael/rijndael-api-fst.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $KAME: rijndael-api-fst.c,v 1.10 2001/05/27 09:34:18 itojun Exp $ */
@@ -17,18 +17,18 @@
* This code is placed in the public domain.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
+#include <rtems/bsd/sys/param.h>
#ifdef _KERNEL
-#include <freebsd/sys/systm.h>
+#include <sys/systm.h>
#else
-#include <freebsd/string.h>
+#include <string.h>
#endif
-#include <freebsd/crypto/rijndael/rijndael_local.h>
-#include <freebsd/crypto/rijndael/rijndael-api-fst.h>
+#include <crypto/rijndael/rijndael_local.h>
+#include <crypto/rijndael/rijndael-api-fst.h>
#ifndef TRUE
#define TRUE 1
diff --git a/freebsd/sys/crypto/rijndael/rijndael-api-fst.h b/freebsd/sys/crypto/rijndael/rijndael-api-fst.h
index f21cb790..122bf52d 100644
--- a/freebsd/sys/crypto/rijndael/rijndael-api-fst.h
+++ b/freebsd/sys/crypto/rijndael/rijndael-api-fst.h
@@ -11,7 +11,7 @@
#ifndef __RIJNDAEL_API_FST_H
#define __RIJNDAEL_API_FST_H
-#include <freebsd/crypto/rijndael/rijndael.h>
+#include <crypto/rijndael/rijndael.h>
/* Generic Defines */
#define DIR_ENCRYPT 0 /* Are we encrpyting? */
diff --git a/freebsd/sys/crypto/rijndael/rijndael-api.c b/freebsd/sys/crypto/rijndael/rijndael-api.c
index 2134aa5c..46823e7d 100644
--- a/freebsd/sys/crypto/rijndael/rijndael-api.c
+++ b/freebsd/sys/crypto/rijndael/rijndael-api.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $KAME: rijndael.c,v 1.3 2003/08/28 14:20:22 itojun Exp $ */
@@ -28,15 +28,15 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/types.h>
+#include <rtems/bsd/sys/types.h>
#ifdef _KERNEL
-#include <freebsd/sys/systm.h>
+#include <sys/systm.h>
#endif
-#include <freebsd/crypto/rijndael/rijndael.h>
+#include <crypto/rijndael/rijndael.h>
void
rijndael_set_key(rijndael_ctx *ctx, const u_char *key, int bits)
diff --git a/freebsd/sys/crypto/sha1.c b/freebsd/sys/crypto/sha1.c
index 76b938af..a850eb60 100644
--- a/freebsd/sys/crypto/sha1.c
+++ b/freebsd/sys/crypto/sha1.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $KAME: sha1.c,v 1.5 2000/11/08 06:13:08 itojun Exp $ */
/*
@@ -36,15 +36,15 @@
* implemented by Jun-ichiro itojun Itoh <itojun@itojun.org>
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/systm.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/cdefs.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/systm.h>
-#include <freebsd/crypto/sha1.h>
+#include <crypto/sha1.h>
/* sanity check */
#if BYTE_ORDER != BIG_ENDIAN
diff --git a/freebsd/sys/crypto/sha1.h b/freebsd/sys/crypto/sha1.h
index 18aedda0..3686d7dd 100644
--- a/freebsd/sys/crypto/sha1.h
+++ b/freebsd/sys/crypto/sha1.h
@@ -35,8 +35,8 @@
* implemented by Jun-ichiro itojun Itoh <itojun@itojun.org>
*/
-#ifndef _NETINET6_SHA1_HH_
-#define _NETINET6_SHA1_HH_
+#ifndef _NETINET6_SHA1_H_
+#define _NETINET6_SHA1_H_
struct sha1_ctxt {
union {
@@ -69,4 +69,4 @@ typedef struct sha1_ctxt SHA1_CTX;
#define SHA1_RESULTLEN (160/8)
-#endif /*_NETINET6_SHA1_HH_*/
+#endif /*_NETINET6_SHA1_H_*/
diff --git a/freebsd/sys/crypto/sha2/sha2.c b/freebsd/sys/crypto/sha2/sha2.c
index 3303a318..c5330f31 100644
--- a/freebsd/sys/crypto/sha2/sha2.c
+++ b/freebsd/sys/crypto/sha2/sha2.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $KAME: sha2.c,v 1.8 2001/11/08 01:07:52 itojun Exp $ */
@@ -36,18 +36,18 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/time.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/time.h>
#ifdef _KERNEL
-#include <freebsd/sys/systm.h>
+#include <sys/systm.h>
#else
-#include <freebsd/string.h>
+#include <string.h>
#endif
-#include <freebsd/machine/endian.h>
-#include <freebsd/crypto/sha2/sha2.h>
+#include <machine/rtems-bsd-endian.h>
+#include <crypto/sha2/sha2.h>
/*
* ASSERT NOTE:
diff --git a/freebsd/sys/crypto/sha2/sha2.h b/freebsd/sys/crypto/sha2/sha2.h
index a2443ca1..446d2ea6 100644
--- a/freebsd/sys/crypto/sha2/sha2.h
+++ b/freebsd/sys/crypto/sha2/sha2.h
@@ -72,7 +72,7 @@ typedef unsigned long long u_int64_t; /* 8-bytes (64-bits) */
* uintXX_t types defined by very recent ANSI C standards and included
* in the file:
*
- * #include <freebsd/inttypes.h>
+ * #include <inttypes.h>
*
* If you choose to use <inttypes.h> then please define:
*
diff --git a/freebsd/sys/dev/bce/if_bce.c b/freebsd/sys/dev/bce/if_bce.c
index 646e6cbf..ab8c938e 100644
--- a/freebsd/sys/dev/bce/if_bce.c
+++ b/freebsd/sys/dev/bce/if_bce.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2006-2010 Broadcom Corporation
@@ -30,7 +30,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -53,10 +53,10 @@ __FBSDID("$FreeBSD$");
* BCM5709S A0, B0, B1, B2 (pre-production)
*/
-#include <freebsd/local/opt_bce.h>
+#include <rtems/bsd/local/opt_bce.h>
-#include <freebsd/dev/bce/if_bcereg.h>
-#include <freebsd/dev/bce/if_bcefw.h>
+#include <dev/bce/if_bcereg.h>
+#include <dev/bce/if_bcefw.h>
/****************************************************************************/
/* BCE Debug Options */
diff --git a/freebsd/sys/dev/bce/if_bcereg.h b/freebsd/sys/dev/bce/if_bcereg.h
index 4ed5fdda..1f2ed1df 100644
--- a/freebsd/sys/dev/bce/if_bcereg.h
+++ b/freebsd/sys/dev/bce/if_bcereg.h
@@ -33,53 +33,53 @@
#define _BCEREG_HH_DEFINED
#ifdef HAVE_KERNEL_OPTION_HEADERS
-#include <freebsd/local/opt_device_polling.h>
+#include <rtems/bsd/local/opt_device_polling.h>
#endif
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/endian.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/queue.h>
-
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_arp.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_media.h>
-
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_vlan_var.h>
-
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/if_ether.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/udp.h>
-
-#include <freebsd/machine/bus.h>
-#include <freebsd/machine/resource.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/rman.h>
-
-#include <freebsd/dev/mii/mii.h>
-#include <freebsd/dev/mii/miivar.h>
-#include <freebsd/local/miidevs.h>
-#include <freebsd/dev/mii/brgphyreg.h>
-
-#include <freebsd/dev/pci/pcireg.h>
-#include <freebsd/dev/pci/pcivar.h>
-
-#include <freebsd/local/miibus_if.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/endian.h>
+#include <sys/systm.h>
+#include <sys/sockio.h>
+#include <sys/mbuf.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/socket.h>
+#include <sys/sysctl.h>
+#include <sys/queue.h>
+
+#include <net/bpf.h>
+#include <net/ethernet.h>
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <net/if_dl.h>
+#include <net/if_media.h>
+
+#include <net/if_types.h>
+#include <net/if_vlan_var.h>
+
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
+#include <netinet/ip.h>
+#include <netinet/ip6.h>
+#include <netinet/tcp.h>
+#include <netinet/udp.h>
+
+#include <machine/bus.h>
+#include <machine/resource.h>
+#include <sys/bus.h>
+#include <sys/rman.h>
+
+#include <dev/mii/mii.h>
+#include <dev/mii/miivar.h>
+#include <rtems/bsd/local/miidevs.h>
+#include <dev/mii/brgphyreg.h>
+
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcivar.h>
+
+#include <rtems/bsd/local/miibus_if.h>
/****************************************************************************/
/* Conversion to FreeBSD type definitions. */
@@ -468,7 +468,7 @@
bce_debug = bce_debug_temp;
/* Needed for random() function which is only used in debugging. */
-#include <freebsd/sys/random.h>
+#include <sys/random.h>
/* Returns FALSE in "defects" per 2^31 - 1 calls, otherwise returns TRUE. */
#define DB_RANDOMFALSE(defects) (random() > defects)
diff --git a/freebsd/sys/dev/bfe/if_bfe.c b/freebsd/sys/dev/bfe/if_bfe.c
index 7ce821b8..74746c28 100644
--- a/freebsd/sys/dev/bfe/if_bfe.c
+++ b/freebsd/sys/dev/bfe/if_bfe.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2003 Stuart Walsh<stu@ipng.org.uk>
@@ -27,46 +27,46 @@
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/endian.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/rman.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_vlan_var.h>
-
-#include <freebsd/dev/mii/mii.h>
-#include <freebsd/dev/mii/miivar.h>
-
-#include <freebsd/dev/pci/pcireg.h>
-#include <freebsd/dev/pci/pcivar.h>
-
-#include <freebsd/machine/bus.h>
-
-#include <freebsd/dev/bfe/if_bfereg.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/endian.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <sys/rman.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/sysctl.h>
+
+#include <net/bpf.h>
+#include <net/if.h>
+#include <net/ethernet.h>
+#include <net/if_dl.h>
+#include <net/if_media.h>
+#include <net/if_types.h>
+#include <net/if_vlan_var.h>
+
+#include <dev/mii/mii.h>
+#include <dev/mii/miivar.h>
+
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcivar.h>
+
+#include <machine/bus.h>
+
+#include <dev/bfe/if_bfereg.h>
MODULE_DEPEND(bfe, pci, 1, 1, 1);
MODULE_DEPEND(bfe, ether, 1, 1, 1);
MODULE_DEPEND(bfe, miibus, 1, 1, 1);
/* "device miibus" required. See GENERIC if you get errors here. */
-#include <freebsd/local/miibus_if.h>
+#include <rtems/bsd/local/miibus_if.h>
#define BFE_DEVDESC_MAX 64 /* Maximum device description length */
diff --git a/freebsd/sys/dev/bge/if_bge.c b/freebsd/sys/dev/bge/if_bge.c
index 4ae441bd..06f5ba7b 100644
--- a/freebsd/sys/dev/bge/if_bge.c
+++ b/freebsd/sys/dev/bge/if_bge.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001 Wind River Systems
@@ -33,7 +33,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -69,58 +69,58 @@ __FBSDID("$FreeBSD$");
*/
#ifdef HAVE_KERNEL_OPTION_HEADERS
-#include <freebsd/local/opt_device_polling.h>
+#include <rtems/bsd/local/opt_device_polling.h>
#endif
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/endian.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/taskqueue.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_arp.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_media.h>
-
-#include <freebsd/net/bpf.h>
-
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_vlan_var.h>
-
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/tcp.h>
-
-#include <freebsd/machine/bus.h>
-#include <freebsd/machine/resource.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/rman.h>
-
-#include <freebsd/dev/mii/mii.h>
-#include <freebsd/dev/mii/miivar.h>
-#include <freebsd/local/miidevs.h>
-#include <freebsd/dev/mii/brgphyreg.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/endian.h>
+#include <sys/systm.h>
+#include <sys/sockio.h>
+#include <sys/mbuf.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/socket.h>
+#include <sys/sysctl.h>
+#include <sys/taskqueue.h>
+
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <net/ethernet.h>
+#include <net/if_dl.h>
+#include <net/if_media.h>
+
+#include <net/bpf.h>
+
+#include <net/if_types.h>
+#include <net/if_vlan_var.h>
+
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <netinet/tcp.h>
+
+#include <machine/bus.h>
+#include <machine/resource.h>
+#include <sys/bus.h>
+#include <sys/rman.h>
+
+#include <dev/mii/mii.h>
+#include <dev/mii/miivar.h>
+#include <rtems/bsd/local/miidevs.h>
+#include <dev/mii/brgphyreg.h>
#ifdef __sparc64__
-#include <freebsd/dev/ofw/ofw_bus.h>
-#include <freebsd/dev/ofw/openfirm.h>
-#include <freebsd/machine/ofw_machdep.h>
-#include <freebsd/machine/ver.h>
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/openfirm.h>
+#include <machine/ofw_machdep.h>
+#include <machine/ver.h>
#endif
-#include <freebsd/dev/pci/pcireg.h>
-#include <freebsd/dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcivar.h>
-#include <freebsd/dev/bge/if_bgereg.h>
+#include <dev/bge/if_bgereg.h>
#define BGE_CSUM_FEATURES (CSUM_IP | CSUM_TCP)
#define ETHER_MIN_NOPAD (ETHER_MIN_LEN - ETHER_CRC_LEN) /* i.e., 60 */
@@ -130,7 +130,7 @@ MODULE_DEPEND(bge, ether, 1, 1, 1);
MODULE_DEPEND(bge, miibus, 1, 1, 1);
/* "device miibus" required. See GENERIC if you get errors here. */
-#include <freebsd/local/miibus_if.h>
+#include <rtems/bsd/local/miibus_if.h>
/*
* Various supported device vendors/types and their names. Note: the
diff --git a/freebsd/sys/dev/dc/dcphy.c b/freebsd/sys/dev/dc/dcphy.c
index 75ba2ce5..fcfa7d6c 100644
--- a/freebsd/sys/dev/dc/dcphy.c
+++ b/freebsd/sys/dev/dc/dcphy.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1997, 1998, 1999
@@ -32,7 +32,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -44,33 +44,33 @@ __FBSDID("$FreeBSD$");
* which is harder to do.
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/bus.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/socket.h>
+#include <rtems/bsd/sys/errno.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/module.h>
+#include <sys/mutex.h>
+#include <sys/bus.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_arp.h>
-#include <freebsd/net/if_media.h>
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <net/if_media.h>
-#include <freebsd/dev/mii/mii.h>
-#include <freebsd/dev/mii/miivar.h>
-#include <freebsd/local/miidevs.h>
+#include <dev/mii/mii.h>
+#include <dev/mii/miivar.h>
+#include <rtems/bsd/local/miidevs.h>
-#include <freebsd/machine/bus.h>
-#include <freebsd/machine/resource.h>
-#include <freebsd/sys/bus.h>
+#include <machine/bus.h>
+#include <machine/resource.h>
+#include <sys/bus.h>
-#include <freebsd/dev/pci/pcivar.h>
+#include <dev/pci/pcivar.h>
-#include <freebsd/dev/dc/if_dcreg.h>
+#include <dev/dc/if_dcreg.h>
-#include <freebsd/local/miibus_if.h>
+#include <rtems/bsd/local/miibus_if.h>
#define DC_SETBIT(sc, reg, x) \
CSR_WRITE_4(sc, reg, \
diff --git a/freebsd/sys/dev/dc/if_dc.c b/freebsd/sys/dev/dc/if_dc.c
index 512555b5..9b60bc06 100644
--- a/freebsd/sys/dev/dc/if_dc.c
+++ b/freebsd/sys/dev/dc/if_dc.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1997, 1998, 1999
@@ -32,7 +32,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -95,47 +95,47 @@ __FBSDID("$FreeBSD$");
*/
#ifdef HAVE_KERNEL_OPTION_HEADERS
-#include <freebsd/local/opt_device_polling.h>
+#include <rtems/bsd/local/opt_device_polling.h>
#endif
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/endian.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/socket.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_arp.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_vlan_var.h>
-
-#include <freebsd/net/bpf.h>
-
-#include <freebsd/machine/bus.h>
-#include <freebsd/machine/resource.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/rman.h>
-
-#include <freebsd/dev/mii/mii.h>
-#include <freebsd/dev/mii/miivar.h>
-
-#include <freebsd/dev/pci/pcireg.h>
-#include <freebsd/dev/pci/pcivar.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/endian.h>
+#include <sys/systm.h>
+#include <sys/sockio.h>
+#include <sys/mbuf.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/socket.h>
+
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <net/ethernet.h>
+#include <net/if_dl.h>
+#include <net/if_media.h>
+#include <net/if_types.h>
+#include <net/if_vlan_var.h>
+
+#include <net/bpf.h>
+
+#include <machine/bus.h>
+#include <machine/resource.h>
+#include <sys/bus.h>
+#include <sys/rman.h>
+
+#include <dev/mii/mii.h>
+#include <dev/mii/miivar.h>
+
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcivar.h>
#define DC_USEIOSPACE
-#include <freebsd/dev/dc/if_dcreg.h>
+#include <dev/dc/if_dcreg.h>
#ifdef __sparc64__
-#include <freebsd/dev/ofw/openfirm.h>
-#include <freebsd/machine/ofw_machdep.h>
+#include <dev/ofw/openfirm.h>
+#include <machine/ofw_machdep.h>
#endif
MODULE_DEPEND(dc, pci, 1, 1, 1);
@@ -146,7 +146,7 @@ MODULE_DEPEND(dc, miibus, 1, 1, 1);
* "device miibus" is required in kernel config. See GENERIC if you get
* errors here.
*/
-#include <freebsd/local/miibus_if.h>
+#include <rtems/bsd/local/miibus_if.h>
/*
* Various supported device vendors/types and their names.
diff --git a/freebsd/sys/dev/dc/pnphy.c b/freebsd/sys/dev/dc/pnphy.c
index d5837e54..b59ddf61 100644
--- a/freebsd/sys/dev/dc/pnphy.c
+++ b/freebsd/sys/dev/dc/pnphy.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* Copyright (c) 1997, 1998, 1999
@@ -32,7 +32,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -42,31 +42,31 @@ __FBSDID("$FreeBSD$");
* NWAY to work right is amazingly difficult.
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/bus.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/socket.h>
+#include <rtems/bsd/sys/errno.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/module.h>
+#include <sys/mutex.h>
+#include <sys/bus.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_arp.h>
-#include <freebsd/net/if_media.h>
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <net/if_media.h>
-#include <freebsd/dev/mii/mii.h>
-#include <freebsd/dev/mii/miivar.h>
-#include <freebsd/local/miidevs.h>
+#include <dev/mii/mii.h>
+#include <dev/mii/miivar.h>
+#include <rtems/bsd/local/miidevs.h>
-#include <freebsd/machine/bus.h>
-#include <freebsd/machine/resource.h>
-#include <freebsd/sys/bus.h>
+#include <machine/bus.h>
+#include <machine/resource.h>
+#include <sys/bus.h>
-#include <freebsd/dev/dc/if_dcreg.h>
+#include <dev/dc/if_dcreg.h>
-#include <freebsd/local/miibus_if.h>
+#include <rtems/bsd/local/miibus_if.h>
#define DC_SETBIT(sc, reg, x) \
CSR_WRITE_4(sc, reg, \
diff --git a/freebsd/sys/dev/e1000/e1000_80003es2lan.c b/freebsd/sys/dev/e1000/e1000_80003es2lan.c
index bec2a8ac..79fba337 100644
--- a/freebsd/sys/dev/e1000/e1000_80003es2lan.c
+++ b/freebsd/sys/dev/e1000/e1000_80003es2lan.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/******************************************************************************
@@ -40,9 +40,9 @@
*/
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_api.h>
+#include <dev/e1000/e1000_api.h>
#else
-#include <freebsd/local/e1000_api.h>
+#include <rtems/bsd/local/e1000_api.h>
#endif
static s32 e1000_init_phy_params_80003es2lan(struct e1000_hw *hw);
diff --git a/freebsd/sys/dev/e1000/e1000_80003es2lan.h b/freebsd/sys/dev/e1000/e1000_80003es2lan.h
index 923d66b3..3ab1ec9d 100644
--- a/freebsd/sys/dev/e1000/e1000_80003es2lan.h
+++ b/freebsd/sys/dev/e1000/e1000_80003es2lan.h
@@ -32,8 +32,8 @@
******************************************************************************/
/*$FreeBSD$*/
-#ifndef _E1000_80003ES2LAN_HH_
-#define _E1000_80003ES2LAN_HH_
+#ifndef _E1000_80003ES2LAN_H_
+#define _E1000_80003ES2LAN_H_
#define E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL 0x00
#define E1000_KMRNCTRLSTA_OFFSET_INB_CTRL 0x02
diff --git a/freebsd/sys/dev/e1000/e1000_82540.c b/freebsd/sys/dev/e1000/e1000_82540.c
index 2f2f0b08..c0e8932f 100644
--- a/freebsd/sys/dev/e1000/e1000_82540.c
+++ b/freebsd/sys/dev/e1000/e1000_82540.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/******************************************************************************
@@ -46,9 +46,9 @@
*/
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_api.h>
+#include <dev/e1000/e1000_api.h>
#else
-#include <freebsd/local/e1000_api.h>
+#include <rtems/bsd/local/e1000_api.h>
#endif
static s32 e1000_init_phy_params_82540(struct e1000_hw *hw);
diff --git a/freebsd/sys/dev/e1000/e1000_82541.c b/freebsd/sys/dev/e1000/e1000_82541.c
index 9faee5fd..2b655738 100644
--- a/freebsd/sys/dev/e1000/e1000_82541.c
+++ b/freebsd/sys/dev/e1000/e1000_82541.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/******************************************************************************
@@ -44,9 +44,9 @@
*/
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_api.h>
+#include <dev/e1000/e1000_api.h>
#else
-#include <freebsd/local/e1000_api.h>
+#include <rtems/bsd/local/e1000_api.h>
#endif
static s32 e1000_init_phy_params_82541(struct e1000_hw *hw);
diff --git a/freebsd/sys/dev/e1000/e1000_82541.h b/freebsd/sys/dev/e1000/e1000_82541.h
index f730c3a4..3b6b9612 100644
--- a/freebsd/sys/dev/e1000/e1000_82541.h
+++ b/freebsd/sys/dev/e1000/e1000_82541.h
@@ -32,8 +32,8 @@
******************************************************************************/
/*$FreeBSD$*/
-#ifndef _E1000_82541_HH_
-#define _E1000_82541_HH_
+#ifndef _E1000_82541_H_
+#define _E1000_82541_H_
#define NVM_WORD_SIZE_BASE_SHIFT_82541 (NVM_WORD_SIZE_BASE_SHIFT + 1)
diff --git a/freebsd/sys/dev/e1000/e1000_82542.c b/freebsd/sys/dev/e1000/e1000_82542.c
index 96687ed4..1e2f8671 100644
--- a/freebsd/sys/dev/e1000/e1000_82542.c
+++ b/freebsd/sys/dev/e1000/e1000_82542.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/******************************************************************************
@@ -39,9 +39,9 @@
*/
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_api.h>
+#include <dev/e1000/e1000_api.h>
#else
-#include <freebsd/local/e1000_api.h>
+#include <rtems/bsd/local/e1000_api.h>
#endif
static s32 e1000_init_phy_params_82542(struct e1000_hw *hw);
diff --git a/freebsd/sys/dev/e1000/e1000_82543.c b/freebsd/sys/dev/e1000/e1000_82543.c
index 0836cf51..ccf5bddf 100644
--- a/freebsd/sys/dev/e1000/e1000_82543.c
+++ b/freebsd/sys/dev/e1000/e1000_82543.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/******************************************************************************
@@ -44,9 +44,9 @@
*/
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_api.h>
+#include <dev/e1000/e1000_api.h>
#else
-#include <freebsd/local/e1000_api.h>
+#include <rtems/bsd/local/e1000_api.h>
#endif
static s32 e1000_init_phy_params_82543(struct e1000_hw *hw);
diff --git a/freebsd/sys/dev/e1000/e1000_82543.h b/freebsd/sys/dev/e1000/e1000_82543.h
index a95ad502..60e5c15d 100644
--- a/freebsd/sys/dev/e1000/e1000_82543.h
+++ b/freebsd/sys/dev/e1000/e1000_82543.h
@@ -32,8 +32,8 @@
******************************************************************************/
/*$FreeBSD$*/
-#ifndef _E1000_82543_HH_
-#define _E1000_82543_HH_
+#ifndef _E1000_82543_H_
+#define _E1000_82543_H_
#define PHY_PREAMBLE 0xFFFFFFFF
#define PHY_PREAMBLE_SIZE 32
diff --git a/freebsd/sys/dev/e1000/e1000_82571.c b/freebsd/sys/dev/e1000/e1000_82571.c
index bb122d3e..8faf6f91 100644
--- a/freebsd/sys/dev/e1000/e1000_82571.c
+++ b/freebsd/sys/dev/e1000/e1000_82571.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/******************************************************************************
@@ -52,9 +52,9 @@
*/
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_api.h>
+#include <dev/e1000/e1000_api.h>
#else
-#include <freebsd/local/e1000_api.h>
+#include <rtems/bsd/local/e1000_api.h>
#endif
static s32 e1000_init_phy_params_82571(struct e1000_hw *hw);
diff --git a/freebsd/sys/dev/e1000/e1000_82571.h b/freebsd/sys/dev/e1000/e1000_82571.h
index afccbf04..c76f16fe 100644
--- a/freebsd/sys/dev/e1000/e1000_82571.h
+++ b/freebsd/sys/dev/e1000/e1000_82571.h
@@ -32,8 +32,8 @@
******************************************************************************/
/*$FreeBSD$*/
-#ifndef _E1000_82571_HH_
-#define _E1000_82571_HH_
+#ifndef _E1000_82571_H_
+#define _E1000_82571_H_
#define ID_LED_RESERVED_F746 0xF746
#define ID_LED_DEFAULT_82573 ((ID_LED_DEF1_DEF2 << 12) | \
diff --git a/freebsd/sys/dev/e1000/e1000_82575.c b/freebsd/sys/dev/e1000/e1000_82575.c
index 5637832c..4ce9d194 100644
--- a/freebsd/sys/dev/e1000/e1000_82575.c
+++ b/freebsd/sys/dev/e1000/e1000_82575.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/******************************************************************************
@@ -44,9 +44,9 @@
*/
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_api.h>
+#include <dev/e1000/e1000_api.h>
#else
-#include <freebsd/local/e1000_api.h>
+#include <rtems/bsd/local/e1000_api.h>
#endif
static s32 e1000_init_phy_params_82575(struct e1000_hw *hw);
diff --git a/freebsd/sys/dev/e1000/e1000_82575.h b/freebsd/sys/dev/e1000/e1000_82575.h
index 11a27b9b..eb05262d 100644
--- a/freebsd/sys/dev/e1000/e1000_82575.h
+++ b/freebsd/sys/dev/e1000/e1000_82575.h
@@ -32,8 +32,8 @@
******************************************************************************/
/*$FreeBSD$*/
-#ifndef _E1000_82575_HH_
-#define _E1000_82575_HH_
+#ifndef _E1000_82575_H_
+#define _E1000_82575_H_
#define ID_LED_DEFAULT_82575_SERDES ((ID_LED_DEF1_DEF2 << 12) | \
(ID_LED_DEF1_DEF2 << 8) | \
@@ -472,4 +472,4 @@ void e1000_vfta_set_vf(struct e1000_hw *, u16, bool);
void e1000_rlpml_set_vf(struct e1000_hw *, u16);
s32 e1000_promisc_set_vf(struct e1000_hw *, enum e1000_promisc_type type);
u16 e1000_rxpbs_adjust_82580(u32 data);
-#endif /* _E1000_82575_HH_ */
+#endif /* _E1000_82575_H_ */
diff --git a/freebsd/sys/dev/e1000/e1000_api.c b/freebsd/sys/dev/e1000/e1000_api.c
index b7f72837..17b4c817 100644
--- a/freebsd/sys/dev/e1000/e1000_api.c
+++ b/freebsd/sys/dev/e1000/e1000_api.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/******************************************************************************
@@ -35,9 +35,9 @@
/*$FreeBSD$*/
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_api.h>
+#include <dev/e1000/e1000_api.h>
#else
-#include <freebsd/local/e1000_api.h>
+#include <rtems/bsd/local/e1000_api.h>
#endif
/**
diff --git a/freebsd/sys/dev/e1000/e1000_api.h b/freebsd/sys/dev/e1000/e1000_api.h
index 94af19ce..c28fc2de 100644
--- a/freebsd/sys/dev/e1000/e1000_api.h
+++ b/freebsd/sys/dev/e1000/e1000_api.h
@@ -32,13 +32,13 @@
******************************************************************************/
/*$FreeBSD$*/
-#ifndef _E1000_API_HH_
-#define _E1000_API_HH_
+#ifndef _E1000_API_H_
+#define _E1000_API_H_
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_hw.h>
+#include <dev/e1000/e1000_hw.h>
#else
-#include <freebsd/local/e1000_hw.h>
+#include <rtems/bsd/local/e1000_hw.h>
#endif
extern void e1000_init_function_pointers_82542(struct e1000_hw *hw);
diff --git a/freebsd/sys/dev/e1000/e1000_defines.h b/freebsd/sys/dev/e1000/e1000_defines.h
index 142903f9..5d09ad92 100644
--- a/freebsd/sys/dev/e1000/e1000_defines.h
+++ b/freebsd/sys/dev/e1000/e1000_defines.h
@@ -32,8 +32,8 @@
******************************************************************************/
/*$FreeBSD$*/
-#ifndef _E1000_DEFINES_HH_
-#define _E1000_DEFINES_HH_
+#ifndef _E1000_DEFINES_H_
+#define _E1000_DEFINES_H_
/* Number of Transmit and Receive Descriptors must be a multiple of 8 */
#define REQ_TX_DESCRIPTOR_MULTIPLE 8
@@ -1720,4 +1720,4 @@
on DMA coal */
-#endif /* _E1000_DEFINES_HH_ */
+#endif /* _E1000_DEFINES_H_ */
diff --git a/freebsd/sys/dev/e1000/e1000_hw.h b/freebsd/sys/dev/e1000/e1000_hw.h
index c51089f8..e5dfe84d 100644
--- a/freebsd/sys/dev/e1000/e1000_hw.h
+++ b/freebsd/sys/dev/e1000/e1000_hw.h
@@ -32,17 +32,17 @@
******************************************************************************/
/*$FreeBSD$*/
-#ifndef _E1000_HW_HH_
-#define _E1000_HW_HH_
+#ifndef _E1000_HW_H_
+#define _E1000_HW_H_
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_osdep.h>
-#include <freebsd/dev/e1000/e1000_regs.h>
-#include <freebsd/dev/e1000/e1000_defines.h>
+#include <dev/e1000/e1000_osdep.h>
+#include <dev/e1000/e1000_regs.h>
+#include <dev/e1000/e1000_defines.h>
#else
-#include <freebsd/local/e1000_osdep.h>
-#include <freebsd/local/e1000_regs.h>
-#include <freebsd/local/e1000_defines.h>
+#include <rtems/bsd/local/e1000_osdep.h>
+#include <rtems/bsd/local/e1000_regs.h>
+#include <rtems/bsd/local/e1000_defines.h>
#endif
struct e1000_hw;
@@ -630,17 +630,17 @@ struct e1000_host_mng_command_info {
};
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_mac.h>
-#include <freebsd/dev/e1000/e1000_phy.h>
-#include <freebsd/dev/e1000/e1000_nvm.h>
-#include <freebsd/dev/e1000/e1000_manage.h>
-#include <freebsd/dev/e1000/e1000_mbx.h>
+#include <dev/e1000/e1000_mac.h>
+#include <dev/e1000/e1000_phy.h>
+#include <dev/e1000/e1000_nvm.h>
+#include <dev/e1000/e1000_manage.h>
+#include <dev/e1000/e1000_mbx.h>
#else
-#include <freebsd/local/e1000_mac.h>
-#include <freebsd/local/e1000_phy.h>
-#include <freebsd/local/e1000_nvm.h>
-#include <freebsd/local/e1000_manage.h>
-#include <freebsd/local/e1000_mbx.h>
+#include <rtems/bsd/local/e1000_mac.h>
+#include <rtems/bsd/local/e1000_phy.h>
+#include <rtems/bsd/local/e1000_nvm.h>
+#include <rtems/bsd/local/e1000_manage.h>
+#include <rtems/bsd/local/e1000_mbx.h>
#endif
struct e1000_mac_operations {
@@ -942,19 +942,19 @@ struct e1000_hw {
};
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_82541.h>
-#include <freebsd/dev/e1000/e1000_82543.h>
-#include <freebsd/dev/e1000/e1000_82571.h>
-#include <freebsd/dev/e1000/e1000_80003es2lan.h>
-#include <freebsd/dev/e1000/e1000_ich8lan.h>
-#include <freebsd/dev/e1000/e1000_82575.h>
+#include <dev/e1000/e1000_82541.h>
+#include <dev/e1000/e1000_82543.h>
+#include <dev/e1000/e1000_82571.h>
+#include <dev/e1000/e1000_80003es2lan.h>
+#include <dev/e1000/e1000_ich8lan.h>
+#include <dev/e1000/e1000_82575.h>
#else
-#include <freebsd/local/e1000_82541.h>
-#include <freebsd/local/e1000_82543.h>
-#include <freebsd/local/e1000_82571.h>
-#include <freebsd/local/e1000_80003es2lan.h>
-#include <freebsd/local/e1000_ich8lan.h>
-#include <freebsd/local/e1000_82575.h>
+#include <rtems/bsd/local/e1000_82541.h>
+#include <rtems/bsd/local/e1000_82543.h>
+#include <rtems/bsd/local/e1000_82571.h>
+#include <rtems/bsd/local/e1000_80003es2lan.h>
+#include <rtems/bsd/local/e1000_ich8lan.h>
+#include <rtems/bsd/local/e1000_82575.h>
#endif
/* These functions must be implemented by drivers */
diff --git a/freebsd/sys/dev/e1000/e1000_ich8lan.c b/freebsd/sys/dev/e1000/e1000_ich8lan.c
index d8c02cb5..6bf287c8 100644
--- a/freebsd/sys/dev/e1000/e1000_ich8lan.c
+++ b/freebsd/sys/dev/e1000/e1000_ich8lan.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/******************************************************************************
@@ -65,9 +65,9 @@
*/
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_api.h>
+#include <dev/e1000/e1000_api.h>
#else
-#include <freebsd/local/e1000_api.h>
+#include <rtems/bsd/local/e1000_api.h>
#endif
static s32 e1000_init_phy_params_ich8lan(struct e1000_hw *hw);
diff --git a/freebsd/sys/dev/e1000/e1000_ich8lan.h b/freebsd/sys/dev/e1000/e1000_ich8lan.h
index 9e87f4d5..2935af56 100644
--- a/freebsd/sys/dev/e1000/e1000_ich8lan.h
+++ b/freebsd/sys/dev/e1000/e1000_ich8lan.h
@@ -32,8 +32,8 @@
******************************************************************************/
/*$FreeBSD$*/
-#ifndef _E1000_ICH8LAN_HH_
-#define _E1000_ICH8LAN_HH_
+#ifndef _E1000_ICH8LAN_H_
+#define _E1000_ICH8LAN_H_
#define ICH_FLASH_GFPREG 0x0000
#define ICH_FLASH_HSFSTS 0x0004
diff --git a/freebsd/sys/dev/e1000/e1000_mac.c b/freebsd/sys/dev/e1000/e1000_mac.c
index 8b38ef9d..0a78d95d 100644
--- a/freebsd/sys/dev/e1000/e1000_mac.c
+++ b/freebsd/sys/dev/e1000/e1000_mac.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/******************************************************************************
@@ -35,9 +35,9 @@
/*$FreeBSD$*/
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_api.h>
+#include <dev/e1000/e1000_api.h>
#else
-#include <freebsd/local/e1000_api.h>
+#include <rtems/bsd/local/e1000_api.h>
#endif
static s32 e1000_validate_mdi_setting_generic(struct e1000_hw *hw);
diff --git a/freebsd/sys/dev/e1000/e1000_mac.h b/freebsd/sys/dev/e1000/e1000_mac.h
index e1ec987e..348d660f 100644
--- a/freebsd/sys/dev/e1000/e1000_mac.h
+++ b/freebsd/sys/dev/e1000/e1000_mac.h
@@ -32,8 +32,8 @@
******************************************************************************/
/*$FreeBSD$*/
-#ifndef _E1000_MAC_HH_
-#define _E1000_MAC_HH_
+#ifndef _E1000_MAC_H_
+#define _E1000_MAC_H_
/*
* Functions that should not be called directly from drivers but can be used
diff --git a/freebsd/sys/dev/e1000/e1000_manage.c b/freebsd/sys/dev/e1000/e1000_manage.c
index 4198425e..540b8a0c 100644
--- a/freebsd/sys/dev/e1000/e1000_manage.c
+++ b/freebsd/sys/dev/e1000/e1000_manage.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/******************************************************************************
@@ -35,9 +35,9 @@
/*$FreeBSD$*/
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_api.h>
+#include <dev/e1000/e1000_api.h>
#else
-#include <freebsd/local/e1000_api.h>
+#include <rtems/bsd/local/e1000_api.h>
#endif
static u8 e1000_calculate_checksum(u8 *buffer, u32 length);
diff --git a/freebsd/sys/dev/e1000/e1000_manage.h b/freebsd/sys/dev/e1000/e1000_manage.h
index 42f3bf2e..146caeb5 100644
--- a/freebsd/sys/dev/e1000/e1000_manage.h
+++ b/freebsd/sys/dev/e1000/e1000_manage.h
@@ -32,8 +32,8 @@
******************************************************************************/
/*$FreeBSD$*/
-#ifndef _E1000_MANAGE_HH_
-#define _E1000_MANAGE_HH_
+#ifndef _E1000_MANAGE_H_
+#define _E1000_MANAGE_H_
bool e1000_check_mng_mode_generic(struct e1000_hw *hw);
bool e1000_enable_tx_pkt_filtering_generic(struct e1000_hw *hw);
diff --git a/freebsd/sys/dev/e1000/e1000_mbx.c b/freebsd/sys/dev/e1000/e1000_mbx.c
index b30ede51..5236837a 100644
--- a/freebsd/sys/dev/e1000/e1000_mbx.c
+++ b/freebsd/sys/dev/e1000/e1000_mbx.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/******************************************************************************
@@ -35,9 +35,9 @@
/*$FreeBSD$*/
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_mbx.h>
+#include <dev/e1000/e1000_mbx.h>
#else
-#include <freebsd/local/e1000_mnx.h>
+#include <rtems/bsd/local/e1000_mnx.h>
#endif
/**
diff --git a/freebsd/sys/dev/e1000/e1000_mbx.h b/freebsd/sys/dev/e1000/e1000_mbx.h
index 4c705282..0785ee2e 100644
--- a/freebsd/sys/dev/e1000/e1000_mbx.h
+++ b/freebsd/sys/dev/e1000/e1000_mbx.h
@@ -32,13 +32,13 @@
******************************************************************************/
/*$FreeBSD$*/
-#ifndef _E1000_MBX_HH_
-#define _E1000_MBX_HH_
+#ifndef _E1000_MBX_H_
+#define _E1000_MBX_H_
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_api.h>
+#include <dev/e1000/e1000_api.h>
#else
-#include <freebsd/local/e1000_api.h>
+#include <rtems/bsd/local/e1000_api.h>
#endif
/* Define mailbox register bits */
@@ -107,4 +107,4 @@ void e1000_init_mbx_ops_generic(struct e1000_hw *hw);
s32 e1000_init_mbx_params_vf(struct e1000_hw *);
s32 e1000_init_mbx_params_pf(struct e1000_hw *);
-#endif /* _E1000_MBX_HH_ */
+#endif /* _E1000_MBX_H_ */
diff --git a/freebsd/sys/dev/e1000/e1000_nvm.c b/freebsd/sys/dev/e1000/e1000_nvm.c
index cc2e9edc..8fefe31c 100644
--- a/freebsd/sys/dev/e1000/e1000_nvm.c
+++ b/freebsd/sys/dev/e1000/e1000_nvm.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/******************************************************************************
@@ -35,9 +35,9 @@
/*$FreeBSD$*/
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_api.h>
+#include <dev/e1000/e1000_api.h>
#else
-#include <freebsd/local/e1000_api.h>
+#include <rtems/bsd/local/e1000_api.h>
#endif
static void e1000_reload_nvm_generic(struct e1000_hw *hw);
diff --git a/freebsd/sys/dev/e1000/e1000_nvm.h b/freebsd/sys/dev/e1000/e1000_nvm.h
index 89b65a0f..36ee4448 100644
--- a/freebsd/sys/dev/e1000/e1000_nvm.h
+++ b/freebsd/sys/dev/e1000/e1000_nvm.h
@@ -32,8 +32,8 @@
******************************************************************************/
/*$FreeBSD$*/
-#ifndef _E1000_NVM_HH_
-#define _E1000_NVM_HH_
+#ifndef _E1000_NVM_H_
+#define _E1000_NVM_H_
void e1000_init_nvm_ops_generic(struct e1000_hw *hw);
s32 e1000_null_read_nvm(struct e1000_hw *hw, u16 a, u16 b, u16 *c);
diff --git a/freebsd/sys/dev/e1000/e1000_osdep.c b/freebsd/sys/dev/e1000/e1000_osdep.c
index bf95d850..e02899ad 100644
--- a/freebsd/sys/dev/e1000/e1000_osdep.c
+++ b/freebsd/sys/dev/e1000/e1000_osdep.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/******************************************************************************
@@ -35,9 +35,9 @@
/*$FreeBSD$*/
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_api.h>
+#include <dev/e1000/e1000_api.h>
#else
-#include <freebsd/local/e1000_api.h>
+#include <rtems/bsd/local/e1000_api.h>
#endif
/*
diff --git a/freebsd/sys/dev/e1000/e1000_osdep.h b/freebsd/sys/dev/e1000/e1000_osdep.h
index 64ea32e1..e3db3ec5 100644
--- a/freebsd/sys/dev/e1000/e1000_osdep.h
+++ b/freebsd/sys/dev/e1000/e1000_osdep.h
@@ -33,28 +33,28 @@
/*$FreeBSD$*/
-#ifndef _FREEBSD_OS_HH_
-#define _FREEBSD_OS_HH_
-
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/machine/bus.h>
-#include <freebsd/sys/rman.h>
-#include <freebsd/machine/resource.h>
-#include <freebsd/vm/vm.h>
-#include <freebsd/vm/pmap.h>
-#include <freebsd/machine/clock.h>
-#include <freebsd/dev/pci/pcivar.h>
-#include <freebsd/dev/pci/pcireg.h>
+#ifndef _FREEBSD_OS_H_
+#define _FREEBSD_OS_H_
+
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/mbuf.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <machine/bus.h>
+#include <sys/rman.h>
+#include <machine/resource.h>
+#include <vm/vm.h>
+#include <vm/pmap.h>
+#include <machine/clock.h>
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
#define ASSERT(x) if(!(x)) panic("EM: x")
@@ -216,5 +216,5 @@ struct e1000_osdep
bus_space_write_2(((struct e1000_osdep *)(hw)->back)->flash_bus_space_tag, \
((struct e1000_osdep *)(hw)->back)->flash_bus_space_handle, reg, value)
-#endif /* _FREEBSD_OS_HH_ */
+#endif /* _FREEBSD_OS_H_ */
diff --git a/freebsd/sys/dev/e1000/e1000_phy.c b/freebsd/sys/dev/e1000/e1000_phy.c
index 5b567f45..c5365e51 100644
--- a/freebsd/sys/dev/e1000/e1000_phy.c
+++ b/freebsd/sys/dev/e1000/e1000_phy.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/******************************************************************************
@@ -35,9 +35,9 @@
/*$FreeBSD$*/
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_api.h>
+#include <dev/e1000/e1000_api.h>
#else
-#include <freebsd/local/e1000_api.h>
+#include <rtems/bsd/local/e1000_api.h>
#endif
static u32 e1000_get_phy_addr_for_bm_page(u32 page, u32 reg);
diff --git a/freebsd/sys/dev/e1000/e1000_phy.h b/freebsd/sys/dev/e1000/e1000_phy.h
index 7fd83969..c42ef6c6 100644
--- a/freebsd/sys/dev/e1000/e1000_phy.h
+++ b/freebsd/sys/dev/e1000/e1000_phy.h
@@ -32,8 +32,8 @@
******************************************************************************/
/*$FreeBSD$*/
-#ifndef _E1000_PHY_HH_
-#define _E1000_PHY_HH_
+#ifndef _E1000_PHY_H_
+#define _E1000_PHY_H_
void e1000_init_phy_ops_generic(struct e1000_hw *hw);
s32 e1000_null_read_reg(struct e1000_hw *hw, u32 offset, u16 *data);
diff --git a/freebsd/sys/dev/e1000/e1000_regs.h b/freebsd/sys/dev/e1000/e1000_regs.h
index 536f087f..38ccff32 100644
--- a/freebsd/sys/dev/e1000/e1000_regs.h
+++ b/freebsd/sys/dev/e1000/e1000_regs.h
@@ -32,8 +32,8 @@
******************************************************************************/
/*$FreeBSD$*/
-#ifndef _E1000_REGS_HH_
-#define _E1000_REGS_HH_
+#ifndef _E1000_REGS_H_
+#define _E1000_REGS_H_
#define E1000_CTRL 0x00000 /* Device Control - RW */
#define E1000_CTRL_DUP 0x00004 /* Device Control Duplicate (Shadow) - RW */
diff --git a/freebsd/sys/dev/e1000/e1000_vf.c b/freebsd/sys/dev/e1000/e1000_vf.c
index 943b24e7..de6feb6a 100644
--- a/freebsd/sys/dev/e1000/e1000_vf.c
+++ b/freebsd/sys/dev/e1000/e1000_vf.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/******************************************************************************
@@ -35,9 +35,9 @@
/*$FreeBSD$*/
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_api.h>
+#include <dev/e1000/e1000_api.h>
#else
-#include <freebsd/local/e1000_api.h>
+#include <rtems/bsd/local/e1000_api.h>
#endif
static s32 e1000_init_phy_params_vf(struct e1000_hw *hw);
diff --git a/freebsd/sys/dev/e1000/e1000_vf.h b/freebsd/sys/dev/e1000/e1000_vf.h
index 28bb4fde..8d02eda3 100644
--- a/freebsd/sys/dev/e1000/e1000_vf.h
+++ b/freebsd/sys/dev/e1000/e1000_vf.h
@@ -32,17 +32,17 @@
******************************************************************************/
/*$FreeBSD$*/
-#ifndef _E1000_VF_HH_
-#define _E1000_VF_HH_
+#ifndef _E1000_VF_H_
+#define _E1000_VF_H_
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_osdep.h>
-#include <freebsd/dev/e1000/e1000_regs.h>
-#include <freebsd/dev/e1000/e1000_defines.h>
+#include <dev/e1000/e1000_osdep.h>
+#include <dev/e1000/e1000_regs.h>
+#include <dev/e1000/e1000_defines.h>
#else
-#include <freebsd/local/e1000_osdep.h>
-#include <freebsd/local/e1000_regs.h>
-#include <freebsd/local/e1000_defines.h>
+#include <rtems/bsd/local/e1000_osdep.h>
+#include <rtems/bsd/local/e1000_regs.h>
+#include <rtems/bsd/local/e1000_defines.h>
#endif
struct e1000_hw;
@@ -196,9 +196,9 @@ struct e1000_vf_stats {
};
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_mbx.h>
+#include <dev/e1000/e1000_mbx.h>
#else
-#include <freebsd/local/e1000_mbx.h>
+#include <rtems/bsd/local/e1000_mbx.h>
#endif
struct e1000_mac_operations {
@@ -298,4 +298,4 @@ s32 e1000_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value);
void e1000_vfta_set_vf(struct e1000_hw *, u16, bool);
void e1000_rlpml_set_vf(struct e1000_hw *, u16);
s32 e1000_promisc_set_vf(struct e1000_hw *, enum e1000_promisc_type);
-#endif /* _E1000_VF_HH_ */
+#endif /* _E1000_VF_H_ */
diff --git a/freebsd/sys/dev/e1000/if_em.c b/freebsd/sys/dev/e1000/if_em.c
index bc3ac3a3..c0fffc30 100644
--- a/freebsd/sys/dev/e1000/if_em.c
+++ b/freebsd/sys/dev/e1000/if_em.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/******************************************************************************
@@ -35,62 +35,62 @@
/*$FreeBSD$*/
#ifdef HAVE_KERNEL_OPTION_HEADERS
-#include <freebsd/local/opt_device_polling.h>
-#include <freebsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_device_polling.h>
+#include <rtems/bsd/local/opt_inet.h>
#endif
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
#if __FreeBSD_version >= 800000
-#include <freebsd/sys/buf_ring.h>
+#include <sys/buf_ring.h>
#endif
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/endian.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/kthread.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/rman.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/taskqueue.h>
-#include <freebsd/sys/eventhandler.h>
-#include <freebsd/machine/bus.h>
-#include <freebsd/machine/resource.h>
-
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_arp.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_media.h>
-
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_vlan_var.h>
-
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/if_ether.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/udp.h>
-
-#include <freebsd/machine/in_cksum.h>
-#include <freebsd/dev/led/led.h>
-#include <freebsd/dev/pci/pcivar.h>
-#include <freebsd/dev/pci/pcireg.h>
+#include <sys/bus.h>
+#include <sys/endian.h>
+#include <sys/kernel.h>
+#include <sys/kthread.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <sys/rman.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/sysctl.h>
+#include <sys/taskqueue.h>
+#include <sys/eventhandler.h>
+#include <machine/bus.h>
+#include <machine/resource.h>
+
+#include <net/bpf.h>
+#include <net/ethernet.h>
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <net/if_dl.h>
+#include <net/if_media.h>
+
+#include <net/if_types.h>
+#include <net/if_vlan_var.h>
+
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
+#include <netinet/ip.h>
+#include <netinet/ip6.h>
+#include <netinet/tcp.h>
+#include <netinet/udp.h>
+
+#include <machine/in_cksum.h>
+#include <dev/led/led.h>
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_api.h>
-#include <freebsd/dev/e1000/e1000_82571.h>
-#include <freebsd/dev/e1000/if_em.h>
+#include <dev/e1000/e1000_api.h>
+#include <dev/e1000/e1000_82571.h>
+#include <dev/e1000/if_em.h>
#else
-#include <freebsd/local/e1000_api.h>
-#include <freebsd/local/e1000_82571.h>
-#include <freebsd/local/if_em.h>
+#include <rtems/bsd/local/e1000_api.h>
+#include <rtems/bsd/local/e1000_82571.h>
+#include <rtems/bsd/local/if_em.h>
#endif
/*********************************************************************
diff --git a/freebsd/sys/dev/e1000/if_igb.c b/freebsd/sys/dev/e1000/if_igb.c
index 2653ccbb..27d9c92b 100644
--- a/freebsd/sys/dev/e1000/if_igb.c
+++ b/freebsd/sys/dev/e1000/if_igb.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/******************************************************************************
@@ -36,67 +36,67 @@
#ifdef HAVE_KERNEL_OPTION_HEADERS
-#include <freebsd/local/opt_device_polling.h>
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_altq.h>
+#include <rtems/bsd/local/opt_device_polling.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_altq.h>
#endif
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
#if __FreeBSD_version >= 800000
-#include <freebsd/sys/buf_ring.h>
+#include <sys/buf_ring.h>
#endif
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/endian.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/kthread.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/rman.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/taskqueue.h>
-#include <freebsd/sys/eventhandler.h>
-#include <freebsd/sys/pcpu.h>
-#include <freebsd/sys/smp.h>
-#include <freebsd/machine/smp.h>
-#include <freebsd/machine/bus.h>
-#include <freebsd/machine/resource.h>
-
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_arp.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_media.h>
-
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_vlan_var.h>
-
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/if_ether.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/tcp_lro.h>
-#include <freebsd/netinet/udp.h>
-
-#include <freebsd/machine/in_cksum.h>
-#include <freebsd/dev/led/led.h>
-#include <freebsd/dev/pci/pcivar.h>
-#include <freebsd/dev/pci/pcireg.h>
+#include <sys/bus.h>
+#include <sys/endian.h>
+#include <sys/kernel.h>
+#include <sys/kthread.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <sys/rman.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/sysctl.h>
+#include <sys/taskqueue.h>
+#include <sys/eventhandler.h>
+#include <sys/pcpu.h>
+#include <sys/smp.h>
+#include <machine/smp.h>
+#include <machine/bus.h>
+#include <machine/resource.h>
+
+#include <net/bpf.h>
+#include <net/ethernet.h>
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <net/if_dl.h>
+#include <net/if_media.h>
+
+#include <net/if_types.h>
+#include <net/if_vlan_var.h>
+
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
+#include <netinet/ip.h>
+#include <netinet/ip6.h>
+#include <netinet/tcp.h>
+#include <netinet/tcp_lro.h>
+#include <netinet/udp.h>
+
+#include <machine/in_cksum.h>
+#include <dev/led/led.h>
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_api.h>
-#include <freebsd/dev/e1000/e1000_82575.h>
-#include <freebsd/dev/e1000/if_igb.h>
+#include <dev/e1000/e1000_api.h>
+#include <dev/e1000/e1000_82575.h>
+#include <dev/e1000/if_igb.h>
#else
-#include <freebsd/local/e1000_api.h>
-#include <freebsd/local/e1000_82575.h>
-#include <freebsd/local/if_igb.h>
+#include <rtems/bsd/local/e1000_api.h>
+#include <rtems/bsd/local/e1000_82575.h>
+#include <rtems/bsd/local/if_igb.h>
#endif
/*********************************************************************
diff --git a/freebsd/sys/dev/e1000/if_lem.c b/freebsd/sys/dev/e1000/if_lem.c
index b0daee16..402a6f48 100644
--- a/freebsd/sys/dev/e1000/if_lem.c
+++ b/freebsd/sys/dev/e1000/if_lem.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/******************************************************************************
@@ -35,57 +35,57 @@
/*$FreeBSD$*/
#ifdef HAVE_KERNEL_OPTION_HEADERS
-#include <freebsd/local/opt_device_polling.h>
-#include <freebsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_device_polling.h>
+#include <rtems/bsd/local/opt_inet.h>
#endif
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/endian.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/kthread.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/rman.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/taskqueue.h>
-#include <freebsd/sys/eventhandler.h>
-#include <freebsd/machine/bus.h>
-#include <freebsd/machine/resource.h>
-
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_arp.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_media.h>
-
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_vlan_var.h>
-
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/if_ether.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/udp.h>
-
-#include <freebsd/machine/in_cksum.h>
-#include <freebsd/dev/led/led.h>
-#include <freebsd/dev/pci/pcivar.h>
-#include <freebsd/dev/pci/pcireg.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/endian.h>
+#include <sys/kernel.h>
+#include <sys/kthread.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <sys/rman.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/sysctl.h>
+#include <sys/taskqueue.h>
+#include <sys/eventhandler.h>
+#include <machine/bus.h>
+#include <machine/resource.h>
+
+#include <net/bpf.h>
+#include <net/ethernet.h>
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <net/if_dl.h>
+#include <net/if_media.h>
+
+#include <net/if_types.h>
+#include <net/if_vlan_var.h>
+
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
+#include <netinet/ip.h>
+#include <netinet/ip6.h>
+#include <netinet/tcp.h>
+#include <netinet/udp.h>
+
+#include <machine/in_cksum.h>
+#include <dev/led/led.h>
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
#ifdef __rtems__
-#include <freebsd/dev/e1000/e1000_api.h>
-#include <freebsd/dev/e1000/if_lem.h>
+#include <dev/e1000/e1000_api.h>
+#include <dev/e1000/if_lem.h>
#else
-#include <freebsd/local/e1000_api.h>
-#include <freebsd/local/if_lem.h>
+#include <rtems/bsd/local/e1000_api.h>
+#include <rtems/bsd/local/if_lem.h>
#endif
/*********************************************************************
diff --git a/freebsd/sys/dev/fxp/if_fxp.c b/freebsd/sys/dev/fxp/if_fxp.c
index 51ee51a9..7bc247dc 100644
--- a/freebsd/sys/dev/fxp/if_fxp.c
+++ b/freebsd/sys/dev/fxp/if_fxp.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1995, David Greenman
@@ -29,7 +29,7 @@
*
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -37,56 +37,56 @@ __FBSDID("$FreeBSD$");
*/
#ifdef HAVE_KERNEL_OPTION_HEADERS
-#include <freebsd/local/opt_device_polling.h>
+#include <rtems/bsd/local/opt_device_polling.h>
#endif
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/endian.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/rman.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_arp.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_vlan_var.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/udp.h>
-
-#include <freebsd/machine/bus.h>
-#include <freebsd/machine/in_cksum.h>
-#include <freebsd/machine/resource.h>
-
-#include <freebsd/dev/pci/pcivar.h>
-#include <freebsd/dev/pci/pcireg.h> /* for PCIM_CMD_xxx */
-
-#include <freebsd/dev/mii/mii.h>
-#include <freebsd/dev/mii/miivar.h>
-
-#include <freebsd/dev/fxp/if_fxpreg.h>
-#include <freebsd/dev/fxp/if_fxpvar.h>
-#include <freebsd/dev/fxp/rcvbundl.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/endian.h>
+#include <sys/kernel.h>
+#include <sys/mbuf.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/module.h>
+#include <sys/mutex.h>
+#include <sys/rman.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/sysctl.h>
+
+#include <net/bpf.h>
+#include <net/ethernet.h>
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <net/if_dl.h>
+#include <net/if_media.h>
+#include <net/if_types.h>
+#include <net/if_vlan_var.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/tcp.h>
+#include <netinet/udp.h>
+
+#include <machine/bus.h>
+#include <machine/in_cksum.h>
+#include <machine/resource.h>
+
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h> /* for PCIM_CMD_xxx */
+
+#include <dev/mii/mii.h>
+#include <dev/mii/miivar.h>
+
+#include <dev/fxp/if_fxpreg.h>
+#include <dev/fxp/if_fxpvar.h>
+#include <dev/fxp/rcvbundl.h>
MODULE_DEPEND(fxp, pci, 1, 1, 1);
MODULE_DEPEND(fxp, ether, 1, 1, 1);
MODULE_DEPEND(fxp, miibus, 1, 1, 1);
-#include <freebsd/local/miibus_if.h>
+#include <rtems/bsd/local/miibus_if.h>
/*
* NOTE! On the Alpha, we have an alignment constraint. The
diff --git a/freebsd/sys/dev/led/led.c b/freebsd/sys/dev/led/led.c
index ae214909..db609a45 100644
--- a/freebsd/sys/dev/led/led.c
+++ b/freebsd/sys/dev/led/led.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* ----------------------------------------------------------------------------
@@ -10,21 +10,21 @@
*
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/conf.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/limits.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/ctype.h>
-#include <freebsd/sys/sbuf.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/dev/led/led.h>
-#include <freebsd/sys/uio.h>
-#include <freebsd/sys/sx.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/conf.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
+#include <sys/limits.h>
+#include <sys/malloc.h>
+#include <sys/ctype.h>
+#include <sys/sbuf.h>
+#include <sys/queue.h>
+#include <dev/led/led.h>
+#include <sys/uio.h>
+#include <sys/sx.h>
struct ledsc {
LIST_ENTRY(ledsc) list;
diff --git a/freebsd/sys/dev/mii/brgphy.c b/freebsd/sys/dev/mii/brgphy.c
index 9b53c83d..5633413c 100644
--- a/freebsd/sys/dev/mii/brgphy.c
+++ b/freebsd/sys/dev/mii/brgphy.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2000
@@ -32,38 +32,38 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* Driver for the Broadcom BCM54xx/57xx 1000baseTX PHY.
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/bus.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/socket.h>
+#include <sys/bus.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if_media.h>
+#include <net/if.h>
+#include <net/ethernet.h>
+#include <net/if_media.h>
-#include <freebsd/dev/mii/mii.h>
-#include <freebsd/dev/mii/miivar.h>
-#include <freebsd/local/miidevs.h>
+#include <dev/mii/mii.h>
+#include <dev/mii/miivar.h>
+#include <rtems/bsd/local/miidevs.h>
-#include <freebsd/dev/mii/brgphyreg.h>
-#include <freebsd/net/if_arp.h>
-#include <freebsd/machine/bus.h>
-#include <freebsd/dev/bge/if_bgereg.h>
-#include <freebsd/dev/bce/if_bcereg.h>
+#include <dev/mii/brgphyreg.h>
+#include <net/if_arp.h>
+#include <machine/bus.h>
+#include <dev/bge/if_bgereg.h>
+#include <dev/bce/if_bcereg.h>
-#include <freebsd/dev/pci/pcireg.h>
-#include <freebsd/dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcivar.h>
-#include <freebsd/local/miibus_if.h>
+#include <rtems/bsd/local/miibus_if.h>
static int brgphy_probe(device_t);
static int brgphy_attach(device_t);
diff --git a/freebsd/sys/dev/mii/brgphyreg.h b/freebsd/sys/dev/mii/brgphyreg.h
index fb8b65a5..3f5ee5df 100644
--- a/freebsd/sys/dev/mii/brgphyreg.h
+++ b/freebsd/sys/dev/mii/brgphyreg.h
@@ -32,8 +32,8 @@
* $FreeBSD$
*/
-#ifndef _DEV_MII_BRGPHYREG_HH_
-#define _DEV_MII_BRGPHYREG_HH_
+#ifndef _DEV_MII_BRGPHYREG_H_
+#define _DEV_MII_BRGPHYREG_H_
/*
* Broadcom BCM5400 registers
@@ -417,4 +417,4 @@
#define BRGPHY_INTRS \
~(BRGPHY_IMR_LNK_CHG|BRGPHY_IMR_LSP_CHG|BRGPHY_IMR_DUP_CHG)
-#endif /* _DEV_BRGPHY_MIIREG_HH_ */
+#endif /* _DEV_BRGPHY_MIIREG_H_ */
diff --git a/freebsd/sys/dev/mii/icsphy.c b/freebsd/sys/dev/mii/icsphy.c
index a034eb36..e2315bc8 100644
--- a/freebsd/sys/dev/mii/icsphy.c
+++ b/freebsd/sys/dev/mii/icsphy.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $NetBSD: icsphy.c,v 1.41 2006/11/16 21:24:07 christos Exp $ */
@@ -56,7 +56,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -64,23 +64,23 @@ __FBSDID("$FreeBSD$");
* datasheet from www.icst.com
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/bus.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/socket.h>
+#include <sys/bus.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
+#include <net/if.h>
+#include <net/if_media.h>
-#include <freebsd/dev/mii/mii.h>
-#include <freebsd/dev/mii/miivar.h>
-#include <freebsd/local/miidevs.h>
+#include <dev/mii/mii.h>
+#include <dev/mii/miivar.h>
+#include <rtems/bsd/local/miidevs.h>
-#include <freebsd/dev/mii/icsphyreg.h>
+#include <dev/mii/icsphyreg.h>
-#include <freebsd/local/miibus_if.h>
+#include <rtems/bsd/local/miibus_if.h>
static int icsphy_probe(device_t dev);
static int icsphy_attach(device_t dev);
diff --git a/freebsd/sys/dev/mii/icsphyreg.h b/freebsd/sys/dev/mii/icsphyreg.h
index a5754b7d..d92d0b51 100644
--- a/freebsd/sys/dev/mii/icsphyreg.h
+++ b/freebsd/sys/dev/mii/icsphyreg.h
@@ -32,8 +32,8 @@
* $FreeBSD$
*/
-#ifndef _DEV_MII_ICSPHYREG_HH_
-#define _DEV_MII_ICSPHYREG_HH_
+#ifndef _DEV_MII_ICSPHYREG_H_
+#define _DEV_MII_ICSPHYREG_H_
/*
* ICS1890 registers.
@@ -126,4 +126,4 @@
#define ECR2_10AUTOPWRDN 0x0002 /* Automatic 10baseT power down */
#define ECR2_100AUTOPWRDN 0x0001 /* Automatic 100baseTX power down */
-#endif /* _DEV_MII_ICSPHYREG_HH_ */
+#endif /* _DEV_MII_ICSPHYREG_H_ */
diff --git a/freebsd/sys/dev/mii/mii.c b/freebsd/sys/dev/mii/mii.c
index c5aebad6..5b949156 100644
--- a/freebsd/sys/dev/mii/mii.c
+++ b/freebsd/sys/dev/mii/mii.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $NetBSD: mii.c,v 1.12 1999/08/03 19:41:49 drochner Exp $ */
@@ -32,7 +32,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -41,23 +41,23 @@ __FBSDID("$FreeBSD$");
* plus some NetBSD extensions.
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/bus.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/socket.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/bus.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/route.h>
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/route.h>
-#include <freebsd/dev/mii/mii.h>
-#include <freebsd/dev/mii/miivar.h>
+#include <dev/mii/mii.h>
+#include <dev/mii/miivar.h>
MODULE_VERSION(miibus, 1);
-#include <freebsd/local/miibus_if.h>
+#include <rtems/bsd/local/miibus_if.h>
static int miibus_print_child(device_t dev, device_t child);
static int miibus_read_ivar(device_t dev, device_t child, int which,
diff --git a/freebsd/sys/dev/mii/mii.h b/freebsd/sys/dev/mii/mii.h
index 21c6b768..1d887d23 100644
--- a/freebsd/sys/dev/mii/mii.h
+++ b/freebsd/sys/dev/mii/mii.h
@@ -29,8 +29,8 @@
* $FreeBSD$
*/
-#ifndef _DEV_MII_MII_HH_
-#define _DEV_MII_MII_HH_
+#ifndef _DEV_MII_MII_H_
+#define _DEV_MII_MII_H_
/*
* Registers common to all PHYs.
@@ -209,4 +209,4 @@
#define EXTSR_MEDIAMASK (EXTSR_1000XFDX|EXTSR_1000XHDX| \
EXTSR_1000TFDX|EXTSR_1000THDX)
-#endif /* _DEV_MII_MII_HH_ */
+#endif /* _DEV_MII_MII_H_ */
diff --git a/freebsd/sys/dev/mii/mii_physubr.c b/freebsd/sys/dev/mii/mii_physubr.c
index f5a278d6..3b6e0042 100644
--- a/freebsd/sys/dev/mii/mii_physubr.c
+++ b/freebsd/sys/dev/mii/mii_physubr.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $NetBSD: mii_physubr.c,v 1.5 1999/08/03 19:41:49 drochner Exp $ */
@@ -32,28 +32,28 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* Subroutines common to all PHYs.
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/bus.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/socket.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/module.h>
+#include <sys/bus.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
+#include <net/if.h>
+#include <net/if_media.h>
-#include <freebsd/dev/mii/mii.h>
-#include <freebsd/dev/mii/miivar.h>
+#include <dev/mii/mii.h>
+#include <dev/mii/miivar.h>
-#include <freebsd/local/miibus_if.h>
+#include <rtems/bsd/local/miibus_if.h>
/*
* Media to register setting conversion table. Order matters.
diff --git a/freebsd/sys/dev/mii/miivar.h b/freebsd/sys/dev/mii/miivar.h
index e8d467f7..d56ea18d 100644
--- a/freebsd/sys/dev/mii/miivar.h
+++ b/freebsd/sys/dev/mii/miivar.h
@@ -32,10 +32,10 @@
* $FreeBSD$
*/
-#ifndef _DEV_MII_MIIVAR_HH_
-#define _DEV_MII_MIIVAR_HH_
+#ifndef _DEV_MII_MIIVAR_H_
+#define _DEV_MII_MIIVAR_H_
-#include <freebsd/sys/queue.h>
+#include <sys/queue.h>
/*
* Media Independent Interface configuration defintions.
@@ -257,4 +257,4 @@ int mii_phy_dev_probe(device_t dev, const struct mii_phydesc *mpd, int mrv);
void ukphy_status(struct mii_softc *);
#endif /* _KERNEL */
-#endif /* _DEV_MII_MIIVAR_HH_ */
+#endif /* _DEV_MII_MIIVAR_H_ */
diff --git a/freebsd/sys/dev/pci/pci.c b/freebsd/sys/dev/pci/pci.c
index ebff0fff..8552fdb7 100644
--- a/freebsd/sys/dev/pci/pci.c
+++ b/freebsd/sys/dev/pci/pci.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1997, Stefan Esser <se@freebsd.org>
@@ -28,56 +28,56 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_bus.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/linker.h>
-#include <freebsd/sys/fcntl.h>
-#include <freebsd/sys/conf.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/endian.h>
-
-#include <freebsd/vm/vm.h>
-#include <freebsd/vm/pmap.h>
+#include <rtems/bsd/local/opt_bus.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/linker.h>
+#include <sys/fcntl.h>
+#include <sys/conf.h>
+#include <sys/kernel.h>
+#include <sys/queue.h>
+#include <sys/sysctl.h>
+#include <sys/endian.h>
+
+#include <vm/vm.h>
+#include <vm/pmap.h>
#ifndef __rtems__
-#include <freebsd/vm/vm_extern.h>
+#include <vm/vm_extern.h>
#endif /* __rtems__ */
-#include <freebsd/sys/bus.h>
-#include <freebsd/machine/bus.h>
-#include <freebsd/sys/rman.h>
-#include <freebsd/machine/resource.h>
-#include <freebsd/machine/stdarg.h>
+#include <sys/bus.h>
+#include <machine/bus.h>
+#include <sys/rman.h>
+#include <machine/resource.h>
+#include <machine/stdarg.h>
#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__)
-#include <freebsd/machine/intr_machdep.h>
+#include <machine/intr_machdep.h>
#endif
-#include <freebsd/sys/pciio.h>
-#include <freebsd/dev/pci/pcireg.h>
-#include <freebsd/dev/pci/pcivar.h>
-#include <freebsd/dev/pci/pci_private.h>
+#include <sys/pciio.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pci_private.h>
-#include <freebsd/dev/usb/controller/ehcireg.h>
-#include <freebsd/dev/usb/controller/ohcireg.h>
+#include <dev/usb/controller/ehcireg.h>
+#include <dev/usb/controller/ohcireg.h>
#ifndef __rtems__
-#include <freebsd/dev/usb/controller/uhcireg.h>
+#include <dev/usb/controller/uhcireg.h>
#endif /* __rtems__ */
-#include <freebsd/local/pcib_if.h>
-#include <freebsd/local/pci_if.h>
+#include <rtems/bsd/local/pcib_if.h>
+#include <rtems/bsd/local/pci_if.h>
#ifdef __HAVE_ACPI
-#include <freebsd/contrib/dev/acpica/include/acpi.h>
-#include <freebsd/local/acpi_if.h>
+#include <contrib/dev/acpica/include/acpi.h>
+#include <rtems/bsd/local/acpi_if.h>
#else
#define ACPI_PWR_FOR_SLEEP(x, y, z)
#endif
@@ -3591,10 +3591,10 @@ pci_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
}
-#include <freebsd/local/opt_ddb.h>
+#include <rtems/bsd/local/opt_ddb.h>
#ifdef DDB
-#include <freebsd/ddb/ddb.h>
-#include <freebsd/sys/cons.h>
+#include <ddb/ddb.h>
+#include <sys/cons.h>
/*
* List resources based on pci map registers, used for within ddb
diff --git a/freebsd/sys/dev/pci/pci_pci.c b/freebsd/sys/dev/pci/pci_pci.c
index c2a829c8..470386a3 100644
--- a/freebsd/sys/dev/pci/pci_pci.c
+++ b/freebsd/sys/dev/pci/pci_pci.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1994,1995 Stefan Esser, Wolfgang StanglMeier
@@ -30,29 +30,29 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* PCI:PCI bridge support.
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/machine/bus.h>
-#include <freebsd/sys/rman.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/bus.h>
+#include <machine/bus.h>
+#include <sys/rman.h>
+#include <sys/sysctl.h>
-#include <freebsd/machine/resource.h>
+#include <machine/resource.h>
-#include <freebsd/dev/pci/pcivar.h>
-#include <freebsd/dev/pci/pcireg.h>
-#include <freebsd/dev/pci/pcib_private.h>
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcib_private.h>
-#include <freebsd/local/pcib_if.h>
+#include <rtems/bsd/local/pcib_if.h>
static int pcib_probe(device_t dev);
diff --git a/freebsd/sys/dev/pci/pci_private.h b/freebsd/sys/dev/pci/pci_private.h
index 93da2538..e45afb7a 100644
--- a/freebsd/sys/dev/pci/pci_private.h
+++ b/freebsd/sys/dev/pci/pci_private.h
@@ -29,8 +29,8 @@
*
*/
-#ifndef _PCI_PRIVATE_HH_
-#define _PCI_PRIVATE_HH_
+#ifndef _PCI_PRIVATE_H_
+#define _PCI_PRIVATE_H_
/*
* Export definitions of the pci bus so that we can more easily share
@@ -113,4 +113,4 @@ void pci_cfg_restore(device_t, struct pci_devinfo *);
*/
void pci_cfg_save(device_t, struct pci_devinfo *, int);
-#endif /* _PCI_PRIVATE_HH_ */
+#endif /* _PCI_PRIVATE_H_ */
diff --git a/freebsd/sys/dev/pci/pci_user.c b/freebsd/sys/dev/pci/pci_user.c
index c0b1eda0..e7306476 100644
--- a/freebsd/sys/dev/pci/pci_user.c
+++ b/freebsd/sys/dev/pci/pci_user.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1997, Stefan Esser <se@freebsd.org>
@@ -26,41 +26,41 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_bus.h> /* XXX trim includes */
-#include <freebsd/local/opt_compat.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/linker.h>
-#include <freebsd/sys/fcntl.h>
-#include <freebsd/sys/conf.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-
-#include <freebsd/vm/vm.h>
-#include <freebsd/vm/pmap.h>
+#include <rtems/bsd/local/opt_bus.h> /* XXX trim includes */
+#include <rtems/bsd/local/opt_compat.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/linker.h>
+#include <sys/fcntl.h>
+#include <sys/conf.h>
+#include <sys/kernel.h>
+#include <sys/proc.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+
+#include <vm/vm.h>
+#include <vm/pmap.h>
#ifndef __rtems__
-#include <freebsd/vm/vm_extern.h>
+#include <vm/vm_extern.h>
#endif /* __rtems__ */
-#include <freebsd/sys/bus.h>
-#include <freebsd/machine/bus.h>
-#include <freebsd/sys/rman.h>
-#include <freebsd/machine/resource.h>
+#include <sys/bus.h>
+#include <machine/bus.h>
+#include <sys/rman.h>
+#include <machine/resource.h>
-#include <freebsd/sys/pciio.h>
-#include <freebsd/dev/pci/pcireg.h>
-#include <freebsd/dev/pci/pcivar.h>
+#include <sys/pciio.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcivar.h>
-#include <freebsd/local/pcib_if.h>
-#include <freebsd/local/pci_if.h>
+#include <rtems/bsd/local/pcib_if.h>
+#include <rtems/bsd/local/pci_if.h>
/*
* This is the user interface to PCI configuration space.
diff --git a/freebsd/sys/dev/pci/pcivar.h b/freebsd/sys/dev/pci/pcivar.h
index a095db6d..8e2da638 100644
--- a/freebsd/sys/dev/pci/pcivar.h
+++ b/freebsd/sys/dev/pci/pcivar.h
@@ -27,10 +27,10 @@
*
*/
-#ifndef _PCIVAR_HH_
-#define _PCIVAR_HH_
+#ifndef _PCIVAR_H_
+#define _PCIVAR_H_
-#include <freebsd/sys/queue.h>
+#include <sys/queue.h>
/* some PCI bus constants */
#define PCI_MAXMAPS_0 6 /* max. no. of memory/port maps */
@@ -198,7 +198,7 @@ typedef struct {
extern uint32_t pci_numdevs;
/* Only if the prerequisites are present */
-#if defined(_SYS_BUS_HH_) && defined(_SYS_PCIIO_HH_)
+#if defined(_SYS_BUS_H_) && defined(_SYS_PCIIO_H_)
struct pci_devinfo {
STAILQ_ENTRY(pci_devinfo) pci_links;
struct resource_list resources;
@@ -207,9 +207,9 @@ struct pci_devinfo {
};
#endif
-#ifdef _SYS_BUS_HH_
+#ifdef _SYS_BUS_H_
-#include <freebsd/local/pci_if.h>
+#include <rtems/bsd/local/pci_if.h>
enum pci_device_ivars {
PCI_IVAR_SUBVENDOR,
@@ -460,7 +460,7 @@ void pci_ht_map_msi(device_t dev, uint64_t addr);
int pci_get_max_read_req(device_t dev);
int pci_set_max_read_req(device_t dev, int size);
-#endif /* _SYS_BUS_HH_ */
+#endif /* _SYS_BUS_H_ */
/*
* cdev switch for control device, initialised in generic PCI code
@@ -475,4 +475,4 @@ STAILQ_HEAD(devlist, pci_devinfo);
extern struct devlist pci_devq;
extern uint32_t pci_generation;
-#endif /* _PCIVAR_HH_ */
+#endif /* _PCIVAR_H_ */
diff --git a/freebsd/sys/dev/random/harvest.c b/freebsd/sys/dev/random/harvest.c
index 68c60676..8f6efd22 100644
--- a/freebsd/sys/dev/random/harvest.c
+++ b/freebsd/sys/dev/random/harvest.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2000-2004 Mark R V Murray
@@ -27,24 +27,24 @@
*
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kthread.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/poll.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/random.h>
-#include <freebsd/sys/selinfo.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/machine/cpu.h>
-
-#include <freebsd/dev/random/randomdev_soft.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kthread.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mutex.h>
+#include <sys/poll.h>
+#include <sys/queue.h>
+#include <sys/random.h>
+#include <sys/selinfo.h>
+#include <sys/systm.h>
+#include <sys/sysctl.h>
+
+#include <machine/cpu.h>
+
+#include <dev/random/randomdev_soft.h>
static int read_random_phony(void *, int);
diff --git a/freebsd/sys/dev/re/if_re.c b/freebsd/sys/dev/re/if_re.c
index 9424f670..2327aa1f 100644
--- a/freebsd/sys/dev/re/if_re.c
+++ b/freebsd/sys/dev/re/if_re.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1997, 1998-2003
@@ -32,7 +32,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -111,52 +111,52 @@ __FBSDID("$FreeBSD$");
*/
#ifdef HAVE_KERNEL_OPTION_HEADERS
-#include <freebsd/local/opt_device_polling.h>
+#include <rtems/bsd/local/opt_device_polling.h>
#endif
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/endian.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/taskqueue.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_arp.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_vlan_var.h>
-
-#include <freebsd/net/bpf.h>
-
-#include <freebsd/machine/bus.h>
-#include <freebsd/machine/resource.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/rman.h>
-
-#include <freebsd/dev/mii/mii.h>
-#include <freebsd/dev/mii/miivar.h>
-
-#include <freebsd/dev/pci/pcireg.h>
-#include <freebsd/dev/pci/pcivar.h>
-
-#include <freebsd/pci/if_rlreg.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/endian.h>
+#include <sys/systm.h>
+#include <sys/sockio.h>
+#include <sys/mbuf.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/kernel.h>
+#include <sys/socket.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/sysctl.h>
+#include <sys/taskqueue.h>
+
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <net/ethernet.h>
+#include <net/if_dl.h>
+#include <net/if_media.h>
+#include <net/if_types.h>
+#include <net/if_vlan_var.h>
+
+#include <net/bpf.h>
+
+#include <machine/bus.h>
+#include <machine/resource.h>
+#include <sys/bus.h>
+#include <sys/rman.h>
+
+#include <dev/mii/mii.h>
+#include <dev/mii/miivar.h>
+
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcivar.h>
+
+#include <pci/if_rlreg.h>
MODULE_DEPEND(re, pci, 1, 1, 1);
MODULE_DEPEND(re, ether, 1, 1, 1);
MODULE_DEPEND(re, miibus, 1, 1, 1);
/* "device miibus" required. See GENERIC if you get errors here. */
-#include <freebsd/local/miibus_if.h>
+#include <rtems/bsd/local/miibus_if.h>
/* Tunables. */
static int msi_disable = 0;
diff --git a/freebsd/sys/dev/smc/if_smc.c b/freebsd/sys/dev/smc/if_smc.c
index d943111f..236eb546 100644
--- a/freebsd/sys/dev/smc/if_smc.c
+++ b/freebsd/sys/dev/smc/if_smc.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2008 Benno Rice. All rights reserved.
@@ -24,7 +24,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -32,51 +32,51 @@ __FBSDID("$FreeBSD$");
*/
#ifdef HAVE_KERNEL_OPTION_HEADERS
-#include <freebsd/local/opt_device_polling.h>
+#include <rtems/bsd/local/opt_device_polling.h>
#endif
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/taskqueue.h>
-
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/bus.h>
-
-#include <freebsd/machine/bus.h>
-#include <freebsd/machine/resource.h>
-#include <freebsd/sys/rman.h>
-
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_arp.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_mib.h>
-#include <freebsd/net/if_media.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/kernel.h>
+#include <sys/sockio.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/queue.h>
+#include <sys/socket.h>
+#include <sys/syslog.h>
+#include <sys/taskqueue.h>
+
+#include <sys/module.h>
+#include <sys/bus.h>
+
+#include <machine/bus.h>
+#include <machine/resource.h>
+#include <sys/rman.h>
+
+#include <net/ethernet.h>
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <net/if_dl.h>
+#include <net/if_types.h>
+#include <net/if_mib.h>
+#include <net/if_media.h>
#ifdef INET
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/ip.h>
#endif
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/bpfdesc.h>
+#include <net/bpf.h>
+#include <net/bpfdesc.h>
-#include <freebsd/dev/smc/if_smcreg.h>
-#include <freebsd/dev/smc/if_smcvar.h>
+#include <dev/smc/if_smcreg.h>
+#include <dev/smc/if_smcvar.h>
-#include <freebsd/dev/mii/mii.h>
-#include <freebsd/dev/mii/miivar.h>
+#include <dev/mii/mii.h>
+#include <dev/mii/miivar.h>
#define SMC_LOCK(sc) mtx_lock(&(sc)->smc_mtx)
#define SMC_UNLOCK(sc) mtx_unlock(&(sc)->smc_mtx)
diff --git a/freebsd/sys/dev/smc/if_smcreg.h b/freebsd/sys/dev/smc/if_smcreg.h
index 50af8077..4b939076 100644
--- a/freebsd/sys/dev/smc/if_smcreg.h
+++ b/freebsd/sys/dev/smc/if_smcreg.h
@@ -25,8 +25,8 @@
*
*/
-#ifndef _IF_SMCREG_HH_
-#define _IF_SMCREG_HH_
+#ifndef _IF_SMCREG_H_
+#define _IF_SMCREG_H_
/* All Banks, Offset 0xe: Bank Select Register */
#define BSR 0xe
@@ -258,4 +258,4 @@
/* Number of times to spin on TX allocations */
#define TX_ALLOC_WAIT_TIME 1000
-#endif /* IF_SMCREG_HH_ */
+#endif /* IF_SMCREG_H_ */
diff --git a/freebsd/sys/dev/smc/if_smcvar.h b/freebsd/sys/dev/smc/if_smcvar.h
index a9e4a668..fd42edbb 100644
--- a/freebsd/sys/dev/smc/if_smcvar.h
+++ b/freebsd/sys/dev/smc/if_smcvar.h
@@ -25,8 +25,8 @@
*
*/
-#ifndef _IF_SMCVAR_HH_
-#define _IF_SMCVAR_HH_
+#ifndef _IF_SMCVAR_H_
+#define _IF_SMCVAR_H_
struct smc_softc {
struct ifnet *smc_ifp;
@@ -74,4 +74,4 @@ int smc_miibus_readreg(device_t, int, int);
int smc_miibus_writereg(device_t, int, int, int);
void smc_miibus_statchg(device_t);
-#endif /* _IF_SMCVAR_HH_ */
+#endif /* _IF_SMCVAR_H_ */
diff --git a/freebsd/sys/dev/usb/controller/ehci.c b/freebsd/sys/dev/usb/controller/ehci.c
index 39221b7a..8a98f608 100644
--- a/freebsd/sys/dev/usb/controller/ehci.c
+++ b/freebsd/sys/dev/usb/controller/ehci.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
@@ -45,47 +45,47 @@
* 1) command failures are not recovered correctly
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
#define USB_DEBUG_VAR ehcidebug
-#include <freebsd/dev/usb/usb_core.h>
-#include <freebsd/dev/usb/usb_debug.h>
-#include <freebsd/dev/usb/usb_busdma.h>
-#include <freebsd/dev/usb/usb_process.h>
-#include <freebsd/dev/usb/usb_transfer.h>
-#include <freebsd/dev/usb/usb_device.h>
-#include <freebsd/dev/usb/usb_hub.h>
-#include <freebsd/dev/usb/usb_util.h>
-
-#include <freebsd/dev/usb/usb_controller.h>
-#include <freebsd/dev/usb/usb_bus.h>
-#include <freebsd/dev/usb/controller/ehci.h>
-#include <freebsd/dev/usb/controller/ehcireg.h>
+#include <dev/usb/usb_core.h>
+#include <dev/usb/usb_debug.h>
+#include <dev/usb/usb_busdma.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usb_transfer.h>
+#include <dev/usb/usb_device.h>
+#include <dev/usb/usb_hub.h>
+#include <dev/usb/usb_util.h>
+
+#include <dev/usb/usb_controller.h>
+#include <dev/usb/usb_bus.h>
+#include <dev/usb/controller/ehci.h>
+#include <dev/usb/controller/ehcireg.h>
#define EHCI_BUS2SC(bus) \
((ehci_softc_t *)(((uint8_t *)(bus)) - \
diff --git a/freebsd/sys/dev/usb/controller/ehci.h b/freebsd/sys/dev/usb/controller/ehci.h
index 26ba336e..19d32426 100644
--- a/freebsd/sys/dev/usb/controller/ehci.h
+++ b/freebsd/sys/dev/usb/controller/ehci.h
@@ -35,8 +35,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef _EHCI_HH_
-#define _EHCI_HH_
+#ifndef _EHCI_H_
+#define _EHCI_H_
#define EHCI_MAX_DEVICES MIN(USB_MAX_DEVICES, 128)
@@ -483,4 +483,4 @@ void ehci_resume(struct ehci_softc *sc);
void ehci_shutdown(ehci_softc_t *sc);
void ehci_interrupt(ehci_softc_t *sc);
-#endif /* _EHCI_HH_ */
+#endif /* _EHCI_H_ */
diff --git a/freebsd/sys/dev/usb/controller/ehcireg.h b/freebsd/sys/dev/usb/controller/ehcireg.h
index 7677dfad..1f5fc5c0 100644
--- a/freebsd/sys/dev/usb/controller/ehcireg.h
+++ b/freebsd/sys/dev/usb/controller/ehcireg.h
@@ -28,8 +28,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef _EHCIREG_HH_
-#define _EHCIREG_HH_
+#ifndef _EHCIREG_H_
+#define _EHCIREG_H_
/* PCI config registers */
#define PCI_CBMEM 0x10 /* configuration base MEM */
@@ -168,4 +168,4 @@
#define EHCI_PORT_RESET_COMPLETE 2 /* ms */
-#endif /* _EHCIREG_HH_ */
+#endif /* _EHCIREG_H_ */
diff --git a/freebsd/sys/dev/usb/controller/ohci.c b/freebsd/sys/dev/usb/controller/ohci.c
index 28261d80..6390156a 100644
--- a/freebsd/sys/dev/usb/controller/ohci.c
+++ b/freebsd/sys/dev/usb/controller/ohci.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -37,44 +37,44 @@ __FBSDID("$FreeBSD$");
* USB spec: http://www.usb.org/developers/docs/usbspec.zip
*/
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
#define USB_DEBUG_VAR ohcidebug
-#include <freebsd/dev/usb/usb_core.h>
-#include <freebsd/dev/usb/usb_debug.h>
-#include <freebsd/dev/usb/usb_busdma.h>
-#include <freebsd/dev/usb/usb_process.h>
-#include <freebsd/dev/usb/usb_transfer.h>
-#include <freebsd/dev/usb/usb_device.h>
-#include <freebsd/dev/usb/usb_hub.h>
-#include <freebsd/dev/usb/usb_util.h>
-
-#include <freebsd/dev/usb/usb_controller.h>
-#include <freebsd/dev/usb/usb_bus.h>
-#include <freebsd/dev/usb/controller/ohci.h>
-#include <freebsd/dev/usb/controller/ohcireg.h>
+#include <dev/usb/usb_core.h>
+#include <dev/usb/usb_debug.h>
+#include <dev/usb/usb_busdma.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usb_transfer.h>
+#include <dev/usb/usb_device.h>
+#include <dev/usb/usb_hub.h>
+#include <dev/usb/usb_util.h>
+
+#include <dev/usb/usb_controller.h>
+#include <dev/usb/usb_bus.h>
+#include <dev/usb/controller/ohci.h>
+#include <dev/usb/controller/ohcireg.h>
#define OHCI_BUS2SC(bus) \
((ohci_softc_t *)(((uint8_t *)(bus)) - \
diff --git a/freebsd/sys/dev/usb/controller/ohci.h b/freebsd/sys/dev/usb/controller/ohci.h
index 1affa420..c878af07 100644
--- a/freebsd/sys/dev/usb/controller/ohci.h
+++ b/freebsd/sys/dev/usb/controller/ohci.h
@@ -36,8 +36,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef _OHCI_HH_
-#define _OHCI_HH_
+#ifndef _OHCI_H_
+#define _OHCI_H_
#define OHCI_MAX_DEVICES MIN(USB_MAX_DEVICES, 128)
@@ -273,4 +273,4 @@ void ohci_suspend(ohci_softc_t *sc);
void ohci_resume(ohci_softc_t *sc);
void ohci_interrupt(ohci_softc_t *sc);
-#endif /* _OHCI_HH_ */
+#endif /* _OHCI_H_ */
diff --git a/freebsd/sys/dev/usb/controller/ohcireg.h b/freebsd/sys/dev/usb/controller/ohcireg.h
index b3acb69b..9127a02a 100644
--- a/freebsd/sys/dev/usb/controller/ohcireg.h
+++ b/freebsd/sys/dev/usb/controller/ohcireg.h
@@ -36,8 +36,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef _OHCIREG_HH_
-#define _OHCIREG_HH_
+#ifndef _OHCIREG_H_
+#define _OHCIREG_H_
/* PCI config registers */
#define PCI_CBMEM 0x10 /* configuration base memory */
@@ -128,4 +128,4 @@
#define OHCI_FSMPS(i) (((i-210)*6/7) << 16)
#define OHCI_PERIODIC(i) ((i)*9/10)
-#endif /* _OHCIREG_HH_ */
+#endif /* _OHCIREG_H_ */
diff --git a/freebsd/sys/dev/usb/controller/usb_controller.c b/freebsd/sys/dev/usb/controller/usb_controller.c
index ee37c265..f4220daf 100644
--- a/freebsd/sys/dev/usb/controller/usb_controller.c
+++ b/freebsd/sys/dev/usb/controller/usb_controller.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/*-
@@ -26,43 +26,43 @@
* SUCH DAMAGE.
*/
-#include <freebsd/local/opt_ddb.h>
-
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
+#include <rtems/bsd/local/opt_ddb.h>
+
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
#define USB_DEBUG_VAR usb_ctrl_debug
-#include <freebsd/dev/usb/usb_core.h>
-#include <freebsd/dev/usb/usb_debug.h>
-#include <freebsd/dev/usb/usb_process.h>
-#include <freebsd/dev/usb/usb_busdma.h>
-#include <freebsd/dev/usb/usb_dynamic.h>
-#include <freebsd/dev/usb/usb_device.h>
-#include <freebsd/dev/usb/usb_hub.h>
+#include <dev/usb/usb_core.h>
+#include <dev/usb/usb_debug.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usb_busdma.h>
+#include <dev/usb/usb_dynamic.h>
+#include <dev/usb/usb_device.h>
+#include <dev/usb/usb_hub.h>
-#include <freebsd/dev/usb/usb_controller.h>
-#include <freebsd/dev/usb/usb_bus.h>
+#include <dev/usb/usb_controller.h>
+#include <dev/usb/usb_bus.h>
/* function prototypes */
diff --git a/freebsd/sys/dev/usb/quirk/usb_quirk.c b/freebsd/sys/dev/usb/quirk/usb_quirk.c
index 8e597dea..6f50452b 100644
--- a/freebsd/sys/dev/usb/quirk/usb_quirk.c
+++ b/freebsd/sys/dev/usb/quirk/usb_quirk.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/*-
@@ -28,36 +28,36 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usb_ioctl.h>
-#include <freebsd/dev/usb/usbdi.h>
-#include <freebsd/local/usbdevs.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usb_ioctl.h>
+#include <dev/usb/usbdi.h>
+#include <rtems/bsd/local/usbdevs.h>
#define USB_DEBUG_VAR usb_debug
-#include <freebsd/dev/usb/usb_debug.h>
-#include <freebsd/dev/usb/usb_dynamic.h>
+#include <dev/usb/usb_debug.h>
+#include <dev/usb/usb_dynamic.h>
-#include <freebsd/dev/usb/quirk/usb_quirk.h>
+#include <dev/usb/quirk/usb_quirk.h>
MODULE_DEPEND(usb_quirk, usb, 1, 1, 1);
MODULE_VERSION(usb_quirk, 1);
diff --git a/freebsd/sys/dev/usb/quirk/usb_quirk.h b/freebsd/sys/dev/usb/quirk/usb_quirk.h
index e8cc0dbf..522b15a4 100644
--- a/freebsd/sys/dev/usb/quirk/usb_quirk.h
+++ b/freebsd/sys/dev/usb/quirk/usb_quirk.h
@@ -24,8 +24,8 @@
* SUCH DAMAGE.
*/
-#ifndef _USB_QUIRK_HH_
-#define _USB_QUIRK_HH_
+#ifndef _USB_QUIRK_H_
+#define _USB_QUIRK_H_
enum {
/*
@@ -105,4 +105,4 @@ enum {
uint8_t usb_test_quirk(const struct usb_attach_arg *uaa, uint16_t quirk);
-#endif /* _USB_QUIRK_HH_ */
+#endif /* _USB_QUIRK_H_ */
diff --git a/freebsd/sys/dev/usb/storage/umass.c b/freebsd/sys/dev/usb/storage/umass.c
index b1867dc2..f59062d9 100644
--- a/freebsd/sys/dev/usb/storage/umass.c
+++ b/freebsd/sys/dev/usb/storage/umass.c
@@ -1,6 +1,6 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*-
@@ -104,41 +104,41 @@ __FBSDID("$FreeBSD$");
* umass_cam_cb again to complete the CAM command.
*/
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
-#include <freebsd/dev/usb/usbdi_util.h>
-#include <freebsd/local/usbdevs.h>
-
-#include <freebsd/dev/usb/quirk/usb_quirk.h>
-
-#include <freebsd/cam/cam.h>
-#include <freebsd/cam/cam_ccb.h>
-#include <freebsd/cam/cam_sim.h>
-#include <freebsd/cam/cam_xpt_sim.h>
-#include <freebsd/cam/scsi/scsi_all.h>
-#include <freebsd/cam/scsi/scsi_da.h>
-
-#include <freebsd/cam/cam_periph.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+#include <dev/usb/usbdi_util.h>
+#include <rtems/bsd/local/usbdevs.h>
+
+#include <dev/usb/quirk/usb_quirk.h>
+
+#include <cam/cam.h>
+#include <cam/cam_ccb.h>
+#include <cam/cam_sim.h>
+#include <cam/cam_xpt_sim.h>
+#include <cam/scsi/scsi_all.h>
+#include <cam/scsi/scsi_da.h>
+
+#include <cam/cam_periph.h>
#define UMASS_EXT_BUFFER
#ifdef UMASS_EXT_BUFFER
diff --git a/freebsd/sys/dev/usb/ufm_ioctl.h b/freebsd/sys/dev/usb/ufm_ioctl.h
index 20a0b96e..921b3d4f 100644
--- a/freebsd/sys/dev/usb/ufm_ioctl.h
+++ b/freebsd/sys/dev/usb/ufm_ioctl.h
@@ -30,7 +30,7 @@
/* $FreeBSD$ */
-#include <freebsd/sys/ioccom.h>
+#include <sys/ioccom.h>
#define FM_SET_FREQ _IOWR('U', 200, int)
#define FM_GET_FREQ _IOWR('U', 201, int)
diff --git a/freebsd/sys/dev/usb/usb.h b/freebsd/sys/dev/usb/usb.h
index 9a6cb8f7..433a0471 100644
--- a/freebsd/sys/dev/usb/usb.h
+++ b/freebsd/sys/dev/usb/usb.h
@@ -36,26 +36,26 @@
* USB v3.0
*/
-#ifndef _USB_STANDARD_HH_
-#define _USB_STANDARD_HH_
+#ifndef _USB_STANDARD_H_
+#define _USB_STANDARD_H_
#if defined(_KERNEL)
-#include <freebsd/local/opt_usb.h>
+#include <rtems/bsd/local/opt_usb.h>
/* Declare parent SYSCTL USB node. */
#ifdef SYSCTL_DECL
SYSCTL_DECL(_hw_usb);
#endif
-#include <freebsd/sys/malloc.h>
+#include <sys/malloc.h>
MALLOC_DECLARE(M_USB);
MALLOC_DECLARE(M_USBDEV);
MALLOC_DECLARE(M_USBHC);
#endif /* _KERNEL */
-#include <freebsd/dev/usb/usb_endian.h>
-#include <freebsd/dev/usb/usb_freebsd.h>
+#include <dev/usb/usb_endian.h>
+#include <dev/usb/usb_freebsd.h>
#define USB_STACK_VERSION 2000 /* 2.0 */
@@ -752,4 +752,4 @@ enum usb_dev_state {
USB_STATE_CONFIGURED,
};
#define USB_STATE_MAX (USB_STATE_CONFIGURED+1)
-#endif /* _USB_STANDARD_HH_ */
+#endif /* _USB_STANDARD_H_ */
diff --git a/freebsd/sys/dev/usb/usb_bus.h b/freebsd/sys/dev/usb/usb_bus.h
index b437fac0..c9840fcb 100644
--- a/freebsd/sys/dev/usb/usb_bus.h
+++ b/freebsd/sys/dev/usb/usb_bus.h
@@ -24,8 +24,8 @@
* SUCH DAMAGE.
*/
-#ifndef _USB_BUS_HH_
-#define _USB_BUS_HH_
+#ifndef _USB_BUS_H_
+#define _USB_BUS_H_
/*
* The following structure defines the USB explore message sent to the USB
@@ -111,4 +111,4 @@ struct usb_bus {
} scratch[1];
};
-#endif /* _USB_BUS_HH_ */
+#endif /* _USB_BUS_H_ */
diff --git a/freebsd/sys/dev/usb/usb_busdma.c b/freebsd/sys/dev/usb/usb_busdma.c
index 979136b8..e08bcbd3 100644
--- a/freebsd/sys/dev/usb/usb_busdma.c
+++ b/freebsd/sys/dev/usb/usb_busdma.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/*-
@@ -26,42 +26,42 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
-#include <freebsd/dev/usb/usbdi_util.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+#include <dev/usb/usbdi_util.h>
#define USB_DEBUG_VAR usb_debug
-#include <freebsd/dev/usb/usb_core.h>
-#include <freebsd/dev/usb/usb_busdma.h>
-#include <freebsd/dev/usb/usb_process.h>
-#include <freebsd/dev/usb/usb_transfer.h>
-#include <freebsd/dev/usb/usb_device.h>
-#include <freebsd/dev/usb/usb_util.h>
-#include <freebsd/dev/usb/usb_debug.h>
+#include <dev/usb/usb_core.h>
+#include <dev/usb/usb_busdma.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usb_transfer.h>
+#include <dev/usb/usb_device.h>
+#include <dev/usb/usb_util.h>
+#include <dev/usb/usb_debug.h>
-#include <freebsd/dev/usb/usb_controller.h>
-#include <freebsd/dev/usb/usb_bus.h>
+#include <dev/usb/usb_controller.h>
+#include <dev/usb/usb_bus.h>
#if USB_HAVE_BUSDMA
static void usb_dma_tag_create(struct usb_dma_tag *, usb_size_t, usb_size_t);
diff --git a/freebsd/sys/dev/usb/usb_busdma.h b/freebsd/sys/dev/usb/usb_busdma.h
index bd761819..6b6e4039 100644
--- a/freebsd/sys/dev/usb/usb_busdma.h
+++ b/freebsd/sys/dev/usb/usb_busdma.h
@@ -24,13 +24,13 @@
* SUCH DAMAGE.
*/
-#ifndef _USB_BUSDMA_HH_
-#define _USB_BUSDMA_HH_
+#ifndef _USB_BUSDMA_H_
+#define _USB_BUSDMA_H_
-#include <freebsd/sys/uio.h>
-#include <freebsd/sys/mbuf.h>
+#include <sys/uio.h>
+#include <sys/mbuf.h>
-#include <freebsd/machine/bus.h>
+#include <machine/bus.h>
/* defines */
@@ -158,4 +158,4 @@ void usb_pc_cpu_invalidate(struct usb_page_cache *pc);
void usb_pc_dmamap_destroy(struct usb_page_cache *pc);
void usb_pc_free_mem(struct usb_page_cache *pc);
-#endif /* _USB_BUSDMA_HH_ */
+#endif /* _USB_BUSDMA_H_ */
diff --git a/freebsd/sys/dev/usb/usb_cdc.h b/freebsd/sys/dev/usb/usb_cdc.h
index 632cfe9c..23fd111c 100644
--- a/freebsd/sys/dev/usb/usb_cdc.h
+++ b/freebsd/sys/dev/usb/usb_cdc.h
@@ -38,8 +38,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef _USB_CDC_HH_
-#define _USB_CDC_HH_
+#ifndef _USB_CDC_H_
+#define _USB_CDC_H_
#define UDESCSUB_CDC_HEADER 0
#define UDESCSUB_CDC_CM 1 /* Call Management */
@@ -292,4 +292,4 @@ struct usb_ncm_parameters {
#define UCDC_NCM_NOTIF_RESPONSE_AVAILABLE 0x01
#define UCDC_NCM_NOTIF_CONNECTION_SPEED_CHANGE 0x2A
-#endif /* _USB_CDC_HH_ */
+#endif /* _USB_CDC_H_ */
diff --git a/freebsd/sys/dev/usb/usb_controller.h b/freebsd/sys/dev/usb/usb_controller.h
index 8f3f3de4..6b15dab9 100644
--- a/freebsd/sys/dev/usb/usb_controller.h
+++ b/freebsd/sys/dev/usb/usb_controller.h
@@ -24,8 +24,8 @@
* SUCH DAMAGE.
*/
-#ifndef _USB_CONTROLLER_HH_
-#define _USB_CONTROLLER_HH_
+#ifndef _USB_CONTROLLER_H_
+#define _USB_CONTROLLER_H_
/* defines */
@@ -222,4 +222,4 @@ uint16_t usb_isoc_time_expand(struct usb_bus *bus, uint16_t isoc_time_curr);
uint16_t usbd_fs_isoc_schedule_isoc_time_expand(struct usb_device *udev, struct usb_fs_isoc_schedule **pp_start, struct usb_fs_isoc_schedule **pp_end, uint16_t isoc_time);
uint8_t usbd_fs_isoc_schedule_alloc(struct usb_fs_isoc_schedule *fss, uint8_t *pstart, uint16_t len);
-#endif /* _USB_CONTROLLER_HH_ */
+#endif /* _USB_CONTROLLER_H_ */
diff --git a/freebsd/sys/dev/usb/usb_core.c b/freebsd/sys/dev/usb/usb_core.c
index 17f9d903..38504363 100644
--- a/freebsd/sys/dev/usb/usb_core.c
+++ b/freebsd/sys/dev/usb/usb_core.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/*-
@@ -32,28 +32,28 @@
* http://www.usb.org/developers/devclass_docs/
*/
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
MALLOC_DEFINE(M_USB, "USB", "USB");
MALLOC_DEFINE(M_USBDEV, "USBdev", "USB device");
diff --git a/freebsd/sys/dev/usb/usb_core.h b/freebsd/sys/dev/usb/usb_core.h
index 9d724171..3dfd0d1a 100644
--- a/freebsd/sys/dev/usb/usb_core.h
+++ b/freebsd/sys/dev/usb/usb_core.h
@@ -28,8 +28,8 @@
* Including this file is mandatory for all USB related c-files in the kernel.
*/
-#ifndef _USB_CORE_HH_
-#define _USB_CORE_HH_
+#ifndef _USB_CORE_H_
+#define _USB_CORE_H_
/*
* The following macro will tell if an USB transfer is currently
@@ -180,4 +180,4 @@ typedef struct malloc_type *usb_malloc_type;
/* prototypes */
-#endif /* _USB_CORE_HH_ */
+#endif /* _USB_CORE_H_ */
diff --git a/freebsd/sys/dev/usb/usb_debug.c b/freebsd/sys/dev/usb/usb_debug.c
index 907d31e1..40dafa20 100644
--- a/freebsd/sys/dev/usb/usb_debug.c
+++ b/freebsd/sys/dev/usb/usb_debug.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/*-
@@ -26,38 +26,38 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
-
-#include <freebsd/dev/usb/usb_core.h>
-#include <freebsd/dev/usb/usb_debug.h>
-#include <freebsd/dev/usb/usb_process.h>
-#include <freebsd/dev/usb/usb_device.h>
-#include <freebsd/dev/usb/usb_busdma.h>
-#include <freebsd/dev/usb/usb_transfer.h>
-
-#include <freebsd/ddb/ddb.h>
-#include <freebsd/ddb/db_sym.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+
+#include <dev/usb/usb_core.h>
+#include <dev/usb/usb_debug.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usb_device.h>
+#include <dev/usb/usb_busdma.h>
+#include <dev/usb/usb_transfer.h>
+
+#include <ddb/ddb.h>
+#include <ddb/db_sym.h>
/*
* Define this unconditionally in case a kernel module is loaded that
diff --git a/freebsd/sys/dev/usb/usb_debug.h b/freebsd/sys/dev/usb/usb_debug.h
index aa3a5a49..8718c89b 100644
--- a/freebsd/sys/dev/usb/usb_debug.h
+++ b/freebsd/sys/dev/usb/usb_debug.h
@@ -26,8 +26,8 @@
/* This file contains various factored out debug macros. */
-#ifndef _USB_DEBUG_HH_
-#define _USB_DEBUG_HH_
+#ifndef _USB_DEBUG_H_
+#define _USB_DEBUG_H_
/* Declare global USB debug variable. */
extern int usb_debug;
@@ -59,4 +59,4 @@ void usb_dump_queue(struct usb_endpoint *ep);
void usb_dump_endpoint(struct usb_endpoint *ep);
void usb_dump_xfer(struct usb_xfer *xfer);
-#endif /* _USB_DEBUG_HH_ */
+#endif /* _USB_DEBUG_H_ */
diff --git a/freebsd/sys/dev/usb/usb_dev.c b/freebsd/sys/dev/usb/usb_dev.c
index 3517f7cc..eaad5952 100644
--- a/freebsd/sys/dev/usb/usb_dev.c
+++ b/freebsd/sys/dev/usb/usb_dev.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/*-
@@ -29,57 +29,57 @@
* usb_dev.c - An abstraction layer for creating devices under /dev/...
*/
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
#ifndef __rtems__
-#include <freebsd/sys/vnode.h>
+#include <sys/vnode.h>
#endif
-#include <freebsd/sys/conf.h>
-#include <freebsd/sys/fcntl.h>
+#include <sys/conf.h>
+#include <sys/fcntl.h>
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usb_ioctl.h>
-#include <freebsd/dev/usb/usbdi.h>
-#include <freebsd/dev/usb/usbdi_util.h>
+#include <dev/usb/usb.h>
+#include <dev/usb/usb_ioctl.h>
+#include <dev/usb/usbdi.h>
+#include <dev/usb/usbdi_util.h>
#define USB_DEBUG_VAR usb_fifo_debug
-#include <freebsd/dev/usb/usb_core.h>
-#include <freebsd/dev/usb/usb_dev.h>
-#include <freebsd/dev/usb/usb_mbuf.h>
-#include <freebsd/dev/usb/usb_process.h>
-#include <freebsd/dev/usb/usb_device.h>
-#include <freebsd/dev/usb/usb_debug.h>
-#include <freebsd/dev/usb/usb_busdma.h>
-#include <freebsd/dev/usb/usb_generic.h>
-#include <freebsd/dev/usb/usb_dynamic.h>
-#include <freebsd/dev/usb/usb_util.h>
-
-#include <freebsd/dev/usb/usb_controller.h>
-#include <freebsd/dev/usb/usb_bus.h>
-
-#include <freebsd/sys/filio.h>
-#include <freebsd/sys/ttycom.h>
-#include <freebsd/sys/syscallsubr.h>
-
-#include <freebsd/machine/stdarg.h>
+#include <dev/usb/usb_core.h>
+#include <dev/usb/usb_dev.h>
+#include <dev/usb/usb_mbuf.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usb_device.h>
+#include <dev/usb/usb_debug.h>
+#include <dev/usb/usb_busdma.h>
+#include <dev/usb/usb_generic.h>
+#include <dev/usb/usb_dynamic.h>
+#include <dev/usb/usb_util.h>
+
+#include <dev/usb/usb_controller.h>
+#include <dev/usb/usb_bus.h>
+
+#include <sys/filio.h>
+#include <sys/ttycom.h>
+#include <sys/syscallsubr.h>
+
+#include <machine/stdarg.h>
#if USB_HAVE_UGEN
diff --git a/freebsd/sys/dev/usb/usb_dev.h b/freebsd/sys/dev/usb/usb_dev.h
index ccf873bd..aa9197f5 100644
--- a/freebsd/sys/dev/usb/usb_dev.h
+++ b/freebsd/sys/dev/usb/usb_dev.h
@@ -24,14 +24,14 @@
* SUCH DAMAGE.
*/
-#ifndef _USB_DEV_HH_
-#define _USB_DEV_HH_
+#ifndef _USB_DEV_H_
+#define _USB_DEV_H_
-#include <freebsd/sys/file.h>
-#include <freebsd/sys/selinfo.h>
-#include <freebsd/sys/poll.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/proc.h>
+#include <sys/file.h>
+#include <sys/selinfo.h>
+#include <sys/poll.h>
+#include <sys/signalvar.h>
+#include <sys/proc.h>
struct usb_fifo;
struct usb_mbuf;
@@ -151,4 +151,4 @@ void usb_free_symlink(struct usb_symlink *ps);
int usb_read_symlink(uint8_t *user_ptr, uint32_t startentry,
uint32_t user_len);
-#endif /* _USB_DEV_HH_ */
+#endif /* _USB_DEV_H_ */
diff --git a/freebsd/sys/dev/usb/usb_device.c b/freebsd/sys/dev/usb/usb_device.c
index 1d5b5182..a2db2727 100644
--- a/freebsd/sys/dev/usb/usb_device.c
+++ b/freebsd/sys/dev/usb/usb_device.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/*-
@@ -26,61 +26,61 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/conf.h>
-#include <freebsd/sys/fcntl.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
-#include <freebsd/dev/usb/usbdi_util.h>
-#include <freebsd/dev/usb/usb_ioctl.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+#include <sys/conf.h>
+#include <sys/fcntl.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+#include <dev/usb/usbdi_util.h>
+#include <dev/usb/usb_ioctl.h>
#if USB_HAVE_UGEN
-#include <freebsd/sys/sbuf.h>
+#include <sys/sbuf.h>
#endif
-#include <freebsd/local/usbdevs.h>
+#include <rtems/bsd/local/usbdevs.h>
#define USB_DEBUG_VAR usb_debug
-#include <freebsd/dev/usb/usb_core.h>
-#include <freebsd/dev/usb/usb_debug.h>
-#include <freebsd/dev/usb/usb_process.h>
-#include <freebsd/dev/usb/usb_device.h>
-#include <freebsd/dev/usb/usb_busdma.h>
-#include <freebsd/dev/usb/usb_transfer.h>
-#include <freebsd/dev/usb/usb_request.h>
-#include <freebsd/dev/usb/usb_dynamic.h>
-#include <freebsd/dev/usb/usb_hub.h>
-#include <freebsd/dev/usb/usb_util.h>
-#include <freebsd/dev/usb/usb_msctest.h>
+#include <dev/usb/usb_core.h>
+#include <dev/usb/usb_debug.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usb_device.h>
+#include <dev/usb/usb_busdma.h>
+#include <dev/usb/usb_transfer.h>
+#include <dev/usb/usb_request.h>
+#include <dev/usb/usb_dynamic.h>
+#include <dev/usb/usb_hub.h>
+#include <dev/usb/usb_util.h>
+#include <dev/usb/usb_msctest.h>
#if USB_HAVE_UGEN
-#include <freebsd/dev/usb/usb_dev.h>
-#include <freebsd/dev/usb/usb_generic.h>
+#include <dev/usb/usb_dev.h>
+#include <dev/usb/usb_generic.h>
#endif
-#include <freebsd/dev/usb/quirk/usb_quirk.h>
+#include <dev/usb/quirk/usb_quirk.h>
-#include <freebsd/dev/usb/usb_controller.h>
-#include <freebsd/dev/usb/usb_bus.h>
+#include <dev/usb/usb_controller.h>
+#include <dev/usb/usb_bus.h>
/* function prototypes */
@@ -2216,8 +2216,8 @@ struct usb_knowndev {
#define USB_KNOWNDEV_NOPROD 0x01 /* match on vendor only */
-#include <freebsd/local/usbdevs.h>
-#include <freebsd/local/usbdevs_data.h>
+#include <rtems/bsd/local/usbdevs.h>
+#include <rtems/bsd/local/usbdevs_data.h>
#endif /* USB_VERBOSE */
static void
diff --git a/freebsd/sys/dev/usb/usb_device.h b/freebsd/sys/dev/usb/usb_device.h
index eb6a3fcb..c8bc5eb9 100644
--- a/freebsd/sys/dev/usb/usb_device.h
+++ b/freebsd/sys/dev/usb/usb_device.h
@@ -24,8 +24,8 @@
* SUCH DAMAGE.
*/
-#ifndef _USB_DEVICE_HH_
-#define _USB_DEVICE_HH_
+#ifndef _USB_DEVICE_H_
+#define _USB_DEVICE_H_
struct usb_symlink; /* UGEN */
struct usb_device; /* linux compat */
@@ -224,4 +224,4 @@ void usbd_sr_lock(struct usb_device *);
void usbd_sr_unlock(struct usb_device *);
uint8_t usbd_enum_is_locked(struct usb_device *);
-#endif /* _USB_DEVICE_HH_ */
+#endif /* _USB_DEVICE_H_ */
diff --git a/freebsd/sys/dev/usb/usb_dynamic.c b/freebsd/sys/dev/usb/usb_dynamic.c
index 7651f97e..cb54d10f 100644
--- a/freebsd/sys/dev/usb/usb_dynamic.c
+++ b/freebsd/sys/dev/usb/usb_dynamic.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/*-
@@ -26,33 +26,33 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
-
-#include <freebsd/dev/usb/usb_core.h>
-#include <freebsd/dev/usb/usb_process.h>
-#include <freebsd/dev/usb/usb_device.h>
-#include <freebsd/dev/usb/usb_dynamic.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+
+#include <dev/usb/usb_core.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usb_device.h>
+#include <dev/usb/usb_dynamic.h>
/* function prototypes */
static usb_handle_req_t usb_temp_get_desc_w;
diff --git a/freebsd/sys/dev/usb/usb_dynamic.h b/freebsd/sys/dev/usb/usb_dynamic.h
index 32fc8362..56849420 100644
--- a/freebsd/sys/dev/usb/usb_dynamic.h
+++ b/freebsd/sys/dev/usb/usb_dynamic.h
@@ -24,8 +24,8 @@
* SUCH DAMAGE.
*/
-#ifndef _USB_DYNAMIC_HH_
-#define _USB_DYNAMIC_HH_
+#ifndef _USB_DYNAMIC_H_
+#define _USB_DYNAMIC_H_
/* prototypes */
@@ -58,4 +58,4 @@ void usb_temp_unload(void *);
void usb_quirk_unload(void *);
void usb_bus_unload(void *);
-#endif /* _USB_DYNAMIC_HH_ */
+#endif /* _USB_DYNAMIC_H_ */
diff --git a/freebsd/sys/dev/usb/usb_endian.h b/freebsd/sys/dev/usb/usb_endian.h
index 54c965d7..29479f13 100644
--- a/freebsd/sys/dev/usb/usb_endian.h
+++ b/freebsd/sys/dev/usb/usb_endian.h
@@ -24,11 +24,11 @@
* SUCH DAMAGE.
*/
-#ifndef _USB_ENDIAN_HH_
-#define _USB_ENDIAN_HH_
+#ifndef _USB_ENDIAN_H_
+#define _USB_ENDIAN_H_
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/endian.h>
+#include <sys/stdint.h>
+#include <sys/endian.h>
/*
* Declare the basic USB record types. USB records have an alignment
@@ -116,4 +116,4 @@ typedef uint8_t uQWord[8];
(w)[7] = (uint8_t)(b7); \
} while (0)
-#endif /* _USB_ENDIAN_HH_ */
+#endif /* _USB_ENDIAN_H_ */
diff --git a/freebsd/sys/dev/usb/usb_error.c b/freebsd/sys/dev/usb/usb_error.c
index b9798a15..4505490d 100644
--- a/freebsd/sys/dev/usb/usb_error.c
+++ b/freebsd/sys/dev/usb/usb_error.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/*-
@@ -26,28 +26,28 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
static const char* usb_errstr_table[USB_ERR_MAX] = {
[USB_ERR_NORMAL_COMPLETION] = "USB_ERR_NORMAL_COMPLETION",
diff --git a/freebsd/sys/dev/usb/usb_freebsd.h b/freebsd/sys/dev/usb/usb_freebsd.h
index ed0f0356..3045ec32 100644
--- a/freebsd/sys/dev/usb/usb_freebsd.h
+++ b/freebsd/sys/dev/usb/usb_freebsd.h
@@ -28,8 +28,8 @@
* Including this file is mandatory for all USB related c-files in the kernel.
*/
-#ifndef _USB_FREEBSD_HH_
-#define _USB_FREEBSD_HH_
+#ifndef _USB_FREEBSD_H_
+#define _USB_FREEBSD_H_
/* Default USB configuration */
#ifndef __rtems__
@@ -66,4 +66,4 @@ typedef uint32_t usb_size_t; /* bytes */
typedef uint32_t usb_ticks_t; /* system defined */
typedef uint16_t usb_power_mask_t; /* see "USB_HW_POWER_XXX" */
-#endif /* _USB_FREEBSD_HH_ */
+#endif /* _USB_FREEBSD_H_ */
diff --git a/freebsd/sys/dev/usb/usb_generic.c b/freebsd/sys/dev/usb/usb_generic.c
index 89217a93..60b24794 100644
--- a/freebsd/sys/dev/usb/usb_generic.c
+++ b/freebsd/sys/dev/usb/usb_generic.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/*-
@@ -26,50 +26,50 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/conf.h>
-#include <freebsd/sys/fcntl.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usb_ioctl.h>
-#include <freebsd/dev/usb/usbdi.h>
-#include <freebsd/dev/usb/usbdi_util.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+#include <sys/conf.h>
+#include <sys/fcntl.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usb_ioctl.h>
+#include <dev/usb/usbdi.h>
+#include <dev/usb/usbdi_util.h>
#define USB_DEBUG_VAR ugen_debug
-#include <freebsd/dev/usb/usb_core.h>
-#include <freebsd/dev/usb/usb_dev.h>
-#include <freebsd/dev/usb/usb_mbuf.h>
-#include <freebsd/dev/usb/usb_process.h>
-#include <freebsd/dev/usb/usb_device.h>
-#include <freebsd/dev/usb/usb_debug.h>
-#include <freebsd/dev/usb/usb_request.h>
-#include <freebsd/dev/usb/usb_busdma.h>
-#include <freebsd/dev/usb/usb_util.h>
-#include <freebsd/dev/usb/usb_hub.h>
-#include <freebsd/dev/usb/usb_generic.h>
-#include <freebsd/dev/usb/usb_transfer.h>
-
-#include <freebsd/dev/usb/usb_controller.h>
-#include <freebsd/dev/usb/usb_bus.h>
+#include <dev/usb/usb_core.h>
+#include <dev/usb/usb_dev.h>
+#include <dev/usb/usb_mbuf.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usb_device.h>
+#include <dev/usb/usb_debug.h>
+#include <dev/usb/usb_request.h>
+#include <dev/usb/usb_busdma.h>
+#include <dev/usb/usb_util.h>
+#include <dev/usb/usb_hub.h>
+#include <dev/usb/usb_generic.h>
+#include <dev/usb/usb_transfer.h>
+
+#include <dev/usb/usb_controller.h>
+#include <dev/usb/usb_bus.h>
#if USB_HAVE_UGEN
diff --git a/freebsd/sys/dev/usb/usb_generic.h b/freebsd/sys/dev/usb/usb_generic.h
index 17506001..835ec72a 100644
--- a/freebsd/sys/dev/usb/usb_generic.h
+++ b/freebsd/sys/dev/usb/usb_generic.h
@@ -24,10 +24,10 @@
* SUCH DAMAGE.
*/
-#ifndef _USB_GENERIC_HH_
-#define _USB_GENERIC_HH_
+#ifndef _USB_GENERIC_H_
+#define _USB_GENERIC_H_
extern struct usb_fifo_methods usb_ugen_methods;
int ugen_do_request(struct usb_fifo *f, struct usb_ctl_request *ur);
-#endif /* _USB_GENERIC_HH_ */
+#endif /* _USB_GENERIC_H_ */
diff --git a/freebsd/sys/dev/usb/usb_handle_request.c b/freebsd/sys/dev/usb/usb_handle_request.c
index 40428d8b..97d30394 100644
--- a/freebsd/sys/dev/usb/usb_handle_request.c
+++ b/freebsd/sys/dev/usb/usb_handle_request.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/*-
@@ -26,44 +26,44 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
-#include <freebsd/dev/usb/usbdi_util.h>
-#include <freebsd/local/usb_if.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+#include <dev/usb/usbdi_util.h>
+#include <rtems/bsd/local/usb_if.h>
#define USB_DEBUG_VAR usb_debug
-#include <freebsd/dev/usb/usb_core.h>
-#include <freebsd/dev/usb/usb_process.h>
-#include <freebsd/dev/usb/usb_busdma.h>
-#include <freebsd/dev/usb/usb_transfer.h>
-#include <freebsd/dev/usb/usb_device.h>
-#include <freebsd/dev/usb/usb_debug.h>
-#include <freebsd/dev/usb/usb_dynamic.h>
-#include <freebsd/dev/usb/usb_hub.h>
-
-#include <freebsd/dev/usb/usb_controller.h>
-#include <freebsd/dev/usb/usb_bus.h>
+#include <dev/usb/usb_core.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usb_busdma.h>
+#include <dev/usb/usb_transfer.h>
+#include <dev/usb/usb_device.h>
+#include <dev/usb/usb_debug.h>
+#include <dev/usb/usb_dynamic.h>
+#include <dev/usb/usb_hub.h>
+
+#include <dev/usb/usb_controller.h>
+#include <dev/usb/usb_bus.h>
/* function prototypes */
diff --git a/freebsd/sys/dev/usb/usb_hid.c b/freebsd/sys/dev/usb/usb_hid.c
index b1780aff..e99cdb0b 100644
--- a/freebsd/sys/dev/usb/usb_hid.c
+++ b/freebsd/sys/dev/usb/usb_hid.c
@@ -1,9 +1,9 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $NetBSD: hid.c,v 1.17 2001/11/13 06:24:53 lukem Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -42,38 +42,38 @@ __FBSDID("$FreeBSD$");
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
-#include <freebsd/dev/usb/usbdi_util.h>
-#include <freebsd/dev/usb/usbhid.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+#include <dev/usb/usbdi_util.h>
+#include <dev/usb/usbhid.h>
#define USB_DEBUG_VAR usb_debug
-#include <freebsd/dev/usb/usb_core.h>
-#include <freebsd/dev/usb/usb_debug.h>
-#include <freebsd/dev/usb/usb_process.h>
-#include <freebsd/dev/usb/usb_device.h>
-#include <freebsd/dev/usb/usb_request.h>
+#include <dev/usb/usb_core.h>
+#include <dev/usb/usb_debug.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usb_device.h>
+#include <dev/usb/usb_request.h>
static void hid_clear_local(struct hid_item *);
static uint8_t hid_get_byte(struct hid_data *s, const uint16_t wSize);
diff --git a/freebsd/sys/dev/usb/usb_hub.c b/freebsd/sys/dev/usb/usb_hub.c
index 4f34f25e..c20bde30 100644
--- a/freebsd/sys/dev/usb/usb_hub.c
+++ b/freebsd/sys/dev/usb/usb_hub.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/*-
@@ -32,46 +32,46 @@
* USB spec: http://www.usb.org/developers/docs/usbspec.zip
*/
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usb_ioctl.h>
-#include <freebsd/dev/usb/usbdi.h>
-#include <freebsd/dev/usb/usbdi_util.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usb_ioctl.h>
+#include <dev/usb/usbdi.h>
+#include <dev/usb/usbdi_util.h>
#define USB_DEBUG_VAR uhub_debug
-#include <freebsd/dev/usb/usb_core.h>
-#include <freebsd/dev/usb/usb_process.h>
-#include <freebsd/dev/usb/usb_device.h>
-#include <freebsd/dev/usb/usb_request.h>
-#include <freebsd/dev/usb/usb_debug.h>
-#include <freebsd/dev/usb/usb_hub.h>
-#include <freebsd/dev/usb/usb_util.h>
-#include <freebsd/dev/usb/usb_busdma.h>
-#include <freebsd/dev/usb/usb_transfer.h>
-#include <freebsd/dev/usb/usb_dynamic.h>
-
-#include <freebsd/dev/usb/usb_controller.h>
-#include <freebsd/dev/usb/usb_bus.h>
+#include <dev/usb/usb_core.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usb_device.h>
+#include <dev/usb/usb_request.h>
+#include <dev/usb/usb_debug.h>
+#include <dev/usb/usb_hub.h>
+#include <dev/usb/usb_util.h>
+#include <dev/usb/usb_busdma.h>
+#include <dev/usb/usb_transfer.h>
+#include <dev/usb/usb_dynamic.h>
+
+#include <dev/usb/usb_controller.h>
+#include <dev/usb/usb_bus.h>
#define UHUB_INTR_INTERVAL 250 /* ms */
#define UHUB_N_TRANSFER 1
diff --git a/freebsd/sys/dev/usb/usb_hub.h b/freebsd/sys/dev/usb/usb_hub.h
index 6f4637da..0f595997 100644
--- a/freebsd/sys/dev/usb/usb_hub.h
+++ b/freebsd/sys/dev/usb/usb_hub.h
@@ -24,8 +24,8 @@
* SUCH DAMAGE.
*/
-#ifndef _USB_HUB_HH_
-#define _USB_HUB_HH_
+#ifndef _USB_HUB_H_
+#define _USB_HUB_H_
/*
* The following structure defines an USB port.
@@ -80,4 +80,4 @@ void usb_bus_powerd(struct usb_bus *bus);
void uhub_root_intr(struct usb_bus *, const uint8_t *, uint8_t);
usb_error_t uhub_query_info(struct usb_device *, uint8_t *, uint8_t *);
-#endif /* _USB_HUB_HH_ */
+#endif /* _USB_HUB_H_ */
diff --git a/freebsd/sys/dev/usb/usb_ioctl.h b/freebsd/sys/dev/usb/usb_ioctl.h
index 99e21f09..f9018e28 100644
--- a/freebsd/sys/dev/usb/usb_ioctl.h
+++ b/freebsd/sys/dev/usb/usb_ioctl.h
@@ -26,15 +26,15 @@
* SUCH DAMAGE.
*/
-#ifndef _USB_IOCTL_HH_
-#define _USB_IOCTL_HH_
+#ifndef _USB_IOCTL_H_
+#define _USB_IOCTL_H_
-#include <freebsd/sys/ioccom.h>
+#include <sys/ioccom.h>
/* Building "kdump" depends on these includes */
-#include <freebsd/dev/usb/usb_endian.h>
-#include <freebsd/dev/usb/usb.h>
+#include <dev/usb/usb_endian.h>
+#include <dev/usb/usb.h>
#define USB_DEVICE_NAME "usbctl"
#define USB_DEVICE_DIR "usb"
@@ -269,4 +269,4 @@ struct usb_gen_quirk {
#define USB_DEV_QUIRK_ADD _IOW ('Q', 2, struct usb_gen_quirk)
#define USB_DEV_QUIRK_REMOVE _IOW ('Q', 3, struct usb_gen_quirk)
-#endif /* _USB_IOCTL_HH_ */
+#endif /* _USB_IOCTL_H_ */
diff --git a/freebsd/sys/dev/usb/usb_lookup.c b/freebsd/sys/dev/usb/usb_lookup.c
index c730b6ba..b7ce2522 100644
--- a/freebsd/sys/dev/usb/usb_lookup.c
+++ b/freebsd/sys/dev/usb/usb_lookup.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/*-
@@ -26,28 +26,28 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
/*------------------------------------------------------------------------*
* usbd_lookup_id_by_info
diff --git a/freebsd/sys/dev/usb/usb_mbuf.c b/freebsd/sys/dev/usb/usb_mbuf.c
index 5aa99df4..f2649679 100644
--- a/freebsd/sys/dev/usb/usb_mbuf.c
+++ b/freebsd/sys/dev/usb/usb_mbuf.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/*-
@@ -26,30 +26,30 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
-#include <freebsd/dev/usb/usb_dev.h>
-#include <freebsd/dev/usb/usb_mbuf.h>
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+#include <dev/usb/usb_dev.h>
+#include <dev/usb/usb_mbuf.h>
/*------------------------------------------------------------------------*
* usb_alloc_mbufs - allocate mbufs to an usbd interface queue
diff --git a/freebsd/sys/dev/usb/usb_mbuf.h b/freebsd/sys/dev/usb/usb_mbuf.h
index 44dba71b..3b331ffc 100644
--- a/freebsd/sys/dev/usb/usb_mbuf.h
+++ b/freebsd/sys/dev/usb/usb_mbuf.h
@@ -24,8 +24,8 @@
* SUCH DAMAGE.
*/
-#ifndef _USB_MBUF_HH_
-#define _USB_MBUF_HH_
+#ifndef _USB_MBUF_H_
+#define _USB_MBUF_H_
/*
* The following structure defines a minimum re-implementation of the
@@ -87,4 +87,4 @@ struct usb_mbuf {
void *usb_alloc_mbufs(struct malloc_type *type, struct usb_ifqueue *ifq,
usb_size_t block_size, uint16_t nblocks);
-#endif /* _USB_MBUF_HH_ */
+#endif /* _USB_MBUF_H_ */
diff --git a/freebsd/sys/dev/usb/usb_msctest.c b/freebsd/sys/dev/usb/usb_msctest.c
index 0b773e29..77f199be 100644
--- a/freebsd/sys/dev/usb/usb_msctest.c
+++ b/freebsd/sys/dev/usb/usb_msctest.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/*-
@@ -34,42 +34,42 @@
* mass storage quirks for not supported SCSI commands!
*/
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
-#include <freebsd/dev/usb/usbdi_util.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+#include <dev/usb/usbdi_util.h>
#define USB_DEBUG_VAR usb_debug
-#include <freebsd/dev/usb/usb_busdma.h>
-#include <freebsd/dev/usb/usb_process.h>
-#include <freebsd/dev/usb/usb_transfer.h>
-#include <freebsd/dev/usb/usb_msctest.h>
-#include <freebsd/dev/usb/usb_debug.h>
-#include <freebsd/dev/usb/usb_busdma.h>
-#include <freebsd/dev/usb/usb_device.h>
-#include <freebsd/dev/usb/usb_request.h>
-#include <freebsd/dev/usb/usb_util.h>
-#include <freebsd/dev/usb/quirk/usb_quirk.h>
+#include <dev/usb/usb_busdma.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usb_transfer.h>
+#include <dev/usb/usb_msctest.h>
+#include <dev/usb/usb_debug.h>
+#include <dev/usb/usb_busdma.h>
+#include <dev/usb/usb_device.h>
+#include <dev/usb/usb_request.h>
+#include <dev/usb/usb_util.h>
+#include <dev/usb/quirk/usb_quirk.h>
enum {
ST_COMMAND,
diff --git a/freebsd/sys/dev/usb/usb_msctest.h b/freebsd/sys/dev/usb/usb_msctest.h
index 6ba2c3fd..807d5f5d 100644
--- a/freebsd/sys/dev/usb/usb_msctest.h
+++ b/freebsd/sys/dev/usb/usb_msctest.h
@@ -24,8 +24,8 @@
* SUCH DAMAGE.
*/
-#ifndef _USB_MSCTEST_HH_
-#define _USB_MSCTEST_HH_
+#ifndef _USB_MSCTEST_H_
+#define _USB_MSCTEST_H_
enum {
MSC_EJECT_STOPUNIT,
@@ -41,4 +41,4 @@ int usb_iface_is_cdrom(struct usb_device *udev,
usb_error_t usb_msc_eject(struct usb_device *udev,
uint8_t iface_index, int method);
-#endif /* _USB_MSCTEST_HH_ */
+#endif /* _USB_MSCTEST_H_ */
diff --git a/freebsd/sys/dev/usb/usb_parse.c b/freebsd/sys/dev/usb/usb_parse.c
index 8681a94a..6b055db7 100644
--- a/freebsd/sys/dev/usb/usb_parse.c
+++ b/freebsd/sys/dev/usb/usb_parse.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/*-
@@ -26,29 +26,29 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
-#include <freebsd/dev/usb/usbdi_util.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+#include <dev/usb/usbdi_util.h>
/*------------------------------------------------------------------------*
diff --git a/freebsd/sys/dev/usb/usb_process.c b/freebsd/sys/dev/usb/usb_process.c
index cfaa5ee6..67ddf693 100644
--- a/freebsd/sys/dev/usb/usb_process.c
+++ b/freebsd/sys/dev/usb/usb_process.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/*-
@@ -28,36 +28,36 @@
#define USB_DEBUG_VAR usb_proc_debug
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
-#include <freebsd/dev/usb/usbdi_util.h>
-#include <freebsd/dev/usb/usb_process.h>
-#include <freebsd/dev/usb/usb_debug.h>
-#include <freebsd/dev/usb/usb_util.h>
-
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/kthread.h>
-#include <freebsd/sys/sched.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+#include <dev/usb/usbdi_util.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usb_debug.h>
+#include <dev/usb/usb_util.h>
+
+#include <sys/proc.h>
+#include <sys/kthread.h>
+#include <sys/sched.h>
#if (__FreeBSD_version < 700000)
#define thread_lock(td) mtx_lock_spin(&sched_lock)
diff --git a/freebsd/sys/dev/usb/usb_process.h b/freebsd/sys/dev/usb/usb_process.h
index 75c86ece..f9a3c38d 100644
--- a/freebsd/sys/dev/usb/usb_process.h
+++ b/freebsd/sys/dev/usb/usb_process.h
@@ -24,10 +24,10 @@
* SUCH DAMAGE.
*/
-#ifndef _USB_PROCESS_HH_
-#define _USB_PROCESS_HH_
+#ifndef _USB_PROCESS_H_
+#define _USB_PROCESS_H_
-#include <freebsd/sys/priority.h>
+#include <sys/priority.h>
/* defines */
#define USB_PRI_HIGH PI_NET
@@ -81,4 +81,4 @@ void usb_proc_free(struct usb_process *up);
void *usb_proc_msignal(struct usb_process *up, void *pm0, void *pm1);
void usb_proc_rewakeup(struct usb_process *up);
-#endif /* _USB_PROCESS_HH_ */
+#endif /* _USB_PROCESS_H_ */
diff --git a/freebsd/sys/dev/usb/usb_request.c b/freebsd/sys/dev/usb/usb_request.c
index 61dafd7d..8d17c202 100644
--- a/freebsd/sys/dev/usb/usb_request.c
+++ b/freebsd/sys/dev/usb/usb_request.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/*-
@@ -28,47 +28,47 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
-#include <freebsd/dev/usb/usbdi_util.h>
-#include <freebsd/dev/usb/usb_ioctl.h>
-#include <freebsd/dev/usb/usbhid.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+#include <dev/usb/usbdi_util.h>
+#include <dev/usb/usb_ioctl.h>
+#include <dev/usb/usbhid.h>
#define USB_DEBUG_VAR usb_debug
-#include <freebsd/dev/usb/usb_core.h>
-#include <freebsd/dev/usb/usb_busdma.h>
-#include <freebsd/dev/usb/usb_request.h>
-#include <freebsd/dev/usb/usb_process.h>
-#include <freebsd/dev/usb/usb_transfer.h>
-#include <freebsd/dev/usb/usb_debug.h>
-#include <freebsd/dev/usb/usb_device.h>
-#include <freebsd/dev/usb/usb_util.h>
-#include <freebsd/dev/usb/usb_dynamic.h>
-
-#include <freebsd/dev/usb/usb_controller.h>
-#include <freebsd/dev/usb/usb_bus.h>
-#include <freebsd/sys/ctype.h>
+#include <dev/usb/usb_core.h>
+#include <dev/usb/usb_busdma.h>
+#include <dev/usb/usb_request.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usb_transfer.h>
+#include <dev/usb/usb_debug.h>
+#include <dev/usb/usb_device.h>
+#include <dev/usb/usb_util.h>
+#include <dev/usb/usb_dynamic.h>
+
+#include <dev/usb/usb_controller.h>
+#include <dev/usb/usb_bus.h>
+#include <sys/ctype.h>
#ifdef USB_DEBUG
static int usb_pr_poll_delay = USB_PORT_RESET_DELAY;
diff --git a/freebsd/sys/dev/usb/usb_request.h b/freebsd/sys/dev/usb/usb_request.h
index 0cf882dc..12f373d5 100644
--- a/freebsd/sys/dev/usb/usb_request.h
+++ b/freebsd/sys/dev/usb/usb_request.h
@@ -24,8 +24,8 @@
* SUCH DAMAGE.
*/
-#ifndef _USB_REQUEST_HH_
-#define _USB_REQUEST_HH_
+#ifndef _USB_REQUEST_H_
+#define _USB_REQUEST_H_
struct usb_process;
@@ -86,4 +86,4 @@ usb_error_t usbd_req_set_hub_u2_timeout(struct usb_device *udev,
usb_error_t usbd_req_set_hub_depth(struct usb_device *udev,
struct mtx *mtx, uint16_t depth);
-#endif /* _USB_REQUEST_HH_ */
+#endif /* _USB_REQUEST_H_ */
diff --git a/freebsd/sys/dev/usb/usb_transfer.c b/freebsd/sys/dev/usb/usb_transfer.c
index caf3d31b..17a492e5 100644
--- a/freebsd/sys/dev/usb/usb_transfer.c
+++ b/freebsd/sys/dev/usb/usb_transfer.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/*-
@@ -26,44 +26,44 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
-#include <freebsd/dev/usb/usbdi_util.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+#include <dev/usb/usbdi_util.h>
#define USB_DEBUG_VAR usb_debug
-#include <freebsd/dev/usb/usb_core.h>
-#include <freebsd/dev/usb/usb_busdma.h>
-#include <freebsd/dev/usb/usb_process.h>
-#include <freebsd/dev/usb/usb_transfer.h>
-#include <freebsd/dev/usb/usb_device.h>
-#include <freebsd/dev/usb/usb_debug.h>
-#include <freebsd/dev/usb/usb_util.h>
+#include <dev/usb/usb_core.h>
+#include <dev/usb/usb_busdma.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usb_transfer.h>
+#include <dev/usb/usb_device.h>
+#include <dev/usb/usb_debug.h>
+#include <dev/usb/usb_util.h>
-#include <freebsd/dev/usb/usb_controller.h>
-#include <freebsd/dev/usb/usb_bus.h>
+#include <dev/usb/usb_controller.h>
+#include <dev/usb/usb_bus.h>
#ifdef __rtems__
-#include <freebsd/machine/rtems-bsd-cache.h>
+#include <machine/rtems-bsd-cache.h>
#endif /* __rtems__ */
struct usb_std_packet_size {
diff --git a/freebsd/sys/dev/usb/usb_transfer.h b/freebsd/sys/dev/usb/usb_transfer.h
index eb2abd0c..71157ca7 100644
--- a/freebsd/sys/dev/usb/usb_transfer.h
+++ b/freebsd/sys/dev/usb/usb_transfer.h
@@ -24,8 +24,8 @@
* SUCH DAMAGE.
*/
-#ifndef _USB_TRANSFER_HH_
-#define _USB_TRANSFER_HH_
+#ifndef _USB_TRANSFER_H_
+#define _USB_TRANSFER_H_
/*
* The following structure defines the messages that is used to signal
@@ -137,4 +137,4 @@ void usbd_transfer_timeout_ms(struct usb_xfer *xfer,
usb_timeout_t usbd_get_dma_delay(struct usb_device *udev);
void usbd_transfer_power_ref(struct usb_xfer *xfer, int val);
-#endif /* _USB_TRANSFER_HH_ */
+#endif /* _USB_TRANSFER_H_ */
diff --git a/freebsd/sys/dev/usb/usb_util.c b/freebsd/sys/dev/usb/usb_util.c
index 3bd1f8c4..14c0476a 100644
--- a/freebsd/sys/dev/usb/usb_util.c
+++ b/freebsd/sys/dev/usb/usb_util.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/*-
@@ -26,39 +26,39 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
-#include <freebsd/dev/usb/usbdi_util.h>
-
-#include <freebsd/dev/usb/usb_core.h>
-#include <freebsd/dev/usb/usb_util.h>
-#include <freebsd/dev/usb/usb_process.h>
-#include <freebsd/dev/usb/usb_device.h>
-#include <freebsd/dev/usb/usb_request.h>
-#include <freebsd/dev/usb/usb_busdma.h>
-
-#include <freebsd/dev/usb/usb_controller.h>
-#include <freebsd/dev/usb/usb_bus.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+#include <dev/usb/usbdi_util.h>
+
+#include <dev/usb/usb_core.h>
+#include <dev/usb/usb_util.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usb_device.h>
+#include <dev/usb/usb_request.h>
+#include <dev/usb/usb_busdma.h>
+
+#include <dev/usb/usb_controller.h>
+#include <dev/usb/usb_bus.h>
/*------------------------------------------------------------------------*
* device_delete_all_children - delete all children of a device
diff --git a/freebsd/sys/dev/usb/usb_util.h b/freebsd/sys/dev/usb/usb_util.h
index 9e001088..35abeddd 100644
--- a/freebsd/sys/dev/usb/usb_util.h
+++ b/freebsd/sys/dev/usb/usb_util.h
@@ -24,12 +24,12 @@
* SUCH DAMAGE.
*/
-#ifndef _USB_UTIL_HH_
-#define _USB_UTIL_HH_
+#ifndef _USB_UTIL_H_
+#define _USB_UTIL_H_
int device_delete_all_children(device_t dev);
uint8_t usb_make_str_desc(void *ptr, uint16_t max_len, const char *s);
void usb_printbcd(char *p, uint16_t p_len, uint16_t bcd);
void usb_trim_spaces(char *p);
-#endif /* _USB_UTIL_HH_ */
+#endif /* _USB_UTIL_H_ */
diff --git a/freebsd/sys/dev/usb/usbdi.h b/freebsd/sys/dev/usb/usbdi.h
index a3f0630f..1c2d412b 100644
--- a/freebsd/sys/dev/usb/usbdi.h
+++ b/freebsd/sys/dev/usb/usbdi.h
@@ -23,8 +23,8 @@
*
* $FreeBSD$
*/
-#ifndef _USB_USBDI_HH_
-#define _USB_USBDI_HH_
+#ifndef _USB_USBDI_H_
+#define _USB_USBDI_H_
struct usb_fifo;
struct usb_xfer;
@@ -101,7 +101,7 @@ typedef void (usb_fifo_filter_t)(struct usb_fifo *fifo, struct usb_mbuf *m);
/* USB events */
-#include <freebsd/sys/eventhandler.h>
+#include <sys/eventhandler.h>
typedef void (*usb_dev_configured_t)(void *, struct usb_device *,
struct usb_attach_arg *);
EVENTHANDLER_DECLARE(usb_dev_configured, usb_dev_configured_t);
@@ -559,4 +559,4 @@ void usb_fifo_set_close_zlp(struct usb_fifo *, uint8_t);
void usb_fifo_set_write_defrag(struct usb_fifo *, uint8_t);
void usb_fifo_free(struct usb_fifo *f);
#endif /* _KERNEL */
-#endif /* _USB_USBDI_HH_ */
+#endif /* _USB_USBDI_H_ */
diff --git a/freebsd/sys/dev/usb/usbdi_util.h b/freebsd/sys/dev/usb/usbdi_util.h
index 32931e52..1e450f8f 100644
--- a/freebsd/sys/dev/usb/usbdi_util.h
+++ b/freebsd/sys/dev/usb/usbdi_util.h
@@ -23,8 +23,8 @@
*
* $FreeBSD$
*/
-#ifndef _USB_USBDI_UTIL_HH_
-#define _USB_USBDI_UTIL_HH_
+#ifndef _USB_USBDI_UTIL_H_
+#define _USB_USBDI_UTIL_H_
struct cv;
@@ -88,4 +88,4 @@ const char *usb_get_manufacturer(struct usb_device *);
const char *usb_get_product(struct usb_device *);
const char *usb_get_serial(struct usb_device *);
-#endif /* _USB_USBDI_UTIL_HH_ */
+#endif /* _USB_USBDI_UTIL_H_ */
diff --git a/freebsd/sys/dev/usb/usbhid.h b/freebsd/sys/dev/usb/usbhid.h
index 192a2359..c07454f7 100644
--- a/freebsd/sys/dev/usb/usbhid.h
+++ b/freebsd/sys/dev/usb/usbhid.h
@@ -26,10 +26,10 @@
* SUCH DAMAGE.
*/
-#ifndef _USB_HID_HH_
-#define _USB_HID_HH_
+#ifndef _USB_HID_H_
+#define _USB_HID_H_
-#include <freebsd/dev/usb/usb_endian.h>
+#include <dev/usb/usb_endian.h>
#define UR_GET_HID_DESCRIPTOR 0x06
#define UDESC_HID 0x21
@@ -241,4 +241,4 @@ usb_error_t usbd_req_get_hid_desc(struct usb_device *udev, struct mtx *mtx,
void **descp, uint16_t *sizep, struct malloc_type *mem,
uint8_t iface_index);
#endif /* _KERNEL */
-#endif /* _USB_HID_HH_ */
+#endif /* _USB_HID_H_ */
diff --git a/freebsd/sys/fs/devfs/devfs_int.h b/freebsd/sys/fs/devfs/devfs_int.h
index 723cbc22..aa06e374 100644
--- a/freebsd/sys/fs/devfs/devfs_int.h
+++ b/freebsd/sys/fs/devfs/devfs_int.h
@@ -30,10 +30,10 @@
* by kern/kern_conf.c and fs/devfs/...
*/
-#ifndef _FS_DEVFS_DEVFS_INT_HH_
-#define _FS_DEVFS_DEVFS_INT_HH_
+#ifndef _FS_DEVFS_DEVFS_INT_H_
+#define _FS_DEVFS_DEVFS_INT_H_
-#include <freebsd/sys/queue.h>
+#include <sys/queue.h>
#ifdef _KERNEL
@@ -87,4 +87,4 @@ extern TAILQ_HEAD(cdev_priv_list, cdev_priv) cdevp_list;
#endif /* _KERNEL */
-#endif /* !_FS_DEVFS_DEVFS_INT_HH_ */
+#endif /* !_FS_DEVFS_DEVFS_INT_H_ */
diff --git a/freebsd/sys/h8300/h8300/in_cksum.c b/freebsd/sys/h8300/h8300/in_cksum.c
new file mode 100644
index 00000000..c6f7b568
--- /dev/null
+++ b/freebsd/sys/h8300/h8300/in_cksum.c
@@ -0,0 +1,255 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1988, 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ * Copyright (c) 1996
+ * Matt Thomas <matt@3am-software.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)in_cksum.c 8.1 (Berkeley) 6/10/93
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/mbuf.h>
+#include <sys/systm.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <machine/in_cksum.h>
+
+/*
+ * Checksum routine for Internet Protocol family headers
+ * (Portable Alpha version).
+ *
+ * This routine is very heavily used in the network
+ * code and should be modified for each CPU to be as fast as possible.
+ */
+
+#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x)
+#define REDUCE32 \
+ { \
+ q_util.q = sum; \
+ sum = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
+ }
+#define REDUCE16 \
+ { \
+ q_util.q = sum; \
+ l_util.l = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
+ sum = l_util.s[0] + l_util.s[1]; \
+ ADDCARRY(sum); \
+ }
+
+static const u_int32_t in_masks[] = {
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
+ 0x00000000, 0x000000FF, 0x0000FFFF, 0x00FFFFFF, /* offset 0 */
+ 0x00000000, 0x0000FF00, 0x00FFFF00, 0xFFFFFF00, /* offset 1 */
+ 0x00000000, 0x00FF0000, 0xFFFF0000, 0xFFFF0000, /* offset 2 */
+ 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, /* offset 3 */
+#else
+ /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
+ 0x00000000, 0xFF000000, 0xFFFF0000, 0xFFFFFF00, /* offset 0 */
+ 0x00000000, 0x00FF0000, 0x00FFFF00, 0x00FFFFFF, /* offset 1 */
+ 0x00000000, 0x0000FF00, 0x0000FFFF, 0x0000FFFF, /* offset 2 */
+ 0x00000000, 0x000000FF, 0x000000FF, 0x000000FF, /* offset 3 */
+#endif
+};
+
+union l_util {
+ u_int16_t s[2];
+ u_int32_t l;
+};
+union q_util {
+ u_int16_t s[4];
+ u_int32_t l[2];
+ u_int64_t q;
+};
+
+static u_int64_t
+in_cksumdata(const void *buf, int len)
+{
+ const u_int32_t *lw = (const u_int32_t *) buf;
+ u_int64_t sum = 0;
+ u_int64_t prefilled;
+ int offset;
+ union q_util q_util;
+
+ if ((3 & (long) lw) == 0 && len == 20) {
+ sum = (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3] + lw[4];
+ REDUCE32;
+ return sum;
+ }
+
+ if ((offset = 3 & (long) lw) != 0) {
+ const u_int32_t *masks = in_masks + (offset << 2);
+ lw = (u_int32_t *) (((long) lw) - offset);
+ sum = *lw++ & masks[len >= 3 ? 3 : len];
+ len -= 4 - offset;
+ if (len <= 0) {
+ REDUCE32;
+ return sum;
+ }
+ }
+#if 0
+ /*
+ * Force to cache line boundary.
+ */
+ offset = 32 - (0x1f & (long) lw);
+ if (offset < 32 && len > offset) {
+ len -= offset;
+ if (4 & offset) {
+ sum += (u_int64_t) lw[0];
+ lw += 1;
+ }
+ if (8 & offset) {
+ sum += (u_int64_t) lw[0] + lw[1];
+ lw += 2;
+ }
+ if (16 & offset) {
+ sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
+ lw += 4;
+ }
+ }
+#endif
+ /*
+ * access prefilling to start load of next cache line.
+ * then add current cache line
+ * save result of prefilling for loop iteration.
+ */
+ prefilled = lw[0];
+ while ((len -= 32) >= 4) {
+ u_int64_t prefilling = lw[8];
+ sum += prefilled + lw[1] + lw[2] + lw[3]
+ + lw[4] + lw[5] + lw[6] + lw[7];
+ lw += 8;
+ prefilled = prefilling;
+ }
+ if (len >= 0) {
+ sum += prefilled + lw[1] + lw[2] + lw[3]
+ + lw[4] + lw[5] + lw[6] + lw[7];
+ lw += 8;
+ } else {
+ len += 32;
+ }
+ while ((len -= 16) >= 0) {
+ sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
+ lw += 4;
+ }
+ len += 16;
+ while ((len -= 4) >= 0) {
+ sum += (u_int64_t) *lw++;
+ }
+ len += 4;
+ if (len > 0)
+ sum += (u_int64_t) (in_masks[len] & *lw);
+ REDUCE32;
+ return sum;
+}
+
+u_short
+in_addword(u_short a, u_short b)
+{
+ u_int64_t sum = a + b;
+
+ ADDCARRY(sum);
+ return (sum);
+}
+
+u_short
+#ifdef __rtems__
+/* Prototype does not match in FreeBSD code */
+in_pseudo(u_int a, u_int b, u_int c)
+#else
+in_pseudo(u_int32_t a, u_int32_t b, u_int32_t c)
+#endif
+{
+ u_int64_t sum;
+ union q_util q_util;
+ union l_util l_util;
+
+ sum = (u_int64_t) a + b + c;
+ REDUCE16;
+ return (sum);
+}
+
+u_short
+in_cksum_skip(struct mbuf *m, int len, int skip)
+{
+ u_int64_t sum = 0;
+ int mlen = 0;
+ int clen = 0;
+ caddr_t addr;
+ union q_util q_util;
+ union l_util l_util;
+
+ len -= skip;
+ for (; skip && m; m = m->m_next) {
+ if (m->m_len > skip) {
+ mlen = m->m_len - skip;
+ addr = mtod(m, caddr_t) + skip;
+ goto skip_start;
+ } else {
+ skip -= m->m_len;
+ }
+ }
+
+ for (; m && len; m = m->m_next) {
+ if (m->m_len == 0)
+ continue;
+ mlen = m->m_len;
+ addr = mtod(m, caddr_t);
+skip_start:
+ if (len < mlen)
+ mlen = len;
+
+ if ((clen ^ (uintptr_t) addr) & 1)
+ sum += in_cksumdata(addr, mlen) << 8;
+ else
+ sum += in_cksumdata(addr, mlen);
+
+ clen += mlen;
+ len -= mlen;
+ }
+ REDUCE16;
+ return (~sum & 0xffff);
+}
+
+u_int in_cksum_hdr(const struct ip *ip)
+{
+ u_int64_t sum = in_cksumdata(ip, sizeof(struct ip));
+ union q_util q_util;
+ union l_util l_util;
+ REDUCE16;
+ return (~sum & 0xffff);
+}
diff --git a/freebsd/sys/h8300/h8300/legacy.c b/freebsd/sys/h8300/h8300/legacy.c
new file mode 100644
index 00000000..2547990c
--- /dev/null
+++ b/freebsd/sys/h8300/h8300/legacy.c
@@ -0,0 +1,347 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright 1998 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby
+ * granted, provided that both the above copyright notice and this
+ * permission notice appear in all copies, that both the above
+ * copyright notice and this permission notice appear in all
+ * supporting documentation, and that the name of M.I.T. not be used
+ * in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission. M.I.T. makes
+ * no representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
+ * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
+ * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * This code implements a system driver for legacy systems that do not
+ * support ACPI or when ACPI support is not present in the kernel.
+ */
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <machine/bus.h>
+#include <sys/pcpu.h>
+#include <sys/rman.h>
+#include <sys/smp.h>
+
+#ifndef __rtems__
+#include <rtems/bsd/local/opt_mca.h>
+#endif /* __rtems__ */
+#ifdef DEV_MCA
+#include <i386/bios/mca_machdep.h>
+#endif
+
+#include <machine/legacyvar.h>
+#include <machine/resource.h>
+
+static MALLOC_DEFINE(M_LEGACYDEV, "legacydrv", "legacy system device");
+struct legacy_device {
+ int lg_pcibus;
+};
+
+#define DEVTOAT(dev) ((struct legacy_device *)device_get_ivars(dev))
+
+static int legacy_probe(device_t);
+static int legacy_attach(device_t);
+static int legacy_print_child(device_t, device_t);
+static device_t legacy_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static int legacy_read_ivar(device_t, device_t, int, uintptr_t *);
+static int legacy_write_ivar(device_t, device_t, int, uintptr_t);
+
+static device_method_t legacy_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, legacy_probe),
+ DEVMETHOD(device_attach, legacy_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, legacy_print_child),
+ DEVMETHOD(bus_add_child, legacy_add_child),
+ DEVMETHOD(bus_read_ivar, legacy_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_write_ivar),
+ DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t legacy_driver = {
+ "legacy",
+ legacy_methods,
+ 1, /* no softc */
+};
+static devclass_t legacy_devclass;
+
+DRIVER_MODULE(legacy, nexus, legacy_driver, legacy_devclass, 0, 0);
+
+static int
+legacy_probe(device_t dev)
+{
+
+ device_set_desc(dev, "legacy system");
+ device_quiet(dev);
+ return (0);
+}
+
+static int
+legacy_attach(device_t dev)
+{
+ device_t child;
+
+ /*
+ * Let our child drivers identify any child devices that they
+ * can find. Once that is done attach any devices that we
+ * found.
+ */
+ bus_generic_probe(dev);
+ bus_generic_attach(dev);
+
+#ifndef PC98
+ /*
+ * If we didn't see EISA or ISA on a pci bridge, create some
+ * connection points now so they show up "on motherboard".
+ */
+ if (!devclass_get_device(devclass_find("eisa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "eisa", 0);
+ if (child == NULL)
+ panic("legacy_attach eisa");
+ device_probe_and_attach(child);
+ }
+#endif
+#ifdef DEV_MCA
+ if (MCA_system && !devclass_get_device(devclass_find("mca"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "mca", 0);
+ if (child == 0)
+ panic("legacy_probe mca");
+ device_probe_and_attach(child);
+ }
+#endif
+ if (!devclass_get_device(devclass_find("isa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "isa", 0);
+ if (child == NULL)
+ panic("legacy_attach isa");
+ device_probe_and_attach(child);
+ }
+
+ return 0;
+}
+
+static int
+legacy_print_child(device_t bus, device_t child)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+ int retval = 0;
+
+ retval += bus_print_child_header(bus, child);
+ if (atdev->lg_pcibus != -1)
+ retval += printf(" pcibus %d", atdev->lg_pcibus);
+ retval += printf(" on motherboard\n"); /* XXX "motherboard", ick */
+
+ return (retval);
+}
+
+static device_t
+legacy_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ device_t child;
+ struct legacy_device *atdev;
+
+ atdev = malloc(sizeof(struct legacy_device), M_LEGACYDEV,
+ M_NOWAIT | M_ZERO);
+ if (atdev == NULL)
+ return(NULL);
+ atdev->lg_pcibus = -1;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child == NULL)
+ free(atdev, M_LEGACYDEV);
+ else
+ /* should we free this in legacy_child_detached? */
+ device_set_ivars(child, atdev);
+
+ return (child);
+}
+
+static int
+legacy_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ *result = 0;
+ break;
+ case LEGACY_IVAR_PCIBUS:
+ *result = atdev->lg_pcibus;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+
+static int
+legacy_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ return EINVAL;
+ case LEGACY_IVAR_PCIBUS:
+ atdev->lg_pcibus = value;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+/*
+ * Legacy CPU attachment when ACPI is not available. Drivers like
+ * cpufreq(4) hang off this.
+ */
+static void cpu_identify(driver_t *driver, device_t parent);
+static int cpu_read_ivar(device_t dev, device_t child, int index,
+ uintptr_t *result);
+static device_t cpu_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static struct resource_list *cpu_get_rlist(device_t dev, device_t child);
+
+struct cpu_device {
+ struct resource_list cd_rl;
+ struct pcpu *cd_pcpu;
+};
+
+static device_method_t cpu_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, cpu_identify),
+ DEVMETHOD(device_probe, bus_generic_probe),
+ DEVMETHOD(device_attach, bus_generic_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_add_child, cpu_add_child),
+ DEVMETHOD(bus_read_ivar, cpu_read_ivar),
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_get_resource_list, cpu_get_rlist),
+ DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
+ DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource),
+ DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource),
+ DEVMETHOD(bus_driver_added, bus_generic_driver_added),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t cpu_driver = {
+ "cpu",
+ cpu_methods,
+ 1, /* no softc */
+};
+static devclass_t cpu_devclass;
+DRIVER_MODULE(cpu, legacy, cpu_driver, cpu_devclass, 0, 0);
+
+static void
+cpu_identify(driver_t *driver, device_t parent)
+{
+ device_t child;
+ int i;
+
+ /*
+ * Attach a cpuX device for each CPU. We use an order of 150
+ * so that these devices are attached after the Host-PCI
+ * bridges (which are added at order 100).
+ */
+ for (i = 0; i <= mp_maxid; i++)
+ if (!CPU_ABSENT(i)) {
+ child = BUS_ADD_CHILD(parent, 150, "cpu", i);
+ if (child == NULL)
+ panic("legacy_attach cpu");
+ }
+}
+
+static device_t
+cpu_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ struct cpu_device *cd;
+ device_t child;
+ struct pcpu *pc;
+
+ if ((cd = malloc(sizeof(*cd), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL)
+ return (NULL);
+
+ resource_list_init(&cd->cd_rl);
+ pc = pcpu_find(device_get_unit(bus));
+ cd->cd_pcpu = pc;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child != NULL) {
+ pc->pc_device = child;
+ device_set_ivars(child, cd);
+ } else
+ free(cd, M_DEVBUF);
+ return (child);
+}
+
+static struct resource_list *
+cpu_get_rlist(device_t dev, device_t child)
+{
+ struct cpu_device *cpdev;
+
+ cpdev = device_get_ivars(child);
+ return (&cpdev->cd_rl);
+}
+
+static int
+cpu_read_ivar(device_t dev, device_t child, int index, uintptr_t *result)
+{
+ struct cpu_device *cpdev;
+
+ if (index != CPU_IVAR_PCPU)
+ return (ENOENT);
+ cpdev = device_get_ivars(child);
+ *result = (uintptr_t)cpdev->cd_pcpu;
+ return (0);
+}
diff --git a/freebsd/sys/h8300/include/machine/in_cksum.h b/freebsd/sys/h8300/include/machine/in_cksum.h
index 25634a6e..37d88e2e 100644
--- a/freebsd/sys/h8300/include/machine/in_cksum.h
+++ b/freebsd/sys/h8300/include/machine/in_cksum.h
@@ -29,15 +29,16 @@
* from tahoe: in_cksum.c 1.2 86/01/05
* from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91
* from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp
+ * from: src/sys/alpha/include/in_cksum.h,v 1.7 2005/03/02 21:33:20 joerg
* $FreeBSD$
*/
-#ifndef _MACHINE_IN_CKSUM_HH_
-#define _MACHINE_IN_CKSUM_HH_ 1
+#ifndef _MACHINE_IN_CKSUM_H_
+#define _MACHINE_IN_CKSUM_H_ 1
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
-#define in_cksum(m, len) in_cksum_skip(m, len, 0)
+#define in_cksum(m, len) in_cksum_skip(m, len, 0)
/*
* It it useful to have an Internet checksum routine which is inlineable
@@ -57,20 +58,20 @@ in_cksum_update(struct ip *ip)
#else
-#define in_cksum_update(ip) \
- do { \
- int __tmpsum; \
- __tmpsum = (int)ntohs(ip->ip_sum) + 256; \
- ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \
+#define in_cksum_update(ip) \
+ do { \
+ int __tmpsum; \
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256; \
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \
} while(0)
#endif
#ifdef _KERNEL
u_int in_cksum_hdr(const struct ip *ip);
-u_short in_addword(u_short sum, u_short b);
-u_short in_pseudo(u_int sum, u_int b, u_int c);
-u_short in_cksum_skip(struct mbuf *m, int len, int skip);
+u_short in_addword(u_short sum, u_short b);
+u_short in_pseudo(u_int sum, u_int b, u_int c);
+u_short in_cksum_skip(struct mbuf *m, int len, int skip);
#endif
-#endif /* _MACHINE_IN_CKSUM_HH_ */
+#endif /* _MACHINE_IN_CKSUM_H_ */
diff --git a/freebsd/sys/h8300/include/machine/legacyvar.h b/freebsd/sys/h8300/include/machine/legacyvar.h
new file mode 100644
index 00000000..0b0fa433
--- /dev/null
+++ b/freebsd/sys/h8300/include/machine/legacyvar.h
@@ -0,0 +1,57 @@
+/*-
+ * Copyright (c) 2000 Peter Wemm <peter@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_LEGACYVAR_H_
+#define _MACHINE_LEGACYVAR_H_
+
+enum legacy_device_ivars {
+ LEGACY_IVAR_PCIDOMAIN,
+ LEGACY_IVAR_PCIBUS
+};
+
+#define LEGACY_ACCESSOR(var, ivar, type) \
+ __BUS_ACCESSOR(legacy, var, LEGACY, ivar, type)
+
+LEGACY_ACCESSOR(pcidomain, PCIDOMAIN, uint32_t)
+LEGACY_ACCESSOR(pcibus, PCIBUS, uint32_t)
+
+#undef LEGACY_ACCESSOR
+
+int legacy_pcib_maxslots(device_t dev);
+uint32_t legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes);
+int legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result);
+void legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes);
+int legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value);
+struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child,
+ int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
+
+#endif /* !_MACHINE_LEGACYVAR_H_ */
diff --git a/freebsd/sys/h8300/include/machine/pci_cfgreg.h b/freebsd/sys/h8300/include/machine/pci_cfgreg.h
new file mode 100644
index 00000000..bc72418d
--- /dev/null
+++ b/freebsd/sys/h8300/include/machine/pci_cfgreg.h
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
+ */
+
+#define CONF1_ADDR_PORT 0x0cf8
+#define CONF1_DATA_PORT 0x0cfc
+
+#define CONF1_ENABLE 0x80000000ul
+#define CONF1_ENABLE_CHK 0x80000000ul
+#define CONF1_ENABLE_MSK 0x7f000000ul
+#define CONF1_ENABLE_CHK1 0xff000001ul
+#define CONF1_ENABLE_MSK1 0x80000001ul
+#define CONF1_ENABLE_RES1 0x80000000ul
+
+#define CONF2_ENABLE_PORT 0x0cf8
+#define CONF2_FORWARD_PORT 0x0cfa
+
+#define CONF2_ENABLE_CHK 0x0e
+#define CONF2_ENABLE_RES 0x0e
+
+int pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus);
+int pci_cfgregopen(void);
+u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes);
+void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes);
+void pci_pir_open(void);
+int pci_pir_probe(int bus, int require_parse);
+int pci_pir_route_interrupt(int bus, int device, int func, int pin);
diff --git a/freebsd/sys/h8300/pci/pci_bus.c b/freebsd/sys/h8300/pci/pci_bus.c
new file mode 100644
index 00000000..6627db98
--- /dev/null
+++ b/freebsd/sys/h8300/pci/pci_bus.c
@@ -0,0 +1,729 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/local/opt_cpu.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
+
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcib_private.h>
+#include <isa/isavar.h>
+#ifdef CPU_ELAN
+#include <machine/md_var.h>
+#endif
+#include <machine/legacyvar.h>
+#include <machine/pci_cfgreg.h>
+#include <machine/resource.h>
+
+#include <rtems/bsd/local/pcib_if.h>
+
+#ifndef __rtems__
+static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev,
+ int pin);
+#else /* __rtems__ */
+int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin);
+#endif /* __rtems__ */
+
+
+int
+legacy_pcib_maxslots(device_t dev)
+{
+ return 31;
+}
+
+/* read configuration space register */
+
+#ifdef __rtems__
+uint32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#else
+u_int32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#endif
+{
+ return(pci_cfgregread(bus, slot, func, reg, bytes));
+}
+
+/* write configuration space register */
+
+void
+legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes)
+{
+ pci_cfgregwrite(bus, slot, func, reg, data, bytes);
+}
+
+/* Pass MSI requests up to the nexus. */
+
+static int
+legacy_pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount,
+ int *irqs)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSI(device_get_parent(bus), dev, count, maxcount,
+ irqs));
+}
+
+static int
+legacy_pcib_alloc_msix(device_t pcib, device_t dev, int *irq)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq));
+}
+
+static int
+legacy_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr,
+ uint32_t *data)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data));
+}
+
+static const char *
+legacy_pcib_is_host_bridge(int bus, int slot, int func,
+ uint32_t id, uint8_t class, uint8_t subclass,
+ uint8_t *busnum)
+{
+ const char *s = NULL;
+ static uint8_t pxb[4]; /* hack for 450nx */
+
+ *busnum = 0;
+
+ switch (id) {
+ case 0x12258086:
+ s = "Intel 824?? host to PCI bridge";
+ /* XXX This is a guess */
+ /* *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x41, 1); */
+ *busnum = bus;
+ break;
+ case 0x71208086:
+ s = "Intel 82810 (i810 GMCH) Host To Hub bridge";
+ break;
+ case 0x71228086:
+ s = "Intel 82810-DC100 (i810-DC100 GMCH) Host To Hub bridge";
+ break;
+ case 0x71248086:
+ s = "Intel 82810E (i810E GMCH) Host To Hub bridge";
+ break;
+ case 0x11308086:
+ s = "Intel 82815 (i815 GMCH) Host To Hub bridge";
+ break;
+ case 0x71808086:
+ s = "Intel 82443LX (440 LX) host to PCI bridge";
+ break;
+ case 0x71908086:
+ s = "Intel 82443BX (440 BX) host to PCI bridge";
+ break;
+ case 0x71928086:
+ s = "Intel 82443BX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x71948086:
+ s = "Intel 82443MX host to PCI bridge";
+ break;
+ case 0x71a08086:
+ s = "Intel 82443GX host to PCI bridge";
+ break;
+ case 0x71a18086:
+ s = "Intel 82443GX host to AGP bridge";
+ break;
+ case 0x71a28086:
+ s = "Intel 82443GX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x84c48086:
+ s = "Intel 82454KX/GX (Orion) host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x4a, 1);
+ break;
+ case 0x84ca8086:
+ /*
+ * For the 450nx chipset, there is a whole bundle of
+ * things pretending to be host bridges. The MIOC will
+ * be seen first and isn't really a pci bridge (the
+ * actual busses are attached to the PXB's). We need to
+ * read the registers of the MIOC to figure out the
+ * bus numbers for the PXB channels.
+ *
+ * Since the MIOC doesn't have a pci bus attached, we
+ * pretend it wasn't there.
+ */
+ pxb[0] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd0, 1); /* BUSNO[0] */
+ pxb[1] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd1, 1) + 1; /* SUBA[0]+1 */
+ pxb[2] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd3, 1); /* BUSNO[1] */
+ pxb[3] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd4, 1) + 1; /* SUBA[1]+1 */
+ return NULL;
+ case 0x84cb8086:
+ switch (slot) {
+ case 0x12:
+ s = "Intel 82454NX PXB#0, Bus#A";
+ *busnum = pxb[0];
+ break;
+ case 0x13:
+ s = "Intel 82454NX PXB#0, Bus#B";
+ *busnum = pxb[1];
+ break;
+ case 0x14:
+ s = "Intel 82454NX PXB#1, Bus#A";
+ *busnum = pxb[2];
+ break;
+ case 0x15:
+ s = "Intel 82454NX PXB#1, Bus#B";
+ *busnum = pxb[3];
+ break;
+ }
+ break;
+ case 0x1A308086:
+ s = "Intel 82845 Host to PCI bridge";
+ break;
+
+ /* AMD -- vendor 0x1022 */
+ case 0x30001022:
+ s = "AMD Elan SC520 host to PCI bridge";
+#ifdef CPU_ELAN
+ init_AMD_Elan_sc520();
+#else
+ printf(
+"*** WARNING: missing CPU_ELAN -- timekeeping may be wrong\n");
+#endif
+ break;
+ case 0x70061022:
+ s = "AMD-751 host to PCI bridge";
+ break;
+ case 0x700e1022:
+ s = "AMD-761 host to PCI bridge";
+ break;
+
+ /* SiS -- vendor 0x1039 */
+ case 0x04961039:
+ s = "SiS 85c496";
+ break;
+ case 0x04061039:
+ s = "SiS 85c501";
+ break;
+ case 0x06011039:
+ s = "SiS 85c601";
+ break;
+ case 0x55911039:
+ s = "SiS 5591 host to PCI bridge";
+ break;
+ case 0x00011039:
+ s = "SiS 5591 host to AGP bridge";
+ break;
+
+ /* VLSI -- vendor 0x1004 */
+ case 0x00051004:
+ s = "VLSI 82C592 Host to PCI bridge";
+ break;
+
+ /* XXX Here is MVP3, I got the datasheet but NO M/B to test it */
+ /* totally. Please let me know if anything wrong. -F */
+ /* XXX need info on the MVP3 -- any takers? */
+ case 0x05981106:
+ s = "VIA 82C598MVP (Apollo MVP3) host bridge";
+ break;
+
+ /* AcerLabs -- vendor 0x10b9 */
+ /* Funny : The datasheet told me vendor id is "10b8",sub-vendor */
+ /* id is '10b9" but the register always shows "10b9". -Foxfair */
+ case 0x154110b9:
+ s = "AcerLabs M1541 (Aladdin-V) PCI host bridge";
+ break;
+
+ /* OPTi -- vendor 0x1045 */
+ case 0xc7011045:
+ s = "OPTi 82C700 host to PCI bridge";
+ break;
+ case 0xc8221045:
+ s = "OPTi 82C822 host to PCI Bridge";
+ break;
+
+ /* ServerWorks -- vendor 0x1166 */
+ case 0x00051166:
+ s = "ServerWorks NB6536 2.0HE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00061166:
+ /* FALLTHROUGH */
+ case 0x00081166:
+ /* FALLTHROUGH */
+ case 0x02011166:
+ /* FALLTHROUGH */
+ case 0x010f1014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00091166:
+ s = "ServerWorks NB6635 3.0LE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00101166:
+ s = "ServerWorks CIOB30 host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00111166:
+ /* FALLTHROUGH */
+ case 0x03021014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks CMIC-HE host to PCI-X bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* XXX unknown chipset, but working */
+ case 0x00171166:
+ /* FALLTHROUGH */
+ case 0x01011166:
+ case 0x01101166:
+ case 0x02251166:
+ s = "ServerWorks host to PCI bridge(unknown chipset)";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* Compaq/HP -- vendor 0x0e11 */
+ case 0x60100e11:
+ s = "Compaq/HP Model 6010 HotPlug PCI Bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0xc8, 1);
+ break;
+
+ /* Integrated Micro Solutions -- vendor 0x10e0 */
+ case 0x884910e0:
+ s = "Integrated Micro Solutions VL Bridge";
+ break;
+
+ default:
+ if (class == PCIC_BRIDGE && subclass == PCIS_BRIDGE_HOST)
+ s = "Host to PCI bridge";
+ break;
+ }
+
+ return s;
+}
+
+/*
+ * Scan the first pci bus for host-pci bridges and add pcib instances
+ * to the nexus for each bridge.
+ */
+static void
+legacy_pcib_identify(driver_t *driver, device_t parent)
+{
+ int bus, slot, func;
+ u_int8_t hdrtype;
+ int found = 0;
+ int pcifunchigh;
+ int found824xx = 0;
+ int found_orion = 0;
+ device_t child;
+ devclass_t pci_devclass;
+
+ if (pci_cfgregopen() == 0)
+ return;
+ /*
+ * Check to see if we haven't already had a PCI bus added
+ * via some other means. If we have, bail since otherwise
+ * we're going to end up duplicating it.
+ */
+ if ((pci_devclass = devclass_find("pci")) &&
+ devclass_get_device(pci_devclass, 0))
+ return;
+
+
+ bus = 0;
+ retry:
+ for (slot = 0; slot <= PCI_SLOTMAX; slot++) {
+ func = 0;
+ hdrtype = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_HDRTYPE, 1);
+ /*
+ * When enumerating bus devices, the standard says that
+ * one should check the header type and ignore the slots whose
+ * header types that the software doesn't know about. We use
+ * this to filter out devices.
+ */
+ if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE)
+ continue;
+ if ((hdrtype & PCIM_MFDEV) &&
+ (!found_orion || hdrtype != 0xff))
+ pcifunchigh = PCI_FUNCMAX;
+ else
+ pcifunchigh = 0;
+ for (func = 0; func <= pcifunchigh; func++) {
+ /*
+ * Read the IDs and class from the device.
+ */
+ u_int32_t id;
+ u_int8_t class, subclass, busnum;
+ const char *s;
+ device_t *devs;
+ int ndevs, i;
+
+ id = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_DEVVENDOR, 4);
+ if (id == -1)
+ continue;
+ class = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_CLASS, 1);
+ subclass = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_SUBCLASS, 1);
+
+ s = legacy_pcib_is_host_bridge(bus, slot, func,
+ id, class, subclass,
+ &busnum);
+ if (s == NULL)
+ continue;
+
+ /*
+ * Check to see if the physical bus has already
+ * been seen. Eg: hybrid 32 and 64 bit host
+ * bridges to the same logical bus.
+ */
+ if (device_get_children(parent, &devs, &ndevs) == 0) {
+ for (i = 0; s != NULL && i < ndevs; i++) {
+ if (strcmp(device_get_name(devs[i]),
+ "pcib") != 0)
+ continue;
+ if (legacy_get_pcibus(devs[i]) == busnum)
+ s = NULL;
+ }
+ free(devs, M_TEMP);
+ }
+
+ if (s == NULL)
+ continue;
+ /*
+ * Add at priority 100 to make sure we
+ * go after any motherboard resources
+ */
+ child = BUS_ADD_CHILD(parent, 100,
+ "pcib", busnum);
+ device_set_desc(child, s);
+ legacy_set_pcibus(child, busnum);
+
+ found = 1;
+ if (id == 0x12258086)
+ found824xx = 1;
+ if (id == 0x84c48086)
+ found_orion = 1;
+ }
+ }
+ if (found824xx && bus == 0) {
+ bus++;
+ goto retry;
+ }
+
+ /*
+ * Make sure we add at least one bridge since some old
+ * hardware doesn't actually have a host-pci bridge device.
+ * Note that pci_cfgregopen() thinks we have PCI devices..
+ */
+ if (!found) {
+ if (bootverbose)
+ printf(
+ "legacy_pcib_identify: no bridge found, adding pcib0 anyway\n");
+ child = BUS_ADD_CHILD(parent, 100, "pcib", 0);
+ legacy_set_pcibus(child, 0);
+ }
+}
+
+static int
+legacy_pcib_probe(device_t dev)
+{
+
+ if (pci_cfgregopen() == 0)
+ return ENXIO;
+ return -100;
+}
+
+static int
+legacy_pcib_attach(device_t dev)
+{
+ device_t pir;
+ int bus;
+
+ /*
+ * Look for a PCI BIOS interrupt routing table as that will be
+ * our method of routing interrupts if we have one.
+ */
+ bus = pcib_get_bus(dev);
+#ifndef __rtems__
+ if (pci_pir_probe(bus, 0)) {
+ pir = BUS_ADD_CHILD(device_get_parent(dev), 0, "pir", 0);
+ if (pir != NULL)
+ device_probe_and_attach(pir);
+ }
+#else /* __rtems__ */
+#endif /* __rtems__ */
+ device_add_child(dev, "pci", bus);
+ return bus_generic_attach(dev);
+}
+
+int
+legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ *result = 0;
+ return 0;
+ case PCIB_IVAR_BUS:
+ *result = legacy_get_pcibus(dev);
+ return 0;
+ }
+ return ENOENT;
+}
+
+int
+legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ return EINVAL;
+ case PCIB_IVAR_BUS:
+ legacy_set_pcibus(dev, value);
+ return 0;
+ }
+ return ENOENT;
+}
+
+SYSCTL_DECL(_hw_pci);
+
+static unsigned long legacy_host_mem_start = 0x80000000;
+TUNABLE_ULONG("hw.pci.host_mem_start", &legacy_host_mem_start);
+SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN,
+ &legacy_host_mem_start, 0x80000000,
+ "Limit the host bridge memory to being above this address. Must be\n\
+set at boot via a tunable.");
+
+struct resource *
+legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
+ u_long start, u_long end, u_long count, u_int flags)
+{
+ /*
+ * If no memory preference is given, use upper 32MB slot most
+ * bioses use for their memory window. Typically other bridges
+ * before us get in the way to assert their preferences on memory.
+ * Hardcoding like this sucks, so a more MD/MI way needs to be
+ * found to do it. This is typically only used on older laptops
+ * that don't have pci busses behind pci bridge, so assuming > 32MB
+ * is liekly OK.
+ *
+ * However, this can cause problems for other chipsets, so we make
+ * this tunable by hw.pci.host_mem_start.
+ */
+ if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL)
+ start = legacy_host_mem_start;
+ if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL)
+ start = 0x1000;
+ return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
+ count, flags));
+}
+
+static device_method_t legacy_pcib_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, legacy_pcib_identify),
+ DEVMETHOD(device_probe, legacy_pcib_probe),
+ DEVMETHOD(device_attach, legacy_pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, legacy_pcib_maxslots),
+ DEVMETHOD(pcib_read_config, legacy_pcib_read_config),
+ DEVMETHOD(pcib_write_config, legacy_pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, legacy_pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, legacy_pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, legacy_pcib_map_msi),
+
+ { 0, 0 }
+};
+
+static devclass_t hostb_devclass;
+
+DEFINE_CLASS_0(pcib, legacy_pcib_driver, legacy_pcib_methods, 1);
+DRIVER_MODULE(pcib, legacy, legacy_pcib_driver, hostb_devclass, 0, 0);
+
+
+#ifndef __rtems__
+/*
+ * Install placeholder to claim the resources owned by the
+ * PCI bus interface. This could be used to extract the
+ * config space registers in the extreme case where the PnP
+ * ID is available and the PCI BIOS isn't, but for now we just
+ * eat the PnP ID and do nothing else.
+ *
+ * XXX we should silence this probe, as it will generally confuse
+ * people.
+ */
+static struct isa_pnp_id pcibus_pnp_ids[] = {
+ { 0x030ad041 /* PNP0A03 */, "PCI Bus" },
+ { 0x080ad041 /* PNP0A08 */, "PCIe Bus" },
+ { 0 }
+};
+
+static int
+pcibus_pnp_probe(device_t dev)
+{
+ int result;
+
+ if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, pcibus_pnp_ids)) <= 0)
+ device_quiet(dev);
+ return(result);
+}
+
+static int
+pcibus_pnp_attach(device_t dev)
+{
+ return(0);
+}
+
+static device_method_t pcibus_pnp_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibus_pnp_probe),
+ DEVMETHOD(device_attach, pcibus_pnp_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+ { 0, 0 }
+};
+
+static devclass_t pcibus_pnp_devclass;
+
+DEFINE_CLASS_0(pcibus_pnp, pcibus_pnp_driver, pcibus_pnp_methods, 1);
+DRIVER_MODULE(pcibus_pnp, isa, pcibus_pnp_driver, pcibus_pnp_devclass, 0, 0);
+
+
+/*
+ * Provide a PCI-PCI bridge driver for PCI busses behind PCI-PCI bridges
+ * that appear in the PCIBIOS Interrupt Routing Table to use the routing
+ * table for interrupt routing when possible.
+ */
+static int pcibios_pcib_probe(device_t bus);
+
+static device_method_t pcibios_pcib_pci_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibios_pcib_probe),
+ DEVMETHOD(device_attach, pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, pcib_maxslots),
+ DEVMETHOD(pcib_read_config, pcib_read_config),
+ DEVMETHOD(pcib_write_config, pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, pcib_map_msi),
+
+ {0, 0}
+};
+
+static devclass_t pcib_devclass;
+
+DEFINE_CLASS_0(pcib, pcibios_pcib_driver, pcibios_pcib_pci_methods,
+ sizeof(struct pcib_softc));
+DRIVER_MODULE(pcibios_pcib, pci, pcibios_pcib_driver, pcib_devclass, 0, 0);
+
+static int
+pcibios_pcib_probe(device_t dev)
+{
+ int bus;
+
+ if ((pci_get_class(dev) != PCIC_BRIDGE) ||
+ (pci_get_subclass(dev) != PCIS_BRIDGE_PCI))
+ return (ENXIO);
+ bus = pci_read_config(dev, PCIR_SECBUS_1, 1);
+ if (bus == 0)
+ return (ENXIO);
+ if (!pci_pir_probe(bus, 1))
+ return (ENXIO);
+ device_set_desc(dev, "PCIBIOS PCI-PCI bridge");
+ return (-2000);
+}
+
+static int
+pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
+{
+ return (pci_pir_route_interrupt(pci_get_bus(dev), pci_get_slot(dev),
+ pci_get_function(dev), pin));
+}
+#endif /* __rtems__ */
diff --git a/freebsd/sys/i386/i386/in_cksum.c b/freebsd/sys/i386/i386/in_cksum.c
index 0f663989..77102b14 100644
--- a/freebsd/sys/i386/i386/in_cksum.c
+++ b/freebsd/sys/i386/i386/in_cksum.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -32,18 +32,18 @@
* from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
-#include <freebsd/machine/in_cksum.h>
+#include <machine/in_cksum.h>
/*
* Checksum routine for Internet Protocol family headers.
diff --git a/freebsd/sys/i386/i386/legacy.c b/freebsd/sys/i386/i386/legacy.c
index 24021809..2547990c 100644
--- a/freebsd/sys/i386/i386/legacy.c
+++ b/freebsd/sys/i386/i386/legacy.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright 1998 Massachusetts Institute of Technology
@@ -29,7 +29,7 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -37,27 +37,27 @@ __FBSDID("$FreeBSD$");
* support ACPI or when ACPI support is not present in the kernel.
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/cpu.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/machine/bus.h>
-#include <freebsd/sys/pcpu.h>
-#include <freebsd/sys/rman.h>
-#include <freebsd/sys/smp.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <machine/bus.h>
+#include <sys/pcpu.h>
+#include <sys/rman.h>
+#include <sys/smp.h>
#ifndef __rtems__
-#include <freebsd/local/opt_mca.h>
+#include <rtems/bsd/local/opt_mca.h>
#endif /* __rtems__ */
#ifdef DEV_MCA
-#include <freebsd/i386/bios/mca_machdep.h>
+#include <i386/bios/mca_machdep.h>
#endif
-#include <freebsd/machine/legacyvar.h>
-#include <freebsd/machine/resource.h>
+#include <machine/legacyvar.h>
+#include <machine/resource.h>
static MALLOC_DEFINE(M_LEGACYDEV, "legacydrv", "legacy system device");
struct legacy_device {
diff --git a/freebsd/sys/i386/include/machine/cpufunc.h b/freebsd/sys/i386/include/machine/cpufunc.h
index 093e38a4..fd8f2ddc 100644
--- a/freebsd/sys/i386/include/machine/cpufunc.h
+++ b/freebsd/sys/i386/include/machine/cpufunc.h
@@ -35,10 +35,10 @@
* used in preference to this.
*/
-#ifndef _MACHINE_CPUFUNC_HH_
-#define _MACHINE_CPUFUNC_HH_
+#ifndef _MACHINE_CPUFUNC_H_
+#define _MACHINE_CPUFUNC_H_
-#ifndef _SYS_CDEFS_HH_
+#ifndef _SYS_CDEFS_H_
#error this file needs sys/cdefs.h as a prerequisite
#endif
@@ -758,4 +758,4 @@ int rdmsr_safe(u_int msr, uint64_t *val);
int wrmsr_safe(u_int msr, uint64_t newval);
#endif
-#endif /* !_MACHINE_CPUFUNC_HH_ */
+#endif /* !_MACHINE_CPUFUNC_H_ */
diff --git a/freebsd/sys/i386/include/machine/in_cksum.h b/freebsd/sys/i386/include/machine/in_cksum.h
index c121f46d..c692f69a 100644
--- a/freebsd/sys/i386/include/machine/in_cksum.h
+++ b/freebsd/sys/i386/include/machine/in_cksum.h
@@ -25,147 +25,118 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- */
-/*-
- * Copyright (c) 2001 by Thomas Moestl <tmm@FreeBSD.org>.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
- * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* from tahoe: in_cksum.c 1.2 86/01/05
* from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91
* from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp
- * from: FreeBSD: src/sys/alpha/include/in_cksum.h,v 1.5 2000/05/06
- *
* $FreeBSD$
*/
-#ifndef _MACHINE_IN_CKSUM_HH_
-#define _MACHINE_IN_CKSUM_HH_ 1
+#ifndef _MACHINE_IN_CKSUM_H_
+#define _MACHINE_IN_CKSUM_H_ 1
+
+#ifndef _SYS_CDEFS_H_
+#error this file needs sys/cdefs.h as a prerequisite
+#endif
+
+/*
+ * MP safe (alfred)
+ */
+
+#include <sys/cdefs.h>
-#include <freebsd/sys/cdefs.h>
+#define in_cksum(m, len) in_cksum_skip(m, len, 0)
-#define in_cksum(m, len) in_cksum_skip(m, len, 0)
+/*
+ * It it useful to have an Internet checksum routine which is inlineable
+ * and optimized specifically for the task of computing IP header checksums
+ * in the normal case (where there are no options and the header length is
+ * therefore always exactly five 32-bit words.
+ */
+#if defined(__GNUCLIKE_ASM) && !defined(__INTEL_COMPILER)
+static __inline u_int
+in_cksum_hdr(const struct ip *ip)
+{
+ u_int sum = 0;
+
+ __asm(
+ "addl %1, %0\n"
+ "adcl %2, %0\n"
+ "adcl %3, %0\n"
+ "adcl %4, %0\n"
+ "adcl %5, %0\n"
+ "adcl $0, %0"
+ : "+r" (sum)
+ : "g" (((const u_int32_t *)ip)[0]),
+ "g" (((const u_int32_t *)ip)[1]),
+ "g" (((const u_int32_t *)ip)[2]),
+ "g" (((const u_int32_t *)ip)[3]),
+ "g" (((const u_int32_t *)ip)[4])
+ : "cc"
+ );
+ sum = (sum & 0xffff) + (sum >> 16);
+ if (sum > 0xffff)
+ sum -= 0xffff;
+
+ return ~sum & 0xffff;
+}
static __inline void
in_cksum_update(struct ip *ip)
{
- int __tmp;
-
- __tmp = (int)ip->ip_sum + 1;
- ip->ip_sum = __tmp + (__tmp >> 16);
+ int __tmpsum;
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256;
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16));
}
static __inline u_short
in_addword(u_short sum, u_short b)
{
- u_long __ret, __tmp;
-
__asm(
- "sll %2, 16, %0\n"
- "sll %3, 16, %1\n"
- "addcc %0, %1, %0\n"
- "srl %0, 16, %0\n"
- "addc %0, 0, %0\n"
- : "=&r" (__ret), "=&r" (__tmp) : "r" (sum), "r" (b) : "cc");
- return (__ret);
+ "addw %1, %0\n"
+ "adcw $0, %0"
+ : "+r" (sum)
+ : "g" (b)
+ : "cc"
+ );
+ return (sum);
}
static __inline u_short
in_pseudo(u_int sum, u_int b, u_int c)
{
- u_long __tmp;
-
__asm(
- "addcc %0, %3, %0\n"
- "addccc %0, %4, %0\n"
- "addc %0, 0, %0\n"
- "sll %0, 16, %1\n"
- "addcc %0, %1, %0\n"
- "srl %0, 16, %0\n"
- "addc %0, 0, %0\n"
- : "=r" (sum), "=&r" (__tmp) : "0" (sum), "r" (b), "r" (c) : "cc");
+ "addl %1, %0\n"
+ "adcl %2, %0\n"
+ "adcl $0, %0"
+ : "+r" (sum)
+ : "g" (b),
+ "g" (c)
+ : "cc"
+ );
+ sum = (sum & 0xffff) + (sum >> 16);
+ if (sum > 0xffff)
+ sum -= 0xffff;
return (sum);
}
-static __inline u_int
-in_cksum_hdr(struct ip *ip)
-{
- u_long __ret, __tmp1, __tmp2, __tmp3, __tmp4;
+#else
+#define in_cksum_update(ip) \
+ do { \
+ int __tmpsum; \
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256; \
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \
+ } while(0)
- /*
- * Use 32-bit memory accesses and additions - addition with carry only
- * works for 32 bits, and fixing up alignment issues for 64 is probably
- * more trouble than it's worth.
- * This may read outside of the ip header, but does not cross a page
- * boundary in doing so, so that should be OK.
- * Actually, this specialized implementation might be overkill - using
- * a generic implementation for both in_cksum_skip and in_cksum_hdr
- * should not be too much more expensive.
- */
-#define __LD_ADD(addr, tmp, sum, offs, mod) \
- "lduw [" #addr " + " #offs "], " #tmp "\n" \
- "add" # mod " " #sum ", " #tmp ", " #sum "\n"
-
- __asm(
- "and %5, 3, %3\n"
- "andn %5, 3, %1\n"
- "brz,pt %3, 0f\n"
- " lduw [%1], %0\n"
- "mov 4, %4\n"
- "sub %4, %3, %4\n"
- "sll %4, 3, %4\n" /* fix up unaligned buffers */
- "mov 1, %2\n"
- "sll %2, %4, %4\n"
- "sub %4, 1, %4\n"
- "lduw [%1 + 20], %2\n"
- "andn %2, %4, %2\n"
- "and %0, %4, %0\n"
- "or %0, %2, %0\n"
- "0:\n"
- __LD_ADD(%1, %2, %0, 4, cc)
- __LD_ADD(%1, %2, %0, 8, ccc)
- __LD_ADD(%1, %2, %0, 12, ccc)
- __LD_ADD(%1, %2, %0, 16, ccc)
- "addc %0, 0, %0\n" /* reduce */
- "1:\n"
- "sll %0, 16, %2\n"
- "addcc %0, %2, %0\n"
- "srl %0, 16, %0\n"
- "addc %0, 0, %0\n"
- "andcc %3, 1, %3\n" /* need to byte-swap? */
- "clr %3\n"
- "bne,a,pn %%xcc, 1b\n"
- " sll %0, 8, %0\n"
- "not %0\n"
- "sll %0, 16, %0\n"
- "srl %0, 16, %0\n"
- : "=&r" (__ret), "=r" (__tmp1), "=&r" (__tmp2), "=&r" (__tmp3),
- "=&r" (__tmp4) : "1" (ip) : "cc");
-#undef __LD_ADD
- return (__ret);
-}
+#endif
#ifdef _KERNEL
-u_short in_cksum_skip(struct mbuf *m, int len, int skip);
+#if !defined(__GNUCLIKE_ASM) || defined(__INTEL_COMPILER)
+u_int in_cksum_hdr(const struct ip *ip);
+u_short in_addword(u_short sum, u_short b);
+u_short in_pseudo(u_int sum, u_int b, u_int c);
#endif
+u_short in_cksum_skip(struct mbuf *m, int len, int skip);
+#endif /* _KERNEL */
-#endif /* _MACHINE_IN_CKSUM_HH_ */
+#endif /* _MACHINE_IN_CKSUM_H_ */
diff --git a/freebsd/sys/i386/include/machine/legacyvar.h b/freebsd/sys/i386/include/machine/legacyvar.h
new file mode 100644
index 00000000..0b0fa433
--- /dev/null
+++ b/freebsd/sys/i386/include/machine/legacyvar.h
@@ -0,0 +1,57 @@
+/*-
+ * Copyright (c) 2000 Peter Wemm <peter@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_LEGACYVAR_H_
+#define _MACHINE_LEGACYVAR_H_
+
+enum legacy_device_ivars {
+ LEGACY_IVAR_PCIDOMAIN,
+ LEGACY_IVAR_PCIBUS
+};
+
+#define LEGACY_ACCESSOR(var, ivar, type) \
+ __BUS_ACCESSOR(legacy, var, LEGACY, ivar, type)
+
+LEGACY_ACCESSOR(pcidomain, PCIDOMAIN, uint32_t)
+LEGACY_ACCESSOR(pcibus, PCIBUS, uint32_t)
+
+#undef LEGACY_ACCESSOR
+
+int legacy_pcib_maxslots(device_t dev);
+uint32_t legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes);
+int legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result);
+void legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes);
+int legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value);
+struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child,
+ int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
+
+#endif /* !_MACHINE_LEGACYVAR_H_ */
diff --git a/freebsd/sys/i386/include/machine/md_var.h b/freebsd/sys/i386/include/machine/md_var.h
index 43bd0491..168ee629 100644
--- a/freebsd/sys/i386/include/machine/md_var.h
+++ b/freebsd/sys/i386/include/machine/md_var.h
@@ -29,8 +29,8 @@
* $FreeBSD$
*/
-#ifndef _MACHINE_MD_VAR_HH_
-#define _MACHINE_MD_VAR_HH_
+#ifndef _MACHINE_MD_VAR_H_
+#define _MACHINE_MD_VAR_H_
/*
* Miscellaneous machine-dependent declarations.
@@ -103,4 +103,4 @@ void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec);
int user_dbreg_trap(void);
void minidumpsys(struct dumperinfo *);
-#endif /* !_MACHINE_MD_VAR_HH_ */
+#endif /* !_MACHINE_MD_VAR_H_ */
diff --git a/freebsd/sys/i386/include/machine/pci_cfgreg.h b/freebsd/sys/i386/include/machine/pci_cfgreg.h
new file mode 100644
index 00000000..bc72418d
--- /dev/null
+++ b/freebsd/sys/i386/include/machine/pci_cfgreg.h
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
+ */
+
+#define CONF1_ADDR_PORT 0x0cf8
+#define CONF1_DATA_PORT 0x0cfc
+
+#define CONF1_ENABLE 0x80000000ul
+#define CONF1_ENABLE_CHK 0x80000000ul
+#define CONF1_ENABLE_MSK 0x7f000000ul
+#define CONF1_ENABLE_CHK1 0xff000001ul
+#define CONF1_ENABLE_MSK1 0x80000001ul
+#define CONF1_ENABLE_RES1 0x80000000ul
+
+#define CONF2_ENABLE_PORT 0x0cf8
+#define CONF2_FORWARD_PORT 0x0cfa
+
+#define CONF2_ENABLE_CHK 0x0e
+#define CONF2_ENABLE_RES 0x0e
+
+int pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus);
+int pci_cfgregopen(void);
+u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes);
+void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes);
+void pci_pir_open(void);
+int pci_pir_probe(int bus, int require_parse);
+int pci_pir_route_interrupt(int bus, int device, int func, int pin);
diff --git a/freebsd/sys/i386/include/machine/specialreg.h b/freebsd/sys/i386/include/machine/specialreg.h
index 4cbd0ec2..823f2ec3 100644
--- a/freebsd/sys/i386/include/machine/specialreg.h
+++ b/freebsd/sys/i386/include/machine/specialreg.h
@@ -30,8 +30,8 @@
* $FreeBSD$
*/
-#ifndef _MACHINE_SPECIALREG_HH_
-#define _MACHINE_SPECIALREG_HH_
+#ifndef _MACHINE_SPECIALREG_H_
+#define _MACHINE_SPECIALREG_H_
/*
* Bits in 386 special registers:
@@ -593,4 +593,4 @@
#define VIA_CRYPT_CWLO_KEY192 0x0000040c /* 192bit, 12 rds */
#define VIA_CRYPT_CWLO_KEY256 0x0000080e /* 256bit, 15 rds */
-#endif /* !_MACHINE_SPECIALREG_HH_ */
+#endif /* !_MACHINE_SPECIALREG_H_ */
diff --git a/freebsd/sys/i386/pci/pci_bus.c b/freebsd/sys/i386/pci/pci_bus.c
new file mode 100644
index 00000000..6627db98
--- /dev/null
+++ b/freebsd/sys/i386/pci/pci_bus.c
@@ -0,0 +1,729 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/local/opt_cpu.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
+
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcib_private.h>
+#include <isa/isavar.h>
+#ifdef CPU_ELAN
+#include <machine/md_var.h>
+#endif
+#include <machine/legacyvar.h>
+#include <machine/pci_cfgreg.h>
+#include <machine/resource.h>
+
+#include <rtems/bsd/local/pcib_if.h>
+
+#ifndef __rtems__
+static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev,
+ int pin);
+#else /* __rtems__ */
+int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin);
+#endif /* __rtems__ */
+
+
+int
+legacy_pcib_maxslots(device_t dev)
+{
+ return 31;
+}
+
+/* read configuration space register */
+
+#ifdef __rtems__
+uint32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#else
+u_int32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#endif
+{
+ return(pci_cfgregread(bus, slot, func, reg, bytes));
+}
+
+/* write configuration space register */
+
+void
+legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes)
+{
+ pci_cfgregwrite(bus, slot, func, reg, data, bytes);
+}
+
+/* Pass MSI requests up to the nexus. */
+
+static int
+legacy_pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount,
+ int *irqs)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSI(device_get_parent(bus), dev, count, maxcount,
+ irqs));
+}
+
+static int
+legacy_pcib_alloc_msix(device_t pcib, device_t dev, int *irq)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq));
+}
+
+static int
+legacy_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr,
+ uint32_t *data)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data));
+}
+
+static const char *
+legacy_pcib_is_host_bridge(int bus, int slot, int func,
+ uint32_t id, uint8_t class, uint8_t subclass,
+ uint8_t *busnum)
+{
+ const char *s = NULL;
+ static uint8_t pxb[4]; /* hack for 450nx */
+
+ *busnum = 0;
+
+ switch (id) {
+ case 0x12258086:
+ s = "Intel 824?? host to PCI bridge";
+ /* XXX This is a guess */
+ /* *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x41, 1); */
+ *busnum = bus;
+ break;
+ case 0x71208086:
+ s = "Intel 82810 (i810 GMCH) Host To Hub bridge";
+ break;
+ case 0x71228086:
+ s = "Intel 82810-DC100 (i810-DC100 GMCH) Host To Hub bridge";
+ break;
+ case 0x71248086:
+ s = "Intel 82810E (i810E GMCH) Host To Hub bridge";
+ break;
+ case 0x11308086:
+ s = "Intel 82815 (i815 GMCH) Host To Hub bridge";
+ break;
+ case 0x71808086:
+ s = "Intel 82443LX (440 LX) host to PCI bridge";
+ break;
+ case 0x71908086:
+ s = "Intel 82443BX (440 BX) host to PCI bridge";
+ break;
+ case 0x71928086:
+ s = "Intel 82443BX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x71948086:
+ s = "Intel 82443MX host to PCI bridge";
+ break;
+ case 0x71a08086:
+ s = "Intel 82443GX host to PCI bridge";
+ break;
+ case 0x71a18086:
+ s = "Intel 82443GX host to AGP bridge";
+ break;
+ case 0x71a28086:
+ s = "Intel 82443GX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x84c48086:
+ s = "Intel 82454KX/GX (Orion) host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x4a, 1);
+ break;
+ case 0x84ca8086:
+ /*
+ * For the 450nx chipset, there is a whole bundle of
+ * things pretending to be host bridges. The MIOC will
+ * be seen first and isn't really a pci bridge (the
+ * actual busses are attached to the PXB's). We need to
+ * read the registers of the MIOC to figure out the
+ * bus numbers for the PXB channels.
+ *
+ * Since the MIOC doesn't have a pci bus attached, we
+ * pretend it wasn't there.
+ */
+ pxb[0] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd0, 1); /* BUSNO[0] */
+ pxb[1] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd1, 1) + 1; /* SUBA[0]+1 */
+ pxb[2] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd3, 1); /* BUSNO[1] */
+ pxb[3] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd4, 1) + 1; /* SUBA[1]+1 */
+ return NULL;
+ case 0x84cb8086:
+ switch (slot) {
+ case 0x12:
+ s = "Intel 82454NX PXB#0, Bus#A";
+ *busnum = pxb[0];
+ break;
+ case 0x13:
+ s = "Intel 82454NX PXB#0, Bus#B";
+ *busnum = pxb[1];
+ break;
+ case 0x14:
+ s = "Intel 82454NX PXB#1, Bus#A";
+ *busnum = pxb[2];
+ break;
+ case 0x15:
+ s = "Intel 82454NX PXB#1, Bus#B";
+ *busnum = pxb[3];
+ break;
+ }
+ break;
+ case 0x1A308086:
+ s = "Intel 82845 Host to PCI bridge";
+ break;
+
+ /* AMD -- vendor 0x1022 */
+ case 0x30001022:
+ s = "AMD Elan SC520 host to PCI bridge";
+#ifdef CPU_ELAN
+ init_AMD_Elan_sc520();
+#else
+ printf(
+"*** WARNING: missing CPU_ELAN -- timekeeping may be wrong\n");
+#endif
+ break;
+ case 0x70061022:
+ s = "AMD-751 host to PCI bridge";
+ break;
+ case 0x700e1022:
+ s = "AMD-761 host to PCI bridge";
+ break;
+
+ /* SiS -- vendor 0x1039 */
+ case 0x04961039:
+ s = "SiS 85c496";
+ break;
+ case 0x04061039:
+ s = "SiS 85c501";
+ break;
+ case 0x06011039:
+ s = "SiS 85c601";
+ break;
+ case 0x55911039:
+ s = "SiS 5591 host to PCI bridge";
+ break;
+ case 0x00011039:
+ s = "SiS 5591 host to AGP bridge";
+ break;
+
+ /* VLSI -- vendor 0x1004 */
+ case 0x00051004:
+ s = "VLSI 82C592 Host to PCI bridge";
+ break;
+
+ /* XXX Here is MVP3, I got the datasheet but NO M/B to test it */
+ /* totally. Please let me know if anything wrong. -F */
+ /* XXX need info on the MVP3 -- any takers? */
+ case 0x05981106:
+ s = "VIA 82C598MVP (Apollo MVP3) host bridge";
+ break;
+
+ /* AcerLabs -- vendor 0x10b9 */
+ /* Funny : The datasheet told me vendor id is "10b8",sub-vendor */
+ /* id is '10b9" but the register always shows "10b9". -Foxfair */
+ case 0x154110b9:
+ s = "AcerLabs M1541 (Aladdin-V) PCI host bridge";
+ break;
+
+ /* OPTi -- vendor 0x1045 */
+ case 0xc7011045:
+ s = "OPTi 82C700 host to PCI bridge";
+ break;
+ case 0xc8221045:
+ s = "OPTi 82C822 host to PCI Bridge";
+ break;
+
+ /* ServerWorks -- vendor 0x1166 */
+ case 0x00051166:
+ s = "ServerWorks NB6536 2.0HE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00061166:
+ /* FALLTHROUGH */
+ case 0x00081166:
+ /* FALLTHROUGH */
+ case 0x02011166:
+ /* FALLTHROUGH */
+ case 0x010f1014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00091166:
+ s = "ServerWorks NB6635 3.0LE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00101166:
+ s = "ServerWorks CIOB30 host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00111166:
+ /* FALLTHROUGH */
+ case 0x03021014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks CMIC-HE host to PCI-X bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* XXX unknown chipset, but working */
+ case 0x00171166:
+ /* FALLTHROUGH */
+ case 0x01011166:
+ case 0x01101166:
+ case 0x02251166:
+ s = "ServerWorks host to PCI bridge(unknown chipset)";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* Compaq/HP -- vendor 0x0e11 */
+ case 0x60100e11:
+ s = "Compaq/HP Model 6010 HotPlug PCI Bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0xc8, 1);
+ break;
+
+ /* Integrated Micro Solutions -- vendor 0x10e0 */
+ case 0x884910e0:
+ s = "Integrated Micro Solutions VL Bridge";
+ break;
+
+ default:
+ if (class == PCIC_BRIDGE && subclass == PCIS_BRIDGE_HOST)
+ s = "Host to PCI bridge";
+ break;
+ }
+
+ return s;
+}
+
+/*
+ * Scan the first pci bus for host-pci bridges and add pcib instances
+ * to the nexus for each bridge.
+ */
+static void
+legacy_pcib_identify(driver_t *driver, device_t parent)
+{
+ int bus, slot, func;
+ u_int8_t hdrtype;
+ int found = 0;
+ int pcifunchigh;
+ int found824xx = 0;
+ int found_orion = 0;
+ device_t child;
+ devclass_t pci_devclass;
+
+ if (pci_cfgregopen() == 0)
+ return;
+ /*
+ * Check to see if we haven't already had a PCI bus added
+ * via some other means. If we have, bail since otherwise
+ * we're going to end up duplicating it.
+ */
+ if ((pci_devclass = devclass_find("pci")) &&
+ devclass_get_device(pci_devclass, 0))
+ return;
+
+
+ bus = 0;
+ retry:
+ for (slot = 0; slot <= PCI_SLOTMAX; slot++) {
+ func = 0;
+ hdrtype = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_HDRTYPE, 1);
+ /*
+ * When enumerating bus devices, the standard says that
+ * one should check the header type and ignore the slots whose
+ * header types that the software doesn't know about. We use
+ * this to filter out devices.
+ */
+ if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE)
+ continue;
+ if ((hdrtype & PCIM_MFDEV) &&
+ (!found_orion || hdrtype != 0xff))
+ pcifunchigh = PCI_FUNCMAX;
+ else
+ pcifunchigh = 0;
+ for (func = 0; func <= pcifunchigh; func++) {
+ /*
+ * Read the IDs and class from the device.
+ */
+ u_int32_t id;
+ u_int8_t class, subclass, busnum;
+ const char *s;
+ device_t *devs;
+ int ndevs, i;
+
+ id = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_DEVVENDOR, 4);
+ if (id == -1)
+ continue;
+ class = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_CLASS, 1);
+ subclass = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_SUBCLASS, 1);
+
+ s = legacy_pcib_is_host_bridge(bus, slot, func,
+ id, class, subclass,
+ &busnum);
+ if (s == NULL)
+ continue;
+
+ /*
+ * Check to see if the physical bus has already
+ * been seen. Eg: hybrid 32 and 64 bit host
+ * bridges to the same logical bus.
+ */
+ if (device_get_children(parent, &devs, &ndevs) == 0) {
+ for (i = 0; s != NULL && i < ndevs; i++) {
+ if (strcmp(device_get_name(devs[i]),
+ "pcib") != 0)
+ continue;
+ if (legacy_get_pcibus(devs[i]) == busnum)
+ s = NULL;
+ }
+ free(devs, M_TEMP);
+ }
+
+ if (s == NULL)
+ continue;
+ /*
+ * Add at priority 100 to make sure we
+ * go after any motherboard resources
+ */
+ child = BUS_ADD_CHILD(parent, 100,
+ "pcib", busnum);
+ device_set_desc(child, s);
+ legacy_set_pcibus(child, busnum);
+
+ found = 1;
+ if (id == 0x12258086)
+ found824xx = 1;
+ if (id == 0x84c48086)
+ found_orion = 1;
+ }
+ }
+ if (found824xx && bus == 0) {
+ bus++;
+ goto retry;
+ }
+
+ /*
+ * Make sure we add at least one bridge since some old
+ * hardware doesn't actually have a host-pci bridge device.
+ * Note that pci_cfgregopen() thinks we have PCI devices..
+ */
+ if (!found) {
+ if (bootverbose)
+ printf(
+ "legacy_pcib_identify: no bridge found, adding pcib0 anyway\n");
+ child = BUS_ADD_CHILD(parent, 100, "pcib", 0);
+ legacy_set_pcibus(child, 0);
+ }
+}
+
+static int
+legacy_pcib_probe(device_t dev)
+{
+
+ if (pci_cfgregopen() == 0)
+ return ENXIO;
+ return -100;
+}
+
+static int
+legacy_pcib_attach(device_t dev)
+{
+ device_t pir;
+ int bus;
+
+ /*
+ * Look for a PCI BIOS interrupt routing table as that will be
+ * our method of routing interrupts if we have one.
+ */
+ bus = pcib_get_bus(dev);
+#ifndef __rtems__
+ if (pci_pir_probe(bus, 0)) {
+ pir = BUS_ADD_CHILD(device_get_parent(dev), 0, "pir", 0);
+ if (pir != NULL)
+ device_probe_and_attach(pir);
+ }
+#else /* __rtems__ */
+#endif /* __rtems__ */
+ device_add_child(dev, "pci", bus);
+ return bus_generic_attach(dev);
+}
+
+int
+legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ *result = 0;
+ return 0;
+ case PCIB_IVAR_BUS:
+ *result = legacy_get_pcibus(dev);
+ return 0;
+ }
+ return ENOENT;
+}
+
+int
+legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ return EINVAL;
+ case PCIB_IVAR_BUS:
+ legacy_set_pcibus(dev, value);
+ return 0;
+ }
+ return ENOENT;
+}
+
+SYSCTL_DECL(_hw_pci);
+
+static unsigned long legacy_host_mem_start = 0x80000000;
+TUNABLE_ULONG("hw.pci.host_mem_start", &legacy_host_mem_start);
+SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN,
+ &legacy_host_mem_start, 0x80000000,
+ "Limit the host bridge memory to being above this address. Must be\n\
+set at boot via a tunable.");
+
+struct resource *
+legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
+ u_long start, u_long end, u_long count, u_int flags)
+{
+ /*
+ * If no memory preference is given, use upper 32MB slot most
+ * bioses use for their memory window. Typically other bridges
+ * before us get in the way to assert their preferences on memory.
+ * Hardcoding like this sucks, so a more MD/MI way needs to be
+ * found to do it. This is typically only used on older laptops
+ * that don't have pci busses behind pci bridge, so assuming > 32MB
+ * is liekly OK.
+ *
+ * However, this can cause problems for other chipsets, so we make
+ * this tunable by hw.pci.host_mem_start.
+ */
+ if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL)
+ start = legacy_host_mem_start;
+ if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL)
+ start = 0x1000;
+ return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
+ count, flags));
+}
+
+static device_method_t legacy_pcib_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, legacy_pcib_identify),
+ DEVMETHOD(device_probe, legacy_pcib_probe),
+ DEVMETHOD(device_attach, legacy_pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, legacy_pcib_maxslots),
+ DEVMETHOD(pcib_read_config, legacy_pcib_read_config),
+ DEVMETHOD(pcib_write_config, legacy_pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, legacy_pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, legacy_pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, legacy_pcib_map_msi),
+
+ { 0, 0 }
+};
+
+static devclass_t hostb_devclass;
+
+DEFINE_CLASS_0(pcib, legacy_pcib_driver, legacy_pcib_methods, 1);
+DRIVER_MODULE(pcib, legacy, legacy_pcib_driver, hostb_devclass, 0, 0);
+
+
+#ifndef __rtems__
+/*
+ * Install placeholder to claim the resources owned by the
+ * PCI bus interface. This could be used to extract the
+ * config space registers in the extreme case where the PnP
+ * ID is available and the PCI BIOS isn't, but for now we just
+ * eat the PnP ID and do nothing else.
+ *
+ * XXX we should silence this probe, as it will generally confuse
+ * people.
+ */
+static struct isa_pnp_id pcibus_pnp_ids[] = {
+ { 0x030ad041 /* PNP0A03 */, "PCI Bus" },
+ { 0x080ad041 /* PNP0A08 */, "PCIe Bus" },
+ { 0 }
+};
+
+static int
+pcibus_pnp_probe(device_t dev)
+{
+ int result;
+
+ if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, pcibus_pnp_ids)) <= 0)
+ device_quiet(dev);
+ return(result);
+}
+
+static int
+pcibus_pnp_attach(device_t dev)
+{
+ return(0);
+}
+
+static device_method_t pcibus_pnp_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibus_pnp_probe),
+ DEVMETHOD(device_attach, pcibus_pnp_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+ { 0, 0 }
+};
+
+static devclass_t pcibus_pnp_devclass;
+
+DEFINE_CLASS_0(pcibus_pnp, pcibus_pnp_driver, pcibus_pnp_methods, 1);
+DRIVER_MODULE(pcibus_pnp, isa, pcibus_pnp_driver, pcibus_pnp_devclass, 0, 0);
+
+
+/*
+ * Provide a PCI-PCI bridge driver for PCI busses behind PCI-PCI bridges
+ * that appear in the PCIBIOS Interrupt Routing Table to use the routing
+ * table for interrupt routing when possible.
+ */
+static int pcibios_pcib_probe(device_t bus);
+
+static device_method_t pcibios_pcib_pci_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibios_pcib_probe),
+ DEVMETHOD(device_attach, pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, pcib_maxslots),
+ DEVMETHOD(pcib_read_config, pcib_read_config),
+ DEVMETHOD(pcib_write_config, pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, pcib_map_msi),
+
+ {0, 0}
+};
+
+static devclass_t pcib_devclass;
+
+DEFINE_CLASS_0(pcib, pcibios_pcib_driver, pcibios_pcib_pci_methods,
+ sizeof(struct pcib_softc));
+DRIVER_MODULE(pcibios_pcib, pci, pcibios_pcib_driver, pcib_devclass, 0, 0);
+
+static int
+pcibios_pcib_probe(device_t dev)
+{
+ int bus;
+
+ if ((pci_get_class(dev) != PCIC_BRIDGE) ||
+ (pci_get_subclass(dev) != PCIS_BRIDGE_PCI))
+ return (ENXIO);
+ bus = pci_read_config(dev, PCIR_SECBUS_1, 1);
+ if (bus == 0)
+ return (ENXIO);
+ if (!pci_pir_probe(bus, 1))
+ return (ENXIO);
+ device_set_desc(dev, "PCIBIOS PCI-PCI bridge");
+ return (-2000);
+}
+
+static int
+pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
+{
+ return (pci_pir_route_interrupt(pci_get_bus(dev), pci_get_slot(dev),
+ pci_get_function(dev), pin));
+}
+#endif /* __rtems__ */
diff --git a/freebsd/sys/ioccom.h b/freebsd/sys/ioccom.h
deleted file mode 100644
index b8c9921e..00000000
--- a/freebsd/sys/ioccom.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)ioccom.h 8.2 (Berkeley) 3/28/94
- * $FreeBSD$
- */
-
-#ifndef _SYS_IOCCOM_HH_
-#define _SYS_IOCCOM_HH_
-
-/*
- * Ioctl's have the command encoded in the lower word, and the size of
- * any in or out parameters in the upper word. The high 3 bits of the
- * upper word are used to encode the in/out status of the parameter.
- */
-#define IOCPARM_SHIFT 13 /* number of bits for ioctl size */
-#define IOCPARM_MASK ((1 << IOCPARM_SHIFT) - 1) /* parameter length mask */
-#define IOCPARM_LEN(x) (((x) >> 16) & IOCPARM_MASK)
-#define IOCBASECMD(x) ((x) & ~(IOCPARM_MASK << 16))
-#define IOCGROUP(x) (((x) >> 8) & 0xff)
-
-#define IOCPARM_MAX (1 << IOCPARM_SHIFT) /* max size of ioctl */
-#define IOC_VOID 0x20000000 /* no parameters */
-#define IOC_OUT 0x40000000 /* copy out parameters */
-#define IOC_IN 0x80000000 /* copy in parameters */
-#define IOC_INOUT (IOC_IN|IOC_OUT)
-#define IOC_DIRMASK (IOC_VOID|IOC_OUT|IOC_IN)
-
-#define _IOC(inout,group,num,len) ((unsigned long) \
- ((inout) | (((len) & IOCPARM_MASK) << 16) | ((group) << 8) | (num)))
-#define _IO(g,n) _IOC(IOC_VOID, (g), (n), 0)
-#define _IOWINT(g,n) _IOC(IOC_VOID, (g), (n), sizeof(int))
-#define _IOR(g,n,t) _IOC(IOC_OUT, (g), (n), sizeof(t))
-#define _IOW(g,n,t) _IOC(IOC_IN, (g), (n), sizeof(t))
-/* this should be _IORW, but stdio got there first */
-#define _IOWR(g,n,t) _IOC(IOC_INOUT, (g), (n), sizeof(t))
-
-#ifdef _KERNEL
-
-#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
- defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
-#define IOCPARM_IVAL(x) ((int)(intptr_t)(void *)*(caddr_t *)(void *)(x))
-#endif
-
-#else
-
-#include <freebsd/sys/cdefs.h>
-
-__BEGIN_DECLS
-int ioctl(int, unsigned long, ...);
-__END_DECLS
-
-#endif
-
-#endif /* !_SYS_IOCCOM_HH_ */
diff --git a/freebsd/sys/isa/isavar.h b/freebsd/sys/isa/isavar.h
index c27961d2..cb20402c 100644
--- a/freebsd/sys/isa/isavar.h
+++ b/freebsd/sys/isa/isavar.h
@@ -26,17 +26,17 @@
* $FreeBSD$
*/
-#ifndef _ISA_ISAVAR_HH_
-#define _ISA_ISAVAR_HH_
+#ifndef _ISA_ISAVAR_H_
+#define _ISA_ISAVAR_H_
struct isa_config;
struct isa_pnp_id;
typedef void isa_config_cb(void *arg, struct isa_config *config, int enable);
#ifndef __rtems__
-#include <freebsd/local/isa_if.h>
+#include <rtems/bsd/local/isa_if.h>
#endif /* __rtems__ */
-#include <freebsd/isa/pnpvar.h>
+#include <isa/pnpvar.h>
#ifdef _KERNEL
@@ -189,7 +189,7 @@ void isa_hint_device_unit(device_t bus, device_t child, const char *name,
int isab_attach(device_t dev);
#ifdef PC98
-#include <freebsd/machine/bus.h>
+#include <machine/bus.h>
/*
* Allocate discontinuous resources for ISA bus.
@@ -203,4 +203,4 @@ isa_load_resourcev(struct resource *re, bus_addr_t *res, bus_size_t count);
#endif /* _KERNEL */
-#endif /* !_ISA_ISAVAR_HH_ */
+#endif /* !_ISA_ISAVAR_H_ */
diff --git a/freebsd/sys/isa/pnpvar.h b/freebsd/sys/isa/pnpvar.h
index 8636ee5e..291c8130 100644
--- a/freebsd/sys/isa/pnpvar.h
+++ b/freebsd/sys/isa/pnpvar.h
@@ -26,8 +26,8 @@
* $FreeBSD$
*/
-#ifndef _ISA_PNPVAR_HH_
-#define _ISA_PNPVAR_HH_
+#ifndef _ISA_PNPVAR_H_
+#define _ISA_PNPVAR_H_
#ifdef _KERNEL
@@ -63,4 +63,4 @@ void pnp_check_quirks(uint32_t vendor_id, uint32_t logical_id, int ldn,
#endif /* _KERNEL */
-#endif /* !_ISA_PNPVAR_HH_ */
+#endif /* !_ISA_PNPVAR_H_ */
diff --git a/freebsd/sys/kern/init_main.c b/freebsd/sys/kern/init_main.c
index 0225a246..aee02576 100644
--- a/freebsd/sys/kern/init_main.c
+++ b/freebsd/sys/kern/init_main.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1995 Terrence R. Lambert
@@ -43,53 +43,53 @@
* @(#)init_main.c 8.9 (Berkeley) 1/21/94
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_ddb.h>
-#include <freebsd/local/opt_init_path.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/exec.h>
-#include <freebsd/sys/file.h>
-#include <freebsd/sys/filedesc.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/ktr.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mount.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/syscallsubr.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/resourcevar.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/vnode.h>
-#include <freebsd/sys/sysent.h>
-#include <freebsd/sys/reboot.h>
-#include <freebsd/sys/sched.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/sysproto.h>
-#include <freebsd/sys/vmmeter.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/conf.h>
-#include <freebsd/sys/cpuset.h>
-
-#include <freebsd/machine/cpu.h>
-
-#include <freebsd/security/audit/audit.h>
-#include <freebsd/security/mac/mac_framework.h>
-
-#include <freebsd/vm/vm.h>
-#include <freebsd/vm/vm_param.h>
-#include <freebsd/vm/pmap.h>
-#include <freebsd/vm/vm_map.h>
-#include <freebsd/sys/copyright.h>
-
-#include <freebsd/ddb/ddb.h>
-#include <freebsd/ddb/db_sym.h>
+#include <rtems/bsd/local/opt_ddb.h>
+#include <rtems/bsd/local/opt_init_path.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/exec.h>
+#include <sys/file.h>
+#include <sys/filedesc.h>
+#include <sys/jail.h>
+#include <sys/ktr.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mount.h>
+#include <sys/mutex.h>
+#include <sys/syscallsubr.h>
+#include <sys/sysctl.h>
+#include <sys/proc.h>
+#include <sys/resourcevar.h>
+#include <sys/systm.h>
+#include <sys/signalvar.h>
+#include <sys/vnode.h>
+#include <sys/sysent.h>
+#include <sys/reboot.h>
+#include <sys/sched.h>
+#include <sys/sx.h>
+#include <sys/sysproto.h>
+#include <sys/vmmeter.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/malloc.h>
+#include <sys/conf.h>
+#include <sys/cpuset.h>
+
+#include <machine/cpu.h>
+
+#include <security/audit/audit.h>
+#include <security/mac/mac_framework.h>
+
+#include <vm/vm.h>
+#include <vm/vm_param.h>
+#include <vm/pmap.h>
+#include <vm/vm_map.h>
+#include <sys/copyright.h>
+
+#include <ddb/ddb.h>
+#include <ddb/db_sym.h>
void mi_startup(void); /* Should be elsewhere */
diff --git a/freebsd/sys/kern/kern_descrip.c b/freebsd/sys/kern/kern_descrip.c
index 0ba063f5..0a1f3954 100644
--- a/freebsd/sys/kern/kern_descrip.c
+++ b/freebsd/sys/kern/kern_descrip.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -36,55 +36,55 @@
* @(#)kern_descrip.c 8.6 (Berkeley) 4/19/94
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_compat.h>
-#include <freebsd/local/opt_ddb.h>
-#include <freebsd/local/opt_ktrace.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-
-#include <freebsd/sys/conf.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/fcntl.h>
-#include <freebsd/sys/file.h>
-#include <freebsd/sys/filedesc.h>
-#include <freebsd/sys/filio.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/limits.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mount.h>
-#include <freebsd/sys/mqueue.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/namei.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/resourcevar.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/stat.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/syscallsubr.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sysproto.h>
-#include <freebsd/sys/tty.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/user.h>
-#include <freebsd/sys/vnode.h>
+#include <rtems/bsd/local/opt_compat.h>
+#include <rtems/bsd/local/opt_ddb.h>
+#include <rtems/bsd/local/opt_ktrace.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+
+#include <sys/conf.h>
+#include <sys/domain.h>
+#include <sys/fcntl.h>
+#include <sys/file.h>
+#include <sys/filedesc.h>
+#include <sys/filio.h>
+#include <sys/jail.h>
+#include <sys/kernel.h>
+#include <sys/limits.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mount.h>
+#include <sys/mqueue.h>
+#include <sys/mutex.h>
+#include <sys/namei.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/protosw.h>
+#include <sys/resourcevar.h>
+#include <sys/signalvar.h>
+#include <sys/socketvar.h>
+#include <sys/stat.h>
+#include <sys/sx.h>
+#include <sys/syscallsubr.h>
+#include <sys/sysctl.h>
+#include <sys/sysproto.h>
+#include <sys/tty.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/user.h>
+#include <sys/vnode.h>
#ifdef KTRACE
-#include <freebsd/sys/ktrace.h>
+#include <sys/ktrace.h>
#endif
-#include <freebsd/security/audit/audit.h>
+#include <security/audit/audit.h>
-#include <freebsd/vm/uma.h>
+#include <vm/uma.h>
-#include <freebsd/ddb/ddb.h>
+#include <ddb/ddb.h>
static MALLOC_DEFINE(M_FILEDESC, "filedesc", "Open file descriptor table");
static MALLOC_DEFINE(M_FILEDESC_TO_LEADER, "filedesc_to_leader",
@@ -267,7 +267,7 @@ fdunused(struct filedesc *fdp, int fd)
/*
* System calls on descriptors.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct getdtablesize_args {
int dummy;
};
@@ -291,7 +291,7 @@ getdtablesize(struct thread *td, struct getdtablesize_args *uap)
* Note: keep in mind that a potential race condition exists when closing
* descriptors from a shared descriptor table (via rfork).
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct dup2_args {
u_int from;
u_int to;
@@ -309,7 +309,7 @@ dup2(struct thread *td, struct dup2_args *uap)
/*
* Duplicate a file descriptor.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct dup_args {
u_int fd;
};
@@ -325,7 +325,7 @@ dup(struct thread *td, struct dup_args *uap)
/*
* The file control system call.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct fcntl_args {
int fd;
int cmd;
@@ -1102,7 +1102,7 @@ fgetown(sigiop)
/*
* Close a file descriptor.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct close_args {
int fd;
};
@@ -1179,7 +1179,7 @@ kern_close(td, fd)
/*
* Close open file descriptors.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct closefrom_args {
int lowfd;
};
@@ -1216,7 +1216,7 @@ closefrom(struct thread *td, struct closefrom_args *uap)
/*
* Return status information about a file descriptor.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct ofstat_args {
int fd;
struct ostat *sb;
@@ -1242,7 +1242,7 @@ ofstat(struct thread *td, struct ofstat_args *uap)
/*
* Return status information about a file descriptor.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct fstat_args {
int fd;
struct stat *sb;
@@ -1286,7 +1286,7 @@ kern_fstat(struct thread *td, int fd, struct stat *sbp)
/*
* Return status information about a file descriptor.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct nfstat_args {
int fd;
struct nstat *sb;
@@ -1311,7 +1311,7 @@ nfstat(struct thread *td, struct nfstat_args *uap)
/*
* Return pathconf information about a file descriptor.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct fpathconf_args {
int fd;
int name;
@@ -2378,7 +2378,7 @@ _fdrop(struct file *fp, struct thread *td)
* Just attempt to get a record lock of the requested type on the entire file
* (l_whence = SEEK_SET, l_start = 0, l_len = 0).
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct flock_args {
int fd;
int how;
@@ -3422,8 +3422,6 @@ fdopen(struct cdev *dev, int mode, int type, struct thread *td)
{
/*
-#include <freebsd/machine/rtems-bsd-config.h>
-
/*-
* Copyright (c) 1982, 1986, 1989, 1991, 1993
* The Regents of the University of California. All rights reserved.
@@ -3460,55 +3458,55 @@ fdopen(struct cdev *dev, int mode, int type, struct thread *td)
* @(#)kern_descrip.c 8.6 (Berkeley) 4/19/94
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_compat.h>
-#include <freebsd/local/opt_ddb.h>
-#include <freebsd/local/opt_ktrace.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-
-#include <freebsd/sys/conf.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/fcntl.h>
-#include <freebsd/sys/file.h>
-#include <freebsd/sys/filedesc.h>
-#include <freebsd/sys/filio.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/limits.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mount.h>
-#include <freebsd/sys/mqueue.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/namei.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/resourcevar.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/stat.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/syscallsubr.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sysproto.h>
-#include <freebsd/sys/tty.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/user.h>
-#include <freebsd/sys/vnode.h>
+#include <rtems/bsd/local/opt_compat.h>
+#include <rtems/bsd/local/opt_ddb.h>
+#include <rtems/bsd/local/opt_ktrace.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+
+#include <sys/conf.h>
+#include <sys/domain.h>
+#include <sys/fcntl.h>
+#include <sys/file.h>
+#include <sys/filedesc.h>
+#include <sys/filio.h>
+#include <sys/jail.h>
+#include <sys/kernel.h>
+#include <sys/limits.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mount.h>
+#include <sys/mqueue.h>
+#include <sys/mutex.h>
+#include <sys/namei.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/protosw.h>
+#include <sys/resourcevar.h>
+#include <sys/signalvar.h>
+#include <sys/socketvar.h>
+#include <sys/stat.h>
+#include <sys/sx.h>
+#include <sys/syscallsubr.h>
+#include <sys/sysctl.h>
+#include <sys/sysproto.h>
+#include <sys/tty.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/user.h>
+#include <sys/vnode.h>
#ifdef KTRACE
-#include <freebsd/sys/ktrace.h>
+#include <sys/ktrace.h>
#endif
-#include <freebsd/security/audit/audit.h>
+#include <security/audit/audit.h>
-#include <freebsd/vm/uma.h>
+#include <vm/uma.h>
-#include <freebsd/ddb/ddb.h>
+#include <ddb/ddb.h>
static MALLOC_DEFINE(M_FILEDESC, "filedesc", "Open file descriptor table");
static MALLOC_DEFINE(M_FILEDESC_TO_LEADER, "filedesc_to_leader",
@@ -3691,7 +3689,7 @@ fdunused(struct filedesc *fdp, int fd)
/*
* System calls on descriptors.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct getdtablesize_args {
int dummy;
};
@@ -3715,7 +3713,7 @@ getdtablesize(struct thread *td, struct getdtablesize_args *uap)
* Note: keep in mind that a potential race condition exists when closing
* descriptors from a shared descriptor table (via rfork).
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct dup2_args {
u_int from;
u_int to;
@@ -3733,7 +3731,7 @@ dup2(struct thread *td, struct dup2_args *uap)
/*
* Duplicate a file descriptor.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct dup_args {
u_int fd;
};
@@ -3749,7 +3747,7 @@ dup(struct thread *td, struct dup_args *uap)
/*
* The file control system call.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct fcntl_args {
int fd;
int cmd;
@@ -4526,7 +4524,7 @@ fgetown(sigiop)
/*
* Close a file descriptor.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct close_args {
int fd;
};
@@ -4603,7 +4601,7 @@ kern_close(td, fd)
/*
* Close open file descriptors.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct closefrom_args {
int lowfd;
};
@@ -4640,7 +4638,7 @@ closefrom(struct thread *td, struct closefrom_args *uap)
/*
* Return status information about a file descriptor.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct ofstat_args {
int fd;
struct ostat *sb;
@@ -4666,7 +4664,7 @@ ofstat(struct thread *td, struct ofstat_args *uap)
/*
* Return status information about a file descriptor.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct fstat_args {
int fd;
struct stat *sb;
@@ -4710,7 +4708,7 @@ kern_fstat(struct thread *td, int fd, struct stat *sbp)
/*
* Return status information about a file descriptor.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct nfstat_args {
int fd;
struct nstat *sb;
@@ -4735,7 +4733,7 @@ nfstat(struct thread *td, struct nfstat_args *uap)
/*
* Return pathconf information about a file descriptor.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct fpathconf_args {
int fd;
int name;
@@ -5802,7 +5800,7 @@ _fdrop(struct file *fp, struct thread *td)
* Just attempt to get a record lock of the requested type on the entire file
* (l_whence = SEEK_SET, l_start = 0, l_len = 0).
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct flock_args {
int fd;
int how;
diff --git a/freebsd/sys/kern/kern_environment.c b/freebsd/sys/kern/kern_environment.c
index faee420d..14549ac1 100644
--- a/freebsd/sys/kern/kern_environment.c
+++ b/freebsd/sys/kern/kern_environment.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1998 Michael Smith
@@ -36,25 +36,25 @@
* the kernel.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/sysent.h>
-#include <freebsd/sys/sysproto.h>
-#include <freebsd/sys/libkern.h>
-#include <freebsd/sys/kenv.h>
-
-#include <freebsd/security/mac/mac_framework.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/proc.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mutex.h>
+#include <sys/priv.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
+#include <sys/sysent.h>
+#include <sys/sysproto.h>
+#include <sys/libkern.h>
+#include <sys/kenv.h>
+
+#include <security/mac/mac_framework.h>
static MALLOC_DEFINE(M_KENV, "kenv", "kernel environment");
diff --git a/freebsd/sys/kern/kern_event.c b/freebsd/sys/kern/kern_event.c
index 401f859e..439c22d3 100644
--- a/freebsd/sys/kern/kern_event.c
+++ b/freebsd/sys/kern/kern_event.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org>
@@ -28,46 +28,46 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_ktrace.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/file.h>
-#include <freebsd/sys/filedesc.h>
-#include <freebsd/sys/filio.h>
-#include <freebsd/sys/fcntl.h>
-#include <freebsd/sys/kthread.h>
-#include <freebsd/sys/selinfo.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/event.h>
-#include <freebsd/sys/eventvar.h>
-#include <freebsd/sys/poll.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/sigio.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/stat.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sysproto.h>
-#include <freebsd/sys/syscallsubr.h>
-#include <freebsd/sys/taskqueue.h>
-#include <freebsd/sys/uio.h>
+#include <rtems/bsd/local/opt_ktrace.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/proc.h>
+#include <sys/malloc.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/file.h>
+#include <sys/filedesc.h>
+#include <sys/filio.h>
+#include <sys/fcntl.h>
+#include <sys/kthread.h>
+#include <sys/selinfo.h>
+#include <sys/queue.h>
+#include <sys/event.h>
+#include <sys/eventvar.h>
+#include <sys/poll.h>
+#include <sys/protosw.h>
+#include <sys/sigio.h>
+#include <sys/signalvar.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/stat.h>
+#include <sys/sysctl.h>
+#include <sys/sysproto.h>
+#include <sys/syscallsubr.h>
+#include <sys/taskqueue.h>
+#include <sys/uio.h>
#ifdef KTRACE
-#include <freebsd/sys/ktrace.h>
+#include <sys/ktrace.h>
#endif
#ifndef __rtems__
-##include <freebsd/vm/uma.h>
+##include <vm/uma.h>
#endif /* __rtems__ */
static MALLOC_DEFINE(M_KQUEUE, "kqueue", "memory for kqueue system");
@@ -702,7 +702,7 @@ done2:
return (error);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct kevent_args {
int fd;
const struct kevent *changelist;
diff --git a/freebsd/sys/kern/kern_intr.c b/freebsd/sys/kern/kern_intr.c
index 982d5e82..bc252c13 100644
--- a/freebsd/sys/kern/kern_intr.c
+++ b/freebsd/sys/kern/kern_intr.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1997, Stefan Esser <se@freebsd.org>
@@ -26,41 +26,41 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_ddb.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/conf.h>
-#include <freebsd/sys/cpuset.h>
-#include <freebsd/sys/rtprio.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/interrupt.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/kthread.h>
-#include <freebsd/sys/ktr.h>
-#include <freebsd/sys/limits.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/random.h>
-#include <freebsd/sys/resourcevar.h>
-#include <freebsd/sys/sched.h>
-#include <freebsd/sys/smp.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/vmmeter.h>
-#include <freebsd/machine/atomic.h>
-#include <freebsd/machine/cpu.h>
+#include <rtems/bsd/local/opt_ddb.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/bus.h>
+#include <sys/conf.h>
+#include <sys/cpuset.h>
+#include <sys/rtprio.h>
+#include <sys/systm.h>
+#include <sys/interrupt.h>
+#include <sys/kernel.h>
+#include <sys/kthread.h>
+#include <sys/ktr.h>
+#include <sys/limits.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mutex.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/random.h>
+#include <sys/resourcevar.h>
+#include <sys/sched.h>
+#include <sys/smp.h>
+#include <sys/sysctl.h>
+#include <sys/syslog.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/vmmeter.h>
+#include <machine/atomic.h>
+#include <machine/cpu.h>
#ifndef __rtems__
-#include <freebsd/machine/md_var.h>
-#include <freebsd/machine/stdarg.h>
+#include <machine/md_var.h>
+#include <machine/stdarg.h>
#else /* __rtems__ */
#ifdef INTR_FILTER
#error INTR_FILTER is currently not suppported with RTEMS
@@ -68,8 +68,8 @@ __FBSDID("$FreeBSD$");
#define RTEMSBSD_SWI_WAKEUP_EVENT RTEMS_EVENT_31
#endif /* __rtems__ */
#ifdef DDB
-#include <freebsd/ddb/ddb.h>
-#include <freebsd/ddb/db_sym.h>
+#include <ddb/ddb.h>
+#include <ddb/db_sym.h>
#endif
/*
diff --git a/freebsd/sys/kern/kern_linker.c b/freebsd/sys/kern/kern_linker.c
index 15141f22..d2318552 100644
--- a/freebsd/sys/kern/kern_linker.c
+++ b/freebsd/sys/kern/kern_linker.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1997-2000 Doug Rabson
@@ -26,42 +26,42 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_ddb.h>
-#include <freebsd/local/opt_hwpmc_hooks.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/sysproto.h>
-#include <freebsd/sys/sysent.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/mount.h>
-#include <freebsd/sys/linker.h>
-#include <freebsd/sys/fcntl.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/libkern.h>
-#include <freebsd/sys/namei.h>
-#include <freebsd/sys/vnode.h>
-#include <freebsd/sys/syscallsubr.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/security/mac/mac_framework.h>
-
-#include <freebsd/local/linker_if.h>
+#include <rtems/bsd/local/opt_ddb.h>
+#include <rtems/bsd/local/opt_hwpmc_hooks.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/sysproto.h>
+#include <sys/sysent.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/sx.h>
+#include <sys/module.h>
+#include <sys/mount.h>
+#include <sys/linker.h>
+#include <sys/fcntl.h>
+#include <sys/jail.h>
+#include <sys/libkern.h>
+#include <sys/namei.h>
+#include <sys/vnode.h>
+#include <sys/syscallsubr.h>
+#include <sys/sysctl.h>
+
+#include <net/vnet.h>
+
+#include <security/mac/mac_framework.h>
+
+#include <rtems/bsd/local/linker_if.h>
#ifdef HWPMC_HOOKS
-#include <freebsd/sys/pmckern.h>
+#include <sys/pmckern.h>
#endif
#ifndef __rtems__
diff --git a/freebsd/sys/kern/kern_mbuf.c b/freebsd/sys/kern/kern_mbuf.c
index cca38078..90212bf6 100644
--- a/freebsd/sys/kern/kern_mbuf.c
+++ b/freebsd/sys/kern/kern_mbuf.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2004, 2005,
@@ -27,33 +27,31 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_param.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/eventhandler.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/smp.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/security/mac/mac_framework.h>
-
-#ifndef __rtems__
-#include <freebsd/vm/vm.h>
-#include <freebsd/vm/vm_extern.h>
-#include <freebsd/vm/vm_kern.h>
-#include <freebsd/vm/vm_page.h>
-#endif
-#include <freebsd/vm/uma.h>
-#include <freebsd/vm/uma_int.h>
-#include <freebsd/vm/uma_dbg.h>
+#include <rtems/bsd/local/opt_param.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/malloc.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/domain.h>
+#include <sys/eventhandler.h>
+#include <sys/kernel.h>
+#include <sys/protosw.h>
+#include <sys/smp.h>
+#include <sys/sysctl.h>
+
+#include <security/mac/mac_framework.h>
+
+#include <vm/vm.h>
+#include <vm/vm_extern.h>
+#include <vm/vm_kern.h>
+#include <vm/vm_page.h>
+#include <vm/uma.h>
+#include <vm/uma_int.h>
+#include <vm/uma_dbg.h>
/*
* In FreeBSD, Mbufs and Mbuf Clusters are allocated from UMA
diff --git a/freebsd/sys/kern/kern_mib.c b/freebsd/sys/kern/kern_mib.c
index 0acf89e5..2acfaddb 100644
--- a/freebsd/sys/kern/kern_mib.c
+++ b/freebsd/sys/kern/kern_mib.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1989, 1993
@@ -37,29 +37,29 @@
* @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_compat.h>
-#include <freebsd/local/opt_posix.h>
-#include <freebsd/local/opt_config.h>
+#include <rtems/bsd/local/opt_compat.h>
+#include <rtems/bsd/local/opt_posix.h>
+#include <rtems/bsd/local/opt_config.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
#ifndef __rtems__
-#include <freebsd/sys/sbuf.h>
+#include <sys/sbuf.h>
#endif
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/proc.h>
+#include <sys/systm.h>
+#include <sys/sysctl.h>
+#include <sys/proc.h>
#ifndef __rtems__
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/smp.h>
-#include <freebsd/sys/sx.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/jail.h>
+#include <sys/smp.h>
+#include <sys/sx.h>
#endif
-#include <freebsd/sys/unistd.h>
+#include <rtems/bsd/sys/unistd.h>
#ifdef __rtems__
char machine[] = "SET ME";
@@ -513,27 +513,27 @@ SYSCTL_INT(_user, USER_STREAM_MAX, stream_max, CTLFLAG_RD,
SYSCTL_INT(_user, USER_TZNAME_MAX, tzname_max, CTLFLAG_RD,
0, 0, "Min Maximum number of types supported for timezone names");
-#include <freebsd/sys/vnode.h>
+#include <sys/vnode.h>
SYSCTL_INT(_debug_sizeof, OID_AUTO, vnode, CTLFLAG_RD,
0, sizeof(struct vnode), "sizeof(struct vnode)");
SYSCTL_INT(_debug_sizeof, OID_AUTO, proc, CTLFLAG_RD,
0, sizeof(struct proc), "sizeof(struct proc)");
-#include <freebsd/sys/bio.h>
-#include <freebsd/sys/buf.h>
+#include <sys/bio.h>
+#include <sys/buf.h>
SYSCTL_INT(_debug_sizeof, OID_AUTO, bio, CTLFLAG_RD,
0, sizeof(struct bio), "sizeof(struct bio)");
SYSCTL_INT(_debug_sizeof, OID_AUTO, buf, CTLFLAG_RD,
0, sizeof(struct buf), "sizeof(struct buf)");
-#include <freebsd/sys/user.h>
+#include <sys/user.h>
SYSCTL_INT(_debug_sizeof, OID_AUTO, kinfo_proc, CTLFLAG_RD,
0, sizeof(struct kinfo_proc), "sizeof(struct kinfo_proc)");
/* XXX compatibility, remove for 6.0 */
-#include <freebsd/sys/imgact.h>
-#include <freebsd/sys/imgact_elf.h>
+#include <sys/imgact.h>
+#include <sys/imgact_elf.h>
SYSCTL_INT(_kern, OID_AUTO, fallback_elf_brand, CTLFLAG_RW,
&__elfN(fallback_brand), sizeof(__elfN(fallback_brand)),
"compatibility for kern.fallback_elf_brand");
diff --git a/freebsd/sys/kern/kern_module.c b/freebsd/sys/kern/kern_module.c
index 0476efef..8351c626 100644
--- a/freebsd/sys/kern/kern_module.c
+++ b/freebsd/sys/kern/kern_module.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1997 Doug Rabson
@@ -26,25 +26,25 @@
* SUCH DAMAGE.
*/
-#include <freebsd/local/opt_compat.h>
+#include <rtems/bsd/local/opt_compat.h>
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/eventhandler.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/sysproto.h>
-#include <freebsd/sys/sysent.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/reboot.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/linker.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
+#include <sys/eventhandler.h>
+#include <sys/malloc.h>
+#include <sys/sysproto.h>
+#include <sys/sysent.h>
+#include <sys/proc.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/reboot.h>
+#include <sys/sx.h>
+#include <sys/module.h>
+#include <sys/linker.h>
static MALLOC_DEFINE(M_MODULE, "module", "module data structures");
@@ -474,11 +474,11 @@ modfind(struct thread *td, struct modfind_args *uap)
MODULE_VERSION(kernel, __FreeBSD_version);
#ifdef COMPAT_FREEBSD32
-#include <freebsd/sys/mount.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/compat/freebsd32/freebsd32_util.h>
-#include <freebsd/compat/freebsd32/freebsd32.h>
-#include <freebsd/compat/freebsd32/freebsd32_proto.h>
+#include <sys/mount.h>
+#include <sys/socket.h>
+#include <compat/freebsd32/freebsd32_util.h>
+#include <compat/freebsd32/freebsd32.h>
+#include <compat/freebsd32/freebsd32_proto.h>
typedef union modspecific32 {
int intval;
diff --git a/freebsd/sys/kern/kern_mtxpool.c b/freebsd/sys/kern/kern_mtxpool.c
index b2c0267a..b5a0465b 100644
--- a/freebsd/sys/kern/kern_mtxpool.c
+++ b/freebsd/sys/kern/kern_mtxpool.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001 Matthew Dillon. All Rights Reserved.
@@ -45,17 +45,17 @@
* - possible L1 cache mastersip contention between cpus.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/ktr.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/systm.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/proc.h>
+#include <sys/kernel.h>
+#include <sys/ktr.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mutex.h>
+#include <sys/systm.h>
static MALLOC_DEFINE(M_MTXPOOL, "mtx_pool", "mutex pool");
diff --git a/freebsd/sys/kern/kern_ntptime.c b/freebsd/sys/kern/kern_ntptime.c
index 33aa4908..c49b82dd 100644
--- a/freebsd/sys/kern/kern_ntptime.c
+++ b/freebsd/sys/kern/kern_ntptime.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
***********************************************************************
@@ -32,26 +32,26 @@
* confusing and/or plain wrong in that context.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_ntp.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/sysproto.h>
-#include <freebsd/sys/eventhandler.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/timex.h>
-#include <freebsd/sys/timetc.h>
-#include <freebsd/sys/timepps.h>
-#include <freebsd/sys/syscallsubr.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/local/opt_ntp.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/sysproto.h>
+#include <sys/eventhandler.h>
+#include <sys/kernel.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/timex.h>
+#include <sys/timetc.h>
+#include <sys/timepps.h>
+#include <sys/syscallsubr.h>
+#include <sys/sysctl.h>
/*
* Single-precision macros for 64-bit machines
@@ -266,7 +266,7 @@ ntp_gettime1(struct ntptimeval *ntvp)
* See the timex.h header file for synopsis and API description. Note that
* the TAI offset is returned in the ntvtimeval.tai structure member.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct ntp_gettime_args {
struct ntptimeval *ntvp;
};
@@ -315,7 +315,7 @@ SYSCTL_OPAQUE(_kern_ntp_pll, OID_AUTO, time_freq, CTLFLAG_RD, &time_freq, sizeof
* the timex.constant structure member has a dual purpose to set the time
* constant and to set the TAI offset.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct ntp_adjtime_args {
struct timex *tp;
};
@@ -924,7 +924,7 @@ hardpps(tsp, nsec)
}
#endif /* PPS_SYNC */
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct adjtime_args {
struct timeval *delta;
struct timeval *olddelta;
diff --git a/freebsd/sys/kern/kern_proc.c b/freebsd/sys/kern/kern_proc.c
index a646aa35..30d78f08 100644
--- a/freebsd/sys/kern/kern_proc.c
+++ b/freebsd/sys/kern/kern_proc.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -31,65 +31,65 @@
* @(#)kern_proc.c 8.7 (Berkeley) 2/14/95
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_compat.h>
-#include <freebsd/local/opt_ddb.h>
-#include <freebsd/local/opt_kdtrace.h>
-#include <freebsd/local/opt_ktrace.h>
+#include <rtems/bsd/local/opt_compat.h>
+#include <rtems/bsd/local/opt_ddb.h>
+#include <rtems/bsd/local/opt_kdtrace.h>
+#include <rtems/bsd/local/opt_ktrace.h>
#ifndef __rtems__
-#include <freebsd/local/opt_kstack_pages.h>
-#include <freebsd/local/opt_stack.h>
+#include <rtems/bsd/local/opt_kstack_pages.h>
+#include <rtems/bsd/local/opt_stack.h>
#endif /* __rtems__ */
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/limits.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mount.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/refcount.h>
-#include <freebsd/sys/sbuf.h>
-#include <freebsd/sys/sysent.h>
-#include <freebsd/sys/sched.h>
-#include <freebsd/sys/smp.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/limits.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mount.h>
+#include <sys/mutex.h>
+#include <sys/proc.h>
+#include <sys/refcount.h>
+#include <sys/sbuf.h>
+#include <sys/sysent.h>
+#include <sys/sched.h>
+#include <sys/smp.h>
#ifndef __rtems__
-#include <freebsd/sys/stack.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/filedesc.h>
-#include <freebsd/sys/tty.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/sdt.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/user.h>
+#include <sys/stack.h>
+#include <sys/sysctl.h>
+#include <sys/filedesc.h>
+#include <sys/tty.h>
+#include <sys/signalvar.h>
+#include <sys/sdt.h>
+#include <sys/sx.h>
+#include <sys/user.h>
#endif /* __rtems__ */
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/vnode.h>
-#include <freebsd/sys/eventhandler.h>
+#include <sys/jail.h>
+#include <sys/vnode.h>
+#include <sys/eventhandler.h>
#ifdef KTRACE
-#include <freebsd/sys/uio.h>
-#include <freebsd/sys/ktrace.h>
+#include <sys/uio.h>
+#include <sys/ktrace.h>
#endif
#ifdef DDB
-#include <freebsd/ddb/ddb.h>
+#include <ddb/ddb.h>
#endif
#ifndef __rtems__
-#include <freebsd/vm/vm.h>
-#include <freebsd/vm/vm_extern.h>
-#include <freebsd/vm/pmap.h>
-#include <freebsd/vm/vm_map.h>
-#include <freebsd/vm/vm_object.h>
-#include <freebsd/vm/uma.h>
+#include <vm/vm.h>
+#include <vm/vm_extern.h>
+#include <vm/pmap.h>
+#include <vm/vm_map.h>
+#include <vm/vm_object.h>
+#include <vm/uma.h>
#ifdef COMPAT_FREEBSD32
-#include <freebsd/compat/freebsd32/freebsd32.h>
-#include <freebsd/compat/freebsd32/freebsd32_util.h>
+#include <compat/freebsd32/freebsd32.h>
+#include <compat/freebsd32/freebsd32_util.h>
#endif
#endif /* __rtems__ */
@@ -652,9 +652,9 @@ sess_release(struct session *s)
}
}
-#include <freebsd/local/opt_ddb.h>
+#include <rtems/bsd/local/opt_ddb.h>
#ifdef DDB
-#include <freebsd/ddb/ddb.h>
+#include <ddb/ddb.h>
DB_SHOW_COMMAND(pgrpdump, pgrpdump)
{
diff --git a/freebsd/sys/kern/kern_prot.c b/freebsd/sys/kern/kern_prot.c
index e969dfa7..f9ea3f1e 100644
--- a/freebsd/sys/kern/kern_prot.c
+++ b/freebsd/sys/kern/kern_prot.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1989, 1990, 1991, 1993
@@ -43,45 +43,45 @@
* System calls related to processes and protection
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_compat.h>
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_compat.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
#ifndef __rtems__
-#include <freebsd/sys/acct.h>
-#include <freebsd/sys/kdb.h>
+#include <sys/acct.h>
+#include <sys/kdb.h>
#endif /* __rtems__ */
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/refcount.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/sysproto.h>
-#include <freebsd/sys/jail.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mutex.h>
+#include <sys/refcount.h>
+#include <sys/sx.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/sysproto.h>
+#include <sys/jail.h>
#ifndef __rtems__
-#include <freebsd/sys/pioctl.h>
+#include <sys/pioctl.h>
#endif /* __rtems__ */
-#include <freebsd/sys/resourcevar.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/syscallsubr.h>
-#include <freebsd/sys/sysctl.h>
+#include <sys/resourcevar.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/syscallsubr.h>
+#include <sys/sysctl.h>
#if defined(INET) || defined(INET6)
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_pcb.h>
+#include <netinet/in.h>
+#include <netinet/in_pcb.h>
#endif
-#include <freebsd/security/audit/audit.h>
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/audit/audit.h>
+#include <security/mac/mac_framework.h>
static MALLOC_DEFINE(M_CRED, "cred", "credentials");
@@ -92,7 +92,7 @@ static void crextend(struct ucred *cr, int n);
static void crsetgroups_locked(struct ucred *cr, int ngrp,
gid_t *groups);
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct getpid_args {
int dummy;
};
@@ -112,7 +112,7 @@ getpid(struct thread *td, struct getpid_args *uap)
return (0);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct getppid_args {
int dummy;
};
@@ -132,7 +132,7 @@ getppid(struct thread *td, struct getppid_args *uap)
/*
* Get process group ID; note that POSIX getpgrp takes no parameter.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct getpgrp_args {
int dummy;
};
@@ -149,7 +149,7 @@ getpgrp(struct thread *td, struct getpgrp_args *uap)
}
/* Get an arbitary pid's process group id */
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct getpgid_args {
pid_t pid;
};
@@ -181,7 +181,7 @@ getpgid(struct thread *td, struct getpgid_args *uap)
/*
* Get an arbitary pid's session id.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct getsid_args {
pid_t pid;
};
@@ -210,7 +210,7 @@ getsid(struct thread *td, struct getsid_args *uap)
return (0);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct getuid_args {
int dummy;
};
@@ -227,7 +227,7 @@ getuid(struct thread *td, struct getuid_args *uap)
return (0);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct geteuid_args {
int dummy;
};
@@ -241,7 +241,7 @@ geteuid(struct thread *td, struct geteuid_args *uap)
return (0);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct getgid_args {
int dummy;
};
@@ -263,7 +263,7 @@ getgid(struct thread *td, struct getgid_args *uap)
* via getgroups. This syscall exists because it is somewhat painful to do
* correctly in a library function.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct getegid_args {
int dummy;
};
@@ -277,7 +277,7 @@ getegid(struct thread *td, struct getegid_args *uap)
return (0);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct getgroups_args {
u_int gidsetsize;
gid_t *gidset;
@@ -327,7 +327,7 @@ kern_getgroups(struct thread *td, u_int *ngrp, gid_t *groups)
return (0);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct setsid_args {
int dummy;
};
@@ -384,7 +384,7 @@ setsid(register struct thread *td, struct setsid_args *uap)
* there must exist some pid in same session having pgid (EPERM)
* pid must not be session leader (EPERM)
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct setpgid_args {
int pid; /* target process id */
int pgid; /* target pgrp id */
@@ -485,7 +485,7 @@ done:
*/
#define POSIX_APPENDIX_B_4_2_2
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct setuid_args {
uid_t uid;
};
@@ -596,7 +596,7 @@ fail:
return (error);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct seteuid_args {
uid_t euid;
};
@@ -652,7 +652,7 @@ fail:
return (error);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct setgid_args {
gid_t gid;
};
@@ -750,7 +750,7 @@ fail:
return (error);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct setegid_args {
gid_t egid;
};
@@ -796,7 +796,7 @@ fail:
return (error);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct setgroups_args {
u_int gidsetsize;
gid_t *gidset;
@@ -869,7 +869,7 @@ fail:
return (error);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct setreuid_args {
uid_t ruid;
uid_t euid;
@@ -936,7 +936,7 @@ fail:
return (error);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct setregid_args {
gid_t rgid;
gid_t egid;
@@ -1000,7 +1000,7 @@ fail:
* setresuid(ruid, euid, suid) is like setreuid except control over the saved
* uid is explicit.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct setresuid_args {
uid_t ruid;
uid_t euid;
@@ -1079,7 +1079,7 @@ fail:
* setresgid(rgid, egid, sgid) is like setregid except control over the saved
* gid is explicit.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct setresgid_args {
gid_t rgid;
gid_t egid;
@@ -1146,7 +1146,7 @@ fail:
return (error);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct getresuid_args {
uid_t *ruid;
uid_t *euid;
@@ -1173,7 +1173,7 @@ getresuid(register struct thread *td, struct getresuid_args *uap)
return (error1 ? error1 : error2 ? error2 : error3);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct getresgid_args {
gid_t *rgid;
gid_t *egid;
@@ -1200,7 +1200,7 @@ getresgid(register struct thread *td, struct getresgid_args *uap)
return (error1 ? error1 : error2 ? error2 : error3);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct issetugid_args {
int dummy;
};
@@ -2062,7 +2062,7 @@ crsetgroups(struct ucred *cr, int ngrp, gid_t *groups)
/*
* Get login name, if available.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct getlogin_args {
char *namebuf;
u_int namelen;
@@ -2090,7 +2090,7 @@ getlogin(struct thread *td, struct getlogin_args *uap)
/*
* Set login name.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct setlogin_args {
char *namebuf;
};
diff --git a/freebsd/sys/kern/kern_resource.c b/freebsd/sys/kern/kern_resource.c
index 939a1d24..fcfd2fb1 100644
--- a/freebsd/sys/kern/kern_resource.c
+++ b/freebsd/sys/kern/kern_resource.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1991, 1993
@@ -36,36 +36,36 @@
* @(#)kern_resource.c 8.5 (Berkeley) 1/21/94
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_compat.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/sysproto.h>
-#include <freebsd/sys/file.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/refcount.h>
-#include <freebsd/sys/resourcevar.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/sched.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/syscallsubr.h>
-#include <freebsd/sys/sysent.h>
-#include <freebsd/sys/time.h>
+#include <rtems/bsd/local/opt_compat.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/sysproto.h>
+#include <sys/file.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mutex.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/refcount.h>
+#include <sys/resourcevar.h>
+#include <sys/rwlock.h>
+#include <sys/sched.h>
+#include <sys/sx.h>
+#include <sys/syscallsubr.h>
+#include <sys/sysent.h>
+#include <rtems/bsd/sys/time.h>
#ifndef __rtems__
-#include <freebsd/sys/umtx.h>
+#include <sys/umtx.h>
-#include <freebsd/vm/vm.h>
-#include <freebsd/vm/vm_param.h>
-#include <freebsd/vm/pmap.h>
-#include <freebsd/vm/vm_map.h>
+#include <vm/vm.h>
+#include <vm/vm_param.h>
+#include <vm/pmap.h>
+#include <vm/vm_map.h>
static MALLOC_DEFINE(M_PLIMIT, "plimit", "plimit structures");
@@ -86,7 +86,7 @@ static void ruxagg_locked(struct rusage_ext *rux, struct thread *td);
/*
* Resource controls and accounting.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct getpriority_args {
int which;
int who;
@@ -171,7 +171,7 @@ getpriority(td, uap)
return (error);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct setpriority_args {
int which;
int who;
@@ -279,7 +279,7 @@ donice(struct thread *td, struct proc *p, int n)
/*
* Set realtime priority for LWP.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct rtprio_thread_args {
int function;
lwpid_t lwpid;
@@ -363,7 +363,7 @@ rtprio_thread(struct thread *td, struct rtprio_thread_args *uap)
/*
* Set realtime priority.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct rtprio_args {
int function;
pid_t pid;
@@ -534,7 +534,7 @@ pri_to_rtp(struct thread *td, struct rtprio *rtp)
}
#if defined(COMPAT_43)
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct osetrlimit_args {
u_int which;
struct orlimit *rlp;
@@ -557,7 +557,7 @@ osetrlimit(td, uap)
return (error);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct ogetrlimit_args {
u_int which;
struct orlimit *rlp;
@@ -596,7 +596,7 @@ ogetrlimit(td, uap)
}
#endif /* COMPAT_43 */
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct __setrlimit_args {
u_int which;
struct rlimit *rlp;
@@ -774,7 +774,7 @@ kern_setrlimit(td, which, limp)
return (0);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct __getrlimit_args {
u_int which;
struct rlimit *rlp;
@@ -924,7 +924,7 @@ calcru1(struct proc *p, struct rusage_ext *ruxp, struct timeval *up,
sp->tv_usec = su % 1000000;
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct getrusage_args {
int who;
struct rusage *rusage;
diff --git a/freebsd/sys/kern/kern_subr.c b/freebsd/sys/kern/kern_subr.c
index 9a28a7d9..663a656e 100644
--- a/freebsd/sys/kern/kern_subr.c
+++ b/freebsd/sys/kern/kern_subr.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1991, 1993
@@ -36,38 +36,36 @@
* @(#)kern_subr.c 8.3 (Berkeley) 1/21/94
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_zero.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/ktr.h>
-#include <freebsd/sys/limits.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/resourcevar.h>
-#include <freebsd/sys/sched.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/local/opt_zero.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/ktr.h>
+#include <sys/limits.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/proc.h>
+#include <sys/malloc.h>
+#include <sys/resourcevar.h>
+#include <sys/sched.h>
+#include <sys/sysctl.h>
#ifndef __rtems__
-#include <freebsd/sys/vnode.h>
+#include <sys/vnode.h>
#endif
-#ifndef __rtems__
-#include <freebsd/vm/vm.h>
-#include <freebsd/vm/vm_page.h>
-#include <freebsd/vm/vm_map.h>
-#endif
+#include <vm/vm.h>
+#include <vm/vm_page.h>
+#include <vm/vm_map.h>
#ifdef __rtems__
-#include <freebsd/sys/uio.h>
+#include <sys/uio.h>
#endif
#ifdef ZERO_COPY_SOCKETS
-#include <freebsd/vm/vm_param.h>
-#include <freebsd/vm/vm_object.h>
+#include <vm/vm_param.h>
+#include <vm/vm_object.h>
#endif
#ifndef __rtems__
diff --git a/freebsd/sys/kern/kern_sysctl.c b/freebsd/sys/kern/kern_sysctl.c
index 72da1f6d..27ac8ce7 100644
--- a/freebsd/sys/kern/kern_sysctl.c
+++ b/freebsd/sys/kern/kern_sysctl.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1989, 1993
@@ -41,35 +41,35 @@
/* FIXME */
#undef sysctl
#endif /* __rtems__ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_compat.h>
-#include <freebsd/local/opt_ktrace.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/sysproto.h>
-#include <freebsd/sys/uio.h>
+#include <rtems/bsd/local/opt_compat.h>
+#include <rtems/bsd/local/opt_ktrace.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/jail.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/sx.h>
+#include <sys/sysproto.h>
+#include <sys/uio.h>
#ifdef KTRACE
-#include <freebsd/sys/ktrace.h>
+#include <sys/ktrace.h>
#endif
-#include <freebsd/net/vnet.h>
+#include <net/vnet.h>
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
#ifndef __rtems__
-#include <freebsd/vm/vm.h>
-#include <freebsd/vm/vm_extern.h>
+#include <vm/vm.h>
+#include <vm/vm_extern.h>
#endif
#ifdef __rtems__
@@ -1456,7 +1456,7 @@ sysctl_root(SYSCTL_HANDLER_ARGS)
}
#ifndef __rtems__
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct sysctl_args {
int *name;
u_int namelen;
diff --git a/freebsd/sys/kern/kern_tc.c b/freebsd/sys/kern/kern_tc.c
index 1671145b..effbe4c5 100644
--- a/freebsd/sys/kern/kern_tc.c
+++ b/freebsd/sys/kern/kern_tc.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* ----------------------------------------------------------------------------
@@ -9,19 +9,19 @@
* ----------------------------------------------------------------------------
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_ntp.h>
+#include <rtems/bsd/local/opt_ntp.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/timepps.h>
-#include <freebsd/sys/timetc.h>
-#include <freebsd/sys/timex.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
+#include <sys/syslog.h>
+#include <sys/systm.h>
+#include <sys/timepps.h>
+#include <sys/timetc.h>
+#include <sys/timex.h>
/*
* A large step happens on boot. This constant detects such steps.
diff --git a/freebsd/sys/kern/kern_time.c b/freebsd/sys/kern/kern_time.c
index 8c760b48..46b47868 100644
--- a/freebsd/sys/kern/kern_time.c
+++ b/freebsd/sys/kern/kern_time.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1989, 1993
@@ -31,36 +31,36 @@
* @(#)kern_time.c 8.1 (Berkeley) 6/10/93
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/limits.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/limits.h>
#ifndef __rtems__
-#include <freebsd/sys/clock.h>
+#include <sys/clock.h>
#endif /* __rtems__ */
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/sysproto.h>
-#include <freebsd/sys/eventhandler.h>
-#include <freebsd/sys/resourcevar.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/syscallsubr.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sysent.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/sysproto.h>
+#include <sys/eventhandler.h>
+#include <sys/resourcevar.h>
+#include <sys/signalvar.h>
+#include <sys/kernel.h>
+#include <sys/syscallsubr.h>
+#include <sys/sysctl.h>
+#include <sys/sysent.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
#ifndef __rtems__
-#include <freebsd/sys/posix4.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/timers.h>
-#include <freebsd/sys/timetc.h>
-#include <freebsd/sys/vnode.h>
+#include <sys/posix4.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/timers.h>
+#include <sys/timetc.h>
+#include <sys/vnode.h>
-#include <freebsd/vm/vm.h>
-#include <freebsd/vm/vm_extern.h>
+#include <vm/vm.h>
+#include <vm/vm_extern.h>
#define MAX_CLOCKS (CLOCK_MONOTONIC+1)
@@ -171,7 +171,7 @@ settime(struct thread *td, struct timeval *tv)
return (0);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct clock_gettime_args {
clockid_t clock_id;
struct timespec *tp;
@@ -258,7 +258,7 @@ kern_clock_gettime(struct thread *td, clockid_t clock_id, struct timespec *ats)
}
#endif
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct clock_settime_args {
clockid_t clock_id;
const struct timespec *tp;
@@ -296,7 +296,7 @@ kern_clock_settime(struct thread *td, clockid_t clock_id, struct timespec *ats)
}
#endif
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct clock_getres_args {
clockid_t clock_id;
struct timespec *tp;
@@ -401,7 +401,7 @@ kern_nanosleep(struct thread *td, struct timespec *rqt, struct timespec *rmt)
}
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct nanosleep_args {
struct timespec *rqtp;
struct timespec *rmtp;
@@ -432,7 +432,7 @@ nanosleep(struct thread *td, struct nanosleep_args *uap)
return (error);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct gettimeofday_args {
struct timeval *tp;
struct timezone *tzp;
@@ -458,7 +458,7 @@ gettimeofday(struct thread *td, struct gettimeofday_args *uap)
return (error);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct settimeofday_args {
struct timeval *tv;
struct timezone *tzp;
@@ -531,7 +531,7 @@ kern_settimeofday(struct thread *td, struct timeval *tv, struct timezone *tzp)
* .it_interval. Rather, we compute the next time in absolute time the timer
* should go off.
*/
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct getitimer_args {
u_int which;
struct itimerval *itv;
@@ -583,7 +583,7 @@ kern_getitimer(struct thread *td, u_int which, struct itimerval *aitv)
return (0);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct setitimer_args {
u_int which;
struct itimerval *itv, *oitv;
@@ -934,7 +934,7 @@ itimer_leave(struct itimer *it)
wakeup(it);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct ktimer_create_args {
clockid_t clock_id;
struct sigevent * evp;
@@ -1075,7 +1075,7 @@ out:
return (error);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct ktimer_delete_args {
int timerid;
};
@@ -1137,7 +1137,7 @@ kern_timer_delete(struct thread *td, int timerid)
return (0);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct ktimer_settime_args {
int timerid;
int flags;
@@ -1180,7 +1180,7 @@ ktimer_settime(struct thread *td, struct ktimer_settime_args *uap)
return (error);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct ktimer_gettime_args {
int timerid;
struct itimerspec * value;
@@ -1212,7 +1212,7 @@ ktimer_gettime(struct thread *td, struct ktimer_gettime_args *uap)
return (error);
}
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct timer_getoverrun_args {
int timerid;
};
diff --git a/freebsd/sys/kern/kern_timeout.c b/freebsd/sys/kern/kern_timeout.c
index 536ca3f3..67924d08 100644
--- a/freebsd/sys/kern/kern_timeout.c
+++ b/freebsd/sys/kern/kern_timeout.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1991, 1993
@@ -36,27 +36,27 @@
* From: @(#)kern_clock.c 8.5 (Berkeley) 1/21/94
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_kdtrace.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/interrupt.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/ktr.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/sdt.h>
-#include <freebsd/sys/sleepqueue.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/smp.h>
+#include <rtems/bsd/local/opt_kdtrace.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/callout.h>
+#include <sys/condvar.h>
+#include <sys/interrupt.h>
+#include <sys/kernel.h>
+#include <sys/ktr.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mutex.h>
+#include <sys/proc.h>
+#include <sys/sdt.h>
+#include <sys/sleepqueue.h>
+#include <sys/sysctl.h>
+#include <sys/smp.h>
#ifdef __rtems__
int ncallout = 16;
diff --git a/freebsd/sys/kern/subr_bufring.c b/freebsd/sys/kern/subr_bufring.c
index 8ec8b9d7..6cc2ec6a 100644
--- a/freebsd/sys/kern/subr_bufring.c
+++ b/freebsd/sys/kern/subr_bufring.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2007, 2008 Kip Macy <kmacy@freebsd.org>
@@ -26,16 +26,16 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/ktr.h>
-#include <freebsd/sys/buf_ring.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/ktr.h>
+#include <sys/buf_ring.h>
struct buf_ring *
diff --git a/freebsd/sys/kern/subr_bus.c b/freebsd/sys/kern/subr_bus.c
index 9edbe777..51717b49 100644
--- a/freebsd/sys/kern/subr_bus.c
+++ b/freebsd/sys/kern/subr_bus.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1997,1998,2003 Doug Rabson
@@ -26,38 +26,38 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_bus.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/conf.h>
-#include <freebsd/sys/filio.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/kobj.h>
-#include <freebsd/sys/limits.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/poll.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/machine/bus.h>
-#include <freebsd/sys/rman.h>
-#include <freebsd/sys/selinfo.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/uio.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/interrupt.h>
-
-#include <freebsd/machine/stdarg.h>
-
-#include <freebsd/vm/uma.h>
+#include <rtems/bsd/local/opt_bus.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/conf.h>
+#include <sys/filio.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/kernel.h>
+#include <sys/kobj.h>
+#include <sys/limits.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/mutex.h>
+#include <sys/poll.h>
+#include <sys/proc.h>
+#include <sys/condvar.h>
+#include <sys/queue.h>
+#include <machine/bus.h>
+#include <sys/rman.h>
+#include <sys/selinfo.h>
+#include <sys/signalvar.h>
+#include <sys/sysctl.h>
+#include <sys/systm.h>
+#include <sys/uio.h>
+#include <sys/bus.h>
+#include <sys/interrupt.h>
+
+#include <machine/stdarg.h>
+
+#include <vm/uma.h>
SYSCTL_NODE(_hw, OID_AUTO, bus, CTLFLAG_RW, NULL, NULL);
SYSCTL_NODE(, OID_AUTO, dev, CTLFLAG_RW, NULL, NULL);
diff --git a/freebsd/sys/kern/subr_eventhandler.c b/freebsd/sys/kern/subr_eventhandler.c
index af6c6295..258dc0bf 100644
--- a/freebsd/sys/kern/subr_eventhandler.c
+++ b/freebsd/sys/kern/subr_eventhandler.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1999 Michael Smith <msmith@freebsd.org>
@@ -26,17 +26,17 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/eventhandler.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mutex.h>
+#include <sys/proc.h>
+#include <sys/systm.h>
+#include <sys/eventhandler.h>
static MALLOC_DEFINE(M_EVENTHANDLER, "eventhandler", "Event handler records");
diff --git a/freebsd/sys/kern/subr_hints.c b/freebsd/sys/kern/subr_hints.c
index dbd120e6..36133218 100644
--- a/freebsd/sys/kern/subr_hints.c
+++ b/freebsd/sys/kern/subr_hints.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2000,2001 Peter Wemm <peter@FreeBSD.org>
@@ -26,14 +26,14 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/bus.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
/*
* Access functions for device resources.
diff --git a/freebsd/sys/kern/subr_kobj.c b/freebsd/sys/kern/subr_kobj.c
index 779fd905..e12a1f36 100644
--- a/freebsd/sys/kern/subr_kobj.c
+++ b/freebsd/sys/kern/subr_kobj.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2000,2003 Doug Rabson
@@ -26,22 +26,22 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/kobj.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/kobj.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mutex.h>
+#include <sys/sysctl.h>
#ifndef TEST
-#include <freebsd/sys/systm.h>
+#include <sys/systm.h>
#endif
#ifdef TEST
-#include <freebsd/local/usertest.h>
+#include <rtems/bsd/local/usertest.h>
#endif
static MALLOC_DEFINE(M_KOBJ, "kobj", "Kernel object structures");
diff --git a/freebsd/sys/kern/subr_module.c b/freebsd/sys/kern/subr_module.c
index 95d4e196..a6c9d1f5 100644
--- a/freebsd/sys/kern/subr_module.c
+++ b/freebsd/sys/kern/subr_module.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1998 Michael Smith
@@ -26,12 +26,12 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/linker.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/linker.h>
/*
* Preloaded module support
diff --git a/freebsd/sys/kern/subr_rman.c b/freebsd/sys/kern/subr_rman.c
index 8561c0a4..c3c87e44 100644
--- a/freebsd/sys/kern/subr_rman.c
+++ b/freebsd/sys/kern/subr_rman.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright 1998 Massachusetts Institute of Technology
@@ -57,25 +57,25 @@
* permitted.
*/
-#include <freebsd/local/opt_ddb.h>
+#include <rtems/bsd/local/opt_ddb.h>
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/limits.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/bus.h> /* XXX debugging */
-#include <freebsd/machine/bus.h>
-#include <freebsd/sys/rman.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/limits.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mutex.h>
+#include <sys/bus.h> /* XXX debugging */
+#include <machine/bus.h>
+#include <sys/rman.h>
+#include <sys/sysctl.h>
#ifdef DDB
-#include <freebsd/ddb/ddb.h>
+#include <ddb/ddb.h>
#endif
/*
diff --git a/freebsd/sys/kern/subr_sbuf.c b/freebsd/sys/kern/subr_sbuf.c
index 3c7b5a20..165d17a3 100644
--- a/freebsd/sys/kern/subr_sbuf.c
+++ b/freebsd/sys/kern/subr_sbuf.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2000-2008 Poul-Henning Kamp
@@ -28,27 +28,27 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
+#include <rtems/bsd/sys/param.h>
#ifdef _KERNEL
-#include <freebsd/sys/ctype.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/uio.h>
-#include <freebsd/machine/stdarg.h>
+#include <sys/ctype.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/systm.h>
+#include <sys/uio.h>
+#include <machine/stdarg.h>
#else /* _KERNEL */
-#include <freebsd/ctype.h>
-#include <freebsd/stdarg.h>
-#include <freebsd/stdio.h>
-#include <freebsd/stdlib.h>
-#include <freebsd/string.h>
+#include <ctype.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#endif /* _KERNEL */
-#include <freebsd/sys/sbuf.h>
+#include <sys/sbuf.h>
#ifdef _KERNEL
static MALLOC_DEFINE(M_SBUF, "sbuf", "string buffers");
diff --git a/freebsd/sys/kern/subr_unit.c b/freebsd/sys/kern/subr_unit.c
index 939c03f1..1719ede8 100644
--- a/freebsd/sys/kern/subr_unit.c
+++ b/freebsd/sys/kern/subr_unit.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2004 Poul-Henning Kamp
@@ -69,19 +69,19 @@
* N is the number of the highest unit allocated.
*/
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/bitstring.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/queue.h>
+#include <sys/bitstring.h>
#ifdef _KERNEL
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/limits.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
+#include <sys/limits.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
/*
* In theory it would be smarter to allocate the individual blocks
@@ -100,9 +100,9 @@ MTX_SYSINIT(unit, &unitmtx, "unit# allocation", MTX_DEF);
#else /* ...USERLAND */
-#include <freebsd/stdio.h>
-#include <freebsd/stdlib.h>
-#include <freebsd/string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#define KASSERT(cond, arg) \
do { \
diff --git a/freebsd/sys/kern/sys_generic.c b/freebsd/sys/kern/sys_generic.c
index c90d632b..bc6130b6 100644
--- a/freebsd/sys/kern/sys_generic.c
+++ b/freebsd/sys/kern/sys_generic.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1989, 1993
@@ -36,52 +36,52 @@
* @(#)sys_generic.c 8.5 (Berkeley) 1/21/94
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_compat.h>
-#include <freebsd/local/opt_ktrace.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/sysproto.h>
-#include <freebsd/sys/filedesc.h>
-#include <freebsd/sys/filio.h>
-#include <freebsd/sys/fcntl.h>
-#include <freebsd/sys/file.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/uio.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/ktr.h>
-#include <freebsd/sys/limits.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/poll.h>
-#include <freebsd/sys/resourcevar.h>
-#include <freebsd/sys/selinfo.h>
-#include <freebsd/sys/sleepqueue.h>
-#include <freebsd/sys/syscallsubr.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sysent.h>
-#include <freebsd/sys/vnode.h>
-#include <freebsd/sys/bio.h>
+#include <rtems/bsd/local/opt_compat.h>
+#include <rtems/bsd/local/opt_ktrace.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/sysproto.h>
+#include <sys/filedesc.h>
+#include <sys/filio.h>
+#include <sys/fcntl.h>
+#include <sys/file.h>
+#include <sys/proc.h>
+#include <sys/signalvar.h>
+#include <sys/socketvar.h>
+#include <sys/uio.h>
+#include <sys/kernel.h>
+#include <sys/ktr.h>
+#include <sys/limits.h>
+#include <sys/malloc.h>
+#include <sys/poll.h>
+#include <sys/resourcevar.h>
+#include <sys/selinfo.h>
+#include <sys/sleepqueue.h>
+#include <sys/syscallsubr.h>
+#include <sys/sysctl.h>
+#include <sys/sysent.h>
+#include <sys/vnode.h>
+#include <sys/bio.h>
#ifndef __rtems__
-#include <freebsd/sys/buf.h>
+#include <sys/buf.h>
#endif
-#include <freebsd/sys/condvar.h>
+#include <sys/condvar.h>
#ifdef KTRACE
-#include <freebsd/sys/ktrace.h>
+#include <sys/ktrace.h>
#endif
-#include <freebsd/security/audit/audit.h>
+#include <security/audit/audit.h>
#ifdef __rtems__
typedef long fd_mask;
-#include <freebsd/vm/uma.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/machine/rtems-bsd-symbols.h>
+#include <vm/uma.h>
+#include <sys/mutex.h>
+#include <machine/rtems-bsd-symbols.h>
#endif /* __rtems__ */
static MALLOC_DEFINE(M_IOCTLOPS, "ioctlops", "ioctl data buffer");
@@ -169,7 +169,6 @@ read(td, uap)
error = kern_readv(td, uap->fd, &auio);
return(error);
}
-#endif
/*
* Positioned read system call
@@ -204,7 +203,6 @@ pread(td, uap)
return(error);
}
-#ifndef __rtems__
int
freebsd6_pread(td, uap)
struct thread *td;
@@ -824,6 +822,7 @@ kern_pselect(struct thread *td, int nd, fd_set *in, fd_set *ou, fd_set *ex,
error = kern_select(td, nd, in, ou, ex, tvp, abi_nfdbits);
return (error);
}
+#endif /* __rtems__ */
#ifndef _SYS_SYSPROTO_H_
struct select_args {
@@ -1009,6 +1008,7 @@ done:
return (error);
}
+#ifndef __rtems__
/*
* Convert a select bit set to poll flags.
*
@@ -1074,6 +1074,7 @@ selsetbits(fd_mask **ibits, fd_mask **obits, int idx, fd_mask bit, int events)
return (n);
}
+#endif /* __rtems__ */
/*
* Traverse the list of fds attached to this thread's seltd and check for
@@ -1082,6 +1083,7 @@ selsetbits(fd_mask **ibits, fd_mask **obits, int idx, fd_mask bit, int events)
static int
selrescan(struct thread *td, fd_mask **ibits, fd_mask **obits)
{
+#ifndef __rtems__
struct filedesc *fdp;
struct selinfo *si;
struct seltd *stp;
@@ -1113,6 +1115,9 @@ selrescan(struct thread *td, fd_mask **ibits, fd_mask **obits)
stp->st_flags = 0;
td->td_retval[0] = n;
return (0);
+#else /* __rtems__ */
+ return (ENOMEM);
+#endif /* __rtems__ */
}
/*
@@ -1125,6 +1130,7 @@ selscan(td, ibits, obits, nfd)
fd_mask **ibits, **obits;
int nfd;
{
+#ifndef __rtems__
struct filedesc *fdp;
struct file *fp;
fd_mask bit;
@@ -1152,8 +1158,10 @@ selscan(td, ibits, obits, nfd)
td->td_retval[0] = n;
return (0);
-}
+#else /* __rtems__ */
+ return (ENOMEM);
#endif /* __rtems__ */
+}
#ifndef _SYS_SYSPROTO_H_
struct poll_args {
diff --git a/freebsd/sys/kern/uipc_accf.c b/freebsd/sys/kern/uipc_accf.c
index fd482e64..5fa31bc5 100644
--- a/freebsd/sys/kern/uipc_accf.c
+++ b/freebsd/sys/kern/uipc_accf.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2000 Paycounter, Inc.
@@ -28,26 +28,26 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#define ACCEPT_FILTER_MOD
-#include <freebsd/local/opt_param.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/queue.h>
+#include <rtems/bsd/local/opt_param.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/domain.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <sys/mutex.h>
+#include <sys/protosw.h>
+#include <sys/sysctl.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/queue.h>
static struct mtx accept_filter_mtx;
MTX_SYSINIT(accept_filter, &accept_filter_mtx, "accept_filter_mtx",
diff --git a/freebsd/sys/kern/uipc_domain.c b/freebsd/sys/kern/uipc_domain.c
index 30eff27c..1b2be102 100644
--- a/freebsd/sys/kern/uipc_domain.c
+++ b/freebsd/sys/kern/uipc_domain.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1993
@@ -31,24 +31,24 @@
* @(#)uipc_domain.c 8.2 (Berkeley) 10/18/93
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/eventhandler.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/systm.h>
-
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/vm/uma.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/socket.h>
+#include <sys/protosw.h>
+#include <sys/domain.h>
+#include <sys/eventhandler.h>
+#include <sys/mbuf.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/socketvar.h>
+#include <sys/systm.h>
+
+#include <net/vnet.h>
+
+#include <vm/uma.h>
/*
* System initialization
diff --git a/freebsd/sys/kern/uipc_mbuf.c b/freebsd/sys/kern/uipc_mbuf.c
index 8e57835c..43255aab 100644
--- a/freebsd/sys/kern/uipc_mbuf.c
+++ b/freebsd/sys/kern/uipc_mbuf.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1988, 1991, 1993
@@ -31,24 +31,24 @@
* @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_param.h>
-#include <freebsd/local/opt_mbuf_stress_test.h>
-#include <freebsd/local/opt_mbuf_profiling.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/limits.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/uio.h>
+#include <rtems/bsd/local/opt_param.h>
+#include <rtems/bsd/local/opt_mbuf_stress_test.h>
+#include <rtems/bsd/local/opt_mbuf_profiling.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/limits.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/sysctl.h>
+#include <sys/domain.h>
+#include <sys/protosw.h>
+#include <sys/uio.h>
int max_linkhdr;
int max_protohdr;
diff --git a/freebsd/sys/kern/uipc_mbuf2.c b/freebsd/sys/kern/uipc_mbuf2.c
index babdf020..960a4206 100644
--- a/freebsd/sys/kern/uipc_mbuf2.c
+++ b/freebsd/sys/kern/uipc_mbuf2.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $KAME: uipc_mbuf2.c,v 1.31 2001/11/28 11:08:53 itojun Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.40 1999/04/01 00:23:25 thorpej Exp $ */
@@ -62,20 +62,20 @@
* @(#)uipc_mbuf.c 8.4 (Berkeley) 2/14/95
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*#define PULLDOWN_DEBUG*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/mutex.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/mutex.h>
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
static MALLOC_DEFINE(M_PACKET_TAGS, MBUF_TAG_MEM_NAME,
"packet-attached information");
diff --git a/freebsd/sys/kern/uipc_sockbuf.c b/freebsd/sys/kern/uipc_sockbuf.c
index 3e331ee0..e711827e 100644
--- a/freebsd/sys/kern/uipc_sockbuf.c
+++ b/freebsd/sys/kern/uipc_sockbuf.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1988, 1990, 1993
@@ -31,25 +31,25 @@
* @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_param.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/aio.h> /* for aio_swake proto */
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/resourcevar.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/local/opt_param.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/aio.h> /* for aio_swake proto */
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mbuf.h>
+#include <sys/mutex.h>
+#include <sys/proc.h>
+#include <sys/protosw.h>
+#include <sys/resourcevar.h>
+#include <sys/signalvar.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sx.h>
+#include <sys/sysctl.h>
/*
* Function pointer set by the AIO routines so that the socket buffer code
diff --git a/freebsd/sys/kern/uipc_socket.c b/freebsd/sys/kern/uipc_socket.c
index a0ff9f53..fdea2601 100644
--- a/freebsd/sys/kern/uipc_socket.c
+++ b/freebsd/sys/kern/uipc_socket.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1988, 1990, 1993
@@ -96,52 +96,52 @@
* these interfaces are not preferred, and should be avoided.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_zero.h>
-#include <freebsd/local/opt_compat.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/fcntl.h>
-#include <freebsd/sys/limits.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mac.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/file.h> /* for struct knote */
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/event.h>
-#include <freebsd/sys/eventhandler.h>
-#include <freebsd/sys/poll.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/resourcevar.h>
-#include <freebsd/net/route.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/stat.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/uio.h>
-#include <freebsd/sys/jail.h>
-
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/security/mac/mac_framework.h>
-
-#include <freebsd/vm/uma.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_zero.h>
+#include <rtems/bsd/local/opt_compat.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/fcntl.h>
+#include <sys/limits.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mac.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/mutex.h>
+#include <sys/domain.h>
+#include <sys/file.h> /* for struct knote */
+#include <sys/kernel.h>
+#include <sys/event.h>
+#include <sys/eventhandler.h>
+#include <sys/poll.h>
+#include <sys/proc.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/resourcevar.h>
+#include <net/route.h>
+#include <sys/signalvar.h>
+#include <sys/stat.h>
+#include <sys/sx.h>
+#include <sys/sysctl.h>
+#include <sys/uio.h>
+#include <sys/jail.h>
+
+#include <net/vnet.h>
+
+#include <security/mac/mac_framework.h>
+
+#include <vm/uma.h>
#ifdef COMPAT_FREEBSD32
-#include <freebsd/sys/mount.h>
-#include <freebsd/sys/sysent.h>
-#include <freebsd/compat/freebsd32/freebsd32.h>
+#include <sys/mount.h>
+#include <sys/sysent.h>
+#include <compat/freebsd32/freebsd32.h>
#endif
static int soreceive_rcvoob(struct socket *so, struct uio *uio,
@@ -820,12 +820,12 @@ struct so_zerocopy_stats{
int found_ifp;
};
struct so_zerocopy_stats so_zerocp_stats = {0,0,0};
-#include <freebsd/netinet/in.h>
-#include <freebsd/net/route.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/vm/vm.h>
-#include <freebsd/vm/vm_page.h>
-#include <freebsd/vm/vm_object.h>
+#include <netinet/in.h>
+#include <net/route.h>
+#include <netinet/in_pcb.h>
+#include <vm/vm.h>
+#include <vm/vm_page.h>
+#include <vm/vm_object.h>
/*
* sosend_copyin() is only used if zero copy sockets are enabled. Otherwise
diff --git a/freebsd/sys/libkern/arc4random.c b/freebsd/sys/libkern/arc4random.c
index a43218c1..80b463f5 100644
--- a/freebsd/sys/libkern/arc4random.c
+++ b/freebsd/sys/libkern/arc4random.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* THE BEER-WARE LICENSE
@@ -10,17 +10,17 @@
* Dan Moschuk
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/random.h>
-#include <freebsd/sys/libkern.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/time.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/random.h>
+#include <sys/libkern.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <rtems/bsd/sys/time.h>
#define ARC4_RESEED_BYTES 65536
#define ARC4_RESEED_SECONDS 300
diff --git a/freebsd/sys/libkern/fls.c b/freebsd/sys/libkern/fls.c
index e350c535..4b780b9d 100644
--- a/freebsd/sys/libkern/fls.c
+++ b/freebsd/sys/libkern/fls.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1990, 1993
@@ -29,10 +29,10 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/libkern.h>
+#include <sys/libkern.h>
/*
* Find Last Set bit
diff --git a/freebsd/sys/libkern/inet_ntoa.c b/freebsd/sys/libkern/inet_ntoa.c
index 89da6a42..288e71d7 100644
--- a/freebsd/sys/libkern/inet_ntoa.c
+++ b/freebsd/sys/libkern/inet_ntoa.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright 1994, 1995 Massachusetts Institute of Technology
@@ -29,13 +29,13 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
-#include <freebsd/netinet/in.h>
+#include <netinet/in.h>
char *
inet_ntoa(struct in_addr ina)
diff --git a/freebsd/sys/libkern/random.c b/freebsd/sys/libkern/random.c
index 87cc9591..f5e30c34 100644
--- a/freebsd/sys/libkern/random.c
+++ b/freebsd/sys/libkern/random.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1992, 1993
@@ -31,10 +31,10 @@
* @(#)random.c 8.1 (Berkeley) 6/10/93
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/libkern.h>
+#include <sys/libkern.h>
#define NSHUFF 50 /* to drop some "seed -> 1st value" linearity */
diff --git a/freebsd/netinet/in_systm.h b/freebsd/sys/lm32/include/machine/in_cksum.h
index a55d196e..37d88e2e 100644
--- a/freebsd/netinet/in_systm.h
+++ b/freebsd/sys/lm32/include/machine/in_cksum.h
@@ -1,6 +1,6 @@
/*-
- * Copyright (c) 1982, 1986, 1993
- * The Regents of the University of California. All rights reserved.
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,33 +26,52 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)in_systm.h 8.1 (Berkeley) 6/10/93
+ * from tahoe: in_cksum.c 1.2 86/01/05
+ * from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91
+ * from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp
+ * from: src/sys/alpha/include/in_cksum.h,v 1.7 2005/03/02 21:33:20 joerg
* $FreeBSD$
*/
-#ifndef _NETINET_IN_SYSTM_HH_
-#define _NETINET_IN_SYSTM_HH_
+#ifndef _MACHINE_IN_CKSUM_H_
+#define _MACHINE_IN_CKSUM_H_ 1
-/*
- * Miscellaneous internetwork
- * definitions for kernel.
- */
+#include <sys/cdefs.h>
+
+#define in_cksum(m, len) in_cksum_skip(m, len, 0)
/*
- * Network types.
- *
- * Internally the system keeps counters in the headers with the bytes
- * swapped so that VAX instructions will work on them. It reverses
- * the bytes before transmission at each protocol level. The n_ types
- * represent the types with the bytes in ``high-ender'' order.
+ * It it useful to have an Internet checksum routine which is inlineable
+ * and optimized specifically for the task of computing IP header checksums
+ * in the normal case (where there are no options and the header length is
+ * therefore always exactly five 32-bit words.
*/
-typedef u_int16_t n_short; /* short as received from the net */
-typedef u_int32_t n_long; /* long as received from the net */
+#ifdef __CC_SUPPORTS___INLINE
-typedef u_int32_t n_time; /* ms since 00:00 GMT, byte rev */
+static __inline void
+in_cksum_update(struct ip *ip)
+{
+ int __tmpsum;
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256;
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16));
+}
+
+#else
+
+#define in_cksum_update(ip) \
+ do { \
+ int __tmpsum; \
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256; \
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \
+ } while(0)
-#ifdef _KERNEL
-uint32_t iptime(void);
#endif
+#ifdef _KERNEL
+u_int in_cksum_hdr(const struct ip *ip);
+u_short in_addword(u_short sum, u_short b);
+u_short in_pseudo(u_int sum, u_int b, u_int c);
+u_short in_cksum_skip(struct mbuf *m, int len, int skip);
#endif
+
+#endif /* _MACHINE_IN_CKSUM_H_ */
diff --git a/freebsd/sys/lm32/include/machine/legacyvar.h b/freebsd/sys/lm32/include/machine/legacyvar.h
new file mode 100644
index 00000000..0b0fa433
--- /dev/null
+++ b/freebsd/sys/lm32/include/machine/legacyvar.h
@@ -0,0 +1,57 @@
+/*-
+ * Copyright (c) 2000 Peter Wemm <peter@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_LEGACYVAR_H_
+#define _MACHINE_LEGACYVAR_H_
+
+enum legacy_device_ivars {
+ LEGACY_IVAR_PCIDOMAIN,
+ LEGACY_IVAR_PCIBUS
+};
+
+#define LEGACY_ACCESSOR(var, ivar, type) \
+ __BUS_ACCESSOR(legacy, var, LEGACY, ivar, type)
+
+LEGACY_ACCESSOR(pcidomain, PCIDOMAIN, uint32_t)
+LEGACY_ACCESSOR(pcibus, PCIBUS, uint32_t)
+
+#undef LEGACY_ACCESSOR
+
+int legacy_pcib_maxslots(device_t dev);
+uint32_t legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes);
+int legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result);
+void legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes);
+int legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value);
+struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child,
+ int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
+
+#endif /* !_MACHINE_LEGACYVAR_H_ */
diff --git a/freebsd/sys/lm32/include/machine/pci_cfgreg.h b/freebsd/sys/lm32/include/machine/pci_cfgreg.h
new file mode 100644
index 00000000..bc72418d
--- /dev/null
+++ b/freebsd/sys/lm32/include/machine/pci_cfgreg.h
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
+ */
+
+#define CONF1_ADDR_PORT 0x0cf8
+#define CONF1_DATA_PORT 0x0cfc
+
+#define CONF1_ENABLE 0x80000000ul
+#define CONF1_ENABLE_CHK 0x80000000ul
+#define CONF1_ENABLE_MSK 0x7f000000ul
+#define CONF1_ENABLE_CHK1 0xff000001ul
+#define CONF1_ENABLE_MSK1 0x80000001ul
+#define CONF1_ENABLE_RES1 0x80000000ul
+
+#define CONF2_ENABLE_PORT 0x0cf8
+#define CONF2_FORWARD_PORT 0x0cfa
+
+#define CONF2_ENABLE_CHK 0x0e
+#define CONF2_ENABLE_RES 0x0e
+
+int pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus);
+int pci_cfgregopen(void);
+u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes);
+void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes);
+void pci_pir_open(void);
+int pci_pir_probe(int bus, int require_parse);
+int pci_pir_route_interrupt(int bus, int device, int func, int pin);
diff --git a/freebsd/sys/lm32/lm32/in_cksum.c b/freebsd/sys/lm32/lm32/in_cksum.c
new file mode 100644
index 00000000..c6f7b568
--- /dev/null
+++ b/freebsd/sys/lm32/lm32/in_cksum.c
@@ -0,0 +1,255 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1988, 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ * Copyright (c) 1996
+ * Matt Thomas <matt@3am-software.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)in_cksum.c 8.1 (Berkeley) 6/10/93
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/mbuf.h>
+#include <sys/systm.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <machine/in_cksum.h>
+
+/*
+ * Checksum routine for Internet Protocol family headers
+ * (Portable Alpha version).
+ *
+ * This routine is very heavily used in the network
+ * code and should be modified for each CPU to be as fast as possible.
+ */
+
+#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x)
+#define REDUCE32 \
+ { \
+ q_util.q = sum; \
+ sum = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
+ }
+#define REDUCE16 \
+ { \
+ q_util.q = sum; \
+ l_util.l = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
+ sum = l_util.s[0] + l_util.s[1]; \
+ ADDCARRY(sum); \
+ }
+
+static const u_int32_t in_masks[] = {
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
+ 0x00000000, 0x000000FF, 0x0000FFFF, 0x00FFFFFF, /* offset 0 */
+ 0x00000000, 0x0000FF00, 0x00FFFF00, 0xFFFFFF00, /* offset 1 */
+ 0x00000000, 0x00FF0000, 0xFFFF0000, 0xFFFF0000, /* offset 2 */
+ 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, /* offset 3 */
+#else
+ /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
+ 0x00000000, 0xFF000000, 0xFFFF0000, 0xFFFFFF00, /* offset 0 */
+ 0x00000000, 0x00FF0000, 0x00FFFF00, 0x00FFFFFF, /* offset 1 */
+ 0x00000000, 0x0000FF00, 0x0000FFFF, 0x0000FFFF, /* offset 2 */
+ 0x00000000, 0x000000FF, 0x000000FF, 0x000000FF, /* offset 3 */
+#endif
+};
+
+union l_util {
+ u_int16_t s[2];
+ u_int32_t l;
+};
+union q_util {
+ u_int16_t s[4];
+ u_int32_t l[2];
+ u_int64_t q;
+};
+
+static u_int64_t
+in_cksumdata(const void *buf, int len)
+{
+ const u_int32_t *lw = (const u_int32_t *) buf;
+ u_int64_t sum = 0;
+ u_int64_t prefilled;
+ int offset;
+ union q_util q_util;
+
+ if ((3 & (long) lw) == 0 && len == 20) {
+ sum = (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3] + lw[4];
+ REDUCE32;
+ return sum;
+ }
+
+ if ((offset = 3 & (long) lw) != 0) {
+ const u_int32_t *masks = in_masks + (offset << 2);
+ lw = (u_int32_t *) (((long) lw) - offset);
+ sum = *lw++ & masks[len >= 3 ? 3 : len];
+ len -= 4 - offset;
+ if (len <= 0) {
+ REDUCE32;
+ return sum;
+ }
+ }
+#if 0
+ /*
+ * Force to cache line boundary.
+ */
+ offset = 32 - (0x1f & (long) lw);
+ if (offset < 32 && len > offset) {
+ len -= offset;
+ if (4 & offset) {
+ sum += (u_int64_t) lw[0];
+ lw += 1;
+ }
+ if (8 & offset) {
+ sum += (u_int64_t) lw[0] + lw[1];
+ lw += 2;
+ }
+ if (16 & offset) {
+ sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
+ lw += 4;
+ }
+ }
+#endif
+ /*
+ * access prefilling to start load of next cache line.
+ * then add current cache line
+ * save result of prefilling for loop iteration.
+ */
+ prefilled = lw[0];
+ while ((len -= 32) >= 4) {
+ u_int64_t prefilling = lw[8];
+ sum += prefilled + lw[1] + lw[2] + lw[3]
+ + lw[4] + lw[5] + lw[6] + lw[7];
+ lw += 8;
+ prefilled = prefilling;
+ }
+ if (len >= 0) {
+ sum += prefilled + lw[1] + lw[2] + lw[3]
+ + lw[4] + lw[5] + lw[6] + lw[7];
+ lw += 8;
+ } else {
+ len += 32;
+ }
+ while ((len -= 16) >= 0) {
+ sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
+ lw += 4;
+ }
+ len += 16;
+ while ((len -= 4) >= 0) {
+ sum += (u_int64_t) *lw++;
+ }
+ len += 4;
+ if (len > 0)
+ sum += (u_int64_t) (in_masks[len] & *lw);
+ REDUCE32;
+ return sum;
+}
+
+u_short
+in_addword(u_short a, u_short b)
+{
+ u_int64_t sum = a + b;
+
+ ADDCARRY(sum);
+ return (sum);
+}
+
+u_short
+#ifdef __rtems__
+/* Prototype does not match in FreeBSD code */
+in_pseudo(u_int a, u_int b, u_int c)
+#else
+in_pseudo(u_int32_t a, u_int32_t b, u_int32_t c)
+#endif
+{
+ u_int64_t sum;
+ union q_util q_util;
+ union l_util l_util;
+
+ sum = (u_int64_t) a + b + c;
+ REDUCE16;
+ return (sum);
+}
+
+u_short
+in_cksum_skip(struct mbuf *m, int len, int skip)
+{
+ u_int64_t sum = 0;
+ int mlen = 0;
+ int clen = 0;
+ caddr_t addr;
+ union q_util q_util;
+ union l_util l_util;
+
+ len -= skip;
+ for (; skip && m; m = m->m_next) {
+ if (m->m_len > skip) {
+ mlen = m->m_len - skip;
+ addr = mtod(m, caddr_t) + skip;
+ goto skip_start;
+ } else {
+ skip -= m->m_len;
+ }
+ }
+
+ for (; m && len; m = m->m_next) {
+ if (m->m_len == 0)
+ continue;
+ mlen = m->m_len;
+ addr = mtod(m, caddr_t);
+skip_start:
+ if (len < mlen)
+ mlen = len;
+
+ if ((clen ^ (uintptr_t) addr) & 1)
+ sum += in_cksumdata(addr, mlen) << 8;
+ else
+ sum += in_cksumdata(addr, mlen);
+
+ clen += mlen;
+ len -= mlen;
+ }
+ REDUCE16;
+ return (~sum & 0xffff);
+}
+
+u_int in_cksum_hdr(const struct ip *ip)
+{
+ u_int64_t sum = in_cksumdata(ip, sizeof(struct ip));
+ union q_util q_util;
+ union l_util l_util;
+ REDUCE16;
+ return (~sum & 0xffff);
+}
diff --git a/freebsd/sys/lm32/lm32/legacy.c b/freebsd/sys/lm32/lm32/legacy.c
new file mode 100644
index 00000000..2547990c
--- /dev/null
+++ b/freebsd/sys/lm32/lm32/legacy.c
@@ -0,0 +1,347 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright 1998 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby
+ * granted, provided that both the above copyright notice and this
+ * permission notice appear in all copies, that both the above
+ * copyright notice and this permission notice appear in all
+ * supporting documentation, and that the name of M.I.T. not be used
+ * in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission. M.I.T. makes
+ * no representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
+ * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
+ * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * This code implements a system driver for legacy systems that do not
+ * support ACPI or when ACPI support is not present in the kernel.
+ */
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <machine/bus.h>
+#include <sys/pcpu.h>
+#include <sys/rman.h>
+#include <sys/smp.h>
+
+#ifndef __rtems__
+#include <rtems/bsd/local/opt_mca.h>
+#endif /* __rtems__ */
+#ifdef DEV_MCA
+#include <i386/bios/mca_machdep.h>
+#endif
+
+#include <machine/legacyvar.h>
+#include <machine/resource.h>
+
+static MALLOC_DEFINE(M_LEGACYDEV, "legacydrv", "legacy system device");
+struct legacy_device {
+ int lg_pcibus;
+};
+
+#define DEVTOAT(dev) ((struct legacy_device *)device_get_ivars(dev))
+
+static int legacy_probe(device_t);
+static int legacy_attach(device_t);
+static int legacy_print_child(device_t, device_t);
+static device_t legacy_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static int legacy_read_ivar(device_t, device_t, int, uintptr_t *);
+static int legacy_write_ivar(device_t, device_t, int, uintptr_t);
+
+static device_method_t legacy_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, legacy_probe),
+ DEVMETHOD(device_attach, legacy_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, legacy_print_child),
+ DEVMETHOD(bus_add_child, legacy_add_child),
+ DEVMETHOD(bus_read_ivar, legacy_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_write_ivar),
+ DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t legacy_driver = {
+ "legacy",
+ legacy_methods,
+ 1, /* no softc */
+};
+static devclass_t legacy_devclass;
+
+DRIVER_MODULE(legacy, nexus, legacy_driver, legacy_devclass, 0, 0);
+
+static int
+legacy_probe(device_t dev)
+{
+
+ device_set_desc(dev, "legacy system");
+ device_quiet(dev);
+ return (0);
+}
+
+static int
+legacy_attach(device_t dev)
+{
+ device_t child;
+
+ /*
+ * Let our child drivers identify any child devices that they
+ * can find. Once that is done attach any devices that we
+ * found.
+ */
+ bus_generic_probe(dev);
+ bus_generic_attach(dev);
+
+#ifndef PC98
+ /*
+ * If we didn't see EISA or ISA on a pci bridge, create some
+ * connection points now so they show up "on motherboard".
+ */
+ if (!devclass_get_device(devclass_find("eisa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "eisa", 0);
+ if (child == NULL)
+ panic("legacy_attach eisa");
+ device_probe_and_attach(child);
+ }
+#endif
+#ifdef DEV_MCA
+ if (MCA_system && !devclass_get_device(devclass_find("mca"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "mca", 0);
+ if (child == 0)
+ panic("legacy_probe mca");
+ device_probe_and_attach(child);
+ }
+#endif
+ if (!devclass_get_device(devclass_find("isa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "isa", 0);
+ if (child == NULL)
+ panic("legacy_attach isa");
+ device_probe_and_attach(child);
+ }
+
+ return 0;
+}
+
+static int
+legacy_print_child(device_t bus, device_t child)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+ int retval = 0;
+
+ retval += bus_print_child_header(bus, child);
+ if (atdev->lg_pcibus != -1)
+ retval += printf(" pcibus %d", atdev->lg_pcibus);
+ retval += printf(" on motherboard\n"); /* XXX "motherboard", ick */
+
+ return (retval);
+}
+
+static device_t
+legacy_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ device_t child;
+ struct legacy_device *atdev;
+
+ atdev = malloc(sizeof(struct legacy_device), M_LEGACYDEV,
+ M_NOWAIT | M_ZERO);
+ if (atdev == NULL)
+ return(NULL);
+ atdev->lg_pcibus = -1;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child == NULL)
+ free(atdev, M_LEGACYDEV);
+ else
+ /* should we free this in legacy_child_detached? */
+ device_set_ivars(child, atdev);
+
+ return (child);
+}
+
+static int
+legacy_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ *result = 0;
+ break;
+ case LEGACY_IVAR_PCIBUS:
+ *result = atdev->lg_pcibus;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+
+static int
+legacy_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ return EINVAL;
+ case LEGACY_IVAR_PCIBUS:
+ atdev->lg_pcibus = value;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+/*
+ * Legacy CPU attachment when ACPI is not available. Drivers like
+ * cpufreq(4) hang off this.
+ */
+static void cpu_identify(driver_t *driver, device_t parent);
+static int cpu_read_ivar(device_t dev, device_t child, int index,
+ uintptr_t *result);
+static device_t cpu_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static struct resource_list *cpu_get_rlist(device_t dev, device_t child);
+
+struct cpu_device {
+ struct resource_list cd_rl;
+ struct pcpu *cd_pcpu;
+};
+
+static device_method_t cpu_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, cpu_identify),
+ DEVMETHOD(device_probe, bus_generic_probe),
+ DEVMETHOD(device_attach, bus_generic_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_add_child, cpu_add_child),
+ DEVMETHOD(bus_read_ivar, cpu_read_ivar),
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_get_resource_list, cpu_get_rlist),
+ DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
+ DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource),
+ DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource),
+ DEVMETHOD(bus_driver_added, bus_generic_driver_added),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t cpu_driver = {
+ "cpu",
+ cpu_methods,
+ 1, /* no softc */
+};
+static devclass_t cpu_devclass;
+DRIVER_MODULE(cpu, legacy, cpu_driver, cpu_devclass, 0, 0);
+
+static void
+cpu_identify(driver_t *driver, device_t parent)
+{
+ device_t child;
+ int i;
+
+ /*
+ * Attach a cpuX device for each CPU. We use an order of 150
+ * so that these devices are attached after the Host-PCI
+ * bridges (which are added at order 100).
+ */
+ for (i = 0; i <= mp_maxid; i++)
+ if (!CPU_ABSENT(i)) {
+ child = BUS_ADD_CHILD(parent, 150, "cpu", i);
+ if (child == NULL)
+ panic("legacy_attach cpu");
+ }
+}
+
+static device_t
+cpu_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ struct cpu_device *cd;
+ device_t child;
+ struct pcpu *pc;
+
+ if ((cd = malloc(sizeof(*cd), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL)
+ return (NULL);
+
+ resource_list_init(&cd->cd_rl);
+ pc = pcpu_find(device_get_unit(bus));
+ cd->cd_pcpu = pc;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child != NULL) {
+ pc->pc_device = child;
+ device_set_ivars(child, cd);
+ } else
+ free(cd, M_DEVBUF);
+ return (child);
+}
+
+static struct resource_list *
+cpu_get_rlist(device_t dev, device_t child)
+{
+ struct cpu_device *cpdev;
+
+ cpdev = device_get_ivars(child);
+ return (&cpdev->cd_rl);
+}
+
+static int
+cpu_read_ivar(device_t dev, device_t child, int index, uintptr_t *result)
+{
+ struct cpu_device *cpdev;
+
+ if (index != CPU_IVAR_PCPU)
+ return (ENOENT);
+ cpdev = device_get_ivars(child);
+ *result = (uintptr_t)cpdev->cd_pcpu;
+ return (0);
+}
diff --git a/freebsd/sys/lm32/pci/pci_bus.c b/freebsd/sys/lm32/pci/pci_bus.c
new file mode 100644
index 00000000..6627db98
--- /dev/null
+++ b/freebsd/sys/lm32/pci/pci_bus.c
@@ -0,0 +1,729 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/local/opt_cpu.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
+
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcib_private.h>
+#include <isa/isavar.h>
+#ifdef CPU_ELAN
+#include <machine/md_var.h>
+#endif
+#include <machine/legacyvar.h>
+#include <machine/pci_cfgreg.h>
+#include <machine/resource.h>
+
+#include <rtems/bsd/local/pcib_if.h>
+
+#ifndef __rtems__
+static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev,
+ int pin);
+#else /* __rtems__ */
+int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin);
+#endif /* __rtems__ */
+
+
+int
+legacy_pcib_maxslots(device_t dev)
+{
+ return 31;
+}
+
+/* read configuration space register */
+
+#ifdef __rtems__
+uint32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#else
+u_int32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#endif
+{
+ return(pci_cfgregread(bus, slot, func, reg, bytes));
+}
+
+/* write configuration space register */
+
+void
+legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes)
+{
+ pci_cfgregwrite(bus, slot, func, reg, data, bytes);
+}
+
+/* Pass MSI requests up to the nexus. */
+
+static int
+legacy_pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount,
+ int *irqs)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSI(device_get_parent(bus), dev, count, maxcount,
+ irqs));
+}
+
+static int
+legacy_pcib_alloc_msix(device_t pcib, device_t dev, int *irq)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq));
+}
+
+static int
+legacy_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr,
+ uint32_t *data)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data));
+}
+
+static const char *
+legacy_pcib_is_host_bridge(int bus, int slot, int func,
+ uint32_t id, uint8_t class, uint8_t subclass,
+ uint8_t *busnum)
+{
+ const char *s = NULL;
+ static uint8_t pxb[4]; /* hack for 450nx */
+
+ *busnum = 0;
+
+ switch (id) {
+ case 0x12258086:
+ s = "Intel 824?? host to PCI bridge";
+ /* XXX This is a guess */
+ /* *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x41, 1); */
+ *busnum = bus;
+ break;
+ case 0x71208086:
+ s = "Intel 82810 (i810 GMCH) Host To Hub bridge";
+ break;
+ case 0x71228086:
+ s = "Intel 82810-DC100 (i810-DC100 GMCH) Host To Hub bridge";
+ break;
+ case 0x71248086:
+ s = "Intel 82810E (i810E GMCH) Host To Hub bridge";
+ break;
+ case 0x11308086:
+ s = "Intel 82815 (i815 GMCH) Host To Hub bridge";
+ break;
+ case 0x71808086:
+ s = "Intel 82443LX (440 LX) host to PCI bridge";
+ break;
+ case 0x71908086:
+ s = "Intel 82443BX (440 BX) host to PCI bridge";
+ break;
+ case 0x71928086:
+ s = "Intel 82443BX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x71948086:
+ s = "Intel 82443MX host to PCI bridge";
+ break;
+ case 0x71a08086:
+ s = "Intel 82443GX host to PCI bridge";
+ break;
+ case 0x71a18086:
+ s = "Intel 82443GX host to AGP bridge";
+ break;
+ case 0x71a28086:
+ s = "Intel 82443GX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x84c48086:
+ s = "Intel 82454KX/GX (Orion) host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x4a, 1);
+ break;
+ case 0x84ca8086:
+ /*
+ * For the 450nx chipset, there is a whole bundle of
+ * things pretending to be host bridges. The MIOC will
+ * be seen first and isn't really a pci bridge (the
+ * actual busses are attached to the PXB's). We need to
+ * read the registers of the MIOC to figure out the
+ * bus numbers for the PXB channels.
+ *
+ * Since the MIOC doesn't have a pci bus attached, we
+ * pretend it wasn't there.
+ */
+ pxb[0] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd0, 1); /* BUSNO[0] */
+ pxb[1] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd1, 1) + 1; /* SUBA[0]+1 */
+ pxb[2] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd3, 1); /* BUSNO[1] */
+ pxb[3] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd4, 1) + 1; /* SUBA[1]+1 */
+ return NULL;
+ case 0x84cb8086:
+ switch (slot) {
+ case 0x12:
+ s = "Intel 82454NX PXB#0, Bus#A";
+ *busnum = pxb[0];
+ break;
+ case 0x13:
+ s = "Intel 82454NX PXB#0, Bus#B";
+ *busnum = pxb[1];
+ break;
+ case 0x14:
+ s = "Intel 82454NX PXB#1, Bus#A";
+ *busnum = pxb[2];
+ break;
+ case 0x15:
+ s = "Intel 82454NX PXB#1, Bus#B";
+ *busnum = pxb[3];
+ break;
+ }
+ break;
+ case 0x1A308086:
+ s = "Intel 82845 Host to PCI bridge";
+ break;
+
+ /* AMD -- vendor 0x1022 */
+ case 0x30001022:
+ s = "AMD Elan SC520 host to PCI bridge";
+#ifdef CPU_ELAN
+ init_AMD_Elan_sc520();
+#else
+ printf(
+"*** WARNING: missing CPU_ELAN -- timekeeping may be wrong\n");
+#endif
+ break;
+ case 0x70061022:
+ s = "AMD-751 host to PCI bridge";
+ break;
+ case 0x700e1022:
+ s = "AMD-761 host to PCI bridge";
+ break;
+
+ /* SiS -- vendor 0x1039 */
+ case 0x04961039:
+ s = "SiS 85c496";
+ break;
+ case 0x04061039:
+ s = "SiS 85c501";
+ break;
+ case 0x06011039:
+ s = "SiS 85c601";
+ break;
+ case 0x55911039:
+ s = "SiS 5591 host to PCI bridge";
+ break;
+ case 0x00011039:
+ s = "SiS 5591 host to AGP bridge";
+ break;
+
+ /* VLSI -- vendor 0x1004 */
+ case 0x00051004:
+ s = "VLSI 82C592 Host to PCI bridge";
+ break;
+
+ /* XXX Here is MVP3, I got the datasheet but NO M/B to test it */
+ /* totally. Please let me know if anything wrong. -F */
+ /* XXX need info on the MVP3 -- any takers? */
+ case 0x05981106:
+ s = "VIA 82C598MVP (Apollo MVP3) host bridge";
+ break;
+
+ /* AcerLabs -- vendor 0x10b9 */
+ /* Funny : The datasheet told me vendor id is "10b8",sub-vendor */
+ /* id is '10b9" but the register always shows "10b9". -Foxfair */
+ case 0x154110b9:
+ s = "AcerLabs M1541 (Aladdin-V) PCI host bridge";
+ break;
+
+ /* OPTi -- vendor 0x1045 */
+ case 0xc7011045:
+ s = "OPTi 82C700 host to PCI bridge";
+ break;
+ case 0xc8221045:
+ s = "OPTi 82C822 host to PCI Bridge";
+ break;
+
+ /* ServerWorks -- vendor 0x1166 */
+ case 0x00051166:
+ s = "ServerWorks NB6536 2.0HE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00061166:
+ /* FALLTHROUGH */
+ case 0x00081166:
+ /* FALLTHROUGH */
+ case 0x02011166:
+ /* FALLTHROUGH */
+ case 0x010f1014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00091166:
+ s = "ServerWorks NB6635 3.0LE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00101166:
+ s = "ServerWorks CIOB30 host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00111166:
+ /* FALLTHROUGH */
+ case 0x03021014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks CMIC-HE host to PCI-X bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* XXX unknown chipset, but working */
+ case 0x00171166:
+ /* FALLTHROUGH */
+ case 0x01011166:
+ case 0x01101166:
+ case 0x02251166:
+ s = "ServerWorks host to PCI bridge(unknown chipset)";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* Compaq/HP -- vendor 0x0e11 */
+ case 0x60100e11:
+ s = "Compaq/HP Model 6010 HotPlug PCI Bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0xc8, 1);
+ break;
+
+ /* Integrated Micro Solutions -- vendor 0x10e0 */
+ case 0x884910e0:
+ s = "Integrated Micro Solutions VL Bridge";
+ break;
+
+ default:
+ if (class == PCIC_BRIDGE && subclass == PCIS_BRIDGE_HOST)
+ s = "Host to PCI bridge";
+ break;
+ }
+
+ return s;
+}
+
+/*
+ * Scan the first pci bus for host-pci bridges and add pcib instances
+ * to the nexus for each bridge.
+ */
+static void
+legacy_pcib_identify(driver_t *driver, device_t parent)
+{
+ int bus, slot, func;
+ u_int8_t hdrtype;
+ int found = 0;
+ int pcifunchigh;
+ int found824xx = 0;
+ int found_orion = 0;
+ device_t child;
+ devclass_t pci_devclass;
+
+ if (pci_cfgregopen() == 0)
+ return;
+ /*
+ * Check to see if we haven't already had a PCI bus added
+ * via some other means. If we have, bail since otherwise
+ * we're going to end up duplicating it.
+ */
+ if ((pci_devclass = devclass_find("pci")) &&
+ devclass_get_device(pci_devclass, 0))
+ return;
+
+
+ bus = 0;
+ retry:
+ for (slot = 0; slot <= PCI_SLOTMAX; slot++) {
+ func = 0;
+ hdrtype = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_HDRTYPE, 1);
+ /*
+ * When enumerating bus devices, the standard says that
+ * one should check the header type and ignore the slots whose
+ * header types that the software doesn't know about. We use
+ * this to filter out devices.
+ */
+ if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE)
+ continue;
+ if ((hdrtype & PCIM_MFDEV) &&
+ (!found_orion || hdrtype != 0xff))
+ pcifunchigh = PCI_FUNCMAX;
+ else
+ pcifunchigh = 0;
+ for (func = 0; func <= pcifunchigh; func++) {
+ /*
+ * Read the IDs and class from the device.
+ */
+ u_int32_t id;
+ u_int8_t class, subclass, busnum;
+ const char *s;
+ device_t *devs;
+ int ndevs, i;
+
+ id = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_DEVVENDOR, 4);
+ if (id == -1)
+ continue;
+ class = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_CLASS, 1);
+ subclass = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_SUBCLASS, 1);
+
+ s = legacy_pcib_is_host_bridge(bus, slot, func,
+ id, class, subclass,
+ &busnum);
+ if (s == NULL)
+ continue;
+
+ /*
+ * Check to see if the physical bus has already
+ * been seen. Eg: hybrid 32 and 64 bit host
+ * bridges to the same logical bus.
+ */
+ if (device_get_children(parent, &devs, &ndevs) == 0) {
+ for (i = 0; s != NULL && i < ndevs; i++) {
+ if (strcmp(device_get_name(devs[i]),
+ "pcib") != 0)
+ continue;
+ if (legacy_get_pcibus(devs[i]) == busnum)
+ s = NULL;
+ }
+ free(devs, M_TEMP);
+ }
+
+ if (s == NULL)
+ continue;
+ /*
+ * Add at priority 100 to make sure we
+ * go after any motherboard resources
+ */
+ child = BUS_ADD_CHILD(parent, 100,
+ "pcib", busnum);
+ device_set_desc(child, s);
+ legacy_set_pcibus(child, busnum);
+
+ found = 1;
+ if (id == 0x12258086)
+ found824xx = 1;
+ if (id == 0x84c48086)
+ found_orion = 1;
+ }
+ }
+ if (found824xx && bus == 0) {
+ bus++;
+ goto retry;
+ }
+
+ /*
+ * Make sure we add at least one bridge since some old
+ * hardware doesn't actually have a host-pci bridge device.
+ * Note that pci_cfgregopen() thinks we have PCI devices..
+ */
+ if (!found) {
+ if (bootverbose)
+ printf(
+ "legacy_pcib_identify: no bridge found, adding pcib0 anyway\n");
+ child = BUS_ADD_CHILD(parent, 100, "pcib", 0);
+ legacy_set_pcibus(child, 0);
+ }
+}
+
+static int
+legacy_pcib_probe(device_t dev)
+{
+
+ if (pci_cfgregopen() == 0)
+ return ENXIO;
+ return -100;
+}
+
+static int
+legacy_pcib_attach(device_t dev)
+{
+ device_t pir;
+ int bus;
+
+ /*
+ * Look for a PCI BIOS interrupt routing table as that will be
+ * our method of routing interrupts if we have one.
+ */
+ bus = pcib_get_bus(dev);
+#ifndef __rtems__
+ if (pci_pir_probe(bus, 0)) {
+ pir = BUS_ADD_CHILD(device_get_parent(dev), 0, "pir", 0);
+ if (pir != NULL)
+ device_probe_and_attach(pir);
+ }
+#else /* __rtems__ */
+#endif /* __rtems__ */
+ device_add_child(dev, "pci", bus);
+ return bus_generic_attach(dev);
+}
+
+int
+legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ *result = 0;
+ return 0;
+ case PCIB_IVAR_BUS:
+ *result = legacy_get_pcibus(dev);
+ return 0;
+ }
+ return ENOENT;
+}
+
+int
+legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ return EINVAL;
+ case PCIB_IVAR_BUS:
+ legacy_set_pcibus(dev, value);
+ return 0;
+ }
+ return ENOENT;
+}
+
+SYSCTL_DECL(_hw_pci);
+
+static unsigned long legacy_host_mem_start = 0x80000000;
+TUNABLE_ULONG("hw.pci.host_mem_start", &legacy_host_mem_start);
+SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN,
+ &legacy_host_mem_start, 0x80000000,
+ "Limit the host bridge memory to being above this address. Must be\n\
+set at boot via a tunable.");
+
+struct resource *
+legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
+ u_long start, u_long end, u_long count, u_int flags)
+{
+ /*
+ * If no memory preference is given, use upper 32MB slot most
+ * bioses use for their memory window. Typically other bridges
+ * before us get in the way to assert their preferences on memory.
+ * Hardcoding like this sucks, so a more MD/MI way needs to be
+ * found to do it. This is typically only used on older laptops
+ * that don't have pci busses behind pci bridge, so assuming > 32MB
+ * is liekly OK.
+ *
+ * However, this can cause problems for other chipsets, so we make
+ * this tunable by hw.pci.host_mem_start.
+ */
+ if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL)
+ start = legacy_host_mem_start;
+ if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL)
+ start = 0x1000;
+ return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
+ count, flags));
+}
+
+static device_method_t legacy_pcib_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, legacy_pcib_identify),
+ DEVMETHOD(device_probe, legacy_pcib_probe),
+ DEVMETHOD(device_attach, legacy_pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, legacy_pcib_maxslots),
+ DEVMETHOD(pcib_read_config, legacy_pcib_read_config),
+ DEVMETHOD(pcib_write_config, legacy_pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, legacy_pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, legacy_pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, legacy_pcib_map_msi),
+
+ { 0, 0 }
+};
+
+static devclass_t hostb_devclass;
+
+DEFINE_CLASS_0(pcib, legacy_pcib_driver, legacy_pcib_methods, 1);
+DRIVER_MODULE(pcib, legacy, legacy_pcib_driver, hostb_devclass, 0, 0);
+
+
+#ifndef __rtems__
+/*
+ * Install placeholder to claim the resources owned by the
+ * PCI bus interface. This could be used to extract the
+ * config space registers in the extreme case where the PnP
+ * ID is available and the PCI BIOS isn't, but for now we just
+ * eat the PnP ID and do nothing else.
+ *
+ * XXX we should silence this probe, as it will generally confuse
+ * people.
+ */
+static struct isa_pnp_id pcibus_pnp_ids[] = {
+ { 0x030ad041 /* PNP0A03 */, "PCI Bus" },
+ { 0x080ad041 /* PNP0A08 */, "PCIe Bus" },
+ { 0 }
+};
+
+static int
+pcibus_pnp_probe(device_t dev)
+{
+ int result;
+
+ if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, pcibus_pnp_ids)) <= 0)
+ device_quiet(dev);
+ return(result);
+}
+
+static int
+pcibus_pnp_attach(device_t dev)
+{
+ return(0);
+}
+
+static device_method_t pcibus_pnp_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibus_pnp_probe),
+ DEVMETHOD(device_attach, pcibus_pnp_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+ { 0, 0 }
+};
+
+static devclass_t pcibus_pnp_devclass;
+
+DEFINE_CLASS_0(pcibus_pnp, pcibus_pnp_driver, pcibus_pnp_methods, 1);
+DRIVER_MODULE(pcibus_pnp, isa, pcibus_pnp_driver, pcibus_pnp_devclass, 0, 0);
+
+
+/*
+ * Provide a PCI-PCI bridge driver for PCI busses behind PCI-PCI bridges
+ * that appear in the PCIBIOS Interrupt Routing Table to use the routing
+ * table for interrupt routing when possible.
+ */
+static int pcibios_pcib_probe(device_t bus);
+
+static device_method_t pcibios_pcib_pci_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibios_pcib_probe),
+ DEVMETHOD(device_attach, pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, pcib_maxslots),
+ DEVMETHOD(pcib_read_config, pcib_read_config),
+ DEVMETHOD(pcib_write_config, pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, pcib_map_msi),
+
+ {0, 0}
+};
+
+static devclass_t pcib_devclass;
+
+DEFINE_CLASS_0(pcib, pcibios_pcib_driver, pcibios_pcib_pci_methods,
+ sizeof(struct pcib_softc));
+DRIVER_MODULE(pcibios_pcib, pci, pcibios_pcib_driver, pcib_devclass, 0, 0);
+
+static int
+pcibios_pcib_probe(device_t dev)
+{
+ int bus;
+
+ if ((pci_get_class(dev) != PCIC_BRIDGE) ||
+ (pci_get_subclass(dev) != PCIS_BRIDGE_PCI))
+ return (ENXIO);
+ bus = pci_read_config(dev, PCIR_SECBUS_1, 1);
+ if (bus == 0)
+ return (ENXIO);
+ if (!pci_pir_probe(bus, 1))
+ return (ENXIO);
+ device_set_desc(dev, "PCIBIOS PCI-PCI bridge");
+ return (-2000);
+}
+
+static int
+pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
+{
+ return (pci_pir_route_interrupt(pci_get_bus(dev), pci_get_slot(dev),
+ pci_get_function(dev), pin));
+}
+#endif /* __rtems__ */
diff --git a/rtemsbsd/freebsd/machine/endian.h b/freebsd/sys/m32c/include/machine/in_cksum.h
index 358200c3..37d88e2e 100644
--- a/rtemsbsd/freebsd/machine/endian.h
+++ b/freebsd/sys/m32c/include/machine/in_cksum.h
@@ -1,22 +1,6 @@
-/**
- * @file
- *
- * @ingroup rtems_bsd_machine
- *
- * @brief TODO.
- */
-
-/*
- * Copyright (c) 2009-2012 embedded brains GmbH. All rights reserved.
- *
- * embedded brains GmbH
- * Obere Lagerstr. 30
- * 82178 Puchheim
- * Germany
- * <rtems@embedded-brains.de>
- *
- * Copyright (c) 1987, 1991, 1993
- * The Regents of the University of California. All rights reserved.
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -41,45 +25,53 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
+ *
+ * from tahoe: in_cksum.c 1.2 86/01/05
+ * from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91
+ * from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp
+ * from: src/sys/alpha/include/in_cksum.h,v 1.7 2005/03/02 21:33:20 joerg
+ * $FreeBSD$
*/
-#ifndef _RTEMS_BSD_MACHINE_ENDIAN_H
-#define _RTEMS_BSD_MACHINE_ENDIAN_H
+#ifndef _MACHINE_IN_CKSUM_H_
+#define _MACHINE_IN_CKSUM_H_ 1
-#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_
-#error "the header file <freebsd/machine/rtems-bsd-config.h> must be included first"
-#endif
+#include <sys/cdefs.h>
+
+#define in_cksum(m, len) in_cksum_skip(m, len, 0)
-#include <rtems/endian.h>
+/*
+ * It it useful to have an Internet checksum routine which is inlineable
+ * and optimized specifically for the task of computing IP header checksums
+ * in the normal case (where there are no options and the header length is
+ * therefore always exactly five 32-bit words.
+ */
+#ifdef __CC_SUPPORTS___INLINE
-#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
-#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
-#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
+static __inline void
+in_cksum_update(struct ip *ip)
+{
+ int __tmpsum;
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256;
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16));
+}
-#if CPU_BIG_ENDIAN
-# define _BYTE_ORDER _BIG_ENDIAN
-#elif CPU_LITTLE_ENDIAN
-# define _BYTE_ORDER _LITTLE_ENDIAN
#else
-# error "undefined endian"
-#endif
-#define __bswap16(x) CPU_swap_u16(x)
-#define __bswap32(x) CPU_swap_u32(x)
+#define in_cksum_update(ip) \
+ do { \
+ int __tmpsum; \
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256; \
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \
+ } while(0)
-#define __htonl(x) __bswap32(x)
-#define __htons(x) __bswap16(x)
-#define __ntohl(x) __bswap32(x)
-#define __ntohs(x) __bswap16(x)
-
-static __inline uint64_t
-__bswap64(uint64_t _x)
-{
+#endif
- return ((_x >> 56) | ((_x >> 40) & 0xff00) | ((_x >> 24) & 0xff0000) |
- ((_x >> 8) & 0xff000000) | ((_x << 8) & ((uint64_t)0xff << 32)) |
- ((_x << 24) & ((uint64_t)0xff << 40)) |
- ((_x << 40) & ((uint64_t)0xff << 48)) | ((_x << 56)));
-}
+#ifdef _KERNEL
+u_int in_cksum_hdr(const struct ip *ip);
+u_short in_addword(u_short sum, u_short b);
+u_short in_pseudo(u_int sum, u_int b, u_int c);
+u_short in_cksum_skip(struct mbuf *m, int len, int skip);
+#endif
-#endif /* _RTEMS_BSD_MACHINE_ENDIAN_H */
+#endif /* _MACHINE_IN_CKSUM_H_ */
diff --git a/freebsd/sys/m32c/include/machine/legacyvar.h b/freebsd/sys/m32c/include/machine/legacyvar.h
new file mode 100644
index 00000000..0b0fa433
--- /dev/null
+++ b/freebsd/sys/m32c/include/machine/legacyvar.h
@@ -0,0 +1,57 @@
+/*-
+ * Copyright (c) 2000 Peter Wemm <peter@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_LEGACYVAR_H_
+#define _MACHINE_LEGACYVAR_H_
+
+enum legacy_device_ivars {
+ LEGACY_IVAR_PCIDOMAIN,
+ LEGACY_IVAR_PCIBUS
+};
+
+#define LEGACY_ACCESSOR(var, ivar, type) \
+ __BUS_ACCESSOR(legacy, var, LEGACY, ivar, type)
+
+LEGACY_ACCESSOR(pcidomain, PCIDOMAIN, uint32_t)
+LEGACY_ACCESSOR(pcibus, PCIBUS, uint32_t)
+
+#undef LEGACY_ACCESSOR
+
+int legacy_pcib_maxslots(device_t dev);
+uint32_t legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes);
+int legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result);
+void legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes);
+int legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value);
+struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child,
+ int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
+
+#endif /* !_MACHINE_LEGACYVAR_H_ */
diff --git a/freebsd/sys/m32c/include/machine/pci_cfgreg.h b/freebsd/sys/m32c/include/machine/pci_cfgreg.h
new file mode 100644
index 00000000..bc72418d
--- /dev/null
+++ b/freebsd/sys/m32c/include/machine/pci_cfgreg.h
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
+ */
+
+#define CONF1_ADDR_PORT 0x0cf8
+#define CONF1_DATA_PORT 0x0cfc
+
+#define CONF1_ENABLE 0x80000000ul
+#define CONF1_ENABLE_CHK 0x80000000ul
+#define CONF1_ENABLE_MSK 0x7f000000ul
+#define CONF1_ENABLE_CHK1 0xff000001ul
+#define CONF1_ENABLE_MSK1 0x80000001ul
+#define CONF1_ENABLE_RES1 0x80000000ul
+
+#define CONF2_ENABLE_PORT 0x0cf8
+#define CONF2_FORWARD_PORT 0x0cfa
+
+#define CONF2_ENABLE_CHK 0x0e
+#define CONF2_ENABLE_RES 0x0e
+
+int pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus);
+int pci_cfgregopen(void);
+u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes);
+void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes);
+void pci_pir_open(void);
+int pci_pir_probe(int bus, int require_parse);
+int pci_pir_route_interrupt(int bus, int device, int func, int pin);
diff --git a/freebsd/sys/m32c/m32c/in_cksum.c b/freebsd/sys/m32c/m32c/in_cksum.c
new file mode 100644
index 00000000..c6f7b568
--- /dev/null
+++ b/freebsd/sys/m32c/m32c/in_cksum.c
@@ -0,0 +1,255 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1988, 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ * Copyright (c) 1996
+ * Matt Thomas <matt@3am-software.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)in_cksum.c 8.1 (Berkeley) 6/10/93
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/mbuf.h>
+#include <sys/systm.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <machine/in_cksum.h>
+
+/*
+ * Checksum routine for Internet Protocol family headers
+ * (Portable Alpha version).
+ *
+ * This routine is very heavily used in the network
+ * code and should be modified for each CPU to be as fast as possible.
+ */
+
+#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x)
+#define REDUCE32 \
+ { \
+ q_util.q = sum; \
+ sum = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
+ }
+#define REDUCE16 \
+ { \
+ q_util.q = sum; \
+ l_util.l = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
+ sum = l_util.s[0] + l_util.s[1]; \
+ ADDCARRY(sum); \
+ }
+
+static const u_int32_t in_masks[] = {
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
+ 0x00000000, 0x000000FF, 0x0000FFFF, 0x00FFFFFF, /* offset 0 */
+ 0x00000000, 0x0000FF00, 0x00FFFF00, 0xFFFFFF00, /* offset 1 */
+ 0x00000000, 0x00FF0000, 0xFFFF0000, 0xFFFF0000, /* offset 2 */
+ 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, /* offset 3 */
+#else
+ /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
+ 0x00000000, 0xFF000000, 0xFFFF0000, 0xFFFFFF00, /* offset 0 */
+ 0x00000000, 0x00FF0000, 0x00FFFF00, 0x00FFFFFF, /* offset 1 */
+ 0x00000000, 0x0000FF00, 0x0000FFFF, 0x0000FFFF, /* offset 2 */
+ 0x00000000, 0x000000FF, 0x000000FF, 0x000000FF, /* offset 3 */
+#endif
+};
+
+union l_util {
+ u_int16_t s[2];
+ u_int32_t l;
+};
+union q_util {
+ u_int16_t s[4];
+ u_int32_t l[2];
+ u_int64_t q;
+};
+
+static u_int64_t
+in_cksumdata(const void *buf, int len)
+{
+ const u_int32_t *lw = (const u_int32_t *) buf;
+ u_int64_t sum = 0;
+ u_int64_t prefilled;
+ int offset;
+ union q_util q_util;
+
+ if ((3 & (long) lw) == 0 && len == 20) {
+ sum = (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3] + lw[4];
+ REDUCE32;
+ return sum;
+ }
+
+ if ((offset = 3 & (long) lw) != 0) {
+ const u_int32_t *masks = in_masks + (offset << 2);
+ lw = (u_int32_t *) (((long) lw) - offset);
+ sum = *lw++ & masks[len >= 3 ? 3 : len];
+ len -= 4 - offset;
+ if (len <= 0) {
+ REDUCE32;
+ return sum;
+ }
+ }
+#if 0
+ /*
+ * Force to cache line boundary.
+ */
+ offset = 32 - (0x1f & (long) lw);
+ if (offset < 32 && len > offset) {
+ len -= offset;
+ if (4 & offset) {
+ sum += (u_int64_t) lw[0];
+ lw += 1;
+ }
+ if (8 & offset) {
+ sum += (u_int64_t) lw[0] + lw[1];
+ lw += 2;
+ }
+ if (16 & offset) {
+ sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
+ lw += 4;
+ }
+ }
+#endif
+ /*
+ * access prefilling to start load of next cache line.
+ * then add current cache line
+ * save result of prefilling for loop iteration.
+ */
+ prefilled = lw[0];
+ while ((len -= 32) >= 4) {
+ u_int64_t prefilling = lw[8];
+ sum += prefilled + lw[1] + lw[2] + lw[3]
+ + lw[4] + lw[5] + lw[6] + lw[7];
+ lw += 8;
+ prefilled = prefilling;
+ }
+ if (len >= 0) {
+ sum += prefilled + lw[1] + lw[2] + lw[3]
+ + lw[4] + lw[5] + lw[6] + lw[7];
+ lw += 8;
+ } else {
+ len += 32;
+ }
+ while ((len -= 16) >= 0) {
+ sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
+ lw += 4;
+ }
+ len += 16;
+ while ((len -= 4) >= 0) {
+ sum += (u_int64_t) *lw++;
+ }
+ len += 4;
+ if (len > 0)
+ sum += (u_int64_t) (in_masks[len] & *lw);
+ REDUCE32;
+ return sum;
+}
+
+u_short
+in_addword(u_short a, u_short b)
+{
+ u_int64_t sum = a + b;
+
+ ADDCARRY(sum);
+ return (sum);
+}
+
+u_short
+#ifdef __rtems__
+/* Prototype does not match in FreeBSD code */
+in_pseudo(u_int a, u_int b, u_int c)
+#else
+in_pseudo(u_int32_t a, u_int32_t b, u_int32_t c)
+#endif
+{
+ u_int64_t sum;
+ union q_util q_util;
+ union l_util l_util;
+
+ sum = (u_int64_t) a + b + c;
+ REDUCE16;
+ return (sum);
+}
+
+u_short
+in_cksum_skip(struct mbuf *m, int len, int skip)
+{
+ u_int64_t sum = 0;
+ int mlen = 0;
+ int clen = 0;
+ caddr_t addr;
+ union q_util q_util;
+ union l_util l_util;
+
+ len -= skip;
+ for (; skip && m; m = m->m_next) {
+ if (m->m_len > skip) {
+ mlen = m->m_len - skip;
+ addr = mtod(m, caddr_t) + skip;
+ goto skip_start;
+ } else {
+ skip -= m->m_len;
+ }
+ }
+
+ for (; m && len; m = m->m_next) {
+ if (m->m_len == 0)
+ continue;
+ mlen = m->m_len;
+ addr = mtod(m, caddr_t);
+skip_start:
+ if (len < mlen)
+ mlen = len;
+
+ if ((clen ^ (uintptr_t) addr) & 1)
+ sum += in_cksumdata(addr, mlen) << 8;
+ else
+ sum += in_cksumdata(addr, mlen);
+
+ clen += mlen;
+ len -= mlen;
+ }
+ REDUCE16;
+ return (~sum & 0xffff);
+}
+
+u_int in_cksum_hdr(const struct ip *ip)
+{
+ u_int64_t sum = in_cksumdata(ip, sizeof(struct ip));
+ union q_util q_util;
+ union l_util l_util;
+ REDUCE16;
+ return (~sum & 0xffff);
+}
diff --git a/freebsd/sys/m32c/m32c/legacy.c b/freebsd/sys/m32c/m32c/legacy.c
new file mode 100644
index 00000000..2547990c
--- /dev/null
+++ b/freebsd/sys/m32c/m32c/legacy.c
@@ -0,0 +1,347 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright 1998 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby
+ * granted, provided that both the above copyright notice and this
+ * permission notice appear in all copies, that both the above
+ * copyright notice and this permission notice appear in all
+ * supporting documentation, and that the name of M.I.T. not be used
+ * in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission. M.I.T. makes
+ * no representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
+ * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
+ * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * This code implements a system driver for legacy systems that do not
+ * support ACPI or when ACPI support is not present in the kernel.
+ */
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <machine/bus.h>
+#include <sys/pcpu.h>
+#include <sys/rman.h>
+#include <sys/smp.h>
+
+#ifndef __rtems__
+#include <rtems/bsd/local/opt_mca.h>
+#endif /* __rtems__ */
+#ifdef DEV_MCA
+#include <i386/bios/mca_machdep.h>
+#endif
+
+#include <machine/legacyvar.h>
+#include <machine/resource.h>
+
+static MALLOC_DEFINE(M_LEGACYDEV, "legacydrv", "legacy system device");
+struct legacy_device {
+ int lg_pcibus;
+};
+
+#define DEVTOAT(dev) ((struct legacy_device *)device_get_ivars(dev))
+
+static int legacy_probe(device_t);
+static int legacy_attach(device_t);
+static int legacy_print_child(device_t, device_t);
+static device_t legacy_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static int legacy_read_ivar(device_t, device_t, int, uintptr_t *);
+static int legacy_write_ivar(device_t, device_t, int, uintptr_t);
+
+static device_method_t legacy_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, legacy_probe),
+ DEVMETHOD(device_attach, legacy_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, legacy_print_child),
+ DEVMETHOD(bus_add_child, legacy_add_child),
+ DEVMETHOD(bus_read_ivar, legacy_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_write_ivar),
+ DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t legacy_driver = {
+ "legacy",
+ legacy_methods,
+ 1, /* no softc */
+};
+static devclass_t legacy_devclass;
+
+DRIVER_MODULE(legacy, nexus, legacy_driver, legacy_devclass, 0, 0);
+
+static int
+legacy_probe(device_t dev)
+{
+
+ device_set_desc(dev, "legacy system");
+ device_quiet(dev);
+ return (0);
+}
+
+static int
+legacy_attach(device_t dev)
+{
+ device_t child;
+
+ /*
+ * Let our child drivers identify any child devices that they
+ * can find. Once that is done attach any devices that we
+ * found.
+ */
+ bus_generic_probe(dev);
+ bus_generic_attach(dev);
+
+#ifndef PC98
+ /*
+ * If we didn't see EISA or ISA on a pci bridge, create some
+ * connection points now so they show up "on motherboard".
+ */
+ if (!devclass_get_device(devclass_find("eisa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "eisa", 0);
+ if (child == NULL)
+ panic("legacy_attach eisa");
+ device_probe_and_attach(child);
+ }
+#endif
+#ifdef DEV_MCA
+ if (MCA_system && !devclass_get_device(devclass_find("mca"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "mca", 0);
+ if (child == 0)
+ panic("legacy_probe mca");
+ device_probe_and_attach(child);
+ }
+#endif
+ if (!devclass_get_device(devclass_find("isa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "isa", 0);
+ if (child == NULL)
+ panic("legacy_attach isa");
+ device_probe_and_attach(child);
+ }
+
+ return 0;
+}
+
+static int
+legacy_print_child(device_t bus, device_t child)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+ int retval = 0;
+
+ retval += bus_print_child_header(bus, child);
+ if (atdev->lg_pcibus != -1)
+ retval += printf(" pcibus %d", atdev->lg_pcibus);
+ retval += printf(" on motherboard\n"); /* XXX "motherboard", ick */
+
+ return (retval);
+}
+
+static device_t
+legacy_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ device_t child;
+ struct legacy_device *atdev;
+
+ atdev = malloc(sizeof(struct legacy_device), M_LEGACYDEV,
+ M_NOWAIT | M_ZERO);
+ if (atdev == NULL)
+ return(NULL);
+ atdev->lg_pcibus = -1;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child == NULL)
+ free(atdev, M_LEGACYDEV);
+ else
+ /* should we free this in legacy_child_detached? */
+ device_set_ivars(child, atdev);
+
+ return (child);
+}
+
+static int
+legacy_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ *result = 0;
+ break;
+ case LEGACY_IVAR_PCIBUS:
+ *result = atdev->lg_pcibus;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+
+static int
+legacy_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ return EINVAL;
+ case LEGACY_IVAR_PCIBUS:
+ atdev->lg_pcibus = value;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+/*
+ * Legacy CPU attachment when ACPI is not available. Drivers like
+ * cpufreq(4) hang off this.
+ */
+static void cpu_identify(driver_t *driver, device_t parent);
+static int cpu_read_ivar(device_t dev, device_t child, int index,
+ uintptr_t *result);
+static device_t cpu_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static struct resource_list *cpu_get_rlist(device_t dev, device_t child);
+
+struct cpu_device {
+ struct resource_list cd_rl;
+ struct pcpu *cd_pcpu;
+};
+
+static device_method_t cpu_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, cpu_identify),
+ DEVMETHOD(device_probe, bus_generic_probe),
+ DEVMETHOD(device_attach, bus_generic_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_add_child, cpu_add_child),
+ DEVMETHOD(bus_read_ivar, cpu_read_ivar),
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_get_resource_list, cpu_get_rlist),
+ DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
+ DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource),
+ DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource),
+ DEVMETHOD(bus_driver_added, bus_generic_driver_added),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t cpu_driver = {
+ "cpu",
+ cpu_methods,
+ 1, /* no softc */
+};
+static devclass_t cpu_devclass;
+DRIVER_MODULE(cpu, legacy, cpu_driver, cpu_devclass, 0, 0);
+
+static void
+cpu_identify(driver_t *driver, device_t parent)
+{
+ device_t child;
+ int i;
+
+ /*
+ * Attach a cpuX device for each CPU. We use an order of 150
+ * so that these devices are attached after the Host-PCI
+ * bridges (which are added at order 100).
+ */
+ for (i = 0; i <= mp_maxid; i++)
+ if (!CPU_ABSENT(i)) {
+ child = BUS_ADD_CHILD(parent, 150, "cpu", i);
+ if (child == NULL)
+ panic("legacy_attach cpu");
+ }
+}
+
+static device_t
+cpu_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ struct cpu_device *cd;
+ device_t child;
+ struct pcpu *pc;
+
+ if ((cd = malloc(sizeof(*cd), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL)
+ return (NULL);
+
+ resource_list_init(&cd->cd_rl);
+ pc = pcpu_find(device_get_unit(bus));
+ cd->cd_pcpu = pc;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child != NULL) {
+ pc->pc_device = child;
+ device_set_ivars(child, cd);
+ } else
+ free(cd, M_DEVBUF);
+ return (child);
+}
+
+static struct resource_list *
+cpu_get_rlist(device_t dev, device_t child)
+{
+ struct cpu_device *cpdev;
+
+ cpdev = device_get_ivars(child);
+ return (&cpdev->cd_rl);
+}
+
+static int
+cpu_read_ivar(device_t dev, device_t child, int index, uintptr_t *result)
+{
+ struct cpu_device *cpdev;
+
+ if (index != CPU_IVAR_PCPU)
+ return (ENOENT);
+ cpdev = device_get_ivars(child);
+ *result = (uintptr_t)cpdev->cd_pcpu;
+ return (0);
+}
diff --git a/freebsd/sys/m32c/pci/pci_bus.c b/freebsd/sys/m32c/pci/pci_bus.c
new file mode 100644
index 00000000..6627db98
--- /dev/null
+++ b/freebsd/sys/m32c/pci/pci_bus.c
@@ -0,0 +1,729 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/local/opt_cpu.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
+
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcib_private.h>
+#include <isa/isavar.h>
+#ifdef CPU_ELAN
+#include <machine/md_var.h>
+#endif
+#include <machine/legacyvar.h>
+#include <machine/pci_cfgreg.h>
+#include <machine/resource.h>
+
+#include <rtems/bsd/local/pcib_if.h>
+
+#ifndef __rtems__
+static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev,
+ int pin);
+#else /* __rtems__ */
+int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin);
+#endif /* __rtems__ */
+
+
+int
+legacy_pcib_maxslots(device_t dev)
+{
+ return 31;
+}
+
+/* read configuration space register */
+
+#ifdef __rtems__
+uint32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#else
+u_int32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#endif
+{
+ return(pci_cfgregread(bus, slot, func, reg, bytes));
+}
+
+/* write configuration space register */
+
+void
+legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes)
+{
+ pci_cfgregwrite(bus, slot, func, reg, data, bytes);
+}
+
+/* Pass MSI requests up to the nexus. */
+
+static int
+legacy_pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount,
+ int *irqs)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSI(device_get_parent(bus), dev, count, maxcount,
+ irqs));
+}
+
+static int
+legacy_pcib_alloc_msix(device_t pcib, device_t dev, int *irq)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq));
+}
+
+static int
+legacy_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr,
+ uint32_t *data)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data));
+}
+
+static const char *
+legacy_pcib_is_host_bridge(int bus, int slot, int func,
+ uint32_t id, uint8_t class, uint8_t subclass,
+ uint8_t *busnum)
+{
+ const char *s = NULL;
+ static uint8_t pxb[4]; /* hack for 450nx */
+
+ *busnum = 0;
+
+ switch (id) {
+ case 0x12258086:
+ s = "Intel 824?? host to PCI bridge";
+ /* XXX This is a guess */
+ /* *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x41, 1); */
+ *busnum = bus;
+ break;
+ case 0x71208086:
+ s = "Intel 82810 (i810 GMCH) Host To Hub bridge";
+ break;
+ case 0x71228086:
+ s = "Intel 82810-DC100 (i810-DC100 GMCH) Host To Hub bridge";
+ break;
+ case 0x71248086:
+ s = "Intel 82810E (i810E GMCH) Host To Hub bridge";
+ break;
+ case 0x11308086:
+ s = "Intel 82815 (i815 GMCH) Host To Hub bridge";
+ break;
+ case 0x71808086:
+ s = "Intel 82443LX (440 LX) host to PCI bridge";
+ break;
+ case 0x71908086:
+ s = "Intel 82443BX (440 BX) host to PCI bridge";
+ break;
+ case 0x71928086:
+ s = "Intel 82443BX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x71948086:
+ s = "Intel 82443MX host to PCI bridge";
+ break;
+ case 0x71a08086:
+ s = "Intel 82443GX host to PCI bridge";
+ break;
+ case 0x71a18086:
+ s = "Intel 82443GX host to AGP bridge";
+ break;
+ case 0x71a28086:
+ s = "Intel 82443GX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x84c48086:
+ s = "Intel 82454KX/GX (Orion) host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x4a, 1);
+ break;
+ case 0x84ca8086:
+ /*
+ * For the 450nx chipset, there is a whole bundle of
+ * things pretending to be host bridges. The MIOC will
+ * be seen first and isn't really a pci bridge (the
+ * actual busses are attached to the PXB's). We need to
+ * read the registers of the MIOC to figure out the
+ * bus numbers for the PXB channels.
+ *
+ * Since the MIOC doesn't have a pci bus attached, we
+ * pretend it wasn't there.
+ */
+ pxb[0] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd0, 1); /* BUSNO[0] */
+ pxb[1] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd1, 1) + 1; /* SUBA[0]+1 */
+ pxb[2] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd3, 1); /* BUSNO[1] */
+ pxb[3] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd4, 1) + 1; /* SUBA[1]+1 */
+ return NULL;
+ case 0x84cb8086:
+ switch (slot) {
+ case 0x12:
+ s = "Intel 82454NX PXB#0, Bus#A";
+ *busnum = pxb[0];
+ break;
+ case 0x13:
+ s = "Intel 82454NX PXB#0, Bus#B";
+ *busnum = pxb[1];
+ break;
+ case 0x14:
+ s = "Intel 82454NX PXB#1, Bus#A";
+ *busnum = pxb[2];
+ break;
+ case 0x15:
+ s = "Intel 82454NX PXB#1, Bus#B";
+ *busnum = pxb[3];
+ break;
+ }
+ break;
+ case 0x1A308086:
+ s = "Intel 82845 Host to PCI bridge";
+ break;
+
+ /* AMD -- vendor 0x1022 */
+ case 0x30001022:
+ s = "AMD Elan SC520 host to PCI bridge";
+#ifdef CPU_ELAN
+ init_AMD_Elan_sc520();
+#else
+ printf(
+"*** WARNING: missing CPU_ELAN -- timekeeping may be wrong\n");
+#endif
+ break;
+ case 0x70061022:
+ s = "AMD-751 host to PCI bridge";
+ break;
+ case 0x700e1022:
+ s = "AMD-761 host to PCI bridge";
+ break;
+
+ /* SiS -- vendor 0x1039 */
+ case 0x04961039:
+ s = "SiS 85c496";
+ break;
+ case 0x04061039:
+ s = "SiS 85c501";
+ break;
+ case 0x06011039:
+ s = "SiS 85c601";
+ break;
+ case 0x55911039:
+ s = "SiS 5591 host to PCI bridge";
+ break;
+ case 0x00011039:
+ s = "SiS 5591 host to AGP bridge";
+ break;
+
+ /* VLSI -- vendor 0x1004 */
+ case 0x00051004:
+ s = "VLSI 82C592 Host to PCI bridge";
+ break;
+
+ /* XXX Here is MVP3, I got the datasheet but NO M/B to test it */
+ /* totally. Please let me know if anything wrong. -F */
+ /* XXX need info on the MVP3 -- any takers? */
+ case 0x05981106:
+ s = "VIA 82C598MVP (Apollo MVP3) host bridge";
+ break;
+
+ /* AcerLabs -- vendor 0x10b9 */
+ /* Funny : The datasheet told me vendor id is "10b8",sub-vendor */
+ /* id is '10b9" but the register always shows "10b9". -Foxfair */
+ case 0x154110b9:
+ s = "AcerLabs M1541 (Aladdin-V) PCI host bridge";
+ break;
+
+ /* OPTi -- vendor 0x1045 */
+ case 0xc7011045:
+ s = "OPTi 82C700 host to PCI bridge";
+ break;
+ case 0xc8221045:
+ s = "OPTi 82C822 host to PCI Bridge";
+ break;
+
+ /* ServerWorks -- vendor 0x1166 */
+ case 0x00051166:
+ s = "ServerWorks NB6536 2.0HE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00061166:
+ /* FALLTHROUGH */
+ case 0x00081166:
+ /* FALLTHROUGH */
+ case 0x02011166:
+ /* FALLTHROUGH */
+ case 0x010f1014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00091166:
+ s = "ServerWorks NB6635 3.0LE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00101166:
+ s = "ServerWorks CIOB30 host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00111166:
+ /* FALLTHROUGH */
+ case 0x03021014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks CMIC-HE host to PCI-X bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* XXX unknown chipset, but working */
+ case 0x00171166:
+ /* FALLTHROUGH */
+ case 0x01011166:
+ case 0x01101166:
+ case 0x02251166:
+ s = "ServerWorks host to PCI bridge(unknown chipset)";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* Compaq/HP -- vendor 0x0e11 */
+ case 0x60100e11:
+ s = "Compaq/HP Model 6010 HotPlug PCI Bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0xc8, 1);
+ break;
+
+ /* Integrated Micro Solutions -- vendor 0x10e0 */
+ case 0x884910e0:
+ s = "Integrated Micro Solutions VL Bridge";
+ break;
+
+ default:
+ if (class == PCIC_BRIDGE && subclass == PCIS_BRIDGE_HOST)
+ s = "Host to PCI bridge";
+ break;
+ }
+
+ return s;
+}
+
+/*
+ * Scan the first pci bus for host-pci bridges and add pcib instances
+ * to the nexus for each bridge.
+ */
+static void
+legacy_pcib_identify(driver_t *driver, device_t parent)
+{
+ int bus, slot, func;
+ u_int8_t hdrtype;
+ int found = 0;
+ int pcifunchigh;
+ int found824xx = 0;
+ int found_orion = 0;
+ device_t child;
+ devclass_t pci_devclass;
+
+ if (pci_cfgregopen() == 0)
+ return;
+ /*
+ * Check to see if we haven't already had a PCI bus added
+ * via some other means. If we have, bail since otherwise
+ * we're going to end up duplicating it.
+ */
+ if ((pci_devclass = devclass_find("pci")) &&
+ devclass_get_device(pci_devclass, 0))
+ return;
+
+
+ bus = 0;
+ retry:
+ for (slot = 0; slot <= PCI_SLOTMAX; slot++) {
+ func = 0;
+ hdrtype = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_HDRTYPE, 1);
+ /*
+ * When enumerating bus devices, the standard says that
+ * one should check the header type and ignore the slots whose
+ * header types that the software doesn't know about. We use
+ * this to filter out devices.
+ */
+ if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE)
+ continue;
+ if ((hdrtype & PCIM_MFDEV) &&
+ (!found_orion || hdrtype != 0xff))
+ pcifunchigh = PCI_FUNCMAX;
+ else
+ pcifunchigh = 0;
+ for (func = 0; func <= pcifunchigh; func++) {
+ /*
+ * Read the IDs and class from the device.
+ */
+ u_int32_t id;
+ u_int8_t class, subclass, busnum;
+ const char *s;
+ device_t *devs;
+ int ndevs, i;
+
+ id = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_DEVVENDOR, 4);
+ if (id == -1)
+ continue;
+ class = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_CLASS, 1);
+ subclass = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_SUBCLASS, 1);
+
+ s = legacy_pcib_is_host_bridge(bus, slot, func,
+ id, class, subclass,
+ &busnum);
+ if (s == NULL)
+ continue;
+
+ /*
+ * Check to see if the physical bus has already
+ * been seen. Eg: hybrid 32 and 64 bit host
+ * bridges to the same logical bus.
+ */
+ if (device_get_children(parent, &devs, &ndevs) == 0) {
+ for (i = 0; s != NULL && i < ndevs; i++) {
+ if (strcmp(device_get_name(devs[i]),
+ "pcib") != 0)
+ continue;
+ if (legacy_get_pcibus(devs[i]) == busnum)
+ s = NULL;
+ }
+ free(devs, M_TEMP);
+ }
+
+ if (s == NULL)
+ continue;
+ /*
+ * Add at priority 100 to make sure we
+ * go after any motherboard resources
+ */
+ child = BUS_ADD_CHILD(parent, 100,
+ "pcib", busnum);
+ device_set_desc(child, s);
+ legacy_set_pcibus(child, busnum);
+
+ found = 1;
+ if (id == 0x12258086)
+ found824xx = 1;
+ if (id == 0x84c48086)
+ found_orion = 1;
+ }
+ }
+ if (found824xx && bus == 0) {
+ bus++;
+ goto retry;
+ }
+
+ /*
+ * Make sure we add at least one bridge since some old
+ * hardware doesn't actually have a host-pci bridge device.
+ * Note that pci_cfgregopen() thinks we have PCI devices..
+ */
+ if (!found) {
+ if (bootverbose)
+ printf(
+ "legacy_pcib_identify: no bridge found, adding pcib0 anyway\n");
+ child = BUS_ADD_CHILD(parent, 100, "pcib", 0);
+ legacy_set_pcibus(child, 0);
+ }
+}
+
+static int
+legacy_pcib_probe(device_t dev)
+{
+
+ if (pci_cfgregopen() == 0)
+ return ENXIO;
+ return -100;
+}
+
+static int
+legacy_pcib_attach(device_t dev)
+{
+ device_t pir;
+ int bus;
+
+ /*
+ * Look for a PCI BIOS interrupt routing table as that will be
+ * our method of routing interrupts if we have one.
+ */
+ bus = pcib_get_bus(dev);
+#ifndef __rtems__
+ if (pci_pir_probe(bus, 0)) {
+ pir = BUS_ADD_CHILD(device_get_parent(dev), 0, "pir", 0);
+ if (pir != NULL)
+ device_probe_and_attach(pir);
+ }
+#else /* __rtems__ */
+#endif /* __rtems__ */
+ device_add_child(dev, "pci", bus);
+ return bus_generic_attach(dev);
+}
+
+int
+legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ *result = 0;
+ return 0;
+ case PCIB_IVAR_BUS:
+ *result = legacy_get_pcibus(dev);
+ return 0;
+ }
+ return ENOENT;
+}
+
+int
+legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ return EINVAL;
+ case PCIB_IVAR_BUS:
+ legacy_set_pcibus(dev, value);
+ return 0;
+ }
+ return ENOENT;
+}
+
+SYSCTL_DECL(_hw_pci);
+
+static unsigned long legacy_host_mem_start = 0x80000000;
+TUNABLE_ULONG("hw.pci.host_mem_start", &legacy_host_mem_start);
+SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN,
+ &legacy_host_mem_start, 0x80000000,
+ "Limit the host bridge memory to being above this address. Must be\n\
+set at boot via a tunable.");
+
+struct resource *
+legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
+ u_long start, u_long end, u_long count, u_int flags)
+{
+ /*
+ * If no memory preference is given, use upper 32MB slot most
+ * bioses use for their memory window. Typically other bridges
+ * before us get in the way to assert their preferences on memory.
+ * Hardcoding like this sucks, so a more MD/MI way needs to be
+ * found to do it. This is typically only used on older laptops
+ * that don't have pci busses behind pci bridge, so assuming > 32MB
+ * is liekly OK.
+ *
+ * However, this can cause problems for other chipsets, so we make
+ * this tunable by hw.pci.host_mem_start.
+ */
+ if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL)
+ start = legacy_host_mem_start;
+ if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL)
+ start = 0x1000;
+ return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
+ count, flags));
+}
+
+static device_method_t legacy_pcib_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, legacy_pcib_identify),
+ DEVMETHOD(device_probe, legacy_pcib_probe),
+ DEVMETHOD(device_attach, legacy_pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, legacy_pcib_maxslots),
+ DEVMETHOD(pcib_read_config, legacy_pcib_read_config),
+ DEVMETHOD(pcib_write_config, legacy_pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, legacy_pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, legacy_pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, legacy_pcib_map_msi),
+
+ { 0, 0 }
+};
+
+static devclass_t hostb_devclass;
+
+DEFINE_CLASS_0(pcib, legacy_pcib_driver, legacy_pcib_methods, 1);
+DRIVER_MODULE(pcib, legacy, legacy_pcib_driver, hostb_devclass, 0, 0);
+
+
+#ifndef __rtems__
+/*
+ * Install placeholder to claim the resources owned by the
+ * PCI bus interface. This could be used to extract the
+ * config space registers in the extreme case where the PnP
+ * ID is available and the PCI BIOS isn't, but for now we just
+ * eat the PnP ID and do nothing else.
+ *
+ * XXX we should silence this probe, as it will generally confuse
+ * people.
+ */
+static struct isa_pnp_id pcibus_pnp_ids[] = {
+ { 0x030ad041 /* PNP0A03 */, "PCI Bus" },
+ { 0x080ad041 /* PNP0A08 */, "PCIe Bus" },
+ { 0 }
+};
+
+static int
+pcibus_pnp_probe(device_t dev)
+{
+ int result;
+
+ if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, pcibus_pnp_ids)) <= 0)
+ device_quiet(dev);
+ return(result);
+}
+
+static int
+pcibus_pnp_attach(device_t dev)
+{
+ return(0);
+}
+
+static device_method_t pcibus_pnp_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibus_pnp_probe),
+ DEVMETHOD(device_attach, pcibus_pnp_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+ { 0, 0 }
+};
+
+static devclass_t pcibus_pnp_devclass;
+
+DEFINE_CLASS_0(pcibus_pnp, pcibus_pnp_driver, pcibus_pnp_methods, 1);
+DRIVER_MODULE(pcibus_pnp, isa, pcibus_pnp_driver, pcibus_pnp_devclass, 0, 0);
+
+
+/*
+ * Provide a PCI-PCI bridge driver for PCI busses behind PCI-PCI bridges
+ * that appear in the PCIBIOS Interrupt Routing Table to use the routing
+ * table for interrupt routing when possible.
+ */
+static int pcibios_pcib_probe(device_t bus);
+
+static device_method_t pcibios_pcib_pci_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibios_pcib_probe),
+ DEVMETHOD(device_attach, pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, pcib_maxslots),
+ DEVMETHOD(pcib_read_config, pcib_read_config),
+ DEVMETHOD(pcib_write_config, pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, pcib_map_msi),
+
+ {0, 0}
+};
+
+static devclass_t pcib_devclass;
+
+DEFINE_CLASS_0(pcib, pcibios_pcib_driver, pcibios_pcib_pci_methods,
+ sizeof(struct pcib_softc));
+DRIVER_MODULE(pcibios_pcib, pci, pcibios_pcib_driver, pcib_devclass, 0, 0);
+
+static int
+pcibios_pcib_probe(device_t dev)
+{
+ int bus;
+
+ if ((pci_get_class(dev) != PCIC_BRIDGE) ||
+ (pci_get_subclass(dev) != PCIS_BRIDGE_PCI))
+ return (ENXIO);
+ bus = pci_read_config(dev, PCIR_SECBUS_1, 1);
+ if (bus == 0)
+ return (ENXIO);
+ if (!pci_pir_probe(bus, 1))
+ return (ENXIO);
+ device_set_desc(dev, "PCIBIOS PCI-PCI bridge");
+ return (-2000);
+}
+
+static int
+pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
+{
+ return (pci_pir_route_interrupt(pci_get_bus(dev), pci_get_slot(dev),
+ pci_get_function(dev), pin));
+}
+#endif /* __rtems__ */
diff --git a/freebsd/sys/m32r/include/machine/in_cksum.h b/freebsd/sys/m32r/include/machine/in_cksum.h
new file mode 100644
index 00000000..37d88e2e
--- /dev/null
+++ b/freebsd/sys/m32r/include/machine/in_cksum.h
@@ -0,0 +1,77 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from tahoe: in_cksum.c 1.2 86/01/05
+ * from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91
+ * from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp
+ * from: src/sys/alpha/include/in_cksum.h,v 1.7 2005/03/02 21:33:20 joerg
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_IN_CKSUM_H_
+#define _MACHINE_IN_CKSUM_H_ 1
+
+#include <sys/cdefs.h>
+
+#define in_cksum(m, len) in_cksum_skip(m, len, 0)
+
+/*
+ * It it useful to have an Internet checksum routine which is inlineable
+ * and optimized specifically for the task of computing IP header checksums
+ * in the normal case (where there are no options and the header length is
+ * therefore always exactly five 32-bit words.
+ */
+#ifdef __CC_SUPPORTS___INLINE
+
+static __inline void
+in_cksum_update(struct ip *ip)
+{
+ int __tmpsum;
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256;
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16));
+}
+
+#else
+
+#define in_cksum_update(ip) \
+ do { \
+ int __tmpsum; \
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256; \
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \
+ } while(0)
+
+#endif
+
+#ifdef _KERNEL
+u_int in_cksum_hdr(const struct ip *ip);
+u_short in_addword(u_short sum, u_short b);
+u_short in_pseudo(u_int sum, u_int b, u_int c);
+u_short in_cksum_skip(struct mbuf *m, int len, int skip);
+#endif
+
+#endif /* _MACHINE_IN_CKSUM_H_ */
diff --git a/freebsd/sys/m32r/include/machine/legacyvar.h b/freebsd/sys/m32r/include/machine/legacyvar.h
new file mode 100644
index 00000000..0b0fa433
--- /dev/null
+++ b/freebsd/sys/m32r/include/machine/legacyvar.h
@@ -0,0 +1,57 @@
+/*-
+ * Copyright (c) 2000 Peter Wemm <peter@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_LEGACYVAR_H_
+#define _MACHINE_LEGACYVAR_H_
+
+enum legacy_device_ivars {
+ LEGACY_IVAR_PCIDOMAIN,
+ LEGACY_IVAR_PCIBUS
+};
+
+#define LEGACY_ACCESSOR(var, ivar, type) \
+ __BUS_ACCESSOR(legacy, var, LEGACY, ivar, type)
+
+LEGACY_ACCESSOR(pcidomain, PCIDOMAIN, uint32_t)
+LEGACY_ACCESSOR(pcibus, PCIBUS, uint32_t)
+
+#undef LEGACY_ACCESSOR
+
+int legacy_pcib_maxslots(device_t dev);
+uint32_t legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes);
+int legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result);
+void legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes);
+int legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value);
+struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child,
+ int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
+
+#endif /* !_MACHINE_LEGACYVAR_H_ */
diff --git a/freebsd/sys/m32r/include/machine/pci_cfgreg.h b/freebsd/sys/m32r/include/machine/pci_cfgreg.h
new file mode 100644
index 00000000..bc72418d
--- /dev/null
+++ b/freebsd/sys/m32r/include/machine/pci_cfgreg.h
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
+ */
+
+#define CONF1_ADDR_PORT 0x0cf8
+#define CONF1_DATA_PORT 0x0cfc
+
+#define CONF1_ENABLE 0x80000000ul
+#define CONF1_ENABLE_CHK 0x80000000ul
+#define CONF1_ENABLE_MSK 0x7f000000ul
+#define CONF1_ENABLE_CHK1 0xff000001ul
+#define CONF1_ENABLE_MSK1 0x80000001ul
+#define CONF1_ENABLE_RES1 0x80000000ul
+
+#define CONF2_ENABLE_PORT 0x0cf8
+#define CONF2_FORWARD_PORT 0x0cfa
+
+#define CONF2_ENABLE_CHK 0x0e
+#define CONF2_ENABLE_RES 0x0e
+
+int pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus);
+int pci_cfgregopen(void);
+u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes);
+void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes);
+void pci_pir_open(void);
+int pci_pir_probe(int bus, int require_parse);
+int pci_pir_route_interrupt(int bus, int device, int func, int pin);
diff --git a/freebsd/sys/m32r/m32r/in_cksum.c b/freebsd/sys/m32r/m32r/in_cksum.c
new file mode 100644
index 00000000..c6f7b568
--- /dev/null
+++ b/freebsd/sys/m32r/m32r/in_cksum.c
@@ -0,0 +1,255 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1988, 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ * Copyright (c) 1996
+ * Matt Thomas <matt@3am-software.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)in_cksum.c 8.1 (Berkeley) 6/10/93
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/mbuf.h>
+#include <sys/systm.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <machine/in_cksum.h>
+
+/*
+ * Checksum routine for Internet Protocol family headers
+ * (Portable Alpha version).
+ *
+ * This routine is very heavily used in the network
+ * code and should be modified for each CPU to be as fast as possible.
+ */
+
+#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x)
+#define REDUCE32 \
+ { \
+ q_util.q = sum; \
+ sum = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
+ }
+#define REDUCE16 \
+ { \
+ q_util.q = sum; \
+ l_util.l = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
+ sum = l_util.s[0] + l_util.s[1]; \
+ ADDCARRY(sum); \
+ }
+
+static const u_int32_t in_masks[] = {
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
+ 0x00000000, 0x000000FF, 0x0000FFFF, 0x00FFFFFF, /* offset 0 */
+ 0x00000000, 0x0000FF00, 0x00FFFF00, 0xFFFFFF00, /* offset 1 */
+ 0x00000000, 0x00FF0000, 0xFFFF0000, 0xFFFF0000, /* offset 2 */
+ 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, /* offset 3 */
+#else
+ /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
+ 0x00000000, 0xFF000000, 0xFFFF0000, 0xFFFFFF00, /* offset 0 */
+ 0x00000000, 0x00FF0000, 0x00FFFF00, 0x00FFFFFF, /* offset 1 */
+ 0x00000000, 0x0000FF00, 0x0000FFFF, 0x0000FFFF, /* offset 2 */
+ 0x00000000, 0x000000FF, 0x000000FF, 0x000000FF, /* offset 3 */
+#endif
+};
+
+union l_util {
+ u_int16_t s[2];
+ u_int32_t l;
+};
+union q_util {
+ u_int16_t s[4];
+ u_int32_t l[2];
+ u_int64_t q;
+};
+
+static u_int64_t
+in_cksumdata(const void *buf, int len)
+{
+ const u_int32_t *lw = (const u_int32_t *) buf;
+ u_int64_t sum = 0;
+ u_int64_t prefilled;
+ int offset;
+ union q_util q_util;
+
+ if ((3 & (long) lw) == 0 && len == 20) {
+ sum = (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3] + lw[4];
+ REDUCE32;
+ return sum;
+ }
+
+ if ((offset = 3 & (long) lw) != 0) {
+ const u_int32_t *masks = in_masks + (offset << 2);
+ lw = (u_int32_t *) (((long) lw) - offset);
+ sum = *lw++ & masks[len >= 3 ? 3 : len];
+ len -= 4 - offset;
+ if (len <= 0) {
+ REDUCE32;
+ return sum;
+ }
+ }
+#if 0
+ /*
+ * Force to cache line boundary.
+ */
+ offset = 32 - (0x1f & (long) lw);
+ if (offset < 32 && len > offset) {
+ len -= offset;
+ if (4 & offset) {
+ sum += (u_int64_t) lw[0];
+ lw += 1;
+ }
+ if (8 & offset) {
+ sum += (u_int64_t) lw[0] + lw[1];
+ lw += 2;
+ }
+ if (16 & offset) {
+ sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
+ lw += 4;
+ }
+ }
+#endif
+ /*
+ * access prefilling to start load of next cache line.
+ * then add current cache line
+ * save result of prefilling for loop iteration.
+ */
+ prefilled = lw[0];
+ while ((len -= 32) >= 4) {
+ u_int64_t prefilling = lw[8];
+ sum += prefilled + lw[1] + lw[2] + lw[3]
+ + lw[4] + lw[5] + lw[6] + lw[7];
+ lw += 8;
+ prefilled = prefilling;
+ }
+ if (len >= 0) {
+ sum += prefilled + lw[1] + lw[2] + lw[3]
+ + lw[4] + lw[5] + lw[6] + lw[7];
+ lw += 8;
+ } else {
+ len += 32;
+ }
+ while ((len -= 16) >= 0) {
+ sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
+ lw += 4;
+ }
+ len += 16;
+ while ((len -= 4) >= 0) {
+ sum += (u_int64_t) *lw++;
+ }
+ len += 4;
+ if (len > 0)
+ sum += (u_int64_t) (in_masks[len] & *lw);
+ REDUCE32;
+ return sum;
+}
+
+u_short
+in_addword(u_short a, u_short b)
+{
+ u_int64_t sum = a + b;
+
+ ADDCARRY(sum);
+ return (sum);
+}
+
+u_short
+#ifdef __rtems__
+/* Prototype does not match in FreeBSD code */
+in_pseudo(u_int a, u_int b, u_int c)
+#else
+in_pseudo(u_int32_t a, u_int32_t b, u_int32_t c)
+#endif
+{
+ u_int64_t sum;
+ union q_util q_util;
+ union l_util l_util;
+
+ sum = (u_int64_t) a + b + c;
+ REDUCE16;
+ return (sum);
+}
+
+u_short
+in_cksum_skip(struct mbuf *m, int len, int skip)
+{
+ u_int64_t sum = 0;
+ int mlen = 0;
+ int clen = 0;
+ caddr_t addr;
+ union q_util q_util;
+ union l_util l_util;
+
+ len -= skip;
+ for (; skip && m; m = m->m_next) {
+ if (m->m_len > skip) {
+ mlen = m->m_len - skip;
+ addr = mtod(m, caddr_t) + skip;
+ goto skip_start;
+ } else {
+ skip -= m->m_len;
+ }
+ }
+
+ for (; m && len; m = m->m_next) {
+ if (m->m_len == 0)
+ continue;
+ mlen = m->m_len;
+ addr = mtod(m, caddr_t);
+skip_start:
+ if (len < mlen)
+ mlen = len;
+
+ if ((clen ^ (uintptr_t) addr) & 1)
+ sum += in_cksumdata(addr, mlen) << 8;
+ else
+ sum += in_cksumdata(addr, mlen);
+
+ clen += mlen;
+ len -= mlen;
+ }
+ REDUCE16;
+ return (~sum & 0xffff);
+}
+
+u_int in_cksum_hdr(const struct ip *ip)
+{
+ u_int64_t sum = in_cksumdata(ip, sizeof(struct ip));
+ union q_util q_util;
+ union l_util l_util;
+ REDUCE16;
+ return (~sum & 0xffff);
+}
diff --git a/freebsd/sys/m32r/m32r/legacy.c b/freebsd/sys/m32r/m32r/legacy.c
new file mode 100644
index 00000000..2547990c
--- /dev/null
+++ b/freebsd/sys/m32r/m32r/legacy.c
@@ -0,0 +1,347 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright 1998 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby
+ * granted, provided that both the above copyright notice and this
+ * permission notice appear in all copies, that both the above
+ * copyright notice and this permission notice appear in all
+ * supporting documentation, and that the name of M.I.T. not be used
+ * in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission. M.I.T. makes
+ * no representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
+ * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
+ * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * This code implements a system driver for legacy systems that do not
+ * support ACPI or when ACPI support is not present in the kernel.
+ */
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <machine/bus.h>
+#include <sys/pcpu.h>
+#include <sys/rman.h>
+#include <sys/smp.h>
+
+#ifndef __rtems__
+#include <rtems/bsd/local/opt_mca.h>
+#endif /* __rtems__ */
+#ifdef DEV_MCA
+#include <i386/bios/mca_machdep.h>
+#endif
+
+#include <machine/legacyvar.h>
+#include <machine/resource.h>
+
+static MALLOC_DEFINE(M_LEGACYDEV, "legacydrv", "legacy system device");
+struct legacy_device {
+ int lg_pcibus;
+};
+
+#define DEVTOAT(dev) ((struct legacy_device *)device_get_ivars(dev))
+
+static int legacy_probe(device_t);
+static int legacy_attach(device_t);
+static int legacy_print_child(device_t, device_t);
+static device_t legacy_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static int legacy_read_ivar(device_t, device_t, int, uintptr_t *);
+static int legacy_write_ivar(device_t, device_t, int, uintptr_t);
+
+static device_method_t legacy_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, legacy_probe),
+ DEVMETHOD(device_attach, legacy_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, legacy_print_child),
+ DEVMETHOD(bus_add_child, legacy_add_child),
+ DEVMETHOD(bus_read_ivar, legacy_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_write_ivar),
+ DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t legacy_driver = {
+ "legacy",
+ legacy_methods,
+ 1, /* no softc */
+};
+static devclass_t legacy_devclass;
+
+DRIVER_MODULE(legacy, nexus, legacy_driver, legacy_devclass, 0, 0);
+
+static int
+legacy_probe(device_t dev)
+{
+
+ device_set_desc(dev, "legacy system");
+ device_quiet(dev);
+ return (0);
+}
+
+static int
+legacy_attach(device_t dev)
+{
+ device_t child;
+
+ /*
+ * Let our child drivers identify any child devices that they
+ * can find. Once that is done attach any devices that we
+ * found.
+ */
+ bus_generic_probe(dev);
+ bus_generic_attach(dev);
+
+#ifndef PC98
+ /*
+ * If we didn't see EISA or ISA on a pci bridge, create some
+ * connection points now so they show up "on motherboard".
+ */
+ if (!devclass_get_device(devclass_find("eisa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "eisa", 0);
+ if (child == NULL)
+ panic("legacy_attach eisa");
+ device_probe_and_attach(child);
+ }
+#endif
+#ifdef DEV_MCA
+ if (MCA_system && !devclass_get_device(devclass_find("mca"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "mca", 0);
+ if (child == 0)
+ panic("legacy_probe mca");
+ device_probe_and_attach(child);
+ }
+#endif
+ if (!devclass_get_device(devclass_find("isa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "isa", 0);
+ if (child == NULL)
+ panic("legacy_attach isa");
+ device_probe_and_attach(child);
+ }
+
+ return 0;
+}
+
+static int
+legacy_print_child(device_t bus, device_t child)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+ int retval = 0;
+
+ retval += bus_print_child_header(bus, child);
+ if (atdev->lg_pcibus != -1)
+ retval += printf(" pcibus %d", atdev->lg_pcibus);
+ retval += printf(" on motherboard\n"); /* XXX "motherboard", ick */
+
+ return (retval);
+}
+
+static device_t
+legacy_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ device_t child;
+ struct legacy_device *atdev;
+
+ atdev = malloc(sizeof(struct legacy_device), M_LEGACYDEV,
+ M_NOWAIT | M_ZERO);
+ if (atdev == NULL)
+ return(NULL);
+ atdev->lg_pcibus = -1;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child == NULL)
+ free(atdev, M_LEGACYDEV);
+ else
+ /* should we free this in legacy_child_detached? */
+ device_set_ivars(child, atdev);
+
+ return (child);
+}
+
+static int
+legacy_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ *result = 0;
+ break;
+ case LEGACY_IVAR_PCIBUS:
+ *result = atdev->lg_pcibus;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+
+static int
+legacy_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ return EINVAL;
+ case LEGACY_IVAR_PCIBUS:
+ atdev->lg_pcibus = value;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+/*
+ * Legacy CPU attachment when ACPI is not available. Drivers like
+ * cpufreq(4) hang off this.
+ */
+static void cpu_identify(driver_t *driver, device_t parent);
+static int cpu_read_ivar(device_t dev, device_t child, int index,
+ uintptr_t *result);
+static device_t cpu_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static struct resource_list *cpu_get_rlist(device_t dev, device_t child);
+
+struct cpu_device {
+ struct resource_list cd_rl;
+ struct pcpu *cd_pcpu;
+};
+
+static device_method_t cpu_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, cpu_identify),
+ DEVMETHOD(device_probe, bus_generic_probe),
+ DEVMETHOD(device_attach, bus_generic_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_add_child, cpu_add_child),
+ DEVMETHOD(bus_read_ivar, cpu_read_ivar),
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_get_resource_list, cpu_get_rlist),
+ DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
+ DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource),
+ DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource),
+ DEVMETHOD(bus_driver_added, bus_generic_driver_added),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t cpu_driver = {
+ "cpu",
+ cpu_methods,
+ 1, /* no softc */
+};
+static devclass_t cpu_devclass;
+DRIVER_MODULE(cpu, legacy, cpu_driver, cpu_devclass, 0, 0);
+
+static void
+cpu_identify(driver_t *driver, device_t parent)
+{
+ device_t child;
+ int i;
+
+ /*
+ * Attach a cpuX device for each CPU. We use an order of 150
+ * so that these devices are attached after the Host-PCI
+ * bridges (which are added at order 100).
+ */
+ for (i = 0; i <= mp_maxid; i++)
+ if (!CPU_ABSENT(i)) {
+ child = BUS_ADD_CHILD(parent, 150, "cpu", i);
+ if (child == NULL)
+ panic("legacy_attach cpu");
+ }
+}
+
+static device_t
+cpu_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ struct cpu_device *cd;
+ device_t child;
+ struct pcpu *pc;
+
+ if ((cd = malloc(sizeof(*cd), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL)
+ return (NULL);
+
+ resource_list_init(&cd->cd_rl);
+ pc = pcpu_find(device_get_unit(bus));
+ cd->cd_pcpu = pc;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child != NULL) {
+ pc->pc_device = child;
+ device_set_ivars(child, cd);
+ } else
+ free(cd, M_DEVBUF);
+ return (child);
+}
+
+static struct resource_list *
+cpu_get_rlist(device_t dev, device_t child)
+{
+ struct cpu_device *cpdev;
+
+ cpdev = device_get_ivars(child);
+ return (&cpdev->cd_rl);
+}
+
+static int
+cpu_read_ivar(device_t dev, device_t child, int index, uintptr_t *result)
+{
+ struct cpu_device *cpdev;
+
+ if (index != CPU_IVAR_PCPU)
+ return (ENOENT);
+ cpdev = device_get_ivars(child);
+ *result = (uintptr_t)cpdev->cd_pcpu;
+ return (0);
+}
diff --git a/freebsd/sys/m32r/pci/pci_bus.c b/freebsd/sys/m32r/pci/pci_bus.c
new file mode 100644
index 00000000..6627db98
--- /dev/null
+++ b/freebsd/sys/m32r/pci/pci_bus.c
@@ -0,0 +1,729 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/local/opt_cpu.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
+
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcib_private.h>
+#include <isa/isavar.h>
+#ifdef CPU_ELAN
+#include <machine/md_var.h>
+#endif
+#include <machine/legacyvar.h>
+#include <machine/pci_cfgreg.h>
+#include <machine/resource.h>
+
+#include <rtems/bsd/local/pcib_if.h>
+
+#ifndef __rtems__
+static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev,
+ int pin);
+#else /* __rtems__ */
+int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin);
+#endif /* __rtems__ */
+
+
+int
+legacy_pcib_maxslots(device_t dev)
+{
+ return 31;
+}
+
+/* read configuration space register */
+
+#ifdef __rtems__
+uint32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#else
+u_int32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#endif
+{
+ return(pci_cfgregread(bus, slot, func, reg, bytes));
+}
+
+/* write configuration space register */
+
+void
+legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes)
+{
+ pci_cfgregwrite(bus, slot, func, reg, data, bytes);
+}
+
+/* Pass MSI requests up to the nexus. */
+
+static int
+legacy_pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount,
+ int *irqs)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSI(device_get_parent(bus), dev, count, maxcount,
+ irqs));
+}
+
+static int
+legacy_pcib_alloc_msix(device_t pcib, device_t dev, int *irq)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq));
+}
+
+static int
+legacy_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr,
+ uint32_t *data)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data));
+}
+
+static const char *
+legacy_pcib_is_host_bridge(int bus, int slot, int func,
+ uint32_t id, uint8_t class, uint8_t subclass,
+ uint8_t *busnum)
+{
+ const char *s = NULL;
+ static uint8_t pxb[4]; /* hack for 450nx */
+
+ *busnum = 0;
+
+ switch (id) {
+ case 0x12258086:
+ s = "Intel 824?? host to PCI bridge";
+ /* XXX This is a guess */
+ /* *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x41, 1); */
+ *busnum = bus;
+ break;
+ case 0x71208086:
+ s = "Intel 82810 (i810 GMCH) Host To Hub bridge";
+ break;
+ case 0x71228086:
+ s = "Intel 82810-DC100 (i810-DC100 GMCH) Host To Hub bridge";
+ break;
+ case 0x71248086:
+ s = "Intel 82810E (i810E GMCH) Host To Hub bridge";
+ break;
+ case 0x11308086:
+ s = "Intel 82815 (i815 GMCH) Host To Hub bridge";
+ break;
+ case 0x71808086:
+ s = "Intel 82443LX (440 LX) host to PCI bridge";
+ break;
+ case 0x71908086:
+ s = "Intel 82443BX (440 BX) host to PCI bridge";
+ break;
+ case 0x71928086:
+ s = "Intel 82443BX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x71948086:
+ s = "Intel 82443MX host to PCI bridge";
+ break;
+ case 0x71a08086:
+ s = "Intel 82443GX host to PCI bridge";
+ break;
+ case 0x71a18086:
+ s = "Intel 82443GX host to AGP bridge";
+ break;
+ case 0x71a28086:
+ s = "Intel 82443GX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x84c48086:
+ s = "Intel 82454KX/GX (Orion) host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x4a, 1);
+ break;
+ case 0x84ca8086:
+ /*
+ * For the 450nx chipset, there is a whole bundle of
+ * things pretending to be host bridges. The MIOC will
+ * be seen first and isn't really a pci bridge (the
+ * actual busses are attached to the PXB's). We need to
+ * read the registers of the MIOC to figure out the
+ * bus numbers for the PXB channels.
+ *
+ * Since the MIOC doesn't have a pci bus attached, we
+ * pretend it wasn't there.
+ */
+ pxb[0] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd0, 1); /* BUSNO[0] */
+ pxb[1] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd1, 1) + 1; /* SUBA[0]+1 */
+ pxb[2] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd3, 1); /* BUSNO[1] */
+ pxb[3] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd4, 1) + 1; /* SUBA[1]+1 */
+ return NULL;
+ case 0x84cb8086:
+ switch (slot) {
+ case 0x12:
+ s = "Intel 82454NX PXB#0, Bus#A";
+ *busnum = pxb[0];
+ break;
+ case 0x13:
+ s = "Intel 82454NX PXB#0, Bus#B";
+ *busnum = pxb[1];
+ break;
+ case 0x14:
+ s = "Intel 82454NX PXB#1, Bus#A";
+ *busnum = pxb[2];
+ break;
+ case 0x15:
+ s = "Intel 82454NX PXB#1, Bus#B";
+ *busnum = pxb[3];
+ break;
+ }
+ break;
+ case 0x1A308086:
+ s = "Intel 82845 Host to PCI bridge";
+ break;
+
+ /* AMD -- vendor 0x1022 */
+ case 0x30001022:
+ s = "AMD Elan SC520 host to PCI bridge";
+#ifdef CPU_ELAN
+ init_AMD_Elan_sc520();
+#else
+ printf(
+"*** WARNING: missing CPU_ELAN -- timekeeping may be wrong\n");
+#endif
+ break;
+ case 0x70061022:
+ s = "AMD-751 host to PCI bridge";
+ break;
+ case 0x700e1022:
+ s = "AMD-761 host to PCI bridge";
+ break;
+
+ /* SiS -- vendor 0x1039 */
+ case 0x04961039:
+ s = "SiS 85c496";
+ break;
+ case 0x04061039:
+ s = "SiS 85c501";
+ break;
+ case 0x06011039:
+ s = "SiS 85c601";
+ break;
+ case 0x55911039:
+ s = "SiS 5591 host to PCI bridge";
+ break;
+ case 0x00011039:
+ s = "SiS 5591 host to AGP bridge";
+ break;
+
+ /* VLSI -- vendor 0x1004 */
+ case 0x00051004:
+ s = "VLSI 82C592 Host to PCI bridge";
+ break;
+
+ /* XXX Here is MVP3, I got the datasheet but NO M/B to test it */
+ /* totally. Please let me know if anything wrong. -F */
+ /* XXX need info on the MVP3 -- any takers? */
+ case 0x05981106:
+ s = "VIA 82C598MVP (Apollo MVP3) host bridge";
+ break;
+
+ /* AcerLabs -- vendor 0x10b9 */
+ /* Funny : The datasheet told me vendor id is "10b8",sub-vendor */
+ /* id is '10b9" but the register always shows "10b9". -Foxfair */
+ case 0x154110b9:
+ s = "AcerLabs M1541 (Aladdin-V) PCI host bridge";
+ break;
+
+ /* OPTi -- vendor 0x1045 */
+ case 0xc7011045:
+ s = "OPTi 82C700 host to PCI bridge";
+ break;
+ case 0xc8221045:
+ s = "OPTi 82C822 host to PCI Bridge";
+ break;
+
+ /* ServerWorks -- vendor 0x1166 */
+ case 0x00051166:
+ s = "ServerWorks NB6536 2.0HE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00061166:
+ /* FALLTHROUGH */
+ case 0x00081166:
+ /* FALLTHROUGH */
+ case 0x02011166:
+ /* FALLTHROUGH */
+ case 0x010f1014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00091166:
+ s = "ServerWorks NB6635 3.0LE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00101166:
+ s = "ServerWorks CIOB30 host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00111166:
+ /* FALLTHROUGH */
+ case 0x03021014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks CMIC-HE host to PCI-X bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* XXX unknown chipset, but working */
+ case 0x00171166:
+ /* FALLTHROUGH */
+ case 0x01011166:
+ case 0x01101166:
+ case 0x02251166:
+ s = "ServerWorks host to PCI bridge(unknown chipset)";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* Compaq/HP -- vendor 0x0e11 */
+ case 0x60100e11:
+ s = "Compaq/HP Model 6010 HotPlug PCI Bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0xc8, 1);
+ break;
+
+ /* Integrated Micro Solutions -- vendor 0x10e0 */
+ case 0x884910e0:
+ s = "Integrated Micro Solutions VL Bridge";
+ break;
+
+ default:
+ if (class == PCIC_BRIDGE && subclass == PCIS_BRIDGE_HOST)
+ s = "Host to PCI bridge";
+ break;
+ }
+
+ return s;
+}
+
+/*
+ * Scan the first pci bus for host-pci bridges and add pcib instances
+ * to the nexus for each bridge.
+ */
+static void
+legacy_pcib_identify(driver_t *driver, device_t parent)
+{
+ int bus, slot, func;
+ u_int8_t hdrtype;
+ int found = 0;
+ int pcifunchigh;
+ int found824xx = 0;
+ int found_orion = 0;
+ device_t child;
+ devclass_t pci_devclass;
+
+ if (pci_cfgregopen() == 0)
+ return;
+ /*
+ * Check to see if we haven't already had a PCI bus added
+ * via some other means. If we have, bail since otherwise
+ * we're going to end up duplicating it.
+ */
+ if ((pci_devclass = devclass_find("pci")) &&
+ devclass_get_device(pci_devclass, 0))
+ return;
+
+
+ bus = 0;
+ retry:
+ for (slot = 0; slot <= PCI_SLOTMAX; slot++) {
+ func = 0;
+ hdrtype = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_HDRTYPE, 1);
+ /*
+ * When enumerating bus devices, the standard says that
+ * one should check the header type and ignore the slots whose
+ * header types that the software doesn't know about. We use
+ * this to filter out devices.
+ */
+ if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE)
+ continue;
+ if ((hdrtype & PCIM_MFDEV) &&
+ (!found_orion || hdrtype != 0xff))
+ pcifunchigh = PCI_FUNCMAX;
+ else
+ pcifunchigh = 0;
+ for (func = 0; func <= pcifunchigh; func++) {
+ /*
+ * Read the IDs and class from the device.
+ */
+ u_int32_t id;
+ u_int8_t class, subclass, busnum;
+ const char *s;
+ device_t *devs;
+ int ndevs, i;
+
+ id = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_DEVVENDOR, 4);
+ if (id == -1)
+ continue;
+ class = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_CLASS, 1);
+ subclass = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_SUBCLASS, 1);
+
+ s = legacy_pcib_is_host_bridge(bus, slot, func,
+ id, class, subclass,
+ &busnum);
+ if (s == NULL)
+ continue;
+
+ /*
+ * Check to see if the physical bus has already
+ * been seen. Eg: hybrid 32 and 64 bit host
+ * bridges to the same logical bus.
+ */
+ if (device_get_children(parent, &devs, &ndevs) == 0) {
+ for (i = 0; s != NULL && i < ndevs; i++) {
+ if (strcmp(device_get_name(devs[i]),
+ "pcib") != 0)
+ continue;
+ if (legacy_get_pcibus(devs[i]) == busnum)
+ s = NULL;
+ }
+ free(devs, M_TEMP);
+ }
+
+ if (s == NULL)
+ continue;
+ /*
+ * Add at priority 100 to make sure we
+ * go after any motherboard resources
+ */
+ child = BUS_ADD_CHILD(parent, 100,
+ "pcib", busnum);
+ device_set_desc(child, s);
+ legacy_set_pcibus(child, busnum);
+
+ found = 1;
+ if (id == 0x12258086)
+ found824xx = 1;
+ if (id == 0x84c48086)
+ found_orion = 1;
+ }
+ }
+ if (found824xx && bus == 0) {
+ bus++;
+ goto retry;
+ }
+
+ /*
+ * Make sure we add at least one bridge since some old
+ * hardware doesn't actually have a host-pci bridge device.
+ * Note that pci_cfgregopen() thinks we have PCI devices..
+ */
+ if (!found) {
+ if (bootverbose)
+ printf(
+ "legacy_pcib_identify: no bridge found, adding pcib0 anyway\n");
+ child = BUS_ADD_CHILD(parent, 100, "pcib", 0);
+ legacy_set_pcibus(child, 0);
+ }
+}
+
+static int
+legacy_pcib_probe(device_t dev)
+{
+
+ if (pci_cfgregopen() == 0)
+ return ENXIO;
+ return -100;
+}
+
+static int
+legacy_pcib_attach(device_t dev)
+{
+ device_t pir;
+ int bus;
+
+ /*
+ * Look for a PCI BIOS interrupt routing table as that will be
+ * our method of routing interrupts if we have one.
+ */
+ bus = pcib_get_bus(dev);
+#ifndef __rtems__
+ if (pci_pir_probe(bus, 0)) {
+ pir = BUS_ADD_CHILD(device_get_parent(dev), 0, "pir", 0);
+ if (pir != NULL)
+ device_probe_and_attach(pir);
+ }
+#else /* __rtems__ */
+#endif /* __rtems__ */
+ device_add_child(dev, "pci", bus);
+ return bus_generic_attach(dev);
+}
+
+int
+legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ *result = 0;
+ return 0;
+ case PCIB_IVAR_BUS:
+ *result = legacy_get_pcibus(dev);
+ return 0;
+ }
+ return ENOENT;
+}
+
+int
+legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ return EINVAL;
+ case PCIB_IVAR_BUS:
+ legacy_set_pcibus(dev, value);
+ return 0;
+ }
+ return ENOENT;
+}
+
+SYSCTL_DECL(_hw_pci);
+
+static unsigned long legacy_host_mem_start = 0x80000000;
+TUNABLE_ULONG("hw.pci.host_mem_start", &legacy_host_mem_start);
+SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN,
+ &legacy_host_mem_start, 0x80000000,
+ "Limit the host bridge memory to being above this address. Must be\n\
+set at boot via a tunable.");
+
+struct resource *
+legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
+ u_long start, u_long end, u_long count, u_int flags)
+{
+ /*
+ * If no memory preference is given, use upper 32MB slot most
+ * bioses use for their memory window. Typically other bridges
+ * before us get in the way to assert their preferences on memory.
+ * Hardcoding like this sucks, so a more MD/MI way needs to be
+ * found to do it. This is typically only used on older laptops
+ * that don't have pci busses behind pci bridge, so assuming > 32MB
+ * is liekly OK.
+ *
+ * However, this can cause problems for other chipsets, so we make
+ * this tunable by hw.pci.host_mem_start.
+ */
+ if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL)
+ start = legacy_host_mem_start;
+ if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL)
+ start = 0x1000;
+ return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
+ count, flags));
+}
+
+static device_method_t legacy_pcib_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, legacy_pcib_identify),
+ DEVMETHOD(device_probe, legacy_pcib_probe),
+ DEVMETHOD(device_attach, legacy_pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, legacy_pcib_maxslots),
+ DEVMETHOD(pcib_read_config, legacy_pcib_read_config),
+ DEVMETHOD(pcib_write_config, legacy_pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, legacy_pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, legacy_pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, legacy_pcib_map_msi),
+
+ { 0, 0 }
+};
+
+static devclass_t hostb_devclass;
+
+DEFINE_CLASS_0(pcib, legacy_pcib_driver, legacy_pcib_methods, 1);
+DRIVER_MODULE(pcib, legacy, legacy_pcib_driver, hostb_devclass, 0, 0);
+
+
+#ifndef __rtems__
+/*
+ * Install placeholder to claim the resources owned by the
+ * PCI bus interface. This could be used to extract the
+ * config space registers in the extreme case where the PnP
+ * ID is available and the PCI BIOS isn't, but for now we just
+ * eat the PnP ID and do nothing else.
+ *
+ * XXX we should silence this probe, as it will generally confuse
+ * people.
+ */
+static struct isa_pnp_id pcibus_pnp_ids[] = {
+ { 0x030ad041 /* PNP0A03 */, "PCI Bus" },
+ { 0x080ad041 /* PNP0A08 */, "PCIe Bus" },
+ { 0 }
+};
+
+static int
+pcibus_pnp_probe(device_t dev)
+{
+ int result;
+
+ if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, pcibus_pnp_ids)) <= 0)
+ device_quiet(dev);
+ return(result);
+}
+
+static int
+pcibus_pnp_attach(device_t dev)
+{
+ return(0);
+}
+
+static device_method_t pcibus_pnp_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibus_pnp_probe),
+ DEVMETHOD(device_attach, pcibus_pnp_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+ { 0, 0 }
+};
+
+static devclass_t pcibus_pnp_devclass;
+
+DEFINE_CLASS_0(pcibus_pnp, pcibus_pnp_driver, pcibus_pnp_methods, 1);
+DRIVER_MODULE(pcibus_pnp, isa, pcibus_pnp_driver, pcibus_pnp_devclass, 0, 0);
+
+
+/*
+ * Provide a PCI-PCI bridge driver for PCI busses behind PCI-PCI bridges
+ * that appear in the PCIBIOS Interrupt Routing Table to use the routing
+ * table for interrupt routing when possible.
+ */
+static int pcibios_pcib_probe(device_t bus);
+
+static device_method_t pcibios_pcib_pci_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibios_pcib_probe),
+ DEVMETHOD(device_attach, pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, pcib_maxslots),
+ DEVMETHOD(pcib_read_config, pcib_read_config),
+ DEVMETHOD(pcib_write_config, pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, pcib_map_msi),
+
+ {0, 0}
+};
+
+static devclass_t pcib_devclass;
+
+DEFINE_CLASS_0(pcib, pcibios_pcib_driver, pcibios_pcib_pci_methods,
+ sizeof(struct pcib_softc));
+DRIVER_MODULE(pcibios_pcib, pci, pcibios_pcib_driver, pcib_devclass, 0, 0);
+
+static int
+pcibios_pcib_probe(device_t dev)
+{
+ int bus;
+
+ if ((pci_get_class(dev) != PCIC_BRIDGE) ||
+ (pci_get_subclass(dev) != PCIS_BRIDGE_PCI))
+ return (ENXIO);
+ bus = pci_read_config(dev, PCIR_SECBUS_1, 1);
+ if (bus == 0)
+ return (ENXIO);
+ if (!pci_pir_probe(bus, 1))
+ return (ENXIO);
+ device_set_desc(dev, "PCIBIOS PCI-PCI bridge");
+ return (-2000);
+}
+
+static int
+pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
+{
+ return (pci_pir_route_interrupt(pci_get_bus(dev), pci_get_slot(dev),
+ pci_get_function(dev), pin));
+}
+#endif /* __rtems__ */
diff --git a/freebsd/sys/m68k/include/machine/in_cksum.h b/freebsd/sys/m68k/include/machine/in_cksum.h
new file mode 100644
index 00000000..37d88e2e
--- /dev/null
+++ b/freebsd/sys/m68k/include/machine/in_cksum.h
@@ -0,0 +1,77 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from tahoe: in_cksum.c 1.2 86/01/05
+ * from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91
+ * from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp
+ * from: src/sys/alpha/include/in_cksum.h,v 1.7 2005/03/02 21:33:20 joerg
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_IN_CKSUM_H_
+#define _MACHINE_IN_CKSUM_H_ 1
+
+#include <sys/cdefs.h>
+
+#define in_cksum(m, len) in_cksum_skip(m, len, 0)
+
+/*
+ * It it useful to have an Internet checksum routine which is inlineable
+ * and optimized specifically for the task of computing IP header checksums
+ * in the normal case (where there are no options and the header length is
+ * therefore always exactly five 32-bit words.
+ */
+#ifdef __CC_SUPPORTS___INLINE
+
+static __inline void
+in_cksum_update(struct ip *ip)
+{
+ int __tmpsum;
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256;
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16));
+}
+
+#else
+
+#define in_cksum_update(ip) \
+ do { \
+ int __tmpsum; \
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256; \
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \
+ } while(0)
+
+#endif
+
+#ifdef _KERNEL
+u_int in_cksum_hdr(const struct ip *ip);
+u_short in_addword(u_short sum, u_short b);
+u_short in_pseudo(u_int sum, u_int b, u_int c);
+u_short in_cksum_skip(struct mbuf *m, int len, int skip);
+#endif
+
+#endif /* _MACHINE_IN_CKSUM_H_ */
diff --git a/freebsd/sys/m68k/include/machine/legacyvar.h b/freebsd/sys/m68k/include/machine/legacyvar.h
new file mode 100644
index 00000000..0b0fa433
--- /dev/null
+++ b/freebsd/sys/m68k/include/machine/legacyvar.h
@@ -0,0 +1,57 @@
+/*-
+ * Copyright (c) 2000 Peter Wemm <peter@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_LEGACYVAR_H_
+#define _MACHINE_LEGACYVAR_H_
+
+enum legacy_device_ivars {
+ LEGACY_IVAR_PCIDOMAIN,
+ LEGACY_IVAR_PCIBUS
+};
+
+#define LEGACY_ACCESSOR(var, ivar, type) \
+ __BUS_ACCESSOR(legacy, var, LEGACY, ivar, type)
+
+LEGACY_ACCESSOR(pcidomain, PCIDOMAIN, uint32_t)
+LEGACY_ACCESSOR(pcibus, PCIBUS, uint32_t)
+
+#undef LEGACY_ACCESSOR
+
+int legacy_pcib_maxslots(device_t dev);
+uint32_t legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes);
+int legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result);
+void legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes);
+int legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value);
+struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child,
+ int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
+
+#endif /* !_MACHINE_LEGACYVAR_H_ */
diff --git a/freebsd/sys/m68k/include/machine/pci_cfgreg.h b/freebsd/sys/m68k/include/machine/pci_cfgreg.h
new file mode 100644
index 00000000..bc72418d
--- /dev/null
+++ b/freebsd/sys/m68k/include/machine/pci_cfgreg.h
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
+ */
+
+#define CONF1_ADDR_PORT 0x0cf8
+#define CONF1_DATA_PORT 0x0cfc
+
+#define CONF1_ENABLE 0x80000000ul
+#define CONF1_ENABLE_CHK 0x80000000ul
+#define CONF1_ENABLE_MSK 0x7f000000ul
+#define CONF1_ENABLE_CHK1 0xff000001ul
+#define CONF1_ENABLE_MSK1 0x80000001ul
+#define CONF1_ENABLE_RES1 0x80000000ul
+
+#define CONF2_ENABLE_PORT 0x0cf8
+#define CONF2_FORWARD_PORT 0x0cfa
+
+#define CONF2_ENABLE_CHK 0x0e
+#define CONF2_ENABLE_RES 0x0e
+
+int pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus);
+int pci_cfgregopen(void);
+u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes);
+void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes);
+void pci_pir_open(void);
+int pci_pir_probe(int bus, int require_parse);
+int pci_pir_route_interrupt(int bus, int device, int func, int pin);
diff --git a/freebsd/sys/m68k/m68k/in_cksum.c b/freebsd/sys/m68k/m68k/in_cksum.c
new file mode 100644
index 00000000..c6f7b568
--- /dev/null
+++ b/freebsd/sys/m68k/m68k/in_cksum.c
@@ -0,0 +1,255 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1988, 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ * Copyright (c) 1996
+ * Matt Thomas <matt@3am-software.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)in_cksum.c 8.1 (Berkeley) 6/10/93
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/mbuf.h>
+#include <sys/systm.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <machine/in_cksum.h>
+
+/*
+ * Checksum routine for Internet Protocol family headers
+ * (Portable Alpha version).
+ *
+ * This routine is very heavily used in the network
+ * code and should be modified for each CPU to be as fast as possible.
+ */
+
+#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x)
+#define REDUCE32 \
+ { \
+ q_util.q = sum; \
+ sum = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
+ }
+#define REDUCE16 \
+ { \
+ q_util.q = sum; \
+ l_util.l = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
+ sum = l_util.s[0] + l_util.s[1]; \
+ ADDCARRY(sum); \
+ }
+
+static const u_int32_t in_masks[] = {
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
+ 0x00000000, 0x000000FF, 0x0000FFFF, 0x00FFFFFF, /* offset 0 */
+ 0x00000000, 0x0000FF00, 0x00FFFF00, 0xFFFFFF00, /* offset 1 */
+ 0x00000000, 0x00FF0000, 0xFFFF0000, 0xFFFF0000, /* offset 2 */
+ 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, /* offset 3 */
+#else
+ /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
+ 0x00000000, 0xFF000000, 0xFFFF0000, 0xFFFFFF00, /* offset 0 */
+ 0x00000000, 0x00FF0000, 0x00FFFF00, 0x00FFFFFF, /* offset 1 */
+ 0x00000000, 0x0000FF00, 0x0000FFFF, 0x0000FFFF, /* offset 2 */
+ 0x00000000, 0x000000FF, 0x000000FF, 0x000000FF, /* offset 3 */
+#endif
+};
+
+union l_util {
+ u_int16_t s[2];
+ u_int32_t l;
+};
+union q_util {
+ u_int16_t s[4];
+ u_int32_t l[2];
+ u_int64_t q;
+};
+
+static u_int64_t
+in_cksumdata(const void *buf, int len)
+{
+ const u_int32_t *lw = (const u_int32_t *) buf;
+ u_int64_t sum = 0;
+ u_int64_t prefilled;
+ int offset;
+ union q_util q_util;
+
+ if ((3 & (long) lw) == 0 && len == 20) {
+ sum = (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3] + lw[4];
+ REDUCE32;
+ return sum;
+ }
+
+ if ((offset = 3 & (long) lw) != 0) {
+ const u_int32_t *masks = in_masks + (offset << 2);
+ lw = (u_int32_t *) (((long) lw) - offset);
+ sum = *lw++ & masks[len >= 3 ? 3 : len];
+ len -= 4 - offset;
+ if (len <= 0) {
+ REDUCE32;
+ return sum;
+ }
+ }
+#if 0
+ /*
+ * Force to cache line boundary.
+ */
+ offset = 32 - (0x1f & (long) lw);
+ if (offset < 32 && len > offset) {
+ len -= offset;
+ if (4 & offset) {
+ sum += (u_int64_t) lw[0];
+ lw += 1;
+ }
+ if (8 & offset) {
+ sum += (u_int64_t) lw[0] + lw[1];
+ lw += 2;
+ }
+ if (16 & offset) {
+ sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
+ lw += 4;
+ }
+ }
+#endif
+ /*
+ * access prefilling to start load of next cache line.
+ * then add current cache line
+ * save result of prefilling for loop iteration.
+ */
+ prefilled = lw[0];
+ while ((len -= 32) >= 4) {
+ u_int64_t prefilling = lw[8];
+ sum += prefilled + lw[1] + lw[2] + lw[3]
+ + lw[4] + lw[5] + lw[6] + lw[7];
+ lw += 8;
+ prefilled = prefilling;
+ }
+ if (len >= 0) {
+ sum += prefilled + lw[1] + lw[2] + lw[3]
+ + lw[4] + lw[5] + lw[6] + lw[7];
+ lw += 8;
+ } else {
+ len += 32;
+ }
+ while ((len -= 16) >= 0) {
+ sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
+ lw += 4;
+ }
+ len += 16;
+ while ((len -= 4) >= 0) {
+ sum += (u_int64_t) *lw++;
+ }
+ len += 4;
+ if (len > 0)
+ sum += (u_int64_t) (in_masks[len] & *lw);
+ REDUCE32;
+ return sum;
+}
+
+u_short
+in_addword(u_short a, u_short b)
+{
+ u_int64_t sum = a + b;
+
+ ADDCARRY(sum);
+ return (sum);
+}
+
+u_short
+#ifdef __rtems__
+/* Prototype does not match in FreeBSD code */
+in_pseudo(u_int a, u_int b, u_int c)
+#else
+in_pseudo(u_int32_t a, u_int32_t b, u_int32_t c)
+#endif
+{
+ u_int64_t sum;
+ union q_util q_util;
+ union l_util l_util;
+
+ sum = (u_int64_t) a + b + c;
+ REDUCE16;
+ return (sum);
+}
+
+u_short
+in_cksum_skip(struct mbuf *m, int len, int skip)
+{
+ u_int64_t sum = 0;
+ int mlen = 0;
+ int clen = 0;
+ caddr_t addr;
+ union q_util q_util;
+ union l_util l_util;
+
+ len -= skip;
+ for (; skip && m; m = m->m_next) {
+ if (m->m_len > skip) {
+ mlen = m->m_len - skip;
+ addr = mtod(m, caddr_t) + skip;
+ goto skip_start;
+ } else {
+ skip -= m->m_len;
+ }
+ }
+
+ for (; m && len; m = m->m_next) {
+ if (m->m_len == 0)
+ continue;
+ mlen = m->m_len;
+ addr = mtod(m, caddr_t);
+skip_start:
+ if (len < mlen)
+ mlen = len;
+
+ if ((clen ^ (uintptr_t) addr) & 1)
+ sum += in_cksumdata(addr, mlen) << 8;
+ else
+ sum += in_cksumdata(addr, mlen);
+
+ clen += mlen;
+ len -= mlen;
+ }
+ REDUCE16;
+ return (~sum & 0xffff);
+}
+
+u_int in_cksum_hdr(const struct ip *ip)
+{
+ u_int64_t sum = in_cksumdata(ip, sizeof(struct ip));
+ union q_util q_util;
+ union l_util l_util;
+ REDUCE16;
+ return (~sum & 0xffff);
+}
diff --git a/freebsd/sys/m68k/m68k/legacy.c b/freebsd/sys/m68k/m68k/legacy.c
new file mode 100644
index 00000000..2547990c
--- /dev/null
+++ b/freebsd/sys/m68k/m68k/legacy.c
@@ -0,0 +1,347 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright 1998 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby
+ * granted, provided that both the above copyright notice and this
+ * permission notice appear in all copies, that both the above
+ * copyright notice and this permission notice appear in all
+ * supporting documentation, and that the name of M.I.T. not be used
+ * in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission. M.I.T. makes
+ * no representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
+ * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
+ * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * This code implements a system driver for legacy systems that do not
+ * support ACPI or when ACPI support is not present in the kernel.
+ */
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <machine/bus.h>
+#include <sys/pcpu.h>
+#include <sys/rman.h>
+#include <sys/smp.h>
+
+#ifndef __rtems__
+#include <rtems/bsd/local/opt_mca.h>
+#endif /* __rtems__ */
+#ifdef DEV_MCA
+#include <i386/bios/mca_machdep.h>
+#endif
+
+#include <machine/legacyvar.h>
+#include <machine/resource.h>
+
+static MALLOC_DEFINE(M_LEGACYDEV, "legacydrv", "legacy system device");
+struct legacy_device {
+ int lg_pcibus;
+};
+
+#define DEVTOAT(dev) ((struct legacy_device *)device_get_ivars(dev))
+
+static int legacy_probe(device_t);
+static int legacy_attach(device_t);
+static int legacy_print_child(device_t, device_t);
+static device_t legacy_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static int legacy_read_ivar(device_t, device_t, int, uintptr_t *);
+static int legacy_write_ivar(device_t, device_t, int, uintptr_t);
+
+static device_method_t legacy_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, legacy_probe),
+ DEVMETHOD(device_attach, legacy_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, legacy_print_child),
+ DEVMETHOD(bus_add_child, legacy_add_child),
+ DEVMETHOD(bus_read_ivar, legacy_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_write_ivar),
+ DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t legacy_driver = {
+ "legacy",
+ legacy_methods,
+ 1, /* no softc */
+};
+static devclass_t legacy_devclass;
+
+DRIVER_MODULE(legacy, nexus, legacy_driver, legacy_devclass, 0, 0);
+
+static int
+legacy_probe(device_t dev)
+{
+
+ device_set_desc(dev, "legacy system");
+ device_quiet(dev);
+ return (0);
+}
+
+static int
+legacy_attach(device_t dev)
+{
+ device_t child;
+
+ /*
+ * Let our child drivers identify any child devices that they
+ * can find. Once that is done attach any devices that we
+ * found.
+ */
+ bus_generic_probe(dev);
+ bus_generic_attach(dev);
+
+#ifndef PC98
+ /*
+ * If we didn't see EISA or ISA on a pci bridge, create some
+ * connection points now so they show up "on motherboard".
+ */
+ if (!devclass_get_device(devclass_find("eisa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "eisa", 0);
+ if (child == NULL)
+ panic("legacy_attach eisa");
+ device_probe_and_attach(child);
+ }
+#endif
+#ifdef DEV_MCA
+ if (MCA_system && !devclass_get_device(devclass_find("mca"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "mca", 0);
+ if (child == 0)
+ panic("legacy_probe mca");
+ device_probe_and_attach(child);
+ }
+#endif
+ if (!devclass_get_device(devclass_find("isa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "isa", 0);
+ if (child == NULL)
+ panic("legacy_attach isa");
+ device_probe_and_attach(child);
+ }
+
+ return 0;
+}
+
+static int
+legacy_print_child(device_t bus, device_t child)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+ int retval = 0;
+
+ retval += bus_print_child_header(bus, child);
+ if (atdev->lg_pcibus != -1)
+ retval += printf(" pcibus %d", atdev->lg_pcibus);
+ retval += printf(" on motherboard\n"); /* XXX "motherboard", ick */
+
+ return (retval);
+}
+
+static device_t
+legacy_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ device_t child;
+ struct legacy_device *atdev;
+
+ atdev = malloc(sizeof(struct legacy_device), M_LEGACYDEV,
+ M_NOWAIT | M_ZERO);
+ if (atdev == NULL)
+ return(NULL);
+ atdev->lg_pcibus = -1;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child == NULL)
+ free(atdev, M_LEGACYDEV);
+ else
+ /* should we free this in legacy_child_detached? */
+ device_set_ivars(child, atdev);
+
+ return (child);
+}
+
+static int
+legacy_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ *result = 0;
+ break;
+ case LEGACY_IVAR_PCIBUS:
+ *result = atdev->lg_pcibus;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+
+static int
+legacy_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ return EINVAL;
+ case LEGACY_IVAR_PCIBUS:
+ atdev->lg_pcibus = value;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+/*
+ * Legacy CPU attachment when ACPI is not available. Drivers like
+ * cpufreq(4) hang off this.
+ */
+static void cpu_identify(driver_t *driver, device_t parent);
+static int cpu_read_ivar(device_t dev, device_t child, int index,
+ uintptr_t *result);
+static device_t cpu_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static struct resource_list *cpu_get_rlist(device_t dev, device_t child);
+
+struct cpu_device {
+ struct resource_list cd_rl;
+ struct pcpu *cd_pcpu;
+};
+
+static device_method_t cpu_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, cpu_identify),
+ DEVMETHOD(device_probe, bus_generic_probe),
+ DEVMETHOD(device_attach, bus_generic_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_add_child, cpu_add_child),
+ DEVMETHOD(bus_read_ivar, cpu_read_ivar),
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_get_resource_list, cpu_get_rlist),
+ DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
+ DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource),
+ DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource),
+ DEVMETHOD(bus_driver_added, bus_generic_driver_added),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t cpu_driver = {
+ "cpu",
+ cpu_methods,
+ 1, /* no softc */
+};
+static devclass_t cpu_devclass;
+DRIVER_MODULE(cpu, legacy, cpu_driver, cpu_devclass, 0, 0);
+
+static void
+cpu_identify(driver_t *driver, device_t parent)
+{
+ device_t child;
+ int i;
+
+ /*
+ * Attach a cpuX device for each CPU. We use an order of 150
+ * so that these devices are attached after the Host-PCI
+ * bridges (which are added at order 100).
+ */
+ for (i = 0; i <= mp_maxid; i++)
+ if (!CPU_ABSENT(i)) {
+ child = BUS_ADD_CHILD(parent, 150, "cpu", i);
+ if (child == NULL)
+ panic("legacy_attach cpu");
+ }
+}
+
+static device_t
+cpu_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ struct cpu_device *cd;
+ device_t child;
+ struct pcpu *pc;
+
+ if ((cd = malloc(sizeof(*cd), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL)
+ return (NULL);
+
+ resource_list_init(&cd->cd_rl);
+ pc = pcpu_find(device_get_unit(bus));
+ cd->cd_pcpu = pc;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child != NULL) {
+ pc->pc_device = child;
+ device_set_ivars(child, cd);
+ } else
+ free(cd, M_DEVBUF);
+ return (child);
+}
+
+static struct resource_list *
+cpu_get_rlist(device_t dev, device_t child)
+{
+ struct cpu_device *cpdev;
+
+ cpdev = device_get_ivars(child);
+ return (&cpdev->cd_rl);
+}
+
+static int
+cpu_read_ivar(device_t dev, device_t child, int index, uintptr_t *result)
+{
+ struct cpu_device *cpdev;
+
+ if (index != CPU_IVAR_PCPU)
+ return (ENOENT);
+ cpdev = device_get_ivars(child);
+ *result = (uintptr_t)cpdev->cd_pcpu;
+ return (0);
+}
diff --git a/freebsd/sys/m68k/pci/pci_bus.c b/freebsd/sys/m68k/pci/pci_bus.c
new file mode 100644
index 00000000..6627db98
--- /dev/null
+++ b/freebsd/sys/m68k/pci/pci_bus.c
@@ -0,0 +1,729 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/local/opt_cpu.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
+
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcib_private.h>
+#include <isa/isavar.h>
+#ifdef CPU_ELAN
+#include <machine/md_var.h>
+#endif
+#include <machine/legacyvar.h>
+#include <machine/pci_cfgreg.h>
+#include <machine/resource.h>
+
+#include <rtems/bsd/local/pcib_if.h>
+
+#ifndef __rtems__
+static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev,
+ int pin);
+#else /* __rtems__ */
+int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin);
+#endif /* __rtems__ */
+
+
+int
+legacy_pcib_maxslots(device_t dev)
+{
+ return 31;
+}
+
+/* read configuration space register */
+
+#ifdef __rtems__
+uint32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#else
+u_int32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#endif
+{
+ return(pci_cfgregread(bus, slot, func, reg, bytes));
+}
+
+/* write configuration space register */
+
+void
+legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes)
+{
+ pci_cfgregwrite(bus, slot, func, reg, data, bytes);
+}
+
+/* Pass MSI requests up to the nexus. */
+
+static int
+legacy_pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount,
+ int *irqs)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSI(device_get_parent(bus), dev, count, maxcount,
+ irqs));
+}
+
+static int
+legacy_pcib_alloc_msix(device_t pcib, device_t dev, int *irq)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq));
+}
+
+static int
+legacy_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr,
+ uint32_t *data)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data));
+}
+
+static const char *
+legacy_pcib_is_host_bridge(int bus, int slot, int func,
+ uint32_t id, uint8_t class, uint8_t subclass,
+ uint8_t *busnum)
+{
+ const char *s = NULL;
+ static uint8_t pxb[4]; /* hack for 450nx */
+
+ *busnum = 0;
+
+ switch (id) {
+ case 0x12258086:
+ s = "Intel 824?? host to PCI bridge";
+ /* XXX This is a guess */
+ /* *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x41, 1); */
+ *busnum = bus;
+ break;
+ case 0x71208086:
+ s = "Intel 82810 (i810 GMCH) Host To Hub bridge";
+ break;
+ case 0x71228086:
+ s = "Intel 82810-DC100 (i810-DC100 GMCH) Host To Hub bridge";
+ break;
+ case 0x71248086:
+ s = "Intel 82810E (i810E GMCH) Host To Hub bridge";
+ break;
+ case 0x11308086:
+ s = "Intel 82815 (i815 GMCH) Host To Hub bridge";
+ break;
+ case 0x71808086:
+ s = "Intel 82443LX (440 LX) host to PCI bridge";
+ break;
+ case 0x71908086:
+ s = "Intel 82443BX (440 BX) host to PCI bridge";
+ break;
+ case 0x71928086:
+ s = "Intel 82443BX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x71948086:
+ s = "Intel 82443MX host to PCI bridge";
+ break;
+ case 0x71a08086:
+ s = "Intel 82443GX host to PCI bridge";
+ break;
+ case 0x71a18086:
+ s = "Intel 82443GX host to AGP bridge";
+ break;
+ case 0x71a28086:
+ s = "Intel 82443GX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x84c48086:
+ s = "Intel 82454KX/GX (Orion) host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x4a, 1);
+ break;
+ case 0x84ca8086:
+ /*
+ * For the 450nx chipset, there is a whole bundle of
+ * things pretending to be host bridges. The MIOC will
+ * be seen first and isn't really a pci bridge (the
+ * actual busses are attached to the PXB's). We need to
+ * read the registers of the MIOC to figure out the
+ * bus numbers for the PXB channels.
+ *
+ * Since the MIOC doesn't have a pci bus attached, we
+ * pretend it wasn't there.
+ */
+ pxb[0] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd0, 1); /* BUSNO[0] */
+ pxb[1] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd1, 1) + 1; /* SUBA[0]+1 */
+ pxb[2] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd3, 1); /* BUSNO[1] */
+ pxb[3] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd4, 1) + 1; /* SUBA[1]+1 */
+ return NULL;
+ case 0x84cb8086:
+ switch (slot) {
+ case 0x12:
+ s = "Intel 82454NX PXB#0, Bus#A";
+ *busnum = pxb[0];
+ break;
+ case 0x13:
+ s = "Intel 82454NX PXB#0, Bus#B";
+ *busnum = pxb[1];
+ break;
+ case 0x14:
+ s = "Intel 82454NX PXB#1, Bus#A";
+ *busnum = pxb[2];
+ break;
+ case 0x15:
+ s = "Intel 82454NX PXB#1, Bus#B";
+ *busnum = pxb[3];
+ break;
+ }
+ break;
+ case 0x1A308086:
+ s = "Intel 82845 Host to PCI bridge";
+ break;
+
+ /* AMD -- vendor 0x1022 */
+ case 0x30001022:
+ s = "AMD Elan SC520 host to PCI bridge";
+#ifdef CPU_ELAN
+ init_AMD_Elan_sc520();
+#else
+ printf(
+"*** WARNING: missing CPU_ELAN -- timekeeping may be wrong\n");
+#endif
+ break;
+ case 0x70061022:
+ s = "AMD-751 host to PCI bridge";
+ break;
+ case 0x700e1022:
+ s = "AMD-761 host to PCI bridge";
+ break;
+
+ /* SiS -- vendor 0x1039 */
+ case 0x04961039:
+ s = "SiS 85c496";
+ break;
+ case 0x04061039:
+ s = "SiS 85c501";
+ break;
+ case 0x06011039:
+ s = "SiS 85c601";
+ break;
+ case 0x55911039:
+ s = "SiS 5591 host to PCI bridge";
+ break;
+ case 0x00011039:
+ s = "SiS 5591 host to AGP bridge";
+ break;
+
+ /* VLSI -- vendor 0x1004 */
+ case 0x00051004:
+ s = "VLSI 82C592 Host to PCI bridge";
+ break;
+
+ /* XXX Here is MVP3, I got the datasheet but NO M/B to test it */
+ /* totally. Please let me know if anything wrong. -F */
+ /* XXX need info on the MVP3 -- any takers? */
+ case 0x05981106:
+ s = "VIA 82C598MVP (Apollo MVP3) host bridge";
+ break;
+
+ /* AcerLabs -- vendor 0x10b9 */
+ /* Funny : The datasheet told me vendor id is "10b8",sub-vendor */
+ /* id is '10b9" but the register always shows "10b9". -Foxfair */
+ case 0x154110b9:
+ s = "AcerLabs M1541 (Aladdin-V) PCI host bridge";
+ break;
+
+ /* OPTi -- vendor 0x1045 */
+ case 0xc7011045:
+ s = "OPTi 82C700 host to PCI bridge";
+ break;
+ case 0xc8221045:
+ s = "OPTi 82C822 host to PCI Bridge";
+ break;
+
+ /* ServerWorks -- vendor 0x1166 */
+ case 0x00051166:
+ s = "ServerWorks NB6536 2.0HE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00061166:
+ /* FALLTHROUGH */
+ case 0x00081166:
+ /* FALLTHROUGH */
+ case 0x02011166:
+ /* FALLTHROUGH */
+ case 0x010f1014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00091166:
+ s = "ServerWorks NB6635 3.0LE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00101166:
+ s = "ServerWorks CIOB30 host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00111166:
+ /* FALLTHROUGH */
+ case 0x03021014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks CMIC-HE host to PCI-X bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* XXX unknown chipset, but working */
+ case 0x00171166:
+ /* FALLTHROUGH */
+ case 0x01011166:
+ case 0x01101166:
+ case 0x02251166:
+ s = "ServerWorks host to PCI bridge(unknown chipset)";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* Compaq/HP -- vendor 0x0e11 */
+ case 0x60100e11:
+ s = "Compaq/HP Model 6010 HotPlug PCI Bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0xc8, 1);
+ break;
+
+ /* Integrated Micro Solutions -- vendor 0x10e0 */
+ case 0x884910e0:
+ s = "Integrated Micro Solutions VL Bridge";
+ break;
+
+ default:
+ if (class == PCIC_BRIDGE && subclass == PCIS_BRIDGE_HOST)
+ s = "Host to PCI bridge";
+ break;
+ }
+
+ return s;
+}
+
+/*
+ * Scan the first pci bus for host-pci bridges and add pcib instances
+ * to the nexus for each bridge.
+ */
+static void
+legacy_pcib_identify(driver_t *driver, device_t parent)
+{
+ int bus, slot, func;
+ u_int8_t hdrtype;
+ int found = 0;
+ int pcifunchigh;
+ int found824xx = 0;
+ int found_orion = 0;
+ device_t child;
+ devclass_t pci_devclass;
+
+ if (pci_cfgregopen() == 0)
+ return;
+ /*
+ * Check to see if we haven't already had a PCI bus added
+ * via some other means. If we have, bail since otherwise
+ * we're going to end up duplicating it.
+ */
+ if ((pci_devclass = devclass_find("pci")) &&
+ devclass_get_device(pci_devclass, 0))
+ return;
+
+
+ bus = 0;
+ retry:
+ for (slot = 0; slot <= PCI_SLOTMAX; slot++) {
+ func = 0;
+ hdrtype = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_HDRTYPE, 1);
+ /*
+ * When enumerating bus devices, the standard says that
+ * one should check the header type and ignore the slots whose
+ * header types that the software doesn't know about. We use
+ * this to filter out devices.
+ */
+ if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE)
+ continue;
+ if ((hdrtype & PCIM_MFDEV) &&
+ (!found_orion || hdrtype != 0xff))
+ pcifunchigh = PCI_FUNCMAX;
+ else
+ pcifunchigh = 0;
+ for (func = 0; func <= pcifunchigh; func++) {
+ /*
+ * Read the IDs and class from the device.
+ */
+ u_int32_t id;
+ u_int8_t class, subclass, busnum;
+ const char *s;
+ device_t *devs;
+ int ndevs, i;
+
+ id = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_DEVVENDOR, 4);
+ if (id == -1)
+ continue;
+ class = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_CLASS, 1);
+ subclass = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_SUBCLASS, 1);
+
+ s = legacy_pcib_is_host_bridge(bus, slot, func,
+ id, class, subclass,
+ &busnum);
+ if (s == NULL)
+ continue;
+
+ /*
+ * Check to see if the physical bus has already
+ * been seen. Eg: hybrid 32 and 64 bit host
+ * bridges to the same logical bus.
+ */
+ if (device_get_children(parent, &devs, &ndevs) == 0) {
+ for (i = 0; s != NULL && i < ndevs; i++) {
+ if (strcmp(device_get_name(devs[i]),
+ "pcib") != 0)
+ continue;
+ if (legacy_get_pcibus(devs[i]) == busnum)
+ s = NULL;
+ }
+ free(devs, M_TEMP);
+ }
+
+ if (s == NULL)
+ continue;
+ /*
+ * Add at priority 100 to make sure we
+ * go after any motherboard resources
+ */
+ child = BUS_ADD_CHILD(parent, 100,
+ "pcib", busnum);
+ device_set_desc(child, s);
+ legacy_set_pcibus(child, busnum);
+
+ found = 1;
+ if (id == 0x12258086)
+ found824xx = 1;
+ if (id == 0x84c48086)
+ found_orion = 1;
+ }
+ }
+ if (found824xx && bus == 0) {
+ bus++;
+ goto retry;
+ }
+
+ /*
+ * Make sure we add at least one bridge since some old
+ * hardware doesn't actually have a host-pci bridge device.
+ * Note that pci_cfgregopen() thinks we have PCI devices..
+ */
+ if (!found) {
+ if (bootverbose)
+ printf(
+ "legacy_pcib_identify: no bridge found, adding pcib0 anyway\n");
+ child = BUS_ADD_CHILD(parent, 100, "pcib", 0);
+ legacy_set_pcibus(child, 0);
+ }
+}
+
+static int
+legacy_pcib_probe(device_t dev)
+{
+
+ if (pci_cfgregopen() == 0)
+ return ENXIO;
+ return -100;
+}
+
+static int
+legacy_pcib_attach(device_t dev)
+{
+ device_t pir;
+ int bus;
+
+ /*
+ * Look for a PCI BIOS interrupt routing table as that will be
+ * our method of routing interrupts if we have one.
+ */
+ bus = pcib_get_bus(dev);
+#ifndef __rtems__
+ if (pci_pir_probe(bus, 0)) {
+ pir = BUS_ADD_CHILD(device_get_parent(dev), 0, "pir", 0);
+ if (pir != NULL)
+ device_probe_and_attach(pir);
+ }
+#else /* __rtems__ */
+#endif /* __rtems__ */
+ device_add_child(dev, "pci", bus);
+ return bus_generic_attach(dev);
+}
+
+int
+legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ *result = 0;
+ return 0;
+ case PCIB_IVAR_BUS:
+ *result = legacy_get_pcibus(dev);
+ return 0;
+ }
+ return ENOENT;
+}
+
+int
+legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ return EINVAL;
+ case PCIB_IVAR_BUS:
+ legacy_set_pcibus(dev, value);
+ return 0;
+ }
+ return ENOENT;
+}
+
+SYSCTL_DECL(_hw_pci);
+
+static unsigned long legacy_host_mem_start = 0x80000000;
+TUNABLE_ULONG("hw.pci.host_mem_start", &legacy_host_mem_start);
+SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN,
+ &legacy_host_mem_start, 0x80000000,
+ "Limit the host bridge memory to being above this address. Must be\n\
+set at boot via a tunable.");
+
+struct resource *
+legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
+ u_long start, u_long end, u_long count, u_int flags)
+{
+ /*
+ * If no memory preference is given, use upper 32MB slot most
+ * bioses use for their memory window. Typically other bridges
+ * before us get in the way to assert their preferences on memory.
+ * Hardcoding like this sucks, so a more MD/MI way needs to be
+ * found to do it. This is typically only used on older laptops
+ * that don't have pci busses behind pci bridge, so assuming > 32MB
+ * is liekly OK.
+ *
+ * However, this can cause problems for other chipsets, so we make
+ * this tunable by hw.pci.host_mem_start.
+ */
+ if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL)
+ start = legacy_host_mem_start;
+ if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL)
+ start = 0x1000;
+ return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
+ count, flags));
+}
+
+static device_method_t legacy_pcib_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, legacy_pcib_identify),
+ DEVMETHOD(device_probe, legacy_pcib_probe),
+ DEVMETHOD(device_attach, legacy_pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, legacy_pcib_maxslots),
+ DEVMETHOD(pcib_read_config, legacy_pcib_read_config),
+ DEVMETHOD(pcib_write_config, legacy_pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, legacy_pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, legacy_pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, legacy_pcib_map_msi),
+
+ { 0, 0 }
+};
+
+static devclass_t hostb_devclass;
+
+DEFINE_CLASS_0(pcib, legacy_pcib_driver, legacy_pcib_methods, 1);
+DRIVER_MODULE(pcib, legacy, legacy_pcib_driver, hostb_devclass, 0, 0);
+
+
+#ifndef __rtems__
+/*
+ * Install placeholder to claim the resources owned by the
+ * PCI bus interface. This could be used to extract the
+ * config space registers in the extreme case where the PnP
+ * ID is available and the PCI BIOS isn't, but for now we just
+ * eat the PnP ID and do nothing else.
+ *
+ * XXX we should silence this probe, as it will generally confuse
+ * people.
+ */
+static struct isa_pnp_id pcibus_pnp_ids[] = {
+ { 0x030ad041 /* PNP0A03 */, "PCI Bus" },
+ { 0x080ad041 /* PNP0A08 */, "PCIe Bus" },
+ { 0 }
+};
+
+static int
+pcibus_pnp_probe(device_t dev)
+{
+ int result;
+
+ if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, pcibus_pnp_ids)) <= 0)
+ device_quiet(dev);
+ return(result);
+}
+
+static int
+pcibus_pnp_attach(device_t dev)
+{
+ return(0);
+}
+
+static device_method_t pcibus_pnp_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibus_pnp_probe),
+ DEVMETHOD(device_attach, pcibus_pnp_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+ { 0, 0 }
+};
+
+static devclass_t pcibus_pnp_devclass;
+
+DEFINE_CLASS_0(pcibus_pnp, pcibus_pnp_driver, pcibus_pnp_methods, 1);
+DRIVER_MODULE(pcibus_pnp, isa, pcibus_pnp_driver, pcibus_pnp_devclass, 0, 0);
+
+
+/*
+ * Provide a PCI-PCI bridge driver for PCI busses behind PCI-PCI bridges
+ * that appear in the PCIBIOS Interrupt Routing Table to use the routing
+ * table for interrupt routing when possible.
+ */
+static int pcibios_pcib_probe(device_t bus);
+
+static device_method_t pcibios_pcib_pci_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibios_pcib_probe),
+ DEVMETHOD(device_attach, pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, pcib_maxslots),
+ DEVMETHOD(pcib_read_config, pcib_read_config),
+ DEVMETHOD(pcib_write_config, pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, pcib_map_msi),
+
+ {0, 0}
+};
+
+static devclass_t pcib_devclass;
+
+DEFINE_CLASS_0(pcib, pcibios_pcib_driver, pcibios_pcib_pci_methods,
+ sizeof(struct pcib_softc));
+DRIVER_MODULE(pcibios_pcib, pci, pcibios_pcib_driver, pcib_devclass, 0, 0);
+
+static int
+pcibios_pcib_probe(device_t dev)
+{
+ int bus;
+
+ if ((pci_get_class(dev) != PCIC_BRIDGE) ||
+ (pci_get_subclass(dev) != PCIS_BRIDGE_PCI))
+ return (ENXIO);
+ bus = pci_read_config(dev, PCIR_SECBUS_1, 1);
+ if (bus == 0)
+ return (ENXIO);
+ if (!pci_pir_probe(bus, 1))
+ return (ENXIO);
+ device_set_desc(dev, "PCIBIOS PCI-PCI bridge");
+ return (-2000);
+}
+
+static int
+pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
+{
+ return (pci_pir_route_interrupt(pci_get_bus(dev), pci_get_slot(dev),
+ pci_get_function(dev), pin));
+}
+#endif /* __rtems__ */
diff --git a/freebsd/sys/mips/include/machine/cpufunc.h b/freebsd/sys/mips/include/machine/cpufunc.h
index f693dcba..d32e4920 100644
--- a/freebsd/sys/mips/include/machine/cpufunc.h
+++ b/freebsd/sys/mips/include/machine/cpufunc.h
@@ -56,11 +56,11 @@
* $FreeBSD$
*/
-#ifndef _MACHINE_CPUFUNC_HH_
-#define _MACHINE_CPUFUNC_HH_
+#ifndef _MACHINE_CPUFUNC_H_
+#define _MACHINE_CPUFUNC_H_
-#include <freebsd/sys/types.h>
-#include <freebsd/machine/cpuregs.h>
+#include <rtems/bsd/sys/types.h>
+#include <machine/cpuregs.h>
/*
* These functions are required by user-land atomi ops
@@ -407,4 +407,4 @@ void outsw(uint16_t *, const uint16_t *,int);
void outsl(uint32_t *, const uint32_t *,int);
u_int loadandclear(volatile u_int *addr);
-#endif /* !_MACHINE_CPUFUNC_HH_ */
+#endif /* !_MACHINE_CPUFUNC_H_ */
diff --git a/freebsd/sys/mips/include/machine/cpuregs.h b/freebsd/sys/mips/include/machine/cpuregs.h
index db6450ff..456c545c 100644
--- a/freebsd/sys/mips/include/machine/cpuregs.h
+++ b/freebsd/sys/mips/include/machine/cpuregs.h
@@ -55,8 +55,8 @@
* $FreeBSD$
*/
-#ifndef _MIPS_CPUREGS_HH_
-#define _MIPS_CPUREGS_HH_
+#ifndef _MIPS_CPUREGS_H_
+#define _MIPS_CPUREGS_H_
/*
* Address space.
@@ -975,13 +975,13 @@
#define MIPS_R3TOSH 0x22 /* Toshiba R3000 based FPU ISA I */
#ifdef ENABLE_MIPS_TX3900
-#include <freebsd/mips/r3900regs.h>
+#include <mips/r3900regs.h>
#endif
#ifdef MIPS3_5900
-#include <freebsd/mips/r5900regs.h>
+#include <mips/r5900regs.h>
#endif
#ifdef MIPS64_SB1
-#include <freebsd/mips/sb1regs.h>
+#include <mips/sb1regs.h>
#endif
-#endif /* _MIPS_CPUREGS_HH_ */
+#endif /* _MIPS_CPUREGS_H_ */
diff --git a/freebsd/sys/mips/include/machine/in_cksum.h b/freebsd/sys/mips/include/machine/in_cksum.h
new file mode 100644
index 00000000..37d88e2e
--- /dev/null
+++ b/freebsd/sys/mips/include/machine/in_cksum.h
@@ -0,0 +1,77 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from tahoe: in_cksum.c 1.2 86/01/05
+ * from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91
+ * from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp
+ * from: src/sys/alpha/include/in_cksum.h,v 1.7 2005/03/02 21:33:20 joerg
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_IN_CKSUM_H_
+#define _MACHINE_IN_CKSUM_H_ 1
+
+#include <sys/cdefs.h>
+
+#define in_cksum(m, len) in_cksum_skip(m, len, 0)
+
+/*
+ * It it useful to have an Internet checksum routine which is inlineable
+ * and optimized specifically for the task of computing IP header checksums
+ * in the normal case (where there are no options and the header length is
+ * therefore always exactly five 32-bit words.
+ */
+#ifdef __CC_SUPPORTS___INLINE
+
+static __inline void
+in_cksum_update(struct ip *ip)
+{
+ int __tmpsum;
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256;
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16));
+}
+
+#else
+
+#define in_cksum_update(ip) \
+ do { \
+ int __tmpsum; \
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256; \
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \
+ } while(0)
+
+#endif
+
+#ifdef _KERNEL
+u_int in_cksum_hdr(const struct ip *ip);
+u_short in_addword(u_short sum, u_short b);
+u_short in_pseudo(u_int sum, u_int b, u_int c);
+u_short in_cksum_skip(struct mbuf *m, int len, int skip);
+#endif
+
+#endif /* _MACHINE_IN_CKSUM_H_ */
diff --git a/freebsd/sys/mips/include/machine/legacyvar.h b/freebsd/sys/mips/include/machine/legacyvar.h
new file mode 100644
index 00000000..0b0fa433
--- /dev/null
+++ b/freebsd/sys/mips/include/machine/legacyvar.h
@@ -0,0 +1,57 @@
+/*-
+ * Copyright (c) 2000 Peter Wemm <peter@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_LEGACYVAR_H_
+#define _MACHINE_LEGACYVAR_H_
+
+enum legacy_device_ivars {
+ LEGACY_IVAR_PCIDOMAIN,
+ LEGACY_IVAR_PCIBUS
+};
+
+#define LEGACY_ACCESSOR(var, ivar, type) \
+ __BUS_ACCESSOR(legacy, var, LEGACY, ivar, type)
+
+LEGACY_ACCESSOR(pcidomain, PCIDOMAIN, uint32_t)
+LEGACY_ACCESSOR(pcibus, PCIBUS, uint32_t)
+
+#undef LEGACY_ACCESSOR
+
+int legacy_pcib_maxslots(device_t dev);
+uint32_t legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes);
+int legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result);
+void legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes);
+int legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value);
+struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child,
+ int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
+
+#endif /* !_MACHINE_LEGACYVAR_H_ */
diff --git a/freebsd/sys/mips/include/machine/pci_cfgreg.h b/freebsd/sys/mips/include/machine/pci_cfgreg.h
new file mode 100644
index 00000000..bc72418d
--- /dev/null
+++ b/freebsd/sys/mips/include/machine/pci_cfgreg.h
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
+ */
+
+#define CONF1_ADDR_PORT 0x0cf8
+#define CONF1_DATA_PORT 0x0cfc
+
+#define CONF1_ENABLE 0x80000000ul
+#define CONF1_ENABLE_CHK 0x80000000ul
+#define CONF1_ENABLE_MSK 0x7f000000ul
+#define CONF1_ENABLE_CHK1 0xff000001ul
+#define CONF1_ENABLE_MSK1 0x80000001ul
+#define CONF1_ENABLE_RES1 0x80000000ul
+
+#define CONF2_ENABLE_PORT 0x0cf8
+#define CONF2_FORWARD_PORT 0x0cfa
+
+#define CONF2_ENABLE_CHK 0x0e
+#define CONF2_ENABLE_RES 0x0e
+
+int pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus);
+int pci_cfgregopen(void);
+u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes);
+void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes);
+void pci_pir_open(void);
+int pci_pir_probe(int bus, int require_parse);
+int pci_pir_route_interrupt(int bus, int device, int func, int pin);
diff --git a/freebsd/sys/mips/mips/in_cksum.c b/freebsd/sys/mips/mips/in_cksum.c
index a519c729..c6f7b568 100644
--- a/freebsd/sys/mips/mips/in_cksum.c
+++ b/freebsd/sys/mips/mips/in_cksum.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1988, 1992, 1993
@@ -37,16 +37,16 @@
* @(#)in_cksum.c 8.1 (Berkeley) 6/10/93
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/machine/in_cksum.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/mbuf.h>
+#include <sys/systm.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <machine/in_cksum.h>
/*
* Checksum routine for Internet Protocol family headers
diff --git a/freebsd/sys/mips/mips/legacy.c b/freebsd/sys/mips/mips/legacy.c
new file mode 100644
index 00000000..2547990c
--- /dev/null
+++ b/freebsd/sys/mips/mips/legacy.c
@@ -0,0 +1,347 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright 1998 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby
+ * granted, provided that both the above copyright notice and this
+ * permission notice appear in all copies, that both the above
+ * copyright notice and this permission notice appear in all
+ * supporting documentation, and that the name of M.I.T. not be used
+ * in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission. M.I.T. makes
+ * no representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
+ * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
+ * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * This code implements a system driver for legacy systems that do not
+ * support ACPI or when ACPI support is not present in the kernel.
+ */
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <machine/bus.h>
+#include <sys/pcpu.h>
+#include <sys/rman.h>
+#include <sys/smp.h>
+
+#ifndef __rtems__
+#include <rtems/bsd/local/opt_mca.h>
+#endif /* __rtems__ */
+#ifdef DEV_MCA
+#include <i386/bios/mca_machdep.h>
+#endif
+
+#include <machine/legacyvar.h>
+#include <machine/resource.h>
+
+static MALLOC_DEFINE(M_LEGACYDEV, "legacydrv", "legacy system device");
+struct legacy_device {
+ int lg_pcibus;
+};
+
+#define DEVTOAT(dev) ((struct legacy_device *)device_get_ivars(dev))
+
+static int legacy_probe(device_t);
+static int legacy_attach(device_t);
+static int legacy_print_child(device_t, device_t);
+static device_t legacy_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static int legacy_read_ivar(device_t, device_t, int, uintptr_t *);
+static int legacy_write_ivar(device_t, device_t, int, uintptr_t);
+
+static device_method_t legacy_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, legacy_probe),
+ DEVMETHOD(device_attach, legacy_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, legacy_print_child),
+ DEVMETHOD(bus_add_child, legacy_add_child),
+ DEVMETHOD(bus_read_ivar, legacy_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_write_ivar),
+ DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t legacy_driver = {
+ "legacy",
+ legacy_methods,
+ 1, /* no softc */
+};
+static devclass_t legacy_devclass;
+
+DRIVER_MODULE(legacy, nexus, legacy_driver, legacy_devclass, 0, 0);
+
+static int
+legacy_probe(device_t dev)
+{
+
+ device_set_desc(dev, "legacy system");
+ device_quiet(dev);
+ return (0);
+}
+
+static int
+legacy_attach(device_t dev)
+{
+ device_t child;
+
+ /*
+ * Let our child drivers identify any child devices that they
+ * can find. Once that is done attach any devices that we
+ * found.
+ */
+ bus_generic_probe(dev);
+ bus_generic_attach(dev);
+
+#ifndef PC98
+ /*
+ * If we didn't see EISA or ISA on a pci bridge, create some
+ * connection points now so they show up "on motherboard".
+ */
+ if (!devclass_get_device(devclass_find("eisa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "eisa", 0);
+ if (child == NULL)
+ panic("legacy_attach eisa");
+ device_probe_and_attach(child);
+ }
+#endif
+#ifdef DEV_MCA
+ if (MCA_system && !devclass_get_device(devclass_find("mca"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "mca", 0);
+ if (child == 0)
+ panic("legacy_probe mca");
+ device_probe_and_attach(child);
+ }
+#endif
+ if (!devclass_get_device(devclass_find("isa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "isa", 0);
+ if (child == NULL)
+ panic("legacy_attach isa");
+ device_probe_and_attach(child);
+ }
+
+ return 0;
+}
+
+static int
+legacy_print_child(device_t bus, device_t child)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+ int retval = 0;
+
+ retval += bus_print_child_header(bus, child);
+ if (atdev->lg_pcibus != -1)
+ retval += printf(" pcibus %d", atdev->lg_pcibus);
+ retval += printf(" on motherboard\n"); /* XXX "motherboard", ick */
+
+ return (retval);
+}
+
+static device_t
+legacy_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ device_t child;
+ struct legacy_device *atdev;
+
+ atdev = malloc(sizeof(struct legacy_device), M_LEGACYDEV,
+ M_NOWAIT | M_ZERO);
+ if (atdev == NULL)
+ return(NULL);
+ atdev->lg_pcibus = -1;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child == NULL)
+ free(atdev, M_LEGACYDEV);
+ else
+ /* should we free this in legacy_child_detached? */
+ device_set_ivars(child, atdev);
+
+ return (child);
+}
+
+static int
+legacy_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ *result = 0;
+ break;
+ case LEGACY_IVAR_PCIBUS:
+ *result = atdev->lg_pcibus;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+
+static int
+legacy_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ return EINVAL;
+ case LEGACY_IVAR_PCIBUS:
+ atdev->lg_pcibus = value;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+/*
+ * Legacy CPU attachment when ACPI is not available. Drivers like
+ * cpufreq(4) hang off this.
+ */
+static void cpu_identify(driver_t *driver, device_t parent);
+static int cpu_read_ivar(device_t dev, device_t child, int index,
+ uintptr_t *result);
+static device_t cpu_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static struct resource_list *cpu_get_rlist(device_t dev, device_t child);
+
+struct cpu_device {
+ struct resource_list cd_rl;
+ struct pcpu *cd_pcpu;
+};
+
+static device_method_t cpu_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, cpu_identify),
+ DEVMETHOD(device_probe, bus_generic_probe),
+ DEVMETHOD(device_attach, bus_generic_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_add_child, cpu_add_child),
+ DEVMETHOD(bus_read_ivar, cpu_read_ivar),
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_get_resource_list, cpu_get_rlist),
+ DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
+ DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource),
+ DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource),
+ DEVMETHOD(bus_driver_added, bus_generic_driver_added),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t cpu_driver = {
+ "cpu",
+ cpu_methods,
+ 1, /* no softc */
+};
+static devclass_t cpu_devclass;
+DRIVER_MODULE(cpu, legacy, cpu_driver, cpu_devclass, 0, 0);
+
+static void
+cpu_identify(driver_t *driver, device_t parent)
+{
+ device_t child;
+ int i;
+
+ /*
+ * Attach a cpuX device for each CPU. We use an order of 150
+ * so that these devices are attached after the Host-PCI
+ * bridges (which are added at order 100).
+ */
+ for (i = 0; i <= mp_maxid; i++)
+ if (!CPU_ABSENT(i)) {
+ child = BUS_ADD_CHILD(parent, 150, "cpu", i);
+ if (child == NULL)
+ panic("legacy_attach cpu");
+ }
+}
+
+static device_t
+cpu_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ struct cpu_device *cd;
+ device_t child;
+ struct pcpu *pc;
+
+ if ((cd = malloc(sizeof(*cd), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL)
+ return (NULL);
+
+ resource_list_init(&cd->cd_rl);
+ pc = pcpu_find(device_get_unit(bus));
+ cd->cd_pcpu = pc;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child != NULL) {
+ pc->pc_device = child;
+ device_set_ivars(child, cd);
+ } else
+ free(cd, M_DEVBUF);
+ return (child);
+}
+
+static struct resource_list *
+cpu_get_rlist(device_t dev, device_t child)
+{
+ struct cpu_device *cpdev;
+
+ cpdev = device_get_ivars(child);
+ return (&cpdev->cd_rl);
+}
+
+static int
+cpu_read_ivar(device_t dev, device_t child, int index, uintptr_t *result)
+{
+ struct cpu_device *cpdev;
+
+ if (index != CPU_IVAR_PCPU)
+ return (ENOENT);
+ cpdev = device_get_ivars(child);
+ *result = (uintptr_t)cpdev->cd_pcpu;
+ return (0);
+}
diff --git a/freebsd/sys/mips/pci/pci_bus.c b/freebsd/sys/mips/pci/pci_bus.c
new file mode 100644
index 00000000..6627db98
--- /dev/null
+++ b/freebsd/sys/mips/pci/pci_bus.c
@@ -0,0 +1,729 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/local/opt_cpu.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
+
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcib_private.h>
+#include <isa/isavar.h>
+#ifdef CPU_ELAN
+#include <machine/md_var.h>
+#endif
+#include <machine/legacyvar.h>
+#include <machine/pci_cfgreg.h>
+#include <machine/resource.h>
+
+#include <rtems/bsd/local/pcib_if.h>
+
+#ifndef __rtems__
+static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev,
+ int pin);
+#else /* __rtems__ */
+int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin);
+#endif /* __rtems__ */
+
+
+int
+legacy_pcib_maxslots(device_t dev)
+{
+ return 31;
+}
+
+/* read configuration space register */
+
+#ifdef __rtems__
+uint32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#else
+u_int32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#endif
+{
+ return(pci_cfgregread(bus, slot, func, reg, bytes));
+}
+
+/* write configuration space register */
+
+void
+legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes)
+{
+ pci_cfgregwrite(bus, slot, func, reg, data, bytes);
+}
+
+/* Pass MSI requests up to the nexus. */
+
+static int
+legacy_pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount,
+ int *irqs)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSI(device_get_parent(bus), dev, count, maxcount,
+ irqs));
+}
+
+static int
+legacy_pcib_alloc_msix(device_t pcib, device_t dev, int *irq)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq));
+}
+
+static int
+legacy_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr,
+ uint32_t *data)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data));
+}
+
+static const char *
+legacy_pcib_is_host_bridge(int bus, int slot, int func,
+ uint32_t id, uint8_t class, uint8_t subclass,
+ uint8_t *busnum)
+{
+ const char *s = NULL;
+ static uint8_t pxb[4]; /* hack for 450nx */
+
+ *busnum = 0;
+
+ switch (id) {
+ case 0x12258086:
+ s = "Intel 824?? host to PCI bridge";
+ /* XXX This is a guess */
+ /* *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x41, 1); */
+ *busnum = bus;
+ break;
+ case 0x71208086:
+ s = "Intel 82810 (i810 GMCH) Host To Hub bridge";
+ break;
+ case 0x71228086:
+ s = "Intel 82810-DC100 (i810-DC100 GMCH) Host To Hub bridge";
+ break;
+ case 0x71248086:
+ s = "Intel 82810E (i810E GMCH) Host To Hub bridge";
+ break;
+ case 0x11308086:
+ s = "Intel 82815 (i815 GMCH) Host To Hub bridge";
+ break;
+ case 0x71808086:
+ s = "Intel 82443LX (440 LX) host to PCI bridge";
+ break;
+ case 0x71908086:
+ s = "Intel 82443BX (440 BX) host to PCI bridge";
+ break;
+ case 0x71928086:
+ s = "Intel 82443BX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x71948086:
+ s = "Intel 82443MX host to PCI bridge";
+ break;
+ case 0x71a08086:
+ s = "Intel 82443GX host to PCI bridge";
+ break;
+ case 0x71a18086:
+ s = "Intel 82443GX host to AGP bridge";
+ break;
+ case 0x71a28086:
+ s = "Intel 82443GX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x84c48086:
+ s = "Intel 82454KX/GX (Orion) host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x4a, 1);
+ break;
+ case 0x84ca8086:
+ /*
+ * For the 450nx chipset, there is a whole bundle of
+ * things pretending to be host bridges. The MIOC will
+ * be seen first and isn't really a pci bridge (the
+ * actual busses are attached to the PXB's). We need to
+ * read the registers of the MIOC to figure out the
+ * bus numbers for the PXB channels.
+ *
+ * Since the MIOC doesn't have a pci bus attached, we
+ * pretend it wasn't there.
+ */
+ pxb[0] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd0, 1); /* BUSNO[0] */
+ pxb[1] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd1, 1) + 1; /* SUBA[0]+1 */
+ pxb[2] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd3, 1); /* BUSNO[1] */
+ pxb[3] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd4, 1) + 1; /* SUBA[1]+1 */
+ return NULL;
+ case 0x84cb8086:
+ switch (slot) {
+ case 0x12:
+ s = "Intel 82454NX PXB#0, Bus#A";
+ *busnum = pxb[0];
+ break;
+ case 0x13:
+ s = "Intel 82454NX PXB#0, Bus#B";
+ *busnum = pxb[1];
+ break;
+ case 0x14:
+ s = "Intel 82454NX PXB#1, Bus#A";
+ *busnum = pxb[2];
+ break;
+ case 0x15:
+ s = "Intel 82454NX PXB#1, Bus#B";
+ *busnum = pxb[3];
+ break;
+ }
+ break;
+ case 0x1A308086:
+ s = "Intel 82845 Host to PCI bridge";
+ break;
+
+ /* AMD -- vendor 0x1022 */
+ case 0x30001022:
+ s = "AMD Elan SC520 host to PCI bridge";
+#ifdef CPU_ELAN
+ init_AMD_Elan_sc520();
+#else
+ printf(
+"*** WARNING: missing CPU_ELAN -- timekeeping may be wrong\n");
+#endif
+ break;
+ case 0x70061022:
+ s = "AMD-751 host to PCI bridge";
+ break;
+ case 0x700e1022:
+ s = "AMD-761 host to PCI bridge";
+ break;
+
+ /* SiS -- vendor 0x1039 */
+ case 0x04961039:
+ s = "SiS 85c496";
+ break;
+ case 0x04061039:
+ s = "SiS 85c501";
+ break;
+ case 0x06011039:
+ s = "SiS 85c601";
+ break;
+ case 0x55911039:
+ s = "SiS 5591 host to PCI bridge";
+ break;
+ case 0x00011039:
+ s = "SiS 5591 host to AGP bridge";
+ break;
+
+ /* VLSI -- vendor 0x1004 */
+ case 0x00051004:
+ s = "VLSI 82C592 Host to PCI bridge";
+ break;
+
+ /* XXX Here is MVP3, I got the datasheet but NO M/B to test it */
+ /* totally. Please let me know if anything wrong. -F */
+ /* XXX need info on the MVP3 -- any takers? */
+ case 0x05981106:
+ s = "VIA 82C598MVP (Apollo MVP3) host bridge";
+ break;
+
+ /* AcerLabs -- vendor 0x10b9 */
+ /* Funny : The datasheet told me vendor id is "10b8",sub-vendor */
+ /* id is '10b9" but the register always shows "10b9". -Foxfair */
+ case 0x154110b9:
+ s = "AcerLabs M1541 (Aladdin-V) PCI host bridge";
+ break;
+
+ /* OPTi -- vendor 0x1045 */
+ case 0xc7011045:
+ s = "OPTi 82C700 host to PCI bridge";
+ break;
+ case 0xc8221045:
+ s = "OPTi 82C822 host to PCI Bridge";
+ break;
+
+ /* ServerWorks -- vendor 0x1166 */
+ case 0x00051166:
+ s = "ServerWorks NB6536 2.0HE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00061166:
+ /* FALLTHROUGH */
+ case 0x00081166:
+ /* FALLTHROUGH */
+ case 0x02011166:
+ /* FALLTHROUGH */
+ case 0x010f1014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00091166:
+ s = "ServerWorks NB6635 3.0LE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00101166:
+ s = "ServerWorks CIOB30 host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00111166:
+ /* FALLTHROUGH */
+ case 0x03021014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks CMIC-HE host to PCI-X bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* XXX unknown chipset, but working */
+ case 0x00171166:
+ /* FALLTHROUGH */
+ case 0x01011166:
+ case 0x01101166:
+ case 0x02251166:
+ s = "ServerWorks host to PCI bridge(unknown chipset)";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* Compaq/HP -- vendor 0x0e11 */
+ case 0x60100e11:
+ s = "Compaq/HP Model 6010 HotPlug PCI Bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0xc8, 1);
+ break;
+
+ /* Integrated Micro Solutions -- vendor 0x10e0 */
+ case 0x884910e0:
+ s = "Integrated Micro Solutions VL Bridge";
+ break;
+
+ default:
+ if (class == PCIC_BRIDGE && subclass == PCIS_BRIDGE_HOST)
+ s = "Host to PCI bridge";
+ break;
+ }
+
+ return s;
+}
+
+/*
+ * Scan the first pci bus for host-pci bridges and add pcib instances
+ * to the nexus for each bridge.
+ */
+static void
+legacy_pcib_identify(driver_t *driver, device_t parent)
+{
+ int bus, slot, func;
+ u_int8_t hdrtype;
+ int found = 0;
+ int pcifunchigh;
+ int found824xx = 0;
+ int found_orion = 0;
+ device_t child;
+ devclass_t pci_devclass;
+
+ if (pci_cfgregopen() == 0)
+ return;
+ /*
+ * Check to see if we haven't already had a PCI bus added
+ * via some other means. If we have, bail since otherwise
+ * we're going to end up duplicating it.
+ */
+ if ((pci_devclass = devclass_find("pci")) &&
+ devclass_get_device(pci_devclass, 0))
+ return;
+
+
+ bus = 0;
+ retry:
+ for (slot = 0; slot <= PCI_SLOTMAX; slot++) {
+ func = 0;
+ hdrtype = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_HDRTYPE, 1);
+ /*
+ * When enumerating bus devices, the standard says that
+ * one should check the header type and ignore the slots whose
+ * header types that the software doesn't know about. We use
+ * this to filter out devices.
+ */
+ if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE)
+ continue;
+ if ((hdrtype & PCIM_MFDEV) &&
+ (!found_orion || hdrtype != 0xff))
+ pcifunchigh = PCI_FUNCMAX;
+ else
+ pcifunchigh = 0;
+ for (func = 0; func <= pcifunchigh; func++) {
+ /*
+ * Read the IDs and class from the device.
+ */
+ u_int32_t id;
+ u_int8_t class, subclass, busnum;
+ const char *s;
+ device_t *devs;
+ int ndevs, i;
+
+ id = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_DEVVENDOR, 4);
+ if (id == -1)
+ continue;
+ class = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_CLASS, 1);
+ subclass = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_SUBCLASS, 1);
+
+ s = legacy_pcib_is_host_bridge(bus, slot, func,
+ id, class, subclass,
+ &busnum);
+ if (s == NULL)
+ continue;
+
+ /*
+ * Check to see if the physical bus has already
+ * been seen. Eg: hybrid 32 and 64 bit host
+ * bridges to the same logical bus.
+ */
+ if (device_get_children(parent, &devs, &ndevs) == 0) {
+ for (i = 0; s != NULL && i < ndevs; i++) {
+ if (strcmp(device_get_name(devs[i]),
+ "pcib") != 0)
+ continue;
+ if (legacy_get_pcibus(devs[i]) == busnum)
+ s = NULL;
+ }
+ free(devs, M_TEMP);
+ }
+
+ if (s == NULL)
+ continue;
+ /*
+ * Add at priority 100 to make sure we
+ * go after any motherboard resources
+ */
+ child = BUS_ADD_CHILD(parent, 100,
+ "pcib", busnum);
+ device_set_desc(child, s);
+ legacy_set_pcibus(child, busnum);
+
+ found = 1;
+ if (id == 0x12258086)
+ found824xx = 1;
+ if (id == 0x84c48086)
+ found_orion = 1;
+ }
+ }
+ if (found824xx && bus == 0) {
+ bus++;
+ goto retry;
+ }
+
+ /*
+ * Make sure we add at least one bridge since some old
+ * hardware doesn't actually have a host-pci bridge device.
+ * Note that pci_cfgregopen() thinks we have PCI devices..
+ */
+ if (!found) {
+ if (bootverbose)
+ printf(
+ "legacy_pcib_identify: no bridge found, adding pcib0 anyway\n");
+ child = BUS_ADD_CHILD(parent, 100, "pcib", 0);
+ legacy_set_pcibus(child, 0);
+ }
+}
+
+static int
+legacy_pcib_probe(device_t dev)
+{
+
+ if (pci_cfgregopen() == 0)
+ return ENXIO;
+ return -100;
+}
+
+static int
+legacy_pcib_attach(device_t dev)
+{
+ device_t pir;
+ int bus;
+
+ /*
+ * Look for a PCI BIOS interrupt routing table as that will be
+ * our method of routing interrupts if we have one.
+ */
+ bus = pcib_get_bus(dev);
+#ifndef __rtems__
+ if (pci_pir_probe(bus, 0)) {
+ pir = BUS_ADD_CHILD(device_get_parent(dev), 0, "pir", 0);
+ if (pir != NULL)
+ device_probe_and_attach(pir);
+ }
+#else /* __rtems__ */
+#endif /* __rtems__ */
+ device_add_child(dev, "pci", bus);
+ return bus_generic_attach(dev);
+}
+
+int
+legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ *result = 0;
+ return 0;
+ case PCIB_IVAR_BUS:
+ *result = legacy_get_pcibus(dev);
+ return 0;
+ }
+ return ENOENT;
+}
+
+int
+legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ return EINVAL;
+ case PCIB_IVAR_BUS:
+ legacy_set_pcibus(dev, value);
+ return 0;
+ }
+ return ENOENT;
+}
+
+SYSCTL_DECL(_hw_pci);
+
+static unsigned long legacy_host_mem_start = 0x80000000;
+TUNABLE_ULONG("hw.pci.host_mem_start", &legacy_host_mem_start);
+SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN,
+ &legacy_host_mem_start, 0x80000000,
+ "Limit the host bridge memory to being above this address. Must be\n\
+set at boot via a tunable.");
+
+struct resource *
+legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
+ u_long start, u_long end, u_long count, u_int flags)
+{
+ /*
+ * If no memory preference is given, use upper 32MB slot most
+ * bioses use for their memory window. Typically other bridges
+ * before us get in the way to assert their preferences on memory.
+ * Hardcoding like this sucks, so a more MD/MI way needs to be
+ * found to do it. This is typically only used on older laptops
+ * that don't have pci busses behind pci bridge, so assuming > 32MB
+ * is liekly OK.
+ *
+ * However, this can cause problems for other chipsets, so we make
+ * this tunable by hw.pci.host_mem_start.
+ */
+ if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL)
+ start = legacy_host_mem_start;
+ if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL)
+ start = 0x1000;
+ return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
+ count, flags));
+}
+
+static device_method_t legacy_pcib_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, legacy_pcib_identify),
+ DEVMETHOD(device_probe, legacy_pcib_probe),
+ DEVMETHOD(device_attach, legacy_pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, legacy_pcib_maxslots),
+ DEVMETHOD(pcib_read_config, legacy_pcib_read_config),
+ DEVMETHOD(pcib_write_config, legacy_pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, legacy_pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, legacy_pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, legacy_pcib_map_msi),
+
+ { 0, 0 }
+};
+
+static devclass_t hostb_devclass;
+
+DEFINE_CLASS_0(pcib, legacy_pcib_driver, legacy_pcib_methods, 1);
+DRIVER_MODULE(pcib, legacy, legacy_pcib_driver, hostb_devclass, 0, 0);
+
+
+#ifndef __rtems__
+/*
+ * Install placeholder to claim the resources owned by the
+ * PCI bus interface. This could be used to extract the
+ * config space registers in the extreme case where the PnP
+ * ID is available and the PCI BIOS isn't, but for now we just
+ * eat the PnP ID and do nothing else.
+ *
+ * XXX we should silence this probe, as it will generally confuse
+ * people.
+ */
+static struct isa_pnp_id pcibus_pnp_ids[] = {
+ { 0x030ad041 /* PNP0A03 */, "PCI Bus" },
+ { 0x080ad041 /* PNP0A08 */, "PCIe Bus" },
+ { 0 }
+};
+
+static int
+pcibus_pnp_probe(device_t dev)
+{
+ int result;
+
+ if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, pcibus_pnp_ids)) <= 0)
+ device_quiet(dev);
+ return(result);
+}
+
+static int
+pcibus_pnp_attach(device_t dev)
+{
+ return(0);
+}
+
+static device_method_t pcibus_pnp_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibus_pnp_probe),
+ DEVMETHOD(device_attach, pcibus_pnp_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+ { 0, 0 }
+};
+
+static devclass_t pcibus_pnp_devclass;
+
+DEFINE_CLASS_0(pcibus_pnp, pcibus_pnp_driver, pcibus_pnp_methods, 1);
+DRIVER_MODULE(pcibus_pnp, isa, pcibus_pnp_driver, pcibus_pnp_devclass, 0, 0);
+
+
+/*
+ * Provide a PCI-PCI bridge driver for PCI busses behind PCI-PCI bridges
+ * that appear in the PCIBIOS Interrupt Routing Table to use the routing
+ * table for interrupt routing when possible.
+ */
+static int pcibios_pcib_probe(device_t bus);
+
+static device_method_t pcibios_pcib_pci_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibios_pcib_probe),
+ DEVMETHOD(device_attach, pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, pcib_maxslots),
+ DEVMETHOD(pcib_read_config, pcib_read_config),
+ DEVMETHOD(pcib_write_config, pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, pcib_map_msi),
+
+ {0, 0}
+};
+
+static devclass_t pcib_devclass;
+
+DEFINE_CLASS_0(pcib, pcibios_pcib_driver, pcibios_pcib_pci_methods,
+ sizeof(struct pcib_softc));
+DRIVER_MODULE(pcibios_pcib, pci, pcibios_pcib_driver, pcib_devclass, 0, 0);
+
+static int
+pcibios_pcib_probe(device_t dev)
+{
+ int bus;
+
+ if ((pci_get_class(dev) != PCIC_BRIDGE) ||
+ (pci_get_subclass(dev) != PCIS_BRIDGE_PCI))
+ return (ENXIO);
+ bus = pci_read_config(dev, PCIR_SECBUS_1, 1);
+ if (bus == 0)
+ return (ENXIO);
+ if (!pci_pir_probe(bus, 1))
+ return (ENXIO);
+ device_set_desc(dev, "PCIBIOS PCI-PCI bridge");
+ return (-2000);
+}
+
+static int
+pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
+{
+ return (pci_pir_route_interrupt(pci_get_bus(dev), pci_get_slot(dev),
+ pci_get_function(dev), pin));
+}
+#endif /* __rtems__ */
diff --git a/freebsd/sys/mman.h b/freebsd/sys/mman.h
deleted file mode 100644
index dc4243f0..00000000
--- a/freebsd/sys/mman.h
+++ /dev/null
@@ -1,238 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)mman.h 8.2 (Berkeley) 1/9/95
- * $FreeBSD$
- */
-
-#ifndef _SYS_MMAN_HH_
-#define _SYS_MMAN_HH_
-
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/_types.h>
-
-#if __BSD_VISIBLE
-/*
- * Inheritance for minherit()
- */
-#define INHERIT_SHARE 0
-#define INHERIT_COPY 1
-#define INHERIT_NONE 2
-#endif
-
-/*
- * Protections are chosen from these bits, or-ed together
- */
-#define PROT_NONE 0x00 /* no permissions */
-#define PROT_READ 0x01 /* pages can be read */
-#define PROT_WRITE 0x02 /* pages can be written */
-#define PROT_EXEC 0x04 /* pages can be executed */
-
-/*
- * Flags contain sharing type and options.
- * Sharing types; choose one.
- */
-#define MAP_SHARED 0x0001 /* share changes */
-#define MAP_PRIVATE 0x0002 /* changes are private */
-#if __BSD_VISIBLE
-#define MAP_COPY MAP_PRIVATE /* Obsolete */
-#endif
-
-/*
- * Other flags
- */
-#define MAP_FIXED 0x0010 /* map addr must be exactly as requested */
-
-#if __BSD_VISIBLE
-#define MAP_RENAME 0x0020 /* Sun: rename private pages to file */
-#define MAP_NORESERVE 0x0040 /* Sun: don't reserve needed swap area */
-#define MAP_RESERVED0080 0x0080 /* previously misimplemented MAP_INHERIT */
-#define MAP_RESERVED0100 0x0100 /* previously unimplemented MAP_NOEXTEND */
-#define MAP_HASSEMAPHORE 0x0200 /* region may contain semaphores */
-#define MAP_STACK 0x0400 /* region grows down, like a stack */
-#define MAP_NOSYNC 0x0800 /* page to but do not sync underlying file */
-
-/*
- * Mapping type
- */
-#define MAP_FILE 0x0000 /* map from file (default) */
-#define MAP_ANON 0x1000 /* allocated from memory, swap space */
-
-/*
- * Extended flags
- */
-#define MAP_NOCORE 0x00020000 /* dont include these pages in a coredump */
-#endif /* __BSD_VISIBLE */
-
-#if __POSIX_VISIBLE >= 199309
-/*
- * Process memory locking
- */
-#define MCL_CURRENT 0x0001 /* Lock only current memory */
-#define MCL_FUTURE 0x0002 /* Lock all future memory as well */
-#endif
-
-/*
- * Error return from mmap()
- */
-#define MAP_FAILED ((void *)-1)
-
-/*
- * msync() flags
- */
-#define MS_SYNC 0x0000 /* msync synchronously */
-#define MS_ASYNC 0x0001 /* return immediately */
-#define MS_INVALIDATE 0x0002 /* invalidate all cached data */
-
-/*
- * Advice to madvise
- */
-#define _MADV_NORMAL 0 /* no further special treatment */
-#define _MADV_RANDOM 1 /* expect random page references */
-#define _MADV_SEQUENTIAL 2 /* expect sequential page references */
-#define _MADV_WILLNEED 3 /* will need these pages */
-#define _MADV_DONTNEED 4 /* dont need these pages */
-
-#if __BSD_VISIBLE
-#define MADV_NORMAL _MADV_NORMAL
-#define MADV_RANDOM _MADV_RANDOM
-#define MADV_SEQUENTIAL _MADV_SEQUENTIAL
-#define MADV_WILLNEED _MADV_WILLNEED
-#define MADV_DONTNEED _MADV_DONTNEED
-#define MADV_FREE 5 /* dont need these pages, and junk contents */
-#define MADV_NOSYNC 6 /* try to avoid flushes to physical media */
-#define MADV_AUTOSYNC 7 /* revert to default flushing strategy */
-#define MADV_NOCORE 8 /* do not include these pages in a core file */
-#define MADV_CORE 9 /* revert to including pages in a core file */
-#define MADV_PROTECT 10 /* protect process from pageout kill */
-
-/*
- * Return bits from mincore
- */
-#define MINCORE_INCORE 0x1 /* Page is incore */
-#define MINCORE_REFERENCED 0x2 /* Page has been referenced by us */
-#define MINCORE_MODIFIED 0x4 /* Page has been modified by us */
-#define MINCORE_REFERENCED_OTHER 0x8 /* Page has been referenced */
-#define MINCORE_MODIFIED_OTHER 0x10 /* Page has been modified */
-#define MINCORE_SUPER 0x20 /* Page is a "super" page */
-
-/*
- * Anonymous object constant for shm_open().
- */
-#define SHM_ANON ((char *)1)
-#endif /* __BSD_VISIBLE */
-
-/*
- * XXX missing POSIX_TYPED_MEM_* macros and
- * posix_typed_mem_info structure.
- */
-#if __POSIX_VISIBLE >= 200112
-#define POSIX_MADV_NORMAL _MADV_NORMAL
-#define POSIX_MADV_RANDOM _MADV_RANDOM
-#define POSIX_MADV_SEQUENTIAL _MADV_SEQUENTIAL
-#define POSIX_MADV_WILLNEED _MADV_WILLNEED
-#define POSIX_MADV_DONTNEED _MADV_DONTNEED
-#endif
-
-#ifndef _MODE_T_DECLARED
-typedef __mode_t mode_t;
-#define _MODE_T_DECLARED
-#endif
-
-#ifndef _OFF_T_DECLARED
-typedef __off_t off_t;
-#define _OFF_T_DECLARED
-#endif
-
-#ifndef _SIZE_T_DECLARED
-typedef __size_t size_t;
-#define _SIZE_T_DECLARED
-#endif
-
-#ifdef _KERNEL
-#include <freebsd/vm/vm.h>
-
-struct shmfd {
- size_t shm_size;
- vm_object_t shm_object;
- int shm_refs;
- uid_t shm_uid;
- gid_t shm_gid;
- mode_t shm_mode;
-
- /*
- * Values maintained solely to make this a better-behaved file
- * descriptor for fstat() to run on.
- */
- struct timespec shm_atime;
- struct timespec shm_mtime;
- struct timespec shm_ctime;
- struct timespec shm_birthtime;
-
- struct label *shm_label; /* MAC label */
-};
-
-int shm_mmap(struct shmfd *shmfd, vm_size_t objsize, vm_ooffset_t foff,
- vm_object_t *obj);
-
-#else /* !_KERNEL */
-
-__BEGIN_DECLS
-/*
- * XXX not yet implemented: posix_mem_offset(), posix_typed_mem_get_info(),
- * posix_typed_mem_open().
- */
-#if __BSD_VISIBLE
-int getpagesizes(size_t *, int);
-int madvise(void *, size_t, int);
-int mincore(const void *, size_t, char *);
-int minherit(void *, size_t, int);
-#endif
-int mlock(const void *, size_t);
-#ifndef _MMAP_DECLARED
-#define _MMAP_DECLARED
-void * mmap(void *, size_t, int, int, int, off_t);
-#endif
-int mprotect(const void *, size_t, int);
-int msync(void *, size_t, int);
-int munlock(const void *, size_t);
-int munmap(void *, size_t);
-#if __POSIX_VISIBLE >= 200112
-int posix_madvise(void *, size_t, int);
-#endif
-#if __POSIX_VISIBLE >= 199309
-int mlockall(int);
-int munlockall(void);
-int shm_open(const char *, int, mode_t);
-int shm_unlink(const char *);
-#endif
-__END_DECLS
-
-#endif /* !_KERNEL */
-
-#endif /* !_SYS_MMAN_HH_ */
diff --git a/freebsd/sys/net/bpf.c b/freebsd/sys/net/bpf.c
index 684c7343..d9223313 100644
--- a/freebsd/sys/net/bpf.c
+++ b/freebsd/sys/net/bpf.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1990, 1991, 1993
@@ -36,55 +36,55 @@
* @(#)bpf.c 8.4 (Berkeley) 1/9/95
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_bpf.h>
-#include <freebsd/local/opt_compat.h>
-#include <freebsd/local/opt_netgraph.h>
-
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/conf.h>
-#include <freebsd/sys/fcntl.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/filio.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/ttycom.h>
-#include <freebsd/sys/uio.h>
-
-#include <freebsd/sys/event.h>
-#include <freebsd/sys/file.h>
-#include <freebsd/sys/poll.h>
-#include <freebsd/sys/proc.h>
-
-#include <freebsd/sys/socket.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/bpf_buffer.h>
+#include <rtems/bsd/local/opt_bpf.h>
+#include <rtems/bsd/local/opt_compat.h>
+#include <rtems/bsd/local/opt_netgraph.h>
+
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/conf.h>
+#include <sys/fcntl.h>
+#include <sys/jail.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/signalvar.h>
+#include <sys/filio.h>
+#include <sys/sockio.h>
+#include <sys/ttycom.h>
+#include <sys/uio.h>
+
+#include <sys/event.h>
+#include <sys/file.h>
+#include <sys/poll.h>
+#include <sys/proc.h>
+
+#include <sys/socket.h>
+
+#include <net/if.h>
+#include <net/bpf.h>
+#include <net/bpf_buffer.h>
#ifdef BPF_JITTER
-#include <freebsd/net/bpf_jitter.h>
+#include <net/bpf_jitter.h>
#endif
-#include <freebsd/net/bpf_zerocopy.h>
-#include <freebsd/net/bpfdesc.h>
-#include <freebsd/net/vnet.h>
+#include <net/bpf_zerocopy.h>
+#include <net/bpfdesc.h>
+#include <net/vnet.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/if_ether.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/sysctl.h>
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
-#include <freebsd/net80211/ieee80211_freebsd.h>
+#include <net80211/ieee80211_freebsd.h>
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
MALLOC_DEFINE(M_BPF, "BPF", "BPF data");
@@ -93,8 +93,8 @@ MALLOC_DEFINE(M_BPF, "BPF", "BPF data");
#define PRINET 26 /* interruptible */
#ifdef COMPAT_FREEBSD32
-#include <freebsd/sys/mount.h>
-#include <freebsd/compat/freebsd32/freebsd32.h>
+#include <sys/mount.h>
+#include <compat/freebsd32/freebsd32.h>
#define BPF_ALIGNMENT32 sizeof(int32_t)
#define BPF_WORDALIGN32(x) (((x)+(BPF_ALIGNMENT32-1))&~(BPF_ALIGNMENT32-1))
diff --git a/freebsd/sys/net/bpf.h b/freebsd/sys/net/bpf.h
index d9dd4289..726483a5 100644
--- a/freebsd/sys/net/bpf.h
+++ b/freebsd/sys/net/bpf.h
@@ -37,8 +37,8 @@
* $FreeBSD$
*/
-#ifndef _NET_BPF_HH_
-#define _NET_BPF_HH_
+#ifndef _NET_BPF_H_
+#define _NET_BPF_H_
/* BSD style release date */
#define BPF_RELEASE 199606
@@ -971,4 +971,4 @@ bpf_peers_present(struct bpf_if *bpf)
*/
#define BPF_MEMWORDS 16
-#endif /* _NET_BPF_HH_ */
+#endif /* _NET_BPF_H_ */
diff --git a/freebsd/sys/net/bpf_buffer.c b/freebsd/sys/net/bpf_buffer.c
index 623b4f8a..7ebfb0a8 100644
--- a/freebsd/sys/net/bpf_buffer.c
+++ b/freebsd/sys/net/bpf_buffer.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2007 Seccuris Inc.
@@ -63,23 +63,23 @@
* @(#)bpf.c 8.4 (Berkeley) 1/9/95
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_bpf.h>
+#include <rtems/bsd/local/opt_bpf.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/uio.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/uio.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/bpf_buffer.h>
-#include <freebsd/net/bpfdesc.h>
+#include <net/if.h>
+#include <net/bpf.h>
+#include <net/bpf_buffer.h>
+#include <net/bpfdesc.h>
/*
* Implement historical kernel memory buffering model for BPF: two malloc(9)
diff --git a/freebsd/sys/net/bpf_buffer.h b/freebsd/sys/net/bpf_buffer.h
index 545ddb22..82d0310b 100644
--- a/freebsd/sys/net/bpf_buffer.h
+++ b/freebsd/sys/net/bpf_buffer.h
@@ -29,8 +29,8 @@
* $FreeBSD$
*/
-#ifndef _NET_BPF_BUFFER_HH_
-#define _NET_BPF_BUFFER_HH_
+#ifndef _NET_BPF_BUFFER_H_
+#define _NET_BPF_BUFFER_H_
#ifndef _KERNEL
#error "no user-serviceable parts inside"
@@ -47,4 +47,4 @@ int bpf_buffer_ioctl_sblen(struct bpf_d *d, u_int *i);
int bpf_buffer_uiomove(struct bpf_d *d, caddr_t buf, u_int len,
struct uio *uio);
-#endif /* !_NET_BPF_BUFFER_HH_ */
+#endif /* !_NET_BPF_BUFFER_H_ */
diff --git a/freebsd/sys/net/bpf_filter.c b/freebsd/sys/net/bpf_filter.c
index 3452cc4a..e796cf79 100644
--- a/freebsd/sys/net/bpf_filter.c
+++ b/freebsd/sys/net/bpf_filter.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1990, 1991, 1993
@@ -36,13 +36,13 @@
* @(#)bpf_filter.c 8.1 (Berkeley) 6/10/93
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
+#include <rtems/bsd/sys/param.h>
#if !defined(_KERNEL) || defined(sun)
-#include <freebsd/netinet/in.h>
+#include <netinet/in.h>
#endif
#ifndef __i386__
@@ -65,11 +65,11 @@ __FBSDID("$FreeBSD$");
#endif
#ifdef _KERNEL
-#include <freebsd/sys/mbuf.h>
+#include <sys/mbuf.h>
#else
-#include <freebsd/stdlib.h>
+#include <stdlib.h>
#endif
-#include <freebsd/net/bpf.h>
+#include <net/bpf.h>
#ifdef _KERNEL
#define MINDEX(m, k) \
{ \
diff --git a/freebsd/sys/net/bpf_jitter.c b/freebsd/sys/net/bpf_jitter.c
index bb373725..02c0b34f 100644
--- a/freebsd/sys/net/bpf_jitter.c
+++ b/freebsd/sys/net/bpf_jitter.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 2002-2003 NetGroup, Politecnico di Torino (Italy)
@@ -31,25 +31,25 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifdef _KERNEL
-#include <freebsd/local/opt_bpf.h>
+#include <rtems/bsd/local/opt_bpf.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/sysctl.h>
#else
-#include <freebsd/stdlib.h>
-#include <freebsd/string.h>
-#include <freebsd/sys/types.h>
+#include <stdlib.h>
+#include <string.h>
+#include <rtems/bsd/sys/types.h>
#endif
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/bpf_jitter.h>
+#include <net/bpf.h>
+#include <net/bpf_jitter.h>
bpf_filter_func bpf_jit_compile(struct bpf_insn *, u_int, int *);
diff --git a/freebsd/sys/net/bpf_jitter.h b/freebsd/sys/net/bpf_jitter.h
index c0dd7e04..04491b01 100644
--- a/freebsd/sys/net/bpf_jitter.h
+++ b/freebsd/sys/net/bpf_jitter.h
@@ -31,8 +31,8 @@
* $FreeBSD$
*/
-#ifndef _NET_BPF_JITTER_HH_
-#define _NET_BPF_JITTER_HH_
+#ifndef _NET_BPF_JITTER_H_
+#define _NET_BPF_JITTER_H_
#ifdef _KERNEL
MALLOC_DECLARE(M_BPFJIT);
@@ -81,4 +81,4 @@ bpf_jit_filter *bpf_jitter(struct bpf_insn *fp, int nins);
*/
void bpf_destroy_jit_filter(bpf_jit_filter *filter);
-#endif /* _NET_BPF_JITTER_HH_ */
+#endif /* _NET_BPF_JITTER_H_ */
diff --git a/freebsd/sys/net/bpf_zerocopy.h b/freebsd/sys/net/bpf_zerocopy.h
index 455bd41c..c541a15d 100644
--- a/freebsd/sys/net/bpf_zerocopy.h
+++ b/freebsd/sys/net/bpf_zerocopy.h
@@ -29,8 +29,8 @@
* $FreeBSD$
*/
-#ifndef _NET_BPF_ZEROCOPY_HH_
-#define _NET_BPF_ZEROCOPY_HH_
+#ifndef _NET_BPF_ZEROCOPY_H_
+#define _NET_BPF_ZEROCOPY_H_
#ifndef _KERNEL
#error "no user-serviceable parts inside"
@@ -53,4 +53,4 @@ int bpf_zerocopy_ioctl_rotzbuf(struct thread *td, struct bpf_d *d,
int bpf_zerocopy_ioctl_setzbuf(struct thread *td, struct bpf_d *d,
struct bpf_zbuf *bz);
-#endif /* !_NET_BPF_ZEROCOPY_HH_ */
+#endif /* !_NET_BPF_ZEROCOPY_H_ */
diff --git a/freebsd/sys/net/bpfdesc.h b/freebsd/sys/net/bpfdesc.h
index d28ecca2..03cb20dd 100644
--- a/freebsd/sys/net/bpfdesc.h
+++ b/freebsd/sys/net/bpfdesc.h
@@ -36,14 +36,14 @@
* $FreeBSD$
*/
-#ifndef _NET_BPFDESC_HH_
-#define _NET_BPFDESC_HH_
+#ifndef _NET_BPFDESC_H_
+#define _NET_BPFDESC_H_
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/selinfo.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/conf.h>
-#include <freebsd/net/if.h>
+#include <sys/callout.h>
+#include <sys/selinfo.h>
+#include <sys/queue.h>
+#include <sys/conf.h>
+#include <net/if.h>
/*
* Descriptor associated with each open bpf file.
diff --git a/freebsd/sys/net/bridgestp.c b/freebsd/sys/net/bridgestp.c
index 2191be26..cc7f4e6f 100644
--- a/freebsd/sys/net/bridgestp.c
+++ b/freebsd/sys/net/bridgestp.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $NetBSD: bridgestp.c,v 1.5 2003/11/28 08:56:48 keihan Exp $ */
@@ -36,34 +36,34 @@
* ISO/IEC 802.1D-2004, June 9, 2004.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/taskqueue.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_llc.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/if_ether.h>
-#include <freebsd/net/bridgestp.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/kernel.h>
+#include <sys/callout.h>
+#include <sys/module.h>
+#include <sys/proc.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/taskqueue.h>
+
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/if_types.h>
+#include <net/if_llc.h>
+#include <net/if_media.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/if_ether.h>
+#include <net/bridgestp.h>
#ifdef BRIDGESTP_DEBUG
#define DPRINTF(fmt, arg...) printf("bstp: " fmt, ##arg)
diff --git a/freebsd/sys/net/bridgestp.h b/freebsd/sys/net/bridgestp.h
index 91328900..74086fce 100644
--- a/freebsd/sys/net/bridgestp.h
+++ b/freebsd/sys/net/bridgestp.h
@@ -74,8 +74,8 @@
* Data structure and control definitions for STP interfaces.
*/
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/queue.h>
+#include <sys/callout.h>
+#include <sys/queue.h>
/* STP port states */
#define BSTP_IFSTATE_DISABLED 0
diff --git a/freebsd/sys/net/ethernet.h b/freebsd/sys/net/ethernet.h
index 17d022b2..ae7341ee 100644
--- a/freebsd/sys/net/ethernet.h
+++ b/freebsd/sys/net/ethernet.h
@@ -1,2 +1,405 @@
-#include <freebsd/bsd.h>
-#include <freebsd/net/ethernet.h>
+/*
+ * Fundamental constants relating to ethernet.
+ *
+ * $FreeBSD$
+ *
+ */
+
+#ifndef _NET_ETHERNET_H_
+#define _NET_ETHERNET_H_
+
+/*
+ * Some basic Ethernet constants.
+ */
+#define ETHER_ADDR_LEN 6 /* length of an Ethernet address */
+#define ETHER_TYPE_LEN 2 /* length of the Ethernet type field */
+#define ETHER_CRC_LEN 4 /* length of the Ethernet CRC */
+#define ETHER_HDR_LEN (ETHER_ADDR_LEN*2+ETHER_TYPE_LEN)
+#define ETHER_MIN_LEN 64 /* minimum frame len, including CRC */
+#define ETHER_MAX_LEN 1518 /* maximum frame len, including CRC */
+#define ETHER_MAX_LEN_JUMBO 9018 /* max jumbo frame len, including CRC */
+
+#define ETHER_VLAN_ENCAP_LEN 4 /* len of 802.1Q VLAN encapsulation */
+/*
+ * Mbuf adjust factor to force 32-bit alignment of IP header.
+ * Drivers should do m_adj(m, ETHER_ALIGN) when setting up a
+ * receive so the upper layers get the IP header properly aligned
+ * past the 14-byte Ethernet header.
+ */
+#define ETHER_ALIGN 2 /* driver adjust for IP hdr alignment */
+
+/*
+ * Compute the maximum frame size based on ethertype (i.e. possible
+ * encapsulation) and whether or not an FCS is present.
+ */
+#define ETHER_MAX_FRAME(ifp, etype, hasfcs) \
+ ((ifp)->if_mtu + ETHER_HDR_LEN + \
+ ((hasfcs) ? ETHER_CRC_LEN : 0) + \
+ (((etype) == ETHERTYPE_VLAN) ? ETHER_VLAN_ENCAP_LEN : 0))
+
+/*
+ * Ethernet-specific mbuf flags.
+ */
+#define M_HASFCS M_PROTO5 /* FCS included at end of frame */
+
+/*
+ * Ethernet CRC32 polynomials (big- and little-endian verions).
+ */
+#define ETHER_CRC_POLY_LE 0xedb88320
+#define ETHER_CRC_POLY_BE 0x04c11db6
+
+/*
+ * A macro to validate a length with
+ */
+#define ETHER_IS_VALID_LEN(foo) \
+ ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
+
+/*
+ * Structure of a 10Mb/s Ethernet header.
+ */
+struct ether_header {
+ u_char ether_dhost[ETHER_ADDR_LEN];
+ u_char ether_shost[ETHER_ADDR_LEN];
+ u_short ether_type;
+} __packed;
+
+/*
+ * Structure of a 48-bit Ethernet address.
+ */
+struct ether_addr {
+ u_char octet[ETHER_ADDR_LEN];
+} __packed;
+
+#define ETHER_IS_MULTICAST(addr) (*(addr) & 0x01) /* is address mcast/bcast? */
+
+/*
+ * NOTE: 0x0000-0x05DC (0..1500) are generally IEEE 802.3 length fields.
+ * However, there are some conflicts.
+ */
+
+#define ETHERTYPE_8023 0x0004 /* IEEE 802.3 packet */
+ /* 0x0101 .. 0x1FF Experimental */
+#define ETHERTYPE_PUP 0x0200 /* Xerox PUP protocol - see 0A00 */
+#define ETHERTYPE_PUPAT 0x0200 /* PUP Address Translation - see 0A01 */
+#define ETHERTYPE_SPRITE 0x0500 /* ??? */
+ /* 0x0400 Nixdorf */
+#define ETHERTYPE_NS 0x0600 /* XNS */
+#define ETHERTYPE_NSAT 0x0601 /* XNS Address Translation (3Mb only) */
+#define ETHERTYPE_DLOG1 0x0660 /* DLOG (?) */
+#define ETHERTYPE_DLOG2 0x0661 /* DLOG (?) */
+#define ETHERTYPE_IP 0x0800 /* IP protocol */
+#define ETHERTYPE_X75 0x0801 /* X.75 Internet */
+#define ETHERTYPE_NBS 0x0802 /* NBS Internet */
+#define ETHERTYPE_ECMA 0x0803 /* ECMA Internet */
+#define ETHERTYPE_CHAOS 0x0804 /* CHAOSnet */
+#define ETHERTYPE_X25 0x0805 /* X.25 Level 3 */
+#define ETHERTYPE_ARP 0x0806 /* Address resolution protocol */
+#define ETHERTYPE_NSCOMPAT 0x0807 /* XNS Compatibility */
+#define ETHERTYPE_FRARP 0x0808 /* Frame Relay ARP (RFC1701) */
+ /* 0x081C Symbolics Private */
+ /* 0x0888 - 0x088A Xyplex */
+#define ETHERTYPE_UBDEBUG 0x0900 /* Ungermann-Bass network debugger */
+#define ETHERTYPE_IEEEPUP 0x0A00 /* Xerox IEEE802.3 PUP */
+#define ETHERTYPE_IEEEPUPAT 0x0A01 /* Xerox IEEE802.3 PUP Address Translation */
+#define ETHERTYPE_VINES 0x0BAD /* Banyan VINES */
+#define ETHERTYPE_VINESLOOP 0x0BAE /* Banyan VINES Loopback */
+#define ETHERTYPE_VINESECHO 0x0BAF /* Banyan VINES Echo */
+
+/* 0x1000 - 0x100F Berkeley Trailer */
+/*
+ * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
+ * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
+ * by an ETHER type (as given above) and then the (variable-length) header.
+ */
+#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
+#define ETHERTYPE_NTRAILER 16
+
+#define ETHERTYPE_DCA 0x1234 /* DCA - Multicast */
+#define ETHERTYPE_VALID 0x1600 /* VALID system protocol */
+#define ETHERTYPE_DOGFIGHT 0x1989 /* Artificial Horizons ("Aviator" dogfight simulator [on Sun]) */
+#define ETHERTYPE_RCL 0x1995 /* Datapoint Corporation (RCL lan protocol) */
+
+ /* The following 3C0x types
+ are unregistered: */
+#define ETHERTYPE_NBPVCD 0x3C00 /* 3Com NBP virtual circuit datagram (like XNS SPP) not registered */
+#define ETHERTYPE_NBPSCD 0x3C01 /* 3Com NBP System control datagram not registered */
+#define ETHERTYPE_NBPCREQ 0x3C02 /* 3Com NBP Connect request (virtual cct) not registered */
+#define ETHERTYPE_NBPCRSP 0x3C03 /* 3Com NBP Connect response not registered */
+#define ETHERTYPE_NBPCC 0x3C04 /* 3Com NBP Connect complete not registered */
+#define ETHERTYPE_NBPCLREQ 0x3C05 /* 3Com NBP Close request (virtual cct) not registered */
+#define ETHERTYPE_NBPCLRSP 0x3C06 /* 3Com NBP Close response not registered */
+#define ETHERTYPE_NBPDG 0x3C07 /* 3Com NBP Datagram (like XNS IDP) not registered */
+#define ETHERTYPE_NBPDGB 0x3C08 /* 3Com NBP Datagram broadcast not registered */
+#define ETHERTYPE_NBPCLAIM 0x3C09 /* 3Com NBP Claim NetBIOS name not registered */
+#define ETHERTYPE_NBPDLTE 0x3C0A /* 3Com NBP Delete NetBIOS name not registered */
+#define ETHERTYPE_NBPRAS 0x3C0B /* 3Com NBP Remote adaptor status request not registered */
+#define ETHERTYPE_NBPRAR 0x3C0C /* 3Com NBP Remote adaptor response not registered */
+#define ETHERTYPE_NBPRST 0x3C0D /* 3Com NBP Reset not registered */
+
+#define ETHERTYPE_PCS 0x4242 /* PCS Basic Block Protocol */
+#define ETHERTYPE_IMLBLDIAG 0x424C /* Information Modes Little Big LAN diagnostic */
+#define ETHERTYPE_DIDDLE 0x4321 /* THD - Diddle */
+#define ETHERTYPE_IMLBL 0x4C42 /* Information Modes Little Big LAN */
+#define ETHERTYPE_SIMNET 0x5208 /* BBN Simnet Private */
+#define ETHERTYPE_DECEXPER 0x6000 /* DEC Unassigned, experimental */
+#define ETHERTYPE_MOPDL 0x6001 /* DEC MOP dump/load */
+#define ETHERTYPE_MOPRC 0x6002 /* DEC MOP remote console */
+#define ETHERTYPE_DECnet 0x6003 /* DEC DECNET Phase IV route */
+#define ETHERTYPE_DN ETHERTYPE_DECnet /* libpcap, tcpdump */
+#define ETHERTYPE_LAT 0x6004 /* DEC LAT */
+#define ETHERTYPE_DECDIAG 0x6005 /* DEC diagnostic protocol (at interface initialization?) */
+#define ETHERTYPE_DECCUST 0x6006 /* DEC customer protocol */
+#define ETHERTYPE_SCA 0x6007 /* DEC LAVC, SCA */
+#define ETHERTYPE_AMBER 0x6008 /* DEC AMBER */
+#define ETHERTYPE_DECMUMPS 0x6009 /* DEC MUMPS */
+ /* 0x6010 - 0x6014 3Com Corporation */
+#define ETHERTYPE_TRANSETHER 0x6558 /* Trans Ether Bridging (RFC1701)*/
+#define ETHERTYPE_RAWFR 0x6559 /* Raw Frame Relay (RFC1701) */
+#define ETHERTYPE_UBDL 0x7000 /* Ungermann-Bass download */
+#define ETHERTYPE_UBNIU 0x7001 /* Ungermann-Bass NIUs */
+#define ETHERTYPE_UBDIAGLOOP 0x7002 /* Ungermann-Bass diagnostic/loopback */
+#define ETHERTYPE_UBNMC 0x7003 /* Ungermann-Bass ??? (NMC to/from UB Bridge) */
+#define ETHERTYPE_UBBST 0x7005 /* Ungermann-Bass Bridge Spanning Tree */
+#define ETHERTYPE_OS9 0x7007 /* OS/9 Microware */
+#define ETHERTYPE_OS9NET 0x7009 /* OS/9 Net? */
+ /* 0x7020 - 0x7029 LRT (England) (now Sintrom) */
+#define ETHERTYPE_RACAL 0x7030 /* Racal-Interlan */
+#define ETHERTYPE_PRIMENTS 0x7031 /* Prime NTS (Network Terminal Service) */
+#define ETHERTYPE_CABLETRON 0x7034 /* Cabletron */
+#define ETHERTYPE_CRONUSVLN 0x8003 /* Cronus VLN */
+#define ETHERTYPE_CRONUS 0x8004 /* Cronus Direct */
+#define ETHERTYPE_HP 0x8005 /* HP Probe */
+#define ETHERTYPE_NESTAR 0x8006 /* Nestar */
+#define ETHERTYPE_ATTSTANFORD 0x8008 /* AT&T/Stanford (local use) */
+#define ETHERTYPE_EXCELAN 0x8010 /* Excelan */
+#define ETHERTYPE_SG_DIAG 0x8013 /* SGI diagnostic type */
+#define ETHERTYPE_SG_NETGAMES 0x8014 /* SGI network games */
+#define ETHERTYPE_SG_RESV 0x8015 /* SGI reserved type */
+#define ETHERTYPE_SG_BOUNCE 0x8016 /* SGI bounce server */
+#define ETHERTYPE_APOLLODOMAIN 0x8019 /* Apollo DOMAIN */
+#define ETHERTYPE_TYMSHARE 0x802E /* Tymeshare */
+#define ETHERTYPE_TIGAN 0x802F /* Tigan, Inc. */
+#define ETHERTYPE_REVARP 0x8035 /* Reverse addr resolution protocol */
+#define ETHERTYPE_AEONIC 0x8036 /* Aeonic Systems */
+#define ETHERTYPE_IPXNEW 0x8037 /* IPX (Novell Netware?) */
+#define ETHERTYPE_LANBRIDGE 0x8038 /* DEC LANBridge */
+#define ETHERTYPE_DSMD 0x8039 /* DEC DSM/DDP */
+#define ETHERTYPE_ARGONAUT 0x803A /* DEC Argonaut Console */
+#define ETHERTYPE_VAXELN 0x803B /* DEC VAXELN */
+#define ETHERTYPE_DECDNS 0x803C /* DEC DNS Naming Service */
+#define ETHERTYPE_ENCRYPT 0x803D /* DEC Ethernet Encryption */
+#define ETHERTYPE_DECDTS 0x803E /* DEC Distributed Time Service */
+#define ETHERTYPE_DECLTM 0x803F /* DEC LAN Traffic Monitor */
+#define ETHERTYPE_DECNETBIOS 0x8040 /* DEC PATHWORKS DECnet NETBIOS Emulation */
+#define ETHERTYPE_DECLAST 0x8041 /* DEC Local Area System Transport */
+ /* 0x8042 DEC Unassigned */
+#define ETHERTYPE_PLANNING 0x8044 /* Planning Research Corp. */
+ /* 0x8046 - 0x8047 AT&T */
+#define ETHERTYPE_DECAM 0x8048 /* DEC Availability Manager for Distributed Systems DECamds (but someone at DEC says not) */
+#define ETHERTYPE_EXPERDATA 0x8049 /* ExperData */
+#define ETHERTYPE_VEXP 0x805B /* Stanford V Kernel exp. */
+#define ETHERTYPE_VPROD 0x805C /* Stanford V Kernel prod. */
+#define ETHERTYPE_ES 0x805D /* Evans & Sutherland */
+#define ETHERTYPE_LITTLE 0x8060 /* Little Machines */
+#define ETHERTYPE_COUNTERPOINT 0x8062 /* Counterpoint Computers */
+ /* 0x8065 - 0x8066 Univ. of Mass @ Amherst */
+#define ETHERTYPE_VEECO 0x8067 /* Veeco Integrated Auto. */
+#define ETHERTYPE_GENDYN 0x8068 /* General Dynamics */
+#define ETHERTYPE_ATT 0x8069 /* AT&T */
+#define ETHERTYPE_AUTOPHON 0x806A /* Autophon */
+#define ETHERTYPE_COMDESIGN 0x806C /* ComDesign */
+#define ETHERTYPE_COMPUGRAPHIC 0x806D /* Compugraphic Corporation */
+ /* 0x806E - 0x8077 Landmark Graphics Corp. */
+#define ETHERTYPE_MATRA 0x807A /* Matra */
+#define ETHERTYPE_DDE 0x807B /* Dansk Data Elektronik */
+#define ETHERTYPE_MERIT 0x807C /* Merit Internodal (or Univ of Michigan?) */
+ /* 0x807D - 0x807F Vitalink Communications */
+#define ETHERTYPE_VLTLMAN 0x8080 /* Vitalink TransLAN III Management */
+ /* 0x8081 - 0x8083 Counterpoint Computers */
+ /* 0x8088 - 0x808A Xyplex */
+#define ETHERTYPE_ATALK 0x809B /* AppleTalk */
+#define ETHERTYPE_AT ETHERTYPE_ATALK /* old NetBSD */
+#define ETHERTYPE_APPLETALK ETHERTYPE_ATALK /* HP-UX */
+ /* 0x809C - 0x809E Datability */
+#define ETHERTYPE_SPIDER 0x809F /* Spider Systems Ltd. */
+ /* 0x80A3 Nixdorf */
+ /* 0x80A4 - 0x80B3 Siemens Gammasonics Inc. */
+ /* 0x80C0 - 0x80C3 DCA (Digital Comm. Assoc.) Data Exchange Cluster */
+ /* 0x80C4 - 0x80C5 Banyan Systems */
+#define ETHERTYPE_PACER 0x80C6 /* Pacer Software */
+#define ETHERTYPE_APPLITEK 0x80C7 /* Applitek Corporation */
+ /* 0x80C8 - 0x80CC Intergraph Corporation */
+ /* 0x80CD - 0x80CE Harris Corporation */
+ /* 0x80CF - 0x80D2 Taylor Instrument */
+ /* 0x80D3 - 0x80D4 Rosemount Corporation */
+#define ETHERTYPE_SNA 0x80D5 /* IBM SNA Services over Ethernet */
+#define ETHERTYPE_VARIAN 0x80DD /* Varian Associates */
+ /* 0x80DE - 0x80DF TRFS (Integrated Solutions Transparent Remote File System) */
+ /* 0x80E0 - 0x80E3 Allen-Bradley */
+ /* 0x80E4 - 0x80F0 Datability */
+#define ETHERTYPE_RETIX 0x80F2 /* Retix */
+#define ETHERTYPE_AARP 0x80F3 /* AppleTalk AARP */
+ /* 0x80F4 - 0x80F5 Kinetics */
+#define ETHERTYPE_APOLLO 0x80F7 /* Apollo Computer */
+#define ETHERTYPE_VLAN 0x8100 /* IEEE 802.1Q VLAN tagging (XXX conflicts) */
+ /* 0x80FF - 0x8101 Wellfleet Communications (XXX conflicts) */
+#define ETHERTYPE_BOFL 0x8102 /* Wellfleet; BOFL (Breath OF Life) pkts [every 5-10 secs.] */
+#define ETHERTYPE_WELLFLEET 0x8103 /* Wellfleet Communications */
+ /* 0x8107 - 0x8109 Symbolics Private */
+#define ETHERTYPE_TALARIS 0x812B /* Talaris */
+#define ETHERTYPE_WATERLOO 0x8130 /* Waterloo Microsystems Inc. (XXX which?) */
+#define ETHERTYPE_HAYES 0x8130 /* Hayes Microcomputers (XXX which?) */
+#define ETHERTYPE_VGLAB 0x8131 /* VG Laboratory Systems */
+ /* 0x8132 - 0x8137 Bridge Communications */
+#define ETHERTYPE_IPX 0x8137 /* Novell (old) NetWare IPX (ECONFIG E option) */
+#define ETHERTYPE_NOVELL 0x8138 /* Novell, Inc. */
+ /* 0x8139 - 0x813D KTI */
+#define ETHERTYPE_MUMPS 0x813F /* M/MUMPS data sharing */
+#define ETHERTYPE_AMOEBA 0x8145 /* Vrije Universiteit (NL) Amoeba 4 RPC (obsolete) */
+#define ETHERTYPE_FLIP 0x8146 /* Vrije Universiteit (NL) FLIP (Fast Local Internet Protocol) */
+#define ETHERTYPE_VURESERVED 0x8147 /* Vrije Universiteit (NL) [reserved] */
+#define ETHERTYPE_LOGICRAFT 0x8148 /* Logicraft */
+#define ETHERTYPE_NCD 0x8149 /* Network Computing Devices */
+#define ETHERTYPE_ALPHA 0x814A /* Alpha Micro */
+#define ETHERTYPE_SNMP 0x814C /* SNMP over Ethernet (see RFC1089) */
+ /* 0x814D - 0x814E BIIN */
+#define ETHERTYPE_TEC 0x814F /* Technically Elite Concepts */
+#define ETHERTYPE_RATIONAL 0x8150 /* Rational Corp */
+ /* 0x8151 - 0x8153 Qualcomm */
+ /* 0x815C - 0x815E Computer Protocol Pty Ltd */
+ /* 0x8164 - 0x8166 Charles River Data Systems */
+#define ETHERTYPE_XTP 0x817D /* Protocol Engines XTP */
+#define ETHERTYPE_SGITW 0x817E /* SGI/Time Warner prop. */
+#define ETHERTYPE_HIPPI_FP 0x8180 /* HIPPI-FP encapsulation */
+#define ETHERTYPE_STP 0x8181 /* Scheduled Transfer STP, HIPPI-ST */
+ /* 0x8182 - 0x8183 Reserved for HIPPI-6400 */
+ /* 0x8184 - 0x818C SGI prop. */
+#define ETHERTYPE_MOTOROLA 0x818D /* Motorola */
+#define ETHERTYPE_NETBEUI 0x8191 /* PowerLAN NetBIOS/NetBEUI (PC) */
+ /* 0x819A - 0x81A3 RAD Network Devices */
+ /* 0x81B7 - 0x81B9 Xyplex */
+ /* 0x81CC - 0x81D5 Apricot Computers */
+ /* 0x81D6 - 0x81DD Artisoft Lantastic */
+ /* 0x81E6 - 0x81EF Polygon */
+ /* 0x81F0 - 0x81F2 Comsat Labs */
+ /* 0x81F3 - 0x81F5 SAIC */
+ /* 0x81F6 - 0x81F8 VG Analytical */
+ /* 0x8203 - 0x8205 QNX Software Systems Ltd. */
+ /* 0x8221 - 0x8222 Ascom Banking Systems */
+ /* 0x823E - 0x8240 Advanced Encryption Systems */
+ /* 0x8263 - 0x826A Charles River Data Systems */
+ /* 0x827F - 0x8282 Athena Programming */
+ /* 0x829A - 0x829B Inst Ind Info Tech */
+ /* 0x829C - 0x82AB Taurus Controls */
+ /* 0x82AC - 0x8693 Walker Richer & Quinn */
+#define ETHERTYPE_ACCTON 0x8390 /* Accton Technologies (unregistered) */
+#define ETHERTYPE_TALARISMC 0x852B /* Talaris multicast */
+#define ETHERTYPE_KALPANA 0x8582 /* Kalpana */
+ /* 0x8694 - 0x869D Idea Courier */
+ /* 0x869E - 0x86A1 Computer Network Tech */
+ /* 0x86A3 - 0x86AC Gateway Communications */
+#define ETHERTYPE_SECTRA 0x86DB /* SECTRA */
+#define ETHERTYPE_IPV6 0x86DD /* IP protocol version 6 */
+#define ETHERTYPE_DELTACON 0x86DE /* Delta Controls */
+#define ETHERTYPE_ATOMIC 0x86DF /* ATOMIC */
+ /* 0x86E0 - 0x86EF Landis & Gyr Powers */
+ /* 0x8700 - 0x8710 Motorola */
+#define ETHERTYPE_RDP 0x8739 /* Control Technology Inc. RDP Without IP */
+#define ETHERTYPE_MICP 0x873A /* Control Technology Inc. Mcast Industrial Ctrl Proto. */
+ /* 0x873B - 0x873C Control Technology Inc. Proprietary */
+#define ETHERTYPE_TCPCOMP 0x876B /* TCP/IP Compression (RFC1701) */
+#define ETHERTYPE_IPAS 0x876C /* IP Autonomous Systems (RFC1701) */
+#define ETHERTYPE_SECUREDATA 0x876D /* Secure Data (RFC1701) */
+#define ETHERTYPE_FLOWCONTROL 0x8808 /* 802.3x flow control packet */
+#define ETHERTYPE_SLOW 0x8809 /* 802.3ad link aggregation (LACP) */
+#define ETHERTYPE_PPP 0x880B /* PPP (obsolete by PPPoE) */
+#define ETHERTYPE_HITACHI 0x8820 /* Hitachi Cable (Optoelectronic Systems Laboratory) */
+#define ETHERTYPE_MPLS 0x8847 /* MPLS Unicast */
+#define ETHERTYPE_MPLS_MCAST 0x8848 /* MPLS Multicast */
+#define ETHERTYPE_AXIS 0x8856 /* Axis Communications AB proprietary bootstrap/config */
+#define ETHERTYPE_PPPOEDISC 0x8863 /* PPP Over Ethernet Discovery Stage */
+#define ETHERTYPE_PPPOE 0x8864 /* PPP Over Ethernet Session Stage */
+#define ETHERTYPE_LANPROBE 0x8888 /* HP LanProbe test? */
+#define ETHERTYPE_PAE 0x888e /* EAPOL PAE/802.1x */
+#define ETHERTYPE_LOOPBACK 0x9000 /* Loopback: used to test interfaces */
+#define ETHERTYPE_LBACK ETHERTYPE_LOOPBACK /* DEC MOP loopback */
+#define ETHERTYPE_XNSSM 0x9001 /* 3Com (Formerly Bridge Communications), XNS Systems Management */
+#define ETHERTYPE_TCPSM 0x9002 /* 3Com (Formerly Bridge Communications), TCP/IP Systems Management */
+#define ETHERTYPE_BCLOOP 0x9003 /* 3Com (Formerly Bridge Communications), loopback detection */
+#define ETHERTYPE_DEBNI 0xAAAA /* DECNET? Used by VAX 6220 DEBNI */
+#define ETHERTYPE_SONIX 0xFAF5 /* Sonix Arpeggio */
+#define ETHERTYPE_VITAL 0xFF00 /* BBN VITAL-LanBridge cache wakeups */
+ /* 0xFF00 - 0xFFOF ISC Bunker Ramo */
+
+#define ETHERTYPE_MAX 0xFFFF /* Maximum valid ethernet type, reserved */
+
+/*
+ * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
+ * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
+ * by an ETHER type (as given above) and then the (variable-length) header.
+ */
+#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
+#define ETHERTYPE_NTRAILER 16
+
+#define ETHERMTU (ETHER_MAX_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
+#define ETHERMIN (ETHER_MIN_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
+#define ETHERMTU_JUMBO (ETHER_MAX_LEN_JUMBO - ETHER_HDR_LEN - ETHER_CRC_LEN)
+/*
+ * The ETHER_BPF_MTAP macro should be used by drivers which support hardware
+ * offload for VLAN tag processing. It will check the mbuf to see if it has
+ * M_VLANTAG set, and if it does, will pass the packet along to
+ * ether_vlan_mtap. This function will re-insert VLAN tags for the duration
+ * of the tap, so they show up properly for network analyzers.
+ */
+#define ETHER_BPF_MTAP(_ifp, _m) do { \
+ if (bpf_peers_present((_ifp)->if_bpf)) { \
+ M_ASSERTVALID(_m); \
+ if (((_m)->m_flags & M_VLANTAG) != 0) \
+ ether_vlan_mtap((_ifp)->if_bpf, (_m), NULL, 0); \
+ else \
+ bpf_mtap((_ifp)->if_bpf, (_m)); \
+ } \
+} while (0)
+
+#ifdef _KERNEL
+
+struct ifnet;
+struct mbuf;
+struct route;
+struct sockaddr;
+struct bpf_if;
+
+extern uint32_t ether_crc32_le(const uint8_t *, size_t);
+extern uint32_t ether_crc32_be(const uint8_t *, size_t);
+extern void ether_demux(struct ifnet *, struct mbuf *);
+extern void ether_ifattach(struct ifnet *, const u_int8_t *);
+extern void ether_ifdetach(struct ifnet *);
+extern int ether_ioctl(struct ifnet *, u_long, caddr_t);
+extern int ether_output(struct ifnet *,
+ struct mbuf *, struct sockaddr *, struct route *);
+extern int ether_output_frame(struct ifnet *, struct mbuf *);
+extern char *ether_sprintf(const u_int8_t *);
+void ether_vlan_mtap(struct bpf_if *, struct mbuf *,
+ void *, u_int);
+struct mbuf *ether_vlanencap(struct mbuf *, uint16_t);
+
+#else /* _KERNEL */
+
+#include <sys/cdefs.h>
+
+/*
+ * Ethernet address conversion/parsing routines.
+ */
+__BEGIN_DECLS
+struct ether_addr *ether_aton(const char *);
+struct ether_addr *ether_aton_r(const char *, struct ether_addr *);
+int ether_hostton(const char *, struct ether_addr *);
+int ether_line(const char *, struct ether_addr *, char *);
+char *ether_ntoa(const struct ether_addr *);
+char *ether_ntoa_r(const struct ether_addr *, char *);
+int ether_ntohost(char *, const struct ether_addr *);
+__END_DECLS
+
+#endif /* !_KERNEL */
+
+#endif /* !_NET_ETHERNET_H_ */
diff --git a/freebsd/sys/net/fddi.h b/freebsd/sys/net/fddi.h
index 03deabff..71e3b6fb 100644
--- a/freebsd/sys/net/fddi.h
+++ b/freebsd/sys/net/fddi.h
@@ -36,8 +36,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET_IF_FDDI_HH_
-#define _NETINET_IF_FDDI_HH_
+#ifndef _NETINET_IF_FDDI_H_
+#define _NETINET_IF_FDDI_H_
#define FDDIIPMTU 4352
#define FDDIMTU 4470
@@ -102,4 +102,4 @@ void fddi_ifdetach(struct ifnet *, int);
int fddi_ioctl(struct ifnet *, u_long, caddr_t);
#endif /* _KERNEL */
-#endif /* _NET_FDDI_HH_ */
+#endif /* _NET_FDDI_H_ */
diff --git a/freebsd/sys/net/firewire.h b/freebsd/sys/net/firewire.h
index 5411dbf8..bab71a58 100644
--- a/freebsd/sys/net/firewire.h
+++ b/freebsd/sys/net/firewire.h
@@ -26,8 +26,8 @@
* $FreeBSD$
*/
-#ifndef _NET_FIREWIRE_HH_
-#define _NET_FIREWIRE_HH_
+#ifndef _NET_FIREWIRE_H_
+#define _NET_FIREWIRE_H_
#define FW_ENCAP_UNFRAG 0
#define FW_ENCAP_FIRST 1
@@ -139,4 +139,4 @@ extern int firewire_ioctl(struct ifnet *, u_long, caddr_t);
#endif /* !_KERNEL */
-#endif /* !_NET_FIREWIRE_HH_ */
+#endif /* !_NET_FIREWIRE_H_ */
diff --git a/freebsd/sys/net/flowtable.h b/freebsd/sys/net/flowtable.h
index c4a09659..6e79a3cf 100644
--- a/freebsd/sys/net/flowtable.h
+++ b/freebsd/sys/net/flowtable.h
@@ -29,8 +29,8 @@ $FreeBSD$
***************************************************************************/
-#ifndef _NET_FLOWTABLE_HH_
-#define _NET_FLOWTABLE_HH_
+#ifndef _NET_FLOWTABLE_H_
+#define _NET_FLOWTABLE_H_
#ifdef _KERNEL
diff --git a/freebsd/sys/net/ieee8023ad_lacp.c b/freebsd/sys/net/ieee8023ad_lacp.c
index 75c0d9ea..6e06ffe5 100644
--- a/freebsd/sys/net/ieee8023ad_lacp.c
+++ b/freebsd/sys/net/ieee8023ad_lacp.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $NetBSD: ieee8023ad_lacp.c,v 1.3 2005/12/11 12:24:54 christos Exp $ */
@@ -29,29 +29,29 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h> /* hz */
-#include <freebsd/sys/socket.h> /* for net/if.h */
-#include <freebsd/sys/sockio.h>
-#include <freebsd/machine/stdarg.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/rwlock.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/if_types.h>
-
-#include <freebsd/net/if_lagg.h>
-#include <freebsd/net/ieee8023ad_lacp.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/callout.h>
+#include <sys/mbuf.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h> /* hz */
+#include <sys/socket.h> /* for net/if.h */
+#include <sys/sockio.h>
+#include <machine/stdarg.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/rwlock.h>
+
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/ethernet.h>
+#include <net/if_media.h>
+#include <net/if_types.h>
+
+#include <net/if_lagg.h>
+#include <net/ieee8023ad_lacp.h>
/*
* actor system priority and port priority.
diff --git a/freebsd/sys/net/if.c b/freebsd/sys/net/if.c
index 33d9ed9d..e52f3963 100644
--- a/freebsd/sys/net/if.c
+++ b/freebsd/sys/net/if.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1980, 1986, 1993
@@ -32,66 +32,66 @@
* $FreeBSD$
*/
-#include <freebsd/local/opt_compat.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_inet.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/conf.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/sbuf.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/refcount.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/taskqueue.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/machine/stdarg.h>
-#include <freebsd/vm/uma.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_arp.h>
-#include <freebsd/net/if_clone.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_var.h>
-#include <freebsd/net/radix.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
+#include <rtems/bsd/local/opt_compat.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_inet.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/conf.h>
+#include <sys/malloc.h>
+#include <sys/sbuf.h>
+#include <sys/bus.h>
+#include <sys/mbuf.h>
+#include <sys/systm.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/protosw.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/refcount.h>
+#include <sys/module.h>
+#include <sys/rwlock.h>
+#include <sys/sockio.h>
+#include <sys/syslog.h>
+#include <sys/sysctl.h>
+#include <sys/taskqueue.h>
+#include <sys/domain.h>
+#include <sys/jail.h>
+#include <machine/stdarg.h>
+#include <vm/uma.h>
+
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <net/if_clone.h>
+#include <net/if_dl.h>
+#include <net/if_types.h>
+#include <net/if_var.h>
+#include <net/radix.h>
+#include <net/route.h>
+#include <net/vnet.h>
#if defined(INET) || defined(INET6)
/*XXX*/
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip_carp.h>
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/ip_carp.h>
#ifdef INET6
-#include <freebsd/netinet6/in6_var.h>
-#include <freebsd/netinet6/in6_ifattach.h>
+#include <netinet6/in6_var.h>
+#include <netinet6/in6_ifattach.h>
#endif
#endif
#ifdef INET
-#include <freebsd/netinet/if_ether.h>
+#include <netinet/if_ether.h>
#endif
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
#ifdef COMPAT_FREEBSD32
-#include <freebsd/sys/mount.h>
-#include <freebsd/compat/freebsd32/freebsd32.h>
+#include <sys/mount.h>
+#include <compat/freebsd32/freebsd32.h>
#endif
struct ifindex_entry {
@@ -1820,7 +1820,7 @@ done:
return (ifa);
}
-#include <freebsd/net/if_llatbl.h>
+#include <net/if_llatbl.h>
/*
* Default action when installing a route with a Link Level gateway.
diff --git a/freebsd/sys/net/if.h b/freebsd/sys/net/if.h
index 6fbbb34a..865513bb 100644
--- a/freebsd/sys/net/if.h
+++ b/freebsd/sys/net/if.h
@@ -1,2 +1,470 @@
-#include <freebsd/bsd.h>
-#include <freebsd/net/if.h>
+/*-
+ * Copyright (c) 1982, 1986, 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)if.h 8.1 (Berkeley) 6/10/93
+ * $FreeBSD$
+ */
+
+#ifndef _NET_IF_H_
+#define _NET_IF_H_
+
+#include <sys/cdefs.h>
+
+#ifdef _KERNEL
+#include <sys/queue.h>
+#endif
+
+#if __BSD_VISIBLE
+
+#ifdef __rtems__
+#include <rtems/bsd/sys/time.h>
+#else
+#ifndef _KERNEL
+/*
+ * <net/if.h> does not depend on <sys/time.h> on most other systems. This
+ * helps userland compatibility. (struct timeval ifi_lastchange)
+ */
+#include <rtems/bsd/sys/time.h>
+#endif
+#endif /* __rtems__ */
+
+struct ifnet;
+#endif
+
+/*
+ * Length of interface external name, including terminating '\0'.
+ * Note: this is the same size as a generic device's external name.
+ */
+#define IF_NAMESIZE 16
+#if __BSD_VISIBLE
+#define IFNAMSIZ IF_NAMESIZE
+#define IF_MAXUNIT 0x7fff /* historical value */
+#endif
+#if __BSD_VISIBLE
+
+/*
+ * Structure used to query names of interface cloners.
+ */
+
+struct if_clonereq {
+ int ifcr_total; /* total cloners (out) */
+ int ifcr_count; /* room for this many in user buffer */
+ char *ifcr_buffer; /* buffer for cloner names */
+};
+
+/*
+ * Structure describing information about an interface
+ * which may be of interest to management entities.
+ */
+struct if_data {
+ /* generic interface information */
+ u_char ifi_type; /* ethernet, tokenring, etc */
+ u_char ifi_physical; /* e.g., AUI, Thinnet, 10base-T, etc */
+ u_char ifi_addrlen; /* media address length */
+ u_char ifi_hdrlen; /* media header length */
+ u_char ifi_link_state; /* current link state */
+ u_char ifi_spare_char1; /* spare byte */
+ u_char ifi_spare_char2; /* spare byte */
+ u_char ifi_datalen; /* length of this data struct */
+ u_long ifi_mtu; /* maximum transmission unit */
+ u_long ifi_metric; /* routing metric (external only) */
+ u_long ifi_baudrate; /* linespeed */
+ /* volatile statistics */
+ u_long ifi_ipackets; /* packets received on interface */
+ u_long ifi_ierrors; /* input errors on interface */
+ u_long ifi_opackets; /* packets sent on interface */
+ u_long ifi_oerrors; /* output errors on interface */
+ u_long ifi_collisions; /* collisions on csma interfaces */
+ u_long ifi_ibytes; /* total number of octets received */
+ u_long ifi_obytes; /* total number of octets sent */
+ u_long ifi_imcasts; /* packets received via multicast */
+ u_long ifi_omcasts; /* packets sent via multicast */
+ u_long ifi_iqdrops; /* dropped on input, this interface */
+ u_long ifi_noproto; /* destined for unsupported protocol */
+ u_long ifi_hwassist; /* HW offload capabilities, see IFCAP */
+ time_t ifi_epoch; /* uptime at attach or stat reset */
+ struct timeval ifi_lastchange; /* time of last administrative change */
+};
+
+/*-
+ * Interface flags are of two types: network stack owned flags, and driver
+ * owned flags. Historically, these values were stored in the same ifnet
+ * flags field, but with the advent of fine-grained locking, they have been
+ * broken out such that the network stack is responsible for synchronizing
+ * the stack-owned fields, and the device driver the device-owned fields.
+ * Both halves can perform lockless reads of the other half's field, subject
+ * to accepting the involved races.
+ *
+ * Both sets of flags come from the same number space, and should not be
+ * permitted to conflict, as they are exposed to user space via a single
+ * field.
+ *
+ * The following symbols identify read and write requirements for fields:
+ *
+ * (i) if_flags field set by device driver before attach, read-only there
+ * after.
+ * (n) if_flags field written only by the network stack, read by either the
+ * stack or driver.
+ * (d) if_drv_flags field written only by the device driver, read by either
+ * the stack or driver.
+ */
+#define IFF_UP 0x1 /* (n) interface is up */
+#define IFF_BROADCAST 0x2 /* (i) broadcast address valid */
+#define IFF_DEBUG 0x4 /* (n) turn on debugging */
+#define IFF_LOOPBACK 0x8 /* (i) is a loopback net */
+#define IFF_POINTOPOINT 0x10 /* (i) is a point-to-point link */
+#define IFF_SMART 0x20 /* (i) interface manages own routes */
+#define IFF_DRV_RUNNING 0x40 /* (d) resources allocated */
+#define IFF_NOARP 0x80 /* (n) no address resolution protocol */
+#define IFF_PROMISC 0x100 /* (n) receive all packets */
+#define IFF_ALLMULTI 0x200 /* (n) receive all multicast packets */
+#define IFF_DRV_OACTIVE 0x400 /* (d) tx hardware queue is full */
+#define IFF_SIMPLEX 0x800 /* (i) can't hear own transmissions */
+#define IFF_LINK0 0x1000 /* per link layer defined bit */
+#define IFF_LINK1 0x2000 /* per link layer defined bit */
+#define IFF_LINK2 0x4000 /* per link layer defined bit */
+#define IFF_ALTPHYS IFF_LINK2 /* use alternate physical connection */
+#define IFF_MULTICAST 0x8000 /* (i) supports multicast */
+/* 0x10000 */
+#define IFF_PPROMISC 0x20000 /* (n) user-requested promisc mode */
+#define IFF_MONITOR 0x40000 /* (n) user-requested monitor mode */
+#define IFF_STATICARP 0x80000 /* (n) static ARP */
+#define IFF_DYING 0x200000 /* (n) interface is winding down */
+#define IFF_RENAMING 0x400000 /* (n) interface is being renamed */
+
+/*
+ * Old names for driver flags so that user space tools can continue to use
+ * the old (portable) names.
+ */
+#ifndef _KERNEL
+#define IFF_RUNNING IFF_DRV_RUNNING
+#define IFF_OACTIVE IFF_DRV_OACTIVE
+#endif
+
+/* flags set internally only: */
+#define IFF_CANTCHANGE \
+ (IFF_BROADCAST|IFF_POINTOPOINT|IFF_DRV_RUNNING|IFF_DRV_OACTIVE|\
+ IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI|IFF_SMART|IFF_PROMISC|\
+ IFF_DYING)
+
+/*
+ * Values for if_link_state.
+ */
+#define LINK_STATE_UNKNOWN 0 /* link invalid/unknown */
+#define LINK_STATE_DOWN 1 /* link is down */
+#define LINK_STATE_UP 2 /* link is up */
+
+/*
+ * Some convenience macros used for setting ifi_baudrate.
+ * XXX 1000 vs. 1024? --thorpej@netbsd.org
+ */
+#define IF_Kbps(x) ((x) * 1000) /* kilobits/sec. */
+#define IF_Mbps(x) (IF_Kbps((x) * 1000)) /* megabits/sec. */
+#define IF_Gbps(x) (IF_Mbps((x) * 1000)) /* gigabits/sec. */
+
+/*
+ * Capabilities that interfaces can advertise.
+ *
+ * struct ifnet.if_capabilities
+ * contains the optional features & capabilities a particular interface
+ * supports (not only the driver but also the detected hw revision).
+ * Capabilities are defined by IFCAP_* below.
+ * struct ifnet.if_capenable
+ * contains the enabled (either by default or through ifconfig) optional
+ * features & capabilities on this interface.
+ * Capabilities are defined by IFCAP_* below.
+ * struct if_data.ifi_hwassist in mbuf CSUM_ flag form, controlled by above
+ * contains the enabled optional feature & capabilites that can be used
+ * individually per packet and are specified in the mbuf pkthdr.csum_flags
+ * field. IFCAP_* and CSUM_* do not match one to one and CSUM_* may be
+ * more detailed or differenciated than IFCAP_*.
+ * Hwassist features are defined CSUM_* in sys/mbuf.h
+ */
+#define IFCAP_RXCSUM 0x00001 /* can offload checksum on RX */
+#define IFCAP_TXCSUM 0x00002 /* can offload checksum on TX */
+#define IFCAP_NETCONS 0x00004 /* can be a network console */
+#define IFCAP_VLAN_MTU 0x00008 /* VLAN-compatible MTU */
+#define IFCAP_VLAN_HWTAGGING 0x00010 /* hardware VLAN tag support */
+#define IFCAP_JUMBO_MTU 0x00020 /* 9000 byte MTU supported */
+#define IFCAP_POLLING 0x00040 /* driver supports polling */
+#define IFCAP_VLAN_HWCSUM 0x00080 /* can do IFCAP_HWCSUM on VLANs */
+#define IFCAP_TSO4 0x00100 /* can do TCP Segmentation Offload */
+#define IFCAP_TSO6 0x00200 /* can do TCP6 Segmentation Offload */
+#define IFCAP_LRO 0x00400 /* can do Large Receive Offload */
+#define IFCAP_WOL_UCAST 0x00800 /* wake on any unicast frame */
+#define IFCAP_WOL_MCAST 0x01000 /* wake on any multicast frame */
+#define IFCAP_WOL_MAGIC 0x02000 /* wake on any Magic Packet */
+#define IFCAP_TOE4 0x04000 /* interface can offload TCP */
+#define IFCAP_TOE6 0x08000 /* interface can offload TCP6 */
+#define IFCAP_VLAN_HWFILTER 0x10000 /* interface hw can filter vlan tag */
+#define IFCAP_POLLING_NOCOUNT 0x20000 /* polling ticks cannot be fragmented */
+#define IFCAP_VLAN_HWTSO 0x40000 /* can do IFCAP_TSO on VLANs */
+#define IFCAP_LINKSTATE 0x80000 /* the runtime link state is dynamic */
+
+#define IFCAP_HWCSUM (IFCAP_RXCSUM | IFCAP_TXCSUM)
+#define IFCAP_TSO (IFCAP_TSO4 | IFCAP_TSO6)
+#define IFCAP_WOL (IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC)
+#define IFCAP_TOE (IFCAP_TOE4 | IFCAP_TOE6)
+
+#define IFQ_MAXLEN 50
+#define IFNET_SLOWHZ 1 /* granularity is 1 second */
+
+/*
+ * Message format for use in obtaining information about interfaces
+ * from getkerninfo and the routing socket
+ */
+struct if_msghdr {
+ u_short ifm_msglen; /* to skip over non-understood messages */
+ u_char ifm_version; /* future binary compatibility */
+ u_char ifm_type; /* message type */
+ int ifm_addrs; /* like rtm_addrs */
+ int ifm_flags; /* value of if_flags */
+ u_short ifm_index; /* index for associated ifp */
+ struct if_data ifm_data;/* statistics and other data about if */
+};
+
+/*
+ * Message format for use in obtaining information about interface addresses
+ * from getkerninfo and the routing socket
+ */
+struct ifa_msghdr {
+ u_short ifam_msglen; /* to skip over non-understood messages */
+ u_char ifam_version; /* future binary compatibility */
+ u_char ifam_type; /* message type */
+ int ifam_addrs; /* like rtm_addrs */
+ int ifam_flags; /* value of ifa_flags */
+ u_short ifam_index; /* index for associated ifp */
+ int ifam_metric; /* value of ifa_metric */
+};
+
+/*
+ * Message format for use in obtaining information about multicast addresses
+ * from the routing socket
+ */
+struct ifma_msghdr {
+ u_short ifmam_msglen; /* to skip over non-understood messages */
+ u_char ifmam_version; /* future binary compatibility */
+ u_char ifmam_type; /* message type */
+ int ifmam_addrs; /* like rtm_addrs */
+ int ifmam_flags; /* value of ifa_flags */
+ u_short ifmam_index; /* index for associated ifp */
+};
+
+/*
+ * Message format announcing the arrival or departure of a network interface.
+ */
+struct if_announcemsghdr {
+ u_short ifan_msglen; /* to skip over non-understood messages */
+ u_char ifan_version; /* future binary compatibility */
+ u_char ifan_type; /* message type */
+ u_short ifan_index; /* index for associated ifp */
+ char ifan_name[IFNAMSIZ]; /* if name, e.g. "en0" */
+ u_short ifan_what; /* what type of announcement */
+};
+
+#define IFAN_ARRIVAL 0 /* interface arrival */
+#define IFAN_DEPARTURE 1 /* interface departure */
+
+/*
+ * Buffer with length to be used in SIOCGIFDESCR/SIOCSIFDESCR requests
+ */
+struct ifreq_buffer {
+ size_t length;
+ void *buffer;
+};
+
+/*
+ * Interface request structure used for socket
+ * ioctl's. All interface ioctl's must have parameter
+ * definitions which begin with ifr_name. The
+ * remainder may be interface specific.
+ */
+struct ifreq {
+ char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */
+ union {
+ struct sockaddr ifru_addr;
+ struct sockaddr ifru_dstaddr;
+ struct sockaddr ifru_broadaddr;
+ struct ifreq_buffer ifru_buffer;
+ short ifru_flags[2];
+ short ifru_index;
+ int ifru_jid;
+ int ifru_metric;
+ int ifru_mtu;
+ int ifru_phys;
+ int ifru_media;
+ caddr_t ifru_data;
+ int ifru_cap[2];
+ } ifr_ifru;
+#define ifr_addr ifr_ifru.ifru_addr /* address */
+#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */
+#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
+#define ifr_buffer ifr_ifru.ifru_buffer /* user supplied buffer with its length */
+#define ifr_flags ifr_ifru.ifru_flags[0] /* flags (low 16 bits) */
+#define ifr_flagshigh ifr_ifru.ifru_flags[1] /* flags (high 16 bits) */
+#define ifr_jid ifr_ifru.ifru_jid /* jail/vnet */
+#define ifr_metric ifr_ifru.ifru_metric /* metric */
+#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
+#define ifr_phys ifr_ifru.ifru_phys /* physical wire */
+#define ifr_media ifr_ifru.ifru_media /* physical media */
+#define ifr_data ifr_ifru.ifru_data /* for use by interface */
+#define ifr_reqcap ifr_ifru.ifru_cap[0] /* requested capabilities */
+#define ifr_curcap ifr_ifru.ifru_cap[1] /* current capabilities */
+#define ifr_index ifr_ifru.ifru_index /* interface index */
+};
+
+#define _SIZEOF_ADDR_IFREQ(ifr) \
+ ((ifr).ifr_addr.sa_len > sizeof(struct sockaddr) ? \
+ (sizeof(struct ifreq) - sizeof(struct sockaddr) + \
+ (ifr).ifr_addr.sa_len) : sizeof(struct ifreq))
+
+struct ifaliasreq {
+ char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */
+ struct sockaddr ifra_addr;
+ struct sockaddr ifra_broadaddr;
+ struct sockaddr ifra_mask;
+};
+
+struct ifmediareq {
+ char ifm_name[IFNAMSIZ]; /* if name, e.g. "en0" */
+ int ifm_current; /* current media options */
+ int ifm_mask; /* don't care mask */
+ int ifm_status; /* media status */
+ int ifm_active; /* active options */
+ int ifm_count; /* # entries in ifm_ulist array */
+ int *ifm_ulist; /* media words */
+};
+
+struct ifdrv {
+ char ifd_name[IFNAMSIZ]; /* if name, e.g. "en0" */
+ unsigned long ifd_cmd;
+ size_t ifd_len;
+ void *ifd_data;
+};
+
+/*
+ * Structure used to retrieve aux status data from interfaces.
+ * Kernel suppliers to this interface should respect the formatting
+ * needed by ifconfig(8): each line starts with a TAB and ends with
+ * a newline. The canonical example to copy and paste is in if_tun.c.
+ */
+
+#define IFSTATMAX 800 /* 10 lines of text */
+struct ifstat {
+ char ifs_name[IFNAMSIZ]; /* if name, e.g. "en0" */
+ char ascii[IFSTATMAX + 1];
+};
+
+/*
+ * Structure used in SIOCGIFCONF request.
+ * Used to retrieve interface configuration
+ * for machine (useful for programs which
+ * must know all networks accessible).
+ */
+struct ifconf {
+ int ifc_len; /* size of associated buffer */
+ union {
+ caddr_t ifcu_buf;
+ struct ifreq *ifcu_req;
+ } ifc_ifcu;
+#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
+#define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */
+};
+
+/*
+ * interface groups
+ */
+
+#define IFG_ALL "all" /* group contains all interfaces */
+/* XXX: will we implement this? */
+#define IFG_EGRESS "egress" /* if(s) default route(s) point to */
+
+struct ifg_req {
+ union {
+ char ifgrqu_group[IFNAMSIZ];
+ char ifgrqu_member[IFNAMSIZ];
+ } ifgrq_ifgrqu;
+#define ifgrq_group ifgrq_ifgrqu.ifgrqu_group
+#define ifgrq_member ifgrq_ifgrqu.ifgrqu_member
+};
+
+/*
+ * Used to lookup groups for an interface
+ */
+struct ifgroupreq {
+ char ifgr_name[IFNAMSIZ];
+ u_int ifgr_len;
+ union {
+ char ifgru_group[IFNAMSIZ];
+ struct ifg_req *ifgru_groups;
+ } ifgr_ifgru;
+#define ifgr_group ifgr_ifgru.ifgru_group
+#define ifgr_groups ifgr_ifgru.ifgru_groups
+};
+
+/*
+ * Structure for SIOC[AGD]LIFADDR
+ */
+struct if_laddrreq {
+ char iflr_name[IFNAMSIZ];
+ u_int flags;
+#define IFLR_PREFIX 0x8000 /* in: prefix given out: kernel fills id */
+ u_int prefixlen; /* in/out */
+ struct sockaddr_storage addr; /* in/out */
+ struct sockaddr_storage dstaddr; /* out */
+};
+
+#endif /* __BSD_VISIBLE */
+
+#ifdef _KERNEL
+#ifdef MALLOC_DECLARE
+MALLOC_DECLARE(M_IFADDR);
+MALLOC_DECLARE(M_IFMADDR);
+#endif
+#endif
+
+#ifndef _KERNEL
+struct if_nameindex {
+ unsigned int if_index; /* 1, 2, ... */
+ char *if_name; /* null terminated name: "le0", ... */
+};
+
+__BEGIN_DECLS
+void if_freenameindex(struct if_nameindex *);
+char *if_indextoname(unsigned int, char *);
+struct if_nameindex *if_nameindex(void);
+unsigned int if_nametoindex(const char *);
+__END_DECLS
+#endif
+
+#ifdef _KERNEL
+/* XXX - this should go away soon. */
+#include <net/if_var.h>
+#endif
+
+#endif /* !_NET_IF_H_ */
diff --git a/freebsd/sys/net/if_arc.h b/freebsd/sys/net/if_arc.h
index 6be5d4e1..88a72403 100644
--- a/freebsd/sys/net/if_arc.h
+++ b/freebsd/sys/net/if_arc.h
@@ -33,8 +33,8 @@
* @(#)if_ether.h 8.1 (Berkeley) 6/10/93
*/
-#ifndef _NET_IF_ARC_HH_
-#define _NET_IF_ARC_HH_
+#ifndef _NET_IF_ARC_H_
+#define _NET_IF_ARC_H_
/*
* Arcnet address - 1 octets
@@ -140,4 +140,4 @@ void arc_frag_init(struct ifnet *);
struct mbuf * arc_frag_next(struct ifnet *);
#endif
-#endif /* _NET_IF_ARC_HH_ */
+#endif /* _NET_IF_ARC_H_ */
diff --git a/freebsd/sys/net/if_arcsubr.c b/freebsd/sys/net/if_arcsubr.c
index 8cd53a6d..dc75b445 100644
--- a/freebsd/sys/net/if_arcsubr.c
+++ b/freebsd/sys/net/if_arcsubr.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $NetBSD: if_arcsubr.c,v 1.36 2001/06/14 05:44:23 itojun Exp $ */
/* $FreeBSD$ */
@@ -40,47 +40,47 @@
* @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93
*
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipx.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/syslog.h>
-
-#include <freebsd/machine/cpu.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_arc.h>
-#include <freebsd/net/if_arp.h>
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/if_llatbl.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipx.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/syslog.h>
+
+#include <machine/cpu.h>
+
+#include <net/if.h>
+#include <net/netisr.h>
+#include <net/route.h>
+#include <net/if_dl.h>
+#include <net/if_types.h>
+#include <net/if_arc.h>
+#include <net/if_arp.h>
+#include <net/bpf.h>
+#include <net/if_llatbl.h>
#if defined(INET) || defined(INET6)
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/if_ether.h>
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/if_ether.h>
#endif
#ifdef INET6
-#include <freebsd/netinet6/nd6.h>
+#include <netinet6/nd6.h>
#endif
#ifdef IPX
-#include <freebsd/netipx/ipx.h>
-#include <freebsd/netipx/ipx_if.h>
+#include <netipx/ipx.h>
+#include <netipx/ipx_if.h>
#endif
#define ARCNET_ALLOW_BROKEN_ARP
diff --git a/freebsd/sys/net/if_arp.h b/freebsd/sys/net/if_arp.h
index 2ad9fffb..2bb63582 100644
--- a/freebsd/sys/net/if_arp.h
+++ b/freebsd/sys/net/if_arp.h
@@ -1,2 +1,138 @@
-#include <freebsd/bsd.h>
-#include <freebsd/net/if_arp.h>
+/*-
+ * Copyright (c) 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)if_arp.h 8.1 (Berkeley) 6/10/93
+ * $FreeBSD$
+ */
+
+#ifndef _NET_IF_ARP_H_
+#define _NET_IF_ARP_H_
+
+/*
+ * Address Resolution Protocol.
+ *
+ * See RFC 826 for protocol description. ARP packets are variable
+ * in size; the arphdr structure defines the fixed-length portion.
+ * Protocol type values are the same as those for 10 Mb/s Ethernet.
+ * It is followed by the variable-sized fields ar_sha, arp_spa,
+ * arp_tha and arp_tpa in that order, according to the lengths
+ * specified. Field names used correspond to RFC 826.
+ */
+struct arphdr {
+ u_short ar_hrd; /* format of hardware address */
+#define ARPHRD_ETHER 1 /* ethernet hardware format */
+#define ARPHRD_IEEE802 6 /* token-ring hardware format */
+#define ARPHRD_ARCNET 7 /* arcnet hardware format */
+#define ARPHRD_FRELAY 15 /* frame relay hardware format */
+#define ARPHRD_IEEE1394 24 /* firewire hardware format */
+ u_short ar_pro; /* format of protocol address */
+ u_char ar_hln; /* length of hardware address */
+ u_char ar_pln; /* length of protocol address */
+ u_short ar_op; /* one of: */
+#define ARPOP_REQUEST 1 /* request to resolve address */
+#define ARPOP_REPLY 2 /* response to previous request */
+#define ARPOP_REVREQUEST 3 /* request protocol address given hardware */
+#define ARPOP_REVREPLY 4 /* response giving protocol address */
+#define ARPOP_INVREQUEST 8 /* request to identify peer */
+#define ARPOP_INVREPLY 9 /* response identifying peer */
+/*
+ * The remaining fields are variable in size,
+ * according to the sizes above.
+ */
+#ifdef COMMENT_ONLY
+ u_char ar_sha[]; /* sender hardware address */
+ u_char ar_spa[]; /* sender protocol address */
+ u_char ar_tha[]; /* target hardware address */
+ u_char ar_tpa[]; /* target protocol address */
+#endif
+};
+
+#define ar_sha(ap) (((caddr_t)((ap)+1)) + 0)
+#define ar_spa(ap) (((caddr_t)((ap)+1)) + (ap)->ar_hln)
+#define ar_tha(ap) (((caddr_t)((ap)+1)) + (ap)->ar_hln + (ap)->ar_pln)
+#define ar_tpa(ap) (((caddr_t)((ap)+1)) + 2*(ap)->ar_hln + (ap)->ar_pln)
+
+#define arphdr_len2(ar_hln, ar_pln) \
+ (sizeof(struct arphdr) + 2*(ar_hln) + 2*(ar_pln))
+#define arphdr_len(ap) (arphdr_len2((ap)->ar_hln, (ap)->ar_pln))
+
+/*
+ * ARP ioctl request
+ */
+struct arpreq {
+ struct sockaddr arp_pa; /* protocol address */
+ struct sockaddr arp_ha; /* hardware address */
+ int arp_flags; /* flags */
+};
+/* arp_flags and at_flags field values */
+#define ATF_INUSE 0x01 /* entry in use */
+#define ATF_COM 0x02 /* completed entry (enaddr valid) */
+#define ATF_PERM 0x04 /* permanent entry */
+#define ATF_PUBL 0x08 /* publish entry (respond for other host) */
+#define ATF_USETRAILERS 0x10 /* has requested trailers */
+
+#ifdef _KERNEL
+/*
+ * Structure shared between the ethernet driver modules and
+ * the address resolution code.
+ */
+struct arpcom {
+ struct ifnet *ac_ifp; /* network-visible interface */
+ void *ac_netgraph; /* ng_ether(4) netgraph node info */
+};
+#define IFP2AC(ifp) ((struct arpcom *)(ifp->if_l2com))
+#define AC2IFP(ac) ((ac)->ac_ifp)
+
+#endif /* _KERNEL */
+
+struct arpstat {
+ /* Normal things that happen: */
+ u_long txrequests; /* # of ARP requests sent by this host. */
+ u_long txreplies; /* # of ARP replies sent by this host. */
+ u_long rxrequests; /* # of ARP requests received by this host. */
+ u_long rxreplies; /* # of ARP replies received by this host. */
+ u_long received; /* # of ARP packets received by this host. */
+
+ u_long arp_spares[4]; /* For either the upper or lower half. */
+ /* Abnormal event and error counting: */
+ u_long dropped; /* # of packets dropped waiting for a reply. */
+ u_long timeouts; /* # of times with entries removed */
+ /* due to timeout. */
+ u_long dupips; /* # of duplicate IPs detected. */
+};
+
+/*
+ * In-kernel consumers can use these accessor macros directly to update
+ * stats.
+ */
+#define ARPSTAT_ADD(name, val) V_arpstat.name += (val)
+#define ARPSTAT_SUB(name, val) V_arpstat.name -= (val)
+#define ARPSTAT_INC(name) ARPSTAT_ADD(name, 1)
+#define ARPSTAT_DEC(name) ARPSTAT_SUB(name, 1)
+
+#endif /* !_NET_IF_ARP_H_ */
diff --git a/freebsd/sys/net/if_atmsubr.c b/freebsd/sys/net/if_atmsubr.c
index 7daa347f..747bc936 100644
--- a/freebsd/sys/net/if_atmsubr.c
+++ b/freebsd/sys/net/if_atmsubr.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $NetBSD: if_atmsubr.c,v 1.10 1997/03/11 23:19:51 chuck Exp $ */
@@ -36,42 +36,42 @@
* if_atmsubr.c
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_natm.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/malloc.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_atm.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/if_atm.h>
-#include <freebsd/netinet/if_ether.h> /* XXX: for ETHERTYPE_* */
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_natm.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/sysctl.h>
+#include <sys/malloc.h>
+
+#include <net/if.h>
+#include <net/netisr.h>
+#include <net/route.h>
+#include <net/if_dl.h>
+#include <net/if_types.h>
+#include <net/if_atm.h>
+
+#include <netinet/in.h>
+#include <netinet/if_atm.h>
+#include <netinet/if_ether.h> /* XXX: for ETHERTYPE_* */
#if defined(INET) || defined(INET6)
-#include <freebsd/netinet/in_var.h>
+#include <netinet/in_var.h>
#endif
#ifdef NATM
-#include <freebsd/netnatm/natm.h>
+#include <netnatm/natm.h>
#endif
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
/*
* Netgraph interface functions.
diff --git a/freebsd/sys/net/if_bridge.c b/freebsd/sys/net/if_bridge.c
index de7aea04..5c15a78f 100644
--- a/freebsd/sys/net/if_bridge.c
+++ b/freebsd/sys/net/if_bridge.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $NetBSD: if_bridge.c,v 1.31 2005/06/01 19:45:34 jdc Exp $ */
@@ -76,64 +76,64 @@
* consider heterogenous bridges).
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/socket.h> /* for net/if.h */
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/ctype.h> /* string functions */
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/random.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/vm/uma.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/rwlock.h>
-
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_clone.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_var.h>
-#include <freebsd/net/pfil.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h> /* for struct arpcom */
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/mbuf.h>
+#include <sys/malloc.h>
+#include <sys/protosw.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/socket.h> /* for net/if.h */
+#include <sys/sockio.h>
+#include <sys/ctype.h> /* string functions */
+#include <sys/kernel.h>
+#include <sys/random.h>
+#include <sys/syslog.h>
+#include <sys/sysctl.h>
+#include <vm/uma.h>
+#include <sys/module.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/rwlock.h>
+
+#include <net/bpf.h>
+#include <net/if.h>
+#include <net/if_clone.h>
+#include <net/if_dl.h>
+#include <net/if_types.h>
+#include <net/if_var.h>
+#include <net/pfil.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h> /* for struct arpcom */
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
#endif
#if defined(INET) || defined(INET6)
-#include <freebsd/netinet/ip_carp.h>
+#include <netinet/ip_carp.h>
#endif
-#include <freebsd/machine/in_cksum.h>
-#include <freebsd/netinet/if_ether.h> /* for struct arpcom */
-#include <freebsd/net/bridgestp.h>
-#include <freebsd/net/if_bridgevar.h>
-#include <freebsd/net/if_llc.h>
-#include <freebsd/net/if_vlan_var.h>
-
-#include <freebsd/net/route.h>
-#include <freebsd/netinet/ip_fw.h>
-#include <freebsd/netinet/ipfw/ip_fw_private.h>
+#include <machine/in_cksum.h>
+#include <netinet/if_ether.h> /* for struct arpcom */
+#include <net/bridgestp.h>
+#include <net/if_bridgevar.h>
+#include <net/if_llc.h>
+#include <net/if_vlan_var.h>
+
+#include <net/route.h>
+#include <netinet/ip_fw.h>
+#include <netinet/ipfw/ip_fw_private.h>
/*
* Size of the route hash table. Must be a power of two.
diff --git a/freebsd/sys/net/if_bridgevar.h b/freebsd/sys/net/if_bridgevar.h
index 642cc98d..3210c03b 100644
--- a/freebsd/sys/net/if_bridgevar.h
+++ b/freebsd/sys/net/if_bridgevar.h
@@ -74,9 +74,9 @@
* Data structure and control definitions for bridge interfaces.
*/
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/condvar.h>
+#include <sys/callout.h>
+#include <sys/queue.h>
+#include <sys/condvar.h>
/*
* Commands used in the SIOCSDRVSPEC ioctl. Note the lookup of the
diff --git a/freebsd/sys/net/if_clone.c b/freebsd/sys/net/if_clone.c
index aca1276f..af0a9ea4 100644
--- a/freebsd/sys/net/if_clone.c
+++ b/freebsd/sys/net/if_clone.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1980, 1986, 1993
@@ -32,26 +32,26 @@
* $FreeBSD$
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/limits.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/socket.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_clone.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/malloc.h>
+#include <sys/limits.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/socket.h>
+
+#include <net/if.h>
+#include <net/if_clone.h>
#if 0
-#include <freebsd/net/if_dl.h>
+#include <net/if_dl.h>
#endif
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_var.h>
-#include <freebsd/net/radix.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
+#include <net/if_types.h>
+#include <net/if_var.h>
+#include <net/radix.h>
+#include <net/route.h>
+#include <net/vnet.h>
static void if_clone_free(struct if_clone *ifc);
static int if_clone_createif(struct if_clone *ifc, char *name, size_t len,
diff --git a/freebsd/sys/net/if_clone.h b/freebsd/sys/net/if_clone.h
index 67de320b..f125f8b5 100644
--- a/freebsd/sys/net/if_clone.h
+++ b/freebsd/sys/net/if_clone.h
@@ -30,8 +30,8 @@
* $FreeBSD$
*/
-#ifndef _NET_IF_CLONE_HH_
-#define _NET_IF_CLONE_HH_
+#ifndef _NET_IF_CLONE_H_
+#define _NET_IF_CLONE_H_
#ifdef _KERNEL
@@ -113,4 +113,4 @@ int ifc_simple_destroy(struct if_clone *, struct ifnet *);
#endif /* _KERNEL */
-#endif /* !_NET_IF_CLONE_HH_ */
+#endif /* !_NET_IF_CLONE_H_ */
diff --git a/freebsd/sys/net/if_dead.c b/freebsd/sys/net/if_dead.c
index dcceaf25..c6453c37 100644
--- a/freebsd/sys/net/if_dead.c
+++ b/freebsd/sys/net/if_dead.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2009 Robert N. M. Watson
@@ -33,15 +33,15 @@
* returned.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_var.h>
+#include <net/if.h>
+#include <net/if_var.h>
static int
ifdead_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa,
diff --git a/freebsd/sys/net/if_disc.c b/freebsd/sys/net/if_disc.c
index 09918bb4..54336eb8 100644
--- a/freebsd/sys/net/if_disc.c
+++ b/freebsd/sys/net/if_disc.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1993
@@ -37,23 +37,23 @@
* (Based on the loopback.)
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_clone.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/bpf.h>
-
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+
+#include <net/if.h>
+#include <net/if_clone.h>
+#include <net/if_types.h>
+#include <net/route.h>
+#include <net/bpf.h>
+
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
#ifdef TINY_DSMTU
#define DSMTU (1024+512)
diff --git a/freebsd/sys/net/if_dl.h b/freebsd/sys/net/if_dl.h
index ad29f1de..8d88623d 100644
--- a/freebsd/sys/net/if_dl.h
+++ b/freebsd/sys/net/if_dl.h
@@ -1,2 +1,82 @@
-#include <freebsd/bsd.h>
-#include <freebsd/net/if_dl.h>
+/*-
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)if_dl.h 8.1 (Berkeley) 6/10/93
+ * $FreeBSD$
+ */
+
+#ifndef _NET_IF_DL_H_
+#define _NET_IF_DL_H_
+
+/*
+ * A Link-Level Sockaddr may specify the interface in one of two
+ * ways: either by means of a system-provided index number (computed
+ * anew and possibly differently on every reboot), or by a human-readable
+ * string such as "il0" (for managerial convenience).
+ *
+ * Census taking actions, such as something akin to SIOCGCONF would return
+ * both the index and the human name.
+ *
+ * High volume transactions (such as giving a link-level ``from'' address
+ * in a recvfrom or recvmsg call) may be likely only to provide the indexed
+ * form, (which requires fewer copy operations and less space).
+ *
+ * The form and interpretation of the link-level address is purely a matter
+ * of convention between the device driver and its consumers; however, it is
+ * expected that all drivers for an interface of a given if_type will agree.
+ */
+
+/*
+ * Structure of a Link-Level sockaddr:
+ */
+struct sockaddr_dl {
+ u_char sdl_len; /* Total length of sockaddr */
+ u_char sdl_family; /* AF_LINK */
+ u_short sdl_index; /* if != 0, system given index for interface */
+ u_char sdl_type; /* interface type */
+ u_char sdl_nlen; /* interface name length, no trailing 0 reqd. */
+ u_char sdl_alen; /* link level address length */
+ u_char sdl_slen; /* link layer selector length */
+ char sdl_data[46]; /* minimum work area, can be larger;
+ contains both if name and ll address */
+};
+
+#define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen))
+
+#ifndef _KERNEL
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+void link_addr(const char *, struct sockaddr_dl *);
+char *link_ntoa(const struct sockaddr_dl *);
+__END_DECLS
+
+#endif /* !_KERNEL */
+
+#endif
diff --git a/freebsd/sys/net/if_edsc.c b/freebsd/sys/net/if_edsc.c
index 89618ce5..71160354 100644
--- a/freebsd/sys/net/if_edsc.c
+++ b/freebsd/sys/net/if_edsc.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1993
@@ -37,21 +37,21 @@
* Mimics an Ethernet device so that VLANs can be attached to it etc.
*/
-#include <freebsd/sys/param.h> /* types, important constants */
-#include <freebsd/sys/kernel.h> /* SYSINIT for load-time initializations */
-#include <freebsd/sys/malloc.h> /* malloc(9) */
-#include <freebsd/sys/module.h> /* module(9) */
-#include <freebsd/sys/mbuf.h> /* mbuf(9) */
-#include <freebsd/sys/socket.h> /* struct ifreq */
-#include <freebsd/sys/sockio.h> /* socket ioctl's */
-/* #include <freebsd/sys/systm.h> if you need printf(9) or other all-purpose globals */
-
-#include <freebsd/net/bpf.h> /* bpf(9) */
-#include <freebsd/net/ethernet.h> /* Ethernet related constants and types */
-#include <freebsd/net/if.h> /* basic part of ifnet(9) */
-#include <freebsd/net/if_clone.h> /* network interface cloning */
-#include <freebsd/net/if_types.h> /* IFT_ETHER and friends */
-#include <freebsd/net/if_var.h> /* kernel-only part of ifnet(9) */
+#include <rtems/bsd/sys/param.h> /* types, important constants */
+#include <sys/kernel.h> /* SYSINIT for load-time initializations */
+#include <sys/malloc.h> /* malloc(9) */
+#include <sys/module.h> /* module(9) */
+#include <sys/mbuf.h> /* mbuf(9) */
+#include <sys/socket.h> /* struct ifreq */
+#include <sys/sockio.h> /* socket ioctl's */
+/* #include <sys/systm.h> if you need printf(9) or other all-purpose globals */
+
+#include <net/bpf.h> /* bpf(9) */
+#include <net/ethernet.h> /* Ethernet related constants and types */
+#include <net/if.h> /* basic part of ifnet(9) */
+#include <net/if_clone.h> /* network interface cloning */
+#include <net/if_types.h> /* IFT_ETHER and friends */
+#include <net/if_var.h> /* kernel-only part of ifnet(9) */
/*
* Software configuration of an interface specific to this device type.
diff --git a/freebsd/sys/net/if_ef.c b/freebsd/sys/net/if_ef.c
index 8114806c..ced792c3 100644
--- a/freebsd/sys/net/if_ef.c
+++ b/freebsd/sys/net/if_ef.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1999, 2000 Boris Popov
@@ -28,39 +28,39 @@
* $FreeBSD$
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_ipx.h>
-#include <freebsd/local/opt_ef.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
-
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if_llc.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_arp.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/vnet.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_ipx.h>
+#include <rtems/bsd/local/opt_ef.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/sockio.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/syslog.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+
+#include <net/ethernet.h>
+#include <net/if_llc.h>
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <net/if_dl.h>
+#include <net/if_types.h>
+#include <net/netisr.h>
+#include <net/bpf.h>
+#include <net/vnet.h>
#ifdef INET
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/if_ether.h>
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/if_ether.h>
#endif
#ifdef IPX
-#include <freebsd/netipx/ipx.h>
-#include <freebsd/netipx/ipx_if.h>
+#include <netipx/ipx.h>
+#include <netipx/ipx_if.h>
#endif
/* If none of the supported layers is enabled explicitly enable them all */
diff --git a/freebsd/sys/net/if_enc.c b/freebsd/sys/net/if_enc.c
index 6bbb6ceb..017d707c 100644
--- a/freebsd/sys/net/if_enc.c
+++ b/freebsd/sys/net/if_enc.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2006 The FreeBSD Project.
@@ -29,42 +29,42 @@
* $FreeBSD$
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/machine/bus.h>
-#include <freebsd/sys/rman.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_clone.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/pfil.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/local/opt_inet6.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <machine/bus.h>
+#include <sys/rman.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/sysctl.h>
+
+#include <net/if.h>
+#include <net/if_clone.h>
+#include <net/if_types.h>
+#include <net/pfil.h>
+#include <net/route.h>
+#include <net/netisr.h>
+#include <net/bpf.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+#include <netinet/in_var.h>
+#include <rtems/bsd/local/opt_inet6.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
#endif
-#include <freebsd/local/opt_enc.h>
-#include <freebsd/netipsec/ipsec.h>
-#include <freebsd/netipsec/xform.h>
+#include <rtems/bsd/local/opt_enc.h>
+#include <netipsec/ipsec.h>
+#include <netipsec/xform.h>
#define ENCMTU (1024+512)
diff --git a/freebsd/sys/net/if_epair.c b/freebsd/sys/net/if_epair.c
index 65baeab8..e49ac84e 100644
--- a/freebsd/sys/net/if_epair.c
+++ b/freebsd/sys/net/if_epair.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2008 The FreeBSD Foundation
@@ -49,29 +49,29 @@
* For now let the user handle that case.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/refcount.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/smp.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/types.h>
-
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_clone.h>
-#include <freebsd/net/if_var.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/vnet.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <sys/refcount.h>
+#include <sys/queue.h>
+#include <sys/smp.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/sysctl.h>
+#include <rtems/bsd/sys/types.h>
+
+#include <net/bpf.h>
+#include <net/ethernet.h>
+#include <net/if.h>
+#include <net/if_clone.h>
+#include <net/if_var.h>
+#include <net/if_types.h>
+#include <net/netisr.h>
+#include <net/vnet.h>
#define EPAIRNAME "epair"
diff --git a/freebsd/sys/net/if_ethersubr.c b/freebsd/sys/net/if_ethersubr.c
index d87ebbd0..02a5d002 100644
--- a/freebsd/sys/net/if_ethersubr.c
+++ b/freebsd/sys/net/if_ethersubr.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1989, 1993
@@ -32,57 +32,57 @@
* $FreeBSD$
*/
-#include <freebsd/local/opt_atalk.h>
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipx.h>
-#include <freebsd/local/opt_netgraph.h>
-#include <freebsd/local/opt_mbuf_profiling.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/random.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_arp.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/if_llc.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if_bridgevar.h>
-#include <freebsd/net/if_vlan_var.h>
-#include <freebsd/net/if_llatbl.h>
-#include <freebsd/net/pf_mtag.h>
-#include <freebsd/net/vnet.h>
+#include <rtems/bsd/local/opt_atalk.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipx.h>
+#include <rtems/bsd/local/opt_netgraph.h>
+#include <rtems/bsd/local/opt_mbuf_profiling.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/mbuf.h>
+#include <sys/random.h>
+#include <sys/rwlock.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/sysctl.h>
+
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <net/netisr.h>
+#include <net/route.h>
+#include <net/if_llc.h>
+#include <net/if_dl.h>
+#include <net/if_types.h>
+#include <net/bpf.h>
+#include <net/ethernet.h>
+#include <net/if_bridgevar.h>
+#include <net/if_vlan_var.h>
+#include <net/if_llatbl.h>
+#include <net/pf_mtag.h>
+#include <net/vnet.h>
#if defined(INET) || defined(INET6)
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/if_ether.h>
-#include <freebsd/netinet/ip_carp.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_fw.h>
-#include <freebsd/netinet/ipfw/ip_fw_private.h>
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/if_ether.h>
+#include <netinet/ip_carp.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_fw.h>
+#include <netinet/ipfw/ip_fw_private.h>
#endif
#ifdef INET6
-#include <freebsd/netinet6/nd6.h>
+#include <netinet6/nd6.h>
#endif
#ifdef IPX
-#include <freebsd/netipx/ipx.h>
-#include <freebsd/netipx/ipx_if.h>
+#include <netipx/ipx.h>
+#include <netipx/ipx_if.h>
#endif
int (*ef_inputp)(struct ifnet*, struct ether_header *eh, struct mbuf *m);
@@ -90,9 +90,9 @@ int (*ef_outputp)(struct ifnet *ifp, struct mbuf **mp,
struct sockaddr *dst, short *tp, int *hlen);
#ifdef NETATALK
-#include <freebsd/netatalk/at.h>
-#include <freebsd/netatalk/at_var.h>
-#include <freebsd/netatalk/at_extern.h>
+#include <netatalk/at.h>
+#include <netatalk/at_var.h>
+#include <netatalk/at_extern.h>
#define llc_snap_org_code llc_un.type_snap.org_code
#define llc_snap_ether_type llc_un.type_snap.ether_type
@@ -101,7 +101,7 @@ extern u_char at_org_code[3];
extern u_char aarp_org_code[3];
#endif /* NETATALK */
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
#ifdef CTASSERT
CTASSERT(sizeof (struct ether_header) == ETHER_ADDR_LEN * 2 + 2);
diff --git a/freebsd/sys/net/if_faith.c b/freebsd/sys/net/if_faith.c
index c8989922..d99e16ea 100644
--- a/freebsd/sys/net/if_faith.c
+++ b/freebsd/sys/net/if_faith.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $KAME: if_faith.c,v 1.23 2001/12/17 13:55:29 sumikawa Exp $ */
@@ -41,44 +41,44 @@
/*
* Loopback interface driver for protocol testing and timing.
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/malloc.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_clone.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/vnet.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <sys/socket.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/sockio.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/malloc.h>
+
+#include <net/if.h>
+#include <net/if_clone.h>
+#include <net/if_types.h>
+#include <net/netisr.h>
+#include <net/route.h>
+#include <net/bpf.h>
+#include <net/vnet.h>
#ifdef INET
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/ip.h>
#endif
#ifdef INET6
#ifndef INET
-#include <freebsd/netinet/in.h>
+#include <netinet/in.h>
#endif
-#include <freebsd/netinet6/in6_var.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
+#include <netinet6/in6_var.h>
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
#endif
#define FAITHNAME "faith"
diff --git a/freebsd/sys/net/if_fddisubr.c b/freebsd/sys/net/if_fddisubr.c
index fc9f27e1..ba4db83f 100644
--- a/freebsd/sys/net/if_fddisubr.c
+++ b/freebsd/sys/net/if_fddisubr.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1995, 1996
@@ -38,60 +38,60 @@
* $FreeBSD$
*/
-#include <freebsd/local/opt_atalk.h>
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipx.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_llc.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_llatbl.h>
-
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/fddi.h>
+#include <rtems/bsd/local/opt_atalk.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipx.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/if_llc.h>
+#include <net/if_types.h>
+#include <net/if_llatbl.h>
+
+#include <net/ethernet.h>
+#include <net/netisr.h>
+#include <net/route.h>
+#include <net/bpf.h>
+#include <net/fddi.h>
#if defined(INET) || defined(INET6)
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/if_ether.h>
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/if_ether.h>
#endif
#ifdef INET6
-#include <freebsd/netinet6/nd6.h>
+#include <netinet6/nd6.h>
#endif
#ifdef IPX
-#include <freebsd/netipx/ipx.h>
-#include <freebsd/netipx/ipx_if.h>
+#include <netipx/ipx.h>
+#include <netipx/ipx_if.h>
#endif
#ifdef DECNET
-#include <freebsd/netdnet/dn.h>
+#include <netdnet/dn.h>
#endif
#ifdef NETATALK
-#include <freebsd/netatalk/at.h>
-#include <freebsd/netatalk/at_var.h>
-#include <freebsd/netatalk/at_extern.h>
+#include <netatalk/at.h>
+#include <netatalk/at_var.h>
+#include <netatalk/at_extern.h>
extern u_char at_org_code[ 3 ];
extern u_char aarp_org_code[ 3 ];
#endif /* NETATALK */
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
static const u_char fddibroadcastaddr[FDDI_ADDR_LEN] =
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
diff --git a/freebsd/sys/net/if_fwsubr.c b/freebsd/sys/net/if_fwsubr.c
index d084bea4..a9931419 100644
--- a/freebsd/sys/net/if_fwsubr.c
+++ b/freebsd/sys/net/if_fwsubr.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2004 Doug Rabson
@@ -32,38 +32,38 @@
* $FreeBSD$
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/if_llc.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/firewire.h>
-#include <freebsd/net/if_llatbl.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+
+#include <net/if.h>
+#include <net/netisr.h>
+#include <net/route.h>
+#include <net/if_llc.h>
+#include <net/if_dl.h>
+#include <net/if_types.h>
+#include <net/bpf.h>
+#include <net/firewire.h>
+#include <net/if_llatbl.h>
#if defined(INET) || defined(INET6)
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/if_ether.h>
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/if_ether.h>
#endif
#ifdef INET6
-#include <freebsd/netinet6/nd6.h>
+#include <netinet6/nd6.h>
#endif
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
MALLOC_DEFINE(M_FWCOM, "fw_com", "firewire interface internals");
diff --git a/freebsd/sys/net/if_gif.c b/freebsd/sys/net/if_gif.c
index be67500a..b6c6111c 100644
--- a/freebsd/sys/net/if_gif.c
+++ b/freebsd/sys/net/if_gif.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/* $KAME: if_gif.c,v 1.87 2001/10/19 08:50:27 itojun Exp $ */
@@ -32,62 +32,62 @@
* SUCH DAMAGE.
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/conf.h>
-#include <freebsd/machine/cpu.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_clone.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <rtems/bsd/sys/errno.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/sysctl.h>
+#include <sys/syslog.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/protosw.h>
+#include <sys/conf.h>
+#include <machine/cpu.h>
+
+#include <net/if.h>
+#include <net/if_clone.h>
+#include <net/if_types.h>
+#include <net/netisr.h>
+#include <net/route.h>
+#include <net/bpf.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
#ifdef INET
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/in_gif.h>
-#include <freebsd/netinet/ip_var.h>
+#include <netinet/in_var.h>
+#include <netinet/in_gif.h>
+#include <netinet/ip_var.h>
#endif /* INET */
#ifdef INET6
#ifndef INET
-#include <freebsd/netinet/in.h>
+#include <netinet/in.h>
#endif
-#include <freebsd/netinet6/in6_var.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/scope6_var.h>
-#include <freebsd/netinet6/in6_gif.h>
-#include <freebsd/netinet6/ip6protosw.h>
+#include <netinet6/in6_var.h>
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/scope6_var.h>
+#include <netinet6/in6_gif.h>
+#include <netinet6/ip6protosw.h>
#endif /* INET6 */
-#include <freebsd/netinet/ip_encap.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if_bridgevar.h>
-#include <freebsd/net/if_gif.h>
+#include <netinet/ip_encap.h>
+#include <net/ethernet.h>
+#include <net/if_bridgevar.h>
+#include <net/if_gif.h>
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
#define GIFNAME "gif"
diff --git a/freebsd/sys/net/if_gif.h b/freebsd/sys/net/if_gif.h
index 14f06fd6..a2f214c5 100644
--- a/freebsd/sys/net/if_gif.h
+++ b/freebsd/sys/net/if_gif.h
@@ -34,15 +34,15 @@
* if_gif.h
*/
-#ifndef _NET_IF_GIF_HH_
-#define _NET_IF_GIF_HH_
+#ifndef _NET_IF_GIF_H_
+#define _NET_IF_GIF_H_
#ifdef _KERNEL
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
-#include <freebsd/netinet/in.h>
+#include <netinet/in.h>
/* xxx sigh, why route have struct route instead of pointer? */
struct encaptab;
@@ -127,4 +127,4 @@ int gif_encapcheck(const struct mbuf *, int, int, void *);
#define GIF_SEND_REVETHIP 0x0010
#define GIF_OPTMASK (GIF_ACCEPT_REVETHIP|GIF_SEND_REVETHIP)
-#endif /* _NET_IF_GIF_HH_ */
+#endif /* _NET_IF_GIF_H_ */
diff --git a/freebsd/sys/net/if_gre.c b/freebsd/sys/net/if_gre.c
index 4a42029b..09e53e94 100644
--- a/freebsd/sys/net/if_gre.c
+++ b/freebsd/sys/net/if_gre.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $NetBSD: if_gre.c,v 1.49 2003/12/11 00:22:29 itojun Exp $ */
/* $FreeBSD$ */
@@ -50,45 +50,45 @@
* Also supported: IP in IP encaps (proto 55) as of RFC 2004
*/
-#include <freebsd/local/opt_atalk.h>
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/systm.h>
-
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_clone.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
+#include <rtems/bsd/local/opt_atalk.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/mbuf.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/sysctl.h>
+#include <sys/systm.h>
+
+#include <net/ethernet.h>
+#include <net/if.h>
+#include <net/if_clone.h>
+#include <net/if_types.h>
+#include <net/route.h>
+#include <net/vnet.h>
#ifdef INET
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_gre.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_encap.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/ip.h>
+#include <netinet/ip_gre.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_encap.h>
#else
#error "Huh? if_gre without inet?"
#endif
-#include <freebsd/net/bpf.h>
+#include <net/bpf.h>
-#include <freebsd/net/if_gre.h>
+#include <net/if_gre.h>
/*
* It is not easy to calculate the right value for a GRE MTU.
diff --git a/freebsd/sys/net/if_gre.h b/freebsd/sys/net/if_gre.h
index ff9c63cf..7ac11fce 100644
--- a/freebsd/sys/net/if_gre.h
+++ b/freebsd/sys/net/if_gre.h
@@ -40,9 +40,9 @@
#ifndef _NET_IF_GRE_H
#define _NET_IF_GRE_H
-#include <freebsd/sys/ioccom.h>
+#include <sys/ioccom.h>
#ifdef _KERNEL
-#include <freebsd/sys/queue.h>
+#include <sys/queue.h>
/*
* Version of the WCCP, need to be configured manually since
diff --git a/freebsd/sys/net/if_iso88025subr.c b/freebsd/sys/net/if_iso88025subr.c
index 87d3eb87..6a39956e 100644
--- a/freebsd/sys/net/if_iso88025subr.c
+++ b/freebsd/sys/net/if_iso88025subr.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1998, Larry Lile
@@ -42,47 +42,47 @@
*
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipx.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_arp.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_llc.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_llatbl.h>
-
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/iso88025.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipx.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <net/if_dl.h>
+#include <net/if_llc.h>
+#include <net/if_types.h>
+#include <net/if_llatbl.h>
+
+#include <net/ethernet.h>
+#include <net/netisr.h>
+#include <net/route.h>
+#include <net/bpf.h>
+#include <net/iso88025.h>
#if defined(INET) || defined(INET6)
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/if_ether.h>
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/if_ether.h>
#endif
#ifdef INET6
-#include <freebsd/netinet6/nd6.h>
+#include <netinet6/nd6.h>
#endif
#ifdef IPX
-#include <freebsd/netipx/ipx.h>
-#include <freebsd/netipx/ipx_if.h>
+#include <netipx/ipx.h>
+#include <netipx/ipx_if.h>
#endif
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
static const u_char iso88025_broadcastaddr[ISO88025_ADDR_LEN] =
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
diff --git a/freebsd/sys/net/if_lagg.c b/freebsd/sys/net/if_lagg.c
index 47c72ca2..a1c90cdf 100644
--- a/freebsd/sys/net/if_lagg.c
+++ b/freebsd/sys/net/if_lagg.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $OpenBSD: if_trunk.c,v 1.30 2007/01/31 06:20:19 reyk Exp $ */
@@ -19,55 +19,55 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/hash.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/taskqueue.h>
-#include <freebsd/sys/eventhandler.h>
-
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_clone.h>
-#include <freebsd/net/if_arp.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_llc.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_var.h>
-#include <freebsd/net/bpf.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/queue.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/sysctl.h>
+#include <sys/module.h>
+#include <sys/priv.h>
+#include <sys/systm.h>
+#include <sys/proc.h>
+#include <sys/hash.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/rwlock.h>
+#include <sys/taskqueue.h>
+#include <sys/eventhandler.h>
+
+#include <net/ethernet.h>
+#include <net/if.h>
+#include <net/if_clone.h>
+#include <net/if_arp.h>
+#include <net/if_dl.h>
+#include <net/if_llc.h>
+#include <net/if_media.h>
+#include <net/if_types.h>
+#include <net/if_var.h>
+#include <net/bpf.h>
#ifdef INET
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/if_ether.h>
-#include <freebsd/netinet/ip.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/if_ether.h>
+#include <netinet/ip.h>
#endif
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
+#include <netinet/ip6.h>
#endif
-#include <freebsd/net/if_vlan_var.h>
-#include <freebsd/net/if_lagg.h>
-#include <freebsd/net/ieee8023ad_lacp.h>
+#include <net/if_vlan_var.h>
+#include <net/if_lagg.h>
+#include <net/ieee8023ad_lacp.h>
/* Special flags we should propagate to the lagg ports. */
static struct {
diff --git a/freebsd/sys/net/if_llatbl.c b/freebsd/sys/net/if_llatbl.c
index b9f78a71..3ffcc21a 100644
--- a/freebsd/sys/net/if_llatbl.c
+++ b/freebsd/sys/net/if_llatbl.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* Copyright (c) 2004 Luigi Rizzo, Alessandro Cerri. All rights reserved.
@@ -26,41 +26,41 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_ddb.h>
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/rwlock.h>
+#include <rtems/bsd/local/opt_ddb.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/syslog.h>
+#include <sys/sysctl.h>
+#include <sys/socket.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/rwlock.h>
#ifdef DDB
-#include <freebsd/ddb/ddb.h>
+#include <ddb/ddb.h>
#endif
-#include <freebsd/vm/uma.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/net/if_llatbl.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_var.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-#include <freebsd/netinet/if_ether.h>
-#include <freebsd/netinet6/in6_var.h>
-#include <freebsd/netinet6/nd6.h>
+#include <vm/uma.h>
+
+#include <netinet/in.h>
+#include <net/if_llatbl.h>
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/if_var.h>
+#include <net/route.h>
+#include <net/vnet.h>
+#include <netinet/if_ether.h>
+#include <netinet6/in6_var.h>
+#include <netinet6/nd6.h>
MALLOC_DEFINE(M_LLTABLE, "lltable", "link level address tables");
diff --git a/freebsd/sys/net/if_llatbl.h b/freebsd/sys/net/if_llatbl.h
index 9e12362b..a4d02ab0 100644
--- a/freebsd/sys/net/if_llatbl.h
+++ b/freebsd/sys/net/if_llatbl.h
@@ -24,14 +24,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#ifndef _NET_IF_LLATBL_HH_
-#define _NET_IF_LLATBL_HH_
+#ifndef _NET_IF_LLATBL_H_
+#define _NET_IF_LLATBL_H_
-#include <freebsd/sys/_rwlock.h>
-#include <freebsd/netinet/in.h>
+#include <sys/_rwlock.h>
+#include <netinet/in.h>
struct ifnet;
struct sysctl_req;
@@ -205,4 +205,4 @@ lla_lookup(struct lltable *llt, u_int flags, const struct sockaddr *l3addr)
}
int lla_rt_output(struct rt_msghdr *, struct rt_addrinfo *);
-#endif /* _NET_IF_LLATBL_HH_ */
+#endif /* _NET_IF_LLATBL_H_ */
diff --git a/freebsd/sys/net/if_llc.h b/freebsd/sys/net/if_llc.h
index b72f21bc..0d96372e 100644
--- a/freebsd/sys/net/if_llc.h
+++ b/freebsd/sys/net/if_llc.h
@@ -32,8 +32,8 @@
* $FreeBSD$
*/
-#ifndef _NET_IF_LLC_HH_
-#define _NET_IF_LLC_HH_
+#ifndef _NET_IF_LLC_H_
+#define _NET_IF_LLC_H_
/*
* IEEE 802.2 Link Level Control headers, for use in conjunction with
@@ -158,4 +158,4 @@ CTASSERT(sizeof (struct llc) == LLC_SNAPFRAMELEN);
#define LLC_SNAP_LSAP 0xaa
#define LLC_ISO_LSAP 0xfe
-#endif /* _NET_IF_LLC_HH_ */
+#endif /* _NET_IF_LLC_H_ */
diff --git a/freebsd/sys/net/if_loop.c b/freebsd/sys/net/if_loop.c
index d80bfdad..3b36ab05 100644
--- a/freebsd/sys/net/if_loop.c
+++ b/freebsd/sys/net/if_loop.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1993
@@ -36,54 +36,54 @@
* Loopback interface driver for protocol testing and timing.
*/
-#include <freebsd/local/opt_atalk.h>
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipx.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/machine/bus.h>
-#include <freebsd/sys/rman.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_clone.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/vnet.h>
+#include <rtems/bsd/local/opt_atalk.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipx.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <machine/bus.h>
+#include <sys/rman.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/sysctl.h>
+
+#include <net/if.h>
+#include <net/if_clone.h>
+#include <net/if_types.h>
+#include <net/netisr.h>
+#include <net/route.h>
+#include <net/bpf.h>
+#include <net/vnet.h>
#ifdef INET
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
+#include <netinet/in.h>
+#include <netinet/in_var.h>
#endif
#ifdef IPX
-#include <freebsd/netipx/ipx.h>
-#include <freebsd/netipx/ipx_if.h>
+#include <netipx/ipx.h>
+#include <netipx/ipx_if.h>
#endif
#ifdef INET6
#ifndef INET
-#include <freebsd/netinet/in.h>
+#include <netinet/in.h>
#endif
-#include <freebsd/netinet6/in6_var.h>
-#include <freebsd/netinet/ip6.h>
+#include <netinet6/in6_var.h>
+#include <netinet/ip6.h>
#endif
#ifdef NETATALK
-#include <freebsd/netatalk/at.h>
-#include <freebsd/netatalk/at_var.h>
+#include <netatalk/at.h>
+#include <netatalk/at_var.h>
#endif
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
#ifdef TINY_LOMTU
#define LOMTU (1024+512)
diff --git a/freebsd/sys/net/if_media.c b/freebsd/sys/net/if_media.c
index 3da5090a..46b57b42 100644
--- a/freebsd/sys/net/if_media.c
+++ b/freebsd/sys/net/if_media.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $NetBSD: if_media.c,v 1.1 1997/03/17 02:55:15 thorpej Exp $ */
/* $FreeBSD$ */
@@ -48,16 +48,16 @@
* to implement this interface.
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
+#include <net/if.h>
+#include <net/if_media.h>
/*
* Compile-time options:
diff --git a/freebsd/sys/net/if_media.h b/freebsd/sys/net/if_media.h
index 26a3c417..337ad685 100644
--- a/freebsd/sys/net/if_media.h
+++ b/freebsd/sys/net/if_media.h
@@ -35,8 +35,8 @@
* SUCH DAMAGE.
*/
-#ifndef _NET_IF_MEDIA_HH_
-#define _NET_IF_MEDIA_HH_
+#ifndef _NET_IF_MEDIA_H_
+#define _NET_IF_MEDIA_H_
/*
* Prototypes and definitions for BSD/OS-compatible network interface
@@ -52,7 +52,7 @@
#ifdef _KERNEL
-#include <freebsd/sys/queue.h>
+#include <sys/queue.h>
/*
* Driver callbacks for media status and change requests.
@@ -689,4 +689,4 @@ struct ifmedia_status_description {
{ 0, 0, 0, \
{ NULL, NULL } } \
}
-#endif /* _NET_IF_MEDIA_HH_ */
+#endif /* _NET_IF_MEDIA_H_ */
diff --git a/freebsd/sys/net/if_mib.c b/freebsd/sys/net/if_mib.c
index ddc75df3..fe9d0e23 100644
--- a/freebsd/sys/net/if_mib.c
+++ b/freebsd/sys/net/if_mib.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright 1996 Massachusetts Institute of Technology
@@ -31,15 +31,15 @@
* $FreeBSD$
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/socket.h>
+#include <sys/sysctl.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_mib.h>
-#include <freebsd/net/vnet.h>
+#include <net/if.h>
+#include <net/if_mib.h>
+#include <net/vnet.h>
/*
* A sysctl(3) MIB for generic interface information. This information
diff --git a/freebsd/sys/net/if_sppp.h b/freebsd/sys/net/if_sppp.h
index ed406b55..97f94b39 100644
--- a/freebsd/sys/net/if_sppp.h
+++ b/freebsd/sys/net/if_sppp.h
@@ -20,8 +20,8 @@
* $FreeBSD$
*/
-#ifndef _NET_IF_SPPP_HH_
-#define _NET_IF_SPPP_HH_ 1
+#ifndef _NET_IF_SPPP_H_
+#define _NET_IF_SPPP_H_ 1
#define IDX_LCP 0 /* idx into state table */
@@ -231,4 +231,4 @@ void sppp_get_ip_addrs(struct sppp *sp, u_long *src, u_long *dst,
#endif
-#endif /* _NET_IF_SPPP_HH_ */
+#endif /* _NET_IF_SPPP_H_ */
diff --git a/freebsd/sys/net/if_spppfr.c b/freebsd/sys/net/if_spppfr.c
index fa912363..be080a7d 100644
--- a/freebsd/sys/net/if_spppfr.c
+++ b/freebsd/sys/net/if_spppfr.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Synchronous Frame Relay link level subroutines.
@@ -25,12 +25,12 @@
* $FreeBSD$
*/
-#include <freebsd/sys/param.h>
+#include <rtems/bsd/sys/param.h>
#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipx.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipx.h>
#endif
#ifdef NetBSD1_3
@@ -41,57 +41,57 @@
# endif
#endif
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/syslog.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/sockio.h>
+#include <sys/socket.h>
+#include <sys/syslog.h>
#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <freebsd/sys/random.h>
+#include <sys/random.h>
#endif
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
#if defined (__OpenBSD__)
-#include <freebsd/sys/md5k.h>
+#include <sys/md5k.h>
#else
-#include <freebsd/sys/md5.h>
+#include <sys/md5.h>
#endif
-#include <freebsd/net/if.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/route.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/net/slcompress.h>
+#include <net/if.h>
+#include <net/netisr.h>
+#include <net/if_types.h>
+#include <net/route.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <net/slcompress.h>
#if defined (__NetBSD__) || defined (__OpenBSD__)
-#include <freebsd/machine/cpu.h> /* XXX for softnet */
+#include <machine/cpu.h> /* XXX for softnet */
#endif
-#include <freebsd/machine/stdarg.h>
+#include <machine/stdarg.h>
-#include <freebsd/netinet/in_var.h>
+#include <netinet/in_var.h>
#ifdef INET
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/tcp.h>
+#include <netinet/ip.h>
+#include <netinet/tcp.h>
#endif
#if defined (__FreeBSD__) || defined (__OpenBSD__)
-# include <freebsd/netinet/if_ether.h>
+# include <netinet/if_ether.h>
#else
-# include <freebsd/net/ethertypes.h>
+# include <net/ethertypes.h>
#endif
#ifdef IPX
-#include <freebsd/netipx/ipx.h>
-#include <freebsd/netipx/ipx_if.h>
+#include <netipx/ipx.h>
+#include <netipx/ipx_if.h>
#endif
-#include <freebsd/net/if_sppp.h>
+#include <net/if_sppp.h>
/*
* Frame Relay.
diff --git a/freebsd/sys/net/if_spppsubr.c b/freebsd/sys/net/if_spppsubr.c
index 235ef7c0..d5f3487a 100644
--- a/freebsd/sys/net/if_spppsubr.c
+++ b/freebsd/sys/net/if_spppsubr.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* Synchronous PPP/Cisco/Frame Relay link level subroutines.
@@ -23,55 +23,55 @@
* $FreeBSD$
*/
-#include <freebsd/sys/param.h>
+#include <rtems/bsd/sys/param.h>
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipx.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipx.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/random.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/sockio.h>
+#include <sys/socket.h>
+#include <sys/syslog.h>
+#include <sys/random.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
-#include <freebsd/sys/md5.h>
+#include <sys/md5.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/net/slcompress.h>
+#include <net/if.h>
+#include <net/netisr.h>
+#include <net/if_types.h>
+#include <net/route.h>
+#include <net/vnet.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <net/slcompress.h>
-#include <freebsd/machine/stdarg.h>
+#include <machine/stdarg.h>
-#include <freebsd/netinet/in_var.h>
+#include <netinet/in_var.h>
#ifdef INET
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/tcp.h>
+#include <netinet/ip.h>
+#include <netinet/tcp.h>
#endif
#ifdef INET6
-#include <freebsd/netinet6/scope6_var.h>
+#include <netinet6/scope6_var.h>
#endif
-#include <freebsd/netinet/if_ether.h>
+#include <netinet/if_ether.h>
#ifdef IPX
-#include <freebsd/netipx/ipx.h>
-#include <freebsd/netipx/ipx_if.h>
+#include <netipx/ipx.h>
+#include <netipx/ipx_if.h>
#endif
-#include <freebsd/net/if_sppp.h>
+#include <net/if_sppp.h>
#define IOCTL_CMD_T u_long
#define MAXALIVECNT 3 /* max. alive packets */
diff --git a/freebsd/sys/net/if_stf.c b/freebsd/sys/net/if_stf.c
index 1cf5c408..104536fd 100644
--- a/freebsd/sys/net/if_stf.c
+++ b/freebsd/sys/net/if_stf.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/* $KAME: if_stf.c,v 1.73 2001/12/03 11:08:30 keiichi Exp $ */
@@ -76,51 +76,51 @@
* Note that there is no way to be 100% secure.
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/machine/cpu.h>
-
-#include <freebsd/sys/malloc.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_clone.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_stf.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/in_var.h>
-
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/in6_var.h>
-#include <freebsd/netinet/ip_ecn.h>
-
-#include <freebsd/netinet/ip_encap.h>
-
-#include <freebsd/machine/stdarg.h>
-
-#include <freebsd/net/bpf.h>
-
-#include <freebsd/security/mac/mac_framework.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/mbuf.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/protosw.h>
+#include <sys/proc.h>
+#include <sys/queue.h>
+#include <sys/sysctl.h>
+#include <machine/cpu.h>
+
+#include <sys/malloc.h>
+
+#include <net/if.h>
+#include <net/if_clone.h>
+#include <net/route.h>
+#include <net/netisr.h>
+#include <net/if_types.h>
+#include <net/if_stf.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+#include <netinet/in_var.h>
+
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/in6_var.h>
+#include <netinet/ip_ecn.h>
+
+#include <netinet/ip_encap.h>
+
+#include <machine/stdarg.h>
+
+#include <net/bpf.h>
+
+#include <security/mac/mac_framework.h>
SYSCTL_DECL(_net_link);
SYSCTL_NODE(_net_link, IFT_STF, stf, CTLFLAG_RW, 0, "6to4 Interface");
diff --git a/freebsd/sys/net/if_stf.h b/freebsd/sys/net/if_stf.h
index 64fd30ee..cbaf6703 100644
--- a/freebsd/sys/net/if_stf.h
+++ b/freebsd/sys/net/if_stf.h
@@ -30,9 +30,9 @@
* SUCH DAMAGE.
*/
-#ifndef _NET_IF_STF_HH_
-#define _NET_IF_STF_HH_
+#ifndef _NET_IF_STF_H_
+#define _NET_IF_STF_H_
void in_stf_input(struct mbuf *, int);
-#endif /* _NET_IF_STF_HH_ */
+#endif /* _NET_IF_STF_H_ */
diff --git a/freebsd/sys/net/if_tap.c b/freebsd/sys/net/if_tap.c
index 206302bb..9e27b809 100644
--- a/freebsd/sys/net/if_tap.c
+++ b/freebsd/sys/net/if_tap.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 1999-2000 by Maksim Yevmenkin <m_evmenkin@yahoo.com>
@@ -37,42 +37,42 @@
* $Id: if_tap.c,v 0.21 2000/07/23 21:46:02 max Exp $
*/
-#include <freebsd/local/opt_compat.h>
-#include <freebsd/local/opt_inet.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/conf.h>
-#include <freebsd/sys/fcntl.h>
-#include <freebsd/sys/filio.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/poll.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/selinfo.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/ttycom.h>
-#include <freebsd/sys/uio.h>
-#include <freebsd/sys/queue.h>
-
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_clone.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/if_types.h>
-
-#include <freebsd/netinet/in.h>
-
-#include <freebsd/net/if_tapvar.h>
-#include <freebsd/net/if_tap.h>
+#include <rtems/bsd/local/opt_compat.h>
+#include <rtems/bsd/local/opt_inet.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/conf.h>
+#include <sys/fcntl.h>
+#include <sys/filio.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <sys/poll.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/selinfo.h>
+#include <sys/signalvar.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/sysctl.h>
+#include <sys/systm.h>
+#include <sys/ttycom.h>
+#include <sys/uio.h>
+#include <sys/queue.h>
+
+#include <net/bpf.h>
+#include <net/ethernet.h>
+#include <net/if.h>
+#include <net/if_clone.h>
+#include <net/if_dl.h>
+#include <net/route.h>
+#include <net/if_types.h>
+
+#include <netinet/in.h>
+
+#include <net/if_tapvar.h>
+#include <net/if_tap.h>
#define CDEV_NAME "tap"
diff --git a/freebsd/sys/net/if_tap.h b/freebsd/sys/net/if_tap.h
index e611884b..91feb2fe 100644
--- a/freebsd/sys/net/if_tap.h
+++ b/freebsd/sys/net/if_tap.h
@@ -35,8 +35,8 @@
* $Id: if_tap.h,v 0.7 2000/07/12 04:12:51 max Exp $
*/
-#ifndef _NET_IF_TAP_HH_
-#define _NET_IF_TAP_HH_
+#ifndef _NET_IF_TAP_H_
+#define _NET_IF_TAP_H_
/* refer to if_tapvar.h for the softc stuff */
@@ -71,4 +71,4 @@ struct tapinfo {
#define VMIO_SIOCBRIDGE _IO('V', 6)
#define VMIO_SIOCNETIF _IO('V', 7)
-#endif /* !_NET_IF_TAP_HH_ */
+#endif /* !_NET_IF_TAP_H_ */
diff --git a/freebsd/sys/net/if_tapvar.h b/freebsd/sys/net/if_tapvar.h
index 4a26fd87..21bac505 100644
--- a/freebsd/sys/net/if_tapvar.h
+++ b/freebsd/sys/net/if_tapvar.h
@@ -38,8 +38,8 @@
* $Id: if_tapvar.h,v 0.6 2000/07/11 02:16:08 max Exp $
*/
-#ifndef _NET_IF_TAPVAR_HH_
-#define _NET_IF_TAPVAR_HH_
+#ifndef _NET_IF_TAPVAR_H_
+#define _NET_IF_TAPVAR_H_
/*
* tap_mtx locks tap_flags, tap_pid. tap_next locked with global tapmtx.
@@ -66,4 +66,4 @@ struct tap_softc {
struct mtx tap_mtx; /* per-softc mutex */
};
-#endif /* !_NET_IF_TAPVAR_HH_ */
+#endif /* !_NET_IF_TAPVAR_H_ */
diff --git a/freebsd/sys/net/if_tun.c b/freebsd/sys/net/if_tun.c
index 7f90fa51..a6b86600 100644
--- a/freebsd/sys/net/if_tun.c
+++ b/freebsd/sys/net/if_tun.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $NetBSD: if_tun.c,v 1.14 1994/06/29 06:36:25 cgd Exp $ */
@@ -18,50 +18,50 @@
* $FreeBSD$
*/
-#include <freebsd/local/opt_atalk.h>
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipx.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/fcntl.h>
-#include <freebsd/sys/filio.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/ttycom.h>
-#include <freebsd/sys/poll.h>
-#include <freebsd/sys/selinfo.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/filedesc.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/conf.h>
-#include <freebsd/sys/uio.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/random.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_clone.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
+#include <rtems/bsd/local/opt_atalk.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipx.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/systm.h>
+#include <sys/jail.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <sys/socket.h>
+#include <sys/fcntl.h>
+#include <sys/filio.h>
+#include <sys/sockio.h>
+#include <sys/ttycom.h>
+#include <sys/poll.h>
+#include <sys/selinfo.h>
+#include <sys/signalvar.h>
+#include <sys/filedesc.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
+#include <sys/conf.h>
+#include <sys/uio.h>
+#include <sys/malloc.h>
+#include <sys/random.h>
+
+#include <net/if.h>
+#include <net/if_clone.h>
+#include <net/if_types.h>
+#include <net/netisr.h>
+#include <net/route.h>
+#include <net/vnet.h>
#ifdef INET
-#include <freebsd/netinet/in.h>
+#include <netinet/in.h>
#endif
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/if_tun.h>
+#include <net/bpf.h>
+#include <net/if_tun.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/condvar.h>
+#include <sys/queue.h>
+#include <sys/condvar.h>
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
/*
* tun_list is protected by global tunmtx. Other mutable fields are
diff --git a/freebsd/sys/net/if_tun.h b/freebsd/sys/net/if_tun.h
index 29718cda..382881cb 100644
--- a/freebsd/sys/net/if_tun.h
+++ b/freebsd/sys/net/if_tun.h
@@ -16,8 +16,8 @@
* $FreeBSD$
*/
-#ifndef _NET_IF_TUN_HH_
-#define _NET_IF_TUN_HH_
+#ifndef _NET_IF_TUN_H_
+#define _NET_IF_TUN_H_
/* Refer to if_tunvar.h for the softc stuff */
@@ -45,4 +45,4 @@ struct tuninfo {
#define TUNSIFHEAD _IOW('t', 96, int)
#define TUNGIFHEAD _IOR('t', 97, int)
-#endif /* !_NET_IF_TUN_HH_ */
+#endif /* !_NET_IF_TUN_H_ */
diff --git a/freebsd/sys/net/if_types.h b/freebsd/sys/net/if_types.h
index 1d4f2b2a..b2d3a159 100644
--- a/freebsd/sys/net/if_types.h
+++ b/freebsd/sys/net/if_types.h
@@ -1,2 +1,254 @@
-#include <freebsd/bsd.h>
-#include <freebsd/net/if_types.h>
+/*-
+ * Copyright (c) 1989, 1993, 1994
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)if_types.h 8.3 (Berkeley) 4/28/95
+ * $FreeBSD$
+ * $NetBSD: if_types.h,v 1.16 2000/04/19 06:30:53 itojun Exp $
+ */
+
+#ifndef _NET_IF_TYPES_H_
+#define _NET_IF_TYPES_H_
+
+/*
+ * Interface types for benefit of parsing media address headers.
+ * This list is derived from the SNMP list of ifTypes, originally
+ * documented in RFC1573, now maintained as:
+ *
+ * http://www.iana.org/assignments/smi-numbers
+ */
+
+#define IFT_OTHER 0x1 /* none of the following */
+#define IFT_1822 0x2 /* old-style arpanet imp */
+#define IFT_HDH1822 0x3 /* HDH arpanet imp */
+#define IFT_X25DDN 0x4 /* x25 to imp */
+#define IFT_X25 0x5 /* PDN X25 interface (RFC877) */
+#define IFT_ETHER 0x6 /* Ethernet CSMA/CD */
+#define IFT_ISO88023 0x7 /* CMSA/CD */
+#define IFT_ISO88024 0x8 /* Token Bus */
+#define IFT_ISO88025 0x9 /* Token Ring */
+#define IFT_ISO88026 0xa /* MAN */
+#define IFT_STARLAN 0xb
+#define IFT_P10 0xc /* Proteon 10MBit ring */
+#define IFT_P80 0xd /* Proteon 80MBit ring */
+#define IFT_HY 0xe /* Hyperchannel */
+#define IFT_FDDI 0xf
+#define IFT_LAPB 0x10
+#define IFT_SDLC 0x11
+#define IFT_T1 0x12
+#define IFT_CEPT 0x13 /* E1 - european T1 */
+#define IFT_ISDNBASIC 0x14
+#define IFT_ISDNPRIMARY 0x15
+#define IFT_PTPSERIAL 0x16 /* Proprietary PTP serial */
+#define IFT_PPP 0x17 /* RFC 1331 */
+#define IFT_LOOP 0x18 /* loopback */
+#define IFT_EON 0x19 /* ISO over IP */
+#define IFT_XETHER 0x1a /* obsolete 3MB experimental ethernet */
+#define IFT_NSIP 0x1b /* XNS over IP */
+#define IFT_SLIP 0x1c /* IP over generic TTY */
+#define IFT_ULTRA 0x1d /* Ultra Technologies */
+#define IFT_DS3 0x1e /* Generic T3 */
+#define IFT_SIP 0x1f /* SMDS */
+#define IFT_FRELAY 0x20 /* Frame Relay DTE only */
+#define IFT_RS232 0x21
+#define IFT_PARA 0x22 /* parallel-port */
+#define IFT_ARCNET 0x23
+#define IFT_ARCNETPLUS 0x24
+#define IFT_ATM 0x25 /* ATM cells */
+#define IFT_MIOX25 0x26
+#define IFT_SONET 0x27 /* SONET or SDH */
+#define IFT_X25PLE 0x28
+#define IFT_ISO88022LLC 0x29
+#define IFT_LOCALTALK 0x2a
+#define IFT_SMDSDXI 0x2b
+#define IFT_FRELAYDCE 0x2c /* Frame Relay DCE */
+#define IFT_V35 0x2d
+#define IFT_HSSI 0x2e
+#define IFT_HIPPI 0x2f
+#define IFT_MODEM 0x30 /* Generic Modem */
+#define IFT_AAL5 0x31 /* AAL5 over ATM */
+#define IFT_SONETPATH 0x32
+#define IFT_SONETVT 0x33
+#define IFT_SMDSICIP 0x34 /* SMDS InterCarrier Interface */
+#define IFT_PROPVIRTUAL 0x35 /* Proprietary Virtual/internal */
+#define IFT_PROPMUX 0x36 /* Proprietary Multiplexing */
+#define IFT_IEEE80212 0x37 /* 100BaseVG */
+#define IFT_FIBRECHANNEL 0x38 /* Fibre Channel */
+#define IFT_HIPPIINTERFACE 0x39 /* HIPPI interfaces */
+#define IFT_FRAMERELAYINTERCONNECT 0x3a /* Obsolete, use either 0x20 or 0x2c */
+#define IFT_AFLANE8023 0x3b /* ATM Emulated LAN for 802.3 */
+#define IFT_AFLANE8025 0x3c /* ATM Emulated LAN for 802.5 */
+#define IFT_CCTEMUL 0x3d /* ATM Emulated circuit */
+#define IFT_FASTETHER 0x3e /* Fast Ethernet (100BaseT) */
+#define IFT_ISDN 0x3f /* ISDN and X.25 */
+#define IFT_V11 0x40 /* CCITT V.11/X.21 */
+#define IFT_V36 0x41 /* CCITT V.36 */
+#define IFT_G703AT64K 0x42 /* CCITT G703 at 64Kbps */
+#define IFT_G703AT2MB 0x43 /* Obsolete see DS1-MIB */
+#define IFT_QLLC 0x44 /* SNA QLLC */
+#define IFT_FASTETHERFX 0x45 /* Fast Ethernet (100BaseFX) */
+#define IFT_CHANNEL 0x46 /* channel */
+#define IFT_IEEE80211 0x47 /* radio spread spectrum */
+#define IFT_IBM370PARCHAN 0x48 /* IBM System 360/370 OEMI Channel */
+#define IFT_ESCON 0x49 /* IBM Enterprise Systems Connection */
+#define IFT_DLSW 0x4a /* Data Link Switching */
+#define IFT_ISDNS 0x4b /* ISDN S/T interface */
+#define IFT_ISDNU 0x4c /* ISDN U interface */
+#define IFT_LAPD 0x4d /* Link Access Protocol D */
+#define IFT_IPSWITCH 0x4e /* IP Switching Objects */
+#define IFT_RSRB 0x4f /* Remote Source Route Bridging */
+#define IFT_ATMLOGICAL 0x50 /* ATM Logical Port */
+#define IFT_DS0 0x51 /* Digital Signal Level 0 */
+#define IFT_DS0BUNDLE 0x52 /* group of ds0s on the same ds1 */
+#define IFT_BSC 0x53 /* Bisynchronous Protocol */
+#define IFT_ASYNC 0x54 /* Asynchronous Protocol */
+#define IFT_CNR 0x55 /* Combat Net Radio */
+#define IFT_ISO88025DTR 0x56 /* ISO 802.5r DTR */
+#define IFT_EPLRS 0x57 /* Ext Pos Loc Report Sys */
+#define IFT_ARAP 0x58 /* Appletalk Remote Access Protocol */
+#define IFT_PROPCNLS 0x59 /* Proprietary Connectionless Protocol*/
+#define IFT_HOSTPAD 0x5a /* CCITT-ITU X.29 PAD Protocol */
+#define IFT_TERMPAD 0x5b /* CCITT-ITU X.3 PAD Facility */
+#define IFT_FRAMERELAYMPI 0x5c /* Multiproto Interconnect over FR */
+#define IFT_X213 0x5d /* CCITT-ITU X213 */
+#define IFT_ADSL 0x5e /* Asymmetric Digital Subscriber Loop */
+#define IFT_RADSL 0x5f /* Rate-Adapt. Digital Subscriber Loop*/
+#define IFT_SDSL 0x60 /* Symmetric Digital Subscriber Loop */
+#define IFT_VDSL 0x61 /* Very H-Speed Digital Subscrib. Loop*/
+#define IFT_ISO88025CRFPINT 0x62 /* ISO 802.5 CRFP */
+#define IFT_MYRINET 0x63 /* Myricom Myrinet */
+#define IFT_VOICEEM 0x64 /* voice recEive and transMit */
+#define IFT_VOICEFXO 0x65 /* voice Foreign Exchange Office */
+#define IFT_VOICEFXS 0x66 /* voice Foreign Exchange Station */
+#define IFT_VOICEENCAP 0x67 /* voice encapsulation */
+#define IFT_VOICEOVERIP 0x68 /* voice over IP encapsulation */
+#define IFT_ATMDXI 0x69 /* ATM DXI */
+#define IFT_ATMFUNI 0x6a /* ATM FUNI */
+#define IFT_ATMIMA 0x6b /* ATM IMA */
+#define IFT_PPPMULTILINKBUNDLE 0x6c /* PPP Multilink Bundle */
+#define IFT_IPOVERCDLC 0x6d /* IBM ipOverCdlc */
+#define IFT_IPOVERCLAW 0x6e /* IBM Common Link Access to Workstn */
+#define IFT_STACKTOSTACK 0x6f /* IBM stackToStack */
+#define IFT_VIRTUALIPADDRESS 0x70 /* IBM VIPA */
+#define IFT_MPC 0x71 /* IBM multi-protocol channel support */
+#define IFT_IPOVERATM 0x72 /* IBM ipOverAtm */
+#define IFT_ISO88025FIBER 0x73 /* ISO 802.5j Fiber Token Ring */
+#define IFT_TDLC 0x74 /* IBM twinaxial data link control */
+#define IFT_GIGABITETHERNET 0x75 /* Gigabit Ethernet */
+#define IFT_HDLC 0x76 /* HDLC */
+#define IFT_LAPF 0x77 /* LAP F */
+#define IFT_V37 0x78 /* V.37 */
+#define IFT_X25MLP 0x79 /* Multi-Link Protocol */
+#define IFT_X25HUNTGROUP 0x7a /* X25 Hunt Group */
+#define IFT_TRANSPHDLC 0x7b /* Transp HDLC */
+#define IFT_INTERLEAVE 0x7c /* Interleave channel */
+#define IFT_FAST 0x7d /* Fast channel */
+#define IFT_IP 0x7e /* IP (for APPN HPR in IP networks) */
+#define IFT_DOCSCABLEMACLAYER 0x7f /* CATV Mac Layer */
+#define IFT_DOCSCABLEDOWNSTREAM 0x80 /* CATV Downstream interface */
+#define IFT_DOCSCABLEUPSTREAM 0x81 /* CATV Upstream interface */
+#define IFT_A12MPPSWITCH 0x82 /* Avalon Parallel Processor */
+#define IFT_TUNNEL 0x83 /* Encapsulation interface */
+#define IFT_COFFEE 0x84 /* coffee pot */
+#define IFT_CES 0x85 /* Circiut Emulation Service */
+#define IFT_ATMSUBINTERFACE 0x86 /* (x) ATM Sub Interface */
+#define IFT_L2VLAN 0x87 /* Layer 2 Virtual LAN using 802.1Q */
+#define IFT_L3IPVLAN 0x88 /* Layer 3 Virtual LAN - IP Protocol */
+#define IFT_L3IPXVLAN 0x89 /* Layer 3 Virtual LAN - IPX Prot. */
+#define IFT_DIGITALPOWERLINE 0x8a /* IP over Power Lines */
+#define IFT_MEDIAMAILOVERIP 0x8b /* (xxx) Multimedia Mail over IP */
+#define IFT_DTM 0x8c /* Dynamic synchronous Transfer Mode */
+#define IFT_DCN 0x8d /* Data Communications Network */
+#define IFT_IPFORWARD 0x8e /* IP Forwarding Interface */
+#define IFT_MSDSL 0x8f /* Multi-rate Symmetric DSL */
+#define IFT_IEEE1394 0x90 /* IEEE1394 High Performance SerialBus*/
+#define IFT_IFGSN 0x91 /* HIPPI-6400 */
+#define IFT_DVBRCCMACLAYER 0x92 /* DVB-RCC MAC Layer */
+#define IFT_DVBRCCDOWNSTREAM 0x93 /* DVB-RCC Downstream Channel */
+#define IFT_DVBRCCUPSTREAM 0x94 /* DVB-RCC Upstream Channel */
+#define IFT_ATMVIRTUAL 0x95 /* ATM Virtual Interface */
+#define IFT_MPLSTUNNEL 0x96 /* MPLS Tunnel Virtual Interface */
+#define IFT_SRP 0x97 /* Spatial Reuse Protocol */
+#define IFT_VOICEOVERATM 0x98 /* Voice over ATM */
+#define IFT_VOICEOVERFRAMERELAY 0x99 /* Voice Over Frame Relay */
+#define IFT_IDSL 0x9a /* Digital Subscriber Loop over ISDN */
+#define IFT_COMPOSITELINK 0x9b /* Avici Composite Link Interface */
+#define IFT_SS7SIGLINK 0x9c /* SS7 Signaling Link */
+#define IFT_PROPWIRELESSP2P 0x9d /* Prop. P2P wireless interface */
+#define IFT_FRFORWARD 0x9e /* Frame forward Interface */
+#define IFT_RFC1483 0x9f /* Multiprotocol over ATM AAL5 */
+#define IFT_USB 0xa0 /* USB Interface */
+#define IFT_IEEE8023ADLAG 0xa1 /* IEEE 802.3ad Link Aggregate*/
+#define IFT_BGPPOLICYACCOUNTING 0xa2 /* BGP Policy Accounting */
+#define IFT_FRF16MFRBUNDLE 0xa3 /* FRF.16 Multilik Frame Relay*/
+#define IFT_H323GATEKEEPER 0xa4 /* H323 Gatekeeper */
+#define IFT_H323PROXY 0xa5 /* H323 Voice and Video Proxy */
+#define IFT_MPLS 0xa6 /* MPLS */
+#define IFT_MFSIGLINK 0xa7 /* Multi-frequency signaling link */
+#define IFT_HDSL2 0xa8 /* High Bit-Rate DSL, 2nd gen. */
+#define IFT_SHDSL 0xa9 /* Multirate HDSL2 */
+#define IFT_DS1FDL 0xaa /* Facility Data Link (4Kbps) on a DS1*/
+#define IFT_POS 0xab /* Packet over SONET/SDH Interface */
+#define IFT_DVBASILN 0xac /* DVB-ASI Input */
+#define IFT_DVBASIOUT 0xad /* DVB-ASI Output */
+#define IFT_PLC 0xae /* Power Line Communications */
+#define IFT_NFAS 0xaf /* Non-Facility Associated Signaling */
+#define IFT_TR008 0xb0 /* TROO8 */
+#define IFT_GR303RDT 0xb1 /* Remote Digital Terminal */
+#define IFT_GR303IDT 0xb2 /* Integrated Digital Terminal */
+#define IFT_ISUP 0xb3 /* ISUP */
+#define IFT_PROPDOCSWIRELESSMACLAYER 0xb4 /* prop/Wireless MAC Layer */
+#define IFT_PROPDOCSWIRELESSDOWNSTREAM 0xb5 /* prop/Wireless Downstream */
+#define IFT_PROPDOCSWIRELESSUPSTREAM 0xb6 /* prop/Wireless Upstream */
+#define IFT_HIPERLAN2 0xb7 /* HIPERLAN Type 2 Radio Interface */
+#define IFT_PROPBWAP2MP 0xb8 /* PropBroadbandWirelessAccess P2MP*/
+#define IFT_SONETOVERHEADCHANNEL 0xb9 /* SONET Overhead Channel */
+#define IFT_DIGITALWRAPPEROVERHEADCHANNEL 0xba /* Digital Wrapper Overhead */
+#define IFT_AAL2 0xbb /* ATM adaptation layer 2 */
+#define IFT_RADIOMAC 0xbc /* MAC layer over radio links */
+#define IFT_ATMRADIO 0xbd /* ATM over radio links */
+#define IFT_IMT 0xbe /* Inter-Machine Trunks */
+#define IFT_MVL 0xbf /* Multiple Virtual Lines DSL */
+#define IFT_REACHDSL 0xc0 /* Long Reach DSL */
+#define IFT_FRDLCIENDPT 0xc1 /* Frame Relay DLCI End Point */
+#define IFT_ATMVCIENDPT 0xc2 /* ATM VCI End Point */
+#define IFT_OPTICALCHANNEL 0xc3 /* Optical Channel */
+#define IFT_OPTICALTRANSPORT 0xc4 /* Optical Transport */
+#define IFT_BRIDGE 0xd1 /* Transparent bridge interface */
+
+#define IFT_STF 0xd7 /* 6to4 interface */
+
+/* not based on IANA assignments */
+#define IFT_GIF 0xf0
+#define IFT_PVC 0xf1
+#define IFT_FAITH 0xf2
+#define IFT_ENC 0xf4
+#define IFT_PFLOG 0xf6
+#define IFT_PFSYNC 0xf7
+#define IFT_CARP 0xf8 /* Common Address Redundancy Protocol */
+#define IFT_IPXIP 0xf9 /* IPX over IP tunneling; no longer used. */
+#endif /* !_NET_IF_TYPES_H_ */
diff --git a/freebsd/sys/net/if_var.h b/freebsd/sys/net/if_var.h
index 913d62a9..172ebe0e 100644
--- a/freebsd/sys/net/if_var.h
+++ b/freebsd/sys/net/if_var.h
@@ -30,8 +30,8 @@
* $FreeBSD$
*/
-#ifndef _NET_IF_VAR_HH_
-#define _NET_IF_VAR_HH_
+#ifndef _NET_IF_VAR_H_
+#define _NET_IF_VAR_H_
/*
* Structures defining a network interface, providing a packet
@@ -74,24 +74,24 @@ struct route;
struct vnet;
#endif
-#include <freebsd/sys/queue.h> /* get TAILQ macros */
+#include <sys/queue.h> /* get TAILQ macros */
#ifdef _KERNEL
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/eventhandler.h>
-#include <freebsd/sys/buf_ring.h>
-#include <freebsd/net/vnet.h>
+#include <sys/mbuf.h>
+#include <sys/eventhandler.h>
+#include <sys/buf_ring.h>
+#include <net/vnet.h>
#endif /* _KERNEL */
-#include <freebsd/sys/lock.h> /* XXX */
-#include <freebsd/sys/mutex.h> /* XXX */
-#include <freebsd/sys/rwlock.h> /* XXX */
-#include <freebsd/sys/sx.h> /* XXX */
-#include <freebsd/sys/event.h> /* XXX */
-#include <freebsd/sys/_task.h>
+#include <rtems/bsd/sys/lock.h> /* XXX */
+#include <sys/mutex.h> /* XXX */
+#include <sys/rwlock.h> /* XXX */
+#include <sys/sx.h> /* XXX */
+#include <sys/event.h> /* XXX */
+#include <sys/_task.h>
#define IF_DUNIT_NONE -1
-#include <freebsd/altq/if_altq.h>
+#include <altq/if_altq.h>
TAILQ_HEAD(ifnethead, ifnet); /* we use TAILQs so that the order of */
TAILQ_HEAD(ifaddrhead, ifaddr); /* instantiation is preserved in the list */
@@ -901,4 +901,4 @@ int ether_poll_deregister(struct ifnet *ifp);
#endif /* _KERNEL */
-#endif /* !_NET_IF_VAR_HH_ */
+#endif /* !_NET_IF_VAR_H_ */
diff --git a/freebsd/sys/net/if_vlan.c b/freebsd/sys/net/if_vlan.c
index 5ae5efd4..576243d9 100644
--- a/freebsd/sys/net/if_vlan.c
+++ b/freebsd/sys/net/if_vlan.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright 1998 Massachusetts Institute of Technology
@@ -41,32 +41,32 @@
* and ask it to send them.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_vlan.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/systm.h>
-
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_clone.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_vlan_var.h>
-#include <freebsd/net/vnet.h>
+#include <rtems/bsd/local/opt_vlan.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <sys/rwlock.h>
+#include <sys/queue.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/sysctl.h>
+#include <sys/systm.h>
+
+#include <net/bpf.h>
+#include <net/ethernet.h>
+#include <net/if.h>
+#include <net/if_clone.h>
+#include <net/if_dl.h>
+#include <net/if_types.h>
+#include <net/if_vlan_var.h>
+#include <net/vnet.h>
#define VLANNAME "vlan"
#define VLAN_DEF_HWIDTH 4
diff --git a/freebsd/sys/net/if_vlan_var.h b/freebsd/sys/net/if_vlan_var.h
index 045e2fa1..ec71df1a 100644
--- a/freebsd/sys/net/if_vlan_var.h
+++ b/freebsd/sys/net/if_vlan_var.h
@@ -29,8 +29,8 @@
* $FreeBSD$
*/
-#ifndef _NET_IF_VLAN_VAR_HH_
-#define _NET_IF_VLAN_VAR_HH_ 1
+#ifndef _NET_IF_VLAN_VAR_H_
+#define _NET_IF_VLAN_VAR_H_ 1
struct ether_vlan_header {
u_char evl_dhost[ETHER_ADDR_LEN];
@@ -134,4 +134,4 @@ struct vlanreq {
extern void (*vlan_trunk_cap_p)(struct ifnet *);
#endif /* _KERNEL */
-#endif /* _NET_IF_VLAN_VAR_HH_ */
+#endif /* _NET_IF_VLAN_VAR_H_ */
diff --git a/freebsd/sys/net/iso88025.h b/freebsd/sys/net/iso88025.h
index 26e3ada6..6edd2e0b 100644
--- a/freebsd/sys/net/iso88025.h
+++ b/freebsd/sys/net/iso88025.h
@@ -40,8 +40,8 @@
* Fundamental constants relating to iso 802.5
*/
-#ifndef _NET_ISO88025_HH_
-#define _NET_ISO88025_HH_
+#ifndef _NET_ISO88025_H_
+#define _NET_ISO88025_H_
/*
* General ISO 802.5 definitions
diff --git a/freebsd/sys/net/netisr.c b/freebsd/sys/net/netisr.c
index 4d34953a..b82c1f0f 100644
--- a/freebsd/sys/net/netisr.c
+++ b/freebsd/sys/net/netisr.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2007-2009 Robert N. M. Watson
@@ -26,7 +26,7 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -61,34 +61,34 @@ __FBSDID("$FreeBSD$");
* detail in netisr.h.
*/
-#include <freebsd/local/opt_ddb.h>
-#include <freebsd/local/opt_device_polling.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/kthread.h>
-#include <freebsd/sys/interrupt.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/pcpu.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/rmlock.h>
-#include <freebsd/sys/sched.h>
-#include <freebsd/sys/smp.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/systm.h>
+#include <rtems/bsd/local/opt_ddb.h>
+#include <rtems/bsd/local/opt_device_polling.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/kthread.h>
+#include <sys/interrupt.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mbuf.h>
+#include <sys/mutex.h>
+#include <sys/pcpu.h>
+#include <sys/proc.h>
+#include <sys/rmlock.h>
+#include <sys/sched.h>
+#include <sys/smp.h>
+#include <sys/socket.h>
+#include <sys/sysctl.h>
+#include <sys/systm.h>
#ifdef DDB
-#include <freebsd/ddb/ddb.h>
+#include <ddb/ddb.h>
#endif
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_var.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/vnet.h>
+#include <net/if.h>
+#include <net/if_var.h>
+#include <net/netisr.h>
+#include <net/vnet.h>
/*-
* Synchronize use and modification of the registered netisr data structures;
diff --git a/freebsd/sys/net/netisr.h b/freebsd/sys/net/netisr.h
index b755332a..72e7f17f 100644
--- a/freebsd/sys/net/netisr.h
+++ b/freebsd/sys/net/netisr.h
@@ -26,8 +26,8 @@
* $FreeBSD$
*/
-#ifndef _NET_NETISR_HH_
-#define _NET_NETISR_HH_
+#ifndef _NET_NETISR_H_
+#define _NET_NETISR_H_
#ifdef _KERNEL
/*
@@ -153,4 +153,4 @@ void netisr_poll(void);
void netisr_pollmore(void);
#endif /* !_KERNEL */
-#endif /* !_NET_NETISR_HH_ */
+#endif /* !_NET_NETISR_H_ */
diff --git a/freebsd/sys/net/pfil.c b/freebsd/sys/net/pfil.c
index 3a382bc5..a11986a9 100644
--- a/freebsd/sys/net/pfil.c
+++ b/freebsd/sys/net/pfil.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/* $NetBSD: pfil.c,v 1.20 2001/11/12 23:49:46 lukem Exp $ */
@@ -31,23 +31,23 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/rmlock.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/queue.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/errno.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/rmlock.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/systm.h>
+#include <sys/condvar.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/proc.h>
+#include <sys/queue.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/pfil.h>
+#include <net/if.h>
+#include <net/pfil.h>
static struct mtx pfil_global_lock;
diff --git a/freebsd/sys/net/pfil.h b/freebsd/sys/net/pfil.h
index 78ab0518..142da67d 100644
--- a/freebsd/sys/net/pfil.h
+++ b/freebsd/sys/net/pfil.h
@@ -29,15 +29,15 @@
* SUCH DAMAGE.
*/
-#ifndef _NET_PFIL_HH_
-#define _NET_PFIL_HH_
+#ifndef _NET_PFIL_H_
+#define _NET_PFIL_H_
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/_lock.h>
-#include <freebsd/sys/_mutex.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/rmlock.h>
+#include <sys/systm.h>
+#include <sys/queue.h>
+#include <sys/_lock.h>
+#include <sys/_mutex.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/rmlock.h>
struct mbuf;
struct ifnet;
@@ -114,4 +114,4 @@ pfil_hook_get(int dir, struct pfil_head *ph)
return (NULL);
}
-#endif /* _NET_PFIL_HH_ */
+#endif /* _NET_PFIL_H_ */
diff --git a/freebsd/sys/net/pfkeyv2.h b/freebsd/sys/net/pfkeyv2.h
index f8e088e1..c45f8b05 100644
--- a/freebsd/sys/net/pfkeyv2.h
+++ b/freebsd/sys/net/pfkeyv2.h
@@ -36,8 +36,8 @@
* sakane@ydc.co.jp
*/
-#ifndef _NET_PFKEYV2_HH_
-#define _NET_PFKEYV2_HH_
+#ifndef _NET_PFKEYV2_H_
+#define _NET_PFKEYV2_H_
/*
This file defines structures and symbols for the PF_KEY Version 2
@@ -429,4 +429,4 @@ struct sadb_x_nat_t_frag {
#endif /* __PFKEY_V2_H */
-#endif /* _NET_PFKEYV2_HH_ */
+#endif /* _NET_PFKEYV2_H_ */
diff --git a/freebsd/sys/net/ppp_defs.h b/freebsd/sys/net/ppp_defs.h
index e0690e94..386a1763 100644
--- a/freebsd/sys/net/ppp_defs.h
+++ b/freebsd/sys/net/ppp_defs.h
@@ -28,8 +28,8 @@
* $FreeBSD$
*/
-#ifndef _PPP_DEFS_HH_
-#define _PPP_DEFS_HH_
+#ifndef _PPP_DEFS_H_
+#define _PPP_DEFS_H_
/*
* The basic PPP frame.
@@ -155,4 +155,4 @@ struct ppp_idle {
#endif
#endif
-#endif /* _PPP_DEFS_HH_ */
+#endif /* _PPP_DEFS_H_ */
diff --git a/freebsd/sys/net/radix.c b/freebsd/sys/net/radix.c
index c1881acb..e0cdea30 100644
--- a/freebsd/sys/net/radix.c
+++ b/freebsd/sys/net/radix.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1988, 1989, 1993
@@ -35,27 +35,27 @@
/*
* Routines to build and maintain radix trees for routing lookups.
*/
-#include <freebsd/sys/param.h>
+#include <rtems/bsd/sys/param.h>
#ifdef _KERNEL
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/net/radix.h>
-#include <freebsd/local/opt_mpath.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/rwlock.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/syslog.h>
+#include <net/radix.h>
+#include <rtems/bsd/local/opt_mpath.h>
#ifdef RADIX_MPATH
-#include <freebsd/net/radix_mpath.h>
+#include <net/radix_mpath.h>
#endif
#else /* !_KERNEL */
-#include <freebsd/stdio.h>
-#include <freebsd/strings.h>
-#include <freebsd/stdlib.h>
+#include <stdio.h>
+#include <strings.h>
+#include <stdlib.h>
#define log(x, arg...) fprintf(stderr, ## arg)
#define panic(x) fprintf(stderr, "PANIC: %s", x), exit(1)
#define min(a, b) ((a) < (b) ? (a) : (b) )
-#include <freebsd/net/radix.h>
+#include <net/radix.h>
#endif /* !_KERNEL */
static int rn_walktree_from(struct radix_node_head *h, void *a, void *m,
diff --git a/freebsd/sys/net/radix.h b/freebsd/sys/net/radix.h
index ccd5f491..29659b54 100644
--- a/freebsd/sys/net/radix.h
+++ b/freebsd/sys/net/radix.h
@@ -30,13 +30,13 @@
* $FreeBSD$
*/
-#ifndef _RADIX_HH_
-#define _RADIX_HH_
+#ifndef _RADIX_H_
+#define _RADIX_H_
#ifdef _KERNEL
-#include <freebsd/sys/_lock.h>
-#include <freebsd/sys/_mutex.h>
-#include <freebsd/sys/_rwlock.h>
+#include <sys/_lock.h>
+#include <sys/_mutex.h>
+#include <sys/_rwlock.h>
#endif
#ifdef MALLOC_DECLARE
@@ -173,4 +173,4 @@ struct radix_node
struct radix_node_head *head),
*rn_match(void *, struct radix_node_head *);
-#endif /* _RADIX_HH_ */
+#endif /* _RADIX_H_ */
diff --git a/freebsd/sys/net/radix_mpath.c b/freebsd/sys/net/radix_mpath.c
index 3c348249..bb7b6fd4 100644
--- a/freebsd/sys/net/radix_mpath.c
+++ b/freebsd/sys/net/radix_mpath.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $KAME: radix_mpath.c,v 1.17 2004/11/08 10:29:39 itojun Exp $ */
@@ -35,23 +35,23 @@
* PROPERTIES.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/net/radix.h>
-#include <freebsd/net/radix_mpath.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_var.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/socket.h>
+#include <sys/domain.h>
+#include <sys/syslog.h>
+#include <net/radix.h>
+#include <net/radix_mpath.h>
+#include <net/route.h>
+#include <net/if.h>
+#include <net/if_var.h>
/*
* give some jitter to hash, to avoid synchronization between routers
diff --git a/freebsd/sys/net/radix_mpath.h b/freebsd/sys/net/radix_mpath.h
index b6d8c16a..bcb210e3 100644
--- a/freebsd/sys/net/radix_mpath.h
+++ b/freebsd/sys/net/radix_mpath.h
@@ -34,8 +34,8 @@
*/
/* $FreeBSD$ */
-#ifndef _NET_RADIX_MPATH_HH_
-#define _NET_RADIX_MPATH_HH_
+#ifndef _NET_RADIX_MPATH_H_
+#define _NET_RADIX_MPATH_H_
#ifdef _KERNEL
/*
@@ -60,4 +60,4 @@ int rn6_mpath_inithead(void **, int);
#endif
-#endif /* _NET_RADIX_MPATH_HH_ */
+#endif /* _NET_RADIX_MPATH_H_ */
diff --git a/freebsd/sys/net/raw_cb.c b/freebsd/sys/net/raw_cb.c
index 2fd73dac..13f4b949 100644
--- a/freebsd/sys/net/raw_cb.c
+++ b/freebsd/sys/net/raw_cb.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1980, 1986, 1993
@@ -33,21 +33,21 @@
* $FreeBSD$
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/systm.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/domain.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/mutex.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sysctl.h>
+#include <sys/systm.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/raw_cb.h>
-#include <freebsd/net/vnet.h>
+#include <net/if.h>
+#include <net/raw_cb.h>
+#include <net/vnet.h>
/*
* Routines to manage the raw protocol control blocks.
diff --git a/freebsd/sys/net/raw_cb.h b/freebsd/sys/net/raw_cb.h
index 278b4235..35b546c5 100644
--- a/freebsd/sys/net/raw_cb.h
+++ b/freebsd/sys/net/raw_cb.h
@@ -31,10 +31,10 @@
* $FreeBSD$
*/
-#ifndef _NET_RAW_CB_HH_
-#define _NET_RAW_CB_HH_
+#ifndef _NET_RAW_CB_H_
+#define _NET_RAW_CB_H_
-#include <freebsd/sys/queue.h>
+#include <sys/queue.h>
/*
* Raw protocol interface control block. Used to tie a socket to the generic
diff --git a/freebsd/sys/net/raw_usrreq.c b/freebsd/sys/net/raw_usrreq.c
index bdf3369e..0723799f 100644
--- a/freebsd/sys/net/raw_usrreq.c
+++ b/freebsd/sys/net/raw_usrreq.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1980, 1986, 1993
@@ -33,23 +33,23 @@
* $FreeBSD$
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/systm.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/raw_cb.h>
-#include <freebsd/net/vnet.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/mutex.h>
+#include <sys/priv.h>
+#include <sys/protosw.h>
+#include <sys/signalvar.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sx.h>
+#include <sys/systm.h>
+
+#include <net/if.h>
+#include <net/raw_cb.h>
+#include <net/vnet.h>
MTX_SYSINIT(rawcb_mtx, &rawcb_mtx, "rawcb", MTX_DEF);
diff --git a/freebsd/sys/net/route.c b/freebsd/sys/net/route.c
index ee43c843..2dd2938c 100644
--- a/freebsd/sys/net/route.c
+++ b/freebsd/sys/net/route.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1980, 1986, 1991, 1993
@@ -36,38 +36,38 @@
* Which is the new name for an in kernel routing (next hop) table. *
***********************************************************************/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_route.h>
-#include <freebsd/local/opt_mrouting.h>
-#include <freebsd/local/opt_mpath.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/sysproto.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/kernel.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-#include <freebsd/net/flowtable.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_route.h>
+#include <rtems/bsd/local/opt_mrouting.h>
+#include <rtems/bsd/local/opt_mpath.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/syslog.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/sysctl.h>
+#include <sys/syslog.h>
+#include <sys/sysproto.h>
+#include <sys/proc.h>
+#include <sys/domain.h>
+#include <sys/kernel.h>
+
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/route.h>
+#include <net/vnet.h>
+#include <net/flowtable.h>
#ifdef RADIX_MPATH
-#include <freebsd/net/radix_mpath.h>
+#include <net/radix_mpath.h>
#endif
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip_mroute.h>
+#include <netinet/in.h>
+#include <netinet/ip_mroute.h>
-#include <freebsd/vm/uma.h>
+#include <vm/uma.h>
u_int rt_numfibs = RT_NUMFIBS;
SYSCTL_INT(_net, OID_AUTO, fibs, CTLFLAG_RD, &rt_numfibs, 0, "");
@@ -262,7 +262,7 @@ VNET_SYSUNINIT(vnet_route_uninit, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD,
vnet_route_uninit, 0);
#endif
-#ifndef _SYS_SYSPROTO_HH_
+#ifndef _SYS_SYSPROTO_H_
struct setfib_args {
int fibnum;
};
diff --git a/freebsd/sys/net/route.h b/freebsd/sys/net/route.h
index 4375020f..4014b3f6 100644
--- a/freebsd/sys/net/route.h
+++ b/freebsd/sys/net/route.h
@@ -1,2 +1,446 @@
-#include <freebsd/bsd.h>
-#include <freebsd/net/route.h>
+/*-
+ * Copyright (c) 1980, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)route.h 8.4 (Berkeley) 1/9/95
+ * $FreeBSD$
+ */
+
+#ifndef _NET_ROUTE_H_
+#define _NET_ROUTE_H_
+
+/*
+ * Kernel resident routing tables.
+ *
+ * The routing tables are initialized when interface addresses
+ * are set by making entries for all directly connected interfaces.
+ */
+
+/*
+ * A route consists of a destination address, a reference
+ * to a routing entry, and a reference to an llentry.
+ * These are often held by protocols in their control
+ * blocks, e.g. inpcb.
+ */
+struct route {
+ struct rtentry *ro_rt;
+ struct llentry *ro_lle;
+ struct sockaddr ro_dst;
+};
+
+/*
+ * These numbers are used by reliable protocols for determining
+ * retransmission behavior and are included in the routing structure.
+ */
+struct rt_metrics_lite {
+ u_long rmx_mtu; /* MTU for this path */
+ u_long rmx_expire; /* lifetime for route, e.g. redirect */
+ u_long rmx_pksent; /* packets sent using this route */
+ u_long rmx_weight; /* absolute weight */
+};
+
+struct rt_metrics {
+ u_long rmx_locks; /* Kernel must leave these values alone */
+ u_long rmx_mtu; /* MTU for this path */
+ u_long rmx_hopcount; /* max hops expected */
+ u_long rmx_expire; /* lifetime for route, e.g. redirect */
+ u_long rmx_recvpipe; /* inbound delay-bandwidth product */
+ u_long rmx_sendpipe; /* outbound delay-bandwidth product */
+ u_long rmx_ssthresh; /* outbound gateway buffer limit */
+ u_long rmx_rtt; /* estimated round trip time */
+ u_long rmx_rttvar; /* estimated rtt variance */
+ u_long rmx_pksent; /* packets sent using this route */
+ u_long rmx_weight; /* route weight */
+ u_long rmx_filler[3]; /* will be used for T/TCP later */
+};
+
+/*
+ * rmx_rtt and rmx_rttvar are stored as microseconds;
+ * RTTTOPRHZ(rtt) converts to a value suitable for use
+ * by a protocol slowtimo counter.
+ */
+#define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */
+#define RTTTOPRHZ(r) ((r) / (RTM_RTTUNIT / PR_SLOWHZ))
+
+/* MRT compile-time constants */
+#ifdef _KERNEL
+ #ifndef ROUTETABLES
+ #define RT_NUMFIBS 1
+ #define RT_MAXFIBS 1
+ #else
+ /* while we use 4 bits in the mbuf flags, we are limited to 16 */
+ #define RT_MAXFIBS 16
+ #if ROUTETABLES > RT_MAXFIBS
+ #define RT_NUMFIBS RT_MAXFIBS
+ #error "ROUTETABLES defined too big"
+ #else
+ #if ROUTETABLES == 0
+ #define RT_NUMFIBS 1
+ #else
+ #define RT_NUMFIBS ROUTETABLES
+ #endif
+ #endif
+ #endif
+#endif
+
+extern u_int rt_numfibs; /* number fo usable routing tables */
+extern u_int tunnel_fib; /* tunnels use these */
+extern u_int fwd_fib; /* packets being forwarded use these routes */
+/*
+ * XXX kernel function pointer `rt_output' is visible to applications.
+ */
+struct mbuf;
+
+/*
+ * We distinguish between routes to hosts and routes to networks,
+ * preferring the former if available. For each route we infer
+ * the interface to use from the gateway address supplied when
+ * the route was entered. Routes that forward packets through
+ * gateways are marked so that the output routines know to address the
+ * gateway rather than the ultimate destination.
+ */
+#ifndef RNF_NORMAL
+#include <net/radix.h>
+#ifdef RADIX_MPATH
+#include <net/radix_mpath.h>
+#endif
+#endif
+struct rtentry {
+ struct radix_node rt_nodes[2]; /* tree glue, and other values */
+ /*
+ * XXX struct rtentry must begin with a struct radix_node (or two!)
+ * because the code does some casts of a 'struct radix_node *'
+ * to a 'struct rtentry *'
+ */
+#define rt_key(r) (*((struct sockaddr **)(&(r)->rt_nodes->rn_key)))
+#define rt_mask(r) (*((struct sockaddr **)(&(r)->rt_nodes->rn_mask)))
+ struct sockaddr *rt_gateway; /* value */
+ int rt_flags; /* up/down?, host/net */
+ int rt_refcnt; /* # held references */
+ struct ifnet *rt_ifp; /* the answer: interface to use */
+ struct ifaddr *rt_ifa; /* the answer: interface address to use */
+ struct rt_metrics_lite rt_rmx; /* metrics used by rx'ing protocols */
+ u_int rt_fibnum; /* which FIB */
+#ifdef _KERNEL
+ /* XXX ugly, user apps use this definition but don't have a mtx def */
+ struct mtx rt_mtx; /* mutex for routing entry */
+#endif
+};
+
+/*
+ * Following structure necessary for 4.3 compatibility;
+ * We should eventually move it to a compat file.
+ */
+struct ortentry {
+ u_long rt_hash; /* to speed lookups */
+ struct sockaddr rt_dst; /* key */
+ struct sockaddr rt_gateway; /* value */
+ short rt_flags; /* up/down?, host/net */
+ short rt_refcnt; /* # held references */
+ u_long rt_use; /* raw # packets forwarded */
+ struct ifnet *rt_ifp; /* the answer: interface to use */
+};
+
+#define rt_use rt_rmx.rmx_pksent
+
+#define RTF_UP 0x1 /* route usable */
+#define RTF_GATEWAY 0x2 /* destination is a gateway */
+#define RTF_HOST 0x4 /* host entry (net otherwise) */
+#define RTF_REJECT 0x8 /* host or net unreachable */
+#define RTF_DYNAMIC 0x10 /* created dynamically (by redirect) */
+#define RTF_MODIFIED 0x20 /* modified dynamically (by redirect) */
+#define RTF_DONE 0x40 /* message confirmed */
+/* 0x80 unused, was RTF_DELCLONE */
+/* 0x100 unused, was RTF_CLONING */
+#define RTF_XRESOLVE 0x200 /* external daemon resolves name */
+#define RTF_LLINFO 0x400 /* DEPRECATED - exists ONLY for backward
+ compatibility */
+#define RTF_LLDATA 0x400 /* used by apps to add/del L2 entries */
+#define RTF_STATIC 0x800 /* manually added */
+#define RTF_BLACKHOLE 0x1000 /* just discard pkts (during updates) */
+#define RTF_PROTO2 0x4000 /* protocol specific routing flag */
+#define RTF_PROTO1 0x8000 /* protocol specific routing flag */
+
+/* XXX: temporary to stay API/ABI compatible with userland */
+#ifndef _KERNEL
+#define RTF_PRCLONING 0x10000 /* unused, for compatibility */
+#endif
+
+/* 0x20000 unused, was RTF_WASCLONED */
+#define RTF_PROTO3 0x40000 /* protocol specific routing flag */
+/* 0x80000 unused */
+#define RTF_PINNED 0x100000 /* future use */
+#define RTF_LOCAL 0x200000 /* route represents a local address */
+#define RTF_BROADCAST 0x400000 /* route represents a bcast address */
+#define RTF_MULTICAST 0x800000 /* route represents a mcast address */
+ /* 0x8000000 and up unassigned */
+#define RTF_STICKY 0x10000000 /* always route dst->src */
+
+#define RTF_RNH_LOCKED 0x40000000 /* radix node head is locked */
+
+/* Mask of RTF flags that are allowed to be modified by RTM_CHANGE. */
+#define RTF_FMASK \
+ (RTF_PROTO1 | RTF_PROTO2 | RTF_PROTO3 | RTF_BLACKHOLE | \
+ RTF_REJECT | RTF_STATIC | RTF_STICKY)
+
+/*
+ * Routing statistics.
+ */
+struct rtstat {
+ short rts_badredirect; /* bogus redirect calls */
+ short rts_dynamic; /* routes created by redirects */
+ short rts_newgateway; /* routes modified by redirects */
+ short rts_unreach; /* lookups which failed */
+ short rts_wildcard; /* lookups satisfied by a wildcard */
+};
+/*
+ * Structures for routing messages.
+ */
+struct rt_msghdr {
+ u_short rtm_msglen; /* to skip over non-understood messages */
+ u_char rtm_version; /* future binary compatibility */
+ u_char rtm_type; /* message type */
+ u_short rtm_index; /* index for associated ifp */
+ int rtm_flags; /* flags, incl. kern & message, e.g. DONE */
+ int rtm_addrs; /* bitmask identifying sockaddrs in msg */
+ pid_t rtm_pid; /* identify sender */
+ int rtm_seq; /* for sender to identify action */
+ int rtm_errno; /* why failed */
+ int rtm_fmask; /* bitmask used in RTM_CHANGE message */
+ u_long rtm_inits; /* which metrics we are initializing */
+ struct rt_metrics rtm_rmx; /* metrics themselves */
+};
+
+#define RTM_VERSION 5 /* Up the ante and ignore older versions */
+
+/*
+ * Message types.
+ */
+#define RTM_ADD 0x1 /* Add Route */
+#define RTM_DELETE 0x2 /* Delete Route */
+#define RTM_CHANGE 0x3 /* Change Metrics or flags */
+#define RTM_GET 0x4 /* Report Metrics */
+#define RTM_LOSING 0x5 /* Kernel Suspects Partitioning */
+#define RTM_REDIRECT 0x6 /* Told to use different route */
+#define RTM_MISS 0x7 /* Lookup failed on this address */
+#define RTM_LOCK 0x8 /* fix specified metrics */
+#define RTM_OLDADD 0x9 /* caused by SIOCADDRT */
+#define RTM_OLDDEL 0xa /* caused by SIOCDELRT */
+#define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */
+#define RTM_NEWADDR 0xc /* address being added to iface */
+#define RTM_DELADDR 0xd /* address being removed from iface */
+#define RTM_IFINFO 0xe /* iface going up/down etc. */
+#define RTM_NEWMADDR 0xf /* mcast group membership being added to if */
+#define RTM_DELMADDR 0x10 /* mcast group membership being deleted */
+#define RTM_IFANNOUNCE 0x11 /* iface arrival/departure */
+#define RTM_IEEE80211 0x12 /* IEEE80211 wireless event */
+
+/*
+ * Bitmask values for rtm_inits and rmx_locks.
+ */
+#define RTV_MTU 0x1 /* init or lock _mtu */
+#define RTV_HOPCOUNT 0x2 /* init or lock _hopcount */
+#define RTV_EXPIRE 0x4 /* init or lock _expire */
+#define RTV_RPIPE 0x8 /* init or lock _recvpipe */
+#define RTV_SPIPE 0x10 /* init or lock _sendpipe */
+#define RTV_SSTHRESH 0x20 /* init or lock _ssthresh */
+#define RTV_RTT 0x40 /* init or lock _rtt */
+#define RTV_RTTVAR 0x80 /* init or lock _rttvar */
+#define RTV_WEIGHT 0x100 /* init or lock _weight */
+
+/*
+ * Bitmask values for rtm_addrs.
+ */
+#define RTA_DST 0x1 /* destination sockaddr present */
+#define RTA_GATEWAY 0x2 /* gateway sockaddr present */
+#define RTA_NETMASK 0x4 /* netmask sockaddr present */
+#define RTA_GENMASK 0x8 /* cloning mask sockaddr present */
+#define RTA_IFP 0x10 /* interface name sockaddr present */
+#define RTA_IFA 0x20 /* interface addr sockaddr present */
+#define RTA_AUTHOR 0x40 /* sockaddr for author of redirect */
+#define RTA_BRD 0x80 /* for NEWADDR, broadcast or p-p dest addr */
+
+/*
+ * Index offsets for sockaddr array for alternate internal encoding.
+ */
+#define RTAX_DST 0 /* destination sockaddr present */
+#define RTAX_GATEWAY 1 /* gateway sockaddr present */
+#define RTAX_NETMASK 2 /* netmask sockaddr present */
+#define RTAX_GENMASK 3 /* cloning mask sockaddr present */
+#define RTAX_IFP 4 /* interface name sockaddr present */
+#define RTAX_IFA 5 /* interface addr sockaddr present */
+#define RTAX_AUTHOR 6 /* sockaddr for author of redirect */
+#define RTAX_BRD 7 /* for NEWADDR, broadcast or p-p dest addr */
+#define RTAX_MAX 8 /* size of array to allocate */
+
+struct rt_addrinfo {
+ int rti_addrs;
+ struct sockaddr *rti_info[RTAX_MAX];
+ int rti_flags;
+ struct ifaddr *rti_ifa;
+ struct ifnet *rti_ifp;
+};
+
+/*
+ * This macro returns the size of a struct sockaddr when passed
+ * through a routing socket. Basically we round up sa_len to
+ * a multiple of sizeof(long), with a minimum of sizeof(long).
+ * The check for a NULL pointer is just a convenience, probably never used.
+ * The case sa_len == 0 should only apply to empty structures.
+ */
+#define SA_SIZE(sa) \
+ ( (!(sa) || ((struct sockaddr *)(sa))->sa_len == 0) ? \
+ sizeof(long) : \
+ 1 + ( (((struct sockaddr *)(sa))->sa_len - 1) | (sizeof(long) - 1) ) )
+
+#ifdef _KERNEL
+
+#define RT_LINK_IS_UP(ifp) (!((ifp)->if_capabilities & IFCAP_LINKSTATE) \
+ || (ifp)->if_link_state == LINK_STATE_UP)
+
+#define RT_LOCK_INIT(_rt) \
+ mtx_init(&(_rt)->rt_mtx, "rtentry", NULL, MTX_DEF | MTX_DUPOK)
+#define RT_LOCK(_rt) mtx_lock(&(_rt)->rt_mtx)
+#define RT_TRYLOCK(_rt) mtx_trylock(&(_rt)->rt_mtx)
+#define RT_UNLOCK(_rt) mtx_unlock(&(_rt)->rt_mtx)
+#define RT_LOCK_DESTROY(_rt) mtx_destroy(&(_rt)->rt_mtx)
+#define RT_LOCK_ASSERT(_rt) mtx_assert(&(_rt)->rt_mtx, MA_OWNED)
+
+#define RT_ADDREF(_rt) do { \
+ RT_LOCK_ASSERT(_rt); \
+ KASSERT((_rt)->rt_refcnt >= 0, \
+ ("negative refcnt %d", (_rt)->rt_refcnt)); \
+ (_rt)->rt_refcnt++; \
+} while (0)
+
+#define RT_REMREF(_rt) do { \
+ RT_LOCK_ASSERT(_rt); \
+ KASSERT((_rt)->rt_refcnt > 0, \
+ ("bogus refcnt %d", (_rt)->rt_refcnt)); \
+ (_rt)->rt_refcnt--; \
+} while (0)
+
+#define RTFREE_LOCKED(_rt) do { \
+ if ((_rt)->rt_refcnt <= 1) \
+ rtfree(_rt); \
+ else { \
+ RT_REMREF(_rt); \
+ RT_UNLOCK(_rt); \
+ } \
+ /* guard against invalid refs */ \
+ _rt = 0; \
+} while (0)
+
+#define RTFREE(_rt) do { \
+ RT_LOCK(_rt); \
+ RTFREE_LOCKED(_rt); \
+} while (0)
+
+#define RT_TEMP_UNLOCK(_rt) do { \
+ RT_ADDREF(_rt); \
+ RT_UNLOCK(_rt); \
+} while (0)
+
+#define RT_RELOCK(_rt) do { \
+ RT_LOCK(_rt); \
+ if ((_rt)->rt_refcnt <= 1) { \
+ rtfree(_rt); \
+ _rt = 0; /* signal that it went away */ \
+ } else { \
+ RT_REMREF(_rt); \
+ /* note that _rt is still valid */ \
+ } \
+} while (0)
+
+struct radix_node_head *rt_tables_get_rnh(int, int);
+
+struct ifmultiaddr;
+
+void rt_ieee80211msg(struct ifnet *, int, void *, size_t);
+void rt_ifannouncemsg(struct ifnet *, int);
+void rt_ifmsg(struct ifnet *);
+void rt_missmsg(int, struct rt_addrinfo *, int, int);
+void rt_newaddrmsg(int, struct ifaddr *, int, struct rtentry *);
+void rt_newmaddrmsg(int, struct ifmultiaddr *);
+int rt_setgate(struct rtentry *, struct sockaddr *, struct sockaddr *);
+void rt_maskedcopy(struct sockaddr *, struct sockaddr *, struct sockaddr *);
+
+/*
+ * Note the following locking behavior:
+ *
+ * rtalloc_ign() and rtalloc() return ro->ro_rt unlocked
+ *
+ * rtalloc1() returns a locked rtentry
+ *
+ * rtfree() and RTFREE_LOCKED() require a locked rtentry
+ *
+ * RTFREE() uses an unlocked entry.
+ */
+
+int rtexpunge(struct rtentry *);
+void rtfree(struct rtentry *);
+int rt_check(struct rtentry **, struct rtentry **, struct sockaddr *);
+
+/* XXX MRT COMPAT VERSIONS THAT SET UNIVERSE to 0 */
+/* Thes are used by old code not yet converted to use multiple FIBS */
+int rt_getifa(struct rt_addrinfo *);
+void rtalloc_ign(struct route *ro, u_long ignflags);
+void rtalloc(struct route *ro); /* XXX deprecated, use rtalloc_ign(ro, 0) */
+struct rtentry *rtalloc1(struct sockaddr *, int, u_long);
+int rtinit(struct ifaddr *, int, int);
+int rtioctl(u_long, caddr_t);
+void rtredirect(struct sockaddr *, struct sockaddr *,
+ struct sockaddr *, int, struct sockaddr *);
+int rtrequest(int, struct sockaddr *,
+ struct sockaddr *, struct sockaddr *, int, struct rtentry **);
+
+/* defaults to "all" FIBs */
+int rtinit_fib(struct ifaddr *, int, int);
+
+/* XXX MRT NEW VERSIONS THAT USE FIBs
+ * For now the protocol indepedent versions are the same as the AF_INET ones
+ * but this will change..
+ */
+int rt_getifa_fib(struct rt_addrinfo *, u_int fibnum);
+void rtalloc_ign_fib(struct route *ro, u_long ignflags, u_int fibnum);
+void rtalloc_fib(struct route *ro, u_int fibnum);
+struct rtentry *rtalloc1_fib(struct sockaddr *, int, u_long, u_int);
+int rtioctl_fib(u_long, caddr_t, u_int);
+void rtredirect_fib(struct sockaddr *, struct sockaddr *,
+ struct sockaddr *, int, struct sockaddr *, u_int);
+int rtrequest_fib(int, struct sockaddr *,
+ struct sockaddr *, struct sockaddr *, int, struct rtentry **, u_int);
+int rtrequest1_fib(int, struct rt_addrinfo *, struct rtentry **, u_int);
+
+#include <sys/eventhandler.h>
+typedef void (*rtevent_arp_update_fn)(void *, struct rtentry *, uint8_t *, struct sockaddr *);
+typedef void (*rtevent_redirect_fn)(void *, struct rtentry *, struct rtentry *, struct sockaddr *);
+EVENTHANDLER_DECLARE(route_arp_update_event, rtevent_arp_update_fn);
+EVENTHANDLER_DECLARE(route_redirect_event, rtevent_redirect_fn);
+#endif
+
+#endif
diff --git a/freebsd/sys/net/rtsock.c b/freebsd/sys/net/rtsock.c
index 287dd74d..0cfc6e91 100644
--- a/freebsd/sys/net/rtsock.c
+++ b/freebsd/sys/net/rtsock.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1988, 1991, 1993
@@ -31,42 +31,42 @@
* @(#)rtsock.c 8.7 (Berkeley) 10/12/95
* $FreeBSD$
*/
-#include <freebsd/local/opt_compat.h>
-#include <freebsd/local/opt_sctp.h>
-#include <freebsd/local/opt_mpath.h>
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/systm.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_llatbl.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/raw_cb.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/if_ether.h>
+#include <rtems/bsd/local/opt_compat.h>
+#include <rtems/bsd/local/opt_sctp.h>
+#include <rtems/bsd/local/opt_mpath.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/jail.h>
+#include <sys/kernel.h>
+#include <sys/domain.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/protosw.h>
+#include <sys/rwlock.h>
+#include <sys/signalvar.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sysctl.h>
+#include <sys/systm.h>
+
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/if_llatbl.h>
+#include <net/if_types.h>
+#include <net/netisr.h>
+#include <net/raw_cb.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
#ifdef INET6
-#include <freebsd/netinet6/scope6_var.h>
+#include <netinet6/scope6_var.h>
#endif
#if defined(INET) || defined(INET6)
@@ -76,8 +76,8 @@ extern void sctp_addr_change(struct ifaddr *ifa, int cmd);
#endif
#ifdef COMPAT_FREEBSD32
-#include <freebsd/sys/mount.h>
-#include <freebsd/compat/freebsd32/freebsd32.h>
+#include <sys/mount.h>
+#include <compat/freebsd32/freebsd32.h>
struct if_data32 {
uint8_t ifi_type;
diff --git a/freebsd/sys/net/slcompress.c b/freebsd/sys/net/slcompress.c
index be337c1f..876d5be3 100644
--- a/freebsd/sys/net/slcompress.c
+++ b/freebsd/sys/net/slcompress.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1989, 1993, 1994
@@ -41,16 +41,16 @@
*
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/systm.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/mbuf.h>
+#include <sys/systm.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/tcp.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/tcp.h>
-#include <freebsd/net/slcompress.h>
+#include <net/slcompress.h>
#ifndef SL_NO_STATS
#define INCR(counter) ++comp->counter;
diff --git a/freebsd/sys/net/slcompress.h b/freebsd/sys/net/slcompress.h
index 08c9042e..794d8b83 100644
--- a/freebsd/sys/net/slcompress.h
+++ b/freebsd/sys/net/slcompress.h
@@ -34,8 +34,8 @@
* $FreeBSD$
*/
-#ifndef _NET_SLCOMPRESS_HH_
-#define _NET_SLCOMPRESS_HH_
+#ifndef _NET_SLCOMPRESS_H_
+#define _NET_SLCOMPRESS_H_
#define MAX_STATES 16 /* must be > 2 and < 256 */
#define MAX_HDR 128
@@ -155,4 +155,4 @@ int sl_uncompress_tcp(u_char **, int, u_int, struct slcompress *);
int sl_uncompress_tcp_core(u_char *, int, int, u_int,
struct slcompress *, u_char **, u_int *);
-#endif /* !_NET_SLCOMPRESS_HH_ */
+#endif /* !_NET_SLCOMPRESS_H_ */
diff --git a/freebsd/sys/net/vnet.h b/freebsd/sys/net/vnet.h
index 7f6326fe..d3c426a4 100644
--- a/freebsd/sys/net/vnet.h
+++ b/freebsd/sys/net/vnet.h
@@ -54,8 +54,8 @@
* sysinits.
*/
-#ifndef _NET_VNET_HH_
-#define _NET_VNET_HH_
+#ifndef _NET_VNET_H_
+#define _NET_VNET_H_
/*
* struct vnet describes a virtualized network stack, and is primarily a
@@ -63,7 +63,7 @@
* as required for libkvm.
*/
#if defined(_KERNEL) || defined(_WANT_VNET)
-#include <freebsd/sys/queue.h>
+#include <sys/queue.h>
struct vnet {
LIST_ENTRY(vnet) vnet_le; /* all vnets list */
@@ -86,10 +86,10 @@ struct vnet {
#ifdef _KERNEL
#ifdef VIMAGE
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/proc.h> /* for struct thread */
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/sx.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/proc.h> /* for struct thread */
+#include <sys/rwlock.h>
+#include <sys/sx.h>
/*
* Location of the kernel's 'set_vnet' linker set.
@@ -275,7 +275,7 @@ int vnet_sysctl_handle_uint(SYSCTL_HANDLER_ARGS);
* startup and shutdown methods to be run when virtual network stack
* instances are created and destroyed.
*/
-#include <freebsd/sys/kernel.h>
+#include <sys/kernel.h>
/*
* SYSINIT/SYSUNINIT variants that provide per-vnet constructors and
@@ -330,7 +330,7 @@ void vnet_deregister_sysuninit(void *arg);
/*
* EVENTHANDLER(9) extensions.
*/
-#include <freebsd/sys/eventhandler.h>
+#include <sys/eventhandler.h>
void vnet_global_eventhandler_iterator_func(void *, ...);
#define VNET_GLOBAL_EVENTHANDLER_REGISTER_TAG(tag, name, func, arg, priority) \
@@ -434,4 +434,4 @@ do { \
#endif /* VIMAGE */
#endif /* _KERNEL */
-#endif /* !_NET_VNET_HH_ */
+#endif /* !_NET_VNET_H_ */
diff --git a/freebsd/sys/net/zlib.c b/freebsd/sys/net/zlib.c
index a7a54740..06b92bb9 100644
--- a/freebsd/sys/net/zlib.c
+++ b/freebsd/sys/net/zlib.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* This file is derived from various .h and .c files from the zlib-1.0.4
@@ -49,38 +49,38 @@
#define _Z_UTIL_H
#ifdef _KERNEL
-#include <freebsd/net/zlib.h>
+#include <net/zlib.h>
#else
-#include <freebsd/local/zlib.h>
+#include <rtems/bsd/local/zlib.h>
#endif
#ifdef _KERNEL
/* Assume this is a *BSD or SVR4 kernel */
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
# define HAVE_MEMCPY
#else
#if defined(__KERNEL__)
/* Assume this is a Linux kernel */
-#include <freebsd/linux/string.h>
+#include <linux/string.h>
#define HAVE_MEMCPY
#else /* not kernel */
#if defined(MSDOS)||defined(VMS)||defined(CRAY)||defined(WIN32)||defined(RISCOS)
-# include <freebsd/stddef.h>
-# include <freebsd/errno.h>
+# include <stddef.h>
+# include <errno.h>
#else
extern int errno;
#endif
#ifdef STDC
-# include <freebsd/string.h>
-# include <freebsd/stdlib.h>
+# include <string.h>
+# include <stdlib.h>
#endif
#endif /* __KERNEL__ */
#endif /* _KERNEL */
@@ -135,9 +135,9 @@ static const char *z_errmsg[10]; /* indexed by 2-zlib_error */
#ifdef MSDOS
# define OS_CODE 0x00
# ifdef __TURBOC__
-# include <freebsd/alloc.h>
+# include <alloc.h>
# else /* MSC or DJGPP */
-# include <freebsd/malloc.h>
+# include <malloc.h>
# endif
#endif
@@ -228,7 +228,7 @@ static const char *z_errmsg[10]; /* indexed by 2-zlib_error */
/* Diagnostic functions */
#ifdef DEBUG_ZLIB
-# include <freebsd/stdio.h>
+# include <stdio.h>
# ifndef verbose
# define verbose 0
# endif
@@ -278,7 +278,7 @@ void zcfree OF((voidpf opaque, voidpf ptr));
#ifndef _DEFLATE_H
#define _DEFLATE_H
-/* #include <freebsd/local/zutil.h> */
+/* #include <rtems/bsd/local/zutil.h> */
/* ===========================================================================
* Internal compression state.
@@ -595,7 +595,7 @@ void _tr_stored_type_only OF((deflate_state *));
/* From: deflate.c,v 1.15 1996/07/24 13:40:58 me Exp $ */
-/* #include <freebsd/local/deflate.h> */
+/* #include <rtems/bsd/local/deflate.h> */
char deflate_copyright[] = " deflate 1.0.4 Copyright 1995-1996 Jean-loup Gailly ";
/*
@@ -1871,10 +1871,10 @@ local block_state deflate_slow(s, flush)
/* From: trees.c,v 1.11 1996/07/24 13:41:06 me Exp $ */
-/* #include <freebsd/local/deflate.h> */
+/* #include <rtems/bsd/local/deflate.h> */
#ifdef DEBUG_ZLIB
-# include <freebsd/ctype.h>
+# include <ctype.h>
#endif
/* ===========================================================================
@@ -2996,7 +2996,7 @@ local void copy_block(s, buf, len, header)
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* #include <freebsd/local/zutil.h> */
+/* #include <rtems/bsd/local/zutil.h> */
/* +++ infblock.h */
/* infblock.h -- header to use infblock.c
@@ -3424,8 +3424,8 @@ z_streamp z;
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* #include <freebsd/local/zutil.h> */
-/* #include <freebsd/local/infblock.h> */
+/* #include <rtems/bsd/local/zutil.h> */
+/* #include <rtems/bsd/local/infblock.h> */
/* +++ inftrees.h */
/* inftrees.h -- header to use inftrees.c
@@ -4101,8 +4101,8 @@ int inflate_packet_flush(s)
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* #include <freebsd/local/zutil.h> */
-/* #include <freebsd/local/inftrees.h> */
+/* #include <rtems/bsd/local/zutil.h> */
+/* #include <rtems/bsd/local/inftrees.h> */
char inflate_copyright[] = " inflate 1.0.4 Copyright 1995-1996 Mark Adler ";
/*
@@ -4585,11 +4585,11 @@ z_streamp z; /* for zfree function */
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* #include <freebsd/local/zutil.h> */
-/* #include <freebsd/local/inftrees.h> */
-/* #include <freebsd/local/infblock.h> */
-/* #include <freebsd/local/infcodes.h> */
-/* #include <freebsd/local/infutil.h> */
+/* #include <rtems/bsd/local/zutil.h> */
+/* #include <rtems/bsd/local/inftrees.h> */
+/* #include <rtems/bsd/local/infblock.h> */
+/* #include <rtems/bsd/local/infcodes.h> */
+/* #include <rtems/bsd/local/infutil.h> */
/* +++ inffast.h */
/* inffast.h -- header to use inffast.c
@@ -4854,11 +4854,11 @@ z_streamp z;
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* #include <freebsd/local/zutil.h> */
-/* #include <freebsd/local/infblock.h> */
-/* #include <freebsd/local/inftrees.h> */
-/* #include <freebsd/local/infcodes.h> */
-/* #include <freebsd/local/infutil.h> */
+/* #include <rtems/bsd/local/zutil.h> */
+/* #include <rtems/bsd/local/infblock.h> */
+/* #include <rtems/bsd/local/inftrees.h> */
+/* #include <rtems/bsd/local/infcodes.h> */
+/* #include <rtems/bsd/local/infutil.h> */
#ifndef NO_DUMMY_DECL
struct inflate_codes_state {int dummy;}; /* for buggy compilers */
@@ -4950,12 +4950,12 @@ int r;
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* #include <freebsd/local/zutil.h> */
-/* #include <freebsd/local/inftrees.h> */
-/* #include <freebsd/local/infblock.h> */
-/* #include <freebsd/local/infcodes.h> */
-/* #include <freebsd/local/infutil.h> */
-/* #include <freebsd/local/inffast.h> */
+/* #include <rtems/bsd/local/zutil.h> */
+/* #include <rtems/bsd/local/inftrees.h> */
+/* #include <rtems/bsd/local/infblock.h> */
+/* #include <rtems/bsd/local/infcodes.h> */
+/* #include <rtems/bsd/local/infutil.h> */
+/* #include <rtems/bsd/local/inffast.h> */
#ifndef NO_DUMMY_DECL
struct inflate_codes_state {int dummy;}; /* for buggy compilers */
@@ -5126,10 +5126,10 @@ z_streamp z;
/* From: zutil.c,v 1.17 1996/07/24 13:41:12 me Exp $ */
#ifdef DEBUG_ZLIB
-#include <freebsd/stdio.h>
+#include <stdio.h>
#endif
-/* #include <freebsd/local/zutil.h> */
+/* #include <rtems/bsd/local/zutil.h> */
#ifndef NO_DUMMY_DECL
struct internal_state {int dummy;}; /* for buggy compilers */
@@ -5343,7 +5343,7 @@ void zcfree (opaque, ptr)
/* From: adler32.c,v 1.10 1996/05/22 11:52:18 me Exp $ */
-/* #include <freebsd/local/zlib.h> */
+/* #include <rtems/bsd/local/zlib.h> */
#define BASE 65521L /* largest prime smaller than 65536 */
#define NMAX 5552
diff --git a/freebsd/sys/net/zlib.h b/freebsd/sys/net/zlib.h
index 3da670fd..9529e43b 100644
--- a/freebsd/sys/net/zlib.h
+++ b/freebsd/sys/net/zlib.h
@@ -235,7 +235,7 @@ typedef uLong FAR uLongf;
/* Compile with -DZLIB_DLL for Windows DLL support */
#if (defined(_WINDOWS) || defined(WINDOWS)) && defined(ZLIB_DLL)
-# include <freebsd/windows.h>
+# include <windows.h>
# define EXPORT WINAPI
#else
# define EXPORT
diff --git a/freebsd/sys/net80211/_ieee80211.h b/freebsd/sys/net80211/_ieee80211.h
index 764e5cf1..c488c006 100644
--- a/freebsd/sys/net80211/_ieee80211.h
+++ b/freebsd/sys/net80211/_ieee80211.h
@@ -25,8 +25,8 @@
*
* $FreeBSD$
*/
-#ifndef _NET80211__IEEE80211_HH_
-#define _NET80211__IEEE80211_HH_
+#ifndef _NET80211__IEEE80211_H_
+#define _NET80211__IEEE80211_H_
/*
* 802.11 implementation definitions.
@@ -393,4 +393,4 @@ struct ieee80211_mimo_info {
uint8_t pad[2];
uint32_t evm[3]; /* EVM data */
};
-#endif /* _NET80211__IEEE80211_HH_ */
+#endif /* _NET80211__IEEE80211_H_ */
diff --git a/freebsd/sys/net80211/ieee80211.c b/freebsd/sys/net80211/ieee80211.c
index 8770d452..831998b6 100644
--- a/freebsd/sys/net80211/ieee80211.c
+++ b/freebsd/sys/net80211/ieee80211.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001 Atsushi Onoe
@@ -26,34 +26,34 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* IEEE 802.11 generic handler
*/
-#include <freebsd/local/opt_wlan.h>
+#include <rtems/bsd/local/opt_wlan.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
-#include <freebsd/sys/socket.h>
+#include <sys/socket.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/ethernet.h>
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/if_media.h>
+#include <net/if_types.h>
+#include <net/ethernet.h>
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_regdomain.h>
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_regdomain.h>
#ifdef IEEE80211_SUPPORT_SUPERG
-#include <freebsd/net80211/ieee80211_superg.h>
+#include <net80211/ieee80211_superg.h>
#endif
-#include <freebsd/net80211/ieee80211_ratectl.h>
+#include <net80211/ieee80211_ratectl.h>
-#include <freebsd/net/bpf.h>
+#include <net/bpf.h>
const char *ieee80211_phymode_name[IEEE80211_MODE_MAX] = {
[IEEE80211_MODE_AUTO] = "auto",
diff --git a/freebsd/sys/net80211/ieee80211.h b/freebsd/sys/net80211/ieee80211.h
index 6019e0ed..712c2a8d 100644
--- a/freebsd/sys/net80211/ieee80211.h
+++ b/freebsd/sys/net80211/ieee80211.h
@@ -25,8 +25,8 @@
*
* $FreeBSD$
*/
-#ifndef _NET80211_IEEE80211_HH_
-#define _NET80211_IEEE80211_HH_
+#ifndef _NET80211_IEEE80211_H_
+#define _NET80211_IEEE80211_H_
/*
* 802.11 protocol definitions.
@@ -1084,4 +1084,4 @@ struct ieee80211_duration {
IEEE80211_DUR_DS_SLOW_PLCPHDR + \
IEEE80211_DUR_DIFS)
-#endif /* _NET80211_IEEE80211_HH_ */
+#endif /* _NET80211_IEEE80211_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_acl.c b/freebsd/sys/net80211/ieee80211_acl.c
index 955989a6..2bad7bf4 100644
--- a/freebsd/sys/net80211/ieee80211_acl.c
+++ b/freebsd/sys/net80211/ieee80211_acl.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2004-2008 Sam Leffler, Errno Consulting
@@ -25,7 +25,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -39,23 +39,23 @@ __FBSDID("$FreeBSD$");
* and if found the frame is either accepted (ACL_POLICY_ALLOW)
* or rejected (ACL_POLICY_DENT).
*/
-#include <freebsd/local/opt_wlan.h>
+#include <rtems/bsd/local/opt_wlan.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/queue.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <sys/queue.h>
-#include <freebsd/sys/socket.h>
+#include <sys/socket.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/route.h>
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/ethernet.h>
+#include <net/route.h>
-#include <freebsd/net80211/ieee80211_var.h>
+#include <net80211/ieee80211_var.h>
enum {
ACL_POLICY_OPEN = 0, /* open, don't check ACL's */
diff --git a/freebsd/sys/net80211/ieee80211_action.c b/freebsd/sys/net80211/ieee80211_action.c
index 4bd5c700..0804b46c 100644
--- a/freebsd/sys/net80211/ieee80211_action.c
+++ b/freebsd/sys/net80211/ieee80211_action.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2009 Sam Leffler, Errno Consulting
@@ -25,7 +25,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
#ifdef __FreeBSD__
__FBSDID("$FreeBSD$");
#endif
@@ -34,22 +34,22 @@ __FBSDID("$FreeBSD$");
* IEEE 802.11 send/recv action frame support.
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_wlan.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_wlan.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/systm.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
-#include <freebsd/sys/socket.h>
+#include <sys/socket.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/ethernet.h>
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/ethernet.h>
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_action.h>
-#include <freebsd/net80211/ieee80211_mesh.h>
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_action.h>
+#include <net80211/ieee80211_mesh.h>
static int
send_inval(struct ieee80211_node *ni, int cat, int act, void *sa)
diff --git a/freebsd/sys/net80211/ieee80211_action.h b/freebsd/sys/net80211/ieee80211_action.h
index 943d145b..4ee2aff4 100644
--- a/freebsd/sys/net80211/ieee80211_action.h
+++ b/freebsd/sys/net80211/ieee80211_action.h
@@ -24,8 +24,8 @@
*
* $FreeBSD$
*/
-#ifndef _NET80211_IEEE80211_ACTION_HH_
-#define _NET80211_IEEE80211_ACTION_HH_
+#ifndef _NET80211_IEEE80211_ACTION_H_
+#define _NET80211_IEEE80211_ACTION_H_
/*
* 802.11 send/recv action frame support.
@@ -49,4 +49,4 @@ void ieee80211_recv_action_unregister(int cat, int act);
int ieee80211_recv_action(struct ieee80211_node *,
const struct ieee80211_frame *,
const uint8_t *, const uint8_t *);
-#endif /* _NET80211_IEEE80211_ACTION_HH_ */
+#endif /* _NET80211_IEEE80211_ACTION_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_adhoc.c b/freebsd/sys/net80211/ieee80211_adhoc.c
index 44d91041..3030bcd0 100644
--- a/freebsd/sys/net80211/ieee80211_adhoc.c
+++ b/freebsd/sys/net80211/ieee80211_adhoc.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2007-2009 Sam Leffler, Errno Consulting
@@ -25,7 +25,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
#ifdef __FreeBSD__
__FBSDID("$FreeBSD$");
#endif
@@ -33,37 +33,37 @@ __FBSDID("$FreeBSD$");
/*
* IEEE 802.11 IBSS mode support.
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_wlan.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/endian.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/if_llc.h>
-#include <freebsd/net/ethernet.h>
-
-#include <freebsd/net/bpf.h>
-
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_adhoc.h>
-#include <freebsd/net80211/ieee80211_input.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_wlan.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/endian.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/proc.h>
+#include <sys/sysctl.h>
+
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/if_llc.h>
+#include <net/ethernet.h>
+
+#include <net/bpf.h>
+
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_adhoc.h>
+#include <net80211/ieee80211_input.h>
#ifdef IEEE80211_SUPPORT_SUPERG
-#include <freebsd/net80211/ieee80211_superg.h>
+#include <net80211/ieee80211_superg.h>
#endif
#ifdef IEEE80211_SUPPORT_TDMA
-#include <freebsd/net80211/ieee80211_tdma.h>
+#include <net80211/ieee80211_tdma.h>
#endif
#define IEEE80211_RATE2MBS(r) (((r) & IEEE80211_RATE_VAL) / 2)
diff --git a/freebsd/sys/net80211/ieee80211_adhoc.h b/freebsd/sys/net80211/ieee80211_adhoc.h
index 2fad984e..d8e19e5e 100644
--- a/freebsd/sys/net80211/ieee80211_adhoc.h
+++ b/freebsd/sys/net80211/ieee80211_adhoc.h
@@ -24,12 +24,12 @@
*
* $FreeBSD$
*/
-#ifndef _NET80211_IEEE80211_ADHOC_HH_
-#define _NET80211_IEEE80211_ADHOC_HH_
+#ifndef _NET80211_IEEE80211_ADHOC_H_
+#define _NET80211_IEEE80211_ADHOC_H_
/*
* Adhoc-mode (ibss+ahdemo) implementation definitions.
*/
void ieee80211_adhoc_attach(struct ieee80211com *);
void ieee80211_adhoc_detach(struct ieee80211com *);
-#endif /* !_NET80211_IEEE80211_STA_HH_ */
+#endif /* !_NET80211_IEEE80211_STA_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_ageq.c b/freebsd/sys/net80211/ieee80211_ageq.c
index 2e838e35..3d164977 100644
--- a/freebsd/sys/net80211/ieee80211_ageq.c
+++ b/freebsd/sys/net80211/ieee80211_ageq.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2009 Sam Leffler, Errno Consulting
@@ -25,25 +25,25 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* IEEE 802.11 age queue support.
*/
-#include <freebsd/local/opt_wlan.h>
+#include <rtems/bsd/local/opt_wlan.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
-#include <freebsd/sys/socket.h>
+#include <sys/socket.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/ethernet.h>
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/ethernet.h>
-#include <freebsd/net80211/ieee80211_var.h>
+#include <net80211/ieee80211_var.h>
/*
* Initialize an ageq.
diff --git a/freebsd/sys/net80211/ieee80211_ageq.h b/freebsd/sys/net80211/ieee80211_ageq.h
index 8aecae05..fdcf071a 100644
--- a/freebsd/sys/net80211/ieee80211_ageq.h
+++ b/freebsd/sys/net80211/ieee80211_ageq.h
@@ -24,8 +24,8 @@
*
* $FreeBSD$
*/
-#ifndef _NET80211_IEEE80211_STAGEQ_HH_
-#define _NET80211_IEEE80211_STAGEQ_HH_
+#ifndef _NET80211_IEEE80211_STAGEQ_H_
+#define _NET80211_IEEE80211_STAGEQ_H_
struct ieee80211_node;
struct mbuf;
@@ -51,4 +51,4 @@ void ieee80211_ageq_drain_node(struct ieee80211_ageq *,
struct mbuf *ieee80211_ageq_age(struct ieee80211_ageq *, int quanta);
struct mbuf *ieee80211_ageq_remove(struct ieee80211_ageq *,
struct ieee80211_node *match);
-#endif /* _NET80211_IEEE80211_STAGEQ_HH_ */
+#endif /* _NET80211_IEEE80211_STAGEQ_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_amrr.c b/freebsd/sys/net80211/ieee80211_amrr.c
index 33f6c5f3..9043ec61 100644
--- a/freebsd/sys/net80211/ieee80211_amrr.c
+++ b/freebsd/sys/net80211/ieee80211_amrr.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $OpenBSD: ieee80211_amrr.c,v 1.1 2006/06/17 19:07:19 damien Exp $ */
@@ -20,7 +20,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*-
@@ -31,25 +31,25 @@ __FBSDID("$FreeBSD$");
* INRIA Sophia - Projet Planete
* http://www-sop.inria.fr/rapports/sophia/RR-5208.html
*/
-#include <freebsd/local/opt_wlan.h>
+#include <rtems/bsd/local/opt_wlan.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/socket.h>
+#include <sys/sysctl.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
+#include <net/if.h>
+#include <net/if_media.h>
#ifdef INET
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/if_ether.h>
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
#endif
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_amrr.h>
-#include <freebsd/net80211/ieee80211_ratectl.h>
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_amrr.h>
+#include <net80211/ieee80211_ratectl.h>
#define is_success(amn) \
((amn)->amn_retrycnt < (amn)->amn_txcnt / 10)
diff --git a/freebsd/sys/net80211/ieee80211_amrr.h b/freebsd/sys/net80211/ieee80211_amrr.h
index b425e268..ec67bdfb 100644
--- a/freebsd/sys/net80211/ieee80211_amrr.h
+++ b/freebsd/sys/net80211/ieee80211_amrr.h
@@ -17,8 +17,8 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#ifndef _NET80211_IEEE80211_AMRR_HH_
-#define _NET80211_IEEE80211_AMRR_HH_
+#ifndef _NET80211_IEEE80211_AMRR_H_
+#define _NET80211_IEEE80211_AMRR_H_
/*-
* Naive implementation of the Adaptive Multi Rate Retry algorithm:
@@ -58,4 +58,4 @@ struct ieee80211_amrr_node {
u_int amn_retrycnt;
};
-#endif /* _NET80211_IEEE80211_AMRR_HH_ */
+#endif /* _NET80211_IEEE80211_AMRR_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_crypto.c b/freebsd/sys/net80211/ieee80211_crypto.c
index c3a263c8..a3b3375e 100644
--- a/freebsd/sys/net80211/ieee80211_crypto.c
+++ b/freebsd/sys/net80211/ieee80211_crypto.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001 Atsushi Onoe
@@ -26,26 +26,26 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* IEEE 802.11 generic crypto support.
*/
-#include <freebsd/local/opt_wlan.h>
+#include <rtems/bsd/local/opt_wlan.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
-#include <freebsd/sys/socket.h>
+#include <sys/socket.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/ethernet.h> /* XXX ETHER_HDR_LEN */
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/ethernet.h> /* XXX ETHER_HDR_LEN */
-#include <freebsd/net80211/ieee80211_var.h>
+#include <net80211/ieee80211_var.h>
MALLOC_DEFINE(M_80211_CRYPTO, "80211crypto", "802.11 crypto state");
diff --git a/freebsd/sys/net80211/ieee80211_crypto.h b/freebsd/sys/net80211/ieee80211_crypto.h
index b9e8e25b..57d05ad7 100644
--- a/freebsd/sys/net80211/ieee80211_crypto.h
+++ b/freebsd/sys/net80211/ieee80211_crypto.h
@@ -25,8 +25,8 @@
*
* $FreeBSD$
*/
-#ifndef _NET80211_IEEE80211_CRYPTO_HH_
-#define _NET80211_IEEE80211_CRYPTO_HH_
+#ifndef _NET80211_IEEE80211_CRYPTO_H_
+#define _NET80211_IEEE80211_CRYPTO_H_
/*
* 802.11 protocol crypto-related definitions.
@@ -242,4 +242,4 @@ void ieee80211_notify_replay_failure(struct ieee80211vap *,
void ieee80211_notify_michael_failure(struct ieee80211vap *,
const struct ieee80211_frame *, u_int keyix);
#endif /* defined(__KERNEL__) || defined(_KERNEL) */
-#endif /* _NET80211_IEEE80211_CRYPTO_HH_ */
+#endif /* _NET80211_IEEE80211_CRYPTO_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_crypto_ccmp.c b/freebsd/sys/net80211/ieee80211_crypto_ccmp.c
index 82443508..a4f327bc 100644
--- a/freebsd/sys/net80211/ieee80211_crypto_ccmp.c
+++ b/freebsd/sys/net80211/ieee80211_crypto_ccmp.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
@@ -25,7 +25,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -35,24 +35,24 @@ __FBSDID("$FreeBSD$");
* AP driver. The code is used with the consent of the author and
* it's license is included below.
*/
-#include <freebsd/local/opt_wlan.h>
+#include <rtems/bsd/local/opt_wlan.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
-#include <freebsd/sys/socket.h>
+#include <sys/socket.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/ethernet.h>
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/ethernet.h>
-#include <freebsd/net80211/ieee80211_var.h>
+#include <net80211/ieee80211_var.h>
-#include <freebsd/crypto/rijndael/rijndael.h>
+#include <crypto/rijndael/rijndael.h>
#define AES_BLOCK_LEN 16
diff --git a/freebsd/sys/net80211/ieee80211_crypto_none.c b/freebsd/sys/net80211/ieee80211_crypto_none.c
index f9112a9f..88dd7d72 100644
--- a/freebsd/sys/net80211/ieee80211_crypto_none.c
+++ b/freebsd/sys/net80211/ieee80211_crypto_none.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
@@ -25,27 +25,27 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* IEEE 802.11 NULL crypto support.
*/
-#include <freebsd/local/opt_wlan.h>
+#include <rtems/bsd/local/opt_wlan.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
-#include <freebsd/sys/socket.h>
+#include <sys/socket.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/ethernet.h>
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/ethernet.h>
-#include <freebsd/net80211/ieee80211_var.h>
+#include <net80211/ieee80211_var.h>
static void *none_attach(struct ieee80211vap *, struct ieee80211_key *);
static void none_detach(struct ieee80211_key *);
diff --git a/freebsd/sys/net80211/ieee80211_crypto_tkip.c b/freebsd/sys/net80211/ieee80211_crypto_tkip.c
index 6b0656e2..01d2002e 100644
--- a/freebsd/sys/net80211/ieee80211_crypto_tkip.c
+++ b/freebsd/sys/net80211/ieee80211_crypto_tkip.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
@@ -25,7 +25,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -35,23 +35,23 @@ __FBSDID("$FreeBSD$");
* AP driver. The code is used with the consent of the author and
* it's license is included below.
*/
-#include <freebsd/local/opt_wlan.h>
+#include <rtems/bsd/local/opt_wlan.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/endian.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/endian.h>
-#include <freebsd/sys/socket.h>
+#include <sys/socket.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/ethernet.h>
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/ethernet.h>
-#include <freebsd/net80211/ieee80211_var.h>
+#include <net80211/ieee80211_var.h>
static void *tkip_attach(struct ieee80211vap *, struct ieee80211_key *);
static void tkip_detach(struct ieee80211_key *);
diff --git a/freebsd/sys/net80211/ieee80211_crypto_wep.c b/freebsd/sys/net80211/ieee80211_crypto_wep.c
index 01b3c37d..577237e7 100644
--- a/freebsd/sys/net80211/ieee80211_crypto_wep.c
+++ b/freebsd/sys/net80211/ieee80211_crypto_wep.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
@@ -25,29 +25,29 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* IEEE 802.11 WEP crypto support.
*/
-#include <freebsd/local/opt_wlan.h>
+#include <rtems/bsd/local/opt_wlan.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/endian.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/endian.h>
-#include <freebsd/sys/socket.h>
+#include <sys/socket.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/ethernet.h>
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/ethernet.h>
-#include <freebsd/net80211/ieee80211_var.h>
+#include <net80211/ieee80211_var.h>
static void *wep_attach(struct ieee80211vap *, struct ieee80211_key *);
static void wep_detach(struct ieee80211_key *);
diff --git a/freebsd/sys/net80211/ieee80211_ddb.c b/freebsd/sys/net80211/ieee80211_ddb.c
index f3b30431..73778c29 100644
--- a/freebsd/sys/net80211/ieee80211_ddb.c
+++ b/freebsd/sys/net80211/ieee80211_ddb.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2007-2009 Sam Leffler, Errno Consulting
@@ -25,38 +25,38 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_ddb.h>
-#include <freebsd/local/opt_wlan.h>
+#include <rtems/bsd/local/opt_ddb.h>
+#include <rtems/bsd/local/opt_wlan.h>
#ifdef DDB
/*
* IEEE 802.11 DDB support
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/socket.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/net80211/ieee80211_var.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/socket.h>
+
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/if_media.h>
+#include <net/if_types.h>
+#include <net/ethernet.h>
+#include <net/vnet.h>
+
+#include <net80211/ieee80211_var.h>
#ifdef IEEE80211_SUPPORT_TDMA
-#include <freebsd/net80211/ieee80211_tdma.h>
+#include <net80211/ieee80211_tdma.h>
#endif
#ifdef IEEE80211_SUPPORT_MESH
-#include <freebsd/net80211/ieee80211_mesh.h>
+#include <net80211/ieee80211_mesh.h>
#endif
-#include <freebsd/ddb/ddb.h>
-#include <freebsd/ddb/db_sym.h>
+#include <ddb/ddb.h>
+#include <ddb/db_sym.h>
#define DB_PRINTSYM(prefix, name, addr) do { \
db_printf("%s%-25s : ", prefix, name); \
diff --git a/freebsd/sys/net80211/ieee80211_dfs.c b/freebsd/sys/net80211/ieee80211_dfs.c
index 803ed337..3090a78c 100644
--- a/freebsd/sys/net80211/ieee80211_dfs.c
+++ b/freebsd/sys/net80211/ieee80211_dfs.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2007-2008 Sam Leffler, Errno Consulting
@@ -25,7 +25,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
#ifdef __FreeBSD__
__FBSDID("$FreeBSD$");
#endif
@@ -33,26 +33,26 @@ __FBSDID("$FreeBSD$");
/*
* IEEE 802.11 DFS/Radar support.
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_wlan.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/endian.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-
-#include <freebsd/net80211/ieee80211_var.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_wlan.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/endian.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/proc.h>
+#include <sys/sysctl.h>
+
+#include <net/if.h>
+#include <net/if_media.h>
+
+#include <net80211/ieee80211_var.h>
MALLOC_DEFINE(M_80211_DFS, "80211dfs", "802.11 DFS state");
diff --git a/freebsd/sys/net80211/ieee80211_dfs.h b/freebsd/sys/net80211/ieee80211_dfs.h
index 474b2078..90760777 100644
--- a/freebsd/sys/net80211/ieee80211_dfs.h
+++ b/freebsd/sys/net80211/ieee80211_dfs.h
@@ -24,8 +24,8 @@
*
* $FreeBSD$
*/
-#ifndef _NET80211_IEEE80211_DFS_HH_
-#define _NET80211_IEEE80211_DFS_HH_
+#ifndef _NET80211_IEEE80211_DFS_H_
+#define _NET80211_IEEE80211_DFS_H_
/*
* 802.11h/DFS definitions.
@@ -54,4 +54,4 @@ void ieee80211_dfs_cac_clear(struct ieee80211com *,
void ieee80211_dfs_notify_radar(struct ieee80211com *,
struct ieee80211_channel *);
struct ieee80211_channel *ieee80211_dfs_pickchannel(struct ieee80211com *);
-#endif /* _NET80211_IEEE80211_DFS_HH_ */
+#endif /* _NET80211_IEEE80211_DFS_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_freebsd.c b/freebsd/sys/net80211/ieee80211_freebsd.c
index 4188f112..23623ece 100644
--- a/freebsd/sys/net80211/ieee80211_freebsd.c
+++ b/freebsd/sys/net80211/ieee80211_freebsd.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2003-2009 Sam Leffler, Errno Consulting
@@ -25,37 +25,37 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* IEEE 802.11 support (FreeBSD-specific code)
*/
-#include <freebsd/local/opt_wlan.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/linker.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/sys/socket.h>
-
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_clone.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_input.h>
+#include <rtems/bsd/local/opt_wlan.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
+#include <sys/linker.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <sys/proc.h>
+#include <sys/sysctl.h>
+
+#include <sys/socket.h>
+
+#include <net/bpf.h>
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/if_clone.h>
+#include <net/if_media.h>
+#include <net/if_types.h>
+#include <net/ethernet.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_input.h>
SYSCTL_NODE(_net, OID_AUTO, wlan, CTLFLAG_RD, 0, "IEEE 80211 parameters");
@@ -481,7 +481,7 @@ ieee80211_process_callback(struct ieee80211_node *ni,
}
}
-#include <freebsd/sys/libkern.h>
+#include <sys/libkern.h>
void
get_random_bytes(void *p, size_t n)
diff --git a/freebsd/sys/net80211/ieee80211_freebsd.h b/freebsd/sys/net80211/ieee80211_freebsd.h
index 69efecd0..3cdc643e 100644
--- a/freebsd/sys/net80211/ieee80211_freebsd.h
+++ b/freebsd/sys/net80211/ieee80211_freebsd.h
@@ -24,16 +24,16 @@
*
* $FreeBSD$
*/
-#ifndef _NET80211_IEEE80211_FREEBSD_HH_
-#define _NET80211_IEEE80211_FREEBSD_HH_
+#ifndef _NET80211_IEEE80211_FREEBSD_H_
+#define _NET80211_IEEE80211_FREEBSD_H_
#ifdef _KERNEL
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/taskqueue.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/rwlock.h>
+#include <sys/sysctl.h>
+#include <sys/taskqueue.h>
/*
* Common state locking definitions.
@@ -167,7 +167,7 @@ typedef struct mtx ieee80211_scan_table_lock_t;
* is the last reference, otherwise 0
* ieee80211_node_refcnt reference count for printing (only)
*/
-#include <freebsd/machine/atomic.h>
+#include <machine/atomic.h>
#define ieee80211_node_initref(_ni) \
do { ((_ni)->ni_refcnt = 1); } while (0)
@@ -547,4 +547,4 @@ struct ieee80211_bpf_params {
uint8_t ibp_try3; /* series 4 try count */
uint8_t ibp_rate3; /* series 4 IEEE tx rate */
};
-#endif /* _NET80211_IEEE80211_FREEBSD_HH_ */
+#endif /* _NET80211_IEEE80211_FREEBSD_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_hostap.c b/freebsd/sys/net80211/ieee80211_hostap.c
index 892957be..803a6f4a 100644
--- a/freebsd/sys/net80211/ieee80211_hostap.c
+++ b/freebsd/sys/net80211/ieee80211_hostap.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2007-2008 Sam Leffler, Errno Consulting
@@ -25,7 +25,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
#ifdef __FreeBSD__
__FBSDID("$FreeBSD$");
#endif
@@ -33,36 +33,36 @@ __FBSDID("$FreeBSD$");
/*
* IEEE 802.11 HOSTAP mode support.
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_wlan.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/endian.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/if_llc.h>
-#include <freebsd/net/ethernet.h>
-
-#include <freebsd/net/bpf.h>
-
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_hostap.h>
-#include <freebsd/net80211/ieee80211_input.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_wlan.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/endian.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/proc.h>
+#include <sys/sysctl.h>
+
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/if_llc.h>
+#include <net/ethernet.h>
+
+#include <net/bpf.h>
+
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_hostap.h>
+#include <net80211/ieee80211_input.h>
#ifdef IEEE80211_SUPPORT_SUPERG
-#include <freebsd/net80211/ieee80211_superg.h>
+#include <net80211/ieee80211_superg.h>
#endif
-#include <freebsd/net80211/ieee80211_wds.h>
+#include <net80211/ieee80211_wds.h>
#define IEEE80211_RATE2MBS(r) (((r) & IEEE80211_RATE_VAL) / 2)
diff --git a/freebsd/sys/net80211/ieee80211_hostap.h b/freebsd/sys/net80211/ieee80211_hostap.h
index fa35e220..87f858d1 100644
--- a/freebsd/sys/net80211/ieee80211_hostap.h
+++ b/freebsd/sys/net80211/ieee80211_hostap.h
@@ -24,12 +24,12 @@
*
* $FreeBSD$
*/
-#ifndef _NET80211_IEEE80211_HOSTAP_HH_
-#define _NET80211_IEEE80211_HOSTAP_HH_
+#ifndef _NET80211_IEEE80211_HOSTAP_H_
+#define _NET80211_IEEE80211_HOSTAP_H_
/*
* Hostap implementation definitions.
*/
void ieee80211_hostap_attach(struct ieee80211com *);
void ieee80211_hostap_detach(struct ieee80211com *);
-#endif /* !_NET80211_IEEE80211_HOSTAP_HH_ */
+#endif /* !_NET80211_IEEE80211_HOSTAP_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_ht.c b/freebsd/sys/net80211/ieee80211_ht.c
index 2b55c067..8f698f98 100644
--- a/freebsd/sys/net80211/ieee80211_ht.c
+++ b/freebsd/sys/net80211/ieee80211_ht.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2007-2008 Sam Leffler, Errno Consulting
@@ -25,7 +25,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
#ifdef __FreeBSD__
__FBSDID("$FreeBSD$");
#endif
@@ -34,23 +34,23 @@ __FBSDID("$FreeBSD$");
* IEEE 802.11n protocol support.
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_wlan.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_wlan.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/endian.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
+#include <sys/endian.h>
-#include <freebsd/sys/socket.h>
+#include <sys/socket.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/ethernet.h>
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/ethernet.h>
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_action.h>
-#include <freebsd/net80211/ieee80211_input.h>
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_action.h>
+#include <net80211/ieee80211_input.h>
/* define here, used throughout file */
#define MS(_v, _f) (((_v) & _f) >> _f##_S)
diff --git a/freebsd/sys/net80211/ieee80211_ht.h b/freebsd/sys/net80211/ieee80211_ht.h
index 552a4264..7b0eab7a 100644
--- a/freebsd/sys/net80211/ieee80211_ht.h
+++ b/freebsd/sys/net80211/ieee80211_ht.h
@@ -24,8 +24,8 @@
*
* $FreeBSD$
*/
-#ifndef _NET80211_IEEE80211_HT_HH_
-#define _NET80211_IEEE80211_HT_HH_
+#ifndef _NET80211_IEEE80211_HT_H_
+#define _NET80211_IEEE80211_HT_H_
/*
* 802.11n protocol implementation definitions.
@@ -199,4 +199,4 @@ uint8_t *ieee80211_add_htinfo_vendor(uint8_t *, struct ieee80211_node *);
struct ieee80211_beacon_offsets;
void ieee80211_ht_update_beacon(struct ieee80211vap *,
struct ieee80211_beacon_offsets *);
-#endif /* _NET80211_IEEE80211_HT_HH_ */
+#endif /* _NET80211_IEEE80211_HT_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_hwmp.c b/freebsd/sys/net80211/ieee80211_hwmp.c
index f0a2cde9..ecf2879a 100644
--- a/freebsd/sys/net80211/ieee80211_hwmp.c
+++ b/freebsd/sys/net80211/ieee80211_hwmp.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2009 The FreeBSD Foundation
@@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
#ifdef __FreeBSD__
__FBSDID("$FreeBSD$");
#endif
@@ -38,33 +38,33 @@ __FBSDID("$FreeBSD$");
*
* Based on March 2009, D3.0 802.11s draft spec.
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_wlan.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/endian.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/if_llc.h>
-#include <freebsd/net/ethernet.h>
-
-#include <freebsd/net/bpf.h>
-
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_action.h>
-#include <freebsd/net80211/ieee80211_input.h>
-#include <freebsd/net80211/ieee80211_mesh.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_wlan.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/endian.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/proc.h>
+#include <sys/sysctl.h>
+
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/if_llc.h>
+#include <net/ethernet.h>
+
+#include <net/bpf.h>
+
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_action.h>
+#include <net80211/ieee80211_input.h>
+#include <net80211/ieee80211_mesh.h>
static void hwmp_vattach(struct ieee80211vap *);
static void hwmp_vdetach(struct ieee80211vap *);
diff --git a/freebsd/sys/net80211/ieee80211_input.c b/freebsd/sys/net80211/ieee80211_input.c
index 60803d2f..a5ee1094 100644
--- a/freebsd/sys/net80211/ieee80211_input.c
+++ b/freebsd/sys/net80211/ieee80211_input.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001 Atsushi Onoe
@@ -26,37 +26,37 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_wlan.h>
+#include <rtems/bsd/local/opt_wlan.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/endian.h>
-#include <freebsd/sys/kernel.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/malloc.h>
+#include <sys/endian.h>
+#include <sys/kernel.h>
-#include <freebsd/sys/socket.h>
+#include <sys/socket.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_llc.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/if_vlan_var.h>
-
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_input.h>
+#include <net/ethernet.h>
+#include <net/if.h>
+#include <net/if_llc.h>
+#include <net/if_media.h>
+#include <net/if_vlan_var.h>
+
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_input.h>
#ifdef IEEE80211_SUPPORT_MESH
-#include <freebsd/net80211/ieee80211_mesh.h>
+#include <net80211/ieee80211_mesh.h>
#endif
-#include <freebsd/net/bpf.h>
+#include <net/bpf.h>
#ifdef INET
-#include <freebsd/netinet/in.h>
-#include <freebsd/net/ethernet.h>
+#include <netinet/in.h>
+#include <net/ethernet.h>
#endif
int
@@ -748,7 +748,7 @@ ieee80211_getbssid(const struct ieee80211vap *vap,
return wh->i_addr3;
}
-#include <freebsd/machine/stdarg.h>
+#include <machine/stdarg.h>
void
ieee80211_note(const struct ieee80211vap *vap, const char *fmt, ...)
diff --git a/freebsd/sys/net80211/ieee80211_input.h b/freebsd/sys/net80211/ieee80211_input.h
index 778badb6..5b38dddc 100644
--- a/freebsd/sys/net80211/ieee80211_input.h
+++ b/freebsd/sys/net80211/ieee80211_input.h
@@ -24,8 +24,8 @@
*
* $FreeBSD$
*/
-#ifndef _NET80211_IEEE80211_INPUT_HH_
-#define _NET80211_IEEE80211_INPUT_HH_
+#ifndef _NET80211_IEEE80211_INPUT_H_
+#define _NET80211_IEEE80211_INPUT_H_
/* Verify the existence and length of __elem or get out. */
#define IEEE80211_VERIFY_ELEMENT(__elem, __maxlen, _action) do { \
@@ -157,4 +157,4 @@ int ieee80211_alloc_challenge(struct ieee80211_node *);
int ieee80211_parse_beacon(struct ieee80211_node *, struct mbuf *,
struct ieee80211_scanparams *);
int ieee80211_parse_action(struct ieee80211_node *, struct mbuf *);
-#endif /* _NET80211_IEEE80211_INPUT_HH_ */
+#endif /* _NET80211_IEEE80211_INPUT_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_ioctl.c b/freebsd/sys/net80211/ieee80211_ioctl.c
index 87d1acc5..995c82f2 100644
--- a/freebsd/sys/net80211/ieee80211_ioctl.c
+++ b/freebsd/sys/net80211/ieee80211_ioctl.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001 Atsushi Onoe
@@ -26,44 +26,44 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* IEEE 802.11 ioctl support (FreeBSD-specific)
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_ipx.h>
-#include <freebsd/local/opt_wlan.h>
-
-#include <freebsd/sys/endian.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/systm.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_ipx.h>
+#include <rtems/bsd/local/opt_wlan.h>
+
+#include <sys/endian.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/priv.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/systm.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/ethernet.h>
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/if_media.h>
+#include <net/ethernet.h>
#ifdef INET
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/if_ether.h>
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
#endif
#ifdef IPX
-#include <freebsd/netipx/ipx.h>
-#include <freebsd/netipx/ipx_if.h>
+#include <netipx/ipx.h>
+#include <netipx/ipx_if.h>
#endif
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_ioctl.h>
-#include <freebsd/net80211/ieee80211_regdomain.h>
-#include <freebsd/net80211/ieee80211_input.h>
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_ioctl.h>
+#include <net80211/ieee80211_regdomain.h>
+#include <net80211/ieee80211_input.h>
#define IS_UP_AUTO(_vap) \
(IFNET_IS_UP_RUNNING((_vap)->iv_ifp) && \
diff --git a/freebsd/sys/net80211/ieee80211_ioctl.h b/freebsd/sys/net80211/ieee80211_ioctl.h
index 109a27fb..89d8fe53 100644
--- a/freebsd/sys/net80211/ieee80211_ioctl.h
+++ b/freebsd/sys/net80211/ieee80211_ioctl.h
@@ -25,15 +25,15 @@
*
* $FreeBSD$
*/
-#ifndef _NET80211_IEEE80211_IOCTL_HH_
-#define _NET80211_IEEE80211_IOCTL_HH_
+#ifndef _NET80211_IEEE80211_IOCTL_H_
+#define _NET80211_IEEE80211_IOCTL_H_
/*
* IEEE 802.11 ioctls.
*/
-#include <freebsd/net80211/_ieee80211.h>
-#include <freebsd/net80211/ieee80211.h>
-#include <freebsd/net80211/ieee80211_crypto.h>
+#include <net80211/_ieee80211.h>
+#include <net80211/ieee80211.h>
+#include <net80211/ieee80211_crypto.h>
/*
* Per/node (station) statistics.
@@ -846,4 +846,4 @@ struct ieee80211_clone_params {
#define IEEE80211_CLONE_TDMA 0x0010 /* operate in TDMA mode */
#endif /* __FreeBSD__ */
-#endif /* _NET80211_IEEE80211_IOCTL_HH_ */
+#endif /* _NET80211_IEEE80211_IOCTL_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_mesh.c b/freebsd/sys/net80211/ieee80211_mesh.c
index 06bac89a..1ed730fc 100644
--- a/freebsd/sys/net80211/ieee80211_mesh.c
+++ b/freebsd/sys/net80211/ieee80211_mesh.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2009 The FreeBSD Foundation
@@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
#ifdef __FreeBSD__
__FBSDID("$FreeBSD$");
#endif
@@ -38,31 +38,31 @@ __FBSDID("$FreeBSD$");
*
* Based on March 2009, D3.0 802.11s draft spec.
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_wlan.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/endian.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/if_llc.h>
-#include <freebsd/net/ethernet.h>
-
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_action.h>
-#include <freebsd/net80211/ieee80211_input.h>
-#include <freebsd/net80211/ieee80211_mesh.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_wlan.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/endian.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/proc.h>
+#include <sys/sysctl.h>
+
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/if_llc.h>
+#include <net/ethernet.h>
+
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_action.h>
+#include <net80211/ieee80211_input.h>
+#include <net80211/ieee80211_mesh.h>
static void mesh_rt_flush_invalid(struct ieee80211vap *);
static int mesh_select_proto_path(struct ieee80211vap *, const char *);
diff --git a/freebsd/sys/net80211/ieee80211_mesh.h b/freebsd/sys/net80211/ieee80211_mesh.h
index e90cd402..de9b5c2a 100644
--- a/freebsd/sys/net80211/ieee80211_mesh.h
+++ b/freebsd/sys/net80211/ieee80211_mesh.h
@@ -28,8 +28,8 @@
*
* $FreeBSD$
*/
-#ifndef _NET80211_IEEE80211_MESH_HH_
-#define _NET80211_IEEE80211_MESH_HH_
+#ifndef _NET80211_IEEE80211_MESH_H_
+#define _NET80211_IEEE80211_MESH_H_
#define IEEE80211_MESH_DEFAULT_TTL 31
@@ -500,4 +500,4 @@ ieee80211_mesh_discover(struct ieee80211vap *vap,
}
#endif /* _KERNEL */
-#endif /* !_NET80211_IEEE80211_MESH_HH_ */
+#endif /* !_NET80211_IEEE80211_MESH_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_monitor.c b/freebsd/sys/net80211/ieee80211_monitor.c
index b87c1d37..70b95a02 100644
--- a/freebsd/sys/net80211/ieee80211_monitor.c
+++ b/freebsd/sys/net80211/ieee80211_monitor.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2007-2008 Sam Leffler, Errno Consulting
@@ -25,7 +25,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
#ifdef __FreeBSD__
__FBSDID("$FreeBSD$");
#endif
@@ -33,31 +33,31 @@ __FBSDID("$FreeBSD$");
/*
* IEEE 802.11 Monitor mode support.
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_wlan.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/endian.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/if_llc.h>
-#include <freebsd/net/ethernet.h>
-
-#include <freebsd/net/bpf.h>
-
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_monitor.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_wlan.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/endian.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/proc.h>
+#include <sys/sysctl.h>
+
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/if_llc.h>
+#include <net/ethernet.h>
+
+#include <net/bpf.h>
+
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_monitor.h>
static void monitor_vattach(struct ieee80211vap *);
static int monitor_newstate(struct ieee80211vap *, enum ieee80211_state, int);
diff --git a/freebsd/sys/net80211/ieee80211_monitor.h b/freebsd/sys/net80211/ieee80211_monitor.h
index 09f95dba..d7dd8e98 100644
--- a/freebsd/sys/net80211/ieee80211_monitor.h
+++ b/freebsd/sys/net80211/ieee80211_monitor.h
@@ -24,12 +24,12 @@
*
* $FreeBSD$
*/
-#ifndef _NET80211_IEEE80211_MONITOR_HH_
-#define _NET80211_IEEE80211_MONITOR_HH_
+#ifndef _NET80211_IEEE80211_MONITOR_H_
+#define _NET80211_IEEE80211_MONITOR_H_
/*
* Monitor implementation definitions.
*/
void ieee80211_monitor_attach(struct ieee80211com *);
void ieee80211_monitor_detach(struct ieee80211com *);
-#endif /* !_NET80211_IEEE80211_MONITOR_HH_ */
+#endif /* !_NET80211_IEEE80211_MONITOR_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_node.c b/freebsd/sys/net80211/ieee80211_node.c
index 8b8335c1..95993d88 100644
--- a/freebsd/sys/net80211/ieee80211_node.c
+++ b/freebsd/sys/net80211/ieee80211_node.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001 Atsushi Onoe
@@ -26,36 +26,36 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_wlan.h>
+#include <rtems/bsd/local/opt_wlan.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
-#include <freebsd/sys/socket.h>
+#include <sys/socket.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/ethernet.h>
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/ethernet.h>
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_input.h>
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_input.h>
#ifdef IEEE80211_SUPPORT_SUPERG
-#include <freebsd/net80211/ieee80211_superg.h>
+#include <net80211/ieee80211_superg.h>
#endif
#ifdef IEEE80211_SUPPORT_TDMA
-#include <freebsd/net80211/ieee80211_tdma.h>
+#include <net80211/ieee80211_tdma.h>
#endif
-#include <freebsd/net80211/ieee80211_wds.h>
-#include <freebsd/net80211/ieee80211_mesh.h>
-#include <freebsd/net80211/ieee80211_ratectl.h>
+#include <net80211/ieee80211_wds.h>
+#include <net80211/ieee80211_mesh.h>
+#include <net80211/ieee80211_ratectl.h>
-#include <freebsd/net/bpf.h>
+#include <net/bpf.h>
/*
* IEEE80211_NODE_HASHSIZE must be a power of 2.
diff --git a/freebsd/sys/net80211/ieee80211_node.h b/freebsd/sys/net80211/ieee80211_node.h
index cf47a101..01bb2cf1 100644
--- a/freebsd/sys/net80211/ieee80211_node.h
+++ b/freebsd/sys/net80211/ieee80211_node.h
@@ -25,11 +25,11 @@
*
* $FreeBSD$
*/
-#ifndef _NET80211_IEEE80211_NODE_HH_
-#define _NET80211_IEEE80211_NODE_HH_
+#ifndef _NET80211_IEEE80211_NODE_H_
+#define _NET80211_IEEE80211_NODE_H_
-#include <freebsd/net80211/ieee80211_ioctl.h> /* for ieee80211_nodestats */
-#include <freebsd/net80211/ieee80211_ht.h> /* for aggregation state */
+#include <net80211/ieee80211_ioctl.h> /* for ieee80211_nodestats */
+#include <net80211/ieee80211_ht.h> /* for aggregation state */
/*
* Each ieee80211com instance has a single timer that fires every
@@ -453,4 +453,4 @@ void ieee80211_node_join(struct ieee80211_node *,int);
void ieee80211_node_leave(struct ieee80211_node *);
int8_t ieee80211_getrssi(struct ieee80211vap *);
void ieee80211_getsignal(struct ieee80211vap *, int8_t *, int8_t *);
-#endif /* _NET80211_IEEE80211_NODE_HH_ */
+#endif /* _NET80211_IEEE80211_NODE_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_output.c b/freebsd/sys/net80211/ieee80211_output.c
index b7abe9ec..24b49ab4 100644
--- a/freebsd/sys/net80211/ieee80211_output.c
+++ b/freebsd/sys/net80211/ieee80211_output.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001 Atsushi Onoe
@@ -26,50 +26,50 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_wlan.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_wlan.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/endian.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/kernel.h>
+#include <sys/endian.h>
-#include <freebsd/sys/socket.h>
+#include <sys/socket.h>
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_llc.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/if_vlan_var.h>
-
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_regdomain.h>
+#include <net/bpf.h>
+#include <net/ethernet.h>
+#include <net/if.h>
+#include <net/if_llc.h>
+#include <net/if_media.h>
+#include <net/if_vlan_var.h>
+
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_regdomain.h>
#ifdef IEEE80211_SUPPORT_SUPERG
-#include <freebsd/net80211/ieee80211_superg.h>
+#include <net80211/ieee80211_superg.h>
#endif
#ifdef IEEE80211_SUPPORT_TDMA
-#include <freebsd/net80211/ieee80211_tdma.h>
+#include <net80211/ieee80211_tdma.h>
#endif
-#include <freebsd/net80211/ieee80211_wds.h>
-#include <freebsd/net80211/ieee80211_mesh.h>
+#include <net80211/ieee80211_wds.h>
+#include <net80211/ieee80211_mesh.h>
#ifdef INET
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/if_ether.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
#endif
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
+#include <netinet/ip6.h>
#endif
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
#define ETHER_HEADER_COPY(dst, src) \
memcpy(dst, src, sizeof(struct ether_header))
diff --git a/freebsd/sys/net80211/ieee80211_phy.c b/freebsd/sys/net80211/ieee80211_phy.c
index 5c5a2f55..9d37a967 100644
--- a/freebsd/sys/net80211/ieee80211_phy.c
+++ b/freebsd/sys/net80211/ieee80211_phy.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2007-2008 Sam Leffler, Errno Consulting
@@ -25,26 +25,26 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* IEEE 802.11 PHY-related support.
*/
-#include <freebsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/systm.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
-#include <freebsd/sys/socket.h>
+#include <sys/socket.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
+#include <net/if.h>
+#include <net/if_media.h>
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_phy.h>
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_phy.h>
#ifdef notyet
struct ieee80211_ds_plcp_hdr {
diff --git a/freebsd/sys/net80211/ieee80211_phy.h b/freebsd/sys/net80211/ieee80211_phy.h
index af76e666..56b404f7 100644
--- a/freebsd/sys/net80211/ieee80211_phy.h
+++ b/freebsd/sys/net80211/ieee80211_phy.h
@@ -25,8 +25,8 @@
* $FreeBSD$
*/
-#ifndef _NET80211_IEEE80211_PHY_HH_
-#define _NET80211_IEEE80211_PHY_HH_
+#ifndef _NET80211_IEEE80211_PHY_H_
+#define _NET80211_IEEE80211_PHY_H_
#ifdef _KERNEL
/*
@@ -152,4 +152,4 @@ uint8_t ieee80211_plcp2rate(uint8_t, enum ieee80211_phytype);
*/
uint8_t ieee80211_rate2plcp(int, enum ieee80211_phytype);
#endif /* _KERNEL */
-#endif /* !_NET80211_IEEE80211_PHY_HH_ */
+#endif /* !_NET80211_IEEE80211_PHY_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_power.c b/freebsd/sys/net80211/ieee80211_power.c
index f56a641f..c15080c4 100644
--- a/freebsd/sys/net80211/ieee80211_power.c
+++ b/freebsd/sys/net80211/ieee80211_power.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
@@ -25,27 +25,27 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* IEEE 802.11 power save support.
*/
-#include <freebsd/local/opt_wlan.h>
+#include <rtems/bsd/local/opt_wlan.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
-#include <freebsd/sys/socket.h>
+#include <sys/socket.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/ethernet.h>
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/ethernet.h>
-#include <freebsd/net80211/ieee80211_var.h>
+#include <net80211/ieee80211_var.h>
-#include <freebsd/net/bpf.h>
+#include <net/bpf.h>
static void ieee80211_update_ps(struct ieee80211vap *, int);
static int ieee80211_set_tim(struct ieee80211_node *, int);
diff --git a/freebsd/sys/net80211/ieee80211_power.h b/freebsd/sys/net80211/ieee80211_power.h
index 6cb0eab8..352cdadb 100644
--- a/freebsd/sys/net80211/ieee80211_power.h
+++ b/freebsd/sys/net80211/ieee80211_power.h
@@ -24,8 +24,8 @@
*
* $FreeBSD$
*/
-#ifndef _NET80211_IEEE80211_POWER_HH_
-#define _NET80211_IEEE80211_POWER_HH_
+#ifndef _NET80211_IEEE80211_POWER_H_
+#define _NET80211_IEEE80211_POWER_H_
struct ieee80211com;
struct ieee80211vap;
@@ -76,4 +76,4 @@ void ieee80211_node_pwrsave(struct ieee80211_node *, int enable);
void ieee80211_sta_pwrsave(struct ieee80211vap *, int enable);
void ieee80211_power_poll(struct ieee80211com *);
-#endif /* _NET80211_IEEE80211_POWER_HH_ */
+#endif /* _NET80211_IEEE80211_POWER_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_proto.c b/freebsd/sys/net80211/ieee80211_proto.c
index 70c5f299..d2874951 100644
--- a/freebsd/sys/net80211/ieee80211_proto.c
+++ b/freebsd/sys/net80211/ieee80211_proto.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001 Atsushi Onoe
@@ -26,37 +26,37 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* IEEE 802.11 protocol support.
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_wlan.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_wlan.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/systm.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/ethernet.h> /* XXX for ether_sprintf */
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/ethernet.h> /* XXX for ether_sprintf */
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_adhoc.h>
-#include <freebsd/net80211/ieee80211_sta.h>
-#include <freebsd/net80211/ieee80211_hostap.h>
-#include <freebsd/net80211/ieee80211_wds.h>
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_adhoc.h>
+#include <net80211/ieee80211_sta.h>
+#include <net80211/ieee80211_hostap.h>
+#include <net80211/ieee80211_wds.h>
#ifdef IEEE80211_SUPPORT_MESH
-#include <freebsd/net80211/ieee80211_mesh.h>
+#include <net80211/ieee80211_mesh.h>
#endif
-#include <freebsd/net80211/ieee80211_monitor.h>
-#include <freebsd/net80211/ieee80211_input.h>
+#include <net80211/ieee80211_monitor.h>
+#include <net80211/ieee80211_input.h>
/* XXX tunables */
#define AGGRESSIVE_MODE_SWITCH_HYSTERESIS 3 /* pkts / 100ms */
diff --git a/freebsd/sys/net80211/ieee80211_proto.h b/freebsd/sys/net80211/ieee80211_proto.h
index f81a6433..c2808477 100644
--- a/freebsd/sys/net80211/ieee80211_proto.h
+++ b/freebsd/sys/net80211/ieee80211_proto.h
@@ -25,8 +25,8 @@
*
* $FreeBSD$
*/
-#ifndef _NET80211_IEEE80211_PROTO_HH_
-#define _NET80211_IEEE80211_PROTO_HH_
+#ifndef _NET80211_IEEE80211_PROTO_H_
+#define _NET80211_IEEE80211_PROTO_H_
/*
* 802.11 protocol implementation definitions.
@@ -384,4 +384,4 @@ void ieee80211_notify_node_auth(struct ieee80211_node *);
void ieee80211_notify_country(struct ieee80211vap *, const uint8_t [],
const uint8_t cc[2]);
void ieee80211_notify_radio(struct ieee80211com *, int);
-#endif /* _NET80211_IEEE80211_PROTO_HH_ */
+#endif /* _NET80211_IEEE80211_PROTO_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_radiotap.c b/freebsd/sys/net80211/ieee80211_radiotap.c
index f630ae99..b51974b3 100644
--- a/freebsd/sys/net80211/ieee80211_radiotap.c
+++ b/freebsd/sys/net80211/ieee80211_radiotap.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2009 Sam Leffler, Errno Consulting
@@ -25,29 +25,29 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* IEEE 802.11 radiotap support.
*/
-#include <freebsd/local/opt_wlan.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/endian.h>
-#include <freebsd/sys/kernel.h>
+#include <rtems/bsd/local/opt_wlan.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/malloc.h>
+#include <sys/endian.h>
+#include <sys/kernel.h>
-#include <freebsd/sys/socket.h>
+#include <sys/socket.h>
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_llc.h>
-#include <freebsd/net/if_media.h>
+#include <net/bpf.h>
+#include <net/if.h>
+#include <net/if_llc.h>
+#include <net/if_media.h>
-#include <freebsd/net80211/ieee80211_var.h>
+#include <net80211/ieee80211_var.h>
static int radiotap_offset(struct ieee80211_radiotap_header *, int);
diff --git a/freebsd/sys/net80211/ieee80211_radiotap.h b/freebsd/sys/net80211/ieee80211_radiotap.h
index 89eac4be..b8a8b510 100644
--- a/freebsd/sys/net80211/ieee80211_radiotap.h
+++ b/freebsd/sys/net80211/ieee80211_radiotap.h
@@ -29,8 +29,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*/
-#ifndef _NET80211_IEEE80211_RADIOTAP_HH_
-#define _NET80211_IEEE80211_RADIOTAP_HH_
+#ifndef _NET80211_IEEE80211_RADIOTAP_H_
+#define _NET80211_IEEE80211_RADIOTAP_H_
/* A generic radio capture format is desirable. It must be
* rigidly defined (e.g., units for fields should be given),
@@ -231,4 +231,4 @@ enum ieee80211_radiotap_type {
#define IEEE80211_RADIOTAP_F_BADFCS 0x40 /* does not pass FCS check */
#define IEEE80211_RADIOTAP_F_SHORTGI 0x80 /* HT short GI */
-#endif /* !_NET80211_IEEE80211_RADIOTAP_HH_ */
+#endif /* !_NET80211_IEEE80211_RADIOTAP_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_ratectl.c b/freebsd/sys/net80211/ieee80211_ratectl.c
index 8eede3cb..b54188e0 100644
--- a/freebsd/sys/net80211/ieee80211_ratectl.c
+++ b/freebsd/sys/net80211/ieee80211_ratectl.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2010 Rui Paulo <rpaulo@FreeBSD.org>
@@ -25,19 +25,19 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/socket.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
+#include <sys/socket.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
+#include <net/if.h>
+#include <net/if_media.h>
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_ratectl.h>
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_ratectl.h>
static const struct ieee80211_ratectl *ratectls[IEEE80211_RATECTL_MAX];
diff --git a/freebsd/sys/net80211/ieee80211_ratectl_none.c b/freebsd/sys/net80211/ieee80211_ratectl_none.c
index 97f0749f..62b7c99c 100644
--- a/freebsd/sys/net80211/ieee80211_ratectl_none.c
+++ b/freebsd/sys/net80211/ieee80211_ratectl_none.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2010 Bernhard Schmidt <bschmidt@FreeBSD.org>
@@ -25,27 +25,27 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_wlan.h>
+#include <rtems/bsd/local/opt_wlan.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/socket.h>
+#include <sys/sysctl.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
+#include <net/if.h>
+#include <net/if_media.h>
#ifdef INET
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/if_ether.h>
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
#endif
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_ratectl.h>
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_ratectl.h>
static void
none_init(struct ieee80211vap *vap)
diff --git a/freebsd/sys/net80211/ieee80211_regdomain.c b/freebsd/sys/net80211/ieee80211_regdomain.c
index e83132c8..890ddf79 100644
--- a/freebsd/sys/net80211/ieee80211_regdomain.c
+++ b/freebsd/sys/net80211/ieee80211_regdomain.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2005-2008 Sam Leffler, Errno Consulting
@@ -25,25 +25,25 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* IEEE 802.11 regdomain support.
*/
-#include <freebsd/local/opt_wlan.h>
+#include <rtems/bsd/local/opt_wlan.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
-#include <freebsd/sys/socket.h>
+#include <sys/socket.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
+#include <net/if.h>
+#include <net/if_media.h>
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_regdomain.h>
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_regdomain.h>
static void
null_getradiocaps(struct ieee80211com *ic, int maxchan,
diff --git a/freebsd/sys/net80211/ieee80211_regdomain.h b/freebsd/sys/net80211/ieee80211_regdomain.h
index f71c1093..8942dd98 100644
--- a/freebsd/sys/net80211/ieee80211_regdomain.h
+++ b/freebsd/sys/net80211/ieee80211_regdomain.h
@@ -24,8 +24,8 @@
*
* $FreeBSD$
*/
-#ifndef _NET80211_IEEE80211_REGDOMAIN_HH_
-#define _NET80211_IEEE80211_REGDOMAIN_HH_
+#ifndef _NET80211_IEEE80211_REGDOMAIN_H_
+#define _NET80211_IEEE80211_REGDOMAIN_H_
/*
* 802.11 regulatory domain definitions.
@@ -279,4 +279,4 @@ struct ieee80211_regdomain_req;
int ieee80211_setregdomain(struct ieee80211vap *,
struct ieee80211_regdomain_req *);
#endif /* defined(__KERNEL__) || defined(_KERNEL) */
-#endif /* _NET80211_IEEE80211_REGDOMAIN_HH_ */
+#endif /* _NET80211_IEEE80211_REGDOMAIN_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_rssadapt.c b/freebsd/sys/net80211/ieee80211_rssadapt.c
index b50d2e66..687ea41e 100644
--- a/freebsd/sys/net80211/ieee80211_rssadapt.c
+++ b/freebsd/sys/net80211/ieee80211_rssadapt.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/* $NetBSD: ieee80211_rssadapt.c,v 1.9 2005/02/26 22:45:09 perry Exp $ */
@@ -32,20 +32,20 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*/
-#include <freebsd/local/opt_wlan.h>
+#include <rtems/bsd/local/opt_wlan.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/socket.h>
+#include <sys/sysctl.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
+#include <net/if.h>
+#include <net/if_media.h>
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_rssadapt.h>
-#include <freebsd/net80211/ieee80211_ratectl.h>
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_rssadapt.h>
+#include <net80211/ieee80211_ratectl.h>
struct rssadapt_expavgctl {
/* RSS threshold decay. */
diff --git a/freebsd/sys/net80211/ieee80211_rssadapt.h b/freebsd/sys/net80211/ieee80211_rssadapt.h
index 26211ece..ee1d2d90 100644
--- a/freebsd/sys/net80211/ieee80211_rssadapt.h
+++ b/freebsd/sys/net80211/ieee80211_rssadapt.h
@@ -29,8 +29,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*/
-#ifndef _NET80211_IEEE80211_RSSADAPT_HH_
-#define _NET80211_IEEE80211_RSSADAPT_HH_
+#ifndef _NET80211_IEEE80211_RSSADAPT_H_
+#define _NET80211_IEEE80211_RSSADAPT_H_
/* Data-rate adaptation loosely based on "Link Adaptation Strategy
* for IEEE 802.11 WLAN via Received Signal Strength Measurement"
@@ -68,4 +68,4 @@ struct ieee80211_rssadapt_node {
#define IEEE80211_RSSADAPT_SUCCESS 1
#define IEEE80211_RSSADAPT_FAILURE 0
-#endif /* _NET80211_IEEE80211_RSSADAPT_HH_ */
+#endif /* _NET80211_IEEE80211_RSSADAPT_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_scan.c b/freebsd/sys/net80211/ieee80211_scan.c
index bda486ec..4a23066d 100644
--- a/freebsd/sys/net80211/ieee80211_scan.c
+++ b/freebsd/sys/net80211/ieee80211_scan.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
@@ -25,29 +25,29 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* IEEE 802.11 scanning support.
*/
-#include <freebsd/local/opt_wlan.h>
+#include <rtems/bsd/local/opt_wlan.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/condvar.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/proc.h>
+#include <sys/kernel.h>
+#include <sys/condvar.h>
-#include <freebsd/sys/socket.h>
+#include <sys/socket.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/ethernet.h>
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/ethernet.h>
-#include <freebsd/net80211/ieee80211_var.h>
+#include <net80211/ieee80211_var.h>
-#include <freebsd/net/bpf.h>
+#include <net/bpf.h>
struct scan_state {
struct ieee80211_scan_state base; /* public state */
diff --git a/freebsd/sys/net80211/ieee80211_scan.h b/freebsd/sys/net80211/ieee80211_scan.h
index 6273902d..4c5e869a 100644
--- a/freebsd/sys/net80211/ieee80211_scan.h
+++ b/freebsd/sys/net80211/ieee80211_scan.h
@@ -24,8 +24,8 @@
*
* $FreeBSD$
*/
-#ifndef _NET80211_IEEE80211_SCAN_HH_
-#define _NET80211_IEEE80211_SCAN_HH_
+#ifndef _NET80211_IEEE80211_SCAN_H_
+#define _NET80211_IEEE80211_SCAN_H_
/*
* 802.11 scanning support.
@@ -298,4 +298,4 @@ void ieee80211_scanner_unregister(enum ieee80211_opmode,
const struct ieee80211_scanner *);
void ieee80211_scanner_unregister_all(const struct ieee80211_scanner *);
const struct ieee80211_scanner *ieee80211_scanner_get(enum ieee80211_opmode);
-#endif /* _NET80211_IEEE80211_SCAN_HH_ */
+#endif /* _NET80211_IEEE80211_SCAN_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_scan_sta.c b/freebsd/sys/net80211/ieee80211_scan_sta.c
index aa9d67ec..573f994f 100644
--- a/freebsd/sys/net80211/ieee80211_scan_sta.c
+++ b/freebsd/sys/net80211/ieee80211_scan_sta.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
@@ -25,36 +25,36 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* IEEE 802.11 station scanning support.
*/
-#include <freebsd/local/opt_wlan.h>
+#include <rtems/bsd/local/opt_wlan.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
-#include <freebsd/sys/socket.h>
+#include <sys/socket.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/ethernet.h>
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/ethernet.h>
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_input.h>
-#include <freebsd/net80211/ieee80211_regdomain.h>
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_input.h>
+#include <net80211/ieee80211_regdomain.h>
#ifdef IEEE80211_SUPPORT_TDMA
-#include <freebsd/net80211/ieee80211_tdma.h>
+#include <net80211/ieee80211_tdma.h>
#endif
#ifdef IEEE80211_SUPPORT_MESH
-#include <freebsd/net80211/ieee80211_mesh.h>
+#include <net80211/ieee80211_mesh.h>
#endif
-#include <freebsd/net/bpf.h>
+#include <net/bpf.h>
/*
* Parameters for managing cache entries:
diff --git a/freebsd/sys/net80211/ieee80211_sta.c b/freebsd/sys/net80211/ieee80211_sta.c
index 67704469..d07e83c4 100644
--- a/freebsd/sys/net80211/ieee80211_sta.c
+++ b/freebsd/sys/net80211/ieee80211_sta.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2007-2008 Sam Leffler, Errno Consulting
@@ -25,7 +25,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
#ifdef __FreeBSD__
__FBSDID("$FreeBSD$");
#endif
@@ -33,36 +33,36 @@ __FBSDID("$FreeBSD$");
/*
* IEEE 802.11 Station mode support.
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_wlan.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/endian.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/if_llc.h>
-#include <freebsd/net/ethernet.h>
-
-#include <freebsd/net/bpf.h>
-
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_sta.h>
-#include <freebsd/net80211/ieee80211_input.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_wlan.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/endian.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/proc.h>
+#include <sys/sysctl.h>
+
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/if_llc.h>
+#include <net/ethernet.h>
+
+#include <net/bpf.h>
+
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_sta.h>
+#include <net80211/ieee80211_input.h>
#ifdef IEEE80211_SUPPORT_SUPERG
-#include <freebsd/net80211/ieee80211_superg.h>
+#include <net80211/ieee80211_superg.h>
#endif
-#include <freebsd/net80211/ieee80211_ratectl.h>
+#include <net80211/ieee80211_ratectl.h>
#define IEEE80211_RATE2MBS(r) (((r) & IEEE80211_RATE_VAL) / 2)
diff --git a/freebsd/sys/net80211/ieee80211_sta.h b/freebsd/sys/net80211/ieee80211_sta.h
index 43316f5b..1508a7c7 100644
--- a/freebsd/sys/net80211/ieee80211_sta.h
+++ b/freebsd/sys/net80211/ieee80211_sta.h
@@ -24,8 +24,8 @@
*
* $FreeBSD$
*/
-#ifndef _NET80211_IEEE80211_STA_HH_
-#define _NET80211_IEEE80211_STA_HH_
+#ifndef _NET80211_IEEE80211_STA_H_
+#define _NET80211_IEEE80211_STA_H_
/*
* Station-mode implementation definitions.
@@ -33,4 +33,4 @@
void ieee80211_sta_attach(struct ieee80211com *);
void ieee80211_sta_detach(struct ieee80211com *);
void ieee80211_sta_vattach(struct ieee80211vap *);
-#endif /* !_NET80211_IEEE80211_STA_HH_ */
+#endif /* !_NET80211_IEEE80211_STA_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_superg.c b/freebsd/sys/net80211/ieee80211_superg.c
index dd886e41..3fcfcd74 100644
--- a/freebsd/sys/net80211/ieee80211_superg.c
+++ b/freebsd/sys/net80211/ieee80211_superg.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
@@ -25,29 +25,29 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_wlan.h>
+#include <rtems/bsd/local/opt_wlan.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/endian.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/kernel.h>
+#include <sys/endian.h>
-#include <freebsd/sys/socket.h>
+#include <sys/socket.h>
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_llc.h>
-#include <freebsd/net/if_media.h>
-
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_input.h>
-#include <freebsd/net80211/ieee80211_phy.h>
-#include <freebsd/net80211/ieee80211_superg.h>
+#include <net/bpf.h>
+#include <net/ethernet.h>
+#include <net/if.h>
+#include <net/if_llc.h>
+#include <net/if_media.h>
+
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_input.h>
+#include <net80211/ieee80211_phy.h>
+#include <net80211/ieee80211_superg.h>
/*
* Atheros fast-frame encapsulation format.
diff --git a/freebsd/sys/net80211/ieee80211_superg.h b/freebsd/sys/net80211/ieee80211_superg.h
index bda45dda..970a5fef 100644
--- a/freebsd/sys/net80211/ieee80211_superg.h
+++ b/freebsd/sys/net80211/ieee80211_superg.h
@@ -24,8 +24,8 @@
*
* $FreeBSD$
*/
-#ifndef _NET80211_IEEE80211_SUPERG_HH_
-#define _NET80211_IEEE80211_SUPERG_HH_
+#ifndef _NET80211_IEEE80211_SUPERG_H_
+#define _NET80211_IEEE80211_SUPERG_H_
/*
* Atheros' 802.11 SuperG protocol support.
@@ -126,4 +126,4 @@ ieee80211_decap_fastframe(struct ieee80211vap *vap, struct ieee80211_node *ni,
ieee80211_ff_decap(ni, m) : m;
}
#endif /* _KERNEL */
-#endif /* _NET80211_IEEE80211_SUPERG_HH_ */
+#endif /* _NET80211_IEEE80211_SUPERG_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_tdma.c b/freebsd/sys/net80211/ieee80211_tdma.c
index c41ca491..1a6b3298 100644
--- a/freebsd/sys/net80211/ieee80211_tdma.c
+++ b/freebsd/sys/net80211/ieee80211_tdma.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2007-2009 Sam Leffler, Errno Consulting
@@ -26,7 +26,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
#ifdef __FreeBSD__
__FBSDID("$FreeBSD$");
#endif
@@ -34,33 +34,33 @@ __FBSDID("$FreeBSD$");
/*
* IEEE 802.11 TDMA mode support.
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_tdma.h>
-#include <freebsd/local/opt_wlan.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/endian.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/if_llc.h>
-#include <freebsd/net/ethernet.h>
-
-#include <freebsd/net/bpf.h>
-
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_tdma.h>
-#include <freebsd/net80211/ieee80211_input.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_tdma.h>
+#include <rtems/bsd/local/opt_wlan.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/endian.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/proc.h>
+#include <sys/sysctl.h>
+
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/if_llc.h>
+#include <net/ethernet.h>
+
+#include <net/bpf.h>
+
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_tdma.h>
+#include <net80211/ieee80211_input.h>
#ifndef TDMA_SLOTLEN_DEFAULT
#define TDMA_SLOTLEN_DEFAULT 10*1000 /* 10ms */
diff --git a/freebsd/sys/net80211/ieee80211_tdma.h b/freebsd/sys/net80211/ieee80211_tdma.h
index 989d6417..2fe591f7 100644
--- a/freebsd/sys/net80211/ieee80211_tdma.h
+++ b/freebsd/sys/net80211/ieee80211_tdma.h
@@ -25,8 +25,8 @@
*
* $FreeBSD$
*/
-#ifndef _NET80211_IEEE80211_TDMA_HH_
-#define _NET80211_IEEE80211_TDMA_HH_
+#ifndef _NET80211_IEEE80211_TDMA_H_
+#define _NET80211_IEEE80211_TDMA_H_
/*
* TDMA-mode implementation definitions.
@@ -99,4 +99,4 @@ struct ieee80211_beacon_offsets;
void ieee80211_tdma_update_beacon(struct ieee80211vap *vap,
struct ieee80211_beacon_offsets *bo);
#endif /* _KERNEL */
-#endif /* !_NET80211_IEEE80211_TDMA_HH_ */
+#endif /* !_NET80211_IEEE80211_TDMA_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_var.h b/freebsd/sys/net80211/ieee80211_var.h
index 2ab54b78..58a46d3b 100644
--- a/freebsd/sys/net80211/ieee80211_var.h
+++ b/freebsd/sys/net80211/ieee80211_var.h
@@ -25,35 +25,35 @@
*
* $FreeBSD$
*/
-#ifndef _NET80211_IEEE80211_VAR_HH_
-#define _NET80211_IEEE80211_VAR_HH_
+#ifndef _NET80211_IEEE80211_VAR_H_
+#define _NET80211_IEEE80211_VAR_H_
/*
* Definitions for IEEE 802.11 drivers.
*/
/* NB: portability glue must go first */
#if defined(__NetBSD__)
-#include <freebsd/net80211/ieee80211_netbsd.h>
+#include <net80211/ieee80211_netbsd.h>
#elif defined(__FreeBSD__)
-#include <freebsd/net80211/ieee80211_freebsd.h>
+#include <net80211/ieee80211_freebsd.h>
#elif defined(__linux__)
-#include <freebsd/net80211/ieee80211_linux.h>
+#include <net80211/ieee80211_linux.h>
#else
#error "No support for your operating system!"
#endif
-#include <freebsd/net80211/_ieee80211.h>
-#include <freebsd/net80211/ieee80211.h>
-#include <freebsd/net80211/ieee80211_ageq.h>
-#include <freebsd/net80211/ieee80211_crypto.h>
-#include <freebsd/net80211/ieee80211_dfs.h>
-#include <freebsd/net80211/ieee80211_ioctl.h> /* for ieee80211_stats */
-#include <freebsd/net80211/ieee80211_phy.h>
-#include <freebsd/net80211/ieee80211_power.h>
-#include <freebsd/net80211/ieee80211_node.h>
-#include <freebsd/net80211/ieee80211_proto.h>
-#include <freebsd/net80211/ieee80211_radiotap.h>
-#include <freebsd/net80211/ieee80211_scan.h>
+#include <net80211/_ieee80211.h>
+#include <net80211/ieee80211.h>
+#include <net80211/ieee80211_ageq.h>
+#include <net80211/ieee80211_crypto.h>
+#include <net80211/ieee80211_dfs.h>
+#include <net80211/ieee80211_ioctl.h> /* for ieee80211_stats */
+#include <net80211/ieee80211_phy.h>
+#include <net80211/ieee80211_power.h>
+#include <net80211/ieee80211_node.h>
+#include <net80211/ieee80211_proto.h>
+#include <net80211/ieee80211_radiotap.h>
+#include <net80211/ieee80211_scan.h>
#define IEEE80211_TXPOWER_MAX 100 /* .5 dbM (XXX units?) */
#define IEEE80211_TXPOWER_MIN 0 /* kill radio */
@@ -913,4 +913,4 @@ void ieee80211_discard_mac(const struct ieee80211vap *,
#define IEEE80211_DISCARD_MAC(_vap, _m, _mac, _type, _fmt, ...)
#endif
-#endif /* _NET80211_IEEE80211_VAR_HH_ */
+#endif /* _NET80211_IEEE80211_VAR_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_wds.c b/freebsd/sys/net80211/ieee80211_wds.c
index b0f5378d..772f305c 100644
--- a/freebsd/sys/net80211/ieee80211_wds.c
+++ b/freebsd/sys/net80211/ieee80211_wds.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2007-2008 Sam Leffler, Errno Consulting
@@ -25,7 +25,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
#ifdef __FreeBSD__
__FBSDID("$FreeBSD$");
#endif
@@ -33,34 +33,34 @@ __FBSDID("$FreeBSD$");
/*
* IEEE 802.11 WDS mode support.
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_wlan.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/endian.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/if_llc.h>
-#include <freebsd/net/ethernet.h>
-
-#include <freebsd/net/bpf.h>
-
-#include <freebsd/net80211/ieee80211_var.h>
-#include <freebsd/net80211/ieee80211_wds.h>
-#include <freebsd/net80211/ieee80211_input.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_wlan.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/endian.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/proc.h>
+#include <sys/sysctl.h>
+
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/if_llc.h>
+#include <net/ethernet.h>
+
+#include <net/bpf.h>
+
+#include <net80211/ieee80211_var.h>
+#include <net80211/ieee80211_wds.h>
+#include <net80211/ieee80211_input.h>
#ifdef IEEE80211_SUPPORT_SUPERG
-#include <freebsd/net80211/ieee80211_superg.h>
+#include <net80211/ieee80211_superg.h>
#endif
static void wds_vattach(struct ieee80211vap *);
diff --git a/freebsd/sys/net80211/ieee80211_wds.h b/freebsd/sys/net80211/ieee80211_wds.h
index 200cba27..c34fb6ee 100644
--- a/freebsd/sys/net80211/ieee80211_wds.h
+++ b/freebsd/sys/net80211/ieee80211_wds.h
@@ -24,8 +24,8 @@
*
* $FreeBSD$
*/
-#ifndef _NET80211_IEEE80211_WDS_HH_
-#define _NET80211_IEEE80211_WDS_HH_
+#ifndef _NET80211_IEEE80211_WDS_H_
+#define _NET80211_IEEE80211_WDS_H_
/*
* WDS implementation definitions.
@@ -36,4 +36,4 @@ void ieee80211_wds_detach(struct ieee80211com *);
void ieee80211_dwds_mcast(struct ieee80211vap *, struct mbuf *);
void ieee80211_dwds_discover(struct ieee80211_node *, struct mbuf *);
int ieee80211_node_wdsq_age(struct ieee80211_node *);
-#endif /* !_NET80211_IEEE80211_WDS_HH_ */
+#endif /* !_NET80211_IEEE80211_WDS_H_ */
diff --git a/freebsd/sys/net80211/ieee80211_xauth.c b/freebsd/sys/net80211/ieee80211_xauth.c
index 55318069..7c937906 100644
--- a/freebsd/sys/net80211/ieee80211_xauth.c
+++ b/freebsd/sys/net80211/ieee80211_xauth.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2004 Video54 Technologies, Inc.
@@ -26,7 +26,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -41,22 +41,22 @@ __FBSDID("$FreeBSD$");
* of the available callbacks--the user mode authenticator process works
* entirely from messages about stations joining and leaving.
*/
-#include <freebsd/local/opt_wlan.h>
+#include <rtems/bsd/local/opt_wlan.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
-#include <freebsd/sys/socket.h>
+#include <sys/socket.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_media.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/route.h>
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/ethernet.h>
+#include <net/route.h>
-#include <freebsd/net80211/ieee80211_var.h>
+#include <net80211/ieee80211_var.h>
/* XXX number of references from net80211 layer; needed for module code */
static int nrefs = 0;
diff --git a/freebsd/sys/netatalk/aarp.c b/freebsd/sys/netatalk/aarp.c
index 63fabede..d8daf757 100644
--- a/freebsd/sys/netatalk/aarp.c
+++ b/freebsd/sys/netatalk/aarp.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2004-2009 Robert N. M. Watson
@@ -52,29 +52,29 @@
* $FreeBSD$
*/
-#include <freebsd/local/opt_atalk.h>
+#include <rtems/bsd/local/opt_atalk.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/syslog.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/kernel.h>
+#include <sys/socket.h>
+#include <sys/syslog.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_dl.h>
+#include <net/if.h>
+#include <net/if_dl.h>
-#include <freebsd/netinet/in.h>
+#include <netinet/in.h>
#undef s_net
-#include <freebsd/netinet/if_ether.h>
+#include <netinet/if_ether.h>
-#include <freebsd/netatalk/at.h>
-#include <freebsd/netatalk/at_var.h>
-#include <freebsd/netatalk/aarp.h>
-#include <freebsd/netatalk/phase2.h>
-#include <freebsd/netatalk/at_extern.h>
+#include <netatalk/at.h>
+#include <netatalk/at_var.h>
+#include <netatalk/aarp.h>
+#include <netatalk/phase2.h>
+#include <netatalk/at_extern.h>
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
static void aarptfree(struct aarptab *aat);
static void at_aarpinput(struct ifnet *ifp, struct mbuf *m);
diff --git a/freebsd/sys/netatalk/aarp.h b/freebsd/sys/netatalk/aarp.h
index 4d7e06ac..b55a9a7c 100644
--- a/freebsd/sys/netatalk/aarp.h
+++ b/freebsd/sys/netatalk/aarp.h
@@ -26,8 +26,8 @@
* $FreeBSD$
*/
-#ifndef _NETATALK_AARP_HH_
-#define _NETATALK_AARP_HH_
+#ifndef _NETATALK_AARP_H_
+#define _NETATALK_AARP_H_
/*
* This structure is used for both phase 1 and 2. Under phase 1
@@ -83,4 +83,4 @@ struct aarptab {
struct aarptab *aarptnew(struct at_addr *);
#endif
-#endif /* _NETATALK_AARP_HH_ */
+#endif /* _NETATALK_AARP_H_ */
diff --git a/freebsd/sys/netatalk/at.h b/freebsd/sys/netatalk/at.h
index 27e88acb..5a944c1a 100644
--- a/freebsd/sys/netatalk/at.h
+++ b/freebsd/sys/netatalk/at.h
@@ -1,2 +1,86 @@
-#include <freebsd/bsd.h>
-#include <freebsd/netatalk/at.h>
+/*-
+ * Copyright (c) 1990,1991 Regents of The University of Michigan.
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation, and that the name of The University
+ * of Michigan not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. This software is supplied as is without expressed or
+ * implied warranties of any kind.
+ *
+ * Research Systems Unix Group
+ * The University of Michigan
+ * c/o Mike Clark
+ * 535 W. William Street
+ * Ann Arbor, Michigan
+ * +1-313-763-0525
+ * netatalk@itd.umich.edu
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _NETATALK_AT_H_
+#define _NETATALK_AT_H_
+
+/*
+ * Supported protocols
+ */
+#define ATPROTO_DDP 0
+#define ATPROTO_AARP 254
+
+#define DDP_MAXSZ 587
+
+/*
+ * If ATPORT_FIRST <= Port < ATPORT_RESERVED, the port was created by a
+ * privileged process.
+ *
+ * If ATPORT_RESERVED <= Port < ATPORT_LAST, the port was not necessarily
+ * created by a privileged process.
+ */
+#define ATPORT_FIRST 1
+#define ATPORT_RESERVED 128
+#define ATPORT_LAST 255
+
+/*
+ * AppleTalk address.
+ */
+struct at_addr {
+ u_short s_net;
+ u_char s_node;
+};
+
+#define ATADDR_ANYNET (u_short)0x0000
+#define ATADDR_ANYNODE (u_char)0x00
+#define ATADDR_ANYPORT (u_char)0x00
+#define ATADDR_BCAST (u_char)0xff /* There is no BCAST for NET. */
+
+struct netrange {
+ u_char nr_phase;
+ u_short nr_firstnet;
+ u_short nr_lastnet;
+};
+
+/*
+ * Socket address, AppleTalk style. We keep magic information in the zero
+ * bytes. There are three types, NONE, CONFIG which has the phase and a net
+ * range, and IFACE which has the network address of an interface. IFACE may
+ * be filled in by the client, and is filled in by the kernel.
+ */
+struct sockaddr_at {
+ u_char sat_len;
+ u_char sat_family;
+ u_char sat_port;
+ struct at_addr sat_addr;
+ union {
+ struct netrange r_netrange;
+ char r_zero[8]; /* Hide struct netrange here. */
+ } sat_range;
+};
+
+#define sat_zero sat_range.r_zero
+
+#endif /* !_NETATALK_AT_H_ */
diff --git a/freebsd/sys/netatalk/at_control.c b/freebsd/sys/netatalk/at_control.c
index c03d2ad8..1c5d0a56 100644
--- a/freebsd/sys/netatalk/at_control.c
+++ b/freebsd/sys/netatalk/at_control.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -27,27 +27,27 @@
* netatalk@umich.edu
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/netinet/in.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/sockio.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+#include <sys/priv.h>
+#include <sys/rwlock.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <net/route.h>
+#include <netinet/in.h>
#undef s_net
-#include <freebsd/netinet/if_ether.h>
+#include <netinet/if_ether.h>
-#include <freebsd/netatalk/at.h>
-#include <freebsd/netatalk/at_var.h>
-#include <freebsd/netatalk/at_extern.h>
+#include <netatalk/at.h>
+#include <netatalk/at_var.h>
+#include <netatalk/at_extern.h>
struct rwlock at_ifaddr_rw;
struct at_ifaddrhead at_ifaddrhead;
diff --git a/freebsd/sys/netatalk/at_extern.h b/freebsd/sys/netatalk/at_extern.h
index aebae73c..c00e526d 100644
--- a/freebsd/sys/netatalk/at_extern.h
+++ b/freebsd/sys/netatalk/at_extern.h
@@ -26,8 +26,8 @@
* $FreeBSD$
*/
-#ifndef _NETATALK_AT_EXTERN_HH_
-#define _NETATALK_AT_EXTERN_HH_
+#ifndef _NETATALK_AT_EXTERN_H_
+#define _NETATALK_AT_EXTERN_H_
extern struct mtx aarptab_mtx;
@@ -64,4 +64,4 @@ int ddp_route(struct mbuf *m, struct route *ro);
struct ddpcb *ddp_search(struct sockaddr_at *, struct sockaddr_at *,
struct at_ifaddr *);
-#endif /* !_NETATALK_AT_EXTERN_HH_ */
+#endif /* !_NETATALK_AT_EXTERN_H_ */
diff --git a/freebsd/sys/netatalk/at_proto.c b/freebsd/sys/netatalk/at_proto.c
index cc7902b0..53f04236 100644
--- a/freebsd/sys/netatalk/at_proto.c
+++ b/freebsd/sys/netatalk/at_proto.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1990, 1991 Regents of The University of Michigan.
@@ -25,18 +25,18 @@
* $FreeBSD$
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/socket.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/protosw.h>
+#include <sys/domain.h>
+#include <sys/socket.h>
-#include <freebsd/sys/kernel.h>
+#include <sys/kernel.h>
-#include <freebsd/net/route.h>
+#include <net/route.h>
-#include <freebsd/netatalk/at.h>
-#include <freebsd/netatalk/ddp_var.h>
-#include <freebsd/netatalk/at_extern.h>
+#include <netatalk/at.h>
+#include <netatalk/ddp_var.h>
+#include <netatalk/at_extern.h>
static struct domain atalkdomain;
diff --git a/freebsd/sys/netatalk/at_rmx.c b/freebsd/sys/netatalk/at_rmx.c
index 54272ad7..61777a70 100644
--- a/freebsd/sys/netatalk/at_rmx.c
+++ b/freebsd/sys/netatalk/at_rmx.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright 1994, 1995 Massachusetts Institute of Technology
@@ -34,11 +34,11 @@
/* This code generates debugging traces to the radix code. */
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/socket.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/socket.h>
-#include <freebsd/net/route.h>
+#include <net/route.h>
int at_inithead(void **head, int off);
diff --git a/freebsd/sys/netatalk/at_var.h b/freebsd/sys/netatalk/at_var.h
index ead90fb1..39b12c77 100644
--- a/freebsd/sys/netatalk/at_var.h
+++ b/freebsd/sys/netatalk/at_var.h
@@ -23,8 +23,8 @@
* $FreeBSD$
*/
-#ifndef _NETATALK_AT_VAR_HH_
-#define _NETATALK_AT_VAR_HH_
+#ifndef _NETATALK_AT_VAR_H_
+#define _NETATALK_AT_VAR_H_
/*
* For phase2, we need to keep not only our address on an interface, but also
@@ -74,4 +74,4 @@ extern struct at_ifaddrhead at_ifaddrhead;
#define AT_IFADDR_WUNLOCK() rw_wunlock(&at_ifaddr_rw)
#endif
-#endif /* _NETATALK_AT_VAR_HH_ */
+#endif /* _NETATALK_AT_VAR_H_ */
diff --git a/freebsd/sys/netatalk/ddp.h b/freebsd/sys/netatalk/ddp.h
index f954b080..1867ae42 100644
--- a/freebsd/sys/netatalk/ddp.h
+++ b/freebsd/sys/netatalk/ddp.h
@@ -23,8 +23,8 @@
* $FreeBSD$
*/
-#ifndef _NETATALK_DDP_HH_
-#define _NETATALK_DDP_HH_
+#ifndef _NETATALK_DDP_H_
+#define _NETATALK_DDP_H_
/*-
* <-1byte(8bits) ->
@@ -134,4 +134,4 @@ struct ddpshdr {
#define dsh_sport dsh_u.du_bits.dub_sport
#define dsh_bytes dsh_u.du_bytes
-#endif /* _NETATALK_DDP_HH_ */
+#endif /* _NETATALK_DDP_H_ */
diff --git a/freebsd/sys/netatalk/ddp_input.c b/freebsd/sys/netatalk/ddp_input.c
index 64eaac7d..267538ec 100644
--- a/freebsd/sys/netatalk/ddp_input.c
+++ b/freebsd/sys/netatalk/ddp_input.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2004-2009 Robert N. M. Watson
@@ -51,26 +51,26 @@
* $FreeBSD$
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-
-#include <freebsd/netatalk/at.h>
-#include <freebsd/netatalk/at_var.h>
-#include <freebsd/netatalk/ddp.h>
-#include <freebsd/netatalk/ddp_var.h>
-#include <freebsd/netatalk/ddp_pcb.h>
-#include <freebsd/netatalk/at_extern.h>
-
-#include <freebsd/security/mac/mac_framework.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mbuf.h>
+#include <sys/signalvar.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sx.h>
+#include <sys/systm.h>
+#include <net/if.h>
+#include <net/route.h>
+
+#include <netatalk/at.h>
+#include <netatalk/at_var.h>
+#include <netatalk/ddp.h>
+#include <netatalk/ddp_var.h>
+#include <netatalk/ddp_pcb.h>
+#include <netatalk/at_extern.h>
+
+#include <security/mac/mac_framework.h>
static volatile int ddp_forward = 1;
static volatile int ddp_firewall = 0;
diff --git a/freebsd/sys/netatalk/ddp_output.c b/freebsd/sys/netatalk/ddp_output.c
index 0bb74123..9f171fd8 100644
--- a/freebsd/sys/netatalk/ddp_output.c
+++ b/freebsd/sys/netatalk/ddp_output.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1990, 1991 Regents of The University of Michigan.
@@ -25,24 +25,24 @@
/* $FreeBSD$ */
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
+#include <net/if.h>
+#include <net/route.h>
#undef s_net
-#include <freebsd/netatalk/at.h>
-#include <freebsd/netatalk/at_var.h>
-#include <freebsd/netatalk/ddp.h>
-#include <freebsd/netatalk/ddp_var.h>
-#include <freebsd/netatalk/at_extern.h>
+#include <netatalk/at.h>
+#include <netatalk/at_var.h>
+#include <netatalk/ddp.h>
+#include <netatalk/ddp_var.h>
+#include <netatalk/at_extern.h>
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
int ddp_cksum = 1;
diff --git a/freebsd/sys/netatalk/ddp_pcb.c b/freebsd/sys/netatalk/ddp_pcb.c
index 4faeb092..3998cbfa 100644
--- a/freebsd/sys/netatalk/ddp_pcb.c
+++ b/freebsd/sys/netatalk/ddp_pcb.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2004-2009 Robert N. M. Watson
@@ -51,23 +51,23 @@
* $FreeBSD$
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/netisr.h>
-
-#include <freebsd/netatalk/at.h>
-#include <freebsd/netatalk/at_var.h>
-#include <freebsd/netatalk/ddp_var.h>
-#include <freebsd/netatalk/ddp_pcb.h>
-#include <freebsd/netatalk/at_extern.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/priv.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/protosw.h>
+#include <net/if.h>
+#include <net/route.h>
+#include <net/netisr.h>
+
+#include <netatalk/at.h>
+#include <netatalk/at_var.h>
+#include <netatalk/ddp_var.h>
+#include <netatalk/ddp_pcb.h>
+#include <netatalk/at_extern.h>
struct mtx ddp_list_mtx;
static struct ddpcb *ddp_ports[ATPORT_LAST];
diff --git a/freebsd/sys/netatalk/ddp_pcb.h b/freebsd/sys/netatalk/ddp_pcb.h
index 4449c3ae..d71836f6 100644
--- a/freebsd/sys/netatalk/ddp_pcb.h
+++ b/freebsd/sys/netatalk/ddp_pcb.h
@@ -50,8 +50,8 @@
* $FreeBSD$
*/
-#ifndef _NETATALK_DDP_PCB_HH_
-#define _NETATALK_DDP_PCB_HH_
+#ifndef _NETATALK_DDP_PCB_H_
+#define _NETATALK_DDP_PCB_H_
int at_pcballoc(struct socket *so);
int at_pcbconnect(struct ddpcb *ddp, struct sockaddr *addr,
@@ -81,4 +81,4 @@ void at_sockaddr(struct ddpcb *ddp, struct sockaddr **addr);
#define DDP_LIST_SUNLOCK() mtx_unlock(&ddp_list_mtx)
#define DDP_LIST_SLOCK_ASSERT() mtx_assert(&ddp_list_mtx, MA_OWNED)
-#endif /* !_NETATALK_DDP_PCB_HH_ */
+#endif /* !_NETATALK_DDP_PCB_H_ */
diff --git a/freebsd/sys/netatalk/ddp_usrreq.c b/freebsd/sys/netatalk/ddp_usrreq.c
index 1d1990c4..e8557552 100644
--- a/freebsd/sys/netatalk/ddp_usrreq.c
+++ b/freebsd/sys/netatalk/ddp_usrreq.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2004-2009 Robert N. M. Watson
@@ -52,22 +52,22 @@
* $FreeBSD$
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/netisr.h>
-
-#include <freebsd/netatalk/at.h>
-#include <freebsd/netatalk/at_var.h>
-#include <freebsd/netatalk/ddp_var.h>
-#include <freebsd/netatalk/ddp_pcb.h>
-#include <freebsd/netatalk/at_extern.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/protosw.h>
+#include <net/if.h>
+#include <net/route.h>
+#include <net/netisr.h>
+
+#include <netatalk/at.h>
+#include <netatalk/at_var.h>
+#include <netatalk/ddp_var.h>
+#include <netatalk/ddp_pcb.h>
+#include <netatalk/at_extern.h>
static u_long ddp_sendspace = DDP_MAXSZ; /* Max ddp size + 1 (ddp_type) */
static u_long ddp_recvspace = 10 * (587 + sizeof(struct sockaddr_at));
diff --git a/freebsd/sys/netatalk/ddp_var.h b/freebsd/sys/netatalk/ddp_var.h
index e0148a24..71bbb5be 100644
--- a/freebsd/sys/netatalk/ddp_var.h
+++ b/freebsd/sys/netatalk/ddp_var.h
@@ -26,8 +26,8 @@
* $FreeBSD$
*/
-#ifndef _NETATALK_DDP_VAR_HH_
-#define _NETATALK_DDP_VAR_HH_
+#ifndef _NETATALK_DDP_VAR_H_
+#define _NETATALK_DDP_VAR_H_
struct ddpcb {
struct sockaddr_at ddp_fsat, ddp_lsat;
@@ -60,4 +60,4 @@ extern struct pr_usrreqs ddp_usrreqs;
extern struct mtx ddp_list_mtx;
#endif
-#endif /* _NETATALK_DDP_VAR_HH_ */
+#endif /* _NETATALK_DDP_VAR_H_ */
diff --git a/freebsd/sys/netatalk/endian.h b/freebsd/sys/netatalk/endian.h
index b15332c1..4d7ba619 100644
--- a/freebsd/sys/netatalk/endian.h
+++ b/freebsd/sys/netatalk/endian.h
@@ -23,9 +23,9 @@
* $FreeBSD$
*/
-#ifndef _ATALK_ENDIAN_HH_
-#define _ATALK_ENDIAN_HH_
+#ifndef _ATALK_ENDIAN_H_
+#define _ATALK_ENDIAN_H_
-#include <freebsd/machine/endian.h>
+#include <machine/rtems-bsd-endian.h>
-#endif /* !_ATALK_ENDIAN_HH_ */
+#endif /* !_ATALK_ENDIAN_H_ */
diff --git a/freebsd/sys/netatalk/phase2.h b/freebsd/sys/netatalk/phase2.h
index aaa3dd38..e6a4bec1 100644
--- a/freebsd/sys/netatalk/phase2.h
+++ b/freebsd/sys/netatalk/phase2.h
@@ -25,7 +25,7 @@
* $FreeBSD$
*/
-#include <freebsd/net/if_llc.h>
+#include <net/if_llc.h>
#define llc_org_code llc_un.type_snap.org_code
#define llc_ether_type llc_un.type_snap.ether_type
diff --git a/freebsd/sys/netinet/accf_data.c b/freebsd/sys/netinet/accf_data.c
index 15696daf..7b81cda6 100644
--- a/freebsd/sys/netinet/accf_data.c
+++ b/freebsd/sys/netinet/accf_data.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2000 Alfred Perlstein <alfred@FreeBSD.org>
@@ -26,17 +26,17 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#define ACCEPT_FILTER_MOD
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/socketvar.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
+#include <sys/signalvar.h>
+#include <sys/socketvar.h>
/* accept filter that holds a socket until data arrives */
diff --git a/freebsd/sys/netinet/accf_dns.c b/freebsd/sys/netinet/accf_dns.c
index f91cbb08..abba9d8b 100644
--- a/freebsd/sys/netinet/accf_dns.c
+++ b/freebsd/sys/netinet/accf_dns.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* Copyright (C) 2007 David Malone <dwmalone@FreeBSD.org>
@@ -30,13 +30,13 @@
#define ACCEPT_FILTER_MOD
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/socketvar.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <sys/signalvar.h>
+#include <sys/sysctl.h>
+#include <sys/socketvar.h>
/* check for full DNS request */
static int sohasdns(struct socket *so, void *arg, int waitflag);
diff --git a/freebsd/sys/netinet/accf_http.c b/freebsd/sys/netinet/accf_http.c
index ce21b1d1..4397b439 100644
--- a/freebsd/sys/netinet/accf_http.c
+++ b/freebsd/sys/netinet/accf_http.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2000 Paycounter, Inc.
@@ -27,18 +27,18 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#define ACCEPT_FILTER_MOD
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/socketvar.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <sys/signalvar.h>
+#include <sys/sysctl.h>
+#include <sys/socketvar.h>
/* check for GET/HEAD */
static int sohashttpget(struct socket *so, void *arg, int waitflag);
diff --git a/freebsd/sys/netinet/icmp6.h b/freebsd/sys/netinet/icmp6.h
index bf61ac5b..5faae7c1 100644
--- a/freebsd/sys/netinet/icmp6.h
+++ b/freebsd/sys/netinet/icmp6.h
@@ -1,2 +1,741 @@
-#include <freebsd/bsd.h>
-#include <freebsd/netinet/icmp6.h>
+/* $FreeBSD$ */
+/* $KAME: icmp6.h,v 1.46 2001/04/27 15:09:48 itojun Exp $ */
+
+/*-
+ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*-
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93
+ */
+
+#ifndef _NETINET_ICMP6_H_
+#define _NETINET_ICMP6_H_
+
+#define ICMPV6_PLD_MAXLEN 1232 /* IPV6_MMTU - sizeof(struct ip6_hdr)
+ - sizeof(struct icmp6_hdr) */
+
+struct icmp6_hdr {
+ u_int8_t icmp6_type; /* type field */
+ u_int8_t icmp6_code; /* code field */
+ u_int16_t icmp6_cksum; /* checksum field */
+ union {
+ u_int32_t icmp6_un_data32[1]; /* type-specific field */
+ u_int16_t icmp6_un_data16[2]; /* type-specific field */
+ u_int8_t icmp6_un_data8[4]; /* type-specific field */
+ } icmp6_dataun;
+} __packed;
+
+#define icmp6_data32 icmp6_dataun.icmp6_un_data32
+#define icmp6_data16 icmp6_dataun.icmp6_un_data16
+#define icmp6_data8 icmp6_dataun.icmp6_un_data8
+#define icmp6_pptr icmp6_data32[0] /* parameter prob */
+#define icmp6_mtu icmp6_data32[0] /* packet too big */
+#define icmp6_id icmp6_data16[0] /* echo request/reply */
+#define icmp6_seq icmp6_data16[1] /* echo request/reply */
+#define icmp6_maxdelay icmp6_data16[0] /* mcast group membership */
+
+#define ICMP6_DST_UNREACH 1 /* dest unreachable, codes: */
+#define ICMP6_PACKET_TOO_BIG 2 /* packet too big */
+#define ICMP6_TIME_EXCEEDED 3 /* time exceeded, code: */
+#define ICMP6_PARAM_PROB 4 /* ip6 header bad */
+
+#define ICMP6_ECHO_REQUEST 128 /* echo service */
+#define ICMP6_ECHO_REPLY 129 /* echo reply */
+#define MLD_LISTENER_QUERY 130 /* multicast listener query */
+#define MLD_LISTENER_REPORT 131 /* multicast listener report */
+#define MLD_LISTENER_DONE 132 /* multicast listener done */
+#define MLD_LISTENER_REDUCTION MLD_LISTENER_DONE /* RFC3542 definition */
+
+/* RFC2292 decls */
+#define ICMP6_MEMBERSHIP_QUERY 130 /* group membership query */
+#define ICMP6_MEMBERSHIP_REPORT 131 /* group membership report */
+#define ICMP6_MEMBERSHIP_REDUCTION 132 /* group membership termination */
+
+#ifndef _KERNEL
+/* the followings are for backward compatibility to old KAME apps. */
+#define MLD6_LISTENER_QUERY MLD_LISTENER_QUERY
+#define MLD6_LISTENER_REPORT MLD_LISTENER_REPORT
+#define MLD6_LISTENER_DONE MLD_LISTENER_DONE
+#endif
+
+#define ND_ROUTER_SOLICIT 133 /* router solicitation */
+#define ND_ROUTER_ADVERT 134 /* router advertisement */
+#define ND_NEIGHBOR_SOLICIT 135 /* neighbor solicitation */
+#define ND_NEIGHBOR_ADVERT 136 /* neighbor advertisement */
+#define ND_REDIRECT 137 /* redirect */
+
+#define ICMP6_ROUTER_RENUMBERING 138 /* router renumbering */
+
+#define ICMP6_WRUREQUEST 139 /* who are you request */
+#define ICMP6_WRUREPLY 140 /* who are you reply */
+#define ICMP6_FQDN_QUERY 139 /* FQDN query */
+#define ICMP6_FQDN_REPLY 140 /* FQDN reply */
+#define ICMP6_NI_QUERY 139 /* node information request */
+#define ICMP6_NI_REPLY 140 /* node information reply */
+#define MLDV2_LISTENER_REPORT 143 /* RFC3810 listener report */
+
+/* The definitions below are experimental. TBA */
+#define MLD_MTRACE_RESP 200 /* mtrace resp (to sender) */
+#define MLD_MTRACE 201 /* mtrace messages */
+
+#ifndef _KERNEL
+#define MLD6_MTRACE_RESP MLD_MTRACE_RESP
+#define MLD6_MTRACE MLD_MTRACE
+#endif
+
+#define ICMP6_MAXTYPE 201
+
+#define ICMP6_DST_UNREACH_NOROUTE 0 /* no route to destination */
+#define ICMP6_DST_UNREACH_ADMIN 1 /* administratively prohibited */
+#define ICMP6_DST_UNREACH_NOTNEIGHBOR 2 /* not a neighbor(obsolete) */
+#define ICMP6_DST_UNREACH_BEYONDSCOPE 2 /* beyond scope of source address */
+#define ICMP6_DST_UNREACH_ADDR 3 /* address unreachable */
+#define ICMP6_DST_UNREACH_NOPORT 4 /* port unreachable */
+
+#define ICMP6_TIME_EXCEED_TRANSIT 0 /* ttl==0 in transit */
+#define ICMP6_TIME_EXCEED_REASSEMBLY 1 /* ttl==0 in reass */
+
+#define ICMP6_PARAMPROB_HEADER 0 /* erroneous header field */
+#define ICMP6_PARAMPROB_NEXTHEADER 1 /* unrecognized next header */
+#define ICMP6_PARAMPROB_OPTION 2 /* unrecognized option */
+
+#define ICMP6_INFOMSG_MASK 0x80 /* all informational messages */
+
+#define ICMP6_NI_SUBJ_IPV6 0 /* Query Subject is an IPv6 address */
+#define ICMP6_NI_SUBJ_FQDN 1 /* Query Subject is a Domain name */
+#define ICMP6_NI_SUBJ_IPV4 2 /* Query Subject is an IPv4 address */
+
+#define ICMP6_NI_SUCCESS 0 /* node information successful reply */
+#define ICMP6_NI_REFUSED 1 /* node information request is refused */
+#define ICMP6_NI_UNKNOWN 2 /* unknown Qtype */
+
+#define ICMP6_ROUTER_RENUMBERING_COMMAND 0 /* rr command */
+#define ICMP6_ROUTER_RENUMBERING_RESULT 1 /* rr result */
+#define ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET 255 /* rr seq num reset */
+
+/* Used in kernel only */
+#define ND_REDIRECT_ONLINK 0 /* redirect to an on-link node */
+#define ND_REDIRECT_ROUTER 1 /* redirect to a better router */
+
+/*
+ * Multicast Listener Discovery
+ */
+struct mld_hdr {
+ struct icmp6_hdr mld_icmp6_hdr;
+ struct in6_addr mld_addr; /* multicast address */
+} __packed;
+
+/* definitions to provide backward compatibility to old KAME applications */
+#ifndef _KERNEL
+#define mld6_hdr mld_hdr
+#define mld6_type mld_type
+#define mld6_code mld_code
+#define mld6_cksum mld_cksum
+#define mld6_maxdelay mld_maxdelay
+#define mld6_reserved mld_reserved
+#define mld6_addr mld_addr
+#endif
+
+/* shortcut macro definitions */
+#define mld_type mld_icmp6_hdr.icmp6_type
+#define mld_code mld_icmp6_hdr.icmp6_code
+#define mld_cksum mld_icmp6_hdr.icmp6_cksum
+#define mld_maxdelay mld_icmp6_hdr.icmp6_data16[0]
+#define mld_reserved mld_icmp6_hdr.icmp6_data16[1]
+#define mld_v2_reserved mld_icmp6_hdr.icmp6_data16[0]
+#define mld_v2_numrecs mld_icmp6_hdr.icmp6_data16[1]
+
+/*
+ * Neighbor Discovery
+ */
+
+struct nd_router_solicit { /* router solicitation */
+ struct icmp6_hdr nd_rs_hdr;
+ /* could be followed by options */
+} __packed;
+
+#define nd_rs_type nd_rs_hdr.icmp6_type
+#define nd_rs_code nd_rs_hdr.icmp6_code
+#define nd_rs_cksum nd_rs_hdr.icmp6_cksum
+#define nd_rs_reserved nd_rs_hdr.icmp6_data32[0]
+
+struct nd_router_advert { /* router advertisement */
+ struct icmp6_hdr nd_ra_hdr;
+ u_int32_t nd_ra_reachable; /* reachable time */
+ u_int32_t nd_ra_retransmit; /* retransmit timer */
+ /* could be followed by options */
+} __packed;
+
+#define nd_ra_type nd_ra_hdr.icmp6_type
+#define nd_ra_code nd_ra_hdr.icmp6_code
+#define nd_ra_cksum nd_ra_hdr.icmp6_cksum
+#define nd_ra_curhoplimit nd_ra_hdr.icmp6_data8[0]
+#define nd_ra_flags_reserved nd_ra_hdr.icmp6_data8[1]
+#define ND_RA_FLAG_MANAGED 0x80
+#define ND_RA_FLAG_OTHER 0x40
+#define ND_RA_FLAG_HA 0x20
+
+/*
+ * Router preference values based on draft-draves-ipngwg-router-selection-01.
+ * These are non-standard definitions.
+ */
+#define ND_RA_FLAG_RTPREF_MASK 0x18 /* 00011000 */
+
+#define ND_RA_FLAG_RTPREF_HIGH 0x08 /* 00001000 */
+#define ND_RA_FLAG_RTPREF_MEDIUM 0x00 /* 00000000 */
+#define ND_RA_FLAG_RTPREF_LOW 0x18 /* 00011000 */
+#define ND_RA_FLAG_RTPREF_RSV 0x10 /* 00010000 */
+
+#define nd_ra_router_lifetime nd_ra_hdr.icmp6_data16[1]
+
+struct nd_neighbor_solicit { /* neighbor solicitation */
+ struct icmp6_hdr nd_ns_hdr;
+ struct in6_addr nd_ns_target; /*target address */
+ /* could be followed by options */
+} __packed;
+
+#define nd_ns_type nd_ns_hdr.icmp6_type
+#define nd_ns_code nd_ns_hdr.icmp6_code
+#define nd_ns_cksum nd_ns_hdr.icmp6_cksum
+#define nd_ns_reserved nd_ns_hdr.icmp6_data32[0]
+
+struct nd_neighbor_advert { /* neighbor advertisement */
+ struct icmp6_hdr nd_na_hdr;
+ struct in6_addr nd_na_target; /* target address */
+ /* could be followed by options */
+} __packed;
+
+#define nd_na_type nd_na_hdr.icmp6_type
+#define nd_na_code nd_na_hdr.icmp6_code
+#define nd_na_cksum nd_na_hdr.icmp6_cksum
+#define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0]
+#if BYTE_ORDER == BIG_ENDIAN
+#define ND_NA_FLAG_ROUTER 0x80000000
+#define ND_NA_FLAG_SOLICITED 0x40000000
+#define ND_NA_FLAG_OVERRIDE 0x20000000
+#else
+#if BYTE_ORDER == LITTLE_ENDIAN
+#define ND_NA_FLAG_ROUTER 0x80
+#define ND_NA_FLAG_SOLICITED 0x40
+#define ND_NA_FLAG_OVERRIDE 0x20
+#endif
+#endif
+
+struct nd_redirect { /* redirect */
+ struct icmp6_hdr nd_rd_hdr;
+ struct in6_addr nd_rd_target; /* target address */
+ struct in6_addr nd_rd_dst; /* destination address */
+ /* could be followed by options */
+} __packed;
+
+#define nd_rd_type nd_rd_hdr.icmp6_type
+#define nd_rd_code nd_rd_hdr.icmp6_code
+#define nd_rd_cksum nd_rd_hdr.icmp6_cksum
+#define nd_rd_reserved nd_rd_hdr.icmp6_data32[0]
+
+struct nd_opt_hdr { /* Neighbor discovery option header */
+ u_int8_t nd_opt_type;
+ u_int8_t nd_opt_len;
+ /* followed by option specific data*/
+} __packed;
+
+#define ND_OPT_SOURCE_LINKADDR 1
+#define ND_OPT_TARGET_LINKADDR 2
+#define ND_OPT_PREFIX_INFORMATION 3
+#define ND_OPT_REDIRECTED_HEADER 4
+#define ND_OPT_MTU 5
+
+#define ND_OPT_ROUTE_INFO 200 /* draft-ietf-ipngwg-router-preference, not officially assigned yet */
+
+struct nd_opt_prefix_info { /* prefix information */
+ u_int8_t nd_opt_pi_type;
+ u_int8_t nd_opt_pi_len;
+ u_int8_t nd_opt_pi_prefix_len;
+ u_int8_t nd_opt_pi_flags_reserved;
+ u_int32_t nd_opt_pi_valid_time;
+ u_int32_t nd_opt_pi_preferred_time;
+ u_int32_t nd_opt_pi_reserved2;
+ struct in6_addr nd_opt_pi_prefix;
+} __packed;
+
+#define ND_OPT_PI_FLAG_ONLINK 0x80
+#define ND_OPT_PI_FLAG_AUTO 0x40
+
+struct nd_opt_rd_hdr { /* redirected header */
+ u_int8_t nd_opt_rh_type;
+ u_int8_t nd_opt_rh_len;
+ u_int16_t nd_opt_rh_reserved1;
+ u_int32_t nd_opt_rh_reserved2;
+ /* followed by IP header and data */
+} __packed;
+
+struct nd_opt_mtu { /* MTU option */
+ u_int8_t nd_opt_mtu_type;
+ u_int8_t nd_opt_mtu_len;
+ u_int16_t nd_opt_mtu_reserved;
+ u_int32_t nd_opt_mtu_mtu;
+} __packed;
+
+struct nd_opt_route_info { /* route info */
+ u_int8_t nd_opt_rti_type;
+ u_int8_t nd_opt_rti_len;
+ u_int8_t nd_opt_rti_prefixlen;
+ u_int8_t nd_opt_rti_flags;
+ u_int32_t nd_opt_rti_lifetime;
+ /* prefix follows */
+} __packed;
+
+/*
+ * icmp6 namelookup
+ */
+
+struct icmp6_namelookup {
+ struct icmp6_hdr icmp6_nl_hdr;
+ u_int8_t icmp6_nl_nonce[8];
+ int32_t icmp6_nl_ttl;
+#if 0
+ u_int8_t icmp6_nl_len;
+ u_int8_t icmp6_nl_name[3];
+#endif
+ /* could be followed by options */
+} __packed;
+
+/*
+ * icmp6 node information
+ */
+struct icmp6_nodeinfo {
+ struct icmp6_hdr icmp6_ni_hdr;
+ u_int8_t icmp6_ni_nonce[8];
+ /* could be followed by reply data */
+} __packed;
+
+#define ni_type icmp6_ni_hdr.icmp6_type
+#define ni_code icmp6_ni_hdr.icmp6_code
+#define ni_cksum icmp6_ni_hdr.icmp6_cksum
+#define ni_qtype icmp6_ni_hdr.icmp6_data16[0]
+#define ni_flags icmp6_ni_hdr.icmp6_data16[1]
+
+#define NI_QTYPE_NOOP 0 /* NOOP */
+#define NI_QTYPE_SUPTYPES 1 /* Supported Qtypes */
+#define NI_QTYPE_FQDN 2 /* FQDN (draft 04) */
+#define NI_QTYPE_DNSNAME 2 /* DNS Name */
+#define NI_QTYPE_NODEADDR 3 /* Node Addresses */
+#define NI_QTYPE_IPV4ADDR 4 /* IPv4 Addresses */
+
+#if BYTE_ORDER == BIG_ENDIAN
+#define NI_SUPTYPE_FLAG_COMPRESS 0x1
+#define NI_FQDN_FLAG_VALIDTTL 0x1
+#elif BYTE_ORDER == LITTLE_ENDIAN
+#define NI_SUPTYPE_FLAG_COMPRESS 0x0100
+#define NI_FQDN_FLAG_VALIDTTL 0x0100
+#endif
+
+#ifdef NAME_LOOKUPS_04
+#if BYTE_ORDER == BIG_ENDIAN
+#define NI_NODEADDR_FLAG_LINKLOCAL 0x1
+#define NI_NODEADDR_FLAG_SITELOCAL 0x2
+#define NI_NODEADDR_FLAG_GLOBAL 0x4
+#define NI_NODEADDR_FLAG_ALL 0x8
+#define NI_NODEADDR_FLAG_TRUNCATE 0x10
+#define NI_NODEADDR_FLAG_ANYCAST 0x20 /* just experimental. not in spec */
+#elif BYTE_ORDER == LITTLE_ENDIAN
+#define NI_NODEADDR_FLAG_LINKLOCAL 0x0100
+#define NI_NODEADDR_FLAG_SITELOCAL 0x0200
+#define NI_NODEADDR_FLAG_GLOBAL 0x0400
+#define NI_NODEADDR_FLAG_ALL 0x0800
+#define NI_NODEADDR_FLAG_TRUNCATE 0x1000
+#define NI_NODEADDR_FLAG_ANYCAST 0x2000 /* just experimental. not in spec */
+#endif
+#else /* draft-ietf-ipngwg-icmp-name-lookups-05 (and later?) */
+#if BYTE_ORDER == BIG_ENDIAN
+#define NI_NODEADDR_FLAG_TRUNCATE 0x1
+#define NI_NODEADDR_FLAG_ALL 0x2
+#define NI_NODEADDR_FLAG_COMPAT 0x4
+#define NI_NODEADDR_FLAG_LINKLOCAL 0x8
+#define NI_NODEADDR_FLAG_SITELOCAL 0x10
+#define NI_NODEADDR_FLAG_GLOBAL 0x20
+#define NI_NODEADDR_FLAG_ANYCAST 0x40 /* just experimental. not in spec */
+#elif BYTE_ORDER == LITTLE_ENDIAN
+#define NI_NODEADDR_FLAG_TRUNCATE 0x0100
+#define NI_NODEADDR_FLAG_ALL 0x0200
+#define NI_NODEADDR_FLAG_COMPAT 0x0400
+#define NI_NODEADDR_FLAG_LINKLOCAL 0x0800
+#define NI_NODEADDR_FLAG_SITELOCAL 0x1000
+#define NI_NODEADDR_FLAG_GLOBAL 0x2000
+#define NI_NODEADDR_FLAG_ANYCAST 0x4000 /* just experimental. not in spec */
+#endif
+#endif
+
+struct ni_reply_fqdn {
+ u_int32_t ni_fqdn_ttl; /* TTL */
+ u_int8_t ni_fqdn_namelen; /* length in octets of the FQDN */
+ u_int8_t ni_fqdn_name[3]; /* XXX: alignment */
+} __packed;
+
+/*
+ * Router Renumbering. as router-renum-08.txt
+ */
+struct icmp6_router_renum { /* router renumbering header */
+ struct icmp6_hdr rr_hdr;
+ u_int8_t rr_segnum;
+ u_int8_t rr_flags;
+ u_int16_t rr_maxdelay;
+ u_int32_t rr_reserved;
+} __packed;
+
+#define ICMP6_RR_FLAGS_TEST 0x80
+#define ICMP6_RR_FLAGS_REQRESULT 0x40
+#define ICMP6_RR_FLAGS_FORCEAPPLY 0x20
+#define ICMP6_RR_FLAGS_SPECSITE 0x10
+#define ICMP6_RR_FLAGS_PREVDONE 0x08
+
+#define rr_type rr_hdr.icmp6_type
+#define rr_code rr_hdr.icmp6_code
+#define rr_cksum rr_hdr.icmp6_cksum
+#define rr_seqnum rr_hdr.icmp6_data32[0]
+
+struct rr_pco_match { /* match prefix part */
+ u_int8_t rpm_code;
+ u_int8_t rpm_len;
+ u_int8_t rpm_ordinal;
+ u_int8_t rpm_matchlen;
+ u_int8_t rpm_minlen;
+ u_int8_t rpm_maxlen;
+ u_int16_t rpm_reserved;
+ struct in6_addr rpm_prefix;
+} __packed;
+
+#define RPM_PCO_ADD 1
+#define RPM_PCO_CHANGE 2
+#define RPM_PCO_SETGLOBAL 3
+#define RPM_PCO_MAX 4
+
+struct rr_pco_use { /* use prefix part */
+ u_int8_t rpu_uselen;
+ u_int8_t rpu_keeplen;
+ u_int8_t rpu_ramask;
+ u_int8_t rpu_raflags;
+ u_int32_t rpu_vltime;
+ u_int32_t rpu_pltime;
+ u_int32_t rpu_flags;
+ struct in6_addr rpu_prefix;
+} __packed;
+#define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x80
+#define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x40
+
+#if BYTE_ORDER == BIG_ENDIAN
+#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80000000
+#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40000000
+#elif BYTE_ORDER == LITTLE_ENDIAN
+#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80
+#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40
+#endif
+
+struct rr_result { /* router renumbering result message */
+ u_int16_t rrr_flags;
+ u_int8_t rrr_ordinal;
+ u_int8_t rrr_matchedlen;
+ u_int32_t rrr_ifid;
+ struct in6_addr rrr_prefix;
+} __packed;
+#if BYTE_ORDER == BIG_ENDIAN
+#define ICMP6_RR_RESULT_FLAGS_OOB 0x0002
+#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0001
+#elif BYTE_ORDER == LITTLE_ENDIAN
+#define ICMP6_RR_RESULT_FLAGS_OOB 0x0200
+#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0100
+#endif
+
+/*
+ * icmp6 filter structures.
+ */
+
+struct icmp6_filter {
+ u_int32_t icmp6_filt[8];
+};
+
+#ifdef _KERNEL
+#define ICMP6_FILTER_SETPASSALL(filterp) \
+do { \
+ int i; u_char *p; \
+ p = (u_char *)filterp; \
+ for (i = 0; i < sizeof(struct icmp6_filter); i++) \
+ p[i] = 0xff; \
+} while (/*CONSTCOND*/ 0)
+#define ICMP6_FILTER_SETBLOCKALL(filterp) \
+ bzero(filterp, sizeof(struct icmp6_filter))
+#else /* _KERNEL */
+#define ICMP6_FILTER_SETPASSALL(filterp) \
+ memset(filterp, 0xff, sizeof(struct icmp6_filter))
+#define ICMP6_FILTER_SETBLOCKALL(filterp) \
+ memset(filterp, 0x00, sizeof(struct icmp6_filter))
+#endif /* _KERNEL */
+
+#define ICMP6_FILTER_SETPASS(type, filterp) \
+ (((filterp)->icmp6_filt[(type) >> 5]) |= (1 << ((type) & 31)))
+#define ICMP6_FILTER_SETBLOCK(type, filterp) \
+ (((filterp)->icmp6_filt[(type) >> 5]) &= ~(1 << ((type) & 31)))
+#define ICMP6_FILTER_WILLPASS(type, filterp) \
+ ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) != 0)
+#define ICMP6_FILTER_WILLBLOCK(type, filterp) \
+ ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) == 0)
+
+/*
+ * Variables related to this implementation
+ * of the internet control message protocol version 6.
+ */
+struct icmp6errstat {
+ u_quad_t icp6errs_dst_unreach_noroute;
+ u_quad_t icp6errs_dst_unreach_admin;
+ u_quad_t icp6errs_dst_unreach_beyondscope;
+ u_quad_t icp6errs_dst_unreach_addr;
+ u_quad_t icp6errs_dst_unreach_noport;
+ u_quad_t icp6errs_packet_too_big;
+ u_quad_t icp6errs_time_exceed_transit;
+ u_quad_t icp6errs_time_exceed_reassembly;
+ u_quad_t icp6errs_paramprob_header;
+ u_quad_t icp6errs_paramprob_nextheader;
+ u_quad_t icp6errs_paramprob_option;
+ u_quad_t icp6errs_redirect; /* we regard redirect as an error here */
+ u_quad_t icp6errs_unknown;
+};
+
+struct icmp6stat {
+/* statistics related to icmp6 packets generated */
+ u_quad_t icp6s_error; /* # of calls to icmp6_error */
+ u_quad_t icp6s_canterror; /* no error 'cuz old was icmp */
+ u_quad_t icp6s_toofreq; /* no error 'cuz rate limitation */
+ u_quad_t icp6s_outhist[256];
+/* statistics related to input message processed */
+ u_quad_t icp6s_badcode; /* icmp6_code out of range */
+ u_quad_t icp6s_tooshort; /* packet < sizeof(struct icmp6_hdr) */
+ u_quad_t icp6s_checksum; /* bad checksum */
+ u_quad_t icp6s_badlen; /* calculated bound mismatch */
+ /*
+ * number of responses: this member is inherited from netinet code, but
+ * for netinet6 code, it is already available in icp6s_outhist[].
+ */
+ u_quad_t icp6s_reflect;
+ u_quad_t icp6s_inhist[256];
+ u_quad_t icp6s_nd_toomanyopt; /* too many ND options */
+ struct icmp6errstat icp6s_outerrhist;
+#define icp6s_odst_unreach_noroute \
+ icp6s_outerrhist.icp6errs_dst_unreach_noroute
+#define icp6s_odst_unreach_admin icp6s_outerrhist.icp6errs_dst_unreach_admin
+#define icp6s_odst_unreach_beyondscope \
+ icp6s_outerrhist.icp6errs_dst_unreach_beyondscope
+#define icp6s_odst_unreach_addr icp6s_outerrhist.icp6errs_dst_unreach_addr
+#define icp6s_odst_unreach_noport icp6s_outerrhist.icp6errs_dst_unreach_noport
+#define icp6s_opacket_too_big icp6s_outerrhist.icp6errs_packet_too_big
+#define icp6s_otime_exceed_transit \
+ icp6s_outerrhist.icp6errs_time_exceed_transit
+#define icp6s_otime_exceed_reassembly \
+ icp6s_outerrhist.icp6errs_time_exceed_reassembly
+#define icp6s_oparamprob_header icp6s_outerrhist.icp6errs_paramprob_header
+#define icp6s_oparamprob_nextheader \
+ icp6s_outerrhist.icp6errs_paramprob_nextheader
+#define icp6s_oparamprob_option icp6s_outerrhist.icp6errs_paramprob_option
+#define icp6s_oredirect icp6s_outerrhist.icp6errs_redirect
+#define icp6s_ounknown icp6s_outerrhist.icp6errs_unknown
+ u_quad_t icp6s_pmtuchg; /* path MTU changes */
+ u_quad_t icp6s_nd_badopt; /* bad ND options */
+ u_quad_t icp6s_badns; /* bad neighbor solicitation */
+ u_quad_t icp6s_badna; /* bad neighbor advertisement */
+ u_quad_t icp6s_badrs; /* bad router advertisement */
+ u_quad_t icp6s_badra; /* bad router advertisement */
+ u_quad_t icp6s_badredirect; /* bad redirect message */
+};
+
+#ifdef _KERNEL
+/*
+ * In-kernel consumers can use these accessor macros directly to update
+ * stats.
+ */
+#define ICMP6STAT_ADD(name, val) V_icmp6stat.name += (val)
+#define ICMP6STAT_INC(name) ICMP6STAT_ADD(name, 1)
+
+/*
+ * Kernel module consumers must use this accessor macro.
+ */
+void kmod_icmp6stat_inc(int statnum);
+#define KMOD_ICMP6STAT_INC(name) \
+ kmod_icmp6stat_inc(offsetof(struct icmp6stat, name) / sizeof(u_quad_t))
+#endif
+
+/*
+ * Names for ICMP sysctl objects
+ */
+#define ICMPV6CTL_STATS 1
+#define ICMPV6CTL_REDIRACCEPT 2 /* accept/process redirects */
+#define ICMPV6CTL_REDIRTIMEOUT 3 /* redirect cache time */
+#if 0 /*obsoleted*/
+#define ICMPV6CTL_ERRRATELIMIT 5 /* ICMPv6 error rate limitation */
+#endif
+#define ICMPV6CTL_ND6_PRUNE 6
+#define ICMPV6CTL_ND6_DELAY 8
+#define ICMPV6CTL_ND6_UMAXTRIES 9
+#define ICMPV6CTL_ND6_MMAXTRIES 10
+#define ICMPV6CTL_ND6_USELOOPBACK 11
+/*#define ICMPV6CTL_ND6_PROXYALL 12 obsoleted, do not reuse here */
+#define ICMPV6CTL_NODEINFO 13
+#define ICMPV6CTL_ERRPPSLIMIT 14 /* ICMPv6 error pps limitation */
+#define ICMPV6CTL_ND6_MAXNUDHINT 15
+#define ICMPV6CTL_MTUDISC_HIWAT 16
+#define ICMPV6CTL_MTUDISC_LOWAT 17
+#define ICMPV6CTL_ND6_DEBUG 18
+#define ICMPV6CTL_ND6_DRLIST 19
+#define ICMPV6CTL_ND6_PRLIST 20
+#define ICMPV6CTL_MLD_MAXSRCFILTER 21
+#define ICMPV6CTL_MLD_SOMAXSRC 22
+#define ICMPV6CTL_MLD_VERSION 23
+#define ICMPV6CTL_ND6_MAXQLEN 24
+#define ICMPV6CTL_MAXID 25
+
+#define RTF_PROBEMTU RTF_PROTO1
+
+#ifdef _KERNEL
+# ifdef __STDC__
+struct rtentry;
+struct rttimer;
+struct in6_multi;
+# endif
+void icmp6_paramerror(struct mbuf *, int);
+void icmp6_error(struct mbuf *, int, int, int);
+void icmp6_error2(struct mbuf *, int, int, int, struct ifnet *);
+int icmp6_input(struct mbuf **, int *, int);
+void icmp6_fasttimo(void);
+void icmp6_slowtimo(void);
+void icmp6_reflect(struct mbuf *, size_t);
+void icmp6_prepare(struct mbuf *);
+void icmp6_redirect_input(struct mbuf *, int);
+void icmp6_redirect_output(struct mbuf *, struct rtentry *);
+
+struct ip6ctlparam;
+void icmp6_mtudisc_update(struct ip6ctlparam *, int);
+
+/* XXX: is this the right place for these macros? */
+#define icmp6_ifstat_inc(ifp, tag) \
+do { \
+ if (ifp) \
+ ((struct in6_ifextra *)((ifp)->if_afdata[AF_INET6]))->icmp6_ifstat->tag++; \
+} while (/*CONSTCOND*/ 0)
+
+#define icmp6_ifoutstat_inc(ifp, type, code) \
+do { \
+ icmp6_ifstat_inc(ifp, ifs6_out_msg); \
+ if (type < ICMP6_INFOMSG_MASK) \
+ icmp6_ifstat_inc(ifp, ifs6_out_error); \
+ switch (type) { \
+ case ICMP6_DST_UNREACH: \
+ icmp6_ifstat_inc(ifp, ifs6_out_dstunreach); \
+ if (code == ICMP6_DST_UNREACH_ADMIN) \
+ icmp6_ifstat_inc(ifp, ifs6_out_adminprohib); \
+ break; \
+ case ICMP6_PACKET_TOO_BIG: \
+ icmp6_ifstat_inc(ifp, ifs6_out_pkttoobig); \
+ break; \
+ case ICMP6_TIME_EXCEEDED: \
+ icmp6_ifstat_inc(ifp, ifs6_out_timeexceed); \
+ break; \
+ case ICMP6_PARAM_PROB: \
+ icmp6_ifstat_inc(ifp, ifs6_out_paramprob); \
+ break; \
+ case ICMP6_ECHO_REQUEST: \
+ icmp6_ifstat_inc(ifp, ifs6_out_echo); \
+ break; \
+ case ICMP6_ECHO_REPLY: \
+ icmp6_ifstat_inc(ifp, ifs6_out_echoreply); \
+ break; \
+ case MLD_LISTENER_QUERY: \
+ icmp6_ifstat_inc(ifp, ifs6_out_mldquery); \
+ break; \
+ case MLD_LISTENER_REPORT: \
+ icmp6_ifstat_inc(ifp, ifs6_out_mldreport); \
+ break; \
+ case MLD_LISTENER_DONE: \
+ icmp6_ifstat_inc(ifp, ifs6_out_mlddone); \
+ break; \
+ case ND_ROUTER_SOLICIT: \
+ icmp6_ifstat_inc(ifp, ifs6_out_routersolicit); \
+ break; \
+ case ND_ROUTER_ADVERT: \
+ icmp6_ifstat_inc(ifp, ifs6_out_routeradvert); \
+ break; \
+ case ND_NEIGHBOR_SOLICIT: \
+ icmp6_ifstat_inc(ifp, ifs6_out_neighborsolicit); \
+ break; \
+ case ND_NEIGHBOR_ADVERT: \
+ icmp6_ifstat_inc(ifp, ifs6_out_neighboradvert); \
+ break; \
+ case ND_REDIRECT: \
+ icmp6_ifstat_inc(ifp, ifs6_out_redirect); \
+ break; \
+ } \
+} while (/*CONSTCOND*/ 0)
+
+VNET_DECLARE(int, icmp6_rediraccept); /* accept/process redirects */
+VNET_DECLARE(int, icmp6_redirtimeout); /* cache time for redirect routes */
+
+#define V_icmp6_rediraccept VNET(icmp6_rediraccept)
+#define V_icmp6_redirtimeout VNET(icmp6_redirtimeout)
+
+#define ICMP6_NODEINFO_FQDNOK 0x1
+#define ICMP6_NODEINFO_NODEADDROK 0x2
+#define ICMP6_NODEINFO_TMPADDROK 0x4
+#define ICMP6_NODEINFO_GLOBALOK 0x8
+#endif /* _KERNEL */
+
+#endif /* not _NETINET_ICMP6_H_ */
diff --git a/freebsd/sys/netinet/icmp_var.h b/freebsd/sys/netinet/icmp_var.h
index d55fc4d3..30da6a26 100644
--- a/freebsd/sys/netinet/icmp_var.h
+++ b/freebsd/sys/netinet/icmp_var.h
@@ -30,8 +30,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET_ICMP_VAR_HH_
-#define _NETINET_ICMP_VAR_HH_
+#ifndef _NETINET_ICMP_VAR_H_
+#define _NETINET_ICMP_VAR_H_
/*
diff --git a/freebsd/sys/netinet/if_atm.c b/freebsd/sys/netinet/if_atm.c
index ea6c567d..1c51718d 100644
--- a/freebsd/sys/netinet/if_atm.c
+++ b/freebsd/sys/netinet/if_atm.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $NetBSD: if_atm.c,v 1.6 1996/10/13 02:03:01 christos Exp $ */
@@ -33,36 +33,36 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* IP <=> ATM address resolution.
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_natm.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_natm.h>
#if defined(INET) || defined(INET6)
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/syslog.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/queue.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/syslog.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/if_atm.h>
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/route.h>
+#include <net/if_atm.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/if_atm.h>
+#include <netinet/in.h>
+#include <netinet/if_atm.h>
#ifdef NATM
-#include <freebsd/netnatm/natm.h>
+#include <netnatm/natm.h>
#endif
#define SDL(s) ((struct sockaddr_dl *)s)
diff --git a/freebsd/sys/netinet/if_ether.c b/freebsd/sys/netinet/if_ether.c
index 2e40c0d2..e7a20c2c 100644
--- a/freebsd/sys/netinet/if_ether.c
+++ b/freebsd/sys/netinet/if_ether.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1988, 1993
@@ -37,43 +37,43 @@
* add "inuse/lock" bit (or ref. count) along with valid bit
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/syslog.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/if_llc.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/net/if_llatbl.h>
-#include <freebsd/netinet/if_ether.h>
+#include <rtems/bsd/local/opt_inet.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/queue.h>
+#include <sys/sysctl.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/malloc.h>
+#include <sys/proc.h>
+#include <sys/socket.h>
+#include <sys/syslog.h>
+
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/if_types.h>
+#include <net/netisr.h>
+#include <net/if_llc.h>
+#include <net/ethernet.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <net/if_llatbl.h>
+#include <netinet/if_ether.h>
#if defined(INET) || defined(INET6)
-#include <freebsd/netinet/ip_carp.h>
+#include <netinet/ip_carp.h>
#endif
-#include <freebsd/net/if_arc.h>
-#include <freebsd/net/iso88025.h>
+#include <net/if_arc.h>
+#include <net/iso88025.h>
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
#define SIN(s) ((struct sockaddr_in *)s)
#define SDL(s) ((struct sockaddr_dl *)s)
diff --git a/freebsd/sys/netinet/if_ether.h b/freebsd/sys/netinet/if_ether.h
index e3c8d009..ce63d8db 100644
--- a/freebsd/sys/netinet/if_ether.h
+++ b/freebsd/sys/netinet/if_ether.h
@@ -1,2 +1,122 @@
-#include <freebsd/bsd.h>
-#include <freebsd/netinet/if_ether.h>
+/*-
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)if_ether.h 8.3 (Berkeley) 5/2/95
+ * $FreeBSD$
+ */
+
+#ifndef _NETINET_IF_ETHER_H_
+#define _NETINET_IF_ETHER_H_
+
+#include <net/ethernet.h>
+#include <net/if_arp.h>
+
+/*
+ * Macro to map an IP multicast address to an Ethernet multicast address.
+ * The high-order 25 bits of the Ethernet address are statically assigned,
+ * and the low-order 23 bits are taken from the low end of the IP address.
+ */
+#define ETHER_MAP_IP_MULTICAST(ipaddr, enaddr) \
+ /* struct in_addr *ipaddr; */ \
+ /* u_char enaddr[ETHER_ADDR_LEN]; */ \
+{ \
+ (enaddr)[0] = 0x01; \
+ (enaddr)[1] = 0x00; \
+ (enaddr)[2] = 0x5e; \
+ (enaddr)[3] = ((u_char *)ipaddr)[1] & 0x7f; \
+ (enaddr)[4] = ((u_char *)ipaddr)[2]; \
+ (enaddr)[5] = ((u_char *)ipaddr)[3]; \
+}
+/*
+ * Macro to map an IP6 multicast address to an Ethernet multicast address.
+ * The high-order 16 bits of the Ethernet address are statically assigned,
+ * and the low-order 32 bits are taken from the low end of the IP6 address.
+ */
+#define ETHER_MAP_IPV6_MULTICAST(ip6addr, enaddr) \
+/* struct in6_addr *ip6addr; */ \
+/* u_char enaddr[ETHER_ADDR_LEN]; */ \
+{ \
+ (enaddr)[0] = 0x33; \
+ (enaddr)[1] = 0x33; \
+ (enaddr)[2] = ((u_char *)ip6addr)[12]; \
+ (enaddr)[3] = ((u_char *)ip6addr)[13]; \
+ (enaddr)[4] = ((u_char *)ip6addr)[14]; \
+ (enaddr)[5] = ((u_char *)ip6addr)[15]; \
+}
+
+/*
+ * Ethernet Address Resolution Protocol.
+ *
+ * See RFC 826 for protocol description. Structure below is adapted
+ * to resolving internet addresses. Field names used correspond to
+ * RFC 826.
+ */
+struct ether_arp {
+ struct arphdr ea_hdr; /* fixed-size header */
+ u_char arp_sha[ETHER_ADDR_LEN]; /* sender hardware address */
+ u_char arp_spa[4]; /* sender protocol address */
+ u_char arp_tha[ETHER_ADDR_LEN]; /* target hardware address */
+ u_char arp_tpa[4]; /* target protocol address */
+};
+#define arp_hrd ea_hdr.ar_hrd
+#define arp_pro ea_hdr.ar_pro
+#define arp_hln ea_hdr.ar_hln
+#define arp_pln ea_hdr.ar_pln
+#define arp_op ea_hdr.ar_op
+
+struct sockaddr_inarp {
+ u_char sin_len;
+ u_char sin_family;
+ u_short sin_port;
+ struct in_addr sin_addr;
+ struct in_addr sin_srcaddr;
+ u_short sin_tos;
+ u_short sin_other;
+#define SIN_PROXY 1
+};
+/*
+ * IP and ethernet specific routing flags
+ */
+#define RTF_USETRAILERS RTF_PROTO1 /* use trailers */
+#define RTF_ANNOUNCE RTF_PROTO2 /* announce new arp entry */
+
+#ifdef _KERNEL
+extern u_char ether_ipmulticast_min[ETHER_ADDR_LEN];
+extern u_char ether_ipmulticast_max[ETHER_ADDR_LEN];
+
+struct llentry;
+struct ifaddr;
+
+int arpresolve(struct ifnet *ifp, struct rtentry *rt,
+ struct mbuf *m, struct sockaddr *dst, u_char *desten,
+ struct llentry **lle);
+void arp_ifinit(struct ifnet *, struct ifaddr *);
+void arp_ifinit2(struct ifnet *, struct ifaddr *, u_char *);
+#endif
+
+#endif
diff --git a/freebsd/sys/netinet/igmp.c b/freebsd/sys/netinet/igmp.c
index 5f8893d7..c41b8f71 100644
--- a/freebsd/sys/netinet/igmp.c
+++ b/freebsd/sys/netinet/igmp.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2007-2009 Bruce Simpson.
@@ -49,37 +49,37 @@
* MULTICAST Revision: 3.5.1.4
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/ktr.h>
-#include <freebsd/sys/condvar.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_options.h>
-#include <freebsd/netinet/igmp.h>
-#include <freebsd/netinet/igmp_var.h>
-
-#include <freebsd/machine/in_cksum.h>
-
-#include <freebsd/security/mac/mac_framework.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/module.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/protosw.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
+#include <sys/ktr.h>
+#include <sys/condvar.h>
+
+#include <net/if.h>
+#include <net/netisr.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_options.h>
+#include <netinet/igmp.h>
+#include <netinet/igmp_var.h>
+
+#include <machine/in_cksum.h>
+
+#include <security/mac/mac_framework.h>
#ifndef KTR_IGMPV3
#define KTR_IGMPV3 KTR_INET
diff --git a/freebsd/sys/netinet/igmp.h b/freebsd/sys/netinet/igmp.h
index f328d21f..8f574290 100644
--- a/freebsd/sys/netinet/igmp.h
+++ b/freebsd/sys/netinet/igmp.h
@@ -1,2 +1,148 @@
-#include <freebsd/bsd.h>
-#include <freebsd/netinet/igmp.h>
+/*-
+ * Copyright (c) 1988 Stephen Deering.
+ * Copyright (c) 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Stephen Deering of Stanford University.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)igmp.h 8.1 (Berkeley) 6/10/93
+ * $FreeBSD$
+ */
+
+#ifndef _NETINET_IGMP_H_
+#define _NETINET_IGMP_H_
+
+/*
+ * Internet Group Management Protocol (IGMP) definitions.
+ *
+ * Written by Steve Deering, Stanford, May 1988.
+ *
+ * MULTICAST Revision: 3.5.1.2
+ */
+
+/* Minimum length of any IGMP protocol message. */
+#define IGMP_MINLEN 8
+
+/*
+ * IGMPv1/v2 query and host report format.
+ */
+struct igmp {
+ u_char igmp_type; /* version & type of IGMP message */
+ u_char igmp_code; /* subtype for routing msgs */
+ u_short igmp_cksum; /* IP-style checksum */
+ struct in_addr igmp_group; /* group address being reported */
+}; /* (zero for queries) */
+
+/*
+ * IGMP v3 query format.
+ */
+struct igmpv3 {
+ u_char igmp_type; /* version & type of IGMP message */
+ u_char igmp_code; /* subtype for routing msgs */
+ u_short igmp_cksum; /* IP-style checksum */
+ struct in_addr igmp_group; /* group address being reported */
+ /* (zero for queries) */
+ u_char igmp_misc; /* reserved/suppress/robustness */
+ u_char igmp_qqi; /* querier's query interval */
+ u_short igmp_numsrc; /* number of sources */
+ /*struct in_addr igmp_sources[1];*/ /* source addresses */
+};
+#define IGMP_V3_QUERY_MINLEN 12
+#define IGMP_EXP(x) (((x) >> 4) & 0x07)
+#define IGMP_MANT(x) ((x) & 0x0f)
+#define IGMP_QRESV(x) (((x) >> 4) & 0x0f)
+#define IGMP_SFLAG(x) (((x) >> 3) & 0x01)
+#define IGMP_QRV(x) ((x) & 0x07)
+
+struct igmp_grouprec {
+ u_char ig_type; /* record type */
+ u_char ig_datalen; /* length of auxiliary data */
+ u_short ig_numsrc; /* number of sources */
+ struct in_addr ig_group; /* group address being reported */
+ /*struct in_addr ig_sources[1];*/ /* source addresses */
+};
+#define IGMP_GRPREC_HDRLEN 8
+
+/*
+ * IGMPv3 host membership report header.
+ */
+struct igmp_report {
+ u_char ir_type; /* IGMP_v3_HOST_MEMBERSHIP_REPORT */
+ u_char ir_rsv1; /* must be zero */
+ u_short ir_cksum; /* checksum */
+ u_short ir_rsv2; /* must be zero */
+ u_short ir_numgrps; /* number of group records */
+ /*struct igmp_grouprec ir_groups[1];*/ /* group records */
+};
+#define IGMP_V3_REPORT_MINLEN 8
+#define IGMP_V3_REPORT_MAXRECS 65535
+
+/*
+ * Message types, including version number.
+ */
+#define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* membership query */
+#define IGMP_v1_HOST_MEMBERSHIP_REPORT 0x12 /* Ver. 1 membership report */
+#define IGMP_DVMRP 0x13 /* DVMRP routing message */
+#define IGMP_PIM 0x14 /* PIMv1 message (historic) */
+#define IGMP_v2_HOST_MEMBERSHIP_REPORT 0x16 /* Ver. 2 membership report */
+#define IGMP_HOST_LEAVE_MESSAGE 0x17 /* Leave-group message */
+#define IGMP_MTRACE_REPLY 0x1e /* mtrace(8) reply */
+#define IGMP_MTRACE_QUERY 0x1f /* mtrace(8) probe */
+#define IGMP_v3_HOST_MEMBERSHIP_REPORT 0x22 /* Ver. 3 membership report */
+
+/*
+ * IGMPv3 report modes.
+ */
+#define IGMP_DO_NOTHING 0 /* don't send a record */
+#define IGMP_MODE_IS_INCLUDE 1 /* MODE_IN */
+#define IGMP_MODE_IS_EXCLUDE 2 /* MODE_EX */
+#define IGMP_CHANGE_TO_INCLUDE_MODE 3 /* TO_IN */
+#define IGMP_CHANGE_TO_EXCLUDE_MODE 4 /* TO_EX */
+#define IGMP_ALLOW_NEW_SOURCES 5 /* ALLOW_NEW */
+#define IGMP_BLOCK_OLD_SOURCES 6 /* BLOCK_OLD */
+
+/*
+ * IGMPv3 query types.
+ */
+#define IGMP_V3_GENERAL_QUERY 1
+#define IGMP_V3_GROUP_QUERY 2
+#define IGMP_V3_GROUP_SOURCE_QUERY 3
+
+/*
+ * Maximum report interval for IGMP v1/v2 host membership reports [RFC 1112]
+ */
+#define IGMP_V1V2_MAX_RI 10
+#define IGMP_MAX_HOST_REPORT_DELAY IGMP_V1V2_MAX_RI
+
+/*
+ * IGMP_TIMER_SCALE denotes that the igmp code field specifies
+ * time in tenths of a second.
+ */
+#define IGMP_TIMER_SCALE 10
+
+#endif /* _NETINET_IGMP_H_ */
diff --git a/freebsd/sys/netinet/igmp_var.h b/freebsd/sys/netinet/igmp_var.h
index e1abe6ab..ca17158f 100644
--- a/freebsd/sys/netinet/igmp_var.h
+++ b/freebsd/sys/netinet/igmp_var.h
@@ -34,8 +34,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET_IGMP_VAR_HH_
-#define _NETINET_IGMP_VAR_HH_
+#ifndef _NETINET_IGMP_VAR_H_
+#define _NETINET_IGMP_VAR_H_
/*
* Internet Group Management Protocol (IGMP),
diff --git a/freebsd/sys/netinet/in.c b/freebsd/sys/netinet/in.c
index 64e5d329..b9231e13 100644
--- a/freebsd/sys/netinet/in.c
+++ b/freebsd/sys/netinet/in.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1991, 1993
@@ -32,38 +32,38 @@
* @(#)in.c 8.4 (Berkeley) 1/9/95
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_mpath.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/syslog.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_var.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_llatbl.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/igmp_var.h>
-#include <freebsd/netinet/udp.h>
-#include <freebsd/netinet/udp_var.h>
+#include <rtems/bsd/local/opt_mpath.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/sockio.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+#include <sys/socket.h>
+#include <sys/jail.h>
+#include <sys/kernel.h>
+#include <sys/proc.h>
+#include <sys/sysctl.h>
+#include <sys/syslog.h>
+
+#include <net/if.h>
+#include <net/if_var.h>
+#include <net/if_dl.h>
+#include <net/if_llatbl.h>
+#include <net/if_types.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/in_pcb.h>
+#include <netinet/ip_var.h>
+#include <netinet/igmp_var.h>
+#include <netinet/udp.h>
+#include <netinet/udp_var.h>
static int in_mask2len(struct in_addr *);
static void in_len2mask(struct in_addr *, int);
@@ -1309,8 +1309,8 @@ in_purgemaddrs(struct ifnet *ifp)
IN_MULTI_UNLOCK();
}
-#include <freebsd/net/if_dl.h>
-#include <freebsd/netinet/if_ether.h>
+#include <net/if_dl.h>
+#include <netinet/if_ether.h>
struct in_llentry {
struct llentry base;
diff --git a/freebsd/sys/netinet/in.h b/freebsd/sys/netinet/in.h
index 73c7ca1a..f38aaee2 100644
--- a/freebsd/sys/netinet/in.h
+++ b/freebsd/sys/netinet/in.h
@@ -1,2 +1,794 @@
-#include <freebsd/bsd.h>
-#include <freebsd/netinet/in.h>
+/*-
+ * Copyright (c) 1982, 1986, 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)in.h 8.3 (Berkeley) 1/3/94
+ * $FreeBSD$
+ */
+
+#ifndef _NETINET_IN_H_
+#define _NETINET_IN_H_
+
+#include <sys/cdefs.h>
+#include <rtems/bsd/sys/_types.h>
+#include <machine/rtems-bsd-endian.h>
+
+/* Protocols common to RFC 1700, POSIX, and X/Open. */
+#define IPPROTO_IP 0 /* dummy for IP */
+#define IPPROTO_ICMP 1 /* control message protocol */
+#define IPPROTO_TCP 6 /* tcp */
+#define IPPROTO_UDP 17 /* user datagram protocol */
+
+#define INADDR_ANY (u_int32_t)0x00000000
+#define INADDR_BROADCAST (u_int32_t)0xffffffff /* must be masked */
+
+#ifndef _UINT8_T_DECLARED
+typedef __uint8_t uint8_t;
+#define _UINT8_T_DECLARED
+#endif
+
+#ifndef _UINT16_T_DECLARED
+typedef __uint16_t uint16_t;
+#define _UINT16_T_DECLARED
+#endif
+
+#ifndef _UINT32_T_DECLARED
+typedef __uint32_t uint32_t;
+#define _UINT32_T_DECLARED
+#endif
+
+#ifndef _IN_ADDR_T_DECLARED
+typedef uint32_t in_addr_t;
+#define _IN_ADDR_T_DECLARED
+#endif
+
+#ifndef _IN_PORT_T_DECLARED
+typedef uint16_t in_port_t;
+#define _IN_PORT_T_DECLARED
+#endif
+
+#ifndef _SA_FAMILY_T_DECLARED
+typedef __sa_family_t sa_family_t;
+#define _SA_FAMILY_T_DECLARED
+#endif
+
+/* Internet address (a structure for historical reasons). */
+#ifndef _STRUCT_IN_ADDR_DECLARED
+struct in_addr {
+ in_addr_t s_addr;
+};
+#define _STRUCT_IN_ADDR_DECLARED
+#endif
+
+#ifndef _SOCKLEN_T_DECLARED
+typedef __socklen_t socklen_t;
+#define _SOCKLEN_T_DECLARED
+#endif
+
+/* Avoid collision with original definition in sys/socket.h. */
+#ifndef _STRUCT_SOCKADDR_STORAGE_DECLARED
+/*
+ * RFC 2553: protocol-independent placeholder for socket addresses
+ */
+#define _SS_MAXSIZE 128U
+#define _SS_ALIGNSIZE (sizeof(__int64_t))
+#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(unsigned char) - \
+ sizeof(sa_family_t))
+#define _SS_PAD2SIZE (_SS_MAXSIZE - sizeof(unsigned char) - \
+ sizeof(sa_family_t) - _SS_PAD1SIZE - _SS_ALIGNSIZE)
+
+struct sockaddr_storage {
+ unsigned char ss_len; /* address length */
+ sa_family_t ss_family; /* address family */
+ char __ss_pad1[_SS_PAD1SIZE];
+ __int64_t __ss_align; /* force desired struct alignment */
+ char __ss_pad2[_SS_PAD2SIZE];
+};
+#define _STRUCT_SOCKADDR_STORAGE_DECLARED
+#endif
+
+/* Socket address, internet style. */
+struct sockaddr_in {
+ uint8_t sin_len;
+ sa_family_t sin_family;
+ in_port_t sin_port;
+ struct in_addr sin_addr;
+ char sin_zero[8];
+};
+
+#if !defined(_KERNEL) && __BSD_VISIBLE
+
+#ifndef _BYTEORDER_PROTOTYPED
+#define _BYTEORDER_PROTOTYPED
+__BEGIN_DECLS
+uint32_t htonl(uint32_t);
+uint16_t htons(uint16_t);
+uint32_t ntohl(uint32_t);
+uint16_t ntohs(uint16_t);
+__END_DECLS
+#endif
+
+#ifndef _BYTEORDER_FUNC_DEFINED
+#define _BYTEORDER_FUNC_DEFINED
+#define htonl(x) __htonl(x)
+#define htons(x) __htons(x)
+#define ntohl(x) __ntohl(x)
+#define ntohs(x) __ntohs(x)
+#endif
+
+#endif /* !_KERNEL && __BSD_VISIBLE */
+
+#if __POSIX_VISIBLE >= 200112
+#define IPPROTO_RAW 255 /* raw IP packet */
+#define INET_ADDRSTRLEN 16
+#endif
+
+#if __BSD_VISIBLE
+/*
+ * Constants and structures defined by the internet system,
+ * Per RFC 790, September 1981, and numerous additions.
+ */
+
+/*
+ * Protocols (RFC 1700)
+ */
+#define IPPROTO_HOPOPTS 0 /* IP6 hop-by-hop options */
+#define IPPROTO_IGMP 2 /* group mgmt protocol */
+#define IPPROTO_GGP 3 /* gateway^2 (deprecated) */
+#define IPPROTO_IPV4 4 /* IPv4 encapsulation */
+#define IPPROTO_IPIP IPPROTO_IPV4 /* for compatibility */
+#define IPPROTO_ST 7 /* Stream protocol II */
+#define IPPROTO_EGP 8 /* exterior gateway protocol */
+#define IPPROTO_PIGP 9 /* private interior gateway */
+#define IPPROTO_RCCMON 10 /* BBN RCC Monitoring */
+#define IPPROTO_NVPII 11 /* network voice protocol*/
+#define IPPROTO_PUP 12 /* pup */
+#define IPPROTO_ARGUS 13 /* Argus */
+#define IPPROTO_EMCON 14 /* EMCON */
+#define IPPROTO_XNET 15 /* Cross Net Debugger */
+#define IPPROTO_CHAOS 16 /* Chaos*/
+#define IPPROTO_MUX 18 /* Multiplexing */
+#define IPPROTO_MEAS 19 /* DCN Measurement Subsystems */
+#define IPPROTO_HMP 20 /* Host Monitoring */
+#define IPPROTO_PRM 21 /* Packet Radio Measurement */
+#define IPPROTO_IDP 22 /* xns idp */
+#define IPPROTO_TRUNK1 23 /* Trunk-1 */
+#define IPPROTO_TRUNK2 24 /* Trunk-2 */
+#define IPPROTO_LEAF1 25 /* Leaf-1 */
+#define IPPROTO_LEAF2 26 /* Leaf-2 */
+#define IPPROTO_RDP 27 /* Reliable Data */
+#define IPPROTO_IRTP 28 /* Reliable Transaction */
+#define IPPROTO_TP 29 /* tp-4 w/ class negotiation */
+#define IPPROTO_BLT 30 /* Bulk Data Transfer */
+#define IPPROTO_NSP 31 /* Network Services */
+#define IPPROTO_INP 32 /* Merit Internodal */
+#define IPPROTO_SEP 33 /* Sequential Exchange */
+#define IPPROTO_3PC 34 /* Third Party Connect */
+#define IPPROTO_IDPR 35 /* InterDomain Policy Routing */
+#define IPPROTO_XTP 36 /* XTP */
+#define IPPROTO_DDP 37 /* Datagram Delivery */
+#define IPPROTO_CMTP 38 /* Control Message Transport */
+#define IPPROTO_TPXX 39 /* TP++ Transport */
+#define IPPROTO_IL 40 /* IL transport protocol */
+#define IPPROTO_IPV6 41 /* IP6 header */
+#define IPPROTO_SDRP 42 /* Source Demand Routing */
+#define IPPROTO_ROUTING 43 /* IP6 routing header */
+#define IPPROTO_FRAGMENT 44 /* IP6 fragmentation header */
+#define IPPROTO_IDRP 45 /* InterDomain Routing*/
+#define IPPROTO_RSVP 46 /* resource reservation */
+#define IPPROTO_GRE 47 /* General Routing Encap. */
+#define IPPROTO_MHRP 48 /* Mobile Host Routing */
+#define IPPROTO_BHA 49 /* BHA */
+#define IPPROTO_ESP 50 /* IP6 Encap Sec. Payload */
+#define IPPROTO_AH 51 /* IP6 Auth Header */
+#define IPPROTO_INLSP 52 /* Integ. Net Layer Security */
+#define IPPROTO_SWIPE 53 /* IP with encryption */
+#define IPPROTO_NHRP 54 /* Next Hop Resolution */
+#define IPPROTO_MOBILE 55 /* IP Mobility */
+#define IPPROTO_TLSP 56 /* Transport Layer Security */
+#define IPPROTO_SKIP 57 /* SKIP */
+#define IPPROTO_ICMPV6 58 /* ICMP6 */
+#define IPPROTO_NONE 59 /* IP6 no next header */
+#define IPPROTO_DSTOPTS 60 /* IP6 destination option */
+#define IPPROTO_AHIP 61 /* any host internal protocol */
+#define IPPROTO_CFTP 62 /* CFTP */
+#define IPPROTO_HELLO 63 /* "hello" routing protocol */
+#define IPPROTO_SATEXPAK 64 /* SATNET/Backroom EXPAK */
+#define IPPROTO_KRYPTOLAN 65 /* Kryptolan */
+#define IPPROTO_RVD 66 /* Remote Virtual Disk */
+#define IPPROTO_IPPC 67 /* Pluribus Packet Core */
+#define IPPROTO_ADFS 68 /* Any distributed FS */
+#define IPPROTO_SATMON 69 /* Satnet Monitoring */
+#define IPPROTO_VISA 70 /* VISA Protocol */
+#define IPPROTO_IPCV 71 /* Packet Core Utility */
+#define IPPROTO_CPNX 72 /* Comp. Prot. Net. Executive */
+#define IPPROTO_CPHB 73 /* Comp. Prot. HeartBeat */
+#define IPPROTO_WSN 74 /* Wang Span Network */
+#define IPPROTO_PVP 75 /* Packet Video Protocol */
+#define IPPROTO_BRSATMON 76 /* BackRoom SATNET Monitoring */
+#define IPPROTO_ND 77 /* Sun net disk proto (temp.) */
+#define IPPROTO_WBMON 78 /* WIDEBAND Monitoring */
+#define IPPROTO_WBEXPAK 79 /* WIDEBAND EXPAK */
+#define IPPROTO_EON 80 /* ISO cnlp */
+#define IPPROTO_VMTP 81 /* VMTP */
+#define IPPROTO_SVMTP 82 /* Secure VMTP */
+#define IPPROTO_VINES 83 /* Banyon VINES */
+#define IPPROTO_TTP 84 /* TTP */
+#define IPPROTO_IGP 85 /* NSFNET-IGP */
+#define IPPROTO_DGP 86 /* dissimilar gateway prot. */
+#define IPPROTO_TCF 87 /* TCF */
+#define IPPROTO_IGRP 88 /* Cisco/GXS IGRP */
+#define IPPROTO_OSPFIGP 89 /* OSPFIGP */
+#define IPPROTO_SRPC 90 /* Strite RPC protocol */
+#define IPPROTO_LARP 91 /* Locus Address Resoloution */
+#define IPPROTO_MTP 92 /* Multicast Transport */
+#define IPPROTO_AX25 93 /* AX.25 Frames */
+#define IPPROTO_IPEIP 94 /* IP encapsulated in IP */
+#define IPPROTO_MICP 95 /* Mobile Int.ing control */
+#define IPPROTO_SCCSP 96 /* Semaphore Comm. security */
+#define IPPROTO_ETHERIP 97 /* Ethernet IP encapsulation */
+#define IPPROTO_ENCAP 98 /* encapsulation header */
+#define IPPROTO_APES 99 /* any private encr. scheme */
+#define IPPROTO_GMTP 100 /* GMTP*/
+#define IPPROTO_IPCOMP 108 /* payload compression (IPComp) */
+#define IPPROTO_SCTP 132 /* SCTP */
+/* 101-254: Partly Unassigned */
+#define IPPROTO_PIM 103 /* Protocol Independent Mcast */
+#define IPPROTO_CARP 112 /* CARP */
+#define IPPROTO_PGM 113 /* PGM */
+#define IPPROTO_PFSYNC 240 /* PFSYNC */
+/* 255: Reserved */
+/* BSD Private, local use, namespace incursion, no longer used */
+#define IPPROTO_OLD_DIVERT 254 /* OLD divert pseudo-proto */
+#define IPPROTO_MAX 256
+
+/* last return value of *_input(), meaning "all job for this pkt is done". */
+#define IPPROTO_DONE 257
+
+/* Only used internally, so can be outside the range of valid IP protocols. */
+#define IPPROTO_DIVERT 258 /* divert pseudo-protocol */
+
+/*
+ * Defined to avoid confusion. The master value is defined by
+ * PROTO_SPACER in sys/protosw.h.
+ */
+#define IPPROTO_SPACER 32767 /* spacer for loadable protos */
+
+/*
+ * Local port number conventions:
+ *
+ * When a user does a bind(2) or connect(2) with a port number of zero,
+ * a non-conflicting local port address is chosen.
+ * The default range is IPPORT_HIFIRSTAUTO through
+ * IPPORT_HILASTAUTO, although that is settable by sysctl.
+ *
+ * A user may set the IPPROTO_IP option IP_PORTRANGE to change this
+ * default assignment range.
+ *
+ * The value IP_PORTRANGE_DEFAULT causes the default behavior.
+ *
+ * The value IP_PORTRANGE_HIGH changes the range of candidate port numbers
+ * into the "high" range. These are reserved for client outbound connections
+ * which do not want to be filtered by any firewalls.
+ *
+ * The value IP_PORTRANGE_LOW changes the range to the "low" are
+ * that is (by convention) restricted to privileged processes. This
+ * convention is based on "vouchsafe" principles only. It is only secure
+ * if you trust the remote host to restrict these ports.
+ *
+ * The default range of ports and the high range can be changed by
+ * sysctl(3). (net.inet.ip.port{hi,low}{first,last}_auto)
+ *
+ * Changing those values has bad security implications if you are
+ * using a stateless firewall that is allowing packets outside of that
+ * range in order to allow transparent outgoing connections.
+ *
+ * Such a firewall configuration will generally depend on the use of these
+ * default values. If you change them, you may find your Security
+ * Administrator looking for you with a heavy object.
+ *
+ * For a slightly more orthodox text view on this:
+ *
+ * ftp://ftp.isi.edu/in-notes/iana/assignments/port-numbers
+ *
+ * port numbers are divided into three ranges:
+ *
+ * 0 - 1023 Well Known Ports
+ * 1024 - 49151 Registered Ports
+ * 49152 - 65535 Dynamic and/or Private Ports
+ *
+ */
+
+/*
+ * Ports < IPPORT_RESERVED are reserved for
+ * privileged processes (e.g. root). (IP_PORTRANGE_LOW)
+ */
+#define IPPORT_RESERVED 1024
+
+/*
+ * Default local port range, used by IP_PORTRANGE_DEFAULT
+ */
+#define IPPORT_EPHEMERALFIRST 10000
+#define IPPORT_EPHEMERALLAST 65535
+
+/*
+ * Dynamic port range, used by IP_PORTRANGE_HIGH.
+ */
+#define IPPORT_HIFIRSTAUTO 49152
+#define IPPORT_HILASTAUTO 65535
+
+/*
+ * Scanning for a free reserved port return a value below IPPORT_RESERVED,
+ * but higher than IPPORT_RESERVEDSTART. Traditionally the start value was
+ * 512, but that conflicts with some well-known-services that firewalls may
+ * have a fit if we use.
+ */
+#define IPPORT_RESERVEDSTART 600
+
+#define IPPORT_MAX 65535
+
+/*
+ * Definitions of bits in internet address integers.
+ * On subnets, the decomposition of addresses to host and net parts
+ * is done according to subnet mask, not the masks here.
+ */
+#define IN_CLASSA(i) (((u_int32_t)(i) & 0x80000000) == 0)
+#define IN_CLASSA_NET 0xff000000
+#define IN_CLASSA_NSHIFT 24
+#define IN_CLASSA_HOST 0x00ffffff
+#define IN_CLASSA_MAX 128
+
+#define IN_CLASSB(i) (((u_int32_t)(i) & 0xc0000000) == 0x80000000)
+#define IN_CLASSB_NET 0xffff0000
+#define IN_CLASSB_NSHIFT 16
+#define IN_CLASSB_HOST 0x0000ffff
+#define IN_CLASSB_MAX 65536
+
+#define IN_CLASSC(i) (((u_int32_t)(i) & 0xe0000000) == 0xc0000000)
+#define IN_CLASSC_NET 0xffffff00
+#define IN_CLASSC_NSHIFT 8
+#define IN_CLASSC_HOST 0x000000ff
+
+#define IN_CLASSD(i) (((u_int32_t)(i) & 0xf0000000) == 0xe0000000)
+#define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */
+#define IN_CLASSD_NSHIFT 28 /* net and host fields, but */
+#define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */
+#define IN_MULTICAST(i) IN_CLASSD(i)
+
+#define IN_EXPERIMENTAL(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000)
+#define IN_BADCLASS(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000)
+
+#define IN_LINKLOCAL(i) (((u_int32_t)(i) & 0xffff0000) == 0xa9fe0000)
+#define IN_LOOPBACK(i) (((u_int32_t)(i) & 0xff000000) == 0x7f000000)
+#define IN_ZERONET(i) (((u_int32_t)(i) & 0xff000000) == 0)
+
+#define IN_PRIVATE(i) ((((u_int32_t)(i) & 0xff000000) == 0x0a000000) || \
+ (((u_int32_t)(i) & 0xfff00000) == 0xac100000) || \
+ (((u_int32_t)(i) & 0xffff0000) == 0xc0a80000))
+
+#define IN_LOCAL_GROUP(i) (((u_int32_t)(i) & 0xffffff00) == 0xe0000000)
+
+#define IN_ANY_LOCAL(i) (IN_LINKLOCAL(i) || IN_LOCAL_GROUP(i))
+
+#define INADDR_LOOPBACK (u_int32_t)0x7f000001
+#ifndef _KERNEL
+#define INADDR_NONE 0xffffffff /* -1 return */
+#endif
+
+#define INADDR_UNSPEC_GROUP (u_int32_t)0xe0000000 /* 224.0.0.0 */
+#define INADDR_ALLHOSTS_GROUP (u_int32_t)0xe0000001 /* 224.0.0.1 */
+#define INADDR_ALLRTRS_GROUP (u_int32_t)0xe0000002 /* 224.0.0.2 */
+#define INADDR_ALLRPTS_GROUP (u_int32_t)0xe0000016 /* 224.0.0.22, IGMPv3 */
+#define INADDR_CARP_GROUP (u_int32_t)0xe0000012 /* 224.0.0.18 */
+#define INADDR_PFSYNC_GROUP (u_int32_t)0xe00000f0 /* 224.0.0.240 */
+#define INADDR_ALLMDNS_GROUP (u_int32_t)0xe00000fb /* 224.0.0.251 */
+#define INADDR_MAX_LOCAL_GROUP (u_int32_t)0xe00000ff /* 224.0.0.255 */
+
+#define IN_LOOPBACKNET 127 /* official! */
+
+/*
+ * Options for use with [gs]etsockopt at the IP level.
+ * First word of comment is data type; bool is stored in int.
+ */
+#define IP_OPTIONS 1 /* buf/ip_opts; set/get IP options */
+#define IP_HDRINCL 2 /* int; header is included with data */
+#define IP_TOS 3 /* int; IP type of service and preced. */
+#define IP_TTL 4 /* int; IP time to live */
+#define IP_RECVOPTS 5 /* bool; receive all IP opts w/dgram */
+#define IP_RECVRETOPTS 6 /* bool; receive IP opts for response */
+#define IP_RECVDSTADDR 7 /* bool; receive IP dst addr w/dgram */
+#define IP_SENDSRCADDR IP_RECVDSTADDR /* cmsg_type to set src addr */
+#define IP_RETOPTS 8 /* ip_opts; set/get IP options */
+#define IP_MULTICAST_IF 9 /* struct in_addr *or* struct ip_mreqn;
+ * set/get IP multicast i/f */
+#define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */
+#define IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback */
+#define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */
+#define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */
+#define IP_MULTICAST_VIF 14 /* set/get IP mcast virt. iface */
+#define IP_RSVP_ON 15 /* enable RSVP in kernel */
+#define IP_RSVP_OFF 16 /* disable RSVP in kernel */
+#define IP_RSVP_VIF_ON 17 /* set RSVP per-vif socket */
+#define IP_RSVP_VIF_OFF 18 /* unset RSVP per-vif socket */
+#define IP_PORTRANGE 19 /* int; range to choose for unspec port */
+#define IP_RECVIF 20 /* bool; receive reception if w/dgram */
+/* for IPSEC */
+#define IP_IPSEC_POLICY 21 /* int; set/get security policy */
+#define IP_FAITH 22 /* bool; accept FAITH'ed connections */
+
+#define IP_ONESBCAST 23 /* bool: send all-ones broadcast */
+#define IP_BINDANY 24 /* bool: allow bind to any address */
+
+/*
+ * Options for controlling the firewall and dummynet.
+ * Historical options (from 40 to 64) will eventually be
+ * replaced by only two options, IP_FW3 and IP_DUMMYNET3.
+ */
+#define IP_FW_TABLE_ADD 40 /* add entry */
+#define IP_FW_TABLE_DEL 41 /* delete entry */
+#define IP_FW_TABLE_FLUSH 42 /* flush table */
+#define IP_FW_TABLE_GETSIZE 43 /* get table size */
+#define IP_FW_TABLE_LIST 44 /* list table contents */
+
+#define IP_FW3 48 /* generic ipfw v.3 sockopts */
+#define IP_DUMMYNET3 49 /* generic dummynet v.3 sockopts */
+
+#define IP_FW_ADD 50 /* add a firewall rule to chain */
+#define IP_FW_DEL 51 /* delete a firewall rule from chain */
+#define IP_FW_FLUSH 52 /* flush firewall rule chain */
+#define IP_FW_ZERO 53 /* clear single/all firewall counter(s) */
+#define IP_FW_GET 54 /* get entire firewall rule chain */
+#define IP_FW_RESETLOG 55 /* reset logging counters */
+
+#define IP_FW_NAT_CFG 56 /* add/config a nat rule */
+#define IP_FW_NAT_DEL 57 /* delete a nat rule */
+#define IP_FW_NAT_GET_CONFIG 58 /* get configuration of a nat rule */
+#define IP_FW_NAT_GET_LOG 59 /* get log of a nat rule */
+
+#define IP_DUMMYNET_CONFIGURE 60 /* add/configure a dummynet pipe */
+#define IP_DUMMYNET_DEL 61 /* delete a dummynet pipe from chain */
+#define IP_DUMMYNET_FLUSH 62 /* flush dummynet */
+#define IP_DUMMYNET_GET 64 /* get entire dummynet pipes */
+
+#define IP_RECVTTL 65 /* bool; receive IP TTL w/dgram */
+#define IP_MINTTL 66 /* minimum TTL for packet or drop */
+#define IP_DONTFRAG 67 /* don't fragment packet */
+
+/* IPv4 Source Filter Multicast API [RFC3678] */
+#define IP_ADD_SOURCE_MEMBERSHIP 70 /* join a source-specific group */
+#define IP_DROP_SOURCE_MEMBERSHIP 71 /* drop a single source */
+#define IP_BLOCK_SOURCE 72 /* block a source */
+#define IP_UNBLOCK_SOURCE 73 /* unblock a source */
+
+/* The following option is private; do not use it from user applications. */
+#define IP_MSFILTER 74 /* set/get filter list */
+
+/* Protocol Independent Multicast API [RFC3678] */
+#define MCAST_JOIN_GROUP 80 /* join an any-source group */
+#define MCAST_LEAVE_GROUP 81 /* leave all sources for group */
+#define MCAST_JOIN_SOURCE_GROUP 82 /* join a source-specific group */
+#define MCAST_LEAVE_SOURCE_GROUP 83 /* leave a single source */
+#define MCAST_BLOCK_SOURCE 84 /* block a source */
+#define MCAST_UNBLOCK_SOURCE 85 /* unblock a source */
+
+/*
+ * Defaults and limits for options
+ */
+#define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */
+#define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */
+
+/*
+ * The imo_membership vector for each socket is now dynamically allocated at
+ * run-time, bounded by USHRT_MAX, and is reallocated when needed, sized
+ * according to a power-of-two increment.
+ */
+#define IP_MIN_MEMBERSHIPS 31
+#define IP_MAX_MEMBERSHIPS 4095
+#define IP_MAX_SOURCE_FILTER 1024 /* XXX to be unused */
+
+/*
+ * Default resource limits for IPv4 multicast source filtering.
+ * These may be modified by sysctl.
+ */
+#define IP_MAX_GROUP_SRC_FILTER 512 /* sources per group */
+#define IP_MAX_SOCK_SRC_FILTER 128 /* sources per socket/group */
+#define IP_MAX_SOCK_MUTE_FILTER 128 /* XXX no longer used */
+
+/*
+ * Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP.
+ */
+struct ip_mreq {
+ struct in_addr imr_multiaddr; /* IP multicast address of group */
+ struct in_addr imr_interface; /* local IP address of interface */
+};
+
+/*
+ * Modified argument structure for IP_MULTICAST_IF, obtained from Linux.
+ * This is used to specify an interface index for multicast sends, as
+ * the IPv4 legacy APIs do not support this (unless IP_SENDIF is available).
+ */
+struct ip_mreqn {
+ struct in_addr imr_multiaddr; /* IP multicast address of group */
+ struct in_addr imr_address; /* local IP address of interface */
+ int imr_ifindex; /* Interface index; cast to uint32_t */
+};
+
+/*
+ * Argument structure for IPv4 Multicast Source Filter APIs. [RFC3678]
+ */
+struct ip_mreq_source {
+ struct in_addr imr_multiaddr; /* IP multicast address of group */
+ struct in_addr imr_sourceaddr; /* IP address of source */
+ struct in_addr imr_interface; /* local IP address of interface */
+};
+
+/*
+ * Argument structures for Protocol-Independent Multicast Source
+ * Filter APIs. [RFC3678]
+ */
+struct group_req {
+ uint32_t gr_interface; /* interface index */
+ struct sockaddr_storage gr_group; /* group address */
+};
+
+struct group_source_req {
+ uint32_t gsr_interface; /* interface index */
+ struct sockaddr_storage gsr_group; /* group address */
+ struct sockaddr_storage gsr_source; /* source address */
+};
+
+#ifndef __MSFILTERREQ_DEFINED
+#define __MSFILTERREQ_DEFINED
+/*
+ * The following structure is private; do not use it from user applications.
+ * It is used to communicate IP_MSFILTER/IPV6_MSFILTER information between
+ * the RFC 3678 libc functions and the kernel.
+ */
+struct __msfilterreq {
+ uint32_t msfr_ifindex; /* interface index */
+ uint32_t msfr_fmode; /* filter mode for group */
+ uint32_t msfr_nsrcs; /* # of sources in msfr_srcs */
+ struct sockaddr_storage msfr_group; /* group address */
+ struct sockaddr_storage *msfr_srcs; /* pointer to the first member
+ * of a contiguous array of
+ * sources to filter in full.
+ */
+};
+#endif
+
+struct sockaddr;
+
+/*
+ * Advanced (Full-state) APIs [RFC3678]
+ * The RFC specifies uint_t for the 6th argument to [sg]etsourcefilter().
+ * We use uint32_t here to be consistent.
+ */
+int setipv4sourcefilter(int, struct in_addr, struct in_addr, uint32_t,
+ uint32_t, struct in_addr *);
+int getipv4sourcefilter(int, struct in_addr, struct in_addr, uint32_t *,
+ uint32_t *, struct in_addr *);
+int setsourcefilter(int, uint32_t, struct sockaddr *, socklen_t,
+ uint32_t, uint32_t, struct sockaddr_storage *);
+int getsourcefilter(int, uint32_t, struct sockaddr *, socklen_t,
+ uint32_t *, uint32_t *, struct sockaddr_storage *);
+
+/*
+ * Filter modes; also used to represent per-socket filter mode internally.
+ */
+#define MCAST_UNDEFINED 0 /* fmode: not yet defined */
+#define MCAST_INCLUDE 1 /* fmode: include these source(s) */
+#define MCAST_EXCLUDE 2 /* fmode: exclude these source(s) */
+
+/*
+ * Argument for IP_PORTRANGE:
+ * - which range to search when port is unspecified at bind() or connect()
+ */
+#define IP_PORTRANGE_DEFAULT 0 /* default range */
+#define IP_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */
+#define IP_PORTRANGE_LOW 2 /* "low" - vouchsafe security */
+
+/*
+ * Definitions for inet sysctl operations.
+ *
+ * Third level is protocol number.
+ * Fourth level is desired variable within that protocol.
+ */
+#define IPPROTO_MAXID (IPPROTO_AH + 1) /* don't list to IPPROTO_MAX */
+
+#define CTL_IPPROTO_NAMES { \
+ { "ip", CTLTYPE_NODE }, \
+ { "icmp", CTLTYPE_NODE }, \
+ { "igmp", CTLTYPE_NODE }, \
+ { "ggp", CTLTYPE_NODE }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { "tcp", CTLTYPE_NODE }, \
+ { 0, 0 }, \
+ { "egp", CTLTYPE_NODE }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { "pup", CTLTYPE_NODE }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { "udp", CTLTYPE_NODE }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { "idp", CTLTYPE_NODE }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { "ipsec", CTLTYPE_NODE }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
+ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
+ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
+ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
+ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
+ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
+ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
+ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
+ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { 0, 0 }, \
+ { "pim", CTLTYPE_NODE }, \
+}
+
+/*
+ * Names for IP sysctl objects
+ */
+#define IPCTL_FORWARDING 1 /* act as router */
+#define IPCTL_SENDREDIRECTS 2 /* may send redirects when forwarding */
+#define IPCTL_DEFTTL 3 /* default TTL */
+#ifdef notyet
+#define IPCTL_DEFMTU 4 /* default MTU */
+#endif
+#define IPCTL_RTEXPIRE 5 /* cloned route expiration time */
+#define IPCTL_RTMINEXPIRE 6 /* min value for expiration time */
+#define IPCTL_RTMAXCACHE 7 /* trigger level for dynamic expire */
+#define IPCTL_SOURCEROUTE 8 /* may perform source routes */
+#define IPCTL_DIRECTEDBROADCAST 9 /* may re-broadcast received packets */
+#define IPCTL_INTRQMAXLEN 10 /* max length of netisr queue */
+#define IPCTL_INTRQDROPS 11 /* number of netisr q drops */
+#define IPCTL_STATS 12 /* ipstat structure */
+#define IPCTL_ACCEPTSOURCEROUTE 13 /* may accept source routed packets */
+#define IPCTL_FASTFORWARDING 14 /* use fast IP forwarding code */
+#define IPCTL_KEEPFAITH 15 /* FAITH IPv4->IPv6 translater ctl */
+#define IPCTL_GIF_TTL 16 /* default TTL for gif encap packet */
+#define IPCTL_MAXID 17
+
+#define IPCTL_NAMES { \
+ { 0, 0 }, \
+ { "forwarding", CTLTYPE_INT }, \
+ { "redirect", CTLTYPE_INT }, \
+ { "ttl", CTLTYPE_INT }, \
+ { "mtu", CTLTYPE_INT }, \
+ { "rtexpire", CTLTYPE_INT }, \
+ { "rtminexpire", CTLTYPE_INT }, \
+ { "rtmaxcache", CTLTYPE_INT }, \
+ { "sourceroute", CTLTYPE_INT }, \
+ { "directed-broadcast", CTLTYPE_INT }, \
+ { "intr-queue-maxlen", CTLTYPE_INT }, \
+ { "intr-queue-drops", CTLTYPE_INT }, \
+ { "stats", CTLTYPE_STRUCT }, \
+ { "accept_sourceroute", CTLTYPE_INT }, \
+ { "fastforwarding", CTLTYPE_INT }, \
+}
+
+#endif /* __BSD_VISIBLE */
+
+#ifdef _KERNEL
+
+struct ifnet; struct mbuf; /* forward declarations for Standard C */
+
+int in_broadcast(struct in_addr, struct ifnet *);
+int in_canforward(struct in_addr);
+int in_localaddr(struct in_addr);
+int in_localip(struct in_addr);
+int inet_aton(const char *, struct in_addr *); /* in libkern */
+char *inet_ntoa(struct in_addr); /* in libkern */
+char *inet_ntoa_r(struct in_addr ina, char *buf); /* in libkern */
+char *inet_ntop(int, const void *, char *, socklen_t); /* in libkern */
+int inet_pton(int af, const char *, void *); /* in libkern */
+void in_ifdetach(struct ifnet *);
+
+#define in_hosteq(s, t) ((s).s_addr == (t).s_addr)
+#define in_nullhost(x) ((x).s_addr == INADDR_ANY)
+#define in_allhosts(x) ((x).s_addr == htonl(INADDR_ALLHOSTS_GROUP))
+
+#define satosin(sa) ((struct sockaddr_in *)(sa))
+#define sintosa(sin) ((struct sockaddr *)(sin))
+#define ifatoia(ifa) ((struct in_ifaddr *)(ifa))
+
+/*
+ * Historically, BSD keeps ip_len and ip_off in host format
+ * when doing layer 3 processing, and this often requires
+ * to translate the format back and forth.
+ * To make the process explicit, we define a couple of macros
+ * that also take into account the fact that at some point
+ * we may want to keep those fields always in net format.
+ */
+
+#if (BYTE_ORDER == BIG_ENDIAN) || defined(HAVE_NET_IPLEN)
+#define SET_NET_IPLEN(p) do {} while (0)
+#define SET_HOST_IPLEN(p) do {} while (0)
+#else
+#define SET_NET_IPLEN(p) do { \
+ struct ip *h_ip = (p); \
+ h_ip->ip_len = htons(h_ip->ip_len); \
+ h_ip->ip_off = htons(h_ip->ip_off); \
+ } while (0)
+
+#define SET_HOST_IPLEN(p) do { \
+ struct ip *h_ip = (p); \
+ h_ip->ip_len = ntohs(h_ip->ip_len); \
+ h_ip->ip_off = ntohs(h_ip->ip_off); \
+ } while (0)
+#endif /* !HAVE_NET_IPLEN */
+
+#endif /* _KERNEL */
+
+/* INET6 stuff */
+#if __POSIX_VISIBLE >= 200112
+#define __KAME_NETINET_IN_HH_INCLUDED_
+#include <netinet6/in6.h>
+#undef __KAME_NETINET_IN_HH_INCLUDED_
+#endif
+
+#endif /* !_NETINET_IN_H_*/
diff --git a/freebsd/sys/netinet/in_gif.c b/freebsd/sys/netinet/in_gif.c
index 3613e214..12faa528 100644
--- a/freebsd/sys/netinet/in_gif.c
+++ b/freebsd/sys/netinet/in_gif.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $KAME: in_gif.c,v 1.54 2001/05/14 14:02:16 itojun Exp $ */
@@ -31,46 +31,46 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_mrouting.h>
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/malloc.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/in_gif.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip_encap.h>
-#include <freebsd/netinet/ip_ecn.h>
+#include <rtems/bsd/local/opt_mrouting.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/mbuf.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
+#include <sys/protosw.h>
+#include <sys/malloc.h>
+
+#include <net/if.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+#include <netinet/in_gif.h>
+#include <netinet/in_var.h>
+#include <netinet/ip_encap.h>
+#include <netinet/ip_ecn.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
+#include <netinet/ip6.h>
#endif
#ifdef MROUTING
-#include <freebsd/netinet/ip_mroute.h>
+#include <netinet/ip_mroute.h>
#endif /* MROUTING */
-#include <freebsd/net/if_gif.h>
+#include <net/if_gif.h>
static int gif_validate4(const struct ip *, struct gif_softc *,
struct ifnet *);
diff --git a/freebsd/sys/netinet/in_gif.h b/freebsd/sys/netinet/in_gif.h
index 1e42b01f..e1f4ae48 100644
--- a/freebsd/sys/netinet/in_gif.h
+++ b/freebsd/sys/netinet/in_gif.h
@@ -30,8 +30,8 @@
* SUCH DAMAGE.
*/
-#ifndef _NETINET_IN_GIF_HH_
-#define _NETINET_IN_GIF_HH_
+#ifndef _NETINET_IN_GIF_H_
+#define _NETINET_IN_GIF_H_
#define GIF_TTL 30
@@ -42,4 +42,4 @@ int gif_encapcheck4(const struct mbuf *, int, int, void *);
int in_gif_attach(struct gif_softc *);
int in_gif_detach(struct gif_softc *);
-#endif /*_NETINET_IN_GIF_HH_*/
+#endif /*_NETINET_IN_GIF_H_*/
diff --git a/freebsd/sys/netinet/in_mcast.c b/freebsd/sys/netinet/in_mcast.c
index ed2bcc12..d6a316a5 100644
--- a/freebsd/sys/netinet/in_mcast.c
+++ b/freebsd/sys/netinet/in_mcast.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2007-2009 Bruce Simpson.
@@ -34,33 +34,33 @@
* IPv4 multicast socket, group, and socket option processing module.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/ktr.h>
-#include <freebsd/sys/tree.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/igmp_var.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/protosw.h>
+#include <sys/sysctl.h>
+#include <sys/ktr.h>
+#include <sys/tree.h>
+
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_pcb.h>
+#include <netinet/in_var.h>
+#include <netinet/ip_var.h>
+#include <netinet/igmp_var.h>
#ifndef KTR_IGMPV3
#define KTR_IGMPV3 KTR_INET
diff --git a/freebsd/sys/netinet/in_pcb.c b/freebsd/sys/netinet/in_pcb.c
index 186a0f0a..9fd9536e 100644
--- a/freebsd/sys/netinet/in_pcb.c
+++ b/freebsd/sys/netinet/in_pcb.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1991, 1993, 1995
@@ -33,57 +33,57 @@
* @(#)in_pcb.c 8.4 (Berkeley) 5/24/95
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_ddb.h>
-#include <freebsd/local/opt_ipsec.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/local/opt_ddb.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/domain.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/jail.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
#ifdef DDB
-#include <freebsd/ddb/ddb.h>
+#include <ddb/ddb.h>
#endif
-#include <freebsd/vm/uma.h>
+#include <vm/uma.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
+#include <net/if.h>
+#include <net/if_types.h>
+#include <net/route.h>
+#include <net/vnet.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/tcp_var.h>
-#include <freebsd/netinet/udp.h>
-#include <freebsd/netinet/udp_var.h>
+#include <netinet/in.h>
+#include <netinet/in_pcb.h>
+#include <netinet/in_var.h>
+#include <netinet/ip_var.h>
+#include <netinet/tcp_var.h>
+#include <netinet/udp.h>
+#include <netinet/udp_var.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
#endif /* INET6 */
#ifdef IPSEC
-#include <freebsd/netipsec/ipsec.h>
-#include <freebsd/netipsec/key.h>
+#include <netipsec/ipsec.h>
+#include <netipsec/key.h>
#endif /* IPSEC */
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
/*
* These configure the range of local port addresses assigned to
diff --git a/freebsd/sys/netinet/in_pcb.h b/freebsd/sys/netinet/in_pcb.h
index 8cd4a5f8..334537d7 100644
--- a/freebsd/sys/netinet/in_pcb.h
+++ b/freebsd/sys/netinet/in_pcb.h
@@ -31,17 +31,17 @@
* $FreeBSD$
*/
-#ifndef _NETINET_IN_PCB_HH_
-#define _NETINET_IN_PCB_HH_
+#ifndef _NETINET_IN_PCB_H_
+#define _NETINET_IN_PCB_H_
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/_lock.h>
-#include <freebsd/sys/_mutex.h>
-#include <freebsd/sys/_rwlock.h>
+#include <sys/queue.h>
+#include <sys/_lock.h>
+#include <sys/_mutex.h>
+#include <sys/_rwlock.h>
#ifdef _KERNEL
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/net/vnet.h>
+#include <sys/rwlock.h>
+#include <net/vnet.h>
#endif
#define in6pcb inpcb /* for KAME src sync over BSD*'s */
@@ -237,7 +237,7 @@ struct inpcb {
* Interface exported to userland by various protocols which use inpcbs. Hack
* alert -- only define if struct xsocket is in scope.
*/
-#ifdef _SYS_SOCKETVAR_HH_
+#ifdef _SYS_SOCKETVAR_H_
struct xinpcb {
size_t xi_len; /* length of this structure */
struct inpcb xi_inp;
@@ -251,7 +251,7 @@ struct xinpgen {
inp_gen_t xig_gen; /* generation count at this time */
so_gen_t xig_sogen; /* socket generation count at this time */
};
-#endif /* _SYS_SOCKETVAR_HH_ */
+#endif /* _SYS_SOCKETVAR_H_ */
struct inpcbport {
LIST_ENTRY(inpcbport) phd_hash;
@@ -522,4 +522,4 @@ void in_pcbsosetlabel(struct socket *so);
void ipport_tick(void *xtp);
#endif /* _KERNEL */
-#endif /* !_NETINET_IN_PCB_HH_ */
+#endif /* !_NETINET_IN_PCB_H_ */
diff --git a/freebsd/sys/netinet/in_proto.c b/freebsd/sys/netinet/in_proto.c
index 9be0b626..db25a54d 100644
--- a/freebsd/sys/netinet/in_proto.c
+++ b/freebsd/sys/netinet/in_proto.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1993
@@ -31,47 +31,47 @@
* @(#)in_proto.c 8.2 (Berkeley) 2/9/95
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_ipx.h>
-#include <freebsd/local/opt_mrouting.h>
-#include <freebsd/local/opt_ipsec.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_pf.h>
-#include <freebsd/local/opt_sctp.h>
-#include <freebsd/local/opt_mpath.h>
+#include <rtems/bsd/local/opt_ipx.h>
+#include <rtems/bsd/local/opt_mrouting.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_pf.h>
+#include <rtems/bsd/local/opt_sctp.h>
+#include <rtems/bsd/local/opt_mpath.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/socket.h>
+#include <sys/domain.h>
+#include <sys/proc.h>
+#include <sys/protosw.h>
+#include <sys/queue.h>
+#include <sys/sysctl.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
+#include <net/if.h>
+#include <net/route.h>
#ifdef RADIX_MPATH
-#include <freebsd/net/radix_mpath.h>
+#include <net/radix_mpath.h>
#endif
-#include <freebsd/net/vnet.h>
+#include <net/vnet.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_icmp.h>
-#include <freebsd/netinet/igmp_var.h>
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/tcp_timer.h>
-#include <freebsd/netinet/tcp_var.h>
-#include <freebsd/netinet/udp.h>
-#include <freebsd/netinet/udp_var.h>
-#include <freebsd/netinet/ip_encap.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/igmp_var.h>
+#include <netinet/tcp.h>
+#include <netinet/tcp_timer.h>
+#include <netinet/tcp_var.h>
+#include <netinet/udp.h>
+#include <netinet/udp_var.h>
+#include <netinet/ip_encap.h>
/*
* TCP/IP protocol family: IP, ICMP, UDP, TCP.
@@ -80,19 +80,19 @@ __FBSDID("$FreeBSD$");
static struct pr_usrreqs nousrreqs;
#ifdef IPSEC
-#include <freebsd/netipsec/ipsec.h>
+#include <netipsec/ipsec.h>
#endif /* IPSEC */
#ifdef SCTP
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/sctp_pcb.h>
-#include <freebsd/netinet/sctp.h>
-#include <freebsd/netinet/sctp_var.h>
+#include <netinet/in_pcb.h>
+#include <netinet/sctp_pcb.h>
+#include <netinet/sctp.h>
+#include <netinet/sctp_var.h>
#endif /* SCTP */
#ifdef DEV_PFSYNC
-#include <freebsd/net/pfvar.h>
-#include <freebsd/net/if_pfsync.h>
+#include <net/pfvar.h>
+#include <net/if_pfsync.h>
#endif
extern struct domain inetdomain;
diff --git a/freebsd/sys/netinet/in_rmx.c b/freebsd/sys/netinet/in_rmx.c
index 25f99ea0..dda56194 100644
--- a/freebsd/sys/netinet/in_rmx.c
+++ b/freebsd/sys/netinet/in_rmx.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright 1994, 1995 Massachusetts Institute of Technology
@@ -42,25 +42,25 @@
* indefinitely. See in_rtqtimo() below for the exact mechanism.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/callout.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip_var.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
+#include <sys/socket.h>
+#include <sys/mbuf.h>
+#include <sys/syslog.h>
+#include <sys/callout.h>
+
+#include <net/if.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/ip_var.h>
extern int in_inithead(void **head, int off);
#ifdef VIMAGE
diff --git a/freebsd/sys/netinet/in_systm.h b/freebsd/sys/netinet/in_systm.h
index 68bb190e..4b34aa00 100644
--- a/freebsd/sys/netinet/in_systm.h
+++ b/freebsd/sys/netinet/in_systm.h
@@ -1,2 +1,58 @@
-#include <freebsd/bsd.h>
-#include <freebsd/netinet/in_systm.h>
+/*-
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)in_systm.h 8.1 (Berkeley) 6/10/93
+ * $FreeBSD$
+ */
+
+#ifndef _NETINET_IN_SYSTM_H_
+#define _NETINET_IN_SYSTM_H_
+
+/*
+ * Miscellaneous internetwork
+ * definitions for kernel.
+ */
+
+/*
+ * Network types.
+ *
+ * Internally the system keeps counters in the headers with the bytes
+ * swapped so that VAX instructions will work on them. It reverses
+ * the bytes before transmission at each protocol level. The n_ types
+ * represent the types with the bytes in ``high-ender'' order.
+ */
+typedef u_int16_t n_short; /* short as received from the net */
+typedef u_int32_t n_long; /* long as received from the net */
+
+typedef u_int32_t n_time; /* ms since 00:00 GMT, byte rev */
+
+#ifdef _KERNEL
+uint32_t iptime(void);
+#endif
+
+#endif
diff --git a/freebsd/sys/netinet/in_var.h b/freebsd/sys/netinet/in_var.h
index c921ad31..cd1d9043 100644
--- a/freebsd/sys/netinet/in_var.h
+++ b/freebsd/sys/netinet/in_var.h
@@ -30,12 +30,12 @@
* $FreeBSD$
*/
-#ifndef _NETINET_IN_VAR_HH_
-#define _NETINET_IN_VAR_HH_
+#ifndef _NETINET_IN_VAR_H_
+#define _NETINET_IN_VAR_H_
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/fnv_hash.h>
-#include <freebsd/sys/tree.h>
+#include <sys/queue.h>
+#include <sys/fnv_hash.h>
+#include <sys/tree.h>
struct igmp_ifinfo;
struct in_multi;
@@ -470,6 +470,6 @@ int in_rtrequest1(int, struct rt_addrinfo *, struct rtentry **, u_int);
#endif /* _KERNEL */
/* INET6 stuff */
-#include <freebsd/netinet6/in6_var.h>
+#include <netinet6/in6_var.h>
-#endif /* _NETINET_IN_VAR_HH_ */
+#endif /* _NETINET_IN_VAR_H_ */
diff --git a/freebsd/sys/netinet/ip.h b/freebsd/sys/netinet/ip.h
index 9d5d8a9c..daee533e 100644
--- a/freebsd/sys/netinet/ip.h
+++ b/freebsd/sys/netinet/ip.h
@@ -1,2 +1,196 @@
-#include <freebsd/bsd.h>
-#include <freebsd/netinet/ip.h>
+/*-
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ip.h 8.2 (Berkeley) 6/1/94
+ * $FreeBSD$
+ */
+
+#ifndef _NETINET_IP_H_
+#define _NETINET_IP_H_
+
+#include <sys/cdefs.h>
+
+/*
+ * Definitions for internet protocol version 4.
+ *
+ * Per RFC 791, September 1981.
+ */
+#define IPVERSION 4
+
+/*
+ * Structure of an internet header, naked of options.
+ */
+struct ip {
+#if BYTE_ORDER == LITTLE_ENDIAN
+ u_int ip_hl:4, /* header length */
+ ip_v:4; /* version */
+#endif
+#if BYTE_ORDER == BIG_ENDIAN
+ u_int ip_v:4, /* version */
+ ip_hl:4; /* header length */
+#endif
+ u_char ip_tos; /* type of service */
+ u_short ip_len; /* total length */
+ u_short ip_id; /* identification */
+ u_short ip_off; /* fragment offset field */
+#define IP_RF 0x8000 /* reserved fragment flag */
+#define IP_DF 0x4000 /* dont fragment flag */
+#define IP_MF 0x2000 /* more fragments flag */
+#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
+ u_char ip_ttl; /* time to live */
+ u_char ip_p; /* protocol */
+ u_short ip_sum; /* checksum */
+ struct in_addr ip_src,ip_dst; /* source and dest address */
+} __packed __aligned(4);
+
+#define IP_MAXPACKET 65535 /* maximum packet size */
+
+/*
+ * Definitions for IP type of service (ip_tos).
+ */
+#define IPTOS_LOWDELAY 0x10
+#define IPTOS_THROUGHPUT 0x08
+#define IPTOS_RELIABILITY 0x04
+#define IPTOS_MINCOST 0x02
+
+/*
+ * Definitions for IP precedence (also in ip_tos) (hopefully unused).
+ */
+#define IPTOS_PREC_NETCONTROL 0xe0
+#define IPTOS_PREC_INTERNETCONTROL 0xc0
+#define IPTOS_PREC_CRITIC_ECP 0xa0
+#define IPTOS_PREC_FLASHOVERRIDE 0x80
+#define IPTOS_PREC_FLASH 0x60
+#define IPTOS_PREC_IMMEDIATE 0x40
+#define IPTOS_PREC_PRIORITY 0x20
+#define IPTOS_PREC_ROUTINE 0x00
+
+/*
+ * ECN (Explicit Congestion Notification) codepoints in RFC3168 mapped to the
+ * lower 2 bits of the TOS field.
+ */
+#define IPTOS_ECN_NOTECT 0x00 /* not-ECT */
+#define IPTOS_ECN_ECT1 0x01 /* ECN-capable transport (1) */
+#define IPTOS_ECN_ECT0 0x02 /* ECN-capable transport (0) */
+#define IPTOS_ECN_CE 0x03 /* congestion experienced */
+#define IPTOS_ECN_MASK 0x03 /* ECN field mask */
+
+/*
+ * Definitions for options.
+ */
+#define IPOPT_COPIED(o) ((o)&0x80)
+#define IPOPT_CLASS(o) ((o)&0x60)
+#define IPOPT_NUMBER(o) ((o)&0x1f)
+
+#define IPOPT_CONTROL 0x00
+#define IPOPT_RESERVED1 0x20
+#define IPOPT_DEBMEAS 0x40
+#define IPOPT_RESERVED2 0x60
+
+#define IPOPT_EOL 0 /* end of option list */
+#define IPOPT_NOP 1 /* no operation */
+
+#define IPOPT_RR 7 /* record packet route */
+#define IPOPT_TS 68 /* timestamp */
+#define IPOPT_SECURITY 130 /* provide s,c,h,tcc */
+#define IPOPT_LSRR 131 /* loose source route */
+#define IPOPT_ESO 133 /* extended security */
+#define IPOPT_CIPSO 134 /* commerical security */
+#define IPOPT_SATID 136 /* satnet id */
+#define IPOPT_SSRR 137 /* strict source route */
+#define IPOPT_RA 148 /* router alert */
+
+/*
+ * Offsets to fields in options other than EOL and NOP.
+ */
+#define IPOPT_OPTVAL 0 /* option ID */
+#define IPOPT_OLEN 1 /* option length */
+#define IPOPT_OFFSET 2 /* offset within option */
+#define IPOPT_MINOFF 4 /* min value of above */
+
+/*
+ * Time stamp option structure.
+ */
+struct ip_timestamp {
+ u_char ipt_code; /* IPOPT_TS */
+ u_char ipt_len; /* size of structure (variable) */
+ u_char ipt_ptr; /* index of current entry */
+#if BYTE_ORDER == LITTLE_ENDIAN
+ u_int ipt_flg:4, /* flags, see below */
+ ipt_oflw:4; /* overflow counter */
+#endif
+#if BYTE_ORDER == BIG_ENDIAN
+ u_int ipt_oflw:4, /* overflow counter */
+ ipt_flg:4; /* flags, see below */
+#endif
+ union ipt_timestamp {
+ uint32_t ipt_time[1]; /* network format */
+ struct ipt_ta {
+ struct in_addr ipt_addr;
+ uint32_t ipt_time; /* network format */
+ } ipt_ta[1];
+ } ipt_timestamp;
+};
+
+/* Flag bits for ipt_flg. */
+#define IPOPT_TS_TSONLY 0 /* timestamps only */
+#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
+#define IPOPT_TS_PRESPEC 3 /* specified modules only */
+
+/* Bits for security (not byte swapped). */
+#define IPOPT_SECUR_UNCLASS 0x0000
+#define IPOPT_SECUR_CONFID 0xf135
+#define IPOPT_SECUR_EFTO 0x789a
+#define IPOPT_SECUR_MMMM 0xbc4d
+#define IPOPT_SECUR_RESTR 0xaf13
+#define IPOPT_SECUR_SECRET 0xd788
+#define IPOPT_SECUR_TOPSECRET 0x6bc5
+
+/*
+ * Internet implementation parameters.
+ */
+#define MAXTTL 255 /* maximum time to live (seconds) */
+#define IPDEFTTL 64 /* default ttl, from RFC 1340 */
+#define IPFRAGTTL 60 /* time to live for frags, slowhz */
+#define IPTTLDEC 1 /* subtracted when forwarding */
+#define IP_MSS 576 /* default maximum segment size */
+
+/*
+ * This is the real IPv4 pseudo header, used for computing the TCP and UDP
+ * checksums. For the Internet checksum, struct ipovly can be used instead.
+ * For stronger checksums, the real thing must be used.
+ */
+struct ippseudo {
+ struct in_addr ippseudo_src; /* source internet address */
+ struct in_addr ippseudo_dst; /* destination internet address */
+ u_char ippseudo_pad; /* pad, must be zero */
+ u_char ippseudo_p; /* protocol */
+ u_short ippseudo_len; /* protocol length */
+};
+#endif
diff --git a/freebsd/sys/netinet/ip6.h b/freebsd/sys/netinet/ip6.h
index f30da6d1..3fb08a78 100644
--- a/freebsd/sys/netinet/ip6.h
+++ b/freebsd/sys/netinet/ip6.h
@@ -1,2 +1,352 @@
-#include <freebsd/bsd.h>
-#include <freebsd/netinet/ip6.h>
+/* $FreeBSD$ */
+/* $KAME: ip6.h,v 1.18 2001/03/29 05:34:30 itojun Exp $ */
+
+/*-
+ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*-
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ip.h 8.1 (Berkeley) 6/10/93
+ */
+
+#ifndef _NETINET_IP6_H_
+#define _NETINET_IP6_H_
+
+/*
+ * Definition for internet protocol version 6.
+ * RFC 2460
+ */
+
+struct ip6_hdr {
+ union {
+ struct ip6_hdrctl {
+ u_int32_t ip6_un1_flow; /* 20 bits of flow-ID */
+ u_int16_t ip6_un1_plen; /* payload length */
+ u_int8_t ip6_un1_nxt; /* next header */
+ u_int8_t ip6_un1_hlim; /* hop limit */
+ } ip6_un1;
+ u_int8_t ip6_un2_vfc; /* 4 bits version, top 4 bits class */
+ } ip6_ctlun;
+ struct in6_addr ip6_src; /* source address */
+ struct in6_addr ip6_dst; /* destination address */
+} __packed;
+
+#define ip6_vfc ip6_ctlun.ip6_un2_vfc
+#define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow
+#define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen
+#define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt
+#define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim
+#define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim
+
+#define IPV6_VERSION 0x60
+#define IPV6_VERSION_MASK 0xf0
+
+#if BYTE_ORDER == BIG_ENDIAN
+#define IPV6_FLOWINFO_MASK 0x0fffffff /* flow info (28 bits) */
+#define IPV6_FLOWLABEL_MASK 0x000fffff /* flow label (20 bits) */
+#else
+#if BYTE_ORDER == LITTLE_ENDIAN
+#define IPV6_FLOWINFO_MASK 0xffffff0f /* flow info (28 bits) */
+#define IPV6_FLOWLABEL_MASK 0xffff0f00 /* flow label (20 bits) */
+#endif /* LITTLE_ENDIAN */
+#endif
+#if 1
+/* ECN bits proposed by Sally Floyd */
+#define IP6TOS_CE 0x01 /* congestion experienced */
+#define IP6TOS_ECT 0x02 /* ECN-capable transport */
+#endif
+
+/*
+ * Extension Headers
+ */
+
+struct ip6_ext {
+ u_int8_t ip6e_nxt;
+ u_int8_t ip6e_len;
+} __packed;
+
+/* Hop-by-Hop options header */
+/* XXX should we pad it to force alignment on an 8-byte boundary? */
+struct ip6_hbh {
+ u_int8_t ip6h_nxt; /* next header */
+ u_int8_t ip6h_len; /* length in units of 8 octets */
+ /* followed by options */
+} __packed;
+
+/* Destination options header */
+/* XXX should we pad it to force alignment on an 8-byte boundary? */
+struct ip6_dest {
+ u_int8_t ip6d_nxt; /* next header */
+ u_int8_t ip6d_len; /* length in units of 8 octets */
+ /* followed by options */
+} __packed;
+
+/* Option types and related macros */
+#define IP6OPT_PAD1 0x00 /* 00 0 00000 */
+#define IP6OPT_PADN 0x01 /* 00 0 00001 */
+#define IP6OPT_JUMBO 0xC2 /* 11 0 00010 = 194 */
+#define IP6OPT_NSAP_ADDR 0xC3 /* 11 0 00011 */
+#define IP6OPT_TUNNEL_LIMIT 0x04 /* 00 0 00100 */
+#ifndef _KERNEL
+#define IP6OPT_RTALERT 0x05 /* 00 0 00101 (KAME definition) */
+#endif
+#define IP6OPT_ROUTER_ALERT 0x05 /* 00 0 00101 (RFC3542, recommended) */
+
+#define IP6OPT_RTALERT_LEN 4
+#define IP6OPT_RTALERT_MLD 0 /* Datagram contains an MLD message */
+#define IP6OPT_RTALERT_RSVP 1 /* Datagram contains an RSVP message */
+#define IP6OPT_RTALERT_ACTNET 2 /* contains an Active Networks msg */
+#define IP6OPT_MINLEN 2
+
+#define IP6OPT_EID 0x8a /* 10 0 01010 */
+
+#define IP6OPT_TYPE(o) ((o) & 0xC0)
+#define IP6OPT_TYPE_SKIP 0x00
+#define IP6OPT_TYPE_DISCARD 0x40
+#define IP6OPT_TYPE_FORCEICMP 0x80
+#define IP6OPT_TYPE_ICMP 0xC0
+
+#define IP6OPT_MUTABLE 0x20
+
+/* IPv6 options: common part */
+struct ip6_opt {
+ u_int8_t ip6o_type;
+ u_int8_t ip6o_len;
+} __packed;
+
+/* Jumbo Payload Option */
+struct ip6_opt_jumbo {
+ u_int8_t ip6oj_type;
+ u_int8_t ip6oj_len;
+ u_int8_t ip6oj_jumbo_len[4];
+} __packed;
+#define IP6OPT_JUMBO_LEN 6
+
+/* NSAP Address Option */
+struct ip6_opt_nsap {
+ u_int8_t ip6on_type;
+ u_int8_t ip6on_len;
+ u_int8_t ip6on_src_nsap_len;
+ u_int8_t ip6on_dst_nsap_len;
+ /* followed by source NSAP */
+ /* followed by destination NSAP */
+} __packed;
+
+/* Tunnel Limit Option */
+struct ip6_opt_tunnel {
+ u_int8_t ip6ot_type;
+ u_int8_t ip6ot_len;
+ u_int8_t ip6ot_encap_limit;
+} __packed;
+
+/* Router Alert Option */
+struct ip6_opt_router {
+ u_int8_t ip6or_type;
+ u_int8_t ip6or_len;
+ u_int8_t ip6or_value[2];
+} __packed;
+/* Router alert values (in network byte order) */
+#if BYTE_ORDER == BIG_ENDIAN
+#define IP6_ALERT_MLD 0x0000
+#define IP6_ALERT_RSVP 0x0001
+#define IP6_ALERT_AN 0x0002
+#else
+#if BYTE_ORDER == LITTLE_ENDIAN
+#define IP6_ALERT_MLD 0x0000
+#define IP6_ALERT_RSVP 0x0100
+#define IP6_ALERT_AN 0x0200
+#endif /* LITTLE_ENDIAN */
+#endif
+
+/* Routing header */
+struct ip6_rthdr {
+ u_int8_t ip6r_nxt; /* next header */
+ u_int8_t ip6r_len; /* length in units of 8 octets */
+ u_int8_t ip6r_type; /* routing type */
+ u_int8_t ip6r_segleft; /* segments left */
+ /* followed by routing type specific data */
+} __packed;
+
+/* Type 0 Routing header, deprecated by RFC 5095. */
+struct ip6_rthdr0 {
+ u_int8_t ip6r0_nxt; /* next header */
+ u_int8_t ip6r0_len; /* length in units of 8 octets */
+ u_int8_t ip6r0_type; /* always zero */
+ u_int8_t ip6r0_segleft; /* segments left */
+ u_int32_t ip6r0_reserved; /* reserved field */
+ /* followed by up to 127 struct in6_addr */
+} __packed;
+
+/* Fragment header */
+struct ip6_frag {
+ u_int8_t ip6f_nxt; /* next header */
+ u_int8_t ip6f_reserved; /* reserved field */
+ u_int16_t ip6f_offlg; /* offset, reserved, and flag */
+ u_int32_t ip6f_ident; /* identification */
+} __packed;
+
+#if BYTE_ORDER == BIG_ENDIAN
+#define IP6F_OFF_MASK 0xfff8 /* mask out offset from _offlg */
+#define IP6F_RESERVED_MASK 0x0006 /* reserved bits in ip6f_offlg */
+#define IP6F_MORE_FRAG 0x0001 /* more-fragments flag */
+#else /* BYTE_ORDER == LITTLE_ENDIAN */
+#define IP6F_OFF_MASK 0xf8ff /* mask out offset from _offlg */
+#define IP6F_RESERVED_MASK 0x0600 /* reserved bits in ip6f_offlg */
+#define IP6F_MORE_FRAG 0x0100 /* more-fragments flag */
+#endif /* BYTE_ORDER == LITTLE_ENDIAN */
+
+/*
+ * Internet implementation parameters.
+ */
+#define IPV6_MAXHLIM 255 /* maximum hoplimit */
+#define IPV6_DEFHLIM 64 /* default hlim */
+#define IPV6_FRAGTTL 120 /* ttl for fragment packets, in slowtimo tick */
+#define IPV6_HLIMDEC 1 /* subtracted when forwarding */
+
+#define IPV6_MMTU 1280 /* minimal MTU and reassembly. 1024 + 256 */
+#define IPV6_MAXPACKET 65535 /* ip6 max packet size without Jumbo payload*/
+#define IPV6_MAXOPTHDR 2048 /* max option header size, 256 64-bit words */
+
+#ifdef _KERNEL
+/*
+ * IP6_EXTHDR_CHECK ensures that region between the IP6 header and the
+ * target header (including IPv6 itself, extension headers and
+ * TCP/UDP/ICMP6 headers) are continuous. KAME requires drivers
+ * to store incoming data into one internal mbuf or one or more external
+ * mbufs(never into two or more internal mbufs). Thus, the third case is
+ * supposed to never be matched but is prepared just in case.
+ */
+
+#define IP6_EXTHDR_CHECK(m, off, hlen, ret) \
+do { \
+ if ((m)->m_next != NULL) { \
+ if (((m)->m_flags & M_LOOP) && \
+ ((m)->m_len < (off) + (hlen)) && \
+ (((m) = m_pullup((m), (off) + (hlen))) == NULL)) { \
+ V_ip6stat.ip6s_exthdrtoolong++; \
+ return ret; \
+ } else if ((m)->m_flags & M_EXT) { \
+ if ((m)->m_len < (off) + (hlen)) { \
+ V_ip6stat.ip6s_exthdrtoolong++; \
+ m_freem(m); \
+ return ret; \
+ } \
+ } else { \
+ if ((m)->m_len < (off) + (hlen)) { \
+ V_ip6stat.ip6s_exthdrtoolong++; \
+ m_freem(m); \
+ return ret; \
+ } \
+ } \
+ } else { \
+ if ((m)->m_len < (off) + (hlen)) { \
+ V_ip6stat.ip6s_tooshort++; \
+ in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_truncated); \
+ m_freem(m); \
+ return ret; \
+ } \
+ } \
+} while (/*CONSTCOND*/ 0)
+
+/*
+ * IP6_EXTHDR_GET ensures that intermediate protocol header (from "off" to
+ * "len") is located in single mbuf, on contiguous memory region.
+ * The pointer to the region will be returned to pointer variable "val",
+ * with type "typ".
+ * IP6_EXTHDR_GET0 does the same, except that it aligns the structure at the
+ * very top of mbuf. GET0 is likely to make memory copy than GET.
+ *
+ * XXX we're now testing this, needs m_pulldown()
+ */
+#define IP6_EXTHDR_GET(val, typ, m, off, len) \
+do { \
+ struct mbuf *t; \
+ int tmp; \
+ if ((m)->m_len >= (off) + (len)) \
+ (val) = (typ)(mtod((m), caddr_t) + (off)); \
+ else { \
+ t = m_pulldown((m), (off), (len), &tmp); \
+ if (t) { \
+ if (t->m_len < tmp + (len)) \
+ panic("m_pulldown malfunction"); \
+ (val) = (typ)(mtod(t, caddr_t) + tmp); \
+ } else { \
+ (val) = (typ)NULL; \
+ (m) = NULL; \
+ } \
+ } \
+} while (/*CONSTCOND*/ 0)
+
+#define IP6_EXTHDR_GET0(val, typ, m, off, len) \
+do { \
+ struct mbuf *t; \
+ if ((off) == 0) \
+ (val) = (typ)mtod(m, caddr_t); \
+ else { \
+ t = m_pulldown((m), (off), (len), NULL); \
+ if (t) { \
+ if (t->m_len < (len)) \
+ panic("m_pulldown malfunction"); \
+ (val) = (typ)mtod(t, caddr_t); \
+ } else { \
+ (val) = (typ)NULL; \
+ (m) = NULL; \
+ } \
+ } \
+} while (/*CONSTCOND*/ 0)
+
+#endif /*_KERNEL*/
+
+#endif /* not _NETINET_IP6_H_ */
diff --git a/freebsd/sys/netinet/ip_carp.c b/freebsd/sys/netinet/ip_carp.c
index 25b20895..7b2a7e18 100644
--- a/freebsd/sys/netinet/ip_carp.c
+++ b/freebsd/sys/netinet/ip_carp.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -26,71 +26,71 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_bpf.h>
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/conf.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/limits.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/filio.h>
-#include <freebsd/sys/sockio.h>
-
-#include <freebsd/sys/socket.h>
+#include <rtems/bsd/local/opt_bpf.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/conf.h>
+#include <sys/kernel.h>
+#include <sys/limits.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/protosw.h>
+#include <sys/sysctl.h>
+#include <sys/syslog.h>
+#include <sys/signalvar.h>
+#include <sys/filio.h>
+#include <sys/sockio.h>
+
+#include <sys/socket.h>
#ifndef __rtems__
-#include <freebsd/sys/vnode.h>
+#include <sys/vnode.h>
#endif
-#include <freebsd/machine/stdarg.h>
+#include <machine/stdarg.h>
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/fddi.h>
-#include <freebsd/net/iso88025.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_clone.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
+#include <net/bpf.h>
+#include <net/ethernet.h>
+#include <net/fddi.h>
+#include <net/iso88025.h>
+#include <net/if.h>
+#include <net/if_clone.h>
+#include <net/if_dl.h>
+#include <net/if_types.h>
+#include <net/route.h>
+#include <net/vnet.h>
#ifdef INET
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/if_ether.h>
-#include <freebsd/machine/in_cksum.h>
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+#include <netinet/if_ether.h>
+#include <machine/in_cksum.h>
#endif
#ifdef INET6
-#include <freebsd/netinet/icmp6.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6protosw.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/scope6_var.h>
-#include <freebsd/netinet6/nd6.h>
+#include <netinet/icmp6.h>
+#include <netinet/ip6.h>
+#include <netinet6/ip6protosw.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/scope6_var.h>
+#include <netinet6/nd6.h>
#endif
-#include <freebsd/crypto/sha1.h>
-#include <freebsd/netinet/ip_carp.h>
+#include <crypto/sha1.h>
+#include <netinet/ip_carp.h>
#define CARP_IFNAME "carp"
static MALLOC_DEFINE(M_CARP, "CARP", "CARP interfaces");
diff --git a/freebsd/sys/netinet/ip_divert.c b/freebsd/sys/netinet/ip_divert.c
index 13999825..857df606 100644
--- a/freebsd/sys/netinet/ip_divert.c
+++ b/freebsd/sys/netinet/ip_divert.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1988, 1993
@@ -29,53 +29,53 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#if !defined(KLD_MODULE)
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_sctp.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_sctp.h>
#ifndef INET
#error "IPDIVERT requires INET."
#endif
#endif
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/systm.h>
-
-#include <freebsd/vm/uma.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <sys/kernel.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/protosw.h>
+#include <sys/rwlock.h>
+#include <sys/signalvar.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sx.h>
+#include <sys/sysctl.h>
+#include <sys/systm.h>
+
+#include <vm/uma.h>
+
+#include <net/if.h>
+#include <net/netisr.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_pcb.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
#ifdef SCTP
-#include <freebsd/netinet/sctp_crc32.h>
+#include <netinet/sctp_crc32.h>
#endif
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
/*
* Divert sockets
diff --git a/freebsd/sys/netinet/ip_divert.h b/freebsd/sys/netinet/ip_divert.h
index eb9b33d4..b8bcf4fb 100644
--- a/freebsd/sys/netinet/ip_divert.h
+++ b/freebsd/sys/netinet/ip_divert.h
@@ -32,8 +32,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET_IP_DIVERT_HH_
-#define _NETINET_IP_DIVERT_HH_
+#ifndef _NETINET_IP_DIVERT_H_
+#define _NETINET_IP_DIVERT_H_
/*
* divert has no custom kernel-userland API.
@@ -52,4 +52,4 @@
* sin_addr = IN: address of the incoming interface;
* OUT: INADDR_ANY
*/
-#endif /* _NETINET_IP_DIVERT_HH_ */
+#endif /* _NETINET_IP_DIVERT_H_ */
diff --git a/freebsd/sys/netinet/ip_ecn.c b/freebsd/sys/netinet/ip_ecn.c
index 97b32b2c..33f07b8a 100644
--- a/freebsd/sys/netinet/ip_ecn.c
+++ b/freebsd/sys/netinet/ip_ecn.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $KAME: ip_ecn.c,v 1.12 2002/01/07 11:34:47 kjc Exp $ */
@@ -36,27 +36,27 @@
* http://www.aciri.org/floyd/papers/draft-ipsec-ecn-00.txt
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/errno.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <rtems/bsd/sys/errno.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
+#include <netinet/ip6.h>
#endif
-#include <freebsd/netinet/ip_ecn.h>
+#include <netinet/ip_ecn.h>
#ifdef INET6
-#include <freebsd/netinet6/ip6_ecn.h>
+#include <netinet6/ip6_ecn.h>
#endif
/*
diff --git a/freebsd/sys/netinet/ip_ecn.h b/freebsd/sys/netinet/ip_ecn.h
index 271c8a47..6a814160 100644
--- a/freebsd/sys/netinet/ip_ecn.h
+++ b/freebsd/sys/netinet/ip_ecn.h
@@ -35,11 +35,11 @@
* http://www.aciri.org/floyd/papers/draft-ipsec-ecn-00.txt
*/
-#ifndef _NETINET_IP_ECN_HH_
-#define _NETINET_IP_ECN_HH_
+#ifndef _NETINET_IP_ECN_H_
+#define _NETINET_IP_ECN_H_
#if defined(_KERNEL) && !defined(_LKM)
-#include <freebsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet.h>
#endif
#define ECN_ALLOWED 1 /* ECN allowed */
diff --git a/freebsd/sys/netinet/ip_encap.c b/freebsd/sys/netinet/ip_encap.c
index 45b0593c..9c7b904d 100644
--- a/freebsd/sys/netinet/ip_encap.c
+++ b/freebsd/sys/netinet/ip_encap.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $KAME: ip_encap.c,v 1.41 2001/03/15 08:35:08 itojun Exp $ */
@@ -58,41 +58,41 @@
*/
/* XXX is M_NETADDR correct? */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_mrouting.h>
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_mrouting.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/queue.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/mbuf.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/protosw.h>
+#include <sys/queue.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
+#include <net/if.h>
+#include <net/route.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_encap.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_encap.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/ip6protosw.h>
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/ip6protosw.h>
#endif
-#include <freebsd/machine/stdarg.h>
+#include <machine/stdarg.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
static MALLOC_DEFINE(M_NETADDR, "encap_export_host", "Export host address structure");
static void encap_add(struct encaptab *);
diff --git a/freebsd/sys/netinet/ip_encap.h b/freebsd/sys/netinet/ip_encap.h
index 44dd1a0d..3b1a5aee 100644
--- a/freebsd/sys/netinet/ip_encap.h
+++ b/freebsd/sys/netinet/ip_encap.h
@@ -30,8 +30,8 @@
* SUCH DAMAGE.
*/
-#ifndef _NETINET_IP_ENCAP_HH_
-#define _NETINET_IP_ENCAP_HH_
+#ifndef _NETINET_IP_ENCAP_H_
+#define _NETINET_IP_ENCAP_H_
#ifdef _KERNEL
@@ -61,4 +61,4 @@ int encap_detach(const struct encaptab *);
void *encap_getarg(struct mbuf *);
#endif
-#endif /*_NETINET_IP_ENCAP_HH_*/
+#endif /*_NETINET_IP_ENCAP_H_*/
diff --git a/freebsd/sys/netinet/ip_fastfwd.c b/freebsd/sys/netinet/ip_fastfwd.c
index 6d406b2b..f27a4f7d 100644
--- a/freebsd/sys/netinet/ip_fastfwd.c
+++ b/freebsd/sys/netinet/ip_fastfwd.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2003 Andre Oppermann, Internet Business Solutions AG
@@ -75,38 +75,38 @@
* is being followed here.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_ipfw.h>
-#include <freebsd/local/opt_ipstealth.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/pfil.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_var.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_icmp.h>
-#include <freebsd/netinet/ip_options.h>
-
-#include <freebsd/machine/in_cksum.h>
+#include <rtems/bsd/local/opt_ipfw.h>
+#include <rtems/bsd/local/opt_ipstealth.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/sysctl.h>
+
+#include <net/pfil.h>
+#include <net/if.h>
+#include <net/if_types.h>
+#include <net/if_var.h>
+#include <net/if_dl.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/ip_options.h>
+
+#include <machine/in_cksum.h>
static VNET_DEFINE(int, ipfastforward_active);
#define V_ipfastforward_active VNET(ipfastforward_active)
diff --git a/freebsd/sys/netinet/ip_gre.c b/freebsd/sys/netinet/ip_gre.c
index 253376de..cd118a53 100644
--- a/freebsd/sys/netinet/ip_gre.c
+++ b/freebsd/sys/netinet/ip_gre.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $NetBSD: ip_gre.c,v 1.29 2003/09/05 23:02:43 itojun Exp $ */
@@ -46,52 +46,52 @@
* This currently handles IPPROTO_GRE, IPPROTO_MOBILE
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_atalk.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/raw_cb.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_atalk.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/protosw.h>
+#include <rtems/bsd/sys/errno.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/kernel.h>
+#include <sys/syslog.h>
+#include <net/bpf.h>
+#include <net/ethernet.h>
+#include <net/if.h>
+#include <net/netisr.h>
+#include <net/route.h>
+#include <net/raw_cb.h>
#ifdef INET
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_gre.h>
-#include <freebsd/machine/in_cksum.h>
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_gre.h>
+#include <machine/in_cksum.h>
#else
#error ip_gre input without IP?
#endif
#ifdef NETATALK
-#include <freebsd/netatalk/at.h>
-#include <freebsd/netatalk/at_var.h>
-#include <freebsd/netatalk/at_extern.h>
+#include <netatalk/at.h>
+#include <netatalk/at_var.h>
+#include <netatalk/at_extern.h>
#endif
/* Needs IP headers. */
-#include <freebsd/net/if_gre.h>
+#include <net/if_gre.h>
-#include <freebsd/machine/stdarg.h>
+#include <machine/stdarg.h>
#if 1
void gre_inet_ntoa(struct in_addr in); /* XXX */
diff --git a/freebsd/sys/netinet/ip_icmp.c b/freebsd/sys/netinet/ip_icmp.c
index b7a83128..d8d34aa4 100644
--- a/freebsd/sys/netinet/ip_icmp.c
+++ b/freebsd/sys/netinet/ip_icmp.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1988, 1993
@@ -31,47 +31,47 @@
* @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_ipsec.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/syslog.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_icmp.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_options.h>
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/tcp_var.h>
-#include <freebsd/netinet/tcpip.h>
-#include <freebsd/netinet/icmp_var.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
+#include <sys/syslog.h>
+
+#include <net/if.h>
+#include <net/if_types.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_pcb.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/ip.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_options.h>
+#include <netinet/tcp.h>
+#include <netinet/tcp_var.h>
+#include <netinet/tcpip.h>
+#include <netinet/icmp_var.h>
#ifdef IPSEC
-#include <freebsd/netipsec/ipsec.h>
-#include <freebsd/netipsec/key.h>
+#include <netipsec/ipsec.h>
+#include <netipsec/key.h>
#endif
-#include <freebsd/machine/in_cksum.h>
+#include <machine/in_cksum.h>
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
/*
* ICMP routines: error generation, receive packet processing, and
diff --git a/freebsd/sys/netinet/ip_icmp.h b/freebsd/sys/netinet/ip_icmp.h
index 903f033d..9cabdb58 100644
--- a/freebsd/sys/netinet/ip_icmp.h
+++ b/freebsd/sys/netinet/ip_icmp.h
@@ -1,2 +1,214 @@
-#include <freebsd/bsd.h>
-#include <freebsd/netinet/ip_icmp.h>
+/*-
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93
+ * $FreeBSD$
+ */
+
+#ifndef _NETINET_IP_ICMP_H_
+#define _NETINET_IP_ICMP_H_
+
+/*
+ * Interface Control Message Protocol Definitions.
+ * Per RFC 792, September 1981.
+ */
+
+/*
+ * Internal of an ICMP Router Advertisement
+ */
+struct icmp_ra_addr {
+ u_int32_t ira_addr;
+ u_int32_t ira_preference;
+};
+
+/*
+ * Structure of an icmp header.
+ */
+struct icmphdr {
+ u_char icmp_type; /* type of message, see below */
+ u_char icmp_code; /* type sub code */
+ u_short icmp_cksum; /* ones complement cksum of struct */
+};
+
+/*
+ * Structure of an icmp packet.
+ *
+ * XXX: should start with a struct icmphdr.
+ */
+struct icmp {
+ u_char icmp_type; /* type of message, see below */
+ u_char icmp_code; /* type sub code */
+ u_short icmp_cksum; /* ones complement cksum of struct */
+ union {
+ u_char ih_pptr; /* ICMP_PARAMPROB */
+ struct in_addr ih_gwaddr; /* ICMP_REDIRECT */
+ struct ih_idseq {
+ uint16_t icd_id; /* network format */
+ uint16_t icd_seq; /* network format */
+ } ih_idseq;
+ int ih_void;
+
+ /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
+ struct ih_pmtu {
+ uint16_t ipm_void; /* network format */
+ uint16_t ipm_nextmtu; /* network format */
+ } ih_pmtu;
+
+ struct ih_rtradv {
+ u_char irt_num_addrs;
+ u_char irt_wpa;
+ u_int16_t irt_lifetime;
+ } ih_rtradv;
+ } icmp_hun;
+#define icmp_pptr icmp_hun.ih_pptr
+#define icmp_gwaddr icmp_hun.ih_gwaddr
+#define icmp_id icmp_hun.ih_idseq.icd_id
+#define icmp_seq icmp_hun.ih_idseq.icd_seq
+#define icmp_void icmp_hun.ih_void
+#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void
+#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu
+#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs
+#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa
+#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime
+ union {
+ struct id_ts { /* ICMP Timestamp */
+ /*
+ * The next 3 fields are in network format,
+ * milliseconds since 00:00 GMT
+ */
+ uint32_t its_otime; /* Originate */
+ uint32_t its_rtime; /* Receive */
+ uint32_t its_ttime; /* Transmit */
+ } id_ts;
+ struct id_ip {
+ struct ip idi_ip;
+ /* options and then 64 bits of data */
+ } id_ip;
+ struct icmp_ra_addr id_radv;
+ u_int32_t id_mask;
+ char id_data[1];
+ } icmp_dun;
+#define icmp_otime icmp_dun.id_ts.its_otime
+#define icmp_rtime icmp_dun.id_ts.its_rtime
+#define icmp_ttime icmp_dun.id_ts.its_ttime
+#define icmp_ip icmp_dun.id_ip.idi_ip
+#define icmp_radv icmp_dun.id_radv
+#define icmp_mask icmp_dun.id_mask
+#define icmp_data icmp_dun.id_data
+};
+
+/*
+ * Lower bounds on packet lengths for various types.
+ * For the error advice packets must first insure that the
+ * packet is large enough to contain the returned ip header.
+ * Only then can we do the check to see if 64 bits of packet
+ * data have been returned, since we need to check the returned
+ * ip header length.
+ */
+#define ICMP_MINLEN 8 /* abs minimum */
+#define ICMP_TSLEN (8 + 3 * sizeof (uint32_t)) /* timestamp */
+#define ICMP_MASKLEN 12 /* address mask */
+#define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */
+#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8)
+ /* N.B.: must separately check that ip_hl >= 5 */
+
+/*
+ * Definition of type and code field values.
+ */
+#define ICMP_ECHOREPLY 0 /* echo reply */
+#define ICMP_UNREACH 3 /* dest unreachable, codes: */
+#define ICMP_UNREACH_NET 0 /* bad net */
+#define ICMP_UNREACH_HOST 1 /* bad host */
+#define ICMP_UNREACH_PROTOCOL 2 /* bad protocol */
+#define ICMP_UNREACH_PORT 3 /* bad port */
+#define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */
+#define ICMP_UNREACH_SRCFAIL 5 /* src route failed */
+#define ICMP_UNREACH_NET_UNKNOWN 6 /* unknown net */
+#define ICMP_UNREACH_HOST_UNKNOWN 7 /* unknown host */
+#define ICMP_UNREACH_ISOLATED 8 /* src host isolated */
+#define ICMP_UNREACH_NET_PROHIB 9 /* prohibited access */
+#define ICMP_UNREACH_HOST_PROHIB 10 /* ditto */
+#define ICMP_UNREACH_TOSNET 11 /* bad tos for net */
+#define ICMP_UNREACH_TOSHOST 12 /* bad tos for host */
+#define ICMP_UNREACH_FILTER_PROHIB 13 /* admin prohib */
+#define ICMP_UNREACH_HOST_PRECEDENCE 14 /* host prec vio. */
+#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 /* prec cutoff */
+#define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */
+#define ICMP_REDIRECT 5 /* shorter route, codes: */
+#define ICMP_REDIRECT_NET 0 /* for network */
+#define ICMP_REDIRECT_HOST 1 /* for host */
+#define ICMP_REDIRECT_TOSNET 2 /* for tos and net */
+#define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */
+#define ICMP_ALTHOSTADDR 6 /* alternate host address */
+#define ICMP_ECHO 8 /* echo service */
+#define ICMP_ROUTERADVERT 9 /* router advertisement */
+#define ICMP_ROUTERADVERT_NORMAL 0 /* normal advertisement */
+#define ICMP_ROUTERADVERT_NOROUTE_COMMON 16 /* selective routing */
+#define ICMP_ROUTERSOLICIT 10 /* router solicitation */
+#define ICMP_TIMXCEED 11 /* time exceeded, code: */
+#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */
+#define ICMP_TIMXCEED_REASS 1 /* ttl==0 in reass */
+#define ICMP_PARAMPROB 12 /* ip header bad */
+#define ICMP_PARAMPROB_ERRATPTR 0 /* error at param ptr */
+#define ICMP_PARAMPROB_OPTABSENT 1 /* req. opt. absent */
+#define ICMP_PARAMPROB_LENGTH 2 /* bad length */
+#define ICMP_TSTAMP 13 /* timestamp request */
+#define ICMP_TSTAMPREPLY 14 /* timestamp reply */
+#define ICMP_IREQ 15 /* information request */
+#define ICMP_IREQREPLY 16 /* information reply */
+#define ICMP_MASKREQ 17 /* address mask request */
+#define ICMP_MASKREPLY 18 /* address mask reply */
+#define ICMP_TRACEROUTE 30 /* traceroute */
+#define ICMP_DATACONVERR 31 /* data conversion error */
+#define ICMP_MOBILE_REDIRECT 32 /* mobile host redirect */
+#define ICMP_IPV6_WHEREAREYOU 33 /* IPv6 where-are-you */
+#define ICMP_IPV6_IAMHERE 34 /* IPv6 i-am-here */
+#define ICMP_MOBILE_REGREQUEST 35 /* mobile registration req */
+#define ICMP_MOBILE_REGREPLY 36 /* mobile registration reply */
+#define ICMP_SKIP 39 /* SKIP */
+#define ICMP_PHOTURIS 40 /* Photuris */
+#define ICMP_PHOTURIS_UNKNOWN_INDEX 1 /* unknown sec index */
+#define ICMP_PHOTURIS_AUTH_FAILED 2 /* auth failed */
+#define ICMP_PHOTURIS_DECRYPT_FAILED 3 /* decrypt failed */
+
+#define ICMP_MAXTYPE 40
+
+#define ICMP_INFOTYPE(type) \
+ ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
+ (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \
+ (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \
+ (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
+ (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
+
+#ifdef _KERNEL
+void icmp_error(struct mbuf *, int, int, uint32_t, int);
+void icmp_input(struct mbuf *, int);
+int ip_next_mtu(int, int);
+#endif
+
+#endif
diff --git a/freebsd/sys/netinet/ip_id.c b/freebsd/sys/netinet/ip_id.c
index ba99cdbb..21bb84cc 100644
--- a/freebsd/sys/netinet/ip_id.c
+++ b/freebsd/sys/netinet/ip_id.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
@@ -27,7 +27,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -76,20 +76,20 @@ __FBSDID("$FreeBSD$");
* enabled.
*/
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/libkern.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/random.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/sys/bitstring.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/malloc.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/kernel.h>
+#include <sys/libkern.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/random.h>
+#include <sys/systm.h>
+#include <sys/sysctl.h>
+#include <netinet/in.h>
+#include <netinet/ip_var.h>
+#include <sys/bitstring.h>
static MALLOC_DEFINE(M_IPID, "ipid", "randomized ip id state");
diff --git a/freebsd/sys/netinet/ip_input.c b/freebsd/sys/netinet/ip_input.c
index 3964e886..1b7f4319 100644
--- a/freebsd/sys/netinet/ip_input.c
+++ b/freebsd/sys/netinet/ip_input.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1988, 1993
@@ -31,58 +31,58 @@
* @(#)ip_input.c 8.2 (Berkeley) 1/4/94
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_bootp.h>
-#include <freebsd/local/opt_ipfw.h>
-#include <freebsd/local/opt_ipstealth.h>
-#include <freebsd/local/opt_ipsec.h>
-#include <freebsd/local/opt_route.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/pfil.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_var.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/vnet.h>
-#include <freebsd/net/flowtable.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_fw.h>
-#include <freebsd/netinet/ip_icmp.h>
-#include <freebsd/netinet/ip_options.h>
-#include <freebsd/machine/in_cksum.h>
-#include <freebsd/netinet/ip_carp.h>
+#include <rtems/bsd/local/opt_bootp.h>
+#include <rtems/bsd/local/opt_ipfw.h>
+#include <rtems/bsd/local/opt_ipstealth.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+#include <rtems/bsd/local/opt_route.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/callout.h>
+#include <sys/mbuf.h>
+#include <sys/malloc.h>
+#include <sys/domain.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/rwlock.h>
+#include <sys/syslog.h>
+#include <sys/sysctl.h>
+
+#include <net/pfil.h>
+#include <net/if.h>
+#include <net/if_types.h>
+#include <net/if_var.h>
+#include <net/if_dl.h>
+#include <net/route.h>
+#include <net/netisr.h>
+#include <net/vnet.h>
+#include <net/flowtable.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/ip.h>
+#include <netinet/in_pcb.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_fw.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/ip_options.h>
+#include <machine/in_cksum.h>
+#include <netinet/ip_carp.h>
#ifdef IPSEC
-#include <freebsd/netinet/ip_ipsec.h>
+#include <netinet/ip_ipsec.h>
#endif /* IPSEC */
-#include <freebsd/sys/socketvar.h>
+#include <sys/socketvar.h>
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
#ifdef CTASSERT
CTASSERT(sizeof(struct ip) == 20);
diff --git a/freebsd/sys/netinet/ip_ipsec.c b/freebsd/sys/netinet/ip_ipsec.c
index f19d5e0e..f83b2d93 100644
--- a/freebsd/sys/netinet/ip_ipsec.c
+++ b/freebsd/sys/netinet/ip_ipsec.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1988, 1993
@@ -29,45 +29,45 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_ipsec.h>
-#include <freebsd/local/opt_sctp.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+#include <rtems/bsd/local/opt_sctp.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sysctl.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
+#include <net/if.h>
+#include <net/route.h>
+#include <net/vnet.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_options.h>
-#include <freebsd/netinet/ip_ipsec.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/ip.h>
+#include <netinet/in_pcb.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_options.h>
+#include <netinet/ip_ipsec.h>
#ifdef SCTP
-#include <freebsd/netinet/sctp_crc32.h>
+#include <netinet/sctp_crc32.h>
#endif
-#include <freebsd/machine/in_cksum.h>
+#include <machine/in_cksum.h>
#ifdef IPSEC
-#include <freebsd/netipsec/ipsec.h>
-#include <freebsd/netipsec/xform.h>
-#include <freebsd/netipsec/key.h>
+#include <netipsec/ipsec.h>
+#include <netipsec/xform.h>
+#include <netipsec/key.h>
#endif /*IPSEC*/
extern struct protosw inetsw[];
diff --git a/freebsd/sys/netinet/ip_ipsec.h b/freebsd/sys/netinet/ip_ipsec.h
index c4de1652..31bc86a1 100644
--- a/freebsd/sys/netinet/ip_ipsec.h
+++ b/freebsd/sys/netinet/ip_ipsec.h
@@ -29,8 +29,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET_IP_IPSEC_HH_
-#define _NETINET_IP_IPSEC_HH_
+#ifndef _NETINET_IP_IPSEC_H_
+#define _NETINET_IP_IPSEC_H_
int ip_ipsec_filtertunnel(struct mbuf *);
int ip_ipsec_fwd(struct mbuf *);
diff --git a/freebsd/sys/netinet/ip_mroute.c b/freebsd/sys/netinet/ip_mroute.c
index 2f7676ad..022f2451 100644
--- a/freebsd/sys/netinet/ip_mroute.c
+++ b/freebsd/sys/netinet/ip_mroute.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1989 Stephen Deering
@@ -68,55 +68,55 @@
* TODO: Sync ip6_mroute.c with this file.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_mrouting.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_mrouting.h>
#define _PIM_VT 1
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/ktr.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/time.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/igmp.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_encap.h>
-#include <freebsd/netinet/ip_mroute.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_options.h>
-#include <freebsd/netinet/pim.h>
-#include <freebsd/netinet/pim_var.h>
-#include <freebsd/netinet/udp.h>
-
-#include <freebsd/machine/in_cksum.h>
-
-#include <freebsd/security/mac/mac_framework.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/ktr.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <sys/priv.h>
+#include <sys/protosw.h>
+#include <sys/signalvar.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sockio.h>
+#include <sys/sx.h>
+#include <sys/sysctl.h>
+#include <sys/syslog.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/time.h>
+
+#include <net/if.h>
+#include <net/netisr.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/igmp.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/ip.h>
+#include <netinet/ip_encap.h>
+#include <netinet/ip_mroute.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_options.h>
+#include <netinet/pim.h>
+#include <netinet/pim_var.h>
+#include <netinet/udp.h>
+
+#include <machine/in_cksum.h>
+
+#include <security/mac/mac_framework.h>
#ifndef KTR_IPMF
#define KTR_IPMF KTR_INET
diff --git a/freebsd/sys/netinet/ip_mroute.h b/freebsd/sys/netinet/ip_mroute.h
index 3bc7f52f..c54c75aa 100644
--- a/freebsd/sys/netinet/ip_mroute.h
+++ b/freebsd/sys/netinet/ip_mroute.h
@@ -34,8 +34,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET_IP_MROUTE_HH_
-#define _NETINET_IP_MROUTE_HH_
+#ifndef _NETINET_IP_MROUTE_H_
+#define _NETINET_IP_MROUTE_H_
/*
* Definitions for IP multicast forwarding.
@@ -356,4 +356,4 @@ extern int (*mrt_ioctl)(u_long, caddr_t, int);
#endif /* _KERNEL */
-#endif /* _NETINET_IP_MROUTE_HH_ */
+#endif /* _NETINET_IP_MROUTE_H_ */
diff --git a/freebsd/sys/netinet/ip_options.c b/freebsd/sys/netinet/ip_options.c
index f8b31607..8012fd3f 100644
--- a/freebsd/sys/netinet/ip_options.c
+++ b/freebsd/sys/netinet/ip_options.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* Copyright (c) 1982, 1986, 1988, 1993
@@ -31,43 +31,43 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_ipstealth.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_var.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_options.h>
-#include <freebsd/netinet/ip_icmp.h>
-#include <freebsd/machine/in_cksum.h>
-
-#include <freebsd/sys/socketvar.h>
-
-#include <freebsd/security/mac/mac_framework.h>
+#include <rtems/bsd/local/opt_ipstealth.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/domain.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/kernel.h>
+#include <sys/syslog.h>
+#include <sys/sysctl.h>
+
+#include <net/if.h>
+#include <net/if_types.h>
+#include <net/if_var.h>
+#include <net/if_dl.h>
+#include <net/route.h>
+#include <net/netisr.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/ip.h>
+#include <netinet/in_pcb.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_options.h>
+#include <netinet/ip_icmp.h>
+#include <machine/in_cksum.h>
+
+#include <sys/socketvar.h>
+
+#include <security/mac/mac_framework.h>
static int ip_dosourceroute = 0;
SYSCTL_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute, CTLFLAG_RW,
diff --git a/freebsd/sys/netinet/ip_options.h b/freebsd/sys/netinet/ip_options.h
index 9c08004d..7ba5ae64 100644
--- a/freebsd/sys/netinet/ip_options.h
+++ b/freebsd/sys/netinet/ip_options.h
@@ -31,8 +31,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET_IP_OPTIONS_HH_
-#define _NETINET_IP_OPTIONS_HH_
+#ifndef _NETINET_IP_OPTIONS_H_
+#define _NETINET_IP_OPTIONS_H_
struct ipoptrt {
struct in_addr dst; /* final destination */
@@ -57,4 +57,4 @@ int ip_pcbopts(struct inpcb *, int, struct mbuf *);
void ip_stripoptions(struct mbuf *, struct mbuf *);
struct mbuf *ip_srcroute(struct mbuf *);
-#endif /* !_NETINET_IP_OPTIONS_HH_ */
+#endif /* !_NETINET_IP_OPTIONS_H_ */
diff --git a/freebsd/sys/netinet/ip_output.c b/freebsd/sys/netinet/ip_output.c
index 51132333..c01e0d32 100644
--- a/freebsd/sys/netinet/ip_output.c
+++ b/freebsd/sys/netinet/ip_output.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1988, 1990, 1993
@@ -31,60 +31,60 @@
* @(#)ip_output.c 8.3 (Berkeley) 1/21/94
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_ipfw.h>
-#include <freebsd/local/opt_ipsec.h>
-#include <freebsd/local/opt_route.h>
-#include <freebsd/local/opt_mbuf_stress_test.h>
-#include <freebsd/local/opt_mpath.h>
-#include <freebsd/local/opt_sctp.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/ucred.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_llatbl.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/pfil.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/flowtable.h>
+#include <rtems/bsd/local/opt_ipfw.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+#include <rtems/bsd/local/opt_route.h>
+#include <rtems/bsd/local/opt_mbuf_stress_test.h>
+#include <rtems/bsd/local/opt_mpath.h>
+#include <rtems/bsd/local/opt_sctp.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sysctl.h>
+#include <sys/ucred.h>
+
+#include <net/if.h>
+#include <net/if_llatbl.h>
+#include <net/netisr.h>
+#include <net/pfil.h>
+#include <net/route.h>
+#include <net/flowtable.h>
#ifdef RADIX_MPATH
-#include <freebsd/net/radix_mpath.h>
+#include <net/radix_mpath.h>
#endif
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_options.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/in_pcb.h>
+#include <netinet/in_var.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_options.h>
#ifdef SCTP
-#include <freebsd/netinet/sctp.h>
-#include <freebsd/netinet/sctp_crc32.h>
+#include <netinet/sctp.h>
+#include <netinet/sctp_crc32.h>
#endif
#ifdef IPSEC
-#include <freebsd/netinet/ip_ipsec.h>
-#include <freebsd/netipsec/ipsec.h>
+#include <netinet/ip_ipsec.h>
+#include <netipsec/ipsec.h>
#endif /* IPSEC*/
-#include <freebsd/machine/in_cksum.h>
+#include <machine/in_cksum.h>
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
#define print_ip(x, a, y) printf("%s %d.%d.%d.%d%s",\
x, (ntohl(a.s_addr)>>24)&0xFF,\
diff --git a/freebsd/sys/netinet/ip_var.h b/freebsd/sys/netinet/ip_var.h
index 2902174d..222b7efe 100644
--- a/freebsd/sys/netinet/ip_var.h
+++ b/freebsd/sys/netinet/ip_var.h
@@ -30,10 +30,10 @@
* $FreeBSD$
*/
-#ifndef _NETINET_IP_VAR_HH_
-#define _NETINET_IP_VAR_HH_
+#ifndef _NETINET_IP_VAR_H_
+#define _NETINET_IP_VAR_H_
-#include <freebsd/sys/queue.h>
+#include <sys/queue.h>
/*
* Overlay for ip header used by other protocols (tcp, udp).
@@ -129,7 +129,7 @@ struct ipstat {
#ifdef _KERNEL
-#include <freebsd/net/vnet.h>
+#include <net/vnet.h>
/*
* In-kernel consumers can use these accessor macros directly to update
@@ -312,4 +312,4 @@ VNET_DECLARE(int, ip_do_randomid);
#endif /* _KERNEL */
-#endif /* !_NETINET_IP_VAR_HH_ */
+#endif /* !_NETINET_IP_VAR_H_ */
diff --git a/freebsd/sys/netinet/ipfw/dn_heap.c b/freebsd/sys/netinet/ipfw/dn_heap.c
index 1e6133bc..3af37a86 100644
--- a/freebsd/sys/netinet/ipfw/dn_heap.c
+++ b/freebsd/sys/netinet/ipfw/dn_heap.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1998-2002,2010 Luigi Rizzo, Universita` di Pisa
@@ -32,24 +32,24 @@
* $FreeBSD$
*/
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/param.h>
+#include <sys/cdefs.h>
+#include <rtems/bsd/sys/param.h>
#ifdef _KERNEL
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/netinet/ipfw/dn_heap.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+#include <netinet/ipfw/dn_heap.h>
#ifndef log
#define log(x, arg...)
#endif
#else /* !_KERNEL */
-#include <freebsd/stdio.h>
-#include <freebsd/dn_test.h>
-#include <freebsd/strings.h>
-#include <freebsd/stdlib.h>
+#include <stdio.h>
+#include <dn_test.h>
+#include <strings.h>
+#include <stdlib.h>
#include "dn_heap.h"
#define log(x, arg...) fprintf(stderr, ## arg)
diff --git a/freebsd/sys/netinet/ipfw/dn_sched_fifo.c b/freebsd/sys/netinet/ipfw/dn_sched_fifo.c
index 6d5a4a12..3bd5e127 100644
--- a/freebsd/sys/netinet/ipfw/dn_sched_fifo.c
+++ b/freebsd/sys/netinet/ipfw/dn_sched_fifo.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* Copyright (c) 2010 Riccardo Panicucci, Universita` di Pisa
@@ -31,22 +31,22 @@
*/
#ifdef _KERNEL
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/net/if.h> /* IFNAMSIZ */
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip_var.h> /* ipfw_rule_ref */
-#include <freebsd/netinet/ip_fw.h> /* flow_id */
-#include <freebsd/netinet/ip_dummynet.h>
-#include <freebsd/netinet/ipfw/dn_heap.h>
-#include <freebsd/netinet/ipfw/ip_dn_private.h>
-#include <freebsd/netinet/ipfw/dn_sched.h>
+#include <sys/malloc.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/kernel.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <net/if.h> /* IFNAMSIZ */
+#include <netinet/in.h>
+#include <netinet/ip_var.h> /* ipfw_rule_ref */
+#include <netinet/ip_fw.h> /* flow_id */
+#include <netinet/ip_dummynet.h>
+#include <netinet/ipfw/dn_heap.h>
+#include <netinet/ipfw/ip_dn_private.h>
+#include <netinet/ipfw/dn_sched.h>
#else
-#include <freebsd/dn_test.h>
+#include <dn_test.h>
#endif
/*
diff --git a/freebsd/sys/netinet/ipfw/dn_sched_prio.c b/freebsd/sys/netinet/ipfw/dn_sched_prio.c
index c6b6027c..b3cb689c 100644
--- a/freebsd/sys/netinet/ipfw/dn_sched_prio.c
+++ b/freebsd/sys/netinet/ipfw/dn_sched_prio.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* Copyright (c) 2010 Riccardo Panicucci, Universita` di Pisa
@@ -30,22 +30,22 @@
* $FreeBSD$
*/
#ifdef _KERNEL
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/net/if.h> /* IFNAMSIZ */
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip_var.h> /* ipfw_rule_ref */
-#include <freebsd/netinet/ip_fw.h> /* flow_id */
-#include <freebsd/netinet/ip_dummynet.h>
-#include <freebsd/netinet/ipfw/dn_heap.h>
-#include <freebsd/netinet/ipfw/ip_dn_private.h>
-#include <freebsd/netinet/ipfw/dn_sched.h>
+#include <sys/malloc.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/kernel.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <net/if.h> /* IFNAMSIZ */
+#include <netinet/in.h>
+#include <netinet/ip_var.h> /* ipfw_rule_ref */
+#include <netinet/ip_fw.h> /* flow_id */
+#include <netinet/ip_dummynet.h>
+#include <netinet/ipfw/dn_heap.h>
+#include <netinet/ipfw/ip_dn_private.h>
+#include <netinet/ipfw/dn_sched.h>
#else
-#include <freebsd/dn_test.h>
+#include <dn_test.h>
#endif
#define DN_SCHED_PRIO 5 //XXX
diff --git a/freebsd/sys/netinet/ipfw/dn_sched_qfq.c b/freebsd/sys/netinet/ipfw/dn_sched_qfq.c
index 23890199..c8fc4886 100644
--- a/freebsd/sys/netinet/ipfw/dn_sched_qfq.c
+++ b/freebsd/sys/netinet/ipfw/dn_sched_qfq.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* Copyright (c) 2010 Fabio Checconi, Luigi Rizzo, Paolo Valente
@@ -31,22 +31,22 @@
*/
#ifdef _KERNEL
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/net/if.h> /* IFNAMSIZ */
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip_var.h> /* ipfw_rule_ref */
-#include <freebsd/netinet/ip_fw.h> /* flow_id */
-#include <freebsd/netinet/ip_dummynet.h>
-#include <freebsd/netinet/ipfw/dn_heap.h>
-#include <freebsd/netinet/ipfw/ip_dn_private.h>
-#include <freebsd/netinet/ipfw/dn_sched.h>
+#include <sys/malloc.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/kernel.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <net/if.h> /* IFNAMSIZ */
+#include <netinet/in.h>
+#include <netinet/ip_var.h> /* ipfw_rule_ref */
+#include <netinet/ip_fw.h> /* flow_id */
+#include <netinet/ip_dummynet.h>
+#include <netinet/ipfw/dn_heap.h>
+#include <netinet/ipfw/ip_dn_private.h>
+#include <netinet/ipfw/dn_sched.h>
#else
-#include <freebsd/dn_test.h>
+#include <dn_test.h>
#endif
#ifdef QFQ_DEBUG
diff --git a/freebsd/sys/netinet/ipfw/dn_sched_rr.c b/freebsd/sys/netinet/ipfw/dn_sched_rr.c
index 4aa833f6..ccfd855c 100644
--- a/freebsd/sys/netinet/ipfw/dn_sched_rr.c
+++ b/freebsd/sys/netinet/ipfw/dn_sched_rr.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* Copyright (c) 2010 Riccardo Panicucci, Universita` di Pisa
@@ -31,22 +31,22 @@
*/
#ifdef _KERNEL
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/net/if.h> /* IFNAMSIZ */
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip_var.h> /* ipfw_rule_ref */
-#include <freebsd/netinet/ip_fw.h> /* flow_id */
-#include <freebsd/netinet/ip_dummynet.h>
-#include <freebsd/netinet/ipfw/dn_heap.h>
-#include <freebsd/netinet/ipfw/ip_dn_private.h>
-#include <freebsd/netinet/ipfw/dn_sched.h>
+#include <sys/malloc.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/kernel.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <net/if.h> /* IFNAMSIZ */
+#include <netinet/in.h>
+#include <netinet/ip_var.h> /* ipfw_rule_ref */
+#include <netinet/ip_fw.h> /* flow_id */
+#include <netinet/ip_dummynet.h>
+#include <netinet/ipfw/dn_heap.h>
+#include <netinet/ipfw/ip_dn_private.h>
+#include <netinet/ipfw/dn_sched.h>
#else
-#include <freebsd/dn_test.h>
+#include <dn_test.h>
#endif
#define DN_SCHED_RR 3 // XXX Where?
diff --git a/freebsd/sys/netinet/ipfw/dn_sched_wf2q.c b/freebsd/sys/netinet/ipfw/dn_sched_wf2q.c
index c1e4c21d..330f78e2 100644
--- a/freebsd/sys/netinet/ipfw/dn_sched_wf2q.c
+++ b/freebsd/sys/netinet/ipfw/dn_sched_wf2q.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* Copyright (c) 2010 Riccardo Panicucci, Universita` di Pisa
@@ -32,22 +32,22 @@
*/
#ifdef _KERNEL
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/net/if.h> /* IFNAMSIZ */
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip_var.h> /* ipfw_rule_ref */
-#include <freebsd/netinet/ip_fw.h> /* flow_id */
-#include <freebsd/netinet/ip_dummynet.h>
-#include <freebsd/netinet/ipfw/dn_heap.h>
-#include <freebsd/netinet/ipfw/ip_dn_private.h>
-#include <freebsd/netinet/ipfw/dn_sched.h>
+#include <sys/malloc.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/kernel.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <net/if.h> /* IFNAMSIZ */
+#include <netinet/in.h>
+#include <netinet/ip_var.h> /* ipfw_rule_ref */
+#include <netinet/ip_fw.h> /* flow_id */
+#include <netinet/ip_dummynet.h>
+#include <netinet/ipfw/dn_heap.h>
+#include <netinet/ipfw/ip_dn_private.h>
+#include <netinet/ipfw/dn_sched.h>
#else
-#include <freebsd/dn_test.h>
+#include <dn_test.h>
#endif
#ifndef MAX64
diff --git a/freebsd/sys/netinet/ipfw/ip_dn_glue.c b/freebsd/sys/netinet/ipfw/ip_dn_glue.c
index 302c4d29..8c8c3ef8 100644
--- a/freebsd/sys/netinet/ipfw/ip_dn_glue.c
+++ b/freebsd/sys/netinet/ipfw/ip_dn_glue.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2010 Riccardo Panicucci, Universita` di Pisa
@@ -32,31 +32,31 @@
* Binary compatibility support for /sbin/ipfw RELENG_7 and RELENG_8
*/
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/taskqueue.h>
-#include <freebsd/net/if.h> /* IFNAMSIZ, struct ifaddr, ifq head, lock.h mutex.h */
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip_var.h> /* ip_output(), IP_FORWARDING */
-#include <freebsd/netinet/ip_fw.h>
-#include <freebsd/netinet/ipfw/ip_fw_private.h>
-#include <freebsd/netinet/ipfw/dn_heap.h>
-#include <freebsd/netinet/ip_dummynet.h>
-#include <freebsd/netinet/ipfw/ip_dn_private.h>
-#include <freebsd/netinet/ipfw/dn_sched.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/module.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/rwlock.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/taskqueue.h>
+#include <net/if.h> /* IFNAMSIZ, struct ifaddr, ifq head, lock.h mutex.h */
+#include <netinet/in.h>
+#include <netinet/ip_var.h> /* ip_output(), IP_FORWARDING */
+#include <netinet/ip_fw.h>
+#include <netinet/ipfw/ip_fw_private.h>
+#include <netinet/ipfw/dn_heap.h>
+#include <netinet/ip_dummynet.h>
+#include <netinet/ipfw/ip_dn_private.h>
+#include <netinet/ipfw/dn_sched.h>
/* FREEBSD7.2 ip_dummynet.h r191715*/
diff --git a/freebsd/sys/netinet/ipfw/ip_dn_io.c b/freebsd/sys/netinet/ipfw/ip_dn_io.c
index 7a2c46d4..72f0c354 100644
--- a/freebsd/sys/netinet/ipfw/ip_dn_io.c
+++ b/freebsd/sys/netinet/ipfw/ip_dn_io.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2010 Luigi Rizzo, Riccardo Panicucci, Universita` di Pisa
@@ -29,40 +29,40 @@
/*
* Dummynet portions related to packet handling.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/net/if.h> /* IFNAMSIZ, struct ifaddr, ifq head, lock.h mutex.h */
-#include <freebsd/net/netisr.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip.h> /* ip_len, ip_off */
-#include <freebsd/netinet/ip_var.h> /* ip_output(), IP_FORWARDING */
-#include <freebsd/netinet/ip_fw.h>
-#include <freebsd/netinet/ipfw/ip_fw_private.h>
-#include <freebsd/netinet/ipfw/dn_heap.h>
-#include <freebsd/netinet/ip_dummynet.h>
-#include <freebsd/netinet/ipfw/ip_dn_private.h>
-#include <freebsd/netinet/ipfw/dn_sched.h>
-
-#include <freebsd/netinet/if_ether.h> /* various ether_* routines */
-
-#include <freebsd/netinet/ip6.h> /* for ip6_input, ip6_output prototypes */
-#include <freebsd/netinet6/ip6_var.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/module.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/rwlock.h>
+#include <sys/socket.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/sysctl.h>
+#include <net/if.h> /* IFNAMSIZ, struct ifaddr, ifq head, lock.h mutex.h */
+#include <net/netisr.h>
+#include <netinet/in.h>
+#include <netinet/ip.h> /* ip_len, ip_off */
+#include <netinet/ip_var.h> /* ip_output(), IP_FORWARDING */
+#include <netinet/ip_fw.h>
+#include <netinet/ipfw/ip_fw_private.h>
+#include <netinet/ipfw/dn_heap.h>
+#include <netinet/ip_dummynet.h>
+#include <netinet/ipfw/ip_dn_private.h>
+#include <netinet/ipfw/dn_sched.h>
+
+#include <netinet/if_ether.h> /* various ether_* routines */
+
+#include <netinet/ip6.h> /* for ip6_input, ip6_output prototypes */
+#include <netinet6/ip6_var.h>
/*
* We keep a private variable for the simulation time, but we could
diff --git a/freebsd/sys/netinet/ipfw/ip_dummynet.c b/freebsd/sys/netinet/ipfw/ip_dummynet.c
index dca39d06..5d51c30b 100644
--- a/freebsd/sys/netinet/ipfw/ip_dummynet.c
+++ b/freebsd/sys/netinet/ipfw/ip_dummynet.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1998-2002,2010 Luigi Rizzo, Universita` di Pisa
@@ -27,38 +27,38 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* Configuration and internal object management for dummynet.
*/
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/taskqueue.h>
-#include <freebsd/net/if.h> /* IFNAMSIZ, struct ifaddr, ifq head, lock.h mutex.h */
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip_var.h> /* ip_output(), IP_FORWARDING */
-#include <freebsd/netinet/ip_fw.h>
-#include <freebsd/netinet/ipfw/ip_fw_private.h>
-#include <freebsd/netinet/ipfw/dn_heap.h>
-#include <freebsd/netinet/ip_dummynet.h>
-#include <freebsd/netinet/ipfw/ip_dn_private.h>
-#include <freebsd/netinet/ipfw/dn_sched.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/module.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/rwlock.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/taskqueue.h>
+#include <net/if.h> /* IFNAMSIZ, struct ifaddr, ifq head, lock.h mutex.h */
+#include <netinet/in.h>
+#include <netinet/ip_var.h> /* ip_output(), IP_FORWARDING */
+#include <netinet/ip_fw.h>
+#include <netinet/ipfw/ip_fw_private.h>
+#include <netinet/ipfw/dn_heap.h>
+#include <netinet/ip_dummynet.h>
+#include <netinet/ipfw/ip_dn_private.h>
+#include <netinet/ipfw/dn_sched.h>
/* which objects to copy */
#define DN_C_LINK 0x01
diff --git a/freebsd/sys/netinet/ipfw/ip_fw2.c b/freebsd/sys/netinet/ipfw/ip_fw2.c
index 682cced1..dd0c2fea 100644
--- a/freebsd/sys/netinet/ipfw/ip_fw2.c
+++ b/freebsd/sys/netinet/ipfw/ip_fw2.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2002-2009 Luigi Rizzo, Universita` di Pisa
@@ -25,7 +25,7 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -33,67 +33,67 @@ __FBSDID("$FreeBSD$");
*/
#if !defined(KLD_MODULE)
-#include <freebsd/local/opt_ipfw.h>
-#include <freebsd/local/opt_ipdivert.h>
-#include <freebsd/local/opt_ipdn.h>
-#include <freebsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_ipfw.h>
+#include <rtems/bsd/local/opt_ipdivert.h>
+#include <rtems/bsd/local/opt_ipdn.h>
+#include <rtems/bsd/local/opt_inet.h>
#ifndef INET
#error IPFIREWALL requires INET.
#endif /* INET */
#endif
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipsec.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/eventhandler.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/ucred.h>
-#include <freebsd/net/ethernet.h> /* for ETHERTYPE_IP */
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/pf_mtag.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_icmp.h>
-#include <freebsd/netinet/ip_fw.h>
-#include <freebsd/netinet/ipfw/ip_fw_private.h>
-#include <freebsd/netinet/ip_carp.h>
-#include <freebsd/netinet/pim.h>
-#include <freebsd/netinet/tcp_var.h>
-#include <freebsd/netinet/udp.h>
-#include <freebsd/netinet/udp_var.h>
-#include <freebsd/netinet/sctp.h>
-
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet/icmp6.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/condvar.h>
+#include <sys/eventhandler.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/jail.h>
+#include <sys/module.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/rwlock.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sysctl.h>
+#include <sys/syslog.h>
+#include <sys/ucred.h>
+#include <net/ethernet.h> /* for ETHERTYPE_IP */
+#include <net/if.h>
+#include <net/route.h>
+#include <net/pf_mtag.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/in_pcb.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/ip_fw.h>
+#include <netinet/ipfw/ip_fw_private.h>
+#include <netinet/ip_carp.h>
+#include <netinet/pim.h>
+#include <netinet/tcp_var.h>
+#include <netinet/udp.h>
+#include <netinet/udp_var.h>
+#include <netinet/sctp.h>
+
+#include <netinet/ip6.h>
+#include <netinet/icmp6.h>
#ifdef INET6
-#include <freebsd/netinet6/scope6_var.h>
-#include <freebsd/netinet6/ip6_var.h>
+#include <netinet6/scope6_var.h>
+#include <netinet6/ip6_var.h>
#endif
-#include <freebsd/machine/in_cksum.h> /* XXX for in_cksum */
+#include <machine/in_cksum.h> /* XXX for in_cksum */
#ifdef MAC
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
#endif
/*
diff --git a/freebsd/sys/netinet/ipfw/ip_fw_log.c b/freebsd/sys/netinet/ipfw/ip_fw_log.c
index 0a5cd94c..b529b9e1 100644
--- a/freebsd/sys/netinet/ipfw/ip_fw_log.c
+++ b/freebsd/sys/netinet/ipfw/ip_fw_log.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2002-2009 Luigi Rizzo, Universita` di Pisa
@@ -25,7 +25,7 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -33,47 +33,47 @@ __FBSDID("$FreeBSD$");
*/
#if !defined(KLD_MODULE)
-#include <freebsd/local/opt_ipfw.h>
-#include <freebsd/local/opt_ipdivert.h>
-#include <freebsd/local/opt_ipdn.h>
-#include <freebsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_ipfw.h>
+#include <rtems/bsd/local/opt_ipdivert.h>
+#include <rtems/bsd/local/opt_ipdn.h>
+#include <rtems/bsd/local/opt_inet.h>
#ifndef INET
#error IPFIREWALL requires INET.
#endif /* INET */
#endif
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipsec.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/net/ethernet.h> /* for ETHERTYPE_IP */
-#include <freebsd/net/if.h>
-#include <freebsd/net/vnet.h>
-#include <freebsd/net/if_types.h> /* for IFT_ETHER */
-#include <freebsd/net/bpf.h> /* for BPF */
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_icmp.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_fw.h>
-#include <freebsd/netinet/ipfw/ip_fw_private.h>
-#include <freebsd/netinet/tcp_var.h>
-#include <freebsd/netinet/udp.h>
-
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet/icmp6.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/kernel.h>
+#include <sys/socket.h>
+#include <sys/sysctl.h>
+#include <sys/syslog.h>
+#include <net/ethernet.h> /* for ETHERTYPE_IP */
+#include <net/if.h>
+#include <net/vnet.h>
+#include <net/if_types.h> /* for IFT_ETHER */
+#include <net/bpf.h> /* for BPF */
+
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_fw.h>
+#include <netinet/ipfw/ip_fw_private.h>
+#include <netinet/tcp_var.h>
+#include <netinet/udp.h>
+
+#include <netinet/ip6.h>
+#include <netinet/icmp6.h>
#ifdef INET6
-#include <freebsd/netinet6/in6_var.h> /* ip6_sprintf() */
+#include <netinet6/in6_var.h> /* ip6_sprintf() */
#endif
#ifdef MAC
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
#endif
/*
diff --git a/freebsd/sys/netinet/ipfw/ip_fw_nat.c b/freebsd/sys/netinet/ipfw/ip_fw_nat.c
index e6c8bcec..dd47dedc 100644
--- a/freebsd/sys/netinet/ipfw/ip_fw_nat.c
+++ b/freebsd/sys/netinet/ipfw/ip_fw_nat.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2008 Paolo Pisati
@@ -26,33 +26,33 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/eventhandler.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/rwlock.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/eventhandler.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/module.h>
+#include <sys/rwlock.h>
#define IPFW_INTERNAL /* Access to protected data structures in ip_fw.h. */
-#include <freebsd/netinet/libalias/alias.h>
-#include <freebsd/netinet/libalias/alias_local.h>
+#include <netinet/libalias/alias.h>
+#include <netinet/libalias/alias_local.h>
-#include <freebsd/net/if.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_fw.h>
-#include <freebsd/netinet/ipfw/ip_fw_private.h>
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/udp.h>
+#include <net/if.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_fw.h>
+#include <netinet/ipfw/ip_fw_private.h>
+#include <netinet/tcp.h>
+#include <netinet/udp.h>
-#include <freebsd/machine/in_cksum.h> /* XXX for in_cksum */
+#include <machine/in_cksum.h> /* XXX for in_cksum */
static VNET_DEFINE(eventhandler_tag, ifaddr_event_tag);
#define V_ifaddr_event_tag VNET(ifaddr_event_tag)
diff --git a/freebsd/sys/netinet/ipfw/ip_fw_pfil.c b/freebsd/sys/netinet/ipfw/ip_fw_pfil.c
index 8759f409..b32a08b7 100644
--- a/freebsd/sys/netinet/ipfw/ip_fw_pfil.c
+++ b/freebsd/sys/netinet/ipfw/ip_fw_pfil.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2004 Andre Oppermann, Internet Business Solutions AG
@@ -26,44 +26,44 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#if !defined(KLD_MODULE)
-#include <freebsd/local/opt_ipfw.h>
-#include <freebsd/local/opt_ipdn.h>
-#include <freebsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_ipfw.h>
+#include <rtems/bsd/local/opt_ipdn.h>
+#include <rtems/bsd/local/opt_inet.h>
#ifndef INET
#error IPFIREWALL requires INET.
#endif /* INET */
#endif /* KLD_MODULE */
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/pfil.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_fw.h>
-#include <freebsd/netinet/ipfw/ip_fw_private.h>
-#include <freebsd/netgraph/ng_ipfw.h>
-
-#include <freebsd/machine/in_cksum.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/rwlock.h>
+#include <sys/socket.h>
+#include <sys/sysctl.h>
+
+#include <net/if.h>
+#include <net/route.h>
+#include <net/pfil.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_fw.h>
+#include <netinet/ipfw/ip_fw_private.h>
+#include <netgraph/ng_ipfw.h>
+
+#include <machine/in_cksum.h>
static VNET_DEFINE(int, fw_enable) = 1;
#define V_fw_enable VNET(fw_enable)
diff --git a/freebsd/sys/netinet/ipfw/ip_fw_sockopt.c b/freebsd/sys/netinet/ipfw/ip_fw_sockopt.c
index 6af09905..b9635416 100644
--- a/freebsd/sys/netinet/ipfw/ip_fw_sockopt.c
+++ b/freebsd/sys/netinet/ipfw/ip_fw_sockopt.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2002-2009 Luigi Rizzo, Universita` di Pisa
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -36,41 +36,41 @@ __FBSDID("$FreeBSD$");
*/
#if !defined(KLD_MODULE)
-#include <freebsd/local/opt_ipfw.h>
-#include <freebsd/local/opt_ipdivert.h>
-#include <freebsd/local/opt_ipdn.h>
-#include <freebsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_ipfw.h>
+#include <rtems/bsd/local/opt_ipdivert.h>
+#include <rtems/bsd/local/opt_ipdn.h>
+#include <rtems/bsd/local/opt_inet.h>
#ifndef INET
#error IPFIREWALL requires INET.
#endif /* INET */
#endif
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipsec.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h> /* struct m_tag used by nested headers */
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip_var.h> /* hooks */
-#include <freebsd/netinet/ip_fw.h>
-#include <freebsd/netinet/ipfw/ip_fw_private.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h> /* struct m_tag used by nested headers */
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/rwlock.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sysctl.h>
+#include <sys/syslog.h>
+#include <net/if.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/ip_var.h> /* hooks */
+#include <netinet/ip_fw.h>
+#include <netinet/ipfw/ip_fw_private.h>
#ifdef MAC
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
#endif
MALLOC_DEFINE(M_IPFW, "IpFw/IpAcct", "IpFw/IpAcct chain's");
diff --git a/freebsd/sys/netinet/ipfw/ip_fw_table.c b/freebsd/sys/netinet/ipfw/ip_fw_table.c
index 39a1dfcc..a399a7a0 100644
--- a/freebsd/sys/netinet/ipfw/ip_fw_table.c
+++ b/freebsd/sys/netinet/ipfw/ip_fw_table.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2004 Ruslan Ermilov and Vsevolod Lobko.
@@ -25,7 +25,7 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -42,37 +42,37 @@ __FBSDID("$FreeBSD$");
*/
#if !defined(KLD_MODULE)
-#include <freebsd/local/opt_ipfw.h>
-#include <freebsd/local/opt_ipdivert.h>
-#include <freebsd/local/opt_ipdn.h>
-#include <freebsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_ipfw.h>
+#include <rtems/bsd/local/opt_ipdivert.h>
+#include <rtems/bsd/local/opt_ipdn.h>
+#include <rtems/bsd/local/opt_inet.h>
#ifndef INET
#error IPFIREWALL requires INET.
#endif /* INET */
#endif
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipsec.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/net/if.h> /* ip_fw.h requires IFNAMSIZ */
-#include <freebsd/net/radix.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip_var.h> /* struct ipfw_rule_ref */
-#include <freebsd/netinet/ip_fw.h>
-#include <freebsd/sys/queue.h> /* LIST_HEAD */
-#include <freebsd/netinet/ipfw/ip_fw_private.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/rwlock.h>
+#include <sys/socket.h>
+#include <net/if.h> /* ip_fw.h requires IFNAMSIZ */
+#include <net/radix.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/ip_var.h> /* struct ipfw_rule_ref */
+#include <netinet/ip_fw.h>
+#include <sys/queue.h> /* LIST_HEAD */
+#include <netinet/ipfw/ip_fw_private.h>
#ifdef MAC
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
#endif
MALLOC_DEFINE(M_IPFW_TBL, "ipfw_tbl", "IpFw tables");
diff --git a/freebsd/sys/netinet/libalias/alias.c b/freebsd/sys/netinet/libalias/alias.c
index e5c5138d..9a8d29bd 100644
--- a/freebsd/sys/netinet/libalias/alias.c
+++ b/freebsd/sys/netinet/libalias/alias.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001 Charles Mott <cm@linktel.net>
@@ -26,7 +26,7 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -114,36 +114,36 @@ __FBSDID("$FreeBSD$");
*/
#ifdef _KERNEL
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/sysctl.h>
#else
-#include <freebsd/sys/types.h>
-#include <freebsd/stdlib.h>
-#include <freebsd/stdio.h>
-#include <freebsd/ctype.h>
-#include <freebsd/dlfcn.h>
-#include <freebsd/errno.h>
-#include <freebsd/string.h>
+#include <rtems/bsd/sys/types.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <dlfcn.h>
+#include <errno.h>
+#include <string.h>
#endif
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_icmp.h>
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/udp.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/tcp.h>
+#include <netinet/udp.h>
#ifdef _KERNEL
-#include <freebsd/netinet/libalias/alias.h>
-#include <freebsd/netinet/libalias/alias_local.h>
-#include <freebsd/netinet/libalias/alias_mod.h>
+#include <netinet/libalias/alias.h>
+#include <netinet/libalias/alias_local.h>
+#include <netinet/libalias/alias_mod.h>
#else
-#include <freebsd/err.h>
-#include <freebsd/local/alias.h>
-#include <freebsd/local/alias_local.h>
-#include <freebsd/local/alias_mod.h>
+#include <err.h>
+#include <rtems/bsd/local/alias.h>
+#include <rtems/bsd/local/alias_local.h>
+#include <rtems/bsd/local/alias_mod.h>
#endif
/*
diff --git a/freebsd/sys/netinet/libalias/alias.h b/freebsd/sys/netinet/libalias/alias.h
index f835e1b7..2aed8293 100644
--- a/freebsd/sys/netinet/libalias/alias.h
+++ b/freebsd/sys/netinet/libalias/alias.h
@@ -36,12 +36,12 @@
* distribution.
*/
-#ifndef _ALIAS_HH_
-#define _ALIAS_HH_
+#ifndef _ALIAS_H_
+#define _ALIAS_H_
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
#define LIBALIAS_BUF_SIZE 128
#ifdef _KERNEL
@@ -227,6 +227,6 @@ struct mbuf *m_megapullup(struct mbuf *, int);
#define PKT_ALIAS_UNRESOLVED_FRAGMENT 3
#define PKT_ALIAS_FOUND_HEADER_FRAGMENT 4
-#endif /* !_ALIAS_HH_ */
+#endif /* !_ALIAS_H_ */
/* lint -restore */
diff --git a/freebsd/sys/netinet/libalias/alias_cuseeme.c b/freebsd/sys/netinet/libalias/alias_cuseeme.c
index 90f2aaae..0e04c3f4 100644
--- a/freebsd/sys/netinet/libalias/alias_cuseeme.c
+++ b/freebsd/sys/netinet/libalias/alias_cuseeme.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1998 Brian Somers <brian@Awfulhak.org>
@@ -28,31 +28,31 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifdef _KERNEL
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
#else
-#include <freebsd/errno.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/stdio.h>
+#include <errno.h>
+#include <rtems/bsd/sys/types.h>
+#include <stdio.h>
#endif
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/udp.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <netinet/udp.h>
#ifdef _KERNEL
-#include <freebsd/netinet/libalias/alias.h>
-#include <freebsd/netinet/libalias/alias_local.h>
-#include <freebsd/netinet/libalias/alias_mod.h>
+#include <netinet/libalias/alias.h>
+#include <netinet/libalias/alias_local.h>
+#include <netinet/libalias/alias_mod.h>
#else
-#include <freebsd/local/alias_local.h>
-#include <freebsd/local/alias_mod.h>
+#include <rtems/bsd/local/alias_local.h>
+#include <rtems/bsd/local/alias_mod.h>
#endif
#define CUSEEME_PORT_NUMBER 7648
diff --git a/freebsd/sys/netinet/libalias/alias_db.c b/freebsd/sys/netinet/libalias/alias_db.c
index 4b003366..35b1846b 100644
--- a/freebsd/sys/netinet/libalias/alias_db.c
+++ b/freebsd/sys/netinet/libalias/alias_db.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001 Charles Mott <cm@linktel.net>
@@ -26,7 +26,7 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -145,34 +145,34 @@ __FBSDID("$FreeBSD$");
*/
#ifdef _KERNEL
-#include <freebsd/machine/stdarg.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/syslog.h>
+#include <machine/stdarg.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/module.h>
+#include <sys/rwlock.h>
+#include <sys/syslog.h>
#else
-#include <freebsd/stdarg.h>
-#include <freebsd/stdlib.h>
-#include <freebsd/stdio.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/unistd.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <rtems/bsd/sys/errno.h>
+#include <rtems/bsd/sys/time.h>
+#include <unistd.h>
#endif
-#include <freebsd/sys/socket.h>
-#include <freebsd/netinet/tcp.h>
+#include <sys/socket.h>
+#include <netinet/tcp.h>
#ifdef _KERNEL
-#include <freebsd/netinet/libalias/alias.h>
-#include <freebsd/netinet/libalias/alias_local.h>
-#include <freebsd/netinet/libalias/alias_mod.h>
-#include <freebsd/net/if.h>
+#include <netinet/libalias/alias.h>
+#include <netinet/libalias/alias_local.h>
+#include <netinet/libalias/alias_mod.h>
+#include <net/if.h>
#else
-#include <freebsd/local/alias.h>
-#include <freebsd/local/alias_local.h>
-#include <freebsd/local/alias_mod.h>
+#include <rtems/bsd/local/alias.h>
+#include <rtems/bsd/local/alias_local.h>
+#include <rtems/bsd/local/alias_mod.h>
#endif
static LIST_HEAD(, libalias) instancehead = LIST_HEAD_INITIALIZER(instancehead);
@@ -2646,10 +2646,10 @@ LibAliasCheckNewLink(struct libalias *la)
****************/
/* Firewall include files */
-#include <freebsd/net/if.h>
-#include <freebsd/netinet/ip_fw.h>
-#include <freebsd/string.h>
-#include <freebsd/err.h>
+#include <net/if.h>
+#include <netinet/ip_fw.h>
+#include <string.h>
+#include <err.h>
/*
* helper function, updates the pointer to cmd with the length
diff --git a/freebsd/sys/netinet/libalias/alias_dummy.c b/freebsd/sys/netinet/libalias/alias_dummy.c
index c5a316d4..d544e6e3 100644
--- a/freebsd/sys/netinet/libalias/alias_dummy.c
+++ b/freebsd/sys/netinet/libalias/alias_dummy.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2005 Paolo Pisati <piso@FreeBSD.org>
@@ -26,7 +26,7 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -36,26 +36,26 @@ __FBSDID("$FreeBSD$");
*/
#ifdef _KERNEL
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
#else
-#include <freebsd/errno.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/stdio.h>
+#include <errno.h>
+#include <rtems/bsd/sys/types.h>
+#include <stdio.h>
#endif
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/udp.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <netinet/udp.h>
#ifdef _KERNEL
-#include <freebsd/netinet/libalias/alias_local.h>
-#include <freebsd/netinet/libalias/alias_mod.h>
+#include <netinet/libalias/alias_local.h>
+#include <netinet/libalias/alias_mod.h>
#else
-#include <freebsd/local/alias_local.h>
-#include <freebsd/local/alias_mod.h>
+#include <rtems/bsd/local/alias_local.h>
+#include <rtems/bsd/local/alias_mod.h>
#endif
static void
diff --git a/freebsd/sys/netinet/libalias/alias_ftp.c b/freebsd/sys/netinet/libalias/alias_ftp.c
index 4e8b7177..c8a09413 100644
--- a/freebsd/sys/netinet/libalias/alias_ftp.c
+++ b/freebsd/sys/netinet/libalias/alias_ftp.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001 Charles Mott <cm@linktel.net>
@@ -26,7 +26,7 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -72,31 +72,31 @@ __FBSDID("$FreeBSD$");
/* Includes */
#ifdef _KERNEL
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/ctype.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/ctype.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
#else
-#include <freebsd/ctype.h>
-#include <freebsd/errno.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/stdio.h>
-#include <freebsd/string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <rtems/bsd/sys/types.h>
+#include <stdio.h>
+#include <string.h>
#endif
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/tcp.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <netinet/tcp.h>
#ifdef _KERNEL
-#include <freebsd/netinet/libalias/alias.h>
-#include <freebsd/netinet/libalias/alias_local.h>
-#include <freebsd/netinet/libalias/alias_mod.h>
+#include <netinet/libalias/alias.h>
+#include <netinet/libalias/alias_local.h>
+#include <netinet/libalias/alias_mod.h>
#else
-#include <freebsd/local/alias_local.h>
-#include <freebsd/local/alias_mod.h>
+#include <rtems/bsd/local/alias_local.h>
+#include <rtems/bsd/local/alias_mod.h>
#endif
#define FTP_CONTROL_PORT_NUMBER 21
diff --git a/freebsd/sys/netinet/libalias/alias_irc.c b/freebsd/sys/netinet/libalias/alias_irc.c
index 05db0f4f..084301be 100644
--- a/freebsd/sys/netinet/libalias/alias_irc.c
+++ b/freebsd/sys/netinet/libalias/alias_irc.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001 Charles Mott <cm@linktel.net>
@@ -26,7 +26,7 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/* Alias_irc.c intercepts packages contain IRC CTCP commands, and
@@ -51,34 +51,34 @@ __FBSDID("$FreeBSD$");
/* Includes */
#ifdef _KERNEL
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/ctype.h>
-#include <freebsd/sys/limits.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/ctype.h>
+#include <sys/limits.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
#else
-#include <freebsd/ctype.h>
-#include <freebsd/errno.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/stdio.h>
-#include <freebsd/stdlib.h>
-#include <freebsd/string.h>
-#include <freebsd/limits.h>
+#include <ctype.h>
+#include <errno.h>
+#include <rtems/bsd/sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <limits.h>
#endif
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/tcp.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <netinet/tcp.h>
#ifdef _KERNEL
-#include <freebsd/netinet/libalias/alias.h>
-#include <freebsd/netinet/libalias/alias_local.h>
-#include <freebsd/netinet/libalias/alias_mod.h>
+#include <netinet/libalias/alias.h>
+#include <netinet/libalias/alias_local.h>
+#include <netinet/libalias/alias_mod.h>
#else
-#include <freebsd/local/alias_local.h>
-#include <freebsd/local/alias_mod.h>
+#include <rtems/bsd/local/alias_local.h>
+#include <rtems/bsd/local/alias_mod.h>
#endif
#define IRC_CONTROL_PORT_NUMBER_1 6667
diff --git a/freebsd/sys/netinet/libalias/alias_local.h b/freebsd/sys/netinet/libalias/alias_local.h
index e24ece49..68839da3 100644
--- a/freebsd/sys/netinet/libalias/alias_local.h
+++ b/freebsd/sys/netinet/libalias/alias_local.h
@@ -43,24 +43,24 @@
* <updated several times by original author and Eivind Eklund>
*/
-#ifndef _ALIAS_LOCAL_HH_
-#define _ALIAS_LOCAL_HH_
+#ifndef _ALIAS_LOCAL_H_
+#define _ALIAS_LOCAL_H_
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/sysctl.h>
#ifdef _KERNEL
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
+#include <sys/malloc.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
/* XXX: LibAliasSetTarget() uses this constant. */
#define INADDR_NONE 0xffffffff
-#include <freebsd/netinet/libalias/alias_sctp.h>
+#include <netinet/libalias/alias_sctp.h>
#else
-#include <freebsd/local/alias_sctp.h>
+#include <rtems/bsd/local/alias_sctp.h>
#endif
/* Sizes of input and output link tables */
@@ -368,7 +368,7 @@ enum alias_tcp_state {
ALIAS_TCP_STATE_DISCONNECTED
};
-#if defined(_NETINET_IP_HH_)
+#if defined(_NETINET_IP_H_)
static __inline void *
ip_next(struct ip *iphdr)
{
@@ -377,7 +377,7 @@ ip_next(struct ip *iphdr)
}
#endif
-#if defined(_NETINET_TCP_HH_)
+#if defined(_NETINET_TCP_H_)
static __inline void *
tcp_next(struct tcphdr *tcphdr)
{
@@ -386,7 +386,7 @@ tcp_next(struct tcphdr *tcphdr)
}
#endif
-#if defined(_NETINET_UDP_HH_)
+#if defined(_NETINET_UDP_H_)
static __inline void *
udp_next(struct udphdr *udphdr)
{
@@ -394,4 +394,4 @@ udp_next(struct udphdr *udphdr)
}
#endif
-#endif /* !_ALIAS_LOCAL_HH_ */
+#endif /* !_ALIAS_LOCAL_H_ */
diff --git a/freebsd/sys/netinet/libalias/alias_mod.c b/freebsd/sys/netinet/libalias/alias_mod.c
index fa15b2e4..cb567473 100644
--- a/freebsd/sys/netinet/libalias/alias_mod.c
+++ b/freebsd/sys/netinet/libalias/alias_mod.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2005 Paolo Pisati <piso@FreeBSD.org>
@@ -26,31 +26,31 @@
* SUCH DAMAGE.
*
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifdef _KERNEL
-#include <freebsd/sys/libkern.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/rwlock.h>
+#include <sys/libkern.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/rwlock.h>
#else
-#include <freebsd/stdio.h>
-#include <freebsd/string.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <rtems/bsd/sys/types.h>
+#include <errno.h>
#endif
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
#ifdef _KERNEL
-#include <freebsd/netinet/libalias/alias_local.h>
-#include <freebsd/netinet/libalias/alias_mod.h>
+#include <netinet/libalias/alias_local.h>
+#include <netinet/libalias/alias_mod.h>
#else
-#include <freebsd/local/alias_local.h>
-#include <freebsd/local/alias_mod.h>
+#include <rtems/bsd/local/alias_local.h>
+#include <rtems/bsd/local/alias_mod.h>
#endif
/* Protocol and userland module handlers chains. */
diff --git a/freebsd/sys/netinet/libalias/alias_mod.h b/freebsd/sys/netinet/libalias/alias_mod.h
index f5f98cc3..995f61ac 100644
--- a/freebsd/sys/netinet/libalias/alias_mod.h
+++ b/freebsd/sys/netinet/libalias/alias_mod.h
@@ -31,14 +31,14 @@
* modular framework
*/
-#ifndef _ALIAS_MOD_HH_
-#define _ALIAS_MOD_HH_
+#ifndef _ALIAS_MOD_H_
+#define _ALIAS_MOD_H_
#ifdef _KERNEL
MALLOC_DECLARE(M_ALIAS);
/* Use kernel allocator. */
-#if defined(_SYS_MALLOC_HH_)
+#if defined(_SYS_MALLOC_H_)
#ifndef __rtems__
#define malloc(x) malloc(x, M_ALIAS, M_NOWAIT|M_ZERO)
#define calloc(x, n) malloc(x*n)
@@ -160,4 +160,4 @@ typedef struct moduledata {
} moduledata_t;
#endif
-#endif /* !_ALIAS_MOD_HH_ */
+#endif /* !_ALIAS_MOD_H_ */
diff --git a/freebsd/sys/netinet/libalias/alias_nbt.c b/freebsd/sys/netinet/libalias/alias_nbt.c
index 31ee0006..f4ae9af7 100644
--- a/freebsd/sys/netinet/libalias/alias_nbt.c
+++ b/freebsd/sys/netinet/libalias/alias_nbt.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Written by Atsushi Murai <amurai@spec.co.jp>
@@ -30,7 +30,7 @@
* oConsidering for word alignment for other platform.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -44,28 +44,28 @@ __FBSDID("$FreeBSD$");
/* Includes */
#ifdef _KERNEL
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
#else
-#include <freebsd/errno.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/stdio.h>
-#include <freebsd/strings.h>
+#include <errno.h>
+#include <rtems/bsd/sys/types.h>
+#include <stdio.h>
+#include <strings.h>
#endif
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/udp.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <netinet/udp.h>
#ifdef _KERNEL
-#include <freebsd/netinet/libalias/alias_local.h>
-#include <freebsd/netinet/libalias/alias_mod.h>
+#include <netinet/libalias/alias_local.h>
+#include <netinet/libalias/alias_mod.h>
#else
-#include <freebsd/local/alias_local.h>
-#include <freebsd/local/alias_mod.h>
+#include <rtems/bsd/local/alias_local.h>
+#include <rtems/bsd/local/alias_mod.h>
#endif
#define NETBIOS_NS_PORT_NUMBER 137
diff --git a/freebsd/sys/netinet/libalias/alias_pptp.c b/freebsd/sys/netinet/libalias/alias_pptp.c
index f6c7f199..61f89392 100644
--- a/freebsd/sys/netinet/libalias/alias_pptp.c
+++ b/freebsd/sys/netinet/libalias/alias_pptp.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* alias_pptp.c
@@ -38,32 +38,32 @@
* Author: Erik Salander <erik@whistle.com>
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/* Includes */
#ifdef _KERNEL
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/limits.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/limits.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
#else
-#include <freebsd/errno.h>
-#include <freebsd/limits.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/stdio.h>
+#include <errno.h>
+#include <limits.h>
+#include <rtems/bsd/sys/types.h>
+#include <stdio.h>
#endif
-#include <freebsd/netinet/tcp.h>
+#include <netinet/tcp.h>
#ifdef _KERNEL
-#include <freebsd/netinet/libalias/alias.h>
-#include <freebsd/netinet/libalias/alias_local.h>
-#include <freebsd/netinet/libalias/alias_mod.h>
+#include <netinet/libalias/alias.h>
+#include <netinet/libalias/alias_local.h>
+#include <netinet/libalias/alias_mod.h>
#else
-#include <freebsd/local/alias.h>
-#include <freebsd/local/alias_local.h>
-#include <freebsd/local/alias_mod.h>
+#include <rtems/bsd/local/alias.h>
+#include <rtems/bsd/local/alias_local.h>
+#include <rtems/bsd/local/alias_mod.h>
#endif
#define PPTP_CONTROL_PORT_NUMBER 1723
diff --git a/freebsd/sys/netinet/libalias/alias_proxy.c b/freebsd/sys/netinet/libalias/alias_proxy.c
index f4f2b643..cbd4b99b 100644
--- a/freebsd/sys/netinet/libalias/alias_proxy.c
+++ b/freebsd/sys/netinet/libalias/alias_proxy.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001 Charles Mott <cm@linktel.net>
@@ -26,7 +26,7 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/* file: alias_proxy.c
@@ -57,29 +57,29 @@ __FBSDID("$FreeBSD$");
/* System includes */
#ifdef _KERNEL
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/ctype.h>
-#include <freebsd/sys/libkern.h>
-#include <freebsd/sys/limits.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/ctype.h>
+#include <sys/libkern.h>
+#include <sys/limits.h>
#else
-#include <freebsd/sys/types.h>
-#include <freebsd/ctype.h>
-#include <freebsd/stdio.h>
-#include <freebsd/stdlib.h>
-#include <freebsd/netdb.h>
-#include <freebsd/string.h>
+#include <rtems/bsd/sys/types.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <netdb.h>
+#include <string.h>
#endif
-#include <freebsd/netinet/tcp.h>
+#include <netinet/tcp.h>
#ifdef _KERNEL
-#include <freebsd/netinet/libalias/alias.h>
-#include <freebsd/netinet/libalias/alias_local.h>
-#include <freebsd/netinet/libalias/alias_mod.h>
+#include <netinet/libalias/alias.h>
+#include <netinet/libalias/alias_local.h>
+#include <netinet/libalias/alias_mod.h>
#else
-#include <freebsd/arpa/inet.h>
-#include <freebsd/local/alias.h> /* Public API functions for libalias */
-#include <freebsd/local/alias_local.h> /* Functions used by alias*.c */
+#include <arpa/inet.h>
+#include <rtems/bsd/local/alias.h> /* Public API functions for libalias */
+#include <rtems/bsd/local/alias_local.h> /* Functions used by alias*.c */
#endif
/*
diff --git a/freebsd/sys/netinet/libalias/alias_sctp.c b/freebsd/sys/netinet/libalias/alias_sctp.c
index cdec258c..fed592f0 100644
--- a/freebsd/sys/netinet/libalias/alias_sctp.c
+++ b/freebsd/sys/netinet/libalias/alias_sctp.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2008
@@ -73,24 +73,24 @@
/* $FreeBSD$ */
#ifdef _KERNEL
-#include <freebsd/machine/stdarg.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/netinet/libalias/alias_sctp.h>
-#include <freebsd/netinet/libalias/alias.h>
-#include <freebsd/netinet/libalias/alias_local.h>
-#include <freebsd/netinet/sctp_crc32.h>
-#include <freebsd/machine/in_cksum.h>
+#include <machine/stdarg.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/syslog.h>
+#include <netinet/libalias/alias_sctp.h>
+#include <netinet/libalias/alias.h>
+#include <netinet/libalias/alias_local.h>
+#include <netinet/sctp_crc32.h>
+#include <machine/in_cksum.h>
#else
-#include <freebsd/local/alias_sctp.h>
-#include <freebsd/arpa/inet.h>
-#include <freebsd/local/alias.h>
-#include <freebsd/local/alias_local.h>
-#include <freebsd/machine/in_cksum.h>
-#include <freebsd/sys/libkern.h>
+#include <rtems/bsd/local/alias_sctp.h>
+#include <arpa/inet.h>
+#include <rtems/bsd/local/alias.h>
+#include <rtems/bsd/local/alias_local.h>
+#include <machine/in_cksum.h>
+#include <sys/libkern.h>
#endif //#ifdef _KERNEL
/* ----------------------------------------------------------------------
@@ -185,11 +185,11 @@ void SctpShowAliasStats(struct libalias *la);
MALLOC_DEFINE(M_SCTPNAT, "sctpnat", "sctp nat dbs");
/* Use kernel allocator. */
-#ifdef _SYS_MALLOC_HH_
+#ifdef _SYS_MALLOC_H_
#define sn_malloc(x) malloc(x, M_SCTPNAT, M_NOWAIT|M_ZERO)
#define sn_calloc(n,x) sn_malloc(x * n)
#define sn_free(x) free(x, M_SCTPNAT)
-#endif// #ifdef _SYS_MALLOC_HH_
+#endif// #ifdef _SYS_MALLOC_H_
#else //#ifdef _KERNEL
#define sn_malloc(x) malloc(x)
diff --git a/freebsd/sys/netinet/libalias/alias_sctp.h b/freebsd/sys/netinet/libalias/alias_sctp.h
index 9ea21959..b6ad6f17 100644
--- a/freebsd/sys/netinet/libalias/alias_sctp.h
+++ b/freebsd/sys/netinet/libalias/alias_sctp.h
@@ -47,36 +47,36 @@
/* $FreeBSD$ */
-#ifndef _ALIAS_SCTP_HH_
-#define _ALIAS_SCTP_HH_
+#ifndef _ALIAS_SCTP_H_
+#define _ALIAS_SCTP_H_
-#include <freebsd/sys/param.h>
+#include <rtems/bsd/sys/param.h>
#ifdef _KERNEL
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/uio.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/syslog.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/kernel.h>
+#include <sys/proc.h>
+#include <sys/uio.h>
+#include <sys/socketvar.h>
+#include <sys/syslog.h>
#endif // #ifdef _KERNEL
-#include <freebsd/sys/types.h>
+#include <rtems/bsd/sys/types.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/time.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/time.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
/**
* These are defined in sctp_os_bsd.h, but it can't be included due to its local file
* inclusion, so I'm defining them here.
*
*/
-#include <freebsd/machine/cpufunc.h>
-#include <freebsd/machine/cpu.h>
+#include <machine/cpufunc.h>
+#include <machine/cpu.h>
/* The packed define for 64 bit platforms */
#ifndef SCTP_PACKED
#define SCTP_PACKED __attribute__((packed))
@@ -86,14 +86,14 @@
#endif //#ifndef SCTP_UNUSED
-#include <freebsd/netinet/sctp.h>
-//#include <freebsd/netinet/sctp_os_bsd.h> --might be needed later for mbuf stuff
-#include <freebsd/netinet/sctp_header.h>
+#include <netinet/sctp.h>
+//#include <netinet/sctp_os_bsd.h> --might be needed later for mbuf stuff
+#include <netinet/sctp_header.h>
#ifndef _KERNEL
-#include <freebsd/stdlib.h>
-#include <freebsd/stdio.h>
-#include <freebsd/curses.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <curses.h>
#endif //#ifdef _KERNEL
diff --git a/freebsd/sys/netinet/libalias/alias_skinny.c b/freebsd/sys/netinet/libalias/alias_skinny.c
index 4d311efe..d472d307 100644
--- a/freebsd/sys/netinet/libalias/alias_skinny.c
+++ b/freebsd/sys/netinet/libalias/alias_skinny.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* alias_skinny.c
@@ -33,26 +33,26 @@
*/
#ifdef _KERNEL
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
#else
-#include <freebsd/errno.h>
-#include <freebsd/stdio.h>
-#include <freebsd/unistd.h>
+#include <errno.h>
+#include <stdio.h>
+#include <unistd.h>
#endif
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/tcp.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <netinet/tcp.h>
#ifdef _KERNEL
-#include <freebsd/netinet/libalias/alias_local.h>
-#include <freebsd/netinet/libalias/alias_mod.h>
+#include <netinet/libalias/alias_local.h>
+#include <netinet/libalias/alias_mod.h>
#else
-#include <freebsd/local/alias_local.h>
-#include <freebsd/local/alias_mod.h>
+#include <rtems/bsd/local/alias_local.h>
+#include <rtems/bsd/local/alias_mod.h>
#endif
static void
diff --git a/freebsd/sys/netinet/libalias/alias_smedia.c b/freebsd/sys/netinet/libalias/alias_smedia.c
index 3d558a94..eed1c49f 100644
--- a/freebsd/sys/netinet/libalias/alias_smedia.c
+++ b/freebsd/sys/netinet/libalias/alias_smedia.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* alias_smedia.c
@@ -65,7 +65,7 @@
* <junichi@junichi.org>
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -101,29 +101,29 @@ __FBSDID("$FreeBSD$");
*/
#ifdef _KERNEL
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
#else
-#include <freebsd/errno.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/stdio.h>
-#include <freebsd/string.h>
+#include <errno.h>
+#include <rtems/bsd/sys/types.h>
+#include <stdio.h>
+#include <string.h>
#endif
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/tcp.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <netinet/tcp.h>
#ifdef _KERNEL
-#include <freebsd/netinet/libalias/alias.h>
-#include <freebsd/netinet/libalias/alias_local.h>
-#include <freebsd/netinet/libalias/alias_mod.h>
+#include <netinet/libalias/alias.h>
+#include <netinet/libalias/alias_local.h>
+#include <netinet/libalias/alias_mod.h>
#else
-#include <freebsd/local/alias_local.h>
-#include <freebsd/local/alias_mod.h>
+#include <rtems/bsd/local/alias_local.h>
+#include <rtems/bsd/local/alias_mod.h>
#endif
#define RTSP_CONTROL_PORT_NUMBER_1 554
diff --git a/freebsd/sys/netinet/libalias/alias_util.c b/freebsd/sys/netinet/libalias/alias_util.c
index 1e0c95ae..066146c8 100644
--- a/freebsd/sys/netinet/libalias/alias_util.c
+++ b/freebsd/sys/netinet/libalias/alias_util.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001 Charles Mott <cm@linktel.net>
@@ -26,7 +26,7 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -46,24 +46,24 @@ __FBSDID("$FreeBSD$");
*/
#ifdef _KERNEL
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/proc.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/proc.h>
#else
-#include <freebsd/sys/types.h>
-#include <freebsd/stdio.h>
+#include <rtems/bsd/sys/types.h>
+#include <stdio.h>
#endif
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/tcp.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <netinet/tcp.h>
#ifdef _KERNEL
-#include <freebsd/netinet/libalias/alias.h>
-#include <freebsd/netinet/libalias/alias_local.h>
+#include <netinet/libalias/alias.h>
+#include <netinet/libalias/alias_local.h>
#else
-#include <freebsd/local/alias.h>
-#include <freebsd/local/alias_local.h>
+#include <rtems/bsd/local/alias.h>
+#include <rtems/bsd/local/alias_local.h>
#endif
/*
diff --git a/freebsd/sys/netinet/pim.h b/freebsd/sys/netinet/pim.h
index 2f887cc2..2b52a447 100644
--- a/freebsd/sys/netinet/pim.h
+++ b/freebsd/sys/netinet/pim.h
@@ -30,8 +30,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET_PIM_HH_
-#define _NETINET_PIM_HH_
+#ifndef _NETINET_PIM_H_
+#define _NETINET_PIM_H_
/*
* Protocol Independent Multicast (PIM) definitions.
@@ -42,7 +42,7 @@
* Modified by Pavlin Radoslavov, USC/ISI, May 1998, October 2000.
*/
-#include <freebsd/sys/types.h>
+#include <rtems/bsd/sys/types.h>
#ifndef _PIM_VT
#ifndef BYTE_ORDER
@@ -116,4 +116,4 @@ struct pim {
{{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d }}}
-#endif /* _NETINET_PIM_HH_ */
+#endif /* _NETINET_PIM_H_ */
diff --git a/freebsd/sys/netinet/pim_var.h b/freebsd/sys/netinet/pim_var.h
index 9d80bbb2..41657b61 100644
--- a/freebsd/sys/netinet/pim_var.h
+++ b/freebsd/sys/netinet/pim_var.h
@@ -30,8 +30,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET_PIM_VAR_HH_
-#define _NETINET_PIM_VAR_HH_
+#ifndef _NETINET_PIM_VAR_H_
+#define _NETINET_PIM_VAR_H_
/*
* Protocol Independent Multicast (PIM),
@@ -81,4 +81,4 @@ void pim_input(struct mbuf *, int);
SYSCTL_DECL(_net_inet_pim);
#endif
-#endif /* _NETINET_PIM_VAR_HH_ */
+#endif /* _NETINET_PIM_VAR_H_ */
diff --git a/freebsd/sys/netinet/raw_ip.c b/freebsd/sys/netinet/raw_ip.c
index fb90880f..408b529b 100644
--- a/freebsd/sys/netinet/raw_ip.c
+++ b/freebsd/sys/netinet/raw_ip.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1988, 1993
@@ -32,48 +32,48 @@
* @(#)raw_ip.c 8.7 (Berkeley) 5/15/95
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipsec.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/systm.h>
-
-#include <freebsd/vm/uma.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_mroute.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/jail.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/protosw.h>
+#include <sys/rwlock.h>
+#include <sys/signalvar.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sx.h>
+#include <sys/sysctl.h>
+#include <sys/systm.h>
+
+#include <vm/uma.h>
+
+#include <net/if.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_pcb.h>
+#include <netinet/in_var.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_mroute.h>
#ifdef IPSEC
-#include <freebsd/netipsec/ipsec.h>
+#include <netipsec/ipsec.h>
#endif /*IPSEC*/
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
VNET_DEFINE(struct inpcbhead, ripcb);
VNET_DEFINE(struct inpcbinfo, ripcbinfo);
diff --git a/freebsd/sys/netinet/sctp.h b/freebsd/sys/netinet/sctp.h
index bf188a23..09e2e465 100644
--- a/freebsd/sys/netinet/sctp.h
+++ b/freebsd/sys/netinet/sctp.h
@@ -29,13 +29,13 @@
*/
/* $KAME: sctp.h,v 1.18 2005/03/06 16:04:16 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#ifndef _NETINET_SCTP_HH_
-#define _NETINET_SCTP_HH_
+#ifndef _NETINET_SCTP_H_
+#define _NETINET_SCTP_H_
-#include <freebsd/sys/types.h>
+#include <rtems/bsd/sys/types.h>
#define SCTP_PACKED __attribute__((packed))
@@ -491,7 +491,7 @@ struct sctp_error_unrecognized_chunk {
#define SCTP_SMALLEST_PMTU 512 /* smallest pmtu allowed when disabling PMTU
* discovery */
-#include <freebsd/netinet/sctp_uio.h>
+#include <netinet/sctp_uio.h>
/* This dictates the size of the packet
* collection buffer. This only applies
@@ -546,4 +546,4 @@ struct sctp_error_unrecognized_chunk {
#undef SCTP_PACKED
-#endif /* !_NETINET_SCTP_HH_ */
+#endif /* !_NETINET_SCTP_H_ */
diff --git a/freebsd/sys/netinet/sctp_asconf.c b/freebsd/sys/netinet/sctp_asconf.c
index 206cf600..3c24b75d 100644
--- a/freebsd/sys/netinet/sctp_asconf.c
+++ b/freebsd/sys/netinet/sctp_asconf.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
@@ -32,17 +32,17 @@
/* $KAME: sctp_asconf.c,v 1.24 2005/03/06 16:04:16 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/netinet/sctp_os.h>
-#include <freebsd/netinet/sctp_var.h>
-#include <freebsd/netinet/sctp_sysctl.h>
-#include <freebsd/netinet/sctp_pcb.h>
-#include <freebsd/netinet/sctp_header.h>
-#include <freebsd/netinet/sctputil.h>
-#include <freebsd/netinet/sctp_output.h>
-#include <freebsd/netinet/sctp_asconf.h>
-#include <freebsd/netinet/sctp_timer.h>
+#include <netinet/sctp_os.h>
+#include <netinet/sctp_var.h>
+#include <netinet/sctp_sysctl.h>
+#include <netinet/sctp_pcb.h>
+#include <netinet/sctp_header.h>
+#include <netinet/sctputil.h>
+#include <netinet/sctp_output.h>
+#include <netinet/sctp_asconf.h>
+#include <netinet/sctp_timer.h>
/*
* debug flags:
diff --git a/freebsd/sys/netinet/sctp_asconf.h b/freebsd/sys/netinet/sctp_asconf.h
index ff8cf378..bf3d5665 100644
--- a/freebsd/sys/netinet/sctp_asconf.h
+++ b/freebsd/sys/netinet/sctp_asconf.h
@@ -30,11 +30,11 @@
/* $KAME: sctp_asconf.h,v 1.8 2005/03/06 16:04:16 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#ifndef _NETINET_SCTP_ASCONF_HH_
-#define _NETINET_SCTP_ASCONF_HH_
+#ifndef _NETINET_SCTP_ASCONF_H_
+#define _NETINET_SCTP_ASCONF_H_
#if defined(_KERNEL) || defined(__Userspace__)
@@ -93,4 +93,4 @@ extern int
#endif /* _KERNEL */
-#endif /* !_NETINET_SCTP_ASCONF_HH_ */
+#endif /* !_NETINET_SCTP_ASCONF_H_ */
diff --git a/freebsd/sys/netinet/sctp_auth.c b/freebsd/sys/netinet/sctp_auth.c
index 6c2bf908..cf4ebaa9 100644
--- a/freebsd/sys/netinet/sctp_auth.c
+++ b/freebsd/sys/netinet/sctp_auth.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved.
@@ -30,19 +30,19 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/netinet/sctp_os.h>
-#include <freebsd/netinet/sctp.h>
-#include <freebsd/netinet/sctp_header.h>
-#include <freebsd/netinet/sctp_pcb.h>
-#include <freebsd/netinet/sctp_var.h>
-#include <freebsd/netinet/sctp_sysctl.h>
-#include <freebsd/netinet/sctputil.h>
-#include <freebsd/netinet/sctp_indata.h>
-#include <freebsd/netinet/sctp_output.h>
-#include <freebsd/netinet/sctp_auth.h>
+#include <netinet/sctp_os.h>
+#include <netinet/sctp.h>
+#include <netinet/sctp_header.h>
+#include <netinet/sctp_pcb.h>
+#include <netinet/sctp_var.h>
+#include <netinet/sctp_sysctl.h>
+#include <netinet/sctputil.h>
+#include <netinet/sctp_indata.h>
+#include <netinet/sctp_output.h>
+#include <netinet/sctp_auth.h>
#ifdef SCTP_DEBUG
#define SCTP_AUTH_DEBUG (SCTP_BASE_SYSCTL(sctp_debug_on) & SCTP_DEBUG_AUTH1)
diff --git a/freebsd/sys/netinet/sctp_auth.h b/freebsd/sys/netinet/sctp_auth.h
index da4dc09b..36535357 100644
--- a/freebsd/sys/netinet/sctp_auth.h
+++ b/freebsd/sys/netinet/sctp_auth.h
@@ -28,7 +28,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef __SCTP_AUTH_HH__
diff --git a/freebsd/sys/netinet/sctp_bsd_addr.c b/freebsd/sys/netinet/sctp_bsd_addr.c
index 8782e681..8612adc9 100644
--- a/freebsd/sys/netinet/sctp_bsd_addr.c
+++ b/freebsd/sys/netinet/sctp_bsd_addr.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
@@ -32,23 +32,23 @@
/* $KAME: sctp_output.c,v 1.46 2005/03/06 16:04:17 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/netinet/sctp_os.h>
-#include <freebsd/netinet/sctp_var.h>
-#include <freebsd/netinet/sctp_pcb.h>
-#include <freebsd/netinet/sctp_header.h>
-#include <freebsd/netinet/sctputil.h>
-#include <freebsd/netinet/sctp_output.h>
-#include <freebsd/netinet/sctp_bsd_addr.h>
-#include <freebsd/netinet/sctp_uio.h>
-#include <freebsd/netinet/sctputil.h>
-#include <freebsd/netinet/sctp_timer.h>
-#include <freebsd/netinet/sctp_asconf.h>
-#include <freebsd/netinet/sctp_sysctl.h>
-#include <freebsd/netinet/sctp_indata.h>
-#include <freebsd/sys/unistd.h>
+#include <netinet/sctp_os.h>
+#include <netinet/sctp_var.h>
+#include <netinet/sctp_pcb.h>
+#include <netinet/sctp_header.h>
+#include <netinet/sctputil.h>
+#include <netinet/sctp_output.h>
+#include <netinet/sctp_bsd_addr.h>
+#include <netinet/sctp_uio.h>
+#include <netinet/sctputil.h>
+#include <netinet/sctp_timer.h>
+#include <netinet/sctp_asconf.h>
+#include <netinet/sctp_sysctl.h>
+#include <netinet/sctp_indata.h>
+#include <rtems/bsd/sys/unistd.h>
/* Declare all of our malloc named types */
MALLOC_DEFINE(SCTP_M_MAP, "sctp_map", "sctp asoc map descriptor");
diff --git a/freebsd/sys/netinet/sctp_bsd_addr.h b/freebsd/sys/netinet/sctp_bsd_addr.h
index 67d65dc6..ae2fa525 100644
--- a/freebsd/sys/netinet/sctp_bsd_addr.h
+++ b/freebsd/sys/netinet/sctp_bsd_addr.h
@@ -28,12 +28,12 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef __sctp_bsd_addr_h__
#define __sctp_bsd_addr_h__
-#include <freebsd/netinet/sctp_pcb.h>
+#include <netinet/sctp_pcb.h>
#if defined(_KERNEL) || defined(__Userspace__)
diff --git a/freebsd/sys/netinet/sctp_cc_functions.c b/freebsd/sys/netinet/sctp_cc_functions.c
index 668fd673..e0f8beae 100644
--- a/freebsd/sys/netinet/sctp_cc_functions.c
+++ b/freebsd/sys/netinet/sctp_cc_functions.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
@@ -30,21 +30,21 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/netinet/sctp_os.h>
-#include <freebsd/netinet/sctp_var.h>
-#include <freebsd/netinet/sctp_sysctl.h>
-#include <freebsd/netinet/sctp_pcb.h>
-#include <freebsd/netinet/sctp_header.h>
-#include <freebsd/netinet/sctputil.h>
-#include <freebsd/netinet/sctp_output.h>
-#include <freebsd/netinet/sctp_input.h>
-#include <freebsd/netinet/sctp_indata.h>
-#include <freebsd/netinet/sctp_uio.h>
-#include <freebsd/netinet/sctp_timer.h>
-#include <freebsd/netinet/sctp_auth.h>
-#include <freebsd/netinet/sctp_asconf.h>
-#include <freebsd/netinet/sctp_cc_functions.h>
-#include <freebsd/sys/cdefs.h>
+#include <netinet/sctp_os.h>
+#include <netinet/sctp_var.h>
+#include <netinet/sctp_sysctl.h>
+#include <netinet/sctp_pcb.h>
+#include <netinet/sctp_header.h>
+#include <netinet/sctputil.h>
+#include <netinet/sctp_output.h>
+#include <netinet/sctp_input.h>
+#include <netinet/sctp_indata.h>
+#include <netinet/sctp_uio.h>
+#include <netinet/sctp_timer.h>
+#include <netinet/sctp_auth.h>
+#include <netinet/sctp_asconf.h>
+#include <netinet/sctp_cc_functions.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
void
diff --git a/freebsd/sys/netinet/sctp_cc_functions.h b/freebsd/sys/netinet/sctp_cc_functions.h
index 3b95d7de..1a681ada 100644
--- a/freebsd/sys/netinet/sctp_cc_functions.h
+++ b/freebsd/sys/netinet/sctp_cc_functions.h
@@ -27,7 +27,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef __sctp_cc_functions_h__
diff --git a/freebsd/sys/netinet/sctp_constants.h b/freebsd/sys/netinet/sctp_constants.h
index c4f4be23..212a2f9e 100644
--- a/freebsd/sys/netinet/sctp_constants.h
+++ b/freebsd/sys/netinet/sctp_constants.h
@@ -30,7 +30,7 @@
/* $KAME: sctp_constants.h,v 1.17 2005/03/06 16:04:17 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef __sctp_constants_h__
diff --git a/freebsd/sys/netinet/sctp_crc32.c b/freebsd/sys/netinet/sctp_crc32.c
index aa4c08cf..3d07f505 100644
--- a/freebsd/sys/netinet/sctp_crc32.c
+++ b/freebsd/sys/netinet/sctp_crc32.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
@@ -33,13 +33,13 @@
/* $KAME: sctp_crc32.c,v 1.12 2005/03/06 16:04:17 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/netinet/sctp_os.h>
-#include <freebsd/netinet/sctp.h>
-#include <freebsd/netinet/sctp_crc32.h>
-#include <freebsd/netinet/sctp_pcb.h>
+#include <netinet/sctp_os.h>
+#include <netinet/sctp.h>
+#include <netinet/sctp_crc32.h>
+#include <netinet/sctp_pcb.h>
#if !defined(SCTP_WITH_NO_CSUM)
diff --git a/freebsd/sys/netinet/sctp_crc32.h b/freebsd/sys/netinet/sctp_crc32.h
index 768b25d5..eb7a1bc7 100644
--- a/freebsd/sys/netinet/sctp_crc32.h
+++ b/freebsd/sys/netinet/sctp_crc32.h
@@ -30,7 +30,7 @@
/* $KAME: sctp_crc32.h,v 1.5 2004/08/17 04:06:16 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef __crc32c_h__
diff --git a/freebsd/sys/netinet/sctp_header.h b/freebsd/sys/netinet/sctp_header.h
index 141bfcda..980845dc 100644
--- a/freebsd/sys/netinet/sctp_header.h
+++ b/freebsd/sys/netinet/sctp_header.h
@@ -30,15 +30,15 @@
/* $KAME: sctp_header.h,v 1.14 2005/03/06 16:04:17 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef __sctp_header_h__
#define __sctp_header_h__
-#include <freebsd/sys/time.h>
-#include <freebsd/netinet/sctp.h>
-#include <freebsd/netinet/sctp_constants.h>
+#include <rtems/bsd/sys/time.h>
+#include <netinet/sctp.h>
+#include <netinet/sctp_constants.h>
#define SCTP_PACKED __attribute__((packed))
diff --git a/freebsd/sys/netinet/sctp_indata.c b/freebsd/sys/netinet/sctp_indata.c
index 963b3205..082e43b8 100644
--- a/freebsd/sys/netinet/sctp_indata.c
+++ b/freebsd/sys/netinet/sctp_indata.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
@@ -32,20 +32,20 @@
/* $KAME: sctp_indata.c,v 1.36 2005/03/06 16:04:17 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/netinet/sctp_os.h>
-#include <freebsd/netinet/sctp_var.h>
-#include <freebsd/netinet/sctp_sysctl.h>
-#include <freebsd/netinet/sctp_pcb.h>
-#include <freebsd/netinet/sctp_header.h>
-#include <freebsd/netinet/sctputil.h>
-#include <freebsd/netinet/sctp_output.h>
-#include <freebsd/netinet/sctp_input.h>
-#include <freebsd/netinet/sctp_indata.h>
-#include <freebsd/netinet/sctp_uio.h>
-#include <freebsd/netinet/sctp_timer.h>
+#include <netinet/sctp_os.h>
+#include <netinet/sctp_var.h>
+#include <netinet/sctp_sysctl.h>
+#include <netinet/sctp_pcb.h>
+#include <netinet/sctp_header.h>
+#include <netinet/sctputil.h>
+#include <netinet/sctp_output.h>
+#include <netinet/sctp_input.h>
+#include <netinet/sctp_indata.h>
+#include <netinet/sctp_uio.h>
+#include <netinet/sctp_timer.h>
/*
diff --git a/freebsd/sys/netinet/sctp_indata.h b/freebsd/sys/netinet/sctp_indata.h
index a231ecaf..79978a5c 100644
--- a/freebsd/sys/netinet/sctp_indata.h
+++ b/freebsd/sys/netinet/sctp_indata.h
@@ -30,7 +30,7 @@
/* $KAME: sctp_indata.h,v 1.9 2005/03/06 16:04:17 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef __sctp_indata_h__
diff --git a/freebsd/sys/netinet/sctp_input.c b/freebsd/sys/netinet/sctp_input.c
index 080813b4..965bec86 100644
--- a/freebsd/sys/netinet/sctp_input.c
+++ b/freebsd/sys/netinet/sctp_input.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved.
@@ -32,24 +32,24 @@
/* $KAME: sctp_input.c,v 1.27 2005/03/06 16:04:17 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/netinet/sctp_os.h>
-#include <freebsd/netinet/sctp_var.h>
-#include <freebsd/netinet/sctp_sysctl.h>
-#include <freebsd/netinet/sctp_pcb.h>
-#include <freebsd/netinet/sctp_header.h>
-#include <freebsd/netinet/sctputil.h>
-#include <freebsd/netinet/sctp_output.h>
-#include <freebsd/netinet/sctp_input.h>
-#include <freebsd/netinet/sctp_auth.h>
-#include <freebsd/netinet/sctp_indata.h>
-#include <freebsd/netinet/sctp_asconf.h>
-#include <freebsd/netinet/sctp_bsd_addr.h>
-#include <freebsd/netinet/sctp_timer.h>
-#include <freebsd/netinet/sctp_crc32.h>
-#include <freebsd/netinet/udp.h>
+#include <netinet/sctp_os.h>
+#include <netinet/sctp_var.h>
+#include <netinet/sctp_sysctl.h>
+#include <netinet/sctp_pcb.h>
+#include <netinet/sctp_header.h>
+#include <netinet/sctputil.h>
+#include <netinet/sctp_output.h>
+#include <netinet/sctp_input.h>
+#include <netinet/sctp_auth.h>
+#include <netinet/sctp_indata.h>
+#include <netinet/sctp_asconf.h>
+#include <netinet/sctp_bsd_addr.h>
+#include <netinet/sctp_timer.h>
+#include <netinet/sctp_crc32.h>
+#include <netinet/udp.h>
diff --git a/freebsd/sys/netinet/sctp_input.h b/freebsd/sys/netinet/sctp_input.h
index 90cd098a..39f64207 100644
--- a/freebsd/sys/netinet/sctp_input.h
+++ b/freebsd/sys/netinet/sctp_input.h
@@ -30,7 +30,7 @@
/* $KAME: sctp_input.h,v 1.6 2005/03/06 16:04:17 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef __sctp_input_h__
diff --git a/freebsd/sys/netinet/sctp_lock_bsd.h b/freebsd/sys/netinet/sctp_lock_bsd.h
index 81e4a35f..dd9c2ce5 100644
--- a/freebsd/sys/netinet/sctp_lock_bsd.h
+++ b/freebsd/sys/netinet/sctp_lock_bsd.h
@@ -68,7 +68,7 @@
* SCTP_INP_INFO_RLOCK() and then when we want to add a new association to
* the SCTP_BASE_INFO() list's we will do a SCTP_INP_INFO_WLOCK().
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
diff --git a/freebsd/sys/netinet/sctp_os.h b/freebsd/sys/netinet/sctp_os.h
index c1a392f0..fb7c5360 100644
--- a/freebsd/sys/netinet/sctp_os.h
+++ b/freebsd/sys/netinet/sctp_os.h
@@ -27,7 +27,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef __sctp_os_h__
#define __sctp_os_h__
@@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$");
* SCTP_ZONE_DESTROY(zone)
*/
-#include <freebsd/netinet/sctp_os_bsd.h>
+#include <netinet/sctp_os_bsd.h>
diff --git a/freebsd/sys/netinet/sctp_os_bsd.h b/freebsd/sys/netinet/sctp_os_bsd.h
index cf29776f..991daca2 100644
--- a/freebsd/sys/netinet/sctp_os_bsd.h
+++ b/freebsd/sys/netinet/sctp_os_bsd.h
@@ -27,78 +27,78 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef __sctp_os_bsd_h__
#define __sctp_os_bsd_h__
/*
* includes
*/
-#include <freebsd/local/opt_ipsec.h>
-#include <freebsd/local/opt_compat.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_sctp.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/ktr.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/resourcevar.h>
-#include <freebsd/sys/uio.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/kthread.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/random.h>
-#include <freebsd/sys/limits.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/machine/cpu.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_var.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_icmp.h>
-#include <freebsd/netinet/icmp_var.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+#include <rtems/bsd/local/opt_compat.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_sctp.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/ktr.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
+#include <sys/mbuf.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/jail.h>
+#include <sys/sysctl.h>
+#include <sys/resourcevar.h>
+#include <sys/uio.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/rwlock.h>
+#include <sys/kthread.h>
+#include <sys/priv.h>
+#include <sys/random.h>
+#include <sys/limits.h>
+#include <sys/queue.h>
+#include <machine/cpu.h>
+
+#include <net/if.h>
+#include <net/if_types.h>
+#include <net/if_var.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/in_pcb.h>
+#include <netinet/in_var.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/icmp_var.h>
#ifdef IPSEC
-#include <freebsd/netipsec/ipsec.h>
-#include <freebsd/netipsec/key.h>
+#include <netipsec/ipsec.h>
+#include <netipsec/key.h>
#endif /* IPSEC */
#ifdef INET6
-#include <freebsd/sys/domain.h>
+#include <sys/domain.h>
#ifdef IPSEC
-#include <freebsd/netipsec/ipsec6.h>
+#include <netipsec/ipsec6.h>
#endif
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/in6_pcb.h>
-#include <freebsd/netinet/icmp6.h>
-#include <freebsd/netinet6/ip6protosw.h>
-#include <freebsd/netinet6/nd6.h>
-#include <freebsd/netinet6/scope6_var.h>
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/in6_pcb.h>
+#include <netinet/icmp6.h>
+#include <netinet6/ip6protosw.h>
+#include <netinet6/nd6.h>
+#include <netinet6/scope6_var.h>
#endif /* INET6 */
-#include <freebsd/netinet/ip_options.h>
+#include <netinet/ip_options.h>
#ifndef in6pcb
#define in6pcb inpcb
@@ -249,7 +249,7 @@ MALLOC_DECLARE(SCTP_M_SOCKOPT);
/*
* zone allocation functions
*/
-#include <freebsd/vm/uma.h>
+#include <vm/uma.h>
/* SCTP_ZONE_INIT: initialize the zone */
typedef struct uma_zone *sctp_zone_t;
@@ -278,7 +278,7 @@ typedef struct uma_zone *sctp_zone_t;
/*
* timers
*/
-#include <freebsd/sys/callout.h>
+#include <sys/callout.h>
typedef struct callout sctp_os_timer_t;
@@ -466,9 +466,9 @@ sctp_get_mbuf_for_msg(unsigned int space_needed,
#define SCTP_READ_RANDOM(buf, len) read_random(buf, len)
#ifdef USE_SCTP_SHA1
-#include <freebsd/netinet/sctp_sha1.h>
+#include <netinet/sctp_sha1.h>
#else
-#include <freebsd/crypto/sha1.h>
+#include <crypto/sha1.h>
/* map standard crypto API names */
#define SHA1_Init SHA1Init
#define SHA1_Update SHA1Update
@@ -476,7 +476,7 @@ sctp_get_mbuf_for_msg(unsigned int space_needed,
#endif
#if defined(HAVE_SHA2)
-#include <freebsd/crypto/sha2/sha2.h>
+#include <crypto/sha2/sha2.h>
#endif
#endif
diff --git a/freebsd/sys/netinet/sctp_output.c b/freebsd/sys/netinet/sctp_output.c
index 9acd3288..648a87a2 100644
--- a/freebsd/sys/netinet/sctp_output.c
+++ b/freebsd/sys/netinet/sctp_output.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved.
@@ -32,28 +32,28 @@
/* $KAME: sctp_output.c,v 1.46 2005/03/06 16:04:17 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/netinet/sctp_os.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/netinet/sctp_var.h>
-#include <freebsd/netinet/sctp_sysctl.h>
-#include <freebsd/netinet/sctp_header.h>
-#include <freebsd/netinet/sctp_pcb.h>
-#include <freebsd/netinet/sctputil.h>
-#include <freebsd/netinet/sctp_output.h>
-#include <freebsd/netinet/sctp_uio.h>
-#include <freebsd/netinet/sctputil.h>
-#include <freebsd/netinet/sctp_auth.h>
-#include <freebsd/netinet/sctp_timer.h>
-#include <freebsd/netinet/sctp_asconf.h>
-#include <freebsd/netinet/sctp_indata.h>
-#include <freebsd/netinet/sctp_bsd_addr.h>
-#include <freebsd/netinet/sctp_input.h>
-#include <freebsd/netinet/sctp_crc32.h>
-#include <freebsd/netinet/udp.h>
-#include <freebsd/machine/in_cksum.h>
+#include <netinet/sctp_os.h>
+#include <sys/proc.h>
+#include <netinet/sctp_var.h>
+#include <netinet/sctp_sysctl.h>
+#include <netinet/sctp_header.h>
+#include <netinet/sctp_pcb.h>
+#include <netinet/sctputil.h>
+#include <netinet/sctp_output.h>
+#include <netinet/sctp_uio.h>
+#include <netinet/sctputil.h>
+#include <netinet/sctp_auth.h>
+#include <netinet/sctp_timer.h>
+#include <netinet/sctp_asconf.h>
+#include <netinet/sctp_indata.h>
+#include <netinet/sctp_bsd_addr.h>
+#include <netinet/sctp_input.h>
+#include <netinet/sctp_crc32.h>
+#include <netinet/udp.h>
+#include <machine/in_cksum.h>
diff --git a/freebsd/sys/netinet/sctp_output.h b/freebsd/sys/netinet/sctp_output.h
index d9051ee7..d655c3aa 100644
--- a/freebsd/sys/netinet/sctp_output.h
+++ b/freebsd/sys/netinet/sctp_output.h
@@ -30,13 +30,13 @@
/* $KAME: sctp_output.h,v 1.14 2005/03/06 16:04:18 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef __sctp_output_h__
#define __sctp_output_h__
-#include <freebsd/netinet/sctp_header.h>
+#include <netinet/sctp_header.h>
#if defined(_KERNEL) || defined(__Userspace__)
diff --git a/freebsd/sys/netinet/sctp_pcb.c b/freebsd/sys/netinet/sctp_pcb.c
index fccbda00..98c5b707 100644
--- a/freebsd/sys/netinet/sctp_pcb.c
+++ b/freebsd/sys/netinet/sctp_pcb.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved.
@@ -32,22 +32,22 @@
/* $KAME: sctp_pcb.c,v 1.38 2005/03/06 16:04:18 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/netinet/sctp_os.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/netinet/sctp_var.h>
-#include <freebsd/netinet/sctp_sysctl.h>
-#include <freebsd/netinet/sctp_pcb.h>
-#include <freebsd/netinet/sctputil.h>
-#include <freebsd/netinet/sctp.h>
-#include <freebsd/netinet/sctp_header.h>
-#include <freebsd/netinet/sctp_asconf.h>
-#include <freebsd/netinet/sctp_output.h>
-#include <freebsd/netinet/sctp_timer.h>
-#include <freebsd/netinet/sctp_bsd_addr.h>
-#include <freebsd/netinet/udp.h>
+#include <netinet/sctp_os.h>
+#include <sys/proc.h>
+#include <netinet/sctp_var.h>
+#include <netinet/sctp_sysctl.h>
+#include <netinet/sctp_pcb.h>
+#include <netinet/sctputil.h>
+#include <netinet/sctp.h>
+#include <netinet/sctp_header.h>
+#include <netinet/sctp_asconf.h>
+#include <netinet/sctp_output.h>
+#include <netinet/sctp_timer.h>
+#include <netinet/sctp_bsd_addr.h>
+#include <netinet/udp.h>
VNET_DEFINE(struct sctp_base_info, system_base_info);
diff --git a/freebsd/sys/netinet/sctp_pcb.h b/freebsd/sys/netinet/sctp_pcb.h
index a4f4d30c..23ebc4f1 100644
--- a/freebsd/sys/netinet/sctp_pcb.h
+++ b/freebsd/sys/netinet/sctp_pcb.h
@@ -30,16 +30,16 @@
/* $KAME: sctp_pcb.h,v 1.21 2005/07/16 01:18:47 suz Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef __sctp_pcb_h__
#define __sctp_pcb_h__
-#include <freebsd/netinet/sctp_os.h>
-#include <freebsd/netinet/sctp.h>
-#include <freebsd/netinet/sctp_constants.h>
-#include <freebsd/netinet/sctp_sysctl.h>
+#include <netinet/sctp_os.h>
+#include <netinet/sctp.h>
+#include <netinet/sctp_constants.h>
+#include <netinet/sctp_sysctl.h>
LIST_HEAD(sctppcbhead, sctp_inpcb);
LIST_HEAD(sctpasochead, sctp_tcb);
@@ -51,8 +51,8 @@ LIST_HEAD(sctp_ifalist, sctp_ifa);
TAILQ_HEAD(sctp_readhead, sctp_queued_to_read);
TAILQ_HEAD(sctp_streamhead, sctp_stream_queue_pending);
-#include <freebsd/netinet/sctp_structs.h>
-#include <freebsd/netinet/sctp_auth.h>
+#include <netinet/sctp_structs.h>
+#include <netinet/sctp_auth.h>
#define SCTP_PCBHASH_ALLADDR(port, mask) (port & mask)
#define SCTP_PCBHASH_ASOC(tag, mask) (tag & mask)
@@ -450,7 +450,7 @@ struct sctp_tcb {
-#include <freebsd/netinet/sctp_lock_bsd.h>
+#include <netinet/sctp_lock_bsd.h>
/* TODO where to put non-_KERNEL things for __Userspace__? */
diff --git a/freebsd/sys/netinet/sctp_peeloff.c b/freebsd/sys/netinet/sctp_peeloff.c
index 7b859bba..bc5f8a4f 100644
--- a/freebsd/sys/netinet/sctp_peeloff.c
+++ b/freebsd/sys/netinet/sctp_peeloff.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
@@ -33,19 +33,19 @@
/* $KAME: sctp_peeloff.c,v 1.13 2005/03/06 16:04:18 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/netinet/sctp_os.h>
-#include <freebsd/netinet/sctp_pcb.h>
-#include <freebsd/netinet/sctputil.h>
-#include <freebsd/netinet/sctp_var.h>
-#include <freebsd/netinet/sctp_var.h>
-#include <freebsd/netinet/sctp_sysctl.h>
-#include <freebsd/netinet/sctp.h>
-#include <freebsd/netinet/sctp_uio.h>
-#include <freebsd/netinet/sctp_peeloff.h>
-#include <freebsd/netinet/sctputil.h>
-#include <freebsd/netinet/sctp_auth.h>
+#include <netinet/sctp_os.h>
+#include <netinet/sctp_pcb.h>
+#include <netinet/sctputil.h>
+#include <netinet/sctp_var.h>
+#include <netinet/sctp_var.h>
+#include <netinet/sctp_sysctl.h>
+#include <netinet/sctp.h>
+#include <netinet/sctp_uio.h>
+#include <netinet/sctp_peeloff.h>
+#include <netinet/sctputil.h>
+#include <netinet/sctp_auth.h>
int
diff --git a/freebsd/sys/netinet/sctp_peeloff.h b/freebsd/sys/netinet/sctp_peeloff.h
index 57fd5fef..db61db3b 100644
--- a/freebsd/sys/netinet/sctp_peeloff.h
+++ b/freebsd/sys/netinet/sctp_peeloff.h
@@ -30,7 +30,7 @@
/* $KAME: sctp_peeloff.h,v 1.6 2005/03/06 16:04:18 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef __sctp_peeloff_h__
diff --git a/freebsd/sys/netinet/sctp_structs.h b/freebsd/sys/netinet/sctp_structs.h
index 2050c581..94d0395c 100644
--- a/freebsd/sys/netinet/sctp_structs.h
+++ b/freebsd/sys/netinet/sctp_structs.h
@@ -30,15 +30,15 @@
/* $KAME: sctp_structs.h,v 1.13 2005/03/06 16:04:18 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef __sctp_structs_h__
#define __sctp_structs_h__
-#include <freebsd/netinet/sctp_os.h>
-#include <freebsd/netinet/sctp_header.h>
-#include <freebsd/netinet/sctp_auth.h>
+#include <netinet/sctp_os.h>
+#include <netinet/sctp_header.h>
+#include <netinet/sctp_auth.h>
struct sctp_timer {
sctp_os_timer_t timer;
diff --git a/freebsd/sys/netinet/sctp_sysctl.c b/freebsd/sys/netinet/sctp_sysctl.c
index b5700e4e..6fcf4964 100644
--- a/freebsd/sys/netinet/sctp_sysctl.c
+++ b/freebsd/sys/netinet/sctp_sysctl.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2007, by Cisco Systems, Inc. All rights reserved.
@@ -30,17 +30,17 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/netinet/sctp_os.h>
-#include <freebsd/netinet/sctp.h>
-#include <freebsd/netinet/sctp_constants.h>
-#include <freebsd/netinet/sctp_sysctl.h>
-#include <freebsd/netinet/sctp_pcb.h>
-#include <freebsd/netinet/sctputil.h>
-#include <freebsd/netinet/sctp_output.h>
-#include <freebsd/sys/smp.h>
+#include <netinet/sctp_os.h>
+#include <netinet/sctp.h>
+#include <netinet/sctp_constants.h>
+#include <netinet/sctp_sysctl.h>
+#include <netinet/sctp_pcb.h>
+#include <netinet/sctputil.h>
+#include <netinet/sctp_output.h>
+#include <sys/smp.h>
/*
* sysctl tunable variables
diff --git a/freebsd/sys/netinet/sctp_sysctl.h b/freebsd/sys/netinet/sctp_sysctl.h
index 5f7f270d..9dbc9ed2 100644
--- a/freebsd/sys/netinet/sctp_sysctl.h
+++ b/freebsd/sys/netinet/sctp_sysctl.h
@@ -28,14 +28,14 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef __sctp_sysctl_h__
#define __sctp_sysctl_h__
-#include <freebsd/netinet/sctp_os.h>
-#include <freebsd/netinet/sctp_constants.h>
+#include <netinet/sctp_os.h>
+#include <netinet/sctp_constants.h>
struct sctp_sysctl {
uint32_t sctp_sendspace;
diff --git a/freebsd/sys/netinet/sctp_timer.c b/freebsd/sys/netinet/sctp_timer.c
index 090689b1..4fbded33 100644
--- a/freebsd/sys/netinet/sctp_timer.c
+++ b/freebsd/sys/netinet/sctp_timer.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
@@ -32,26 +32,26 @@
/* $KAME: sctp_timer.c,v 1.29 2005/03/06 16:04:18 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#define _IP_VHL
-#include <freebsd/netinet/sctp_os.h>
-#include <freebsd/netinet/sctp_pcb.h>
+#include <netinet/sctp_os.h>
+#include <netinet/sctp_pcb.h>
#ifdef INET6
#endif
-#include <freebsd/netinet/sctp_var.h>
-#include <freebsd/netinet/sctp_sysctl.h>
-#include <freebsd/netinet/sctp_timer.h>
-#include <freebsd/netinet/sctputil.h>
-#include <freebsd/netinet/sctp_output.h>
-#include <freebsd/netinet/sctp_header.h>
-#include <freebsd/netinet/sctp_indata.h>
-#include <freebsd/netinet/sctp_asconf.h>
-#include <freebsd/netinet/sctp_input.h>
-#include <freebsd/netinet/sctp.h>
-#include <freebsd/netinet/sctp_uio.h>
-#include <freebsd/netinet/udp.h>
+#include <netinet/sctp_var.h>
+#include <netinet/sctp_sysctl.h>
+#include <netinet/sctp_timer.h>
+#include <netinet/sctputil.h>
+#include <netinet/sctp_output.h>
+#include <netinet/sctp_header.h>
+#include <netinet/sctp_indata.h>
+#include <netinet/sctp_asconf.h>
+#include <netinet/sctp_input.h>
+#include <netinet/sctp.h>
+#include <netinet/sctp_uio.h>
+#include <netinet/udp.h>
void
diff --git a/freebsd/sys/netinet/sctp_timer.h b/freebsd/sys/netinet/sctp_timer.h
index 34abbace..a26ad728 100644
--- a/freebsd/sys/netinet/sctp_timer.h
+++ b/freebsd/sys/netinet/sctp_timer.h
@@ -29,7 +29,7 @@
*/
/* $KAME: sctp_timer.h,v 1.6 2005/03/06 16:04:18 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef __sctp_timer_h__
diff --git a/freebsd/sys/netinet/sctp_uio.h b/freebsd/sys/netinet/sctp_uio.h
index 734447ed..4d72b1ca 100644
--- a/freebsd/sys/netinet/sctp_uio.h
+++ b/freebsd/sys/netinet/sctp_uio.h
@@ -29,7 +29,7 @@
*/
/* $KAME: sctp_uio.h,v 1.11 2005/03/06 16:04:18 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef __sctp_uio_h__
@@ -37,11 +37,11 @@ __FBSDID("$FreeBSD$");
#if ! defined(_KERNEL)
-#include <freebsd/stdint.h>
+#include <stdint.h>
#endif
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/netinet/in.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
typedef uint32_t sctp_assoc_t;
@@ -999,12 +999,12 @@ union sctp_sockstore {
/***********************************/
#ifndef ntohll
-#include <freebsd/sys/endian.h>
+#include <sys/endian.h>
#define ntohll(x) be64toh(x)
#endif
#ifndef htonll
-#include <freebsd/sys/endian.h>
+#include <sys/endian.h>
#define htonll(x) htobe64(x)
#endif
/***********************************/
diff --git a/freebsd/sys/netinet/sctp_usrreq.c b/freebsd/sys/netinet/sctp_usrreq.c
index bb60795c..e901cf97 100644
--- a/freebsd/sys/netinet/sctp_usrreq.c
+++ b/freebsd/sys/netinet/sctp_usrreq.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved.
@@ -32,26 +32,26 @@
/* $KAME: sctp_usrreq.c,v 1.48 2005/03/07 23:26:08 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/netinet/sctp_os.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/netinet/sctp_pcb.h>
-#include <freebsd/netinet/sctp_header.h>
-#include <freebsd/netinet/sctp_var.h>
+#include <netinet/sctp_os.h>
+#include <sys/proc.h>
+#include <netinet/sctp_pcb.h>
+#include <netinet/sctp_header.h>
+#include <netinet/sctp_var.h>
#if defined(INET6)
#endif
-#include <freebsd/netinet/sctp_sysctl.h>
-#include <freebsd/netinet/sctp_output.h>
-#include <freebsd/netinet/sctp_uio.h>
-#include <freebsd/netinet/sctp_asconf.h>
-#include <freebsd/netinet/sctputil.h>
-#include <freebsd/netinet/sctp_indata.h>
-#include <freebsd/netinet/sctp_timer.h>
-#include <freebsd/netinet/sctp_auth.h>
-#include <freebsd/netinet/sctp_bsd_addr.h>
-#include <freebsd/netinet/sctp_cc_functions.h>
-#include <freebsd/netinet/udp.h>
+#include <netinet/sctp_sysctl.h>
+#include <netinet/sctp_output.h>
+#include <netinet/sctp_uio.h>
+#include <netinet/sctp_asconf.h>
+#include <netinet/sctputil.h>
+#include <netinet/sctp_indata.h>
+#include <netinet/sctp_timer.h>
+#include <netinet/sctp_auth.h>
+#include <netinet/sctp_bsd_addr.h>
+#include <netinet/sctp_cc_functions.h>
+#include <netinet/udp.h>
diff --git a/freebsd/sys/netinet/sctp_var.h b/freebsd/sys/netinet/sctp_var.h
index 93b92038..bff7f5de 100644
--- a/freebsd/sys/netinet/sctp_var.h
+++ b/freebsd/sys/netinet/sctp_var.h
@@ -30,13 +30,13 @@
/* $KAME: sctp_var.h,v 1.24 2005/03/06 16:04:19 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#ifndef _NETINET_SCTP_VAR_HH_
-#define _NETINET_SCTP_VAR_HH_
+#ifndef _NETINET_SCTP_VAR_H_
+#define _NETINET_SCTP_VAR_H_
-#include <freebsd/netinet/sctp_uio.h>
+#include <netinet/sctp_uio.h>
#if defined(_KERNEL) || defined(__Userspace__)
@@ -333,4 +333,4 @@ __P((struct sctp_inpcb *, struct ip *ip, struct sctphdr *,
#endif /* _KERNEL */
-#endif /* !_NETINET_SCTP_VAR_HH_ */
+#endif /* !_NETINET_SCTP_VAR_H_ */
diff --git a/freebsd/sys/netinet/sctputil.c b/freebsd/sys/netinet/sctputil.c
index 7e8ac1ea..e9a279c9 100644
--- a/freebsd/sys/netinet/sctputil.c
+++ b/freebsd/sys/netinet/sctputil.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved.
@@ -32,25 +32,25 @@
/* $KAME: sctputil.c,v 1.37 2005/03/07 23:26:09 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/netinet/sctp_os.h>
-#include <freebsd/netinet/sctp_pcb.h>
-#include <freebsd/netinet/sctputil.h>
-#include <freebsd/netinet/sctp_var.h>
-#include <freebsd/netinet/sctp_sysctl.h>
+#include <netinet/sctp_os.h>
+#include <netinet/sctp_pcb.h>
+#include <netinet/sctputil.h>
+#include <netinet/sctp_var.h>
+#include <netinet/sctp_sysctl.h>
#ifdef INET6
#endif
-#include <freebsd/netinet/sctp_header.h>
-#include <freebsd/netinet/sctp_output.h>
-#include <freebsd/netinet/sctp_uio.h>
-#include <freebsd/netinet/sctp_timer.h>
-#include <freebsd/netinet/sctp_indata.h>/* for sctp_deliver_data() */
-#include <freebsd/netinet/sctp_auth.h>
-#include <freebsd/netinet/sctp_asconf.h>
-#include <freebsd/netinet/sctp_cc_functions.h>
-#include <freebsd/netinet/sctp_bsd_addr.h>
+#include <netinet/sctp_header.h>
+#include <netinet/sctp_output.h>
+#include <netinet/sctp_uio.h>
+#include <netinet/sctp_timer.h>
+#include <netinet/sctp_indata.h>/* for sctp_deliver_data() */
+#include <netinet/sctp_auth.h>
+#include <netinet/sctp_asconf.h>
+#include <netinet/sctp_cc_functions.h>
+#include <netinet/sctp_bsd_addr.h>
#ifndef KTR_SCTP
@@ -6813,11 +6813,11 @@ sctp_log_trace(uint32_t subsys, const char *str SCTP_UNUSED, uint32_t a, uint32_
* so we can do UDP tunneling. In
* the mean-time, we return error
*/
-#include <freebsd/netinet/udp.h>
-#include <freebsd/netinet/udp_var.h>
-#include <freebsd/sys/proc.h>
+#include <netinet/udp.h>
+#include <netinet/udp_var.h>
+#include <sys/proc.h>
#ifdef INET6
-#include <freebsd/netinet6/sctp6_var.h>
+#include <netinet6/sctp6_var.h>
#endif
static void
diff --git a/freebsd/sys/netinet/sctputil.h b/freebsd/sys/netinet/sctputil.h
index b1bee3a4..d109ec23 100644
--- a/freebsd/sys/netinet/sctputil.h
+++ b/freebsd/sys/netinet/sctputil.h
@@ -31,7 +31,7 @@
/* $KAME: sctputil.h,v 1.15 2005/03/06 16:04:19 itojun Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef __sctputil_h__
#define __sctputil_h__
diff --git a/freebsd/sys/netinet/tcp.h b/freebsd/sys/netinet/tcp.h
index 19b1c57f..8779582a 100644
--- a/freebsd/sys/netinet/tcp.h
+++ b/freebsd/sys/netinet/tcp.h
@@ -1,2 +1,226 @@
-#include <freebsd/bsd.h>
-#include <freebsd/netinet/tcp.h>
+/*-
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)tcp.h 8.1 (Berkeley) 6/10/93
+ * $FreeBSD$
+ */
+
+#ifndef _NETINET_TCP_H_
+#define _NETINET_TCP_H_
+
+#include <sys/cdefs.h>
+
+#if __BSD_VISIBLE
+
+typedef u_int32_t tcp_seq;
+
+#define tcp6_seq tcp_seq /* for KAME src sync over BSD*'s */
+#define tcp6hdr tcphdr /* for KAME src sync over BSD*'s */
+
+/*
+ * TCP header.
+ * Per RFC 793, September, 1981.
+ */
+struct tcphdr {
+ u_short th_sport; /* source port */
+ u_short th_dport; /* destination port */
+ tcp_seq th_seq; /* sequence number */
+ tcp_seq th_ack; /* acknowledgement number */
+#if BYTE_ORDER == LITTLE_ENDIAN
+ u_int th_x2:4, /* (unused) */
+ th_off:4; /* data offset */
+#endif
+#if BYTE_ORDER == BIG_ENDIAN
+ u_int th_off:4, /* data offset */
+ th_x2:4; /* (unused) */
+#endif
+ u_char th_flags;
+#define TH_FIN 0x01
+#define TH_SYN 0x02
+#define TH_RST 0x04
+#define TH_PUSH 0x08
+#define TH_ACK 0x10
+#define TH_URG 0x20
+#define TH_ECE 0x40
+#define TH_CWR 0x80
+#define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_PUSH|TH_ACK|TH_URG|TH_ECE|TH_CWR)
+#define PRINT_TH_FLAGS "\20\1FIN\2SYN\3RST\4PUSH\5ACK\6URG\7ECE\10CWR"
+
+ u_short th_win; /* window */
+ u_short th_sum; /* checksum */
+ u_short th_urp; /* urgent pointer */
+};
+
+#define TCPOPT_EOL 0
+#define TCPOLEN_EOL 1
+#define TCPOPT_PAD 0 /* padding after EOL */
+#define TCPOLEN_PAD 1
+#define TCPOPT_NOP 1
+#define TCPOLEN_NOP 1
+#define TCPOPT_MAXSEG 2
+#define TCPOLEN_MAXSEG 4
+#define TCPOPT_WINDOW 3
+#define TCPOLEN_WINDOW 3
+#define TCPOPT_SACK_PERMITTED 4
+#define TCPOLEN_SACK_PERMITTED 2
+#define TCPOPT_SACK 5
+#define TCPOLEN_SACKHDR 2
+#define TCPOLEN_SACK 8 /* 2*sizeof(tcp_seq) */
+#define TCPOPT_TIMESTAMP 8
+#define TCPOLEN_TIMESTAMP 10
+#define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */
+#define TCPOPT_SIGNATURE 19 /* Keyed MD5: RFC 2385 */
+#define TCPOLEN_SIGNATURE 18
+
+/* Miscellaneous constants */
+#define MAX_SACK_BLKS 6 /* Max # SACK blocks stored at receiver side */
+#define TCP_MAX_SACK 4 /* MAX # SACKs sent in any segment */
+
+
+/*
+ * Default maximum segment size for TCP.
+ * With an IP MTU of 576, this is 536,
+ * but 512 is probably more convenient.
+ * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)).
+ */
+#define TCP_MSS 512
+/*
+ * TCP_MINMSS is defined to be 216 which is fine for the smallest
+ * link MTU (256 bytes, AX.25 packet radio) in the Internet.
+ * However it is very unlikely to come across such low MTU interfaces
+ * these days (anno dato 2003).
+ * See tcp_subr.c tcp_minmss SYSCTL declaration for more comments.
+ * Setting this to "0" disables the minmss check.
+ */
+#define TCP_MINMSS 216
+
+/*
+ * Default maximum segment size for TCP6.
+ * With an IP6 MSS of 1280, this is 1220,
+ * but 1024 is probably more convenient. (xxx kazu in doubt)
+ * This should be defined as MIN(1024, IP6_MSS - sizeof (struct tcpip6hdr))
+ */
+#define TCP6_MSS 1024
+
+#define TCP_MAXWIN 65535 /* largest value for (unscaled) window */
+#define TTCP_CLIENT_SND_WND 4096 /* dflt send window for T/TCP client */
+
+#define TCP_MAX_WINSHIFT 14 /* maximum window shift */
+
+#define TCP_MAXBURST 4 /* maximum segments in a burst */
+
+#define TCP_MAXHLEN (0xf<<2) /* max length of header in bytes */
+#define TCP_MAXOLEN (TCP_MAXHLEN - sizeof(struct tcphdr))
+ /* max space left for options */
+#endif /* __BSD_VISIBLE */
+
+/*
+ * User-settable options (used with setsockopt).
+ */
+#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */
+#if __BSD_VISIBLE
+#define TCP_MAXSEG 0x02 /* set maximum segment size */
+#define TCP_NOPUSH 0x04 /* don't push last block of write */
+#define TCP_NOOPT 0x08 /* don't use TCP options */
+#define TCP_MD5SIG 0x10 /* use MD5 digests (RFC2385) */
+#define TCP_INFO 0x20 /* retrieve tcp_info structure */
+#define TCP_CONGESTION 0x40 /* get/set congestion control algorithm */
+
+#define TCP_CA_NAME_MAX 16 /* max congestion control name length */
+
+#define TCPI_OPT_TIMESTAMPS 0x01
+#define TCPI_OPT_SACK 0x02
+#define TCPI_OPT_WSCALE 0x04
+#define TCPI_OPT_ECN 0x08
+#define TCPI_OPT_TOE 0x10
+
+/*
+ * The TCP_INFO socket option comes from the Linux 2.6 TCP API, and permits
+ * the caller to query certain information about the state of a TCP
+ * connection. We provide an overlapping set of fields with the Linux
+ * implementation, but since this is a fixed size structure, room has been
+ * left for growth. In order to maximize potential future compatibility with
+ * the Linux API, the same variable names and order have been adopted, and
+ * padding left to make room for omitted fields in case they are added later.
+ *
+ * XXX: This is currently an unstable ABI/API, in that it is expected to
+ * change.
+ */
+struct tcp_info {
+ u_int8_t tcpi_state; /* TCP FSM state. */
+ u_int8_t __tcpi_ca_state;
+ u_int8_t __tcpi_retransmits;
+ u_int8_t __tcpi_probes;
+ u_int8_t __tcpi_backoff;
+ u_int8_t tcpi_options; /* Options enabled on conn. */
+ u_int8_t tcpi_snd_wscale:4, /* RFC1323 send shift value. */
+ tcpi_rcv_wscale:4; /* RFC1323 recv shift value. */
+
+ u_int32_t tcpi_rto; /* Retransmission timeout (usec). */
+ u_int32_t __tcpi_ato;
+ u_int32_t tcpi_snd_mss; /* Max segment size for send. */
+ u_int32_t tcpi_rcv_mss; /* Max segment size for receive. */
+
+ u_int32_t __tcpi_unacked;
+ u_int32_t __tcpi_sacked;
+ u_int32_t __tcpi_lost;
+ u_int32_t __tcpi_retrans;
+ u_int32_t __tcpi_fackets;
+
+ /* Times; measurements in usecs. */
+ u_int32_t __tcpi_last_data_sent;
+ u_int32_t __tcpi_last_ack_sent; /* Also unimpl. on Linux? */
+ u_int32_t tcpi_last_data_recv; /* Time since last recv data. */
+ u_int32_t __tcpi_last_ack_recv;
+
+ /* Metrics; variable units. */
+ u_int32_t __tcpi_pmtu;
+ u_int32_t __tcpi_rcv_ssthresh;
+ u_int32_t tcpi_rtt; /* Smoothed RTT in usecs. */
+ u_int32_t tcpi_rttvar; /* RTT variance in usecs. */
+ u_int32_t tcpi_snd_ssthresh; /* Slow start threshold. */
+ u_int32_t tcpi_snd_cwnd; /* Send congestion window. */
+ u_int32_t __tcpi_advmss;
+ u_int32_t __tcpi_reordering;
+
+ u_int32_t __tcpi_rcv_rtt;
+ u_int32_t tcpi_rcv_space; /* Advertised recv window. */
+
+ /* FreeBSD extensions to tcp_info. */
+ u_int32_t tcpi_snd_wnd; /* Advertised send window. */
+ u_int32_t tcpi_snd_bwnd; /* Bandwidth send window. */
+ u_int32_t tcpi_snd_nxt; /* Next egress seqno */
+ u_int32_t tcpi_rcv_nxt; /* Next ingress seqno */
+ u_int32_t tcpi_toe_tid; /* HWTID for TOE endpoints */
+
+ /* Padding to grow without breaking ABI. */
+ u_int32_t __tcpi_pad[29]; /* Padding. */
+};
+#endif
+
+#endif /* !_NETINET_TCP_H_ */
diff --git a/freebsd/sys/netinet/tcp_debug.c b/freebsd/sys/netinet/tcp_debug.c
index 52a82193..5d4b992a 100644
--- a/freebsd/sys/netinet/tcp_debug.c
+++ b/freebsd/sys/netinet/tcp_debug.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1993
@@ -32,12 +32,12 @@
* @(#)tcp_debug.c 8.1 (Berkeley) 6/10/93
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_tcpdebug.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_tcpdebug.h>
#ifdef TCPDEBUG
/* load symbolic names */
@@ -47,28 +47,28 @@ __FBSDID("$FreeBSD$");
#define TANAMES
#endif
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mbuf.h>
+#include <sys/mutex.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
+#include <netinet/ip6.h>
#endif
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/tcp_fsm.h>
-#include <freebsd/netinet/tcp_timer.h>
-#include <freebsd/netinet/tcp_var.h>
-#include <freebsd/netinet/tcpip.h>
-#include <freebsd/netinet/tcp_debug.h>
+#include <netinet/ip_var.h>
+#include <netinet/tcp.h>
+#include <netinet/tcp_fsm.h>
+#include <netinet/tcp_timer.h>
+#include <netinet/tcp_var.h>
+#include <netinet/tcpip.h>
+#include <netinet/tcp_debug.h>
#ifdef TCPDEBUG
static int tcpconsdebug = 0;
diff --git a/freebsd/sys/netinet/tcp_debug.h b/freebsd/sys/netinet/tcp_debug.h
index 0c103958..c4d38da9 100644
--- a/freebsd/sys/netinet/tcp_debug.h
+++ b/freebsd/sys/netinet/tcp_debug.h
@@ -30,8 +30,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET_TCP_DEBUG_HH_
-#define _NETINET_TCP_DEBUG_HH_
+#ifndef _NETINET_TCP_DEBUG_H_
+#define _NETINET_TCP_DEBUG_H_
struct tcp_debug {
uint32_t td_time; /* network format */
@@ -77,4 +77,4 @@ struct tcp_debug tcp_debug[TCP_NDEBUG];
int tcp_debx;
#endif
-#endif /* !_NETINET_TCP_DEBUG_HH_ */
+#endif /* !_NETINET_TCP_DEBUG_H_ */
diff --git a/freebsd/sys/netinet/tcp_fsm.h b/freebsd/sys/netinet/tcp_fsm.h
index 253e53d4..61fd0c1f 100644
--- a/freebsd/sys/netinet/tcp_fsm.h
+++ b/freebsd/sys/netinet/tcp_fsm.h
@@ -31,8 +31,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET_TCP_FSM_HH_
-#define _NETINET_TCP_FSM_HH_
+#ifndef _NETINET_TCP_FSM_H_
+#define _NETINET_TCP_FSM_H_
/*
* TCP FSM state definitions.
diff --git a/freebsd/sys/netinet/tcp_hostcache.c b/freebsd/sys/netinet/tcp_hostcache.c
index 07b78cfe..352df1dd 100644
--- a/freebsd/sys/netinet/tcp_hostcache.c
+++ b/freebsd/sys/netinet/tcp_hostcache.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2002 Andre Oppermann, Internet Business Solutions AG
@@ -64,43 +64,43 @@
* followed here.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/ip_var.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/malloc.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sysctl.h>
+
+#include <net/if.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/in_var.h>
+#include <netinet/in_pcb.h>
+#include <netinet/ip_var.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
#endif
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/tcp_var.h>
-#include <freebsd/netinet/tcp_hostcache.h>
+#include <netinet/tcp.h>
+#include <netinet/tcp_var.h>
+#include <netinet/tcp_hostcache.h>
#ifdef INET6
-#include <freebsd/netinet6/tcp6_var.h>
+#include <netinet6/tcp6_var.h>
#endif
-#include <freebsd/vm/uma.h>
+#include <vm/uma.h>
/* Arbitrary values */
#define TCP_HOSTCACHE_HASHSIZE 512
diff --git a/freebsd/sys/netinet/tcp_hostcache.h b/freebsd/sys/netinet/tcp_hostcache.h
index a494ed03..8569edcc 100644
--- a/freebsd/sys/netinet/tcp_hostcache.h
+++ b/freebsd/sys/netinet/tcp_hostcache.h
@@ -34,8 +34,8 @@
* followed here.
*/
-#ifndef _NETINET_TCP_HOSTCACHE_HH_
-#define _NETINET_TCP_HOSTCACHE_HH_
+#ifndef _NETINET_TCP_HOSTCACHE_H_
+#define _NETINET_TCP_HOSTCACHE_H_
TAILQ_HEAD(hc_qhead, hc_metrics);
@@ -79,4 +79,4 @@ struct tcp_hostcache {
int purgeall;
};
-#endif /* !_NETINET_TCP_HOSTCACHE_HH_*/
+#endif /* !_NETINET_TCP_HOSTCACHE_H_*/
diff --git a/freebsd/sys/netinet/tcp_input.c b/freebsd/sys/netinet/tcp_input.c
index 85daf203..8feb571f 100644
--- a/freebsd/sys/netinet/tcp_input.c
+++ b/freebsd/sys/netinet/tcp_input.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 1995
@@ -31,72 +31,72 @@
* @(#)tcp_input.c 8.12 (Berkeley) 5/24/95
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_ipfw.h> /* for ipfw_fwd */
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipsec.h>
-#include <freebsd/local/opt_tcpdebug.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/proc.h> /* for proc0 declaration */
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/systm.h>
-
-#include <freebsd/machine/cpu.h> /* before tcp_seq.h, for tcp_random18() */
-
-#include <freebsd/vm/uma.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
+#include <rtems/bsd/local/opt_ipfw.h> /* for ipfw_fwd */
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+#include <rtems/bsd/local/opt_tcpdebug.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/proc.h> /* for proc0 declaration */
+#include <sys/protosw.h>
+#include <sys/signalvar.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sysctl.h>
+#include <sys/syslog.h>
+#include <sys/systm.h>
+
+#include <machine/cpu.h> /* before tcp_seq.h, for tcp_random18() */
+
+#include <vm/uma.h>
+
+#include <net/if.h>
+#include <net/route.h>
+#include <net/vnet.h>
#define TCPSTATES /* for logging */
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_icmp.h> /* required for icmp_var.h */
-#include <freebsd/netinet/icmp_var.h> /* for ICMP_BANDLIM */
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_options.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet/icmp6.h>
-#include <freebsd/netinet6/in6_pcb.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/nd6.h>
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/tcp_fsm.h>
-#include <freebsd/netinet/tcp_seq.h>
-#include <freebsd/netinet/tcp_timer.h>
-#include <freebsd/netinet/tcp_var.h>
-#include <freebsd/netinet6/tcp6_var.h>
-#include <freebsd/netinet/tcpip.h>
-#include <freebsd/netinet/tcp_syncache.h>
+#include <netinet/in.h>
+#include <netinet/in_pcb.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/ip.h>
+#include <netinet/ip_icmp.h> /* required for icmp_var.h */
+#include <netinet/icmp_var.h> /* for ICMP_BANDLIM */
+#include <netinet/ip_var.h>
+#include <netinet/ip_options.h>
+#include <netinet/ip6.h>
+#include <netinet/icmp6.h>
+#include <netinet6/in6_pcb.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/nd6.h>
+#include <netinet/tcp.h>
+#include <netinet/tcp_fsm.h>
+#include <netinet/tcp_seq.h>
+#include <netinet/tcp_timer.h>
+#include <netinet/tcp_var.h>
+#include <netinet6/tcp6_var.h>
+#include <netinet/tcpip.h>
+#include <netinet/tcp_syncache.h>
#ifdef TCPDEBUG
-#include <freebsd/netinet/tcp_debug.h>
+#include <netinet/tcp_debug.h>
#endif /* TCPDEBUG */
#ifdef IPSEC
-#include <freebsd/netipsec/ipsec.h>
-#include <freebsd/netipsec/ipsec6.h>
+#include <netipsec/ipsec.h>
+#include <netipsec/ipsec6.h>
#endif /*IPSEC*/
-#include <freebsd/machine/in_cksum.h>
+#include <machine/in_cksum.h>
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
static const int tcprexmtthresh = 3;
diff --git a/freebsd/sys/netinet/tcp_lro.c b/freebsd/sys/netinet/tcp_lro.c
index 6aaff4a5..bbb98e60 100644
--- a/freebsd/sys/netinet/tcp_lro.c
+++ b/freebsd/sys/netinet/tcp_lro.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/******************************************************************************
@@ -35,25 +35,25 @@ POSSIBILITY OF SUCH DAMAGE.
$FreeBSD$
***************************************************************************/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/endian.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/socket.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/ethernet.h>
-#include <freebsd/net/if_media.h>
-
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/tcp_lro.h>
-
-#include <freebsd/machine/bus.h>
-#include <freebsd/machine/in_cksum.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/endian.h>
+#include <sys/mbuf.h>
+#include <sys/kernel.h>
+#include <sys/socket.h>
+
+#include <net/if.h>
+#include <net/ethernet.h>
+#include <net/if_media.h>
+
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <netinet/tcp.h>
+#include <netinet/tcp_lro.h>
+
+#include <machine/bus.h>
+#include <machine/in_cksum.h>
static uint16_t do_csum_data(uint16_t *raw, int len)
diff --git a/freebsd/sys/netinet/tcp_lro.h b/freebsd/sys/netinet/tcp_lro.h
index 20cfb7cf..08aac690 100644
--- a/freebsd/sys/netinet/tcp_lro.h
+++ b/freebsd/sys/netinet/tcp_lro.h
@@ -34,8 +34,8 @@ POSSIBILITY OF SUCH DAMAGE.
$FreeBSD$
***************************************************************************/
-#ifndef _TCP_LRO_HH_
-#define _TCP_LRO_HH_
+#ifndef _TCP_LRO_H_
+#define _TCP_LRO_H_
struct lro_entry;
struct lro_entry
@@ -82,4 +82,4 @@ int tcp_lro_rx(struct lro_ctrl *, struct mbuf *, uint32_t);
/* Number of LRO entries - these are per rx queue */
#define LRO_ENTRIES 8
-#endif /* _TCP_LRO_HH_ */
+#endif /* _TCP_LRO_H_ */
diff --git a/freebsd/sys/netinet/tcp_offload.c b/freebsd/sys/netinet/tcp_offload.c
index 9c73992b..3c663a47 100644
--- a/freebsd/sys/netinet/tcp_offload.c
+++ b/freebsd/sys/netinet/tcp_offload.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2007, Chelsio Inc.
@@ -27,32 +27,32 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_var.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/tcp_var.h>
-#include <freebsd/netinet/tcp_offload.h>
-#include <freebsd/netinet/toedev.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+
+#include <net/if.h>
+#include <net/if_types.h>
+#include <net/if_var.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_pcb.h>
+#include <netinet/tcp.h>
+#include <netinet/tcp_var.h>
+#include <netinet/tcp_offload.h>
+#include <netinet/toedev.h>
uint32_t toedev_registration_count;
diff --git a/freebsd/sys/netinet/tcp_offload.h b/freebsd/sys/netinet/tcp_offload.h
index f2a35a58..48f35ff6 100644
--- a/freebsd/sys/netinet/tcp_offload.h
+++ b/freebsd/sys/netinet/tcp_offload.h
@@ -27,8 +27,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET_TCP_OFFLOAD_HH_
-#define _NETINET_TCP_OFFLOAD_HH_
+#ifndef _NETINET_TCP_OFFLOAD_H_
+#define _NETINET_TCP_OFFLOAD_H_
#ifndef _KERNEL
#error "no user-serviceable parts inside"
@@ -247,7 +247,7 @@ int tcp_offload_connect(struct socket *so, struct sockaddr *nam);
* hackish way of allowing this file to also be included by TOE
* which needs to be kept ignorant of socket implementation details
*/
-#ifdef _SYS_SOCKETVAR_HH_
+#ifdef _SYS_SOCKETVAR_H_
/*
* The socket has not been marked as "do not offload"
*/
@@ -344,11 +344,11 @@ tcp_offload_listen_close(struct tcpcb *tp)
#endif
}
#undef SO_OFFLOADABLE
-#endif /* _SYS_SOCKETVAR_HH_ */
+#endif /* _SYS_SOCKETVAR_H_ */
#undef tp_offload
void tcp_offload_twstart(struct tcpcb *tp);
struct tcpcb *tcp_offload_close(struct tcpcb *tp);
struct tcpcb *tcp_offload_drop(struct tcpcb *tp, int error);
-#endif /* _NETINET_TCP_OFFLOAD_HH_ */
+#endif /* _NETINET_TCP_OFFLOAD_H_ */
diff --git a/freebsd/sys/netinet/tcp_output.c b/freebsd/sys/netinet/tcp_output.c
index bebab1f1..55a1f6e4 100644
--- a/freebsd/sys/netinet/tcp_output.c
+++ b/freebsd/sys/netinet/tcp_output.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
@@ -31,59 +31,59 @@
* @(#)tcp_output.c 8.4 (Berkeley) 5/24/95
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipsec.h>
-#include <freebsd/local/opt_tcpdebug.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_options.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+#include <rtems/bsd/local/opt_tcpdebug.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/domain.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mbuf.h>
+#include <sys/mutex.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sysctl.h>
+
+#include <net/if.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/in_pcb.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_options.h>
#ifdef INET6
-#include <freebsd/netinet6/in6_pcb.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
+#include <netinet6/in6_pcb.h>
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
#endif
-#include <freebsd/netinet/tcp.h>
+#include <netinet/tcp.h>
#define TCPOUTFLAGS
-#include <freebsd/netinet/tcp_fsm.h>
-#include <freebsd/netinet/tcp_seq.h>
-#include <freebsd/netinet/tcp_timer.h>
-#include <freebsd/netinet/tcp_var.h>
-#include <freebsd/netinet/tcpip.h>
+#include <netinet/tcp_fsm.h>
+#include <netinet/tcp_seq.h>
+#include <netinet/tcp_timer.h>
+#include <netinet/tcp_var.h>
+#include <netinet/tcpip.h>
#ifdef TCPDEBUG
-#include <freebsd/netinet/tcp_debug.h>
+#include <netinet/tcp_debug.h>
#endif
#ifdef IPSEC
-#include <freebsd/netipsec/ipsec.h>
+#include <netipsec/ipsec.h>
#endif /*IPSEC*/
-#include <freebsd/machine/in_cksum.h>
+#include <machine/in_cksum.h>
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
#ifdef notyet
extern struct mbuf *m_copypack();
diff --git a/freebsd/sys/netinet/tcp_reass.c b/freebsd/sys/netinet/tcp_reass.c
index aea58740..64aeca84 100644
--- a/freebsd/sys/netinet/tcp_reass.c
+++ b/freebsd/sys/netinet/tcp_reass.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 1995
@@ -31,49 +31,49 @@
* @(#)tcp_input.c 8.12 (Berkeley) 5/24/95
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_tcpdebug.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/systm.h>
-
-#include <freebsd/vm/uma.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_options.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/in6_pcb.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/nd6.h>
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/tcp_fsm.h>
-#include <freebsd/netinet/tcp_seq.h>
-#include <freebsd/netinet/tcp_timer.h>
-#include <freebsd/netinet/tcp_var.h>
-#include <freebsd/netinet6/tcp6_var.h>
-#include <freebsd/netinet/tcpip.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_tcpdebug.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sysctl.h>
+#include <sys/syslog.h>
+#include <sys/systm.h>
+
+#include <vm/uma.h>
+
+#include <net/if.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_pcb.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_options.h>
+#include <netinet/ip6.h>
+#include <netinet6/in6_pcb.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/nd6.h>
+#include <netinet/tcp.h>
+#include <netinet/tcp_fsm.h>
+#include <netinet/tcp_seq.h>
+#include <netinet/tcp_timer.h>
+#include <netinet/tcp_var.h>
+#include <netinet6/tcp6_var.h>
+#include <netinet/tcpip.h>
#ifdef TCPDEBUG
-#include <freebsd/netinet/tcp_debug.h>
+#include <netinet/tcp_debug.h>
#endif /* TCPDEBUG */
static int tcp_reass_sysctl_maxseg(SYSCTL_HANDLER_ARGS);
diff --git a/freebsd/sys/netinet/tcp_sack.c b/freebsd/sys/netinet/tcp_sack.c
index 94bae57b..7a7df0bb 100644
--- a/freebsd/sys/netinet/tcp_sack.c
+++ b/freebsd/sys/netinet/tcp_sack.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 1995
@@ -72,57 +72,57 @@
* Research Laboratory (NRL).
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_tcpdebug.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/proc.h> /* for proc0 declaration */
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/systm.h>
-
-#include <freebsd/machine/cpu.h> /* before tcp_seq.h, for tcp_random18() */
-
-#include <freebsd/vm/uma.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet/icmp6.h>
-#include <freebsd/netinet6/nd6.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/in6_pcb.h>
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/tcp_fsm.h>
-#include <freebsd/netinet/tcp_seq.h>
-#include <freebsd/netinet/tcp_timer.h>
-#include <freebsd/netinet/tcp_var.h>
-#include <freebsd/netinet6/tcp6_var.h>
-#include <freebsd/netinet/tcpip.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_tcpdebug.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/proc.h> /* for proc0 declaration */
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/syslog.h>
+#include <sys/systm.h>
+
+#include <machine/cpu.h> /* before tcp_seq.h, for tcp_random18() */
+
+#include <vm/uma.h>
+
+#include <net/if.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/in_var.h>
+#include <netinet/in_pcb.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip6.h>
+#include <netinet/icmp6.h>
+#include <netinet6/nd6.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/in6_pcb.h>
+#include <netinet/tcp.h>
+#include <netinet/tcp_fsm.h>
+#include <netinet/tcp_seq.h>
+#include <netinet/tcp_timer.h>
+#include <netinet/tcp_var.h>
+#include <netinet6/tcp6_var.h>
+#include <netinet/tcpip.h>
#ifdef TCPDEBUG
-#include <freebsd/netinet/tcp_debug.h>
+#include <netinet/tcp_debug.h>
#endif /* TCPDEBUG */
-#include <freebsd/machine/in_cksum.h>
+#include <machine/in_cksum.h>
VNET_DECLARE(struct uma_zone *, sack_hole_zone);
#define V_sack_hole_zone VNET(sack_hole_zone)
diff --git a/freebsd/sys/netinet/tcp_seq.h b/freebsd/sys/netinet/tcp_seq.h
index 8af7b0ab..f58b537c 100644
--- a/freebsd/sys/netinet/tcp_seq.h
+++ b/freebsd/sys/netinet/tcp_seq.h
@@ -30,8 +30,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET_TCP_SEQ_HH_
-#define _NETINET_TCP_SEQ_HH_
+#ifndef _NETINET_TCP_SEQ_H_
+#define _NETINET_TCP_SEQ_H_
/*
* TCP sequence numbers are 32 bit integers operated
* on with modular arithmetic. These macros can be
@@ -65,4 +65,4 @@
#define TCP_PAWS_IDLE (24 * 24 * 60 * 60 * hz)
/* timestamp wrap-around time */
-#endif /* _NETINET_TCP_SEQ_HH_ */
+#endif /* _NETINET_TCP_SEQ_H_ */
diff --git a/freebsd/sys/netinet/tcp_subr.c b/freebsd/sys/netinet/tcp_subr.c
index 83777450..55e5806f 100644
--- a/freebsd/sys/netinet/tcp_subr.c
+++ b/freebsd/sys/netinet/tcp_subr.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
@@ -31,87 +31,87 @@
* @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_compat.h>
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipsec.h>
-#include <freebsd/local/opt_tcpdebug.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
+#include <rtems/bsd/local/opt_compat.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+#include <rtems/bsd/local/opt_tcpdebug.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/callout.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
+#include <sys/jail.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
#ifdef INET6
-#include <freebsd/sys/domain.h>
+#include <sys/domain.h>
#endif
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/random.h>
-
-#include <freebsd/vm/uma.h>
-
-#include <freebsd/net/route.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/protosw.h>
+#include <sys/random.h>
+
+#include <vm/uma.h>
+
+#include <net/route.h>
+#include <net/if.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
+#include <netinet/ip6.h>
#endif
-#include <freebsd/netinet/in_pcb.h>
+#include <netinet/in_pcb.h>
#ifdef INET6
-#include <freebsd/netinet6/in6_pcb.h>
+#include <netinet6/in6_pcb.h>
#endif
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip_var.h>
+#include <netinet/in_var.h>
+#include <netinet/ip_var.h>
#ifdef INET6
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/scope6_var.h>
-#include <freebsd/netinet6/nd6.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/scope6_var.h>
+#include <netinet6/nd6.h>
#endif
-#include <freebsd/netinet/ip_icmp.h>
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/tcp_fsm.h>
-#include <freebsd/netinet/tcp_seq.h>
-#include <freebsd/netinet/tcp_timer.h>
-#include <freebsd/netinet/tcp_var.h>
-#include <freebsd/netinet/tcp_syncache.h>
-#include <freebsd/netinet/tcp_offload.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/tcp.h>
+#include <netinet/tcp_fsm.h>
+#include <netinet/tcp_seq.h>
+#include <netinet/tcp_timer.h>
+#include <netinet/tcp_var.h>
+#include <netinet/tcp_syncache.h>
+#include <netinet/tcp_offload.h>
#ifdef INET6
-#include <freebsd/netinet6/tcp6_var.h>
+#include <netinet6/tcp6_var.h>
#endif
-#include <freebsd/netinet/tcpip.h>
+#include <netinet/tcpip.h>
#ifdef TCPDEBUG
-#include <freebsd/netinet/tcp_debug.h>
+#include <netinet/tcp_debug.h>
#endif
-#include <freebsd/netinet6/ip6protosw.h>
+#include <netinet6/ip6protosw.h>
#ifdef IPSEC
-#include <freebsd/netipsec/ipsec.h>
-#include <freebsd/netipsec/xform.h>
+#include <netipsec/ipsec.h>
+#include <netipsec/xform.h>
#ifdef INET6
-#include <freebsd/netipsec/ipsec6.h>
+#include <netipsec/ipsec6.h>
#endif
-#include <freebsd/netipsec/key.h>
-#include <freebsd/sys/syslog.h>
+#include <netipsec/key.h>
+#include <sys/syslog.h>
#endif /*IPSEC*/
-#include <freebsd/machine/in_cksum.h>
-#include <freebsd/sys/md5.h>
+#include <machine/in_cksum.h>
+#include <sys/md5.h>
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
VNET_DEFINE(int, tcp_mssdflt) = TCP_MSS;
#ifdef INET6
diff --git a/freebsd/sys/netinet/tcp_syncache.c b/freebsd/sys/netinet/tcp_syncache.c
index 78790cc8..04f321ab 100644
--- a/freebsd/sys/netinet/tcp_syncache.c
+++ b/freebsd/sys/netinet/tcp_syncache.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001 McAfee, Inc.
@@ -32,72 +32,72 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipsec.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/limits.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/md5.h>
-#include <freebsd/sys/proc.h> /* for proc0 declaration */
-#include <freebsd/sys/random.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/ucred.h>
-
-#include <freebsd/vm/uma.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_options.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
+#include <sys/limits.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/md5.h>
+#include <sys/proc.h> /* for proc0 declaration */
+#include <sys/random.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/syslog.h>
+#include <sys/ucred.h>
+
+#include <vm/uma.h>
+
+#include <net/if.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/in_var.h>
+#include <netinet/in_pcb.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_options.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet/icmp6.h>
-#include <freebsd/netinet6/nd6.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/in6_pcb.h>
+#include <netinet/ip6.h>
+#include <netinet/icmp6.h>
+#include <netinet6/nd6.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/in6_pcb.h>
#endif
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/tcp_fsm.h>
-#include <freebsd/netinet/tcp_seq.h>
-#include <freebsd/netinet/tcp_timer.h>
-#include <freebsd/netinet/tcp_var.h>
-#include <freebsd/netinet/tcp_syncache.h>
-#include <freebsd/netinet/tcp_offload.h>
+#include <netinet/tcp.h>
+#include <netinet/tcp_fsm.h>
+#include <netinet/tcp_seq.h>
+#include <netinet/tcp_timer.h>
+#include <netinet/tcp_var.h>
+#include <netinet/tcp_syncache.h>
+#include <netinet/tcp_offload.h>
#ifdef INET6
-#include <freebsd/netinet6/tcp6_var.h>
+#include <netinet6/tcp6_var.h>
#endif
#ifdef IPSEC
-#include <freebsd/netipsec/ipsec.h>
+#include <netipsec/ipsec.h>
#ifdef INET6
-#include <freebsd/netipsec/ipsec6.h>
+#include <netipsec/ipsec6.h>
#endif
-#include <freebsd/netipsec/key.h>
+#include <netipsec/key.h>
#endif /*IPSEC*/
-#include <freebsd/machine/in_cksum.h>
+#include <machine/in_cksum.h>
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
static VNET_DEFINE(int, tcp_syncookies) = 1;
#define V_tcp_syncookies VNET(tcp_syncookies)
diff --git a/freebsd/sys/netinet/tcp_syncache.h b/freebsd/sys/netinet/tcp_syncache.h
index 96ba1535..93c7aaa2 100644
--- a/freebsd/sys/netinet/tcp_syncache.h
+++ b/freebsd/sys/netinet/tcp_syncache.h
@@ -30,8 +30,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET_TCP_SYNCACHE_HH_
-#define _NETINET_TCP_SYNCACHE_HH_
+#ifndef _NETINET_TCP_SYNCACHE_H_
+#define _NETINET_TCP_SYNCACHE_H_
#ifdef _KERNEL
struct toeopt;
@@ -124,4 +124,4 @@ struct tcp_syncache {
};
#endif /* _KERNEL */
-#endif /* !_NETINET_TCP_SYNCACHE_HH_ */
+#endif /* !_NETINET_TCP_SYNCACHE_H_ */
diff --git a/freebsd/sys/netinet/tcp_timer.c b/freebsd/sys/netinet/tcp_timer.c
index 36e2bec2..cbf9206f 100644
--- a/freebsd/sys/netinet/tcp_timer.c
+++ b/freebsd/sys/netinet/tcp_timer.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
@@ -31,41 +31,41 @@
* @(#)tcp_timer.c 8.2 (Berkeley) 5/24/95
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_tcpdebug.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/systm.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/in_systm.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_tcpdebug.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mbuf.h>
+#include <sys/mutex.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sysctl.h>
+#include <sys/systm.h>
+
+#include <net/if.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_pcb.h>
+#include <netinet/in_systm.h>
#ifdef INET6
-#include <freebsd/netinet6/in6_pcb.h>
+#include <netinet6/in6_pcb.h>
#endif
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/tcp_fsm.h>
-#include <freebsd/netinet/tcp_timer.h>
-#include <freebsd/netinet/tcp_var.h>
-#include <freebsd/netinet/tcpip.h>
+#include <netinet/ip_var.h>
+#include <netinet/tcp.h>
+#include <netinet/tcp_fsm.h>
+#include <netinet/tcp_timer.h>
+#include <netinet/tcp_var.h>
+#include <netinet/tcpip.h>
#ifdef TCPDEBUG
-#include <freebsd/netinet/tcp_debug.h>
+#include <netinet/tcp_debug.h>
#endif
int tcp_keepinit;
diff --git a/freebsd/sys/netinet/tcp_timer.h b/freebsd/sys/netinet/tcp_timer.h
index 1514a293..ff455b6b 100644
--- a/freebsd/sys/netinet/tcp_timer.h
+++ b/freebsd/sys/netinet/tcp_timer.h
@@ -30,8 +30,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET_TCP_TIMER_HH_
-#define _NETINET_TCP_TIMER_HH_
+#ifndef _NETINET_TCP_TIMER_H_
+#define _NETINET_TCP_TIMER_H_
/*
* The TCPT_REXMT timer is used to force retransmissions.
@@ -180,4 +180,4 @@ void tcp_timer_delack(void *xtp);
#endif /* _KERNEL */
-#endif /* !_NETINET_TCP_TIMER_HH_ */
+#endif /* !_NETINET_TCP_TIMER_H_ */
diff --git a/freebsd/sys/netinet/tcp_timewait.c b/freebsd/sys/netinet/tcp_timewait.c
index 92643d0a..de321e3f 100644
--- a/freebsd/sys/netinet/tcp_timewait.c
+++ b/freebsd/sys/netinet/tcp_timewait.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
@@ -31,68 +31,68 @@
* @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_tcpdebug.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/random.h>
-
-#include <freebsd/vm/uma.h>
-
-#include <freebsd/net/route.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_tcpdebug.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/callout.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/protosw.h>
+#include <sys/random.h>
+
+#include <vm/uma.h>
+
+#include <net/route.h>
+#include <net/if.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
+#include <netinet/ip6.h>
#endif
-#include <freebsd/netinet/in_pcb.h>
+#include <netinet/in_pcb.h>
#ifdef INET6
-#include <freebsd/netinet6/in6_pcb.h>
+#include <netinet6/in6_pcb.h>
#endif
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip_var.h>
+#include <netinet/in_var.h>
+#include <netinet/ip_var.h>
#ifdef INET6
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/scope6_var.h>
-#include <freebsd/netinet6/nd6.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/scope6_var.h>
+#include <netinet6/nd6.h>
#endif
-#include <freebsd/netinet/ip_icmp.h>
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/tcp_fsm.h>
-#include <freebsd/netinet/tcp_seq.h>
-#include <freebsd/netinet/tcp_timer.h>
-#include <freebsd/netinet/tcp_var.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/tcp.h>
+#include <netinet/tcp_fsm.h>
+#include <netinet/tcp_seq.h>
+#include <netinet/tcp_timer.h>
+#include <netinet/tcp_var.h>
#ifdef INET6
-#include <freebsd/netinet6/tcp6_var.h>
+#include <netinet6/tcp6_var.h>
#endif
-#include <freebsd/netinet/tcpip.h>
+#include <netinet/tcpip.h>
#ifdef TCPDEBUG
-#include <freebsd/netinet/tcp_debug.h>
+#include <netinet/tcp_debug.h>
#endif
-#include <freebsd/netinet6/ip6protosw.h>
+#include <netinet6/ip6protosw.h>
-#include <freebsd/machine/in_cksum.h>
+#include <machine/in_cksum.h>
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
static VNET_DEFINE(uma_zone_t, tcptw_zone);
#define V_tcptw_zone VNET(tcptw_zone)
diff --git a/freebsd/sys/netinet/tcp_usrreq.c b/freebsd/sys/netinet/tcp_usrreq.c
index fc083e05..3d803987 100644
--- a/freebsd/sys/netinet/tcp_usrreq.c
+++ b/freebsd/sys/netinet/tcp_usrreq.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1988, 1993
@@ -33,62 +33,62 @@
* From: @(#)tcp_usrreq.c 8.2 (Berkeley) 1/3/94
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_ddb.h>
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_tcpdebug.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/mbuf.h>
+#include <rtems/bsd/local/opt_ddb.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_tcpdebug.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
+#include <sys/mbuf.h>
#ifdef INET6
-#include <freebsd/sys/domain.h>
+#include <sys/domain.h>
#endif /* INET6 */
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/jail.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/protosw.h>
+#include <sys/proc.h>
+#include <sys/jail.h>
#ifdef DDB
-#include <freebsd/ddb/ddb.h>
+#include <ddb/ddb.h>
#endif
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
+#include <net/if.h>
+#include <net/route.h>
+#include <net/vnet.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
+#include <netinet/ip6.h>
#endif
-#include <freebsd/netinet/in_pcb.h>
+#include <netinet/in_pcb.h>
#ifdef INET6
-#include <freebsd/netinet6/in6_pcb.h>
+#include <netinet6/in6_pcb.h>
#endif
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip_var.h>
+#include <netinet/in_var.h>
+#include <netinet/ip_var.h>
#ifdef INET6
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/scope6_var.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/scope6_var.h>
#endif
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/tcp_fsm.h>
-#include <freebsd/netinet/tcp_seq.h>
-#include <freebsd/netinet/tcp_timer.h>
-#include <freebsd/netinet/tcp_var.h>
-#include <freebsd/netinet/tcpip.h>
+#include <netinet/tcp.h>
+#include <netinet/tcp_fsm.h>
+#include <netinet/tcp_seq.h>
+#include <netinet/tcp_timer.h>
+#include <netinet/tcp_var.h>
+#include <netinet/tcpip.h>
#ifdef TCPDEBUG
-#include <freebsd/netinet/tcp_debug.h>
+#include <netinet/tcp_debug.h>
#endif
-#include <freebsd/netinet/tcp_offload.h>
+#include <netinet/tcp_offload.h>
/*
* TCP protocol interface to socket abstraction.
diff --git a/freebsd/sys/netinet/tcp_var.h b/freebsd/sys/netinet/tcp_var.h
index 77586144..9de0ca89 100644
--- a/freebsd/sys/netinet/tcp_var.h
+++ b/freebsd/sys/netinet/tcp_var.h
@@ -30,13 +30,13 @@
* $FreeBSD$
*/
-#ifndef _NETINET_TCP_VAR_HH_
-#define _NETINET_TCP_VAR_HH_
+#ifndef _NETINET_TCP_VAR_H_
+#define _NETINET_TCP_VAR_H_
-#include <freebsd/netinet/tcp.h>
+#include <netinet/tcp.h>
#ifdef _KERNEL
-#include <freebsd/net/vnet.h>
+#include <net/vnet.h>
/*
* Kernel variables for tcp.
@@ -298,9 +298,9 @@ struct hc_metrics_lite { /* must stay in sync with hc_metrics */
u_long rmx_recvpipe; /* inbound delay-bandwidth product */
};
-#ifndef _NETINET_IN_PCB_HH_
+#ifndef _NETINET_IN_PCB_H_
struct in_conninfo;
-#endif /* _NETINET_IN_PCB_HH_ */
+#endif /* _NETINET_IN_PCB_H_ */
struct tcptw {
struct inpcb *tw_inpcb; /* XXX back pointer to internet pcb */
@@ -490,7 +490,7 @@ void kmod_tcpstat_inc(int statnum);
* Evil hack: declare only if in_pcb.h and sys/socketvar.h have been
* included. Not all of our clients do.
*/
-#if defined(_NETINET_IN_PCB_HH_) && defined(_SYS_SOCKETVAR_HH_)
+#if defined(_NETINET_IN_PCB_H_) && defined(_SYS_SOCKETVAR_H_)
struct xtcpcb {
size_t xt_len;
struct inpcb xt_inp;
@@ -684,4 +684,4 @@ u_long tcp_seq_subtract(u_long, u_long );
#endif /* _KERNEL */
-#endif /* _NETINET_TCP_VAR_HH_ */
+#endif /* _NETINET_TCP_VAR_H_ */
diff --git a/freebsd/sys/netinet/tcpip.h b/freebsd/sys/netinet/tcpip.h
index 337c07a6..3a89d5d5 100644
--- a/freebsd/sys/netinet/tcpip.h
+++ b/freebsd/sys/netinet/tcpip.h
@@ -30,8 +30,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET_TCPIP_HH_
-#define _NETINET_TCPIP_HH_
+#ifndef _NETINET_TCPIP_H_
+#define _NETINET_TCPIP_H_
/*
* Tcp+ip header, after ip options removed.
diff --git a/freebsd/sys/netinet/toedev.h b/freebsd/sys/netinet/toedev.h
index 4623845c..7edaca12 100644
--- a/freebsd/sys/netinet/toedev.h
+++ b/freebsd/sys/netinet/toedev.h
@@ -27,8 +27,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET_TOEDEV_HH_
-#define _NETINET_TOEDEV_HH_
+#ifndef _NETINET_TOEDEV_H_
+#define _NETINET_TOEDEV_H_
#ifndef _KERNEL
#error "no user-serviceable parts inside"
@@ -159,4 +159,4 @@ toe_enslave(struct ifnet *bond_ifp, struct ifnet *slave_ifp)
return (0);
}
-#endif /* _NETINET_TOEDEV_HH_ */
+#endif /* _NETINET_TOEDEV_H_ */
diff --git a/freebsd/sys/netinet/udp.h b/freebsd/sys/netinet/udp.h
index e7010ac5..6841683f 100644
--- a/freebsd/sys/netinet/udp.h
+++ b/freebsd/sys/netinet/udp.h
@@ -1,2 +1,67 @@
-#include <freebsd/bsd.h>
-#include <freebsd/netinet/udp.h>
+/*-
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)udp.h 8.1 (Berkeley) 6/10/93
+ * $FreeBSD$
+ */
+
+#ifndef _NETINET_UDP_H_
+#define _NETINET_UDP_H_
+
+/*
+ * UDP protocol header.
+ * Per RFC 768, September, 1981.
+ */
+struct udphdr {
+ u_short uh_sport; /* source port */
+ u_short uh_dport; /* destination port */
+ u_short uh_ulen; /* udp length */
+ u_short uh_sum; /* udp checksum */
+};
+
+/*
+ * User-settable options (used with setsockopt).
+ */
+#define UDP_ENCAP 0x01
+
+
+/*
+ * UDP Encapsulation of IPsec Packets options.
+ */
+/* Encapsulation types. */
+#define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */
+#define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-02+ */
+
+/* Default ESP in UDP encapsulation port. */
+#define UDP_ENCAP_ESPINUDP_PORT 500
+
+/* Maximum UDP fragment size for ESP over UDP. */
+#define UDP_ENCAP_ESPINUDP_MAXFRAGLEN 552
+
+#endif
diff --git a/freebsd/sys/netinet/udp_usrreq.c b/freebsd/sys/netinet/udp_usrreq.c
index f992f5f6..26bdfed2 100644
--- a/freebsd/sys/netinet/udp_usrreq.c
+++ b/freebsd/sys/netinet/udp_usrreq.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
@@ -33,63 +33,63 @@
* @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_ipfw.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipsec.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/eventhandler.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/systm.h>
-
-#include <freebsd/vm/uma.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip.h>
+#include <rtems/bsd/local/opt_ipfw.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/domain.h>
+#include <sys/eventhandler.h>
+#include <sys/jail.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/protosw.h>
+#include <sys/signalvar.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sx.h>
+#include <sys/sysctl.h>
+#include <sys/syslog.h>
+#include <sys/systm.h>
+
+#include <vm/uma.h>
+
+#include <net/if.h>
+#include <net/route.h>
+
+#include <netinet/in.h>
+#include <netinet/in_pcb.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/ip.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
+#include <netinet/ip6.h>
#endif
-#include <freebsd/netinet/ip_icmp.h>
-#include <freebsd/netinet/icmp_var.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_options.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/icmp_var.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_options.h>
#ifdef INET6
-#include <freebsd/netinet6/ip6_var.h>
+#include <netinet6/ip6_var.h>
#endif
-#include <freebsd/netinet/udp.h>
-#include <freebsd/netinet/udp_var.h>
+#include <netinet/udp.h>
+#include <netinet/udp_var.h>
#ifdef IPSEC
-#include <freebsd/netipsec/ipsec.h>
-#include <freebsd/netipsec/esp.h>
+#include <netipsec/ipsec.h>
+#include <netipsec/esp.h>
#endif
-#include <freebsd/machine/in_cksum.h>
+#include <machine/in_cksum.h>
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
/*
* UDP protocol implementation.
diff --git a/freebsd/sys/netinet/udp_var.h b/freebsd/sys/netinet/udp_var.h
index 0bff6ea9..aa7ee470 100644
--- a/freebsd/sys/netinet/udp_var.h
+++ b/freebsd/sys/netinet/udp_var.h
@@ -31,8 +31,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET_UDP_VAR_HH_
-#define _NETINET_UDP_VAR_HH_
+#ifndef _NETINET_UDP_VAR_H_
+#define _NETINET_UDP_VAR_H_
/*
* UDP kernel structures and variables.
diff --git a/freebsd/sys/netinet6/dest6.c b/freebsd/sys/netinet6/dest6.c
index 6774dc86..aacfdec5 100644
--- a/freebsd/sys/netinet6/dest6.c
+++ b/freebsd/sys/netinet6/dest6.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -31,31 +31,31 @@
* $KAME: dest6.c,v 1.59 2003/07/11 13:21:16 t-momose Exp $
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/kernel.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/domain.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <rtems/bsd/sys/errno.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/kernel.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
+#include <net/if.h>
+#include <net/route.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet/icmp6.h>
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
+#include <netinet/icmp6.h>
/*
* Destination options header processing.
diff --git a/freebsd/sys/netinet6/frag6.c b/freebsd/sys/netinet6/frag6.c
index bdb0f198..391f2a78 100644
--- a/freebsd/sys/netinet6/frag6.c
+++ b/freebsd/sys/netinet6/frag6.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -31,34 +31,34 @@
* $KAME: frag6.c,v 1.33 2002/01/07 11:34:48 kjc Exp $
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/syslog.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet/icmp6.h>
-#include <freebsd/netinet/in_systm.h> /* for ECN definitions */
-#include <freebsd/netinet/ip.h> /* for ECN definitions */
-
-#include <freebsd/security/mac/mac_framework.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/domain.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <rtems/bsd/sys/errno.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/kernel.h>
+#include <sys/syslog.h>
+
+#include <net/if.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
+#include <netinet/icmp6.h>
+#include <netinet/in_systm.h> /* for ECN definitions */
+#include <netinet/ip.h> /* for ECN definitions */
+
+#include <security/mac/mac_framework.h>
/*
* Define it to get a correct behavior on per-interface statistics.
diff --git a/freebsd/sys/netinet6/icmp6.c b/freebsd/sys/netinet6/icmp6.c
index 3df7f7b1..407e91d0 100644
--- a/freebsd/sys/netinet6/icmp6.c
+++ b/freebsd/sys/netinet6/icmp6.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -62,55 +62,55 @@
* @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipsec.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/time.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_llatbl.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet/icmp6.h>
-#include <freebsd/netinet/tcp_var.h>
-
-#include <freebsd/netinet6/in6_ifattach.h>
-#include <freebsd/netinet6/in6_pcb.h>
-#include <freebsd/netinet6/ip6protosw.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/scope6_var.h>
-#include <freebsd/netinet6/mld6_var.h>
-#include <freebsd/netinet6/nd6.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/domain.h>
+#include <sys/jail.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/proc.h>
+#include <sys/protosw.h>
+#include <sys/signalvar.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sx.h>
+#include <sys/syslog.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/time.h>
+
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/if_llatbl.h>
+#include <net/if_types.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_pcb.h>
+#include <netinet/in_var.h>
+#include <netinet/ip6.h>
+#include <netinet/icmp6.h>
+#include <netinet/tcp_var.h>
+
+#include <netinet6/in6_ifattach.h>
+#include <netinet6/in6_pcb.h>
+#include <netinet6/ip6protosw.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/scope6_var.h>
+#include <netinet6/mld6_var.h>
+#include <netinet6/nd6.h>
#ifdef IPSEC
-#include <freebsd/netipsec/ipsec.h>
-#include <freebsd/netipsec/key.h>
+#include <netipsec/ipsec.h>
+#include <netipsec/key.h>
#endif
extern struct domain inet6domain;
diff --git a/freebsd/sys/netinet6/in6.c b/freebsd/sys/netinet6/in6.c
index 826213af..1ed8b138 100644
--- a/freebsd/sys/netinet6/in6.c
+++ b/freebsd/sys/netinet6/in6.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -62,50 +62,50 @@
* @(#)in.c 8.2 (Berkeley) 11/15/93
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_compat.h>
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/syslog.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_var.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/net/if_llatbl.h>
-#include <freebsd/netinet/if_ether.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/in_pcb.h>
-
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/nd6.h>
-#include <freebsd/netinet6/mld6_var.h>
-#include <freebsd/netinet6/ip6_mroute.h>
-#include <freebsd/netinet6/in6_ifattach.h>
-#include <freebsd/netinet6/scope6_var.h>
-#include <freebsd/netinet6/in6_pcb.h>
+#include <rtems/bsd/local/opt_compat.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/jail.h>
+#include <sys/malloc.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sockio.h>
+#include <sys/systm.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/kernel.h>
+#include <sys/syslog.h>
+
+#include <net/if.h>
+#include <net/if_var.h>
+#include <net/if_types.h>
+#include <net/route.h>
+#include <net/if_dl.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <net/if_llatbl.h>
+#include <netinet/if_ether.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/in_pcb.h>
+
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/nd6.h>
+#include <netinet6/mld6_var.h>
+#include <netinet6/ip6_mroute.h>
+#include <netinet6/in6_ifattach.h>
+#include <netinet6/scope6_var.h>
+#include <netinet6/in6_pcb.h>
/*
* Definitions of some costant IP6 addresses.
@@ -2310,7 +2310,7 @@ in6_if2idlen(struct ifnet *ifp)
}
}
-#include <freebsd/sys/sysctl.h>
+#include <sys/sysctl.h>
struct in6_llentry {
struct llentry base;
diff --git a/freebsd/sys/netinet6/in6.h b/freebsd/sys/netinet6/in6.h
index 8d241116..d0331f43 100644
--- a/freebsd/sys/netinet6/in6.h
+++ b/freebsd/sys/netinet6/in6.h
@@ -65,8 +65,8 @@
#error "do not include netinet6/in6.h directly, include netinet/in.h. see RFC2553"
#endif
-#ifndef _NETINET6_IN6_HH_
-#define _NETINET6_IN6_HH_
+#ifndef _NETINET6_IN6_H_
+#define _NETINET6_IN6_H_
/*
* Identification of the network protocol stack
@@ -705,4 +705,4 @@ __END_DECLS
#endif /* __BSD_VISIBLE */
-#endif /* !_NETINET6_IN6_HH_ */
+#endif /* !_NETINET6_IN6_H_ */
diff --git a/freebsd/sys/netinet6/in6_cksum.c b/freebsd/sys/netinet6/in6_cksum.c
index 1bd215b9..fb8e044d 100644
--- a/freebsd/sys/netinet6/in6_cksum.c
+++ b/freebsd/sys/netinet6/in6_cksum.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -62,15 +62,15 @@
* @(#)in_cksum.c 8.1 (Berkeley) 6/10/93
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/scope6_var.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/mbuf.h>
+#include <sys/systm.h>
+#include <netinet/in.h>
+#include <netinet/ip6.h>
+#include <netinet6/scope6_var.h>
/*
* Checksum routine for Internet Protocol family headers (Portable Version).
diff --git a/freebsd/sys/netinet6/in6_gif.c b/freebsd/sys/netinet6/in6_gif.c
index 482181db..be915827 100644
--- a/freebsd/sys/netinet6/in6_gif.c
+++ b/freebsd/sys/netinet6/in6_gif.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -31,47 +31,47 @@
* $KAME: in6_gif.c,v 1.49 2001/05/14 14:02:17 itojun Exp $
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/malloc.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/mbuf.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/kernel.h>
+#include <sys/queue.h>
+#include <sys/syslog.h>
+#include <sys/sysctl.h>
+#include <sys/protosw.h>
+#include <sys/malloc.h>
+
+#include <net/if.h>
+#include <net/route.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
#ifdef INET
-#include <freebsd/netinet/ip.h>
+#include <netinet/ip.h>
#endif
-#include <freebsd/netinet/ip_encap.h>
+#include <netinet/ip_encap.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/in6_gif.h>
-#include <freebsd/netinet6/in6_var.h>
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/in6_gif.h>
+#include <netinet6/in6_var.h>
#endif
-#include <freebsd/netinet6/ip6protosw.h>
-#include <freebsd/netinet/ip_ecn.h>
+#include <netinet6/ip6protosw.h>
+#include <netinet/ip_ecn.h>
#ifdef INET6
-#include <freebsd/netinet6/ip6_ecn.h>
+#include <netinet6/ip6_ecn.h>
#endif
-#include <freebsd/net/if_gif.h>
+#include <net/if_gif.h>
VNET_DEFINE(int, ip6_gif_hlim) = GIF_HLIM;
#define V_ip6_gif_hlim VNET(ip6_gif_hlim)
diff --git a/freebsd/sys/netinet6/in6_gif.h b/freebsd/sys/netinet6/in6_gif.h
index ed566112..f9520898 100644
--- a/freebsd/sys/netinet6/in6_gif.h
+++ b/freebsd/sys/netinet6/in6_gif.h
@@ -30,8 +30,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET6_IN6_GIF_HH_
-#define _NETINET6_IN6_GIF_HH_
+#ifndef _NETINET6_IN6_GIF_H_
+#define _NETINET6_IN6_GIF_H_
#define GIF_HLIM 30
@@ -42,4 +42,4 @@ int gif_encapcheck6 __P((const struct mbuf *, int, int, void *));
int in6_gif_attach __P((struct gif_softc *));
int in6_gif_detach __P((struct gif_softc *));
-#endif /* _NETINET6_IN6_GIF_HH_ */
+#endif /* _NETINET6_IN6_GIF_H_ */
diff --git a/freebsd/sys/netinet6/in6_ifattach.c b/freebsd/sys/netinet6/in6_ifattach.c
index 7942d5af..1063ed43 100644
--- a/freebsd/sys/netinet6/in6_ifattach.c
+++ b/freebsd/sys/netinet6/in6_ifattach.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -31,43 +31,43 @@
* $KAME: in6_ifattach.c,v 1.118 2001/05/24 07:44:00 itojun Exp $
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/md5.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/if_ether.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/udp.h>
-#include <freebsd/netinet/udp_var.h>
-
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/in6_var.h>
-#include <freebsd/netinet6/in6_pcb.h>
-#include <freebsd/netinet6/in6_ifattach.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/nd6.h>
-#include <freebsd/netinet6/mld6_var.h>
-#include <freebsd/netinet6/scope6_var.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/jail.h>
+#include <sys/kernel.h>
+#include <sys/proc.h>
+#include <sys/syslog.h>
+#include <sys/md5.h>
+
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/if_types.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/if_ether.h>
+#include <netinet/in_pcb.h>
+#include <netinet/ip_var.h>
+#include <netinet/udp.h>
+#include <netinet/udp_var.h>
+
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/in6_var.h>
+#include <netinet6/in6_pcb.h>
+#include <netinet6/in6_ifattach.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/nd6.h>
+#include <netinet6/mld6_var.h>
+#include <netinet6/scope6_var.h>
VNET_DEFINE(unsigned long, in6_maxmtu) = 0;
diff --git a/freebsd/sys/netinet6/in6_ifattach.h b/freebsd/sys/netinet6/in6_ifattach.h
index d7db4e47..441eb755 100644
--- a/freebsd/sys/netinet6/in6_ifattach.h
+++ b/freebsd/sys/netinet6/in6_ifattach.h
@@ -30,8 +30,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET6_IN6_IFATTACH_HH_
-#define _NETINET6_IN6_IFATTACH_HH_
+#ifndef _NETINET6_IN6_IFATTACH_H_
+#define _NETINET6_IN6_IFATTACH_H_
#ifdef _KERNEL
void in6_ifattach __P((struct ifnet *, struct ifnet *));
@@ -42,4 +42,4 @@ int in6_get_hw_ifid __P((struct ifnet *, struct in6_addr *));
int in6_nigroup __P((struct ifnet *, const char *, int, struct in6_addr *));
#endif /* _KERNEL */
-#endif /* _NETINET6_IN6_IFATTACH_HH_ */
+#endif /* _NETINET6_IN6_IFATTACH_H_ */
diff --git a/freebsd/sys/netinet6/in6_mcast.c b/freebsd/sys/netinet6/in6_mcast.c
index a75a4ed3..4d0637aa 100644
--- a/freebsd/sys/netinet6/in6_mcast.c
+++ b/freebsd/sys/netinet6/in6_mcast.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* Copyright (c) 2009 Bruce Simpson.
@@ -34,41 +34,41 @@
* Normative references: RFC 2292, RFC 3492, RFC 3542, RFC 3678, RFC 3810.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/ktr.h>
-#include <freebsd/sys/tree.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet6/in6_var.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet/icmp6.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/tcp_var.h>
-#include <freebsd/netinet6/nd6.h>
-#include <freebsd/netinet6/mld6_var.h>
-#include <freebsd/netinet6/scope6_var.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/protosw.h>
+#include <sys/sysctl.h>
+#include <sys/priv.h>
+#include <sys/ktr.h>
+#include <sys/tree.h>
+
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet6/in6_var.h>
+#include <netinet/ip6.h>
+#include <netinet/icmp6.h>
+#include <netinet6/ip6_var.h>
+#include <netinet/in_pcb.h>
+#include <netinet/tcp_var.h>
+#include <netinet6/nd6.h>
+#include <netinet6/mld6_var.h>
+#include <netinet6/scope6_var.h>
#ifndef KTR_MLD
#define KTR_MLD KTR_INET6
diff --git a/freebsd/sys/netinet6/in6_pcb.c b/freebsd/sys/netinet6/in6_pcb.c
index 5faccefd..a5475914 100644
--- a/freebsd/sys/netinet6/in6_pcb.c
+++ b/freebsd/sys/netinet6/in6_pcb.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -62,48 +62,48 @@
* @(#)in_pcb.c 8.2 (Berkeley) 1/4/94
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipsec.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/jail.h>
-
-#include <freebsd/vm/uma.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/route.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/tcp_var.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet/ip_var.h>
-
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/nd6.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet6/in6_pcb.h>
-#include <freebsd/netinet6/scope6_var.h>
-
-#include <freebsd/security/mac/mac_framework.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/domain.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sockio.h>
+#include <rtems/bsd/sys/errno.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/jail.h>
+
+#include <vm/uma.h>
+
+#include <net/if.h>
+#include <net/if_types.h>
+#include <net/route.h>
+
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/in_systm.h>
+#include <netinet/tcp_var.h>
+#include <netinet/ip6.h>
+#include <netinet/ip_var.h>
+
+#include <netinet6/ip6_var.h>
+#include <netinet6/nd6.h>
+#include <netinet/in_pcb.h>
+#include <netinet6/in6_pcb.h>
+#include <netinet6/scope6_var.h>
+
+#include <security/mac/mac_framework.h>
struct in6_addr zeroin6_addr;
diff --git a/freebsd/sys/netinet6/in6_pcb.h b/freebsd/sys/netinet6/in6_pcb.h
index abc4a318..6ea63903 100644
--- a/freebsd/sys/netinet6/in6_pcb.h
+++ b/freebsd/sys/netinet6/in6_pcb.h
@@ -61,8 +61,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET6_IN6_PCB_HH_
-#define _NETINET6_IN6_PCB_HH_
+#ifndef _NETINET6_IN6_PCB_H_
+#define _NETINET6_IN6_PCB_H_
#ifdef _KERNEL
#define satosin6(sa) ((struct sockaddr_in6 *)(sa))
@@ -106,4 +106,4 @@ int in6_pcbsetport __P((struct in6_addr *, struct inpcb *, struct ucred *));
void init_sin6 __P((struct sockaddr_in6 *sin6, struct mbuf *m));
#endif /* _KERNEL */
-#endif /* !_NETINET6_IN6_PCB_HH_ */
+#endif /* !_NETINET6_IN6_PCB_H_ */
diff --git a/freebsd/sys/netinet6/in6_proto.c b/freebsd/sys/netinet6/in6_proto.c
index 0cd0858d..39611537 100644
--- a/freebsd/sys/netinet6/in6_proto.c
+++ b/freebsd/sys/netinet6/in6_proto.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -62,70 +62,70 @@
* @(#)in_proto.c 8.1 (Berkeley) 6/10/93
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipsec.h>
-#include <freebsd/local/opt_ipstealth.h>
-#include <freebsd/local/opt_sctp.h>
-#include <freebsd/local/opt_mpath.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/radix.h>
-#include <freebsd/net/route.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+#include <rtems/bsd/local/opt_ipstealth.h>
+#include <rtems/bsd/local/opt_sctp.h>
+#include <rtems/bsd/local/opt_mpath.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/proc.h>
+#include <sys/protosw.h>
+#include <sys/jail.h>
+#include <sys/kernel.h>
+#include <sys/domain.h>
+#include <sys/mbuf.h>
+#include <sys/systm.h>
+#include <sys/sysctl.h>
+
+#include <net/if.h>
+#include <net/radix.h>
+#include <net/route.h>
#ifdef RADIX_MPATH
-#include <freebsd/net/radix_mpath.h>
+#include <net/radix_mpath.h>
#endif
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip_encap.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet/icmp6.h>
-
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/tcp_timer.h>
-#include <freebsd/netinet/tcp_var.h>
-#include <freebsd/netinet/udp.h>
-#include <freebsd/netinet/udp_var.h>
-#include <freebsd/netinet6/tcp6_var.h>
-#include <freebsd/netinet6/raw_ip6.h>
-#include <freebsd/netinet6/udp6_var.h>
-#include <freebsd/netinet6/pim6_var.h>
-#include <freebsd/netinet6/nd6.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/ip_encap.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
+#include <netinet/icmp6.h>
+
+#include <netinet/tcp.h>
+#include <netinet/tcp_timer.h>
+#include <netinet/tcp_var.h>
+#include <netinet/udp.h>
+#include <netinet/udp_var.h>
+#include <netinet6/tcp6_var.h>
+#include <netinet6/raw_ip6.h>
+#include <netinet6/udp6_var.h>
+#include <netinet6/pim6_var.h>
+#include <netinet6/nd6.h>
#ifdef SCTP
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/sctp_pcb.h>
-#include <freebsd/netinet/sctp.h>
-#include <freebsd/netinet/sctp_var.h>
-#include <freebsd/netinet6/sctp6_var.h>
+#include <netinet/in_pcb.h>
+#include <netinet/sctp_pcb.h>
+#include <netinet/sctp.h>
+#include <netinet/sctp_var.h>
+#include <netinet6/sctp6_var.h>
#endif /* SCTP */
#ifdef IPSEC
-#include <freebsd/netipsec/ipsec.h>
-#include <freebsd/netipsec/ipsec6.h>
+#include <netipsec/ipsec.h>
+#include <netipsec/ipsec6.h>
#endif /* IPSEC */
-#include <freebsd/netinet6/ip6protosw.h>
+#include <netinet6/ip6protosw.h>
/*
* TCP/IP protocol family: IP6, ICMP6, UDP, TCP.
diff --git a/freebsd/sys/netinet6/in6_rmx.c b/freebsd/sys/netinet6/in6_rmx.c
index de867c36..fee58221 100644
--- a/freebsd/sys/netinet6/in6_rmx.c
+++ b/freebsd/sys/netinet6/in6_rmx.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -74,39 +74,39 @@
* indefinitely. See in6_rtqtimo() below for the exact mechanism.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/callout.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/in_var.h>
-
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
-
-#include <freebsd/netinet/icmp6.h>
-#include <freebsd/netinet6/nd6.h>
-
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/tcp_seq.h>
-#include <freebsd/netinet/tcp_timer.h>
-#include <freebsd/netinet/tcp_var.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/sysctl.h>
+#include <sys/queue.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/mbuf.h>
+#include <sys/rwlock.h>
+#include <sys/syslog.h>
+#include <sys/callout.h>
+
+#include <net/if.h>
+#include <net/route.h>
+
+#include <netinet/in.h>
+#include <netinet/ip_var.h>
+#include <netinet/in_var.h>
+
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
+
+#include <netinet/icmp6.h>
+#include <netinet6/nd6.h>
+
+#include <netinet/tcp.h>
+#include <netinet/tcp_seq.h>
+#include <netinet/tcp_timer.h>
+#include <netinet/tcp_var.h>
extern int in6_inithead(void **head, int off);
#ifdef VIMAGE
diff --git a/freebsd/sys/netinet6/in6_src.c b/freebsd/sys/netinet6/in6_src.c
index a3914c3f..f7cd642e 100644
--- a/freebsd/sys/netinet6/in6_src.c
+++ b/freebsd/sys/netinet6/in6_src.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -62,53 +62,53 @@
* @(#)in_pcb.c 8.2 (Berkeley) 1/4/94
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_mpath.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/sx.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/if_llatbl.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_mpath.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/priv.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sockio.h>
+#include <sys/sysctl.h>
+#include <rtems/bsd/sys/errno.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/jail.h>
+#include <sys/kernel.h>
+#include <sys/sx.h>
+
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/route.h>
+#include <net/if_llatbl.h>
#ifdef RADIX_MPATH
-#include <freebsd/net/radix_mpath.h>
+#include <net/radix_mpath.h>
#endif
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/udp.h>
-#include <freebsd/netinet/udp_var.h>
-
-#include <freebsd/netinet6/in6_var.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/in6_pcb.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/scope6_var.h>
-#include <freebsd/netinet6/nd6.h>
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/in_pcb.h>
+#include <netinet/ip_var.h>
+#include <netinet/udp.h>
+#include <netinet/udp_var.h>
+
+#include <netinet6/in6_var.h>
+#include <netinet/ip6.h>
+#include <netinet6/in6_pcb.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/scope6_var.h>
+#include <netinet6/nd6.h>
static struct mtx addrsel_lock;
#define ADDRSEL_LOCK_INIT() mtx_init(&addrsel_lock, "addrsel_lock", NULL, MTX_DEF)
diff --git a/freebsd/sys/netinet6/in6_var.h b/freebsd/sys/netinet6/in6_var.h
index f77a3271..00342fde 100644
--- a/freebsd/sys/netinet6/in6_var.h
+++ b/freebsd/sys/netinet6/in6_var.h
@@ -61,13 +61,13 @@
* $FreeBSD$
*/
-#ifndef _NETINET6_IN6_VAR_HH_
-#define _NETINET6_IN6_VAR_HH_
+#ifndef _NETINET6_IN6_VAR_H_
+#define _NETINET6_IN6_VAR_H_
-#include <freebsd/sys/tree.h>
+#include <sys/tree.h>
#ifdef _KERNEL
-#include <freebsd/sys/libkern.h>
+#include <sys/libkern.h>
#endif
/*
@@ -783,4 +783,4 @@ struct inpcb;
int in6_src_ioctl __P((u_long, caddr_t));
#endif /* _KERNEL */
-#endif /* _NETINET6_IN6_VAR_HH_ */
+#endif /* _NETINET6_IN6_VAR_H_ */
diff --git a/freebsd/sys/netinet6/ip6_forward.c b/freebsd/sys/netinet6/ip6_forward.c
index f1d19737..2f9073c8 100644
--- a/freebsd/sys/netinet6/ip6_forward.c
+++ b/freebsd/sys/netinet6/ip6_forward.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -31,51 +31,51 @@
* $KAME: ip6_forward.c,v 1.69 2001/05/17 03:48:30 itojun Exp $
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipsec.h>
-#include <freebsd/local/opt_ipstealth.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/syslog.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/pfil.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet6/in6_var.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/scope6_var.h>
-#include <freebsd/netinet/icmp6.h>
-#include <freebsd/netinet6/nd6.h>
-
-#include <freebsd/netinet/in_pcb.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+#include <rtems/bsd/local/opt_ipstealth.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/domain.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <rtems/bsd/sys/errno.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/kernel.h>
+#include <sys/syslog.h>
+
+#include <net/if.h>
+#include <net/route.h>
+#include <net/pfil.h>
+
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+#include <netinet6/in6_var.h>
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/scope6_var.h>
+#include <netinet/icmp6.h>
+#include <netinet6/nd6.h>
+
+#include <netinet/in_pcb.h>
#ifdef IPSEC
-#include <freebsd/netipsec/ipsec.h>
-#include <freebsd/netipsec/ipsec6.h>
-#include <freebsd/netipsec/key.h>
+#include <netipsec/ipsec.h>
+#include <netipsec/ipsec6.h>
+#include <netipsec/key.h>
#endif /* IPSEC */
-#include <freebsd/netinet6/ip6protosw.h>
+#include <netinet6/ip6protosw.h>
/*
* Forward a packet. If some error occurs return the sender
diff --git a/freebsd/sys/netinet6/ip6_id.c b/freebsd/sys/netinet6/ip6_id.c
index 090e66fa..d504cb2d 100644
--- a/freebsd/sys/netinet6/ip6_id.c
+++ b/freebsd/sys/netinet6/ip6_id.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 2003 WIDE Project.
@@ -68,7 +68,7 @@
* $OpenBSD: ip_id.c,v 1.6 2002/03/15 18:19:52 millert Exp $
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -91,17 +91,17 @@ __FBSDID("$FreeBSD$");
* This avoids reuse issues caused by reseeding.
*/
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/libkern.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/socket.h>
+#include <sys/libkern.h>
+
+#include <net/if.h>
+#include <net/route.h>
+#include <netinet/in.h>
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
#ifndef INT32_MAX
#define INT32_MAX 0x7fffffffU
diff --git a/freebsd/sys/netinet6/ip6_input.c b/freebsd/sys/netinet6/ip6_input.c
index 323bb2a8..425ed2f0 100644
--- a/freebsd/sys/netinet6/ip6_input.c
+++ b/freebsd/sys/netinet6/ip6_input.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -62,58 +62,58 @@
* @(#)ip_input.c 8.2 (Berkeley) 1/4/94
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipsec.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/syslog.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/pfil.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/net/if_llatbl.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/proc.h>
+#include <sys/domain.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <rtems/bsd/sys/errno.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/kernel.h>
+#include <sys/syslog.h>
+
+#include <net/if.h>
+#include <net/if_types.h>
+#include <net/if_dl.h>
+#include <net/route.h>
+#include <net/netisr.h>
+#include <net/pfil.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <net/if_llatbl.h>
#ifdef INET
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_icmp.h>
+#include <netinet/ip.h>
+#include <netinet/ip_icmp.h>
#endif /* INET */
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/in6_var.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/icmp6.h>
-#include <freebsd/netinet6/scope6_var.h>
-#include <freebsd/netinet6/in6_ifattach.h>
-#include <freebsd/netinet6/nd6.h>
+#include <netinet/ip6.h>
+#include <netinet6/in6_var.h>
+#include <netinet6/ip6_var.h>
+#include <netinet/in_pcb.h>
+#include <netinet/icmp6.h>
+#include <netinet6/scope6_var.h>
+#include <netinet6/in6_ifattach.h>
+#include <netinet6/nd6.h>
#ifdef IPSEC
-#include <freebsd/netipsec/ipsec.h>
-#include <freebsd/netinet6/ip6_ipsec.h>
-#include <freebsd/netipsec/ipsec6.h>
+#include <netipsec/ipsec.h>
+#include <netinet6/ip6_ipsec.h>
+#include <netipsec/ipsec6.h>
#endif /* IPSEC */
-#include <freebsd/netinet6/ip6protosw.h>
+#include <netinet6/ip6protosw.h>
extern struct domain inet6domain;
diff --git a/freebsd/sys/netinet6/ip6_ipsec.c b/freebsd/sys/netinet6/ip6_ipsec.c
index a50c22c5..e1477123 100644
--- a/freebsd/sys/netinet6/ip6_ipsec.c
+++ b/freebsd/sys/netinet6/ip6_ipsec.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1982, 1986, 1988, 1993
@@ -29,52 +29,52 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipsec.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipsec.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/mac.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/mac.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sysctl.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
+#include <net/if.h>
+#include <net/route.h>
+#include <net/vnet.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_options.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/ip.h>
+#include <netinet/ip6.h>
+#include <netinet/in_pcb.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_options.h>
-#include <freebsd/machine/in_cksum.h>
+#include <machine/in_cksum.h>
#ifdef IPSEC
-#include <freebsd/netipsec/ipsec.h>
-#include <freebsd/netipsec/ipsec6.h>
-#include <freebsd/netipsec/xform.h>
-#include <freebsd/netipsec/key.h>
+#include <netipsec/ipsec.h>
+#include <netipsec/ipsec6.h>
+#include <netipsec/xform.h>
+#include <netipsec/key.h>
#ifdef IPSEC_DEBUG
-#include <freebsd/netipsec/key_debug.h>
+#include <netipsec/key_debug.h>
#else
#define KEYDEBUG(lev,arg)
#endif
#endif /*IPSEC*/
-#include <freebsd/netinet6/ip6_ipsec.h>
-#include <freebsd/netinet6/ip6_var.h>
+#include <netinet6/ip6_ipsec.h>
+#include <netinet6/ip6_var.h>
extern struct protosw inet6sw[];
diff --git a/freebsd/sys/netinet6/ip6_ipsec.h b/freebsd/sys/netinet6/ip6_ipsec.h
index e3049534..86d1b005 100644
--- a/freebsd/sys/netinet6/ip6_ipsec.h
+++ b/freebsd/sys/netinet6/ip6_ipsec.h
@@ -29,8 +29,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET_IP6_IPSEC_HH_
-#define _NETINET_IP6_IPSEC_HH_
+#ifndef _NETINET_IP6_IPSEC_H_
+#define _NETINET_IP6_IPSEC_H_
int ip6_ipsec_filtertunnel(struct mbuf *);
int ip6_ipsec_fwd(struct mbuf *);
diff --git a/freebsd/sys/netinet6/ip6_mroute.c b/freebsd/sys/netinet6/ip6_mroute.c
index 661cd1c0..3be1d480 100644
--- a/freebsd/sys/netinet6/ip6_mroute.c
+++ b/freebsd/sys/netinet6/ip6_mroute.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 1998 WIDE Project.
@@ -80,50 +80,50 @@
* MROUTING Revision: 3.5.1.2 + PIM-SMv2 (pimd) Support
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/time.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/raw_cb.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/icmp6.h>
-#include <freebsd/netinet/ip_encap.h>
-
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/scope6_var.h>
-#include <freebsd/netinet6/nd6.h>
-#include <freebsd/netinet6/ip6_mroute.h>
-#include <freebsd/netinet6/ip6protosw.h>
-#include <freebsd/netinet6/pim6.h>
-#include <freebsd/netinet6/pim6_var.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/callout.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <sys/domain.h>
+#include <sys/protosw.h>
+#include <sys/signalvar.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sockio.h>
+#include <sys/sx.h>
+#include <sys/sysctl.h>
+#include <sys/syslog.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/time.h>
+
+#include <net/if.h>
+#include <net/if_types.h>
+#include <net/raw_cb.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/icmp6.h>
+#include <netinet/ip_encap.h>
+
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/scope6_var.h>
+#include <netinet6/nd6.h>
+#include <netinet6/ip6_mroute.h>
+#include <netinet6/ip6protosw.h>
+#include <netinet6/pim6.h>
+#include <netinet6/pim6_var.h>
static MALLOC_DEFINE(M_MRTABLE6, "mf6c", "multicast forwarding cache entry");
diff --git a/freebsd/sys/netinet6/ip6_mroute.h b/freebsd/sys/netinet6/ip6_mroute.h
index 198659fa..701d5345 100644
--- a/freebsd/sys/netinet6/ip6_mroute.h
+++ b/freebsd/sys/netinet6/ip6_mroute.h
@@ -44,8 +44,8 @@
* MROUTING Revision: 1.2
*/
-#ifndef _NETINET6_IP6_MROUTE_HH_
-#define _NETINET6_IP6_MROUTE_HH_
+#ifndef _NETINET6_IP6_MROUTE_H_
+#define _NETINET6_IP6_MROUTE_H_
/*
* Multicast Routing set/getsockopt commands.
@@ -242,7 +242,7 @@ struct mf6c {
/*
* Argument structure used for pkt info. while upcall is made
*/
-#ifndef _NETINET_IP_MROUTE_HH_
+#ifndef _NETINET_IP_MROUTE_H_
struct rtdetq { /* XXX: rtdetq is also defined in ip_mroute.h */
struct mbuf *m; /* A copy of the packet */
struct ifnet *ifp; /* Interface pkt came in on */
@@ -251,7 +251,7 @@ struct rtdetq { /* XXX: rtdetq is also defined in ip_mroute.h */
#endif /* UPCALL_TIMING */
struct rtdetq *next;
};
-#endif /* _NETINET_IP_MROUTE_HH_ */
+#endif /* _NETINET_IP_MROUTE_H_ */
#define MF6CTBLSIZ 256
#if (MF6CTBLSIZ & (MF6CTBLSIZ - 1)) == 0 /* from sys:route.h */
@@ -268,4 +268,4 @@ extern int (*ip6_mrouter_done)(void);
extern int (*mrt6_ioctl)(u_long, caddr_t);
#endif /* _KERNEL */
-#endif /* !_NETINET6_IP6_MROUTE_HH_ */
+#endif /* !_NETINET6_IP6_MROUTE_H_ */
diff --git a/freebsd/sys/netinet6/ip6_output.c b/freebsd/sys/netinet6/ip6_output.c
index 0d762cc0..d6d7eb6e 100644
--- a/freebsd/sys/netinet6/ip6_output.c
+++ b/freebsd/sys/netinet6/ip6_output.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -62,56 +62,56 @@
* @(#)ip_output.c 8.3 (Berkeley) 1/21/94
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipsec.h>
-#include <freebsd/local/opt_sctp.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/ucred.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/pfil.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet6/in6_var.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet/icmp6.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/tcp_var.h>
-#include <freebsd/netinet6/nd6.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+#include <rtems/bsd/local/opt_sctp.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/syslog.h>
+#include <sys/ucred.h>
+
+#include <net/if.h>
+#include <net/netisr.h>
+#include <net/route.h>
+#include <net/pfil.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet6/in6_var.h>
+#include <netinet/ip6.h>
+#include <netinet/icmp6.h>
+#include <netinet6/ip6_var.h>
+#include <netinet/in_pcb.h>
+#include <netinet/tcp_var.h>
+#include <netinet6/nd6.h>
#ifdef IPSEC
-#include <freebsd/netipsec/ipsec.h>
-#include <freebsd/netipsec/ipsec6.h>
-#include <freebsd/netipsec/key.h>
-#include <freebsd/netinet6/ip6_ipsec.h>
+#include <netipsec/ipsec.h>
+#include <netipsec/ipsec6.h>
+#include <netipsec/key.h>
+#include <netinet6/ip6_ipsec.h>
#endif /* IPSEC */
#ifdef SCTP
-#include <freebsd/netinet/sctp.h>
-#include <freebsd/netinet/sctp_crc32.h>
+#include <netinet/sctp.h>
+#include <netinet/sctp_crc32.h>
#endif
-#include <freebsd/netinet6/ip6protosw.h>
-#include <freebsd/netinet6/scope6_var.h>
+#include <netinet6/ip6protosw.h>
+#include <netinet6/scope6_var.h>
extern int in6_mcast_loop;
diff --git a/freebsd/sys/netinet6/ip6_var.h b/freebsd/sys/netinet6/ip6_var.h
index 50d8adcb..51ae1f74 100644
--- a/freebsd/sys/netinet6/ip6_var.h
+++ b/freebsd/sys/netinet6/ip6_var.h
@@ -61,8 +61,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET6_IP6_VAR_HH_
-#define _NETINET6_IP6_VAR_HH_
+#ifndef _NETINET6_IP6_VAR_H_
+#define _NETINET6_IP6_VAR_H_
/*
* IP6 reassembly queue structure. Each fragment
@@ -441,4 +441,4 @@ u_int32_t ip6_randomid __P((void));
u_int32_t ip6_randomflowlabel __P((void));
#endif /* _KERNEL */
-#endif /* !_NETINET6_IP6_VAR_HH_ */
+#endif /* !_NETINET6_IP6_VAR_H_ */
diff --git a/freebsd/sys/netinet6/ip6protosw.h b/freebsd/sys/netinet6/ip6protosw.h
index ebb38c8d..1fae44c8 100644
--- a/freebsd/sys/netinet6/ip6protosw.h
+++ b/freebsd/sys/netinet6/ip6protosw.h
@@ -62,8 +62,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET6_IP6PROTOSW_HH_
-#define _NETINET6_IP6PROTOSW_HH_
+#ifndef _NETINET6_IP6PROTOSW_H_
+#define _NETINET6_IP6PROTOSW_H_
/*
* Protocol switch table for IPv6.
@@ -145,4 +145,4 @@ struct ip6protosw {
extern struct ip6protosw inet6sw[];
#endif
-#endif /* !_NETINET6_IP6PROTOSW_HH_ */
+#endif /* !_NETINET6_IP6PROTOSW_H_ */
diff --git a/freebsd/sys/netinet6/mld6.c b/freebsd/sys/netinet6/mld6.c
index a08f0f16..b1133d69 100644
--- a/freebsd/sys/netinet6/mld6.c
+++ b/freebsd/sys/netinet6/mld6.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2009 Bruce Simpson.
@@ -65,39 +65,39 @@
* @(#)igmp.c 8.1 (Berkeley) 7/19/93
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/ktr.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet6/in6_var.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/scope6_var.h>
-#include <freebsd/netinet/icmp6.h>
-#include <freebsd/netinet6/mld6.h>
-#include <freebsd/netinet6/mld6_var.h>
-
-#include <freebsd/security/mac/mac_framework.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/protosw.h>
+#include <sys/sysctl.h>
+#include <sys/kernel.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/ktr.h>
+
+#include <net/if.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet6/in6_var.h>
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/scope6_var.h>
+#include <netinet/icmp6.h>
+#include <netinet6/mld6.h>
+#include <netinet6/mld6_var.h>
+
+#include <security/mac/mac_framework.h>
#ifndef KTR_MLD
#define KTR_MLD KTR_INET6
diff --git a/freebsd/sys/netinet6/mld6.h b/freebsd/sys/netinet6/mld6.h
index 1839b4f7..64d6b8d7 100644
--- a/freebsd/sys/netinet6/mld6.h
+++ b/freebsd/sys/netinet6/mld6.h
@@ -28,8 +28,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET6_MLD6_HH_
-#define _NETINET6_MLD6_HH_
+#ifndef _NETINET6_MLD6_H_
+#define _NETINET6_MLD6_H_
/*
* Multicast Listener Discovery (MLD) definitions.
@@ -109,4 +109,4 @@ struct mldv2_record {
*/
#define MLD_TIMER_SCALE 1000
-#endif /* _NETINET6_MLD6_HH_ */
+#endif /* _NETINET6_MLD6_H_ */
diff --git a/freebsd/sys/netinet6/mld6_var.h b/freebsd/sys/netinet6/mld6_var.h
index 40d70e51..e62ec236 100644
--- a/freebsd/sys/netinet6/mld6_var.h
+++ b/freebsd/sys/netinet6/mld6_var.h
@@ -27,8 +27,8 @@
*
* $FreeBSD$
*/
-#ifndef _NETINET6_MLD6_VAR_HH_
-#define _NETINET6_MLD6_VAR_HH_
+#ifndef _NETINET6_MLD6_VAR_H_
+#define _NETINET6_MLD6_VAR_H_
/*
* Multicast Listener Discovery (MLD)
@@ -161,4 +161,4 @@ SYSCTL_DECL(_net_inet6_mld);
#endif /* _KERNEL */
-#endif /* _NETINET6_MLD6_VAR_HH_ */
+#endif /* _NETINET6_MLD6_VAR_H_ */
diff --git a/freebsd/sys/netinet6/nd6.c b/freebsd/sys/netinet6/nd6.c
index bc7ed57e..999855ca 100644
--- a/freebsd/sys/netinet6/nd6.c
+++ b/freebsd/sys/netinet6/nd6.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -31,52 +31,52 @@
* $KAME: nd6.c,v 1.144 2001/05/24 07:44:00 itojun Exp $
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_arc.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/iso88025.h>
-#include <freebsd/net/fddi.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/net/if_llatbl.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/kernel.h>
+#include <sys/protosw.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/syslog.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/rwlock.h>
+#include <sys/queue.h>
+#include <sys/sysctl.h>
+
+#include <net/if.h>
+#include <net/if_arc.h>
+#include <net/if_dl.h>
+#include <net/if_types.h>
+#include <net/iso88025.h>
+#include <net/fddi.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <net/if_llatbl.h>
#define L3_ADDR_SIN6(le) ((struct sockaddr_in6 *) L3_ADDR(le))
-#include <freebsd/netinet/if_ether.h>
-#include <freebsd/netinet6/in6_var.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/scope6_var.h>
-#include <freebsd/netinet6/nd6.h>
-#include <freebsd/netinet/icmp6.h>
+#include <netinet/if_ether.h>
+#include <netinet6/in6_var.h>
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/scope6_var.h>
+#include <netinet6/nd6.h>
+#include <netinet/icmp6.h>
-#include <freebsd/sys/limits.h>
+#include <sys/limits.h>
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
#define ND6_SLOWTIMER_INTERVAL (60 * 60) /* 1 hour */
#define ND6_RECALC_REACHTM_INTERVAL (60 * 120) /* 2 hours */
diff --git a/freebsd/sys/netinet6/nd6.h b/freebsd/sys/netinet6/nd6.h
index 2da061df..9874f6ad 100644
--- a/freebsd/sys/netinet6/nd6.h
+++ b/freebsd/sys/netinet6/nd6.h
@@ -30,16 +30,16 @@
* $FreeBSD$
*/
-#ifndef _NETINET6_ND6_HH_
-#define _NETINET6_ND6_HH_
+#ifndef _NETINET6_ND6_H_
+#define _NETINET6_ND6_H_
/* see net/route.h, or net/if_inarp.h */
#ifndef RTF_ANNOUNCE
#define RTF_ANNOUNCE RTF_PROTO2
#endif
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/callout.h>
+#include <sys/queue.h>
+#include <sys/callout.h>
struct llentry;
@@ -452,4 +452,4 @@ int in6_tmpifadd __P((const struct in6_ifaddr *, int, int));
#endif /* _KERNEL */
-#endif /* _NETINET6_ND6_HH_ */
+#endif /* _NETINET6_ND6_H_ */
diff --git a/freebsd/sys/netinet6/nd6_nbr.c b/freebsd/sys/netinet6/nd6_nbr.c
index 44dd3cf1..599c133f 100644
--- a/freebsd/sys/netinet6/nd6_nbr.c
+++ b/freebsd/sys/netinet6/nd6_nbr.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -31,50 +31,50 @@
* $KAME: nd6_nbr.c,v 1.86 2002/01/21 02:33:04 jinmei Exp $
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipsec.h>
-#include <freebsd/local/opt_mpath.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/callout.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/if_var.h>
-#include <freebsd/net/route.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+#include <rtems/bsd/local/opt_mpath.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/rwlock.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/syslog.h>
+#include <sys/queue.h>
+#include <sys/callout.h>
+
+#include <net/if.h>
+#include <net/if_types.h>
+#include <net/if_dl.h>
+#include <net/if_var.h>
+#include <net/route.h>
#ifdef RADIX_MPATH
-#include <freebsd/net/radix_mpath.h>
+#include <net/radix_mpath.h>
#endif
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/net/if_llatbl.h>
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <net/if_llatbl.h>
#define L3_ADDR_SIN6(le) ((struct sockaddr_in6 *) L3_ADDR(le))
-#include <freebsd/netinet6/in6_var.h>
-#include <freebsd/netinet6/in6_ifattach.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/scope6_var.h>
-#include <freebsd/netinet6/nd6.h>
-#include <freebsd/netinet/icmp6.h>
-#include <freebsd/netinet/ip_carp.h>
+#include <netinet6/in6_var.h>
+#include <netinet6/in6_ifattach.h>
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/scope6_var.h>
+#include <netinet6/nd6.h>
+#include <netinet/icmp6.h>
+#include <netinet/ip_carp.h>
#define SDL(s) ((struct sockaddr_dl *)s)
diff --git a/freebsd/sys/netinet6/nd6_rtr.c b/freebsd/sys/netinet6/nd6_rtr.c
index 97aa15fb..f2a07d96 100644
--- a/freebsd/sys/netinet6/nd6_rtr.c
+++ b/freebsd/sys/netinet6/nd6_rtr.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -31,42 +31,42 @@
* $KAME: nd6_rtr.c,v 1.111 2001/04/27 01:37:15 jinmei Exp $
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/sockio.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/queue.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/if_dl.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/radix.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/net/if_llatbl.h>
-#include <freebsd/netinet6/in6_var.h>
-#include <freebsd/netinet6/in6_ifattach.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/nd6.h>
-#include <freebsd/netinet/icmp6.h>
-#include <freebsd/netinet6/scope6_var.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/rwlock.h>
+#include <sys/syslog.h>
+#include <sys/queue.h>
+
+#include <net/if.h>
+#include <net/if_types.h>
+#include <net/if_dl.h>
+#include <net/route.h>
+#include <net/radix.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <net/if_llatbl.h>
+#include <netinet6/in6_var.h>
+#include <netinet6/in6_ifattach.h>
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/nd6.h>
+#include <netinet/icmp6.h>
+#include <netinet6/scope6_var.h>
static int rtpref(struct nd_defrouter *);
static struct nd_defrouter *defrtrlist_update(struct nd_defrouter *);
diff --git a/freebsd/sys/netinet6/pim6_var.h b/freebsd/sys/netinet6/pim6_var.h
index 8c63b5cc..19d0e900 100644
--- a/freebsd/sys/netinet6/pim6_var.h
+++ b/freebsd/sys/netinet6/pim6_var.h
@@ -38,8 +38,8 @@
* Modified by Pavlin Ivanov Radoslavov, USC/ISI, May 1998
*/
-#ifndef _NETINET6_PIM6_VAR_HH_
-#define _NETINET6_PIM6_VAR_HH_
+#ifndef _NETINET6_PIM6_VAR_H_
+#define _NETINET6_PIM6_VAR_H_
struct pim6stat {
u_quad_t pim6s_rcv_total; /* total PIM messages received */
@@ -65,4 +65,4 @@ int pim6_input __P((struct mbuf **, int*, int));
{ 0, 0 }, \
{ 0, 0 }, \
}
-#endif /* _NETINET6_PIM6_VAR_HH_ */
+#endif /* _NETINET6_PIM6_VAR_H_ */
diff --git a/freebsd/sys/netinet6/raw_ip6.c b/freebsd/sys/netinet6/raw_ip6.c
index 71a8add8..9ea1895d 100644
--- a/freebsd/sys/netinet6/raw_ip6.c
+++ b/freebsd/sys/netinet6/raw_ip6.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,53 +61,53 @@
* @(#)raw_ip.c 8.2 (Berkeley) 1/4/94
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_ipsec.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/syslog.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_pcb.h>
-
-#include <freebsd/netinet/icmp6.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6protosw.h>
-#include <freebsd/netinet6/ip6_mroute.h>
-#include <freebsd/netinet6/in6_pcb.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/nd6.h>
-#include <freebsd/netinet6/raw_ip6.h>
-#include <freebsd/netinet6/scope6_var.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/jail.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/protosw.h>
+#include <sys/signalvar.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sx.h>
+#include <sys/syslog.h>
+
+#include <net/if.h>
+#include <net/if_types.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_pcb.h>
+
+#include <netinet/icmp6.h>
+#include <netinet/ip6.h>
+#include <netinet6/ip6protosw.h>
+#include <netinet6/ip6_mroute.h>
+#include <netinet6/in6_pcb.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/nd6.h>
+#include <netinet6/raw_ip6.h>
+#include <netinet6/scope6_var.h>
#ifdef IPSEC
-#include <freebsd/netipsec/ipsec.h>
-#include <freebsd/netipsec/ipsec6.h>
+#include <netipsec/ipsec.h>
+#include <netipsec/ipsec6.h>
#endif /* IPSEC */
-#include <freebsd/machine/stdarg.h>
+#include <machine/stdarg.h>
#define satosin6(sa) ((struct sockaddr_in6 *)(sa))
#define ifatoia6(ifa) ((struct in6_ifaddr *)(ifa))
diff --git a/freebsd/sys/netinet6/raw_ip6.h b/freebsd/sys/netinet6/raw_ip6.h
index c4491d01..23395a67 100644
--- a/freebsd/sys/netinet6/raw_ip6.h
+++ b/freebsd/sys/netinet6/raw_ip6.h
@@ -30,8 +30,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET6_RAW_IP6_HH_
-#define _NETINET6_RAW_IP6_HH_
+#ifndef _NETINET6_RAW_IP6_H_
+#define _NETINET6_RAW_IP6_H_
/*
* ICMPv6 stat is counted separately. see netinet/icmp6.h
diff --git a/freebsd/sys/netinet6/route6.c b/freebsd/sys/netinet6/route6.c
index 72ad9fae..a674b45e 100644
--- a/freebsd/sys/netinet6/route6.c
+++ b/freebsd/sys/netinet6/route6.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -31,27 +31,27 @@
* $KAME: route6.c,v 1.24 2001/03/14 03:07:05 itojun Exp $
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/queue.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/systm.h>
+#include <sys/queue.h>
-#include <freebsd/net/if.h>
+#include <net/if.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet6/in6_var.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/scope6_var.h>
+#include <netinet/in.h>
+#include <netinet6/in6_var.h>
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/scope6_var.h>
-#include <freebsd/netinet/icmp6.h>
+#include <netinet/icmp6.h>
/*
* proto - is unused
diff --git a/freebsd/sys/netinet6/scope6.c b/freebsd/sys/netinet6/scope6.c
index d9a19d56..655022d6 100644
--- a/freebsd/sys/netinet6/scope6.c
+++ b/freebsd/sys/netinet6/scope6.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 2000 WIDE Project.
@@ -31,26 +31,26 @@
* $KAME: scope6.c,v 1.10 2000/07/24 13:29:31 itojun Exp $
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/syslog.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/systm.h>
+#include <sys/queue.h>
+#include <sys/syslog.h>
-#include <freebsd/net/if.h>
-#include <freebsd/net/vnet.h>
+#include <net/if.h>
+#include <net/vnet.h>
-#include <freebsd/netinet/in.h>
+#include <netinet/in.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/in6_var.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/scope6_var.h>
+#include <netinet/ip6.h>
+#include <netinet6/in6_var.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/scope6_var.h>
#ifdef ENABLE_DEFAULT_SCOPE
VNET_DEFINE(int, ip6_use_defzone) = 1;
diff --git a/freebsd/sys/netinet6/scope6_var.h b/freebsd/sys/netinet6/scope6_var.h
index a87aa57c..55e0c8ed 100644
--- a/freebsd/sys/netinet6/scope6_var.h
+++ b/freebsd/sys/netinet6/scope6_var.h
@@ -30,8 +30,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET6_SCOPE6_VAR_HH_
-#define _NETINET6_SCOPE6_VAR_HH_
+#ifndef _NETINET6_SCOPE6_VAR_H_
+#define _NETINET6_SCOPE6_VAR_H_
#ifdef _KERNEL
struct scope6_id {
@@ -57,4 +57,4 @@ int in6_setscope __P((struct in6_addr *, struct ifnet *, u_int32_t *));
int in6_clearscope __P((struct in6_addr *));
#endif /* _KERNEL */
-#endif /* _NETINET6_SCOPE6_VAR_HH_ */
+#endif /* _NETINET6_SCOPE6_VAR_H_ */
diff --git a/freebsd/sys/netinet6/sctp6_usrreq.c b/freebsd/sys/netinet6/sctp6_usrreq.c
index 178f0d84..6cdd340e 100644
--- a/freebsd/sys/netinet6/sctp6_usrreq.c
+++ b/freebsd/sys/netinet6/sctp6_usrreq.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
@@ -31,35 +31,35 @@
*/
/* $KAME: sctp6_usrreq.c,v 1.38 2005/08/24 08:08:56 suz Exp $ */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/netinet/sctp_os.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/netinet/sctp_pcb.h>
-#include <freebsd/netinet/sctp_header.h>
-#include <freebsd/netinet/sctp_var.h>
+#include <netinet/sctp_os.h>
+#include <sys/proc.h>
+#include <netinet/sctp_pcb.h>
+#include <netinet/sctp_header.h>
+#include <netinet/sctp_var.h>
#if defined(INET6)
-#include <freebsd/netinet6/sctp6_var.h>
+#include <netinet6/sctp6_var.h>
#endif
-#include <freebsd/netinet/sctp_sysctl.h>
-#include <freebsd/netinet/sctp_output.h>
-#include <freebsd/netinet/sctp_uio.h>
-#include <freebsd/netinet/sctp_asconf.h>
-#include <freebsd/netinet/sctputil.h>
-#include <freebsd/netinet/sctp_indata.h>
-#include <freebsd/netinet/sctp_timer.h>
-#include <freebsd/netinet/sctp_auth.h>
-#include <freebsd/netinet/sctp_input.h>
-#include <freebsd/netinet/sctp_output.h>
-#include <freebsd/netinet/sctp_bsd_addr.h>
-#include <freebsd/netinet/sctp_crc32.h>
-#include <freebsd/netinet/udp.h>
+#include <netinet/sctp_sysctl.h>
+#include <netinet/sctp_output.h>
+#include <netinet/sctp_uio.h>
+#include <netinet/sctp_asconf.h>
+#include <netinet/sctputil.h>
+#include <netinet/sctp_indata.h>
+#include <netinet/sctp_timer.h>
+#include <netinet/sctp_auth.h>
+#include <netinet/sctp_input.h>
+#include <netinet/sctp_output.h>
+#include <netinet/sctp_bsd_addr.h>
+#include <netinet/sctp_crc32.h>
+#include <netinet/udp.h>
#ifdef IPSEC
-#include <freebsd/netipsec/ipsec.h>
+#include <netipsec/ipsec.h>
#if defined(INET6)
-#include <freebsd/netipsec/ipsec6.h>
+#include <netipsec/ipsec6.h>
#endif /* INET6 */
#endif /* IPSEC */
diff --git a/freebsd/sys/netinet6/sctp6_var.h b/freebsd/sys/netinet6/sctp6_var.h
index b692fdbd..a05f6b03 100644
--- a/freebsd/sys/netinet6/sctp6_var.h
+++ b/freebsd/sys/netinet6/sctp6_var.h
@@ -29,10 +29,10 @@
*/
/* $KAME: sctp6_var.h,v 1.7 2004/08/17 04:06:22 itojun Exp $ */
-#ifndef _NETINET6_SCTP6_VAR_HH_
-#define _NETINET6_SCTP6_VAR_HH_
+#ifndef _NETINET6_SCTP6_VAR_H_
+#define _NETINET6_SCTP6_VAR_H_
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/* TODO __Userspace__ IPv6 stuff... */
diff --git a/freebsd/sys/netinet6/tcp6_var.h b/freebsd/sys/netinet6/tcp6_var.h
index e0373b3d..7da325a1 100644
--- a/freebsd/sys/netinet6/tcp6_var.h
+++ b/freebsd/sys/netinet6/tcp6_var.h
@@ -59,8 +59,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET_TCP6_VAR_HH_
-#define _NETINET_TCP6_VAR_HH_
+#ifndef _NETINET_TCP6_VAR_H_
+#define _NETINET_TCP6_VAR_H_
#ifdef _KERNEL
#ifdef SYSCTL_DECL
@@ -80,4 +80,4 @@ extern struct pr_usrreqs tcp6_usrreqs;
#endif /* _KERNEL */
-#endif /* _NETINET_TCP6_VAR_HH_ */
+#endif /* _NETINET_TCP6_VAR_H_ */
diff --git a/freebsd/sys/netinet6/udp6_usrreq.c b/freebsd/sys/netinet6/udp6_usrreq.c
index 735c795b..941b3950 100644
--- a/freebsd/sys/netinet6/udp6_usrreq.c
+++ b/freebsd/sys/netinet6/udp6_usrreq.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -64,58 +64,58 @@
* @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipsec.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/systm.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/if_types.h>
-#include <freebsd/net/route.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_pcb.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_icmp.h>
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet/icmp_var.h>
-#include <freebsd/netinet/icmp6.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/udp.h>
-#include <freebsd/netinet/udp_var.h>
-
-#include <freebsd/netinet6/ip6protosw.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/in6_pcb.h>
-#include <freebsd/netinet6/udp6_var.h>
-#include <freebsd/netinet6/scope6_var.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/jail.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mbuf.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/protosw.h>
+#include <sys/signalvar.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sx.h>
+#include <sys/sysctl.h>
+#include <sys/syslog.h>
+#include <sys/systm.h>
+
+#include <net/if.h>
+#include <net/if_types.h>
+#include <net/route.h>
+
+#include <netinet/in.h>
+#include <netinet/in_pcb.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/ip.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/ip6.h>
+#include <netinet/icmp_var.h>
+#include <netinet/icmp6.h>
+#include <netinet/ip_var.h>
+#include <netinet/udp.h>
+#include <netinet/udp_var.h>
+
+#include <netinet6/ip6protosw.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/in6_pcb.h>
+#include <netinet6/udp6_var.h>
+#include <netinet6/scope6_var.h>
#ifdef IPSEC
-#include <freebsd/netipsec/ipsec.h>
-#include <freebsd/netipsec/ipsec6.h>
+#include <netipsec/ipsec.h>
+#include <netipsec/ipsec6.h>
#endif /* IPSEC */
-#include <freebsd/security/mac/mac_framework.h>
+#include <security/mac/mac_framework.h>
/*
* UDP protocol implementation.
diff --git a/freebsd/sys/netinet6/udp6_var.h b/freebsd/sys/netinet6/udp6_var.h
index f52503cd..ae53c5a8 100644
--- a/freebsd/sys/netinet6/udp6_var.h
+++ b/freebsd/sys/netinet6/udp6_var.h
@@ -60,8 +60,8 @@
* $FreeBSD$
*/
-#ifndef _NETINET6_UDP6_VAR_HH_
-#define _NETINET6_UDP6_VAR_HH_
+#ifndef _NETINET6_UDP6_VAR_H_
+#define _NETINET6_UDP6_VAR_H_
#ifdef _KERNEL
SYSCTL_DECL(_net_inet6_udp6);
@@ -72,4 +72,4 @@ void udp6_ctlinput(int, struct sockaddr *, void *);
int udp6_input(struct mbuf **, int *, int);
#endif
-#endif /*_NETINET6_UDP6_VAR_HH_*/
+#endif /*_NETINET6_UDP6_VAR_H_*/
diff --git a/freebsd/sys/netipsec/ah.h b/freebsd/sys/netipsec/ah.h
index 6a35089b..1ffeacdc 100644
--- a/freebsd/sys/netipsec/ah.h
+++ b/freebsd/sys/netipsec/ah.h
@@ -34,8 +34,8 @@
* RFC1826/2402 authentication header.
*/
-#ifndef _NETIPSEC_AH_HH_
-#define _NETIPSEC_AH_HH_
+#ifndef _NETIPSEC_AH_H_
+#define _NETIPSEC_AH_H_
struct ah {
u_int8_t ah_nxt; /* Next Header */
@@ -53,4 +53,4 @@ struct newah {
u_int32_t ah_seq; /* Sequence number field */
/* variable size, 32bit bound*/ /* Authentication data */
};
-#endif /*_NETIPSEC_AH_HH_*/
+#endif /*_NETIPSEC_AH_H_*/
diff --git a/freebsd/sys/netipsec/ah_var.h b/freebsd/sys/netipsec/ah_var.h
index f82ea401..6145dba9 100644
--- a/freebsd/sys/netipsec/ah_var.h
+++ b/freebsd/sys/netipsec/ah_var.h
@@ -36,8 +36,8 @@
* PURPOSE.
*/
-#ifndef _NETIPSEC_AH_VAR_HH_
-#define _NETIPSEC_AH_VAR_HH_
+#ifndef _NETIPSEC_AH_VAR_H_
+#define _NETIPSEC_AH_VAR_H_
/*
* These define the algorithm indices into the histogram. They're
@@ -79,4 +79,4 @@ VNET_DECLARE(struct ahstat, ahstat);
#define V_ah_cleartos VNET(ah_cleartos)
#define V_ahstat VNET(ahstat)
#endif /* _KERNEL */
-#endif /*_NETIPSEC_AH_VAR_HH_*/
+#endif /*_NETIPSEC_AH_VAR_H_*/
diff --git a/freebsd/sys/netipsec/esp.h b/freebsd/sys/netipsec/esp.h
index 282883b2..eb373970 100644
--- a/freebsd/sys/netipsec/esp.h
+++ b/freebsd/sys/netipsec/esp.h
@@ -34,8 +34,8 @@
* RFC1827/2406 Encapsulated Security Payload.
*/
-#ifndef _NETIPSEC_ESP_HH_
-#define _NETIPSEC_ESP_HH_
+#ifndef _NETIPSEC_ESP_H_
+#define _NETIPSEC_ESP_H_
struct esp {
u_int32_t esp_spi; /* ESP */
@@ -66,4 +66,4 @@ struct esptail {
};
#define ESP_ALEN 12 /* 96-bit authenticator */
-#endif /*_NETIPSEC_ESP_HH_*/
+#endif /*_NETIPSEC_ESP_H_*/
diff --git a/freebsd/sys/netipsec/esp_var.h b/freebsd/sys/netipsec/esp_var.h
index eda4033b..477dcbf5 100644
--- a/freebsd/sys/netipsec/esp_var.h
+++ b/freebsd/sys/netipsec/esp_var.h
@@ -36,8 +36,8 @@
* PURPOSE.
*/
-#ifndef _NETIPSEC_ESP_VAR_HH_
-#define _NETIPSEC_ESP_VAR_HH_
+#ifndef _NETIPSEC_ESP_VAR_H_
+#define _NETIPSEC_ESP_VAR_H_
/*
* These define the algorithm indices into the histogram. They're
@@ -78,4 +78,4 @@ VNET_DECLARE(struct espstat, espstat);
#define V_esp_enable VNET(esp_enable)
#define V_espstat VNET(espstat)
#endif /* _KERNEL */
-#endif /*_NETIPSEC_ESP_VAR_HH_*/
+#endif /*_NETIPSEC_ESP_VAR_H_*/
diff --git a/freebsd/sys/netipsec/ipcomp.h b/freebsd/sys/netipsec/ipcomp.h
index a43bf2e8..47e9305e 100644
--- a/freebsd/sys/netipsec/ipcomp.h
+++ b/freebsd/sys/netipsec/ipcomp.h
@@ -34,8 +34,8 @@
* RFC2393 IP payload compression protocol (IPComp).
*/
-#ifndef _NETIPSEC_IPCOMP_HH_
-#define _NETIPSEC_IPCOMP_HH_
+#ifndef _NETIPSEC_IPCOMP_H_
+#define _NETIPSEC_IPCOMP_H_
struct ipcomp {
u_int8_t comp_nxt; /* Next Header */
@@ -52,4 +52,4 @@ struct ipcomp {
#define IPCOMP_MAX 4
#define IPCOMP_CPI_NEGOTIATE_MIN 256
-#endif /*_NETIPSEC_IPCOMP_HH_*/
+#endif /*_NETIPSEC_IPCOMP_H_*/
diff --git a/freebsd/sys/netipsec/ipcomp_var.h b/freebsd/sys/netipsec/ipcomp_var.h
index bf4598f4..c99a3be7 100644
--- a/freebsd/sys/netipsec/ipcomp_var.h
+++ b/freebsd/sys/netipsec/ipcomp_var.h
@@ -30,8 +30,8 @@
* SUCH DAMAGE.
*/
-#ifndef _NETIPSEC_IPCOMP_VAR_HH_
-#define _NETIPSEC_IPCOMP_VAR_HH_
+#ifndef _NETIPSEC_IPCOMP_VAR_H_
+#define _NETIPSEC_IPCOMP_VAR_H_
/*
* These define the algorithm indices into the histogram. They're
@@ -71,4 +71,4 @@ VNET_DECLARE(struct ipcompstat, ipcompstat);
#define V_ipcomp_enable VNET(ipcomp_enable)
#define V_ipcompstat VNET(ipcompstat)
#endif /* _KERNEL */
-#endif /*_NETIPSEC_IPCOMP_VAR_HH_*/
+#endif /*_NETIPSEC_IPCOMP_VAR_H_*/
diff --git a/freebsd/sys/netipsec/ipip_var.h b/freebsd/sys/netipsec/ipip_var.h
index 51d8a554..3c8c3974 100644
--- a/freebsd/sys/netipsec/ipip_var.h
+++ b/freebsd/sys/netipsec/ipip_var.h
@@ -36,8 +36,8 @@
* PURPOSE.
*/
-#ifndef _NETINET_IPIP_HH_
-#define _NETINET_IPIP_HH_
+#ifndef _NETINET_IPIP_H_
+#define _NETINET_IPIP_H_
/*
* IP-inside-IP processing.
@@ -65,4 +65,4 @@ VNET_DECLARE(struct ipipstat, ipipstat);
#define V_ipip_allow VNET(ipip_allow)
#define V_ipipstat VNET(ipipstat)
#endif /* _KERNEL */
-#endif /* _NETINET_IPIP_HH_ */
+#endif /* _NETINET_IPIP_H_ */
diff --git a/freebsd/sys/netipsec/ipsec.c b/freebsd/sys/netipsec/ipsec.c
index 95aefca3..4c19caec 100644
--- a/freebsd/sys/netipsec/ipsec.c
+++ b/freebsd/sys/netipsec/ipsec.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/* $KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $ */
@@ -36,68 +36,68 @@
* IPsec controller part.
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipsec.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/proc.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/udp.h>
-#include <freebsd/netinet/udp_var.h>
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/udp.h>
-
-#include <freebsd/netinet/ip6.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/domain.h>
+#include <sys/priv.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <rtems/bsd/sys/errno.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/kernel.h>
+#include <sys/syslog.h>
+#include <sys/sysctl.h>
+#include <sys/proc.h>
+
+#include <net/if.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+#include <netinet/in_var.h>
+#include <netinet/udp.h>
+#include <netinet/udp_var.h>
+#include <netinet/tcp.h>
+#include <netinet/udp.h>
+
+#include <netinet/ip6.h>
#ifdef INET6
-#include <freebsd/netinet6/ip6_var.h>
+#include <netinet6/ip6_var.h>
#endif
-#include <freebsd/netinet/in_pcb.h>
+#include <netinet/in_pcb.h>
#ifdef INET6
-#include <freebsd/netinet/icmp6.h>
+#include <netinet/icmp6.h>
#endif
-#include <freebsd/sys/types.h>
-#include <freebsd/netipsec/ipsec.h>
+#include <rtems/bsd/sys/types.h>
+#include <netipsec/ipsec.h>
#ifdef INET6
-#include <freebsd/netipsec/ipsec6.h>
+#include <netipsec/ipsec6.h>
#endif
-#include <freebsd/netipsec/ah_var.h>
-#include <freebsd/netipsec/esp_var.h>
-#include <freebsd/netipsec/ipcomp.h> /*XXX*/
-#include <freebsd/netipsec/ipcomp_var.h>
+#include <netipsec/ah_var.h>
+#include <netipsec/esp_var.h>
+#include <netipsec/ipcomp.h> /*XXX*/
+#include <netipsec/ipcomp_var.h>
-#include <freebsd/netipsec/key.h>
-#include <freebsd/netipsec/keydb.h>
-#include <freebsd/netipsec/key_debug.h>
+#include <netipsec/key.h>
+#include <netipsec/keydb.h>
+#include <netipsec/key_debug.h>
-#include <freebsd/netipsec/xform.h>
+#include <netipsec/xform.h>
-#include <freebsd/machine/in_cksum.h>
+#include <machine/in_cksum.h>
-#include <freebsd/opencrypto/cryptodev.h>
+#include <opencrypto/cryptodev.h>
#ifdef IPSEC_DEBUG
VNET_DEFINE(int, ipsec_debug) = 1;
diff --git a/freebsd/sys/netipsec/ipsec.h b/freebsd/sys/netipsec/ipsec.h
index ca9a52f3..d54e7cff 100644
--- a/freebsd/sys/netipsec/ipsec.h
+++ b/freebsd/sys/netipsec/ipsec.h
@@ -34,16 +34,16 @@
* IPsec controller part.
*/
-#ifndef _NETIPSEC_IPSEC_HH_
-#define _NETIPSEC_IPSEC_HH_
+#ifndef _NETIPSEC_IPSEC_H_
+#define _NETIPSEC_IPSEC_H_
#if defined(_KERNEL) && !defined(_LKM) && !defined(KLD_MODULE)
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_ipsec.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_ipsec.h>
#endif
-#include <freebsd/net/pfkeyv2.h>
-#include <freebsd/netipsec/keydb.h>
+#include <net/pfkeyv2.h>
+#include <netipsec/keydb.h>
#ifdef _KERNEL
@@ -450,4 +450,4 @@ extern const char *ipsec_strerror __P((void));
#endif /* ! KERNEL */
-#endif /* _NETIPSEC_IPSEC_HH_ */
+#endif /* _NETIPSEC_IPSEC_H_ */
diff --git a/freebsd/sys/netipsec/ipsec6.h b/freebsd/sys/netipsec/ipsec6.h
index 7213fce7..c004220e 100644
--- a/freebsd/sys/netipsec/ipsec6.h
+++ b/freebsd/sys/netipsec/ipsec6.h
@@ -34,11 +34,11 @@
* IPsec controller part.
*/
-#ifndef _NETIPSEC_IPSEC6_HH_
-#define _NETIPSEC_IPSEC6_HH_
+#ifndef _NETIPSEC_IPSEC6_H_
+#define _NETIPSEC_IPSEC6_H_
-#include <freebsd/net/pfkeyv2.h>
-#include <freebsd/netipsec/keydb.h>
+#include <net/pfkeyv2.h>
+#include <netipsec/keydb.h>
#ifdef _KERNEL
VNET_DECLARE(struct ipsecstat, ipsec6stat);
@@ -75,4 +75,4 @@ extern int ipsec6_output_tunnel __P((struct ipsec_output_state *,
struct secpolicy *, int));
#endif /*_KERNEL*/
-#endif /*_NETIPSEC_IPSEC6_HH_*/
+#endif /*_NETIPSEC_IPSEC6_H_*/
diff --git a/freebsd/sys/netipsec/ipsec_input.c b/freebsd/sys/netipsec/ipsec_input.c
index d8714348..ace3eaea 100644
--- a/freebsd/sys/netipsec/ipsec_input.c
+++ b/freebsd/sys/netipsec/ipsec_input.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/* $OpenBSD: ipsec_input.c,v 1.63 2003/02/20 18:35:43 deraadt Exp $ */
@@ -42,62 +42,62 @@
* IPsec input processing.
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipsec.h>
-#include <freebsd/local/opt_enc.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/syslog.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/pfil.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/in_var.h>
-
-#include <freebsd/netinet/ip6.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+#include <rtems/bsd/local/opt_enc.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/domain.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/syslog.h>
+
+#include <net/if.h>
+#include <net/pfil.h>
+#include <net/route.h>
+#include <net/netisr.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+#include <netinet/in_var.h>
+
+#include <netinet/ip6.h>
#ifdef INET6
-#include <freebsd/netinet6/ip6_var.h>
+#include <netinet6/ip6_var.h>
#endif
-#include <freebsd/netinet/in_pcb.h>
+#include <netinet/in_pcb.h>
#ifdef INET6
-#include <freebsd/netinet/icmp6.h>
+#include <netinet/icmp6.h>
#endif
-#include <freebsd/netipsec/ipsec.h>
+#include <netipsec/ipsec.h>
#ifdef INET6
-#include <freebsd/netipsec/ipsec6.h>
+#include <netipsec/ipsec6.h>
#endif
-#include <freebsd/netipsec/ah_var.h>
-#include <freebsd/netipsec/esp.h>
-#include <freebsd/netipsec/esp_var.h>
-#include <freebsd/netipsec/ipcomp_var.h>
+#include <netipsec/ah_var.h>
+#include <netipsec/esp.h>
+#include <netipsec/esp_var.h>
+#include <netipsec/ipcomp_var.h>
-#include <freebsd/netipsec/key.h>
-#include <freebsd/netipsec/keydb.h>
+#include <netipsec/key.h>
+#include <netipsec/keydb.h>
-#include <freebsd/netipsec/xform.h>
-#include <freebsd/netinet6/ip6protosw.h>
+#include <netipsec/xform.h>
+#include <netinet6/ip6protosw.h>
-#include <freebsd/machine/in_cksum.h>
-#include <freebsd/machine/stdarg.h>
+#include <machine/in_cksum.h>
+#include <machine/stdarg.h>
#ifdef DEV_ENC
-#include <freebsd/net/if_enc.h>
+#include <net/if_enc.h>
#endif
diff --git a/freebsd/sys/netipsec/ipsec_mbuf.c b/freebsd/sys/netipsec/ipsec_mbuf.c
index f888e60d..24e1ea81 100644
--- a/freebsd/sys/netipsec/ipsec_mbuf.c
+++ b/freebsd/sys/netipsec/ipsec_mbuf.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
@@ -32,19 +32,19 @@
* IPsec-specific mbuf routines.
*/
-#include <freebsd/local/opt_param.h>
+#include <rtems/bsd/local/opt_param.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
+#include <net/route.h>
+#include <net/vnet.h>
-#include <freebsd/netinet/in.h>
+#include <netinet/in.h>
-#include <freebsd/netipsec/ipsec.h>
+#include <netipsec/ipsec.h>
/*
* Make space for a new header of length hlen at skip bytes
diff --git a/freebsd/sys/netipsec/ipsec_output.c b/freebsd/sys/netipsec/ipsec_output.c
index 5fdaa0e5..d477b5f4 100644
--- a/freebsd/sys/netipsec/ipsec_output.c
+++ b/freebsd/sys/netipsec/ipsec_output.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
@@ -31,66 +31,66 @@
/*
* IPsec output processing.
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipsec.h>
-#include <freebsd/local/opt_enc.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/syslog.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/pfil.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip_ecn.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+#include <rtems/bsd/local/opt_enc.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/domain.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/syslog.h>
+
+#include <net/if.h>
+#include <net/pfil.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+#include <netinet/in_var.h>
+#include <netinet/ip_ecn.h>
#ifdef INET6
-#include <freebsd/netinet6/ip6_ecn.h>
+#include <netinet6/ip6_ecn.h>
#endif
-#include <freebsd/netinet/ip6.h>
+#include <netinet/ip6.h>
#ifdef INET6
-#include <freebsd/netinet6/ip6_var.h>
+#include <netinet6/ip6_var.h>
#endif
-#include <freebsd/netinet/in_pcb.h>
+#include <netinet/in_pcb.h>
#ifdef INET6
-#include <freebsd/netinet/icmp6.h>
+#include <netinet/icmp6.h>
#endif
-#include <freebsd/netipsec/ipsec.h>
+#include <netipsec/ipsec.h>
#ifdef INET6
-#include <freebsd/netipsec/ipsec6.h>
+#include <netipsec/ipsec6.h>
#endif
-#include <freebsd/netipsec/ah_var.h>
-#include <freebsd/netipsec/esp_var.h>
-#include <freebsd/netipsec/ipcomp_var.h>
+#include <netipsec/ah_var.h>
+#include <netipsec/esp_var.h>
+#include <netipsec/ipcomp_var.h>
-#include <freebsd/netipsec/xform.h>
+#include <netipsec/xform.h>
-#include <freebsd/netipsec/key.h>
-#include <freebsd/netipsec/keydb.h>
-#include <freebsd/netipsec/key_debug.h>
+#include <netipsec/key.h>
+#include <netipsec/keydb.h>
+#include <netipsec/key_debug.h>
-#include <freebsd/machine/in_cksum.h>
+#include <machine/in_cksum.h>
#ifdef IPSEC_NAT_T
-#include <freebsd/netinet/udp.h>
+#include <netinet/udp.h>
#endif
#ifdef DEV_ENC
-#include <freebsd/net/if_enc.h>
+#include <net/if_enc.h>
#endif
diff --git a/freebsd/sys/netipsec/key.c b/freebsd/sys/netipsec/key.c
index 1bf41660..b6fb97a0 100644
--- a/freebsd/sys/netipsec/key.c
+++ b/freebsd/sys/netipsec/key.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/* $KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $ */
@@ -36,69 +36,69 @@
* This code is referd to RFC 2367
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipsec.h>
-
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/refcount.h>
-#include <freebsd/sys/syslog.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/raw_cb.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/in_var.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipsec.h>
+
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/mbuf.h>
+#include <sys/domain.h>
+#include <sys/protosw.h>
+#include <sys/malloc.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sysctl.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/proc.h>
+#include <sys/queue.h>
+#include <sys/refcount.h>
+#include <sys/syslog.h>
+
+#include <net/if.h>
+#include <net/route.h>
+#include <net/raw_cb.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/in_var.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netinet6/in6_var.h>
-#include <freebsd/netinet6/ip6_var.h>
+#include <netinet/ip6.h>
+#include <netinet6/in6_var.h>
+#include <netinet6/ip6_var.h>
#endif /* INET6 */
#ifdef INET
-#include <freebsd/netinet/in_pcb.h>
+#include <netinet/in_pcb.h>
#endif
#ifdef INET6
-#include <freebsd/netinet6/in6_pcb.h>
+#include <netinet6/in6_pcb.h>
#endif /* INET6 */
-#include <freebsd/net/pfkeyv2.h>
-#include <freebsd/netipsec/keydb.h>
-#include <freebsd/netipsec/key.h>
-#include <freebsd/netipsec/keysock.h>
-#include <freebsd/netipsec/key_debug.h>
+#include <net/pfkeyv2.h>
+#include <netipsec/keydb.h>
+#include <netipsec/key.h>
+#include <netipsec/keysock.h>
+#include <netipsec/key_debug.h>
-#include <freebsd/netipsec/ipsec.h>
+#include <netipsec/ipsec.h>
#ifdef INET6
-#include <freebsd/netipsec/ipsec6.h>
+#include <netipsec/ipsec6.h>
#endif
-#include <freebsd/netipsec/xform.h>
+#include <netipsec/xform.h>
-#include <freebsd/machine/stdarg.h>
+#include <machine/stdarg.h>
/* randomness */
-#include <freebsd/sys/random.h>
+#include <sys/random.h>
#define FULLMASK 0xff
#define _BITS(bytes) ((bytes) << 3)
@@ -3962,7 +3962,7 @@ key_ismyaddr(sa)
* 0: other
* NOTE: derived ip6_input() in KAME. This is necessary to modify more.
*/
-#include <freebsd/netinet6/in6_var.h>
+#include <netinet6/in6_var.h>
static int
key_ismyaddr6(sin6)
diff --git a/freebsd/sys/netipsec/key.h b/freebsd/sys/netipsec/key.h
index 4d2b3083..e85acd1e 100644
--- a/freebsd/sys/netipsec/key.h
+++ b/freebsd/sys/netipsec/key.h
@@ -30,8 +30,8 @@
* SUCH DAMAGE.
*/
-#ifndef _NETIPSEC_KEY_HH_
-#define _NETIPSEC_KEY_HH_
+#ifndef _NETIPSEC_KEY_H_
+#define _NETIPSEC_KEY_H_
#ifdef _KERNEL
@@ -124,4 +124,4 @@ MALLOC_DECLARE(M_IPSEC_INPCB);
#endif /* MALLOC_DECLARE */
#endif /* defined(_KERNEL) */
-#endif /* _NETIPSEC_KEY_HH_ */
+#endif /* _NETIPSEC_KEY_H_ */
diff --git a/freebsd/sys/netipsec/key_debug.c b/freebsd/sys/netipsec/key_debug.c
index b8d909b3..0fc9308f 100644
--- a/freebsd/sys/netipsec/key_debug.c
+++ b/freebsd/sys/netipsec/key_debug.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/* $KAME: key_debug.c,v 1.26 2001/06/27 10:46:50 sakane Exp $ */
@@ -33,36 +33,36 @@
*/
#ifdef _KERNEL
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_ipsec.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_ipsec.h>
#endif
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
#ifdef _KERNEL
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/queue.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/queue.h>
#endif
-#include <freebsd/sys/socket.h>
+#include <sys/socket.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
+#include <net/route.h>
+#include <net/vnet.h>
-#include <freebsd/netipsec/key_var.h>
-#include <freebsd/netipsec/key_debug.h>
+#include <netipsec/key_var.h>
+#include <netipsec/key_debug.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netipsec/ipsec.h>
+#include <netinet/in.h>
+#include <netipsec/ipsec.h>
#ifdef _KERNEL
-#include <freebsd/netipsec/keydb.h>
+#include <netipsec/keydb.h>
#endif
#ifndef _KERNEL
-#include <freebsd/ctype.h>
-#include <freebsd/stdio.h>
-#include <freebsd/stdlib.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
#endif /* !_KERNEL */
static void kdebug_sadb_prop __P((struct sadb_ext *));
diff --git a/freebsd/sys/netipsec/key_debug.h b/freebsd/sys/netipsec/key_debug.h
index 26dfdbcf..1a3782b1 100644
--- a/freebsd/sys/netipsec/key_debug.h
+++ b/freebsd/sys/netipsec/key_debug.h
@@ -30,8 +30,8 @@
* SUCH DAMAGE.
*/
-#ifndef _NETIPSEC_KEY_DEBUG_HH_
-#define _NETIPSEC_KEY_DEBUG_HH_
+#ifndef _NETIPSEC_KEY_DEBUG_H_
+#define _NETIPSEC_KEY_DEBUG_H_
#ifdef _KERNEL
/* debug flags */
@@ -86,4 +86,4 @@ extern void kdebug_sockaddr __P((struct sockaddr *));
extern void ipsec_hexdump __P((caddr_t, int));
extern void ipsec_bindump __P((caddr_t, int));
-#endif /* _NETIPSEC_KEY_DEBUG_HH_ */
+#endif /* _NETIPSEC_KEY_DEBUG_H_ */
diff --git a/freebsd/sys/netipsec/key_var.h b/freebsd/sys/netipsec/key_var.h
index 127b6abf..edf232d8 100644
--- a/freebsd/sys/netipsec/key_var.h
+++ b/freebsd/sys/netipsec/key_var.h
@@ -30,8 +30,8 @@
* SUCH DAMAGE.
*/
-#ifndef _NETIPSEC_KEY_VAR_HH_
-#define _NETIPSEC_KEY_VAR_HH_
+#ifndef _NETIPSEC_KEY_VAR_H_
+#define _NETIPSEC_KEY_VAR_H_
/* sysctl */
#define KEYCTL_DEBUG_LEVEL 1
@@ -71,4 +71,4 @@
#define _KEYBUF(key) ((caddr_t)((caddr_t)(key) + sizeof(struct sadb_key)))
#endif /*_KERNEL*/
-#endif /* _NETIPSEC_KEY_VAR_HH_ */
+#endif /* _NETIPSEC_KEY_VAR_H_ */
diff --git a/freebsd/sys/netipsec/keydb.h b/freebsd/sys/netipsec/keydb.h
index 7fe8ab39..f16d1ea2 100644
--- a/freebsd/sys/netipsec/keydb.h
+++ b/freebsd/sys/netipsec/keydb.h
@@ -30,12 +30,12 @@
* SUCH DAMAGE.
*/
-#ifndef _NETIPSEC_KEYDB_HH_
-#define _NETIPSEC_KEYDB_HH_
+#ifndef _NETIPSEC_KEYDB_H_
+#define _NETIPSEC_KEYDB_H_
#ifdef _KERNEL
-#include <freebsd/netipsec/key_var.h>
+#include <netipsec/key_var.h>
#ifndef _SOCKADDR_UNION_DEFINED
#define _SOCKADDR_UNION_DEFINED
@@ -224,4 +224,4 @@ extern void keydb_delsecreg __P((struct secreg *));
#endif /* _KERNEL */
-#endif /* _NETIPSEC_KEYDB_HH_ */
+#endif /* _NETIPSEC_KEYDB_H_ */
diff --git a/freebsd/sys/netipsec/keysock.c b/freebsd/sys/netipsec/keysock.c
index bd8d2170..21502bb9 100644
--- a/freebsd/sys/netipsec/keysock.c
+++ b/freebsd/sys/netipsec/keysock.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/* $KAME: keysock.c,v 1.25 2001/08/13 20:07:41 itojun Exp $ */
@@ -32,41 +32,41 @@
* SUCH DAMAGE.
*/
-#include <freebsd/local/opt_ipsec.h>
+#include <rtems/bsd/local/opt_ipsec.h>
/* This code has derived from sys/net/rtsock.c on FreeBSD2.2.5 */
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/signalvar.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/systm.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/raw_cb.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-
-#include <freebsd/net/pfkeyv2.h>
-#include <freebsd/netipsec/key.h>
-#include <freebsd/netipsec/keysock.h>
-#include <freebsd/netipsec/key_debug.h>
-#include <freebsd/netipsec/ipsec.h>
-
-#include <freebsd/machine/stdarg.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/domain.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/mutex.h>
+#include <sys/priv.h>
+#include <sys/protosw.h>
+#include <sys/signalvar.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/sysctl.h>
+#include <sys/systm.h>
+
+#include <net/if.h>
+#include <net/raw_cb.h>
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+
+#include <net/pfkeyv2.h>
+#include <netipsec/key.h>
+#include <netipsec/keysock.h>
+#include <netipsec/key_debug.h>
+#include <netipsec/ipsec.h>
+
+#include <machine/stdarg.h>
struct key_cb {
int key_count;
diff --git a/freebsd/sys/netipsec/keysock.h b/freebsd/sys/netipsec/keysock.h
index 2d147b7a..3c0cc8b8 100644
--- a/freebsd/sys/netipsec/keysock.h
+++ b/freebsd/sys/netipsec/keysock.h
@@ -30,8 +30,8 @@
* SUCH DAMAGE.
*/
-#ifndef _NETIPSEC_KEYSOCK_HH_
-#define _NETIPSEC_KEYSOCK_HH_
+#ifndef _NETIPSEC_KEYSOCK_H_
+#define _NETIPSEC_KEYSOCK_H_
/* statistics for pfkey socket */
struct pfkeystat {
@@ -80,4 +80,4 @@ extern int key_sendup __P((struct socket *, struct sadb_msg *, u_int, int));
extern int key_sendup_mbuf __P((struct socket *, struct mbuf *, int));
#endif /* _KERNEL */
-#endif /*_NETIPSEC_KEYSOCK_HH_*/
+#endif /*_NETIPSEC_KEYSOCK_H_*/
diff --git a/freebsd/sys/netipsec/xform.h b/freebsd/sys/netipsec/xform.h
index d229e17d..fc259c91 100644
--- a/freebsd/sys/netipsec/xform.h
+++ b/freebsd/sys/netipsec/xform.h
@@ -38,12 +38,12 @@
* PURPOSE.
*/
-#ifndef _NETIPSEC_XFORM_HH_
-#define _NETIPSEC_XFORM_HH_
+#ifndef _NETIPSEC_XFORM_H_
+#define _NETIPSEC_XFORM_H_
-#include <freebsd/sys/types.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/opencrypto/xform.h>
+#include <rtems/bsd/sys/types.h>
+#include <netinet/in.h>
+#include <opencrypto/xform.h>
#define AH_HMAC_HASHLEN 12 /* 96 bits of authenticator */
#define AH_HMAC_INITIAL_RPL 1 /* replay counter initial value */
@@ -126,4 +126,4 @@ extern size_t esp_hdrsiz(struct secasvar *sav);
extern struct comp_algo *ipcomp_algorithm_lookup(int alg);
#endif /* _KERNEL */
-#endif /* _NETIPSEC_XFORM_HH_ */
+#endif /* _NETIPSEC_XFORM_H_ */
diff --git a/freebsd/sys/netipsec/xform_ah.c b/freebsd/sys/netipsec/xform_ah.c
index 34014eef..f5c0929b 100644
--- a/freebsd/sys/netipsec/xform_ah.c
+++ b/freebsd/sys/netipsec/xform_ah.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/* $OpenBSD: ip_ah.c,v 1.63 2001/06/26 06:18:58 angelos Exp $ */
@@ -38,42 +38,42 @@
* MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
* PURPOSE.
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_ecn.h>
-#include <freebsd/netinet/ip6.h>
-
-#include <freebsd/net/route.h>
-#include <freebsd/netipsec/ipsec.h>
-#include <freebsd/netipsec/ah.h>
-#include <freebsd/netipsec/ah_var.h>
-#include <freebsd/netipsec/xform.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/syslog.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
+
+#include <net/if.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_ecn.h>
+#include <netinet/ip6.h>
+
+#include <net/route.h>
+#include <netipsec/ipsec.h>
+#include <netipsec/ah.h>
+#include <netipsec/ah_var.h>
+#include <netipsec/xform.h>
#ifdef INET6
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netipsec/ipsec6.h>
-#include <freebsd/netinet6/ip6_ecn.h>
+#include <netinet6/ip6_var.h>
+#include <netipsec/ipsec6.h>
+#include <netinet6/ip6_ecn.h>
#endif
-#include <freebsd/netipsec/key.h>
-#include <freebsd/netipsec/key_debug.h>
+#include <netipsec/key.h>
+#include <netipsec/key_debug.h>
-#include <freebsd/opencrypto/cryptodev.h>
+#include <opencrypto/cryptodev.h>
/*
* Return header size in bytes. The old protocol did not support
diff --git a/freebsd/sys/netipsec/xform_esp.c b/freebsd/sys/netipsec/xform_esp.c
index 3a550d17..04d7bd51 100644
--- a/freebsd/sys/netipsec/xform_esp.c
+++ b/freebsd/sys/netipsec/xform_esp.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/* $OpenBSD: ip_esp.c,v 1.69 2001/06/26 06:18:59 angelos Exp $ */
@@ -37,46 +37,46 @@
* MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
* PURPOSE.
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/syslog.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/random.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_ecn.h>
-#include <freebsd/netinet/ip6.h>
-
-#include <freebsd/net/route.h>
-#include <freebsd/netipsec/ipsec.h>
-#include <freebsd/netipsec/ah.h>
-#include <freebsd/netipsec/ah_var.h>
-#include <freebsd/netipsec/esp.h>
-#include <freebsd/netipsec/esp_var.h>
-#include <freebsd/netipsec/xform.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/syslog.h>
+#include <sys/kernel.h>
+#include <sys/random.h>
+#include <sys/sysctl.h>
+
+#include <net/if.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_ecn.h>
+#include <netinet/ip6.h>
+
+#include <net/route.h>
+#include <netipsec/ipsec.h>
+#include <netipsec/ah.h>
+#include <netipsec/ah_var.h>
+#include <netipsec/esp.h>
+#include <netipsec/esp_var.h>
+#include <netipsec/xform.h>
#ifdef INET6
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netipsec/ipsec6.h>
-#include <freebsd/netinet6/ip6_ecn.h>
+#include <netinet6/ip6_var.h>
+#include <netipsec/ipsec6.h>
+#include <netinet6/ip6_ecn.h>
#endif
-#include <freebsd/netipsec/key.h>
-#include <freebsd/netipsec/key_debug.h>
+#include <netipsec/key.h>
+#include <netipsec/key_debug.h>
-#include <freebsd/opencrypto/cryptodev.h>
-#include <freebsd/opencrypto/xform.h>
+#include <opencrypto/cryptodev.h>
+#include <opencrypto/xform.h>
VNET_DEFINE(int, esp_enable) = 1;
VNET_DEFINE(struct espstat, espstat);
diff --git a/freebsd/sys/netipsec/xform_ipcomp.c b/freebsd/sys/netipsec/xform_ipcomp.c
index a4a65953..2c0f961f 100644
--- a/freebsd/sys/netipsec/xform_ipcomp.c
+++ b/freebsd/sys/netipsec/xform_ipcomp.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/* $OpenBSD: ip_ipcomp.c,v 1.1 2001/07/05 12:08:52 jjbg Exp $ */
@@ -31,44 +31,44 @@
*/
/* IP payload compression protocol (IPComp), see RFC 2393 */
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netipsec/ipsec.h>
-#include <freebsd/netipsec/xform.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/socket.h>
+#include <sys/kernel.h>
+#include <sys/protosw.h>
+#include <sys/sysctl.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netipsec/ipsec.h>
+#include <netipsec/xform.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netipsec/ipsec6.h>
+#include <netinet/ip6.h>
+#include <netipsec/ipsec6.h>
#endif
-#include <freebsd/netipsec/ipcomp.h>
-#include <freebsd/netipsec/ipcomp_var.h>
+#include <netipsec/ipcomp.h>
+#include <netipsec/ipcomp_var.h>
-#include <freebsd/netipsec/key.h>
-#include <freebsd/netipsec/key_debug.h>
+#include <netipsec/key.h>
+#include <netipsec/key_debug.h>
-#include <freebsd/opencrypto/cryptodev.h>
-#include <freebsd/opencrypto/deflate.h>
-#include <freebsd/opencrypto/xform.h>
+#include <opencrypto/cryptodev.h>
+#include <opencrypto/deflate.h>
+#include <opencrypto/xform.h>
VNET_DEFINE(int, ipcomp_enable) = 1;
VNET_DEFINE(struct ipcompstat, ipcompstat);
diff --git a/freebsd/sys/netipsec/xform_ipip.c b/freebsd/sys/netipsec/xform_ipip.c
index cf89239a..87214ec0 100644
--- a/freebsd/sys/netipsec/xform_ipip.c
+++ b/freebsd/sys/netipsec/xform_ipip.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/* $OpenBSD: ip_ipip.c,v 1.25 2002/06/10 18:04:55 itojun Exp $ */
@@ -41,52 +41,52 @@
/*
* IP-inside-IP processing
*/
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-#include <freebsd/local/opt_enc.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/net/if.h>
-#include <freebsd/net/pfil.h>
-#include <freebsd/net/route.h>
-#include <freebsd/net/netisr.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in_var.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_ecn.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/ip_encap.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+#include <rtems/bsd/local/opt_enc.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/kernel.h>
+#include <sys/protosw.h>
+#include <sys/sysctl.h>
+
+#include <net/if.h>
+#include <net/pfil.h>
+#include <net/route.h>
+#include <net/netisr.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/ip.h>
+#include <netinet/ip_ecn.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip_encap.h>
#ifdef MROUTING
-#include <freebsd/netinet/ip_mroute.h>
+#include <netinet/ip_mroute.h>
#endif
-#include <freebsd/netipsec/ipsec.h>
-#include <freebsd/netipsec/xform.h>
+#include <netipsec/ipsec.h>
+#include <netipsec/xform.h>
-#include <freebsd/netipsec/ipip_var.h>
+#include <netipsec/ipip_var.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netipsec/ipsec6.h>
-#include <freebsd/netinet6/ip6_ecn.h>
-#include <freebsd/netinet6/in6_var.h>
-#include <freebsd/netinet6/ip6protosw.h>
+#include <netinet/ip6.h>
+#include <netipsec/ipsec6.h>
+#include <netinet6/ip6_ecn.h>
+#include <netinet6/in6_var.h>
+#include <netinet6/ip6protosw.h>
#endif
-#include <freebsd/netipsec/key.h>
-#include <freebsd/netipsec/key_debug.h>
+#include <netipsec/key.h>
+#include <netipsec/key_debug.h>
-#include <freebsd/machine/stdarg.h>
+#include <machine/stdarg.h>
/*
* We can control the acceptance of IP4 packets by altering the sysctl
diff --git a/freebsd/sys/netipsec/xform_tcp.c b/freebsd/sys/netipsec/xform_tcp.c
index 2b099639..ca1a3a1b 100644
--- a/freebsd/sys/netipsec/xform_tcp.c
+++ b/freebsd/sys/netipsec/xform_tcp.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
@@ -30,38 +30,38 @@
*/
/* TCP MD5 Signature Option (RFC2385) */
-#include <freebsd/local/opt_inet.h>
-#include <freebsd/local/opt_inet6.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/sysctl.h>
-
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/tcp.h>
-#include <freebsd/netinet/tcp_var.h>
-
-#include <freebsd/net/route.h>
-#include <freebsd/net/vnet.h>
-
-#include <freebsd/netipsec/ipsec.h>
-#include <freebsd/netipsec/xform.h>
+#include <rtems/bsd/local/opt_inet.h>
+#include <rtems/bsd/local/opt_inet6.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/socket.h>
+#include <sys/kernel.h>
+#include <sys/protosw.h>
+#include <sys/sysctl.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_var.h>
+#include <netinet/tcp.h>
+#include <netinet/tcp_var.h>
+
+#include <net/route.h>
+#include <net/vnet.h>
+
+#include <netipsec/ipsec.h>
+#include <netipsec/xform.h>
#ifdef INET6
-#include <freebsd/netinet/ip6.h>
-#include <freebsd/netipsec/ipsec6.h>
+#include <netinet/ip6.h>
+#include <netipsec/ipsec6.h>
#endif
-#include <freebsd/netipsec/key.h>
-#include <freebsd/netipsec/key_debug.h>
+#include <netipsec/key.h>
+#include <netipsec/key_debug.h>
/*
* Initialize a TCP-MD5 SA. Called when the SA is being set up.
diff --git a/freebsd/sys/nios2/include/machine/in_cksum.h b/freebsd/sys/nios2/include/machine/in_cksum.h
new file mode 100644
index 00000000..37d88e2e
--- /dev/null
+++ b/freebsd/sys/nios2/include/machine/in_cksum.h
@@ -0,0 +1,77 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from tahoe: in_cksum.c 1.2 86/01/05
+ * from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91
+ * from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp
+ * from: src/sys/alpha/include/in_cksum.h,v 1.7 2005/03/02 21:33:20 joerg
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_IN_CKSUM_H_
+#define _MACHINE_IN_CKSUM_H_ 1
+
+#include <sys/cdefs.h>
+
+#define in_cksum(m, len) in_cksum_skip(m, len, 0)
+
+/*
+ * It it useful to have an Internet checksum routine which is inlineable
+ * and optimized specifically for the task of computing IP header checksums
+ * in the normal case (where there are no options and the header length is
+ * therefore always exactly five 32-bit words.
+ */
+#ifdef __CC_SUPPORTS___INLINE
+
+static __inline void
+in_cksum_update(struct ip *ip)
+{
+ int __tmpsum;
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256;
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16));
+}
+
+#else
+
+#define in_cksum_update(ip) \
+ do { \
+ int __tmpsum; \
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256; \
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \
+ } while(0)
+
+#endif
+
+#ifdef _KERNEL
+u_int in_cksum_hdr(const struct ip *ip);
+u_short in_addword(u_short sum, u_short b);
+u_short in_pseudo(u_int sum, u_int b, u_int c);
+u_short in_cksum_skip(struct mbuf *m, int len, int skip);
+#endif
+
+#endif /* _MACHINE_IN_CKSUM_H_ */
diff --git a/freebsd/sys/nios2/include/machine/legacyvar.h b/freebsd/sys/nios2/include/machine/legacyvar.h
new file mode 100644
index 00000000..0b0fa433
--- /dev/null
+++ b/freebsd/sys/nios2/include/machine/legacyvar.h
@@ -0,0 +1,57 @@
+/*-
+ * Copyright (c) 2000 Peter Wemm <peter@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_LEGACYVAR_H_
+#define _MACHINE_LEGACYVAR_H_
+
+enum legacy_device_ivars {
+ LEGACY_IVAR_PCIDOMAIN,
+ LEGACY_IVAR_PCIBUS
+};
+
+#define LEGACY_ACCESSOR(var, ivar, type) \
+ __BUS_ACCESSOR(legacy, var, LEGACY, ivar, type)
+
+LEGACY_ACCESSOR(pcidomain, PCIDOMAIN, uint32_t)
+LEGACY_ACCESSOR(pcibus, PCIBUS, uint32_t)
+
+#undef LEGACY_ACCESSOR
+
+int legacy_pcib_maxslots(device_t dev);
+uint32_t legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes);
+int legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result);
+void legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes);
+int legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value);
+struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child,
+ int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
+
+#endif /* !_MACHINE_LEGACYVAR_H_ */
diff --git a/freebsd/sys/nios2/include/machine/pci_cfgreg.h b/freebsd/sys/nios2/include/machine/pci_cfgreg.h
new file mode 100644
index 00000000..bc72418d
--- /dev/null
+++ b/freebsd/sys/nios2/include/machine/pci_cfgreg.h
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
+ */
+
+#define CONF1_ADDR_PORT 0x0cf8
+#define CONF1_DATA_PORT 0x0cfc
+
+#define CONF1_ENABLE 0x80000000ul
+#define CONF1_ENABLE_CHK 0x80000000ul
+#define CONF1_ENABLE_MSK 0x7f000000ul
+#define CONF1_ENABLE_CHK1 0xff000001ul
+#define CONF1_ENABLE_MSK1 0x80000001ul
+#define CONF1_ENABLE_RES1 0x80000000ul
+
+#define CONF2_ENABLE_PORT 0x0cf8
+#define CONF2_FORWARD_PORT 0x0cfa
+
+#define CONF2_ENABLE_CHK 0x0e
+#define CONF2_ENABLE_RES 0x0e
+
+int pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus);
+int pci_cfgregopen(void);
+u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes);
+void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes);
+void pci_pir_open(void);
+int pci_pir_probe(int bus, int require_parse);
+int pci_pir_route_interrupt(int bus, int device, int func, int pin);
diff --git a/freebsd/sys/nios2/nios2/in_cksum.c b/freebsd/sys/nios2/nios2/in_cksum.c
new file mode 100644
index 00000000..c6f7b568
--- /dev/null
+++ b/freebsd/sys/nios2/nios2/in_cksum.c
@@ -0,0 +1,255 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1988, 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ * Copyright (c) 1996
+ * Matt Thomas <matt@3am-software.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)in_cksum.c 8.1 (Berkeley) 6/10/93
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/mbuf.h>
+#include <sys/systm.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <machine/in_cksum.h>
+
+/*
+ * Checksum routine for Internet Protocol family headers
+ * (Portable Alpha version).
+ *
+ * This routine is very heavily used in the network
+ * code and should be modified for each CPU to be as fast as possible.
+ */
+
+#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x)
+#define REDUCE32 \
+ { \
+ q_util.q = sum; \
+ sum = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
+ }
+#define REDUCE16 \
+ { \
+ q_util.q = sum; \
+ l_util.l = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
+ sum = l_util.s[0] + l_util.s[1]; \
+ ADDCARRY(sum); \
+ }
+
+static const u_int32_t in_masks[] = {
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
+ 0x00000000, 0x000000FF, 0x0000FFFF, 0x00FFFFFF, /* offset 0 */
+ 0x00000000, 0x0000FF00, 0x00FFFF00, 0xFFFFFF00, /* offset 1 */
+ 0x00000000, 0x00FF0000, 0xFFFF0000, 0xFFFF0000, /* offset 2 */
+ 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, /* offset 3 */
+#else
+ /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
+ 0x00000000, 0xFF000000, 0xFFFF0000, 0xFFFFFF00, /* offset 0 */
+ 0x00000000, 0x00FF0000, 0x00FFFF00, 0x00FFFFFF, /* offset 1 */
+ 0x00000000, 0x0000FF00, 0x0000FFFF, 0x0000FFFF, /* offset 2 */
+ 0x00000000, 0x000000FF, 0x000000FF, 0x000000FF, /* offset 3 */
+#endif
+};
+
+union l_util {
+ u_int16_t s[2];
+ u_int32_t l;
+};
+union q_util {
+ u_int16_t s[4];
+ u_int32_t l[2];
+ u_int64_t q;
+};
+
+static u_int64_t
+in_cksumdata(const void *buf, int len)
+{
+ const u_int32_t *lw = (const u_int32_t *) buf;
+ u_int64_t sum = 0;
+ u_int64_t prefilled;
+ int offset;
+ union q_util q_util;
+
+ if ((3 & (long) lw) == 0 && len == 20) {
+ sum = (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3] + lw[4];
+ REDUCE32;
+ return sum;
+ }
+
+ if ((offset = 3 & (long) lw) != 0) {
+ const u_int32_t *masks = in_masks + (offset << 2);
+ lw = (u_int32_t *) (((long) lw) - offset);
+ sum = *lw++ & masks[len >= 3 ? 3 : len];
+ len -= 4 - offset;
+ if (len <= 0) {
+ REDUCE32;
+ return sum;
+ }
+ }
+#if 0
+ /*
+ * Force to cache line boundary.
+ */
+ offset = 32 - (0x1f & (long) lw);
+ if (offset < 32 && len > offset) {
+ len -= offset;
+ if (4 & offset) {
+ sum += (u_int64_t) lw[0];
+ lw += 1;
+ }
+ if (8 & offset) {
+ sum += (u_int64_t) lw[0] + lw[1];
+ lw += 2;
+ }
+ if (16 & offset) {
+ sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
+ lw += 4;
+ }
+ }
+#endif
+ /*
+ * access prefilling to start load of next cache line.
+ * then add current cache line
+ * save result of prefilling for loop iteration.
+ */
+ prefilled = lw[0];
+ while ((len -= 32) >= 4) {
+ u_int64_t prefilling = lw[8];
+ sum += prefilled + lw[1] + lw[2] + lw[3]
+ + lw[4] + lw[5] + lw[6] + lw[7];
+ lw += 8;
+ prefilled = prefilling;
+ }
+ if (len >= 0) {
+ sum += prefilled + lw[1] + lw[2] + lw[3]
+ + lw[4] + lw[5] + lw[6] + lw[7];
+ lw += 8;
+ } else {
+ len += 32;
+ }
+ while ((len -= 16) >= 0) {
+ sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
+ lw += 4;
+ }
+ len += 16;
+ while ((len -= 4) >= 0) {
+ sum += (u_int64_t) *lw++;
+ }
+ len += 4;
+ if (len > 0)
+ sum += (u_int64_t) (in_masks[len] & *lw);
+ REDUCE32;
+ return sum;
+}
+
+u_short
+in_addword(u_short a, u_short b)
+{
+ u_int64_t sum = a + b;
+
+ ADDCARRY(sum);
+ return (sum);
+}
+
+u_short
+#ifdef __rtems__
+/* Prototype does not match in FreeBSD code */
+in_pseudo(u_int a, u_int b, u_int c)
+#else
+in_pseudo(u_int32_t a, u_int32_t b, u_int32_t c)
+#endif
+{
+ u_int64_t sum;
+ union q_util q_util;
+ union l_util l_util;
+
+ sum = (u_int64_t) a + b + c;
+ REDUCE16;
+ return (sum);
+}
+
+u_short
+in_cksum_skip(struct mbuf *m, int len, int skip)
+{
+ u_int64_t sum = 0;
+ int mlen = 0;
+ int clen = 0;
+ caddr_t addr;
+ union q_util q_util;
+ union l_util l_util;
+
+ len -= skip;
+ for (; skip && m; m = m->m_next) {
+ if (m->m_len > skip) {
+ mlen = m->m_len - skip;
+ addr = mtod(m, caddr_t) + skip;
+ goto skip_start;
+ } else {
+ skip -= m->m_len;
+ }
+ }
+
+ for (; m && len; m = m->m_next) {
+ if (m->m_len == 0)
+ continue;
+ mlen = m->m_len;
+ addr = mtod(m, caddr_t);
+skip_start:
+ if (len < mlen)
+ mlen = len;
+
+ if ((clen ^ (uintptr_t) addr) & 1)
+ sum += in_cksumdata(addr, mlen) << 8;
+ else
+ sum += in_cksumdata(addr, mlen);
+
+ clen += mlen;
+ len -= mlen;
+ }
+ REDUCE16;
+ return (~sum & 0xffff);
+}
+
+u_int in_cksum_hdr(const struct ip *ip)
+{
+ u_int64_t sum = in_cksumdata(ip, sizeof(struct ip));
+ union q_util q_util;
+ union l_util l_util;
+ REDUCE16;
+ return (~sum & 0xffff);
+}
diff --git a/freebsd/sys/nios2/nios2/legacy.c b/freebsd/sys/nios2/nios2/legacy.c
new file mode 100644
index 00000000..2547990c
--- /dev/null
+++ b/freebsd/sys/nios2/nios2/legacy.c
@@ -0,0 +1,347 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright 1998 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby
+ * granted, provided that both the above copyright notice and this
+ * permission notice appear in all copies, that both the above
+ * copyright notice and this permission notice appear in all
+ * supporting documentation, and that the name of M.I.T. not be used
+ * in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission. M.I.T. makes
+ * no representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
+ * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
+ * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * This code implements a system driver for legacy systems that do not
+ * support ACPI or when ACPI support is not present in the kernel.
+ */
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <machine/bus.h>
+#include <sys/pcpu.h>
+#include <sys/rman.h>
+#include <sys/smp.h>
+
+#ifndef __rtems__
+#include <rtems/bsd/local/opt_mca.h>
+#endif /* __rtems__ */
+#ifdef DEV_MCA
+#include <i386/bios/mca_machdep.h>
+#endif
+
+#include <machine/legacyvar.h>
+#include <machine/resource.h>
+
+static MALLOC_DEFINE(M_LEGACYDEV, "legacydrv", "legacy system device");
+struct legacy_device {
+ int lg_pcibus;
+};
+
+#define DEVTOAT(dev) ((struct legacy_device *)device_get_ivars(dev))
+
+static int legacy_probe(device_t);
+static int legacy_attach(device_t);
+static int legacy_print_child(device_t, device_t);
+static device_t legacy_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static int legacy_read_ivar(device_t, device_t, int, uintptr_t *);
+static int legacy_write_ivar(device_t, device_t, int, uintptr_t);
+
+static device_method_t legacy_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, legacy_probe),
+ DEVMETHOD(device_attach, legacy_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, legacy_print_child),
+ DEVMETHOD(bus_add_child, legacy_add_child),
+ DEVMETHOD(bus_read_ivar, legacy_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_write_ivar),
+ DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t legacy_driver = {
+ "legacy",
+ legacy_methods,
+ 1, /* no softc */
+};
+static devclass_t legacy_devclass;
+
+DRIVER_MODULE(legacy, nexus, legacy_driver, legacy_devclass, 0, 0);
+
+static int
+legacy_probe(device_t dev)
+{
+
+ device_set_desc(dev, "legacy system");
+ device_quiet(dev);
+ return (0);
+}
+
+static int
+legacy_attach(device_t dev)
+{
+ device_t child;
+
+ /*
+ * Let our child drivers identify any child devices that they
+ * can find. Once that is done attach any devices that we
+ * found.
+ */
+ bus_generic_probe(dev);
+ bus_generic_attach(dev);
+
+#ifndef PC98
+ /*
+ * If we didn't see EISA or ISA on a pci bridge, create some
+ * connection points now so they show up "on motherboard".
+ */
+ if (!devclass_get_device(devclass_find("eisa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "eisa", 0);
+ if (child == NULL)
+ panic("legacy_attach eisa");
+ device_probe_and_attach(child);
+ }
+#endif
+#ifdef DEV_MCA
+ if (MCA_system && !devclass_get_device(devclass_find("mca"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "mca", 0);
+ if (child == 0)
+ panic("legacy_probe mca");
+ device_probe_and_attach(child);
+ }
+#endif
+ if (!devclass_get_device(devclass_find("isa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "isa", 0);
+ if (child == NULL)
+ panic("legacy_attach isa");
+ device_probe_and_attach(child);
+ }
+
+ return 0;
+}
+
+static int
+legacy_print_child(device_t bus, device_t child)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+ int retval = 0;
+
+ retval += bus_print_child_header(bus, child);
+ if (atdev->lg_pcibus != -1)
+ retval += printf(" pcibus %d", atdev->lg_pcibus);
+ retval += printf(" on motherboard\n"); /* XXX "motherboard", ick */
+
+ return (retval);
+}
+
+static device_t
+legacy_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ device_t child;
+ struct legacy_device *atdev;
+
+ atdev = malloc(sizeof(struct legacy_device), M_LEGACYDEV,
+ M_NOWAIT | M_ZERO);
+ if (atdev == NULL)
+ return(NULL);
+ atdev->lg_pcibus = -1;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child == NULL)
+ free(atdev, M_LEGACYDEV);
+ else
+ /* should we free this in legacy_child_detached? */
+ device_set_ivars(child, atdev);
+
+ return (child);
+}
+
+static int
+legacy_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ *result = 0;
+ break;
+ case LEGACY_IVAR_PCIBUS:
+ *result = atdev->lg_pcibus;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+
+static int
+legacy_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ return EINVAL;
+ case LEGACY_IVAR_PCIBUS:
+ atdev->lg_pcibus = value;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+/*
+ * Legacy CPU attachment when ACPI is not available. Drivers like
+ * cpufreq(4) hang off this.
+ */
+static void cpu_identify(driver_t *driver, device_t parent);
+static int cpu_read_ivar(device_t dev, device_t child, int index,
+ uintptr_t *result);
+static device_t cpu_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static struct resource_list *cpu_get_rlist(device_t dev, device_t child);
+
+struct cpu_device {
+ struct resource_list cd_rl;
+ struct pcpu *cd_pcpu;
+};
+
+static device_method_t cpu_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, cpu_identify),
+ DEVMETHOD(device_probe, bus_generic_probe),
+ DEVMETHOD(device_attach, bus_generic_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_add_child, cpu_add_child),
+ DEVMETHOD(bus_read_ivar, cpu_read_ivar),
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_get_resource_list, cpu_get_rlist),
+ DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
+ DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource),
+ DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource),
+ DEVMETHOD(bus_driver_added, bus_generic_driver_added),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t cpu_driver = {
+ "cpu",
+ cpu_methods,
+ 1, /* no softc */
+};
+static devclass_t cpu_devclass;
+DRIVER_MODULE(cpu, legacy, cpu_driver, cpu_devclass, 0, 0);
+
+static void
+cpu_identify(driver_t *driver, device_t parent)
+{
+ device_t child;
+ int i;
+
+ /*
+ * Attach a cpuX device for each CPU. We use an order of 150
+ * so that these devices are attached after the Host-PCI
+ * bridges (which are added at order 100).
+ */
+ for (i = 0; i <= mp_maxid; i++)
+ if (!CPU_ABSENT(i)) {
+ child = BUS_ADD_CHILD(parent, 150, "cpu", i);
+ if (child == NULL)
+ panic("legacy_attach cpu");
+ }
+}
+
+static device_t
+cpu_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ struct cpu_device *cd;
+ device_t child;
+ struct pcpu *pc;
+
+ if ((cd = malloc(sizeof(*cd), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL)
+ return (NULL);
+
+ resource_list_init(&cd->cd_rl);
+ pc = pcpu_find(device_get_unit(bus));
+ cd->cd_pcpu = pc;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child != NULL) {
+ pc->pc_device = child;
+ device_set_ivars(child, cd);
+ } else
+ free(cd, M_DEVBUF);
+ return (child);
+}
+
+static struct resource_list *
+cpu_get_rlist(device_t dev, device_t child)
+{
+ struct cpu_device *cpdev;
+
+ cpdev = device_get_ivars(child);
+ return (&cpdev->cd_rl);
+}
+
+static int
+cpu_read_ivar(device_t dev, device_t child, int index, uintptr_t *result)
+{
+ struct cpu_device *cpdev;
+
+ if (index != CPU_IVAR_PCPU)
+ return (ENOENT);
+ cpdev = device_get_ivars(child);
+ *result = (uintptr_t)cpdev->cd_pcpu;
+ return (0);
+}
diff --git a/freebsd/sys/nios2/pci/pci_bus.c b/freebsd/sys/nios2/pci/pci_bus.c
new file mode 100644
index 00000000..6627db98
--- /dev/null
+++ b/freebsd/sys/nios2/pci/pci_bus.c
@@ -0,0 +1,729 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/local/opt_cpu.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
+
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcib_private.h>
+#include <isa/isavar.h>
+#ifdef CPU_ELAN
+#include <machine/md_var.h>
+#endif
+#include <machine/legacyvar.h>
+#include <machine/pci_cfgreg.h>
+#include <machine/resource.h>
+
+#include <rtems/bsd/local/pcib_if.h>
+
+#ifndef __rtems__
+static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev,
+ int pin);
+#else /* __rtems__ */
+int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin);
+#endif /* __rtems__ */
+
+
+int
+legacy_pcib_maxslots(device_t dev)
+{
+ return 31;
+}
+
+/* read configuration space register */
+
+#ifdef __rtems__
+uint32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#else
+u_int32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#endif
+{
+ return(pci_cfgregread(bus, slot, func, reg, bytes));
+}
+
+/* write configuration space register */
+
+void
+legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes)
+{
+ pci_cfgregwrite(bus, slot, func, reg, data, bytes);
+}
+
+/* Pass MSI requests up to the nexus. */
+
+static int
+legacy_pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount,
+ int *irqs)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSI(device_get_parent(bus), dev, count, maxcount,
+ irqs));
+}
+
+static int
+legacy_pcib_alloc_msix(device_t pcib, device_t dev, int *irq)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq));
+}
+
+static int
+legacy_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr,
+ uint32_t *data)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data));
+}
+
+static const char *
+legacy_pcib_is_host_bridge(int bus, int slot, int func,
+ uint32_t id, uint8_t class, uint8_t subclass,
+ uint8_t *busnum)
+{
+ const char *s = NULL;
+ static uint8_t pxb[4]; /* hack for 450nx */
+
+ *busnum = 0;
+
+ switch (id) {
+ case 0x12258086:
+ s = "Intel 824?? host to PCI bridge";
+ /* XXX This is a guess */
+ /* *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x41, 1); */
+ *busnum = bus;
+ break;
+ case 0x71208086:
+ s = "Intel 82810 (i810 GMCH) Host To Hub bridge";
+ break;
+ case 0x71228086:
+ s = "Intel 82810-DC100 (i810-DC100 GMCH) Host To Hub bridge";
+ break;
+ case 0x71248086:
+ s = "Intel 82810E (i810E GMCH) Host To Hub bridge";
+ break;
+ case 0x11308086:
+ s = "Intel 82815 (i815 GMCH) Host To Hub bridge";
+ break;
+ case 0x71808086:
+ s = "Intel 82443LX (440 LX) host to PCI bridge";
+ break;
+ case 0x71908086:
+ s = "Intel 82443BX (440 BX) host to PCI bridge";
+ break;
+ case 0x71928086:
+ s = "Intel 82443BX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x71948086:
+ s = "Intel 82443MX host to PCI bridge";
+ break;
+ case 0x71a08086:
+ s = "Intel 82443GX host to PCI bridge";
+ break;
+ case 0x71a18086:
+ s = "Intel 82443GX host to AGP bridge";
+ break;
+ case 0x71a28086:
+ s = "Intel 82443GX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x84c48086:
+ s = "Intel 82454KX/GX (Orion) host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x4a, 1);
+ break;
+ case 0x84ca8086:
+ /*
+ * For the 450nx chipset, there is a whole bundle of
+ * things pretending to be host bridges. The MIOC will
+ * be seen first and isn't really a pci bridge (the
+ * actual busses are attached to the PXB's). We need to
+ * read the registers of the MIOC to figure out the
+ * bus numbers for the PXB channels.
+ *
+ * Since the MIOC doesn't have a pci bus attached, we
+ * pretend it wasn't there.
+ */
+ pxb[0] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd0, 1); /* BUSNO[0] */
+ pxb[1] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd1, 1) + 1; /* SUBA[0]+1 */
+ pxb[2] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd3, 1); /* BUSNO[1] */
+ pxb[3] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd4, 1) + 1; /* SUBA[1]+1 */
+ return NULL;
+ case 0x84cb8086:
+ switch (slot) {
+ case 0x12:
+ s = "Intel 82454NX PXB#0, Bus#A";
+ *busnum = pxb[0];
+ break;
+ case 0x13:
+ s = "Intel 82454NX PXB#0, Bus#B";
+ *busnum = pxb[1];
+ break;
+ case 0x14:
+ s = "Intel 82454NX PXB#1, Bus#A";
+ *busnum = pxb[2];
+ break;
+ case 0x15:
+ s = "Intel 82454NX PXB#1, Bus#B";
+ *busnum = pxb[3];
+ break;
+ }
+ break;
+ case 0x1A308086:
+ s = "Intel 82845 Host to PCI bridge";
+ break;
+
+ /* AMD -- vendor 0x1022 */
+ case 0x30001022:
+ s = "AMD Elan SC520 host to PCI bridge";
+#ifdef CPU_ELAN
+ init_AMD_Elan_sc520();
+#else
+ printf(
+"*** WARNING: missing CPU_ELAN -- timekeeping may be wrong\n");
+#endif
+ break;
+ case 0x70061022:
+ s = "AMD-751 host to PCI bridge";
+ break;
+ case 0x700e1022:
+ s = "AMD-761 host to PCI bridge";
+ break;
+
+ /* SiS -- vendor 0x1039 */
+ case 0x04961039:
+ s = "SiS 85c496";
+ break;
+ case 0x04061039:
+ s = "SiS 85c501";
+ break;
+ case 0x06011039:
+ s = "SiS 85c601";
+ break;
+ case 0x55911039:
+ s = "SiS 5591 host to PCI bridge";
+ break;
+ case 0x00011039:
+ s = "SiS 5591 host to AGP bridge";
+ break;
+
+ /* VLSI -- vendor 0x1004 */
+ case 0x00051004:
+ s = "VLSI 82C592 Host to PCI bridge";
+ break;
+
+ /* XXX Here is MVP3, I got the datasheet but NO M/B to test it */
+ /* totally. Please let me know if anything wrong. -F */
+ /* XXX need info on the MVP3 -- any takers? */
+ case 0x05981106:
+ s = "VIA 82C598MVP (Apollo MVP3) host bridge";
+ break;
+
+ /* AcerLabs -- vendor 0x10b9 */
+ /* Funny : The datasheet told me vendor id is "10b8",sub-vendor */
+ /* id is '10b9" but the register always shows "10b9". -Foxfair */
+ case 0x154110b9:
+ s = "AcerLabs M1541 (Aladdin-V) PCI host bridge";
+ break;
+
+ /* OPTi -- vendor 0x1045 */
+ case 0xc7011045:
+ s = "OPTi 82C700 host to PCI bridge";
+ break;
+ case 0xc8221045:
+ s = "OPTi 82C822 host to PCI Bridge";
+ break;
+
+ /* ServerWorks -- vendor 0x1166 */
+ case 0x00051166:
+ s = "ServerWorks NB6536 2.0HE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00061166:
+ /* FALLTHROUGH */
+ case 0x00081166:
+ /* FALLTHROUGH */
+ case 0x02011166:
+ /* FALLTHROUGH */
+ case 0x010f1014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00091166:
+ s = "ServerWorks NB6635 3.0LE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00101166:
+ s = "ServerWorks CIOB30 host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00111166:
+ /* FALLTHROUGH */
+ case 0x03021014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks CMIC-HE host to PCI-X bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* XXX unknown chipset, but working */
+ case 0x00171166:
+ /* FALLTHROUGH */
+ case 0x01011166:
+ case 0x01101166:
+ case 0x02251166:
+ s = "ServerWorks host to PCI bridge(unknown chipset)";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* Compaq/HP -- vendor 0x0e11 */
+ case 0x60100e11:
+ s = "Compaq/HP Model 6010 HotPlug PCI Bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0xc8, 1);
+ break;
+
+ /* Integrated Micro Solutions -- vendor 0x10e0 */
+ case 0x884910e0:
+ s = "Integrated Micro Solutions VL Bridge";
+ break;
+
+ default:
+ if (class == PCIC_BRIDGE && subclass == PCIS_BRIDGE_HOST)
+ s = "Host to PCI bridge";
+ break;
+ }
+
+ return s;
+}
+
+/*
+ * Scan the first pci bus for host-pci bridges and add pcib instances
+ * to the nexus for each bridge.
+ */
+static void
+legacy_pcib_identify(driver_t *driver, device_t parent)
+{
+ int bus, slot, func;
+ u_int8_t hdrtype;
+ int found = 0;
+ int pcifunchigh;
+ int found824xx = 0;
+ int found_orion = 0;
+ device_t child;
+ devclass_t pci_devclass;
+
+ if (pci_cfgregopen() == 0)
+ return;
+ /*
+ * Check to see if we haven't already had a PCI bus added
+ * via some other means. If we have, bail since otherwise
+ * we're going to end up duplicating it.
+ */
+ if ((pci_devclass = devclass_find("pci")) &&
+ devclass_get_device(pci_devclass, 0))
+ return;
+
+
+ bus = 0;
+ retry:
+ for (slot = 0; slot <= PCI_SLOTMAX; slot++) {
+ func = 0;
+ hdrtype = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_HDRTYPE, 1);
+ /*
+ * When enumerating bus devices, the standard says that
+ * one should check the header type and ignore the slots whose
+ * header types that the software doesn't know about. We use
+ * this to filter out devices.
+ */
+ if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE)
+ continue;
+ if ((hdrtype & PCIM_MFDEV) &&
+ (!found_orion || hdrtype != 0xff))
+ pcifunchigh = PCI_FUNCMAX;
+ else
+ pcifunchigh = 0;
+ for (func = 0; func <= pcifunchigh; func++) {
+ /*
+ * Read the IDs and class from the device.
+ */
+ u_int32_t id;
+ u_int8_t class, subclass, busnum;
+ const char *s;
+ device_t *devs;
+ int ndevs, i;
+
+ id = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_DEVVENDOR, 4);
+ if (id == -1)
+ continue;
+ class = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_CLASS, 1);
+ subclass = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_SUBCLASS, 1);
+
+ s = legacy_pcib_is_host_bridge(bus, slot, func,
+ id, class, subclass,
+ &busnum);
+ if (s == NULL)
+ continue;
+
+ /*
+ * Check to see if the physical bus has already
+ * been seen. Eg: hybrid 32 and 64 bit host
+ * bridges to the same logical bus.
+ */
+ if (device_get_children(parent, &devs, &ndevs) == 0) {
+ for (i = 0; s != NULL && i < ndevs; i++) {
+ if (strcmp(device_get_name(devs[i]),
+ "pcib") != 0)
+ continue;
+ if (legacy_get_pcibus(devs[i]) == busnum)
+ s = NULL;
+ }
+ free(devs, M_TEMP);
+ }
+
+ if (s == NULL)
+ continue;
+ /*
+ * Add at priority 100 to make sure we
+ * go after any motherboard resources
+ */
+ child = BUS_ADD_CHILD(parent, 100,
+ "pcib", busnum);
+ device_set_desc(child, s);
+ legacy_set_pcibus(child, busnum);
+
+ found = 1;
+ if (id == 0x12258086)
+ found824xx = 1;
+ if (id == 0x84c48086)
+ found_orion = 1;
+ }
+ }
+ if (found824xx && bus == 0) {
+ bus++;
+ goto retry;
+ }
+
+ /*
+ * Make sure we add at least one bridge since some old
+ * hardware doesn't actually have a host-pci bridge device.
+ * Note that pci_cfgregopen() thinks we have PCI devices..
+ */
+ if (!found) {
+ if (bootverbose)
+ printf(
+ "legacy_pcib_identify: no bridge found, adding pcib0 anyway\n");
+ child = BUS_ADD_CHILD(parent, 100, "pcib", 0);
+ legacy_set_pcibus(child, 0);
+ }
+}
+
+static int
+legacy_pcib_probe(device_t dev)
+{
+
+ if (pci_cfgregopen() == 0)
+ return ENXIO;
+ return -100;
+}
+
+static int
+legacy_pcib_attach(device_t dev)
+{
+ device_t pir;
+ int bus;
+
+ /*
+ * Look for a PCI BIOS interrupt routing table as that will be
+ * our method of routing interrupts if we have one.
+ */
+ bus = pcib_get_bus(dev);
+#ifndef __rtems__
+ if (pci_pir_probe(bus, 0)) {
+ pir = BUS_ADD_CHILD(device_get_parent(dev), 0, "pir", 0);
+ if (pir != NULL)
+ device_probe_and_attach(pir);
+ }
+#else /* __rtems__ */
+#endif /* __rtems__ */
+ device_add_child(dev, "pci", bus);
+ return bus_generic_attach(dev);
+}
+
+int
+legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ *result = 0;
+ return 0;
+ case PCIB_IVAR_BUS:
+ *result = legacy_get_pcibus(dev);
+ return 0;
+ }
+ return ENOENT;
+}
+
+int
+legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ return EINVAL;
+ case PCIB_IVAR_BUS:
+ legacy_set_pcibus(dev, value);
+ return 0;
+ }
+ return ENOENT;
+}
+
+SYSCTL_DECL(_hw_pci);
+
+static unsigned long legacy_host_mem_start = 0x80000000;
+TUNABLE_ULONG("hw.pci.host_mem_start", &legacy_host_mem_start);
+SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN,
+ &legacy_host_mem_start, 0x80000000,
+ "Limit the host bridge memory to being above this address. Must be\n\
+set at boot via a tunable.");
+
+struct resource *
+legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
+ u_long start, u_long end, u_long count, u_int flags)
+{
+ /*
+ * If no memory preference is given, use upper 32MB slot most
+ * bioses use for their memory window. Typically other bridges
+ * before us get in the way to assert their preferences on memory.
+ * Hardcoding like this sucks, so a more MD/MI way needs to be
+ * found to do it. This is typically only used on older laptops
+ * that don't have pci busses behind pci bridge, so assuming > 32MB
+ * is liekly OK.
+ *
+ * However, this can cause problems for other chipsets, so we make
+ * this tunable by hw.pci.host_mem_start.
+ */
+ if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL)
+ start = legacy_host_mem_start;
+ if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL)
+ start = 0x1000;
+ return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
+ count, flags));
+}
+
+static device_method_t legacy_pcib_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, legacy_pcib_identify),
+ DEVMETHOD(device_probe, legacy_pcib_probe),
+ DEVMETHOD(device_attach, legacy_pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, legacy_pcib_maxslots),
+ DEVMETHOD(pcib_read_config, legacy_pcib_read_config),
+ DEVMETHOD(pcib_write_config, legacy_pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, legacy_pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, legacy_pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, legacy_pcib_map_msi),
+
+ { 0, 0 }
+};
+
+static devclass_t hostb_devclass;
+
+DEFINE_CLASS_0(pcib, legacy_pcib_driver, legacy_pcib_methods, 1);
+DRIVER_MODULE(pcib, legacy, legacy_pcib_driver, hostb_devclass, 0, 0);
+
+
+#ifndef __rtems__
+/*
+ * Install placeholder to claim the resources owned by the
+ * PCI bus interface. This could be used to extract the
+ * config space registers in the extreme case where the PnP
+ * ID is available and the PCI BIOS isn't, but for now we just
+ * eat the PnP ID and do nothing else.
+ *
+ * XXX we should silence this probe, as it will generally confuse
+ * people.
+ */
+static struct isa_pnp_id pcibus_pnp_ids[] = {
+ { 0x030ad041 /* PNP0A03 */, "PCI Bus" },
+ { 0x080ad041 /* PNP0A08 */, "PCIe Bus" },
+ { 0 }
+};
+
+static int
+pcibus_pnp_probe(device_t dev)
+{
+ int result;
+
+ if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, pcibus_pnp_ids)) <= 0)
+ device_quiet(dev);
+ return(result);
+}
+
+static int
+pcibus_pnp_attach(device_t dev)
+{
+ return(0);
+}
+
+static device_method_t pcibus_pnp_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibus_pnp_probe),
+ DEVMETHOD(device_attach, pcibus_pnp_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+ { 0, 0 }
+};
+
+static devclass_t pcibus_pnp_devclass;
+
+DEFINE_CLASS_0(pcibus_pnp, pcibus_pnp_driver, pcibus_pnp_methods, 1);
+DRIVER_MODULE(pcibus_pnp, isa, pcibus_pnp_driver, pcibus_pnp_devclass, 0, 0);
+
+
+/*
+ * Provide a PCI-PCI bridge driver for PCI busses behind PCI-PCI bridges
+ * that appear in the PCIBIOS Interrupt Routing Table to use the routing
+ * table for interrupt routing when possible.
+ */
+static int pcibios_pcib_probe(device_t bus);
+
+static device_method_t pcibios_pcib_pci_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibios_pcib_probe),
+ DEVMETHOD(device_attach, pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, pcib_maxslots),
+ DEVMETHOD(pcib_read_config, pcib_read_config),
+ DEVMETHOD(pcib_write_config, pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, pcib_map_msi),
+
+ {0, 0}
+};
+
+static devclass_t pcib_devclass;
+
+DEFINE_CLASS_0(pcib, pcibios_pcib_driver, pcibios_pcib_pci_methods,
+ sizeof(struct pcib_softc));
+DRIVER_MODULE(pcibios_pcib, pci, pcibios_pcib_driver, pcib_devclass, 0, 0);
+
+static int
+pcibios_pcib_probe(device_t dev)
+{
+ int bus;
+
+ if ((pci_get_class(dev) != PCIC_BRIDGE) ||
+ (pci_get_subclass(dev) != PCIS_BRIDGE_PCI))
+ return (ENXIO);
+ bus = pci_read_config(dev, PCIR_SECBUS_1, 1);
+ if (bus == 0)
+ return (ENXIO);
+ if (!pci_pir_probe(bus, 1))
+ return (ENXIO);
+ device_set_desc(dev, "PCIBIOS PCI-PCI bridge");
+ return (-2000);
+}
+
+static int
+pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
+{
+ return (pci_pir_route_interrupt(pci_get_bus(dev), pci_get_slot(dev),
+ pci_get_function(dev), pin));
+}
+#endif /* __rtems__ */
diff --git a/freebsd/sys/opencrypto/cast.c b/freebsd/sys/opencrypto/cast.c
index fde6352c..53fe23b1 100644
--- a/freebsd/sys/opencrypto/cast.c
+++ b/freebsd/sys/opencrypto/cast.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $OpenBSD: cast.c,v 1.2 2000/06/06 06:49:47 deraadt Exp $ */
/*-
@@ -8,12 +8,12 @@
* Released 1997.10.11
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/types.h>
-#include <freebsd/opencrypto/cast.h>
-#include <freebsd/opencrypto/castsb.h>
+#include <rtems/bsd/sys/types.h>
+#include <opencrypto/cast.h>
+#include <opencrypto/castsb.h>
/* Macros to access 8-bit bytes out of a 32-bit word */
#define U_INT8_Ta(x) ( (u_int8_t) (x>>24) )
diff --git a/freebsd/sys/opencrypto/cast.h b/freebsd/sys/opencrypto/cast.h
index 25d6c763..8e2d0d19 100644
--- a/freebsd/sys/opencrypto/cast.h
+++ b/freebsd/sys/opencrypto/cast.h
@@ -8,8 +8,8 @@
* Released 1997.10.11
*/
-#ifndef _CAST_HH_
-#define _CAST_HH_
+#ifndef _CAST_H_
+#define _CAST_H_
typedef struct {
u_int32_t xkey[32]; /* Key, after expansion */
@@ -20,4 +20,4 @@ void cast_setkey(cast_key * key, u_int8_t * rawkey, int keybytes);
void cast_encrypt(cast_key * key, u_int8_t * inblock, u_int8_t * outblock);
void cast_decrypt(cast_key * key, u_int8_t * inblock, u_int8_t * outblock);
-#endif /* ifndef _CAST_HH_ */
+#endif /* ifndef _CAST_H_ */
diff --git a/freebsd/sys/opencrypto/criov.c b/freebsd/sys/opencrypto/criov.c
index 1e389c1d..63ba4c66 100644
--- a/freebsd/sys/opencrypto/criov.c
+++ b/freebsd/sys/opencrypto/criov.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $OpenBSD: criov.c,v 1.9 2002/01/29 15:48:29 jason Exp $ */
@@ -29,19 +29,19 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/uio.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/proc.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+#include <sys/mbuf.h>
+#include <sys/uio.h>
-#include <freebsd/opencrypto/cryptodev.h>
+#include <opencrypto/cryptodev.h>
/*
* This macro is only for avoiding code duplication, as we need to skip
diff --git a/freebsd/sys/opencrypto/crypto.c b/freebsd/sys/opencrypto/crypto.c
index 597bbc94..006d33ea 100644
--- a/freebsd/sys/opencrypto/crypto.c
+++ b/freebsd/sys/opencrypto/crypto.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2002-2006 Sam Leffler. All rights reserved.
@@ -24,7 +24,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
@@ -58,34 +58,34 @@ __FBSDID("$FreeBSD$");
#define CRYPTO_TIMING /* enable timing support */
-#include <freebsd/local/opt_ddb.h>
-#include <freebsd/local/opt_kdtrace.h>
+#include <rtems/bsd/local/opt_ddb.h>
+#include <rtems/bsd/local/opt_kdtrace.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/eventhandler.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/kthread.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/sdt.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/eventhandler.h>
+#include <sys/kernel.h>
+#include <sys/kthread.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/module.h>
+#include <sys/mutex.h>
+#include <sys/malloc.h>
+#include <sys/proc.h>
+#include <sys/sdt.h>
+#include <sys/sysctl.h>
-#include <freebsd/ddb/ddb.h>
+#include <ddb/ddb.h>
-#include <freebsd/vm/uma.h>
-#include <freebsd/opencrypto/cryptodev.h>
-#include <freebsd/opencrypto/xform.h> /* XXX for M_XDATA */
+#include <vm/uma.h>
+#include <opencrypto/cryptodev.h>
+#include <opencrypto/xform.h> /* XXX for M_XDATA */
-#include <freebsd/sys/kobj.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/local/cryptodev_if.h>
+#include <sys/kobj.h>
+#include <sys/bus.h>
+#include <rtems/bsd/local/cryptodev_if.h>
#if defined(__i386__) || defined(__amd64__)
-#include <freebsd/machine/pcb.h>
+#include <machine/pcb.h>
#endif
SDT_PROVIDER_DEFINE(opencrypto);
diff --git a/freebsd/sys/opencrypto/cryptodev.c b/freebsd/sys/opencrypto/cryptodev.c
index fed4f5df..71cc5b23 100644
--- a/freebsd/sys/opencrypto/cryptodev.c
+++ b/freebsd/sys/opencrypto/cryptodev.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $OpenBSD: cryptodev.c,v 1.52 2002/06/19 07:22:46 deraadt Exp $ */
@@ -34,35 +34,35 @@
* Materiel Command, USAF, under agreement number F30602-01-2-0537.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_compat.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/file.h>
-#include <freebsd/sys/filedesc.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/uio.h>
-#include <freebsd/sys/random.h>
-#include <freebsd/sys/conf.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/fcntl.h>
-#include <freebsd/sys/bus.h>
-
-#include <freebsd/opencrypto/cryptodev.h>
-#include <freebsd/opencrypto/xform.h>
+#include <rtems/bsd/local/opt_compat.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/sysctl.h>
+#include <sys/file.h>
+#include <sys/filedesc.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/uio.h>
+#include <sys/random.h>
+#include <sys/conf.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/fcntl.h>
+#include <sys/bus.h>
+
+#include <opencrypto/cryptodev.h>
+#include <opencrypto/xform.h>
#ifdef COMPAT_FREEBSD32
-#include <freebsd/sys/mount.h>
-#include <freebsd/compat/freebsd32/freebsd32.h>
+#include <sys/mount.h>
+#include <compat/freebsd32/freebsd32.h>
struct session_op32 {
u_int32_t cipher;
diff --git a/freebsd/sys/opencrypto/cryptodev.h b/freebsd/sys/opencrypto/cryptodev.h
index 2ca71802..e2995221 100644
--- a/freebsd/sys/opencrypto/cryptodev.h
+++ b/freebsd/sys/opencrypto/cryptodev.h
@@ -53,10 +53,10 @@
*
*/
-#ifndef _CRYPTO_CRYPTO_HH_
-#define _CRYPTO_CRYPTO_HH_
+#ifndef _CRYPTO_CRYPTO_H_
+#define _CRYPTO_CRYPTO_H_
-#include <freebsd/sys/ioccom.h>
+#include <sys/ioccom.h>
/* Some initial values */
#define CRYPTO_DRIVERS_INITIAL 4
@@ -429,4 +429,4 @@ extern void crypto_copydata(int flags, caddr_t buf, int off, int size,
extern int crypto_apply(int flags, caddr_t buf, int off, int len,
int (*f)(void *, void *, u_int), void *arg);
#endif /* _KERNEL */
-#endif /* _CRYPTO_CRYPTO_HH_ */
+#endif /* _CRYPTO_CRYPTO_H_ */
diff --git a/freebsd/sys/opencrypto/cryptosoft.c b/freebsd/sys/opencrypto/cryptosoft.c
index 69b2d656..cee58527 100644
--- a/freebsd/sys/opencrypto/cryptosoft.c
+++ b/freebsd/sys/opencrypto/cryptosoft.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $OpenBSD: cryptosoft.c,v 1.35 2002/04/26 08:43:50 deraadt Exp $ */
@@ -24,34 +24,34 @@
* PURPOSE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/random.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/uio.h>
-
-#include <freebsd/crypto/blowfish/blowfish.h>
-#include <freebsd/crypto/sha1.h>
-#include <freebsd/opencrypto/rmd160.h>
-#include <freebsd/opencrypto/cast.h>
-#include <freebsd/opencrypto/skipjack.h>
-#include <freebsd/sys/md5.h>
-
-#include <freebsd/opencrypto/cryptodev.h>
-#include <freebsd/opencrypto/cryptosoft.h>
-#include <freebsd/opencrypto/xform.h>
-
-#include <freebsd/sys/kobj.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/local/cryptodev_if.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/random.h>
+#include <sys/kernel.h>
+#include <sys/uio.h>
+
+#include <crypto/blowfish/blowfish.h>
+#include <crypto/sha1.h>
+#include <opencrypto/rmd160.h>
+#include <opencrypto/cast.h>
+#include <opencrypto/skipjack.h>
+#include <sys/md5.h>
+
+#include <opencrypto/cryptodev.h>
+#include <opencrypto/cryptosoft.h>
+#include <opencrypto/xform.h>
+
+#include <sys/kobj.h>
+#include <sys/bus.h>
+#include <rtems/bsd/local/cryptodev_if.h>
static int32_t swcr_id;
static struct swcr_data **swcr_sessions = NULL;
diff --git a/freebsd/sys/opencrypto/cryptosoft.h b/freebsd/sys/opencrypto/cryptosoft.h
index 363fdbba..af78dc18 100644
--- a/freebsd/sys/opencrypto/cryptosoft.h
+++ b/freebsd/sys/opencrypto/cryptosoft.h
@@ -22,8 +22,8 @@
* PURPOSE.
*/
-#ifndef _CRYPTO_CRYPTOSOFT_HH_
-#define _CRYPTO_CRYPTOSOFT_HH_
+#ifndef _CRYPTO_CRYPTOSOFT_H_
+#define _CRYPTO_CRYPTOSOFT_H_
/* Software session entry */
struct swcr_data {
@@ -64,4 +64,4 @@ extern u_int8_t hmac_ipad_buffer[];
extern u_int8_t hmac_opad_buffer[];
#endif /* _KERNEL */
-#endif /* _CRYPTO_CRYPTO_HH_ */
+#endif /* _CRYPTO_CRYPTO_H_ */
diff --git a/freebsd/sys/opencrypto/deflate.c b/freebsd/sys/opencrypto/deflate.c
index ddf8239e..5806d33e 100644
--- a/freebsd/sys/opencrypto/deflate.c
+++ b/freebsd/sys/opencrypto/deflate.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $OpenBSD: deflate.c,v 1.3 2001/08/20 02:45:22 hugh Exp $ */
@@ -34,22 +34,22 @@
* functions using the zlib library (see net/zlib.{c,h})
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/local/opt_kdtrace.h>
+#include <rtems/bsd/local/opt_kdtrace.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/sdt.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/net/zlib.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/malloc.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/kernel.h>
+#include <sys/sdt.h>
+#include <sys/systm.h>
+#include <net/zlib.h>
-#include <freebsd/opencrypto/cryptodev.h>
-#include <freebsd/opencrypto/deflate.h>
+#include <opencrypto/cryptodev.h>
+#include <opencrypto/deflate.h>
SDT_PROVIDER_DECLARE(opencrypto);
SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, entry,
diff --git a/freebsd/sys/opencrypto/deflate.h b/freebsd/sys/opencrypto/deflate.h
index 732620b5..dcf7a844 100644
--- a/freebsd/sys/opencrypto/deflate.h
+++ b/freebsd/sys/opencrypto/deflate.h
@@ -33,10 +33,10 @@
* algorithm used in /sys/crypto
*/
-#ifndef _CRYPTO_DEFLATE_HH_
-#define _CRYPTO_DEFLATE_HH_
+#ifndef _CRYPTO_DEFLATE_H_
+#define _CRYPTO_DEFLATE_H_
-#include <freebsd/net/zlib.h>
+#include <net/zlib.h>
#define Z_METHOD 8
#define Z_MEMLEVEL 8
@@ -57,4 +57,4 @@ struct deflate_buf {
uint8_t data[];
};
-#endif /* _CRYPTO_DEFLATE_HH_ */
+#endif /* _CRYPTO_DEFLATE_H_ */
diff --git a/freebsd/sys/opencrypto/rmd160.c b/freebsd/sys/opencrypto/rmd160.c
index 99f987ee..92b5c2e7 100644
--- a/freebsd/sys/opencrypto/rmd160.c
+++ b/freebsd/sys/opencrypto/rmd160.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $OpenBSD: rmd160.c,v 1.3 2001/09/26 21:40:13 markus Exp $ */
/*-
@@ -31,13 +31,13 @@
* ftp://ftp.rsasecurity.com/pub/cryptobytes/crypto3n2.pdf
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/endian.h>
-#include <freebsd/opencrypto/rmd160.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/endian.h>
+#include <opencrypto/rmd160.h>
#define PUT_64BIT_LE(cp, value) do { \
(cp)[7] = (value) >> 56; \
diff --git a/freebsd/sys/opencrypto/skipjack.c b/freebsd/sys/opencrypto/skipjack.c
index ae06dc1b..08edc4c2 100644
--- a/freebsd/sys/opencrypto/skipjack.c
+++ b/freebsd/sys/opencrypto/skipjack.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $OpenBSD: skipjack.c,v 1.3 2001/05/05 00:31:34 angelos Exp $ */
/*-
@@ -14,12 +14,12 @@
* 29 May 1998
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
+#include <rtems/bsd/sys/param.h>
-#include <freebsd/opencrypto/skipjack.h>
+#include <opencrypto/skipjack.h>
static const u_int8_t ftable[0x100] =
{
diff --git a/freebsd/sys/opencrypto/xform.c b/freebsd/sys/opencrypto/xform.c
index e54a6740..7fceb4ec 100644
--- a/freebsd/sys/opencrypto/xform.c
+++ b/freebsd/sys/opencrypto/xform.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $OpenBSD: xform.c,v 1.16 2001/08/28 12:20:43 ben Exp $ */
/*-
@@ -38,33 +38,33 @@
* PURPOSE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/machine/cpu.h>
-
-#include <freebsd/crypto/blowfish/blowfish.h>
-#include <freebsd/crypto/des/des.h>
-#include <freebsd/crypto/rijndael/rijndael.h>
-#include <freebsd/crypto/camellia/camellia.h>
-#include <freebsd/crypto/sha1.h>
-
-#include <freebsd/opencrypto/cast.h>
-#include <freebsd/opencrypto/deflate.h>
-#include <freebsd/opencrypto/rmd160.h>
-#include <freebsd/opencrypto/skipjack.h>
-
-#include <freebsd/sys/md5.h>
-
-#include <freebsd/opencrypto/cryptodev.h>
-#include <freebsd/opencrypto/xform.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/sysctl.h>
+#include <rtems/bsd/sys/errno.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/kernel.h>
+#include <machine/cpu.h>
+
+#include <crypto/blowfish/blowfish.h>
+#include <crypto/des/des.h>
+#include <crypto/rijndael/rijndael.h>
+#include <crypto/camellia/camellia.h>
+#include <crypto/sha1.h>
+
+#include <opencrypto/cast.h>
+#include <opencrypto/deflate.h>
+#include <opencrypto/rmd160.h>
+#include <opencrypto/skipjack.h>
+
+#include <sys/md5.h>
+
+#include <opencrypto/cryptodev.h>
+#include <opencrypto/xform.h>
static int null_setkey(u_int8_t **, u_int8_t *, int);
static int des1_setkey(u_int8_t **, u_int8_t *, int);
diff --git a/freebsd/sys/opencrypto/xform.h b/freebsd/sys/opencrypto/xform.h
index 7c70ca90..0a7f981d 100644
--- a/freebsd/sys/opencrypto/xform.h
+++ b/freebsd/sys/opencrypto/xform.h
@@ -22,13 +22,13 @@
* PURPOSE.
*/
-#ifndef _CRYPTO_XFORM_HH_
-#define _CRYPTO_XFORM_HH_
+#ifndef _CRYPTO_XFORM_H_
+#define _CRYPTO_XFORM_H_
-#include <freebsd/sys/md5.h>
-#include <freebsd/crypto/sha1.h>
-#include <freebsd/crypto/sha2/sha2.h>
-#include <freebsd/opencrypto/rmd160.h>
+#include <sys/md5.h>
+#include <crypto/sha1.h>
+#include <crypto/sha2/sha2.h>
+#include <opencrypto/rmd160.h>
/* Declarations */
struct auth_hash {
@@ -98,7 +98,7 @@ extern struct auth_hash auth_hash_hmac_sha2_512;
extern struct comp_algo comp_algo_deflate;
#ifdef _KERNEL
-#include <freebsd/sys/malloc.h>
+#include <sys/malloc.h>
MALLOC_DECLARE(M_XDATA);
#endif
-#endif /* _CRYPTO_XFORM_HH_ */
+#endif /* _CRYPTO_XFORM_H_ */
diff --git a/freebsd/sys/powerpc/include/machine/cpufunc.h b/freebsd/sys/powerpc/include/machine/cpufunc.h
index 7c240e2e..f028b62c 100644
--- a/freebsd/sys/powerpc/include/machine/cpufunc.h
+++ b/freebsd/sys/powerpc/include/machine/cpufunc.h
@@ -26,8 +26,8 @@
* $FreeBSD$
*/
-#ifndef _MACHINE_CPUFUNC_HH_
-#define _MACHINE_CPUFUNC_HH_
+#ifndef _MACHINE_CPUFUNC_H_
+#define _MACHINE_CPUFUNC_H_
/*
* Required for user-space atomic.h includes
@@ -41,10 +41,10 @@ powerpc_mb(void)
#ifdef _KERNEL
-#include <freebsd/sys/types.h>
+#include <rtems/bsd/sys/types.h>
-#include <freebsd/machine/psl.h>
-#include <freebsd/machine/spr.h>
+#include <machine/psl.h>
+#include <machine/spr.h>
struct thread;
@@ -196,4 +196,4 @@ powerpc_get_pcpup(void)
#endif /* _KERNEL */
-#endif /* !_MACHINE_CPUFUNC_HH_ */
+#endif /* !_MACHINE_CPUFUNC_H_ */
diff --git a/freebsd/netinet/udp.h b/freebsd/sys/powerpc/include/machine/in_cksum.h
index 66f153d9..09920062 100644
--- a/freebsd/netinet/udp.h
+++ b/freebsd/sys/powerpc/include/machine/in_cksum.h
@@ -1,6 +1,5 @@
/*-
- * Copyright (c) 1982, 1986, 1993
- * The Regents of the University of California.
+ * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -27,41 +26,51 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)udp.h 8.1 (Berkeley) 6/10/93
+ * from tahoe: in_cksum.c 1.2 86/01/05
+ * from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91
+ * from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp
* $FreeBSD$
*/
-#ifndef _NETINET_UDP_HH_
-#define _NETINET_UDP_HH_
+#ifndef _MACHINE_IN_CKSUM_H_
+#define _MACHINE_IN_CKSUM_H_ 1
-/*
- * UDP protocol header.
- * Per RFC 768, September, 1981.
- */
-struct udphdr {
- u_short uh_sport; /* source port */
- u_short uh_dport; /* destination port */
- u_short uh_ulen; /* udp length */
- u_short uh_sum; /* udp checksum */
-};
-
-/*
- * User-settable options (used with setsockopt).
- */
-#define UDP_ENCAP 0x01
+#include <sys/cdefs.h>
+#define in_cksum(m, len) in_cksum_skip(m, len, 0)
/*
- * UDP Encapsulation of IPsec Packets options.
+ * It it useful to have an Internet checksum routine which is inlineable
+ * and optimized specifically for the task of computing IP header checksums
+ * in the normal case (where there are no options and the header length is
+ * therefore always exactly five 32-bit words.
*/
-/* Encapsulation types. */
-#define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */
-#define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-02+ */
+#ifdef __CC_SUPPORTS___INLINE
-/* Default ESP in UDP encapsulation port. */
-#define UDP_ENCAP_ESPINUDP_PORT 500
+static __inline void
+in_cksum_update(struct ip *ip)
+{
+ int __tmpsum;
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256;
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16));
+}
-/* Maximum UDP fragment size for ESP over UDP. */
-#define UDP_ENCAP_ESPINUDP_MAXFRAGLEN 552
+#else
+#define in_cksum_update(ip) \
+ do { \
+ int __tmpsum; \
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256; \
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \
+ } while(0)
+
+#endif
+
+#ifdef _KERNEL
+u_int in_cksum_hdr(const struct ip *ip);
+u_short in_addword(u_short sum, u_short b);
+u_short in_pseudo(u_int sum, u_int b, u_int c);
+u_short in_cksum_skip(struct mbuf *m, int len, int skip);
#endif
+
+#endif /* _MACHINE_IN_CKSUM_H_ */
diff --git a/freebsd/sys/powerpc/include/machine/legacyvar.h b/freebsd/sys/powerpc/include/machine/legacyvar.h
new file mode 100644
index 00000000..0b0fa433
--- /dev/null
+++ b/freebsd/sys/powerpc/include/machine/legacyvar.h
@@ -0,0 +1,57 @@
+/*-
+ * Copyright (c) 2000 Peter Wemm <peter@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_LEGACYVAR_H_
+#define _MACHINE_LEGACYVAR_H_
+
+enum legacy_device_ivars {
+ LEGACY_IVAR_PCIDOMAIN,
+ LEGACY_IVAR_PCIBUS
+};
+
+#define LEGACY_ACCESSOR(var, ivar, type) \
+ __BUS_ACCESSOR(legacy, var, LEGACY, ivar, type)
+
+LEGACY_ACCESSOR(pcidomain, PCIDOMAIN, uint32_t)
+LEGACY_ACCESSOR(pcibus, PCIBUS, uint32_t)
+
+#undef LEGACY_ACCESSOR
+
+int legacy_pcib_maxslots(device_t dev);
+uint32_t legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes);
+int legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result);
+void legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes);
+int legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value);
+struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child,
+ int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
+
+#endif /* !_MACHINE_LEGACYVAR_H_ */
diff --git a/freebsd/sys/powerpc/include/machine/pci_cfgreg.h b/freebsd/sys/powerpc/include/machine/pci_cfgreg.h
new file mode 100644
index 00000000..bc72418d
--- /dev/null
+++ b/freebsd/sys/powerpc/include/machine/pci_cfgreg.h
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
+ */
+
+#define CONF1_ADDR_PORT 0x0cf8
+#define CONF1_DATA_PORT 0x0cfc
+
+#define CONF1_ENABLE 0x80000000ul
+#define CONF1_ENABLE_CHK 0x80000000ul
+#define CONF1_ENABLE_MSK 0x7f000000ul
+#define CONF1_ENABLE_CHK1 0xff000001ul
+#define CONF1_ENABLE_MSK1 0x80000001ul
+#define CONF1_ENABLE_RES1 0x80000000ul
+
+#define CONF2_ENABLE_PORT 0x0cf8
+#define CONF2_FORWARD_PORT 0x0cfa
+
+#define CONF2_ENABLE_CHK 0x0e
+#define CONF2_ENABLE_RES 0x0e
+
+int pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus);
+int pci_cfgregopen(void);
+u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes);
+void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes);
+void pci_pir_open(void);
+int pci_pir_probe(int bus, int require_parse);
+int pci_pir_route_interrupt(int bus, int device, int func, int pin);
diff --git a/freebsd/sys/powerpc/include/machine/psl.h b/freebsd/sys/powerpc/include/machine/psl.h
index 4764c626..ec3975a0 100644
--- a/freebsd/sys/powerpc/include/machine/psl.h
+++ b/freebsd/sys/powerpc/include/machine/psl.h
@@ -32,8 +32,8 @@
* $FreeBSD$
*/
-#ifndef _MACHINE_PSL_HH_
-#define _MACHINE_PSL_HH_
+#ifndef _MACHINE_PSL_H_
+#define _MACHINE_PSL_H_
#if defined(E500)
/*
@@ -117,4 +117,4 @@
#define PSL_USERSTATIC (PSL_USERSET | PSL_IP | 0x87c0008c)
#endif /* if defined(E500) */
-#endif /* _MACHINE_PSL_HH_ */
+#endif /* _MACHINE_PSL_H_ */
diff --git a/freebsd/sys/powerpc/include/machine/spr.h b/freebsd/sys/powerpc/include/machine/spr.h
index b24a6ade..586a57be 100644
--- a/freebsd/sys/powerpc/include/machine/spr.h
+++ b/freebsd/sys/powerpc/include/machine/spr.h
@@ -33,8 +33,8 @@
* $NetBSD: spr.h,v 1.25 2002/08/14 15:38:40 matt Exp $
* $FreeBSD$
*/
-#ifndef _POWERPC_SPR_HH_
-#define _POWERPC_SPR_HH_
+#ifndef _POWERPC_SPR_H_
+#define _POWERPC_SPR_H_
#ifndef _LOCORE
#define mtspr(reg, val) \
@@ -695,4 +695,4 @@
#endif /* #elif defined(E500) */
-#endif /* !_POWERPC_SPR_HH_ */
+#endif /* !_POWERPC_SPR_H_ */
diff --git a/freebsd/sys/powerpc/pci/pci_bus.c b/freebsd/sys/powerpc/pci/pci_bus.c
new file mode 100644
index 00000000..6627db98
--- /dev/null
+++ b/freebsd/sys/powerpc/pci/pci_bus.c
@@ -0,0 +1,729 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/local/opt_cpu.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
+
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcib_private.h>
+#include <isa/isavar.h>
+#ifdef CPU_ELAN
+#include <machine/md_var.h>
+#endif
+#include <machine/legacyvar.h>
+#include <machine/pci_cfgreg.h>
+#include <machine/resource.h>
+
+#include <rtems/bsd/local/pcib_if.h>
+
+#ifndef __rtems__
+static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev,
+ int pin);
+#else /* __rtems__ */
+int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin);
+#endif /* __rtems__ */
+
+
+int
+legacy_pcib_maxslots(device_t dev)
+{
+ return 31;
+}
+
+/* read configuration space register */
+
+#ifdef __rtems__
+uint32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#else
+u_int32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#endif
+{
+ return(pci_cfgregread(bus, slot, func, reg, bytes));
+}
+
+/* write configuration space register */
+
+void
+legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes)
+{
+ pci_cfgregwrite(bus, slot, func, reg, data, bytes);
+}
+
+/* Pass MSI requests up to the nexus. */
+
+static int
+legacy_pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount,
+ int *irqs)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSI(device_get_parent(bus), dev, count, maxcount,
+ irqs));
+}
+
+static int
+legacy_pcib_alloc_msix(device_t pcib, device_t dev, int *irq)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq));
+}
+
+static int
+legacy_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr,
+ uint32_t *data)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data));
+}
+
+static const char *
+legacy_pcib_is_host_bridge(int bus, int slot, int func,
+ uint32_t id, uint8_t class, uint8_t subclass,
+ uint8_t *busnum)
+{
+ const char *s = NULL;
+ static uint8_t pxb[4]; /* hack for 450nx */
+
+ *busnum = 0;
+
+ switch (id) {
+ case 0x12258086:
+ s = "Intel 824?? host to PCI bridge";
+ /* XXX This is a guess */
+ /* *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x41, 1); */
+ *busnum = bus;
+ break;
+ case 0x71208086:
+ s = "Intel 82810 (i810 GMCH) Host To Hub bridge";
+ break;
+ case 0x71228086:
+ s = "Intel 82810-DC100 (i810-DC100 GMCH) Host To Hub bridge";
+ break;
+ case 0x71248086:
+ s = "Intel 82810E (i810E GMCH) Host To Hub bridge";
+ break;
+ case 0x11308086:
+ s = "Intel 82815 (i815 GMCH) Host To Hub bridge";
+ break;
+ case 0x71808086:
+ s = "Intel 82443LX (440 LX) host to PCI bridge";
+ break;
+ case 0x71908086:
+ s = "Intel 82443BX (440 BX) host to PCI bridge";
+ break;
+ case 0x71928086:
+ s = "Intel 82443BX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x71948086:
+ s = "Intel 82443MX host to PCI bridge";
+ break;
+ case 0x71a08086:
+ s = "Intel 82443GX host to PCI bridge";
+ break;
+ case 0x71a18086:
+ s = "Intel 82443GX host to AGP bridge";
+ break;
+ case 0x71a28086:
+ s = "Intel 82443GX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x84c48086:
+ s = "Intel 82454KX/GX (Orion) host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x4a, 1);
+ break;
+ case 0x84ca8086:
+ /*
+ * For the 450nx chipset, there is a whole bundle of
+ * things pretending to be host bridges. The MIOC will
+ * be seen first and isn't really a pci bridge (the
+ * actual busses are attached to the PXB's). We need to
+ * read the registers of the MIOC to figure out the
+ * bus numbers for the PXB channels.
+ *
+ * Since the MIOC doesn't have a pci bus attached, we
+ * pretend it wasn't there.
+ */
+ pxb[0] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd0, 1); /* BUSNO[0] */
+ pxb[1] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd1, 1) + 1; /* SUBA[0]+1 */
+ pxb[2] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd3, 1); /* BUSNO[1] */
+ pxb[3] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd4, 1) + 1; /* SUBA[1]+1 */
+ return NULL;
+ case 0x84cb8086:
+ switch (slot) {
+ case 0x12:
+ s = "Intel 82454NX PXB#0, Bus#A";
+ *busnum = pxb[0];
+ break;
+ case 0x13:
+ s = "Intel 82454NX PXB#0, Bus#B";
+ *busnum = pxb[1];
+ break;
+ case 0x14:
+ s = "Intel 82454NX PXB#1, Bus#A";
+ *busnum = pxb[2];
+ break;
+ case 0x15:
+ s = "Intel 82454NX PXB#1, Bus#B";
+ *busnum = pxb[3];
+ break;
+ }
+ break;
+ case 0x1A308086:
+ s = "Intel 82845 Host to PCI bridge";
+ break;
+
+ /* AMD -- vendor 0x1022 */
+ case 0x30001022:
+ s = "AMD Elan SC520 host to PCI bridge";
+#ifdef CPU_ELAN
+ init_AMD_Elan_sc520();
+#else
+ printf(
+"*** WARNING: missing CPU_ELAN -- timekeeping may be wrong\n");
+#endif
+ break;
+ case 0x70061022:
+ s = "AMD-751 host to PCI bridge";
+ break;
+ case 0x700e1022:
+ s = "AMD-761 host to PCI bridge";
+ break;
+
+ /* SiS -- vendor 0x1039 */
+ case 0x04961039:
+ s = "SiS 85c496";
+ break;
+ case 0x04061039:
+ s = "SiS 85c501";
+ break;
+ case 0x06011039:
+ s = "SiS 85c601";
+ break;
+ case 0x55911039:
+ s = "SiS 5591 host to PCI bridge";
+ break;
+ case 0x00011039:
+ s = "SiS 5591 host to AGP bridge";
+ break;
+
+ /* VLSI -- vendor 0x1004 */
+ case 0x00051004:
+ s = "VLSI 82C592 Host to PCI bridge";
+ break;
+
+ /* XXX Here is MVP3, I got the datasheet but NO M/B to test it */
+ /* totally. Please let me know if anything wrong. -F */
+ /* XXX need info on the MVP3 -- any takers? */
+ case 0x05981106:
+ s = "VIA 82C598MVP (Apollo MVP3) host bridge";
+ break;
+
+ /* AcerLabs -- vendor 0x10b9 */
+ /* Funny : The datasheet told me vendor id is "10b8",sub-vendor */
+ /* id is '10b9" but the register always shows "10b9". -Foxfair */
+ case 0x154110b9:
+ s = "AcerLabs M1541 (Aladdin-V) PCI host bridge";
+ break;
+
+ /* OPTi -- vendor 0x1045 */
+ case 0xc7011045:
+ s = "OPTi 82C700 host to PCI bridge";
+ break;
+ case 0xc8221045:
+ s = "OPTi 82C822 host to PCI Bridge";
+ break;
+
+ /* ServerWorks -- vendor 0x1166 */
+ case 0x00051166:
+ s = "ServerWorks NB6536 2.0HE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00061166:
+ /* FALLTHROUGH */
+ case 0x00081166:
+ /* FALLTHROUGH */
+ case 0x02011166:
+ /* FALLTHROUGH */
+ case 0x010f1014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00091166:
+ s = "ServerWorks NB6635 3.0LE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00101166:
+ s = "ServerWorks CIOB30 host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00111166:
+ /* FALLTHROUGH */
+ case 0x03021014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks CMIC-HE host to PCI-X bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* XXX unknown chipset, but working */
+ case 0x00171166:
+ /* FALLTHROUGH */
+ case 0x01011166:
+ case 0x01101166:
+ case 0x02251166:
+ s = "ServerWorks host to PCI bridge(unknown chipset)";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* Compaq/HP -- vendor 0x0e11 */
+ case 0x60100e11:
+ s = "Compaq/HP Model 6010 HotPlug PCI Bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0xc8, 1);
+ break;
+
+ /* Integrated Micro Solutions -- vendor 0x10e0 */
+ case 0x884910e0:
+ s = "Integrated Micro Solutions VL Bridge";
+ break;
+
+ default:
+ if (class == PCIC_BRIDGE && subclass == PCIS_BRIDGE_HOST)
+ s = "Host to PCI bridge";
+ break;
+ }
+
+ return s;
+}
+
+/*
+ * Scan the first pci bus for host-pci bridges and add pcib instances
+ * to the nexus for each bridge.
+ */
+static void
+legacy_pcib_identify(driver_t *driver, device_t parent)
+{
+ int bus, slot, func;
+ u_int8_t hdrtype;
+ int found = 0;
+ int pcifunchigh;
+ int found824xx = 0;
+ int found_orion = 0;
+ device_t child;
+ devclass_t pci_devclass;
+
+ if (pci_cfgregopen() == 0)
+ return;
+ /*
+ * Check to see if we haven't already had a PCI bus added
+ * via some other means. If we have, bail since otherwise
+ * we're going to end up duplicating it.
+ */
+ if ((pci_devclass = devclass_find("pci")) &&
+ devclass_get_device(pci_devclass, 0))
+ return;
+
+
+ bus = 0;
+ retry:
+ for (slot = 0; slot <= PCI_SLOTMAX; slot++) {
+ func = 0;
+ hdrtype = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_HDRTYPE, 1);
+ /*
+ * When enumerating bus devices, the standard says that
+ * one should check the header type and ignore the slots whose
+ * header types that the software doesn't know about. We use
+ * this to filter out devices.
+ */
+ if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE)
+ continue;
+ if ((hdrtype & PCIM_MFDEV) &&
+ (!found_orion || hdrtype != 0xff))
+ pcifunchigh = PCI_FUNCMAX;
+ else
+ pcifunchigh = 0;
+ for (func = 0; func <= pcifunchigh; func++) {
+ /*
+ * Read the IDs and class from the device.
+ */
+ u_int32_t id;
+ u_int8_t class, subclass, busnum;
+ const char *s;
+ device_t *devs;
+ int ndevs, i;
+
+ id = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_DEVVENDOR, 4);
+ if (id == -1)
+ continue;
+ class = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_CLASS, 1);
+ subclass = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_SUBCLASS, 1);
+
+ s = legacy_pcib_is_host_bridge(bus, slot, func,
+ id, class, subclass,
+ &busnum);
+ if (s == NULL)
+ continue;
+
+ /*
+ * Check to see if the physical bus has already
+ * been seen. Eg: hybrid 32 and 64 bit host
+ * bridges to the same logical bus.
+ */
+ if (device_get_children(parent, &devs, &ndevs) == 0) {
+ for (i = 0; s != NULL && i < ndevs; i++) {
+ if (strcmp(device_get_name(devs[i]),
+ "pcib") != 0)
+ continue;
+ if (legacy_get_pcibus(devs[i]) == busnum)
+ s = NULL;
+ }
+ free(devs, M_TEMP);
+ }
+
+ if (s == NULL)
+ continue;
+ /*
+ * Add at priority 100 to make sure we
+ * go after any motherboard resources
+ */
+ child = BUS_ADD_CHILD(parent, 100,
+ "pcib", busnum);
+ device_set_desc(child, s);
+ legacy_set_pcibus(child, busnum);
+
+ found = 1;
+ if (id == 0x12258086)
+ found824xx = 1;
+ if (id == 0x84c48086)
+ found_orion = 1;
+ }
+ }
+ if (found824xx && bus == 0) {
+ bus++;
+ goto retry;
+ }
+
+ /*
+ * Make sure we add at least one bridge since some old
+ * hardware doesn't actually have a host-pci bridge device.
+ * Note that pci_cfgregopen() thinks we have PCI devices..
+ */
+ if (!found) {
+ if (bootverbose)
+ printf(
+ "legacy_pcib_identify: no bridge found, adding pcib0 anyway\n");
+ child = BUS_ADD_CHILD(parent, 100, "pcib", 0);
+ legacy_set_pcibus(child, 0);
+ }
+}
+
+static int
+legacy_pcib_probe(device_t dev)
+{
+
+ if (pci_cfgregopen() == 0)
+ return ENXIO;
+ return -100;
+}
+
+static int
+legacy_pcib_attach(device_t dev)
+{
+ device_t pir;
+ int bus;
+
+ /*
+ * Look for a PCI BIOS interrupt routing table as that will be
+ * our method of routing interrupts if we have one.
+ */
+ bus = pcib_get_bus(dev);
+#ifndef __rtems__
+ if (pci_pir_probe(bus, 0)) {
+ pir = BUS_ADD_CHILD(device_get_parent(dev), 0, "pir", 0);
+ if (pir != NULL)
+ device_probe_and_attach(pir);
+ }
+#else /* __rtems__ */
+#endif /* __rtems__ */
+ device_add_child(dev, "pci", bus);
+ return bus_generic_attach(dev);
+}
+
+int
+legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ *result = 0;
+ return 0;
+ case PCIB_IVAR_BUS:
+ *result = legacy_get_pcibus(dev);
+ return 0;
+ }
+ return ENOENT;
+}
+
+int
+legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ return EINVAL;
+ case PCIB_IVAR_BUS:
+ legacy_set_pcibus(dev, value);
+ return 0;
+ }
+ return ENOENT;
+}
+
+SYSCTL_DECL(_hw_pci);
+
+static unsigned long legacy_host_mem_start = 0x80000000;
+TUNABLE_ULONG("hw.pci.host_mem_start", &legacy_host_mem_start);
+SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN,
+ &legacy_host_mem_start, 0x80000000,
+ "Limit the host bridge memory to being above this address. Must be\n\
+set at boot via a tunable.");
+
+struct resource *
+legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
+ u_long start, u_long end, u_long count, u_int flags)
+{
+ /*
+ * If no memory preference is given, use upper 32MB slot most
+ * bioses use for their memory window. Typically other bridges
+ * before us get in the way to assert their preferences on memory.
+ * Hardcoding like this sucks, so a more MD/MI way needs to be
+ * found to do it. This is typically only used on older laptops
+ * that don't have pci busses behind pci bridge, so assuming > 32MB
+ * is liekly OK.
+ *
+ * However, this can cause problems for other chipsets, so we make
+ * this tunable by hw.pci.host_mem_start.
+ */
+ if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL)
+ start = legacy_host_mem_start;
+ if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL)
+ start = 0x1000;
+ return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
+ count, flags));
+}
+
+static device_method_t legacy_pcib_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, legacy_pcib_identify),
+ DEVMETHOD(device_probe, legacy_pcib_probe),
+ DEVMETHOD(device_attach, legacy_pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, legacy_pcib_maxslots),
+ DEVMETHOD(pcib_read_config, legacy_pcib_read_config),
+ DEVMETHOD(pcib_write_config, legacy_pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, legacy_pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, legacy_pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, legacy_pcib_map_msi),
+
+ { 0, 0 }
+};
+
+static devclass_t hostb_devclass;
+
+DEFINE_CLASS_0(pcib, legacy_pcib_driver, legacy_pcib_methods, 1);
+DRIVER_MODULE(pcib, legacy, legacy_pcib_driver, hostb_devclass, 0, 0);
+
+
+#ifndef __rtems__
+/*
+ * Install placeholder to claim the resources owned by the
+ * PCI bus interface. This could be used to extract the
+ * config space registers in the extreme case where the PnP
+ * ID is available and the PCI BIOS isn't, but for now we just
+ * eat the PnP ID and do nothing else.
+ *
+ * XXX we should silence this probe, as it will generally confuse
+ * people.
+ */
+static struct isa_pnp_id pcibus_pnp_ids[] = {
+ { 0x030ad041 /* PNP0A03 */, "PCI Bus" },
+ { 0x080ad041 /* PNP0A08 */, "PCIe Bus" },
+ { 0 }
+};
+
+static int
+pcibus_pnp_probe(device_t dev)
+{
+ int result;
+
+ if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, pcibus_pnp_ids)) <= 0)
+ device_quiet(dev);
+ return(result);
+}
+
+static int
+pcibus_pnp_attach(device_t dev)
+{
+ return(0);
+}
+
+static device_method_t pcibus_pnp_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibus_pnp_probe),
+ DEVMETHOD(device_attach, pcibus_pnp_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+ { 0, 0 }
+};
+
+static devclass_t pcibus_pnp_devclass;
+
+DEFINE_CLASS_0(pcibus_pnp, pcibus_pnp_driver, pcibus_pnp_methods, 1);
+DRIVER_MODULE(pcibus_pnp, isa, pcibus_pnp_driver, pcibus_pnp_devclass, 0, 0);
+
+
+/*
+ * Provide a PCI-PCI bridge driver for PCI busses behind PCI-PCI bridges
+ * that appear in the PCIBIOS Interrupt Routing Table to use the routing
+ * table for interrupt routing when possible.
+ */
+static int pcibios_pcib_probe(device_t bus);
+
+static device_method_t pcibios_pcib_pci_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibios_pcib_probe),
+ DEVMETHOD(device_attach, pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, pcib_maxslots),
+ DEVMETHOD(pcib_read_config, pcib_read_config),
+ DEVMETHOD(pcib_write_config, pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, pcib_map_msi),
+
+ {0, 0}
+};
+
+static devclass_t pcib_devclass;
+
+DEFINE_CLASS_0(pcib, pcibios_pcib_driver, pcibios_pcib_pci_methods,
+ sizeof(struct pcib_softc));
+DRIVER_MODULE(pcibios_pcib, pci, pcibios_pcib_driver, pcib_devclass, 0, 0);
+
+static int
+pcibios_pcib_probe(device_t dev)
+{
+ int bus;
+
+ if ((pci_get_class(dev) != PCIC_BRIDGE) ||
+ (pci_get_subclass(dev) != PCIS_BRIDGE_PCI))
+ return (ENXIO);
+ bus = pci_read_config(dev, PCIR_SECBUS_1, 1);
+ if (bus == 0)
+ return (ENXIO);
+ if (!pci_pir_probe(bus, 1))
+ return (ENXIO);
+ device_set_desc(dev, "PCIBIOS PCI-PCI bridge");
+ return (-2000);
+}
+
+static int
+pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
+{
+ return (pci_pir_route_interrupt(pci_get_bus(dev), pci_get_slot(dev),
+ pci_get_function(dev), pin));
+}
+#endif /* __rtems__ */
diff --git a/freebsd/sys/powerpc/powerpc/in_cksum.c b/freebsd/sys/powerpc/powerpc/in_cksum.c
index ede39fc3..62e45e18 100644
--- a/freebsd/sys/powerpc/powerpc/in_cksum.c
+++ b/freebsd/sys/powerpc/powerpc/in_cksum.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/* $FreeBSD$ */
/* $NetBSD: in_cksum.c,v 1.7 1997/09/02 13:18:15 thorpej Exp $ */
@@ -40,15 +40,15 @@
* @(#)in_cksum.c 8.1 (Berkeley) 6/10/93
*/
-#include <freebsd/sys/cdefs.h> /* RCS ID & Copyright macro defns */
+#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/ip.h>
-#include <freebsd/machine/in_cksum.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/mbuf.h>
+#include <sys/systm.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <machine/in_cksum.h>
/*
* Checksum routine for Internet Protocol family headers
diff --git a/freebsd/sys/powerpc/powerpc/legacy.c b/freebsd/sys/powerpc/powerpc/legacy.c
new file mode 100644
index 00000000..2547990c
--- /dev/null
+++ b/freebsd/sys/powerpc/powerpc/legacy.c
@@ -0,0 +1,347 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright 1998 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby
+ * granted, provided that both the above copyright notice and this
+ * permission notice appear in all copies, that both the above
+ * copyright notice and this permission notice appear in all
+ * supporting documentation, and that the name of M.I.T. not be used
+ * in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission. M.I.T. makes
+ * no representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
+ * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
+ * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * This code implements a system driver for legacy systems that do not
+ * support ACPI or when ACPI support is not present in the kernel.
+ */
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <machine/bus.h>
+#include <sys/pcpu.h>
+#include <sys/rman.h>
+#include <sys/smp.h>
+
+#ifndef __rtems__
+#include <rtems/bsd/local/opt_mca.h>
+#endif /* __rtems__ */
+#ifdef DEV_MCA
+#include <i386/bios/mca_machdep.h>
+#endif
+
+#include <machine/legacyvar.h>
+#include <machine/resource.h>
+
+static MALLOC_DEFINE(M_LEGACYDEV, "legacydrv", "legacy system device");
+struct legacy_device {
+ int lg_pcibus;
+};
+
+#define DEVTOAT(dev) ((struct legacy_device *)device_get_ivars(dev))
+
+static int legacy_probe(device_t);
+static int legacy_attach(device_t);
+static int legacy_print_child(device_t, device_t);
+static device_t legacy_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static int legacy_read_ivar(device_t, device_t, int, uintptr_t *);
+static int legacy_write_ivar(device_t, device_t, int, uintptr_t);
+
+static device_method_t legacy_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, legacy_probe),
+ DEVMETHOD(device_attach, legacy_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, legacy_print_child),
+ DEVMETHOD(bus_add_child, legacy_add_child),
+ DEVMETHOD(bus_read_ivar, legacy_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_write_ivar),
+ DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t legacy_driver = {
+ "legacy",
+ legacy_methods,
+ 1, /* no softc */
+};
+static devclass_t legacy_devclass;
+
+DRIVER_MODULE(legacy, nexus, legacy_driver, legacy_devclass, 0, 0);
+
+static int
+legacy_probe(device_t dev)
+{
+
+ device_set_desc(dev, "legacy system");
+ device_quiet(dev);
+ return (0);
+}
+
+static int
+legacy_attach(device_t dev)
+{
+ device_t child;
+
+ /*
+ * Let our child drivers identify any child devices that they
+ * can find. Once that is done attach any devices that we
+ * found.
+ */
+ bus_generic_probe(dev);
+ bus_generic_attach(dev);
+
+#ifndef PC98
+ /*
+ * If we didn't see EISA or ISA on a pci bridge, create some
+ * connection points now so they show up "on motherboard".
+ */
+ if (!devclass_get_device(devclass_find("eisa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "eisa", 0);
+ if (child == NULL)
+ panic("legacy_attach eisa");
+ device_probe_and_attach(child);
+ }
+#endif
+#ifdef DEV_MCA
+ if (MCA_system && !devclass_get_device(devclass_find("mca"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "mca", 0);
+ if (child == 0)
+ panic("legacy_probe mca");
+ device_probe_and_attach(child);
+ }
+#endif
+ if (!devclass_get_device(devclass_find("isa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "isa", 0);
+ if (child == NULL)
+ panic("legacy_attach isa");
+ device_probe_and_attach(child);
+ }
+
+ return 0;
+}
+
+static int
+legacy_print_child(device_t bus, device_t child)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+ int retval = 0;
+
+ retval += bus_print_child_header(bus, child);
+ if (atdev->lg_pcibus != -1)
+ retval += printf(" pcibus %d", atdev->lg_pcibus);
+ retval += printf(" on motherboard\n"); /* XXX "motherboard", ick */
+
+ return (retval);
+}
+
+static device_t
+legacy_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ device_t child;
+ struct legacy_device *atdev;
+
+ atdev = malloc(sizeof(struct legacy_device), M_LEGACYDEV,
+ M_NOWAIT | M_ZERO);
+ if (atdev == NULL)
+ return(NULL);
+ atdev->lg_pcibus = -1;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child == NULL)
+ free(atdev, M_LEGACYDEV);
+ else
+ /* should we free this in legacy_child_detached? */
+ device_set_ivars(child, atdev);
+
+ return (child);
+}
+
+static int
+legacy_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ *result = 0;
+ break;
+ case LEGACY_IVAR_PCIBUS:
+ *result = atdev->lg_pcibus;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+
+static int
+legacy_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ return EINVAL;
+ case LEGACY_IVAR_PCIBUS:
+ atdev->lg_pcibus = value;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+/*
+ * Legacy CPU attachment when ACPI is not available. Drivers like
+ * cpufreq(4) hang off this.
+ */
+static void cpu_identify(driver_t *driver, device_t parent);
+static int cpu_read_ivar(device_t dev, device_t child, int index,
+ uintptr_t *result);
+static device_t cpu_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static struct resource_list *cpu_get_rlist(device_t dev, device_t child);
+
+struct cpu_device {
+ struct resource_list cd_rl;
+ struct pcpu *cd_pcpu;
+};
+
+static device_method_t cpu_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, cpu_identify),
+ DEVMETHOD(device_probe, bus_generic_probe),
+ DEVMETHOD(device_attach, bus_generic_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_add_child, cpu_add_child),
+ DEVMETHOD(bus_read_ivar, cpu_read_ivar),
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_get_resource_list, cpu_get_rlist),
+ DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
+ DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource),
+ DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource),
+ DEVMETHOD(bus_driver_added, bus_generic_driver_added),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t cpu_driver = {
+ "cpu",
+ cpu_methods,
+ 1, /* no softc */
+};
+static devclass_t cpu_devclass;
+DRIVER_MODULE(cpu, legacy, cpu_driver, cpu_devclass, 0, 0);
+
+static void
+cpu_identify(driver_t *driver, device_t parent)
+{
+ device_t child;
+ int i;
+
+ /*
+ * Attach a cpuX device for each CPU. We use an order of 150
+ * so that these devices are attached after the Host-PCI
+ * bridges (which are added at order 100).
+ */
+ for (i = 0; i <= mp_maxid; i++)
+ if (!CPU_ABSENT(i)) {
+ child = BUS_ADD_CHILD(parent, 150, "cpu", i);
+ if (child == NULL)
+ panic("legacy_attach cpu");
+ }
+}
+
+static device_t
+cpu_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ struct cpu_device *cd;
+ device_t child;
+ struct pcpu *pc;
+
+ if ((cd = malloc(sizeof(*cd), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL)
+ return (NULL);
+
+ resource_list_init(&cd->cd_rl);
+ pc = pcpu_find(device_get_unit(bus));
+ cd->cd_pcpu = pc;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child != NULL) {
+ pc->pc_device = child;
+ device_set_ivars(child, cd);
+ } else
+ free(cd, M_DEVBUF);
+ return (child);
+}
+
+static struct resource_list *
+cpu_get_rlist(device_t dev, device_t child)
+{
+ struct cpu_device *cpdev;
+
+ cpdev = device_get_ivars(child);
+ return (&cpdev->cd_rl);
+}
+
+static int
+cpu_read_ivar(device_t dev, device_t child, int index, uintptr_t *result)
+{
+ struct cpu_device *cpdev;
+
+ if (index != CPU_IVAR_PCPU)
+ return (ENOENT);
+ cpdev = device_get_ivars(child);
+ *result = (uintptr_t)cpdev->cd_pcpu;
+ return (0);
+}
diff --git a/freebsd/sys/rpc/types.h b/freebsd/sys/rpc/types.h
index b476ada3..5634c4dd 100644
--- a/freebsd/sys/rpc/types.h
+++ b/freebsd/sys/rpc/types.h
@@ -39,7 +39,7 @@
#ifndef _RPC_TYPES_H
#define _RPC_TYPES_H
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/_null.h>
typedef int32_t bool_t;
@@ -72,7 +72,7 @@ MALLOC_DECLARE(M_RPC);
#define mem_free(ptr, bsize) free(ptr)
#endif
-#include <sys/time.h>
+#include <rtems/bsd/sys/time.h>
#ifdef _KERNEL
#include <rpc/netconfig.h>
#else
diff --git a/freebsd/sys/security/mac/mac_framework.h b/freebsd/sys/security/mac/mac_framework.h
index c827e713..70fb7c99 100644
--- a/freebsd/sys/security/mac/mac_framework.h
+++ b/freebsd/sys/security/mac/mac_framework.h
@@ -46,8 +46,8 @@
* interact with the TrustedBSD MAC Framework.
*/
-#ifndef _SECURITY_MAC_MAC_FRAMEWORK_HH_
-#define _SECURITY_MAC_MAC_FRAMEWORK_HH_
+#ifndef _SECURITY_MAC_MAC_FRAMEWORK_H_
+#define _SECURITY_MAC_MAC_FRAMEWORK_H_
#ifndef _KERNEL
#error "no user-serviceable parts inside"
@@ -89,8 +89,8 @@ struct vattr;
struct vnode;
struct vop_setlabel_args;
-#include <freebsd/sys/acl.h> /* XXX acl_type_t */
-#include <freebsd/sys/types.h> /* accmode_t */
+#include <sys/acl.h> /* XXX acl_type_t */
+#include <rtems/bsd/sys/types.h> /* accmode_t */
/*
* Entry points to the TrustedBSD MAC Framework from the remainder of the
@@ -438,4 +438,4 @@ void mac_vnode_relabel(struct ucred *cred, struct vnode *vp,
*/
int vop_stdsetlabel_ea(struct vop_setlabel_args *ap);
-#endif /* !_SECURITY_MAC_MAC_FRAMEWORK_HH_ */
+#endif /* !_SECURITY_MAC_MAC_FRAMEWORK_H_ */
diff --git a/freebsd/sys/sh/include/machine/in_cksum.h b/freebsd/sys/sh/include/machine/in_cksum.h
new file mode 100644
index 00000000..37d88e2e
--- /dev/null
+++ b/freebsd/sys/sh/include/machine/in_cksum.h
@@ -0,0 +1,77 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from tahoe: in_cksum.c 1.2 86/01/05
+ * from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91
+ * from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp
+ * from: src/sys/alpha/include/in_cksum.h,v 1.7 2005/03/02 21:33:20 joerg
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_IN_CKSUM_H_
+#define _MACHINE_IN_CKSUM_H_ 1
+
+#include <sys/cdefs.h>
+
+#define in_cksum(m, len) in_cksum_skip(m, len, 0)
+
+/*
+ * It it useful to have an Internet checksum routine which is inlineable
+ * and optimized specifically for the task of computing IP header checksums
+ * in the normal case (where there are no options and the header length is
+ * therefore always exactly five 32-bit words.
+ */
+#ifdef __CC_SUPPORTS___INLINE
+
+static __inline void
+in_cksum_update(struct ip *ip)
+{
+ int __tmpsum;
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256;
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16));
+}
+
+#else
+
+#define in_cksum_update(ip) \
+ do { \
+ int __tmpsum; \
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256; \
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \
+ } while(0)
+
+#endif
+
+#ifdef _KERNEL
+u_int in_cksum_hdr(const struct ip *ip);
+u_short in_addword(u_short sum, u_short b);
+u_short in_pseudo(u_int sum, u_int b, u_int c);
+u_short in_cksum_skip(struct mbuf *m, int len, int skip);
+#endif
+
+#endif /* _MACHINE_IN_CKSUM_H_ */
diff --git a/freebsd/sys/sh/include/machine/legacyvar.h b/freebsd/sys/sh/include/machine/legacyvar.h
new file mode 100644
index 00000000..0b0fa433
--- /dev/null
+++ b/freebsd/sys/sh/include/machine/legacyvar.h
@@ -0,0 +1,57 @@
+/*-
+ * Copyright (c) 2000 Peter Wemm <peter@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_LEGACYVAR_H_
+#define _MACHINE_LEGACYVAR_H_
+
+enum legacy_device_ivars {
+ LEGACY_IVAR_PCIDOMAIN,
+ LEGACY_IVAR_PCIBUS
+};
+
+#define LEGACY_ACCESSOR(var, ivar, type) \
+ __BUS_ACCESSOR(legacy, var, LEGACY, ivar, type)
+
+LEGACY_ACCESSOR(pcidomain, PCIDOMAIN, uint32_t)
+LEGACY_ACCESSOR(pcibus, PCIBUS, uint32_t)
+
+#undef LEGACY_ACCESSOR
+
+int legacy_pcib_maxslots(device_t dev);
+uint32_t legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes);
+int legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result);
+void legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes);
+int legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value);
+struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child,
+ int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
+
+#endif /* !_MACHINE_LEGACYVAR_H_ */
diff --git a/freebsd/sys/sh/include/machine/pci_cfgreg.h b/freebsd/sys/sh/include/machine/pci_cfgreg.h
new file mode 100644
index 00000000..bc72418d
--- /dev/null
+++ b/freebsd/sys/sh/include/machine/pci_cfgreg.h
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
+ */
+
+#define CONF1_ADDR_PORT 0x0cf8
+#define CONF1_DATA_PORT 0x0cfc
+
+#define CONF1_ENABLE 0x80000000ul
+#define CONF1_ENABLE_CHK 0x80000000ul
+#define CONF1_ENABLE_MSK 0x7f000000ul
+#define CONF1_ENABLE_CHK1 0xff000001ul
+#define CONF1_ENABLE_MSK1 0x80000001ul
+#define CONF1_ENABLE_RES1 0x80000000ul
+
+#define CONF2_ENABLE_PORT 0x0cf8
+#define CONF2_FORWARD_PORT 0x0cfa
+
+#define CONF2_ENABLE_CHK 0x0e
+#define CONF2_ENABLE_RES 0x0e
+
+int pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus);
+int pci_cfgregopen(void);
+u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes);
+void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes);
+void pci_pir_open(void);
+int pci_pir_probe(int bus, int require_parse);
+int pci_pir_route_interrupt(int bus, int device, int func, int pin);
diff --git a/freebsd/sys/sh/pci/pci_bus.c b/freebsd/sys/sh/pci/pci_bus.c
new file mode 100644
index 00000000..6627db98
--- /dev/null
+++ b/freebsd/sys/sh/pci/pci_bus.c
@@ -0,0 +1,729 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/local/opt_cpu.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
+
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcib_private.h>
+#include <isa/isavar.h>
+#ifdef CPU_ELAN
+#include <machine/md_var.h>
+#endif
+#include <machine/legacyvar.h>
+#include <machine/pci_cfgreg.h>
+#include <machine/resource.h>
+
+#include <rtems/bsd/local/pcib_if.h>
+
+#ifndef __rtems__
+static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev,
+ int pin);
+#else /* __rtems__ */
+int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin);
+#endif /* __rtems__ */
+
+
+int
+legacy_pcib_maxslots(device_t dev)
+{
+ return 31;
+}
+
+/* read configuration space register */
+
+#ifdef __rtems__
+uint32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#else
+u_int32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#endif
+{
+ return(pci_cfgregread(bus, slot, func, reg, bytes));
+}
+
+/* write configuration space register */
+
+void
+legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes)
+{
+ pci_cfgregwrite(bus, slot, func, reg, data, bytes);
+}
+
+/* Pass MSI requests up to the nexus. */
+
+static int
+legacy_pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount,
+ int *irqs)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSI(device_get_parent(bus), dev, count, maxcount,
+ irqs));
+}
+
+static int
+legacy_pcib_alloc_msix(device_t pcib, device_t dev, int *irq)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq));
+}
+
+static int
+legacy_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr,
+ uint32_t *data)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data));
+}
+
+static const char *
+legacy_pcib_is_host_bridge(int bus, int slot, int func,
+ uint32_t id, uint8_t class, uint8_t subclass,
+ uint8_t *busnum)
+{
+ const char *s = NULL;
+ static uint8_t pxb[4]; /* hack for 450nx */
+
+ *busnum = 0;
+
+ switch (id) {
+ case 0x12258086:
+ s = "Intel 824?? host to PCI bridge";
+ /* XXX This is a guess */
+ /* *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x41, 1); */
+ *busnum = bus;
+ break;
+ case 0x71208086:
+ s = "Intel 82810 (i810 GMCH) Host To Hub bridge";
+ break;
+ case 0x71228086:
+ s = "Intel 82810-DC100 (i810-DC100 GMCH) Host To Hub bridge";
+ break;
+ case 0x71248086:
+ s = "Intel 82810E (i810E GMCH) Host To Hub bridge";
+ break;
+ case 0x11308086:
+ s = "Intel 82815 (i815 GMCH) Host To Hub bridge";
+ break;
+ case 0x71808086:
+ s = "Intel 82443LX (440 LX) host to PCI bridge";
+ break;
+ case 0x71908086:
+ s = "Intel 82443BX (440 BX) host to PCI bridge";
+ break;
+ case 0x71928086:
+ s = "Intel 82443BX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x71948086:
+ s = "Intel 82443MX host to PCI bridge";
+ break;
+ case 0x71a08086:
+ s = "Intel 82443GX host to PCI bridge";
+ break;
+ case 0x71a18086:
+ s = "Intel 82443GX host to AGP bridge";
+ break;
+ case 0x71a28086:
+ s = "Intel 82443GX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x84c48086:
+ s = "Intel 82454KX/GX (Orion) host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x4a, 1);
+ break;
+ case 0x84ca8086:
+ /*
+ * For the 450nx chipset, there is a whole bundle of
+ * things pretending to be host bridges. The MIOC will
+ * be seen first and isn't really a pci bridge (the
+ * actual busses are attached to the PXB's). We need to
+ * read the registers of the MIOC to figure out the
+ * bus numbers for the PXB channels.
+ *
+ * Since the MIOC doesn't have a pci bus attached, we
+ * pretend it wasn't there.
+ */
+ pxb[0] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd0, 1); /* BUSNO[0] */
+ pxb[1] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd1, 1) + 1; /* SUBA[0]+1 */
+ pxb[2] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd3, 1); /* BUSNO[1] */
+ pxb[3] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd4, 1) + 1; /* SUBA[1]+1 */
+ return NULL;
+ case 0x84cb8086:
+ switch (slot) {
+ case 0x12:
+ s = "Intel 82454NX PXB#0, Bus#A";
+ *busnum = pxb[0];
+ break;
+ case 0x13:
+ s = "Intel 82454NX PXB#0, Bus#B";
+ *busnum = pxb[1];
+ break;
+ case 0x14:
+ s = "Intel 82454NX PXB#1, Bus#A";
+ *busnum = pxb[2];
+ break;
+ case 0x15:
+ s = "Intel 82454NX PXB#1, Bus#B";
+ *busnum = pxb[3];
+ break;
+ }
+ break;
+ case 0x1A308086:
+ s = "Intel 82845 Host to PCI bridge";
+ break;
+
+ /* AMD -- vendor 0x1022 */
+ case 0x30001022:
+ s = "AMD Elan SC520 host to PCI bridge";
+#ifdef CPU_ELAN
+ init_AMD_Elan_sc520();
+#else
+ printf(
+"*** WARNING: missing CPU_ELAN -- timekeeping may be wrong\n");
+#endif
+ break;
+ case 0x70061022:
+ s = "AMD-751 host to PCI bridge";
+ break;
+ case 0x700e1022:
+ s = "AMD-761 host to PCI bridge";
+ break;
+
+ /* SiS -- vendor 0x1039 */
+ case 0x04961039:
+ s = "SiS 85c496";
+ break;
+ case 0x04061039:
+ s = "SiS 85c501";
+ break;
+ case 0x06011039:
+ s = "SiS 85c601";
+ break;
+ case 0x55911039:
+ s = "SiS 5591 host to PCI bridge";
+ break;
+ case 0x00011039:
+ s = "SiS 5591 host to AGP bridge";
+ break;
+
+ /* VLSI -- vendor 0x1004 */
+ case 0x00051004:
+ s = "VLSI 82C592 Host to PCI bridge";
+ break;
+
+ /* XXX Here is MVP3, I got the datasheet but NO M/B to test it */
+ /* totally. Please let me know if anything wrong. -F */
+ /* XXX need info on the MVP3 -- any takers? */
+ case 0x05981106:
+ s = "VIA 82C598MVP (Apollo MVP3) host bridge";
+ break;
+
+ /* AcerLabs -- vendor 0x10b9 */
+ /* Funny : The datasheet told me vendor id is "10b8",sub-vendor */
+ /* id is '10b9" but the register always shows "10b9". -Foxfair */
+ case 0x154110b9:
+ s = "AcerLabs M1541 (Aladdin-V) PCI host bridge";
+ break;
+
+ /* OPTi -- vendor 0x1045 */
+ case 0xc7011045:
+ s = "OPTi 82C700 host to PCI bridge";
+ break;
+ case 0xc8221045:
+ s = "OPTi 82C822 host to PCI Bridge";
+ break;
+
+ /* ServerWorks -- vendor 0x1166 */
+ case 0x00051166:
+ s = "ServerWorks NB6536 2.0HE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00061166:
+ /* FALLTHROUGH */
+ case 0x00081166:
+ /* FALLTHROUGH */
+ case 0x02011166:
+ /* FALLTHROUGH */
+ case 0x010f1014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00091166:
+ s = "ServerWorks NB6635 3.0LE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00101166:
+ s = "ServerWorks CIOB30 host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00111166:
+ /* FALLTHROUGH */
+ case 0x03021014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks CMIC-HE host to PCI-X bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* XXX unknown chipset, but working */
+ case 0x00171166:
+ /* FALLTHROUGH */
+ case 0x01011166:
+ case 0x01101166:
+ case 0x02251166:
+ s = "ServerWorks host to PCI bridge(unknown chipset)";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* Compaq/HP -- vendor 0x0e11 */
+ case 0x60100e11:
+ s = "Compaq/HP Model 6010 HotPlug PCI Bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0xc8, 1);
+ break;
+
+ /* Integrated Micro Solutions -- vendor 0x10e0 */
+ case 0x884910e0:
+ s = "Integrated Micro Solutions VL Bridge";
+ break;
+
+ default:
+ if (class == PCIC_BRIDGE && subclass == PCIS_BRIDGE_HOST)
+ s = "Host to PCI bridge";
+ break;
+ }
+
+ return s;
+}
+
+/*
+ * Scan the first pci bus for host-pci bridges and add pcib instances
+ * to the nexus for each bridge.
+ */
+static void
+legacy_pcib_identify(driver_t *driver, device_t parent)
+{
+ int bus, slot, func;
+ u_int8_t hdrtype;
+ int found = 0;
+ int pcifunchigh;
+ int found824xx = 0;
+ int found_orion = 0;
+ device_t child;
+ devclass_t pci_devclass;
+
+ if (pci_cfgregopen() == 0)
+ return;
+ /*
+ * Check to see if we haven't already had a PCI bus added
+ * via some other means. If we have, bail since otherwise
+ * we're going to end up duplicating it.
+ */
+ if ((pci_devclass = devclass_find("pci")) &&
+ devclass_get_device(pci_devclass, 0))
+ return;
+
+
+ bus = 0;
+ retry:
+ for (slot = 0; slot <= PCI_SLOTMAX; slot++) {
+ func = 0;
+ hdrtype = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_HDRTYPE, 1);
+ /*
+ * When enumerating bus devices, the standard says that
+ * one should check the header type and ignore the slots whose
+ * header types that the software doesn't know about. We use
+ * this to filter out devices.
+ */
+ if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE)
+ continue;
+ if ((hdrtype & PCIM_MFDEV) &&
+ (!found_orion || hdrtype != 0xff))
+ pcifunchigh = PCI_FUNCMAX;
+ else
+ pcifunchigh = 0;
+ for (func = 0; func <= pcifunchigh; func++) {
+ /*
+ * Read the IDs and class from the device.
+ */
+ u_int32_t id;
+ u_int8_t class, subclass, busnum;
+ const char *s;
+ device_t *devs;
+ int ndevs, i;
+
+ id = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_DEVVENDOR, 4);
+ if (id == -1)
+ continue;
+ class = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_CLASS, 1);
+ subclass = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_SUBCLASS, 1);
+
+ s = legacy_pcib_is_host_bridge(bus, slot, func,
+ id, class, subclass,
+ &busnum);
+ if (s == NULL)
+ continue;
+
+ /*
+ * Check to see if the physical bus has already
+ * been seen. Eg: hybrid 32 and 64 bit host
+ * bridges to the same logical bus.
+ */
+ if (device_get_children(parent, &devs, &ndevs) == 0) {
+ for (i = 0; s != NULL && i < ndevs; i++) {
+ if (strcmp(device_get_name(devs[i]),
+ "pcib") != 0)
+ continue;
+ if (legacy_get_pcibus(devs[i]) == busnum)
+ s = NULL;
+ }
+ free(devs, M_TEMP);
+ }
+
+ if (s == NULL)
+ continue;
+ /*
+ * Add at priority 100 to make sure we
+ * go after any motherboard resources
+ */
+ child = BUS_ADD_CHILD(parent, 100,
+ "pcib", busnum);
+ device_set_desc(child, s);
+ legacy_set_pcibus(child, busnum);
+
+ found = 1;
+ if (id == 0x12258086)
+ found824xx = 1;
+ if (id == 0x84c48086)
+ found_orion = 1;
+ }
+ }
+ if (found824xx && bus == 0) {
+ bus++;
+ goto retry;
+ }
+
+ /*
+ * Make sure we add at least one bridge since some old
+ * hardware doesn't actually have a host-pci bridge device.
+ * Note that pci_cfgregopen() thinks we have PCI devices..
+ */
+ if (!found) {
+ if (bootverbose)
+ printf(
+ "legacy_pcib_identify: no bridge found, adding pcib0 anyway\n");
+ child = BUS_ADD_CHILD(parent, 100, "pcib", 0);
+ legacy_set_pcibus(child, 0);
+ }
+}
+
+static int
+legacy_pcib_probe(device_t dev)
+{
+
+ if (pci_cfgregopen() == 0)
+ return ENXIO;
+ return -100;
+}
+
+static int
+legacy_pcib_attach(device_t dev)
+{
+ device_t pir;
+ int bus;
+
+ /*
+ * Look for a PCI BIOS interrupt routing table as that will be
+ * our method of routing interrupts if we have one.
+ */
+ bus = pcib_get_bus(dev);
+#ifndef __rtems__
+ if (pci_pir_probe(bus, 0)) {
+ pir = BUS_ADD_CHILD(device_get_parent(dev), 0, "pir", 0);
+ if (pir != NULL)
+ device_probe_and_attach(pir);
+ }
+#else /* __rtems__ */
+#endif /* __rtems__ */
+ device_add_child(dev, "pci", bus);
+ return bus_generic_attach(dev);
+}
+
+int
+legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ *result = 0;
+ return 0;
+ case PCIB_IVAR_BUS:
+ *result = legacy_get_pcibus(dev);
+ return 0;
+ }
+ return ENOENT;
+}
+
+int
+legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ return EINVAL;
+ case PCIB_IVAR_BUS:
+ legacy_set_pcibus(dev, value);
+ return 0;
+ }
+ return ENOENT;
+}
+
+SYSCTL_DECL(_hw_pci);
+
+static unsigned long legacy_host_mem_start = 0x80000000;
+TUNABLE_ULONG("hw.pci.host_mem_start", &legacy_host_mem_start);
+SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN,
+ &legacy_host_mem_start, 0x80000000,
+ "Limit the host bridge memory to being above this address. Must be\n\
+set at boot via a tunable.");
+
+struct resource *
+legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
+ u_long start, u_long end, u_long count, u_int flags)
+{
+ /*
+ * If no memory preference is given, use upper 32MB slot most
+ * bioses use for their memory window. Typically other bridges
+ * before us get in the way to assert their preferences on memory.
+ * Hardcoding like this sucks, so a more MD/MI way needs to be
+ * found to do it. This is typically only used on older laptops
+ * that don't have pci busses behind pci bridge, so assuming > 32MB
+ * is liekly OK.
+ *
+ * However, this can cause problems for other chipsets, so we make
+ * this tunable by hw.pci.host_mem_start.
+ */
+ if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL)
+ start = legacy_host_mem_start;
+ if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL)
+ start = 0x1000;
+ return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
+ count, flags));
+}
+
+static device_method_t legacy_pcib_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, legacy_pcib_identify),
+ DEVMETHOD(device_probe, legacy_pcib_probe),
+ DEVMETHOD(device_attach, legacy_pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, legacy_pcib_maxslots),
+ DEVMETHOD(pcib_read_config, legacy_pcib_read_config),
+ DEVMETHOD(pcib_write_config, legacy_pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, legacy_pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, legacy_pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, legacy_pcib_map_msi),
+
+ { 0, 0 }
+};
+
+static devclass_t hostb_devclass;
+
+DEFINE_CLASS_0(pcib, legacy_pcib_driver, legacy_pcib_methods, 1);
+DRIVER_MODULE(pcib, legacy, legacy_pcib_driver, hostb_devclass, 0, 0);
+
+
+#ifndef __rtems__
+/*
+ * Install placeholder to claim the resources owned by the
+ * PCI bus interface. This could be used to extract the
+ * config space registers in the extreme case where the PnP
+ * ID is available and the PCI BIOS isn't, but for now we just
+ * eat the PnP ID and do nothing else.
+ *
+ * XXX we should silence this probe, as it will generally confuse
+ * people.
+ */
+static struct isa_pnp_id pcibus_pnp_ids[] = {
+ { 0x030ad041 /* PNP0A03 */, "PCI Bus" },
+ { 0x080ad041 /* PNP0A08 */, "PCIe Bus" },
+ { 0 }
+};
+
+static int
+pcibus_pnp_probe(device_t dev)
+{
+ int result;
+
+ if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, pcibus_pnp_ids)) <= 0)
+ device_quiet(dev);
+ return(result);
+}
+
+static int
+pcibus_pnp_attach(device_t dev)
+{
+ return(0);
+}
+
+static device_method_t pcibus_pnp_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibus_pnp_probe),
+ DEVMETHOD(device_attach, pcibus_pnp_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+ { 0, 0 }
+};
+
+static devclass_t pcibus_pnp_devclass;
+
+DEFINE_CLASS_0(pcibus_pnp, pcibus_pnp_driver, pcibus_pnp_methods, 1);
+DRIVER_MODULE(pcibus_pnp, isa, pcibus_pnp_driver, pcibus_pnp_devclass, 0, 0);
+
+
+/*
+ * Provide a PCI-PCI bridge driver for PCI busses behind PCI-PCI bridges
+ * that appear in the PCIBIOS Interrupt Routing Table to use the routing
+ * table for interrupt routing when possible.
+ */
+static int pcibios_pcib_probe(device_t bus);
+
+static device_method_t pcibios_pcib_pci_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibios_pcib_probe),
+ DEVMETHOD(device_attach, pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, pcib_maxslots),
+ DEVMETHOD(pcib_read_config, pcib_read_config),
+ DEVMETHOD(pcib_write_config, pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, pcib_map_msi),
+
+ {0, 0}
+};
+
+static devclass_t pcib_devclass;
+
+DEFINE_CLASS_0(pcib, pcibios_pcib_driver, pcibios_pcib_pci_methods,
+ sizeof(struct pcib_softc));
+DRIVER_MODULE(pcibios_pcib, pci, pcibios_pcib_driver, pcib_devclass, 0, 0);
+
+static int
+pcibios_pcib_probe(device_t dev)
+{
+ int bus;
+
+ if ((pci_get_class(dev) != PCIC_BRIDGE) ||
+ (pci_get_subclass(dev) != PCIS_BRIDGE_PCI))
+ return (ENXIO);
+ bus = pci_read_config(dev, PCIR_SECBUS_1, 1);
+ if (bus == 0)
+ return (ENXIO);
+ if (!pci_pir_probe(bus, 1))
+ return (ENXIO);
+ device_set_desc(dev, "PCIBIOS PCI-PCI bridge");
+ return (-2000);
+}
+
+static int
+pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
+{
+ return (pci_pir_route_interrupt(pci_get_bus(dev), pci_get_slot(dev),
+ pci_get_function(dev), pin));
+}
+#endif /* __rtems__ */
diff --git a/freebsd/sys/sh/sh/in_cksum.c b/freebsd/sys/sh/sh/in_cksum.c
new file mode 100644
index 00000000..c6f7b568
--- /dev/null
+++ b/freebsd/sys/sh/sh/in_cksum.c
@@ -0,0 +1,255 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1988, 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ * Copyright (c) 1996
+ * Matt Thomas <matt@3am-software.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)in_cksum.c 8.1 (Berkeley) 6/10/93
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/mbuf.h>
+#include <sys/systm.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <machine/in_cksum.h>
+
+/*
+ * Checksum routine for Internet Protocol family headers
+ * (Portable Alpha version).
+ *
+ * This routine is very heavily used in the network
+ * code and should be modified for each CPU to be as fast as possible.
+ */
+
+#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x)
+#define REDUCE32 \
+ { \
+ q_util.q = sum; \
+ sum = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
+ }
+#define REDUCE16 \
+ { \
+ q_util.q = sum; \
+ l_util.l = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
+ sum = l_util.s[0] + l_util.s[1]; \
+ ADDCARRY(sum); \
+ }
+
+static const u_int32_t in_masks[] = {
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
+ 0x00000000, 0x000000FF, 0x0000FFFF, 0x00FFFFFF, /* offset 0 */
+ 0x00000000, 0x0000FF00, 0x00FFFF00, 0xFFFFFF00, /* offset 1 */
+ 0x00000000, 0x00FF0000, 0xFFFF0000, 0xFFFF0000, /* offset 2 */
+ 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, /* offset 3 */
+#else
+ /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
+ 0x00000000, 0xFF000000, 0xFFFF0000, 0xFFFFFF00, /* offset 0 */
+ 0x00000000, 0x00FF0000, 0x00FFFF00, 0x00FFFFFF, /* offset 1 */
+ 0x00000000, 0x0000FF00, 0x0000FFFF, 0x0000FFFF, /* offset 2 */
+ 0x00000000, 0x000000FF, 0x000000FF, 0x000000FF, /* offset 3 */
+#endif
+};
+
+union l_util {
+ u_int16_t s[2];
+ u_int32_t l;
+};
+union q_util {
+ u_int16_t s[4];
+ u_int32_t l[2];
+ u_int64_t q;
+};
+
+static u_int64_t
+in_cksumdata(const void *buf, int len)
+{
+ const u_int32_t *lw = (const u_int32_t *) buf;
+ u_int64_t sum = 0;
+ u_int64_t prefilled;
+ int offset;
+ union q_util q_util;
+
+ if ((3 & (long) lw) == 0 && len == 20) {
+ sum = (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3] + lw[4];
+ REDUCE32;
+ return sum;
+ }
+
+ if ((offset = 3 & (long) lw) != 0) {
+ const u_int32_t *masks = in_masks + (offset << 2);
+ lw = (u_int32_t *) (((long) lw) - offset);
+ sum = *lw++ & masks[len >= 3 ? 3 : len];
+ len -= 4 - offset;
+ if (len <= 0) {
+ REDUCE32;
+ return sum;
+ }
+ }
+#if 0
+ /*
+ * Force to cache line boundary.
+ */
+ offset = 32 - (0x1f & (long) lw);
+ if (offset < 32 && len > offset) {
+ len -= offset;
+ if (4 & offset) {
+ sum += (u_int64_t) lw[0];
+ lw += 1;
+ }
+ if (8 & offset) {
+ sum += (u_int64_t) lw[0] + lw[1];
+ lw += 2;
+ }
+ if (16 & offset) {
+ sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
+ lw += 4;
+ }
+ }
+#endif
+ /*
+ * access prefilling to start load of next cache line.
+ * then add current cache line
+ * save result of prefilling for loop iteration.
+ */
+ prefilled = lw[0];
+ while ((len -= 32) >= 4) {
+ u_int64_t prefilling = lw[8];
+ sum += prefilled + lw[1] + lw[2] + lw[3]
+ + lw[4] + lw[5] + lw[6] + lw[7];
+ lw += 8;
+ prefilled = prefilling;
+ }
+ if (len >= 0) {
+ sum += prefilled + lw[1] + lw[2] + lw[3]
+ + lw[4] + lw[5] + lw[6] + lw[7];
+ lw += 8;
+ } else {
+ len += 32;
+ }
+ while ((len -= 16) >= 0) {
+ sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
+ lw += 4;
+ }
+ len += 16;
+ while ((len -= 4) >= 0) {
+ sum += (u_int64_t) *lw++;
+ }
+ len += 4;
+ if (len > 0)
+ sum += (u_int64_t) (in_masks[len] & *lw);
+ REDUCE32;
+ return sum;
+}
+
+u_short
+in_addword(u_short a, u_short b)
+{
+ u_int64_t sum = a + b;
+
+ ADDCARRY(sum);
+ return (sum);
+}
+
+u_short
+#ifdef __rtems__
+/* Prototype does not match in FreeBSD code */
+in_pseudo(u_int a, u_int b, u_int c)
+#else
+in_pseudo(u_int32_t a, u_int32_t b, u_int32_t c)
+#endif
+{
+ u_int64_t sum;
+ union q_util q_util;
+ union l_util l_util;
+
+ sum = (u_int64_t) a + b + c;
+ REDUCE16;
+ return (sum);
+}
+
+u_short
+in_cksum_skip(struct mbuf *m, int len, int skip)
+{
+ u_int64_t sum = 0;
+ int mlen = 0;
+ int clen = 0;
+ caddr_t addr;
+ union q_util q_util;
+ union l_util l_util;
+
+ len -= skip;
+ for (; skip && m; m = m->m_next) {
+ if (m->m_len > skip) {
+ mlen = m->m_len - skip;
+ addr = mtod(m, caddr_t) + skip;
+ goto skip_start;
+ } else {
+ skip -= m->m_len;
+ }
+ }
+
+ for (; m && len; m = m->m_next) {
+ if (m->m_len == 0)
+ continue;
+ mlen = m->m_len;
+ addr = mtod(m, caddr_t);
+skip_start:
+ if (len < mlen)
+ mlen = len;
+
+ if ((clen ^ (uintptr_t) addr) & 1)
+ sum += in_cksumdata(addr, mlen) << 8;
+ else
+ sum += in_cksumdata(addr, mlen);
+
+ clen += mlen;
+ len -= mlen;
+ }
+ REDUCE16;
+ return (~sum & 0xffff);
+}
+
+u_int in_cksum_hdr(const struct ip *ip)
+{
+ u_int64_t sum = in_cksumdata(ip, sizeof(struct ip));
+ union q_util q_util;
+ union l_util l_util;
+ REDUCE16;
+ return (~sum & 0xffff);
+}
diff --git a/freebsd/sys/sh/sh/legacy.c b/freebsd/sys/sh/sh/legacy.c
new file mode 100644
index 00000000..2547990c
--- /dev/null
+++ b/freebsd/sys/sh/sh/legacy.c
@@ -0,0 +1,347 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright 1998 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby
+ * granted, provided that both the above copyright notice and this
+ * permission notice appear in all copies, that both the above
+ * copyright notice and this permission notice appear in all
+ * supporting documentation, and that the name of M.I.T. not be used
+ * in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission. M.I.T. makes
+ * no representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
+ * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
+ * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * This code implements a system driver for legacy systems that do not
+ * support ACPI or when ACPI support is not present in the kernel.
+ */
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <machine/bus.h>
+#include <sys/pcpu.h>
+#include <sys/rman.h>
+#include <sys/smp.h>
+
+#ifndef __rtems__
+#include <rtems/bsd/local/opt_mca.h>
+#endif /* __rtems__ */
+#ifdef DEV_MCA
+#include <i386/bios/mca_machdep.h>
+#endif
+
+#include <machine/legacyvar.h>
+#include <machine/resource.h>
+
+static MALLOC_DEFINE(M_LEGACYDEV, "legacydrv", "legacy system device");
+struct legacy_device {
+ int lg_pcibus;
+};
+
+#define DEVTOAT(dev) ((struct legacy_device *)device_get_ivars(dev))
+
+static int legacy_probe(device_t);
+static int legacy_attach(device_t);
+static int legacy_print_child(device_t, device_t);
+static device_t legacy_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static int legacy_read_ivar(device_t, device_t, int, uintptr_t *);
+static int legacy_write_ivar(device_t, device_t, int, uintptr_t);
+
+static device_method_t legacy_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, legacy_probe),
+ DEVMETHOD(device_attach, legacy_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, legacy_print_child),
+ DEVMETHOD(bus_add_child, legacy_add_child),
+ DEVMETHOD(bus_read_ivar, legacy_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_write_ivar),
+ DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t legacy_driver = {
+ "legacy",
+ legacy_methods,
+ 1, /* no softc */
+};
+static devclass_t legacy_devclass;
+
+DRIVER_MODULE(legacy, nexus, legacy_driver, legacy_devclass, 0, 0);
+
+static int
+legacy_probe(device_t dev)
+{
+
+ device_set_desc(dev, "legacy system");
+ device_quiet(dev);
+ return (0);
+}
+
+static int
+legacy_attach(device_t dev)
+{
+ device_t child;
+
+ /*
+ * Let our child drivers identify any child devices that they
+ * can find. Once that is done attach any devices that we
+ * found.
+ */
+ bus_generic_probe(dev);
+ bus_generic_attach(dev);
+
+#ifndef PC98
+ /*
+ * If we didn't see EISA or ISA on a pci bridge, create some
+ * connection points now so they show up "on motherboard".
+ */
+ if (!devclass_get_device(devclass_find("eisa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "eisa", 0);
+ if (child == NULL)
+ panic("legacy_attach eisa");
+ device_probe_and_attach(child);
+ }
+#endif
+#ifdef DEV_MCA
+ if (MCA_system && !devclass_get_device(devclass_find("mca"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "mca", 0);
+ if (child == 0)
+ panic("legacy_probe mca");
+ device_probe_and_attach(child);
+ }
+#endif
+ if (!devclass_get_device(devclass_find("isa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "isa", 0);
+ if (child == NULL)
+ panic("legacy_attach isa");
+ device_probe_and_attach(child);
+ }
+
+ return 0;
+}
+
+static int
+legacy_print_child(device_t bus, device_t child)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+ int retval = 0;
+
+ retval += bus_print_child_header(bus, child);
+ if (atdev->lg_pcibus != -1)
+ retval += printf(" pcibus %d", atdev->lg_pcibus);
+ retval += printf(" on motherboard\n"); /* XXX "motherboard", ick */
+
+ return (retval);
+}
+
+static device_t
+legacy_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ device_t child;
+ struct legacy_device *atdev;
+
+ atdev = malloc(sizeof(struct legacy_device), M_LEGACYDEV,
+ M_NOWAIT | M_ZERO);
+ if (atdev == NULL)
+ return(NULL);
+ atdev->lg_pcibus = -1;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child == NULL)
+ free(atdev, M_LEGACYDEV);
+ else
+ /* should we free this in legacy_child_detached? */
+ device_set_ivars(child, atdev);
+
+ return (child);
+}
+
+static int
+legacy_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ *result = 0;
+ break;
+ case LEGACY_IVAR_PCIBUS:
+ *result = atdev->lg_pcibus;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+
+static int
+legacy_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ return EINVAL;
+ case LEGACY_IVAR_PCIBUS:
+ atdev->lg_pcibus = value;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+/*
+ * Legacy CPU attachment when ACPI is not available. Drivers like
+ * cpufreq(4) hang off this.
+ */
+static void cpu_identify(driver_t *driver, device_t parent);
+static int cpu_read_ivar(device_t dev, device_t child, int index,
+ uintptr_t *result);
+static device_t cpu_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static struct resource_list *cpu_get_rlist(device_t dev, device_t child);
+
+struct cpu_device {
+ struct resource_list cd_rl;
+ struct pcpu *cd_pcpu;
+};
+
+static device_method_t cpu_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, cpu_identify),
+ DEVMETHOD(device_probe, bus_generic_probe),
+ DEVMETHOD(device_attach, bus_generic_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_add_child, cpu_add_child),
+ DEVMETHOD(bus_read_ivar, cpu_read_ivar),
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_get_resource_list, cpu_get_rlist),
+ DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
+ DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource),
+ DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource),
+ DEVMETHOD(bus_driver_added, bus_generic_driver_added),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t cpu_driver = {
+ "cpu",
+ cpu_methods,
+ 1, /* no softc */
+};
+static devclass_t cpu_devclass;
+DRIVER_MODULE(cpu, legacy, cpu_driver, cpu_devclass, 0, 0);
+
+static void
+cpu_identify(driver_t *driver, device_t parent)
+{
+ device_t child;
+ int i;
+
+ /*
+ * Attach a cpuX device for each CPU. We use an order of 150
+ * so that these devices are attached after the Host-PCI
+ * bridges (which are added at order 100).
+ */
+ for (i = 0; i <= mp_maxid; i++)
+ if (!CPU_ABSENT(i)) {
+ child = BUS_ADD_CHILD(parent, 150, "cpu", i);
+ if (child == NULL)
+ panic("legacy_attach cpu");
+ }
+}
+
+static device_t
+cpu_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ struct cpu_device *cd;
+ device_t child;
+ struct pcpu *pc;
+
+ if ((cd = malloc(sizeof(*cd), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL)
+ return (NULL);
+
+ resource_list_init(&cd->cd_rl);
+ pc = pcpu_find(device_get_unit(bus));
+ cd->cd_pcpu = pc;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child != NULL) {
+ pc->pc_device = child;
+ device_set_ivars(child, cd);
+ } else
+ free(cd, M_DEVBUF);
+ return (child);
+}
+
+static struct resource_list *
+cpu_get_rlist(device_t dev, device_t child)
+{
+ struct cpu_device *cpdev;
+
+ cpdev = device_get_ivars(child);
+ return (&cpdev->cd_rl);
+}
+
+static int
+cpu_read_ivar(device_t dev, device_t child, int index, uintptr_t *result)
+{
+ struct cpu_device *cpdev;
+
+ if (index != CPU_IVAR_PCPU)
+ return (ENOENT);
+ cpdev = device_get_ivars(child);
+ *result = (uintptr_t)cpdev->cd_pcpu;
+ return (0);
+}
diff --git a/freebsd/sys/socket.h b/freebsd/sys/socket.h
deleted file mode 100644
index a5a43db1..00000000
--- a/freebsd/sys/socket.h
+++ /dev/null
@@ -1,691 +0,0 @@
-/*-
- * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)socket.h 8.4 (Berkeley) 2/21/94
- * $FreeBSD$
- */
-
-#ifndef _SYS_SOCKET_HH_
-#define _SYS_SOCKET_HH_
-
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/_types.h>
-#include <freebsd/sys/_iovec.h>
-#define _NO_NAMESPACE_POLLUTION
-#include <freebsd/machine/param.h>
-#undef _NO_NAMESPACE_POLLUTION
-
-/*
- * Definitions related to sockets: types, address families, options.
- */
-
-/*
- * Data types.
- */
-#if __BSD_VISIBLE
-#ifndef _GID_T_DECLARED
-typedef __gid_t gid_t;
-#define _GID_T_DECLARED
-#endif
-
-#ifndef _OFF_T_DECLARED
-typedef __off_t off_t;
-#define _OFF_T_DECLARED
-#endif
-
-#ifndef _PID_T_DECLARED
-typedef __pid_t pid_t;
-#define _PID_T_DECLARED
-#endif
-#endif
-
-#ifndef _SA_FAMILY_T_DECLARED
-typedef __sa_family_t sa_family_t;
-#define _SA_FAMILY_T_DECLARED
-#endif
-
-#ifndef _SOCKLEN_T_DECLARED
-typedef __socklen_t socklen_t;
-#define _SOCKLEN_T_DECLARED
-#endif
-
-#ifndef _SSIZE_T_DECLARED
-typedef __ssize_t ssize_t;
-#define _SSIZE_T_DECLARED
-#endif
-
-#if __BSD_VISIBLE
-#ifndef _UID_T_DECLARED
-typedef __uid_t uid_t;
-#define _UID_T_DECLARED
-#endif
-#endif
-
-/*
- * Types
- */
-#define SOCK_STREAM 1 /* stream socket */
-#define SOCK_DGRAM 2 /* datagram socket */
-#define SOCK_RAW 3 /* raw-protocol interface */
-#if __BSD_VISIBLE
-#define SOCK_RDM 4 /* reliably-delivered message */
-#endif
-#define SOCK_SEQPACKET 5 /* sequenced packet stream */
-
-/*
- * Option flags per-socket.
- */
-#define SO_DEBUG 0x0001 /* turn on debugging info recording */
-#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
-#define SO_REUSEADDR 0x0004 /* allow local address reuse */
-#define SO_KEEPALIVE 0x0008 /* keep connections alive */
-#define SO_DONTROUTE 0x0010 /* just use interface addresses */
-#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
-#if __BSD_VISIBLE
-#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
-#endif
-#define SO_LINGER 0x0080 /* linger on close if data present */
-#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
-#if __BSD_VISIBLE
-#define SO_REUSEPORT 0x0200 /* allow local address & port reuse */
-#define SO_TIMESTAMP 0x0400 /* timestamp received dgram traffic */
-#define SO_NOSIGPIPE 0x0800 /* no SIGPIPE from EPIPE */
-#define SO_ACCEPTFILTER 0x1000 /* there is an accept filter */
-#define SO_BINTIME 0x2000 /* timestamp received dgram traffic */
-#endif
-#define SO_NO_OFFLOAD 0x4000 /* socket cannot be offloaded */
-#define SO_NO_DDP 0x8000 /* disable direct data placement */
-
-/*
- * Additional options, not kept in so_options.
- */
-#define SO_SNDBUF 0x1001 /* send buffer size */
-#define SO_RCVBUF 0x1002 /* receive buffer size */
-#define SO_SNDLOWAT 0x1003 /* send low-water mark */
-#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
-#define SO_SNDTIMEO 0x1005 /* send timeout */
-#define SO_RCVTIMEO 0x1006 /* receive timeout */
-#define SO_ERROR 0x1007 /* get error status and clear */
-#define SO_TYPE 0x1008 /* get socket type */
-#if __BSD_VISIBLE
-#define SO_LABEL 0x1009 /* socket's MAC label */
-#define SO_PEERLABEL 0x1010 /* socket's peer's MAC label */
-#define SO_LISTENQLIMIT 0x1011 /* socket's backlog limit */
-#define SO_LISTENQLEN 0x1012 /* socket's complete queue length */
-#define SO_LISTENINCQLEN 0x1013 /* socket's incomplete queue length */
-#define SO_SETFIB 0x1014 /* use this FIB to route */
-#endif
-
-/*
- * Structure used for manipulating linger option.
- */
-struct linger {
- int l_onoff; /* option on/off */
- int l_linger; /* linger time */
-};
-
-#if __BSD_VISIBLE
-struct accept_filter_arg {
- char af_name[16];
- char af_arg[256-16];
-};
-#endif
-
-/*
- * Level number for (get/set)sockopt() to apply to socket itself.
- */
-#define SOL_SOCKET 0xffff /* options for socket level */
-
-/*
- * Address families.
- */
-#define AF_UNSPEC 0 /* unspecified */
-#if __BSD_VISIBLE
-#define AF_LOCAL AF_UNIX /* local to host (pipes, portals) */
-#endif
-#define AF_UNIX 1 /* standardized name for AF_LOCAL */
-#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
-#if __BSD_VISIBLE
-#define AF_IMPLINK 3 /* arpanet imp addresses */
-#define AF_PUP 4 /* pup protocols: e.g. BSP */
-#define AF_CHAOS 5 /* mit CHAOS protocols */
-#define AF_NETBIOS 6 /* SMB protocols */
-#define AF_ISO 7 /* ISO protocols */
-#define AF_OSI AF_ISO
-#define AF_ECMA 8 /* European computer manufacturers */
-#define AF_DATAKIT 9 /* datakit protocols */
-#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
-#define AF_SNA 11 /* IBM SNA */
-#define AF_DECnet 12 /* DECnet */
-#define AF_DLI 13 /* DEC Direct data link interface */
-#define AF_LAT 14 /* LAT */
-#define AF_HYLINK 15 /* NSC Hyperchannel */
-#define AF_APPLETALK 16 /* Apple Talk */
-#define AF_ROUTE 17 /* Internal Routing Protocol */
-#define AF_LINK 18 /* Link layer interface */
-#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */
-#define AF_COIP 20 /* connection-oriented IP, aka ST II */
-#define AF_CNT 21 /* Computer Network Technology */
-#define pseudo_AF_RTIP 22 /* Help Identify RTIP packets */
-#define AF_IPX 23 /* Novell Internet Protocol */
-#define AF_SIP 24 /* Simple Internet Protocol */
-#define pseudo_AF_PIP 25 /* Help Identify PIP packets */
-#define AF_ISDN 26 /* Integrated Services Digital Network*/
-#define AF_E164 AF_ISDN /* CCITT E.164 recommendation */
-#define pseudo_AF_KEY 27 /* Internal key-management function */
-#endif
-#define AF_INET6 28 /* IPv6 */
-#if __BSD_VISIBLE
-#define AF_NATM 29 /* native ATM access */
-#define AF_ATM 30 /* ATM */
-#define pseudo_AF_HDRCMPLT 31 /* Used by BPF to not rewrite headers
- * in interface output routine
- */
-#define AF_NETGRAPH 32 /* Netgraph sockets */
-#define AF_SLOW 33 /* 802.3ad slow protocol */
-#define AF_SCLUSTER 34 /* Sitara cluster protocol */
-#define AF_ARP 35
-#define AF_BLUETOOTH 36 /* Bluetooth sockets */
-#define AF_IEEE80211 37 /* IEEE 802.11 protocol */
-#define AF_MAX 38
-/*
- * When allocating a new AF_ constant, please only allocate
- * even numbered constants for FreeBSD until 134 as odd numbered AF_
- * constants 39-133 are now reserved for vendors.
- */
-#define AF_VENDOR00 39
-#define AF_VENDOR01 41
-#define AF_VENDOR02 43
-#define AF_VENDOR03 45
-#define AF_VENDOR04 47
-#define AF_VENDOR05 49
-#define AF_VENDOR06 51
-#define AF_VENDOR07 53
-#define AF_VENDOR08 55
-#define AF_VENDOR09 57
-#define AF_VENDOR10 59
-#define AF_VENDOR11 61
-#define AF_VENDOR12 63
-#define AF_VENDOR13 65
-#define AF_VENDOR14 67
-#define AF_VENDOR15 69
-#define AF_VENDOR16 71
-#define AF_VENDOR17 73
-#define AF_VENDOR18 75
-#define AF_VENDOR19 77
-#define AF_VENDOR20 79
-#define AF_VENDOR21 81
-#define AF_VENDOR22 83
-#define AF_VENDOR23 85
-#define AF_VENDOR24 87
-#define AF_VENDOR25 89
-#define AF_VENDOR26 91
-#define AF_VENDOR27 93
-#define AF_VENDOR28 95
-#define AF_VENDOR29 97
-#define AF_VENDOR30 99
-#define AF_VENDOR31 101
-#define AF_VENDOR32 103
-#define AF_VENDOR33 105
-#define AF_VENDOR34 107
-#define AF_VENDOR35 109
-#define AF_VENDOR36 111
-#define AF_VENDOR37 113
-#define AF_VENDOR38 115
-#define AF_VENDOR39 117
-#define AF_VENDOR40 119
-#define AF_VENDOR41 121
-#define AF_VENDOR42 123
-#define AF_VENDOR43 125
-#define AF_VENDOR44 127
-#define AF_VENDOR45 129
-#define AF_VENDOR46 131
-#define AF_VENDOR47 133
-#endif
-
-/*
- * Structure used by kernel to store most
- * addresses.
- */
-struct sockaddr {
- unsigned char sa_len; /* total length */
- sa_family_t sa_family; /* address family */
- char sa_data[14]; /* actually longer; address value */
-};
-#if __BSD_VISIBLE
-#define SOCK_MAXADDRLEN 255 /* longest possible addresses */
-
-/*
- * Structure used by kernel to pass protocol
- * information in raw sockets.
- */
-struct sockproto {
- unsigned short sp_family; /* address family */
- unsigned short sp_protocol; /* protocol */
-};
-#endif
-
-#ifndef _STRUCT_SOCKADDR_STORAGE_DECLARED
-/*
- * RFC 2553: protocol-independent placeholder for socket addresses
- */
-#define _SS_MAXSIZE 128U
-#define _SS_ALIGNSIZE (sizeof(__int64_t))
-#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(unsigned char) - \
- sizeof(sa_family_t))
-#define _SS_PAD2SIZE (_SS_MAXSIZE - sizeof(unsigned char) - \
- sizeof(sa_family_t) - _SS_PAD1SIZE - _SS_ALIGNSIZE)
-
-struct sockaddr_storage {
- unsigned char ss_len; /* address length */
- sa_family_t ss_family; /* address family */
- char __ss_pad1[_SS_PAD1SIZE];
- __int64_t __ss_align; /* force desired struct alignment */
- char __ss_pad2[_SS_PAD2SIZE];
-};
-#define _STRUCT_SOCKADDR_STORAGE_DECLARED
-#endif
-
-#if __BSD_VISIBLE
-/*
- * Protocol families, same as address families for now.
- */
-#define PF_UNSPEC AF_UNSPEC
-#define PF_LOCAL AF_LOCAL
-#define PF_UNIX PF_LOCAL /* backward compatibility */
-#define PF_INET AF_INET
-#define PF_IMPLINK AF_IMPLINK
-#define PF_PUP AF_PUP
-#define PF_CHAOS AF_CHAOS
-#define PF_NETBIOS AF_NETBIOS
-#define PF_ISO AF_ISO
-#define PF_OSI AF_ISO
-#define PF_ECMA AF_ECMA
-#define PF_DATAKIT AF_DATAKIT
-#define PF_CCITT AF_CCITT
-#define PF_SNA AF_SNA
-#define PF_DECnet AF_DECnet
-#define PF_DLI AF_DLI
-#define PF_LAT AF_LAT
-#define PF_HYLINK AF_HYLINK
-#define PF_APPLETALK AF_APPLETALK
-#define PF_ROUTE AF_ROUTE
-#define PF_LINK AF_LINK
-#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */
-#define PF_COIP AF_COIP
-#define PF_CNT AF_CNT
-#define PF_SIP AF_SIP
-#define PF_IPX AF_IPX
-#define PF_RTIP pseudo_AF_RTIP /* same format as AF_INET */
-#define PF_PIP pseudo_AF_PIP
-#define PF_ISDN AF_ISDN
-#define PF_KEY pseudo_AF_KEY
-#define PF_INET6 AF_INET6
-#define PF_NATM AF_NATM
-#define PF_ATM AF_ATM
-#define PF_NETGRAPH AF_NETGRAPH
-#define PF_SLOW AF_SLOW
-#define PF_SCLUSTER AF_SCLUSTER
-#define PF_ARP AF_ARP
-#define PF_BLUETOOTH AF_BLUETOOTH
-
-#define PF_MAX AF_MAX
-
-/*
- * Definitions for network related sysctl, CTL_NET.
- *
- * Second level is protocol family.
- * Third level is protocol number.
- *
- * Further levels are defined by the individual families below.
- */
-#define NET_MAXID AF_MAX
-
-#define CTL_NET_NAMES { \
- { 0, 0 }, \
- { "unix", CTLTYPE_NODE }, \
- { "inet", CTLTYPE_NODE }, \
- { "implink", CTLTYPE_NODE }, \
- { "pup", CTLTYPE_NODE }, \
- { "chaos", CTLTYPE_NODE }, \
- { "xerox_ns", CTLTYPE_NODE }, \
- { "iso", CTLTYPE_NODE }, \
- { "emca", CTLTYPE_NODE }, \
- { "datakit", CTLTYPE_NODE }, \
- { "ccitt", CTLTYPE_NODE }, \
- { "ibm_sna", CTLTYPE_NODE }, \
- { "decnet", CTLTYPE_NODE }, \
- { "dec_dli", CTLTYPE_NODE }, \
- { "lat", CTLTYPE_NODE }, \
- { "hylink", CTLTYPE_NODE }, \
- { "appletalk", CTLTYPE_NODE }, \
- { "route", CTLTYPE_NODE }, \
- { "link_layer", CTLTYPE_NODE }, \
- { "xtp", CTLTYPE_NODE }, \
- { "coip", CTLTYPE_NODE }, \
- { "cnt", CTLTYPE_NODE }, \
- { "rtip", CTLTYPE_NODE }, \
- { "ipx", CTLTYPE_NODE }, \
- { "sip", CTLTYPE_NODE }, \
- { "pip", CTLTYPE_NODE }, \
- { "isdn", CTLTYPE_NODE }, \
- { "key", CTLTYPE_NODE }, \
- { "inet6", CTLTYPE_NODE }, \
- { "natm", CTLTYPE_NODE }, \
- { "atm", CTLTYPE_NODE }, \
- { "hdrcomplete", CTLTYPE_NODE }, \
- { "netgraph", CTLTYPE_NODE }, \
- { "snp", CTLTYPE_NODE }, \
- { "scp", CTLTYPE_NODE }, \
-}
-
-/*
- * PF_ROUTE - Routing table
- *
- * Three additional levels are defined:
- * Fourth: address family, 0 is wildcard
- * Fifth: type of info, defined below
- * Sixth: flag(s) to mask with for NET_RT_FLAGS
- */
-#define NET_RT_DUMP 1 /* dump; may limit to a.f. */
-#define NET_RT_FLAGS 2 /* by flags, e.g. RESOLVING */
-#define NET_RT_IFLIST 3 /* survey interface list */
-#define NET_RT_IFMALIST 4 /* return multicast address list */
-#define NET_RT_MAXID 5
-
-#define CTL_NET_RT_NAMES { \
- { 0, 0 }, \
- { "dump", CTLTYPE_STRUCT }, \
- { "flags", CTLTYPE_STRUCT }, \
- { "iflist", CTLTYPE_STRUCT }, \
- { "ifmalist", CTLTYPE_STRUCT }, \
-}
-#endif /* __BSD_VISIBLE */
-
-/*
- * Maximum queue length specifiable by listen.
- */
-#define SOMAXCONN 128
-
-/*
- * Message header for recvmsg and sendmsg calls.
- * Used value-result for recvmsg, value only for sendmsg.
- */
-struct msghdr {
- void *msg_name; /* optional address */
- socklen_t msg_namelen; /* size of address */
- struct iovec *msg_iov; /* scatter/gather array */
- int msg_iovlen; /* # elements in msg_iov */
- void *msg_control; /* ancillary data, see below */
- socklen_t msg_controllen; /* ancillary data buffer len */
- int msg_flags; /* flags on received message */
-};
-
-#define MSG_OOB 0x1 /* process out-of-band data */
-#define MSG_PEEK 0x2 /* peek at incoming message */
-#define MSG_DONTROUTE 0x4 /* send without using routing tables */
-#define MSG_EOR 0x8 /* data completes record */
-#define MSG_TRUNC 0x10 /* data discarded before delivery */
-#define MSG_CTRUNC 0x20 /* control data lost before delivery */
-#define MSG_WAITALL 0x40 /* wait for full request or error */
-#define MSG_NOTIFICATION 0x2000 /* SCTP notification */
-#if __BSD_VISIBLE
-#define MSG_DONTWAIT 0x80 /* this message should be nonblocking */
-#define MSG_EOF 0x100 /* data completes connection */
-#define MSG_NBIO 0x4000 /* FIONBIO mode, used by fifofs */
-#define MSG_COMPAT 0x8000 /* used in sendit() */
-#endif
-#ifdef _KERNEL
-#define MSG_SOCALLBCK 0x10000 /* for use by socket callbacks - soreceive (TCP) */
-#endif
-#if __BSD_VISIBLE
-#define MSG_NOSIGNAL 0x20000 /* do not generate SIGPIPE on EOF */
-#endif
-
-/*
- * Header for ancillary data objects in msg_control buffer.
- * Used for additional information with/about a datagram
- * not expressible by flags. The format is a sequence
- * of message elements headed by cmsghdr structures.
- */
-struct cmsghdr {
- socklen_t cmsg_len; /* data byte count, including hdr */
- int cmsg_level; /* originating protocol */
- int cmsg_type; /* protocol-specific type */
-/* followed by u_char cmsg_data[]; */
-};
-
-#if __BSD_VISIBLE
-/*
- * While we may have more groups than this, the cmsgcred struct must
- * be able to fit in an mbuf and we have historically supported a
- * maximum of 16 groups.
-*/
-#define CMGROUP_MAX 16
-
-/*
- * Credentials structure, used to verify the identity of a peer
- * process that has sent us a message. This is allocated by the
- * peer process but filled in by the kernel. This prevents the
- * peer from lying about its identity. (Note that cmcred_groups[0]
- * is the effective GID.)
- */
-struct cmsgcred {
- pid_t cmcred_pid; /* PID of sending process */
- uid_t cmcred_uid; /* real UID of sending process */
- uid_t cmcred_euid; /* effective UID of sending process */
- gid_t cmcred_gid; /* real GID of sending process */
- short cmcred_ngroups; /* number or groups */
- gid_t cmcred_groups[CMGROUP_MAX]; /* groups */
-};
-
-/*
- * Socket credentials.
- */
-struct sockcred {
- uid_t sc_uid; /* real user id */
- uid_t sc_euid; /* effective user id */
- gid_t sc_gid; /* real group id */
- gid_t sc_egid; /* effective group id */
- int sc_ngroups; /* number of supplemental groups */
- gid_t sc_groups[1]; /* variable length */
-};
-
-/*
- * Compute size of a sockcred structure with groups.
- */
-#define SOCKCREDSIZE(ngrps) \
- (sizeof(struct sockcred) + (sizeof(gid_t) * ((ngrps) - 1)))
-
-#endif /* __BSD_VISIBLE */
-
-/* given pointer to struct cmsghdr, return pointer to data */
-#define CMSG_DATA(cmsg) ((unsigned char *)(cmsg) + \
- _ALIGN(sizeof(struct cmsghdr)))
-
-/* given pointer to struct cmsghdr, return pointer to next cmsghdr */
-#define CMSG_NXTHDR(mhdr, cmsg) \
- ((char *)(cmsg) == NULL ? CMSG_FIRSTHDR(mhdr) : \
- ((char *)(cmsg) + _ALIGN(((struct cmsghdr *)(cmsg))->cmsg_len) + \
- _ALIGN(sizeof(struct cmsghdr)) > \
- (char *)(mhdr)->msg_control + (mhdr)->msg_controllen) ? \
- (struct cmsghdr *)0 : \
- (struct cmsghdr *)((char *)(cmsg) + \
- _ALIGN(((struct cmsghdr *)(cmsg))->cmsg_len)))
-
-/*
- * RFC 2292 requires to check msg_controllen, in case that the kernel returns
- * an empty list for some reasons.
- */
-#define CMSG_FIRSTHDR(mhdr) \
- ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
- (struct cmsghdr *)(mhdr)->msg_control : \
- (struct cmsghdr *)NULL)
-
-#if __BSD_VISIBLE
-/* RFC 2292 additions */
-#define CMSG_SPACE(l) (_ALIGN(sizeof(struct cmsghdr)) + _ALIGN(l))
-#define CMSG_LEN(l) (_ALIGN(sizeof(struct cmsghdr)) + (l))
-#endif
-
-#ifdef _KERNEL
-#define CMSG_ALIGN(n) _ALIGN(n)
-#endif
-
-/* "Socket"-level control message types: */
-#define SCM_RIGHTS 0x01 /* access rights (array of int) */
-#if __BSD_VISIBLE
-#define SCM_TIMESTAMP 0x02 /* timestamp (struct timeval) */
-#define SCM_CREDS 0x03 /* process creds (struct cmsgcred) */
-#define SCM_BINTIME 0x04 /* timestamp (struct bintime) */
-#endif
-
-#if __BSD_VISIBLE
-/*
- * 4.3 compat sockaddr, move to compat file later
- */
-struct osockaddr {
- unsigned short sa_family; /* address family */
- char sa_data[14]; /* up to 14 bytes of direct address */
-};
-
-/*
- * 4.3-compat message header (move to compat file later).
- */
-struct omsghdr {
- char *msg_name; /* optional address */
- int msg_namelen; /* size of address */
- struct iovec *msg_iov; /* scatter/gather array */
- int msg_iovlen; /* # elements in msg_iov */
- char *msg_accrights; /* access rights sent/received */
- int msg_accrightslen;
-};
-#endif
-
-/*
- * howto arguments for shutdown(2), specified by Posix.1g.
- */
-#define SHUT_RD 0 /* shut down the reading side */
-#define SHUT_WR 1 /* shut down the writing side */
-#define SHUT_RDWR 2 /* shut down both sides */
-
-/* we cheat and use the SHUT_XX defines for these */
-#define PRU_FLUSH_RD SHUT_RD
-#define PRU_FLUSH_WR SHUT_WR
-#define PRU_FLUSH_RDWR SHUT_RDWR
-
-
-#if __BSD_VISIBLE
-/*
- * sendfile(2) header/trailer struct
- */
-struct sf_hdtr {
- struct iovec *headers; /* pointer to an array of header struct iovec's */
- int hdr_cnt; /* number of header iovec's */
- struct iovec *trailers; /* pointer to an array of trailer struct iovec's */
- int trl_cnt; /* number of trailer iovec's */
-};
-
-/*
- * Sendfile-specific flag(s)
- */
-#define SF_NODISKIO 0x00000001
-#define SF_MNOWAIT 0x00000002
-#define SF_SYNC 0x00000004
-#endif
-
-#ifndef _KERNEL
-
-#include <freebsd/sys/cdefs.h>
-
-__BEGIN_DECLS
-int accept(int, struct sockaddr * __restrict, socklen_t * __restrict);
-int bind(int, const struct sockaddr *, socklen_t);
-int connect(int, const struct sockaddr *, socklen_t);
-int getpeername(int, struct sockaddr * __restrict, socklen_t * __restrict);
-int getsockname(int, struct sockaddr * __restrict, socklen_t * __restrict);
-int getsockopt(int, int, int, void * __restrict, socklen_t * __restrict);
-int listen(int, int);
-ssize_t recv(int, void *, size_t, int);
-ssize_t recvfrom(int, void *, size_t, int, struct sockaddr * __restrict, socklen_t * __restrict);
-ssize_t recvmsg(int, struct msghdr *, int);
-ssize_t send(int, const void *, size_t, int);
-ssize_t sendto(int, const void *,
- size_t, int, const struct sockaddr *, socklen_t);
-ssize_t sendmsg(int, const struct msghdr *, int);
-#if __BSD_VISIBLE
-int sendfile(int, int, off_t, size_t, struct sf_hdtr *, off_t *, int);
-int setfib(int);
-#endif
-int setsockopt(int, int, int, const void *, socklen_t);
-int shutdown(int, int);
-int sockatmark(int);
-int socket(int, int, int);
-int socketpair(int, int, int, int *);
-__END_DECLS
-
-#endif /* !_KERNEL */
-
-#ifdef _KERNEL
-struct socket;
-
-struct tcpcb *so_sototcpcb(struct socket *so);
-struct inpcb *so_sotoinpcb(struct socket *so);
-struct sockbuf *so_sockbuf_snd(struct socket *);
-struct sockbuf *so_sockbuf_rcv(struct socket *);
-
-int so_state_get(const struct socket *);
-void so_state_set(struct socket *, int);
-
-int so_options_get(const struct socket *);
-void so_options_set(struct socket *, int);
-
-int so_error_get(const struct socket *);
-void so_error_set(struct socket *, int);
-
-int so_linger_get(const struct socket *);
-void so_linger_set(struct socket *, int);
-
-struct protosw *so_protosw_get(const struct socket *);
-void so_protosw_set(struct socket *, struct protosw *);
-
-void so_sorwakeup_locked(struct socket *so);
-void so_sowwakeup_locked(struct socket *so);
-
-void so_sorwakeup(struct socket *so);
-void so_sowwakeup(struct socket *so);
-
-void so_lock(struct socket *so);
-void so_unlock(struct socket *so);
-
-void so_listeners_apply_all(struct socket *so, void (*func)(struct socket *, void *), void *arg);
-
-#endif
-
-
-#endif /* !_SYS_SOCKET_HH_ */
diff --git a/freebsd/sys/socketvar.h b/freebsd/sys/socketvar.h
deleted file mode 100644
index 6eeec9b6..00000000
--- a/freebsd/sys/socketvar.h
+++ /dev/null
@@ -1,393 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)socketvar.h 8.3 (Berkeley) 2/19/95
- *
- * $FreeBSD$
- */
-
-#ifndef _SYS_SOCKETVAR_HH_
-#define _SYS_SOCKETVAR_HH_
-
-#include <freebsd/sys/queue.h> /* for TAILQ macros */
-#include <freebsd/sys/selinfo.h> /* for struct selinfo */
-#include <freebsd/sys/_lock.h>
-#include <freebsd/sys/_mutex.h>
-#include <freebsd/sys/_sx.h>
-#include <freebsd/sys/sockbuf.h>
-#include <freebsd/sys/sockstate.h>
-#ifdef _KERNEL
-#include <freebsd/sys/sockopt.h>
-#endif
-
-struct vnet;
-
-/*
- * Kernel structure per socket.
- * Contains send and receive buffer queues,
- * handle on protocol and pointer to protocol
- * private data and error information.
- */
-typedef u_quad_t so_gen_t;
-
-struct socket;
-
-/*-
- * Locking key to struct socket:
- * (a) constant after allocation, no locking required.
- * (b) locked by SOCK_LOCK(so).
- * (c) locked by SOCKBUF_LOCK(&so->so_rcv).
- * (d) locked by SOCKBUF_LOCK(&so->so_snd).
- * (e) locked by ACCEPT_LOCK().
- * (f) not locked since integer reads/writes are atomic.
- * (g) used only as a sleep/wakeup address, no value.
- * (h) locked by global mutex so_global_mtx.
- */
-struct socket {
- int so_count; /* (b) reference count */
- short so_type; /* (a) generic type, see socket.h */
- short so_options; /* from socket call, see socket.h */
- short so_linger; /* time to linger while closing */
- short so_state; /* (b) internal state flags SS_* */
- int so_qstate; /* (e) internal state flags SQ_* */
- void *so_pcb; /* protocol control block */
- struct vnet *so_vnet; /* network stack instance */
- struct protosw *so_proto; /* (a) protocol handle */
-/*
- * Variables for connection queuing.
- * Socket where accepts occur is so_head in all subsidiary sockets.
- * If so_head is 0, socket is not related to an accept.
- * For head socket so_incomp queues partially completed connections,
- * while so_comp is a queue of connections ready to be accepted.
- * If a connection is aborted and it has so_head set, then
- * it has to be pulled out of either so_incomp or so_comp.
- * We allow connections to queue up based on current queue lengths
- * and limit on number of queued connections for this socket.
- */
- struct socket *so_head; /* (e) back pointer to listen socket */
- TAILQ_HEAD(, socket) so_incomp; /* (e) queue of partial unaccepted connections */
- TAILQ_HEAD(, socket) so_comp; /* (e) queue of complete unaccepted connections */
- TAILQ_ENTRY(socket) so_list; /* (e) list of unaccepted connections */
- u_short so_qlen; /* (e) number of unaccepted connections */
- u_short so_incqlen; /* (e) number of unaccepted incomplete
- connections */
- u_short so_qlimit; /* (e) max number queued connections */
- short so_timeo; /* (g) connection timeout */
- u_short so_error; /* (f) error affecting connection */
- struct sigio *so_sigio; /* [sg] information for async I/O or
- out of band data (SIGURG) */
- u_long so_oobmark; /* (c) chars to oob mark */
- TAILQ_HEAD(, aiocblist) so_aiojobq; /* AIO ops waiting on socket */
-
- struct sockbuf so_rcv, so_snd;
-
- struct ucred *so_cred; /* (a) user credentials */
- struct label *so_label; /* (b) MAC label for socket */
- struct label *so_peerlabel; /* (b) cached MAC label for peer */
- /* NB: generation count must not be first. */
- so_gen_t so_gencnt; /* (h) generation count */
- void *so_emuldata; /* (b) private data for emulators */
- struct so_accf {
- struct accept_filter *so_accept_filter;
- void *so_accept_filter_arg; /* saved filter args */
- char *so_accept_filter_str; /* saved user args */
- } *so_accf;
- int so_fibnum; /* routing domain for this socket */
-};
-
-/*
- * Global accept mutex to serialize access to accept queues and
- * fields associated with multiple sockets. This allows us to
- * avoid defining a lock order between listen and accept sockets
- * until such time as it proves to be a good idea.
- */
-extern struct mtx accept_mtx;
-#define ACCEPT_LOCK_ASSERT() mtx_assert(&accept_mtx, MA_OWNED)
-#define ACCEPT_UNLOCK_ASSERT() mtx_assert(&accept_mtx, MA_NOTOWNED)
-#define ACCEPT_LOCK() mtx_lock(&accept_mtx)
-#define ACCEPT_UNLOCK() mtx_unlock(&accept_mtx)
-
-/*
- * Per-socket mutex: we reuse the receive socket buffer mutex for space
- * efficiency. This decision should probably be revisited as we optimize
- * locking for the socket code.
- */
-#define SOCK_MTX(_so) SOCKBUF_MTX(&(_so)->so_rcv)
-#define SOCK_LOCK(_so) SOCKBUF_LOCK(&(_so)->so_rcv)
-#define SOCK_OWNED(_so) SOCKBUF_OWNED(&(_so)->so_rcv)
-#define SOCK_UNLOCK(_so) SOCKBUF_UNLOCK(&(_so)->so_rcv)
-#define SOCK_LOCK_ASSERT(_so) SOCKBUF_LOCK_ASSERT(&(_so)->so_rcv)
-
-/*
- * Socket state bits stored in so_qstate.
- */
-#define SQ_INCOMP 0x0800 /* unaccepted, incomplete connection */
-#define SQ_COMP 0x1000 /* unaccepted, complete connection */
-
-/*
- * Externalized form of struct socket used by the sysctl(3) interface.
- */
-struct xsocket {
- size_t xso_len; /* length of this structure */
- struct socket *xso_so; /* makes a convenient handle sometimes */
- short so_type;
- short so_options;
- short so_linger;
- short so_state;
- caddr_t so_pcb; /* another convenient handle */
- int xso_protocol;
- int xso_family;
- u_short so_qlen;
- u_short so_incqlen;
- u_short so_qlimit;
- short so_timeo;
- u_short so_error;
- pid_t so_pgid;
- u_long so_oobmark;
- struct xsockbuf so_rcv, so_snd;
- uid_t so_uid; /* XXX */
-};
-
-#ifdef _KERNEL
-
-/*
- * Macros for sockets and socket buffering.
- */
-
-/*
- * Flags to sblock().
- */
-#define SBL_WAIT 0x00000001 /* Wait if not immediately available. */
-#define SBL_NOINTR 0x00000002 /* Force non-interruptible sleep. */
-#define SBL_VALID (SBL_WAIT | SBL_NOINTR)
-
-/*
- * Do we need to notify the other side when I/O is possible?
- */
-#define sb_notify(sb) (((sb)->sb_flags & (SB_WAIT | SB_SEL | SB_ASYNC | \
- SB_UPCALL | SB_AIO | SB_KNOTE)) != 0)
-
-/* do we have to send all at once on a socket? */
-#define sosendallatonce(so) \
- ((so)->so_proto->pr_flags & PR_ATOMIC)
-
-/* can we read something from so? */
-#define soreadabledata(so) \
- ((so)->so_rcv.sb_cc >= (so)->so_rcv.sb_lowat || \
- !TAILQ_EMPTY(&(so)->so_comp) || (so)->so_error)
-#define soreadable(so) \
- (soreadabledata(so) || ((so)->so_rcv.sb_state & SBS_CANTRCVMORE))
-
-/* can we write something to so? */
-#define sowriteable(so) \
- ((sbspace(&(so)->so_snd) >= (so)->so_snd.sb_lowat && \
- (((so)->so_state&SS_ISCONNECTED) || \
- ((so)->so_proto->pr_flags&PR_CONNREQUIRED)==0)) || \
- ((so)->so_snd.sb_state & SBS_CANTSENDMORE) || \
- (so)->so_error)
-
-/*
- * soref()/sorele() ref-count the socket structure. Note that you must
- * still explicitly close the socket, but the last ref count will free
- * the structure.
- */
-#define soref(so) do { \
- SOCK_LOCK_ASSERT(so); \
- ++(so)->so_count; \
-} while (0)
-
-#define sorele(so) do { \
- ACCEPT_LOCK_ASSERT(); \
- SOCK_LOCK_ASSERT(so); \
- if ((so)->so_count <= 0) \
- panic("sorele"); \
- if (--(so)->so_count == 0) \
- sofree(so); \
- else { \
- SOCK_UNLOCK(so); \
- ACCEPT_UNLOCK(); \
- } \
-} while (0)
-
-#define sotryfree(so) do { \
- ACCEPT_LOCK_ASSERT(); \
- SOCK_LOCK_ASSERT(so); \
- if ((so)->so_count == 0) \
- sofree(so); \
- else { \
- SOCK_UNLOCK(so); \
- ACCEPT_UNLOCK(); \
- } \
-} while(0)
-
-/*
- * In sorwakeup() and sowwakeup(), acquire the socket buffer lock to
- * avoid a non-atomic test-and-wakeup. However, sowakeup is
- * responsible for releasing the lock if it is called. We unlock only
- * if we don't call into sowakeup. If any code is introduced that
- * directly invokes the underlying sowakeup() primitives, it must
- * maintain the same semantics.
- */
-#define sorwakeup_locked(so) do { \
- SOCKBUF_LOCK_ASSERT(&(so)->so_rcv); \
- if (sb_notify(&(so)->so_rcv)) \
- sowakeup((so), &(so)->so_rcv); \
- else \
- SOCKBUF_UNLOCK(&(so)->so_rcv); \
-} while (0)
-
-#define sorwakeup(so) do { \
- SOCKBUF_LOCK(&(so)->so_rcv); \
- sorwakeup_locked(so); \
-} while (0)
-
-#define sowwakeup_locked(so) do { \
- SOCKBUF_LOCK_ASSERT(&(so)->so_snd); \
- if (sb_notify(&(so)->so_snd)) \
- sowakeup((so), &(so)->so_snd); \
- else \
- SOCKBUF_UNLOCK(&(so)->so_snd); \
-} while (0)
-
-#define sowwakeup(so) do { \
- SOCKBUF_LOCK(&(so)->so_snd); \
- sowwakeup_locked(so); \
-} while (0)
-
-struct accept_filter {
- char accf_name[16];
- int (*accf_callback)
- (struct socket *so, void *arg, int waitflag);
- void * (*accf_create)
- (struct socket *so, char *arg);
- void (*accf_destroy)
- (struct socket *so);
- SLIST_ENTRY(accept_filter) accf_next;
-};
-
-#ifdef MALLOC_DECLARE
-MALLOC_DECLARE(M_ACCF);
-MALLOC_DECLARE(M_PCB);
-MALLOC_DECLARE(M_SONAME);
-#endif
-
-extern int maxsockets;
-extern u_long sb_max;
-extern struct uma_zone *socket_zone;
-extern so_gen_t so_gencnt;
-
-struct mbuf;
-struct sockaddr;
-struct ucred;
-struct uio;
-
-/* 'which' values for socket upcalls. */
-#define SO_RCV 1
-#define SO_SND 2
-
-/* Return values for socket upcalls. */
-#define SU_OK 0
-#define SU_ISCONNECTED 1
-
-/*
- * From uipc_socket and friends
- */
-int sockargs(struct mbuf **mp, caddr_t buf, int buflen, int type);
-int getsockaddr(struct sockaddr **namp, caddr_t uaddr, size_t len);
-void soabort(struct socket *so);
-int soaccept(struct socket *so, struct sockaddr **nam);
-int socheckuid(struct socket *so, uid_t uid);
-int sobind(struct socket *so, struct sockaddr *nam, struct thread *td);
-int soclose(struct socket *so);
-int soconnect(struct socket *so, struct sockaddr *nam, struct thread *td);
-int soconnect2(struct socket *so1, struct socket *so2);
-int socow_setup(struct mbuf *m0, struct uio *uio);
-int socreate(int dom, struct socket **aso, int type, int proto,
- struct ucred *cred, struct thread *td);
-int sodisconnect(struct socket *so);
-struct sockaddr *sodupsockaddr(const struct sockaddr *sa, int mflags);
-void sofree(struct socket *so);
-void sohasoutofband(struct socket *so);
-int solisten(struct socket *so, int backlog, struct thread *td);
-void solisten_proto(struct socket *so, int backlog);
-int solisten_proto_check(struct socket *so);
-struct socket *
- sonewconn(struct socket *head, int connstatus);
-
-
-int sopoll(struct socket *so, int events, struct ucred *active_cred,
- struct thread *td);
-int sopoll_generic(struct socket *so, int events,
- struct ucred *active_cred, struct thread *td);
-int soreceive(struct socket *so, struct sockaddr **paddr, struct uio *uio,
- struct mbuf **mp0, struct mbuf **controlp, int *flagsp);
-int soreceive_stream(struct socket *so, struct sockaddr **paddr,
- struct uio *uio, struct mbuf **mp0, struct mbuf **controlp,
- int *flagsp);
-int soreceive_dgram(struct socket *so, struct sockaddr **paddr,
- struct uio *uio, struct mbuf **mp0, struct mbuf **controlp,
- int *flagsp);
-int soreceive_generic(struct socket *so, struct sockaddr **paddr,
- struct uio *uio, struct mbuf **mp0, struct mbuf **controlp,
- int *flagsp);
-int soreserve(struct socket *so, u_long sndcc, u_long rcvcc);
-void sorflush(struct socket *so);
-int sosend(struct socket *so, struct sockaddr *addr, struct uio *uio,
- struct mbuf *top, struct mbuf *control, int flags,
- struct thread *td);
-int sosend_dgram(struct socket *so, struct sockaddr *addr,
- struct uio *uio, struct mbuf *top, struct mbuf *control,
- int flags, struct thread *td);
-int sosend_generic(struct socket *so, struct sockaddr *addr,
- struct uio *uio, struct mbuf *top, struct mbuf *control,
- int flags, struct thread *td);
-int soshutdown(struct socket *so, int how);
-void sotoxsocket(struct socket *so, struct xsocket *xso);
-void soupcall_clear(struct socket *so, int which);
-void soupcall_set(struct socket *so, int which,
- int (*func)(struct socket *, void *, int), void *arg);
-void sowakeup(struct socket *so, struct sockbuf *sb);
-int selsocket(struct socket *so, int events, struct timeval *tv,
- struct thread *td);
-
-/*
- * Accept filter functions (duh).
- */
-int accept_filt_add(struct accept_filter *filt);
-int accept_filt_del(char *name);
-struct accept_filter *accept_filt_get(char *name);
-#ifdef ACCEPT_FILTER_MOD
-#ifdef SYSCTL_DECL
-SYSCTL_DECL(_net_inet_accf);
-#endif
-int accept_filt_generic_mod_event(module_t mod, int event, void *data);
-#endif
-
-#endif /* _KERNEL */
-
-#endif /* !_SYS_SOCKETVAR_HH_ */
diff --git a/freebsd/sys/sparc/include/machine/in_cksum.h b/freebsd/sys/sparc/include/machine/in_cksum.h
new file mode 100644
index 00000000..37d88e2e
--- /dev/null
+++ b/freebsd/sys/sparc/include/machine/in_cksum.h
@@ -0,0 +1,77 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from tahoe: in_cksum.c 1.2 86/01/05
+ * from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91
+ * from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp
+ * from: src/sys/alpha/include/in_cksum.h,v 1.7 2005/03/02 21:33:20 joerg
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_IN_CKSUM_H_
+#define _MACHINE_IN_CKSUM_H_ 1
+
+#include <sys/cdefs.h>
+
+#define in_cksum(m, len) in_cksum_skip(m, len, 0)
+
+/*
+ * It it useful to have an Internet checksum routine which is inlineable
+ * and optimized specifically for the task of computing IP header checksums
+ * in the normal case (where there are no options and the header length is
+ * therefore always exactly five 32-bit words.
+ */
+#ifdef __CC_SUPPORTS___INLINE
+
+static __inline void
+in_cksum_update(struct ip *ip)
+{
+ int __tmpsum;
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256;
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16));
+}
+
+#else
+
+#define in_cksum_update(ip) \
+ do { \
+ int __tmpsum; \
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256; \
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \
+ } while(0)
+
+#endif
+
+#ifdef _KERNEL
+u_int in_cksum_hdr(const struct ip *ip);
+u_short in_addword(u_short sum, u_short b);
+u_short in_pseudo(u_int sum, u_int b, u_int c);
+u_short in_cksum_skip(struct mbuf *m, int len, int skip);
+#endif
+
+#endif /* _MACHINE_IN_CKSUM_H_ */
diff --git a/freebsd/sys/sparc/include/machine/legacyvar.h b/freebsd/sys/sparc/include/machine/legacyvar.h
new file mode 100644
index 00000000..0b0fa433
--- /dev/null
+++ b/freebsd/sys/sparc/include/machine/legacyvar.h
@@ -0,0 +1,57 @@
+/*-
+ * Copyright (c) 2000 Peter Wemm <peter@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_LEGACYVAR_H_
+#define _MACHINE_LEGACYVAR_H_
+
+enum legacy_device_ivars {
+ LEGACY_IVAR_PCIDOMAIN,
+ LEGACY_IVAR_PCIBUS
+};
+
+#define LEGACY_ACCESSOR(var, ivar, type) \
+ __BUS_ACCESSOR(legacy, var, LEGACY, ivar, type)
+
+LEGACY_ACCESSOR(pcidomain, PCIDOMAIN, uint32_t)
+LEGACY_ACCESSOR(pcibus, PCIBUS, uint32_t)
+
+#undef LEGACY_ACCESSOR
+
+int legacy_pcib_maxslots(device_t dev);
+uint32_t legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes);
+int legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result);
+void legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes);
+int legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value);
+struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child,
+ int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
+
+#endif /* !_MACHINE_LEGACYVAR_H_ */
diff --git a/freebsd/sys/sparc/include/machine/pci_cfgreg.h b/freebsd/sys/sparc/include/machine/pci_cfgreg.h
new file mode 100644
index 00000000..bc72418d
--- /dev/null
+++ b/freebsd/sys/sparc/include/machine/pci_cfgreg.h
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
+ */
+
+#define CONF1_ADDR_PORT 0x0cf8
+#define CONF1_DATA_PORT 0x0cfc
+
+#define CONF1_ENABLE 0x80000000ul
+#define CONF1_ENABLE_CHK 0x80000000ul
+#define CONF1_ENABLE_MSK 0x7f000000ul
+#define CONF1_ENABLE_CHK1 0xff000001ul
+#define CONF1_ENABLE_MSK1 0x80000001ul
+#define CONF1_ENABLE_RES1 0x80000000ul
+
+#define CONF2_ENABLE_PORT 0x0cf8
+#define CONF2_FORWARD_PORT 0x0cfa
+
+#define CONF2_ENABLE_CHK 0x0e
+#define CONF2_ENABLE_RES 0x0e
+
+int pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus);
+int pci_cfgregopen(void);
+u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes);
+void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes);
+void pci_pir_open(void);
+int pci_pir_probe(int bus, int require_parse);
+int pci_pir_route_interrupt(int bus, int device, int func, int pin);
diff --git a/freebsd/sys/sparc/pci/pci_bus.c b/freebsd/sys/sparc/pci/pci_bus.c
new file mode 100644
index 00000000..6627db98
--- /dev/null
+++ b/freebsd/sys/sparc/pci/pci_bus.c
@@ -0,0 +1,729 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/local/opt_cpu.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
+
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcib_private.h>
+#include <isa/isavar.h>
+#ifdef CPU_ELAN
+#include <machine/md_var.h>
+#endif
+#include <machine/legacyvar.h>
+#include <machine/pci_cfgreg.h>
+#include <machine/resource.h>
+
+#include <rtems/bsd/local/pcib_if.h>
+
+#ifndef __rtems__
+static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev,
+ int pin);
+#else /* __rtems__ */
+int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin);
+#endif /* __rtems__ */
+
+
+int
+legacy_pcib_maxslots(device_t dev)
+{
+ return 31;
+}
+
+/* read configuration space register */
+
+#ifdef __rtems__
+uint32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#else
+u_int32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#endif
+{
+ return(pci_cfgregread(bus, slot, func, reg, bytes));
+}
+
+/* write configuration space register */
+
+void
+legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes)
+{
+ pci_cfgregwrite(bus, slot, func, reg, data, bytes);
+}
+
+/* Pass MSI requests up to the nexus. */
+
+static int
+legacy_pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount,
+ int *irqs)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSI(device_get_parent(bus), dev, count, maxcount,
+ irqs));
+}
+
+static int
+legacy_pcib_alloc_msix(device_t pcib, device_t dev, int *irq)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq));
+}
+
+static int
+legacy_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr,
+ uint32_t *data)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data));
+}
+
+static const char *
+legacy_pcib_is_host_bridge(int bus, int slot, int func,
+ uint32_t id, uint8_t class, uint8_t subclass,
+ uint8_t *busnum)
+{
+ const char *s = NULL;
+ static uint8_t pxb[4]; /* hack for 450nx */
+
+ *busnum = 0;
+
+ switch (id) {
+ case 0x12258086:
+ s = "Intel 824?? host to PCI bridge";
+ /* XXX This is a guess */
+ /* *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x41, 1); */
+ *busnum = bus;
+ break;
+ case 0x71208086:
+ s = "Intel 82810 (i810 GMCH) Host To Hub bridge";
+ break;
+ case 0x71228086:
+ s = "Intel 82810-DC100 (i810-DC100 GMCH) Host To Hub bridge";
+ break;
+ case 0x71248086:
+ s = "Intel 82810E (i810E GMCH) Host To Hub bridge";
+ break;
+ case 0x11308086:
+ s = "Intel 82815 (i815 GMCH) Host To Hub bridge";
+ break;
+ case 0x71808086:
+ s = "Intel 82443LX (440 LX) host to PCI bridge";
+ break;
+ case 0x71908086:
+ s = "Intel 82443BX (440 BX) host to PCI bridge";
+ break;
+ case 0x71928086:
+ s = "Intel 82443BX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x71948086:
+ s = "Intel 82443MX host to PCI bridge";
+ break;
+ case 0x71a08086:
+ s = "Intel 82443GX host to PCI bridge";
+ break;
+ case 0x71a18086:
+ s = "Intel 82443GX host to AGP bridge";
+ break;
+ case 0x71a28086:
+ s = "Intel 82443GX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x84c48086:
+ s = "Intel 82454KX/GX (Orion) host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x4a, 1);
+ break;
+ case 0x84ca8086:
+ /*
+ * For the 450nx chipset, there is a whole bundle of
+ * things pretending to be host bridges. The MIOC will
+ * be seen first and isn't really a pci bridge (the
+ * actual busses are attached to the PXB's). We need to
+ * read the registers of the MIOC to figure out the
+ * bus numbers for the PXB channels.
+ *
+ * Since the MIOC doesn't have a pci bus attached, we
+ * pretend it wasn't there.
+ */
+ pxb[0] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd0, 1); /* BUSNO[0] */
+ pxb[1] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd1, 1) + 1; /* SUBA[0]+1 */
+ pxb[2] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd3, 1); /* BUSNO[1] */
+ pxb[3] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd4, 1) + 1; /* SUBA[1]+1 */
+ return NULL;
+ case 0x84cb8086:
+ switch (slot) {
+ case 0x12:
+ s = "Intel 82454NX PXB#0, Bus#A";
+ *busnum = pxb[0];
+ break;
+ case 0x13:
+ s = "Intel 82454NX PXB#0, Bus#B";
+ *busnum = pxb[1];
+ break;
+ case 0x14:
+ s = "Intel 82454NX PXB#1, Bus#A";
+ *busnum = pxb[2];
+ break;
+ case 0x15:
+ s = "Intel 82454NX PXB#1, Bus#B";
+ *busnum = pxb[3];
+ break;
+ }
+ break;
+ case 0x1A308086:
+ s = "Intel 82845 Host to PCI bridge";
+ break;
+
+ /* AMD -- vendor 0x1022 */
+ case 0x30001022:
+ s = "AMD Elan SC520 host to PCI bridge";
+#ifdef CPU_ELAN
+ init_AMD_Elan_sc520();
+#else
+ printf(
+"*** WARNING: missing CPU_ELAN -- timekeeping may be wrong\n");
+#endif
+ break;
+ case 0x70061022:
+ s = "AMD-751 host to PCI bridge";
+ break;
+ case 0x700e1022:
+ s = "AMD-761 host to PCI bridge";
+ break;
+
+ /* SiS -- vendor 0x1039 */
+ case 0x04961039:
+ s = "SiS 85c496";
+ break;
+ case 0x04061039:
+ s = "SiS 85c501";
+ break;
+ case 0x06011039:
+ s = "SiS 85c601";
+ break;
+ case 0x55911039:
+ s = "SiS 5591 host to PCI bridge";
+ break;
+ case 0x00011039:
+ s = "SiS 5591 host to AGP bridge";
+ break;
+
+ /* VLSI -- vendor 0x1004 */
+ case 0x00051004:
+ s = "VLSI 82C592 Host to PCI bridge";
+ break;
+
+ /* XXX Here is MVP3, I got the datasheet but NO M/B to test it */
+ /* totally. Please let me know if anything wrong. -F */
+ /* XXX need info on the MVP3 -- any takers? */
+ case 0x05981106:
+ s = "VIA 82C598MVP (Apollo MVP3) host bridge";
+ break;
+
+ /* AcerLabs -- vendor 0x10b9 */
+ /* Funny : The datasheet told me vendor id is "10b8",sub-vendor */
+ /* id is '10b9" but the register always shows "10b9". -Foxfair */
+ case 0x154110b9:
+ s = "AcerLabs M1541 (Aladdin-V) PCI host bridge";
+ break;
+
+ /* OPTi -- vendor 0x1045 */
+ case 0xc7011045:
+ s = "OPTi 82C700 host to PCI bridge";
+ break;
+ case 0xc8221045:
+ s = "OPTi 82C822 host to PCI Bridge";
+ break;
+
+ /* ServerWorks -- vendor 0x1166 */
+ case 0x00051166:
+ s = "ServerWorks NB6536 2.0HE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00061166:
+ /* FALLTHROUGH */
+ case 0x00081166:
+ /* FALLTHROUGH */
+ case 0x02011166:
+ /* FALLTHROUGH */
+ case 0x010f1014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00091166:
+ s = "ServerWorks NB6635 3.0LE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00101166:
+ s = "ServerWorks CIOB30 host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00111166:
+ /* FALLTHROUGH */
+ case 0x03021014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks CMIC-HE host to PCI-X bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* XXX unknown chipset, but working */
+ case 0x00171166:
+ /* FALLTHROUGH */
+ case 0x01011166:
+ case 0x01101166:
+ case 0x02251166:
+ s = "ServerWorks host to PCI bridge(unknown chipset)";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* Compaq/HP -- vendor 0x0e11 */
+ case 0x60100e11:
+ s = "Compaq/HP Model 6010 HotPlug PCI Bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0xc8, 1);
+ break;
+
+ /* Integrated Micro Solutions -- vendor 0x10e0 */
+ case 0x884910e0:
+ s = "Integrated Micro Solutions VL Bridge";
+ break;
+
+ default:
+ if (class == PCIC_BRIDGE && subclass == PCIS_BRIDGE_HOST)
+ s = "Host to PCI bridge";
+ break;
+ }
+
+ return s;
+}
+
+/*
+ * Scan the first pci bus for host-pci bridges and add pcib instances
+ * to the nexus for each bridge.
+ */
+static void
+legacy_pcib_identify(driver_t *driver, device_t parent)
+{
+ int bus, slot, func;
+ u_int8_t hdrtype;
+ int found = 0;
+ int pcifunchigh;
+ int found824xx = 0;
+ int found_orion = 0;
+ device_t child;
+ devclass_t pci_devclass;
+
+ if (pci_cfgregopen() == 0)
+ return;
+ /*
+ * Check to see if we haven't already had a PCI bus added
+ * via some other means. If we have, bail since otherwise
+ * we're going to end up duplicating it.
+ */
+ if ((pci_devclass = devclass_find("pci")) &&
+ devclass_get_device(pci_devclass, 0))
+ return;
+
+
+ bus = 0;
+ retry:
+ for (slot = 0; slot <= PCI_SLOTMAX; slot++) {
+ func = 0;
+ hdrtype = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_HDRTYPE, 1);
+ /*
+ * When enumerating bus devices, the standard says that
+ * one should check the header type and ignore the slots whose
+ * header types that the software doesn't know about. We use
+ * this to filter out devices.
+ */
+ if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE)
+ continue;
+ if ((hdrtype & PCIM_MFDEV) &&
+ (!found_orion || hdrtype != 0xff))
+ pcifunchigh = PCI_FUNCMAX;
+ else
+ pcifunchigh = 0;
+ for (func = 0; func <= pcifunchigh; func++) {
+ /*
+ * Read the IDs and class from the device.
+ */
+ u_int32_t id;
+ u_int8_t class, subclass, busnum;
+ const char *s;
+ device_t *devs;
+ int ndevs, i;
+
+ id = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_DEVVENDOR, 4);
+ if (id == -1)
+ continue;
+ class = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_CLASS, 1);
+ subclass = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_SUBCLASS, 1);
+
+ s = legacy_pcib_is_host_bridge(bus, slot, func,
+ id, class, subclass,
+ &busnum);
+ if (s == NULL)
+ continue;
+
+ /*
+ * Check to see if the physical bus has already
+ * been seen. Eg: hybrid 32 and 64 bit host
+ * bridges to the same logical bus.
+ */
+ if (device_get_children(parent, &devs, &ndevs) == 0) {
+ for (i = 0; s != NULL && i < ndevs; i++) {
+ if (strcmp(device_get_name(devs[i]),
+ "pcib") != 0)
+ continue;
+ if (legacy_get_pcibus(devs[i]) == busnum)
+ s = NULL;
+ }
+ free(devs, M_TEMP);
+ }
+
+ if (s == NULL)
+ continue;
+ /*
+ * Add at priority 100 to make sure we
+ * go after any motherboard resources
+ */
+ child = BUS_ADD_CHILD(parent, 100,
+ "pcib", busnum);
+ device_set_desc(child, s);
+ legacy_set_pcibus(child, busnum);
+
+ found = 1;
+ if (id == 0x12258086)
+ found824xx = 1;
+ if (id == 0x84c48086)
+ found_orion = 1;
+ }
+ }
+ if (found824xx && bus == 0) {
+ bus++;
+ goto retry;
+ }
+
+ /*
+ * Make sure we add at least one bridge since some old
+ * hardware doesn't actually have a host-pci bridge device.
+ * Note that pci_cfgregopen() thinks we have PCI devices..
+ */
+ if (!found) {
+ if (bootverbose)
+ printf(
+ "legacy_pcib_identify: no bridge found, adding pcib0 anyway\n");
+ child = BUS_ADD_CHILD(parent, 100, "pcib", 0);
+ legacy_set_pcibus(child, 0);
+ }
+}
+
+static int
+legacy_pcib_probe(device_t dev)
+{
+
+ if (pci_cfgregopen() == 0)
+ return ENXIO;
+ return -100;
+}
+
+static int
+legacy_pcib_attach(device_t dev)
+{
+ device_t pir;
+ int bus;
+
+ /*
+ * Look for a PCI BIOS interrupt routing table as that will be
+ * our method of routing interrupts if we have one.
+ */
+ bus = pcib_get_bus(dev);
+#ifndef __rtems__
+ if (pci_pir_probe(bus, 0)) {
+ pir = BUS_ADD_CHILD(device_get_parent(dev), 0, "pir", 0);
+ if (pir != NULL)
+ device_probe_and_attach(pir);
+ }
+#else /* __rtems__ */
+#endif /* __rtems__ */
+ device_add_child(dev, "pci", bus);
+ return bus_generic_attach(dev);
+}
+
+int
+legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ *result = 0;
+ return 0;
+ case PCIB_IVAR_BUS:
+ *result = legacy_get_pcibus(dev);
+ return 0;
+ }
+ return ENOENT;
+}
+
+int
+legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ return EINVAL;
+ case PCIB_IVAR_BUS:
+ legacy_set_pcibus(dev, value);
+ return 0;
+ }
+ return ENOENT;
+}
+
+SYSCTL_DECL(_hw_pci);
+
+static unsigned long legacy_host_mem_start = 0x80000000;
+TUNABLE_ULONG("hw.pci.host_mem_start", &legacy_host_mem_start);
+SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN,
+ &legacy_host_mem_start, 0x80000000,
+ "Limit the host bridge memory to being above this address. Must be\n\
+set at boot via a tunable.");
+
+struct resource *
+legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
+ u_long start, u_long end, u_long count, u_int flags)
+{
+ /*
+ * If no memory preference is given, use upper 32MB slot most
+ * bioses use for their memory window. Typically other bridges
+ * before us get in the way to assert their preferences on memory.
+ * Hardcoding like this sucks, so a more MD/MI way needs to be
+ * found to do it. This is typically only used on older laptops
+ * that don't have pci busses behind pci bridge, so assuming > 32MB
+ * is liekly OK.
+ *
+ * However, this can cause problems for other chipsets, so we make
+ * this tunable by hw.pci.host_mem_start.
+ */
+ if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL)
+ start = legacy_host_mem_start;
+ if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL)
+ start = 0x1000;
+ return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
+ count, flags));
+}
+
+static device_method_t legacy_pcib_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, legacy_pcib_identify),
+ DEVMETHOD(device_probe, legacy_pcib_probe),
+ DEVMETHOD(device_attach, legacy_pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, legacy_pcib_maxslots),
+ DEVMETHOD(pcib_read_config, legacy_pcib_read_config),
+ DEVMETHOD(pcib_write_config, legacy_pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, legacy_pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, legacy_pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, legacy_pcib_map_msi),
+
+ { 0, 0 }
+};
+
+static devclass_t hostb_devclass;
+
+DEFINE_CLASS_0(pcib, legacy_pcib_driver, legacy_pcib_methods, 1);
+DRIVER_MODULE(pcib, legacy, legacy_pcib_driver, hostb_devclass, 0, 0);
+
+
+#ifndef __rtems__
+/*
+ * Install placeholder to claim the resources owned by the
+ * PCI bus interface. This could be used to extract the
+ * config space registers in the extreme case where the PnP
+ * ID is available and the PCI BIOS isn't, but for now we just
+ * eat the PnP ID and do nothing else.
+ *
+ * XXX we should silence this probe, as it will generally confuse
+ * people.
+ */
+static struct isa_pnp_id pcibus_pnp_ids[] = {
+ { 0x030ad041 /* PNP0A03 */, "PCI Bus" },
+ { 0x080ad041 /* PNP0A08 */, "PCIe Bus" },
+ { 0 }
+};
+
+static int
+pcibus_pnp_probe(device_t dev)
+{
+ int result;
+
+ if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, pcibus_pnp_ids)) <= 0)
+ device_quiet(dev);
+ return(result);
+}
+
+static int
+pcibus_pnp_attach(device_t dev)
+{
+ return(0);
+}
+
+static device_method_t pcibus_pnp_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibus_pnp_probe),
+ DEVMETHOD(device_attach, pcibus_pnp_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+ { 0, 0 }
+};
+
+static devclass_t pcibus_pnp_devclass;
+
+DEFINE_CLASS_0(pcibus_pnp, pcibus_pnp_driver, pcibus_pnp_methods, 1);
+DRIVER_MODULE(pcibus_pnp, isa, pcibus_pnp_driver, pcibus_pnp_devclass, 0, 0);
+
+
+/*
+ * Provide a PCI-PCI bridge driver for PCI busses behind PCI-PCI bridges
+ * that appear in the PCIBIOS Interrupt Routing Table to use the routing
+ * table for interrupt routing when possible.
+ */
+static int pcibios_pcib_probe(device_t bus);
+
+static device_method_t pcibios_pcib_pci_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibios_pcib_probe),
+ DEVMETHOD(device_attach, pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, pcib_maxslots),
+ DEVMETHOD(pcib_read_config, pcib_read_config),
+ DEVMETHOD(pcib_write_config, pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, pcib_map_msi),
+
+ {0, 0}
+};
+
+static devclass_t pcib_devclass;
+
+DEFINE_CLASS_0(pcib, pcibios_pcib_driver, pcibios_pcib_pci_methods,
+ sizeof(struct pcib_softc));
+DRIVER_MODULE(pcibios_pcib, pci, pcibios_pcib_driver, pcib_devclass, 0, 0);
+
+static int
+pcibios_pcib_probe(device_t dev)
+{
+ int bus;
+
+ if ((pci_get_class(dev) != PCIC_BRIDGE) ||
+ (pci_get_subclass(dev) != PCIS_BRIDGE_PCI))
+ return (ENXIO);
+ bus = pci_read_config(dev, PCIR_SECBUS_1, 1);
+ if (bus == 0)
+ return (ENXIO);
+ if (!pci_pir_probe(bus, 1))
+ return (ENXIO);
+ device_set_desc(dev, "PCIBIOS PCI-PCI bridge");
+ return (-2000);
+}
+
+static int
+pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
+{
+ return (pci_pir_route_interrupt(pci_get_bus(dev), pci_get_slot(dev),
+ pci_get_function(dev), pin));
+}
+#endif /* __rtems__ */
diff --git a/freebsd/sys/sparc/sparc/in_cksum.c b/freebsd/sys/sparc/sparc/in_cksum.c
new file mode 100644
index 00000000..c6f7b568
--- /dev/null
+++ b/freebsd/sys/sparc/sparc/in_cksum.c
@@ -0,0 +1,255 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1988, 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ * Copyright (c) 1996
+ * Matt Thomas <matt@3am-software.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)in_cksum.c 8.1 (Berkeley) 6/10/93
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/mbuf.h>
+#include <sys/systm.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <machine/in_cksum.h>
+
+/*
+ * Checksum routine for Internet Protocol family headers
+ * (Portable Alpha version).
+ *
+ * This routine is very heavily used in the network
+ * code and should be modified for each CPU to be as fast as possible.
+ */
+
+#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x)
+#define REDUCE32 \
+ { \
+ q_util.q = sum; \
+ sum = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
+ }
+#define REDUCE16 \
+ { \
+ q_util.q = sum; \
+ l_util.l = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
+ sum = l_util.s[0] + l_util.s[1]; \
+ ADDCARRY(sum); \
+ }
+
+static const u_int32_t in_masks[] = {
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
+ 0x00000000, 0x000000FF, 0x0000FFFF, 0x00FFFFFF, /* offset 0 */
+ 0x00000000, 0x0000FF00, 0x00FFFF00, 0xFFFFFF00, /* offset 1 */
+ 0x00000000, 0x00FF0000, 0xFFFF0000, 0xFFFF0000, /* offset 2 */
+ 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, /* offset 3 */
+#else
+ /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
+ 0x00000000, 0xFF000000, 0xFFFF0000, 0xFFFFFF00, /* offset 0 */
+ 0x00000000, 0x00FF0000, 0x00FFFF00, 0x00FFFFFF, /* offset 1 */
+ 0x00000000, 0x0000FF00, 0x0000FFFF, 0x0000FFFF, /* offset 2 */
+ 0x00000000, 0x000000FF, 0x000000FF, 0x000000FF, /* offset 3 */
+#endif
+};
+
+union l_util {
+ u_int16_t s[2];
+ u_int32_t l;
+};
+union q_util {
+ u_int16_t s[4];
+ u_int32_t l[2];
+ u_int64_t q;
+};
+
+static u_int64_t
+in_cksumdata(const void *buf, int len)
+{
+ const u_int32_t *lw = (const u_int32_t *) buf;
+ u_int64_t sum = 0;
+ u_int64_t prefilled;
+ int offset;
+ union q_util q_util;
+
+ if ((3 & (long) lw) == 0 && len == 20) {
+ sum = (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3] + lw[4];
+ REDUCE32;
+ return sum;
+ }
+
+ if ((offset = 3 & (long) lw) != 0) {
+ const u_int32_t *masks = in_masks + (offset << 2);
+ lw = (u_int32_t *) (((long) lw) - offset);
+ sum = *lw++ & masks[len >= 3 ? 3 : len];
+ len -= 4 - offset;
+ if (len <= 0) {
+ REDUCE32;
+ return sum;
+ }
+ }
+#if 0
+ /*
+ * Force to cache line boundary.
+ */
+ offset = 32 - (0x1f & (long) lw);
+ if (offset < 32 && len > offset) {
+ len -= offset;
+ if (4 & offset) {
+ sum += (u_int64_t) lw[0];
+ lw += 1;
+ }
+ if (8 & offset) {
+ sum += (u_int64_t) lw[0] + lw[1];
+ lw += 2;
+ }
+ if (16 & offset) {
+ sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
+ lw += 4;
+ }
+ }
+#endif
+ /*
+ * access prefilling to start load of next cache line.
+ * then add current cache line
+ * save result of prefilling for loop iteration.
+ */
+ prefilled = lw[0];
+ while ((len -= 32) >= 4) {
+ u_int64_t prefilling = lw[8];
+ sum += prefilled + lw[1] + lw[2] + lw[3]
+ + lw[4] + lw[5] + lw[6] + lw[7];
+ lw += 8;
+ prefilled = prefilling;
+ }
+ if (len >= 0) {
+ sum += prefilled + lw[1] + lw[2] + lw[3]
+ + lw[4] + lw[5] + lw[6] + lw[7];
+ lw += 8;
+ } else {
+ len += 32;
+ }
+ while ((len -= 16) >= 0) {
+ sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
+ lw += 4;
+ }
+ len += 16;
+ while ((len -= 4) >= 0) {
+ sum += (u_int64_t) *lw++;
+ }
+ len += 4;
+ if (len > 0)
+ sum += (u_int64_t) (in_masks[len] & *lw);
+ REDUCE32;
+ return sum;
+}
+
+u_short
+in_addword(u_short a, u_short b)
+{
+ u_int64_t sum = a + b;
+
+ ADDCARRY(sum);
+ return (sum);
+}
+
+u_short
+#ifdef __rtems__
+/* Prototype does not match in FreeBSD code */
+in_pseudo(u_int a, u_int b, u_int c)
+#else
+in_pseudo(u_int32_t a, u_int32_t b, u_int32_t c)
+#endif
+{
+ u_int64_t sum;
+ union q_util q_util;
+ union l_util l_util;
+
+ sum = (u_int64_t) a + b + c;
+ REDUCE16;
+ return (sum);
+}
+
+u_short
+in_cksum_skip(struct mbuf *m, int len, int skip)
+{
+ u_int64_t sum = 0;
+ int mlen = 0;
+ int clen = 0;
+ caddr_t addr;
+ union q_util q_util;
+ union l_util l_util;
+
+ len -= skip;
+ for (; skip && m; m = m->m_next) {
+ if (m->m_len > skip) {
+ mlen = m->m_len - skip;
+ addr = mtod(m, caddr_t) + skip;
+ goto skip_start;
+ } else {
+ skip -= m->m_len;
+ }
+ }
+
+ for (; m && len; m = m->m_next) {
+ if (m->m_len == 0)
+ continue;
+ mlen = m->m_len;
+ addr = mtod(m, caddr_t);
+skip_start:
+ if (len < mlen)
+ mlen = len;
+
+ if ((clen ^ (uintptr_t) addr) & 1)
+ sum += in_cksumdata(addr, mlen) << 8;
+ else
+ sum += in_cksumdata(addr, mlen);
+
+ clen += mlen;
+ len -= mlen;
+ }
+ REDUCE16;
+ return (~sum & 0xffff);
+}
+
+u_int in_cksum_hdr(const struct ip *ip)
+{
+ u_int64_t sum = in_cksumdata(ip, sizeof(struct ip));
+ union q_util q_util;
+ union l_util l_util;
+ REDUCE16;
+ return (~sum & 0xffff);
+}
diff --git a/freebsd/sys/sparc/sparc/legacy.c b/freebsd/sys/sparc/sparc/legacy.c
new file mode 100644
index 00000000..2547990c
--- /dev/null
+++ b/freebsd/sys/sparc/sparc/legacy.c
@@ -0,0 +1,347 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright 1998 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby
+ * granted, provided that both the above copyright notice and this
+ * permission notice appear in all copies, that both the above
+ * copyright notice and this permission notice appear in all
+ * supporting documentation, and that the name of M.I.T. not be used
+ * in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission. M.I.T. makes
+ * no representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
+ * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
+ * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * This code implements a system driver for legacy systems that do not
+ * support ACPI or when ACPI support is not present in the kernel.
+ */
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <machine/bus.h>
+#include <sys/pcpu.h>
+#include <sys/rman.h>
+#include <sys/smp.h>
+
+#ifndef __rtems__
+#include <rtems/bsd/local/opt_mca.h>
+#endif /* __rtems__ */
+#ifdef DEV_MCA
+#include <i386/bios/mca_machdep.h>
+#endif
+
+#include <machine/legacyvar.h>
+#include <machine/resource.h>
+
+static MALLOC_DEFINE(M_LEGACYDEV, "legacydrv", "legacy system device");
+struct legacy_device {
+ int lg_pcibus;
+};
+
+#define DEVTOAT(dev) ((struct legacy_device *)device_get_ivars(dev))
+
+static int legacy_probe(device_t);
+static int legacy_attach(device_t);
+static int legacy_print_child(device_t, device_t);
+static device_t legacy_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static int legacy_read_ivar(device_t, device_t, int, uintptr_t *);
+static int legacy_write_ivar(device_t, device_t, int, uintptr_t);
+
+static device_method_t legacy_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, legacy_probe),
+ DEVMETHOD(device_attach, legacy_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, legacy_print_child),
+ DEVMETHOD(bus_add_child, legacy_add_child),
+ DEVMETHOD(bus_read_ivar, legacy_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_write_ivar),
+ DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t legacy_driver = {
+ "legacy",
+ legacy_methods,
+ 1, /* no softc */
+};
+static devclass_t legacy_devclass;
+
+DRIVER_MODULE(legacy, nexus, legacy_driver, legacy_devclass, 0, 0);
+
+static int
+legacy_probe(device_t dev)
+{
+
+ device_set_desc(dev, "legacy system");
+ device_quiet(dev);
+ return (0);
+}
+
+static int
+legacy_attach(device_t dev)
+{
+ device_t child;
+
+ /*
+ * Let our child drivers identify any child devices that they
+ * can find. Once that is done attach any devices that we
+ * found.
+ */
+ bus_generic_probe(dev);
+ bus_generic_attach(dev);
+
+#ifndef PC98
+ /*
+ * If we didn't see EISA or ISA on a pci bridge, create some
+ * connection points now so they show up "on motherboard".
+ */
+ if (!devclass_get_device(devclass_find("eisa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "eisa", 0);
+ if (child == NULL)
+ panic("legacy_attach eisa");
+ device_probe_and_attach(child);
+ }
+#endif
+#ifdef DEV_MCA
+ if (MCA_system && !devclass_get_device(devclass_find("mca"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "mca", 0);
+ if (child == 0)
+ panic("legacy_probe mca");
+ device_probe_and_attach(child);
+ }
+#endif
+ if (!devclass_get_device(devclass_find("isa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "isa", 0);
+ if (child == NULL)
+ panic("legacy_attach isa");
+ device_probe_and_attach(child);
+ }
+
+ return 0;
+}
+
+static int
+legacy_print_child(device_t bus, device_t child)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+ int retval = 0;
+
+ retval += bus_print_child_header(bus, child);
+ if (atdev->lg_pcibus != -1)
+ retval += printf(" pcibus %d", atdev->lg_pcibus);
+ retval += printf(" on motherboard\n"); /* XXX "motherboard", ick */
+
+ return (retval);
+}
+
+static device_t
+legacy_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ device_t child;
+ struct legacy_device *atdev;
+
+ atdev = malloc(sizeof(struct legacy_device), M_LEGACYDEV,
+ M_NOWAIT | M_ZERO);
+ if (atdev == NULL)
+ return(NULL);
+ atdev->lg_pcibus = -1;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child == NULL)
+ free(atdev, M_LEGACYDEV);
+ else
+ /* should we free this in legacy_child_detached? */
+ device_set_ivars(child, atdev);
+
+ return (child);
+}
+
+static int
+legacy_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ *result = 0;
+ break;
+ case LEGACY_IVAR_PCIBUS:
+ *result = atdev->lg_pcibus;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+
+static int
+legacy_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ return EINVAL;
+ case LEGACY_IVAR_PCIBUS:
+ atdev->lg_pcibus = value;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+/*
+ * Legacy CPU attachment when ACPI is not available. Drivers like
+ * cpufreq(4) hang off this.
+ */
+static void cpu_identify(driver_t *driver, device_t parent);
+static int cpu_read_ivar(device_t dev, device_t child, int index,
+ uintptr_t *result);
+static device_t cpu_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static struct resource_list *cpu_get_rlist(device_t dev, device_t child);
+
+struct cpu_device {
+ struct resource_list cd_rl;
+ struct pcpu *cd_pcpu;
+};
+
+static device_method_t cpu_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, cpu_identify),
+ DEVMETHOD(device_probe, bus_generic_probe),
+ DEVMETHOD(device_attach, bus_generic_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_add_child, cpu_add_child),
+ DEVMETHOD(bus_read_ivar, cpu_read_ivar),
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_get_resource_list, cpu_get_rlist),
+ DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
+ DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource),
+ DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource),
+ DEVMETHOD(bus_driver_added, bus_generic_driver_added),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t cpu_driver = {
+ "cpu",
+ cpu_methods,
+ 1, /* no softc */
+};
+static devclass_t cpu_devclass;
+DRIVER_MODULE(cpu, legacy, cpu_driver, cpu_devclass, 0, 0);
+
+static void
+cpu_identify(driver_t *driver, device_t parent)
+{
+ device_t child;
+ int i;
+
+ /*
+ * Attach a cpuX device for each CPU. We use an order of 150
+ * so that these devices are attached after the Host-PCI
+ * bridges (which are added at order 100).
+ */
+ for (i = 0; i <= mp_maxid; i++)
+ if (!CPU_ABSENT(i)) {
+ child = BUS_ADD_CHILD(parent, 150, "cpu", i);
+ if (child == NULL)
+ panic("legacy_attach cpu");
+ }
+}
+
+static device_t
+cpu_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ struct cpu_device *cd;
+ device_t child;
+ struct pcpu *pc;
+
+ if ((cd = malloc(sizeof(*cd), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL)
+ return (NULL);
+
+ resource_list_init(&cd->cd_rl);
+ pc = pcpu_find(device_get_unit(bus));
+ cd->cd_pcpu = pc;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child != NULL) {
+ pc->pc_device = child;
+ device_set_ivars(child, cd);
+ } else
+ free(cd, M_DEVBUF);
+ return (child);
+}
+
+static struct resource_list *
+cpu_get_rlist(device_t dev, device_t child)
+{
+ struct cpu_device *cpdev;
+
+ cpdev = device_get_ivars(child);
+ return (&cpdev->cd_rl);
+}
+
+static int
+cpu_read_ivar(device_t dev, device_t child, int index, uintptr_t *result)
+{
+ struct cpu_device *cpdev;
+
+ if (index != CPU_IVAR_PCPU)
+ return (ENOENT);
+ cpdev = device_get_ivars(child);
+ *result = (uintptr_t)cpdev->cd_pcpu;
+ return (0);
+}
diff --git a/freebsd/sys/sparc64/include/machine/asi.h b/freebsd/sys/sparc64/include/machine/asi.h
index 83a42ff3..e5769c12 100644
--- a/freebsd/sys/sparc64/include/machine/asi.h
+++ b/freebsd/sys/sparc64/include/machine/asi.h
@@ -29,8 +29,8 @@
* $FreeBSD$
*/
-#ifndef _MACHINE_ASI_HH_
-#define _MACHINE_ASI_HH_
+#ifndef _MACHINE_ASI_H_
+#define _MACHINE_ASI_H_
/*
* Standard v9 ASIs
@@ -257,4 +257,4 @@
#define ASI_BLK_PL 0xf8
#define ASI_BLK_SL 0xf9
-#endif /* !_MACHINE_ASI_HH_ */
+#endif /* !_MACHINE_ASI_H_ */
diff --git a/freebsd/sys/sparc64/include/machine/cpufunc.h b/freebsd/sys/sparc64/include/machine/cpufunc.h
index 7805abc4..60533f83 100644
--- a/freebsd/sys/sparc64/include/machine/cpufunc.h
+++ b/freebsd/sys/sparc64/include/machine/cpufunc.h
@@ -26,11 +26,11 @@
* $FreeBSD$
*/
-#ifndef _MACHINE_CPUFUNC_HH_
-#define _MACHINE_CPUFUNC_HH_
+#ifndef _MACHINE_CPUFUNC_H_
+#define _MACHINE_CPUFUNC_H_
-#include <freebsd/machine/asi.h>
-#include <freebsd/machine/pstate.h>
+#include <machine/asi.h>
+#include <machine/pstate.h>
struct thread;
@@ -265,4 +265,4 @@ ffs(int mask)
#undef LDNC_GEN
#undef STNC_GEN
-#endif /* !_MACHINE_CPUFUNC_HH_ */
+#endif /* !_MACHINE_CPUFUNC_H_ */
diff --git a/freebsd/sys/sparc64/include/machine/in_cksum.h b/freebsd/sys/sparc64/include/machine/in_cksum.h
new file mode 100644
index 00000000..ae06a4cb
--- /dev/null
+++ b/freebsd/sys/sparc64/include/machine/in_cksum.h
@@ -0,0 +1,171 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+/*-
+ * Copyright (c) 2001 by Thomas Moestl <tmm@FreeBSD.org>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * from tahoe: in_cksum.c 1.2 86/01/05
+ * from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91
+ * from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp
+ * from: FreeBSD: src/sys/alpha/include/in_cksum.h,v 1.5 2000/05/06
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_IN_CKSUM_H_
+#define _MACHINE_IN_CKSUM_H_ 1
+
+#include <sys/cdefs.h>
+
+#define in_cksum(m, len) in_cksum_skip(m, len, 0)
+
+static __inline void
+in_cksum_update(struct ip *ip)
+{
+ int __tmp;
+
+ __tmp = (int)ip->ip_sum + 1;
+ ip->ip_sum = __tmp + (__tmp >> 16);
+}
+
+static __inline u_short
+in_addword(u_short sum, u_short b)
+{
+ u_long __ret, __tmp;
+
+ __asm(
+ "sll %2, 16, %0\n"
+ "sll %3, 16, %1\n"
+ "addcc %0, %1, %0\n"
+ "srl %0, 16, %0\n"
+ "addc %0, 0, %0\n"
+ : "=&r" (__ret), "=&r" (__tmp) : "r" (sum), "r" (b) : "cc");
+ return (__ret);
+}
+
+static __inline u_short
+in_pseudo(u_int sum, u_int b, u_int c)
+{
+ u_long __tmp;
+
+ __asm(
+ "addcc %0, %3, %0\n"
+ "addccc %0, %4, %0\n"
+ "addc %0, 0, %0\n"
+ "sll %0, 16, %1\n"
+ "addcc %0, %1, %0\n"
+ "srl %0, 16, %0\n"
+ "addc %0, 0, %0\n"
+ : "=r" (sum), "=&r" (__tmp) : "0" (sum), "r" (b), "r" (c) : "cc");
+ return (sum);
+}
+
+static __inline u_int
+in_cksum_hdr(struct ip *ip)
+{
+ u_long __ret, __tmp1, __tmp2, __tmp3, __tmp4;
+
+ /*
+ * Use 32-bit memory accesses and additions - addition with carry only
+ * works for 32 bits, and fixing up alignment issues for 64 is probably
+ * more trouble than it's worth.
+ * This may read outside of the ip header, but does not cross a page
+ * boundary in doing so, so that should be OK.
+ * Actually, this specialized implementation might be overkill - using
+ * a generic implementation for both in_cksum_skip and in_cksum_hdr
+ * should not be too much more expensive.
+ */
+#define __LD_ADD(addr, tmp, sum, offs, mod) \
+ "lduw [" #addr " + " #offs "], " #tmp "\n" \
+ "add" # mod " " #sum ", " #tmp ", " #sum "\n"
+
+ __asm(
+ "and %5, 3, %3\n"
+ "andn %5, 3, %1\n"
+ "brz,pt %3, 0f\n"
+ " lduw [%1], %0\n"
+ "mov 4, %4\n"
+ "sub %4, %3, %4\n"
+ "sll %4, 3, %4\n" /* fix up unaligned buffers */
+ "mov 1, %2\n"
+ "sll %2, %4, %4\n"
+ "sub %4, 1, %4\n"
+ "lduw [%1 + 20], %2\n"
+ "andn %2, %4, %2\n"
+ "and %0, %4, %0\n"
+ "or %0, %2, %0\n"
+ "0:\n"
+ __LD_ADD(%1, %2, %0, 4, cc)
+ __LD_ADD(%1, %2, %0, 8, ccc)
+ __LD_ADD(%1, %2, %0, 12, ccc)
+ __LD_ADD(%1, %2, %0, 16, ccc)
+ "addc %0, 0, %0\n" /* reduce */
+ "1:\n"
+ "sll %0, 16, %2\n"
+ "addcc %0, %2, %0\n"
+ "srl %0, 16, %0\n"
+ "addc %0, 0, %0\n"
+ "andcc %3, 1, %3\n" /* need to byte-swap? */
+ "clr %3\n"
+ "bne,a,pn %%xcc, 1b\n"
+ " sll %0, 8, %0\n"
+ "not %0\n"
+ "sll %0, 16, %0\n"
+ "srl %0, 16, %0\n"
+ : "=&r" (__ret), "=r" (__tmp1), "=&r" (__tmp2), "=&r" (__tmp3),
+ "=&r" (__tmp4) : "1" (ip) : "cc");
+#undef __LD_ADD
+ return (__ret);
+}
+
+#ifdef _KERNEL
+u_short in_cksum_skip(struct mbuf *m, int len, int skip);
+#endif
+
+#endif /* _MACHINE_IN_CKSUM_H_ */
diff --git a/freebsd/sys/sparc64/include/machine/legacyvar.h b/freebsd/sys/sparc64/include/machine/legacyvar.h
new file mode 100644
index 00000000..0b0fa433
--- /dev/null
+++ b/freebsd/sys/sparc64/include/machine/legacyvar.h
@@ -0,0 +1,57 @@
+/*-
+ * Copyright (c) 2000 Peter Wemm <peter@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_LEGACYVAR_H_
+#define _MACHINE_LEGACYVAR_H_
+
+enum legacy_device_ivars {
+ LEGACY_IVAR_PCIDOMAIN,
+ LEGACY_IVAR_PCIBUS
+};
+
+#define LEGACY_ACCESSOR(var, ivar, type) \
+ __BUS_ACCESSOR(legacy, var, LEGACY, ivar, type)
+
+LEGACY_ACCESSOR(pcidomain, PCIDOMAIN, uint32_t)
+LEGACY_ACCESSOR(pcibus, PCIBUS, uint32_t)
+
+#undef LEGACY_ACCESSOR
+
+int legacy_pcib_maxslots(device_t dev);
+uint32_t legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes);
+int legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result);
+void legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes);
+int legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value);
+struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child,
+ int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
+
+#endif /* !_MACHINE_LEGACYVAR_H_ */
diff --git a/freebsd/sys/sparc64/include/machine/pci_cfgreg.h b/freebsd/sys/sparc64/include/machine/pci_cfgreg.h
new file mode 100644
index 00000000..bc72418d
--- /dev/null
+++ b/freebsd/sys/sparc64/include/machine/pci_cfgreg.h
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
+ */
+
+#define CONF1_ADDR_PORT 0x0cf8
+#define CONF1_DATA_PORT 0x0cfc
+
+#define CONF1_ENABLE 0x80000000ul
+#define CONF1_ENABLE_CHK 0x80000000ul
+#define CONF1_ENABLE_MSK 0x7f000000ul
+#define CONF1_ENABLE_CHK1 0xff000001ul
+#define CONF1_ENABLE_MSK1 0x80000001ul
+#define CONF1_ENABLE_RES1 0x80000000ul
+
+#define CONF2_ENABLE_PORT 0x0cf8
+#define CONF2_FORWARD_PORT 0x0cfa
+
+#define CONF2_ENABLE_CHK 0x0e
+#define CONF2_ENABLE_RES 0x0e
+
+int pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus);
+int pci_cfgregopen(void);
+u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes);
+void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes);
+void pci_pir_open(void);
+int pci_pir_probe(int bus, int require_parse);
+int pci_pir_route_interrupt(int bus, int device, int func, int pin);
diff --git a/freebsd/sys/sparc64/include/machine/pstate.h b/freebsd/sys/sparc64/include/machine/pstate.h
index 19d98be5..4f536303 100644
--- a/freebsd/sys/sparc64/include/machine/pstate.h
+++ b/freebsd/sys/sparc64/include/machine/pstate.h
@@ -26,8 +26,8 @@
* $FreeBSD$
*/
-#ifndef _MACHINE_PSTATE_HH_
-#define _MACHINE_PSTATE_HH_
+#ifndef _MACHINE_PSTATE_H_
+#define _MACHINE_PSTATE_H_
#define PSTATE_AG (1<<0)
#define PSTATE_IE (1<<1)
@@ -60,4 +60,4 @@
#define PSTATE_SECURE(pstate) \
(((pstate) & ~(PSTATE_AM|PSTATE_MM_MASK)) == (PSTATE_IE|PSTATE_PEF))
-#endif /* !_MACHINE_PSTATE_HH_ */
+#endif /* !_MACHINE_PSTATE_H_ */
diff --git a/freebsd/sys/sparc64/pci/pci_bus.c b/freebsd/sys/sparc64/pci/pci_bus.c
new file mode 100644
index 00000000..6627db98
--- /dev/null
+++ b/freebsd/sys/sparc64/pci/pci_bus.c
@@ -0,0 +1,729 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/local/opt_cpu.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
+
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcib_private.h>
+#include <isa/isavar.h>
+#ifdef CPU_ELAN
+#include <machine/md_var.h>
+#endif
+#include <machine/legacyvar.h>
+#include <machine/pci_cfgreg.h>
+#include <machine/resource.h>
+
+#include <rtems/bsd/local/pcib_if.h>
+
+#ifndef __rtems__
+static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev,
+ int pin);
+#else /* __rtems__ */
+int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin);
+#endif /* __rtems__ */
+
+
+int
+legacy_pcib_maxslots(device_t dev)
+{
+ return 31;
+}
+
+/* read configuration space register */
+
+#ifdef __rtems__
+uint32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#else
+u_int32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#endif
+{
+ return(pci_cfgregread(bus, slot, func, reg, bytes));
+}
+
+/* write configuration space register */
+
+void
+legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes)
+{
+ pci_cfgregwrite(bus, slot, func, reg, data, bytes);
+}
+
+/* Pass MSI requests up to the nexus. */
+
+static int
+legacy_pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount,
+ int *irqs)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSI(device_get_parent(bus), dev, count, maxcount,
+ irqs));
+}
+
+static int
+legacy_pcib_alloc_msix(device_t pcib, device_t dev, int *irq)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq));
+}
+
+static int
+legacy_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr,
+ uint32_t *data)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data));
+}
+
+static const char *
+legacy_pcib_is_host_bridge(int bus, int slot, int func,
+ uint32_t id, uint8_t class, uint8_t subclass,
+ uint8_t *busnum)
+{
+ const char *s = NULL;
+ static uint8_t pxb[4]; /* hack for 450nx */
+
+ *busnum = 0;
+
+ switch (id) {
+ case 0x12258086:
+ s = "Intel 824?? host to PCI bridge";
+ /* XXX This is a guess */
+ /* *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x41, 1); */
+ *busnum = bus;
+ break;
+ case 0x71208086:
+ s = "Intel 82810 (i810 GMCH) Host To Hub bridge";
+ break;
+ case 0x71228086:
+ s = "Intel 82810-DC100 (i810-DC100 GMCH) Host To Hub bridge";
+ break;
+ case 0x71248086:
+ s = "Intel 82810E (i810E GMCH) Host To Hub bridge";
+ break;
+ case 0x11308086:
+ s = "Intel 82815 (i815 GMCH) Host To Hub bridge";
+ break;
+ case 0x71808086:
+ s = "Intel 82443LX (440 LX) host to PCI bridge";
+ break;
+ case 0x71908086:
+ s = "Intel 82443BX (440 BX) host to PCI bridge";
+ break;
+ case 0x71928086:
+ s = "Intel 82443BX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x71948086:
+ s = "Intel 82443MX host to PCI bridge";
+ break;
+ case 0x71a08086:
+ s = "Intel 82443GX host to PCI bridge";
+ break;
+ case 0x71a18086:
+ s = "Intel 82443GX host to AGP bridge";
+ break;
+ case 0x71a28086:
+ s = "Intel 82443GX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x84c48086:
+ s = "Intel 82454KX/GX (Orion) host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x4a, 1);
+ break;
+ case 0x84ca8086:
+ /*
+ * For the 450nx chipset, there is a whole bundle of
+ * things pretending to be host bridges. The MIOC will
+ * be seen first and isn't really a pci bridge (the
+ * actual busses are attached to the PXB's). We need to
+ * read the registers of the MIOC to figure out the
+ * bus numbers for the PXB channels.
+ *
+ * Since the MIOC doesn't have a pci bus attached, we
+ * pretend it wasn't there.
+ */
+ pxb[0] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd0, 1); /* BUSNO[0] */
+ pxb[1] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd1, 1) + 1; /* SUBA[0]+1 */
+ pxb[2] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd3, 1); /* BUSNO[1] */
+ pxb[3] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd4, 1) + 1; /* SUBA[1]+1 */
+ return NULL;
+ case 0x84cb8086:
+ switch (slot) {
+ case 0x12:
+ s = "Intel 82454NX PXB#0, Bus#A";
+ *busnum = pxb[0];
+ break;
+ case 0x13:
+ s = "Intel 82454NX PXB#0, Bus#B";
+ *busnum = pxb[1];
+ break;
+ case 0x14:
+ s = "Intel 82454NX PXB#1, Bus#A";
+ *busnum = pxb[2];
+ break;
+ case 0x15:
+ s = "Intel 82454NX PXB#1, Bus#B";
+ *busnum = pxb[3];
+ break;
+ }
+ break;
+ case 0x1A308086:
+ s = "Intel 82845 Host to PCI bridge";
+ break;
+
+ /* AMD -- vendor 0x1022 */
+ case 0x30001022:
+ s = "AMD Elan SC520 host to PCI bridge";
+#ifdef CPU_ELAN
+ init_AMD_Elan_sc520();
+#else
+ printf(
+"*** WARNING: missing CPU_ELAN -- timekeeping may be wrong\n");
+#endif
+ break;
+ case 0x70061022:
+ s = "AMD-751 host to PCI bridge";
+ break;
+ case 0x700e1022:
+ s = "AMD-761 host to PCI bridge";
+ break;
+
+ /* SiS -- vendor 0x1039 */
+ case 0x04961039:
+ s = "SiS 85c496";
+ break;
+ case 0x04061039:
+ s = "SiS 85c501";
+ break;
+ case 0x06011039:
+ s = "SiS 85c601";
+ break;
+ case 0x55911039:
+ s = "SiS 5591 host to PCI bridge";
+ break;
+ case 0x00011039:
+ s = "SiS 5591 host to AGP bridge";
+ break;
+
+ /* VLSI -- vendor 0x1004 */
+ case 0x00051004:
+ s = "VLSI 82C592 Host to PCI bridge";
+ break;
+
+ /* XXX Here is MVP3, I got the datasheet but NO M/B to test it */
+ /* totally. Please let me know if anything wrong. -F */
+ /* XXX need info on the MVP3 -- any takers? */
+ case 0x05981106:
+ s = "VIA 82C598MVP (Apollo MVP3) host bridge";
+ break;
+
+ /* AcerLabs -- vendor 0x10b9 */
+ /* Funny : The datasheet told me vendor id is "10b8",sub-vendor */
+ /* id is '10b9" but the register always shows "10b9". -Foxfair */
+ case 0x154110b9:
+ s = "AcerLabs M1541 (Aladdin-V) PCI host bridge";
+ break;
+
+ /* OPTi -- vendor 0x1045 */
+ case 0xc7011045:
+ s = "OPTi 82C700 host to PCI bridge";
+ break;
+ case 0xc8221045:
+ s = "OPTi 82C822 host to PCI Bridge";
+ break;
+
+ /* ServerWorks -- vendor 0x1166 */
+ case 0x00051166:
+ s = "ServerWorks NB6536 2.0HE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00061166:
+ /* FALLTHROUGH */
+ case 0x00081166:
+ /* FALLTHROUGH */
+ case 0x02011166:
+ /* FALLTHROUGH */
+ case 0x010f1014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00091166:
+ s = "ServerWorks NB6635 3.0LE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00101166:
+ s = "ServerWorks CIOB30 host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00111166:
+ /* FALLTHROUGH */
+ case 0x03021014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks CMIC-HE host to PCI-X bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* XXX unknown chipset, but working */
+ case 0x00171166:
+ /* FALLTHROUGH */
+ case 0x01011166:
+ case 0x01101166:
+ case 0x02251166:
+ s = "ServerWorks host to PCI bridge(unknown chipset)";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* Compaq/HP -- vendor 0x0e11 */
+ case 0x60100e11:
+ s = "Compaq/HP Model 6010 HotPlug PCI Bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0xc8, 1);
+ break;
+
+ /* Integrated Micro Solutions -- vendor 0x10e0 */
+ case 0x884910e0:
+ s = "Integrated Micro Solutions VL Bridge";
+ break;
+
+ default:
+ if (class == PCIC_BRIDGE && subclass == PCIS_BRIDGE_HOST)
+ s = "Host to PCI bridge";
+ break;
+ }
+
+ return s;
+}
+
+/*
+ * Scan the first pci bus for host-pci bridges and add pcib instances
+ * to the nexus for each bridge.
+ */
+static void
+legacy_pcib_identify(driver_t *driver, device_t parent)
+{
+ int bus, slot, func;
+ u_int8_t hdrtype;
+ int found = 0;
+ int pcifunchigh;
+ int found824xx = 0;
+ int found_orion = 0;
+ device_t child;
+ devclass_t pci_devclass;
+
+ if (pci_cfgregopen() == 0)
+ return;
+ /*
+ * Check to see if we haven't already had a PCI bus added
+ * via some other means. If we have, bail since otherwise
+ * we're going to end up duplicating it.
+ */
+ if ((pci_devclass = devclass_find("pci")) &&
+ devclass_get_device(pci_devclass, 0))
+ return;
+
+
+ bus = 0;
+ retry:
+ for (slot = 0; slot <= PCI_SLOTMAX; slot++) {
+ func = 0;
+ hdrtype = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_HDRTYPE, 1);
+ /*
+ * When enumerating bus devices, the standard says that
+ * one should check the header type and ignore the slots whose
+ * header types that the software doesn't know about. We use
+ * this to filter out devices.
+ */
+ if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE)
+ continue;
+ if ((hdrtype & PCIM_MFDEV) &&
+ (!found_orion || hdrtype != 0xff))
+ pcifunchigh = PCI_FUNCMAX;
+ else
+ pcifunchigh = 0;
+ for (func = 0; func <= pcifunchigh; func++) {
+ /*
+ * Read the IDs and class from the device.
+ */
+ u_int32_t id;
+ u_int8_t class, subclass, busnum;
+ const char *s;
+ device_t *devs;
+ int ndevs, i;
+
+ id = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_DEVVENDOR, 4);
+ if (id == -1)
+ continue;
+ class = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_CLASS, 1);
+ subclass = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_SUBCLASS, 1);
+
+ s = legacy_pcib_is_host_bridge(bus, slot, func,
+ id, class, subclass,
+ &busnum);
+ if (s == NULL)
+ continue;
+
+ /*
+ * Check to see if the physical bus has already
+ * been seen. Eg: hybrid 32 and 64 bit host
+ * bridges to the same logical bus.
+ */
+ if (device_get_children(parent, &devs, &ndevs) == 0) {
+ for (i = 0; s != NULL && i < ndevs; i++) {
+ if (strcmp(device_get_name(devs[i]),
+ "pcib") != 0)
+ continue;
+ if (legacy_get_pcibus(devs[i]) == busnum)
+ s = NULL;
+ }
+ free(devs, M_TEMP);
+ }
+
+ if (s == NULL)
+ continue;
+ /*
+ * Add at priority 100 to make sure we
+ * go after any motherboard resources
+ */
+ child = BUS_ADD_CHILD(parent, 100,
+ "pcib", busnum);
+ device_set_desc(child, s);
+ legacy_set_pcibus(child, busnum);
+
+ found = 1;
+ if (id == 0x12258086)
+ found824xx = 1;
+ if (id == 0x84c48086)
+ found_orion = 1;
+ }
+ }
+ if (found824xx && bus == 0) {
+ bus++;
+ goto retry;
+ }
+
+ /*
+ * Make sure we add at least one bridge since some old
+ * hardware doesn't actually have a host-pci bridge device.
+ * Note that pci_cfgregopen() thinks we have PCI devices..
+ */
+ if (!found) {
+ if (bootverbose)
+ printf(
+ "legacy_pcib_identify: no bridge found, adding pcib0 anyway\n");
+ child = BUS_ADD_CHILD(parent, 100, "pcib", 0);
+ legacy_set_pcibus(child, 0);
+ }
+}
+
+static int
+legacy_pcib_probe(device_t dev)
+{
+
+ if (pci_cfgregopen() == 0)
+ return ENXIO;
+ return -100;
+}
+
+static int
+legacy_pcib_attach(device_t dev)
+{
+ device_t pir;
+ int bus;
+
+ /*
+ * Look for a PCI BIOS interrupt routing table as that will be
+ * our method of routing interrupts if we have one.
+ */
+ bus = pcib_get_bus(dev);
+#ifndef __rtems__
+ if (pci_pir_probe(bus, 0)) {
+ pir = BUS_ADD_CHILD(device_get_parent(dev), 0, "pir", 0);
+ if (pir != NULL)
+ device_probe_and_attach(pir);
+ }
+#else /* __rtems__ */
+#endif /* __rtems__ */
+ device_add_child(dev, "pci", bus);
+ return bus_generic_attach(dev);
+}
+
+int
+legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ *result = 0;
+ return 0;
+ case PCIB_IVAR_BUS:
+ *result = legacy_get_pcibus(dev);
+ return 0;
+ }
+ return ENOENT;
+}
+
+int
+legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ return EINVAL;
+ case PCIB_IVAR_BUS:
+ legacy_set_pcibus(dev, value);
+ return 0;
+ }
+ return ENOENT;
+}
+
+SYSCTL_DECL(_hw_pci);
+
+static unsigned long legacy_host_mem_start = 0x80000000;
+TUNABLE_ULONG("hw.pci.host_mem_start", &legacy_host_mem_start);
+SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN,
+ &legacy_host_mem_start, 0x80000000,
+ "Limit the host bridge memory to being above this address. Must be\n\
+set at boot via a tunable.");
+
+struct resource *
+legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
+ u_long start, u_long end, u_long count, u_int flags)
+{
+ /*
+ * If no memory preference is given, use upper 32MB slot most
+ * bioses use for their memory window. Typically other bridges
+ * before us get in the way to assert their preferences on memory.
+ * Hardcoding like this sucks, so a more MD/MI way needs to be
+ * found to do it. This is typically only used on older laptops
+ * that don't have pci busses behind pci bridge, so assuming > 32MB
+ * is liekly OK.
+ *
+ * However, this can cause problems for other chipsets, so we make
+ * this tunable by hw.pci.host_mem_start.
+ */
+ if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL)
+ start = legacy_host_mem_start;
+ if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL)
+ start = 0x1000;
+ return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
+ count, flags));
+}
+
+static device_method_t legacy_pcib_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, legacy_pcib_identify),
+ DEVMETHOD(device_probe, legacy_pcib_probe),
+ DEVMETHOD(device_attach, legacy_pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, legacy_pcib_maxslots),
+ DEVMETHOD(pcib_read_config, legacy_pcib_read_config),
+ DEVMETHOD(pcib_write_config, legacy_pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, legacy_pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, legacy_pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, legacy_pcib_map_msi),
+
+ { 0, 0 }
+};
+
+static devclass_t hostb_devclass;
+
+DEFINE_CLASS_0(pcib, legacy_pcib_driver, legacy_pcib_methods, 1);
+DRIVER_MODULE(pcib, legacy, legacy_pcib_driver, hostb_devclass, 0, 0);
+
+
+#ifndef __rtems__
+/*
+ * Install placeholder to claim the resources owned by the
+ * PCI bus interface. This could be used to extract the
+ * config space registers in the extreme case where the PnP
+ * ID is available and the PCI BIOS isn't, but for now we just
+ * eat the PnP ID and do nothing else.
+ *
+ * XXX we should silence this probe, as it will generally confuse
+ * people.
+ */
+static struct isa_pnp_id pcibus_pnp_ids[] = {
+ { 0x030ad041 /* PNP0A03 */, "PCI Bus" },
+ { 0x080ad041 /* PNP0A08 */, "PCIe Bus" },
+ { 0 }
+};
+
+static int
+pcibus_pnp_probe(device_t dev)
+{
+ int result;
+
+ if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, pcibus_pnp_ids)) <= 0)
+ device_quiet(dev);
+ return(result);
+}
+
+static int
+pcibus_pnp_attach(device_t dev)
+{
+ return(0);
+}
+
+static device_method_t pcibus_pnp_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibus_pnp_probe),
+ DEVMETHOD(device_attach, pcibus_pnp_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+ { 0, 0 }
+};
+
+static devclass_t pcibus_pnp_devclass;
+
+DEFINE_CLASS_0(pcibus_pnp, pcibus_pnp_driver, pcibus_pnp_methods, 1);
+DRIVER_MODULE(pcibus_pnp, isa, pcibus_pnp_driver, pcibus_pnp_devclass, 0, 0);
+
+
+/*
+ * Provide a PCI-PCI bridge driver for PCI busses behind PCI-PCI bridges
+ * that appear in the PCIBIOS Interrupt Routing Table to use the routing
+ * table for interrupt routing when possible.
+ */
+static int pcibios_pcib_probe(device_t bus);
+
+static device_method_t pcibios_pcib_pci_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibios_pcib_probe),
+ DEVMETHOD(device_attach, pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, pcib_maxslots),
+ DEVMETHOD(pcib_read_config, pcib_read_config),
+ DEVMETHOD(pcib_write_config, pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, pcib_map_msi),
+
+ {0, 0}
+};
+
+static devclass_t pcib_devclass;
+
+DEFINE_CLASS_0(pcib, pcibios_pcib_driver, pcibios_pcib_pci_methods,
+ sizeof(struct pcib_softc));
+DRIVER_MODULE(pcibios_pcib, pci, pcibios_pcib_driver, pcib_devclass, 0, 0);
+
+static int
+pcibios_pcib_probe(device_t dev)
+{
+ int bus;
+
+ if ((pci_get_class(dev) != PCIC_BRIDGE) ||
+ (pci_get_subclass(dev) != PCIS_BRIDGE_PCI))
+ return (ENXIO);
+ bus = pci_read_config(dev, PCIR_SECBUS_1, 1);
+ if (bus == 0)
+ return (ENXIO);
+ if (!pci_pir_probe(bus, 1))
+ return (ENXIO);
+ device_set_desc(dev, "PCIBIOS PCI-PCI bridge");
+ return (-2000);
+}
+
+static int
+pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
+{
+ return (pci_pir_route_interrupt(pci_get_bus(dev), pci_get_slot(dev),
+ pci_get_function(dev), pin));
+}
+#endif /* __rtems__ */
diff --git a/freebsd/sys/sparc64/sparc64/in_cksum.c b/freebsd/sys/sparc64/sparc64/in_cksum.c
index 5490d005..f023f767 100644
--- a/freebsd/sys/sparc64/sparc64/in_cksum.c
+++ b/freebsd/sys/sparc64/sparc64/in_cksum.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -57,18 +57,18 @@
* from: FreeBSD: src/sys/i386/i386/in_cksum.c,v 1.22 2000/11/25
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/mbuf.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
-#include <freebsd/netinet/in.h>
-#include <freebsd/netinet/in_systm.h>
-#include <freebsd/netinet/ip.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
-#include <freebsd/machine/in_cksum.h>
+#include <machine/in_cksum.h>
/*
* Checksum routine for Internet Protocol family headers.
diff --git a/freebsd/sys/sparc64/sparc64/legacy.c b/freebsd/sys/sparc64/sparc64/legacy.c
new file mode 100644
index 00000000..2547990c
--- /dev/null
+++ b/freebsd/sys/sparc64/sparc64/legacy.c
@@ -0,0 +1,347 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright 1998 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby
+ * granted, provided that both the above copyright notice and this
+ * permission notice appear in all copies, that both the above
+ * copyright notice and this permission notice appear in all
+ * supporting documentation, and that the name of M.I.T. not be used
+ * in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission. M.I.T. makes
+ * no representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
+ * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
+ * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * This code implements a system driver for legacy systems that do not
+ * support ACPI or when ACPI support is not present in the kernel.
+ */
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <machine/bus.h>
+#include <sys/pcpu.h>
+#include <sys/rman.h>
+#include <sys/smp.h>
+
+#ifndef __rtems__
+#include <rtems/bsd/local/opt_mca.h>
+#endif /* __rtems__ */
+#ifdef DEV_MCA
+#include <i386/bios/mca_machdep.h>
+#endif
+
+#include <machine/legacyvar.h>
+#include <machine/resource.h>
+
+static MALLOC_DEFINE(M_LEGACYDEV, "legacydrv", "legacy system device");
+struct legacy_device {
+ int lg_pcibus;
+};
+
+#define DEVTOAT(dev) ((struct legacy_device *)device_get_ivars(dev))
+
+static int legacy_probe(device_t);
+static int legacy_attach(device_t);
+static int legacy_print_child(device_t, device_t);
+static device_t legacy_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static int legacy_read_ivar(device_t, device_t, int, uintptr_t *);
+static int legacy_write_ivar(device_t, device_t, int, uintptr_t);
+
+static device_method_t legacy_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, legacy_probe),
+ DEVMETHOD(device_attach, legacy_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, legacy_print_child),
+ DEVMETHOD(bus_add_child, legacy_add_child),
+ DEVMETHOD(bus_read_ivar, legacy_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_write_ivar),
+ DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t legacy_driver = {
+ "legacy",
+ legacy_methods,
+ 1, /* no softc */
+};
+static devclass_t legacy_devclass;
+
+DRIVER_MODULE(legacy, nexus, legacy_driver, legacy_devclass, 0, 0);
+
+static int
+legacy_probe(device_t dev)
+{
+
+ device_set_desc(dev, "legacy system");
+ device_quiet(dev);
+ return (0);
+}
+
+static int
+legacy_attach(device_t dev)
+{
+ device_t child;
+
+ /*
+ * Let our child drivers identify any child devices that they
+ * can find. Once that is done attach any devices that we
+ * found.
+ */
+ bus_generic_probe(dev);
+ bus_generic_attach(dev);
+
+#ifndef PC98
+ /*
+ * If we didn't see EISA or ISA on a pci bridge, create some
+ * connection points now so they show up "on motherboard".
+ */
+ if (!devclass_get_device(devclass_find("eisa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "eisa", 0);
+ if (child == NULL)
+ panic("legacy_attach eisa");
+ device_probe_and_attach(child);
+ }
+#endif
+#ifdef DEV_MCA
+ if (MCA_system && !devclass_get_device(devclass_find("mca"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "mca", 0);
+ if (child == 0)
+ panic("legacy_probe mca");
+ device_probe_and_attach(child);
+ }
+#endif
+ if (!devclass_get_device(devclass_find("isa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "isa", 0);
+ if (child == NULL)
+ panic("legacy_attach isa");
+ device_probe_and_attach(child);
+ }
+
+ return 0;
+}
+
+static int
+legacy_print_child(device_t bus, device_t child)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+ int retval = 0;
+
+ retval += bus_print_child_header(bus, child);
+ if (atdev->lg_pcibus != -1)
+ retval += printf(" pcibus %d", atdev->lg_pcibus);
+ retval += printf(" on motherboard\n"); /* XXX "motherboard", ick */
+
+ return (retval);
+}
+
+static device_t
+legacy_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ device_t child;
+ struct legacy_device *atdev;
+
+ atdev = malloc(sizeof(struct legacy_device), M_LEGACYDEV,
+ M_NOWAIT | M_ZERO);
+ if (atdev == NULL)
+ return(NULL);
+ atdev->lg_pcibus = -1;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child == NULL)
+ free(atdev, M_LEGACYDEV);
+ else
+ /* should we free this in legacy_child_detached? */
+ device_set_ivars(child, atdev);
+
+ return (child);
+}
+
+static int
+legacy_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ *result = 0;
+ break;
+ case LEGACY_IVAR_PCIBUS:
+ *result = atdev->lg_pcibus;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+
+static int
+legacy_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ return EINVAL;
+ case LEGACY_IVAR_PCIBUS:
+ atdev->lg_pcibus = value;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+/*
+ * Legacy CPU attachment when ACPI is not available. Drivers like
+ * cpufreq(4) hang off this.
+ */
+static void cpu_identify(driver_t *driver, device_t parent);
+static int cpu_read_ivar(device_t dev, device_t child, int index,
+ uintptr_t *result);
+static device_t cpu_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static struct resource_list *cpu_get_rlist(device_t dev, device_t child);
+
+struct cpu_device {
+ struct resource_list cd_rl;
+ struct pcpu *cd_pcpu;
+};
+
+static device_method_t cpu_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, cpu_identify),
+ DEVMETHOD(device_probe, bus_generic_probe),
+ DEVMETHOD(device_attach, bus_generic_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_add_child, cpu_add_child),
+ DEVMETHOD(bus_read_ivar, cpu_read_ivar),
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_get_resource_list, cpu_get_rlist),
+ DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
+ DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource),
+ DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource),
+ DEVMETHOD(bus_driver_added, bus_generic_driver_added),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t cpu_driver = {
+ "cpu",
+ cpu_methods,
+ 1, /* no softc */
+};
+static devclass_t cpu_devclass;
+DRIVER_MODULE(cpu, legacy, cpu_driver, cpu_devclass, 0, 0);
+
+static void
+cpu_identify(driver_t *driver, device_t parent)
+{
+ device_t child;
+ int i;
+
+ /*
+ * Attach a cpuX device for each CPU. We use an order of 150
+ * so that these devices are attached after the Host-PCI
+ * bridges (which are added at order 100).
+ */
+ for (i = 0; i <= mp_maxid; i++)
+ if (!CPU_ABSENT(i)) {
+ child = BUS_ADD_CHILD(parent, 150, "cpu", i);
+ if (child == NULL)
+ panic("legacy_attach cpu");
+ }
+}
+
+static device_t
+cpu_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ struct cpu_device *cd;
+ device_t child;
+ struct pcpu *pc;
+
+ if ((cd = malloc(sizeof(*cd), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL)
+ return (NULL);
+
+ resource_list_init(&cd->cd_rl);
+ pc = pcpu_find(device_get_unit(bus));
+ cd->cd_pcpu = pc;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child != NULL) {
+ pc->pc_device = child;
+ device_set_ivars(child, cd);
+ } else
+ free(cd, M_DEVBUF);
+ return (child);
+}
+
+static struct resource_list *
+cpu_get_rlist(device_t dev, device_t child)
+{
+ struct cpu_device *cpdev;
+
+ cpdev = device_get_ivars(child);
+ return (&cpdev->cd_rl);
+}
+
+static int
+cpu_read_ivar(device_t dev, device_t child, int index, uintptr_t *result)
+{
+ struct cpu_device *cpdev;
+
+ if (index != CPU_IVAR_PCPU)
+ return (ENOENT);
+ cpdev = device_get_ivars(child);
+ *result = (uintptr_t)cpdev->cd_pcpu;
+ return (0);
+}
diff --git a/freebsd/sys/sys/_bus_dma.h b/freebsd/sys/sys/_bus_dma.h
index 8d60c957..91318d01 100644
--- a/freebsd/sys/sys/_bus_dma.h
+++ b/freebsd/sys/sys/_bus_dma.h
@@ -27,8 +27,8 @@
*
*/
-#ifndef _SYS__BUS_DMA_HH_
-#define _SYS__BUS_DMA_HH_
+#ifndef _SYS__BUS_DMA_H_
+#define _SYS__BUS_DMA_H_
typedef int bus_dmasync_op_t;
@@ -60,4 +60,4 @@ typedef enum {
typedef void bus_dma_lock_t(void *, bus_dma_lock_op_t);
-#endif /* !_SYS__BUS_DMA_HH_ */
+#endif /* !_SYS__BUS_DMA_H_ */
diff --git a/freebsd/sys/sys/_lock.h b/freebsd/sys/sys/_lock.h
index eb13f2aa..457ffd4d 100644
--- a/freebsd/sys/sys/_lock.h
+++ b/freebsd/sys/sys/_lock.h
@@ -28,9 +28,13 @@
* $FreeBSD$
*/
-#ifndef _SYS__LOCK_HH_
-#define _SYS__LOCK_HH_
+#ifndef _SYS__LOCK_H_
+#define _SYS__LOCK_H_
+#ifdef __rtems__
+#include <rtems.h>
+#include <rtems/chain.h>
+#endif
struct lock_object {
#ifdef __rtems__
rtems_chain_node lo_node;
@@ -44,4 +48,4 @@ struct lock_object {
#endif /* __rtems__ */
};
-#endif /* !_SYS__LOCK_HH_ */
+#endif /* !_SYS__LOCK_H_ */
diff --git a/freebsd/sys/sys/_lockmgr.h b/freebsd/sys/sys/_lockmgr.h
index 616cae4e..0b99e1a4 100644
--- a/freebsd/sys/sys/_lockmgr.h
+++ b/freebsd/sys/sys/_lockmgr.h
@@ -28,11 +28,11 @@
* $FreeBSD$
*/
-#ifndef _SYS__LOCKMGR_HH_
-#define _SYS__LOCKMGR_HH_
+#ifndef _SYS__LOCKMGR_H_
+#define _SYS__LOCKMGR_H_
#ifdef DEBUG_LOCKS
-#include <freebsd/sys/_stack.h>
+#include <sys/_stack.h>
#endif
struct lock {
diff --git a/freebsd/sys/sys/_mutex.h b/freebsd/sys/sys/_mutex.h
index eac45780..9bf2d39f 100644
--- a/freebsd/sys/sys/_mutex.h
+++ b/freebsd/sys/sys/_mutex.h
@@ -28,8 +28,8 @@
* $FreeBSD$
*/
-#ifndef _SYS__MUTEX_HH_
-#define _SYS__MUTEX_HH_
+#ifndef _SYS__MUTEX_H_
+#define _SYS__MUTEX_H_
/*
* Sleep/spin mutex.
@@ -41,4 +41,4 @@ struct mtx {
#endif /* __rtems__ */
};
-#endif /* !_SYS__MUTEX_HH_ */
+#endif /* !_SYS__MUTEX_H_ */
diff --git a/freebsd/sys/sys/_rmlock.h b/freebsd/sys/sys/_rmlock.h
index 87fe1ee8..dba7affd 100644
--- a/freebsd/sys/sys/_rmlock.h
+++ b/freebsd/sys/sys/_rmlock.h
@@ -29,14 +29,14 @@
* $FreeBSD$
*/
-#ifndef _SYS__RMLOCK_HH_
-#define _SYS__RMLOCK_HH_
+#ifndef _SYS__RMLOCK_H_
+#define _SYS__RMLOCK_H_
/*
* XXXUPS remove as soon as we have per cpu variable
* linker sets and can define rm_queue in _rm_lock.h
*/
-#include <freebsd/sys/pcpu.h>
+#include <sys/pcpu.h>
/*
* Mostly reader/occasional writer lock.
*/
@@ -52,7 +52,7 @@ struct rmlock {
};
#else /* __rtems__ */
- #include <freebsd/sys/rwlock.h>
+ #include <sys/rwlock.h>
#define rmlock rwlock
#endif /* __rtems__ */
@@ -64,4 +64,4 @@ struct rm_priotracker {
LIST_ENTRY(rm_priotracker) rmp_qentry;
};
-#endif /* !_SYS__RMLOCK_HH_ */
+#endif /* !_SYS__RMLOCK_H_ */
diff --git a/freebsd/sys/sys/_rwlock.h b/freebsd/sys/sys/_rwlock.h
index 536ba1dd..c5adac0e 100644
--- a/freebsd/sys/sys/_rwlock.h
+++ b/freebsd/sys/sys/_rwlock.h
@@ -29,8 +29,8 @@
* $FreeBSD$
*/
-#ifndef _SYS__RWLOCK_HH_
-#define _SYS__RWLOCK_HH_
+#ifndef _SYS__RWLOCK_H_
+#define _SYS__RWLOCK_H_
/*
* Reader/writer lock.
@@ -40,4 +40,4 @@ struct rwlock {
volatile uintptr_t rw_lock;
};
-#endif /* !_SYS__RWLOCK_HH_ */
+#endif /* !_SYS__RWLOCK_H_ */
diff --git a/freebsd/sys/sys/_semaphore.h b/freebsd/sys/sys/_semaphore.h
index e0d5eff2..df3c5da1 100644
--- a/freebsd/sys/sys/_semaphore.h
+++ b/freebsd/sys/sys/_semaphore.h
@@ -25,15 +25,15 @@
*
* $FreeBSD$
*/
-#ifndef __SEMAPHORE_HH_
-#define __SEMAPHORE_HH_
+#ifndef __SEMAPHORE_H_
+#define __SEMAPHORE_H_
typedef intptr_t semid_t;
struct timespec;
#ifndef _KERNEL
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
/*
* Semaphore definitions.
@@ -70,4 +70,4 @@ __END_DECLS
#endif /* !_KERNEL */
-#endif /* __SEMAPHORE_HH_ */
+#endif /* __SEMAPHORE_H_ */
diff --git a/freebsd/sys/sys/_sigset.h b/freebsd/sys/sys/_sigset.h
index 52028110..06826701 100644
--- a/freebsd/sys/sys/_sigset.h
+++ b/freebsd/sys/sys/_sigset.h
@@ -35,8 +35,8 @@
* $FreeBSD$
*/
-#ifndef _SYS__SIGSET_HH_
-#define _SYS__SIGSET_HH_
+#ifndef _SYS__SIGSET_H_
+#define _SYS__SIGSET_H_
/*
* sigset_t macros.
@@ -56,4 +56,4 @@ typedef struct __sigset {
typedef unsigned int osigset_t;
#endif
-#endif /* !_SYS__SIGSET_HH_ */
+#endif /* !_SYS__SIGSET_H_ */
diff --git a/freebsd/sys/sys/_sx.h b/freebsd/sys/sys/_sx.h
index ff8f821e..699316b6 100644
--- a/freebsd/sys/sys/_sx.h
+++ b/freebsd/sys/sys/_sx.h
@@ -28,8 +28,8 @@
* $FreeBSD$
*/
-#ifndef _SYS__SX_HH_
-#define _SYS__SX_HH_
+#ifndef _SYS__SX_H_
+#define _SYS__SX_H_
/*
* Shared/exclusive lock main structure definition.
@@ -41,4 +41,4 @@ struct sx {
#endif /* __rtems__ */
};
-#endif /* !_SYS__SX_HH_ */
+#endif /* !_SYS__SX_H_ */
diff --git a/freebsd/sys/sys/_task.h b/freebsd/sys/sys/_task.h
index efea7fc8..2a51e1b0 100644
--- a/freebsd/sys/sys/_task.h
+++ b/freebsd/sys/sys/_task.h
@@ -26,10 +26,10 @@
* $FreeBSD$
*/
-#ifndef _SYS__TASK_HH_
-#define _SYS__TASK_HH_
+#ifndef _SYS__TASK_H_
+#define _SYS__TASK_H_
-#include <freebsd/sys/queue.h>
+#include <sys/queue.h>
/*
* Each task includes a function which is called from
@@ -47,4 +47,4 @@ struct task {
void *ta_context; /* argument for handler */
};
-#endif /* !_SYS__TASK_HH_ */
+#endif /* !_SYS__TASK_H_ */
diff --git a/freebsd/sys/sys/_timeval.h b/freebsd/sys/sys/_timeval.h
index 936ffd88..c1edd5c8 100644
--- a/freebsd/sys/sys/_timeval.h
+++ b/freebsd/sys/sys/_timeval.h
@@ -1 +1,56 @@
-/* EMPTY */
+/*-
+ * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _SYS__TIMEVAL_H_
+#define _SYS__TIMEVAL_H_
+
+#ifndef __rtems__
+#include <rtems/bsd/sys/_types.h>
+
+#ifndef _SUSECONDS_T_DECLARED
+typedef __suseconds_t suseconds_t;
+#define _SUSECONDS_T_DECLARED
+#endif
+
+#ifndef _TIME_T_DECLARED
+typedef __time_t time_t;
+#define _TIME_T_DECLARED
+#endif
+
+/*
+ * Structure returned by gettimeofday(2) system call, and used in other calls.
+ */
+struct timeval {
+ time_t tv_sec; /* seconds */
+ suseconds_t tv_usec; /* and microseconds */
+};
+#else /* __rtems__ */
+#include <rtems/bsd/sys/time.h>
+#endif /* __rtems__ */
+
+#endif /* !_SYS__TIMEVAL_H_ */
diff --git a/freebsd/sys/sys/acl.h b/freebsd/sys/sys/acl.h
index f8c20c73..ec2e025b 100644
--- a/freebsd/sys/sys/acl.h
+++ b/freebsd/sys/sys/acl.h
@@ -33,12 +33,12 @@
* Support for POSIX.1e and NFSv4 access control lists.
*/
-#ifndef _SYS_ACL_HH_
-#define _SYS_ACL_HH_
+#ifndef _SYS_ACL_H_
+#define _SYS_ACL_H_
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/vm/uma.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <vm/uma.h>
/*
* POSIX.1e and NFSv4 ACL types and related constants.
@@ -404,4 +404,4 @@ __END_DECLS
#endif /* !_KERNEL */
-#endif /* !_SYS_ACL_HH_ */
+#endif /* !_SYS_ACL_H_ */
diff --git a/freebsd/sys/sys/aio.h b/freebsd/sys/sys/aio.h
index cff3d78c..03f6b34e 100644
--- a/freebsd/sys/sys/aio.h
+++ b/freebsd/sys/sys/aio.h
@@ -16,11 +16,11 @@
* $FreeBSD$
*/
-#ifndef _SYS_AIO_HH_
-#define _SYS_AIO_HH_
+#ifndef _SYS_AIO_H_
+#define _SYS_AIO_H_
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/signal.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/signal.h>
/*
* Returned by aio_cancel:
diff --git a/freebsd/sys/sys/ata.h b/freebsd/sys/sys/ata.h
index df4cea71..cacb1ea0 100644
--- a/freebsd/sys/sys/ata.h
+++ b/freebsd/sys/sys/ata.h
@@ -26,10 +26,10 @@
* $FreeBSD$
*/
-#ifndef _SYS_ATA_HH_
-#define _SYS_ATA_HH_
+#ifndef _SYS_ATA_H_
+#define _SYS_ATA_H_
-#include <freebsd/sys/ioccom.h>
+#include <sys/ioccom.h>
/* ATA/ATAPI device parameters */
struct ata_params {
@@ -557,4 +557,4 @@ struct ata_ioc_raid_status {
#define IOCATARAIDADDSPARE _IOW('a', 203, struct ata_ioc_raid_config)
#define IOCATARAIDREBUILD _IOW('a', 204, int)
-#endif /* _SYS_ATA_HH_ */
+#endif /* _SYS_ATA_H_ */
diff --git a/freebsd/sys/sys/bitstring.h b/freebsd/sys/sys/bitstring.h
index a2b70ba8..125ef51d 100644
--- a/freebsd/sys/sys/bitstring.h
+++ b/freebsd/sys/sys/bitstring.h
@@ -32,8 +32,8 @@
* $FreeBSD$
*/
-#ifndef _SYS_BITSTRING_HH_
-#define _SYS_BITSTRING_HH_
+#ifndef _SYS_BITSTRING_H_
+#define _SYS_BITSTRING_H_
typedef unsigned char bitstr_t;
@@ -143,4 +143,4 @@ typedef unsigned char bitstr_t;
*(value) = _value; \
} while (0)
-#endif /* !_SYS_BITSTRING_HH_ */
+#endif /* !_SYS_BITSTRING_H_ */
diff --git a/freebsd/sys/sys/buf.h b/freebsd/sys/sys/buf.h
index 88e55d95..6cc68ee9 100644
--- a/freebsd/sys/sys/buf.h
+++ b/freebsd/sys/sys/buf.h
@@ -35,13 +35,13 @@
* $FreeBSD$
*/
-#ifndef _SYS_BUF_HH_
-#define _SYS_BUF_HH_
+#ifndef _SYS_BUF_H_
+#define _SYS_BUF_H_
-#include <freebsd/sys/bufobj.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/lockmgr.h>
+#include <sys/bufobj.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/lockmgr.h>
struct bio;
struct buf;
@@ -255,8 +255,8 @@ struct buf {
*/
extern const char *buf_wmesg; /* Default buffer lock message */
#define BUF_WMESG "bufwait"
-#include <freebsd/sys/proc.h> /* XXX for curthread */
-#include <freebsd/sys/mutex.h>
+#include <sys/proc.h> /* XXX for curthread */
+#include <sys/mutex.h>
/*
* Initialize a lock.
@@ -333,7 +333,7 @@ extern const char *buf_wmesg; /* Default buffer lock message */
#define BUF_ASSERT_UNHELD(bp)
#endif
-#ifdef _SYS_PROC_HH_ /* Avoid #include <freebsd/sys/proc.h> pollution */
+#ifdef _SYS_PROC_H_ /* Avoid #include <sys/proc.h> pollution */
/*
* When initiating asynchronous I/O, change ownership of the lock to the
* kernel. Once done, the lock may legally released by biodone. The
@@ -523,4 +523,4 @@ void bunpin_wait(struct buf *);
#endif /* _KERNEL */
-#endif /* !_SYS_BUF_HH_ */
+#endif /* !_SYS_BUF_H_ */
diff --git a/freebsd/sys/sys/buf_ring.h b/freebsd/sys/sys/buf_ring.h
index dbdf6206..59853e42 100644
--- a/freebsd/sys/sys/buf_ring.h
+++ b/freebsd/sys/sys/buf_ring.h
@@ -27,18 +27,18 @@
*
*/
-#ifndef _SYS_BUF_RING_HH_
-#define _SYS_BUF_RING_HH_
+#ifndef _SYS_BUF_RING_H_
+#define _SYS_BUF_RING_H_
-#include <freebsd/machine/cpu.h>
+#include <machine/cpu.h>
#if defined(INVARIANTS) && !defined(DEBUG_BUFRING)
#define DEBUG_BUFRING 1
#endif
#ifdef DEBUG_BUFRING
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
#endif
struct buf_ring {
diff --git a/freebsd/sys/sys/bufobj.h b/freebsd/sys/sys/bufobj.h
index 896e4ff8..916b2565 100644
--- a/freebsd/sys/sys/bufobj.h
+++ b/freebsd/sys/sys/bufobj.h
@@ -46,14 +46,14 @@
* once things starts to crystalize.
*/
-#ifndef _SYS_BUFOBJ_HH_
-#define _SYS_BUFOBJ_HH_
+#ifndef _SYS_BUFOBJ_H_
+#define _SYS_BUFOBJ_H_
#if defined(_KERNEL) || defined(_KVM_VNODE)
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/_lock.h>
-#include <freebsd/sys/_mutex.h>
+#include <sys/queue.h>
+#include <sys/_lock.h>
+#include <sys/_mutex.h>
struct bufobj;
struct buf_ops;
@@ -128,4 +128,4 @@ int bufsync(struct bufobj *bo, int waitfor);
void bufbdflush(struct bufobj *bo, struct buf *bp);
#endif /* defined(_KERNEL) || defined(_KVM_VNODE) */
-#endif /* _SYS_BUFOBJ_HH_ */
+#endif /* _SYS_BUFOBJ_H_ */
diff --git a/freebsd/sys/sys/bus.h b/freebsd/sys/sys/bus.h
index 8dc54d08..6c1128e3 100644
--- a/freebsd/sys/sys/bus.h
+++ b/freebsd/sys/sys/bus.h
@@ -26,11 +26,11 @@
* $FreeBSD$
*/
-#ifndef _SYS_BUS_HH_
-#define _SYS_BUS_HH_
+#ifndef _SYS_BUS_H_
+#define _SYS_BUS_H_
-#include <freebsd/machine/_limits.h>
-#include <freebsd/sys/_bus_dma.h>
+#include <machine/_limits.h>
+#include <sys/_bus_dma.h>
/**
* @defgroup NEWBUS newbus - a generic framework for managing devices
@@ -76,8 +76,8 @@ struct u_device {
#ifdef _KERNEL
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/kobj.h>
+#include <sys/queue.h>
+#include <sys/kobj.h>
/**
* devctl hooks. Typically one should use the devctl_notify
@@ -547,8 +547,8 @@ void bus_set_pass(int pass);
/*
* Some common device interfaces.
*/
-#include <freebsd/local/device_if.h>
-#include <freebsd/local/bus_if.h>
+#include <rtems/bsd/local/device_if.h>
+#include <rtems/bsd/local/bus_if.h>
struct module;
@@ -745,4 +745,4 @@ static __inline void varp ## _set_ ## var(device_t dev, type t) \
bus_space_write_region_stream_8((r)->r_bustag, (r)->r_bushandle, (o), (d), (c))
#endif /* _KERNEL */
-#endif /* !_SYS_BUS_HH_ */
+#endif /* !_SYS_BUS_H_ */
diff --git a/freebsd/sys/sys/bus_dma.h b/freebsd/sys/sys/bus_dma.h
index 1bcde10a..0dad3267 100644
--- a/freebsd/sys/sys/bus_dma.h
+++ b/freebsd/sys/sys/bus_dma.h
@@ -69,10 +69,10 @@
*/
/* $FreeBSD$ */
-#ifndef _BUS_DMA_HH_
-#define _BUS_DMA_HH_
+#ifndef _BUS_DMA_H_
+#define _BUS_DMA_H_
-#include <freebsd/sys/_bus_dma.h>
+#include <sys/_bus_dma.h>
/*
* Machine independent interface for mapping physical addresses to peripheral
@@ -274,4 +274,4 @@ void _bus_dmamap_unload(bus_dma_tag_t dmat, bus_dmamap_t map);
#endif /* __sparc64__ */
-#endif /* _BUS_DMA_HH_ */
+#endif /* _BUS_DMA_H_ */
diff --git a/freebsd/sys/sys/callout.h b/freebsd/sys/sys/callout.h
index 4686a4db..2d43d149 100644
--- a/freebsd/sys/sys/callout.h
+++ b/freebsd/sys/sys/callout.h
@@ -35,10 +35,10 @@
* $FreeBSD$
*/
-#ifndef _SYS_CALLOUT_HH_
-#define _SYS_CALLOUT_HH_
+#ifndef _SYS_CALLOUT_H_
+#define _SYS_CALLOUT_H_
-#include <freebsd/sys/queue.h>
+#include <sys/queue.h>
struct lock_object;
@@ -100,4 +100,4 @@ void callout_tick(void);
#endif
-#endif /* _SYS_CALLOUT_HH_ */
+#endif /* _SYS_CALLOUT_H_ */
diff --git a/freebsd/sys/sys/condvar.h b/freebsd/sys/sys/condvar.h
index 54cfe9eb..51da8170 100644
--- a/freebsd/sys/sys/condvar.h
+++ b/freebsd/sys/sys/condvar.h
@@ -26,11 +26,11 @@
* $FreeBSD$
*/
-#ifndef _SYS_CONDVAR_HH_
-#define _SYS_CONDVAR_HH_
+#ifndef _SYS_CONDVAR_H_
+#define _SYS_CONDVAR_H_
#ifndef LOCORE
-#include <freebsd/sys/queue.h>
+#include <sys/queue.h>
struct lock_object;
struct thread;
@@ -43,6 +43,10 @@ TAILQ_HEAD(cv_waitq, thread);
* and is held across calls to cv_signal() and cv_broadcast(). It is an
* optimization to avoid looking up the sleep queue if there are no waiters.
*/
+#ifdef __rtems__
+#include <pthread.h>
+#include <rtems/chain.h>
+#endif
struct cv {
#ifdef __rtems__
rtems_chain_node cv_node;
@@ -84,4 +88,4 @@ void cv_broadcastpri(struct cv *cvp, int pri);
#endif /* _KERNEL */
#endif /* !LOCORE */
-#endif /* _SYS_CONDVAR_HH_ */
+#endif /* _SYS_CONDVAR_H_ */
diff --git a/freebsd/sys/sys/conf.h b/freebsd/sys/sys/conf.h
index 86e29c4d..694bbb36 100644
--- a/freebsd/sys/sys/conf.h
+++ b/freebsd/sys/sys/conf.h
@@ -37,13 +37,13 @@
* $FreeBSD$
*/
-#ifndef _SYS_CONF_HH_
-#define _SYS_CONF_HH_
+#ifndef _SYS_CONF_H_
+#define _SYS_CONF_H_
#ifdef _KERNEL
-#include <freebsd/sys/eventhandler.h>
+#include <sys/eventhandler.h>
#else
-#include <freebsd/sys/queue.h>
+#include <sys/queue.h>
#endif
struct snapdata;
@@ -348,4 +348,4 @@ extern int dumping; /* system is dumping */
#endif /* _KERNEL */
-#endif /* !_SYS_CONF_HH_ */
+#endif /* !_SYS_CONF_H_ */
diff --git a/freebsd/sys/sys/cpu.h b/freebsd/sys/sys/cpu.h
index 3e6729db..c16091e1 100644
--- a/freebsd/sys/sys/cpu.h
+++ b/freebsd/sys/sys/cpu.h
@@ -26,10 +26,10 @@
* $FreeBSD$
*/
-#ifndef _SYS_CPU_HH_
-#define _SYS_CPU_HH_
+#ifndef _SYS_CPU_H_
+#define _SYS_CPU_H_
-#include <freebsd/sys/eventhandler.h>
+#include <sys/eventhandler.h>
/*
* CPU device support.
@@ -170,4 +170,4 @@ EVENTHANDLER_DECLARE(cpufreq_levels_changed, cpufreq_levels_notify_fn);
/* Estimate the current clock rate for the given CPU id. */
int cpu_est_clockrate(int cpu_id, uint64_t *rate);
-#endif /* !_SYS_CPU_HH_ */
+#endif /* !_SYS_CPU_H_ */
diff --git a/freebsd/sys/sys/ctype.h b/freebsd/sys/sys/ctype.h
index b7b4ad5a..5022d40c 100644
--- a/freebsd/sys/sys/ctype.h
+++ b/freebsd/sys/sys/ctype.h
@@ -34,8 +34,8 @@
* $FreeBSD$
*/
-#ifndef _SYS_CTYPE_HH_
-#define _SYS_CTYPE_HH_
+#ifndef _SYS_CTYPE_H_
+#define _SYS_CTYPE_H_
#ifdef _KERNEL
@@ -54,4 +54,4 @@
#define tolower(c) ((c) + 0x20 * (((c) >= 'A') && ((c) <= 'Z')))
#endif
-#endif /* !_SYS_CTYPE_HH_ */
+#endif /* !_SYS_CTYPE_H_ */
diff --git a/freebsd/sys/sys/domain.h b/freebsd/sys/sys/domain.h
index 0b44e9fd..2563cb6e 100644
--- a/freebsd/sys/sys/domain.h
+++ b/freebsd/sys/sys/domain.h
@@ -30,8 +30,8 @@
* $FreeBSD$
*/
-#ifndef _SYS_DOMAIN_HH_
-#define _SYS_DOMAIN_HH_
+#ifndef _SYS_DOMAIN_H_
+#define _SYS_DOMAIN_H_
/*
* Structure per communications domain.
@@ -103,4 +103,4 @@ void vnet_domain_uninit(void *);
#endif /* _KERNEL */
-#endif /* !_SYS_DOMAIN_HH_ */
+#endif /* !_SYS_DOMAIN_H_ */
diff --git a/freebsd/sys/sys/endian.h b/freebsd/sys/sys/endian.h
index 5c95d748..921fac41 100644
--- a/freebsd/sys/sys/endian.h
+++ b/freebsd/sys/sys/endian.h
@@ -26,12 +26,12 @@
* $FreeBSD$
*/
-#ifndef _SYS_ENDIAN_HH_
-#define _SYS_ENDIAN_HH_
+#ifndef _SYS_ENDIAN_H_
+#define _SYS_ENDIAN_H_
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/_types.h>
-#include <freebsd/machine/endian.h>
+#include <sys/cdefs.h>
+#include <rtems/bsd/sys/_types.h>
+#include <machine/rtems-bsd-endian.h>
#ifndef _UINT16_T_DECLARED
typedef __uint16_t uint16_t;
@@ -197,4 +197,4 @@ le64enc(void *pp, uint64_t u)
le32enc(p + 4, u >> 32);
}
-#endif /* _SYS_ENDIAN_HH_ */
+#endif /* _SYS_ENDIAN_H_ */
diff --git a/freebsd/sys/sys/event.h b/freebsd/sys/sys/event.h
index 1af716d7..d92eb55d 100644
--- a/freebsd/sys/sys/event.h
+++ b/freebsd/sys/sys/event.h
@@ -26,10 +26,10 @@
* $FreeBSD$
*/
-#ifndef _SYS_EVENT_HH_
-#define _SYS_EVENT_HH_
+#ifndef _SYS_EVENT_H_
+#define _SYS_EVENT_H_
-#include <freebsd/sys/queue.h>
+#include <sys/queue.h>
#define EVFILT_READ (-1)
#define EVFILT_WRITE (-2)
@@ -264,7 +264,7 @@ extern int kqueue_del_filteropts(int filt);
#else /* !_KERNEL */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
struct timespec;
__BEGIN_DECLS
@@ -276,4 +276,4 @@ __END_DECLS
#endif /* !_KERNEL */
-#endif /* !_SYS_EVENT_HH_ */
+#endif /* !_SYS_EVENT_H_ */
diff --git a/freebsd/sys/sys/eventhandler.h b/freebsd/sys/sys/eventhandler.h
index 1472df18..0da999d0 100644
--- a/freebsd/sys/sys/eventhandler.h
+++ b/freebsd/sys/sys/eventhandler.h
@@ -29,10 +29,10 @@
#ifndef SYS_EVENTHANDLER_H
#define SYS_EVENTHANDLER_H
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/ktr.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/queue.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/ktr.h>
+#include <sys/mutex.h>
+#include <sys/queue.h>
struct eventhandler_entry {
TAILQ_ENTRY(eventhandler_entry) ee_link;
diff --git a/freebsd/sys/sys/eventvar.h b/freebsd/sys/sys/eventvar.h
index 8712cfdc..bdb3adf5 100644
--- a/freebsd/sys/sys/eventvar.h
+++ b/freebsd/sys/sys/eventvar.h
@@ -26,14 +26,14 @@
* $FreeBSD$
*/
-#ifndef _SYS_EVENTVAR_HH_
-#define _SYS_EVENTVAR_HH_
+#ifndef _SYS_EVENTVAR_H_
+#define _SYS_EVENTVAR_H_
#ifndef _KERNEL
#error "no user-servicable parts inside"
#endif
-#include <freebsd/sys/_task.h>
+#include <sys/_task.h>
#define KQ_NEVENTS 8 /* minimize copy{in,out} calls */
#define KQEXTENT 256 /* linear growth by this amount */
@@ -62,4 +62,4 @@ struct kqueue {
struct task kq_task;
};
-#endif /* !_SYS_EVENTVAR_HH_ */
+#endif /* !_SYS_EVENTVAR_H_ */
diff --git a/freebsd/sys/sys/fcntl.h b/freebsd/sys/sys/fcntl.h
index 82646c7f..00f79279 100644
--- a/freebsd/sys/sys/fcntl.h
+++ b/freebsd/sys/sys/fcntl.h
@@ -35,8 +35,8 @@
* $FreeBSD$
*/
-#ifndef _SYS_FCNTL_HH_
-#define _SYS_FCNTL_HH_
+#ifndef _SYS_FCNTL_H_
+#define _SYS_FCNTL_H_
/*
* This file includes the definitions for open and fcntl
@@ -44,8 +44,8 @@
* related kernel definitions.
*/
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/_types.h>
+#include <sys/cdefs.h>
+#include <rtems/bsd/sys/_types.h>
#ifndef _MODE_T_DECLARED
typedef __mode_t mode_t;
@@ -293,4 +293,4 @@ int flock(int, int);
__END_DECLS
#endif
-#endif /* !_SYS_FCNTL_HH_ */
+#endif /* !_SYS_FCNTL_H_ */
diff --git a/freebsd/sys/sys/file.h b/freebsd/sys/sys/file.h
index 21b8e413..5ba6aee2 100644
--- a/freebsd/sys/sys/file.h
+++ b/freebsd/sys/sys/file.h
@@ -30,18 +30,18 @@
* $FreeBSD$
*/
-#ifndef _SYS_FILE_HH_
-#define _SYS_FILE_HH_
+#ifndef _SYS_FILE_H_
+#define _SYS_FILE_H_
#ifndef _KERNEL
-#include <freebsd/sys/types.h> /* XXX */
-#include <freebsd/sys/fcntl.h>
-#include <freebsd/sys/unistd.h>
+#include <rtems/bsd/sys/types.h> /* XXX */
+#include <sys/fcntl.h>
+#include <rtems/bsd/sys/unistd.h>
#else
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/refcount.h>
-#include <freebsd/sys/_lock.h>
-#include <freebsd/sys/_mutex.h>
+#include <sys/queue.h>
+#include <sys/refcount.h>
+#include <sys/_lock.h>
+#include <sys/_mutex.h>
struct stat;
struct thread;
diff --git a/freebsd/sys/sys/filedesc.h b/freebsd/sys/sys/filedesc.h
index fab6d93b..718f2e8b 100644
--- a/freebsd/sys/sys/filedesc.h
+++ b/freebsd/sys/sys/filedesc.h
@@ -30,16 +30,16 @@
* $FreeBSD$
*/
-#ifndef _SYS_FILEDESC_HH_
-#define _SYS_FILEDESC_HH_
+#ifndef _SYS_FILEDESC_H_
+#define _SYS_FILEDESC_H_
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/event.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/priority.h>
-#include <freebsd/sys/sx.h>
+#include <sys/queue.h>
+#include <sys/event.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/priority.h>
+#include <sys/sx.h>
-#include <freebsd/machine/_limits.h>
+#include <machine/_limits.h>
/*
* This structure is used for the management of descriptors. It may be
@@ -142,4 +142,4 @@ fget_locked(struct filedesc *fdp, int fd)
#endif /* _KERNEL */
-#endif /* !_SYS_FILEDESC_HH_ */
+#endif /* !_SYS_FILEDESC_H_ */
diff --git a/freebsd/sys/sys/filio.h b/freebsd/sys/sys/filio.h
index 899d3458..1710ba45 100644
--- a/freebsd/sys/sys/filio.h
+++ b/freebsd/sys/sys/filio.h
@@ -35,10 +35,10 @@
* $FreeBSD$
*/
-#ifndef _SYS_FILIO_HH_
-#define _SYS_FILIO_HH_
+#ifndef _SYS_FILIO_H_
+#define _SYS_FILIO_H_
-#include <freebsd/sys/ioccom.h>
+#include <sys/ioccom.h>
/* Generic file-descriptor ioctl's. */
#define FIOCLEX _IO('f', 1) /* set close on exec on fd */
@@ -61,4 +61,4 @@ struct fiodgname_arg {
#define FIOSEEKDATA _IOWR('f', 97, off_t) /* SEEK_DATA */
#define FIOSEEKHOLE _IOWR('f', 98, off_t) /* SEEK_HOLE */
-#endif /* !_SYS_FILIO_HH_ */
+#endif /* !_SYS_FILIO_H_ */
diff --git a/freebsd/sys/sys/hash.h b/freebsd/sys/sys/hash.h
index 91dd4fcc..fcbe6b69 100644
--- a/freebsd/sys/sys/hash.h
+++ b/freebsd/sys/sys/hash.h
@@ -26,9 +26,9 @@
* $FreeBSD$
*/
-#ifndef _SYS_HASH_HH_
-#define _SYS_HASH_HH_
-#include <freebsd/sys/types.h>
+#ifndef _SYS_HASH_H_
+#define _SYS_HASH_H_
+#include <rtems/bsd/sys/types.h>
/* Convenience */
#ifndef HASHINIT
@@ -118,4 +118,4 @@ hash32_strne(const void *buf, size_t len, int end, const char **ep,
return hash;
}
-#endif /* !_SYS_HASH_HH_ */
+#endif /* !_SYS_HASH_H_ */
diff --git a/freebsd/sys/sys/interrupt.h b/freebsd/sys/sys/interrupt.h
index e43d0047..c1df1c76 100644
--- a/freebsd/sys/sys/interrupt.h
+++ b/freebsd/sys/sys/interrupt.h
@@ -26,11 +26,11 @@
* $FreeBSD$
*/
-#ifndef _SYS_INTERRUPT_HH_
-#define _SYS_INTERRUPT_HH_
+#ifndef _SYS_INTERRUPT_H_
+#define _SYS_INTERRUPT_H_
-#include <freebsd/sys/_lock.h>
-#include <freebsd/sys/_mutex.h>
+#include <sys/_lock.h>
+#include <sys/_mutex.h>
struct intr_event;
struct intr_thread;
diff --git a/freebsd/sys/sys/jail.h b/freebsd/sys/sys/jail.h
index f501c0b2..2e259f24 100644
--- a/freebsd/sys/sys/jail.h
+++ b/freebsd/sys/sys/jail.h
@@ -27,8 +27,8 @@
* $FreeBSD$
*/
-#ifndef _SYS_JAIL_HH_
-#define _SYS_JAIL_HH_
+#ifndef _SYS_JAIL_H_
+#define _SYS_JAIL_H_
#ifdef _KERNEL
struct jail_v0 {
@@ -116,11 +116,11 @@ int jail_remove(int);
#else /* _KERNEL */
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/_task.h>
+#include <sys/queue.h>
+#include <sys/sysctl.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/_task.h>
#define JAIL_MAX 999999
@@ -131,7 +131,7 @@ MALLOC_DECLARE(M_PRISON);
#if defined(_KERNEL) || defined(_WANT_PRISON)
-#include <freebsd/sys/osd.h>
+#include <sys/osd.h>
#define HOSTUUIDLEN 64
@@ -382,4 +382,4 @@ int prison_priv_check(struct ucred *cred, int priv);
int sysctl_jail_param(struct sysctl_oid *, void *, int , struct sysctl_req *);
#endif /* _KERNEL */
-#endif /* !_SYS_JAIL_HH_ */
+#endif /* !_SYS_JAIL_H_ */
diff --git a/freebsd/sys/sys/kenv.h b/freebsd/sys/sys/kenv.h
index 497eb2f2..0a30ddb3 100644
--- a/freebsd/sys/sys/kenv.h
+++ b/freebsd/sys/sys/kenv.h
@@ -26,8 +26,8 @@
* $FreeBSD$
*/
-#ifndef _SYS_KENV_HH_
-#define _SYS_KENV_HH_
+#ifndef _SYS_KENV_H_
+#define _SYS_KENV_H_
/*
* Constants for the kenv(2) syscall
@@ -40,4 +40,4 @@
#define KENV_MNAMELEN 128 /* Maximum name length (for the syscall) */
#define KENV_MVALLEN 128 /* Maximum value length (for the syscall) */
-#endif /* !_SYS_KENV_HH_ */
+#endif /* !_SYS_KENV_H_ */
diff --git a/freebsd/sys/sys/kernel.h b/freebsd/sys/sys/kernel.h
index 2bcc58ed..e2cc2678 100644
--- a/freebsd/sys/sys/kernel.h
+++ b/freebsd/sys/sys/kernel.h
@@ -42,15 +42,15 @@
* $FreeBSD$
*/
-#ifndef _SYS_KERNEL_HH_
-#define _SYS_KERNEL_HH_
+#ifndef _SYS_KERNEL_H_
+#define _SYS_KERNEL_H_
-#include <freebsd/sys/linker_set.h>
+#include <sys/linker_set.h>
#ifdef _KERNEL
/* for intrhook below */
-#include <freebsd/sys/queue.h>
+#include <sys/queue.h>
/* Global variables for the kernel. */
@@ -421,4 +421,4 @@ struct intr_config_hook {
int config_intrhook_establish(struct intr_config_hook *hook);
void config_intrhook_disestablish(struct intr_config_hook *hook);
-#endif /* !_SYS_KERNEL_HH_*/
+#endif /* !_SYS_KERNEL_H_*/
diff --git a/freebsd/sys/sys/kobj.h b/freebsd/sys/sys/kobj.h
index 385159aa..3143bea4 100644
--- a/freebsd/sys/sys/kobj.h
+++ b/freebsd/sys/sys/kobj.h
@@ -26,8 +26,8 @@
* $FreeBSD$
*/
-#ifndef _SYS_KOBJ_HH_
-#define _SYS_KOBJ_HH_
+#ifndef _SYS_KOBJ_H_
+#define _SYS_KOBJ_H_
/*
* Forward declarations
@@ -254,4 +254,4 @@ kobj_method_t* kobj_lookup_method(kobj_class_t cls,
*/
int kobj_error_method(void);
-#endif /* !_SYS_KOBJ_HH_ */
+#endif /* !_SYS_KOBJ_H_ */
diff --git a/freebsd/sys/sys/kthread.h b/freebsd/sys/sys/kthread.h
index 6fe442e3..390463f3 100644
--- a/freebsd/sys/sys/kthread.h
+++ b/freebsd/sys/sys/kthread.h
@@ -26,10 +26,10 @@
* $FreeBSD$
*/
-#ifndef _SYS_KTHREAD_HH_
-#define _SYS_KTHREAD_HH_
+#ifndef _SYS_KTHREAD_H_
+#define _SYS_KTHREAD_H_
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
/*-
* A kernel process descriptor; used to start "internal" daemons.
@@ -76,4 +76,4 @@ int kthread_suspend(struct thread *, int);
void kthread_suspend_check(struct thread *);
-#endif /* !_SYS_KTHREAD_HH_ */
+#endif /* !_SYS_KTHREAD_H_ */
diff --git a/freebsd/sys/sys/ktr.h b/freebsd/sys/sys/ktr.h
index 3942b92e..5fbe2947 100644
--- a/freebsd/sys/sys/ktr.h
+++ b/freebsd/sys/sys/ktr.h
@@ -33,8 +33,8 @@
* Wraparound kernel trace buffer support.
*/
-#ifndef _SYS_KTR_HH_
-#define _SYS_KTR_HH_
+#ifndef _SYS_KTR_H_
+#define _SYS_KTR_H_
/*
* Trace classes
@@ -279,4 +279,4 @@ void ktr_tracepoint(u_int mask, const char *file, int line,
#endif /* !LOCORE */
-#endif /* !_SYS_KTR_HH_ */
+#endif /* !_SYS_KTR_H_ */
diff --git a/freebsd/sys/sys/libkern.h b/freebsd/sys/sys/libkern.h
index 943ac34b..4675caa3 100644
--- a/freebsd/sys/sys/libkern.h
+++ b/freebsd/sys/sys/libkern.h
@@ -30,13 +30,13 @@
* $FreeBSD$
*/
-#ifndef _SYS_LIBKERN_HH_
-#define _SYS_LIBKERN_HH_
+#ifndef _SYS_LIBKERN_H_
+#define _SYS_LIBKERN_H_
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/types.h>
+#include <sys/cdefs.h>
+#include <rtems/bsd/sys/types.h>
#ifdef _KERNEL
-#include <freebsd/sys/systm.h>
+#include <sys/systm.h>
#endif
#ifndef __rtems__
@@ -192,4 +192,4 @@ strrchr(const char *p, int ch)
#define FNM_IGNORECASE FNM_CASEFOLD
#define FNM_FILE_NAME FNM_PATHNAME
-#endif /* !_SYS_LIBKERN_HH_ */
+#endif /* !_SYS_LIBKERN_H_ */
diff --git a/freebsd/sys/sys/limits.h b/freebsd/sys/sys/limits.h
index b2850e20..633a7f70 100644
--- a/freebsd/sys/sys/limits.h
+++ b/freebsd/sys/sys/limits.h
@@ -1,9 +1,104 @@
-#include <sys/types.h>
-#include <limits.h>
+/*-
+ * Copyright (c) 1988, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
-#define __FD_SETSIZE 1024
-#define FD_SETSIZE __FD_SETSIZE
+#ifndef _SYS_LIMITS_H_
+#define _SYS_LIMITS_H_
-#define __CHAR_BIT CHAR_BIT /* number of bits in a char */
+#include <sys/cdefs.h>
+#include <machine/_limits.h>
+#ifndef __rtems__
+#define CHAR_BIT __CHAR_BIT /* number of bits in a char */
+#define SCHAR_MAX __SCHAR_MAX /* max value for a signed char */
+#define SCHAR_MIN __SCHAR_MIN /* min value for a signed char */
+
+#define UCHAR_MAX __UCHAR_MAX /* max value for an unsigned char */
+
+#ifdef __CHAR_UNSIGNED__
+#define CHAR_MAX UCHAR_MAX /* max value for a char */
+#define CHAR_MIN 0 /* min value for a char */
+#else
+#define CHAR_MAX SCHAR_MAX
+#define CHAR_MIN SCHAR_MIN
+#endif
+
+#define USHRT_MAX __USHRT_MAX /* max value for an unsigned short */
+#define SHRT_MAX __SHRT_MAX /* max value for a short */
+#define SHRT_MIN __SHRT_MIN /* min value for a short */
+
+#define UINT_MAX __UINT_MAX /* max value for an unsigned int */
+#define INT_MAX __INT_MAX /* max value for an int */
+#define INT_MIN __INT_MIN /* min value for an int */
+
+#define ULONG_MAX __ULONG_MAX /* max for an unsigned long */
+#define LONG_MAX __LONG_MAX /* max for a long */
+#define LONG_MIN __LONG_MIN /* min for a long */
+
+#ifdef __LONG_LONG_SUPPORTED
+#define ULLONG_MAX __ULLONG_MAX /* max for an unsigned long long */
+#define LLONG_MAX __LLONG_MAX /* max for a long long */
+#define LLONG_MIN __LLONG_MIN /* min for a long long */
+#endif
+
+#if __POSIX_VISIBLE || __XSI_VISIBLE
+#define SSIZE_MAX __SSIZE_MAX /* max value for an ssize_t */
+#endif
+
+#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
+#define SIZE_T_MAX __SIZE_T_MAX /* max value for a size_t */
+
+#define OFF_MAX __OFF_MAX /* max value for an off_t */
+#define OFF_MIN __OFF_MIN /* min value for an off_t */
+#endif
+#endif /* __rtems__ */
+
+#if __BSD_VISIBLE
+#define GID_MAX UINT_MAX /* max value for a gid_t */
+#define UID_MAX UINT_MAX /* max value for a uid_t */
+
+#define UQUAD_MAX (__UQUAD_MAX) /* max value for a uquad_t */
+#define QUAD_MAX (__QUAD_MAX) /* max value for a quad_t */
+#define QUAD_MIN (__QUAD_MIN) /* min value for a quad_t */
+#endif
+
+#ifndef __rtems__
+#if __XSI_VISIBLE
+#define LONG_BIT __LONG_BIT
+#define WORD_BIT __WORD_BIT
+#endif
+
+#if __POSIX_VISIBLE
+#define MQ_PRIO_MAX 64
+#endif
+#endif /* __rtems__ */
+
+#endif /* !_SYS_LIMITS_H_ */
diff --git a/freebsd/sys/sys/linker.h b/freebsd/sys/sys/linker.h
index 449fa1ec..896b0c8c 100644
--- a/freebsd/sys/sys/linker.h
+++ b/freebsd/sys/sys/linker.h
@@ -26,13 +26,13 @@
* $FreeBSD$
*/
-#ifndef _SYS_LINKER_HH_
-#define _SYS_LINKER_HH_
+#ifndef _SYS_LINKER_H_
+#define _SYS_LINKER_H_
#ifdef _KERNEL
-#include <freebsd/machine/elf.h>
-#include <freebsd/sys/kobj.h>
+#include <machine/elf.h>
+#include <sys/kobj.h>
#ifdef MALLOC_DECLARE
MALLOC_DECLARE(M_LINKER);
@@ -331,7 +331,7 @@ struct kld_sym_lookup {
#ifndef _KERNEL
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__BEGIN_DECLS
int kldload(const char* _file);
@@ -346,4 +346,4 @@ __END_DECLS
#endif
-#endif /* !_SYS_LINKER_HH_ */
+#endif /* !_SYS_LINKER_H_ */
diff --git a/freebsd/sys/sys/linker_set.h b/freebsd/sys/sys/linker_set.h
index 2dd056bc..fc04fe0d 100644
--- a/freebsd/sys/sys/linker_set.h
+++ b/freebsd/sys/sys/linker_set.h
@@ -27,8 +27,8 @@
* $FreeBSD$
*/
-#ifndef _SYS_LINKER_SET_HH_
-#define _SYS_LINKER_SET_HH_
+#ifndef _SYS_LINKER_SET_H_
+#define _SYS_LINKER_SET_H_
#ifndef _SYS_CDEFS_H_
#error this file needs sys/cdefs.h as a prerequisite
@@ -111,4 +111,4 @@
#define SET_COUNT(set) \
(SET_LIMIT(set) - SET_BEGIN(set))
-#endif /* _SYS_LINKER_SET_HH_ */
+#endif /* _SYS_LINKER_SET_H_ */
diff --git a/freebsd/sys/sys/lock_profile.h b/freebsd/sys/sys/lock_profile.h
index 92eb512f..579113a7 100644
--- a/freebsd/sys/sys/lock_profile.h
+++ b/freebsd/sys/sys/lock_profile.h
@@ -28,16 +28,16 @@
*/
-#ifndef _SYS_LOCK_PROFILE_HH_
-#define _SYS_LOCK_PROFILE_HH_
+#ifndef _SYS_LOCK_PROFILE_H_
+#define _SYS_LOCK_PROFILE_H_
struct lock_profile_object;
LIST_HEAD(lpohead, lock_profile_object);
#ifdef _KERNEL
#ifdef LOCK_PROFILING
-#include <freebsd/machine/cpufunc.h>
-#include <freebsd/sys/lock.h>
+#include <machine/cpufunc.h>
+#include <rtems/bsd/sys/lock.h>
#ifndef USE_CPU_NANOSECONDS
u_int64_t nanoseconds(void);
@@ -72,4 +72,4 @@ lock_profile_obtain_lock_failed(struct lock_object *lo, int *contested,
#endif /* _KERNEL */
-#endif /* _SYS_LOCK_PROFILE_HH_ */
+#endif /* _SYS_LOCK_PROFILE_H_ */
diff --git a/freebsd/sys/sys/lockmgr.h b/freebsd/sys/sys/lockmgr.h
index 2020eb83..3d0aad0b 100644
--- a/freebsd/sys/sys/lockmgr.h
+++ b/freebsd/sys/sys/lockmgr.h
@@ -28,13 +28,13 @@
* $FreeBSD$
*/
-#ifndef _SYS_LOCKMGR_HH_
-#define _SYS_LOCKMGR_HH_
+#ifndef _SYS_LOCKMGR_H_
+#define _SYS_LOCKMGR_H_
-#include <freebsd/sys/_lock.h>
-#include <freebsd/sys/_lockmgr.h>
-#include <freebsd/sys/_mutex.h>
-#include <freebsd/sys/_rwlock.h>
+#include <sys/_lock.h>
+#include <sys/_lockmgr.h>
+#include <sys/_mutex.h>
+#include <sys/_rwlock.h>
#define LK_SHARE 0x01
#define LK_SHARED_WAITERS 0x02
@@ -56,7 +56,7 @@
#ifdef _KERNEL
#if !defined(LOCK_FILE) || !defined(LOCK_LINE)
-#error "LOCK_FILE and LOCK_LINE not defined, include <sys/lock.h> before"
+#error "LOCK_FILE and LOCK_LINE not defined, include <rtems/bsd/sys/lock.h> before"
#endif
struct thread;
@@ -192,4 +192,4 @@ _lockmgr_args_rw(struct lock *lk, u_int flags, struct rwlock *ilk,
#endif /* _KERNEL */
-#endif /* !_SYS_LOCKMGR_HH_ */
+#endif /* !_SYS_LOCKMGR_H_ */
diff --git a/freebsd/sys/sys/mac.h b/freebsd/sys/sys/mac.h
index f261c7ff..0aa89608 100644
--- a/freebsd/sys/sys/mac.h
+++ b/freebsd/sys/sys/mac.h
@@ -44,8 +44,8 @@
* http://www.TrustedBSD.org/
*/
-#ifndef _SYS_MAC_HH_
-#define _SYS_MAC_HH_
+#ifndef _SYS_MAC_H_
+#define _SYS_MAC_H_
#ifndef _POSIX_MAC
#define _POSIX_MAC
@@ -108,4 +108,4 @@ __END_DECLS
#endif /* !_KERNEL */
-#endif /* !_SYS_MAC_HH_ */
+#endif /* !_SYS_MAC_H_ */
diff --git a/freebsd/sys/sys/malloc.h b/freebsd/sys/sys/malloc.h
index faca480d..d70fd21c 100644
--- a/freebsd/sys/sys/malloc.h
+++ b/freebsd/sys/sys/malloc.h
@@ -32,13 +32,13 @@
* $FreeBSD$
*/
-#ifndef _SYS_MALLOC_HH_
-#define _SYS_MALLOC_HH_
+#ifndef _SYS_MALLOC_H_
+#define _SYS_MALLOC_H_
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/_lock.h>
-#include <freebsd/sys/_mutex.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <sys/_lock.h>
+#include <sys/_mutex.h>
#define MINALLOCSIZE UMA_SMALLEST_UNIT
@@ -186,4 +186,4 @@ void *reallocf(void *addr, unsigned long size, struct malloc_type *type,
struct malloc_type *malloc_desc2type(const char *desc);
#endif /* _KERNEL */
-#endif /* !_SYS_MALLOC_HH_ */
+#endif /* !_SYS_MALLOC_H_ */
diff --git a/freebsd/sys/sys/mbuf.h b/freebsd/sys/sys/mbuf.h
index 5988760e..148e9cd1 100644
--- a/freebsd/sys/sys/mbuf.h
+++ b/freebsd/sys/sys/mbuf.h
@@ -31,16 +31,16 @@
* $FreeBSD$
*/
-#ifndef _SYS_MBUF_HH_
-#define _SYS_MBUF_HH_
+#ifndef _SYS_MBUF_H_
+#define _SYS_MBUF_H_
/* XXX: These includes suck. Sorry! */
-#include <freebsd/sys/queue.h>
+#include <sys/queue.h>
#ifdef _KERNEL
-#include <freebsd/sys/systm.h>
-#include <freebsd/vm/uma.h>
+#include <sys/systm.h>
+#include <vm/uma.h>
#ifdef WITNESS
-#include <freebsd/sys/lock.h>
+#include <rtems/bsd/sys/lock.h>
#endif
#endif
@@ -1029,4 +1029,4 @@ m_tag_find(struct mbuf *m, int type, struct m_tag *start)
#endif
-#endif /* !_SYS_MBUF_HH_ */
+#endif /* !_SYS_MBUF_H_ */
diff --git a/freebsd/sys/sys/md5.h b/freebsd/sys/sys/md5.h
index 9bf97cd6..e98b7afb 100644
--- a/freebsd/sys/sys/md5.h
+++ b/freebsd/sys/sys/md5.h
@@ -25,8 +25,8 @@ These notices must be retained in any copies of any part of this
documentation and/or software.
*/
-#ifndef _SYS_MD5_HH_
-#define _SYS_MD5_HH_
+#ifndef _SYS_MD5_H_
+#define _SYS_MD5_H_
#define MD5_BLOCK_LENGTH 64
#define MD5_DIGEST_LENGTH 16
@@ -39,7 +39,7 @@ typedef struct MD5Context {
unsigned char buffer[64]; /* input buffer */
} MD5_CTX;
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__BEGIN_DECLS
void MD5Init (MD5_CTX *);
@@ -50,4 +50,4 @@ char * MD5File(const char *, char *);
char * MD5FileChunk(const char *, char *, off_t, off_t);
char * MD5Data(const void *, unsigned int, char *);
__END_DECLS
-#endif /* _SYS_MD5_HH_ */
+#endif /* _SYS_MD5_H_ */
diff --git a/freebsd/sys/sys/mman.h b/freebsd/sys/sys/mman.h
index 2d90a14d..4872d631 100644
--- a/freebsd/sys/sys/mman.h
+++ b/freebsd/sys/sys/mman.h
@@ -1,3 +1,238 @@
-#include <freebsd/bsd.h>
-#include <freebsd/sys/mman.h>
+/*-
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)mman.h 8.2 (Berkeley) 1/9/95
+ * $FreeBSD$
+ */
+#ifndef _SYS_MMAN_H_
+#define _SYS_MMAN_H_
+
+#include <sys/cdefs.h>
+#include <rtems/bsd/sys/_types.h>
+
+#if __BSD_VISIBLE
+/*
+ * Inheritance for minherit()
+ */
+#define INHERIT_SHARE 0
+#define INHERIT_COPY 1
+#define INHERIT_NONE 2
+#endif
+
+/*
+ * Protections are chosen from these bits, or-ed together
+ */
+#define PROT_NONE 0x00 /* no permissions */
+#define PROT_READ 0x01 /* pages can be read */
+#define PROT_WRITE 0x02 /* pages can be written */
+#define PROT_EXEC 0x04 /* pages can be executed */
+
+/*
+ * Flags contain sharing type and options.
+ * Sharing types; choose one.
+ */
+#define MAP_SHARED 0x0001 /* share changes */
+#define MAP_PRIVATE 0x0002 /* changes are private */
+#if __BSD_VISIBLE
+#define MAP_COPY MAP_PRIVATE /* Obsolete */
+#endif
+
+/*
+ * Other flags
+ */
+#define MAP_FIXED 0x0010 /* map addr must be exactly as requested */
+
+#if __BSD_VISIBLE
+#define MAP_RENAME 0x0020 /* Sun: rename private pages to file */
+#define MAP_NORESERVE 0x0040 /* Sun: don't reserve needed swap area */
+#define MAP_RESERVED0080 0x0080 /* previously misimplemented MAP_INHERIT */
+#define MAP_RESERVED0100 0x0100 /* previously unimplemented MAP_NOEXTEND */
+#define MAP_HASSEMAPHORE 0x0200 /* region may contain semaphores */
+#define MAP_STACK 0x0400 /* region grows down, like a stack */
+#define MAP_NOSYNC 0x0800 /* page to but do not sync underlying file */
+
+/*
+ * Mapping type
+ */
+#define MAP_FILE 0x0000 /* map from file (default) */
+#define MAP_ANON 0x1000 /* allocated from memory, swap space */
+
+/*
+ * Extended flags
+ */
+#define MAP_NOCORE 0x00020000 /* dont include these pages in a coredump */
+#endif /* __BSD_VISIBLE */
+
+#if __POSIX_VISIBLE >= 199309
+/*
+ * Process memory locking
+ */
+#define MCL_CURRENT 0x0001 /* Lock only current memory */
+#define MCL_FUTURE 0x0002 /* Lock all future memory as well */
+#endif
+
+/*
+ * Error return from mmap()
+ */
+#define MAP_FAILED ((void *)-1)
+
+/*
+ * msync() flags
+ */
+#define MS_SYNC 0x0000 /* msync synchronously */
+#define MS_ASYNC 0x0001 /* return immediately */
+#define MS_INVALIDATE 0x0002 /* invalidate all cached data */
+
+/*
+ * Advice to madvise
+ */
+#define _MADV_NORMAL 0 /* no further special treatment */
+#define _MADV_RANDOM 1 /* expect random page references */
+#define _MADV_SEQUENTIAL 2 /* expect sequential page references */
+#define _MADV_WILLNEED 3 /* will need these pages */
+#define _MADV_DONTNEED 4 /* dont need these pages */
+
+#if __BSD_VISIBLE
+#define MADV_NORMAL _MADV_NORMAL
+#define MADV_RANDOM _MADV_RANDOM
+#define MADV_SEQUENTIAL _MADV_SEQUENTIAL
+#define MADV_WILLNEED _MADV_WILLNEED
+#define MADV_DONTNEED _MADV_DONTNEED
+#define MADV_FREE 5 /* dont need these pages, and junk contents */
+#define MADV_NOSYNC 6 /* try to avoid flushes to physical media */
+#define MADV_AUTOSYNC 7 /* revert to default flushing strategy */
+#define MADV_NOCORE 8 /* do not include these pages in a core file */
+#define MADV_CORE 9 /* revert to including pages in a core file */
+#define MADV_PROTECT 10 /* protect process from pageout kill */
+
+/*
+ * Return bits from mincore
+ */
+#define MINCORE_INCORE 0x1 /* Page is incore */
+#define MINCORE_REFERENCED 0x2 /* Page has been referenced by us */
+#define MINCORE_MODIFIED 0x4 /* Page has been modified by us */
+#define MINCORE_REFERENCED_OTHER 0x8 /* Page has been referenced */
+#define MINCORE_MODIFIED_OTHER 0x10 /* Page has been modified */
+#define MINCORE_SUPER 0x20 /* Page is a "super" page */
+
+/*
+ * Anonymous object constant for shm_open().
+ */
+#define SHM_ANON ((char *)1)
+#endif /* __BSD_VISIBLE */
+
+/*
+ * XXX missing POSIX_TYPED_MEM_* macros and
+ * posix_typed_mem_info structure.
+ */
+#if __POSIX_VISIBLE >= 200112
+#define POSIX_MADV_NORMAL _MADV_NORMAL
+#define POSIX_MADV_RANDOM _MADV_RANDOM
+#define POSIX_MADV_SEQUENTIAL _MADV_SEQUENTIAL
+#define POSIX_MADV_WILLNEED _MADV_WILLNEED
+#define POSIX_MADV_DONTNEED _MADV_DONTNEED
+#endif
+
+#ifndef _MODE_T_DECLARED
+typedef __mode_t mode_t;
+#define _MODE_T_DECLARED
+#endif
+
+#ifndef _OFF_T_DECLARED
+typedef __off_t off_t;
+#define _OFF_T_DECLARED
+#endif
+
+#ifndef _SIZE_T_DECLARED
+typedef __size_t size_t;
+#define _SIZE_T_DECLARED
+#endif
+
+#ifdef _KERNEL
+#include <vm/vm.h>
+
+struct shmfd {
+ size_t shm_size;
+ vm_object_t shm_object;
+ int shm_refs;
+ uid_t shm_uid;
+ gid_t shm_gid;
+ mode_t shm_mode;
+
+ /*
+ * Values maintained solely to make this a better-behaved file
+ * descriptor for fstat() to run on.
+ */
+ struct timespec shm_atime;
+ struct timespec shm_mtime;
+ struct timespec shm_ctime;
+ struct timespec shm_birthtime;
+
+ struct label *shm_label; /* MAC label */
+};
+
+int shm_mmap(struct shmfd *shmfd, vm_size_t objsize, vm_ooffset_t foff,
+ vm_object_t *obj);
+
+#else /* !_KERNEL */
+
+__BEGIN_DECLS
+/*
+ * XXX not yet implemented: posix_mem_offset(), posix_typed_mem_get_info(),
+ * posix_typed_mem_open().
+ */
+#if __BSD_VISIBLE
+int getpagesizes(size_t *, int);
+int madvise(void *, size_t, int);
+int mincore(const void *, size_t, char *);
+int minherit(void *, size_t, int);
+#endif
+int mlock(const void *, size_t);
+#ifndef _MMAP_DECLARED
+#define _MMAP_DECLARED
+void * mmap(void *, size_t, int, int, int, off_t);
+#endif
+int mprotect(const void *, size_t, int);
+int msync(void *, size_t, int);
+int munlock(const void *, size_t);
+int munmap(void *, size_t);
+#if __POSIX_VISIBLE >= 200112
+int posix_madvise(void *, size_t, int);
+#endif
+#if __POSIX_VISIBLE >= 199309
+int mlockall(int);
+int munlockall(void);
+int shm_open(const char *, int, mode_t);
+int shm_unlink(const char *);
+#endif
+__END_DECLS
+
+#endif /* !_KERNEL */
+
+#endif /* !_SYS_MMAN_H_ */
diff --git a/freebsd/sys/sys/module.h b/freebsd/sys/sys/module.h
index 3b67ad5a..782770a7 100644
--- a/freebsd/sys/sys/module.h
+++ b/freebsd/sys/sys/module.h
@@ -26,8 +26,8 @@
* $FreeBSD$
*/
-#ifndef _SYS_MODULE_HH_
-#define _SYS_MODULE_HH_
+#ifndef _SYS_MODULE_H_
+#define _SYS_MODULE_H_
/*
* Module metadata types
@@ -94,7 +94,7 @@ struct mod_metadata {
#ifdef _KERNEL
-#include <freebsd/sys/linker_set.h>
+#include <sys/linker_set.h>
#define MODULE_METADATA(uniquifier, type, data, cval) \
static struct mod_metadata _mod_metadata##uniquifier = { \
@@ -204,7 +204,7 @@ struct module_stat {
#ifndef _KERNEL
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__BEGIN_DECLS
int modnext(int _modid);
@@ -215,4 +215,4 @@ __END_DECLS
#endif
-#endif /* !_SYS_MODULE_HH_ */
+#endif /* !_SYS_MODULE_H_ */
diff --git a/freebsd/sys/sys/mount.h b/freebsd/sys/sys/mount.h
index 9ec6915d..fcf80bd5 100644
--- a/freebsd/sys/sys/mount.h
+++ b/freebsd/sys/sys/mount.h
@@ -30,15 +30,15 @@
* $FreeBSD$
*/
-#ifndef _SYS_MOUNT_HH_
-#define _SYS_MOUNT_HH_
+#ifndef _SYS_MOUNT_H_
+#define _SYS_MOUNT_H_
-#include <freebsd/sys/ucred.h>
-#include <freebsd/sys/queue.h>
+#include <sys/ucred.h>
+#include <sys/queue.h>
#ifdef _KERNEL
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/lockmgr.h>
-#include <freebsd/sys/_mutex.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/lockmgr.h>
+#include <sys/_mutex.h>
#endif
/*
@@ -663,7 +663,7 @@ vfs_statfs_t __vfs_statfs;
VN_KNOTE((vp), (hint), 0); \
} while (0)
-#include <freebsd/sys/module.h>
+#include <sys/module.h>
/*
* Version numbers.
@@ -771,7 +771,7 @@ vfs_sysctl_t vfs_stdsysctl;
#else /* !_KERNEL */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
struct stat;
@@ -795,4 +795,4 @@ __END_DECLS
#endif /* _KERNEL */
-#endif /* !_SYS_MOUNT_HH_ */
+#endif /* !_SYS_MOUNT_H_ */
diff --git a/freebsd/sys/sys/mqueue.h b/freebsd/sys/sys/mqueue.h
index 80d40479..36e89fa2 100644
--- a/freebsd/sys/sys/mqueue.h
+++ b/freebsd/sys/sys/mqueue.h
@@ -26,8 +26,8 @@
* $FreeBSD$
*/
-#ifndef _SYS_MQUEUE_HH_
-#define _SYS_MQUEUE_HH_
+#ifndef _SYS_MQUEUE_H_
+#define _SYS_MQUEUE_H_
struct mq_attr {
long mq_flags; /* Message queue flags. */
diff --git a/freebsd/sys/sys/mutex.h b/freebsd/sys/sys/mutex.h
index 0e8e1739..3e4a1701 100644
--- a/freebsd/sys/sys/mutex.h
+++ b/freebsd/sys/sys/mutex.h
@@ -29,24 +29,24 @@
* $FreeBSD$
*/
-#ifndef _SYS_MUTEX_HH_
-#define _SYS_MUTEX_HH_
+#ifndef _SYS_MUTEX_H_
+#define _SYS_MUTEX_H_
#ifndef LOCORE
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/_lock.h>
-#include <freebsd/sys/_mutex.h>
+#include <sys/queue.h>
+#include <sys/_lock.h>
+#include <sys/_mutex.h>
#ifdef _KERNEL
-#include <freebsd/sys/pcpu.h>
-#include <freebsd/sys/lock_profile.h>
-#include <freebsd/sys/lockstat.h>
-#include <freebsd/machine/atomic.h>
-#include <freebsd/machine/cpufunc.h>
+#include <sys/pcpu.h>
+#include <sys/lock_profile.h>
+#include <sys/lockstat.h>
+#include <machine/atomic.h>
+#include <machine/cpufunc.h>
#endif /* _KERNEL_ */
#endif /* !LOCORE */
-#include <freebsd/machine/mutex.h>
+#include <machine/mutex.h>
#ifdef _KERNEL
@@ -337,7 +337,7 @@ extern struct mtx_pool *mtxpool_lockbuilder;
extern struct mtx_pool *mtxpool_sleep;
#ifndef LOCK_DEBUG
-#error LOCK_DEBUG not defined, include <sys/lock.h> before <sys/mutex.h>
+#error LOCK_DEBUG not defined, include <rtems/bsd/sys/lock.h> before <sys/mutex.h>
#endif
#if LOCK_DEBUG > 0 || defined(MUTEX_NOINLINE)
#define mtx_lock_flags(m, opts) \
@@ -471,4 +471,4 @@ struct mtx_args {
#endif /* _KERNEL */
#endif /* !LOCORE */
-#endif /* _SYS_MUTEX_HH_ */
+#endif /* _SYS_MUTEX_H_ */
diff --git a/freebsd/sys/sys/osd.h b/freebsd/sys/sys/osd.h
index a1989de0..63d536fa 100644
--- a/freebsd/sys/sys/osd.h
+++ b/freebsd/sys/sys/osd.h
@@ -26,10 +26,10 @@
* $FreeBSD$
*/
-#ifndef _SYS_OSD_HH_
-#define _SYS_OSD_HH_
+#ifndef _SYS_OSD_H_
+#define _SYS_OSD_H_
-#include <freebsd/sys/queue.h>
+#include <sys/queue.h>
/*
* Lock key:
@@ -98,4 +98,4 @@ void osd_exit(u_int type, struct osd *osd);
#endif /* _KERNEL */
-#endif /* !_SYS_OSD_HH_ */
+#endif /* !_SYS_OSD_H_ */
diff --git a/freebsd/sys/sys/pciio.h b/freebsd/sys/sys/pciio.h
index c4a5abf8..a0c4560e 100644
--- a/freebsd/sys/sys/pciio.h
+++ b/freebsd/sys/sys/pciio.h
@@ -28,10 +28,10 @@
*
*/
-#ifndef _SYS_PCIIO_HH_
-#define _SYS_PCIIO_HH_
+#ifndef _SYS_PCIIO_H_
+#define _SYS_PCIIO_H_
-#include <freebsd/sys/ioccom.h>
+#include <sys/ioccom.h>
#define PCI_MAXNAMELEN 16
@@ -122,4 +122,4 @@ struct pci_bar_io {
#define PCIOCATTACHED _IOWR('p', 4, struct pci_io)
#define PCIOCGETBAR _IOWR('p', 6, struct pci_bar_io)
-#endif /* !_SYS_PCIIO_HH_ */
+#endif /* !_SYS_PCIIO_H_ */
diff --git a/freebsd/sys/sys/pcpu.h b/freebsd/sys/sys/pcpu.h
index ce84f15a..48a3bccb 100644
--- a/freebsd/sys/sys/pcpu.h
+++ b/freebsd/sys/sys/pcpu.h
@@ -30,19 +30,19 @@
* $FreeBSD$
*/
-#ifndef _SYS_PCPU_HH_
-#define _SYS_PCPU_HH_
+#ifndef _SYS_PCPU_H_
+#define _SYS_PCPU_H_
#ifdef LOCORE
#error "no assembler-serviceable parts inside"
#endif
-#include <freebsd/sys/queue.h>
+#include <sys/queue.h>
#ifndef __rtems__
-#include <freebsd/sys/vmmeter.h>
+#include <sys/vmmeter.h>
#endif
-#include <freebsd/sys/resource.h>
-#include <freebsd/machine/pcpu.h>
+#include <rtems/bsd/sys/resource.h>
+#include <machine/pcpu.h>
/*
* Define a set for pcpu data.
@@ -230,4 +230,4 @@ void pcpu_init(struct pcpu *pcpu, int cpuid, size_t size);
#endif /* _KERNEL */
-#endif /* !_SYS_PCPU_HH_ */
+#endif /* !_SYS_PCPU_H_ */
diff --git a/freebsd/sys/sys/poll.h b/freebsd/sys/sys/poll.h
index 1d09405a..c955f321 100644
--- a/freebsd/sys/sys/poll.h
+++ b/freebsd/sys/sys/poll.h
@@ -28,10 +28,10 @@
* $FreeBSD$
*/
-#ifndef _SYS_POLL_HH_
-#define _SYS_POLL_HH_
+#ifndef _SYS_POLL_H_
+#define _SYS_POLL_H_
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
/*
* This file is intended to be compatible with the traditional poll.h.
@@ -101,4 +101,4 @@ __END_DECLS
#endif /* !_KERNEL */
-#endif /* !_SYS_POLL_HH_ */
+#endif /* !_SYS_POLL_H_ */
diff --git a/freebsd/sys/sys/priority.h b/freebsd/sys/sys/priority.h
index dbaa5eaa..9bbd2de8 100644
--- a/freebsd/sys/sys/priority.h
+++ b/freebsd/sys/sys/priority.h
@@ -31,8 +31,8 @@
* $FreeBSD$
*/
-#ifndef _SYS_PRIORITY_HH_
-#define _SYS_PRIORITY_HH_
+#ifndef _SYS_PRIORITY_H_
+#define _SYS_PRIORITY_H_
/*
* Process priority specifications.
@@ -127,4 +127,4 @@ struct priority {
u_char pri_user; /* User priority based on p_cpu and p_nice. */
};
-#endif /* !_SYS_PRIORITY_HH_ */
+#endif /* !_SYS_PRIORITY_H_ */
diff --git a/freebsd/sys/sys/priv.h b/freebsd/sys/sys/priv.h
index 78342669..6939e144 100644
--- a/freebsd/sys/sys/priv.h
+++ b/freebsd/sys/sys/priv.h
@@ -32,8 +32,8 @@
/*
* Privilege checking interface for BSD kernel.
*/
-#ifndef _SYS_PRIV_HH_
-#define _SYS_PRIV_HH_
+#ifndef _SYS_PRIV_H_
+#define _SYS_PRIV_H_
/*
* Privilege list, sorted loosely by kernel subsystem.
@@ -515,4 +515,4 @@ int priv_check_cred(struct ucred *cred, int priv, int flags);
#endif /* __rtems__ */
#endif
-#endif /* !_SYS_PRIV_HH_ */
+#endif /* !_SYS_PRIV_H_ */
diff --git a/freebsd/sys/sys/proc.h b/freebsd/sys/sys/proc.h
index 43c2044c..cd10421e 100644
--- a/freebsd/sys/sys/proc.h
+++ b/freebsd/sys/sys/proc.h
@@ -35,35 +35,35 @@
* $FreeBSD$
*/
-#ifndef _SYS_PROC_HH_
-#define _SYS_PROC_HH_
+#ifndef _SYS_PROC_H_
+#define _SYS_PROC_H_
-#include <freebsd/sys/callout.h> /* For struct callout. */
-#include <freebsd/sys/event.h> /* For struct klist. */
-#include <freebsd/sys/condvar.h>
+#include <sys/callout.h> /* For struct callout. */
+#include <sys/event.h> /* For struct klist. */
+#include <sys/condvar.h>
#ifndef _KERNEL
-#include <freebsd/sys/filedesc.h>
+#include <sys/filedesc.h>
#endif
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/_lock.h>
-#include <freebsd/sys/lock_profile.h>
-#include <freebsd/sys/_mutex.h>
-#include <freebsd/sys/osd.h>
-#include <freebsd/sys/priority.h>
-#include <freebsd/sys/rtprio.h> /* XXX. */
-#include <freebsd/sys/runq.h>
-#include <freebsd/sys/resource.h>
-#include <freebsd/sys/sigio.h>
-#include <freebsd/sys/signal.h>
-#include <freebsd/sys/signalvar.h>
+#include <sys/queue.h>
+#include <sys/_lock.h>
+#include <sys/lock_profile.h>
+#include <sys/_mutex.h>
+#include <sys/osd.h>
+#include <sys/priority.h>
+#include <sys/rtprio.h> /* XXX. */
+#include <sys/runq.h>
+#include <rtems/bsd/sys/resource.h>
+#include <sys/sigio.h>
+#include <sys/signal.h>
+#include <sys/signalvar.h>
#ifndef _KERNEL
-#include <freebsd/sys/time.h> /* For structs itimerval, timeval. */
+#include <rtems/bsd/sys/time.h> /* For structs itimerval, timeval. */
#else
-#include <freebsd/sys/pcpu.h>
+#include <sys/pcpu.h>
#endif
-#include <freebsd/sys/ucontext.h>
-#include <freebsd/sys/ucred.h>
-#include <freebsd/machine/proc.h> /* Machine-dependent proc substruct. */
+#include <sys/ucontext.h>
+#include <sys/ucred.h>
+#include <machine/proc.h> /* Machine-dependent proc substruct. */
/*
* One structure allocated per session.
@@ -926,4 +926,4 @@ void thr_exit1(void);
#endif /* _KERNEL */
-#endif /* !_SYS_PROC_HH_ */
+#endif /* !_SYS_PROC_H_ */
diff --git a/freebsd/sys/sys/protosw.h b/freebsd/sys/sys/protosw.h
index 5b8e9f03..b55af4b7 100644
--- a/freebsd/sys/sys/protosw.h
+++ b/freebsd/sys/sys/protosw.h
@@ -30,8 +30,8 @@
* $FreeBSD$
*/
-#ifndef _SYS_PROTOSW_HH_
-#define _SYS_PROTOSW_HH_
+#ifndef _SYS_PROTOSW_H_
+#define _SYS_PROTOSW_H_
/* Forward declare these structures referenced from prototypes below. */
struct mbuf;
diff --git a/freebsd/sys/sys/queue.h b/freebsd/sys/sys/queue.h
index e303641a..f0bae8d9 100644
--- a/freebsd/sys/sys/queue.h
+++ b/freebsd/sys/sys/queue.h
@@ -30,10 +30,10 @@
* $FreeBSD$
*/
-#ifndef _SYS_QUEUE_HH_
-#define _SYS_QUEUE_HH_
+#ifndef _SYS_QUEUE_H_
+#define _SYS_QUEUE_H_
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
/*
* This file defines four types of data structures: singly-linked lists,
@@ -633,4 +633,4 @@ struct { \
(head2)->tqh_last = &(head2)->tqh_first; \
} while (0)
-#endif /* !_SYS_QUEUE_HH_ */
+#endif /* !_SYS_QUEUE_H_ */
diff --git a/freebsd/sys/sys/random.h b/freebsd/sys/sys/random.h
index e5dea939..5cf1611e 100644
--- a/freebsd/sys/sys/random.h
+++ b/freebsd/sys/sys/random.h
@@ -26,8 +26,8 @@
* $FreeBSD$
*/
-#ifndef _SYS_RANDOM_HH_
-#define _SYS_RANDOM_HH_
+#ifndef _SYS_RANDOM_H_
+#define _SYS_RANDOM_H_
#ifdef _KERNEL
@@ -63,4 +63,4 @@ extern struct harvest_select harvest;
#endif /* _KERNEL */
-#endif /* _SYS_RANDOM_HH_ */
+#endif /* _SYS_RANDOM_H_ */
diff --git a/freebsd/sys/sys/reboot.h b/freebsd/sys/sys/reboot.h
index c2ffd30e..6b8e25e6 100644
--- a/freebsd/sys/sys/reboot.h
+++ b/freebsd/sys/sys/reboot.h
@@ -30,8 +30,8 @@
* $FreeBSD$
*/
-#ifndef _SYS_REBOOT_HH_
-#define _SYS_REBOOT_HH_
+#ifndef _SYS_REBOOT_H_
+#define _SYS_REBOOT_H_
/*
* Arguments to reboot system call. These are passed to
diff --git a/freebsd/sys/sys/refcount.h b/freebsd/sys/sys/refcount.h
index 6ec2417e..848b69ca 100644
--- a/freebsd/sys/sys/refcount.h
+++ b/freebsd/sys/sys/refcount.h
@@ -32,10 +32,10 @@
#ifndef __SYS_REFCOUNT_HH__
#define __SYS_REFCOUNT_HH__
-#include <freebsd/machine/atomic.h>
+#include <machine/atomic.h>
#ifdef _KERNEL
-#include <freebsd/sys/systm.h>
+#include <sys/systm.h>
#else
#define KASSERT(exp, msg) /* */
#endif
diff --git a/freebsd/sys/sys/resourcevar.h b/freebsd/sys/sys/resourcevar.h
index 53901f39..688bc22d 100644
--- a/freebsd/sys/sys/resourcevar.h
+++ b/freebsd/sys/sys/resourcevar.h
@@ -30,14 +30,14 @@
* $FreeBSD$
*/
-#ifndef _SYS_RESOURCEVAR_HH_
-#define _SYS_RESOURCEVAR_HH_
+#ifndef _SYS_RESOURCEVAR_H_
+#define _SYS_RESOURCEVAR_H_
-#include <freebsd/sys/resource.h>
-#include <freebsd/sys/queue.h>
+#include <rtems/bsd/sys/resource.h>
+#include <sys/queue.h>
#ifdef _KERNEL
-#include <freebsd/sys/_lock.h>
-#include <freebsd/sys/_mutex.h>
+#include <sys/_lock.h>
+#include <sys/_mutex.h>
#endif
/*
@@ -140,4 +140,4 @@ void uihashinit(void);
void uihold(struct uidinfo *uip);
#endif /* _KERNEL */
-#endif /* !_SYS_RESOURCEVAR_HH_ */
+#endif /* !_SYS_RESOURCEVAR_H_ */
diff --git a/freebsd/sys/sys/rman.h b/freebsd/sys/sys/rman.h
index 3f909a22..ba06cc04 100644
--- a/freebsd/sys/sys/rman.h
+++ b/freebsd/sys/sys/rman.h
@@ -29,14 +29,14 @@
* $FreeBSD$
*/
-#ifndef _SYS_RMAN_HH_
-#define _SYS_RMAN_HH_ 1
+#ifndef _SYS_RMAN_H_
+#define _SYS_RMAN_H_ 1
#ifndef _KERNEL
-#include <freebsd/sys/queue.h>
+#include <sys/queue.h>
#else
-#include <freebsd/machine/_bus.h>
-#include <freebsd/machine/resource.h>
+#include <machine/_bus.h>
+#include <machine/resource.h>
#endif
#define RF_ALLOCATED 0x0001 /* resource has been reserved */
@@ -152,4 +152,4 @@ extern struct rman_head rman_head;
#endif /* _KERNEL */
-#endif /* !_SYS_RMAN_HH_ */
+#endif /* !_SYS_RMAN_H_ */
diff --git a/freebsd/sys/sys/rmlock.h b/freebsd/sys/sys/rmlock.h
index ec676b74..04a1e79c 100644
--- a/freebsd/sys/sys/rmlock.h
+++ b/freebsd/sys/sys/rmlock.h
@@ -29,12 +29,12 @@
* $FreeBSD$
*/
-#ifndef _SYS_RMLOCK_HH_
-#define _SYS_RMLOCK_HH_
+#ifndef _SYS_RMLOCK_H_
+#define _SYS_RMLOCK_H_
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/_lock.h>
-#include <freebsd/sys/_rmlock.h>
+#include <sys/mutex.h>
+#include <sys/_lock.h>
+#include <sys/_rmlock.h>
#ifdef _KERNEL
@@ -68,7 +68,7 @@ void _rm_runlock(struct rmlock *rm, struct rm_priotracker *tracker);
* Public interface for lock operations.
*/
#ifndef LOCK_DEBUG
-#error LOCK_DEBUG not defined, include <sys/lock.h> before <sys/rmlock.h>
+#error LOCK_DEBUG not defined, include <rtems/bsd/sys/lock.h> before <sys/rmlock.h>
#endif
#if LOCK_DEBUG > 0
@@ -135,4 +135,4 @@ struct rm_args_flags {
rm_destroy, (rm))
#endif /* _KERNEL */
-#endif /* !_SYS_RMLOCK_HH_ */
+#endif /* !_SYS_RMLOCK_H_ */
diff --git a/freebsd/sys/sys/rtprio.h b/freebsd/sys/sys/rtprio.h
index 0694c119..7ffdb732 100644
--- a/freebsd/sys/sys/rtprio.h
+++ b/freebsd/sys/sys/rtprio.h
@@ -31,10 +31,10 @@
* $FreeBSD$
*/
-#ifndef _SYS_RTPRIO_HH_
-#define _SYS_RTPRIO_HH_
+#ifndef _SYS_RTPRIO_H_
+#define _SYS_RTPRIO_H_
-#include <freebsd/sys/priority.h>
+#include <sys/priority.h>
/*
* Process realtime-priority specifications to rtprio.
@@ -82,11 +82,11 @@ void pri_to_rtp(struct thread *, struct rtprio *);
#endif
#ifndef _KERNEL
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__BEGIN_DECLS
int rtprio(int, pid_t, struct rtprio *);
int rtprio_thread(int, lwpid_t, struct rtprio *);
__END_DECLS
#endif /* !_KERNEL */
-#endif /* !_SYS_RTPRIO_HH_ */
+#endif /* !_SYS_RTPRIO_H_ */
diff --git a/freebsd/sys/sys/runq.h b/freebsd/sys/sys/runq.h
index ce2dada1..50c00eb6 100644
--- a/freebsd/sys/sys/runq.h
+++ b/freebsd/sys/sys/runq.h
@@ -26,10 +26,10 @@
* $FreeBSD$
*/
-#ifndef _RUNQ_HH_
-#define _RUNQ_HH_
+#ifndef _RUNQ_H_
+#define _RUNQ_H_
-#include <freebsd/machine/runq.h>
+#include <machine/runq.h>
struct thread;
diff --git a/freebsd/sys/sys/rwlock.h b/freebsd/sys/sys/rwlock.h
index c3d6ee7a..82e95c4b 100644
--- a/freebsd/sys/sys/rwlock.h
+++ b/freebsd/sys/sys/rwlock.h
@@ -29,17 +29,17 @@
* $FreeBSD$
*/
-#ifndef _SYS_RWLOCK_HH_
-#define _SYS_RWLOCK_HH_
+#ifndef _SYS_RWLOCK_H_
+#define _SYS_RWLOCK_H_
-#include <freebsd/sys/_lock.h>
-#include <freebsd/sys/_rwlock.h>
-#include <freebsd/sys/lock_profile.h>
-#include <freebsd/sys/lockstat.h>
+#include <sys/_lock.h>
+#include <sys/_rwlock.h>
+#include <sys/lock_profile.h>
+#include <sys/lockstat.h>
#ifdef _KERNEL
-#include <freebsd/sys/pcpu.h>
-#include <freebsd/machine/atomic.h>
+#include <sys/pcpu.h>
+#include <machine/atomic.h>
#endif
#ifdef __rtems__
@@ -155,7 +155,7 @@ void _rw_assert(struct rwlock *rw, int what, const char *file, int line);
*/
#ifndef LOCK_DEBUG
-#error LOCK_DEBUG not defined, include <sys/lock.h> before <sys/rwlock.h>
+#error LOCK_DEBUG not defined, include <rtems/bsd/sys/lock.h> before <sys/rwlock.h>
#endif
#if LOCK_DEBUG > 0 || defined(RWLOCK_NOINLINE)
#define rw_wlock(rw) _rw_wlock((rw), LOCK_FILE, LOCK_LINE)
@@ -248,4 +248,4 @@ struct rw_args_flags {
#endif
#endif /* _KERNEL */
-#endif /* !_SYS_RWLOCK_HH_ */
+#endif /* !_SYS_RWLOCK_H_ */
diff --git a/freebsd/sys/sys/sbuf.h b/freebsd/sys/sys/sbuf.h
index 6b270d3d..ee74ce5b 100644
--- a/freebsd/sys/sys/sbuf.h
+++ b/freebsd/sys/sys/sbuf.h
@@ -28,10 +28,10 @@
* $FreeBSD$
*/
-#ifndef _SYS_SBUF_HH_
-#define _SYS_SBUF_HH_
+#ifndef _SYS_SBUF_H_
+#define _SYS_SBUF_H_
-#include <freebsd/sys/_types.h>
+#include <rtems/bsd/sys/_types.h>
/*
* Structure definition
diff --git a/freebsd/sys/sys/select.h b/freebsd/sys/sys/select.h
index 03f7d851..f348f54e 100644
--- a/freebsd/sys/sys/select.h
+++ b/freebsd/sys/sys/select.h
@@ -1,3 +1,114 @@
-#include <freebsd/bsd.h>
-#include <freebsd/sys/select.h>
+/*-
+ * Copyright (c) 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+#ifndef _SYS_SELECT_H_
+#define _SYS_SELECT_H_
+
+#include <sys/cdefs.h>
+#include <rtems/bsd/sys/_types.h>
+
+#include <sys/_sigset.h>
+#include <sys/_timeval.h>
+#include <rtems/bsd/sys/timespec.h>
+
+#ifndef __rtems__
+typedef unsigned long __fd_mask;
+#if __BSD_VISIBLE
+typedef __fd_mask fd_mask;
+#endif
+
+#ifndef _SIGSET_T_DECLARED
+#define _SIGSET_T_DECLARED
+typedef __sigset_t sigset_t;
+#endif
+
+/*
+ * Select uses bit masks of file descriptors in longs. These macros
+ * manipulate such bit fields (the filesystem macros use chars).
+ * FD_SETSIZE may be defined by the user, but the default here should
+ * be enough for most uses.
+ */
+#ifndef FD_SETSIZE
+#define FD_SETSIZE 1024U
+#endif
+
+#define _NFDBITS (sizeof(__fd_mask) * 8) /* bits per mask */
+#if __BSD_VISIBLE
+#define NFDBITS _NFDBITS
+#endif
+
+#ifndef _howmany
+#define _howmany(x, y) (((x) + ((y) - 1)) / (y))
+#endif
+
+typedef struct fd_set {
+ __fd_mask __fds_bits[_howmany(FD_SETSIZE, _NFDBITS)];
+} fd_set;
+#if __BSD_VISIBLE
+#define fds_bits __fds_bits
+#endif
+
+#define __fdset_mask(n) ((__fd_mask)1 << ((n) % _NFDBITS))
+#define FD_CLR(n, p) ((p)->__fds_bits[(n)/_NFDBITS] &= ~__fdset_mask(n))
+#if __BSD_VISIBLE
+#define FD_COPY(f, t) (void)(*(t) = *(f))
+#endif
+#define FD_ISSET(n, p) (((p)->__fds_bits[(n)/_NFDBITS] & __fdset_mask(n)) != 0)
+#define FD_SET(n, p) ((p)->__fds_bits[(n)/_NFDBITS] |= __fdset_mask(n))
+#define FD_ZERO(p) do { \
+ fd_set *_p; \
+ __size_t _n; \
+ \
+ _p = (p); \
+ _n = _howmany(FD_SETSIZE, _NFDBITS); \
+ while (_n > 0) \
+ _p->__fds_bits[--_n] = 0; \
+} while (0)
+#else /* __rtems__ */
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/signal.h>
+#endif /* __rtems__ */
+
+#ifndef _KERNEL
+
+__BEGIN_DECLS
+int pselect(int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict,
+ const struct timespec *__restrict, const sigset_t *__restrict);
+#ifndef _SELECT_DECLARED
+#define _SELECT_DECLARED
+/* XXX missing restrict type-qualifier */
+int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
+#endif
+__END_DECLS
+#endif /* !_KERNEL */
+
+#endif /* _SYS_SELECT_H_ */
diff --git a/freebsd/sys/sys/selinfo.h b/freebsd/sys/sys/selinfo.h
index da20189b..39e540f7 100644
--- a/freebsd/sys/sys/selinfo.h
+++ b/freebsd/sys/sys/selinfo.h
@@ -30,10 +30,10 @@
* $FreeBSD$
*/
-#ifndef _SYS_SELINFO_HH_
-#define _SYS_SELINFO_HH_
+#ifndef _SYS_SELINFO_H_
+#define _SYS_SELINFO_H_
-#include <freebsd/sys/event.h> /* for struct klist */
+#include <sys/event.h> /* for struct klist */
struct selfd;
TAILQ_HEAD(selfdlist, selfd);
@@ -61,4 +61,4 @@ void selwakeuppri(struct selinfo *sip, int pri);
void seltdfini(struct thread *td);
#endif
-#endif /* !_SYS_SELINFO_HH_ */
+#endif /* !_SYS_SELINFO_H_ */
diff --git a/freebsd/sys/sys/sf_buf.h b/freebsd/sys/sys/sf_buf.h
index 5dbcd5ef..af420652 100644
--- a/freebsd/sys/sys/sf_buf.h
+++ b/freebsd/sys/sys/sf_buf.h
@@ -26,10 +26,10 @@
* $FreeBSD$
*/
-#ifndef _SYS_SF_BUF_HH_
-#define _SYS_SF_BUF_HH_
+#ifndef _SYS_SF_BUF_H_
+#define _SYS_SF_BUF_H_
-#include <freebsd/machine/sf_buf.h>
+#include <machine/sf_buf.h>
/*
* Options to sf_buf_alloc() are specified through its flags argument. This
@@ -53,4 +53,4 @@ struct sf_buf *
void sf_buf_free(struct sf_buf *sf);
void sf_buf_mext(void *addr, void *args);
-#endif /* !_SYS_SF_BUF_HH_ */
+#endif /* !_SYS_SF_BUF_H_ */
diff --git a/freebsd/sys/sys/sigio.h b/freebsd/sys/sys/sigio.h
index dc29d948..62ece6d4 100644
--- a/freebsd/sys/sys/sigio.h
+++ b/freebsd/sys/sys/sigio.h
@@ -30,8 +30,8 @@
* $FreeBSD$
*/
-#ifndef _SYS_SIGIO_HH_
-#define _SYS_SIGIO_HH_
+#ifndef _SYS_SIGIO_H_
+#define _SYS_SIGIO_H_
/*
* This structure holds the information needed to send a SIGIO or
@@ -64,4 +64,4 @@ int fsetown(pid_t pgid, struct sigio **sigiop);
void funsetown(struct sigio **sigiop);
void funsetownlst(struct sigiolst *sigiolst);
-#endif /* _SYS_SIGIO_HH_ */
+#endif /* _SYS_SIGIO_H_ */
diff --git a/freebsd/sys/sys/smp.h b/freebsd/sys/sys/smp.h
index c73bec25..619eba81 100644
--- a/freebsd/sys/sys/smp.h
+++ b/freebsd/sys/sys/smp.h
@@ -9,8 +9,8 @@
* $FreeBSD$
*/
-#ifndef _SYS_SMP_HH_
-#define _SYS_SMP_HH_
+#ifndef _SYS_SMP_H_
+#define _SYS_SMP_H_
#ifdef _KERNEL
@@ -180,4 +180,4 @@ void smp_rendezvous_cpus(cpumask_t,
void *arg);
#endif /* !LOCORE */
#endif /* _KERNEL */
-#endif /* _SYS_SMP_HH_ */
+#endif /* _SYS_SMP_H_ */
diff --git a/freebsd/sys/sys/sockbuf.h b/freebsd/sys/sys/sockbuf.h
index 5de6f6eb..b8e66999 100644
--- a/freebsd/sys/sys/sockbuf.h
+++ b/freebsd/sys/sys/sockbuf.h
@@ -30,12 +30,12 @@
*
* $FreeBSD$
*/
-#ifndef _SYS_SOCKBUF_HH_
-#define _SYS_SOCKBUF_HH_
-#include <freebsd/sys/selinfo.h> /* for struct selinfo */
-#include <freebsd/sys/_lock.h>
-#include <freebsd/sys/_mutex.h>
-#include <freebsd/sys/_sx.h>
+#ifndef _SYS_SOCKBUF_H_
+#define _SYS_SOCKBUF_H_
+#include <sys/selinfo.h> /* for struct selinfo */
+#include <sys/_lock.h>
+#include <sys/_mutex.h>
+#include <sys/_sx.h>
#define SB_MAX (256*1024) /* default for max chars in sockbuf */
@@ -220,4 +220,4 @@ void sblastmbufchk(struct sockbuf *, const char *, int);
#endif /* _KERNEL */
-#endif /* _SYS_SOCKBUF_HH_ */
+#endif /* _SYS_SOCKBUF_H_ */
diff --git a/freebsd/sys/sys/socket.h b/freebsd/sys/sys/socket.h
index 39138881..9481e5c4 100644
--- a/freebsd/sys/sys/socket.h
+++ b/freebsd/sys/sys/socket.h
@@ -1,2 +1,691 @@
-#include <freebsd/bsd.h>
-#include <freebsd/sys/socket.h>
+/*-
+ * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)socket.h 8.4 (Berkeley) 2/21/94
+ * $FreeBSD$
+ */
+
+#ifndef _SYS_SOCKET_H_
+#define _SYS_SOCKET_H_
+
+#include <sys/cdefs.h>
+#include <rtems/bsd/sys/_types.h>
+#include <sys/_iovec.h>
+#define _NO_NAMESPACE_POLLUTION
+#include <machine/rtems-bsd-param.h>
+#undef _NO_NAMESPACE_POLLUTION
+
+/*
+ * Definitions related to sockets: types, address families, options.
+ */
+
+/*
+ * Data types.
+ */
+#if __BSD_VISIBLE
+#ifndef _GID_T_DECLARED
+typedef __gid_t gid_t;
+#define _GID_T_DECLARED
+#endif
+
+#ifndef _OFF_T_DECLARED
+typedef __off_t off_t;
+#define _OFF_T_DECLARED
+#endif
+
+#ifndef _PID_T_DECLARED
+typedef __pid_t pid_t;
+#define _PID_T_DECLARED
+#endif
+#endif
+
+#ifndef _SA_FAMILY_T_DECLARED
+typedef __sa_family_t sa_family_t;
+#define _SA_FAMILY_T_DECLARED
+#endif
+
+#ifndef _SOCKLEN_T_DECLARED
+typedef __socklen_t socklen_t;
+#define _SOCKLEN_T_DECLARED
+#endif
+
+#ifndef _SSIZE_T_DECLARED
+typedef __ssize_t ssize_t;
+#define _SSIZE_T_DECLARED
+#endif
+
+#if __BSD_VISIBLE
+#ifndef _UID_T_DECLARED
+typedef __uid_t uid_t;
+#define _UID_T_DECLARED
+#endif
+#endif
+
+/*
+ * Types
+ */
+#define SOCK_STREAM 1 /* stream socket */
+#define SOCK_DGRAM 2 /* datagram socket */
+#define SOCK_RAW 3 /* raw-protocol interface */
+#if __BSD_VISIBLE
+#define SOCK_RDM 4 /* reliably-delivered message */
+#endif
+#define SOCK_SEQPACKET 5 /* sequenced packet stream */
+
+/*
+ * Option flags per-socket.
+ */
+#define SO_DEBUG 0x0001 /* turn on debugging info recording */
+#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
+#define SO_REUSEADDR 0x0004 /* allow local address reuse */
+#define SO_KEEPALIVE 0x0008 /* keep connections alive */
+#define SO_DONTROUTE 0x0010 /* just use interface addresses */
+#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
+#if __BSD_VISIBLE
+#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
+#endif
+#define SO_LINGER 0x0080 /* linger on close if data present */
+#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
+#if __BSD_VISIBLE
+#define SO_REUSEPORT 0x0200 /* allow local address & port reuse */
+#define SO_TIMESTAMP 0x0400 /* timestamp received dgram traffic */
+#define SO_NOSIGPIPE 0x0800 /* no SIGPIPE from EPIPE */
+#define SO_ACCEPTFILTER 0x1000 /* there is an accept filter */
+#define SO_BINTIME 0x2000 /* timestamp received dgram traffic */
+#endif
+#define SO_NO_OFFLOAD 0x4000 /* socket cannot be offloaded */
+#define SO_NO_DDP 0x8000 /* disable direct data placement */
+
+/*
+ * Additional options, not kept in so_options.
+ */
+#define SO_SNDBUF 0x1001 /* send buffer size */
+#define SO_RCVBUF 0x1002 /* receive buffer size */
+#define SO_SNDLOWAT 0x1003 /* send low-water mark */
+#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
+#define SO_SNDTIMEO 0x1005 /* send timeout */
+#define SO_RCVTIMEO 0x1006 /* receive timeout */
+#define SO_ERROR 0x1007 /* get error status and clear */
+#define SO_TYPE 0x1008 /* get socket type */
+#if __BSD_VISIBLE
+#define SO_LABEL 0x1009 /* socket's MAC label */
+#define SO_PEERLABEL 0x1010 /* socket's peer's MAC label */
+#define SO_LISTENQLIMIT 0x1011 /* socket's backlog limit */
+#define SO_LISTENQLEN 0x1012 /* socket's complete queue length */
+#define SO_LISTENINCQLEN 0x1013 /* socket's incomplete queue length */
+#define SO_SETFIB 0x1014 /* use this FIB to route */
+#endif
+
+/*
+ * Structure used for manipulating linger option.
+ */
+struct linger {
+ int l_onoff; /* option on/off */
+ int l_linger; /* linger time */
+};
+
+#if __BSD_VISIBLE
+struct accept_filter_arg {
+ char af_name[16];
+ char af_arg[256-16];
+};
+#endif
+
+/*
+ * Level number for (get/set)sockopt() to apply to socket itself.
+ */
+#define SOL_SOCKET 0xffff /* options for socket level */
+
+/*
+ * Address families.
+ */
+#define AF_UNSPEC 0 /* unspecified */
+#if __BSD_VISIBLE
+#define AF_LOCAL AF_UNIX /* local to host (pipes, portals) */
+#endif
+#define AF_UNIX 1 /* standardized name for AF_LOCAL */
+#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
+#if __BSD_VISIBLE
+#define AF_IMPLINK 3 /* arpanet imp addresses */
+#define AF_PUP 4 /* pup protocols: e.g. BSP */
+#define AF_CHAOS 5 /* mit CHAOS protocols */
+#define AF_NETBIOS 6 /* SMB protocols */
+#define AF_ISO 7 /* ISO protocols */
+#define AF_OSI AF_ISO
+#define AF_ECMA 8 /* European computer manufacturers */
+#define AF_DATAKIT 9 /* datakit protocols */
+#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
+#define AF_SNA 11 /* IBM SNA */
+#define AF_DECnet 12 /* DECnet */
+#define AF_DLI 13 /* DEC Direct data link interface */
+#define AF_LAT 14 /* LAT */
+#define AF_HYLINK 15 /* NSC Hyperchannel */
+#define AF_APPLETALK 16 /* Apple Talk */
+#define AF_ROUTE 17 /* Internal Routing Protocol */
+#define AF_LINK 18 /* Link layer interface */
+#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */
+#define AF_COIP 20 /* connection-oriented IP, aka ST II */
+#define AF_CNT 21 /* Computer Network Technology */
+#define pseudo_AF_RTIP 22 /* Help Identify RTIP packets */
+#define AF_IPX 23 /* Novell Internet Protocol */
+#define AF_SIP 24 /* Simple Internet Protocol */
+#define pseudo_AF_PIP 25 /* Help Identify PIP packets */
+#define AF_ISDN 26 /* Integrated Services Digital Network*/
+#define AF_E164 AF_ISDN /* CCITT E.164 recommendation */
+#define pseudo_AF_KEY 27 /* Internal key-management function */
+#endif
+#define AF_INET6 28 /* IPv6 */
+#if __BSD_VISIBLE
+#define AF_NATM 29 /* native ATM access */
+#define AF_ATM 30 /* ATM */
+#define pseudo_AF_HDRCMPLT 31 /* Used by BPF to not rewrite headers
+ * in interface output routine
+ */
+#define AF_NETGRAPH 32 /* Netgraph sockets */
+#define AF_SLOW 33 /* 802.3ad slow protocol */
+#define AF_SCLUSTER 34 /* Sitara cluster protocol */
+#define AF_ARP 35
+#define AF_BLUETOOTH 36 /* Bluetooth sockets */
+#define AF_IEEE80211 37 /* IEEE 802.11 protocol */
+#define AF_MAX 38
+/*
+ * When allocating a new AF_ constant, please only allocate
+ * even numbered constants for FreeBSD until 134 as odd numbered AF_
+ * constants 39-133 are now reserved for vendors.
+ */
+#define AF_VENDOR00 39
+#define AF_VENDOR01 41
+#define AF_VENDOR02 43
+#define AF_VENDOR03 45
+#define AF_VENDOR04 47
+#define AF_VENDOR05 49
+#define AF_VENDOR06 51
+#define AF_VENDOR07 53
+#define AF_VENDOR08 55
+#define AF_VENDOR09 57
+#define AF_VENDOR10 59
+#define AF_VENDOR11 61
+#define AF_VENDOR12 63
+#define AF_VENDOR13 65
+#define AF_VENDOR14 67
+#define AF_VENDOR15 69
+#define AF_VENDOR16 71
+#define AF_VENDOR17 73
+#define AF_VENDOR18 75
+#define AF_VENDOR19 77
+#define AF_VENDOR20 79
+#define AF_VENDOR21 81
+#define AF_VENDOR22 83
+#define AF_VENDOR23 85
+#define AF_VENDOR24 87
+#define AF_VENDOR25 89
+#define AF_VENDOR26 91
+#define AF_VENDOR27 93
+#define AF_VENDOR28 95
+#define AF_VENDOR29 97
+#define AF_VENDOR30 99
+#define AF_VENDOR31 101
+#define AF_VENDOR32 103
+#define AF_VENDOR33 105
+#define AF_VENDOR34 107
+#define AF_VENDOR35 109
+#define AF_VENDOR36 111
+#define AF_VENDOR37 113
+#define AF_VENDOR38 115
+#define AF_VENDOR39 117
+#define AF_VENDOR40 119
+#define AF_VENDOR41 121
+#define AF_VENDOR42 123
+#define AF_VENDOR43 125
+#define AF_VENDOR44 127
+#define AF_VENDOR45 129
+#define AF_VENDOR46 131
+#define AF_VENDOR47 133
+#endif
+
+/*
+ * Structure used by kernel to store most
+ * addresses.
+ */
+struct sockaddr {
+ unsigned char sa_len; /* total length */
+ sa_family_t sa_family; /* address family */
+ char sa_data[14]; /* actually longer; address value */
+};
+#if __BSD_VISIBLE
+#define SOCK_MAXADDRLEN 255 /* longest possible addresses */
+
+/*
+ * Structure used by kernel to pass protocol
+ * information in raw sockets.
+ */
+struct sockproto {
+ unsigned short sp_family; /* address family */
+ unsigned short sp_protocol; /* protocol */
+};
+#endif
+
+#ifndef _STRUCT_SOCKADDR_STORAGE_DECLARED
+/*
+ * RFC 2553: protocol-independent placeholder for socket addresses
+ */
+#define _SS_MAXSIZE 128U
+#define _SS_ALIGNSIZE (sizeof(__int64_t))
+#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(unsigned char) - \
+ sizeof(sa_family_t))
+#define _SS_PAD2SIZE (_SS_MAXSIZE - sizeof(unsigned char) - \
+ sizeof(sa_family_t) - _SS_PAD1SIZE - _SS_ALIGNSIZE)
+
+struct sockaddr_storage {
+ unsigned char ss_len; /* address length */
+ sa_family_t ss_family; /* address family */
+ char __ss_pad1[_SS_PAD1SIZE];
+ __int64_t __ss_align; /* force desired struct alignment */
+ char __ss_pad2[_SS_PAD2SIZE];
+};
+#define _STRUCT_SOCKADDR_STORAGE_DECLARED
+#endif
+
+#if __BSD_VISIBLE
+/*
+ * Protocol families, same as address families for now.
+ */
+#define PF_UNSPEC AF_UNSPEC
+#define PF_LOCAL AF_LOCAL
+#define PF_UNIX PF_LOCAL /* backward compatibility */
+#define PF_INET AF_INET
+#define PF_IMPLINK AF_IMPLINK
+#define PF_PUP AF_PUP
+#define PF_CHAOS AF_CHAOS
+#define PF_NETBIOS AF_NETBIOS
+#define PF_ISO AF_ISO
+#define PF_OSI AF_ISO
+#define PF_ECMA AF_ECMA
+#define PF_DATAKIT AF_DATAKIT
+#define PF_CCITT AF_CCITT
+#define PF_SNA AF_SNA
+#define PF_DECnet AF_DECnet
+#define PF_DLI AF_DLI
+#define PF_LAT AF_LAT
+#define PF_HYLINK AF_HYLINK
+#define PF_APPLETALK AF_APPLETALK
+#define PF_ROUTE AF_ROUTE
+#define PF_LINK AF_LINK
+#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */
+#define PF_COIP AF_COIP
+#define PF_CNT AF_CNT
+#define PF_SIP AF_SIP
+#define PF_IPX AF_IPX
+#define PF_RTIP pseudo_AF_RTIP /* same format as AF_INET */
+#define PF_PIP pseudo_AF_PIP
+#define PF_ISDN AF_ISDN
+#define PF_KEY pseudo_AF_KEY
+#define PF_INET6 AF_INET6
+#define PF_NATM AF_NATM
+#define PF_ATM AF_ATM
+#define PF_NETGRAPH AF_NETGRAPH
+#define PF_SLOW AF_SLOW
+#define PF_SCLUSTER AF_SCLUSTER
+#define PF_ARP AF_ARP
+#define PF_BLUETOOTH AF_BLUETOOTH
+
+#define PF_MAX AF_MAX
+
+/*
+ * Definitions for network related sysctl, CTL_NET.
+ *
+ * Second level is protocol family.
+ * Third level is protocol number.
+ *
+ * Further levels are defined by the individual families below.
+ */
+#define NET_MAXID AF_MAX
+
+#define CTL_NET_NAMES { \
+ { 0, 0 }, \
+ { "unix", CTLTYPE_NODE }, \
+ { "inet", CTLTYPE_NODE }, \
+ { "implink", CTLTYPE_NODE }, \
+ { "pup", CTLTYPE_NODE }, \
+ { "chaos", CTLTYPE_NODE }, \
+ { "xerox_ns", CTLTYPE_NODE }, \
+ { "iso", CTLTYPE_NODE }, \
+ { "emca", CTLTYPE_NODE }, \
+ { "datakit", CTLTYPE_NODE }, \
+ { "ccitt", CTLTYPE_NODE }, \
+ { "ibm_sna", CTLTYPE_NODE }, \
+ { "decnet", CTLTYPE_NODE }, \
+ { "dec_dli", CTLTYPE_NODE }, \
+ { "lat", CTLTYPE_NODE }, \
+ { "hylink", CTLTYPE_NODE }, \
+ { "appletalk", CTLTYPE_NODE }, \
+ { "route", CTLTYPE_NODE }, \
+ { "link_layer", CTLTYPE_NODE }, \
+ { "xtp", CTLTYPE_NODE }, \
+ { "coip", CTLTYPE_NODE }, \
+ { "cnt", CTLTYPE_NODE }, \
+ { "rtip", CTLTYPE_NODE }, \
+ { "ipx", CTLTYPE_NODE }, \
+ { "sip", CTLTYPE_NODE }, \
+ { "pip", CTLTYPE_NODE }, \
+ { "isdn", CTLTYPE_NODE }, \
+ { "key", CTLTYPE_NODE }, \
+ { "inet6", CTLTYPE_NODE }, \
+ { "natm", CTLTYPE_NODE }, \
+ { "atm", CTLTYPE_NODE }, \
+ { "hdrcomplete", CTLTYPE_NODE }, \
+ { "netgraph", CTLTYPE_NODE }, \
+ { "snp", CTLTYPE_NODE }, \
+ { "scp", CTLTYPE_NODE }, \
+}
+
+/*
+ * PF_ROUTE - Routing table
+ *
+ * Three additional levels are defined:
+ * Fourth: address family, 0 is wildcard
+ * Fifth: type of info, defined below
+ * Sixth: flag(s) to mask with for NET_RT_FLAGS
+ */
+#define NET_RT_DUMP 1 /* dump; may limit to a.f. */
+#define NET_RT_FLAGS 2 /* by flags, e.g. RESOLVING */
+#define NET_RT_IFLIST 3 /* survey interface list */
+#define NET_RT_IFMALIST 4 /* return multicast address list */
+#define NET_RT_MAXID 5
+
+#define CTL_NET_RT_NAMES { \
+ { 0, 0 }, \
+ { "dump", CTLTYPE_STRUCT }, \
+ { "flags", CTLTYPE_STRUCT }, \
+ { "iflist", CTLTYPE_STRUCT }, \
+ { "ifmalist", CTLTYPE_STRUCT }, \
+}
+#endif /* __BSD_VISIBLE */
+
+/*
+ * Maximum queue length specifiable by listen.
+ */
+#define SOMAXCONN 128
+
+/*
+ * Message header for recvmsg and sendmsg calls.
+ * Used value-result for recvmsg, value only for sendmsg.
+ */
+struct msghdr {
+ void *msg_name; /* optional address */
+ socklen_t msg_namelen; /* size of address */
+ struct iovec *msg_iov; /* scatter/gather array */
+ int msg_iovlen; /* # elements in msg_iov */
+ void *msg_control; /* ancillary data, see below */
+ socklen_t msg_controllen; /* ancillary data buffer len */
+ int msg_flags; /* flags on received message */
+};
+
+#define MSG_OOB 0x1 /* process out-of-band data */
+#define MSG_PEEK 0x2 /* peek at incoming message */
+#define MSG_DONTROUTE 0x4 /* send without using routing tables */
+#define MSG_EOR 0x8 /* data completes record */
+#define MSG_TRUNC 0x10 /* data discarded before delivery */
+#define MSG_CTRUNC 0x20 /* control data lost before delivery */
+#define MSG_WAITALL 0x40 /* wait for full request or error */
+#define MSG_NOTIFICATION 0x2000 /* SCTP notification */
+#if __BSD_VISIBLE
+#define MSG_DONTWAIT 0x80 /* this message should be nonblocking */
+#define MSG_EOF 0x100 /* data completes connection */
+#define MSG_NBIO 0x4000 /* FIONBIO mode, used by fifofs */
+#define MSG_COMPAT 0x8000 /* used in sendit() */
+#endif
+#ifdef _KERNEL
+#define MSG_SOCALLBCK 0x10000 /* for use by socket callbacks - soreceive (TCP) */
+#endif
+#if __BSD_VISIBLE
+#define MSG_NOSIGNAL 0x20000 /* do not generate SIGPIPE on EOF */
+#endif
+
+/*
+ * Header for ancillary data objects in msg_control buffer.
+ * Used for additional information with/about a datagram
+ * not expressible by flags. The format is a sequence
+ * of message elements headed by cmsghdr structures.
+ */
+struct cmsghdr {
+ socklen_t cmsg_len; /* data byte count, including hdr */
+ int cmsg_level; /* originating protocol */
+ int cmsg_type; /* protocol-specific type */
+/* followed by u_char cmsg_data[]; */
+};
+
+#if __BSD_VISIBLE
+/*
+ * While we may have more groups than this, the cmsgcred struct must
+ * be able to fit in an mbuf and we have historically supported a
+ * maximum of 16 groups.
+*/
+#define CMGROUP_MAX 16
+
+/*
+ * Credentials structure, used to verify the identity of a peer
+ * process that has sent us a message. This is allocated by the
+ * peer process but filled in by the kernel. This prevents the
+ * peer from lying about its identity. (Note that cmcred_groups[0]
+ * is the effective GID.)
+ */
+struct cmsgcred {
+ pid_t cmcred_pid; /* PID of sending process */
+ uid_t cmcred_uid; /* real UID of sending process */
+ uid_t cmcred_euid; /* effective UID of sending process */
+ gid_t cmcred_gid; /* real GID of sending process */
+ short cmcred_ngroups; /* number or groups */
+ gid_t cmcred_groups[CMGROUP_MAX]; /* groups */
+};
+
+/*
+ * Socket credentials.
+ */
+struct sockcred {
+ uid_t sc_uid; /* real user id */
+ uid_t sc_euid; /* effective user id */
+ gid_t sc_gid; /* real group id */
+ gid_t sc_egid; /* effective group id */
+ int sc_ngroups; /* number of supplemental groups */
+ gid_t sc_groups[1]; /* variable length */
+};
+
+/*
+ * Compute size of a sockcred structure with groups.
+ */
+#define SOCKCREDSIZE(ngrps) \
+ (sizeof(struct sockcred) + (sizeof(gid_t) * ((ngrps) - 1)))
+
+#endif /* __BSD_VISIBLE */
+
+/* given pointer to struct cmsghdr, return pointer to data */
+#define CMSG_DATA(cmsg) ((unsigned char *)(cmsg) + \
+ _ALIGN(sizeof(struct cmsghdr)))
+
+/* given pointer to struct cmsghdr, return pointer to next cmsghdr */
+#define CMSG_NXTHDR(mhdr, cmsg) \
+ ((char *)(cmsg) == NULL ? CMSG_FIRSTHDR(mhdr) : \
+ ((char *)(cmsg) + _ALIGN(((struct cmsghdr *)(cmsg))->cmsg_len) + \
+ _ALIGN(sizeof(struct cmsghdr)) > \
+ (char *)(mhdr)->msg_control + (mhdr)->msg_controllen) ? \
+ (struct cmsghdr *)0 : \
+ (struct cmsghdr *)((char *)(cmsg) + \
+ _ALIGN(((struct cmsghdr *)(cmsg))->cmsg_len)))
+
+/*
+ * RFC 2292 requires to check msg_controllen, in case that the kernel returns
+ * an empty list for some reasons.
+ */
+#define CMSG_FIRSTHDR(mhdr) \
+ ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
+ (struct cmsghdr *)(mhdr)->msg_control : \
+ (struct cmsghdr *)NULL)
+
+#if __BSD_VISIBLE
+/* RFC 2292 additions */
+#define CMSG_SPACE(l) (_ALIGN(sizeof(struct cmsghdr)) + _ALIGN(l))
+#define CMSG_LEN(l) (_ALIGN(sizeof(struct cmsghdr)) + (l))
+#endif
+
+#ifdef _KERNEL
+#define CMSG_ALIGN(n) _ALIGN(n)
+#endif
+
+/* "Socket"-level control message types: */
+#define SCM_RIGHTS 0x01 /* access rights (array of int) */
+#if __BSD_VISIBLE
+#define SCM_TIMESTAMP 0x02 /* timestamp (struct timeval) */
+#define SCM_CREDS 0x03 /* process creds (struct cmsgcred) */
+#define SCM_BINTIME 0x04 /* timestamp (struct bintime) */
+#endif
+
+#if __BSD_VISIBLE
+/*
+ * 4.3 compat sockaddr, move to compat file later
+ */
+struct osockaddr {
+ unsigned short sa_family; /* address family */
+ char sa_data[14]; /* up to 14 bytes of direct address */
+};
+
+/*
+ * 4.3-compat message header (move to compat file later).
+ */
+struct omsghdr {
+ char *msg_name; /* optional address */
+ int msg_namelen; /* size of address */
+ struct iovec *msg_iov; /* scatter/gather array */
+ int msg_iovlen; /* # elements in msg_iov */
+ char *msg_accrights; /* access rights sent/received */
+ int msg_accrightslen;
+};
+#endif
+
+/*
+ * howto arguments for shutdown(2), specified by Posix.1g.
+ */
+#define SHUT_RD 0 /* shut down the reading side */
+#define SHUT_WR 1 /* shut down the writing side */
+#define SHUT_RDWR 2 /* shut down both sides */
+
+/* we cheat and use the SHUT_XX defines for these */
+#define PRU_FLUSH_RD SHUT_RD
+#define PRU_FLUSH_WR SHUT_WR
+#define PRU_FLUSH_RDWR SHUT_RDWR
+
+
+#if __BSD_VISIBLE
+/*
+ * sendfile(2) header/trailer struct
+ */
+struct sf_hdtr {
+ struct iovec *headers; /* pointer to an array of header struct iovec's */
+ int hdr_cnt; /* number of header iovec's */
+ struct iovec *trailers; /* pointer to an array of trailer struct iovec's */
+ int trl_cnt; /* number of trailer iovec's */
+};
+
+/*
+ * Sendfile-specific flag(s)
+ */
+#define SF_NODISKIO 0x00000001
+#define SF_MNOWAIT 0x00000002
+#define SF_SYNC 0x00000004
+#endif
+
+#ifndef _KERNEL
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+int accept(int, struct sockaddr * __restrict, socklen_t * __restrict);
+int bind(int, const struct sockaddr *, socklen_t);
+int connect(int, const struct sockaddr *, socklen_t);
+int getpeername(int, struct sockaddr * __restrict, socklen_t * __restrict);
+int getsockname(int, struct sockaddr * __restrict, socklen_t * __restrict);
+int getsockopt(int, int, int, void * __restrict, socklen_t * __restrict);
+int listen(int, int);
+ssize_t recv(int, void *, size_t, int);
+ssize_t recvfrom(int, void *, size_t, int, struct sockaddr * __restrict, socklen_t * __restrict);
+ssize_t recvmsg(int, struct msghdr *, int);
+ssize_t send(int, const void *, size_t, int);
+ssize_t sendto(int, const void *,
+ size_t, int, const struct sockaddr *, socklen_t);
+ssize_t sendmsg(int, const struct msghdr *, int);
+#if __BSD_VISIBLE
+int sendfile(int, int, off_t, size_t, struct sf_hdtr *, off_t *, int);
+int setfib(int);
+#endif
+int setsockopt(int, int, int, const void *, socklen_t);
+int shutdown(int, int);
+int sockatmark(int);
+int socket(int, int, int);
+int socketpair(int, int, int, int *);
+__END_DECLS
+
+#endif /* !_KERNEL */
+
+#ifdef _KERNEL
+struct socket;
+
+struct tcpcb *so_sototcpcb(struct socket *so);
+struct inpcb *so_sotoinpcb(struct socket *so);
+struct sockbuf *so_sockbuf_snd(struct socket *);
+struct sockbuf *so_sockbuf_rcv(struct socket *);
+
+int so_state_get(const struct socket *);
+void so_state_set(struct socket *, int);
+
+int so_options_get(const struct socket *);
+void so_options_set(struct socket *, int);
+
+int so_error_get(const struct socket *);
+void so_error_set(struct socket *, int);
+
+int so_linger_get(const struct socket *);
+void so_linger_set(struct socket *, int);
+
+struct protosw *so_protosw_get(const struct socket *);
+void so_protosw_set(struct socket *, struct protosw *);
+
+void so_sorwakeup_locked(struct socket *so);
+void so_sowwakeup_locked(struct socket *so);
+
+void so_sorwakeup(struct socket *so);
+void so_sowwakeup(struct socket *so);
+
+void so_lock(struct socket *so);
+void so_unlock(struct socket *so);
+
+void so_listeners_apply_all(struct socket *so, void (*func)(struct socket *, void *), void *arg);
+
+#endif
+
+
+#endif /* !_SYS_SOCKET_H_ */
diff --git a/freebsd/sys/sys/socketvar.h b/freebsd/sys/sys/socketvar.h
index 5c3a9b4d..88990831 100644
--- a/freebsd/sys/sys/socketvar.h
+++ b/freebsd/sys/sys/socketvar.h
@@ -1,2 +1,393 @@
-#include <freebsd/bsd.h>
-#include <freebsd/sys/socketvar.h>
+/*-
+ * Copyright (c) 1982, 1986, 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)socketvar.h 8.3 (Berkeley) 2/19/95
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _SYS_SOCKETVAR_H_
+#define _SYS_SOCKETVAR_H_
+
+#include <sys/queue.h> /* for TAILQ macros */
+#include <sys/selinfo.h> /* for struct selinfo */
+#include <sys/_lock.h>
+#include <sys/_mutex.h>
+#include <sys/_sx.h>
+#include <sys/sockbuf.h>
+#include <sys/sockstate.h>
+#ifdef _KERNEL
+#include <sys/sockopt.h>
+#endif
+
+struct vnet;
+
+/*
+ * Kernel structure per socket.
+ * Contains send and receive buffer queues,
+ * handle on protocol and pointer to protocol
+ * private data and error information.
+ */
+typedef u_quad_t so_gen_t;
+
+struct socket;
+
+/*-
+ * Locking key to struct socket:
+ * (a) constant after allocation, no locking required.
+ * (b) locked by SOCK_LOCK(so).
+ * (c) locked by SOCKBUF_LOCK(&so->so_rcv).
+ * (d) locked by SOCKBUF_LOCK(&so->so_snd).
+ * (e) locked by ACCEPT_LOCK().
+ * (f) not locked since integer reads/writes are atomic.
+ * (g) used only as a sleep/wakeup address, no value.
+ * (h) locked by global mutex so_global_mtx.
+ */
+struct socket {
+ int so_count; /* (b) reference count */
+ short so_type; /* (a) generic type, see socket.h */
+ short so_options; /* from socket call, see socket.h */
+ short so_linger; /* time to linger while closing */
+ short so_state; /* (b) internal state flags SS_* */
+ int so_qstate; /* (e) internal state flags SQ_* */
+ void *so_pcb; /* protocol control block */
+ struct vnet *so_vnet; /* network stack instance */
+ struct protosw *so_proto; /* (a) protocol handle */
+/*
+ * Variables for connection queuing.
+ * Socket where accepts occur is so_head in all subsidiary sockets.
+ * If so_head is 0, socket is not related to an accept.
+ * For head socket so_incomp queues partially completed connections,
+ * while so_comp is a queue of connections ready to be accepted.
+ * If a connection is aborted and it has so_head set, then
+ * it has to be pulled out of either so_incomp or so_comp.
+ * We allow connections to queue up based on current queue lengths
+ * and limit on number of queued connections for this socket.
+ */
+ struct socket *so_head; /* (e) back pointer to listen socket */
+ TAILQ_HEAD(, socket) so_incomp; /* (e) queue of partial unaccepted connections */
+ TAILQ_HEAD(, socket) so_comp; /* (e) queue of complete unaccepted connections */
+ TAILQ_ENTRY(socket) so_list; /* (e) list of unaccepted connections */
+ u_short so_qlen; /* (e) number of unaccepted connections */
+ u_short so_incqlen; /* (e) number of unaccepted incomplete
+ connections */
+ u_short so_qlimit; /* (e) max number queued connections */
+ short so_timeo; /* (g) connection timeout */
+ u_short so_error; /* (f) error affecting connection */
+ struct sigio *so_sigio; /* [sg] information for async I/O or
+ out of band data (SIGURG) */
+ u_long so_oobmark; /* (c) chars to oob mark */
+ TAILQ_HEAD(, aiocblist) so_aiojobq; /* AIO ops waiting on socket */
+
+ struct sockbuf so_rcv, so_snd;
+
+ struct ucred *so_cred; /* (a) user credentials */
+ struct label *so_label; /* (b) MAC label for socket */
+ struct label *so_peerlabel; /* (b) cached MAC label for peer */
+ /* NB: generation count must not be first. */
+ so_gen_t so_gencnt; /* (h) generation count */
+ void *so_emuldata; /* (b) private data for emulators */
+ struct so_accf {
+ struct accept_filter *so_accept_filter;
+ void *so_accept_filter_arg; /* saved filter args */
+ char *so_accept_filter_str; /* saved user args */
+ } *so_accf;
+ int so_fibnum; /* routing domain for this socket */
+};
+
+/*
+ * Global accept mutex to serialize access to accept queues and
+ * fields associated with multiple sockets. This allows us to
+ * avoid defining a lock order between listen and accept sockets
+ * until such time as it proves to be a good idea.
+ */
+extern struct mtx accept_mtx;
+#define ACCEPT_LOCK_ASSERT() mtx_assert(&accept_mtx, MA_OWNED)
+#define ACCEPT_UNLOCK_ASSERT() mtx_assert(&accept_mtx, MA_NOTOWNED)
+#define ACCEPT_LOCK() mtx_lock(&accept_mtx)
+#define ACCEPT_UNLOCK() mtx_unlock(&accept_mtx)
+
+/*
+ * Per-socket mutex: we reuse the receive socket buffer mutex for space
+ * efficiency. This decision should probably be revisited as we optimize
+ * locking for the socket code.
+ */
+#define SOCK_MTX(_so) SOCKBUF_MTX(&(_so)->so_rcv)
+#define SOCK_LOCK(_so) SOCKBUF_LOCK(&(_so)->so_rcv)
+#define SOCK_OWNED(_so) SOCKBUF_OWNED(&(_so)->so_rcv)
+#define SOCK_UNLOCK(_so) SOCKBUF_UNLOCK(&(_so)->so_rcv)
+#define SOCK_LOCK_ASSERT(_so) SOCKBUF_LOCK_ASSERT(&(_so)->so_rcv)
+
+/*
+ * Socket state bits stored in so_qstate.
+ */
+#define SQ_INCOMP 0x0800 /* unaccepted, incomplete connection */
+#define SQ_COMP 0x1000 /* unaccepted, complete connection */
+
+/*
+ * Externalized form of struct socket used by the sysctl(3) interface.
+ */
+struct xsocket {
+ size_t xso_len; /* length of this structure */
+ struct socket *xso_so; /* makes a convenient handle sometimes */
+ short so_type;
+ short so_options;
+ short so_linger;
+ short so_state;
+ caddr_t so_pcb; /* another convenient handle */
+ int xso_protocol;
+ int xso_family;
+ u_short so_qlen;
+ u_short so_incqlen;
+ u_short so_qlimit;
+ short so_timeo;
+ u_short so_error;
+ pid_t so_pgid;
+ u_long so_oobmark;
+ struct xsockbuf so_rcv, so_snd;
+ uid_t so_uid; /* XXX */
+};
+
+#ifdef _KERNEL
+
+/*
+ * Macros for sockets and socket buffering.
+ */
+
+/*
+ * Flags to sblock().
+ */
+#define SBL_WAIT 0x00000001 /* Wait if not immediately available. */
+#define SBL_NOINTR 0x00000002 /* Force non-interruptible sleep. */
+#define SBL_VALID (SBL_WAIT | SBL_NOINTR)
+
+/*
+ * Do we need to notify the other side when I/O is possible?
+ */
+#define sb_notify(sb) (((sb)->sb_flags & (SB_WAIT | SB_SEL | SB_ASYNC | \
+ SB_UPCALL | SB_AIO | SB_KNOTE)) != 0)
+
+/* do we have to send all at once on a socket? */
+#define sosendallatonce(so) \
+ ((so)->so_proto->pr_flags & PR_ATOMIC)
+
+/* can we read something from so? */
+#define soreadabledata(so) \
+ ((so)->so_rcv.sb_cc >= (so)->so_rcv.sb_lowat || \
+ !TAILQ_EMPTY(&(so)->so_comp) || (so)->so_error)
+#define soreadable(so) \
+ (soreadabledata(so) || ((so)->so_rcv.sb_state & SBS_CANTRCVMORE))
+
+/* can we write something to so? */
+#define sowriteable(so) \
+ ((sbspace(&(so)->so_snd) >= (so)->so_snd.sb_lowat && \
+ (((so)->so_state&SS_ISCONNECTED) || \
+ ((so)->so_proto->pr_flags&PR_CONNREQUIRED)==0)) || \
+ ((so)->so_snd.sb_state & SBS_CANTSENDMORE) || \
+ (so)->so_error)
+
+/*
+ * soref()/sorele() ref-count the socket structure. Note that you must
+ * still explicitly close the socket, but the last ref count will free
+ * the structure.
+ */
+#define soref(so) do { \
+ SOCK_LOCK_ASSERT(so); \
+ ++(so)->so_count; \
+} while (0)
+
+#define sorele(so) do { \
+ ACCEPT_LOCK_ASSERT(); \
+ SOCK_LOCK_ASSERT(so); \
+ if ((so)->so_count <= 0) \
+ panic("sorele"); \
+ if (--(so)->so_count == 0) \
+ sofree(so); \
+ else { \
+ SOCK_UNLOCK(so); \
+ ACCEPT_UNLOCK(); \
+ } \
+} while (0)
+
+#define sotryfree(so) do { \
+ ACCEPT_LOCK_ASSERT(); \
+ SOCK_LOCK_ASSERT(so); \
+ if ((so)->so_count == 0) \
+ sofree(so); \
+ else { \
+ SOCK_UNLOCK(so); \
+ ACCEPT_UNLOCK(); \
+ } \
+} while(0)
+
+/*
+ * In sorwakeup() and sowwakeup(), acquire the socket buffer lock to
+ * avoid a non-atomic test-and-wakeup. However, sowakeup is
+ * responsible for releasing the lock if it is called. We unlock only
+ * if we don't call into sowakeup. If any code is introduced that
+ * directly invokes the underlying sowakeup() primitives, it must
+ * maintain the same semantics.
+ */
+#define sorwakeup_locked(so) do { \
+ SOCKBUF_LOCK_ASSERT(&(so)->so_rcv); \
+ if (sb_notify(&(so)->so_rcv)) \
+ sowakeup((so), &(so)->so_rcv); \
+ else \
+ SOCKBUF_UNLOCK(&(so)->so_rcv); \
+} while (0)
+
+#define sorwakeup(so) do { \
+ SOCKBUF_LOCK(&(so)->so_rcv); \
+ sorwakeup_locked(so); \
+} while (0)
+
+#define sowwakeup_locked(so) do { \
+ SOCKBUF_LOCK_ASSERT(&(so)->so_snd); \
+ if (sb_notify(&(so)->so_snd)) \
+ sowakeup((so), &(so)->so_snd); \
+ else \
+ SOCKBUF_UNLOCK(&(so)->so_snd); \
+} while (0)
+
+#define sowwakeup(so) do { \
+ SOCKBUF_LOCK(&(so)->so_snd); \
+ sowwakeup_locked(so); \
+} while (0)
+
+struct accept_filter {
+ char accf_name[16];
+ int (*accf_callback)
+ (struct socket *so, void *arg, int waitflag);
+ void * (*accf_create)
+ (struct socket *so, char *arg);
+ void (*accf_destroy)
+ (struct socket *so);
+ SLIST_ENTRY(accept_filter) accf_next;
+};
+
+#ifdef MALLOC_DECLARE
+MALLOC_DECLARE(M_ACCF);
+MALLOC_DECLARE(M_PCB);
+MALLOC_DECLARE(M_SONAME);
+#endif
+
+extern int maxsockets;
+extern u_long sb_max;
+extern struct uma_zone *socket_zone;
+extern so_gen_t so_gencnt;
+
+struct mbuf;
+struct sockaddr;
+struct ucred;
+struct uio;
+
+/* 'which' values for socket upcalls. */
+#define SO_RCV 1
+#define SO_SND 2
+
+/* Return values for socket upcalls. */
+#define SU_OK 0
+#define SU_ISCONNECTED 1
+
+/*
+ * From uipc_socket and friends
+ */
+int sockargs(struct mbuf **mp, caddr_t buf, int buflen, int type);
+int getsockaddr(struct sockaddr **namp, caddr_t uaddr, size_t len);
+void soabort(struct socket *so);
+int soaccept(struct socket *so, struct sockaddr **nam);
+int socheckuid(struct socket *so, uid_t uid);
+int sobind(struct socket *so, struct sockaddr *nam, struct thread *td);
+int soclose(struct socket *so);
+int soconnect(struct socket *so, struct sockaddr *nam, struct thread *td);
+int soconnect2(struct socket *so1, struct socket *so2);
+int socow_setup(struct mbuf *m0, struct uio *uio);
+int socreate(int dom, struct socket **aso, int type, int proto,
+ struct ucred *cred, struct thread *td);
+int sodisconnect(struct socket *so);
+struct sockaddr *sodupsockaddr(const struct sockaddr *sa, int mflags);
+void sofree(struct socket *so);
+void sohasoutofband(struct socket *so);
+int solisten(struct socket *so, int backlog, struct thread *td);
+void solisten_proto(struct socket *so, int backlog);
+int solisten_proto_check(struct socket *so);
+struct socket *
+ sonewconn(struct socket *head, int connstatus);
+
+
+int sopoll(struct socket *so, int events, struct ucred *active_cred,
+ struct thread *td);
+int sopoll_generic(struct socket *so, int events,
+ struct ucred *active_cred, struct thread *td);
+int soreceive(struct socket *so, struct sockaddr **paddr, struct uio *uio,
+ struct mbuf **mp0, struct mbuf **controlp, int *flagsp);
+int soreceive_stream(struct socket *so, struct sockaddr **paddr,
+ struct uio *uio, struct mbuf **mp0, struct mbuf **controlp,
+ int *flagsp);
+int soreceive_dgram(struct socket *so, struct sockaddr **paddr,
+ struct uio *uio, struct mbuf **mp0, struct mbuf **controlp,
+ int *flagsp);
+int soreceive_generic(struct socket *so, struct sockaddr **paddr,
+ struct uio *uio, struct mbuf **mp0, struct mbuf **controlp,
+ int *flagsp);
+int soreserve(struct socket *so, u_long sndcc, u_long rcvcc);
+void sorflush(struct socket *so);
+int sosend(struct socket *so, struct sockaddr *addr, struct uio *uio,
+ struct mbuf *top, struct mbuf *control, int flags,
+ struct thread *td);
+int sosend_dgram(struct socket *so, struct sockaddr *addr,
+ struct uio *uio, struct mbuf *top, struct mbuf *control,
+ int flags, struct thread *td);
+int sosend_generic(struct socket *so, struct sockaddr *addr,
+ struct uio *uio, struct mbuf *top, struct mbuf *control,
+ int flags, struct thread *td);
+int soshutdown(struct socket *so, int how);
+void sotoxsocket(struct socket *so, struct xsocket *xso);
+void soupcall_clear(struct socket *so, int which);
+void soupcall_set(struct socket *so, int which,
+ int (*func)(struct socket *, void *, int), void *arg);
+void sowakeup(struct socket *so, struct sockbuf *sb);
+int selsocket(struct socket *so, int events, struct timeval *tv,
+ struct thread *td);
+
+/*
+ * Accept filter functions (duh).
+ */
+int accept_filt_add(struct accept_filter *filt);
+int accept_filt_del(char *name);
+struct accept_filter *accept_filt_get(char *name);
+#ifdef ACCEPT_FILTER_MOD
+#ifdef SYSCTL_DECL
+SYSCTL_DECL(_net_inet_accf);
+#endif
+int accept_filt_generic_mod_event(module_t mod, int event, void *data);
+#endif
+
+#endif /* _KERNEL */
+
+#endif /* !_SYS_SOCKETVAR_H_ */
diff --git a/freebsd/sys/sys/sockio.h b/freebsd/sys/sys/sockio.h
index 319dc783..4c1c4839 100644
--- a/freebsd/sys/sys/sockio.h
+++ b/freebsd/sys/sys/sockio.h
@@ -30,10 +30,10 @@
* $FreeBSD$
*/
-#ifndef _SYS_SOCKIO_HH_
-#define _SYS_SOCKIO_HH_
+#ifndef _SYS_SOCKIO_H_
+#define _SYS_SOCKIO_H_
-#include <freebsd/sys/ioccom.h>
+#include <sys/ioccom.h>
/* Socket ioctl's. */
#define SIOCSHIWAT _IOW('s', 0, int) /* set high watermark */
@@ -125,4 +125,4 @@
#define SIOCDIFGROUP _IOW('i', 137, struct ifgroupreq) /* delete ifgroup */
#define SIOCGIFGMEMB _IOWR('i', 138, struct ifgroupreq) /* get members */
-#endif /* !_SYS_SOCKIO_HH_ */
+#endif /* !_SYS_SOCKIO_H_ */
diff --git a/freebsd/sys/sys/sockopt.h b/freebsd/sys/sys/sockopt.h
index 09dc5599..69d6c6dc 100644
--- a/freebsd/sys/sys/sockopt.h
+++ b/freebsd/sys/sys/sockopt.h
@@ -30,8 +30,8 @@
*
* $FreeBSD$
*/
-#ifndef _SYS_SOCKOPT_HH_
-#define _SYS_SOCKOPT_HH_
+#ifndef _SYS_SOCKOPT_H_
+#define _SYS_SOCKOPT_H_
#ifndef _KERNEL
#error "no user-servicable parts inside"
@@ -69,4 +69,4 @@ int do_setopt_accept_filter(struct socket *so, struct sockopt *sopt);
int so_setsockopt(struct socket *so, int level, int optname,
void *optval, size_t optlen);
-#endif /* _SYS_SOCKOPT_HH_ */
+#endif /* _SYS_SOCKOPT_H_ */
diff --git a/freebsd/sys/sys/sockstate.h b/freebsd/sys/sys/sockstate.h
index a6c4149d..52c85b76 100644
--- a/freebsd/sys/sys/sockstate.h
+++ b/freebsd/sys/sys/sockstate.h
@@ -30,8 +30,8 @@
*
* $FreeBSD$
*/
-#ifndef _SYS_SOCKTATE_HH_
-#define _SYS_SOCKTATE_HH_
+#ifndef _SYS_SOCKTATE_H_
+#define _SYS_SOCKTATE_H_
/*
* Socket state bits.
@@ -80,4 +80,4 @@ void socantrcvmore(struct socket *so);
void socantrcvmore_locked(struct socket *so);
void socantsendmore(struct socket *so);
void socantsendmore_locked(struct socket *so);
-#endif /* _SYS_SOCKTATE_HH_ */
+#endif /* _SYS_SOCKTATE_H_ */
diff --git a/freebsd/sys/sys/stddef.h b/freebsd/sys/sys/stddef.h
index 85de99d8..df51c369 100644
--- a/freebsd/sys/sys/stddef.h
+++ b/freebsd/sys/sys/stddef.h
@@ -26,17 +26,17 @@
* $FreeBSD$
*/
-#ifndef _SYS_STDDEF_HH_
-#define _SYS_STDDEF_HH_
-
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/_null.h>
-#include <freebsd/machine/_types.h>
+#ifndef _SYS_STDDEF_H_
+#define _SYS_STDDEF_H_
+#include <sys/cdefs.h>
#ifndef __rtems__
+#include <sys/_null.h>
+#include <machine/_types.h>
+
typedef __ptrdiff_t ptrdiff_t;
#define offsetof(type, field) __offsetof(type, field)
#endif /* __rtems__ */
-#endif /* !_SYS_STDDEF_HH_ */
+#endif /* !_SYS_STDDEF_H_ */
diff --git a/freebsd/sys/sys/stdint.h b/freebsd/sys/sys/stdint.h
index 10bab732..74e4a0ce 100644
--- a/freebsd/sys/sys/stdint.h
+++ b/freebsd/sys/sys/stdint.h
@@ -26,13 +26,14 @@
* $FreeBSD$
*/
-#ifndef _SYS_STDINT_HH_
-#define _SYS_STDINT_HH_
+#ifndef _SYS_STDINT_H_
+#define _SYS_STDINT_H_
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/_types.h>
+#include <sys/cdefs.h>
+#include <rtems/bsd/sys/_types.h>
-#include <freebsd/machine/_stdint.h>
+#ifndef __rtems__
+#include <machine/_stdint.h>
#ifndef _INT8_T_DECLARED
typedef __int8_t int8_t;
@@ -102,5 +103,6 @@ typedef __intptr_t intptr_t;
typedef __uintptr_t uintptr_t;
#define _INTPTR_T_DECLARED
#endif
+#endif /* __rtems__ */
-#endif /* !_SYS_STDINT_HH_ */
+#endif /* !_SYS_STDINT_H_ */
diff --git a/freebsd/sys/sys/sx.h b/freebsd/sys/sys/sx.h
index e6a22c13..dc19023c 100644
--- a/freebsd/sys/sys/sx.h
+++ b/freebsd/sys/sys/sx.h
@@ -29,17 +29,17 @@
* $FreeBSD$
*/
-#ifndef _SYS_SX_HH_
-#define _SYS_SX_HH_
+#ifndef _SYS_SX_H_
+#define _SYS_SX_H_
-#include <freebsd/sys/_lock.h>
-#include <freebsd/sys/_sx.h>
+#include <sys/_lock.h>
+#include <sys/_sx.h>
#ifdef _KERNEL
-#include <freebsd/sys/pcpu.h>
-#include <freebsd/sys/lock_profile.h>
-#include <freebsd/sys/lockstat.h>
-#include <freebsd/machine/atomic.h>
+#include <sys/pcpu.h>
+#include <sys/lock_profile.h>
+#include <sys/lockstat.h>
+#include <machine/atomic.h>
#endif
#ifdef __rtems__
@@ -210,7 +210,7 @@ __sx_sunlock(struct sx *sx, const char *file, int line)
* Public interface for lock operations.
*/
#ifndef LOCK_DEBUG
-#error "LOCK_DEBUG not defined, include <sys/lock.h> before <sys/sx.h>"
+#error "LOCK_DEBUG not defined, include <rtems/bsd/sys/lock.h> before <sys/sx.h>"
#endif
#if (LOCK_DEBUG > 0) || defined(SX_NOINLINE)
#define sx_xlock(sx) (void)_sx_xlock((sx), 0, LOCK_FILE, LOCK_LINE)
@@ -304,4 +304,4 @@ int sx_xlocked(struct sx *sx);
#endif /* _KERNEL */
-#endif /* !_SYS_SX_HH_ */
+#endif /* !_SYS_SX_H_ */
diff --git a/freebsd/sys/sys/sysctl.h b/freebsd/sys/sys/sysctl.h
index 11ed653d..35c0e984 100644
--- a/freebsd/sys/sys/sysctl.h
+++ b/freebsd/sys/sys/sysctl.h
@@ -1,2 +1,762 @@
-#include <freebsd/bsd.h>
-#include <freebsd/sys/sysctl.h>
+/*-
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Mike Karels at Berkeley Software Design, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)sysctl.h 8.1 (Berkeley) 6/2/93
+ * $FreeBSD$
+ */
+
+#ifndef _SYS_SYSCTL_H_
+#define _SYS_SYSCTL_H_
+
+#include <sys/queue.h>
+
+struct thread;
+/*
+ * Definitions for sysctl call. The sysctl call uses a hierarchical name
+ * for objects that can be examined or modified. The name is expressed as
+ * a sequence of integers. Like a file path name, the meaning of each
+ * component depends on its place in the hierarchy. The top-level and kern
+ * identifiers are defined here, and other identifiers are defined in the
+ * respective subsystem header files.
+ */
+
+#define CTL_MAXNAME 24 /* largest number of components supported */
+
+/*
+ * Each subsystem defined by sysctl defines a list of variables
+ * for that subsystem. Each name is either a node with further
+ * levels defined below it, or it is a leaf of some particular
+ * type given below. Each sysctl level defines a set of name/type
+ * pairs to be used by sysctl(8) in manipulating the subsystem.
+ */
+struct ctlname {
+ char *ctl_name; /* subsystem name */
+ int ctl_type; /* type of name */
+};
+
+#define CTLTYPE 0xf /* Mask for the type */
+#define CTLTYPE_NODE 1 /* name is a node */
+#define CTLTYPE_INT 2 /* name describes an integer */
+#define CTLTYPE_STRING 3 /* name describes a string */
+#define CTLTYPE_QUAD 4 /* name describes a 64-bit number */
+#define CTLTYPE_OPAQUE 5 /* name describes a structure */
+#define CTLTYPE_STRUCT CTLTYPE_OPAQUE /* name describes a structure */
+#define CTLTYPE_UINT 6 /* name describes an unsigned integer */
+#define CTLTYPE_LONG 7 /* name describes a long */
+#define CTLTYPE_ULONG 8 /* name describes an unsigned long */
+
+#define CTLFLAG_RD 0x80000000 /* Allow reads of variable */
+#define CTLFLAG_WR 0x40000000 /* Allow writes to the variable */
+#define CTLFLAG_RW (CTLFLAG_RD|CTLFLAG_WR)
+#define CTLFLAG_NOLOCK 0x20000000 /* XXX Don't Lock */
+#define CTLFLAG_ANYBODY 0x10000000 /* All users can set this var */
+#define CTLFLAG_SECURE 0x08000000 /* Permit set only if securelevel<=0 */
+#define CTLFLAG_PRISON 0x04000000 /* Prisoned roots can fiddle */
+#define CTLFLAG_DYN 0x02000000 /* Dynamic oid - can be freed */
+#define CTLFLAG_SKIP 0x01000000 /* Skip this sysctl when listing */
+#define CTLMASK_SECURE 0x00F00000 /* Secure level */
+#define CTLFLAG_TUN 0x00080000 /* Tunable variable */
+#define CTLFLAG_MPSAFE 0x00040000 /* Handler is MP safe */
+#define CTLFLAG_VNET 0x00020000 /* Prisons with vnet can fiddle */
+#define CTLFLAG_RDTUN (CTLFLAG_RD|CTLFLAG_TUN)
+
+/*
+ * Secure level. Note that CTLFLAG_SECURE == CTLFLAG_SECURE1.
+ *
+ * Secure when the securelevel is raised to at least N.
+ */
+#define CTLSHIFT_SECURE 20
+#define CTLFLAG_SECURE1 (CTLFLAG_SECURE | (0 << CTLSHIFT_SECURE))
+#define CTLFLAG_SECURE2 (CTLFLAG_SECURE | (1 << CTLSHIFT_SECURE))
+#define CTLFLAG_SECURE3 (CTLFLAG_SECURE | (2 << CTLSHIFT_SECURE))
+
+/*
+ * USE THIS instead of a hardwired number from the categories below
+ * to get dynamically assigned sysctl entries using the linker-set
+ * technology. This is the way nearly all new sysctl variables should
+ * be implemented.
+ * e.g. SYSCTL_INT(_parent, OID_AUTO, name, CTLFLAG_RW, &variable, 0, "");
+ */
+#define OID_AUTO (-1)
+
+/*
+ * The starting number for dynamically-assigned entries. WARNING!
+ * ALL static sysctl entries should have numbers LESS than this!
+ */
+#define CTL_AUTO_START 0x100
+
+#ifdef _KERNEL
+#define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, int arg2, \
+ struct sysctl_req *req
+
+/* definitions for sysctl_req 'lock' member */
+#define REQ_UNLOCKED 0 /* not locked and not wired */
+#define REQ_LOCKED 1 /* locked and not wired */
+#define REQ_WIRED 2 /* locked and wired */
+
+/* definitions for sysctl_req 'flags' member */
+#if defined(__amd64__) || defined(__ia64__)
+#define SCTL_MASK32 1 /* 32 bit emulation */
+#endif
+
+/*
+ * This describes the access space for a sysctl request. This is needed
+ * so that we can use the interface from the kernel or from user-space.
+ */
+struct sysctl_req {
+ struct thread *td; /* used for access checking */
+ int lock; /* locking/wiring state */
+ void *oldptr;
+ size_t oldlen;
+ size_t oldidx;
+ int (*oldfunc)(struct sysctl_req *, const void *, size_t);
+#ifndef __rtems__
+ void *newptr;
+#else /* __rtems__ */
+ const void *newptr;
+#endif /* __rtems__ */
+ size_t newlen;
+ size_t newidx;
+ int (*newfunc)(struct sysctl_req *, void *, size_t);
+ size_t validlen;
+ int flags;
+};
+
+SLIST_HEAD(sysctl_oid_list, sysctl_oid);
+
+/*
+ * This describes one "oid" in the MIB tree. Potentially more nodes can
+ * be hidden behind it, expanded by the handler.
+ */
+struct sysctl_oid {
+ struct sysctl_oid_list *oid_parent;
+ SLIST_ENTRY(sysctl_oid) oid_link;
+ int oid_number;
+ u_int oid_kind;
+ void *oid_arg1;
+ int oid_arg2;
+ const char *oid_name;
+ int (*oid_handler)(SYSCTL_HANDLER_ARGS);
+ const char *oid_fmt;
+ int oid_refcnt;
+ const char *oid_descr;
+};
+
+#define SYSCTL_IN(r, p, l) (r->newfunc)(r, p, l)
+#define SYSCTL_OUT(r, p, l) (r->oldfunc)(r, p, l)
+
+int sysctl_handle_int(SYSCTL_HANDLER_ARGS);
+int sysctl_msec_to_ticks(SYSCTL_HANDLER_ARGS);
+int sysctl_handle_long(SYSCTL_HANDLER_ARGS);
+int sysctl_handle_quad(SYSCTL_HANDLER_ARGS);
+int sysctl_handle_intptr(SYSCTL_HANDLER_ARGS);
+int sysctl_handle_string(SYSCTL_HANDLER_ARGS);
+int sysctl_handle_opaque(SYSCTL_HANDLER_ARGS);
+
+int sysctl_dpcpu_int(SYSCTL_HANDLER_ARGS);
+int sysctl_dpcpu_long(SYSCTL_HANDLER_ARGS);
+int sysctl_dpcpu_quad(SYSCTL_HANDLER_ARGS);
+
+/*
+ * These functions are used to add/remove an oid from the mib.
+ */
+void sysctl_register_oid(struct sysctl_oid *oidp);
+void sysctl_unregister_oid(struct sysctl_oid *oidp);
+
+/* Declare a static oid to allow child oids to be added to it. */
+#ifndef __rtems__
+#define SYSCTL_DECL(name) \
+ extern struct sysctl_oid_list sysctl_##name##_children
+#else /* __rtems__ */
+#define SYSCTL_DECL(name) \
+ extern struct sysctl_oid_list _bsd_sysctl_##name##_children
+#endif /* __rtems__ */
+
+/* Hide these in macros */
+#define SYSCTL_CHILDREN(oid_ptr) (struct sysctl_oid_list *) \
+ (oid_ptr)->oid_arg1
+#define SYSCTL_CHILDREN_SET(oid_ptr, val) \
+ (oid_ptr)->oid_arg1 = (val);
+#ifndef __rtems__
+#define SYSCTL_STATIC_CHILDREN(oid_name) \
+ (&sysctl_##oid_name##_children)
+#else /* __rtems__ */
+#define SYSCTL_STATIC_CHILDREN(oid_name) \
+ (&_bsd_sysctl_##oid_name##_children)
+#endif /* __rtems__ */
+
+/* === Structs and macros related to context handling === */
+
+/* All dynamically created sysctls can be tracked in a context list. */
+struct sysctl_ctx_entry {
+ struct sysctl_oid *entry;
+ TAILQ_ENTRY(sysctl_ctx_entry) link;
+};
+
+TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
+
+#ifndef __rtems__
+#define SYSCTL_NODE_CHILDREN(parent, name) \
+ sysctl_##parent##_##name##_children
+#else /* __rtems__ */
+#define SYSCTL_NODE_CHILDREN(parent, name) \
+ _bsd_sysctl_##parent##_##name##_children
+#endif /* __rtems__ */
+
+#ifndef NO_SYSCTL_DESCR
+#define __DESCR(d) d
+#else
+#define __DESCR(d) ""
+#endif
+
+/* This constructs a "raw" MIB oid. */
+#ifndef __rtems__
+#define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
+ static struct sysctl_oid sysctl__##parent##_##name = { \
+ &sysctl_##parent##_children, { NULL }, nbr, kind, \
+ a1, a2, #name, handler, fmt, 0, __DESCR(descr) }; \
+ DATA_SET(sysctl_set, sysctl__##parent##_##name)
+#else /* __rtems__ */
+#define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
+ static struct sysctl_oid sysctl__##parent##_##name = { \
+ &_bsd_sysctl_##parent##_children, { NULL }, nbr, kind, \
+ a1, a2, #name, handler, fmt, 0, __DESCR(descr) }; \
+ DATA_SET(sysctl_set, sysctl__##parent##_##name)
+#endif /* __rtems__ */
+
+#define SYSCTL_ADD_OID(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
+ sysctl_add_oid(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, __DESCR(descr))
+
+/* This constructs a node from which other oids can hang. */
+#define SYSCTL_NODE(parent, nbr, name, access, handler, descr) \
+ struct sysctl_oid_list SYSCTL_NODE_CHILDREN(parent, name); \
+ SYSCTL_OID(parent, nbr, name, CTLTYPE_NODE|(access), \
+ (void*)&SYSCTL_NODE_CHILDREN(parent, name), 0, handler, "N", descr)
+
+#define SYSCTL_ADD_NODE(ctx, parent, nbr, name, access, handler, descr) \
+ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_NODE|(access), \
+ NULL, 0, handler, "N", __DESCR(descr))
+
+/* Oid for a string. len can be 0 to indicate '\0' termination. */
+#define SYSCTL_STRING(parent, nbr, name, access, arg, len, descr) \
+ SYSCTL_OID(parent, nbr, name, CTLTYPE_STRING|(access), \
+ arg, len, sysctl_handle_string, "A", descr)
+
+#define SYSCTL_ADD_STRING(ctx, parent, nbr, name, access, arg, len, descr) \
+ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_STRING|(access), \
+ arg, len, sysctl_handle_string, "A", __DESCR(descr))
+
+/* Oid for an int. If ptr is NULL, val is returned. */
+#define SYSCTL_INT(parent, nbr, name, access, ptr, val, descr) \
+ SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|CTLFLAG_MPSAFE|(access), \
+ ptr, val, sysctl_handle_int, "I", descr)
+
+#define SYSCTL_ADD_INT(ctx, parent, nbr, name, access, ptr, val, descr) \
+ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_INT|CTLFLAG_MPSAFE|(access), \
+ ptr, val, sysctl_handle_int, "I", __DESCR(descr))
+
+/* Oid for an unsigned int. If ptr is NULL, val is returned. */
+#define SYSCTL_UINT(parent, nbr, name, access, ptr, val, descr) \
+ SYSCTL_OID(parent, nbr, name, CTLTYPE_UINT|CTLFLAG_MPSAFE|(access), \
+ ptr, val, sysctl_handle_int, "IU", descr)
+
+#define SYSCTL_ADD_UINT(ctx, parent, nbr, name, access, ptr, val, descr) \
+ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_UINT|CTLFLAG_MPSAFE|(access), \
+ ptr, val, sysctl_handle_int, "IU", __DESCR(descr))
+
+#define SYSCTL_XINT(parent, nbr, name, access, ptr, val, descr) \
+ SYSCTL_OID(parent, nbr, name, CTLTYPE_UINT|CTLFLAG_MPSAFE|(access), \
+ ptr, val, sysctl_handle_int, "IX", descr)
+
+#define SYSCTL_ADD_XINT(ctx, parent, nbr, name, access, ptr, val, descr) \
+ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_UINT|CTLFLAG_MPSAFE|(access), \
+ ptr, val, sysctl_handle_int, "IX", __DESCR(descr))
+
+/* Oid for a long. The pointer must be non NULL. */
+#define SYSCTL_LONG(parent, nbr, name, access, ptr, val, descr) \
+ SYSCTL_OID(parent, nbr, name, CTLTYPE_LONG|CTLFLAG_MPSAFE|(access), \
+ ptr, val, sysctl_handle_long, "L", descr)
+
+#define SYSCTL_ADD_LONG(ctx, parent, nbr, name, access, ptr, descr) \
+ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_LONG|CTLFLAG_MPSAFE|(access), \
+ ptr, 0, sysctl_handle_long, "L", __DESCR(descr))
+
+/* Oid for an unsigned long. The pointer must be non NULL. */
+#define SYSCTL_ULONG(parent, nbr, name, access, ptr, val, descr) \
+ SYSCTL_OID(parent, nbr, name, CTLTYPE_ULONG|CTLFLAG_MPSAFE|(access), \
+ ptr, val, sysctl_handle_long, "LU", __DESCR(descr))
+
+#define SYSCTL_ADD_ULONG(ctx, parent, nbr, name, access, ptr, descr) \
+ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_ULONG|CTLFLAG_MPSAFE|(access), \
+ ptr, 0, sysctl_handle_long, "LU", __DESCR(descr))
+
+#define SYSCTL_XLONG(parent, nbr, name, access, ptr, val, descr) \
+ SYSCTL_OID(parent, nbr, name, CTLTYPE_ULONG|CTLFLAG_MPSAFE|(access), \
+ ptr, val, sysctl_handle_long, "LX", __DESCR(descr))
+
+#define SYSCTL_ADD_XLONG(ctx, parent, nbr, name, access, ptr, descr) \
+ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_ULONG|CTLFLAG_MPSAFE|(access), \
+ ptr, 0, sysctl_handle_long, "LX", __DESCR(descr))
+
+/* Oid for a quad. The pointer must be non NULL. */
+#define SYSCTL_QUAD(parent, nbr, name, access, ptr, val, descr) \
+ SYSCTL_OID(parent, nbr, name, CTLTYPE_QUAD|CTLFLAG_MPSAFE|(access), \
+ ptr, val, sysctl_handle_quad, "Q", __DESCR(descr))
+
+#define SYSCTL_ADD_QUAD(ctx, parent, nbr, name, access, ptr, descr) \
+ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_QUAD|CTLFLAG_MPSAFE|(access), \
+ ptr, 0, sysctl_handle_quad, "Q", __DESCR(descr))
+
+/* Oid for an opaque object. Specified by a pointer and a length. */
+#define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr) \
+ SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), \
+ ptr, len, sysctl_handle_opaque, fmt, descr)
+
+#define SYSCTL_ADD_OPAQUE(ctx, parent, nbr, name, access, ptr, len, fmt, descr)\
+ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|(access), \
+ ptr, len, sysctl_handle_opaque, fmt, __DESCR(descr))
+
+/* Oid for a struct. Specified by a pointer and a type. */
+#define SYSCTL_STRUCT(parent, nbr, name, access, ptr, type, descr) \
+ SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), \
+ ptr, sizeof(struct type), sysctl_handle_opaque, \
+ "S," #type, descr)
+
+#define SYSCTL_ADD_STRUCT(ctx, parent, nbr, name, access, ptr, type, descr) \
+ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|(access), \
+ ptr, sizeof(struct type), sysctl_handle_opaque, "S," #type, __DESCR(descr))
+
+/* Oid for a procedure. Specified by a pointer and an arg. */
+#define SYSCTL_PROC(parent, nbr, name, access, ptr, arg, handler, fmt, descr) \
+ SYSCTL_OID(parent, nbr, name, (access), \
+ ptr, arg, handler, fmt, descr)
+
+#define SYSCTL_ADD_PROC(ctx, parent, nbr, name, access, ptr, arg, handler, fmt, descr) \
+ sysctl_add_oid(ctx, parent, nbr, name, (access), \
+ ptr, arg, handler, fmt, __DESCR(descr))
+
+/*
+ * A macro to generate a read-only sysctl to indicate the presense of optional
+ * kernel features.
+ */
+#define FEATURE(name, desc) \
+ SYSCTL_INT(_kern_features, OID_AUTO, name, CTLFLAG_RD, 0, 1, desc)
+
+#endif /* _KERNEL */
+
+/*
+ * Top-level identifiers
+ */
+#define CTL_UNSPEC 0 /* unused */
+#define CTL_KERN 1 /* "high kernel": proc, limits */
+#define CTL_VM 2 /* virtual memory */
+#define CTL_VFS 3 /* filesystem, mount type is next */
+#define CTL_NET 4 /* network, see socket.h */
+#define CTL_DEBUG 5 /* debugging parameters */
+#define CTL_HW 6 /* generic cpu/io */
+#define CTL_MACHDEP 7 /* machine dependent */
+#define CTL_USER 8 /* user-level */
+#define CTL_P1003_1B 9 /* POSIX 1003.1B */
+#define CTL_MAXID 10 /* number of valid top-level ids */
+
+#define CTL_NAMES { \
+ { 0, 0 }, \
+ { "kern", CTLTYPE_NODE }, \
+ { "vm", CTLTYPE_NODE }, \
+ { "vfs", CTLTYPE_NODE }, \
+ { "net", CTLTYPE_NODE }, \
+ { "debug", CTLTYPE_NODE }, \
+ { "hw", CTLTYPE_NODE }, \
+ { "machdep", CTLTYPE_NODE }, \
+ { "user", CTLTYPE_NODE }, \
+ { "p1003_1b", CTLTYPE_NODE }, \
+}
+
+/*
+ * CTL_KERN identifiers
+ */
+#define KERN_OSTYPE 1 /* string: system version */
+#define KERN_OSRELEASE 2 /* string: system release */
+#define KERN_OSREV 3 /* int: system revision */
+#define KERN_VERSION 4 /* string: compile time info */
+#define KERN_MAXVNODES 5 /* int: max vnodes */
+#define KERN_MAXPROC 6 /* int: max processes */
+#define KERN_MAXFILES 7 /* int: max open files */
+#define KERN_ARGMAX 8 /* int: max arguments to exec */
+#define KERN_SECURELVL 9 /* int: system security level */
+#define KERN_HOSTNAME 10 /* string: hostname */
+#define KERN_HOSTID 11 /* int: host identifier */
+#define KERN_CLOCKRATE 12 /* struct: struct clockrate */
+#define KERN_VNODE 13 /* struct: vnode structures */
+#define KERN_PROC 14 /* struct: process entries */
+#define KERN_FILE 15 /* struct: file entries */
+#define KERN_PROF 16 /* node: kernel profiling info */
+#define KERN_POSIX1 17 /* int: POSIX.1 version */
+#define KERN_NGROUPS 18 /* int: # of supplemental group ids */
+#define KERN_JOB_CONTROL 19 /* int: is job control available */
+#define KERN_SAVED_IDS 20 /* int: saved set-user/group-ID */
+#define KERN_BOOTTIME 21 /* struct: time kernel was booted */
+#define KERN_NISDOMAINNAME 22 /* string: YP domain name */
+#define KERN_UPDATEINTERVAL 23 /* int: update process sleep time */
+#define KERN_OSRELDATE 24 /* int: kernel release date */
+#define KERN_NTP_PLL 25 /* node: NTP PLL control */
+#define KERN_BOOTFILE 26 /* string: name of booted kernel */
+#define KERN_MAXFILESPERPROC 27 /* int: max open files per proc */
+#define KERN_MAXPROCPERUID 28 /* int: max processes per uid */
+#define KERN_DUMPDEV 29 /* struct cdev *: device to dump on */
+#define KERN_IPC 30 /* node: anything related to IPC */
+#define KERN_DUMMY 31 /* unused */
+#define KERN_PS_STRINGS 32 /* int: address of PS_STRINGS */
+#define KERN_USRSTACK 33 /* int: address of USRSTACK */
+#define KERN_LOGSIGEXIT 34 /* int: do we log sigexit procs? */
+#define KERN_IOV_MAX 35 /* int: value of UIO_MAXIOV */
+#define KERN_HOSTUUID 36 /* string: host UUID identifier */
+#define KERN_ARND 37 /* int: from arc4rand() */
+#define KERN_MAXID 38 /* number of valid kern ids */
+
+#define CTL_KERN_NAMES { \
+ { 0, 0 }, \
+ { "ostype", CTLTYPE_STRING }, \
+ { "osrelease", CTLTYPE_STRING }, \
+ { "osrevision", CTLTYPE_INT }, \
+ { "version", CTLTYPE_STRING }, \
+ { "maxvnodes", CTLTYPE_INT }, \
+ { "maxproc", CTLTYPE_INT }, \
+ { "maxfiles", CTLTYPE_INT }, \
+ { "argmax", CTLTYPE_INT }, \
+ { "securelevel", CTLTYPE_INT }, \
+ { "hostname", CTLTYPE_STRING }, \
+ { "hostid", CTLTYPE_UINT }, \
+ { "clockrate", CTLTYPE_STRUCT }, \
+ { "vnode", CTLTYPE_STRUCT }, \
+ { "proc", CTLTYPE_STRUCT }, \
+ { "file", CTLTYPE_STRUCT }, \
+ { "profiling", CTLTYPE_NODE }, \
+ { "posix1version", CTLTYPE_INT }, \
+ { "ngroups", CTLTYPE_INT }, \
+ { "job_control", CTLTYPE_INT }, \
+ { "saved_ids", CTLTYPE_INT }, \
+ { "boottime", CTLTYPE_STRUCT }, \
+ { "nisdomainname", CTLTYPE_STRING }, \
+ { "update", CTLTYPE_INT }, \
+ { "osreldate", CTLTYPE_INT }, \
+ { "ntp_pll", CTLTYPE_NODE }, \
+ { "bootfile", CTLTYPE_STRING }, \
+ { "maxfilesperproc", CTLTYPE_INT }, \
+ { "maxprocperuid", CTLTYPE_INT }, \
+ { "ipc", CTLTYPE_NODE }, \
+ { "dummy", CTLTYPE_INT }, \
+ { "ps_strings", CTLTYPE_INT }, \
+ { "usrstack", CTLTYPE_INT }, \
+ { "logsigexit", CTLTYPE_INT }, \
+ { "iov_max", CTLTYPE_INT }, \
+ { "hostuuid", CTLTYPE_STRING }, \
+ { "arc4rand", CTLTYPE_OPAQUE }, \
+}
+
+/*
+ * CTL_VFS identifiers
+ */
+#define CTL_VFS_NAMES { \
+ { "vfsconf", CTLTYPE_STRUCT }, \
+}
+
+/*
+ * KERN_PROC subtypes
+ */
+#define KERN_PROC_ALL 0 /* everything */
+#define KERN_PROC_PID 1 /* by process id */
+#define KERN_PROC_PGRP 2 /* by process group id */
+#define KERN_PROC_SESSION 3 /* by session of pid */
+#define KERN_PROC_TTY 4 /* by controlling tty */
+#define KERN_PROC_UID 5 /* by effective uid */
+#define KERN_PROC_RUID 6 /* by real uid */
+#define KERN_PROC_ARGS 7 /* get/set arguments/proctitle */
+#define KERN_PROC_PROC 8 /* only return procs */
+#define KERN_PROC_SV_NAME 9 /* get syscall vector name */
+#define KERN_PROC_RGID 10 /* by real group id */
+#define KERN_PROC_GID 11 /* by effective group id */
+#define KERN_PROC_PATHNAME 12 /* path to executable */
+#define KERN_PROC_OVMMAP 13 /* Old VM map entries for process */
+#define KERN_PROC_OFILEDESC 14 /* Old file descriptors for process */
+#define KERN_PROC_KSTACK 15 /* Kernel stacks for process */
+#define KERN_PROC_INC_THREAD 0x10 /*
+ * modifier for pid, pgrp, tty,
+ * uid, ruid, gid, rgid and proc
+ * This effectively uses 16-31
+ */
+#define KERN_PROC_VMMAP 32 /* VM map entries for process */
+#define KERN_PROC_FILEDESC 33 /* File descriptors for process */
+#define KERN_PROC_GROUPS 34 /* process groups */
+
+/*
+ * KERN_IPC identifiers
+ */
+#define KIPC_MAXSOCKBUF 1 /* int: max size of a socket buffer */
+#define KIPC_SOCKBUF_WASTE 2 /* int: wastage factor in sockbuf */
+#define KIPC_SOMAXCONN 3 /* int: max length of connection q */
+#define KIPC_MAX_LINKHDR 4 /* int: max length of link header */
+#define KIPC_MAX_PROTOHDR 5 /* int: max length of network header */
+#define KIPC_MAX_HDR 6 /* int: max total length of headers */
+#define KIPC_MAX_DATALEN 7 /* int: max length of data? */
+
+/*
+ * CTL_HW identifiers
+ */
+#define HW_MACHINE 1 /* string: machine class */
+#define HW_MODEL 2 /* string: specific machine model */
+#define HW_NCPU 3 /* int: number of cpus */
+#define HW_BYTEORDER 4 /* int: machine byte order */
+#define HW_PHYSMEM 5 /* int: total memory */
+#define HW_USERMEM 6 /* int: non-kernel memory */
+#define HW_PAGESIZE 7 /* int: software page size */
+#define HW_DISKNAMES 8 /* strings: disk drive names */
+#define HW_DISKSTATS 9 /* struct: diskstats[] */
+#define HW_FLOATINGPT 10 /* int: has HW floating point? */
+#define HW_MACHINE_ARCH 11 /* string: machine architecture */
+#define HW_REALMEM 12 /* int: 'real' memory */
+#define HW_MAXID 13 /* number of valid hw ids */
+
+#define CTL_HW_NAMES { \
+ { 0, 0 }, \
+ { "machine", CTLTYPE_STRING }, \
+ { "model", CTLTYPE_STRING }, \
+ { "ncpu", CTLTYPE_INT }, \
+ { "byteorder", CTLTYPE_INT }, \
+ { "physmem", CTLTYPE_ULONG }, \
+ { "usermem", CTLTYPE_ULONG }, \
+ { "pagesize", CTLTYPE_INT }, \
+ { "disknames", CTLTYPE_STRUCT }, \
+ { "diskstats", CTLTYPE_STRUCT }, \
+ { "floatingpoint", CTLTYPE_INT }, \
+ { "machine_arch", CTLTYPE_STRING }, \
+ { "realmem", CTLTYPE_ULONG }, \
+}
+
+/*
+ * CTL_USER definitions
+ */
+#define USER_CS_PATH 1 /* string: _CS_PATH */
+#define USER_BC_BASE_MAX 2 /* int: BC_BASE_MAX */
+#define USER_BC_DIM_MAX 3 /* int: BC_DIM_MAX */
+#define USER_BC_SCALE_MAX 4 /* int: BC_SCALE_MAX */
+#define USER_BC_STRING_MAX 5 /* int: BC_STRING_MAX */
+#define USER_COLL_WEIGHTS_MAX 6 /* int: COLL_WEIGHTS_MAX */
+#define USER_EXPR_NEST_MAX 7 /* int: EXPR_NEST_MAX */
+#define USER_LINE_MAX 8 /* int: LINE_MAX */
+#define USER_RE_DUP_MAX 9 /* int: RE_DUP_MAX */
+#define USER_POSIX2_VERSION 10 /* int: POSIX2_VERSION */
+#define USER_POSIX2_C_BIND 11 /* int: POSIX2_C_BIND */
+#define USER_POSIX2_C_DEV 12 /* int: POSIX2_C_DEV */
+#define USER_POSIX2_CHAR_TERM 13 /* int: POSIX2_CHAR_TERM */
+#define USER_POSIX2_FORT_DEV 14 /* int: POSIX2_FORT_DEV */
+#define USER_POSIX2_FORT_RUN 15 /* int: POSIX2_FORT_RUN */
+#define USER_POSIX2_LOCALEDEF 16 /* int: POSIX2_LOCALEDEF */
+#define USER_POSIX2_SW_DEV 17 /* int: POSIX2_SW_DEV */
+#define USER_POSIX2_UPE 18 /* int: POSIX2_UPE */
+#define USER_STREAM_MAX 19 /* int: POSIX2_STREAM_MAX */
+#define USER_TZNAME_MAX 20 /* int: POSIX2_TZNAME_MAX */
+#define USER_MAXID 21 /* number of valid user ids */
+
+#define CTL_USER_NAMES { \
+ { 0, 0 }, \
+ { "cs_path", CTLTYPE_STRING }, \
+ { "bc_base_max", CTLTYPE_INT }, \
+ { "bc_dim_max", CTLTYPE_INT }, \
+ { "bc_scale_max", CTLTYPE_INT }, \
+ { "bc_string_max", CTLTYPE_INT }, \
+ { "coll_weights_max", CTLTYPE_INT }, \
+ { "expr_nest_max", CTLTYPE_INT }, \
+ { "line_max", CTLTYPE_INT }, \
+ { "re_dup_max", CTLTYPE_INT }, \
+ { "posix2_version", CTLTYPE_INT }, \
+ { "posix2_c_bind", CTLTYPE_INT }, \
+ { "posix2_c_dev", CTLTYPE_INT }, \
+ { "posix2_char_term", CTLTYPE_INT }, \
+ { "posix2_fort_dev", CTLTYPE_INT }, \
+ { "posix2_fort_run", CTLTYPE_INT }, \
+ { "posix2_localedef", CTLTYPE_INT }, \
+ { "posix2_sw_dev", CTLTYPE_INT }, \
+ { "posix2_upe", CTLTYPE_INT }, \
+ { "stream_max", CTLTYPE_INT }, \
+ { "tzname_max", CTLTYPE_INT }, \
+}
+
+#define CTL_P1003_1B_ASYNCHRONOUS_IO 1 /* boolean */
+#define CTL_P1003_1B_MAPPED_FILES 2 /* boolean */
+#define CTL_P1003_1B_MEMLOCK 3 /* boolean */
+#define CTL_P1003_1B_MEMLOCK_RANGE 4 /* boolean */
+#define CTL_P1003_1B_MEMORY_PROTECTION 5 /* boolean */
+#define CTL_P1003_1B_MESSAGE_PASSING 6 /* boolean */
+#define CTL_P1003_1B_PRIORITIZED_IO 7 /* boolean */
+#define CTL_P1003_1B_PRIORITY_SCHEDULING 8 /* boolean */
+#define CTL_P1003_1B_REALTIME_SIGNALS 9 /* boolean */
+#define CTL_P1003_1B_SEMAPHORES 10 /* boolean */
+#define CTL_P1003_1B_FSYNC 11 /* boolean */
+#define CTL_P1003_1B_SHARED_MEMORY_OBJECTS 12 /* boolean */
+#define CTL_P1003_1B_SYNCHRONIZED_IO 13 /* boolean */
+#define CTL_P1003_1B_TIMERS 14 /* boolean */
+#define CTL_P1003_1B_AIO_LISTIO_MAX 15 /* int */
+#define CTL_P1003_1B_AIO_MAX 16 /* int */
+#define CTL_P1003_1B_AIO_PRIO_DELTA_MAX 17 /* int */
+#define CTL_P1003_1B_DELAYTIMER_MAX 18 /* int */
+#define CTL_P1003_1B_MQ_OPEN_MAX 19 /* int */
+#define CTL_P1003_1B_PAGESIZE 20 /* int */
+#define CTL_P1003_1B_RTSIG_MAX 21 /* int */
+#define CTL_P1003_1B_SEM_NSEMS_MAX 22 /* int */
+#define CTL_P1003_1B_SEM_VALUE_MAX 23 /* int */
+#define CTL_P1003_1B_SIGQUEUE_MAX 24 /* int */
+#define CTL_P1003_1B_TIMER_MAX 25 /* int */
+
+#define CTL_P1003_1B_MAXID 26
+
+#define CTL_P1003_1B_NAMES { \
+ { 0, 0 }, \
+ { "asynchronous_io", CTLTYPE_INT }, \
+ { "mapped_files", CTLTYPE_INT }, \
+ { "memlock", CTLTYPE_INT }, \
+ { "memlock_range", CTLTYPE_INT }, \
+ { "memory_protection", CTLTYPE_INT }, \
+ { "message_passing", CTLTYPE_INT }, \
+ { "prioritized_io", CTLTYPE_INT }, \
+ { "priority_scheduling", CTLTYPE_INT }, \
+ { "realtime_signals", CTLTYPE_INT }, \
+ { "semaphores", CTLTYPE_INT }, \
+ { "fsync", CTLTYPE_INT }, \
+ { "shared_memory_objects", CTLTYPE_INT }, \
+ { "synchronized_io", CTLTYPE_INT }, \
+ { "timers", CTLTYPE_INT }, \
+ { "aio_listio_max", CTLTYPE_INT }, \
+ { "aio_max", CTLTYPE_INT }, \
+ { "aio_prio_delta_max", CTLTYPE_INT }, \
+ { "delaytimer_max", CTLTYPE_INT }, \
+ { "mq_open_max", CTLTYPE_INT }, \
+ { "pagesize", CTLTYPE_INT }, \
+ { "rtsig_max", CTLTYPE_INT }, \
+ { "nsems_max", CTLTYPE_INT }, \
+ { "sem_value_max", CTLTYPE_INT }, \
+ { "sigqueue_max", CTLTYPE_INT }, \
+ { "timer_max", CTLTYPE_INT }, \
+}
+
+#ifdef _KERNEL
+
+/*
+ * Declare some common oids.
+ */
+#ifdef __rtems__
+#define sysctl__children _bsd_sysctl__children
+#endif /* __rtems__ */
+extern struct sysctl_oid_list sysctl__children;
+SYSCTL_DECL(_kern);
+SYSCTL_DECL(_kern_features);
+SYSCTL_DECL(_kern_ipc);
+SYSCTL_DECL(_kern_proc);
+SYSCTL_DECL(_kern_sched);
+SYSCTL_DECL(_kern_sched_stats);
+SYSCTL_DECL(_sysctl);
+SYSCTL_DECL(_vm);
+SYSCTL_DECL(_vm_stats);
+SYSCTL_DECL(_vm_stats_misc);
+SYSCTL_DECL(_vfs);
+SYSCTL_DECL(_net);
+SYSCTL_DECL(_debug);
+SYSCTL_DECL(_debug_sizeof);
+SYSCTL_DECL(_dev);
+SYSCTL_DECL(_hw);
+SYSCTL_DECL(_hw_bus);
+SYSCTL_DECL(_hw_bus_devices);
+SYSCTL_DECL(_hw_bus_info);
+SYSCTL_DECL(_machdep);
+SYSCTL_DECL(_user);
+SYSCTL_DECL(_compat);
+SYSCTL_DECL(_regression);
+SYSCTL_DECL(_security);
+SYSCTL_DECL(_security_bsd);
+
+extern char machine[];
+extern char osrelease[];
+extern char ostype[];
+extern char kern_ident[];
+
+/* Dynamic oid handling */
+struct sysctl_oid *sysctl_add_oid(struct sysctl_ctx_list *clist,
+ struct sysctl_oid_list *parent, int nbr, const char *name,
+ int kind, void *arg1, int arg2,
+ int (*handler) (SYSCTL_HANDLER_ARGS),
+ const char *fmt, const char *descr);
+void sysctl_rename_oid(struct sysctl_oid *oidp, const char *name);
+int sysctl_move_oid(struct sysctl_oid *oidp,
+ struct sysctl_oid_list *parent);
+int sysctl_remove_oid(struct sysctl_oid *oidp, int del, int recurse);
+int sysctl_ctx_init(struct sysctl_ctx_list *clist);
+int sysctl_ctx_free(struct sysctl_ctx_list *clist);
+struct sysctl_ctx_entry *sysctl_ctx_entry_add(struct sysctl_ctx_list *clist,
+ struct sysctl_oid *oidp);
+struct sysctl_ctx_entry *sysctl_ctx_entry_find(struct sysctl_ctx_list *clist,
+ struct sysctl_oid *oidp);
+int sysctl_ctx_entry_del(struct sysctl_ctx_list *clist,
+ struct sysctl_oid *oidp);
+
+int kernel_sysctl(struct thread *td, int *name, u_int namelen, void *old,
+#ifndef __rtems__
+ size_t *oldlenp, void *new, size_t newlen,
+#else /* __rtems__ */
+ size_t *oldlenp, const void *newp, size_t newlen,
+#endif /* __rtems__ */
+ size_t *retval, int flags);
+#ifndef __rtems__
+int kernel_sysctlbyname(struct thread *td, char *name,
+ void *old, size_t *oldlenp, void *new, size_t newlen,
+ size_t *retval, int flags);
+int userland_sysctl(struct thread *td, int *name, u_int namelen, void *old,
+ size_t *oldlenp, int inkernel, void *new, size_t newlen,
+ size_t *retval, int flags);
+#endif /* __rtems__ */
+int sysctl_find_oid(int *name, u_int namelen, struct sysctl_oid **noid,
+ int *nindx, struct sysctl_req *req);
+void sysctl_lock(void);
+void sysctl_unlock(void);
+int sysctl_wire_old_buffer(struct sysctl_req *req, size_t len);
+
+#ifndef __rtems__
+#else /* !_KERNEL */
+#endif /* __rtems__ */
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+int sysctl(int *, u_int, void *, size_t *, void *, size_t);
+int sysctlbyname(const char *, void *, size_t *, void *, size_t);
+int sysctlnametomib(const char *, int *, size_t *);
+__END_DECLS
+#endif /* _KERNEL */
+
+#endif /* !_SYS_SYSCTL_H_ */
diff --git a/freebsd/sys/sys/syslog.h b/freebsd/sys/sys/syslog.h
index a4aba4a1..5407a67e 100644
--- a/freebsd/sys/sys/syslog.h
+++ b/freebsd/sys/sys/syslog.h
@@ -186,15 +186,15 @@ CODE facilitynames[] = {
* __va_list from <sys/_types.h> and use it.
*/
#include <sys/cdefs.h>
-#include <sys/_types.h>
+#include <rtems/bsd/sys/_types.h>
__BEGIN_DECLS
void closelog(void);
void openlog(const char *, int, int);
int setlogmask(int);
-void syslog(int, const char *, ...); /* JRS __printflike(2, 3); */
+void syslog(int, const char *, ...) __printflike(2, 3);
#if __BSD_VISIBLE
-void vsyslog(int, const char *, __va_list); /* JRS __printflike(2, 0); */
+void vsyslog(int, const char *, __va_list) __printflike(2, 0);
#endif
__END_DECLS
diff --git a/freebsd/sys/sys/systm.h b/freebsd/sys/sys/systm.h
index 731626ee..1ab467d0 100644
--- a/freebsd/sys/sys/systm.h
+++ b/freebsd/sys/sys/systm.h
@@ -35,15 +35,15 @@
* $FreeBSD$
*/
-#ifndef _SYS_SYSTM_HH_
-#define _SYS_SYSTM_HH_
+#ifndef _SYS_SYSTM_H_
+#define _SYS_SYSTM_H_
-#include <freebsd/machine/atomic.h>
-#include <freebsd/machine/cpufunc.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/stdint.h> /* for people using printf mainly */
+#include <machine/atomic.h>
+#include <machine/cpufunc.h>
+#include <sys/callout.h>
+#include <sys/cdefs.h>
+#include <sys/queue.h>
+#include <sys/stdint.h> /* for people using printf mainly */
extern int cold; /* nonzero if we are doing a cold boot */
extern int rebooting; /* boot() has been called. */
@@ -279,7 +279,7 @@ struct timeval;
void adjust_timeout_calltodo(struct timeval *time_change);
#endif /* APM_FIXUP_CALLTODO */
-#include <freebsd/sys/libkern.h>
+#include <sys/libkern.h>
/* Initialize the world */
void consinit(void);
@@ -420,4 +420,4 @@ bitcount32(uint32_t x)
return (x);
}
-#endif /* !_SYS_SYSTM_HH_ */
+#endif /* !_SYS_SYSTM_H_ */
diff --git a/freebsd/sys/sys/taskqueue.h b/freebsd/sys/sys/taskqueue.h
index d5da47a9..bf2e4ee3 100644
--- a/freebsd/sys/sys/taskqueue.h
+++ b/freebsd/sys/sys/taskqueue.h
@@ -26,15 +26,15 @@
* $FreeBSD$
*/
-#ifndef _SYS_TASKQUEUE_HH_
-#define _SYS_TASKQUEUE_HH_
+#ifndef _SYS_TASKQUEUE_H_
+#define _SYS_TASKQUEUE_H_
#ifndef _KERNEL
#error "no user-servicable parts inside"
#endif
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/_task.h>
+#include <sys/queue.h>
+#include <sys/_task.h>
struct taskqueue;
struct thread;
@@ -158,4 +158,4 @@ struct taskqueue *taskqueue_create_fast(const char *name, int mflags,
taskqueue_enqueue_fn enqueue,
void *context);
-#endif /* !_SYS_TASKQUEUE_HH_ */
+#endif /* !_SYS_TASKQUEUE_H_ */
diff --git a/freebsd/sys/sys/timepps.h b/freebsd/sys/sys/timepps.h
index 1e5e84fc..4f3ce646 100644
--- a/freebsd/sys/sys/timepps.h
+++ b/freebsd/sys/sys/timepps.h
@@ -12,11 +12,11 @@
* timing interfaces.
*/
-#ifndef _SYS_TIMEPPS_HH_
-#define _SYS_TIMEPPS_HH_
+#ifndef _SYS_TIMEPPS_H_
+#define _SYS_TIMEPPS_H_
-#include <freebsd/sys/ioccom.h>
-#include <freebsd/sys/time.h>
+#include <sys/ioccom.h>
+#include <rtems/bsd/sys/time.h>
#define PPS_API_VERS_1 1
@@ -197,4 +197,4 @@ time_pps_kcbind(pps_handle_t handle, const int kernel_consumer,
#endif /* KERNEL */
-#endif /* !_SYS_TIMEPPS_HH_ */
+#endif /* !_SYS_TIMEPPS_H_ */
diff --git a/freebsd/sys/sys/timetc.h b/freebsd/sys/sys/timetc.h
index 6b1c9b91..d5a818b4 100644
--- a/freebsd/sys/sys/timetc.h
+++ b/freebsd/sys/sys/timetc.h
@@ -9,8 +9,8 @@
* $FreeBSD$
*/
-#ifndef _SYS_TIMETC_HH_
-#define _SYS_TIMETC_HH_
+#ifndef _SYS_TIMETC_H_
+#define _SYS_TIMETC_H_
#ifndef _KERNEL
#error "no user-serviceable parts inside"
@@ -75,4 +75,4 @@ void tc_ticktock(void);
SYSCTL_DECL(_kern_timecounter);
#endif
-#endif /* !_SYS_TIMETC_HH_ */
+#endif /* !_SYS_TIMETC_H_ */
diff --git a/freebsd/sys/sys/timex.h b/freebsd/sys/sys/timex.h
index 838a0e05..c34b5892 100644
--- a/freebsd/sys/sys/timex.h
+++ b/freebsd/sys/sys/timex.h
@@ -65,7 +65,7 @@
* ntp_gettime - NTP user application interface
*
* SYNOPSIS
- * #include <freebsd/sys/timex.h>
+ * #include <sys/timex.h>
*
* int ntp_gettime(struct ntptimeval *ntv);
*
@@ -80,8 +80,8 @@
* ntp_adjtime - NTP daemon application interface
*
* SYNOPSIS
- * #include <freebsd/sys/timex.h>
- * #include <freebsd/sys/syscall.h>
+ * #include <sys/timex.h>
+ * #include <sys/syscall.h>
*
* int syscall(SYS_ntp_adjtime, tptr);
* int SYS_ntp_adjtime;
@@ -93,13 +93,13 @@
* STA_NANO bit in the status word. See the description below for
* further information.
*/
-#ifndef _SYS_TIMEX_HH_
-#define _SYS_TIMEX_HH_ 1
+#ifndef _SYS_TIMEX_H_
+#define _SYS_TIMEX_H_ 1
#define NTP_API 4 /* NTP API version */
#ifndef __rtems__
#ifndef MSDOS /* Microsoft specific */
-#include <freebsd/sys/syscall.h>
+#include <sys/syscall.h>
#endif /* MSDOS */
#endif
@@ -225,7 +225,7 @@ struct timex {
#ifdef _KERNEL
void ntp_update_second(int64_t *adjustment, time_t *newsec);
#else /* !_KERNEL */
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__BEGIN_DECLS
int ntp_adjtime(struct timex *);
@@ -235,4 +235,4 @@ __END_DECLS
#endif /* __FreeBSD__ */
-#endif /* !_SYS_TIMEX_HH_ */
+#endif /* !_SYS_TIMEX_H_ */
diff --git a/freebsd/sys/sys/tree.h b/freebsd/sys/sys/tree.h
index ed0b9a27..1cce7278 100644
--- a/freebsd/sys/sys/tree.h
+++ b/freebsd/sys/sys/tree.h
@@ -27,10 +27,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef _SYS_TREE_HH_
-#define _SYS_TREE_HH_
+#ifndef _SYS_TREE_H_
+#define _SYS_TREE_H_
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
/*
* This file defines data structures for different types of trees:
@@ -762,4 +762,4 @@ name##_RB_MINMAX(struct name *head, int val) \
((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL); \
(x) = (y))
-#endif /* _SYS_TREE_HH_ */
+#endif /* _SYS_TREE_H_ */
diff --git a/freebsd/sys/sys/tty.h b/freebsd/sys/sys/tty.h
index a56d38fb..2cf454ef 100644
--- a/freebsd/sys/sys/tty.h
+++ b/freebsd/sys/sys/tty.h
@@ -29,20 +29,20 @@
* $FreeBSD$
*/
-#ifndef _SYS_TTY_HH_
-#define _SYS_TTY_HH_
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/selinfo.h>
+#ifndef _SYS_TTY_H_
+#define _SYS_TTY_H_
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/selinfo.h>
#ifndef __rtems__
-#include <freebsd/sys/termios.h>
+#include <sys/termios.h>
#endif
-#include <freebsd/sys/ttycom.h>
-#include <freebsd/sys/ttyqueue.h>
+#include <sys/ttycom.h>
+#include <sys/ttyqueue.h>
struct cdev;
struct file;
@@ -209,9 +209,9 @@ int pts_alloc_external(int fd, struct thread *td, struct file *fp,
struct cdev *dev, const char *name);
/* Drivers and line disciplines also need to call these. */
-#include <freebsd/sys/ttydisc.h>
-#include <freebsd/sys/ttydevsw.h>
-#include <freebsd/sys/ttyhook.h>
+#include <sys/ttydisc.h>
+#include <sys/ttydevsw.h>
+#include <sys/ttyhook.h>
#endif /* _KERNEL */
-#endif /* !_SYS_TTY_HH_ */
+#endif /* !_SYS_TTY_H_ */
diff --git a/freebsd/sys/sys/ttycom.h b/freebsd/sys/sys/ttycom.h
index cf7cba42..60b6145e 100644
--- a/freebsd/sys/sys/ttycom.h
+++ b/freebsd/sys/sys/ttycom.h
@@ -35,10 +35,10 @@
* $FreeBSD$
*/
-#ifndef _SYS_TTYCOM_HH_
-#define _SYS_TTYCOM_HH_
+#ifndef _SYS_TTYCOM_H_
+#define _SYS_TTYCOM_H_
-#include <freebsd/sys/ioccom.h>
+#include <sys/ioccom.h>
/*
* Tty ioctl's except for those supported only for backwards compatibility
@@ -143,4 +143,4 @@ struct winsize {
#define NETGRAPHDISC 6 /* Netgraph tty node discipline */
#define H4DISC 7 /* Netgraph Bluetooth H4 discipline */
-#endif /* !_SYS_TTYCOM_HH_ */
+#endif /* !_SYS_TTYCOM_H_ */
diff --git a/freebsd/sys/sys/ttydevsw.h b/freebsd/sys/sys/ttydevsw.h
index a4035585..e2278c3a 100644
--- a/freebsd/sys/sys/ttydevsw.h
+++ b/freebsd/sys/sys/ttydevsw.h
@@ -29,12 +29,12 @@
* $FreeBSD$
*/
-#ifndef _SYS_TTYDEVSW_HH_
-#define _SYS_TTYDEVSW_HH_
+#ifndef _SYS_TTYDEVSW_H_
+#define _SYS_TTYDEVSW_H_
-#ifndef _SYS_TTY_HH_
+#ifndef _SYS_TTY_H_
#error "can only be included through <sys/tty.h>"
-#endif /* !_SYS_TTY_HH_ */
+#endif /* !_SYS_TTY_H_ */
/*
* Driver routines that are called from the line discipline to adjust
@@ -166,4 +166,4 @@ ttydevsw_free(struct tty *tp)
tp->t_devsw->tsw_free(tty_softc(tp));
}
-#endif /* !_SYS_TTYDEVSW_HH_ */
+#endif /* !_SYS_TTYDEVSW_H_ */
diff --git a/freebsd/sys/sys/ttydisc.h b/freebsd/sys/sys/ttydisc.h
index 00194988..2ea54666 100644
--- a/freebsd/sys/sys/ttydisc.h
+++ b/freebsd/sys/sys/ttydisc.h
@@ -29,12 +29,12 @@
* $FreeBSD$
*/
-#ifndef _SYS_TTYDISC_HH_
-#define _SYS_TTYDISC_HH_
+#ifndef _SYS_TTYDISC_H_
+#define _SYS_TTYDISC_H_
-#ifndef _SYS_TTY_HH_
+#ifndef _SYS_TTY_H_
#error "can only be included through <sys/tty.h>"
-#endif /* !_SYS_TTY_HH_ */
+#endif /* !_SYS_TTY_H_ */
struct cv;
struct thread;
@@ -83,4 +83,4 @@ ttydisc_write_poll(struct tty *tp)
return ttyoutq_bytesleft(&tp->t_outq);
}
-#endif /* !_SYS_TTYDISC_HH_ */
+#endif /* !_SYS_TTYDISC_H_ */
diff --git a/freebsd/sys/sys/ttyhook.h b/freebsd/sys/sys/ttyhook.h
index a15fbbb7..2a6d0887 100644
--- a/freebsd/sys/sys/ttyhook.h
+++ b/freebsd/sys/sys/ttyhook.h
@@ -26,12 +26,12 @@
* $FreeBSD$
*/
-#ifndef _SYS_TTYHOOK_HH_
-#define _SYS_TTYHOOK_HH_
+#ifndef _SYS_TTYHOOK_H_
+#define _SYS_TTYHOOK_H_
-#ifndef _SYS_TTY_HH_
+#ifndef _SYS_TTY_H_
#error "can only be included through <sys/tty.h>"
-#endif /* !_SYS_TTY_HH_ */
+#endif /* !_SYS_TTY_H_ */
struct tty;
@@ -144,4 +144,4 @@ ttyhook_close(struct tty *tp)
tp->t_hook->th_close(tp);
}
-#endif /* !_SYS_TTYHOOK_HH_ */
+#endif /* !_SYS_TTYHOOK_H_ */
diff --git a/freebsd/sys/sys/ttyqueue.h b/freebsd/sys/sys/ttyqueue.h
index b9228bdc..2d1a565a 100644
--- a/freebsd/sys/sys/ttyqueue.h
+++ b/freebsd/sys/sys/ttyqueue.h
@@ -29,12 +29,12 @@
* $FreeBSD$
*/
-#ifndef _SYS_TTYQUEUE_HH_
-#define _SYS_TTYQUEUE_HH_
+#ifndef _SYS_TTYQUEUE_H_
+#define _SYS_TTYQUEUE_H_
-#ifndef _SYS_TTY_HH_
+#ifndef _SYS_TTY_H_
#error "can only be included through <sys/tty.h>"
-#endif /* !_SYS_TTY_HH_ */
+#endif /* !_SYS_TTY_H_ */
struct tty;
struct ttyinq_block;
@@ -175,4 +175,4 @@ ttyoutq_bytesused(struct ttyoutq *to)
}
#endif /* _KERNEL */
-#endif /* !_SYS_TTYQUEUE_HH_ */
+#endif /* !_SYS_TTYQUEUE_H_ */
diff --git a/freebsd/sys/sys/ucred.h b/freebsd/sys/sys/ucred.h
index 917cc750..a8934cec 100644
--- a/freebsd/sys/sys/ucred.h
+++ b/freebsd/sys/sys/ucred.h
@@ -30,10 +30,10 @@
* $FreeBSD$
*/
-#ifndef _SYS_UCRED_HH_
-#define _SYS_UCRED_HH_
+#ifndef _SYS_UCRED_H_
+#define _SYS_UCRED_H_
-#include <freebsd/bsm/audit.h>
+#include <bsm/audit.h>
/*
* Credentials.
@@ -107,4 +107,4 @@ void crsetgroups(struct ucred *cr, int n, gid_t *groups);
int groupmember(gid_t gid, struct ucred *cred);
#endif /* _KERNEL */
-#endif /* !_SYS_UCRED_HH_ */
+#endif /* !_SYS_UCRED_H_ */
diff --git a/freebsd/sys/sys/un.h b/freebsd/sys/sys/un.h
index 1f4731e6..a858abf4 100644
--- a/freebsd/sys/sys/un.h
+++ b/freebsd/sys/sys/un.h
@@ -34,7 +34,7 @@
#define _SYS_UN_H_
#include <sys/cdefs.h>
-#include <sys/_types.h>
+#include <rtems/bsd/sys/_types.h>
#ifndef _SA_FAMILY_T_DECLARED
typedef __sa_family_t sa_family_t;
diff --git a/freebsd/sys/sys/user.h b/freebsd/sys/sys/user.h
index df788c06..7ca16ad0 100644
--- a/freebsd/sys/sys/user.h
+++ b/freebsd/sys/sys/user.h
@@ -32,34 +32,34 @@
* $FreeBSD$
*/
-#ifndef _SYS_USER_HH_
-#define _SYS_USER_HH_
+#ifndef _SYS_USER_H_
+#define _SYS_USER_H_
-#include <freebsd/machine/pcb.h>
+#include <machine/pcb.h>
#ifndef _KERNEL
/* stuff that *used* to be included by user.h, or is now needed */
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/resource.h>
-#include <freebsd/sys/ucred.h>
-#include <freebsd/sys/uio.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/_lock.h>
-#include <freebsd/sys/_mutex.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/vm/vm.h> /* XXX */
-#include <freebsd/vm/vm_param.h> /* XXX */
-#include <freebsd/vm/pmap.h> /* XXX */
-#include <freebsd/vm/vm_map.h> /* XXX */
+#include <rtems/bsd/sys/errno.h>
+#include <rtems/bsd/sys/time.h>
+#include <rtems/bsd/sys/resource.h>
+#include <sys/ucred.h>
+#include <sys/uio.h>
+#include <sys/queue.h>
+#include <sys/_lock.h>
+#include <sys/_mutex.h>
+#include <sys/proc.h>
+#include <vm/vm.h> /* XXX */
+#include <vm/vm_param.h> /* XXX */
+#include <vm/pmap.h> /* XXX */
+#include <vm/vm_map.h> /* XXX */
#endif /* !_KERNEL */
-#ifndef _SYS_RESOURCEVAR_HH_
-#include <freebsd/sys/resourcevar.h>
+#ifndef _SYS_RESOURCEVAR_H_
+#include <sys/resourcevar.h>
#endif
-#ifndef _SYS_SIGNALVAR_HH_
-#include <freebsd/sys/signalvar.h>
+#ifndef _SYS_SIGNALVAR_H_
+#include <sys/signalvar.h>
#endif
-#ifndef _SYS_SOCKET_VAR_HH_
-#include <freebsd/sys/socket.h>
+#ifndef _SYS_SOCKET_VAR_H_
+#include <sys/socket.h>
#endif
/*
diff --git a/freebsd/sys/sys/vmmeter.h b/freebsd/sys/sys/vmmeter.h
index 3a470074..6c866c7f 100644
--- a/freebsd/sys/sys/vmmeter.h
+++ b/freebsd/sys/sys/vmmeter.h
@@ -30,8 +30,8 @@
* $FreeBSD$
*/
-#ifndef _SYS_VMMETER_HH_
-#define _SYS_VMMETER_HH_
+#ifndef _SYS_VMMETER_H_
+#define _SYS_VMMETER_H_
/*
* System wide statistics counters.
diff --git a/freebsd/sys/sysctl.h b/freebsd/sys/sysctl.h
deleted file mode 100644
index b2a421f5..00000000
--- a/freebsd/sys/sysctl.h
+++ /dev/null
@@ -1,762 +0,0 @@
-/*-
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Mike Karels at Berkeley Software Design, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)sysctl.h 8.1 (Berkeley) 6/2/93
- * $FreeBSD$
- */
-
-#ifndef _SYS_SYSCTL_HH_
-#define _SYS_SYSCTL_HH_
-
-#include <freebsd/sys/queue.h>
-
-struct thread;
-/*
- * Definitions for sysctl call. The sysctl call uses a hierarchical name
- * for objects that can be examined or modified. The name is expressed as
- * a sequence of integers. Like a file path name, the meaning of each
- * component depends on its place in the hierarchy. The top-level and kern
- * identifiers are defined here, and other identifiers are defined in the
- * respective subsystem header files.
- */
-
-#define CTL_MAXNAME 24 /* largest number of components supported */
-
-/*
- * Each subsystem defined by sysctl defines a list of variables
- * for that subsystem. Each name is either a node with further
- * levels defined below it, or it is a leaf of some particular
- * type given below. Each sysctl level defines a set of name/type
- * pairs to be used by sysctl(8) in manipulating the subsystem.
- */
-struct ctlname {
- char *ctl_name; /* subsystem name */
- int ctl_type; /* type of name */
-};
-
-#define CTLTYPE 0xf /* Mask for the type */
-#define CTLTYPE_NODE 1 /* name is a node */
-#define CTLTYPE_INT 2 /* name describes an integer */
-#define CTLTYPE_STRING 3 /* name describes a string */
-#define CTLTYPE_QUAD 4 /* name describes a 64-bit number */
-#define CTLTYPE_OPAQUE 5 /* name describes a structure */
-#define CTLTYPE_STRUCT CTLTYPE_OPAQUE /* name describes a structure */
-#define CTLTYPE_UINT 6 /* name describes an unsigned integer */
-#define CTLTYPE_LONG 7 /* name describes a long */
-#define CTLTYPE_ULONG 8 /* name describes an unsigned long */
-
-#define CTLFLAG_RD 0x80000000 /* Allow reads of variable */
-#define CTLFLAG_WR 0x40000000 /* Allow writes to the variable */
-#define CTLFLAG_RW (CTLFLAG_RD|CTLFLAG_WR)
-#define CTLFLAG_NOLOCK 0x20000000 /* XXX Don't Lock */
-#define CTLFLAG_ANYBODY 0x10000000 /* All users can set this var */
-#define CTLFLAG_SECURE 0x08000000 /* Permit set only if securelevel<=0 */
-#define CTLFLAG_PRISON 0x04000000 /* Prisoned roots can fiddle */
-#define CTLFLAG_DYN 0x02000000 /* Dynamic oid - can be freed */
-#define CTLFLAG_SKIP 0x01000000 /* Skip this sysctl when listing */
-#define CTLMASK_SECURE 0x00F00000 /* Secure level */
-#define CTLFLAG_TUN 0x00080000 /* Tunable variable */
-#define CTLFLAG_MPSAFE 0x00040000 /* Handler is MP safe */
-#define CTLFLAG_VNET 0x00020000 /* Prisons with vnet can fiddle */
-#define CTLFLAG_RDTUN (CTLFLAG_RD|CTLFLAG_TUN)
-
-/*
- * Secure level. Note that CTLFLAG_SECURE == CTLFLAG_SECURE1.
- *
- * Secure when the securelevel is raised to at least N.
- */
-#define CTLSHIFT_SECURE 20
-#define CTLFLAG_SECURE1 (CTLFLAG_SECURE | (0 << CTLSHIFT_SECURE))
-#define CTLFLAG_SECURE2 (CTLFLAG_SECURE | (1 << CTLSHIFT_SECURE))
-#define CTLFLAG_SECURE3 (CTLFLAG_SECURE | (2 << CTLSHIFT_SECURE))
-
-/*
- * USE THIS instead of a hardwired number from the categories below
- * to get dynamically assigned sysctl entries using the linker-set
- * technology. This is the way nearly all new sysctl variables should
- * be implemented.
- * e.g. SYSCTL_INT(_parent, OID_AUTO, name, CTLFLAG_RW, &variable, 0, "");
- */
-#define OID_AUTO (-1)
-
-/*
- * The starting number for dynamically-assigned entries. WARNING!
- * ALL static sysctl entries should have numbers LESS than this!
- */
-#define CTL_AUTO_START 0x100
-
-#ifdef _KERNEL
-#define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, int arg2, \
- struct sysctl_req *req
-
-/* definitions for sysctl_req 'lock' member */
-#define REQ_UNLOCKED 0 /* not locked and not wired */
-#define REQ_LOCKED 1 /* locked and not wired */
-#define REQ_WIRED 2 /* locked and wired */
-
-/* definitions for sysctl_req 'flags' member */
-#if defined(__amd64__) || defined(__ia64__)
-#define SCTL_MASK32 1 /* 32 bit emulation */
-#endif
-
-/*
- * This describes the access space for a sysctl request. This is needed
- * so that we can use the interface from the kernel or from user-space.
- */
-struct sysctl_req {
- struct thread *td; /* used for access checking */
- int lock; /* locking/wiring state */
- void *oldptr;
- size_t oldlen;
- size_t oldidx;
- int (*oldfunc)(struct sysctl_req *, const void *, size_t);
-#ifndef __rtems__
- void *newptr;
-#else /* __rtems__ */
- const void *newptr;
-#endif /* __rtems__ */
- size_t newlen;
- size_t newidx;
- int (*newfunc)(struct sysctl_req *, void *, size_t);
- size_t validlen;
- int flags;
-};
-
-SLIST_HEAD(sysctl_oid_list, sysctl_oid);
-
-/*
- * This describes one "oid" in the MIB tree. Potentially more nodes can
- * be hidden behind it, expanded by the handler.
- */
-struct sysctl_oid {
- struct sysctl_oid_list *oid_parent;
- SLIST_ENTRY(sysctl_oid) oid_link;
- int oid_number;
- u_int oid_kind;
- void *oid_arg1;
- int oid_arg2;
- const char *oid_name;
- int (*oid_handler)(SYSCTL_HANDLER_ARGS);
- const char *oid_fmt;
- int oid_refcnt;
- const char *oid_descr;
-};
-
-#define SYSCTL_IN(r, p, l) (r->newfunc)(r, p, l)
-#define SYSCTL_OUT(r, p, l) (r->oldfunc)(r, p, l)
-
-int sysctl_handle_int(SYSCTL_HANDLER_ARGS);
-int sysctl_msec_to_ticks(SYSCTL_HANDLER_ARGS);
-int sysctl_handle_long(SYSCTL_HANDLER_ARGS);
-int sysctl_handle_quad(SYSCTL_HANDLER_ARGS);
-int sysctl_handle_intptr(SYSCTL_HANDLER_ARGS);
-int sysctl_handle_string(SYSCTL_HANDLER_ARGS);
-int sysctl_handle_opaque(SYSCTL_HANDLER_ARGS);
-
-int sysctl_dpcpu_int(SYSCTL_HANDLER_ARGS);
-int sysctl_dpcpu_long(SYSCTL_HANDLER_ARGS);
-int sysctl_dpcpu_quad(SYSCTL_HANDLER_ARGS);
-
-/*
- * These functions are used to add/remove an oid from the mib.
- */
-void sysctl_register_oid(struct sysctl_oid *oidp);
-void sysctl_unregister_oid(struct sysctl_oid *oidp);
-
-/* Declare a static oid to allow child oids to be added to it. */
-#ifndef __rtems__
-#define SYSCTL_DECL(name) \
- extern struct sysctl_oid_list sysctl_##name##_children
-#else /* __rtems__ */
-#define SYSCTL_DECL(name) \
- extern struct sysctl_oid_list _bsd_sysctl_##name##_children
-#endif /* __rtems__ */
-
-/* Hide these in macros */
-#define SYSCTL_CHILDREN(oid_ptr) (struct sysctl_oid_list *) \
- (oid_ptr)->oid_arg1
-#define SYSCTL_CHILDREN_SET(oid_ptr, val) \
- (oid_ptr)->oid_arg1 = (val);
-#ifndef __rtems__
-#define SYSCTL_STATIC_CHILDREN(oid_name) \
- (&sysctl_##oid_name##_children)
-#else /* __rtems__ */
-#define SYSCTL_STATIC_CHILDREN(oid_name) \
- (&_bsd_sysctl_##oid_name##_children)
-#endif /* __rtems__ */
-
-/* === Structs and macros related to context handling === */
-
-/* All dynamically created sysctls can be tracked in a context list. */
-struct sysctl_ctx_entry {
- struct sysctl_oid *entry;
- TAILQ_ENTRY(sysctl_ctx_entry) link;
-};
-
-TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
-
-#ifndef __rtems__
-#define SYSCTL_NODE_CHILDREN(parent, name) \
- sysctl_##parent##_##name##_children
-#else /* __rtems__ */
-#define SYSCTL_NODE_CHILDREN(parent, name) \
- _bsd_sysctl_##parent##_##name##_children
-#endif /* __rtems__ */
-
-#ifndef NO_SYSCTL_DESCR
-#define __DESCR(d) d
-#else
-#define __DESCR(d) ""
-#endif
-
-/* This constructs a "raw" MIB oid. */
-#ifndef __rtems__
-#define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
- static struct sysctl_oid sysctl__##parent##_##name = { \
- &sysctl_##parent##_children, { NULL }, nbr, kind, \
- a1, a2, #name, handler, fmt, 0, __DESCR(descr) }; \
- DATA_SET(sysctl_set, sysctl__##parent##_##name)
-#else /* __rtems__ */
-#define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
- static struct sysctl_oid sysctl__##parent##_##name = { \
- &_bsd_sysctl_##parent##_children, { NULL }, nbr, kind, \
- a1, a2, #name, handler, fmt, 0, __DESCR(descr) }; \
- DATA_SET(sysctl_set, sysctl__##parent##_##name)
-#endif /* __rtems__ */
-
-#define SYSCTL_ADD_OID(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
- sysctl_add_oid(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, __DESCR(descr))
-
-/* This constructs a node from which other oids can hang. */
-#define SYSCTL_NODE(parent, nbr, name, access, handler, descr) \
- struct sysctl_oid_list SYSCTL_NODE_CHILDREN(parent, name); \
- SYSCTL_OID(parent, nbr, name, CTLTYPE_NODE|(access), \
- (void*)&SYSCTL_NODE_CHILDREN(parent, name), 0, handler, "N", descr)
-
-#define SYSCTL_ADD_NODE(ctx, parent, nbr, name, access, handler, descr) \
- sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_NODE|(access), \
- NULL, 0, handler, "N", __DESCR(descr))
-
-/* Oid for a string. len can be 0 to indicate '\0' termination. */
-#define SYSCTL_STRING(parent, nbr, name, access, arg, len, descr) \
- SYSCTL_OID(parent, nbr, name, CTLTYPE_STRING|(access), \
- arg, len, sysctl_handle_string, "A", descr)
-
-#define SYSCTL_ADD_STRING(ctx, parent, nbr, name, access, arg, len, descr) \
- sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_STRING|(access), \
- arg, len, sysctl_handle_string, "A", __DESCR(descr))
-
-/* Oid for an int. If ptr is NULL, val is returned. */
-#define SYSCTL_INT(parent, nbr, name, access, ptr, val, descr) \
- SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|CTLFLAG_MPSAFE|(access), \
- ptr, val, sysctl_handle_int, "I", descr)
-
-#define SYSCTL_ADD_INT(ctx, parent, nbr, name, access, ptr, val, descr) \
- sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_INT|CTLFLAG_MPSAFE|(access), \
- ptr, val, sysctl_handle_int, "I", __DESCR(descr))
-
-/* Oid for an unsigned int. If ptr is NULL, val is returned. */
-#define SYSCTL_UINT(parent, nbr, name, access, ptr, val, descr) \
- SYSCTL_OID(parent, nbr, name, CTLTYPE_UINT|CTLFLAG_MPSAFE|(access), \
- ptr, val, sysctl_handle_int, "IU", descr)
-
-#define SYSCTL_ADD_UINT(ctx, parent, nbr, name, access, ptr, val, descr) \
- sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_UINT|CTLFLAG_MPSAFE|(access), \
- ptr, val, sysctl_handle_int, "IU", __DESCR(descr))
-
-#define SYSCTL_XINT(parent, nbr, name, access, ptr, val, descr) \
- SYSCTL_OID(parent, nbr, name, CTLTYPE_UINT|CTLFLAG_MPSAFE|(access), \
- ptr, val, sysctl_handle_int, "IX", descr)
-
-#define SYSCTL_ADD_XINT(ctx, parent, nbr, name, access, ptr, val, descr) \
- sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_UINT|CTLFLAG_MPSAFE|(access), \
- ptr, val, sysctl_handle_int, "IX", __DESCR(descr))
-
-/* Oid for a long. The pointer must be non NULL. */
-#define SYSCTL_LONG(parent, nbr, name, access, ptr, val, descr) \
- SYSCTL_OID(parent, nbr, name, CTLTYPE_LONG|CTLFLAG_MPSAFE|(access), \
- ptr, val, sysctl_handle_long, "L", descr)
-
-#define SYSCTL_ADD_LONG(ctx, parent, nbr, name, access, ptr, descr) \
- sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_LONG|CTLFLAG_MPSAFE|(access), \
- ptr, 0, sysctl_handle_long, "L", __DESCR(descr))
-
-/* Oid for an unsigned long. The pointer must be non NULL. */
-#define SYSCTL_ULONG(parent, nbr, name, access, ptr, val, descr) \
- SYSCTL_OID(parent, nbr, name, CTLTYPE_ULONG|CTLFLAG_MPSAFE|(access), \
- ptr, val, sysctl_handle_long, "LU", __DESCR(descr))
-
-#define SYSCTL_ADD_ULONG(ctx, parent, nbr, name, access, ptr, descr) \
- sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_ULONG|CTLFLAG_MPSAFE|(access), \
- ptr, 0, sysctl_handle_long, "LU", __DESCR(descr))
-
-#define SYSCTL_XLONG(parent, nbr, name, access, ptr, val, descr) \
- SYSCTL_OID(parent, nbr, name, CTLTYPE_ULONG|CTLFLAG_MPSAFE|(access), \
- ptr, val, sysctl_handle_long, "LX", __DESCR(descr))
-
-#define SYSCTL_ADD_XLONG(ctx, parent, nbr, name, access, ptr, descr) \
- sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_ULONG|CTLFLAG_MPSAFE|(access), \
- ptr, 0, sysctl_handle_long, "LX", __DESCR(descr))
-
-/* Oid for a quad. The pointer must be non NULL. */
-#define SYSCTL_QUAD(parent, nbr, name, access, ptr, val, descr) \
- SYSCTL_OID(parent, nbr, name, CTLTYPE_QUAD|CTLFLAG_MPSAFE|(access), \
- ptr, val, sysctl_handle_quad, "Q", __DESCR(descr))
-
-#define SYSCTL_ADD_QUAD(ctx, parent, nbr, name, access, ptr, descr) \
- sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_QUAD|CTLFLAG_MPSAFE|(access), \
- ptr, 0, sysctl_handle_quad, "Q", __DESCR(descr))
-
-/* Oid for an opaque object. Specified by a pointer and a length. */
-#define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr) \
- SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), \
- ptr, len, sysctl_handle_opaque, fmt, descr)
-
-#define SYSCTL_ADD_OPAQUE(ctx, parent, nbr, name, access, ptr, len, fmt, descr)\
- sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|(access), \
- ptr, len, sysctl_handle_opaque, fmt, __DESCR(descr))
-
-/* Oid for a struct. Specified by a pointer and a type. */
-#define SYSCTL_STRUCT(parent, nbr, name, access, ptr, type, descr) \
- SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), \
- ptr, sizeof(struct type), sysctl_handle_opaque, \
- "S," #type, descr)
-
-#define SYSCTL_ADD_STRUCT(ctx, parent, nbr, name, access, ptr, type, descr) \
- sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|(access), \
- ptr, sizeof(struct type), sysctl_handle_opaque, "S," #type, __DESCR(descr))
-
-/* Oid for a procedure. Specified by a pointer and an arg. */
-#define SYSCTL_PROC(parent, nbr, name, access, ptr, arg, handler, fmt, descr) \
- SYSCTL_OID(parent, nbr, name, (access), \
- ptr, arg, handler, fmt, descr)
-
-#define SYSCTL_ADD_PROC(ctx, parent, nbr, name, access, ptr, arg, handler, fmt, descr) \
- sysctl_add_oid(ctx, parent, nbr, name, (access), \
- ptr, arg, handler, fmt, __DESCR(descr))
-
-/*
- * A macro to generate a read-only sysctl to indicate the presense of optional
- * kernel features.
- */
-#define FEATURE(name, desc) \
- SYSCTL_INT(_kern_features, OID_AUTO, name, CTLFLAG_RD, 0, 1, desc)
-
-#endif /* _KERNEL */
-
-/*
- * Top-level identifiers
- */
-#define CTL_UNSPEC 0 /* unused */
-#define CTL_KERN 1 /* "high kernel": proc, limits */
-#define CTL_VM 2 /* virtual memory */
-#define CTL_VFS 3 /* filesystem, mount type is next */
-#define CTL_NET 4 /* network, see socket.h */
-#define CTL_DEBUG 5 /* debugging parameters */
-#define CTL_HW 6 /* generic cpu/io */
-#define CTL_MACHDEP 7 /* machine dependent */
-#define CTL_USER 8 /* user-level */
-#define CTL_P1003_1B 9 /* POSIX 1003.1B */
-#define CTL_MAXID 10 /* number of valid top-level ids */
-
-#define CTL_NAMES { \
- { 0, 0 }, \
- { "kern", CTLTYPE_NODE }, \
- { "vm", CTLTYPE_NODE }, \
- { "vfs", CTLTYPE_NODE }, \
- { "net", CTLTYPE_NODE }, \
- { "debug", CTLTYPE_NODE }, \
- { "hw", CTLTYPE_NODE }, \
- { "machdep", CTLTYPE_NODE }, \
- { "user", CTLTYPE_NODE }, \
- { "p1003_1b", CTLTYPE_NODE }, \
-}
-
-/*
- * CTL_KERN identifiers
- */
-#define KERN_OSTYPE 1 /* string: system version */
-#define KERN_OSRELEASE 2 /* string: system release */
-#define KERN_OSREV 3 /* int: system revision */
-#define KERN_VERSION 4 /* string: compile time info */
-#define KERN_MAXVNODES 5 /* int: max vnodes */
-#define KERN_MAXPROC 6 /* int: max processes */
-#define KERN_MAXFILES 7 /* int: max open files */
-#define KERN_ARGMAX 8 /* int: max arguments to exec */
-#define KERN_SECURELVL 9 /* int: system security level */
-#define KERN_HOSTNAME 10 /* string: hostname */
-#define KERN_HOSTID 11 /* int: host identifier */
-#define KERN_CLOCKRATE 12 /* struct: struct clockrate */
-#define KERN_VNODE 13 /* struct: vnode structures */
-#define KERN_PROC 14 /* struct: process entries */
-#define KERN_FILE 15 /* struct: file entries */
-#define KERN_PROF 16 /* node: kernel profiling info */
-#define KERN_POSIX1 17 /* int: POSIX.1 version */
-#define KERN_NGROUPS 18 /* int: # of supplemental group ids */
-#define KERN_JOB_CONTROL 19 /* int: is job control available */
-#define KERN_SAVED_IDS 20 /* int: saved set-user/group-ID */
-#define KERN_BOOTTIME 21 /* struct: time kernel was booted */
-#define KERN_NISDOMAINNAME 22 /* string: YP domain name */
-#define KERN_UPDATEINTERVAL 23 /* int: update process sleep time */
-#define KERN_OSRELDATE 24 /* int: kernel release date */
-#define KERN_NTP_PLL 25 /* node: NTP PLL control */
-#define KERN_BOOTFILE 26 /* string: name of booted kernel */
-#define KERN_MAXFILESPERPROC 27 /* int: max open files per proc */
-#define KERN_MAXPROCPERUID 28 /* int: max processes per uid */
-#define KERN_DUMPDEV 29 /* struct cdev *: device to dump on */
-#define KERN_IPC 30 /* node: anything related to IPC */
-#define KERN_DUMMY 31 /* unused */
-#define KERN_PS_STRINGS 32 /* int: address of PS_STRINGS */
-#define KERN_USRSTACK 33 /* int: address of USRSTACK */
-#define KERN_LOGSIGEXIT 34 /* int: do we log sigexit procs? */
-#define KERN_IOV_MAX 35 /* int: value of UIO_MAXIOV */
-#define KERN_HOSTUUID 36 /* string: host UUID identifier */
-#define KERN_ARND 37 /* int: from arc4rand() */
-#define KERN_MAXID 38 /* number of valid kern ids */
-
-#define CTL_KERN_NAMES { \
- { 0, 0 }, \
- { "ostype", CTLTYPE_STRING }, \
- { "osrelease", CTLTYPE_STRING }, \
- { "osrevision", CTLTYPE_INT }, \
- { "version", CTLTYPE_STRING }, \
- { "maxvnodes", CTLTYPE_INT }, \
- { "maxproc", CTLTYPE_INT }, \
- { "maxfiles", CTLTYPE_INT }, \
- { "argmax", CTLTYPE_INT }, \
- { "securelevel", CTLTYPE_INT }, \
- { "hostname", CTLTYPE_STRING }, \
- { "hostid", CTLTYPE_UINT }, \
- { "clockrate", CTLTYPE_STRUCT }, \
- { "vnode", CTLTYPE_STRUCT }, \
- { "proc", CTLTYPE_STRUCT }, \
- { "file", CTLTYPE_STRUCT }, \
- { "profiling", CTLTYPE_NODE }, \
- { "posix1version", CTLTYPE_INT }, \
- { "ngroups", CTLTYPE_INT }, \
- { "job_control", CTLTYPE_INT }, \
- { "saved_ids", CTLTYPE_INT }, \
- { "boottime", CTLTYPE_STRUCT }, \
- { "nisdomainname", CTLTYPE_STRING }, \
- { "update", CTLTYPE_INT }, \
- { "osreldate", CTLTYPE_INT }, \
- { "ntp_pll", CTLTYPE_NODE }, \
- { "bootfile", CTLTYPE_STRING }, \
- { "maxfilesperproc", CTLTYPE_INT }, \
- { "maxprocperuid", CTLTYPE_INT }, \
- { "ipc", CTLTYPE_NODE }, \
- { "dummy", CTLTYPE_INT }, \
- { "ps_strings", CTLTYPE_INT }, \
- { "usrstack", CTLTYPE_INT }, \
- { "logsigexit", CTLTYPE_INT }, \
- { "iov_max", CTLTYPE_INT }, \
- { "hostuuid", CTLTYPE_STRING }, \
- { "arc4rand", CTLTYPE_OPAQUE }, \
-}
-
-/*
- * CTL_VFS identifiers
- */
-#define CTL_VFS_NAMES { \
- { "vfsconf", CTLTYPE_STRUCT }, \
-}
-
-/*
- * KERN_PROC subtypes
- */
-#define KERN_PROC_ALL 0 /* everything */
-#define KERN_PROC_PID 1 /* by process id */
-#define KERN_PROC_PGRP 2 /* by process group id */
-#define KERN_PROC_SESSION 3 /* by session of pid */
-#define KERN_PROC_TTY 4 /* by controlling tty */
-#define KERN_PROC_UID 5 /* by effective uid */
-#define KERN_PROC_RUID 6 /* by real uid */
-#define KERN_PROC_ARGS 7 /* get/set arguments/proctitle */
-#define KERN_PROC_PROC 8 /* only return procs */
-#define KERN_PROC_SV_NAME 9 /* get syscall vector name */
-#define KERN_PROC_RGID 10 /* by real group id */
-#define KERN_PROC_GID 11 /* by effective group id */
-#define KERN_PROC_PATHNAME 12 /* path to executable */
-#define KERN_PROC_OVMMAP 13 /* Old VM map entries for process */
-#define KERN_PROC_OFILEDESC 14 /* Old file descriptors for process */
-#define KERN_PROC_KSTACK 15 /* Kernel stacks for process */
-#define KERN_PROC_INC_THREAD 0x10 /*
- * modifier for pid, pgrp, tty,
- * uid, ruid, gid, rgid and proc
- * This effectively uses 16-31
- */
-#define KERN_PROC_VMMAP 32 /* VM map entries for process */
-#define KERN_PROC_FILEDESC 33 /* File descriptors for process */
-#define KERN_PROC_GROUPS 34 /* process groups */
-
-/*
- * KERN_IPC identifiers
- */
-#define KIPC_MAXSOCKBUF 1 /* int: max size of a socket buffer */
-#define KIPC_SOCKBUF_WASTE 2 /* int: wastage factor in sockbuf */
-#define KIPC_SOMAXCONN 3 /* int: max length of connection q */
-#define KIPC_MAX_LINKHDR 4 /* int: max length of link header */
-#define KIPC_MAX_PROTOHDR 5 /* int: max length of network header */
-#define KIPC_MAX_HDR 6 /* int: max total length of headers */
-#define KIPC_MAX_DATALEN 7 /* int: max length of data? */
-
-/*
- * CTL_HW identifiers
- */
-#define HW_MACHINE 1 /* string: machine class */
-#define HW_MODEL 2 /* string: specific machine model */
-#define HW_NCPU 3 /* int: number of cpus */
-#define HW_BYTEORDER 4 /* int: machine byte order */
-#define HW_PHYSMEM 5 /* int: total memory */
-#define HW_USERMEM 6 /* int: non-kernel memory */
-#define HW_PAGESIZE 7 /* int: software page size */
-#define HW_DISKNAMES 8 /* strings: disk drive names */
-#define HW_DISKSTATS 9 /* struct: diskstats[] */
-#define HW_FLOATINGPT 10 /* int: has HW floating point? */
-#define HW_MACHINE_ARCH 11 /* string: machine architecture */
-#define HW_REALMEM 12 /* int: 'real' memory */
-#define HW_MAXID 13 /* number of valid hw ids */
-
-#define CTL_HW_NAMES { \
- { 0, 0 }, \
- { "machine", CTLTYPE_STRING }, \
- { "model", CTLTYPE_STRING }, \
- { "ncpu", CTLTYPE_INT }, \
- { "byteorder", CTLTYPE_INT }, \
- { "physmem", CTLTYPE_ULONG }, \
- { "usermem", CTLTYPE_ULONG }, \
- { "pagesize", CTLTYPE_INT }, \
- { "disknames", CTLTYPE_STRUCT }, \
- { "diskstats", CTLTYPE_STRUCT }, \
- { "floatingpoint", CTLTYPE_INT }, \
- { "machine_arch", CTLTYPE_STRING }, \
- { "realmem", CTLTYPE_ULONG }, \
-}
-
-/*
- * CTL_USER definitions
- */
-#define USER_CS_PATH 1 /* string: _CS_PATH */
-#define USER_BC_BASE_MAX 2 /* int: BC_BASE_MAX */
-#define USER_BC_DIM_MAX 3 /* int: BC_DIM_MAX */
-#define USER_BC_SCALE_MAX 4 /* int: BC_SCALE_MAX */
-#define USER_BC_STRING_MAX 5 /* int: BC_STRING_MAX */
-#define USER_COLL_WEIGHTS_MAX 6 /* int: COLL_WEIGHTS_MAX */
-#define USER_EXPR_NEST_MAX 7 /* int: EXPR_NEST_MAX */
-#define USER_LINE_MAX 8 /* int: LINE_MAX */
-#define USER_RE_DUP_MAX 9 /* int: RE_DUP_MAX */
-#define USER_POSIX2_VERSION 10 /* int: POSIX2_VERSION */
-#define USER_POSIX2_C_BIND 11 /* int: POSIX2_C_BIND */
-#define USER_POSIX2_C_DEV 12 /* int: POSIX2_C_DEV */
-#define USER_POSIX2_CHAR_TERM 13 /* int: POSIX2_CHAR_TERM */
-#define USER_POSIX2_FORT_DEV 14 /* int: POSIX2_FORT_DEV */
-#define USER_POSIX2_FORT_RUN 15 /* int: POSIX2_FORT_RUN */
-#define USER_POSIX2_LOCALEDEF 16 /* int: POSIX2_LOCALEDEF */
-#define USER_POSIX2_SW_DEV 17 /* int: POSIX2_SW_DEV */
-#define USER_POSIX2_UPE 18 /* int: POSIX2_UPE */
-#define USER_STREAM_MAX 19 /* int: POSIX2_STREAM_MAX */
-#define USER_TZNAME_MAX 20 /* int: POSIX2_TZNAME_MAX */
-#define USER_MAXID 21 /* number of valid user ids */
-
-#define CTL_USER_NAMES { \
- { 0, 0 }, \
- { "cs_path", CTLTYPE_STRING }, \
- { "bc_base_max", CTLTYPE_INT }, \
- { "bc_dim_max", CTLTYPE_INT }, \
- { "bc_scale_max", CTLTYPE_INT }, \
- { "bc_string_max", CTLTYPE_INT }, \
- { "coll_weights_max", CTLTYPE_INT }, \
- { "expr_nest_max", CTLTYPE_INT }, \
- { "line_max", CTLTYPE_INT }, \
- { "re_dup_max", CTLTYPE_INT }, \
- { "posix2_version", CTLTYPE_INT }, \
- { "posix2_c_bind", CTLTYPE_INT }, \
- { "posix2_c_dev", CTLTYPE_INT }, \
- { "posix2_char_term", CTLTYPE_INT }, \
- { "posix2_fort_dev", CTLTYPE_INT }, \
- { "posix2_fort_run", CTLTYPE_INT }, \
- { "posix2_localedef", CTLTYPE_INT }, \
- { "posix2_sw_dev", CTLTYPE_INT }, \
- { "posix2_upe", CTLTYPE_INT }, \
- { "stream_max", CTLTYPE_INT }, \
- { "tzname_max", CTLTYPE_INT }, \
-}
-
-#define CTL_P1003_1B_ASYNCHRONOUS_IO 1 /* boolean */
-#define CTL_P1003_1B_MAPPED_FILES 2 /* boolean */
-#define CTL_P1003_1B_MEMLOCK 3 /* boolean */
-#define CTL_P1003_1B_MEMLOCK_RANGE 4 /* boolean */
-#define CTL_P1003_1B_MEMORY_PROTECTION 5 /* boolean */
-#define CTL_P1003_1B_MESSAGE_PASSING 6 /* boolean */
-#define CTL_P1003_1B_PRIORITIZED_IO 7 /* boolean */
-#define CTL_P1003_1B_PRIORITY_SCHEDULING 8 /* boolean */
-#define CTL_P1003_1B_REALTIME_SIGNALS 9 /* boolean */
-#define CTL_P1003_1B_SEMAPHORES 10 /* boolean */
-#define CTL_P1003_1B_FSYNC 11 /* boolean */
-#define CTL_P1003_1B_SHARED_MEMORY_OBJECTS 12 /* boolean */
-#define CTL_P1003_1B_SYNCHRONIZED_IO 13 /* boolean */
-#define CTL_P1003_1B_TIMERS 14 /* boolean */
-#define CTL_P1003_1B_AIO_LISTIO_MAX 15 /* int */
-#define CTL_P1003_1B_AIO_MAX 16 /* int */
-#define CTL_P1003_1B_AIO_PRIO_DELTA_MAX 17 /* int */
-#define CTL_P1003_1B_DELAYTIMER_MAX 18 /* int */
-#define CTL_P1003_1B_MQ_OPEN_MAX 19 /* int */
-#define CTL_P1003_1B_PAGESIZE 20 /* int */
-#define CTL_P1003_1B_RTSIG_MAX 21 /* int */
-#define CTL_P1003_1B_SEM_NSEMS_MAX 22 /* int */
-#define CTL_P1003_1B_SEM_VALUE_MAX 23 /* int */
-#define CTL_P1003_1B_SIGQUEUE_MAX 24 /* int */
-#define CTL_P1003_1B_TIMER_MAX 25 /* int */
-
-#define CTL_P1003_1B_MAXID 26
-
-#define CTL_P1003_1B_NAMES { \
- { 0, 0 }, \
- { "asynchronous_io", CTLTYPE_INT }, \
- { "mapped_files", CTLTYPE_INT }, \
- { "memlock", CTLTYPE_INT }, \
- { "memlock_range", CTLTYPE_INT }, \
- { "memory_protection", CTLTYPE_INT }, \
- { "message_passing", CTLTYPE_INT }, \
- { "prioritized_io", CTLTYPE_INT }, \
- { "priority_scheduling", CTLTYPE_INT }, \
- { "realtime_signals", CTLTYPE_INT }, \
- { "semaphores", CTLTYPE_INT }, \
- { "fsync", CTLTYPE_INT }, \
- { "shared_memory_objects", CTLTYPE_INT }, \
- { "synchronized_io", CTLTYPE_INT }, \
- { "timers", CTLTYPE_INT }, \
- { "aio_listio_max", CTLTYPE_INT }, \
- { "aio_max", CTLTYPE_INT }, \
- { "aio_prio_delta_max", CTLTYPE_INT }, \
- { "delaytimer_max", CTLTYPE_INT }, \
- { "mq_open_max", CTLTYPE_INT }, \
- { "pagesize", CTLTYPE_INT }, \
- { "rtsig_max", CTLTYPE_INT }, \
- { "nsems_max", CTLTYPE_INT }, \
- { "sem_value_max", CTLTYPE_INT }, \
- { "sigqueue_max", CTLTYPE_INT }, \
- { "timer_max", CTLTYPE_INT }, \
-}
-
-#ifdef _KERNEL
-
-/*
- * Declare some common oids.
- */
-#ifdef __rtems__
-#define sysctl__children _bsd_sysctl__children
-#endif /* __rtems__ */
-extern struct sysctl_oid_list sysctl__children;
-SYSCTL_DECL(_kern);
-SYSCTL_DECL(_kern_features);
-SYSCTL_DECL(_kern_ipc);
-SYSCTL_DECL(_kern_proc);
-SYSCTL_DECL(_kern_sched);
-SYSCTL_DECL(_kern_sched_stats);
-SYSCTL_DECL(_sysctl);
-SYSCTL_DECL(_vm);
-SYSCTL_DECL(_vm_stats);
-SYSCTL_DECL(_vm_stats_misc);
-SYSCTL_DECL(_vfs);
-SYSCTL_DECL(_net);
-SYSCTL_DECL(_debug);
-SYSCTL_DECL(_debug_sizeof);
-SYSCTL_DECL(_dev);
-SYSCTL_DECL(_hw);
-SYSCTL_DECL(_hw_bus);
-SYSCTL_DECL(_hw_bus_devices);
-SYSCTL_DECL(_hw_bus_info);
-SYSCTL_DECL(_machdep);
-SYSCTL_DECL(_user);
-SYSCTL_DECL(_compat);
-SYSCTL_DECL(_regression);
-SYSCTL_DECL(_security);
-SYSCTL_DECL(_security_bsd);
-
-extern char machine[];
-extern char osrelease[];
-extern char ostype[];
-extern char kern_ident[];
-
-/* Dynamic oid handling */
-struct sysctl_oid *sysctl_add_oid(struct sysctl_ctx_list *clist,
- struct sysctl_oid_list *parent, int nbr, const char *name,
- int kind, void *arg1, int arg2,
- int (*handler) (SYSCTL_HANDLER_ARGS),
- const char *fmt, const char *descr);
-void sysctl_rename_oid(struct sysctl_oid *oidp, const char *name);
-int sysctl_move_oid(struct sysctl_oid *oidp,
- struct sysctl_oid_list *parent);
-int sysctl_remove_oid(struct sysctl_oid *oidp, int del, int recurse);
-int sysctl_ctx_init(struct sysctl_ctx_list *clist);
-int sysctl_ctx_free(struct sysctl_ctx_list *clist);
-struct sysctl_ctx_entry *sysctl_ctx_entry_add(struct sysctl_ctx_list *clist,
- struct sysctl_oid *oidp);
-struct sysctl_ctx_entry *sysctl_ctx_entry_find(struct sysctl_ctx_list *clist,
- struct sysctl_oid *oidp);
-int sysctl_ctx_entry_del(struct sysctl_ctx_list *clist,
- struct sysctl_oid *oidp);
-
-int kernel_sysctl(struct thread *td, int *name, u_int namelen, void *old,
-#ifndef __rtems__
- size_t *oldlenp, void *new, size_t newlen,
-#else /* __rtems__ */
- size_t *oldlenp, const void *newp, size_t newlen,
-#endif /* __rtems__ */
- size_t *retval, int flags);
-#ifndef __rtems__
-int kernel_sysctlbyname(struct thread *td, char *name,
- void *old, size_t *oldlenp, void *new, size_t newlen,
- size_t *retval, int flags);
-int userland_sysctl(struct thread *td, int *name, u_int namelen, void *old,
- size_t *oldlenp, int inkernel, void *new, size_t newlen,
- size_t *retval, int flags);
-#endif /* __rtems__ */
-int sysctl_find_oid(int *name, u_int namelen, struct sysctl_oid **noid,
- int *nindx, struct sysctl_req *req);
-void sysctl_lock(void);
-void sysctl_unlock(void);
-int sysctl_wire_old_buffer(struct sysctl_req *req, size_t len);
-
-#ifndef __rtems__
-#else /* !_KERNEL */
-#endif /* __rtems__ */
-#include <freebsd/sys/cdefs.h>
-
-__BEGIN_DECLS
-int sysctl(int *, u_int, void *, size_t *, void *, size_t);
-int sysctlbyname(const char *, void *, size_t *, void *, size_t);
-int sysctlnametomib(const char *, int *, size_t *);
-__END_DECLS
-#endif /* _KERNEL */
-
-#endif /* !_SYS_SYSCTL_HH_ */
diff --git a/freebsd/sys/syslimits.h b/freebsd/sys/syslimits.h
deleted file mode 100644
index 936ffd88..00000000
--- a/freebsd/sys/syslimits.h
+++ /dev/null
@@ -1 +0,0 @@
-/* EMPTY */
diff --git a/freebsd/sys/syslog.h b/freebsd/sys/syslog.h
deleted file mode 100644
index 11f7c8e6..00000000
--- a/freebsd/sys/syslog.h
+++ /dev/null
@@ -1,203 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1988, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)syslog.h 8.1 (Berkeley) 6/2/93
- * $FreeBSD$
- */
-
-#ifndef _SYS_SYSLOG_HH_
-#define _SYS_SYSLOG_HH_
-
-#define _PATH_LOG "/var/run/log"
-#define _PATH_LOG_PRIV "/var/run/logpriv"
-#define _PATH_OLDLOG "/dev/log" /* backward compatibility */
-
-/*
- * priorities/facilities are encoded into a single 32-bit quantity, where the
- * bottom 3 bits are the priority (0-7) and the top 28 bits are the facility
- * (0-big number). Both the priorities and the facilities map roughly
- * one-to-one to strings in the syslogd(8) source code. This mapping is
- * included in this file.
- *
- * priorities (these are ordered)
- */
-#define LOG_EMERG 0 /* system is unusable */
-#define LOG_ALERT 1 /* action must be taken immediately */
-#define LOG_CRIT 2 /* critical conditions */
-#define LOG_ERR 3 /* error conditions */
-#define LOG_WARNING 4 /* warning conditions */
-#define LOG_NOTICE 5 /* normal but significant condition */
-#define LOG_INFO 6 /* informational */
-#define LOG_DEBUG 7 /* debug-level messages */
-
-#define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */
- /* extract priority */
-#define LOG_PRI(p) ((p) & LOG_PRIMASK)
-#define LOG_MAKEPRI(fac, pri) ((fac) | (pri))
-
-#ifdef SYSLOG_NAMES
-#define INTERNAL_NOPRI 0x10 /* the "no priority" priority */
- /* mark "facility" */
-#define INTERNAL_MARK LOG_MAKEPRI((LOG_NFACILITIES<<3), 0)
-typedef struct _code {
- const char *c_name;
- int c_val;
-} CODE;
-
-CODE prioritynames[] = {
- { "alert", LOG_ALERT, },
- { "crit", LOG_CRIT, },
- { "debug", LOG_DEBUG, },
- { "emerg", LOG_EMERG, },
- { "err", LOG_ERR, },
- { "error", LOG_ERR, }, /* DEPRECATED */
- { "info", LOG_INFO, },
- { "none", INTERNAL_NOPRI, }, /* INTERNAL */
- { "notice", LOG_NOTICE, },
- { "panic", LOG_EMERG, }, /* DEPRECATED */
- { "warn", LOG_WARNING, }, /* DEPRECATED */
- { "warning", LOG_WARNING, },
- { NULL, -1, }
-};
-#endif
-
-/* facility codes */
-#define LOG_KERN (0<<3) /* kernel messages */
-#define LOG_USER (1<<3) /* random user-level messages */
-#define LOG_MAIL (2<<3) /* mail system */
-#define LOG_DAEMON (3<<3) /* system daemons */
-#define LOG_AUTH (4<<3) /* authorization messages */
-#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */
-#define LOG_LPR (6<<3) /* line printer subsystem */
-#define LOG_NEWS (7<<3) /* network news subsystem */
-#define LOG_UUCP (8<<3) /* UUCP subsystem */
-#define LOG_CRON (9<<3) /* clock daemon */
-#define LOG_AUTHPRIV (10<<3) /* authorization messages (private) */
- /* Facility #10 clashes in DEC UNIX, where */
- /* it's defined as LOG_MEGASAFE for AdvFS */
- /* event logging. */
-#define LOG_FTP (11<<3) /* ftp daemon */
-#define LOG_NTP (12<<3) /* NTP subsystem */
-#define LOG_SECURITY (13<<3) /* security subsystems (firewalling, etc.) */
-#define LOG_CONSOLE (14<<3) /* /dev/console output */
-
- /* other codes through 15 reserved for system use */
-#define LOG_LOCAL0 (16<<3) /* reserved for local use */
-#define LOG_LOCAL1 (17<<3) /* reserved for local use */
-#define LOG_LOCAL2 (18<<3) /* reserved for local use */
-#define LOG_LOCAL3 (19<<3) /* reserved for local use */
-#define LOG_LOCAL4 (20<<3) /* reserved for local use */
-#define LOG_LOCAL5 (21<<3) /* reserved for local use */
-#define LOG_LOCAL6 (22<<3) /* reserved for local use */
-#define LOG_LOCAL7 (23<<3) /* reserved for local use */
-
-#define LOG_NFACILITIES 24 /* current number of facilities */
-#define LOG_FACMASK 0x03f8 /* mask to extract facility part */
- /* facility of pri */
-#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3)
-
-#ifdef SYSLOG_NAMES
-CODE facilitynames[] = {
- { "auth", LOG_AUTH, },
- { "authpriv", LOG_AUTHPRIV, },
- { "console", LOG_CONSOLE, },
- { "cron", LOG_CRON, },
- { "daemon", LOG_DAEMON, },
- { "ftp", LOG_FTP, },
- { "kern", LOG_KERN, },
- { "lpr", LOG_LPR, },
- { "mail", LOG_MAIL, },
- { "mark", INTERNAL_MARK, }, /* INTERNAL */
- { "news", LOG_NEWS, },
- { "ntp", LOG_NTP, },
- { "security", LOG_SECURITY, },
- { "syslog", LOG_SYSLOG, },
- { "user", LOG_USER, },
- { "uucp", LOG_UUCP, },
- { "local0", LOG_LOCAL0, },
- { "local1", LOG_LOCAL1, },
- { "local2", LOG_LOCAL2, },
- { "local3", LOG_LOCAL3, },
- { "local4", LOG_LOCAL4, },
- { "local5", LOG_LOCAL5, },
- { "local6", LOG_LOCAL6, },
- { "local7", LOG_LOCAL7, },
- { NULL, -1, }
-};
-#endif
-
-#ifdef _KERNEL
-#define LOG_PRINTF -1 /* pseudo-priority to indicate use of printf */
-#endif
-
-/*
- * arguments to setlogmask.
- */
-#define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */
-#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */
-
-/*
- * Option flags for openlog.
- *
- * LOG_ODELAY no longer does anything.
- * LOG_NDELAY is the inverse of what it used to be.
- */
-#define LOG_PID 0x01 /* log the pid with each message */
-#define LOG_CONS 0x02 /* log on the console if errors in sending */
-#define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */
-#define LOG_NDELAY 0x08 /* don't delay open */
-#define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */
-#define LOG_PERROR 0x20 /* log to stderr as well */
-
-#ifdef _KERNEL
-
-#else /* not _KERNEL */
-
-/*
- * Don't use va_list in the vsyslog() prototype. Va_list is typedef'd in two
- * places (<machine/varargs.h> and <machine/stdarg.h>), so if we include one
- * of them here we may collide with the utility's includes. It's unreasonable
- * for utilities to have to include one of them to include syslog.h, so we get
- * __va_list from <sys/_types.h> and use it.
- */
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/_types.h>
-
-__BEGIN_DECLS
-void closelog(void);
-void openlog(const char *, int, int);
-int setlogmask(int);
-void syslog(int, const char *, ...) __printflike(2, 3);
-#if __BSD_VISIBLE
-void vsyslog(int, const char *, __va_list) __printflike(2, 0);
-#endif
-__END_DECLS
-
-#endif /* !_KERNEL */
-
-#endif
diff --git a/freebsd/sys/uio.h b/freebsd/sys/uio.h
deleted file mode 100644
index 57b4153b..00000000
--- a/freebsd/sys/uio.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)uio.h 8.5 (Berkeley) 2/22/94
- * $FreeBSD$
- */
-
-#ifndef _SYS_UIO_HH_
-#define _SYS_UIO_HH_
-
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/_types.h>
-#include <freebsd/sys/_iovec.h>
-
-#ifndef _SSIZE_T_DECLARED
-typedef __ssize_t ssize_t;
-#define _SSIZE_T_DECLARED
-#endif
-
-#ifndef _OFF_T_DECLARED
-typedef __off_t off_t;
-#define _OFF_T_DECLARED
-#endif
-
-#if __BSD_VISIBLE
-enum uio_rw { UIO_READ, UIO_WRITE };
-
-/* Segment flag values. */
-enum uio_seg {
- UIO_USERSPACE, /* from user data space */
- UIO_SYSSPACE, /* from system space */
- UIO_NOCOPY /* don't copy, already in object */
-};
-#endif
-
-#ifdef _KERNEL
-
-struct uio {
- struct iovec *uio_iov; /* scatter/gather list */
- int uio_iovcnt; /* length of scatter/gather list */
- off_t uio_offset; /* offset in target object */
- ssize_t uio_resid; /* remaining bytes to process */
- enum uio_seg uio_segflg; /* address space */
- enum uio_rw uio_rw; /* operation */
- struct thread *uio_td; /* owner */
-};
-
-/*
- * Limits
- *
- * N.B.: UIO_MAXIOV must be no less than IOV_MAX from <sys/syslimits.h>
- * which in turn must be no less than _XOPEN_IOV_MAX from <limits.h>. If
- * we ever make this tunable (probably pointless), then IOV_MAX should be
- * removed from <sys/syslimits.h> and applications would be expected to use
- * sysconf(3) to find out the correct value, or else assume the worst
- * (_XOPEN_IOV_MAX). Perhaps UIO_MAXIOV should be simply defined as
- * IOV_MAX.
- */
-#define UIO_MAXIOV 1024 /* max 1K of iov's */
-
-struct vm_object;
-struct vm_page;
-
-struct uio *cloneuio(struct uio *uiop);
-int copyinfrom(const void * __restrict src, void * __restrict dst,
- size_t len, int seg);
-int copyiniov(struct iovec *iovp, u_int iovcnt, struct iovec **iov,
- int error);
-int copyinstrfrom(const void * __restrict src, void * __restrict dst,
- size_t len, size_t * __restrict copied, int seg);
-int copyinuio(struct iovec *iovp, u_int iovcnt, struct uio **uiop);
-void uio_yield(void);
-int uiomove(void *cp, int n, struct uio *uio);
-int uiomove_frombuf(void *buf, int buflen, struct uio *uio);
-int uiomove_fromphys(struct vm_page *ma[], vm_offset_t offset, int n,
- struct uio *uio);
-int uiomoveco(void *cp, int n, struct uio *uio, int disposable);
-
-#else /* !_KERNEL */
-
-__BEGIN_DECLS
-ssize_t readv(int, const struct iovec *, int);
-ssize_t writev(int, const struct iovec *, int);
-#if __BSD_VISIBLE
-ssize_t preadv(int, const struct iovec *, int, off_t);
-ssize_t pwritev(int, const struct iovec *, int, off_t);
-#endif
-__END_DECLS
-
-#endif /* _KERNEL */
-
-#endif /* !_SYS_UIO_HH_ */
diff --git a/freebsd/sys/v850/include/machine/in_cksum.h b/freebsd/sys/v850/include/machine/in_cksum.h
new file mode 100644
index 00000000..37d88e2e
--- /dev/null
+++ b/freebsd/sys/v850/include/machine/in_cksum.h
@@ -0,0 +1,77 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from tahoe: in_cksum.c 1.2 86/01/05
+ * from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91
+ * from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp
+ * from: src/sys/alpha/include/in_cksum.h,v 1.7 2005/03/02 21:33:20 joerg
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_IN_CKSUM_H_
+#define _MACHINE_IN_CKSUM_H_ 1
+
+#include <sys/cdefs.h>
+
+#define in_cksum(m, len) in_cksum_skip(m, len, 0)
+
+/*
+ * It it useful to have an Internet checksum routine which is inlineable
+ * and optimized specifically for the task of computing IP header checksums
+ * in the normal case (where there are no options and the header length is
+ * therefore always exactly five 32-bit words.
+ */
+#ifdef __CC_SUPPORTS___INLINE
+
+static __inline void
+in_cksum_update(struct ip *ip)
+{
+ int __tmpsum;
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256;
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16));
+}
+
+#else
+
+#define in_cksum_update(ip) \
+ do { \
+ int __tmpsum; \
+ __tmpsum = (int)ntohs(ip->ip_sum) + 256; \
+ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \
+ } while(0)
+
+#endif
+
+#ifdef _KERNEL
+u_int in_cksum_hdr(const struct ip *ip);
+u_short in_addword(u_short sum, u_short b);
+u_short in_pseudo(u_int sum, u_int b, u_int c);
+u_short in_cksum_skip(struct mbuf *m, int len, int skip);
+#endif
+
+#endif /* _MACHINE_IN_CKSUM_H_ */
diff --git a/freebsd/sys/v850/include/machine/legacyvar.h b/freebsd/sys/v850/include/machine/legacyvar.h
new file mode 100644
index 00000000..0b0fa433
--- /dev/null
+++ b/freebsd/sys/v850/include/machine/legacyvar.h
@@ -0,0 +1,57 @@
+/*-
+ * Copyright (c) 2000 Peter Wemm <peter@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_LEGACYVAR_H_
+#define _MACHINE_LEGACYVAR_H_
+
+enum legacy_device_ivars {
+ LEGACY_IVAR_PCIDOMAIN,
+ LEGACY_IVAR_PCIBUS
+};
+
+#define LEGACY_ACCESSOR(var, ivar, type) \
+ __BUS_ACCESSOR(legacy, var, LEGACY, ivar, type)
+
+LEGACY_ACCESSOR(pcidomain, PCIDOMAIN, uint32_t)
+LEGACY_ACCESSOR(pcibus, PCIBUS, uint32_t)
+
+#undef LEGACY_ACCESSOR
+
+int legacy_pcib_maxslots(device_t dev);
+uint32_t legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes);
+int legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result);
+void legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes);
+int legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value);
+struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child,
+ int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
+
+#endif /* !_MACHINE_LEGACYVAR_H_ */
diff --git a/freebsd/sys/v850/include/machine/pci_cfgreg.h b/freebsd/sys/v850/include/machine/pci_cfgreg.h
new file mode 100644
index 00000000..bc72418d
--- /dev/null
+++ b/freebsd/sys/v850/include/machine/pci_cfgreg.h
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
+ */
+
+#define CONF1_ADDR_PORT 0x0cf8
+#define CONF1_DATA_PORT 0x0cfc
+
+#define CONF1_ENABLE 0x80000000ul
+#define CONF1_ENABLE_CHK 0x80000000ul
+#define CONF1_ENABLE_MSK 0x7f000000ul
+#define CONF1_ENABLE_CHK1 0xff000001ul
+#define CONF1_ENABLE_MSK1 0x80000001ul
+#define CONF1_ENABLE_RES1 0x80000000ul
+
+#define CONF2_ENABLE_PORT 0x0cf8
+#define CONF2_FORWARD_PORT 0x0cfa
+
+#define CONF2_ENABLE_CHK 0x0e
+#define CONF2_ENABLE_RES 0x0e
+
+int pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus);
+int pci_cfgregopen(void);
+u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes);
+void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes);
+void pci_pir_open(void);
+int pci_pir_probe(int bus, int require_parse);
+int pci_pir_route_interrupt(int bus, int device, int func, int pin);
diff --git a/freebsd/sys/v850/pci/pci_bus.c b/freebsd/sys/v850/pci/pci_bus.c
new file mode 100644
index 00000000..6627db98
--- /dev/null
+++ b/freebsd/sys/v850/pci/pci_bus.c
@@ -0,0 +1,729 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/local/opt_cpu.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
+
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcib_private.h>
+#include <isa/isavar.h>
+#ifdef CPU_ELAN
+#include <machine/md_var.h>
+#endif
+#include <machine/legacyvar.h>
+#include <machine/pci_cfgreg.h>
+#include <machine/resource.h>
+
+#include <rtems/bsd/local/pcib_if.h>
+
+#ifndef __rtems__
+static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev,
+ int pin);
+#else /* __rtems__ */
+int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin);
+#endif /* __rtems__ */
+
+
+int
+legacy_pcib_maxslots(device_t dev)
+{
+ return 31;
+}
+
+/* read configuration space register */
+
+#ifdef __rtems__
+uint32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#else
+u_int32_t
+legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, int bytes)
+#endif
+{
+ return(pci_cfgregread(bus, slot, func, reg, bytes));
+}
+
+/* write configuration space register */
+
+void
+legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
+ u_int reg, u_int32_t data, int bytes)
+{
+ pci_cfgregwrite(bus, slot, func, reg, data, bytes);
+}
+
+/* Pass MSI requests up to the nexus. */
+
+static int
+legacy_pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount,
+ int *irqs)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSI(device_get_parent(bus), dev, count, maxcount,
+ irqs));
+}
+
+static int
+legacy_pcib_alloc_msix(device_t pcib, device_t dev, int *irq)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq));
+}
+
+static int
+legacy_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr,
+ uint32_t *data)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data));
+}
+
+static const char *
+legacy_pcib_is_host_bridge(int bus, int slot, int func,
+ uint32_t id, uint8_t class, uint8_t subclass,
+ uint8_t *busnum)
+{
+ const char *s = NULL;
+ static uint8_t pxb[4]; /* hack for 450nx */
+
+ *busnum = 0;
+
+ switch (id) {
+ case 0x12258086:
+ s = "Intel 824?? host to PCI bridge";
+ /* XXX This is a guess */
+ /* *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x41, 1); */
+ *busnum = bus;
+ break;
+ case 0x71208086:
+ s = "Intel 82810 (i810 GMCH) Host To Hub bridge";
+ break;
+ case 0x71228086:
+ s = "Intel 82810-DC100 (i810-DC100 GMCH) Host To Hub bridge";
+ break;
+ case 0x71248086:
+ s = "Intel 82810E (i810E GMCH) Host To Hub bridge";
+ break;
+ case 0x11308086:
+ s = "Intel 82815 (i815 GMCH) Host To Hub bridge";
+ break;
+ case 0x71808086:
+ s = "Intel 82443LX (440 LX) host to PCI bridge";
+ break;
+ case 0x71908086:
+ s = "Intel 82443BX (440 BX) host to PCI bridge";
+ break;
+ case 0x71928086:
+ s = "Intel 82443BX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x71948086:
+ s = "Intel 82443MX host to PCI bridge";
+ break;
+ case 0x71a08086:
+ s = "Intel 82443GX host to PCI bridge";
+ break;
+ case 0x71a18086:
+ s = "Intel 82443GX host to AGP bridge";
+ break;
+ case 0x71a28086:
+ s = "Intel 82443GX host to PCI bridge (AGP disabled)";
+ break;
+ case 0x84c48086:
+ s = "Intel 82454KX/GX (Orion) host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x4a, 1);
+ break;
+ case 0x84ca8086:
+ /*
+ * For the 450nx chipset, there is a whole bundle of
+ * things pretending to be host bridges. The MIOC will
+ * be seen first and isn't really a pci bridge (the
+ * actual busses are attached to the PXB's). We need to
+ * read the registers of the MIOC to figure out the
+ * bus numbers for the PXB channels.
+ *
+ * Since the MIOC doesn't have a pci bus attached, we
+ * pretend it wasn't there.
+ */
+ pxb[0] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd0, 1); /* BUSNO[0] */
+ pxb[1] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd1, 1) + 1; /* SUBA[0]+1 */
+ pxb[2] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd3, 1); /* BUSNO[1] */
+ pxb[3] = legacy_pcib_read_config(0, bus, slot, func,
+ 0xd4, 1) + 1; /* SUBA[1]+1 */
+ return NULL;
+ case 0x84cb8086:
+ switch (slot) {
+ case 0x12:
+ s = "Intel 82454NX PXB#0, Bus#A";
+ *busnum = pxb[0];
+ break;
+ case 0x13:
+ s = "Intel 82454NX PXB#0, Bus#B";
+ *busnum = pxb[1];
+ break;
+ case 0x14:
+ s = "Intel 82454NX PXB#1, Bus#A";
+ *busnum = pxb[2];
+ break;
+ case 0x15:
+ s = "Intel 82454NX PXB#1, Bus#B";
+ *busnum = pxb[3];
+ break;
+ }
+ break;
+ case 0x1A308086:
+ s = "Intel 82845 Host to PCI bridge";
+ break;
+
+ /* AMD -- vendor 0x1022 */
+ case 0x30001022:
+ s = "AMD Elan SC520 host to PCI bridge";
+#ifdef CPU_ELAN
+ init_AMD_Elan_sc520();
+#else
+ printf(
+"*** WARNING: missing CPU_ELAN -- timekeeping may be wrong\n");
+#endif
+ break;
+ case 0x70061022:
+ s = "AMD-751 host to PCI bridge";
+ break;
+ case 0x700e1022:
+ s = "AMD-761 host to PCI bridge";
+ break;
+
+ /* SiS -- vendor 0x1039 */
+ case 0x04961039:
+ s = "SiS 85c496";
+ break;
+ case 0x04061039:
+ s = "SiS 85c501";
+ break;
+ case 0x06011039:
+ s = "SiS 85c601";
+ break;
+ case 0x55911039:
+ s = "SiS 5591 host to PCI bridge";
+ break;
+ case 0x00011039:
+ s = "SiS 5591 host to AGP bridge";
+ break;
+
+ /* VLSI -- vendor 0x1004 */
+ case 0x00051004:
+ s = "VLSI 82C592 Host to PCI bridge";
+ break;
+
+ /* XXX Here is MVP3, I got the datasheet but NO M/B to test it */
+ /* totally. Please let me know if anything wrong. -F */
+ /* XXX need info on the MVP3 -- any takers? */
+ case 0x05981106:
+ s = "VIA 82C598MVP (Apollo MVP3) host bridge";
+ break;
+
+ /* AcerLabs -- vendor 0x10b9 */
+ /* Funny : The datasheet told me vendor id is "10b8",sub-vendor */
+ /* id is '10b9" but the register always shows "10b9". -Foxfair */
+ case 0x154110b9:
+ s = "AcerLabs M1541 (Aladdin-V) PCI host bridge";
+ break;
+
+ /* OPTi -- vendor 0x1045 */
+ case 0xc7011045:
+ s = "OPTi 82C700 host to PCI bridge";
+ break;
+ case 0xc8221045:
+ s = "OPTi 82C822 host to PCI Bridge";
+ break;
+
+ /* ServerWorks -- vendor 0x1166 */
+ case 0x00051166:
+ s = "ServerWorks NB6536 2.0HE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00061166:
+ /* FALLTHROUGH */
+ case 0x00081166:
+ /* FALLTHROUGH */
+ case 0x02011166:
+ /* FALLTHROUGH */
+ case 0x010f1014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00091166:
+ s = "ServerWorks NB6635 3.0LE host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00101166:
+ s = "ServerWorks CIOB30 host to PCI bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ case 0x00111166:
+ /* FALLTHROUGH */
+ case 0x03021014: /* IBM re-badged ServerWorks chipset */
+ s = "ServerWorks CMIC-HE host to PCI-X bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* XXX unknown chipset, but working */
+ case 0x00171166:
+ /* FALLTHROUGH */
+ case 0x01011166:
+ case 0x01101166:
+ case 0x02251166:
+ s = "ServerWorks host to PCI bridge(unknown chipset)";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0x44, 1);
+ break;
+
+ /* Compaq/HP -- vendor 0x0e11 */
+ case 0x60100e11:
+ s = "Compaq/HP Model 6010 HotPlug PCI Bridge";
+ *busnum = legacy_pcib_read_config(0, bus, slot, func, 0xc8, 1);
+ break;
+
+ /* Integrated Micro Solutions -- vendor 0x10e0 */
+ case 0x884910e0:
+ s = "Integrated Micro Solutions VL Bridge";
+ break;
+
+ default:
+ if (class == PCIC_BRIDGE && subclass == PCIS_BRIDGE_HOST)
+ s = "Host to PCI bridge";
+ break;
+ }
+
+ return s;
+}
+
+/*
+ * Scan the first pci bus for host-pci bridges and add pcib instances
+ * to the nexus for each bridge.
+ */
+static void
+legacy_pcib_identify(driver_t *driver, device_t parent)
+{
+ int bus, slot, func;
+ u_int8_t hdrtype;
+ int found = 0;
+ int pcifunchigh;
+ int found824xx = 0;
+ int found_orion = 0;
+ device_t child;
+ devclass_t pci_devclass;
+
+ if (pci_cfgregopen() == 0)
+ return;
+ /*
+ * Check to see if we haven't already had a PCI bus added
+ * via some other means. If we have, bail since otherwise
+ * we're going to end up duplicating it.
+ */
+ if ((pci_devclass = devclass_find("pci")) &&
+ devclass_get_device(pci_devclass, 0))
+ return;
+
+
+ bus = 0;
+ retry:
+ for (slot = 0; slot <= PCI_SLOTMAX; slot++) {
+ func = 0;
+ hdrtype = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_HDRTYPE, 1);
+ /*
+ * When enumerating bus devices, the standard says that
+ * one should check the header type and ignore the slots whose
+ * header types that the software doesn't know about. We use
+ * this to filter out devices.
+ */
+ if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE)
+ continue;
+ if ((hdrtype & PCIM_MFDEV) &&
+ (!found_orion || hdrtype != 0xff))
+ pcifunchigh = PCI_FUNCMAX;
+ else
+ pcifunchigh = 0;
+ for (func = 0; func <= pcifunchigh; func++) {
+ /*
+ * Read the IDs and class from the device.
+ */
+ u_int32_t id;
+ u_int8_t class, subclass, busnum;
+ const char *s;
+ device_t *devs;
+ int ndevs, i;
+
+ id = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_DEVVENDOR, 4);
+ if (id == -1)
+ continue;
+ class = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_CLASS, 1);
+ subclass = legacy_pcib_read_config(0, bus, slot, func,
+ PCIR_SUBCLASS, 1);
+
+ s = legacy_pcib_is_host_bridge(bus, slot, func,
+ id, class, subclass,
+ &busnum);
+ if (s == NULL)
+ continue;
+
+ /*
+ * Check to see if the physical bus has already
+ * been seen. Eg: hybrid 32 and 64 bit host
+ * bridges to the same logical bus.
+ */
+ if (device_get_children(parent, &devs, &ndevs) == 0) {
+ for (i = 0; s != NULL && i < ndevs; i++) {
+ if (strcmp(device_get_name(devs[i]),
+ "pcib") != 0)
+ continue;
+ if (legacy_get_pcibus(devs[i]) == busnum)
+ s = NULL;
+ }
+ free(devs, M_TEMP);
+ }
+
+ if (s == NULL)
+ continue;
+ /*
+ * Add at priority 100 to make sure we
+ * go after any motherboard resources
+ */
+ child = BUS_ADD_CHILD(parent, 100,
+ "pcib", busnum);
+ device_set_desc(child, s);
+ legacy_set_pcibus(child, busnum);
+
+ found = 1;
+ if (id == 0x12258086)
+ found824xx = 1;
+ if (id == 0x84c48086)
+ found_orion = 1;
+ }
+ }
+ if (found824xx && bus == 0) {
+ bus++;
+ goto retry;
+ }
+
+ /*
+ * Make sure we add at least one bridge since some old
+ * hardware doesn't actually have a host-pci bridge device.
+ * Note that pci_cfgregopen() thinks we have PCI devices..
+ */
+ if (!found) {
+ if (bootverbose)
+ printf(
+ "legacy_pcib_identify: no bridge found, adding pcib0 anyway\n");
+ child = BUS_ADD_CHILD(parent, 100, "pcib", 0);
+ legacy_set_pcibus(child, 0);
+ }
+}
+
+static int
+legacy_pcib_probe(device_t dev)
+{
+
+ if (pci_cfgregopen() == 0)
+ return ENXIO;
+ return -100;
+}
+
+static int
+legacy_pcib_attach(device_t dev)
+{
+ device_t pir;
+ int bus;
+
+ /*
+ * Look for a PCI BIOS interrupt routing table as that will be
+ * our method of routing interrupts if we have one.
+ */
+ bus = pcib_get_bus(dev);
+#ifndef __rtems__
+ if (pci_pir_probe(bus, 0)) {
+ pir = BUS_ADD_CHILD(device_get_parent(dev), 0, "pir", 0);
+ if (pir != NULL)
+ device_probe_and_attach(pir);
+ }
+#else /* __rtems__ */
+#endif /* __rtems__ */
+ device_add_child(dev, "pci", bus);
+ return bus_generic_attach(dev);
+}
+
+int
+legacy_pcib_read_ivar(device_t dev, device_t child, int which,
+ uintptr_t *result)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ *result = 0;
+ return 0;
+ case PCIB_IVAR_BUS:
+ *result = legacy_get_pcibus(dev);
+ return 0;
+ }
+ return ENOENT;
+}
+
+int
+legacy_pcib_write_ivar(device_t dev, device_t child, int which,
+ uintptr_t value)
+{
+
+ switch (which) {
+ case PCIB_IVAR_DOMAIN:
+ return EINVAL;
+ case PCIB_IVAR_BUS:
+ legacy_set_pcibus(dev, value);
+ return 0;
+ }
+ return ENOENT;
+}
+
+SYSCTL_DECL(_hw_pci);
+
+static unsigned long legacy_host_mem_start = 0x80000000;
+TUNABLE_ULONG("hw.pci.host_mem_start", &legacy_host_mem_start);
+SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN,
+ &legacy_host_mem_start, 0x80000000,
+ "Limit the host bridge memory to being above this address. Must be\n\
+set at boot via a tunable.");
+
+struct resource *
+legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
+ u_long start, u_long end, u_long count, u_int flags)
+{
+ /*
+ * If no memory preference is given, use upper 32MB slot most
+ * bioses use for their memory window. Typically other bridges
+ * before us get in the way to assert their preferences on memory.
+ * Hardcoding like this sucks, so a more MD/MI way needs to be
+ * found to do it. This is typically only used on older laptops
+ * that don't have pci busses behind pci bridge, so assuming > 32MB
+ * is liekly OK.
+ *
+ * However, this can cause problems for other chipsets, so we make
+ * this tunable by hw.pci.host_mem_start.
+ */
+ if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL)
+ start = legacy_host_mem_start;
+ if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL)
+ start = 0x1000;
+ return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
+ count, flags));
+}
+
+static device_method_t legacy_pcib_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, legacy_pcib_identify),
+ DEVMETHOD(device_probe, legacy_pcib_probe),
+ DEVMETHOD(device_attach, legacy_pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, legacy_pcib_maxslots),
+ DEVMETHOD(pcib_read_config, legacy_pcib_read_config),
+ DEVMETHOD(pcib_write_config, legacy_pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, legacy_pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, legacy_pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, legacy_pcib_map_msi),
+
+ { 0, 0 }
+};
+
+static devclass_t hostb_devclass;
+
+DEFINE_CLASS_0(pcib, legacy_pcib_driver, legacy_pcib_methods, 1);
+DRIVER_MODULE(pcib, legacy, legacy_pcib_driver, hostb_devclass, 0, 0);
+
+
+#ifndef __rtems__
+/*
+ * Install placeholder to claim the resources owned by the
+ * PCI bus interface. This could be used to extract the
+ * config space registers in the extreme case where the PnP
+ * ID is available and the PCI BIOS isn't, but for now we just
+ * eat the PnP ID and do nothing else.
+ *
+ * XXX we should silence this probe, as it will generally confuse
+ * people.
+ */
+static struct isa_pnp_id pcibus_pnp_ids[] = {
+ { 0x030ad041 /* PNP0A03 */, "PCI Bus" },
+ { 0x080ad041 /* PNP0A08 */, "PCIe Bus" },
+ { 0 }
+};
+
+static int
+pcibus_pnp_probe(device_t dev)
+{
+ int result;
+
+ if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, pcibus_pnp_ids)) <= 0)
+ device_quiet(dev);
+ return(result);
+}
+
+static int
+pcibus_pnp_attach(device_t dev)
+{
+ return(0);
+}
+
+static device_method_t pcibus_pnp_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibus_pnp_probe),
+ DEVMETHOD(device_attach, pcibus_pnp_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+ { 0, 0 }
+};
+
+static devclass_t pcibus_pnp_devclass;
+
+DEFINE_CLASS_0(pcibus_pnp, pcibus_pnp_driver, pcibus_pnp_methods, 1);
+DRIVER_MODULE(pcibus_pnp, isa, pcibus_pnp_driver, pcibus_pnp_devclass, 0, 0);
+
+
+/*
+ * Provide a PCI-PCI bridge driver for PCI busses behind PCI-PCI bridges
+ * that appear in the PCIBIOS Interrupt Routing Table to use the routing
+ * table for interrupt routing when possible.
+ */
+static int pcibios_pcib_probe(device_t bus);
+
+static device_method_t pcibios_pcib_pci_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcibios_pcib_probe),
+ DEVMETHOD(device_attach, pcib_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_read_ivar, pcib_read_ivar),
+ DEVMETHOD(bus_write_ivar, pcib_write_ivar),
+ DEVMETHOD(bus_alloc_resource, pcib_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ /* pcib interface */
+ DEVMETHOD(pcib_maxslots, pcib_maxslots),
+ DEVMETHOD(pcib_read_config, pcib_read_config),
+ DEVMETHOD(pcib_write_config, pcib_write_config),
+ DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
+ DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi),
+ DEVMETHOD(pcib_release_msi, pcib_release_msi),
+ DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix),
+ DEVMETHOD(pcib_release_msix, pcib_release_msix),
+ DEVMETHOD(pcib_map_msi, pcib_map_msi),
+
+ {0, 0}
+};
+
+static devclass_t pcib_devclass;
+
+DEFINE_CLASS_0(pcib, pcibios_pcib_driver, pcibios_pcib_pci_methods,
+ sizeof(struct pcib_softc));
+DRIVER_MODULE(pcibios_pcib, pci, pcibios_pcib_driver, pcib_devclass, 0, 0);
+
+static int
+pcibios_pcib_probe(device_t dev)
+{
+ int bus;
+
+ if ((pci_get_class(dev) != PCIC_BRIDGE) ||
+ (pci_get_subclass(dev) != PCIS_BRIDGE_PCI))
+ return (ENXIO);
+ bus = pci_read_config(dev, PCIR_SECBUS_1, 1);
+ if (bus == 0)
+ return (ENXIO);
+ if (!pci_pir_probe(bus, 1))
+ return (ENXIO);
+ device_set_desc(dev, "PCIBIOS PCI-PCI bridge");
+ return (-2000);
+}
+
+static int
+pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
+{
+ return (pci_pir_route_interrupt(pci_get_bus(dev), pci_get_slot(dev),
+ pci_get_function(dev), pin));
+}
+#endif /* __rtems__ */
diff --git a/freebsd/sys/v850/v850/in_cksum.c b/freebsd/sys/v850/v850/in_cksum.c
new file mode 100644
index 00000000..c6f7b568
--- /dev/null
+++ b/freebsd/sys/v850/v850/in_cksum.c
@@ -0,0 +1,255 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright (c) 1988, 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ * Copyright (c) 1996
+ * Matt Thomas <matt@3am-software.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)in_cksum.c 8.1 (Berkeley) 6/10/93
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/mbuf.h>
+#include <sys/systm.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <machine/in_cksum.h>
+
+/*
+ * Checksum routine for Internet Protocol family headers
+ * (Portable Alpha version).
+ *
+ * This routine is very heavily used in the network
+ * code and should be modified for each CPU to be as fast as possible.
+ */
+
+#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x)
+#define REDUCE32 \
+ { \
+ q_util.q = sum; \
+ sum = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
+ }
+#define REDUCE16 \
+ { \
+ q_util.q = sum; \
+ l_util.l = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
+ sum = l_util.s[0] + l_util.s[1]; \
+ ADDCARRY(sum); \
+ }
+
+static const u_int32_t in_masks[] = {
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
+ 0x00000000, 0x000000FF, 0x0000FFFF, 0x00FFFFFF, /* offset 0 */
+ 0x00000000, 0x0000FF00, 0x00FFFF00, 0xFFFFFF00, /* offset 1 */
+ 0x00000000, 0x00FF0000, 0xFFFF0000, 0xFFFF0000, /* offset 2 */
+ 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, /* offset 3 */
+#else
+ /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
+ 0x00000000, 0xFF000000, 0xFFFF0000, 0xFFFFFF00, /* offset 0 */
+ 0x00000000, 0x00FF0000, 0x00FFFF00, 0x00FFFFFF, /* offset 1 */
+ 0x00000000, 0x0000FF00, 0x0000FFFF, 0x0000FFFF, /* offset 2 */
+ 0x00000000, 0x000000FF, 0x000000FF, 0x000000FF, /* offset 3 */
+#endif
+};
+
+union l_util {
+ u_int16_t s[2];
+ u_int32_t l;
+};
+union q_util {
+ u_int16_t s[4];
+ u_int32_t l[2];
+ u_int64_t q;
+};
+
+static u_int64_t
+in_cksumdata(const void *buf, int len)
+{
+ const u_int32_t *lw = (const u_int32_t *) buf;
+ u_int64_t sum = 0;
+ u_int64_t prefilled;
+ int offset;
+ union q_util q_util;
+
+ if ((3 & (long) lw) == 0 && len == 20) {
+ sum = (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3] + lw[4];
+ REDUCE32;
+ return sum;
+ }
+
+ if ((offset = 3 & (long) lw) != 0) {
+ const u_int32_t *masks = in_masks + (offset << 2);
+ lw = (u_int32_t *) (((long) lw) - offset);
+ sum = *lw++ & masks[len >= 3 ? 3 : len];
+ len -= 4 - offset;
+ if (len <= 0) {
+ REDUCE32;
+ return sum;
+ }
+ }
+#if 0
+ /*
+ * Force to cache line boundary.
+ */
+ offset = 32 - (0x1f & (long) lw);
+ if (offset < 32 && len > offset) {
+ len -= offset;
+ if (4 & offset) {
+ sum += (u_int64_t) lw[0];
+ lw += 1;
+ }
+ if (8 & offset) {
+ sum += (u_int64_t) lw[0] + lw[1];
+ lw += 2;
+ }
+ if (16 & offset) {
+ sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
+ lw += 4;
+ }
+ }
+#endif
+ /*
+ * access prefilling to start load of next cache line.
+ * then add current cache line
+ * save result of prefilling for loop iteration.
+ */
+ prefilled = lw[0];
+ while ((len -= 32) >= 4) {
+ u_int64_t prefilling = lw[8];
+ sum += prefilled + lw[1] + lw[2] + lw[3]
+ + lw[4] + lw[5] + lw[6] + lw[7];
+ lw += 8;
+ prefilled = prefilling;
+ }
+ if (len >= 0) {
+ sum += prefilled + lw[1] + lw[2] + lw[3]
+ + lw[4] + lw[5] + lw[6] + lw[7];
+ lw += 8;
+ } else {
+ len += 32;
+ }
+ while ((len -= 16) >= 0) {
+ sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
+ lw += 4;
+ }
+ len += 16;
+ while ((len -= 4) >= 0) {
+ sum += (u_int64_t) *lw++;
+ }
+ len += 4;
+ if (len > 0)
+ sum += (u_int64_t) (in_masks[len] & *lw);
+ REDUCE32;
+ return sum;
+}
+
+u_short
+in_addword(u_short a, u_short b)
+{
+ u_int64_t sum = a + b;
+
+ ADDCARRY(sum);
+ return (sum);
+}
+
+u_short
+#ifdef __rtems__
+/* Prototype does not match in FreeBSD code */
+in_pseudo(u_int a, u_int b, u_int c)
+#else
+in_pseudo(u_int32_t a, u_int32_t b, u_int32_t c)
+#endif
+{
+ u_int64_t sum;
+ union q_util q_util;
+ union l_util l_util;
+
+ sum = (u_int64_t) a + b + c;
+ REDUCE16;
+ return (sum);
+}
+
+u_short
+in_cksum_skip(struct mbuf *m, int len, int skip)
+{
+ u_int64_t sum = 0;
+ int mlen = 0;
+ int clen = 0;
+ caddr_t addr;
+ union q_util q_util;
+ union l_util l_util;
+
+ len -= skip;
+ for (; skip && m; m = m->m_next) {
+ if (m->m_len > skip) {
+ mlen = m->m_len - skip;
+ addr = mtod(m, caddr_t) + skip;
+ goto skip_start;
+ } else {
+ skip -= m->m_len;
+ }
+ }
+
+ for (; m && len; m = m->m_next) {
+ if (m->m_len == 0)
+ continue;
+ mlen = m->m_len;
+ addr = mtod(m, caddr_t);
+skip_start:
+ if (len < mlen)
+ mlen = len;
+
+ if ((clen ^ (uintptr_t) addr) & 1)
+ sum += in_cksumdata(addr, mlen) << 8;
+ else
+ sum += in_cksumdata(addr, mlen);
+
+ clen += mlen;
+ len -= mlen;
+ }
+ REDUCE16;
+ return (~sum & 0xffff);
+}
+
+u_int in_cksum_hdr(const struct ip *ip)
+{
+ u_int64_t sum = in_cksumdata(ip, sizeof(struct ip));
+ union q_util q_util;
+ union l_util l_util;
+ REDUCE16;
+ return (~sum & 0xffff);
+}
diff --git a/freebsd/sys/v850/v850/legacy.c b/freebsd/sys/v850/v850/legacy.c
new file mode 100644
index 00000000..2547990c
--- /dev/null
+++ b/freebsd/sys/v850/v850/legacy.c
@@ -0,0 +1,347 @@
+#include <machine/rtems-bsd-config.h>
+
+/*-
+ * Copyright 1998 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby
+ * granted, provided that both the above copyright notice and this
+ * permission notice appear in all copies, that both the above
+ * copyright notice and this permission notice appear in all
+ * supporting documentation, and that the name of M.I.T. not be used
+ * in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission. M.I.T. makes
+ * no representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
+ * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
+ * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * This code implements a system driver for legacy systems that do not
+ * support ACPI or when ACPI support is not present in the kernel.
+ */
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <machine/bus.h>
+#include <sys/pcpu.h>
+#include <sys/rman.h>
+#include <sys/smp.h>
+
+#ifndef __rtems__
+#include <rtems/bsd/local/opt_mca.h>
+#endif /* __rtems__ */
+#ifdef DEV_MCA
+#include <i386/bios/mca_machdep.h>
+#endif
+
+#include <machine/legacyvar.h>
+#include <machine/resource.h>
+
+static MALLOC_DEFINE(M_LEGACYDEV, "legacydrv", "legacy system device");
+struct legacy_device {
+ int lg_pcibus;
+};
+
+#define DEVTOAT(dev) ((struct legacy_device *)device_get_ivars(dev))
+
+static int legacy_probe(device_t);
+static int legacy_attach(device_t);
+static int legacy_print_child(device_t, device_t);
+static device_t legacy_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static int legacy_read_ivar(device_t, device_t, int, uintptr_t *);
+static int legacy_write_ivar(device_t, device_t, int, uintptr_t);
+
+static device_method_t legacy_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, legacy_probe),
+ DEVMETHOD(device_attach, legacy_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, legacy_print_child),
+ DEVMETHOD(bus_add_child, legacy_add_child),
+ DEVMETHOD(bus_read_ivar, legacy_read_ivar),
+ DEVMETHOD(bus_write_ivar, legacy_write_ivar),
+ DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t legacy_driver = {
+ "legacy",
+ legacy_methods,
+ 1, /* no softc */
+};
+static devclass_t legacy_devclass;
+
+DRIVER_MODULE(legacy, nexus, legacy_driver, legacy_devclass, 0, 0);
+
+static int
+legacy_probe(device_t dev)
+{
+
+ device_set_desc(dev, "legacy system");
+ device_quiet(dev);
+ return (0);
+}
+
+static int
+legacy_attach(device_t dev)
+{
+ device_t child;
+
+ /*
+ * Let our child drivers identify any child devices that they
+ * can find. Once that is done attach any devices that we
+ * found.
+ */
+ bus_generic_probe(dev);
+ bus_generic_attach(dev);
+
+#ifndef PC98
+ /*
+ * If we didn't see EISA or ISA on a pci bridge, create some
+ * connection points now so they show up "on motherboard".
+ */
+ if (!devclass_get_device(devclass_find("eisa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "eisa", 0);
+ if (child == NULL)
+ panic("legacy_attach eisa");
+ device_probe_and_attach(child);
+ }
+#endif
+#ifdef DEV_MCA
+ if (MCA_system && !devclass_get_device(devclass_find("mca"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "mca", 0);
+ if (child == 0)
+ panic("legacy_probe mca");
+ device_probe_and_attach(child);
+ }
+#endif
+ if (!devclass_get_device(devclass_find("isa"), 0)) {
+ child = BUS_ADD_CHILD(dev, 0, "isa", 0);
+ if (child == NULL)
+ panic("legacy_attach isa");
+ device_probe_and_attach(child);
+ }
+
+ return 0;
+}
+
+static int
+legacy_print_child(device_t bus, device_t child)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+ int retval = 0;
+
+ retval += bus_print_child_header(bus, child);
+ if (atdev->lg_pcibus != -1)
+ retval += printf(" pcibus %d", atdev->lg_pcibus);
+ retval += printf(" on motherboard\n"); /* XXX "motherboard", ick */
+
+ return (retval);
+}
+
+static device_t
+legacy_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ device_t child;
+ struct legacy_device *atdev;
+
+ atdev = malloc(sizeof(struct legacy_device), M_LEGACYDEV,
+ M_NOWAIT | M_ZERO);
+ if (atdev == NULL)
+ return(NULL);
+ atdev->lg_pcibus = -1;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child == NULL)
+ free(atdev, M_LEGACYDEV);
+ else
+ /* should we free this in legacy_child_detached? */
+ device_set_ivars(child, atdev);
+
+ return (child);
+}
+
+static int
+legacy_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ *result = 0;
+ break;
+ case LEGACY_IVAR_PCIBUS:
+ *result = atdev->lg_pcibus;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+
+static int
+legacy_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
+{
+ struct legacy_device *atdev = DEVTOAT(child);
+
+ switch (which) {
+ case LEGACY_IVAR_PCIDOMAIN:
+ return EINVAL;
+ case LEGACY_IVAR_PCIBUS:
+ atdev->lg_pcibus = value;
+ break;
+ default:
+ return ENOENT;
+ }
+ return 0;
+}
+
+/*
+ * Legacy CPU attachment when ACPI is not available. Drivers like
+ * cpufreq(4) hang off this.
+ */
+static void cpu_identify(driver_t *driver, device_t parent);
+static int cpu_read_ivar(device_t dev, device_t child, int index,
+ uintptr_t *result);
+static device_t cpu_add_child(device_t bus, u_int order, const char *name,
+ int unit);
+static struct resource_list *cpu_get_rlist(device_t dev, device_t child);
+
+struct cpu_device {
+ struct resource_list cd_rl;
+ struct pcpu *cd_pcpu;
+};
+
+static device_method_t cpu_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, cpu_identify),
+ DEVMETHOD(device_probe, bus_generic_probe),
+ DEVMETHOD(device_attach, bus_generic_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_add_child, cpu_add_child),
+ DEVMETHOD(bus_read_ivar, cpu_read_ivar),
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_get_resource_list, cpu_get_rlist),
+ DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
+ DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource),
+ DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource),
+ DEVMETHOD(bus_driver_added, bus_generic_driver_added),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t cpu_driver = {
+ "cpu",
+ cpu_methods,
+ 1, /* no softc */
+};
+static devclass_t cpu_devclass;
+DRIVER_MODULE(cpu, legacy, cpu_driver, cpu_devclass, 0, 0);
+
+static void
+cpu_identify(driver_t *driver, device_t parent)
+{
+ device_t child;
+ int i;
+
+ /*
+ * Attach a cpuX device for each CPU. We use an order of 150
+ * so that these devices are attached after the Host-PCI
+ * bridges (which are added at order 100).
+ */
+ for (i = 0; i <= mp_maxid; i++)
+ if (!CPU_ABSENT(i)) {
+ child = BUS_ADD_CHILD(parent, 150, "cpu", i);
+ if (child == NULL)
+ panic("legacy_attach cpu");
+ }
+}
+
+static device_t
+cpu_add_child(device_t bus, u_int order, const char *name, int unit)
+{
+ struct cpu_device *cd;
+ device_t child;
+ struct pcpu *pc;
+
+ if ((cd = malloc(sizeof(*cd), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL)
+ return (NULL);
+
+ resource_list_init(&cd->cd_rl);
+ pc = pcpu_find(device_get_unit(bus));
+ cd->cd_pcpu = pc;
+
+ child = device_add_child_ordered(bus, order, name, unit);
+ if (child != NULL) {
+ pc->pc_device = child;
+ device_set_ivars(child, cd);
+ } else
+ free(cd, M_DEVBUF);
+ return (child);
+}
+
+static struct resource_list *
+cpu_get_rlist(device_t dev, device_t child)
+{
+ struct cpu_device *cpdev;
+
+ cpdev = device_get_ivars(child);
+ return (&cpdev->cd_rl);
+}
+
+static int
+cpu_read_ivar(device_t dev, device_t child, int index, uintptr_t *result)
+{
+ struct cpu_device *cpdev;
+
+ if (index != CPU_IVAR_PCPU)
+ return (ENOENT);
+ cpdev = device_get_ivars(child);
+ *result = (uintptr_t)cpdev->cd_pcpu;
+ return (0);
+}
diff --git a/freebsd/sys/vm/uma.h b/freebsd/sys/vm/uma.h
index b23ad453..62a0ca79 100644
--- a/freebsd/sys/vm/uma.h
+++ b/freebsd/sys/vm/uma.h
@@ -36,8 +36,8 @@
#ifndef VM_UMA_H
#define VM_UMA_H
-#include <freebsd/sys/param.h> /* For NULL */
-#include <freebsd/sys/malloc.h> /* For M_* */
+#include <rtems/bsd/sys/param.h> /* For NULL */
+#include <sys/malloc.h> /* For M_* */
/* User visible parameters */
#define UMA_SMALLEST_UNIT (PAGE_SIZE / 256) /* Smallest item allocated */
diff --git a/freebsd/sys/vm/uma_core.c b/freebsd/sys/vm/uma_core.c
index a53fceb9..8d62d559 100644
--- a/freebsd/sys/vm/uma_core.c
+++ b/freebsd/sys/vm/uma_core.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*-
* Copyright (c) 2002-2005, 2009 Jeffrey Roberson <jeff@FreeBSD.org>
@@ -49,7 +49,7 @@
* - Investigate cache size adjustments
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/* I should really use ktr.. */
@@ -59,45 +59,44 @@ __FBSDID("$FreeBSD$");
#define UMA_DEBUG_ALLOC_1 1
*/
-#include <freebsd/local/opt_ddb.h>
-#include <freebsd/local/opt_param.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/ktr.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/sbuf.h>
-#include <freebsd/sys/smp.h>
-#include <freebsd/sys/vmmeter.h>
-
-#include <freebsd/vm/vm.h>
-#ifndef __rtems__
-#include <freebsd/vm/vm_object.h>
-#include <freebsd/vm/vm_page.h>
-#include <freebsd/vm/vm_param.h>
-#include <freebsd/vm/vm_map.h>
-#include <freebsd/vm/vm_kern.h>
-#include <freebsd/vm/vm_extern.h>
-#else
+#include <rtems/bsd/local/opt_ddb.h>
+#include <rtems/bsd/local/opt_param.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/queue.h>
+#include <sys/malloc.h>
+#include <sys/ktr.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/sysctl.h>
+#include <sys/mutex.h>
+#include <sys/proc.h>
+#include <sys/sbuf.h>
+#include <sys/smp.h>
+#include <sys/vmmeter.h>
+
+#include <vm/vm.h>
+#include <vm/vm_object.h>
+#include <vm/vm_page.h>
+#include <vm/vm_param.h>
+#include <vm/vm_map.h>
+#include <vm/vm_kern.h>
+#include <vm/vm_extern.h>
+#ifdef __rtems__
void *rtems_page_alloc(int bytes);
void *rtems_page_find( void *address );
void rtems_page_free( void *address );
#endif /* __rtems__ */
-#include <freebsd/vm/uma.h>
-#include <freebsd/vm/uma_int.h>
-#include <freebsd/vm/uma_dbg.h>
+#include <vm/uma.h>
+#include <vm/uma_int.h>
+#include <vm/uma_dbg.h>
#ifndef __rtems__
-#include <freebsd/machine/vmparam.h>
+#include <machine/vmparam.h>
-#include <freebsd/ddb/ddb.h>
+#include <ddb/ddb.h>
#endif /* __rtems__ */
/*
diff --git a/freebsd/sys/vm/vm.h b/freebsd/sys/vm/vm.h
index 037ac838..941300a0 100644
--- a/freebsd/sys/vm/vm.h
+++ b/freebsd/sys/vm/vm.h
@@ -61,7 +61,7 @@
#ifndef VM_H
#define VM_H
-#include <freebsd/machine/vm.h>
+#include <machine/vm.h>
typedef char vm_inherit_t; /* inheritance codes */
diff --git a/freebsd/time.h b/freebsd/time.h
deleted file mode 100644
index 936ffd88..00000000
--- a/freebsd/time.h
+++ /dev/null
@@ -1 +0,0 @@
-/* EMPTY */
diff --git a/freebsd/usr.bin/netstat/atalk.c b/freebsd/usr.bin/netstat/atalk.c
index 2c7e7a18..c9c8c3f6 100644
--- a/freebsd/usr.bin/netstat/atalk.c
+++ b/freebsd/usr.bin/netstat/atalk.c
@@ -40,15 +40,11 @@ static char sccsid[] = "@(#)atalk.c 1.1 (Whistle) 6/6/96";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
-#ifdef __rtems__
-#include <freebsd/sys/protosw.h>
-#else
#include <sys/protosw.h>
-#endif
#include <arpa/inet.h>
#include <net/route.h>
diff --git a/freebsd/usr.bin/netstat/bpf.c b/freebsd/usr.bin/netstat/bpf.c
index 3e3053d7..09261889 100644
--- a/freebsd/usr.bin/netstat/bpf.c
+++ b/freebsd/usr.bin/netstat/bpf.c
@@ -27,30 +27,20 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
-#ifdef __rtems__
-#include <freebsd/sys/protosw.h>
-#else
+#include <rtems/bsd/sys/types.h>
#include <sys/protosw.h>
-#endif
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/sysctl.h>
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#ifndef __rtems__
#include <sys/user.h>
-#endif
+#endif /* __rtems__ */
#include <net/if.h>
-#ifdef __rtems__
-#include <freebsd/net/if_var.h>
-#include <freebsd/net/bpf.h>
-#include <freebsd/net/bpfdesc.h>
-#else
#include <net/if_var.h>
#include <net/bpf.h>
#include <net/bpfdesc.h>
-#endif
#include <arpa/inet.h>
#include <err.h>
diff --git a/freebsd/usr.bin/netstat/if.c b/freebsd/usr.bin/netstat/if.c
index 2bf86b69..f5b1f380 100644
--- a/freebsd/usr.bin/netstat/if.c
+++ b/freebsd/usr.bin/netstat/if.c
@@ -40,42 +40,26 @@ static char sccsid[] = "@(#)if.c 8.3 (Berkeley) 4/28/95";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
-#ifdef __rtems__
-#include <freebsd/sys/protosw.h>
-#else
+#include <rtems/bsd/sys/types.h>
#include <sys/protosw.h>
-#endif
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/sysctl.h>
-#include <sys/time.h>
+#include <rtems/bsd/sys/time.h>
#include <net/if.h>
-#ifdef __rtems__
-#include <freebsd/net/if_var.h>
-#else
#include <net/if_var.h>
-#endif
#include <net/if_dl.h>
#include <net/if_types.h>
#include <net/ethernet.h>
-#ifdef __rtems__
-#include <freebsd/net/pfvar.h>
-#include <freebsd/net/if_pfsync.h>
-#include <netinet/in.h>
-#include <freebsd/netinet/in_var.h>
-/* IPX not on RTEMS */
-/* #include <netipx/ipx.h> */
-/* #include <netipx/ipx_if.h> */
-#else
#include <net/pfvar.h>
#include <net/if_pfsync.h>
#include <netinet/in.h>
#include <netinet/in_var.h>
+#ifndef __rtems__
#include <netipx/ipx.h>
#include <netipx/ipx_if.h>
-#endif
+#endif /* __rtems__ */
#include <arpa/inet.h>
#include <err.h>
diff --git a/freebsd/usr.bin/netstat/inet.c b/freebsd/usr.bin/netstat/inet.c
index f6d111f3..5a414592 100644
--- a/freebsd/usr.bin/netstat/inet.c
+++ b/freebsd/usr.bin/netstat/inet.c
@@ -40,15 +40,10 @@ static char sccsid[] = "@(#)inet.c 8.5 (Berkeley) 5/24/95";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/queue.h>
-#ifdef __rtems__
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/protosw.h>
-#else
#include <sys/domain.h>
#include <sys/protosw.h>
-#endif
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/sysctl.h>
@@ -58,36 +53,12 @@ __FBSDID("$FreeBSD$");
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
-#ifdef __rtems__
-#include <freebsd/netinet/ip_carp.h>
-#else
#include <netinet/ip_carp.h>
-#endif
#ifdef INET6
#include <netinet/ip6.h>
#endif /* INET6 */
-#ifdef __rtems__
-#include <freebsd/netinet/in_pcb.h>
-#else
#include <netinet/in_pcb.h>
-#endif
#include <netinet/ip_icmp.h>
-#ifdef __rtems__
-#include <freebsd/netinet/icmp_var.h>
-#include <freebsd/netinet/igmp_var.h>
-#include <freebsd/netinet/ip_var.h>
-#include <freebsd/netinet/pim_var.h>
-#include <netinet/tcp.h>
-#include <freebsd/netinet/tcpip.h>
-#include <freebsd/netinet/tcp_seq.h>
-#define TCPSTATES
-#include <freebsd/netinet/tcp_fsm.h>
-#include <freebsd/netinet/tcp_timer.h>
-#include <freebsd/netinet/tcp_var.h>
-#include <freebsd/netinet/tcp_debug.h>
-#include <netinet/udp.h>
-#include <freebsd/netinet/udp_var.h>
-#else
#include <netinet/icmp_var.h>
#include <netinet/igmp_var.h>
#include <netinet/ip_var.h>
@@ -102,7 +73,6 @@ __FBSDID("$FreeBSD$");
#include <netinet/tcp_debug.h>
#include <netinet/udp.h>
#include <netinet/udp_var.h>
-#endif
#include <arpa/inet.h>
#include <err.h>
diff --git a/freebsd/usr.bin/netstat/inet6.c b/freebsd/usr.bin/netstat/inet6.c
index 64b645ee..9f179569 100644
--- a/freebsd/usr.bin/netstat/inet6.c
+++ b/freebsd/usr.bin/netstat/inet6.c
@@ -41,47 +41,27 @@ static char sccsid[] = "@(#)inet6.c 8.4 (Berkeley) 4/20/94";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#ifdef __rtems__
-#include "port_before.h"
-#endif
#ifdef INET6
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/ioctl.h>
-#ifdef __rtems__
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/protosw.h>
-#else
#include <sys/mbuf.h>
#include <sys/protosw.h>
-#endif
#include <sys/sysctl.h>
#include <net/route.h>
#include <net/if.h>
-#ifdef __rtems__
-#include <freebsd/net/if_var.h>
-#else
#include <net/if_var.h>
-#endif
#include <netinet/in.h>
#include <netinet/ip6.h>
#include <netinet/icmp6.h>
#include <netinet/in_systm.h>
-#ifdef __rtems__
-#include <freebsd/netinet6/in6_pcb.h>
-#include <freebsd/netinet6/in6_var.h>
-#include <freebsd/netinet6/ip6_var.h>
-#include <freebsd/netinet6/pim6_var.h>
-#include <freebsd/netinet6/raw_ip6.h>
-#else
#include <netinet6/in6_pcb.h>
#include <netinet6/in6_var.h>
#include <netinet6/ip6_var.h>
#include <netinet6/pim6_var.h>
#include <netinet6/raw_ip6.h>
-#endif
#include <arpa/inet.h>
#include <netdb.h>
diff --git a/freebsd/usr.bin/netstat/ipsec.c b/freebsd/usr.bin/netstat/ipsec.c
index a6ef510c..392f5a70 100644
--- a/freebsd/usr.bin/netstat/ipsec.c
+++ b/freebsd/usr.bin/netstat/ipsec.c
@@ -95,7 +95,7 @@ static char sccsid[] = "@(#)inet.c 8.5 (Berkeley) 5/24/95";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
@@ -103,18 +103,11 @@ __FBSDID("$FreeBSD$");
#include <netinet/in.h>
#ifdef IPSEC
-#ifdef __rtems__
-#include <freebsd/netipsec/ipsec.h>
-#include <freebsd/netipsec/ah_var.h>
-#include <freebsd/netipsec/esp_var.h>
-#include <freebsd/netipsec/ipcomp_var.h>
-#else
#include <netipsec/ipsec.h>
#include <netipsec/ah_var.h>
#include <netipsec/esp_var.h>
#include <netipsec/ipcomp_var.h>
#endif
-#endif
#include <stdint.h>
#include <stdio.h>
diff --git a/freebsd/usr.bin/netstat/main.c b/freebsd/usr.bin/netstat/main.c
index 1c2461b0..a072801a 100644
--- a/freebsd/usr.bin/netstat/main.c
+++ b/freebsd/usr.bin/netstat/main.c
@@ -50,13 +50,9 @@ static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 3/1/94";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/file.h>
-#ifdef __rtems__
-#include <freebsd/sys/protosw.h>
-#else
#include <sys/protosw.h>
-#endif
#include <sys/socket.h>
#include <sys/socketvar.h>
diff --git a/freebsd/usr.bin/netstat/mbuf.c b/freebsd/usr.bin/netstat/mbuf.c
index 418c761b..1869cd76 100644
--- a/freebsd/usr.bin/netstat/mbuf.c
+++ b/freebsd/usr.bin/netstat/mbuf.c
@@ -42,15 +42,9 @@ static char sccsid[] = "@(#)mbuf.c 8.1 (Berkeley) 6/6/93";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/param.h>
-#ifdef __rtems__
-#include <stdint.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/protosw.h>
-#else
+#include <rtems/bsd/sys/param.h>
#include <sys/mbuf.h>
#include <sys/protosw.h>
-#endif
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/sysctl.h>
diff --git a/freebsd/usr.bin/netstat/mroute.c b/freebsd/usr.bin/netstat/mroute.c
index 7669ff07..d26505b4 100644
--- a/freebsd/usr.bin/netstat/mroute.c
+++ b/freebsd/usr.bin/netstat/mroute.c
@@ -46,22 +46,14 @@ __FBSDID("$FreeBSD$");
* MROUTING 1.0
*/
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/sysctl.h>
-#ifdef __rtems__
-#include <freebsd/sys/protosw.h>
-#else
#include <sys/protosw.h>
-#endif
-#ifdef __rtems__
-#include <freebsd/sys/mbuf.h>
-#else
#include <sys/mbuf.h>
-#endif
-#include <sys/time.h>
+#include <rtems/bsd/sys/time.h>
#include <net/if.h>
#include <netinet/in.h>
@@ -69,11 +61,7 @@ __FBSDID("$FreeBSD$");
#include <net/route.h>
#define _KERNEL 1
-#ifdef __rtems__
-#include <freebsd/netinet/ip_mroute.h>
-#else
#include <netinet/ip_mroute.h>
-#endif
#undef _KERNEL
#include <err.h>
diff --git a/freebsd/usr.bin/netstat/mroute6.c b/freebsd/usr.bin/netstat/mroute6.c
index 4fff5462..cdd7eaf2 100644
--- a/freebsd/usr.bin/netstat/mroute6.c
+++ b/freebsd/usr.bin/netstat/mroute6.c
@@ -68,33 +68,18 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#ifdef __rtems__
-#include "port_before.h"
-#endif
#ifdef INET6
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/sysctl.h>
-#ifdef __rtems__
-#include <freebsd/sys/protosw.h>
-#else
#include <sys/protosw.h>
-#endif
-#ifdef __rtems__
-#include <freebsd/sys/mbuf.h>
-#else
#include <sys/mbuf.h>
-#endif
-#include <sys/time.h>
+#include <rtems/bsd/sys/time.h>
#include <net/if.h>
-#ifdef __rtems__
-#include <freebsd/net/if_var.h>
-#else
#include <net/if_var.h>
-#endif
#include <net/route.h>
#include <netinet/in.h>
@@ -105,11 +90,7 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#define KERNEL 1
-#ifdef __rtems__
-#include <freebsd/netinet6/ip6_mroute.h>
-#else
#include <netinet6/ip6_mroute.h>
-#endif
#undef KERNEL
#include "netstat.h"
diff --git a/freebsd/usr.bin/netstat/netstat.h b/freebsd/usr.bin/netstat/netstat.h
index c7564c6f..c3073ec3 100644
--- a/freebsd/usr.bin/netstat/netstat.h
+++ b/freebsd/usr.bin/netstat/netstat.h
@@ -35,12 +35,6 @@
*/
#include <sys/cdefs.h>
-#ifdef __rtems__
-#define __BSD_VISIBLE 1
-#include <freebsd/sys/types.h>
-
-#define rt_tables netstat_rt_tables
-#endif
extern int Aflag; /* show addresses of protocol control block */
extern int aflag; /* show all sockets (including servers) */
@@ -133,6 +127,7 @@ char *ns_phost(struct sockaddr *);
void upHex(char *);
#ifdef __rtems__
+#define rt_tables netstat_rt_tables
#define routename rtems_shell_netstats_routername
#define netname rtems_shell_netstats_netname
#define sotoxsocket rtems_shell_netstats_sotoxsocket
diff --git a/freebsd/usr.bin/netstat/pfkey.c b/freebsd/usr.bin/netstat/pfkey.c
index 7c5af07b..9d91532f 100644
--- a/freebsd/usr.bin/netstat/pfkey.c
+++ b/freebsd/usr.bin/netstat/pfkey.c
@@ -70,7 +70,7 @@ static char sccsid[] = "@(#)inet.c 8.5 (Berkeley) 5/24/95";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
@@ -78,12 +78,8 @@ __FBSDID("$FreeBSD$");
#include <netinet/in.h>
#ifdef IPSEC
-#ifdef __rtems__
-#include <freebsd/netipsec/keysock.h>
-#else
#include <netipsec/keysock.h>
#endif
-#endif
#include <stdint.h>
#include <stdio.h>
diff --git a/freebsd/usr.bin/netstat/route.c b/freebsd/usr.bin/netstat/route.c
index 55042814..bc6bb63d 100644
--- a/freebsd/usr.bin/netstat/route.c
+++ b/freebsd/usr.bin/netstat/route.c
@@ -40,54 +40,38 @@ static char sccsid[] = "From: @(#)route.c 8.6 (Berkeley) 4/28/95";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/param.h>
-#ifdef __rtems__
-#include <freebsd/sys/protosw.h>
-#else
+#include <rtems/bsd/sys/param.h>
#include <sys/protosw.h>
-#endif
#include <sys/socket.h>
#include <sys/socketvar.h>
-#include <sys/time.h>
+#include <rtems/bsd/sys/time.h>
#include <net/ethernet.h>
#include <net/if.h>
-#ifdef __rtems__
-#include <freebsd/net/if_var.h>
-#else
#include <net/if_var.h>
-#endif
#include <net/if_dl.h>
#include <net/if_types.h>
-#ifdef __rtems__
-#include <freebsd/net/radix.h>
-#else
#include <net/radix.h>
-#endif
#include <net/route.h>
#include <netinet/in.h>
#ifdef __rtems__
/* no IPX on RTEMS */
/* no AppleTalk on RTEMS */
-#else
+#else /* __rtems__ */
#include <netipx/ipx.h>
#include <netatalk/at.h>
-#endif
+#endif /* __rtems__ */
#ifdef __rtems__
/* why isn't this protected by a NETGRAPH define */
-#else
+#else /* __rtems__ */
#include <netgraph/ng_socket.h>
-#endif
+#endif /* __rtems__ */
#include <sys/sysctl.h>
#include <arpa/inet.h>
-#ifdef __rtems__
-/* apparently libutil.h is not needed */
-#else
#include <libutil.h>
-#endif
#include <netdb.h>
#include <stdint.h>
#include <stdio.h>
diff --git a/freebsd/usr.bin/netstat/sctp.c b/freebsd/usr.bin/netstat/sctp.c
index 0c02db9f..d32d28d1 100644
--- a/freebsd/usr.bin/netstat/sctp.c
+++ b/freebsd/usr.bin/netstat/sctp.c
@@ -37,35 +37,22 @@ static char sccsid[] = "@(#)sctp.c 0.1 (Berkeley) 4/18/2007";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/queue.h>
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/sysctl.h>
-#ifdef __rtems__
-#include <freebsd/sys/protosw.h>
-#else
#include <sys/protosw.h>
-#endif
#include <netinet/in.h>
-#ifdef __rtems__
-#include <freebsd/netinet/sctp.h>
-#include <freebsd/netinet/sctp_constants.h>
-#else
#include <netinet/sctp.h>
#include <netinet/sctp_constants.h>
-#endif
#include <arpa/inet.h>
#include <err.h>
#include <errno.h>
-#ifdef __rtems__
-/* apparently libutil.h is not needed */
-#else
#include <libutil.h>
-#endif
#include <netdb.h>
#include <stdint.h>
#include <stdio.h>
diff --git a/freebsd/usr.bin/netstat/unix.c b/freebsd/usr.bin/netstat/unix.c
index 15bea05c..602cec7f 100644
--- a/freebsd/usr.bin/netstat/unix.c
+++ b/freebsd/usr.bin/netstat/unix.c
@@ -43,25 +43,17 @@ __FBSDID("$FreeBSD$");
/*
* Display protocol blocks in the unix domain.
*/
-#include <sys/param.h>
+#include <rtems/bsd/sys/param.h>
#include <sys/queue.h>
-#ifdef __rtems__
-#include <freebsd/sys/protosw.h>
-#else
#include <sys/protosw.h>
-#endif
#include <sys/socket.h>
#include <sys/socketvar.h>
-#ifdef __rtems__
-#include <freebsd/sys/mbuf.h>
-#else
#include <sys/mbuf.h>
-#endif
#include <sys/sysctl.h>
#include <sys/un.h>
#ifndef __rtems__
#include <sys/unpcb.h>
-#endif
+#endif /* __rtems__ */
#include <netinet/in.h>
diff --git a/rtemsbsd/bfin/include/freebsd/machine/cpufunc.h b/rtemsbsd/bfin/include/freebsd/machine/cpufunc.h
deleted file mode 100644
index fa882cb5..00000000
--- a/rtemsbsd/bfin/include/freebsd/machine/cpufunc.h
+++ /dev/null
@@ -1 +0,0 @@
-/* empty file */
diff --git a/rtemsbsd/freebsd/machine/_align.h b/rtemsbsd/freebsd/machine/_align.h
deleted file mode 100644
index a307acaa..00000000
--- a/rtemsbsd/freebsd/machine/_align.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * @file
- *
- * @ingroup rtems_bsd_machine
- *
- * @brief TODO.
- */
-
-/*
- * Copyright (c) 2009, 2010 embedded brains GmbH. All rights reserved.
- *
- * embedded brains GmbH
- * Obere Lagerstr. 30
- * 82178 Puchheim
- * Germany
- * <rtems@embedded-brains.de>
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- */
-
-#ifndef _RTEMS_BSD_MACHINE__ALIGN_H_
-#define _RTEMS_BSD_MACHINE__ALIGN_H_
-
-#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_
-#error "the header file <freebsd/machine/rtems-bsd-config.h> must be included first"
-#endif
-
-#define _ALIGNBYTES ((uintptr_t) (CPU_ALIGNMENT - 1))
-#define _ALIGN(p) (((uintptr_t) (p) + _ALIGNBYTES) & ~_ALIGNBYTES)
-
-#endif /* _RTEMS_BSD_MACHINE__ALIGN_H_ */
diff --git a/rtemsbsd/freebsd/machine/_stdint.h b/rtemsbsd/freebsd/machine/_stdint.h
deleted file mode 100644
index c41425f6..00000000
--- a/rtemsbsd/freebsd/machine/_stdint.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * @file
- *
- * @ingroup rtems_bsd_machine
- *
- * @brief TODO.
- */
-
-/*
- * Copyright (c) 2009, 2010 embedded brains GmbH. All rights reserved.
- *
- * embedded brains GmbH
- * Obere Lagerstr. 30
- * 82178 Puchheim
- * Germany
- * <rtems@embedded-brains.de>
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- */
-
-#ifndef _RTEMS_BSD_MACHINE__STDINT_H_
-#define _RTEMS_BSD_MACHINE__STDINT_H_
-
-#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_
-#error "the header file <freebsd/machine/rtems-bsd-config.h> must be included first"
-#endif
-
-#endif /* _RTEMS_BSD_MACHINE__STDINT_H_ */
diff --git a/rtemsbsd/freebsd/machine/_types.h b/rtemsbsd/freebsd/machine/_types.h
deleted file mode 100644
index 0a1c80b0..00000000
--- a/rtemsbsd/freebsd/machine/_types.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * @file
- *
- * @ingroup rtems_bsd_machine
- *
- * @brief TODO.
- */
-
-/*
- * Copyright (c) 2009, 2010 embedded brains GmbH. All rights reserved.
- *
- * embedded brains GmbH
- * Obere Lagerstr. 30
- * 82178 Puchheim
- * Germany
- * <rtems@embedded-brains.de>
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- */
-
-#ifndef _RTEMS_BSD_MACHINE__TYPES_H_
-#define _RTEMS_BSD_MACHINE__TYPES_H_
-
-#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_
-#error "the header file <freebsd/machine/rtems-bsd-config.h> must be included first"
-#endif
-
-#endif /* _RTEMS_BSD_MACHINE__TYPES_H_ */
diff --git a/rtemsbsd/freebsd/machine/param.h b/rtemsbsd/freebsd/machine/param.h
deleted file mode 100644
index c0472daf..00000000
--- a/rtemsbsd/freebsd/machine/param.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * @file
- *
- * @ingroup rtems_bsd_machine
- *
- * @brief TODO.
- */
-
-/*
- * Copyright (c) 2009, 2010 embedded brains GmbH. All rights reserved.
- *
- * embedded brains GmbH
- * Obere Lagerstr. 30
- * 82178 Puchheim
- * Germany
- * <rtems@embedded-brains.de>
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- */
-
-#ifndef _RTEMS_BSD_MACHINE_PARAM_H_
-#define _RTEMS_BSD_MACHINE_PARAM_H_
-
-#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_
-#error "the header file <freebsd/machine/rtems-bsd-config.h> must be included first"
-#endif
-
-#include <machine/param.h>
-
-#define MAXCPU 1
-
-#define CACHE_LINE_SHIFT 7
-
-#define CACHE_LINE_SIZE (1 << CACHE_LINE_SHIFT)
-
-#define MAXPAGESIZES 1 /* maximum number of supported page sizes */
-
-#define MACHINE_ARCH "rtems"
-
-#endif /* _RTEMS_BSD_MACHINE_PARAM_H_ */
diff --git a/rtemsbsd/freebsd/machine/resource.h b/rtemsbsd/freebsd/machine/resource.h
deleted file mode 100644
index b29a0aca..00000000
--- a/rtemsbsd/freebsd/machine/resource.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * @file
- *
- * @ingroup rtems_bsd_machine
- *
- * @brief TODO.
- */
-
-/*
- * Copyright (c) 2009, 2010 embedded brains GmbH. All rights reserved.
- *
- * embedded brains GmbH
- * Obere Lagerstr. 30
- * 82178 Puchheim
- * Germany
- * <rtems@embedded-brains.de>
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- */
-
-#ifndef _RTEMS_BSD_MACHINE_RESOURCE_H_
-#define _RTEMS_BSD_MACHINE_RESOURCE_H_
-
-#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_
-#error "the header file <freebsd/machine/rtems-bsd-config.h> must be included first"
-#endif
-
-#endif /* _RTEMS_BSD_MACHINE_RESOURCE_H_ */
diff --git a/rtemsbsd/freebsd/machine/rtems-bsd-select.h b/rtemsbsd/freebsd/machine/rtems-bsd-select.h
deleted file mode 100644
index 368c285b..00000000
--- a/rtemsbsd/freebsd/machine/rtems-bsd-select.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)select.h 8.2 (Berkeley) 1/4/94
- * $Id: select.h,v 1.7 2010/04/02 07:39:34 ralf Exp $
- */
-
-#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_SELECT_H_
-#define _RTEMS_BSD_MACHINE_RTEMS_BSD_SELECT_H_
-
-#ifndef _KERNEL
-
-#include <sys/time.h> /* struct timeval */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Used to maintain information about processes that wish to be
- * notified when I/O becomes possible.
- */
-#if 0
-struct selinfo {
- pid_t si_pid; /* process to be notified */
- short si_flags; /* see below */
-};
-#endif
-#define SI_COLL 0x0001 /* collision occurred */
-
-/* Check the first NFDS descriptors each in READFDS (if not NULL) for read
- readiness, in WRITEFDS (if not NULL) for write readiness, and in EXCEPTFDS
- (if not NULL) for exceptional conditions. If TIMEOUT is not NULL, time out
- after waiting the interval specified therein. Returns the number of ready
- descriptors, or -1 for errors. */
-extern int select (int __nfds, fd_set *__readfds,
- fd_set *__writefds,
- fd_set *__exceptfds,
- struct timeval *__timeout);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !_KERNEL */
-
-#endif /* !_RTEMS_BSD_MACHINE_RTEMS_BSD_SELECT_H_ */
diff --git a/rtemsbsd/freebsd/sys/_iovec.h b/rtemsbsd/freebsd/sys/_iovec.h
deleted file mode 100644
index 8e9ba4a4..00000000
--- a/rtemsbsd/freebsd/sys/_iovec.h
+++ /dev/null
@@ -1,2 +0,0 @@
-/* <sys/_iovec.h> is installed by RTEMS */
-#include <sys/_iovec.h>
diff --git a/rtemsbsd/freebsd/sys/cdefs.h b/rtemsbsd/freebsd/sys/cdefs.h
deleted file mode 100644
index 522eecd4..00000000
--- a/rtemsbsd/freebsd/sys/cdefs.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef __RTEMSBSD_FREEBSD_SYS_CDEFS_h
-#define __RTEMSBSD_FREEBSD_SYS_CDEFS_h
-
-/* <sys/cdefs.h> is owned by newlib */
-#include <sys/cdefs.h>
-
-#endif /* !__RTEMSBSD_FREEBSD_SYS_CDEFS_h */
diff --git a/rtemsbsd/freebsd/sys/signal.h b/rtemsbsd/freebsd/sys/signal.h
deleted file mode 100644
index 1032e153..00000000
--- a/rtemsbsd/freebsd/sys/signal.h
+++ /dev/null
@@ -1,2 +0,0 @@
-/* <sys/signal.h> is owned by newlib */
-#include <sys/signal.h>
diff --git a/rtemsbsd/freebsd/sys/uio.h b/rtemsbsd/freebsd/sys/uio.h
deleted file mode 100644
index 896bca3d..00000000
--- a/rtemsbsd/freebsd/sys/uio.h
+++ /dev/null
@@ -1,2 +0,0 @@
-/* <sys/uio.h> is installed by RTEMS */
-#include <sys/uio.h>
diff --git a/rtemsbsd/h8300/include/freebsd/machine/cpufunc.h b/rtemsbsd/h8300/include/freebsd/machine/cpufunc.h
deleted file mode 100644
index fa882cb5..00000000
--- a/rtemsbsd/h8300/include/freebsd/machine/cpufunc.h
+++ /dev/null
@@ -1 +0,0 @@
-/* empty file */
diff --git a/rtemsbsd/include/machine/_bus.h b/rtemsbsd/include/machine/_bus.h
index 436fb584..3891cb15 100644
--- a/rtemsbsd/include/machine/_bus.h
+++ b/rtemsbsd/include/machine/_bus.h
@@ -1 +1 @@
-#include <freebsd/machine/bus.h>
+#include <machine/bus.h>
diff --git a/rtemsbsd/include/machine/_limits.h b/rtemsbsd/include/machine/_limits.h
index 46cac302..c7187c60 100644
--- a/rtemsbsd/include/machine/_limits.h
+++ b/rtemsbsd/include/machine/_limits.h
@@ -7,24 +7,43 @@
*/
/*
- * Copyright (c) 2009, 2010 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2009-2013 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
- * Obere Lagerstr. 30
+ * Dornierstr. 4
* 82178 Puchheim
* Germany
* <rtems@embedded-brains.de>
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
*/
#ifndef _RTEMS_BSD_MACHINE__LIMITS_H_
#define _RTEMS_BSD_MACHINE__LIMITS_H_
-#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_
-#error "the header file <freebsd/machine/rtems-bsd-config.h> must be included first"
-#endif
+#include <limits.h>
+
+#define __CHAR_BIT CHAR_BIT
+
+#define __INT_MAX INT_MAX
#endif /* _RTEMS_BSD_MACHINE__LIMITS_H_ */
diff --git a/rtemsbsd/include/machine/bus.h b/rtemsbsd/include/machine/bus.h
index 18689dec..28558905 100644
--- a/rtemsbsd/include/machine/bus.h
+++ b/rtemsbsd/include/machine/bus.h
@@ -213,15 +213,15 @@ bus_space_free(bus_space_tag_t bst __unused, bus_space_handle_t bsh, bus_size_t
#if defined(__i386__)
- #include <freebsd/machine/bus_space-i386.h>
+ #include <machine/bus_space-i386.h>
#elif defined(__ppc__)
- #include <freebsd/machine/bus_space-simple_memory.h>
+ #include <machine/bus_space-simple_memory.h>
#else
#warning "Bus space routines not implemented for this architecture!!"
#warning "Defaulting to simple-memory Bus space routines!!"
- #include <freebsd/machine/bus_space-simple_memory.h>
+ #include <machine/bus_space-simple_memory.h>
#endif
-#include <freebsd/machine/bus_dma.h>
+#include <machine/bus_dma.h>
#endif /* _RTEMS_BSD_MACHINE_BUS_H_ */
diff --git a/rtemsbsd/include/machine/bus_dma.h b/rtemsbsd/include/machine/bus_dma.h
index 44ed7762..d4a1cfb8 100644
--- a/rtemsbsd/include/machine/bus_dma.h
+++ b/rtemsbsd/include/machine/bus_dma.h
@@ -27,6 +27,6 @@
#error "the header file <freebsd/machine/rtems-bsd-config.h> must be included first"
#endif
-#include <freebsd/sys/bus_dma.h>
+#include <sys/bus_dma.h>
#endif /* _RTEMS_BSD_MACHINE_BUS_DMA_H_ */
diff --git a/rtemsbsd/include/machine/bus_space-i386.h b/rtemsbsd/include/machine/bus_space-i386.h
index 748d883d..67868001 100644
--- a/rtemsbsd/include/machine/bus_space-i386.h
+++ b/rtemsbsd/include/machine/bus_space-i386.h
@@ -114,9 +114,9 @@
#ifndef _RTEMS_BSD_MACHINE_BUS_I386_H_
#define _RTEMS_BSD_MACHINE_BUS_I386_H_
-#include <freebsd/machine/_bus.h>
-#include <freebsd/machine/cpufunc.h>
-#include <freebsd/machine/resource.h>
+#include <machine/_bus.h>
+#include <machine/cpufunc.h>
+#include <machine/resource.h>
#if 0
#define I386_BUS_SPACE_IO SYS_RES_IOPORT
diff --git a/rtemsbsd/include/machine/elf.h b/rtemsbsd/include/machine/elf.h
index 936ffd88..e69de29b 100644
--- a/rtemsbsd/include/machine/elf.h
+++ b/rtemsbsd/include/machine/elf.h
@@ -1 +0,0 @@
-/* EMPTY */
diff --git a/rtemsbsd/include/machine/mutex.h b/rtemsbsd/include/machine/mutex.h
index 8ab14405..7b36e6b9 100644
--- a/rtemsbsd/include/machine/mutex.h
+++ b/rtemsbsd/include/machine/mutex.h
@@ -7,24 +7,39 @@
*/
/*
- * Copyright (c) 2009, 2010 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2009-2013 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
- * Obere Lagerstr. 30
+ * Dornierstr. 4
* 82178 Puchheim
* Germany
* <rtems@embedded-brains.de>
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
*/
#ifndef _RTEMS_BSD_MACHINE_MUTEX_H_
#define _RTEMS_BSD_MACHINE_MUTEX_H_
-#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_
-#error "the header file <freebsd/machine/rtems-bsd-config.h> must be included first"
-#endif
+/* Empty */
#endif /* _RTEMS_BSD_MACHINE_MUTEX_H_ */
diff --git a/rtemsbsd/include/machine/pcb.h b/rtemsbsd/include/machine/pcb.h
index 936ffd88..e69de29b 100644
--- a/rtemsbsd/include/machine/pcb.h
+++ b/rtemsbsd/include/machine/pcb.h
@@ -1 +0,0 @@
-/* EMPTY */
diff --git a/rtemsbsd/include/machine/resource.h b/rtemsbsd/include/machine/resource.h
index 9b143810..35ad0924 100644
--- a/rtemsbsd/include/machine/resource.h
+++ b/rtemsbsd/include/machine/resource.h
@@ -1,10 +1,32 @@
-#ifndef _MACHINE_RESOURCE_H_
-#define _MACHINE_RESOURCE_H_ 1
+/**
+ * @file
+ *
+ * @ingroup rtems_bsd_machine
+ *
+ * @brief TODO.
+ */
-#define SYS_RES_IRQ 1 /* interrupt lines */
-#define SYS_RES_DRQ 2 /* isa dma lines */
-#define SYS_RES_MEMORY 3 /* i/o memory */
-#define SYS_RES_IOPORT 4 /* i/o ports */
-#define SYS_RES_GPIO 5 /* general purpose i/o */
+/*
+ * Copyright (c) 2009, 2010 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Obere Lagerstr. 30
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
-#endif /* !_MACHINE_RESOURCE_H_ */
+#ifndef _RTEMS_BSD_MACHINE_RESOURCE_H_
+#define _RTEMS_BSD_MACHINE_RESOURCE_H_
+
+#define SYS_RES_IRQ 1
+#define SYS_RES_DRQ 2
+#define SYS_RES_MEMORY 3
+#define SYS_RES_IOPORT 4
+#define SYS_RES_GPIO 5
+
+#endif /* _RTEMS_BSD_MACHINE_RESOURCE_H_ */
diff --git a/rtemsbsd/include/machine/rtems-bsd-bus-dma.h b/rtemsbsd/include/machine/rtems-bsd-bus-dma.h
index e9115e42..5cff23b1 100644
--- a/rtemsbsd/include/machine/rtems-bsd-bus-dma.h
+++ b/rtemsbsd/include/machine/rtems-bsd-bus-dma.h
@@ -47,12 +47,12 @@
#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_BUS_DMA_H_
#define _RTEMS_BSD_MACHINE_RTEMS_BSD_BUS_DMA_H_
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/machine/bus.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/systm.h>
+#include <machine/bus.h>
struct bus_dma_tag {
bus_dma_tag_t parent;
diff --git a/rtemsbsd/include/machine/rtems-bsd-config.h.in b/rtemsbsd/include/machine/rtems-bsd-config.h.in
index 655d319a..64dce1cc 100644
--- a/rtemsbsd/include/machine/rtems-bsd-config.h.in
+++ b/rtemsbsd/include/machine/rtems-bsd-config.h.in
@@ -23,33 +23,14 @@
#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_
#define _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_
-/* We compile for RTEMS and FreeBSD */
-#define __rtems__ 1
-#define __FreeBSD__ 1
-#define __BSD_VISIBLE 1
-
/* XXX hack so /opt.../machine/param.h can disable MSIZE and use this one */
#define __NEW_RTEMS_BSD__
-#include <sys/cdefs.h>
-
-#ifndef _RTEMS_BSD_BSD_HH_
/* General defines to activate BSD kernel parts */
#define _KERNEL 1
-/* Disable standard system headers */
-#undef _SYS_UNISTD_H
-#define _SYS_UNISTD_H 1
-#undef _SYS_TTYCOM_H_
-#define _SYS_TTYCOM_H_ 1
-
-/* Disable some quirks in the standard headers */
-#define _POSIX_SOURCE 1
-
-/* We need POSIX threads */
-#define _POSIX_THREADS 1
-
-#endif /* !_RTEMS_BSD_BSD_HH_ */
+#include <sys/cdefs.h>
+#include <sys/types.h>
/* Type set from the C standard */
#include <stdarg.h>
@@ -59,8 +40,6 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#include <errno.h>
-#include <sys/types.h>
/* Ensure that we are RTEMS compatible and can use RTEMS */
#include <rtems.h>
@@ -68,7 +47,6 @@
#include <rtems/chain.h>
#include <rtems/libio.h>
-#ifndef _RTEMS_BSD_BSD_HH_
/* Ensure that we can use POSIX threads */
#include <pthread.h>
@@ -78,8 +56,6 @@
/* Symbol undefines */
#undef MAXPATHLEN
-#endif /* !_RTEMS_BSD_BSD_HH_ */
-
/* Networking */
#define IPSEC 1
#define INET 1
@@ -88,131 +64,26 @@
/* Integer type definitions */
-#define __INT_MAX INT_MAX
-#define GID_MAX UINT_MAX /* max value for a gid_t */
-#define UID_MAX UINT_MAX /* max value for a uid_t */
-
-#define __int8_t int8_t
-#define __int16_t int16_t
-#define __int32_t int32_t
-#define __int64_t int64_t
-
-#define __int_least8_t int_least8_t
-#define __int_least16_t int_least16_t
-#define __int_least32_t int_least32_t
-#define __int_least64_t int_least64_t
-
-#define __int_fast8_t int_fast8_t
-#define __int_fast16_t int_fast16_t
-#define __int_fast32_t int_fast32_t
-#define __int_fast64_t int_fast64_t
-
-#define __uint8_t uint8_t
-#define __uint16_t uint16_t
-#define __uint32_t uint32_t
-#define __uint64_t uint64_t
-
-#define __uint_least8_t uint_least8_t
-#define __uint_least16_t uint_least16_t
-#define __uint_least32_t uint_least32_t
-#define __uint_least64_t uint_least64_t
-
-#define __uint_fast8_t uint_fast8_t
-#define __uint_fast16_t uint_fast16_t
-#define __uint_fast32_t uint_fast32_t
-#define __uint_fast64_t uint_fast64_t
-
-#define __intfptr_t intptr_t
-#define __uintfptr_t uintptr_t
-
-#define __intptr_t intptr_t
-#define __uintptr_t uintptr_t
-
-#define __intmax_t intmax_t
-#define __uintmax_t uintmax_t
-
-#define __register_t int
-#define __u_register_t unsigned int
-
#define __float_t float
#define __double_t double
-#define __vm_offset_t uintptr_t
-#define __vm_ooffset_t uint64_t
-#define __vm_paddr_t uintptr_t
-#define __vm_pindex_t uint64_t
-#define __vm_size_t uintptr_t
-
#define __clock_t clock_t
#define __cpumask_t unsigned int
#define __critical_t intptr_t
#define __ptrdiff_t ptrdiff_t
-#define __segsz_t intptr_t
#define __time_t time_t
-#define __va_list va_list
-
-#undef __size_t
-#define __size_t size_t
-
#define _CLOCKID_T_DECLARED 1
-#define _DEV_T_DECLARED 1
-#define _GID_T_DECLARED 1
-#define _MODE_T_DECLARED 1
-#define _OFF_T_DECLARED 1
-#define _PID_T_DECLARED 1
-#define _SSIZE_T_DECLARED 1
#define _TIMER_T_DECLARED 1
#define _TIME_T_DECLARED 1
-#define _UID_T_DECLARED 1
#define _USECONDS_T_DECLARED 1
#define _FSBLKCNT_T_DECLARED 1
#define _BLKSIZE_T_DECLARED 1
#define _BLKCNT_T_DECLARED 1
-#define __dev_t _bsd_dev_t
-#define __gid_t _bsd_gid_t
-#define __off_t _bsd_off_t
-#define __pid_t _bsd_pid_t
-#define __uid_t _bsd_uid_t
-
-/* Missing error number */
-//#define ENOIOCTL EINVAL
-
-/* multiple user space methods and commands use this */
-#ifndef _PATH_DEVNULL
-#define _PATH_DEVNULL "/dev/null"
-#endif
-
-/* used by some user space code */
-#ifndef SIZE_T_MAX
-#define SIZE_T_MAX SIZE_MAX
-#endif
-
-/* used by some user space code */
-#ifndef O_EXLOCK
-#define O_EXLOCK O_EXCL
-#endif
-
-/* used by some user space code */
-#if !defined O_NOFOLLOW
-#define O_NOFOLLOW 0
-#endif
-
-/* used by some user space code */
-#ifndef O_SHLOCK
-#define O_SHLOCK 0
-#endif
-
-/* from limits.h on FreeBSD */
-#ifndef _POSIX_HOST_NAME_MAX
-#define _POSIX_HOST_NAME_MAX 255
-#endif
-
-#ifndef _RTEMS_BSD_BSD_HH_
/* Symbol rename */
-#include <freebsd/machine/rtems-bsd-symbols.h>
+#include <machine/rtems-bsd-symbols.h>
#define gets _bsd_gets
#define realloc _bsd_realloc
@@ -276,6 +147,4 @@ extern rtems_chain_control rtems_bsd_malloc_chain;
/* CPU definitions */
#define cpu_spinwait() /* nothing */
-#endif /* !_RTEMS_BSD_BSD_HH_ */
-
#endif /* _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_ */
diff --git a/rtemsbsd/include/machine/rtems-bsd-devicet.h b/rtemsbsd/include/machine/rtems-bsd-devicet.h
index 2db95850..9c59577b 100644
--- a/rtemsbsd/include/machine/rtems-bsd-devicet.h
+++ b/rtemsbsd/include/machine/rtems-bsd-devicet.h
@@ -41,7 +41,7 @@
#include <stdarg.h>
#include <stdio.h>
-#include <freebsd/sys/queue.h>
+#include <sys/queue.h>
typedef struct device *device_t;
diff --git a/rtemsbsd/include/machine/rtems-bsd-endian.h b/rtemsbsd/include/machine/rtems-bsd-endian.h
new file mode 100644
index 00000000..006a9f37
--- /dev/null
+++ b/rtemsbsd/include/machine/rtems-bsd-endian.h
@@ -0,0 +1,107 @@
+/**
+ * @file
+ *
+ * @ingroup rtems_bsd_machine
+ *
+ * @brief TODO.
+ */
+
+/*
+ * Copyright (c) 2009-2013 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _RTEMS_BSD_MACHINE_ENDIAN_H
+#define _RTEMS_BSD_MACHINE_ENDIAN_H
+
+#include <machine/endian.h>
+#include <stdint.h>
+
+#if __BSD_VISIBLE
+
+#define _BYTE_ORDER BYTE_ORDER
+#define _BIG_ENDIAN BIG_ENDIAN
+#define _LITTLE_ENDIAN LITTLE_ENDIAN
+
+#if BYTE_ORDER == BIG_ENDIAN
+#define __ntohl(x) ((uint32_t) (x))
+#define __ntohs(x) ((uint16_t) (x))
+#define __htonl(x) ((uint32_t) (x))
+#define __htons(x) ((uint16_t) (x))
+#else
+#define __ntohl(x) (__bswap32(x))
+#define __ntohs(x) (__bswap16(x))
+#define __htonl(x) (__bswap32(x))
+#define __htons(x) (__bswap16(x))
+#endif
+
+static inline uint16_t
+__bswap16(uint16_t v)
+{
+#ifdef __GNUC__
+ return __builtin_bswap16(v);
+#else
+ return (uint16_t) ((v >> 8)
+ | ((v & 0xffU) << 8));
+#endif
+}
+
+static inline uint32_t
+__bswap32(uint32_t v)
+{
+#ifdef __GNUC__
+ return __builtin_bswap32(v);
+#else
+ return (uint32_t) ((v >> 24)
+ | ((v >> 8) && 0xff00U)
+ | ((v & 0xff00U) << 8)
+ | ((v & 0xffU) << 24));
+#endif
+}
+
+static inline uint64_t
+__bswap64(uint64_t v)
+{
+#ifdef __GNUC__
+ return __builtin_bswap64(v);
+#else
+ return (uint64_t) ((v >> 56)
+ | ((v >> 40) && 0xff00U)
+ | ((v >> 24) && 0xff0000U)
+ | ((v >> 8) && 0xff000000U)
+ | ((v & 0xff000000U) << 8)
+ | ((v & 0xff0000U) << 24)
+ | ((v & 0xff00U) << 40)
+ | ((v & 0xffU) << 56));
+#endif
+}
+
+#endif /* __BSD_VISIBLE */
+
+#endif /* _RTEMS_BSD_MACHINE_ENDIAN_H */
diff --git a/freebsd/sys/_iovec.h b/rtemsbsd/include/machine/rtems-bsd-param.h
index e98d84b9..ffcbf926 100644
--- a/freebsd/sys/_iovec.h
+++ b/rtemsbsd/include/machine/rtems-bsd-param.h
@@ -1,6 +1,19 @@
-/*-
- * Copyright (c) 1982, 1986, 1993, 1994
- * The Regents of the University of California. All rights reserved.
+/**
+ * @file
+ *
+ * @ingroup rtems_bsd_machine
+ *
+ * @brief TODO.
+ */
+
+/*
+ * Copyright (c) 2009-2013 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -10,14 +23,11 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
@@ -25,34 +35,25 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * @(#)uio.h 8.5 (Berkeley) 2/22/94
- * $FreeBSD$
*/
-#ifndef _SYS__IOVEC_HH_
-#define _SYS__IOVEC_HH_
-
-#include <freebsd/sys/_types.h>
-
-#ifndef _SIZE_T_DECLARED
-typedef __size_t size_t;
-#define _SIZE_T_DECLARED
-#endif
-
-#ifdef __rtems__
-#ifndef __IOVEC_DEFINED
-#define __IOVEC_DEFINED
-struct iovec {
- void *iov_base; /* Base address. */
- size_t iov_len; /* Length. */
-};
-#endif /* __IOVEC_DEFINED */
-#else
-struct iovec {
- void *iov_base; /* Base address. */
- size_t iov_len; /* Length. */
-};
-#endif /* rtems */
-
-#endif /* !_SYS__IOVEC_HH_ */
+#ifndef _RTEMS_BSD_MACHINE_PARAM_H_
+#define _RTEMS_BSD_MACHINE_PARAM_H_
+
+#include <machine/param.h>
+
+#define _ALIGNBYTES ALIGNBYTES
+
+#define _ALIGN(p) ALIGN(p)
+
+#define MAXCPU 1
+
+#define CACHE_LINE_SHIFT 7
+
+#define CACHE_LINE_SIZE (1 << CACHE_LINE_SHIFT)
+
+#define MAXPAGESIZES 1 /* maximum number of supported page sizes */
+
+#define MACHINE_ARCH "rtems"
+
+#endif /* _RTEMS_BSD_MACHINE_PARAM_H_ */
diff --git a/rtemsbsd/include/machine/rtems-bsd-symbols.h b/rtemsbsd/include/machine/rtems-bsd-symbols.h
index 4c3be853..5ab4a756 100644
--- a/rtemsbsd/include/machine/rtems-bsd-symbols.h
+++ b/rtemsbsd/include/machine/rtems-bsd-symbols.h
@@ -23,7 +23,6 @@
#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_SYMBOLS_H_
#define _RTEMS_BSD_MACHINE_RTEMS_BSD_SYMBOLS_H_
-#define bootverbose _bsd_bootverbose
#define bus_activate_resource _bsd_bus_activate_resource
#define bus_activate_resource _bsd_bus_activate_resource
#define bus_activate_resource_desc _bsd_bus_activate_resource_desc
diff --git a/rtemsbsd/include/machine/rtems-bsd-syscall-api.h b/rtemsbsd/include/machine/rtems-bsd-syscall-api.h
new file mode 100644
index 00000000..7d53606b
--- /dev/null
+++ b/rtemsbsd/include/machine/rtems-bsd-syscall-api.h
@@ -0,0 +1,59 @@
+/**
+ * @file
+ *
+ * @ingroup rtems_bsd_machine
+ *
+ * @brief TODO.
+ *
+ * This file helps to ensure that the system calls match the user space
+ * declaration. The user space declaration is normally not visible to the
+ * kernel space due to the _KERNEL guard.
+ */
+
+/*
+ * Copyright (c) 2013 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_SYSCALL_API_H_
+#define _RTEMS_BSD_MACHINE_RTEMS_BSD_SYSCALL_API_H_
+
+#include <sys/cdefs.h>
+#include <sys/select.h>
+
+__BEGIN_DECLS
+
+int pselect(int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict,
+ const struct timespec *__restrict, const sigset_t *__restrict);
+
+int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
+
+__END_DECLS
+
+#endif /* _RTEMS_BSD_MACHINE_RTEMS_BSD_SYSCALL_API_H_ */
diff --git a/rtemsbsd/include/machine/rtems-bsd-sysinit.h b/rtemsbsd/include/machine/rtems-bsd-sysinit.h
index 0e31d3ec..6242d790 100644
--- a/rtemsbsd/include/machine/rtems-bsd-sysinit.h
+++ b/rtemsbsd/include/machine/rtems-bsd-sysinit.h
@@ -23,9 +23,9 @@
#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_SYSINIT_H_
#define _RTEMS_BSD_MACHINE_RTEMS_BSD_SYSINIT_H_
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/kernel.h>
+#include <sys/cdefs.h>
+#include <sys/queue.h>
+#include <sys/kernel.h>
#define SYSINIT_NEED_FREEBSD_CORE \
SYSINIT_REFERENCE(configure1); \
diff --git a/rtemsbsd/include/machine/smp.h b/rtemsbsd/include/machine/smp.h
index 936ffd88..e69de29b 100644
--- a/rtemsbsd/include/machine/smp.h
+++ b/rtemsbsd/include/machine/smp.h
@@ -1 +0,0 @@
-/* EMPTY */
diff --git a/rtemsbsd/include/machine/vm.h b/rtemsbsd/include/machine/vm.h
index 936ffd88..e69de29b 100644
--- a/rtemsbsd/include/machine/vm.h
+++ b/rtemsbsd/include/machine/vm.h
@@ -1 +0,0 @@
-/* EMPTY */
diff --git a/rtemsbsd/include/poll.h b/rtemsbsd/include/poll.h
index 48572ee4..06fb41ab 100644
--- a/rtemsbsd/include/poll.h
+++ b/rtemsbsd/include/poll.h
@@ -1,2 +1 @@
-#include <freebsd/bsd.h>
-#include <freebsd/sys/poll.h>
+#include <sys/poll.h>
diff --git a/freebsd/machine/sf_buf.h b/rtemsbsd/include/pthread_np.h
index 936ffd88..936ffd88 100644
--- a/freebsd/machine/sf_buf.h
+++ b/rtemsbsd/include/pthread_np.h
diff --git a/rtemsbsd/include/rtems/bsd/bsd.h b/rtemsbsd/include/rtems/bsd/bsd.h
index 6eafb4e5..d7348420 100644
--- a/rtemsbsd/include/rtems/bsd/bsd.h
+++ b/rtemsbsd/include/rtems/bsd/bsd.h
@@ -7,29 +7,44 @@
*/
/*
- * Copyright (c) 2009, 2010 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2009-2013 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
- * Obere Lagerstr. 30
+ * Dornierstr. 4
* 82178 Puchheim
* Germany
* <rtems@embedded-brains.de>
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
*/
-#ifndef _RTEMS_BSD_BSD_HH_
-#define _RTEMS_BSD_BSD_HH_
+#ifndef _RTEMS_BSD_BSD_H_
+#define _RTEMS_BSD_BSD_H_
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
-#include <freebsd/machine/rtems-bsd-config.h>
-#include <freebsd/machine/rtems-bsd-select.h>
-#include <freebsd/machine/_align.h>
+#include <rtems.h>
rtems_status_code rtems_bsd_initialize(void);
@@ -41,4 +56,4 @@ void rtems_bsd_shell_initialize(void);
}
#endif /* __cplusplus */
-#endif /* _RTEMS_BSD_BSD_HH_ */
+#endif /* _RTEMS_BSD_BSD_H_ */
diff --git a/rtemsbsd/include/rtems/bsd/local/vnode_if.h b/rtemsbsd/include/rtems/bsd/local/vnode_if.h
index c90e6c8e..367a8db7 100644
--- a/rtemsbsd/include/rtems/bsd/local/vnode_if.h
+++ b/rtemsbsd/include/rtems/bsd/local/vnode_if.h
@@ -6,8 +6,8 @@
*/
extern struct vnodeop_desc vop_default_desc;
-#include <freebsd/local/vnode_if_typedef.h>
-#include <freebsd/local/vnode_if_newproto.h>
+#include <rtems/bsd/local/vnode_if_typedef.h>
+#include <rtems/bsd/local/vnode_if_newproto.h>
struct vop_islocked_args {
struct vop_generic_args a_gen;
struct vnode *a_vp;
diff --git a/rtemsbsd/include/rtems/bsd/sys/_types.h b/rtemsbsd/include/rtems/bsd/sys/_types.h
index b9f4d392..e9acaf4e 100644
--- a/rtemsbsd/include/rtems/bsd/sys/_types.h
+++ b/rtemsbsd/include/rtems/bsd/sys/_types.h
@@ -26,11 +26,12 @@
* $FreeBSD$
*/
-#ifndef _SYS__TYPES_HH_
-#define _SYS__TYPES_HH_
+#ifndef _RTEMS_BSD_SYS__TYPES_H_
+#define _RTEMS_BSD_SYS__TYPES_H_
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/machine/_types.h>
+#include <sys/cdefs.h>
+#ifndef __rtems__
+#include <machine/_types.h>
/*
* Standard type definitions.
@@ -101,5 +102,110 @@ typedef union {
char __mbstate8[128];
__int64_t _mbstateL; /* for alignment */
} __mbstate_t;
+#else /* __rtems__ */
+#include <sys/types.h>
-#endif /* !_SYS__TYPES_HH_ */
+#ifdef __BSD_VISIBLE
+
+#include <machine/rtems-bsd-endian.h>
+#include <stdarg.h>
+
+#define _INT8_T_DECLARED
+#define _UINT8_T_DECLARED
+
+#define _INT16_T_DECLARED
+#define _UINT16_T_DECLARED
+
+#define _INT32_T_DECLARED
+#define _UINT32_T_DECLARED
+
+#define _INT64_T_DECLARED
+#define _UINT64_T_DECLARED
+
+#define _INTPTR_T_DECLARED
+
+#ifdef _KERNEL
+
+typedef int boolean_t;
+
+typedef struct device *device_t;
+
+typedef intptr_t intfptr_t;
+typedef uintptr_t uintfptr_t;
+
+typedef uint32_t intrmask_t;
+
+typedef char vm_memattr_t;
+
+#endif /* _KERNEL */
+
+typedef int accmode_t;
+#define _ACCMODE_T_DECLARED
+
+typedef const char *c_caddr_t;
+
+typedef uint32_t cpumask_t;
+
+typedef int cpusetid_t;
+
+#define _DEV_T_DECLARED
+
+typedef uint32_t __fixpt_t;
+typedef __fixpt_t fixpt_t;
+
+#define _GID_T_DECLARED
+
+typedef uint32_t in_addr_t;
+#define _IN_ADDR_T_DECLARED
+
+typedef uint16_t in_port_t;
+#define _IN_PORT_T_DECLARED
+
+#define _MODE_T_DECLARED
+
+typedef _off_t __off_t;
+#define _OFF_T_DECLARED
+
+#define _PID_T_DECLARED
+
+typedef int register_t;
+typedef unsigned int u_register_t;
+
+typedef intptr_t segsz_t;
+
+#undef __size_t
+typedef size_t __size_t;
+#define _SIZE_T_DECLARED
+
+#define __ssize_t ssize_t
+#define _SSIZE_T_DECLARED
+
+#define _UID_T_DECLARED
+
+#define __va_list va_list
+
+typedef uintptr_t vm_offset_t;
+typedef uint64_t vm_ooffset_t;
+typedef uintptr_t vm_paddr_t;
+typedef uint64_t vm_pindex_t;
+typedef uintptr_t vm_size_t;
+
+typedef int lwpid_t;
+#define _LWPID_T_DECLARED
+
+typedef int64_t rlim_t;
+#define _RLIM_T_DECLARED
+
+typedef uint8_t sa_family_t;
+#define _SA_FAMILY_T_DECLARED
+
+typedef uint32_t socklen_t;
+#define _SOCKLEN_T_DECLARED
+
+#define SIZE_T_MAX SIZE_MAX
+
+#endif /* __BSD_VISIBLE */
+
+#endif /* __rtems__ */
+
+#endif /* !_RTEMS_BSD_SYS__TYPES_H_ */
diff --git a/rtemsbsd/include/rtems/bsd/sys/errno.h b/rtemsbsd/include/rtems/bsd/sys/errno.h
index 9b68014d..2ed71acc 100644
--- a/rtemsbsd/include/rtems/bsd/sys/errno.h
+++ b/rtemsbsd/include/rtems/bsd/sys/errno.h
@@ -35,11 +35,11 @@
* $FreeBSD$
*/
-#ifndef _SYS_ERRNO_HH_
-#define _SYS_ERRNO_HH_
+#ifndef _RTEMS_BSD_SYS_ERRNO_H_
+#define _RTEMS_BSD_SYS_ERRNO_H_
#ifndef _KERNEL
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__BEGIN_DECLS
int * __error(void);
__END_DECLS
@@ -181,6 +181,8 @@ __END_DECLS
#ifndef _POSIX_SOURCE
#define ELAST 93 /* Must be equal largest errno */
#endif /* _POSIX_SOURCE */
+#else /* __rtems__ */
+#include <errno.h>
#endif /* __rtems__ */
#ifdef _KERNEL
diff --git a/rtemsbsd/include/rtems/bsd/sys/lock.h b/rtemsbsd/include/rtems/bsd/sys/lock.h
index f86ec765..f252976c 100644
--- a/rtemsbsd/include/rtems/bsd/sys/lock.h
+++ b/rtemsbsd/include/rtems/bsd/sys/lock.h
@@ -29,11 +29,11 @@
* $FreeBSD$
*/
-#ifndef _SYS_LOCK_HH_
-#define _SYS_LOCK_HH_
+#ifndef _RTEMS_BSD_SYS_LOCK_H_
+#define _RTEMS_BSD_SYS_LOCK_H_
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/_lock.h>
+#include <sys/queue.h>
+#include <sys/_lock.h>
struct lock_list_entry;
struct thread;
@@ -316,4 +316,4 @@ void witness_thread_exit(struct thread *);
WITNESS_CHECKORDER(&(l)->lock_object, 0, LOCK_FILE, LOCK_LINE, NULL)
#endif /* _KERNEL */
-#endif /* _SYS_LOCK_HH_ */
+#endif /* _RTEMS_BSD_SYS_LOCK_H_ */
diff --git a/rtemsbsd/include/rtems/bsd/sys/param.h b/rtemsbsd/include/rtems/bsd/sys/param.h
index cd00ea4c..93e2ef44 100644
--- a/rtemsbsd/include/rtems/bsd/sys/param.h
+++ b/rtemsbsd/include/rtems/bsd/sys/param.h
@@ -35,10 +35,13 @@
* $FreeBSD$
*/
-#ifndef _SYS_PARAM_HH_
-#define _SYS_PARAM_HH_
+#ifndef _RTEMS_BSD_SYS_PARAM_H_
+#define _RTEMS_BSD_SYS_PARAM_H_
-#include <freebsd/sys/_null.h>
+#ifdef __rtems__
+#include <sys/param.h>
+#endif /* __rtems__ */
+#include <sys/_null.h>
#define BSD 199506 /* System version (year & month). */
#define BSD4_3 1
@@ -66,7 +69,7 @@
#endif
#ifndef LOCORE
-#include <freebsd/sys/types.h>
+#include <rtems/bsd/sys/types.h>
#endif
/*
@@ -76,11 +79,11 @@
* MAXCOMLEN should be >= sizeof(ac_comm) (see <acct.h>)
* MAXLOGNAME should be == UT_NAMESIZE+1 (see <utmp.h>)
*/
-#include <freebsd/sys/syslimits.h>
+#include <sys/syslimits.h>
#define MAXCOMLEN 19 /* max command name remembered */
-#define MAXINTERP 32 /* max interpreter file name length */
-#define MAXLOGNAME 17 /* max login name length (incl. NUL) */
+#define MAXINTERP PATH_MAX /* max interpreter file name length */
+#define MAXLOGNAME 33 /* max login name length (incl. NUL) */
#define MAXUPRC CHILD_MAX /* max simultaneous processes */
#define NCARGS ARG_MAX /* max bytes for an exec function */
#define NGROUPS (NGROUPS_MAX+1) /* max number groups */
@@ -91,11 +94,11 @@
/* More types and definitions used throughout the kernel. */
#ifdef _KERNEL
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/errno.h>
+#include <sys/cdefs.h>
+#include <rtems/bsd/sys/errno.h>
#ifndef LOCORE
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/priority.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/priority.h>
#endif
#ifndef FALSE
@@ -108,13 +111,13 @@
#ifndef _KERNEL
/* Signals. */
-#include <freebsd/sys/signal.h>
+#include <sys/signal.h>
#endif
/* Machine type dependent parameters. */
-#include <freebsd/machine/param.h>
+#include <machine/rtems-bsd-param.h>
#ifndef _KERNEL
-#include <freebsd/sys/limits.h>
+#include <sys/limits.h>
#endif
#ifndef _NO_NAMESPACE_POLLUTION
@@ -329,4 +332,4 @@ __END_DECLS
#define member2struct(s, m, x) \
((struct s *)(void *)((char *)(x) - offsetof(struct s, m)))
-#endif /* _SYS_PARAM_HH_ */
+#endif /* _RTEMS_BSD_SYS_PARAM_H_ */
diff --git a/rtemsbsd/include/rtems/bsd/sys/resource.h b/rtemsbsd/include/rtems/bsd/sys/resource.h
index 74a43c34..09f68696 100644
--- a/rtemsbsd/include/rtems/bsd/sys/resource.h
+++ b/rtemsbsd/include/rtems/bsd/sys/resource.h
@@ -30,12 +30,12 @@
* $FreeBSD$
*/
-#ifndef _SYS_RESOURCE_HH_
-#define _SYS_RESOURCE_HH_
+#ifndef _RTEMS_BSD_SYS_RESOURCE_H_
+#define _RTEMS_BSD_SYS_RESOURCE_H_
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/_timeval.h>
-#include <freebsd/sys/_types.h>
+#include <sys/cdefs.h>
+#include <sys/_timeval.h>
+#include <rtems/bsd/sys/_types.h>
/*
* Process priority specifications to get/setpriority.
@@ -56,6 +56,7 @@
#define RUSAGE_SELF 0
#define RUSAGE_CHILDREN -1
+#ifndef __rtems__
#define RUSAGE_THREAD 1
struct rusage {
@@ -78,6 +79,9 @@ struct rusage {
long ru_nivcsw; /* involuntary " */
#define ru_last ru_nivcsw
};
+#else /* __rtems__ */
+#include <sys/resource.h>
+#endif /* __rtems__ */
/*
* Resource limits
@@ -173,4 +177,4 @@ int setrlimit(int, const struct rlimit *);
__END_DECLS
#endif /* _KERNEL */
-#endif /* !_SYS_RESOURCE_HH_ */
+#endif /* !_RTEMS_BSD_SYS_RESOURCE_H_ */
diff --git a/rtemsbsd/include/rtems/bsd/sys/time.h b/rtemsbsd/include/rtems/bsd/sys/time.h
index f34af077..7dea42bd 100644
--- a/rtemsbsd/include/rtems/bsd/sys/time.h
+++ b/rtemsbsd/include/rtems/bsd/sys/time.h
@@ -30,12 +30,15 @@
* $FreeBSD$
*/
-#ifndef _SYS_TIME_HH_
-#define _SYS_TIME_HH_
+#ifndef _RTEMS_BSD_SYS_TIME_H_
+#define _RTEMS_BSD_SYS_TIME_H_
-#include <freebsd/sys/_timeval.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/timespec.h>
+#include <sys/_timeval.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/timespec.h>
+#ifdef __rtems__
+#include <sys/time.h>
+#endif /* __rtems__ */
#ifndef __rtems__
struct timezone {
@@ -320,10 +323,10 @@ void timevaladd(struct timeval *t1, const struct timeval *t2);
void timevalsub(struct timeval *t1, const struct timeval *t2);
int tvtohz(struct timeval *tv);
#else /* !_KERNEL */
-#include <freebsd/time.h>
+#include <time.h>
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/select.h>
+#include <sys/cdefs.h>
+#include <sys/select.h>
__BEGIN_DECLS
int setitimer(int, const struct itimerval *, struct itimerval *);
@@ -348,4 +351,4 @@ __END_DECLS
#endif /* !_KERNEL */
-#endif /* !_SYS_TIME_HH_ */
+#endif /* !_RTEMS_BSD_SYS_TIME_H_ */
diff --git a/rtemsbsd/include/rtems/bsd/sys/timespec.h b/rtemsbsd/include/rtems/bsd/sys/timespec.h
index 4ec4147e..19a4ba3e 100644
--- a/rtemsbsd/include/rtems/bsd/sys/timespec.h
+++ b/rtemsbsd/include/rtems/bsd/sys/timespec.h
@@ -1,10 +1,80 @@
-#define TIMEVAL_TO_TIMESPEC(tv, ts) \
- do { \
- (ts)->tv_sec = (tv)->tv_sec; \
- (ts)->tv_nsec = (tv)->tv_usec * 1000; \
- } while (0)
-#define TIMESPEC_TO_TIMEVAL(tv, ts) \
- do { \
- (tv)->tv_sec = (ts)->tv_sec; \
- (tv)->tv_usec = (ts)->tv_nsec / 1000; \
- } while (0)
+/*-
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)time.h 8.5 (Berkeley) 5/4/95
+ * from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp
+ * $FreeBSD$
+ */
+
+/*
+ * Prerequisites: <sys/cdefs.h>, <sys/_types.h>
+ */
+
+#ifndef _RTEMS_BSD_SYS_TIMESPEC_H_
+#define _RTEMS_BSD_SYS_TIMESPEC_H_
+
+#ifndef __rtems__
+#ifndef _TIME_T_DECLARED
+typedef __time_t time_t;
+#define _TIME_T_DECLARED
+#endif
+
+struct timespec {
+ time_t tv_sec; /* seconds */
+ long tv_nsec; /* and nanoseconds */
+};
+#else /* __rtems__ */
+#include <rtems/bsd/sys/types.h>
+#endif /* __rtems__ */
+
+#if __BSD_VISIBLE
+#define TIMEVAL_TO_TIMESPEC(tv, ts) \
+ do { \
+ (ts)->tv_sec = (tv)->tv_sec; \
+ (ts)->tv_nsec = (tv)->tv_usec * 1000; \
+ } while (0)
+#define TIMESPEC_TO_TIMEVAL(tv, ts) \
+ do { \
+ (tv)->tv_sec = (ts)->tv_sec; \
+ (tv)->tv_usec = (ts)->tv_nsec / 1000; \
+ } while (0)
+
+#endif /* __BSD_VISIBLE */
+
+#ifndef __rtems__
+/*
+ * Structure defined by POSIX.1b to be like a itimerval, but with
+ * timespecs. Used in the timer_*() system calls.
+ */
+struct itimerspec {
+ struct timespec it_interval;
+ struct timespec it_value;
+};
+#endif /* __rtems__ */
+
+#endif /* _RTEMS_BSD_SYS_TIMESPEC_H_ */
diff --git a/rtemsbsd/include/rtems/bsd/sys/types.h b/rtemsbsd/include/rtems/bsd/sys/types.h
index 38ae5c68..a8c47ef3 100644
--- a/rtemsbsd/include/rtems/bsd/sys/types.h
+++ b/rtemsbsd/include/rtems/bsd/sys/types.h
@@ -35,16 +35,17 @@
* $FreeBSD$
*/
-#ifndef _SYS_TYPES_HH_
-#define _SYS_TYPES_HH_
+#ifndef _RTEMS_BSD_SYS_TYPES_H_
+#define _RTEMS_BSD_SYS_TYPES_H_
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
/* Machine type dependent parameters. */
-#include <freebsd/machine/endian.h>
-#include <freebsd/sys/_types.h>
+#include <machine/rtems-bsd-endian.h>
+#include <rtems/bsd/sys/_types.h>
-#include <freebsd/sys/_pthreadtypes.h>
+#ifndef __rtems__
+#include <sys/_pthreadtypes.h>
#if __BSD_VISIBLE
typedef unsigned char u_char;
@@ -318,7 +319,7 @@ typedef struct vm_page *vm_page_t;
*/
#if __BSD_VISIBLE
-#include <freebsd/sys/select.h>
+#include <sys/select.h>
/*
* minor() gives a cookie instead of an index since we don't want to
@@ -356,5 +357,6 @@ __END_DECLS
#endif /* !_KERNEL */
#endif /* __BSD_VISIBLE */
+#endif /* __rtems__ */
-#endif /* !_SYS_TYPES_HH_ */
+#endif /* !_RTEMS_BSD_SYS_TYPES_H_ */
diff --git a/rtemsbsd/include/rtems/bsd/sys/unistd.h b/rtemsbsd/include/rtems/bsd/sys/unistd.h
index 2918d563..5c3208c7 100644
--- a/rtemsbsd/include/rtems/bsd/sys/unistd.h
+++ b/rtemsbsd/include/rtems/bsd/sys/unistd.h
@@ -30,11 +30,12 @@
* $FreeBSD$
*/
-#ifndef _SYS_UNISTD_HH_
-#define _SYS_UNISTD_HH_
+#ifndef _RTEMS_BSD_SYS_UNISTD_H_
+#define _RTEMS_BSD_SYS_UNISTD_H_
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
+#ifndef __rtems__
/*
* POSIX options and option groups we unconditionally do or don't
* implement. Those options which are implemented (or not) entirely
@@ -158,6 +159,9 @@
/* From OpenSolaris, used by SEEK_DATA/SEEK_HOLE. */
#define _PC_MIN_HOLE_SIZE 21
+#else /* __rtems__ */
+#include <unistd.h>
+#endif /* __rtems__ */
#if __BSD_VISIBLE
/*
@@ -185,4 +189,4 @@
#endif /* __BSD_VISIBLE */
-#endif /* !_SYS_UNISTD_HH_ */
+#endif /* !_RTEMS_BSD_SYS_UNISTD_H_ */
diff --git a/rtemsbsd/include/sys/_pthreadtypes.h b/rtemsbsd/include/sys/_pthreadtypes.h
index fa882cb5..936ffd88 100644
--- a/rtemsbsd/include/sys/_pthreadtypes.h
+++ b/rtemsbsd/include/sys/_pthreadtypes.h
@@ -1 +1 @@
-/* empty file */
+/* EMPTY */
diff --git a/rtemsbsd/include/sys/signalvar.h b/rtemsbsd/include/sys/signalvar.h
index baa28bdd..936ffd88 100644
--- a/rtemsbsd/include/sys/signalvar.h
+++ b/rtemsbsd/include/sys/signalvar.h
@@ -1 +1 @@
-/* deliberately empty file */
+/* EMPTY */
diff --git a/freebsd/sys/_pthreadtypes.h b/rtemsbsd/include/vm/vm_extern.h
index 936ffd88..936ffd88 100644
--- a/freebsd/sys/_pthreadtypes.h
+++ b/rtemsbsd/include/vm/vm_extern.h
diff --git a/freebsd/sys/sched.h b/rtemsbsd/include/vm/vm_kern.h
index 936ffd88..936ffd88 100644
--- a/freebsd/sys/sched.h
+++ b/rtemsbsd/include/vm/vm_kern.h
diff --git a/freebsd/sys/select.h b/rtemsbsd/include/vm/vm_object.h
index 936ffd88..936ffd88 100644
--- a/freebsd/sys/select.h
+++ b/rtemsbsd/include/vm/vm_object.h
diff --git a/freebsd/sys/stat.h b/rtemsbsd/include/vm/vm_page.h
index 936ffd88..936ffd88 100644
--- a/freebsd/sys/stat.h
+++ b/rtemsbsd/include/vm/vm_page.h
diff --git a/rtemsbsd/lm32/include/freebsd/machine/cpufunc.h b/rtemsbsd/lm32/include/freebsd/machine/cpufunc.h
deleted file mode 100644
index fa882cb5..00000000
--- a/rtemsbsd/lm32/include/freebsd/machine/cpufunc.h
+++ /dev/null
@@ -1 +0,0 @@
-/* empty file */
diff --git a/rtemsbsd/local/bus_if.c b/rtemsbsd/local/bus_if.c
index 10f9ef46..77a982b8 100644
--- a/rtemsbsd/local/bus_if.c
+++ b/rtemsbsd/local/bus_if.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* This file is produced automatically.
@@ -12,14 +12,14 @@
* See the source file for legal information
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/kobj.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/local/bus_if.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <sys/kernel.h>
+#include <sys/kobj.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <rtems/bsd/local/bus_if.h>
static struct resource *
diff --git a/rtemsbsd/local/cryptodev_if.c b/rtemsbsd/local/cryptodev_if.c
index d4875e46..6b252130 100644
--- a/rtemsbsd/local/cryptodev_if.c
+++ b/rtemsbsd/local/cryptodev_if.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* This file is produced automatically.
@@ -12,13 +12,13 @@
* See the source file for legal information
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/kobj.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/opencrypto/cryptodev.h>
-#include <freebsd/local/cryptodev_if.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <sys/kernel.h>
+#include <sys/kobj.h>
+#include <sys/malloc.h>
+#include <opencrypto/cryptodev.h>
+#include <rtems/bsd/local/cryptodev_if.h>
struct kobj_method cryptodev_newsession_method_default = {
&cryptodev_newsession_desc, (kobjop_t) kobj_error_method
diff --git a/rtemsbsd/local/device_if.c b/rtemsbsd/local/device_if.c
index e6f3189a..ba29ef4a 100644
--- a/rtemsbsd/local/device_if.c
+++ b/rtemsbsd/local/device_if.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* This file is produced automatically.
@@ -12,12 +12,12 @@
* See the source file for legal information
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/kobj.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/local/device_if.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <sys/kernel.h>
+#include <sys/kobj.h>
+#include <sys/bus.h>
+#include <rtems/bsd/local/device_if.h>
static int null_shutdown(device_t dev)
diff --git a/rtemsbsd/local/miibus_if.c b/rtemsbsd/local/miibus_if.c
index 2f5127e8..6fbdd911 100644
--- a/rtemsbsd/local/miibus_if.c
+++ b/rtemsbsd/local/miibus_if.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* This file is produced automatically.
@@ -12,12 +12,12 @@
* See the source file for legal information
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/kobj.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/local/miibus_if.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <sys/kernel.h>
+#include <sys/kobj.h>
+#include <sys/bus.h>
+#include <rtems/bsd/local/miibus_if.h>
struct kobj_method miibus_readreg_method_default = {
&miibus_readreg_desc, (kobjop_t) kobj_error_method
diff --git a/rtemsbsd/local/pci_if.c b/rtemsbsd/local/pci_if.c
index 257e890b..7a939f6a 100644
--- a/rtemsbsd/local/pci_if.c
+++ b/rtemsbsd/local/pci_if.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* This file is produced automatically.
@@ -12,12 +12,12 @@
* See the source file for legal information
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/kobj.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/local/pci_if.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <sys/kernel.h>
+#include <sys/kobj.h>
+#include <sys/bus.h>
+#include <rtems/bsd/local/pci_if.h>
static int
diff --git a/rtemsbsd/local/pcib_if.c b/rtemsbsd/local/pcib_if.c
index cc460893..bdb60e44 100644
--- a/rtemsbsd/local/pcib_if.c
+++ b/rtemsbsd/local/pcib_if.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* This file is produced automatically.
@@ -12,13 +12,13 @@
* See the source file for legal information
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/kobj.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/dev/pci/pcivar.h>
-#include <freebsd/local/pcib_if.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <sys/kernel.h>
+#include <sys/kobj.h>
+#include <sys/bus.h>
+#include <dev/pci/pcivar.h>
+#include <rtems/bsd/local/pcib_if.h>
static int
diff --git a/rtemsbsd/local/usb_if.c b/rtemsbsd/local/usb_if.c
index db9b2670..766b1243 100644
--- a/rtemsbsd/local/usb_if.c
+++ b/rtemsbsd/local/usb_if.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* This file is produced automatically.
@@ -12,12 +12,12 @@
* See the source file for legal information
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/kobj.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/local/usb_if.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <sys/kernel.h>
+#include <sys/kobj.h>
+#include <sys/bus.h>
+#include <rtems/bsd/local/usb_if.h>
struct kobj_method usb_handle_request_method_default = {
&usb_handle_request_desc, (kobjop_t) kobj_error_method
diff --git a/rtemsbsd/m32c/include/freebsd/machine/cpufunc.h b/rtemsbsd/m32c/include/freebsd/machine/cpufunc.h
deleted file mode 100644
index fa882cb5..00000000
--- a/rtemsbsd/m32c/include/freebsd/machine/cpufunc.h
+++ /dev/null
@@ -1 +0,0 @@
-/* empty file */
diff --git a/rtemsbsd/m32r/include/freebsd/machine/cpufunc.h b/rtemsbsd/m32r/include/freebsd/machine/cpufunc.h
deleted file mode 100644
index fa882cb5..00000000
--- a/rtemsbsd/m32r/include/freebsd/machine/cpufunc.h
+++ /dev/null
@@ -1 +0,0 @@
-/* empty file */
diff --git a/rtemsbsd/m68k/include/freebsd/machine/cpufunc.h b/rtemsbsd/m68k/include/freebsd/machine/cpufunc.h
deleted file mode 100644
index fa882cb5..00000000
--- a/rtemsbsd/m68k/include/freebsd/machine/cpufunc.h
+++ /dev/null
@@ -1 +0,0 @@
-/* empty file */
diff --git a/rtemsbsd/nios2/include/freebsd/machine/cpufunc.h b/rtemsbsd/nios2/include/freebsd/machine/cpufunc.h
deleted file mode 100644
index fa882cb5..00000000
--- a/rtemsbsd/nios2/include/freebsd/machine/cpufunc.h
+++ /dev/null
@@ -1 +0,0 @@
-/* empty file */
diff --git a/rtemsbsd/rtems/ipsec_get_policylen.c b/rtemsbsd/rtems/ipsec_get_policylen.c
index 160c5e52..c5d910ad 100644
--- a/rtemsbsd/rtems/ipsec_get_policylen.c
+++ b/rtemsbsd/rtems/ipsec_get_policylen.c
@@ -1,6 +1,6 @@
-#include <sys/types.h>
-#include <sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
#include <netipsec/ipsec.h>
diff --git a/rtemsbsd/rtems/kvm_private.h b/rtemsbsd/rtems/kvm_private.h
index 7655511a..5b9c9b04 100644
--- a/rtemsbsd/rtems/kvm_private.h
+++ b/rtemsbsd/rtems/kvm_private.h
@@ -8,6 +8,6 @@ typedef struct {
uintptr_t value;
} kvm_symval_t;
-kvm_symval_t rtems_kvm_symbols[];
+extern kvm_symval_t rtems_kvm_symbols[];
#endif
diff --git a/rtemsbsd/rtems/rtems-bsd-assert.c b/rtemsbsd/rtems/rtems-bsd-assert.c
index 2228fe8d..410f1026 100644
--- a/rtemsbsd/rtems/rtems-bsd-assert.c
+++ b/rtemsbsd/rtems/rtems-bsd-assert.c
@@ -38,10 +38,10 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
void
rtems_bsd_assert_func(const char *file, int line, const char *func, const char *expr)
diff --git a/rtemsbsd/rtems/rtems-bsd-autoconf.c b/rtemsbsd/rtems/rtems-bsd-autoconf.c
index 94cf5355..5febcbcc 100644
--- a/rtemsbsd/rtems/rtems-bsd-autoconf.c
+++ b/rtemsbsd/rtems/rtems-bsd-autoconf.c
@@ -38,13 +38,13 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/kernel.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
static void
configure_first(void *dummy)
diff --git a/rtemsbsd/rtems/rtems-bsd-bus-dma-mbuf.c b/rtemsbsd/rtems/rtems-bsd-bus-dma-mbuf.c
index 97e0149b..9056b489 100644
--- a/rtemsbsd/rtems/rtems-bsd-bus-dma-mbuf.c
+++ b/rtemsbsd/rtems/rtems-bsd-bus-dma-mbuf.c
@@ -43,10 +43,10 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
-#include <freebsd/machine/rtems-bsd-bus-dma.h>
+#include <machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-bus-dma.h>
-#include <freebsd/sys/mbuf.h>
+#include <sys/mbuf.h>
/*
* Like bus_dmamap_load(), but for mbufs.
diff --git a/rtemsbsd/rtems/rtems-bsd-bus-dma.c b/rtemsbsd/rtems/rtems-bsd-bus-dma.c
index e186e8ba..34f46eed 100644
--- a/rtemsbsd/rtems/rtems-bsd-bus-dma.c
+++ b/rtemsbsd/rtems/rtems-bsd-bus-dma.c
@@ -45,14 +45,14 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
-#include <freebsd/machine/rtems-bsd-cache.h>
-#include <freebsd/machine/rtems-bsd-bus-dma.h>
+#include <machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-cache.h>
+#include <machine/rtems-bsd-bus-dma.h>
#include <rtems/malloc.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/machine/atomic.h>
+#include <sys/malloc.h>
+#include <machine/atomic.h>
#ifdef CPU_DATA_CACHE_ALIGNMENT
#define CLSZ ((uintptr_t) CPU_DATA_CACHE_ALIGNMENT)
diff --git a/rtemsbsd/rtems/rtems-bsd-cam.c b/rtemsbsd/rtems/rtems-bsd-cam.c
index 1f039412..baad15f2 100644
--- a/rtemsbsd/rtems/rtems-bsd-cam.c
+++ b/rtemsbsd/rtems/rtems-bsd-cam.c
@@ -38,24 +38,24 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-
-#include <freebsd/cam/cam.h>
-#include <freebsd/cam/cam_ccb.h>
-#include <freebsd/cam/cam_sim.h>
-#include <freebsd/cam/cam_xpt.h>
-#include <freebsd/cam/cam_xpt_sim.h>
-#include <freebsd/cam/cam_debug.h>
-
-#include <freebsd/cam/scsi/scsi_all.h>
+#include <machine/rtems-bsd-config.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+
+#include <cam/cam.h>
+#include <cam/cam_ccb.h>
+#include <cam/cam_sim.h>
+#include <cam/cam_xpt.h>
+#include <cam/cam_xpt_sim.h>
+#include <cam/cam_debug.h>
+
+#include <cam/scsi/scsi_all.h>
#include <rtems/media.h>
#include <rtems/libio.h>
diff --git a/rtemsbsd/rtems/rtems-bsd-condvar.c b/rtemsbsd/rtems/rtems-bsd-condvar.c
index cb97174d..f5022191 100644
--- a/rtemsbsd/rtems/rtems-bsd-condvar.c
+++ b/rtemsbsd/rtems/rtems-bsd-condvar.c
@@ -37,19 +37,19 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <rtems/score/objectimpl.h>
#include <rtems/score/threaddispatch.h>
#include <rtems/score/threadqimpl.h>
#include <rtems/posix/condimpl.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
RTEMS_CHAIN_DEFINE_EMPTY(rtems_bsd_condvar_chain);
diff --git a/rtemsbsd/rtems/rtems-bsd-conf.c b/rtemsbsd/rtems/rtems-bsd-conf.c
index cfe8e823..bb1666c2 100644
--- a/rtemsbsd/rtems/rtems-bsd-conf.c
+++ b/rtemsbsd/rtems/rtems-bsd-conf.c
@@ -33,14 +33,14 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <stdio.h>
#include <rtems.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/conf.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/conf.h>
struct cdev *
make_dev(struct cdevsw *devsw, int unit, uid_t uid, gid_t gid, int mode,
diff --git a/rtemsbsd/rtems/rtems-bsd-copyinout.c b/rtemsbsd/rtems/rtems-bsd-copyinout.c
index 334de961..3d3707a5 100644
--- a/rtemsbsd/rtems/rtems-bsd-copyinout.c
+++ b/rtemsbsd/rtems/rtems-bsd-copyinout.c
@@ -33,7 +33,7 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <string.h>
#include <stdio.h>
diff --git a/rtemsbsd/rtems/rtems-bsd-delay.c b/rtemsbsd/rtems/rtems-bsd-delay.c
index e7fe9ae9..9eb34c40 100644
--- a/rtemsbsd/rtems/rtems-bsd-delay.c
+++ b/rtemsbsd/rtems/rtems-bsd-delay.c
@@ -38,12 +38,12 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
void
DELAY(int usec)
diff --git a/rtemsbsd/rtems/rtems-bsd-descrip.c b/rtemsbsd/rtems/rtems-bsd-descrip.c
index 72539987..d0d7944e 100644
--- a/rtemsbsd/rtems/rtems-bsd-descrip.c
+++ b/rtemsbsd/rtems/rtems-bsd-descrip.c
@@ -32,27 +32,27 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
-#include <freebsd/sys/conf.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/fcntl.h>
-#include <freebsd/sys/file.h>
-#include <freebsd/sys/filedesc.h>
-#include <freebsd/sys/filio.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/limits.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mount.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/namei.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
+#include <sys/conf.h>
+#include <sys/domain.h>
+#include <sys/fcntl.h>
+#include <sys/file.h>
+#include <sys/filedesc.h>
+#include <sys/filio.h>
+#include <sys/jail.h>
+#include <sys/kernel.h>
+#include <sys/limits.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mount.h>
+#include <sys/mutex.h>
+#include <sys/namei.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
/*
* This routine is not supported in the RTEMS interface
diff --git a/rtemsbsd/rtems/rtems-bsd-generic.c b/rtemsbsd/rtems/rtems-bsd-generic.c
index 4b32f6df..b7d7e110 100644
--- a/rtemsbsd/rtems/rtems-bsd-generic.c
+++ b/rtemsbsd/rtems/rtems-bsd-generic.c
@@ -37,21 +37,21 @@
* SUCH DAMAGE.
*/
-#include <sys/types.h> //needed for fd_mask and such
-#include <freebsd/machine/rtems-bsd-config.h>
-
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/selinfo.h>
-#include <freebsd/sys/fcntl.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/select.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/malloc.h>
+#include <rtems/bsd/sys/types.h> //needed for fd_mask and such
+#include <machine/rtems-bsd-config.h>
+
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/selinfo.h>
+#include <sys/fcntl.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/protosw.h>
+#include <sys/select.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/malloc.h>
void selrecord(struct thread *selector, struct selinfo *sip)
{
diff --git a/rtemsbsd/rtems/rtems-bsd-init-with-irq.c b/rtemsbsd/rtems/rtems-bsd-init-with-irq.c
index c1917e6b..a663fe34 100644
--- a/rtemsbsd/rtems/rtems-bsd-init-with-irq.c
+++ b/rtemsbsd/rtems/rtems-bsd-init-with-irq.c
@@ -37,11 +37,11 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <rtems/irq-extension.h>
-#include <freebsd/bsd.h>
+#include <rtems/bsd/bsd.h>
rtems_status_code
rtems_bsd_initialize_with_interrupt_server(void)
diff --git a/rtemsbsd/rtems/rtems-bsd-init.c b/rtemsbsd/rtems/rtems-bsd-init.c
index 429f0649..22cb1440 100644
--- a/rtemsbsd/rtems/rtems-bsd-init.c
+++ b/rtemsbsd/rtems/rtems-bsd-init.c
@@ -37,17 +37,17 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/proc.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/proc.h>
-#include <freebsd/bsd.h>
+#include <rtems/bsd/bsd.h>
/* In FreeBSD this is a local function */
void mi_startup(void);
diff --git a/rtemsbsd/rtems/rtems-bsd-jail.c b/rtemsbsd/rtems/rtems-bsd-jail.c
index 6294e98c..d6e0c345 100644
--- a/rtemsbsd/rtems/rtems-bsd-jail.c
+++ b/rtemsbsd/rtems/rtems-bsd-jail.c
@@ -37,38 +37,38 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-/*#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>*/
+/*#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/jail.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/sysproto.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/osd.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/taskqueue.h>
-#include <freebsd/sys/fcntl.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/sysent.h>
-#include <freebsd/sys/namei.h>
-#include <freebsd/sys/mount.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/syscallsubr.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/sysproto.h>
+#include <sys/malloc.h>
+#include <sys/osd.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/taskqueue.h>
+#include <sys/fcntl.h>
+#include <sys/jail.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/sx.h>
+#include <sys/sysent.h>
+#include <sys/namei.h>
+#include <sys/mount.h>
+#include <sys/queue.h>
+#include <sys/socket.h>
+#include <sys/syscallsubr.h>
+#include <sys/sysctl.h>
#define DEFAULT_HOSTUUID "00000000-0000-0000-0000-000000000000"
diff --git a/rtemsbsd/rtems/rtems-bsd-lock.c b/rtemsbsd/rtems/rtems-bsd-lock.c
index 6af64ea0..fbcc6710 100644
--- a/rtemsbsd/rtems/rtems-bsd-lock.c
+++ b/rtemsbsd/rtems/rtems-bsd-lock.c
@@ -40,17 +40,17 @@
/* Necessary to obtain some internal functions */
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/ktr.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/proc.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/ktr.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/sx.h>
+#include <sys/rwlock.h>
+#include <sys/proc.h>
struct lock_class *lock_classes[LOCK_CLASS_MAX + 1] = {
&lock_class_mtx_spin,
diff --git a/rtemsbsd/rtems/rtems-bsd-log.c b/rtemsbsd/rtems/rtems-bsd-log.c
index 05d94e89..fee0b1cc 100644
--- a/rtemsbsd/rtems/rtems-bsd-log.c
+++ b/rtemsbsd/rtems/rtems-bsd-log.c
@@ -32,10 +32,10 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
/*
* Log writes to the log buffer, and guarantees not to sleep (so can be
diff --git a/rtemsbsd/rtems/rtems-bsd-malloc.c b/rtemsbsd/rtems/rtems-bsd-malloc.c
index 244f6a66..f5484712 100644
--- a/rtemsbsd/rtems/rtems-bsd-malloc.c
+++ b/rtemsbsd/rtems/rtems-bsd-malloc.c
@@ -37,13 +37,13 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
MALLOC_DEFINE(M_DEVBUF, "devbuf", "device driver memory");
diff --git a/rtemsbsd/rtems/rtems-bsd-mutex.c b/rtemsbsd/rtems/rtems-bsd-mutex.c
index 23249148..bc364191 100644
--- a/rtemsbsd/rtems/rtems-bsd-mutex.c
+++ b/rtemsbsd/rtems/rtems-bsd-mutex.c
@@ -37,18 +37,18 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <rtems/score/objectimpl.h>
#include <rtems/rtems/attrimpl.h>
#include <rtems/rtems/semimpl.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/proc.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/proc.h>
static void assert_mtx(struct lock_object *lock, int what);
static void lock_mtx(struct lock_object *lock, int how);
diff --git a/rtemsbsd/rtems/rtems-bsd-nexus.c b/rtemsbsd/rtems/rtems-bsd-nexus.c
index ba85c05d..1c2ef7a3 100644
--- a/rtemsbsd/rtems/rtems-bsd-nexus.c
+++ b/rtemsbsd/rtems/rtems-bsd-nexus.c
@@ -37,24 +37,24 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
-#include <freebsd/machine/rtems-bsd-sysinit.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/rman.h>
-#include <freebsd/sys/malloc.h>
+#include <machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-sysinit.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/rman.h>
+#include <sys/malloc.h>
#include <bsp.h>
-#include <freebsd/machine/rtems-bsd-devicet.h>
+#include <machine/rtems-bsd-devicet.h>
#include <bsp/irq.h>
#include <rtems/irq.h>
#include <rtems/irq-extension.h>
-#include <freebsd/machine/bus.h>
+#include <machine/bus.h>
/* XXX Note: These defines should be moved. */
#if defined(__i386__)
@@ -180,9 +180,10 @@ nexus_attach(device_t dev)
static int
nexus_probe(device_t dev)
{
- size_t unit = 0;
#if 0
/* FIXME */
+ size_t unit = 0;
+
for (unit = 0; _bsd_nexus_devices [unit] != NULL; ++unit) {
device_add_child(dev, _bsd_nexus_devices [unit], unit);
}
@@ -353,9 +354,6 @@ nexus_release_resource(device_t bus, device_t child, int type, int rid,
return (rman_release_resource(r));
}
-static void noop(const rtems_irq_connect_data *unused) {};
-static int noop1(const rtems_irq_connect_data *unused) { return 0;};
-
static int
bspExtInstallSharedISR(int irqLine, void (*isr)(void *), void * uarg, int flags)
{
diff --git a/rtemsbsd/rtems/rtems-bsd-page.c b/rtemsbsd/rtems/rtems-bsd-page.c
index 2a807178..250c8fb0 100644
--- a/rtemsbsd/rtems/rtems-bsd-page.c
+++ b/rtemsbsd/rtems/rtems-bsd-page.c
@@ -37,11 +37,11 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
#include <rtems/chain.h>
diff --git a/rtemsbsd/rtems/rtems-bsd-panic.c b/rtemsbsd/rtems/rtems-bsd-panic.c
index e4361110..6b1d8507 100644
--- a/rtemsbsd/rtems/rtems-bsd-panic.c
+++ b/rtemsbsd/rtems/rtems-bsd-panic.c
@@ -37,15 +37,15 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/proc.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/proc.h>
static void
suspend_all_threads(void)
diff --git a/rtemsbsd/rtems/rtems-bsd-pci_bus.c b/rtemsbsd/rtems/rtems-bsd-pci_bus.c
new file mode 100644
index 00000000..4ceddfce
--- /dev/null
+++ b/rtemsbsd/rtems/rtems-bsd-pci_bus.c
@@ -0,0 +1,71 @@
+#include <machine/rtems-bsd-config.h>
+
+/**
+ * @file
+ *
+ * @ingroup rtems_bsd_rtems
+ *
+ * @brief This file contains methods that are rtems specific implementation
+ * of methods in pci_bus.c.
+ */
+
+/*
+ * COPYRIGHT (c) 2012. On-Line Applications Research Corporation (OAR).
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/local/opt_cpu.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcib_private.h>
+#include <machine/resource.h>
+
+#include <rtems/bsd/local/pcib_if.h>
+#include <rtems/pci.h>
+#include <machine/bus.h>
+
+int
+pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
+{
+ int bus;
+ int slot;
+ int func;
+ uint8_t irq;
+
+ bus = pci_get_bus(dev);
+ slot = pci_get_slot(dev);
+ func = pci_get_function(dev);
+
+ pci_read_config_byte(bus, slot, func, PCI_INTERRUPT_LINE, &irq);
+ return irq;
+}
diff --git a/rtemsbsd/rtems/rtems-bsd-pci_cfgreg.c b/rtemsbsd/rtems/rtems-bsd-pci_cfgreg.c
index c6d47823..14c9edd0 100644
--- a/rtemsbsd/rtems/rtems-bsd-pci_cfgreg.c
+++ b/rtemsbsd/rtems/rtems-bsd-pci_cfgreg.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/**
* @file
@@ -36,18 +36,18 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/dev/pci/pcivar.h>
-#include <freebsd/dev/pci/pcireg.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/sysctl.h>
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
#include <rtems/pci.h>
diff --git a/rtemsbsd/rtems/rtems-bsd-rwlock.c b/rtemsbsd/rtems/rtems-bsd-rwlock.c
index a38a9a14..50e39997 100644
--- a/rtemsbsd/rtems/rtems-bsd-rwlock.c
+++ b/rtemsbsd/rtems/rtems-bsd-rwlock.c
@@ -37,19 +37,16 @@
* SUCH DAMAGE.
*/
-#include <pthread.h>
-
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <rtems/score/objectimpl.h>
#include <rtems/posix/rwlockimpl.h>
-#include <sys/types.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/rwlock.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/rwlock.h>
#ifndef INVARIANTS
#define _rw_assert(rw, what, file, line)
@@ -234,7 +231,7 @@ _rw_wlock(struct rwlock *rw, const char *file, int line)
{
int iret;
- pthread_rwlock_wrlock( &rw->lock_object.lo_id );
+ iret = pthread_rwlock_wrlock( &rw->lock_object.lo_id );
BSD_ASSERT( iret == 0 );
return 0;
diff --git a/rtemsbsd/rtems/rtems-bsd-shell.c b/rtemsbsd/rtems/rtems-bsd-shell.c
index f80e9371..fba191a0 100644
--- a/rtemsbsd/rtems/rtems-bsd-shell.c
+++ b/rtemsbsd/rtems/rtems-bsd-shell.c
@@ -37,18 +37,18 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/proc.h>
-
-#include <freebsd/bsd.h>
+#include <machine/rtems-bsd-config.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/callout.h>
+#include <sys/condvar.h>
+#include <sys/proc.h>
+
+#include <rtems/bsd/bsd.h>
#include <rtems/shell.h>
static void
diff --git a/rtemsbsd/rtems/rtems-bsd-signal.c b/rtemsbsd/rtems/rtems-bsd-signal.c
index 8ba40693..0c024487 100644
--- a/rtemsbsd/rtems/rtems-bsd-signal.c
+++ b/rtemsbsd/rtems/rtems-bsd-signal.c
@@ -37,11 +37,11 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/signalvar.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/signalvar.h>
void
psignal(struct proc *p, int sig)
diff --git a/rtemsbsd/rtems/rtems-bsd-smp.c b/rtemsbsd/rtems/rtems-bsd-smp.c
index f2a46520..f6cbfc8c 100644
--- a/rtemsbsd/rtems/rtems-bsd-smp.c
+++ b/rtemsbsd/rtems/rtems-bsd-smp.c
@@ -33,13 +33,13 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/types.h>
+#include <rtems/bsd/sys/types.h>
-#include <freebsd/sys/smp.h>
-#include <freebsd/machine/smp.h>
-#include <freebsd/sys/sysctl.h>
+#include <sys/smp.h>
+#include <machine/smp.h>
+#include <sys/sysctl.h>
int mp_ncpus;
int mp_maxcpus;
diff --git a/rtemsbsd/rtems/rtems-bsd-subr_param.c b/rtemsbsd/rtems/rtems-bsd-subr_param.c
index 5bdc63d2..efbd7384 100644
--- a/rtemsbsd/rtems/rtems-bsd-subr_param.c
+++ b/rtemsbsd/rtems/rtems-bsd-subr_param.c
@@ -32,6 +32,6 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
int vm_guest = 0;
diff --git a/rtemsbsd/rtems/rtems-bsd-support.c b/rtemsbsd/rtems/rtems-bsd-support.c
index 8c0ccac7..ed34a10a 100644
--- a/rtemsbsd/rtems/rtems-bsd-support.c
+++ b/rtemsbsd/rtems/rtems-bsd-support.c
@@ -39,14 +39,14 @@
/* FIXME: This file needs careful review. */
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <rtems/score/threaddispatch.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/uio.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/uio.h>
int maxproc = 32; /* XXX Used value of rtems KERN_MAXPROC */
int ngroups_max = NGROUPS_MAX; /* XXX */
diff --git a/rtemsbsd/rtems/rtems-bsd-sx.c b/rtemsbsd/rtems/rtems-bsd-sx.c
index 73df4f6f..5b2bc4da 100644
--- a/rtemsbsd/rtems/rtems-bsd-sx.c
+++ b/rtemsbsd/rtems/rtems-bsd-sx.c
@@ -37,17 +37,17 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <rtems/score/objectimpl.h>
#include <rtems/rtems/attrimpl.h>
#include <rtems/rtems/semimpl.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/sx.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/sx.h>
#ifndef INVARIANTS
#define _sx_assert(sx, what, file, line)
diff --git a/rtemsbsd/rtems/rtems-bsd-synch.c b/rtemsbsd/rtems/rtems-bsd-synch.c
index 40e08e1c..19ab0971 100644
--- a/rtemsbsd/rtems/rtems-bsd-synch.c
+++ b/rtemsbsd/rtems/rtems-bsd-synch.c
@@ -41,22 +41,22 @@
* FIXME: This seems to be a completely broken implementation.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <rtems/score/statesimpl.h>
#include <rtems/score/threaddispatch.h>
#include <rtems/score/thread.h>
#include <rtems/score/threadqimpl.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/ktr.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/machine/pcpu.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/ktr.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/proc.h>
+#include <machine/pcpu.h>
#define STATES_WAITING_FOR_SLEEP 0x40000
diff --git a/rtemsbsd/rtems/rtems-bsd-syscall-api.c b/rtemsbsd/rtems/rtems-bsd-syscall-api.c
new file mode 100644
index 00000000..63274a0e
--- /dev/null
+++ b/rtemsbsd/rtems/rtems-bsd-syscall-api.c
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2013 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <machine/rtems-bsd-syscall-api.h>
diff --git a/rtemsbsd/rtems/rtems-bsd-syscalls.c b/rtemsbsd/rtems/rtems-bsd-syscalls.c
index 821fcc9c..4ae9de44 100644
--- a/rtemsbsd/rtems/rtems-bsd-syscalls.c
+++ b/rtemsbsd/rtems/rtems-bsd-syscalls.c
@@ -37,24 +37,24 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
-
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/fcntl.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/uio.h>
-#include <freebsd/machine/pcpu.h>
-#include <freebsd/net/vnet.h>
+#include <machine/rtems-bsd-config.h>
+
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/malloc.h>
+#include <sys/proc.h>
+#include <sys/fcntl.h>
+#include <sys/protosw.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/uio.h>
+#include <machine/pcpu.h>
+#include <net/vnet.h>
#include <rtems/libio_.h>
#include <rtems/libio.h>
diff --git a/rtemsbsd/rtems/rtems-bsd-sysctl.c b/rtemsbsd/rtems/rtems-bsd-sysctl.c
index 8d3b7570..bd9f31f6 100644
--- a/rtemsbsd/rtems/rtems-bsd-sysctl.c
+++ b/rtemsbsd/rtems/rtems-bsd-sysctl.c
@@ -37,10 +37,11 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/sysctl.h>
+#include <sys/errno.h>
int sysctl(
int *name,
diff --git a/rtemsbsd/rtems/rtems-bsd-sysctlbyname.c b/rtemsbsd/rtems/rtems-bsd-sysctlbyname.c
index 6b7c2018..a0ba592b 100644
--- a/rtemsbsd/rtems/rtems-bsd-sysctlbyname.c
+++ b/rtemsbsd/rtems/rtems-bsd-sysctlbyname.c
@@ -18,13 +18,13 @@
*
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/sysctl.h>
int
sysctlbyname(const char *name, void *oldp, size_t *oldlenp,
diff --git a/rtemsbsd/rtems/rtems-bsd-sysctlnametomib.c b/rtemsbsd/rtems/rtems-bsd-sysctlnametomib.c
index ecd5cbf1..6f65fa5c 100644
--- a/rtemsbsd/rtems/rtems-bsd-sysctlnametomib.c
+++ b/rtemsbsd/rtems/rtems-bsd-sysctlnametomib.c
@@ -34,13 +34,13 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/sysctl.h>
#include <string.h>
/*
diff --git a/rtemsbsd/rtems/rtems-bsd-taskqueue.c b/rtemsbsd/rtems/rtems-bsd-taskqueue.c
index 36bbf235..58959df2 100644
--- a/rtemsbsd/rtems/rtems-bsd-taskqueue.c
+++ b/rtemsbsd/rtems/rtems-bsd-taskqueue.c
@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
#include <rtems.h>
#include <rtems/error.h>
-#include <freebsd/machine/rtems-bsd-taskqueue.h>
+#include <machine/rtems-bsd-taskqueue.h>
/*
#define STATIC static
diff --git a/rtemsbsd/rtems/rtems-bsd-thread.c b/rtemsbsd/rtems/rtems-bsd-thread.c
index ca1ff1f2..357fb45c 100644
--- a/rtemsbsd/rtems/rtems-bsd-thread.c
+++ b/rtemsbsd/rtems/rtems-bsd-thread.c
@@ -37,19 +37,19 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/kthread.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/resourcevar.h>
-#include <freebsd/sys/filedesc.h>
+#include <machine/rtems-bsd-config.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/proc.h>
+#include <sys/kthread.h>
+#include <sys/malloc.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/jail.h>
+#include <sys/resourcevar.h>
+#include <sys/filedesc.h>
RTEMS_CHAIN_DEFINE_EMPTY(rtems_bsd_thread_chain);
diff --git a/rtemsbsd/rtems/rtems-bsd-thread0-ucred.c b/rtemsbsd/rtems/rtems-bsd-thread0-ucred.c
index 4ff61ea4..095e360b 100644
--- a/rtemsbsd/rtems/rtems-bsd-thread0-ucred.c
+++ b/rtemsbsd/rtems/rtems-bsd-thread0-ucred.c
@@ -30,14 +30,15 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/kernel.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/proc.h>
+#include <sys/jail.h>
+#include <sys/kernel.h>
+#include <sys/resourcevar.h>
struct ucred *rtems_bsd_thread0_ucred;
@@ -46,7 +47,6 @@ static void rtems_bsd_thread0_ucred_init(void *arg)
rtems_bsd_thread0_ucred = crget();
rtems_bsd_thread0_ucred->cr_ngroups = 1; /* group 0 */
rtems_bsd_thread0_ucred->cr_uidinfo = uifind(0);
- rtems_bsd_thread0_ucred = uifind(0);
rtems_bsd_thread0_ucred->cr_prison = &prison0;
}
diff --git a/rtemsbsd/rtems/rtems-bsd-timesupport.c b/rtemsbsd/rtems/rtems-bsd-timesupport.c
index 5d730c45..c26c0b07 100644
--- a/rtemsbsd/rtems/rtems-bsd-timesupport.c
+++ b/rtemsbsd/rtems/rtems-bsd-timesupport.c
@@ -37,7 +37,7 @@
* This violation is specifically for _Timespec_To_ticks
*/
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <rtems/score/timespec.h>
diff --git a/rtemsbsd/rtems/rtems-bsd-vm_glue.c b/rtemsbsd/rtems/rtems-bsd-vm_glue.c
index 284f7d60..9bee98e5 100644
--- a/rtemsbsd/rtems/rtems-bsd-vm_glue.c
+++ b/rtemsbsd/rtems/rtems-bsd-vm_glue.c
@@ -32,19 +32,19 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/types.h>
-#include <sys/param.h>
-#include <sys/lock.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/lock.h>
#include <sys/sched.h>
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/kernel.h>
-#include <freebsd/vm/uma.h>
-#include <freebsd/vm/uma_int.h>
-#include <freebsd/sys/systm.h>
+#include <sys/kernel.h>
+#include <vm/uma.h>
+#include <vm/uma_int.h>
+#include <sys/systm.h>
/*
* System initialization
diff --git a/rtemsbsd/rtems/rtems-net-setup.c b/rtemsbsd/rtems/rtems-net-setup.c
index 7774cd26..6f33a08b 100644
--- a/rtemsbsd/rtems/rtems-net-setup.c
+++ b/rtemsbsd/rtems/rtems-net-setup.c
@@ -4,8 +4,9 @@
* XXX integrate using old configuration structure as it makes sense
*/
-#include <freebsd/bsd.h>
#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/errno.h>
#include <net/if.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/rtemsbsd/rtems/rtems-syspoll.c b/rtemsbsd/rtems/rtems-syspoll.c
index d53d14e8..33e05006 100644
--- a/rtemsbsd/rtems/rtems-syspoll.c
+++ b/rtemsbsd/rtems/rtems-syspoll.c
@@ -3,7 +3,7 @@
#include <sys/time.h>
#include <rtems.h>
#include <rtems/error.h>
-#include <freebsd/sys/poll.h>
+#include <sys/poll.h>
struct poll_args {
struct pollfd *fds;
diff --git a/rtemsbsd/rtems/rtems-uthread_kqueue.c b/rtemsbsd/rtems/rtems-uthread_kqueue.c
index 0693412f..268ca658 100644
--- a/rtemsbsd/rtems/rtems-uthread_kqueue.c
+++ b/rtemsbsd/rtems/rtems-uthread_kqueue.c
@@ -1,4 +1,4 @@
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <rtems.h>
diff --git a/rtemsbsd/rtems/syslog.c b/rtemsbsd/rtems/syslog.c
index 10a75a61..f2f20fd0 100644
--- a/rtemsbsd/rtems/syslog.c
+++ b/rtemsbsd/rtems/syslog.c
@@ -11,7 +11,7 @@
#include <stdarg.h>
#include <errno.h>
#include <syslog.h>
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <string.h>
diff --git a/rtemsbsd/sh/include/freebsd/machine/cpufunc.h b/rtemsbsd/sh/include/freebsd/machine/cpufunc.h
deleted file mode 100644
index fa882cb5..00000000
--- a/rtemsbsd/sh/include/freebsd/machine/cpufunc.h
+++ /dev/null
@@ -1 +0,0 @@
-/* empty file */
diff --git a/rtemsbsd/sparc/include/freebsd/machine/cpufunc.h b/rtemsbsd/sparc/include/freebsd/machine/cpufunc.h
deleted file mode 100644
index fa882cb5..00000000
--- a/rtemsbsd/sparc/include/freebsd/machine/cpufunc.h
+++ /dev/null
@@ -1 +0,0 @@
-/* empty file */
diff --git a/rtemsbsd/sys/dev/usb/controller/ehci_mpc83xx.c b/rtemsbsd/sys/dev/usb/controller/ehci_mpc83xx.c
index 88952e5f..b9bc7244 100644
--- a/rtemsbsd/sys/dev/usb/controller/ehci_mpc83xx.c
+++ b/rtemsbsd/sys/dev/usb/controller/ehci_mpc83xx.c
@@ -12,7 +12,7 @@
* http://www.rtems.com/license/LICENSE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <bsp.h>
@@ -33,38 +33,38 @@
#define BSP_EHCI_IRQ_VECTOR QORIQ_IRQ_USB_1
#endif
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
-
-#include <freebsd/dev/usb/usb_core.h>
-#include <freebsd/dev/usb/usb_busdma.h>
-#include <freebsd/dev/usb/usb_process.h>
-#include <freebsd/dev/usb/usb_util.h>
-
-#include <freebsd/dev/usb/usb_controller.h>
-#include <freebsd/dev/usb/usb_bus.h>
-#include <freebsd/dev/usb/controller/ehci.h>
+#include <sys/cdefs.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+
+#include <dev/usb/usb_core.h>
+#include <dev/usb/usb_busdma.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usb_util.h>
+
+#include <dev/usb/usb_controller.h>
+#include <dev/usb/usb_bus.h>
+#include <dev/usb/controller/ehci.h>
static device_probe_t ehci_mpc83xx_probe;
static device_attach_t ehci_mpc83xx_attach;
diff --git a/rtemsbsd/sys/dev/usb/controller/ohci_lpc24xx.c b/rtemsbsd/sys/dev/usb/controller/ohci_lpc24xx.c
index dc32510c..72077906 100644
--- a/rtemsbsd/sys/dev/usb/controller/ohci_lpc24xx.c
+++ b/rtemsbsd/sys/dev/usb/controller/ohci_lpc24xx.c
@@ -12,7 +12,7 @@
* http://www.rtems.com/license/LICENSE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <bsp.h>
@@ -22,38 +22,38 @@
#include <bsp/io.h>
#include <bsp/lpc24xx.h>
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
-
-#include <freebsd/dev/usb/usb_core.h>
-#include <freebsd/dev/usb/usb_busdma.h>
-#include <freebsd/dev/usb/usb_process.h>
-#include <freebsd/dev/usb/usb_util.h>
-
-#include <freebsd/dev/usb/usb_controller.h>
-#include <freebsd/dev/usb/usb_bus.h>
-#include <freebsd/dev/usb/controller/ohci.h>
+#include <sys/cdefs.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+
+#include <dev/usb/usb_core.h>
+#include <dev/usb/usb_busdma.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usb_util.h>
+
+#include <dev/usb/usb_controller.h>
+#include <dev/usb/usb_bus.h>
+#include <dev/usb/controller/ohci.h>
static device_probe_t ohci_lpc24xx_probe;
static device_attach_t ohci_lpc24xx_attach;
diff --git a/rtemsbsd/sys/dev/usb/controller/ohci_lpc32xx.c b/rtemsbsd/sys/dev/usb/controller/ohci_lpc32xx.c
index 9c7e8efb..ee3a0ebf 100644
--- a/rtemsbsd/sys/dev/usb/controller/ohci_lpc32xx.c
+++ b/rtemsbsd/sys/dev/usb/controller/ohci_lpc32xx.c
@@ -12,7 +12,7 @@
* http://www.rtems.com/license/LICENSE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <bsp.h>
@@ -21,38 +21,38 @@
#include <bsp/irq.h>
#include <bsp/lpc32xx.h>
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
-
-#include <freebsd/dev/usb/usb_core.h>
-#include <freebsd/dev/usb/usb_busdma.h>
-#include <freebsd/dev/usb/usb_process.h>
-#include <freebsd/dev/usb/usb_util.h>
-
-#include <freebsd/dev/usb/usb_controller.h>
-#include <freebsd/dev/usb/usb_bus.h>
-#include <freebsd/dev/usb/controller/ohci.h>
+#include <sys/cdefs.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+
+#include <dev/usb/usb_core.h>
+#include <dev/usb/usb_busdma.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usb_util.h>
+
+#include <dev/usb/usb_controller.h>
+#include <dev/usb/usb_bus.h>
+#include <dev/usb/controller/ohci.h>
#define USB_CTRL_SLAVE_HCLK_EN (1U << 24)
#define USB_CTRL_I2C_EN (1U << 23)
diff --git a/rtemsbsd/v850/include/freebsd/machine/cpufunc.h b/rtemsbsd/v850/include/freebsd/machine/cpufunc.h
deleted file mode 100644
index fa882cb5..00000000
--- a/rtemsbsd/v850/include/freebsd/machine/cpufunc.h
+++ /dev/null
@@ -1 +0,0 @@
-/* empty file */
diff --git a/services/librpc/src/rpc/auth_none.c b/services/librpc/src/rpc/auth_none.c
index 1718caa2..33b93498 100644
--- a/services/librpc/src/rpc/auth_none.c
+++ b/services/librpc/src/rpc/auth_none.c
@@ -45,7 +45,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/auth_none.c,v 1.9 1999/08/28 00
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <rpc/auth.h>
diff --git a/services/librpc/src/rpc/auth_unix.c b/services/librpc/src/rpc/auth_unix.c
index ca7f74b6..67d3962b 100644
--- a/services/librpc/src/rpc/auth_unix.c
+++ b/services/librpc/src/rpc/auth_unix.c
@@ -49,7 +49,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/auth_unix.c,v 1.12 1999/12/29 0
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/services/librpc/src/rpc/authunix_prot.c b/services/librpc/src/rpc/authunix_prot.c
index f8a05ae0..84acf46c 100644
--- a/services/librpc/src/rpc/authunix_prot.c
+++ b/services/librpc/src/rpc/authunix_prot.c
@@ -45,7 +45,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/authunix_prot.c,v 1.6 1999/08/2
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <rpc/auth.h>
diff --git a/services/librpc/src/rpc/bindresvport.c b/services/librpc/src/rpc/bindresvport.c
index 87b1becb..849d664f 100644
--- a/services/librpc/src/rpc/bindresvport.c
+++ b/services/librpc/src/rpc/bindresvport.c
@@ -46,7 +46,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/bindresvport.c,v 1.12 2000/01/2
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/services/librpc/src/rpc/clnt_generic.c b/services/librpc/src/rpc/clnt_generic.c
index 67433c61..649e36db 100644
--- a/services/librpc/src/rpc/clnt_generic.c
+++ b/services/librpc/src/rpc/clnt_generic.c
@@ -40,7 +40,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/clnt_generic.c,v 1.9 1999/08/28
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <rpc/rpc.h>
#include <rpc/rpc.h>
#include <sys/socket.h>
diff --git a/services/librpc/src/rpc/clnt_perror.c b/services/librpc/src/rpc/clnt_perror.c
index dad3bfa3..38b3d71a 100644
--- a/services/librpc/src/rpc/clnt_perror.c
+++ b/services/librpc/src/rpc/clnt_perror.c
@@ -44,7 +44,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/clnt_perror.c,v 1.11 1999/08/28
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/services/librpc/src/rpc/clnt_raw.c b/services/librpc/src/rpc/clnt_raw.c
index c4c313e0..30088112 100644
--- a/services/librpc/src/rpc/clnt_raw.c
+++ b/services/librpc/src/rpc/clnt_raw.c
@@ -48,7 +48,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/clnt_raw.c,v 1.10 1999/08/28 00
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <rpc/rpc.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/services/librpc/src/rpc/clnt_simple.c b/services/librpc/src/rpc/clnt_simple.c
index c619f852..9517eb5d 100644
--- a/services/librpc/src/rpc/clnt_simple.c
+++ b/services/librpc/src/rpc/clnt_simple.c
@@ -44,7 +44,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/clnt_simple.c,v 1.12 2000/01/27
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <sys/param.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/services/librpc/src/rpc/clnt_tcp.c b/services/librpc/src/rpc/clnt_tcp.c
index a08b20fd..102426cf 100644
--- a/services/librpc/src/rpc/clnt_tcp.c
+++ b/services/librpc/src/rpc/clnt_tcp.c
@@ -56,7 +56,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/clnt_tcp.c,v 1.14 2000/01/27 23
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/services/librpc/src/rpc/clnt_udp.c b/services/librpc/src/rpc/clnt_udp.c
index 6640baa8..dc032bce 100644
--- a/services/librpc/src/rpc/clnt_udp.c
+++ b/services/librpc/src/rpc/clnt_udp.c
@@ -43,7 +43,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/clnt_udp.c,v 1.15 2000/01/27 23
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/services/librpc/src/rpc/get_myaddress.c b/services/librpc/src/rpc/get_myaddress.c
index 26caee37..caf147d1 100644
--- a/services/librpc/src/rpc/get_myaddress.c
+++ b/services/librpc/src/rpc/get_myaddress.c
@@ -44,7 +44,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/get_myaddress.c,v 1.17 2000/01/
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <rpc/pmap_prot.h>
diff --git a/services/librpc/src/rpc/getrpcent.c b/services/librpc/src/rpc/getrpcent.c
index 7a85d4b6..fdd0f88e 100644
--- a/services/librpc/src/rpc/getrpcent.c
+++ b/services/librpc/src/rpc/getrpcent.c
@@ -41,7 +41,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/getrpcent.c,v 1.10 1999/08/28 0
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
diff --git a/services/librpc/src/rpc/getrpcport.c b/services/librpc/src/rpc/getrpcport.c
index 942f2c29..f783bac2 100644
--- a/services/librpc/src/rpc/getrpcport.c
+++ b/services/librpc/src/rpc/getrpcport.c
@@ -41,7 +41,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/getrpcport.c,v 1.10 1999/08/28
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <stdio.h>
#include <string.h>
#include <rpc/rpc.h>
diff --git a/services/librpc/src/rpc/netname.c b/services/librpc/src/rpc/netname.c
index 7b768eb2..3d19b489 100644
--- a/services/librpc/src/rpc/netname.c
+++ b/services/librpc/src/rpc/netname.c
@@ -43,7 +43,6 @@ static char sccsid[] = "@(#)netname.c 1.8 91/03/11 Copyr 1986 Sun Micro";
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <sys/param.h>
#include <rpc/rpc.h>
#include <rpc/rpc_com.h>
diff --git a/services/librpc/src/rpc/netnamer.c b/services/librpc/src/rpc/netnamer.c
index 9e87d21f..aa9397e0 100644
--- a/services/librpc/src/rpc/netnamer.c
+++ b/services/librpc/src/rpc/netnamer.c
@@ -40,7 +40,6 @@ static char sccsid[] = "@(#)netnamer.c 1.13 91/03/11 Copyr 1986 Sun Micro";
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <sys/param.h>
#include <rpc/rpc.h>
#include <rpc/rpc_com.h>
diff --git a/services/librpc/src/rpc/pmap_clnt.c b/services/librpc/src/rpc/pmap_clnt.c
index b63349c7..7c02867e 100644
--- a/services/librpc/src/rpc/pmap_clnt.c
+++ b/services/librpc/src/rpc/pmap_clnt.c
@@ -44,7 +44,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/pmap_clnt.c,v 1.11 2000/01/27 2
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
diff --git a/services/librpc/src/rpc/pmap_getmaps.c b/services/librpc/src/rpc/pmap_getmaps.c
index 3c682ab3..be03c3f2 100644
--- a/services/librpc/src/rpc/pmap_getmaps.c
+++ b/services/librpc/src/rpc/pmap_getmaps.c
@@ -45,7 +45,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/pmap_getmaps.c,v 1.11 2000/01/2
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <rpc/rpc.h>
#include <rpc/pmap_prot.h>
#include <rpc/pmap_clnt.h>
diff --git a/services/librpc/src/rpc/pmap_getport.c b/services/librpc/src/rpc/pmap_getport.c
index 8bece3f4..03014efa 100644
--- a/services/librpc/src/rpc/pmap_getport.c
+++ b/services/librpc/src/rpc/pmap_getport.c
@@ -44,7 +44,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/pmap_getport.c,v 1.10 2000/01/2
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <rpc/rpc.h>
#include <rpc/pmap_prot.h>
#include <rpc/pmap_clnt.h>
diff --git a/services/librpc/src/rpc/pmap_prot.c b/services/librpc/src/rpc/pmap_prot.c
index f7bb9e7c..30aedce4 100644
--- a/services/librpc/src/rpc/pmap_prot.c
+++ b/services/librpc/src/rpc/pmap_prot.c
@@ -44,7 +44,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/pmap_prot.c,v 1.6 1999/08/28 00
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <rpc/pmap_prot.h>
diff --git a/services/librpc/src/rpc/pmap_prot2.c b/services/librpc/src/rpc/pmap_prot2.c
index e3f98419..19a39e10 100644
--- a/services/librpc/src/rpc/pmap_prot2.c
+++ b/services/librpc/src/rpc/pmap_prot2.c
@@ -44,7 +44,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/pmap_prot2.c,v 1.7 1999/08/28 0
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#ifndef __rtems__
/* XXX not needed in old.. */
#include <sys/types.h>
diff --git a/services/librpc/src/rpc/rpc_callmsg.c b/services/librpc/src/rpc/rpc_callmsg.c
index 2594cc35..b44ebb4a 100644
--- a/services/librpc/src/rpc/rpc_callmsg.c
+++ b/services/librpc/src/rpc/rpc_callmsg.c
@@ -44,7 +44,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/rpc_callmsg.c,v 1.9 1999/08/28
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <sys/param.h>
#include <stdlib.h>
#include <string.h>
diff --git a/services/librpc/src/rpc/rpc_commondata.c b/services/librpc/src/rpc/rpc_commondata.c
index 39777cf6..88eab015 100644
--- a/services/librpc/src/rpc/rpc_commondata.c
+++ b/services/librpc/src/rpc/rpc_commondata.c
@@ -36,7 +36,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/rpc_commondata.c,v 1.7 1999/08/
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <rpc/rpc.h>
#ifdef __rtems__
#include <rpc/clnt.h>
diff --git a/services/librpc/src/rpc/rpc_dtablesize.c b/services/librpc/src/rpc/rpc_dtablesize.c
index 858dd924..65f29531 100644
--- a/services/librpc/src/rpc/rpc_dtablesize.c
+++ b/services/librpc/src/rpc/rpc_dtablesize.c
@@ -37,7 +37,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/rpc_dtablesize.c,v 1.10 1999/08
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <sys/types.h>
#include <unistd.h>
diff --git a/services/librpc/src/rpc/rpc_prot.c b/services/librpc/src/rpc/rpc_prot.c
index 4e533339..0718c9a9 100644
--- a/services/librpc/src/rpc/rpc_prot.c
+++ b/services/librpc/src/rpc/rpc_prot.c
@@ -50,7 +50,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/rpc_prot.c,v 1.8 1999/08/28 00:
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <assert.h>
#include <sys/param.h>
diff --git a/services/librpc/src/rpc/rpcdname.c b/services/librpc/src/rpc/rpcdname.c
index 1f01ca5d..9088fb20 100644
--- a/services/librpc/src/rpc/rpcdname.c
+++ b/services/librpc/src/rpc/rpcdname.c
@@ -40,7 +40,6 @@ static char sccsid[] = "@(#)rpcdname.c 1.7 91/03/11 Copyr 1989 Sun Micro";
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
diff --git a/services/librpc/src/rpc/rtems_portmapper.c b/services/librpc/src/rpc/rtems_portmapper.c
index a3f11d7b..9d327b5d 100644
--- a/services/librpc/src/rpc/rtems_portmapper.c
+++ b/services/librpc/src/rpc/rtems_portmapper.c
@@ -31,7 +31,6 @@
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <rpc/rpc.h>
#include <rpc/pmap_prot.h>
#include <stdio.h>
diff --git a/services/librpc/src/rpc/rtems_rpc.c b/services/librpc/src/rpc/rtems_rpc.c
index 38b22f97..085cf14e 100644
--- a/services/librpc/src/rpc/rtems_rpc.c
+++ b/services/librpc/src/rpc/rtems_rpc.c
@@ -6,7 +6,6 @@
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <rpc/rpc.h>
#include <rtems.h>
#include <stdlib.h>
diff --git a/services/librpc/src/rpc/rtime.c b/services/librpc/src/rpc/rtime.c
index e4059ba2..af63d5b8 100644
--- a/services/librpc/src/rpc/rtime.c
+++ b/services/librpc/src/rpc/rtime.c
@@ -46,7 +46,6 @@
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
diff --git a/services/librpc/src/rpc/svc.c b/services/librpc/src/rpc/svc.c
index 47843968..8a99fc13 100644
--- a/services/librpc/src/rpc/svc.c
+++ b/services/librpc/src/rpc/svc.c
@@ -47,7 +47,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/svc.c,v 1.14 1999/08/28 00:00:4
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <string.h>
#ifdef HAVE_STRINGS_H
#include <strings.h> /* for ffs */
diff --git a/services/librpc/src/rpc/svc_auth.c b/services/librpc/src/rpc/svc_auth.c
index b15c1b72..8c7bc883 100644
--- a/services/librpc/src/rpc/svc_auth.c
+++ b/services/librpc/src/rpc/svc_auth.c
@@ -50,7 +50,6 @@ static const char rcsid[] =
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#ifdef _KERNEL
#include <sys/param.h>
#include <rpc/types.h>
diff --git a/services/librpc/src/rpc/svc_auth_unix.c b/services/librpc/src/rpc/svc_auth_unix.c
index 56b4027a..ce395998 100644
--- a/services/librpc/src/rpc/svc_auth_unix.c
+++ b/services/librpc/src/rpc/svc_auth_unix.c
@@ -48,7 +48,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/svc_auth_unix.c,v 1.8 1999/08/2
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <stdio.h>
#include <string.h>
#include <rpc/rpc.h>
diff --git a/services/librpc/src/rpc/svc_raw.c b/services/librpc/src/rpc/svc_raw.c
index bbdfc807..da38c857 100644
--- a/services/librpc/src/rpc/svc_raw.c
+++ b/services/librpc/src/rpc/svc_raw.c
@@ -46,7 +46,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/svc_raw.c,v 1.7 1999/08/28 00:0
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <rpc/rpc.h>
#include <stdlib.h>
#ifdef __rtems__
diff --git a/services/librpc/src/rpc/svc_run.c b/services/librpc/src/rpc/svc_run.c
index 9b672760..a764fb57 100644
--- a/services/librpc/src/rpc/svc_run.c
+++ b/services/librpc/src/rpc/svc_run.c
@@ -42,7 +42,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/svc_run.c,v 1.10 1999/08/28 00:
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <rpc/rpc.h>
#include <stdio.h>
#include <sys/errno.h>
diff --git a/services/librpc/src/rpc/svc_simple.c b/services/librpc/src/rpc/svc_simple.c
index 3a4024d1..5a2a0f08 100644
--- a/services/librpc/src/rpc/svc_simple.c
+++ b/services/librpc/src/rpc/svc_simple.c
@@ -44,7 +44,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/svc_simple.c,v 1.9 1999/08/28 0
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/services/librpc/src/rpc/svc_tcp.c b/services/librpc/src/rpc/svc_tcp.c
index ca2a84bc..88967aae 100644
--- a/services/librpc/src/rpc/svc_tcp.c
+++ b/services/librpc/src/rpc/svc_tcp.c
@@ -47,7 +47,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/svc_tcp.c,v 1.18 2000/01/27 23:
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/services/librpc/src/rpc/svc_udp.c b/services/librpc/src/rpc/svc_udp.c
index 8b765ebc..4d64dee5 100644
--- a/services/librpc/src/rpc/svc_udp.c
+++ b/services/librpc/src/rpc/svc_udp.c
@@ -45,7 +45,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/svc_udp.c,v 1.13 2000/01/27 23:
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/services/librpc/src/xdr/xdr.c b/services/librpc/src/xdr/xdr.c
index 59ec3556..4fb7c992 100644
--- a/services/librpc/src/xdr/xdr.c
+++ b/services/librpc/src/xdr/xdr.c
@@ -47,7 +47,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/xdr/xdr.c,v 1.9 1999/08/28 00:02:55
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/services/librpc/src/xdr/xdr_array.c b/services/librpc/src/xdr/xdr_array.c
index f9065ee0..190dc3cf 100644
--- a/services/librpc/src/xdr/xdr_array.c
+++ b/services/librpc/src/xdr/xdr_array.c
@@ -46,7 +46,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/xdr/xdr_array.c,v 1.8 1999/08/28 00
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/services/librpc/src/xdr/xdr_float.c b/services/librpc/src/xdr/xdr_float.c
index 8eeaf7b9..2517072c 100644
--- a/services/librpc/src/xdr/xdr_float.c
+++ b/services/librpc/src/xdr/xdr_float.c
@@ -47,7 +47,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/xdr/xdr_float.c,v 1.7 1999/08/28 00
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/param.h>
diff --git a/services/librpc/src/xdr/xdr_mem.c b/services/librpc/src/xdr/xdr_mem.c
index b4cf070d..5b30419d 100644
--- a/services/librpc/src/xdr/xdr_mem.c
+++ b/services/librpc/src/xdr/xdr_mem.c
@@ -48,7 +48,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/xdr/xdr_mem.c,v 1.8 1999/08/28 00:0
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <string.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
diff --git a/services/librpc/src/xdr/xdr_rec.c b/services/librpc/src/xdr/xdr_rec.c
index 5b4d5b9d..1698bc69 100644
--- a/services/librpc/src/xdr/xdr_rec.c
+++ b/services/librpc/src/xdr/xdr_rec.c
@@ -53,7 +53,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/xdr/xdr_rec.c,v 1.12 2000/01/19 06:
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/services/librpc/src/xdr/xdr_reference.c b/services/librpc/src/xdr/xdr_reference.c
index 86fcf290..a2a6ee51 100644
--- a/services/librpc/src/xdr/xdr_reference.c
+++ b/services/librpc/src/xdr/xdr_reference.c
@@ -46,7 +46,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/xdr/xdr_reference.c,v 1.8 1999/08/2
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/services/librpc/src/xdr/xdr_sizeof.c b/services/librpc/src/xdr/xdr_sizeof.c
index 12241ea5..72a7ff97 100644
--- a/services/librpc/src/xdr/xdr_sizeof.c
+++ b/services/librpc/src/xdr/xdr_sizeof.c
@@ -39,7 +39,6 @@
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <sys/types.h>
diff --git a/services/librpc/src/xdr/xdr_stdio.c b/services/librpc/src/xdr/xdr_stdio.c
index d1191210..ca67941e 100644
--- a/services/librpc/src/xdr/xdr_stdio.c
+++ b/services/librpc/src/xdr/xdr_stdio.c
@@ -47,7 +47,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/xdr/xdr_stdio.c,v 1.7 1999/08/28 00
#include "config.h"
#endif
-#include <freebsd/bsd.h>
#include <rpc/types.h>
#include <stdio.h>
#include <rpc/xdr.h>
diff --git a/testsuite/Makefile b/testsuite/Makefile
deleted file mode 100644
index e0c8ebbf..00000000
--- a/testsuite/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# $Id$
-#
-
-include ../config.inc
-
-include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
-include $(RTEMS_CUSTOM)
-include $(RTEMS_SHARE)/make/directory.cfg
-
-# Basic Tests
-SUBDIRS = swi01
-SUBDIRS += timeout01
-# USB Tests
-SUBDIRS += usb01
-
-# Network Tests
-SUBDIRS += init01
-SUBDIRS += netshell01
-SUBDIRS += loopback01
diff --git a/testsuite/init01/init.c b/testsuite/include/rtems/bsd/test/default-init.h
index 028dcde3..c3150f5f 100644
--- a/testsuite/init01/init.c
+++ b/testsuite/include/rtems/bsd/test/default-init.h
@@ -2,20 +2,19 @@
* Shared Network Test Initialization File
*/
+#ifndef RTEMS_BSD_TEST_DEFAULT_INIT_H
+#define RTEMS_BSD_TEST_DEFAULT_INIT_H
+
#include <bsp.h>
#include <stdlib.h>
#include <stdio.h>
-#include <freebsd/bsd.h>
-
-/* XXX should these be in a header? */
-void print_test_name(void);
-void test_main(void);
+#include <rtems/bsd/bsd.h>
rtems_task Init(
rtems_task_argument ignored
)
{
- print_test_name();
+ puts( "*** " TEST_NAME " TEST ***" );
/*
* BSD must support the new "shared IRQ PIC implementation" at this point.
@@ -34,7 +33,6 @@ rtems_task Init(
/* configuration information */
-/* NOTICE: the clock driver is explicitly disabled */
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
@@ -55,7 +53,7 @@ rtems_task Init(
* FreeBSD TCP/IP Initialization
*/
-#include <freebsd/machine/rtems-bsd-sysinit.h>
+#include <machine/rtems-bsd-sysinit.h>
#define CONFIGURE_NEED_NET
/* only include FXP and PCI for i386/pc386 for debug on qemu (for now) */
@@ -71,6 +69,7 @@ char static_hints[] = {
"hint.fxp.0.prefer_iomap=1\0\n"
};
-#include "nic-sysinit.h"
+#include <rtems/bsd/test/nic-sysinit.h>
/* end of file */
+#endif /* RTEMS_BSD_TEST_DEFAULT_INIT_H */
diff --git a/testsuite/include/rtems/bsd/test/nic-sysinit.h b/testsuite/include/rtems/bsd/test/nic-sysinit.h
index dbad732d..752fe601 100644
--- a/testsuite/include/rtems/bsd/test/nic-sysinit.h
+++ b/testsuite/include/rtems/bsd/test/nic-sysinit.h
@@ -33,7 +33,7 @@
*/
-#include <freebsd/machine/rtems-bsd-sysinit.h>
+#include <machine/rtems-bsd-sysinit.h>
/*
* We "read" that and generate references and nexus devices
diff --git a/testsuite/init01/.gitignore b/testsuite/init01/.gitignore
deleted file mode 100644
index adaff0b8..00000000
--- a/testsuite/init01/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-undefined.txt
diff --git a/testsuite/init01/Makefile b/testsuite/init01/Makefile
deleted file mode 100644
index 1e7ac313..00000000
--- a/testsuite/init01/Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# $Id$
-#
-
-include ../../config.inc
-
-PGM=${ARCH}/init01.exe
-
-# optional managers required
-MANAGERS=all
-
-# C source names
-C_FILES = init.c test_main.c
-C_O_FILES = $(C_FILES:%.c=${ARCH}/%.o)
-
-AM_CPPFLAGS += -I $(INSTALL_BASE)/include
-LINK_LIBS += $(INSTALL_BASE)/libbsdc.a
-LINK_LIBS += $(INSTALL_BASE)/libbsd.a ${REL_ARGS}
-
-include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
-include $(RTEMS_CUSTOM)
-include $(PROJECT_ROOT)/make/leaf.cfg
-
-OBJS= $(C_O_FILES)
-CLEAN_ADDITIONS += undefined.txt
-
-all: ${ARCH} $(PGM)
-
-$(PGM): $(OBJS)
- -$(make-exe)
diff --git a/testsuite/init01/test_main.c b/testsuite/init01/test_main.c
index 649a578b..88de0648 100644
--- a/testsuite/init01/test_main.c
+++ b/testsuite/init01/test_main.c
@@ -3,22 +3,18 @@
* that the target is alive after initializing the TCP/IP stack.
*/
-#include <bsp.h>
#include <stdlib.h>
#include <stdio.h>
-#include <freebsd/bsd.h>
+#include <unistd.h>
-void print_test_name(void)
-{
- printf( "\n\n*** LIBFREEBSD INITIALIZATION TEST ***\n" );
-}
+#define TEST_NAME "LIBBSD INIT 1"
-void test_main(void)
+static void test_main(void)
{
puts( "Sleeping to see what happens" );
sleep( 5 );
- printf( "*** END OF LIBFREEBSD INITIALIZATION TEST ***\n" );
+ puts( "*** END OF " TEST_NAME " TEST ***" );
exit( 0 );
}
@@ -47,3 +43,4 @@ struct rtems_bsdnet_config rtems_bsdnet_config = {
0
};
+#include <rtems/bsd/test/default-init.h>
diff --git a/testsuite/loopback01/.gitignore b/testsuite/loopback01/.gitignore
deleted file mode 100644
index 27bb1279..00000000
--- a/testsuite/loopback01/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-init.c
diff --git a/testsuite/loopback01/Makefile b/testsuite/loopback01/Makefile
deleted file mode 100644
index 7998aba6..00000000
--- a/testsuite/loopback01/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# $Id$
-#
-
-include ../../config.inc
-
-PGM=${ARCH}/loopback01.exe
-
-# optional managers required
-MANAGERS=all
-
-# C source names
-C_FILES = init.c test_main.c
-C_O_FILES = $(C_FILES:%.c=${ARCH}/%.o)
-
-AM_CPPFLAGS += -I $(INSTALL_BASE)/include
-AM_CPPFLAGS += -I ../init01
-LINK_LIBS += $(INSTALL_BASE)/libbsdc.a
-LINK_LIBS += $(INSTALL_BASE)/libbsd.a ${REL_ARGS}
-
-include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
-include $(RTEMS_CUSTOM)
-include $(PROJECT_ROOT)/make/leaf.cfg
-
-OBJS= $(C_O_FILES)
-CLEAN_ADDITIONS += init.c
-
-all: init.c ${ARCH} $(PGM)
-
-init.c: ../init01/init.c
- cp ../init01/init.c .
-
-$(PGM): $(OBJS)
- -$(make-exe)
diff --git a/testsuite/loopback01/test_main.c b/testsuite/loopback01/test_main.c
index b21fc87e..6f58f329 100644
--- a/testsuite/loopback01/test_main.c
+++ b/testsuite/loopback01/test_main.c
@@ -9,19 +9,7 @@
#include <sys/socket.h>
#include <netinet/in.h>
-void print_test_name(void)
-{
- printf( "\n\n*** LIBFREEBSD LOOPBACK SOCKET01 TEST ***\n" );
-}
-
-
-/* XXX remaining init configuration to evaluate */
-#define CONFIGURE_INIT_TASK_STACK_SIZE (10*1024)
-#define CONFIGURE_INIT_TASK_PRIORITY 50
-#define CONFIGURE_INIT_TASK_INITIAL_MODES (RTEMS_PREEMPT | \
- RTEMS_NO_TIMESLICE | \
- RTEMS_NO_ASR | \
- RTEMS_INTERRUPT_LEVEL(0))
+#define TEST_NAME "LIBBSD LOOPBACK 1"
#include <rtems/error.h>
#include <stdio.h>
@@ -224,7 +212,7 @@ static rtems_task clientTask(rtems_task_argument arg)
/*
* RTEMS Startup Task
*/
-void test_main(void)
+static void test_main(void)
{
rtems_status_code sc;
rtems_task_priority old;
@@ -270,6 +258,8 @@ void test_main(void)
spawnTask(clientTask, 120, 6);
rtems_task_wake_after(500);
- puts( "*** END OF LOOPBACK TEST ***" );
+ puts( "*** END OF " TEST_NAME " TEST ***" );
exit( 0 );
}
+
+#include <rtems/bsd/test/default-init.h>
diff --git a/testsuite/mghttpd01/.gitignore b/testsuite/mghttpd01/.gitignore
deleted file mode 100644
index 27bb1279..00000000
--- a/testsuite/mghttpd01/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-init.c
diff --git a/testsuite/mghttpd01/Makefile b/testsuite/mghttpd01/Makefile
deleted file mode 100644
index 4444a517..00000000
--- a/testsuite/mghttpd01/Makefile
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# $Id$
-#
-
-include ../../config.inc
-
-PGM=${ARCH}/mghttpd01.exe
-
-# optional managers required
-MANAGERS=all
-
-# XXX = mghttpd01.doc mghttpd01.scn
-# C source names
-C_FILES = init.c test-http-client.c
-C_O_FILES = $(C_FILES:%.c=${ARCH}/%.o)
-
-AM_CPPFLAGS += -I $(INSTALL_BASE)/include
-AM_CPPFLAGS += -I ../init01
-AM_CPPFLAGS += -I ${r}/testsuites/support/include
-LINK_LIBS += $(INSTALL_BASE)/libmghttpd.a
-LINK_LIBS += $(INSTALL_BASE)/libbsdc.a
-LINK_LIBS += $(INSTALL_BASE)/libbsd.a
-
-include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
-include $(RTEMS_CUSTOM)
-include $(PROJECT_ROOT)/make/leaf.cfg
-
-OBJS= $(C_O_FILES)
-CLEAN_ADDITIONS += init.c
-
-all: init.c ${ARCH} $(PGM)
-
-init.c: ../init01/init.c
- cp ../init01/init.c .
-
-$(PGM): $(OBJS)
- -$(make-exe)
diff --git a/testsuite/netshell01/.gitignore b/testsuite/netshell01/.gitignore
deleted file mode 100644
index 27bb1279..00000000
--- a/testsuite/netshell01/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-init.c
diff --git a/testsuite/netshell01/Makefile b/testsuite/netshell01/Makefile
deleted file mode 100644
index e0179c22..00000000
--- a/testsuite/netshell01/Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-include ../../config.inc
-
-PGM=${ARCH}/netshell01.exe
-
-# optional managers required
-MANAGERS=all
-
-# C source names
-C_FILES = init.c test_main.c shellconfig.c ns_parser_vars.c
-C_O_FILES = $(C_FILES:%.c=${ARCH}/%.o)
-
-AM_CPPFLAGS += -I $(INSTALL_BASE)/include
-AM_CPPFLAGS += -I ../init01
-LINK_LIBS += $(INSTALL_BASE)/libbsdc.a
-LINK_LIBS += $(INSTALL_BASE)/libbsd.a -lm ${REL_ARGS}
-
-include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
-include $(RTEMS_CUSTOM)
-include $(PROJECT_ROOT)/make/leaf.cfg
-
-OBJS= $(C_O_FILES)
-CLEAN_ADDITIONS += init.c
-
-all: init.c ${ARCH} $(PGM)
-
-init.c: ../init01/init.c
- cp ../init01/init.c .
-
-$(PGM): $(OBJS)
- -$(make-exe)
diff --git a/testsuite/netshell01/test_main.c b/testsuite/netshell01/test_main.c
index 65304849..b56d8307 100644
--- a/testsuite/netshell01/test_main.c
+++ b/testsuite/netshell01/test_main.c
@@ -11,20 +11,19 @@
#include <rtems/shell.h>
-void print_test_name(void)
-{
- printf( "\n\n*** LIBFREEBSD NETWORK SHELL TEST ***\n" );
-}
+#define TEST_NAME "LIBBSD NETSHELL 1"
/*
* RTEMS Startup Task
*/
-void test_main(void)
+static void test_main(void)
{
rtems_shell_env_t env = rtems_global_shell_env;
rtems_shell_main_loop( &env );
- puts( "*** END OF NETWORK SHELL TEST ***" );
+ puts( "*** END OF " TEST_NAME " TEST ***" );
exit( 0 );
}
+
+#include <rtems/bsd/test/default-init.h>
diff --git a/testsuite/swi01/Makefile b/testsuite/swi01/Makefile
deleted file mode 100644
index f5de48f4..00000000
--- a/testsuite/swi01/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-include ../../config.inc
-
-APP=swi01
-PGM=${ARCH}/$(APP).exe
-
-# optional managers required
-MANAGERS=all
-
-# C source names
-C_FILES = init.c swi_test.c
-C_O_FILES = $(C_FILES:%.c=${ARCH}/%.o)
-
-AM_CPPFLAGS += -I $(INSTALL_BASE)/include
-LINK_LIBS += $(INSTALL_BASE)/libbsd.a ${REL_ARGS}
-CFLAGS += $(DEPFLAGS) $(GCCFLAGS) $(AM_CPPFLAGS) -Wno-unused -Wl,-Map,$(APP).map
-
-include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
-include $(RTEMS_CUSTOM)
-include $(PROJECT_ROOT)/make/leaf.cfg
-
-OBJS= $(C_O_FILES)
-CLEAN_ADDITIONS += $(APP).map
-
-all: ${ARCH} $(PGM)
-
-$(PGM): $(OBJS)
- -$(make-exe)
diff --git a/testsuite/swi01/init.c b/testsuite/swi01/init.c
index 9bc13dc6..57d77f80 100644
--- a/testsuite/swi01/init.c
+++ b/testsuite/swi01/init.c
@@ -34,7 +34,7 @@
#include <rtems.h>
-#include <freebsd/bsd.h>
+#include <rtems/bsd/bsd.h>
#include "swi_test.h"
diff --git a/testsuite/swi01/swi_test.c b/testsuite/swi01/swi_test.c
index 99ba94f4..093458e7 100644
--- a/testsuite/swi01/swi_test.c
+++ b/testsuite/swi01/swi_test.c
@@ -34,19 +34,19 @@
#include <stdio.h>
#include <unistd.h>
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
+#include <sys/types.h>
+#include <sys/systm.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/interrupt.h>
+#include <sys/param.h>
+#include <sys/bus.h>
+#include <sys/interrupt.h>
#define SWI_TEST_THREAD_PRIO (0)
// Time to wait for swi-test-handler
-#define SWI_SLEEP_TIME (100)
+#define SWI_SLEEP_TIME (1)
enum arg {
HANDLER_NOT_VISITED,
@@ -78,7 +78,7 @@ void swi_test_normal_handler()
swi_sched(test_ih, 0);
- usleep(SWI_SLEEP_TIME);
+ sleep(SWI_SLEEP_TIME);
assert(argument == HANDLER_VISITED);
}
@@ -98,7 +98,7 @@ void swi_test_exclusive_handler()
swi_sched(test_ih, 0);
- usleep(SWI_SLEEP_TIME);
+ sleep(SWI_SLEEP_TIME);
assert(argument == HANDLER_VISITED);
}
@@ -124,7 +124,7 @@ void swi_test_error_intr_entropy_set()
SWI_TEST_THREAD_PRIO, INTR_ENTROPY, &test_ih);
assert(retval == EINVAL);
- usleep(SWI_SLEEP_TIME);
+ sleep(SWI_SLEEP_TIME);
assert(argument == HANDLER_NOT_VISITED);
}
@@ -148,7 +148,7 @@ void swi_test_error_name_null()
SWI_TEST_THREAD_PRIO, 0, &test_ih);
assert(retval == EINVAL);
- usleep(SWI_SLEEP_TIME);
+ sleep(SWI_SLEEP_TIME);
assert(argument == HANDLER_NOT_VISITED);
}
@@ -166,7 +166,7 @@ void swi_test_error_handler_null()
SWI_TEST_THREAD_PRIO, 0, &test_ih);
assert(retval == EINVAL);
- usleep(SWI_SLEEP_TIME);
+ sleep(SWI_SLEEP_TIME);
assert(argument == HANDLER_NOT_VISITED);
}
@@ -189,7 +189,7 @@ void swi_test_error_has_allready_exclusive()
SWI_TEST_THREAD_PRIO, 0, &test_ih2);
assert(retval == EINVAL);
- usleep(SWI_SLEEP_TIME);
+ sleep(SWI_SLEEP_TIME);
assert(argument == HANDLER_NOT_VISITED);
}
diff --git a/testsuite/timeout01/Makefile b/testsuite/timeout01/Makefile
deleted file mode 100644
index 78a4b7ed..00000000
--- a/testsuite/timeout01/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-include ../../config.inc
-
-APP = timeout01
-PGM=${ARCH}/$(APP).exe
-
-# optional managers required
-MANAGERS=all
-
-# C source names
-C_FILES = init.c timeout_helper.c timeout_test.c
-C_O_FILES = $(C_FILES:%.c=${ARCH}/%.o)
-
-AM_CPPFLAGS += -I $(INSTALL_BASE)/include
-LINK_LIBS += $(INSTALL_BASE)/libbsd.a ${REL_ARGS}
-CFLAGS += $(DEPFLAGS) $(GCCFLAGS) $(AM_CPPFLAGS) -Wno-unused -Wl,-Map,$(APP).map
-
-include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
-include $(RTEMS_CUSTOM)
-include $(PROJECT_ROOT)/make/leaf.cfg
-
-OBJS= $(C_O_FILES)
-CLEAN_ADDITIONS += $(APP).map *.dep
-
-all: ${ARCH} $(PGM)
-
-$(PGM): $(OBJS)
- -$(make-exe)
diff --git a/testsuite/timeout01/init.c b/testsuite/timeout01/init.c
index f1bd5291..e632bb0a 100644
--- a/testsuite/timeout01/init.c
+++ b/testsuite/timeout01/init.c
@@ -35,7 +35,7 @@
#include <rtems.h>
-#include <freebsd/bsd.h>
+#include <rtems/bsd/bsd.h>
#include "timeout_test.h"
#include "timeout_helper.h"
diff --git a/testsuite/timeout01/timeout_helper.c b/testsuite/timeout01/timeout_helper.c
index 88d8510d..060fef0b 100644
--- a/testsuite/timeout01/timeout_helper.c
+++ b/testsuite/timeout01/timeout_helper.c
@@ -29,10 +29,10 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
+#include <sys/param.h>
+#include <sys/systm.h>
#include <assert.h>
#include <malloc.h>
diff --git a/testsuite/timeout01/timeout_test.c b/testsuite/timeout01/timeout_test.c
index b89feb84..8ce0b41e 100644
--- a/testsuite/timeout01/timeout_test.c
+++ b/testsuite/timeout01/timeout_test.c
@@ -34,15 +34,15 @@
#include <stdio.h>
#include <unistd.h>
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/rwlock.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/rwlock.h>
#define TIMEOUT_MILLISECONDS (100)
diff --git a/testsuite/usb01/Makefile b/testsuite/usb01/Makefile
deleted file mode 100644
index d12a215d..00000000
--- a/testsuite/usb01/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
-
-include ../../config.inc
-
-APP=usb01
-PGM=${ARCH}/$(APP).exe
-
-include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
-include $(RTEMS_CUSTOM)
-include $(PROJECT_ROOT)/make/leaf.cfg
-
-C_PIECES = init test-file-system
-C_O_FILES = $(C_PIECES:%=%.o)
-C_DEP_FILES = $(C_PIECES:%=%.dep)
-
-OBJS= $(C_O_FILES)
-
-DEPFLAGS = -MT $@ -MD -MP -MF $*.dep
-AM_CPPFLAGS += -I $(INSTALL_BASE)/include -I.
-CLEAN_ADDITIONS += $(APP).exe $(ARCH)/$(APP).map $(C_DEP_FILES)
-CLEAN_ADDITIONS += $(C_DEP_FILES)
-
-CFLAGS += $(DEPFLAGS) $(GCCFLAGS) $(AM_CPPFLAGS)
-CFLAGS += -Wno-unused
-CFLAGS += -Wl,-Map,$(ARCH)/$(APP).map
-
-LINK_LIBS += $(INSTALL_BASE)/libbsd.a
-
-all: $(ARCH) $(PGM)
-
-$(PGM): $(C_O_FILES)
- $(make-exe)
-
--include $(C_DEP_FILES)
diff --git a/testsuite/usb01/init.c b/testsuite/usb01/init.c
index 0bde78d7..517d1544 100644
--- a/testsuite/usb01/init.c
+++ b/testsuite/usb01/init.c
@@ -31,7 +31,7 @@
#include <rtems/shell.h>
#include <rtems/console.h>
#include <rtems/diskdevs.h>
-#include <freebsd/bsd.h>
+#include <rtems/bsd/bsd.h>
#include "test.h"
@@ -295,19 +295,9 @@ static void Init(rtems_task_argument arg)
#define CONFIGURE_BDBUF_CACHE_MEMORY_SIZE (WORKER_COUNT * 512)
#define CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS 0
-#define CONFIGURE_MAXIMUM_TASKS 64
-#define CONFIGURE_MAXIMUM_DRIVERS 4
-#define CONFIGURE_MAXIMUM_SEMAPHORES 64
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 4
-#define CONFIGURE_MAXIMUM_TIMERS 64
-#define CONFIGURE_MAXIMUM_PERIODS 4
-#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 1
-#define CONFIGURE_MAXIMUM_BARRIERS 1
+#define CONFIGURE_UNLIMITED_OBJECTS
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 32
-#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 64
-
-#define CONFIGURE_EXTRA_TASK_STACKS (1 * 1024 * 1024)
+#define CONFIGURE_UNIFIED_WORK_AREAS
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
diff --git a/testsuite/usb01/usb-sysinit.h b/testsuite/usb01/usb-sysinit.h
index 367ea69a..0ee09dd1 100644
--- a/testsuite/usb01/usb-sysinit.h
+++ b/testsuite/usb01/usb-sysinit.h
@@ -20,7 +20,7 @@
* http://www.rtems.com/license/LICENSE.
*/
-#include <freebsd/machine/rtems-bsd-sysinit.h>
+#include <machine/rtems-bsd-sysinit.h>
#include <bsp.h>