Date: Sat, 12 Nov 2011 17:12:33 +0000 (UTC) From: Attilio Rao <attilio@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r227469 - in user/attilio/vmcontention: bin/sh contrib/gcc/config/arm contrib/top etc etc/rc.d lib/libc/regex lib/libc/sys lib/libusb release/doc/en_US.ISO8859-1/hardware sbin/ffsinfo s... Message-ID: <201111121712.pACHCXAv053926@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: attilio Date: Sat Nov 12 17:12:33 2011 New Revision: 227469 URL: http://svn.freebsd.org/changeset/base/227469 Log: MFC Modified: user/attilio/vmcontention/bin/sh/arith_yacc.c user/attilio/vmcontention/contrib/gcc/config/arm/arm.c user/attilio/vmcontention/etc/rc.d/routing user/attilio/vmcontention/etc/rc.d/syscons user/attilio/vmcontention/etc/rc.subr user/attilio/vmcontention/lib/libc/regex/regcomp.c user/attilio/vmcontention/lib/libc/sys/flock.2 user/attilio/vmcontention/lib/libusb/Makefile user/attilio/vmcontention/lib/libusb/libusb.3 user/attilio/vmcontention/lib/libusb/libusb.h user/attilio/vmcontention/lib/libusb/libusb10_desc.c user/attilio/vmcontention/lib/libusb/libusb20_desc.c user/attilio/vmcontention/lib/libusb/libusb20_desc.h user/attilio/vmcontention/release/doc/en_US.ISO8859-1/hardware/article.sgml user/attilio/vmcontention/sbin/ffsinfo/Makefile user/attilio/vmcontention/sbin/geom/class/multipath/geom_multipath.c user/attilio/vmcontention/sbin/geom/class/multipath/gmultipath.8 user/attilio/vmcontention/sbin/ifconfig/ifieee80211.c user/attilio/vmcontention/sbin/ipfw/ipfw.8 user/attilio/vmcontention/sbin/newfs_msdos/newfs_msdos.c user/attilio/vmcontention/secure/usr.bin/openssl/man/ca.1 user/attilio/vmcontention/share/man/man4/altq.4 user/attilio/vmcontention/share/man/man4/mps.4 user/attilio/vmcontention/share/man/man4/mtio.4 user/attilio/vmcontention/share/man/man4/mvs.4 user/attilio/vmcontention/share/man/man4/ti.4 user/attilio/vmcontention/share/misc/committers-ports.dot user/attilio/vmcontention/share/misc/committers-src.dot user/attilio/vmcontention/share/monetdef/zh_CN.UTF-8.src user/attilio/vmcontention/sys/amd64/amd64/machdep.c user/attilio/vmcontention/sys/amd64/amd64/trap.c user/attilio/vmcontention/sys/amd64/include/signal.h user/attilio/vmcontention/sys/amd64/include/ucontext.h user/attilio/vmcontention/sys/amd64/linux32/linux32_systrace_args.c user/attilio/vmcontention/sys/boot/i386/libi386/bioscd.c user/attilio/vmcontention/sys/cddl/dev/dtrace/i386/dtrace_asm.S user/attilio/vmcontention/sys/cddl/dev/systrace/systrace.c user/attilio/vmcontention/sys/compat/freebsd32/freebsd32.h user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_systrace_args.c user/attilio/vmcontention/sys/conf/NOTES user/attilio/vmcontention/sys/conf/options user/attilio/vmcontention/sys/dev/ae/if_ae.c user/attilio/vmcontention/sys/dev/ath/ah_osdep.c user/attilio/vmcontention/sys/dev/ath/ath_hal/ah.c user/attilio/vmcontention/sys/dev/ath/ath_hal/ah.h user/attilio/vmcontention/sys/dev/ath/ath_hal/ah_devid.h user/attilio/vmcontention/sys/dev/ath/ath_hal/ah_internal.h user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416.h user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416phy.h user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416reg.h user/attilio/vmcontention/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c user/attilio/vmcontention/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c user/attilio/vmcontention/sys/dev/ath/ath_rate/amrr/amrr.c user/attilio/vmcontention/sys/dev/ath/ath_rate/onoe/onoe.c user/attilio/vmcontention/sys/dev/ath/ath_rate/sample/sample.c user/attilio/vmcontention/sys/dev/ath/ath_rate/sample/sample.h user/attilio/vmcontention/sys/dev/ath/if_ath.c user/attilio/vmcontention/sys/dev/ath/if_ath_debug.c user/attilio/vmcontention/sys/dev/ath/if_ath_keycache.c user/attilio/vmcontention/sys/dev/ath/if_ath_keycache.h user/attilio/vmcontention/sys/dev/ath/if_ath_misc.h user/attilio/vmcontention/sys/dev/ath/if_ath_pci.c user/attilio/vmcontention/sys/dev/ath/if_ath_sysctl.c user/attilio/vmcontention/sys/dev/ath/if_ath_tx.c user/attilio/vmcontention/sys/dev/ath/if_ath_tx.h user/attilio/vmcontention/sys/dev/ath/if_ath_tx_ht.c user/attilio/vmcontention/sys/dev/ath/if_ath_tx_ht.h user/attilio/vmcontention/sys/dev/ath/if_athrate.h user/attilio/vmcontention/sys/dev/ath/if_athvar.h user/attilio/vmcontention/sys/dev/hwpmc/hwpmc_mips24k.c user/attilio/vmcontention/sys/dev/isp/DriverManual.txt user/attilio/vmcontention/sys/dev/lmc/if_lmc.c user/attilio/vmcontention/sys/dev/mfi/mfi.c user/attilio/vmcontention/sys/dev/puc/pucdata.c user/attilio/vmcontention/sys/dev/ti/if_ti.c user/attilio/vmcontention/sys/dev/ti/if_tireg.h user/attilio/vmcontention/sys/dev/usb/controller/at91dci.c user/attilio/vmcontention/sys/dev/usb/controller/avr32dci.c user/attilio/vmcontention/sys/dev/usb/controller/ehci.c user/attilio/vmcontention/sys/dev/usb/controller/ohci.c user/attilio/vmcontention/sys/dev/usb/controller/uhci.c user/attilio/vmcontention/sys/dev/usb/controller/xhci.c user/attilio/vmcontention/sys/dev/usb/net/if_kue.c user/attilio/vmcontention/sys/dev/usb/net/uhso.c user/attilio/vmcontention/sys/dev/usb/serial/ufoma.c user/attilio/vmcontention/sys/dev/usb/serial/uftdi.c user/attilio/vmcontention/sys/dev/usb/serial/umodem.c user/attilio/vmcontention/sys/dev/usb/serial/uplcom.c user/attilio/vmcontention/sys/dev/usb/serial/uslcom.c user/attilio/vmcontention/sys/dev/usb/serial/uvisor.c user/attilio/vmcontention/sys/dev/usb/storage/umass.c user/attilio/vmcontention/sys/dev/usb/storage/urio.c user/attilio/vmcontention/sys/dev/usb/storage/ustorage_fs.c user/attilio/vmcontention/sys/dev/usb/template/usb_template.c user/attilio/vmcontention/sys/dev/usb/usb.h user/attilio/vmcontention/sys/dev/usb/usb_busdma.c user/attilio/vmcontention/sys/dev/usb/usb_compat_linux.c user/attilio/vmcontention/sys/dev/usb/usb_dev.c user/attilio/vmcontention/sys/dev/usb/usb_generic.c user/attilio/vmcontention/sys/dev/usb/usb_ioctl.h user/attilio/vmcontention/sys/dev/usb/usb_msctest.c user/attilio/vmcontention/sys/dev/usb/usb_request.c user/attilio/vmcontention/sys/dev/usb/usb_transfer.c user/attilio/vmcontention/sys/dev/usb/wlan/if_uath.c user/attilio/vmcontention/sys/dev/usb/wlan/if_upgt.c user/attilio/vmcontention/sys/dev/usb/wlan/if_urtw.c user/attilio/vmcontention/sys/dev/usb/wlan/if_zyd.c user/attilio/vmcontention/sys/fs/procfs/procfs_status.c user/attilio/vmcontention/sys/geom/multipath/g_multipath.c user/attilio/vmcontention/sys/geom/multipath/g_multipath.h user/attilio/vmcontention/sys/i386/i386/machdep.c user/attilio/vmcontention/sys/i386/i386/trap.c user/attilio/vmcontention/sys/i386/include/signal.h user/attilio/vmcontention/sys/i386/include/ucontext.h user/attilio/vmcontention/sys/i386/linux/linux_systrace_args.c user/attilio/vmcontention/sys/kern/kern_conf.c user/attilio/vmcontention/sys/kern/kern_ctf.c user/attilio/vmcontention/sys/kern/makesyscalls.sh user/attilio/vmcontention/sys/kern/subr_kobj.c user/attilio/vmcontention/sys/kern/systrace_args.c user/attilio/vmcontention/sys/modules/ath/Makefile user/attilio/vmcontention/sys/modules/ath_ahb/Makefile user/attilio/vmcontention/sys/modules/ath_pci/Makefile user/attilio/vmcontention/sys/net/if_bridge.c user/attilio/vmcontention/sys/net/if_lagg.c user/attilio/vmcontention/sys/net/if_tap.c user/attilio/vmcontention/sys/net/if_vlan.c user/attilio/vmcontention/sys/net80211/ieee80211_sta.c user/attilio/vmcontention/sys/netgraph/ng_fec.c user/attilio/vmcontention/sys/netinet/ip_carp.c user/attilio/vmcontention/sys/netinet/ipfw/dummynet.txt user/attilio/vmcontention/sys/netinet6/in6.c user/attilio/vmcontention/sys/netinet6/in6_pcb.c user/attilio/vmcontention/sys/netinet6/nd6.c user/attilio/vmcontention/sys/netinet6/nd6.h user/attilio/vmcontention/sys/netinet6/nd6_rtr.c user/attilio/vmcontention/sys/powerpc/aim/trap_subr32.S user/attilio/vmcontention/sys/powerpc/aim/trap_subr64.S user/attilio/vmcontention/sys/sys/kobj.h user/attilio/vmcontention/sys/sys/proc.h user/attilio/vmcontention/sys/sys/unistd.h user/attilio/vmcontention/sys/tools/makeobjops.awk user/attilio/vmcontention/sys/ufs/ffs/fs.h user/attilio/vmcontention/sys/ufs/ufs/dinode.h user/attilio/vmcontention/tools/tools/netrate/netblast/netblast.c user/attilio/vmcontention/tools/tools/netrate/netreceive/netreceive.c user/attilio/vmcontention/tools/tools/netrate/netsend/netsend.c user/attilio/vmcontention/usr.bin/calendar/calendar.1 user/attilio/vmcontention/usr.bin/calendar/calendar.c user/attilio/vmcontention/usr.bin/calendar/io.c user/attilio/vmcontention/usr.bin/calendar/parsedata.c user/attilio/vmcontention/usr.bin/compress/doc/NOTES user/attilio/vmcontention/usr.bin/du/du.c user/attilio/vmcontention/usr.bin/procstat/procstat.1 user/attilio/vmcontention/usr.sbin/config/mkmakefile.c user/attilio/vmcontention/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh user/attilio/vmcontention/usr.sbin/pc-sysinstall/backend/functions-disk.sh user/attilio/vmcontention/usr.sbin/pc-sysinstall/backend/parseconfig.sh user/attilio/vmcontention/usr.sbin/pkg_install/lib/version.c Directory Properties: user/attilio/vmcontention/ (props changed) user/attilio/vmcontention/cddl/contrib/opensolaris/ (props changed) user/attilio/vmcontention/contrib/bind9/ (props changed) user/attilio/vmcontention/contrib/binutils/ (props changed) user/attilio/vmcontention/contrib/bzip2/ (props changed) user/attilio/vmcontention/contrib/com_err/ (props changed) user/attilio/vmcontention/contrib/compiler-rt/ (props changed) user/attilio/vmcontention/contrib/dialog/ (props changed) user/attilio/vmcontention/contrib/ee/ (props changed) user/attilio/vmcontention/contrib/expat/ (props changed) user/attilio/vmcontention/contrib/file/ (props changed) user/attilio/vmcontention/contrib/gcc/ (props changed) user/attilio/vmcontention/contrib/gdb/ (props changed) user/attilio/vmcontention/contrib/gdtoa/ (props changed) user/attilio/vmcontention/contrib/gnu-sort/ (props changed) user/attilio/vmcontention/contrib/groff/ (props changed) user/attilio/vmcontention/contrib/less/ (props changed) user/attilio/vmcontention/contrib/libpcap/ (props changed) user/attilio/vmcontention/contrib/libstdc++/ (props changed) user/attilio/vmcontention/contrib/llvm/ (props changed) user/attilio/vmcontention/contrib/llvm/tools/clang/ (props changed) user/attilio/vmcontention/contrib/ncurses/ (props changed) user/attilio/vmcontention/contrib/netcat/ (props changed) user/attilio/vmcontention/contrib/ntp/ (props changed) user/attilio/vmcontention/contrib/one-true-awk/ (props changed) user/attilio/vmcontention/contrib/openbsm/ (props changed) user/attilio/vmcontention/contrib/openpam/ (props changed) user/attilio/vmcontention/contrib/openresolv/ (props changed) user/attilio/vmcontention/contrib/pf/ (props changed) user/attilio/vmcontention/contrib/sendmail/ (props changed) user/attilio/vmcontention/contrib/tcpdump/ (props changed) user/attilio/vmcontention/contrib/tcsh/ (props changed) user/attilio/vmcontention/contrib/tnftp/ (props changed) user/attilio/vmcontention/contrib/top/ (props changed) user/attilio/vmcontention/contrib/top/install-sh (props changed) user/attilio/vmcontention/contrib/tzcode/stdtime/ (props changed) user/attilio/vmcontention/contrib/tzcode/zic/ (props changed) user/attilio/vmcontention/contrib/tzdata/ (props changed) user/attilio/vmcontention/contrib/wpa/ (props changed) user/attilio/vmcontention/contrib/xz/ (props changed) user/attilio/vmcontention/crypto/heimdal/ (props changed) user/attilio/vmcontention/crypto/openssh/ (props changed) user/attilio/vmcontention/crypto/openssl/ (props changed) user/attilio/vmcontention/gnu/lib/ (props changed) user/attilio/vmcontention/gnu/usr.bin/binutils/ (props changed) user/attilio/vmcontention/gnu/usr.bin/cc/cc_tools/ (props changed) user/attilio/vmcontention/gnu/usr.bin/gdb/ (props changed) user/attilio/vmcontention/lib/libc/ (props changed) user/attilio/vmcontention/lib/libc/stdtime/ (props changed) user/attilio/vmcontention/lib/libutil/ (props changed) user/attilio/vmcontention/lib/libz/ (props changed) user/attilio/vmcontention/sbin/ (props changed) user/attilio/vmcontention/sbin/ipfw/ (props changed) user/attilio/vmcontention/share/mk/bsd.arch.inc.mk (props changed) user/attilio/vmcontention/share/zoneinfo/ (props changed) user/attilio/vmcontention/sys/ (props changed) user/attilio/vmcontention/sys/amd64/include/xen/ (props changed) user/attilio/vmcontention/sys/boot/ (props changed) user/attilio/vmcontention/sys/boot/i386/efi/ (props changed) user/attilio/vmcontention/sys/boot/ia64/efi/ (props changed) user/attilio/vmcontention/sys/boot/ia64/ski/ (props changed) user/attilio/vmcontention/sys/boot/powerpc/boot1.chrp/ (props changed) user/attilio/vmcontention/sys/boot/powerpc/ofw/ (props changed) user/attilio/vmcontention/sys/cddl/contrib/opensolaris/ (props changed) user/attilio/vmcontention/sys/conf/ (props changed) user/attilio/vmcontention/sys/contrib/dev/acpica/ (props changed) user/attilio/vmcontention/sys/contrib/octeon-sdk/ (props changed) user/attilio/vmcontention/sys/contrib/pf/ (props changed) user/attilio/vmcontention/sys/contrib/x86emu/ (props changed) user/attilio/vmcontention/usr.bin/calendar/ (props changed) user/attilio/vmcontention/usr.bin/csup/ (props changed) user/attilio/vmcontention/usr.bin/procstat/ (props changed) user/attilio/vmcontention/usr.sbin/ndiscvt/ (props changed) user/attilio/vmcontention/usr.sbin/rtadvctl/ (props changed) user/attilio/vmcontention/usr.sbin/rtadvd/ (props changed) user/attilio/vmcontention/usr.sbin/rtsold/ (props changed) user/attilio/vmcontention/usr.sbin/zic/ (props changed) Modified: user/attilio/vmcontention/bin/sh/arith_yacc.c ============================================================================== --- user/attilio/vmcontention/bin/sh/arith_yacc.c Sat Nov 12 16:47:23 2011 (r227468) +++ user/attilio/vmcontention/bin/sh/arith_yacc.c Sat Nov 12 17:12:33 2011 (r227469) @@ -131,11 +131,11 @@ static arith_t do_binop(int op, arith_t yyerror("divide error"); return op == ARITH_REM ? a % b : a / b; case ARITH_MUL: - return a * b; + return (uintmax_t)a * (uintmax_t)b; case ARITH_ADD: - return a + b; + return (uintmax_t)a + (uintmax_t)b; case ARITH_SUB: - return a - b; + return (uintmax_t)a - (uintmax_t)b; case ARITH_LSHIFT: return a << b; case ARITH_RSHIFT: Modified: user/attilio/vmcontention/contrib/gcc/config/arm/arm.c ============================================================================== --- user/attilio/vmcontention/contrib/gcc/config/arm/arm.c Sat Nov 12 16:47:23 2011 (r227468) +++ user/attilio/vmcontention/contrib/gcc/config/arm/arm.c Sat Nov 12 17:12:33 2011 (r227469) @@ -3217,7 +3217,8 @@ legitimize_pic_address (rtx orig, enum m gcc_assert (!no_new_pseudos); if (arm_pic_register != INVALID_REGNUM) { - cfun->machine->pic_reg = gen_rtx_REG (Pmode, arm_pic_register); + if (!cfun->machine->pic_reg) + cfun->machine->pic_reg = gen_rtx_REG (Pmode, arm_pic_register); /* Play games to avoid marking the function as needing pic if we are being called as part of the cost-estimation @@ -3229,7 +3230,8 @@ legitimize_pic_address (rtx orig, enum m { rtx seq; - cfun->machine->pic_reg = gen_reg_rtx (Pmode); + if (!cfun->machine->pic_reg) + cfun->machine->pic_reg = gen_reg_rtx (Pmode); /* Play games to avoid marking the function as needing pic if we are being called as part of the cost-estimation Modified: user/attilio/vmcontention/etc/rc.d/routing ============================================================================== --- user/attilio/vmcontention/etc/rc.d/routing Sat Nov 12 16:47:23 2011 (r227468) +++ user/attilio/vmcontention/etc/rc.d/routing Sat Nov 12 17:12:33 2011 (r227469) @@ -247,6 +247,7 @@ static_atm() static_ipx() { + : } ropts_init() Modified: user/attilio/vmcontention/etc/rc.d/syscons ============================================================================== --- user/attilio/vmcontention/etc/rc.d/syscons Sat Nov 12 16:47:23 2011 (r227468) +++ user/attilio/vmcontention/etc/rc.d/syscons Sat Nov 12 17:12:33 2011 (r227469) @@ -99,7 +99,7 @@ syscons_configure_keyboard() *) sc_init echo -n ' keychange' - set - ${keychange} + set -- ${keychange} while [ $# -gt 0 ]; do kbdcontrol <${kbddev} -f "$1" "$2" shift; shift Modified: user/attilio/vmcontention/etc/rc.subr ============================================================================== --- user/attilio/vmcontention/etc/rc.subr Sat Nov 12 16:47:23 2011 (r227468) +++ user/attilio/vmcontention/etc/rc.subr Sat Nov 12 17:12:33 2011 (r227469) @@ -1638,7 +1638,7 @@ find_local_scripts_old () { continue zlist="$zlist $file" done - for file in ${dir}/[^0-9]*.sh; do + for file in ${dir}/[!0-9]*.sh; do grep '^# PROVIDE:' $file >/dev/null 2>&1 && continue slist="$slist $file" Modified: user/attilio/vmcontention/lib/libc/regex/regcomp.c ============================================================================== --- user/attilio/vmcontention/lib/libc/regex/regcomp.c Sat Nov 12 16:47:23 2011 (r227468) +++ user/attilio/vmcontention/lib/libc/regex/regcomp.c Sat Nov 12 17:12:33 2011 (r227469) @@ -81,10 +81,10 @@ extern "C" { #endif /* === regcomp.c === */ -static void p_ere(struct parse *p, wint_t stop); +static void p_ere(struct parse *p, int stop); static void p_ere_exp(struct parse *p); static void p_str(struct parse *p); -static void p_bre(struct parse *p, wint_t end1, wint_t end2); +static void p_bre(struct parse *p, int end1, int end2); static int p_simp_re(struct parse *p, int starordinary); static int p_count(struct parse *p); static void p_bracket(struct parse *p); @@ -109,7 +109,7 @@ static sopno dupl(struct parse *p, sopno static void doemit(struct parse *p, sop op, size_t opnd); static void doinsert(struct parse *p, sop op, size_t opnd, sopno pos); static void dofwd(struct parse *p, sopno pos, sop value); -static void enlarge(struct parse *p, sopno size); +static int enlarge(struct parse *p, sopno size); static void stripsnug(struct parse *p, struct re_guts *g); static void findmust(struct parse *p, struct re_guts *g); static int altoffset(sop *scan, int offset); @@ -285,7 +285,7 @@ regcomp(regex_t * __restrict preg, /* - p_ere - ERE parser top level, concatenation and alternation - == static void p_ere(struct parse *p, int stop); + == static void p_ere(struct parse *p, int_t stop); */ static void p_ere(struct parse *p, @@ -493,7 +493,7 @@ p_str(struct parse *p) /* - p_bre - BRE parser top level, anchoring and concatenation - == static void p_bre(struct parse *p, int end1, \ + == static void p_bre(struct parse *p, int end1, \ == int end2); * Giving end1 as OUT essentially eliminates the end1/end2 check. * @@ -840,7 +840,7 @@ p_b_eclass(struct parse *p, cset *cs) /* - p_b_symbol - parse a character or [..]ed multicharacter collating symbol - == static char p_b_symbol(struct parse *p); + == static wint_t p_b_symbol(struct parse *p); */ static wint_t /* value of symbol */ p_b_symbol(struct parse *p) @@ -859,7 +859,7 @@ p_b_symbol(struct parse *p) /* - p_b_coll_elem - parse a collating-element name and look it up - == static char p_b_coll_elem(struct parse *p, int endc); + == static wint_t p_b_coll_elem(struct parse *p, wint_t endc); */ static wint_t /* value of collating element */ p_b_coll_elem(struct parse *p, @@ -894,7 +894,7 @@ p_b_coll_elem(struct parse *p, /* - othercase - return the case counterpart of an alphabetic - == static char othercase(int ch); + == static wint_t othercase(wint_t ch); */ static wint_t /* if no counterpart, return ch */ othercase(wint_t ch) @@ -910,7 +910,7 @@ othercase(wint_t ch) /* - bothcases - emit a dualcase version of a two-case character - == static void bothcases(struct parse *p, int ch); + == static void bothcases(struct parse *p, wint_t ch); * * Boy, is this implementation ever a kludge... */ @@ -939,7 +939,7 @@ bothcases(struct parse *p, wint_t ch) /* - ordinary - emit an ordinary character - == static void ordinary(struct parse *p, int ch); + == static void ordinary(struct parse *p, wint_t ch); */ static void ordinary(struct parse *p, wint_t ch) @@ -1246,8 +1246,8 @@ dupl(struct parse *p, assert(finish >= start); if (len == 0) return(ret); - enlarge(p, p->ssize + len); /* this many unexpected additions */ - assert(p->ssize >= p->slen + len); + if (!enlarge(p, p->ssize + len)) /* this many unexpected additions */ + return(ret); (void) memcpy((char *)(p->strip + p->slen), (char *)(p->strip + start), (size_t)len*sizeof(sop)); p->slen += len; @@ -1274,8 +1274,8 @@ doemit(struct parse *p, sop op, size_t o /* deal with undersized strip */ if (p->slen >= p->ssize) - enlarge(p, (p->ssize+1) / 2 * 3); /* +50% */ - assert(p->slen < p->ssize); + if (!enlarge(p, (p->ssize+1) / 2 * 3)) /* +50% */ + return; /* finally, it's all reduced to the easy case */ p->strip[p->slen++] = SOP(op, opnd); @@ -1334,23 +1334,24 @@ dofwd(struct parse *p, sopno pos, sop va /* - enlarge - enlarge the strip - == static void enlarge(struct parse *p, sopno size); + == static int enlarge(struct parse *p, sopno size); */ -static void +static int enlarge(struct parse *p, sopno size) { sop *sp; if (p->ssize >= size) - return; + return 1; sp = (sop *)realloc(p->strip, size*sizeof(sop)); if (sp == NULL) { SETERROR(REG_ESPACE); - return; + return 0; } p->strip = sp; p->ssize = size; + return 1; } /* Modified: user/attilio/vmcontention/lib/libc/sys/flock.2 ============================================================================== --- user/attilio/vmcontention/lib/libc/sys/flock.2 Sat Nov 12 16:47:23 2011 (r227468) +++ user/attilio/vmcontention/lib/libc/sys/flock.2 Sat Nov 12 17:12:33 2011 (r227469) @@ -28,7 +28,7 @@ .\" @(#)flock.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd January 22, 2008 +.Dd November 9, 2011 .Dt FLOCK 2 .Os .Sh NAME @@ -154,6 +154,8 @@ refers to an object other than a file. The argument .Fa fd refers to an object that does not support file locking. +.It Bq Er ENOLCK +A lock was requested, but no locks are available. .El .Sh SEE ALSO .Xr close 2 , Modified: user/attilio/vmcontention/lib/libusb/Makefile ============================================================================== --- user/attilio/vmcontention/lib/libusb/Makefile Sat Nov 12 16:47:23 2011 (r227468) +++ user/attilio/vmcontention/lib/libusb/Makefile Sat Nov 12 17:12:33 2011 (r227469) @@ -74,6 +74,10 @@ MLINKS += libusb.3 libusb_get_config_des MLINKS += libusb.3 libusb_get_config_descriptor_by_value.3 MLINKS += libusb.3 libusb_free_config_descriptor.3 MLINKS += libusb.3 libusb_get_string_descriptor_ascii.3 +MLINKS += libusb.3 libusb_parse_ss_endpoint_comp.3 +MLINKS += libusb.3 libusb_free_ss_endpoint_comp.3 +MLINKS += libusb.3 libusb_parse_bos_descriptor.3 +MLINKS += libusb.3 libusb_free_bos_descriptor.3 MLINKS += libusb.3 libusb_alloc_transfer.3 MLINKS += libusb.3 libusb_free_transfer.3 MLINKS += libusb.3 libusb_submit_transfer.3 Modified: user/attilio/vmcontention/lib/libusb/libusb.3 ============================================================================== --- user/attilio/vmcontention/lib/libusb/libusb.3 Sat Nov 12 16:47:23 2011 (r227468) +++ user/attilio/vmcontention/lib/libusb/libusb.3 Sat Nov 12 17:12:33 2011 (r227469) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 16, 2011 +.Dd November 9, 2011 .Dt LIBUSB 3 .Os .Sh NAME @@ -316,6 +316,40 @@ Retrieve a string descriptor in C style Returns the positive number of bytes in the resulting ASCII string on success and a LIBUSB_ERROR code on failure. .Pp +.Ft int +.Fn libusb_parse_ss_endpoint_comp "const void *buf" "int len" "libusb_ss_endpoint_companion_descriptor **ep_comp" +This function parses the USB 3.0 endpoint companion descriptor in host endian format pointed to by +.Fa buf +and having a length of +.Fa len. +Typically these arguments are the extra and extra_length fields of the +endpoint descriptor. +On success the pointer to resulting descriptor is stored at the location given by +.Fa ep_comp. +Returns zero on success and a LIBUSB_ERROR code on failure. +On success the parsed USB 3.0 endpoint companion descriptor must be +freed using the libusb_free_ss_endpoint_comp function. +.Pp +.Ft void +.Fn libusb_free_ss_endpoint_comp "libusb_ss_endpoint_companion_descriptor *ep_comp" +This function is NULL safe and frees a parsed USB 3.0 endpoint companion descriptor. +.Pp +.Ft int +.Fn libusb_parse_bos_descriptor "const void *buf" "int len" "libusb_bos_descriptor **bos" +This function parses a Binary Object Store, BOS, descriptor into host endian format pointed to by +.Fa buf +and having a length of +.Fa len. +On success the pointer to resulting descriptor is stored at the location given by +.Fa bos. +Returns zero on success and a LIBUSB_ERROR code on failure. +On success the parsed BOS descriptor must be freed using the +libusb_free_bos_descriptor function. +.Pp +.Ft void +.Fn libusb_free_bos_descriptor "libusb_bos_descriptor *bos" +This function is NULL safe and frees a parsed BOS descriptor. +.Pp .Sh USB ASYNCHRONOUS I/O .Pp .Ft struct libusb_transfer * Modified: user/attilio/vmcontention/lib/libusb/libusb.h ============================================================================== --- user/attilio/vmcontention/lib/libusb/libusb.h Sat Nov 12 16:47:23 2011 (r227468) +++ user/attilio/vmcontention/lib/libusb/libusb.h Sat Nov 12 17:12:33 2011 (r227469) @@ -63,6 +63,16 @@ enum libusb_descriptor_type { LIBUSB_DT_REPORT = 0x22, LIBUSB_DT_PHYSICAL = 0x23, LIBUSB_DT_HUB = 0x29, + LIBUSB_DT_BOS = 0x0f, + LIBUSB_DT_DEVICE_CAPABILITY = 0x10, + LIBUSB_DT_SS_ENDPOINT_COMPANION = 0x30, +}; + +enum libusb_device_capability_type { + LIBUSB_WIRELESS_USB_DEVICE_CAPABILITY = 0x1, + LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY = 0x2, + LIBUSB_SS_USB_DEVICE_CAPABILITY = 0x3, + LIBUSB_CONTAINER_ID_DEVICE_CAPABILITY = 0x4, }; #define LIBUSB_DT_DEVICE_SIZE 18 @@ -71,6 +81,10 @@ enum libusb_descriptor_type { #define LIBUSB_DT_ENDPOINT_SIZE 7 #define LIBUSB_DT_ENDPOINT_AUDIO_SIZE 9 #define LIBUSB_DT_HUB_NONVAR_SIZE 7 +#define LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE 6 +#define LIBUSB_DT_BOS_SIZE 5 +#define LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY_SIZE 7 +#define LIBUSB_SS_USB_DEVICE_CAPABILITY_SIZE 10 #define LIBUSB_ENDPOINT_ADDRESS_MASK 0x0f #define LIBUSB_ENDPOINT_DIR_MASK 0x80 @@ -230,6 +244,14 @@ typedef struct libusb_endpoint_descripto int extra_length; } libusb_endpoint_descriptor __aligned(sizeof(void *)); +typedef struct libusb_ss_endpoint_companion_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bMaxBurst; + uint8_t bmAttributes; + uint16_t wBytesPerInterval; +} libusb_ss_endpoint_companion_descriptor __aligned(sizeof(void *)); + typedef struct libusb_interface_descriptor { uint8_t bLength; uint8_t bDescriptorType; @@ -264,6 +286,39 @@ typedef struct libusb_config_descriptor int extra_length; } libusb_config_descriptor __aligned(sizeof(void *)); +typedef struct libusb_usb_2_0_device_capability_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; + uint32_t bmAttributes; +#define LIBUSB_USB_2_0_CAPABILITY_LPM_SUPPORT (1 << 1) +} libusb_usb_2_0_device_capability_descriptor __aligned(sizeof(void *)); + +typedef struct libusb_ss_usb_device_capability_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; + uint8_t bmAttributes; +#define LIBUSB_SS_USB_CAPABILITY_LPM_SUPPORT (1 << 1) + uint16_t wSpeedSupported; +#define LIBUSB_CAPABILITY_LOW_SPEED_OPERATION (1) +#define LIBUSB_CAPABILITY_FULL_SPEED_OPERATION (1 << 1) +#define LIBUSB_CAPABILITY_HIGH_SPEED_OPERATION (1 << 2) +#define LIBUSB_CAPABILITY_5GBPS_OPERATION (1 << 3) + uint8_t bFunctionalitySupport; + uint8_t bU1DevExitLat; + uint16_t wU2DevExitLat; +} libusb_ss_usb_device_capability_descriptor __aligned(sizeof(void *)); + +typedef struct libusb_bos_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint16_t wTotalLength; + uint8_t bNumDeviceCapabilities; + struct libusb_usb_2_0_device_capability_descriptor *usb_2_0_ext_cap; + struct libusb_ss_usb_device_capability_descriptor *ss_usb_cap; +} libusb_bos_descriptor __aligned(sizeof(void *)); + typedef struct libusb_control_setup { uint8_t bmRequestType; uint8_t bRequest; @@ -345,6 +400,10 @@ int libusb_get_config_descriptor_by_valu void libusb_free_config_descriptor(struct libusb_config_descriptor *config); int libusb_get_string_descriptor_ascii(libusb_device_handle * devh, uint8_t desc_index, uint8_t *data, int length); int libusb_get_descriptor(libusb_device_handle * devh, uint8_t desc_type, uint8_t desc_index, uint8_t *data, int length); +int libusb_parse_ss_endpoint_comp(const void *buf, int len, struct libusb_ss_endpoint_companion_descriptor **ep_comp); +void libusb_free_ss_endpoint_comp(struct libusb_ss_endpoint_companion_descriptor *ep_comp); +int libusb_parse_bos_descriptor(const void *buf, int len, struct libusb_bos_descriptor **bos); +void libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos); /* Asynchronous device I/O */ Modified: user/attilio/vmcontention/lib/libusb/libusb10_desc.c ============================================================================== --- user/attilio/vmcontention/lib/libusb/libusb10_desc.c Sat Nov 12 16:47:23 2011 (r227468) +++ user/attilio/vmcontention/lib/libusb/libusb10_desc.c Sat Nov 12 17:12:33 2011 (r227469) @@ -298,7 +298,7 @@ libusb_get_string_descriptor_ascii(libus uint8_t desc_index, unsigned char *data, int length) { if (pdev == NULL || data == NULL || length < 1) - return (LIBUSB20_ERROR_INVALID_PARAM); + return (LIBUSB_ERROR_INVALID_PARAM); if (length > 65535) length = 65535; @@ -318,7 +318,7 @@ libusb_get_descriptor(libusb_device_hand uint8_t desc_index, uint8_t *data, int length) { if (devh == NULL || data == NULL || length < 1) - return (LIBUSB20_ERROR_INVALID_PARAM); + return (LIBUSB_ERROR_INVALID_PARAM); if (length > 65535) length = 65535; @@ -327,3 +327,172 @@ libusb_get_descriptor(libusb_device_hand LIBUSB_REQUEST_GET_DESCRIPTOR, (desc_type << 8) | desc_index, 0, data, length, 1000)); } + +int +libusb_parse_ss_endpoint_comp(const void *buf, int len, + struct libusb_ss_endpoint_companion_descriptor **ep_comp) +{ + if (buf == NULL || ep_comp == NULL || len < 1) + return (LIBUSB_ERROR_INVALID_PARAM); + + if (len > 65535) + len = 65535; + + *ep_comp = NULL; + + while (len != 0) { + uint8_t dlen; + uint8_t dtype; + + dlen = ((const uint8_t *)buf)[0]; + dtype = ((const uint8_t *)buf)[1]; + + if (dlen < 2 || dlen > len) + break; + + if (dlen >= LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE && + dtype == LIBUSB_DT_SS_ENDPOINT_COMPANION) { + struct libusb_ss_endpoint_companion_descriptor *ptr; + + ptr = malloc(sizeof(*ptr)); + if (ptr == NULL) + return (LIBUSB_ERROR_NO_MEM); + + ptr->bLength = LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE; + ptr->bDescriptorType = dtype; + ptr->bMaxBurst = ((const uint8_t *)buf)[2]; + ptr->bmAttributes = ((const uint8_t *)buf)[3]; + ptr->wBytesPerInterval = ((const uint8_t *)buf)[4] | + (((const uint8_t *)buf)[5] << 8); + + *ep_comp = ptr; + + return (0); /* success */ + } + + buf = ((const uint8_t *)buf) + dlen; + len -= dlen; + } + return (LIBUSB_ERROR_IO); +} + +void +libusb_free_ss_endpoint_comp(struct libusb_ss_endpoint_companion_descriptor *ep_comp) +{ + if (ep_comp == NULL) + return; + + free(ep_comp); +} + +int +libusb_parse_bos_descriptor(const void *buf, int len, + struct libusb_bos_descriptor **bos) +{ + struct libusb_bos_descriptor *ptr; + struct libusb_usb_2_0_device_capability_descriptor *dcap_20; + struct libusb_ss_usb_device_capability_descriptor *ss_cap; + + if (buf == NULL || bos == NULL || len < 1) + return (LIBUSB_ERROR_INVALID_PARAM); + + if (len > 65535) + len = 65535; + + *bos = ptr = NULL; + + while (len != 0) { + uint8_t dlen; + uint8_t dtype; + + dlen = ((const uint8_t *)buf)[0]; + dtype = ((const uint8_t *)buf)[1]; + + if (dlen < 2 || dlen > len) + break; + + if (dlen >= LIBUSB_DT_BOS_SIZE && + dtype == LIBUSB_DT_BOS) { + + ptr = malloc(sizeof(*ptr) + sizeof(*dcap_20) + + sizeof(*ss_cap)); + + if (ptr == NULL) + return (LIBUSB_ERROR_NO_MEM); + + *bos = ptr; + + ptr->bLength = LIBUSB_DT_BOS_SIZE; + ptr->bDescriptorType = dtype; + ptr->wTotalLength = ((const uint8_t *)buf)[2] | + (((const uint8_t *)buf)[3] << 8); + ptr->bNumDeviceCapabilities = ((const uint8_t *)buf)[4]; + ptr->usb_2_0_ext_cap = NULL; + ptr->ss_usb_cap = NULL; + + dcap_20 = (void *)(ptr + 1); + ss_cap = (void *)(dcap_20 + 1); + } + if (dlen >= 3 && + ptr != NULL && + dtype == LIBUSB_DT_DEVICE_CAPABILITY) { + switch (((const uint8_t *)buf)[2]) { + case LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY: + if (ptr->usb_2_0_ext_cap != NULL) + break; + if (dlen < LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY_SIZE) + break; + + ptr->usb_2_0_ext_cap = dcap_20; + + dcap_20->bLength = LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY_SIZE; + dcap_20->bDescriptorType = dtype; + dcap_20->bDevCapabilityType = ((const uint8_t *)buf)[2]; + dcap_20->bmAttributes = ((const uint8_t *)buf)[3] | + (((const uint8_t *)buf)[4] << 8) | + (((const uint8_t *)buf)[5] << 16) | + (((const uint8_t *)buf)[6] << 24); + break; + + case LIBUSB_SS_USB_DEVICE_CAPABILITY: + if (ptr->ss_usb_cap != NULL) + break; + if (dlen < LIBUSB_SS_USB_DEVICE_CAPABILITY_SIZE) + break; + + ptr->ss_usb_cap = ss_cap; + + ss_cap->bLength = LIBUSB_SS_USB_DEVICE_CAPABILITY_SIZE; + ss_cap->bDescriptorType = dtype; + ss_cap->bDevCapabilityType = ((const uint8_t *)buf)[2]; + ss_cap->bmAttributes = ((const uint8_t *)buf)[3]; + ss_cap->wSpeedSupported = ((const uint8_t *)buf)[4] | + (((const uint8_t *)buf)[5] << 8); + ss_cap->bFunctionalitySupport = ((const uint8_t *)buf)[6]; + ss_cap->bU1DevExitLat = ((const uint8_t *)buf)[7]; + ss_cap->wU2DevExitLat = ((const uint8_t *)buf)[8] | + (((const uint8_t *)buf)[9] << 8); + break; + + default: + break; + } + } + + buf = ((const uint8_t *)buf) + dlen; + len -= dlen; + } + if (ptr != NULL) + return (0); /* success */ + + return (LIBUSB_ERROR_IO); +} + +void +libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos) +{ + if (bos == NULL) + return; + + free(bos); +} Modified: user/attilio/vmcontention/lib/libusb/libusb20_desc.c ============================================================================== --- user/attilio/vmcontention/lib/libusb/libusb20_desc.c Sat Nov 12 16:47:23 2011 (r227468) +++ user/attilio/vmcontention/lib/libusb/libusb20_desc.c Sat Nov 12 17:12:33 2011 (r227469) @@ -41,6 +41,10 @@ LIBUSB20_MAKE_STRUCT_FORMAT(LIBUSB20_END LIBUSB20_MAKE_STRUCT_FORMAT(LIBUSB20_INTERFACE_DESC); LIBUSB20_MAKE_STRUCT_FORMAT(LIBUSB20_CONFIG_DESC); LIBUSB20_MAKE_STRUCT_FORMAT(LIBUSB20_CONTROL_SETUP); +LIBUSB20_MAKE_STRUCT_FORMAT(LIBUSB20_SS_ENDPT_COMP_DESC); +LIBUSB20_MAKE_STRUCT_FORMAT(LIBUSB20_USB_20_DEVCAP_DESC); +LIBUSB20_MAKE_STRUCT_FORMAT(LIBUSB20_SS_USB_DEVCAP_DESC); +LIBUSB20_MAKE_STRUCT_FORMAT(LIBUSB20_BOS_DESCRIPTOR); /*------------------------------------------------------------------------* * libusb20_parse_config_desc Modified: user/attilio/vmcontention/lib/libusb/libusb20_desc.h ============================================================================== --- user/attilio/vmcontention/lib/libusb/libusb20_desc.h Sat Nov 12 16:47:23 2011 (r227468) +++ user/attilio/vmcontention/lib/libusb/libusb20_desc.h Sat Nov 12 17:12:33 2011 (r227469) @@ -264,6 +264,43 @@ LIBUSB20_MAKE_STRUCT(LIBUSB20_CONFIG_DES LIBUSB20_MAKE_STRUCT(LIBUSB20_CONTROL_SETUP); +#define LIBUSB20_SS_ENDPT_COMP_DESC(m,n) \ + m(n, UINT8_T, bLength, ) \ + m(n, UINT8_T, bDescriptorType, ) \ + m(n, UINT8_T, bMaxBurst, ) \ + m(n, UINT8_T, bmAttributes, ) \ + m(n, UINT16_T, wBytesPerInterval, ) \ + +LIBUSB20_MAKE_STRUCT(LIBUSB20_SS_ENDPT_COMP_DESC); + +#define LIBUSB20_USB_20_DEVCAP_DESC(m,n) \ + m(n, UINT8_T, bLength, ) \ + m(n, UINT8_T, bDescriptorType, ) \ + m(n, UINT8_T, bDevCapabilityType, ) \ + m(n, UINT32_T, bmAttributes, ) \ + +LIBUSB20_MAKE_STRUCT(LIBUSB20_USB_20_DEVCAP_DESC); + +#define LIBUSB20_SS_USB_DEVCAP_DESC(m,n) \ + m(n, UINT8_T, bLength, ) \ + m(n, UINT8_T, bDescriptorType, ) \ + m(n, UINT8_T, bDevCapabilityType, ) \ + m(n, UINT8_T, bmAttributes, ) \ + m(n, UINT16_T, wSpeedSupported, ) \ + m(n, UINT8_T, bFunctionalitySupport, ) \ + m(n, UINT8_T, bU1DevExitLat, ) \ + m(n, UINT16_T, wU2DevExitLat, ) \ + +LIBUSB20_MAKE_STRUCT(LIBUSB20_SS_USB_DEVCAP_DESC); + +#define LIBUSB20_BOS_DESCRIPTOR(m,n) \ + m(n, UINT8_T, bLength, ) \ + m(n, UINT8_T, bDescriptorType, ) \ + m(n, UINT16_T, wTotalLength, ) \ + m(n, UINT8_T, bNumDeviceCapabilities, ) \ + +LIBUSB20_MAKE_STRUCT(LIBUSB20_BOS_DESCRIPTOR); + /* standard USB stuff */ /** \ingroup desc @@ -333,6 +370,24 @@ enum libusb20_descriptor_type { /** Hub descriptor */ LIBUSB20_DT_HUB = 0x29, + + /** Binary Object Store, BOS */ + LIBUSB20_DT_BOS = 0x0f, + + /** Device Capability */ + LIBUSB20_DT_DEVICE_CAPABILITY = 0x10, + + /** SuperSpeed endpoint companion */ + LIBUSB20_DT_SS_ENDPOINT_COMPANION = 0x30, +}; + +/** \ingroup desc + * Device capability types as defined by the USB specification. */ +enum libusb20_device_capability_type { + LIBUSB20_WIRELESS_USB_DEVICE_CAPABILITY = 0x1, + LIBUSB20_USB_2_0_EXTENSION_DEVICE_CAPABILITY = 0x2, + LIBUSB20_SS_USB_DEVICE_CAPABILITY = 0x3, + LIBUSB20_CONTAINER_ID_DEVICE_CAPABILITY = 0x4, }; /* Descriptor sizes per descriptor type */ @@ -342,6 +397,10 @@ enum libusb20_descriptor_type { #define LIBUSB20_DT_ENDPOINT_SIZE 7 #define LIBUSB20_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */ #define LIBUSB20_DT_HUB_NONVAR_SIZE 7 +#define LIBUSB20_DT_SS_ENDPOINT_COMPANION_SIZE 6 +#define LIBUSB20_DT_BOS_SIZE 5 +#define LIBUSB20_USB_2_0_EXTENSION_DEVICE_CAPABILITY_SIZE 7 +#define LIBUSB20_SS_USB_DEVICE_CAPABILITY_SIZE 10 #define LIBUSB20_ENDPOINT_ADDRESS_MASK 0x0f /* in bEndpointAddress */ #define LIBUSB20_ENDPOINT_DIR_MASK 0x80 Modified: user/attilio/vmcontention/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- user/attilio/vmcontention/release/doc/en_US.ISO8859-1/hardware/article.sgml Sat Nov 12 16:47:23 2011 (r227468) +++ user/attilio/vmcontention/release/doc/en_US.ISO8859-1/hardware/article.sgml Sat Nov 12 17:12:33 2011 (r227469) @@ -798,8 +798,12 @@ &hwlist.mly; + &hwlist.mps; + &hwlist.mpt; + &hwlist.mvs; + &hwlist.ncr; &hwlist.ncv; Modified: user/attilio/vmcontention/sbin/ffsinfo/Makefile ============================================================================== --- user/attilio/vmcontention/sbin/ffsinfo/Makefile Sat Nov 12 16:47:23 2011 (r227468) +++ user/attilio/vmcontention/sbin/ffsinfo/Makefile Sat Nov 12 17:12:33 2011 (r227469) @@ -15,5 +15,5 @@ WARNS?= 1 CFLAGS+=-DFS_DEBUG -I${GROWFS} DPADD= ${LIBUFS} LDADD= -lufs - -.include <bsd.prog.mk> + +.include <bsd.prog.mk> Modified: user/attilio/vmcontention/sbin/geom/class/multipath/geom_multipath.c ============================================================================== --- user/attilio/vmcontention/sbin/geom/class/multipath/geom_multipath.c Sat Nov 12 16:47:23 2011 (r227468) +++ user/attilio/vmcontention/sbin/geom/class/multipath/geom_multipath.c Sat Nov 12 17:12:33 2011 (r227469) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include <strings.h> #include <assert.h> #include <libgeom.h> +#include <unistd.h> #include <uuid.h> #include <geom/multipath/g_multipath.h> @@ -48,31 +49,58 @@ uint32_t version = G_MULTIPATH_VERSION; static void mp_main(struct gctl_req *, unsigned int); static void mp_label(struct gctl_req *); static void mp_clear(struct gctl_req *); -static void mp_add(struct gctl_req *); struct g_command class_commands[] = { { - "label", G_FLAG_VERBOSE | G_FLAG_LOADKLD, mp_main, G_NULL_OPTS, - "[-v] name prov ..." + "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL, + { + { 'A', "active_active", NULL, G_TYPE_BOOL }, + G_OPT_SENTINEL + }, + "[-vA] name prov ..." }, { - "add", G_FLAG_VERBOSE | G_FLAG_LOADKLD, mp_main, G_NULL_OPTS, - "[-v] name prov ..." + "label", G_FLAG_VERBOSE | G_FLAG_LOADKLD, mp_main, + { + { 'A', "active_active", NULL, G_TYPE_BOOL }, + G_OPT_SENTINEL + }, + "[-vA] name prov ..." }, { - "destroy", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, - "[-v] prov ..." + "add", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "[-v] name prov" }, { - "clear", G_FLAG_VERBOSE, mp_main, G_NULL_OPTS, - "[-v] prov ..." + "remove", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "[-v] name prov" + }, + { + "fail", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "[-v] name prov" + }, + { + "restore", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "[-v] name prov" }, { "rotate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, - "[-v] prov ..." + "[-v] name" }, { "getactive", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "[-v] name" + }, + { + "destroy", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "[-v] name" + }, + { + "stop", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "[-v] name" + }, + { + "clear", G_FLAG_VERBOSE, mp_main, G_NULL_OPTS, "[-v] prov ..." }, G_CMD_SENTINEL @@ -90,8 +118,6 @@ mp_main(struct gctl_req *req, unsigned i } if (strcmp(name, "label") == 0) { mp_label(req); - } else if (strcmp(name, "add") == 0) { - mp_add(req); } else if (strcmp(name, "clear") == 0) { mp_clear(req); } else { @@ -103,13 +129,13 @@ static void mp_label(struct gctl_req *req) { struct g_multipath_metadata md; - off_t disksiz = 0, msize; - uint8_t *sector; + off_t disksize = 0, msize; + uint8_t *sector, *rsector; char *ptr; uuid_t uuid; uint32_t secsize = 0, ssize, status; - const char *name, *mpname; - int error, i, nargs; + const char *name, *name2, *mpname; + int error, i, nargs, fd; nargs = gctl_get_int(req, "nargs"); if (nargs < 2) { @@ -132,14 +158,14 @@ mp_label(struct gctl_req *req) } if (i == 1) { secsize = ssize; - disksiz = msize; + disksize = msize; } else { if (secsize != ssize) { gctl_error(req, "%s sector size %u different.", name, ssize); return; } - if (disksiz != msize) { + if (disksize != msize) { gctl_error(req, "%s media size %ju different.", name, (intmax_t)msize); return; @@ -155,7 +181,7 @@ mp_label(struct gctl_req *req) md.md_version = G_MULTIPATH_VERSION; mpname = gctl_get_ascii(req, "arg0"); strlcpy(md.md_name, mpname, sizeof(md.md_name)); - md.md_size = disksiz; + md.md_size = disksize; md.md_sectorsize = secsize; uuid_create(&uuid, &status); if (status != uuid_s_ok) { @@ -168,19 +194,10 @@ mp_label(struct gctl_req *req) return; } strlcpy(md.md_uuid, ptr, sizeof (md.md_uuid)); + md.md_active_active = gctl_get_int(req, "active_active"); free(ptr); /* - * Clear metadata on initial provider first. - */ - name = gctl_get_ascii(req, "arg1"); - error = g_metadata_clear(name, NULL); - if (error != 0) { - gctl_error(req, "cannot clear metadata on %s: %s.", name, strerror(error)); - return; - } - - /* * Allocate a sector to write as metadata. */ sector = malloc(secsize); @@ -189,6 +206,12 @@ mp_label(struct gctl_req *req) return; } memset(sector, 0, secsize); + rsector = malloc(secsize); + if (rsector == NULL) { + free(sector); + gctl_error(req, "unable to allocate metadata buffer"); + return; + } /* * encode the metadata @@ -198,6 +221,7 @@ mp_label(struct gctl_req *req) /* * Store metadata on the initial provider. */ + name = gctl_get_ascii(req, "arg1"); error = g_metadata_store(name, sector, secsize); if (error != 0) { gctl_error(req, "cannot store metadata on %s: %s.", name, strerror(error)); @@ -205,20 +229,29 @@ mp_label(struct gctl_req *req) } /* - * Now add the rest of the providers. + * Now touch the rest of the providers to hint retaste. */ - error = gctl_change_param(req, "verb", -1, "add"); - if (error) { - gctl_error(req, "unable to change verb to \"add\": %s.", strerror(error)); - return; - } for (i = 2; i < nargs; i++) { - error = gctl_change_param(req, "arg1", -1, gctl_get_ascii(req, "arg%d", i)); - if (error) { - gctl_error(req, "unable to add %s to %s: %s.", gctl_get_ascii(req, "arg%d", i), mpname, strerror(error)); + name2 = gctl_get_ascii(req, "arg%d", i); + fd = g_open(name2, 1); + if (fd < 0) { + fprintf(stderr, "Unable to open %s: %s.\n", + name2, strerror(errno)); + continue; + } + if (pread(fd, rsector, secsize, disksize - secsize) != + secsize) { + fprintf(stderr, "Unable to read metadata from %s: %s.\n", + name2, strerror(errno)); + g_close(fd); continue; } - mp_add(req); + g_close(fd); + if (memcmp(sector, rsector, secsize)) { + fprintf(stderr, "No metadata found on %s." + " It is not a path of %s.\n", + name2, name); + } } } @@ -247,13 +280,3 @@ mp_clear(struct gctl_req *req) } } -static void -mp_add(struct gctl_req *req) -{ - const char *errstr; - - errstr = gctl_issue(req); - if (errstr != NULL && errstr[0] != '\0') { - gctl_error(req, "%s", errstr); - } -} Modified: user/attilio/vmcontention/sbin/geom/class/multipath/gmultipath.8 ============================================================================== --- user/attilio/vmcontention/sbin/geom/class/multipath/gmultipath.8 Sat Nov 12 16:47:23 2011 (r227468) +++ user/attilio/vmcontention/sbin/geom/class/multipath/gmultipath.8 Sat Nov 12 17:12:33 2011 (r227469) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 26, 2007 +.Dd October 31, 2011 .Dt GMULTIPATH 8 .Os .Sh NAME @@ -32,11 +32,48 @@ .Nd "disk multipath control utility" .Sh SYNOPSIS .Nm +.Cm create +.Op Fl Av +.Ar name +.Ar prov ... +.Nm .Cm label -.Op Fl hv +.Op Fl Av .Ar name .Ar prov ... .Nm +.Cm add +.Op Fl v +.Ar name prov +.Nm +.Cm remove +.Op Fl v +.Ar name prov +.Nm +.Cm fail +.Op Fl v +.Ar name prov +.Nm +.Cm restore +.Op Fl v +.Ar name prov +.Nm +.Cm rotate +.Op Fl v +.Ar name +.Nm +.Cm getactive +.Op Fl v +.Ar name +.Nm +.Cm destroy +.Op Fl v +.Ar name +.Nm +.Cm stop +.Op Fl v +.Ar name +.Nm .Cm clear .Op Fl v .Ar prov ... @@ -53,27 +90,79 @@ The .Nm utility is used for device multipath configuration. .Pp -Only automatic configuration is supported at the present time via the -.Cm label -command. -This operation writes a label on the last sector of the underlying *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111121712.pACHCXAv053926>