svn commit: r216817 - head/sys/ufs/ffs
Author: kib Date: Thu Dec 30 10:41:17 2010 New Revision: 216817 URL: http://svn.freebsd.org/changeset/base/216817 Log: In indir_trunc(), when processing jnewblk entries that are not written to the disk, recurse to handle indirect blocks of next level that are hidden by the corresponding entry. In collaboration with:pho Reviewed by: jeff, mckusick Tested by:mckusick, pho Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c == --- head/sys/ufs/ffs/ffs_softdep.c Thu Dec 30 09:46:45 2010 (r216816) +++ head/sys/ufs/ffs/ffs_softdep.c Thu Dec 30 10:41:17 2010 (r216817) @@ -6140,17 +6140,20 @@ indir_trunc(freework, dbn, lbn) ufs1fmt = 0; bap2 = (ufs2_daddr_t *)bp->b_data; } + + if (needj) + freework->fw_ref += NINDIR(fs) + 1; + /* * Reclaim indirect blocks which never made it to disk. */ cnt = 0; LIST_FOREACH_SAFE(wk, &wkhd, wk_list, wkn) { - struct workhead freewk; if (wk->wk_type != D_JNEWBLK) continue; - WORKLIST_REMOVE_UNLOCKED(wk); - LIST_INIT(&freewk); - WORKLIST_INSERT_UNLOCKED(&freewk, wk); + ACQUIRE_LOCK(&lk); + WORKLIST_REMOVE(wk); + FREE_LOCK(&lk); jnewblk = WK_JNEWBLK(wk); if (jnewblk->jn_lbn > 0) i = (jnewblk->jn_lbn - -lbn) / lbnadd; @@ -6158,8 +6161,8 @@ indir_trunc(freework, dbn, lbn) i = (-(jnewblk->jn_lbn + level - 1) - -(lbn + level)) / lbnadd; KASSERT(i >= 0 && i < NINDIR(fs), - ("indir_trunc: Index out of range %d parent %jd lbn %jd", - i, lbn, jnewblk->jn_lbn)); + ("indir_trunc: Index out of range %d parent %jd lbn %jd level %d", + i, lbn, jnewblk->jn_lbn, level)); /* Clear the pointer so it isn't found below. */ if (ufs1fmt) { nb = bap1[i]; @@ -6171,13 +6174,29 @@ indir_trunc(freework, dbn, lbn) KASSERT(nb == jnewblk->jn_blkno, ("indir_trunc: Block mismatch %jd != %jd", nb, jnewblk->jn_blkno)); - ffs_blkfree(ump, fs, freeblks->fb_devvp, jnewblk->jn_blkno, - fs->fs_bsize, freeblks->fb_previousinum, &freewk); + if (level != 0) { + ufs_lbn_t nlbn; + + nlbn = (lbn + 1) - (i * lbnadd); + nfreework = newfreework(freeblks, freework, + nlbn, nb, fs->fs_frag, 0); + WORKLIST_INSERT_UNLOCKED(&nfreework->fw_jwork, wk); + freedeps++; + indir_trunc(nfreework, fsbtodb(fs, nb), nlbn); + } else { + struct workhead freewk; + + LIST_INIT(&freewk); + ACQUIRE_LOCK(&lk); + WORKLIST_INSERT(&freewk, wk); + FREE_LOCK(&lk); + ffs_blkfree(ump, fs, freeblks->fb_devvp, + jnewblk->jn_blkno, fs->fs_bsize, + freeblks->fb_previousinum, &freewk); + } cnt++; } ACQUIRE_LOCK(&lk); - if (needj) - freework->fw_ref += NINDIR(fs) + 1; /* Any remaining journal work can be completed with freeblks. */ jwork_move(&freeblks->fb_jwork, &wkhd); FREE_LOCK(&lk); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r216818 - in head/sys/ufs: ffs ufs
Author: kib Date: Thu Dec 30 10:52:07 2010 New Revision: 216818 URL: http://svn.freebsd.org/changeset/base/216818 Log: Handle missing jremrefs when a directory is renamed overtop of another, deleting it. If the directory is removed, UFS always need to remove the .. ref, even if the ultimate ref on the parent would not change. The new directory must have a new journal entry for that ref. Otherwise journal processing would not properly account for the parent's reference since it will belong to a removed directory entry. Change ufs_rename()'s dotdot rename section to always setup_dotdot_link(). In the tip != NULL case SUJ needs the newref dependency allocated via setup_dotdot_link(). Stop setting isrmdir to 2 for newdirrem() in softdep_setup_remove(). Remove the isdirrem > 1 checks from newdirrem(). Reported by: many Submitted by: jeff Tested by:pho Modified: head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ffs/ffs_softdep.c == --- head/sys/ufs/ffs/ffs_softdep.c Thu Dec 30 10:41:17 2010 (r216817) +++ head/sys/ufs/ffs/ffs_softdep.c Thu Dec 30 10:52:07 2010 (r216818) @@ -6918,7 +6918,7 @@ softdep_setup_remove(bp, dp, ip, isrmdir * newdirrem() to setup the full directory remove which requires * isrmdir > 1. */ - dirrem = newdirrem(bp, dp, ip, isrmdir?2:0, &prevdirrem); + dirrem = newdirrem(bp, dp, ip, isrmdir, &prevdirrem); /* * Add the dirrem to the inodedep's pending remove list for quick * discovery later. @@ -7152,14 +7152,12 @@ newdirrem(bp, dp, ip, isrmdir, prevdirre ip->i_effnlink + 2); dotremref = newjremref(dirrem, ip, ip, DOT_OFFSET, ip->i_effnlink + 1); - } else - jremref = newjremref(dirrem, dp, ip, dp->i_offset, - ip->i_effnlink + 1); - if (isrmdir > 1) { dotdotremref = newjremref(dirrem, ip, dp, DOTDOT_OFFSET, dp->i_effnlink + 1); dotdotremref->jr_state |= MKDIR_PARENT; - } + } else + jremref = newjremref(dirrem, dp, ip, dp->i_offset, + ip->i_effnlink + 1); } ACQUIRE_LOCK(&lk); lbn = lblkno(dp->i_fs, dp->i_offset); @@ -7184,7 +7182,7 @@ newdirrem(bp, dp, ip, isrmdir, prevdirre * cancel it. Any pending journal work will be added to the dirrem * to be completed when the workitem remove completes. */ - if (isrmdir > 1) + if (isrmdir) dotdotremref = cancel_diradd_dotdot(ip, dirrem, dotdotremref); /* * Check for a diradd dependency for the same directory entry. Modified: head/sys/ufs/ufs/ufs_vnops.c == --- head/sys/ufs/ufs/ufs_vnops.cThu Dec 30 10:41:17 2010 (r216817) +++ head/sys/ufs/ufs/ufs_vnops.cThu Dec 30 10:52:07 2010 (r216818) @@ -1497,7 +1497,9 @@ relock: /* Don't go to bad here as the new link exists. */ if (error) goto unlockout; - } + } else if (DOINGSUJ(tdvp)) + /* Journal must account for each new link. */ + softdep_setup_dotdot_link(tdp, fip); fip->i_offset = mastertemplate.dot_reclen; ufs_dirrewrite(fip, fdp, newparent, DT_DIR, 0); cache_purge(fdvp); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r216819 - head/tools/regression/bin/sh/expansion
Author: jilles Date: Thu Dec 30 15:04:59 2010 New Revision: 216819 URL: http://svn.freebsd.org/changeset/base/216819 Log: sh: Add two tests for special cases in command substitution that already work in stable/8. Added: head/tools/regression/bin/sh/expansion/cmdsubst8.0 (contents, props changed) head/tools/regression/bin/sh/expansion/cmdsubst9.0 (contents, props changed) Added: head/tools/regression/bin/sh/expansion/cmdsubst8.0 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/cmdsubst8.0 Thu Dec 30 15:04:59 2010(r216819) @@ -0,0 +1,17 @@ +# $FreeBSD$ +# Not required by POSIX (although referenced in a non-normative section), +# but possibly useful. + +: hi there & +p=$! +q=$(jobs -l $p) + +# Change tabs to spaces. +set -f +set -- $q +r="$*" + +case $r in +*" $p "*) ;; +*) echo Pid missing; exit 3 ;; +esac Added: head/tools/regression/bin/sh/expansion/cmdsubst9.0 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/cmdsubst9.0 Thu Dec 30 15:04:59 2010(r216819) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +set -e + +cd / +dummy=$(cd /bin) +[ "$(pwd)" = / ] + +v=1 +dummy=$(eval v=2) +[ "$v" = 1 ] ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r216820 - in head/share: examples/etc mk
Author: marius Date: Thu Dec 30 15:58:23 2010 New Revision: 216820 URL: http://svn.freebsd.org/changeset/base/216820 Log: - Add CPUTYPE support for sparc64. The net result is that it's now possible to let the compiler optimize for the famility of UltraSPARC-III CPUs as the default already was to optimize for UltraSPARC-I/II and generating generic 64-bit V9 is mainly for reference purposes. At least for SPARC64-V CPUs code optimized for UltraSPARC-I/II still is the most performant one. Thanks go to Michael Moll for testing SPARC64-V. - Move a booke MACHINE_CPU bit into the right section. Modified: head/share/examples/etc/make.conf head/share/mk/bsd.cpu.mk Modified: head/share/examples/etc/make.conf == --- head/share/examples/etc/make.conf Thu Dec 30 15:04:59 2010 (r216819) +++ head/share/examples/etc/make.conf Thu Dec 30 15:58:23 2010 (r216820) @@ -38,6 +38,8 @@ # (Via CPUs) c3 c3-2 # AMD64 architecture: opteron, athlon64, nocona, prescott, core2 # Intel ia64 architecture: itanium2, itanium +# SPARC-V9 architecture: v9 (generic 64-bit V9), ultrasparc (default +# if omitted), ultrasparc3 # # (?= allows to buildworld for a different CPUTYPE.) # Modified: head/share/mk/bsd.cpu.mk == --- head/share/mk/bsd.cpu.mkThu Dec 30 15:04:59 2010(r216819) +++ head/share/mk/bsd.cpu.mkThu Dec 30 15:58:23 2010(r216820) @@ -15,6 +15,7 @@ MACHINE_CPU = itanium . elif ${MACHINE_CPUARCH} == "powerpc" MACHINE_CPU = aim . elif ${MACHINE_CPUARCH} == "sparc64" +MACHINE_CPU = ultrasparc . elif ${MACHINE_CPUARCH} == "arm" MACHINE_CPU = arm . elif ${MACHINE_CPUARCH} == "mips" @@ -58,6 +59,12 @@ CPUTYPE = athlon . if ${CPUTYPE} == "prescott" || ${CPUTYPE} == "core2" CPUTYPE = nocona . endif +. elif ${MACHINE_ARCH} == "sparc64" +. if ${CPUTYPE} == "us" +CPUTYPE = ultrasparc +. elif ${CPUTYPE} == "us3" +CPUTYPE = ultrasparc3 +. endif . endif ### @@ -116,7 +123,6 @@ _CPUCFLAGS = -mcpu=${CPUTYPE} . endif . elif ${MACHINE_ARCH} == "powerpc" . if ${CPUTYPE} == "e500" -MACHINE_CPU = booke _CPUCFLAGS = -Wa,-me500 -msoft-float . else _CPUCFLAGS = -mcpu=${CPUTYPE} -mno-powerpc64 @@ -137,6 +143,14 @@ _CPUCFLAGS = -march=4kc . elif ${CPUTYPE} == "mips24kc" _CPUCFLAGS = -march=24kc . endif +. elif ${MACHINE_ARCH} == "sparc64" +. if ${CPUTYPE} == "v9" +_CPUCFLAGS = -mcpu=v9 +. elif ${CPUTYPE} == "ultrasparc" +_CPUCFLAGS = -mcpu=ultrasparc +. elif ${CPUTYPE} == "ultrasparc3" +_CPUCFLAGS = -mcpu=ultrasparc3 +. endif . endif # Set up the list of CPU features based on the CPU type. This is an @@ -193,10 +207,22 @@ MACHINE_CPU += amd64 sse2 sse mmx . if ${CPUTYPE} == "itanium" MACHINE_CPU = itanium . endif +. elif ${MACHINE_ARCH} == "powerpc" +. if ${CPUTYPE} == "e500" +MACHINE_CPU = booke +. endif +. elif ${MACHINE_ARCH} == "sparc64" +. if ${CPUTYPE} == "v9" +MACHINE_CPU = v9 +. elif ${CPUTYPE} == "ultrasparc" +MACHINE_CPU = v9 ultrasparc +. elif ${CPUTYPE} == "ultrasparc3" +MACHINE_CPU = v9 ultrasparc ultrasparc3 +. endif . endif .endif -.if ${MACHINE_CPUARCH} == "mips" +.if ${MACHINE_CPUARCH} == "mips" CFLAGS += -G0 .endif ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r216821 - head/sys/netinet
Author: tuexen Date: Thu Dec 30 16:23:13 2010 New Revision: 216821 URL: http://svn.freebsd.org/changeset/base/216821 Log: Fix three bugs related to the sequence number wrap-around affecting the processing of ECNE and ASCONF chunks. Reviewed by: rrs MFC after: 3 days. Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_asconf.c == --- head/sys/netinet/sctp_asconf.c Thu Dec 30 15:58:23 2010 (r216820) +++ head/sys/netinet/sctp_asconf.c Thu Dec 30 16:23:13 2010 (r216821) @@ -632,7 +632,7 @@ sctp_handle_asconf(struct mbuf *m, unsig asoc = &stcb->asoc; serial_num = ntohl(cp->serial_number); - if (compare_with_wrap(asoc->asconf_seq_in, serial_num, MAX_SEQ) || + if (compare_with_wrap(asoc->asconf_seq_in, serial_num, MAX_TSN) || serial_num == asoc->asconf_seq_in) { /* got a duplicate ASCONF */ SCTPDBG(SCTP_DEBUG_ASCONF1, Modified: head/sys/netinet/sctp_input.c == --- head/sys/netinet/sctp_input.c Thu Dec 30 15:58:23 2010 (r216820) +++ head/sys/netinet/sctp_input.c Thu Dec 30 16:23:13 2010 (r216821) @@ -2944,7 +2944,7 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch net = lchk->whoTo; break; } - if (compare_with_wrap(lchk->rec.data.TSN_seq, tsn, MAX_SEQ)) + if (compare_with_wrap(lchk->rec.data.TSN_seq, tsn, MAX_TSN)) break; lchk = TAILQ_NEXT(lchk, sctp_next); } Modified: head/sys/netinet/sctp_output.c == --- head/sys/netinet/sctp_output.c Thu Dec 30 15:58:23 2010 (r216820) +++ head/sys/netinet/sctp_output.c Thu Dec 30 16:23:13 2010 (r216821) @@ -6477,7 +6477,7 @@ sctp_toss_old_asconf(struct sctp_tcb *st if (chk->rec.chunk_id.id == SCTP_ASCONF) { if (chk->data) { acp = mtod(chk->data, struct sctp_asconf_chunk *); - if (compare_with_wrap(ntohl(acp->serial_number), stcb->asoc.asconf_seq_out_acked, MAX_SEQ)) { + if (compare_with_wrap(ntohl(acp->serial_number), stcb->asoc.asconf_seq_out_acked, MAX_TSN)) { /* Not Acked yet */ break; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r216822 - head/sys/netinet
Author: tuexen Date: Thu Dec 30 16:56:20 2010 New Revision: 216822 URL: http://svn.freebsd.org/changeset/base/216822 Log: Code cleanup: Use LIST_FOREACH, LIST_FOREACH_SAFE, TAILQ_FOREACH, TAILQ_FOREACH_SAFE where appropriate. No functional change. MFC after: 3 months. Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_bsd_addr.c head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_timer.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_asconf.c == --- head/sys/netinet/sctp_asconf.c Thu Dec 30 16:23:13 2010 (r216821) +++ head/sys/netinet/sctp_asconf.c Thu Dec 30 16:56:20 2010 (r216822) @@ -656,19 +656,16 @@ sctp_handle_asconf(struct mbuf *m, unsig /* delete old cache */ SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: Now processing firstASCONF. Try to delte old cache\n"); - ack = TAILQ_FIRST(&stcb->asoc.asconf_ack_sent); - while (ack != NULL) { - ack_next = TAILQ_NEXT(ack, next); + TAILQ_FOREACH_SAFE(ack, &asoc->asconf_ack_sent, next, ack_next) { if (ack->serial_number == serial_num) break; SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: delete old(%u) < first(%u)\n", ack->serial_number, serial_num); - TAILQ_REMOVE(&stcb->asoc.asconf_ack_sent, ack, next); + TAILQ_REMOVE(&asoc->asconf_ack_sent, ack, next); if (ack->data != NULL) { sctp_m_freem(ack->data); } SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_asconf_ack), ack); - ack = ack_next; } } m_ack = sctp_get_mbuf_for_msg(sizeof(struct sctp_asconf_ack_chunk), 0, @@ -1264,9 +1261,7 @@ sctp_asconf_queue_mgmt(struct sctp_tcb * struct sockaddr *sa; /* make sure the request isn't already in the queue */ - for (aa = TAILQ_FIRST(&stcb->asoc.asconf_queue); aa != NULL; - aa = aa_next) { - aa_next = TAILQ_NEXT(aa, next); + TAILQ_FOREACH_SAFE(aa, &stcb->asoc.asconf_queue, next, aa_next) { /* address match? */ if (sctp_asconf_addr_match(aa, &ifa->address.sa) == 0) continue; @@ -1480,9 +1475,7 @@ sctp_asconf_queue_sa_delete(struct sctp_ return (-1); } /* make sure the request isn't already in the queue */ - for (aa = TAILQ_FIRST(&stcb->asoc.asconf_queue); aa != NULL; - aa = aa_next) { - aa_next = TAILQ_NEXT(aa, next); + TAILQ_FOREACH_SAFE(aa, &stcb->asoc.asconf_queue, next, aa_next) { /* address match? */ if (sctp_asconf_addr_match(aa, sa) == 0) continue; @@ -1836,9 +1829,7 @@ sctp_handle_asconf_ack(struct mbuf *m, i */ if (last_error_id == 0) last_error_id--;/* set to "max" value */ - for (aa = TAILQ_FIRST(&stcb->asoc.asconf_queue); aa != NULL; - aa = aa_next) { - aa_next = TAILQ_NEXT(aa, next); + TAILQ_FOREACH_SAFE(aa, &stcb->asoc.asconf_queue, next, aa_next) { if (aa->sent == 1) { /* * implicitly successful or failed if correlation_id @@ -2098,14 +2089,11 @@ sctp_asconf_iterator_ep_end(struct sctp_ } } } else if (l->action == SCTP_DEL_IP_ADDRESS) { - laddr = LIST_FIRST(&inp->sctp_addr_list); - while (laddr) { - nladdr = LIST_NEXT(laddr, sctp_nxt_addr); + LIST_FOREACH_SAFE(laddr, &inp->sctp_addr_list, sctp_nxt_addr, nladdr) { /* remove only after all guys are done */ if (laddr->ifa == ifa) { sctp_del_local_addr_ep(inp, ifa); } - laddr = nladdr; } } } @@ -2285,12 +2273,10 @@ sctp_asconf_iterator_end(void *ptr, uint { struct sctp_asconf_iterator *asc; struct sctp_ifa *ifa; - struct sctp_laddr *l, *l_next; + struct sctp_laddr *l, *nl; asc = (struct sctp_asconf_iterator *)ptr; - l = LIST_FIRST(&asc->list_of_work); - while (l != NULL) { - l_next = LIST_NEXT(l, sctp_nxt_addr); + LIST_FOREACH_SAFE(l, &asc->list_of_work, sctp_nxt_addr, nl) { ifa = l->ifa; if (l->a
svn commit: r216823 - head/sbin/shutdown
Author: pjd Date: Thu Dec 30 18:06:31 2010 New Revision: 216823 URL: http://svn.freebsd.org/changeset/base/216823 Log: For compatibility with Linux and Solaris add poweroff(8). It is implemented as a hard link to shutdown(8) and it is equivalent of: # shutdown -p now While I'm here put one line of usage into one line of C code so it is easier to grep(1) and separate unrelated code with empty line. MFC after:2 weeks Modified: head/sbin/shutdown/Makefile head/sbin/shutdown/shutdown.8 head/sbin/shutdown/shutdown.c Modified: head/sbin/shutdown/Makefile == --- head/sbin/shutdown/Makefile Thu Dec 30 16:56:20 2010(r216822) +++ head/sbin/shutdown/Makefile Thu Dec 30 18:06:31 2010(r216823) @@ -3,6 +3,8 @@ PROG= shutdown MAN= shutdown.8 +LINKS= ${BINDIR}/shutdown ${BINDIR}/poweroff +MLINKS=shutdown.8 poweroff.8 BINOWN=root BINGRP=operator Modified: head/sbin/shutdown/shutdown.8 == --- head/sbin/shutdown/shutdown.8 Thu Dec 30 16:56:20 2010 (r216822) +++ head/sbin/shutdown/shutdown.8 Thu Dec 30 18:06:31 2010 (r216823) @@ -28,11 +28,12 @@ .\" @(#)shutdown.8 8.2 (Berkeley) 4/27/95 .\" $FreeBSD$ .\" -.Dd December 23, 2008 +.Dd December 30, 2010 .Dt SHUTDOWN 8 .Os .Sh NAME -.Nm shutdown +.Nm shutdown , +.Nm poweroff .Nd "close down the system at a given time" .Sh SYNOPSIS .Nm @@ -47,6 +48,7 @@ .Oc .Ar time .Op Ar warning-message ... +.Nm poweroff .Sh DESCRIPTION The .Nm @@ -173,6 +175,13 @@ When run without options, the utility will place the system into single user mode at the .Ar time specified. +.Pp +Calling utility as +.Nm poweroff +is equivalent of calling: +.Bd -literal -offset indent +shutdown -p now +.Ed .Sh FILES .Bl -tag -width /var/run/nologin -compact .It Pa /var/run/nologin Modified: head/sbin/shutdown/shutdown.c == --- head/sbin/shutdown/shutdown.c Thu Dec 30 16:56:20 2010 (r216822) +++ head/sbin/shutdown/shutdown.c Thu Dec 30 18:06:31 2010 (r216823) @@ -115,8 +115,31 @@ main(int argc, char **argv) if (geteuid()) errx(1, "NOT super-user"); #endif + nosync = NULL; readstdin = 0; + + /* +* Test for the special case where the utility is called as +* "poweroff", for which it runs 'shutdown -p now'. +*/ + if ((p = rindex(argv[0], '/')) == NULL) + p = argv[0]; + else + ++p; + if (strcmp(p, "poweroff") == 0) { + if (getopt(argc, argv, "") != -1) + usage((char *)NULL); + argc -= optind; + argv += optind; + if (argc != 0) + usage((char *)NULL); + dopower = 1; + offset = 0; + (void)time(&shuttime); + goto poweroff; + } + while ((ch = getopt(argc, argv, "-hknopr")) != -1) switch (ch) { case '-': @@ -161,6 +184,7 @@ main(int argc, char **argv) getoffset(*argv++); +poweroff: if (*argv) { for (p = mbuf, len = sizeof(mbuf); *argv; ++argv) { arglen = strlen(*argv); @@ -510,7 +534,7 @@ usage(const char *cp) if (cp != NULL) warnx("%s", cp); (void)fprintf(stderr, - "usage: shutdown [-] [-h | -p | -r | -k] [-o [-n]]" - " time [warning-message ...]\n"); + "usage: shutdown [-] [-h | -p | -r | -k] [-o [-n]] time [warning-message ...]\n" + " poweroff\n"); exit(1); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r216824 - head/sys/dev/wpi
Author: bschmidt Date: Thu Dec 30 18:29:22 2010 New Revision: 216824 URL: http://svn.freebsd.org/changeset/base/216824 Log: The RX path is missing a few bus_dmamap_*() calls, this results in modification of memory which was already free'd and eventually in: wpi0: could not map mbuf (error 12) wpi0: wpi_rx_intr: bus_dmamap_load failed, error 12 and an usuable device. PR: kern/144898 MFC after:3 days Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c == --- head/sys/dev/wpi/if_wpi.c Thu Dec 30 18:06:31 2010(r216823) +++ head/sys/dev/wpi/if_wpi.c Thu Dec 30 18:29:22 2010(r216824) @@ -1052,9 +1052,18 @@ wpi_free_rx_ring(struct wpi_softc *sc, s wpi_dma_contig_free(&ring->desc_dma); - for (i = 0; i < WPI_RX_RING_COUNT; i++) - if (ring->data[i].m != NULL) - m_freem(ring->data[i].m); + for (i = 0; i < WPI_RX_RING_COUNT; i++) { + struct wpi_rx_data *data = &ring->data[i]; + + if (data->m != NULL) { + bus_dmamap_sync(ring->data_dmat, data->map, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(ring->data_dmat, data->map); + m_freem(data->m); + } + if (data->map != NULL) + bus_dmamap_destroy(ring->data_dmat, data->map); + } } static int @@ -1461,6 +1470,7 @@ wpi_rx_intr(struct wpi_softc *sc, struct return; } + bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD); head = (struct wpi_rx_head *)((caddr_t)(stat + 1) + stat->len); tail = (struct wpi_rx_tail *)((caddr_t)(head + 1) + le16toh(head->len)); @@ -1491,6 +1501,8 @@ wpi_rx_intr(struct wpi_softc *sc, struct ifp->if_ierrors++; return; } + bus_dmamap_unload(ring->data_dmat, data->map); + error = bus_dmamap_load(ring->data_dmat, data->map, mtod(mnew, caddr_t), MJUMPAGESIZE, wpi_dma_map_addr, &paddr, BUS_DMA_NOWAIT); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r216825 - head/sys/netinet
Author: tuexen Date: Thu Dec 30 21:32:35 2010 New Revision: 216825 URL: http://svn.freebsd.org/changeset/base/216825 Log: Define and use SCTP_SSN_GE, SCTP_SSN_GT, SCTP_TSN_GE, SCTP_TSN_GT macros and use them instead of the generic compare_with_wrap. Retire compare_with_wrap. MFC after: 3 months. Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_timer.c Modified: head/sys/netinet/sctp_asconf.c == --- head/sys/netinet/sctp_asconf.c Thu Dec 30 18:29:22 2010 (r216824) +++ head/sys/netinet/sctp_asconf.c Thu Dec 30 21:32:35 2010 (r216825) @@ -632,8 +632,7 @@ sctp_handle_asconf(struct mbuf *m, unsig asoc = &stcb->asoc; serial_num = ntohl(cp->serial_number); - if (compare_with_wrap(asoc->asconf_seq_in, serial_num, MAX_TSN) || - serial_num == asoc->asconf_seq_in) { + if (SCTP_TSN_GE(asoc->asconf_seq_in, serial_num)) { /* got a duplicate ASCONF */ SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: got duplicate serial number = %xh\n", Modified: head/sys/netinet/sctp_constants.h == --- head/sys/netinet/sctp_constants.h Thu Dec 30 18:29:22 2010 (r216824) +++ head/sys/netinet/sctp_constants.h Thu Dec 30 21:32:35 2010 (r216825) @@ -322,7 +322,6 @@ __FBSDID("$FreeBSD$"); #define SCTP_VERSION_NUMBER0x3 #define MAX_TSN0x -#define MAX_SEQ0x /* how many executions every N tick's */ #define SCTP_ITERATOR_MAX_AT_ONCE 20 @@ -906,10 +905,13 @@ __FBSDID("$FreeBSD$"); #define SCTP_MAX_DATA_BUNDLING 256 /* modular comparison */ -/* True if a > b (mod = M) */ -#define compare_with_wrap(a, b, M) (((a > b) && ((a - b) < ((M >> 1) + 1))) || \ - ((b > a) && ((b - a) > ((M >> 1) + 1 - +/* See RFC 1982 for details. */ +#define SCTP_SSN_GT(a, b) (((a < b) && ((b - a) > (1<<15))) || \ + ((a > b) && ((a - b) < (1<<15 +#define SCTP_SSN_GE(a, b) (SCTP_SSN_GT(a, b) || (a == b)) +#define SCTP_TSN_GT(a, b) (((a < b) && ((b - a) > (1<<31))) || \ + ((a > b) && ((a - b) < (1<<31 +#define SCTP_TSN_GE(a, b) (SCTP_TSN_GT(a, b) || (a == b)) /* Mapping array manipulation routines */ #define SCTP_IS_TSN_PRESENT(arry, gap) ((arry[(gap >> 3)] >> (gap & 0x07)) & 0x01) Modified: head/sys/netinet/sctp_indata.c == --- head/sys/netinet/sctp_indata.c Thu Dec 30 18:29:22 2010 (r216824) +++ head/sys/netinet/sctp_indata.c Thu Dec 30 21:32:35 2010 (r216825) @@ -298,7 +298,7 @@ sctp_mark_non_revokable(struct sctp_asso return; } cumackp1 = asoc->cumulative_tsn + 1; - if (compare_with_wrap(cumackp1, tsn, MAX_TSN)) { + if (SCTP_TSN_GT(cumackp1, tsn)) { /* * this tsn is behind the cum ack and thus we don't need to * worry about it being moved from one to the other. @@ -315,13 +315,12 @@ sctp_mark_non_revokable(struct sctp_asso } SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); SCTP_UNSET_TSN_PRESENT(asoc->mapping_array, gap); - if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { asoc->highest_tsn_inside_nr_map = tsn; } if (tsn == asoc->highest_tsn_inside_map) { /* We must back down to see what the new highest is */ - for (i = tsn - 1; (compare_with_wrap(i, asoc->mapping_array_base_tsn, MAX_TSN) || - (i == asoc->mapping_array_base_tsn)); i--) { + for (i = tsn - 1; SCTP_TSN_GE(i, asoc->mapping_array_base_tsn); i--) { SCTP_CALC_TSN_TO_GAP(gap, i, asoc->mapping_array_base_tsn); if (SCTP_IS_TSN_PRESENT(asoc->mapping_array, gap)) { asoc->highest_tsn_inside_map = i; @@ -558,9 +557,7 @@ sctp_queue_data_to_stream(struct sctp_tc (uint32_t) control->sinfo_stream, (uint32_t) strm->last_sequence_delivered, (uint32_t) nxt_todel); - if (compare_with_wrap(strm->last_sequence_delivered, - control->sinfo_ssn, MAX_SEQ) || - (strm->last_sequence_delivered == control->sinfo_ssn)) { + if (SCTP_SSN_GE(strm->last_sequence_delivered, control->sinfo_ssn)) { /* The incoming sseq is behind where we last delivered? */ SCTPDBG(SCTP_DEBUG_INDATA1, "Duplicate S-SEQ:%d delivered:%d from peer, Abort association\n",
svn commit: r216826 - in head: bin/sh tools/regression/bin/sh/expansion
Author: jilles Date: Thu Dec 30 22:33:55 2010 New Revision: 216826 URL: http://svn.freebsd.org/changeset/base/216826 Log: sh: Avoid side effects from builtins in optimized command substitution. Change the criterion for builtins to be safe to execute in the same process in optimized command substitution from a blacklist of only cd, . and eval to a whitelist. This avoids clobbering the main shell environment such as by $(exit 4) and $(set -x). The builtins jobid, jobs, times and trap can still show information not available in a child process; this is deliberately permitted. (Changing traps is not.) For some builtins, whether they are safe depends on the arguments passed to them. Some of these are always considered unsafe to keep things simple; this only harms efficiency a little in the rare case they are used alone in a command substitution. Added: head/tools/regression/bin/sh/expansion/cmdsubst10.0 (contents, props changed) Modified: head/bin/sh/eval.c Modified: head/bin/sh/eval.c == --- head/bin/sh/eval.c Thu Dec 30 21:32:35 2010(r216825) +++ head/bin/sh/eval.c Thu Dec 30 22:33:55 2010(r216826) @@ -643,7 +643,31 @@ out: result->fd, result->buf, result->nleft, result->jp)); } - +/* + * Check if a builtin can safely be executed in the same process, + * even though it should be in a subshell (command substitution). + * Note that jobid, jobs, times and trap can show information not + * available in a child process; this is deliberate. + * The arguments should already have been expanded. + */ +static int +safe_builtin(int idx, int argc, char **argv) +{ + if (idx == BLTINCMD || idx == COMMANDCMD || idx == ECHOCMD || + idx == FALSECMD || idx == JOBIDCMD || idx == JOBSCMD || + idx == KILLCMD || idx == PRINTFCMD || idx == PWDCMD || + idx == TESTCMD || idx == TIMESCMD || idx == TRUECMD || + idx == TYPECMD) + return (1); + if (idx == EXPORTCMD || idx == TRAPCMD || idx == ULIMITCMD || + idx == UMASKCMD) + return (argc <= 1 || (argc == 2 && argv[1][0] == '-')); + if (idx == SETCMD) + return (argc <= 1 || (argc == 2 && (argv[1][0] == '-' || + argv[1][0] == '+') && argv[1][1] == 'o' && + argv[1][2] == '\0')); + return (0); +} /* * Execute a simple command. @@ -861,10 +885,8 @@ evalcommand(union node *cmd, int flags, || ((cmdentry.cmdtype == CMDNORMAL || cmdentry.cmdtype == CMDUNKNOWN) && ((flags & EV_EXIT) == 0 || have_traps())) || ((flags & EV_BACKCMD) != 0 - && (cmdentry.cmdtype != CMDBUILTIN -|| cmdentry.u.index == CDCMD -|| cmdentry.u.index == DOTCMD -|| cmdentry.u.index == EVALCMD))) { + && (cmdentry.cmdtype != CMDBUILTIN || +!safe_builtin(cmdentry.u.index, argc, argv { jp = makejob(cmd, 1); mode = cmd->ncmd.backgnd; if (flags & EV_BACKCMD) { Added: head/tools/regression/bin/sh/expansion/cmdsubst10.0 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/cmdsubst10.0 Thu Dec 30 22:33:55 2010(r216826) @@ -0,0 +1,51 @@ +# $FreeBSD$ + +a1=$(alias) +: $(alias testalias=abcd) +a2=$(alias) +[ "$a1" = "$a2" ] || echo Error at line $LINENO + +alias testalias2=abcd +a1=$(alias) +: $(unalias testalias2) +a2=$(alias) +[ "$a1" = "$a2" ] || echo Error at line $LINENO + +[ "$(command -V pwd)" = "$(command -V pwd; exit $?)" ] || echo Error at line $LINENO + +v=1 +: $(export v=2) +[ "$v" = 1 ] || echo Error at line $LINENO + +rotest=1 +: $(readonly rotest=2) +[ "$rotest" = 1 ] || echo Error at line $LINENO + +set +u +: $(set -u) +case $- in +*u*) echo Error at line $LINENO ;; +esac +set +u + +set +u +: $(set -o nounset) +case $- in +*u*) echo Error at line $LINENO ;; +esac +set +u + +set +u +: $(command set -u) +case $- in +*u*) echo Error at line $LINENO ;; +esac +set +u + +umask 77 +u1=$(umask) +: $(umask 022) +u2=$(umask) +[ "$u1" = "$u2" ] || echo Error at line $LINENO + +dummy=$(exit 3); [ $? -eq 3 ] || echo Error at line $LINENO ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r216828 - in head/sys: conf dev/mii modules/mii
Author: yongari Date: Thu Dec 30 23:50:25 2010 New Revision: 216828 URL: http://svn.freebsd.org/changeset/base/216828 Log: Add RDC Semiconductor R6040 10/100 PHY driver. Added: head/sys/dev/mii/rdcphy.c (contents, props changed) head/sys/dev/mii/rdcphyreg.h (contents, props changed) Modified: head/sys/conf/NOTES head/sys/conf/files head/sys/dev/mii/miidevs head/sys/modules/mii/Makefile Modified: head/sys/conf/NOTES == --- head/sys/conf/NOTES Thu Dec 30 23:35:23 2010(r216827) +++ head/sys/conf/NOTES Thu Dec 30 23:50:25 2010(r216828) @@ -1870,6 +1870,7 @@ devicensphy # NatSemi DP83840A device nsphyter# NatSemi DP83843/DP83815 device pnaphy # HomePNA device qsphy # Quality Semiconductor QS6612 +device rdcphy # RDC Semiconductor R6040 device rgephy # RealTek 8169S/8110S/8211B/8211C device rlphy # RealTek 8139 device rlswitch# RealTek 8305 Modified: head/sys/conf/files == --- head/sys/conf/files Thu Dec 30 23:35:23 2010(r216827) +++ head/sys/conf/files Thu Dec 30 23:50:25 2010(r216828) @@ -1324,6 +1324,7 @@ dev/mii/nsphy.c optional miibus | nsph dev/mii/nsphyter.c optional miibus | nsphyter dev/mii/pnaphy.c optional miibus | pnaphy dev/mii/qsphy.coptional miibus | qsphy +dev/mii/rdcphy.c optional miibus | rdcphy dev/mii/rgephy.c optional miibus | rgephy dev/mii/rlphy.coptional miibus | rlphy dev/mii/rlswitch.c optional rlswitch Modified: head/sys/dev/mii/miidevs == --- head/sys/dev/mii/miidevsThu Dec 30 23:35:23 2010(r216827) +++ head/sys/dev/mii/miidevsThu Dec 30 23:50:25 2010(r216828) @@ -59,6 +59,7 @@ oui JMICRON 0x001b8cJMicron Technolog oui LEVEL1 0x00207bLevel 1 oui NATSEMI0x080017National Semiconductor oui QUALSEMI 0x006051Quality Semiconductor +oui RDC0x000bb4RDC Semiconductor oui REALTEK0x20RealTek Semicondctor oui SEEQ 0x00a07dSeeq oui SIS0x00e006Silicon Integrated Systems @@ -213,6 +214,9 @@ model NATSEMI DP83865 0x0007 DP83865 10 /* Quality Semiconductor PHYs */ model QUALSEMI QS6612 0x QS6612 10/100 media interface +/* RDC Semiconductor PHYs */ +model RDC R60400x0003 R6040 10/100 media interface + /* RealTek Semiconductor PHYs */ model REALTEK RTL8201L 0x0020 RTL8201L 10/100 media interface model xxREALTEK RTL8305SC 0x0005 RTL8305SC 10/100 802.1q switch Added: head/sys/dev/mii/rdcphy.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mii/rdcphy.c Thu Dec 30 23:50:25 2010(r216828) @@ -0,0 +1,267 @@ +/*- + * Copyright (c) 2010, Pyun YongHyeon + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice unmodified, this list of conditions, and the following + *disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Driver for the RDC Semiconductor R6040 10/100 PHY. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#
svn commit: r216829 - in head/sys: boot/forth conf dev/vte i386/conf modules modules/vte
Author: yongari Date: Fri Dec 31 00:21:41 2010 New Revision: 216829 URL: http://svn.freebsd.org/changeset/base/216829 Log: Add driver for DM&P Vortex86 RDC R6040 Fast Ethernet. The controller is commonly found on DM&P Vortex86 x86 SoC. The driver supports all hardware features except flow control. The flow control was intentionally disabled due to silicon bug. DM&P Electronics, Inc. provided all necessary information including sample board to write driver and answered many questions I had. Many thanks for their support of FreeBSD. H/W donated by: DM&P Electronics, Inc. Added: head/sys/dev/vte/ head/sys/dev/vte/if_vte.c (contents, props changed) head/sys/dev/vte/if_vtereg.h (contents, props changed) head/sys/dev/vte/if_vtevar.h (contents, props changed) head/sys/modules/vte/ head/sys/modules/vte/Makefile (contents, props changed) Modified: head/sys/boot/forth/loader.conf head/sys/conf/NOTES head/sys/conf/files head/sys/i386/conf/GENERIC head/sys/modules/Makefile Modified: head/sys/boot/forth/loader.conf == --- head/sys/boot/forth/loader.conf Thu Dec 30 23:50:25 2010 (r216828) +++ head/sys/boot/forth/loader.conf Fri Dec 31 00:21:41 2010 (r216829) @@ -328,6 +328,7 @@ if_tl_load="NO" # Texas Instruments TN if_tx_load="NO"# SMC 83c17x Fast Ethernet if_txp_load="NO" # 3Com 3XP Typhoon/Sidewinder (3CR990) if_vge_load="NO" # VIA VT6122 PCI Gigabit Ethernet +if_vte_load="NO" # DM&P Vortex86 RDC R6040 Fast Ethernet if_uath_load="NO" # Atheros USB wireless for AR5005UG & AR5005UX if_udav_load="NO" # Davicom DM9601 USB Ethernet if_upgt_load="NO" # Conexant/Intersil PrismGT USB wireless Modified: head/sys/conf/NOTES == --- head/sys/conf/NOTES Thu Dec 30 23:50:25 2010(r216828) +++ head/sys/conf/NOTES Fri Dec 31 00:21:41 2010(r216829) @@ -1995,6 +1995,7 @@ devicexmphy # XaQti XMAC II # Technologies VT3043 `Rhine I' and VT86C100A `Rhine II' chips, # including the D-Link DFE520TX and D-Link DFE530TX (see 'rl' for # DFE530TX+), the Hawking Technologies PN102TX, and the AOpen/Acer ALN-320. +# vte: DM&P Vortex86 RDC R6040 Fast Ethernet # vx: 3Com 3C590 and 3C595 # wb: Support for fast ethernet adapters based on the Winbond W89C840F chip. # Note: this is not the same as the Winbond W89C940F, which is a @@ -2067,6 +2068,7 @@ devicestge# Sundance/Tamarack TC9021 device tl # Texas Instruments ThunderLAN device tx # SMC EtherPower II (83c170 ``EPIC'') device vr # VIA Rhine, Rhine II +device vte # DM&P Vortex86 RDC R6040 Fast Ethernet device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') Modified: head/sys/conf/files == --- head/sys/conf/files Thu Dec 30 23:50:25 2010(r216828) +++ head/sys/conf/files Fri Dec 31 00:21:41 2010(r216829) @@ -1876,6 +1876,7 @@ dev/utopia/utopia.c optional utopia dev/vge/if_vge.c optional vge dev/vkbd/vkbd.coptional vkbd dev/vr/if_vr.c optional vr pci +dev/vte/if_vte.c optional vte pci dev/vx/if_vx.c optional vx dev/vx/if_vx_eisa.coptional vx eisa dev/vx/if_vx_pci.c optional vx pci Added: head/sys/dev/vte/if_vte.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/vte/if_vte.c Fri Dec 31 00:21:41 2010(r216829) @@ -0,0 +1,2056 @@ +/*- + * Copyright (c) 2010, Pyun YongHyeon + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice unmodified, this list of conditions, and the following + *disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT
svn commit: r216830 - head/usr.sbin/sysinstall
Author: yongari Date: Fri Dec 31 00:24:08 2010 New Revision: 216830 URL: http://svn.freebsd.org/changeset/base/216830 Log: Add vte(4) to the list of supported network interface. Modified: head/usr.sbin/sysinstall/devices.c Modified: head/usr.sbin/sysinstall/devices.c == --- head/usr.sbin/sysinstall/devices.c Fri Dec 31 00:21:41 2010 (r216829) +++ head/usr.sbin/sysinstall/devices.c Fri Dec 31 00:24:08 2010 (r216830) @@ -169,6 +169,7 @@ static struct _devname { NETWORK("urtw","Realtek 8187L USB wireless adapter"), NETWORK("vge", "VIA VT612x PCI Gigabit Ethernet card"), NETWORK("vr", "VIA VT3043/VT86C100A Rhine PCI Ethernet card"), +NETWORK("vte", "DM&P Vortex86 RDC R6040 Fast Ethernet"), NETWORK("vlan","IEEE 802.1Q VLAN network interface"), NETWORK("vx", "3COM 3c590 / 3c595 Ethernet card"), NETWORK("wb", "Winbond W89C840F PCI Ethernet card"), ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r216831 - head/share/man/man4
Author: yongari Date: Fri Dec 31 00:46:30 2010 New Revision: 216831 URL: http://svn.freebsd.org/changeset/base/216831 Log: Add vte(4) man page and hook up vte(4) to the build. Also add Xr to appropriate man pages. Added: head/share/man/man4/vte.4 (contents, props changed) Modified: head/share/man/man4/Makefile head/share/man/man4/altq.4 head/share/man/man4/miibus.4 head/share/man/man4/vlan.4 Modified: head/share/man/man4/Makefile == --- head/share/man/man4/MakefileFri Dec 31 00:24:08 2010 (r216830) +++ head/share/man/man4/MakefileFri Dec 31 00:46:30 2010 (r216831) @@ -482,6 +482,7 @@ MAN=aac.4 \ vlan.4 \ vpo.4 \ vr.4 \ + vte.4 \ watchdog.4 \ wb.4 \ wi.4 \ Modified: head/share/man/man4/altq.4 == --- head/share/man/man4/altq.4 Fri Dec 31 00:24:08 2010(r216830) +++ head/share/man/man4/altq.4 Fri Dec 31 00:46:30 2010(r216831) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 19, 2010 +.Dd December 30, 2010 .Dt ALTQ 4 .Os .Sh NAME @@ -165,6 +165,7 @@ They have been applied to the following .Xr ural 4 , .Xr vge 4 , .Xr vr 4 , +.Xr vte 4 , .Xr wi 4 , and .Xr xl 4 . Modified: head/share/man/man4/miibus.4 == --- head/share/man/man4/miibus.4Fri Dec 31 00:24:08 2010 (r216830) +++ head/share/man/man4/miibus.4Fri Dec 31 00:46:30 2010 (r216831) @@ -8,7 +8,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 19, 2010 +.Dd December 30, 2010 .Dt MIIBUS 4 .Os .Sh NAME @@ -119,6 +119,8 @@ Davicom DM9601 USB Ethernet VIA VT612x PCI Gigabit Ethernet .It Xr vr 4 VIA Rhine, Rhine II +.It Xr vte 4 +DM&P Vortex86 RDC R6040 Fast Ethernet .It Xr wb 4 Winbond W89C840F .It Xr xl 4 @@ -173,6 +175,7 @@ but as a result are not well behaved new .Xr udav 4 , .Xr vge 4 , .Xr vr 4 , +.Xr vte 4 , .Xr wb 4 , .Xr xl 4 .Sh STANDARDS Modified: head/share/man/man4/vlan.4 == --- head/share/man/man4/vlan.4 Fri Dec 31 00:24:08 2010(r216830) +++ head/share/man/man4/vlan.4 Fri Dec 31 00:46:30 2010(r216831) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 19, 2010 +.Dd December 30, 2010 .Dt VLAN 4 .Os .Sh NAME @@ -184,6 +184,7 @@ natively: .Xr tl 4 , .Xr tx 4 , .Xr vr 4 , +.Xr vte 4 , and .Xr xl 4 . .Pp Added: head/share/man/man4/vte.4 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/vte.4 Fri Dec 31 00:46:30 2010(r216831) @@ -0,0 +1,152 @@ +.\" Copyright (c) 2010 Pyun YongHyeon +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\"notice, this list of conditions and the following disclaimer in the +.\"documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 30, 2010 +.Dt VTE 4 +.Os +.Sh NAME +.Nm vte +.Nd Vortex86 RDC R6040 Fast Ethernet driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device miibus" +.Cd "device vte" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_vte_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +device driver provides support for RDC R6040 Fast Ethernet controller +which is commonly found on Vortex86 System On a Chip (SoC). +.Pp +The RDC R6040 has integrated 10/100 PHY for 10/100Mbps sup
svn commit: r216832 - head/usr.sbin/newsyslog
Author: brian Date: Fri Dec 31 01:10:42 2010 New Revision: 216832 URL: http://svn.freebsd.org/changeset/base/216832 Log: Make -S functional. MFC after:1 week Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c == --- head/usr.sbin/newsyslog/newsyslog.c Fri Dec 31 00:46:30 2010 (r216831) +++ head/usr.sbin/newsyslog/newsyslog.c Fri Dec 31 01:10:42 2010 (r216832) @@ -599,7 +599,7 @@ parse_args(int argc, char **argv) *p = '\0'; /* Parse command line options. */ - while ((ch = getopt(argc, argv, "a:d:f:nrst:vCD:FNPR:")) != -1) + while ((ch = getopt(argc, argv, "a:d:f:nrst:vCD:FNPR:S:")) != -1) switch (ch) { case 'a': archtodir++; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r216833 - head/sys/dev/vte
Author: yongari Date: Fri Dec 31 01:23:04 2010 New Revision: 216833 URL: http://svn.freebsd.org/changeset/base/216833 Log: Remove debugging leftovers. Modified: head/sys/dev/vte/if_vte.c Modified: head/sys/dev/vte/if_vte.c == --- head/sys/dev/vte/if_vte.c Fri Dec 31 01:10:42 2010(r216832) +++ head/sys/dev/vte/if_vte.c Fri Dec 31 01:23:04 2010(r216833) @@ -66,13 +66,8 @@ __FBSDID("$FreeBSD$"); #include -#if 0 -#include "if_vtereg.h" -#include "if_vtevar.h" -#else #include #include -#endif /* "device miibus" required. See GENERIC if you get errors here. */ #include "miibus_if.h" ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r216823 - head/sbin/shutdown
On Thu Dec 30 10, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Thu Dec 30 18:06:31 2010 > New Revision: 216823 > URL: http://svn.freebsd.org/changeset/base/216823 > > Log: > For compatibility with Linux and Solaris add poweroff(8). any thoughts on adding a 'shutdown -c' switch for compatibility reasons? right now the only way to revert a scheduled shutdown is to send a sigterm. 'shutdown -c' would provide an easier way and in addition to that using 'shutdown -c reason', admins could issue a notice to users why a scheduled shutdown was aborted. this is the explanation for the -c option from the linux shutdown(8) manual: "-c Cancel an already running shutdown. With this option it is of course not possible to give the time argument, but you can enter a explanatory message on the command line that will be sent to all users." cheers. alex > > It is implemented as a hard link to shutdown(8) and it is equivalent of: > > # shutdown -p now > > While I'm here put one line of usage into one line of C code so it is > easier to > grep(1) and separate unrelated code with empty line. > > MFC after: 2 weeks > > Modified: > head/sbin/shutdown/Makefile > head/sbin/shutdown/shutdown.8 > head/sbin/shutdown/shutdown.c > > Modified: head/sbin/shutdown/Makefile > == > --- head/sbin/shutdown/Makefile Thu Dec 30 16:56:20 2010 > (r216822) > +++ head/sbin/shutdown/Makefile Thu Dec 30 18:06:31 2010 > (r216823) > @@ -3,6 +3,8 @@ > > PROG=shutdown > MAN= shutdown.8 > +LINKS= ${BINDIR}/shutdown ${BINDIR}/poweroff > +MLINKS= shutdown.8 poweroff.8 > > BINOWN= root > BINGRP= operator > > Modified: head/sbin/shutdown/shutdown.8 > == > --- head/sbin/shutdown/shutdown.8 Thu Dec 30 16:56:20 2010 > (r216822) > +++ head/sbin/shutdown/shutdown.8 Thu Dec 30 18:06:31 2010 > (r216823) > @@ -28,11 +28,12 @@ > .\" @(#)shutdown.8 8.2 (Berkeley) 4/27/95 > .\" $FreeBSD$ > .\" > -.Dd December 23, 2008 > +.Dd December 30, 2010 > .Dt SHUTDOWN 8 > .Os > .Sh NAME > -.Nm shutdown > +.Nm shutdown , > +.Nm poweroff > .Nd "close down the system at a given time" > .Sh SYNOPSIS > .Nm > @@ -47,6 +48,7 @@ > .Oc > .Ar time > .Op Ar warning-message ... > +.Nm poweroff > .Sh DESCRIPTION > The > .Nm > @@ -173,6 +175,13 @@ When run without options, the > utility will place the system into single user mode at the > .Ar time > specified. > +.Pp > +Calling utility as > +.Nm poweroff > +is equivalent of calling: > +.Bd -literal -offset indent > +shutdown -p now > +.Ed > .Sh FILES > .Bl -tag -width /var/run/nologin -compact > .It Pa /var/run/nologin > > Modified: head/sbin/shutdown/shutdown.c > == > --- head/sbin/shutdown/shutdown.c Thu Dec 30 16:56:20 2010 > (r216822) > +++ head/sbin/shutdown/shutdown.c Thu Dec 30 18:06:31 2010 > (r216823) > @@ -115,8 +115,31 @@ main(int argc, char **argv) > if (geteuid()) > errx(1, "NOT super-user"); > #endif > + > nosync = NULL; > readstdin = 0; > + > + /* > + * Test for the special case where the utility is called as > + * "poweroff", for which it runs 'shutdown -p now'. > + */ > + if ((p = rindex(argv[0], '/')) == NULL) > + p = argv[0]; > + else > + ++p; > + if (strcmp(p, "poweroff") == 0) { > + if (getopt(argc, argv, "") != -1) > + usage((char *)NULL); > + argc -= optind; > + argv += optind; > + if (argc != 0) > + usage((char *)NULL); > + dopower = 1; > + offset = 0; > + (void)time(&shuttime); > + goto poweroff; > + } > + > while ((ch = getopt(argc, argv, "-hknopr")) != -1) > switch (ch) { > case '-': > @@ -161,6 +184,7 @@ main(int argc, char **argv) > > getoffset(*argv++); > > +poweroff: > if (*argv) { > for (p = mbuf, len = sizeof(mbuf); *argv; ++argv) { > arglen = strlen(*argv); > @@ -510,7 +534,7 @@ usage(const char *cp) > if (cp != NULL) > warnx("%s", cp); > (void)fprintf(stderr, > - "usage: shutdown [-] [-h | -p | -r | -k] [-o [-n]]" > - " time [warning-message ...]\n"); > + "usage: shutdown [-] [-h | -p | -r | -k] [-o [-n]] time > [warning-message ...]\n" > + " poweroff\n"); > exit(1); > } -- a13x ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r210144 - head/usr.sbin/config
Hi Warner, On 07/16/10 08:28, Warner Losh wrote: > Author: imp > Date: Thu Jul 15 22:28:19 2010 > New Revision: 210144 > URL: http://svn.freebsd.org/changeset/base/210144 > > Log: > Put warnings out to stderr rather than stdout. > > MFC after: 3 days > > Modified: > head/usr.sbin/config/config.y > head/usr.sbin/config/mkmakefile.c > head/usr.sbin/config/mkoptions.c Attempting to "make universe" on stable/8 without this diff currently results in the make bailing because of config warnings ending up in make variables when a LINT kernel is built. Building a head tree on stable/8 using the following command will demonstrate the problem: make -v -dl universe_kernels KERNCONFS=LINT e.g. ## lstew...@lstewart3:head> sudo make -v -dl universe_kernels KERNCONFS=LINT (cd /work/svn/freebsd_mirror/head && env __MAKE_CONF=/dev/null make buildkernel TARGET=amd64 TARGET_ARCH=WARNING: duplicate option `GEOM_PART_BSD' encountered. WARNING: duplicate option `GEOM_PART_EBR' encountered. WARNING: duplicate option `GEOM_PART_EBR_COMPAT' encountered. WARNING: duplicate option `GEOM_PART_MBR' encountered. WARNING: duplicate option `DEV_MEM' encountered. WARNING: duplicate device `mem' encountered. WARNING: duplicate option `DEV_ISA' encountered. WARNING: duplicate device `isa' encountered. amd64 KERNCONF=LINT > _.amd64.LINT 2>&1 || (echo "amd64 LINT kernel failed," "check _.amd64.LINT for details"| cat)) Syntax error: Unterminated quoted string *** Error code 2 Stop in /work/svn/freebsd_mirror/head. ## Jilles deserves the credit for doing all the detective work after I complained about this problem on IRC today. Is there a reason the MFC was never done? Assuming not, I would appreciate if you could do it when you have a sec or give me the green light to do it instead. Cheers, Lawrence ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"