From owner-svn-src-projects@FreeBSD.ORG Sun Jun 19 14:22:36 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 451C1106566B; Sun, 19 Jun 2011 14:22:36 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30DF28FC15; Sun, 19 Jun 2011 14:22:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5JEMaEj097245; Sun, 19 Jun 2011 14:22:36 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JEMZRl097206; Sun, 19 Jun 2011 14:22:35 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201106191422.p5JEMZRl097206@svn.freebsd.org> From: Attilio Rao Date: Sun, 19 Jun 2011 14:22:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223297 - in projects/largeSMP: . bin/sh cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/ld contrib/... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2011 14:22:36 -0000 Author: attilio Date: Sun Jun 19 14:22:35 2011 New Revision: 223297 URL: http://svn.freebsd.org/changeset/base/223297 Log: MFC Added: projects/largeSMP/etc/rc.d/kld - copied unchanged from r223296, head/etc/rc.d/kld projects/largeSMP/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S - copied unchanged from r223296, head/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S projects/largeSMP/sys/fs/nfsclient/nfs_clkdtrace.c - copied unchanged from r223296, head/sys/fs/nfsclient/nfs_clkdtrace.c projects/largeSMP/sys/fs/nfsclient/nfs_kdtrace.h - copied unchanged from r223296, head/sys/fs/nfsclient/nfs_kdtrace.h projects/largeSMP/sys/modules/dtrace/dtnfscl/ - copied from r223296, head/sys/modules/dtrace/dtnfscl/ projects/largeSMP/tools/build/options/WITHOUT_UTMPX - copied unchanged from r223296, head/tools/build/options/WITHOUT_UTMPX projects/largeSMP/tools/regression/bin/sh/builtins/case9.0 - copied unchanged from r223296, head/tools/regression/bin/sh/builtins/case9.0 projects/largeSMP/tools/regression/bin/sh/builtins/export1.0 - copied unchanged from r223296, head/tools/regression/bin/sh/builtins/export1.0 projects/largeSMP/tools/regression/bin/sh/builtins/set2.0 - copied unchanged from r223296, head/tools/regression/bin/sh/builtins/set2.0 projects/largeSMP/tools/regression/bin/sh/execution/bg4.0 - copied unchanged from r223296, head/tools/regression/bin/sh/execution/bg4.0 projects/largeSMP/tools/regression/bin/sh/expansion/cmdsubst11.0 - copied unchanged from r223296, head/tools/regression/bin/sh/expansion/cmdsubst11.0 Modified: projects/largeSMP/Makefile projects/largeSMP/Makefile.inc1 projects/largeSMP/UPDATING projects/largeSMP/bin/sh/eval.c projects/largeSMP/bin/sh/mktokens projects/largeSMP/bin/sh/nodetypes projects/largeSMP/bin/sh/options.h projects/largeSMP/bin/sh/parser.c projects/largeSMP/bin/sh/sh.1 projects/largeSMP/bin/sh/var.c projects/largeSMP/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c projects/largeSMP/contrib/binutils/bfd/coffcode.h projects/largeSMP/contrib/binutils/bfd/opncls.c projects/largeSMP/contrib/binutils/bfd/peicode.h projects/largeSMP/contrib/binutils/gas/config/obj-elf.c projects/largeSMP/contrib/binutils/gas/frags.c projects/largeSMP/contrib/binutils/gas/subsegs.c projects/largeSMP/contrib/binutils/ld/ldexp.c projects/largeSMP/contrib/binutils/ld/sysdep.h projects/largeSMP/contrib/binutils/opcodes/i386-dis.c projects/largeSMP/contrib/dialog/dialog.h projects/largeSMP/contrib/gcc/cfg.c projects/largeSMP/contrib/gcc/output.h projects/largeSMP/contrib/gcc/rtl.h projects/largeSMP/contrib/gcc/tree.h projects/largeSMP/contrib/gperf/src/gen-perf.cc projects/largeSMP/contrib/gperf/src/key-list.cc projects/largeSMP/etc/defaults/rc.conf projects/largeSMP/etc/periodic/monthly/Makefile projects/largeSMP/etc/rc.d/Makefile projects/largeSMP/etc/rc.d/var projects/largeSMP/etc/rc.subr projects/largeSMP/lib/libc/db/btree/bt_split.c projects/largeSMP/lib/libc/db/man/mpool.3 projects/largeSMP/lib/libc/gen/basename.3 projects/largeSMP/lib/libc/gen/basename.c projects/largeSMP/lib/libc/gen/ftw.c projects/largeSMP/lib/libc/gen/posix_spawn.3 projects/largeSMP/lib/libc/iconv/citrus_mapper.c projects/largeSMP/lib/libc/iconv/iconv.c projects/largeSMP/lib/libc/net/sctp_opt_info.3 projects/largeSMP/lib/libc/net/sctp_sys_calls.c projects/largeSMP/lib/libc/sys/wait.2 projects/largeSMP/lib/libprocstat/libprocstat.c projects/largeSMP/lib/libstand/Makefile projects/largeSMP/lib/libstand/zalloc_malloc.c projects/largeSMP/lib/libthr/arch/sparc64/Makefile.inc projects/largeSMP/lib/libthr/arch/sparc64/include/pthread_md.h projects/largeSMP/lib/libthr/arch/sparc64/sparc64/pthread_md.c projects/largeSMP/lib/libthr/thread/thr_init.c projects/largeSMP/lib/msun/ld80/e_rem_pio2l.h projects/largeSMP/libexec/rtld-elf/rtld.c projects/largeSMP/sbin/ddb/ddb.8 projects/largeSMP/sbin/geom/class/part/geom_part.c projects/largeSMP/sbin/hastd/primary.c projects/largeSMP/sbin/hastd/secondary.c projects/largeSMP/sbin/ipfw/ipfw2.c projects/largeSMP/sbin/ipfw/nat.c projects/largeSMP/share/examples/etc/make.conf projects/largeSMP/share/man/man4/snd_hda.4 projects/largeSMP/share/man/man5/make.conf.5 projects/largeSMP/share/man/man5/rc.conf.5 projects/largeSMP/share/man/man5/src.conf.5 projects/largeSMP/share/man/man7/build.7 projects/largeSMP/share/man/man9/Makefile projects/largeSMP/share/man/man9/device_get_sysctl.9 projects/largeSMP/share/misc/usb_hid_usages projects/largeSMP/share/mk/bsd.own.mk projects/largeSMP/sys/amd64/ia32/ia32_sigtramp.S projects/largeSMP/sys/boot/common/load_elf_obj.c projects/largeSMP/sys/boot/i386/libi386/biosacpi.c projects/largeSMP/sys/cam/ata/ata_da.c projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h projects/largeSMP/sys/compat/freebsd32/freebsd32_misc.c projects/largeSMP/sys/compat/freebsd32/freebsd32_proto.h projects/largeSMP/sys/compat/freebsd32/freebsd32_syscall.h projects/largeSMP/sys/compat/freebsd32/freebsd32_syscalls.c projects/largeSMP/sys/compat/freebsd32/freebsd32_sysent.c projects/largeSMP/sys/compat/freebsd32/syscalls.master projects/largeSMP/sys/compat/linprocfs/linprocfs.c projects/largeSMP/sys/dev/acpica/acpi.c projects/largeSMP/sys/dev/acpica/acpi_pci.c projects/largeSMP/sys/dev/e1000/if_igb.c projects/largeSMP/sys/dev/e1000/if_igb.h projects/largeSMP/sys/dev/pccbb/pccbb.c projects/largeSMP/sys/dev/usb/net/if_udav.c projects/largeSMP/sys/dev/usb/usbdevs projects/largeSMP/sys/fs/nfs/nfs_commonkrpc.c projects/largeSMP/sys/fs/nfs/nfsport.h projects/largeSMP/sys/fs/nfs/nfsproto.h projects/largeSMP/sys/fs/nfsclient/nfs_clbio.c projects/largeSMP/sys/fs/nfsclient/nfs_clnode.c projects/largeSMP/sys/fs/nfsclient/nfs_clport.c projects/largeSMP/sys/fs/nfsclient/nfs_clsubs.c projects/largeSMP/sys/fs/nfsclient/nfs_clvnops.c projects/largeSMP/sys/ia64/ia64/busdma_machdep.c projects/largeSMP/sys/ia64/ia64/pmap.c projects/largeSMP/sys/ia64/include/ia64_cpu.h projects/largeSMP/sys/kern/imgact_aout.c projects/largeSMP/sys/kern/link_elf.c projects/largeSMP/sys/kern/sys_process.c projects/largeSMP/sys/modules/dtrace/Makefile projects/largeSMP/sys/modules/dtrace/dtraceall/dtraceall.c projects/largeSMP/sys/net/if_gre.c projects/largeSMP/sys/net/if_gre.h projects/largeSMP/sys/netinet/if_ether.c projects/largeSMP/sys/netinet/sctp.h projects/largeSMP/sys/netinet/sctp_uio.h projects/largeSMP/sys/netinet/sctp_usrreq.c projects/largeSMP/sys/sparc64/sparc64/intr_machdep.c projects/largeSMP/sys/sys/diskpc98.h projects/largeSMP/sys/sys/dtrace_bsd.h projects/largeSMP/sys/sys/param.h projects/largeSMP/sys/ufs/ffs/ffs_extern.h projects/largeSMP/sys/ufs/ffs/ffs_snapshot.c projects/largeSMP/sys/x86/x86/tsc.c projects/largeSMP/tools/build/mk/OptionalObsoleteFiles.inc projects/largeSMP/tools/build/options/WITHOUT_ACCT projects/largeSMP/usr.bin/Makefile projects/largeSMP/usr.bin/fstat/fuser.c projects/largeSMP/usr.bin/kdump/mksubr projects/largeSMP/usr.bin/ldd/sods.c projects/largeSMP/usr.bin/users/users.c projects/largeSMP/usr.bin/xlint/lint1/decl.c projects/largeSMP/usr.bin/xlint/lint1/scan.l projects/largeSMP/usr.bin/xlint/lint2/msg.c projects/largeSMP/usr.bin/xlint/lint2/read.c projects/largeSMP/usr.sbin/Makefile projects/largeSMP/usr.sbin/fdread/fdread.c projects/largeSMP/usr.sbin/jls/jls.c projects/largeSMP/usr.sbin/makefs/ffs/ffs_bswap.c projects/largeSMP/usr.sbin/makefs/ffs/ffs_subr.c projects/largeSMP/usr.sbin/mfiutil/mfiutil.c Directory Properties: projects/largeSMP/ (props changed) projects/largeSMP/cddl/contrib/opensolaris/ (props changed) projects/largeSMP/contrib/bind9/ (props changed) projects/largeSMP/contrib/binutils/ (props changed) projects/largeSMP/contrib/bzip2/ (props changed) projects/largeSMP/contrib/compiler-rt/ (props changed) projects/largeSMP/contrib/dialog/ (props changed) projects/largeSMP/contrib/ee/ (props changed) projects/largeSMP/contrib/expat/ (props changed) projects/largeSMP/contrib/file/ (props changed) projects/largeSMP/contrib/gcc/ (props changed) projects/largeSMP/contrib/gdb/ (props changed) projects/largeSMP/contrib/gdtoa/ (props changed) projects/largeSMP/contrib/gnu-sort/ (props changed) projects/largeSMP/contrib/groff/ (props changed) projects/largeSMP/contrib/less/ (props changed) projects/largeSMP/contrib/libpcap/ (props changed) projects/largeSMP/contrib/libstdc++/ (props changed) projects/largeSMP/contrib/llvm/ (props changed) projects/largeSMP/contrib/llvm/tools/clang/ (props changed) projects/largeSMP/contrib/ncurses/ (props changed) projects/largeSMP/contrib/netcat/ (props changed) projects/largeSMP/contrib/ntp/ (props changed) projects/largeSMP/contrib/one-true-awk/ (props changed) projects/largeSMP/contrib/openbsm/ (props changed) projects/largeSMP/contrib/openpam/ (props changed) projects/largeSMP/contrib/pf/ (props changed) projects/largeSMP/contrib/sendmail/ (props changed) projects/largeSMP/contrib/tcpdump/ (props changed) projects/largeSMP/contrib/tcsh/ (props changed) projects/largeSMP/contrib/top/ (props changed) projects/largeSMP/contrib/top/install-sh (props changed) projects/largeSMP/contrib/tzcode/stdtime/ (props changed) projects/largeSMP/contrib/tzcode/zic/ (props changed) projects/largeSMP/contrib/tzdata/ (props changed) projects/largeSMP/contrib/wpa/ (props changed) projects/largeSMP/contrib/xz/ (props changed) projects/largeSMP/crypto/openssh/ (props changed) projects/largeSMP/crypto/openssl/ (props changed) projects/largeSMP/gnu/lib/ (props changed) projects/largeSMP/gnu/usr.bin/binutils/ (props changed) projects/largeSMP/gnu/usr.bin/cc/cc_tools/ (props changed) projects/largeSMP/gnu/usr.bin/gdb/ (props changed) projects/largeSMP/lib/libc/ (props changed) projects/largeSMP/lib/libc/stdtime/ (props changed) projects/largeSMP/lib/libutil/ (props changed) projects/largeSMP/lib/libz/ (props changed) projects/largeSMP/sbin/ (props changed) projects/largeSMP/sbin/ipfw/ (props changed) projects/largeSMP/share/mk/bsd.arch.inc.mk (props changed) projects/largeSMP/share/zoneinfo/ (props changed) projects/largeSMP/sys/ (props changed) projects/largeSMP/sys/amd64/include/xen/ (props changed) projects/largeSMP/sys/boot/ (props changed) projects/largeSMP/sys/boot/i386/efi/ (props changed) projects/largeSMP/sys/boot/ia64/efi/ (props changed) projects/largeSMP/sys/boot/ia64/ski/ (props changed) projects/largeSMP/sys/boot/powerpc/boot1.chrp/ (props changed) projects/largeSMP/sys/boot/powerpc/ofw/ (props changed) projects/largeSMP/sys/cddl/contrib/opensolaris/ (props changed) projects/largeSMP/sys/conf/ (props changed) projects/largeSMP/sys/contrib/dev/acpica/ (props changed) projects/largeSMP/sys/contrib/octeon-sdk/ (props changed) projects/largeSMP/sys/contrib/pf/ (props changed) projects/largeSMP/sys/contrib/x86emu/ (props changed) projects/largeSMP/usr.bin/calendar/ (props changed) projects/largeSMP/usr.bin/csup/ (props changed) projects/largeSMP/usr.bin/procstat/ (props changed) projects/largeSMP/usr.sbin/ndiscvt/ (props changed) projects/largeSMP/usr.sbin/zic/ (props changed) Modified: projects/largeSMP/Makefile ============================================================================== --- projects/largeSMP/Makefile Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/Makefile Sun Jun 19 14:22:35 2011 (r223297) @@ -19,7 +19,7 @@ # kernel - buildkernel + installkernel. # kernel-toolchain - Builds the subset of world necessary to build a kernel # doxygen - Build API documentation of the kernel, needs doxygen. -# update - Convenient way to update your source tree (cvs). +# update - Convenient way to update your source tree(s). # check-old - List obsolete directories/files/libraries. # check-old-dirs - List obsolete directories. # check-old-files - List obsolete files. Modified: projects/largeSMP/Makefile.inc1 ============================================================================== --- projects/largeSMP/Makefile.inc1 Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/Makefile.inc1 Sun Jun 19 14:22:35 2011 (r223297) @@ -12,6 +12,7 @@ # -DNO_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel # -DNO_PORTSUPDATE do not update ports in ${MAKE} update # -DNO_DOCUPDATE do not update doc in ${MAKE} update +# -DNO_WWWUPDATE do not update www in ${MAKE} update # -DNO_CTF do not run the DTrace CTF conversion tools on built objects # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list # TARGET="machine" to crossbuild world for a different machine type @@ -904,7 +905,7 @@ doxygen: # # update # -# Update the source tree, by running cvsup and/or running cvs to update to the +# Update the source tree(s), by running cvsup/cvs/svn to update to the # latest copy. # update: @@ -927,6 +928,9 @@ update: .if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE) @${SUP} ${SUPFLAGS} ${DOCSUPFILE} .endif +.if defined(WWWSUPFILE) && !defined(NO_WWWUPDATE) + @${SUP} ${SUPFLAGS} ${WWWSUPFILE} +.endif .endif .if defined(CVS_UPDATE) @cd ${.CURDIR} ; \ Modified: projects/largeSMP/UPDATING ============================================================================== --- projects/largeSMP/UPDATING Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/UPDATING Sun Jun 19 14:22:35 2011 (r223297) @@ -52,6 +52,18 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. 20110513: Support for sun4v architecture is officially dropped +20110503: + Several KPI breaking changes have been committed to the mii(4) layer, + the PHY drivers and consequently some Ethernet drivers using mii(4). + This means that miibus.ko and the modules of the affected Ethernet + drivers need to be recompiled. + + Note to kernel developers: Given that the OUI bit reversion problem + was fixed as part of these changes all mii(4) commits related to OUIs, + i.e. to sys/dev/mii/miidevs, PHY driver probing and vendor specific + handling, no longer can be merged verbatim to stable/8 and previous + branches. + 20110430: Users of the Atheros AR71xx SoC code now need to add 'device ar71xx_pci' into their kernel configurations along with 'device pci'. Modified: projects/largeSMP/bin/sh/eval.c ============================================================================== --- projects/largeSMP/bin/sh/eval.c Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/bin/sh/eval.c Sun Jun 19 14:22:35 2011 (r223297) @@ -140,7 +140,7 @@ evalcmd(int argc, char **argv) STPUTC('\0', concat); p = grabstackstr(concat); } - evalstring(p, builtin_flags & EV_TESTED); + evalstring(p, builtin_flags); } else exitstatus = 0; return exitstatus; @@ -386,6 +386,14 @@ evalcase(union node *n, int flags) for (cp = n->ncase.cases ; cp && evalskip == 0 ; cp = cp->nclist.next) { for (patp = cp->nclist.pattern ; patp ; patp = patp->narg.next) { if (casematch(patp, arglist.list->text)) { + while (cp->nclist.next && + cp->type == NCLISTFALLTHRU) { + if (evalskip != 0) + break; + evaltree(cp->nclist.body, + flags & ~EV_EXIT); + cp = cp->nclist.next; + } if (evalskip == 0) { evaltree(cp->nclist.body, flags); } @@ -886,14 +894,13 @@ evalcommand(union node *cmd, int flags, } /* Fork off a child process if necessary. */ - if (cmd->ncmd.backgnd - || ((cmdentry.cmdtype == CMDNORMAL || cmdentry.cmdtype == CMDUNKNOWN) + if (((cmdentry.cmdtype == CMDNORMAL || cmdentry.cmdtype == CMDUNKNOWN) && ((flags & EV_EXIT) == 0 || have_traps())) || ((flags & EV_BACKCMD) != 0 && (cmdentry.cmdtype != CMDBUILTIN || !safe_builtin(cmdentry.u.index, argc, argv)))) { jp = makejob(cmd, 1); - mode = cmd->ncmd.backgnd; + mode = FORK_FG; if (flags & EV_BACKCMD) { mode = FORK_NOJOB; if (pipe(pip) < 0) @@ -908,6 +915,7 @@ evalcommand(union node *cmd, int flags, dup2(pip[1], 1); close(pip[1]); } + flags &= ~EV_BACKCMD; } flags |= EV_EXIT; } @@ -1059,8 +1067,7 @@ parent: /* parent process gets here (if backcmd->fd = pip[0]; close(pip[1]); backcmd->jp = jp; - } else - exitstatus = 0; + } out: if (lastarg) Modified: projects/largeSMP/bin/sh/mktokens ============================================================================== --- projects/largeSMP/bin/sh/mktokens Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/bin/sh/mktokens Sun Jun 19 14:22:35 2011 (r223297) @@ -50,6 +50,7 @@ TPIPE 0 "|" TLP 0 "(" TRP 1 ")" TENDCASE 1 ";;" +TFALLTHRU 1 ";&" TREDIR 0 redirection TWORD 0 word TIF 0 "if" Modified: projects/largeSMP/bin/sh/nodetypes ============================================================================== --- projects/largeSMP/bin/sh/nodetypes Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/bin/sh/nodetypes Sun Jun 19 14:22:35 2011 (r223297) @@ -56,7 +56,6 @@ NSEMI nbinary # two commands separated NCMD ncmd # a simple command type int - backgnd int # set to run command in background args nodeptr # the arguments redirect nodeptr # list of file redirections @@ -96,12 +95,13 @@ NCASE ncase # a case statement expr nodeptr # the word to switch on cases nodeptr # the list of cases (NCLIST nodes) -NCLIST nclist # a case +NCLIST nclist # a case ending with ;; type int next nodeptr # the next case in list pattern nodeptr # list of patterns for this case body nodeptr # code to execute for this case +NCLISTFALLTHRU nclist # a case ending with ;& NDEFUN narg # define a function. The "next" field contains # the body of the function. Modified: projects/largeSMP/bin/sh/options.h ============================================================================== --- projects/largeSMP/bin/sh/options.h Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/bin/sh/options.h Sun Jun 19 14:22:35 2011 (r223297) @@ -62,8 +62,9 @@ struct shparam { #define privileged optlist[15].val #define Tflag optlist[16].val #define Pflag optlist[17].val +#define hflag optlist[18].val -#define NOPTS 18 +#define NOPTS 19 struct optent { const char *name; @@ -91,6 +92,7 @@ struct optent optlist[NOPTS] = { { "privileged", 'p', 0 }, { "trapsasync", 'T', 0 }, { "physical", 'P', 0 }, + { "trackall", 'h', 0 }, }; #else extern struct optent optlist[NOPTS]; Modified: projects/largeSMP/bin/sh/parser.c ============================================================================== --- projects/largeSMP/bin/sh/parser.c Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/bin/sh/parser.c Sun Jun 19 14:22:35 2011 (r223297) @@ -240,8 +240,8 @@ list(int nlflag, int erflag) n2 = andor(); tok = readtoken(); if (tok == TBACKGND) { - if (n2->type == NCMD || n2->type == NPIPE) { - n2->ncmd.backgnd = 1; + if (n2->type == NPIPE) { + n2->npipe.backgnd = 1; } else if (n2->type == NREDIR) { n2->type = NBACKGND; } else { @@ -542,10 +542,13 @@ TRACE(("expecting DO got %s %s\n", tokna checkkwd = CHKNL | CHKKWD | CHKALIAS; if ((t = readtoken()) != TESAC) { - if (t != TENDCASE) - synexpect(TENDCASE); + if (t == TENDCASE) + ; + else if (t == TFALLTHRU) + cp->type = NCLISTFALLTHRU; else - checkkwd = CHKNL | CHKKWD, readtoken(); + synexpect(TENDCASE); + checkkwd = CHKNL | CHKKWD, readtoken(); } cpp = &cp->nclist.next; } @@ -686,7 +689,6 @@ simplecmd(union node **rpp, union node * *rpp = NULL; n = (union node *)stalloc(sizeof (struct ncmd)); n->type = NCMD; - n->ncmd.backgnd = 0; n->ncmd.args = args; n->ncmd.redirect = redir; return n; @@ -931,8 +933,11 @@ xxreadtoken(void) pungetc(); RETURN(TPIPE); case ';': - if (pgetc() == ';') + c = pgetc(); + if (c == ';') RETURN(TENDCASE); + else if (c == '&') + RETURN(TFALLTHRU); pungetc(); RETURN(TSEMI); case '(': Modified: projects/largeSMP/bin/sh/sh.1 ============================================================================== --- projects/largeSMP/bin/sh/sh.1 Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/bin/sh/sh.1 Sun Jun 19 14:22:35 2011 (r223297) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd June 15, 2011 +.Dd June 18, 2011 .Dt SH 1 .Os .Sh NAME @@ -241,6 +241,10 @@ tested, all commands of the function are well. .It Fl f Li noglob Disable pathname expansion. +.It Fl h Li trackall +A do-nothing option for +.Tn POSIX +compliance. .It Fl I Li ignoreeof Ignore .Dv EOF Ap s @@ -372,7 +376,7 @@ The following is a list of valid operato .It Control operators: .Bl -column "XXX" "XXX" "XXX" "XXX" "XXX" -offset center -compact .It Li & Ta Li && Ta Li ( Ta Li ) Ta Li \en -.It Li ;; Ta Li ; Ta Li | Ta Li || +.It Li ;; Ta Li ;& Ta Li ; Ta Li | Ta Li || .El .It Redirection operators: .Bl -column "XXX" "XXX" "XXX" "XXX" "XXX" -offset center -compact @@ -990,6 +994,11 @@ described later), separated by .Ql \&| characters. +If the selected list is terminated by the control operator +.Ql ;& +instead of +.Ql ;; , +execution continues with the next list. The exit code of the .Ic case command is the exit code of the last command executed in the list or Modified: projects/largeSMP/bin/sh/var.c ============================================================================== --- projects/largeSMP/bin/sh/var.c Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/bin/sh/var.c Sun Jun 19 14:22:35 2011 (r223297) @@ -612,6 +612,12 @@ showvarscmd(int argc __unused, char **ar qsort(vars, n, sizeof(*vars), var_compare); for (i = 0; i < n; i++) { + /* + * Skip improper variable names so the output remains usable as + * shell input. + */ + if (!isassignment(vars[i])) + continue; s = strchr(vars[i], '='); s++; outbin(vars[i], s - vars[i], out1); @@ -683,6 +689,13 @@ exportcmd(int argc, char **argv) for (vp = *vpp ; vp ; vp = vp->next) { if (vp->flags & flag) { if (values) { + /* + * Skip improper variable names + * so the output remains usable + * as shell input. + */ + if (!isassignment(vp->text)) + continue; out1str(cmdname); out1c(' '); } Modified: projects/largeSMP/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c ============================================================================== --- projects/largeSMP/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Sun Jun 19 14:22:35 2011 (r223297) @@ -45,6 +45,7 @@ #include #include #include +#include #include @@ -811,15 +812,14 @@ dt_basename(char *str) ulong_t dt_popc(ulong_t x) { -#ifdef _ILP32 +#if defined(_ILP32) x = x - ((x >> 1) & 0x55555555UL); x = (x & 0x33333333UL) + ((x >> 2) & 0x33333333UL); x = (x + (x >> 4)) & 0x0F0F0F0FUL; x = x + (x >> 8); x = x + (x >> 16); return (x & 0x3F); -#endif -#ifdef _LP64 +#elif defined(_LP64) x = x - ((x >> 1) & 0x5555555555555555ULL); x = (x & 0x3333333333333333ULL) + ((x >> 2) & 0x3333333333333333ULL); x = (x + (x >> 4)) & 0x0F0F0F0F0F0F0F0FULL; @@ -827,6 +827,8 @@ dt_popc(ulong_t x) x = x + (x >> 16); x = x + (x >> 32); return (x & 0x7F); +#else +/* This should be a #warning but for now ignore error. Err: "need td_popc() implementation" */ #endif } @@ -958,7 +960,7 @@ dtrace_uaddr2str(dtrace_hdl_t *dtp, pid_ P = dt_proc_grab(dtp, pid, PGRAB_RDONLY | PGRAB_FORCE, 0); if (P == NULL) { - (void) snprintf(c, sizeof (c), "0x%llx", addr); + (void) snprintf(c, sizeof (c), "0x%jx", (uintmax_t)addr); return (dt_string2str(c, str, nbytes)); } @@ -976,10 +978,10 @@ dtrace_uaddr2str(dtrace_hdl_t *dtp, pid_ (void) snprintf(c, sizeof (c), "%s`%s", obj, name); } } else if (Pobjname(P, addr, objname, sizeof (objname)) != 0) { - (void) snprintf(c, sizeof (c), "%s`0x%llx", - dt_basename(objname), addr); + (void) snprintf(c, sizeof (c), "%s`0x%jx", + dt_basename(objname), (uintmax_t)addr); } else { - (void) snprintf(c, sizeof (c), "0x%llx", addr); + (void) snprintf(c, sizeof (c), "0x%jx", (uintmax_t)addr); } dt_proc_unlock(dtp, P); Modified: projects/largeSMP/contrib/binutils/bfd/coffcode.h ============================================================================== --- projects/largeSMP/contrib/binutils/bfd/coffcode.h Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/contrib/binutils/bfd/coffcode.h Sun Jun 19 14:22:35 2011 (r223297) @@ -3240,7 +3240,7 @@ coff_compute_section_file_positions (bfd incremented in coff_set_section_contents. This is right for SVR3.2. */ if (strcmp (current->name, _LIB) == 0) - bfd_set_section_vma (abfd, current, 0); + (void) bfd_set_section_vma (abfd, current, 0); #endif previous = current; Modified: projects/largeSMP/contrib/binutils/bfd/opncls.c ============================================================================== --- projects/largeSMP/contrib/binutils/bfd/opncls.c Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/contrib/binutils/bfd/opncls.c Sun Jun 19 14:22:35 2011 (r223297) @@ -231,7 +231,7 @@ bfd_fopen (const char *filename, const c then it may have been opened with special flags that make it unsafe to close and reopen the file. */ if (fd == -1) - bfd_set_cacheable (nbfd, TRUE); + (void) bfd_set_cacheable (nbfd, TRUE); return nbfd; } Modified: projects/largeSMP/contrib/binutils/bfd/peicode.h ============================================================================== --- projects/largeSMP/contrib/binutils/bfd/peicode.h Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/contrib/binutils/bfd/peicode.h Sun Jun 19 14:22:35 2011 (r223297) @@ -607,7 +607,7 @@ pe_ILF_make_a_section (pe_ILF_vars * var bfd_set_section_flags (vars->abfd, sec, flags | extra_flags); - bfd_set_section_alignment (vars->abfd, sec, 2); + (void) bfd_set_section_alignment (vars->abfd, sec, 2); /* Check that we will not run out of space. */ BFD_ASSERT (vars->data + size < vars->bim->buffer + vars->bim->size); Modified: projects/largeSMP/contrib/binutils/gas/config/obj-elf.c ============================================================================== --- projects/largeSMP/contrib/binutils/gas/config/obj-elf.c Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/contrib/binutils/gas/config/obj-elf.c Sun Jun 19 14:22:35 2011 (r223297) @@ -1636,7 +1636,7 @@ obj_elf_init_stab_section (segT seg) /* Force the section to align to a longword boundary. Without this, UnixWare ar crashes. */ - bfd_set_section_alignment (stdoutput, seg, 2); + (void) bfd_set_section_alignment (stdoutput, seg, 2); /* Make space for this first symbol. */ p = frag_more (12); Modified: projects/largeSMP/contrib/binutils/gas/frags.c ============================================================================== --- projects/largeSMP/contrib/binutils/gas/frags.c Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/contrib/binutils/gas/frags.c Sun Jun 19 14:22:35 2011 (r223297) @@ -146,7 +146,7 @@ frag_new (int old_frags_var_max_size /* This will align the obstack so the next struct we allocate on it will begin at a correct boundary. */ - obstack_finish (&frchain_now->frch_obstack); + (void) obstack_finish (&frchain_now->frch_obstack); frchP = frchain_now; know (frchP); former_last_fragP = frchP->frch_last; Modified: projects/largeSMP/contrib/binutils/gas/subsegs.c ============================================================================== --- projects/largeSMP/contrib/binutils/gas/subsegs.c Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/contrib/binutils/gas/subsegs.c Sun Jun 19 14:22:35 2011 (r223297) @@ -67,7 +67,7 @@ subseg_change (register segT seg, regist { seginfo = xcalloc (1, sizeof (*seginfo)); seginfo->bfd_section = seg; - bfd_set_section_userdata (stdoutput, seg, seginfo); + (void) bfd_set_section_userdata (stdoutput, seg, seginfo); } } @@ -169,7 +169,7 @@ subseg_get (const char *segname, int for secptr->output_section = secptr; seginfo = xcalloc (1, sizeof (*seginfo)); seginfo->bfd_section = secptr; - bfd_set_section_userdata (stdoutput, secptr, seginfo); + (void) bfd_set_section_userdata (stdoutput, secptr, seginfo); } return secptr; } Modified: projects/largeSMP/contrib/binutils/ld/ldexp.c ============================================================================== --- projects/largeSMP/contrib/binutils/ld/ldexp.c Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/contrib/binutils/ld/ldexp.c Sun Jun 19 14:22:35 2011 (r223297) @@ -1112,9 +1112,9 @@ exp_get_fill (etree_type *tree, fill_typ fill = xmalloc (4 + sizeof (*fill) - 1); val = expld.result.value; fill->data[0] = (val >> 24) & 0xff; - fill->data[1] = (val >> 16) & 0xff; - fill->data[2] = (val >> 8) & 0xff; - fill->data[3] = (val >> 0) & 0xff; + __PAST_END(fill->data, 1) = (val >> 16) & 0xff; + __PAST_END(fill->data, 2) = (val >> 8) & 0xff; + __PAST_END(fill->data, 3) = (val >> 0) & 0xff; fill->size = 4; } return fill; Modified: projects/largeSMP/contrib/binutils/ld/sysdep.h ============================================================================== --- projects/largeSMP/contrib/binutils/ld/sysdep.h Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/contrib/binutils/ld/sysdep.h Sun Jun 19 14:22:35 2011 (r223297) @@ -54,6 +54,9 @@ extern char *strrchr (); /* for MAXPATHLEN */ #ifdef HAVE_SYS_PARAM_H #include +#ifndef __PAST_END +# define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset]) +#endif #endif #ifdef PATH_MAX # define LD_PATHMAX PATH_MAX Modified: projects/largeSMP/contrib/binutils/opcodes/i386-dis.c ============================================================================== --- projects/largeSMP/contrib/binutils/opcodes/i386-dis.c Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/contrib/binutils/opcodes/i386-dis.c Sun Jun 19 14:22:35 2011 (r223297) @@ -3203,7 +3203,7 @@ ckprefix (void) rex_used = 0; while (1) { - FETCH_DATA (the_info, codep + 1); + (void) FETCH_DATA (the_info, codep + 1); newrex = 0; switch (*codep) { @@ -3606,7 +3606,7 @@ print_insn (bfd_vma pc, disassemble_info insn_codep = codep; sizeflag = priv.orig_sizeflag; - FETCH_DATA (info, codep + 1); + (void) FETCH_DATA (info, codep + 1); two_source_ops = (*codep == 0x62) || (*codep == 0xc8); if (((prefixes & PREFIX_FWAIT) @@ -3628,7 +3628,7 @@ print_insn (bfd_vma pc, disassemble_info if (*codep == 0x0f) { unsigned char threebyte; - FETCH_DATA (info, codep + 2); + (void) FETCH_DATA (info, codep + 2); threebyte = *++codep; dp = &dis386_twobyte[threebyte]; need_modrm = twobyte_has_modrm[*codep]; @@ -3639,7 +3639,7 @@ print_insn (bfd_vma pc, disassemble_info codep++; if (dp->name == NULL && dp->op[0].bytemode == IS_3BYTE_OPCODE) { - FETCH_DATA (info, codep + 2); + (void) FETCH_DATA (info, codep + 2); op = *codep++; switch (threebyte) { @@ -3724,7 +3724,7 @@ print_insn (bfd_vma pc, disassemble_info } else if (need_modrm) { - FETCH_DATA (info, codep + 1); + (void) FETCH_DATA (info, codep + 1); modrm.mod = (*codep >> 6) & 3; modrm.reg = (*codep >> 3) & 7; modrm.rm = *codep & 7; @@ -4890,7 +4890,7 @@ OP_E (int bytemode, int sizeflag) if (base == 4) { havesib = 1; - FETCH_DATA (the_info, codep + 1); + (void) FETCH_DATA (the_info, codep + 1); index = (*codep >> 3) & 7; if (address_mode == mode_64bit || index != 0x4) /* When INDEX == 0x4 in 32 bit mode, SCALE is ignored. */ @@ -5147,7 +5147,7 @@ get64 (void) unsigned int a; unsigned int b; - FETCH_DATA (the_info, codep + 8); + (void) FETCH_DATA (the_info, codep + 8); a = *codep++ & 0xff; a |= (*codep++ & 0xff) << 8; a |= (*codep++ & 0xff) << 16; @@ -5169,7 +5169,7 @@ get32 (void) { bfd_signed_vma x = 0; - FETCH_DATA (the_info, codep + 4); + (void) FETCH_DATA (the_info, codep + 4); x = *codep++ & (bfd_signed_vma) 0xff; x |= (*codep++ & (bfd_signed_vma) 0xff) << 8; x |= (*codep++ & (bfd_signed_vma) 0xff) << 16; @@ -5182,7 +5182,7 @@ get32s (void) { bfd_signed_vma x = 0; - FETCH_DATA (the_info, codep + 4); + (void) FETCH_DATA (the_info, codep + 4); x = *codep++ & (bfd_signed_vma) 0xff; x |= (*codep++ & (bfd_signed_vma) 0xff) << 8; x |= (*codep++ & (bfd_signed_vma) 0xff) << 16; @@ -5198,7 +5198,7 @@ get16 (void) { int x = 0; - FETCH_DATA (the_info, codep + 2); + (void) FETCH_DATA (the_info, codep + 2); x = *codep++ & 0xff; x |= (*codep++ & 0xff) << 8; return x; @@ -6018,7 +6018,7 @@ OP_3DNowSuffix (int bytemode ATTRIBUTE_U { const char *mnemonic; - FETCH_DATA (the_info, codep + 1); + (void) FETCH_DATA (the_info, codep + 1); /* AMD 3DNow! instructions are specified by an opcode suffix in the place where an 8-bit immediate would normally go. ie. the last byte of the instruction. */ @@ -6054,7 +6054,7 @@ OP_SIMD_Suffix (int bytemode ATTRIBUTE_U { unsigned int cmp_type; - FETCH_DATA (the_info, codep + 1); + (void) FETCH_DATA (the_info, codep + 1); obufp = obuf + strlen (obuf); cmp_type = *codep++ & 0xff; if (cmp_type < 8) Modified: projects/largeSMP/contrib/dialog/dialog.h ============================================================================== --- projects/largeSMP/contrib/dialog/dialog.h Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/contrib/dialog/dialog.h Sun Jun 19 14:22:35 2011 (r223297) @@ -1,5 +1,5 @@ /* - * $Id: dialog.h,v 1.223 2011/03/02 10:04:09 tom Exp $ + * $Id: dialog.h,v 1.224 2011/06/13 14:29:42 tom Exp $ * * dialog.h -- common declarations for all dialog modules * @@ -44,7 +44,10 @@ #include /* fork() etc. */ #include /* sqrt() */ -#undef ERR /* header conflict with Solaris xpg4 */ +/* header conflict with Solaris xpg4 versus */ +#if defined(ERR) && (ERR == 13) +#undef ERR +#endif #if defined(HAVE_NCURSESW_NCURSES_H) #include Modified: projects/largeSMP/contrib/gcc/cfg.c ============================================================================== --- projects/largeSMP/contrib/gcc/cfg.c Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/contrib/gcc/cfg.c Sun Jun 19 14:22:35 2011 (r223297) @@ -830,7 +830,7 @@ dump_cfg_bb_info (FILE *file, basic_bloc else fprintf (file, ", "); first = false; - fprintf (file, bb_bitnames[i]); + fputs (bb_bitnames[i], file); } if (!first) fprintf (file, ")"); Modified: projects/largeSMP/contrib/gcc/output.h ============================================================================== --- projects/largeSMP/contrib/gcc/output.h Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/contrib/gcc/output.h Sun Jun 19 14:22:35 2011 (r223297) @@ -109,13 +109,14 @@ extern void output_addr_const (FILE *, r /* Output a string of assembler code, substituting numbers, strings and fixed syntactic prefixes. */ -#if GCC_VERSION >= 3004 +#if GCC_VERSION >= 3004 && !defined(__clang__) #define ATTRIBUTE_ASM_FPRINTF(m, n) __attribute__ ((__format__ (__asm_fprintf__, m, n))) ATTRIBUTE_NONNULL(m) /* This is a magic identifier which allows GCC to figure out the type of HOST_WIDE_INT for %wd specifier checks. You must issue this typedef before using the __asm_fprintf__ format attribute. */ typedef HOST_WIDE_INT __gcc_host_wide_int__; #else +/* FIXME(benl): what about %wd? */ #define ATTRIBUTE_ASM_FPRINTF(m, n) ATTRIBUTE_NONNULL(m) #endif Modified: projects/largeSMP/contrib/gcc/rtl.h ============================================================================== --- projects/largeSMP/contrib/gcc/rtl.h Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/contrib/gcc/rtl.h Sun Jun 19 14:22:35 2011 (r223297) @@ -22,6 +22,11 @@ Software Foundation, 51 Franklin Street, #ifndef GCC_RTL_H #define GCC_RTL_H +#include +#ifndef __PAST_END +# define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset]) +#endif + #include "statistics.h" #include "machmode.h" #include "input.h" @@ -565,12 +570,12 @@ extern void rtvec_check_failed_bounds (r #define RTL_CHECK1(RTX, N, C1) ((RTX)->u.fld[N]) #define RTL_CHECK2(RTX, N, C1, C2) ((RTX)->u.fld[N]) -#define RTL_CHECKC1(RTX, N, C) ((RTX)->u.fld[N]) +#define RTL_CHECKC1(RTX, N, C) __PAST_END((RTX)->u.fld, N) #define RTL_CHECKC2(RTX, N, C1, C2) ((RTX)->u.fld[N]) -#define RTVEC_ELT(RTVEC, I) ((RTVEC)->elem[I]) +#define RTVEC_ELT(RTVEC, I) __PAST_END((RTVEC)->elem, I) #define XWINT(RTX, N) ((RTX)->u.hwint[N]) #define XCWINT(RTX, N, C) ((RTX)->u.hwint[N]) -#define XCMWINT(RTX, N, C, M) ((RTX)->u.hwint[N]) +#define XCMWINT(RTX, N, C, M) __PAST_END((RTX)->u.hwint, N) #define XCNMWINT(RTX, N, C, M) ((RTX)->u.hwint[N]) #define XCNMPRV(RTX, C, M) (&(RTX)->u.rv) #define BLOCK_SYMBOL_CHECK(RTX) (&(RTX)->u.block_sym) Modified: projects/largeSMP/contrib/gcc/tree.h ============================================================================== --- projects/largeSMP/contrib/gcc/tree.h Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/contrib/gcc/tree.h Sun Jun 19 14:22:35 2011 (r223297) @@ -22,6 +22,11 @@ Software Foundation, 51 Franklin Street, #ifndef GCC_TREE_H #define GCC_TREE_H +#include +#ifndef __PAST_END +# define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset]) +#endif + #include "hashtab.h" #include "machmode.h" #include "input.h" @@ -830,12 +835,12 @@ extern void omp_clause_range_check_faile #define TREE_RANGE_CHECK(T, CODE1, CODE2) (T) #define EXPR_CHECK(T) (T) #define NON_TYPE_CHECK(T) (T) -#define TREE_VEC_ELT_CHECK(T, I) ((T)->vec.a[I]) -#define TREE_OPERAND_CHECK(T, I) ((T)->exp.operands[I]) -#define TREE_OPERAND_CHECK_CODE(T, CODE, I) ((T)->exp.operands[I]) +#define TREE_VEC_ELT_CHECK(T, I) __PAST_END((T)->vec.a, I) +#define TREE_OPERAND_CHECK(T, I) __PAST_END((T)->exp.operands, I) +#define TREE_OPERAND_CHECK_CODE(T, CODE, I) __PAST_END((T)->exp.operands, I) #define TREE_RTL_OPERAND_CHECK(T, CODE, I) (*(rtx *) &((T)->exp.operands[I])) #define PHI_NODE_ELT_CHECK(T, i) ((T)->phi.a[i]) -#define OMP_CLAUSE_ELT_CHECK(T, i) ((T)->omp_clause.ops[i]) +#define OMP_CLAUSE_ELT_CHECK(T, i) __PAST_END((T)->omp_clause.ops, i) #define OMP_CLAUSE_RANGE_CHECK(T, CODE1, CODE2) (T) #define OMP_CLAUSE_SUBCODE_CHECK(T, CODE) (T) Modified: projects/largeSMP/contrib/gperf/src/gen-perf.cc ============================================================================== --- projects/largeSMP/contrib/gperf/src/gen-perf.cc Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/contrib/gperf/src/gen-perf.cc Sun Jun 19 14:22:35 2011 (r223297) @@ -246,7 +246,7 @@ Gen_Perf::change (List_Node *prior, List { if (option[DEBUG]) { - fprintf (stderr, " by changing asso_value['%c'] (char #%zd) to %d\n", + fprintf (stderr, " by changing asso_value['%c'] (char #%td) to %d\n", *p, p - union_set + 1, asso_values[(unsigned char)(*p)]); fflush (stderr); } Modified: projects/largeSMP/contrib/gperf/src/key-list.cc ============================================================================== --- projects/largeSMP/contrib/gperf/src/key-list.cc Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/contrib/gperf/src/key-list.cc Sun Jun 19 14:22:35 2011 (r223297) @@ -1441,7 +1441,7 @@ Key_List::output_lookup_array (void) if (option[DEBUG]) fprintf (stderr, - "dup_ptr[%zd]: hash_value = %d, index = %d, count = %d\n", + "dup_ptr[%td]: hash_value = %d, index = %d, count = %d\n", dup_ptr - duplicates, dup_ptr->hash_value, dup_ptr->index, dup_ptr->count); Modified: projects/largeSMP/etc/defaults/rc.conf ============================================================================== --- projects/largeSMP/etc/defaults/rc.conf Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/etc/defaults/rc.conf Sun Jun 19 14:22:35 2011 (r223297) @@ -38,6 +38,7 @@ ddb_enable="NO" # Set to YES to load dd ddb_config="/etc/ddb.conf" # ddb(8) config file. devd_enable="YES" # Run devd, to trigger programs on device tree changes. devd_flags="" # Additional flags for devd(8). +#kld_list="" # Kernel modules to load after local disks are mounted kldxref_enable="NO" # Build linker.hints files with kldxref(8). kldxref_clobber="NO" # Overwrite old linker.hints at boot. kldxref_module_path="" # Override kern.module_path. A ';'-delimited list. Modified: projects/largeSMP/etc/periodic/monthly/Makefile ============================================================================== --- projects/largeSMP/etc/periodic/monthly/Makefile Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/etc/periodic/monthly/Makefile Sun Jun 19 14:22:35 2011 (r223297) @@ -6,7 +6,7 @@ FILES= 999.local # NB: keep these sorted by MK_* knobs -.if ${MK_ACCT} != "no" +.if ${MK_UTMPX} != "no" FILES+= 200.accounting .endif Modified: projects/largeSMP/etc/rc.d/Makefile ============================================================================== --- projects/largeSMP/etc/rc.d/Makefile Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/etc/rc.d/Makefile Sun Jun 19 14:22:35 2011 (r223297) @@ -18,7 +18,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI ip6addrctl ipfilter ipfs ipfw ipmon \ ipnat ipsec ipxrouted \ jail \ - kadmind kerberos keyserv kldxref kpasswdd \ + kadmind kerberos keyserv kld kldxref kpasswdd \ ldconfig local localpkg lockd lpd \ mixer motd mountcritlocal mountcritremote mountlate \ mdconfig mdconfig2 mountd moused mroute6d mrouted msgs \ Copied: projects/largeSMP/etc/rc.d/kld (from r223296, head/etc/rc.d/kld) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/largeSMP/etc/rc.d/kld Sun Jun 19 14:22:35 2011 (r223297, copy of r223296, head/etc/rc.d/kld) @@ -0,0 +1,53 @@ +#!/bin/sh + +# Copyright (c) 2011 Douglas Barton +# 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$ +# +# PROVIDE: kld +# REQUIRE: FILESYSTEMS +# KEYWORD: nojail + +. /etc/rc.subr + +name="kld" + +start_cmd="${name}_start" +stop_cmd=':' + +kld_start() +{ + [ -n "$kld_list" ] || return + + local _kld + + echo 'Loading kernel modules:' + for _kld in $kld_list ; do + load_kld -e ${_kld}.ko $_kld + done +} + +load_rc_config $name +run_rc_command "$1" Modified: projects/largeSMP/etc/rc.d/var ============================================================================== --- projects/largeSMP/etc/rc.d/var Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/etc/rc.d/var Sun Jun 19 14:22:35 2011 (r223297) @@ -28,7 +28,7 @@ # # PROVIDE: var -# REQUIRE: FILESYSTEMS +# REQUIRE: FILESYSTEMS kld . /etc/rc.subr Modified: projects/largeSMP/etc/rc.subr ============================================================================== --- projects/largeSMP/etc/rc.subr Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/etc/rc.subr Sun Jun 19 14:22:35 2011 (r223297) @@ -1062,7 +1062,7 @@ load_rc_config() # Set defaults if defined. for _var in $rcvar $rcvars; do - _defval=`eval echo "\\\$${_var}_defval"` + eval _defval=\$${_var}_defval if [ -n "$_defval" ]; then eval : \${$_var:=\$${_var}_defval} fi @@ -1070,9 +1070,9 @@ load_rc_config() # check obsolete rc.conf variables for _var in $rcvars_obsolete; do - _v=`eval echo \\$$_var` - _msg=`eval echo \\$${_var}_obsolete_msg` - _new=`eval echo \\$${_var}_newvar` + eval _v=\$$_var + eval _msg=\$${_var}_obsolete_msg + eval _new=\$${_var}_newvar case $_v in "") ;; @@ -1744,7 +1744,7 @@ check_kern_features() local _v [ -n "$1" ] || return 1; - _v=`eval echo "\\$_rc_cache_kern_features_$1"` + eval _v=\$_rc_cache_kern_features_$1 [ -n "$_v" ] && return "$_v"; if ${SYSCTL_N} kern.features.$1 > /dev/null 2>&1; then @@ -1765,7 +1765,7 @@ check_kern_features() _echoonce() { local _var _msg _mode - _var=`eval echo \\$$1` + eval _var=\$$1 _msg=$2 _mode=$3 Modified: projects/largeSMP/lib/libc/db/btree/bt_split.c ============================================================================== --- projects/largeSMP/lib/libc/db/btree/bt_split.c Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/lib/libc/db/btree/bt_split.c Sun Jun 19 14:22:35 2011 (r223297) @@ -37,6 +37,7 @@ static char sccsid[] = "@(#)bt_split.c 8 __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -482,7 +483,7 @@ bt_rroot(BTREE *t, PAGE *h, PAGE *l, PAG WR_RINTERNAL(dest, l->flags & P_RLEAF ? NEXTINDEX(l) : rec_total(l), l->pgno); - h->linp[1] = h->upper -= NRINTERNAL; + __PAST_END(h->linp, 1) = h->upper -= NRINTERNAL; dest = (char *)h + h->upper; WR_RINTERNAL(dest, r->flags & P_RLEAF ? NEXTINDEX(r) : rec_total(r), r->pgno); @@ -534,7 +535,7 @@ bt_broot(BTREE *t, PAGE *h, PAGE *l, PAG case P_BLEAF: bl = GETBLEAF(r, 0); nbytes = NBINTERNAL(bl->ksize); - h->linp[1] = h->upper -= nbytes; + __PAST_END(h->linp, 1) = h->upper -= nbytes; dest = (char *)h + h->upper; WR_BINTERNAL(dest, bl->ksize, r->pgno, 0); memmove(dest, bl->bytes, bl->ksize); @@ -550,7 +551,7 @@ bt_broot(BTREE *t, PAGE *h, PAGE *l, PAG case P_BINTERNAL: bi = GETBINTERNAL(r, 0); nbytes = NBINTERNAL(bi->ksize); - h->linp[1] = h->upper -= nbytes; + __PAST_END(h->linp, 1) = h->upper -= nbytes; dest = (char *)h + h->upper; memmove(dest, bi, nbytes); ((BINTERNAL *)dest)->pgno = r->pgno; Modified: projects/largeSMP/lib/libc/db/man/mpool.3 ============================================================================== --- projects/largeSMP/lib/libc/db/man/mpool.3 Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/lib/libc/db/man/mpool.3 Sun Jun 19 14:22:35 2011 (r223297) @@ -28,7 +28,7 @@ .\" @(#)mpool.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 25, 1999 +.Dd June 17, 2011 .Dt MPOOL 3 .Os .Sh NAME @@ -147,7 +147,14 @@ is returned and is set. The .Fa flags -argument is not currently used. +argument is specified by +.Em or Ns 'ing +any of the following values: +.Bl -tag -width indent +.It Dv MPOOL_IGNOREPIN +The page returned is not pinned; +page will otherwise be pinned on return. +.El .Pp The .Fn mpool_put Modified: projects/largeSMP/lib/libc/gen/basename.3 ============================================================================== --- projects/largeSMP/lib/libc/gen/basename.3 Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/lib/libc/gen/basename.3 Sun Jun 19 14:22:35 2011 (r223297) @@ -1,33 +1,22 @@ +.\" $OpenBSD: basename.3,v 1.20 2007/05/31 19:19:28 jmc Exp $ .\" .\" Copyright (c) 1997 Todd C. Miller -.\" 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. -.\" 3. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. .\" -.\" THIS SOFTWARE IS PROVIDED ``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 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. +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.\" $OpenBSD: basename.3,v 1.12 2000/04/18 03:01:25 aaron Exp $ .\" $FreeBSD$ .\" -.Dd October 6, 2009 +.Dd March 31, 2010 .Dt BASENAME 3 .Os .Sh NAME @@ -42,8 +31,7 @@ .Sh DESCRIPTION The .Fn basename -function -returns the last component from the pathname pointed to by +function returns the last component from the pathname pointed to by .Fa path , deleting any trailing .Sq \&/ @@ -111,4 +99,15 @@ function first appeared in and .Fx 4.2 . .Sh AUTHORS -.An "Todd C. Miller" Aq Todd.Miller@courtesan.com +.An Todd C. Miller +.Sh CAVEATS +.Fn basename +returns a pointer to internal static storage space that will be overwritten +by subsequent calls. +.Pp +Other vendor implementations of +.Fn basename +may modify the contents of the string passed to +.Fn basename ; +this should be taken into account when writing code which calls this function +if portability is desired. Modified: projects/largeSMP/lib/libc/gen/basename.c ============================================================================== --- projects/largeSMP/lib/libc/gen/basename.c Sun Jun 19 13:35:46 2011 (r223296) +++ projects/largeSMP/lib/libc/gen/basename.c Sun Jun 19 14:22:35 2011 (r223297) @@ -1,35 +1,21 @@ +/* $OpenBSD: basename.c,v 1.14 2005/08/08 08:05:33 espie Exp $ */ + /* - * Copyright (c) 1997 Todd C. Miller - * All rights reserved. + * Copyright (c) 1997, 2004 Todd C. Miller * - * 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 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Mon Jun 20 07:58:44 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2977106564A; Mon, 20 Jun 2011 07:58:44 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B35C78FC0A; Mon, 20 Jun 2011 07:58:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5K7wiri030051; Mon, 20 Jun 2011 07:58:44 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K7wiTV030048; Mon, 20 Jun 2011 07:58:44 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201106200758.p5K7wiTV030048@svn.freebsd.org> From: Jamie Gritton Date: Mon, 20 Jun 2011 07:58:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223327 - projects/jailconf/usr.sbin/jail X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2011 07:58:44 -0000 Author: jamie Date: Mon Jun 20 07:58:44 2011 New Revision: 223327 URL: http://svn.freebsd.org/changeset/base/223327 Log: Linty stuff. Modified: projects/jailconf/usr.sbin/jail/command.c projects/jailconf/usr.sbin/jail/config.c Modified: projects/jailconf/usr.sbin/jail/command.c ============================================================================== --- projects/jailconf/usr.sbin/jail/command.c Mon Jun 20 07:07:18 2011 (r223326) +++ projects/jailconf/usr.sbin/jail/command.c Mon Jun 20 07:58:44 2011 (r223327) @@ -86,7 +86,6 @@ static int kq; int next_command(struct cfjail *j) { - const struct cfstring *comstring; enum intparam comparam; int rval, create_failed; @@ -286,6 +285,8 @@ run_command(struct cfjail *j) } requeue(j, &ready); return 1; + + default: ; } /* * Collect exec arguments. Internal commands for network and Modified: projects/jailconf/usr.sbin/jail/config.c ============================================================================== --- projects/jailconf/usr.sbin/jail/config.c Mon Jun 20 07:07:18 2011 (r223326) +++ projects/jailconf/usr.sbin/jail/config.c Mon Jun 20 07:58:44 2011 (r223327) @@ -288,7 +288,6 @@ add_param(struct cfjail *j, const struct struct cfparam *dp, *np; struct cfstring *s, *ns; struct cfvar *v, *nv; - struct ipspec *ips; const char *name; char *cs, *tname; unsigned flags; @@ -432,7 +431,7 @@ check_intparams(struct cfjail *j) struct addrinfo hints; struct addrinfo *ai0, *ai; struct cfparam *p; - struct cfstring *s, *ns; + struct cfstring *s; FILE *f; const char *hostname, *val; char *cs, *ep, *ln; From owner-svn-src-projects@FreeBSD.ORG Mon Jun 20 12:40:21 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F25541065670; Mon, 20 Jun 2011 12:40:21 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E15B58FC18; Mon, 20 Jun 2011 12:40:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5KCeLPj050212; Mon, 20 Jun 2011 12:40:21 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KCeLJu050202; Mon, 20 Jun 2011 12:40:21 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201106201240.p5KCeLJu050202@svn.freebsd.org> From: Peter Holm Date: Mon, 20 Jun 2011 12:40:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223335 - projects/stress2/misc X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2011 12:40:22 -0000 Author: pho Date: Mon Jun 20 12:40:21 2011 New Revision: 223335 URL: http://svn.freebsd.org/changeset/base/223335 Log: Added more SUJ test cases (suj18 will be added later on). Added: projects/stress2/misc/suj12.sh (contents, props changed) projects/stress2/misc/suj13.sh (contents, props changed) projects/stress2/misc/suj14.sh (contents, props changed) projects/stress2/misc/suj15.sh (contents, props changed) projects/stress2/misc/suj16.sh (contents, props changed) projects/stress2/misc/suj17.sh (contents, props changed) projects/stress2/misc/suj19.sh (contents, props changed) projects/stress2/misc/suj20.sh (contents, props changed) projects/stress2/misc/suj21.sh (contents, props changed) projects/stress2/misc/suj22.sh (contents, props changed) Added: projects/stress2/misc/suj12.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/stress2/misc/suj12.sh Mon Jun 20 12:40:21 2011 (r223335) @@ -0,0 +1,59 @@ +#!/bin/sh + +# +# Copyright (c) 2011 Peter Holm +# 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$ +# + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +# Test with different sector size using gnop(8). + +. ../default.cfg + +mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint +mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart + +mdconfig -a -t swap -s 1g -u $mdstart || exit 1 +gnop load +gnop create -S 4k /dev/md$mdstart +newfs -U /dev/md${mdstart}.nop +tunefs -j enable /dev/md${mdstart}.nop +mount /dev/md${mdstart}.nop $mntpoint +chmod 777 $mntpoint + +export runRUNTIME=20m +export RUNDIR=$mntpoint/stressX + +su $testuser -c 'cd ..; ./run.sh marcus.cfg' + +while mount | grep $mntpoint | grep -q /dev/md; do + umount $mntpoint || sleep 1 +done +checkfs /dev/md${mdstart}.nop +gnop destroy /dev/md${mdstart}.nop +gnop unload +mdconfig -d -u $mdstart Added: projects/stress2/misc/suj13.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/stress2/misc/suj13.sh Mon Jun 20 12:40:21 2011 (r223335) @@ -0,0 +1,60 @@ +#!/bin/sh + +# +# Copyright (c) 2011 Peter Holm +# 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$ +# + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +# Run with marcus.cfg on a malloc backed MD with non standard sector size. + +. ../default.cfg + +mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint +mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart + +size="128m" +[ `uname -m` = "amd64" ] && size="1g" +mdconfig -a -t malloc -o reserve -s $size -S 4096 -u $mdstart || exit 1 +bsdlabel -w md$mdstart auto + +newfs -U md${mdstart}$part > /dev/null +tunefs -j enable /dev/md${mdstart}$part + +mount /dev/md${mdstart}$part $mntpoint +chmod 777 $mntpoint + +export runRUNTIME=20m +export RUNDIR=$mntpoint/stressX + +su $testuser -c 'cd ..; ./run.sh marcus.cfg' > /dev/null 2>&1 + +while mount | grep $mntpoint | grep -q /dev/md; do + umount $mntpoint || sleep 1 +done +checkfs /dev/md${mdstart}$part +mdconfig -d -u $mdstart Added: projects/stress2/misc/suj14.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/stress2/misc/suj14.sh Mon Jun 20 12:40:21 2011 (r223335) @@ -0,0 +1,58 @@ +#!/bin/sh + +# +# Copyright (c) 2011 Peter Holm +# 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$ +# + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +# "filesystem is full" scenario. + +# "panic: softdep_revert_mkdir: dot addref parent mismatch" seen. + +. ../default.cfg + +mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint +mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart + +mdconfig -a -t swap -s 2g -u $mdstart || exit 1 +bsdlabel -w md$mdstart auto + +newfs -U -j md${mdstart}$part > /dev/null + +mount /dev/md${mdstart}$part $mntpoint + +# Populate the FS with some random files +for i in `jot 102`; do + mkdir $mntpoint/d$i + cp -a /usr/include $mntpoint/d$i +done + +while mount | grep $mntpoint | grep -q /dev/md; do + umount $mntpoint || sleep 1 +done +mdconfig -d -u $mdstart Added: projects/stress2/misc/suj15.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/stress2/misc/suj15.sh Mon Jun 20 12:40:21 2011 (r223335) @@ -0,0 +1,68 @@ +#!/bin/sh + +# +# Copyright (c) 2011 Peter Holm +# 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$ +# + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +# mksnap_ffs(8) test scenario inspired by Christian Gusenbauer, c47g gmx at. + +# Three problems seen with this scenario: +# +# 1) mksnap_ffs looping in ffs_sync() +# 2) mksnap_ffs stuck in wsuspfs +# 3) softdep_waitidle: Failed to flush worklist for ... + +. ../default.cfg + +mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint +mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart + +mdconfig -a -t swap -s 2g -u $mdstart || exit 1 +bsdlabel -w md$mdstart auto + +newfs -U -j md${mdstart}$part > /dev/null + +mount /dev/md${mdstart}$part $mntpoint +chmod 777 $mntpoint + +export runRUNTIME=30m +export RUNDIR=$mntpoint/stressX + +su $testuser -c 'cd ..; ./run.sh jeff.cfg > /dev/null' & +rpid=$! +while kill -0 $rpid 2> /dev/null; do + sleep 10 + dump -0aLf /dev/null /dev/md${mdstart}$part +done +wait + +while mount | grep $mntpoint | grep -q /dev/md; do + umount $mntpoint || sleep 1 +done +mdconfig -d -u $mdstart Added: projects/stress2/misc/suj16.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/stress2/misc/suj16.sh Mon Jun 20 12:40:21 2011 (r223335) @@ -0,0 +1,84 @@ +#!/bin/sh + +# +# Copyright (c) 2011 Peter Holm +# 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$ +# + +# mksnap_ffs(8) test scenario + +# Livelock seen in ffs_sync(). +# "panic: initiate_write_bmsafemap: block 846816 marked free" seen. +# Zero size snapshot file seen. + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg + +mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint +mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart + +mdconfig -a -t swap -s 2g -u $mdstart || exit 1 +bsdlabel -w md$mdstart auto + +newfs -U -j md${mdstart}$part > /dev/null 2>&1 + +mount /dev/md${mdstart}$part $mntpoint +chmod 777 $mntpoint + +export runRUNTIME=30m +export RUNDIR=$mntpoint/stressX +export creatINCARNATIONS=2 + +export TESTPROGS=" +testcases/creat/creat +" +su $testuser -c 'cd ..; ./testcases/run/run $TESTPROGS' > /dev/null 2>&1 & +rpid=$! +mdstart2=$((mdstart + 1)) +mntpoint2=${mntpoint}2 +[ -d $mntpoint2 ] || mkdir $mntpoint2 +mount | grep $mntpoint2 | grep -q /dev/md && umount -f $mntpoint2 +mdconfig -l | grep -q md$mdstart2 && mdconfig -d -u $mdstart2 +while kill -0 $rpid 2> /dev/null; do + rm -f /mnt/.snap/suj16 + { mksnap_ffs /mnt /mnt/.snap/suj16 || continue; } 2>&1 | \ + grep -v "Resource temporarily unavailable" + [ ! -s /mnt/.snap/suj16 ] && continue + mdconfig -a -t vnode -f /mnt/.snap/suj16 -u $mdstart2 -o readonly + mount -r /dev/md$mdstart2 $mntpoint2 + + ls -l $mntpoint2 > /dev/null + + umount $mntpoint2 + mdconfig -d -u $mdstart2 +done +wait + +while mount | grep $mntpoint | grep -q /dev/md; do + umount $mntpoint || sleep 1 +done +mdconfig -d -u $mdstart Added: projects/stress2/misc/suj17.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/stress2/misc/suj17.sh Mon Jun 20 12:40:21 2011 (r223335) @@ -0,0 +1,137 @@ +#!/bin/sh + +# +# Copyright (c) 2011 Peter Holm +# 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$ +# + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +# Truncate scenario for suj. +# "panic: worklist_insert: 0xc8bc5b00 freework(0x8009) already on list" +# seen. + +. ../default.cfg + +here=`pwd` +cd /tmp +sed '1,/^EOF/d' < $here/$0 > suj17.c +cc -o suj17 -Wall -Wextra -O2 suj17.c +rm -f suj17.c +cd $here + +mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint +mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart + +mdconfig -a -t swap -s 2g -u $mdstart || exit 1 +bsdlabel -w md$mdstart auto +[ $# -eq 1 ] && opt="$1" +[ $# -eq 0 ] && opt="-j" +echo "newfs $opt md${mdstart}$part" +newfs $opt md${mdstart}$part > /dev/null +mount /dev/md${mdstart}$part $mntpoint +chmod 777 $mntpoint + +su $testuser -c "cd $mntpoint; /tmp/suj17" + +while mount | grep $mntpoint | grep -q /dev/md; do + umount $mntpoint || sleep 1 +done +checkfs /dev/md${mdstart}$part +mdconfig -d -u $mdstart +rm -f /tmp/suj17 +exit +EOF +#include +#include +#include +#include +#include +#include +#include + +#define SIZ (1024 * 1024 - 1) +char buf[SIZ]; + +void +test() +{ + int fd, i; + char name[128]; + off_t len = 104857600LL; /* 100 Mb */ + off_t pos; + + sprintf(name, "%06d", getpid()); + if ((fd = open(name, O_WRONLY | O_CREAT, 0666)) == -1) + err(1, "open(%s)", name); + for (i = 0; i < 100; i++) { + if (write(fd, buf, sizeof(buf)) != sizeof(buf)) + err(1, "write"); + } + + for (;;) { + if (access("rendezvous", R_OK) == 0) + break; + sched_yield(); + } + + srand48(getpid()); + for (i = 0; i < 50000; i++) { + pos = lrand48() % (len - sizeof(buf)); + if (ftruncate(fd, pos) == -1) + err(1, "ftruncate"); + pos = lrand48() % (len - sizeof(buf)); + if (lseek(fd, pos, SEEK_SET) == -1) + err(1, "lseek"); + if (write(fd, buf, sizeof(buf)) != sizeof(buf)) + err(1, "write"); + } + close(fd); + unlink(name); + _exit(0); +} + +int +main() +{ + int fd, i, j, status; + + for (i = 0; i < 1; i++) { + for (j = 0; j < 6; j++) { + if (fork() == 0) + test(); + } + if ((fd = open("rendezvous", O_CREAT, 0644)) == -1) + err(1, "open()"); + close(fd); + + for (j = 0; j < 6; j++) + wait(&status); + unlink("rendezvous"); + } + + return (0); +} Added: projects/stress2/misc/suj19.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/stress2/misc/suj19.sh Mon Jun 20 12:40:21 2011 (r223335) @@ -0,0 +1,76 @@ +#!/bin/sh + +# +# Copyright (c) 2011 Peter Holm +# 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$ +# + +# SUJ, quota and snapshots test scenario + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg + +snap () { + while [ ! -s $2 ]; do + mksnap_ffs $1 $2 2>&1 | grep -v "Resource temporarily unavailable" + [ ! -s $2 ] && rm -f $2 # Get rid of zero size snapshots + done +} + +mount | grep "${mntpoint}" | grep -q md${mdstart} && umount ${mntpoint} +mdconfig -l | grep -q md${mdstart} && mdconfig -d -u ${mdstart} + +mdconfig -a -t swap -s 1g -u ${mdstart} +bsdlabel -w md${mdstart} auto +newfs -j md${mdstart}${part} > /dev/null +export PATH_FSTAB=/tmp/fstab +echo "/dev/md${mdstart}${part} ${mntpoint} ufs rw,userquota 2 2" > $PATH_FSTAB +mount ${mntpoint} +set `df -ik ${mntpoint} | tail -1 | awk '{print $4,$7}'` +export QK=$(($1 / 4)) +export QI=$(($2 / 4)) +edquota -u -f ${mntpoint} -e ${mntpoint}:$((QK - 50)):$QK:$((QI - 50 )):$QI ${testuser} +quotaon ${mntpoint} +export RUNDIR=${mntpoint}/stressX +chmod 777 ${mntpoint} +su ${testuser} -c 'sh -c "(cd ..;runRUNTIME=20m ./run.sh disk.cfg > /dev/null 2>&1)"' & + +for i in `jot 20`; do + echo "`date '+%T'` mksnap_ffs ${mntpoint} ${mntpoint}/.snap/snap$i" + snap ${mntpoint} ${mntpoint}/.snap/snap$i + sleep 1 +done +i=$(($(date '+%S') % 20 + 1)) +echo "rm -f ${mntpoint}/.snap/snap$i" +rm -f ${mntpoint}/.snap/snap$i +wait + +while mount | grep -q ${mntpoint}; do + umount ${mntpoint} || sleep 1 +done +mdconfig -d -u ${mdstart} +rm -f $PATH_FSTAB Added: projects/stress2/misc/suj20.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/stress2/misc/suj20.sh Mon Jun 20 12:40:21 2011 (r223335) @@ -0,0 +1,177 @@ +#!/bin/sh + +# +# Copyright (c) 2011 Peter Holm +# 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$ +# + +# Looping mksnap_ffs seen. + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg + +# Scenario by mckusick@ +# +# create a bunch of files/directories +# create a snapshot +# remove many (but not all) of those files/directories +# create some new files/directories in what remains of those +# original files/directories. +# create another snapshot +# repeat { +# remove many (somewhat different) of those files/directories +# create some new files/directories in what remains of those +# remaining files/directories. +# create a new snapshot +# remove oldest snapshot +# } + +snap () { + while [ ! -s $2 ]; do + mksnap_ffs $1 $2 2>&1 | grep -v "Resource temporarily unavailable" + [ ! -s $2 ] && rm -f $2 # Get rid of zero size snapshots + done +} + +here=`pwd` +cd /tmp +sed '1,/^EOF/d' < $here/$0 > suj20.c +cc -o suj20 -Wall -Wextra -g -O2 suj20.c +rm -f suj20.c + +mount | grep "${mntpoint}" | grep -q md${mdstart} && umount ${mntpoint} +mdconfig -l | grep -q md${mdstart} && mdconfig -d -u ${mdstart} + +mdconfig -a -t swap -s 1g -u ${mdstart} +bsdlabel -w md${mdstart} auto +newfs -j md${mdstart}${part} > /dev/null +mount /dev/md${mdstart}$part $mntpoint + +cd $mntpoint +chmod 777 $mntpoint +/tmp/suj20 +snap $mntpoint ${mntpoint}/.snap/snap1 +/tmp/suj20 prune +snap $mntpoint ${mntpoint}/.snap/snap2 +/tmp/suj20 +for i in `jot 10`; do + /tmp/suj20 prune + /tmp/suj20 + snap $mntpoint ${mntpoint}/.snap/snap$((i + 2)) + sn=`ls -tU ${mntpoint}/.snap | tail -1` + rm -f ${mntpoint}/.snap/$sn +done +cd $here + +while mount | grep -q ${mntpoint}; do + umount ${mntpoint} || sleep 1 +done +mdconfig -d -u ${mdstart} +rm -f /tmp/suj20 +exit 0 +EOF +#include +#include +#include +#include +#include +#include +#include +#include + +static char buf[4096]; +#define ND 100 +#define NF 500 + +void +setup(void) +{ + int d, f, fd, i, n; + char name[128]; + + for (d = 0; d < ND; d++) { + snprintf(name, sizeof(name), "d%03d", d); + if (mkdir(name, 00700) == -1 && errno != EEXIST) + err(1, "mkdir(%s)", name); + if (chdir(name) == -1) + err(1, "chdir(%s)", name); + for (f = 0; f < NF; f++) { + if (arc4random() % 100 < 33) + continue; + snprintf(name, sizeof(name), "f%03d", f); + if ((fd = open(name, O_RDWR | O_CREAT | O_TRUNC, 0640)) == -1) + err(1, "open(%s)", name); + n = arc4random() % 10; + for (i = 0; i < n; i++) { + if (write(fd, buf, sizeof(buf)) != sizeof(buf)) + err(1, "write()"); + } + close(fd); + } + if (chdir("..") == -1) + err(1, "chdir(%s)", ".."); + } +} +void + +prune(void) +{ + int d, f; + char name[128]; + + for (d = 0; d < ND; d++) { + snprintf(name, sizeof(name), "d%03d", d); + if (chdir(name) == -1) + err(1, "chdir(%s)", name); + for (f = 0; f < NF; f++) { + if (arc4random() % 100 < 33) + continue; + snprintf(name, sizeof(name), "f%03d", f); + if (unlink(name) == -1 && errno != ENOENT) + err(1, "unlink(%s)", name); + } + if (chdir("..") == -1) + err(1, "chdir(%s)", ".."); + } + for (d = 0; d < ND; d++) { + if (arc4random() % 100 > 10) + continue; + snprintf(name, sizeof(name), "rm -rf d%03d", d); + system(name); + } +} + +int +main(int argc, char **argv __unused) +{ + if (argc == 1) + setup(); + if (argc == 2) + prune(); + + return (0); +} Added: projects/stress2/misc/suj21.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/stress2/misc/suj21.sh Mon Jun 20 12:40:21 2011 (r223335) @@ -0,0 +1,178 @@ +#!/bin/sh + +# +# Copyright (c) 2011 Peter Holm +# 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$ +# + +# Copy of suj20.sh, but with test user as non root. +# "panic: handle_disk_write_complete: Unknown type freedep" seen. + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg + +# Scenario by mckusick@ +# +# create a bunch of files/directories +# create a snapshot +# remove many (but not all) of those files/directories +# create some new files/directories in what remains of those +# original files/directories. +# create another snapshot +# repeat { +# remove many (somewhat different) of those files/directories +# create some new files/directories in what remains of those +# remaining files/directories. +# create a new snapshot +# remove oldest snapshot +# } + +snap () { + while [ ! -s $2 ]; do + mksnap_ffs $1 $2 2>&1 | grep -v "Resource temporarily unavailable" + [ ! -s $2 ] && rm -f $2 # Get rid of zero size snapshots + done +} + +here=`pwd` +cd /tmp +sed '1,/^EOF/d' < $here/$0 > suj21.c +cc -o suj21 -Wall -Wextra -g -O2 suj21.c +rm -f suj21.c + +mount | grep "${mntpoint}" | grep -q md${mdstart} && umount ${mntpoint} +mdconfig -l | grep -q md${mdstart} && mdconfig -d -u ${mdstart} + +mdconfig -a -t swap -s 1g -u ${mdstart} +bsdlabel -w md${mdstart} auto +newfs -j md${mdstart}${part} > /dev/null +mount /dev/md${mdstart}$part $mntpoint + +cd $mntpoint +chmod 777 $mntpoint +su $testuser -c '/tmp/suj21' +snap $mntpoint ${mntpoint}/.snap/snap1 +su $testuser -c '/tmp/suj21 prune' +snap $mntpoint ${mntpoint}/.snap/snap2 +su $testuser -c '/tmp/suj21' +for i in `jot 10`; do + su $testuser -c '/tmp/suj21 prune' + su $testuser -c '/tmp/suj21' + snap $mntpoint ${mntpoint}/.snap/snap$((i + 2)) + sn=`ls -tU ${mntpoint}/.snap | tail -1` + rm -f ${mntpoint}/.snap/$sn +done +cd $here + +while mount | grep -q ${mntpoint}; do + umount ${mntpoint} || sleep 1 +done +mdconfig -d -u ${mdstart} +rm -f /tmp/suj21 +exit 0 +EOF +#include +#include +#include +#include +#include +#include +#include +#include + +static char buf[4096]; +#define ND 100 +#define NF 500 + +void +setup(void) +{ + int d, f, fd, i, n; + char name[128]; + + for (d = 0; d < ND; d++) { + snprintf(name, sizeof(name), "d%03d", d); + if (mkdir(name, 00700) == -1 && errno != EEXIST) + err(1, "mkdir(%s)", name); + if (chdir(name) == -1) + err(1, "chdir(%s)", name); + for (f = 0; f < NF; f++) { + if (arc4random() % 100 < 33) + continue; + snprintf(name, sizeof(name), "f%03d", f); + if ((fd = open(name, O_RDWR | O_CREAT | O_TRUNC, 0640)) == -1) + err(1, "open(%s)", name); + n = arc4random() % 10; + for (i = 0; i < n; i++) { + if (write(fd, buf, sizeof(buf)) != sizeof(buf)) + err(1, "write()"); + } + close(fd); + } + if (chdir("..") == -1) + err(1, "chdir(%s)", ".."); + } +} +void + +prune(void) +{ + int d, f; + char name[128]; + + for (d = 0; d < ND; d++) { + snprintf(name, sizeof(name), "d%03d", d); + if (chdir(name) == -1) + err(1, "chdir(%s)", name); + for (f = 0; f < NF; f++) { + if (arc4random() % 100 < 33) + continue; + snprintf(name, sizeof(name), "f%03d", f); + if (unlink(name) == -1 && errno != ENOENT) + err(1, "unlink(%s)", name); + } + if (chdir("..") == -1) + err(1, "chdir(%s)", ".."); + } + for (d = 0; d < ND; d++) { + if (arc4random() % 100 > 10) + continue; + snprintf(name, sizeof(name), "rm -rf d%03d", d); + system(name); + } +} + +int +main(int argc, char **argv __unused) +{ + if (argc == 1) + setup(); + if (argc == 2) + prune(); + + return (0); +} Added: projects/stress2/misc/suj22.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/stress2/misc/suj22.sh Mon Jun 20 12:40:21 2011 (r223335) @@ -0,0 +1,193 @@ +#!/bin/sh + +# +# Copyright (c) 2011 Peter Holm +# 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$ +# + +# Variation of suj20.sh, with focus on the FS state after a panic / power +# cycle. + +# Demonstrate "multiple references to blocks" in FS after reboot from a +# looping mksnap_ffs(8). + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg + +# Scenario by mckusick@ +# +# create a bunch of files/directories +# create a snapshot +# remove many (but not all) of those files/directories +# create some new files/directories in what remains of those +# original files/directories. +# create another snapshot +# repeat { +# remove many (somewhat different) of those files/directories +# create some new files/directories in what remains of those +# remaining files/directories. +# create a new snapshot +# remove oldest snapshot +# } + +snap () { + while [ ! -s $2 ]; do + mksnap_ffs $1 $2 2>&1 | grep -v "Resource temporarily unavailable" + [ ! -s $2 ] && rm -f $2 # Get rid of zero size snapshots + done +} + +D=$diskimage + +if [ -n "`find $D -mtime -1h 2>/dev/null`" ]; then + # FS left by previous crash + mdconfig -a -t vnode -f $D -u ${mdstart} + fsck -t ufs -y md${mdstart}${part} + fsck -t ufs -y md${mdstart}${part} + rm -f $D + exit 0 +fi *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Mon Jun 20 23:04:13 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A94FE106564A; Mon, 20 Jun 2011 23:04:13 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 992848FC08; Mon, 20 Jun 2011 23:04:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5KN4DTX069490; Mon, 20 Jun 2011 23:04:13 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KN4Dow069484; Mon, 20 Jun 2011 23:04:13 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201106202304.p5KN4Dow069484@svn.freebsd.org> From: Jamie Gritton Date: Mon, 20 Jun 2011 23:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223351 - projects/jailconf/usr.sbin/jail X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2011 23:04:13 -0000 Author: jamie Date: Mon Jun 20 23:04:13 2011 New Revision: 223351 URL: http://svn.freebsd.org/changeset/base/223351 Log: Following r222465: Check for IPv4 or IPv6 to be available by the kernel to not provoke errors trying to query options not available. Make it possible to compile out INET or INET6 only parts. Modified: projects/jailconf/usr.sbin/jail/Makefile projects/jailconf/usr.sbin/jail/command.c projects/jailconf/usr.sbin/jail/config.c projects/jailconf/usr.sbin/jail/jail.c projects/jailconf/usr.sbin/jail/jailp.h Modified: projects/jailconf/usr.sbin/jail/Makefile ============================================================================== --- projects/jailconf/usr.sbin/jail/Makefile Mon Jun 20 22:59:29 2011 (r223350) +++ projects/jailconf/usr.sbin/jail/Makefile Mon Jun 20 23:04:13 2011 (r223351) @@ -15,6 +15,9 @@ CFLAGS+=-I. -I${.CURDIR} .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 .endif +.if ${MK_INET_SUPPORT} != "no" +CFLAGS+= -DINET +.endif CLEANFILES= y.output Modified: projects/jailconf/usr.sbin/jail/command.c ============================================================================== --- projects/jailconf/usr.sbin/jail/command.c Mon Jun 20 22:59:29 2011 (r223350) +++ projects/jailconf/usr.sbin/jail/command.c Mon Jun 20 23:04:13 2011 (r223351) @@ -247,12 +247,15 @@ run_command(struct cfjail *j) const struct cfstring *comstring, *s; login_cap_t *lcap; char **argv; - char *cs, *addr, *comcs, *devpath; + char *cs, *comcs, *devpath; const char *jidstr, *conslog, *path, *ruleset, *term, *username; enum intparam comparam; size_t comlen; pid_t pid; int argc, bg, clean, consfd, down, fib, i, injail, sjuser, timeout; +#if defined(INET) || defined(INET6) + char *addr; +#endif static char *cleanenv; @@ -295,6 +298,7 @@ run_command(struct cfjail *j) comstring = j->comstring; bg = 0; switch (comparam) { +#ifdef INET case IP__IP4_IFADDR: argv = alloca(8 * sizeof(char *)); *(const char **)&argv[0] = _PATH_IFCONFIG; @@ -326,6 +330,7 @@ run_command(struct cfjail *j) *(const char **)&argv[argc] = down ? "-alias" : "alias"; argv[argc + 1] = NULL; break; +#endif #ifdef INET6 case IP__IP6_IFADDR: Modified: projects/jailconf/usr.sbin/jail/config.c ============================================================================== --- projects/jailconf/usr.sbin/jail/config.c Mon Jun 20 22:59:29 2011 (r223350) +++ projects/jailconf/usr.sbin/jail/config.c Mon Jun 20 23:04:13 2011 (r223351) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "jailp.h" @@ -74,15 +75,19 @@ static const struct ipspec intparams[] = PF_INTERNAL | PF_BOOL}, [IP_EXEC_SYSTEM_USER] = {"exec.system_user", PF_INTERNAL}, [IP_EXEC_TIMEOUT] = {"exec.timeout", PF_INTERNAL | PF_INT}, +#if defined(INET) || defined(INET6) [IP_INTERFACE] = {"interface", PF_INTERNAL}, [IP_IP_HOSTNAME] = {"ip_hostname", PF_INTERNAL | PF_BOOL}, +#endif [IP_MOUNT] = {"mount", PF_INTERNAL}, [IP_MOUNT_DEVFS] = {"mount.devfs", PF_INTERNAL | PF_BOOL}, [IP_MOUNT_DEVFS_RULESET]= {"mount.devfs.ruleset", PF_INTERNAL}, [IP_MOUNT_FSTAB] = {"mount.fstab", PF_INTERNAL}, [IP_STOP_TIMEOUT] = {"stop.timeout", PF_INTERNAL | PF_INT}, [IP_VNET_INTERFACE] = {"vnet.interface", PF_INTERNAL}, +#ifdef INET [IP__IP4_IFADDR] = {"ip4.addr", PF_INTERNAL | PF_CONV}, +#endif #ifdef INET6 [IP__IP6_IFADDR] = {"ip6.addr", PF_INTERNAL | PF_CONV}, #endif @@ -96,7 +101,9 @@ static const struct ipspec intparams[] = [KP_ALLOW_SYSVIPC] = {"allow.sysvipc", 0}, [KP_ENFORCE_STATFS] = {"enforce_statfs", 0}, [KP_HOST_HOSTNAME] = {"host.hostname", 0}, +#ifdef INET [KP_IP4_ADDR] = {"ip4.addr", 0}, +#endif #ifdef INET6 [KP_IP6_ADDR] = {"ip6.addr", 0}, #endif @@ -427,21 +434,27 @@ string_param(const struct cfparam *p) int check_intparams(struct cfjail *j) { - struct in_addr addr4; - struct addrinfo hints; - struct addrinfo *ai0, *ai; struct cfparam *p; struct cfstring *s; FILE *f; - const char *hostname, *val; + const char *val; char *cs, *ep, *ln; - size_t size, lnlen; - int error, gicode, ip4ok, defif, prefix; - int mib[4]; + size_t lnlen; + int error; +#if defined(INET) || defined(INET6) + struct addrinfo hints; + struct addrinfo *ai0, *ai; + const char *hostname; + int gicode, defif, prefix; +#endif +#ifdef INET + struct in_addr addr4; + int ip4ok; char avalue4[INET_ADDRSTRLEN]; +#endif #ifdef INET6 struct in6_addr addr6; - int ip6ok, isip6; + int ip6ok; char avalue6[INET6_ADDRSTRLEN]; #endif @@ -471,6 +484,7 @@ check_intparams(struct cfjail *j) } } +#if defined(INET) || defined(INET6) /* * The ip_hostname parameter looks up the hostname, and adds parameters * for any IP addresses it finds. @@ -484,27 +498,32 @@ check_intparams(struct cfjail *j) * Silently ignore unsupported address families from * DNS lookups. */ - size = 4; - ip4ok = sysctlnametomib("security.jail.param.ip4", mib, &size) - == 0; -#ifdef INET6 - size = 4; - ip6ok = sysctlnametomib("security.jail.param.ip6", mib, &size) - == 0; +#ifdef INET + ip4ok = feature_present("inet"); #endif - if (ip4ok #ifdef INET6 - || ip6ok + ip6ok = feature_present("inet6"); +#endif + if ( +#if defined(INET) && defined(INET6) + ip4ok || ip6ok +#elif defined(INET) + ip4ok +#elif defined(INET6) + ip6ok #endif - ) { + ) { /* Look up the hostname (or get the address) */ memset(&hints, 0, sizeof(hints)); hints.ai_socktype = SOCK_STREAM; hints.ai_family = -#ifdef INET6 - ip6ok ? (ip4ok ? PF_UNSPEC : PF_INET6) : -#endif +#if defined(INET) && defined(INET6) + ip4ok ? (ip6ok ? PF_UNSPEC : PF_INET) : PF_INET6; +#elif defined(INET) PF_INET; +#elif defined(INET6) + PF_INET6; +#endif gicode = getaddrinfo(hostname, NULL, &hints, &ai0); if (gicode != 0) { jail_warnx(j, "host.hostname %s: %s", hostname, @@ -518,6 +537,7 @@ check_intparams(struct cfjail *j) */ for (ai = ai0; ai; ai = ai->ai_next) switch (ai->ai_family) { +#ifdef INET case AF_INET: memcpy(&addr4, &((struct sockaddr_in *) @@ -530,6 +550,7 @@ check_intparams(struct cfjail *j) add_param(j, NULL, KP_IP4_ADDR, avalue4); break; +#endif #ifdef INET6 case AF_INET6: memcpy(&addr6, @@ -555,43 +576,46 @@ check_intparams(struct cfjail *j) * and a netmask/suffix for that address. */ defif = string_param(j->intparams[IP_INTERFACE]) != NULL; -#ifdef INET6 - for (isip6 = 0; isip6 <= 1; isip6++) -#else -#define isip6 0 - do -#endif - { - if (j->intparams[KP_IP4_ADDR + isip6] == NULL) - continue; - TAILQ_FOREACH(s, &j->intparams[KP_IP4_ADDR + isip6]->val, tq) { +#ifdef INET + if (j->intparams[KP_IP4_ADDR] != NULL) { + TAILQ_FOREACH(s, &j->intparams[KP_IP4_ADDR]->val, tq) { cs = strchr(s->s, '|'); if (cs || defif) - add_param(j, NULL, IP__IP4_IFADDR + isip6, - s->s); + add_param(j, NULL, IP__IP4_IFADDR, s->s); if (cs) { strcpy(s->s, cs + 1); s->len -= cs + 1 - s->s; } if ((cs = strchr(s->s, '/'))) { prefix = strtol(cs + 1, &ep, 10); - if ( -#ifdef INET6 - !isip6 && -#endif - *ep == '.' + if (*ep == '.' ? inet_pton(AF_INET, cs + 1, &addr4) != 1 - : *ep || prefix < 0 || prefix > ( -#ifdef INET6 - isip6 ? 128 : -#endif - 32)) { + : *ep || prefix < 0 || prefix > 32) { jail_warnx(j, -#ifdef INET6 - isip6 - ? "ip6.addr: bad prefixlen \"%s\"" : + "ip4.addr: bad netmask \"%s\"", cs); + error = -1; + } + *cs = '\0'; + s->len = cs - s->s + 1; + } + } + } #endif - "ip4.addr: bad netmask \"%s\"", +#ifdef INET6 + if (j->intparams[KP_IP6_ADDR] != NULL) { + TAILQ_FOREACH(s, &j->intparams[KP_IP6_ADDR]->val, tq) { + cs = strchr(s->s, '|'); + if (cs || defif) + add_param(j, NULL, IP__IP6_IFADDR, s->s); + if (cs) { + strcpy(s->s, cs + 1); + s->len -= cs + 1 - s->s; + } + if ((cs = strchr(s->s, '/'))) { + prefix = strtol(cs + 1, &ep, 10); + if (*ep || prefix < 0 || prefix > 128) { + jail_warnx(j, + "ip6.addr: bad prefixlen \"%s\"", cs); error = -1; } @@ -600,8 +624,7 @@ check_intparams(struct cfjail *j) } } } -#ifndef INET6 - while (0); +#endif #endif /* Modified: projects/jailconf/usr.sbin/jail/jail.c ============================================================================== --- projects/jailconf/usr.sbin/jail/jail.c Mon Jun 20 22:59:29 2011 (r223350) +++ projects/jailconf/usr.sbin/jail/jail.c Mon Jun 20 23:04:13 2011 (r223351) @@ -80,7 +80,9 @@ static struct permspec perm_sysctl[] = { static const enum intparam startcommands[] = { 0, +#ifdef INET IP__IP4_IFADDR, +#endif #ifdef INET6 IP__IP6_IFADDR, #endif @@ -109,25 +111,30 @@ static const enum intparam stopcommands[ #ifdef INET6 IP__IP6_IFADDR, #endif +#ifdef INET IP__IP4_IFADDR, +#endif 0 }; int main(int argc, char **argv) { -#ifdef INET6 - struct in6_addr addr6; -#endif struct stat st; FILE *jfp; struct cfjail *j; - char *cs, *ncs, *JidFile; + char *JidFile; size_t sysvallen; unsigned op, pi; int ch, docf, error, i, oldcl, sysval; int dflag, iflag, Rflag; char enforce_statfs[4]; +#if defined(INET) || defined(INET6) + char *cs, *ncs; +#endif +#if defined(INET) && defined(INET6) + struct in6_addr addr6; +#endif op = 0; dflag = iflag = Rflag = 0; @@ -147,7 +154,9 @@ main(int argc, char **argv) cfname = optarg; break; case 'h': +#if defined(INET) || defined(INET6) add_param(NULL, NULL, IP_IP_HOSTNAME, NULL); +#endif docf = 0; break; case 'i': @@ -219,21 +228,27 @@ main(int argc, char **argv) oldcl = 1; add_param(NULL, NULL, KP_PATH, argv[0]); add_param(NULL, NULL, KP_HOST_HOSTNAME, argv[1]); +#if defined(INET) || defined(INET6) if (argv[2][0] != '\0') { for (cs = argv[2];; cs = ncs + 1) { ncs = strchr(cs, ','); if (ncs) *ncs = '\0'; add_param(NULL, NULL, -#ifdef INET6 +#if defined(INET) && defined(INET6) inet_pton(AF_INET6, cs, &addr6) == 1 - ? KP_IP6_ADDR : + ? KP_IP6_ADDR : KP_IP4_ADDR, +#elif defined(INET) + KP_IP4_ADDR, +#elif defined(INET6) + KP_IP6_ADDR, #endif - KP_IP4_ADDR, cs); + cs); if (!ncs) break; } } +#endif for (i = 3; i < argc; i++) add_param(NULL, NULL, IP_COMMAND, argv[i]); /* Emulate the defaults from security.jail.* sysctls. */ @@ -866,15 +881,18 @@ print_jail(FILE *fp, struct cfjail *j, i putc('\t', fp); print_param(fp, j->intparams[KP_HOST_HOSTNAME], ',', 0); putc('\t', fp); +#ifdef INET print_param(fp, j->intparams[KP_IP4_ADDR], ',', 0); #ifdef INET6 - if (j->intparams[KP_IP6_ADDR] && - !TAILQ_EMPTY(&j->intparams[KP_IP6_ADDR]->val)) { - if (j->intparams[KP_IP4_ADDR] && - !TAILQ_EMPTY(&j->intparams[KP_IP4_ADDR]->val)) - putc(',', fp); - print_param(fp, j->intparams[KP_IP6_ADDR], ',', 0); - } + if (j->intparams[KP_IP4_ADDR] && + !TAILQ_EMPTY(&j->intparams[KP_IP4_ADDR]->val) && + j->intparams[KP_IP6_ADDR] && + !TAILQ_EMPTY(&j->intparams[KP_IP6_ADDR]->val)) + putc(',', fp); +#endif +#endif +#ifdef INET6 + print_param(fp, j->intparams[KP_IP6_ADDR], ',', 0); #endif putc('\t', fp); print_param(fp, j->intparams[IP_COMMAND], ' ', 0); Modified: projects/jailconf/usr.sbin/jail/jailp.h ============================================================================== --- projects/jailconf/usr.sbin/jail/jailp.h Mon Jun 20 22:59:29 2011 (r223350) +++ projects/jailconf/usr.sbin/jail/jailp.h Mon Jun 20 23:04:13 2011 (r223351) @@ -87,15 +87,19 @@ enum intparam { IP_EXEC_SYSTEM_JAIL_USER,/* Get jail_user from system passwd file */ IP_EXEC_SYSTEM_USER, /* Run non-jailed commands as this user */ IP_EXEC_TIMEOUT, /* Time to wait for a command to complete */ +#if defined(INET) || defined(INET6) IP_INTERFACE, /* Add IP addresses to this interface */ IP_IP_HOSTNAME, /* Get jail IP address(es) from hostname */ +#endif IP_MOUNT, /* Mount points in fstab(5) form */ IP_MOUNT_DEVFS, /* Mount /dev under prison root */ IP_MOUNT_DEVFS_RULESET, /* Ruleset for the devfs mount */ IP_MOUNT_FSTAB, /* A standard fstab(5) file */ IP_STOP_TIMEOUT, /* Time to wait after sending SIGTERM */ IP_VNET_INTERFACE, /* Assign interface(s) to vnet jail */ +#ifdef INET IP__IP4_IFADDR, /* Copy of ip4.addr with interface/netmask */ +#endif #ifdef INET6 IP__IP6_IFADDR, /* Copy of ip6.addr with interface/prefixlen */ #endif @@ -109,7 +113,9 @@ enum intparam { KP_ALLOW_SYSVIPC, KP_ENFORCE_STATFS, KP_HOST_HOSTNAME, +#ifdef INET KP_IP4_ADDR, +#endif #ifdef INET6 KP_IP6_ADDR, #endif From owner-svn-src-projects@FreeBSD.ORG Tue Jun 21 03:42:00 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9F4E106564A; Tue, 21 Jun 2011 03:42:00 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 807A58FC1A; Tue, 21 Jun 2011 03:42:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5L3g0wV078060; Tue, 21 Jun 2011 03:42:00 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5L3g0WJ078057; Tue, 21 Jun 2011 03:42:00 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201106210342.p5L3g0WJ078057@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 21 Jun 2011 03:42:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223354 - projects/llvm-ia64/contrib/llvm/lib/Target/IA64 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 03:42:00 -0000 Author: marcel Date: Tue Jun 21 03:42:00 2011 New Revision: 223354 URL: http://svn.freebsd.org/changeset/base/223354 Log: o remove getFunctionAlignment(). It's not part of the class. o set the minimum and preferred function alignment. o set the size and alignment of the jump buffer. Modified: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetLowering.cpp projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetLowering.h Modified: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetLowering.cpp ============================================================================== --- projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetLowering.cpp Tue Jun 21 03:07:59 2011 (r223353) +++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetLowering.cpp Tue Jun 21 03:42:00 2011 (r223354) @@ -34,20 +34,17 @@ IA64TargetLowering::IA64TargetLowering(I TD = getTargetData(); // Set up the register classes. + addRegisterClass(MVT::i64, &IA64::BranchRegClass); addRegisterClass(MVT::f128, &IA64::FloatingPointRegClass); addRegisterClass(MVT::i64, &IA64::GeneralRegClass); addRegisterClass(MVT::i1, &IA64::PredicateRegClass); // Compute derived properties from the register classes computeRegisterProperties(); -} -unsigned -IA64TargetLowering::getFunctionAlignment(const Function *F) const -{ - // Functions must have at least 16-byte alignment, but 32-byte alignment - // is better because branch targets should be aligned on 32-byte boundaries - // to ensure that the front-end can deliver 2 bundles per cycle to the - // back-end. - return F->hasFnAttr(Attribute::OptimizeForSize) ? 4 : 5; + setMinFunctionAlignment(4); + setPrefFunctionAlignment(5); + + setJumpBufSize(512); + setJumpBufAlignment(16); } Modified: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetLowering.h ============================================================================== --- projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetLowering.h Tue Jun 21 03:07:59 2011 (r223353) +++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetLowering.h Tue Jun 21 03:42:00 2011 (r223354) @@ -17,8 +17,6 @@ namespace llvm { public: explicit IA64TargetLowering(IA64TargetMachine &TM); - - virtual unsigned getFunctionAlignment(const Function *F) const; }; } // namespace llvm From owner-svn-src-projects@FreeBSD.ORG Tue Jun 21 05:27:50 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E3AA106566B; Tue, 21 Jun 2011 05:27:50 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CDAF8FC08; Tue, 21 Jun 2011 05:27:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5L5Rosf081320; Tue, 21 Jun 2011 05:27:50 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5L5RoKW081314; Tue, 21 Jun 2011 05:27:50 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201106210527.p5L5RoKW081314@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 21 Jun 2011 05:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223357 - projects/llvm-ia64/contrib/llvm/lib/Target/IA64 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 05:27:50 -0000 Author: marcel Date: Tue Jun 21 05:27:49 2011 New Revision: 223357 URL: http://svn.freebsd.org/changeset/base/223357 Log: o Implement IA64TargetLowering::LowerFormalArguments() for just a single case. o Implement IA64TargetLowering::LowerReturn() as empty. o Give a stab at IA64CallingConv.td We now reach IA64FrameLowering::emitPrologue() Added: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64CallingConv.td Modified: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64.td projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64FrameLowering.cpp projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetLowering.cpp projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetLowering.h Modified: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64.td ============================================================================== --- projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64.td Tue Jun 21 04:46:00 2011 (r223356) +++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64.td Tue Jun 21 05:27:49 2011 (r223357) @@ -35,6 +35,14 @@ def F2 : IA64Register<"f2">; def F3 : IA64Register<"f3">; def F4 : IA64Register<"f4">; def F5 : IA64Register<"f5">; +def F8 : IA64Register<"f8">; +def F9 : IA64Register<"f9">; +def F10 : IA64Register<"f10">; +def F11 : IA64Register<"f11">; +def F12 : IA64Register<"f12">; +def F13 : IA64Register<"f13">; +def F14 : IA64Register<"f14">; +def F15 : IA64Register<"f15">; def F16 : IA64Register<"f16">; def F17 : IA64Register<"f17">; def F18 : IA64Register<"f18">; @@ -115,8 +123,18 @@ def R4 : IA64Register<"r4">; def R5 : IA64Register<"r5">; def R6 : IA64Register<"r6">; def R7 : IA64Register<"r7">; +def R8 : IA64Register<"r8">; def R12 : IA64Register<"r12">; def R13 : IA64Register<"r13">; +// XXX +def R32 : IA64Register<"r32">; +def R33 : IA64Register<"r33">; +def R34 : IA64Register<"r34">; +def R35 : IA64Register<"r35">; +def R36 : IA64Register<"r36">; +def R37 : IA64Register<"r37">; +def R38 : IA64Register<"r38">; +def R39 : IA64Register<"r39">; // Branch registers def B1 : IA64Register<"b1">; @@ -134,10 +152,11 @@ class IA64RegisterClass def Branch : IA64RegisterClass<[i64], 8, [B1, B2, B3, B4, B5]>; def FloatingPoint : IA64RegisterClass<[f128], 128, - [F0, F1, F2, F3, F4, F5, F16, F17, F18, F19, F20, F21, F22, F23, - F24, F25, F26, F27, F28, F29, F30, F31]>; + [F0, F1, F2, F3, F4, F5, F8, F9, F10, F11, F12, F13, F14, F15, F16, + F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, + F30, F31]>; def General : IA64RegisterClass<[i64], 64, - [R0, R1, R4, R5, R6, R7, R12, R13]>; + [R0, R1, R4, R5, R6, R7, R8, R12, R13]>; def Predicate : IA64RegisterClass<[i1], 0, [P0, P1, P2, P3, P4, P5, P16, P17, P18, P19, P20, P21, P22, P23, P24, P25, P26, P27, P28, P29, P30, P31, P32, P33, P34, P35, P36, @@ -146,6 +165,11 @@ def Predicate : IA64RegisterClass<[i1], P63]>; // +// Calling Convention +// +include "IA64CallingConv.td" + +// // Instructions // class IA64Instruction : Instruction { Added: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64CallingConv.td ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64CallingConv.td Tue Jun 21 05:27:49 2011 (r223357) @@ -0,0 +1,42 @@ +def RetCC_IA64 : CallingConv<[ + CCIfType<[i64], CCAssignToReg<[R8]>>, + + // XXX i128 is returned in the pair {r8,r9}. Custom rule needed? + + // FP values are returned in the register format, but rounded to + // the appropriate precision. + CCIfType<[f32, f64, f80], CCAssignToReg<[F8]>> + + // XXX f128 is returned in the pair {f8,f9}. Custom rule needed? + + // XXX HFAs (Momogeneous FP aggregates) up to 8 elements or fields are + // treated specially. Each element or field is assigned to a FP register + // (in order) from the set [f8, f9, f10, f11, f12, f13, f14, f15]. + + // XXX Aggregates up to 256 bits in size are assigned to registers (in + // order) from the set [r8, r9, r10, r11]. + + // Aggregates larger than 256 bits are returned in memory. +]>; + +def CC_IA64 : CallingConv<[ + // XXX There's a 1-to-1 mapping between general registers and slots. + // As such, if an argument is to be passed in a FP register, the + // general register corresponding to that slot cannot be used anymore. + // This isn't handled (yet). + CCIfType<[i64], CCAssignToReg<[R32, R33, R34, R35, R36, R37, R38, R39]>>, + + // XXX i128 is assigned 2 consecutive registers/slots, aligned at the + // next even slot. + + // FP registers are assigned in sequence. For the vararg case, this + // works differently. This isn't handled (yet). + CCIfNotVarArg>>, + + // XXX f80 and f128 occupy 2 consecutive slots, aligned at the + // next even slot. + + CCIfType<[i64, f32, f64], CCAssignToStack<8, 8>>, + CCIfType<[f80, f128], CCAssignToStack<16, 16>> +]>; Modified: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64FrameLowering.cpp ============================================================================== --- projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64FrameLowering.cpp Tue Jun 21 04:46:00 2011 (r223356) +++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64FrameLowering.cpp Tue Jun 21 05:27:49 2011 (r223357) @@ -1,5 +1,6 @@ #include "IA64FrameLowering.h" #include "IA64InstrInfo.h" +#include "IA64MachineFunctionInfo.h" #include "llvm/Function.h" #include "llvm/CodeGen/MachineFrameInfo.h" @@ -16,6 +17,12 @@ using namespace llvm; void IA64FrameLowering::emitPrologue(MachineFunction &MF) const { + IA64MachineFunctionInfo *IA64FI = MF.getInfo(); + MachineFrameInfo *MFI = MF.getFrameInfo(); + MachineBasicBlock &MBB = MF.front(); + const IA64InstrInfo &TII = + *static_cast(MF.getTarget().getInstrInfo()); + llvm_unreachable(__func__); } Modified: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetLowering.cpp ============================================================================== --- projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetLowering.cpp Tue Jun 21 04:46:00 2011 (r223356) +++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetLowering.cpp Tue Jun 21 05:27:49 2011 (r223357) @@ -1,3 +1,5 @@ +#define DEBUG_TYPE "ia64-target-lowering" + #include "IA64.h" #include "IA64Subtarget.h" #include "IA64TargetLowering.h" @@ -48,3 +50,37 @@ IA64TargetLowering::IA64TargetLowering(I setJumpBufSize(512); setJumpBufAlignment(16); } + +SDValue +IA64TargetLowering::LowerFormalArguments(SDValue Chain, + CallingConv::ID CallConv, bool isVarArg, + const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, + SmallVectorImpl &InVals) const +{ + MachineFunction &MF = DAG.getMachineFunction(); + SDValue Val; + + for (unsigned ArgNo = 0, e = Ins.size(); ArgNo != e; ++ArgNo) { + EVT vt = Ins[ArgNo].VT; + + unsigned VReg = + MF.getRegInfo().createVirtualRegister(&IA64::GeneralRegClass); + MF.getRegInfo().addLiveIn(IA64::R32, VReg); + Val = DAG.getCopyFromReg(Chain, dl, VReg, MVT::i64); + InVals.push_back(Val); + + DEBUG(dbgs() << ArgNo << ": " << vt.getSimpleVT().SimpleTy << " -> " << + VReg << "\n:"); + } + + return Chain; +} + +SDValue +IA64TargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv, + bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, + SelectionDAG &DAG) const +{ + return Chain; +} Modified: projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetLowering.h ============================================================================== --- projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetLowering.h Tue Jun 21 04:46:00 2011 (r223356) +++ projects/llvm-ia64/contrib/llvm/lib/Target/IA64/IA64TargetLowering.h Tue Jun 21 05:27:49 2011 (r223357) @@ -17,6 +17,16 @@ namespace llvm { public: explicit IA64TargetLowering(IA64TargetMachine &TM); + + virtual SDValue LowerFormalArguments(SDValue Chain, + CallingConv::ID CallConv, bool isVarArg, + const SmallVectorImpl &Ins, DebugLoc dl, + SelectionDAG &DAG, SmallVectorImpl &InVals) const; + + virtual SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, + bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, + SelectionDAG &DAG) const; }; } // namespace llvm From owner-svn-src-projects@FreeBSD.ORG Tue Jun 21 07:52:05 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B03F1065674 for ; Tue, 21 Jun 2011 07:52:05 +0000 (UTC) (envelope-from rdivacky@vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [46.28.110.116]) by mx1.freebsd.org (Postfix) with ESMTP id F02248FC15 for ; Tue, 21 Jun 2011 07:52:04 +0000 (UTC) Received: by vlakno.cz (Postfix, from userid 1002) id 75F167F38B9; Tue, 21 Jun 2011 09:13:52 +0200 (CEST) Date: Tue, 21 Jun 2011 09:13:52 +0200 From: Roman Divacky To: Marcel Moolenaar Message-ID: <20110621071352.GA44571@freebsd.org> References: <201106210527.p5L5RoKW081314@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201106210527.p5L5RoKW081314@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223357 - projects/llvm-ia64/contrib/llvm/lib/Target/IA64 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 07:52:05 -0000 On Tue, Jun 21, 2011 at 05:27:50AM +0000, Marcel Moolenaar wrote: > Author: marcel > Date: Tue Jun 21 05:27:49 2011 > New Revision: 223357 > URL: http://svn.freebsd.org/changeset/base/223357 > > Log: > o Implement IA64TargetLowering::LowerFormalArguments() for just a single > case. > o Implement IA64TargetLowering::LowerReturn() as empty. > o Give a stab at IA64CallingConv.td > > We now reach IA64FrameLowering::emitPrologue() cool! > + > +SDValue > +IA64TargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv, > + bool isVarArg, const SmallVectorImpl &Outs, > + const SmallVectorImpl &OutVals, DebugLoc dl, > + SelectionDAG &DAG) const > +{ > + return Chain; > +} This doesn't look right, you probably want to copy the result(s) into register(s) or something like this. anyway, great to see progress! From owner-svn-src-projects@FreeBSD.ORG Tue Jun 21 09:09:53 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC3FF1065670; Tue, 21 Jun 2011 09:09:53 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A92168FC19; Tue, 21 Jun 2011 09:09:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5L99rnn089273; Tue, 21 Jun 2011 09:09:53 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5L99rZl089250; Tue, 21 Jun 2011 09:09:53 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201106210909.p5L99rZl089250@svn.freebsd.org> From: Attilio Rao Date: Tue, 21 Jun 2011 09:09:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223362 - in projects/largeSMP: contrib/lukemftp contrib/top etc etc/defaults etc/rc.d lib/msun/src sbin/geom/class/part share/man/man5 share/mk sys/conf sys/dev/atkbdc sys/dev/e1000 sy... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 09:09:53 -0000 Author: attilio Date: Tue Jun 21 09:09:53 2011 New Revision: 223362 URL: http://svn.freebsd.org/changeset/base/223362 Log: MFC Added: - copied from r223361, head/contrib/tnftp/ projects/largeSMP/etc/rc.d/netwait - copied unchanged from r223361, head/etc/rc.d/netwait projects/largeSMP/sys/powerpc/ps3/ohci_ps3.c - copied unchanged from r223361, head/sys/powerpc/ps3/ohci_ps3.c projects/largeSMP/sys/powerpc/ps3/ps3disk.c - copied unchanged from r223361, head/sys/powerpc/ps3/ps3disk.c projects/largeSMP/usr.bin/ftp/tnftp_config.h - copied unchanged from r223361, head/usr.bin/ftp/tnftp_config.h projects/largeSMP/usr.sbin/makefs/mtree.c - copied unchanged from r223361, head/usr.sbin/makefs/mtree.c Directory Properties: projects/largeSMP/contrib/tnftp/ (props changed) Deleted: projects/largeSMP/contrib/lukemftp/ projects/largeSMP/usr.bin/ftp/config.h Modified: projects/largeSMP/contrib/top/display.c projects/largeSMP/contrib/top/top.h projects/largeSMP/etc/defaults/rc.conf projects/largeSMP/etc/rc.d/Makefile projects/largeSMP/etc/rc.d/mountcritremote projects/largeSMP/etc/rc.subr projects/largeSMP/lib/msun/src/e_rem_pio2.c projects/largeSMP/sbin/geom/class/part/geom_part.c projects/largeSMP/share/man/man5/rc.conf.5 projects/largeSMP/sys/conf/files.powerpc projects/largeSMP/sys/dev/atkbdc/atkbd.c projects/largeSMP/sys/dev/e1000/if_igb.c projects/largeSMP/sys/dev/e1000/if_igb.h projects/largeSMP/sys/dev/firewire/fwohci.c projects/largeSMP/sys/dev/pccbb/pccbb_pci.c projects/largeSMP/sys/fs/nfs/nfs_commonkrpc.c projects/largeSMP/sys/fs/nfsclient/nfs_clkrpc.c projects/largeSMP/sys/fs/nfsserver/nfs_nfsdcache.c projects/largeSMP/sys/fs/nfsserver/nfs_nfsdkrpc.c projects/largeSMP/sys/fs/nfsserver/nfs_nfsdserv.c projects/largeSMP/sys/fs/nfsserver/nfs_nfsdsocket.c projects/largeSMP/sys/geom/part/g_part_bsd.c projects/largeSMP/sys/kgssapi/gss_impl.c projects/largeSMP/sys/modules/Makefile projects/largeSMP/sys/modules/kgssapi_krb5/Makefile projects/largeSMP/sys/net/route.c projects/largeSMP/sys/net/route.h projects/largeSMP/sys/net80211/ieee80211_ht.c projects/largeSMP/sys/net80211/ieee80211_var.h projects/largeSMP/sys/netinet/ipfw/ip_dn_io.c projects/largeSMP/sys/netinet/ipfw/ip_fw_pfil.c projects/largeSMP/sys/netinet/tcp_output.c projects/largeSMP/sys/nfsclient/nfs_krpc.c projects/largeSMP/sys/nfsserver/nfs_srvkrpc.c projects/largeSMP/sys/powerpc/ps3/if_glc.c projects/largeSMP/sys/powerpc/ps3/ps3bus.c projects/largeSMP/sys/powerpc/ps3/ps3bus.h projects/largeSMP/sys/rpc/rpc_generic.c projects/largeSMP/sys/rpc/rpcsec_gss.h projects/largeSMP/sys/sparc64/sparc64/mp_machdep.c projects/largeSMP/sys/sparc64/sparc64/pmap.c projects/largeSMP/sys/ufs/ffs/ffs_alloc.c projects/largeSMP/sys/ufs/ffs/ffs_extern.h projects/largeSMP/sys/ufs/ffs/ffs_softdep.c projects/largeSMP/sys/vm/vm_fault.c projects/largeSMP/sys/vm/vm_page.c projects/largeSMP/sys/vm/vm_page.h projects/largeSMP/usr.bin/ftp/Makefile projects/largeSMP/usr.sbin/makefs/Makefile projects/largeSMP/usr.sbin/makefs/cd9660/cd9660_write.c projects/largeSMP/usr.sbin/makefs/ffs.c projects/largeSMP/usr.sbin/makefs/makefs.8 projects/largeSMP/usr.sbin/makefs/makefs.c projects/largeSMP/usr.sbin/makefs/makefs.h projects/largeSMP/usr.sbin/mfiutil/mfi_config.c projects/largeSMP/usr.sbin/mfiutil/mfi_drive.c projects/largeSMP/usr.sbin/mfiutil/mfi_patrol.c projects/largeSMP/usr.sbin/mfiutil/mfi_show.c projects/largeSMP/usr.sbin/mfiutil/mfiutil.8 projects/largeSMP/usr.sbin/mfiutil/mfiutil.c projects/largeSMP/usr.sbin/mfiutil/mfiutil.h projects/largeSMP/usr.sbin/ypserv/yp_main.c Directory Properties: projects/largeSMP/ (props changed) projects/largeSMP/cddl/contrib/opensolaris/ (props changed) projects/largeSMP/contrib/bind9/ (props changed) projects/largeSMP/contrib/binutils/ (props changed) projects/largeSMP/contrib/bzip2/ (props changed) projects/largeSMP/contrib/compiler-rt/ (props changed) projects/largeSMP/contrib/dialog/ (props changed) projects/largeSMP/contrib/ee/ (props changed) projects/largeSMP/contrib/expat/ (props changed) projects/largeSMP/contrib/file/ (props changed) projects/largeSMP/contrib/gcc/ (props changed) projects/largeSMP/contrib/gdb/ (props changed) projects/largeSMP/contrib/gdtoa/ (props changed) projects/largeSMP/contrib/gnu-sort/ (props changed) projects/largeSMP/contrib/groff/ (props changed) projects/largeSMP/contrib/less/ (props changed) projects/largeSMP/contrib/libpcap/ (props changed) projects/largeSMP/contrib/libstdc++/ (props changed) projects/largeSMP/contrib/llvm/ (props changed) projects/largeSMP/contrib/llvm/tools/clang/ (props changed) projects/largeSMP/contrib/ncurses/ (props changed) projects/largeSMP/contrib/netcat/ (props changed) projects/largeSMP/contrib/ntp/ (props changed) projects/largeSMP/contrib/one-true-awk/ (props changed) projects/largeSMP/contrib/openbsm/ (props changed) projects/largeSMP/contrib/openpam/ (props changed) projects/largeSMP/contrib/pf/ (props changed) projects/largeSMP/contrib/sendmail/ (props changed) projects/largeSMP/contrib/tcpdump/ (props changed) projects/largeSMP/contrib/tcsh/ (props changed) projects/largeSMP/contrib/top/ (props changed) projects/largeSMP/contrib/top/install-sh (props changed) projects/largeSMP/contrib/tzcode/stdtime/ (props changed) projects/largeSMP/contrib/tzcode/zic/ (props changed) projects/largeSMP/contrib/tzdata/ (props changed) projects/largeSMP/contrib/wpa/ (props changed) projects/largeSMP/contrib/xz/ (props changed) projects/largeSMP/crypto/openssh/ (props changed) projects/largeSMP/crypto/openssl/ (props changed) projects/largeSMP/gnu/lib/ (props changed) projects/largeSMP/gnu/usr.bin/binutils/ (props changed) projects/largeSMP/gnu/usr.bin/cc/cc_tools/ (props changed) projects/largeSMP/gnu/usr.bin/gdb/ (props changed) projects/largeSMP/lib/libc/ (props changed) projects/largeSMP/lib/libc/stdtime/ (props changed) projects/largeSMP/lib/libutil/ (props changed) projects/largeSMP/lib/libz/ (props changed) projects/largeSMP/sbin/ (props changed) projects/largeSMP/sbin/ipfw/ (props changed) projects/largeSMP/share/mk/bsd.arch.inc.mk (props changed) projects/largeSMP/share/zoneinfo/ (props changed) projects/largeSMP/sys/ (props changed) projects/largeSMP/sys/amd64/include/xen/ (props changed) projects/largeSMP/sys/boot/ (props changed) projects/largeSMP/sys/boot/i386/efi/ (props changed) projects/largeSMP/sys/boot/ia64/efi/ (props changed) projects/largeSMP/sys/boot/ia64/ski/ (props changed) projects/largeSMP/sys/boot/powerpc/boot1.chrp/ (props changed) projects/largeSMP/sys/boot/powerpc/ofw/ (props changed) projects/largeSMP/sys/cddl/contrib/opensolaris/ (props changed) projects/largeSMP/sys/conf/ (props changed) projects/largeSMP/sys/contrib/dev/acpica/ (props changed) projects/largeSMP/sys/contrib/octeon-sdk/ (props changed) projects/largeSMP/sys/contrib/pf/ (props changed) projects/largeSMP/sys/contrib/x86emu/ (props changed) projects/largeSMP/usr.bin/calendar/ (props changed) projects/largeSMP/usr.bin/csup/ (props changed) projects/largeSMP/usr.bin/procstat/ (props changed) projects/largeSMP/usr.sbin/ndiscvt/ (props changed) projects/largeSMP/usr.sbin/zic/ (props changed) Modified: projects/largeSMP/contrib/top/display.c ============================================================================== --- projects/largeSMP/contrib/top/display.c Tue Jun 21 08:39:09 2011 (r223361) +++ projects/largeSMP/contrib/top/display.c Tue Jun 21 09:09:53 2011 (r223362) @@ -698,7 +698,7 @@ char *text; int width; s = NULL; - width = screen_width; + width = display_width; header_length = strlen(text); if (header_length >= width) { s = malloc((width + 1) * sizeof(char)); @@ -706,14 +706,6 @@ char *text; return (NULL); strncpy(s, text, width); s[width] = '\0'; - } else { - s = malloc((width + 1) * sizeof(char)); - if (s == NULL) - return (NULL); - strncpy(s, text, width); - while (screen_width > header_length) - s[header_length++] = ' '; - s[width] = '\0'; } return (s); } @@ -738,7 +730,7 @@ char *text; if (header_status == ON) { putchar('\n'); - standout(text, stdout); + fputs(text, stdout); lastline++; } else if (header_status == ERASE) Modified: projects/largeSMP/contrib/top/top.h ============================================================================== --- projects/largeSMP/contrib/top/top.h Tue Jun 21 08:39:09 2011 (r223361) +++ projects/largeSMP/contrib/top/top.h Tue Jun 21 09:09:53 2011 (r223362) @@ -14,7 +14,7 @@ extern int Header_lines; /* 7 */ /* Maximum number of columns allowed for display */ -#define MAX_COLS 512 +#define MAX_COLS 128 /* Log base 2 of 1024 is 10 (2^10 == 1024) */ #define LOG1024 10 Modified: projects/largeSMP/etc/defaults/rc.conf ============================================================================== --- projects/largeSMP/etc/defaults/rc.conf Tue Jun 21 08:39:09 2011 (r223361) +++ projects/largeSMP/etc/defaults/rc.conf Tue Jun 21 09:09:53 2011 (r223362) @@ -444,6 +444,13 @@ ubthidhci_enable="NO" # Switch an USB B #ubthidhci_addr="2" # Check usbconfig list to find the correct # numbers for your system. +### Network link/usability verification options +netwait_enable="NO" # Enable rc.d/netwait (or NO) +#netwait_ip="" # IP addresses to be pinged by netwait. +netwait_timeout="60" # Total number of seconds to perform pings. +#netwait_if="" # Interface name to watch link state on. +netwait_if_timeout="30" # Total number of seconds to monitor link state. + ### Miscellaneous network options: ### icmp_bmcastecho="NO" # respond to broadcast ping packets Modified: projects/largeSMP/etc/rc.d/Makefile ============================================================================== --- projects/largeSMP/etc/rc.d/Makefile Tue Jun 21 08:39:09 2011 (r223361) +++ projects/largeSMP/etc/rc.d/Makefile Tue Jun 21 09:09:53 2011 (r223362) @@ -22,7 +22,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI ldconfig local localpkg lockd lpd \ mixer motd mountcritlocal mountcritremote mountlate \ mdconfig mdconfig2 mountd moused mroute6d mrouted msgs \ - named natd netif netoptions \ + named natd netif netoptions netwait \ newsyslog nfsclient nfscbd nfsd \ nfsserver nfsuserd nisdomain nsswitch ntpd ntpdate \ othermta \ Modified: projects/largeSMP/etc/rc.d/mountcritremote ============================================================================== --- projects/largeSMP/etc/rc.d/mountcritremote Tue Jun 21 08:39:09 2011 (r223361) +++ projects/largeSMP/etc/rc.d/mountcritremote Tue Jun 21 09:09:53 2011 (r223362) @@ -4,7 +4,7 @@ # # PROVIDE: mountcritremote -# REQUIRE: NETWORKING FILESYSTEMS cleanvar ipsec +# REQUIRE: NETWORKING FILESYSTEMS cleanvar ipsec netwait # KEYWORD: nojail . /etc/rc.subr Copied: projects/largeSMP/etc/rc.d/netwait (from r223361, head/etc/rc.d/netwait) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/largeSMP/etc/rc.d/netwait Tue Jun 21 09:09:53 2011 (r223362, copy of r223361, head/etc/rc.d/netwait) @@ -0,0 +1,97 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: netwait +# REQUIRE: NETWORKING +# KEYWORD: nojail +# +# The netwait script is intended to be used by systems which have +# statically-configured IP addresses in rc.conf(5). If your system +# uses DHCP, you should use synchronous_dhclient="YES" in your +# /etc/rc.conf instead of using netwait. + +. /etc/rc.subr + +name="netwait" +rc_var=`set_rcvar` +start_cmd="${name}_start" +stop_cmd=":" + +netwait_start() +{ + local ip rc count output link + + if [ -z "${netwait_ip}" ]; then + err 1 "You must define one or more IP addresses in netwait_ip" + fi + + if [ ${netwait_timeout} -lt 1 ]; then + err 1 "netwait_timeout must be >= 1" + fi + + # Handle SIGINT (Ctrl-C); force abort of while() loop + trap break SIGINT + + if [ -n "${netwait_if}" ]; then + echo -n "Waiting for $netwait_if to have link" + + count=1 + while [ ${count} -le ${netwait_if_timeout} ]; do + if output=`/sbin/ifconfig ${netwait_if} 2>/dev/null`; then + link=`expr "${output}" : '.*[[:blank:]]status: \(no carrier\)'` + if [ -z "${link}" ]; then + echo '.' + break + fi + else + echo '' + err 1 "ifconfig ${netwait_if} failed" + fi + sleep 1 + count=$((count+1)) + done + if [ -n "${link}" ]; then + # Restore default SIGINT handler + trap - SIGINT + + echo '' + warn "Interface still has no link. Continuing with startup, but" + warn "be aware you may not have a fully functional networking" + warn "layer at this point." + return + fi + fi + + # Handle SIGINT (Ctrl-C); force abort of while() loop + trap break SIGINT + + for ip in ${netwait_ip}; do + echo -n "Waiting for ${ip} to respond to ICMP" + + count=1 + while [ ${count} -le ${netwait_timeout} ]; do + /sbin/ping -t 1 -c 1 -o ${ip} >/dev/null 2>&1 + rc=$? + + if [ $rc -eq 0 ]; then + # Restore default SIGINT handler + trap - SIGINT + + echo '.' + return + fi + count=$((count+1)) + done + echo ': No response from host.' + done + + # Restore default SIGINT handler + trap - SIGINT + + warn "Exhausted IP list. Continuing with startup, but be aware you may" + warn "not have a fully functional networking layer at this point." +} + +load_rc_config $name +run_rc_command "$1" Modified: projects/largeSMP/etc/rc.subr ============================================================================== --- projects/largeSMP/etc/rc.subr Tue Jun 21 08:39:09 2011 (r223361) +++ projects/largeSMP/etc/rc.subr Tue Jun 21 09:09:53 2011 (r223362) @@ -1732,8 +1732,6 @@ check_required_after() return 0 } -fi - # check_kern_features mib # Return existence of kern.features.* sysctl MIB as true or # false. The result will be cached in $_rc_cache_kern_features_ @@ -1775,4 +1773,6 @@ _echoonce() esac } +fi # [ -z "${_rc_subr_loaded}" ] + _rc_subr_loaded=: Modified: projects/largeSMP/lib/msun/src/e_rem_pio2.c ============================================================================== --- projects/largeSMP/lib/msun/src/e_rem_pio2.c Tue Jun 21 08:39:09 2011 (r223361) +++ projects/largeSMP/lib/msun/src/e_rem_pio2.c Tue Jun 21 09:09:53 2011 (r223362) @@ -171,9 +171,8 @@ medium: } /* set z = scalbn(|x|,ilogb(x)-23) */ GET_LOW_WORD(low,x); - SET_LOW_WORD(z,low); e0 = (ix>>20)-1046; /* e0 = ilogb(z)-23; */ - SET_HIGH_WORD(z, ix - ((int32_t)(e0<<20))); + INSERT_WORDS(z, ix - ((int32_t)(e0<<20)), low); for(i=0;i<2;i++) { tx[i] = (double)((int32_t)(z)); z = (z-tx[i])*two24; Modified: projects/largeSMP/sbin/geom/class/part/geom_part.c ============================================================================== --- projects/largeSMP/sbin/geom/class/part/geom_part.c Tue Jun 21 08:39:09 2011 (r223361) +++ projects/largeSMP/sbin/geom/class/part/geom_part.c Tue Jun 21 09:09:53 2011 (r223362) @@ -362,7 +362,7 @@ gpart_autofill_resize(struct gctl_req *r goto done; } - offset = pp->lg_stripeoffset / pp->lg_sectorsize; + offset = (pp->lg_stripeoffset / pp->lg_sectorsize) % alignment; last = (off_t)strtoimax(find_geomcfg(gp, "last"), NULL, 0); LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { s = find_provcfg(pp, "index"); @@ -497,10 +497,10 @@ gpart_autofill(struct gctl_req *req) alignment = len; /* Adjust parameters to stripeoffset */ - offset = pp->lg_stripeoffset / pp->lg_sectorsize; + offset = (pp->lg_stripeoffset / pp->lg_sectorsize) % alignment; start = ALIGNUP(start + offset, alignment); - if (size + offset > alignment) - size = ALIGNDOWN(size + offset, alignment); + if (size > alignment) + size = ALIGNDOWN(size, alignment); first = (off_t)strtoimax(find_geomcfg(gp, "first"), NULL, 0); last = (off_t)strtoimax(find_geomcfg(gp, "last"), NULL, 0); Modified: projects/largeSMP/share/man/man5/rc.conf.5 ============================================================================== --- projects/largeSMP/share/man/man5/rc.conf.5 Tue Jun 21 08:39:09 2011 (r223361) +++ projects/largeSMP/share/man/man5/rc.conf.5 Tue Jun 21 09:09:53 2011 (r223362) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 18, 2011 +.Dd June 19, 2011 .Dt RC.CONF 5 .Os .Sh NAME @@ -4293,6 +4293,61 @@ Bus address of the USB Bluetooth control Check the output of .Xr usbconfig 8 on your system to find this information. +.It Va netwait_enable +.Pq Vt bool +If set to +.Dq Li YES , +delays the start of network-reliant services until +.Va netwait_if +is up and ICMP packets to a destination defined in +.Va netwait_ip +are flowing. +Link state is examined first, followed by +.Dq Li pinging +an IP address to verify network usability. +If no destination can be reached or timeouts are exceeded, +network services are started anyway with no guarantee that +the network is usable. +Use of this variable requires both +.Va netwait_ip +and +.Va netwait_if +to be set. +.It Va netwait_ip +.Pq Vt str +Empty by default. +This variable contains a space-delimited list of IP addresses to +.Xr ping 8 . +DNS hostnames should not be used as resolution is not guaranteed +to be functional at this point. +If multiple IP addresses are specified, +each will be tried until one is successful or the list is exhausted. +.It Va netwait_timeout +.Pq Vt int +Indicates the total number of seconds to perform a +.Dq Li ping +against each IP address in +.Va netwait_ip , +at a rate of one ping per second. +If any of the pings are successful, +full network connectivity is considered reliable. +The default is 60. +.It Va netwait_if +.Pq Vt str +Empty by default. +Defines the name of the network interface on which watch for link. +.Xr ifconfig 8 +is used to monitor the interface, looking for +.Dq Li status: no carrier . +Once gone, the link is considered up. +This can be a +.Xr vlan 4 +interface if desired. +.It Va netwait_if_timeout +.Pq Vt int +Defines the total number of seconds to wait for link to become usable, +polled at a 1-second interval. +The default is 30. .El .Sh FILES .Bl -tag -width ".Pa /etc/defaults/rc.conf" -compact @@ -4364,6 +4419,7 @@ on your system to find this information. .Xr ntpdate 8 , .Xr pfctl 8 , .Xr pflogd 8 , +.Xr ping 8 , .Xr powerd 8 , .Xr quotacheck 8 , .Xr quotaon 8 , Modified: projects/largeSMP/sys/conf/files.powerpc ============================================================================== --- projects/largeSMP/sys/conf/files.powerpc Tue Jun 21 08:39:09 2011 (r223361) +++ projects/largeSMP/sys/conf/files.powerpc Tue Jun 21 09:09:53 2011 (r223362) @@ -203,11 +203,13 @@ powerpc/powerpc/syncicache.c standard powerpc/powerpc/sys_machdep.c standard powerpc/powerpc/uio_machdep.c standard powerpc/ps3/ehci_ps3.c optional ps3 ehci +powerpc/ps3/ohci_ps3.c optional ps3 ohci powerpc/ps3/if_glc.c optional ps3 glc powerpc/ps3/mmu_ps3.c optional ps3 powerpc/ps3/platform_ps3.c optional ps3 powerpc/ps3/ps3ata.c optional ps3 ps3ata powerpc/ps3/ps3bus.c optional ps3 +powerpc/ps3/ps3disk.c optional ps3 powerpc/ps3/ps3pic.c optional ps3 powerpc/ps3/ps3_syscons.c optional ps3 sc powerpc/ps3/ps3-hvcall.S optional ps3 sc Modified: projects/largeSMP/sys/dev/atkbdc/atkbd.c ============================================================================== --- projects/largeSMP/sys/dev/atkbdc/atkbd.c Tue Jun 21 08:39:09 2011 (r223361) +++ projects/largeSMP/sys/dev/atkbdc/atkbd.c Tue Jun 21 09:09:53 2011 (r223362) @@ -1100,7 +1100,7 @@ get_typematic(keyboard_t *kbd) /* * Traditional entry points of int 0x15 and 0x16 are fixed * and later BIOSes follow them. (U)EFI CSM specification - * also mandate these fixed entry points. + * also mandates these fixed entry points. * * Validate the entry points here before we proceed further. * It's known that some recent laptops does not have the Modified: projects/largeSMP/sys/dev/e1000/if_igb.c ============================================================================== --- projects/largeSMP/sys/dev/e1000/if_igb.c Tue Jun 21 08:39:09 2011 (r223361) +++ projects/largeSMP/sys/dev/e1000/if_igb.c Tue Jun 21 09:09:53 2011 (r223362) @@ -36,6 +36,7 @@ #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_device_polling.h" #include "opt_inet.h" +#include "opt_inet6.h" #include "opt_altq.h" #endif @@ -99,7 +100,7 @@ int igb_display_debug_stats = 0; /********************************************************************* * Driver version: *********************************************************************/ -char igb_driver_version[] = "version - 2.2.3"; +char igb_driver_version[] = "version - 2.2.5"; /********************************************************************* @@ -265,6 +266,7 @@ static void igb_handle_link(void *contex static void igb_set_sysctl_value(struct adapter *, const char *, const char *, int *, int); static int igb_set_flowcntl(SYSCTL_HANDLER_ARGS); +static int igb_sysctl_dmac(SYSCTL_HANDLER_ARGS); #ifdef DEVICE_POLLING static poll_handler_t igb_poll; @@ -344,25 +346,6 @@ TUNABLE_INT("hw.igb.hdr_split", &igb_hea static int igb_num_queues = 0; TUNABLE_INT("hw.igb.num_queues", &igb_num_queues); -/* How many packets rxeof tries to clean at a time */ -static int igb_rx_process_limit = 100; -TUNABLE_INT("hw.igb.rx_process_limit", &igb_rx_process_limit); - -/* Flow control setting - default to FULL */ -static int igb_fc_setting = e1000_fc_full; -TUNABLE_INT("hw.igb.fc_setting", &igb_fc_setting); - -/* Energy Efficient Ethernet - default to off */ -static int igb_eee_disabled = TRUE; -TUNABLE_INT("hw.igb.eee_disabled", &igb_eee_disabled); - -/* -** DMA Coalescing, only for i350 - default to off, -** this feature is for power savings -*/ -static int igb_dma_coalesce = FALSE; -TUNABLE_INT("hw.igb.dma_coalesce", &igb_dma_coalesce); - /********************************************************************* * Device identification routine * @@ -433,6 +416,11 @@ igb_attach(device_t dev) INIT_DEBUGOUT("igb_attach: begin"); + if (resource_disabled("igb", device_get_unit(dev))) { + device_printf(dev, "Disabled by device hint\n"); + return (ENXIO); + } + adapter = device_get_softc(dev); adapter->dev = adapter->osdep.dev = dev; IGB_CORE_LOCK_INIT(adapter, device_get_nameunit(dev)); @@ -450,7 +438,7 @@ igb_attach(device_t dev) SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "flow_control", CTLTYPE_INT|CTLFLAG_RW, + OID_AUTO, "fc", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, igb_set_flowcntl, "I", "Flow Control"); callout_init_mtx(&adapter->timer, &adapter->core_mtx, 0); @@ -476,8 +464,8 @@ igb_attach(device_t dev) /* Sysctl for limiting the amount of work done in the taskqueue */ igb_set_sysctl_value(adapter, "rx_processing_limit", - "max number of rx packets to process", &adapter->rx_process_limit, - igb_rx_process_limit); + "max number of rx packets to process", + &adapter->rx_process_limit, 100); /* * Validate number of transmit and receive descriptors. It @@ -552,13 +540,14 @@ igb_attach(device_t dev) /* Some adapter-specific advanced features */ if (adapter->hw.mac.type >= e1000_i350) { - igb_set_sysctl_value(adapter, "dma_coalesce", - "configure dma coalesce", - &adapter->dma_coalesce, igb_dma_coalesce); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "dmac", CTLTYPE_INT|CTLFLAG_RW, + adapter, 0, igb_sysctl_dmac, "I", "DMA Coalesce"); igb_set_sysctl_value(adapter, "eee_disabled", "enable Energy Efficient Ethernet", &adapter->hw.dev_spec._82575.eee_disable, - igb_eee_disabled); + TRUE); e1000_set_eee_i350(&adapter->hw); } @@ -658,6 +647,7 @@ igb_attach(device_t dev) return (0); err_late: + igb_detach(dev); igb_free_transmit_structures(adapter); igb_free_receive_structures(adapter); igb_release_hw_control(adapter); @@ -736,7 +726,8 @@ igb_detach(device_t dev) igb_free_transmit_structures(adapter); igb_free_receive_structures(adapter); - free(adapter->mta, M_DEVBUF); + if (adapter->mta != NULL) + free(adapter->mta, M_DEVBUF); IGB_CORE_LOCK_DESTROY(adapter); @@ -1025,11 +1016,12 @@ static int igb_ioctl(struct ifnet *ifp, u_long command, caddr_t data) { struct adapter *adapter = ifp->if_softc; - struct ifreq *ifr = (struct ifreq *)data; -#ifdef INET - struct ifaddr *ifa = (struct ifaddr *)data; + struct ifreq *ifr = (struct ifreq *)data; +#if defined(INET) || defined(INET6) + struct ifaddr *ifa = (struct ifaddr *)data; + bool avoid_reset = FALSE; #endif - int error = 0; + int error = 0; if (adapter->in_detach) return (error); @@ -1037,20 +1029,22 @@ igb_ioctl(struct ifnet *ifp, u_long comm switch (command) { case SIOCSIFADDR: #ifdef INET - if (ifa->ifa_addr->sa_family == AF_INET) { - /* - * XXX - * Since resetting hardware takes a very long time - * and results in link renegotiation we only - * initialize the hardware only when it is absolutely - * required. - */ + if (ifa->ifa_addr->sa_family == AF_INET) + avoid_reset = TRUE; +#endif +#ifdef INET6 + if (ifa->ifa_addr->sa_family == AF_INET6) + avoid_reset = TRUE; +#endif +#if defined(INET) || defined(INET6) + /* + ** Calling init results in link renegotiation, + ** so we avoid doing it when possible. + */ + if (avoid_reset) { ifp->if_flags |= IFF_UP; - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { - IGB_CORE_LOCK(adapter); - igb_init_locked(adapter); - IGB_CORE_UNLOCK(adapter); - } + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) + igb_init(adapter); if (!(ifp->if_flags & IFF_NOARP)) arp_ifinit(ifp, ifa); } else @@ -1175,6 +1169,10 @@ igb_ioctl(struct ifnet *ifp, u_long comm ifp->if_capenable ^= IFCAP_VLAN_HWFILTER; reinit = 1; } + if (mask & IFCAP_VLAN_HWTSO) { + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; + reinit = 1; + } if (mask & IFCAP_LRO) { ifp->if_capenable ^= IFCAP_LRO; reinit = 1; @@ -2721,6 +2719,12 @@ igb_reset(struct adapter *adapter) fc->pause_time = IGB_FC_PAUSE_TIME; fc->send_xon = TRUE; + if (fc->requested_mode) + fc->current_mode = fc->requested_mode; + else + fc->current_mode = e1000_fc_full; + + adapter->fc = fc->current_mode; /* Issue a global reset */ e1000_reset_hw(hw); @@ -2730,9 +2734,13 @@ igb_reset(struct adapter *adapter) device_printf(dev, "Hardware Initialization Failed\n"); /* Setup DMA Coalescing */ - if ((hw->mac.type == e1000_i350) && - (adapter->dma_coalesce == TRUE)) { - u32 reg; + if (hw->mac.type == e1000_i350) { + u32 reg = ~E1000_DMACR_DMAC_EN; + + if (adapter->dmac == 0) { /* Disabling it */ + E1000_WRITE_REG(hw, E1000_DMACR, reg); + goto reset_out; + } hwm = (pba - 4) << 10; reg = (((pba-6) << E1000_DMACR_DMACTHR_SHIFT) @@ -2741,8 +2749,8 @@ igb_reset(struct adapter *adapter) /* transition to L0x or L1 if available..*/ reg |= (E1000_DMACR_DMAC_EN | E1000_DMACR_DMAC_LX_MASK); - /* timer = +-1000 usec in 32usec intervals */ - reg |= (1000 >> 5); + /* timer = value in adapter->dmac in 32usec intervals */ + reg |= (adapter->dmac >> 5); E1000_WRITE_REG(hw, E1000_DMACR, reg); /* No lower threshold */ @@ -2767,6 +2775,7 @@ igb_reset(struct adapter *adapter) device_printf(dev, "DMA Coalescing enabled\n"); } +reset_out: E1000_WRITE_REG(&adapter->hw, E1000_VET, ETHERTYPE_VLAN); e1000_get_phy_info(hw); e1000_check_for_link(hw); @@ -2827,15 +2836,19 @@ igb_setup_interface(device_t dev, struct * support full VLAN capability. */ ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); - ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; - ifp->if_capenable |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; + ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING + | IFCAP_VLAN_HWTSO + | IFCAP_VLAN_MTU; + ifp->if_capenable |= IFCAP_VLAN_HWTAGGING + | IFCAP_VLAN_HWTSO + | IFCAP_VLAN_MTU; /* - ** Dont turn this on by default, if vlans are + ** Don't turn this on by default, if vlans are ** created on another pseudo device (eg. lagg) ** then vlan events are not passed thru, breaking ** operation, but with HW FILTER off it works. If - ** using vlans directly on the em driver you can + ** using vlans directly on the igb driver you can ** enable this and get full hardware tag filtering. */ ifp->if_capabilities |= IFCAP_VLAN_HWFILTER; @@ -5595,19 +5608,18 @@ static int igb_set_flowcntl(SYSCTL_HANDLER_ARGS) { int error; - struct adapter *adapter; + struct adapter *adapter = (struct adapter *) arg1; - error = sysctl_handle_int(oidp, &igb_fc_setting, 0, req); + error = sysctl_handle_int(oidp, &adapter->fc, 0, req); - if (error) + if ((error) || (req->newptr == NULL)) return (error); - adapter = (struct adapter *) arg1; - switch (igb_fc_setting) { + switch (adapter->fc) { case e1000_fc_rx_pause: case e1000_fc_tx_pause: case e1000_fc_full: - adapter->hw.fc.requested_mode = igb_fc_setting; + adapter->hw.fc.requested_mode = adapter->fc; break; case e1000_fc_none: default: @@ -5616,5 +5628,54 @@ igb_set_flowcntl(SYSCTL_HANDLER_ARGS) adapter->hw.fc.current_mode = adapter->hw.fc.requested_mode; e1000_force_mac_fc(&adapter->hw); - return error; + return (error); +} + +/* +** Manage DMA Coalesce: +** Control values: +** 0/1 - off/on +** Legal timer values are: +** 250,500,1000-10000 in thousands +*/ +static int +igb_sysctl_dmac(SYSCTL_HANDLER_ARGS) +{ + struct adapter *adapter = (struct adapter *) arg1; + int error; + + error = sysctl_handle_int(oidp, &adapter->dmac, 0, req); + + if ((error) || (req->newptr == NULL)) + return (error); + + switch (adapter->dmac) { + case 0: + /*Disabling */ + break; + case 1: /* Just enable and use default */ + adapter->dmac = 1000; + break; + case 250: + case 500: + case 1000: + case 2000: + case 3000: + case 4000: + case 5000: + case 6000: + case 7000: + case 8000: + case 9000: + case 10000: + /* Legal values - allow */ + break; + default: + /* Do nothing, illegal value */ + adapter->dmac = 0; + return (error); + } + /* Reinit the interface */ + igb_init(adapter); + return (error); } Modified: projects/largeSMP/sys/dev/e1000/if_igb.h ============================================================================== --- projects/largeSMP/sys/dev/e1000/if_igb.h Tue Jun 21 08:39:09 2011 (r223361) +++ projects/largeSMP/sys/dev/e1000/if_igb.h Tue Jun 21 09:09:53 2011 (r223362) @@ -396,11 +396,12 @@ struct adapter { u32 shadow_vfta[IGB_VFTA_SIZE]; /* Info about the interface */ - u8 link_active; + u16 link_active; + u16 fc; u16 link_speed; u16 link_duplex; u32 smartspeed; - u32 dma_coalesce; + u32 dmac; /* Interface queues */ struct igb_queue *queues; Modified: projects/largeSMP/sys/dev/firewire/fwohci.c ============================================================================== --- projects/largeSMP/sys/dev/firewire/fwohci.c Tue Jun 21 08:39:09 2011 (r223361) +++ projects/largeSMP/sys/dev/firewire/fwohci.c Tue Jun 21 09:09:53 2011 (r223362) @@ -2072,8 +2072,9 @@ fwohci_check_stat(struct fwohci_softc *s FW_GLOCK_ASSERT(&sc->fc); stat = OREAD(sc, FWOHCI_INTSTAT); if (stat == 0xffffffff) { - device_printf(sc->fc.dev, - "device physically ejected?\n"); + if (!bus_child_present(sc->fc.dev)) + return (FILTER_HANDLED); + device_printf(sc->fc.dev, "device physically ejected?\n"); return (FILTER_STRAY); } if (stat) Modified: projects/largeSMP/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- projects/largeSMP/sys/dev/pccbb/pccbb_pci.c Tue Jun 21 08:39:09 2011 (r223361) +++ projects/largeSMP/sys/dev/pccbb/pccbb_pci.c Tue Jun 21 09:09:53 2011 (r223362) @@ -658,6 +658,12 @@ cbb_pci_shutdown(device_t brdev) struct cbb_softc *sc = (struct cbb_softc *)device_get_softc(brdev); /* + * We're about to pull the rug out from the card, so mark it as + * gone to prevent harm. + */ + sc->cardok = 0; + + /* * Place the cards in reset, turn off the interrupts and power * down the socket. */ Modified: projects/largeSMP/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- projects/largeSMP/sys/fs/nfs/nfs_commonkrpc.c Tue Jun 21 08:39:09 2011 (r223361) +++ projects/largeSMP/sys/fs/nfs/nfs_commonkrpc.c Tue Jun 21 09:09:53 2011 (r223362) @@ -323,9 +323,7 @@ newnfs_disconnect(struct nfssockreq *nrp client = nrp->nr_client; nrp->nr_client = NULL; mtx_unlock(&nrp->nr_mtx); -#ifdef KGSSAPI - rpc_gss_secpurge(client); -#endif + rpc_gss_secpurge_call(client); CLNT_CLOSE(client); CLNT_RELEASE(client); } else { @@ -337,21 +335,18 @@ static AUTH * nfs_getauth(struct nfssockreq *nrp, int secflavour, char *clnt_principal, char *srv_principal, gss_OID mech_oid, struct ucred *cred) { -#ifdef KGSSAPI rpc_gss_service_t svc; AUTH *auth; #ifdef notyet rpc_gss_options_req_t req_options; #endif -#endif switch (secflavour) { -#ifdef KGSSAPI case RPCSEC_GSS_KRB5: case RPCSEC_GSS_KRB5I: case RPCSEC_GSS_KRB5P: if (!mech_oid) { - if (!rpc_gss_mech_to_oid("kerberosv5", &mech_oid)) + if (!rpc_gss_mech_to_oid_call("kerberosv5", &mech_oid)) return (NULL); } if (secflavour == RPCSEC_GSS_KRB5) @@ -367,7 +362,7 @@ nfs_getauth(struct nfssockreq *nrp, int req_options.input_channel_bindings = NULL; req_options.enc_type = nfs_keytab_enctype; - auth = rpc_gss_secfind(nrp->nr_client, cred, + auth = rpc_gss_secfind_call(nrp->nr_client, cred, clnt_principal, srv_principal, mech_oid, svc, &req_options); #else @@ -377,7 +372,7 @@ nfs_getauth(struct nfssockreq *nrp, int * principals. As such, that case cannot yet be handled. */ if (clnt_principal == NULL) - auth = rpc_gss_secfind(nrp->nr_client, cred, + auth = rpc_gss_secfind_call(nrp->nr_client, cred, srv_principal, mech_oid, svc); else auth = NULL; @@ -385,7 +380,6 @@ nfs_getauth(struct nfssockreq *nrp, int if (auth != NULL) return (auth); /* fallthrough */ -#endif /* KGSSAPI */ case AUTH_SYS: default: return (authunix_create(cred)); Modified: projects/largeSMP/sys/fs/nfsclient/nfs_clkrpc.c ============================================================================== --- projects/largeSMP/sys/fs/nfsclient/nfs_clkrpc.c Tue Jun 21 08:39:09 2011 (r223361) +++ projects/largeSMP/sys/fs/nfsclient/nfs_clkrpc.c Tue Jun 21 09:09:53 2011 (r223362) @@ -215,12 +215,9 @@ nfscbd_addsock(struct file *fp) int nfscbd_nfsd(struct thread *td, struct nfsd_nfscbd_args *args) { -#ifdef KGSSAPI char principal[128]; int error; -#endif -#ifdef KGSSAPI if (args != NULL) { error = copyinstr(args->principal, principal, sizeof(principal), NULL); @@ -229,7 +226,6 @@ nfscbd_nfsd(struct thread *td, struct nf } else { principal[0] = '\0'; } -#endif /* * Only the first nfsd actually does any work. The RPC code @@ -244,20 +240,16 @@ nfscbd_nfsd(struct thread *td, struct nf NFSD_UNLOCK(); -#ifdef KGSSAPI if (principal[0] != '\0') - rpc_gss_set_svc_name(principal, "kerberosv5", + rpc_gss_set_svc_name_call(principal, "kerberosv5", GSS_C_INDEFINITE, NFS_CALLBCKPROG, NFSV4_CBVERS); -#endif nfscbd_pool->sp_minthreads = 4; nfscbd_pool->sp_maxthreads = 4; svc_run(nfscbd_pool); -#ifdef KGSSAPI - rpc_gss_clear_svc_name(NFS_CALLBCKPROG, NFSV4_CBVERS); -#endif + rpc_gss_clear_svc_name_call(NFS_CALLBCKPROG, NFSV4_CBVERS); NFSD_LOCK(); nfs_numnfscbd--; Modified: projects/largeSMP/sys/fs/nfsserver/nfs_nfsdcache.c ============================================================================== --- projects/largeSMP/sys/fs/nfsserver/nfs_nfsdcache.c Tue Jun 21 08:39:09 2011 (r223361) +++ projects/largeSMP/sys/fs/nfsserver/nfs_nfsdcache.c Tue Jun 21 09:09:53 2011 (r223362) @@ -405,6 +405,7 @@ nfsrvd_updatecache(struct nfsrv_descript { struct nfsrvcache *rp; struct nfsrvcache *retrp = NULL; + mbuf_t m; rp = nd->nd_rp; if (!rp) @@ -457,9 +458,9 @@ nfsrvd_updatecache(struct nfsrv_descript } if ((nd->nd_flag & ND_NFSV2) && nfsv2_repstat[newnfsv2_procid[nd->nd_procnum]]) { - NFSUNLOCKCACHE(); rp->rc_status = nd->nd_repstat; rp->rc_flag |= RC_REPSTATUS; + NFSUNLOCKCACHE(); } else { if (!(rp->rc_flag & RC_UDP)) { nfsrc_tcpsavedreplies++; @@ -469,9 +470,11 @@ nfsrvd_updatecache(struct nfsrv_descript nfsrc_tcpsavedreplies; } NFSUNLOCKCACHE(); - rp->rc_reply = m_copym(nd->nd_mreq, 0, M_COPYALL, - M_WAIT); + m = m_copym(nd->nd_mreq, 0, M_COPYALL, M_WAIT); + NFSLOCKCACHE(); + rp->rc_reply = m; rp->rc_flag |= RC_REPMBUF; + NFSUNLOCKCACHE(); } if (rp->rc_flag & RC_UDP) { rp->rc_timestamp = NFSD_MONOSEC + @@ -518,6 +521,7 @@ nfsrvd_delcache(struct nfsrvcache *rp) APPLESTATIC void nfsrvd_sentcache(struct nfsrvcache *rp, struct socket *so, int err) { + tcp_seq tmp_seq; if (!(rp->rc_flag & RC_LOCKED)) panic("nfsrvd_sentcache not locked"); @@ -526,8 +530,12 @@ nfsrvd_sentcache(struct nfsrvcache *rp, so->so_proto->pr_domain->dom_family != AF_INET6) || so->so_proto->pr_protocol != IPPROTO_TCP) panic("nfs sent cache"); - if (nfsrv_getsockseqnum(so, &rp->rc_tcpseq)) + if (nfsrv_getsockseqnum(so, &tmp_seq)) { + NFSLOCKCACHE(); + rp->rc_tcpseq = tmp_seq; rp->rc_flag |= RC_TCPSEQ; + NFSUNLOCKCACHE(); + } } nfsrc_unlock(rp); } @@ -687,8 +695,11 @@ nfsrc_lock(struct nfsrvcache *rp) static void nfsrc_unlock(struct nfsrvcache *rp) { + + NFSLOCKCACHE(); rp->rc_flag &= ~RC_LOCKED; nfsrc_wanted(rp); + NFSUNLOCKCACHE(); } /* Modified: projects/largeSMP/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- projects/largeSMP/sys/fs/nfsserver/nfs_nfsdkrpc.c Tue Jun 21 08:39:09 2011 (r223361) +++ projects/largeSMP/sys/fs/nfsserver/nfs_nfsdkrpc.c Tue Jun 21 09:09:53 2011 (r223362) @@ -386,18 +386,14 @@ nfsrvd_addsock(struct file *fp) int nfsrvd_nfsd(struct thread *td, struct nfsd_nfsd_args *args) { -#ifdef KGSSAPI char principal[MAXHOSTNAMELEN + 5]; int error; bool_t ret2, ret3, ret4; -#endif -#ifdef KGSSAPI error = copyinstr(args->principal, principal, sizeof (principal), NULL); if (error) return (error); -#endif /* * Only the first nfsd actually does any work. The RPC code @@ -412,38 +408,29 @@ nfsrvd_nfsd(struct thread *td, struct nf NFSD_UNLOCK(); -#ifdef KGSSAPI /* An empty string implies AUTH_SYS only. */ if (principal[0] != '\0') { - ret2 = rpc_gss_set_svc_name(principal, "kerberosv5", - GSS_C_INDEFINITE, NFS_PROG, NFS_VER2); - ret3 = rpc_gss_set_svc_name(principal, "kerberosv5", - GSS_C_INDEFINITE, NFS_PROG, NFS_VER3); - ret4 = rpc_gss_set_svc_name(principal, "kerberosv5", - GSS_C_INDEFINITE, NFS_PROG, NFS_VER4); - - if (!ret2 || !ret3 || !ret4) { - NFSD_LOCK(); - newnfs_numnfsd--; - nfsrvd_init(1); - NFSD_UNLOCK(); - return (EAUTH); - } + ret2 = rpc_gss_set_svc_name_call(principal, + "kerberosv5", GSS_C_INDEFINITE, NFS_PROG, NFS_VER2); + ret3 = rpc_gss_set_svc_name_call(principal, + "kerberosv5", GSS_C_INDEFINITE, NFS_PROG, NFS_VER3); + ret4 = rpc_gss_set_svc_name_call(principal, + "kerberosv5", GSS_C_INDEFINITE, NFS_PROG, NFS_VER4); + + if (!ret2 || !ret3 || !ret4) + printf("nfsd: can't register svc name\n"); } -#endif nfsrvd_pool->sp_minthreads = args->minthreads; nfsrvd_pool->sp_maxthreads = args->maxthreads; svc_run(nfsrvd_pool); -#ifdef KGSSAPI if (principal[0] != '\0') { - rpc_gss_clear_svc_name(NFS_PROG, NFS_VER2); - rpc_gss_clear_svc_name(NFS_PROG, NFS_VER3); - rpc_gss_clear_svc_name(NFS_PROG, NFS_VER4); + rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER2); + rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER3); + rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER4); } -#endif NFSD_LOCK(); newnfs_numnfsd--; Modified: projects/largeSMP/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- projects/largeSMP/sys/fs/nfsserver/nfs_nfsdserv.c Tue Jun 21 08:39:09 2011 (r223361) +++ projects/largeSMP/sys/fs/nfsserver/nfs_nfsdserv.c Tue Jun 21 09:09:53 2011 (r223362) @@ -454,7 +454,7 @@ nfsmout: APPLESTATIC int nfsrvd_lookup(struct nfsrv_descript *nd, __unused int isdgram, vnode_t dp, vnode_t *vpp, fhandle_t *fhp, NFSPROC_T *p, - __unused struct nfsexstuff *exp) + struct nfsexstuff *exp) { struct nameidata named; vnode_t vp, dirp = NULL; @@ -508,7 +508,15 @@ nfsrvd_lookup(struct nfsrv_descript *nd, vrele(named.ni_startdir); nfsvno_relpathbuf(&named); vp = named.ni_vp; - nd->nd_repstat = nfsvno_getfh(vp, fhp, p); + if ((nd->nd_flag & ND_NFSV4) != 0 && !NFSVNO_EXPORTED(exp) && *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Tue Jun 21 09:19:38 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A74081065672; Tue, 21 Jun 2011 09:19:38 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 971F08FC1A; Tue, 21 Jun 2011 09:19:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5L9JcMl089631; Tue, 21 Jun 2011 09:19:38 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5L9JcXC089626; Tue, 21 Jun 2011 09:19:38 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201106210919.p5L9JcXC089626@svn.freebsd.org> From: Attilio Rao Date: Tue, 21 Jun 2011 09:19:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223363 - in projects/largeSMP/sys/amd64: acpica amd64 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 09:19:38 -0000 Author: attilio Date: Tue Jun 21 09:19:38 2011 New Revision: 223363 URL: http://svn.freebsd.org/changeset/base/223363 Log: Remove the usage of pc_other_cpus from amd64. Tested by: pluknet Modified: projects/largeSMP/sys/amd64/acpica/acpi_wakeup.c projects/largeSMP/sys/amd64/amd64/mp_machdep.c projects/largeSMP/sys/amd64/amd64/pmap.c projects/largeSMP/sys/amd64/amd64/vm_machdep.c Modified: projects/largeSMP/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- projects/largeSMP/sys/amd64/acpica/acpi_wakeup.c Tue Jun 21 09:09:53 2011 (r223362) +++ projects/largeSMP/sys/amd64/acpica/acpi_wakeup.c Tue Jun 21 09:19:38 2011 (r223363) @@ -226,7 +226,8 @@ acpi_sleep_machdep(struct acpi_softc *sc return (ret); #ifdef SMP - wakeup_cpus = PCPU_GET(other_cpus); + wakeup_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &wakeup_cpus); #endif AcpiSetFirmwareWakingVector(WAKECODE_PADDR(sc)); Modified: projects/largeSMP/sys/amd64/amd64/mp_machdep.c ============================================================================== --- projects/largeSMP/sys/amd64/amd64/mp_machdep.c Tue Jun 21 09:09:53 2011 (r223362) +++ projects/largeSMP/sys/amd64/amd64/mp_machdep.c Tue Jun 21 09:19:38 2011 (r223363) @@ -604,7 +604,7 @@ cpu_mp_announce(void) void init_secondary(void) { - cpuset_t tcpuset, tallcpus; + cpuset_t tcpuset; struct pcpu *pc; struct nmi_pcpu *np; u_int64_t msr, cr0; @@ -743,11 +743,6 @@ init_secondary(void) if (cpu_logical > 1 && PCPU_GET(apic_id) % cpu_logical != 0) CPU_OR(&logical_cpus_mask, &tcpuset); - /* Build our map of 'other' CPUs. */ - tallcpus = all_cpus; - CPU_NAND(&tallcpus, &tcpuset); - PCPU_SET(other_cpus, tallcpus); - if (bootverbose) lapic_dump("AP"); @@ -893,7 +888,6 @@ assign_cpu_ids(void) static int start_all_aps(void) { - cpuset_t tallcpus, tcpuset; vm_offset_t va = boot_address + KERNBASE; u_int64_t *pt4, *pt3, *pt2; u_int32_t mpbioswarmvec; @@ -961,12 +955,6 @@ start_all_aps(void) CPU_SET(cpu, &all_cpus); /* record AP in CPU map */ } - /* build our map of 'other' CPUs */ - tallcpus = all_cpus; - tcpuset = PCPU_GET(cpumask); - CPU_NAND(&tallcpus, &tcpuset); - PCPU_SET(other_cpus, tallcpus); - /* restore the warmstart vector */ *(u_int32_t *) WARMBOOT_OFF = mpbioswarmvec; @@ -1349,11 +1337,13 @@ ipi_cpu(int cpu, u_int ipi) void ipi_all_but_self(u_int ipi) { + cpuset_t other_cpus; + + other_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); - sched_pin(); if (IPI_IS_BITMAPED(ipi)) { - ipi_selected(PCPU_GET(other_cpus), ipi); - sched_unpin(); + ipi_selected(other_cpus, ipi); return; } @@ -1363,8 +1353,7 @@ ipi_all_but_self(u_int ipi) * Set the mask of receiving CPUs for this purpose. */ if (ipi == IPI_STOP_HARD) - CPU_OR_ATOMIC(&ipi_nmi_pending, PCPU_PTR(other_cpus)); - sched_unpin(); + CPU_OR_ATOMIC(&ipi_nmi_pending, &other_cpus); CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); lapic_ipi_vectored(ipi, APIC_IPI_DEST_OTHERS); Modified: projects/largeSMP/sys/amd64/amd64/pmap.c ============================================================================== --- projects/largeSMP/sys/amd64/amd64/pmap.c Tue Jun 21 09:09:53 2011 (r223362) +++ projects/largeSMP/sys/amd64/amd64/pmap.c Tue Jun 21 09:19:38 2011 (r223363) @@ -933,7 +933,8 @@ pmap_invalidate_page(pmap_t pmap, vm_off smp_invlpg(va); } else { cpumask = PCPU_GET(cpumask); - other_cpus = PCPU_GET(other_cpus); + other_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); if (CPU_OVERLAP(&pmap->pm_active, &cpumask)) invlpg(va); CPU_AND(&other_cpus, &pmap->pm_active); @@ -956,7 +957,8 @@ pmap_invalidate_range(pmap_t pmap, vm_of smp_invlpg_range(sva, eva); } else { cpumask = PCPU_GET(cpumask); - other_cpus = PCPU_GET(other_cpus); + other_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); if (CPU_OVERLAP(&pmap->pm_active, &cpumask)) for (addr = sva; addr < eva; addr += PAGE_SIZE) invlpg(addr); @@ -978,7 +980,8 @@ pmap_invalidate_all(pmap_t pmap) smp_invltlb(); } else { cpumask = PCPU_GET(cpumask); - other_cpus = PCPU_GET(other_cpus); + other_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); if (CPU_OVERLAP(&pmap->pm_active, &cpumask)) invltlb(); CPU_AND(&other_cpus, &pmap->pm_active); @@ -1048,7 +1051,8 @@ pmap_update_pde(pmap_t pmap, vm_offset_t sched_pin(); cpumask = PCPU_GET(cpumask); - other_cpus = PCPU_GET(other_cpus); + other_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); if (pmap == kernel_pmap) active = all_cpus; else Modified: projects/largeSMP/sys/amd64/amd64/vm_machdep.c ============================================================================== --- projects/largeSMP/sys/amd64/amd64/vm_machdep.c Tue Jun 21 09:09:53 2011 (r223362) +++ projects/largeSMP/sys/amd64/amd64/vm_machdep.c Tue Jun 21 09:19:38 2011 (r223363) @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -535,8 +534,8 @@ cpu_reset() u_int cnt; if (smp_active) { - sched_pin(); - map = PCPU_GET(other_cpus); + map = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &map); CPU_NAND(&map, &stopped_cpus); if (!CPU_EMPTY(&map)) { printf("cpu_reset: Stopping other CPUs\n"); @@ -545,7 +544,6 @@ cpu_reset() if (PCPU_GET(cpuid) != 0) { cpu_reset_proxyid = PCPU_GET(cpuid); - sched_unpin(); cpustop_restartfunc = cpu_reset_proxy; cpu_reset_proxy_active = 0; printf("cpu_reset: Restarting BSP\n"); @@ -564,8 +562,7 @@ cpu_reset() while (1); /* NOTREACHED */ - } else - sched_unpin(); + } DELAY(1000000); } From owner-svn-src-projects@FreeBSD.ORG Tue Jun 21 14:31:37 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A5F8106566B; Tue, 21 Jun 2011 14:31:37 +0000 (UTC) (envelope-from flz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 47C328FC14; Tue, 21 Jun 2011 14:31:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5LEVbhb004723; Tue, 21 Jun 2011 14:31:37 GMT (envelope-from flz@svn.freebsd.org) Received: (from flz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LEVbje004718; Tue, 21 Jun 2011 14:31:37 GMT (envelope-from flz@svn.freebsd.org) Message-Id: <201106211431.p5LEVbje004718@svn.freebsd.org> From: Florent Thoumie Date: Tue, 21 Jun 2011 14:31:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223366 - in projects/portbuild: conf errorlogs scripts www www/js X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 14:31:37 -0000 Author: flz Date: Tue Jun 21 14:31:36 2011 New Revision: 223366 URL: http://svn.freebsd.org/changeset/base/223366 Log: Cleanup www configuration and static files. - Add apache configuration. - Add static files. - Add js/sorttable.js to generate sortable tables and adjust processlogs. Added: projects/portbuild/conf/apache.conf projects/portbuild/errorlogs/index.html (contents, props changed) projects/portbuild/www/ projects/portbuild/www/favicon.ico (contents, props changed) projects/portbuild/www/index.html - copied unchanged from r222445, projects/portbuild/errorlogs/index.shtml projects/portbuild/www/js/ projects/portbuild/www/js/sorttable.js projects/portbuild/www/robots.txt Deleted: projects/portbuild/errorlogs/index.shtml Modified: projects/portbuild/scripts/processlogs Added: projects/portbuild/conf/apache.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/portbuild/conf/apache.conf Tue Jun 21 14:31:36 2011 (r223366) @@ -0,0 +1,43 @@ +DocumentRoot "/var/portbuild/www" + +# filter magic to decompress bzip2 logs - pav@ +LoadModule ext_filter_module libexec/apache22/mod_ext_filter.so +LoadModule php5_module libexec/apache22/libphp5.so +ExtFilterDefine BUNZIP2 mode=output intype=application/x-bzip2 outtype=text/plain cmd=/usr/bin/bunzip2 + + + Order allow,deny + Allow from all + Options FollowSymLinks + AllowOverride None + #Redirect permanent /index.html http://pointyhat-west.isc.freebsd.org/errorlogs/ + + +Alias /errorlogs/ /var/portbuild/errorlogs/ + + + Order allow,deny + Allow from all + Options FollowSymLinks +# Added kk 030222 + Options +IncludesNoExec + AddHandler server-parsed .shtml + DirectoryIndex index.shtml index.html +# filter magic to decompress bzip2 logs - pav@ + Options +MultiViews + AddOutputFilterByType BUNZIP2 application/x-bzip2 + + +Alias /ganglia/ "/usr/local/www/ganglia/" + + + Order allow,deny + Allow from all + Options Indexes FollowSymlinks MultiViews + AllowOverride None + AddType text/html php + #AddType application/x-httpd-php .php + #AddType application/x-httpd-php-source .phps + addhandler php5-script .php + DirectoryIndex index.php + Added: projects/portbuild/errorlogs/index.html ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/portbuild/errorlogs/index.html Tue Jun 21 14:31:36 2011 (r223366) @@ -0,0 +1 @@ +link ../www/index.html \ No newline at end of file Modified: projects/portbuild/scripts/processlogs ============================================================================== --- projects/portbuild/scripts/processlogs Tue Jun 21 12:38:40 2011 (r223365) +++ projects/portbuild/scripts/processlogs Tue Jun 21 14:31:36 2011 (r223366) @@ -121,6 +121,7 @@ fi header() { echo "Package building errors" >$of + echo "" >>$of echo "

Package building errors

" >>$of echo "

View by " >>$of echo "[ port " >>$of @@ -141,7 +142,7 @@ header() { echo "\"Aff.\" is number of ports that depend on this one
" >> $of echo "\"[B]\" indicates port is marked BROKEN (Note: BROKEN ports are not frequently rebuilt so they may not be listed here)

" >> $of echo "

${n_logs} errors

" >> $of - echo "" >>$of + echo "
" >>$of echo "$1" >>$of fi } Added: projects/portbuild/www/favicon.ico ============================================================================== Binary file. No diff available. Copied: projects/portbuild/www/index.html (from r222445, projects/portbuild/errorlogs/index.shtml) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/portbuild/www/index.html Tue Jun 21 14:31:36 2011 (r223366, copy of r222445, projects/portbuild/errorlogs/index.shtml) @@ -0,0 +1,984 @@ + + + + +FreeBSD Package building logs and errors + + +

FreeBSD Package building logs and errors

+ +

FreeBSD maintains a build farm (the "pointyhat cluster") that is used +to build all packages across all supported architectures and major releases. +This page contains the build logs and errors for all the ports built by +the cluster. See the notes for additional information, +or the types of package errors detected.

+ +

+Port cross-reference summaries +

+

These live on +portsmon.FreeBSD.org.

+
+ +
* Build errors +by portname; +by portname vs. build environment; +by error type vs. build environment
+
* Problem Reports +for existing ports; +for new ports; +for the ports framework; +for repocopies requested; +for unknown
+
* Build Errors and +Problem Reports +by portname; +for one maintainer; +for broken ports; +for deprecated ports; +for forbidden ports
+
* Everything about +one port
+
* The +complete list of all reports
+
+ +

+New build failures +

+

Check here to find the most recent error log from your port.

+ + + +
+
+* New build +failures on 7.x-stable: +amd64 +i386 +ia64 +sparc64 +
+* New build +failures on 8.x-stable: +amd64 +i386 +ia64 +powerpc +sparc64 +
+* New build +failures on 9.x-current: +amd64 +i386 +ia64 +powerpc +sparc64 +
+
+* New build failures on 7.x-stable with experimental port patches: +amd64 +i386 +
+* New build failures on 8.x-stable with experimental port patches: +amd64 +i386 +
+* New build failures on 9.x-current with experimental port patches: +amd64 +i386 +
+
+
+ +

+Error logs +

+ +
+
+* Previous run +on 7.x-stable: +amd64 +i386 +ia64 +sparc64 +
+* Current run +on 7.x-stable: +amd64 +i386 +ia64 +sparc64 +
+* Previous run +on 8.x-stable: +amd64 +i386 +ia64 +powerpc +sparc64 +
+* Current run +on 8.x-stable: +amd64 +i386 +ia64 +powerpc +sparc64 +
+* Previous run +on 9.x-current: +amd64 +i386 +ia64 +powerpc +sparc64 +
+* Current run +on 9.x-current: +amd64 +i386 +ia64 +powerpc +sparc64 +
+
+* Previous run +on 7.x-stable with experimental port patches: +amd64 +i386 +
+* Current run +on 7.x-stable with experimental port patches: +amd64 +i386 +
+* Previous run +on 8.x-stable with experimental port patches: +amd64 +i386 +
+* Current run +on 8.x-stable with experimental port patches: +amd64 +i386 +
+* Previous run +on 9.x-current with experimental port patches: +amd64 +i386 +
+* Current run +on 9.x-current with experimental port patches: +amd64 +i386 +
+
+ +

+Build logs (errors and otherwise) +

+ +
+
+*Previous run +on 7.x-stable: +amd64 +i386 +ia64 +sparc64 +
+*Current run on +7.x-stable: +amd64 +i386 +ia64 +sparc64 +
+*Previous run +on 8.x-stable: +amd64 +i386 +ia64 +powerpc +sparc64 +
+*Current run on +8.x-stable: +amd64 +i386 +ia64 +powerpc +sparc64 +
+*Previous run +on 9.x-current: +amd64 +i386 +ia64 +powerpc +sparc64 +
+*Current run on +9.x-current: +amd64 +i386 +ia64 +powerpc +sparc64 +
+
+*Previous run +on 7.x-stable with experimental port patches: +amd64 +i386 +
+*Current run on +7.x-stable with experimental port patches: +amd64 +i386 +
+*Previous run +on 8.x-stable with experimental port patches: +amd64 +i386 +
+*Current run on +8.x-stable with experimental port patches: +amd64 +i386 +
+*Previous run +on 9.x-current with experimental port patches: +amd64 +i386 +
+*Current run on +9.x-current with experimental port patches: +amd64 +i386 +
+
+
+ +

+Packages +

+ +
+
+* Packages from +latest run on 6-stable: +amd64 +i386 +sparc64 +
+* Packages from +latest run on 7-stable: +amd64 +i386 +ia64 +sparc64 +
+* Packages from +latest run on 8-stable: +amd64 +i386 +ia64 +powerpc +sparc64 +
+* Packages from +latest run on 9-current: +amd64 +i386 +ia64 +powerpc +sparc64 +
+
+* Package +building statistics (current state of all package builds) +
+
+ +

+Archive +

+ +
+
* All error +logs: +amd64 +i386 +ia64 +powerpc +sparc64 +
+* All portbuild +logs: +amd64 +i386 +ia64 +powerpc +sparc64 +
+
+ + +

Additional information

+
+ +

All of the "Current run" links are possibly in progress and may be +partial, so keep that in mind if there appear to be some missing.

+ +

None of the ports marked IS_INTERACTIVE or +NO_PACKAGE are built any more -- if you have ports that +fall into those categories, assume their packages or distfiles will +never show up in ftp sites or CDROMs. RESTRICTED packages +are built and deleted (using "make +clean-restricted-list"). NO_CDROM packages are built +but deleted (using "make clean-cdrom-list") before being +put on a CDROM.

+ +

See also the types of errors detected.

+ +

Notes on the building process:

+ +
    +
  • Every port is built in its own chroot environment + +, starting with an +empty /usr/local and /usr/X11R6. The dependencies are installed as packages just before +the build. You can see the list of dependencies on the third line +of the log -- the "foo.tgz bar.tgz" stuff are the dependencies. To +make sure that these actually work, DEPENDS_TARGET is set +to "/usr/bin/true"; if you see "/usr/bin/true is up to date" or +some such, that means there is something wrong with the dependency +lines or the packages this port is depending on.
  • + +
  • The build is done on a shared (read-only) /usr/ports +with +WRKDIRPREFIX set to /work. If your +WRKSRC looks funny, that's probably why.
  • + +
  • MASTER_SITE_OVERRIDE is pointing to pointyhat's distfile +dir, and MASTER_SITE_BACKUP is pointing to +ftp-master.freebsd.org or a local mirror. +Please pay attention to + +Emanuel Haupt's distfile checker +for that.
  • + +
  • The ports are built on machines that are mostly running + 9-CURRENT, with some 8.x-STABLE machines. If your port depends on + the result of uname(3) or sysctl to determine the running version of + FreeBSD, change it to use uname(1) instead (the builds use a dummy + uname(1) that reports the target version of FreeBSD), or change it to + use the value of the OSVERSION variable that can be passed in from + the port makefile.
+ + +

Types of package errors detected

+ +

Here is the alphabetical list of current errors +detected by the AI script. Note that this is all just a rough guess -- +it is merely for your aid.

+ +

Key: +

+
(common)The most common + errors.
+
(uncommon)Some less common + errors.
+
(transient)Transient + errors. These may not be your fault.
+
+

+ +

+

+
(common)arch
+ +
The port does not build on a particular architecture, due to +assembler or linker errors. In some easy cases this is due to +not picking up the various ARCH configuration variables +in the Makefile; you'll see this via, e.g., a Sparc make +failing while looking for an i386 subdirectory. For the 64-bit +architectures, a common problem is the assumption many programmers +make that pointers may be cast to and from 32-bit ints. In other cases +the problems run much deeper, in which case ONLY_FOR_ARCHS +may be needed.
+ +
(uncommon)autoconf
+ +
Your port depends on autoconf, but the Makefile +either doesn't have USE_AUTOCONF, or does not use +USE_AUTOCONF_VER correctly.
+ +
(uncommon)autoheader
+ +
Your port depends on autoheader, but the Makefile +cannot find it; set USE_AUTOHEADER.
+ +
(uncommon)automake
+ +
Your port depends on automake, but the Makefile +either doesn't have USE_AUTOMAKE, or does not use +USE_AUTOMAKE_VER correctly.
+ +
(common)bad C++ code
+ +
There is a compiler error which is caused by something specific +to C++.
+ +
(common)compiler error
+ +
There is a C compiler error which is caused by something other +than e.g. "new compiler error".
+ +
(uncommon)CATEGORIES
+ +
The CATEGORIES line in Makefile includes an +invalid category.
+ +
(common)checksum
+ +
The checksum of one or more of the files is incorrect.
+ +
(common)clang
+ +
Your code does not run with the the experimental clang compiler. See +(TBA) +for further information.
+ +
(uncommon)clang bug
+ +
You have tickled a bug in clang itself. See +(TBA) +for further information.
+ +
(transient)cluster
+ +
There was some kind of transient error on the build cluster. It is not your +fault.
+ +
(uncommon)compat6x
+ +
This port needs to depend on a port misc/compat6x.
+ +
(common)configure error
+ +
The port's configure script produced some kind of +error. +(Note: using clang as the ports compiler can also trigger this message.)
+ +
(common)coredump
+ +
Some process in the build chain dropped core. While your port may indeed +be faulty, the process that dropped core should also be fixed.
+ +
(uncommon)cpusetsize
+ +
This port needs to catch up with the cpusetsize sysctl change in 9-CURRENT.
+ +
(common)depend object
+ +
The port is trying to reinstall a dependency that already +exists. This is usually caused by the first field of a +*_DEPENDS line (the obj of +obj:dir[:target]) indicating a file that is not installed +by the dependency, causing it to be rebuilt even though it has +already been added from a package.
+ +
(common)depend package
+ +
There was an error during adding dependencies +from packages. It is the fault of the package being added, not +this port.
+ +
(uncommon)dirent
+ +
The port has not caught up with the change to scandir(3) +as committed in FreeBSD version 800501.
+ +
(transient)disk full
+ +
The disk filled up on the build system. It is not your +fault.
+ +
(uncommon)DISPLAY
+ +
This port requires an X display to build. There is nothing you +can do about it unless you can somehow make it not require an X +connection.
+ +
(common)distinfo update
+ +
The contents of distinfo does not match the list of +distfiles or patchfiles.
+ +
(common)fetch
+ +
One or more of the files could not be fetched.
+ +
(uncommon)fetch timeout
+ +
Your fetch process was killed because it took too long. (More +accurately, it did not produce any output for a long time.) Please +put sites with better connectivity near the beginning of +MASTER_SITES.
+ +
(uncommon)forbidden
+ +
Someone has marked this port as "forbidden", almost always due +to security concerns. See the logfile for more information.
+ +
(uncommon)gcc bug
+ +
You have tickled a bug in gcc itself. See the +GNU bug report documentation +for further information.
+ +
(common)gcc4
+ +
Your code does not run with the latest gcc version +See the wiki page +for further information.
+ +
(common)gmake
+ +
Your code does not run with the latest, incompatible, gmake version +(3.82.)
+ +
(common)install error
+ +
There was an error during installation.
+ +
(common)LIB_DEPENDS
+ +
The LIB_DEPENDS line specifies a library name +incorrectly. This often happens when a port is upgraded and the +shared library version number changes.
+ +
(common)linker error
+ +
There is a linker error which is caused by something other than +those flagged elsewhere. +(Note: using clang as the ports compiler can also trigger this message.)
+ +
(common)makefile
+ +
There is an error in the Makefile, possibly in the default +targets.
+ +
(uncommon)manpage
+ +
There is a manpage listed in a MAN? macro that does not +exist or is not installed in the right place.
+ +
(common)missing header
+ +
There is a missing header file. This is usually caused by +either (1) a missing dependency, or (2) specifying an incorrect +location with -I in the compiler command line.
+ +
(common)mtree
+ +
The port leaves ${PREFIX} in a state that is not +consistent with the mtree definition after pkg_delete. This +usually means some files are missing from PLIST. It could +also mean that your installation scripts create files or +directories not properly deleted by the deinstallation scripts. +Another possibility is that your port is deleting some directories +it is not supposed to, or incorrectly modifying some directory's +permission.
+ +
(uncommon)nested_declaration
+ +
There is a nested declaration in the source code.
+ +
(common)new compiler error
+ +
The newest version of gcc in the base does not like the source code. This is +usually due to stricter C++ type checking or changes in register +allocation policy.
+ +
(transient)NFS
+ +
There was either a temporary NFS error on the build system +(which is not your fault), or the WRKSRC is invalid +(which is your fault).
+ +
(common)patch
+ +
One or more of the patches failed.
+ +
(uncommon)perl
+ +
perl is no longer included by default in the base +system, but your port's configuration process depends on it. While +this change helps avoid having a stale version of perl +in the base system, it also means that many ports now need to include +USE_PERL5.
+ +
(common)PLIST
+ +
There is a missing item in the PLIST. Note that this is +often caused by an earlier error that went undetected. In this case, +you should fix the error and also the build process so it will fail +upon an error instead of continuing, since that makes debugging +that much harder.
+ +
(uncommon)process failed
+ +
The make process terminated unexpectedly, due to +something like a signal 11 or bus error.
+ +
(uncommon)runaway process
+ +
Your make package process was killed because it took +too long. (More accurately, it did not produce any output for a long +time.) It is probably because there is a process spinning in an infinite +loop. Please check the log to determine the exact cause of the +problem.
+ +
(uncommon)segfault
+ +
Some process in the build chain got a segmentation fault.
+ +
(uncommon)sem_wait
+ +
This port needs to catch up with semaphore changes in 9-CURRENT.
+ +
(uncommon)termios
+ +
This port needs to catch up with the termios.h changes in src.
+ +
(uncommon)threads
+ +
There is a linker error which is caused by failing to find one of +the thread libraries.
+ +
(transient)truncated_distfile
+ +
A package node encountered an error during pkg_add. It is not your +fault. Linimon is trying to figure out this problem.
+ +
(uncommon)utmp_x
+ +
This port needs to catch up with the utmp_x.h changes in src.
+ +
(uncommon)WRKDIR
+ +
The port is attempting to change something outside +${WRKDIR}. See handbook +for details.
+ +
(common)??? (unknown)
+ +
The automated script cannot even guess what is wrong with your +port. portmgr tries to keep the processonelog script +reasonably efficient while covering as many errors as possible, but many +errors are not common enough to try to catch.
+
+ +

Here is an alphabetical list of obsolete errors +that used to be detected by the AI script, but are now uncommon enough to +be skipped:

+ +
+
(uncommon)alignment
+ +
You've managed to confuse the assembler with a misaligned +structure.
+ +
(uncommon)apxs
+ +
Your port depends on Apache (in particular, the apxs +binary) but the Makefile doesn't have Apache in +BUILD_DEPENDS and/or LIB_DEPENDS.
+ +
(uncommon)assert
+ +
Compilation failed due to an assert. This is often a variation +on arch or missing header.
+ +
(uncommon)awk
+ +
awk is complaining about some kind of bogus string +expression.
+ +
(uncommon)bison
+ +
Your port requires bison, which does not exist in +4.x-stable or newer anymore. Either patch it to use byacc +instead, or define USE_BISON.
+ +
(uncommon)cgi-bin
+ +
Your port assumes that a directory (usually +/usr/local/www/cgi-bin) already exists, +but by default it doesn't.
+ +
(uncommon)chown
+ +
POSIX has deprecated the usage +"chown user.group filename" in favor of +"chown user:group filename". This happened quite some time +ago, actually, but it is only now being enforced. (The change was +made to allow '.' in usernames).
+ +
(uncommon)ELF
+ +
The port does not properly work in the new ELF world. It is +probably looking for an a.out object (e.g., +crt0.o).
+ +
(uncommon)f77
+ +
gcc in base no longer includes the Fortran compiler +by default.
+ +
(uncommon)ffs conflict
+ +
Both /usr/include/machine/cpufunc.h and +/usr/include/strings.h are attempting to define int ffs().
+ +
(uncommon)getopt.h
+ +
<getopt.h> is conflicting with unistd.h.
+ +
(uncommon) +getopt
+ +
Your port may need to set the new port variable +USE_GETOPT_LONG.
+ +
(uncommon)libc_r not found
+ +
This library has not yet been ported to e.g. the Sparc.
+ +
(uncommon)malloc.h
+ +
Including <malloc.h> is now deprecated in favor of +<stdlib.h>.
+ +
(uncommon)MOTIF
+ +
This port requires Motif but does not define +REQUIRES_MOTIF. See the handbook +for details.
+ +
(uncommon)MOTIFLIB
+ +
This port requires Motif but does not refer to the libraries +using ${MOTIFLIB}. See handbook +for details.
+ +
(uncommon)munmap
+ +
POSIX specifies that munmap cannot be called on a zero-length file. +Because of this, during 4.X builds, if cp tries to copy a zero-length file, it +may fail saying, "cp: ...: Invalid argument". This is a problem with the +bindist image on pointyhat, and not the fault of the porter.
+ +
(uncommon)perl5
+ +
There is a problem in processing a perl5 module.
+ +
(uncommon)pod2man
+ +
perl is no longer included by default in the base +system, but your port's documentation process depends on it. While +this change helps avoid having a stale version of perl +in the base system, it also means that many ports now need to include +USE_PERL5.
+ +
(uncommon)python
+ +
The Makefile needs to define USE_PYTHON.
+ +
(uncommon)sed
+ +
sed is complaining about some kind of bogus regular +expression, probably as a side-effect of its being invoked by +${REINPLACE_COMMAND}. This is often a result of having +replaced usages of perl in the Makefile with usages +of ${REINPLACE_COMMAND} but having left +perl-specific regexps in place.
+ +
(uncommon)soundcard.h
+ +
machine/soundcard.h has been moved.
+ +
(uncommon)stdio
+ +
You need to bring your port up to date with the current +<stdio.h>.
+ +
(uncommon)stl
+ +
Your port requires the STL library but cannot find it.
+ +
(uncommon)struct changes
+ +
Your port is trying to refer to structure elements that are not +really there. This is often due to changes in the underlying +include files.
+ +
(uncommon)sysvipc
+ +
Your port is interacting badly with the System V InterProcess *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Tue Jun 21 15:40:31 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B11A1106564A for ; Tue, 21 Jun 2011 15:40:31 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 7D1DE8FC0C for ; Tue, 21 Jun 2011 15:40:31 +0000 (UTC) Received: from sa-nc-common-177.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.4/8.14.4) with ESMTP id p5LF182X058988 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 21 Jun 2011 08:01:14 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <20110621071352.GA44571@freebsd.org> Date: Tue, 21 Jun 2011 08:01:05 -0700 Content-Transfer-Encoding: 7bit Message-Id: <8D265214-C867-443B-8C93-2D7CD22CE4DF@xcllnt.net> References: <201106210527.p5L5RoKW081314@svn.freebsd.org> <20110621071352.GA44571@freebsd.org> To: Roman Divacky X-Mailer: Apple Mail (2.1084) Cc: svn-src-projects@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r223357 - projects/llvm-ia64/contrib/llvm/lib/Target/IA64 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 15:40:31 -0000 On Jun 21, 2011, at 12:13 AM, Roman Divacky wrote: >> + >> +SDValue >> +IA64TargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv, >> + bool isVarArg, const SmallVectorImpl &Outs, >> + const SmallVectorImpl &OutVals, DebugLoc dl, >> + SelectionDAG &DAG) const >> +{ >> + return Chain; >> +} > > This doesn't look right, you probably want to copy the result(s) into > register(s) or something like this. Oh, it's definitely not right. I just want to get to the point where I can compile 1 thing, no matter if that's: void foo(void) { } The thing is that you can expand in multiple directions in parallel after you have that. You can work on supporting more and different formal arguments (including the icky varargs), different return values and structure returns, more instructions patterns for the instruction selection pass, etc. More importantly, it allows me (in parallel) to work out the best way to abstract the notion of having a flexible number of stacked registers, rotating registers and other ia64 specific features. FYI, -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-projects@FreeBSD.ORG Tue Jun 21 19:13:48 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEF9610656AC; Tue, 21 Jun 2011 19:13:48 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFFBF8FC0A; Tue, 21 Jun 2011 19:13:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5LJDmmu013031; Tue, 21 Jun 2011 19:13:48 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LJDmMZ013029; Tue, 21 Jun 2011 19:13:48 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201106211913.p5LJDmMZ013029@svn.freebsd.org> From: Jamie Gritton Date: Tue, 21 Jun 2011 19:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223368 - projects/jailconf/usr.sbin/jail X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 19:13:48 -0000 Author: jamie Date: Tue Jun 21 19:13:48 2011 New Revision: 223368 URL: http://svn.freebsd.org/changeset/base/223368 Log: Fix a couple of NULL dereferences. Modified: projects/jailconf/usr.sbin/jail/command.c Modified: projects/jailconf/usr.sbin/jail/command.c ============================================================================== --- projects/jailconf/usr.sbin/jail/command.c Tue Jun 21 17:59:51 2011 (r223367) +++ projects/jailconf/usr.sbin/jail/command.c Tue Jun 21 19:13:48 2011 (r223368) @@ -77,6 +77,7 @@ static int check_path(struct cfjail *j, static struct cfjails sleeping = TAILQ_HEAD_INITIALIZER(sleeping); static struct cfjails runnable = TAILQ_HEAD_INITIALIZER(runnable); +static struct cfstring dummystring = { .len = 1 }; static struct phhead phash[PHASH_SIZE]; static int kq; @@ -89,8 +90,6 @@ next_command(struct cfjail *j) enum intparam comparam; int rval, create_failed; - static struct cfstring dummystring = { .len = 1 }; - rval = 0; create_failed = (j->flags & (JF_STOP | JF_FAILED)) == JF_FAILED; for (; (comparam = *j->comparam); @@ -115,7 +114,8 @@ next_command(struct cfjail *j) } } for (; j->comstring != NULL; - j->comstring = create_failed + j->comstring = j->comstring == &dummystring ? NULL : + create_failed ? TAILQ_PREV(j->comstring, cfstrings, tq) : TAILQ_NEXT(j->comstring, tq)) { if (rval != 0) @@ -457,7 +457,7 @@ run_command(struct cfjail *j) TAILQ_FOREACH(s, &j->intparams[IP_COMMAND]->val, tq) argv[argc++] = s->s; argv[argc] = NULL; - j->comstring = NULL; + j->comstring = &dummystring; break; default: From owner-svn-src-projects@FreeBSD.ORG Wed Jun 22 04:11:28 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C05791065705; Wed, 22 Jun 2011 04:11:28 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A5318FC19; Wed, 22 Jun 2011 04:11:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5M4BSFl031190; Wed, 22 Jun 2011 04:11:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M4BSkg031188; Wed, 22 Jun 2011 04:11:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106220411.p5M4BSkg031188@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 22 Jun 2011 04:11:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223407 - projects/pseries/powerpc/aim X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 04:11:28 -0000 Author: nwhitehorn Date: Wed Jun 22 04:11:27 2011 New Revision: 223407 URL: http://svn.freebsd.org/changeset/base/223407 Log: Free up SPRG1 any time the MMU is enabled. This allows it to be used as a scratch register handling kernel SLB faults, and will eliminate the need (once a special fault handler is written) to lock in kernel SLB entries. Modified: projects/pseries/powerpc/aim/trap_subr64.S Modified: projects/pseries/powerpc/aim/trap_subr64.S ============================================================================== --- projects/pseries/powerpc/aim/trap_subr64.S Wed Jun 22 02:23:18 2011 (r223406) +++ projects/pseries/powerpc/aim/trap_subr64.S Wed Jun 22 04:11:27 2011 (r223407) @@ -122,9 +122,9 @@ restore_kernsrs: std %r30,(savearea+CPUSAVE_SRR1)(%r31); /* save SRR1 */ \ mfmsr %r30; \ ori %r30,%r30,(PSL_DR|PSL_IR|PSL_RI)@l; /* relocation on */ \ + mfsprg1 %r31; /* get saved SP */ \ mtmsr %r30; /* stack can now be accessed */ \ isync; \ - mfsprg1 %r31; /* get saved SP */ \ stdu %r31,-(FRAMELEN+288)(%r1); /* save it in the callframe */ \ std %r0, FRAME_0+48(%r1); /* save r0 in the trapframe */ \ std %r31,FRAME_1+48(%r1); /* save SP " " */ \ @@ -195,7 +195,7 @@ restore_kernsrs: mtctr %r4; \ mtxer %r5; \ mtlr %r6; \ - mtsprg1 %r7; /* save cr */ \ + mtsprg3 %r7; /* save cr */ \ ld %r31,FRAME_31+48(%r1); /* restore r0-31 */ \ ld %r30,FRAME_30+48(%r1); \ ld %r29,FRAME_29+48(%r1); \ @@ -229,8 +229,7 @@ restore_kernsrs: ld %r0, FRAME_0+48(%r1); \ ld %r1, FRAME_1+48(%r1); \ /* Can't touch %r1 from here on */ \ - mtsprg2 %r2; /* save r2 & r3 */ \ - mtsprg3 %r3; \ + mtsprg2 %r2; /* save r2 */ \ /* Disable translation, machine check and recoverability: */ \ mfmsr %r2; \ andi. %r2,%r2,~(PSL_DR|PSL_IR|PSL_EE|PSL_ME|PSL_RI)@l; \ @@ -238,33 +237,33 @@ restore_kernsrs: isync; \ /* Decide whether we return to user mode: */ \ GET_CPUINFO(%r2); \ - ld %r3,(savearea+CPUSAVE_SRR1)(%r2); \ - mtcr %r3; \ + ld %r2,(savearea+CPUSAVE_SRR1)(%r2); \ + mtcr %r2; \ bf 17,1f; /* branch if PSL_PR is false */ \ /* Restore user SRs */ \ - GET_CPUINFO(%r3); \ - std %r27,(savearea+CPUSAVE_R27)(%r3); \ - std %r28,(savearea+CPUSAVE_R28)(%r3); \ - std %r29,(savearea+CPUSAVE_R29)(%r3); \ - std %r30,(savearea+CPUSAVE_R30)(%r3); \ - std %r31,(savearea+CPUSAVE_R31)(%r3); \ + GET_CPUINFO(%r2); \ + std %r27,(savearea+CPUSAVE_R27)(%r2); \ + std %r28,(savearea+CPUSAVE_R28)(%r2); \ + std %r29,(savearea+CPUSAVE_R29)(%r2); \ + std %r30,(savearea+CPUSAVE_R30)(%r2); \ + std %r31,(savearea+CPUSAVE_R31)(%r2); \ mflr %r27; /* preserve LR */ \ bl restore_usersrs; /* uses r28-r31 */ \ mtlr %r27; \ - ld %r31,(savearea+CPUSAVE_R31)(%r3); \ - ld %r30,(savearea+CPUSAVE_R30)(%r3); \ - ld %r29,(savearea+CPUSAVE_R29)(%r3); \ - ld %r28,(savearea+CPUSAVE_R28)(%r3); \ - ld %r27,(savearea+CPUSAVE_R27)(%r3); \ -1: mfsprg1 %r2; /* restore cr */ \ + ld %r31,(savearea+CPUSAVE_R31)(%r2); \ + ld %r30,(savearea+CPUSAVE_R30)(%r2); \ + ld %r29,(savearea+CPUSAVE_R29)(%r2); \ + ld %r28,(savearea+CPUSAVE_R28)(%r2); \ + ld %r27,(savearea+CPUSAVE_R27)(%r2); \ +1: mfsprg3 %r2; /* restore cr */ \ mtcr %r2; \ GET_CPUINFO(%r2); \ - ld %r3,(savearea+CPUSAVE_SRR0)(%r2); /* restore srr0 */ \ - mtsrr0 %r3; \ - ld %r3,(savearea+CPUSAVE_SRR1)(%r2); /* restore srr1 */ \ - mtsrr1 %r3; \ - mfsprg2 %r2; /* restore r2 & r3 */ \ - mfsprg3 %r3 + ld %r2,(savearea+CPUSAVE_SRR0)(%r2); /* restore srr0 */ \ + mtsrr0 %r2; \ + GET_CPUINFO(%r2); \ + ld %r2,(savearea+CPUSAVE_SRR1)(%r2); /* restore srr1 */ \ + mtsrr1 %r2; \ + mfsprg2 %r2 /* restore r2 */ \ #ifdef SMP /* From owner-svn-src-projects@FreeBSD.ORG Wed Jun 22 17:31:50 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 885C9106566C; Wed, 22 Jun 2011 17:31:50 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 793688FC16; Wed, 22 Jun 2011 17:31:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MHVoiB058785; Wed, 22 Jun 2011 17:31:50 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MHVonO058783; Wed, 22 Jun 2011 17:31:50 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201106221731.p5MHVonO058783@svn.freebsd.org> From: Peter Holm Date: Wed, 22 Jun 2011 17:31:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223427 - projects/stress2/misc X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 17:31:50 -0000 Author: pho Date: Wed Jun 22 17:31:50 2011 New Revision: 223427 URL: http://svn.freebsd.org/changeset/base/223427 Log: Updated to reflect the new block / frag defaults defined by r222319. While here, fix the error handling cleanup. Modified: projects/stress2/misc/linger.sh Modified: projects/stress2/misc/linger.sh ============================================================================== --- projects/stress2/misc/linger.sh Wed Jun 22 16:40:45 2011 (r223426) +++ projects/stress2/misc/linger.sh Wed Jun 22 17:31:50 2011 (r223427) @@ -86,12 +86,12 @@ EOF #include #define PARALLEL 10 -static int size = 14130; /* 6 free inodes */ +static int size = 6552; /* 10 free inodes */ int test(void) { - int error = 0, fd, i, j; + int fd, i, j; pid_t pid; char file[128]; @@ -107,7 +107,6 @@ test(void) if (errno != EINTR) { warn("creat(%s). %s:%d", file, __FILE__, __LINE__); unlink("continue"); - error = 1; break; } } @@ -117,12 +116,10 @@ test(void) } sleep(3); - if (error == 0) - j--; - for (i = j; i >= 0; i--) { + for (i = --j; i >= 0; i--) { sprintf(file,"p%05d.%05d", pid, i); if (unlink(file) == -1) - err(3, "unlink(%s)", file); + warn("unlink(%s)", file); } return (0); From owner-svn-src-projects@FreeBSD.ORG Wed Jun 22 19:42:33 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F31EC106564A; Wed, 22 Jun 2011 19:42:32 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E030B8FC12; Wed, 22 Jun 2011 19:42:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MJgWBI063978; Wed, 22 Jun 2011 19:42:32 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MJgWdj063959; Wed, 22 Jun 2011 19:42:32 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201106221942.p5MJgWdj063959@svn.freebsd.org> From: Attilio Rao Date: Wed, 22 Jun 2011 19:42:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223435 - in projects/largeSMP: bin/realpath contrib/top etc/rc.d lib/libc/stdlib libexec/ulog-helper sbin/geom/class/part sbin/growfs sbin/ipfw sbin/newfs sbin/tunefs share/mk sys/amd6... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 19:42:33 -0000 Author: attilio Date: Wed Jun 22 19:42:32 2011 New Revision: 223435 URL: http://svn.freebsd.org/changeset/base/223435 Log: MFC Modified: projects/largeSMP/bin/realpath/realpath.1 projects/largeSMP/bin/realpath/realpath.c projects/largeSMP/etc/rc.d/netwait projects/largeSMP/lib/libc/stdlib/malloc.c projects/largeSMP/libexec/ulog-helper/Makefile projects/largeSMP/libexec/ulog-helper/ulog-helper.c projects/largeSMP/sbin/geom/class/part/geom_part.c projects/largeSMP/sbin/growfs/growfs.8 projects/largeSMP/sbin/growfs/growfs.c projects/largeSMP/sbin/ipfw/nat.c projects/largeSMP/sbin/newfs/newfs.8 projects/largeSMP/sbin/tunefs/tunefs.8 projects/largeSMP/sys/amd64/include/pci_cfgreg.h projects/largeSMP/sys/amd64/pci/pci_bus.c projects/largeSMP/sys/dev/acpica/acpi_cpu.c projects/largeSMP/sys/dev/acpica/acpi_pcib_acpi.c projects/largeSMP/sys/dev/acpica/acpi_resource.c projects/largeSMP/sys/dev/acpica/acpivar.h projects/largeSMP/sys/dev/cardbus/cardbus_cis.c projects/largeSMP/sys/dev/dc/if_dc.c projects/largeSMP/sys/dev/pci/pci.c projects/largeSMP/sys/dev/vr/if_vr.c projects/largeSMP/sys/dev/vr/if_vrreg.h projects/largeSMP/sys/dev/xl/if_xl.c projects/largeSMP/sys/fs/nfsserver/nfs_nfsdserv.c projects/largeSMP/sys/i386/include/pci_cfgreg.h projects/largeSMP/sys/i386/pci/pci_bus.c projects/largeSMP/sys/ia64/conf/NOTES projects/largeSMP/sys/kern/kern_clocksource.c projects/largeSMP/sys/netinet/libalias/libalias.3 projects/largeSMP/sys/powerpc/ps3/ps3bus.c projects/largeSMP/sys/sparc64/include/tsb.h projects/largeSMP/sys/sparc64/include/vmparam.h projects/largeSMP/sys/sparc64/sparc64/pmap.c projects/largeSMP/sys/sys/systm.h projects/largeSMP/sys/x86/x86/tsc.c projects/largeSMP/usr.bin/cmp/regular.c projects/largeSMP/usr.bin/cmp/special.c projects/largeSMP/usr.bin/finger/net.c projects/largeSMP/usr.bin/lastcomm/lastcomm.c projects/largeSMP/usr.bin/lastcomm/readrec.c projects/largeSMP/usr.sbin/nfsuserd/nfsuserd.c Directory Properties: projects/largeSMP/ (props changed) projects/largeSMP/cddl/contrib/opensolaris/ (props changed) projects/largeSMP/contrib/bind9/ (props changed) projects/largeSMP/contrib/binutils/ (props changed) projects/largeSMP/contrib/bzip2/ (props changed) projects/largeSMP/contrib/compiler-rt/ (props changed) projects/largeSMP/contrib/dialog/ (props changed) projects/largeSMP/contrib/ee/ (props changed) projects/largeSMP/contrib/expat/ (props changed) projects/largeSMP/contrib/file/ (props changed) projects/largeSMP/contrib/gcc/ (props changed) projects/largeSMP/contrib/gdb/ (props changed) projects/largeSMP/contrib/gdtoa/ (props changed) projects/largeSMP/contrib/gnu-sort/ (props changed) projects/largeSMP/contrib/groff/ (props changed) projects/largeSMP/contrib/less/ (props changed) projects/largeSMP/contrib/libpcap/ (props changed) projects/largeSMP/contrib/libstdc++/ (props changed) projects/largeSMP/contrib/llvm/ (props changed) projects/largeSMP/contrib/llvm/tools/clang/ (props changed) projects/largeSMP/contrib/ncurses/ (props changed) projects/largeSMP/contrib/netcat/ (props changed) projects/largeSMP/contrib/ntp/ (props changed) projects/largeSMP/contrib/one-true-awk/ (props changed) projects/largeSMP/contrib/openbsm/ (props changed) projects/largeSMP/contrib/openpam/ (props changed) projects/largeSMP/contrib/pf/ (props changed) projects/largeSMP/contrib/sendmail/ (props changed) projects/largeSMP/contrib/tcpdump/ (props changed) projects/largeSMP/contrib/tcsh/ (props changed) projects/largeSMP/contrib/tnftp/ (props changed) projects/largeSMP/contrib/top/ (props changed) projects/largeSMP/contrib/top/install-sh (props changed) projects/largeSMP/contrib/tzcode/stdtime/ (props changed) projects/largeSMP/contrib/tzcode/zic/ (props changed) projects/largeSMP/contrib/tzdata/ (props changed) projects/largeSMP/contrib/wpa/ (props changed) projects/largeSMP/contrib/xz/ (props changed) projects/largeSMP/crypto/openssh/ (props changed) projects/largeSMP/crypto/openssl/ (props changed) projects/largeSMP/gnu/lib/ (props changed) projects/largeSMP/gnu/usr.bin/binutils/ (props changed) projects/largeSMP/gnu/usr.bin/cc/cc_tools/ (props changed) projects/largeSMP/gnu/usr.bin/gdb/ (props changed) projects/largeSMP/lib/libc/ (props changed) projects/largeSMP/lib/libc/stdtime/ (props changed) projects/largeSMP/lib/libutil/ (props changed) projects/largeSMP/lib/libz/ (props changed) projects/largeSMP/sbin/ (props changed) projects/largeSMP/sbin/ipfw/ (props changed) projects/largeSMP/share/mk/bsd.arch.inc.mk (props changed) projects/largeSMP/share/zoneinfo/ (props changed) projects/largeSMP/sys/ (props changed) projects/largeSMP/sys/amd64/include/xen/ (props changed) projects/largeSMP/sys/boot/ (props changed) projects/largeSMP/sys/boot/i386/efi/ (props changed) projects/largeSMP/sys/boot/ia64/efi/ (props changed) projects/largeSMP/sys/boot/ia64/ski/ (props changed) projects/largeSMP/sys/boot/powerpc/boot1.chrp/ (props changed) projects/largeSMP/sys/boot/powerpc/ofw/ (props changed) projects/largeSMP/sys/cddl/contrib/opensolaris/ (props changed) projects/largeSMP/sys/conf/ (props changed) projects/largeSMP/sys/contrib/dev/acpica/ (props changed) projects/largeSMP/sys/contrib/octeon-sdk/ (props changed) projects/largeSMP/sys/contrib/pf/ (props changed) projects/largeSMP/sys/contrib/x86emu/ (props changed) projects/largeSMP/usr.bin/calendar/ (props changed) projects/largeSMP/usr.bin/csup/ (props changed) projects/largeSMP/usr.bin/procstat/ (props changed) projects/largeSMP/usr.sbin/ndiscvt/ (props changed) projects/largeSMP/usr.sbin/zic/ (props changed) Modified: projects/largeSMP/bin/realpath/realpath.1 ============================================================================== --- projects/largeSMP/bin/realpath/realpath.1 Wed Jun 22 19:14:49 2011 (r223434) +++ projects/largeSMP/bin/realpath/realpath.1 Wed Jun 22 19:42:32 2011 (r223435) @@ -33,7 +33,7 @@ .\" From: src/bin/pwd/pwd.1,v 1.11 2000/11/20 11:39:39 ru Exp .\" $FreeBSD$ .\" -.Dd November 24, 2000 +.Dd June 21, 2011 .Dt REALPATH 1 .Os .Sh NAME @@ -42,8 +42,7 @@ .Sh SYNOPSIS .Nm .Op Fl q -.Ar path -.Op Ar ... +.Op Ar path ... .Sh DESCRIPTION The .Nm @@ -57,6 +56,11 @@ and .Pa /../ in .Ar path . +If +.Ar path +is absent, the current working directory +.Pq Sq Pa .\& +is assumed. .Pp If .Fl q Modified: projects/largeSMP/bin/realpath/realpath.c ============================================================================== --- projects/largeSMP/bin/realpath/realpath.c Wed Jun 22 19:14:49 2011 (r223434) +++ projects/largeSMP/bin/realpath/realpath.c Wed Jun 22 19:42:32 2011 (r223435) @@ -44,7 +44,8 @@ main(int argc, char *argv[]) { char buf[PATH_MAX]; char *p; - int ch, i, qflag, rval; + const char *path; + int ch, qflag, rval; qflag = 0; while ((ch = getopt(argc, argv, "q")) != -1) { @@ -59,17 +60,16 @@ main(int argc, char *argv[]) } argc -= optind; argv += optind; - if (argc < 1) - usage(); + path = *argv != NULL ? *argv++ : "."; rval = 0; - for (i = 0; i < argc; i++) { - if ((p = realpath(argv[i], buf)) == NULL) { + do { + if ((p = realpath(path, buf)) == NULL) { if (!qflag) - warn("%s", argv[i]); + warn("%s", path); rval = 1; } else (void)printf("%s\n", p); - } + } while ((path = *argv++) != NULL); exit(rval); } @@ -77,6 +77,6 @@ static void usage(void) { - (void)fprintf(stderr, "usage: realpath [-q] path [...]\n"); + (void)fprintf(stderr, "usage: realpath [-q] [path ...]\n"); exit(1); } Modified: projects/largeSMP/etc/rc.d/netwait ============================================================================== --- projects/largeSMP/etc/rc.d/netwait Wed Jun 22 19:14:49 2011 (r223434) +++ projects/largeSMP/etc/rc.d/netwait Wed Jun 22 19:42:32 2011 (r223435) @@ -14,7 +14,8 @@ . /etc/rc.subr name="netwait" -rc_var=`set_rcvar` +rcvar=`set_rcvar` + start_cmd="${name}_start" stop_cmd=":" Modified: projects/largeSMP/lib/libc/stdlib/malloc.c ============================================================================== --- projects/largeSMP/lib/libc/stdlib/malloc.c Wed Jun 22 19:14:49 2011 (r223434) +++ projects/largeSMP/lib/libc/stdlib/malloc.c Wed Jun 22 19:42:32 2011 (r223435) @@ -234,7 +234,7 @@ __FBSDID("$FreeBSD$"); #ifdef __sparc64__ # define LG_QUANTUM 4 # define LG_SIZEOF_PTR 3 -# define TLS_MODEL /* default */ +# define TLS_MODEL __attribute__((tls_model("initial-exec"))) #endif #ifdef __amd64__ # define LG_QUANTUM 4 Modified: projects/largeSMP/libexec/ulog-helper/Makefile ============================================================================== --- projects/largeSMP/libexec/ulog-helper/Makefile Wed Jun 22 19:14:49 2011 (r223434) +++ projects/largeSMP/libexec/ulog-helper/Makefile Wed Jun 22 19:42:32 2011 (r223435) @@ -5,7 +5,7 @@ BINOWN= root BINMODE=4555 NO_MAN= -DPADD= ${LIBULOG} ${LIBMD} -LDADD= -lulog -lmd +DPADD= ${LIBULOG} +LDADD= -lulog .include Modified: projects/largeSMP/libexec/ulog-helper/ulog-helper.c ============================================================================== --- projects/largeSMP/libexec/ulog-helper/ulog-helper.c Wed Jun 22 19:14:49 2011 (r223434) +++ projects/largeSMP/libexec/ulog-helper/ulog-helper.c Wed Jun 22 19:42:32 2011 (r223435) @@ -36,11 +36,11 @@ __FBSDID("$FreeBSD$"); /* * This setuid helper utility writes user login records to disk. - * Unprivileged processes are not capable of writing records to utmp, - * wtmp and lastlog, but we do want to allow this for pseudo-terminals. - * Because a file descriptor to a pseudo-terminal master device can only - * be obtained by processes using the pseudo-terminal, we expect such a - * descriptor on stdin. + * Unprivileged processes are not capable of writing records to utmpx, + * but we do want to allow this for pseudo-terminals. Because a file + * descriptor to a pseudo-terminal master device can only be obtained by + * processes using the pseudo-terminal, we expect such a descriptor on + * stdin. * * It uses the real user ID of the calling process to determine the * username. It does allow users to log arbitrary hostnames. @@ -49,26 +49,22 @@ __FBSDID("$FreeBSD$"); int main(int argc, char *argv[]) { - const char *line; + const char *line, *user, *host; /* Device line name. */ if ((line = ptsname(STDIN_FILENO)) == NULL) return (EX_USAGE); if ((argc == 2 || argc == 3) && strcmp(argv[1], "login") == 0) { - struct passwd *pwd; - const char *host = NULL; - /* Username. */ - pwd = getpwuid(getuid()); - if (pwd == NULL) + user = user_from_uid(getuid(), 1); + if (user == NULL) return (EX_OSERR); /* Hostname. */ - if (argc == 3) - host = argv[2]; + host = argc == 3 ? argv[2] : NULL; - ulog_login(line, pwd->pw_name, host); + ulog_login(line, user, host); return (EX_OK); } else if (argc == 2 && strcmp(argv[1], "logout") == 0) { ulog_logout(line); Modified: projects/largeSMP/sbin/geom/class/part/geom_part.c ============================================================================== --- projects/largeSMP/sbin/geom/class/part/geom_part.c Wed Jun 22 19:14:49 2011 (r223434) +++ projects/largeSMP/sbin/geom/class/part/geom_part.c Wed Jun 22 19:42:32 2011 (r223435) @@ -1208,8 +1208,11 @@ gpart_bootcode(struct gctl_req *req, uns if (idx == 0) errx(EXIT_FAILURE, "missing -i option"); gpart_write_partcode(gp, idx, partcode, partsize); - } else + } else { + if (partsize != VTOC_BOOTSIZE) + errx(EXIT_FAILURE, "invalid bootcode"); gpart_write_partcode_vtoc8(gp, idx, partcode); + } } else if (bootcode == NULL) errx(EXIT_FAILURE, "no -b nor -p"); Modified: projects/largeSMP/sbin/growfs/growfs.8 ============================================================================== --- projects/largeSMP/sbin/growfs/growfs.8 Wed Jun 22 19:14:49 2011 (r223434) +++ projects/largeSMP/sbin/growfs/growfs.8 Wed Jun 22 19:42:32 2011 (r223435) @@ -37,12 +37,12 @@ .\" $TSHeader: src/sbin/growfs/growfs.8,v 1.3 2000/12/12 19:31:00 tomsoft Exp $ .\" $FreeBSD$ .\" -.Dd May 8, 2011 +.Dd June 22, 2011 .Dt GROWFS 8 .Os .Sh NAME .Nm growfs -.Nd grow size of an existing UFS file system +.Nd expand an existing UFS filesystem .Sh SYNOPSIS .Nm .Op Fl Ny @@ -58,26 +58,26 @@ Before starting .Nm the disk must be labeled to a bigger size using .Xr bsdlabel 8 . -If you wish to grow a file system beyond the boundary of -the slice it resides in, you must re-size the slice using -.Xr fdisk 8 +If you wish to grow a filesystem beyond the boundary of +the slice it resides in, you must resize the slice using +.Xr gpart 8 before running .Nm . If you are using volumes you must enlarge them by using -.Xr vinum 8 . +.Xr gvinum 8 . The .Nm -utility extends the size of the file system on the specified special file. +utility extends the size of the filesystem on the specified special file. Currently .Nm -can only enlarge unmounted file systems. -Do not try enlarging a mounted file system, your system may panic and you will -not be able to use the file system any longer. +can only enlarge unmounted filesystems. +Do not try enlarging a mounted filesystem, your system may panic and you will +not be able to use the filesystem any longer. Most of the .Xr newfs 8 options cannot be changed by .Nm . -In fact, you can only increase the size of the file system. +In fact, you can only increase the size of the filesystem. Use .Xr tunefs 8 for other changes. @@ -86,8 +86,8 @@ The following options are available: .Bl -tag -width indent .It Fl N .Dq Test mode . -Causes the new file system parameters to be printed out without actually -enlarging the file system. +Causes the new filesystem parameters to be printed out without actually +enlarging the filesystem. .It Fl y .Dq Expert mode . Usually @@ -102,12 +102,12 @@ So use this option with great care! .It Fl s Ar size Determines the .Ar size -of the file system after enlarging in sectors. +of the filesystem after enlarging in sectors. This value defaults to the size of the raw partition specified in .Ar special (in other words, .Nm -will enlarge the file system to the size of the entire partition). +will enlarge the filesystem to the size of the entire partition). .El .Sh EXAMPLES .Dl growfs -s 4194304 /dev/vinum/testvol @@ -119,12 +119,12 @@ up to 2GB if there is enough space in .Sh SEE ALSO .Xr bsdlabel 8 , .Xr dumpfs 8 , -.Xr fdisk 8 , .Xr ffsinfo 8 , .Xr fsck 8 , +.Xr gpart 8 , .Xr newfs 8 , .Xr tunefs 8 , -.Xr vinum 8 +.Xr gvinum 8 .Sh HISTORY The .Nm @@ -144,12 +144,12 @@ There may be cases on .Fx 3.x only, when .Nm -does not recognize properly whether or not the file system is mounted and +does not recognize properly whether or not the filesystem is mounted and exits with an error message. Then please use .Nm .Fl y -if you are sure that the file system is not mounted. +if you are sure that the filesystem is not mounted. It is also recommended to always use .Xr fsck 8 after enlarging (just to be on the safe side). @@ -183,8 +183,8 @@ on the first cylinder group to verify th in the CYLINDER SUMMARY (internal cs) of the CYLINDER GROUP .Em cgr0 has enough blocks. -As a rule of thumb for default file system parameters one block is needed for -every 2 GB of total file system size. +As a rule of thumb for default filesystem parameters one block is needed for +every 2 GB of total filesystem size. .Pp Normally .Nm Modified: projects/largeSMP/sbin/growfs/growfs.c ============================================================================== --- projects/largeSMP/sbin/growfs/growfs.c Wed Jun 22 19:14:49 2011 (r223434) +++ projects/largeSMP/sbin/growfs/growfs.c Wed Jun 22 19:42:32 2011 (r223435) @@ -160,7 +160,7 @@ static void get_dev_size(int, int *); /* ************************************************************ growfs ***** */ /* - * Here we actually start growing the file system. We basically read the + * Here we actually start growing the filesystem. We basically read the * cylinder summary from the first cylinder group as we want to update * this on the fly during our various operations. First we handle the * changes in the former last cylinder group. Afterwards we create all new @@ -231,7 +231,7 @@ growfs(int fsi, int fso, unsigned int Nf updjcg(osblock.fs_ncg-1, modtime, fsi, fso, Nflag); /* - * Dump out summary information about file system. + * Dump out summary information about filesystem. */ # define B2MBFACTOR (1 / (1024.0 * 1024.0)) printf("growfs: %.1fMB (%jd sectors) block size %d, fragment size %d\n", @@ -435,7 +435,7 @@ initcg(int cylno, time_t modtime, int fs if (acg.cg_nextfreeoff > (unsigned)sblock.fs_cgsize) { /* * This should never happen as we would have had that panic - * already on file system creation + * already on filesystem creation */ errx(37, "panic: cylinder group too big"); } @@ -446,7 +446,7 @@ initcg(int cylno, time_t modtime, int fs acg.cg_cs.cs_nifree--; } /* - * For the old file system, we have to initialize all the inodes. + * For the old filesystem, we have to initialize all the inodes. */ if (sblock.fs_magic == FS_UFS1_MAGIC) { bzero(iobuf, sblock.fs_bsize); @@ -670,7 +670,7 @@ cond_bl_upd(ufs2_daddr_t *block, struct /* ************************************************************ updjcg ***** */ /* * Here we do all needed work for the former last cylinder group. It has to be - * changed in any case, even if the file system ended exactly on the end of + * changed in any case, even if the filesystem ended exactly on the end of * this group, as there is some slightly inconsistent handling of the number * of cylinders in the cylinder group. We start again by reading the cylinder * group from disk. If the last block was not fully available, we first handle @@ -780,7 +780,7 @@ updjcg(int cylno, time_t modtime, int fs * the rotational layout tables and the cluster summary. This is * also done per fragment for the first new block if the old file * system end was not on a block boundary, per fragment for the new - * last block if the new file system end is not on a block boundary, + * last block if the new filesystem end is not on a block boundary, * and per block for all space in between. * * Handle the first new block here if it was partially available @@ -804,7 +804,7 @@ updjcg(int cylno, time_t modtime, int fs /* * Check if the fragment just created could join an * already existing fragment at the former end of the - * file system. + * filesystem. */ if(isblock(&sblock, cg_blksfree(&acg), ((osblock.fs_size - cgbase(&sblock, cylno))/ @@ -931,7 +931,7 @@ updjcg(int cylno, time_t modtime, int fs * Option (1) is considered to be less intrusive to the structure of the file- * system. So we try to stick to that whenever possible. If there is not enough * space in the cylinder group containing the cylinder summary we have to use - * method (2). In case of active snapshots in the file system we probably can + * method (2). In case of active snapshots in the filesystem we probably can * completely avoid implementing copy on write if we stick to method (2) only. */ static void @@ -1287,7 +1287,7 @@ updcsloc(time_t modtime, int fsi, int fs /* * No cluster handling is needed here, as there was at least * one fragment in use by the cylinder summary in the old - * file system. + * filesystem. * No block-free counter handling here as this block was not * a free block. */ @@ -1597,7 +1597,7 @@ wtfs(ufs2_daddr_t bno, size_t size, void /* * Here we allocate a free block in the current cylinder group. It is assumed, * that acg contains the current cylinder group. As we may take a block from - * somewhere in the file system we have to handle cluster summary here. + * somewhere in the filesystem we have to handle cluster summary here. */ static ufs2_daddr_t alloc(void) @@ -1939,9 +1939,9 @@ get_dev_size(int fd, int *size) /* ************************************************************** main ***** */ /* * growfs(8) is a utility which allows to increase the size of an existing - * ufs file system. Currently this can only be done on unmounted file system. + * ufs filesystem. Currently this can only be done on unmounted filesystem. * It recognizes some command line options to specify the new desired size, - * and it does some basic checkings. The old file system size is determined + * and it does some basic checkings. The old filesystem size is determined * and after some more checks like we can really access the new last block * on the disk etc. we calculate the new parameters for the superblock. After * having done this we just call growfs() which will do the work. Before @@ -1953,11 +1953,11 @@ get_dev_size(int fd, int *size) * are lucky, then we only have to handle our blocks to be relocated in that * way. * Also we have to consider in what order we actually update the critical - * data structures of the file system to make sure, that in case of a disaster + * data structures of the filesystem to make sure, that in case of a disaster * fsck(8) is still able to restore any lost data. * The foreseen last step then will be to provide for growing even mounted - * file systems. There we have to extend the mount() system call to provide - * userland access to the file system locking facility. + * filesystems. There we have to extend the mount() system call to provide + * userland access to the filesystem locking facility. */ int main(int argc, char **argv) @@ -2088,7 +2088,7 @@ main(int argc, char **argv) } /* - * Check if that partition is suitable for growing a file system. + * Check if that partition is suitable for growing a filesystem. */ if (p_size < 1) { errx(1, "partition is unavailable"); @@ -2146,8 +2146,8 @@ main(int argc, char **argv) if(ExpertFlag == 0) { for(j=0; j 32MB is likely OK. + * + * However, this can cause problems for other chipsets, so we make + * this tunable by hw.pci.host_mem_start. + */ SYSCTL_DECL(_hw_pci); -static unsigned long legacy_host_mem_start = 0x80000000; -TUNABLE_ULONG("hw.pci.host_mem_start", &legacy_host_mem_start); -SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN, - &legacy_host_mem_start, 0x80000000, - "Limit the host bridge memory to being above this address. Must be\n\ -set at boot via a tunable."); +static unsigned long host_mem_start = 0x80000000; +TUNABLE_ULONG("hw.pci.host_mem_start", &host_mem_start); +SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN, &host_mem_start, + 0, "Limit the host bridge memory to being above this address."); + +u_long +hostb_alloc_start(int type, u_long start, u_long end, u_long count) +{ + + if (start + count - 1 != end) { + if (type == SYS_RES_MEMORY && start < host_mem_start) + start = host_mem_start; + if (type == SYS_RES_IOPORT && start < 0x1000) + start = 0x1000; + } + return (start); +} struct resource * legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { - /* - * If no memory preference is given, use upper 32MB slot most - * bioses use for their memory window. Typically other bridges - * before us get in the way to assert their preferences on memory. - * Hardcoding like this sucks, so a more MD/MI way needs to be - * found to do it. This is typically only used on older laptops - * that don't have pci busses behind pci bridge, so assuming > 32MB - * is liekly OK. - * - * However, this can cause problems for other chipsets, so we make - * this tunable by hw.pci.host_mem_start. - */ - if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL) - start = legacy_host_mem_start; - if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL) - start = 0x1000; + + start = hostb_alloc_start(type, start, end, count); return (bus_generic_alloc_resource(dev, child, type, rid, start, end, count, flags)); } Modified: projects/largeSMP/sys/dev/acpica/acpi_cpu.c ============================================================================== --- projects/largeSMP/sys/dev/acpica/acpi_cpu.c Wed Jun 22 19:14:49 2011 (r223434) +++ projects/largeSMP/sys/dev/acpica/acpi_cpu.c Wed Jun 22 19:42:32 2011 (r223435) @@ -856,6 +856,8 @@ acpi_cpu_cx_list(struct acpi_cpu_softc * sbuf_printf(&sb, "C%d/%d ", i + 1, sc->cpu_cx_states[i].trans_lat); if (sc->cpu_cx_states[i].type < ACPI_STATE_C3) sc->cpu_non_c3 = i; + else + cpu_can_deep_sleep = 1; } sbuf_trim(&sb); sbuf_finish(&sb); Modified: projects/largeSMP/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- projects/largeSMP/sys/dev/acpica/acpi_pcib_acpi.c Wed Jun 22 19:14:49 2011 (r223434) +++ projects/largeSMP/sys/dev/acpica/acpi_pcib_acpi.c Wed Jun 22 19:42:32 2011 (r223435) @@ -357,32 +357,14 @@ acpi_pcib_map_msi(device_t pcib, device_ return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data)); } -static u_long acpi_host_mem_start = 0x80000000; -TUNABLE_ULONG("hw.acpi.host_mem_start", &acpi_host_mem_start); - struct resource * acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { - /* - * If no memory preference is given, use upper 32MB slot most - * bioses use for their memory window. Typically other bridges - * before us get in the way to assert their preferences on memory. - * Hardcoding like this sucks, so a more MD/MI way needs to be - * found to do it. This is typically only used on older laptops - * that don't have pci busses behind pci bridge, so assuming > 32MB - * is likely OK. - * - * PCI-PCI bridges may allocate smaller ranges for their windows, - * but the heuristics here should apply to those, so we allow - * several different end addresses. - */ - if (type == SYS_RES_MEMORY && start == 0UL && (end == ~0UL || - end == 0xffffffff)) - start = acpi_host_mem_start; - if (type == SYS_RES_IOPORT && start == 0UL && (end == ~0UL || - end == 0xffff || end == 0xffffffff)) - start = 0x1000; + +#if defined(__i386__) || defined(__amd64__) + start = hostb_alloc_start(type, start, end, count); +#endif return (bus_generic_alloc_resource(dev, child, type, rid, start, end, count, flags)); } Modified: projects/largeSMP/sys/dev/acpica/acpi_resource.c ============================================================================== --- projects/largeSMP/sys/dev/acpica/acpi_resource.c Wed Jun 22 19:14:49 2011 (r223434) +++ projects/largeSMP/sys/dev/acpica/acpi_resource.c Wed Jun 22 19:42:32 2011 (r223435) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -139,6 +140,249 @@ acpi_config_intr(device_t dev, ACPI_RESO INTR_POLARITY_HIGH : INTR_POLARITY_LOW); } +struct acpi_resource_context { + struct acpi_parse_resource_set *set; + device_t dev; + void *context; +}; + +#ifdef ACPI_DEBUG_OUTPUT +static const char * +acpi_address_range_name(UINT8 ResourceType) +{ + static char buf[16]; + + switch (ResourceType) { + case ACPI_MEMORY_RANGE: + return ("Memory"); + case ACPI_IO_RANGE: + return ("IO"); + case ACPI_BUS_NUMBER_RANGE: + return ("Bus Number"); + default: + snprintf(buf, sizeof(buf), "type %u", ResourceType); + return (buf); + } +} +#endif + +static ACPI_STATUS +acpi_parse_resource(ACPI_RESOURCE *res, void *context) +{ + struct acpi_parse_resource_set *set; + struct acpi_resource_context *arc; + UINT64 min, max, length, gran; + const char *name; + device_t dev; + + arc = context; + dev = arc->dev; + set = arc->set; + + switch (res->Type) { + case ACPI_RESOURCE_TYPE_END_TAG: + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "EndTag\n")); + break; + case ACPI_RESOURCE_TYPE_FIXED_IO: + if (res->Data.FixedIo.AddressLength <= 0) + break; + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "FixedIo 0x%x/%d\n", + res->Data.FixedIo.Address, res->Data.FixedIo.AddressLength)); + set->set_ioport(dev, arc->context, res->Data.FixedIo.Address, + res->Data.FixedIo.AddressLength); + break; + case ACPI_RESOURCE_TYPE_IO: + if (res->Data.Io.AddressLength <= 0) + break; + if (res->Data.Io.Minimum == res->Data.Io.Maximum) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Io 0x%x/%d\n", + res->Data.Io.Minimum, res->Data.Io.AddressLength)); + set->set_ioport(dev, arc->context, res->Data.Io.Minimum, + res->Data.Io.AddressLength); + } else { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Io 0x%x-0x%x/%d\n", + res->Data.Io.Minimum, res->Data.Io.Maximum, + res->Data.Io.AddressLength)); + set->set_iorange(dev, arc->context, res->Data.Io.Minimum, + res->Data.Io.Maximum, res->Data.Io.AddressLength, + res->Data.Io.Alignment); + } + break; + case ACPI_RESOURCE_TYPE_FIXED_MEMORY32: + if (res->Data.FixedMemory32.AddressLength <= 0) + break; + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "FixedMemory32 0x%x/%d\n", + res->Data.FixedMemory32.Address, + res->Data.FixedMemory32.AddressLength)); + set->set_memory(dev, arc->context, res->Data.FixedMemory32.Address, + res->Data.FixedMemory32.AddressLength); + break; + case ACPI_RESOURCE_TYPE_MEMORY32: + if (res->Data.Memory32.AddressLength <= 0) + break; + if (res->Data.Memory32.Minimum == res->Data.Memory32.Maximum) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory32 0x%x/%d\n", + res->Data.Memory32.Minimum, res->Data.Memory32.AddressLength)); + set->set_memory(dev, arc->context, res->Data.Memory32.Minimum, + res->Data.Memory32.AddressLength); + } else { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory32 0x%x-0x%x/%d\n", + res->Data.Memory32.Minimum, res->Data.Memory32.Maximum, + res->Data.Memory32.AddressLength)); + set->set_memoryrange(dev, arc->context, res->Data.Memory32.Minimum, + res->Data.Memory32.Maximum, res->Data.Memory32.AddressLength, + res->Data.Memory32.Alignment); + } + break; + case ACPI_RESOURCE_TYPE_MEMORY24: + if (res->Data.Memory24.AddressLength <= 0) + break; + if (res->Data.Memory24.Minimum == res->Data.Memory24.Maximum) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory24 0x%x/%d\n", + res->Data.Memory24.Minimum, res->Data.Memory24.AddressLength)); + set->set_memory(dev, arc->context, res->Data.Memory24.Minimum, + res->Data.Memory24.AddressLength); + } else { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory24 0x%x-0x%x/%d\n", + res->Data.Memory24.Minimum, res->Data.Memory24.Maximum, + res->Data.Memory24.AddressLength)); + set->set_memoryrange(dev, arc->context, res->Data.Memory24.Minimum, + res->Data.Memory24.Maximum, res->Data.Memory24.AddressLength, + res->Data.Memory24.Alignment); + } + break; + case ACPI_RESOURCE_TYPE_IRQ: + /* + * from 1.0b 6.4.2 + * "This structure is repeated for each separate interrupt + * required" + */ + set->set_irq(dev, arc->context, res->Data.Irq.Interrupts, + res->Data.Irq.InterruptCount, res->Data.Irq.Triggering, + res->Data.Irq.Polarity); + break; + case ACPI_RESOURCE_TYPE_DMA: + /* + * from 1.0b 6.4.3 + * "This structure is repeated for each separate DMA channel + * required" + */ + set->set_drq(dev, arc->context, res->Data.Dma.Channels, + res->Data.Dma.ChannelCount); + break; + case ACPI_RESOURCE_TYPE_START_DEPENDENT: + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "start dependent functions\n")); + set->set_start_dependent(dev, arc->context, + res->Data.StartDpf.CompatibilityPriority); + break; + case ACPI_RESOURCE_TYPE_END_DEPENDENT: + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "end dependent functions\n")); + set->set_end_dependent(dev, arc->context); + break; + case ACPI_RESOURCE_TYPE_ADDRESS16: + case ACPI_RESOURCE_TYPE_ADDRESS32: + case ACPI_RESOURCE_TYPE_ADDRESS64: + case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64: + switch (res->Type) { + case ACPI_RESOURCE_TYPE_ADDRESS16: + gran = res->Data.Address16.Granularity; + min = res->Data.Address16.Minimum; + max = res->Data.Address16.Maximum; + length = res->Data.Address16.AddressLength; + name = "Address16"; + break; + case ACPI_RESOURCE_TYPE_ADDRESS32: + gran = res->Data.Address32.Granularity; + min = res->Data.Address32.Minimum; + max = res->Data.Address32.Maximum; + length = res->Data.Address32.AddressLength; + name = "Address32"; + break; + case ACPI_RESOURCE_TYPE_ADDRESS64: + gran = res->Data.Address64.Granularity; + min = res->Data.Address64.Minimum; + max = res->Data.Address64.Maximum; + length = res->Data.Address64.AddressLength; + name = "Address64"; + break; + default: + KASSERT(res->Type == ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64, + ("should never happen")); + gran = res->Data.ExtAddress64.Granularity; + min = res->Data.ExtAddress64.Minimum; + max = res->Data.ExtAddress64.Maximum; + length = res->Data.ExtAddress64.AddressLength; + name = "ExtAddress64"; + break; + } + if (length <= 0) + break; + if (res->Data.Address.ProducerConsumer != ACPI_CONSUMER) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, + "ignored %s %s producer\n", name, + acpi_address_range_name(res->Data.Address.ResourceType))); + break; + } + if (res->Data.Address.ResourceType != ACPI_MEMORY_RANGE && + res->Data.Address.ResourceType != ACPI_IO_RANGE) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, + "ignored %s for non-memory, non-I/O\n", name)); + break; + } + +#ifdef __i386__ + if (min > ULONG_MAX || (res->Data.Address.MaxAddressFixed && max > + ULONG_MAX)) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "ignored %s above 4G\n", + name)); + break; + } + if (max > ULONG_MAX) + max = ULONG_MAX; +#endif + if (res->Data.Address.MinAddressFixed == ACPI_ADDRESS_FIXED && + res->Data.Address.MaxAddressFixed == ACPI_ADDRESS_FIXED) { + if (res->Data.Address.ResourceType == ACPI_MEMORY_RANGE) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/Memory 0x%jx/%ju\n", + name, (uintmax_t)min, (uintmax_t)length)); + set->set_memory(dev, arc->context, min, length); + } else { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%jx/%ju\n", name, + (uintmax_t)min, (uintmax_t)length)); + set->set_ioport(dev, arc->context, min, length); + } + } else { + if (res->Data.Address32.ResourceType == ACPI_MEMORY_RANGE) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, + "%s/Memory 0x%jx-0x%jx/%ju\n", name, (uintmax_t)min, + (uintmax_t)max, (uintmax_t)length)); + set->set_memoryrange(dev, arc->context, min, max, length, gran); + } else { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%jx-0x%jx/%ju\n", + name, (uintmax_t)min, (uintmax_t)max, (uintmax_t)length)); + set->set_iorange(dev, arc->context, min, max, length, gran); + } + } + break; + case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: + if (res->Data.ExtendedIrq.ProducerConsumer != ACPI_CONSUMER) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "ignored ExtIRQ producer\n")); + break; + } + set->set_ext_irq(dev, arc->context, res->Data.ExtendedIrq.Interrupts, + res->Data.ExtendedIrq.InterruptCount, + res->Data.ExtendedIrq.Triggering, res->Data.ExtendedIrq.Polarity); + break; + case ACPI_RESOURCE_TYPE_VENDOR: + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, + "unimplemented VendorSpecific resource\n")); + break; + default: + break; + } + return (AE_OK); +} + /* * Fetch a device's resources and associate them with the device. * @@ -153,318 +397,21 @@ ACPI_STATUS acpi_parse_resources(device_t dev, ACPI_HANDLE handle, struct acpi_parse_resource_set *set, void *arg) { - ACPI_BUFFER buf; - ACPI_RESOURCE *res; - char *curr, *last; + struct acpi_resource_context arc; ACPI_STATUS status; - void *context; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); - /* - * Special-case some devices that abuse _PRS/_CRS to mean - * something other than "I consume this resource". - * - * XXX do we really need this? It's only relevant once - * we start always-allocating these resources, and even - * then, the only special-cased device is likely to be - * the PCI interrupt link. - */ - - /* Fetch the device's current resources. */ - buf.Length = ACPI_ALLOCATE_BUFFER; - if (ACPI_FAILURE((status = AcpiGetCurrentResources(handle, &buf)))) { - if (status != AE_NOT_FOUND && status != AE_TYPE) - printf("can't fetch resources for %s - %s\n", - acpi_name(handle), AcpiFormatException(status)); + set->set_init(dev, arg, &arc.context); + arc.set = set; + arc.dev = dev; + status = AcpiWalkResources(handle, "_CRS", acpi_parse_resource, &arc); + if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { + printf("can't fetch resources for %s - %s\n", + acpi_name(handle), AcpiFormatException(status)); return_ACPI_STATUS (status); } - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s - got %ld bytes of resources\n", - acpi_name(handle), (long)buf.Length)); - set->set_init(dev, arg, &context); - - /* Iterate through the resources */ - curr = buf.Pointer; - last = (char *)buf.Pointer + buf.Length; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Wed Jun 22 20:04:39 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEB3F1065672; Wed, 22 Jun 2011 20:04:39 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A9E58FC12; Wed, 22 Jun 2011 20:04:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MK4dB5064825; Wed, 22 Jun 2011 20:04:39 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MK4dwX064819; Wed, 22 Jun 2011 20:04:39 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201106222004.p5MK4dwX064819@svn.freebsd.org> From: Attilio Rao Date: Wed, 22 Jun 2011 20:04:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223438 - in projects/largeSMP/sys/i386: i386 xen X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 20:04:39 -0000 Author: attilio Date: Wed Jun 22 20:04:39 2011 New Revision: 223438 URL: http://svn.freebsd.org/changeset/base/223438 Log: Remove pc_other_cpus usage from i386 and XEN. Tested by: pluknet Modified: projects/largeSMP/sys/i386/i386/mp_machdep.c projects/largeSMP/sys/i386/i386/pmap.c projects/largeSMP/sys/i386/i386/vm_machdep.c projects/largeSMP/sys/i386/xen/mp_machdep.c projects/largeSMP/sys/i386/xen/pmap.c Modified: projects/largeSMP/sys/i386/i386/mp_machdep.c ============================================================================== --- projects/largeSMP/sys/i386/i386/mp_machdep.c Wed Jun 22 20:00:27 2011 (r223437) +++ projects/largeSMP/sys/i386/i386/mp_machdep.c Wed Jun 22 20:04:39 2011 (r223438) @@ -658,7 +658,7 @@ cpu_mp_announce(void) void init_secondary(void) { - cpuset_t tcpuset, tallcpus; + cpuset_t tcpuset; struct pcpu *pc; vm_offset_t addr; int gsel_tss; @@ -790,11 +790,6 @@ init_secondary(void) if (cpu_logical > 1 && PCPU_GET(apic_id) % cpu_logical != 0) CPU_OR(&logical_cpus_mask, &tcpuset); - /* Build our map of 'other' CPUs. */ - tallcpus = all_cpus; - CPU_NAND(&tallcpus, &tcpuset); - PCPU_SET(other_cpus, tallcpus); - if (bootverbose) lapic_dump("AP"); @@ -934,7 +929,6 @@ assign_cpu_ids(void) static int start_all_aps(void) { - cpuset_t tallcpus; #ifndef PC98 u_char mpbiosreason; #endif @@ -997,11 +991,6 @@ start_all_aps(void) CPU_SET(cpu, &all_cpus); /* record AP in CPU map */ } - /* build our map of 'other' CPUs */ - tallcpus = all_cpus; - CPU_NAND(&tallcpus, PCPU_PTR(cpumask)); - PCPU_SET(other_cpus, tallcpus); - /* restore the warmstart vector */ *(u_int32_t *) WARMBOOT_OFF = mpbioswarmvec; @@ -1452,11 +1441,12 @@ ipi_cpu(int cpu, u_int ipi) void ipi_all_but_self(u_int ipi) { + cpuset_t other_cpus; - sched_pin(); + other_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); if (IPI_IS_BITMAPED(ipi)) { - ipi_selected(PCPU_GET(other_cpus), ipi); - sched_unpin(); + ipi_selected(other_cpus, ipi); return; } @@ -1466,8 +1456,7 @@ ipi_all_but_self(u_int ipi) * Set the mask of receiving CPUs for this purpose. */ if (ipi == IPI_STOP_HARD) - CPU_OR_ATOMIC(&ipi_nmi_pending, PCPU_PTR(other_cpus)); - sched_unpin(); + CPU_OR_ATOMIC(&ipi_nmi_pending, &other_cpus); CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); lapic_ipi_vectored(ipi, APIC_IPI_DEST_OTHERS); Modified: projects/largeSMP/sys/i386/i386/pmap.c ============================================================================== --- projects/largeSMP/sys/i386/i386/pmap.c Wed Jun 22 20:00:27 2011 (r223437) +++ projects/largeSMP/sys/i386/i386/pmap.c Wed Jun 22 20:04:39 2011 (r223438) @@ -932,16 +932,18 @@ pmap_update_pde_invalidate(vm_offset_t v void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { - cpuset_t cpumask, other_cpus; + cpuset_t other_cpus; + u_int cpuid; sched_pin(); if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) { invlpg(va); smp_invlpg(va); } else { - cpumask = PCPU_GET(cpumask); - other_cpus = PCPU_GET(other_cpus); - if (CPU_OVERLAP(&pmap->pm_active, &cpumask)) + cpuid = PCPU_GET(cpuid); + other_cpus = all_cpus; + CPU_CLR(cpuid, &other_cpus); + if (CPU_ISSET(cpuid, &pmap->pm_active)) invlpg(va); CPU_AND(&other_cpus, &pmap->pm_active); if (!CPU_EMPTY(&other_cpus)) @@ -953,8 +955,9 @@ pmap_invalidate_page(pmap_t pmap, vm_off void pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { - cpuset_t cpumask, other_cpus; + cpuset_t other_cpus; vm_offset_t addr; + u_int cpuid; sched_pin(); if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) { @@ -962,9 +965,10 @@ pmap_invalidate_range(pmap_t pmap, vm_of invlpg(addr); smp_invlpg_range(sva, eva); } else { - cpumask = PCPU_GET(cpumask); - other_cpus = PCPU_GET(other_cpus); - if (CPU_OVERLAP(&pmap->pm_active, &cpumask)) + cpuid = PCPU_GET(cpuid); + other_cpus = all_cpus; + CPU_CLR(cpuid, &other_cpus); + if (CPU_ISSET(cpuid, &pmap->pm_active)) for (addr = sva; addr < eva; addr += PAGE_SIZE) invlpg(addr); CPU_AND(&other_cpus, &pmap->pm_active); @@ -977,16 +981,18 @@ pmap_invalidate_range(pmap_t pmap, vm_of void pmap_invalidate_all(pmap_t pmap) { - cpuset_t cpumask, other_cpus; + cpuset_t other_cpus; + u_int cpuid; sched_pin(); if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) { invltlb(); smp_invltlb(); } else { - cpumask = PCPU_GET(cpumask); - other_cpus = PCPU_GET(other_cpus); - if (CPU_OVERLAP(&pmap->pm_active, &cpumask)) + cpuid = PCPU_GET(cpuid); + other_cpus = all_cpus; + CPU_CLR(cpuid, &other_cpus); + if (CPU_ISSET(cpuid, &pmap->pm_active)) invltlb(); CPU_AND(&other_cpus, &pmap->pm_active); if (!CPU_EMPTY(&other_cpus)) @@ -1055,12 +1061,8 @@ pmap_update_pde_teardown(void *arg) { struct pde_action *act = arg; - sched_pin(); - if (CPU_OVERLAP(&act->invalidate, PCPU_PTR(cpumask))) { - sched_unpin(); + if (CPU_ISSET(PCPU_GET(cpuid), &act->invalidate)) pmap_update_pde_invalidate(act->va, act->newpde); - } else - sched_unpin(); } /* @@ -1079,7 +1081,8 @@ pmap_update_pde(pmap_t pmap, vm_offset_t sched_pin(); cpumask = PCPU_GET(cpumask); - other_cpus = PCPU_GET(other_cpus); + other_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); if (pmap == kernel_pmap) active = all_cpus; else Modified: projects/largeSMP/sys/i386/i386/vm_machdep.c ============================================================================== --- projects/largeSMP/sys/i386/i386/vm_machdep.c Wed Jun 22 20:00:27 2011 (r223437) +++ projects/largeSMP/sys/i386/i386/vm_machdep.c Wed Jun 22 20:04:39 2011 (r223438) @@ -602,8 +602,8 @@ cpu_reset() u_int cnt; if (smp_active) { - sched_pin(); - map = PCPU_GET(other_cpus); + map = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &map); CPU_NAND(&map, &stopped_cpus); if (!CPU_EMPTY(&map)) { printf("cpu_reset: Stopping other CPUs\n"); @@ -612,7 +612,6 @@ cpu_reset() if (PCPU_GET(cpuid) != 0) { cpu_reset_proxyid = PCPU_GET(cpuid); - sched_unpin(); cpustop_restartfunc = cpu_reset_proxy; cpu_reset_proxy_active = 0; printf("cpu_reset: Restarting BSP\n"); @@ -632,8 +631,7 @@ cpu_reset() while (1); /* NOTREACHED */ - } else - sched_unpin(); + } DELAY(1000000); } @@ -802,7 +800,8 @@ sf_buf_alloc(struct vm_page *m, int flag struct sf_head *hash_list; struct sf_buf *sf; #ifdef SMP - cpuset_t cpumask, other_cpus; + cpuset_t other_cpus; + u_int cpuid; #endif int error; @@ -877,13 +876,14 @@ sf_buf_alloc(struct vm_page *m, int flag CPU_ZERO(&sf->cpumask); shootdown: sched_pin(); - cpumask = PCPU_GET(cpumask); - if (!CPU_OVERLAP(&cpumask, &sf->cpumask)) { - CPU_OR(&sf->cpumask, &cpumask); + cpuid = PCPU_GET(cpuid); + if (!CPU_ISSET(cpuid, &sf->cpumask)) { + CPU_SET(cpuid, &sf->cpumask); invlpg(sf->kva); } if ((flags & SFB_CPUPRIVATE) == 0) { - other_cpus = PCPU_GET(other_cpus); + other_cpus = all_cpus; + CPU_CLR(cpuid, &other_cpus); CPU_NAND(&other_cpus, &sf->cpumask); if (!CPU_EMPTY(&other_cpus)) { CPU_OR(&sf->cpumask, &other_cpus); Modified: projects/largeSMP/sys/i386/xen/mp_machdep.c ============================================================================== --- projects/largeSMP/sys/i386/xen/mp_machdep.c Wed Jun 22 20:00:27 2011 (r223437) +++ projects/largeSMP/sys/i386/xen/mp_machdep.c Wed Jun 22 20:04:39 2011 (r223438) @@ -523,7 +523,7 @@ xen_smp_intr_init_cpus(void *unused) void init_secondary(void) { - cpuset_t tcpuset, tallcpus; + cpuset_t tcpuset; vm_offset_t addr; int gsel_tss; @@ -613,11 +613,6 @@ init_secondary(void) if (hyperthreading_cpus > 1 && PCPU_GET(apic_id) % hyperthreading_cpus != 0) CPU_OR(&hyperthreading_cpus_mask, &tcpuset); - - /* Build our map of 'other' CPUs. */ - tallcpus = all_cpus; - CPU_NAND(&tallcpus, &tcpuset); - PCPU_SET(other_cpus, tallcpus); #if 0 if (bootverbose) lapic_dump("AP"); @@ -731,7 +726,6 @@ assign_cpu_ids(void) int start_all_aps(void) { - cpuset_t tallcpus; int x,apic_id, cpu; struct pcpu *pc; @@ -789,11 +783,6 @@ start_all_aps(void) } - /* build our map of 'other' CPUs */ - tallcpus = all_cpus; - CPU_NAND(&tallcpus, PCPU_PTR(cpumask)); - PCPU_SET(other_cpus, tallcpus); - pmap_invalidate_range(kernel_pmap, 0, NKPT * NBPDR - 1); /* number of APs actually started */ @@ -1184,9 +1173,8 @@ ipi_all_but_self(u_int ipi) * of help in order to understand what is the source. * Set the mask of receiving CPUs for this purpose. */ - sched_pin(); - other_cpus = PCPU_GET(other_cpus); - sched_unpin(); + other_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); if (ipi == IPI_STOP_HARD) CPU_OR_ATOMIC(&ipi_nmi_pending, &other_cpus); Modified: projects/largeSMP/sys/i386/xen/pmap.c ============================================================================== --- projects/largeSMP/sys/i386/xen/pmap.c Wed Jun 22 20:00:27 2011 (r223437) +++ projects/largeSMP/sys/i386/xen/pmap.c Wed Jun 22 20:04:39 2011 (r223438) @@ -813,7 +813,8 @@ pmap_invalidate_page(pmap_t pmap, vm_off smp_invlpg(va); } else { cpumask = PCPU_GET(cpumask); - other_cpus = PCPU_GET(other_cpus); + other_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); if (CPU_OVERLAP(&pmap->pm_active, &cpumask)) invlpg(va); CPU_AND(&other_cpus, &pmap->pm_active); @@ -840,7 +841,8 @@ pmap_invalidate_range(pmap_t pmap, vm_of smp_invlpg_range(sva, eva); } else { cpumask = PCPU_GET(cpumask); - other_cpus = PCPU_GET(other_cpus); + other_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); if (CPU_OVERLAP(&pmap->pm_active, &cpumask)) for (addr = sva; addr < eva; addr += PAGE_SIZE) invlpg(addr); @@ -865,7 +867,8 @@ pmap_invalidate_all(pmap_t pmap) smp_invltlb(); } else { cpumask = PCPU_GET(cpumask); - other_cpus = PCPU_GET(other_cpus); + other_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); if (CPU_OVERLAP(&pmap->pm_active, &cpumask)) invltlb(); CPU_AND(&other_cpus, &pmap->pm_active); From owner-svn-src-projects@FreeBSD.ORG Wed Jun 22 21:18:38 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33447106566B; Wed, 22 Jun 2011 21:18:38 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F0BC8FC08; Wed, 22 Jun 2011 21:18:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MLIcYj069074; Wed, 22 Jun 2011 21:18:38 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MLIbGX069071; Wed, 22 Jun 2011 21:18:37 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201106222118.p5MLIbGX069071@svn.freebsd.org> From: Jamie Gritton Date: Wed, 22 Jun 2011 21:18:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223442 - projects/jailconf/usr.sbin/jail X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2011 21:18:38 -0000 Author: jamie Date: Wed Jun 22 21:18:37 2011 New Revision: 223442 URL: http://svn.freebsd.org/changeset/base/223442 Log: Advance to the next command before running anything, so errors found in finish_command can be processed properly. Call failed() once in next_command() instead of multiple times in run_command(). Continue processing commands when a no-wait operation (IP__OP or background command) succeeds. Modified: projects/jailconf/usr.sbin/jail/command.c projects/jailconf/usr.sbin/jail/jail.c Modified: projects/jailconf/usr.sbin/jail/command.c ============================================================================== --- projects/jailconf/usr.sbin/jail/command.c Wed Jun 22 21:10:12 2011 (r223441) +++ projects/jailconf/usr.sbin/jail/command.c Wed Jun 22 21:18:37 2011 (r223442) @@ -88,14 +88,20 @@ int next_command(struct cfjail *j) { enum intparam comparam; - int rval, create_failed; + int create_failed; - rval = 0; + if (paralimit == 0) { + requeue(j, &runnable); + return 1; + } create_failed = (j->flags & (JF_STOP | JF_FAILED)) == JF_FAILED; - for (; (comparam = *j->comparam); - j->comparam += create_failed ? -1 : 1) { + comparam = *j->comparam; + for (;;) { if (j->comstring == NULL) { - switch (comparam) { + j->comparam += create_failed ? -1 : 1; + switch ((comparam = *j->comparam)) { + case 0: + return 0; case IP_MOUNT_DEVFS: if (!bool_param(j->intparams[IP_MOUNT_DEVFS])) continue; @@ -112,29 +118,25 @@ next_command(struct cfjail *j) cfstrings) : TAILQ_FIRST(&j->intparams[comparam]->val); } - } - for (; j->comstring != NULL; - j->comstring = j->comstring == &dummystring ? NULL : - create_failed - ? TAILQ_PREV(j->comstring, cfstrings, tq) - : TAILQ_NEXT(j->comstring, tq)) { - if (rval != 0) - return rval; - if (j->comstring->len == 0 || (create_failed && - (comparam == IP_EXEC_PRESTART || comparam == - IP_EXEC_START || comparam == IP_COMMAND || - comparam == IP_EXEC_POSTSTART))) - continue; - if (paralimit == 0) { - requeue(j, &runnable); - return 1; - } - rval = run_command(j); - create_failed = - (j->flags & (JF_STOP | JF_FAILED)) == JF_FAILED; + } else { + j->comstring = j->comstring == &dummystring ? NULL : + create_failed + ? TAILQ_PREV(j->comstring, cfstrings, tq) + : TAILQ_NEXT(j->comstring, tq); + } + if (j->comstring == NULL || j->comstring->len == 0 || + (create_failed && (comparam == IP_EXEC_PRESTART || + comparam == IP_EXEC_START || comparam == IP_COMMAND || + comparam == IP_EXEC_POSTSTART))) + continue; + switch (run_command(j)) { + case -1: + failed(j); + /* FALLTHROUGH */ + case 1: + return 1; } } - return rval; } /* @@ -178,7 +180,7 @@ finish_command(struct cfjail *j) } /* - * Check for finished processed or timeouts. + * Check for finished processes or timeouts. */ struct cfjail * next_proc(int nonblock) @@ -278,16 +280,13 @@ run_command(struct cfjail *j) else j->flags &= ~JF_PERSIST; } else { - if (create_jail(j) < 0) { - failed(j); + if (create_jail(j) < 0) return -1; - } if (verbose >= 0 && (j->name || verbose > 0)) jail_note(j, "created\n"); dep_done(j, DF_LIGHT); } - requeue(j, &ready); - return 1; + return 0; default: ; } @@ -383,14 +382,11 @@ run_command(struct cfjail *j) if (argc < 3) { jail_warnx(j, "%s: %s: missing information", j->intparams[comparam]->name, comstring->s); - failed(j); return -1; } if (check_path(j, j->intparams[comparam]->name, argv[1], 0, - down ? argv[2] : NULL) < 0) { - failed(j); + down ? argv[2] : NULL) < 0) return -1; - } if (down) { argv[4] = NULL; argv[3] = argv[1]; @@ -416,16 +412,13 @@ run_command(struct cfjail *j) path = string_param(j->intparams[KP_PATH]); if (path == NULL) { jail_warnx(j, "mount.devfs: no path"); - failed(j); return -1; } devpath = alloca(strlen(path) + 5); sprintf(devpath, "%s/dev", path); if (check_path(j, "mount.devfs", devpath, 0, - down ? "devfs" : NULL) < 0) { - failed(j); + down ? "devfs" : NULL) < 0) return -1; - } if (down) { argv = alloca(3 * sizeof(char *)); *(const char **)&argv[0] = "/sbin/umount"; @@ -509,15 +502,12 @@ run_command(struct cfjail *j) consfd = 0; if (injail && (conslog = string_param(j->intparams[IP_EXEC_CONSOLELOG]))) { - if (check_path(j, "exec.consolelog", conslog, 1, NULL) < 0) { - failed(j); + if (check_path(j, "exec.consolelog", conslog, 1, NULL) < 0) return -1; - } consfd = open(conslog, O_WRONLY | O_CREAT | O_APPEND, DEFFILEMODE); if (consfd < 0) { jail_warnx(j, "open %s: %s", conslog, strerror(errno)); - failed(j); return -1; } } @@ -545,12 +535,12 @@ run_command(struct cfjail *j) if (bg) { free(j->comline); j->comline = NULL; - requeue(j, &ready); + return 0; } else { paralimit--; add_proc(j, pid); + return 1; } - return 1; } if (bg) setsid(); Modified: projects/jailconf/usr.sbin/jail/jail.c ============================================================================== --- projects/jailconf/usr.sbin/jail/jail.c Wed Jun 22 21:10:12 2011 (r223441) +++ projects/jailconf/usr.sbin/jail/jail.c Wed Jun 22 21:18:37 2011 (r223442) @@ -404,7 +404,8 @@ main(int argc, char **argv) continue; if (j->jid > 0) goto jail_create_done; - j->comparam = startcommands + 1; + j->comparam = startcommands; + j->comstring = NULL; } if (next_command(j)) continue; @@ -447,7 +448,8 @@ main(int argc, char **argv) j->name); goto jail_remove_done; } - j->comparam = stopcommands + 1; + j->comparam = stopcommands; + j->comstring = NULL; } else if ((j->flags & JF_FAILED) && j->jid > 0) goto jail_remove_done; if (next_command(j)) From owner-svn-src-projects@FreeBSD.ORG Thu Jun 23 09:40:46 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF3E4106566B; Thu, 23 Jun 2011 09:40:46 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id A012D8FC13; Thu, 23 Jun 2011 09:40:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5N9ekvP092100; Thu, 23 Jun 2011 09:40:46 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N9ek2o092098; Thu, 23 Jun 2011 09:40:46 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201106230940.p5N9ek2o092098@svn.freebsd.org> From: Andreas Tobler Date: Thu, 23 Jun 2011 09:40:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223468 - projects/pseries/powerpc/pseries X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2011 09:40:46 -0000 Author: andreast Date: Thu Jun 23 09:40:46 2011 New Revision: 223468 URL: http://svn.freebsd.org/changeset/base/223468 Log: Make the result available to check against. Modified: projects/pseries/powerpc/pseries/mmu_phyp.c Modified: projects/pseries/powerpc/pseries/mmu_phyp.c ============================================================================== --- projects/pseries/powerpc/pseries/mmu_phyp.c Thu Jun 23 07:54:03 2011 (r223467) +++ projects/pseries/powerpc/pseries/mmu_phyp.c Thu Jun 23 09:40:46 2011 (r223468) @@ -207,7 +207,7 @@ mphyp_pte_change(mmu_t mmu, uintptr_t sl result = phyp_hcall(H_REMOVE, 0, slot, vpn); if (result != H_SUCCESS) panic("mphyp_pte_change() invalidation failure: %ld\n", result); - phyp_pft_hcall(H_ENTER, H_EXACT, slot, pvo_pt->pte_hi, + result = phyp_pft_hcall(H_ENTER, H_EXACT, slot, pvo_pt->pte_hi, pvo_pt->pte_lo, &index, &evicted.pte_lo, &junk); if (result != H_SUCCESS) panic("mphyp_pte_change() insertion failure: %ld\n", result); From owner-svn-src-projects@FreeBSD.ORG Fri Jun 24 14:03:12 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 051D01065673; Fri, 24 Jun 2011 14:03:12 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id E5BE18FC16; Fri, 24 Jun 2011 14:03:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5OE3B1h057125; Fri, 24 Jun 2011 14:03:11 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OE3BqB057097; Fri, 24 Jun 2011 14:03:11 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201106241403.p5OE3BqB057097@svn.freebsd.org> From: Andreas Tobler Date: Fri, 24 Jun 2011 14:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223503 - in projects/pseries: amd64/ia32 amd64/include amd64/pci boot/common boot/i386/libi386 boot/i386/zfsboot cam/ata cam/scsi cddl/contrib/opensolaris/uts/common/sys compat/freebsd... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2011 14:03:12 -0000 Author: andreast Date: Fri Jun 24 14:03:10 2011 New Revision: 223503 URL: http://svn.freebsd.org/changeset/base/223503 Log: MFC. Added: projects/pseries/dev/usb/template/usb_template_audio.c - copied unchanged from r223501, head/sys/dev/usb/template/usb_template_audio.c projects/pseries/dev/usb/template/usb_template_kbd.c - copied unchanged from r223501, head/sys/dev/usb/template/usb_template_kbd.c projects/pseries/dev/usb/template/usb_template_modem.c - copied unchanged from r223501, head/sys/dev/usb/template/usb_template_modem.c projects/pseries/dev/usb/template/usb_template_mouse.c - copied unchanged from r223501, head/sys/dev/usb/template/usb_template_mouse.c projects/pseries/fs/nfsclient/nfs_clkdtrace.c - copied unchanged from r223501, head/sys/fs/nfsclient/nfs_clkdtrace.c projects/pseries/fs/nfsclient/nfs_kdtrace.h - copied unchanged from r223501, head/sys/fs/nfsclient/nfs_kdtrace.h projects/pseries/modules/dtrace/dtnfscl/ - copied from r223501, head/sys/modules/dtrace/dtnfscl/ projects/pseries/powerpc/ps3/ohci_ps3.c - copied unchanged from r223501, head/sys/powerpc/ps3/ohci_ps3.c projects/pseries/powerpc/ps3/ps3disk.c - copied unchanged from r223501, head/sys/powerpc/ps3/ps3disk.c projects/pseries/x86/include/pci_cfgreg.h - copied unchanged from r223501, head/sys/x86/include/pci_cfgreg.h projects/pseries/x86/pci/pci_bus.c - copied unchanged from r223501, head/sys/x86/pci/pci_bus.c Deleted: projects/pseries/amd64/pci/pci_bus.c projects/pseries/i386/pci/pci_bus.c Modified: projects/pseries/amd64/ia32/ia32_sigtramp.S projects/pseries/amd64/include/pci_cfgreg.h projects/pseries/boot/common/load_elf_obj.c projects/pseries/boot/i386/libi386/biosacpi.c projects/pseries/boot/i386/zfsboot/zfsldr.S projects/pseries/cam/ata/ata_da.c projects/pseries/cam/ata/ata_xpt.c projects/pseries/cam/scsi/scsi_xpt.c projects/pseries/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h projects/pseries/compat/freebsd32/freebsd32_misc.c projects/pseries/compat/freebsd32/freebsd32_proto.h projects/pseries/compat/freebsd32/freebsd32_syscall.h projects/pseries/compat/freebsd32/freebsd32_syscalls.c projects/pseries/compat/freebsd32/freebsd32_sysent.c projects/pseries/compat/freebsd32/syscalls.master projects/pseries/compat/linprocfs/linprocfs.c projects/pseries/conf/files projects/pseries/conf/files.amd64 projects/pseries/conf/files.i386 projects/pseries/conf/files.pc98 projects/pseries/conf/files.powerpc projects/pseries/dev/acpica/acpi.c projects/pseries/dev/acpica/acpi_cpu.c projects/pseries/dev/acpica/acpi_pci.c projects/pseries/dev/acpica/acpi_pcib_acpi.c projects/pseries/dev/acpica/acpi_resource.c projects/pseries/dev/acpica/acpivar.h projects/pseries/dev/ath/ah_osdep.c projects/pseries/dev/ath/ath_hal/ah.h projects/pseries/dev/ath/ath_hal/ah_internal.h projects/pseries/dev/ath/ath_hal/ah_regdomain.c projects/pseries/dev/ath/ath_hal/ar5210/ar5210_attach.c projects/pseries/dev/ath/ath_hal/ar5210/ar5210_beacon.c projects/pseries/dev/ath/ath_hal/ar5211/ar5211_attach.c projects/pseries/dev/ath/ath_hal/ar5211/ar5211_beacon.c projects/pseries/dev/ath/ath_hal/ar5211/ar5211_xmit.c projects/pseries/dev/ath/ath_hal/ar5212/ar5112.c projects/pseries/dev/ath/ath_hal/ar5212/ar5212_attach.c projects/pseries/dev/ath/ath_hal/ar5212/ar5212_beacon.c projects/pseries/dev/ath/ath_hal/ar5212/ar5212_xmit.c projects/pseries/dev/ath/ath_hal/ar5312/ar5312_attach.c projects/pseries/dev/ath/ath_hal/ar5416/ar2133.c projects/pseries/dev/ath/ath_hal/ar5416/ar5416_attach.c projects/pseries/dev/ath/ath_hal/ar5416/ar5416_beacon.c projects/pseries/dev/ath/ath_hal/ar5416/ar5416_misc.c projects/pseries/dev/ath/ath_hal/ar5416/ar5416_xmit.c projects/pseries/dev/ath/ath_hal/ar9001/ar9130_attach.c projects/pseries/dev/ath/ath_hal/ar9001/ar9160_attach.c projects/pseries/dev/ath/ath_hal/ar9002/ar9280_attach.c projects/pseries/dev/ath/ath_hal/ar9002/ar9285_attach.c projects/pseries/dev/ath/ath_hal/ar9002/ar9287_attach.c projects/pseries/dev/ath/if_ath.c projects/pseries/dev/ath/if_ath_sysctl.c projects/pseries/dev/ath/if_ath_sysctl.h projects/pseries/dev/atkbdc/atkbd.c projects/pseries/dev/cardbus/cardbus_cis.c projects/pseries/dev/dc/if_dc.c projects/pseries/dev/e1000/if_igb.c projects/pseries/dev/e1000/if_igb.h projects/pseries/dev/firewire/fwohci.c projects/pseries/dev/pccbb/pccbb.c projects/pseries/dev/pccbb/pccbb_pci.c projects/pseries/dev/pci/pci.c projects/pseries/dev/sound/usb/uaudio.c projects/pseries/dev/usb/input/atp.c projects/pseries/dev/usb/input/uhid.c projects/pseries/dev/usb/net/if_aue.c projects/pseries/dev/usb/net/if_axe.c projects/pseries/dev/usb/net/if_cdce.c projects/pseries/dev/usb/net/if_cue.c projects/pseries/dev/usb/net/if_ipheth.c projects/pseries/dev/usb/net/if_kue.c projects/pseries/dev/usb/net/if_mos.c projects/pseries/dev/usb/net/if_rue.c projects/pseries/dev/usb/net/if_udav.c projects/pseries/dev/usb/net/uhso.c projects/pseries/dev/usb/serial/u3g.c projects/pseries/dev/usb/serial/uark.c projects/pseries/dev/usb/serial/ubsa.c projects/pseries/dev/usb/serial/uchcom.c projects/pseries/dev/usb/serial/ucycom.c projects/pseries/dev/usb/serial/uftdi.c projects/pseries/dev/usb/serial/ugensa.c projects/pseries/dev/usb/serial/uipaq.c projects/pseries/dev/usb/serial/ulpt.c projects/pseries/dev/usb/serial/umcs.c projects/pseries/dev/usb/serial/umct.c projects/pseries/dev/usb/serial/umodem.c projects/pseries/dev/usb/serial/umoscom.c projects/pseries/dev/usb/serial/uplcom.c projects/pseries/dev/usb/serial/uslcom.c projects/pseries/dev/usb/serial/uvisor.c projects/pseries/dev/usb/serial/uvscom.c projects/pseries/dev/usb/storage/umass.c projects/pseries/dev/usb/template/usb_template.c projects/pseries/dev/usb/template/usb_template.h projects/pseries/dev/usb/template/usb_template_cdce.c projects/pseries/dev/usb/template/usb_template_msc.c projects/pseries/dev/usb/template/usb_template_mtp.c projects/pseries/dev/usb/usb_hub.c projects/pseries/dev/usb/usb_ioctl.h projects/pseries/dev/usb/usb_lookup.c projects/pseries/dev/usb/usbdevs projects/pseries/dev/usb/usbdi.h projects/pseries/dev/usb/wlan/if_rum.c projects/pseries/dev/usb/wlan/if_run.c projects/pseries/dev/usb/wlan/if_uath.c projects/pseries/dev/usb/wlan/if_upgt.c projects/pseries/dev/usb/wlan/if_ural.c projects/pseries/dev/usb/wlan/if_urtw.c projects/pseries/dev/usb/wlan/if_zyd.c projects/pseries/dev/vr/if_vr.c projects/pseries/dev/vr/if_vrreg.h projects/pseries/dev/xl/if_xl.c projects/pseries/fs/nfs/nfs_commonkrpc.c projects/pseries/fs/nfs/nfsport.h projects/pseries/fs/nfs/nfsproto.h projects/pseries/fs/nfsclient/nfs_clbio.c projects/pseries/fs/nfsclient/nfs_clkrpc.c projects/pseries/fs/nfsclient/nfs_clnode.c projects/pseries/fs/nfsclient/nfs_clport.c projects/pseries/fs/nfsclient/nfs_clsubs.c projects/pseries/fs/nfsclient/nfs_clvnops.c projects/pseries/fs/nfsserver/nfs_nfsdcache.c projects/pseries/fs/nfsserver/nfs_nfsdkrpc.c projects/pseries/fs/nfsserver/nfs_nfsdserv.c projects/pseries/fs/nfsserver/nfs_nfsdsocket.c projects/pseries/geom/part/g_part_bsd.c projects/pseries/i386/include/param.h projects/pseries/i386/include/pci_cfgreg.h projects/pseries/ia64/conf/NOTES projects/pseries/ia64/ia64/busdma_machdep.c projects/pseries/ia64/ia64/machdep.c projects/pseries/ia64/ia64/pmap.c projects/pseries/ia64/include/ia64_cpu.h projects/pseries/kern/imgact_aout.c projects/pseries/kern/kern_clocksource.c projects/pseries/kern/sys_process.c projects/pseries/kgssapi/gss_impl.c projects/pseries/modules/Makefile projects/pseries/modules/cxgbe/if_cxgbe/Makefile projects/pseries/modules/dtrace/Makefile projects/pseries/modules/dtrace/dtraceall/dtraceall.c projects/pseries/modules/kgssapi_krb5/Makefile projects/pseries/modules/nfscl/Makefile projects/pseries/modules/nfscommon/Makefile projects/pseries/modules/usb/template/Makefile projects/pseries/net/if_gre.c projects/pseries/net/if_gre.h projects/pseries/net/route.c projects/pseries/net/route.h projects/pseries/net80211/ieee80211_ht.c projects/pseries/net80211/ieee80211_var.h projects/pseries/netgraph/bluetooth/drivers/ubt/ng_ubt.c projects/pseries/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c projects/pseries/netgraph/ng_ether.c projects/pseries/netinet/if_ether.c projects/pseries/netinet/ipfw/ip_dn_io.c projects/pseries/netinet/ipfw/ip_fw_pfil.c projects/pseries/netinet/libalias/alias_db.c projects/pseries/netinet/libalias/alias_ftp.c projects/pseries/netinet/libalias/alias_local.h projects/pseries/netinet/libalias/libalias.3 projects/pseries/netinet/sctp.h projects/pseries/netinet/sctp_uio.h projects/pseries/netinet/sctp_usrreq.c projects/pseries/netinet/tcp_output.c projects/pseries/nfsclient/nfs_krpc.c projects/pseries/nfsserver/nfs_srvkrpc.c projects/pseries/powerpc/aim/copyinout.c projects/pseries/powerpc/aim/locore32.S projects/pseries/powerpc/aim/locore64.S projects/pseries/powerpc/aim/machdep.c projects/pseries/powerpc/aim/mmu_oea64.c projects/pseries/powerpc/aim/mp_cpudep.c projects/pseries/powerpc/aim/swtch32.S projects/pseries/powerpc/aim/swtch64.S projects/pseries/powerpc/aim/trap.c projects/pseries/powerpc/aim/trap_subr32.S projects/pseries/powerpc/aim/trap_subr64.S projects/pseries/powerpc/booke/copyinout.c projects/pseries/powerpc/booke/interrupt.c projects/pseries/powerpc/booke/trap.c projects/pseries/powerpc/include/pcpu.h projects/pseries/powerpc/ofw/ofwcall32.S projects/pseries/powerpc/powerpc/db_trace.c projects/pseries/powerpc/powerpc/mp_machdep.c projects/pseries/powerpc/ps3/if_glc.c projects/pseries/powerpc/ps3/ps3-hvcall.h projects/pseries/powerpc/ps3/ps3-hvcall.master projects/pseries/powerpc/ps3/ps3bus.c projects/pseries/powerpc/ps3/ps3bus.h projects/pseries/powerpc/ps3/ps3pic.c projects/pseries/rpc/rpc_generic.c projects/pseries/rpc/rpcsec_gss.h projects/pseries/sparc64/include/tsb.h projects/pseries/sparc64/include/vmparam.h projects/pseries/sparc64/sparc64/intr_machdep.c projects/pseries/sparc64/sparc64/mp_machdep.c projects/pseries/sparc64/sparc64/pmap.c projects/pseries/sparc64/sparc64/tlb.c projects/pseries/sys/diskpc98.h projects/pseries/sys/dtrace_bsd.h projects/pseries/sys/param.h projects/pseries/sys/systm.h projects/pseries/ufs/ffs/ffs_alloc.c projects/pseries/ufs/ffs/ffs_extern.h projects/pseries/ufs/ffs/ffs_snapshot.c projects/pseries/ufs/ffs/ffs_softdep.c projects/pseries/vm/vm_fault.c projects/pseries/vm/vm_page.c projects/pseries/vm/vm_page.h projects/pseries/x86/x86/tsc.c Directory Properties: projects/pseries/ (props changed) projects/pseries/amd64/include/xen/ (props changed) projects/pseries/boot/ (props changed) projects/pseries/boot/i386/efi/ (props changed) projects/pseries/boot/ia64/efi/ (props changed) projects/pseries/boot/ia64/ski/ (props changed) projects/pseries/boot/powerpc/boot1.chrp/ (props changed) projects/pseries/boot/powerpc/ofw/ (props changed) projects/pseries/cddl/contrib/opensolaris/ (props changed) projects/pseries/conf/ (props changed) projects/pseries/contrib/dev/acpica/ (props changed) projects/pseries/contrib/octeon-sdk/ (props changed) projects/pseries/contrib/pf/ (props changed) projects/pseries/contrib/x86emu/ (props changed) Modified: projects/pseries/amd64/ia32/ia32_sigtramp.S ============================================================================== --- projects/pseries/amd64/ia32/ia32_sigtramp.S Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/amd64/ia32/ia32_sigtramp.S Fri Jun 24 14:03:10 2011 (r223503) @@ -79,8 +79,20 @@ ia32_osigcode: jmp 1b +/* + * The lcall $7,$0 emulator cannot use the call gate that does an + * inter-privilege transition. The reason is that the call gate + * does not disable interrupts, and, before the swapgs is + * executed, we would have a window where the ring 0 code is + * executed with the wrong gsbase. + * + * Instead, reflect the lcall $7,$0 back to ring 3 trampoline + * which sets up the frame for int $0x80. + */ ALIGN_TEXT lcall_tramp: + cmpl $SYS_vfork,%eax + je 2f pushl %ebp movl %esp,%ebp pushl 0x24(%ebp) /* arg 6 */ @@ -91,8 +103,19 @@ lcall_tramp: pushl 0x10(%ebp) /* arg 1 */ pushl 0xc(%ebp) /* gap */ int $0x80 - leave + leavel +1: lretl +2: + /* + * vfork handling is special and relies on the libc stub saving + * the return ip in %ecx. If vfork failed, then there is no + * child which can corrupt the frame created by call gate. + */ + int $0x80 + jb 1b + addl $8,%esp + jmpl *%ecx #endif ALIGN_TEXT Modified: projects/pseries/amd64/include/pci_cfgreg.h ============================================================================== --- projects/pseries/amd64/include/pci_cfgreg.h Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/amd64/include/pci_cfgreg.h Fri Jun 24 14:03:10 2011 (r223503) @@ -1,43 +1,6 @@ /*- - * Copyright (c) 1997, Stefan Esser - * 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 ``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 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$ - * + * This file is in the public domain. */ +/* $FreeBSD$ */ -#define CONF1_ADDR_PORT 0x0cf8 -#define CONF1_DATA_PORT 0x0cfc - -#define CONF1_ENABLE 0x80000000ul -#define CONF1_ENABLE_CHK 0x80000000ul -#define CONF1_ENABLE_MSK 0x7f000000ul -#define CONF1_ENABLE_CHK1 0xff000001ul -#define CONF1_ENABLE_MSK1 0x80000001ul -#define CONF1_ENABLE_RES1 0x80000000ul - -int pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus); -int pci_cfgregopen(void); -u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes); -void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes); +#include Modified: projects/pseries/boot/common/load_elf_obj.c ============================================================================== --- projects/pseries/boot/common/load_elf_obj.c Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/boot/common/load_elf_obj.c Fri Jun 24 14:03:10 2011 (r223503) @@ -196,7 +196,7 @@ static int __elfN(obj_loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off) { Elf_Ehdr *hdr; - Elf_Shdr *shdr; + Elf_Shdr *shdr, *cshdr, *lshdr; vm_offset_t firstaddr, lastaddr; int i, nsym, res, ret, shdrbytes, symstrindex; @@ -294,12 +294,35 @@ __elfN(obj_loadimage)(struct preloaded_f /* Clear the whole area, including bss regions. */ kern_bzero(firstaddr, lastaddr - firstaddr); - /* Now read it all in. */ - for (i = 0; i < hdr->e_shnum; i++) { - if (shdr[i].sh_addr == 0 || shdr[i].sh_type == SHT_NOBITS) - continue; - if (kern_pread(ef->fd, (vm_offset_t)shdr[i].sh_addr, - shdr[i].sh_size, (off_t)shdr[i].sh_offset) != 0) { + /* Figure section with the lowest file offset we haven't loaded yet. */ + for (cshdr = NULL; /* none */; /* none */) + { + /* + * Find next section to load. The complexity of this loop is + * O(n^2), but with the number of sections being typically + * small, we do not care. + */ + lshdr = cshdr; + + for (i = 0; i < hdr->e_shnum; i++) { + if (shdr[i].sh_addr == 0 || + shdr[i].sh_type == SHT_NOBITS) + continue; + /* Skip sections that were loaded already. */ + if (lshdr != NULL && + lshdr->sh_offset >= shdr[i].sh_offset) + continue; + /* Find section with smallest offset. */ + if (cshdr == lshdr || + cshdr->sh_offset > shdr[i].sh_offset) + cshdr = &shdr[i]; + } + + if (cshdr == lshdr) + break; + + if (kern_pread(ef->fd, (vm_offset_t)cshdr->sh_addr, + cshdr->sh_size, (off_t)cshdr->sh_offset) != 0) { printf("\nelf" __XSTRING(__ELF_WORD_SIZE) "_obj_loadimage: read failed\n"); goto out; Modified: projects/pseries/boot/i386/libi386/biosacpi.c ============================================================================== --- projects/pseries/boot/i386/libi386/biosacpi.c Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/boot/i386/libi386/biosacpi.c Fri Jun 24 14:03:10 2011 (r223503) @@ -61,7 +61,7 @@ biosacpi_detect(void) return; /* export values from the RSDP */ - sprintf(buf, "%p", VTOP(rsdp)); + sprintf(buf, "%u", VTOP(rsdp)); setenv("hint.acpi.0.rsdp", buf, 1); revision = rsdp->Revision; if (revision == 0) Modified: projects/pseries/boot/i386/zfsboot/zfsldr.S ============================================================================== --- projects/pseries/boot/i386/zfsboot/zfsldr.S Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/boot/i386/zfsboot/zfsldr.S Fri Jun 24 14:03:10 2011 (r223503) @@ -16,7 +16,6 @@ */ /* Memory Locations */ - .set MEM_REL,0x700 # Relocation address .set MEM_ARG,0x900 # Arguments .set MEM_ORG,0x7c00 # Origin .set MEM_BUF,0x8000 # Load area @@ -91,26 +90,18 @@ main: cld # String ops inc mov %cx,%ss # Set up mov $start,%sp # stack /* - * Relocate ourself to MEM_REL. Since %cx == 0, the inc %ch sets - * %cx == 0x100. - */ - mov %sp,%si # Source - mov $MEM_REL,%di # Destination - incb %ch # Word count - rep # Copy - movsw # code -/* * If we are on a hard drive, then load the MBR and look for the first * FreeBSD slice. We use the fake partition entry below that points to * the MBR when we call nread. The first pass looks for the first active * FreeBSD slice. The second pass looks for the first non-active FreeBSD * slice if the first one fails. */ - mov $part4,%si # Partition + mov $part4,%si # Dummy partition cmpb $0x80,%dl # Hard drive? jb main.4 # No - movb $0x1,%dh # Block count - callw nread # Read MBR + xor %eax,%eax # Read MBR + movl $MEM_BUF,%ebx # from first + callw nread # sector mov $0x1,%cx # Two passes main.1: mov $MEM_BUF+PRT_OFF,%si # Partition table movb $0x1,%dh # Partition @@ -139,52 +130,51 @@ main.4: xor %dx,%dx # Partition:drive /* * Ok, we have a slice and drive in %dx now, so use that to locate and * load boot2. %si references the start of the slice we are looking - * for, so go ahead and load up the 64 sectors starting at sector 1024 + * for, so go ahead and load up the 128 sectors starting at sector 1024 * (i.e. after the two vdev labels). We don't have do anything fancy * here to allow for an extra copy of boot1 and a partition table * (compare to this section of the UFS bootstrap) so we just load it - * all at 0x8000. The first part of boot2 is BTX, which wants to run + * all at 0x9000. The first part of boot2 is BTX, which wants to run * at 0x9000. The boot2.bin binary starts right after the end of BTX, * so we have to figure out where the start of it is and then move the - * binary to 0xc000. After we have moved the client, we relocate BTX - * itself to 0x9000 - doing it in this order means that none of the - * memcpy regions overlap which would corrupt the copy. Normally, BTX - * clients start at MEM_USR, or 0xa000, but when we use btxld to - * create zfsboot2, we use an entry point of 0x2000. That entry point is - * relative to MEM_USR; thus boot2.bin starts at 0xc000. + * binary to 0xc000. Normally, BTX clients start at MEM_USR, or 0xa000, + * but when we use btxld to create zfsboot2, we use an entry point of + * 0x2000. That entry point is relative to MEM_USR; thus boot2.bin + * starts at 0xc000. * * The load area and the target area for the client overlap so we have * to use a decrementing string move. We also play segment register * games with the destination address for the move so that the client * can be larger than 16k (which would overflow the zero segment since - * the client starts at 0xc000). Relocating BTX is easy since the load - * area and target area do not overlap. + * the client starts at 0xc000). */ main.5: mov %dx,MEM_ARG # Save args - movb $NSECT,%dh # Sector count + mov $NSECT,%cx # Sector count movl $1024,%eax # Offset to boot2 - callw nread.1 # Read disk -main.6: mov $MEM_BUF,%si # BTX (before reloc) - mov 0xa(%si),%bx # Get BTX length and set + mov $MEM_BTX,%ebx # Destination buffer +main.6: pushal # Save params + callw nread # Read disk + popal # Restore + incl %eax # Advance to + add $SIZ_SEC,%ebx # next sector + loop main.6 # If not last, read another + mov MEM_BTX+0xa,%bx # Get BTX length mov $NSECT*SIZ_SEC-1,%di # Size of load area (less one) - mov %di,%si # End of load - add $MEM_BUF,%si # area + mov %di,%si # End of load area, 0x9000 rel sub %bx,%di # End of client, 0xc000 rel mov %di,%cx # Size of inc %cx # client + mov $(MEM_BTX)>>4,%dx # Segment + mov %dx,%ds # addressing 0x9000 mov $(MEM_USR+2*SIZ_PAG)>>4,%dx # Segment mov %dx,%es # addressing 0xc000 std # Move with decrement rep # Relocate movsb # client - mov %ds,%dx # Back to - mov %dx,%es # zero segment - mov $MEM_BUF,%si # BTX (before reloc) - mov $MEM_BTX,%di # BTX - mov %bx,%cx # Get BTX length - cld # Increment this time - rep # Relocate - movsb # BTX + cld # Back to increment + xor %dx,%dx # Back + mov %ds,%dx # to zero + mov %dx,%es # segment /* * Enable A20 so we can access memory above 1 meg. @@ -211,32 +201,35 @@ seta20.3: sti # Enable interrupts /* * Trampoline used to call read from within zfsldr. Sets up an EDD - * packet on the stack and passes it to read. + * packet on the stack and passes it to read. We assume that the + * destination address is always segment-aligned. * * %eax - int - LBA to read in relative to partition start + * %ebx - ptr - destination address * %dl - byte - drive to read from - * %dh - byte - num sectors to read * %si - ptr - MBR partition entry */ -nread: xor %eax,%eax # Sector offset in partition -nread.1: xor %ecx,%ecx # Get +nread: xor %ecx,%ecx # Get addl 0x8(%si),%eax # LBA adc $0,%ecx pushl %ecx # Starting absolute block pushl %eax # block number - push %es # Address of - push $MEM_BUF # transfer buffer - xor %ax,%ax # Number of - movb %dh,%al # blocks to - push %ax # transfer + shr $4,%ebx # Convert to segment + push %bx # Address of + push $0 # transfer buffer + push $0x1 # Read 1 sector push $0x10 # Size of packet mov %sp,%bp # Packet pointer callw read # Read from disk + jc nread.1 # If error, fail lea 0x10(%bp),%sp # Clear stack - jnc return # If success, return - mov $msg_read,%si # Otherwise, set the error - # message and fall through to - # the error routine + ret # If success, return +nread.1: mov %ah,%al # Format + mov $read_err,%di # error + call hex8 # code + mov $msg_read,%si # Set the error message and + # fall through to the error + # routine /* * Print out the error message pointed to by %ds:(%si) followed * by a prompt, wait for a keypress, and then reboot the machine. @@ -259,14 +252,6 @@ putstr: lodsb # Get char jne putstr.0 # No /* - * Overused return code. ereturn is used to return an error from the - * read function. Since we assume putstr succeeds, we (ab)use the - * same code when we return from putstr. - */ -ereturn: movb $0x1,%ah # Invalid - stc # argument -return: retw # To caller -/* * Reads sectors from the disk. If EDD is enabled, then check if it is * installed and use it if it is. If it is not installed or not enabled, then * fall back to using CHS. Since we use a LBA, if we are using CHS, we have to @@ -294,14 +279,30 @@ read: cmpb $0x80,%dl # Hard drive? retw # To caller read.1: mov $msg_chs,%si jmp error -msg_chs: .asciz "CHS not supported" + +/* + * AL to hex, saving the result to [EDI]. + */ +hex8: push %ax # Save + shrb $0x4,%al # Do upper + call hex8.1 # 4 + pop %ax # Restore +hex8.1: andb $0xf,%al # Get lower 4 + cmpb $0xa,%al # Convert + sbbb $0x69,%al # to hex + das # digit + orb $0x20,%al # To lower case + stosb # Save char + ret # (Recursive) /* Messages */ -msg_read: .asciz "Read" -msg_part: .asciz "Boot" +msg_chs: .asciz "CHS not supported" +msg_read: .ascii "Read error: " +read_err: .asciz "XX" +msg_part: .asciz "Boot error" -prompt: .asciz " error\r\n" +prompt: .asciz "\r\n" .org PRT_OFF,0x90 Modified: projects/pseries/cam/ata/ata_da.c ============================================================================== --- projects/pseries/cam/ata/ata_da.c Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/cam/ata/ata_da.c Fri Jun 24 14:03:10 2011 (r223503) @@ -818,7 +818,7 @@ adagetattr(struct bio *bp) int ret = -1; struct cam_periph *periph; - if (bp->bio_disk == NULL || bp->bio_disk->d_drv1) + if (bp->bio_disk == NULL || bp->bio_disk->d_drv1 == NULL) return ENXIO; periph = (struct cam_periph *)bp->bio_disk->d_drv1; if (periph->path == NULL) Modified: projects/pseries/cam/ata/ata_xpt.c ============================================================================== --- projects/pseries/cam/ata/ata_xpt.c Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/cam/ata/ata_xpt.c Fri Jun 24 14:03:10 2011 (r223503) @@ -1601,6 +1601,34 @@ ata_device_transport(struct cam_path *pa } static void +ata_dev_advinfo(union ccb *start_ccb) +{ + struct cam_ed *device; + struct ccb_dev_advinfo *cdai; + off_t amt; + + start_ccb->ccb_h.status = CAM_REQ_INVALID; + device = start_ccb->ccb_h.path->device; + cdai = &start_ccb->cdai; + switch(cdai->buftype) { + case CDAI_TYPE_SERIAL_NUM: + if (cdai->flags & CDAI_FLAG_STORE) + break; + start_ccb->ccb_h.status = CAM_REQ_CMP; + cdai->provsiz = device->serial_num_len; + if (device->serial_num_len == 0) + break; + amt = device->serial_num_len; + if (cdai->provsiz > cdai->bufsiz) + amt = cdai->bufsiz; + memcpy(cdai->buf, device->serial_num, amt); + break; + default: + break; + } +} + +static void ata_action(union ccb *start_ccb) { @@ -1650,7 +1678,13 @@ ata_action(union ccb *start_ccb) xpt_done(start_ccb); break; } - /* FALLTHROUGH */ + xpt_action_default(start_ccb); + break; + } + case XPT_DEV_ADVINFO: + { + ata_dev_advinfo(start_ccb); + break; } default: xpt_action_default(start_ccb); Modified: projects/pseries/cam/scsi/scsi_xpt.c ============================================================================== --- projects/pseries/cam/scsi/scsi_xpt.c Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/cam/scsi/scsi_xpt.c Fri Jun 24 14:03:10 2011 (r223503) @@ -2440,12 +2440,13 @@ scsi_dev_advinfo(union ccb *start_ccb) struct ccb_dev_advinfo *cdai; off_t amt; + start_ccb->ccb_h.status = CAM_REQ_INVALID; device = start_ccb->ccb_h.path->device; cdai = &start_ccb->cdai; switch(cdai->buftype) { case CDAI_TYPE_SCSI_DEVID: if (cdai->flags & CDAI_FLAG_STORE) - break; + return; cdai->provsiz = device->device_id_len; if (device->device_id_len == 0) break; @@ -2456,7 +2457,7 @@ scsi_dev_advinfo(union ccb *start_ccb) break; case CDAI_TYPE_SERIAL_NUM: if (cdai->flags & CDAI_FLAG_STORE) - break; + return; cdai->provsiz = device->serial_num_len; if (device->serial_num_len == 0) break; @@ -2490,7 +2491,7 @@ scsi_dev_advinfo(union ccb *start_ccb) } break; default: - break; + return; } start_ccb->ccb_h.status = CAM_REQ_CMP; Modified: projects/pseries/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h ============================================================================== --- projects/pseries/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h Fri Jun 24 14:03:10 2011 (r223503) @@ -65,7 +65,7 @@ typedef long ctf_id_t; * filling in ctf_sect_t structures and passing them to ctf_bufopen(): */ typedef struct ctf_sect { - char *cts_name; /* section name (if any) */ + const char *cts_name; /* section name (if any) */ ulong_t cts_type; /* section type (ELF SHT_... value) */ ulong_t cts_flags; /* section flags (ELF SHF_... value) */ #if defined(sun) Modified: projects/pseries/compat/freebsd32/freebsd32_misc.c ============================================================================== --- projects/pseries/compat/freebsd32/freebsd32_misc.c Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/compat/freebsd32/freebsd32_misc.c Fri Jun 24 14:03:10 2011 (r223503) @@ -1416,6 +1416,19 @@ freebsd32_pwrite(struct thread *td, stru return (pwrite(td, &ap)); } +#ifdef COMPAT_43 +int +ofreebsd32_lseek(struct thread *td, struct ofreebsd32_lseek_args *uap) +{ + struct lseek_args nuap; + + nuap.fd = uap->fd; + nuap.offset = uap->offset; + nuap.whence = uap->whence; + return (lseek(td, &nuap)); +} +#endif + int freebsd32_lseek(struct thread *td, struct freebsd32_lseek_args *uap) { Modified: projects/pseries/compat/freebsd32/freebsd32_proto.h ============================================================================== --- projects/pseries/compat/freebsd32/freebsd32_proto.h Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/compat/freebsd32/freebsd32_proto.h Fri Jun 24 14:03:10 2011 (r223503) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 223166 2011-06-16 22:05:56Z kib */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -690,6 +690,11 @@ int freebsd32_posix_fallocate(struct thr #if !defined(PAD64_REQUIRED) && defined(__powerpc__) #define PAD64_REQUIRED #endif +struct ofreebsd32_lseek_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset_l_[PADL_(int)]; int offset; char offset_r_[PADR_(int)]; + char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)]; +}; struct ofreebsd32_stat_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char ub_l_[PADL_(struct ostat32 *)]; struct ostat32 * ub; char ub_r_[PADR_(struct ostat32 *)]; @@ -747,6 +752,7 @@ struct ofreebsd32_getdirentries_args { #ifdef PAD64_REQUIRED #else #endif +int ofreebsd32_lseek(struct thread *, struct ofreebsd32_lseek_args *); int ofreebsd32_stat(struct thread *, struct ofreebsd32_stat_args *); int ofreebsd32_lstat(struct thread *, struct ofreebsd32_lstat_args *); int ofreebsd32_sigaction(struct thread *, struct ofreebsd32_sigaction_args *); @@ -923,6 +929,7 @@ int freebsd7_freebsd32_shmctl(struct thr #define FREEBSD32_SYS_AUE_freebsd32_wait4 AUE_WAIT4 #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_getfsstat AUE_GETFSSTAT +#define FREEBSD32_SYS_AUE_ofreebsd32_lseek AUE_LSEEK #define FREEBSD32_SYS_AUE_freebsd32_recvmsg AUE_RECVMSG #define FREEBSD32_SYS_AUE_freebsd32_sendmsg AUE_SENDMSG #define FREEBSD32_SYS_AUE_freebsd32_recvfrom AUE_RECVFROM Modified: projects/pseries/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- projects/pseries/compat/freebsd32/freebsd32_syscall.h Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/compat/freebsd32/freebsd32_syscall.h Fri Jun 24 14:03:10 2011 (r223503) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 223166 2011-06-16 22:05:56Z kib */ #define FREEBSD32_SYS_syscall 0 @@ -25,7 +25,7 @@ #define FREEBSD32_SYS_chown 16 #define FREEBSD32_SYS_break 17 #define FREEBSD32_SYS_freebsd4_freebsd32_getfsstat 18 - /* 19 is obsolete olseek */ + /* 19 is old freebsd32_lseek */ #define FREEBSD32_SYS_getpid 20 #define FREEBSD32_SYS_mount 21 #define FREEBSD32_SYS_unmount 22 Modified: projects/pseries/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- projects/pseries/compat/freebsd32/freebsd32_syscalls.c Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/compat/freebsd32/freebsd32_syscalls.c Fri Jun 24 14:03:10 2011 (r223503) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 223166 2011-06-16 22:05:56Z kib */ const char *freebsd32_syscallnames[] = { @@ -29,7 +29,7 @@ const char *freebsd32_syscallnames[] = { "chown", /* 16 = chown */ "break", /* 17 = break */ "compat4.freebsd32_getfsstat", /* 18 = freebsd4 freebsd32_getfsstat */ - "obs_olseek", /* 19 = obsolete olseek */ + "compat.freebsd32_lseek", /* 19 = old freebsd32_lseek */ "getpid", /* 20 = getpid */ "mount", /* 21 = mount */ "unmount", /* 22 = unmount */ Modified: projects/pseries/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- projects/pseries/compat/freebsd32/freebsd32_sysent.c Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/compat/freebsd32/freebsd32_sysent.c Fri Jun 24 14:03:10 2011 (r223503) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 223166 2011-06-16 22:05:56Z kib */ #include "opt_compat.h" @@ -66,7 +66,7 @@ struct sysent freebsd32_sysent[] = { { AS(chown_args), (sy_call_t *)chown, AUE_CHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 16 = chown */ { AS(obreak_args), (sy_call_t *)obreak, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 17 = break */ { compat4(AS(freebsd4_freebsd32_getfsstat_args),freebsd32_getfsstat), AUE_GETFSSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 18 = freebsd4 freebsd32_getfsstat */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 19 = obsolete olseek */ + { compat(AS(ofreebsd32_lseek_args),freebsd32_lseek), AUE_LSEEK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 19 = old freebsd32_lseek */ { 0, (sy_call_t *)getpid, AUE_GETPID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 20 = getpid */ { AS(mount_args), (sy_call_t *)mount, AUE_MOUNT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 21 = mount */ { AS(unmount_args), (sy_call_t *)unmount, AUE_UMOUNT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 22 = unmount */ Modified: projects/pseries/compat/freebsd32/syscalls.master ============================================================================== --- projects/pseries/compat/freebsd32/syscalls.master Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/compat/freebsd32/syscalls.master Fri Jun 24 14:03:10 2011 (r223503) @@ -89,7 +89,8 @@ 18 AUE_GETFSSTAT COMPAT4 { int freebsd32_getfsstat( \ struct statfs32 *buf, long bufsize, \ int flags); } -19 AUE_LSEEK OBSOL olseek +19 AUE_LSEEK COMPAT { int freebsd32_lseek(int fd, int offset, \ + int whence); } 20 AUE_GETPID NOPROTO { pid_t getpid(void); } 21 AUE_MOUNT NOPROTO { int mount(char *type, char *path, \ int flags, caddr_t data); } Modified: projects/pseries/compat/linprocfs/linprocfs.c ============================================================================== --- projects/pseries/compat/linprocfs/linprocfs.c Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/compat/linprocfs/linprocfs.c Fri Jun 24 14:03:10 2011 (r223503) @@ -1049,6 +1049,15 @@ linprocfs_doproccmdline(PFS_FILL_ARGS) PROC_UNLOCK(p); return (ret); } + + /* + * Mimic linux behavior and pass only processes with usermode + * address space as valid. Return zero silently otherwize. + */ + if (p->p_vmspace == &vmspace0) { + PROC_UNLOCK(p); + return (0); + } if (p->p_args != NULL) { sbuf_bcpy(sb, p->p_args->ar_args, p->p_args->ar_length); PROC_UNLOCK(p); @@ -1073,6 +1082,15 @@ linprocfs_doprocenviron(PFS_FILL_ARGS) PROC_UNLOCK(p); return (ret); } + + /* + * Mimic linux behavior and pass only processes with usermode + * address space as valid. Return zero silently otherwize. + */ + if (p->p_vmspace == &vmspace0) { + PROC_UNLOCK(p); + return (0); + } PROC_UNLOCK(p); ret = linprocfs_doargv(td, p, sb, ps_string_env); Modified: projects/pseries/conf/files ============================================================================== --- projects/pseries/conf/files Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/conf/files Fri Jun 24 14:03:10 2011 (r223503) @@ -1991,8 +1991,12 @@ dev/usb/quirk/usb_quirk.c optional usb # # USB templates # -dev/usb/template/usb_template.c optional usb_template +dev/usb/template/usb_template.c optional usb_template +dev/usb/template/usb_template_audio.c optional usb_template dev/usb/template/usb_template_cdce.c optional usb_template +dev/usb/template/usb_template_kbd.c optional usb_template +dev/usb/template/usb_template_modem.c optional usb_template +dev/usb/template/usb_template_mouse.c optional usb_template dev/usb/template/usb_template_msc.c optional usb_template dev/usb/template/usb_template_mtp.c optional usb_template # Modified: projects/pseries/conf/files.amd64 ============================================================================== --- projects/pseries/conf/files.amd64 Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/conf/files.amd64 Fri Jun 24 14:03:10 2011 (r223503) @@ -128,7 +128,6 @@ amd64/amd64/trap.c standard amd64/amd64/uio_machdep.c standard amd64/amd64/uma_machdep.c standard amd64/amd64/vm_machdep.c standard -amd64/pci/pci_bus.c optional pci amd64/pci/pci_cfgreg.c optional pci crypto/aesni/aesencdec_amd64.S optional aesni crypto/aesni/aeskeys_amd64.S optional aesni @@ -315,7 +314,8 @@ x86/isa/isa.c standard x86/isa/isa_dma.c standard x86/isa/nmi.c standard x86/isa/orm.c optional isa -x86/pci/qpi.c standard +x86/pci/pci_bus.c optional pci +x86/pci/qpi.c optional pci x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard x86/x86/io_apic.c standard Modified: projects/pseries/conf/files.i386 ============================================================================== --- projects/pseries/conf/files.i386 Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/conf/files.i386 Fri Jun 24 14:03:10 2011 (r223503) @@ -352,7 +352,6 @@ i386/linux/linux_support.s optional comp dependency "linux_assym.h" i386/linux/linux_sysent.c optional compat_linux i386/linux/linux_sysvec.c optional compat_linux -i386/pci/pci_bus.c optional pci i386/pci/pci_cfgreg.c optional pci i386/pci/pci_pir.c optional pci i386/svr4/svr4_locore.s optional compat_svr4 \ @@ -405,7 +404,8 @@ x86/isa/isa.c optional isa x86/isa/isa_dma.c optional isa x86/isa/nmi.c standard x86/isa/orm.c optional isa -x86/pci/qpi.c standard +x86/pci/pci_bus.c optional pci +x86/pci/qpi.c optional pci x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard x86/x86/io_apic.c optional apic Modified: projects/pseries/conf/files.pc98 ============================================================================== --- projects/pseries/conf/files.pc98 Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/conf/files.pc98 Fri Jun 24 14:03:10 2011 (r223503) @@ -199,7 +199,6 @@ i386/linux/linux_support.s optional comp dependency "linux_assym.h" i386/linux/linux_sysent.c optional compat_linux i386/linux/linux_sysvec.c optional compat_linux -i386/pci/pci_bus.c optional pci i386/pci/pci_cfgreg.c optional pci i386/pci/pci_pir.c optional pci i386/svr4/svr4_locore.s optional compat_svr4 \ @@ -249,6 +248,7 @@ pc98/pc98/pc98_machdep.c standard x86/isa/atpic.c optional atpic x86/isa/clock.c standard x86/isa/isa.c optional isa +x86/pci/pci_bus.c optional pci x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard x86/x86/io_apic.c optional apic Modified: projects/pseries/conf/files.powerpc ============================================================================== --- projects/pseries/conf/files.powerpc Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/conf/files.powerpc Fri Jun 24 14:03:10 2011 (r223503) @@ -203,11 +203,13 @@ powerpc/powerpc/syncicache.c standard powerpc/powerpc/sys_machdep.c standard powerpc/powerpc/uio_machdep.c standard powerpc/ps3/ehci_ps3.c optional ps3 ehci +powerpc/ps3/ohci_ps3.c optional ps3 ohci powerpc/ps3/if_glc.c optional ps3 glc powerpc/ps3/mmu_ps3.c optional ps3 powerpc/ps3/platform_ps3.c optional ps3 powerpc/ps3/ps3ata.c optional ps3 ps3ata powerpc/ps3/ps3bus.c optional ps3 +powerpc/ps3/ps3disk.c optional ps3 powerpc/ps3/ps3pic.c optional ps3 powerpc/ps3/ps3_syscons.c optional ps3 sc powerpc/ps3/ps3-hvcall.S optional ps3 sc Modified: projects/pseries/dev/acpica/acpi.c ============================================================================== --- projects/pseries/dev/acpica/acpi.c Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/dev/acpica/acpi.c Fri Jun 24 14:03:10 2011 (r223503) @@ -151,6 +151,7 @@ static ACPI_STATUS acpi_sleep_disable(st static ACPI_STATUS acpi_EnterSleepState(struct acpi_softc *sc, int state); static void acpi_shutdown_final(void *arg, int howto); static void acpi_enable_fixed_events(struct acpi_softc *sc); +static BOOLEAN acpi_has_hid(ACPI_HANDLE handle); static int acpi_wake_sleep_prep(ACPI_HANDLE handle, int sstate); static int acpi_wake_run_prep(ACPI_HANDLE handle, int sstate); static int acpi_wake_prep_walk(int sstate); @@ -1855,6 +1856,13 @@ acpi_probe_child(ACPI_HANDLE handle, UIN break; if (acpi_parse_prw(handle, &prw) == 0) AcpiSetupGpeForWake(handle, prw.gpe_handle, prw.gpe_bit); + + /* + * Ignore devices that do not have a _HID or _CID. They should + * be discovered by other buses (e.g. the PCI bus driver). + */ + if (!acpi_has_hid(handle)) + break; /* FALLTHROUGH */ case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_THERMAL: @@ -2043,6 +2051,30 @@ acpi_BatteryIsPresent(device_t dev) } /* + * Returns true if a device has at least one valid device ID. + */ +static BOOLEAN +acpi_has_hid(ACPI_HANDLE h) +{ + ACPI_DEVICE_INFO *devinfo; + BOOLEAN ret; + + if (h == NULL || + ACPI_FAILURE(AcpiGetObjectInfo(h, &devinfo))) + return (FALSE); + + ret = FALSE; + if ((devinfo->Valid & ACPI_VALID_HID) != 0) + ret = TRUE; + else if ((devinfo->Valid & ACPI_VALID_CID) != 0) + if (devinfo->CompatibleIdList.Count > 0) + ret = TRUE; + + AcpiOsFree(devinfo); + return (ret); +} + +/* * Match a HID string against a handle */ BOOLEAN Modified: projects/pseries/dev/acpica/acpi_cpu.c ============================================================================== --- projects/pseries/dev/acpica/acpi_cpu.c Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/dev/acpica/acpi_cpu.c Fri Jun 24 14:03:10 2011 (r223503) @@ -856,6 +856,10 @@ acpi_cpu_cx_list(struct acpi_cpu_softc * sbuf_printf(&sb, "C%d/%d ", i + 1, sc->cpu_cx_states[i].trans_lat); if (sc->cpu_cx_states[i].type < ACPI_STATE_C3) sc->cpu_non_c3 = i; +#ifndef __ia64__ + else + cpu_can_deep_sleep = 1; +#endif } sbuf_trim(&sb); sbuf_finish(&sb); Modified: projects/pseries/dev/acpica/acpi_pci.c ============================================================================== --- projects/pseries/dev/acpica/acpi_pci.c Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/dev/acpica/acpi_pci.c Fri Jun 24 14:03:10 2011 (r223503) @@ -209,38 +209,24 @@ acpi_pci_update_device(ACPI_HANDLE handl device_t child; /* - * Lookup and remove the unused device that acpi0 creates when it walks - * the namespace creating devices. + * Occasionally a PCI device may show up as an ACPI device + * with a _HID. (For example, the TabletPC TC1000 has a + * second PCI-ISA bridge that has a _HID for an + * acpi_sysresource device.) In that case, leave ACPI-CA's + * device data pointing at the ACPI-enumerated device. */ child = acpi_get_device(handle); if (child != NULL) { - if (device_is_alive(child)) { - /* - * The TabletPC TC1000 has a second PCI-ISA bridge - * that has a _HID for an acpi_sysresource device. - * In that case, leave ACPI-CA's device data pointing - * at the ACPI-enumerated device. - */ - device_printf(child, - "Conflicts with PCI device %d:%d:%d\n", - pci_get_bus(pci_child), pci_get_slot(pci_child), - pci_get_function(pci_child)); - return; - } KASSERT(device_get_parent(child) == devclass_get_device(devclass_find("acpi"), 0), ("%s: child (%s)'s parent is not acpi0", __func__, acpi_name(handle))); - device_delete_child(device_get_parent(child), child); + return; } /* * Update ACPI-CA to use the PCI enumerated device_t for this handle. */ - status = AcpiDetachData(handle, acpi_fake_objhandler); - if (ACPI_FAILURE(status)) - printf("WARNING: Unable to detach object data from %s - %s\n", - acpi_name(handle), AcpiFormatException(status)); status = AcpiAttachData(handle, acpi_fake_objhandler, pci_child); if (ACPI_FAILURE(status)) printf("WARNING: Unable to attach object data to %s - %s\n", Modified: projects/pseries/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- projects/pseries/dev/acpica/acpi_pcib_acpi.c Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/dev/acpica/acpi_pcib_acpi.c Fri Jun 24 14:03:10 2011 (r223503) @@ -357,32 +357,14 @@ acpi_pcib_map_msi(device_t pcib, device_ return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data)); } -static u_long acpi_host_mem_start = 0x80000000; -TUNABLE_ULONG("hw.acpi.host_mem_start", &acpi_host_mem_start); - struct resource * acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { - /* - * If no memory preference is given, use upper 32MB slot most - * bioses use for their memory window. Typically other bridges - * before us get in the way to assert their preferences on memory. - * Hardcoding like this sucks, so a more MD/MI way needs to be - * found to do it. This is typically only used on older laptops - * that don't have pci busses behind pci bridge, so assuming > 32MB - * is likely OK. - * - * PCI-PCI bridges may allocate smaller ranges for their windows, - * but the heuristics here should apply to those, so we allow - * several different end addresses. - */ - if (type == SYS_RES_MEMORY && start == 0UL && (end == ~0UL || - end == 0xffffffff)) - start = acpi_host_mem_start; - if (type == SYS_RES_IOPORT && start == 0UL && (end == ~0UL || - end == 0xffff || end == 0xffffffff)) - start = 0x1000; + +#if defined(__i386__) || defined(__amd64__) + start = hostb_alloc_start(type, start, end, count); +#endif return (bus_generic_alloc_resource(dev, child, type, rid, start, end, count, flags)); } Modified: projects/pseries/dev/acpica/acpi_resource.c ============================================================================== --- projects/pseries/dev/acpica/acpi_resource.c Fri Jun 24 13:58:56 2011 (r223502) +++ projects/pseries/dev/acpica/acpi_resource.c Fri Jun 24 14:03:10 2011 (r223503) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -139,6 +140,249 @@ acpi_config_intr(device_t dev, ACPI_RESO INTR_POLARITY_HIGH : INTR_POLARITY_LOW); } +struct acpi_resource_context { + struct acpi_parse_resource_set *set; + device_t dev; + void *context; +}; + +#ifdef ACPI_DEBUG_OUTPUT +static const char * +acpi_address_range_name(UINT8 ResourceType) +{ + static char buf[16]; + + switch (ResourceType) { + case ACPI_MEMORY_RANGE: + return ("Memory"); + case ACPI_IO_RANGE: + return ("IO"); + case ACPI_BUS_NUMBER_RANGE: + return ("Bus Number"); + default: + snprintf(buf, sizeof(buf), "type %u", ResourceType); + return (buf); + } +} +#endif + +static ACPI_STATUS +acpi_parse_resource(ACPI_RESOURCE *res, void *context) +{ + struct acpi_parse_resource_set *set; + struct acpi_resource_context *arc; + UINT64 min, max, length, gran; + const char *name; + device_t dev; + + arc = context; + dev = arc->dev; + set = arc->set; + + switch (res->Type) { + case ACPI_RESOURCE_TYPE_END_TAG: + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "EndTag\n")); + break; + case ACPI_RESOURCE_TYPE_FIXED_IO: + if (res->Data.FixedIo.AddressLength <= 0) + break; + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "FixedIo 0x%x/%d\n", + res->Data.FixedIo.Address, res->Data.FixedIo.AddressLength)); + set->set_ioport(dev, arc->context, res->Data.FixedIo.Address, + res->Data.FixedIo.AddressLength); + break; + case ACPI_RESOURCE_TYPE_IO: + if (res->Data.Io.AddressLength <= 0) + break; + if (res->Data.Io.Minimum == res->Data.Io.Maximum) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Io 0x%x/%d\n", + res->Data.Io.Minimum, res->Data.Io.AddressLength)); + set->set_ioport(dev, arc->context, res->Data.Io.Minimum, + res->Data.Io.AddressLength); + } else { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Io 0x%x-0x%x/%d\n", + res->Data.Io.Minimum, res->Data.Io.Maximum, + res->Data.Io.AddressLength)); + set->set_iorange(dev, arc->context, res->Data.Io.Minimum, + res->Data.Io.Maximum, res->Data.Io.AddressLength, + res->Data.Io.Alignment); + } + break; + case ACPI_RESOURCE_TYPE_FIXED_MEMORY32: + if (res->Data.FixedMemory32.AddressLength <= 0) + break; + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "FixedMemory32 0x%x/%d\n", + res->Data.FixedMemory32.Address, + res->Data.FixedMemory32.AddressLength)); + set->set_memory(dev, arc->context, res->Data.FixedMemory32.Address, + res->Data.FixedMemory32.AddressLength); + break; + case ACPI_RESOURCE_TYPE_MEMORY32: + if (res->Data.Memory32.AddressLength <= 0) + break; + if (res->Data.Memory32.Minimum == res->Data.Memory32.Maximum) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory32 0x%x/%d\n", + res->Data.Memory32.Minimum, res->Data.Memory32.AddressLength)); + set->set_memory(dev, arc->context, res->Data.Memory32.Minimum, + res->Data.Memory32.AddressLength); + } else { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory32 0x%x-0x%x/%d\n", + res->Data.Memory32.Minimum, res->Data.Memory32.Maximum, + res->Data.Memory32.AddressLength)); + set->set_memoryrange(dev, arc->context, res->Data.Memory32.Minimum, + res->Data.Memory32.Maximum, res->Data.Memory32.AddressLength, + res->Data.Memory32.Alignment); + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Fri Jun 24 16:35:41 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80B39106564A; Fri, 24 Jun 2011 16:35:41 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 6D6D98FC18; Fri, 24 Jun 2011 16:35:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5OGZf4D062250; Fri, 24 Jun 2011 16:35:41 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OGZfDq062240; Fri, 24 Jun 2011 16:35:41 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201106241635.p5OGZfDq062240@svn.freebsd.org> From: Attilio Rao Date: Fri, 24 Jun 2011 16:35:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223508 - in projects/largeSMP: bin/rcp bin/sh contrib/binutils/gas/config contrib/top etc lib/libstand lib/libusb libexec/ftpd libexec/tftpd release/doc/en_US.ISO8859-1/readme release/... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2011 16:35:41 -0000 Author: attilio Date: Fri Jun 24 16:35:40 2011 New Revision: 223508 URL: http://svn.freebsd.org/changeset/base/223508 Log: MFC Added: projects/largeSMP/lib/libusb/libusb01.c - copied unchanged from r223507, head/lib/libusb/libusb01.c projects/largeSMP/sys/dev/usb/template/usb_template_audio.c - copied unchanged from r223507, head/sys/dev/usb/template/usb_template_audio.c projects/largeSMP/sys/dev/usb/template/usb_template_kbd.c - copied unchanged from r223507, head/sys/dev/usb/template/usb_template_kbd.c projects/largeSMP/sys/dev/usb/template/usb_template_modem.c - copied unchanged from r223507, head/sys/dev/usb/template/usb_template_modem.c projects/largeSMP/sys/dev/usb/template/usb_template_mouse.c - copied unchanged from r223507, head/sys/dev/usb/template/usb_template_mouse.c projects/largeSMP/sys/x86/include/pci_cfgreg.h - copied unchanged from r223507, head/sys/x86/include/pci_cfgreg.h projects/largeSMP/sys/x86/pci/pci_bus.c - copied unchanged from r223507, head/sys/x86/pci/pci_bus.c projects/largeSMP/tools/tools/bus_autoconf/ - copied from r223507, head/tools/tools/bus_autoconf/ Deleted: projects/largeSMP/lib/libusb/libusb20_compat01.c projects/largeSMP/sys/amd64/pci/pci_bus.c projects/largeSMP/sys/i386/pci/pci_bus.c Modified: projects/largeSMP/bin/rcp/rcp.c projects/largeSMP/bin/sh/mkinit.c projects/largeSMP/contrib/binutils/gas/config/tc-arm.c projects/largeSMP/etc/network.subr projects/largeSMP/etc/regdomain.xml projects/largeSMP/lib/libstand/tftp.c projects/largeSMP/lib/libusb/Makefile projects/largeSMP/lib/libusb/libusb20.3 projects/largeSMP/lib/libusb/libusb20.c projects/largeSMP/lib/libusb/libusb20.h projects/largeSMP/lib/libusb/libusb20_int.h projects/largeSMP/lib/libusb/libusb20_ugen20.c projects/largeSMP/libexec/ftpd/ftpd.c projects/largeSMP/libexec/tftpd/tftp-file.c projects/largeSMP/libexec/tftpd/tftpd.8 projects/largeSMP/release/doc/en_US.ISO8859-1/readme/article.sgml projects/largeSMP/release/doc/share/sgml/release.ent projects/largeSMP/sbin/ipfw/nat.c projects/largeSMP/sbin/savecore/savecore.c projects/largeSMP/share/man/man4/ng_ether.4 projects/largeSMP/sys/amd64/include/pci_cfgreg.h projects/largeSMP/sys/boot/i386/zfsboot/zfsldr.S projects/largeSMP/sys/cam/ata/ata_xpt.c projects/largeSMP/sys/cam/scsi/scsi_xpt.c projects/largeSMP/sys/conf/files projects/largeSMP/sys/conf/files.amd64 projects/largeSMP/sys/conf/files.i386 projects/largeSMP/sys/conf/files.pc98 projects/largeSMP/sys/dev/acpica/acpi.c projects/largeSMP/sys/dev/acpica/acpi_cpu.c projects/largeSMP/sys/dev/ath/ah_osdep.c projects/largeSMP/sys/dev/ath/ath_hal/ah.h projects/largeSMP/sys/dev/ath/ath_hal/ah_internal.h projects/largeSMP/sys/dev/ath/ath_hal/ah_regdomain.c projects/largeSMP/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c projects/largeSMP/sys/dev/ath/ath_hal/ar5210/ar5210_beacon.c projects/largeSMP/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c projects/largeSMP/sys/dev/ath/ath_hal/ar5211/ar5211_beacon.c projects/largeSMP/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5112.c projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c projects/largeSMP/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar2133.c projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c projects/largeSMP/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c projects/largeSMP/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c projects/largeSMP/sys/dev/ath/if_ath.c projects/largeSMP/sys/dev/ath/if_ath_sysctl.c projects/largeSMP/sys/dev/ath/if_ath_sysctl.h projects/largeSMP/sys/dev/e1000/if_igb.c projects/largeSMP/sys/dev/sound/usb/uaudio.c projects/largeSMP/sys/dev/usb/input/atp.c projects/largeSMP/sys/dev/usb/input/uhid.c projects/largeSMP/sys/dev/usb/net/if_aue.c projects/largeSMP/sys/dev/usb/net/if_axe.c projects/largeSMP/sys/dev/usb/net/if_cdce.c projects/largeSMP/sys/dev/usb/net/if_cue.c projects/largeSMP/sys/dev/usb/net/if_ipheth.c projects/largeSMP/sys/dev/usb/net/if_kue.c projects/largeSMP/sys/dev/usb/net/if_mos.c projects/largeSMP/sys/dev/usb/net/if_rue.c projects/largeSMP/sys/dev/usb/net/if_udav.c projects/largeSMP/sys/dev/usb/net/uhso.c projects/largeSMP/sys/dev/usb/serial/u3g.c projects/largeSMP/sys/dev/usb/serial/uark.c projects/largeSMP/sys/dev/usb/serial/ubsa.c projects/largeSMP/sys/dev/usb/serial/uchcom.c projects/largeSMP/sys/dev/usb/serial/ucycom.c projects/largeSMP/sys/dev/usb/serial/uftdi.c projects/largeSMP/sys/dev/usb/serial/ugensa.c projects/largeSMP/sys/dev/usb/serial/uipaq.c projects/largeSMP/sys/dev/usb/serial/ulpt.c projects/largeSMP/sys/dev/usb/serial/umcs.c projects/largeSMP/sys/dev/usb/serial/umct.c projects/largeSMP/sys/dev/usb/serial/umodem.c projects/largeSMP/sys/dev/usb/serial/umoscom.c projects/largeSMP/sys/dev/usb/serial/uplcom.c projects/largeSMP/sys/dev/usb/serial/uslcom.c projects/largeSMP/sys/dev/usb/serial/uvisor.c projects/largeSMP/sys/dev/usb/serial/uvscom.c projects/largeSMP/sys/dev/usb/storage/umass.c projects/largeSMP/sys/dev/usb/template/usb_template.c projects/largeSMP/sys/dev/usb/template/usb_template.h projects/largeSMP/sys/dev/usb/template/usb_template_cdce.c projects/largeSMP/sys/dev/usb/template/usb_template_msc.c projects/largeSMP/sys/dev/usb/template/usb_template_mtp.c projects/largeSMP/sys/dev/usb/usb_hub.c projects/largeSMP/sys/dev/usb/usb_ioctl.h projects/largeSMP/sys/dev/usb/usb_lookup.c projects/largeSMP/sys/dev/usb/usbdi.h projects/largeSMP/sys/dev/usb/wlan/if_rum.c projects/largeSMP/sys/dev/usb/wlan/if_run.c projects/largeSMP/sys/dev/usb/wlan/if_uath.c projects/largeSMP/sys/dev/usb/wlan/if_upgt.c projects/largeSMP/sys/dev/usb/wlan/if_ural.c projects/largeSMP/sys/dev/usb/wlan/if_urtw.c projects/largeSMP/sys/dev/usb/wlan/if_zyd.c projects/largeSMP/sys/fs/nfs/nfs_commonkrpc.c projects/largeSMP/sys/i386/include/param.h projects/largeSMP/sys/i386/include/pci_cfgreg.h projects/largeSMP/sys/ia64/ia64/machdep.c projects/largeSMP/sys/kern/vfs_subr.c projects/largeSMP/sys/modules/cxgbe/if_cxgbe/Makefile projects/largeSMP/sys/modules/nfscl/Makefile projects/largeSMP/sys/modules/nfscommon/Makefile projects/largeSMP/sys/modules/usb/template/Makefile projects/largeSMP/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c projects/largeSMP/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c projects/largeSMP/sys/netgraph/ng_ether.c projects/largeSMP/sys/netinet/libalias/alias_db.c projects/largeSMP/sys/netinet/libalias/alias_ftp.c projects/largeSMP/sys/netinet/libalias/alias_local.h projects/largeSMP/sys/netinet/libalias/libalias.3 projects/largeSMP/sys/powerpc/aim/copyinout.c projects/largeSMP/sys/powerpc/aim/locore32.S projects/largeSMP/sys/powerpc/aim/locore64.S projects/largeSMP/sys/powerpc/aim/machdep.c projects/largeSMP/sys/powerpc/aim/mmu_oea64.c projects/largeSMP/sys/powerpc/aim/mp_cpudep.c projects/largeSMP/sys/powerpc/aim/swtch32.S projects/largeSMP/sys/powerpc/aim/swtch64.S projects/largeSMP/sys/powerpc/aim/trap.c projects/largeSMP/sys/powerpc/aim/trap_subr32.S projects/largeSMP/sys/powerpc/aim/trap_subr64.S projects/largeSMP/sys/powerpc/booke/copyinout.c projects/largeSMP/sys/powerpc/booke/interrupt.c projects/largeSMP/sys/powerpc/booke/trap.c projects/largeSMP/sys/powerpc/include/pcpu.h projects/largeSMP/sys/powerpc/ofw/ofwcall32.S projects/largeSMP/sys/powerpc/powerpc/db_trace.c projects/largeSMP/sys/powerpc/powerpc/mp_machdep.c projects/largeSMP/sys/powerpc/ps3/ps3-hvcall.h projects/largeSMP/sys/powerpc/ps3/ps3-hvcall.master projects/largeSMP/sys/powerpc/ps3/ps3bus.c projects/largeSMP/sys/powerpc/ps3/ps3disk.c projects/largeSMP/sys/powerpc/ps3/ps3pic.c projects/largeSMP/sys/vm/vm_fault.c projects/largeSMP/sys/vm/vm_page.c projects/largeSMP/usr.bin/ktrace/ktrace.c projects/largeSMP/usr.bin/ncplogin/ncplogin.c projects/largeSMP/usr.bin/systat/netstat.c projects/largeSMP/usr.bin/tftp/main.c projects/largeSMP/usr.bin/tftp/tftp.1 projects/largeSMP/usr.bin/vmstat/vmstat.c projects/largeSMP/usr.sbin/ancontrol/ancontrol.c projects/largeSMP/usr.sbin/ifmcstat/ifmcstat.c projects/largeSMP/usr.sbin/nfsd/nfsd.c projects/largeSMP/usr.sbin/pmcstat/pmcpl_calltree.c projects/largeSMP/usr.sbin/ppp/nat_cmd.c projects/largeSMP/usr.sbin/rpc.yppasswdd/yppasswdd_main.c projects/largeSMP/usr.sbin/rpc.ypupdated/update.c projects/largeSMP/usr.sbin/rpc.ypupdated/ypupdated_main.c projects/largeSMP/usr.sbin/rpc.ypupdated/ypupdated_server.c projects/largeSMP/usr.sbin/sysinstall/modules.c projects/largeSMP/usr.sbin/wpa/ndis_events/ndis_events.c projects/largeSMP/usr.sbin/wpa/wpa_supplicant/Packet32.c Directory Properties: projects/largeSMP/ (props changed) projects/largeSMP/cddl/contrib/opensolaris/ (props changed) projects/largeSMP/contrib/bind9/ (props changed) projects/largeSMP/contrib/binutils/ (props changed) projects/largeSMP/contrib/bzip2/ (props changed) projects/largeSMP/contrib/compiler-rt/ (props changed) projects/largeSMP/contrib/dialog/ (props changed) projects/largeSMP/contrib/ee/ (props changed) projects/largeSMP/contrib/expat/ (props changed) projects/largeSMP/contrib/file/ (props changed) projects/largeSMP/contrib/gcc/ (props changed) projects/largeSMP/contrib/gdb/ (props changed) projects/largeSMP/contrib/gdtoa/ (props changed) projects/largeSMP/contrib/gnu-sort/ (props changed) projects/largeSMP/contrib/groff/ (props changed) projects/largeSMP/contrib/less/ (props changed) projects/largeSMP/contrib/libpcap/ (props changed) projects/largeSMP/contrib/libstdc++/ (props changed) projects/largeSMP/contrib/llvm/ (props changed) projects/largeSMP/contrib/llvm/tools/clang/ (props changed) projects/largeSMP/contrib/ncurses/ (props changed) projects/largeSMP/contrib/netcat/ (props changed) projects/largeSMP/contrib/ntp/ (props changed) projects/largeSMP/contrib/one-true-awk/ (props changed) projects/largeSMP/contrib/openbsm/ (props changed) projects/largeSMP/contrib/openpam/ (props changed) projects/largeSMP/contrib/pf/ (props changed) projects/largeSMP/contrib/sendmail/ (props changed) projects/largeSMP/contrib/tcpdump/ (props changed) projects/largeSMP/contrib/tcsh/ (props changed) projects/largeSMP/contrib/tnftp/ (props changed) projects/largeSMP/contrib/top/ (props changed) projects/largeSMP/contrib/top/install-sh (props changed) projects/largeSMP/contrib/tzcode/stdtime/ (props changed) projects/largeSMP/contrib/tzcode/zic/ (props changed) projects/largeSMP/contrib/tzdata/ (props changed) projects/largeSMP/contrib/wpa/ (props changed) projects/largeSMP/contrib/xz/ (props changed) projects/largeSMP/crypto/openssh/ (props changed) projects/largeSMP/crypto/openssl/ (props changed) projects/largeSMP/gnu/lib/ (props changed) projects/largeSMP/gnu/usr.bin/binutils/ (props changed) projects/largeSMP/gnu/usr.bin/cc/cc_tools/ (props changed) projects/largeSMP/gnu/usr.bin/gdb/ (props changed) projects/largeSMP/lib/libc/ (props changed) projects/largeSMP/lib/libc/stdtime/ (props changed) projects/largeSMP/lib/libutil/ (props changed) projects/largeSMP/lib/libz/ (props changed) projects/largeSMP/sbin/ (props changed) projects/largeSMP/sbin/ipfw/ (props changed) projects/largeSMP/share/mk/bsd.arch.inc.mk (props changed) projects/largeSMP/share/zoneinfo/ (props changed) projects/largeSMP/sys/ (props changed) projects/largeSMP/sys/amd64/include/xen/ (props changed) projects/largeSMP/sys/boot/ (props changed) projects/largeSMP/sys/boot/i386/efi/ (props changed) projects/largeSMP/sys/boot/ia64/efi/ (props changed) projects/largeSMP/sys/boot/ia64/ski/ (props changed) projects/largeSMP/sys/boot/powerpc/boot1.chrp/ (props changed) projects/largeSMP/sys/boot/powerpc/ofw/ (props changed) projects/largeSMP/sys/cddl/contrib/opensolaris/ (props changed) projects/largeSMP/sys/conf/ (props changed) projects/largeSMP/sys/contrib/dev/acpica/ (props changed) projects/largeSMP/sys/contrib/octeon-sdk/ (props changed) projects/largeSMP/sys/contrib/pf/ (props changed) projects/largeSMP/sys/contrib/x86emu/ (props changed) projects/largeSMP/usr.bin/calendar/ (props changed) projects/largeSMP/usr.bin/csup/ (props changed) projects/largeSMP/usr.bin/procstat/ (props changed) projects/largeSMP/usr.sbin/ndiscvt/ (props changed) projects/largeSMP/usr.sbin/zic/ (props changed) Modified: projects/largeSMP/bin/rcp/rcp.c ============================================================================== --- projects/largeSMP/bin/rcp/rcp.c Fri Jun 24 16:06:50 2011 (r223507) +++ projects/largeSMP/bin/rcp/rcp.c Fri Jun 24 16:35:40 2011 (r223508) @@ -71,7 +71,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include "extern.h" Modified: projects/largeSMP/bin/sh/mkinit.c ============================================================================== --- projects/largeSMP/bin/sh/mkinit.c Fri Jun 24 16:06:50 2011 (r223507) +++ projects/largeSMP/bin/sh/mkinit.c Fri Jun 24 16:35:40 2011 (r223508) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); */ -#include #include #include #include Modified: projects/largeSMP/contrib/binutils/gas/config/tc-arm.c ============================================================================== --- projects/largeSMP/contrib/binutils/gas/config/tc-arm.c Fri Jun 24 16:06:50 2011 (r223507) +++ projects/largeSMP/contrib/binutils/gas/config/tc-arm.c Fri Jun 24 16:35:40 2011 (r223508) @@ -9974,6 +9974,13 @@ do_t_rbit (void) } static void +do_t_rd_rm (void) +{ + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].reg; +} + +static void do_t_rev (void) { if (inst.operands[0].reg <= 7 && inst.operands[1].reg <= 7 @@ -14901,6 +14908,9 @@ static const struct asm_opcode insns[] = TCE(rsb, 0600000, ebc00000, 3, (RR, oRR, SH), arit, t_rsb), TC3(rsbs, 0700000, ebd00000, 3, (RR, oRR, SH), arit, t_rsb), + TCE(rrx, 1a00060, ea4f0030, 2, (RR, RR), rd_rm, t_rd_rm), + TCE(rrxs, 1b00060, ea5f0030, 2, (RR, RR), rd_rm, t_rd_rm), + #undef THUMB_VARIANT #define THUMB_VARIANT &arm_ext_v6 TCE(cpy, 1a00000, 4600, 2, (RR, RR), rd_rm, t_cpy), Modified: projects/largeSMP/etc/network.subr ============================================================================== --- projects/largeSMP/etc/network.subr Fri Jun 24 16:06:50 2011 (r223507) +++ projects/largeSMP/etc/network.subr Fri Jun 24 16:35:40 2011 (r223508) @@ -94,7 +94,7 @@ ifconfig_up() # ifconfig_IF ifconfig_args=`ifconfig_getargs $1` if [ -n "${ifconfig_args}" ]; then - ifconfig $1 ${ifconfig_args} + eval ifconfig $1 ${ifconfig_args} _cfg=0 fi Modified: projects/largeSMP/etc/regdomain.xml ============================================================================== --- projects/largeSMP/etc/regdomain.xml Fri Jun 24 16:06:50 2011 (r223507) +++ projects/largeSMP/etc/regdomain.xml Fri Jun 24 16:35:40 2011 (r223508) @@ -83,7 +83,7 @@ IEEE80211_CHAN_HT20 - + 30 IEEE80211_CHAN_G IEEE80211_CHAN_HT40 @@ -96,7 +96,7 @@ IEEE80211_CHAN_HT20 - + 17 IEEE80211_CHAN_HT40 @@ -106,7 +106,7 @@ IEEE80211_CHAN_HT20 - + 23 IEEE80211_CHAN_HT40 @@ -138,6 +138,12 @@ 17 + + 20 + IEEE80211_CHAN_PASSIVE + IEEE80211_CHAN_DFS + + 23 IEEE80211_CHAN_PASSIVE @@ -176,6 +182,20 @@ IEEE80211_CHAN_HT40 + + 20 + IEEE80211_CHAN_HT20 + IEEE80211_CHAN_PASSIVE + IEEE80211_CHAN_DFS + + + + 20 + IEEE80211_CHAN_HT40 + IEEE80211_CHAN_PASSIVE + IEEE80211_CHAN_DFS + + 23 IEEE80211_CHAN_HT20 @@ -231,7 +251,7 @@ IEEE80211_CHAN_HT20 - + 30 IEEE80211_CHAN_G IEEE80211_CHAN_HT40 Modified: projects/largeSMP/lib/libstand/tftp.c ============================================================================== --- projects/largeSMP/lib/libstand/tftp.c Fri Jun 24 16:06:50 2011 (r223507) +++ projects/largeSMP/lib/libstand/tftp.c Fri Jun 24 16:35:40 2011 (r223508) @@ -64,13 +64,13 @@ struct tftp_handle; static int tftp_open(const char *path, struct open_file *f); static int tftp_close(struct open_file *f); -static void tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len); +static int tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len); static int tftp_read(struct open_file *f, void *buf, size_t size, size_t *resid); static int tftp_write(struct open_file *f, void *buf, size_t size, size_t *resid); static off_t tftp_seek(struct open_file *f, off_t offset, int where); static int tftp_set_blksize(struct tftp_handle *h, const char *str); static int tftp_stat(struct open_file *f, struct stat *sb); -static ssize_t sendrecv_tftp(struct tftp_handle *h, +static ssize_t sendrecv_tftp(struct tftp_handle *h, ssize_t (*sproc)(struct iodesc *, void *, size_t), void *sbuf, size_t ssize, ssize_t (*rproc)(struct tftp_handle *h, void *, ssize_t, time_t, unsigned short *), @@ -93,7 +93,7 @@ static int tftpport = 2000; static int is_open = 0; /* - * The legacy TFTP_BLKSIZE value was 512. + * The legacy TFTP_BLKSIZE value was SEGSIZE(512). * TFTP_REQUESTED_BLKSIZE of 1428 is (Ethernet MTU, less the TFTP, UDP and * IP header lengths). */ @@ -102,7 +102,7 @@ static int is_open = 0; /* * Choose a blksize big enough so we can test with Ethernet * Jumbo frames in the future. - */ + */ #define TFTP_MAX_BLKSIZE 9008 struct tftp_handle { @@ -113,7 +113,7 @@ struct tftp_handle { int off; char *path; /* saved for re-requests */ unsigned int tftp_blksize; - unsigned long tftp_tsize; + unsigned long tftp_tsize; struct { u_char header[HEADER_SIZE]; struct tftphdr t; @@ -121,7 +121,8 @@ struct tftp_handle { } __packed __aligned(4) lastdata; }; -static const int tftperrors[8] = { +#define TFTP_MAX_ERRCODE EOPTNEG +static const int tftperrors[TFTP_MAX_ERRCODE + 1] = { 0, /* ??? */ ENOENT, EPERM, @@ -129,10 +130,57 @@ static const int tftperrors[8] = { EINVAL, /* ??? */ EINVAL, /* ??? */ EEXIST, - EINVAL /* ??? */ + EINVAL, /* ??? */ + EINVAL, /* Option negotiation failed. */ }; -static ssize_t +static int tftp_getnextblock(struct tftp_handle *h); + +/* send error message back. */ +static void +tftp_senderr(struct tftp_handle *h, u_short errcode, const char *msg) +{ + struct { + u_char header[HEADER_SIZE]; + struct tftphdr t; + u_char space[63]; /* +1 from t */ + } __packed __aligned(4) wbuf; + char *wtail; + int len; + + len = strlen(msg); + if (len > sizeof(wbuf.space)) + len = sizeof(wbuf.space); + + wbuf.t.th_opcode = htons((u_short) ERROR); + wbuf.t.th_code = htons(errcode); + + wtail = wbuf.t.th_msg; + bcopy(msg, wtail, len); + wtail[len] = '\0'; + wtail += len + 1; + + sendudp(h->iodesc, &wbuf.t, wtail - (char *) &wbuf.t); +} + +static void +tftp_sendack(struct tftp_handle *h) +{ + struct { + u_char header[HEADER_SIZE]; + struct tftphdr t; + } __packed __aligned(4) wbuf; + char *wtail; + + wbuf.t.th_opcode = htons((u_short) ACK); + wtail = (char *) &wbuf.t.th_block; + wbuf.t.th_block = htons((u_short) h->currblock); + wtail += 2; + + sendudp(h->iodesc, &wbuf.t, wtail - (char *) &wbuf.t); +} + +static ssize_t recvtftp(struct tftp_handle *h, void *pkt, ssize_t len, time_t tleft, unsigned short *rtype) { @@ -170,7 +218,7 @@ recvtftp(struct tftp_handle *h, void *pk return got; } case ERROR: - if ((unsigned) ntohs(t->th_code) >= 8) { + if ((unsigned) ntohs(t->th_code) > TFTP_MAX_ERRCODE) { printf("illegal tftp error %d\n", ntohs(t->th_code)); errno = EIO; } else { @@ -182,14 +230,30 @@ recvtftp(struct tftp_handle *h, void *pk return (-1); case OACK: { struct udphdr *uh; - int tftp_oack_len = len - sizeof(t->th_opcode); - tftp_parse_oack(h, t->th_u.tu_stuff, tftp_oack_len); + int tftp_oack_len; + + /* + * Unexpected OACK. TFTP transfer already in progress. + * Drop the pkt. + */ + if (d->xid != 1) { + return (-1); + } + /* - * Remember which port this OACK came from, - * because we need to send the ACK back to it. + * Remember which port this OACK came from, because we need + * to send the ACK or errors back to it. */ uh = (struct udphdr *) pkt - 1; d->destport = uh->uh_sport; + + /* Parse options ACK-ed by the server. */ + tftp_oack_len = len - sizeof(t->th_opcode); + if (tftp_parse_oack(h, t->th_u.tu_stuff, tftp_oack_len) != 0) { + tftp_senderr(h, EOPTNEG, "Malformed OACK"); + errno = EIO; + return (-1); + } return (0); } default: @@ -201,7 +265,7 @@ recvtftp(struct tftp_handle *h, void *pk } /* send request, expect first block (or error) */ -static int +static int tftp_makereq(struct tftp_handle *h) { struct { @@ -250,26 +314,28 @@ tftp_makereq(struct tftp_handle *h) h->iodesc->destport = htons(IPPORT_TFTP); h->iodesc->xid = 1; /* expected block */ + h->currblock = 0; + h->islastblock = 0; + h->validsize = 0; + res = sendrecv_tftp(h, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t, &recvtftp, t, sizeof(*t) + h->tftp_blksize, &rtype); - if (rtype == OACK) { - wbuf.t.th_opcode = htons((u_short)ACK); - wtail = (char *) &wbuf.t.th_block; - wbuf.t.th_block = htons(0); - wtail += 2; - rtype = 0; - res = sendrecv_tftp(h, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t, - &recvtftp, t, sizeof(*t) + h->tftp_blksize, &rtype); - } + if (rtype == OACK) + return (tftp_getnextblock(h)); + + /* Server ignored our blksize request, revert to TFTP default. */ + h->tftp_blksize = SEGSIZE; switch (rtype) { case DATA: { h->currblock = 1; h->validsize = res; h->islastblock = 0; - if (res < h->tftp_blksize) + if (res < h->tftp_blksize) { h->islastblock = 1; /* very short file */ + tftp_sendack(h); + } return (0); } case ERROR: @@ -320,7 +386,7 @@ tftp_getnextblock(struct tftp_handle *h) return (0); } -static int +static int tftp_open(const char *path, struct open_file *f) { struct tftp_handle *tftpfile; @@ -365,7 +431,7 @@ tftp_open(const char *path, struct open_ return (0); } -static int +static int tftp_read(struct open_file *f, void *addr, size_t size, size_t *resid /* out */) { @@ -381,9 +447,11 @@ tftp_read(struct open_file *f, void *add needblock = tftpfile->off / tftpfile->tftp_blksize + 1; - if (tftpfile->currblock > needblock) /* seek backwards */ + if (tftpfile->currblock > needblock) { /* seek backwards */ + tftp_senderr(tftpfile, 0, "No error: read aborted"); tftp_makereq(tftpfile); /* no error check, it worked * for open */ + } while (tftpfile->currblock < needblock) { int res; @@ -452,7 +520,7 @@ tftp_close(struct open_file *f) return (0); } -static int +static int tftp_write(struct open_file *f __unused, void *start __unused, size_t size __unused, size_t *resid __unused /* out */) { @@ -473,7 +541,7 @@ tftp_stat(struct open_file *f, struct st return (0); } -static off_t +static off_t tftp_seek(struct open_file *f, off_t offset, int where) { struct tftp_handle *tftpfile; @@ -494,7 +562,7 @@ tftp_seek(struct open_file *f, off_t off } static ssize_t -sendrecv_tftp(struct tftp_handle *h, +sendrecv_tftp(struct tftp_handle *h, ssize_t (*sproc)(struct iodesc *, void *, size_t), void *sbuf, size_t ssize, ssize_t (*rproc)(struct tftp_handle *, void *, ssize_t, time_t, unsigned short *), @@ -562,9 +630,9 @@ tftp_set_blksize(struct tftp_handle *h, /* * Only accept blksize value if it is numeric. - * RFC2348 specifies that acceptable valuesare 8-65464 - * 8-65464 . Let's choose a limit less than MAXRSPACE - */ + * RFC2348 specifies that acceptable values are 8-65464. + * Let's choose a limit less than MAXRSPACE. + */ if (*endptr == '\0' && new_blksize >= 8 && new_blksize <= TFTP_MAX_BLKSIZE) { h->tftp_blksize = new_blksize; @@ -597,13 +665,12 @@ tftp_set_blksize(struct tftp_handle *h, * optN, valueN * The final option/value acknowledgment pair. */ -static void +static int tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len) { /* * We parse the OACK strings into an array * of name-value pairs. - * */ char *tftp_options[128] = { 0 }; char *val = buf; @@ -612,18 +679,22 @@ tftp_parse_oack(struct tftp_handle *h, c int blksize_is_set = 0; int tsize = 0; - - while ( option_idx < 128 && i < len ) { - if (buf[i] == '\0') { - if (&buf[i] > val) { - tftp_options[option_idx] = val; - val = &buf[i] + 1; - ++option_idx; - } - } - ++i; + unsigned int orig_blksize; + + while (option_idx < 128 && i < len) { + if (buf[i] == '\0') { + if (&buf[i] > val) { + tftp_options[option_idx] = val; + val = &buf[i] + 1; + ++option_idx; + } + } + ++i; } + /* Save the block size we requested for sanity check later. */ + orig_blksize = h->tftp_blksize; + /* * Parse individual TFTP options. * * "blksize" is specified in RFC2348. @@ -631,27 +702,37 @@ tftp_parse_oack(struct tftp_handle *h, c */ for (i = 0; i < option_idx; i += 2) { if (strcasecmp(tftp_options[i], "blksize") == 0) { - if (i + 1 < option_idx) { + if (i + 1 < option_idx) blksize_is_set = tftp_set_blksize(h, tftp_options[i + 1]); - } } else if (strcasecmp(tftp_options[i], "tsize") == 0) { - if (i + 1 < option_idx) { + if (i + 1 < option_idx) tsize = strtol(tftp_options[i + 1], (char **)NULL, 10); - } + } else { + /* Do not allow any options we did not expect to be ACKed. */ + printf("unexpected tftp option '%s'\n", tftp_options[i]); + return (-1); } } if (!blksize_is_set) { /* * If TFTP blksize was not set, try defaulting - * to the legacy TFTP blksize of 512 + * to the legacy TFTP blksize of SEGSIZE(512) */ - h->tftp_blksize = 512; + h->tftp_blksize = SEGSIZE; + } else if (h->tftp_blksize > orig_blksize) { + /* + * Server should not be proposing block sizes that + * exceed what we said we can handle. + */ + printf("unexpected blksize %u\n", h->tftp_blksize); + return (-1); } #ifdef TFTP_DEBUG printf("tftp_blksize: %u\n", h->tftp_blksize); printf("tftp_tsize: %lu\n", h->tftp_tsize); #endif + return 0; } Modified: projects/largeSMP/lib/libusb/Makefile ============================================================================== --- projects/largeSMP/lib/libusb/Makefile Fri Jun 24 16:06:50 2011 (r223507) +++ projects/largeSMP/lib/libusb/Makefile Fri Jun 24 16:35:40 2011 (r223508) @@ -22,7 +22,7 @@ MLINKS+= libusb.3 usb.3 # libusb 0.1 compat INCS+= usb.h -SRCS+= libusb20_compat01.c +SRCS+= libusb01.c # libusb 1.0 compat INCS+= libusb.h @@ -184,6 +184,8 @@ MLINKS += libusb20.3 libusb20_dev_get_de MLINKS += libusb20.3 libusb20_dev_alloc_config.3 MLINKS += libusb20.3 libusb20_dev_alloc.3 MLINKS += libusb20.3 libusb20_dev_get_address.3 +MLINKS += libusb20.3 libusb20_dev_get_parent_address.3 +MLINKS += libusb20.3 libusb20_dev_get_parent_port.3 MLINKS += libusb20.3 libusb20_dev_get_bus_number.3 MLINKS += libusb20.3 libusb20_dev_get_mode.3 MLINKS += libusb20.3 libusb20_dev_get_speed.3 Copied: projects/largeSMP/lib/libusb/libusb01.c (from r223507, head/lib/libusb/libusb01.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/largeSMP/lib/libusb/libusb01.c Fri Jun 24 16:35:40 2011 (r223508, copy of r223507, head/lib/libusb/libusb01.c) @@ -0,0 +1,945 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2008 Hans Petter Selasky. 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. + */ + +/* + * This file contains the emulation layer for LibUSB v0.1 from sourceforge. + */ + +#include + +#include +#include +#include + +#include "libusb20.h" +#include "libusb20_desc.h" +#include "libusb20_int.h" +#include "usb.h" + +/* + * The two following macros were taken from the original LibUSB v0.1 + * for sake of compatibility: + */ +#define LIST_ADD(begin, ent) \ + do { \ + if (begin) { \ + ent->next = begin; \ + ent->next->prev = ent; \ + } else { \ + ent->next = NULL; \ + } \ + ent->prev = NULL; \ + begin = ent; \ + } while(0) + +#define LIST_DEL(begin, ent) \ + do { \ + if (ent->prev) { \ + ent->prev->next = ent->next; \ + } else { \ + begin = ent->next; \ + } \ + if (ent->next) { \ + ent->next->prev = ent->prev; \ + } \ + ent->prev = NULL; \ + ent->next = NULL; \ + } while (0) + +struct usb_bus *usb_busses = NULL; + +static struct usb_bus usb_global_bus = { + .dirname = {"/dev/usb"}, + .root_dev = NULL, + .devices = NULL, +}; + +static struct libusb20_backend *usb_backend = NULL; + +struct usb_parse_state { + + struct { + struct libusb20_endpoint *currep; + struct libusb20_interface *currifc; + struct libusb20_config *currcfg; + struct libusb20_me_struct *currextra; + } a; + + struct { + struct usb_config_descriptor *currcfg; + struct usb_interface_descriptor *currifc; + struct usb_endpoint_descriptor *currep; + struct usb_interface *currifcw; + uint8_t *currextra; + } b; + + uint8_t preparse; +}; + +static struct libusb20_transfer * +usb_get_transfer_by_ep_no(usb_dev_handle * dev, uint8_t ep_no) +{ + struct libusb20_device *pdev = (void *)dev; + struct libusb20_transfer *xfer; + int err; + uint32_t bufsize; + uint8_t x; + uint8_t speed; + + x = (ep_no & LIBUSB20_ENDPOINT_ADDRESS_MASK) * 2; + + if (ep_no & LIBUSB20_ENDPOINT_DIR_MASK) { + /* this is an IN endpoint */ + x |= 1; + } + speed = libusb20_dev_get_speed(pdev); + + /* select a sensible buffer size */ + if (speed == LIBUSB20_SPEED_LOW) { + bufsize = 256; + } else if (speed == LIBUSB20_SPEED_FULL) { + bufsize = 4096; + } else { + bufsize = 16384; + } + + xfer = libusb20_tr_get_pointer(pdev, x); + + if (xfer == NULL) + return (xfer); + + err = libusb20_tr_open(xfer, bufsize, 1, ep_no); + if (err == LIBUSB20_ERROR_BUSY) { + /* already opened */ + return (xfer); + } else if (err) { + return (NULL); + } + /* success */ + return (xfer); +} + +usb_dev_handle * +usb_open(struct usb_device *dev) +{ + int err; + + err = libusb20_dev_open(dev->dev, 16 * 2); + if (err == LIBUSB20_ERROR_BUSY) { + /* + * Workaround buggy USB applications which open the USB + * device multiple times: + */ + return (dev->dev); + } + if (err) + return (NULL); + + /* + * Dequeue USB device from backend queue so that it does not get + * freed when the backend is re-scanned: + */ + libusb20_be_dequeue_device(usb_backend, dev->dev); + + return (dev->dev); +} + +int +usb_close(usb_dev_handle * udev) +{ + struct usb_device *dev; + int err; + + err = libusb20_dev_close((void *)udev); + + if (err) + return (-1); + + if (usb_backend != NULL) { + /* + * Enqueue USB device to backend queue so that it gets freed + * when the backend is re-scanned: + */ + libusb20_be_enqueue_device(usb_backend, (void *)udev); + } else { + /* + * The backend is gone. Free device data so that we + * don't start leaking memory! + */ + dev = usb_device(udev); + libusb20_dev_free((void *)udev); + LIST_DEL(usb_global_bus.devices, dev); + free(dev); + } + return (0); +} + +int +usb_get_string(usb_dev_handle * dev, int strindex, + int langid, char *buf, size_t buflen) +{ + int err; + + err = libusb20_dev_req_string_sync((void *)dev, + strindex, langid, buf, buflen); + + if (err) + return (-1); + + return (0); +} + +int +usb_get_string_simple(usb_dev_handle * dev, int strindex, + char *buf, size_t buflen) +{ + int err; + + err = libusb20_dev_req_string_simple_sync((void *)dev, + strindex, buf, buflen); + + if (err) + return (-1); + + return (strlen(buf)); +} + +int +usb_get_descriptor_by_endpoint(usb_dev_handle * udev, int ep, uint8_t type, + uint8_t ep_index, void *buf, int size) +{ + memset(buf, 0, size); + + return (usb_control_msg(udev, ep | USB_ENDPOINT_IN, + USB_REQ_GET_DESCRIPTOR, (type << 8) + ep_index, 0, + buf, size, 1000)); +} + +int +usb_get_descriptor(usb_dev_handle * udev, uint8_t type, uint8_t desc_index, + void *buf, int size) +{ + memset(buf, 0, size); + + return (usb_control_msg(udev, USB_ENDPOINT_IN, USB_REQ_GET_DESCRIPTOR, + (type << 8) + desc_index, 0, buf, size, 1000)); +} + +int +usb_parse_descriptor(uint8_t *source, char *description, void *dest) +{ + uint8_t *sp = source; + uint8_t *dp = dest; + uint16_t w; + uint32_t d; + char *cp; + + for (cp = description; *cp; cp++) { + switch (*cp) { + case 'b': /* 8-bit byte */ + *dp++ = *sp++; + break; + /* + * 16-bit word, convert from little endian to CPU + */ + case 'w': + w = (sp[1] << 8) | sp[0]; + sp += 2; + /* Align to word boundary */ + dp += ((dp - (uint8_t *)0) & 1); + *((uint16_t *)dp) = w; + dp += 2; + break; + /* + * 32-bit dword, convert from little endian to CPU + */ + case 'd': + d = (sp[3] << 24) | (sp[2] << 16) | + (sp[1] << 8) | sp[0]; + sp += 4; + /* Align to word boundary */ + dp += ((dp - (uint8_t *)0) & 1); + /* Align to double word boundary */ + dp += ((dp - (uint8_t *)0) & 2); + *((uint32_t *)dp) = d; + dp += 4; + break; + } + } + return (sp - source); +} + +static void +usb_parse_extra(struct usb_parse_state *ps, uint8_t **pptr, int *plen) +{ + void *ptr; + uint16_t len; + + ptr = ps->a.currextra->ptr; + len = ps->a.currextra->len; + + if (ps->preparse == 0) { + memcpy(ps->b.currextra, ptr, len); + *pptr = ps->b.currextra; + *plen = len; + } + ps->b.currextra += len; + return; +} + +static void +usb_parse_endpoint(struct usb_parse_state *ps) +{ + struct usb_endpoint_descriptor *bep; + struct libusb20_endpoint *aep; + + aep = ps->a.currep; + bep = ps->b.currep++; + + if (ps->preparse == 0) { + /* copy descriptor fields */ + bep->bLength = aep->desc.bLength; + bep->bDescriptorType = aep->desc.bDescriptorType; + bep->bEndpointAddress = aep->desc.bEndpointAddress; + bep->bmAttributes = aep->desc.bmAttributes; + bep->wMaxPacketSize = aep->desc.wMaxPacketSize; + bep->bInterval = aep->desc.bInterval; + bep->bRefresh = aep->desc.bRefresh; + bep->bSynchAddress = aep->desc.bSynchAddress; + } + ps->a.currextra = &aep->extra; + usb_parse_extra(ps, &bep->extra, &bep->extralen); + return; +} + +static void +usb_parse_iface_sub(struct usb_parse_state *ps) +{ + struct libusb20_interface *aifc; + struct usb_interface_descriptor *bifc; + uint8_t x; + + aifc = ps->a.currifc; + bifc = ps->b.currifc++; + + if (ps->preparse == 0) { + /* copy descriptor fields */ + bifc->bLength = aifc->desc.bLength; + bifc->bDescriptorType = aifc->desc.bDescriptorType; + bifc->bInterfaceNumber = aifc->desc.bInterfaceNumber; + bifc->bAlternateSetting = aifc->desc.bAlternateSetting; + bifc->bNumEndpoints = aifc->num_endpoints; + bifc->bInterfaceClass = aifc->desc.bInterfaceClass; + bifc->bInterfaceSubClass = aifc->desc.bInterfaceSubClass; + bifc->bInterfaceProtocol = aifc->desc.bInterfaceProtocol; + bifc->iInterface = aifc->desc.iInterface; + bifc->endpoint = ps->b.currep; + } + for (x = 0; x != aifc->num_endpoints; x++) { + ps->a.currep = aifc->endpoints + x; + usb_parse_endpoint(ps); + } + + ps->a.currextra = &aifc->extra; + usb_parse_extra(ps, &bifc->extra, &bifc->extralen); + return; +} + +static void +usb_parse_iface(struct usb_parse_state *ps) +{ + struct libusb20_interface *aifc; + struct usb_interface *bifc; + uint8_t x; + + aifc = ps->a.currifc; + bifc = ps->b.currifcw++; + + if (ps->preparse == 0) { + /* initialise interface wrapper */ + bifc->altsetting = ps->b.currifc; + bifc->num_altsetting = aifc->num_altsetting + 1; + } + usb_parse_iface_sub(ps); + + for (x = 0; x != aifc->num_altsetting; x++) { + ps->a.currifc = aifc->altsetting + x; + usb_parse_iface_sub(ps); + } + return; +} + +static void +usb_parse_config(struct usb_parse_state *ps) +{ + struct libusb20_config *acfg; + struct usb_config_descriptor *bcfg; + uint8_t x; + + acfg = ps->a.currcfg; + bcfg = ps->b.currcfg; + + if (ps->preparse == 0) { + /* initialise config wrapper */ + bcfg->bLength = acfg->desc.bLength; + bcfg->bDescriptorType = acfg->desc.bDescriptorType; + bcfg->wTotalLength = acfg->desc.wTotalLength; + bcfg->bNumInterfaces = acfg->num_interface; + bcfg->bConfigurationValue = acfg->desc.bConfigurationValue; + bcfg->iConfiguration = acfg->desc.iConfiguration; + bcfg->bmAttributes = acfg->desc.bmAttributes; + bcfg->MaxPower = acfg->desc.bMaxPower; + bcfg->interface = ps->b.currifcw; + } + for (x = 0; x != acfg->num_interface; x++) { + ps->a.currifc = acfg->interface + x; + usb_parse_iface(ps); + } + + ps->a.currextra = &acfg->extra; + usb_parse_extra(ps, &bcfg->extra, &bcfg->extralen); + return; +} + +int +usb_parse_configuration(struct usb_config_descriptor *config, + uint8_t *buffer) +{ + struct usb_parse_state ps; + uint8_t *ptr; + uint32_t a; + uint32_t b; + uint32_t c; + uint32_t d; + + if ((buffer == NULL) || (config == NULL)) { + return (-1); + } + memset(&ps, 0, sizeof(ps)); + + ps.a.currcfg = libusb20_parse_config_desc(buffer); + ps.b.currcfg = config; + if (ps.a.currcfg == NULL) { + /* could not parse config or out of memory */ + return (-1); + } + /* do the pre-parse */ + ps.preparse = 1; + usb_parse_config(&ps); + + a = ((uint8_t *)(ps.b.currifcw) - ((uint8_t *)0)); + b = ((uint8_t *)(ps.b.currifc) - ((uint8_t *)0)); + c = ((uint8_t *)(ps.b.currep) - ((uint8_t *)0)); + d = ((uint8_t *)(ps.b.currextra) - ((uint8_t *)0)); + + /* allocate memory for our configuration */ + ptr = malloc(a + b + c + d); + if (ptr == NULL) { + /* free config structure */ + free(ps.a.currcfg); + return (-1); + } + + /* "currifcw" must be first, hence this pointer is freed */ + ps.b.currifcw = (void *)(ptr); + ps.b.currifc = (void *)(ptr + a); + ps.b.currep = (void *)(ptr + a + b); + ps.b.currextra = (void *)(ptr + a + b + c); + + /* generate a libusb v0.1 compatible structure */ + ps.preparse = 0; + usb_parse_config(&ps); + + /* free config structure */ + free(ps.a.currcfg); + *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***