diff --git a/share/mk-pic32/bsd.lib.mk b/share/mk-pic32/bsd.lib.mk index 5d2c83f3..e9de6726 100644 --- a/share/mk-pic32/bsd.lib.mk +++ b/share/mk-pic32/bsd.lib.mk @@ -29,18 +29,18 @@ LDCROSS?= -mips32r2 -EL -nostdlib nroff -man ${.IMPSRC} > ${.TARGET} .c.o: - ${MIPS_TOOLCHAIN}${CC} ${CCROSS} ${CFLAGS} -c ${.IMPSRC} + ${MIPS_GCC_PREFIX}${CC} ${CCROSS} ${CFLAGS} -c ${.IMPSRC} .c.po: - ${MIPS_TOOLCHAIN}${CC} ${CCROSS} -p ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${MIPS_GCC_PREFIX}${CC} ${CCROSS} -p ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} .s.o: ${CPP} -E ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \ - ${MIPS_TOOLCHAIN}${AS} -o ${.TARGET} + ${MIPS_GCC_PREFIX}${AS} -o ${.TARGET} .s.po: ${CPP} -E -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \ - ${MIPS_TOOLCHAIN}${AS} -o ${.TARGET} + ${MIPS_GCC_PREFIX}${AS} -o ${.TARGET} MANALL= ${MAN1} ${MAN2} ${MAN3} ${MAN4} ${MAN5} ${MAN6} ${MAN7} ${MAN8} manpages: ${MANALL} @@ -61,15 +61,15 @@ OBJS+= ${SRCS:R:S/$/.o/g} lib${LIB}.a:: ${OBJS} @echo building standard ${LIB} library @rm -f lib${LIB}.a - @${MIPS_TOOLCHAIN}${AR} cTq lib${LIB}.a `lorder ${OBJS} | tsort` ${LDADD} - ${MIPS_TOOLCHAIN}ranlib lib${LIB}.a + @${MIPS_GCC_PREFIX}${AR} cTq lib${LIB}.a `lorder ${OBJS} | tsort` ${LDADD} + ${MIPS_GCC_PREFIX}ranlib lib${LIB}.a POBJS+= ${OBJS:.o=.po} lib${LIB}_p.a:: ${POBJS} @echo building profiled ${LIB} library @rm -f lib${LIB}_p.a - @${MIPS_TOOLCHAIN}${AR} cTq lib${LIB}_p.a `lorder ${POBJS} | tsort` ${LDADD} - ${MIPS_TOOLCHAIN}ranlib lib${LIB}_p.a + @${MIPS_GCC_PREFIX}${AR} cTq lib${LIB}_p.a `lorder ${POBJS} | tsort` ${LDADD} + ${MIPS_GCC_PREFIX}ranlib lib${LIB}_p.a llib-l${LIB}.ln: ${SRCS} ${LINT} -C${LIB} ${CFLAGS} ${.ALLSRC:M*.c} diff --git a/sys/mips/conf/Makefile.pic32 b/sys/mips/conf/Makefile.pic32 index 852e075d..f48ef780 100644 --- a/sys/mips/conf/Makefile.pic32 +++ b/sys/mips/conf/Makefile.pic32 @@ -20,13 +20,13 @@ # DEBUG is set to -g by config if debugging is requested (config -g). # PROF is set to -pg by config if profiling is requested (config -p). -AS= ${MIPS_TOOLCHAIN}as ${DEBUG} -CC= ${MIPS_TOOLCHAIN}gcc ${DEBUG} -fno-builtin +AS= ${MIPS_GCC_PREFIX}as ${DEBUG} +CC= ${MIPS_GCC_PREFIX}gcc ${DEBUG} -fno-builtin LOCALCC= gcc -m32 ${DEBUG} CPP= cpp -LD= ${MIPS_TOOLCHAIN}gcc +LD= ${MIPS_GCC_PREFIX}gcc LDFLAGS= -nostdlib -T $A/pic32/bootloader-max32.ld -Wl,-Map=unix.map -SIZE= ${MIPS_TOOLCHAIN}size +SIZE= ${MIPS_GCC_PREFIX}size # source tree is located via $S relative to the compilation directory S= ../.. @@ -66,7 +66,7 @@ SYSTEM_DEP= Makefile ${SYSTEM_OBJ} $S/libkern/libkern.a SYSTEM_LD_HEAD= rm -f $@ SYSTEM_LD= -@echo ${LD} ${LDFLAGS} '$${SYSTEM_OBJ}' vers.o -L$S/libkern -lkern -o vmunix; \ ${LD} ${LDFLAGS} ${SYSTEM_OBJ} vers.o -L$S/libkern -lkern -o vmunix -SYSTEM_LD_TAIL= chmod 755 $@; ${SIZE} $@ +SYSTEM_LD_TAIL= ${SIZE} $@ %LOAD diff --git a/sys/mips/conf/Makefile.pmax b/sys/mips/conf/Makefile.pmax index 03059716..df1555b1 100644 --- a/sys/mips/conf/Makefile.pmax +++ b/sys/mips/conf/Makefile.pmax @@ -21,13 +21,13 @@ # DEBUG is set to -g by config if debugging is requested (config -g). # PROF is set to -pg by config if profiling is requested (config -p). -AS= ${MIPS_TOOLCHAIN}as ${DEBUG} -CC= ${MIPS_TOOLCHAIN}gcc ${DEBUG} -fno-builtin +AS= ${MIPS_GCC_PREFIX}as ${DEBUG} +CC= ${MIPS_GCC_PREFIX}gcc ${DEBUG} -fno-builtin LOCALCC= gcc -m32 ${DEBUG} CPP= cpp -LD= ${MIPS_TOOLCHAIN}gcc +LD= ${MIPS_GCC_PREFIX}gcc LDFLAGS= -nostdlib -T $A/pmax/pmax.ld -Wl,-Map=unix.map -SIZE= ${MIPS_TOOLCHAIN}size +SIZE= ${MIPS_GCC_PREFIX}size # source tree is located via $S relative to the compilation directory S= ../.. diff --git a/sys/netinet/tcp_debug.c b/sys/netinet/tcp_debug.c index ddb30927..f8712a47 100644 --- a/sys/netinet/tcp_debug.c +++ b/sys/netinet/tcp_debug.c @@ -39,7 +39,6 @@ #define TCPSTATES #define TCPTIMERS #define TANAMES -#endif #include #include @@ -65,9 +64,12 @@ #include #include -#ifdef TCPDEBUG +#define TCP_NDEBUG 100 +struct tcp_debug tcp_debug[TCP_NDEBUG]; +int tcp_debx; + int tcpconsdebug = 0; -#endif + /* * Tcp debug routines */ @@ -97,7 +99,7 @@ tcp_trace(act, ostate, tp, ti, req) else bzero((caddr_t)&td->td_ti, sizeof (*ti)); td->td_req = req; -#ifdef TCPDEBUG + if (tcpconsdebug == 0) return; if (tp) @@ -155,5 +157,5 @@ tcp_trace(act, ostate, tp, ti, req) tp->snd_max); printf("\tsnd_(wl1,wl2,wnd) (%x,%x,%x)\n", tp->snd_wl1, tp->snd_wl2, tp->snd_wnd); -#endif /* TCPDEBUG */ } +#endif /* TCPDEBUG */ diff --git a/sys/netinet/tcp_debug.h b/sys/netinet/tcp_debug.h index c02c0cd5..3c5d57ae 100644 --- a/sys/netinet/tcp_debug.h +++ b/sys/netinet/tcp_debug.h @@ -53,7 +53,3 @@ struct tcp_debug { char *tanames[] = { "input", "output", "user", "respond", "drop" }; #endif - -#define TCP_NDEBUG 100 -struct tcp_debug tcp_debug[TCP_NDEBUG]; -int tcp_debx; diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 9bd82ee9..c1990b99 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -284,7 +284,7 @@ tcp_input(m, iphlen) } optlen = off - sizeof (struct tcphdr); optp = mtod(m, u_char *) + sizeof (struct tcpiphdr); - /* + /* * Do quick retrieval of timestamp options ("options * prediction?"). If timestamp is the only option and it's * formatted as recommended in RFC 1323 appendix A, we @@ -341,7 +341,7 @@ tcp_input(m, iphlen) goto dropwithreset; if (tp->t_state == TCPS_CLOSED) goto drop; - + /* Unscale the window into a 32-bit value. */ if ((tiflags & TH_SYN) == 0) tiwin = ti->ti_win << tp->snd_scale; @@ -413,7 +413,7 @@ tcp_input(m, iphlen) tcp_dooptions(tp, optp, optlen, ti, &ts_present, &ts_val, &ts_ecr); - /* + /* * Header prediction: check for the two common cases * of a uni-directional data xfer. If the packet has * no control flags, is in-sequence, the window didn't @@ -434,7 +434,7 @@ tcp_input(m, iphlen) tiwin && tiwin == tp->snd_wnd && tp->snd_nxt == tp->snd_max) { - /* + /* * If last ACK falls within this segment's sequence numbers, * record the timestamp. */ @@ -685,10 +685,10 @@ tcp_input(m, iphlen) /* * States other than LISTEN or SYN_SENT. * First check timestamp, if present. - * Then check that at least some bytes of segment are within + * Then check that at least some bytes of segment are within * receive window. If segment begins before rcv_nxt, * drop leading data (and SYN); if nothing left, just ack. - * + * * RFC 1323 PAWS: If we have a timestamp reply on this segment * and it's less than ts_recent, drop it. */ @@ -722,7 +722,7 @@ tcp_input(m, iphlen) if (tiflags & TH_SYN) { tiflags &= ~TH_SYN; ti->ti_seq++; - if (ti->ti_urp > 1) + if (ti->ti_urp > 1) ti->ti_urp--; else tiflags &= ~TH_URG; @@ -884,7 +884,7 @@ tcp_input(m, iphlen) */ if ((tiflags & TH_ACK) == 0) goto drop; - + /* * Ack processing. */ @@ -950,7 +950,7 @@ tcp_input(m, iphlen) * the new ssthresh). * * Dup acks mean that packets have left the - * network (they're now cached at the receiver) + * network (they're now cached at the receiver) * so bump cwnd by the amount in the receiver * to keep a constant cwnd packets in the * network. @@ -1161,14 +1161,14 @@ tcp_input(m, iphlen) * If this segment advances the known urgent pointer, * then mark the data stream. This should not happen * in CLOSE_WAIT, CLOSING, LAST_ACK or TIME_WAIT STATES since - * a FIN has been received from the remote side. + * a FIN has been received from the remote side. * In these states we ignore the URG. * * According to RFC961 (Assigned Protocols), * the urgent pointer points to the last octet * of urgent data. We continue, however, * to consider it to indicate the first octet - * of data past the urgent section as the original + * of data past the urgent section as the original * spec states (in one of two places). */ if (SEQ_GT(ti->ti_seq+ti->ti_urp, tp->rcv_up)) { @@ -1255,7 +1255,7 @@ tcp_input(m, iphlen) /* * In FIN_WAIT_2 state enter the TIME_WAIT state, - * starting the time-wait timer, turning off the other + * starting the time-wait timer, turning off the other * standard timers. */ case TCPS_FIN_WAIT_2: @@ -1273,9 +1273,10 @@ tcp_input(m, iphlen) break; } } +#ifdef TCPDEBUG if (so->so_options & SO_DEBUG) tcp_trace(TA_INPUT, ostate, tp, &tcp_saveti, 0); - +#endif /* * Return any desired output. */ @@ -1321,8 +1322,10 @@ tcp_input(m, iphlen) /* * Drop space held by incoming segment and return. */ +#ifdef TCPDEBUG if (tp && (tp->t_inpcb->inp_socket->so_options & SO_DEBUG)) tcp_trace(TA_DROP, ostate, tp, &tcp_saveti, 0); +#endif m_freem(m); /* destroy temporarily created socket */ if (dropsocket) @@ -1387,7 +1390,7 @@ tcp_dooptions(tp, cp, cnt, ti, ts_present, ts_val, ts_ecr) bcopy((char *)cp + 6, (char *) ts_ecr, sizeof(*ts_ecr)); NTOHL(*ts_ecr); - /* + /* * A timestamp received in a SYN makes * it ok to send timestamp requests and replies. */ @@ -1414,7 +1417,7 @@ tcp_pulloutofband(so, ti, m) register struct mbuf *m; { int cnt = ti->ti_urp - 1; - + while (cnt >= 0) { if (m->m_len > cnt) { char *cp = mtod(m, caddr_t) + cnt; @@ -1473,7 +1476,7 @@ tcp_xmit_timer(tp, rtt) if ((tp->t_rttvar += delta) <= 0) tp->t_rttvar = 1; } else { - /* + /* * No rtt measurement yet - use the unsmoothed rtt. * Set the variance to half the rtt (so our first * retransmit happens at 3*rtt). @@ -1497,7 +1500,7 @@ tcp_xmit_timer(tp, rtt) */ TCPT_RANGESET(tp->t_rxtcur, TCP_REXMTVAL(tp), tp->t_rttmin, TCPTV_REXMTMAX); - + /* * We received an ack for a packet that wasn't retransmitted; * it is probably safe to discard any error indications we've diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 84f71d97..6e7277a6 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -194,7 +194,7 @@ tcp_output(tp) * window, then want to send a window update to peer. */ if (win > 0) { - /* + /* * "adv" is the amount we can increase the window, * taking into account that we are limited by * TCP_MAXWIN << tp->rcv_scale. @@ -280,7 +280,7 @@ tcp_output(tp) mss = htons((u_short) tcp_mss(tp, 0)); bcopy((caddr_t)&mss, (caddr_t)(opt + 2), sizeof(mss)); optlen = 4; - + if ((tp->t_flags & TF_REQ_SCALE) && ((flags & TH_ACK) == 0 || (tp->t_flags & TF_RCVD_SCALE))) { @@ -293,9 +293,9 @@ tcp_output(tp) } } } - + /* - * Send a timestamp and echo-reply if this is a SYN and our side + * Send a timestamp and echo-reply if this is a SYN and our side * wants to use timestamps (TF_REQ_TSTMP is set) or both our side * and our peer have sent timestamps in our SYN's. */ @@ -304,7 +304,7 @@ tcp_output(tp) ((flags & (TH_SYN|TH_ACK)) == TH_SYN || (tp->t_flags & TF_RCVD_TSTMP))) { u_long *lp = (u_long *)(opt + optlen); - + /* Form timestamp option as shown in appendix A of RFC 1323. */ *lp++ = htonl(TCPOPT_TSTAMP_HDR); *lp++ = htonl(tcp_now); @@ -313,7 +313,7 @@ tcp_output(tp) } hdrlen += optlen; - + /* * Adjust data length if insertion of options will * bump the packet length beyond the t_maxseg length. @@ -414,7 +414,7 @@ tcp_output(tp) * window for use in delaying messages about window sizes. * If resending a FIN, be sure not to use a new sequence number. */ - if (flags & TH_FIN && tp->t_flags & TF_SENTFIN && + if (flags & TH_FIN && tp->t_flags & TF_SENTFIN && tp->snd_nxt == tp->snd_max) tp->snd_nxt--; /* @@ -527,9 +527,10 @@ tcp_output(tp) /* * Trace. */ +#ifdef TCPDEBUG if (so->so_options & SO_DEBUG) tcp_trace(TA_OUTPUT, tp->t_state, tp, ti, 0); - +#endif /* * Fill in IP length and desired time to live and * send to IP level. There should be a better way @@ -550,7 +551,7 @@ tcp_output(tp) error = ip_output(m, tp->t_inpcb->inp_options, &tp->t_inpcb->inp_route, so->so_options & SO_DONTROUTE, 0); #else - error = ip_output(m, (struct mbuf *)0, &tp->t_inpcb->inp_route, + error = ip_output(m, (struct mbuf *)0, &tp->t_inpcb->inp_route, so->so_options & SO_DONTROUTE); #endif } diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index cf9ffff3..f932b33f 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -339,8 +339,10 @@ tcp_usrreq(so, req, m, nam, control) default: panic("tcp_usrreq"); } +#ifdef TCPDEBUG if (tp && (so->so_options & SO_DEBUG)) tcp_trace(TA_USER, ostate, tp, (struct tcpiphdr *)0, req); +#endif splx(s); return (error); } diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index 6f09e840..72f7c10f 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -465,8 +465,7 @@ vnode_pager_uncache(vp) if (vp->v_type != VREG || (pager = (vm_pager_t)vp->v_vmdata) == NULL) return (TRUE); #ifdef DEBUG -#include "nfs.h" -#if NNFS > 0 +#ifdef NFS if (!VOP_ISLOCKED(vp)) { extern int (**nfsv2_vnodeop_p)();