From owner-svn-src-user@FreeBSD.ORG Wed Jun 22 14:27:31 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15C3F1065672; Wed, 22 Jun 2011 14:27:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05D3E8FC13; Wed, 22 Jun 2011 14:27:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MERUJX053042; Wed, 22 Jun 2011 14:27:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MERUvT053039; Wed, 22 Jun 2011 14:27:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106221427.p5MERUvT053039@svn.freebsd.org> From: Adrian Chadd Date: Wed, 22 Jun 2011 14:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223422 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 14:27:31 -0000 Author: adrian Date: Wed Jun 22 14:27:30 2011 New Revision: 223422 URL: http://svn.freebsd.org/changeset/base/223422 Log: Begin fleshing out the aggregate session handling code. Document what I see as currently missing, so I don't forget to fill in the gaps and implement this stuff. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Wed Jun 22 09:55:28 2011 (r223421) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Wed Jun 22 14:27:30 2011 (r223422) @@ -939,6 +939,12 @@ ath_tx_start(struct ath_softc *sc, struc ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); /* A-MPDU TX */ + /* + * XXX This doesn't hold the node lock! + * XXX So it's possible that another TX process can change + * XXX the AMPDU status from underneath us. This needs to be + * XXX further investigated! + */ is_ampdu_tx = ath_tx_ampdu_running(sc, ATH_NODE(ni), tid); is_ampdu_pending = ath_tx_ampdu_pending(sc, ATH_NODE(ni), tid); is_ampdu = is_ampdu_tx | is_ampdu_pending; @@ -1646,15 +1652,90 @@ ath_tx_tid_cleanup(struct ath_softc *sc, } /* + * Handle completion of aggregate frames. + */ +static void +ath_tx_aggr_comp(struct ath_softc *sc, struct ath_buf *bf) +{ + /* Success? Complete */ + ath_tx_default_comp(sc, bf); + + /* + * Not success and have retries left? + * + * Mark as retry, requeue at head of queue + */ + + /* + * Not success and out of retries? + * + * Need to wait for the hardware TXQ to finish draining, + * then once we know what was successfully TXed and what + * wasn't, we send a BAR to advance the pointer to that + * place. + */ +} + +/* * Schedule some packets from the given node/TID to the hardware. * - * For non-aggregate packets, all packets can just be queued. - * Aggregate destinations will end up having limitations on - * what can actually be queued here (ie, not more than the - * block-ack window.) + * This is the aggregate version. + */ +void +ath_tx_tid_hw_queue_aggr(struct ath_softc *sc, struct ath_node *an, int tid) +{ + struct ath_buf *bf; + struct ath_txq *txq; + struct ath_tid *atid = &an->an_tid[tid]; + + for (;;) { + ATH_TXQ_LOCK(atid); + bf = STAILQ_FIRST(&atid->axq_q); + if (bf == NULL) { + ATH_TXQ_UNLOCK(atid); + break; + } + + /* XXX check if seqno is outside of BAW, if so don't queue it */ + + /* + * XXX If the seqno is out of BAW, then we should pause this TID + * XXX until a completion for this TID allows the BAW to be advanced. + * XXX Otherwise it's possible that we'll simply keep getting called + * XXX for this node/TID until some TX completion has occured + * XXX and progress can be made. + */ + ATH_TXQ_REMOVE_HEAD(atid, bf_list); + ATH_TXQ_UNLOCK(atid); + + /* Remove from queue */ + ATH_NODE_LOCK(an); + an->an_qdepth--; + ATH_NODE_UNLOCK(an); + + txq = bf->bf_state.bfs_txq; + /* Sanity check! */ + if (tid != bf->bf_state.bfs_tid) { + device_printf(sc->sc_dev, "%s: bfs_tid %d !=" + " tid %d\n", + __func__, bf->bf_state.bfs_tid, tid); + } + + /* Set completion handler */ + bf->bf_comp = ath_tx_aggr_comp; + + /* Punt to hardware or software txq */ + ath_tx_handoff(sc, txq, bf); + } +} + + + +/* + * Schedule some packets from the given node/TID to the hardware. */ void -ath_tx_tid_hw_queue(struct ath_softc *sc, struct ath_node *an, int tid) +ath_tx_tid_hw_queue_norm(struct ath_softc *sc, struct ath_node *an, int tid) { struct ath_buf *bf; struct ath_txq *txq; @@ -1695,29 +1776,28 @@ void ath_tx_hw_queue(struct ath_softc *sc, struct ath_node *an) { struct ath_tid *atid; - int i; + int tid; /* * For now, just queue from all TIDs in order. * This is very likely absolutely wrong from a QoS * perspective but it'll do for now. */ - for (i = 0; i < IEEE80211_TID_SIZE; i++) { - atid = &an->an_tid[i]; + for (tid = 0; tid < IEEE80211_TID_SIZE; tid++) { + atid = &an->an_tid[tid]; ATH_NODE_LOCK(an); - if (ath_tx_ampdu_pending(sc, an, i)) { + if (ath_tx_ampdu_pending(sc, an, tid)) { ATH_NODE_UNLOCK(an); continue; } ATH_NODE_UNLOCK(an); - ath_tx_tid_hw_queue(sc, an, i); + if (ath_tx_ampdu_running(sc, an, tid)) + ath_tx_tid_hw_queue_aggr(sc, an, tid); + else + ath_tx_tid_hw_queue_norm(sc, an, tid); } } -/* - * XXX this needs to be atomic or ath_node locked - * XXX This is currently serialised behind the ATH lock - */ static int ath_txq_node_qlen(struct ath_softc *sc, struct ath_node *an) { @@ -1783,7 +1863,7 @@ ath_tx_ampdu_running(struct ath_softc *s { struct ieee80211_tx_ampdu *tap; - //ATH_NODE_LOCK_ASSERT(an); + ATH_NODE_LOCK_ASSERT(an); tap = ath_tx_get_tx_tid(an, tid); if (tap == NULL) @@ -1802,7 +1882,7 @@ ath_tx_ampdu_pending(struct ath_softc *s { struct ieee80211_tx_ampdu *tap; - //ATH_NODE_LOCK_ASSERT(an); + ATH_NODE_LOCK_ASSERT(an); tap = ath_tx_get_tx_tid(an, tid); if (tap == NULL) Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h Wed Jun 22 09:55:28 2011 (r223421) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h Wed Jun 22 14:27:30 2011 (r223422) @@ -47,7 +47,9 @@ extern void ath_tx_swq(struct ath_softc struct ath_txq *txq, struct ath_buf *bf, struct mbuf *m0); extern void ath_tx_tid_init(struct ath_softc *sc, struct ath_node *an); extern void ath_tx_tid_cleanup(struct ath_softc *sc, struct ath_node *an); -extern void ath_tx_tid_hw_queue(struct ath_softc *sc, struct ath_node *an, +extern void ath_tx_tid_hw_queue_aggr(struct ath_softc *sc, struct ath_node *an, + int tid); +extern void ath_tx_tid_hw_queue_norm(struct ath_softc *sc, struct ath_node *an, int tid); extern void ath_tx_hw_queue(struct ath_softc *sc, struct ath_node *an); extern void ath_txq_sched(struct ath_softc *sc); From owner-svn-src-user@FreeBSD.ORG Wed Jun 22 14:33:16 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 891801065678; Wed, 22 Jun 2011 14:33:16 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 637828FC14; Wed, 22 Jun 2011 14:33:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MEXGcu053251; Wed, 22 Jun 2011 14:33:16 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MEXGHN053249; Wed, 22 Jun 2011 14:33:16 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106221433.p5MEXGHN053249@svn.freebsd.org> From: Adrian Chadd Date: Wed, 22 Jun 2011 14:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223423 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 14:33:16 -0000 Author: adrian Date: Wed Jun 22 14:33:16 2011 New Revision: 223423 URL: http://svn.freebsd.org/changeset/base/223423 Log: Squirrel away a cheap copy of the sequence number to use in later trechery. When doing A-MPDU, the sequence number of the current packet is needed in order to ensure what's queued to the hardware is within the BAW. When doing aggregation, the sequence number of the current packet is needed to see whether to squeeze said packet into an aggregate. The code could use M_SEQNO() (and I may do that later) but one of my aims is to separate out the code which handles mbufs to the code which does all the rest of it. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Wed Jun 22 14:27:30 2011 (r223422) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Wed Jun 22 14:33:16 2011 (r223423) @@ -965,6 +965,12 @@ ath_tx_start(struct ath_softc *sc, struc if (is_ampdu_tx) seqno = ath_tx_tid_seqno_assign(sc, ni, bf, m0); + /* + * If needed, the sequence number has been assigned. + * Squirrel it away somewhere easy to get to. + */ + bf->bf_state.bfs_seqno = M_SEQNO_GET(m0); + #if 0 /* Is ampdu pending? fetch the seqno and print it out */ if (is_ampdu_pending) From owner-svn-src-user@FreeBSD.ORG Wed Jun 22 16:26:22 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 487F11065672; Wed, 22 Jun 2011 16:26:22 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38DD28FC08; Wed, 22 Jun 2011 16:26:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MGQM63056724; Wed, 22 Jun 2011 16:26:22 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MGQM5L056722; Wed, 22 Jun 2011 16:26:22 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201106221626.p5MGQM5L056722@svn.freebsd.org> From: Gabor Kovesdan Date: Wed, 22 Jun 2011 16:26:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223425 - user/gabor/tre-integration/lib/libc/regex X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 16:26:22 -0000 Author: gabor Date: Wed Jun 22 16:26:21 2011 New Revision: 223425 URL: http://svn.freebsd.org/changeset/base/223425 Log: - Reduce namespace to the actually necessary symbols Modified: user/gabor/tre-integration/lib/libc/regex/Symbol.map Modified: user/gabor/tre-integration/lib/libc/regex/Symbol.map ============================================================================== --- user/gabor/tre-integration/lib/libc/regex/Symbol.map Wed Jun 22 16:15:15 2011 (r223424) +++ user/gabor/tre-integration/lib/libc/regex/Symbol.map Wed Jun 22 16:26:21 2011 (r223425) @@ -20,9 +20,12 @@ FBSD_1.2 { regwncomp; regwnexec; tre_config; + tre_regaparams_default; +}; + +FBSDprivate_1.0 { tre_regacomp; tre_regaexec; - tre_regaparams_default; tre_regancomp; tre_reganexec; tre_regawncomp; From owner-svn-src-user@FreeBSD.ORG Wed Jun 22 20:20:50 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18799106566B; Wed, 22 Jun 2011 20:20:50 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0369D8FC17; Wed, 22 Jun 2011 20:20:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MKKngR065592; Wed, 22 Jun 2011 20:20:50 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MKKnrT065586; Wed, 22 Jun 2011 20:20:49 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201106222020.p5MKKnrT065586@svn.freebsd.org> From: Gabor Kovesdan Date: Wed, 22 Jun 2011 20:20:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223439 - user/gabor/tre-integration/lib/libc/regex/grot X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 20:20:50 -0000 Author: gabor Date: Wed Jun 22 20:20:49 2011 New Revision: 223439 URL: http://svn.freebsd.org/changeset/base/223439 Log: - Readd regression tests from previous regex code; probably it will be still useful Added: user/gabor/tre-integration/lib/libc/regex/grot/ user/gabor/tre-integration/lib/libc/regex/grot/Makefile (contents, props changed) user/gabor/tre-integration/lib/libc/regex/grot/debug.c (contents, props changed) user/gabor/tre-integration/lib/libc/regex/grot/main.c (contents, props changed) user/gabor/tre-integration/lib/libc/regex/grot/mkh (contents, props changed) user/gabor/tre-integration/lib/libc/regex/grot/split.c (contents, props changed) user/gabor/tre-integration/lib/libc/regex/grot/tests Added: user/gabor/tre-integration/lib/libc/regex/grot/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gabor/tre-integration/lib/libc/regex/grot/Makefile Wed Jun 22 20:20:49 2011 (r223439) @@ -0,0 +1,98 @@ +# $FreeBSD$ +# You probably want to take -DREDEBUG out of CFLAGS, and put something like +# -O in, *after* testing (-DREDEBUG strengthens testing by enabling a lot of +# internal assertion checking). Take -Dconst= out for an ANSI compiler. +# Do not take -DPOSIX_MISTAKE out. REGCFLAGS isn't important to you (it's +# for my use in some special contexts). + +PATHS= ${.CURDIR}/.. ${.CURDIR}/../../locale ${.CURDIR}/../../../../include +.PATH: ${PATHS} + +CFLAGS+= -DPOSIX_MISTAKE -DREDEBUG $(REGCFLAGS) +.for incpath in ${PATHS} +CFLAGS+= -I${incpath} +.endfor + +# If you have an ANSI compiler, take -o out of MKHFLAGS. If you want +# the Berkeley __P macro, put -b in. +MKHFLAGS = + +LDFLAGS = + +# If you have an ANSI environment, take limits.h and stdlib.h out of +# HMISSING and take memmove out of SRCMISSING and OBJMISSING. +HMISSING = +SRCMISSING = split.c +OBJMISSING = split.o +H = cname.h regex2.h utils.h $(HMISSING) +REGSRC = regcomp.c regerror.c regexec.c regfree.c engine.c +SRC = $(REGSRC) debug.c main.c $(SRCMISSING) + +# Internal stuff, should not need changing. +OBJPRODN = regcomp.o regexec.o regerror.o regfree.o +OBJS = $(OBJPRODN) debug.o main.o $(OBJMISSING) + +# Stuff that matters only if you're trying to lint the package. +LINTFLAGS = -I. -Dstatic= -Dconst= -DREDEBUG +LINTC = regcomp.c regexec.c regerror.c regfree.c debug.c main.c $(SRCMISSING) +JUNKLINT =possible pointer alignment|null effect + +.SUFFIXES: .ih .h +.c.ih: + sh mkh $(MKHFLAGS) -p $< >$@ + +default: r + +re: $(OBJS) + $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@ + +o: $(OBJPRODN) + +REGEXHSRC = ../regex2.h ../reg*.c +h: $(REGEXHSRC) + sh mkh $(MKHFLAGS) -i _REGEX_H_ $(REGEXHSRC) >regex.tmp + cmp -s regex.tmp regex.h 2>/dev/null || cp regex.tmp regex.h + rm -f regex.tmp + +regex.h: h + +regcomp.o regexec.o regfree.o debug.o: utils.h regex.h regex2.h +regcomp.o: cname.h regcomp.ih +regexec.o: engine.c engine.ih +regerror.o: regerror.ih +regerror.o: utils.h +debug.o: debug.ih +main.o: main.ih + +r: re tests + ./re &1 | egrep -v '$(JUNKLINT)' | tee lint + +clean: tidy + rm -f *.o *.s *.ih re + +tidy: + rm -f junk* core regex.tmp lint + +spotless: clean + rm -f regex.h Added: user/gabor/tre-integration/lib/libc/regex/grot/debug.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gabor/tre-integration/lib/libc/regex/grot/debug.c Wed Jun 22 20:20:49 2011 (r223439) @@ -0,0 +1,212 @@ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "utils.h" +#include "regex2.h" +#include "debug.ih" + +/* + - regprint - print a regexp for debugging + == void regprint(regex_t *r, FILE *d); + */ +void +regprint(r, d) +regex_t *r; +FILE *d; +{ + struct re_guts *g = r->re_g; + int i; + int c; + int last; + + fprintf(d, "%ld states", (long)g->nstates); + fprintf(d, ", first %ld last %ld", (long)g->firststate, + (long)g->laststate); + if (g->iflags&USEBOL) + fprintf(d, ", USEBOL"); + if (g->iflags&USEEOL) + fprintf(d, ", USEEOL"); + if (g->iflags&BAD) + fprintf(d, ", BAD"); + if (g->nsub > 0) + fprintf(d, ", nsub=%ld", (long)g->nsub); + if (g->must != NULL) + fprintf(d, ", must(%ld) `%*s'", (long)g->mlen, (int)g->mlen, + g->must); + if (g->backrefs) + fprintf(d, ", backrefs"); + if (g->nplus > 0) + fprintf(d, ", nplus %ld", (long)g->nplus); + fprintf(d, "\n"); + s_print(g, d); +} + +/* + - s_print - print the strip for debugging + == static void s_print(struct re_guts *g, FILE *d); + */ +static void +s_print(g, d) +struct re_guts *g; +FILE *d; +{ + sop *s; + cset *cs; + int i; + int done = 0; + sop opnd; + int col = 0; + int last; + sopno offset = 2; +# define GAP() { if (offset % 5 == 0) { \ + if (col > 40) { \ + fprintf(d, "\n\t"); \ + col = 0; \ + } else { \ + fprintf(d, " "); \ + col++; \ + } \ + } else \ + col++; \ + offset++; \ + } + + if (OP(g->strip[0]) != OEND) + fprintf(d, "missing initial OEND!\n"); + for (s = &g->strip[1]; !done; s++) { + opnd = OPND(*s); + switch (OP(*s)) { + case OEND: + fprintf(d, "\n"); + done = 1; + break; + case OCHAR: + if (strchr("\\|()^$.[+*?{}!<> ", (char)opnd) != NULL) + fprintf(d, "\\%c", (char)opnd); + else + fprintf(d, "%s", regchar((char)opnd)); + break; + case OBOL: + fprintf(d, "^"); + break; + case OEOL: + fprintf(d, "$"); + break; + case OBOW: + fprintf(d, "\\{"); + break; + case OEOW: + fprintf(d, "\\}"); + break; + case OANY: + fprintf(d, "."); + break; + case OANYOF: + fprintf(d, "[(%ld)", (long)opnd); +#if 0 + cs = &g->sets[opnd]; + last = -1; + for (i = 0; i < g->csetsize+1; i++) /* +1 flushes */ + if (CHIN(cs, i) && i < g->csetsize) { + if (last < 0) { + fprintf(d, "%s", regchar(i)); + last = i; + } + } else { + if (last >= 0) { + if (last != i-1) + fprintf(d, "-%s", + regchar(i-1)); + last = -1; + } + } +#endif + fprintf(d, "]"); + break; + case OBACK_: + fprintf(d, "(\\<%ld>", (long)opnd); + break; + case O_BACK: + fprintf(d, "<%ld>\\)", (long)opnd); + break; + case OPLUS_: + fprintf(d, "(+"); + if (OP(*(s+opnd)) != O_PLUS) + fprintf(d, "<%ld>", (long)opnd); + break; + case O_PLUS: + if (OP(*(s-opnd)) != OPLUS_) + fprintf(d, "<%ld>", (long)opnd); + fprintf(d, "+)"); + break; + case OQUEST_: + fprintf(d, "(?"); + if (OP(*(s+opnd)) != O_QUEST) + fprintf(d, "<%ld>", (long)opnd); + break; + case O_QUEST: + if (OP(*(s-opnd)) != OQUEST_) + fprintf(d, "<%ld>", (long)opnd); + fprintf(d, "?)"); + break; + case OLPAREN: + fprintf(d, "((<%ld>", (long)opnd); + break; + case ORPAREN: + fprintf(d, "<%ld>))", (long)opnd); + break; + case OCH_: + fprintf(d, "<"); + if (OP(*(s+opnd)) != OOR2) + fprintf(d, "<%ld>", (long)opnd); + break; + case OOR1: + if (OP(*(s-opnd)) != OOR1 && OP(*(s-opnd)) != OCH_) + fprintf(d, "<%ld>", (long)opnd); + fprintf(d, "|"); + break; + case OOR2: + fprintf(d, "|"); + if (OP(*(s+opnd)) != OOR2 && OP(*(s+opnd)) != O_CH) + fprintf(d, "<%ld>", (long)opnd); + break; + case O_CH: + if (OP(*(s-opnd)) != OOR1) + fprintf(d, "<%ld>", (long)opnd); + fprintf(d, ">"); + break; + default: + fprintf(d, "!%d(%d)!", OP(*s), opnd); + break; + } + if (!done) + GAP(); + } +} + +/* + - regchar - make a character printable + == static char *regchar(int ch); + */ +static char * /* -> representation */ +regchar(ch) +int ch; +{ + static char buf[10]; + + if (isprint(ch) || ch == ' ') + sprintf(buf, "%c", ch); + else + sprintf(buf, "\\%o", ch); + return(buf); +} Added: user/gabor/tre-integration/lib/libc/regex/grot/main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gabor/tre-integration/lib/libc/regex/grot/main.c Wed Jun 22 20:20:49 2011 (r223439) @@ -0,0 +1,513 @@ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include "main.ih" + +char *progname; +int debug = 0; +int line = 0; +int status = 0; + +int copts = REG_EXTENDED; +int eopts = 0; +regoff_t startoff = 0; +regoff_t endoff = 0; + + +extern int split(); +extern void regprint(); + +/* + - main - do the simple case, hand off to regress() for regression + */ +main(argc, argv) +int argc; +char *argv[]; +{ + regex_t re; +# define NS 10 + regmatch_t subs[NS]; + char erbuf[100]; + int err; + size_t len; + int c; + int errflg = 0; + int i; + extern int optind; + extern char *optarg; + + progname = argv[0]; + + while ((c = getopt(argc, argv, "c:e:S:E:x")) != -1) + switch (c) { + case 'c': /* compile options */ + copts = options('c', optarg); + break; + case 'e': /* execute options */ + eopts = options('e', optarg); + break; + case 'S': /* start offset */ + startoff = (regoff_t)atoi(optarg); + break; + case 'E': /* end offset */ + endoff = (regoff_t)atoi(optarg); + break; + case 'x': /* Debugging. */ + debug++; + break; + case '?': + default: + errflg++; + break; + } + if (errflg) { + fprintf(stderr, "usage: %s ", progname); + fprintf(stderr, "[-c copt][-C][-d] [re]\n"); + exit(2); + } + + if (optind >= argc) { + regress(stdin); + exit(status); + } + + err = regcomp(&re, argv[optind++], copts); + if (err) { + len = regerror(err, &re, erbuf, sizeof(erbuf)); + fprintf(stderr, "error %s, %d/%d `%s'\n", + eprint(err), len, sizeof(erbuf), erbuf); + exit(status); + } + regprint(&re, stdout); + + if (optind >= argc) { + regfree(&re); + exit(status); + } + + if (eopts®_STARTEND) { + subs[0].rm_so = startoff; + subs[0].rm_eo = strlen(argv[optind]) - endoff; + } + err = regexec(&re, argv[optind], (size_t)NS, subs, eopts); + if (err) { + len = regerror(err, &re, erbuf, sizeof(erbuf)); + fprintf(stderr, "error %s, %d/%d `%s'\n", + eprint(err), len, sizeof(erbuf), erbuf); + exit(status); + } + if (!(copts®_NOSUB)) { + len = (int)(subs[0].rm_eo - subs[0].rm_so); + if (subs[0].rm_so != -1) { + if (len != 0) + printf("match `%.*s'\n", len, + argv[optind] + subs[0].rm_so); + else + printf("match `'@%.1s\n", + argv[optind] + subs[0].rm_so); + } + for (i = 1; i < NS; i++) + if (subs[i].rm_so != -1) + printf("(%d) `%.*s'\n", i, + (int)(subs[i].rm_eo - subs[i].rm_so), + argv[optind] + subs[i].rm_so); + } + exit(status); +} + +/* + - regress - main loop of regression test + == void regress(FILE *in); + */ +void +regress(in) +FILE *in; +{ + char inbuf[1000]; +# define MAXF 10 + char *f[MAXF]; + int nf; + int i; + char erbuf[100]; + size_t ne; + char *badpat = "invalid regular expression"; +# define SHORT 10 + char *bpname = "REG_BADPAT"; + regex_t re; + + while (fgets(inbuf, sizeof(inbuf), in) != NULL) { + line++; + if (inbuf[0] == '#' || inbuf[0] == '\n') + continue; /* NOTE CONTINUE */ + inbuf[strlen(inbuf)-1] = '\0'; /* get rid of stupid \n */ + if (debug) + fprintf(stdout, "%d:\n", line); + nf = split(inbuf, f, MAXF, "\t\t"); + if (nf < 3) { + fprintf(stderr, "bad input, line %d\n", line); + exit(1); + } + for (i = 0; i < nf; i++) + if (strcmp(f[i], "\"\"") == 0) + f[i] = ""; + if (nf <= 3) + f[3] = NULL; + if (nf <= 4) + f[4] = NULL; + try(f[0], f[1], f[2], f[3], f[4], options('c', f[1])); + if (opt('&', f[1])) /* try with either type of RE */ + try(f[0], f[1], f[2], f[3], f[4], + options('c', f[1]) &~ REG_EXTENDED); + } + + ne = regerror(REG_BADPAT, (regex_t *)NULL, erbuf, sizeof(erbuf)); + if (strcmp(erbuf, badpat) != 0 || ne != strlen(badpat)+1) { + fprintf(stderr, "end: regerror() test gave `%s' not `%s'\n", + erbuf, badpat); + status = 1; + } + ne = regerror(REG_BADPAT, (regex_t *)NULL, erbuf, (size_t)SHORT); + if (strncmp(erbuf, badpat, SHORT-1) != 0 || erbuf[SHORT-1] != '\0' || + ne != strlen(badpat)+1) { + fprintf(stderr, "end: regerror() short test gave `%s' not `%.*s'\n", + erbuf, SHORT-1, badpat); + status = 1; + } + ne = regerror(REG_ITOA|REG_BADPAT, (regex_t *)NULL, erbuf, sizeof(erbuf)); + if (strcmp(erbuf, bpname) != 0 || ne != strlen(bpname)+1) { + fprintf(stderr, "end: regerror() ITOA test gave `%s' not `%s'\n", + erbuf, bpname); + status = 1; + } + re.re_endp = bpname; + ne = regerror(REG_ATOI, &re, erbuf, sizeof(erbuf)); + if (atoi(erbuf) != (int)REG_BADPAT) { + fprintf(stderr, "end: regerror() ATOI test gave `%s' not `%ld'\n", + erbuf, (long)REG_BADPAT); + status = 1; + } else if (ne != strlen(erbuf)+1) { + fprintf(stderr, "end: regerror() ATOI test len(`%s') = %ld\n", + erbuf, (long)REG_BADPAT); + status = 1; + } +} + +/* + - try - try it, and report on problems + == void try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts); + */ +void +try(f0, f1, f2, f3, f4, opts) +char *f0; +char *f1; +char *f2; +char *f3; +char *f4; +int opts; /* may not match f1 */ +{ + regex_t re; +# define NSUBS 10 + regmatch_t subs[NSUBS]; +# define NSHOULD 15 + char *should[NSHOULD]; + int nshould; + char erbuf[100]; + int err; + int len; + char *type = (opts & REG_EXTENDED) ? "ERE" : "BRE"; + int i; + char *grump; + char f0copy[1000]; + char f2copy[1000]; + + strcpy(f0copy, f0); + re.re_endp = (opts®_PEND) ? f0copy + strlen(f0copy) : NULL; + fixstr(f0copy); + err = regcomp(&re, f0copy, opts); + if (err != 0 && (!opt('C', f1) || err != efind(f2))) { + /* unexpected error or wrong error */ + len = regerror(err, &re, erbuf, sizeof(erbuf)); + fprintf(stderr, "%d: %s error %s, %d/%d `%s'\n", + line, type, eprint(err), len, + sizeof(erbuf), erbuf); + status = 1; + } else if (err == 0 && opt('C', f1)) { + /* unexpected success */ + fprintf(stderr, "%d: %s should have given REG_%s\n", + line, type, f2); + status = 1; + err = 1; /* so we won't try regexec */ + } + + if (err != 0) { + regfree(&re); + return; + } + + strcpy(f2copy, f2); + fixstr(f2copy); + + if (options('e', f1)®_STARTEND) { + if (strchr(f2, '(') == NULL || strchr(f2, ')') == NULL) + fprintf(stderr, "%d: bad STARTEND syntax\n", line); + subs[0].rm_so = strchr(f2, '(') - f2 + 1; + subs[0].rm_eo = strchr(f2, ')') - f2; + } + err = regexec(&re, f2copy, NSUBS, subs, options('e', f1)); + + if (err != 0 && (f3 != NULL || err != REG_NOMATCH)) { + /* unexpected error or wrong error */ + len = regerror(err, &re, erbuf, sizeof(erbuf)); + fprintf(stderr, "%d: %s exec error %s, %d/%d `%s'\n", + line, type, eprint(err), len, + sizeof(erbuf), erbuf); + status = 1; + } else if (err != 0) { + /* nothing more to check */ + } else if (f3 == NULL) { + /* unexpected success */ + fprintf(stderr, "%d: %s exec should have failed\n", + line, type); + status = 1; + err = 1; /* just on principle */ + } else if (opts®_NOSUB) { + /* nothing more to check */ + } else if ((grump = check(f2, subs[0], f3)) != NULL) { + fprintf(stderr, "%d: %s %s\n", line, type, grump); + status = 1; + err = 1; + } + + if (err != 0 || f4 == NULL) { + regfree(&re); + return; + } + + for (i = 1; i < NSHOULD; i++) + should[i] = NULL; + nshould = split(f4, should+1, NSHOULD-1, ","); + if (nshould == 0) { + nshould = 1; + should[1] = ""; + } + for (i = 1; i < NSUBS; i++) { + grump = check(f2, subs[i], should[i]); + if (grump != NULL) { + fprintf(stderr, "%d: %s $%d %s\n", line, + type, i, grump); + status = 1; + err = 1; + } + } + + regfree(&re); +} + +/* + - options - pick options out of a regression-test string + == int options(int type, char *s); + */ +int +options(type, s) +int type; /* 'c' compile, 'e' exec */ +char *s; +{ + char *p; + int o = (type == 'c') ? copts : eopts; + char *legal = (type == 'c') ? "bisnmp" : "^$#tl"; + + for (p = s; *p != '\0'; p++) + if (strchr(legal, *p) != NULL) + switch (*p) { + case 'b': + o &= ~REG_EXTENDED; + break; + case 'i': + o |= REG_ICASE; + break; + case 's': + o |= REG_NOSUB; + break; + case 'n': + o |= REG_NEWLINE; + break; + case 'm': + o &= ~REG_EXTENDED; + o |= REG_NOSPEC; + break; + case 'p': + o |= REG_PEND; + break; + case '^': + o |= REG_NOTBOL; + break; + case '$': + o |= REG_NOTEOL; + break; + case '#': + o |= REG_STARTEND; + break; + case 't': /* trace */ + o |= REG_TRACE; + break; + case 'l': /* force long representation */ + o |= REG_LARGE; + break; + case 'r': /* force backref use */ + o |= REG_BACKR; + break; + } + return(o); +} + +/* + - opt - is a particular option in a regression string? + == int opt(int c, char *s); + */ +int /* predicate */ +opt(c, s) +int c; +char *s; +{ + return(strchr(s, c) != NULL); +} + +/* + - fixstr - transform magic characters in strings + == void fixstr(char *p); + */ +void +fixstr(p) +char *p; +{ + if (p == NULL) + return; + + for (; *p != '\0'; p++) + if (*p == 'N') + *p = '\n'; + else if (*p == 'T') + *p = '\t'; + else if (*p == 'S') + *p = ' '; + else if (*p == 'Z') + *p = '\0'; +} + +/* + - check - check a substring match + == char *check(char *str, regmatch_t sub, char *should); + */ +char * /* NULL or complaint */ +check(str, sub, should) +char *str; +regmatch_t sub; +char *should; +{ + int len; + int shlen; + char *p; + static char grump[500]; + char *at = NULL; + + if (should != NULL && strcmp(should, "-") == 0) + should = NULL; + if (should != NULL && should[0] == '@') { + at = should + 1; + should = ""; + } + + /* check rm_so and rm_eo for consistency */ + if (sub.rm_so > sub.rm_eo || (sub.rm_so == -1 && sub.rm_eo != -1) || + (sub.rm_so != -1 && sub.rm_eo == -1) || + (sub.rm_so != -1 && sub.rm_so < 0) || + (sub.rm_eo != -1 && sub.rm_eo < 0) ) { + sprintf(grump, "start %ld end %ld", (long)sub.rm_so, + (long)sub.rm_eo); + return(grump); + } + + /* check for no match */ + if (sub.rm_so == -1 && should == NULL) + return(NULL); + if (sub.rm_so == -1) + return("did not match"); + + /* check for in range */ + if (sub.rm_eo > strlen(str)) { + sprintf(grump, "start %ld end %ld, past end of string", + (long)sub.rm_so, (long)sub.rm_eo); + return(grump); + } + + len = (int)(sub.rm_eo - sub.rm_so); + shlen = (int)strlen(should); + p = str + sub.rm_so; + + /* check for not supposed to match */ + if (should == NULL) { + sprintf(grump, "matched `%.*s'", len, p); + return(grump); + } + + /* check for wrong match */ + if (len != shlen || strncmp(p, should, (size_t)shlen) != 0) { + sprintf(grump, "matched `%.*s' instead", len, p); + return(grump); + } + if (shlen > 0) + return(NULL); + + /* check null match in right place */ + if (at == NULL) + return(NULL); + shlen = strlen(at); + if (shlen == 0) + shlen = 1; /* force check for end-of-string */ + if (strncmp(p, at, shlen) != 0) { + sprintf(grump, "matched null at `%.20s'", p); + return(grump); + } + return(NULL); +} + +/* + - eprint - convert error number to name + == static char *eprint(int err); + */ +static char * +eprint(err) +int err; +{ + static char epbuf[100]; + size_t len; + + len = regerror(REG_ITOA|err, (regex_t *)NULL, epbuf, sizeof(epbuf)); + assert(len <= sizeof(epbuf)); + return(epbuf); +} + +/* + - efind - convert error name to number + == static int efind(char *name); + */ +static int +efind(name) +char *name; +{ + static char efbuf[100]; + size_t n; + regex_t re; + + sprintf(efbuf, "REG_%s", name); + assert(strlen(efbuf) < sizeof(efbuf)); + re.re_endp = efbuf; + (void) regerror(REG_ATOI, &re, efbuf, sizeof(efbuf)); + return(atoi(efbuf)); +} Added: user/gabor/tre-integration/lib/libc/regex/grot/mkh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gabor/tre-integration/lib/libc/regex/grot/mkh Wed Jun 22 20:20:49 2011 (r223439) @@ -0,0 +1,77 @@ +#! /bin/sh +# mkh - pull headers out of C source +# $FreeBSD: head/lib/libc/regex/grot/mkh 92971 2002-03-22 19:45:43Z obrien $ +PATH=/bin:/usr/bin ; export PATH + +# egrep pattern to pick out marked lines +egrep='^ =([ ]|$)' + +# Sed program to process marked lines into lines for the header file. +# The markers have already been removed. Two things are done here: removal +# of backslashed newlines, and some fudging of comments. The first is done +# because -o needs to have prototypes on one line to strip them down. +# Getting comments into the output is tricky; we turn C++-style // comments +# into /* */ comments, after altering any existing */'s to avoid trouble. +peel=' /\\$/N + /\\\n[ ]*/s///g + /\/\//s;\*/;* /;g + /\/\//s;//\(.*\);/*\1 */;' + +for a +do + case "$a" in + -o) # old (pre-function-prototype) compiler + # add code to comment out argument lists + peel="$peel + "'/^\([^#\/][^\/]*[a-zA-Z0-9_)]\)(\(.*\))/s;;\1(/*\2*/);' + shift + ;; + -b) # funny Berkeley __P macro + peel="$peel + "'/^\([^#\/][^\/]*[a-zA-Z0-9_)]\)(\(.*\))/s;;\1 __P((\2));' + shift + ;; + -s) # compiler doesn't like `static foo();' + # add code to get rid of the `static' + peel="$peel + "'/^static[ ][^\/]*[a-zA-Z0-9_)](.*)/s;static.;;' + shift + ;; + -p) # private declarations + egrep='^ ==([ ]|$)' + shift + ;; + -i) # wrap in #ifndef, argument is name + ifndef="$2" + shift ; shift + ;; + *) break + ;; + esac +done + +if test " $ifndef" != " " +then + echo "#ifndef $ifndef" + echo "#define $ifndef /* never again */" +fi +echo "/* ========= begin header generated by $0 ========= */" +echo '#ifdef __cplusplus' +echo 'extern "C" {' +echo '#endif' +for f +do + echo + echo "/* === $f === */" + egrep "$egrep" $f | sed 's/^ ==*[ ]//;s/^ ==*$//' | sed "$peel" + echo +done +echo '#ifdef __cplusplus' +echo '}' +echo '#endif' +echo "/* ========= end header generated by $0 ========= */" +if test " $ifndef" != " " +then + echo "#endif" +fi +exit 0 Added: user/gabor/tre-integration/lib/libc/regex/grot/split.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gabor/tre-integration/lib/libc/regex/grot/split.c Wed Jun 22 20:20:49 2011 (r223439) @@ -0,0 +1,319 @@ +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +/* + - split - divide a string into fields, like awk split() + = int split(char *string, char *fields[], int nfields, char *sep); + */ +int /* number of fields, including overflow */ +split(string, fields, nfields, sep) +char *string; +char *fields[]; /* list is not NULL-terminated */ +int nfields; /* number of entries available in fields[] */ +char *sep; /* "" white, "c" single char, "ab" [ab]+ */ +{ + char *p = string; + char c; /* latest character */ + char sepc = sep[0]; + char sepc2; + int fn; + char **fp = fields; + char *sepp; + int trimtrail; + + /* white space */ + if (sepc == '\0') { + while ((c = *p++) == ' ' || c == '\t') + continue; + p--; + trimtrail = 1; + sep = " \t"; /* note, code below knows this is 2 long */ + sepc = ' '; + } else + trimtrail = 0; + sepc2 = sep[1]; /* now we can safely pick this up */ + + /* catch empties */ + if (*p == '\0') + return(0); + + /* single separator */ + if (sepc2 == '\0') { + fn = nfields; + for (;;) { + *fp++ = p; + fn--; + if (fn == 0) + break; + while ((c = *p++) != sepc) + if (c == '\0') + return(nfields - fn); + *(p-1) = '\0'; + } + /* we have overflowed the fields vector -- just count them */ + fn = nfields; + for (;;) { + while ((c = *p++) != sepc) + if (c == '\0') + return(fn); + fn++; + } + /* not reached */ + } + + /* two separators */ + if (sep[2] == '\0') { + fn = nfields; + for (;;) { + *fp++ = p; + fn--; + while ((c = *p++) != sepc && c != sepc2) + if (c == '\0') { + if (trimtrail && **(fp-1) == '\0') + fn++; + return(nfields - fn); + } + if (fn == 0) + break; + *(p-1) = '\0'; + while ((c = *p++) == sepc || c == sepc2) + continue; + p--; + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Wed Jun 22 23:36:03 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E8F5106566C; Wed, 22 Jun 2011 23:36:03 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EEE828FC13; Wed, 22 Jun 2011 23:36:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MNa2G1073607; Wed, 22 Jun 2011 23:36:02 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MNa2ID073575; Wed, 22 Jun 2011 23:36:02 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201106222336.p5MNa2ID073575@svn.freebsd.org> From: Gabor Kovesdan Date: Wed, 22 Jun 2011 23:36:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223452 - in user/gabor/tre-integration: bin/realpath bin/sh cddl/contrib/opensolaris/lib/libdtrace/common contrib/dialog contrib/lukemftp contrib/top etc etc/defaults etc/rc.d lib/libc... X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 23:36:03 -0000 Author: gabor Date: Wed Jun 22 23:36:01 2011 New Revision: 223452 URL: http://svn.freebsd.org/changeset/base/223452 Log: - MFC Added: - copied from r223450, head/contrib/tnftp/ user/gabor/tre-integration/etc/rc.d/netwait - copied unchanged from r223450, head/etc/rc.d/netwait user/gabor/tre-integration/sys/fs/nfsclient/nfs_clkdtrace.c - copied unchanged from r223450, head/sys/fs/nfsclient/nfs_clkdtrace.c user/gabor/tre-integration/sys/fs/nfsclient/nfs_kdtrace.h - copied unchanged from r223450, head/sys/fs/nfsclient/nfs_kdtrace.h user/gabor/tre-integration/sys/modules/dtrace/dtnfscl/ - copied from r223450, head/sys/modules/dtrace/dtnfscl/ user/gabor/tre-integration/sys/powerpc/ps3/ohci_ps3.c - copied unchanged from r223450, head/sys/powerpc/ps3/ohci_ps3.c user/gabor/tre-integration/sys/powerpc/ps3/ps3disk.c - copied unchanged from r223450, head/sys/powerpc/ps3/ps3disk.c user/gabor/tre-integration/sys/x86/include/pci_cfgreg.h - copied unchanged from r223450, head/sys/x86/include/pci_cfgreg.h user/gabor/tre-integration/sys/x86/pci/pci_bus.c - copied unchanged from r223450, head/sys/x86/pci/pci_bus.c user/gabor/tre-integration/tools/regression/bin/sh/execution/bg4.0 - copied unchanged from r223450, head/tools/regression/bin/sh/execution/bg4.0 user/gabor/tre-integration/usr.bin/ftp/tnftp_config.h - copied unchanged from r223450, head/usr.bin/ftp/tnftp_config.h user/gabor/tre-integration/usr.sbin/makefs/mtree.c - copied unchanged from r223450, head/usr.sbin/makefs/mtree.c Directory Properties: user/gabor/tre-integration/contrib/tnftp/ (props changed) Deleted: user/gabor/tre-integration/contrib/lukemftp/ user/gabor/tre-integration/sys/amd64/pci/pci_bus.c user/gabor/tre-integration/sys/i386/pci/pci_bus.c user/gabor/tre-integration/usr.bin/ftp/config.h Modified: user/gabor/tre-integration/bin/realpath/realpath.1 user/gabor/tre-integration/bin/realpath/realpath.c user/gabor/tre-integration/bin/sh/eval.c user/gabor/tre-integration/bin/sh/nodetypes user/gabor/tre-integration/bin/sh/options.h user/gabor/tre-integration/bin/sh/parser.c user/gabor/tre-integration/bin/sh/sh.1 user/gabor/tre-integration/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c user/gabor/tre-integration/contrib/dialog/dialog.h user/gabor/tre-integration/contrib/top/display.c user/gabor/tre-integration/contrib/top/top.h user/gabor/tre-integration/etc/defaults/rc.conf user/gabor/tre-integration/etc/rc.d/Makefile user/gabor/tre-integration/etc/rc.d/mountcritremote user/gabor/tre-integration/etc/rc.subr user/gabor/tre-integration/lib/libc/iconv/citrus_mapper.c user/gabor/tre-integration/lib/libc/iconv/iconv.c user/gabor/tre-integration/lib/libc/stdlib/malloc.c user/gabor/tre-integration/lib/libprocstat/libprocstat.c user/gabor/tre-integration/lib/libthr/thread/thr_init.c user/gabor/tre-integration/lib/msun/src/e_rem_pio2.c user/gabor/tre-integration/libexec/ftpd/ftpd.c user/gabor/tre-integration/libexec/tftpd/tftpd.8 user/gabor/tre-integration/libexec/ulog-helper/Makefile user/gabor/tre-integration/libexec/ulog-helper/ulog-helper.c user/gabor/tre-integration/sbin/ddb/ddb.8 user/gabor/tre-integration/sbin/geom/class/part/geom_part.c user/gabor/tre-integration/sbin/growfs/growfs.8 user/gabor/tre-integration/sbin/growfs/growfs.c user/gabor/tre-integration/sbin/ipfw/nat.c user/gabor/tre-integration/sbin/newfs/newfs.8 user/gabor/tre-integration/sbin/tunefs/tunefs.8 user/gabor/tre-integration/share/man/man5/rc.conf.5 user/gabor/tre-integration/sys/amd64/include/pci_cfgreg.h user/gabor/tre-integration/sys/boot/common/load_elf_obj.c user/gabor/tre-integration/sys/cam/ata/ata_da.c user/gabor/tre-integration/sys/cam/ata/ata_xpt.c user/gabor/tre-integration/sys/cam/scsi/scsi_xpt.c user/gabor/tre-integration/sys/conf/files.amd64 user/gabor/tre-integration/sys/conf/files.i386 user/gabor/tre-integration/sys/conf/files.pc98 user/gabor/tre-integration/sys/conf/files.powerpc user/gabor/tre-integration/sys/dev/acpica/acpi_cpu.c user/gabor/tre-integration/sys/dev/acpica/acpi_pcib_acpi.c user/gabor/tre-integration/sys/dev/acpica/acpi_resource.c user/gabor/tre-integration/sys/dev/acpica/acpivar.h user/gabor/tre-integration/sys/dev/atkbdc/atkbd.c user/gabor/tre-integration/sys/dev/cardbus/cardbus_cis.c user/gabor/tre-integration/sys/dev/dc/if_dc.c user/gabor/tre-integration/sys/dev/e1000/if_igb.c user/gabor/tre-integration/sys/dev/e1000/if_igb.h user/gabor/tre-integration/sys/dev/firewire/fwohci.c user/gabor/tre-integration/sys/dev/pccbb/pccbb_pci.c user/gabor/tre-integration/sys/dev/pci/pci.c user/gabor/tre-integration/sys/dev/usb/net/if_udav.c user/gabor/tre-integration/sys/dev/usb/usbdevs user/gabor/tre-integration/sys/dev/usb/wlan/if_urtw.c user/gabor/tre-integration/sys/dev/vr/if_vr.c user/gabor/tre-integration/sys/dev/vr/if_vrreg.h user/gabor/tre-integration/sys/dev/xl/if_xl.c user/gabor/tre-integration/sys/fs/nfs/nfs_commonkrpc.c user/gabor/tre-integration/sys/fs/nfs/nfsport.h user/gabor/tre-integration/sys/fs/nfs/nfsproto.h user/gabor/tre-integration/sys/fs/nfsclient/nfs_clbio.c user/gabor/tre-integration/sys/fs/nfsclient/nfs_clkrpc.c user/gabor/tre-integration/sys/fs/nfsclient/nfs_clnode.c user/gabor/tre-integration/sys/fs/nfsclient/nfs_clport.c user/gabor/tre-integration/sys/fs/nfsclient/nfs_clsubs.c user/gabor/tre-integration/sys/fs/nfsclient/nfs_clvnops.c user/gabor/tre-integration/sys/fs/nfsserver/nfs_nfsdcache.c user/gabor/tre-integration/sys/fs/nfsserver/nfs_nfsdkrpc.c user/gabor/tre-integration/sys/fs/nfsserver/nfs_nfsdserv.c user/gabor/tre-integration/sys/fs/nfsserver/nfs_nfsdsocket.c user/gabor/tre-integration/sys/geom/part/g_part_bsd.c user/gabor/tre-integration/sys/i386/include/param.h user/gabor/tre-integration/sys/i386/include/pci_cfgreg.h user/gabor/tre-integration/sys/ia64/conf/NOTES user/gabor/tre-integration/sys/kern/kern_clocksource.c user/gabor/tre-integration/sys/kgssapi/gss_impl.c user/gabor/tre-integration/sys/modules/Makefile user/gabor/tre-integration/sys/modules/dtrace/Makefile user/gabor/tre-integration/sys/modules/dtrace/dtraceall/dtraceall.c user/gabor/tre-integration/sys/modules/kgssapi_krb5/Makefile user/gabor/tre-integration/sys/net/route.c user/gabor/tre-integration/sys/net/route.h user/gabor/tre-integration/sys/net80211/ieee80211_ht.c user/gabor/tre-integration/sys/net80211/ieee80211_var.h user/gabor/tre-integration/sys/netinet/ipfw/ip_dn_io.c user/gabor/tre-integration/sys/netinet/ipfw/ip_fw_pfil.c user/gabor/tre-integration/sys/netinet/libalias/alias_db.c user/gabor/tre-integration/sys/netinet/libalias/alias_ftp.c user/gabor/tre-integration/sys/netinet/libalias/alias_local.h user/gabor/tre-integration/sys/netinet/libalias/libalias.3 user/gabor/tre-integration/sys/netinet/tcp_output.c user/gabor/tre-integration/sys/nfsclient/nfs_krpc.c user/gabor/tre-integration/sys/nfsserver/nfs_srvkrpc.c user/gabor/tre-integration/sys/powerpc/ps3/if_glc.c user/gabor/tre-integration/sys/powerpc/ps3/ps3bus.c user/gabor/tre-integration/sys/powerpc/ps3/ps3bus.h user/gabor/tre-integration/sys/rpc/rpc_generic.c user/gabor/tre-integration/sys/rpc/rpcsec_gss.h user/gabor/tre-integration/sys/sparc64/include/tsb.h user/gabor/tre-integration/sys/sparc64/include/vmparam.h user/gabor/tre-integration/sys/sparc64/sparc64/mp_machdep.c user/gabor/tre-integration/sys/sparc64/sparc64/pmap.c user/gabor/tre-integration/sys/sparc64/sparc64/tlb.c user/gabor/tre-integration/sys/sys/dtrace_bsd.h user/gabor/tre-integration/sys/sys/systm.h user/gabor/tre-integration/sys/ufs/ffs/ffs_alloc.c user/gabor/tre-integration/sys/ufs/ffs/ffs_extern.h user/gabor/tre-integration/sys/ufs/ffs/ffs_snapshot.c user/gabor/tre-integration/sys/ufs/ffs/ffs_softdep.c user/gabor/tre-integration/sys/vm/vm_fault.c user/gabor/tre-integration/sys/vm/vm_page.c user/gabor/tre-integration/sys/vm/vm_page.h user/gabor/tre-integration/sys/x86/x86/tsc.c user/gabor/tre-integration/usr.bin/cmp/regular.c user/gabor/tre-integration/usr.bin/cmp/special.c user/gabor/tre-integration/usr.bin/finger/net.c user/gabor/tre-integration/usr.bin/ftp/Makefile user/gabor/tre-integration/usr.bin/lastcomm/lastcomm.c user/gabor/tre-integration/usr.bin/lastcomm/readrec.c user/gabor/tre-integration/usr.bin/tftp/tftp.1 user/gabor/tre-integration/usr.sbin/makefs/Makefile user/gabor/tre-integration/usr.sbin/makefs/cd9660/cd9660_write.c user/gabor/tre-integration/usr.sbin/makefs/ffs.c user/gabor/tre-integration/usr.sbin/makefs/makefs.8 user/gabor/tre-integration/usr.sbin/makefs/makefs.c user/gabor/tre-integration/usr.sbin/makefs/makefs.h user/gabor/tre-integration/usr.sbin/mfiutil/mfi_config.c user/gabor/tre-integration/usr.sbin/mfiutil/mfi_drive.c user/gabor/tre-integration/usr.sbin/mfiutil/mfi_patrol.c user/gabor/tre-integration/usr.sbin/mfiutil/mfi_show.c user/gabor/tre-integration/usr.sbin/mfiutil/mfiutil.8 user/gabor/tre-integration/usr.sbin/mfiutil/mfiutil.c user/gabor/tre-integration/usr.sbin/mfiutil/mfiutil.h user/gabor/tre-integration/usr.sbin/nfsuserd/nfsuserd.c user/gabor/tre-integration/usr.sbin/ypserv/yp_main.c Directory Properties: user/gabor/tre-integration/ (props changed) user/gabor/tre-integration/cddl/contrib/opensolaris/ (props changed) user/gabor/tre-integration/contrib/bind9/ (props changed) user/gabor/tre-integration/contrib/binutils/ (props changed) user/gabor/tre-integration/contrib/bzip2/ (props changed) user/gabor/tre-integration/contrib/compiler-rt/ (props changed) user/gabor/tre-integration/contrib/dialog/ (props changed) user/gabor/tre-integration/contrib/ee/ (props changed) user/gabor/tre-integration/contrib/expat/ (props changed) user/gabor/tre-integration/contrib/file/ (props changed) user/gabor/tre-integration/contrib/gcc/ (props changed) user/gabor/tre-integration/contrib/gdb/ (props changed) user/gabor/tre-integration/contrib/gdtoa/ (props changed) user/gabor/tre-integration/contrib/gnu-sort/ (props changed) user/gabor/tre-integration/contrib/groff/ (props changed) user/gabor/tre-integration/contrib/less/ (props changed) user/gabor/tre-integration/contrib/libpcap/ (props changed) user/gabor/tre-integration/contrib/libstdc++/ (props changed) user/gabor/tre-integration/contrib/llvm/ (props changed) user/gabor/tre-integration/contrib/llvm/tools/clang/ (props changed) user/gabor/tre-integration/contrib/ncurses/ (props changed) user/gabor/tre-integration/contrib/netcat/ (props changed) user/gabor/tre-integration/contrib/ntp/ (props changed) user/gabor/tre-integration/contrib/one-true-awk/ (props changed) user/gabor/tre-integration/contrib/openbsm/ (props changed) user/gabor/tre-integration/contrib/openpam/ (props changed) user/gabor/tre-integration/contrib/pf/ (props changed) user/gabor/tre-integration/contrib/sendmail/ (props changed) user/gabor/tre-integration/contrib/tcpdump/ (props changed) user/gabor/tre-integration/contrib/tcsh/ (props changed) user/gabor/tre-integration/contrib/top/ (props changed) user/gabor/tre-integration/contrib/top/install-sh (props changed) user/gabor/tre-integration/contrib/tzcode/stdtime/ (props changed) user/gabor/tre-integration/contrib/tzcode/zic/ (props changed) user/gabor/tre-integration/contrib/tzdata/ (props changed) user/gabor/tre-integration/contrib/wpa/ (props changed) user/gabor/tre-integration/contrib/xz/ (props changed) user/gabor/tre-integration/crypto/openssh/ (props changed) user/gabor/tre-integration/crypto/openssl/ (props changed) user/gabor/tre-integration/gnu/lib/ (props changed) user/gabor/tre-integration/gnu/usr.bin/binutils/ (props changed) user/gabor/tre-integration/gnu/usr.bin/cc/cc_tools/ (props changed) user/gabor/tre-integration/gnu/usr.bin/gdb/ (props changed) user/gabor/tre-integration/lib/libc/ (props changed) user/gabor/tre-integration/lib/libc/stdtime/ (props changed) user/gabor/tre-integration/lib/libutil/ (props changed) user/gabor/tre-integration/lib/libz/ (props changed) user/gabor/tre-integration/sbin/ (props changed) user/gabor/tre-integration/sbin/ipfw/ (props changed) user/gabor/tre-integration/share/mk/bsd.arch.inc.mk (props changed) user/gabor/tre-integration/share/zoneinfo/ (props changed) user/gabor/tre-integration/sys/ (props changed) user/gabor/tre-integration/sys/amd64/include/xen/ (props changed) user/gabor/tre-integration/sys/boot/ (props changed) user/gabor/tre-integration/sys/boot/i386/efi/ (props changed) user/gabor/tre-integration/sys/boot/ia64/efi/ (props changed) user/gabor/tre-integration/sys/boot/ia64/ski/ (props changed) user/gabor/tre-integration/sys/boot/powerpc/boot1.chrp/ (props changed) user/gabor/tre-integration/sys/boot/powerpc/ofw/ (props changed) user/gabor/tre-integration/sys/cddl/contrib/opensolaris/ (props changed) user/gabor/tre-integration/sys/conf/ (props changed) user/gabor/tre-integration/sys/contrib/dev/acpica/ (props changed) user/gabor/tre-integration/sys/contrib/octeon-sdk/ (props changed) user/gabor/tre-integration/sys/contrib/pf/ (props changed) user/gabor/tre-integration/sys/contrib/x86emu/ (props changed) user/gabor/tre-integration/usr.bin/calendar/ (props changed) user/gabor/tre-integration/usr.bin/csup/ (props changed) user/gabor/tre-integration/usr.bin/procstat/ (props changed) user/gabor/tre-integration/usr.sbin/ndiscvt/ (props changed) user/gabor/tre-integration/usr.sbin/zic/ (props changed) Modified: user/gabor/tre-integration/bin/realpath/realpath.1 ============================================================================== --- user/gabor/tre-integration/bin/realpath/realpath.1 Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/bin/realpath/realpath.1 Wed Jun 22 23:36:01 2011 (r223452) @@ -33,7 +33,7 @@ .\" From: src/bin/pwd/pwd.1,v 1.11 2000/11/20 11:39:39 ru Exp .\" $FreeBSD$ .\" -.Dd November 24, 2000 +.Dd June 21, 2011 .Dt REALPATH 1 .Os .Sh NAME @@ -42,8 +42,7 @@ .Sh SYNOPSIS .Nm .Op Fl q -.Ar path -.Op Ar ... +.Op Ar path ... .Sh DESCRIPTION The .Nm @@ -57,6 +56,11 @@ and .Pa /../ in .Ar path . +If +.Ar path +is absent, the current working directory +.Pq Sq Pa .\& +is assumed. .Pp If .Fl q Modified: user/gabor/tre-integration/bin/realpath/realpath.c ============================================================================== --- user/gabor/tre-integration/bin/realpath/realpath.c Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/bin/realpath/realpath.c Wed Jun 22 23:36:01 2011 (r223452) @@ -44,7 +44,8 @@ main(int argc, char *argv[]) { char buf[PATH_MAX]; char *p; - int ch, i, qflag, rval; + const char *path; + int ch, qflag, rval; qflag = 0; while ((ch = getopt(argc, argv, "q")) != -1) { @@ -59,17 +60,16 @@ main(int argc, char *argv[]) } argc -= optind; argv += optind; - if (argc < 1) - usage(); + path = *argv != NULL ? *argv++ : "."; rval = 0; - for (i = 0; i < argc; i++) { - if ((p = realpath(argv[i], buf)) == NULL) { + do { + if ((p = realpath(path, buf)) == NULL) { if (!qflag) - warn("%s", argv[i]); + warn("%s", path); rval = 1; } else (void)printf("%s\n", p); - } + } while ((path = *argv++) != NULL); exit(rval); } @@ -77,6 +77,6 @@ static void usage(void) { - (void)fprintf(stderr, "usage: realpath [-q] path [...]\n"); + (void)fprintf(stderr, "usage: realpath [-q] [path ...]\n"); exit(1); } Modified: user/gabor/tre-integration/bin/sh/eval.c ============================================================================== --- user/gabor/tre-integration/bin/sh/eval.c Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/bin/sh/eval.c Wed Jun 22 23:36:01 2011 (r223452) @@ -894,14 +894,13 @@ evalcommand(union node *cmd, int flags, } /* Fork off a child process if necessary. */ - if (cmd->ncmd.backgnd - || ((cmdentry.cmdtype == CMDNORMAL || cmdentry.cmdtype == CMDUNKNOWN) + if (((cmdentry.cmdtype == CMDNORMAL || cmdentry.cmdtype == CMDUNKNOWN) && ((flags & EV_EXIT) == 0 || have_traps())) || ((flags & EV_BACKCMD) != 0 && (cmdentry.cmdtype != CMDBUILTIN || !safe_builtin(cmdentry.u.index, argc, argv)))) { jp = makejob(cmd, 1); - mode = cmd->ncmd.backgnd; + mode = FORK_FG; if (flags & EV_BACKCMD) { mode = FORK_NOJOB; if (pipe(pip) < 0) @@ -1068,8 +1067,7 @@ parent: /* parent process gets here (if backcmd->fd = pip[0]; close(pip[1]); backcmd->jp = jp; - } else - exitstatus = 0; + } out: if (lastarg) Modified: user/gabor/tre-integration/bin/sh/nodetypes ============================================================================== --- user/gabor/tre-integration/bin/sh/nodetypes Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/bin/sh/nodetypes Wed Jun 22 23:36:01 2011 (r223452) @@ -56,7 +56,6 @@ NSEMI nbinary # two commands separated NCMD ncmd # a simple command type int - backgnd int # set to run command in background args nodeptr # the arguments redirect nodeptr # list of file redirections Modified: user/gabor/tre-integration/bin/sh/options.h ============================================================================== --- user/gabor/tre-integration/bin/sh/options.h Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/bin/sh/options.h Wed Jun 22 23:36:01 2011 (r223452) @@ -62,8 +62,9 @@ struct shparam { #define privileged optlist[15].val #define Tflag optlist[16].val #define Pflag optlist[17].val +#define hflag optlist[18].val -#define NOPTS 18 +#define NOPTS 19 struct optent { const char *name; @@ -91,6 +92,7 @@ struct optent optlist[NOPTS] = { { "privileged", 'p', 0 }, { "trapsasync", 'T', 0 }, { "physical", 'P', 0 }, + { "trackall", 'h', 0 }, }; #else extern struct optent optlist[NOPTS]; Modified: user/gabor/tre-integration/bin/sh/parser.c ============================================================================== --- user/gabor/tre-integration/bin/sh/parser.c Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/bin/sh/parser.c Wed Jun 22 23:36:01 2011 (r223452) @@ -240,8 +240,8 @@ list(int nlflag, int erflag) n2 = andor(); tok = readtoken(); if (tok == TBACKGND) { - if (n2->type == NCMD || n2->type == NPIPE) { - n2->ncmd.backgnd = 1; + if (n2->type == NPIPE) { + n2->npipe.backgnd = 1; } else if (n2->type == NREDIR) { n2->type = NBACKGND; } else { @@ -689,7 +689,6 @@ simplecmd(union node **rpp, union node * *rpp = NULL; n = (union node *)stalloc(sizeof (struct ncmd)); n->type = NCMD; - n->ncmd.backgnd = 0; n->ncmd.args = args; n->ncmd.redirect = redir; return n; Modified: user/gabor/tre-integration/bin/sh/sh.1 ============================================================================== --- user/gabor/tre-integration/bin/sh/sh.1 Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/bin/sh/sh.1 Wed Jun 22 23:36:01 2011 (r223452) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd June 17, 2011 +.Dd June 18, 2011 .Dt SH 1 .Os .Sh NAME @@ -241,6 +241,10 @@ tested, all commands of the function are well. .It Fl f Li noglob Disable pathname expansion. +.It Fl h Li trackall +A do-nothing option for +.Tn POSIX +compliance. .It Fl I Li ignoreeof Ignore .Dv EOF Ap s Modified: user/gabor/tre-integration/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c ============================================================================== --- user/gabor/tre-integration/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Wed Jun 22 23:36:01 2011 (r223452) @@ -828,7 +828,7 @@ dt_popc(ulong_t x) x = x + (x >> 32); return (x & 0x7F); #else -# warning need td_popc() implementation +/* This should be a #warning but for now ignore error. Err: "need td_popc() implementation" */ #endif } Modified: user/gabor/tre-integration/contrib/dialog/dialog.h ============================================================================== --- user/gabor/tre-integration/contrib/dialog/dialog.h Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/contrib/dialog/dialog.h Wed Jun 22 23:36:01 2011 (r223452) @@ -1,5 +1,5 @@ /* - * $Id: dialog.h,v 1.223 2011/03/02 10:04:09 tom Exp $ + * $Id: dialog.h,v 1.224 2011/06/13 14:29:42 tom Exp $ * * dialog.h -- common declarations for all dialog modules * @@ -44,7 +44,10 @@ #include /* fork() etc. */ #include /* sqrt() */ -#undef ERR /* header conflict with Solaris xpg4 */ +/* header conflict with Solaris xpg4 versus */ +#if defined(ERR) && (ERR == 13) +#undef ERR +#endif #if defined(HAVE_NCURSESW_NCURSES_H) #include Modified: user/gabor/tre-integration/contrib/top/display.c ============================================================================== --- user/gabor/tre-integration/contrib/top/display.c Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/contrib/top/display.c Wed Jun 22 23:36:01 2011 (r223452) @@ -698,7 +698,7 @@ char *text; int width; s = NULL; - width = screen_width; + width = display_width; header_length = strlen(text); if (header_length >= width) { s = malloc((width + 1) * sizeof(char)); @@ -706,14 +706,6 @@ char *text; return (NULL); strncpy(s, text, width); s[width] = '\0'; - } else { - s = malloc((width + 1) * sizeof(char)); - if (s == NULL) - return (NULL); - strncpy(s, text, width); - while (screen_width > header_length) - s[header_length++] = ' '; - s[width] = '\0'; } return (s); } @@ -738,7 +730,7 @@ char *text; if (header_status == ON) { putchar('\n'); - standout(text, stdout); + fputs(text, stdout); lastline++; } else if (header_status == ERASE) Modified: user/gabor/tre-integration/contrib/top/top.h ============================================================================== --- user/gabor/tre-integration/contrib/top/top.h Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/contrib/top/top.h Wed Jun 22 23:36:01 2011 (r223452) @@ -14,7 +14,7 @@ extern int Header_lines; /* 7 */ /* Maximum number of columns allowed for display */ -#define MAX_COLS 512 +#define MAX_COLS 128 /* Log base 2 of 1024 is 10 (2^10 == 1024) */ #define LOG1024 10 Modified: user/gabor/tre-integration/etc/defaults/rc.conf ============================================================================== --- user/gabor/tre-integration/etc/defaults/rc.conf Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/etc/defaults/rc.conf Wed Jun 22 23:36:01 2011 (r223452) @@ -444,6 +444,13 @@ ubthidhci_enable="NO" # Switch an USB B #ubthidhci_addr="2" # Check usbconfig list to find the correct # numbers for your system. +### Network link/usability verification options +netwait_enable="NO" # Enable rc.d/netwait (or NO) +#netwait_ip="" # IP addresses to be pinged by netwait. +netwait_timeout="60" # Total number of seconds to perform pings. +#netwait_if="" # Interface name to watch link state on. +netwait_if_timeout="30" # Total number of seconds to monitor link state. + ### Miscellaneous network options: ### icmp_bmcastecho="NO" # respond to broadcast ping packets Modified: user/gabor/tre-integration/etc/rc.d/Makefile ============================================================================== --- user/gabor/tre-integration/etc/rc.d/Makefile Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/etc/rc.d/Makefile Wed Jun 22 23:36:01 2011 (r223452) @@ -22,7 +22,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI ldconfig local localpkg lockd lpd \ mixer motd mountcritlocal mountcritremote mountlate \ mdconfig mdconfig2 mountd moused mroute6d mrouted msgs \ - named natd netif netoptions \ + named natd netif netoptions netwait \ newsyslog nfsclient nfscbd nfsd \ nfsserver nfsuserd nisdomain nsswitch ntpd ntpdate \ othermta \ Modified: user/gabor/tre-integration/etc/rc.d/mountcritremote ============================================================================== --- user/gabor/tre-integration/etc/rc.d/mountcritremote Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/etc/rc.d/mountcritremote Wed Jun 22 23:36:01 2011 (r223452) @@ -4,7 +4,7 @@ # # PROVIDE: mountcritremote -# REQUIRE: NETWORKING FILESYSTEMS cleanvar ipsec +# REQUIRE: NETWORKING FILESYSTEMS cleanvar ipsec netwait # KEYWORD: nojail . /etc/rc.subr Copied: user/gabor/tre-integration/etc/rc.d/netwait (from r223450, head/etc/rc.d/netwait) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gabor/tre-integration/etc/rc.d/netwait Wed Jun 22 23:36:01 2011 (r223452, copy of r223450, head/etc/rc.d/netwait) @@ -0,0 +1,98 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: netwait +# REQUIRE: NETWORKING +# KEYWORD: nojail +# +# The netwait script is intended to be used by systems which have +# statically-configured IP addresses in rc.conf(5). If your system +# uses DHCP, you should use synchronous_dhclient="YES" in your +# /etc/rc.conf instead of using netwait. + +. /etc/rc.subr + +name="netwait" +rcvar=`set_rcvar` + +start_cmd="${name}_start" +stop_cmd=":" + +netwait_start() +{ + local ip rc count output link + + if [ -z "${netwait_ip}" ]; then + err 1 "You must define one or more IP addresses in netwait_ip" + fi + + if [ ${netwait_timeout} -lt 1 ]; then + err 1 "netwait_timeout must be >= 1" + fi + + # Handle SIGINT (Ctrl-C); force abort of while() loop + trap break SIGINT + + if [ -n "${netwait_if}" ]; then + echo -n "Waiting for $netwait_if to have link" + + count=1 + while [ ${count} -le ${netwait_if_timeout} ]; do + if output=`/sbin/ifconfig ${netwait_if} 2>/dev/null`; then + link=`expr "${output}" : '.*[[:blank:]]status: \(no carrier\)'` + if [ -z "${link}" ]; then + echo '.' + break + fi + else + echo '' + err 1 "ifconfig ${netwait_if} failed" + fi + sleep 1 + count=$((count+1)) + done + if [ -n "${link}" ]; then + # Restore default SIGINT handler + trap - SIGINT + + echo '' + warn "Interface still has no link. Continuing with startup, but" + warn "be aware you may not have a fully functional networking" + warn "layer at this point." + return + fi + fi + + # Handle SIGINT (Ctrl-C); force abort of while() loop + trap break SIGINT + + for ip in ${netwait_ip}; do + echo -n "Waiting for ${ip} to respond to ICMP" + + count=1 + while [ ${count} -le ${netwait_timeout} ]; do + /sbin/ping -t 1 -c 1 -o ${ip} >/dev/null 2>&1 + rc=$? + + if [ $rc -eq 0 ]; then + # Restore default SIGINT handler + trap - SIGINT + + echo '.' + return + fi + count=$((count+1)) + done + echo ': No response from host.' + done + + # Restore default SIGINT handler + trap - SIGINT + + warn "Exhausted IP list. Continuing with startup, but be aware you may" + warn "not have a fully functional networking layer at this point." +} + +load_rc_config $name +run_rc_command "$1" Modified: user/gabor/tre-integration/etc/rc.subr ============================================================================== --- user/gabor/tre-integration/etc/rc.subr Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/etc/rc.subr Wed Jun 22 23:36:01 2011 (r223452) @@ -1732,8 +1732,6 @@ check_required_after() return 0 } -fi - # check_kern_features mib # Return existence of kern.features.* sysctl MIB as true or # false. The result will be cached in $_rc_cache_kern_features_ @@ -1744,7 +1742,7 @@ check_kern_features() local _v [ -n "$1" ] || return 1; - _v=`eval echo "\\$_rc_cache_kern_features_$1"` + eval _v=\$_rc_cache_kern_features_$1 [ -n "$_v" ] && return "$_v"; if ${SYSCTL_N} kern.features.$1 > /dev/null 2>&1; then @@ -1775,4 +1773,6 @@ _echoonce() esac } +fi # [ -z "${_rc_subr_loaded}" ] + _rc_subr_loaded=: Modified: user/gabor/tre-integration/lib/libc/iconv/citrus_mapper.c ============================================================================== --- user/gabor/tre-integration/lib/libc/iconv/citrus_mapper.c Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/lib/libc/iconv/citrus_mapper.c Wed Jun 22 23:36:01 2011 (r223452) @@ -337,7 +337,9 @@ _citrus_mapper_open(struct _citrus_mappe goto quit; /* open mapper */ + UNLOCK; ret = mapper_open(ma, &cm, module, variable); + WLOCK; if (ret) goto quit; cm->cm_key = strdup(mapname); Modified: user/gabor/tre-integration/lib/libc/iconv/iconv.c ============================================================================== --- user/gabor/tre-integration/lib/libc/iconv/iconv.c Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/lib/libc/iconv/iconv.c Wed Jun 22 23:36:01 2011 (r223452) @@ -85,7 +85,7 @@ _iconv_open(const char *out, const char errno = ENOMEM; return ((iconv_t)-1); } - + p = out_truncated; while (*p != 0) { if (p[0] == '/' && p[1] == '/') { Modified: user/gabor/tre-integration/lib/libc/stdlib/malloc.c ============================================================================== --- user/gabor/tre-integration/lib/libc/stdlib/malloc.c Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/lib/libc/stdlib/malloc.c Wed Jun 22 23:36:01 2011 (r223452) @@ -234,7 +234,7 @@ __FBSDID("$FreeBSD$"); #ifdef __sparc64__ # define LG_QUANTUM 4 # define LG_SIZEOF_PTR 3 -# define TLS_MODEL /* default */ +# define TLS_MODEL __attribute__((tls_model("initial-exec"))) #endif #ifdef __amd64__ # define LG_QUANTUM 4 Modified: user/gabor/tre-integration/lib/libprocstat/libprocstat.c ============================================================================== --- user/gabor/tre-integration/lib/libprocstat/libprocstat.c Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/lib/libprocstat/libprocstat.c Wed Jun 22 23:36:01 2011 (r223452) @@ -191,7 +191,7 @@ procstat_getprocs(struct procstat *procs len = *count * sizeof(*p); p = malloc(len); if (p == NULL) { - warnx("malloc(%zd)", len); + warnx("malloc(%zu)", len); goto fail; } bcopy(p0, p, len); @@ -213,7 +213,7 @@ procstat_getprocs(struct procstat *procs } p = malloc(len); if (p == NULL) { - warnx("malloc(%zd)", len); + warnx("malloc(%zu)", len); goto fail; } error = sysctl(name, 4, p, &len, NULL, 0); @@ -229,7 +229,7 @@ procstat_getprocs(struct procstat *procs *count = len / sizeof(*p); return (p); } else { - warnx("unknown access method"); + warnx("unknown access method: %d", procstat->type); return (NULL); } fail: @@ -271,11 +271,11 @@ procstat_freefiles(struct procstat *proc } free(head); if (procstat->vmentries != NULL) { - free (procstat->vmentries); + free(procstat->vmentries); procstat->vmentries = NULL; } if (procstat->files != NULL) { - free (procstat->files); + free(procstat->files); procstat->files = NULL; } } @@ -426,7 +426,7 @@ procstat_getfiles_kvm(struct procstat *p nfiles = filed.fd_lastfile + 1; ofiles = malloc(nfiles * sizeof(struct file *)); if (ofiles == NULL) { - warn("malloc(%zd)", nfiles * sizeof(struct file *)); + warn("malloc(%zu)", nfiles * sizeof(struct file *)); goto do_mmapped; } if (!kvm_read_all(kd, (unsigned long)filed.fd_ofiles, ofiles, @@ -522,7 +522,8 @@ do_mmapped: fflags = 0; if (prot & VM_PROT_READ) fflags = PS_FST_FFLAG_READ; - if (prot & VM_PROT_WRITE) + if ((vmentry.eflags & MAP_ENTRY_COW) == 0 && + prot & VM_PROT_WRITE) fflags |= PS_FST_FFLAG_WRITE; /* @@ -696,7 +697,8 @@ procstat_getfiles_sysctl(struct procstat fflags = 0; if (kve->kve_protection & KVME_PROT_READ) fflags = PS_FST_FFLAG_READ; - if (kve->kve_protection & KVME_PROT_WRITE) + if ((kve->kve_flags & KVME_FLAG_COW) == 0 && + kve->kve_protection & KVME_PROT_WRITE) fflags |= PS_FST_FFLAG_WRITE; offset = kve->kve_offset; refcount = kve->kve_ref_count; @@ -726,7 +728,7 @@ procstat_get_pipe_info(struct procstat * } else if (procstat->type == PROCSTAT_SYSCTL) { return (procstat_get_pipe_info_sysctl(fst, ps, errbuf)); } else { - warnx("unknow access method: %d", procstat->type); + warnx("unknown access method: %d", procstat->type); snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } @@ -790,7 +792,7 @@ procstat_get_pts_info(struct procstat *p } else if (procstat->type == PROCSTAT_SYSCTL) { return (procstat_get_pts_info_sysctl(fst, pts, errbuf)); } else { - warnx("unknow access method: %d", procstat->type); + warnx("unknown access method: %d", procstat->type); snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } @@ -852,7 +854,7 @@ procstat_get_vnode_info(struct procstat } else if (procstat->type == PROCSTAT_SYSCTL) { return (procstat_get_vnode_info_sysctl(fst, vn, errbuf)); } else { - warnx("unknow access method: %d", procstat->type); + warnx("unknown access method: %d", procstat->type); snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } @@ -1059,7 +1061,7 @@ procstat_get_socket_info(struct procstat } else if (procstat->type == PROCSTAT_SYSCTL) { return (procstat_get_socket_info_sysctl(fst, sock, errbuf)); } else { - warnx("unknow access method: %d", procstat->type); + warnx("unknown access method: %d", procstat->type); snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } Modified: user/gabor/tre-integration/lib/libthr/thread/thr_init.c ============================================================================== --- user/gabor/tre-integration/lib/libthr/thread/thr_init.c Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/lib/libthr/thread/thr_init.c Wed Jun 22 23:36:01 2011 (r223452) @@ -409,7 +409,6 @@ init_main_thread(struct pthread *thread) thread->cancel_enable = 1; thread->cancel_async = 0; - thr_set_name(thread->tid, "initial thread"); /* Initialize the mutex queue: */ TAILQ_INIT(&thread->mutexq); Modified: user/gabor/tre-integration/lib/msun/src/e_rem_pio2.c ============================================================================== --- user/gabor/tre-integration/lib/msun/src/e_rem_pio2.c Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/lib/msun/src/e_rem_pio2.c Wed Jun 22 23:36:01 2011 (r223452) @@ -171,9 +171,8 @@ medium: } /* set z = scalbn(|x|,ilogb(x)-23) */ GET_LOW_WORD(low,x); - SET_LOW_WORD(z,low); e0 = (ix>>20)-1046; /* e0 = ilogb(z)-23; */ - SET_HIGH_WORD(z, ix - ((int32_t)(e0<<20))); + INSERT_WORDS(z, ix - ((int32_t)(e0<<20)), low); for(i=0;i<2;i++) { tx[i] = (double)((int32_t)(z)); z = (z-tx[i])*two24; Modified: user/gabor/tre-integration/libexec/ftpd/ftpd.c ============================================================================== --- user/gabor/tre-integration/libexec/ftpd/ftpd.c Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/libexec/ftpd/ftpd.c Wed Jun 22 23:36:01 2011 (r223452) @@ -1191,9 +1191,9 @@ end_login(void) ftpd_logwtmp(wtmpid, NULL, NULL); pw = NULL; #ifdef LOGIN_CAP - setusercontext(NULL, getpwuid(0), 0, - LOGIN_SETPRIORITY|LOGIN_SETRESOURCES|LOGIN_SETUMASK| - LOGIN_SETMAC); + setusercontext(NULL, getpwuid(0), 0, LOGIN_SETALL & ~(LOGIN_SETLOGIN | + LOGIN_SETUSER | LOGIN_SETGROUP | LOGIN_SETPATH | + LOGIN_SETENV)); #endif #ifdef USE_PAM if (pamh) { @@ -1465,9 +1465,8 @@ skip: return; } } - setusercontext(lc, pw, 0, - LOGIN_SETLOGIN|LOGIN_SETGROUP|LOGIN_SETPRIORITY| - LOGIN_SETRESOURCES|LOGIN_SETUMASK|LOGIN_SETMAC); + setusercontext(lc, pw, 0, LOGIN_SETALL & + ~(LOGIN_SETUSER | LOGIN_SETPATH | LOGIN_SETENV)); #else setlogin(pw->pw_name); (void) initgroups(pw->pw_name, pw->pw_gid); Modified: user/gabor/tre-integration/libexec/tftpd/tftpd.8 ============================================================================== --- user/gabor/tre-integration/libexec/tftpd/tftpd.8 Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/libexec/tftpd/tftpd.8 Wed Jun 22 23:36:01 2011 (r223452) @@ -32,7 +32,7 @@ .\" @(#)tftpd.8 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 14, 2000 +.Dd June 22, 2011 .Dt TFTPD 8 .Os .Sh NAME @@ -150,9 +150,27 @@ compatible format string for the creatio .Fl W is specified. By default the string "%Y%m%d" is used. -.It Fl d +.It Fl d, d Ar [value] Enables debug output. -If specified twice, it will log DATA and ACK packets too. +If +.Ar value +is not specified, then the debug level is increased by one +for each instance of +.Fl d +which is specified. +.Pp +If +.Ar value +is specified, then the debug level is set to +.Ar value . +The debug level is a bitmask implemented in +.Pa src/libexec/tftpd/tftp-utils.h . +Valid values are 0 (DEBUG_NONE), 1 (DEBUG_PACKETS), 2, (DEBUG_SIMPLE), +4 (DEBUG_OPTIONS), and 8 (DEBUG_ACCESS). Multiple debug values can be combined +in the bitmask by logically OR'ing the values. For example, specifying +.Fl d +.Ar 15 +will enable all the debug values. .It Fl l Log all requests using .Xr syslog 3 @@ -217,12 +235,34 @@ option. .Xr services 5 , .Xr syslog.conf 5 , .Xr inetd 8 +.Pp +The following RFC's are supported: .Rs -.%A K. R. Sollins +RFC 1350 .%T The TFTP Protocol (Revision 2) -.%D July 1992 -.%O RFC 1350, STD 33 .Re +.Rs +RFC 2347 +.%T TFTP Option Extension +.Re +.Rs +RFC 2348 +.%T TFTP Blocksize Option +.Re +.Rs +RFC 2349 +.%T TFTP Timeout Interval and Transfer Size Options +.Re +.Pp +The non-standard +.Cm rollover +and +.Cm blksize2 +TFTP options are mentioned here: +.Rs +.%T Extending TFTP +.%U http://www.compuphase.com/tftp.htm +.Re .Sh HISTORY The .Nm @@ -255,7 +295,7 @@ was introduced in .Fx 7.4 . .Sh NOTES Files larger than 33488896 octets (65535 blocks) cannot be transferred -without client and server supporting the the TFTP blocksize option (RFC2348), +without client and server supporting the TFTP blocksize option (RFC2348), or the non-standard TFTP rollover option. .Pp Many tftp clients will not transfer files over 16744448 octets (32767 blocks). Modified: user/gabor/tre-integration/libexec/ulog-helper/Makefile ============================================================================== --- user/gabor/tre-integration/libexec/ulog-helper/Makefile Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/libexec/ulog-helper/Makefile Wed Jun 22 23:36:01 2011 (r223452) @@ -5,7 +5,7 @@ BINOWN= root BINMODE=4555 NO_MAN= -DPADD= ${LIBULOG} ${LIBMD} -LDADD= -lulog -lmd +DPADD= ${LIBULOG} +LDADD= -lulog .include Modified: user/gabor/tre-integration/libexec/ulog-helper/ulog-helper.c ============================================================================== --- user/gabor/tre-integration/libexec/ulog-helper/ulog-helper.c Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/libexec/ulog-helper/ulog-helper.c Wed Jun 22 23:36:01 2011 (r223452) @@ -36,11 +36,11 @@ __FBSDID("$FreeBSD$"); /* * This setuid helper utility writes user login records to disk. - * Unprivileged processes are not capable of writing records to utmp, - * wtmp and lastlog, but we do want to allow this for pseudo-terminals. - * Because a file descriptor to a pseudo-terminal master device can only - * be obtained by processes using the pseudo-terminal, we expect such a - * descriptor on stdin. + * Unprivileged processes are not capable of writing records to utmpx, + * but we do want to allow this for pseudo-terminals. Because a file + * descriptor to a pseudo-terminal master device can only be obtained by + * processes using the pseudo-terminal, we expect such a descriptor on + * stdin. * * It uses the real user ID of the calling process to determine the * username. It does allow users to log arbitrary hostnames. @@ -49,26 +49,22 @@ __FBSDID("$FreeBSD$"); int main(int argc, char *argv[]) { - const char *line; + const char *line, *user, *host; /* Device line name. */ if ((line = ptsname(STDIN_FILENO)) == NULL) return (EX_USAGE); if ((argc == 2 || argc == 3) && strcmp(argv[1], "login") == 0) { - struct passwd *pwd; - const char *host = NULL; - /* Username. */ - pwd = getpwuid(getuid()); - if (pwd == NULL) + user = user_from_uid(getuid(), 1); + if (user == NULL) return (EX_OSERR); /* Hostname. */ - if (argc == 3) - host = argv[2]; + host = argc == 3 ? argv[2] : NULL; - ulog_login(line, pwd->pw_name, host); + ulog_login(line, user, host); return (EX_OK); } else if (argc == 2 && strcmp(argv[1], "logout") == 0) { ulog_logout(line); Modified: user/gabor/tre-integration/sbin/ddb/ddb.8 ============================================================================== --- user/gabor/tre-integration/sbin/ddb/ddb.8 Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/sbin/ddb/ddb.8 Wed Jun 22 23:36:01 2011 (r223452) @@ -126,7 +126,7 @@ it is advisable to enclose in quotes. .It Cm scripts List currently defined scripts. -.It Cm unset Ar scriptname +.It Cm unscript Ar scriptname Delete the script named .Ar scriptname . .El Modified: user/gabor/tre-integration/sbin/geom/class/part/geom_part.c ============================================================================== --- user/gabor/tre-integration/sbin/geom/class/part/geom_part.c Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/sbin/geom/class/part/geom_part.c Wed Jun 22 23:36:01 2011 (r223452) @@ -362,7 +362,7 @@ gpart_autofill_resize(struct gctl_req *r goto done; } - offset = pp->lg_stripeoffset / pp->lg_sectorsize; + offset = (pp->lg_stripeoffset / pp->lg_sectorsize) % alignment; last = (off_t)strtoimax(find_geomcfg(gp, "last"), NULL, 0); LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { s = find_provcfg(pp, "index"); @@ -497,10 +497,10 @@ gpart_autofill(struct gctl_req *req) alignment = len; /* Adjust parameters to stripeoffset */ - offset = pp->lg_stripeoffset / pp->lg_sectorsize; + offset = (pp->lg_stripeoffset / pp->lg_sectorsize) % alignment; start = ALIGNUP(start + offset, alignment); - if (size + offset > alignment) - size = ALIGNDOWN(size + offset, alignment); + if (size > alignment) + size = ALIGNDOWN(size, alignment); first = (off_t)strtoimax(find_geomcfg(gp, "first"), NULL, 0); last = (off_t)strtoimax(find_geomcfg(gp, "last"), NULL, 0); @@ -1208,8 +1208,11 @@ gpart_bootcode(struct gctl_req *req, uns if (idx == 0) errx(EXIT_FAILURE, "missing -i option"); gpart_write_partcode(gp, idx, partcode, partsize); - } else + } else { + if (partsize != VTOC_BOOTSIZE) + errx(EXIT_FAILURE, "invalid bootcode"); gpart_write_partcode_vtoc8(gp, idx, partcode); + } } else if (bootcode == NULL) errx(EXIT_FAILURE, "no -b nor -p"); Modified: user/gabor/tre-integration/sbin/growfs/growfs.8 ============================================================================== --- user/gabor/tre-integration/sbin/growfs/growfs.8 Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/sbin/growfs/growfs.8 Wed Jun 22 23:36:01 2011 (r223452) @@ -37,12 +37,12 @@ .\" $TSHeader: src/sbin/growfs/growfs.8,v 1.3 2000/12/12 19:31:00 tomsoft Exp $ .\" $FreeBSD$ .\" -.Dd May 8, 2011 +.Dd June 22, 2011 .Dt GROWFS 8 .Os .Sh NAME .Nm growfs -.Nd grow size of an existing UFS file system +.Nd expand an existing UFS filesystem .Sh SYNOPSIS .Nm .Op Fl Ny @@ -58,26 +58,26 @@ Before starting .Nm the disk must be labeled to a bigger size using .Xr bsdlabel 8 . -If you wish to grow a file system beyond the boundary of -the slice it resides in, you must re-size the slice using -.Xr fdisk 8 +If you wish to grow a filesystem beyond the boundary of +the slice it resides in, you must resize the slice using +.Xr gpart 8 before running .Nm . If you are using volumes you must enlarge them by using -.Xr vinum 8 . +.Xr gvinum 8 . The .Nm -utility extends the size of the file system on the specified special file. +utility extends the size of the filesystem on the specified special file. Currently .Nm -can only enlarge unmounted file systems. -Do not try enlarging a mounted file system, your system may panic and you will -not be able to use the file system any longer. +can only enlarge unmounted filesystems. +Do not try enlarging a mounted filesystem, your system may panic and you will +not be able to use the filesystem any longer. Most of the .Xr newfs 8 options cannot be changed by .Nm . -In fact, you can only increase the size of the file system. +In fact, you can only increase the size of the filesystem. Use .Xr tunefs 8 for other changes. @@ -86,8 +86,8 @@ The following options are available: .Bl -tag -width indent .It Fl N .Dq Test mode . -Causes the new file system parameters to be printed out without actually -enlarging the file system. +Causes the new filesystem parameters to be printed out without actually +enlarging the filesystem. .It Fl y .Dq Expert mode . Usually @@ -102,12 +102,12 @@ So use this option with great care! .It Fl s Ar size Determines the .Ar size -of the file system after enlarging in sectors. +of the filesystem after enlarging in sectors. This value defaults to the size of the raw partition specified in .Ar special (in other words, .Nm -will enlarge the file system to the size of the entire partition). +will enlarge the filesystem to the size of the entire partition). .El .Sh EXAMPLES .Dl growfs -s 4194304 /dev/vinum/testvol @@ -119,12 +119,12 @@ up to 2GB if there is enough space in .Sh SEE ALSO .Xr bsdlabel 8 , .Xr dumpfs 8 , -.Xr fdisk 8 , .Xr ffsinfo 8 , .Xr fsck 8 , +.Xr gpart 8 , .Xr newfs 8 , .Xr tunefs 8 , -.Xr vinum 8 +.Xr gvinum 8 .Sh HISTORY The .Nm @@ -144,12 +144,12 @@ There may be cases on .Fx 3.x only, when .Nm -does not recognize properly whether or not the file system is mounted and +does not recognize properly whether or not the filesystem is mounted and exits with an error message. Then please use .Nm .Fl y -if you are sure that the file system is not mounted. +if you are sure that the filesystem is not mounted. It is also recommended to always use .Xr fsck 8 after enlarging (just to be on the safe side). @@ -183,8 +183,8 @@ on the first cylinder group to verify th in the CYLINDER SUMMARY (internal cs) of the CYLINDER GROUP .Em cgr0 has enough blocks. -As a rule of thumb for default file system parameters one block is needed for -every 2 GB of total file system size. +As a rule of thumb for default filesystem parameters one block is needed for +every 2 GB of total filesystem size. .Pp Normally .Nm Modified: user/gabor/tre-integration/sbin/growfs/growfs.c ============================================================================== --- user/gabor/tre-integration/sbin/growfs/growfs.c Wed Jun 22 23:26:04 2011 (r223451) +++ user/gabor/tre-integration/sbin/growfs/growfs.c Wed Jun 22 23:36:01 2011 (r223452) @@ -160,7 +160,7 @@ static void get_dev_size(int, int *); /* ************************************************************ growfs ***** */ /* - * Here we actually start growing the file system. We basically read the + * Here we actually start growing the filesystem. We basically read the * cylinder summary from the first cylinder group as we want to update * this on the fly during our various operations. First we handle the * changes in the former last cylinder group. Afterwards we create all new @@ -231,7 +231,7 @@ growfs(int fsi, int fso, unsigned int Nf updjcg(osblock.fs_ncg-1, modtime, fsi, fso, Nflag); /* - * Dump out summary information about file system. + * Dump out summary information about filesystem. */ # define B2MBFACTOR (1 / (1024.0 * 1024.0)) printf("growfs: %.1fMB (%jd sectors) block size %d, fragment size %d\n", @@ -435,7 +435,7 @@ initcg(int cylno, time_t modtime, int fs if (acg.cg_nextfreeoff > (unsigned)sblock.fs_cgsize) { /* * This should never happen as we would have had that panic - * already on file system creation + * already on filesystem creation */ errx(37, "panic: cylinder group too big"); } @@ -446,7 +446,7 @@ initcg(int cylno, time_t modtime, int fs acg.cg_cs.cs_nifree--; } /* - * For the old file system, we have to initialize all the inodes. + * For the old filesystem, we have to initialize all the inodes. */ if (sblock.fs_magic == FS_UFS1_MAGIC) { bzero(iobuf, sblock.fs_bsize); @@ -670,7 +670,7 @@ cond_bl_upd(ufs2_daddr_t *block, struct /* ************************************************************ updjcg ***** */ /* * Here we do all needed work for the former last cylinder group. It has to be - * changed in any case, even if the file system ended exactly on the end of + * changed in any case, even if the filesystem ended exactly on the end of * this group, as there is some slightly inconsistent handling of the number * of cylinders in the cylinder group. We start again by reading the cylinder * group from disk. If the last block was not fully available, we first handle @@ -780,7 +780,7 @@ updjcg(int cylno, time_t modtime, int fs * the rotational layout tables and the cluster summary. This is * also done per fragment for the first new block if the old file * system end was not on a block boundary, per fragment for the new - * last block if the new file system end is not on a block boundary, + * last block if the new filesystem end is not on a block boundary, * and per block for all space in between. * * Handle the first new block here if it was partially available @@ -804,7 +804,7 @@ updjcg(int cylno, time_t modtime, int fs /* * Check if the fragment just created could join an * already existing fragment at the former end of the - * file system. + * filesystem. */ if(isblock(&sblock, cg_blksfree(&acg), ((osblock.fs_size - cgbase(&sblock, cylno))/ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Thu Jun 23 00:04:07 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A47341065673; Thu, 23 Jun 2011 00:04:07 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FDC98FC14; Thu, 23 Jun 2011 00:04:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5N047Vk074481; Thu, 23 Jun 2011 00:04:07 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N047QB074463; Thu, 23 Jun 2011 00:04:07 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201106230004.p5N047QB074463@svn.freebsd.org> From: Gabor Kovesdan Date: Thu, 23 Jun 2011 00:04:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223453 - in user/gabor/tre-integration: contrib/compiler-rt/lib contrib/compiler-rt/lib/arm contrib/llvm/include/llvm contrib/llvm/include/llvm/ADT contrib/llvm/include/llvm/Analysis c... X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2011 00:04:07 -0000 Author: gabor Date: Thu Jun 23 00:04:06 2011 New Revision: 223453 URL: http://svn.freebsd.org/changeset/base/223453 Log: - Manually merge some new files. I don't actually understand how they got lost but mergeinfo is already recorded so the branch should be in a consistent state now. Added: user/gabor/tre-integration/contrib/compiler-rt/lib/abi.h (contents, props changed) user/gabor/tre-integration/contrib/compiler-rt/lib/arm/divmodsi4.S (contents, props changed) user/gabor/tre-integration/contrib/compiler-rt/lib/arm/divsi3.S (contents, props changed) user/gabor/tre-integration/contrib/compiler-rt/lib/arm/softfloat-alias.list user/gabor/tre-integration/contrib/compiler-rt/lib/arm/udivmodsi4.S (contents, props changed) user/gabor/tre-integration/contrib/compiler-rt/lib/arm/udivsi3.S (contents, props changed) user/gabor/tre-integration/contrib/compiler-rt/lib/arm/umodsi3.S (contents, props changed) user/gabor/tre-integration/contrib/compiler-rt/lib/divmoddi4.c (contents, props changed) user/gabor/tre-integration/contrib/compiler-rt/lib/divmodsi4.c (contents, props changed) user/gabor/tre-integration/contrib/compiler-rt/lib/subdf3.c (contents, props changed) user/gabor/tre-integration/contrib/compiler-rt/lib/subsf3.c (contents, props changed) user/gabor/tre-integration/contrib/compiler-rt/lib/udivmodsi4.c (contents, props changed) user/gabor/tre-integration/contrib/llvm/include/llvm/ADT/PackedVector.h (contents, props changed) user/gabor/tre-integration/contrib/llvm/include/llvm/Analysis/BranchProbabilityInfo.h (contents, props changed) user/gabor/tre-integration/contrib/llvm/include/llvm/DefaultPasses.h (contents, props changed) user/gabor/tre-integration/contrib/llvm/include/llvm/MC/MCWin64EH.h (contents, props changed) user/gabor/tre-integration/contrib/llvm/include/llvm/Support/BranchProbability.h (contents, props changed) user/gabor/tre-integration/contrib/llvm/include/llvm/Support/PassManagerBuilder.h (contents, props changed) user/gabor/tre-integration/contrib/llvm/include/llvm/Support/Win64EH.h (contents, props changed) user/gabor/tre-integration/contrib/llvm/lib/Analysis/BranchProbabilityInfo.cpp (contents, props changed) user/gabor/tre-integration/contrib/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp (contents, props changed) user/gabor/tre-integration/contrib/llvm/lib/CodeGen/RegisterClassInfo.cpp (contents, props changed) user/gabor/tre-integration/contrib/llvm/lib/CodeGen/RegisterClassInfo.h (contents, props changed) user/gabor/tre-integration/contrib/llvm/lib/ExecutionEngine/TargetSelect.cpp (contents, props changed) user/gabor/tre-integration/contrib/llvm/lib/MC/MCWin64EH.cpp (contents, props changed) user/gabor/tre-integration/contrib/llvm/lib/Support/BranchProbability.cpp (contents, props changed) user/gabor/tre-integration/contrib/llvm/lib/Target/Mips/MipsEmitGPRestore.cpp (contents, props changed) user/gabor/tre-integration/contrib/llvm/utils/TableGen/CodeGenRegisters.cpp (contents, props changed) user/gabor/tre-integration/contrib/llvm/utils/TableGen/SetTheory.cpp (contents, props changed) user/gabor/tre-integration/contrib/llvm/utils/TableGen/SetTheory.h (contents, props changed) user/gabor/tre-integration/contrib/sendmail/cf/ostype/solaris11.m4 user/gabor/tre-integration/contrib/tre/lib/tre.h (contents, props changed) user/gabor/tre-integration/crypto/openssh/audit-linux.c (contents, props changed) user/gabor/tre-integration/crypto/openssh/bufec.c (contents, props changed) user/gabor/tre-integration/crypto/openssh/kexecdh.c (contents, props changed) user/gabor/tre-integration/crypto/openssh/kexecdhc.c (contents, props changed) user/gabor/tre-integration/crypto/openssh/kexecdhs.c (contents, props changed) user/gabor/tre-integration/crypto/openssh/openbsd-compat/charclass.h (contents, props changed) user/gabor/tre-integration/crypto/openssh/openbsd-compat/timingsafe_bcmp.c (contents, props changed) user/gabor/tre-integration/crypto/openssh/ssh-ecdsa.c (contents, props changed) user/gabor/tre-integration/etc/periodic/security/460.chkportsum.rej user/gabor/tre-integration/lib/libdwarf/dwarf_func.c (contents, props changed) user/gabor/tre-integration/lib/libsbuf/Symbol.map user/gabor/tre-integration/lib/libsbuf/Version.def user/gabor/tre-integration/lib/libutil/kinfo_getallproc.3 (contents, props changed) user/gabor/tre-integration/lib/libutil/kinfo_getallproc.c (contents, props changed) user/gabor/tre-integration/lib/libutil/kinfo_getproc.3 (contents, props changed) user/gabor/tre-integration/lib/libutil/kinfo_getproc.c (contents, props changed) user/gabor/tre-integration/release/pc98/mkisoimages.sh (contents, props changed) user/gabor/tre-integration/release/powerpc/generate-hfs.sh (contents, props changed) user/gabor/tre-integration/release/powerpc/hfs-boot.bz2.uu user/gabor/tre-integration/sbin/hastd/proto_tcp.c (contents, props changed) user/gabor/tre-integration/share/man/man4/ath_ahb.4 (contents, props changed) user/gabor/tre-integration/share/man/man4/ath_pci.4 (contents, props changed) user/gabor/tre-integration/share/man/man4/geom_map.4 (contents, props changed) user/gabor/tre-integration/share/man/man4/man4.i386/glxiic.4 (contents, props changed) user/gabor/tre-integration/share/man/man4/umcs.4 (contents, props changed) user/gabor/tre-integration/sys/amd64/conf/LINT user/gabor/tre-integration/sys/amd64/conf/LINT-VIMAGE user/gabor/tre-integration/sys/boot/forth/beastie.4th.8 (contents, props changed) user/gabor/tre-integration/sys/boot/forth/brand.4th user/gabor/tre-integration/sys/boot/forth/brand.4th.8 (contents, props changed) user/gabor/tre-integration/sys/boot/forth/check-password.4th user/gabor/tre-integration/sys/boot/forth/check-password.4th.8 (contents, props changed) user/gabor/tre-integration/sys/boot/forth/color.4th user/gabor/tre-integration/sys/boot/forth/color.4th.8 (contents, props changed) user/gabor/tre-integration/sys/boot/forth/delay.4th user/gabor/tre-integration/sys/boot/forth/delay.4th.8 (contents, props changed) user/gabor/tre-integration/sys/boot/forth/menu-commands.4th user/gabor/tre-integration/sys/boot/forth/menu.4th user/gabor/tre-integration/sys/boot/forth/menu.4th.8 (contents, props changed) user/gabor/tre-integration/sys/boot/forth/menu.rc user/gabor/tre-integration/sys/boot/forth/shortcuts.4th user/gabor/tre-integration/sys/boot/forth/version.4th user/gabor/tre-integration/sys/boot/forth/version.4th.8 (contents, props changed) user/gabor/tre-integration/sys/boot/ia64/common/icache.c (contents, props changed) user/gabor/tre-integration/sys/compat/linux/linux_videodev2.h (contents, props changed) user/gabor/tre-integration/sys/compat/linux/linux_videodev2_compat.h (contents, props changed) user/gabor/tre-integration/sys/dev/ath/ath_hal/ah_eeprom_9287.c (contents, props changed) user/gabor/tre-integration/sys/dev/ath/ath_hal/ah_eeprom_9287.h (contents, props changed) user/gabor/tre-integration/sys/dev/ath/ath_hal/ar9002/ar9285an.h (contents, props changed) user/gabor/tre-integration/sys/dev/ath/ath_hal/ar9002/ar9287.c (contents, props changed) user/gabor/tre-integration/sys/dev/ath/ath_hal/ar9002/ar9287.h (contents, props changed) user/gabor/tre-integration/sys/dev/ath/ath_hal/ar9002/ar9287.ini user/gabor/tre-integration/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c (contents, props changed) user/gabor/tre-integration/sys/dev/ath/ath_hal/ar9002/ar9287_cal.c (contents, props changed) user/gabor/tre-integration/sys/dev/ath/ath_hal/ar9002/ar9287_cal.h (contents, props changed) user/gabor/tre-integration/sys/dev/ath/ath_hal/ar9002/ar9287_olc.c (contents, props changed) user/gabor/tre-integration/sys/dev/ath/ath_hal/ar9002/ar9287_olc.h (contents, props changed) user/gabor/tre-integration/sys/dev/ath/ath_hal/ar9002/ar9287_reset.c (contents, props changed) user/gabor/tre-integration/sys/dev/ath/ath_hal/ar9002/ar9287_reset.h (contents, props changed) user/gabor/tre-integration/sys/dev/ath/ath_hal/ar9002/ar9287an.h (contents, props changed) user/gabor/tre-integration/sys/dev/ath/ath_hal/ar9002/ar9287phy.h (contents, props changed) user/gabor/tre-integration/sys/dev/ath/if_athdfs.h (contents, props changed) user/gabor/tre-integration/sys/dev/cxgbe/common/jhash.h (contents, props changed) user/gabor/tre-integration/sys/dev/cxgbe/t4_l2t.c (contents, props changed) user/gabor/tre-integration/sys/dev/cxgbe/t4_l2t.h (contents, props changed) user/gabor/tre-integration/sys/dev/iicbus/ad7417.c (contents, props changed) user/gabor/tre-integration/sys/dev/usb/serial/umcs.c (contents, props changed) user/gabor/tre-integration/sys/dev/usb/serial/umcs.h (contents, props changed) user/gabor/tre-integration/sys/i386/conf/LINT user/gabor/tre-integration/sys/i386/conf/LINT-VIMAGE user/gabor/tre-integration/sys/ia64/conf/LINT user/gabor/tre-integration/sys/netinet/in_pcbgroup.c (contents, props changed) user/gabor/tre-integration/sys/netinet6/in6_pcbgroup.c (contents, props changed) user/gabor/tre-integration/sys/nfs/nfs_kdtrace.h (contents, props changed) user/gabor/tre-integration/sys/pc98/conf/LINT user/gabor/tre-integration/sys/powerpc/conf/LINT user/gabor/tre-integration/sys/powerpc/include/rtas.h (contents, props changed) user/gabor/tre-integration/sys/powerpc/ofw/ofwcall32.S (contents, props changed) user/gabor/tre-integration/sys/powerpc/ofw/ofwcall64.S (contents, props changed) user/gabor/tre-integration/sys/powerpc/ofw/ofwmagic.S (contents, props changed) user/gabor/tre-integration/sys/powerpc/ofw/rtas.c (contents, props changed) user/gabor/tre-integration/sys/powerpc/powermac/powermac_thermal.c (contents, props changed) user/gabor/tre-integration/sys/powerpc/powermac/powermac_thermal.h (contents, props changed) user/gabor/tre-integration/sys/powerpc/powermac/windtunnel.c (contents, props changed) user/gabor/tre-integration/sys/sparc64/conf/LINT user/gabor/tre-integration/sys/sys/_cpuset.h (contents, props changed) user/gabor/tre-integration/sys/sys/_stdint.h (contents, props changed) user/gabor/tre-integration/tools/build/options/WITHOUT_BINUTILS user/gabor/tre-integration/tools/build/options/WITHOUT_GCC user/gabor/tre-integration/tools/build/options/WITHOUT_GPIO user/gabor/tre-integration/tools/build/options/WITHOUT_KERNEL_SYMBOLS user/gabor/tre-integration/tools/build/options/WITH_CLANG user/gabor/tre-integration/tools/build/options/WITH_FDT user/gabor/tre-integration/tools/build/options/WITH_OFED user/gabor/tre-integration/tools/regression/bin/sh/builtins/case5.0 user/gabor/tre-integration/tools/regression/bin/sh/builtins/case6.0 user/gabor/tre-integration/tools/regression/bin/sh/builtins/case7.0 user/gabor/tre-integration/tools/regression/bin/sh/builtins/cd3.0 user/gabor/tre-integration/tools/regression/bin/sh/builtins/cd4.0 user/gabor/tre-integration/tools/regression/bin/sh/builtins/cd5.0 user/gabor/tre-integration/tools/regression/bin/sh/builtins/cd6.0 user/gabor/tre-integration/tools/regression/bin/sh/builtins/cd7.0 user/gabor/tre-integration/tools/regression/bin/sh/builtins/dot4.0 user/gabor/tre-integration/tools/regression/bin/sh/builtins/set1.0 user/gabor/tre-integration/tools/regression/bin/sh/errors/bad-parm-exp6.2 (contents, props changed) user/gabor/tre-integration/tools/regression/bin/sh/errors/bad-parm-exp6.2.stderr user/gabor/tre-integration/tools/regression/bin/sh/execution/set-n1.0 user/gabor/tre-integration/tools/regression/bin/sh/execution/set-n2.0 user/gabor/tre-integration/tools/regression/bin/sh/execution/set-n3.0 user/gabor/tre-integration/tools/regression/bin/sh/execution/set-n4.0 user/gabor/tre-integration/tools/regression/bin/sh/execution/set-x1.0 user/gabor/tre-integration/tools/regression/bin/sh/execution/set-x2.0 user/gabor/tre-integration/tools/regression/bin/sh/execution/set-x3.0 user/gabor/tre-integration/tools/regression/bin/sh/expansion/heredoc1.0 user/gabor/tre-integration/tools/regression/bin/sh/expansion/heredoc2.0 user/gabor/tre-integration/tools/regression/bin/sh/expansion/ifs4.0 user/gabor/tre-integration/tools/regression/bin/sh/expansion/length7.0 user/gabor/tre-integration/tools/regression/bin/sh/expansion/length8.0 user/gabor/tre-integration/tools/regression/bin/sh/expansion/set-u3.0 user/gabor/tre-integration/tools/regression/bin/sh/expansion/trim8.0 user/gabor/tre-integration/tools/regression/bin/sh/parameters/env1.0 user/gabor/tre-integration/tools/regression/bin/sh/parameters/positional1.0 user/gabor/tre-integration/tools/regression/bin/sh/parser/alias4.0 user/gabor/tre-integration/tools/regression/bin/sh/parser/alias5.0 user/gabor/tre-integration/tools/regression/bin/sh/parser/dollar-quote1.0 user/gabor/tre-integration/tools/regression/bin/sh/parser/dollar-quote10.0 user/gabor/tre-integration/tools/regression/bin/sh/parser/dollar-quote11.0 user/gabor/tre-integration/tools/regression/bin/sh/parser/dollar-quote2.0 user/gabor/tre-integration/tools/regression/bin/sh/parser/dollar-quote3.0 user/gabor/tre-integration/tools/regression/bin/sh/parser/dollar-quote4.0 user/gabor/tre-integration/tools/regression/bin/sh/parser/dollar-quote5.0 user/gabor/tre-integration/tools/regression/bin/sh/parser/dollar-quote6.0 user/gabor/tre-integration/tools/regression/bin/sh/parser/dollar-quote7.0 user/gabor/tre-integration/tools/regression/bin/sh/parser/dollar-quote8.0 user/gabor/tre-integration/tools/regression/bin/sh/parser/dollar-quote9.0 user/gabor/tre-integration/tools/regression/bin/sh/parser/func2.0 user/gabor/tre-integration/tools/regression/bin/sh/parser/func3.0 user/gabor/tre-integration/tools/regression/bin/sh/parser/heredoc10.0 user/gabor/tre-integration/tools/regression/bin/sh/parser/heredoc11.0 user/gabor/tre-integration/tools/regression/bin/sh/parser/heredoc9.0 user/gabor/tre-integration/tools/regression/usr.bin/printf/regress.l1.out user/gabor/tre-integration/tools/regression/usr.bin/printf/regress.l2.out user/gabor/tre-integration/usr.bin/fstat/functions.h (contents, props changed) user/gabor/tre-integration/usr.bin/fstat/fuser.1 (contents, props changed) user/gabor/tre-integration/usr.bin/fstat/fuser.c (contents, props changed) user/gabor/tre-integration/usr.bin/fstat/main.c (contents, props changed) user/gabor/tre-integration/usr.sbin/bsdinstall/bsdinstall.8 (contents, props changed) user/gabor/tre-integration/usr.sbin/bsdinstall/scripts/netconfig_ipv4 (contents, props changed) user/gabor/tre-integration/usr.sbin/bsdinstall/scripts/netconfig_ipv6 (contents, props changed) Added: user/gabor/tre-integration/contrib/compiler-rt/lib/abi.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gabor/tre-integration/contrib/compiler-rt/lib/abi.h Thu Jun 23 00:04:06 2011 (r223453) @@ -0,0 +1,23 @@ +/* ===------ abi.h - configuration header for compiler-rt -----------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===----------------------------------------------------------------------=== + * + * This file is a configuration header for compiler-rt. + * This file is not part of the interface of this library. + * + * ===----------------------------------------------------------------------=== + */ + +#if __ARM_EABI__ +# define ARM_EABI_FNALIAS(aeabi_name, name) \ + void __aeabi_##aeabi_name() __attribute__((alias("__" #name))); +# define COMPILER_RT_ABI __attribute__((pcs("aapcs"))) +#else +# define ARM_EABI_FNALIAS(aeabi_name, name) +# define COMPILER_RT_ABI +#endif Added: user/gabor/tre-integration/contrib/compiler-rt/lib/arm/divmodsi4.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gabor/tre-integration/contrib/compiler-rt/lib/arm/divmodsi4.S Thu Jun 23 00:04:06 2011 (r223453) @@ -0,0 +1,47 @@ +/*===-- divmodsi4.S - 32-bit signed integer divide and modulus ------------===// + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + *===----------------------------------------------------------------------===// + * + * This file implements the __divmodsi4 (32-bit signed integer divide and + * modulus) function for the ARM architecture. A naive digit-by-digit + * computation is employed for simplicity. + * + *===----------------------------------------------------------------------===*/ + +#include "../assembly.h" + +#define ESTABLISH_FRAME \ + push {r4-r7, lr} ;\ + add r7, sp, #12 +#define CLEAR_FRAME_AND_RETURN \ + pop {r4-r7, pc} + +.syntax unified +.align 3 +DEFINE_COMPILERRT_FUNCTION(__divmodsi4) + ESTABLISH_FRAME +// Set aside the sign of the quotient and modulus, and the address for the +// modulus. + eor r4, r0, r1 + mov r5, r0 + mov r6, r2 +// Take the absolute value of a and b via abs(x) = (x^(x >> 31)) - (x >> 31). + eor ip, r0, r0, asr #31 + eor lr, r1, r1, asr #31 + sub r0, ip, r0, asr #31 + sub r1, lr, r1, asr #31 +// Unsigned divmod: + bl SYMBOL_NAME(__udivmodsi4) +// Apply the sign of quotient and modulus + ldr r1, [r6] + eor r0, r0, r4, asr #31 + eor r1, r1, r5, asr #31 + sub r0, r0, r4, asr #31 + sub r1, r1, r5, asr #31 + str r1, [r6] + CLEAR_FRAME_AND_RETURN Added: user/gabor/tre-integration/contrib/compiler-rt/lib/arm/divsi3.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gabor/tre-integration/contrib/compiler-rt/lib/arm/divsi3.S Thu Jun 23 00:04:06 2011 (r223453) @@ -0,0 +1,41 @@ +/*===-- divsi3.S - 32-bit signed integer divide ---------------------------===// + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + *===----------------------------------------------------------------------===// + * + * This file implements the __divsi3 (32-bit signed integer divide) function + * for the ARM architecture as a wrapper around the unsigned routine. + * + *===----------------------------------------------------------------------===*/ + +#include "../assembly.h" + +#define ESTABLISH_FRAME \ + push {r4, r7, lr} ;\ + add r7, sp, #4 +#define CLEAR_FRAME_AND_RETURN \ + pop {r4, r7, pc} + +.syntax unified +.align 3 +// Ok, APCS and AAPCS agree on 32 bit args, so it's safe to use the same routine. +DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_idiv, __divsi3) +DEFINE_COMPILERRT_FUNCTION(__divsi3) + ESTABLISH_FRAME +// Set aside the sign of the quotient. + eor r4, r0, r1 +// Take absolute value of a and b via abs(x) = (x^(x >> 31)) - (x >> 31). + eor r2, r0, r0, asr #31 + eor r3, r1, r1, asr #31 + sub r0, r2, r0, asr #31 + sub r1, r3, r1, asr #31 +// abs(a) / abs(b) + bl SYMBOL_NAME(__udivsi3) +// Apply sign of quotient to result and return. + eor r0, r0, r4, asr #31 + sub r0, r0, r4, asr #31 + CLEAR_FRAME_AND_RETURN Added: user/gabor/tre-integration/contrib/compiler-rt/lib/arm/softfloat-alias.list ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gabor/tre-integration/contrib/compiler-rt/lib/arm/softfloat-alias.list Thu Jun 23 00:04:06 2011 (r223453) @@ -0,0 +1,21 @@ +# +# These are soft float functions which can be +# aliased to the *vfp functions on arm processors +# that support floating point instructions. +# +___adddf3vfp ___adddf3 +___addsf3vfp ___addsf3 +___divdf3vfp ___divdf3 +___divsf3vfp ___divsf3 +___extendsfdf2vfp ___extendsfdf2 +___fixdfsivfp ___fixdfsi +___fixsfsivfp ___fixsfsi +___floatsidfvfp ___floatsidf +___floatsisfvfp ___floatsisf +___muldf3vfp ___muldf3 +___mulsf3vfp ___mulsf3 +___subdf3vfp ___subdf3 +___subsf3vfp ___subsf3 +___truncdfsf2vfp ___truncdfsf2 +___floatunssidfvfp ___floatunsidf +___floatunssisfvfp ___floatunsisf Added: user/gabor/tre-integration/contrib/compiler-rt/lib/arm/udivmodsi4.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gabor/tre-integration/contrib/compiler-rt/lib/arm/udivmodsi4.S Thu Jun 23 00:04:06 2011 (r223453) @@ -0,0 +1,80 @@ +/*===-- udivmodsi4.S - 32-bit unsigned integer divide and modulus ---------===// + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + *===----------------------------------------------------------------------===// + * + * This file implements the __udivmodsi4 (32-bit unsigned integer divide and + * modulus) function for the ARM architecture. A naive digit-by-digit + * computation is employed for simplicity. + * + *===----------------------------------------------------------------------===*/ + +#include "../assembly.h" + +#define ESTABLISH_FRAME \ + push {r4, r7, lr} ;\ + add r7, sp, #4 +#define CLEAR_FRAME_AND_RETURN \ + pop {r4, r7, pc} + +#define a r0 +#define b r1 +#define i r3 +#define r r4 +#define q ip +#define one lr + +.syntax unified +.align 3 +DEFINE_COMPILERRT_FUNCTION(__udivmodsi4) +// We use a simple digit by digit algorithm; before we get into the actual +// divide loop, we must calculate the left-shift amount necessary to align +// the MSB of the divisor with that of the dividend (If this shift is +// negative, then the result is zero, and we early out). We also conjure a +// bit mask of 1 to use in constructing the quotient, and initialize the +// quotient to zero. + ESTABLISH_FRAME + clz r4, a + tst b, b // detect divide-by-zero + clz r3, b + mov q, #0 + beq LOCAL_LABEL(return) // return 0 if b is zero. + mov one, #1 + subs i, r3, r4 + blt LOCAL_LABEL(return) // return 0 if MSB(a) < MSB(b) + +LOCAL_LABEL(mainLoop): +// This loop basically implements the following: +// +// do { +// if (a >= b << i) { +// a -= b << i; +// q |= 1 << i; +// if (a == 0) break; +// } +// } while (--i) +// +// Note that this does not perform the final iteration (i == 0); by doing it +// this way, we can merge the two branches which is a substantial win for +// such a tight loop on current ARM architectures. + subs r, a, b, lsl i + orrhs q, q,one, lsl i + movhs a, r + subsne i, i, #1 + bhi LOCAL_LABEL(mainLoop) + +// Do the final test subtraction and update of quotient (i == 0), as it is +// not performed in the main loop. + subs r, a, b + orrhs q, #1 + movhs a, r + +LOCAL_LABEL(return): +// Store the remainder, and move the quotient to r0, then return. + str a, [r2] + mov r0, q + CLEAR_FRAME_AND_RETURN Added: user/gabor/tre-integration/contrib/compiler-rt/lib/arm/udivsi3.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gabor/tre-integration/contrib/compiler-rt/lib/arm/udivsi3.S Thu Jun 23 00:04:06 2011 (r223453) @@ -0,0 +1,80 @@ +/*===-- udivsi3.S - 32-bit unsigned integer divide ------------------------===// + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + *===----------------------------------------------------------------------===// + * + * This file implements the __udivsi3 (32-bit unsigned integer divide) + * function for the ARM architecture. A naive digit-by-digit computation is + * employed for simplicity. + * + *===----------------------------------------------------------------------===*/ + +#include "../assembly.h" + +#define ESTABLISH_FRAME \ + push {r7, lr} ;\ + mov r7, sp +#define CLEAR_FRAME_AND_RETURN \ + pop {r7, pc} + +#define a r0 +#define b r1 +#define r r2 +#define i r3 +#define q ip +#define one lr + +.syntax unified +.align 3 +// Ok, APCS and AAPCS agree on 32 bit args, so it's safe to use the same routine. +DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_uidiv, __udivsi3) +DEFINE_COMPILERRT_FUNCTION(__udivsi3) +// We use a simple digit by digit algorithm; before we get into the actual +// divide loop, we must calculate the left-shift amount necessary to align +// the MSB of the divisor with that of the dividend (If this shift is +// negative, then the result is zero, and we early out). We also conjure a +// bit mask of 1 to use in constructing the quotient, and initialize the +// quotient to zero. + ESTABLISH_FRAME + clz r2, a + tst b, b // detect divide-by-zero + clz r3, b + mov q, #0 + beq LOCAL_LABEL(return) // return 0 if b is zero. + mov one, #1 + subs i, r3, r2 + blt LOCAL_LABEL(return) // return 0 if MSB(a) < MSB(b) + +LOCAL_LABEL(mainLoop): +// This loop basically implements the following: +// +// do { +// if (a >= b << i) { +// a -= b << i; +// q |= 1 << i; +// if (a == 0) break; +// } +// } while (--i) +// +// Note that this does not perform the final iteration (i == 0); by doing it +// this way, we can merge the two branches which is a substantial win for +// such a tight loop on current ARM architectures. + subs r, a, b, lsl i + orrhs q, q,one, lsl i + movhs a, r + subsne i, i, #1 + bhi LOCAL_LABEL(mainLoop) + +// Do the final test subtraction and update of quotient (i == 0), as it is +// not performed in the main loop. + subs r, a, b + orrhs q, #1 + +LOCAL_LABEL(return): +// Move the quotient to r0 and return. + mov r0, q + CLEAR_FRAME_AND_RETURN Added: user/gabor/tre-integration/contrib/compiler-rt/lib/arm/umodsi3.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gabor/tre-integration/contrib/compiler-rt/lib/arm/umodsi3.S Thu Jun 23 00:04:06 2011 (r223453) @@ -0,0 +1,58 @@ +/*===-- umodsi3.S - 32-bit unsigned integer modulus -----------------------===// + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + *===----------------------------------------------------------------------===// + * + * This file implements the __umodsi3 (32-bit unsigned integer modulus) + * function for the ARM architecture. A naive digit-by-digit computation is + * employed for simplicity. + * + *===----------------------------------------------------------------------===*/ + +#include "../assembly.h" + +#define a r0 +#define b r1 +#define r r2 +#define i r3 + +.syntax unified +.align 3 +DEFINE_COMPILERRT_FUNCTION(__umodsi3) +// We use a simple digit by digit algorithm; before we get into the actual +// divide loop, we must calculate the left-shift amount necessary to align +// the MSB of the divisor with that of the dividend. + clz r2, a + tst b, b // detect b == 0 + clz r3, b + bxeq lr // return a if b == 0 + subs i, r3, r2 + bxlt lr // return a if MSB(a) < MSB(b) + +LOCAL_LABEL(mainLoop): +// This loop basically implements the following: +// +// do { +// if (a >= b << i) { +// a -= b << i; +// if (a == 0) break; +// } +// } while (--i) +// +// Note that this does not perform the final iteration (i == 0); by doing it +// this way, we can merge the two branches which is a substantial win for +// such a tight loop on current ARM architectures. + subs r, a, b, lsl i + movhs a, r + subsne i, i, #1 + bhi LOCAL_LABEL(mainLoop) + +// Do the final test subtraction and update of remainder (i == 0), as it is +// not performed in the main loop. + subs r, a, b + movhs a, r + bx lr Added: user/gabor/tre-integration/contrib/compiler-rt/lib/divmoddi4.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gabor/tre-integration/contrib/compiler-rt/lib/divmoddi4.c Thu Jun 23 00:04:06 2011 (r223453) @@ -0,0 +1,30 @@ +/*===-- divmoddi4.c - Implement __divmoddi4 --------------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===----------------------------------------------------------------------=== + * + * This file implements __divmoddi4 for the compiler_rt library. + * + * ===----------------------------------------------------------------------=== + */ +#include "abi.h" + +#include "int_lib.h" + +extern COMPILER_RT_ABI di_int __divdi3(di_int a, di_int b); + +ARM_EABI_FNALIAS(ldivmod, divmoddi4); + +/* Returns: a / b, *rem = a % b */ + +COMPILER_RT_ABI di_int +__divmoddi4(di_int a, di_int b, di_int* rem) +{ + di_int d = __divdi3(a,b); + *rem = a - (d*b); + return d; +} Added: user/gabor/tre-integration/contrib/compiler-rt/lib/divmodsi4.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gabor/tre-integration/contrib/compiler-rt/lib/divmodsi4.c Thu Jun 23 00:04:06 2011 (r223453) @@ -0,0 +1,31 @@ +/*===-- divmodsi4.c - Implement __divmodsi4 --------------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===----------------------------------------------------------------------=== + * + * This file implements __divmodsi4 for the compiler_rt library. + * + * ===----------------------------------------------------------------------=== + */ +#include "abi.h" + +#include "int_lib.h" + +extern COMPILER_RT_ABI si_int __divsi3(si_int a, si_int b); + + +/* Returns: a / b, *rem = a % b */ + +COMPILER_RT_ABI si_int +__divmodsi4(si_int a, si_int b, si_int* rem) +{ + si_int d = __divsi3(a,b); + *rem = a - (d*b); + return d; +} + + Added: user/gabor/tre-integration/contrib/compiler-rt/lib/subdf3.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gabor/tre-integration/contrib/compiler-rt/lib/subdf3.c Thu Jun 23 00:04:06 2011 (r223453) @@ -0,0 +1,30 @@ +//===-- lib/adddf3.c - Double-precision subtraction ---------------*- C -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements double-precision soft-float subtraction with the +// IEEE-754 default rounding (to nearest, ties to even). +// +//===----------------------------------------------------------------------===// +#include "abi.h" + +#define DOUBLE_PRECISION +#include "fp_lib.h" + +fp_t COMPILER_RT_ABI __adddf3(fp_t a, fp_t b); + + +ARM_EABI_FNALIAS(dsub, subdf3); + +// Subtraction; flip the sign bit of b and add. +COMPILER_RT_ABI fp_t +__subdf3(fp_t a, fp_t b) { + return __adddf3(a, fromRep(toRep(b) ^ signBit)); +} + +/* FIXME: rsub for ARM EABI */ Added: user/gabor/tre-integration/contrib/compiler-rt/lib/subsf3.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gabor/tre-integration/contrib/compiler-rt/lib/subsf3.c Thu Jun 23 00:04:06 2011 (r223453) @@ -0,0 +1,29 @@ +//===-- lib/subsf3.c - Single-precision subtraction ---------------*- C -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements single-precision soft-float subtraction with the +// IEEE-754 default rounding (to nearest, ties to even). +// +//===----------------------------------------------------------------------===// +#include "abi.h" + +#define SINGLE_PRECISION +#include "fp_lib.h" + +fp_t COMPILER_RT_ABI __addsf3(fp_t a, fp_t b); + +ARM_EABI_FNALIAS(fsub, subsf3); + +// Subtraction; flip the sign bit of b and add. +COMPILER_RT_ABI fp_t +__subsf3(fp_t a, fp_t b) { + return __addsf3(a, fromRep(toRep(b) ^ signBit)); +} + +/* FIXME: rsub for ARM EABI */ Added: user/gabor/tre-integration/contrib/compiler-rt/lib/udivmodsi4.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gabor/tre-integration/contrib/compiler-rt/lib/udivmodsi4.c Thu Jun 23 00:04:06 2011 (r223453) @@ -0,0 +1,31 @@ +/*===-- udivmodsi4.c - Implement __udivmodsi4 ------------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===----------------------------------------------------------------------=== + * + * This file implements __udivmodsi4 for the compiler_rt library. + * + * ===----------------------------------------------------------------------=== + */ +#include "abi.h" + +#include "int_lib.h" + +extern su_int COMPILER_RT_ABI __udivsi3(su_int n, su_int d); + + +/* Returns: a / b, *rem = a % b */ + +COMPILER_RT_ABI su_int +__udivmodsi4(su_int a, su_int b, su_int* rem) +{ + si_int d = __udivsi3(a,b); + *rem = a - (d*b); + return d; +} + + Added: user/gabor/tre-integration/contrib/llvm/include/llvm/ADT/PackedVector.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gabor/tre-integration/contrib/llvm/include/llvm/ADT/PackedVector.h Thu Jun 23 00:04:06 2011 (r223453) @@ -0,0 +1,158 @@ +//===- llvm/ADT/PackedVector.h - Packed values vector -----------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements the PackedVector class. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_ADT_PACKEDVECTOR_H +#define LLVM_ADT_PACKEDVECTOR_H + +#include "llvm/ADT/BitVector.h" +#include + +namespace llvm { + +template +class PackedVectorBase; + +// This won't be necessary if we can specialize members without specializing +// the parent template. +template +class PackedVectorBase { +protected: + static T getValue(const llvm::BitVector &Bits, unsigned Idx) { + T val = T(); + for (unsigned i = 0; i != BitNum; ++i) + val = T(val | ((Bits[(Idx << (BitNum-1)) + i] ? 1UL : 0UL) << i)); + return val; + } + + static void setValue(llvm::BitVector &Bits, unsigned Idx, T val) { + assert((val >> BitNum) == 0 && "value is too big"); + for (unsigned i = 0; i != BitNum; ++i) + Bits[(Idx << (BitNum-1)) + i] = val & (T(1) << i); + } +}; + +template +class PackedVectorBase { +protected: + static T getValue(const llvm::BitVector &Bits, unsigned Idx) { + T val = T(); + for (unsigned i = 0; i != BitNum-1; ++i) + val = T(val | ((Bits[(Idx << (BitNum-1)) + i] ? 1UL : 0UL) << i)); + if (Bits[(Idx << (BitNum-1)) + BitNum-1]) + val = ~val; + return val; + } + + static void setValue(llvm::BitVector &Bits, unsigned Idx, T val) { + if (val < 0) { + val = ~val; + Bits.set((Idx << (BitNum-1)) + BitNum-1); + } + assert((val >> (BitNum-1)) == 0 && "value is too big"); + for (unsigned i = 0; i != BitNum-1; ++i) + Bits[(Idx << (BitNum-1)) + i] = val & (T(1) << i); + } +}; + +/// \brief Store a vector of values using a specific number of bits for each +/// value. Both signed and unsigned types can be used, e.g +/// @code +/// PackedVector vec; +/// @endcode +/// will create a vector accepting values -2, -1, 0, 1. Any other value will hit +/// an assertion. +template +class PackedVector : public PackedVectorBase::is_signed> { + llvm::BitVector Bits; + typedef PackedVectorBase::is_signed> base; + +public: + class reference { + PackedVector &Vec; + const unsigned Idx; + + reference(); // Undefined + public: + reference(PackedVector &vec, unsigned idx) : Vec(vec), Idx(idx) { } + + reference &operator=(T val) { + Vec.setValue(Vec.Bits, Idx, val); + return *this; + } + operator T() { + return Vec.getValue(Vec.Bits, Idx); + } + }; + + PackedVector() { } + explicit PackedVector(unsigned size) : Bits(size << (BitNum-1)) { } + + bool empty() const { return Bits.empty(); } + + unsigned size() const { return Bits.size() >> (BitNum-1); } + + void clear() { Bits.clear(); } + + void resize(unsigned N) { Bits.resize(N << (BitNum-1)); } + + void reserve(unsigned N) { Bits.reserve(N << (BitNum-1)); } + + PackedVector &reset() { + Bits.reset(); + return *this; + } + + void push_back(T val) { + resize(size()+1); + (*this)[size()-1] = val; + } + + reference operator[](unsigned Idx) { + return reference(*this, Idx); + } + + T operator[](unsigned Idx) const { + return base::getValue(Bits, Idx); + } + + bool operator==(const PackedVector &RHS) const { + return Bits == RHS.Bits; + } + + bool operator!=(const PackedVector &RHS) const { + return Bits != RHS.Bits; + } + + const PackedVector &operator=(const PackedVector &RHS) { + Bits = RHS.Bits; + return *this; + } + + PackedVector &operator|=(const PackedVector &RHS) { + Bits |= RHS.Bits; + return *this; + } + + void swap(PackedVector &RHS) { + Bits.swap(RHS.Bits); + } +}; + +// Leave BitNum=0 undefined. +template +class PackedVector; + +} // end llvm namespace + +#endif Added: user/gabor/tre-integration/contrib/llvm/include/llvm/Analysis/BranchProbabilityInfo.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gabor/tre-integration/contrib/llvm/include/llvm/Analysis/BranchProbabilityInfo.h Thu Jun 23 00:04:06 2011 (r223453) @@ -0,0 +1,78 @@ +//===--- BranchProbabilityInfo.h - Branch Probability Analysis --*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This pass is used to evaluate branch probabilties. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_ANALYSIS_BRANCHPROBABILITYINFO_H +#define LLVM_ANALYSIS_BRANCHPROBABILITYINFO_H + +#include "llvm/InitializePasses.h" +#include "llvm/Support/BranchProbability.h" +#include "llvm/Analysis/LoopInfo.h" + +namespace llvm { + +class raw_ostream; + +class BranchProbabilityInfo : public FunctionPass { + + // Default weight value. Used when we don't have information about the edge. + static const uint32_t DEFAULT_WEIGHT = 16; + + typedef std::pair Edge; + + DenseMap Weights; + + // Get sum of the block successors' weights. + uint32_t getSumForBlock(BasicBlock *BB) const; + +public: + static char ID; + + BranchProbabilityInfo() : FunctionPass(ID) { + initializeBranchProbabilityInfoPass(*PassRegistry::getPassRegistry()); + } + + void getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequired(); + AU.setPreservesAll(); + } + + bool runOnFunction(Function &F); + + // Returned value is between 1 and UINT32_MAX. Look at + // BranchProbabilityInfo.cpp for details. + uint32_t getEdgeWeight(BasicBlock *Src, BasicBlock *Dst) const; + + // Look at BranchProbabilityInfo.cpp for details. Use it with caution! + void setEdgeWeight(BasicBlock *Src, BasicBlock *Dst, uint32_t Weight); + + // A 'Hot' edge is an edge which probability is >= 80%. + bool isEdgeHot(BasicBlock *Src, BasicBlock *Dst) const; + + // Return a hot successor for the block BB or null if there isn't one. + BasicBlock *getHotSucc(BasicBlock *BB) const; + + // Return a probability as a fraction between 0 (0% probability) and + // 1 (100% probability), however the value is never equal to 0, and can be 1 + // only iff SRC block has only one successor. + BranchProbability getEdgeProbability(BasicBlock *Src, BasicBlock *Dst) const; + + // Print value between 0 (0% probability) and 1 (100% probability), + // however the value is never equal to 0, and can be 1 only iff SRC block + // has only one successor. + raw_ostream &printEdgeProbability(raw_ostream &OS, BasicBlock *Src, + BasicBlock *Dst) const; +}; + +} + +#endif Added: user/gabor/tre-integration/contrib/llvm/include/llvm/DefaultPasses.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gabor/tre-integration/contrib/llvm/include/llvm/DefaultPasses.h Thu Jun 23 00:04:06 2011 (r223453) @@ -0,0 +1,167 @@ +//===- llvm/DefaultPasses.h - Default Pass Support code --------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// This file defines the infrastructure for registering the standard pass list. +// This defines sets of standard optimizations that plugins can modify and +// front ends can use. +//===----------------------------------------------------------------------===// + +#ifndef LLVM_DEFAULT_PASS_SUPPORT_H +#define LLVM_DEFAULT_PASS_SUPPORT_H + +namespace llvm { + +class PassManagerBase; + +/// Unique identifiers for the default standard passes. The addresses of +/// these symbols are used to uniquely identify passes from the default list. +namespace DefaultStandardPasses { +extern unsigned char AggressiveDCEID; +extern unsigned char ArgumentPromotionID; +extern unsigned char BasicAliasAnalysisID; +extern unsigned char CFGSimplificationID; +extern unsigned char ConstantMergeID; +extern unsigned char CorrelatedValuePropagationID; +extern unsigned char DeadArgEliminationID; +extern unsigned char DeadStoreEliminationID; +extern unsigned char DeadTypeEliminationID; +extern unsigned char EarlyCSEID; +extern unsigned char FunctionAttrsID; +extern unsigned char FunctionInliningID; +extern unsigned char GVNID; +extern unsigned char GlobalDCEID; +extern unsigned char GlobalOptimizerID; +extern unsigned char GlobalsModRefID; +extern unsigned char IPSCCPID; +extern unsigned char IndVarSimplifyID; +extern unsigned char InlinerPlaceholderID; +extern unsigned char InstructionCombiningID; +extern unsigned char JumpThreadingID; +extern unsigned char LICMID; +extern unsigned char LoopDeletionID; +extern unsigned char LoopIdiomID; +extern unsigned char LoopRotateID; +extern unsigned char LoopUnrollID; +extern unsigned char LoopUnswitchID; +extern unsigned char MemCpyOptID; +extern unsigned char PruneEHID; +extern unsigned char ReassociateID; +extern unsigned char SCCPID; +extern unsigned char ScalarReplAggregatesID; +extern unsigned char SimplifyLibCallsID; +extern unsigned char StripDeadPrototypesID; +extern unsigned char TailCallEliminationID; +extern unsigned char TypeBasedAliasAnalysisID; +} + +/// StandardPass - The class responsible for maintaining the lists of standard +class StandardPass { + friend class RegisterStandardPassLists; + public: + /// Predefined standard sets of passes + enum StandardSet { + AliasAnalysis, + Function, + Module, + LTO + }; + /// Flags to specify whether a pass should be enabled. Passes registered + /// with the standard sets may specify a minimum optimization level and one + /// or more flags that must be set when constructing the set for the pass to + /// be used. + enum OptimizationFlags { + /// Optimize for size was requested. + OptimizeSize = 1<<0, + /// Allow passes which may make global module changes. + UnitAtATime = 1<<1, + /// UnrollLoops - Allow loop unrolling. + UnrollLoops = 1<<2, + /// Allow library calls to be simplified. + SimplifyLibCalls = 1<<3, + /// Whether the module may have code using exceptions. + HaveExceptions = 1<<4, + // Run an inliner pass as part of this set. + RunInliner = 1<<5 + }; + enum OptimizationFlagComponents { + /// The low bits are used to store the optimization level. When requesting + /// passes, this should store the requested optimisation level. When + /// setting passes, this should set the minimum optimization level at which + /// the pass will run. + OptimizationLevelMask=0xf, + /// The maximum optimisation level at which the pass is run. + MaxOptimizationLevelMask=0xf0, + // Flags that must be set + RequiredFlagMask=0xff00, + // Flags that may not be set. + DisallowedFlagMask=0xff0000, + MaxOptimizationLevelShift=4, + RequiredFlagShift=8, + DisallowedFlagShift=16 + }; + /// Returns the optimisation level from a set of flags. + static unsigned OptimizationLevel(unsigned flags) { + return flags & OptimizationLevelMask; + } + /// Returns the maximum optimization level for this set of flags + static unsigned MaxOptimizationLevel(unsigned flags) { + return (flags & MaxOptimizationLevelMask) >> 4; + } + /// Constructs a set of flags from the specified minimum and maximum + /// optimisation level + static unsigned OptimzationFlags(unsigned minLevel=0, unsigned maxLevel=0xf, + unsigned requiredFlags=0, unsigned disallowedFlags=0) { + return ((minLevel & OptimizationLevelMask) | + ((maxLevel<> RequiredFlagShift; + } + /// Returns the flags that must not be set for this to match + static unsigned DisallowedFlags(unsigned flags) { + return (flags & DisallowedFlagMask) >> DisallowedFlagShift; + } + /// Register a standard pass in the specified set. If flags is non-zero, + /// then the pass will only be returned when the specified flags are set. + template + class RegisterStandardPass { + public: + RegisterStandardPass(StandardSet set, unsigned char *runBefore=0, + unsigned flags=0, unsigned char *ID=0) { + // Use the pass's ID if one is not specified + RegisterDefaultPass(PassInfo::NormalCtor_t(callDefaultCtor), + ID ? ID : (unsigned char*)&passName::ID, runBefore, set, flags); + } + }; + /// Adds the passes from the specified set to the provided pass manager + static void AddPassesFromSet(PassManagerBase *PM, + StandardSet set, + unsigned flags=0, + bool VerifyEach=false, + Pass *inliner=0); + private: + /// Registers the default passes. This is set by RegisterStandardPassLists + /// and is called lazily. + static void (*RegisterDefaultPasses)(void); + /// Creates the verifier pass that is inserted when a VerifyEach is passed to + /// AddPassesFromSet() + static Pass* (*CreateVerifierPass)(void); + /// Registers the pass + static void RegisterDefaultPass(PassInfo::NormalCtor_t constructor, + unsigned char *newPass, + unsigned char *oldPass, + StandardSet set, + unsigned flags=0); +}; + +} // namespace llvm + +#endif Added: user/gabor/tre-integration/contrib/llvm/include/llvm/MC/MCWin64EH.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gabor/tre-integration/contrib/llvm/include/llvm/MC/MCWin64EH.h Thu Jun 23 00:04:06 2011 (r223453) @@ -0,0 +1,93 @@ +//===- MCWin64EH.h - Machine Code Win64 EH support --------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains declarations to support the Win64 Exception Handling +// scheme in MC. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_MC_MCWIN64EH_H +#define LLVM_MC_MCWIN64EH_H + +#include "llvm/Support/Win64EH.h" +#include +#include + +namespace llvm { + class StringRef; + class MCStreamer; + class MCSymbol; + + class MCWin64EHInstruction { + public: + typedef Win64EH::UnwindOpcodes OpType; + private: + OpType Operation; + MCSymbol *Label; + unsigned Offset; + unsigned Register; + public: + MCWin64EHInstruction(OpType Op, MCSymbol *L, unsigned Reg) + : Operation(Op), Label(L), Offset(0), Register(Reg) { + assert(Op == Win64EH::UOP_PushNonVol); + } + MCWin64EHInstruction(MCSymbol *L, unsigned Size) + : Operation(Size>128 ? Win64EH::UOP_AllocLarge : Win64EH::UOP_AllocSmall), + Label(L), Offset(Size) { } + MCWin64EHInstruction(OpType Op, MCSymbol *L, unsigned Reg, unsigned Off) + : Operation(Op), Label(L), Offset(Off), Register(Reg) { + assert(Op == Win64EH::UOP_SetFPReg || + Op == Win64EH::UOP_SaveNonVol || + Op == Win64EH::UOP_SaveNonVolBig || + Op == Win64EH::UOP_SaveXMM128 || *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***