From 0a57e1db23218393483a356c07868413a45caeeb Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 6 Nov 2013 09:35:05 +0100 Subject: Reduce divergence from FreeBSD sources --- freebsd-to-rtems.py | 7 +- freebsd/lib/libc/net/gethostbydns.c | 26 ++--- freebsd/lib/libc/net/gethostbyht.c | 13 --- freebsd/lib/libc/net/gethostnamadr.c | 4 - freebsd/lib/libc/net/nsdispatch.c | 6 +- freebsd/lib/libc/net/res_config.h | 3 + freebsd/lib/libc/stdio/fgetln.c | 3 +- freebsd/lib/libipsec/policy_token.l | 4 +- freebsd/lib/libmemstat/memstat_all.c | 2 +- freebsd/lib/libmemstat/memstat_malloc.c | 2 +- freebsd/lib/libmemstat/memstat_uma.c | 2 +- freebsd/sbin/ifconfig/ifconfig.c | 3 +- freebsd/sys/arm/arm/legacy.c | 2 - freebsd/sys/arm/pci/pci_bus.c | 8 -- freebsd/sys/avr/avr/legacy.c | 2 - freebsd/sys/avr/pci/pci_bus.c | 8 -- freebsd/sys/bfin/bfin/legacy.c | 2 - freebsd/sys/bfin/pci/pci_bus.c | 8 -- freebsd/sys/cam/cam_ccb.h | 2 +- freebsd/sys/contrib/pf/net/if_pflog.c | 4 +- freebsd/sys/contrib/pf/net/if_pfsync.c | 6 +- freebsd/sys/contrib/pf/net/pf.c | 6 +- freebsd/sys/contrib/pf/net/pf_ioctl.c | 6 +- freebsd/sys/contrib/pf/net/pf_norm.c | 2 +- freebsd/sys/contrib/pf/net/pf_osfp.c | 20 ++-- freebsd/sys/crypto/sha2/sha2.h | 6 +- freebsd/sys/dev/bce/if_bcereg.h | 4 +- freebsd/sys/dev/e1000/e1000_80003es2lan.c | 6 +- freebsd/sys/dev/e1000/e1000_82540.c | 6 +- freebsd/sys/dev/e1000/e1000_82541.c | 6 +- freebsd/sys/dev/e1000/e1000_82542.c | 6 +- freebsd/sys/dev/e1000/e1000_82543.c | 6 +- freebsd/sys/dev/e1000/e1000_82571.c | 6 +- freebsd/sys/dev/e1000/e1000_82575.c | 9 +- freebsd/sys/dev/e1000/e1000_api.c | 6 +- freebsd/sys/dev/e1000/e1000_api.h | 6 +- freebsd/sys/dev/e1000/e1000_hw.h | 54 +++------ freebsd/sys/dev/e1000/e1000_ich8lan.c | 6 +- freebsd/sys/dev/e1000/e1000_mac.c | 6 +- freebsd/sys/dev/e1000/e1000_manage.c | 6 +- freebsd/sys/dev/e1000/e1000_mbx.c | 6 +- freebsd/sys/dev/e1000/e1000_mbx.h | 6 +- freebsd/sys/dev/e1000/e1000_nvm.c | 6 +- freebsd/sys/dev/e1000/e1000_osdep.c | 6 +- freebsd/sys/dev/e1000/e1000_osdep.h | 2 - freebsd/sys/dev/e1000/e1000_phy.c | 6 +- freebsd/sys/dev/e1000/e1000_vf.c | 8 +- freebsd/sys/dev/e1000/e1000_vf.h | 18 +-- freebsd/sys/dev/e1000/if_em.c | 12 +- freebsd/sys/dev/e1000/if_em.h | 6 +- freebsd/sys/dev/e1000/if_igb.c | 13 +-- freebsd/sys/dev/e1000/if_igb.h | 6 +- freebsd/sys/dev/e1000/if_lem.c | 9 +- freebsd/sys/dev/e1000/if_lem.h | 6 +- freebsd/sys/dev/pci/pci.c | 4 - freebsd/sys/dev/pci/pci_user.c | 2 - freebsd/sys/dev/pci/pcib_private.h | 4 +- freebsd/sys/dev/pci/pcivar.h | 2 +- freebsd/sys/dev/usb/controller/uhcireg.h | 95 +++++++++++++++ freebsd/sys/dev/usb/quirk/usb_quirk.c | 6 +- freebsd/sys/dev/usb/usb_dev.c | 12 +- freebsd/sys/h8300/h8300/legacy.c | 2 - freebsd/sys/h8300/pci/pci_bus.c | 8 -- freebsd/sys/i386/i386/legacy.c | 2 - freebsd/sys/i386/include/machine/intr_machdep.h | 6 +- freebsd/sys/i386/pci/pci_bus.c | 8 -- freebsd/sys/isa/isavar.h | 2 +- freebsd/sys/kern/kern_intr.c | 11 +- freebsd/sys/kern/kern_mbuf.c | 22 ++-- freebsd/sys/kern/kern_subr.c | 6 +- freebsd/sys/kern/kern_time.c | 4 +- freebsd/sys/kern/kern_timeout.c | 4 +- freebsd/sys/kern/subr_bus.c | 10 +- freebsd/sys/kern/subr_kobj.c | 2 +- freebsd/sys/kern/sys_generic.c | 4 +- freebsd/sys/kern/uipc_mbuf.c | 46 ++++---- freebsd/sys/kern/uipc_socket.c | 8 +- freebsd/sys/kern/uipc_syscalls.c | 1 + freebsd/sys/lm32/lm32/legacy.c | 2 - freebsd/sys/lm32/pci/pci_bus.c | 8 -- freebsd/sys/m32c/m32c/legacy.c | 2 - freebsd/sys/m32c/pci/pci_bus.c | 8 -- freebsd/sys/m32r/m32r/legacy.c | 2 - freebsd/sys/m32r/pci/pci_bus.c | 8 -- freebsd/sys/m68k/m68k/legacy.c | 2 - freebsd/sys/m68k/pci/pci_bus.c | 8 -- freebsd/sys/mips/mips/legacy.c | 2 - freebsd/sys/mips/pci/pci_bus.c | 8 -- freebsd/sys/net/if_gif.c | 8 +- freebsd/sys/net/if_gre.c | 2 +- freebsd/sys/net/if_stf.c | 2 +- freebsd/sys/net/if_tap.c | 12 +- freebsd/sys/net/if_tun.c | 2 +- freebsd/sys/net/netisr.c | 2 +- freebsd/sys/net/radix_mpath.c | 16 +-- freebsd/sys/net/route.c | 46 ++++---- freebsd/sys/net/rtsock.c | 28 ++--- freebsd/sys/net80211/ieee80211_amrr.c | 2 +- freebsd/sys/net80211/ieee80211_var.h | 4 +- freebsd/sys/netinet/in.c | 44 +++---- freebsd/sys/netinet/in_pcb.c | 11 +- freebsd/sys/netinet/ip_carp.c | 12 +- freebsd/sys/netinet/ip_mroute.c | 12 +- freebsd/sys/netinet/libalias/alias.c | 6 +- freebsd/sys/netinet/libalias/alias_cuseeme.c | 4 +- freebsd/sys/netinet/libalias/alias_db.c | 36 +++--- freebsd/sys/netinet/libalias/alias_dummy.c | 4 +- freebsd/sys/netinet/libalias/alias_ftp.c | 4 +- freebsd/sys/netinet/libalias/alias_irc.c | 28 ++--- freebsd/sys/netinet/libalias/alias_local.h | 2 +- freebsd/sys/netinet/libalias/alias_mod.c | 4 +- freebsd/sys/netinet/libalias/alias_mod.h | 38 +++--- freebsd/sys/netinet/libalias/alias_nbt.c | 4 +- freebsd/sys/netinet/libalias/alias_pptp.c | 6 +- freebsd/sys/netinet/libalias/alias_proxy.c | 4 +- freebsd/sys/netinet/libalias/alias_sctp.c | 6 +- freebsd/sys/netinet/libalias/alias_sctp.h | 21 ++-- freebsd/sys/netinet/libalias/alias_skinny.c | 4 +- freebsd/sys/netinet/libalias/alias_smedia.c | 4 +- freebsd/sys/netinet/libalias/alias_util.c | 4 +- freebsd/sys/netinet/sctp_auth.h | 2 +- freebsd/sys/netinet/sctp_output.c | 6 +- freebsd/sys/netinet/sctp_pcb.c | 6 +- freebsd/sys/netinet/tcp_input.c | 5 +- freebsd/sys/netinet6/in6_pcb.c | 2 +- freebsd/sys/nios2/nios2/legacy.c | 2 - freebsd/sys/nios2/pci/pci_bus.c | 8 -- freebsd/sys/powerpc/pci/pci_bus.c | 8 -- freebsd/sys/powerpc/powerpc/legacy.c | 2 - freebsd/sys/sh/pci/pci_bus.c | 8 -- freebsd/sys/sh/sh/legacy.c | 2 - freebsd/sys/sparc/pci/pci_bus.c | 8 -- freebsd/sys/sparc/sparc/legacy.c | 2 - freebsd/sys/sparc64/pci/pci_bus.c | 8 -- freebsd/sys/sparc64/sparc64/legacy.c | 2 - freebsd/sys/sys/_rmlock.h | 4 +- freebsd/sys/sys/lockmgr.h | 2 +- freebsd/sys/sys/mbuf.h | 13 ++- freebsd/sys/sys/mutex.h | 14 +-- freebsd/sys/sys/pcpu.h | 2 +- freebsd/sys/sys/priv.h | 3 +- freebsd/sys/sys/rmlock.h | 4 +- freebsd/sys/sys/rwlock.h | 3 +- freebsd/sys/sys/sigio.h | 4 +- freebsd/sys/sys/sx.h | 3 +- freebsd/sys/sys/sysctl.h | 4 +- freebsd/sys/sys/sysproto.h | 3 - freebsd/sys/sys/tty.h | 2 - freebsd/sys/sys/unpcb.h | 148 ++++++++++++++++++++++++ freebsd/sys/v850/pci/pci_bus.c | 8 -- freebsd/sys/v850/v850/legacy.c | 2 - freebsd/sys/vm/uma_core.c | 8 +- freebsd/sys/vm/uma_int.h | 22 ++-- freebsd/usr.bin/netstat/bpf.c | 6 +- freebsd/usr.bin/netstat/if.c | 10 +- freebsd/usr.bin/netstat/main.c | 7 -- freebsd/usr.bin/netstat/mbuf.c | 4 +- freebsd/usr.bin/netstat/route.c | 16 +-- freebsd/usr.bin/netstat/unix.c | 8 +- rtemsbsd/include/machine/rtems-bsd-user-space.h | 2 + rtemsbsd/include/rtems/bsd/local/opt_mca.h | 0 rtemsbsd/include/sys/clock.h | 1 + rtemsbsd/include/sys/posix4.h | 1 + rtemsbsd/include/sys/timers.h | 1 + 164 files changed, 693 insertions(+), 786 deletions(-) create mode 100644 freebsd/sys/dev/usb/controller/uhcireg.h create mode 100644 freebsd/sys/sys/unpcb.h create mode 100644 rtemsbsd/include/rtems/bsd/local/opt_mca.h create mode 100644 rtemsbsd/include/sys/clock.h create mode 100644 rtemsbsd/include/sys/posix4.h create mode 100644 rtemsbsd/include/sys/timers.h diff --git a/freebsd-to-rtems.py b/freebsd-to-rtems.py index bd202977..0dbeb86d 100755 --- a/freebsd-to-rtems.py +++ b/freebsd-to-rtems.py @@ -191,7 +191,10 @@ def revertFixIncludes(data): # fix include paths inside a C or .h file def fixLocalIncludes(data): - data = re.sub('#include "([^"]*)"', '#include ', data) + data = re.sub('#include "opt_([^"]*)"', '#include ', data) + data = re.sub('#include "([^"]*)_if.h"', '#include ', data) + data = re.sub('#include "miidevs([^"]*)"', '#include ', data) + data = re.sub('#include "usbdevs([^"]*)"', '#include ', data) return data # revert fixing the include paths inside a C or .h file @@ -770,6 +773,7 @@ base.addHeaderFiles( 'sys/sys/ttycom.h', 'sys/sys/ucred.h', 'sys/sys/un.h', + 'sys/sys/unpcb.h', 'sys/sys/vmmeter.h', 'sys/vm/uma_dbg.h', 'sys/vm/uma.h', @@ -910,6 +914,7 @@ devUsbController.addHeaderFiles( 'sys/dev/usb/controller/ohcireg.h', 'sys/dev/usb/controller/ehci.h', 'sys/dev/usb/controller/ehcireg.h', + 'sys/dev/usb/controller/uhcireg.h', ] ) devUsbController.addSourceFiles( diff --git a/freebsd/lib/libc/net/gethostbydns.c b/freebsd/lib/libc/net/gethostbydns.c index dce98b14..d1c62590 100644 --- a/freebsd/lib/libc/net/gethostbydns.c +++ b/freebsd/lib/libc/net/gethostbydns.c @@ -90,7 +90,7 @@ static void addrsort(char **, int, res_state); #endif #ifdef DEBUG -static void DPRINTF(char *, int, res_state) __printflike(1, 0); +static void dprintf(char *, int, res_state) __printflike(1, 0); #endif #define MAXPACKET (64*1024) @@ -109,7 +109,7 @@ int _dns_ttl_; #ifdef DEBUG static void -DPRINTF(msg, num, res) +dprintf(msg, num, res) char *msg; int num; res_state res; @@ -122,7 +122,7 @@ DPRINTF(msg, num, res) } } #else -# define DPRINTF(msg, num, res) /*nada*/ +# define dprintf(msg, num, res) /*nada*/ #endif #define BOUNDED_INCR(x) \ @@ -340,7 +340,6 @@ gethostanswer(const querybuf *answer, int anslen, const char *qname, int qtype, break; #else he->h_name = bp; -#ifdef INET6 if (statp->options & RES_USE_INET6) { n = strlen(bp) + 1; /* for the \0 */ if (n >= MAXHOSTNAMELEN) { @@ -350,7 +349,6 @@ gethostanswer(const querybuf *answer, int anslen, const char *qname, int qtype, bp += n; _map_v4v6_hostent(he, &bp, ep); } -#endif RES_SET_H_ERRNO(statp, NETDB_SUCCESS); return (0); #endif @@ -377,13 +375,13 @@ gethostanswer(const querybuf *answer, int anslen, const char *qname, int qtype, bp += sizeof(align) - ((u_long)bp % sizeof(align)); if (bp + n >= ep) { - DPRINTF("size (%d) too big\n", n, statp); + dprintf("size (%d) too big\n", n, statp); had_error++; continue; } if (hap >= &hed->h_addr_ptrs[_MAXADDRS-1]) { if (!toobig++) - DPRINTF("Too many addresses (%d)\n", + dprintf("Too many addresses (%d)\n", _MAXADDRS, statp); cp += n; continue; @@ -397,7 +395,7 @@ gethostanswer(const querybuf *answer, int anslen, const char *qname, int qtype, } break; default: - DPRINTF("Impossible condition (type=%d)\n", type, + dprintf("Impossible condition (type=%d)\n", type, statp); RES_SET_H_ERRNO(statp, NO_RECOVERY); return (-1); @@ -426,10 +424,8 @@ gethostanswer(const querybuf *answer, int anslen, const char *qname, int qtype, he->h_name = bp; bp += n; } -#ifdef INET6 if (statp->options & RES_USE_INET6) _map_v4v6_hostent(he, &bp, ep); -#endif RES_SET_H_ERRNO(statp, NETDB_SUCCESS); return (0); } @@ -526,12 +522,12 @@ _dns_gethostbyname(void *rval, void *cb_data, va_list ap) n = res_nsearch(statp, name, C_IN, type, buf->buf, sizeof(buf->buf)); if (n < 0) { free(buf); - DPRINTF("res_nsearch failed (%d)\n", n, statp); + dprintf("res_nsearch failed (%d)\n", n, statp); *h_errnop = statp->res_h_errno; return (NS_NOTFOUND); } else if (n > sizeof(buf->buf)) { free(buf); - DPRINTF("static buffer is too small (%d)\n", n, statp); + dprintf("static buffer is too small (%d)\n", n, statp); *h_errnop = statp->res_h_errno; return (NS_UNAVAIL); } @@ -633,13 +629,13 @@ _dns_gethostbyaddr(void *rval, void *cb_data, va_list ap) sizeof buf->buf); if (n < 0) { free(buf); - DPRINTF("res_nquery failed (%d)\n", n, statp); + dprintf("res_nquery failed (%d)\n", n, statp); *h_errnop = statp->res_h_errno; return (NS_UNAVAIL); } if (n > sizeof buf->buf) { free(buf); - DPRINTF("static buffer is too small (%d)\n", n, statp); + dprintf("static buffer is too small (%d)\n", n, statp); *h_errnop = statp->res_h_errno; return (NS_UNAVAIL); } @@ -703,13 +699,11 @@ _dns_gethostbyaddr(void *rval, void *cb_data, va_list ap) memcpy(hed->host_addr, uaddr, len); hed->h_addr_ptrs[0] = (char *)hed->host_addr; hed->h_addr_ptrs[1] = NULL; -#ifdef INET6 if (af == AF_INET && (statp->options & RES_USE_INET6)) { _map_v4v6_address((char*)hed->host_addr, (char*)hed->host_addr); he.h_addrtype = AF_INET6; he.h_length = NS_IN6ADDRSZ; } -#endif if (__copy_hostent(&he, hptr, buffer, buflen) != 0) { *errnop = errno; RES_SET_H_ERRNO(statp, NETDB_INTERNAL); diff --git a/freebsd/lib/libc/net/gethostbyht.c b/freebsd/lib/libc/net/gethostbyht.c index 3814ae7d..f373fcbd 100644 --- a/freebsd/lib/libc/net/gethostbyht.c +++ b/freebsd/lib/libc/net/gethostbyht.c @@ -115,7 +115,6 @@ gethostent_p(struct hostent *he, struct hostent_data *hed, int mapped, if (!(cp = strpbrk(p, " \t"))) goto again; *cp++ = '\0'; -#ifdef INET6 if (inet_pton(AF_INET6, p, hed->host_addr) > 0) { af = AF_INET6; len = IN6ADDRSZ; @@ -132,12 +131,6 @@ gethostent_p(struct hostent *he, struct hostent_data *hed, int mapped, } else { goto again; } -#else - if (inet_pton(AF_INET, p, hed->host_addr) > 0) { - af = AF_INET; - len = INADDRSZ; - } -#endif hed->h_addr_ptrs[0] = (char *)hed->host_addr; hed->h_addr_ptrs[1] = NULL; he->h_addr_list = hed->h_addr_ptrs; @@ -200,10 +193,8 @@ gethostent_r(struct hostent *hptr, char *buffer, size_t buflen, *h_errnop = statp->res_h_errno; return (-1); } -#ifdef INET6 if (gethostent_p(&he, hed, statp->options & RES_USE_INET6, statp) != 0) return (-1); -#endif if (__copy_hostent(&he, hptr, buffer, buflen) != 0) { RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; @@ -263,14 +254,12 @@ _ht_gethostbyname(void *rval, void *cb_data, va_list ap) while ((error = gethostent_p(&he, hed, 0, statp)) == 0) { if (he.h_addrtype != af) continue; -#ifdef INET6 if (he.h_addrtype == AF_INET && statp->options & RES_USE_INET6) { _map_v4v6_address(he.h_addr, he.h_addr); he.h_length = IN6ADDRSZ; he.h_addrtype = AF_INET6; } -#endif if (strcasecmp(he.h_name, name) == 0) break; for (cp = he.h_aliases; *cp != 0; cp++) @@ -328,7 +317,6 @@ _ht_gethostbyaddr(void *rval, void *cb_data, va_list ap) _sethosthtent(0, hed); while ((error = gethostent_p(&he, hed, 0, statp)) == 0) -#ifdef INET6 if (he.h_addrtype == af && !bcmp(he.h_addr, addr, len)) { if (he.h_addrtype == AF_INET && statp->options & RES_USE_INET6) { @@ -338,7 +326,6 @@ _ht_gethostbyaddr(void *rval, void *cb_data, va_list ap) } break; } -#endif _endhosthtent(hed); if (error != 0) diff --git a/freebsd/lib/libc/net/gethostnamadr.c b/freebsd/lib/libc/net/gethostnamadr.c index 5c158467..7960be7c 100644 --- a/freebsd/lib/libc/net/gethostnamadr.c +++ b/freebsd/lib/libc/net/gethostnamadr.c @@ -458,23 +458,19 @@ fakeaddr(const char *name, int af, struct hostent *hp, char *buf, } strncpy(hed->hostbuf, name, MAXDNAME); hed->hostbuf[MAXDNAME] = '\0'; -#ifdef INET6 if (af == AF_INET && (statp->options & RES_USE_INET6) != 0U) { _map_v4v6_address((char *)hed->host_addr, (char *)hed->host_addr); af = AF_INET6; } -#endif he.h_addrtype = af; switch(af) { case AF_INET: he.h_length = NS_INADDRSZ; break; -#ifdef INET6 case AF_INET6: he.h_length = NS_IN6ADDRSZ; break; -#endif default: errno = EAFNOSUPPORT; RES_SET_H_ERRNO(statp, NETDB_INTERNAL); diff --git a/freebsd/lib/libc/net/nsdispatch.c b/freebsd/lib/libc/net/nsdispatch.c index 621ecad3..8caafdcc 100644 --- a/freebsd/lib/libc/net/nsdispatch.c +++ b/freebsd/lib/libc/net/nsdispatch.c @@ -519,13 +519,13 @@ nss_load_module(const char *source, nss_module_register_fn reg_fn) goto fin; } } -#endif +#endif /* __rtems__ */ mod.mtab = fn(mod.name, &mod.mtabsize, &mod.unregister); if (mod.mtab == NULL || mod.mtabsize == 0) { #ifndef __rtems__ if (mod.handle != nss_builtin_handle) (void)dlclose(mod.handle); -#endif +#endif /* __rtems__ */ mod.handle = NULL; nss_log(LOG_ERR, "%s, registration failed", mod.name); goto fin; @@ -552,7 +552,7 @@ ns_mod_free(ns_mod *mod) #ifndef __rtems__ if (mod->handle != nss_builtin_handle) (void)dlclose(mod->handle); -#endif +#endif /* __rtems__ */ } diff --git a/freebsd/lib/libc/net/res_config.h b/freebsd/lib/libc/net/res_config.h index 05909bca..411542d1 100644 --- a/freebsd/lib/libc/net/res_config.h +++ b/freebsd/lib/libc/net/res_config.h @@ -4,3 +4,6 @@ #define RESOLVSORT /* allow sorting of addresses in gethostbyname */ #undef SUNSECURITY /* verify gethostbyaddr() calls - WE DONT NEED IT */ #define MULTI_PTRS_ARE_ALIASES 1 /* fold multiple PTR records into aliases */ +#ifdef __rtems__ +#define dprintf gethostbydns_dprintf +#endif /* __rtems__ */ diff --git a/freebsd/lib/libc/stdio/fgetln.c b/freebsd/lib/libc/stdio/fgetln.c index d27a7c4e..1a7b0514 100644 --- a/freebsd/lib/libc/stdio/fgetln.c +++ b/freebsd/lib/libc/stdio/fgetln.c @@ -106,9 +106,8 @@ fgetln(FILE *fp, size_t *lenp) ret = (char *)fp->_p; *lenp = len = p - fp->_p; #ifndef __rtems__ - fp->_flags |= __SMOD; -#endif +#endif /* __rtems__ */ fp->_r -= len; fp->_p = p; FUNLOCKFILE(fp); diff --git a/freebsd/lib/libipsec/policy_token.l b/freebsd/lib/libipsec/policy_token.l index d4167a4f..cc70ea90 100644 --- a/freebsd/lib/libipsec/policy_token.l +++ b/freebsd/lib/libipsec/policy_token.l @@ -49,10 +49,8 @@ #ifdef __rtems__ /* XXX - Jennifer doesn't know where to get this from */ static YY_BUFFER_STATE yy_current_buffer; -#endif - +#endif /* __rtems__ */ #include "y.tab.h" - #define yylval __libipsecyylval /* XXX */ int yylex(void); diff --git a/freebsd/lib/libmemstat/memstat_all.c b/freebsd/lib/libmemstat/memstat_all.c index 4dc32666..c76a8528 100644 --- a/freebsd/lib/libmemstat/memstat_all.c +++ b/freebsd/lib/libmemstat/memstat_all.c @@ -59,4 +59,4 @@ memstat_kvm_all(struct memory_type_list *mtlp, void *kvm_handle) return (-1); return (0); } -#endif +#endif /* __rtems__ */ diff --git a/freebsd/lib/libmemstat/memstat_malloc.c b/freebsd/lib/libmemstat/memstat_malloc.c index 2d47b694..1f83de33 100644 --- a/freebsd/lib/libmemstat/memstat_malloc.c +++ b/freebsd/lib/libmemstat/memstat_malloc.c @@ -409,4 +409,4 @@ memstat_kvm_malloc(struct memory_type_list *list, void *kvm_handle) return (0); } -#endif +#endif /* __rtems__ */ diff --git a/freebsd/lib/libmemstat/memstat_uma.c b/freebsd/lib/libmemstat/memstat_uma.c index 63153d82..127a7662 100644 --- a/freebsd/lib/libmemstat/memstat_uma.c +++ b/freebsd/lib/libmemstat/memstat_uma.c @@ -465,4 +465,4 @@ skip_percpu: free(ucp_array); return (0); } -#endif +#endif /* __rtems__ */ diff --git a/freebsd/sbin/ifconfig/ifconfig.c b/freebsd/sbin/ifconfig/ifconfig.c index 0f368668..0772b647 100644 --- a/freebsd/sbin/ifconfig/ifconfig.c +++ b/freebsd/sbin/ifconfig/ifconfig.c @@ -77,7 +77,6 @@ static const char rcsid[] = #include #include #include - #include #include #include @@ -1146,7 +1145,7 @@ ifmaybeload(const char *name) /* not present, we should try to load it */ kldload(ifkind); -#endif +#endif /* __rtems__ */ } static struct cmd basic_cmds[] = { diff --git a/freebsd/sys/arm/arm/legacy.c b/freebsd/sys/arm/arm/legacy.c index d2b0a78a..c81ccc5e 100644 --- a/freebsd/sys/arm/arm/legacy.c +++ b/freebsd/sys/arm/arm/legacy.c @@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef __rtems__ #include -#endif /* __rtems__ */ #ifdef DEV_MCA #include #endif diff --git a/freebsd/sys/arm/pci/pci_bus.c b/freebsd/sys/arm/pci/pci_bus.c index 53446262..ad0342ec 100644 --- a/freebsd/sys/arm/pci/pci_bus.c +++ b/freebsd/sys/arm/pci/pci_bus.c @@ -60,7 +60,6 @@ static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin); #endif /* __rtems__ */ - int legacy_pcib_maxslots(device_t dev) { @@ -69,15 +68,9 @@ legacy_pcib_maxslots(device_t dev) /* 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)); } @@ -514,7 +507,6 @@ legacy_pcib_attach(device_t dev) if (pir != NULL) device_probe_and_attach(pir); } -#else /* __rtems__ */ #endif /* __rtems__ */ device_add_child(dev, "pci", bus); return bus_generic_attach(dev); diff --git a/freebsd/sys/avr/avr/legacy.c b/freebsd/sys/avr/avr/legacy.c index d2b0a78a..c81ccc5e 100644 --- a/freebsd/sys/avr/avr/legacy.c +++ b/freebsd/sys/avr/avr/legacy.c @@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef __rtems__ #include -#endif /* __rtems__ */ #ifdef DEV_MCA #include #endif diff --git a/freebsd/sys/avr/pci/pci_bus.c b/freebsd/sys/avr/pci/pci_bus.c index 53446262..ad0342ec 100644 --- a/freebsd/sys/avr/pci/pci_bus.c +++ b/freebsd/sys/avr/pci/pci_bus.c @@ -60,7 +60,6 @@ static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin); #endif /* __rtems__ */ - int legacy_pcib_maxslots(device_t dev) { @@ -69,15 +68,9 @@ legacy_pcib_maxslots(device_t dev) /* 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)); } @@ -514,7 +507,6 @@ legacy_pcib_attach(device_t dev) if (pir != NULL) device_probe_and_attach(pir); } -#else /* __rtems__ */ #endif /* __rtems__ */ device_add_child(dev, "pci", bus); return bus_generic_attach(dev); diff --git a/freebsd/sys/bfin/bfin/legacy.c b/freebsd/sys/bfin/bfin/legacy.c index d2b0a78a..c81ccc5e 100644 --- a/freebsd/sys/bfin/bfin/legacy.c +++ b/freebsd/sys/bfin/bfin/legacy.c @@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef __rtems__ #include -#endif /* __rtems__ */ #ifdef DEV_MCA #include #endif diff --git a/freebsd/sys/bfin/pci/pci_bus.c b/freebsd/sys/bfin/pci/pci_bus.c index 53446262..ad0342ec 100644 --- a/freebsd/sys/bfin/pci/pci_bus.c +++ b/freebsd/sys/bfin/pci/pci_bus.c @@ -60,7 +60,6 @@ static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin); #endif /* __rtems__ */ - int legacy_pcib_maxslots(device_t dev) { @@ -69,15 +68,9 @@ legacy_pcib_maxslots(device_t dev) /* 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)); } @@ -514,7 +507,6 @@ legacy_pcib_attach(device_t dev) if (pir != NULL) device_probe_and_attach(pir); } -#else /* __rtems__ */ #endif /* __rtems__ */ device_add_child(dev, "pci", bus); return bus_generic_attach(dev); diff --git a/freebsd/sys/cam/cam_ccb.h b/freebsd/sys/cam/cam_ccb.h index 3e85eacb..ced8cca1 100644 --- a/freebsd/sys/cam/cam_ccb.h +++ b/freebsd/sys/cam/cam_ccb.h @@ -44,7 +44,7 @@ #ifdef __rtems__ #include -#endif /* __rtems__ */ +#endif /* __rtems__ */ /* General allocation length definitions for CCB structures */ #define IOCDBLEN CAM_MAX_CDBLEN /* Space for CDB bytes/pointer */ diff --git a/freebsd/sys/contrib/pf/net/if_pflog.c b/freebsd/sys/contrib/pf/net/if_pflog.c index 8e33eaf3..5efbf76d 100644 --- a/freebsd/sys/contrib/pf/net/if_pflog.c +++ b/freebsd/sys/contrib/pf/net/if_pflog.c @@ -57,8 +57,8 @@ __FBSDID("$FreeBSD$"); #endif #else /* ! __FreeBSD__ */ -#include -#include +#include "bpfilter.h" +#include "pflog.h" #endif /* __FreeBSD__ */ #include diff --git a/freebsd/sys/contrib/pf/net/if_pfsync.c b/freebsd/sys/contrib/pf/net/if_pfsync.c index f4fe498f..24c80e3d 100644 --- a/freebsd/sys/contrib/pf/net/if_pfsync.c +++ b/freebsd/sys/contrib/pf/net/if_pfsync.c @@ -105,7 +105,7 @@ __FBSDID("$FreeBSD$"); #endif /* INET6 */ #ifndef __FreeBSD__ -#include +#include "carp.h" #endif #if NCARP > 0 #include @@ -115,8 +115,8 @@ __FBSDID("$FreeBSD$"); #include #ifndef __FreeBSD__ -#include -#include +#include "bpfilter.h" +#include "pfsync.h" #endif #define PFSYNC_MINMTU \ diff --git a/freebsd/sys/contrib/pf/net/pf.c b/freebsd/sys/contrib/pf/net/pf.c index e24cd26c..70123329 100644 --- a/freebsd/sys/contrib/pf/net/pf.c +++ b/freebsd/sys/contrib/pf/net/pf.c @@ -69,9 +69,9 @@ __FBSDID("$FreeBSD$"); #endif #else -#include -#include -#include +#include "bpfilter.h" +#include "pflog.h" +#include "pfsync.h" #endif #include diff --git a/freebsd/sys/contrib/pf/net/pf_ioctl.c b/freebsd/sys/contrib/pf/net/pf_ioctl.c index b380701e..7479b510 100644 --- a/freebsd/sys/contrib/pf/net/pf_ioctl.c +++ b/freebsd/sys/contrib/pf/net/pf_ioctl.c @@ -65,9 +65,9 @@ __FBSDID("$FreeBSD$"); #endif #else -#include -#include -#include +#include "bpfilter.h" +#include "pflog.h" +#include "pfsync.h" #endif #include diff --git a/freebsd/sys/contrib/pf/net/pf_norm.c b/freebsd/sys/contrib/pf/net/pf_norm.c index de0ff245..a59c3fd8 100644 --- a/freebsd/sys/contrib/pf/net/pf_norm.c +++ b/freebsd/sys/contrib/pf/net/pf_norm.c @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); #define NPFLOG 0 #endif #else -#include +#include "pflog.h" #endif #include diff --git a/freebsd/sys/contrib/pf/net/pf_osfp.c b/freebsd/sys/contrib/pf/net/pf_osfp.c index 0995797a..7ff79c00 100644 --- a/freebsd/sys/contrib/pf/net/pf_osfp.c +++ b/freebsd/sys/contrib/pf/net/pf_osfp.c @@ -135,11 +135,6 @@ pf_osfp_fingerprint_hdr(const struct ip *ip, const struct ip6_hdr *ip6, const st #else char srcname[NI_MAXHOST]; #endif -#ifdef __rtems__ -#ifdef INET6 -char ip6buf[INET6_ADDRSTRLEN]; -#endif //INET6 -#endif //__rtems__ if ((tcp->th_flags & (TH_SYN|TH_ACK)) != TH_SYN) return (NULL); @@ -176,6 +171,9 @@ char ip6buf[INET6_ADDRSTRLEN]; #ifndef _KERNEL struct sockaddr_in6 sin6; #endif +#ifdef __rtems__ + char ip6buf[INET6_ADDRSTRLEN]; +#endif /* __rtems__ */ /* jumbo payload? */ fp.fp_psize = sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen); @@ -184,12 +182,12 @@ char ip6buf[INET6_ADDRSTRLEN]; fp.fp_flags |= PF_OSFP_INET6; #ifdef _KERNEL #ifndef __rtems__ - strlcpy(srcname, ip6_sprintf((struct in6_addr *)&ip6->ip6_src), + strlcpy(srcname, ip6_sprintf((struct in6_addr *)&ip6->ip6_src), sizeof(srcname)); -#else - strlcpy(srcname, ip6_sprintf(&ip6buf, (struct in6_addr *)&ip6->ip6_src), - sizeof(srcname)); -#endif +#else /* __rtems__ */ + strlcpy(srcname, ip6_sprintf(ip6buf, (struct in6_addr *)&ip6->ip6_src), + sizeof(srcname)); +#endif /* __rtems__ */ #else memset(&sin6, 0, sizeof(sin6)); sin6.sin6_family = AF_INET6; @@ -322,7 +320,7 @@ pf_osfp_initialize(void) { #if defined(__FreeBSD__) && defined(_KERNEL) int error = ENOMEM; - + do { pf_osfp_entry_pl = pf_osfp_pl = NULL; UMA_CREATE(pf_osfp_entry_pl, struct pf_osfp_entry, "pfospfen"); diff --git a/freebsd/sys/crypto/sha2/sha2.h b/freebsd/sys/crypto/sha2/sha2.h index 446d2ea6..12da95c9 100644 --- a/freebsd/sys/crypto/sha2/sha2.h +++ b/freebsd/sys/crypto/sha2/sha2.h @@ -36,8 +36,8 @@ * */ -#ifndef __SHA2_HH__ -#define __SHA2_HH__ +#ifndef __SHA2_H__ +#define __SHA2_H__ #ifdef __cplusplus extern "C" { @@ -137,5 +137,5 @@ char* SHA512_Data(const u_int8_t*, size_t, char[SHA512_DIGEST_STRING_LENGTH]); } #endif /* __cplusplus */ -#endif /* __SHA2_HH__ */ +#endif /* __SHA2_H__ */ diff --git a/freebsd/sys/dev/bce/if_bcereg.h b/freebsd/sys/dev/bce/if_bcereg.h index 14b5affe..b043df5b 100644 --- a/freebsd/sys/dev/bce/if_bcereg.h +++ b/freebsd/sys/dev/bce/if_bcereg.h @@ -29,8 +29,8 @@ * $FreeBSD$ */ -#ifndef _BCEREG_HH_DEFINED -#define _BCEREG_HH_DEFINED +#ifndef _BCEREG_H_DEFINED +#define _BCEREG_H_DEFINED #ifdef HAVE_KERNEL_OPTION_HEADERS #include diff --git a/freebsd/sys/dev/e1000/e1000_80003es2lan.c b/freebsd/sys/dev/e1000/e1000_80003es2lan.c index cf8fef3b..ea5e88c1 100644 --- a/freebsd/sys/dev/e1000/e1000_80003es2lan.c +++ b/freebsd/sys/dev/e1000/e1000_80003es2lan.c @@ -39,11 +39,7 @@ * 80003ES2LAN Gigabit Ethernet Controller (Serdes) */ -#ifdef __rtems__ -#include -#else -#include -#endif +#include "e1000_api.h" static s32 e1000_init_phy_params_80003es2lan(struct e1000_hw *hw); static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw); diff --git a/freebsd/sys/dev/e1000/e1000_82540.c b/freebsd/sys/dev/e1000/e1000_82540.c index fabc2652..c769c901 100644 --- a/freebsd/sys/dev/e1000/e1000_82540.c +++ b/freebsd/sys/dev/e1000/e1000_82540.c @@ -45,11 +45,7 @@ * 82546GB Gigabit Ethernet Controller */ -#ifdef __rtems__ -#include -#else -#include -#endif +#include "e1000_api.h" static s32 e1000_init_phy_params_82540(struct e1000_hw *hw); static s32 e1000_init_nvm_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 7a02b59f..6bfbb33b 100644 --- a/freebsd/sys/dev/e1000/e1000_82541.c +++ b/freebsd/sys/dev/e1000/e1000_82541.c @@ -43,11 +43,7 @@ * 82547GI Gigabit Ethernet Controller */ -#ifdef __rtems__ -#include -#else -#include -#endif +#include "e1000_api.h" static s32 e1000_init_phy_params_82541(struct e1000_hw *hw); static s32 e1000_init_nvm_params_82541(struct e1000_hw *hw); diff --git a/freebsd/sys/dev/e1000/e1000_82542.c b/freebsd/sys/dev/e1000/e1000_82542.c index bbcfcbf6..8b4ce19f 100644 --- a/freebsd/sys/dev/e1000/e1000_82542.c +++ b/freebsd/sys/dev/e1000/e1000_82542.c @@ -38,11 +38,7 @@ * 82542 Gigabit Ethernet Controller */ -#ifdef __rtems__ -#include -#else -#include -#endif +#include "e1000_api.h" static s32 e1000_init_phy_params_82542(struct e1000_hw *hw); static s32 e1000_init_nvm_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 0d9f9e14..47cf69c4 100644 --- a/freebsd/sys/dev/e1000/e1000_82543.c +++ b/freebsd/sys/dev/e1000/e1000_82543.c @@ -43,11 +43,7 @@ * 82544GC Gigabit Ethernet Controller (LOM) */ -#ifdef __rtems__ -#include -#else -#include -#endif +#include "e1000_api.h" static s32 e1000_init_phy_params_82543(struct e1000_hw *hw); static s32 e1000_init_nvm_params_82543(struct e1000_hw *hw); diff --git a/freebsd/sys/dev/e1000/e1000_82571.c b/freebsd/sys/dev/e1000/e1000_82571.c index 28889c15..e64e8fa6 100644 --- a/freebsd/sys/dev/e1000/e1000_82571.c +++ b/freebsd/sys/dev/e1000/e1000_82571.c @@ -50,11 +50,7 @@ * 82583V Gigabit Network Connection */ -#ifdef __rtems__ -#include -#else -#include -#endif +#include "e1000_api.h" static s32 e1000_acquire_nvm_82571(struct e1000_hw *hw); static void e1000_release_nvm_82571(struct e1000_hw *hw); diff --git a/freebsd/sys/dev/e1000/e1000_82575.c b/freebsd/sys/dev/e1000/e1000_82575.c index 2910c078..b6356b05 100644 --- a/freebsd/sys/dev/e1000/e1000_82575.c +++ b/freebsd/sys/dev/e1000/e1000_82575.c @@ -44,13 +44,8 @@ * I350 Gigabit Network Connection */ -#ifdef __rtems__ -#include -#include -#else -#include -#include -#endif /* __rtems__ */ +#include "e1000_api.h" +#include "e1000_i210.h" static s32 e1000_init_phy_params_82575(struct e1000_hw *hw); static s32 e1000_init_mac_params_82575(struct e1000_hw *hw); diff --git a/freebsd/sys/dev/e1000/e1000_api.c b/freebsd/sys/dev/e1000/e1000_api.c index 009a89cc..40a1dd3f 100644 --- a/freebsd/sys/dev/e1000/e1000_api.c +++ b/freebsd/sys/dev/e1000/e1000_api.c @@ -34,11 +34,7 @@ ******************************************************************************/ /*$FreeBSD$*/ -#ifdef __rtems__ -#include -#else -#include -#endif +#include "e1000_api.h" /** * e1000_init_mac_params - Initialize MAC function pointers diff --git a/freebsd/sys/dev/e1000/e1000_api.h b/freebsd/sys/dev/e1000/e1000_api.h index 3dc5a3fd..69db1be9 100644 --- a/freebsd/sys/dev/e1000/e1000_api.h +++ b/freebsd/sys/dev/e1000/e1000_api.h @@ -35,11 +35,7 @@ #ifndef _E1000_API_H_ #define _E1000_API_H_ -#ifdef __rtems__ -#include -#else -#include -#endif +#include "e1000_hw.h" extern void e1000_init_function_pointers_82542(struct e1000_hw *hw); extern void e1000_init_function_pointers_82543(struct e1000_hw *hw); diff --git a/freebsd/sys/dev/e1000/e1000_hw.h b/freebsd/sys/dev/e1000/e1000_hw.h index e47a7593..e8a8c174 100644 --- a/freebsd/sys/dev/e1000/e1000_hw.h +++ b/freebsd/sys/dev/e1000/e1000_hw.h @@ -35,15 +35,9 @@ #ifndef _E1000_HW_H_ #define _E1000_HW_H_ -#ifdef __rtems__ -#include -#include -#include -#else -#include -#include -#include -#endif +#include "e1000_osdep.h" +#include "e1000_regs.h" +#include "e1000_defines.h" struct e1000_hw; @@ -659,19 +653,11 @@ struct e1000_host_mng_command_info { u8 command_data[E1000_HI_MAX_MNG_DATA_LENGTH]; }; -#ifdef __rtems__ -#include -#include -#include -#include -#include -#else -#include -#include -#include -#include -#include -#endif +#include "e1000_mac.h" +#include "e1000_phy.h" +#include "e1000_nvm.h" +#include "e1000_manage.h" +#include "e1000_mbx.h" /* Function pointers for the MAC. */ struct e1000_mac_operations { @@ -995,23 +981,13 @@ struct e1000_hw { u8 revision_id; }; -#ifdef __rtems__ -#include -#include -#include -#include -#include -#include -#include -#else -#include -#include -#include -#include -#include -#include -#include -#endif /* __rtems__ */ +#include "e1000_82541.h" +#include "e1000_82543.h" +#include "e1000_82571.h" +#include "e1000_80003es2lan.h" +#include "e1000_ich8lan.h" +#include "e1000_82575.h" +#include "e1000_i210.h" /* These functions must be implemented by drivers */ void e1000_pci_clear_mwi(struct e1000_hw *hw); diff --git a/freebsd/sys/dev/e1000/e1000_ich8lan.c b/freebsd/sys/dev/e1000/e1000_ich8lan.c index e58e2606..e843527e 100644 --- a/freebsd/sys/dev/e1000/e1000_ich8lan.c +++ b/freebsd/sys/dev/e1000/e1000_ich8lan.c @@ -63,11 +63,7 @@ * 82579V Gigabit Network Connection */ -#ifdef __rtems__ -#include -#else -#include -#endif +#include "e1000_api.h" static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw); static void e1000_release_swflag_ich8lan(struct e1000_hw *hw); diff --git a/freebsd/sys/dev/e1000/e1000_mac.c b/freebsd/sys/dev/e1000/e1000_mac.c index 9c5a812a..b9bf8dc4 100644 --- a/freebsd/sys/dev/e1000/e1000_mac.c +++ b/freebsd/sys/dev/e1000/e1000_mac.c @@ -34,11 +34,7 @@ ******************************************************************************/ /*$FreeBSD$*/ -#ifdef __rtems__ -#include -#else -#include -#endif +#include "e1000_api.h" static s32 e1000_validate_mdi_setting_generic(struct e1000_hw *hw); static void e1000_set_lan_id_multi_port_pcie(struct e1000_hw *hw); diff --git a/freebsd/sys/dev/e1000/e1000_manage.c b/freebsd/sys/dev/e1000/e1000_manage.c index 59f53428..e33ff560 100644 --- a/freebsd/sys/dev/e1000/e1000_manage.c +++ b/freebsd/sys/dev/e1000/e1000_manage.c @@ -34,11 +34,7 @@ ******************************************************************************/ /*$FreeBSD$*/ -#ifdef __rtems__ -#include -#else -#include -#endif +#include "e1000_api.h" /** * e1000_calculate_checksum - Calculate checksum for buffer diff --git a/freebsd/sys/dev/e1000/e1000_mbx.c b/freebsd/sys/dev/e1000/e1000_mbx.c index a4c1e5e4..8028487b 100644 --- a/freebsd/sys/dev/e1000/e1000_mbx.c +++ b/freebsd/sys/dev/e1000/e1000_mbx.c @@ -34,11 +34,7 @@ ******************************************************************************/ /*$FreeBSD$*/ -#ifdef __rtems__ -#include -#else -#include -#endif +#include "e1000_mbx.h" /** * e1000_null_mbx_check_for_flag - No-op function, return 0 diff --git a/freebsd/sys/dev/e1000/e1000_mbx.h b/freebsd/sys/dev/e1000/e1000_mbx.h index 0785ee2e..206f00c5 100644 --- a/freebsd/sys/dev/e1000/e1000_mbx.h +++ b/freebsd/sys/dev/e1000/e1000_mbx.h @@ -35,11 +35,7 @@ #ifndef _E1000_MBX_H_ #define _E1000_MBX_H_ -#ifdef __rtems__ -#include -#else -#include -#endif +#include "e1000_api.h" /* Define mailbox register bits */ #define E1000_V2PMAILBOX_REQ 0x00000001 /* Request for PF Ready bit */ diff --git a/freebsd/sys/dev/e1000/e1000_nvm.c b/freebsd/sys/dev/e1000/e1000_nvm.c index 633ba998..9b9333c6 100644 --- a/freebsd/sys/dev/e1000/e1000_nvm.c +++ b/freebsd/sys/dev/e1000/e1000_nvm.c @@ -34,11 +34,7 @@ ******************************************************************************/ /*$FreeBSD$*/ -#ifdef __rtems__ -#include -#else -#include -#endif +#include "e1000_api.h" static void e1000_reload_nvm_generic(struct e1000_hw *hw); diff --git a/freebsd/sys/dev/e1000/e1000_osdep.c b/freebsd/sys/dev/e1000/e1000_osdep.c index 97619732..7eef489c 100644 --- a/freebsd/sys/dev/e1000/e1000_osdep.c +++ b/freebsd/sys/dev/e1000/e1000_osdep.c @@ -34,11 +34,7 @@ ******************************************************************************/ /*$FreeBSD$*/ -#ifdef __rtems__ -#include -#else -#include -#endif +#include "e1000_api.h" /* * NOTE: the following routines using the e1000 diff --git a/freebsd/sys/dev/e1000/e1000_osdep.h b/freebsd/sys/dev/e1000/e1000_osdep.h index 345536a4..7253969b 100644 --- a/freebsd/sys/dev/e1000/e1000_osdep.h +++ b/freebsd/sys/dev/e1000/e1000_osdep.h @@ -100,11 +100,9 @@ typedef int64_t s64; typedef int32_t s32; typedef int16_t s16; typedef int8_t s8; -#ifndef __rtems__ #ifndef __bool_true_false_are_defined typedef boolean_t bool; #endif -#endif /* __rtems__ */ #define __le16 u16 #define __le32 u32 diff --git a/freebsd/sys/dev/e1000/e1000_phy.c b/freebsd/sys/dev/e1000/e1000_phy.c index c808a020..9f955089 100644 --- a/freebsd/sys/dev/e1000/e1000_phy.c +++ b/freebsd/sys/dev/e1000/e1000_phy.c @@ -34,11 +34,7 @@ ******************************************************************************/ /*$FreeBSD$*/ -#ifdef __rtems__ -#include -#else -#include -#endif +#include "e1000_api.h" static s32 e1000_wait_autoneg(struct e1000_hw *hw); static s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset, diff --git a/freebsd/sys/dev/e1000/e1000_vf.c b/freebsd/sys/dev/e1000/e1000_vf.c index 4f314c0b..e525795d 100644 --- a/freebsd/sys/dev/e1000/e1000_vf.c +++ b/freebsd/sys/dev/e1000/e1000_vf.c @@ -34,11 +34,9 @@ ******************************************************************************/ /*$FreeBSD$*/ -#ifdef __rtems__ -#include -#else -#include -#endif + +#include "e1000_api.h" + static s32 e1000_init_phy_params_vf(struct e1000_hw *hw); static s32 e1000_init_nvm_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 a07c1e3e..0ee73aec 100644 --- a/freebsd/sys/dev/e1000/e1000_vf.h +++ b/freebsd/sys/dev/e1000/e1000_vf.h @@ -35,15 +35,9 @@ #ifndef _E1000_VF_H_ #define _E1000_VF_H_ -#ifdef __rtems__ -#include -#include -#include -#else -#include -#include -#include -#endif +#include "e1000_osdep.h" +#include "e1000_regs.h" +#include "e1000_defines.h" struct e1000_hw; @@ -198,11 +192,7 @@ struct e1000_vf_stats { u64 gprlbc; }; -#ifdef __rtems__ -#include -#else -#include -#endif +#include "e1000_mbx.h" struct e1000_mac_operations { /* Function pointers for the MAC. */ diff --git a/freebsd/sys/dev/e1000/if_em.c b/freebsd/sys/dev/e1000/if_em.c index 93ddafd6..948d5f2b 100644 --- a/freebsd/sys/dev/e1000/if_em.c +++ b/freebsd/sys/dev/e1000/if_em.c @@ -84,15 +84,9 @@ #include #include -#ifdef __rtems__ -#include -#include -#include -#else -#include -#include -#include -#endif +#include "e1000_api.h" +#include "e1000_82571.h" +#include "if_em.h" /********************************************************************* * Set this to one to display debug statistics diff --git a/freebsd/sys/dev/e1000/if_em.h b/freebsd/sys/dev/e1000/if_em.h index 20ba1267..f1afbadb 100644 --- a/freebsd/sys/dev/e1000/if_em.h +++ b/freebsd/sys/dev/e1000/if_em.h @@ -33,8 +33,8 @@ /*$FreeBSD$*/ -#ifndef _EM_HH_DEFINED_ -#define _EM_HH_DEFINED_ +#ifndef _EM_H_DEFINED_ +#define _EM_H_DEFINED_ /* Tunables */ @@ -500,4 +500,4 @@ e1000_rx_unrefreshed(struct rx_ring *rxr) #define EM_TX_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->tx_mtx, MA_OWNED) #define EM_RX_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->rx_mtx, MA_OWNED) -#endif /* _EM_HH_DEFINED_ */ +#endif /* _EM_H_DEFINED_ */ diff --git a/freebsd/sys/dev/e1000/if_igb.c b/freebsd/sys/dev/e1000/if_igb.c index c64a058d..a3c7fede 100644 --- a/freebsd/sys/dev/e1000/if_igb.c +++ b/freebsd/sys/dev/e1000/if_igb.c @@ -90,15 +90,9 @@ #include #include -#ifdef __rtems__ -#include -#include -#include -#else -#include -#include -#include -#endif +#include "e1000_api.h" +#include "e1000_82575.h" +#include "if_igb.h" /********************************************************************* * Set this to one to display debug statistics @@ -4715,7 +4709,6 @@ igb_rx_input(struct rx_ring *rxr, struct ifnet *ifp, struct mbuf *m, u32 ptype) * * Return TRUE if more to clean, FALSE otherwise *********************************************************************/ - static bool igb_rxeof(struct igb_queue *que, int count, int *done) { diff --git a/freebsd/sys/dev/e1000/if_igb.h b/freebsd/sys/dev/e1000/if_igb.h index 51d8987a..f286e67a 100644 --- a/freebsd/sys/dev/e1000/if_igb.h +++ b/freebsd/sys/dev/e1000/if_igb.h @@ -32,8 +32,8 @@ ******************************************************************************/ /*$FreeBSD$*/ -#ifndef _IGB_HH_DEFINED_ -#define _IGB_HH_DEFINED_ +#ifndef _IGB_H_DEFINED_ +#define _IGB_H_DEFINED_ /* Tunables */ @@ -543,6 +543,6 @@ drbr_needs_enqueue(struct ifnet *ifp, struct buf_ring *br) } #endif -#endif /* _IGB_HH_DEFINED_ */ +#endif /* _IGB_H_DEFINED_ */ diff --git a/freebsd/sys/dev/e1000/if_lem.c b/freebsd/sys/dev/e1000/if_lem.c index 9ed7b8e8..aa64f655 100644 --- a/freebsd/sys/dev/e1000/if_lem.c +++ b/freebsd/sys/dev/e1000/if_lem.c @@ -81,13 +81,8 @@ #include #include -#ifdef __rtems__ -#include -#include -#else -#include -#include -#endif +#include "e1000_api.h" +#include "if_lem.h" /********************************************************************* * Legacy Em Driver version: diff --git a/freebsd/sys/dev/e1000/if_lem.h b/freebsd/sys/dev/e1000/if_lem.h index 29d26af5..c1973e55 100644 --- a/freebsd/sys/dev/e1000/if_lem.h +++ b/freebsd/sys/dev/e1000/if_lem.h @@ -33,8 +33,8 @@ /*$FreeBSD$*/ -#ifndef _LEM_HH_DEFINED_ -#define _LEM_HH_DEFINED_ +#ifndef _LEM_H_DEFINED_ +#define _LEM_H_DEFINED_ /* Tunables */ @@ -493,4 +493,4 @@ typedef struct _DESCRIPTOR_PAIR #define EM_CORE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->core_mtx, MA_OWNED) #define EM_TX_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->tx_mtx, MA_OWNED) -#endif /* _LEM_HH_DEFINED_ */ +#endif /* _LEM_H_DEFINED_ */ diff --git a/freebsd/sys/dev/pci/pci.c b/freebsd/sys/dev/pci/pci.c index 8557cb33..ea1e841e 100644 --- a/freebsd/sys/dev/pci/pci.c +++ b/freebsd/sys/dev/pci/pci.c @@ -47,9 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef __rtems__ #include -#endif /* __rtems__ */ #include #include @@ -68,9 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef __rtems__ #include -#endif /* __rtems__ */ #include #include diff --git a/freebsd/sys/dev/pci/pci_user.c b/freebsd/sys/dev/pci/pci_user.c index 1a977860..c2723ad3 100644 --- a/freebsd/sys/dev/pci/pci_user.c +++ b/freebsd/sys/dev/pci/pci_user.c @@ -46,9 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef __rtems__ #include -#endif /* __rtems__ */ #include #include diff --git a/freebsd/sys/dev/pci/pcib_private.h b/freebsd/sys/dev/pci/pcib_private.h index 0fbc8df5..1574deb7 100644 --- a/freebsd/sys/dev/pci/pcib_private.h +++ b/freebsd/sys/dev/pci/pcib_private.h @@ -30,8 +30,8 @@ * $FreeBSD$ */ -#ifndef __PCIB_PRIVATE_HH__ -#define __PCIB_PRIVATE_HH__ +#ifndef __PCIB_PRIVATE_H__ +#define __PCIB_PRIVATE_H__ /* * Export portions of generic PCI:PCI bridge support so that it can be diff --git a/freebsd/sys/dev/pci/pcivar.h b/freebsd/sys/dev/pci/pcivar.h index 63adb09d..b0359d30 100644 --- a/freebsd/sys/dev/pci/pcivar.h +++ b/freebsd/sys/dev/pci/pcivar.h @@ -313,7 +313,6 @@ PCIB_ACCESSOR(bus, BUS, uint32_t) #define PCI_INVALID_IRQ 255 #define PCI_INTERRUPT_VALID(x) ((x) != PCI_INVALID_IRQ) - /* * Convenience functions. * @@ -460,6 +459,7 @@ pci_msix_count(device_t dev) device_t pci_find_bsf(uint8_t, uint8_t, uint8_t); device_t pci_find_dbsf(uint32_t, uint8_t, uint8_t, uint8_t); device_t pci_find_device(uint16_t, uint16_t); +device_t pci_find_class(uint8_t class, uint8_t subclass); /* Can be used by drivers to manage the MSI-X table. */ int pci_pending_msix(device_t dev, u_int index); diff --git a/freebsd/sys/dev/usb/controller/uhcireg.h b/freebsd/sys/dev/usb/controller/uhcireg.h new file mode 100644 index 00000000..95eae494 --- /dev/null +++ b/freebsd/sys/dev/usb/controller/uhcireg.h @@ -0,0 +1,95 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 1998 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Lennart Augustsson (lennart@augustsson.net) at + * Carlstedt Research & Technology. + * + * 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 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. + */ + +#ifndef _UHCIREG_H_ +#define _UHCIREG_H_ + +#define PCI_UHCI_BASE_REG 0x20 + +/* PCI config registers */ +#define PCI_USBREV 0x60 /* USB protocol revision */ +#define PCI_USB_REV_MASK 0xff +#define PCI_USB_REV_PRE_1_0 0x00 +#define PCI_USB_REV_1_0 0x10 +#define PCI_USB_REV_1_1 0x11 +#define PCI_LEGSUP 0xc0 /* Legacy Support register */ +#define PCI_LEGSUP_USBPIRQDEN 0x2000 /* USB PIRQ D Enable */ +#define PCI_CBIO 0x20 /* configuration base IO */ +#define PCI_INTERFACE_UHCI 0x00 + +/* UHCI registers */ +#define UHCI_CMD 0x00 +#define UHCI_CMD_RS 0x0001 +#define UHCI_CMD_HCRESET 0x0002 +#define UHCI_CMD_GRESET 0x0004 +#define UHCI_CMD_EGSM 0x0008 +#define UHCI_CMD_FGR 0x0010 +#define UHCI_CMD_SWDBG 0x0020 +#define UHCI_CMD_CF 0x0040 +#define UHCI_CMD_MAXP 0x0080 +#define UHCI_STS 0x02 +#define UHCI_STS_USBINT 0x0001 +#define UHCI_STS_USBEI 0x0002 +#define UHCI_STS_RD 0x0004 +#define UHCI_STS_HSE 0x0008 +#define UHCI_STS_HCPE 0x0010 +#define UHCI_STS_HCH 0x0020 +#define UHCI_STS_ALLINTRS 0x003f +#define UHCI_INTR 0x04 +#define UHCI_INTR_TOCRCIE 0x0001 +#define UHCI_INTR_RIE 0x0002 +#define UHCI_INTR_IOCE 0x0004 +#define UHCI_INTR_SPIE 0x0008 +#define UHCI_FRNUM 0x06 +#define UHCI_FRNUM_MASK 0x03ff +#define UHCI_FLBASEADDR 0x08 +#define UHCI_SOF 0x0c +#define UHCI_SOF_MASK 0x7f +#define UHCI_PORTSC1 0x010 +#define UHCI_PORTSC2 0x012 +#define UHCI_PORTSC_CCS 0x0001 +#define UHCI_PORTSC_CSC 0x0002 +#define UHCI_PORTSC_PE 0x0004 +#define UHCI_PORTSC_POEDC 0x0008 +#define UHCI_PORTSC_LS 0x0030 +#define UHCI_PORTSC_LS_SHIFT 4 +#define UHCI_PORTSC_RD 0x0040 +#define UHCI_PORTSC_LSDA 0x0100 +#define UHCI_PORTSC_PR 0x0200 +#define UHCI_PORTSC_OCI 0x0400 +#define UHCI_PORTSC_OCIC 0x0800 +#define UHCI_PORTSC_SUSP 0x1000 + +#define URWMASK(x) ((x) & (UHCI_PORTSC_SUSP | \ + UHCI_PORTSC_PR | UHCI_PORTSC_RD | \ + UHCI_PORTSC_PE)) + +#endif /* _UHCIREG_H_ */ diff --git a/freebsd/sys/dev/usb/quirk/usb_quirk.c b/freebsd/sys/dev/usb/quirk/usb_quirk.c index c11ef928..2df2de5e 100644 --- a/freebsd/sys/dev/usb/quirk/usb_quirk.c +++ b/freebsd/sys/dev/usb/quirk/usb_quirk.c @@ -154,10 +154,8 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRKS_MAX] = { UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(ALCOR, UMCR_9361, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), - USB_QUIRK(ALCOR, TRANSCEND, 0x0142, 0x0142, UQ_MSC_FORCE_WIRE_BBB, - UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN, UQ_MSC_NO_SYNC_CACHE), - USB_QUIRK(ALCOR, TRANSCEND, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, - UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(ALCOR, TRANSCEND, 0x0000, 0xffff, UQ_MSC_NO_GETMAXLUN, + UQ_MSC_NO_SYNC_CACHE, UQ_MSC_NO_TEST_UNIT_READY), USB_QUIRK(APACER, HT202, 0x0000, 0xffff, UQ_MSC_NO_TEST_UNIT_READY, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(ASAHIOPTICAL, OPTIO230, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, diff --git a/freebsd/sys/dev/usb/usb_dev.c b/freebsd/sys/dev/usb/usb_dev.c index 68000d8e..7ca10d7b 100644 --- a/freebsd/sys/dev/usb/usb_dev.c +++ b/freebsd/sys/dev/usb/usb_dev.c @@ -47,9 +47,7 @@ #include #include #include -#ifndef __rtems__ #include -#endif #include #include @@ -100,7 +98,7 @@ TUNABLE_INT("hw.usb.dev.debug", &usb_fifo_debug); /* prototypes */ -static int usb_fifo_open(struct usb_cdev_privdata *, +static int usb_fifo_open(struct usb_cdev_privdata *, struct usb_fifo *, int); static void usb_fifo_close(struct usb_fifo *, int); static void usb_dev_init(void *); @@ -185,7 +183,7 @@ usb_loc_fill(struct usb_fs_privdata* pd, struct usb_cdev_privdata *cpd) * Else: Failure. *------------------------------------------------------------------------*/ static usb_error_t -usb_ref_device(struct usb_cdev_privdata *cpd, +usb_ref_device(struct usb_cdev_privdata *cpd, struct usb_cdev_refdata *crd, int need_uref) { struct usb_fifo **ppf; @@ -225,7 +223,7 @@ usb_ref_device(struct usb_cdev_privdata *cpd, mtx_lock(&usb_ref_lock); - /* + /* * Set "is_uref" after grabbing the default SX lock */ crd->is_uref = 1; @@ -655,7 +653,7 @@ usb_dev_get_ep(struct usb_device *udev, uint8_t ep_index, uint8_t dir) * Else: Failure *------------------------------------------------------------------------*/ static int -usb_fifo_open(struct usb_cdev_privdata *cpd, +usb_fifo_open(struct usb_cdev_privdata *cpd, struct usb_fifo *f, int fflags) { int err; @@ -1049,7 +1047,7 @@ usb_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int fflag, struct thread* if (err != 0) return (err); - /* + /* * Performance optimisation: We try to check for IOCTL's that * don't need the USB reference first. Then we grab the USB * reference if we need it! diff --git a/freebsd/sys/h8300/h8300/legacy.c b/freebsd/sys/h8300/h8300/legacy.c index d2b0a78a..c81ccc5e 100644 --- a/freebsd/sys/h8300/h8300/legacy.c +++ b/freebsd/sys/h8300/h8300/legacy.c @@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef __rtems__ #include -#endif /* __rtems__ */ #ifdef DEV_MCA #include #endif diff --git a/freebsd/sys/h8300/pci/pci_bus.c b/freebsd/sys/h8300/pci/pci_bus.c index 53446262..ad0342ec 100644 --- a/freebsd/sys/h8300/pci/pci_bus.c +++ b/freebsd/sys/h8300/pci/pci_bus.c @@ -60,7 +60,6 @@ static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin); #endif /* __rtems__ */ - int legacy_pcib_maxslots(device_t dev) { @@ -69,15 +68,9 @@ legacy_pcib_maxslots(device_t dev) /* 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)); } @@ -514,7 +507,6 @@ legacy_pcib_attach(device_t dev) if (pir != NULL) device_probe_and_attach(pir); } -#else /* __rtems__ */ #endif /* __rtems__ */ device_add_child(dev, "pci", bus); return bus_generic_attach(dev); diff --git a/freebsd/sys/i386/i386/legacy.c b/freebsd/sys/i386/i386/legacy.c index d2b0a78a..c81ccc5e 100644 --- a/freebsd/sys/i386/i386/legacy.c +++ b/freebsd/sys/i386/i386/legacy.c @@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef __rtems__ #include -#endif /* __rtems__ */ #ifdef DEV_MCA #include #endif diff --git a/freebsd/sys/i386/include/machine/intr_machdep.h b/freebsd/sys/i386/include/machine/intr_machdep.h index fc490b35..535fcf8f 100644 --- a/freebsd/sys/i386/include/machine/intr_machdep.h +++ b/freebsd/sys/i386/include/machine/intr_machdep.h @@ -26,8 +26,8 @@ * $FreeBSD$ */ -#ifndef __MACHINE_INTR_MACHDEP_HH__ -#define __MACHINE_INTR_MACHDEP_HH__ +#ifndef __MACHINE_INTR_MACHDEP_H__ +#define __MACHINE_INTR_MACHDEP_H__ #ifdef _KERNEL @@ -158,4 +158,4 @@ int msix_release(int irq); #endif /* !LOCORE */ #endif /* _KERNEL */ -#endif /* !__MACHINE_INTR_MACHDEP_HH__ */ +#endif /* !__MACHINE_INTR_MACHDEP_H__ */ diff --git a/freebsd/sys/i386/pci/pci_bus.c b/freebsd/sys/i386/pci/pci_bus.c index 53446262..ad0342ec 100644 --- a/freebsd/sys/i386/pci/pci_bus.c +++ b/freebsd/sys/i386/pci/pci_bus.c @@ -60,7 +60,6 @@ static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin); #endif /* __rtems__ */ - int legacy_pcib_maxslots(device_t dev) { @@ -69,15 +68,9 @@ legacy_pcib_maxslots(device_t dev) /* 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)); } @@ -514,7 +507,6 @@ legacy_pcib_attach(device_t dev) if (pir != NULL) device_probe_and_attach(pir); } -#else /* __rtems__ */ #endif /* __rtems__ */ device_add_child(dev, "pci", bus); return bus_generic_attach(dev); diff --git a/freebsd/sys/isa/isavar.h b/freebsd/sys/isa/isavar.h index cb20402c..d2053da3 100644 --- a/freebsd/sys/isa/isavar.h +++ b/freebsd/sys/isa/isavar.h @@ -32,10 +32,10 @@ struct isa_config; struct isa_pnp_id; typedef void isa_config_cb(void *arg, struct isa_config *config, int enable); + #ifndef __rtems__ #include #endif /* __rtems__ */ - #include #ifdef _KERNEL diff --git a/freebsd/sys/kern/kern_intr.c b/freebsd/sys/kern/kern_intr.c index a9017fd2..2fd12773 100644 --- a/freebsd/sys/kern/kern_intr.c +++ b/freebsd/sys/kern/kern_intr.c @@ -29,7 +29,6 @@ #include __FBSDID("$FreeBSD$"); - #include #include @@ -95,7 +94,7 @@ struct intr_event *clk_intr_event; #ifndef __rtems__ struct intr_event *tty_intr_event; void *vm_ih; -#endif /* __rtems__ */ +#endif /* __rtems__ */ struct proc *intrproc; static MALLOC_DEFINE(M_ITHREAD, "ithread", "Interrupt Threads"); @@ -538,7 +537,7 @@ ithread_destroy(struct intr_thread *ithread) thread_unlock(td); } -#endif /* __rtems__ */ +#endif /* __rtems__ */ #ifndef INTR_FILTER int intr_event_add_handler(struct intr_event *ie, const char *name, @@ -774,7 +773,7 @@ intr_handler_source(void *cookie) return (ie->ie_source); } -#endif /* __rtems__ */ +#endif /* __rtems__ */ #ifndef INTR_FILTER #ifndef __rtems__ int @@ -866,7 +865,7 @@ ok: return (0); } -#endif /* __rtems__ */ +#endif /* __rtems__ */ static int intr_event_schedule_thread(struct intr_event *ie) { @@ -1177,7 +1176,7 @@ swi_sched(void *cookie, int flags) if (!(flags & SWI_DELAY)) { #ifndef __rtems__ PCPU_INC(cnt.v_soft); -#endif /* __rtems__ */ +#endif /* __rtems__ */ #ifdef INTR_FILTER error = intr_event_schedule_thread(ie, ie->ie_thread); #else diff --git a/freebsd/sys/kern/kern_mbuf.c b/freebsd/sys/kern/kern_mbuf.c index 12b4841b..5ad62894 100644 --- a/freebsd/sys/kern/kern_mbuf.c +++ b/freebsd/sys/kern/kern_mbuf.c @@ -129,14 +129,14 @@ sysctl_nmbclusters(SYSCTL_HANDLER_ARGS) int error, newnmbclusters; newnmbclusters = nmbclusters; - error = sysctl_handle_int(oidp, &newnmbclusters, 0, req); + error = sysctl_handle_int(oidp, &newnmbclusters, 0, req); if (error == 0 && req->newptr) { if (newnmbclusters > nmbclusters) { nmbclusters = newnmbclusters; uma_zone_set_max(zone_clust, nmbclusters); #ifndef __rtems__ EVENTHANDLER_INVOKE(nmbclusters_change); -#endif +#endif /* __rtems__ */ } else error = EINVAL; } @@ -152,7 +152,7 @@ sysctl_nmbjumbop(SYSCTL_HANDLER_ARGS) int error, newnmbjumbop; newnmbjumbop = nmbjumbop; - error = sysctl_handle_int(oidp, &newnmbjumbop, 0, req); + error = sysctl_handle_int(oidp, &newnmbjumbop, 0, req); if (error == 0 && req->newptr) { if (newnmbjumbop> nmbjumbop) { nmbjumbop = newnmbjumbop; @@ -173,7 +173,7 @@ sysctl_nmbjumbo9(SYSCTL_HANDLER_ARGS) int error, newnmbjumbo9; newnmbjumbo9 = nmbjumbo9; - error = sysctl_handle_int(oidp, &newnmbjumbo9, 0, req); + error = sysctl_handle_int(oidp, &newnmbjumbo9, 0, req); if (error == 0 && req->newptr) { if (newnmbjumbo9> nmbjumbo9) { nmbjumbo9 = newnmbjumbo9; @@ -185,7 +185,7 @@ sysctl_nmbjumbo9(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbo9, CTLTYPE_INT|CTLFLAG_RW, &nmbjumbo9, 0, sysctl_nmbjumbo9, "IU", - "Maximum number of mbuf 9k jumbo clusters allowed"); + "Maximum number of mbuf 9k jumbo clusters allowed"); static int sysctl_nmbjumbo16(SYSCTL_HANDLER_ARGS) @@ -193,7 +193,7 @@ sysctl_nmbjumbo16(SYSCTL_HANDLER_ARGS) int error, newnmbjumbo16; newnmbjumbo16 = nmbjumbo16; - error = sysctl_handle_int(oidp, &newnmbjumbo16, 0, req); + error = sysctl_handle_int(oidp, &newnmbjumbo16, 0, req); if (error == 0 && req->newptr) { if (newnmbjumbo16> nmbjumbo16) { nmbjumbo16 = newnmbjumbo16; @@ -327,7 +327,7 @@ mbuf_init(void *dummy) #ifndef __rtems__ EVENTHANDLER_REGISTER(vm_lowmem, mb_reclaim, NULL, EVENTHANDLER_PRI_FIRST); -#endif +#endif /* __rtems__ */ /* * [Re]set counters and local statistics knobs. @@ -364,9 +364,9 @@ mbuf_jumbo_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) #ifndef __rtems__ return ((void *)kmem_alloc_contig(kernel_map, bytes, wait, (vm_paddr_t)0, ~(vm_paddr_t)0, 1, 0, VM_MEMATTR_DEFAULT)); -#else - return ((void *)malloc(bytes, M_TEMP, wait)); -#endif +#else /* __rtems__ */ + return ((void *)malloc(bytes, M_TEMP, wait)); +#endif /* __rtems__ */ } /* @@ -436,7 +436,7 @@ static void mb_dtor_mbuf(void *mem, int size, void *arg) { struct mbuf *m; - unsigned long flags; + unsigned long flags; m = (struct mbuf *)mem; flags = (unsigned long)arg; diff --git a/freebsd/sys/kern/kern_subr.c b/freebsd/sys/kern/kern_subr.c index 571da0b2..ced2d943 100644 --- a/freebsd/sys/kern/kern_subr.c +++ b/freebsd/sys/kern/kern_subr.c @@ -186,6 +186,11 @@ uiomove_faultflag(void *cp, int n, struct uio *uio, int nofault) u_int cnt; int error, newflags, save; +#ifndef __rtems__ + td = curthread; +#endif /* __rtems__ */ + error = 0; + KASSERT(uio->uio_rw == UIO_READ || uio->uio_rw == UIO_WRITE, ("uiomove: mode")); KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == td, @@ -557,7 +562,6 @@ copyinstrfrom(const void * __restrict src, void * __restrict dst, size_t len, } return (error); } - #endif /* __rtems__ */ int diff --git a/freebsd/sys/kern/kern_time.c b/freebsd/sys/kern/kern_time.c index d15da74f..344c379e 100644 --- a/freebsd/sys/kern/kern_time.c +++ b/freebsd/sys/kern/kern_time.c @@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifndef __rtems__ #include -#endif /* __rtems__ */ #include #include #include @@ -52,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifndef __rtems__ #include #include #include @@ -64,6 +61,7 @@ __FBSDID("$FreeBSD$"); #define MAX_CLOCKS (CLOCK_MONOTONIC+1) +#ifndef __rtems__ static struct kclock posix_clocks[MAX_CLOCKS]; static uma_zone_t itimer_zone = NULL; diff --git a/freebsd/sys/kern/kern_timeout.c b/freebsd/sys/kern/kern_timeout.c index c8522153..38871b03 100644 --- a/freebsd/sys/kern/kern_timeout.c +++ b/freebsd/sys/kern/kern_timeout.c @@ -63,8 +63,8 @@ __FBSDID("$FreeBSD$"); #endif #ifdef __rtems__ -int ncallout = 16; -#endif /* __rtems__ */ +#define ncallout 16 +#endif /* __rtems__ */ SDT_PROVIDER_DEFINE(callout_execute); SDT_PROBE_DEFINE(callout_execute, kernel, , callout_start, callout-start); SDT_PROBE_ARGTYPE(callout_execute, kernel, , callout_start, 0, diff --git a/freebsd/sys/kern/subr_bus.c b/freebsd/sys/kern/subr_bus.c index f476951c..3d1bd2bc 100644 --- a/freebsd/sys/kern/subr_bus.c +++ b/freebsd/sys/kern/subr_bus.c @@ -608,6 +608,7 @@ devctl_queue_data_f(char *data, int flags) psignal(p, SIGIO); PROC_UNLOCK(p); } + return; #else /* __rtems__ */ printf("devctl: %s", data); #endif /* __rtems__ */ @@ -2269,10 +2270,6 @@ device_get_children(device_t dev, device_t **devlistp, int *devcountp) return (0); } -#ifdef __rtems__ - /* malloc(0) may return NULL */ - if (count != 0) { -#endif /* __rtems__ */ list = malloc(count * sizeof(device_t), M_TEMP, M_NOWAIT|M_ZERO); if (!list) return (ENOMEM); @@ -2282,11 +2279,6 @@ device_get_children(device_t dev, device_t **devlistp, int *devcountp) list[count] = child; count++; } -#ifdef __rtems__ - } else { - list = NULL; - } -#endif /* __rtems__ */ *devlistp = list; *devcountp = count; diff --git a/freebsd/sys/kern/subr_kobj.c b/freebsd/sys/kern/subr_kobj.c index 7f2b31f7..9cfe868b 100644 --- a/freebsd/sys/kern/subr_kobj.c +++ b/freebsd/sys/kern/subr_kobj.c @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); #endif #ifdef TEST -#include +#include "usertest.h" #endif static MALLOC_DEFINE(M_KOBJ, "kobj", "Kernel object structures"); diff --git a/freebsd/sys/kern/sys_generic.c b/freebsd/sys/kern/sys_generic.c index ba636b39..7cc2a516 100644 --- a/freebsd/sys/kern/sys_generic.c +++ b/freebsd/sys/kern/sys_generic.c @@ -39,7 +39,6 @@ #include __FBSDID("$FreeBSD$"); - #include #include @@ -910,6 +909,9 @@ kern_select(struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou, if (nd < 0) return (EINVAL); +#ifndef __rtems__ + fdp = td->td_proc->p_fd; +#endif /* __rtems__ */ ndu = nd; #ifndef __rtems__ lf = fdp->fd_lastfile; diff --git a/freebsd/sys/kern/uipc_mbuf.c b/freebsd/sys/kern/uipc_mbuf.c index f05546b1..3b0a5fe9 100644 --- a/freebsd/sys/kern/uipc_mbuf.c +++ b/freebsd/sys/kern/uipc_mbuf.c @@ -213,16 +213,16 @@ void mb_free_ext(struct mbuf *m) { int skipmbuf; - + KASSERT((m->m_flags & M_EXT) == M_EXT, ("%s: M_EXT not set", __func__)); KASSERT(m->m_ext.ref_cnt != NULL, ("%s: ref_cnt not set", __func__)); /* * check if the header is embedded in the cluster - */ + */ skipmbuf = (m->m_flags & M_NOFREE); - + /* Free attached storage if this mbuf is the only reference to it. */ if (*(m->m_ext.ref_cnt) == 1 || atomic_fetchadd_int(m->m_ext.ref_cnt, -1) == 1) { @@ -265,7 +265,7 @@ mb_free_ext(struct mbuf *m) } if (skipmbuf) return; - + /* * Free this mbuf back to the mbuf zone with all m_ext * information purged. @@ -349,7 +349,7 @@ m_sanity(struct mbuf *m0, int sanitize) #ifdef INVARIANTS #define M_SANITY_ACTION(s) panic("mbuf %p: " s, m) -#else +#else #define M_SANITY_ACTION(s) printf("mbuf %p: " s, m) #endif @@ -512,7 +512,7 @@ m_prepend(struct mbuf *m, int len, int how) if (len < MHLEN) MH_ALIGN(m, len); } else { - if (len < MLEN) + if (len < MLEN) M_ALIGN(m, len); } m->m_len = len; @@ -550,7 +550,7 @@ m_copym(struct mbuf *m, int off0, int len, int wait) top = 0; while (len > 0) { if (m == NULL) { - KASSERT(len == M_COPYALL, + KASSERT(len == M_COPYALL, ("m_copym, length > size of mbuf chain")); break; } @@ -794,7 +794,7 @@ m_copypacket(struct mbuf *m, int how) return top; nospace: m_freem(top); - mbstat.m_mcfail++; /* XXX: No consistency. */ + mbstat.m_mcfail++; /* XXX: No consistency. */ return (NULL); } @@ -1498,7 +1498,7 @@ m_defrag(struct mbuf *m0, int how) goto nospace; } #endif - + if (m0->m_pkthdr.len > MHLEN) m_final = m_getcl(how, MT_DATA, M_PKTHDR); else @@ -1664,7 +1664,7 @@ m_fragment(struct mbuf *m0, int how, int length) if (!(m0->m_flags & M_PKTHDR)) return (m0); - + if ((length == 0) || (length < -2)) return (m0); @@ -1948,7 +1948,7 @@ m_unshare(struct mbuf *m0, int how) n->m_len = cc; if (mlast != NULL) mlast->m_next = n; - mlast = n; + mlast = n; #if 0 newipsecstat.ips_clcopied++; #endif @@ -1965,7 +1965,7 @@ m_unshare(struct mbuf *m0, int how) return (NULL); } } - n->m_next = m->m_next; + n->m_next = m->m_next; if (mprev == NULL) m0 = mfirst; /* new head of chain */ else @@ -2001,7 +2001,7 @@ m_profile(struct mbuf *m) int segments = 0; int used = 0; int wasted = 0; - + while (m) { segments++; used += m->m_len; @@ -2036,11 +2036,11 @@ mbprof_textify(void) int offset; char *c; u_int64_t *p; - + p = &mbprof.wasted[0]; c = mbprofbuf; - offset = snprintf(c, MP_MAXLINE + 10, + offset = snprintf(c, MP_MAXLINE + 10, "wasted:\n" "%ju %ju %ju %ju %ju %ju %ju %ju " "%ju %ju %ju %ju %ju %ju %ju %ju\n", @@ -2049,7 +2049,7 @@ mbprof_textify(void) #ifdef BIG_ARRAY p = &mbprof.wasted[16]; c += offset; - offset = snprintf(c, MP_MAXLINE, + offset = snprintf(c, MP_MAXLINE, "%ju %ju %ju %ju %ju %ju %ju %ju " "%ju %ju %ju %ju %ju %ju %ju %ju\n", p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], @@ -2057,7 +2057,7 @@ mbprof_textify(void) #endif p = &mbprof.used[0]; c += offset; - offset = snprintf(c, MP_MAXLINE + 10, + offset = snprintf(c, MP_MAXLINE + 10, "used:\n" "%ju %ju %ju %ju %ju %ju %ju %ju " "%ju %ju %ju %ju %ju %ju %ju %ju\n", @@ -2066,7 +2066,7 @@ mbprof_textify(void) #ifdef BIG_ARRAY p = &mbprof.used[16]; c += offset; - offset = snprintf(c, MP_MAXLINE, + offset = snprintf(c, MP_MAXLINE, "%ju %ju %ju %ju %ju %ju %ju %ju " "%ju %ju %ju %ju %ju %ju %ju %ju\n", p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], @@ -2074,7 +2074,7 @@ mbprof_textify(void) #endif p = &mbprof.segments[0]; c += offset; - offset = snprintf(c, MP_MAXLINE + 10, + offset = snprintf(c, MP_MAXLINE + 10, "segments:\n" "%ju %ju %ju %ju %ju %ju %ju %ju " "%ju %ju %ju %ju %ju %ju %ju %ju\n", @@ -2083,7 +2083,7 @@ mbprof_textify(void) #ifdef BIG_ARRAY p = &mbprof.segments[16]; c += offset; - offset = snprintf(c, MP_MAXLINE, + offset = snprintf(c, MP_MAXLINE, "%ju %ju %ju %ju %ju %ju %ju %ju " "%ju %ju %ju %ju %ju %ju %ju %jju", p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], @@ -2105,16 +2105,16 @@ static int mbprof_clr_handler(SYSCTL_HANDLER_ARGS) { int clear, error; - + clear = 0; error = sysctl_handle_int(oidp, &clear, 0, req); if (error || !req->newptr) return (error); - + if (clear) { bzero(&mbprof, sizeof(mbprof)); } - + return (error); } diff --git a/freebsd/sys/kern/uipc_socket.c b/freebsd/sys/kern/uipc_socket.c index 614b5408..227e6dac 100644 --- a/freebsd/sys/kern/uipc_socket.c +++ b/freebsd/sys/kern/uipc_socket.c @@ -873,7 +873,7 @@ struct so_zerocopy_stats so_zerocp_stats = {0,0,0}; /* * sosend_copyin() is only used if zero copy sockets are enabled. Otherwise * sosend_dgram() and sosend_generic() use m_uiotombuf(). - * + * * sosend_copyin() accepts a uio and prepares an mbuf chain holding part or * all of the data referenced by the uio. If desired, it uses zero-copy. * *space will be updated to reflect data copied in. @@ -3352,7 +3352,7 @@ soisconnecting(struct socket *so) void soisconnected(struct socket *so) { - struct socket *head; + struct socket *head; int ret; restart: @@ -3457,7 +3457,7 @@ soupcall_set(struct socket *so, int which, int (*func)(struct socket *, void *, int), void *arg) { struct sockbuf *sb; - + switch (which) { case SO_RCV: sb = &so->so_rcv; @@ -3547,7 +3547,7 @@ sotoxsocket(struct socket *so, struct xsocket *xso) void so_listeners_apply_all(struct socket *so, void (*func)(struct socket *, void *), void *arg) { - + TAILQ_FOREACH(so, &so->so_comp, so_list) func(so, arg); } diff --git a/freebsd/sys/kern/uipc_syscalls.c b/freebsd/sys/kern/uipc_syscalls.c index 73b91367..c62cc9b5 100644 --- a/freebsd/sys/kern/uipc_syscalls.c +++ b/freebsd/sys/kern/uipc_syscalls.c @@ -666,6 +666,7 @@ oaccept(td, uap) /* ARGSUSED */ #ifndef __rtems__ int +connect(td, uap) #else /* __rtems__ */ static int kern_connect(struct thread *, int, struct sockaddr *); diff --git a/freebsd/sys/lm32/lm32/legacy.c b/freebsd/sys/lm32/lm32/legacy.c index d2b0a78a..c81ccc5e 100644 --- a/freebsd/sys/lm32/lm32/legacy.c +++ b/freebsd/sys/lm32/lm32/legacy.c @@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef __rtems__ #include -#endif /* __rtems__ */ #ifdef DEV_MCA #include #endif diff --git a/freebsd/sys/lm32/pci/pci_bus.c b/freebsd/sys/lm32/pci/pci_bus.c index 53446262..ad0342ec 100644 --- a/freebsd/sys/lm32/pci/pci_bus.c +++ b/freebsd/sys/lm32/pci/pci_bus.c @@ -60,7 +60,6 @@ static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin); #endif /* __rtems__ */ - int legacy_pcib_maxslots(device_t dev) { @@ -69,15 +68,9 @@ legacy_pcib_maxslots(device_t dev) /* 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)); } @@ -514,7 +507,6 @@ legacy_pcib_attach(device_t dev) if (pir != NULL) device_probe_and_attach(pir); } -#else /* __rtems__ */ #endif /* __rtems__ */ device_add_child(dev, "pci", bus); return bus_generic_attach(dev); diff --git a/freebsd/sys/m32c/m32c/legacy.c b/freebsd/sys/m32c/m32c/legacy.c index d2b0a78a..c81ccc5e 100644 --- a/freebsd/sys/m32c/m32c/legacy.c +++ b/freebsd/sys/m32c/m32c/legacy.c @@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef __rtems__ #include -#endif /* __rtems__ */ #ifdef DEV_MCA #include #endif diff --git a/freebsd/sys/m32c/pci/pci_bus.c b/freebsd/sys/m32c/pci/pci_bus.c index 53446262..ad0342ec 100644 --- a/freebsd/sys/m32c/pci/pci_bus.c +++ b/freebsd/sys/m32c/pci/pci_bus.c @@ -60,7 +60,6 @@ static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin); #endif /* __rtems__ */ - int legacy_pcib_maxslots(device_t dev) { @@ -69,15 +68,9 @@ legacy_pcib_maxslots(device_t dev) /* 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)); } @@ -514,7 +507,6 @@ legacy_pcib_attach(device_t dev) if (pir != NULL) device_probe_and_attach(pir); } -#else /* __rtems__ */ #endif /* __rtems__ */ device_add_child(dev, "pci", bus); return bus_generic_attach(dev); diff --git a/freebsd/sys/m32r/m32r/legacy.c b/freebsd/sys/m32r/m32r/legacy.c index d2b0a78a..c81ccc5e 100644 --- a/freebsd/sys/m32r/m32r/legacy.c +++ b/freebsd/sys/m32r/m32r/legacy.c @@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef __rtems__ #include -#endif /* __rtems__ */ #ifdef DEV_MCA #include #endif diff --git a/freebsd/sys/m32r/pci/pci_bus.c b/freebsd/sys/m32r/pci/pci_bus.c index 53446262..ad0342ec 100644 --- a/freebsd/sys/m32r/pci/pci_bus.c +++ b/freebsd/sys/m32r/pci/pci_bus.c @@ -60,7 +60,6 @@ static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin); #endif /* __rtems__ */ - int legacy_pcib_maxslots(device_t dev) { @@ -69,15 +68,9 @@ legacy_pcib_maxslots(device_t dev) /* 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)); } @@ -514,7 +507,6 @@ legacy_pcib_attach(device_t dev) if (pir != NULL) device_probe_and_attach(pir); } -#else /* __rtems__ */ #endif /* __rtems__ */ device_add_child(dev, "pci", bus); return bus_generic_attach(dev); diff --git a/freebsd/sys/m68k/m68k/legacy.c b/freebsd/sys/m68k/m68k/legacy.c index d2b0a78a..c81ccc5e 100644 --- a/freebsd/sys/m68k/m68k/legacy.c +++ b/freebsd/sys/m68k/m68k/legacy.c @@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef __rtems__ #include -#endif /* __rtems__ */ #ifdef DEV_MCA #include #endif diff --git a/freebsd/sys/m68k/pci/pci_bus.c b/freebsd/sys/m68k/pci/pci_bus.c index 53446262..ad0342ec 100644 --- a/freebsd/sys/m68k/pci/pci_bus.c +++ b/freebsd/sys/m68k/pci/pci_bus.c @@ -60,7 +60,6 @@ static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin); #endif /* __rtems__ */ - int legacy_pcib_maxslots(device_t dev) { @@ -69,15 +68,9 @@ legacy_pcib_maxslots(device_t dev) /* 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)); } @@ -514,7 +507,6 @@ legacy_pcib_attach(device_t dev) if (pir != NULL) device_probe_and_attach(pir); } -#else /* __rtems__ */ #endif /* __rtems__ */ device_add_child(dev, "pci", bus); return bus_generic_attach(dev); diff --git a/freebsd/sys/mips/mips/legacy.c b/freebsd/sys/mips/mips/legacy.c index d2b0a78a..c81ccc5e 100644 --- a/freebsd/sys/mips/mips/legacy.c +++ b/freebsd/sys/mips/mips/legacy.c @@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef __rtems__ #include -#endif /* __rtems__ */ #ifdef DEV_MCA #include #endif diff --git a/freebsd/sys/mips/pci/pci_bus.c b/freebsd/sys/mips/pci/pci_bus.c index 53446262..ad0342ec 100644 --- a/freebsd/sys/mips/pci/pci_bus.c +++ b/freebsd/sys/mips/pci/pci_bus.c @@ -60,7 +60,6 @@ static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin); #endif /* __rtems__ */ - int legacy_pcib_maxslots(device_t dev) { @@ -69,15 +68,9 @@ legacy_pcib_maxslots(device_t dev) /* 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)); } @@ -514,7 +507,6 @@ legacy_pcib_attach(device_t dev) if (pir != NULL) device_probe_and_attach(pir); } -#else /* __rtems__ */ #endif /* __rtems__ */ device_add_child(dev, "pci", bus); return bus_generic_attach(dev); diff --git a/freebsd/sys/net/if_gif.c b/freebsd/sys/net/if_gif.c index 10d1dcce..e309d73a 100644 --- a/freebsd/sys/net/if_gif.c +++ b/freebsd/sys/net/if_gif.c @@ -451,7 +451,7 @@ gif_output(ifp, m, dst, ro) af = dst->sa_family; BPF_MTAP2(ifp, &af, sizeof(af), m); - ifp->if_opackets++; + ifp->if_opackets++; ifp->if_obytes += m->m_pkthdr.len; /* override to IPPROTO_ETHERIP for bridged traffic */ @@ -476,7 +476,7 @@ gif_output(ifp, m, dst, ro) break; #endif default: - m_freem(m); + m_freem(m); error = ENETDOWN; } @@ -555,7 +555,7 @@ gif_input(m, af, ifp) } eip = mtod(m, struct etherip_header *); - /* + /* * GIF_ACCEPT_REVETHIP (enabled by default) intentionally * accepts an EtherIP packet with revered version field in * the header. This is a knob for backward compatibility @@ -639,7 +639,7 @@ gif_ioctl(ifp, cmd, data) case SIOCSIFADDR: ifp->if_flags |= IFF_UP; break; - + case SIOCSIFDSTADDR: break; diff --git a/freebsd/sys/net/if_gre.c b/freebsd/sys/net/if_gre.c index 24a4d876..2eb4433f 100644 --- a/freebsd/sys/net/if_gre.c +++ b/freebsd/sys/net/if_gre.c @@ -460,7 +460,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, error = EAFNOSUPPORT; goto end; } - + /* Reserve space for GRE header + optional GRE key */ int hdrlen = sizeof(struct greip) + extra; if (sc->key) diff --git a/freebsd/sys/net/if_stf.c b/freebsd/sys/net/if_stf.c index 4f0346f8..da09de7c 100644 --- a/freebsd/sys/net/if_stf.c +++ b/freebsd/sys/net/if_stf.c @@ -62,7 +62,7 @@ * ICMPv6: * - Redirects cannot be used due to the lack of link-local address. * - * stf interface does not have, and will not need, a link-local address. + * stf interface does not have, and will not need, a link-local address. * It seems to have no real benefit and does not help the above symptoms much. * Even if we assign link-locals to interface, we cannot really * use link-local unicast/multicast on top of 6to4 cloud (since there's no diff --git a/freebsd/sys/net/if_tap.c b/freebsd/sys/net/if_tap.c index 63861b41..b34b77de 100644 --- a/freebsd/sys/net/if_tap.c +++ b/freebsd/sys/net/if_tap.c @@ -463,7 +463,7 @@ tapcreate(struct cdev *dev) knlist_init_mtx(&tp->tap_rsel.si_note, &tp->tap_mtx); - TAPDEBUG("interface %s is created. minor = %#x\n", + TAPDEBUG("interface %s is created. minor = %#x\n", ifp->if_xname, dev2unit(dev)); } /* tapcreate */ @@ -567,7 +567,7 @@ tapclose(struct cdev *dev, int foo, int bar, struct thread *td) tp->tap_pid = 0; mtx_unlock(&tp->tap_mtx); - TAPDEBUG("%s is closed. minor = %#x\n", + TAPDEBUG("%s is closed. minor = %#x\n", ifp->if_xname, dev2unit(dev)); return (0); @@ -663,7 +663,7 @@ tapifstart(struct ifnet *ifp) struct mbuf *m; /* Unlocked read. */ - TAPDEBUG("%s not ready, tap_flags = 0x%x\n", ifp->if_xname, + TAPDEBUG("%s not ready, tap_flags = 0x%x\n", ifp->if_xname, tp->tap_flags); for (;;) { @@ -899,7 +899,7 @@ tapread(struct cdev *dev, struct uio *uio, int flag) } if (m != NULL) { - TAPDEBUG("%s dropping mbuf, minor = %#x\n", ifp->if_xname, + TAPDEBUG("%s dropping mbuf, minor = %#x\n", ifp->if_xname, dev2unit(dev)); m_freem(m); } @@ -921,7 +921,7 @@ tapwrite(struct cdev *dev, struct uio *uio, int flag) struct ifnet *ifp = tp->tap_ifp; struct mbuf *m; - TAPDEBUG("%s writting, minor = %#x\n", + TAPDEBUG("%s writting, minor = %#x\n", ifp->if_xname, dev2unit(dev)); if (uio->uio_resid == 0) @@ -983,7 +983,7 @@ tappoll(struct cdev *dev, int events, struct thread *td) struct ifnet *ifp = tp->tap_ifp; int revents = 0; - TAPDEBUG("%s polling, minor = %#x\n", + TAPDEBUG("%s polling, minor = %#x\n", ifp->if_xname, dev2unit(dev)); if (events & (POLLIN | POLLRDNORM)) { diff --git a/freebsd/sys/net/if_tun.c b/freebsd/sys/net/if_tun.c index d5f22cde..669c0b1b 100644 --- a/freebsd/sys/net/if_tun.c +++ b/freebsd/sys/net/if_tun.c @@ -622,7 +622,7 @@ tunoutput(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, /* BPF writes need to be handled specially. */ if (dst->sa_family == AF_UNSPEC) { bcopy(dst->sa_data, &af, sizeof(af)); - dst->sa_family = af; + dst->sa_family = af; } if (bpf_peers_present(ifp->if_bpf)) { diff --git a/freebsd/sys/net/netisr.c b/freebsd/sys/net/netisr.c index 53d96ba9..13e12147 100644 --- a/freebsd/sys/net/netisr.c +++ b/freebsd/sys/net/netisr.c @@ -1036,7 +1036,7 @@ netisr_start_swi(u_int cpuid, struct pcpu *pc) nws_array[nws_count] = nwsp->nws_cpu; nws_count++; NETISR_WUNLOCK(); -#endif +#endif /* __rtems__ */ } /* diff --git a/freebsd/sys/net/radix_mpath.c b/freebsd/sys/net/radix_mpath.c index 2af82da0..0f89bf5e 100644 --- a/freebsd/sys/net/radix_mpath.c +++ b/freebsd/sys/net/radix_mpath.c @@ -79,11 +79,11 @@ rn_mpath_next(struct radix_node *rn) return NULL; } -#ifdef __rtems__ -u_int32_t -#else +#ifndef __rtems__ uint32_t -#endif +#else /* __rtems__ */ +u_int32_t +#endif /* __rtems__ */ rn_mpath_count(struct radix_node *rn) { uint32_t i = 0; @@ -262,11 +262,11 @@ different: } void -#ifdef __rtems__ -rtalloc_mpath_fib(struct route *ro, u_int32_t hash, u_int fibnum) -#else +#ifndef __rtems__ rtalloc_mpath_fib(struct route *ro, uint32_t hash, u_int fibnum) -#endif +#else /* __rtems__ */ +rtalloc_mpath_fib(struct route *ro, u_int32_t hash, u_int fibnum) +#endif /* __rtems__ */ { struct radix_node *rn0, *rn; u_int32_t n; diff --git a/freebsd/sys/net/route.c b/freebsd/sys/net/route.c index 36e3ae73..a0589947 100644 --- a/freebsd/sys/net/route.c +++ b/freebsd/sys/net/route.c @@ -153,7 +153,7 @@ sysctl_my_fibnum(SYSCTL_HANDLER_ARGS) { int fibnum; int error; - + fibnum = curthread->td_proc->p_fibnum; error = sysctl_handle_int(oidp, &fibnum, 0, req); return (error); @@ -388,7 +388,7 @@ rtalloc1_fib(struct sockaddr *dst, int report, u_long ignflags, needlock = !(ignflags & RTF_RNH_LOCKED); if (needlock) RADIX_NODE_HEAD_RLOCK(rnh); -#ifdef INVARIANTS +#ifdef INVARIANTS else RADIX_NODE_HEAD_LOCK_ASSERT(rnh); #endif @@ -403,7 +403,7 @@ rtalloc1_fib(struct sockaddr *dst, int report, u_long ignflags, } else if (needlock) RADIX_NODE_HEAD_RUNLOCK(rnh); - + /* * Either we hit the root or couldn't find any match, * Which basically means @@ -588,7 +588,7 @@ rtredirect_fib(struct sockaddr *dst, create: rt0 = rt; rt = NULL; - + flags |= RTF_GATEWAY | RTF_DYNAMIC; bzero((caddr_t)&info, sizeof(info)); info.rti_info[RTAX_DST] = dst; @@ -607,7 +607,7 @@ rtredirect_fib(struct sockaddr *dst, } if (rt0 != NULL) RTFREE(rt0); - + stat = &V_rtstat.rts_dynamic; } else { struct rtentry *gwrt; @@ -983,12 +983,12 @@ rn_mpath_update(int req, struct rt_addrinfo *info, RT_UNLOCK(rto); } else if (rt->rt_flags & RTF_GATEWAY) { /* - * For gateway routes, we need to + * For gateway routes, we need to * make sure that we we are deleting - * the correct gateway. - * rt_mpath_matchgate() does not + * the correct gateway. + * rt_mpath_matchgate() does not * check the case when there is only - * one route in the chain. + * one route in the chain. */ if (gateway && (rt->rt_gateway->sa_len != gateway->sa_len || @@ -1003,19 +1003,19 @@ rn_mpath_update(int req, struct rt_addrinfo *info, KASSERT(rt == RNTORT(rn), ("radix node disappeared")); goto gwdelete; } - + } /* * use the normal delete code to remove * the first entry */ - if (req != RTM_DELETE) + if (req != RTM_DELETE) goto nondelete; error = ENOENT; goto done; } - + /* * if the entry is 2nd and on up */ @@ -1033,11 +1033,11 @@ gwdelete: */ V_rttrash++; } - + nondelete: if (req != RTM_DELETE) panic("unrecognized request %d", req); - + /* * If the caller wants it, then it can have it, @@ -1165,7 +1165,7 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt, case RTM_ADD: if ((flags & RTF_GATEWAY) && !gateway) senderr(EINVAL); - if (dst && gateway && (dst->sa_family != gateway->sa_family) && + if (dst && gateway && (dst->sa_family != gateway->sa_family) && (gateway->sa_family != AF_UNSPEC) && (gateway->sa_family != AF_LINK)) senderr(EINVAL); @@ -1251,7 +1251,7 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt, struct sockaddr *mask; u_char *m, *n; int len; - + /* * compare mask to see if the new route is * more specific than the existing one @@ -1261,7 +1261,7 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt, RT_ADDREF(rt0); RT_UNLOCK(rt0); /* - * A host route is already present, so + * A host route is already present, so * leave the flow-table entries as is. */ if (rt0->rt_flags & RTF_HOST) { @@ -1305,7 +1305,7 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt, RTFREE(rt0); #endif senderr(EEXIST); - } + } #ifdef FLOWTABLE else if (rt0 != NULL) { switch (dst->sa_family) { @@ -1373,7 +1373,7 @@ rt_setgate(struct rtentry *rt, struct sockaddr *dst, struct sockaddr *gate) RT_LOCK_ASSERT(rt); RADIX_NODE_HEAD_LOCK_ASSERT(rnh); - + /* * Prepare to store the gateway in rt->rt_gateway. * Both dst and gateway are stored one after the other in the same @@ -1522,7 +1522,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fibnum) if (rn_mpath_capable(rnh)) { rn = rnh->rnh_matchaddr(dst, rnh); - if (rn == NULL) + if (rn == NULL) error = ESRCH; else { rt = RNTORT(rn); @@ -1535,7 +1535,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fibnum) */ rt = rt_mpath_matchgate(rt, ifa->ifa_addr); - if (!rt) + if (!rt) error = ESRCH; } } @@ -1559,7 +1559,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fibnum) info.rti_ifa = ifa; info.rti_flags = flags | (ifa->ifa_flags & ~IFA_RTSELF); info.rti_info[RTAX_DST] = dst; - /* + /* * doing this for compatibility reasons */ if (cmd == RTM_ADD) @@ -1590,7 +1590,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fibnum) rt->rt_ifa = ifa; } #endif - /* + /* * doing this for compatibility reasons */ if (cmd == RTM_ADD) { diff --git a/freebsd/sys/net/rtsock.c b/freebsd/sys/net/rtsock.c index c1a263d8..a421fd61 100644 --- a/freebsd/sys/net/rtsock.c +++ b/freebsd/sys/net/rtsock.c @@ -636,7 +636,7 @@ route_output(struct mbuf *m, struct socket *so) * The given gateway address may be an interface address. * For example, issuing a "route change" command on a route * entry that was created from a tunnel, and the gateway - * address given is the local end point. In this case the + * address given is the local end point. In this case the * RTF_GATEWAY flag must be cleared or the destination will * not be reachable even though there is no error message. */ @@ -647,11 +647,11 @@ route_output(struct mbuf *m, struct socket *so) bzero(&gw_ro, sizeof(gw_ro)); gw_ro.ro_dst = *info.rti_info[RTAX_GATEWAY]; rtalloc_ign_fib(&gw_ro, 0, so->so_fibnum); - /* - * A host route through the loopback interface is + /* + * A host route through the loopback interface is * installed for each interface adddress. In pre 8.0 * releases the interface address of a PPP link type - * is not reachable locally. This behavior is fixed as + * is not reachable locally. This behavior is fixed as * part of the new L2/L3 redesign and rewrite work. The * signature of this interface address route is the * AF_LINK sa_family type of the rt_gateway, and the @@ -694,7 +694,7 @@ route_output(struct mbuf *m, struct socket *so) case RTM_DELETE: saved_nrt = NULL; /* support for new ARP code */ - if (info.rti_info[RTAX_GATEWAY] && + if (info.rti_info[RTAX_GATEWAY] && (info.rti_info[RTAX_GATEWAY]->sa_family == AF_LINK) && (rtm->rtm_flags & RTF_LLDATA) != 0) { error = lla_rt_output(rtm, &info); @@ -750,7 +750,7 @@ route_output(struct mbuf *m, struct socket *so) if (rtm->rtm_flags & RTF_ANNOUNCE) { struct sockaddr laddr; - if (rt->rt_ifp != NULL && + if (rt->rt_ifp != NULL && rt->rt_ifp->if_type == IFT_PROPVIRTUAL) { struct ifaddr *ifa; @@ -763,7 +763,7 @@ route_output(struct mbuf *m, struct socket *so) rt_maskedcopy(rt->rt_ifa->ifa_addr, &laddr, rt->rt_ifa->ifa_netmask); - /* + /* * refactor rt and no lock operation necessary */ rt = (struct rtentry *)rnh->rnh_matchaddr(&laddr, rnh); @@ -771,12 +771,12 @@ route_output(struct mbuf *m, struct socket *so) RADIX_NODE_HEAD_RUNLOCK(rnh); senderr(ESRCH); } - } + } RT_LOCK(rt); RT_ADDREF(rt); RADIX_NODE_HEAD_RUNLOCK(rnh); - /* + /* * Fix for PR: 82974 * * RTM_CHANGE/LOCK need a perfect match, rn_lookup() @@ -789,7 +789,7 @@ route_output(struct mbuf *m, struct socket *so) * perfect match. */ - if (rtm->rtm_type != RTM_GET && + if (rtm->rtm_type != RTM_GET && (!rt_mask(rt) != !info.rti_info[RTAX_NETMASK])) { RT_UNLOCK(rt); senderr(ESRCH); @@ -806,7 +806,7 @@ route_output(struct mbuf *m, struct socket *so) rt_key(rt)) != 0) { RT_UNLOCK(rt); senderr(ESRCH); - } + } info.rti_info[RTAX_DST] = rt_key(rt); info.rti_info[RTAX_GATEWAY] = rt->rt_gateway; info.rti_info[RTAX_NETMASK] = rt_mask(rt); @@ -819,7 +819,7 @@ route_output(struct mbuf *m, struct socket *so) error = rtm_get_jailed(&info, ifp, rt, &saun, curthread->td_ucred); if (error != 0) { - RT_UNLOCK(rt); + RT_UNLOCK(rt); senderr(error); } if (ifp->if_flags & IFF_POINTOPOINT) @@ -889,7 +889,7 @@ route_output(struct mbuf *m, struct socket *so) RT_UNLOCK(rt); RADIX_NODE_HEAD_LOCK(rnh); RT_LOCK(rt); - + error = rt_setgate(rt, rt_key(rt), info.rti_info[RTAX_GATEWAY]); RADIX_NODE_HEAD_UNLOCK(rnh); @@ -1032,7 +1032,7 @@ rt_xaddrs(caddr_t cp, caddr_t cplim, struct rt_addrinfo *rtinfo) /* * there are no more.. quit now * If there are more bits, they are in error. - * I've seen this. route(1) can evidently generate these. + * I've seen this. route(1) can evidently generate these. * This causes kernel to core dump. * for compatibility, If we see this, point to a safe address. */ diff --git a/freebsd/sys/net80211/ieee80211_amrr.c b/freebsd/sys/net80211/ieee80211_amrr.c index 7b340bbe..b453c2f4 100644 --- a/freebsd/sys/net80211/ieee80211_amrr.c +++ b/freebsd/sys/net80211/ieee80211_amrr.c @@ -67,7 +67,7 @@ static int amrr_update(struct ieee80211_amrr *, struct ieee80211_amrr_node *, struct ieee80211_node *); static int amrr_rate(struct ieee80211_node *, void *, uint32_t); static void amrr_tx_complete(const struct ieee80211vap *, - const struct ieee80211_node *, int, + const struct ieee80211_node *, int, void *, void *); static void amrr_tx_update(const struct ieee80211vap *vap, const struct ieee80211_node *, void *, void *, void *); diff --git a/freebsd/sys/net80211/ieee80211_var.h b/freebsd/sys/net80211/ieee80211_var.h index 58a46d3b..d790bfc2 100644 --- a/freebsd/sys/net80211/ieee80211_var.h +++ b/freebsd/sys/net80211/ieee80211_var.h @@ -419,7 +419,7 @@ struct ieee80211vap { int (*iv_key_alloc)(struct ieee80211vap *, struct ieee80211_key *, ieee80211_keyix *, ieee80211_keyix *); - int (*iv_key_delete)(struct ieee80211vap *, + int (*iv_key_delete)(struct ieee80211vap *, const struct ieee80211_key *); int (*iv_key_set)(struct ieee80211vap *, const struct ieee80211_key *, @@ -718,7 +718,7 @@ ieee80211_draintask(struct ieee80211com *ic, struct task *task) taskqueue_drain(ic->ic_tq, task); } -/* +/* * Key update synchronization methods. XXX should not be visible. */ static __inline void diff --git a/freebsd/sys/netinet/in.c b/freebsd/sys/netinet/in.c index 310800cd..7bf52c6b 100644 --- a/freebsd/sys/netinet/in.c +++ b/freebsd/sys/netinet/in.c @@ -347,7 +347,7 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp, IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { iap = ifatoia(ifa); - if (iap->ia_addr.sin_family == AF_INET) { + if (iap->ia_addr.sin_family == AF_INET) { if (td != NULL && prison_check_ip4(td->td_ucred, &iap->ia_addr.sin_addr) != 0) @@ -541,13 +541,13 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp, hostIsNew = 0; } if (ifra->ifra_mask.sin_len) { - /* + /* * QL: XXX * Need to scrub the prefix here in case * the issued command is SIOCAIFADDR with * the same address, but with a different * prefix length. And if the prefix length - * is the same as before, then the call is + * is the same as before, then the call is * un-necessarily executed here. */ in_ifscrub(ifp, ia, LLE_STATIC); @@ -880,11 +880,11 @@ in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin, if (ia->ia_addr.sin_family == AF_INET) LIST_INSERT_HEAD(INADDR_HASH( ia->ia_addr.sin_addr.s_addr), ia, ia_hash); - else - /* - * If oldaddr family is not AF_INET (e.g. - * interface has been just created) in_control - * does not call LIST_REMOVE, and we end up + else + /* + * If oldaddr family is not AF_INET (e.g. + * interface has been just created) in_control + * does not call LIST_REMOVE, and we end up * with bogus ia entries in hash */ LIST_REMOVE(ia, ia_hash); @@ -966,7 +966,7 @@ in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin, RT_ADDREF(ia_ro.ro_rt); RTFREE_LOCKED(ia_ro.ro_rt); } else - error = ifa_add_loopback_route((struct ifaddr *)ia, + error = ifa_add_loopback_route((struct ifaddr *)ia, (struct sockaddr *)&ia->ia_addr); if (error == 0) ia->ia_flags |= IFA_RTSELF; @@ -982,10 +982,10 @@ in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin, ? RTF_HOST : 0) /* - * Generate a routing message when inserting or deleting + * Generate a routing message when inserting or deleting * an interface address alias. */ -static void in_addralias_rtmsg(int cmd, struct in_addr *prefix, +static void in_addralias_rtmsg(int cmd, struct in_addr *prefix, struct in_ifaddr *target) { struct route pfx_ro; @@ -1008,14 +1008,14 @@ static void in_addralias_rtmsg(int cmd, struct in_addr *prefix, /* QL: XXX * Point the gateway to the new interface - * address as if a new prefix route entry has - * been added through the new address alias. - * All other parts of the rtentry is accurate, + * address as if a new prefix route entry has + * been added through the new address alias. + * All other parts of the rtentry is accurate, * e.g., rt_key, rt_mask, rt_ifp etc. */ - msg_rt.rt_gateway = + msg_rt.rt_gateway = (struct sockaddr *)&target->ia_addr; - rt_newaddrmsg(cmd, + rt_newaddrmsg(cmd, (struct ifaddr *)target, 0, &msg_rt); RTFREE(pfx_ro.ro_rt); @@ -1065,7 +1065,7 @@ in_addprefix(struct in_ifaddr *target, int flags) */ if (ia->ia_flags & IFA_ROUTE) { #ifdef RADIX_MPATH - if (ia->ia_addr.sin_addr.s_addr == + if (ia->ia_addr.sin_addr.s_addr == target->ia_addr.sin_addr.s_addr) { IN_IFADDR_RUNLOCK(); return (EEXIST); @@ -1383,7 +1383,7 @@ in_lltable_free(struct lltable *llt, struct llentry *lle) (((ntohl((d)->sin_addr.s_addr) ^ (a)->sin_addr.s_addr) & (m)->sin_addr.s_addr)) == 0 ) static void -in_lltable_prefix_free(struct lltable *llt, +in_lltable_prefix_free(struct lltable *llt, const struct sockaddr *prefix, const struct sockaddr *mask, u_int flags) @@ -1521,7 +1521,7 @@ in_lltable_lookup(struct lltable *llt, u_int flags, const struct sockaddr *l3add if (lle == NULL) { #ifdef DIAGNOSTIC if (flags & LLE_DELETE) - log(LOG_INFO, "interface address is missing from cache = %p in delete\n", lle); + log(LOG_INFO, "interface address is missing from cache = %p in delete\n", lle); #endif if (!(flags & LLE_CREATE)) return (NULL); @@ -1554,11 +1554,11 @@ in_lltable_lookup(struct lltable *llt, u_int flags, const struct sockaddr *l3add lle->la_flags = LLE_DELETED; LLE_WUNLOCK(lle); #ifdef DIAGNOSTIC - log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); + log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); #endif } lle = (void *)-1; - + } if (LLE_IS_VALID(lle)) { if (flags & LLE_EXCLUSIVE) @@ -1590,7 +1590,7 @@ in_lltable_dump(struct lltable *llt, struct sysctl_req *wr) for (i = 0; i < LLTBL_HASHTBL_SIZE; i++) { LIST_FOREACH(lle, &llt->lle_head[i], lle_next) { struct sockaddr_dl *sdl; - + /* skip deleted entries */ if ((lle->la_flags & LLE_DELETED) == LLE_DELETED) continue; diff --git a/freebsd/sys/netinet/in_pcb.c b/freebsd/sys/netinet/in_pcb.c index c6f4c6f7..2b50ae8f 100644 --- a/freebsd/sys/netinet/in_pcb.c +++ b/freebsd/sys/netinet/in_pcb.c @@ -471,12 +471,12 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp, sin->sin_port = 0; /* yech... */ bzero(&sin->sin_zero, sizeof(sin->sin_zero)); /* - * Is the address a local IP address? + * Is the address a local IP address? * If INP_BINDANY is set, then the socket may be bound * to any endpoint address, local or not. */ if ((inp->inp_flags & INP_BINDANY) == 0 && - ifa_ifwithaddr_check((struct sockaddr *)sin) == 0) + ifa_ifwithaddr_check((struct sockaddr *)sin) == 0) return (EADDRNOTAVAIL); } laddr = sin->sin_addr; @@ -645,7 +645,7 @@ in_pcbladdr(struct inpcb *inp, struct in_addr *faddr, struct in_addr *laddr, /* * If we found a route, use the address corresponding to * the outgoing interface. - * + * * Otherwise assume faddr is reachable on a directly connected * network and try to find a corresponding interface to take * the source address from. @@ -1191,8 +1191,9 @@ in_getpeeraddr(struct socket *so, struct sockaddr **nam) *nam = in_sockaddr(port, &addr); return 0; } - -void in_pcbnotifyall(struct inpcbinfo *pcbinfo, struct in_addr faddr, int errno, + +void +in_pcbnotifyall(struct inpcbinfo *pcbinfo, struct in_addr faddr, int errno, struct inpcb *(*notify)(struct inpcb *, int)) { struct inpcb *inp, *inp_temp; diff --git a/freebsd/sys/netinet/ip_carp.c b/freebsd/sys/netinet/ip_carp.c index aaed21de..a08c3fb8 100644 --- a/freebsd/sys/netinet/ip_carp.c +++ b/freebsd/sys/netinet/ip_carp.c @@ -53,9 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef __rtems__ #include -#endif #include @@ -134,7 +132,7 @@ struct carp_softc { struct callout sc_ad_tmo; /* advertisement timeout */ struct callout sc_md_tmo; /* master down timeout */ struct callout sc_md6_tmo; /* master down timeout */ - + LIST_ENTRY(carp_softc) sc_next; /* Interface clue */ }; #define SC2IFP(sc) ((sc)->sc_ifp) @@ -400,7 +398,7 @@ carp_clone_create(struct if_clone *ifc, int unit, caddr_t params) free(sc, M_CARP); return (ENOSPC); } - + sc->sc_flags_backup = 0; sc->sc_suppress = 0; sc->sc_advbase = CARP_DFLTINTV; @@ -426,7 +424,7 @@ carp_clone_create(struct if_clone *ifc, int unit, caddr_t params) callout_init(&sc->sc_ad_tmo, CALLOUT_MPSAFE); callout_init(&sc->sc_md_tmo, CALLOUT_MPSAFE); callout_init(&sc->sc_md6_tmo, CALLOUT_MPSAFE); - + ifp->if_softc = sc; if_initname(ifp, CARP_IFNAME, unit); ifp->if_mtu = ETHERMTU; @@ -1259,7 +1257,7 @@ carp_iamatch6(struct ifnet *ifp, struct in6_addr *taddr) IF_ADDR_RUNLOCK(SC2IFP(vh)); } CARP_UNLOCK(cif); - + return (NULL); } @@ -1559,7 +1557,7 @@ carp_set_addr(struct carp_softc *sc, struct sockaddr_in *sin) free(cif, M_CARP); goto cleanup; } - + CARP_LOCK_INIT(cif); CARP_LOCK(cif); cif->vhif_ifp = ifp; diff --git a/freebsd/sys/netinet/ip_mroute.c b/freebsd/sys/netinet/ip_mroute.c index f35aa002..18419a74 100644 --- a/freebsd/sys/netinet/ip_mroute.c +++ b/freebsd/sys/netinet/ip_mroute.c @@ -652,7 +652,7 @@ if_detached_event(void *arg __unused, struct ifnet *ifp) MROUTER_UNLOCK(); } - + /* * Enable multicast forwarding. */ @@ -747,7 +747,7 @@ X_ip_mrouter_done(void) bzero((caddr_t)V_viftable, sizeof(V_viftable)); V_numvifs = 0; V_pim_assert_enabled = 0; - + VIF_UNLOCK(); callout_stop(&V_expire_upcalls_ch); @@ -2835,7 +2835,7 @@ vnet_mroute_uninit(const void *unused __unused) V_nexpire = NULL; } -VNET_SYSUNINIT(vnet_mroute_uninit, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, +VNET_SYSUNINIT(vnet_mroute_uninit, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, vnet_mroute_uninit, NULL); static int @@ -2846,7 +2846,7 @@ ip_mroute_modevent(module_t mod, int type, void *unused) case MOD_LOAD: MROUTER_LOCK_INIT(); - if_detach_event_tag = EVENTHANDLER_REGISTER(ifnet_departure_event, + if_detach_event_tag = EVENTHANDLER_REGISTER(ifnet_departure_event, if_detached_event, NULL, EVENTHANDLER_PRI_ANY); if (if_detach_event_tag == NULL) { printf("ip_mroute: unable to ifnet_deperture_even handler\n"); @@ -2864,8 +2864,8 @@ ip_mroute_modevent(module_t mod, int type, void *unused) printf("WARNING: %s not a power of 2; using default\n", "net.inet.ip.mfchashsize"); mfchashsize = MFCHASHSIZE; - } -#endif + } +#endif /* __rtems__ */ pim_squelch_wholepkt = 0; TUNABLE_ULONG_FETCH("net.inet.pim.squelch_wholepkt", diff --git a/freebsd/sys/netinet/libalias/alias.c b/freebsd/sys/netinet/libalias/alias.c index 9dee1e93..09db9153 100644 --- a/freebsd/sys/netinet/libalias/alias.c +++ b/freebsd/sys/netinet/libalias/alias.c @@ -141,9 +141,9 @@ __FBSDID("$FreeBSD$"); #include #else #include -#include -#include -#include +#include "alias.h" +#include "alias_local.h" +#include "alias_mod.h" #endif /* diff --git a/freebsd/sys/netinet/libalias/alias_cuseeme.c b/freebsd/sys/netinet/libalias/alias_cuseeme.c index a27e937f..1db9a138 100644 --- a/freebsd/sys/netinet/libalias/alias_cuseeme.c +++ b/freebsd/sys/netinet/libalias/alias_cuseeme.c @@ -51,8 +51,8 @@ __FBSDID("$FreeBSD$"); #include #include #else -#include -#include +#include "alias_local.h" +#include "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 3eb31b63..7385027c 100644 --- a/freebsd/sys/netinet/libalias/alias_db.c +++ b/freebsd/sys/netinet/libalias/alias_db.c @@ -158,21 +158,21 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #endif #include #include -#ifdef _KERNEL +#ifdef _KERNEL #include #include #include #include #else -#include -#include -#include +#include "alias.h" +#include "alias_local.h" +#include "alias_mod.h" #endif static LIST_HEAD(, libalias) instancehead = LIST_HEAD_INITIALIZER(instancehead); @@ -465,9 +465,9 @@ SeqDiff(u_long x, u_long y) static void AliasLog(char *str, const char *format, ...) -{ +{ va_list ap; - + va_start(ap, format); vsnprintf(str, LIBALIAS_BUF_SIZE, format, ap); va_end(ap); @@ -477,7 +477,7 @@ static void AliasLog(FILE *stream, const char *format, ...) { va_list ap; - + va_start(ap, format); vfprintf(stream, format, ap); va_end(ap); @@ -492,12 +492,12 @@ ShowAliasStats(struct libalias *la) LIBALIAS_LOCK_ASSERT(la); /* Used for debugging */ if (la->logDesc) { - int tot = la->icmpLinkCount + la->udpLinkCount + + int tot = la->icmpLinkCount + la->udpLinkCount + (la->sctpLinkCount>>1) + /* sctp counts half associations */ la->tcpLinkCount + la->pptpLinkCount + la->protoLinkCount + la->fragmentIdLinkCount + la->fragmentPtrLinkCount; - + AliasLog(la->logDesc, "icmp=%u, udp=%u, tcp=%u, sctp=%u, pptp=%u, proto=%u, frag_id=%u frag_ptr=%u / tot=%u", la->icmpLinkCount, @@ -509,7 +509,7 @@ ShowAliasStats(struct libalias *la) la->fragmentIdLinkCount, la->fragmentPtrLinkCount, tot); #ifndef _KERNEL - AliasLog(la->logDesc, " (sock=%u)\n", la->sockCount); + AliasLog(la->logDesc, " (sock=%u)\n", la->sockCount); #endif } } @@ -1417,7 +1417,7 @@ FindFragmentIn2(struct libalias *la, struct in_addr dst_addr, /* Doesn't add a l struct in_addr alias_addr, /* is not found. */ u_short ip_id) { - + LIBALIAS_LOCK_ASSERT(la); return FindLinkIn(la, dst_addr, alias_addr, NO_DEST_PORT, ip_id, @@ -1904,7 +1904,7 @@ GetAliasAddress(struct alias_link *lnk) struct in_addr GetDefaultAliasAddress(struct libalias *la) { - + LIBALIAS_LOCK_ASSERT(la); return (la->aliasAddress); } @@ -2064,7 +2064,7 @@ packet size was altered is searched. // XXX ip free void -AddSeq(struct alias_link *lnk, int delta, u_int ip_hl, u_short ip_len, +AddSeq(struct alias_link *lnk, int delta, u_int ip_hl, u_short ip_len, u_long th_seq, u_int th_off) { /* @@ -2117,7 +2117,7 @@ SetExpire(struct alias_link *lnk, int expire) void ClearCheckNewLink(struct libalias *la) { - + LIBALIAS_LOCK_ASSERT(la); la->newDefaultLink = 0; } @@ -2217,11 +2217,11 @@ InitPacketAliasLog(struct libalias *la) #ifdef _KERNEL if ((la->logDesc = malloc(LIBALIAS_BUF_SIZE))) ; -#else +#else if ((la->logDesc = fopen("/var/log/alias.log", "w"))) - fprintf(la->logDesc, "PacketAlias/InitPacketAliasLog: Packet alias logging enabled.\n"); + fprintf(la->logDesc, "PacketAlias/InitPacketAliasLog: Packet alias logging enabled.\n"); #endif - else + else return (ENOMEM); /* log initialization failed */ la->packetAliasMode |= PKT_ALIAS_LOG; } diff --git a/freebsd/sys/netinet/libalias/alias_dummy.c b/freebsd/sys/netinet/libalias/alias_dummy.c index 6298ecca..ac89d8d7 100644 --- a/freebsd/sys/netinet/libalias/alias_dummy.c +++ b/freebsd/sys/netinet/libalias/alias_dummy.c @@ -54,8 +54,8 @@ __FBSDID("$FreeBSD$"); #include #include #else -#include -#include +#include "alias_local.h" +#include "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 d449bcfc..fbc9c564 100644 --- a/freebsd/sys/netinet/libalias/alias_ftp.c +++ b/freebsd/sys/netinet/libalias/alias_ftp.c @@ -95,8 +95,8 @@ __FBSDID("$FreeBSD$"); #include #include #else -#include -#include +#include "alias_local.h" +#include "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 353d3332..240c0f61 100644 --- a/freebsd/sys/netinet/libalias/alias_irc.c +++ b/freebsd/sys/netinet/libalias/alias_irc.c @@ -77,8 +77,8 @@ __FBSDID("$FreeBSD$"); #include #include #else -#include -#include +#include "alias_local.h" +#include "alias_mod.h" #endif #define IRC_CONTROL_PORT_NUMBER_1 6667 @@ -91,14 +91,14 @@ char *newpacket; #define DBprintf(a) static void -AliasHandleIrcOut(struct libalias *, struct ip *, struct alias_link *, +AliasHandleIrcOut(struct libalias *, struct ip *, struct alias_link *, int maxpacketsize); -static int +static int fingerprint(struct libalias *la, struct alias_data *ah) { - if (ah->dport == NULL || ah->dport == NULL || ah->lnk == NULL || + if (ah->dport == NULL || ah->dport == NULL || ah->lnk == NULL || ah->maxpktsize == 0) return (-1); if (ntohs(*ah->dport) == IRC_CONTROL_PORT_NUMBER_1 @@ -107,7 +107,7 @@ fingerprint(struct libalias *la, struct alias_data *ah) return (-1); } -static int +static int protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) { @@ -120,13 +120,13 @@ protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) } struct proto_handler handlers[] = { - { - .pri = 90, - .dir = OUT, - .proto = TCP, - .fingerprint = &fingerprint, + { + .pri = 90, + .dir = OUT, + .proto = TCP, + .fingerprint = &fingerprint, .protohandler = &protohandler - }, + }, { EOH } }; @@ -151,7 +151,7 @@ mod_handler(module_t mod, int type, void *data) } #ifdef _KERNEL -static +static #endif moduledata_t alias_mod = { "alias_irc", mod_handler, NULL @@ -441,7 +441,7 @@ lPACKET_DONE: int delta; SetAckModified(lnk); - tc = (struct tcphdr *)ip_next(pip); + tc = (struct tcphdr *)ip_next(pip); delta = GetDeltaSeqOut(tc->th_seq, lnk); AddSeq(lnk, delta + copyat + iCopy - dlen, pip->ip_hl, pip->ip_len, tc->th_seq, tc->th_off); diff --git a/freebsd/sys/netinet/libalias/alias_local.h b/freebsd/sys/netinet/libalias/alias_local.h index 307442cd..db58bca0 100644 --- a/freebsd/sys/netinet/libalias/alias_local.h +++ b/freebsd/sys/netinet/libalias/alias_local.h @@ -60,7 +60,7 @@ #include #else -#include +#include "alias_sctp.h" #endif /* Sizes of input and output link tables */ diff --git a/freebsd/sys/netinet/libalias/alias_mod.c b/freebsd/sys/netinet/libalias/alias_mod.c index daf55b82..09fa3624 100644 --- a/freebsd/sys/netinet/libalias/alias_mod.c +++ b/freebsd/sys/netinet/libalias/alias_mod.c @@ -49,8 +49,8 @@ __FBSDID("$FreeBSD$"); #include #include #else -#include -#include +#include "alias_local.h" +#include "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 e9dfc724..727df8e6 100644 --- a/freebsd/sys/netinet/libalias/alias_mod.h +++ b/freebsd/sys/netinet/libalias/alias_mod.h @@ -57,30 +57,30 @@ MALLOC_DECLARE(M_ALIAS); /* Protocol handlers struct & function. */ /* Packet flow direction. */ -#define IN 1 -#define OUT 2 +#define IN 1 +#define OUT 2 /* Working protocol. */ #define IP 1 #define TCP 2 #define UDP 4 -/* +/* * Data passed to protocol handler module, it must be filled * right before calling find_handler() to determine which * module is elegible to be called. */ -struct alias_data { - struct alias_link *lnk; +struct alias_data { + struct alias_link *lnk; struct in_addr *oaddr; /* Original address. */ - struct in_addr *aaddr; /* Alias address. */ + struct in_addr *aaddr; /* Alias address. */ uint16_t *aport; /* Alias port. */ uint16_t *sport, *dport; /* Source & destination port */ uint16_t maxpktsize; /* Max packet size. */ -}; +}; -/* +/* * This structure contains all the information necessary to make * a protocol handler correctly work. */ @@ -88,29 +88,29 @@ struct alias_data { struct proto_handler { u_int pri; /* Handler priority. */ int16_t dir; /* Flow direction. */ - uint8_t proto; /* Working protocol. */ + uint8_t proto; /* Working protocol. */ int (*fingerprint)(struct libalias *, /* Fingerprint * function. */ - struct alias_data *); + struct alias_data *); int (*protohandler)(struct libalias *, /* Aliasing * function. */ - struct ip *, struct alias_data *); + struct ip *, struct alias_data *); LIST_ENTRY(proto_handler) entries; }; -/* +/* * Used only in userland when libalias needs to keep track of all * module loaded. In kernel land (kld mode) we don't need to care * care about libalias modules cause it's kld to do it for us. */ #define DLL_LEN 32 -struct dll { +struct dll { char name[DLL_LEN]; /* Name of module. */ - void *handle; /* + void *handle; /* * Ptr to shared obj obtained through * dlopen() - use this ptr to get access - * to any symbols from a loaded module - * via dlsym(). + * to any symbols from a loaded module + * via dlsym(). */ SLIST_ENTRY(dll) next; }; @@ -122,7 +122,7 @@ void handler_chain_destroy(void); int LibAliasAttachHandlers(struct proto_handler *); int LibAliasDetachHandlers(struct proto_handler *); int detach_handler(struct proto_handler *); -int find_handler(int8_t, int8_t, struct libalias *, +int find_handler(int8_t, int8_t, struct libalias *, struct ip *, struct alias_data *); struct proto_handler *first_handler(void); @@ -137,7 +137,7 @@ struct dll *walk_dll_chain(void); /* End of handlers. */ #define EOH -1 -/* +/* * Some defines borrowed from sys/module.h used to compile a kld * in userland as a shared lib. */ @@ -149,7 +149,7 @@ typedef enum modeventtype { MOD_SHUTDOWN, MOD_QUIESCE } modeventtype_t; - + typedef struct module *module_t; typedef int (*modeventhand_t)(module_t, int /* modeventtype_t */, void *); diff --git a/freebsd/sys/netinet/libalias/alias_nbt.c b/freebsd/sys/netinet/libalias/alias_nbt.c index 1add2fa3..8cbf2582 100644 --- a/freebsd/sys/netinet/libalias/alias_nbt.c +++ b/freebsd/sys/netinet/libalias/alias_nbt.c @@ -64,8 +64,8 @@ __FBSDID("$FreeBSD$"); #include #include #else -#include -#include +#include "alias_local.h" +#include "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 59c7af82..60d2999e 100644 --- a/freebsd/sys/netinet/libalias/alias_pptp.c +++ b/freebsd/sys/netinet/libalias/alias_pptp.c @@ -61,9 +61,9 @@ __FBSDID("$FreeBSD$"); #include #include #else -#include -#include -#include +#include "alias.h" +#include "alias_local.h" +#include "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 ec0a158c..e2234333 100644 --- a/freebsd/sys/netinet/libalias/alias_proxy.c +++ b/freebsd/sys/netinet/libalias/alias_proxy.c @@ -78,8 +78,8 @@ __FBSDID("$FreeBSD$"); #include #else #include -#include /* Public API functions for libalias */ -#include /* Functions used by alias*.c */ +#include "alias.h" /* Public API functions for libalias */ +#include "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 ed0279b3..c8d83878 100644 --- a/freebsd/sys/netinet/libalias/alias_sctp.c +++ b/freebsd/sys/netinet/libalias/alias_sctp.c @@ -85,10 +85,10 @@ #include #include #else -#include +#include "alias_sctp.h" #include -#include -#include +#include "alias.h" +#include "alias_local.h" #include #include #endif //#ifdef _KERNEL diff --git a/freebsd/sys/netinet/libalias/alias_sctp.h b/freebsd/sys/netinet/libalias/alias_sctp.h index b6ad6f17..8c244b45 100644 --- a/freebsd/sys/netinet/libalias/alias_sctp.h +++ b/freebsd/sys/netinet/libalias/alias_sctp.h @@ -25,7 +25,7 @@ */ /* - * Alias_sctp forms part of the libalias kernel module to handle + * Alias_sctp forms part of the libalias kernel module to handle * Network Address Translation (NAT) for the SCTP protocol. * * This software was developed by David A. Hayes @@ -38,7 +38,7 @@ * proposed by Jason But and Grenville Armitage: * http://caia.swin.edu.au/urp/sonata/ * - * + * * This project has been made possible in part by a grant from * the Cisco University Research Program Fund at Community * Foundation Silicon Valley. @@ -51,7 +51,7 @@ #define _ALIAS_SCTP_H_ #include -#ifdef _KERNEL +#ifdef _KERNEL #include #include #include @@ -59,7 +59,7 @@ #include #include #include -#endif // #ifdef _KERNEL +#endif // #ifdef _KERNEL #include #include @@ -73,7 +73,7 @@ /** * 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 #include @@ -165,20 +165,19 @@ union sctpChunkOfInt { /** * @brief SCTP message - * + * * Structure containing the relevant information from the SCTP message */ struct sctp_nat_msg { uint16_t msg; /**< one of the key messages defined above */ -#ifndef __rtems__ #ifdef INET6 // struct ip6_hdr *ip_hdr; /**< pointer to ip packet header */ /*no inet6 support yet*/ +#ifdef __rtems__ + struct ip *ip_hdr; /**< pointer to ip packet header */ +#endif /* __rtems__ */ #else struct ip *ip_hdr; /**< pointer to ip packet header */ #endif //#ifdef INET6 -#else //__rtems__ - struct ip *ip_hdr; /**< pointer to ip packet header */ -#endif //__rtems__ struct sctphdr *sctp_hdr; /**< pointer to sctp common header */ union sctpChunkOfInt sctpchnk; /**< union of pointers to the chunk of interest */ int chunk_length; /**< length of chunk of interest */ @@ -187,7 +186,7 @@ struct sctp_nat_msg { /** * @brief sctp nat timer queue structure - * + * */ struct sctp_nat_timer { diff --git a/freebsd/sys/netinet/libalias/alias_skinny.c b/freebsd/sys/netinet/libalias/alias_skinny.c index 47bc46c2..9f292916 100644 --- a/freebsd/sys/netinet/libalias/alias_skinny.c +++ b/freebsd/sys/netinet/libalias/alias_skinny.c @@ -51,8 +51,8 @@ #include #include #else -#include -#include +#include "alias_local.h" +#include "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 9232568a..6c6c6aab 100644 --- a/freebsd/sys/netinet/libalias/alias_smedia.c +++ b/freebsd/sys/netinet/libalias/alias_smedia.c @@ -122,8 +122,8 @@ __FBSDID("$FreeBSD$"); #include #include #else -#include -#include +#include "alias_local.h" +#include "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 3f8b8ac3..fd9465b9 100644 --- a/freebsd/sys/netinet/libalias/alias_util.c +++ b/freebsd/sys/netinet/libalias/alias_util.c @@ -62,8 +62,8 @@ __FBSDID("$FreeBSD$"); #include #include #else -#include -#include +#include "alias.h" +#include "alias_local.h" #endif /* diff --git a/freebsd/sys/netinet/sctp_auth.h b/freebsd/sys/netinet/sctp_auth.h index a7ded047..eac89f6f 100644 --- a/freebsd/sys/netinet/sctp_auth.h +++ b/freebsd/sys/netinet/sctp_auth.h @@ -236,4 +236,4 @@ sctp_initialize_auth_params(struct sctp_inpcb *inp, struct sctp_tcb *stcb); /* test functions */ -#endif /* __SCTP_AUTH_HH__ */ +#endif /* __SCTP_AUTH_H__ */ diff --git a/freebsd/sys/netinet/sctp_output.c b/freebsd/sys/netinet/sctp_output.c index c2c7b147..1bca9771 100644 --- a/freebsd/sys/netinet/sctp_output.c +++ b/freebsd/sys/netinet/sctp_output.c @@ -4840,11 +4840,11 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_initpkt, * being equal to the beginning of the params i.e. (iphlen + * sizeof(struct sctp_init_msg) parse through the parameters to the * end of the mbuf verifying that all parameters are known. - * + * * For unknown parameters build and return a mbuf with * UNRECOGNIZED_PARAMETER errors. If the flags indicate to stop * processing this chunk stop, and set *abort_processing to 1. - * + * * By having param_offset be pre-set to where parameters begin it is * hoped that this routine may be reused in the future by new * features. @@ -7754,7 +7754,7 @@ nothing_to_send: * (when CMT is off) then it calls * sctp_fill_outqueue for the net. This gets data on * the send queue for that network. - * + * * In sctp_fill_outqueue TSN's are assigned and data is * copied out of the stream buffers. Note mostly * copy by reference (we hope). diff --git a/freebsd/sys/netinet/sctp_pcb.c b/freebsd/sys/netinet/sctp_pcb.c index 68eca553..47877ef1 100644 --- a/freebsd/sys/netinet/sctp_pcb.c +++ b/freebsd/sys/netinet/sctp_pcb.c @@ -3019,7 +3019,7 @@ continue_anyway: * bind specific, make sure flags is off and add a new * address structure to the sctp_addr_list inside the ep * structure. - * + * * We will need to allocate one and insert it at the head. The * socketopt call can just insert new addresses in there as * well. It will also have to do the embed scope kame hack @@ -3151,11 +3151,11 @@ sctp_iterator_inp_being_freed(struct sctp_inpcb *inp) * from happening. But of course the iterator has a * reference on the stcb and inp. We can mark it and it will * stop. - * + * * If its a single iterator situation, we set the end iterator * flag. Otherwise we set the iterator to go to the next * inp. - * + * */ if (it->iterator_flags & SCTP_ITERATOR_DO_SINGLE_INP) { sctp_it_ctl.iterator_flags |= SCTP_ITERATOR_STOP_CUR_IT; diff --git a/freebsd/sys/netinet/tcp_input.c b/freebsd/sys/netinet/tcp_input.c index 02840c89..25afbb26 100644 --- a/freebsd/sys/netinet/tcp_input.c +++ b/freebsd/sys/netinet/tcp_input.c @@ -540,6 +540,8 @@ tcp6_input(struct mbuf **mp, int *offp, int proto) (caddr_t)&ip6->ip6_dst - (caddr_t)ip6); return IPPROTO_DONE; } + if (ia6) + ifa_free(&ia6->ia_ifa); tcp_input(m, *offp); return IPPROTO_DONE; @@ -1208,7 +1210,8 @@ relocked: rstreason = BANDLIM_RST_OPENPORT; goto dropwithreset; } - ifa_free(&ia6->ia_ifa); + if (ia6) + ifa_free(&ia6->ia_ifa); } #endif /* diff --git a/freebsd/sys/netinet6/in6_pcb.c b/freebsd/sys/netinet6/in6_pcb.c index 63ae7a65..6446edeb 100644 --- a/freebsd/sys/netinet6/in6_pcb.c +++ b/freebsd/sys/netinet6/in6_pcb.c @@ -234,7 +234,7 @@ in6_pcbbind(register struct inpcb *inp, struct sockaddr *nam, (inp->inp_cred->cr_uid != t->inp_cred->cr_uid)) #else /* __rtems__ */ - 0) + 0) #endif /* __rtems__ */ return (EADDRINUSE); } diff --git a/freebsd/sys/nios2/nios2/legacy.c b/freebsd/sys/nios2/nios2/legacy.c index d2b0a78a..c81ccc5e 100644 --- a/freebsd/sys/nios2/nios2/legacy.c +++ b/freebsd/sys/nios2/nios2/legacy.c @@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef __rtems__ #include -#endif /* __rtems__ */ #ifdef DEV_MCA #include #endif diff --git a/freebsd/sys/nios2/pci/pci_bus.c b/freebsd/sys/nios2/pci/pci_bus.c index 53446262..ad0342ec 100644 --- a/freebsd/sys/nios2/pci/pci_bus.c +++ b/freebsd/sys/nios2/pci/pci_bus.c @@ -60,7 +60,6 @@ static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin); #endif /* __rtems__ */ - int legacy_pcib_maxslots(device_t dev) { @@ -69,15 +68,9 @@ legacy_pcib_maxslots(device_t dev) /* 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)); } @@ -514,7 +507,6 @@ legacy_pcib_attach(device_t dev) if (pir != NULL) device_probe_and_attach(pir); } -#else /* __rtems__ */ #endif /* __rtems__ */ device_add_child(dev, "pci", bus); return bus_generic_attach(dev); diff --git a/freebsd/sys/powerpc/pci/pci_bus.c b/freebsd/sys/powerpc/pci/pci_bus.c index 53446262..ad0342ec 100644 --- a/freebsd/sys/powerpc/pci/pci_bus.c +++ b/freebsd/sys/powerpc/pci/pci_bus.c @@ -60,7 +60,6 @@ static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin); #endif /* __rtems__ */ - int legacy_pcib_maxslots(device_t dev) { @@ -69,15 +68,9 @@ legacy_pcib_maxslots(device_t dev) /* 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)); } @@ -514,7 +507,6 @@ legacy_pcib_attach(device_t dev) if (pir != NULL) device_probe_and_attach(pir); } -#else /* __rtems__ */ #endif /* __rtems__ */ device_add_child(dev, "pci", bus); return bus_generic_attach(dev); diff --git a/freebsd/sys/powerpc/powerpc/legacy.c b/freebsd/sys/powerpc/powerpc/legacy.c index d2b0a78a..c81ccc5e 100644 --- a/freebsd/sys/powerpc/powerpc/legacy.c +++ b/freebsd/sys/powerpc/powerpc/legacy.c @@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef __rtems__ #include -#endif /* __rtems__ */ #ifdef DEV_MCA #include #endif diff --git a/freebsd/sys/sh/pci/pci_bus.c b/freebsd/sys/sh/pci/pci_bus.c index 53446262..ad0342ec 100644 --- a/freebsd/sys/sh/pci/pci_bus.c +++ b/freebsd/sys/sh/pci/pci_bus.c @@ -60,7 +60,6 @@ static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin); #endif /* __rtems__ */ - int legacy_pcib_maxslots(device_t dev) { @@ -69,15 +68,9 @@ legacy_pcib_maxslots(device_t dev) /* 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)); } @@ -514,7 +507,6 @@ legacy_pcib_attach(device_t dev) if (pir != NULL) device_probe_and_attach(pir); } -#else /* __rtems__ */ #endif /* __rtems__ */ device_add_child(dev, "pci", bus); return bus_generic_attach(dev); diff --git a/freebsd/sys/sh/sh/legacy.c b/freebsd/sys/sh/sh/legacy.c index d2b0a78a..c81ccc5e 100644 --- a/freebsd/sys/sh/sh/legacy.c +++ b/freebsd/sys/sh/sh/legacy.c @@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef __rtems__ #include -#endif /* __rtems__ */ #ifdef DEV_MCA #include #endif diff --git a/freebsd/sys/sparc/pci/pci_bus.c b/freebsd/sys/sparc/pci/pci_bus.c index 53446262..ad0342ec 100644 --- a/freebsd/sys/sparc/pci/pci_bus.c +++ b/freebsd/sys/sparc/pci/pci_bus.c @@ -60,7 +60,6 @@ static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin); #endif /* __rtems__ */ - int legacy_pcib_maxslots(device_t dev) { @@ -69,15 +68,9 @@ legacy_pcib_maxslots(device_t dev) /* 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)); } @@ -514,7 +507,6 @@ legacy_pcib_attach(device_t dev) if (pir != NULL) device_probe_and_attach(pir); } -#else /* __rtems__ */ #endif /* __rtems__ */ device_add_child(dev, "pci", bus); return bus_generic_attach(dev); diff --git a/freebsd/sys/sparc/sparc/legacy.c b/freebsd/sys/sparc/sparc/legacy.c index d2b0a78a..c81ccc5e 100644 --- a/freebsd/sys/sparc/sparc/legacy.c +++ b/freebsd/sys/sparc/sparc/legacy.c @@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef __rtems__ #include -#endif /* __rtems__ */ #ifdef DEV_MCA #include #endif diff --git a/freebsd/sys/sparc64/pci/pci_bus.c b/freebsd/sys/sparc64/pci/pci_bus.c index 53446262..ad0342ec 100644 --- a/freebsd/sys/sparc64/pci/pci_bus.c +++ b/freebsd/sys/sparc64/pci/pci_bus.c @@ -60,7 +60,6 @@ static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin); #endif /* __rtems__ */ - int legacy_pcib_maxslots(device_t dev) { @@ -69,15 +68,9 @@ legacy_pcib_maxslots(device_t dev) /* 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)); } @@ -514,7 +507,6 @@ legacy_pcib_attach(device_t dev) if (pir != NULL) device_probe_and_attach(pir); } -#else /* __rtems__ */ #endif /* __rtems__ */ device_add_child(dev, "pci", bus); return bus_generic_attach(dev); diff --git a/freebsd/sys/sparc64/sparc64/legacy.c b/freebsd/sys/sparc64/sparc64/legacy.c index d2b0a78a..c81ccc5e 100644 --- a/freebsd/sys/sparc64/sparc64/legacy.c +++ b/freebsd/sys/sparc64/sparc64/legacy.c @@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef __rtems__ #include -#endif /* __rtems__ */ #ifdef DEV_MCA #include #endif diff --git a/freebsd/sys/sys/_rmlock.h b/freebsd/sys/sys/_rmlock.h index dba7affd..3ea2cb27 100644 --- a/freebsd/sys/sys/_rmlock.h +++ b/freebsd/sys/sys/_rmlock.h @@ -52,8 +52,8 @@ struct rmlock { }; #else /* __rtems__ */ - #include - #define rmlock rwlock +#include +#define rmlock rwlock #endif /* __rtems__ */ struct rm_priotracker { diff --git a/freebsd/sys/sys/lockmgr.h b/freebsd/sys/sys/lockmgr.h index 3d0aad0b..c85c39bd 100644 --- a/freebsd/sys/sys/lockmgr.h +++ b/freebsd/sys/sys/lockmgr.h @@ -56,7 +56,7 @@ #ifdef _KERNEL #if !defined(LOCK_FILE) || !defined(LOCK_LINE) -#error "LOCK_FILE and LOCK_LINE not defined, include before" +#error "LOCK_FILE and LOCK_LINE not defined, include before" #endif struct thread; diff --git a/freebsd/sys/sys/mbuf.h b/freebsd/sys/sys/mbuf.h index ad410687..7ce3bf44 100644 --- a/freebsd/sys/sys/mbuf.h +++ b/freebsd/sys/sys/mbuf.h @@ -115,7 +115,7 @@ struct pkthdr { /* variables for ip and tcp reassembly */ void *header; /* pointer to packet header */ int len; /* total packet length */ - uint32_t flowid; /* packet's 4-tuple system + uint32_t flowid; /* packet's 4-tuple system * flow identifier */ /* variables for hardware checksum */ @@ -380,7 +380,7 @@ static __inline int m_gettype(int size) { int type; - + switch (size) { case MSIZE: type = EXT_MBUF; @@ -410,7 +410,7 @@ static __inline uma_zone_t m_getzone(int size) { uma_zone_t zone; - + switch (size) { case MSIZE: zone = zone_mbuf; @@ -533,7 +533,7 @@ m_getjcl(int how, short type, int flags, int size) if (m == NULL) return (NULL); - zone = m_getzone(size); + zone = m_getzone(size); n = uma_zalloc_arg(zone, m, how); if (n == NULL) { uma_zfree(zone_mbuf, m); @@ -549,6 +549,7 @@ m_free_fast(struct mbuf *m) if (m->m_flags & M_PKTHDR) KASSERT(SLIST_EMPTY(&m->m_pkthdr.tags), ("doing fast free of mbuf with tags")); #endif + uma_zfree_arg(zone_mbuf, m, (void *)MB_NOTAGS); } @@ -608,7 +609,7 @@ m_cljset(struct mbuf *m, void *cl, int type) { uma_zone_t zone; int size; - + switch (type) { case EXT_CLUSTER: size = MCLBYTES; @@ -1017,7 +1018,7 @@ m_tag_find(struct mbuf *m, int type, struct m_tag *start) #define M_SETFIB(_m, _fib) do { \ _m->m_flags &= ~M_FIB; \ _m->m_flags |= (((_fib) << M_FIBSHIFT) & M_FIB); \ -} while (0) +} while (0) #endif /* _KERNEL */ diff --git a/freebsd/sys/sys/mutex.h b/freebsd/sys/sys/mutex.h index e7649d8f..447ca17f 100644 --- a/freebsd/sys/sys/mutex.h +++ b/freebsd/sys/sys/mutex.h @@ -57,7 +57,7 @@ * Mutex types and options passed to mtx_init(). MTX_QUIET and MTX_DUPOK * can also be passed in. */ -#define MTX_DEF 0x00000000 /* DEFAULT (sleep) lock */ +#define MTX_DEF 0x00000000 /* DEFAULT (sleep) lock */ #define MTX_SPIN 0x00000001 /* Spin lock (disables interrupts) */ #define MTX_RECURSE 0x00000004 /* Option: lock allowed to recurse */ #define MTX_NOWITNESS 0x00000008 /* Don't do any witness checking. */ @@ -153,7 +153,7 @@ void _thread_lock_flags(struct thread *, int, const char *, int); /* * We define our machine-independent (unoptimized) mutex micro-operations - * here, if they are not already defined in the machine-dependent mutex.h + * here, if they are not already defined in the machine-dependent mutex.h */ /* Try to obtain mtx_lock once. */ @@ -193,7 +193,7 @@ void _thread_lock_flags(struct thread *, int, const char *, int); * Obtain a spin lock inline, or call the "hard" function if we can't get it * easy. For spinlocks, we handle recursion inline (it turns out that function * calls can be significantly expensive on some architectures). - * Since spin locks are not _too_ common, inlining this code is not too big + * Since spin locks are not _too_ common, inlining this code is not too big * a deal. */ #ifndef _get_spin_lock @@ -242,7 +242,7 @@ void _thread_lock_flags(struct thread *, int, const char *, int); /* * For spinlocks, we can handle everything inline, as it's pretty simple and * a function call would be too expensive (at least on some architectures). - * Since spin locks are not _too_ common, inlining this code is not too big + * Since spin locks are not _too_ common, inlining this code is not too big * a deal. * * Since we always perform a spinlock_enter() when attempting to acquire a @@ -305,7 +305,7 @@ void _thread_lock_flags(struct thread *, int, const char *, int); * mtx_owned(m) returns non-zero if the current thread owns the lock `m' * * mtx_recursed(m) returns non-zero if the lock `m' is presently recursed. - */ + */ #define mtx_lock(m) mtx_lock_flags((m), 0) #define mtx_lock_spin(m) mtx_lock_spin_flags((m), 0) #define mtx_trylock(m) mtx_trylock_flags((m), 0) @@ -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 before +#error LOCK_DEBUG not defined, include before #endif #if LOCK_DEBUG > 0 || defined(MUTEX_NOINLINE) #define mtx_lock_flags(m, opts) \ @@ -388,7 +388,7 @@ extern struct mtx blocked_lock; * Giant lock manipulation and clean exit macros. * Used to replace return with an exit Giant and return. * - * Note that DROP_GIANT*() needs to be paired with PICKUP_GIANT() + * Note that DROP_GIANT*() needs to be paired with PICKUP_GIANT() * The #ifndef is to allow lint-like tools to redefine DROP_GIANT. */ #ifndef DROP_GIANT diff --git a/freebsd/sys/sys/pcpu.h b/freebsd/sys/sys/pcpu.h index b3bbb16a..599af11b 100644 --- a/freebsd/sys/sys/pcpu.h +++ b/freebsd/sys/sys/pcpu.h @@ -131,7 +131,7 @@ extern uintptr_t dpcpu_off[]; } \ } while(0) -/* +/* * XXXUPS remove as soon as we have per cpu variable * linker sets and can define rm_queue in _rm_lock.h */ diff --git a/freebsd/sys/sys/priv.h b/freebsd/sys/sys/priv.h index a9b9bdb6..d82e9816 100644 --- a/freebsd/sys/sys/priv.h +++ b/freebsd/sys/sys/priv.h @@ -510,8 +510,7 @@ struct ucred; int priv_check(struct thread *td, int priv); int priv_check_cred(struct ucred *cred, int priv, int flags); #else /* __rtems__ */ -/* rtems assumes all privileges for now. */ -#define priv_check(td, priv) 0 +#define priv_check(td, priv) 0 #define priv_check_cred(cred, priv, flags) 0 #endif /* __rtems__ */ #endif diff --git a/freebsd/sys/sys/rmlock.h b/freebsd/sys/sys/rmlock.h index 04a1e79c..effbcffb 100644 --- a/freebsd/sys/sys/rmlock.h +++ b/freebsd/sys/sys/rmlock.h @@ -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 before +#error LOCK_DEBUG not defined, include before #endif #if LOCK_DEBUG > 0 @@ -89,7 +89,7 @@ void _rm_runlock(struct rmlock *rm, struct rm_priotracker *tracker); #define rm_init(rm, name) rw_init(rm, name) #define rm_init_flags(rm, name, opts) rw_init_flags(rm, name, opts) #define rm_destroy(rm) rw_destroy(rm) - #define rm_wowned(rm) rw_wowned(rm) + #define rm_wowned(rm) rw_wowned(rm) #define rm_sysinit(arg) rw_sysinit(arg) #define rm_sysinit_flags(arg) rw_sysinit_flags(arg) diff --git a/freebsd/sys/sys/rwlock.h b/freebsd/sys/sys/rwlock.h index 82e95c4b..ec2aed27 100644 --- a/freebsd/sys/sys/rwlock.h +++ b/freebsd/sys/sys/rwlock.h @@ -45,7 +45,6 @@ #ifdef __rtems__ #define RWLOCK_NOINLINE 1 #endif /* __rtems__ */ - /* * The rw_lock field consists of several fields. The low bit indicates * if the lock is locked with a read (shared) or write (exclusive) lock. @@ -155,7 +154,7 @@ void _rw_assert(struct rwlock *rw, int what, const char *file, int line); */ #ifndef LOCK_DEBUG -#error LOCK_DEBUG not defined, include before +#error LOCK_DEBUG not defined, include before #endif #if LOCK_DEBUG > 0 || defined(RWLOCK_NOINLINE) #define rw_wlock(rw) _rw_wlock((rw), LOCK_FILE, LOCK_LINE) diff --git a/freebsd/sys/sys/sigio.h b/freebsd/sys/sys/sigio.h index 1345cd61..74047b78 100644 --- a/freebsd/sys/sys/sigio.h +++ b/freebsd/sys/sys/sigio.h @@ -64,7 +64,7 @@ pid_t fgetown(struct sigio **sigiop); int fsetown(pid_t pgid, struct sigio **sigiop); void funsetown(struct sigio **sigiop); void funsetownlst(struct sigiolst *sigiolst); -#else /* __rtems__ */ +#elif defined(__rtems__) && defined(_KERNEL) static inline pid_t fgetown(struct sigio **sigiop) { @@ -93,6 +93,6 @@ funsetownlst(struct sigiolst *sigiolst) { (void) sigiolst; } -#endif /* __rtems__ */ +#endif /* __rtems__ && _KERNEL */ #endif /* _SYS_SIGIO_H_ */ diff --git a/freebsd/sys/sys/sx.h b/freebsd/sys/sys/sx.h index dc19023c..39906fe7 100644 --- a/freebsd/sys/sys/sx.h +++ b/freebsd/sys/sys/sx.h @@ -48,7 +48,6 @@ #define _sx_try_slock _bsd__sx_try_xlock #define _sx_sunlock _bsd__sx_xunlock #endif /* __rtems__ */ - /* * In general, the sx locks and rwlocks use very similar algorithms. * The main difference in the implementations is how threads are @@ -210,7 +209,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 before " +#error "LOCK_DEBUG not defined, include before " #endif #if (LOCK_DEBUG > 0) || defined(SX_NOINLINE) #define sx_xlock(sx) (void)_sx_xlock((sx), 0, LOCK_FILE, LOCK_LINE) diff --git a/freebsd/sys/sys/sysctl.h b/freebsd/sys/sys/sysctl.h index d4f44e64..f5341d87 100644 --- a/freebsd/sys/sys/sysctl.h +++ b/freebsd/sys/sys/sysctl.h @@ -90,7 +90,7 @@ struct ctlname { #define CTLFLAG_DYING 0x00010000 /* oid is being removed */ /* - * Secure level. Note that CTLFLAG_SECURE == CTLFLAG_SECURE1. + * Secure level. Note that CTLFLAG_SECURE == CTLFLAG_SECURE1. * * Secure when the securelevel is raised to at least N. */ @@ -105,7 +105,7 @@ struct ctlname { * 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) /* diff --git a/freebsd/sys/sys/sysproto.h b/freebsd/sys/sys/sysproto.h index c94df43d..d56edfd4 100644 --- a/freebsd/sys/sys/sysproto.h +++ b/freebsd/sys/sys/sysproto.h @@ -9,9 +9,6 @@ #ifndef _SYS_SYSPROTO_H_ #define _SYS_SYSPROTO_H_ -#ifdef __rtems__ -#include -#endif #include #include #include diff --git a/freebsd/sys/sys/tty.h b/freebsd/sys/sys/tty.h index 2cf454ef..34c6eff1 100644 --- a/freebsd/sys/sys/tty.h +++ b/freebsd/sys/sys/tty.h @@ -38,9 +38,7 @@ #include #include #include -#ifndef __rtems__ #include -#endif #include #include diff --git a/freebsd/sys/sys/unpcb.h b/freebsd/sys/sys/unpcb.h new file mode 100644 index 00000000..4d69f3e5 --- /dev/null +++ b/freebsd/sys/sys/unpcb.h @@ -0,0 +1,148 @@ +/*- + * 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. + * + * @(#)unpcb.h 8.1 (Berkeley) 6/2/93 + * $FreeBSD$ + */ + +#ifndef _SYS_UNPCB_H_ +#define _SYS_UNPCB_H_ + +#include +#include + +/* + * Protocol control block for an active + * instance of a UNIX internal protocol. + * + * A socket may be associated with a vnode in the + * filesystem. If so, the unp_vnode pointer holds + * a reference count to this vnode, which should be irele'd + * when the socket goes away. + * + * A socket may be connected to another socket, in which + * case the control block of the socket to which it is connected + * is given by unp_conn. + * + * A socket may be referenced by a number of sockets (e.g. several + * sockets may be connected to a datagram socket.) These sockets + * are in a linked list starting with unp_refs, linked through + * unp_nextref and null-terminated. Note that a socket may be referenced + * by a number of other sockets and may also reference a socket (not + * necessarily one which is referencing it). This generates + * the need for unp_refs and unp_nextref to be separate fields. + * + * Stream sockets keep copies of receive sockbuf sb_cc and sb_mbcnt + * so that changes in the sockbuf may be computed to modify + * back pressure on the sender accordingly. + */ +typedef u_quad_t unp_gen_t; +LIST_HEAD(unp_head, unpcb); + +struct unpcb { + LIST_ENTRY(unpcb) unp_link; /* glue on list of all PCBs */ + struct socket *unp_socket; /* pointer back to socket */ + struct file *unp_file; /* back-pointer to file for gc. */ + struct vnode *unp_vnode; /* if associated with file */ + ino_t unp_ino; /* fake inode number */ + struct unpcb *unp_conn; /* control block of connected socket */ + struct unp_head unp_refs; /* referencing socket linked list */ + LIST_ENTRY(unpcb) unp_reflink; /* link in unp_refs list */ + struct sockaddr_un *unp_addr; /* bound address of socket */ + int unp_cc; /* copy of rcv.sb_cc */ + int unp_mbcnt; /* copy of rcv.sb_mbcnt */ + unp_gen_t unp_gencnt; /* generation count of this instance */ + short unp_flags; /* flags */ + short unp_gcflag; /* Garbage collector flags. */ + struct xucred unp_peercred; /* peer credentials, if applicable */ + u_int unp_refcount; + u_int unp_msgcount; /* references from message queue */ + struct mtx unp_mtx; /* mutex */ +}; + +/* + * Flags in unp_flags. + * + * UNP_HAVEPC - indicates that the unp_peercred member is filled in + * and is really the credentials of the connected peer. This is used + * to determine whether the contents should be sent to the user or + * not. + * + * UNP_HAVEPCCACHED - indicates that the unp_peercred member is filled + * in, but does *not* contain the credentials of the connected peer + * (there may not even be a peer). This is set in unp_listen() when + * it fills in unp_peercred for later consumption by unp_connect(). + */ +#define UNP_HAVEPC 0x001 +#define UNP_HAVEPCCACHED 0x002 +#define UNP_WANTCRED 0x004 /* credentials wanted */ +#define UNP_CONNWAIT 0x008 /* connect blocks until accepted */ + +#define UNPGC_REF 0x1 /* unpcb has external ref. */ +#define UNPGC_DEAD 0x2 /* unpcb might be dead. */ +#define UNPGC_SCANNED 0x4 /* Has been scanned. */ + +/* + * These flags are used to handle non-atomicity in connect() and bind() + * operations on a socket: in particular, to avoid races between multiple + * threads or processes operating simultaneously on the same socket. + */ +#define UNP_CONNECTING 0x010 /* Currently connecting. */ +#define UNP_BINDING 0x020 /* Currently binding. */ + +#define sotounpcb(so) ((struct unpcb *)((so)->so_pcb)) + +/* Hack alert -- this structure depends on . */ +#ifdef _SYS_SOCKETVAR_H_ +struct xunpcb { + size_t xu_len; /* length of this structure */ + struct unpcb *xu_unpp; /* to help netstat, fstat */ + struct unpcb xu_unp; /* our information */ + union { + struct sockaddr_un xuu_addr; /* our bound address */ + char xu_dummy1[256]; + } xu_au; +#define xu_addr xu_au.xuu_addr + union { + struct sockaddr_un xuu_caddr; /* their bound address */ + char xu_dummy2[256]; + } xu_cau; +#define xu_caddr xu_cau.xuu_caddr + struct xsocket xu_socket; + u_quad_t xu_alignment_hack; +}; + +struct xunpgen { + size_t xug_len; + u_int xug_count; + unp_gen_t xug_gen; + so_gen_t xug_sogen; +}; +#endif /* _SYS_SOCKETVAR_H_ */ + +#endif /* _SYS_UNPCB_H_ */ diff --git a/freebsd/sys/v850/pci/pci_bus.c b/freebsd/sys/v850/pci/pci_bus.c index 53446262..ad0342ec 100644 --- a/freebsd/sys/v850/pci/pci_bus.c +++ b/freebsd/sys/v850/pci/pci_bus.c @@ -60,7 +60,6 @@ static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin); #endif /* __rtems__ */ - int legacy_pcib_maxslots(device_t dev) { @@ -69,15 +68,9 @@ legacy_pcib_maxslots(device_t dev) /* 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)); } @@ -514,7 +507,6 @@ legacy_pcib_attach(device_t dev) if (pir != NULL) device_probe_and_attach(pir); } -#else /* __rtems__ */ #endif /* __rtems__ */ device_add_child(dev, "pci", bus); return bus_generic_attach(dev); diff --git a/freebsd/sys/v850/v850/legacy.c b/freebsd/sys/v850/v850/legacy.c index d2b0a78a..c81ccc5e 100644 --- a/freebsd/sys/v850/v850/legacy.c +++ b/freebsd/sys/v850/v850/legacy.c @@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef __rtems__ #include -#endif /* __rtems__ */ #ifdef DEV_MCA #include #endif diff --git a/freebsd/sys/vm/uma_core.c b/freebsd/sys/vm/uma_core.c index e6ac69ca..c61faff4 100644 --- a/freebsd/sys/vm/uma_core.c +++ b/freebsd/sys/vm/uma_core.c @@ -2876,10 +2876,10 @@ zone_free_item(uma_zone_t zone, void *item, void *udata, clearfull = 1; } - /* + /* * We can handle one more allocation. Since we're clearing ZFLAG_FULL, - * wake up all procs blocked on pages. This should be uncommon, so - * keeping this simple for now (rather than adding count of blocked + * wake up all procs blocked on pages. This should be uncommon, so + * keeping this simple for now (rather than adding count of blocked * threads etc). */ wakeup(keg); @@ -3135,7 +3135,7 @@ uma_zone_exhausted(uma_zone_t zone) ZONE_LOCK(zone); full = (zone->uz_flags & UMA_ZFLAG_FULL); ZONE_UNLOCK(zone); - return (full); + return (full); } int diff --git a/freebsd/sys/vm/uma_int.h b/freebsd/sys/vm/uma_int.h index b92681c1..22e2af78 100644 --- a/freebsd/sys/vm/uma_int.h +++ b/freebsd/sys/vm/uma_int.h @@ -28,12 +28,12 @@ * */ -/* +/* * This file includes definitions, structures, prototypes, and inlines that * should not be used outside of the actual implementation of UMA. */ -/* +/* * Here's a quick description of the relationship between the objects: * * Kegs contain lists of slabs which are stored in either the full bin, empty @@ -42,7 +42,7 @@ * and rsize is the result of that. The Keg also stores information for * managing a hash of page addresses that maps pages to uma_slab_t structures * for pages that don't have embedded uma_slab_t's. - * + * * The uma_slab_t may be embedded in a UMA_SLAB_SIZE chunk of memory or it may * be allocated off the page from a special slab zone. The free list within a * slab is managed with a linked list of indexes, which are 8 bit values. If @@ -50,7 +50,7 @@ * values. Currently on alpha you can get 250 or so 32 byte items and on x86 * you can get 250 or so 16byte items. For item sizes that would yield more * than 10% memory waste we potentially allocate a separate uma_slab_t if this - * will improve the number of items per slab that will fit. + * will improve the number of items per slab that will fit. * * Other potential space optimizations are storing the 8bit of linkage in space * wasted between items due to alignment problems. This may yield a much better @@ -65,7 +65,7 @@ * so you fall back to the memory footprint of the power of two allocator. I * have looked at memory allocation sizes on many of the machines available to * me, and there does not seem to be an abundance of allocations at this range - * so at this time it may not make sense to optimize for it. This can, of + * so at this time it may not make sense to optimize for it. This can, of * course, be solved with dynamic slab sizes. * * Kegs may serve multiple Zones but by far most of the time they only serve @@ -94,7 +94,7 @@ * ___________________________________________________________ * | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ___________ | * ||i||i||i||i||i||i||i||i||i||i||i||i||i||i||i| |slab header|| - * ||_||_||_||_||_||_||_||_||_||_||_||_||_||_||_| |___________|| + * ||_||_||_||_||_||_||_||_||_||_||_||_||_||_||_| |___________|| * |___________________________________________________________| * * @@ -128,9 +128,9 @@ * size of the hash table for uma_slabs that are managed off page. This hash * does expand by powers of two. Currently it doesn't get smaller. */ -#define UMA_HASH_SIZE_INIT 32 +#define UMA_HASH_SIZE_INIT 32 -/* +/* * I should investigate other hashing algorithms. This should yield a low * number of collisions if the pages are relatively contiguous. * @@ -290,7 +290,7 @@ struct uma_klink { typedef struct uma_klink *uma_klink_t; /* - * Zone management structure + * Zone management structure * * TODO: Optimize for cache line size * @@ -358,7 +358,7 @@ void uma_large_free(uma_slab_t slab); mtx_init(&(k)->uk_lock, (k)->uk_name, \ "UMA zone", MTX_DEF | MTX_DUPOK); \ } while (0) - + #define KEG_LOCK_FINI(k) mtx_destroy(&(k)->uk_lock) #define KEG_LOCK(k) mtx_lock(&(k)->uk_lock) #define KEG_UNLOCK(k) mtx_unlock(&(k)->uk_lock) @@ -450,7 +450,7 @@ vsetobj(vm_offset_t va, vm_object_t obj) p->object = obj; p->flags &= ~PG_SLAB; } -#endif +#endif /* __rtems__ */ /* * The following two functions may be defined by architecture specific code diff --git a/freebsd/usr.bin/netstat/bpf.c b/freebsd/usr.bin/netstat/bpf.c index a7b9e452..b429ed62 100644 --- a/freebsd/usr.bin/netstat/bpf.c +++ b/freebsd/usr.bin/netstat/bpf.c @@ -35,9 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifndef __rtems__ #include -#endif /* __rtems__ */ #include #include @@ -62,7 +60,7 @@ bpf_pidname(pid_t pid) { #ifdef __rtems__ return "rtems"; -#else +#else /* __rtems__ */ struct kinfo_proc newkp; int error, mib[4]; size_t size; @@ -78,7 +76,7 @@ bpf_pidname(pid_t pid) return (strdup("??????")); } return (strdup(newkp.ki_comm)); -#endif +#endif /* __rtems__ */ } static void diff --git a/freebsd/usr.bin/netstat/if.c b/freebsd/usr.bin/netstat/if.c index cd383241..b39670e1 100644 --- a/freebsd/usr.bin/netstat/if.c +++ b/freebsd/usr.bin/netstat/if.c @@ -197,7 +197,7 @@ intpr(int interval1, u_long ifnetaddr, void (*pfunc)(char *)) #endif #ifndef __rtems__ struct ipx_ifaddr ipx; -#endif +#endif /* __rtems__ */ } ifaddr; u_long ifaddraddr; u_long ifaddrfound; @@ -387,14 +387,14 @@ intpr(int interval1, u_long ifnetaddr, void (*pfunc)(char *)) network_layer = 1; break; -#endif +#endif /* __rtems__ */ #ifndef __rtems__ case AF_APPLETALK: printf("atalk:%-12.12s ",atalk_print(sa,0x10) ); printf("%-11.11s ",atalk_print(sa,0x0b) ); break; -#endif +#endif /* __rtems__ */ case AF_LINK: { struct sockaddr_dl *sdl = @@ -716,13 +716,13 @@ loop: signalled = NO; sigprocmask(SIG_SETMASK, &oldmask, NULL); } -#else +#else /* __rtems__ */ oldmask = sigblock(sigmask(SIGALRM)); while (!signalled) sigpause(0); signalled = NO; sigsetmask(oldmask); -#endif +#endif /* __rtems__ */ line++; first = 0; if (line == 21) diff --git a/freebsd/usr.bin/netstat/main.c b/freebsd/usr.bin/netstat/main.c index fcc40d5c..4c76b906 100644 --- a/freebsd/usr.bin/netstat/main.c +++ b/freebsd/usr.bin/netstat/main.c @@ -779,10 +779,6 @@ printproto(tp, name) (*pr)(off, name, af, tp->pr_protocol); } -#ifdef __rtems__ -#define _POSIX2_LINE_MAX 128 -#endif - /* * Read kernel memory, return 0 on success. */ @@ -790,9 +786,6 @@ int kread(u_long addr, void *buf, size_t size) { char errbuf[_POSIX2_LINE_MAX]; -#ifdef __rtems__ - /* printf( "kread( %p to %p for %d)\n", (void *)addr, buf, size ); */ -#endif if (kvmd == NULL) { kvmd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf); diff --git a/freebsd/usr.bin/netstat/mbuf.c b/freebsd/usr.bin/netstat/mbuf.c index b06a1190..08633639 100644 --- a/freebsd/usr.bin/netstat/mbuf.c +++ b/freebsd/usr.bin/netstat/mbuf.c @@ -113,9 +113,9 @@ mbpr(void *kvmd, u_long mbaddr) memstat_strerror(error)); goto out; } -#else +#else /* __rtems__ */ ; -#endif +#endif /* __rtems__ */ } mtp = memstat_mtl_find(mtlp, ALLOCATOR_UMA, MBUF_MEM_NAME); diff --git a/freebsd/usr.bin/netstat/route.c b/freebsd/usr.bin/netstat/route.c index 4ffe329a..33374831 100644 --- a/freebsd/usr.bin/netstat/route.c +++ b/freebsd/usr.bin/netstat/route.c @@ -180,10 +180,10 @@ routepr(u_long rtree) { rtems_clock_get_uptime(&uptime); } -#else +#else /* __rtems__ */ if (clock_gettime(CLOCK_UPTIME, &uptime) < 0) err(EX_OSERR, "clock_gettime() failed"); -#endif +#endif /* __rtems__ */ printf("Routing tables\n"); @@ -217,10 +217,6 @@ routepr(u_long rtree) continue; if (rnh == NULL) continue; -#ifdef __rtems__ - /* printf( "rnh %p %p\n", (void *)rnhp, (void *)rnh ); */ - /* We get a 1 here on some fields. Why? XXX */ -#endif /* Read the rnh data. */ if (kget(rnh, head) != 0) continue; @@ -692,17 +688,17 @@ fmt_sockaddr(struct sockaddr *sa, struct sockaddr *mask, int flags) cp = atalk_print(sa,11); break; } -#endif +#endif /* __rtems__ */ case AF_NETGRAPH: { #ifdef __rtems__ /* netgraph not supported yet */ err(EX_OSERR, "memory allocation failed"); -#else +#else /* __rtems__ */ strlcpy(workbuf, ((struct sockaddr_ng *)sa)->sg_data, sizeof(workbuf)); cp = workbuf; -#endif +#endif /* __rtems__ */ break; } @@ -1145,7 +1141,7 @@ ipx_phost(struct sockaddr *sa) return(p); } -#endif +#endif /* __rtems__ */ void upHex(char *p0) diff --git a/freebsd/usr.bin/netstat/unix.c b/freebsd/usr.bin/netstat/unix.c index ada14c46..7a209ebc 100644 --- a/freebsd/usr.bin/netstat/unix.c +++ b/freebsd/usr.bin/netstat/unix.c @@ -53,9 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifndef __rtems__ #include -#endif /* __rtems__ */ #include @@ -196,7 +194,7 @@ fail: #undef COPYOUT #undef KREAD } -#endif +#endif /* __rtems__ */ #ifndef __rtems__ void @@ -247,7 +245,7 @@ unixpr(u_long count_off, u_long gencnt_off, u_long dhead_off, u_long shead_off) free(buf); } } -#endif +#endif /* __rtems__ */ #ifndef __rtems__ static void @@ -293,4 +291,4 @@ unixdomainpr(struct xunpcb *xunp, struct xsocket *so) sa->sun_path); putchar('\n'); } -#endif +#endif /* __rtems__ */ diff --git a/rtemsbsd/include/machine/rtems-bsd-user-space.h b/rtemsbsd/include/machine/rtems-bsd-user-space.h index dddfa862..64d3cb0f 100644 --- a/rtemsbsd/include/machine/rtems-bsd-user-space.h +++ b/rtemsbsd/include/machine/rtems-bsd-user-space.h @@ -53,6 +53,8 @@ #define _PATH_VARRUN "/var/run" +#define _POSIX2_LINE_MAX 128 + __BEGIN_DECLS /* FIXME: Add to Newlib */ diff --git a/rtemsbsd/include/rtems/bsd/local/opt_mca.h b/rtemsbsd/include/rtems/bsd/local/opt_mca.h new file mode 100644 index 00000000..e69de29b diff --git a/rtemsbsd/include/sys/clock.h b/rtemsbsd/include/sys/clock.h new file mode 100644 index 00000000..936ffd88 --- /dev/null +++ b/rtemsbsd/include/sys/clock.h @@ -0,0 +1 @@ +/* EMPTY */ diff --git a/rtemsbsd/include/sys/posix4.h b/rtemsbsd/include/sys/posix4.h new file mode 100644 index 00000000..936ffd88 --- /dev/null +++ b/rtemsbsd/include/sys/posix4.h @@ -0,0 +1 @@ +/* EMPTY */ diff --git a/rtemsbsd/include/sys/timers.h b/rtemsbsd/include/sys/timers.h new file mode 100644 index 00000000..936ffd88 --- /dev/null +++ b/rtemsbsd/include/sys/timers.h @@ -0,0 +1 @@ +/* EMPTY */ -- cgit v1.2.3