From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 00:04:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EF6D10656A5; Sun, 22 Aug 2010 00:04:25 +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 EFC428FC17; Sun, 22 Aug 2010 00:04:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7M04OqB084584; Sun, 22 Aug 2010 00:04:24 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7M04O4V084577; Sun, 22 Aug 2010 00:04:24 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201008220004.o7M04O4V084577@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 22 Aug 2010 00:04:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211595 - in stable/8/sys: conf powerpc/aim powerpc/booke powerpc/include powerpc/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 00:04:25 -0000 Author: nwhitehorn Date: Sun Aug 22 00:04:24 2010 New Revision: 211595 URL: http://svn.freebsd.org/changeset/base/211595 Log: MFC r209950: Unify ABI-related bits of the Book-E and AIM machdep routines (exec_setregs, etc.) in order to simplify the addition of 64-bit support, and possible future extension of the Book-E code to handle hard floating point and Altivec. Added: stable/8/sys/powerpc/powerpc/exec_machdep.c - copied, changed from r209950, head/sys/powerpc/powerpc/exec_machdep.c Modified: stable/8/sys/conf/files.powerpc stable/8/sys/powerpc/aim/machdep.c stable/8/sys/powerpc/aim/vm_machdep.c stable/8/sys/powerpc/booke/machdep.c stable/8/sys/powerpc/booke/vm_machdep.c stable/8/sys/powerpc/include/psl.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/conf/files.powerpc ============================================================================== --- stable/8/sys/conf/files.powerpc Sat Aug 21 23:13:16 2010 (r211594) +++ stable/8/sys/conf/files.powerpc Sun Aug 22 00:04:24 2010 (r211595) @@ -157,6 +157,7 @@ powerpc/powerpc/db_interface.c optional powerpc/powerpc/db_trace.c optional ddb powerpc/powerpc/dump_machdep.c standard powerpc/powerpc/elf_machdep.c standard +powerpc/powerpc/exec_machdep.c standard powerpc/powerpc/fpu.c optional aim powerpc/powerpc/fuswintr.c standard powerpc/powerpc/gdb_machdep.c optional gdb Modified: stable/8/sys/powerpc/aim/machdep.c ============================================================================== --- stable/8/sys/powerpc/aim/machdep.c Sat Aug 21 23:13:16 2010 (r211594) +++ stable/8/sys/powerpc/aim/machdep.c Sun Aug 22 00:04:24 2010 (r211595) @@ -154,8 +154,6 @@ void install_extint(void (*)(void)); int setfault(faultbuf); /* defined in locore.S */ -static int grab_mcontext(struct thread *, mcontext_t *, int); - void asm_panic(char *); long Maxmem = 0; @@ -579,295 +577,6 @@ bzero(void *buf, size_t len) } void -sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) -{ - struct trapframe *tf; - struct sigframe *sfp; - struct sigacts *psp; - struct sigframe sf; - struct thread *td; - struct proc *p; - int oonstack, rndfsize; - int sig; - int code; - - td = curthread; - p = td->td_proc; - PROC_LOCK_ASSERT(p, MA_OWNED); - sig = ksi->ksi_signo; - code = ksi->ksi_code; - psp = p->p_sigacts; - mtx_assert(&psp->ps_mtx, MA_OWNED); - tf = td->td_frame; - oonstack = sigonstack(tf->fixreg[1]); - - rndfsize = ((sizeof(sf) + 15) / 16) * 16; - - CTR4(KTR_SIG, "sendsig: td=%p (%s) catcher=%p sig=%d", td, p->p_comm, - catcher, sig); - - /* - * Save user context - */ - memset(&sf, 0, sizeof(sf)); - grab_mcontext(td, &sf.sf_uc.uc_mcontext, 0); - sf.sf_uc.uc_sigmask = *mask; - sf.sf_uc.uc_stack = td->td_sigstk; - sf.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) - ? ((oonstack) ? SS_ONSTACK : 0) : SS_DISABLE; - - sf.sf_uc.uc_mcontext.mc_onstack = (oonstack) ? 1 : 0; - - /* - * Allocate and validate space for the signal handler context. - */ - if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && - SIGISMEMBER(psp->ps_sigonstack, sig)) { - sfp = (struct sigframe *)(td->td_sigstk.ss_sp + - td->td_sigstk.ss_size - rndfsize); - } else { - sfp = (struct sigframe *)(tf->fixreg[1] - rndfsize); - } - - /* - * Translate the signal if appropriate (Linux emu ?) - */ - if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - - /* - * Save the floating-point state, if necessary, then copy it. - */ - /* XXX */ - - /* - * Set up the registers to return to sigcode. - * - * r1/sp - sigframe ptr - * lr - sig function, dispatched to by blrl in trampoline - * r3 - sig number - * r4 - SIGINFO ? &siginfo : exception code - * r5 - user context - * srr0 - trampoline function addr - */ - tf->lr = (register_t)catcher; - tf->fixreg[1] = (register_t)sfp; - tf->fixreg[FIRSTARG] = sig; - tf->fixreg[FIRSTARG+2] = (register_t)&sfp->sf_uc; - if (SIGISMEMBER(psp->ps_siginfo, sig)) { - /* - * Signal handler installed with SA_SIGINFO. - */ - tf->fixreg[FIRSTARG+1] = (register_t)&sfp->sf_si; - - /* - * Fill siginfo structure. - */ - sf.sf_si = ksi->ksi_info; - sf.sf_si.si_signo = sig; - sf.sf_si.si_addr = (void *)((tf->exc == EXC_DSI) ? - tf->cpu.aim.dar : tf->srr0); - } else { - /* Old FreeBSD-style arguments. */ - tf->fixreg[FIRSTARG+1] = code; - tf->fixreg[FIRSTARG+3] = (tf->exc == EXC_DSI) ? - tf->cpu.aim.dar : tf->srr0; - } - mtx_unlock(&psp->ps_mtx); - PROC_UNLOCK(p); - - tf->srr0 = (register_t)(PS_STRINGS - *(p->p_sysent->sv_szsigcode)); - - /* - * copy the frame out to userland. - */ - if (copyout(&sf, sfp, sizeof(*sfp)) != 0) { - /* - * Process has trashed its stack. Kill it. - */ - CTR2(KTR_SIG, "sendsig: sigexit td=%p sfp=%p", td, sfp); - PROC_LOCK(p); - sigexit(td, SIGILL); - } - - CTR3(KTR_SIG, "sendsig: return td=%p pc=%#x sp=%#x", td, - tf->srr0, tf->fixreg[1]); - - PROC_LOCK(p); - mtx_lock(&psp->ps_mtx); -} - -int -sigreturn(struct thread *td, struct sigreturn_args *uap) -{ - ucontext_t uc; - int error; - - CTR2(KTR_SIG, "sigreturn: td=%p ucp=%p", td, uap->sigcntxp); - - if (copyin(uap->sigcntxp, &uc, sizeof(uc)) != 0) { - CTR1(KTR_SIG, "sigreturn: efault td=%p", td); - return (EFAULT); - } - - error = set_mcontext(td, &uc.uc_mcontext); - if (error != 0) - return (error); - - kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); - - CTR3(KTR_SIG, "sigreturn: return td=%p pc=%#x sp=%#x", - td, uc.uc_mcontext.mc_srr0, uc.uc_mcontext.mc_gpr[1]); - - return (EJUSTRETURN); -} - -#ifdef COMPAT_FREEBSD4 -int -freebsd4_sigreturn(struct thread *td, struct freebsd4_sigreturn_args *uap) -{ - - return sigreturn(td, (struct sigreturn_args *)uap); -} -#endif - -/* - * Construct a PCB from a trapframe. This is called from kdb_trap() where - * we want to start a backtrace from the function that caused us to enter - * the debugger. We have the context in the trapframe, but base the trace - * on the PCB. The PCB doesn't have to be perfect, as long as it contains - * enough for a backtrace. - */ -void -makectx(struct trapframe *tf, struct pcb *pcb) -{ - - pcb->pcb_lr = tf->srr0; - pcb->pcb_sp = tf->fixreg[1]; -} - -/* - * get_mcontext/sendsig helper routine that doesn't touch the - * proc lock - */ -static int -grab_mcontext(struct thread *td, mcontext_t *mcp, int flags) -{ - struct pcb *pcb; - - pcb = td->td_pcb; - - memset(mcp, 0, sizeof(mcontext_t)); - - mcp->mc_vers = _MC_VERSION; - mcp->mc_flags = 0; - memcpy(&mcp->mc_frame, td->td_frame, sizeof(struct trapframe)); - if (flags & GET_MC_CLEAR_RET) { - mcp->mc_gpr[3] = 0; - mcp->mc_gpr[4] = 0; - } - - /* - * This assumes that floating-point context is *not* lazy, - * so if the thread has used FP there would have been a - * FP-unavailable exception that would have set things up - * correctly. - */ - if (pcb->pcb_flags & PCB_FPU) { - KASSERT(td == curthread, - ("get_mcontext: fp save not curthread")); - critical_enter(); - save_fpu(td); - critical_exit(); - mcp->mc_flags |= _MC_FP_VALID; - memcpy(&mcp->mc_fpscr, &pcb->pcb_fpu.fpscr, sizeof(double)); - memcpy(mcp->mc_fpreg, pcb->pcb_fpu.fpr, 32*sizeof(double)); - } - - /* - * Repeat for Altivec context - */ - - if (pcb->pcb_flags & PCB_VEC) { - KASSERT(td == curthread, - ("get_mcontext: fp save not curthread")); - critical_enter(); - save_vec(td); - critical_exit(); - mcp->mc_flags |= _MC_AV_VALID; - mcp->mc_vscr = pcb->pcb_vec.vscr; - mcp->mc_vrsave = pcb->pcb_vec.vrsave; - memcpy(mcp->mc_avec, pcb->pcb_vec.vr, sizeof(mcp->mc_avec)); - } - - mcp->mc_len = sizeof(*mcp); - - return (0); -} - -int -get_mcontext(struct thread *td, mcontext_t *mcp, int flags) -{ - int error; - - error = grab_mcontext(td, mcp, flags); - if (error == 0) { - PROC_LOCK(curthread->td_proc); - mcp->mc_onstack = sigonstack(td->td_frame->fixreg[1]); - PROC_UNLOCK(curthread->td_proc); - } - - return (error); -} - -int -set_mcontext(struct thread *td, const mcontext_t *mcp) -{ - struct pcb *pcb; - struct trapframe *tf; - - pcb = td->td_pcb; - tf = td->td_frame; - - if (mcp->mc_vers != _MC_VERSION || - mcp->mc_len != sizeof(*mcp)) - return (EINVAL); - - /* - * Don't let the user set privileged MSR bits - */ - if ((mcp->mc_srr1 & PSL_USERSTATIC) != (tf->srr1 & PSL_USERSTATIC)) { - return (EINVAL); - } - - memcpy(tf, mcp->mc_frame, sizeof(mcp->mc_frame)); - - if (mcp->mc_flags & _MC_FP_VALID) { - if ((pcb->pcb_flags & PCB_FPU) != PCB_FPU) { - critical_enter(); - enable_fpu(td); - critical_exit(); - } - memcpy(&pcb->pcb_fpu.fpscr, &mcp->mc_fpscr, sizeof(double)); - memcpy(pcb->pcb_fpu.fpr, mcp->mc_fpreg, 32*sizeof(double)); - } - - if (mcp->mc_flags & _MC_AV_VALID) { - if ((pcb->pcb_flags & PCB_VEC) != PCB_VEC) { - critical_enter(); - enable_vec(td); - critical_exit(); - } - pcb->pcb_vec.vscr = mcp->mc_vscr; - pcb->pcb_vec.vrsave = mcp->mc_vrsave; - memcpy(pcb->pcb_vec.vr, mcp->mc_avec, sizeof(mcp->mc_avec)); - } - - - return (0); -} - -void cpu_boot(int howto) { } @@ -929,123 +638,6 @@ cpu_idle_wakeup(int cpu) return (0); } -/* - * Set set up registers on exec. - */ -void -exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings) -{ - struct trapframe *tf; - struct ps_strings arginfo; - - tf = trapframe(td); - bzero(tf, sizeof *tf); - tf->fixreg[1] = -roundup(-stack + 8, 16); - - /* - * XXX Machine-independent code has already copied arguments and - * XXX environment to userland. Get them back here. - */ - (void)copyin((char *)PS_STRINGS, &arginfo, sizeof(arginfo)); - - /* - * Set up arguments for _start(): - * _start(argc, argv, envp, obj, cleanup, ps_strings); - * - * Notes: - * - obj and cleanup are the auxilliary and termination - * vectors. They are fixed up by ld.elf_so. - * - ps_strings is a NetBSD extention, and will be - * ignored by executables which are strictly - * compliant with the SVR4 ABI. - * - * XXX We have to set both regs and retval here due to different - * XXX calling convention in trap.c and init_main.c. - */ - /* - * XXX PG: these get overwritten in the syscall return code. - * execve() should return EJUSTRETURN, like it does on NetBSD. - * Emulate by setting the syscall return value cells. The - * registers still have to be set for init's fork trampoline. - */ - td->td_retval[0] = arginfo.ps_nargvstr; - td->td_retval[1] = (register_t)arginfo.ps_argvstr; - tf->fixreg[3] = arginfo.ps_nargvstr; - tf->fixreg[4] = (register_t)arginfo.ps_argvstr; - tf->fixreg[5] = (register_t)arginfo.ps_envstr; - tf->fixreg[6] = 0; /* auxillary vector */ - tf->fixreg[7] = 0; /* termination vector */ - tf->fixreg[8] = (register_t)PS_STRINGS; /* NetBSD extension */ - - tf->srr0 = entry; - tf->srr1 = PSL_MBO | PSL_USERSET | PSL_FE_DFLT; - td->td_pcb->pcb_flags = 0; -} - -int -fill_regs(struct thread *td, struct reg *regs) -{ - struct trapframe *tf; - - tf = td->td_frame; - memcpy(regs, tf, sizeof(struct reg)); - - return (0); -} - -int -fill_dbregs(struct thread *td, struct dbreg *dbregs) -{ - /* No debug registers on PowerPC */ - return (ENOSYS); -} - -int -fill_fpregs(struct thread *td, struct fpreg *fpregs) -{ - struct pcb *pcb; - - pcb = td->td_pcb; - - if ((pcb->pcb_flags & PCB_FPU) == 0) - memset(fpregs, 0, sizeof(struct fpreg)); - else - memcpy(fpregs, &pcb->pcb_fpu, sizeof(struct fpreg)); - - return (0); -} - -int -set_regs(struct thread *td, struct reg *regs) -{ - struct trapframe *tf; - - tf = td->td_frame; - memcpy(tf, regs, sizeof(struct reg)); - - return (0); -} - -int -set_dbregs(struct thread *td, struct dbreg *dbregs) -{ - /* No debug registers on PowerPC */ - return (ENOSYS); -} - -int -set_fpregs(struct thread *td, struct fpreg *fpregs) -{ - struct pcb *pcb; - - pcb = td->td_pcb; - if ((pcb->pcb_flags & PCB_FPU) == 0) - enable_fpu(td); - memcpy(&pcb->pcb_fpu, fpregs, sizeof(struct fpreg)); - - return (0); -} - int ptrace_set_pc(struct thread *td, unsigned long addr) { Modified: stable/8/sys/powerpc/aim/vm_machdep.c ============================================================================== --- stable/8/sys/powerpc/aim/vm_machdep.c Sat Aug 21 23:13:16 2010 (r211594) +++ stable/8/sys/powerpc/aim/vm_machdep.c Sun Aug 22 00:04:24 2010 (r211595) @@ -358,6 +358,7 @@ sf_buf_free(struct sf_buf *sf) void swi_vm(void *dummy) { + if (busdma_swi_pending != 0) busdma_swi(); } @@ -385,31 +386,6 @@ is_physical_memory(addr) /* * Threading functions */ -void -cpu_thread_exit(struct thread *td) -{ -} - -void -cpu_thread_clean(struct thread *td) -{ -} - -void -cpu_thread_alloc(struct thread *td) -{ - struct pcb *pcb; - - pcb = (struct pcb *)((td->td_kstack + td->td_kstack_pages * PAGE_SIZE - - sizeof(struct pcb)) & ~0x2fU); - td->td_pcb = pcb; - td->td_frame = (struct trapframe *)pcb - 1; -} - -void -cpu_thread_free(struct thread *td) -{ -} void cpu_thread_swapin(struct thread *td) @@ -421,121 +397,3 @@ cpu_thread_swapout(struct thread *td) { } -void -cpu_set_syscall_retval(struct thread *td, int error) -{ - struct proc *p; - struct trapframe *tf; - int fixup; - - if (error == EJUSTRETURN) - return; - - p = td->td_proc; - tf = td->td_frame; - - if (tf->fixreg[0] == SYS___syscall) { - int code = tf->fixreg[FIRSTARG + 1]; - if (p->p_sysent->sv_mask) - code &= p->p_sysent->sv_mask; - fixup = (code != SYS_freebsd6_lseek && code != SYS_lseek) ? - 1 : 0; - } else - fixup = 0; - - switch (error) { - case 0: - if (fixup) { - /* - * 64-bit return, 32-bit syscall. Fixup byte order - */ - tf->fixreg[FIRSTARG] = 0; - tf->fixreg[FIRSTARG + 1] = td->td_retval[0]; - } else { - tf->fixreg[FIRSTARG] = td->td_retval[0]; - tf->fixreg[FIRSTARG + 1] = td->td_retval[1]; - } - tf->cr &= ~0x10000000; /* XXX: Magic number */ - break; - case ERESTART: - /* - * Set user's pc back to redo the system call. - */ - tf->srr0 -= 4; - break; - default: - if (p->p_sysent->sv_errsize) { - error = (error < p->p_sysent->sv_errsize) ? - p->p_sysent->sv_errtbl[error] : -1; - } - tf->fixreg[FIRSTARG] = error; - tf->cr |= 0x10000000; /* XXX: Magic number */ - break; - } -} - -void -cpu_set_upcall(struct thread *td, struct thread *td0) -{ - struct pcb *pcb2; - struct trapframe *tf; - struct callframe *cf; - - pcb2 = td->td_pcb; - - /* Copy the upcall pcb */ - bcopy(td0->td_pcb, pcb2, sizeof(*pcb2)); - - /* Create a stack for the new thread */ - tf = td->td_frame; - bcopy(td0->td_frame, tf, sizeof(struct trapframe)); - tf->fixreg[FIRSTARG] = 0; - tf->fixreg[FIRSTARG + 1] = 0; - tf->cr &= ~0x10000000; - - /* Set registers for trampoline to user mode. */ - cf = (struct callframe *)tf - 1; - memset(cf, 0, sizeof(struct callframe)); - cf->cf_func = (register_t)fork_return; - cf->cf_arg0 = (register_t)td; - cf->cf_arg1 = (register_t)tf; - - pcb2->pcb_sp = (register_t)cf; - pcb2->pcb_lr = (register_t)fork_trampoline; - pcb2->pcb_cpu.aim.usr = kernel_pmap->pm_sr[USER_SR]; - - /* Setup to release spin count in fork_exit(). */ - td->td_md.md_spinlock_count = 1; - td->td_md.md_saved_msr = PSL_KERNSET; -} - -void -cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg, - stack_t *stack) -{ - struct trapframe *tf; - uint32_t sp; - - tf = td->td_frame; - /* align stack and alloc space for frame ptr and saved LR */ - sp = ((uint32_t)stack->ss_sp + stack->ss_size - sizeof(uint64_t)) & - ~0x1f; - bzero(tf, sizeof(struct trapframe)); - - tf->fixreg[1] = (register_t)sp; - tf->fixreg[3] = (register_t)arg; - tf->srr0 = (register_t)entry; - tf->srr1 = PSL_MBO | PSL_USERSET | PSL_FE_DFLT; - td->td_pcb->pcb_flags = 0; - - td->td_retval[0] = (register_t)entry; - td->td_retval[1] = 0; -} - -int -cpu_set_user_tls(struct thread *td, void *tls_base) -{ - - td->td_frame->fixreg[2] = (register_t)tls_base + 0x7008; - return (0); -} Modified: stable/8/sys/powerpc/booke/machdep.c ============================================================================== --- stable/8/sys/powerpc/booke/machdep.c Sat Aug 21 23:13:16 2010 (r211594) +++ stable/8/sys/powerpc/booke/machdep.c Sun Aug 22 00:04:24 2010 (r211595) @@ -507,75 +507,6 @@ cpu_pcpu_init(struct pcpu *pcpu, int cpu #endif } -/* Set set up registers on exec. */ -void -exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings) -{ - struct trapframe *tf; - struct ps_strings arginfo; - - tf = trapframe(td); - bzero(tf, sizeof *tf); - tf->fixreg[1] = -roundup(-stack + 8, 16); - - /* - * XXX Machine-independent code has already copied arguments and - * XXX environment to userland. Get them back here. - */ - (void)copyin((char *)PS_STRINGS, &arginfo, sizeof(arginfo)); - - /* - * Set up arguments for _start(): - * _start(argc, argv, envp, obj, cleanup, ps_strings); - * - * Notes: - * - obj and cleanup are the auxilliary and termination - * vectors. They are fixed up by ld.elf_so. - * - ps_strings is a NetBSD extention, and will be - * ignored by executables which are strictly - * compliant with the SVR4 ABI. - * - * XXX We have to set both regs and retval here due to different - * XXX calling convention in trap.c and init_main.c. - */ - /* - * XXX PG: these get overwritten in the syscall return code. - * execve() should return EJUSTRETURN, like it does on NetBSD. - * Emulate by setting the syscall return value cells. The - * registers still have to be set for init's fork trampoline. - */ - td->td_retval[0] = arginfo.ps_nargvstr; - td->td_retval[1] = (register_t)arginfo.ps_argvstr; - tf->fixreg[3] = arginfo.ps_nargvstr; - tf->fixreg[4] = (register_t)arginfo.ps_argvstr; - tf->fixreg[5] = (register_t)arginfo.ps_envstr; - tf->fixreg[6] = 0; /* auxillary vector */ - tf->fixreg[7] = 0; /* termination vector */ - tf->fixreg[8] = (register_t)PS_STRINGS; /* NetBSD extension */ - - tf->srr0 = entry; - tf->srr1 = PSL_USERSET; - td->td_pcb->pcb_flags = 0; -} - -int -fill_regs(struct thread *td, struct reg *regs) -{ - struct trapframe *tf; - - tf = td->td_frame; - memcpy(regs, tf, sizeof(struct reg)); - - return (0); -} - -int -fill_fpregs(struct thread *td, struct fpreg *fpregs) -{ - - return (0); -} - /* * Flush the D-cache for non-DMA I/O so that the I-cache can * be made coherent later. @@ -587,115 +518,6 @@ cpu_flush_dcache(void *ptr, size_t len) } /* - * Construct a PCB from a trapframe. This is called from kdb_trap() where - * we want to start a backtrace from the function that caused us to enter - * the debugger. We have the context in the trapframe, but base the trace - * on the PCB. The PCB doesn't have to be perfect, as long as it contains - * enough for a backtrace. - */ -void -makectx(struct trapframe *tf, struct pcb *pcb) -{ - - pcb->pcb_lr = tf->srr0; - pcb->pcb_sp = tf->fixreg[1]; -} - -/* - * get_mcontext/sendsig helper routine that doesn't touch the - * proc lock. - */ -static int -grab_mcontext(struct thread *td, mcontext_t *mcp, int flags) -{ - struct pcb *pcb; - - pcb = td->td_pcb; - memset(mcp, 0, sizeof(mcontext_t)); - - mcp->mc_vers = _MC_VERSION; - mcp->mc_flags = 0; - memcpy(&mcp->mc_frame, td->td_frame, sizeof(struct trapframe)); - if (flags & GET_MC_CLEAR_RET) { - mcp->mc_gpr[3] = 0; - mcp->mc_gpr[4] = 0; - } - - /* XXX Altivec context ? */ - - mcp->mc_len = sizeof(*mcp); - return (0); -} - -int -get_mcontext(struct thread *td, mcontext_t *mcp, int flags) -{ - int error; - - error = grab_mcontext(td, mcp, flags); - if (error == 0) { - PROC_LOCK(curthread->td_proc); - mcp->mc_onstack = sigonstack(td->td_frame->fixreg[1]); - PROC_UNLOCK(curthread->td_proc); - } - - return (error); -} - -int -set_mcontext(struct thread *td, const mcontext_t *mcp) -{ - struct pcb *pcb; - struct trapframe *tf; - - pcb = td->td_pcb; - tf = td->td_frame; - - if (mcp->mc_vers != _MC_VERSION || mcp->mc_len != sizeof(*mcp)) - return (EINVAL); - - memcpy(tf, mcp->mc_frame, sizeof(mcp->mc_frame)); - - /* XXX Altivec context? */ - - return (0); -} - -int -sigreturn(struct thread *td, struct sigreturn_args *uap) -{ - ucontext_t uc; - int error; - - CTR2(KTR_SIG, "sigreturn: td=%p ucp=%p", td, uap->sigcntxp); - - if (copyin(uap->sigcntxp, &uc, sizeof(uc)) != 0) { - CTR1(KTR_SIG, "sigreturn: efault td=%p", td); - return (EFAULT); - } - - error = set_mcontext(td, &uc.uc_mcontext); - if (error != 0) - return (error); - - kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); - - CTR3(KTR_SIG, "sigreturn: return td=%p pc=%#x sp=%#x", - td, uc.uc_mcontext.mc_srr0, uc.uc_mcontext.mc_gpr[1]); - - return (EJUSTRETURN); -} - -#ifdef COMPAT_FREEBSD4 -int -freebsd4_sigreturn(struct thread *td, struct freebsd4_sigreturn_args *uap) -{ - - return sigreturn(td, (struct sigreturn_args *)uap); -} -#endif - -/* * cpu_idle * * Set Wait state enable. @@ -761,39 +583,6 @@ cpu_halt(void) } int -set_regs(struct thread *td, struct reg *regs) -{ - struct trapframe *tf; - - tf = td->td_frame; - memcpy(tf, regs, sizeof(struct reg)); - return (0); -} - -int -fill_dbregs(struct thread *td, struct dbreg *dbregs) -{ - - /* No debug registers on PowerPC */ - return (ENOSYS); -} - -int -set_dbregs(struct thread *td, struct dbreg *dbregs) -{ - - /* No debug registers on PowerPC */ - return (ENOSYS); -} - -int -set_fpregs(struct thread *td, struct fpreg *fpregs) -{ - - return (0); -} - -int ptrace_set_pc(struct thread *td, unsigned long addr) { struct trapframe *tf; @@ -847,124 +636,6 @@ kdb_cpu_set_singlestep(void) } void -sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) -{ - struct trapframe *tf; - struct sigframe *sfp; - struct sigacts *psp; - struct sigframe sf; - struct thread *td; - struct proc *p; - int oonstack, rndfsize; - int sig, code; - - td = curthread; - p = td->td_proc; - PROC_LOCK_ASSERT(p, MA_OWNED); - sig = ksi->ksi_signo; - code = ksi->ksi_code; - psp = p->p_sigacts; - mtx_assert(&psp->ps_mtx, MA_OWNED); - tf = td->td_frame; - oonstack = sigonstack(tf->fixreg[1]); - - rndfsize = ((sizeof(sf) + 15) / 16) * 16; - - CTR4(KTR_SIG, "sendsig: td=%p (%s) catcher=%p sig=%d", td, p->p_comm, - catcher, sig); - - /* - * Save user context - */ - memset(&sf, 0, sizeof(sf)); - grab_mcontext(td, &sf.sf_uc.uc_mcontext, 0); - sf.sf_uc.uc_sigmask = *mask; - sf.sf_uc.uc_stack = td->td_sigstk; - sf.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) - ? ((oonstack) ? SS_ONSTACK : 0) : SS_DISABLE; - - sf.sf_uc.uc_mcontext.mc_onstack = (oonstack) ? 1 : 0; - - /* - * Allocate and validate space for the signal handler context. - */ - if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && - SIGISMEMBER(psp->ps_sigonstack, sig)) { - sfp = (struct sigframe *)((caddr_t)td->td_sigstk.ss_sp + - td->td_sigstk.ss_size - rndfsize); - } else { - sfp = (struct sigframe *)(tf->fixreg[1] - rndfsize); - } - - /* - * Translate the signal if appropriate (Linux emu ?) - */ - if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - - /* - * Save the floating-point state, if necessary, then copy it. - */ - /* XXX */ - - /* - * Set up the registers to return to sigcode. - * - * r1/sp - sigframe ptr - * lr - sig function, dispatched to by blrl in trampoline - * r3 - sig number - * r4 - SIGINFO ? &siginfo : exception code - * r5 - user context - * srr0 - trampoline function addr - */ - tf->lr = (register_t)catcher; - tf->fixreg[1] = (register_t)sfp; - tf->fixreg[FIRSTARG] = sig; - tf->fixreg[FIRSTARG+2] = (register_t)&sfp->sf_uc; - if (SIGISMEMBER(psp->ps_siginfo, sig)) { - /* - * Signal handler installed with SA_SIGINFO. - */ - tf->fixreg[FIRSTARG+1] = (register_t)&sfp->sf_si; - - /* - * Fill siginfo structure. - */ - sf.sf_si = ksi->ksi_info; - sf.sf_si.si_signo = sig; - sf.sf_si.si_addr = (void *) ((tf->exc == EXC_DSI) ? - tf->cpu.booke.dear : tf->srr0); - } else { - /* Old FreeBSD-style arguments. */ - tf->fixreg[FIRSTARG+1] = code; - tf->fixreg[FIRSTARG+3] = (tf->exc == EXC_DSI) ? - tf->cpu.booke.dear : tf->srr0; - } - mtx_unlock(&psp->ps_mtx); - PROC_UNLOCK(p); - - tf->srr0 = (register_t)(PS_STRINGS - *(p->p_sysent->sv_szsigcode)); - - /* - * copy the frame out to userland. - */ - if (copyout((caddr_t)&sf, (caddr_t)sfp, sizeof(sf)) != 0) { - /* - * Process has trashed its stack. Kill it. - */ - CTR2(KTR_SIG, "sendsig: sigexit td=%p sfp=%p", td, sfp); - PROC_LOCK(p); - sigexit(td, SIGILL); - } - - CTR3(KTR_SIG, "sendsig: return td=%p pc=%#x sp=%#x", td, - tf->srr0, tf->fixreg[1]); - - PROC_LOCK(p); - mtx_lock(&psp->ps_mtx); -} - -void bzero(void *buf, size_t len) { caddr_t p; Modified: stable/8/sys/powerpc/booke/vm_machdep.c ============================================================================== --- stable/8/sys/powerpc/booke/vm_machdep.c Sat Aug 21 23:13:16 2010 (r211594) +++ stable/8/sys/powerpc/booke/vm_machdep.c Sun Aug 22 00:04:24 2010 (r211595) @@ -357,6 +357,7 @@ sf_buf_free(struct sf_buf *sf) void swi_vm(void *dummy) { + if (busdma_swi_pending != 0) busdma_swi(); } @@ -381,34 +382,6 @@ is_physical_memory(vm_offset_t addr) /* * Thread functions */ -void -cpu_thread_exit(struct thread *td) -{ - -} - -void -cpu_thread_clean(struct thread *td) -{ - -} - -void -cpu_thread_alloc(struct thread *td) -{ - struct pcb *pcb; - - pcb = (struct pcb *)((td->td_kstack + td->td_kstack_pages * PAGE_SIZE - - sizeof(struct pcb)) & ~0x3fU); - td->td_pcb = pcb; - td->td_frame = (struct trapframe *)pcb - 1; -} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 01:15:36 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0830F106566C; Sun, 22 Aug 2010 01:15:36 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id BBF9A8FC13; Sun, 22 Aug 2010 01:15:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o7M1DS2G026492; Sat, 21 Aug 2010 19:13:28 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 21 Aug 2010 19:13:34 -0600 (MDT) Message-Id: <20100821.191334.655406241928302946.imp@bsdimp.com> To: yongari@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <201008212313.o7LNDGpH083604@svn.freebsd.org> References: <201008212313.o7LNDGpH083604@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r211594 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 01:15:36 -0000 In message: <201008212313.o7LNDGpH083604@svn.freebsd.org> Pyun YongHyeon writes: : Author: yongari : Date: Sat Aug 21 23:13:16 2010 : New Revision: 211594 : URL: http://svn.freebsd.org/changeset/base/211594 : : Log: : Load tunable from loader.conf(5) instead of device.hints(5). Why the move? Warner : Modified: : head/sys/dev/bge/if_bge.c : : Modified: head/sys/dev/bge/if_bge.c : ============================================================================== : --- head/sys/dev/bge/if_bge.c Sat Aug 21 22:23:22 2010 (r211593) : +++ head/sys/dev/bge/if_bge.c Sat Aug 21 23:13:16 2010 (r211594) : @@ -4898,6 +4898,8 @@ bge_add_sysctls(struct bge_softc *sc) : struct sysctl_ctx_list *ctx; : struct sysctl_oid_list *children, *schildren; : struct sysctl_oid *tree; : + char tn[32]; : + int unit; : : ctx = device_get_sysctl_ctx(sc->bge_dev); : children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->bge_dev)); : @@ -4917,6 +4919,7 @@ bge_add_sysctls(struct bge_softc *sc) : : #endif : : + unit = device_get_unit(sc->bge_dev); : /* : * A common design characteristic for many Broadcom client controllers : * is that they only support a single outstanding DMA read operation : @@ -4929,13 +4932,13 @@ bge_add_sysctls(struct bge_softc *sc) : * performance is about 850Mbps. However forcing coalescing mbufs : * consumes a lot of CPU cycles, so leave it off by default. : */ : + sc->bge_forced_collapse = 0; : + snprintf(tn, sizeof(tn), "dev.bge.%d.forced_collapse", unit); : + TUNABLE_INT_FETCH(tn, &sc->bge_forced_collapse); : SYSCTL_ADD_INT(ctx, children, OID_AUTO, "forced_collapse", : CTLFLAG_RW, &sc->bge_forced_collapse, 0, : "Number of fragmented TX buffers of a frame allowed before " : "forced collapsing"); : - resource_int_value(device_get_name(sc->bge_dev), : - device_get_unit(sc->bge_dev), "forced_collapse", : - &sc->bge_forced_collapse); : : if (BGE_IS_5705_PLUS(sc)) : return; : From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 01:15:36 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85B3610656A3; Sun, 22 Aug 2010 01:15:36 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 46AB98FC17; Sun, 22 Aug 2010 01:15:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o7M1Cnv4026491; Sat, 21 Aug 2010 19:12:50 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 21 Aug 2010 19:12:55 -0600 (MDT) Message-Id: <20100821.191255.1023414010414033264.imp@bsdimp.com> To: dougb@FreeBSD.org From: "M. Warner Losh" In-Reply-To: References: <26CBB559-FA72-4688-92E9-ED9CEA151B2C@FreeBSD.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, rpaulo@FreeBSD.org, svn-src-all@FreeBSD.org, bz@FreeBSD.org, svn-src-head@FreeBSD.org, anchie@FreeBSD.org Subject: Re: svn commit: r211501 - in head/sys: modules modules/send netinet netinet6 sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 01:15:36 -0000 In message: Doug Barton writes: : On Sat, 21 Aug 2010, Rui Paulo wrote: : : > If your concern is to change the status quo, you do understand that : > you picked the worst possible thread to hijack ? Esp. since the author : > promised to roll out a man page. : : I didn't hijack anything, I responded to Ana's message saying that a : man page was forthcoming. To me, since Ana intends to write a man page : anyway I thought this was an excellent opportunity to highlight the : fact that committing the man page along with the code is the preferred : course of action. Do we really need to have a bunch of threads about why people should do the things they have promised to do? Warner From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 01:24:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BF421065674; Sun, 22 Aug 2010 01:24:38 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-px0-f182.google.com (mail-px0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 471AD8FC14; Sun, 22 Aug 2010 01:24:38 +0000 (UTC) Received: by pxi17 with SMTP id 17so2004988pxi.13 for ; Sat, 21 Aug 2010 18:24:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=X9Z5EAmEdyv8MihovhLmD9vknl9N5WO9cnzMpmxLshY=; b=x5qBVxJjgOZ9GvTnQJEXvROot0oW9K0YTLZ6Ili81Pat//kZ9fOtPE9j77VNeji62h A60T7ySj0wk0DusfM88cQpQ9kpcTguiI4Caxz4FktQi1MVr7vwwWqefvWisiChALYX2u L14jUai2Z4oKHyIud7Ep7wdAl1Kzgn3IPbS+w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=u0IPlQNSTuHBZjOp6czQgAdeCqCh1PnQSH0vAQVmQiziyg+K0i/2fK2x+MfG/AOeJM qHAFJVPdyEqF6D01IvCvpEm3B84f5WHlnsg/8wft6zsJmGBAmSwofYTU2kG8FsrR5cji rBEEHtd8nChTu1QkW2yBELgEvm8W7c2kbWhNk= Received: by 10.142.211.5 with SMTP id j5mr2696832wfg.261.1282440277668; Sat, 21 Aug 2010 18:24:37 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id z1sm5861042wfd.15.2010.08.21.18.24.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 21 Aug 2010 18:24:36 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Sat, 21 Aug 2010 18:24:33 -0700 From: Pyun YongHyeon Date: Sat, 21 Aug 2010 18:24:33 -0700 To: "M. Warner Losh" Message-ID: <20100822012433.GB1090@michelle.cdnetworks.com> References: <201008212313.o7LNDGpH083604@svn.freebsd.org> <20100821.191334.655406241928302946.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100821.191334.655406241928302946.imp@bsdimp.com> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, yongari@FreeBSD.org Subject: Re: svn commit: r211594 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 01:24:38 -0000 On Sat, Aug 21, 2010 at 07:13:34PM -0600, M. Warner Losh wrote: > In message: <201008212313.o7LNDGpH083604@svn.freebsd.org> > Pyun YongHyeon writes: > : Author: yongari > : Date: Sat Aug 21 23:13:16 2010 > : New Revision: 211594 > : URL: http://svn.freebsd.org/changeset/base/211594 > : > : Log: > : Load tunable from loader.conf(5) instead of device.hints(5). > > Why the move? > Because bge(4) man page didn't mention device.hints. The tunable could be set via sysctl or loader. From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 01:39:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEB361065670; Sun, 22 Aug 2010 01:39:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A42108FC08; Sun, 22 Aug 2010 01:39:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7M1d9xd086348; Sun, 22 Aug 2010 01:39:09 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7M1d9r8086345; Sun, 22 Aug 2010 01:39:09 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008220139.o7M1d9r8086345@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Aug 2010 01:39:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211596 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 01:39:09 -0000 Author: yongari Date: Sun Aug 22 01:39:09 2010 New Revision: 211596 URL: http://svn.freebsd.org/changeset/base/211596 Log: It seems all Broadcom controllers have a bug that can generate UDP datagrams with checksum value 0 when TX UDP checksum offloading is enabled. Generating UDP checksum value 0 is RFC 768 violation. Even though the probability of generating such UDP datagrams is low, I don't want to see FreeBSD boxes to inject such datagrams into network so disable UDP checksum offloading by default. Users still override this behavior by setting a sysctl variable or loader tunable, dev.bge.%d.forced_udpcsum. I have no idea why this issue was not reported so far given that bge(4) is one of the most commonly used controller on high-end server class systems. Thanks to andre@ who passed the PR to me. PR: kern/104826 Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Aug 22 00:04:24 2010 (r211595) +++ head/sys/dev/bge/if_bge.c Sun Aug 22 01:39:09 2010 (r211596) @@ -120,7 +120,7 @@ __FBSDID("$FreeBSD$"); #include -#define BGE_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) +#define BGE_CSUM_FEATURES (CSUM_IP | CSUM_TCP) #define ETHER_MIN_NOPAD (ETHER_MIN_LEN - ETHER_CRC_LEN) /* i.e., 60 */ MODULE_DEPEND(bge, pci, 1, 1, 1); @@ -2795,6 +2795,8 @@ bge_attach(device_t dev) goto fail; } + bge_add_sysctls(sc); + /* Set default tuneable values. */ sc->bge_stat_ticks = BGE_TICKS_PER_SEC; sc->bge_rx_coal_ticks = 150; @@ -2802,6 +2804,11 @@ bge_attach(device_t dev) sc->bge_rx_max_coal_bds = 10; sc->bge_tx_max_coal_bds = 10; + /* Initialize checksum features to use. */ + sc->bge_csum_features = BGE_CSUM_FEATURES; + if (sc->bge_forced_udpcsum != 0) + sc->bge_csum_features |= CSUM_UDP; + /* Set up ifnet structure */ ifp = sc->bge_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { @@ -2818,7 +2825,7 @@ bge_attach(device_t dev) ifp->if_snd.ifq_drv_maxlen = BGE_TX_RING_CNT - 1; IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); IFQ_SET_READY(&ifp->if_snd); - ifp->if_hwassist = BGE_CSUM_FEATURES; + ifp->if_hwassist = sc->bge_csum_features; ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; if ((sc->bge_flags & BGE_FLAG_TSO) != 0) { @@ -2975,8 +2982,6 @@ again: device_printf(sc->bge_dev, "couldn't set up irq\n"); } - bge_add_sysctls(sc); - return (0); fail: @@ -3960,7 +3965,7 @@ bge_encap(struct bge_softc *sc, struct m return (ENOBUFS); csum_flags |= BGE_TXBDFLAG_CPU_PRE_DMA | BGE_TXBDFLAG_CPU_POST_DMA; - } else if ((m->m_pkthdr.csum_flags & BGE_CSUM_FEATURES) != 0) { + } else if ((m->m_pkthdr.csum_flags & sc->bge_csum_features) != 0) { if (m->m_pkthdr.csum_flags & CSUM_IP) csum_flags |= BGE_TXBDFLAG_IP_CSUM; if (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) { @@ -4237,6 +4242,17 @@ bge_init_locked(struct bge_softc *sc) /* Program VLAN tag stripping. */ bge_setvlan(sc); + /* Override UDP checksum offloading. */ + if (sc->bge_forced_udpcsum == 0) + sc->bge_csum_features &= ~CSUM_UDP; + else + sc->bge_csum_features |= CSUM_UDP; + if (ifp->if_capabilities & IFCAP_TXCSUM && + ifp->if_capenable & IFCAP_TXCSUM) { + ifp->if_hwassist &= ~(BGE_CSUM_FEATURES | CSUM_UDP); + ifp->if_hwassist |= sc->bge_csum_features; + } + /* Init RX ring. */ if (bge_init_rx_ring_std(sc) != 0) { device_printf(sc->bge_dev, "no memory for std Rx buffers.\n"); @@ -4562,9 +4578,9 @@ bge_ioctl(struct ifnet *ifp, u_long comm ifp->if_capenable ^= IFCAP_HWCSUM; if (IFCAP_HWCSUM & ifp->if_capenable && IFCAP_HWCSUM & ifp->if_capabilities) - ifp->if_hwassist |= BGE_CSUM_FEATURES; + ifp->if_hwassist |= sc->bge_csum_features; else - ifp->if_hwassist &= ~BGE_CSUM_FEATURES; + ifp->if_hwassist &= ~sc->bge_csum_features; } if ((mask & IFCAP_TSO4) != 0 && @@ -4940,6 +4956,24 @@ bge_add_sysctls(struct bge_softc *sc) "Number of fragmented TX buffers of a frame allowed before " "forced collapsing"); + /* + * It seems all Broadcom controllers have a bug that can generate UDP + * datagrams with checksum value 0 when TX UDP checksum offloading is + * enabled. Generating UDP checksum value 0 is RFC 768 violation. + * Even though the probability of generating such UDP datagrams is + * low, I don't want to see FreeBSD boxes to inject such datagrams + * into network so disable UDP checksum offloading by default. Users + * still override this behavior by setting a sysctl variable, + * dev.bge.0.forced_udpcsum. + */ + sc->bge_forced_udpcsum = 0; + snprintf(tn, sizeof(tn), "dev.bge.%d.bge_forced_udpcsum", unit); + TUNABLE_INT_FETCH(tn, &sc->bge_forced_udpcsum); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "forced_udpcsum", + CTLFLAG_RW, &sc->bge_forced_udpcsum, 0, + "Enable UDP checksum offloading even if controller can " + "generate UDP checksum value 0"); + if (BGE_IS_5705_PLUS(sc)) return; Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Sun Aug 22 00:04:24 2010 (r211595) +++ head/sys/dev/bge/if_bgereg.h Sun Aug 22 01:39:09 2010 (r211596) @@ -2644,6 +2644,8 @@ struct bge_softc { int bge_link_evt; /* pending link event */ int bge_timer; int bge_forced_collapse; + int bge_forced_udpcsum; + int bge_csum_features; struct callout bge_stat_ch; uint32_t bge_rx_discards; uint32_t bge_tx_discards; From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 01:41:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F7F41065694; Sun, 22 Aug 2010 01:41:00 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F38F68FC12; Sun, 22 Aug 2010 01:40:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7M1exjH086421; Sun, 22 Aug 2010 01:40:59 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7M1exCJ086419; Sun, 22 Aug 2010 01:40:59 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008220140.o7M1exCJ086419@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Aug 2010 01:40:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211597 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 01:41:00 -0000 Author: yongari Date: Sun Aug 22 01:40:59 2010 New Revision: 211597 URL: http://svn.freebsd.org/changeset/base/211597 Log: Document newly introduced tunable dev.bge.%d.forced_udpcsum. While I'm here also mention tunable dev.bge.%d.forced_collapse. Modified: head/share/man/man4/bge.4 Modified: head/share/man/man4/bge.4 ============================================================================== --- head/share/man/man4/bge.4 Sun Aug 22 01:39:09 2010 (r211596) +++ head/share/man/man4/bge.4 Sun Aug 22 01:40:59 2010 (r211597) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 7, 2009 +.Dd August 21, 2010 .Dt BGE 4 .Os .Sh NAME @@ -219,6 +219,26 @@ Allow the ASF feature for cooperating wi Can cause system lockup problems on a small number of systems. Enabled by default. .El +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width indent +.It Va dev.bge.%d.forced_collapse +Allow collapsing multiple transmit buffers into a single buffer +to increase transmit performance with the cost of CPU cycles. +The default value is 0 to disable transmit buffer collapsing. +.It Va dev.bge.%d.forced_udpcsum +Enable UDP transmit checksum offloading even if controller can generate +UDP datagrams with checksum value 0. +UDP datagrams with checksum value 0 can confuse receiver host as it means +sender did not compute UDP checksum. +The default value is 0 which disables UDP transmit checksum offloading. +The interface need to be brought down and up again before a change takes +effect. +.El .Sh DIAGNOSTICS .Bl -diag .It "bge%d: couldn't map memory" From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 02:14:12 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29EDF106566B; Sun, 22 Aug 2010 02:14:12 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id DF8848FC0C; Sun, 22 Aug 2010 02:14:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o7M2AaDx026818; Sat, 21 Aug 2010 20:10:36 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 21 Aug 2010 20:10:42 -0600 (MDT) Message-Id: <20100821.201042.802415220773306162.imp@bsdimp.com> To: pyunyh@gmail.com From: "M. Warner Losh" In-Reply-To: <20100822012433.GB1090@michelle.cdnetworks.com> References: <201008212313.o7LNDGpH083604@svn.freebsd.org> <20100821.191334.655406241928302946.imp@bsdimp.com> <20100822012433.GB1090@michelle.cdnetworks.com> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, yongari@FreeBSD.org Subject: Re: svn commit: r211594 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 02:14:12 -0000 In message: <20100822012433.GB1090@michelle.cdnetworks.com> Pyun YongHyeon writes: : On Sat, Aug 21, 2010 at 07:13:34PM -0600, M. Warner Losh wrote: : > In message: <201008212313.o7LNDGpH083604@svn.freebsd.org> : > Pyun YongHyeon writes: : > : Author: yongari : > : Date: Sat Aug 21 23:13:16 2010 : > : New Revision: 211594 : > : URL: http://svn.freebsd.org/changeset/base/211594 : > : : > : Log: : > : Load tunable from loader.conf(5) instead of device.hints(5). : > : > Why the move? : > : : Because bge(4) man page didn't mention device.hints. The tunable : could be set via sysctl or loader. It's just that our other drivers use the hints mechanism. Of course, you could easily set either of these in either loader.conf or device.hints... They are basically the same thing... Warner From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 02:20:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7795E1065696; Sun, 22 Aug 2010 02:20:07 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 318BD8FC0C; Sun, 22 Aug 2010 02:20:06 +0000 (UTC) Received: by pwi8 with SMTP id 8so252642pwi.13 for ; Sat, 21 Aug 2010 19:20:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=ALBoIp+OxR7w76CqZ0zBupaL+8xyIK8qdhL8U0nXnso=; b=HwLocR0TVZMRCcvDFynTaRd50aStJ7GJhK6Y76wyepycGcJAHovZaHQw7mP67iGR4C Pfm2cKkH3o1MXRYWuz7Hd4eR4N/03hrFsZekm9TkMMmLm2/L/XfXXIWcGeXZ7c8CYwkq VS1uUxghFypyd2PNc+vaUyyDvohv0fhb09aPE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=qseFKatvah9wziKDQs38ySQU8W/FOSImd1Hd43bEDhSS8X2lzuLQPnSom9db012hwh vEMwEttSK/ZDhc6RNWAxqO4TM+YBtNWATg+EHGGw3bwH1MXCaZGfSRuUdt9sm3Z4twpX 3hc9ulNrNeBpYYYtFNdT0nEZ03ID5fQcnjL6Y= Received: by 10.142.131.21 with SMTP id e21mr2819121wfd.88.1282443605799; Sat, 21 Aug 2010 19:20:05 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id v38sm5942235wfh.0.2010.08.21.19.20.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 21 Aug 2010 19:20:04 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Sat, 21 Aug 2010 19:20:01 -0700 From: Pyun YongHyeon Date: Sat, 21 Aug 2010 19:20:01 -0700 To: "M. Warner Losh" Message-ID: <20100822022001.GC1090@michelle.cdnetworks.com> References: <201008212313.o7LNDGpH083604@svn.freebsd.org> <20100821.191334.655406241928302946.imp@bsdimp.com> <20100822012433.GB1090@michelle.cdnetworks.com> <20100821.201042.802415220773306162.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100821.201042.802415220773306162.imp@bsdimp.com> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, yongari@FreeBSD.org Subject: Re: svn commit: r211594 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 02:20:07 -0000 On Sat, Aug 21, 2010 at 08:10:42PM -0600, M. Warner Losh wrote: > In message: <20100822012433.GB1090@michelle.cdnetworks.com> > Pyun YongHyeon writes: > : On Sat, Aug 21, 2010 at 07:13:34PM -0600, M. Warner Losh wrote: > : > In message: <201008212313.o7LNDGpH083604@svn.freebsd.org> > : > Pyun YongHyeon writes: > : > : Author: yongari > : > : Date: Sat Aug 21 23:13:16 2010 > : > : New Revision: 211594 > : > : URL: http://svn.freebsd.org/changeset/base/211594 > : > : > : > : Log: > : > : Load tunable from loader.conf(5) instead of device.hints(5). > : > > : > Why the move? > : > > : > : Because bge(4) man page didn't mention device.hints. The tunable > : could be set via sysctl or loader. > > It's just that our other drivers use the hints mechanism. > > Of course, you could easily set either of these in either loader.conf > or device.hints... They are basically the same thing... > Yes, but hints requires "hint" string to be present before driver.unit.keyword string which is not the same syntax of sysctl variable. > Warner From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 03:39:06 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45390106567A; Sun, 22 Aug 2010 03:39:06 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 04AE78FC0C; Sun, 22 Aug 2010 03:39:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o7M3Xk4c027343; Sat, 21 Aug 2010 21:33:46 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 21 Aug 2010 21:33:52 -0600 (MDT) Message-Id: <20100821.213352.496218958820922397.imp@bsdimp.com> To: pyunyh@gmail.com From: "M. Warner Losh" In-Reply-To: <20100822022001.GC1090@michelle.cdnetworks.com> References: <20100822012433.GB1090@michelle.cdnetworks.com> <20100821.201042.802415220773306162.imp@bsdimp.com> <20100822022001.GC1090@michelle.cdnetworks.com> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, yongari@FreeBSD.org Subject: Re: svn commit: r211594 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 03:39:06 -0000 In message: <20100822022001.GC1090@michelle.cdnetworks.com> Pyun YongHyeon writes: : On Sat, Aug 21, 2010 at 08:10:42PM -0600, M. Warner Losh wrote: : > In message: <20100822012433.GB1090@michelle.cdnetworks.com> : > Pyun YongHyeon writes: : > : On Sat, Aug 21, 2010 at 07:13:34PM -0600, M. Warner Losh wrote: : > : > In message: <201008212313.o7LNDGpH083604@svn.freebsd.org> : > : > Pyun YongHyeon writes: : > : > : Author: yongari : > : > : Date: Sat Aug 21 23:13:16 2010 : > : > : New Revision: 211594 : > : > : URL: http://svn.freebsd.org/changeset/base/211594 : > : > : : > : > : Log: : > : > : Load tunable from loader.conf(5) instead of device.hints(5). : > : > : > : > Why the move? : > : > : > : : > : Because bge(4) man page didn't mention device.hints. The tunable : > : could be set via sysctl or loader. : > : > It's just that our other drivers use the hints mechanism. : > : > Of course, you could easily set either of these in either loader.conf : > or device.hints... They are basically the same thing... : > : : Yes, but hints requires "hint" string to be present before : driver.unit.keyword string which is not the same syntax of sysctl : variable. I guess my bigger point is that we should consider migration now that we have a better mechanism... Warner From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 05:36:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 486391065673; Sun, 22 Aug 2010 05:36:07 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 379D58FC0A; Sun, 22 Aug 2010 05:36:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7M5a7kJ092452; Sun, 22 Aug 2010 05:36:07 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7M5a7D1092448; Sun, 22 Aug 2010 05:36:07 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201008220536.o7M5a7D1092448@svn.freebsd.org> From: Ed Schouten Date: Sun, 22 Aug 2010 05:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211598 - head/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 05:36:07 -0000 Author: ed Date: Sun Aug 22 05:36:06 2010 New Revision: 211598 URL: http://svn.freebsd.org/changeset/base/211598 Log: Add support for whiteouts on tmpfs. Right now unionfs only allows filesystems to be mounted on top of another if it supports whiteouts. Even though I have sent a patch to daichi@ to let unionfs work without it, we'd better also add support for whiteouts to tmpfs. This patch implements .vop_whiteout and makes necessary changes to lookup() and readdir() to take them into account. We must also make sure that when adding or removing a file, we honour the componentname's DOWHITEOUT and ISWHITEOUT, to prevent duplicate filenames. MFC after: 1 month Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Sun Aug 22 01:40:59 2010 (r211597) +++ head/sys/fs/tmpfs/tmpfs.h Sun Aug 22 05:36:06 2010 (r211598) @@ -72,7 +72,8 @@ struct tmpfs_dirent { * td_namelen field must always be used when accessing its value. */ char * td_name; - /* Pointer to the node this entry refers to. */ + /* Pointer to the node this entry refers to. In case this field + * is NULL, the node is a whiteout. */ struct tmpfs_node * td_node; }; @@ -434,6 +435,8 @@ int tmpfs_dir_getdotdent(struct tmpfs_no int tmpfs_dir_getdotdotdent(struct tmpfs_node *, struct uio *); struct tmpfs_dirent * tmpfs_dir_lookupbycookie(struct tmpfs_node *, off_t); int tmpfs_dir_getdents(struct tmpfs_node *, struct uio *, off_t *); +int tmpfs_dir_whiteout_add(struct vnode *, struct componentname *); +void tmpfs_dir_whiteout_remove(struct vnode *, struct componentname *); int tmpfs_reg_resize(struct vnode *, off_t); int tmpfs_chflags(struct vnode *, int, struct ucred *, struct thread *); int tmpfs_chmod(struct vnode *, mode_t, struct ucred *, struct thread *); Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Sun Aug 22 01:40:59 2010 (r211597) +++ head/sys/fs/tmpfs/tmpfs_subr.c Sun Aug 22 05:36:06 2010 (r211598) @@ -261,7 +261,8 @@ tmpfs_alloc_dirent(struct tmpfs_mount *t memcpy(nde->td_name, name, len); nde->td_node = node; - node->tn_links++; + if (node != NULL) + node->tn_links++; *de = nde; @@ -287,9 +288,10 @@ tmpfs_free_dirent(struct tmpfs_mount *tm struct tmpfs_node *node; node = de->td_node; - - MPASS(node->tn_links > 0); - node->tn_links--; + if (node != NULL) { + MPASS(node->tn_links > 0); + node->tn_links--; + } } free(de->td_name, M_TMPFSNAME); @@ -518,6 +520,8 @@ tmpfs_alloc_file(struct vnode *dvp, stru /* Now that all required items are allocated, we can proceed to * insert the new node into the directory, an operation that * cannot fail. */ + if (cnp->cn_flags & ISWHITEOUT) + tmpfs_dir_whiteout_remove(dvp, cnp); tmpfs_dir_attach(dvp, de); out: @@ -768,39 +772,44 @@ tmpfs_dir_getdents(struct tmpfs_node *no /* Create a dirent structure representing the current * tmpfs_node and fill it. */ - d.d_fileno = de->td_node->tn_id; - switch (de->td_node->tn_type) { - case VBLK: - d.d_type = DT_BLK; - break; - - case VCHR: - d.d_type = DT_CHR; - break; - - case VDIR: - d.d_type = DT_DIR; - break; - - case VFIFO: - d.d_type = DT_FIFO; - break; - - case VLNK: - d.d_type = DT_LNK; - break; - - case VREG: - d.d_type = DT_REG; - break; - - case VSOCK: - d.d_type = DT_SOCK; - break; - - default: - panic("tmpfs_dir_getdents: type %p %d", - de->td_node, (int)de->td_node->tn_type); + if (de->td_node == NULL) { + d.d_fileno = 1; + d.d_type = DT_WHT; + } else { + d.d_fileno = de->td_node->tn_id; + switch (de->td_node->tn_type) { + case VBLK: + d.d_type = DT_BLK; + break; + + case VCHR: + d.d_type = DT_CHR; + break; + + case VDIR: + d.d_type = DT_DIR; + break; + + case VFIFO: + d.d_type = DT_FIFO; + break; + + case VLNK: + d.d_type = DT_LNK; + break; + + case VREG: + d.d_type = DT_REG; + break; + + case VSOCK: + d.d_type = DT_SOCK; + break; + + default: + panic("tmpfs_dir_getdents: type %p %d", + de->td_node, (int)de->td_node->tn_type); + } } d.d_namlen = de->td_namelen; MPASS(de->td_namelen < sizeof(d.d_name)); @@ -837,6 +846,31 @@ tmpfs_dir_getdents(struct tmpfs_node *no return error; } +int +tmpfs_dir_whiteout_add(struct vnode *dvp, struct componentname *cnp) +{ + struct tmpfs_dirent *de; + int error; + + error = tmpfs_alloc_dirent(VFS_TO_TMPFS(dvp->v_mount), NULL, + cnp->cn_nameptr, cnp->cn_namelen, &de); + if (error != 0) + return (error); + tmpfs_dir_attach(dvp, de); + return (0); +} + +void +tmpfs_dir_whiteout_remove(struct vnode *dvp, struct componentname *cnp) +{ + struct tmpfs_dirent *de; + + de = tmpfs_dir_lookup(VP_TO_TMPFS_DIR(dvp), NULL, cnp); + MPASS(de != NULL && de->td_node == NULL); + tmpfs_dir_detach(dvp, de); + tmpfs_free_dirent(VFS_TO_TMPFS(dvp->v_mount), de, TRUE); +} + /* --------------------------------------------------------------------- */ /* Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Sun Aug 22 01:40:59 2010 (r211597) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Sun Aug 22 05:36:06 2010 (r211598) @@ -109,14 +109,19 @@ tmpfs_lookup(struct vop_cachedlookup_arg error = 0; } else { de = tmpfs_dir_lookup(dnode, NULL, cnp); - if (de == NULL) { + if (de != NULL && de->td_node == NULL) + cnp->cn_flags |= ISWHITEOUT; + if (de == NULL || de->td_node == NULL) { /* The entry was not found in the directory. * This is OK if we are creating or renaming an * entry and are working on the last component of * the path name. */ if ((cnp->cn_flags & ISLASTCN) && (cnp->cn_nameiop == CREATE || \ - cnp->cn_nameiop == RENAME)) { + cnp->cn_nameiop == RENAME || + (cnp->cn_nameiop == DELETE && + cnp->cn_flags & DOWHITEOUT && + cnp->cn_flags & ISWHITEOUT))) { error = VOP_ACCESS(dvp, VWRITE, cnp->cn_cred, cnp->cn_thread); if (error != 0) @@ -834,6 +839,8 @@ tmpfs_remove(struct vop_remove_args *v) /* Remove the entry from the directory; as it is a file, we do not * have to change the number of hard links of the directory. */ tmpfs_dir_detach(dvp, de); + if (v->a_cnp->cn_flags & DOWHITEOUT) + tmpfs_dir_whiteout_add(dvp, v->a_cnp); /* Free the directory entry we just deleted. Note that the node * referred by it will not be removed until the vnode is really @@ -904,6 +911,8 @@ tmpfs_link(struct vop_link_args *v) goto out; /* Insert the new directory entry into the appropriate directory. */ + if (cnp->cn_flags & ISWHITEOUT) + tmpfs_dir_whiteout_remove(dvp, cnp); tmpfs_dir_attach(dvp, de); /* vp link count has changed, so update node times. */ @@ -1099,6 +1108,10 @@ tmpfs_rename(struct vop_rename_args *v) /* Do the move: just remove the entry from the source directory * and insert it into the target one. */ tmpfs_dir_detach(fdvp, de); + if (fcnp->cn_flags & DOWHITEOUT) + tmpfs_dir_whiteout_add(fdvp, fcnp); + if (tcnp->cn_flags & ISWHITEOUT) + tmpfs_dir_whiteout_remove(tdvp, tcnp); tmpfs_dir_attach(tdvp, de); } @@ -1223,6 +1236,8 @@ tmpfs_rmdir(struct vop_rmdir_args *v) /* Detach the directory entry from the directory (dnode). */ tmpfs_dir_detach(dvp, de); + if (v->a_cnp->cn_flags & DOWHITEOUT) + tmpfs_dir_whiteout_add(dvp, v->a_cnp); /* No vnode should be allocated for this entry from this point */ TMPFS_NODE_LOCK(node); @@ -1541,6 +1556,29 @@ tmpfs_vptofh(struct vop_vptofh_args *ap) return (0); } +static int +tmpfs_whiteout(struct vop_whiteout_args *ap) +{ + struct vnode *dvp = ap->a_dvp; + struct componentname *cnp = ap->a_cnp; + struct tmpfs_dirent *de; + + switch (ap->a_flags) { + case LOOKUP: + return (0); + case CREATE: + de = tmpfs_dir_lookup(VP_TO_TMPFS_DIR(dvp), NULL, cnp); + if (de != NULL) + return (de->td_node == NULL ? 0 : EEXIST); + return (tmpfs_dir_whiteout_add(dvp, cnp)); + case DELETE: + tmpfs_dir_whiteout_remove(dvp, cnp); + return (0); + default: + panic("tmpfs_whiteout: unknown op"); + } +} + /* --------------------------------------------------------------------- */ /* @@ -1573,6 +1611,7 @@ struct vop_vector tmpfs_vnodeop_entries .vop_print = tmpfs_print, .vop_pathconf = tmpfs_pathconf, .vop_vptofh = tmpfs_vptofh, + .vop_whiteout = tmpfs_whiteout, .vop_bmap = VOP_EOPNOTSUPP, }; From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 08:18:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A17410656A4; Sun, 22 Aug 2010 08:18:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8922D8FC28; Sun, 22 Aug 2010 08:18:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7M8IWsa095537; Sun, 22 Aug 2010 08:18:32 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7M8IWGq095535; Sun, 22 Aug 2010 08:18:32 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201008220818.o7M8IWGq095535@svn.freebsd.org> From: Andriy Gapon Date: Sun, 22 Aug 2010 08:18:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211599 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 08:18:32 -0000 Author: avg Date: Sun Aug 22 08:18:32 2010 New Revision: 211599 URL: http://svn.freebsd.org/changeset/base/211599 Log: Fix a mismerge in r211581, MFC of r210427 This is a direct commit. Reported by: many Pointyhat to: avg Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Aug 22 05:36:06 2010 (r211598) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Aug 22 08:18:32 2010 (r211599) @@ -3611,7 +3611,6 @@ arc_memory_throttle(uint64_t reserve, ui { #ifdef _KERNEL uint64_t inflight_data = arc_anon->arcs_size; - uint64_t available_memory = ptoa((uintmax_t)cnt.v_free_count); uint64_t available_memory = ptoa((uintmax_t)cnt.v_free_count + cnt.v_cache_count); static uint64_t page_load = 0; From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 08:47:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 732AE1065698; Sun, 22 Aug 2010 08:47:00 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 575398FC0C; Sun, 22 Aug 2010 08:47:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7M8l0ba096157; Sun, 22 Aug 2010 08:47:00 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7M8l0kX096155; Sun, 22 Aug 2010 08:47:00 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201008220847.o7M8l0kX096155@svn.freebsd.org> From: Andre Oppermann Date: Sun, 22 Aug 2010 08:47:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211600 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 08:47:00 -0000 Author: andre Date: Sun Aug 22 08:47:00 2010 New Revision: 211600 URL: http://svn.freebsd.org/changeset/base/211600 Log: MFC r211327: Add more logging points for failures in syncache_socket() to report when a new socket couldn't be created because one of in_pcbinshash(), in6_pcbconnect() or in_pcbconnect() failed. Modified: stable/8/sys/netinet/tcp_syncache.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet/tcp_syncache.c ============================================================================== --- stable/8/sys/netinet/tcp_syncache.c Sun Aug 22 08:18:32 2010 (r211599) +++ stable/8/sys/netinet/tcp_syncache.c Sun Aug 22 08:47:00 2010 (r211600) @@ -627,6 +627,7 @@ syncache_socket(struct syncache *sc, str struct inpcb *inp = NULL; struct socket *so; struct tcpcb *tp; + int error = 0; char *s; INP_INFO_WLOCK_ASSERT(&V_tcbinfo); @@ -675,7 +676,7 @@ syncache_socket(struct syncache *sc, str } #endif inp->inp_lport = sc->sc_inc.inc_lport; - if (in_pcbinshash(inp) != 0) { + if ((error = in_pcbinshash(inp)) != 0) { /* * Undo the assignments above if we failed to * put the PCB on the hash lists. @@ -687,6 +688,12 @@ syncache_socket(struct syncache *sc, str #endif inp->inp_laddr.s_addr = INADDR_ANY; inp->inp_lport = 0; + if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: in_pcbinshash failed " + "with error %i\n", + s, __func__, error); + free(s, M_TCPLOG); + } goto abort; } #ifdef IPSEC @@ -721,9 +728,15 @@ syncache_socket(struct syncache *sc, str laddr6 = inp->in6p_laddr; if (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) inp->in6p_laddr = sc->sc_inc.inc6_laddr; - if (in6_pcbconnect(inp, (struct sockaddr *)&sin6, - thread0.td_ucred)) { + if ((error = in6_pcbconnect(inp, (struct sockaddr *)&sin6, + thread0.td_ucred)) != 0) { inp->in6p_laddr = laddr6; + if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: in6_pcbconnect failed " + "with error %i\n", + s, __func__, error); + free(s, M_TCPLOG); + } goto abort; } /* Override flowlabel from in6_pcbconnect. */ @@ -750,9 +763,15 @@ syncache_socket(struct syncache *sc, str laddr = inp->inp_laddr; if (inp->inp_laddr.s_addr == INADDR_ANY) inp->inp_laddr = sc->sc_inc.inc_laddr; - if (in_pcbconnect(inp, (struct sockaddr *)&sin, - thread0.td_ucred)) { + if ((error = in_pcbconnect(inp, (struct sockaddr *)&sin, + thread0.td_ucred)) != 0) { inp->inp_laddr = laddr; + if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: in_pcbconnect failed " + "with error %i\n", + s, __func__, error); + free(s, M_TCPLOG); + } goto abort; } } From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 08:47:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7C3C1065695; Sun, 22 Aug 2010 08:47:51 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC8678FC22; Sun, 22 Aug 2010 08:47:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7M8lpKM096207; Sun, 22 Aug 2010 08:47:51 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7M8lpjN096205; Sun, 22 Aug 2010 08:47:51 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201008220847.o7M8lpjN096205@svn.freebsd.org> From: Andre Oppermann Date: Sun, 22 Aug 2010 08:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211601 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 08:47:51 -0000 Author: andre Date: Sun Aug 22 08:47:51 2010 New Revision: 211601 URL: http://svn.freebsd.org/changeset/base/211601 Log: MFC r211327: Add more logging points for failures in syncache_socket() to report when a new socket couldn't be created because one of in_pcbinshash(), in6_pcbconnect() or in_pcbconnect() failed. Modified: stable/7/sys/netinet/tcp_syncache.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/tcp_syncache.c ============================================================================== --- stable/7/sys/netinet/tcp_syncache.c Sun Aug 22 08:47:00 2010 (r211600) +++ stable/7/sys/netinet/tcp_syncache.c Sun Aug 22 08:47:51 2010 (r211601) @@ -645,6 +645,7 @@ syncache_socket(struct syncache *sc, str struct inpcb *inp = NULL; struct socket *so; struct tcpcb *tp; + int error = 0; char *s; INP_INFO_WLOCK_ASSERT(&tcbinfo); @@ -695,7 +696,7 @@ syncache_socket(struct syncache *sc, str } #endif inp->inp_lport = sc->sc_inc.inc_lport; - if (in_pcbinshash(inp) != 0) { + if ((error = in_pcbinshash(inp)) != 0) { /* * Undo the assignments above if we failed to * put the PCB on the hash lists. @@ -707,6 +708,12 @@ syncache_socket(struct syncache *sc, str #endif inp->inp_laddr.s_addr = INADDR_ANY; inp->inp_lport = 0; + if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: in_pcbinshash failed " + "with error %i\n", + s, __func__, error); + free(s, M_TCPLOG); + } goto abort; } #ifdef IPSEC @@ -741,9 +748,15 @@ syncache_socket(struct syncache *sc, str laddr6 = inp->in6p_laddr; if (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) inp->in6p_laddr = sc->sc_inc.inc6_laddr; - if (in6_pcbconnect(inp, (struct sockaddr *)&sin6, - thread0.td_ucred)) { + if ((error = in6_pcbconnect(inp, (struct sockaddr *)&sin6, + thread0.td_ucred)) != 0) { inp->in6p_laddr = laddr6; + if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: in6_pcbconnect failed " + "with error %i\n", + s, __func__, error); + free(s, M_TCPLOG); + } goto abort; } /* Override flowlabel from in6_pcbconnect. */ @@ -770,9 +783,15 @@ syncache_socket(struct syncache *sc, str laddr = inp->inp_laddr; if (inp->inp_laddr.s_addr == INADDR_ANY) inp->inp_laddr = sc->sc_inc.inc_laddr; - if (in_pcbconnect(inp, (struct sockaddr *)&sin, - thread0.td_ucred)) { + if ((error = in_pcbconnect(inp, (struct sockaddr *)&sin, + thread0.td_ucred)) != 0) { inp->inp_laddr = laddr; + if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: in_pcbconnect failed " + "with error %i\n", + s, __func__, error); + free(s, M_TCPLOG); + } goto abort; } } From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 09:01:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F319D1065679; Sun, 22 Aug 2010 09:01:58 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7D678FC13; Sun, 22 Aug 2010 09:01:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7M91wxF096652; Sun, 22 Aug 2010 09:01:58 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7M91wZj096649; Sun, 22 Aug 2010 09:01:58 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201008220901.o7M91wZj096649@svn.freebsd.org> From: Andre Oppermann Date: Sun, 22 Aug 2010 09:01:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211602 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 09:01:59 -0000 Author: andre Date: Sun Aug 22 09:01:58 2010 New Revision: 211602 URL: http://svn.freebsd.org/changeset/base/211602 Log: MFC r211333: Fix the interaction between 'ICMP fragmentation needed' MTU updates, path MTU discovery and the tcp_minmss limiter for very small MTU's. Modified: stable/8/sys/netinet/tcp_output.c stable/8/sys/netinet/tcp_subr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet/tcp_output.c ============================================================================== --- stable/8/sys/netinet/tcp_output.c Sun Aug 22 08:47:51 2010 (r211601) +++ stable/8/sys/netinet/tcp_output.c Sun Aug 22 09:01:58 2010 (r211602) @@ -1186,8 +1186,10 @@ timer: * This might not be the best thing to do according to RFC3390 * Section 2. However the tcp hostcache migitates the problem * so it affects only the first tcp connection with a host. + * + * NB: Don't set DF on small MTU/MSS to have a safe fallback. */ - if (V_path_mtu_discovery) + if (V_path_mtu_discovery && tp->t_maxopd > V_tcp_minmss) ip->ip_off |= IP_DF; error = ip_output(m, tp->t_inpcb->inp_options, NULL, Modified: stable/8/sys/netinet/tcp_subr.c ============================================================================== --- stable/8/sys/netinet/tcp_subr.c Sun Aug 22 08:47:51 2010 (r211601) +++ stable/8/sys/netinet/tcp_subr.c Sun Aug 22 09:01:58 2010 (r211602) @@ -1330,11 +1330,9 @@ tcp_ctlinput(int cmd, struct sockaddr *s if (!mtu) mtu = ip_next_mtu(ip->ip_len, 1); - if (mtu < max(296, V_tcp_minmss - + sizeof(struct tcpiphdr))) - mtu = 0; - if (!mtu) - mtu = V_tcp_mssdflt + if (mtu < V_tcp_minmss + + sizeof(struct tcpiphdr)) + mtu = V_tcp_minmss + sizeof(struct tcpiphdr); /* * Only cache the the MTU if it From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 09:02:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B85AD10656B1; Sun, 22 Aug 2010 09:02:38 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D16C8FC0C; Sun, 22 Aug 2010 09:02:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7M92cTr096713; Sun, 22 Aug 2010 09:02:38 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7M92cHv096710; Sun, 22 Aug 2010 09:02:38 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201008220902.o7M92cHv096710@svn.freebsd.org> From: Andre Oppermann Date: Sun, 22 Aug 2010 09:02:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211603 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 09:02:38 -0000 Author: andre Date: Sun Aug 22 09:02:38 2010 New Revision: 211603 URL: http://svn.freebsd.org/changeset/base/211603 Log: MFC r211333: Fix the interaction between 'ICMP fragmentation needed' MTU updates, path MTU discovery and the tcp_minmss limiter for very small MTU's. Modified: stable/7/sys/netinet/tcp_output.c stable/7/sys/netinet/tcp_subr.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/tcp_output.c ============================================================================== --- stable/7/sys/netinet/tcp_output.c Sun Aug 22 09:01:58 2010 (r211602) +++ stable/7/sys/netinet/tcp_output.c Sun Aug 22 09:02:38 2010 (r211603) @@ -1130,8 +1130,10 @@ timer: * This might not be the best thing to do according to RFC3390 * Section 2. However the tcp hostcache migitates the problem * so it affects only the first tcp connection with a host. + * + * NB: Don't set DF on small MTU/MSS to have a safe fallback. */ - if (path_mtu_discovery) + if (path_mtu_discovery && tp->t_maxopd > tcp_minmss) ip->ip_off |= IP_DF; error = ip_output(m, tp->t_inpcb->inp_options, NULL, Modified: stable/7/sys/netinet/tcp_subr.c ============================================================================== --- stable/7/sys/netinet/tcp_subr.c Sun Aug 22 09:01:58 2010 (r211602) +++ stable/7/sys/netinet/tcp_subr.c Sun Aug 22 09:02:38 2010 (r211603) @@ -1241,11 +1241,9 @@ tcp_ctlinput(int cmd, struct sockaddr *s if (!mtu) mtu = ip_next_mtu(ip->ip_len, 1); - if (mtu < max(296, (tcp_minmss) - + sizeof(struct tcpiphdr))) - mtu = 0; - if (!mtu) - mtu = tcp_mssdflt + if (mtu < tcp_minmss + + sizeof(struct tcpiphdr)) + mtu = tcp_minmss + sizeof(struct tcpiphdr); /* * Only cache the the MTU if it From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 09:05:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF5B510656A4; Sun, 22 Aug 2010 09:05:08 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E97B8FC17; Sun, 22 Aug 2010 09:05:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7M958ap096816; Sun, 22 Aug 2010 09:05:08 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7M958S9096814; Sun, 22 Aug 2010 09:05:08 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201008220905.o7M958S9096814@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 22 Aug 2010 09:05:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211604 - stable/8/share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 09:05:08 -0000 Author: gavin Date: Sun Aug 22 09:05:08 2010 New Revision: 211604 URL: http://svn.freebsd.org/changeset/base/211604 Log: Merge r211066 from head: Add a termcap entry for rxvt-256color. PR: conf/147726 Submitted by: Sterling (Chip) Camden Modified: stable/8/share/termcap/termcap.src Directory Properties: stable/8/share/termcap/ (props changed) Modified: stable/8/share/termcap/termcap.src ============================================================================== --- stable/8/share/termcap/termcap.src Sun Aug 22 09:02:38 2010 (r211603) +++ stable/8/share/termcap/termcap.src Sun Aug 22 09:05:08 2010 (r211604) @@ -4585,6 +4585,9 @@ rxvt-unicode|rxvt-unicode terminal (X Wi rxvt|rxvt terminal emulator (X Window System):\ :pa#64:Co#8:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:tc=rxvt-mono: +rxvt-256color|rxvt terminal emulator with 256 colors:\ + :Co#256:AF=\E[38;5;%dm:AB=\E[48;5;%dm:tc=rxvt-unicode: + # Termcap entry for Eterm, taken from the sources of Eterm-0.9.2 Eterm|Eterm Terminal Emulator (X11 Window System):\ :am:bw:eo:km:mi:ms:xn:xo:\ From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 09:06:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BEA910656A8; Sun, 22 Aug 2010 09:06:55 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B1D48FC08; Sun, 22 Aug 2010 09:06:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7M96tIZ096881; Sun, 22 Aug 2010 09:06:55 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7M96ttR096879; Sun, 22 Aug 2010 09:06:55 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201008220906.o7M96ttR096879@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 22 Aug 2010 09:06:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211605 - stable/7/share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 09:06:55 -0000 Author: gavin Date: Sun Aug 22 09:06:55 2010 New Revision: 211605 URL: http://svn.freebsd.org/changeset/base/211605 Log: Merge r211066 from head: Add a termcap entry for rxvt-256color. PR: conf/147726 Submitted by: Sterling (Chip) Camden Modified: stable/7/share/termcap/termcap.src Directory Properties: stable/7/share/termcap/ (props changed) Modified: stable/7/share/termcap/termcap.src ============================================================================== --- stable/7/share/termcap/termcap.src Sun Aug 22 09:05:08 2010 (r211604) +++ stable/7/share/termcap/termcap.src Sun Aug 22 09:06:55 2010 (r211605) @@ -4585,6 +4585,9 @@ rxvt-unicode|rxvt-unicode terminal (X Wi rxvt|rxvt terminal emulator (X Window System):\ :pa#64:Co#8:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:tc=rxvt-mono: +rxvt-256color|rxvt terminal emulator with 256 colors:\ + :Co#256:AF=\E[38;5;%dm:AB=\E[48;5;%dm:tc=rxvt-unicode: + # Termcap entry for Eterm, taken from the sources of Eterm-0.9.2 Eterm|Eterm Terminal Emulator (X11 Window System):\ :am:bw:eo:km:mi:ms:xn:xo:\ From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 10:13:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 441681065696; Sun, 22 Aug 2010 10:13:57 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3360D8FC1D; Sun, 22 Aug 2010 10:13:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MADvLL098172; Sun, 22 Aug 2010 10:13:57 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MADvoc098170; Sun, 22 Aug 2010 10:13:57 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008221013.o7MADvoc098170@svn.freebsd.org> From: Rui Paulo Date: Sun, 22 Aug 2010 10:13:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211606 - head/sys/cddl/contrib/opensolaris/uts/common/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 10:13:57 -0000 Author: rpaulo Date: Sun Aug 22 10:13:56 2010 New Revision: 211606 URL: http://svn.freebsd.org/changeset/base/211606 Log: Add the FreeBSD definition for the fasttrap ioctls. Sponsored by: The FreeBSD Foundation Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h Sun Aug 22 09:06:55 2010 (r211605) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h Sun Aug 22 10:13:56 2010 (r211606) @@ -37,9 +37,14 @@ extern "C" { #endif +#if defined(sun) #define FASTTRAPIOC (('m' << 24) | ('r' << 16) | ('f' << 8)) #define FASTTRAPIOC_MAKEPROBE (FASTTRAPIOC | 1) #define FASTTRAPIOC_GETINSTR (FASTTRAPIOC | 2) +#else +#define FASTTRAPIOC_MAKEPROBE _IOW('f', 1, fasttrap_probe_spec_t) +#define FASTTRAPIOC_GETINSTR _IOWR('f', 2, uint8_t) +#endif typedef enum fasttrap_probe_type { DTFTP_NONE = 0, From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 10:40:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84C4110656A7; Sun, 22 Aug 2010 10:40:15 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59C5D8FC1C; Sun, 22 Aug 2010 10:40:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MAeFDS000888; Sun, 22 Aug 2010 10:40:15 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MAeFP8000885; Sun, 22 Aug 2010 10:40:15 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008221040.o7MAeFP8000885@svn.freebsd.org> From: Rui Paulo Date: Sun, 22 Aug 2010 10:40:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211607 - in head/sys/cddl/dev/dtrace: amd64 i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 10:40:15 -0000 Author: rpaulo Date: Sun Aug 22 10:40:15 2010 New Revision: 211607 URL: http://svn.freebsd.org/changeset/base/211607 Log: Add a function compatibility function dtrace_instr_size_isa() that on FreeBSD does the same as dtrace_dis_isize(). Sponsored by: The FreeBSD Foundation Modified: head/sys/cddl/dev/dtrace/amd64/instr_size.c head/sys/cddl/dev/dtrace/i386/instr_size.c Modified: head/sys/cddl/dev/dtrace/amd64/instr_size.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/instr_size.c Sun Aug 22 10:13:56 2010 (r211606) +++ head/sys/cddl/dev/dtrace/amd64/instr_size.c Sun Aug 22 10:40:15 2010 (r211607) @@ -47,6 +47,7 @@ typedef u_int model_t; #define DATAMODEL_NATIVE 0 int dtrace_instr_size(uchar_t *); +int dtrace_instr_size_isa(uchar_t *, model_t, int *); #endif #include @@ -125,6 +126,12 @@ dtrace_dis_isize(uchar_t *instr, dis_isi } int +dtrace_instr_size_isa(uchar_t *instr, model_t model, int *rmindex) +{ + return (dtrace_dis_isize(instr, DIS_ISIZE_INSTR, model, rmindex)); +} + +int dtrace_instr_size(uchar_t *instr) { return (dtrace_dis_isize(instr, DIS_ISIZE_INSTR, DATAMODEL_NATIVE, Modified: head/sys/cddl/dev/dtrace/i386/instr_size.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/instr_size.c Sun Aug 22 10:13:56 2010 (r211606) +++ head/sys/cddl/dev/dtrace/i386/instr_size.c Sun Aug 22 10:40:15 2010 (r211607) @@ -47,6 +47,7 @@ typedef u_int model_t; #define DATAMODEL_NATIVE 0 int dtrace_instr_size(uchar_t *); +int dtrace_instr_size_isa(uchar_t *, model_t, int *); #endif #include @@ -125,6 +126,12 @@ dtrace_dis_isize(uchar_t *instr, dis_isi } int +dtrace_instr_size_isa(uchar_t *instr, model_t model, int *rmindex) +{ + return (dtrace_dis_isize(instr, DIS_ISIZE_INSTR, model, rmindex)); +} + +int dtrace_instr_size(uchar_t *instr) { return (dtrace_dis_isize(instr, DIS_ISIZE_INSTR, DATAMODEL_NATIVE, From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 10:49:00 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E8001065695; Sun, 22 Aug 2010 10:49:00 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id BF8158FC16; Sun, 22 Aug 2010 10:48:59 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 3D2E745F99; Fri, 20 Aug 2010 11:39:03 +0200 (CEST) Received: from localhost (pdawidek.whl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 22E8645E98; Fri, 20 Aug 2010 11:38:58 +0200 (CEST) Date: Fri, 20 Aug 2010 11:38:56 +0200 From: Pawel Jakub Dawidek To: Doug Barton Message-ID: <20100820093856.GB1766@garage.freebsd.pl> References: <201008191131.o7JBV4Yf002412@svn.freebsd.org> <4C6D18BE.2000905@fer.hr> <4C6D95A8.9070105@FreeBSD.org> <20100819213159.B48418@maildrop.int.zabbadoz.net> <4C6DDB74.3090102@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hQiwHBbRI9kgIhsi" Content-Disposition: inline In-Reply-To: <4C6DDB74.3090102@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@FreeBSD.org, Ana Kukec , svn-src-all@FreeBSD.org, "Bjoern A. Zeeb" , src-committers@FreeBSD.org Subject: Re: svn commit: r211501 - in head/sys: modules modules/send netinet netinet6 sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 10:49:00 -0000 --hQiwHBbRI9kgIhsi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 19, 2010 at 06:33:40PM -0700, Doug Barton wrote: > On 08/19/2010 14:50, Bjoern A. Zeeb wrote: > >Yes I can: soon will be when it'll be comitted. >=20 > I'm guessing that's an attempt at humor, [...] [...] > [...] If the answer is "someday"=20 > then I'm going to request that the code be backed out until the man=20 > page(s) are done. [...] I'm guessing that's an attempt at humor? What Ana should learn from this and I'm sure she will is that if she is going to commit manual page later, she shouldn't mention that. This way nobody's time will be wasted, because nobody will notice that manual page was missing in the first place until its committed. PS. Great stuff, Ana, keep up the good work!:) --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --hQiwHBbRI9kgIhsi Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkxuTTAACgkQForvXbEpPzTf3ACdHvCnTF+pHhLokb8Bqiu5qP3n b6YAniasi5eAly4VsPIGFv3SzQI1Irou =4v1F -----END PGP SIGNATURE----- --hQiwHBbRI9kgIhsi-- From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 10:53:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A09641065673; Sun, 22 Aug 2010 10:53:32 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C7B88FC1A; Sun, 22 Aug 2010 10:53:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MArWQn001248; Sun, 22 Aug 2010 10:53:32 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MArWDE001239; Sun, 22 Aug 2010 10:53:32 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008221053.o7MArWDE001239@svn.freebsd.org> From: Rui Paulo Date: Sun, 22 Aug 2010 10:53:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211608 - in head/sys: cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/common/sys cddl/dev/dtrace cddl/dev/dtrace/amd64 cddl/dev/dtrace/i386 cddl/dev/systrace sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 10:53:32 -0000 Author: rpaulo Date: Sun Aug 22 10:53:32 2010 New Revision: 211608 URL: http://svn.freebsd.org/changeset/base/211608 Log: Kernel DTrace support for: o uregs (sson@) o ustack (sson@) o /dev/dtrace/helper device (needed for USDT probes) The work done by me was: Sponsored by: The FreeBSD Foundation Added: head/sys/cddl/dev/dtrace/amd64/regset.h (contents, props changed) head/sys/cddl/dev/dtrace/i386/regset.h (contents, props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c head/sys/cddl/dev/dtrace/dtrace_ioctl.c head/sys/cddl/dev/dtrace/dtrace_load.c head/sys/cddl/dev/dtrace/i386/dtrace_isa.c head/sys/cddl/dev/systrace/systrace.c head/sys/sys/sysent.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sun Aug 22 10:40:15 2010 (r211607) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sun Aug 22 10:53:32 2010 (r211608) @@ -551,20 +551,16 @@ static void dtrace_enabling_provide(dtra static int dtrace_enabling_match(dtrace_enabling_t *, int *); static void dtrace_enabling_matchall(void); static dtrace_state_t *dtrace_anon_grab(void); -#if defined(sun) static uint64_t dtrace_helper(int, dtrace_mstate_t *, dtrace_state_t *, uint64_t, uint64_t); static dtrace_helpers_t *dtrace_helpers_create(proc_t *); -#endif static void dtrace_buffer_drop(dtrace_buffer_t *); static intptr_t dtrace_buffer_reserve(dtrace_buffer_t *, size_t, size_t, dtrace_state_t *, dtrace_mstate_t *); static int dtrace_state_option(dtrace_state_t *, dtrace_optid_t, dtrace_optval_t); static int dtrace_ecb_create_enable(dtrace_probe_t *, void *); -#if defined(sun) static void dtrace_helper_provider_destroy(dtrace_helper_provider_t *); -#endif uint16_t dtrace_load16(uintptr_t); uint32_t dtrace_load32(uintptr_t); uint64_t dtrace_load64(uintptr_t); @@ -2784,6 +2780,21 @@ dtrace_dif_variable(dtrace_mstate_t *mst return (dtrace_getreg(lwp->lwp_regs, ndx)); return (0); } +#else + case DIF_VAR_UREGS: { + struct trapframe *tframe; + + if (!dtrace_priv_proc(state)) + return (0); + + if ((tframe = curthread->td_frame) == NULL) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = 0; + return (0); + } + + return (dtrace_getreg(tframe, ndx)); + } #endif case DIF_VAR_CURTHREAD: @@ -2839,7 +2850,6 @@ dtrace_dif_variable(dtrace_mstate_t *mst } return (mstate->dtms_stackdepth); -#if defined(sun) case DIF_VAR_USTACKDEPTH: if (!dtrace_priv_proc(state)) return (0); @@ -2859,7 +2869,6 @@ dtrace_dif_variable(dtrace_mstate_t *mst mstate->dtms_present |= DTRACE_MSTATE_USTACKDEPTH; } return (mstate->dtms_ustackdepth); -#endif case DIF_VAR_CALLER: if (!dtrace_priv_kernel(state)) @@ -2896,7 +2905,6 @@ dtrace_dif_variable(dtrace_mstate_t *mst } return (mstate->dtms_caller); -#if defined(sun) case DIF_VAR_UCALLER: if (!dtrace_priv_proc(state)) return (0); @@ -2920,7 +2928,6 @@ dtrace_dif_variable(dtrace_mstate_t *mst } return (mstate->dtms_ucaller); -#endif case DIF_VAR_PROBEPROV: ASSERT(mstate->dtms_present & DTRACE_MSTATE_PROBE); @@ -5736,7 +5743,6 @@ dtrace_action_chill(dtrace_mstate_t *mst cpu->cpu_dtrace_chilled += val; } -#if defined(sun) static void dtrace_action_ustack(dtrace_mstate_t *mstate, dtrace_state_t *state, uint64_t *buf, uint64_t arg) @@ -5849,7 +5855,6 @@ dtrace_action_ustack(dtrace_mstate_t *ms out: mstate->dtms_scratch_ptr = old; } -#endif /* * If you're looking for the epicenter of DTrace, you just found it. This @@ -6172,7 +6177,6 @@ dtrace_probe(dtrace_id_t id, uintptr_t a (uint32_t *)arg0); continue; -#if defined(sun) case DTRACEACT_JSTACK: case DTRACEACT_USTACK: if (!dtrace_priv_proc(state)) @@ -6214,7 +6218,6 @@ dtrace_probe(dtrace_id_t id, uintptr_t a DTRACE_USTACK_NFRAMES(rec->dtrd_arg) + 1); DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); continue; -#endif default: break; @@ -8141,7 +8144,6 @@ dtrace_helper_provide(dof_helper_t *dhp, dtrace_enabling_matchall(); } -#if defined(sun) static void dtrace_helper_provider_remove_one(dof_helper_t *dhp, dof_sec_t *sec, pid_t pid) { @@ -8189,7 +8191,6 @@ dtrace_helper_provider_remove(dof_helper dtrace_helper_provider_remove_one(dhp, sec, pid); } } -#endif /* * DTrace Meta Provider-to-Framework API Functions @@ -8729,7 +8730,6 @@ dtrace_difo_validate(dtrace_difo_t *dp, return (err); } -#if defined(sun) /* * Validate a DTrace DIF object that it is to be used as a helper. Helpers * are much more constrained than normal DIFOs. Specifically, they may @@ -8887,7 +8887,6 @@ dtrace_difo_validate_helper(dtrace_difo_ return (err); } -#endif /* * Returns 1 if the expression in the DIF object can be cached on a per-thread @@ -13791,7 +13790,6 @@ dtrace_anon_property(void) } } -#if defined(sun) /* * DTrace Helper Functions */ @@ -13855,9 +13853,7 @@ dtrace_helper_trace(dtrace_helper_action ((uint64_t *)(uintptr_t)svar->dtsv_data)[curcpu]; } } -#endif -#if defined(sun) static uint64_t dtrace_helper(int which, dtrace_mstate_t *mstate, dtrace_state_t *state, uint64_t arg0, uint64_t arg1) @@ -13865,7 +13861,7 @@ dtrace_helper(int which, dtrace_mstate_t uint16_t *flags = &cpu_core[curcpu].cpuc_dtrace_flags; uint64_t sarg0 = mstate->dtms_arg[0]; uint64_t sarg1 = mstate->dtms_arg[1]; - uint64_t rval; + uint64_t rval = 0; dtrace_helpers_t *helpers = curproc->p_dtrace_helpers; dtrace_helper_action_t *helper; dtrace_vstate_t *vstate; @@ -14056,9 +14052,7 @@ dtrace_helper_destroygen(int gen) return (0); } -#endif -#if defined(sun) static int dtrace_helper_validate(dtrace_helper_action_t *helper) { @@ -14073,9 +14067,7 @@ dtrace_helper_validate(dtrace_helper_act return (err == 0); } -#endif -#if defined(sun) static int dtrace_helper_action_add(int which, dtrace_ecbdesc_t *ep) { @@ -14622,6 +14614,7 @@ dtrace_helpers_create(proc_t *p) return (help); } +#if defined(sun) static void dtrace_helpers_destroy(void) { @@ -16466,6 +16459,7 @@ _fini(void) #else static d_ioctl_t dtrace_ioctl; +static d_ioctl_t dtrace_ioctl_helper; static void dtrace_load(void *); static int dtrace_unload(void); #if __FreeBSD_version < 800039 @@ -16474,6 +16468,7 @@ static struct clonedevs *dtrace_clones; static eventhandler_tag eh_tag; /* Event handler tag. */ #else static struct cdev *dtrace_dev; +static struct cdev *helper_dev; #endif void dtrace_invop_init(void); @@ -16488,6 +16483,13 @@ static struct cdevsw dtrace_cdevsw = { .d_name = "dtrace", }; +static struct cdevsw helper_cdevsw = { + .d_version = D_VERSION, + .d_flags = D_TRACKCLOSE | D_NEEDMINOR, + .d_ioctl = dtrace_ioctl_helper, + .d_name = "helper", +}; + #include #if __FreeBSD_version < 800039 #include Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h Sun Aug 22 10:40:15 2010 (r211607) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h Sun Aug 22 10:53:32 2010 (r211608) @@ -1268,7 +1268,7 @@ extern void dtrace_copyout(uintptr_t, ui extern void dtrace_copyoutstr(uintptr_t, uintptr_t, size_t, volatile uint16_t *); extern void dtrace_getpcstack(pc_t *, int, int, uint32_t *); -extern ulong_t dtrace_getreg(struct regs *, uint_t); +extern ulong_t dtrace_getreg(struct trapframe *, uint_t); extern int dtrace_getstackdepth(int); extern void dtrace_getupcstack(uint64_t *, int); extern void dtrace_getufpstack(uint64_t *, uint64_t *, int); Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Sun Aug 22 10:40:15 2010 (r211607) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Sun Aug 22 10:53:32 2010 (r211608) @@ -42,6 +42,7 @@ #include #include +#include "regset.h" uint8_t dtrace_fuword8_nocheck(void *); uint16_t dtrace_fuword16_nocheck(void *); @@ -103,12 +104,11 @@ dtrace_getustack_common(uint64_t *pcstac { volatile uint16_t *flags = (volatile uint16_t *)&cpu_core[curcpu].cpuc_dtrace_flags; - struct amd64_frame *frame; int ret = 0; ASSERT(pcstack == NULL || pcstack_limit > 0); - while (pc != 0 && sp != 0) { + while (pc != 0) { ret++; if (pcstack != NULL) { *pcstack++ = (uint64_t)pc; @@ -117,10 +117,12 @@ dtrace_getustack_common(uint64_t *pcstac break; } - frame = (struct amd64_frame *) sp; + if (sp == 0) + break; - pc = dtrace_fulword(&frame->f_retaddr); - sp = dtrace_fulword(&frame->f_frame); + pc = dtrace_fuword64((void *)(sp + + offsetof(struct amd64_frame, f_retaddr))); + sp = dtrace_fuword64((void *)sp); /* * This is totally bogus: if we faulted, we're going to clear @@ -141,7 +143,7 @@ dtrace_getupcstack(uint64_t *pcstack, in { proc_t *p = curproc; struct trapframe *tf; - uintptr_t pc, sp; + uintptr_t pc, sp, fp; volatile uint16_t *flags = (volatile uint16_t *)&cpu_core[curcpu].cpuc_dtrace_flags; int n; @@ -165,18 +167,28 @@ dtrace_getupcstack(uint64_t *pcstack, in return; pc = tf->tf_rip; + fp = tf->tf_rbp; sp = tf->tf_rsp; if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_ENTRY)) { + /* + * In an entry probe. The frame pointer has not yet been + * pushed (that happens in the function prologue). The + * best approach is to add the current pc as a missing top + * of stack and back the pc up to the caller, which is stored + * at the current stack pointer address since the call + * instruction puts it there right before the branch. + */ + *pcstack++ = (uint64_t)pc; pcstack_limit--; if (pcstack_limit <= 0) return; - pc = dtrace_fulword((void *) sp); + pc = dtrace_fuword64((void *) sp); } - n = dtrace_getustack_common(pcstack, pcstack_limit, pc, sp); + n = dtrace_getustack_common(pcstack, pcstack_limit, pc, fp); ASSERT(n >= 0); ASSERT(n <= pcstack_limit); @@ -193,7 +205,7 @@ dtrace_getustackdepth(void) { proc_t *p = curproc; struct trapframe *tf; - uintptr_t pc, sp; + uintptr_t pc, fp, sp; int n = 0; if (p == NULL || (tf = curthread->td_frame) == NULL) @@ -203,30 +215,40 @@ dtrace_getustackdepth(void) return (-1); pc = tf->tf_rip; + fp = tf->tf_rbp; sp = tf->tf_rsp; if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_ENTRY)) { - n++; + /* + * In an entry probe. The frame pointer has not yet been + * pushed (that happens in the function prologue). The + * best approach is to add the current pc as a missing top + * of stack and back the pc up to the caller, which is stored + * at the current stack pointer address since the call + * instruction puts it there right before the branch. + */ - pc = dtrace_fulword((void *) sp); + pc = dtrace_fuword64((void *) sp); + n++; } - n += dtrace_getustack_common(NULL, 0, pc, sp); + n += dtrace_getustack_common(NULL, 0, pc, fp); return (n); } -#ifdef notyet void dtrace_getufpstack(uint64_t *pcstack, uint64_t *fpstack, int pcstack_limit) { - klwp_t *lwp = ttolwp(curthread); proc_t *p = curproc; - struct regs *rp; - uintptr_t pc, sp, oldcontext; + struct trapframe *tf; + uintptr_t pc, sp, fp; volatile uint16_t *flags = (volatile uint16_t *)&cpu_core[curcpu].cpuc_dtrace_flags; +#ifdef notyet /* XXX signal stack */ + uintptr_t oldcontext; size_t s1, s2; +#endif if (*flags & CPU_DTRACE_FAULT) return; @@ -237,7 +259,7 @@ dtrace_getufpstack(uint64_t *pcstack, ui /* * If there's no user context we still need to zero the stack. */ - if (lwp == NULL || p == NULL || (rp = lwp->lwp_regs) == NULL) + if (p == NULL || (tf = curthread->td_frame) == NULL) goto zero; *pcstack++ = (uint64_t)p->p_pid; @@ -246,12 +268,15 @@ dtrace_getufpstack(uint64_t *pcstack, ui if (pcstack_limit <= 0) return; - pc = rp->r_pc; - sp = rp->r_fp; - oldcontext = lwp->lwp_oldcontext; + pc = tf->tf_rip; + sp = tf->tf_rsp; + fp = tf->tf_rbp; +#ifdef notyet /* XXX signal stack */ + oldcontext = lwp->lwp_oldcontext; s1 = sizeof (struct xframe) + 2 * sizeof (long); s2 = s1 + sizeof (siginfo_t); +#endif if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_ENTRY)) { *pcstack++ = (uint64_t)pc; @@ -260,19 +285,20 @@ dtrace_getufpstack(uint64_t *pcstack, ui if (pcstack_limit <= 0) return; - if (p->p_model == DATAMODEL_NATIVE) - pc = dtrace_fulword((void *)rp->r_sp); - else - pc = dtrace_fuword32((void *)rp->r_sp); + pc = dtrace_fuword64((void *)sp); } - while (pc != 0 && sp != 0) { + while (pc != 0) { *pcstack++ = (uint64_t)pc; - *fpstack++ = sp; + *fpstack++ = fp; pcstack_limit--; if (pcstack_limit <= 0) break; + if (fp == 0) + break; + +#ifdef notyet /* XXX signal stack */ if (oldcontext == sp + s1 || oldcontext == sp + s2) { ucontext_t *ucp = (ucontext_t *)oldcontext; greg_t *gregs = ucp->uc_mcontext.gregs; @@ -281,11 +307,12 @@ dtrace_getufpstack(uint64_t *pcstack, ui pc = dtrace_fulword(&gregs[REG_PC]); oldcontext = dtrace_fulword(&ucp->uc_link); - } else { - struct xframe *fr = (struct xframe *)sp; - - pc = dtrace_fulword(&fr->fr_savpc); - sp = dtrace_fulword(&fr->fr_savfp); + } else +#endif /* XXX */ + { + pc = dtrace_fuword64((void *)(fp + + offsetof(struct amd64_frame, f_retaddr))); + fp = dtrace_fuword64((void *)fp); } /* @@ -301,9 +328,8 @@ dtrace_getufpstack(uint64_t *pcstack, ui zero: while (pcstack_limit-- > 0) - *pcstack++ = NULL; + *pcstack++ = 0; } -#endif /*ARGSUSED*/ uint64_t @@ -412,31 +438,30 @@ dtrace_getstackdepth(int aframes) return depth - aframes; } -#ifdef notyet ulong_t -dtrace_getreg(struct regs *rp, uint_t reg) +dtrace_getreg(struct trapframe *rp, uint_t reg) { -#if defined(__amd64) + /* This table is dependent on reg.d. */ int regmap[] = { - REG_GS, /* GS */ - REG_FS, /* FS */ - REG_ES, /* ES */ - REG_DS, /* DS */ - REG_RDI, /* EDI */ - REG_RSI, /* ESI */ - REG_RBP, /* EBP */ - REG_RSP, /* ESP */ - REG_RBX, /* EBX */ - REG_RDX, /* EDX */ - REG_RCX, /* ECX */ - REG_RAX, /* EAX */ - REG_TRAPNO, /* TRAPNO */ - REG_ERR, /* ERR */ - REG_RIP, /* EIP */ - REG_CS, /* CS */ - REG_RFL, /* EFL */ - REG_RSP, /* UESP */ - REG_SS /* SS */ + REG_GS, /* 0 GS */ + REG_FS, /* 1 FS */ + REG_ES, /* 2 ES */ + REG_DS, /* 3 DS */ + REG_RDI, /* 4 EDI */ + REG_RSI, /* 5 ESI */ + REG_RBP, /* 6 EBP, REG_FP */ + REG_RSP, /* 7 ESP */ + REG_RBX, /* 8 EBX, REG_R1 */ + REG_RDX, /* 9 EDX */ + REG_RCX, /* 10 ECX */ + REG_RAX, /* 11 EAX, REG_R0 */ + REG_TRAPNO, /* 12 TRAPNO */ + REG_ERR, /* 13 ERR */ + REG_RIP, /* 14 EIP, REG_PC */ + REG_CS, /* 15 CS */ + REG_RFL, /* 16 EFL, REG_PS */ + REG_RSP, /* 17 UESP, REG_SP */ + REG_SS /* 18 SS */ }; if (reg <= SS) { @@ -447,77 +472,68 @@ dtrace_getreg(struct regs *rp, uint_t re reg = regmap[reg]; } else { + /* This is dependent on reg.d. */ reg -= SS + 1; } switch (reg) { case REG_RDI: - return (rp->r_rdi); + return (rp->tf_rdi); case REG_RSI: - return (rp->r_rsi); + return (rp->tf_rsi); case REG_RDX: - return (rp->r_rdx); + return (rp->tf_rdx); case REG_RCX: - return (rp->r_rcx); + return (rp->tf_rcx); case REG_R8: - return (rp->r_r8); + return (rp->tf_r8); case REG_R9: - return (rp->r_r9); + return (rp->tf_r9); case REG_RAX: - return (rp->r_rax); + return (rp->tf_rax); case REG_RBX: - return (rp->r_rbx); + return (rp->tf_rbx); case REG_RBP: - return (rp->r_rbp); + return (rp->tf_rbp); case REG_R10: - return (rp->r_r10); + return (rp->tf_r10); case REG_R11: - return (rp->r_r11); + return (rp->tf_r11); case REG_R12: - return (rp->r_r12); + return (rp->tf_r12); case REG_R13: - return (rp->r_r13); + return (rp->tf_r13); case REG_R14: - return (rp->r_r14); + return (rp->tf_r14); case REG_R15: - return (rp->r_r15); + return (rp->tf_r15); case REG_DS: - return (rp->r_ds); + return (rp->tf_ds); case REG_ES: - return (rp->r_es); + return (rp->tf_es); case REG_FS: - return (rp->r_fs); + return (rp->tf_fs); case REG_GS: - return (rp->r_gs); + return (rp->tf_gs); case REG_TRAPNO: - return (rp->r_trapno); + return (rp->tf_trapno); case REG_ERR: - return (rp->r_err); + return (rp->tf_err); case REG_RIP: - return (rp->r_rip); + return (rp->tf_rip); case REG_CS: - return (rp->r_cs); + return (rp->tf_cs); case REG_SS: - return (rp->r_ss); + return (rp->tf_ss); case REG_RFL: - return (rp->r_rfl); + return (rp->tf_rflags); case REG_RSP: - return (rp->r_rsp); + return (rp->tf_rsp); default: DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); return (0); } - -#else - if (reg > SS) { - DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); - return (0); - } - - return ((&rp->r_gs)[reg]); -#endif } -#endif static int dtrace_copycheck(uintptr_t uaddr, uintptr_t kaddr, size_t size) Added: head/sys/cddl/dev/dtrace/amd64/regset.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/dev/dtrace/amd64/regset.h Sun Aug 22 10:53:32 2010 (r211608) @@ -0,0 +1,127 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * $FreeBSD$ + */ +/* + * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */ + +/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ +/* All Rights Reserved */ + +#ifndef _REGSET_H +#define _REGSET_H + +/* + * #pragma ident "@(#)regset.h 1.11 05/06/08 SMI" + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The names and offsets defined here should be specified by the + * AMD64 ABI suppl. + * + * We make fsbase and gsbase part of the lwp context (since they're + * the only way to access the full 64-bit address range via the segment + * registers) and thus belong here too. However we treat them as + * read-only; if %fs or %gs are updated, the results of the descriptor + * table lookup that those updates implicitly cause will be reflected + * in the corresponding fsbase and/or gsbase values the next time the + * context can be inspected. However it is NOT possible to override + * the fsbase/gsbase settings via this interface. + * + * Direct modification of the base registers (thus overriding the + * descriptor table base address) can be achieved with _lwp_setprivate. + */ + +#define REG_GSBASE 27 +#define REG_FSBASE 26 +#define REG_DS 25 +#define REG_ES 24 + +#define REG_GS 23 +#define REG_FS 22 +#define REG_SS 21 +#define REG_RSP 20 +#define REG_RFL 19 +#define REG_CS 18 +#define REG_RIP 17 +#define REG_ERR 16 +#define REG_TRAPNO 15 +#define REG_RAX 14 +#define REG_RCX 13 +#define REG_RDX 12 +#define REG_RBX 11 +#define REG_RBP 10 +#define REG_RSI 9 +#define REG_RDI 8 +#define REG_R8 7 +#define REG_R9 6 +#define REG_R10 5 +#define REG_R11 4 +#define REG_R12 3 +#define REG_R13 2 +#define REG_R14 1 +#define REG_R15 0 + +/* + * The names and offsets defined here are specified by i386 ABI suppl. + */ + +#define SS 18 /* only stored on a privilege transition */ +#define UESP 17 /* only stored on a privilege transition */ +#define EFL 16 +#define CS 15 +#define EIP 14 +#define ERR 13 +#define TRAPNO 12 +#define EAX 11 +#define ECX 10 +#define EDX 9 +#define EBX 8 +#define ESP 7 +#define EBP 6 +#define ESI 5 +#define EDI 4 +#define DS 3 +#define ES 2 +#define FS 1 +#define GS 0 + +#define REG_PC EIP +#define REG_FP EBP +#define REG_SP UESP +#define REG_PS EFL +#define REG_R0 EAX +#define REG_R1 EDX + +#ifdef __cplusplus +} +#endif + +#endif /* _REGSET_H */ Modified: head/sys/cddl/dev/dtrace/dtrace_ioctl.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_ioctl.c Sun Aug 22 10:40:15 2010 (r211607) +++ head/sys/cddl/dev/dtrace/dtrace_ioctl.c Sun Aug 22 10:53:32 2010 (r211608) @@ -27,6 +27,55 @@ SYSCTL_INT(_debug_dtrace, OID_AUTO, verb #define DTRACE_IOCTL_PRINTF(fmt, ...) if (dtrace_verbose_ioctl) printf(fmt, ## __VA_ARGS__ ) +static int +dtrace_ioctl_helper(struct cdev *dev, u_long cmd, caddr_t addr, int flags, + struct thread *td) +{ + int rval; + dof_helper_t *dhp = NULL; + dof_hdr_t *dof = NULL; + + switch (cmd) { + case DTRACEHIOC_ADDDOF: + dhp = (dof_helper_t *)addr; + /* XXX all because dofhp_dof is 64 bit */ +#ifdef __i386 + addr = (caddr_t)(uint32_t)dhp->dofhp_dof; +#else + addr = (caddr_t)dhp->dofhp_dof; +#endif + /* FALLTHROUGH */ + case DTRACEHIOC_ADD: + dof = dtrace_dof_copyin((intptr_t)addr, &rval); + + if (dof == NULL) + return (rval); + + mutex_enter(&dtrace_lock); + if ((rval = dtrace_helper_slurp((dof_hdr_t *)dof, dhp)) != -1) { + if (dhp) { + dhp->gen = rval; + copyout(dhp, addr, sizeof(*dhp)); + } + rval = 0; + } else { + rval = EINVAL; + } + mutex_exit(&dtrace_lock); + return (rval); + case DTRACEHIOC_REMOVE: + mutex_enter(&dtrace_lock); + rval = dtrace_helper_destroygen((int)*addr); + mutex_exit(&dtrace_lock); + + return (rval); + default: + break; + } + + return (ENOTTY); +} + /* ARGSUSED */ static int dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, Modified: head/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_load.c Sun Aug 22 10:40:15 2010 (r211607) +++ head/sys/cddl/dev/dtrace/dtrace_load.c Sun Aug 22 10:53:32 2010 (r211608) @@ -161,7 +161,10 @@ dtrace_load(void *dummy) /* Setup device cloning events. */ eh_tag = EVENTHANDLER_REGISTER(dev_clone, dtrace_clone, 0, 1000); #else - dtrace_dev = make_dev(&dtrace_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "dtrace/dtrace"); + dtrace_dev = make_dev(&dtrace_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, + "dtrace/dtrace"); + helper_dev = make_dev(&helper_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, + "dtrace/helper"); #endif return; Modified: head/sys/cddl/dev/dtrace/i386/dtrace_isa.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dtrace_isa.c Sun Aug 22 10:40:15 2010 (r211607) +++ head/sys/cddl/dev/dtrace/i386/dtrace_isa.c Sun Aug 22 10:53:32 2010 (r211608) @@ -33,13 +33,17 @@ #include #include +#include #include +#include #include #include #include #include +#include "regset.h" + extern uintptr_t kernbase; uintptr_t kernelbase = (uintptr_t) &kernbase; @@ -100,21 +104,22 @@ dtrace_getpcstack(pc_t *pcstack, int pcs } } -#ifdef notyet static int dtrace_getustack_common(uint64_t *pcstack, int pcstack_limit, uintptr_t pc, uintptr_t sp) { - klwp_t *lwp = ttolwp(curthread); +#ifdef notyet proc_t *p = curproc; - uintptr_t oldcontext = lwp->lwp_oldcontext; + uintptr_t oldcontext = lwp->lwp_oldcontext; /* XXX signal stack. */ + size_t s1, s2; +#endif volatile uint16_t *flags = (volatile uint16_t *)&cpu_core[curcpu].cpuc_dtrace_flags; - size_t s1, s2; int ret = 0; ASSERT(pcstack == NULL || pcstack_limit > 0); +#ifdef notyet /* XXX signal stack. */ if (p->p_model == DATAMODEL_NATIVE) { s1 = sizeof (struct frame) + 2 * sizeof (long); s2 = s1 + sizeof (siginfo_t); @@ -122,8 +127,9 @@ dtrace_getustack_common(uint64_t *pcstac s1 = sizeof (struct frame32) + 3 * sizeof (int); s2 = s1 + sizeof (siginfo32_t); } +#endif - while (pc != 0 && sp != 0) { + while (pc != 0) { ret++; if (pcstack != NULL) { *pcstack++ = (uint64_t)pc; @@ -132,6 +138,10 @@ dtrace_getustack_common(uint64_t *pcstac break; } + if (sp == 0) + break; + +#ifdef notyet /* XXX signal stack. */ if (oldcontext == sp + s1 || oldcontext == sp + s2) { if (p->p_model == DATAMODEL_NATIVE) { ucontext_t *ucp = (ucontext_t *)oldcontext; @@ -163,6 +173,11 @@ dtrace_getustack_common(uint64_t *pcstac sp = dtrace_fuword32(&fr->fr_savfp); } } +#else + pc = dtrace_fuword32((void *)(sp + + offsetof(struct i386_frame, f_retaddr))); + sp = dtrace_fuword32((void *)sp); +#endif /* ! notyet */ /* * This is totally bogus: if we faulted, we're going to clear @@ -181,10 +196,9 @@ dtrace_getustack_common(uint64_t *pcstac void dtrace_getupcstack(uint64_t *pcstack, int pcstack_limit) { - klwp_t *lwp = ttolwp(curthread); proc_t *p = curproc; - struct regs *rp; - uintptr_t pc, sp; + struct trapframe *tf; + uintptr_t pc, sp, fp; volatile uint16_t *flags = (volatile uint16_t *)&cpu_core[curcpu].cpuc_dtrace_flags; int n; @@ -198,7 +212,7 @@ dtrace_getupcstack(uint64_t *pcstack, in /* * If there's no user context we still need to zero the stack. */ - if (lwp == NULL || p == NULL || (rp = lwp->lwp_regs) == NULL) + if (p == NULL || (tf = curthread->td_frame) == NULL) goto zero; *pcstack++ = (uint64_t)p->p_pid; @@ -207,19 +221,26 @@ dtrace_getupcstack(uint64_t *pcstack, in if (pcstack_limit <= 0) return; - pc = rp->r_pc; - sp = rp->r_fp; + pc = tf->tf_eip; + fp = tf->tf_ebp; + sp = tf->tf_esp; if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_ENTRY)) { + /* + * In an entry probe. The frame pointer has not yet been + * pushed (that happens in the function prologue). The + * best approach is to add the current pc as a missing top + * of stack and back the pc up to the caller, which is stored + * at the current stack pointer address since the call + * instruction puts it there right before the branch. + */ + *pcstack++ = (uint64_t)pc; pcstack_limit--; if (pcstack_limit <= 0) return; - if (p->p_model == DATAMODEL_NATIVE) - pc = dtrace_fulword((void *)rp->r_sp); - else - pc = dtrace_fuword32((void *)rp->r_sp); + pc = dtrace_fuword32((void *) sp); } n = dtrace_getustack_common(pcstack, pcstack_limit, pc, sp); @@ -231,24 +252,58 @@ dtrace_getupcstack(uint64_t *pcstack, in zero: while (pcstack_limit-- > 0) - *pcstack++ = NULL; + *pcstack++ = 0; } int dtrace_getustackdepth(void) { + proc_t *p = curproc; + struct trapframe *tf; + uintptr_t pc, fp, sp; + int n = 0; + + if (p == NULL || (tf = curthread->td_frame) == NULL) + return (0); + + if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_FAULT)) + return (-1); + + pc = tf->tf_eip; + fp = tf->tf_ebp; + sp = tf->tf_esp; + + if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_ENTRY)) { + /* + * In an entry probe. The frame pointer has not yet been + * pushed (that happens in the function prologue). The + * best approach is to add the current pc as a missing top + * of stack and back the pc up to the caller, which is stored + * at the current stack pointer address since the call + * instruction puts it there right before the branch. + */ + + pc = dtrace_fuword32((void *) sp); + n++; + } + + n += dtrace_getustack_common(NULL, 0, pc, fp); + + return (n); } void *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 11:04:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58A711065694; Sun, 22 Aug 2010 11:04:30 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 480568FC14; Sun, 22 Aug 2010 11:04:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MB4Unv001539; Sun, 22 Aug 2010 11:04:30 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MB4Ung001538; Sun, 22 Aug 2010 11:04:30 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201008221104.o7MB4Ung001538@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 22 Aug 2010 11:04:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211609 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 11:04:30 -0000 Author: jilles Date: Sun Aug 22 11:04:30 2010 New Revision: 211609 URL: http://svn.freebsd.org/changeset/base/211609 Log: sh: Add a test for breaking from a loop outside the current function. It is unwise to rely on this but I'd like to know if this would break. Added: head/tools/regression/bin/sh/builtins/break3.0 (contents, props changed) Added: head/tools/regression/bin/sh/builtins/break3.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/break3.0 Sun Aug 22 11:04:30 2010 (r211609) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +# We accept this and people might rely on it. +# However, various other shells do not accept it. + +f() { + break + echo bad1 +} + +while :; do + f + echo bad2 + exit 2 +done From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 11:04:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1A551065672; Sun, 22 Aug 2010 11:04:43 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D13598FC12; Sun, 22 Aug 2010 11:04:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MB4hfS001579; Sun, 22 Aug 2010 11:04:43 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MB4h9m001577; Sun, 22 Aug 2010 11:04:43 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008221104.o7MB4h9m001577@svn.freebsd.org> From: Rui Paulo Date: Sun, 22 Aug 2010 11:04:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211610 - head/sys/cddl/dev/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 11:04:44 -0000 Author: rpaulo Date: Sun Aug 22 11:04:43 2010 New Revision: 211610 URL: http://svn.freebsd.org/changeset/base/211610 Log: Add more compatibility structure members needed by the upcoming fasttrap DTrace device. Sponsored by: The FreeBSD Foundation Modified: head/sys/cddl/dev/dtrace/dtrace_cddl.h Modified: head/sys/cddl/dev/dtrace/dtrace_cddl.h ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_cddl.h Sun Aug 22 11:04:30 2010 (r211609) +++ head/sys/cddl/dev/dtrace/dtrace_cddl.h Sun Aug 22 11:04:43 2010 (r211610) @@ -36,6 +36,7 @@ typedef struct kdtrace_proc { int p_dtrace_probes; /* Are there probes for this proc? */ u_int64_t p_dtrace_count; /* Number of DTrace tracepoints */ void *p_dtrace_helpers; /* DTrace helpers, if any */ + int p_dtrace_model; } kdtrace_proc_t; @@ -59,6 +60,9 @@ typedef struct kdtrace_thread { /* Handling a return probe. */ u_int8_t _td_dtrace_ast; /* Saved ast flag. */ +#ifdef __amd64__ + u_int8_t _td_dtrace_reg; +#endif } _tds; u_long _td_dtrace_ft; /* Bitwise or of these flags. */ } _tdu; @@ -67,6 +71,7 @@ typedef struct kdtrace_thread { #define td_dtrace_step _tdu._tds._td_dtrace_step #define td_dtrace_ret _tdu._tds._td_dtrace_ret #define td_dtrace_ast _tdu._tds._td_dtrace_ast +#define td_dtrace_reg _tdu._tds._td_dtrace_reg uintptr_t td_dtrace_pc; /* DTrace saved pc from fasttrap. */ uintptr_t td_dtrace_npc; /* DTrace next pc from fasttrap. */ @@ -74,6 +79,9 @@ typedef struct kdtrace_thread { /* DTrace per-thread scratch location. */ uintptr_t td_dtrace_astpc; /* DTrace return sequence location. */ +#ifdef __amd64__ + uintptr_t td_dtrace_regv; +#endif u_int64_t td_hrtime; /* Last time on cpu. */ int td_errno; /* Syscall return value. */ } kdtrace_thread_t; @@ -89,16 +97,38 @@ typedef struct kdtrace_thread { #define t_dtrace_stop td_dtrace->td_dtrace_stop #define t_dtrace_sig td_dtrace->td_dtrace_sig #define t_predcache td_dtrace->td_predcache -#define p_dtrace_helpers p_dtrace->p_dtrace_helpers +#define t_dtrace_ft td_dtrace->td_dtrace_ft +#define t_dtrace_on td_dtrace->td_dtrace_on +#define t_dtrace_step td_dtrace->td_dtrace_step +#define t_dtrace_ret td_dtrace->td_dtrace_ret +#define t_dtrace_ast td_dtrace->td_dtrace_ast +#define t_dtrace_reg td_dtrace->td_dtrace_reg +#define t_dtrace_pc td_dtrace->td_dtrace_pc +#define t_dtrace_npc td_dtrace->td_dtrace_npc +#define t_dtrace_scrpc td_dtrace->td_dtrace_scrpc +#define t_dtrace_astpc td_dtrace->td_dtrace_astpc +#define t_dtrace_regv td_dtrace->td_dtrace_regv +#define p_dtrace_helpers p_dtrace->p_dtrace_helpers +#define p_dtrace_count p_dtrace->p_dtrace_count +#define p_dtrace_probes p_dtrace->p_dtrace_probes +#define p_model p_dtrace->p_dtrace_model +#define DATAMODEL_NATIVE 0 +#ifdef __amd64__ +#define DATAMODEL_LP64 0 +#define DATAMODEL_ILP32 1 +#else +#define DATAMODEL_LP64 1 +#define DATAMODEL_ILP32 0 +#endif /* - * Definitions for fields in struct proc which are named differntly in FreeBSD. + * Definitions for fields in struct proc which are named differently in FreeBSD. */ #define p_cred p_ucred #define p_parent p_pptr /* - * Definitions for fields in struct thread which are named differntly in FreeBSD. + * Definitions for fields in struct thread which are named differently in FreeBSD. */ #define t_procp td_proc #define t_tid td_tid From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 11:05:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1584F10656B2; Sun, 22 Aug 2010 11:05:38 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0525A8FC0A; Sun, 22 Aug 2010 11:05:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MB5bnX001645; Sun, 22 Aug 2010 11:05:37 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MB5bB7001643; Sun, 22 Aug 2010 11:05:37 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008221105.o7MB5bB7001643@svn.freebsd.org> From: Rui Paulo Date: Sun, 22 Aug 2010 11:05:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211611 - head/sys/cddl/dev/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 11:05:38 -0000 Author: rpaulo Date: Sun Aug 22 11:05:37 2010 New Revision: 211611 URL: http://svn.freebsd.org/changeset/base/211611 Log: Destroy the helper device when unloading. Sponsored by: The FreeBSD Foundation Modified: head/sys/cddl/dev/dtrace/dtrace_unload.c Modified: head/sys/cddl/dev/dtrace/dtrace_unload.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_unload.c Sun Aug 22 11:04:43 2010 (r211610) +++ head/sys/cddl/dev/dtrace/dtrace_unload.c Sun Aug 22 11:05:37 2010 (r211611) @@ -43,6 +43,7 @@ dtrace_unload() } #else destroy_dev(dtrace_dev); + destroy_dev(helper_dev); #endif mutex_enter(&dtrace_provider_lock); From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 11:07:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 317E0106566C; Sun, 22 Aug 2010 11:07:47 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 071F48FC21; Sun, 22 Aug 2010 11:07:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MB7kQG001721; Sun, 22 Aug 2010 11:07:46 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MB7k3D001720; Sun, 22 Aug 2010 11:07:46 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201008221107.o7MB7k3D001720@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 22 Aug 2010 11:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211612 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 11:07:47 -0000 Author: jilles Date: Sun Aug 22 11:07:46 2010 New Revision: 211612 URL: http://svn.freebsd.org/changeset/base/211612 Log: Fix keyword expansion properties. Modified: Directory Properties: head/tools/regression/bin/sh/builtins/break3.0 (props changed) From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 11:08:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B0DF1065694; Sun, 22 Aug 2010 11:08:19 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 005C48FC08; Sun, 22 Aug 2010 11:08:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MB8IFQ001773; Sun, 22 Aug 2010 11:08:18 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MB8I8w001771; Sun, 22 Aug 2010 11:08:18 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008221108.o7MB8I8w001771@svn.freebsd.org> From: Rui Paulo Date: Sun, 22 Aug 2010 11:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211613 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 11:08:19 -0000 Author: rpaulo Date: Sun Aug 22 11:08:18 2010 New Revision: 211613 URL: http://svn.freebsd.org/changeset/base/211613 Log: Fix style issues. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_dtrace.c Modified: head/sys/kern/kern_dtrace.c ============================================================================== --- head/sys/kern/kern_dtrace.c Sun Aug 22 11:07:46 2010 (r211612) +++ head/sys/kern/kern_dtrace.c Sun Aug 22 11:08:18 2010 (r211613) @@ -49,7 +49,8 @@ MALLOC_DEFINE(M_KDTRACE, "kdtrace", "DTr size_t kdtrace_proc_size() { - return(KDTRACE_PROC_SIZE); + + return (KDTRACE_PROC_SIZE); } static void @@ -63,6 +64,7 @@ kdtrace_proc_ctor(void *arg __unused, st static void kdtrace_proc_dtor(void *arg __unused, struct proc *p) { + if (p->p_dtrace != NULL) { free(p->p_dtrace, M_KDTRACE); p->p_dtrace = NULL; @@ -73,7 +75,7 @@ kdtrace_proc_dtor(void *arg __unused, st size_t kdtrace_thread_size() { - return(KDTRACE_THREAD_SIZE); + return (KDTRACE_THREAD_SIZE); } static void @@ -87,6 +89,7 @@ kdtrace_thread_ctor(void *arg __unused, static void kdtrace_thread_dtor(void *arg __unused, struct thread *td) { + if (td->td_dtrace != NULL) { free(td->td_dtrace, M_KDTRACE); td->td_dtrace = NULL; @@ -99,10 +102,15 @@ kdtrace_thread_dtor(void *arg __unused, static void init_dtrace(void *dummy __unused) { - EVENTHANDLER_REGISTER(process_ctor, kdtrace_proc_ctor, NULL, EVENTHANDLER_PRI_ANY); - EVENTHANDLER_REGISTER(process_dtor, kdtrace_proc_dtor, NULL, EVENTHANDLER_PRI_ANY); - EVENTHANDLER_REGISTER(thread_ctor, kdtrace_thread_ctor, NULL, EVENTHANDLER_PRI_ANY); - EVENTHANDLER_REGISTER(thread_dtor, kdtrace_thread_dtor, NULL, EVENTHANDLER_PRI_ANY); + + EVENTHANDLER_REGISTER(process_ctor, kdtrace_proc_ctor, NULL, + EVENTHANDLER_PRI_ANY); + EVENTHANDLER_REGISTER(process_dtor, kdtrace_proc_dtor, NULL, + EVENTHANDLER_PRI_ANY); + EVENTHANDLER_REGISTER(thread_ctor, kdtrace_thread_ctor, NULL, + EVENTHANDLER_PRI_ANY); + EVENTHANDLER_REGISTER(thread_dtor, kdtrace_thread_dtor, NULL, + EVENTHANDLER_PRI_ANY); } SYSINIT(kdtrace, SI_SUB_KDTRACE, SI_ORDER_FIRST, init_dtrace, NULL); From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 11:09:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52FE71065673; Sun, 22 Aug 2010 11:09:54 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42E8C8FC12; Sun, 22 Aug 2010 11:09:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MB9sNF001842; Sun, 22 Aug 2010 11:09:54 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MB9sD6001840; Sun, 22 Aug 2010 11:09:54 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008221109.o7MB9sD6001840@svn.freebsd.org> From: Rui Paulo Date: Sun, 22 Aug 2010 11:09:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211614 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 11:09:54 -0000 Author: rpaulo Date: Sun Aug 22 11:09:53 2010 New Revision: 211614 URL: http://svn.freebsd.org/changeset/base/211614 Log: Bump KDTRACE_THREAD_ZERO and use M_ZERO as a malloc flag instead of calling bzero. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_dtrace.c Modified: head/sys/kern/kern_dtrace.c ============================================================================== --- head/sys/kern/kern_dtrace.c Sun Aug 22 11:08:18 2010 (r211613) +++ head/sys/kern/kern_dtrace.c Sun Aug 22 11:09:53 2010 (r211614) @@ -39,9 +39,7 @@ __FBSDID("$FreeBSD$"); #include #define KDTRACE_PROC_SIZE 64 -#define KDTRACE_PROC_ZERO 8 #define KDTRACE_THREAD_SIZE 256 -#define KDTRACE_THREAD_ZERO 64 MALLOC_DEFINE(M_KDTRACE, "kdtrace", "DTrace hooks"); @@ -56,9 +54,8 @@ kdtrace_proc_size() static void kdtrace_proc_ctor(void *arg __unused, struct proc *p) { - p->p_dtrace = malloc(KDTRACE_PROC_SIZE, M_KDTRACE, M_WAITOK); - bzero(p->p_dtrace, KDTRACE_PROC_ZERO); + p->p_dtrace = malloc(KDTRACE_PROC_SIZE, M_KDTRACE, M_WAITOK|M_ZERO); } static void @@ -75,15 +72,15 @@ kdtrace_proc_dtor(void *arg __unused, st size_t kdtrace_thread_size() { + return (KDTRACE_THREAD_SIZE); } static void kdtrace_thread_ctor(void *arg __unused, struct thread *td) { - td->td_dtrace = malloc(KDTRACE_THREAD_SIZE, M_KDTRACE, M_WAITOK); - bzero(td->td_dtrace, KDTRACE_THREAD_ZERO); + td->td_dtrace = malloc(KDTRACE_THREAD_SIZE, M_KDTRACE, M_WAITOK|M_ZERO); } static void From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 11:12:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72B551065672; Sun, 22 Aug 2010 11:12:07 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 627AC8FC17; Sun, 22 Aug 2010 11:12:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MBC7NQ001955; Sun, 22 Aug 2010 11:12:07 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MBC7AY001953; Sun, 22 Aug 2010 11:12:07 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008221112.o7MBC7AY001953@svn.freebsd.org> From: Rui Paulo Date: Sun, 22 Aug 2010 11:12:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211615 - head/sys/modules/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 11:12:07 -0000 Author: rpaulo Date: Sun Aug 22 11:12:07 2010 New Revision: 211615 URL: http://svn.freebsd.org/changeset/base/211615 Log: Remove an elif and add an or-clause. Sponsored by: The FreeBSD Foundation Modified: head/sys/modules/dtrace/Makefile Modified: head/sys/modules/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/Makefile Sun Aug 22 11:09:53 2010 (r211614) +++ head/sys/modules/dtrace/Makefile Sun Aug 22 11:12:07 2010 (r211615) @@ -14,9 +14,7 @@ SUBDIR= dtmalloc \ sdt \ systrace -.if ${MACHINE_ARCH} == "amd64" -SUBDIR+= fbt -.elif ${MACHINE_ARCH} == "i386" +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" SUBDIR+= fbt .endif From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 11:18:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AF58106566C; Sun, 22 Aug 2010 11:18:58 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27E848FC1D; Sun, 22 Aug 2010 11:18:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MBIwNb002176; Sun, 22 Aug 2010 11:18:58 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MBIvFq002159; Sun, 22 Aug 2010 11:18:57 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008221118.o7MBIvFq002159@svn.freebsd.org> From: Rui Paulo Date: Sun, 22 Aug 2010 11:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211616 - in head/sys: kern net opencrypto security/mac sys tools X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 11:18:58 -0000 Author: rpaulo Date: Sun Aug 22 11:18:57 2010 New Revision: 211616 URL: http://svn.freebsd.org/changeset/base/211616 Log: Add an extra comment to the SDT probes definition. This allows us to get use '-' in probe names, matching the probe names in Solaris.[1] Add userland SDT probes definitions to sys/sdt.h. Sponsored by: The FreeBSD Foundation Discussed with: rwaston [1] Modified: head/sys/kern/kern_exec.c head/sys/kern/kern_exit.c head/sys/kern/kern_fork.c head/sys/kern/kern_priv.c head/sys/kern/kern_proc.c head/sys/kern/kern_sig.c head/sys/kern/kern_timeout.c head/sys/kern/vfs_cache.c head/sys/kern/vfs_lookup.c head/sys/kern/vfs_syscalls.c head/sys/net/vnet.c head/sys/opencrypto/deflate.c head/sys/security/mac/mac_framework.c head/sys/security/mac/mac_internal.h head/sys/sys/sdt.h head/sys/tools/vnode_if.awk Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Sun Aug 22 11:12:07 2010 (r211615) +++ head/sys/kern/kern_exec.c Sun Aug 22 11:18:57 2010 (r211616) @@ -91,11 +91,11 @@ dtrace_execexit_func_t dtrace_fasttrap_e #endif SDT_PROVIDER_DECLARE(proc); -SDT_PROBE_DEFINE(proc, kernel, , exec); +SDT_PROBE_DEFINE(proc, kernel, , exec, exec); SDT_PROBE_ARGTYPE(proc, kernel, , exec, 0, "char *"); -SDT_PROBE_DEFINE(proc, kernel, , exec_failure); +SDT_PROBE_DEFINE(proc, kernel, , exec_failure, exec-failure); SDT_PROBE_ARGTYPE(proc, kernel, , exec_failure, 0, "int"); -SDT_PROBE_DEFINE(proc, kernel, , exec_success); +SDT_PROBE_DEFINE(proc, kernel, , exec_success, exec-success); SDT_PROBE_ARGTYPE(proc, kernel, , exec_success, 0, "char *"); MALLOC_DEFINE(M_PARGS, "proc-args", "Process arguments"); Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sun Aug 22 11:12:07 2010 (r211615) +++ head/sys/kern/kern_exit.c Sun Aug 22 11:18:57 2010 (r211616) @@ -90,7 +90,7 @@ dtrace_execexit_func_t dtrace_fasttrap_e #endif SDT_PROVIDER_DECLARE(proc); -SDT_PROBE_DEFINE(proc, kernel, , exit); +SDT_PROBE_DEFINE(proc, kernel, , exit, exit); SDT_PROBE_ARGTYPE(proc, kernel, , exit, 0, "int"); /* Required to be non-static for SysVR4 emulator */ Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Sun Aug 22 11:12:07 2010 (r211615) +++ head/sys/kern/kern_fork.c Sun Aug 22 11:18:57 2010 (r211616) @@ -84,7 +84,7 @@ dtrace_fork_func_t dtrace_fasttrap_fork; #endif SDT_PROVIDER_DECLARE(proc); -SDT_PROBE_DEFINE(proc, kernel, , create); +SDT_PROBE_DEFINE(proc, kernel, , create, create); SDT_PROBE_ARGTYPE(proc, kernel, , create, 0, "struct proc *"); SDT_PROBE_ARGTYPE(proc, kernel, , create, 1, "struct proc *"); SDT_PROBE_ARGTYPE(proc, kernel, , create, 2, "int"); Modified: head/sys/kern/kern_priv.c ============================================================================== --- head/sys/kern/kern_priv.c Sun Aug 22 11:12:07 2010 (r211615) +++ head/sys/kern/kern_priv.c Sun Aug 22 11:18:57 2010 (r211616) @@ -60,8 +60,8 @@ SYSCTL_INT(_security_bsd, OID_AUTO, suse TUNABLE_INT("security.bsd.suser_enabled", &suser_enabled); SDT_PROVIDER_DEFINE(priv); -SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv_ok, "int"); -SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv_err, "int"); +SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv_ok, priv-ok, "int"); +SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv_err, priv-err, "int"); /* * Check a credential for privilege. Lots of good reasons to deny privilege; Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sun Aug 22 11:12:07 2010 (r211615) +++ head/sys/kern/kern_proc.c Sun Aug 22 11:18:57 2010 (r211616) @@ -82,30 +82,30 @@ __FBSDID("$FreeBSD$"); #endif SDT_PROVIDER_DEFINE(proc); -SDT_PROBE_DEFINE(proc, kernel, ctor, entry); +SDT_PROBE_DEFINE(proc, kernel, ctor, entry, entry); SDT_PROBE_ARGTYPE(proc, kernel, ctor, entry, 0, "struct proc *"); SDT_PROBE_ARGTYPE(proc, kernel, ctor, entry, 1, "int"); SDT_PROBE_ARGTYPE(proc, kernel, ctor, entry, 2, "void *"); SDT_PROBE_ARGTYPE(proc, kernel, ctor, entry, 3, "int"); -SDT_PROBE_DEFINE(proc, kernel, ctor, return); +SDT_PROBE_DEFINE(proc, kernel, ctor, return, return); SDT_PROBE_ARGTYPE(proc, kernel, ctor, return, 0, "struct proc *"); SDT_PROBE_ARGTYPE(proc, kernel, ctor, return, 1, "int"); SDT_PROBE_ARGTYPE(proc, kernel, ctor, return, 2, "void *"); SDT_PROBE_ARGTYPE(proc, kernel, ctor, return, 3, "int"); -SDT_PROBE_DEFINE(proc, kernel, dtor, entry); +SDT_PROBE_DEFINE(proc, kernel, dtor, entry, entry); SDT_PROBE_ARGTYPE(proc, kernel, dtor, entry, 0, "struct proc *"); SDT_PROBE_ARGTYPE(proc, kernel, dtor, entry, 1, "int"); SDT_PROBE_ARGTYPE(proc, kernel, dtor, entry, 2, "void *"); SDT_PROBE_ARGTYPE(proc, kernel, dtor, entry, 3, "struct thread *"); -SDT_PROBE_DEFINE(proc, kernel, dtor, return); +SDT_PROBE_DEFINE(proc, kernel, dtor, return, return); SDT_PROBE_ARGTYPE(proc, kernel, dtor, return, 0, "struct proc *"); SDT_PROBE_ARGTYPE(proc, kernel, dtor, return, 1, "int"); SDT_PROBE_ARGTYPE(proc, kernel, dtor, return, 2, "void *"); -SDT_PROBE_DEFINE(proc, kernel, init, entry); +SDT_PROBE_DEFINE(proc, kernel, init, entry, entry); SDT_PROBE_ARGTYPE(proc, kernel, init, entry, 0, "struct proc *"); SDT_PROBE_ARGTYPE(proc, kernel, init, entry, 1, "int"); SDT_PROBE_ARGTYPE(proc, kernel, init, entry, 2, "int"); -SDT_PROBE_DEFINE(proc, kernel, init, return); +SDT_PROBE_DEFINE(proc, kernel, init, return, return); SDT_PROBE_ARGTYPE(proc, kernel, init, return, 0, "struct proc *"); SDT_PROBE_ARGTYPE(proc, kernel, init, return, 1, "int"); SDT_PROBE_ARGTYPE(proc, kernel, init, return, 2, "int"); Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Sun Aug 22 11:12:07 2010 (r211615) +++ head/sys/kern/kern_sig.c Sun Aug 22 11:18:57 2010 (r211616) @@ -89,14 +89,14 @@ __FBSDID("$FreeBSD$"); #define ONSIG 32 /* NSIG for osig* syscalls. XXX. */ SDT_PROVIDER_DECLARE(proc); -SDT_PROBE_DEFINE(proc, kernel, , signal_send); +SDT_PROBE_DEFINE(proc, kernel, , signal_send, signal-send); SDT_PROBE_ARGTYPE(proc, kernel, , signal_send, 0, "struct thread *"); SDT_PROBE_ARGTYPE(proc, kernel, , signal_send, 1, "struct proc *"); SDT_PROBE_ARGTYPE(proc, kernel, , signal_send, 2, "int"); -SDT_PROBE_DEFINE(proc, kernel, , signal_clear); +SDT_PROBE_DEFINE(proc, kernel, , signal_clear, signal-clear); SDT_PROBE_ARGTYPE(proc, kernel, , signal_clear, 0, "int"); SDT_PROBE_ARGTYPE(proc, kernel, , signal_clear, 1, "ksiginfo_t *"); -SDT_PROBE_DEFINE(proc, kernel, , signal_discard); +SDT_PROBE_DEFINE(proc, kernel, , signal_discard, signal-discard); SDT_PROBE_ARGTYPE(proc, kernel, , signal_discard, 0, "struct thread *"); SDT_PROBE_ARGTYPE(proc, kernel, , signal_discard, 1, "struct proc *"); SDT_PROBE_ARGTYPE(proc, kernel, , signal_discard, 2, "int"); Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Sun Aug 22 11:12:07 2010 (r211615) +++ head/sys/kern/kern_timeout.c Sun Aug 22 11:18:57 2010 (r211616) @@ -57,10 +57,10 @@ __FBSDID("$FreeBSD$"); #include SDT_PROVIDER_DEFINE(callout_execute); -SDT_PROBE_DEFINE(callout_execute, kernel, , callout_start); +SDT_PROBE_DEFINE(callout_execute, kernel, , callout_start, callout-start); SDT_PROBE_ARGTYPE(callout_execute, kernel, , callout_start, 0, "struct callout *"); -SDT_PROBE_DEFINE(callout_execute, kernel, , callout_end); +SDT_PROBE_DEFINE(callout_execute, kernel, , callout_end, callout-end); SDT_PROBE_ARGTYPE(callout_execute, kernel, , callout_end, 0, "struct callout *"); Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sun Aug 22 11:12:07 2010 (r211615) +++ head/sys/kern/vfs_cache.c Sun Aug 22 11:18:57 2010 (r211616) @@ -61,28 +61,28 @@ __FBSDID("$FreeBSD$"); #include SDT_PROVIDER_DECLARE(vfs); -SDT_PROBE_DEFINE3(vfs, namecache, enter, done, "struct vnode *", "char *", +SDT_PROBE_DEFINE3(vfs, namecache, enter, done, done, "struct vnode *", "char *", "struct vnode *"); -SDT_PROBE_DEFINE2(vfs, namecache, enter_negative, done, "struct vnode *", +SDT_PROBE_DEFINE2(vfs, namecache, enter_negative, done, done, "struct vnode *", "char *"); -SDT_PROBE_DEFINE1(vfs, namecache, fullpath, entry, "struct vnode *"); -SDT_PROBE_DEFINE3(vfs, namecache, fullpath, hit, "struct vnode *", +SDT_PROBE_DEFINE1(vfs, namecache, fullpath, entry, entry, "struct vnode *"); +SDT_PROBE_DEFINE3(vfs, namecache, fullpath, hit, hit, "struct vnode *", "struct char *", "struct vnode *"); -SDT_PROBE_DEFINE1(vfs, namecache, fullpath, miss, "struct vnode *"); -SDT_PROBE_DEFINE3(vfs, namecache, fullpath, return, "int", "struct vnode *", - "struct char *"); -SDT_PROBE_DEFINE3(vfs, namecache, lookup, hit, "struct vnode *", "char *", +SDT_PROBE_DEFINE1(vfs, namecache, fullpath, miss, miss, "struct vnode *"); +SDT_PROBE_DEFINE3(vfs, namecache, fullpath, return, return, "int", + "struct vnode *", "struct char *"); +SDT_PROBE_DEFINE3(vfs, namecache, lookup, hit, hit, "struct vnode *", "char *", "struct vnode *"); -SDT_PROBE_DEFINE2(vfs, namecache, lookup, hit_negative, "struct vnode *", +SDT_PROBE_DEFINE2(vfs, namecache, lookup, hit_negative, hit-negative, + "struct vnode *", "char *"); +SDT_PROBE_DEFINE2(vfs, namecache, lookup, miss, miss, "struct vnode *", "char *"); -SDT_PROBE_DEFINE2(vfs, namecache, lookup, miss, "struct vnode *", - "char *"); -SDT_PROBE_DEFINE1(vfs, namecache, purge, done, "struct vnode *"); -SDT_PROBE_DEFINE1(vfs, namecache, purge_negative, done, "struct vnode *"); -SDT_PROBE_DEFINE1(vfs, namecache, purgevfs, done, "struct mount *"); -SDT_PROBE_DEFINE3(vfs, namecache, zap, done, "struct vnode *", "char *", +SDT_PROBE_DEFINE1(vfs, namecache, purge, done, done, "struct vnode *"); +SDT_PROBE_DEFINE1(vfs, namecache, purge_negative, done, done, "struct vnode *"); +SDT_PROBE_DEFINE1(vfs, namecache, purgevfs, done, done, "struct mount *"); +SDT_PROBE_DEFINE3(vfs, namecache, zap, done, done, "struct vnode *", "char *", "struct vnode *"); -SDT_PROBE_DEFINE2(vfs, namecache, zap_negative, done, "struct vnode *", +SDT_PROBE_DEFINE2(vfs, namecache, zap_negative, done, done, "struct vnode *", "char *"); /* Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Sun Aug 22 11:12:07 2010 (r211615) +++ head/sys/kern/vfs_lookup.c Sun Aug 22 11:18:57 2010 (r211616) @@ -68,9 +68,9 @@ __FBSDID("$FreeBSD$"); #undef NAMEI_DIAGNOSTIC SDT_PROVIDER_DECLARE(vfs); -SDT_PROBE_DEFINE3(vfs, namei, lookup, entry, "struct vnode *", "char *", +SDT_PROBE_DEFINE3(vfs, namei, lookup, entry, entry, "struct vnode *", "char *", "unsigned long"); -SDT_PROBE_DEFINE2(vfs, namei, lookup, return, "int", "struct vnode *"); +SDT_PROBE_DEFINE2(vfs, namei, lookup, return, return, "int", "struct vnode *"); /* * Allocation zone for namei Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Sun Aug 22 11:12:07 2010 (r211615) +++ head/sys/kern/vfs_syscalls.c Sun Aug 22 11:18:57 2010 (r211616) @@ -85,10 +85,10 @@ __FBSDID("$FreeBSD$"); #include SDT_PROVIDER_DEFINE(vfs); -SDT_PROBE_DEFINE(vfs, , stat, mode); +SDT_PROBE_DEFINE(vfs, , stat, mode, mode); SDT_PROBE_ARGTYPE(vfs, , stat, mode, 0, "char *"); SDT_PROBE_ARGTYPE(vfs, , stat, mode, 1, "int"); -SDT_PROBE_DEFINE(vfs, , stat, reg); +SDT_PROBE_DEFINE(vfs, , stat, reg, reg); SDT_PROBE_ARGTYPE(vfs, , stat, reg, 0, "char *"); SDT_PROBE_ARGTYPE(vfs, , stat, reg, 1, "int"); Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Sun Aug 22 11:12:07 2010 (r211615) +++ head/sys/net/vnet.c Sun Aug 22 11:18:57 2010 (r211616) @@ -208,11 +208,15 @@ static TAILQ_HEAD(, vnet_data_free) vnet static struct sx vnet_data_free_lock; SDT_PROVIDER_DEFINE(vnet); -SDT_PROBE_DEFINE1(vnet, functions, vnet_alloc, entry, "int"); -SDT_PROBE_DEFINE2(vnet, functions, vnet_alloc, alloc, "int", "struct vnet *"); -SDT_PROBE_DEFINE2(vnet, functions, vnet_alloc, return, "int", "struct vnet *"); -SDT_PROBE_DEFINE2(vnet, functions, vnet_destroy, entry, "int", "struct vnet *"); -SDT_PROBE_DEFINE1(vnet, functions, vnet_destroy, return, "int"); +SDT_PROBE_DEFINE1(vnet, functions, vnet_alloc, entry, entry, "int"); +SDT_PROBE_DEFINE2(vnet, functions, vnet_alloc, alloc, alloc, "int", + "struct vnet *"); +SDT_PROBE_DEFINE2(vnet, functions, vnet_alloc, return, return, + "int", "struct vnet *"); +SDT_PROBE_DEFINE2(vnet, functions, vnet_destroy, entry, entry, + "int", "struct vnet *"); +SDT_PROBE_DEFINE1(vnet, functions, vnet_destroy, return, entry, + "int"); #ifdef DDB static void db_show_vnet_print_vs(struct vnet_sysinit *, int); Modified: head/sys/opencrypto/deflate.c ============================================================================== --- head/sys/opencrypto/deflate.c Sun Aug 22 11:12:07 2010 (r211615) +++ head/sys/opencrypto/deflate.c Sun Aug 22 11:18:57 2010 (r211616) @@ -50,13 +50,13 @@ __FBSDID("$FreeBSD$"); #include SDT_PROVIDER_DECLARE(opencrypto); -SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, entry, +SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, entry, entry, "int", "u_int32_t"); -SDT_PROBE_DEFINE5(opencrypto, deflate, deflate_global, bad, +SDT_PROBE_DEFINE5(opencrypto, deflate, deflate_global, bad, bad, "int", "int", "int", "int", "int"); -SDT_PROBE_DEFINE5(opencrypto, deflate, deflate_global, iter, +SDT_PROBE_DEFINE5(opencrypto, deflate, deflate_global, iter, iter, "int", "int", "int", "int", "int"); -SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, return, +SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, return, return, "int", "u_int32_t"); int window_inflate = -1 * MAX_WBITS; Modified: head/sys/security/mac/mac_framework.c ============================================================================== --- head/sys/security/mac/mac_framework.c Sun Aug 22 11:12:07 2010 (r211615) +++ head/sys/security/mac/mac_framework.c Sun Aug 22 11:18:57 2010 (r211616) @@ -94,10 +94,12 @@ __FBSDID("$FreeBSD$"); SDT_PROVIDER_DEFINE(mac); SDT_PROVIDER_DEFINE(mac_framework); -SDT_PROBE_DEFINE2(mac, kernel, policy, modevent, "int", +SDT_PROBE_DEFINE2(mac, kernel, policy, modevent, modevent, "int", "struct mac_policy_conf *mpc"); -SDT_PROBE_DEFINE1(mac, kernel, policy, register, "struct mac_policy_conf *"); -SDT_PROBE_DEFINE1(mac, kernel, policy, unregister, "struct mac_policy_conf *"); +SDT_PROBE_DEFINE1(mac, kernel, policy, register, register, + "struct mac_policy_conf *"); +SDT_PROBE_DEFINE1(mac, kernel, policy, unregister, unregister, + "struct mac_policy_conf *"); /* * Root sysctl node for all MAC and MAC policy controls. Modified: head/sys/security/mac/mac_internal.h ============================================================================== --- head/sys/security/mac/mac_internal.h Sun Aug 22 11:12:07 2010 (r211615) +++ head/sys/security/mac/mac_internal.h Sun Aug 22 11:18:57 2010 (r211616) @@ -75,27 +75,27 @@ SDT_PROVIDER_DECLARE(mac_framework); /* #define MAC_CHECK_PROBE_DEFINE4(name, arg0, arg1, arg2, arg3) \ SDT_PROBE_DEFINE5(mac_framework, kernel, name, mac_check_err, \ - "int", arg0, arg1, arg2, arg3); \ + mac-check-ok, "int", arg0, arg1, arg2, arg3); \ SDT_PROBE_DEFINE5(mac_framework, kernel, name, mac_check_ok, \ - "int", arg0, arg1, arg2, arg3); + mac-check-ok, "int", arg0, arg1, arg2, arg3); #define MAC_CHECK_PROBE_DEFINE3(name, arg0, arg1, arg2) \ SDT_PROBE_DEFINE4(mac_framework, kernel, name, mac_check_err, \ - "int", arg0, arg1, arg2); \ + mac-check-err, "int", arg0, arg1, arg2); \ SDT_PROBE_DEFINE4(mac_framework, kernel, name, mac_check_ok, \ - "int", arg0, arg1, arg2); + mac-check-ok, "int", arg0, arg1, arg2); #define MAC_CHECK_PROBE_DEFINE2(name, arg0, arg1) \ SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac_check_err, \ - "int", arg0, arg1); \ + mac-check-err, "int", arg0, arg1); \ SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac_check_ok, \ - "int", arg0, arg1); + mac-check-ok, "int", arg0, arg1); #define MAC_CHECK_PROBE_DEFINE1(name, arg0) \ SDT_PROBE_DEFINE2(mac_framework, kernel, name, mac_check_err, \ - "int", arg0); \ + mac-check-err, "int", arg0); \ SDT_PROBE_DEFINE2(mac_framework, kernel, name, mac_check_ok, \ - "int", arg0); + mac-check-ok, "int", arg0); #define MAC_CHECK_PROBE4(name, error, arg0, arg1, arg2, arg3) do { \ if (error) { \ @@ -117,9 +117,9 @@ SDT_PROVIDER_DECLARE(mac_framework); /* #define MAC_GRANT_PROBE_DEFINE2(name, arg0, arg1) \ SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac_grant_err, \ - "int", arg0, arg1); \ + mac-grant-err, "int", arg0, arg1); \ SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac_grant_ok, \ - "INT", arg0, arg1); + mac-grant-ok, "INT", arg0, arg1); #define MAC_GRANT_PROBE2(name, error, arg0, arg1) do { \ if (error) { \ Modified: head/sys/sys/sdt.h ============================================================================== --- head/sys/sys/sdt.h Sun Aug 22 11:12:07 2010 (r211615) +++ head/sys/sys/sdt.h Sun Aug 22 11:18:57 2010 (r211616) @@ -31,33 +31,66 @@ #ifndef _SYS_SDT_H #define _SYS_SDT_H -/* Stub these for the time being. */ -#define DTRACE_PROBE(name) -#define DTRACE_PROBE1(name, type1, arg1) -#define DTRACE_PROBE2(name, type1, arg1, type2, arg2) -#define DTRACE_PROBE3(name, type1, arg1, type2, arg2, type3, arg3) -#define DTRACE_PROBE4(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4) - #ifndef _KERNEL -/* The promise of things to come. Worlds to explore. People to meet. Things to do. */ +#define _DTRACE_VERSION 1 -#else +#define DTRACE_PROBE(prov, name) { \ + extern void __dtrace_##prov##___##name(void); \ + __dtrace_##prov##___##name(); \ +} + +#define DTRACE_PROBE1(prov, name, arg1) { \ + extern void __dtrace_##prov##___##name(unsigned long); \ + __dtrace_##prov##___##name((unsigned long)arg1); \ +} + +#define DTRACE_PROBE2(prov, name, arg1, arg2) { \ + extern void __dtrace_##prov##___##name(unsigned long, \ + unsigned long); \ + __dtrace_##prov##___##name((unsigned long)arg1, \ + (unsigned long)arg2); \ +} + +#define DTRACE_PROBE3(prov, name, arg1, arg2, arg3) { \ + extern void __dtrace_##prov##___##name(unsigned long, \ + unsigned long, unsigned long); \ + __dtrace_##prov##___##name((unsigned long)arg1, \ + (unsigned long)arg2, (unsigned long)arg3); \ +} + +#define DTRACE_PROBE4(prov, name, arg1, arg2, arg3, arg4) { \ + extern void __dtrace_##prov##___##name(unsigned long, \ + unsigned long, unsigned long, unsigned long); \ + __dtrace_##prov##___##name((unsigned long)arg1, \ + (unsigned long)arg2, (unsigned long)arg3, \ + (unsigned long)arg4); \ +} + +#define DTRACE_PROBE5(prov, name, arg1, arg2, arg3, arg4, arg5) { \ + extern void __dtrace_##prov##___##name(unsigned long, \ + unsigned long, unsigned long, unsigned long, unsigned long);\ + __dtrace_##prov##___##name((unsigned long)arg1, \ + (unsigned long)arg2, (unsigned long)arg3, \ + (unsigned long)arg4, (unsigned long)arg5); \ +} + +#else /* _KERNEL */ #ifndef KDTRACE_HOOKS #define SDT_PROVIDER_DEFINE(prov) #define SDT_PROVIDER_DECLARE(prov) -#define SDT_PROBE_DEFINE(prov, mod, func, name) +#define SDT_PROBE_DEFINE(prov, mod, func, name, sname) #define SDT_PROBE_DECLARE(prov, mod, func, name) #define SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) #define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type) -#define SDT_PROBE_DEFINE1(prov, mod, func, name, arg0) -#define SDT_PROBE_DEFINE2(prov, mod, func, name, arg0, arg1) -#define SDT_PROBE_DEFINE3(prov, mod, func, name, arg0, arg1, arg2) -#define SDT_PROBE_DEFINE4(prov, mod, func, name, arg0, arg1, arg2, arg3) -#define SDT_PROBE_DEFINE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) +#define SDT_PROBE_DEFINE1(prov, mod, func, name, sname, arg0) +#define SDT_PROBE_DEFINE2(prov, mod, func, name, sname, arg0, arg1) +#define SDT_PROBE_DEFINE3(prov, mod, func, name, sname, arg0, arg1, arg2) +#define SDT_PROBE_DEFINE4(prov, mod, func, name, sname, arg0, arg1, arg2, arg3) +#define SDT_PROBE_DEFINE5(prov, mod, func, name, sname, arg0, arg1, arg2, arg3, arg4) #define SDT_PROBE1(prov, mod, func, name, arg0) #define SDT_PROBE2(prov, mod, func, name, arg0, arg1) @@ -135,10 +168,10 @@ struct sdt_provider { #define SDT_PROVIDER_DECLARE(prov) \ extern struct sdt_provider sdt_provider_##prov[1] -#define SDT_PROBE_DEFINE(prov, mod, func, name) \ +#define SDT_PROBE_DEFINE(prov, mod, func, name, sname) \ struct sdt_probe sdt_##prov##_##mod##_##func##_##name[1] = { \ { sizeof(struct sdt_probe), 0, sdt_provider_##prov, \ - { NULL, NULL }, { NULL, NULL }, #mod, #func, #name, 0, 0 } \ + { NULL, NULL }, { NULL, NULL }, #mod, #func, #sname, 0, 0 } \ }; \ SYSINIT(sdt_##prov##_##mod##_##func##_##name##_init, SI_SUB_KDTRACE, \ SI_ORDER_SECOND + 1, sdt_probe_register, \ @@ -168,30 +201,30 @@ struct sdt_provider { SI_SUB_KDTRACE, SI_ORDER_SECOND + 2, sdt_argtype_deregister, \ sdt_##prov##_##mod##_##func##_##name##num ) -#define SDT_PROBE_DEFINE1(prov, mod, func, name, arg0) \ - SDT_PROBE_DEFINE(prov, mod, func, name); \ +#define SDT_PROBE_DEFINE1(prov, mod, func, name, sname, arg0) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0) -#define SDT_PROBE_DEFINE2(prov, mod, func, name, arg0, arg1) \ - SDT_PROBE_DEFINE(prov, mod, func, name); \ +#define SDT_PROBE_DEFINE2(prov, mod, func, name, sname, arg0, arg1) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \ SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1) -#define SDT_PROBE_DEFINE3(prov, mod, func, name, arg0, arg1, arg2) \ - SDT_PROBE_DEFINE(prov, mod, func, name); \ +#define SDT_PROBE_DEFINE3(prov, mod, func, name, sname, arg0, arg1, arg2)\ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \ SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1); \ SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2) -#define SDT_PROBE_DEFINE4(prov, mod, func, name, arg0, arg1, arg2, arg3) \ - SDT_PROBE_DEFINE(prov, mod, func, name); \ +#define SDT_PROBE_DEFINE4(prov, mod, func, name, sname, arg0, arg1, arg2, arg3) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \ SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1); \ SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2); \ SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3) -#define SDT_PROBE_DEFINE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) \ - SDT_PROBE_DEFINE(prov, mod, func, name); \ +#define SDT_PROBE_DEFINE5(prov, mod, func, name, sname, arg0, arg1, arg2, arg3, arg4) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \ SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1); \ SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2); \ Modified: head/sys/tools/vnode_if.awk ============================================================================== --- head/sys/tools/vnode_if.awk Sun Aug 22 11:12:07 2010 (r211615) +++ head/sys/tools/vnode_if.awk Sun Aug 22 11:18:57 2010 (r211616) @@ -355,8 +355,8 @@ while ((getline < srcfile) > 0) { printc("};"); printc("\n"); - printc("SDT_PROBE_DEFINE2(vfs, vop, " name ", entry, \"struct vnode *\", \"struct " name "_args *\");\n"); - printc("SDT_PROBE_DEFINE3(vfs, vop, " name ", return, \"struct vnode *\", \"struct " name "_args *\", \"int\");\n"); + printc("SDT_PROBE_DEFINE2(vfs, vop, " name ", entry, entry, \"struct vnode *\", \"struct " name "_args *\");\n"); + printc("SDT_PROBE_DEFINE3(vfs, vop, " name ", return, return, \"struct vnode *\", \"struct " name "_args *\", \"int\");\n"); # Print out function. printc("\nint\n" uname "_AP(struct " name "_args *a)"); From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 11:30:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E253106564A; Sun, 22 Aug 2010 11:30:49 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DC8E8FC17; Sun, 22 Aug 2010 11:30:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MBUnNq002488; Sun, 22 Aug 2010 11:30:49 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MBUnUu002486; Sun, 22 Aug 2010 11:30:49 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008221130.o7MBUnUu002486@svn.freebsd.org> From: Rui Paulo Date: Sun, 22 Aug 2010 11:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211617 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 11:30:49 -0000 Author: rpaulo Date: Sun Aug 22 11:30:49 2010 New Revision: 211617 URL: http://svn.freebsd.org/changeset/base/211617 Log: Call the systrace_probe_func() when the error value. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/subr_trap.c Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Sun Aug 22 11:18:57 2010 (r211616) +++ head/sys/kern/subr_trap.c Sun Aug 22 11:30:49 2010 (r211617) @@ -312,7 +312,7 @@ syscallenter(struct thread *td, struct s */ if (systrace_probe_func != NULL && sa->callp->sy_entry != 0) (*systrace_probe_func)(sa->callp->sy_entry, sa->code, - sa->callp, sa->args); + sa->callp, sa->args, 0); #endif AUDIT_SYSCALL_ENTER(sa->code, td); @@ -330,7 +330,7 @@ syscallenter(struct thread *td, struct s */ if (systrace_probe_func != NULL && sa->callp->sy_return != 0) (*systrace_probe_func)(sa->callp->sy_return, sa->code, - sa->callp, sa->args); + sa->callp, NULL, (error) ? -1 : td->td_retval[0]); #endif syscall_thread_exit(td, sa->callp); CTR4(KTR_SYSC, "syscall: p=%p error=%d return %#lx %#lx", From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 11:31:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B6791065674; Sun, 22 Aug 2010 11:31:50 +0000 (UTC) (envelope-from rpaulo@freebsd.org) Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33]) by mx1.freebsd.org (Postfix) with ESMTP id 3E0A58FC0A; Sun, 22 Aug 2010 11:31:50 +0000 (UTC) Received: from d.earth.lavabit.com (d.earth.lavabit.com [192.168.111.13]) by karen.lavabit.com (Postfix) with ESMTP id 54D6811B897; Sun, 22 Aug 2010 06:31:49 -0500 (CDT) Received: from 10.0.10.3 (54.81.54.77.rev.vodafone.pt [77.54.81.54]) by lavabit.com with ESMTP id IYNU5RRE2WOR; Sun, 22 Aug 2010 06:31:49 -0500 Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Rui Paulo In-Reply-To: <201008221130.o7MBUnUu002486@svn.freebsd.org> Date: Sun, 22 Aug 2010 12:31:46 +0100 Content-Transfer-Encoding: 7bit Message-Id: References: <201008221130.o7MBUnUu002486@svn.freebsd.org> To: Rui Paulo X-Mailer: Apple Mail (2.1081) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211617 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 11:31:50 -0000 On 22 Aug 2010, at 12:30, Rui Paulo wrote: > Author: rpaulo > Date: Sun Aug 22 11:30:49 2010 > New Revision: 211617 > URL: http://svn.freebsd.org/changeset/base/211617 > > Log: > Call the systrace_probe_func() when the error value. s/when/with/ Regards, -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 11:41:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D5BE1065695; Sun, 22 Aug 2010 11:41:07 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2218E8FC12; Sun, 22 Aug 2010 11:41:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MBf7HS002773; Sun, 22 Aug 2010 11:41:07 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MBf7ss002771; Sun, 22 Aug 2010 11:41:07 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008221141.o7MBf7ss002771@svn.freebsd.org> From: Rui Paulo Date: Sun, 22 Aug 2010 11:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211618 - head/sys/cddl/contrib/opensolaris/uts/common/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 11:41:07 -0000 Author: rpaulo Date: Sun Aug 22 11:41:06 2010 New Revision: 211618 URL: http://svn.freebsd.org/changeset/base/211618 Log: Port this to FreeBSD. We miss some suword functions, so we use copyout. Sponsored by: The FreeBSD Foundation > Description of fields to fill in above: 76 columns --| > PR: If a GNATS PR is affected by the change. > Submitted by: If someone else sent in the change. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > Security: Vulnerability reference (one per line) or description. > Empty fields above will be automatically removed. M sys/fasttrap_impl.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h Sun Aug 22 11:30:49 2010 (r211617) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h Sun Aug 22 11:41:06 2010 (r211618) @@ -158,10 +158,16 @@ typedef struct fasttrap_hash { */ #define fasttrap_copyout copyout #define fasttrap_fuword32 fuword32 -#define fasttrap_suword32 suword32 +#define fasttrap_suword32(_k, _u) copyout((_k), (_u), sizeof(uint32_t)) +#define fasttrap_suword64(_k, _u) copyout((_k), (_u), sizeof(uint64_t)) -#define fasttrap_fulword fulword -#define fasttrap_sulword sulword +#ifdef __amd64__ +#define fasttrap_fulword fuword64 +#define fasttrap_sulword fasttrap_suword64 +#else +#define fasttrap_fulword fuword32 +#define fasttrap_sulword fasttrap_suword32 +#endif extern void fasttrap_sigtrap(proc_t *, kthread_t *, uintptr_t); @@ -179,8 +185,9 @@ extern int fasttrap_tracepoint_init(proc extern int fasttrap_tracepoint_install(proc_t *, fasttrap_tracepoint_t *); extern int fasttrap_tracepoint_remove(proc_t *, fasttrap_tracepoint_t *); -extern int fasttrap_pid_probe(struct regs *); -extern int fasttrap_return_probe(struct regs *); +struct reg; +extern int fasttrap_pid_probe(struct reg *); +extern int fasttrap_return_probe(struct reg *); extern uint64_t fasttrap_pid_getarg(void *, dtrace_id_t, void *, int, int); extern uint64_t fasttrap_usdt_getarg(void *, dtrace_id_t, void *, int, int); From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 11:48:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53FF31065670; Sun, 22 Aug 2010 11:48:33 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 297948FC14; Sun, 22 Aug 2010 11:48:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MBmXVO002972; Sun, 22 Aug 2010 11:48:33 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MBmXjA002970; Sun, 22 Aug 2010 11:48:33 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201008221148.o7MBmXjA002970@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sun, 22 Aug 2010 11:48:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211619 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 11:48:33 -0000 Author: des Date: Sun Aug 22 11:48:32 2010 New Revision: 211619 URL: http://svn.freebsd.org/changeset/base/211619 Log: UTFize my name. Modified: head/lib/libutil/kld.c Modified: head/lib/libutil/kld.c ============================================================================== --- head/lib/libutil/kld.c Sun Aug 22 11:41:06 2010 (r211618) +++ head/lib/libutil/kld.c Sun Aug 22 11:48:32 2010 (r211619) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2006 Dag-Erling Coďdan Smřrgrav + * Copyright (c) 2006 Dag-Erling CoĂŻdan Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 12:03:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D8CA10656B9; Sun, 22 Aug 2010 12:03:31 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B5EF8FC0C; Sun, 22 Aug 2010 12:03:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MC3Vpr003349; Sun, 22 Aug 2010 12:03:31 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MC3VIl003345; Sun, 22 Aug 2010 12:03:31 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201008221203.o7MC3VIl003345@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 22 Aug 2010 12:03:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211620 - stable/8/share/syscons/keymaps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 12:03:31 -0000 Author: gavin Date: Sun Aug 22 12:03:31 2010 New Revision: 211620 URL: http://svn.freebsd.org/changeset/base/211620 Log: Merge r211026 from head: Add a keymap for the Swiss-German Macbook keyboard. PR: conf/139997 Submitted by: Andreas Tobler Added: stable/8/share/syscons/keymaps/swissgerman.macbook.acc.kbd - copied unchanged from r211026, head/share/syscons/keymaps/swissgerman.macbook.acc.kbd Modified: stable/8/share/syscons/keymaps/INDEX.keymaps stable/8/share/syscons/keymaps/Makefile Modified: stable/8/share/syscons/keymaps/INDEX.keymaps ============================================================================== --- stable/8/share/syscons/keymaps/INDEX.keymaps Sun Aug 22 11:48:32 2010 (r211619) +++ stable/8/share/syscons/keymaps/INDEX.keymaps Sun Aug 22 12:03:31 2010 (r211620) @@ -440,6 +440,12 @@ swissgerman.cp850.kbd:fr:Suisse-Allemand swissgerman.cp850.kbd:pt:Suiço-Alemăo Codepage 850 swissgerman.cp850.kbd:es:Germanosuizo Codepage 850 +swissgerman.macbook.acc.kbd:en:Swiss-German Macbook/Macbook Pro (accent keys) +swissgerman.macbook.acc.kbd:de:Schweiz-Deutsch Macbook/Macbook Pro (mit Akzenten) +swissgerman.macbook.acc.kbd:fr:Suisse-Allemand Macbook/Macbook Pro (avec accents) +swissgerman.macbook.acc.kbd:pt:Suiço-Alemăo Macbook/Macbook Pro (com acentos) +swissgerman.macbook.acc.kbd:es:Germanosuizo Macbook/Macbook Pro (con acentos) + tr.iso9.q.kbd:en:Turkish ISO-8859-9 tr.iso9.q.kbd:fr:Turc ISO-8859-9 tr.iso9.q.kbd:uk:ôŐŇĹĂŘËÁ ISO-8859-9 Modified: stable/8/share/syscons/keymaps/Makefile ============================================================================== --- stable/8/share/syscons/keymaps/Makefile Sun Aug 22 11:48:32 2010 (r211619) +++ stable/8/share/syscons/keymaps/Makefile Sun Aug 22 12:03:31 2010 (r211620) @@ -40,6 +40,7 @@ FILES= INDEX.keymaps \ swedish.iso.kbd swedish.cp850.kbd \ swissfrench.iso.kbd swissfrench.iso.acc.kbd swissfrench.cp850.kbd \ swissgerman.iso.kbd swissgerman.iso.acc.kbd swissgerman.cp850.kbd \ + swissgerman.macbook.acc.kbd \ tr.iso9.q.kbd \ ua.koi8-u.kbd ua.koi8-u.shift.alt.kbd ua.iso5.kbd \ uk.iso.kbd uk.iso-ctrl.kbd uk.cp850.kbd uk.cp850-ctrl.kbd \ Copied: stable/8/share/syscons/keymaps/swissgerman.macbook.acc.kbd (from r211026, head/share/syscons/keymaps/swissgerman.macbook.acc.kbd) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/syscons/keymaps/swissgerman.macbook.acc.kbd Sun Aug 22 12:03:31 2010 (r211620, copy of r211026, head/share/syscons/keymaps/swissgerman.macbook.acc.kbd) @@ -0,0 +1,134 @@ +# $FreeBSD$ +# +# swissgerman Macbook/Macbook PRO ISO 8859-1 keymap, with accent keys +# derived from swissgerman.iso.acc.kbd +# 06.08.2010 by Andreas Tobler +# alt +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug esc O + 002 '1' '+' nop nop '1' '1' nop nop O + 003 '2' '"' nul nul '2' '2' nul nul O + 004 '3' '*' nop nop '#' '#' nop nop O + 005 '4' 231 nop nop '4' 231 nop nop O + 006 '5' '%' nop nop '[' '[' nop nop O + 007 '6' '&' nop nop ']' ']' nop nop O + 008 '7' '/' nop nop '|' '\' nop nop O + 009 '8' '(' esc esc '{' '{' nop nop O + 010 '9' ')' gs gs '}' '}' nop nop O + 011 '0' '=' nop nop '0' '=' nop nop O + 012 ''' '?' fs fs dacu dacu fs fs O + 013 dcir dgra nop nop dtil dtil nop nop O + 014 bs bs del del bs bs del del O + 015 ht btab nop nop ht btab nop nop O + 016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C + 017 'w' 'W' etb etb 'w' 'W' etb etb C + 018 'e' 'E' enq enq 164 'E' enq enq C + 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C + 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C + 021 'z' 'Z' sub sub 'z' 'Z' sub sub C + 022 'u' 'U' nak nak 'u' 'U' nak nak C + 023 'i' 'I' ht ht 'i' 'I' ht ht C + 024 'o' 'O' si si 'o' 'O' si si C + 025 'p' 'P' dle dle 'p' 'P' dle dle C + 026 dgra duml esc esc '[' 220 esc esc C + 027 duml '!' gs gs ']' ']' gs gs O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'a' 'A' soh soh 'a' 'A' soh soh C + 031 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C + 032 'd' 'D' eot eot 'd' 'D' eot eot C + 033 'f' 'F' ack ack 'f' 'F' ack ack C + 034 'g' 'G' bel bel '@' '@' bel bel C + 035 'h' 'H' bs bs 'h' 'H' bs bs C + 036 'j' 'J' nl nl 'j' 'J' nl nl C + 037 'k' 'K' vt vt 'k' 'K' vt vt C + 038 'l' 'L' ff ff 'l' 'L' ff ff C + 039 233 233 nop nop 246 214 nop nop C + 040 224 224 nop nop '{' 196 nop nop C + 041 '<' '>' nop nop nop nop nop nop O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 '$' 163 rs rs '}' '}' rs rs O + 044 'y' 'Y' em em 'y' 'Y' em em C + 045 'x' 'X' can can 'x' 'X' can can C + 046 'c' 'C' etx etx 'c' 'C' etx etx C + 047 'v' 'V' syn syn 'v' 'V' syn syn C + 048 'b' 'B' stx stx 'b' 'B' stx stx C + 049 'n' 'N' so so '~' '~' so so C + 050 'm' 'M' cr cr 181 181 cr cr C + 051 ',' ';' nop nop ',' ';' nop nop O + 052 '.' ':' nop nop '.' ':' nop nop O + 053 '-' '_' us us '-' '_' us us O + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O + 058 clock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del '.' '.' '.' '.' '.' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 086 '<' '>' nop nop '\' '\' nop nop O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr nl nl cr cr nl nl O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' N + 092 nscr pscr debug debug nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O + 104 slock saver slock saver susp nop susp nop O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O + + dacu 180 ( 'a' 225 ) ( 'A' 193 ) ( 'e' 233 ) ( 'E' 201 ) + ( 'i' 237 ) ( 'I' 205 ) ( 'o' 243 ) ( 'O' 211 ) + ( 'u' 250 ) ( 'U' 218 ) ( 'c' 231 ) ( 'C' 199 ) + ( 'y' 253 ) ( 'Y' 221 ) + dgra '`' ( 'a' 224 ) ( 'A' 192 ) ( 'e' 232 ) ( 'E' 200 ) + ( 'i' 236 ) ( 'I' 204 ) ( 'o' 242 ) ( 'O' 210 ) + ( 'u' 249 ) ( 'U' 217 ) + dcir '^' ( 'a' 226 ) ( 'A' 194 ) ( 'e' 234 ) ( 'E' 202 ) + ( 'i' 238 ) ( 'I' 206 ) ( 'o' 244 ) ( 'O' 212 ) + ( 'u' 251 ) ( 'U' 219 ) + dtil '~' ( 'a' 227 ) ( 'A' 195 ) ( 'o' 245 ) ( 'O' 213 ) + ( 'n' 241 ) ( 'N' 209 ) + duml 168 ( 'a' 228 ) ( 'A' 196 ) ( 'e' 235 ) ( 'E' 203 ) + ( 'i' 239 ) ( 'I' 207 ) ( 'o' 246 ) ( 'O' 214 ) + ( 'u' 252 ) ( 'U' 220 ) ( 'y' 255 ) From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 13:04:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93CE01065674; Sun, 22 Aug 2010 13:04:00 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68E608FC16; Sun, 22 Aug 2010 13:04:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MD403g004590; Sun, 22 Aug 2010 13:04:00 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MD40lP004588; Sun, 22 Aug 2010 13:04:00 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201008221304.o7MD40lP004588@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 22 Aug 2010 13:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211621 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 13:04:00 -0000 Author: jilles Date: Sun Aug 22 13:04:00 2010 New Revision: 211621 URL: http://svn.freebsd.org/changeset/base/211621 Log: sh(1): Add a brief summary of arithmetic expressions. Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sun Aug 22 12:03:31 2010 (r211620) +++ head/bin/sh/sh.1 Sun Aug 22 13:04:00 2010 (r211621) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd June 29, 2010 +.Dd August 22, 2010 .Dt SH 1 .Os .Sh NAME @@ -1230,7 +1230,7 @@ Quote Removal. The .Ql $ character is used to introduce parameter expansion, command -substitution, or arithmetic evaluation. +substitution, or arithmetic expansion. .Ss Tilde Expansion (substituting a user's home directory) A word beginning with an unquoted tilde character .Pq Ql ~ @@ -1463,10 +1463,41 @@ The shell expands all tokens in the .Ar expression for parameter expansion, -command substitution, and quote removal. +command substitution, +arithmetic expansion +and quote removal. +.Pp +The allowed expressions are a subset of C expressions, +summarized below. +.Bl -tag -width "Variables" -offset indent +.It Values +All values are of type +.Ft intmax_t . +.It Constants +Decimal, octal (starting with +.Li 0 ) +and hexadecimal (starting with +.Li 0x ) +integer constants. +.It Variables +Shell variables can be read and written +and contain integer constants. +.It Unary operators +.Li "! ~ + -" +.It Binary operators +.Li "* / % + - << >> < <= > >= == != & ^ | && ||" +.It Assignment operators +.Li "= += -= *= /= %= <<= >>= &= ^= |=" +.It Short-circuit evaluation +The +.Li && +and +.Li || +operators always evaluate both sides. +This is a bug. +.El .Pp -Next, the shell treats this as an arithmetic expression and -substitutes the value of the expression. +The result of the expression is substituted in decimal. .Ss White Space Splitting (Field Splitting) After parameter expansion, command substitution, and arithmetic expansion the shell scans the results of From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 13:09:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9938C1065670; Sun, 22 Aug 2010 13:09:12 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8890E8FC08; Sun, 22 Aug 2010 13:09:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MD9CYB004721; Sun, 22 Aug 2010 13:09:12 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MD9Cif004720; Sun, 22 Aug 2010 13:09:12 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201008221309.o7MD9Cif004720@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 22 Aug 2010 13:09:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211622 - head/tools/regression/bin/sh/expansion X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 13:09:12 -0000 Author: jilles Date: Sun Aug 22 13:09:12 2010 New Revision: 211622 URL: http://svn.freebsd.org/changeset/base/211622 Log: sh: Test that all bytes from 128 to 255 can be used in IFS. To avoid multibyte issues, this test forces ISO8859-1 charset. This also passes on stable/8. Added: head/tools/regression/bin/sh/expansion/ifs3.0 (contents, props changed) Added: head/tools/regression/bin/sh/expansion/ifs3.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/ifs3.0 Sun Aug 22 13:09:12 2010 (r211622) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +failures=0 +unset LC_ALL +export LC_CTYPE=en_US.ISO8859-1 +i=128 +set -f +while [ "$i" -le 255 ]; do + i2=$((i^2)) + c=$(printf \\"$(printf %o "$i")") + c2=$(printf \\"$(printf %o "$i2")") + IFS=$c + set -- $c2$c$c2$c$c2 + if [ "$#" -ne 3 ] || [ "$1" != "$c2" ] || [ "$2" != "$c2" ] || + [ "$3" != "$c2" ]; then + echo "Bad results for separator $i (word $i2)" >&2 + : $((failures += 1)) + fi + i=$((i+1)) +done +exit $((failures > 0)) From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 13:27:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 101A2106566C; Sun, 22 Aug 2010 13:27:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2C058FC1C; Sun, 22 Aug 2010 13:27:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MDRXTu005110; Sun, 22 Aug 2010 13:27:33 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MDRXtp005108; Sun, 22 Aug 2010 13:27:33 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201008221327.o7MDRXtp005108@svn.freebsd.org> From: Andriy Gapon Date: Sun, 22 Aug 2010 13:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211623 - stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 13:27:34 -0000 Author: avg Date: Sun Aug 22 13:27:33 2010 New Revision: 211623 URL: http://svn.freebsd.org/changeset/base/211623 Log: Fix a mismerge in r211581, MFC of r210427 This is a direct commit. Reported by: many Pointyhat to: avg Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Aug 22 13:09:12 2010 (r211622) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Aug 22 13:27:33 2010 (r211623) @@ -3296,7 +3296,6 @@ arc_memory_throttle(uint64_t reserve, ui { #ifdef _KERNEL uint64_t inflight_data = arc_anon->arcs_size; - uint64_t available_memory = ptoa((uintmax_t)cnt.v_free_count); uint64_t available_memory = ptoa((uintmax_t)cnt.v_free_count + cnt.v_cache_count); static uint64_t page_load = 0; From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 14:55:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DE02106564A; Sun, 22 Aug 2010 14:55:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CFCF8FC12; Sun, 22 Aug 2010 14:55:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MEt03L006844; Sun, 22 Aug 2010 14:55:00 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MEt0Ic006842; Sun, 22 Aug 2010 14:55:00 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008221455.o7MEt0Ic006842@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 22 Aug 2010 14:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211624 - stable/8/sys/modules/sem X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 14:55:00 -0000 Author: kib Date: Sun Aug 22 14:54:59 2010 New Revision: 211624 URL: http://svn.freebsd.org/changeset/base/211624 Log: MFC r211339: Add missed dependency. Modified: stable/8/sys/modules/sem/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/modules/sem/Makefile ============================================================================== --- stable/8/sys/modules/sem/Makefile Sun Aug 22 13:27:33 2010 (r211623) +++ stable/8/sys/modules/sem/Makefile Sun Aug 22 14:54:59 2010 (r211624) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../kern KMOD= sem -SRCS= uipc_sem.c opt_posix.h vnode_if.h +SRCS= uipc_sem.c opt_compat.h opt_posix.h vnode_if.h .include From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 16:08:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F23110656B2; Sun, 22 Aug 2010 16:08:12 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EEBE8FC12; Sun, 22 Aug 2010 16:08:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MG8Cpd008411; Sun, 22 Aug 2010 16:08:12 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MG8C2d008409; Sun, 22 Aug 2010 16:08:12 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201008221608.o7MG8C2d008409@svn.freebsd.org> From: Jaakko Heinonen Date: Sun, 22 Aug 2010 16:08:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211628 - head/sys/fs/devfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 16:08:12 -0000 Author: jh Date: Sun Aug 22 16:08:12 2010 New Revision: 211628 URL: http://svn.freebsd.org/changeset/base/211628 Log: Introduce and use devfs_populate_vp() to unlock a vnode before calling devfs_populate(). This is a prerequisite for the automatic removal of empty directories which will be committed in the future. Reviewed by: kib (previous version) Modified: head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Sun Aug 22 16:06:07 2010 (r211627) +++ head/sys/fs/devfs/devfs_vnops.c Sun Aug 22 16:08:12 2010 (r211628) @@ -185,6 +185,43 @@ devfs_clear_cdevpriv(void) devfs_fpdrop(fp); } +/* + * On success devfs_populate_vp() returns with dmp->dm_lock held. + */ +static int +devfs_populate_vp(struct vnode *vp) +{ + struct devfs_mount *dmp; + int locked; + + ASSERT_VOP_LOCKED(vp, "devfs_populate_vp"); + + dmp = VFSTODEVFS(vp->v_mount); + locked = VOP_ISLOCKED(vp); + + sx_xlock(&dmp->dm_lock); + DEVFS_DMP_HOLD(dmp); + + /* Can't call devfs_populate() with the vnode lock held. */ + VOP_UNLOCK(vp, 0); + devfs_populate(dmp); + + sx_xunlock(&dmp->dm_lock); + vn_lock(vp, locked | LK_RETRY); + sx_xlock(&dmp->dm_lock); + if (DEVFS_DMP_DROP(dmp)) { + sx_xunlock(&dmp->dm_lock); + devfs_unmount_final(dmp); + return (EBADF); + } + if (vp->v_iflag & VI_DOOMED) { + sx_xunlock(&dmp->dm_lock); + return (EBADF); + } + + return (0); +} + static int devfs_vptocnp(struct vop_vptocnp_args *ap) { @@ -813,14 +850,6 @@ devfs_lookupx(struct vop_lookup_args *ap return (error); } - DEVFS_DMP_HOLD(dmp); - devfs_populate(dmp); - if (DEVFS_DMP_DROP(dmp)) { - *dm_unlock = 0; - sx_xunlock(&dmp->dm_lock); - devfs_unmount_final(dmp); - return (ENOENT); - } dd = dvp->v_data; de = devfs_find(dd, cnp->cn_nameptr, cnp->cn_namelen, 0); while (de == NULL) { /* While(...) so we can use break */ @@ -843,7 +872,20 @@ devfs_lookupx(struct vop_lookup_args *ap EVENTHANDLER_INVOKE(dev_clone, td->td_ucred, pname, strlen(pname), &cdev); sx_sunlock(&clone_drain_lock); - sx_xlock(&dmp->dm_lock); + + if (cdev == NULL) + sx_xlock(&dmp->dm_lock); + else if (devfs_populate_vp(dvp) != 0) { + *dm_unlock = 0; + sx_xlock(&dmp->dm_lock); + if (DEVFS_DMP_DROP(dmp)) { + sx_xunlock(&dmp->dm_lock); + devfs_unmount_final(dmp); + } else + sx_xunlock(&dmp->dm_lock); + dev_rel(cdev); + return (ENOENT); + } if (DEVFS_DMP_DROP(dmp)) { *dm_unlock = 0; sx_xunlock(&dmp->dm_lock); @@ -852,19 +894,10 @@ devfs_lookupx(struct vop_lookup_args *ap dev_rel(cdev); return (ENOENT); } + if (cdev == NULL) break; - DEVFS_DMP_HOLD(dmp); - devfs_populate(dmp); - if (DEVFS_DMP_DROP(dmp)) { - *dm_unlock = 0; - sx_xunlock(&dmp->dm_lock); - devfs_unmount_final(dmp); - dev_rel(cdev); - return (ENOENT); - } - dev_lock(); dde = &cdev2priv(cdev)->cdp_dirents[dmp->dm_idx]; if (dde != NULL && *dde != NULL) @@ -909,9 +942,11 @@ devfs_lookup(struct vop_lookup_args *ap) struct devfs_mount *dmp; int dm_unlock; + if (devfs_populate_vp(ap->a_dvp) != 0) + return (ENOTDIR); + dmp = VFSTODEVFS(ap->a_dvp->v_mount); dm_unlock = 1; - sx_xlock(&dmp->dm_lock); j = devfs_lookupx(ap, &dm_unlock); if (dm_unlock == 1) sx_xunlock(&dmp->dm_lock); @@ -1139,12 +1174,7 @@ devfs_readdir(struct vop_readdir_args *a } dmp = VFSTODEVFS(ap->a_vp->v_mount); - sx_xlock(&dmp->dm_lock); - DEVFS_DMP_HOLD(dmp); - devfs_populate(dmp); - if (DEVFS_DMP_DROP(dmp)) { - sx_xunlock(&dmp->dm_lock); - devfs_unmount_final(dmp); + if (devfs_populate_vp(ap->a_vp) != 0) { if (tmp_ncookies != NULL) ap->a_ncookies = tmp_ncookies; return (EIO); From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 16:33:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63E501065695; Sun, 22 Aug 2010 16:33:00 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 525B68FC1D; Sun, 22 Aug 2010 16:33:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MGX0ia009110; Sun, 22 Aug 2010 16:33:00 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MGX0H7009106; Sun, 22 Aug 2010 16:33:00 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201008221633.o7MGX0H7009106@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 22 Aug 2010 16:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211632 - stable/7/share/syscons/keymaps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 16:33:00 -0000 Author: gavin Date: Sun Aug 22 16:32:59 2010 New Revision: 211632 URL: http://svn.freebsd.org/changeset/base/211632 Log: Merge r211026 from head: Add a keymap for the Swiss-German Macbook keyboard. PR: conf/139997 Submitted by: Andreas Tobler Added: stable/7/share/syscons/keymaps/swissgerman.macbook.acc.kbd - copied unchanged from r211026, head/share/syscons/keymaps/swissgerman.macbook.acc.kbd Modified: stable/7/share/syscons/keymaps/INDEX.keymaps stable/7/share/syscons/keymaps/Makefile Directory Properties: stable/7/share/syscons/keymaps/ (props changed) Modified: stable/7/share/syscons/keymaps/INDEX.keymaps ============================================================================== --- stable/7/share/syscons/keymaps/INDEX.keymaps Sun Aug 22 16:22:44 2010 (r211631) +++ stable/7/share/syscons/keymaps/INDEX.keymaps Sun Aug 22 16:32:59 2010 (r211632) @@ -437,6 +437,12 @@ swissgerman.cp850.kbd:fr:Suisse-Allemand swissgerman.cp850.kbd:pt:Suiço-Alemăo Codepage 850 swissgerman.cp850.kbd:es:Germanosuizo Codepage 850 +swissgerman.macbook.acc.kbd:en:Swiss-German Macbook/Macbook Pro (accent keys) +swissgerman.macbook.acc.kbd:de:Schweiz-Deutsch Macbook/Macbook Pro (mit Akzenten) +swissgerman.macbook.acc.kbd:fr:Suisse-Allemand Macbook/Macbook Pro (avec accents) +swissgerman.macbook.acc.kbd:pt:Suiço-Alemăo Macbook/Macbook Pro (com acentos) +swissgerman.macbook.acc.kbd:es:Germanosuizo Macbook/Macbook Pro (con acentos) + tr.iso9.q.kbd:en:Turkish ISO-8859-9 tr.iso9.q.kbd:fr:Turc ISO-8859-9 tr.iso9.q.kbd:uk:ôŐŇĹĂŘËÁ ISO-8859-9 Modified: stable/7/share/syscons/keymaps/Makefile ============================================================================== --- stable/7/share/syscons/keymaps/Makefile Sun Aug 22 16:22:44 2010 (r211631) +++ stable/7/share/syscons/keymaps/Makefile Sun Aug 22 16:32:59 2010 (r211632) @@ -40,6 +40,7 @@ FILES= INDEX.keymaps \ swedish.iso.kbd swedish.cp850.kbd \ swissfrench.iso.kbd swissfrench.iso.acc.kbd swissfrench.cp850.kbd \ swissgerman.iso.kbd swissgerman.iso.acc.kbd swissgerman.cp850.kbd \ + swissgerman.macbook.acc.kbd \ tr.iso9.q.kbd \ ua.koi8-u.kbd ua.koi8-u.shift.alt.kbd ua.iso5.kbd \ uk.iso.kbd uk.iso-ctrl.kbd uk.cp850.kbd uk.cp850-ctrl.kbd \ Copied: stable/7/share/syscons/keymaps/swissgerman.macbook.acc.kbd (from r211026, head/share/syscons/keymaps/swissgerman.macbook.acc.kbd) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/share/syscons/keymaps/swissgerman.macbook.acc.kbd Sun Aug 22 16:32:59 2010 (r211632, copy of r211026, head/share/syscons/keymaps/swissgerman.macbook.acc.kbd) @@ -0,0 +1,134 @@ +# $FreeBSD$ +# +# swissgerman Macbook/Macbook PRO ISO 8859-1 keymap, with accent keys +# derived from swissgerman.iso.acc.kbd +# 06.08.2010 by Andreas Tobler +# alt +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug esc O + 002 '1' '+' nop nop '1' '1' nop nop O + 003 '2' '"' nul nul '2' '2' nul nul O + 004 '3' '*' nop nop '#' '#' nop nop O + 005 '4' 231 nop nop '4' 231 nop nop O + 006 '5' '%' nop nop '[' '[' nop nop O + 007 '6' '&' nop nop ']' ']' nop nop O + 008 '7' '/' nop nop '|' '\' nop nop O + 009 '8' '(' esc esc '{' '{' nop nop O + 010 '9' ')' gs gs '}' '}' nop nop O + 011 '0' '=' nop nop '0' '=' nop nop O + 012 ''' '?' fs fs dacu dacu fs fs O + 013 dcir dgra nop nop dtil dtil nop nop O + 014 bs bs del del bs bs del del O + 015 ht btab nop nop ht btab nop nop O + 016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C + 017 'w' 'W' etb etb 'w' 'W' etb etb C + 018 'e' 'E' enq enq 164 'E' enq enq C + 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C + 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C + 021 'z' 'Z' sub sub 'z' 'Z' sub sub C + 022 'u' 'U' nak nak 'u' 'U' nak nak C + 023 'i' 'I' ht ht 'i' 'I' ht ht C + 024 'o' 'O' si si 'o' 'O' si si C + 025 'p' 'P' dle dle 'p' 'P' dle dle C + 026 dgra duml esc esc '[' 220 esc esc C + 027 duml '!' gs gs ']' ']' gs gs O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'a' 'A' soh soh 'a' 'A' soh soh C + 031 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C + 032 'd' 'D' eot eot 'd' 'D' eot eot C + 033 'f' 'F' ack ack 'f' 'F' ack ack C + 034 'g' 'G' bel bel '@' '@' bel bel C + 035 'h' 'H' bs bs 'h' 'H' bs bs C + 036 'j' 'J' nl nl 'j' 'J' nl nl C + 037 'k' 'K' vt vt 'k' 'K' vt vt C + 038 'l' 'L' ff ff 'l' 'L' ff ff C + 039 233 233 nop nop 246 214 nop nop C + 040 224 224 nop nop '{' 196 nop nop C + 041 '<' '>' nop nop nop nop nop nop O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 '$' 163 rs rs '}' '}' rs rs O + 044 'y' 'Y' em em 'y' 'Y' em em C + 045 'x' 'X' can can 'x' 'X' can can C + 046 'c' 'C' etx etx 'c' 'C' etx etx C + 047 'v' 'V' syn syn 'v' 'V' syn syn C + 048 'b' 'B' stx stx 'b' 'B' stx stx C + 049 'n' 'N' so so '~' '~' so so C + 050 'm' 'M' cr cr 181 181 cr cr C + 051 ',' ';' nop nop ',' ';' nop nop O + 052 '.' ':' nop nop '.' ':' nop nop O + 053 '-' '_' us us '-' '_' us us O + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O + 058 clock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del '.' '.' '.' '.' '.' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 086 '<' '>' nop nop '\' '\' nop nop O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr nl nl cr cr nl nl O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' N + 092 nscr pscr debug debug nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O + 104 slock saver slock saver susp nop susp nop O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O + + dacu 180 ( 'a' 225 ) ( 'A' 193 ) ( 'e' 233 ) ( 'E' 201 ) + ( 'i' 237 ) ( 'I' 205 ) ( 'o' 243 ) ( 'O' 211 ) + ( 'u' 250 ) ( 'U' 218 ) ( 'c' 231 ) ( 'C' 199 ) + ( 'y' 253 ) ( 'Y' 221 ) + dgra '`' ( 'a' 224 ) ( 'A' 192 ) ( 'e' 232 ) ( 'E' 200 ) + ( 'i' 236 ) ( 'I' 204 ) ( 'o' 242 ) ( 'O' 210 ) + ( 'u' 249 ) ( 'U' 217 ) + dcir '^' ( 'a' 226 ) ( 'A' 194 ) ( 'e' 234 ) ( 'E' 202 ) + ( 'i' 238 ) ( 'I' 206 ) ( 'o' 244 ) ( 'O' 212 ) + ( 'u' 251 ) ( 'U' 219 ) + dtil '~' ( 'a' 227 ) ( 'A' 195 ) ( 'o' 245 ) ( 'O' 213 ) + ( 'n' 241 ) ( 'N' 209 ) + duml 168 ( 'a' 228 ) ( 'A' 196 ) ( 'e' 235 ) ( 'E' 203 ) + ( 'i' 239 ) ( 'I' 207 ) ( 'o' 246 ) ( 'O' 214 ) + ( 'u' 252 ) ( 'U' 220 ) ( 'y' 255 ) From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 16:42:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E65441065696; Sun, 22 Aug 2010 16:42:46 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D65288FC0C; Sun, 22 Aug 2010 16:42:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MGgkEi009331; Sun, 22 Aug 2010 16:42:46 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MGgkgv009329; Sun, 22 Aug 2010 16:42:46 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201008221642.o7MGgkgv009329@svn.freebsd.org> From: Ed Schouten Date: Sun, 22 Aug 2010 16:42:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211633 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 16:42:47 -0000 Author: ed Date: Sun Aug 22 16:42:46 2010 New Revision: 211633 URL: http://svn.freebsd.org/changeset/base/211633 Log: Add missing mlink for insmntque1(). MFC after: 1 week Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sun Aug 22 16:32:59 2010 (r211632) +++ head/share/man/man9/Makefile Sun Aug 22 16:42:46 2010 (r211633) @@ -700,6 +700,7 @@ MLINKS+=ieee80211_vap.9 ieee80211_vap_at MLINKS+=ifnet.9 ifaddr.9 \ ifnet.9 if_data.9 \ ifnet.9 ifqueue.9 +MLINKS+=insmntque.9 insmntque1.9 MLINKS+=ithread.9 ithread_add_handler.9 \ ithread.9 ithread_create.9 \ ithread.9 ithread_destroy.9 \ From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 16:55:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEDDA10656C3; Sun, 22 Aug 2010 16:55:21 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2F29E8FC1C; Sun, 22 Aug 2010 16:55:20 +0000 (UTC) Received: by vws7 with SMTP id 7so5352026vws.13 for ; Sun, 22 Aug 2010 09:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:message-id:user-agent:mime-version:content-type; bh=qlwu5hvrbHYYCGfsWUQlE6vzegiBkPq0ZJsLMs0c048=; b=LdFRXTWsZdb0abZtdyw1OII700nEFWVz3qF+K757OUNo4gP0Itw66+q8B2q2r7POAQ CGIPRC9e0KdlKsXGyIEYN8hwmuvJiINaFr8igEbgDDAYOm0/Bg+pTnW2nhyLEzsdouaM b4+MY9UvX/dttW+KOr/aG77Awb6zyf9jIOR0Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:message-id:user-agent :mime-version:content-type; b=C8eKv5FDoYgUbOPmyxb41K7rmlyX+dBC8aYTdtDWtSPqZHPT05immTp9f0VVlLcXJH yJ2rxMaI7HJP2VrQV8Nc3cDrxyy0Qh7VE/KyXdZDip+qM8PWJ7wDfFKucGYbGRnsayiO QQ28vuh4k+PrlkfHXFeLjgMQGHiniyoevC8Jo= Received: by 10.220.171.211 with SMTP id i19mr2451308vcz.252.1282496120234; Sun, 22 Aug 2010 09:55:20 -0700 (PDT) Received: from localhost (tor.funk.org [193.37.152.204]) by mx.google.com with ESMTPS id m30sm2971570vbr.9.2010.08.22.09.55.15 (version=SSLv3 cipher=RC4-MD5); Sun, 22 Aug 2010 09:55:19 -0700 (PDT) From: Anonymous To: Jilles Tjoelker References: <201008221304.o7MD40lP004588__49386.4383352504$1282482264$gmane$org@svn.freebsd.org> Date: Sun, 22 Aug 2010 20:54:20 +0400 Message-ID: <86fwy6ziyr.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211621 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 16:55:21 -0000 Jilles Tjoelker writes: > Author: jilles > Date: Sun Aug 22 13:04:00 2010 > New Revision: 211621 > URL: http://svn.freebsd.org/changeset/base/211621 > > Log: > sh(1): Add a brief summary of arithmetic expressions. > > Modified: > head/bin/sh/sh.1 > > Modified: head/bin/sh/sh.1 > ============================================================================== > --- head/bin/sh/sh.1 Sun Aug 22 12:03:31 2010 (r211620) > +++ head/bin/sh/sh.1 Sun Aug 22 13:04:00 2010 (r211621) [...] > +.It Short-circuit evaluation > +The > +.Li && > +and > +.Li || > +operators always evaluate both sides. > +This is a bug. > +.El > .Pp Why not put it in the BUGS section then? From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 19:19:21 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81A9810656AC for ; Sun, 22 Aug 2010 19:19:21 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 0C85E8FC25 for ; Sun, 22 Aug 2010 19:19:20 +0000 (UTC) Received: (qmail 4959 invoked by uid 399); 22 Aug 2010 19:19:20 -0000 Received: from localhost (HELO lap.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 22 Aug 2010 19:19:20 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C717836.1050707@FreeBSD.org> Date: Sun, 22 Aug 2010 12:19:18 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.8) Gecko/20100807 Thunderbird/3.1.2 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201008191131.o7JBV4Yf002412@svn.freebsd.org> <4C6D18BE.2000905@fer.hr> <4C6D95A8.9070105@FreeBSD.org> <20100819213159.B48418@maildrop.int.zabbadoz.net> <4C6DDB74.3090102@FreeBSD.org> <20100820093856.GB1766@garage.freebsd.pl> In-Reply-To: <20100820093856.GB1766@garage.freebsd.pl> X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, Ana Kukec , svn-src-all@FreeBSD.org, "Bjoern A. Zeeb" , src-committers@FreeBSD.org Subject: Re: svn commit: r211501 - in head/sys: modules modules/send netinet netinet6 sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 19:19:21 -0000 On 08/20/2010 02:38, Pawel Jakub Dawidek wrote: > I'm guessing that's an attempt at humor? I thought I've made it clear in the rest of the thread that it wasn't. I think it's interesting that every time I make a cogent point that's hard to disagree with the response is snark and/or thinly veiled ad hominem attacks. It's like the best of early 90's usenet! :) So, fine, here's one more thing that I'd like to see happen that a vocal portion of the community doesn't care about. No worries. But you hereby lose the right to complain about the lack of man pages at any point in the future. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ Computers are useless. They can only give you answers. -- Pablo Picasso From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 19:24:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E73B10656A3; Sun, 22 Aug 2010 19:24:59 +0000 (UTC) (envelope-from remko@elvandar.org) Received: from mailgate.jr-hosting.nl (mailgate.jr-hosting.nl [IPv6:2a01:4f8:63:1281::3]) by mx1.freebsd.org (Postfix) with ESMTP id BBE9B8FC0C; Sun, 22 Aug 2010 19:24:58 +0000 (UTC) Received: from websrv01.jr-hosting.nl (unknown [IPv6:2a01:4f8:63:1281::4]) by mailgate.jr-hosting.nl (Postfix) with ESMTP id DEC661CC2E; Sun, 22 Aug 2010 21:24:57 +0200 (CEST) Received: from [2001:888:15a5:0:21e:c2ff:febc:d902] by websrv01.jr-hosting.nl with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.72 (FreeBSD)) (envelope-from ) id 1OnGA5-000Exb-LF; Sun, 22 Aug 2010 21:24:57 +0200 Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Remko Lodder In-Reply-To: <86fwy6ziyr.fsf@gmail.com> Date: Sun, 22 Aug 2010 21:24:56 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <7047B3CD-B22C-48D6-AE7B-FD705488E11F@elvandar.org> References: <201008221304.o7MD40lP004588__49386.4383352504$1282482264$gmane$org@svn.freebsd.org> <86fwy6ziyr.fsf@gmail.com> To: Anonymous X-Mailer: Apple Mail (2.1081) Cc: Jilles Tjoelker , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211621 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 19:24:59 -0000 >>=20 >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/bin/sh/sh.1 Sun Aug 22 12:03:31 2010 (r211620) >> +++ head/bin/sh/sh.1 Sun Aug 22 13:04:00 2010 (r211621) > [...] >> +.It Short-circuit evaluation >> +The >> +.Li && >> +and >> +.Li || >> +operators always evaluate both sides. >> +This is a bug. >> +.El >> .Pp >=20 > Why not put it in the BUGS section then? FreeBSD doesn't contain BUGS.. so we dont need to... (Just kidding ofcourse). I am sure Jilles has a reason :-) Cheerio Remko --=20 /"\ Best regards, | remko@FreeBSD.org \ / Remko Lodder | remko@EFnet X http://www.evilcoder.org/ | / \ ASCII Ribbon Campaign | Against HTML Mail and News From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 19:25:07 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA2CB1065743 for ; Sun, 22 Aug 2010 19:25:07 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 32E4C8FC25 for ; Sun, 22 Aug 2010 19:25:06 +0000 (UTC) Received: (qmail 13511 invoked by uid 399); 22 Aug 2010 19:25:05 -0000 Received: from localhost (HELO lap.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 22 Aug 2010 19:25:05 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C717990.6020601@FreeBSD.org> Date: Sun, 22 Aug 2010 12:25:04 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.8) Gecko/20100807 Thunderbird/3.1.2 MIME-Version: 1.0 To: "M. Warner Losh" References: <26CBB559-FA72-4688-92E9-ED9CEA151B2C@FreeBSD.org> <20100821.191255.1023414010414033264.imp@bsdimp.com> In-Reply-To: <20100821.191255.1023414010414033264.imp@bsdimp.com> X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, rpaulo@FreeBSD.org, svn-src-all@FreeBSD.org, bz@FreeBSD.org, svn-src-head@FreeBSD.org, anchie@FreeBSD.org Subject: Re: svn commit: r211501 - in head/sys: modules modules/send netinet netinet6 sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 19:25:07 -0000 On 08/21/2010 18:12, M. Warner Losh wrote: > Do we really need to have a bunch of threads about why people should > do the things they have promised to do? Since this is basically a useless/snarky question, here are some useless/snarky responses. Feel free to pick your favorite. Apparently we do, since there's still no man page for the new feature. I don't know Warner, what do you think? How many threads would you prefer on this topic? I guess you're right, we don't really need man pages after all. Thanks for setting me straight. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ Computers are useless. They can only give you answers. -- Pablo Picasso From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 19:32:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 069E71065673; Sun, 22 Aug 2010 19:32:42 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id BFAF98FC1E; Sun, 22 Aug 2010 19:32:41 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id A49AE35A838; Sun, 22 Aug 2010 21:32:40 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 8F6101721D; Sun, 22 Aug 2010 21:32:40 +0200 (CEST) Date: Sun, 22 Aug 2010 21:32:40 +0200 From: Jilles Tjoelker To: Remko Lodder Message-ID: <20100822193240.GC42636@stack.nl> References: <201008221304.o7MD40lP004588__49386.4383352504$1282482264$gmane$org@svn.freebsd.org> <86fwy6ziyr.fsf@gmail.com> <7047B3CD-B22C-48D6-AE7B-FD705488E11F@elvandar.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7047B3CD-B22C-48D6-AE7B-FD705488E11F@elvandar.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Anonymous , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211621 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 19:32:42 -0000 On Sun, Aug 22, 2010 at 09:24:56PM +0200, Remko Lodder wrote: > >> ============================================================================== > >> --- head/bin/sh/sh.1 Sun Aug 22 12:03:31 2010 (r211620) > >> +++ head/bin/sh/sh.1 Sun Aug 22 13:04:00 2010 (r211621) > > [...] > >> +.It Short-circuit evaluation > >> +The > >> +.Li && > >> +and > >> +.Li || > >> +operators always evaluate both sides. > >> +This is a bug. > >> +.El > >> .Pp > > Why not put it in the BUGS section then? > FreeBSD doesn't contain BUGS.. so we dont need to... > (Just kidding ofcourse). I am sure Jilles has a reason :-) The sh(1) man page is so long that I do not expect it to be read in its entirety often. Therefore I have put the description of this bug near the feature so that it is more likely to be seen at the appropriate time. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 19:46:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B5A3106564A; Sun, 22 Aug 2010 19:46:27 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id DE4138FC1D; Sun, 22 Aug 2010 19:46:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o7MJgMss034828; Sun, 22 Aug 2010 13:42:22 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 22 Aug 2010 13:42:29 -0600 (MDT) Message-Id: <20100822.134229.550118873867470111.imp@bsdimp.com> To: dougb@freebsd.org From: "M. Warner Losh" In-Reply-To: <4C717990.6020601@FreeBSD.org> References: <20100821.191255.1023414010414033264.imp@bsdimp.com> <4C717990.6020601@FreeBSD.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, rpaulo@freebsd.org, svn-src-all@freebsd.org, bz@freebsd.org, svn-src-head@freebsd.org, anchie@freebsd.org Subject: Re: svn commit: r211501 - in head/sys: modules modules/send netinet netinet6 sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 19:46:27 -0000 In message: <4C717990.6020601@FreeBSD.org> Doug Barton writes: : On 08/21/2010 18:12, M. Warner Losh wrote: : > Do we really need to have a bunch of threads about why people should : > do the things they have promised to do? : : Since this is basically a useless/snarky question, here are some : useless/snarky responses. Feel free to pick your favorite. : : Apparently we do, since there's still no man page for the new feature. : : I don't know Warner, what do you think? : : How many threads would you prefer on this topic? : : I guess you're right, we don't really need man pages after all. Thanks : for setting me straight. I think you're drawing the wrong conclusion here. My point is that we have trusted folks in the past to do the right thing, even when they don't say they will. Here we have someone who says she'll commit something soon. We should take her at her word that she'll do this. Reverting all the code is cutting off our nose to spite our face and is too extreme a remedy raised far too early in the process. Complaining like this sends lots of negative energy towards Ann and might actively turn her off to writing the man page, which is exactly the result you are trying to avoid. While the ends are noble, the means I strongly disagree with. Warner From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 20:16:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8372710656B2 for ; Sun, 22 Aug 2010 20:16:24 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 294228FC1B for ; Sun, 22 Aug 2010 20:16:23 +0000 (UTC) Received: (qmail 15313 invoked by uid 399); 22 Aug 2010 20:16:23 -0000 Received: from localhost (HELO lap.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 22 Aug 2010 20:16:23 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C718595.5050304@FreeBSD.org> Date: Sun, 22 Aug 2010 13:16:21 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.8) Gecko/20100807 Thunderbird/3.1.2 MIME-Version: 1.0 To: "M. Warner Losh" References: <20100821.191255.1023414010414033264.imp@bsdimp.com> <4C717990.6020601@FreeBSD.org> <20100822.134229.550118873867470111.imp@bsdimp.com> In-Reply-To: <20100822.134229.550118873867470111.imp@bsdimp.com> X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, rpaulo@freebsd.org, svn-src-all@freebsd.org, bz@freebsd.org, svn-src-head@freebsd.org, anchie@freebsd.org Subject: Re: svn commit: r211501 - in head/sys: modules modules/send netinet netinet6 sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 20:16:24 -0000 On 08/22/2010 12:42, M. Warner Losh wrote: > I think you're drawing the wrong conclusion here. Doubtful. :) > My point is that we have trusted folks in the past to do the right > thing, even when they don't say they will. And my point, which I will make one last time, is that this model hasn't worked. Yes, it works sometimes, but we still have a bunch of stuff that doesn't have _any_ man page at all. If we want to continue the transition to being a more professional OS that isn't acceptable. I've already made the points about why working through the documentation _before_ committing is valuable, and that the simple step of requiring this is an easy way to make sure the problem we have doesn't get any worse. Clearly there isn't a lot of sympathy for either of these perspectives in the wider community, so c'est la vie. But I was serious about my other comment, if you(pl.) are not willing to make a change to improve the situation, you lose the right to complain down the road when the man pages don't magically appear. > towards Ann Wrong name. :) Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ Computers are useless. They can only give you answers. -- Pablo Picasso From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 20:17:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25E5510656A4; Sun, 22 Aug 2010 20:17:29 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14D858FC16; Sun, 22 Aug 2010 20:17:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MKHSml013617; Sun, 22 Aug 2010 20:17:28 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MKHSww013615; Sun, 22 Aug 2010 20:17:28 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201008222017.o7MKHSww013615@svn.freebsd.org> From: Christian Brueffer Date: Sun, 22 Aug 2010 20:17:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211639 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 20:17:29 -0000 Author: brueffer Date: Sun Aug 22 20:17:28 2010 New Revision: 211639 URL: http://svn.freebsd.org/changeset/base/211639 Log: MFC: r211355 Fixed a typo and added a comma. Modified: stable/8/share/man/man4/ng_atm.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/ng_atm.4 ============================================================================== --- stable/8/share/man/man4/ng_atm.4 Sun Aug 22 20:04:48 2010 (r211638) +++ stable/8/share/man/man4/ng_atm.4 Sun Aug 22 20:17:28 2010 (r211639) @@ -138,7 +138,7 @@ Hooks for dynamically initiated VCIs can .Xr netgraph 4 as long as the name does not collide with one of the three predefined names. .Pp -To initiate packet sending an receiving on a dynamic hook one has to issue +To initiate packet sending and receiving on a dynamic hook, one has to issue a .Dv NGM_ATM_CPCS_INIT control message. From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 20:22:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF767106564A; Sun, 22 Aug 2010 20:22:56 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE5C28FC0A; Sun, 22 Aug 2010 20:22:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MKMui1013827; Sun, 22 Aug 2010 20:22:56 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MKMu0X013825; Sun, 22 Aug 2010 20:22:56 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201008222022.o7MKMu0X013825@svn.freebsd.org> From: Christian Brueffer Date: Sun, 22 Aug 2010 20:22:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211641 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 20:22:56 -0000 Author: brueffer Date: Sun Aug 22 20:22:56 2010 New Revision: 211641 URL: http://svn.freebsd.org/changeset/base/211641 Log: MFC: r148681 Fixed a typo and added a comma. Modified: stable/7/share/man/man4/ng_atm.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/ng_atm.4 ============================================================================== --- stable/7/share/man/man4/ng_atm.4 Sun Aug 22 20:21:10 2010 (r211640) +++ stable/7/share/man/man4/ng_atm.4 Sun Aug 22 20:22:56 2010 (r211641) @@ -138,7 +138,7 @@ Hooks for dynamically initiated VCIs can .Xr netgraph 4 as long as the name does not collide with one of the three predefined names. .Pp -To initiate packet sending an receiving on a dynamic hook one has to issue +To initiate packet sending and receiving on a dynamic hook, one has to issue a .Dv NGM_ATM_CPCS_INIT control message. From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 20:24:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B0841065697; Sun, 22 Aug 2010 20:24:25 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A0808FC22; Sun, 22 Aug 2010 20:24:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MKOOcL013937; Sun, 22 Aug 2010 20:24:24 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MKOOlc013935; Sun, 22 Aug 2010 20:24:24 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201008222024.o7MKOOlc013935@svn.freebsd.org> From: Christian Brueffer Date: Sun, 22 Aug 2010 20:24:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211642 - stable/8/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 20:24:25 -0000 Author: brueffer Date: Sun Aug 22 20:24:24 2010 New Revision: 211642 URL: http://svn.freebsd.org/changeset/base/211642 Log: MFC: r148701 Fixed a typo. Modified: stable/8/share/man/man9/crypto.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/crypto.9 ============================================================================== --- stable/8/share/man/man9/crypto.9 Sun Aug 22 20:22:56 2010 (r211641) +++ stable/8/share/man/man9/crypto.9 Sun Aug 22 20:24:24 2010 (r211642) @@ -143,7 +143,7 @@ not The same holds for the framework. Thus, a callback mechanism is used to notify a consumer that a request has been completed (the -callback is specified by the consumer on an per-request basis). +callback is specified by the consumer on a per-request basis). The callback is invoked by the framework whether the request was successfully completed or not. An error indication is provided in the latter case. From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 20:25:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2292106564A; Sun, 22 Aug 2010 20:25:03 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C11088FC16; Sun, 22 Aug 2010 20:25:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MKP3Ig014009; Sun, 22 Aug 2010 20:25:03 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MKP30U014007; Sun, 22 Aug 2010 20:25:03 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201008222025.o7MKP30U014007@svn.freebsd.org> From: Christian Brueffer Date: Sun, 22 Aug 2010 20:25:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211643 - stable/7/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 20:25:03 -0000 Author: brueffer Date: Sun Aug 22 20:25:03 2010 New Revision: 211643 URL: http://svn.freebsd.org/changeset/base/211643 Log: MFC: r148701 Fixed a typo. Modified: stable/7/share/man/man9/crypto.9 Directory Properties: stable/7/share/man/man9/ (props changed) Modified: stable/7/share/man/man9/crypto.9 ============================================================================== --- stable/7/share/man/man9/crypto.9 Sun Aug 22 20:24:24 2010 (r211642) +++ stable/7/share/man/man9/crypto.9 Sun Aug 22 20:25:03 2010 (r211643) @@ -143,7 +143,7 @@ not The same holds for the framework. Thus, a callback mechanism is used to notify a consumer that a request has been completed (the -callback is specified by the consumer on an per-request basis). +callback is specified by the consumer on a per-request basis). The callback is invoked by the framework whether the request was successfully completed or not. An error indication is provided in the latter case. From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 20:42:55 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61CEA106564A; Sun, 22 Aug 2010 20:42:55 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id B0C3C8FC0A; Sun, 22 Aug 2010 20:42:54 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 4BE889CB0DB; Sun, 22 Aug 2010 22:23:51 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DW8ISbQKcKle; Sun, 22 Aug 2010 22:23:50 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 269439CB43A; Sun, 22 Aug 2010 22:23:50 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id o7MKNogk031175; Sun, 22 Aug 2010 22:23:50 +0200 (CEST) (envelope-from rdivacky) Date: Sun, 22 Aug 2010 22:23:50 +0200 From: Roman Divacky To: Rui Paulo Message-ID: <20100822202350.GA30039@freebsd.org> References: <201008211546.o7LFkY83073894@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201008211546.o7LFkY83073894@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r211573 - in head: contrib/llvm/tools/clang/lib/Driver contrib/llvm/tools/clang/lib/Frontend lib/clang X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 20:42:55 -0000 are they interested in this upstream? I think they can be and it would save us some effort on the next merge On Sat, Aug 21, 2010 at 03:46:34PM +0000, Rui Paulo wrote: > Author: rpaulo > Date: Sat Aug 21 15:46:33 2010 > New Revision: 211573 > URL: http://svn.freebsd.org/changeset/base/211573 > > Log: > Modify clang so that when TOOLS_PREFIX is defined we register the > CLANG_PREFIX macro. This changes the default header search path when we > are building clang as part of cross-tools. > > Submitted by: Dimitry Andric > Reviewed by: freebsd-current > > Modified: > head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp > head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp > head/lib/clang/clang.build.mk > > Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp > ============================================================================== > --- head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp Sat Aug 21 15:39:06 2010 (r211572) > +++ head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp Sat Aug 21 15:46:33 2010 (r211573) > @@ -26,6 +26,10 @@ > > #include // ::getenv > > +#ifndef CLANG_PREFIX > +#define CLANG_PREFIX > +#endif > + > using namespace clang::driver; > using namespace clang::driver::toolchains; > > @@ -869,11 +873,9 @@ FreeBSD::FreeBSD(const HostInfo &Host, c > getProgramPaths().push_back(getDriver().Dir + "/../libexec"); > getProgramPaths().push_back("/usr/libexec"); > if (Lib32) { > - getFilePaths().push_back(getDriver().Dir + "/../lib32"); > - getFilePaths().push_back("/usr/lib32"); > + getFilePaths().push_back(CLANG_PREFIX "/usr/lib32"); > } else { > - getFilePaths().push_back(getDriver().Dir + "/../lib"); > - getFilePaths().push_back("/usr/lib"); > + getFilePaths().push_back(CLANG_PREFIX "/usr/lib"); > } > } > > > Modified: head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp > ============================================================================== > --- head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp Sat Aug 21 15:39:06 2010 (r211572) > +++ head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp Sat Aug 21 15:46:33 2010 (r211573) > @@ -30,6 +30,9 @@ > #define WIN32_LEAN_AND_MEAN 1 > #include > #endif > +#ifndef CLANG_PREFIX > +#define CLANG_PREFIX > +#endif > using namespace clang; > using namespace clang::frontend; > > @@ -408,9 +411,10 @@ static bool getWindowsSDKDir(std::string > > void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple, > const HeaderSearchOptions &HSOpts) { > -#if 0 /* Remove unneeded include paths. */ > // FIXME: temporary hack: hard-coded paths. > - AddPath("/usr/local/include", System, true, false, false); > +#ifndef __FreeBSD__ > + AddPath(CLANG_PREFIX "/usr/local/include", System, true, false, false); > +#endif > > // Builtin includes use #include_next directives and should be positioned > // just prior C include dirs. > @@ -421,7 +425,6 @@ void InitHeaderSearch::AddDefaultCInclud > P.appendComponent("include"); > AddPath(P.str(), System, false, false, false, /*IgnoreSysRoot=*/ true); > } > -#endif > > // Add dirs specified via 'configure --with-c-include-dirs'. > llvm::StringRef CIncludeDirs(C_INCLUDE_DIRS); > @@ -518,13 +521,15 @@ void InitHeaderSearch::AddDefaultCInclud > case llvm::Triple::MinGW32: > AddPath("c:/mingw/include", System, true, false, false); > break; > + case llvm::Triple::FreeBSD: > + AddPath(CLANG_PREFIX "/usr/include/clang/" CLANG_VERSION_STRING, > + System, false, false, false); > + break; > default: > break; > } > > - AddPath("/usr/include/clang/" CLANG_VERSION_STRING, > - System, false, false, false); > - AddPath("/usr/include", System, false, false, false); > + AddPath(CLANG_PREFIX "/usr/include", System, false, false, false); > } > > void InitHeaderSearch:: > @@ -726,8 +731,10 @@ AddDefaultCPlusPlusIncludePaths(const ll > case llvm::Triple::FreeBSD: > // FreeBSD 8.0 > // FreeBSD 7.3 > - AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2", "", "", "", triple); > - AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2/backward", "", "", "", triple); > + AddGnuCPlusPlusIncludePaths(CLANG_PREFIX "/usr/include/c++/4.2", > + "", "", "", triple); > + AddGnuCPlusPlusIncludePaths(CLANG_PREFIX "/usr/include/c++/4.2/backward", > + "", "", "", triple); > break; > case llvm::Triple::Minix: > AddGnuCPlusPlusIncludePaths("/usr/gnu/include/c++/4.4.3", > > Modified: head/lib/clang/clang.build.mk > ============================================================================== > --- head/lib/clang/clang.build.mk Sat Aug 21 15:39:06 2010 (r211572) > +++ head/lib/clang/clang.build.mk Sat Aug 21 15:46:33 2010 (r211573) > @@ -28,6 +28,10 @@ LLVM_REQUIRES_RTTI= > CFLAGS+=-fno-rtti > .endif > > +.ifdef TOOLS_PREFIX > +CFLAGS+=-DCLANG_PREFIX=\"${TOOLS_PREFIX}\" > +.endif > + > .PATH: ${LLVM_SRCS}/${SRCDIR} > > TBLGEN=tblgen ${CFLAGS:M-I*} From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 21:18:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA64C10656AC; Sun, 22 Aug 2010 21:18:21 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E66B8FC14; Sun, 22 Aug 2010 21:18:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MLILS1016021; Sun, 22 Aug 2010 21:18:21 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MLILb4016018; Sun, 22 Aug 2010 21:18:21 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201008222118.o7MLILb4016018@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 22 Aug 2010 21:18:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211646 - in head: bin/sh tools/regression/bin/sh/expansion X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 21:18:21 -0000 Author: jilles Date: Sun Aug 22 21:18:21 2010 New Revision: 211646 URL: http://svn.freebsd.org/changeset/base/211646 Log: sh: Remove remnants of '!!' to negate pattern. This Almquist extension was disabled long ago. In pathname generation, components starting with '!!' were treated as containing wildcards, causing unnecessary readdir (which could fail, causing pathname generation to fail while it should not). Added: head/tools/regression/bin/sh/expansion/pathname4.0 (contents, props changed) Modified: head/bin/sh/expand.c Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Sun Aug 22 21:06:18 2010 (r211645) +++ head/bin/sh/expand.c Sun Aug 22 21:18:21 2010 (r211646) @@ -109,7 +109,6 @@ STATIC void expmeta(char *, char *); STATIC void addfname(char *); STATIC struct strlist *expsort(struct strlist *); STATIC struct strlist *msort(struct strlist *, int); -STATIC int pmatch(const char *, const char *, int); STATIC char *cvtnum(int, char *); STATIC int collate_range_cmp(int, int); @@ -1101,7 +1100,7 @@ expandmeta(struct strlist *str, int flag for (;;) { /* fast check for meta chars */ if ((c = *p++) == '\0') goto nometa; - if (c == '*' || c == '?' || c == '[' || c == '!') + if (c == '*' || c == '?' || c == '[') break; } savelastp = exparg.lastp; @@ -1168,8 +1167,6 @@ expmeta(char *enddir, char *name) break; } } - } else if (*p == '!' && p[1] == '!' && (p == name || p[-1] == '/')) { - metaflag = 1; } else if (*p == '\0') break; else if (*p == CTLQUOTEMARK) @@ -1353,18 +1350,6 @@ msort(struct strlist *list, int len) int patmatch(const char *pattern, const char *string, int squoted) { -#ifdef notdef - if (pattern[0] == '!' && pattern[1] == '!') - return 1 - pmatch(pattern + 2, string); - else -#endif - return pmatch(pattern, string, squoted); -} - - -STATIC int -pmatch(const char *pattern, const char *string, int squoted) -{ const char *p, *q; char c; @@ -1406,7 +1391,7 @@ pmatch(const char *pattern, const char * } } do { - if (pmatch(p, q, squoted)) + if (patmatch(p, q, squoted)) return 1; if (squoted && *q == CTLESC) q++; Added: head/tools/regression/bin/sh/expansion/pathname4.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/pathname4.0 Sun Aug 22 21:18:21 2010 (r211646) @@ -0,0 +1,28 @@ +# $FreeBSD$ + +failures=0 + +check() { + testcase=$1 + expect=$2 + eval "set -- $testcase" + actual="$*" + if [ "$actual" != "$expect" ]; then + failures=$((failures+1)) + printf '%s\n' "For $testcase, expected $expect actual $actual" + fi +} + +set -e +T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX) +trap 'rm -rf $T' 0 +cd -P $T + +mkdir !!a +touch !!a/fff + +chmod u-r . +check '!!a/ff*' '!!a/fff' +chmod u+r . + +exit $((failures != 0)) From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 21:21:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF0431065697; Sun, 22 Aug 2010 21:21:39 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 18BED8FC08; Sun, 22 Aug 2010 21:21:39 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:adf2:d748:7256:efad] (unknown [IPv6:2001:7b8:3a7:0:adf2:d748:7256:efad]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 477A65C59; Sun, 22 Aug 2010 23:21:37 +0200 (CEST) Message-ID: <4C7194E6.6080708@andric.com> Date: Sun, 22 Aug 2010 23:21:42 +0200 From: Dimitry Andric User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.9pre) Gecko/20100814 Lanikai/3.1.3pre MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <201008141434.o7EEYaSA030301@svn.freebsd.org> <20100815205724.00007e0f@unknown> <86wrrraqk8.fsf@ds4.des.no> In-Reply-To: <86wrrraqk8.fsf@ds4.des.no> Content-Type: multipart/mixed; boundary="------------040200060404010907090506" Cc: Bruce Cran , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211304 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 21:21:39 -0000 This is a multi-part message in MIME format. --------------040200060404010907090506 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2010-08-16 10:51, Dag-Erling Sm=C3=B8rgrav wrote: > Bruce Cran writes: >> Somewhat related, there are overflow bugs in humanize_number - for >> example df(1) fails to display space from a 100PB filesystem >> correctly. >=20 > Patch? :) Attached. This makes humanize_number() work properly for all possible int64_t values. It has one significant behaviour change, though: with the original version of humanize_number(), if you used a fixed scale parameter, and the number was larger than the buffer could contain, it would simply stomp over the end of the buffer. With this fix, it will return -1 instead. I hope you agree that is better. :) --------------040200060404010907090506 Content-Type: text/plain; name="humanize-overflow-fix.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="humanize-overflow-fix.diff" ZGlmZiAtLWdpdCBhL2xpYi9saWJ1dGlsL2h1bWFuaXplX251bWJlci5jIGIvbGliL2xpYnV0 aWwvaHVtYW5pemVfbnVtYmVyLmMKaW5kZXggZGU5ODU4Ny4uYTMwNDEzNyAxMDA2NDQKLS0t IGEvbGliL2xpYnV0aWwvaHVtYW5pemVfbnVtYmVyLmMKKysrIGIvbGliL2xpYnV0aWwvaHVt YW5pemVfbnVtYmVyLmMKQEAgLTQyLDEzICs0MiwzNCBAQCBfX0ZCU0RJRCgiJEZyZWVCU0Qk Iik7CiAjaW5jbHVkZSA8bG9jYWxlLmg+CiAjaW5jbHVkZSA8bGlidXRpbC5oPgogCitzdGF0 aWMgaW5saW5lIHZvaWQKK2RpdmlkZShpbnQ2NF90IG51bSwgaW50NjRfdCBkZW4sIGludDY0 X3QgKnF1b3RwLCBpbnQ2NF90ICpxdW90cnAsIGludCAqZnJhY3JwKQoreworCWludCBmcmFj OworCisJaWYgKGRlbiA9PSAxKSB7CisJCSpxdW90cCA9ICpxdW90cnAgPSBudW07CisJCSpm cmFjcnAgPSAwOworCX0gZWxzZSB7CisJCSpxdW90cCA9ICpxdW90cnAgPSBudW0gLyBkZW47 CisJCWZyYWMgPSAoNSAqIChudW0gJSBkZW4pKSAvIChkZW4gLyAyKTsKKwkJaWYgKGZyYWMg Pj0gNSkKKwkJCSsrKnF1b3RwOworCQkqZnJhY3JwID0gKDUgKiAobnVtICUgZGVuKSArIGRl biAvIDQpIC8gKGRlbiAvIDIpOworCQlpZiAoKmZyYWNycCA9PSAxMCkgeworCQkJKysqcXVv dHJwOworCQkJKmZyYWNycCA9IDA7CisJCX0KKwl9Cit9CisKIGludAogaHVtYW5pemVfbnVt YmVyKGNoYXIgKmJ1Ziwgc2l6ZV90IGxlbiwgaW50NjRfdCBieXRlcywKICAgICBjb25zdCBj aGFyICpzdWZmaXgsIGludCBzY2FsZSwgaW50IGZsYWdzKQogewogCWNvbnN0IGNoYXIgKnBy ZWZpeGVzLCAqc2VwOwotCWludAliLCBpLCByLCBtYXhzY2FsZSwgczEsIHMyLCBzaWduOwot CWludDY0X3QJZGl2aXNvciwgbWF4OworCWludAlpLCByLCBtYXhzY2FsZSwgc2lnbiwgZnJh Y3I7CisJaW50NjRfdAlkaXZpc29yLCBtYXgsIGZ1bGxkaXYsIHF1b3QsIHF1b3RyOwogCXNp emVfdAliYXNlbGVuOwogCiAJYXNzZXJ0KGJ1ZiAhPSBOVUxMKTsKQEAgLTg4LDExICsxMDks MTAgQEAgaHVtYW5pemVfbnVtYmVyKGNoYXIgKmJ1Ziwgc2l6ZV90IGxlbiwgaW50NjRfdCBi eXRlcywKIAkJYnVmWzBdID0gJ1wwJzsKIAlpZiAoYnl0ZXMgPCAwKSB7CiAJCXNpZ24gPSAt MTsKLQkJYnl0ZXMgKj0gLTEwMDsKKwkJYnl0ZXMgPSAtYnl0ZXM7CiAJCWJhc2VsZW4gPSAz OwkJLyogc2lnbiwgZGlnaXQsIHByZWZpeCAqLwogCX0gZWxzZSB7CiAJCXNpZ24gPSAxOwot CQlieXRlcyAqPSAxMDA7CiAJCWJhc2VsZW4gPSAyOwkJLyogZGlnaXQsIHByZWZpeCAqLwog CX0KIAlpZiAoZmxhZ3MgJiBITl9OT1NQQUNFKQpAQCAtMTA3LDM5ICsxMjcsNDIgQEAgaHVt YW5pemVfbnVtYmVyKGNoYXIgKmJ1Ziwgc2l6ZV90IGxlbiwgaW50NjRfdCBieXRlcywKIAlp ZiAobGVuIDwgYmFzZWxlbiArIDEpCiAJCXJldHVybiAoLTEpOwogCisJLyogRGV0ZXJtaW5l IHRoZSBtYXhpbXVtIG51bWJlciB0aGF0IGZpdHMuICovCisJZm9yIChtYXggPSAxLCBpID0g bGVuIC0gYmFzZWxlbjsgaS0tID4gMDspCisJCW1heCAqPSAxMDsKKwogCWlmIChzY2FsZSAm IChITl9BVVRPU0NBTEUgfCBITl9HRVRTQ0FMRSkpIHsKLQkJLyogU2VlIGlmIHRoZXJlIGlz IGFkZGl0aW9uYWwgY29sdW1ucyBjYW4gYmUgdXNlZC4gKi8KLQkJZm9yIChtYXggPSAxMDAs IGkgPSBsZW4gLSBiYXNlbGVuOyBpLS0gPiAwOykKLQkJCW1heCAqPSAxMDsKLQotCQkvKgot CQkgKiBEaXZpZGUgdGhlIG51bWJlciB1bnRpbCBpdCBmaXRzIHRoZSBnaXZlbiBjb2x1bW4u Ci0JCSAqIElmIHRoZXJlIHdpbGwgYmUgYW4gb3ZlcmZsb3cgYnkgdGhlIHJvdW5kaW5nIGJl bG93LAotCQkgKiBkaXZpZGUgb25jZSBtb3JlLgotCQkgKi8KLQkJZm9yIChpID0gMDsgYnl0 ZXMgPj0gbWF4IC0gNTAgJiYgaSA8IG1heHNjYWxlOyBpKyspCi0JCQlieXRlcyAvPSBkaXZp c29yOworCQkvKiBEaXZpZGUgdGhlIG51bWJlciB1bnRpbCBpdCBmaXRzIHRoZSBnaXZlbiBs ZW5ndGguICovCisJCWZvciAoaSA9IDAsIGZ1bGxkaXYgPSAxOyBpIDwgbWF4c2NhbGU7IGkr KykgeworCQkJZGl2aWRlKGJ5dGVzLCBmdWxsZGl2LCAmcXVvdCwgJnF1b3RyLCAmZnJhY3Ip OworCQkJaWYgKChxdW90ciA8IDEwICYmIGkgPiAwICYmIGZsYWdzICYgSE5fREVDSU1BTCAm JgorCQkJICAgIHF1b3RyICogMTAwIDwgbWF4KSB8fCBxdW90IDwgbWF4KQorCQkJCWJyZWFr OworCQkJZnVsbGRpdiAqPSBkaXZpc29yOworCQl9CiAKIAkJaWYgKHNjYWxlICYgSE5fR0VU U0NBTEUpCiAJCQlyZXR1cm4gKGkpOwotCX0gZWxzZQotCQlmb3IgKGkgPSAwOyBpIDwgc2Nh bGUgJiYgaSA8IG1heHNjYWxlOyBpKyspCi0JCQlieXRlcyAvPSBkaXZpc29yOworCX0gZWxz ZSB7CisJCWZvciAoaSA9IDAsIGZ1bGxkaXYgPSAxOyBpIDwgc2NhbGU7IGkrKykKKwkJCWZ1 bGxkaXYgKj0gZGl2aXNvcjsKKwkJZGl2aWRlKGJ5dGVzLCBmdWxsZGl2LCAmcXVvdCwgJnF1 b3RyLCAmZnJhY3IpOworCQlpZiAoKHF1b3RyIDwgMTAgJiYgaSA+IDAgJiYgZmxhZ3MgJiBI Tl9ERUNJTUFMICYmCisJCSAgICBxdW90ciAqIDEwMCA+PSBtYXgpIHx8IHF1b3QgPj0gbWF4 KQorCQkJcmV0dXJuICgtMSk7CisJfQogCi0JLyogSWYgYSB2YWx1ZSA8PSA5LjkgYWZ0ZXIg cm91bmRpbmcgYW5kIC4uLiAqLwotCWlmIChieXRlcyA8IDk5NSAmJiBpID4gMCAmJiBmbGFn cyAmIEhOX0RFQ0lNQUwpIHsKKwkvKiBJZiBxdW90aWVudCA8IDEwIGFmdGVyIHJvdW5kaW5n IGFuZCAuLi4gKi8KKwlpZiAocXVvdHIgPCAxMCAmJiBpID4gMCAmJiBmbGFncyAmIEhOX0RF Q0lNQUwpIHsKIAkJLyogYmFzZWxlbiArIFwwICsgLk4gKi8KIAkJaWYgKGxlbiA8IGJhc2Vs ZW4gKyAxICsgMikKIAkJCXJldHVybiAoLTEpOwotCQliID0gKChpbnQpYnl0ZXMgKyA1KSAv IDEwOwotCQlzMSA9IGIgLyAxMDsKLQkJczIgPSBiICUgMTA7CiAJCXIgPSBzbnByaW50Zihi dWYsIGxlbiwgIiVkJXMlZCVzJXMlcyIsCi0JCSAgICBzaWduICogczEsIGxvY2FsZWNvbnYo KS0+ZGVjaW1hbF9wb2ludCwgczIsCisJCSAgICBzaWduICogKGludCkgcXVvdHIsIGxvY2Fs ZWNvbnYoKS0+ZGVjaW1hbF9wb2ludCwgZnJhY3IsCiAJCSAgICBzZXAsIFNDQUxFMlBSRUZJ WChpKSwgc3VmZml4KTsKIAl9IGVsc2UKIAkJciA9IHNucHJpbnRmKGJ1ZiwgbGVuLCAiJSIg UFJJZDY0ICIlcyVzJXMiLAotCQkgICAgc2lnbiAqICgoYnl0ZXMgKyA1MCkgLyAxMDApLAor CQkgICAgc2lnbiAqIHF1b3QsCiAJCSAgICBzZXAsIFNDQUxFMlBSRUZJWChpKSwgc3VmZml4 KTsKIAogCXJldHVybiAocik7Cg== --------------040200060404010907090506-- From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 21:26:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D0A510656A4; Sun, 22 Aug 2010 21:26:36 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C8438FC17; Sun, 22 Aug 2010 21:26:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MLQaPS016671; Sun, 22 Aug 2010 21:26:36 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MLQavY016669; Sun, 22 Aug 2010 21:26:36 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008222126.o7MLQavY016669@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Aug 2010 21:26:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211648 - head/sys/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 21:26:36 -0000 Author: yongari Date: Sun Aug 22 21:26:35 2010 New Revision: 211648 URL: http://svn.freebsd.org/changeset/base/211648 Log: It seems some newer RTL8139 controllers provides only memory space register mapping. I'm not sure whether it comes from the fact that controllers live behind certain PCI brdge(PLX PCI 6152 33BC) and the bridge has some issues in handling I/O space register mapping. Unfortunately it's not possible to narrow down to an exact controller that shows this issue because RealTek used the same PCI device/revision id again. In theory, it's possible to check parent PCI bridge device and change rl(4) to use memory space register mapping if the parent PCI bridge is PLX PCI 6152. But I didn't try to do that and we wouldn't get much benefit with added complexity. Blindly switching to use memory space register mapping for rl(4) may make most old controllers not to work. At least, I don't want to take potential risk from such change. So use I/O space register mapping by default but give users chance to override it via a tunable. The tunable to use memory space register mapping would be given by adding the following line to /boot/loader.conf file. dev.rl.%d.prefer_iomap="0" This change makes P811B quad-port work with this tunable. Tested by: Nikola Kalpazanov ( n.kalpazanov <> gmail dot com ) MFC after: 1 week Modified: head/sys/pci/if_rl.c Modified: head/sys/pci/if_rl.c ============================================================================== --- head/sys/pci/if_rl.c Sun Aug 22 21:25:21 2010 (r211647) +++ head/sys/pci/if_rl.c Sun Aug 22 21:26:35 2010 (r211648) @@ -125,16 +125,6 @@ MODULE_DEPEND(rl, miibus, 1, 1, 1); /* "device miibus" required. See GENERIC if you get errors here. */ #include "miibus_if.h" -/* - * Default to using PIO access for this driver. On SMP systems, - * there appear to be problems with memory mapped mode: it looks like - * doing too many memory mapped access back to back in rapid succession - * can hang the bus. I'm inclined to blame this on crummy design/construction - * on the part of RealTek. Memory mapped mode does appear to work on - * uniprocessor systems though. - */ -#define RL_USEIOSPACE - #include /* @@ -225,14 +215,6 @@ static void rl_watchdog(struct rl_softc static void rl_setwol(struct rl_softc *); static void rl_clrwol(struct rl_softc *); -#ifdef RL_USEIOSPACE -#define RL_RES SYS_RES_IOPORT -#define RL_RID RL_PCI_LOIO -#else -#define RL_RES SYS_RES_MEMORY -#define RL_RID RL_PCI_LOMEM -#endif - static device_method_t rl_methods[] = { /* Device interface */ DEVMETHOD(device_probe, rl_probe), @@ -806,7 +788,7 @@ rl_attach(device_t dev) struct sysctl_ctx_list *ctx; struct sysctl_oid_list *children; int error = 0, hwrev, i, pmc, rid; - int unit; + int prefer_iomap, unit; uint16_t rl_did = 0; char tn[32]; @@ -828,10 +810,31 @@ rl_attach(device_t dev) pci_enable_busmaster(dev); - /* Map control/status registers. */ - rid = RL_RID; - sc->rl_res = bus_alloc_resource_any(dev, RL_RES, &rid, RF_ACTIVE); + /* + * Map control/status registers. + * Default to using PIO access for this driver. On SMP systems, + * there appear to be problems with memory mapped mode: it looks + * like doing too many memory mapped access back to back in rapid + * succession can hang the bus. I'm inclined to blame this on + * crummy design/construction on the part of RealTek. Memory + * mapped mode does appear to work on uniprocessor systems though. + */ + prefer_iomap = 1; + snprintf(tn, sizeof(tn), "dev.rl.%d.prefer_iomap", unit); + TUNABLE_INT_FETCH(tn, &prefer_iomap); + if (prefer_iomap) { + sc->rl_res_id = PCIR_BAR(0); + sc->rl_res_type = SYS_RES_IOPORT; + sc->rl_res = bus_alloc_resource_any(dev, sc->rl_res_type, + &sc->rl_res_id, RF_ACTIVE); + } + if (prefer_iomap == 0 || sc->rl_res == NULL) { + sc->rl_res_id = PCIR_BAR(1); + sc->rl_res_type = SYS_RES_MEMORY; + sc->rl_res = bus_alloc_resource_any(dev, sc->rl_res_type, + &sc->rl_res_id, RF_ACTIVE); + } if (sc->rl_res == NULL) { device_printf(dev, "couldn't map ports/memory\n"); error = ENXIO; @@ -1029,7 +1032,8 @@ rl_detach(device_t dev) if (sc->rl_irq[0]) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->rl_irq[0]); if (sc->rl_res) - bus_release_resource(dev, RL_RES, RL_RID, sc->rl_res); + bus_release_resource(dev, sc->rl_res_type, sc->rl_res_id, + sc->rl_res); if (ifp) if_free(ifp); From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 21:32:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C40D1065693; Sun, 22 Aug 2010 21:32:48 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BECC8FC20; Sun, 22 Aug 2010 21:32:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MLWmQD016847; Sun, 22 Aug 2010 21:32:48 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MLWmGT016845; Sun, 22 Aug 2010 21:32:48 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008222132.o7MLWmGT016845@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Aug 2010 21:32:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211650 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 21:32:48 -0000 Author: yongari Date: Sun Aug 22 21:32:48 2010 New Revision: 211650 URL: http://svn.freebsd.org/changeset/base/211650 Log: Document tunable dev.rl.%unit.prefer_iomap Modified: head/share/man/man4/rl.4 Modified: head/share/man/man4/rl.4 ============================================================================== --- head/share/man/man4/rl.4 Sun Aug 22 21:27:15 2010 (r211649) +++ head/share/man/man4/rl.4 Sun Aug 22 21:32:48 2010 (r211650) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 1, 2008 +.Dd August 22, 2010 .Dt RL 4 .Os .Sh NAME @@ -203,6 +203,13 @@ SOHO (PRAGMATIC) UE-1211C .El .Sh LOADER TUNABLES .Bl -tag -width indent +.It Va dev.rl.%unit.prefer_iomap +This tunable controls which register mapping should be used on the +specified device. +Non-zero value enables I/O space register mapping. +For controllers that have no I/O space register mapping this tunable +should be set to 0 to use I/O space register mapping. +The default value is 1 to use I/O space register mapping. .It Va dev.rl.%unit.twister_enable Non-zero value enables the long cable tuning on the specified device. Disabled by default. From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 22:39:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 383FC1065670; Sun, 22 Aug 2010 22:39:05 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id A4AC78FC0A; Sun, 22 Aug 2010 22:39:04 +0000 (UTC) Received: by vws7 with SMTP id 7so5512123vws.13 for ; Sun, 22 Aug 2010 15:39:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=zAHIeoSexeQ+nelTuftLcKToocE/6yeL/B2RNmzTwkU=; b=nxj0Zytd6S6Y442mSk6aWneiQ1CqtUZWNFkRbD9HBHSYkbt7ftCKXvGYUCJdcds9sY QxIhXpNYGS8lPxxQjyR/F1ZxB0fodqhlgo6DV9Qo/G856Pw7SWVRwEVEj16TODcFNM/l iznfXcm2Qe1LSbsZasNValqiWd9HEcvJJaai4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=CF5qG/2O5Z1eE0ghUZ6bDJgmAxXt86Ylc6LvSIdecZ26rc9d+N0xTouv3a/gm48rrm RI99nWXYqubf+qLPx36FttUGv8l0ZC5w5rCk2ul+pL8wj8nWMPE+x2EjREHOrbP+uRVe E5iIcYZtNzqx2sJweoa9GCg47kjQ+4LJL60Uc= MIME-Version: 1.0 Received: by 10.220.158.9 with SMTP id d9mr2718923vcx.33.1282515348583; Sun, 22 Aug 2010 15:15:48 -0700 (PDT) Received: by 10.220.10.203 with HTTP; Sun, 22 Aug 2010 15:15:48 -0700 (PDT) In-Reply-To: <201008222132.o7MLWmGT016845@svn.freebsd.org> References: <201008222132.o7MLWmGT016845@svn.freebsd.org> Date: Sun, 22 Aug 2010 18:15:48 -0400 Message-ID: From: Ben Kaduk To: Pyun YongHyeon Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211650 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 22:39:05 -0000 On Sun, Aug 22, 2010 at 5:32 PM, Pyun YongHyeon wrote= : > --- head/share/man/man4/rl.4 =A0 =A0Sun Aug 22 21:27:15 2010 =A0 =A0 =A0 = =A0(r211649) > +++ head/share/man/man4/rl.4 =A0 =A0Sun Aug 22 21:32:48 2010 =A0 =A0 =A0 = =A0(r211650) > @@ -30,7 +30,7 @@ > =A0.\" > =A0.\" $FreeBSD$ > =A0.\" > -.Dd November 1, 2008 > +.Dd August 22, 2010 > =A0.Dt RL 4 > =A0.Os > =A0.Sh NAME > @@ -203,6 +203,13 @@ SOHO (PRAGMATIC) UE-1211C > =A0.El > =A0.Sh LOADER TUNABLES > =A0.Bl -tag -width indent > +.It Va dev.rl.%unit.prefer_iomap > +This tunable controls which register mapping should be used on the > +specified device. > +Non-zero value enables I/O space register mapping. "Non-zero values enable" or "A non-zero value enables" is better. > +For controllers that have no I/O space register mapping this tunable > +should be set to 0 to use I/O space register mapping. This seems odd -- should this^^^ be memory instead of I/O? Thanks, Ben Kaduk > +The default value is 1 to use I/O space register mapping. > =A0.It Va dev.rl.%unit.twister_enable > =A0Non-zero value enables the long cable tuning on the specified device. > =A0Disabled by default. > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 00:10:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B543110656A4; Mon, 23 Aug 2010 00:10:43 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A4A938FC14; Mon, 23 Aug 2010 00:10:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7N0AhLL020931; Mon, 23 Aug 2010 00:10:43 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7N0AhwK020929; Mon, 23 Aug 2010 00:10:43 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008230010.o7N0AhwK020929@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 23 Aug 2010 00:10:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211667 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 00:10:43 -0000 Author: yongari Date: Mon Aug 23 00:10:43 2010 New Revision: 211667 URL: http://svn.freebsd.org/changeset/base/211667 Log: Better wording and fix wrong explanation. Submitted by: Ben Kaduk ( minimarmot <> gmail dot com ) Modified: head/share/man/man4/rl.4 Modified: head/share/man/man4/rl.4 ============================================================================== --- head/share/man/man4/rl.4 Sun Aug 22 23:31:16 2010 (r211666) +++ head/share/man/man4/rl.4 Mon Aug 23 00:10:43 2010 (r211667) @@ -206,9 +206,9 @@ SOHO (PRAGMATIC) UE-1211C .It Va dev.rl.%unit.prefer_iomap This tunable controls which register mapping should be used on the specified device. -Non-zero value enables I/O space register mapping. +A non-zero value enables I/O space register mapping. For controllers that have no I/O space register mapping this tunable -should be set to 0 to use I/O space register mapping. +should be set to 0 to use memory space register mapping. The default value is 1 to use I/O space register mapping. .It Va dev.rl.%unit.twister_enable Non-zero value enables the long cable tuning on the specified device. From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 00:11:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2747106564A; Mon, 23 Aug 2010 00:11:31 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-px0-f182.google.com (mail-px0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7C71C8FC14; Mon, 23 Aug 2010 00:11:30 +0000 (UTC) Received: by pxi17 with SMTP id 17so2313070pxi.13 for ; Sun, 22 Aug 2010 17:11:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=5jIK72dp8bhyGRKhF/MQ3igHB9+yzfS5jZ81r4husqo=; b=o0eTrmMfmd1EyoyRqHPvIy66lI5XTHkr4QmyFxwuImMyE5MnbHFWOLRORNKM28dPJ4 leJjwNBY1YPdV2t/VosjYB6bUdEXdjEaYr+o0CGmuuohNDv6pl3MGcU4K9tmX3vAtopn C8BBvpzfvn2zmZwu3tIr6+XhcJwOLWz/imLw4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=m8BEquqLTmnzIKsYYk8WBsLZwMtSH14KXgFCKT42aPmfjjyrC+RCMj/wjoY2F7+Nbm qk5BdPRLMMcoj1WXJ6Tp/SfxWLio2vA5nsSS5dTojdufN+XbvY2T5QwMFFZReLXM86Oe +1yRxXOGChENCikOJ6D4M1NnPyDFCWt3Wphlw= Received: by 10.142.48.18 with SMTP id v18mr3663031wfv.337.1282522290537; Sun, 22 Aug 2010 17:11:30 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id n2sm7684021wfl.1.2010.08.22.17.11.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 22 Aug 2010 17:11:29 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Sun, 22 Aug 2010 17:11:27 -0700 From: Pyun YongHyeon Date: Sun, 22 Aug 2010 17:11:27 -0700 To: Ben Kaduk Message-ID: <20100823001127.GA1094@michelle.cdnetworks.com> References: <201008222132.o7MLWmGT016845@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pyun YongHyeon Subject: Re: svn commit: r211650 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 00:11:32 -0000 On Sun, Aug 22, 2010 at 06:15:48PM -0400, Ben Kaduk wrote: > On Sun, Aug 22, 2010 at 5:32 PM, Pyun YongHyeon wrote: > > --- head/share/man/man4/rl.4 ? ?Sun Aug 22 21:27:15 2010 ? ? ? ?(r211649) > > +++ head/share/man/man4/rl.4 ? ?Sun Aug 22 21:32:48 2010 ? ? ? ?(r211650) > > @@ -30,7 +30,7 @@ > > ?.\" > > ?.\" $FreeBSD$ > > ?.\" > > -.Dd November 1, 2008 > > +.Dd August 22, 2010 > > ?.Dt RL 4 > > ?.Os > > ?.Sh NAME > > @@ -203,6 +203,13 @@ SOHO (PRAGMATIC) UE-1211C > > ?.El > > ?.Sh LOADER TUNABLES > > ?.Bl -tag -width indent > > +.It Va dev.rl.%unit.prefer_iomap > > +This tunable controls which register mapping should be used on the > > +specified device. > > +Non-zero value enables I/O space register mapping. > > "Non-zero values enable" or "A non-zero value enables" is better. > > > +For controllers that have no I/O space register mapping this tunable > > +should be set to 0 to use I/O space register mapping. > > This seems odd -- should this^^^ be memory instead of I/O? > Ah, you're right. Fixed in r211667. Thanks a lot for pointing out. From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 00:24:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B03C1065670; Mon, 23 Aug 2010 00:24:12 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FF2C8FC0A; Mon, 23 Aug 2010 00:24:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7N0OCu0021315; Mon, 23 Aug 2010 00:24:12 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7N0OCh0021313; Mon, 23 Aug 2010 00:24:12 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008230024.o7N0OCh0021313@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 23 Aug 2010 00:24:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211670 - head/sys/dev/xl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 00:24:12 -0000 Author: yongari Date: Mon Aug 23 00:24:12 2010 New Revision: 211670 URL: http://svn.freebsd.org/changeset/base/211670 Log: Clean up SIOCSIFCAP handler and allow RX checksum offloading could be controlled by user. Modified: head/sys/dev/xl/if_xl.c Modified: head/sys/dev/xl/if_xl.c ============================================================================== --- head/sys/dev/xl/if_xl.c Mon Aug 23 00:15:50 2010 (r211669) +++ head/sys/dev/xl/if_xl.c Mon Aug 23 00:24:12 2010 (r211670) @@ -3083,7 +3083,7 @@ xl_ioctl(struct ifnet *ifp, u_long comma { struct xl_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *) data; - int error = 0; + int error = 0, mask; struct mii_data *mii = NULL; u_int8_t rxfilt; @@ -3143,40 +3143,47 @@ xl_ioctl(struct ifnet *ifp, u_long comma &mii->mii_media, command); break; case SIOCSIFCAP: + mask = ifr->ifr_reqcap ^ ifp->if_capenable; #ifdef DEVICE_POLLING - if (ifr->ifr_reqcap & IFCAP_POLLING && - !(ifp->if_capenable & IFCAP_POLLING)) { - error = ether_poll_register(xl_poll, ifp); - if (error) - return(error); - XL_LOCK(sc); - /* Disable interrupts */ - CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_INTR_ENB|0); - ifp->if_capenable |= IFCAP_POLLING; - XL_UNLOCK(sc); - return (error); - } - if (!(ifr->ifr_reqcap & IFCAP_POLLING) && - ifp->if_capenable & IFCAP_POLLING) { - error = ether_poll_deregister(ifp); - /* Enable interrupts. */ - XL_LOCK(sc); - CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_INTR_ACK|0xFF); - CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_INTR_ENB|XL_INTRS); - if (sc->xl_flags & XL_FLAG_FUNCREG) - bus_space_write_4(sc->xl_ftag, sc->xl_fhandle, - 4, 0x8000); - ifp->if_capenable &= ~IFCAP_POLLING; - XL_UNLOCK(sc); - return (error); + if ((mask & IFCAP_POLLING) != 0 && + (ifp->if_capabilities & IFCAP_POLLING) != 0) { + ifp->if_capenable ^= IFCAP_POLLING; + if ((ifp->if_capenable & IFCAP_POLLING) != 0) { + error = ether_poll_register(xl_poll, ifp); + if (error) + break; + XL_LOCK(sc); + /* Disable interrupts */ + CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_INTR_ENB|0); + ifp->if_capenable |= IFCAP_POLLING; + XL_UNLOCK(sc); + } else { + error = ether_poll_deregister(ifp); + /* Enable interrupts. */ + XL_LOCK(sc); + CSR_WRITE_2(sc, XL_COMMAND, + XL_CMD_INTR_ACK | 0xFF); + CSR_WRITE_2(sc, XL_COMMAND, + XL_CMD_INTR_ENB | XL_INTRS); + if (sc->xl_flags & XL_FLAG_FUNCREG) + bus_space_write_4(sc->xl_ftag, + sc->xl_fhandle, 4, 0x8000); + XL_UNLOCK(sc); + } } #endif /* DEVICE_POLLING */ XL_LOCK(sc); - ifp->if_capenable = ifr->ifr_reqcap; - if (ifp->if_capenable & IFCAP_TXCSUM) - ifp->if_hwassist = XL905B_CSUM_FEATURES; - else - ifp->if_hwassist = 0; + if ((mask & IFCAP_TXCSUM) != 0 && + (ifp->if_capabilities & IFCAP_TXCSUM) != 0) { + ifp->if_capenable ^= IFCAP_TXCSUM; + if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) + ifp->if_hwassist |= XL905B_CSUM_FEATURES; + else + ifp->if_hwassist &= ~XL905B_CSUM_FEATURES; + } + if ((mask & IFCAP_RXCSUM) != 0 && + (ifp->if_capabilities & IFCAP_RXCSUM) != 0) + ifp->if_capenable ^= IFCAP_RXCSUM; XL_UNLOCK(sc); break; default: From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 00:31:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D9841065675; Mon, 23 Aug 2010 00:31:56 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0281D8FC12; Mon, 23 Aug 2010 00:31:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7N0Vtuh021485; Mon, 23 Aug 2010 00:31:55 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7N0VtbR021483; Mon, 23 Aug 2010 00:31:55 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008230031.o7N0VtbR021483@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 23 Aug 2010 00:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211671 - head/sys/dev/xl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 00:31:56 -0000 Author: yongari Date: Mon Aug 23 00:31:55 2010 New Revision: 211671 URL: http://svn.freebsd.org/changeset/base/211671 Log: Remove unnecessary controller reinitialization by checking IFF_DRV_RUNNING flag. Modified: head/sys/dev/xl/if_xl.c Modified: head/sys/dev/xl/if_xl.c ============================================================================== --- head/sys/dev/xl/if_xl.c Mon Aug 23 00:24:12 2010 (r211670) +++ head/sys/dev/xl/if_xl.c Mon Aug 23 00:31:55 2010 (r211671) @@ -2247,6 +2247,7 @@ xl_intr(void *arg) if (status & XL_STAT_ADFAIL) { xl_reset(sc); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; xl_init_locked(sc); } @@ -2318,6 +2319,7 @@ xl_poll_locked(struct ifnet *ifp, enum p if (status & XL_STAT_ADFAIL) { xl_reset(sc); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; xl_init_locked(sc); } @@ -2745,6 +2747,8 @@ xl_init_locked(struct xl_softc *sc) XL_LOCK_ASSERT(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; /* * Cancel pending I/O and free all RX/TX buffers. */ @@ -2993,6 +2997,7 @@ xl_ifmedia_upd(struct ifnet *ifp) if (sc->xl_media & XL_MEDIAOPT_MII || sc->xl_media & XL_MEDIAOPT_BTX || sc->xl_media & XL_MEDIAOPT_BT4) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; xl_init_locked(sc); } else { xl_setmode(sc, ifm->ifm_media); @@ -3108,10 +3113,8 @@ xl_ioctl(struct ifnet *ifp, u_long comma CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_RX_SET_FILT|rxfilt); XL_SEL_WIN(7); - } else { - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) - xl_init_locked(sc); - } + } else + xl_init_locked(sc); } else { if (ifp->if_drv_flags & IFF_DRV_RUNNING) xl_stop(sc); @@ -3234,6 +3237,7 @@ xl_watchdog(struct xl_softc *sc) "no carrier - transceiver cable problem?\n"); xl_reset(sc); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; xl_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { @@ -3364,8 +3368,10 @@ xl_resume(device_t dev) XL_LOCK(sc); xl_reset(sc); - if (ifp->if_flags & IFF_UP) + if (ifp->if_flags & IFF_UP) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; xl_init_locked(sc); + } XL_UNLOCK(sc); From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 01:07:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34669106566C; Mon, 23 Aug 2010 01:07:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 09FBC8FC14; Mon, 23 Aug 2010 01:07:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7N177YL022289; Mon, 23 Aug 2010 01:07:07 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7N177Ge022287; Mon, 23 Aug 2010 01:07:07 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008230107.o7N177Ge022287@svn.freebsd.org> From: Warner Losh Date: Mon, 23 Aug 2010 01:07:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211673 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 01:07:08 -0000 Author: imp Date: Mon Aug 23 01:07:07 2010 New Revision: 211673 URL: http://svn.freebsd.org/changeset/base/211673 Log: Minor tweak from tbemd Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Aug 23 00:52:52 2010 (r211672) +++ head/Makefile.inc1 Mon Aug 23 01:07:07 2010 (r211673) @@ -29,7 +29,6 @@ # obj depend all install clean cleandepend cleanobj .include - .include # We must do share/info early so that installation of info `dir' From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 01:33:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EE5A1065697; Mon, 23 Aug 2010 01:33:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D6E18FC13; Mon, 23 Aug 2010 01:33:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7N1XR0e022917; Mon, 23 Aug 2010 01:33:27 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7N1XRGs022914; Mon, 23 Aug 2010 01:33:27 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008230133.o7N1XRGs022914@svn.freebsd.org> From: Warner Losh Date: Mon, 23 Aug 2010 01:33:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211675 - head/sys/boot/arm/uboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 01:33:28 -0000 Author: imp Date: Mon Aug 23 01:33:27 2010 New Revision: 211675 URL: http://svn.freebsd.org/changeset/base/211675 Log: MF tbemd: differentiate between arm and armeb Added: head/sys/boot/arm/uboot/ldscript.armeb (contents, props changed) Modified: head/sys/boot/arm/uboot/Makefile Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Mon Aug 23 01:29:22 2010 (r211674) +++ head/sys/boot/arm/uboot/Makefile Mon Aug 23 01:33:27 2010 (r211675) @@ -77,7 +77,7 @@ CLEANFILES+= vers.c loader.help CFLAGS+= -ffreestanding -LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.arm +LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_ARCH} # Pull in common loader code .PATH: ${.CURDIR}/../../uboot/common Added: head/sys/boot/arm/uboot/ldscript.armeb ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/arm/uboot/ldscript.armeb Mon Aug 23 01:33:27 2010 (r211675) @@ -0,0 +1,134 @@ +/* $FreeBSD$ */ + +OUTPUT_FORMAT("elf32-bigarm", "elf32-bigarm", "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(_start) +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + . = 0x1000000 + SIZEOF_HEADERS; + .interp : { *(.interp) } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rela.text : + { *(.rela.text) *(.rela.gnu.linkonce.t*) } + .rela.data : + { *(.rela.data) *(.rela.gnu.linkonce.d*) } + .rela.rodata : + { *(.rela.rodata) *(.rela.gnu.linkonce.r*) } + .rela.got : { *(.rela.got) } + .rela.got1 : { *(.rela.got1) } + .rela.got2 : { *(.rela.got2) } + .rela.ctors : { *(.rela.ctors) } + .rela.dtors : { *(.rela.dtors) } + .rela.init : { *(.rela.init) } + .rela.fini : { *(.rela.fini) } + .rela.bss : { *(.rela.bss) } + .rela.plt : { *(.rela.plt) } + .rela.sdata : { *(.rela.sdata) } + .rela.sbss : { *(.rela.sbss) } + .rela.sdata2 : { *(.rela.sdata2) } + .rela.sbss2 : { *(.rela.sbss2) } + .text : + { + *(.text) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + } =0 + _etext = .; + PROVIDE (etext = .); + .init : { *(.init) } =0 + .fini : { *(.fini) } =0 + .rodata : { *(.rodata) *(.gnu.linkonce.r*) } + .rodata1 : { *(.rodata1) } + .sdata2 : { *(.sdata2) } + .sbss2 : { *(.sbss2) } + /* Adjust the address for the data segment to the next page up. */ + . = ((. + 0x1000) & ~(0x1000 - 1)); + .data : + { + *(.data) + *(.gnu.linkonce.d*) + CONSTRUCTORS + } + .data1 : { *(.data1) } + .got1 : { *(.got1) } + .dynamic : { *(.dynamic) } + /* Put .ctors and .dtors next to the .got2 section, so that the pointers + get relocated with -mrelocatable. Also put in the .fixup pointers. + The current compiler no longer needs this, but keep it around for 2.7.2 */ + PROVIDE (_GOT2_START_ = .); + .got2 : { *(.got2) } + PROVIDE (__CTOR_LIST__ = .); + .ctors : { *(.ctors) } + PROVIDE (__CTOR_END__ = .); + PROVIDE (__DTOR_LIST__ = .); + .dtors : { *(.dtors) } + PROVIDE (__DTOR_END__ = .); + PROVIDE (_FIXUP_START_ = .); + .fixup : { *(.fixup) } + PROVIDE (_FIXUP_END_ = .); + PROVIDE (_GOT2_END_ = .); + PROVIDE (_GOT_START_ = .); + .got : { *(.got) } + .got.plt : { *(.got.plt) } + PROVIDE (_GOT_END_ = .); + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + .sdata : { *(.sdata) } + _edata = .; + PROVIDE (edata = .); + .sbss : + { + PROVIDE (__sbss_start = .); + *(.sbss) + *(.scommon) + *(.dynsbss) + PROVIDE (__sbss_end = .); + } + .plt : { *(.plt) } + .bss : + { + PROVIDE (__bss_start = .); + *(.dynbss) + *(.bss) + *(COMMON) + } + _end = . ; + PROVIDE (end = .); + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + /* These must appear regardless of . */ +} From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 01:37:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C643106566C; Mon, 23 Aug 2010 01:37:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BF558FC1F; Mon, 23 Aug 2010 01:37:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7N1btZv023029; Mon, 23 Aug 2010 01:37:55 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7N1bt11023027; Mon, 23 Aug 2010 01:37:55 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008230137.o7N1bt11023027@svn.freebsd.org> From: Warner Losh Date: Mon, 23 Aug 2010 01:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211676 - head/sys/boot/arm/uboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 01:37:56 -0000 Author: imp Date: Mon Aug 23 01:37:55 2010 New Revision: 211676 URL: http://svn.freebsd.org/changeset/base/211676 Log: It turns out that the OUTPUT_FORMAT should do the right thing for both endians... Deleted: head/sys/boot/arm/uboot/ldscript.armeb Modified: head/sys/boot/arm/uboot/Makefile Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Mon Aug 23 01:33:27 2010 (r211675) +++ head/sys/boot/arm/uboot/Makefile Mon Aug 23 01:37:55 2010 (r211676) @@ -77,7 +77,7 @@ CLEANFILES+= vers.c loader.help CFLAGS+= -ffreestanding -LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_ARCH} +LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH} # Pull in common loader code .PATH: ${.CURDIR}/../../uboot/common From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 01:42:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6F2810656A3; Mon, 23 Aug 2010 01:42:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 94EA68FC17; Mon, 23 Aug 2010 01:42:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7N1g9hQ023146; Mon, 23 Aug 2010 01:42:09 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7N1g92E023137; Mon, 23 Aug 2010 01:42:09 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008230142.o7N1g92E023137@svn.freebsd.org> From: Warner Losh Date: Mon, 23 Aug 2010 01:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211677 - in head/sys/boot/i386: . boot2 gptboot gptzfsboot libfirewire libi386 loader zfsboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 01:42:09 -0000 Author: imp Date: Mon Aug 23 01:42:09 2010 New Revision: 211677 URL: http://svn.freebsd.org/changeset/base/211677 Log: MF tbemd: Minor tweaks, prefer MACHINE_CPUARCH generally to MACHINE_ARCH Modified: head/sys/boot/i386/Makefile.inc head/sys/boot/i386/boot2/Makefile head/sys/boot/i386/gptboot/Makefile head/sys/boot/i386/gptzfsboot/Makefile head/sys/boot/i386/libfirewire/Makefile head/sys/boot/i386/libi386/Makefile head/sys/boot/i386/loader/Makefile head/sys/boot/i386/zfsboot/Makefile Modified: head/sys/boot/i386/Makefile.inc ============================================================================== --- head/sys/boot/i386/Makefile.inc Mon Aug 23 01:37:55 2010 (r211676) +++ head/sys/boot/i386/Makefile.inc Mon Aug 23 01:42:09 2010 (r211677) @@ -9,7 +9,7 @@ CFLAGS+= -ffreestanding -mpreferred-stac -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 LDFLAGS+= -nostdlib -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -m32 -march=i386 LDFLAGS+= -m elf_i386_fbsd AFLAGS+= --32 Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Mon Aug 23 01:37:55 2010 (r211676) +++ head/sys/boot/i386/boot2/Makefile Mon Aug 23 01:42:09 2010 (r211677) @@ -99,7 +99,7 @@ boot2.h: boot1.out ORG1=`printf "%d" ${ORG1}` \ REL1=`printf "%d" ${REL1}` > ${.TARGET} -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" beforedepend boot2.s: machine CLEANFILES+= machine machine: Modified: head/sys/boot/i386/gptboot/Makefile ============================================================================== --- head/sys/boot/i386/gptboot/Makefile Mon Aug 23 01:37:55 2010 (r211676) +++ head/sys/boot/i386/gptboot/Makefile Mon Aug 23 01:42:09 2010 (r211677) @@ -67,7 +67,7 @@ gptboot.out: ${BTXCRT} gptboot.o sio.o gptboot.o: ${.CURDIR}/../../common/ufsread.c -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" beforedepend gptboot.o: machine CLEANFILES+= machine machine: Modified: head/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- head/sys/boot/i386/gptzfsboot/Makefile Mon Aug 23 01:37:55 2010 (r211676) +++ head/sys/boot/i386/gptzfsboot/Makefile Mon Aug 23 01:42:09 2010 (r211677) @@ -64,7 +64,7 @@ gptzfsboot.out: ${BTXCRT} zfsboot.o sio. zfsboot.o: ${.CURDIR}/../../zfs/zfsimpl.c -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" beforedepend zfsboot.o: machine CLEANFILES+= machine machine: Modified: head/sys/boot/i386/libfirewire/Makefile ============================================================================== --- head/sys/boot/i386/libfirewire/Makefile Mon Aug 23 01:37:55 2010 (r211676) +++ head/sys/boot/i386/libfirewire/Makefile Mon Aug 23 01:42:09 2010 (r211677) @@ -16,7 +16,7 @@ CFLAGS+= -I${.CURDIR}/../libi386 CFLAGS+= -Wformat -Wall -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" CLEANFILES+= machine machine: ln -sf ${.CURDIR}/../../../i386/include machine @@ -24,7 +24,7 @@ machine: .include -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" beforedepend ${OBJS}: machine .endif Modified: head/sys/boot/i386/libi386/Makefile ============================================================================== --- head/sys/boot/i386/libi386/Makefile Mon Aug 23 01:37:55 2010 (r211676) +++ head/sys/boot/i386/libi386/Makefile Mon Aug 23 01:42:09 2010 (r211677) @@ -53,7 +53,7 @@ CFLAGS+= -I${.CURDIR}/../../common -I${. # the location of libstand CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" CLEANFILES+= machine machine: ln -sf ${.CURDIR}/../../../i386/include machine @@ -61,6 +61,6 @@ machine: .include -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" beforedepend ${OBJS}: machine .endif Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Mon Aug 23 01:37:55 2010 (r211676) +++ head/sys/boot/i386/loader/Makefile Mon Aug 23 01:42:09 2010 (r211677) @@ -119,7 +119,7 @@ LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZF .include -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" beforedepend ${OBJS}: machine CLEANFILES+= machine machine: Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Mon Aug 23 01:37:55 2010 (r211676) +++ head/sys/boot/i386/zfsboot/Makefile Mon Aug 23 01:42:09 2010 (r211677) @@ -98,7 +98,7 @@ zfsboot.h: zfsldr.out ORG1=`printf "%d" ${ORG1}` \ REL1=`printf "%d" ${REL1}` > ${.TARGET} -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" beforedepend zfsboot.s: machine CLEANFILES+= machine machine: From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 01:43:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E6C010656A4; Mon, 23 Aug 2010 01:43:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D6898FC0A; Mon, 23 Aug 2010 01:43:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7N1hl9b023210; Mon, 23 Aug 2010 01:43:47 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7N1hlvX023207; Mon, 23 Aug 2010 01:43:47 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008230143.o7N1hlvX023207@svn.freebsd.org> From: Warner Losh Date: Mon, 23 Aug 2010 01:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211678 - in head/sys/boot: common ficl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 01:43:47 -0000 Author: imp Date: Mon Aug 23 01:43:47 2010 New Revision: 211678 URL: http://svn.freebsd.org/changeset/base/211678 Log: MF tbemd: Minor tweaks, prefer MACHINE_CPUARCH generally to MACHINE_ARCH (which simplifies some powerpc/powerpc64 ifs) Modified: head/sys/boot/common/Makefile.inc head/sys/boot/ficl/Makefile Modified: head/sys/boot/common/Makefile.inc ============================================================================== --- head/sys/boot/common/Makefile.inc Mon Aug 23 01:42:09 2010 (r211677) +++ head/sys/boot/common/Makefile.inc Mon Aug 23 01:43:47 2010 (r211678) @@ -4,17 +4,17 @@ SRCS+= boot.c commands.c console.c devop SRCS+= interp_backslash.c interp_parse.c ls.c misc.c SRCS+= module.c panic.c -.if ${MACHINE} == "i386" || ${MACHINE_ARCH} == "amd64" +.if ${MACHINE} == "i386" || ${MACHINE_CPUARCH} == "amd64" SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c SRCS+= load_elf64.c load_elf64_obj.c reloc_elf64.c .elif ${MACHINE} == "pc98" SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c -.elif ${MACHINE_ARCH} == "arm" +.elif ${MACHINE_ARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" SRCS+= load_elf32.c reloc_elf32.c -.elif ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" +.elif ${MACHINE_CPUARCH} == "powerpc" SRCS+= load_elf32.c reloc_elf32.c SRCS+= load_elf64.c reloc_elf64.c -.elif ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "ia64" +.elif ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "ia64" SRCS+= load_elf64.c reloc_elf64.c .endif Modified: head/sys/boot/ficl/Makefile ============================================================================== --- head/sys/boot/ficl/Makefile Mon Aug 23 01:42:09 2010 (r211677) +++ head/sys/boot/ficl/Makefile Mon Aug 23 01:43:47 2010 (r211678) @@ -1,20 +1,20 @@ # $FreeBSD$ # -.PATH: ${.CURDIR}/${MACHINE_ARCH:S/amd64/i386/:S/powerpc64/powerpc/} +.PATH: ${.CURDIR}/${MACHINE_CPUARCH:S/amd64/i386/} BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c math64.c \ prefix.c search.c stack.c tools.c vm.c words.c SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES= softcore.c testmain testmain.o CFLAGS+= -ffreestanding -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 .endif -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" CFLAGS+= -mno-sse3 .endif -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "arm" +.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" CFLAGS+= -msoft-float .endif .if ${MACHINE} == "pc98" @@ -41,7 +41,7 @@ SOFTWORDS= softcore.fr jhlocal.fr marker # Optional OO extension softwords #SOFTWORDS+= oo.fr classes.fr -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -m32 -march=i386 -I. .endif @@ -49,14 +49,14 @@ CFLAGS+= -m32 -march=i386 -I. CFLAGS+= -m32 -mcpu=powerpc -I. .endif -CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${MACHINE_ARCH:S/amd64/i386/:S/powerpc64/powerpc/} \ +CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${MACHINE_CPUARCH:S/amd64/i386/} \ -I${.CURDIR}/../common softcore.c: ${SOFTWORDS} softcore.awk (cd ${.CURDIR}/softwords; cat ${SOFTWORDS} \ | awk -f softcore.awk -v datestamp="`LC_ALL=C date`") > ${.TARGET} -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" ${SRCS:M*.c:R:S/$/.o/g}: machine beforedepend ${OBJS}: machine From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 01:46:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52D351065672; Mon, 23 Aug 2010 01:46:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id DE2878FC15; Mon, 23 Aug 2010 01:46:38 +0000 (UTC) Received: from c122-107-127-123.carlnfd1.nsw.optusnet.com.au (c122-107-127-123.carlnfd1.nsw.optusnet.com.au [122.107.127.123]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o7N1k6sw027805 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 23 Aug 2010 11:46:09 +1000 Date: Mon, 23 Aug 2010 11:46:06 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Dimitry Andric In-Reply-To: <4C6FDBCF.6070101@andric.com> Message-ID: <20100823111937.D21446@delplex.bde.org> References: <201008191259.o7JCxv3i004613@svn.freebsd.org> <20100820075236.L18914@delplex.bde.org> <4C6DC0F8.9040001@andric.com> <20100821054033.M19850@delplex.bde.org> <4C6FDBCF.6070101@andric.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo , Bruce Evans Subject: Re: svn commit: r211505 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 01:46:39 -0000 On Sat, 21 Aug 2010, Dimitry Andric wrote: > On 2010-08-20 22:36, Bruce Evans wrote: >> On Fri, 20 Aug 2010, Dimitry Andric wrote: > [...] >>> But will the casts not potentially hide problems, if you pass the wrong >>> types to those macros? Maybe it is better if the compiler complains >>> that some argument is of an incompatible type, than just forcing it to >>> cast? >> This is unclear. All integer types are compatible to some extent. >> Upcasting them always works and downcasting them works iff the value >> is not changed. Rui Paulo wrote in a another reply: > I think he meant that downcasting might not work. Yes, but note that for function calls with a prototype in scope, conversion always occurs and no dignostic is required for the dangerous downcasting (or sidecasting with a sign change?) cases. It is only with raw macros or raw asms that you even have a chance to see the original type in the callee. I guess my argument is essentially that since the original code wants to cast everything so as to get almost function call protocol for the macros, we shouldn't change this, except for the lvalues where using function calls would have made the bug obvious. > I meant this in the context of this llvm PR, about matching inline asm > input constraints with output constraints of an incompatible type: > > http://llvm.org/bugs/show_bug.cgi?id=3373 > > Clang is currently somewhat pickier about the arguments to inline asm, > which we also noticed in OpenSSL code, where a rotate-left macro is > defined (for i386 and amd64) as: > > # define ROTATE(a,n) ({ register unsigned int ret; \ > asm ( \ > "roll %1,%0" \ > : "=r"(ret) \ > : "I"(n), "0"(a) \ > : "cc"); \ > ret; \ > }) > > On amd64, it was being called with the 'a' argument being of unsigned > long type. Clang complained: > > crypto/openssl/crypto/md4/md4_dgst.c:117:2: > error: unsupported inline asm: input with type 'unsigned long' matching > output with type 'unsigned int' > R0(A,B,C,D,X( 0), 3,0); HOST_c2l(data,l); X( 2)=l; > ^~~~~~~~~~~~~~~~~~~~~~ > > In this case, the OpenSSL developers chose to explicitly cast 'a' to > 'unsigned int' (see ). Slightly wrong, since you want a macro named ROTATE() to be type-generic, but this one just doesn't work for 64-bit unsigned longs (and without the cast it may be be broken for [u_]chars and [u_]shorts) (and with the cast it is probably broken for signed chars and signed shorts with a negative value). But the authors may know that they only use it on 32-bit values. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 01:48:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E97E106566C; Mon, 23 Aug 2010 01:48:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D9BE8FC08; Mon, 23 Aug 2010 01:48:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7N1m7lH023347; Mon, 23 Aug 2010 01:48:07 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7N1m7rx023337; Mon, 23 Aug 2010 01:48:07 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008230148.o7N1m7rx023337@svn.freebsd.org> From: Warner Losh Date: Mon, 23 Aug 2010 01:48:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211679 - in head/sys/boot: . efi/libefi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 01:48:07 -0000 Author: imp Date: Mon Aug 23 01:48:07 2010 New Revision: 211679 URL: http://svn.freebsd.org/changeset/base/211679 Log: MF tbemd: move to using specific architecture makefiles Added: head/sys/boot/Makefile.amd64 (contents, props changed) head/sys/boot/Makefile.arm (contents, props changed) head/sys/boot/Makefile.i386 (contents, props changed) head/sys/boot/Makefile.ia64 (contents, props changed) head/sys/boot/Makefile.pc98 (contents, props changed) head/sys/boot/Makefile.powerpc (contents, props changed) head/sys/boot/Makefile.sparc64 (contents, props changed) Modified: head/sys/boot/Makefile head/sys/boot/efi/libefi/Makefile Modified: head/sys/boot/Makefile ============================================================================== --- head/sys/boot/Makefile Mon Aug 23 01:43:47 2010 (r211678) +++ head/sys/boot/Makefile Mon Aug 23 01:48:07 2010 (r211679) @@ -1,31 +1,13 @@ # $FreeBSD$ .include +.include .if ${MK_FORTH} != "no" # Build the add-in FORTH interpreter. SUBDIR+= ficl .endif -# Build EFI library. -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE} == "i386" || ${MACHINE_ARCH} == "ia64" -SUBDIR+= efi -.endif - -# Build Open Firmware library. -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "sparc64" -SUBDIR+= ofw -.endif - -# Build U-Boot library. -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "arm" -SUBDIR+= uboot -.endif - -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE} == "i386" -SUBDIR+= zfs -.endif - .if ${MK_FDT} != "no" SUBDIR+= fdt .endif Added: head/sys/boot/Makefile.amd64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/Makefile.amd64 Mon Aug 23 01:48:07 2010 (r211679) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +SUBDIR+= efi +SUBDIR+= zfs Added: head/sys/boot/Makefile.arm ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/Makefile.arm Mon Aug 23 01:48:07 2010 (r211679) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +SUBDIR+= uboot Added: head/sys/boot/Makefile.i386 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/Makefile.i386 Mon Aug 23 01:48:07 2010 (r211679) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +SUBDIR+= efi +SUBDIR+= zfs Added: head/sys/boot/Makefile.ia64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/Makefile.ia64 Mon Aug 23 01:48:07 2010 (r211679) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +SUBDIR+= efi Added: head/sys/boot/Makefile.pc98 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/Makefile.pc98 Mon Aug 23 01:48:07 2010 (r211679) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +# Blank, to override Makefile.i386 since Makefile.$MACHINE is included before +# Makefile.$MACHINE_ARCH Added: head/sys/boot/Makefile.powerpc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/Makefile.powerpc Mon Aug 23 01:48:07 2010 (r211679) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +SUBDIR+= ofw +SUBDIR+= uboot Added: head/sys/boot/Makefile.sparc64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/Makefile.sparc64 Mon Aug 23 01:48:07 2010 (r211679) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +SUBDIR+= ofw Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Mon Aug 23 01:43:47 2010 (r211678) +++ head/sys/boot/efi/libefi/Makefile Mon Aug 23 01:48:07 2010 (r211679) @@ -7,7 +7,7 @@ SRCS= delay.c efi_console.c efinet.c efi libefi.c time.c CFLAGS+= -I${.CURDIR}/../include -CFLAGS+= -I${.CURDIR}/../include/${MACHINE_ARCH:S/amd64/i386/} +CFLAGS+= -I${.CURDIR}/../include/${MACHINE_CPUARCH:S/amd64/i386/} CFLAGS+= -I${.CURDIR}/../../../../lib/libstand # Pick up the bootstrap header for some interface items From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 01:50:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F5881065773; Mon, 23 Aug 2010 01:50:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D3C78FC0A; Mon, 23 Aug 2010 01:50:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7N1oYEl023433; Mon, 23 Aug 2010 01:50:34 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7N1oYe6023426; Mon, 23 Aug 2010 01:50:34 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008230150.o7N1oYe6023426@svn.freebsd.org> From: Warner Losh Date: Mon, 23 Aug 2010 01:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211680 - in head/sys/boot: ia64/common ia64/efi ia64/ski ofw/libofw uboot/lib zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 01:50:35 -0000 Author: imp Date: Mon Aug 23 01:50:34 2010 New Revision: 211680 URL: http://svn.freebsd.org/changeset/base/211680 Log: MF tbemd: Minor tweaks, prefer MACHINE_CPUARCH generally to MACHINE_ARCH (which simplifies some powerpc/powerpc64 ifs) Modified: head/sys/boot/ia64/common/Makefile head/sys/boot/ia64/efi/Makefile head/sys/boot/ia64/ski/Makefile head/sys/boot/ofw/libofw/Makefile head/sys/boot/uboot/lib/Makefile head/sys/boot/zfs/Makefile Modified: head/sys/boot/ia64/common/Makefile ============================================================================== --- head/sys/boot/ia64/common/Makefile Mon Aug 23 01:48:07 2010 (r211679) +++ head/sys/boot/ia64/common/Makefile Mon Aug 23 01:50:34 2010 (r211680) @@ -9,7 +9,7 @@ INTERNALLIB= SRCS= autoload.c bootinfo.c copy.c devicename.c exec.c CFLAGS+= -I${.CURDIR}/../../efi/include -CFLAGS+= -I${.CURDIR}/../../efi/include/${MACHINE_ARCH} +CFLAGS+= -I${.CURDIR}/../../efi/include/${MACHINE_CPUARCH} CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -I${.CURDIR}/../../../../lib/libstand @@ -17,7 +17,7 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li BOOT_FORTH= yes CFLAGS+= -DBOOT_FORTH CFLAGS+= -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/${MACHINE_ARCH} +CFLAGS+= -I${.CURDIR}/../../ficl/${MACHINE_CPUARCH} .endif .PATH: ${.CURDIR}/../../common Modified: head/sys/boot/ia64/efi/Makefile ============================================================================== --- head/sys/boot/ia64/efi/Makefile Mon Aug 23 01:48:07 2010 (r211679) +++ head/sys/boot/ia64/efi/Makefile Mon Aug 23 01:50:34 2010 (r211680) @@ -9,21 +9,21 @@ PROG= loader.sym INTERNALPROG= SRCS= conf.c efimd.c main.c pal.S start.S vers.c -.PATH: ${.CURDIR}/../../../${MACHINE_ARCH}/${MACHINE_ARCH} +.PATH: ${.CURDIR}/../../../${MACHINE_CPUARCH}/${MACHINE_CPUARCH} CFLAGS+= -I${.CURDIR}/../common CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I${.CURDIR}/../../efi/include -CFLAGS+= -I${.CURDIR}/../../efi/include/${MACHINE_ARCH} +CFLAGS+= -I${.CURDIR}/../../efi/include/${MACHINE_CPUARCH} CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -I${.CURDIR}/../../../../lib/libstand -LDSCRIPT= ${.CURDIR}/ldscript.${MACHINE_ARCH} +LDSCRIPT= ${.CURDIR}/ldscript.${MACHINE_CPUARCH} LDFLAGS= -Wl,-T${LDSCRIPT} -shared -symbolic ${PROG}: ${LDSCRIPT} -NEWVERSWHAT= "EFI boot" ${MACHINE_ARCH} +NEWVERSWHAT= "EFI boot" ${MACHINE_CPUARCH} vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} @@ -42,7 +42,7 @@ loader.efi: loader.sym fi ${OBJCOPY} -j .data -j .dynamic -j .dynstr -j .dynsym -j .hash \ -j .rela.dyn -j .reloc -j .sdata -j .text \ - --target=efi-app-${MACHINE_ARCH} ${.ALLSRC} ${.TARGET} + --target=efi-app-${MACHINE_CPUARCH} ${.ALLSRC} ${.TARGET} CLEANFILES= vers.c loader.efi Modified: head/sys/boot/ia64/ski/Makefile ============================================================================== --- head/sys/boot/ia64/ski/Makefile Mon Aug 23 01:48:07 2010 (r211679) +++ head/sys/boot/ia64/ski/Makefile Mon Aug 23 01:50:34 2010 (r211680) @@ -17,10 +17,10 @@ CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -I${.CURDIR}/../../../../lib/libstand -LDSCRIPT= ${.CURDIR}/ldscript.${MACHINE_ARCH} +LDSCRIPT= ${.CURDIR}/ldscript.${MACHINE_CPUARCH} LDFLAGS= -Wl,-T${LDSCRIPT} -NEWVERSWHAT= "SKI boot" ${MACHINE_ARCH} +NEWVERSWHAT= "SKI boot" ${MACHINE_CPUARCH} vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} Modified: head/sys/boot/ofw/libofw/Makefile ============================================================================== --- head/sys/boot/ofw/libofw/Makefile Mon Aug 23 01:48:07 2010 (r211679) +++ head/sys/boot/ofw/libofw/Makefile Mon Aug 23 01:50:34 2010 (r211680) @@ -13,7 +13,7 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. CFLAGS+= -ffreestanding -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" +.if ${MACHINE_CPUARCH} == "powerpc" CFLAGS+= -msoft-float SRCS+= ppc64_elf_freebsd.c .endif @@ -24,7 +24,7 @@ CFLAGS+= -DDISK_DEBUG .endif machine: - ln -sf ${.CURDIR}/../../../${MACHINE_ARCH}/include machine + ln -sf ${.CURDIR}/../../../${MACHINE_CPUARCH}/include machine CLEANFILES+= machine Modified: head/sys/boot/uboot/lib/Makefile ============================================================================== --- head/sys/boot/uboot/lib/Makefile Mon Aug 23 01:48:07 2010 (r211679) +++ head/sys/boot/uboot/lib/Makefile Mon Aug 23 01:50:34 2010 (r211680) @@ -23,7 +23,7 @@ CFLAGS+= -DDISK_DEBUG .endif machine: - ln -sf ${.CURDIR}/../../../${MACHINE_ARCH}/include machine + ln -sf ${.CURDIR}/../../../${MACHINE_CPUARCH}/include machine CLEANFILES+= machine Modified: head/sys/boot/zfs/Makefile ============================================================================== --- head/sys/boot/zfs/Makefile Mon Aug 23 01:48:07 2010 (r211679) +++ head/sys/boot/zfs/Makefile Mon Aug 23 01:50:34 2010 (r211680) @@ -10,23 +10,23 @@ CFLAGS+= -I${.CURDIR}/../../../lib/libst CFLAGS+= -I${.CURDIR}/../../cddl/boot/zfs CFLAGS+= -ffreestanding -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 .endif -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" CFLAGS+= -mno-sse3 .endif -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "arm" +.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" CFLAGS+= -msoft-float .endif -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -m32 -march=i386 .endif CFLAGS+= -Wformat -Wall -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" CLEANFILES+= machine machine: ln -sf ${.CURDIR}/../../i386/include machine @@ -34,6 +34,6 @@ machine: .include -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" beforedepend ${OBJS}: machine .endif From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 05:33:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D794310656A3; Mon, 23 Aug 2010 05:33:31 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7C0A8FC15; Mon, 23 Aug 2010 05:33:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7N5XVgM028295; Mon, 23 Aug 2010 05:33:31 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7N5XVxa028293; Mon, 23 Aug 2010 05:33:31 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201008230533.o7N5XVxa028293@svn.freebsd.org> From: Brian Somers Date: Mon, 23 Aug 2010 05:33:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211684 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 05:33:31 -0000 Author: brian Date: Mon Aug 23 05:33:31 2010 New Revision: 211684 URL: http://svn.freebsd.org/changeset/base/211684 Log: uio_resid isn't updated by VOP_READDIR for nfs filesystems. Use the uio_offset adjustment instead to calculate a correct *len. Without this change, we run off the end of the directory data we're reading and panic horribly for nfs filesystems. MFC after: 1 week Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Mon Aug 23 05:33:20 2010 (r211683) +++ head/sys/kern/vfs_default.c Mon Aug 23 05:33:31 2010 (r211684) @@ -281,10 +281,9 @@ get_next_dirent(struct vnode *vp, struct if (error) return (error); - *off = uio.uio_offset; - *cpos = dirbuf; - *len = (dirbuflen - uio.uio_resid); + *len = uio.uio_offset - *off; + *off = uio.uio_offset; } dp = (struct dirent *)(*cpos); From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 06:13:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E29B31065694; Mon, 23 Aug 2010 06:13:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF3098FC1F; Mon, 23 Aug 2010 06:13:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7N6DTCe029363; Mon, 23 Aug 2010 06:13:29 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7N6DTGU029327; Mon, 23 Aug 2010 06:13:29 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008230613.o7N6DTGU029327@svn.freebsd.org> From: Warner Losh Date: Mon, 23 Aug 2010 06:13:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211690 - in head/sys/modules: . aac acpi/acpi agp amr asr bge cpufreq cxgb cyclic dtrace dtrace/dtrace dtrace/fasttrap hptmv hptrr hwpmc i2c/controllers/pcf io le linprocfs linsysfs li... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 06:13:30 -0000 Author: imp Date: Mon Aug 23 06:13:29 2010 New Revision: 211690 URL: http://svn.freebsd.org/changeset/base/211690 Log: MFtbemd: Use MACHINE_CPUARCH in preference to MACHINE_ARCH. The former is the source code location of the machine, the latter the binary output. In general, we want to use MACHINE_CPUARCH instead of MACHINE_ARCH unless we're tesitng for a specific target. The isn't even moot for i386/amd64 where there's momemntum towards a MACHINE_CPUARCH == x86, although a specific cleanup for that likely would be needed... Modified: head/sys/modules/Makefile head/sys/modules/aac/Makefile head/sys/modules/acpi/acpi/Makefile head/sys/modules/agp/Makefile head/sys/modules/amr/Makefile head/sys/modules/asr/Makefile head/sys/modules/bge/Makefile head/sys/modules/cpufreq/Makefile head/sys/modules/cxgb/Makefile head/sys/modules/cyclic/Makefile head/sys/modules/dtrace/Makefile head/sys/modules/dtrace/Makefile.inc head/sys/modules/dtrace/dtrace/Makefile head/sys/modules/dtrace/fasttrap/Makefile head/sys/modules/hptmv/Makefile head/sys/modules/hptrr/Makefile head/sys/modules/hwpmc/Makefile head/sys/modules/i2c/controllers/pcf/Makefile head/sys/modules/io/Makefile head/sys/modules/le/Makefile head/sys/modules/linprocfs/Makefile head/sys/modules/linsysfs/Makefile head/sys/modules/linux/Makefile head/sys/modules/mem/Makefile head/sys/modules/mfi/Makefile head/sys/modules/ndis/Makefile head/sys/modules/ppc/Makefile head/sys/modules/procfs/Makefile head/sys/modules/smbfs/Makefile head/sys/modules/sound/driver/Makefile head/sys/modules/svr4/Makefile head/sys/modules/syscons/Makefile head/sys/modules/uart/Makefile head/sys/modules/usb/Makefile head/sys/modules/vx/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -323,8 +323,8 @@ SUBDIR= ${_3dfx} \ ${_zfs} \ zlib \ -.if ${MACHINE_CPUARCH} != "powerpc" && ${MACHINE_ARCH} != "arm" && \ - ${MACHINE_ARCH} != "mips" +.if ${MACHINE_CPUARCH} != "powerpc" && ${MACHINE_CPUARCH} != "arm" && \ + ${MACHINE_CPUARCH} != "mips" _syscons= syscons _vpo= vpo .endif @@ -360,7 +360,7 @@ _pf= pf _pflog= pflog .endif -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" # XXX some of these can move to the general case when de-i386'ed # XXX some of these can move now, but are untested on other architectures. _3dfx= 3dfx @@ -500,7 +500,7 @@ _snc= snc .endif .endif -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" _aac= aac _acpi= acpi .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) @@ -590,7 +590,7 @@ _zfs= zfs .endif .endif -.if ${MACHINE_ARCH} == "ia64" +.if ${MACHINE_CPUARCH} == "ia64" _aac= aac _aic= aic _an= an @@ -647,7 +647,7 @@ _zfs= zfs .endif .endif -.if ${MACHINE_ARCH} == "sparc64" +.if ${MACHINE_CPUARCH} == "sparc64" _auxio= auxio _em= em _epic= epic Modified: head/sys/modules/aac/Makefile ============================================================================== --- head/sys/modules/aac/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/aac/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -2,7 +2,7 @@ .PATH: ${.CURDIR}/../../dev/aac -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SUBDIR= aac_linux .endif Modified: head/sys/modules/acpi/acpi/Makefile ============================================================================== --- head/sys/modules/acpi/acpi/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/acpi/acpi/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -1,6 +1,6 @@ # $FreeBSD$ -.if ${MACHINE_ARCH} == "ia64" +.if ${MACHINE_CPUARCH} == "ia64" .error "ACPI can only be compiled into the kernel on the ia64 platform" .endif @@ -22,7 +22,7 @@ ${.CURDIR}/../../../pci \ ${.CURDIR}/../../../dev/acpica \ ${.CURDIR}/../../../dev/acpica/Osd \ - ${.CURDIR}/../../../${MACHINE_ARCH}/acpica + ${.CURDIR}/../../../${MACHINE_CPUARCH}/acpica KMOD= acpi @@ -98,7 +98,10 @@ SRCS+= acpi_machdep.c acpi_wakecode.h ac SRCS+= assym.s madt.c CLEANFILES+= acpi_wakecode.bin acpi_wakecode.h acpi_wakecode.o -.if ${MACHINE_ARCH} == "amd64" +SRCS+= opt_global.h + +.if ${MACHINE_CPUARCH} == "amd64" +SRCS+= acpi_switch.S opt_global.h .if !defined(KERNBUILDDIR) CFLAGS+=-DSMP .endif @@ -119,8 +122,8 @@ acpi_wakedata.h: acpi_wakecode.o echo "#define $${what} 0x$${offset}"; done > ${.TARGET} .else acpi_wakecode.h: acpi_wakecode.S assym.s - ${MAKE} -f ${.CURDIR}/../../../${MACHINE_ARCH}/acpica/Makefile \ - MAKESRCPATH=${.CURDIR}/../../../${MACHINE_ARCH}/acpica + ${MAKE} -f ${.CURDIR}/../../../${MACHINE_CPUARCH}/acpica/Makefile \ + MAKESRCPATH=${.CURDIR}/../../../${MACHINE_CPUARCH}/acpica .endif .include Modified: head/sys/modules/agp/Makefile ============================================================================== --- head/sys/modules/agp/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/agp/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -4,14 +4,14 @@ KMOD= agp SRCS= agp.c agp_if.c -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= agp_i810.c agp_intel.c agp_via.c agp_sis.c agp_ali.c agp_amd.c \ agp_nvidia.c agp_ati.c .endif .if ${MACHINE} == "i386" SRCS+= agp_amd64.c .endif -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" SRCS+= agp_amd64.c agp_i810.c agp_via.c .endif SRCS+= device_if.h bus_if.h agp_if.h pci_if.h Modified: head/sys/modules/amr/Makefile ============================================================================== --- head/sys/modules/amr/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/amr/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../dev/amr SUBDIR= amr_cam -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" SUBDIR+= amr_linux .endif Modified: head/sys/modules/asr/Makefile ============================================================================== --- head/sys/modules/asr/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/asr/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -7,7 +7,7 @@ SRCS= asr.c SRCS+= opt_scsi.h opt_cam.h SRCS+= device_if.h bus_if.h pci_if.h -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= opt_asr.h .endif Modified: head/sys/modules/bge/Makefile ============================================================================== --- head/sys/modules/bge/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/bge/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -5,7 +5,7 @@ KMOD= if_bge SRCS= if_bge.c miibus_if.h miidevs.h device_if.h bus_if.h pci_if.h -.if ${MACHINE_ARCH} == sparc64 +.if ${MACHINE_CPUARCH} == sparc64 SRCS+= ofw_bus_if.h .endif Modified: head/sys/modules/cpufreq/Makefile ============================================================================== --- head/sys/modules/cpufreq/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/cpufreq/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -1,7 +1,7 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../../dev/cpufreq \ - ${.CURDIR}/../../${MACHINE_ARCH}/cpufreq + ${.CURDIR}/../../${MACHINE_CPUARCH}/cpufreq KMOD= cpufreq SRCS= ichss.c Modified: head/sys/modules/cxgb/Makefile ============================================================================== --- head/sys/modules/cxgb/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/cxgb/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -28,11 +28,11 @@ _toecore = toecore #_tom = tom .endif -.if ${MACHINE_ARCH} == "i386" && exists(${_toe_header}) +.if ${MACHINE_CPUARCH} == "i386" && exists(${_toe_header}) _iw_cxgb = iw_cxgb .endif -.if ${MACHINE_ARCH} == "amd64" && exists(${_toe_header}) +.if ${MACHINE_CPUARCH} == "amd64" && exists(${_toe_header}) _iw_cxgb = iw_cxgb .endif Modified: head/sys/modules/cyclic/Makefile ============================================================================== --- head/sys/modules/cyclic/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/cyclic/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -4,13 +4,13 @@ KMOD= cyclic SRCS= cyclic.c - + SRCS+= vnode_if.h CFLAGS+= -I${.CURDIR}/../../cddl/compat/opensolaris \ -I${.CURDIR}/../../cddl/contrib/opensolaris/uts/common \ -I${.CURDIR}/../.. \ - -I${.CURDIR}/../../cddl/dev/cyclic/${MACHINE_ARCH:S/amd64/i386/} + -I${.CURDIR}/../../cddl/dev/cyclic/${MACHINE_CPUARCH:S/amd64/i386/} CFLAGS+= -DDEBUG=1 Modified: head/sys/modules/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/dtrace/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -14,7 +14,7 @@ SUBDIR= dtmalloc \ sdt \ systrace -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" SUBDIR+= fbt .endif Modified: head/sys/modules/dtrace/Makefile.inc ============================================================================== --- head/sys/modules/dtrace/Makefile.inc Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/dtrace/Makefile.inc Mon Aug 23 06:13:29 2010 (r211690) @@ -5,7 +5,7 @@ IGNORE_PRAGMA= 1 load : -kldload cyclic -kldload dtrace -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" -kldload sdt -kldload lockstat -kldload fbt @@ -18,7 +18,7 @@ load : unload : -kldunload systrace -kldunload profile -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" -kldunload prototype -kldunload fbt -kldunload lockstat Modified: head/sys/modules/dtrace/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/dtrace/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/dtrace/dtrace/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -1,6 +1,6 @@ # $FreeBSD$ -ARCHDIR= ${MACHINE_ARCH} +ARCHDIR= ${MACHINE_CPUARCH} .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common/dtrace .PATH: ${.CURDIR}/../../../cddl/kern @@ -12,7 +12,7 @@ SRCS= dtrace.c \ dtrace_asm.S \ dtrace_subr.c -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" SRCS+= dis_tables.c \ instr_size.c .endif @@ -25,7 +25,7 @@ SRCS+= assym.s # These are needed for assym.s SRCS+= opt_compat.h opt_kstack_pages.h opt_nfs.h opt_hwpmc_hooks.h -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= opt_apic.h .endif Modified: head/sys/modules/dtrace/fasttrap/Makefile ============================================================================== --- head/sys/modules/dtrace/fasttrap/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/dtrace/fasttrap/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -10,7 +10,7 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \ -I${.CURDIR}/../../.. -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/intel .endif Modified: head/sys/modules/hptmv/Makefile ============================================================================== --- head/sys/modules/hptmv/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/hptmv/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -13,7 +13,7 @@ SRCS+= bus_if.h device_if.h pci_if.h SRCS+= mv.c entry.c ioctl.c hptproc.c gui_lib.c OBJS+= hptmvraid.o -.if $(MACHINE_ARCH) == "amd64" +.if $(MACHINE_CPUARCH) == "amd64" HPTMV_RAID_O = amd64-elf.raid.o.uu .else HPTMV_RAID_O = i386-elf.raid.o.uu @@ -48,5 +48,5 @@ DEBUGOPT += -DFOR_DEMO .endif CFLAGS = ${DEBUGOPT} - + .include Modified: head/sys/modules/hptrr/Makefile ============================================================================== --- head/sys/modules/hptrr/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/hptrr/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -9,6 +9,6 @@ SRCS+= hptrr_os_bsd.c hptrr_osm_bsd.c hp OBJS = hptrr_lib.o hptrr_lib.o: - uudecode -p < ${HPTRR}/$(MACHINE_ARCH)-elf.hptrr_lib.o.uu > hptrr_lib.o + uudecode -p < ${HPTRR}/$(MACHINE_CPUARCH)-elf.hptrr_lib.o.uu > hptrr_lib.o .include Modified: head/sys/modules/hwpmc/Makefile ============================================================================== --- head/sys/modules/hwpmc/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/hwpmc/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -8,23 +8,23 @@ KMOD= hwpmc SRCS= hwpmc_mod.c hwpmc_logging.c vnode_if.h -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" SRCS+= hwpmc_amd.c hwpmc_core.c hwpmc_intel.c hwpmc_piv.c hwpmc_tsc.c SRCS+= hwpmc_x86.c hwpmc_uncore.c SRCS+= device_if.h bus_if.h .endif -.if ${MACHINE_ARCH} == "arm" +.if ${MACHINE_CPUARCH} == "arm" SRCS+= hwpmc_arm.c .endif -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= hwpmc_amd.c hwpmc_core.c hwpmc_intel.c hwpmc_piv.c hwpmc_ppro.c SRCS+= hwpmc_pentium.c hwpmc_tsc.c hwpmc_x86.c hwpmc_uncore.c SRCS+= device_if.h bus_if.h .endif -.if ${MACHINE_ARCH} == "ia64" +.if ${MACHINE_CPUARCH} == "ia64" SRCS+= hwpmc_ia64.c .endif @@ -32,7 +32,7 @@ SRCS+= hwpmc_ia64.c SRCS+= hwpmc_powerpc.c .endif -.if ${MACHINE_ARCH} == "sparc64" +.if ${MACHINE_CPUARCH} == "sparc64" SRCS+= hwpmc_sparc64.c .endif Modified: head/sys/modules/i2c/controllers/pcf/Makefile ============================================================================== --- head/sys/modules/i2c/controllers/pcf/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/i2c/controllers/pcf/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -6,12 +6,12 @@ KMOD= pcf SRCS= ${envctrl} pcf.c ${pcf_ebus} ${pcf_isa} SRCS+= bus_if.h device_if.h iicbus_if.h ${isa_if} ${ofw_bus_if} -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" isa_if= isa_if.h pcf_isa= pcf_isa.c .endif -.if ${MACHINE_ARCH} == "sparc64" +.if ${MACHINE_CPUARCH} == "sparc64" envctrl= envctrl.c ofw_bus_if= ofw_bus_if.h pcf_ebus= pcf_ebus.c Modified: head/sys/modules/io/Makefile ============================================================================== --- head/sys/modules/io/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/io/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -1,7 +1,7 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../../dev/io -.PATH: ${.CURDIR}/../../${MACHINE_ARCH}/${MACHINE_ARCH} +.PATH: ${.CURDIR}/../../${MACHINE_CPUARCH}/${MACHINE_CPUARCH} KMOD= io SRCS= iodev.c io.c Modified: head/sys/modules/le/Makefile ============================================================================== --- head/sys/modules/le/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/le/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -7,7 +7,7 @@ SRCS= am7990.c am79900.c ${if_le_cbus} $ SRCS+= ${if_le_ledma} if_le_pci.c lance.c ${lebuffer_sbus} SRCS+= bus_if.h device_if.h ${isa_if} ${ofw_bus_if} pci_if.h -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" .if ${MACHINE} == "pc98" if_le_cbus= if_le_cbus.c .else Modified: head/sys/modules/linprocfs/Makefile ============================================================================== --- head/sys/modules/linprocfs/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/linprocfs/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -8,7 +8,7 @@ SRCS= vnode_if.h \ linprocfs.c \ opt_compat.h -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" CFLAGS+=-DCOMPAT_LINUX32 .endif Modified: head/sys/modules/linsysfs/Makefile ============================================================================== --- head/sys/modules/linsysfs/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/linsysfs/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -8,7 +8,7 @@ SRCS= vnode_if.h \ linsysfs.c \ opt_compat.h -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" CFLAGS+=-DCOMPAT_LINUX32 .endif Modified: head/sys/modules/linux/Makefile ============================================================================== --- head/sys/modules/linux/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/linux/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -1,11 +1,11 @@ # $FreeBSD$ -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" SFX= 32 CFLAGS+=-DCOMPAT_FREEBSD32 -DCOMPAT_LINUX32 .endif -.PATH: ${.CURDIR}/../../compat/linux ${.CURDIR}/../../${MACHINE_ARCH}/linux${SFX} +.PATH: ${.CURDIR}/../../compat/linux ${.CURDIR}/../../${MACHINE_CPUARCH}/linux${SFX} KMOD= linux SRCS= linux${SFX}_dummy.c linux_emul.c linux_file.c \ @@ -18,13 +18,13 @@ SRCS= linux${SFX}_dummy.c linux_emul.c l # XXX: for assym.s SRCS+= opt_kstack_pages.h opt_nfs.h opt_compat.h opt_hwpmc_hooks.h -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= opt_apic.h .endif OBJS= linux${SFX}_locore.o linux${SFX}_support.o -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= linux_ptrace.c imgact_linux.c opt_cpu.h .endif Modified: head/sys/modules/mem/Makefile ============================================================================== --- head/sys/modules/mem/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/mem/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -2,17 +2,17 @@ .PATH: ${.CURDIR}/../../dev/mem .PATH: ${.CURDIR}/../../${MACHINE}/${MACHINE} -.PATH: ${.CURDIR}/../../${MACHINE_ARCH}/${MACHINE_ARCH} +.PATH: ${.CURDIR}/../../${MACHINE_CPUARCH}/${MACHINE_CPUARCH} KMOD= mem SRCS= memdev.c mem.c -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" SRCS+= memutil.c .endif -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= i686_mem.c k6_mem.c .endif -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" SRCS+= amd64_mem.c .endif SRCS+= bus_if.h device_if.h Modified: head/sys/modules/mfi/Makefile ============================================================================== --- head/sys/modules/mfi/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/mfi/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -4,7 +4,7 @@ SUBDIR= mfip -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" SUBDIR+= mfi_linux .endif Modified: head/sys/modules/ndis/Makefile ============================================================================== --- head/sys/modules/ndis/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/ndis/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -8,11 +8,11 @@ SRCS+= kern_windrv.c subr_usbd.c SRCS+= device_if.h bus_if.h pci_if.h vnode_if.h SRCS+= opt_bus.h opt_usb.h usb_if.h usbdevs.h -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" SRCS+= winx64_wrap.S .endif -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= winx32_wrap.S .endif Modified: head/sys/modules/ppc/Makefile ============================================================================== --- head/sys/modules/ppc/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/ppc/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -6,18 +6,18 @@ SRCS= bus_if.h device_if.h ppbus_if.h is opt_ppc.h opt_isa.h \ ppc.c ppc_pci.c ppc_puc.c -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" SRCS+= ppc_acpi.c ppc_isa.c .endif -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" .if ${MACHINE} != "pc98" SRCS+= ppc_acpi.c .endif SRCS+= ppc_isa.c .endif -.if ${MACHINE_ARCH} == "ia64" +.if ${MACHINE_CPUARCH} == "ia64" SRCS+= ppc_acpi.c .endif Modified: head/sys/modules/procfs/Makefile ============================================================================== --- head/sys/modules/procfs/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/procfs/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -34,7 +34,7 @@ opt_compat.h: echo "#define COMPAT_FREEBSD4 1" >> ${.TARGET} echo "#define COMPAT_FREEBSD5 1" >> ${.TARGET} echo "#define COMPAT_FREEBSD6 1" >> ${.TARGET} -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" echo "#define COMPAT_FREEBSD32 1" >> ${.TARGET} echo "#define COMPAT_LINUX32 1" >> ${.TARGET} .endif Modified: head/sys/modules/smbfs/Makefile ============================================================================== --- head/sys/modules/smbfs/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/smbfs/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -1,7 +1,7 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../../crypto/des \ - ${.CURDIR}/../../crypto/des/arch/${MACHINE_ARCH} \ + ${.CURDIR}/../../crypto/des/arch/${MACHINE_CPUARCH} \ ${.CURDIR}/../../kern \ ${.CURDIR}/../../libkern \ ${.CURDIR}/../../netsmb \ @@ -21,7 +21,7 @@ SRCS= vnode_if.h \ # NETSMBCRYPTO SRCS+= des_ecb.c des_setkey.c -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= des_enc.S .else SRCS+= des_enc.c Modified: head/sys/modules/sound/driver/Makefile ============================================================================== --- head/sys/modules/sound/driver/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/sound/driver/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -5,11 +5,11 @@ SUBDIR+= envy24 envy24ht es137x ess fm80 SUBDIR+= neomagic sb16 sb8 sbc solo spicds t4dwave via8233 SUBDIR+= via82c686 vibes driver uaudio -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" SUBDIR+= cmi mss .endif -.if ${MACHINE_ARCH} == "sparc64" +.if ${MACHINE_CPUARCH} == "sparc64" .if ${MACHINE} == "sparc64" SUBDIR+= audiocs .endif Modified: head/sys/modules/svr4/Makefile ============================================================================== --- head/sys/modules/svr4/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/svr4/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../${MACHINE_ARCH}/svr4 ${.CURDIR}/../../compat/svr4 +.PATH: ${.CURDIR}/../../${MACHINE_CPUARCH}/svr4 ${.CURDIR}/../../compat/svr4 KMOD= svr4 SRCS= svr4_sysent.c svr4_sysvec.c opt_compat.h opt_svr4.h \ vnode_if.h imgact_svr4.c svr4_signal.c svr4_fcntl.c \ Modified: head/sys/modules/syscons/Makefile ============================================================================== --- head/sys/modules/syscons/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/syscons/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -14,11 +14,12 @@ SUBDIR= ${_apm} \ ${_star} \ ${_warp} -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" _apm= apm .endif -.if ${MACHINE_ARCH} != "sparc64" +.if ${MACHINE_CPUARCH} != "sparc64" +_beastie= beastie _beastie= beastie _daemon= daemon _dragon= dragon Modified: head/sys/modules/uart/Makefile ============================================================================== --- head/sys/modules/uart/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/uart/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -2,7 +2,7 @@ .PATH: ${.CURDIR}/../../dev/uart -.if ${MACHINE_ARCH} == "sparc64" +.if ${MACHINE_CPUARCH} == "sparc64" uart_bus_ebus= uart_bus_ebus.c ofw_bus_if= ofw_bus_if.h .endif Modified: head/sys/modules/usb/Makefile ============================================================================== --- head/sys/modules/usb/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/usb/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -35,16 +35,16 @@ SUBDIR += uether aue axe cdce cue kue ru SUBDIR += usfs umass urio SUBDIR += quirk template -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" _urtw= urtw .endif -.if ${MACHINE_ARCH} == "arm" +.if ${MACHINE_CPUARCH} == "arm" _at91dci= at91dci _atmegadci= atmegadci .endif -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" _urtw= urtw .endif Modified: head/sys/modules/vx/Makefile ============================================================================== --- head/sys/modules/vx/Makefile Mon Aug 23 06:06:55 2010 (r211689) +++ head/sys/modules/vx/Makefile Mon Aug 23 06:13:29 2010 (r211690) @@ -4,7 +4,7 @@ KMOD= if_vx SRCS= if_vx.c if_vx_pci.c -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= if_vx_eisa.c .endif SRCS+= device_if.h bus_if.h pci_if.h eisa_if.h From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 06:22:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 870D81065694; Mon, 23 Aug 2010 06:22:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 778DC8FC0C; Mon, 23 Aug 2010 06:22:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7N6MZli029822; Mon, 23 Aug 2010 06:22:35 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7N6MZnT029820; Mon, 23 Aug 2010 06:22:35 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008230622.o7N6MZnT029820@svn.freebsd.org> From: Warner Losh Date: Mon, 23 Aug 2010 06:22:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211695 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 06:22:35 -0000 Author: imp Date: Mon Aug 23 06:22:35 2010 New Revision: 211695 URL: http://svn.freebsd.org/changeset/base/211695 Log: This should really be MACHINE not MACHINE_ARCH, and is this Makefile even used? Modified: head/sys/kern/Makefile Modified: head/sys/kern/Makefile ============================================================================== --- head/sys/kern/Makefile Mon Aug 23 06:19:57 2010 (r211694) +++ head/sys/kern/Makefile Mon Aug 23 06:22:35 2010 (r211695) @@ -28,7 +28,7 @@ init_sysent.c syscalls.c systrace_args.c # are placed in each source directory. We need to have links to tags files # from the generic directories that are relative to the machine type, even # via remote mounts; therefore we use symlinks to $SYSTAGS, which points at -# ${SYSDIR}/${MACHINE_ARCH}/tags. +# ${SYSDIR}/${MACHINE}/tags. SYSTAGS=/var/db/sys_tags SYSDIR=/sys @@ -51,7 +51,7 @@ tags:: links:: rm -f ${SYSTAGS} - ln -s ${SYSDIR}/${MACHINE_ARCH}/tags ${SYSTAGS} + ln -s ${SYSDIR}/${MACHINE}/tags ${SYSTAGS} -for i in ${DGEN}; do \ (cd ../$$i && { rm -f tags; ln -s ${SYSTAGS} tags; }) done -for i in ${ARCH}; do \ From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 06:27:38 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03E9A10656A5; Mon, 23 Aug 2010 06:27:38 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 739798FC16; Mon, 23 Aug 2010 06:27:37 +0000 (UTC) Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.4/8.14.4) with ESMTP id o7N6RYBk087833; Mon, 23 Aug 2010 00:27:34 -0600 (MDT) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Scott Long In-Reply-To: <201008222126.o7MLQavY016669@svn.freebsd.org> Date: Mon, 23 Aug 2010 00:27:33 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <7C069EE9-33B9-4D57-A6E6-C133F6C47D53@samsco.org> References: <201008222126.o7MLQavY016669@svn.freebsd.org> To: Pyun YongHyeon X-Mailer: Apple Mail (2.1081) X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r211648 - head/sys/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 06:27:38 -0000 On Aug 22, 2010, at 3:26 PM, Pyun YongHyeon wrote: > Author: yongari > Date: Sun Aug 22 21:26:35 2010 > New Revision: 211648 > URL: http://svn.freebsd.org/changeset/base/211648 >=20 > Log: > It seems some newer RTL8139 controllers provides only memory space > register mapping. Something that I'm seeing more of in recent years is vendors putting = descriptive information into PCI VPD attributes, and having their = Windows and Linux drivers read these attributes and select behavior off = of them instead of selecting based on PCI ID. I don't have any RLT8139 = specs to confirm that this would be the case here, but it might be = something to consider looking into. Scott From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 06:32:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C13A91065694; Mon, 23 Aug 2010 06:32:01 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 358958FC16; Mon, 23 Aug 2010 06:32:00 +0000 (UTC) Received: by qwg5 with SMTP id 5so5383201qwg.13 for ; Sun, 22 Aug 2010 23:32:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=SKPP4JdBMQVw1dwZ/sDPaFuBO1TAcJZxP+qkcib4rNU=; b=Pb9rDloaXUDVnWhJVak8ZQipDDGcG/4u70xQag7Bxard07/81eoYUY6zxzxGheHGtk gR2uWwXTilHlNAreofWwnXE9CESJGJw7AqJa6S67buA7XdSSazlUEoPjpdmrA9fTfzed ve1gF49kBWRXxYnS0lNnqfKHJIZCkwy0wx1g4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Viq7AcoeiSSHcEE++44TWQMjMyJsj09Dzj8uDicNNCU9EBY7o6yQtTAnDsjywZ+ZF4 tU1mc0PTcpHenHXK3rFKS4LPOG4fs3TVD7bCegXcPrKD8eW56/kRl7Dcm056H26xgDtk VUa6+bKAtNFhTf+yhzYzPhDh639eN/VW4RkXs= MIME-Version: 1.0 Received: by 10.229.249.200 with SMTP id ml8mr3248897qcb.115.1282545120346; Sun, 22 Aug 2010 23:32:00 -0700 (PDT) Received: by 10.229.26.81 with HTTP; Sun, 22 Aug 2010 23:32:00 -0700 (PDT) In-Reply-To: <201008230622.o7N6MZnT029820@svn.freebsd.org> References: <201008230622.o7N6MZnT029820@svn.freebsd.org> Date: Mon, 23 Aug 2010 10:32:00 +0400 Message-ID: From: pluknet To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211695 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 06:32:01 -0000 On 23 August 2010 10:22, Warner Losh wrote: > Author: imp > Date: Mon Aug 23 06:22:35 2010 > New Revision: 211695 > URL: http://svn.freebsd.org/changeset/base/211695 > > Log: > =A0This should really be MACHINE not MACHINE_ARCH, and is this Makefile e= ven used? > Hi. I wrote this letter almost 2.5y ago with no response. Hope this helps. %%% I looked at sys/kern/ Makefile Make.tags.inc. AFAICS they were partially abandoned years ago and has broken tags support and even contain 4.4BSD-Lit= e paths, that never ever being in FreeBSD CVS or was dropped years ago. So ma= ke links exits with error. It looks very odd: pl$ make links rm -f /var/db/sys_tags ln -s /sys/i386/tags /var/db/sys_tags for i in conf dev dev/scsi fs fs/deadfs fs/fdescfs fs/fifofs fs/lofs fs/nullfs fs/portalfs fs/procfs fs/specfs fs/unionfs hp hp/dev hp/hpux kern libkern net netinet nfs scripts sys ufs ufs/ffs ufs/lfs ufs/ufs vm; do (cd ../$i && { rm -f tags; ln -s /var/db/sys_tags tags; }) done cd: can't cd to ../dev/scsi cd: can't cd to ../fs/lofs cd: can't cd to ../fs/specfs cd: can't cd to ../hp cd: can't cd to ../hp/dev cd: can't cd to ../hp/hpux cd: can't cd to ../scripts cd: can't cd to ../ufs/lfs for i in i386; do (cd ../$i && make SYSTAGS=3D/var/db/sys_tags links); do= ne for i in /sys/conf /sys/kern /sys/net /sys/netatalk /sys/netatm /sys/netinet /sys/netinet6 /sys/netipsec /sys/netipx /sys/netnatm /sys/nfs /sys/pci /sys/vm /sys/sys; do (cd $i && { rm -f tags; ln -s ../i386/tags tags; }) done for i in /sys/dev/advansys /sys/dev/aha /sys/dev/aic7xxx /sys/dev/buslogic /sys/dev/ccd /sys/dev/dec /sys/dev/dpt /sys/dev/en /sys/dev/hea /sys/dev/hfa /sys/dev/iicbus /sys/dev/isp /sys/dev/pdq /sys/dev/ppbus /sys/dev/smbus /sys/dev/vn /sys/dev/vx /sys/fs/deadfs /sys/fs/devfs /sys/fs/fdescfs /sys/fs/fifofs /sys/fs/msdosfs /sys/fs/nullfs /sys/fs/portalfs /sys/fs/procfs /sys /fs/specfs /sys/fs/unionfs /sys/fs/cd9660 /sys/ufs/ffs /sys/ufs/ufs; do (cd $i && { rm -f tags; ln -s ../../i386/tags tags; }) done cd: can't cd to /sys/dev/ccd cd: can't cd to /sys/dev/dec cd: can't cd to /sys/dev/hea cd: can't cd to /sys/dev/vn cd: can't cd to /sys/fs/specfs for i in apm i386 ibcs2 include isa linux; do (cd $i && { rm -f tags; ln -s ../tags tags; }) done cd: can't cd to apm I moved that two files from src and could complete build kernel without errors, so it seems they are not referenced by any kernel building tools. Yes, there is tags target in src/Makefile, I didn't looked too much how it interacts with Makefile Make.tags.inc, but by their erroneous paths I doubt there is any interaction. I found this in NetBSD's kern/Makefile: +# XXX +# [Note by Perry Metzger, Sept. 1998] +# As it stands, the tags support below is hopelessly +# broken. Just look at the names of the architectures it is dealing +# with and where it expects to find the support for them to see why. +# I've left the stuff in this Makefile alone in the hope that someone +# will fix it someday -- I am assuming that it might help that +# person if they have the old Makefile goo left in place as a starting +# point. +# XXX ps. BTW I tried to make tags from src/ (with clean obj, if that matters) and the target began to build my gcc (cc/cc_tools) after going through various world paths= . Is that intended? %%% --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 06:32:38 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2A1710656AA; Mon, 23 Aug 2010 06:32:38 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 556758FC12; Mon, 23 Aug 2010 06:32:38 +0000 (UTC) Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.4/8.14.4) with ESMTP id o7N6WYHv087862; Mon, 23 Aug 2010 00:32:34 -0600 (MDT) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Scott Long In-Reply-To: <4C718595.5050304@FreeBSD.org> Date: Mon, 23 Aug 2010 00:32:33 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20100821.191255.1023414010414033264.imp@bsdimp.com> <4C717990.6020601@FreeBSD.org> <20100822.134229.550118873867470111.imp@bsdimp.com> <4C718595.5050304@FreeBSD.org> To: Doug Barton X-Mailer: Apple Mail (2.1081) X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org Cc: src-committers@FreeBSD.org, rpaulo@FreeBSD.org, svn-src-all@FreeBSD.org, bz@FreeBSD.org, svn-src-head@FreeBSD.org, anchie@FreeBSD.org, "M. Warner Losh" Subject: Re: svn commit: r211501 - in head/sys: modules modules/send netinet netinet6 sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 06:32:38 -0000 On Aug 22, 2010, at 2:16 PM, Doug Barton wrote: > On 08/22/2010 12:42, M. Warner Losh wrote: >=20 >> I think you're drawing the wrong conclusion here. >=20 > Doubtful. :) >=20 >> My point is that we have trusted folks in the past to do the right >> thing, even when they don't say they will. >=20 > And my point, which I will make one last time, is that this model = hasn't worked. Yes, it works sometimes, but we still have a bunch of = stuff that doesn't have _any_ man page at all. If we want to continue = the transition to being a more professional OS that isn't acceptable. >=20 > I've already made the points about why working through the = documentation _before_ committing is valuable, and that the simple step = of requiring this is an easy way to make sure the problem we have = doesn't get any worse. Clearly there isn't a lot of sympathy for either = of these perspectives in the wider community, so c'est la vie. >=20 > But I was serious about my other comment, if you(pl.) are not willing = to make a change to improve the situation, you lose the right to = complain down the road when the man pages don't magically appear. >=20 >> towards Ann >=20 > Wrong name. :) >=20 Doug, you're being a grade-A asshole in this entire discussion. The = merits of your argument are being completely overshadowed by your = patronizing attitude and over the top straw-man extremism. Ana deserves = an apology from you, and you would do well to consider apologizing to = everyone involved. Scott From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 07:00:57 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 3EB0C10656A9; Mon, 23 Aug 2010 07:00:57 +0000 (UTC) Date: Mon, 23 Aug 2010 07:00:57 +0000 From: Alexey Dokuchaev To: Scott Long Message-ID: <20100823070057.GA6278@FreeBSD.org> References: <20100821.191255.1023414010414033264.imp@bsdimp.com> <4C717990.6020601@FreeBSD.org> <20100822.134229.550118873867470111.imp@bsdimp.com> <4C718595.5050304@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i Cc: Doug Barton , rpaulo@FreeBSD.org, svn-src-all@FreeBSD.org, bz@FreeBSD.org, src-committers@FreeBSD.org, svn-src-head@FreeBSD.org, anchie@FreeBSD.org, "M. Warner Losh" Subject: Re: svn commit: r211501 - in head/sys: modules modules/send netinet netinet6 sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 07:00:57 -0000 On Mon, Aug 23, 2010 at 12:32:33AM -0600, Scott Long wrote: > Doug, you're being a grade-A asshole in this entire discussion. The > merits of your argument are being completely overshadowed by your > patronizing attitude and over the top straw-man extremism. Ana deserves > an apology from you, and you would do well to consider apologizing to > everyone involved. Guys, I think you all are being too hard on Doug. Let me quote this part of article I recently came across at Undeadly: "When people actually care about something, they tend to have strong opinions. When you are wrong, you hear about it, very directly and in no uncertain terms. Absolutely no one is given special treatment. You have a choice between being offended and leaving, or appreciating the criticism and trying to do better. The people who get offended are the ones who have missed the obvious; another person just gave you their time in writing out their opinion and correction. They may have skipped showering you with sunshine, rainbows and ponies, but how you feel is unimportant. The thing that matters is the thing they care about, the best way to do it." -- http://undeadly.org/cgi?action=article&sid=20100721125722 That said, I wish we all grow a thiker skin and start actually value the criticism like we did in the old days. ./danfe From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 07:50:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE4D81065674; Mon, 23 Aug 2010 07:50:00 +0000 (UTC) (envelope-from prvs=1844a38e31=brian@FreeBSD.org) Received: from idcmail-mo2no.shaw.ca (idcmail-mo2no.shaw.ca [64.59.134.9]) by mx1.freebsd.org (Postfix) with ESMTP id 529F28FC17; Mon, 23 Aug 2010 07:50:00 +0000 (UTC) Received: from pd5ml3no-ssvc.prod.shaw.ca ([10.0.153.148]) by pd7mo1no-svcs.prod.shaw.ca with ESMTP; 23 Aug 2010 01:34:59 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=EPI+Anp5axUU12/DJ58YCKzU/28JrKwJBM9MxN4j1qY= c=1 sm=1 a=VXq8tsqEoNMA:10 a=VphdPIyG4kEA:10 a=MJPcHhXccCG8eBs0us8XwA==:17 a=6I5d2MoRAAAA:8 a=MMwg4So0AAAA:8 a=TJgWdOKpczqAMaWz67QA:9 a=OYAXRMB_6eCn7ADHmecA:7 a=w3vOS1xaNfVGzeS_8aEVBIZBe74A:4 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=WJ3hkfHDukgA:10 a=7NE1Py9lpwSuLBJfC_UA:9 a=_3Kyx6-qKaylvj2gxvohvC9KemQA:4 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO store.lan.Awfulhak.org) ([70.79.162.198]) by pd5ml3no-dmz.prod.shaw.ca with ESMTP; 23 Aug 2010 01:34:59 -0600 Received: from store.lan.Awfulhak.org (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id A6907C433AC_C722445B; Mon, 23 Aug 2010 07:33:25 +0000 (GMT) Received: from gw.Awfulhak.org (gw.lan.Awfulhak.org [172.16.0.1]) by store.lan.Awfulhak.org (Sophos Email Appliance) with ESMTP id 5EFB8C46121_C722442F; Mon, 23 Aug 2010 07:33:22 +0000 (GMT) Received: from dev.lan.Awfulhak.org (brian@dev.lan.Awfulhak.org [172.16.0.5]) by gw.Awfulhak.org (8.14.4/8.14.4) with ESMTP id o7N7XMx6077065; Mon, 23 Aug 2010 00:33:22 -0700 (PDT) (envelope-from brian@FreeBSD.org) Date: Mon, 23 Aug 2010 00:33:14 -0700 From: Brian Somers To: Jilles Tjoelker Message-ID: <20100823003314.57d41b94@dev.lan.Awfulhak.org> In-Reply-To: <201008221104.o7MB4Ung001538@svn.freebsd.org> References: <201008221104.o7MB4Ung001538@svn.freebsd.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; i386-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/uBHsmDpijb2Gjg4/4iP+Egi"; protocol="application/pgp-signature" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r211609 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 07:50:01 -0000 --Sig_/uBHsmDpijb2Gjg4/4iP+Egi Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sun, 22 Aug 2010 11:04:30 +0000 (UTC) Jilles Tjoelker wrote: > Author: jilles > Date: Sun Aug 22 11:04:30 2010 > New Revision: 211609 > URL: http://svn.freebsd.org/changeset/base/211609 >=20 > Log: > sh: Add a test for breaking from a loop outside the current function. > =20 > It is unwise to rely on this but I'd like to know if this would break. >=20 > Added: > head/tools/regression/bin/sh/builtins/break3.0 (contents, props chang= ed) >=20 > Added: head/tools/regression/bin/sh/builtins/break3.0 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/tools/regression/bin/sh/builtins/break3.0 Sun Aug 22 11:04:30 20= 10 (r211609) > @@ -0,0 +1,15 @@ > +# $FreeBSD$ > + > +# We accept this and people might rely on it. > +# However, various other shells do not accept it. > + > +f() { > + break > + echo bad1 > +} > + > +while :; do > + f > + echo bad2 > + exit 2 > +done This feature should be counted as a bug IMHO. How can f() possibly know wh= ether there's a surrounding context to break from? Having said that, this behaviour is the same in bash except that bash will = complain if it's asked to break when the context is wrong, perhaps we should complain t= oo? $ bash -c 'f() { break; echo no break; }; for f in good bad; do echo $f; f;= done' good $ sh -c 'f() { break; echo no break; }; for f in good bad; do echo $f; f; d= one' good $ bash -c 'f() { break; echo no break; }; f' bash: line 0: break: only meaningful in a `for', `while', or `until' loop no break $ bash -c 'f() { break 2>/dev/null; echo no break; }; f' no break $ sh -c 'f() { break; echo no break; }; f' no break --=20 Brian Somers Don't _EVER_ lose your sense of humour ! --Sig_/uBHsmDpijb2Gjg4/4iP+Egi Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iQCVAwUBTHIkQQ7tvOdmanQhAQJuvwP/YrtETlwy1MFtF6KPtovatQukjMX5wpWw FMX+Efgkvv6QEKYD777fngWl3igOKx2KE8Zm11sQo45r2cgfrOK5Nl1xMzQD4Neo WaCX35wwPjD+QupFOWN59XWxTroV/s1ct7DgKbscj8zvEMMwkgoK21eIoWH8kRHO b6GUHEosUQ4= =kB8L -----END PGP SIGNATURE----- --Sig_/uBHsmDpijb2Gjg4/4iP+Egi-- From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 08:07:16 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9936F10656AB for ; Mon, 23 Aug 2010 08:07:16 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 2B0C98FC20 for ; Mon, 23 Aug 2010 08:07:15 +0000 (UTC) Received: (qmail 14982 invoked by uid 399); 23 Aug 2010 08:07:14 -0000 Received: from localhost (HELO ?192.168.0.142?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 23 Aug 2010 08:07:14 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C722C30.1030003@FreeBSD.org> Date: Mon, 23 Aug 2010 01:07:12 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 MIME-Version: 1.0 To: Alexey Dokuchaev References: <20100821.191255.1023414010414033264.imp@bsdimp.com> <4C717990.6020601@FreeBSD.org> <20100822.134229.550118873867470111.imp@bsdimp.com> <4C718595.5050304@FreeBSD.org> <20100823070057.GA6278@FreeBSD.org> In-Reply-To: <20100823070057.GA6278@FreeBSD.org> X-Enigmail-Version: 1.1.1 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: Scott Long , src-committers@FreeBSD.org, rpaulo@FreeBSD.org, svn-src-all@FreeBSD.org, bz@FreeBSD.org, svn-src-head@FreeBSD.org, anchie@FreeBSD.org, "M. Warner Losh" Subject: Re: svn commit: r211501 - in head/sys: modules modules/send netinet netinet6 sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 08:07:16 -0000 Just to be clear, I never meant any disrespect to Ana personally, and if anything I said was or could have been construed that way, for that I definitely do apologize. On 8/23/2010 12:00 AM, Alexey Dokuchaev wrote: > On Mon, Aug 23, 2010 at 12:32:33AM -0600, Scott Long wrote: >> Doug, you're being a grade-A asshole in this entire discussion. The >> merits of your argument are being completely overshadowed by your >> patronizing attitude and over the top straw-man extremism. Ana deserves >> an apology from you, and you would do well to consider apologizing to >> everyone involved. > > Guys, I think you all are being too hard on Doug. Not only might you be the first FreeBSD person to ever say that, you're definitely the first to say it publicly. :) I really liked your quote, and you are correct in thinking that I do care deeply about this issue specifically, and the issue of making FreeBSD better generally. However neither my motivations, nor the extent to which I felt ill-treated by some in this thread excuse my over-the-top behavior, and for that I also apologize. Doug -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 08:24:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1828810656A5; Mon, 23 Aug 2010 08:24:01 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id C8D228FC24; Mon, 23 Aug 2010 08:24:00 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id CB03E1FFC33; Mon, 23 Aug 2010 08:23:59 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 98A818452E; Mon, 23 Aug 2010 10:23:59 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Dimitry Andric References: <201008141434.o7EEYaSA030301@svn.freebsd.org> <20100815205724.00007e0f@unknown> <86wrrraqk8.fsf@ds4.des.no> <4C7194E6.6080708@andric.com> Date: Mon, 23 Aug 2010 10:23:59 +0200 In-Reply-To: <4C7194E6.6080708@andric.com> (Dimitry Andric's message of "Sun, 22 Aug 2010 23:21:42 +0200") Message-ID: <86y6bxybxc.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Bruce Cran , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r211304 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 08:24:01 -0000 Dimitry Andric writes: > Dag-Erling Sm=C3=B8rgrav writes: > > Bruce Cran writes: > > > Somewhat related, there are overflow bugs in humanize_number - for > > > example df(1) fails to display space from a 100PB filesystem > > > correctly. > > Patch? :) > Attached. This makes humanize_number() work properly for all possible > int64_t values. That's awesome! Any way I can convince you to fix expand_number() as well? I got a detailed explanation of what's wrong with it (both before and after my commits) from bde@ (cc:ed) in private correspondence; I can forward it to you if he doesn't mind. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 09:52:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03C7910656A7; Mon, 23 Aug 2010 09:52:05 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E69DF8FC2A; Mon, 23 Aug 2010 09:52:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7N9q4FG034127; Mon, 23 Aug 2010 09:52:04 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7N9q4uq034123; Mon, 23 Aug 2010 09:52:04 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201008230952.o7N9q4uq034123@svn.freebsd.org> From: Brian Somers Date: Mon, 23 Aug 2010 09:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211699 - stable/8/usr.sbin/newsyslog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 09:52:05 -0000 Author: brian Date: Mon Aug 23 09:52:04 2010 New Revision: 211699 URL: http://svn.freebsd.org/changeset/base/211699 Log: MFC r210407: Add a -S switch to override syslogd's pidfile. Modified: stable/8/usr.sbin/newsyslog/newsyslog.8 stable/8/usr.sbin/newsyslog/newsyslog.c stable/8/usr.sbin/newsyslog/newsyslog.conf.5 Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.8 ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.8 Mon Aug 23 06:40:21 2010 (r211698) +++ stable/8/usr.sbin/newsyslog/newsyslog.8 Mon Aug 23 09:52:04 2010 (r211699) @@ -17,7 +17,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd January 19, 2010 +.Dd July 23, 2010 .Dt NEWSYSLOG 8 .Os .Sh NAME @@ -27,6 +27,7 @@ .Nm .Op Fl CFNPnrsv .Op Fl R Ar tagname +.Op Fl S Ar pidfile .Op Fl a Ar directory .Op Fl d Ar directory .Op Fl f Ar config_file @@ -215,6 +216,12 @@ Skipping the signal step will also mean will return faster, since .Nm normally waits a few seconds after any signal that is sent. +.It Fl S Ar pidfile +Use +.Ar pidfile +as +.Xr syslogd 8 Ns 's +pidfile. .El .Pp If additional command line arguments are given, Modified: stable/8/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.c Mon Aug 23 06:40:21 2010 (r211698) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Mon Aug 23 09:52:04 2010 (r211699) @@ -186,6 +186,8 @@ char daytime[DAYTIME_LEN]; /* The curren * used for rotation-tracking messages. */ char hostname[MAXHOSTNAMELEN]; /* hostname */ +const char *path_syslogpid = _PATH_SYSLOGPID; + static struct conf_entry *get_worklist(char **files); static void parse_file(FILE *cf, const char *cfname, struct conf_entry **work_p, struct conf_entry **glob_p, struct conf_entry **defconf_p); @@ -632,6 +634,9 @@ parse_args(int argc, char **argv) rotatereq++; requestor = strdup(optarg); break; + case 'S': + path_syslogpid = optarg; + break; case 'm': /* Used by OpenBSD for "monitor mode" */ default: usage(); @@ -724,7 +729,7 @@ usage(void) fprintf(stderr, "usage: newsyslog [-CFNnrsv] [-a directory] [-d directory] [-f config-file]\n" - " [ [-R requestor] filename ... ]\n"); + " [-S pidfile] [ [-R requestor] filename ... ]\n"); exit(1); } @@ -1318,7 +1323,7 @@ no_trimat: working->flags &= ~CE_SIGNALGROUP; } if (needroot) - working->pid_file = strdup(_PATH_SYSLOGPID); + working->pid_file = strdup(path_syslogpid); } /* Modified: stable/8/usr.sbin/newsyslog/newsyslog.conf.5 ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.conf.5 Mon Aug 23 06:40:21 2010 (r211698) +++ stable/8/usr.sbin/newsyslog/newsyslog.conf.5 Mon Aug 23 09:52:04 2010 (r211699) @@ -21,7 +21,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd November 27, 2006 +.Dd July 23, 2010 .Dt NEWSYSLOG.CONF 5 .Os .Sh NAME @@ -315,14 +315,17 @@ process ID or to find a group process ID flag was specified. If this field is present, a .Ar signal_number -is sent the process ID contained in this file. -If this field is not present, then a +is sent to the process ID contained in this file. +If this field is not present and the +.Cm N +flag has not been specified, then a .Dv SIGHUP signal will be sent to -.Xr syslogd 8 , -unless the -.Cm N -flag has been specified. +.Xr syslogd 8 +or to the process id found in the file specified by +.Xr newsyslog 8 Ns 's +.Fl S +switch. This field must start with .Ql / in order to be recognized properly. From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 09:54:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60095106564A; Mon, 23 Aug 2010 09:54:32 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4EB658FC0C; Mon, 23 Aug 2010 09:54:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7N9sWG6034227; Mon, 23 Aug 2010 09:54:32 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7N9sW3j034223; Mon, 23 Aug 2010 09:54:32 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201008230954.o7N9sW3j034223@svn.freebsd.org> From: Brian Somers Date: Mon, 23 Aug 2010 09:54:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211700 - stable/7/usr.sbin/newsyslog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 09:54:32 -0000 Author: brian Date: Mon Aug 23 09:54:32 2010 New Revision: 211700 URL: http://svn.freebsd.org/changeset/base/211700 Log: MFC r210407: Add a -S switch to override syslogd's pidfile. Modified: stable/7/usr.sbin/newsyslog/newsyslog.8 stable/7/usr.sbin/newsyslog/newsyslog.c stable/7/usr.sbin/newsyslog/newsyslog.conf.5 Directory Properties: stable/7/usr.sbin/newsyslog/ (props changed) Modified: stable/7/usr.sbin/newsyslog/newsyslog.8 ============================================================================== --- stable/7/usr.sbin/newsyslog/newsyslog.8 Mon Aug 23 09:52:04 2010 (r211699) +++ stable/7/usr.sbin/newsyslog/newsyslog.8 Mon Aug 23 09:54:32 2010 (r211700) @@ -17,7 +17,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd January 19, 2010 +.Dd July 23, 2010 .Dt NEWSYSLOG 8 .Os .Sh NAME @@ -27,6 +27,7 @@ .Nm .Op Fl CFNPnrsv .Op Fl R Ar tagname +.Op Fl S Ar pidfile .Op Fl a Ar directory .Op Fl d Ar directory .Op Fl f Ar config_file @@ -215,6 +216,12 @@ Skipping the signal step will also mean will return faster, since .Nm normally waits a few seconds after any signal that is sent. +.It Fl S Ar pidfile +Use +.Ar pidfile +as +.Xr syslogd 8 Ns 's +pidfile. .El .Pp If additional command line arguments are given, Modified: stable/7/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/7/usr.sbin/newsyslog/newsyslog.c Mon Aug 23 09:52:04 2010 (r211699) +++ stable/7/usr.sbin/newsyslog/newsyslog.c Mon Aug 23 09:54:32 2010 (r211700) @@ -186,6 +186,8 @@ char daytime[DAYTIME_LEN]; /* The curren * used for rotation-tracking messages. */ char hostname[MAXHOSTNAMELEN]; /* hostname */ +const char *path_syslogpid = _PATH_SYSLOGPID; + static struct conf_entry *get_worklist(char **files); static void parse_file(FILE *cf, const char *cfname, struct conf_entry **work_p, struct conf_entry **glob_p, struct conf_entry **defconf_p); @@ -632,6 +634,9 @@ parse_args(int argc, char **argv) rotatereq++; requestor = strdup(optarg); break; + case 'S': + path_syslogpid = optarg; + break; case 'm': /* Used by OpenBSD for "monitor mode" */ default: usage(); @@ -724,7 +729,7 @@ usage(void) fprintf(stderr, "usage: newsyslog [-CFNnrsv] [-a directory] [-d directory] [-f config-file]\n" - " [ [-R requestor] filename ... ]\n"); + " [-S pidfile] [ [-R requestor] filename ... ]\n"); exit(1); } @@ -1318,7 +1323,7 @@ no_trimat: working->flags &= ~CE_SIGNALGROUP; } if (needroot) - working->pid_file = strdup(_PATH_SYSLOGPID); + working->pid_file = strdup(path_syslogpid); } /* Modified: stable/7/usr.sbin/newsyslog/newsyslog.conf.5 ============================================================================== --- stable/7/usr.sbin/newsyslog/newsyslog.conf.5 Mon Aug 23 09:52:04 2010 (r211699) +++ stable/7/usr.sbin/newsyslog/newsyslog.conf.5 Mon Aug 23 09:54:32 2010 (r211700) @@ -21,7 +21,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd November 27, 2006 +.Dd July 23, 2010 .Dt NEWSYSLOG.CONF 5 .Os .Sh NAME @@ -315,14 +315,17 @@ process ID or to find a group process ID flag was specified. If this field is present, a .Ar signal_number -is sent the process ID contained in this file. -If this field is not present, then a +is sent to the process ID contained in this file. +If this field is not present and the +.Cm N +flag has not been specified, then a .Dv SIGHUP signal will be sent to -.Xr syslogd 8 , -unless the -.Cm N -flag has been specified. +.Xr syslogd 8 +or to the process id found in the file specified by +.Xr newsyslog 8 Ns 's +.Fl S +switch. This field must start with .Ql / in order to be recognized properly. From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 10:04:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7DCD1065672; Mon, 23 Aug 2010 10:04:26 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD5CB8FC08; Mon, 23 Aug 2010 10:04:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7NA4QYP034544; Mon, 23 Aug 2010 10:04:26 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7NA4Qk5034538; Mon, 23 Aug 2010 10:04:26 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201008231004.o7NA4Qk5034538@svn.freebsd.org> From: Gabor Kovesdan Date: Mon, 23 Aug 2010 10:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211701 - in head: gnu/usr.bin share/mk sys/sys tools/build/options usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 10:04:27 -0000 Author: gabor Date: Mon Aug 23 10:04:26 2010 New Revision: 211701 URL: http://svn.freebsd.org/changeset/base/211701 Log: - Change default grep back to GNU version. BSD grep can be built with the WITH_BSD_GREP knob. - Bump __FreeBSD_version Requested by: dougb Approved by: delphij (mentor) Added: head/tools/build/options/WITH_BSD_GREP (contents, props changed) Deleted: head/tools/build/options/WITH_GNU_GREP Modified: head/gnu/usr.bin/Makefile head/share/mk/bsd.own.mk head/sys/sys/param.h head/usr.bin/Makefile Modified: head/gnu/usr.bin/Makefile ============================================================================== --- head/gnu/usr.bin/Makefile Mon Aug 23 09:54:32 2010 (r211700) +++ head/gnu/usr.bin/Makefile Mon Aug 23 10:04:26 2010 (r211701) @@ -28,6 +28,10 @@ _groff= groff .endif .endif +.if ${MK_BSD_GREP} != "yes" +_grep= grep +.endif + .if ${MK_CVS} != "no" _cvs= cvs .endif @@ -36,10 +40,6 @@ _cvs= cvs _dtc= dtc .endif -.if ${MK_GNU_GREP} != "no" -_grep= grep -.endif - .if ${MK_INFO} != "no" _texinfo= texinfo .endif Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Mon Aug 23 09:54:32 2010 (r211700) +++ head/share/mk/bsd.own.mk Mon Aug 23 10:04:26 2010 (r211701) @@ -419,9 +419,9 @@ MK_${var}:= yes BIND_LIBS \ BIND_SIGCHASE \ BIND_XML \ + BSD_GREP \ ${_clang_no} \ FDT \ - GNU_GREP \ HESIOD \ IDEA .if defined(WITH_${var}) && defined(WITHOUT_${var}) Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Aug 23 09:54:32 2010 (r211700) +++ head/sys/sys/param.h Mon Aug 23 10:04:26 2010 (r211701) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900016 /* Master, propagated to newvers */ +#define __FreeBSD_version 900017 /* Master, propagated to newvers */ #ifndef LOCORE #include Added: head/tools/build/options/WITH_BSD_GREP ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_BSD_GREP Mon Aug 23 10:04:26 2010 (r211701) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Build BSD-licensed grep instead of GNU grep. Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Mon Aug 23 09:54:32 2010 (r211700) +++ head/usr.bin/Makefile Mon Aug 23 10:04:26 2010 (r211701) @@ -277,6 +277,10 @@ _bluetooth= bluetooth _cpio= cpio .endif +.if ${MK_BSD_GREP} != "no" +_grep= grep +.endif + .if ${MK_CALENDAR} != "no" _calendar= calendar .endif @@ -285,10 +289,6 @@ _calendar= calendar _clang= clang .endif -.if ${MK_GNU_GREP} != "yes" -_grep= grep -.endif - .if ${MK_HESIOD} != "no" _hesinfo= hesinfo .endif From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 10:13:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9DAD1065675; Mon, 23 Aug 2010 10:13:54 +0000 (UTC) (envelope-from prvs=1844a38e31=brian@FreeBSD.org) Received: from idcmail-mo2no.shaw.ca (idcmail-mo2no.shaw.ca [64.59.134.9]) by mx1.freebsd.org (Postfix) with ESMTP id 71AE18FC16; Mon, 23 Aug 2010 10:13:54 +0000 (UTC) Received: from pd5ml3no-ssvc.prod.shaw.ca ([10.0.153.148]) by pd7mo1no-svcs.prod.shaw.ca with ESMTP; 23 Aug 2010 04:13:53 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=EPI+Anp5axUU12/DJ58YCKzU/28JrKwJBM9MxN4j1qY= c=1 sm=1 a=EQYUhsiSGKsA:10 a=VphdPIyG4kEA:10 a=MJPcHhXccCG8eBs0us8XwA==:17 a=6I5d2MoRAAAA:8 a=MMwg4So0AAAA:8 a=OBlIFFXcqL3Mi_WKgWQA:9 a=xLBoPPJG_dkswh6zPccA:7 a=DBZ5gsgBFwulzg9d5_W2HmfEPFAA:4 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=WJ3hkfHDukgA:10 a=ba-t8vnvHnTbQcImUF0A:9 a=7yj-52yHm9kZRRlWNE0NnJ3zdq0A:4 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO store.lan.Awfulhak.org) ([70.79.162.198]) by pd5ml3no-dmz.prod.shaw.ca with ESMTP; 23 Aug 2010 04:13:53 -0600 Received: from store.lan.Awfulhak.org (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id 0D1CCC433AC_C724983B; Mon, 23 Aug 2010 10:12:19 +0000 (GMT) Received: from gw.Awfulhak.org (gw.lan.Awfulhak.org [172.16.0.1]) by store.lan.Awfulhak.org (Sophos Email Appliance) with ESMTP id 860FAC460F7_C72497FF; Mon, 23 Aug 2010 10:12:15 +0000 (GMT) Received: from dev.lan.Awfulhak.org (brian@dev.lan.Awfulhak.org [172.16.0.5]) by gw.Awfulhak.org (8.14.4/8.14.4) with ESMTP id o7NACFZM091651; Mon, 23 Aug 2010 03:12:15 -0700 (PDT) (envelope-from brian@FreeBSD.org) Date: Mon, 23 Aug 2010 03:12:08 -0700 From: Brian Somers To: Gabor Kovesdan Message-ID: <20100823031208.3f6d23e8@dev.lan.Awfulhak.org> In-Reply-To: <201008231004.o7NA4Qk5034538@svn.freebsd.org> References: <201008231004.o7NA4Qk5034538@svn.freebsd.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; i386-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/3qAEb9tyi1_0LwHHQ9pnjM9"; protocol="application/pgp-signature" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r211701 - in head: gnu/usr.bin share/mk sys/sys tools/build/options usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 10:13:54 -0000 --Sig_/3qAEb9tyi1_0LwHHQ9pnjM9 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Is this a permanent switch or is there a list of issues to be resolved befo= re switching back to the BSD grep? On Mon, 23 Aug 2010 10:04:26 +0000 (UTC) Gabor Kovesdan = wrote: > Author: gabor > Date: Mon Aug 23 10:04:26 2010 > New Revision: 211701 > URL: http://svn.freebsd.org/changeset/base/211701 >=20 > Log: > - Change default grep back to GNU version. BSD grep can be built with t= he > WITH_BSD_GREP knob. > - Bump __FreeBSD_version > =20 > Requested by: dougb > Approved by: delphij (mentor) >=20 > Added: > head/tools/build/options/WITH_BSD_GREP (contents, props changed) > Deleted: > head/tools/build/options/WITH_GNU_GREP > Modified: > head/gnu/usr.bin/Makefile > head/share/mk/bsd.own.mk > head/sys/sys/param.h > head/usr.bin/Makefile >=20 > Modified: head/gnu/usr.bin/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/gnu/usr.bin/Makefile Mon Aug 23 09:54:32 2010 (r211700) > +++ head/gnu/usr.bin/Makefile Mon Aug 23 10:04:26 2010 (r211701) > @@ -28,6 +28,10 @@ _groff=3D groff > .endif > .endif > =20 > +.if ${MK_BSD_GREP} !=3D "yes" > +_grep=3D grep > +.endif > + > .if ${MK_CVS} !=3D "no" > _cvs=3D cvs > .endif > @@ -36,10 +40,6 @@ _cvs=3D cvs > _dtc=3D dtc > .endif > =20 > -.if ${MK_GNU_GREP} !=3D "no" > -_grep=3D grep > -.endif > - > .if ${MK_INFO} !=3D "no" > _texinfo=3D texinfo > .endif >=20 > Modified: head/share/mk/bsd.own.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/mk/bsd.own.mk Mon Aug 23 09:54:32 2010 (r211700) > +++ head/share/mk/bsd.own.mk Mon Aug 23 10:04:26 2010 (r211701) > @@ -419,9 +419,9 @@ MK_${var}:=3D yes > BIND_LIBS \ > BIND_SIGCHASE \ > BIND_XML \ > + BSD_GREP \ > ${_clang_no} \ > FDT \ > - GNU_GREP \ > HESIOD \ > IDEA > .if defined(WITH_${var}) && defined(WITHOUT_${var}) >=20 > Modified: head/sys/sys/param.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/sys/param.h Mon Aug 23 09:54:32 2010 (r211700) > +++ head/sys/sys/param.h Mon Aug 23 10:04:26 2010 (r211701) > @@ -58,7 +58,7 @@ > * in the range 5 to 9. > */ > #undef __FreeBSD_version > -#define __FreeBSD_version 900016 /* Master, propagated to newvers */ > +#define __FreeBSD_version 900017 /* Master, propagated to newvers */ > =20 > #ifndef LOCORE > #include >=20 > Added: head/tools/build/options/WITH_BSD_GREP > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/tools/build/options/WITH_BSD_GREP Mon Aug 23 10:04:26 2010 (r211= 701) > @@ -0,0 +1,2 @@ > +.\" $FreeBSD$ > +Build BSD-licensed grep instead of GNU grep. >=20 > Modified: head/usr.bin/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.bin/Makefile Mon Aug 23 09:54:32 2010 (r211700) > +++ head/usr.bin/Makefile Mon Aug 23 10:04:26 2010 (r211701) > @@ -277,6 +277,10 @@ _bluetooth=3D bluetooth > _cpio=3D cpio > .endif > =20 > +.if ${MK_BSD_GREP} !=3D "no" > +_grep=3D grep > +.endif > + > .if ${MK_CALENDAR} !=3D "no" > _calendar=3D calendar > .endif > @@ -285,10 +289,6 @@ _calendar=3D calendar > _clang=3D clang > .endif > =20 > -.if ${MK_GNU_GREP} !=3D "yes" > -_grep=3D grep > -.endif > - > .if ${MK_HESIOD} !=3D "no" > _hesinfo=3D hesinfo > .endif >=20 --=20 Brian Somers Don't _EVER_ lose your sense of humour ! --Sig_/3qAEb9tyi1_0LwHHQ9pnjM9 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iQCVAwUBTHJJfg7tvOdmanQhAQIVXQP/Rjjj6WOTZ3+HpmMfUyhF1ci9ff16AAso n5XNYPXLULdO5wFHH3p9z1/WOZCP2IpwaVHP6/GpcEKk2XhBKRn09s6MVBEXLb5j lg9iG3ePDcxBxlqZTdKf4NAjzlu/vM5kc+mK2gIr82MCx2iSB1VlR2dnuYprNbMb 6nSylufyTOo= =Fx+m -----END PGP SIGNATURE----- --Sig_/3qAEb9tyi1_0LwHHQ9pnjM9-- From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 10:16:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2B88106564A; Mon, 23 Aug 2010 10:16:42 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from mail.vnode.se (mail.vnode.se [62.119.52.80]) by mx1.freebsd.org (Postfix) with ESMTP id 76C128FC1D; Mon, 23 Aug 2010 10:16:42 +0000 (UTC) Received: from mail.vnode.se (localhost [127.0.0.1]) by mail.vnode.se (Postfix) with ESMTP id CEAD8E3F07B; Mon, 23 Aug 2010 12:16:40 +0200 (CEST) X-Virus-Scanned: amavisd-new at vnode.se Received: from mail.vnode.se ([127.0.0.1]) by mail.vnode.se (mail.vnode.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cWolwgm48nei; Mon, 23 Aug 2010 12:16:38 +0200 (CEST) Received: from pluto.vnode.local (unknown [83.223.1.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.vnode.se (Postfix) with ESMTPSA id B80A3E3F079; Mon, 23 Aug 2010 12:16:37 +0200 (CEST) Date: Mon, 23 Aug 2010 12:16:35 +0200 From: Joel Dahl To: Gabor Kovesdan Message-ID: <20100823101635.GA20435@pluto.vnode.local> References: <201008231004.o7NA4Qk5034538@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201008231004.o7NA4Qk5034538@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211701 - in head: gnu/usr.bin share/mk sys/sys tools/build/options usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 10:16:42 -0000 On 23-08-2010 10:04, Gabor Kovesdan wrote: > Author: gabor > Date: Mon Aug 23 10:04:26 2010 > New Revision: 211701 > URL: http://svn.freebsd.org/changeset/base/211701 > > Log: > - Change default grep back to GNU version. BSD grep can be built with the > WITH_BSD_GREP knob. :-( -- Joel From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 10:29:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A71E410656A6; Mon, 23 Aug 2010 10:29:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 0772D8FC1A; Mon, 23 Aug 2010 10:29:00 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o7NASwqM058049 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 23 Aug 2010 13:28:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o7NASwkj014047; Mon, 23 Aug 2010 13:28:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o7NASwBF014046; Mon, 23 Aug 2010 13:28:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 23 Aug 2010 13:28:58 +0300 From: Kostik Belousov To: Brian Somers Message-ID: <20100823102858.GD2396@deviant.kiev.zoral.com.ua> References: <201008230533.o7N5XVxa028293@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="q5PQdybHXkW1/peZ" Content-Disposition: inline In-Reply-To: <201008230533.o7N5XVxa028293@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211684 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 10:29:01 -0000 --q5PQdybHXkW1/peZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 23, 2010 at 05:33:31AM +0000, Brian Somers wrote: > Author: brian > Date: Mon Aug 23 05:33:31 2010 > New Revision: 211684 > URL: http://svn.freebsd.org/changeset/base/211684 >=20 > Log: > uio_resid isn't updated by VOP_READDIR for nfs filesystems. Use > the uio_offset adjustment instead to calculate a correct *len. Isn't this should be fixed in nfs instead ? Please note that the moral equivalent of the code is also present in compat/linux/linux_cwd.c: linux_getcwd_scandir(). I did not inspected other callers of VOP_READDIR. > =20 > Without this change, we run off the end of the directory data > we're reading and panic horribly for nfs filesystems. > =20 > MFC after: 1 week >=20 > Modified: > head/sys/kern/vfs_default.c >=20 > Modified: head/sys/kern/vfs_default.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/vfs_default.c Mon Aug 23 05:33:20 2010 (r211683) > +++ head/sys/kern/vfs_default.c Mon Aug 23 05:33:31 2010 (r211684) > @@ -281,10 +281,9 @@ get_next_dirent(struct vnode *vp, struct > if (error) > return (error); > =20 > - *off =3D uio.uio_offset; > - > *cpos =3D dirbuf; > - *len =3D (dirbuflen - uio.uio_resid); > + *len =3D uio.uio_offset - *off; > + *off =3D uio.uio_offset; > } > =20 > dp =3D (struct dirent *)(*cpos); --q5PQdybHXkW1/peZ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkxyTWkACgkQC3+MBN1Mb4hVnQCgzC0YD5HQPnEg3NpIuKXIqWVb 0WMAnA7Aps14cDsNFgQzoG0AK2RFtXdI =CSb4 -----END PGP SIGNATURE----- --q5PQdybHXkW1/peZ-- From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 10:31:36 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F38641065721; Mon, 23 Aug 2010 10:31:35 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id A64C88FC1A; Mon, 23 Aug 2010 10:31:35 +0000 (UTC) Received: from server.mypc.hu (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id BCB5714DC6D4; Mon, 23 Aug 2010 12:31:34 +0200 (CEST) X-Virus-Scanned: amavisd-new at server.mypc.hu Received: from server.mypc.hu ([127.0.0.1]) by server.mypc.hu (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 6nUZBRWi-6T0; Mon, 23 Aug 2010 12:31:32 +0200 (CEST) Received: from [192.168.1.105] (catv-80-99-92-167.catv.broadband.hu [80.99.92.167]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id 9C5D414DC689; Mon, 23 Aug 2010 12:31:32 +0200 (CEST) Message-ID: <4C724E03.7050804@FreeBSD.org> Date: Mon, 23 Aug 2010 12:31:31 +0200 From: Gabor Kovesdan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-PT; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 MIME-Version: 1.0 To: Brian Somers References: <201008231004.o7NA4Qk5034538@svn.freebsd.org> <20100823031208.3f6d23e8@dev.lan.Awfulhak.org> In-Reply-To: <20100823031208.3f6d23e8@dev.lan.Awfulhak.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r211701 - in head: gnu/usr.bin share/mk sys/sys tools/build/options usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 10:31:36 -0000 Em 2010.08.23. 12:12, Brian Somers escreveu: > Is this a permanent switch or is there a list of issues to be resolved before switching > back to the BSD grep? I maintain my TODO list, which currently has the following items: - fix context grepping bug - fix loop on reading drectories on ZFS/NFS - print out warning and exit if writing to stdin fails - track down and fix -wq bug - support and install bz*grep binaries - performance issue: avoid copying strings everywhere where possible - performance issue: only check line boundaries on match - performance issue: compare various fixed string algorithms for fgrep Some of these are quite easy and the performance is much better now but some people objected so strongly that I decided to stop fighting and change back. I'll work these out and then we'll reevaluate if we can use BSD grep as default. I'll try to get them solved asap but I'll move to another country soon and given that I as forced to change it back without having some more time to arrange them, I don't like to be stressed any more so I'll concentrate on my move and calm settlement in Portugal, first. Gabor From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 10:43:49 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E199C10656A3; Mon, 23 Aug 2010 10:43:49 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id A1E058FC26; Mon, 23 Aug 2010 10:43:49 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:153e:890e:2af6:cf40] (unknown [IPv6:2001:7b8:3a7:0:153e:890e:2af6:cf40]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 242315C59; Mon, 23 Aug 2010 12:43:48 +0200 (CEST) Message-ID: <4C7250EA.4090704@andric.com> Date: Mon, 23 Aug 2010 12:43:54 +0200 From: Dimitry Andric User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.9pre) Gecko/20100814 Lanikai/3.1.3pre MIME-Version: 1.0 To: Gabor Kovesdan References: <201008231004.o7NA4Qk5034538@svn.freebsd.org> <20100823031208.3f6d23e8@dev.lan.Awfulhak.org> <4C724E03.7050804@FreeBSD.org> In-Reply-To: <4C724E03.7050804@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Brian Somers Subject: Re: svn commit: r211701 - in head: gnu/usr.bin share/mk sys/sys tools/build/options usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 10:43:50 -0000 On 2010-08-23 12:31, Gabor Kovesdan wrote: > - print out warning and exit if writing to stdin fails I hope you mean stdout here? :) From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 11:29:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2325210656A3; Mon, 23 Aug 2010 11:29:54 +0000 (UTC) (envelope-from rpaulo@lavabit.com) Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33]) by mx1.freebsd.org (Postfix) with ESMTP id D30658FC13; Mon, 23 Aug 2010 11:29:53 +0000 (UTC) Received: from d.earth.lavabit.com (d.earth.lavabit.com [192.168.111.13]) by karen.lavabit.com (Postfix) with ESMTP id DA88311B9C6; Mon, 23 Aug 2010 05:59:03 -0500 (CDT) Received: from 10.0.10.3 (54.81.54.77.rev.vodafone.pt [77.54.81.54]) by lavabit.com with ESMTP id RV3N791D9MWF; Mon, 23 Aug 2010 05:59:03 -0500 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=lavabit; d=lavabit.com; b=lXOnsuHItkw5l8cy0m1ALTkPOMjntmuUu7R1TFK7weO2agKMdERS1H1mFye06NRCan7UPtap6OCe6BGFiLvlg35FqWllAOAa8TQVCL9RGx3Nw52UCWWsh8QadPi7Yot8GxUByUMiJ7N5LFy6cj5/1a+dQ3GiFFwl0sfyoPOFJ2U=; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Rui Paulo In-Reply-To: Date: Mon, 23 Aug 2010 11:59:00 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <875BFE25-D7A2-4FB5-B1E2-9E90CEB5086C@lavabit.com> References: <201008230622.o7N6MZnT029820@svn.freebsd.org> To: pluknet X-Mailer: Apple Mail (2.1081) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh Subject: Re: svn commit: r211695 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 11:29:54 -0000 On 23 Aug 2010, at 07:32, pluknet wrote: > On 23 August 2010 10:22, Warner Losh wrote: >> Author: imp >> Date: Mon Aug 23 06:22:35 2010 >> New Revision: 211695 >> URL: http://svn.freebsd.org/changeset/base/211695 >>=20 >> Log: >> This should really be MACHINE not MACHINE_ARCH, and is this Makefile = even used? >>=20 >=20 > Hi. >=20 > I wrote this letter almost 2.5y ago with no response. > Hope this helps. >=20 > %%% > I looked at sys/kern/ Makefile Make.tags.inc. AFAICS they were = partially > abandoned years ago and has broken tags support and even contain = 4.4BSD-Lite > paths, that never ever being in FreeBSD CVS or was dropped years ago. = So make > links exits with error. It looks very odd: >=20 > pl$ make links > rm -f /var/db/sys_tags > ln -s /sys/i386/tags /var/db/sys_tags > for i in conf dev dev/scsi fs fs/deadfs fs/fdescfs fs/fifofs > fs/lofs fs/nullfs fs/portalfs fs/procfs fs/specfs fs/unionfs hp > hp/dev hp/hpux kern libkern net netinet nfs scripts sys ufs ufs/ffs > ufs/lfs ufs/ufs vm; do (cd ../$i && { rm -f tags; ln -s > /var/db/sys_tags tags; }) done > cd: can't cd to ../dev/scsi > cd: can't cd to ../fs/lofs > cd: can't cd to ../fs/specfs > cd: can't cd to ../hp > cd: can't cd to ../hp/dev > cd: can't cd to ../hp/hpux > cd: can't cd to ../scripts > cd: can't cd to ../ufs/lfs > for i in i386; do (cd ../$i && make SYSTAGS=3D/var/db/sys_tags = links); done > for i in /sys/conf /sys/kern /sys/net /sys/netatalk /sys/netatm > /sys/netinet /sys/netinet6 /sys/netipsec /sys/netipx /sys/netnatm > /sys/nfs /sys/pci /sys/vm /sys/sys; do (cd $i && { rm -f tags; ln > -s ../i386/tags tags; }) done > for i in /sys/dev/advansys /sys/dev/aha /sys/dev/aic7xxx > /sys/dev/buslogic /sys/dev/ccd /sys/dev/dec /sys/dev/dpt > /sys/dev/en /sys/dev/hea /sys/dev/hfa /sys/dev/iicbus /sys/dev/isp > /sys/dev/pdq /sys/dev/ppbus /sys/dev/smbus /sys/dev/vn > /sys/dev/vx /sys/fs/deadfs /sys/fs/devfs /sys/fs/fdescfs > /sys/fs/fifofs /sys/fs/msdosfs /sys/fs/nullfs /sys/fs/portalfs > /sys/fs/procfs /sys > /fs/specfs /sys/fs/unionfs /sys/fs/cd9660 /sys/ufs/ffs > /sys/ufs/ufs; do (cd $i && { rm -f tags; ln -s ../../i386/tags tags; > }) done > cd: can't cd to /sys/dev/ccd > cd: can't cd to /sys/dev/dec > cd: can't cd to /sys/dev/hea > cd: can't cd to /sys/dev/vn > cd: can't cd to /sys/fs/specfs > for i in apm i386 ibcs2 include isa linux; do (cd $i && { rm -f tags; > ln -s ../tags tags; }) done > cd: can't cd to apm >=20 > I moved that two files from src and could complete build kernel > without errors, so it > seems they are not referenced by any kernel building tools. >=20 > Yes, there is tags target in src/Makefile, I didn't looked too much > how it interacts with Makefile Make.tags.inc, but by their erroneous > paths I doubt there is any interaction. >=20 > I found this in NetBSD's kern/Makefile: > +# XXX > +# [Note by Perry Metzger, Sept. 1998] > +# As it stands, the tags support below is hopelessly > +# broken. Just look at the names of the architectures it is dealing > +# with and where it expects to find the support for them to see why. > +# I've left the stuff in this Makefile alone in the hope that someone > +# will fix it someday -- I am assuming that it might help that > +# person if they have the old Makefile goo left in place as a = starting > +# point. > +# XXX >=20 > ps. BTW I tried to make tags from src/ (with clean obj, if that > matters) and the target > began to build my gcc (cc/cc_tools) after going through various world = paths. > Is that intended? > %%% Oh, this is great thing to axe then... Regards, -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 11:58:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 943361065670; Mon, 23 Aug 2010 11:58:45 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F0518FC13; Mon, 23 Aug 2010 11:58:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7NBwjHN039902; Mon, 23 Aug 2010 11:58:45 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7NBwjJp039892; Mon, 23 Aug 2010 11:58:45 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201008231158.o7NBwjJp039892@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 23 Aug 2010 11:58:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211702 - in stable: 7/contrib/bsnmp/gensnmpdef 7/contrib/bsnmp/gensnmptree 7/contrib/bsnmp/lib 7/contrib/bsnmp/snmp_mibII 7/contrib/bsnmp/snmpd 8/contrib/bsnmp/gensnmpdef 8/contrib/bsn... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 11:58:45 -0000 Author: uqs Date: Mon Aug 23 11:58:45 2010 New Revision: 211702 URL: http://svn.freebsd.org/changeset/base/211702 Log: MFC r205078,208483,211401-211402,211404: mdoc cleanup - Fix typo in macro name and macro usage. - Consistently spell our email addresses - Wordsmithing of bsnmpd.1; bump .Dd - Fix two minor typos. Modified: stable/8/contrib/bsnmp/gensnmpdef/gensnmpdef.1 stable/8/contrib/bsnmp/gensnmptree/gensnmptree.1 stable/8/contrib/bsnmp/lib/asn1.3 stable/8/contrib/bsnmp/lib/bsnmpagent.3 stable/8/contrib/bsnmp/lib/bsnmpclient.3 stable/8/contrib/bsnmp/lib/bsnmplib.3 stable/8/contrib/bsnmp/snmp_mibII/snmp_mibII.3 stable/8/contrib/bsnmp/snmpd/bsnmpd.1 stable/8/contrib/bsnmp/snmpd/snmpmod.3 Directory Properties: stable/8/contrib/bsnmp/ (props changed) Changes in other areas also in this revision: Modified: stable/7/contrib/bsnmp/gensnmpdef/gensnmpdef.1 stable/7/contrib/bsnmp/gensnmptree/gensnmptree.1 stable/7/contrib/bsnmp/lib/asn1.3 stable/7/contrib/bsnmp/lib/bsnmpagent.3 stable/7/contrib/bsnmp/lib/bsnmpclient.3 stable/7/contrib/bsnmp/lib/bsnmplib.3 stable/7/contrib/bsnmp/snmp_mibII/snmp_mibII.3 stable/7/contrib/bsnmp/snmpd/bsnmpd.1 stable/7/contrib/bsnmp/snmpd/snmpmod.3 Directory Properties: stable/7/contrib/bsnmp/ (props changed) Modified: stable/8/contrib/bsnmp/gensnmpdef/gensnmpdef.1 ============================================================================== --- stable/8/contrib/bsnmp/gensnmpdef/gensnmpdef.1 Mon Aug 23 10:04:26 2010 (r211701) +++ stable/8/contrib/bsnmp/gensnmpdef/gensnmpdef.1 Mon Aug 23 11:58:45 2010 (r211702) @@ -3,7 +3,7 @@ .\" Hartmut Brandt. .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -78,7 +78,7 @@ file by hand. .Sh SEE ALSO .Xr snmpd 1 .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org .Sh BUGS The utility is by no means bullet-proof and may fail for complex or non-standard MIBs. Modified: stable/8/contrib/bsnmp/gensnmptree/gensnmptree.1 ============================================================================== --- stable/8/contrib/bsnmp/gensnmptree/gensnmptree.1 Mon Aug 23 10:04:26 2010 (r211701) +++ stable/8/contrib/bsnmp/gensnmptree/gensnmptree.1 Mon Aug 23 11:58:45 2010 (r211702) @@ -6,7 +6,7 @@ .\" Hartmut Brandt .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -58,7 +58,7 @@ If none of the options .Fl e , .Fl E or -.FL t +.Fl t are used .Nm reads a MIB description from its standard input and creates two files: a @@ -243,4 +243,4 @@ typedef AdminStatus ENUM ( .Sh SEE ALSO .Xr bsnmpd 1 .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org Modified: stable/8/contrib/bsnmp/lib/asn1.3 ============================================================================== --- stable/8/contrib/bsnmp/lib/asn1.3 Mon Aug 23 10:04:26 2010 (r211701) +++ stable/8/contrib/bsnmp/lib/asn1.3 Mon Aug 23 11:58:45 2010 (r211702) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -489,4 +489,4 @@ followed by the error message and an opt This implementation conforms to the applicable IETF RFCs and ITU-T recommendations. .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org Modified: stable/8/contrib/bsnmp/lib/bsnmpagent.3 ============================================================================== --- stable/8/contrib/bsnmp/lib/bsnmpagent.3 Mon Aug 23 10:04:26 2010 (r211701) +++ stable/8/contrib/bsnmp/lib/bsnmpagent.3 Mon Aug 23 11:58:45 2010 (r211702) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -441,4 +441,4 @@ Additionally the functions may call snmp This implementation conforms to the applicable IETF RFCs and ITU-T recommendations. .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org Modified: stable/8/contrib/bsnmp/lib/bsnmpclient.3 ============================================================================== --- stable/8/contrib/bsnmp/lib/bsnmpclient.3 Mon Aug 23 10:04:26 2010 (r211701) +++ stable/8/contrib/bsnmp/lib/bsnmpclient.3 Mon Aug 23 11:58:45 2010 (r211702) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -654,5 +654,5 @@ filed of This implementation conforms to the applicable IETF RFCs and ITU-T recommendations. .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org .An Kendy Kutzner Aq kutzner@fokus.gmd.de Modified: stable/8/contrib/bsnmp/lib/bsnmplib.3 ============================================================================== --- stable/8/contrib/bsnmp/lib/bsnmplib.3 Mon Aug 23 10:04:26 2010 (r211701) +++ stable/8/contrib/bsnmp/lib/bsnmplib.3 Mon Aug 23 11:58:45 2010 (r211702) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -302,4 +302,4 @@ Encoding failed. This implementation conforms to the applicable IETF RFCs and ITU-T recommendations. .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org Modified: stable/8/contrib/bsnmp/snmp_mibII/snmp_mibII.3 ============================================================================== --- stable/8/contrib/bsnmp/snmp_mibII/snmp_mibII.3 Mon Aug 23 10:04:26 2010 (r211701) +++ stable/8/contrib/bsnmp/snmp_mibII/snmp_mibII.3 Mon Aug 23 11:58:45 2010 (r211702) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -363,4 +363,4 @@ The various internet MIBs. .Sh STANDARDS This implementation conforms to the applicable IETF RFCs. .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org Modified: stable/8/contrib/bsnmp/snmpd/bsnmpd.1 ============================================================================== --- stable/8/contrib/bsnmp/snmpd/bsnmpd.1 Mon Aug 23 10:04:26 2010 (r211701) +++ stable/8/contrib/bsnmp/snmpd/bsnmpd.1 Mon Aug 23 11:58:45 2010 (r211702) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -31,7 +31,7 @@ .\" .\" $Begemot: bsnmp/snmpd/bsnmpd.1,v 1.12 2006/02/27 09:50:03 brandt_h Exp $ .\" -.Dd February 27, 2006 +.Dd August 16, 2010 .Dt BSNMPD 1 .Os .Sh NAME @@ -49,7 +49,7 @@ .Sh DESCRIPTION The .Nm -daemon server the internet SNMP (Simple Network Management Protocol). +daemon serves the internet SNMP (Simple Network Management Protocol). It is intended to serve only the absolute basic MIBs and implement all other MIBs through loadable modules. In this way the @@ -59,11 +59,10 @@ can be used in unexpected ways. The options are as follows: .Bl -tag -width ".It Fl D Ar options" .It Fl d -This option is used for debugging -.Nm -and causes it not to daemonize itself. +Do not daemonize. +Used for debugging. .It Fl h -This option prints a short usage message. +Print a short usage message. .It Fl c Ar file Use .Ar file @@ -75,33 +74,32 @@ flag followed by a comma separated strin The following options are available. .Bl -tag -width ".It Cm trace Ns Cm = Ns Cm level" .It Cm dump -This option causes all sent and received PDUs to be dumped to the terminal. +Dump all sent and received PDUs to the terminal. .It Cm events -This causes the debugging level of the event library (see +Set the debugging level of the event library (see .Xr eventlib 3 ) -to be set to 10. +to 10. .It Cm trace Ns Cm = Ns Cm level -This option causes the snmp library trace flag to be set to the specified +Set the snmp library trace flag to the specified value. The value can be specified in the usual C-syntax for numbers. .El .It Fl I Ar paths -This option specifies a colon separated list of directories to search for -configuration include files. +Specify a colon separated list of directories to search for configuration +include files. The default is .Pa /etc:/usr/etc/:/usr/local/etc . These paths are only searched for include specified within <> parentheses. .It Fl l Ar prefix -The +Use .Ar prefix -is used as the default basename for the pid and the configuration files. +as the default basename for the pid and the configuration files. .It Fl m Ar variable Ns Op = Ns Ar value Define a configuration variable. .It Fl p Ar file Specify an alternate pid file instead of the default one. .El .Sh CONFIGURATION -The .Nm reads its configuration from either the default or the user specified configuration file. @@ -218,7 +216,7 @@ If the element is a hostname, the IP address of the host is looked up and the four elements of the IP address are appended to the oid. .Pp -For example a oid of +For example, an oid of .Bd -unfilled -offset indent myvariable.27.foooll.[localhost]."&^!" .Ed @@ -253,13 +251,13 @@ is .It Pa /var/run/ Ns Ao Ar prefix Ac Ns \&.pid Default pid file. .It Pa /etc:/usr/etc/:/usr/local/etc -This is the default search path for system include files. +Default search path for system include files. .It Pa @MIBSPATH@FOKUS-MIB.txt .It Pa @MIBSPATH@BEGEMOT-MIB.txt .It Pa @MIBSPATH@BEGEMOT-SNMPD.txt -The definitions for the MIBs implemented in the daemon. +Definitions for the MIBs implemented in the daemon. .It Pa /etc/hosts.allow, /etc/hosts.deny -Access controls that should be enforced by TCP wrappers should be defined here. +Access controls that should be enforced by TCP wrappers are defined here. Further details are described in .Xr hosts_access 5 . .El @@ -271,6 +269,6 @@ The .Nm conforms to the applicable IETF RFCs. .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org .Sh BUGS Sure. Modified: stable/8/contrib/bsnmp/snmpd/snmpmod.3 ============================================================================== --- stable/8/contrib/bsnmp/snmpd/snmpmod.3 Mon Aug 23 10:04:26 2010 (r211701) +++ stable/8/contrib/bsnmp/snmpd/snmpmod.3 Mon Aug 23 11:58:45 2010 (r211702) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -558,7 +558,7 @@ For modules that implement SNMP client f it may be necessary to identify SNMP requests by their identifier to allow easier routing of responses to the correct sub-system. Request id ranges -provide a way to aquire globally non-overlapping sub-ranges of the entire +provide a way to acquire globally non-overlapping sub-ranges of the entire 31-bit id range. .Pp A request id range is allocated with @@ -586,7 +586,7 @@ The function .Fn reqid_istype checks whether the request id .Fa reqid -is withing the range identified by +is within the range identified by .Fa type . The function .Fn reqid_type @@ -777,7 +777,8 @@ is used for GET or GETNEXT. The function .It Fn string_get_max can be used instead of -.Nf stringto ensure that the returned string has a certain maximum length. +.Fn string_get +to ensure that the returned string has a certain maximum length. If .Fa len is -1, the length is computed via @@ -925,4 +926,4 @@ beginning at position This implementation conforms to the applicable IETF RFCs and ITU-T recommendations. .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 11:58:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B00C01065672; Mon, 23 Aug 2010 11:58:45 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99CF28FC15; Mon, 23 Aug 2010 11:58:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7NBwjZ5039916; Mon, 23 Aug 2010 11:58:45 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7NBwjEF039906; Mon, 23 Aug 2010 11:58:45 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201008231158.o7NBwjEF039906@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 23 Aug 2010 11:58:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211702 - in stable: 7/contrib/bsnmp/gensnmpdef 7/contrib/bsnmp/gensnmptree 7/contrib/bsnmp/lib 7/contrib/bsnmp/snmp_mibII 7/contrib/bsnmp/snmpd 8/contrib/bsnmp/gensnmpdef 8/contrib/bsn... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 11:58:45 -0000 Author: uqs Date: Mon Aug 23 11:58:45 2010 New Revision: 211702 URL: http://svn.freebsd.org/changeset/base/211702 Log: MFC r205078,208483,211401-211402,211404: mdoc cleanup - Fix typo in macro name and macro usage. - Consistently spell our email addresses - Wordsmithing of bsnmpd.1; bump .Dd - Fix two minor typos. Modified: stable/7/contrib/bsnmp/gensnmpdef/gensnmpdef.1 stable/7/contrib/bsnmp/gensnmptree/gensnmptree.1 stable/7/contrib/bsnmp/lib/asn1.3 stable/7/contrib/bsnmp/lib/bsnmpagent.3 stable/7/contrib/bsnmp/lib/bsnmpclient.3 stable/7/contrib/bsnmp/lib/bsnmplib.3 stable/7/contrib/bsnmp/snmp_mibII/snmp_mibII.3 stable/7/contrib/bsnmp/snmpd/bsnmpd.1 stable/7/contrib/bsnmp/snmpd/snmpmod.3 Directory Properties: stable/7/contrib/bsnmp/ (props changed) Changes in other areas also in this revision: Modified: stable/8/contrib/bsnmp/gensnmpdef/gensnmpdef.1 stable/8/contrib/bsnmp/gensnmptree/gensnmptree.1 stable/8/contrib/bsnmp/lib/asn1.3 stable/8/contrib/bsnmp/lib/bsnmpagent.3 stable/8/contrib/bsnmp/lib/bsnmpclient.3 stable/8/contrib/bsnmp/lib/bsnmplib.3 stable/8/contrib/bsnmp/snmp_mibII/snmp_mibII.3 stable/8/contrib/bsnmp/snmpd/bsnmpd.1 stable/8/contrib/bsnmp/snmpd/snmpmod.3 Directory Properties: stable/8/contrib/bsnmp/ (props changed) Modified: stable/7/contrib/bsnmp/gensnmpdef/gensnmpdef.1 ============================================================================== --- stable/7/contrib/bsnmp/gensnmpdef/gensnmpdef.1 Mon Aug 23 10:04:26 2010 (r211701) +++ stable/7/contrib/bsnmp/gensnmpdef/gensnmpdef.1 Mon Aug 23 11:58:45 2010 (r211702) @@ -3,7 +3,7 @@ .\" Hartmut Brandt. .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -78,7 +78,7 @@ file by hand. .Sh SEE ALSO .Xr snmpd 1 .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org .Sh BUGS The utility is by no means bullet-proof and may fail for complex or non-standard MIBs. Modified: stable/7/contrib/bsnmp/gensnmptree/gensnmptree.1 ============================================================================== --- stable/7/contrib/bsnmp/gensnmptree/gensnmptree.1 Mon Aug 23 10:04:26 2010 (r211701) +++ stable/7/contrib/bsnmp/gensnmptree/gensnmptree.1 Mon Aug 23 11:58:45 2010 (r211702) @@ -6,7 +6,7 @@ .\" Hartmut Brandt .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -58,7 +58,7 @@ If none of the options .Fl e , .Fl E or -.FL t +.Fl t are used .Nm reads a MIB description from its standard input and creates two files: a @@ -243,4 +243,4 @@ typedef AdminStatus ENUM ( .Sh SEE ALSO .Xr bsnmpd 1 .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org Modified: stable/7/contrib/bsnmp/lib/asn1.3 ============================================================================== --- stable/7/contrib/bsnmp/lib/asn1.3 Mon Aug 23 10:04:26 2010 (r211701) +++ stable/7/contrib/bsnmp/lib/asn1.3 Mon Aug 23 11:58:45 2010 (r211702) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -489,4 +489,4 @@ followed by the error message and an opt This implementation conforms to the applicable IETF RFCs and ITU-T recommendations. .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org Modified: stable/7/contrib/bsnmp/lib/bsnmpagent.3 ============================================================================== --- stable/7/contrib/bsnmp/lib/bsnmpagent.3 Mon Aug 23 10:04:26 2010 (r211701) +++ stable/7/contrib/bsnmp/lib/bsnmpagent.3 Mon Aug 23 11:58:45 2010 (r211702) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -441,4 +441,4 @@ Additionally the functions may call snmp This implementation conforms to the applicable IETF RFCs and ITU-T recommendations. .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org Modified: stable/7/contrib/bsnmp/lib/bsnmpclient.3 ============================================================================== --- stable/7/contrib/bsnmp/lib/bsnmpclient.3 Mon Aug 23 10:04:26 2010 (r211701) +++ stable/7/contrib/bsnmp/lib/bsnmpclient.3 Mon Aug 23 11:58:45 2010 (r211702) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -654,5 +654,5 @@ filed of This implementation conforms to the applicable IETF RFCs and ITU-T recommendations. .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org .An Kendy Kutzner Aq kutzner@fokus.gmd.de Modified: stable/7/contrib/bsnmp/lib/bsnmplib.3 ============================================================================== --- stable/7/contrib/bsnmp/lib/bsnmplib.3 Mon Aug 23 10:04:26 2010 (r211701) +++ stable/7/contrib/bsnmp/lib/bsnmplib.3 Mon Aug 23 11:58:45 2010 (r211702) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -302,4 +302,4 @@ Encoding failed. This implementation conforms to the applicable IETF RFCs and ITU-T recommendations. .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org Modified: stable/7/contrib/bsnmp/snmp_mibII/snmp_mibII.3 ============================================================================== --- stable/7/contrib/bsnmp/snmp_mibII/snmp_mibII.3 Mon Aug 23 10:04:26 2010 (r211701) +++ stable/7/contrib/bsnmp/snmp_mibII/snmp_mibII.3 Mon Aug 23 11:58:45 2010 (r211702) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -363,4 +363,4 @@ The various internet MIBs. .Sh STANDARDS This implementation conforms to the applicable IETF RFCs. .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org Modified: stable/7/contrib/bsnmp/snmpd/bsnmpd.1 ============================================================================== --- stable/7/contrib/bsnmp/snmpd/bsnmpd.1 Mon Aug 23 10:04:26 2010 (r211701) +++ stable/7/contrib/bsnmp/snmpd/bsnmpd.1 Mon Aug 23 11:58:45 2010 (r211702) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -31,7 +31,7 @@ .\" .\" $Begemot: bsnmp/snmpd/bsnmpd.1,v 1.12 2006/02/27 09:50:03 brandt_h Exp $ .\" -.Dd February 27, 2006 +.Dd August 16, 2010 .Dt BSNMPD 1 .Os .Sh NAME @@ -49,7 +49,7 @@ .Sh DESCRIPTION The .Nm -daemon server the internet SNMP (Simple Network Management Protocol). +daemon serves the internet SNMP (Simple Network Management Protocol). It is intended to serve only the absolute basic MIBs and implement all other MIBs through loadable modules. In this way the @@ -59,11 +59,10 @@ can be used in unexpected ways. The options are as follows: .Bl -tag -width ".It Fl D Ar options" .It Fl d -This option is used for debugging -.Nm -and causes it not to daemonize itself. +Do not daemonize. +Used for debugging. .It Fl h -This option prints a short usage message. +Print a short usage message. .It Fl c Ar file Use .Ar file @@ -75,33 +74,32 @@ flag followed by a comma separated strin The following options are available. .Bl -tag -width ".It Cm trace Ns Cm = Ns Cm level" .It Cm dump -This option causes all sent and received PDUs to be dumped to the terminal. +Dump all sent and received PDUs to the terminal. .It Cm events -This causes the debugging level of the event library (see +Set the debugging level of the event library (see .Xr eventlib 3 ) -to be set to 10. +to 10. .It Cm trace Ns Cm = Ns Cm level -This option causes the snmp library trace flag to be set to the specified +Set the snmp library trace flag to the specified value. The value can be specified in the usual C-syntax for numbers. .El .It Fl I Ar paths -This option specifies a colon separated list of directories to search for -configuration include files. +Specify a colon separated list of directories to search for configuration +include files. The default is .Pa /etc:/usr/etc/:/usr/local/etc . These paths are only searched for include specified within <> parentheses. .It Fl l Ar prefix -The +Use .Ar prefix -is used as the default basename for the pid and the configuration files. +as the default basename for the pid and the configuration files. .It Fl m Ar variable Ns Op = Ns Ar value Define a configuration variable. .It Fl p Ar file Specify an alternate pid file instead of the default one. .El .Sh CONFIGURATION -The .Nm reads its configuration from either the default or the user specified configuration file. @@ -218,7 +216,7 @@ If the element is a hostname, the IP address of the host is looked up and the four elements of the IP address are appended to the oid. .Pp -For example a oid of +For example, an oid of .Bd -unfilled -offset indent myvariable.27.foooll.[localhost]."&^!" .Ed @@ -253,13 +251,13 @@ is .It Pa /var/run/ Ns Ao Ar prefix Ac Ns \&.pid Default pid file. .It Pa /etc:/usr/etc/:/usr/local/etc -This is the default search path for system include files. +Default search path for system include files. .It Pa @MIBSPATH@FOKUS-MIB.txt .It Pa @MIBSPATH@BEGEMOT-MIB.txt .It Pa @MIBSPATH@BEGEMOT-SNMPD.txt -The definitions for the MIBs implemented in the daemon. +Definitions for the MIBs implemented in the daemon. .It Pa /etc/hosts.allow, /etc/hosts.deny -Access controls that should be enforced by TCP wrappers should be defined here. +Access controls that should be enforced by TCP wrappers are defined here. Further details are described in .Xr hosts_access 5 . .El @@ -271,6 +269,6 @@ The .Nm conforms to the applicable IETF RFCs. .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org .Sh BUGS Sure. Modified: stable/7/contrib/bsnmp/snmpd/snmpmod.3 ============================================================================== --- stable/7/contrib/bsnmp/snmpd/snmpmod.3 Mon Aug 23 10:04:26 2010 (r211701) +++ stable/7/contrib/bsnmp/snmpd/snmpmod.3 Mon Aug 23 11:58:45 2010 (r211702) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -558,7 +558,7 @@ For modules that implement SNMP client f it may be necessary to identify SNMP requests by their identifier to allow easier routing of responses to the correct sub-system. Request id ranges -provide a way to aquire globally non-overlapping sub-ranges of the entire +provide a way to acquire globally non-overlapping sub-ranges of the entire 31-bit id range. .Pp A request id range is allocated with @@ -586,7 +586,7 @@ The function .Fn reqid_istype checks whether the request id .Fa reqid -is withing the range identified by +is within the range identified by .Fa type . The function .Fn reqid_type @@ -777,7 +777,8 @@ is used for GET or GETNEXT. The function .It Fn string_get_max can be used instead of -.Nf stringto ensure that the returned string has a certain maximum length. +.Fn string_get +to ensure that the returned string has a certain maximum length. If .Fa len is -1, the length is computed via @@ -925,4 +926,4 @@ beginning at position This implementation conforms to the applicable IETF RFCs and ITU-T recommendations. .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 12:40:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0769E1065820; Mon, 23 Aug 2010 12:40:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C92458FC23; Mon, 23 Aug 2010 12:40:39 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 710E446B23; Mon, 23 Aug 2010 08:40:39 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7773A8A04F; Mon, 23 Aug 2010 08:40:38 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Date: Mon, 23 Aug 2010 08:40:19 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201008202058.o7KKwvdp047830@svn.freebsd.org> In-Reply-To: <201008202058.o7KKwvdp047830@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201008230840.20016.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 23 Aug 2010 08:40:38 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r211533 - in stable/7/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/cd9660 fs/udf kern sys ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 12:40:40 -0000 On Friday, August 20, 2010 4:58:57 pm John Baldwin wrote: > Author: jhb > Date: Fri Aug 20 20:58:57 2010 > New Revision: 211533 > URL: http://svn.freebsd.org/changeset/base/211533 > > Log: > Revert 210173 as it did not properly fix the bug. It assumed that the > VI_LOCK() for a given vnode was used as the internal interlock for that > vnode's v_lock lockmgr lock. This is not the case. Instead, add dedicated > routines to toggle the LK_NOSHARE and LK_CANRECURSE flags. These routines > lock the lockmgr lock's internal interlock to synchronize the updates to > the flags member with other threads attempting to acquire the lock. The > VN_LOCK_A*() macros now invoke these routines, and the softupdates code > uses these routines to temporarly enable recursion on buffer locks. This is a direct commit rather than an MFC as the lockmgr implementation is completely different in relation to this bug than in 8.x and later. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 12:57:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C1341065679; Mon, 23 Aug 2010 12:57:27 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 1A93A8FC15; Mon, 23 Aug 2010 12:57:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o7NCk5CT048576; Mon, 23 Aug 2010 06:46:05 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 23 Aug 2010 06:46:13 -0600 (MDT) Message-Id: <20100823.064613.737751539211145619.imp@bsdimp.com> To: danfe@freebsd.org From: "M. Warner Losh" In-Reply-To: <20100823070057.GA6278@FreeBSD.org> References: <4C718595.5050304@FreeBSD.org> <20100823070057.GA6278@FreeBSD.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: scottl@samsco.org, dougb@freebsd.org, rpaulo@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, bz@freebsd.org, svn-src-head@freebsd.org, anchie@freebsd.org Subject: Re: svn commit: r211501 - in head/sys: modules modules/send netinet netinet6 sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 12:57:27 -0000 In message: <20100823070057.GA6278@FreeBSD.org> Alexey Dokuchaev writes: : That said, I wish we all grow a thiker skin and start actually value the : criticism like we did in the old days. We do value criticism, when it is constructive, flexible and well timed. The point that everybody has been making is that Doug's criticism didn't meet these criteria. He chose a bad example (Ana already had a man page in review, evidently) and pressed it beyond all reason. The project has grown to this point because although we have guidelines, we intelligently apply them rather than having cast-in-stone rules (just look at our bylaws, for example). In addition, he presented no evidence to show that we have a problem that's worse than before. He didn't pick, say, those items added in the last year that still don't have documentation to bolster his case, nor did he research to see if there might be a small group of people that don't document and address his concerns to them rather than the whole group which my experience tells me is doing a good, but not perfect, job with documentation. In short, he flew off the handle at an issue he feels strongly about, and has been somewhat inflexible about accepting this very criticism. Warner From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 13:47:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F4E610656B2; Mon, 23 Aug 2010 13:47:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 534638FC2A; Mon, 23 Aug 2010 13:47:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7NDlKvJ042376; Mon, 23 Aug 2010 13:47:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7NDlKVp042375; Mon, 23 Aug 2010 13:47:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201008231347.o7NDlKVp042375@svn.freebsd.org> From: John Baldwin Date: Mon, 23 Aug 2010 13:47:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211703 - in stable/8/sys: . amd64/include/xen cam cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 13:47:20 -0000 Author: jhb Date: Mon Aug 23 13:47:20 2010 New Revision: 211703 URL: http://svn.freebsd.org/changeset/base/211703 Log: Move mergeinfo for sys/cam up to sys. Modified: Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 15:18:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E97A3106566B; Mon, 23 Aug 2010 15:18:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D92A68FC15; Mon, 23 Aug 2010 15:18:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7NFIZ0o044331; Mon, 23 Aug 2010 15:18:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7NFIZeJ044328; Mon, 23 Aug 2010 15:18:35 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008231518.o7NFIZeJ044328@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 23 Aug 2010 15:18:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211704 - in head/lib/libc: . stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 15:18:36 -0000 Author: kib Date: Mon Aug 23 15:18:35 2010 New Revision: 211704 URL: http://svn.freebsd.org/changeset/base/211704 Log: Style. MFC after: 3 days Modified: head/lib/libc/Makefile head/lib/libc/stdlib/atexit.c Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Mon Aug 23 13:47:20 2010 (r211703) +++ head/lib/libc/Makefile Mon Aug 23 15:18:35 2010 (r211704) @@ -124,7 +124,7 @@ libkern.${MACHINE_ARCH}:: ${KMSRCS} .if defined(KMSRCS) && !empty(KMSRCS) cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${MACHINE_ARCH} .endif - + .include # Disable warnings in contributed sources. Modified: head/lib/libc/stdlib/atexit.c ============================================================================== --- head/lib/libc/stdlib/atexit.c Mon Aug 23 13:47:20 2010 (r211703) +++ head/lib/libc/stdlib/atexit.c Mon Aug 23 15:18:35 2010 (r211704) @@ -120,7 +120,7 @@ atexit(void (*func)(void)) int error; fn.fn_type = ATEXIT_FN_STD; - fn.fn_ptr.std_func = func;; + fn.fn_ptr.std_func = func; fn.fn_arg = NULL; fn.fn_dso = NULL; @@ -139,7 +139,7 @@ __cxa_atexit(void (*func)(void *), void int error; fn.fn_type = ATEXIT_FN_CXA; - fn.fn_ptr.cxa_func = func;; + fn.fn_ptr.cxa_func = func; fn.fn_arg = arg; fn.fn_dso = dso; From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 15:27:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D76B10656A4; Mon, 23 Aug 2010 15:27:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F05C88FC08; Mon, 23 Aug 2010 15:27:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7NFR3ih044562; Mon, 23 Aug 2010 15:27:03 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7NFR32e044556; Mon, 23 Aug 2010 15:27:03 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008231527.o7NFR32e044556@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 23 Aug 2010 15:27:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211705 - in head: lib/libc/gen libexec/rtld-elf sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 15:27:04 -0000 Author: kib Date: Mon Aug 23 15:27:03 2010 New Revision: 211705 URL: http://svn.freebsd.org/changeset/base/211705 Log: Introduce implementation-private rtld interface _rtld_addr_phdr, which fills struct dl_phdr_info for the shared object that contains the specified address, if any. Idea and reviewed by: kan MFC after: 3 weeks Modified: head/lib/libc/gen/Symbol.map head/lib/libc/gen/dlfcn.c head/libexec/rtld-elf/Symbol.map head/libexec/rtld-elf/rtld.c head/sys/sys/link_elf.h Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Mon Aug 23 15:18:35 2010 (r211704) +++ head/lib/libc/gen/Symbol.map Mon Aug 23 15:27:03 2010 (r211705) @@ -446,6 +446,7 @@ FBSDprivate_1.0 { _spinlock; _spinlock_debug; _spinunlock; + _rtld_addr_phdr; _rtld_atfork_pre; _rtld_atfork_post; _rtld_error; /* for private use */ Modified: head/lib/libc/gen/dlfcn.c ============================================================================== --- head/lib/libc/gen/dlfcn.c Mon Aug 23 15:18:35 2010 (r211704) +++ head/lib/libc/gen/dlfcn.c Mon Aug 23 15:27:03 2010 (r211705) @@ -157,3 +157,11 @@ void _rtld_atfork_post(int *locks) { } + +#pragma weak _rtld_addr_phdr +int +_rtld_addr_phdr(const void *addr, struct dl_phdr_info *phdr_info) +{ + + return (0); +} Modified: head/libexec/rtld-elf/Symbol.map ============================================================================== --- head/libexec/rtld-elf/Symbol.map Mon Aug 23 15:18:35 2010 (r211704) +++ head/libexec/rtld-elf/Symbol.map Mon Aug 23 15:27:03 2010 (r211705) @@ -27,4 +27,5 @@ FBSDprivate_1.0 { _rtld_free_tls; _rtld_atfork_pre; _rtld_atfork_post; + _rtld_addr_phdr; }; Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Mon Aug 23 15:18:35 2010 (r211704) +++ head/libexec/rtld-elf/rtld.c Mon Aug 23 15:27:03 2010 (r211705) @@ -147,6 +147,8 @@ static int rtld_verify_object_versions( static void object_add_name(Obj_Entry *, const char *); static int object_match_name(const Obj_Entry *, const char *); static void ld_utrace_log(int, void *, void *, size_t, int, const char *); +static void rtld_fill_dl_phdr_info(const Obj_Entry *obj, + struct dl_phdr_info *phdr_info); void r_debug_state(struct r_debug *, struct link_map *); @@ -220,6 +222,7 @@ static func_ptr_type exports[] = { (func_ptr_type) &dl_iterate_phdr, (func_ptr_type) &_rtld_atfork_pre, (func_ptr_type) &_rtld_atfork_post, + (func_ptr_type) &_rtld_addr_phdr, NULL }; @@ -2261,6 +2264,24 @@ dlvsym(void *handle, const char *name, c } int +_rtld_addr_phdr(const void *addr, struct dl_phdr_info *phdr_info) +{ + const Obj_Entry *obj; + int lockstate; + + lockstate = rlock_acquire(rtld_bind_lock); + obj = obj_from_addr(addr); + if (obj == NULL) { + _rtld_error("No shared object contains address"); + rlock_release(rtld_bind_lock, lockstate); + return (0); + } + rtld_fill_dl_phdr_info(obj, phdr_info); + rlock_release(rtld_bind_lock, lockstate); + return (1); +} + +int dladdr(const void *addr, Dl_info *info) { const Obj_Entry *obj; @@ -2362,6 +2383,21 @@ dlinfo(void *handle, int request, void * return (error); } +static void +rtld_fill_dl_phdr_info(const Obj_Entry *obj, struct dl_phdr_info *phdr_info) +{ + + phdr_info->dlpi_addr = (Elf_Addr)obj->relocbase; + phdr_info->dlpi_name = STAILQ_FIRST(&obj->names) ? + STAILQ_FIRST(&obj->names)->name : obj->path; + phdr_info->dlpi_phdr = obj->phdr; + phdr_info->dlpi_phnum = obj->phsize / sizeof(obj->phdr[0]); + phdr_info->dlpi_tls_modid = obj->tlsindex; + phdr_info->dlpi_tls_data = obj->tlsinit; + phdr_info->dlpi_adds = obj_loads; + phdr_info->dlpi_subs = obj_loads - obj_count; +} + int dl_iterate_phdr(__dl_iterate_hdr_callback callback, void *param) { @@ -2375,16 +2411,7 @@ dl_iterate_phdr(__dl_iterate_hdr_callbac error = 0; for (obj = obj_list; obj != NULL; obj = obj->next) { - phdr_info.dlpi_addr = (Elf_Addr)obj->relocbase; - phdr_info.dlpi_name = STAILQ_FIRST(&obj->names) ? - STAILQ_FIRST(&obj->names)->name : obj->path; - phdr_info.dlpi_phdr = obj->phdr; - phdr_info.dlpi_phnum = obj->phsize / sizeof(obj->phdr[0]); - phdr_info.dlpi_tls_modid = obj->tlsindex; - phdr_info.dlpi_tls_data = obj->tlsinit; - phdr_info.dlpi_adds = obj_loads; - phdr_info.dlpi_subs = obj_loads - obj_count; - + rtld_fill_dl_phdr_info(obj, &phdr_info); if ((error = callback(&phdr_info, sizeof phdr_info, param)) != 0) break; Modified: head/sys/sys/link_elf.h ============================================================================== --- head/sys/sys/link_elf.h Mon Aug 23 15:18:35 2010 (r211704) +++ head/sys/sys/link_elf.h Mon Aug 23 15:27:03 2010 (r211705) @@ -92,6 +92,7 @@ __BEGIN_DECLS typedef int (*__dl_iterate_hdr_callback)(struct dl_phdr_info *, size_t, void *); extern int dl_iterate_phdr(__dl_iterate_hdr_callback, void *); +int _rtld_addr_phdr(const void *, struct dl_phdr_info *); __END_DECLS From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 15:38:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDB291065694; Mon, 23 Aug 2010 15:38:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CAF6D8FC19; Mon, 23 Aug 2010 15:38:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7NFc2ib044794; Mon, 23 Aug 2010 15:38:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7NFc26I044784; Mon, 23 Aug 2010 15:38:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008231538.o7NFc26I044784@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 23 Aug 2010 15:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211706 - in head: lib/libc/gen lib/libc/include lib/libc/stdlib lib/libthr lib/libthr/thread libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 15:38:03 -0000 Author: kib Date: Mon Aug 23 15:38:02 2010 New Revision: 211706 URL: http://svn.freebsd.org/changeset/base/211706 Log: On shared object unload, in __cxa_finalize, call and clear all installed atexit and __cxa_atexit handlers that are either installed by unloaded dso, or points to the functions provided by the dso. Use _rtld_addr_phdr to locate segment information from the address of private variable belonging to the dso, supplied by crtstuff.c. Provide utility function __elf_phdr_match_addr to do the match of address against dso executable segment. Call back into libthr from __cxa_finalize using weak __pthread_cxa_finalize symbol to remove any atfork handler which function points into unloaded object. The rtld needs private __pthread_cxa_finalize symbol to not require resolution of the weak undefined symbol at initialization time. This cannot work, since rtld is relocated before sym_zero is set up. Idea by: kan Reviewed by: kan (previous version) MFC after: 3 weeks Added: head/lib/libc/gen/elf_utils.c (contents, props changed) Modified: head/lib/libc/gen/Makefile.inc head/lib/libc/gen/Symbol.map head/lib/libc/include/libc_private.h head/lib/libc/stdlib/atexit.c head/lib/libthr/pthread.map head/lib/libthr/thread/thr_fork.c head/lib/libthr/thread/thr_private.h head/libexec/rtld-elf/rtld.c Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Mon Aug 23 15:27:03 2010 (r211705) +++ head/lib/libc/gen/Makefile.inc Mon Aug 23 15:38:02 2010 (r211706) @@ -10,7 +10,7 @@ SRCS+= __getosreldate.c __xuname.c \ alarm.c arc4random.c assert.c aux.c basename.c check_utility_compat.c \ clock.c closedir.c confstr.c \ crypt.c ctermid.c daemon.c devname.c dirname.c disklabel.c \ - dlfcn.c drand48.c erand48.c err.c errlst.c errno.c \ + dlfcn.c drand48.c elf_utils.c erand48.c err.c errlst.c errno.c \ exec.c fdevname.c feature_present.c fmtcheck.c fmtmsg.c fnmatch.c \ fpclassify.c frexp.c fstab.c ftok.c fts.c fts-compat.c ftw.c \ getbootfile.c getbsize.c \ Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Mon Aug 23 15:27:03 2010 (r211705) +++ head/lib/libc/gen/Symbol.map Mon Aug 23 15:38:02 2010 (r211706) @@ -451,6 +451,7 @@ FBSDprivate_1.0 { _rtld_atfork_post; _rtld_error; /* for private use */ _rtld_thread_init; /* for private use */ + __elf_phdr_match_addr; _err; _warn; __fmtcheck; Added: head/lib/libc/gen/elf_utils.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/elf_utils.c Mon Aug 23 15:38:02 2010 (r211706) @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2010 Konstantin Belousov + * 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. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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$ + */ + +#include + +int +__elf_phdr_match_addr(struct dl_phdr_info *phdr_info, void *addr) +{ + const Elf_Phdr *ph; + int i; + + for (i = 0; i < phdr_info->dlpi_phnum; i++) { + ph = &phdr_info->dlpi_phdr[i]; + if (ph->p_type != PT_LOAD || (ph->p_flags & PF_X) == 0) + continue; + if (phdr_info->dlpi_addr + ph->p_vaddr <= (uintptr_t)addr && + (uintptr_t)addr + sizeof(addr) < phdr_info->dlpi_addr + + ph->p_vaddr + ph->p_memsz) + break; + } + return (i != phdr_info->dlpi_phnum); +} Modified: head/lib/libc/include/libc_private.h ============================================================================== --- head/lib/libc/include/libc_private.h Mon Aug 23 15:27:03 2010 (r211705) +++ head/lib/libc/include/libc_private.h Mon Aug 23 15:38:02 2010 (r211706) @@ -214,5 +214,7 @@ extern int __sys_fcntl(int, int, ...); int _execvpe(const char *, char * const *, char * const *); int _elf_aux_info(int aux, void *buf, int buflen); +struct dl_phdr_info; +int __elf_phdr_match_addr(struct dl_phdr_info *, void *); #endif /* _LIBC_PRIVATE_H_ */ Modified: head/lib/libc/stdlib/atexit.c ============================================================================== --- head/lib/libc/stdlib/atexit.c Mon Aug 23 15:27:03 2010 (r211705) +++ head/lib/libc/stdlib/atexit.c Mon Aug 23 15:38:02 2010 (r211706) @@ -37,6 +37,7 @@ static char sccsid[] = "@(#)atexit.c 8.2 __FBSDID("$FreeBSD$"); #include "namespace.h" +#include #include #include #include @@ -147,6 +148,9 @@ __cxa_atexit(void (*func)(void *), void return (error); } +#pragma weak __pthread_cxa_finalize +void __pthread_cxa_finalize(const struct dl_phdr_info *); + /* * Call all handlers registered with __cxa_atexit for the shared * object owning 'dso'. Note: if 'dso' is NULL, then all remaining @@ -155,18 +159,28 @@ __cxa_atexit(void (*func)(void *), void void __cxa_finalize(void *dso) { + struct dl_phdr_info phdr_info; struct atexit *p; struct atexit_fn fn; - int n; + int n, has_phdr; + + if (dso != NULL) + has_phdr = _rtld_addr_phdr(dso, &phdr_info); + else + has_phdr = 0; _MUTEX_LOCK(&atexit_mutex); for (p = __atexit; p; p = p->next) { for (n = p->ind; --n >= 0;) { if (p->fns[n].fn_type == ATEXIT_FN_EMPTY) continue; /* already been called */ - if (dso != NULL && dso != p->fns[n].fn_dso) - continue; /* wrong DSO */ fn = p->fns[n]; + if (dso != NULL && dso != fn.fn_dso) { + /* wrong DSO ? */ + if (!has_phdr || !__elf_phdr_match_addr( + &phdr_info, fn.fn_ptr.cxa_func)) + continue; + } /* Mark entry to indicate that this particular handler has already been called. @@ -185,4 +199,7 @@ __cxa_finalize(void *dso) _MUTEX_UNLOCK(&atexit_mutex); if (dso == NULL) _MUTEX_DESTROY(&atexit_mutex); + + if (&__pthread_cxa_finalize != NULL) + __pthread_cxa_finalize(&phdr_info); } Modified: head/lib/libthr/pthread.map ============================================================================== --- head/lib/libthr/pthread.map Mon Aug 23 15:27:03 2010 (r211705) +++ head/lib/libthr/pthread.map Mon Aug 23 15:38:02 2010 (r211706) @@ -192,6 +192,7 @@ FBSDprivate_1.0 { __poll; __pthread_cond_timedwait; __pthread_cond_wait; + __pthread_cxa_finalize; __pthread_mutex_init; __pthread_mutex_lock; __pthread_mutex_timedlock; Modified: head/lib/libthr/thread/thr_fork.c ============================================================================== --- head/lib/libthr/thread/thr_fork.c Mon Aug 23 15:27:03 2010 (r211705) +++ head/lib/libthr/thread/thr_fork.c Mon Aug 23 15:38:02 2010 (r211706) @@ -59,6 +59,7 @@ #include "namespace.h" #include +#include #include #include #include @@ -94,6 +95,27 @@ _pthread_atfork(void (*prepare)(void), v return (0); } +void +__pthread_cxa_finalize(struct dl_phdr_info *phdr_info) +{ + struct pthread *curthread; + struct pthread_atfork *af, *af1; + + _thr_check_init(); + + curthread = _get_curthread(); + THR_UMUTEX_LOCK(curthread, &_thr_atfork_lock); + TAILQ_FOREACH_SAFE(af, &_thr_atfork_list, qe, af1) { + if (__elf_phdr_match_addr(phdr_info, af->prepare) || + __elf_phdr_match_addr(phdr_info, af->parent) || + __elf_phdr_match_addr(phdr_info, af->child)) { + TAILQ_REMOVE(&_thr_atfork_list, af, qe); + free(af); + } + } + THR_UMUTEX_UNLOCK(curthread, &_thr_atfork_lock); +} + __weak_reference(_fork, fork); pid_t _fork(void); Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Mon Aug 23 15:27:03 2010 (r211705) +++ head/lib/libthr/thread/thr_private.h Mon Aug 23 15:38:02 2010 (r211706) @@ -740,6 +740,9 @@ _thr_check_init(void) _libpthread_init(NULL); } +struct dl_phdr_info; +void __pthread_cxa_finalize(struct dl_phdr_info *phdr_info); + __END_DECLS #endif /* !_THR_PRIVATE_H */ Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Mon Aug 23 15:27:03 2010 (r211705) +++ head/libexec/rtld-elf/rtld.c Mon Aug 23 15:38:02 2010 (r211706) @@ -3692,6 +3692,10 @@ fetch_ventry(const Obj_Entry *obj, unsig return NULL; } +/* + * Overrides for libc_pic-provided functions. + */ + int __getosreldate(void) { @@ -3711,3 +3715,11 @@ __getosreldate(void) osreldate = osrel; return (osreldate); } + +/* + * No unresolved symbols for rtld. + */ +void +__pthread_cxa_finalize(struct dl_phdr_info *a) +{ +} From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 16:33:52 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2CCE106566C; Mon, 23 Aug 2010 16:33:52 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 8093E8FC15; Mon, 23 Aug 2010 16:33:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o7NGTbfg052060; Mon, 23 Aug 2010 10:29:37 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 23 Aug 2010 10:29:46 -0600 (MDT) Message-Id: <20100823.102946.974954616532377663.imp@bsdimp.com> To: pluknet@gmail.com From: "M. Warner Losh" In-Reply-To: References: <201008230622.o7N6MZnT029820@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r211695 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 16:33:53 -0000 Hi Pluknet... I think that kern/Makefile is an ex-parrot and plan on removing it later today. Warner P.S. sorry for the top post, but I wanted things in the archives.. In message: pluknet writes: : On 23 August 2010 10:22, Warner Losh wrote: : > Author: imp : > Date: Mon Aug 23 06:22:35 2010 : > New Revision: 211695 : > URL: http://svn.freebsd.org/changeset/base/211695 : > : > Log: : > =A0This should really be MACHINE not MACHINE_ARCH, and is this Make= file even used? : > : = : Hi. : = : I wrote this letter almost 2.5y ago with no response. : Hope this helps. : = : %%% : I looked at sys/kern/ Makefile Make.tags.inc. AFAICS they were partia= lly : abandoned years ago and has broken tags support and even contain 4.4B= SD-Lite : paths, that never ever being in FreeBSD CVS or was dropped years ago.= So make : links exits with error. It looks very odd: : = : pl$ make links : rm -f /var/db/sys_tags : ln -s /sys/i386/tags /var/db/sys_tags : for i in conf dev dev/scsi fs fs/deadfs fs/fdescfs fs/fifofs : fs/lofs fs/nullfs fs/portalfs fs/procfs fs/specfs fs/unionfs hp : hp/dev hp/hpux kern libkern net netinet nfs scripts sys ufs ufs/ff= s : ufs/lfs ufs/ufs vm; do (cd ../$i && { rm -f tags; ln -s : /var/db/sys_tags tags; }) done : cd: can't cd to ../dev/scsi : cd: can't cd to ../fs/lofs : cd: can't cd to ../fs/specfs : cd: can't cd to ../hp : cd: can't cd to ../hp/dev : cd: can't cd to ../hp/hpux : cd: can't cd to ../scripts : cd: can't cd to ../ufs/lfs : for i in i386; do (cd ../$i && make SYSTAGS=3D/var/db/sys_tags link= s); done : for i in /sys/conf /sys/kern /sys/net /sys/netatalk /sys/netatm : /sys/netinet /sys/netinet6 /sys/netipsec /sys/netipx /sys/netnatm= : /sys/nfs /sys/pci /sys/vm /sys/sys; do (cd $i && { rm -f tags; ln= : -s ../i386/tags tags; }) done : for i in /sys/dev/advansys /sys/dev/aha /sys/dev/aic7xxx : /sys/dev/buslogic /sys/dev/ccd /sys/dev/dec /sys/dev/dpt : /sys/dev/en /sys/dev/hea /sys/dev/hfa /sys/dev/iicbus /sys/dev/is= p : /sys/dev/pdq /sys/dev/ppbus /sys/dev/smbus /sys/dev/vn : /sys/dev/vx /sys/fs/deadfs /sys/fs/devfs /sys/fs/fdescfs : /sys/fs/fifofs /sys/fs/msdosfs /sys/fs/nullfs /sys/fs/portalfs : /sys/fs/procfs /sys : /fs/specfs /sys/fs/unionfs /sys/fs/cd9660 /sys/ufs/ffs : /sys/ufs/ufs; do (cd $i && { rm -f tags; ln -s ../../i386/tags tags;= : }) done : cd: can't cd to /sys/dev/ccd : cd: can't cd to /sys/dev/dec : cd: can't cd to /sys/dev/hea : cd: can't cd to /sys/dev/vn : cd: can't cd to /sys/fs/specfs : for i in apm i386 ibcs2 include isa linux; do (cd $i && { rm -f tags= ; : ln -s ../tags tags; }) done : cd: can't cd to apm : = : I moved that two files from src and could complete build kernel : without errors, so it : seems they are not referenced by any kernel building tools. : = : Yes, there is tags target in src/Makefile, I didn't looked too much : how it interacts with Makefile Make.tags.inc, but by their erroneous : paths I doubt there is any interaction. : = : I found this in NetBSD's kern/Makefile: : +# XXX : +# [Note by Perry Metzger, Sept. 1998] : +# As it stands, the tags support below is hopelessly : +# broken. Just look at the names of the architectures it is dealing : +# with and where it expects to find the support for them to see why.= : +# I've left the stuff in this Makefile alone in the hope that someon= e : +# will fix it someday -- I am assuming that it might help that : +# person if they have the old Makefile goo left in place as a starti= ng : +# point. : +# XXX : = : ps. BTW I tried to make tags from src/ (with clean obj, if that : matters) and the target : began to build my gcc (cc/cc_tools) after going through various world= paths. : Is that intended? : %%% : = : -- = : wbr, : pluknet : = From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 16:47:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 155A61065674; Mon, 23 Aug 2010 16:47:30 +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 040108FC1A; Mon, 23 Aug 2010 16:47:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7NGlT1T046330; Mon, 23 Aug 2010 16:47:29 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7NGlT2I046328; Mon, 23 Aug 2010 16:47:29 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201008231647.o7NGlT2I046328@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 23 Aug 2010 16:47:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211707 - head/cddl/lib/libzpool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 16:47:30 -0000 Author: nwhitehorn Date: Mon Aug 23 16:47:29 2010 New Revision: 211707 URL: http://svn.freebsd.org/changeset/base/211707 Log: Add powerpc64 to the list of architectures with real atomic operations. Submitted by: imp Modified: head/cddl/lib/libzpool/Makefile Modified: head/cddl/lib/libzpool/Makefile ============================================================================== --- head/cddl/lib/libzpool/Makefile Mon Aug 23 15:38:02 2010 (r211706) +++ head/cddl/lib/libzpool/Makefile Mon Aug 23 16:47:29 2010 (r211707) @@ -11,7 +11,7 @@ # LIST_SRCS .PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/os # ATOMIC_SRCS -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" || ${MACHINE_ARCH} == "powerpc64" .PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH} ATOMIC_SRCS= opensolaris_atomic.S .else From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 17:48:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C2C21065672; Mon, 23 Aug 2010 17:48:50 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AD598FC13; Mon, 23 Aug 2010 17:48:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7NHmoJY047992; Mon, 23 Aug 2010 17:48:50 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7NHmo9L047990; Mon, 23 Aug 2010 17:48:50 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201008231748.o7NHmo9L047990@svn.freebsd.org> From: Maksim Yevmenkin Date: Mon, 23 Aug 2010 17:48:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211713 - stable/7/sys/netgraph/bluetooth/l2cap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 17:48:50 -0000 Author: emax Date: Mon Aug 23 17:48:50 2010 New Revision: 211713 URL: http://svn.freebsd.org/changeset/base/211713 Log: MFC r210783 as requested by Helge Oldach on freebsd-bluetooth@ Fix typo PR: kern/140590 Modified: stable/7/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.h ============================================================================== --- stable/7/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.h Mon Aug 23 17:27:29 2010 (r211712) +++ stable/7/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.h Mon Aug 23 17:48:50 2010 (r211713) @@ -379,7 +379,7 @@ do { \ break; \ \ c = mtod((_m), struct _info_rsp *); \ - c->hdr.code = NG_L2CAP_INFO_REQ; \ + c->hdr.code = NG_L2CAP_INFO_RSP; \ c->hdr.ident = (_ident); \ c->hdr.length = sizeof(c->param); \ \ From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 18:25:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 106071065757; Mon, 23 Aug 2010 18:25:21 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id BD6058FC12; Mon, 23 Aug 2010 18:25:20 +0000 (UTC) Received: by pzk7 with SMTP id 7so2676683pzk.13 for ; Mon, 23 Aug 2010 11:25:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=Y+ip7Ht8VCyi49uw3dLOx1yRtcs1F9sZHjhvCQzDE1I=; b=prN9vAkmwrfeo+LdcdLU+GGh/67sZ31T4f7pJRtRSL9Bllz1Motd2x3ay8egI1MqVJ q0IRgdqQ/3c6Ji2PR8IVD2GSfxmKsufcOes8Op2KrR6XNlB/j6g8dxIadiUSvAtlgYNG dyUNpBgMxv/GM7p0s/bPlzlaVWMnMCnqZ85Ao= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=lwWE2FlBzxLpKUl/9Ams1XoRpDAlQla3gRaFpxHXzY0i14NUCP5ZqW9UoHivLWygqz PbX7eo+lMDvG5qwDqrHFcVumPA48tWNcfAorFG/CpRhzpnTCewr2BaXgAseS7fKe93mT xp0tHvtgW1N3HzlPKxVyQN1E7WO+5dr/B26rQ= Received: by 10.142.165.13 with SMTP id n13mr2379343wfe.292.1282587920040; Mon, 23 Aug 2010 11:25:20 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id q27sm8809446wfc.18.2010.08.23.11.25.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 23 Aug 2010 11:25:18 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Mon, 23 Aug 2010 11:25:16 -0700 From: Pyun YongHyeon Date: Mon, 23 Aug 2010 11:25:16 -0700 To: Scott Long Message-ID: <20100823182516.GC1116@michelle.cdnetworks.com> References: <201008222126.o7MLQavY016669@svn.freebsd.org> <7C069EE9-33B9-4D57-A6E6-C133F6C47D53@samsco.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7C069EE9-33B9-4D57-A6E6-C133F6C47D53@samsco.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pyun YongHyeon Subject: Re: svn commit: r211648 - head/sys/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 18:25:21 -0000 On Mon, Aug 23, 2010 at 12:27:33AM -0600, Scott Long wrote: > On Aug 22, 2010, at 3:26 PM, Pyun YongHyeon wrote: > > Author: yongari > > Date: Sun Aug 22 21:26:35 2010 > > New Revision: 211648 > > URL: http://svn.freebsd.org/changeset/base/211648 > > > > Log: > > It seems some newer RTL8139 controllers provides only memory space > > register mapping. > > Something that I'm seeing more of in recent years is vendors putting descriptive information into PCI VPD attributes, and having their Windows and Linux drivers read these attributes and select behavior off of them instead of selecting based on PCI ID. I don't have any RLT8139 specs to confirm that this would be the case here, but it might be something to consider looking into. > I also don't have data sheet for RTL8139 and I never saw rl(4) controllers which have VPD capability. But I think that's good idea to check. I've sent request mail to the user. Thanks for hints. :-) > Scott > From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 18:51:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B590D10656A4; Mon, 23 Aug 2010 18:51:31 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AC238FC18; Mon, 23 Aug 2010 18:51:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7NIpVla049570; Mon, 23 Aug 2010 18:51:31 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7NIpVeW049568; Mon, 23 Aug 2010 18:51:31 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008231851.o7NIpVeW049568@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 23 Aug 2010 18:51:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211716 - head/sys/dev/xl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 18:51:31 -0000 Author: yongari Date: Mon Aug 23 18:51:31 2010 New Revision: 211716 URL: http://svn.freebsd.org/changeset/base/211716 Log: Move xl_reset() to xl_init_locked(). This will make driver initialize controller from a known good state. Previously driver used to issue controller reset while TX/RX DMA are in progress. I guess resetting controller in active TX/RX DMA cycle is to ensure stopping I/Os in xl_shutdown(). I remember some buggy controllers didn't respond with stop command if controller is under high network load at the time of shutdown so resetting controller was the only safe way to stop the I/Os. However, from my experiments, controller always responded with stop command under high network load so I think it's okay to remove the xl_reset() in device_shutdown handler. Resetting controller also will clear configured RX filter which in turn will make WOL support hard because driver have to reprogram RX filter in WOL handler as well as setting station address. Modified: head/sys/dev/xl/if_xl.c Modified: head/sys/dev/xl/if_xl.c ============================================================================== --- head/sys/dev/xl/if_xl.c Mon Aug 23 18:21:40 2010 (r211715) +++ head/sys/dev/xl/if_xl.c Mon Aug 23 18:51:31 2010 (r211716) @@ -1635,7 +1635,6 @@ xl_detach(device_t dev) /* These should only be active if attach succeeded */ if (device_is_attached(dev)) { XL_LOCK(sc); - xl_reset(sc); xl_stop(sc); XL_UNLOCK(sc); taskqueue_drain(taskqueue_swi, &sc->xl_task); @@ -2246,7 +2245,6 @@ xl_intr(void *arg) } if (status & XL_STAT_ADFAIL) { - xl_reset(sc); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; xl_init_locked(sc); } @@ -2318,7 +2316,6 @@ xl_poll_locked(struct ifnet *ifp, enum p } if (status & XL_STAT_ADFAIL) { - xl_reset(sc); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; xl_init_locked(sc); } @@ -2754,6 +2751,9 @@ xl_init_locked(struct xl_softc *sc) */ xl_stop(sc); + /* Reset the chip to a known state. */ + xl_reset(sc); + if (sc->xl_miibus == NULL) { CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_RX_RESET); xl_wait(sc); @@ -3236,7 +3236,6 @@ xl_watchdog(struct xl_softc *sc) device_printf(sc->xl_dev, "no carrier - transceiver cable problem?\n"); - xl_reset(sc); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; xl_init_locked(sc); @@ -3335,7 +3334,6 @@ xl_shutdown(device_t dev) sc = device_get_softc(dev); XL_LOCK(sc); - xl_reset(sc); xl_stop(sc); XL_UNLOCK(sc); @@ -3367,7 +3365,6 @@ xl_resume(device_t dev) XL_LOCK(sc); - xl_reset(sc); if (ifp->if_flags & IFF_UP) { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; xl_init_locked(sc); From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 19:18:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C99E1065673; Mon, 23 Aug 2010 19:18:51 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 117BE8FC1D; Mon, 23 Aug 2010 19:18:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7NJIok8050144; Mon, 23 Aug 2010 19:18:50 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7NJIobo050141; Mon, 23 Aug 2010 19:18:50 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008231918.o7NJIobo050141@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 23 Aug 2010 19:18:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211717 - head/sys/dev/xl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 19:18:51 -0000 Author: yongari Date: Mon Aug 23 19:18:50 2010 New Revision: 211717 URL: http://svn.freebsd.org/changeset/base/211717 Log: Implement basic WOL support. Note, not all xl(4) controllers support WOL. Some controllers require additional 3-wire auxiliary remote wakeup connector to draw power. More recent xl(4) controllers may not need the wakeup connector though. Modified: head/sys/dev/xl/if_xl.c head/sys/dev/xl/if_xlreg.h Modified: head/sys/dev/xl/if_xl.c ============================================================================== --- head/sys/dev/xl/if_xl.c Mon Aug 23 18:51:31 2010 (r211716) +++ head/sys/dev/xl/if_xl.c Mon Aug 23 19:18:50 2010 (r211717) @@ -246,6 +246,7 @@ static int xl_watchdog(struct xl_softc * static int xl_shutdown(device_t); static int xl_suspend(device_t); static int xl_resume(device_t); +static void xl_setwol(struct xl_softc *); #ifdef DEVICE_POLLING static int xl_poll(struct ifnet *ifp, enum poll_cmd cmd, int count); @@ -1145,10 +1146,10 @@ static int xl_attach(device_t dev) { u_char eaddr[ETHER_ADDR_LEN]; - u_int16_t xcvr[2]; + u_int16_t sinfo2, xcvr[2]; struct xl_softc *sc; struct ifnet *ifp; - int media; + int media, pmcap; int unit, error = 0, rid, res; uint16_t did; @@ -1405,6 +1406,18 @@ xl_attach(device_t dev) else sc->xl_type = XL_TYPE_90X; + /* Check availability of WOL. */ + if ((sc->xl_caps & XL_CAPS_PWRMGMT) != 0 && + pci_find_extcap(dev, PCIY_PMG, &pmcap) == 0) { + sc->xl_pmcap = pmcap; + sc->xl_flags |= XL_FLAG_WOL; + sinfo2 = 0; + xl_read_eeprom(sc, (caddr_t)&sinfo2, XL_EE_SOFTINFO2, 1, 0); + if ((sinfo2 & XL_SINFO2_AUX_WOL_CON) == 0 && bootverbose) + device_printf(dev, + "No auxiliary remote wakeup connector!\n"); + } + /* Set the TX start threshold for best performance. */ sc->xl_tx_thresh = XL_MIN_FRAMELEN; @@ -1419,6 +1432,8 @@ xl_attach(device_t dev) ifp->if_capabilities |= IFCAP_HWCSUM; #endif } + if ((sc->xl_flags & XL_FLAG_WOL) != 0) + ifp->if_capabilities |= IFCAP_WOL_MAGIC; ifp->if_capenable = ifp->if_capabilities; #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; @@ -2765,6 +2780,15 @@ xl_init_locked(struct xl_softc *sc) if (sc->xl_miibus != NULL) mii = device_get_softc(sc->xl_miibus); + /* + * Clear WOL status and disable all WOL feature as WOL + * would interfere Rx operation under normal environments. + */ + if ((sc->xl_flags & XL_FLAG_WOL) != 0) { + XL_SEL_WIN(7); + CSR_READ_2(sc, XL_W7_BM_PME); + CSR_WRITE_2(sc, XL_W7_BM_PME, 0); + } /* Init our MAC address */ XL_SEL_WIN(2); for (i = 0; i < ETHER_ADDR_LEN; i++) { @@ -3187,6 +3211,9 @@ xl_ioctl(struct ifnet *ifp, u_long comma if ((mask & IFCAP_RXCSUM) != 0 && (ifp->if_capabilities & IFCAP_RXCSUM) != 0) ifp->if_capenable ^= IFCAP_RXCSUM; + if ((mask & IFCAP_WOL_MAGIC) != 0 && + (ifp->if_capabilities & IFCAP_WOL_MAGIC) != 0) + ifp->if_capenable ^= IFCAP_WOL_MAGIC; XL_UNLOCK(sc); break; default: @@ -3329,15 +3356,8 @@ xl_stop(struct xl_softc *sc) static int xl_shutdown(device_t dev) { - struct xl_softc *sc; - - sc = device_get_softc(dev); - - XL_LOCK(sc); - xl_stop(sc); - XL_UNLOCK(sc); - return (0); + return (xl_suspend(dev)); } static int @@ -3349,6 +3369,7 @@ xl_suspend(device_t dev) XL_LOCK(sc); xl_stop(sc); + xl_setwol(sc); XL_UNLOCK(sc); return (0); @@ -3374,3 +3395,34 @@ xl_resume(device_t dev) return (0); } + +static void +xl_setwol(struct xl_softc *sc) +{ + struct ifnet *ifp; + u_int16_t cfg, pmstat; + + if ((sc->xl_flags & XL_FLAG_WOL) == 0) + return; + + ifp = sc->xl_ifp; + XL_SEL_WIN(7); + /* Clear any pending PME events. */ + CSR_READ_2(sc, XL_W7_BM_PME); + cfg = 0; + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + cfg |= XL_BM_PME_MAGIC; + CSR_WRITE_2(sc, XL_W7_BM_PME, cfg); + /* Enable RX. */ + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_RX_ENABLE); + /* Request PME. */ + pmstat = pci_read_config(sc->xl_dev, + sc->xl_pmcap + PCIR_POWER_STATUS, 2); + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + pmstat |= PCIM_PSTAT_PMEENABLE; + else + pmstat &= ~PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->xl_dev, + sc->xl_pmcap + PCIR_POWER_STATUS, pmstat, 2); +} Modified: head/sys/dev/xl/if_xlreg.h ============================================================================== --- head/sys/dev/xl/if_xlreg.h Mon Aug 23 18:51:31 2010 (r211716) +++ head/sys/dev/xl/if_xlreg.h Mon Aug 23 19:18:50 2010 (r211717) @@ -81,6 +81,17 @@ #define XL_CAPS_100MBPS 0x1000 #define XL_CAPS_PWRMGMT 0x2000 +/* + * Bits in the software information 2 word + */ +#define XL_SINFO2_FIXED_BCAST_RX_BUG 0x0002 +#define XL_SINFO2_FIXED_ENDEC_LOOP_BUG 0x0004 +#define XL_SINFO2_AUX_WOL_CON 0x0008 +#define XL_SINFO2_PME_PULSED 0x0010 +#define XL_SINFO2_FIXED_MWI_BUG 0x0020 +#define XL_SINFO2_WOL_AFTER_PWR_LOSS 0x0040 +#define XL_SINFO2_AUTO_RST_TO_D0 0x0080 + #define XL_PACKET_SIZE 1540 #define XL_MAX_FRAMELEN (ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN) @@ -408,7 +419,12 @@ #define XL_W7_BM_LEN 0x06 #define XL_W7_BM_STATUS 0x0B #define XL_W7_BM_TIMEr 0x0A +#define XL_W7_BM_PME 0x0C +#define XL_BM_PME_WAKE 0x0001 +#define XL_BM_PME_MAGIC 0x0002 +#define XL_BM_PME_LINKCHG 0x0004 +#define XL_BM_PME_WAKETIMER 0x0008 /* * bus master control registers */ @@ -577,6 +593,7 @@ struct xl_mii_frame { #define XL_FLAG_NO_XCVR_PWR 0x0080 #define XL_FLAG_USE_MMIO 0x0100 #define XL_FLAG_NO_MMIO 0x0200 +#define XL_FLAG_WOL 0x0400 #define XL_NO_XCVR_PWR_MAGICBITS 0x0900 @@ -599,6 +616,7 @@ struct xl_softc { u_int16_t xl_caps; u_int8_t xl_stats_no_timeout; u_int16_t xl_tx_thresh; + int xl_pmcap; int xl_if_flags; struct xl_list_data xl_ldata; struct xl_chain_data xl_cdata; From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 20:53:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 470A410656AC; Mon, 23 Aug 2010 20:53:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A5F08FC27; Mon, 23 Aug 2010 20:53:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7NKr10G052612; Mon, 23 Aug 2010 20:53:01 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7NKr1AF052607; Mon, 23 Aug 2010 20:53:01 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201008232053.o7NKr1AF052607@svn.freebsd.org> From: John Baldwin Date: Mon, 23 Aug 2010 20:53:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211719 - in stable/8: contrib/bsnmp/snmp_mibII sbin/ifconfig usr.sbin/ndp usr.sbin/ppp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 20:53:02 -0000 Author: jhb Date: Mon Aug 23 20:53:01 2010 New Revision: 211719 URL: http://svn.freebsd.org/changeset/base/211719 Log: MFC 210936,210946: Ethernet vlan(4) interfaces have valid Ethernet link layer addresses but use a different interface type (IFT_L2VLAN vs IFT_ETHER). Treat IFT_L2VLAN interfaces like IFT_ETHER interfaces when handling link layer addresses. Modified: stable/8/contrib/bsnmp/snmp_mibII/mibII.c stable/8/sbin/ifconfig/af_link.c stable/8/usr.sbin/ndp/ndp.c stable/8/usr.sbin/ppp/ipv6cp.c Directory Properties: stable/8/contrib/bsnmp/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/usr.sbin/ndp/ (props changed) stable/8/usr.sbin/ppp/ (props changed) Modified: stable/8/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- stable/8/contrib/bsnmp/snmp_mibII/mibII.c Mon Aug 23 20:19:17 2010 (r211718) +++ stable/8/contrib/bsnmp/snmp_mibII/mibII.c Mon Aug 23 20:53:01 2010 (r211719) @@ -843,6 +843,7 @@ check_llbcast(struct mibif *ifp) case IFT_ETHER: case IFT_FDDI: case IFT_ISO88025: + case IFT_L2VLAN: if (mib_find_rcvaddr(ifp->index, ether_bcast, 6) == NULL && (rcv = mib_rcvaddr_create(ifp, ether_bcast, 6)) != NULL) rcv->flags |= MIBRCVADDR_BCAST; Modified: stable/8/sbin/ifconfig/af_link.c ============================================================================== --- stable/8/sbin/ifconfig/af_link.c Mon Aug 23 20:19:17 2010 (r211718) +++ stable/8/sbin/ifconfig/af_link.c Mon Aug 23 20:53:01 2010 (r211719) @@ -58,7 +58,9 @@ link_status(int s __unused, const struct struct sockaddr_dl *sdl = (struct sockaddr_dl *) ifa->ifa_addr; if (sdl != NULL && sdl->sdl_alen > 0) { - if (sdl->sdl_type == IFT_ETHER && + if ((sdl->sdl_type == IFT_ETHER || + sdl->sdl_type == IFT_L2VLAN || + sdl->sdl_type == IFT_BRIDGE) && sdl->sdl_alen == ETHER_ADDR_LEN) printf("\tether %s\n", ether_ntoa((struct ether_addr *)LLADDR(sdl))); Modified: stable/8/usr.sbin/ndp/ndp.c ============================================================================== --- stable/8/usr.sbin/ndp/ndp.c Mon Aug 23 20:19:17 2010 (r211718) +++ stable/8/usr.sbin/ndp/ndp.c Mon Aug 23 20:53:01 2010 (r211719) @@ -437,6 +437,7 @@ set(argc, argv) switch (sdl->sdl_type) { case IFT_ETHER: case IFT_FDDI: case IFT_ISO88023: case IFT_ISO88024: case IFT_ISO88025: + case IFT_L2VLAN: case IFT_BRIDGE: goto overwrite; } } Modified: stable/8/usr.sbin/ppp/ipv6cp.c ============================================================================== --- stable/8/usr.sbin/ppp/ipv6cp.c Mon Aug 23 20:19:17 2010 (r211718) +++ stable/8/usr.sbin/ppp/ipv6cp.c Mon Aug 23 20:53:01 2010 (r211719) @@ -148,6 +148,7 @@ SetInterfaceID(u_char *ifid, int userand switch(sdl->sdl_type) { case IFT_ETHER: case IFT_FDDI: + case IFT_L2VLAN: /* XXX need more cases? */ break; default: From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 20:53:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF7F11065696; Mon, 23 Aug 2010 20:53:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82ADD8FC19; Mon, 23 Aug 2010 20:53:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7NKrODa052659; Mon, 23 Aug 2010 20:53:24 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7NKrO2G052654; Mon, 23 Aug 2010 20:53:24 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201008232053.o7NKrO2G052654@svn.freebsd.org> From: John Baldwin Date: Mon, 23 Aug 2010 20:53:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211720 - in stable/7: contrib/bsnmp/snmp_mibII sbin/ifconfig usr.sbin/ndp usr.sbin/ppp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 20:53:24 -0000 Author: jhb Date: Mon Aug 23 20:53:24 2010 New Revision: 211720 URL: http://svn.freebsd.org/changeset/base/211720 Log: MFC 210936,210946: Ethernet vlan(4) interfaces have valid Ethernet link layer addresses but use a different interface type (IFT_L2VLAN vs IFT_ETHER). Treat IFT_L2VLAN interfaces like IFT_ETHER interfaces when handling link layer addresses. Modified: stable/7/contrib/bsnmp/snmp_mibII/mibII.c stable/7/sbin/ifconfig/af_link.c stable/7/usr.sbin/ndp/ndp.c stable/7/usr.sbin/ppp/ipv6cp.c Directory Properties: stable/7/contrib/bsnmp/ (props changed) stable/7/sbin/ifconfig/ (props changed) stable/7/usr.sbin/ndp/ (props changed) stable/7/usr.sbin/ppp/ (props changed) Modified: stable/7/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- stable/7/contrib/bsnmp/snmp_mibII/mibII.c Mon Aug 23 20:53:01 2010 (r211719) +++ stable/7/contrib/bsnmp/snmp_mibII/mibII.c Mon Aug 23 20:53:24 2010 (r211720) @@ -821,6 +821,7 @@ check_llbcast(struct mibif *ifp) case IFT_ETHER: case IFT_FDDI: case IFT_ISO88025: + case IFT_L2VLAN: if (mib_find_rcvaddr(ifp->index, ether_bcast, 6) == NULL && (rcv = mib_rcvaddr_create(ifp, ether_bcast, 6)) != NULL) rcv->flags |= MIBRCVADDR_BCAST; Modified: stable/7/sbin/ifconfig/af_link.c ============================================================================== --- stable/7/sbin/ifconfig/af_link.c Mon Aug 23 20:53:01 2010 (r211719) +++ stable/7/sbin/ifconfig/af_link.c Mon Aug 23 20:53:24 2010 (r211720) @@ -58,7 +58,9 @@ link_status(int s __unused, const struct struct sockaddr_dl *sdl = (struct sockaddr_dl *) ifa->ifa_addr; if (sdl != NULL && sdl->sdl_alen > 0) { - if (sdl->sdl_type == IFT_ETHER && + if ((sdl->sdl_type == IFT_ETHER || + sdl->sdl_type == IFT_L2VLAN || + sdl->sdl_type == IFT_BRIDGE) && sdl->sdl_alen == ETHER_ADDR_LEN) printf("\tether %s\n", ether_ntoa((struct ether_addr *)LLADDR(sdl))); Modified: stable/7/usr.sbin/ndp/ndp.c ============================================================================== --- stable/7/usr.sbin/ndp/ndp.c Mon Aug 23 20:53:01 2010 (r211719) +++ stable/7/usr.sbin/ndp/ndp.c Mon Aug 23 20:53:24 2010 (r211720) @@ -433,6 +433,7 @@ set(argc, argv) switch (sdl->sdl_type) { case IFT_ETHER: case IFT_FDDI: case IFT_ISO88023: case IFT_ISO88024: case IFT_ISO88025: + case IFT_L2VLAN: case IFT_BRIDGE: goto overwrite; } } Modified: stable/7/usr.sbin/ppp/ipv6cp.c ============================================================================== --- stable/7/usr.sbin/ppp/ipv6cp.c Mon Aug 23 20:53:01 2010 (r211719) +++ stable/7/usr.sbin/ppp/ipv6cp.c Mon Aug 23 20:53:24 2010 (r211720) @@ -148,6 +148,7 @@ SetInterfaceID(u_char *ifid, int userand switch(sdl->sdl_type) { case IFT_ETHER: case IFT_FDDI: + case IFT_L2VLAN: /* XXX need more cases? */ break; default: From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 21:40:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E941610656A7; Mon, 23 Aug 2010 21:40:04 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D87E58FC0C; Mon, 23 Aug 2010 21:40:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7NLe45Z054272; Mon, 23 Aug 2010 21:40:04 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7NLe4nQ054270; Mon, 23 Aug 2010 21:40:04 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008232140.o7NLe4nQ054270@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 23 Aug 2010 21:40:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211721 - head/sys/dev/ed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 21:40:05 -0000 Author: yongari Date: Mon Aug 23 21:40:03 2010 New Revision: 211721 URL: http://svn.freebsd.org/changeset/base/211721 Log: Fix a possible unaligned access to savebyte array. PR: kern/122195 Modified: head/sys/dev/ed/if_ed.c Modified: head/sys/dev/ed/if_ed.c ============================================================================== --- head/sys/dev/ed/if_ed.c Mon Aug 23 20:53:24 2010 (r211720) +++ head/sys/dev/ed/if_ed.c Mon Aug 23 21:40:03 2010 (r211721) @@ -1476,9 +1476,12 @@ ed_pio_write_mbufs(struct ed_softc *sc, } } else { /* NE2000s are a pain */ - unsigned char *data; + uint8_t *data; int len, wantbyte; - unsigned char savebyte[2]; + union { + uint16_t w; + uint8_t b[2]; + } saveword; wantbyte = 0; @@ -1488,9 +1491,9 @@ ed_pio_write_mbufs(struct ed_softc *sc, data = mtod(m, caddr_t); /* finish the last word */ if (wantbyte) { - savebyte[1] = *data; + saveword.b[1] = *data; ed_asic_outw(sc, ED_NOVELL_DATA, - *(u_short *)savebyte); + saveword.w); data++; len--; wantbyte = 0; @@ -1504,7 +1507,7 @@ ed_pio_write_mbufs(struct ed_softc *sc, } /* save last byte, if necessary */ if (len == 1) { - savebyte[0] = *data; + saveword.b[0] = *data; wantbyte = 1; } } @@ -1512,7 +1515,7 @@ ed_pio_write_mbufs(struct ed_softc *sc, } /* spit last byte */ if (wantbyte) - ed_asic_outw(sc, ED_NOVELL_DATA, *(u_short *)savebyte); + ed_asic_outw(sc, ED_NOVELL_DATA, saveword.w); } /* From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 21:58:52 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE527106567A; Mon, 23 Aug 2010 21:58:52 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 836AC8FC15; Mon, 23 Aug 2010 21:58:52 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id C2D001DD687; Mon, 23 Aug 2010 23:58:50 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id B71E81721B; Mon, 23 Aug 2010 23:58:50 +0200 (CEST) Date: Mon, 23 Aug 2010 23:58:50 +0200 From: Jilles Tjoelker To: Brian Somers Message-ID: <20100823215850.GC67671@stack.nl> References: <201008221104.o7MB4Ung001538@svn.freebsd.org> <20100823003314.57d41b94@dev.lan.Awfulhak.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100823003314.57d41b94@dev.lan.Awfulhak.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r211609 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 21:58:52 -0000 On Mon, Aug 23, 2010 at 12:33:14AM -0700, Brian Somers wrote: > On Sun, 22 Aug 2010 11:04:30 +0000 (UTC) Jilles Tjoelker wrote: > > Author: jilles > > Date: Sun Aug 22 11:04:30 2010 > > New Revision: 211609 > > URL: http://svn.freebsd.org/changeset/base/211609 > > Log: > > sh: Add a test for breaking from a loop outside the current function. > > It is unwise to rely on this but I'd like to know if this would break. > > Added: > > head/tools/regression/bin/sh/builtins/break3.0 (contents, props changed) > > Added: head/tools/regression/bin/sh/builtins/break3.0 > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/tools/regression/bin/sh/builtins/break3.0 Sun Aug 22 11:04:30 2010 (r211609) > > @@ -0,0 +1,15 @@ > > +# $FreeBSD$ > > + > > +# We accept this and people might rely on it. > > +# However, various other shells do not accept it. > > + > > +f() { > > + break > > + echo bad1 > > +} > > + > > +while :; do > > + f > > + echo bad2 > > + exit 2 > > +done > This feature should be counted as a bug IMHO. How can f() possibly > know whether there's a surrounding context to break from? If you replace f by its definition, there is an obvious meaning. And how about a script like: while :; do f() { ...; break; ...; } ... f ... done I will admit that there are various other shells that do not implement this. > Having said that, this behaviour is the same in bash except that bash > will complain if it's asked to break when the context is wrong, > perhaps we should complain too? > $ bash -c 'f() { break; echo no break; }; for f in good bad; do echo $f; f; done' > good > $ sh -c 'f() { break; echo no break; }; for f in good bad; do echo $f; f; done' > good > $ bash -c 'f() { break; echo no break; }; f' > bash: line 0: break: only meaningful in a `for', `while', or `until' loop > no break > $ bash -c 'f() { break 2>/dev/null; echo no break; }; f' > no break > $ sh -c 'f() { break; echo no break; }; f' > no break The System V sh and ksh93 behave the same way with break and continue builtins outside loops. I don't think this is very broken, and there is a limit on how many incompatible changes I'm willing to make. This doesn't make the cut. Warning messages to stderr mostly get lost in the noise, I don't really like them. I do not expect people to test for failure of break and continue, and bash even sets $? to 0 despite printing a warning. If this error is so important as to need an error message I think should abort the shell as well (via error(), so that "command break" will avoid aborting). Furthermore note that bash disables these warnings in POSIX mode. As an aside, if breaking out of a function were to be disallowed, a stronger approach seems possible: special builtins cannot be overridden by functions or PATH (we currently do not implement this), so if the parser (after alias expansion) sees a command "break" or "continue", it must be the special builtin and a parse error could result if it is not in a loop, or possibly a ksh93-like parse warning with -n. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 22:04:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 842751065679; Mon, 23 Aug 2010 22:04:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 735598FC0C; Mon, 23 Aug 2010 22:04:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7NM4UwB054872; Mon, 23 Aug 2010 22:04:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7NM4UPA054870; Mon, 23 Aug 2010 22:04:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201008232204.o7NM4UPA054870@svn.freebsd.org> From: Marius Strobl Date: Mon, 23 Aug 2010 22:04:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211722 - head/cddl/lib/libzpool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 22:04:30 -0000 Author: marius Date: Mon Aug 23 22:04:30 2010 New Revision: 211722 URL: http://svn.freebsd.org/changeset/base/211722 Log: Use real atomic operations for sparc64. MFC after: 1 week Modified: head/cddl/lib/libzpool/Makefile Modified: head/cddl/lib/libzpool/Makefile ============================================================================== --- head/cddl/lib/libzpool/Makefile Mon Aug 23 21:40:03 2010 (r211721) +++ head/cddl/lib/libzpool/Makefile Mon Aug 23 22:04:30 2010 (r211722) @@ -11,7 +11,7 @@ # LIST_SRCS .PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/os # ATOMIC_SRCS -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" || ${MACHINE_ARCH} == "powerpc64" +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" || ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "powerpc64" .PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH} ATOMIC_SRCS= opensolaris_atomic.S .else From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 22:09:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DE4A10656AA; Mon, 23 Aug 2010 22:09:26 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39F7C8FC13; Mon, 23 Aug 2010 22:09:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7NM9QSg055014; Mon, 23 Aug 2010 22:09:26 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7NM9Q5l055003; Mon, 23 Aug 2010 22:09:26 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201008232209.o7NM9Q5l055003@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 23 Aug 2010 22:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211723 - in stable/8/usr.bin/calendar: . calendars calendars/ru_RU.KOI8-R X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 22:09:26 -0000 Author: edwin Date: Mon Aug 23 22:09:25 2010 New Revision: 211723 URL: http://svn.freebsd.org/changeset/base/211723 Log: MFC of r205821 r205827 r205828 r205862 r205872 r205937 r206568 MFC of r208825 r208826 r208827 r208828 r208829 r208943 r205821: Long awaited update to the calendar system: - Repeating events which span multiple years (because of -A, -B or just the three days before the end of the year). - Support for lunar events (full moon, new moon) and solar events (equinox and solstice, chinese new year). Because of this, the options -U (UTC offset) and -l (longitude) are available to compensate if reality doesn't match the calculated values. r205828: Use local names for calendar.dutch r205862: Fix DST thingies in calendar.australia r205872: Make licenses 3 clause instead of 4 clause r205937: Make the dates in the Tasmanian part of calendar.australia properly variable. r206568: Typo in Allerheiligen in calendar.dutch r208825, r208826, r208827, r208828, r208829, r208943: Coverity Prevent related fixes. Modified: stable/8/usr.bin/calendar/Makefile stable/8/usr.bin/calendar/calendar.1 stable/8/usr.bin/calendar/calendar.c stable/8/usr.bin/calendar/calendar.h stable/8/usr.bin/calendar/calendars/calendar.australia stable/8/usr.bin/calendar/calendars/calendar.dutch stable/8/usr.bin/calendar/calendars/calendar.freebsd stable/8/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.common (contents, props changed) stable/8/usr.bin/calendar/day.c stable/8/usr.bin/calendar/io.c stable/8/usr.bin/calendar/ostern.c stable/8/usr.bin/calendar/paskha.c stable/8/usr.bin/calendar/pathnames.h Directory Properties: stable/8/usr.bin/calendar/ (props changed) Modified: stable/8/usr.bin/calendar/Makefile ============================================================================== --- stable/8/usr.bin/calendar/Makefile Mon Aug 23 22:04:30 2010 (r211722) +++ stable/8/usr.bin/calendar/Makefile Mon Aug 23 22:09:25 2010 (r211723) @@ -2,13 +2,17 @@ # $FreeBSD$ PROG= calendar -SRCS= calendar.c io.c day.c ostern.c paskha.c +SRCS= calendar.c locale.c events.c dates.c parsedata.c io.c day.c \ + ostern.c paskha.c pom.c sunpos.c +LDADD= -lm INTER= de_AT.ISO_8859-15 de_DE.ISO8859-1 fr_FR.ISO8859-1 \ hr_HR.ISO8859-2 hu_HU.ISO8859-2 ru_RU.KOI8-R uk_UA.KOI8-U DE_LINKS= de_DE.ISO8859-15 FR_LINKS= fr_FR.ISO8859-15 TEXTMODE?= 444 +WARNS?= 7 + beforeinstall: ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${TEXTMODE} \ ${.CURDIR}/calendars/calendar.* ${DESTDIR}${SHAREDIR}/calendar Modified: stable/8/usr.bin/calendar/calendar.1 ============================================================================== --- stable/8/usr.bin/calendar/calendar.1 Mon Aug 23 22:04:30 2010 (r211722) +++ stable/8/usr.bin/calendar/calendar.1 Mon Aug 23 22:09:25 2010 (r211723) @@ -9,10 +9,6 @@ .\" 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. @@ -54,6 +50,8 @@ .Ek .Oc .Op Fl W Ar num +.Op Fl U Ar UTC-offset +.Op Fl l Ar longitude .Sh DESCRIPTION The .Nm @@ -93,6 +91,12 @@ as the default calendar file. .Sm on .Xc For test purposes only: set date directly to argument values. +.It Fl l Ar longitude , Fl U Ar UTC-offset +Only one is needed: +Perform lunar and solar calculations from this longitude or from +this UTC offset. +If neither is specified, the calculations will be based on the +difference between UTC time and localtime. .It Fl W Ar num Print lines from today and the next .Ar num @@ -103,12 +107,36 @@ Ignore weekends when calculating the num To handle calendars in your national code table you can specify .Dq LANG= in the calendar file as early as possible. -To handle national Easter -names in the calendars -.Dq Easter= -(for Catholic Easter) or -.Dq Paskha= -(for Orthodox Easter) can be used. +.Pp +To handle the local name of sequences, you can specify them as: +.Dq SEQUENCE= +in the calendar file as early as possible. +.Pp +The names of the following special days are recognized: +.Bl -tag -width 123456789012345 -compact +.It Easter +Catholic Easter. +.It Paskha +Orthodox Easter. +.It NewMoon +The lunar New Moon. +.It FullMoon +The lunar Full Moon. +.It MarEquinox +The solar equinox in March. +.It JunSolstice +The solar solstice in June. +.It SepEquinox +The solar equinox in March. +.It DecSolstice +The solar solstice in December. +.It ChineseNewYear +The first day of the Chinese year. +.El +These names may be reassigned to their local names via an assignment +like +.Dq Easter=Pasen +in the calendar file. .Pp Other lines should begin with a month and day. They may be entered in almost any format, either numeric or as character @@ -122,11 +150,11 @@ Two numbers default to the month followe Lines with leading tabs default to the last entered date, allowing multiple line specifications for a single date. .Pp -``Easter'', is Easter for this year, and may be followed by a positive -or negative integer. -.Pp -``Paskha'', is Orthodox Easter for this year, and may be followed by a -positive or negative integer. +The names of the recognized special days may be followed by a +positive or negative integer, like: +.Dq Easter+3 +or +.Dq Pashka-4 . .Pp Weekdays may be followed by ``-4'' ...\& ``+5'' (aliases for last, first, second, third, fourth) for moving events like @@ -191,7 +219,8 @@ calendar file to use if no calendar file do not send mail if this file exists. .El .Pp -The following default calendar files are provided: +The following default calendar files are provided in +.Pa /usr/share/calendars: .Pp .Bl -tag -width calendar.southafrica -compact .It Pa calendar.all @@ -208,6 +237,8 @@ so that roving holidays are set correctl Days of special significance to computer people. .It Pa calendar.croatian Calendar of events in Croatia. +.It Pa calendar.dutch +Calendar of events in the Netherlands. .It Pa calendar.freebsd Birthdays of .Fx @@ -259,7 +290,28 @@ A .Nm command appeared in .At v7 . +.Sh NOTES +Chinese New Year is calculated at 120 degrees east of Greenwich, +which roughly corresponds with the east coast of China. +For people west of China, this might result that the start of Chinese +New Year and the day of the related new moon might differ. +.Pp +The phases of the moon and the longitude of the sun are calculated +against the local position which corresponds with 30 degrees times +the time-difference towards Greenwich. +.Pp +The new and full moons are happening on the day indicated: They +might happen in the time period in the early night or in the late +evening. +It doesn't indicate that they are starting in the night on that date. +.Pp +Because of minor differences between the output of the formulas +used and other sources on the Internet, Druids and Werewolves should +double-check the start and end time of solar and lunar events. .Sh BUGS The .Nm -utility does not handle Jewish holidays and moon phases. +utility does not handle Jewish holidays. +.Pp +There is no possibility to properly specify the local position +needed for solar and lunar calculations. Modified: stable/8/usr.bin/calendar/calendar.c ============================================================================== --- stable/8/usr.bin/calendar/calendar.c Mon Aug 23 22:04:30 2010 (r211722) +++ stable/8/usr.bin/calendar/calendar.c Mon Aug 23 22:09:25 2010 (r211723) @@ -1,4 +1,4 @@ -/* +/*- * Copyright (c) 1989, 1993, 1994 * The Regents of the University of California. All rights reserved. * @@ -10,10 +10,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -52,30 +48,38 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include -#include "pathnames.h" #include "calendar.h" +#define UTCOFFSET_NOTSET 100 /* Expected between -24 and +24 */ +#define LONGITUDE_NOTSET 1000 /* Expected between -360 and +360 */ + struct passwd *pw; int doall = 0; +int debug = 0; +char *DEBUG = NULL; time_t f_time = 0; - -int f_dayAfter = 0; /* days after current date */ -int f_dayBefore = 0; /* days before current date */ -int Friday = 5; /* day before weekend */ +double UTCOffset = UTCOFFSET_NOTSET; +int EastLongitude = LONGITUDE_NOTSET; static void usage(void) __dead2; int main(int argc, char *argv[]) { + int f_dayAfter = 0; /* days after current date */ + int f_dayBefore = 0; /* days before current date */ + int Friday = 5; /* day before weekend */ + int ch; + struct tm tp1, tp2; (void)setlocale(LC_ALL, ""); - while ((ch = getopt(argc, argv, "-A:aB:F:f:t:W:")) != -1) + while ((ch = getopt(argc, argv, "-A:aB:dD:F:f:l:t:U:W:")) != -1) switch (ch) { case '-': /* backward contemptible */ case 'a': @@ -90,14 +94,10 @@ main(int argc, char *argv[]) calendarFile = optarg; break; - case 't': /* other date, undocumented, for tests */ - f_time = Mktime(optarg); - break; - case 'W': /* we don't need no steenking Fridays */ Friday = -1; - /* FALLTHROUGH */ + case 'A': /* days after current date */ f_dayAfter = atoi(optarg); break; @@ -106,9 +106,25 @@ main(int argc, char *argv[]) f_dayBefore = atoi(optarg); break; - case 'F': + case 'F': /* Change the time: When does weekend start? */ Friday = atoi(optarg); break; + case 'l': /* Change longitudal position */ + EastLongitude = strtol(optarg, NULL, 10); + break; + case 'U': /* Change UTC offset */ + UTCOffset = strtod(optarg, NULL); + break; + + case 'd': + debug = 1; + break; + case 'D': + DEBUG = optarg; + break; + case 't': /* other date, undocumented, for tests */ + f_time = Mktime(optarg); + break; case '?': default: @@ -125,7 +141,60 @@ main(int argc, char *argv[]) if (f_time <= 0) (void)time(&f_time); - settime(f_time); + /* if not set, determine where I could be */ + { + if (UTCOffset == UTCOFFSET_NOTSET && + EastLongitude == LONGITUDE_NOTSET) { + /* Calculate on difference between here and UTC */ + time_t t; + struct tm tm; + long utcoffset, hh, mm, ss; + double uo; + + time(&t); + localtime_r(&t, &tm); + utcoffset = tm.tm_gmtoff; + /* seconds -> hh:mm:ss */ + hh = utcoffset / SECSPERHOUR; + utcoffset %= SECSPERHOUR; + mm = utcoffset / SECSPERMINUTE; + utcoffset %= SECSPERMINUTE; + ss = utcoffset; + + /* hh:mm:ss -> hh.mmss */ + uo = mm + (100.0 * (ss / 60.0)); + uo /= 60.0 / 100.0; + uo = hh + uo / 100; + + UTCOffset = uo; + EastLongitude = UTCOffset * 15; + } else if (UTCOffset == UTCOFFSET_NOTSET) { + /* Base on information given */ + UTCOffset = EastLongitude / 15; + } else if (EastLongitude == LONGITUDE_NOTSET) { + /* Base on information given */ + EastLongitude = UTCOffset * 15; + } + } + + settimes(f_time, f_dayBefore, f_dayAfter, Friday, &tp1, &tp2); + generatedates(&tp1, &tp2); + + /* + * FROM now on, we are working in UTC. + * This will only affect moon and sun related events anyway. + */ + if (setenv("TZ", "UTC", 1) != 0) + errx(1, "setenv: %s", strerror(errno)); + tzset(); + + if (debug) + dumpdates(); + + if (DEBUG != NULL) { + dodebug(DEBUG); + exit(0); + } if (doall) while ((pw = getpwent()) != NULL) { @@ -146,9 +215,11 @@ static void __dead2 usage(void) { - fprintf(stderr, "%s\n%s\n", + fprintf(stderr, "%s\n%s\n%s\n", "usage: calendar [-a] [-A days] [-B days] [-F friday] " "[-f calendarfile]", - " [-t dd[.mm[.year]]] [-W days]"); + " [-d] [-t dd[.mm[.year]]] [-W days]", + " [-U utcoffset] [-l longitude]" + ); exit(1); } Modified: stable/8/usr.bin/calendar/calendar.h ============================================================================== --- stable/8/usr.bin/calendar/calendar.h Mon Aug 23 22:04:30 2010 (r211722) +++ stable/8/usr.bin/calendar/calendar.h Mon Aug 23 22:09:25 2010 (r211723) @@ -1,4 +1,4 @@ -/* +/*- * Copyright (c) 1989, 1993, 1994 * The Regents of the University of California. All rights reserved. * @@ -10,10 +10,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -36,43 +32,163 @@ #include #include +#define SECSPERDAY (24 * 60 * 60) +#define SECSPERHOUR (60 * 60) +#define SECSPERMINUTE (60) +#define MINSPERHOUR (60) +#define HOURSPERDAY (24) +#define FSECSPERDAY (24.0 * 60.0 * 60.0) +#define FSECSPERHOUR (60.0 * 60.0) +#define FSECSPERMINUTE (60.0) +#define FMINSPERHOUR (60.0) +#define FHOURSPERDAY (24.0) + +#define DAYSPERYEAR 365 +#define DAYSPERLEAPYEAR 366 + +/* Not yet categorized */ + extern struct passwd *pw; extern int doall; -extern struct iovec header[]; -extern struct tm *tp; +extern time_t t1, t2; extern const char *calendarFile; -extern int *cumdays; extern int yrdays; -extern struct fixs neaster, npaskha; - -void cal(void); -void closecal(FILE *); -int getday(char *); -int getdayvar(char *); -int getfield(char *, char **, int *); -int getmonth(char *); -int geteaster(char *, int); -int getpaskha(char *, int); -int easter(int); -int isnow(char *, int *, int *, int *); -FILE *opencal(void); -void settime(time_t); -time_t Mktime(char *); -void setnnames(void); +extern struct fixs neaster, npaskha, ncny, nfullmoon, nnewmoon; +extern struct fixs nmarequinox, nsepequinox, njunsolstice, ndecsolstice; +extern double UTCOffset; +extern int EastLongitude; #define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0) -/* some flags */ -#define F_ISMONTH 0x01 /* month (January ...) */ -#define F_ISDAY 0x02 /* day of week (Sun, Mon, ...) */ -#define F_ISDAYVAR 0x04 /* variables day of week, like SundayLast */ -#define F_EASTER 0x08 /* Easter or easter depending days */ - -extern int f_dayAfter; /* days after current date */ -extern int f_dayBefore; /* days before current date */ -extern int Friday; /* day before weekend */ +/* Flags to determine the returned values by determinestyle() in parsedata.c */ +#define F_NONE 0x00000 +#define F_MONTH 0x00001 +#define F_DAYOFWEEK 0x00002 +#define F_DAYOFMONTH 0x00004 +#define F_MODIFIERINDEX 0x00008 +#define F_MODIFIEROFFSET 0x00010 +#define F_SPECIALDAY 0x00020 +#define F_ALLMONTH 0x00040 +#define F_ALLDAY 0x00080 +#define F_VARIABLE 0x00100 +#define F_EASTER 0x00200 +#define F_CNY 0x00400 +#define F_PASKHA 0x00800 +#define F_NEWMOON 0x01000 +#define F_FULLMOON 0x02000 +#define F_MAREQUINOX 0x04000 +#define F_SEPEQUINOX 0x08000 +#define F_JUNSOLSTICE 0x10000 +#define F_DECSOLSTICE 0x20000 + +#define STRING_EASTER "Easter" +#define STRING_PASKHA "Paskha" +#define STRING_CNY "ChineseNewYear" +#define STRING_NEWMOON "NewMoon" +#define STRING_FULLMOON "FullMoon" +#define STRING_MAREQUINOX "MarEquinox" +#define STRING_SEPEQUINOX "SepEquinox" +#define STRING_JUNSOLSTICE "JunSolstice" +#define STRING_DECSOLSTICE "DecSolstice" + +#define MAXCOUNT 125 /* Random number of maximum number of + * repeats of an event. Should be 52 + * (number of weeks per year), if you + * want to show two years then it + * should be 104. If you are seeing + * more than this you are using this + * program wrong. + */ + +/* + * All the astronomical calculations are carried out for the meridian 120 + * degrees east of Greenwich. + */ +#define UTCOFFSET_CNY 8.0 + +extern int debug; /* show parsing of the input */ +extern int year1, year2; + +/* events.c */ +/* + * Event sorting related functions: + * - Use event_add() to create a new event + * - Use event_continue() to add more text to the last added event + * - Use event_print_all() to display them in time chronological order + */ +struct event *event_add(int, int, int, char *, int, char *, char *); +void event_continue(struct event *events, char *txt); +void event_print_all(FILE *fp); +struct event { + int year; + int month; + int day; + int var; + char *date; + char *text; + char *extra; + struct event *next; +}; + +/* locale.c */ struct fixs { char *name; - int len; + size_t len; }; + +extern const char *days[]; +extern const char *fdays[]; +extern const char *fmonths[]; +extern const char *months[]; +extern const char *sequences[]; +extern struct fixs fndays[8]; /* full national days names */ +extern struct fixs fnmonths[13]; /* full national months names */ +extern struct fixs ndays[8]; /* short national days names */ +extern struct fixs nmonths[13]; /* short national month names */ +extern struct fixs nsequences[10]; + +void setnnames(void); +void setnsequences(char *); + +/* day.c */ +extern const struct tm tm0; +extern char dayname[]; +void settimes(time_t,int before, int after, int friday, struct tm *tp1, struct tm *tp2); +time_t Mktime(char *); + +/* parsedata.c */ +int parsedaymonth(char *, int *, int *, int *, int *, char **); +void dodebug(char *type); + +/* io.c */ +void cal(void); +void closecal(FILE *); +FILE *opencal(void); + +/* ostern.c / pashka.c */ +int paskha(int); +int easter(int); + +/* dates.c */ +extern int cumdaytab[][14]; +extern int mondaytab[][14]; +extern int debug_remember; +void generatedates(struct tm *tp1, struct tm *tp2); +void dumpdates(void); +int remember_ymd(int y, int m, int d); +int remember_yd(int y, int d, int *rm, int *rd); +int first_dayofweek_of_year(int y); +int first_dayofweek_of_month(int y, int m); +int walkthrough_dates(struct event **e); +void addtodate(struct event *e, int year, int month, int day); + +/* pom.c */ +#define MAXMOONS 18 +void pom(int year, double UTCoffset, int *fms, int *nms); +void fpom(int year, double utcoffset, double *ffms, double *fnms); + +/* sunpos.c */ +void equinoxsolstice(int year, double UTCoffset, int *equinoxdays, int *solsticedays); +void fequinoxsolstice(int year, double UTCoffset, double *equinoxdays, double *solsticedays); +int calculatesunlongitude30(int year, int degreeGMToffset, int *ichinesemonths); Modified: stable/8/usr.bin/calendar/calendars/calendar.australia ============================================================================== --- stable/8/usr.bin/calendar/calendars/calendar.australia Mon Aug 23 22:04:30 2010 (r211722) +++ stable/8/usr.bin/calendar/calendars/calendar.australia Mon Aug 23 22:09:25 2010 (r211723) @@ -10,49 +10,63 @@ LANG=en_AU.ISO8859-1 /* Australia */ -Jan 26 Australia Day -Mar/SunLast Daylight Savings Time ends in ACT, NSW, SA, TAS and VIC. -Apr 25 Anzac Day +Jan 26 Australia Day +Apr/SunFirst Daylight Savings Time ends in ACT, NSW, SA, TAS and VIC. +Apr 25 Anzac Day Jun/MonSecond Queen's Birthday Holiday (Australia, except WA) -Oct/SunLast Daylight Savings Time starts in ACT, NSW, SA and VIC. +Oct/SunFirst Daylight Savings Time starts in ACT, NSW, SA and VIC. /* ACT, NSW, common */ -Mar 18 Canberra Day (ACT) -8/MonFirst Bank Holiday (ACT, NSW) -10/MonFirst Labour Day (ACT, NSW, SA) +Mar 18 Canberra Day (ACT) +Sep/MonLast Family & Community Day (ACT) +Aug/MonFirst Bank Holiday (ACT, NSW) +Oct/MonFirst Labour Day (ACT, NSW, SA) /* Victoria */ -3/MonSecond Labour Day (Vic) -Nov/TueFirst Melbourne Cup (Vic) +Mar/MonSecond Labour Day (VIC) +Nov/TueFirst Melbourne Cup (VIC) -/* Tasmania */ -Feb 11 Regatta Day (Tas) -Feb 27 Launceston Cup (Tas) -Mar 11 Eight Hours Day (Tas) -Oct/SunFirst Daylight Savings Time starts in TAS. -Oct 10 Launceston Show Day (Tas) -Oct 24 Hobart Show Day (Tas) -Nov 04 Recreation Day (N Tas) +/* Tasmania + * http://www.wst.tas.gov.au/employment_info/public_holidays/html/2010 + */ +Feb/MonSecond Regatta Day (TAS) +Feb/WedLast Launceston Cup (TAS) +Mar/TueFirst King Island show (TAS) +Mar/MonSecond Eight Hours Day (TAS) +Oct 10 Launceston Show Day (TAS) /* Thursday preceding second Saturday in October */ +Oct 24 Hobart Show Day (TAS) /* Thursday preceding fourth Saturday in October */ +Nov/MonFirst Recreation Day (N TAS) + +/* +Oct/SatSecond-2 Launceston Show Day (TAS) // Thursday preceding second Sat in October +Oct/SatFourth-2 Hobart Show Day (TAS) // Thursday preceding fourth Sat in October +May/ThuFirst+1 Agfest (Circular Head only) // Friday following the first Thursday in May +Oct/SatFirst-1 Burnie Show // Friday preceding first Saturday in October +Oct/SatThird-1 Flinders Island Show // Friday preceding third Saturday in October + +DEVONPORT CUP Wednesday not earlier than fifth and not later than eleventh day of January +DEVONPORT SHOW Friday nearest last day in November, but not later than first day of December +*/ /* South Australia */ May/MonThird Adelaide Cup (SA) -Dec 26 Proclamation Day holiday (SA) +Dec 26 Proclamation Day holiday (SA) /* Western Australia */ -3/MonFirst Labour Day (WA) -6/MonFirst Foundation Day (WA) -Sep 30 Queen's Birthday (WA) +Mar/MonFirst Labour Day (WA) +Jun/MonFirst Foundation Day (WA) +Sep 30 Queen's Birthday (WA) /* Northern Territory */ -5/MonFirst May Day (NT) -7/FriFirst Alice Springs Show Day (NT) -7/FriSecond Tennant Creek Show Day (NT) -7/FriThird Katherine Show Day (NT) -7/FriLast Darwin Show Day (NT) -8/MonFirst Picnic Day (NT) +May/MonFirst May Day (NT) +Jul/FriFirst Alice Springs Show Day (NT) +Jul/FriSecond Tennant Creek Show Day (NT) +Jul/FriThird Katherine Show Day (NT) +Jul/FriLast Darwin Show Day (NT) +Aug/MonFirst Picnic Day (NT) /* Queensland */ -5/MonFirst Labour Day (Qld) -Aug 14 RNA Show Day (Brisbane metro) +May/MonFirst Labour Day (QLD) +Aug/WedSecond RNA Show Day (Brisbane metro) /* Second Last Wednesday */ #endif Modified: stable/8/usr.bin/calendar/calendars/calendar.dutch ============================================================================== --- stable/8/usr.bin/calendar/calendars/calendar.dutch Mon Aug 23 22:04:30 2010 (r211722) +++ stable/8/usr.bin/calendar/calendars/calendar.dutch Mon Aug 23 22:09:25 2010 (r211723) @@ -10,25 +10,25 @@ Easter=Pasen /* * Feestdagen */ -01/01 Nieuwjaar -01/06 Driekoningen -04/01 Een April -04/30 Koninginendag -05/01 Dag van de Arbeid -05/04 Dodenherdenking -05/05 Bevrijdingsdag -10/04 Dierendag -11/01 Allerheilingen -11/02 Allerzielen -11/11 Sint Maarten -11/11 Elfde-van-de-elfde -12/05 Sinterklaas avond -12/15 Koninkrijksdag -12/24 Kerstavond -12/25 Eerste kerstdag -12/26 Tweede kerstdag -12/28 Feest der Onnozele Kinderen -12/31 Oudjaar +jan/01 Nieuwjaar +jan/06 Driekoningen +apr/01 1 april +apr/30 Koninginnedag +mei/01 Dag van de Arbeid +mei/04 Dodenherdenking +mei/05 Bevrijdingsdag +okt/04 Dierendag +nov/01 Allerheiligen +nov/02 Allerzielen +nov/11 Sint Maarten +nov/11 Elfde-van-de-elfde +dec/05 Sinterklaas avond +dec/15 Koninkrijksdag +dec/24 Kerstavond +dec/25 Eerste kerstdag +dec/26 Tweede kerstdag +dec/28 Feest der Onnozele Kinderen +dec/31 Oudjaar /* * Pasen gerelateerd @@ -38,12 +38,12 @@ Pasen-49 Carnaval Pasen-48 Carnaval Pasen-47 Carnaval (Vastenavond) Pasen-46 Aswoensdag -Pasen-7 Palmzondag -Pasen-3 Witte Donderdag -Pasen-2 Goede vrijdag -Pasen-1 Stille zaterdag +Pasen-7 Palmzondag +Pasen-3 Witte Donderdag +Pasen-2 Goede vrijdag +Pasen-1 Stille zaterdag Pasen Eerste paasdag -Pasen+1 Tweede paasdag +Pasen+1 Tweede paasdag Pasen+39 Hemelvaartsdag Pasen+49 Eerste Pinksterdag Pasen+50 Tweede Pinksterdag @@ -52,28 +52,28 @@ Pasen+56 Trinitatis /* * Misc */ -05/SunSecond Moederdag -06/SunThird Vaderdag -09/TueThird Prinsjesdag +mei/SunSecond Moederdag +jun/SunThird Vaderdag +sep/TueThird Prinsjesdag /* * Het koningshuis */ -01/19 Prinses Margriet (1943) -01/31 Koningin Beatrix (1938) -02/17 Prins Willem III (1817 - 1890) -02/18 Prinses Christina (1947) -04/10 Prinses Ariane (2007) -04/19 Prins Hendrik (1876 - 1934) -04/27 Kroonprins Willem Alexander (1967) -04/30 Koningin Juliana (1909 - 2004) -04/30 Mr. Pieter van Vollenhoven (1939) -05/17 Prinses Maxima (1971) -06/26 Prinses Alexia (2005) -06/29 Prins Bernhard (1911 - 2004) -08/05 Prinses Irene (1939) -08/31 Prinses Wilhelmina (1880 - 1962) -09/06 Prins Claus (1925 - 2002) -09/25 Prins Johan Friso (1968) -10/11 Prins Constantijn (1969) -12/07 Prinses Catharina-Amalia (2003) +jan/19 Prinses Margriet (1943) +jan/31 Koningin Beatrix (1938) +feb/17 Prins Willem III (1817 - 1890) +feb/18 Prinses Christina (1947) +apr/10 Prinses Ariane (2007) +apr/19 Prins Hendrik (1876 - 1934) +apr/27 Kroonprins Willem Alexander (1967) +apr/30 Koningin Juliana (1909 - 2004) +apr/30 Mr. Pieter van Vollenhoven (1939) +mei/17 Prinses Maxima (1971) +jun/26 Prinses Alexia (2005) +jun/29 Prins Bernhard (1911 - 2004) +aug/05 Prinses Irene (1939) +aug/31 Prinses Wilhelmina (1880 - 1962) +sep/06 Prins Claus (1925 - 2002) +sep/25 Prins Johan Friso (1968) +okt/11 Prins Constantijn (1969) +dec/07 Prinses Catharina-Amalia (2003) Modified: stable/8/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- stable/8/usr.bin/calendar/calendars/calendar.freebsd Mon Aug 23 22:04:30 2010 (r211722) +++ stable/8/usr.bin/calendar/calendars/calendar.freebsd Mon Aug 23 22:09:25 2010 (r211723) @@ -72,6 +72,7 @@ 03/03 Doug White born in Eugene, Oregon, United States, 1977 03/03 Gordon Tetlow born in Reno, Nevada, United States, 1978 03/04 Oleksandr Tymoshenko born in Chernihiv, Ukraine, 1980 +03/05 Baptiste Daroussin born in Beauvais, France, 1980 03/05 Philip Paeps born in Leuven, Belgium, 1983 03/05 Ulf Lilleengen born in Hamar, Norway, 1985 03/06 Christopher Piazza born in Kamloops, British Columbia, Canada, 1981 @@ -82,6 +83,7 @@ 03/12 Greg Lewis born in Adelaide, South Australia, Australia, 1969 03/13 Alexander Leidinger born in Neunkirchen, Saarland, Germany, 1976 03/13 Will Andrews born in Pontiac, Michigan, United States, 1982 +03/14 Bernhard Froehlich born in Graz, Styria, Austria, 1985 03/15 Paolo Pisati born in Lodi, Italy, 1977 03/15 Brian Fundakowski Feldman born in Alexandria, Virginia, United States, 1983 03/17 Michael Smith born in Bankstown, New South Wales, Australia, 1971 @@ -91,6 +93,7 @@ 03/20 MANTANI Nobutaka born in Hiroshima, Japan, 1978 03/20 Cameron Grant died in Hemel Hempstead, United Kingdom, 2005 03/20 Henrik Brix Andersen born in Aarhus, Denmark, 1978 +03/20 Joseph S. Atkinson born in Batesville, Arkansas, United States, 1977 03/22 Brad Davis born in Farmington, New Mexico, United States, 1983 03/23 Daniel C. Sobral born in Brasilia, Distrito Federal, Brazil, 1971 03/23 Benno Rice born in Adelaide, South Australia, Australia, 1977 @@ -135,6 +138,7 @@ 05/11 Jesus Rodriguez born in Barcelona, Spain, 1972 05/11 Roman Kurakin born in Moscow, USSR, 1979 05/13 Pete Fritchman born in Lansdale, Pennsylvania, United States, 1983 +05/14 Bruce Cran born in Cambridge, United Kingdom, 1981 05/14 Tatsumi Hosokawa born in Tokyo, Japan, 1968 05/14 Shigeyuku Fukushima born in Osaka, Japan, 1974 05/16 Johann Kois born in Wolfsberg, Austria, 1975 @@ -200,6 +204,7 @@ 07/19 Masafumi NAKANE born in Okazaki, Aichi, Japan, 1972 07/19 Simon L. Nielsen born in Copenhagen, Denmark, 1980 07/19 Gleb Smirnoff born in Kharkov, USSR, 1981 +07/20 Andrey V. Elsukov born in Kotelnich, Russian Federation, 1981 07/22 James Housley born in Chicago, Illinois, United States, 1965 07/22 Jens Schweikhardt born in Waiblingen, Baden-Wuerttemberg, Germany, 1967 07/22 Lukas Ertl born in Weissenbach/Enns, Steiermark, Austria, 1976 @@ -251,6 +256,7 @@ 09/12 Benedict Christopher Reuschling born in Darmstadt, Germany, 1981 09/15 Dima Panov born in Khabarovsk, Russian Federation, 1978 09/17 Maxim Bolotin born in Rostov-on-Don, Russian Federation, 1976 +09/18 Matthew Fleming born in Cleveland, Ohio, United States, 1975 09/20 Kevin Lo born in Taipei, Taiwan, Republic of China, 1972 09/27 Neil Blakey-Milner born in Port Elizabeth, South Africa, 1978 09/27 Renato Botelho born in Araras, Sao Paulo, Brazil, 1979 @@ -284,6 +290,7 @@ 11/10 Gregory Neil Shapiro born in Providence, Rhode Island, United States, 1970 11/13 John Baldwin born in Stuart, Virginia, United States, 1977 11/15 Lars Engels born in Hilden, Nordrhein-Westfalen, Germany, 1980 +11/15 Tijl Coosemans born in Duffel, Belgium, 1983 11/16 Jose Maria Alcaide Salinas born in Madrid, Spain, 1962 11/17 Ralf S. Engelschall born in Dachau, Bavaria, Germany, 1972 11/18 Thomas Quinot born in Paris, France, 1977 Modified: stable/8/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.common ============================================================================== --- stable/8/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.common Mon Aug 23 22:04:30 2010 (r211722) +++ stable/8/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.common Mon Aug 23 22:09:25 2010 (r211723) @@ -18,6 +18,7 @@ LANG=ru_RU.KOI8-R 10 ĆĹ× äĹÎŘ ÄÉĐĚĎÍÁÔÉŢĹÓËĎÇĎ ŇÁÂĎÔÎÉËÁ 1 ÍÁŇ ÷ÓĹÍÉŇÎŮĘ ÄĹÎŘ ÇŇÁÖÄÁÎÓËĎĘ ĎÂĎŇĎÎŮ 03/SunSecond äĹÎŘ ŇÁÂĎÔÎÉËĎ× ÇĹĎÄĹÚÉÉ É ËÁŇÔĎÇŇÁĆÉÉ +11 ÍÁŇ äĹÎŘ ŇÁÂĎÔÎÉËÁ ĎŇÇÁÎĎ× ÎÁŇËĎËĎÎÔŇĎĚŃ 18 ÍÁŇ äĹÎŘ ÎÁĚĎÇĎ×ĎĘ ĐĎĚÉĂÉÉ 03/SunThird äĹÎŘ ŇÁÂĎÔÎÉËĎ× ÔĎŇÇĎ×ĚÉ, ÂŮÔĎ×ĎÇĎ ĎÂÓĚŐÖÉ×ÁÎÉŃ ÎÁÓĹĚĹÎÉŃ É ÖÉĚÉÝÎĎ-ËĎÍÍŐÎÁĚŘÎĎÇĎ ČĎÚŃĘÓÔ×Á 27 ÍÁŇ íĹÖÄŐÎÁŇĎÄÎŮĘ ÄĹÎŘ ÔĹÁÔŇÁ @@ -33,22 +34,28 @@ LANG=ru_RU.KOI8-R 17 ÍÁĘ íĹÖÄŐÎÁŇĎÄÎŮĘ ÄĹÎŘ ÔĹĚĹËĎÍÍŐÎÉËÁĂÉĘ 18 ÍÁĘ íĹÖÄŐÎÁŇĎÄÎŮĘ ÄĹÎŘ ÍŐÚĹĹ× 24 ÍÁĘ äĹÎŘ ÓĚÁ×ŃÎÓËĎĘ ĐÉÓŘÍĹÎÎĎÓÔÉ É ËŐĚŘÔŐŇŮ +26 ÍÁĘ äĹÎŘ ŇĎÓÓÉĘÓËĎÇĎ ĐŇĹÄĐŇÉÎÉÍÁÔĹĚŘÓÔ×Á 27 ÍÁĘ ďÂÝĹŇĎÓÓÉĘÓËÉĘ ÄĹÎŘ ÂÉÂĚÉĎÔĹË 28 ÍÁĘ äĹÎŘ ĐĎÇŇÁÎÉŢÎÉËÁ +30 ÍÁĘ äĹÎŘ ĐĎÖÁŇÎĎĘ ĎČŇÁÎŮ +31 ÍÁĘ äĹÎŘ ňĎÓÓÉĘÓËĎĘ áÄ×ĎËÁÔŐŇŮ 05/SunLast äĹÎŘ ČÉÍÉËÁ 1 ÉŔÎ äĹÎŘ ÚÁÝÉÔŮ ÄĹÔĹĘ + 5 ÉŔÎ äĹÎŘ ÜËĎĚĎÇÁ 6 ÉŔÎ đŐŰËÉÎÓËÉĘ ÄĹÎŘ 8 ÉŔÎ äĹÎŘ ÓĎĂÉÁĚŘÎĎÇĎ ŇÁÂĎÔÎÉËÁ 06/SunSecond äĹÎŘ ŇÁÂĎÔÎÉËĎ× ĚĹÇËĎĘ ĐŇĎÍŮŰĚĹÎÎĎÓÔÉ 06/SunThird äĹÎŘ ÍĹÄÉĂÉÎÓËĎÇĎ ŇÁÂĎÔÎÉËÁ 22 ÉŔÎ äĹÎŘ ĐÁÍŃÔÉ É ÓËĎŇÂÉ (îÁŢÁĚĎ ÷ĹĚÉËĎĘ ďÔĹŢĹÓÔ×ĹÎÎĎĘ ÷ĎĘÎŮ, 1941 ÇĎÄ) 27 ÉŔÎ äĹÎŘ ÍĎĚĎÄĹÖÉ +29 ÉŔÎ äĹÎŘ ĐÁŇÔÉÚÁÎ É ĐĎÄĐĎĚŘÝÉËĎ× 06/SatLast äĹÎŘ ÉÚĎÂŇĹÔÁÔĹĚŃ É ŇÁĂÉĎÎÁĚÉÚÁÔĎŇÁ 07/SunFirst äĹÎŘ ŇÁÂĎÔÎÉËĎ× ÍĎŇÓËĎÇĎ É ŇĹŢÎĎÇĎ ĆĚĎÔÁ 07/SunSecond äĹÎŘ ŇŮÂÁËÁ 07/SunSecond äĹÎŘ ŇĎÓÓÉĘÓËĎĘ ĐĎŢÔŮ 07/SunThird äĹÎŘ ÍĹÔÁĚĚŐŇÇÁ 07/SunLast äĹÎŘ ÷ĎĹÎÎĎ-íĎŇÓËĎÇĎ ćĚĎÔÁ +28 ÉŔĚ äĹÎŘ ËŇĹÝĹÎÉŃ ňŐÓÉ 6 Á×Ç äĹÎŘ ÖĹĚĹÚÎĎÄĎŇĎÖÎŮČ ×ĎĘÓË 08/SunFirst äĹÎŘ ÖĹĚĹÚÎĎÄĎŇĎÖÎÉËÁ 12 Á×Ç äĹÎŘ ×ĎĹÎÎĎ-×ĎÚÄŐŰÎŮČ ÓÉĚ @@ -59,12 +66,16 @@ LANG=ru_RU.KOI8-R 08/SunLast äĹÎŘ ŰÁČÔĹŇÁ 1 ÓĹÎ äĹÎŘ ÚÎÁÎÉĘ 2 ÓĹÎ äĹÎŘ ŇĎÓÓÉĘÓËĎĘ Ç×ÁŇÄÉÉ + 3 ÓĹÎ äĹÎŘ ÓĎĚÉÄÁŇÎĎÓÔÉ × ÂĎŇŘÂĹ Ó ÔĹŇŇĎŇÉÚÍĎÍ + 4 ÓĹÎ äĹÎŘ ÓĐĹĂÉÁĚÉÓÔÁ ĐĎ ŃÄĹŇÎĎÍŐ ĎÂĹÓĐĹŢĹÎÉŔ 09/SunFirst äĹÎŘ ŇÁÂĎÔÎÉËĎ× ÎĹĆÔŃÎĎĘ É ÇÁÚĎ×ĎĘ ĐŇĎÍŮŰĚĹÎÎĎÓÔÉ 09/SunSecond äĹÎŘ ÔÁÎËÉÓÔÁ 09/SunThird äĹÎŘ ŇÁÂĎÔÎÉËĎ× ĚĹÓÁ +28 ÓĹÎ äĹÎŘ ŇÁÂĎÔÎÉËÁ ÁÔĎÍÎĎĘ ĐŇĎÍŮŰĚĹÎÎĎÓÔÉ 09/SunLast äĹÎŘ ÍÁŰÉÎĎÓÔŇĎÉÔĹĚŃ 1 ĎËÔ äĹÎŘ ĐĎÖÉĚŮČ ĚŔÄĹĘ - 4 ĎËÔ äĹÎŘ ×ĎĹÎÎĎ-ËĎÓÍÉŢĹÓËÉČ ÓÉĚ + 1 ĎËÔ äĹÎŘ ÓŐČĎĐŐÔÎŮČ ×ĎĘÓË + 4 ĎËÔ äĹÎŘ ËĎÓÍÉŢĹÓËÉČ ×ĎĘÓË 5 ĎËÔ äĹÎŘ ŐŢÉÔĹĚŃ 14 ĎËÔ íĹÖÄŐÎÁŇĎÄÎŮĘ ÄĹÎŘ ÓÔÁÎÄÁŇÔÉÚÁĂÉÉ 10/SunSecond äĹÎŘ ŇÁÂĎÔÎÉËĎ× ÓĹĚŘÓËĎÇĎ ČĎÚŃĘÓÔ×Á É ĐĹŇĹŇÁÂÁÔŮ×ÁŔÝĹĘ ĐŇĎÍŮŰĚĹÎÎĎÓÔÉ @@ -73,15 +84,19 @@ LANG=ru_RU.KOI8-R 25 ĎËÔ äĹÎŘ ÔÁÍĎÖĹÎÎÉËÁ 30 ĎËÔ äĹÎŘ ĐÁÍŃÔÉ ÖĹŇÔ× ĐĎĚÉÔÉŢĹÓËÉČ ŇĹĐŇĹÓÓÉĘ 10/SunLast äĹÎŘ ŇÁÂĎÔÎÉËĎ× Á×ÔĎÍĎÂÉĚŘÎĎÇĎ ÔŇÁÎÓĐĎŇÔÁ + 7 ÎĎŃ äĹÎŘ ĎËÔŃÂŇŘÓËĎĘ ŇĹ×ĎĚŔĂÉÉ 1917 ÇĎÄÁ 9 ÎĎŃ ÷ÓĹÍÉŇÎŮĘ ÄĹÎŘ ËÁŢĹÓÔ×Á 10 ÎĎŃ äĹÎŘ ÍÉĚÉĂÉÉ 16 ÎĎŃ äĹÎŘ ÍĎŇÓËĎĘ ĐĹČĎÔŮ 17 ÎĎŃ íĹÖÄŐÎÁŇĎÄÎŮĘ ÄĹÎŘ ÓÔŐÄĹÎÔĎ× -11/SunThird äĹÎŘ ŇÁËĹÔÎŮČ ×ĎĘÓË É ÁŇÔÉĚĚĹŇÉÉ +19 ÎĎŃ äĹÎŘ ŇÁËĹÔÎŮČ ×ĎĘÓË É ÁŇÔÉĚĚĹŇÉÉ 21 ÎĎŃ äĹÎŘ ŇÁÂĎÔÎÉËĎ× ÎÁĚĎÇĎ×ŮČ ĎŇÇÁÎĎ× 26 ÎĎŃ ÷ÓĹÍÉŇÎŮĘ ÄĹÎŘ ÉÎĆĎŇÍÁĂÉÉ 11/SunLast äĹÎŘ ÍÁÔĹŇÉ 1 ÄĹË ÷ÓĹÍÉŇÎŮĘ ÄĹÎŘ ÂĎŇŘÂŮ ÓĎ óđéäĎÍ + 3 ÄĹË äĹÎŘ ŔŇÉÓÔÁ + 9 ÄĹË äĹÎŘ çĹŇĎĹ× ďÔĹŢĹÓÔ×Á +12 ÄĹË äĹÎŘ ëĎÎÓÔÉÔŐĂÉÉ 17 ÄĹË äĹÎŘ ŇÁËĹÔÎŮČ ×ĎĘÓË ÓÔŇÁÔĹÇÉŢĹÓËĎÇĎ ÎÁÚÎÁŢĹÎÉŃ 20 ÄĹË äĹÎŘ ŇÁÂĎÔÎÉËÁ ĎŇÇÁÎĎ× ÂĹÚĎĐÁÓÎĎÓÔÉ 22 ÄĹË äĹÎŘ ÜÎĹŇÇĹÔÉËÁ Modified: stable/8/usr.bin/calendar/day.c ============================================================================== --- stable/8/usr.bin/calendar/day.c Mon Aug 23 22:04:30 2010 (r211722) +++ stable/8/usr.bin/calendar/day.c Mon Aug 23 22:09:25 2010 (r211723) @@ -1,4 +1,4 @@ -/* +/*- * Copyright (c) 1989, 1993, 1994 * The Regents of the University of California. All rights reserved. * @@ -10,10 +10,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -34,9 +30,6 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include #include #include #include @@ -44,123 +37,40 @@ __FBSDID("$FreeBSD$"); #include #include -#include "pathnames.h" #include "calendar.h" -struct tm *tp; -static const struct tm tm0; -int *cumdays, yrdays; -char dayname[10]; - - -/* 1-based month, 0-based days, cumulative */ -int daytab[][14] = { - {0, -1, 30, 58, 89, 119, 150, 180, 211, 242, 272, 303, 333, 364}, - {0, -1, 30, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}, -}; - -static char const *days[] = { - "sun", "mon", "tue", "wed", "thu", "fri", "sat", NULL, -}; - -static const char *months[] = { - "jan", "feb", "mar", "apr", "may", "jun", - "jul", "aug", "sep", "oct", "nov", "dec", NULL, -}; - -static struct fixs fndays[8]; /* full national days names */ -static struct fixs ndays[8]; /* short national days names */ - -static struct fixs fnmonths[13]; /* full national months names */ -static struct fixs nmonths[13]; /* short national month names */ +time_t time1, time2; +const struct tm tm0; +char dayname[100]; +int year1, year2; void -setnnames(void) -{ - char buf[80]; - int i, l; - struct tm tm; - - for (i = 0; i < 7; i++) { - tm.tm_wday = i; - strftime(buf, sizeof(buf), "%a", &tm); - for (l = strlen(buf); - l > 0 && isspace((unsigned char)buf[l - 1]); - l--) - ; - buf[l] = '\0'; - if (ndays[i].name != NULL) - free(ndays[i].name); - if ((ndays[i].name = strdup(buf)) == NULL) - errx(1, "cannot allocate memory"); - ndays[i].len = strlen(buf); - - strftime(buf, sizeof(buf), "%A", &tm); - for (l = strlen(buf); - l > 0 && isspace((unsigned char)buf[l - 1]); - l--) - ; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 22:24:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A9F410656A4; Mon, 23 Aug 2010 22:24:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15F4B8FC0A; Mon, 23 Aug 2010 22:24:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7NMOCHR055499; Mon, 23 Aug 2010 22:24:12 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7NMOBTm055452; Mon, 23 Aug 2010 22:24:11 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008232224.o7NMOBTm055452@svn.freebsd.org> From: Warner Losh Date: Mon, 23 Aug 2010 22:24:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211725 - in head: . cddl/lib/libdtrace cddl/lib/libzpool gnu/lib/csu gnu/lib/libgomp gnu/lib/libstdc++ gnu/usr.bin/binutils/gdb gnu/usr.bin/gdb gnu/usr.bin/gdb/gdbserver include lib li... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 22:24:12 -0000 Author: imp Date: Mon Aug 23 22:24:11 2010 New Revision: 211725 URL: http://svn.freebsd.org/changeset/base/211725 Log: MFtbemd: Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want to test of all the CPUs of a given family conform. Modified: head/Makefile.inc1 head/cddl/lib/libdtrace/Makefile head/cddl/lib/libzpool/Makefile head/gnu/lib/csu/Makefile head/gnu/lib/libgomp/Makefile head/gnu/lib/libstdc++/Makefile head/gnu/usr.bin/binutils/gdb/Makefile head/gnu/usr.bin/gdb/Makefile head/gnu/usr.bin/gdb/gdbserver/Makefile head/include/Makefile head/lib/Makefile head/lib/libc/Makefile head/lib/libc/compat-43/Makefile.inc head/lib/libc/gen/Makefile.inc head/lib/libc/locale/Makefile.inc head/lib/libc/quad/Makefile.inc head/lib/libc/softfloat/Makefile.inc head/lib/libc/stdlib/Makefile.inc head/lib/libc/string/Makefile.inc head/lib/libc/sys/Makefile.inc head/lib/libc_r/sys/Makefile.inc head/lib/libdisk/Makefile head/lib/libkvm/Makefile head/lib/libpmc/Makefile head/lib/libstand/Makefile head/lib/libthread_db/Makefile head/lib/msun/Makefile head/libexec/rtld-elf/Makefile head/libexec/rtld-elf/amd64/Makefile.inc head/libexec/rtld-elf/i386/Makefile.inc head/rescue/rescue/Makefile head/sbin/atm/atmconfig/Makefile head/sbin/bsdlabel/Makefile head/sbin/camcontrol/Makefile head/sbin/gbde/Makefile head/sbin/newfs_msdos/Makefile head/sbin/sunlabel/Makefile head/secure/lib/libcrypto/Makefile head/share/man/man4/Makefile head/share/man/man5/Makefile head/share/mk/bsd.lib.mk head/share/mk/bsd.sys.mk head/sys/boot/arm/ixp425/boot2/Makefile head/sys/conf/kern.post.mk head/sys/conf/kern.pre.mk head/usr.bin/ldd/Makefile head/usr.bin/truss/Makefile head/usr.sbin/ac/Makefile head/usr.sbin/amd/Makefile.inc head/usr.sbin/apm/Makefile head/usr.sbin/kldxref/Makefile head/usr.sbin/sade/Makefile head/usr.sbin/sysinstall/Makefile head/usr.sbin/tcpdump/tcpdump/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Aug 23 22:21:37 2010 (r211724) +++ head/Makefile.inc1 Mon Aug 23 22:24:11 2010 (r211725) @@ -1131,8 +1131,8 @@ _prereq_libs= gnu/lib/libssp/libssp_nons # all shared libraries for ELF. # _startup_libs= gnu/lib/csu -.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf) -_startup_libs+= lib/csu/${MACHINE_ARCH}-elf +.if exists(${.CURDIR}/lib/csu/${MACHINE_CPUARCH}-elf) +_startup_libs+= lib/csu/${MACHINE_CPUARCH}-elf .elif exists(${.CURDIR}/lib/csu/${MACHINE_CPUARCH}-elf) _startup_libs+= lib/csu/${MACHINE_CPUARCH}-elf .elif exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}) Modified: head/cddl/lib/libdtrace/Makefile ============================================================================== --- head/cddl/lib/libdtrace/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/cddl/lib/libdtrace/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -63,11 +63,11 @@ CFLAGS+= -I${.OBJDIR} -I${.CURDIR} \ #CFLAGS+= -DYYDEBUG -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel -DDIS_MEM .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/i386 .PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/${MACHINE_ARCH} -.elif ${MACHINE_ARCH} == "sparc64" +.elif ${MACHINE_CPUARCH} == "sparc64" CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/sparc .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/sparc .else Modified: head/cddl/lib/libzpool/Makefile ============================================================================== --- head/cddl/lib/libzpool/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/cddl/lib/libzpool/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -51,7 +51,7 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/cont CFLAGS+= -DWANTS_MUTEX_OWNED CFLAGS+= -I${.CURDIR}/../../../lib/libpthread/thread CFLAGS+= -I${.CURDIR}/../../../lib/libpthread/sys -CFLAGS+= -I${.CURDIR}/../../../lib/libthr/arch/${MACHINE_ARCH}/include +CFLAGS+= -I${.CURDIR}/../../../lib/libthr/arch/${MACHINE_CPUARCH}/include DPADD= ${LIBPTHREAD} ${LIBZ} LDADD= -lpthread -lz Modified: head/gnu/lib/csu/Makefile ============================================================================== --- head/gnu/lib/csu/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/gnu/lib/csu/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -24,18 +24,18 @@ CFLAGS+= -I${GCCLIB}/include -I${GCCDIR} CRTS_CFLAGS= -DCRTSTUFFS_O -DSHARED ${PICFLAG} MKDEP= -DCRT_BEGIN -.if ${MACHINE_ARCH} == "ia64" +.if ${MACHINE_CPUARCH} == "ia64" BEGINSRC= crtbegin.asm ENDSRC= crtend.asm CFLAGS+= -x assembler-with-cpp # Ugly hack CFLAGS+= -include osreldate.h .undef SRCS # hack for 'make depend' .endif -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" +.if ${MACHINE_CPUARCH} == "powerpc" TGTOBJS= crtsavres.o SRCS+= crtsavres.asm .endif -.if ${MACHINE_ARCH} == "sparc64" +.if ${MACHINE_CPUARCH} == "sparc64" TGTOBJS= crtfastmath.o SRCS+= crtfastmath.c .endif Modified: head/gnu/lib/libgomp/Makefile ============================================================================== --- head/gnu/lib/libgomp/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/gnu/lib/libgomp/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -23,9 +23,10 @@ CFLAGS+= -I${.CURDIR} -I. -I${SRCDIR} -I VERSION_MAP= ${SRCDIR}/libgomp.map # Target-specific OpenMP configuration -.if ${MACHINE_ARCH} == arm || ${MACHINE_ARCH} == i386 || \ - ${MACHINE_ARCH} == powerpc || \ - (${MACHINE_ARCH} == mips && (!defined(TARGET_ABI) || ${TARGET_ABI} != "n64")) +.if ${MACHINE_CPUARCH} == arm || ${MACHINE_CPUARCH} == i386 || \ + ${MACHINE_CPUARCH} == powerpc || \ + (${MACHINE_CPUARCH} == mips && \ + (!defined(TARGET_ABI) || ${TARGET_ABI} != "n64")) OMP_LOCK_ALIGN = 4 OMP_LOCK_KIND= 4 OMP_LOCK_SIZE= 4 Modified: head/gnu/lib/libstdc++/Makefile ============================================================================== --- head/gnu/lib/libstdc++/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/gnu/lib/libstdc++/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -14,7 +14,7 @@ LIB= stdc++ SHLIB_MAJOR= 6 CFLAGS+= -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H -.if ${MACHINE_ARCH} == "arm" +.if ${MACHINE_CPUARCH} == "arm" CFLAGS+= -D_GLIBCXX_SJLJ_EXCEPTIONS=1 .endif CFLAGS+= -I${.CURDIR} -I${SUPDIR} -I${GCCDIR} -I${SRCDIR}/include @@ -67,14 +67,14 @@ SRCS+= del_op.cc del_opnt.cc del_opv.cc SRCS+= cp-demangle.c # MD headers location -.if ${MACHINE_ARCH} == "sparc64" +.if ${MACHINE_CPUARCH} == "sparc64" MARCHDIR= sparc -.elif ${MACHINE_ARCH} == "i386" && ${MACHINE_CPU} != 'i386' +.elif ${MACHINE_CPUARCH} == "i386" && ${MACHINE_CPU} != 'i386' MARCHDIR= i486 -.elif ${MACHINE_ARCH} == "amd64" +.elif ${MACHINE_CPUARCH} == "amd64" MARCHDIR= i486 .else -MARCHDIR= ${MACHINE_ARCH} +MARCHDIR= ${MACHINE_CPUARCH} .endif .if exists(${SRCDIR}/config/cpu/${MARCHDIR}/atomicity.h) @@ -83,7 +83,7 @@ ATOMICITY_H= ${SRCDIR}/config/cpu/${MARC ATOMICITY_H= ${SRCDIR}/config/cpu/generic/atomicity_mutex/atomicity.h .endif -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" .if exists(${SRCDIR}/config/cpu/generic/atomicity_builtins/atomicity.h) ATOMICITY_H= ${SRCDIR}/config/cpu/generic/atomicity_builtins/atomicity.h .endif Modified: head/gnu/usr.bin/binutils/gdb/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/gdb/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/gnu/usr.bin/binutils/gdb/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -8,16 +8,7 @@ GDBDIR= ${.CURDIR}/../../../../contrib/g .PATH: ${SRCDIR}/opcodes ${SRCDIR}/binutils # For FSF GDB files, use their CPU (arch) name; for our files use ours. -.if ${TARGET_ARCH} == "sparc64" -GDB_CPU= sparc -.elif ${TARGET_ARCH} == "amd64" -GDB_CPU= i386 -.elif ${TARGET_ARCH} == "powerpc64" -GDB_CPU= powerpc -.else -GDB_CPU= ${TARGET_ARCH} -.endif - +GDB_CPU=${TARGET_CPUARCH:C/amd64/i386/:C/powerpc.*/rs6000/:C/sparc64/sparc/} NO_SHARED?=yes PROG= gdb XSRCS= annotate.c arch-utils.c ax-general.c ax-gdb.c bcache.c \ @@ -57,7 +48,7 @@ WARNS?= 0 CFLAGS+= -DCROSS_COMPILE=1 .endif CFLAGS+= -DDEFAULT_BFD_ARCH=bfd_${GDB_CPU}_arch -CFLAGS+= -I${.CURDIR}/${TARGET_ARCH} +CFLAGS+= -I${.CURDIR}/${TARGET_CPUARCH} CFLAGS+= -I${SRCDIR}/binutils -I${SRCDIR}/bfd CFLAGS+= -I${GDBDIR}/gdb -I${GDBDIR}/gdb/config CFLAGS+= -I$(.CURDIR) @@ -123,8 +114,8 @@ init.c: ${XSRCS} tm.h: echo '#include "${GDB_CPU}/tm-fbsd.h"' > ${.TARGET} -.if exists(${.CURDIR}/fbsd-kgdb-${TARGET_ARCH}.h) - echo '#include "fbsd-kgdb-${TARGET_ARCH}.h"' >> ${.TARGET} +.if exists(${.CURDIR}/fbsd-kgdb-${TARGET_CPUARCH}.h) + echo '#include "fbsd-kgdb-${TARGET_CPUARCH}.h"' >> ${.TARGET} .endif .for H in nm-fbsd xm-${GDB_CPU} @@ -133,7 +124,7 @@ ${H:C/-.*$//}.h: .endfor kvm-fbsd-machine.h: - ln -sf ${.CURDIR}/kvm-fbsd-${TARGET_ARCH}.h ${.TARGET} + ln -sf ${.CURDIR}/kvm-fbsd-${TARGET_CPUARCH}.h ${.TARGET} GDB_VERSION= "5.2.1 (FreeBSD)" gdbversion.c: Makefile Modified: head/gnu/usr.bin/gdb/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/gnu/usr.bin/gdb/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -2,8 +2,7 @@ SUBDIR= doc libgdb gdb gdbtui kgdb -TARGET_ARCH?= ${MACHINE_ARCH} -.if exists(${.CURDIR}/gdbserver/reg-${TARGET_ARCH}.c) +.if exists(${.CURDIR}/gdbserver/reg-${MACHINE_CPUARCH}.c) SUBDIR+=gdbserver .endif Modified: head/gnu/usr.bin/gdb/gdbserver/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/gdbserver/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/gnu/usr.bin/gdb/gdbserver/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -14,11 +14,10 @@ SRCS= inferiors.c mem-break.c regcache.c server.c signals.c target.c utils.c SRCS+= fbsd-low.c -SRCS+= fbsd-${MACHINE_ARCH}-low.c reg-${MACHINE_ARCH}.c -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" +SRCS+= fbsd-${MACHINE_CPUARCH}-low.c reg-${MACHINE_CPUARCH}.c +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" SRCS+= i387-fp.c .endif - #CFLAGS+= -I${.CURDIR}/../arch/${MACHINE_ARCH} CFLAGS+= -I${GDBDIR}/gdb/gdbserver CFLAGS+= -I${GDBDIR}/gdb/regformats Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/include/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -115,8 +115,8 @@ INCSLINKS+= machine/$i ${INCLUDEDIR}/$i INCSLINKS+= sys/$i ${INCLUDEDIR}/$i .endfor -.if ${MACHINE} != ${MACHINE_ARCH} -_MARCH=${MACHINE_ARCH} +.if ${MACHINE} != ${MACHINE_CPUARCH} +_MARCH=${MACHINE_CPUARCH} .endif .include Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/lib/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -112,10 +112,10 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_bind} \ ${_clang} -.if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf) -_csu=csu/${MACHINE_ARCH}-elf -.elif exists(${.CURDIR}/csu/${MACHINE_ARCH}/Makefile) -_csu=csu/${MACHINE_ARCH} +.if exists(${.CURDIR}/csu/${MACHINE_CPUARCH}-elf) +_csu=csu/${MACHINE_CPUARCH}-elf +.elif exists(${.CURDIR}/csu/${MACHINE_CPUARCH}/Makefile) +_csu=csu/${MACHINE_CPUARCH} .else _csu=csu .endif @@ -168,7 +168,7 @@ _libnetgraph= libnetgraph _libypclnt= libypclnt .endif -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" .if ${MK_NCP} != "no" _libncp= libncp .endif @@ -178,16 +178,22 @@ _libproc= libproc _librtld_db= librtld_db .endif -.if ${MACHINE_ARCH} == "ia64" +.if ${MACHINE_CPUARCH} == "ia64" _libefi= libefi _libsmb= libsmb .endif +.if ${MACHINE_CPUARCH} == "amd64" +.if ${MK_NCP} != "no" +_libncp= libncp +.endif +.endif + .if ${MACHINE_CPUARCH} == "powerpc" _libsmb= libsmb .endif -.if ${MACHINE_ARCH} == "sparc64" +.if ${MACHINE_CPUARCH} == "sparc64" _libsmb= libsmb .endif Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/lib/libc/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -15,7 +15,7 @@ LIB=c SHLIB_MAJOR= 7 WARNS?= 2 CFLAGS+=-I${.CURDIR}/include -I${.CURDIR}/../../include -CFLAGS+=-I${.CURDIR}/${MACHINE_ARCH} +CFLAGS+=-I${.CURDIR}/${MACHINE_CPUARCH} CFLAGS+=-DNLS CLEANFILES+=tags INSTALL_PIC_ARCHIVE= @@ -36,7 +36,7 @@ MDASM= MIASM= NOASM= -.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc" +.include "${.CURDIR}/${MACHINE_CPUARCH}/Makefile.inc" .include "${.CURDIR}/db/Makefile.inc" .include "${.CURDIR}/compat-43/Makefile.inc" .include "${.CURDIR}/gdtoa/Makefile.inc" @@ -49,11 +49,11 @@ NOASM= .include "${.CURDIR}/net/Makefile.inc" .include "${.CURDIR}/nls/Makefile.inc" .include "${.CURDIR}/posix1e/Makefile.inc" -.if ${MACHINE_ARCH} != "amd64" && \ - ${MACHINE_ARCH} != "ia64" && \ +.if ${MACHINE_CPUARCH} != "amd64" && \ + ${MACHINE_CPUARCH} != "ia64" && \ ${MACHINE_ARCH} != "powerpc64" && \ - ${MACHINE_ARCH} != "sparc64" && \ - ${MACHINE_ARCH} != "mips" + ${MACHINE_CPUARCH} != "sparc64" && \ + ${MACHINE_CPUARCH} != "mips" .include "${.CURDIR}/quad/Makefile.inc" .endif .if ${MACHINE_ARCH} == "mips" && \ @@ -70,7 +70,7 @@ NOASM= .include "${.CURDIR}/rpc/Makefile.inc" .include "${.CURDIR}/uuid/Makefile.inc" .include "${.CURDIR}/xdr/Makefile.inc" -.if ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "mips" +.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" .include "${.CURDIR}/softfloat/Makefile.inc" .endif .if ${MK_NIS} != "no" @@ -115,14 +115,14 @@ KQSRCS= adddi3.c anddi3.c ashldi3.c ashr KSRCS= bcmp.c ffs.c ffsl.c fls.c flsl.c index.c mcount.c rindex.c \ strcat.c strcmp.c strcpy.c strlen.c strncpy.c -libkern: libkern.gen libkern.${MACHINE_ARCH} +libkern: libkern.gen libkern.${MACHINE_CPUARCH} libkern.gen: ${KQSRCS} ${KSRCS} cp -p ${.CURDIR}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern -libkern.${MACHINE_ARCH}:: ${KMSRCS} +libkern.${MACHINE_CPUARCH}:: ${KMSRCS} .if defined(KMSRCS) && !empty(KMSRCS) - cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${MACHINE_ARCH} + cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${MACHINE_CPUARCH} .endif .include Modified: head/lib/libc/compat-43/Makefile.inc ============================================================================== --- head/lib/libc/compat-43/Makefile.inc Mon Aug 23 22:21:37 2010 (r211724) +++ head/lib/libc/compat-43/Makefile.inc Mon Aug 23 22:24:11 2010 (r211725) @@ -2,7 +2,7 @@ # $FreeBSD$ # compat-43 sources -.PATH: ${.CURDIR}/${MACHINE_ARCH}/compat-43 ${.CURDIR}/compat-43 +.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/compat-43 ${.CURDIR}/compat-43 SRCS+= creat.c gethostid.c getwd.c killpg.c sethostid.c setpgrp.c \ setrgid.c setruid.c sigcompat.c Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Mon Aug 23 22:21:37 2010 (r211724) +++ head/lib/libc/gen/Makefile.inc Mon Aug 23 22:24:11 2010 (r211725) @@ -2,7 +2,7 @@ # $FreeBSD$ # machine-independent gen sources -.PATH: ${.CURDIR}/${MACHINE_ARCH}/gen ${.CURDIR}/gen +.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/gen ${.CURDIR}/gen SRCS+= __getosreldate.c __xuname.c \ _once_stub.c _pthread_stubs.c _rand48.c _spinlock_stub.c \ @@ -38,8 +38,8 @@ SRCS+= __getosreldate.c __xuname.c \ SYM_MAPS+=${.CURDIR}/gen/Symbol.map # machine-dependent gen sources -.if exists(${.CURDIR}/${MACHINE_ARCH}/gen/Makefile.inc) -.include "${.CURDIR}/${MACHINE_ARCH}/gen/Makefile.inc" +.if exists(${.CURDIR}/${MACHINE_CPUARCH}/gen/Makefile.inc) +.include "${.CURDIR}/${MACHINE_CPUARCH}/gen/Makefile.inc" .endif MAN+= alarm.3 arc4random.3 \ Modified: head/lib/libc/locale/Makefile.inc ============================================================================== --- head/lib/libc/locale/Makefile.inc Mon Aug 23 22:21:37 2010 (r211724) +++ head/lib/libc/locale/Makefile.inc Mon Aug 23 22:24:11 2010 (r211725) @@ -2,7 +2,7 @@ # $FreeBSD$ # locale sources -.PATH: ${.CURDIR}/${MACHINE_ARCH}/locale ${.CURDIR}/locale +.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/locale ${.CURDIR}/locale SRCS+= ascii.c big5.c btowc.c collate.c collcmp.c euc.c fix_grouping.c \ gb18030.c gb2312.c gbk.c isctype.c iswctype.c \ Modified: head/lib/libc/quad/Makefile.inc ============================================================================== --- head/lib/libc/quad/Makefile.inc Mon Aug 23 22:21:37 2010 (r211724) +++ head/lib/libc/quad/Makefile.inc Mon Aug 23 22:24:11 2010 (r211725) @@ -2,9 +2,9 @@ # $FreeBSD$ # Quad support, if needed -.PATH: ${.CURDIR}/${MACHINE_ARCH}/quad ${.CURDIR}/quad +.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/quad ${.CURDIR}/quad -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= cmpdi2.c divdi3.c moddi3.c qdivrem.c ucmpdi2.c udivdi3.c umoddi3.c Modified: head/lib/libc/softfloat/Makefile.inc ============================================================================== --- head/lib/libc/softfloat/Makefile.inc Mon Aug 23 22:21:37 2010 (r211724) +++ head/lib/libc/softfloat/Makefile.inc Mon Aug 23 22:24:11 2010 (r211725) @@ -2,10 +2,10 @@ # $FreeBSD$ SOFTFLOAT_BITS?=64 -.PATH: ${MACHINE_ARCH}/softfloat \ +.PATH: ${MACHINE_CPUARCH}/softfloat \ ${.CURDIR}/softfloat/bits${SOFTFLOAT_BITS} ${.CURDIR}/softfloat -CFLAGS+= -I${.CURDIR}/${MACHINE_ARCH}/softfloat -I${.CURDIR}/softfloat +CFLAGS+= -I${.CURDIR}/${MACHINE_CPUARCH}/softfloat -I${.CURDIR}/softfloat CFLAGS+= -DSOFTFLOAT_FOR_GCC SRCS+= softfloat.c Modified: head/lib/libc/stdlib/Makefile.inc ============================================================================== --- head/lib/libc/stdlib/Makefile.inc Mon Aug 23 22:21:37 2010 (r211724) +++ head/lib/libc/stdlib/Makefile.inc Mon Aug 23 22:24:11 2010 (r211725) @@ -2,7 +2,7 @@ # $FreeBSD$ # machine-independent stdlib sources -.PATH: ${.CURDIR}/${MACHINE_ARCH}/stdlib ${.CURDIR}/stdlib +.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/stdlib ${.CURDIR}/stdlib MISRCS+=_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \ bsearch.c div.c exit.c getenv.c getopt.c getopt_long.c \ @@ -16,7 +16,7 @@ MISRCS+=_Exit.c a64l.c abort.c abs.c ate SYM_MAPS+= ${.CURDIR}/stdlib/Symbol.map # machine-dependent stdlib sources -.sinclude "${.CURDIR}/${MACHINE_ARCH}/stdlib/Makefile.inc" +.sinclude "${.CURDIR}/${MACHINE_CPUARCH}/stdlib/Makefile.inc" MAN+= a64l.3 abort.3 abs.3 alloca.3 atexit.3 atof.3 atoi.3 atol.3 bsearch.3 \ div.3 exit.3 getenv.3 getopt.3 getopt_long.3 getsubopt.3 \ Modified: head/lib/libc/string/Makefile.inc ============================================================================== --- head/lib/libc/string/Makefile.inc Mon Aug 23 22:21:37 2010 (r211724) +++ head/lib/libc/string/Makefile.inc Mon Aug 23 22:24:11 2010 (r211725) @@ -1,7 +1,7 @@ # @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 # $FreeBSD$ -.PATH: ${.CURDIR}/${MACHINE_ARCH}/string ${.CURDIR}/string +.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/string ${.CURDIR}/string CFLAGS+= -I${.CURDIR}/locale @@ -26,8 +26,8 @@ SYM_MAPS+= ${.CURDIR}/string/Symbol.map # machine-dependent string sources -.if exists(${.CURDIR}/${MACHINE_ARCH}/string/Makefile.inc) -.include "${.CURDIR}/${MACHINE_ARCH}/string/Makefile.inc" +.if exists(${.CURDIR}/${MACHINE_CPUARCH}/string/Makefile.inc) +.include "${.CURDIR}/${MACHINE_CPUARCH}/string/Makefile.inc" .endif MAN+= bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 index.3 memccpy.3 memchr.3 \ Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Mon Aug 23 22:21:37 2010 (r211724) +++ head/lib/libc/sys/Makefile.inc Mon Aug 23 22:24:11 2010 (r211725) @@ -2,7 +2,7 @@ # $FreeBSD$ # sys sources -.PATH: ${.CURDIR}/${MACHINE_ARCH}/sys ${.CURDIR}/sys +.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/sys ${.CURDIR}/sys # Include the generated makefile containing the *complete* list # of syscall names in MIASM. @@ -13,8 +13,8 @@ # MDASM names override the default syscall names in MIASM. # NOASM will prevent the default syscall code from being generated. # -.if exists(${.CURDIR}/${MACHINE_ARCH}/sys/Makefile.inc) -.include "${.CURDIR}/${MACHINE_ARCH}/sys/Makefile.inc" +.if exists(${.CURDIR}/${MACHINE_CPUARCH}/sys/Makefile.inc) +.include "${.CURDIR}/${MACHINE_CPUARCH}/sys/Makefile.inc" .endif # Sources common to both syscall interfaces: Modified: head/lib/libc_r/sys/Makefile.inc ============================================================================== --- head/lib/libc_r/sys/Makefile.inc Mon Aug 23 22:21:37 2010 (r211724) +++ head/lib/libc_r/sys/Makefile.inc Mon Aug 23 22:24:11 2010 (r211725) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/sys ${.CURDIR}/arch/${MACHINE_ARCH} +.PATH: ${.CURDIR}/sys ${.CURDIR}/arch/${MACHINE_CPUARCH} SRCS+= uthread_error.c _atomic_lock.S Modified: head/lib/libdisk/Makefile ============================================================================== --- head/lib/libdisk/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/lib/libdisk/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -1,6 +1,6 @@ # $FreeBSD$ -.if ${MACHINE_ARCH} == "ia64" +.if ${MACHINE_CPUARCH} == "ia64" _open_disk= open_ia64_disk.c .else _change = change.c Modified: head/lib/libkvm/Makefile ============================================================================== --- head/lib/libkvm/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/lib/libkvm/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -11,10 +11,11 @@ CFLAGS+=-DSUN4V WARNS?= 0 -SRCS= kvm.c kvm_${MACHINE_ARCH}.c kvm_cptime.c kvm_file.c kvm_getloadavg.c \ +SRCS= kvm.c kvm_${MACHINE_CPUARCH}.c kvm_cptime.c kvm_file.c kvm_getloadavg.c \ kvm_getswapinfo.c kvm_pcpu.c kvm_proc.c kvm_vnet.c -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "arm" -SRCS+= kvm_minidump_${MACHINE_ARCH}.c +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ + ${MACHINE_CPUARCH} == "arm" +SRCS+= kvm_minidump_${MACHINE_CPUARCH}.c .endif INCS= kvm.h Modified: head/lib/libpmc/Makefile ============================================================================== --- head/lib/libpmc/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/lib/libpmc/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -22,7 +22,7 @@ MAN+= pmc_start.3 MAN+= pmclog.3 # PMC-dependent manual pages -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" MAN+= pmc.atom.3 MAN+= pmc.core.3 MAN+= pmc.core2.3 @@ -38,7 +38,7 @@ MAN+= pmc.corei7uc.3 MAN+= pmc.westmere.3 MAN+= pmc.westmereuc.3 MAN+= pmc.tsc.3 -.elif ${MACHINE_ARCH} == "arm" && ${CPUTYPE} == "xscale" +.elif ${MACHINE_CPUARCH} == "arm" && ${CPUTYPE} == "xscale" MAN+= pmc.xscale.3 .endif Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/lib/libstand/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -20,23 +20,23 @@ WARNS?= 0 CFLAGS+= -ffreestanding -Wformat CFLAGS+= -I${.CURDIR} -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 .endif -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" CFLAGS+= -mno-sse3 .endif .if ${MACHINE} == "pc98" CFLAGS+= -Os .endif -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" +.if ${MACHINE_CPUARCH} == "powerpc" CFLAGS+= -msoft-float -D_STANDALONE -DNETIF_DEBUG .endif .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" CFLAGS+= -m32 -I. .endif -.if ${MACHINE_ARCH} == "arm" +.if ${MACHINE_CPUARCH} == "arm" CFLAGS+= -msoft-float -D_STANDALONE .endif @@ -54,19 +54,19 @@ SRCS+= ntoh.c # string functions from libc .PATH: ${.CURDIR}/../libc/string -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \ - ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "sparc64" || \ - ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "arm" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "powerpc" || \ + ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "amd64" || \ + ${MACHINE_CPUARCH} == "arm" SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \ memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \ strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \ strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c .endif -.if ${MACHINE_ARCH} == "arm" +.if ${MACHINE_CPUARCH} == "arm" .PATH: ${.CURDIR}/../libc/arm/gen SRCS+= divsi3.S .endif -.if ${MACHINE_ARCH} == "ia64" +.if ${MACHINE_CPUARCH} == "ia64" .PATH: ${.CURDIR}/../libc/ia64/string SRCS+= bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \ memcpy.S memmove.S memset.c rindex.c strcat.c strchr.c \ @@ -78,7 +78,7 @@ SRCS+= bcmp.c bcopy.S bzero.S ffs.S inde SRCS+= __divdi3.S __divsi3.S __moddi3.S __modsi3.S SRCS+= __udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S .endif -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" +.if ${MACHINE_CPUARCH} == "powerpc" .PATH: ${.CURDIR}/../libc/quad SRCS+= ashldi3.c ashrdi3.c .PATH: ${.CURDIR}/../libc/powerpc/gen @@ -90,12 +90,12 @@ SRCS+= syncicache.c SRCS+= uuid_equal.c uuid_is_nil.c # _setjmp/_longjmp -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" .PATH: ${.CURDIR}/i386 .elif ${MACHINE_ARCH} == "powerpc64" .PATH: ${.CURDIR}/powerpc .else -.PATH: ${.CURDIR}/${MACHINE_ARCH} +.PATH: ${.CURDIR}/${MACHINE_CPUARCH} .endif SRCS+= _setjmp.S @@ -157,7 +157,7 @@ SRCS+= splitfs.c .include -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" beforedepend ${OBJS}: machine cleandepend: cleanmachine cleanmachine: Modified: head/lib/libthread_db/Makefile ============================================================================== --- head/lib/libthread_db/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/lib/libthread_db/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/arch/${MACHINE_ARCH} +.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH} LIB= thread_db SHLIB_MAJOR= 3 Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/lib/msun/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -76,7 +76,7 @@ COMMON_SRCS= b_exp.c b_log.c b_tgamma.c # Location of fpmath.h and _fpmath.h LIBCDIR= ${.CURDIR}/../libc CFLAGS+= -I${.CURDIR}/src -I${LIBCDIR}/include \ - -I${LIBCDIR}/${MACHINE_ARCH} + -I${LIBCDIR}/${MACHINE_CPUARCH} SYM_MAPS+= ${.CURDIR}/Symbol.map VERSION_DEF= ${LIBCDIR}/Versions.def Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/libexec/rtld-elf/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -10,7 +10,7 @@ SRCS= rtld_start.S \ MAN= rtld.1 CSTD?= gnu99 CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD -CFLAGS+= -I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR} +CFLAGS+= -I${.CURDIR}/${MACHINE_CPUARCH} -I${.CURDIR} .if ${MACHINE_ARCH} == "powerpc64" LDFLAGS+= -nostdlib -e _rtld_start .else @@ -29,7 +29,7 @@ LDFLAGS+= -shared -Wl,-Bsymbolic DPADD= ${LIBC_PIC} LDADD= -lc_pic -lssp_nonshared -.if ${MACHINE_ARCH} != "ia64" +.if ${MACHINE_CPUARCH} != "ia64" .if ${MK_SYMVER} == "yes" LIBCDIR= ${.CURDIR}/../../lib/libc VERSION_DEF= ${LIBCDIR}/Versions.def @@ -39,14 +39,14 @@ LDFLAGS+= -Wl,--version-script=${VERSION ${PROG}: ${VERSION_MAP} -.if exists(${.CURDIR}/${MACHINE_ARCH}/Symbol.map) -SYMBOL_MAPS+= ${.CURDIR}/${MACHINE_ARCH}/Symbol.map +.if exists(${.CURDIR}/${MACHINE_CPUARCH}/Symbol.map) +SYMBOL_MAPS+= ${.CURDIR}/${MACHINE_CPUARCH}/Symbol.map .endif .endif .endif -.if exists(${.CURDIR}/${MACHINE_ARCH}/Makefile.inc) -.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc" +.if exists(${.CURDIR}/${MACHINE_CPUARCH}/Makefile.inc) +.include "${.CURDIR}/${MACHINE_CPUARCH}/Makefile.inc" .endif # Since moving rtld-elf to /libexec, we need to create a symlink. @@ -56,7 +56,7 @@ beforeinstall: -chflags noschg ${DESTDIR}/usr/libexec/${PROG} .endif -.PATH: ${.CURDIR}/${MACHINE_ARCH} +.PATH: ${.CURDIR}/${MACHINE_CPUARCH} .include .include Modified: head/libexec/rtld-elf/amd64/Makefile.inc ============================================================================== --- head/libexec/rtld-elf/amd64/Makefile.inc Mon Aug 23 22:21:37 2010 (r211724) +++ head/libexec/rtld-elf/amd64/Makefile.inc Mon Aug 23 22:24:11 2010 (r211725) @@ -1,5 +1,7 @@ +# $FreeBSD$ + CFLAGS+= -elf LDFLAGS+= -elf # Uncomment this to build the dynamic linker as an executable instead # of a shared library: -#LDSCRIPT= ${.CURDIR}/${MACHINE_ARCH}/elf_rtld.x +#LDSCRIPT= ${.CURDIR}/${MACHINE_CPUARCH}/elf_rtld.x Modified: head/libexec/rtld-elf/i386/Makefile.inc ============================================================================== --- head/libexec/rtld-elf/i386/Makefile.inc Mon Aug 23 22:21:37 2010 (r211724) +++ head/libexec/rtld-elf/i386/Makefile.inc Mon Aug 23 22:24:11 2010 (r211725) @@ -1,5 +1,7 @@ +# $FreeBSD$ + CFLAGS+= -elf LDFLAGS+= -elf # Uncomment this to build the dynamic linker as an executable instead # of a shared library: -#LDSCRIPT= ${.CURDIR}/${MACHINE_ARCH}/elf_rtld.x +#LDSCRIPT= ${.CURDIR}/${MACHINE_CPUARCH}/elf_rtld.x Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/rescue/rescue/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -145,7 +145,7 @@ CRUNCH_LIBS+= -lzfs -lnvpair -luutil -la .endif CRUNCH_LIBS+= -lgeom -lbsdxml -ljail -lkiconv -lmd -lreadline -lsbuf -lufs -lz -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" CRUNCH_PROGS_sbin+= bsdlabel sconfig fdisk CRUNCH_ALIAS_bsdlabel= disklabel #.if ${MK_NCP} != "no" @@ -161,15 +161,15 @@ CRUNCH_PROGS_sbin+= bsdlabel CRUNCH_SRCDIR_fdisk= $(.CURDIR)/../../sbin/fdisk_pc98 .endif -.if ${MACHINE_ARCH} == "ia64" +.if ${MACHINE_CPUARCH} == "ia64" CRUNCH_PROGS_sbin+= mca .endif -.if ${MACHINE_ARCH} == "sparc64" +.if ${MACHINE_CPUARCH} == "sparc64" CRUNCH_PROGS_sbin+= bsdlabel sunlabel .endif -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" CRUNCH_PROGS_sbin+= bsdlabel fdisk CRUNCH_ALIAS_bsdlabel= disklabel .endif Modified: head/sbin/atm/atmconfig/Makefile ============================================================================== --- head/sbin/atm/atmconfig/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/sbin/atm/atmconfig/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -27,7 +27,8 @@ LDADD= -lbsnmp CLEANFILES+= oid.h .endif -.if ${MACHINE_ARCH} == "arm" +# XXX - this is verboten +.if ${MACHINE_CPUARCH} == "arm" WARNS?= 3 .endif Modified: head/sbin/bsdlabel/Makefile ============================================================================== --- head/sbin/bsdlabel/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/sbin/bsdlabel/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -8,7 +8,7 @@ SRCS= bsdlabel.c geom_bsd_enc.c #MAN= bsdlabel.5 MAN+= bsdlabel.8 -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" LINKS= ${BINDIR}/bsdlabel ${BINDIR}/disklabel MLINKS= bsdlabel.8 disklabel.8 .endif Modified: head/sbin/camcontrol/Makefile ============================================================================== --- head/sbin/camcontrol/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/sbin/camcontrol/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -7,7 +7,8 @@ SRCS+= modeedit.c .else CFLAGS+= -DMINIMALISTIC .endif -.if ${MACHINE_ARCH} == "arm" +# This is verboten +.if ${MACHINE_CPUARCH} == "arm" WARNS?= 3 .endif DPADD= ${LIBCAM} ${LIBSBUF} ${LIBUTIL} Modified: head/sbin/gbde/Makefile ============================================================================== --- head/sbin/gbde/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/sbin/gbde/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -9,7 +9,7 @@ SRCS+= g_bde_lock.c # rijndael-fst.c does evil casting things which results in warnings on # 64 bit machines, the test-vectors check out however, so it works right. -.if ${MACHINE_ARCH} != "i386" +.if ${MACHINE_CPUARCH} != "i386" WARNS?= 3 .endif Modified: head/sbin/newfs_msdos/Makefile ============================================================================== --- head/sbin/newfs_msdos/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/sbin/newfs_msdos/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -3,7 +3,8 @@ PROG= newfs_msdos MAN= newfs_msdos.8 -.if ${MACHINE_ARCH} == "arm" +# XXX - this is verboten +.if ${MACHINE_CPUARCH} == "arm" WARNS?= 3 .endif Modified: head/sbin/sunlabel/Makefile ============================================================================== --- head/sbin/sunlabel/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/sbin/sunlabel/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -6,7 +6,7 @@ PROG= sunlabel SRCS= sunlabel.c geom_sunlabel_enc.c MAN= sunlabel.8 -.if ${MACHINE_ARCH} == "sparc64" +.if ${MACHINE_CPUARCH} == "sparc64" LINKS= ${BINDIR}/sunlabel ${BINDIR}/disklabel MLINKS= sunlabel.8 disklabel.8 .endif Modified: head/secure/lib/libcrypto/Makefile ============================================================================== --- head/secure/lib/libcrypto/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/secure/lib/libcrypto/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -49,7 +49,7 @@ INCS+= asn1.h asn1_mac.h asn1t.h # bf SRCS+= bf_cfb64.c bf_ecb.c bf_ofb64.c bf_skey.c -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" .if ${MACHINE_CPU:Mi686} SRCS+= bf-686.s .else @@ -73,9 +73,9 @@ SRCS+= bn_add.c bn_blind.c bn_const.c bn bn_lib.c bn_mod.c bn_mont.c bn_mpi.c bn_mul.c bn_nist.c bn_opt.c \ bn_prime.c bn_print.c bn_rand.c bn_recp.c bn_shift.c bn_sqr.c \ bn_sqrt.c bn_word.c bn_x931p.c -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= bn-586.s co-586.s -.elif ${MACHINE_ARCH} == "amd64" +.elif ${MACHINE_CPUARCH} == "amd64" SRCS+= x86_64-gcc.c .else SRCS+= bn_asm.c @@ -89,7 +89,7 @@ INCS+= buffer.h # cast SRCS+= c_cfb64.c c_ecb.c c_ofb64.c c_skey.c -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= cast-586.s .else SRCS+= c_enc.c @@ -97,7 +97,7 @@ SRCS+= c_enc.c INCS+= cast.h # camellia -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" SRCS+= camellia.c cmll_cbc.c cmll_cfb.c cmll_ctr.c cmll_ecb.c \ cmll_misc.c cmll_ofb.c INCS+= camellia.h @@ -117,7 +117,7 @@ SRCS+= cbc3_enc.c cbc_cksm.c cbc_enc.c c enc_read.c enc_writ.c fcrypt.c ofb64ede.c ofb64enc.c \ ofb_enc.c pcbc_enc.c qud_cksm.c rand_key.c read2pwd.c \ rpc_enc.c set_key.c str2key.c xcbc_enc.c -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= des-586.s crypt586.s .else SRCS+= des_enc.c fcrypt_b.c @@ -172,7 +172,7 @@ SRCS+= bio_b64.c bio_enc.c bio_md.c bio_ m_mdc2.c m_null.c m_ripemd.c m_sha.c m_sha1.c names.c \ openbsd_hw.c p5_crpt.c p5_crpt2.c p_dec.c p_enc.c p_lib.c \ p_open.c p_seal.c p_sign.c p_verify.c -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" SRCS+= e_camellia.c .endif INCS+= evp.h @@ -208,7 +208,7 @@ INCS+= md4.h # md5 SRCS+= md5_dgst.c md5_one.c -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= md5-586.s .endif INCS+= md5.h @@ -255,7 +255,7 @@ INCS+= rc2.h # rc4 SRCS+= rc4_skey.c rc4_fblk.c -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= rc4-586.s .else SRCS+= rc4_enc.c @@ -264,7 +264,7 @@ INCS+= rc4.h # rc5 SRCS+= rc5_ecb.c rc5_skey.c rc5cfb64.c rc5ofb64.c -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= rc5-586.s .else SRCS+= rc5_enc.c @@ -284,7 +284,7 @@ INCS+= rsa.h # sha SRCS+= sha1_one.c sha1dgst.c sha_dgst.c sha_one.c sha256.c sha512.c -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= sha1-586.s .endif INCS+= sha.h @@ -351,10 +351,10 @@ buildinf.h: ${.CURDIR}/Makefile ( echo "#ifndef MK1MF_BUILD"; \ echo " /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \ echo " #define CFLAGS \"$(CC)\""; \ - echo " #define PLATFORM \"FreeBSD-${MACHINE_ARCH}\""; \ + echo " #define PLATFORM \"FreeBSD-${MACHINE_CPUARCH}\""; \ echo "#endif" ) > ${.TARGET} -opensslconf.h: opensslconf-${MACHINE_ARCH}.h +opensslconf.h: opensslconf-${MACHINE_CPUARCH}.h cp -f ${.ALLSRC} ${.TARGET} evp.h: ${LCRYPTO_SRC}/crypto/evp/evp.h @@ -383,11 +383,11 @@ afterinstall: .include -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" .PATH: ${.CURDIR}/i386 .endif -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" _bn_asmpath= ${LCRYPTO_SRC}/crypto/bn/asm .endif Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/share/man/man4/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -628,7 +628,7 @@ MLINKS+=xe.4 if_xe.4 MLINKS+=xl.4 if_xl.4 MLINKS+=zyd.4 if_zyd.4 -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" _acpi_asus.4= acpi_asus.4 _acpi_dock.4= acpi_dock.4 _acpi_fujitsu.4=acpi_fujitsu.4 @@ -678,7 +678,7 @@ _wpi.4= wpi.4 MLINKS+=lindev.4 full.4 .endif -.if ${MACHINE_ARCH} == "powerpc" +.if ${MACHINE_CPUARCH} == "powerpc" _atp.4= atp.4 .endif Modified: head/share/man/man5/Makefile ============================================================================== --- head/share/man/man5/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/share/man/man5/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -83,7 +83,7 @@ MLINKS+=resolver.5 resolv.conf.5 MAN+= hesiod.conf.5 .endif -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" _boot.config.5= boot.config.5 .endif Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Mon Aug 23 22:21:37 2010 (r211724) +++ head/share/mk/bsd.lib.mk Mon Aug 23 22:24:11 2010 (r211725) @@ -58,7 +58,7 @@ STRIP?= -s .SUFFIXES: .out .o .po .So .S .asm .s .c .cc .cpp .cxx .m .C .f .y .l .ln .if !defined(PICFLAG) -.if ${MACHINE_ARCH} == "sparc64" +.if ${MACHINE_CPUARCH} == "sparc64" PICFLAG=-fPIC .else PICFLAG=-fpic Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Mon Aug 23 22:21:37 2010 (r211724) +++ head/share/mk/bsd.sys.mk Mon Aug 23 22:24:11 2010 (r211725) @@ -79,8 +79,9 @@ CWARNFLAGS += -Werror CWARNFLAGS += -Wno-unknown-pragmas .endif -.if ${MK_SSP} != "no" && ${CC:T:Micc} != "icc" && ${MACHINE_ARCH} != "ia64" && \ - ${MACHINE_ARCH} != "arm" && ${MACHINE_ARCH} != "mips" +.if ${MK_SSP} != "no" && ${CC:T:Micc} != "icc" && \ + ${MACHINE_CPUARCH} != "ia64" && \ + ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" # Don't use -Wstack-protector as it breaks world with -Werror. SSP_CFLAGS ?= -fstack-protector CFLAGS += ${SSP_CFLAGS} Modified: head/sys/boot/arm/ixp425/boot2/Makefile ============================================================================== --- head/sys/boot/arm/ixp425/boot2/Makefile Mon Aug 23 22:21:37 2010 (r211724) +++ head/sys/boot/arm/ixp425/boot2/Makefile Mon Aug 23 22:24:11 2010 (r211725) @@ -20,7 +20,7 @@ NO_MAN= KERNPHYSADDR=0x180000 KERNVIRTADDR=${KERNPHYSADDR} BOOT_STACK=0x200000-4 -M=${MACHINE_ARCH} +M=${MACHINE} LDFLAGS=-e ${KERNPHYSADDR} -EB -T ldscript.${M} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} S=${.CURDIR}/../../../.. Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Mon Aug 23 22:21:37 2010 (r211724) +++ head/sys/conf/kern.post.mk Mon Aug 23 22:24:11 2010 (r211725) @@ -84,8 +84,8 @@ gdbinit: grep -v '# XXX' ${S}/../tools/debugscripts/dot.gdbinit | \ sed "s:MODPATH:${.OBJDIR}/modules:" > .gdbinit cp ${S}/../tools/debugscripts/gdbinit.kernel ${.CURDIR} -.if exists(${S}/../tools/debugscripts/gdbinit.${MACHINE_ARCH}) - cp ${S}/../tools/debugscripts/gdbinit.${MACHINE_ARCH} \ +.if exists(${S}/../tools/debugscripts/gdbinit.${MACHINE_CPUARCH}) + cp ${S}/../tools/debugscripts/gdbinit.${MACHINE_CPUARCH} \ ${.CURDIR}/gdbinit.machine .endif .endif Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Mon Aug 23 22:21:37 2010 (r211724) +++ head/sys/conf/kern.pre.mk Mon Aug 23 22:24:11 2010 (r211725) @@ -32,7 +32,7 @@ CTFFLAGS+= -g *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 23:35:54 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A5431065675; Mon, 23 Aug 2010 23:35:54 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id EB39B8FC08; Mon, 23 Aug 2010 23:35:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o7NNZpST057210; Mon, 23 Aug 2010 17:35:51 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 23 Aug 2010 17:36:00 -0600 (MDT) Message-Id: <20100823.173600.180924398998066421.imp@bsdimp.com> To: marius@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <201008232204.o7NM4UPA054870@svn.freebsd.org> References: <201008232204.o7NM4UPA054870@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r211722 - head/cddl/lib/libzpool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 23:35:54 -0000 In message: <201008232204.o7NM4UPA054870@svn.freebsd.org> Marius Strobl writes: : Author: marius : Date: Mon Aug 23 22:04:30 2010 : New Revision: 211722 : URL: http://svn.freebsd.org/changeset/base/211722 : : Log: : Use real atomic operations for sparc64. : : MFC after: 1 week : : Modified: : head/cddl/lib/libzpool/Makefile : : Modified: head/cddl/lib/libzpool/Makefile : ============================================================================== : --- head/cddl/lib/libzpool/Makefile Mon Aug 23 21:40:03 2010 (r211721) : +++ head/cddl/lib/libzpool/Makefile Mon Aug 23 22:04:30 2010 (r211722) : @@ -11,7 +11,7 @@ : # LIST_SRCS : .PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/os : # ATOMIC_SRCS : -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" || ${MACHINE_ARCH} == "powerpc64" : +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" || ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "powerpc64" : .PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH} : ATOMIC_SRCS= opensolaris_atomic.S : .else I find it disturbing that we have 3 or 4 copies of this code in our Makefiles... Warner From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 23:42:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34CBD1065695; Mon, 23 Aug 2010 23:42:19 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id E0E588FC16; Mon, 23 Aug 2010 23:42:18 +0000 (UTC) Received: by pwi8 with SMTP id 8so991064pwi.13 for ; Mon, 23 Aug 2010 16:42:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=BzMii8bKkNHZBAJZspJzCmOkF/vUo7NHmQo0NBsLpVA=; b=ESCa01/rQSrACnnqH+DpNmpBJUft5eUrEjU3nEmwl8RP32lF7Tf/whzYTJi0nQe7Xw RlrgiiVKnk2fiV7pPAsHNYFbv+geiHc2eMQvE73HNoCB7aUlsBTm0A59yLv8GXYBYQBx O65k03adOQvExrTj+NSuBE0hGR8Oi+A6jC0i0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=INTGIcFRqaRyvm8zpuDEFc0HrVlH17n6KOvZRIQ1nu7AYGGhNcQM7AZ+ljkkAfaVIZ 2vBX9IOKq1N4cEhL7+0sBc6wSgmo6FWuJC19joJdpIoVgw1UcoBLWDzO2HehGlMo/jIm pxT1b7lPCYgTnYWY6XCFEXsD4P+cohOgAIChA= Received: by 10.142.200.5 with SMTP id x5mr4975351wff.227.1282606938338; Mon, 23 Aug 2010 16:42:18 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id c10sm13448960wam.1.2010.08.23.16.42.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 23 Aug 2010 16:42:16 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Mon, 23 Aug 2010 16:42:13 -0700 From: Pyun YongHyeon Date: Mon, 23 Aug 2010 16:42:13 -0700 To: Scott Long Message-ID: <20100823234213.GL1116@michelle.cdnetworks.com> References: <201008222126.o7MLQavY016669@svn.freebsd.org> <7C069EE9-33B9-4D57-A6E6-C133F6C47D53@samsco.org> <20100823182516.GC1116@michelle.cdnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100823182516.GC1116@michelle.cdnetworks.com> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pyun YongHyeon Subject: Re: svn commit: r211648 - head/sys/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 23:42:19 -0000 On Mon, Aug 23, 2010 at 11:25:16AM -0700, Pyun YongHyeon wrote: > On Mon, Aug 23, 2010 at 12:27:33AM -0600, Scott Long wrote: > > On Aug 22, 2010, at 3:26 PM, Pyun YongHyeon wrote: > > > Author: yongari > > > Date: Sun Aug 22 21:26:35 2010 > > > New Revision: 211648 > > > URL: http://svn.freebsd.org/changeset/base/211648 > > > > > > Log: > > > It seems some newer RTL8139 controllers provides only memory space > > > register mapping. > > > > Something that I'm seeing more of in recent years is vendors putting descriptive information into PCI VPD attributes, and having their Windows and Linux drivers read these attributes and select behavior off of them instead of selecting based on PCI ID. I don't have any RLT8139 specs to confirm that this would be the case here, but it might be something to consider looking into. > > > > I also don't have data sheet for RTL8139 and I never saw rl(4) > controllers which have VPD capability. But I think that's good idea > to check. I've sent request mail to the user. > Thanks for hints. :-) > It seems the controller has no PCI VPD capability so I guess the idea is not applicable to RTL8139 controllers. Anyway, thanks a lot! From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 00:13:14 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C0611065697; Tue, 24 Aug 2010 00:13:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id AA0D58FC14; Tue, 24 Aug 2010 00:13:13 +0000 (UTC) Received: from c122-107-127-123.carlnfd1.nsw.optusnet.com.au (c122-107-127-123.carlnfd1.nsw.optusnet.com.au [122.107.127.123]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o7O0CZAs017208 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 24 Aug 2010 10:12:37 +1000 Date: Tue, 24 Aug 2010 10:12:34 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= In-Reply-To: <86y6bxybxc.fsf@ds4.des.no> Message-ID: <20100824100917.C22315@delplex.bde.org> References: <201008141434.o7EEYaSA030301@svn.freebsd.org> <20100815205724.00007e0f@unknown> <86wrrraqk8.fsf@ds4.des.no> <4C7194E6.6080708@andric.com> <86y6bxybxc.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-127678578-1282608754=:22315" Cc: Bruce Cran , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Bruce Evans , svn-src-head@FreeBSD.org, Dimitry Andric Subject: Re: svn commit: r211304 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 00:13:14 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-127678578-1282608754=:22315 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Mon, 23 Aug 2010, [utf-8] Dag-Erling Sm=C3=B8rgrav wrote: > Dimitry Andric writes: >> Dag-Erling Sm=C3=B8rgrav writes: >>> Bruce Cran writes: >>>> Somewhat related, there are overflow bugs in humanize_number - for >>>> example df(1) fails to display space from a 100PB filesystem >>>> correctly. >>> Patch? :) >> Attached. This makes humanize_number() work properly for all possible >> int64_t values. > > That's awesome! Any way I can convince you to fix expand_number() as > well? I got a detailed explanation of what's wrong with it (both before > and after my commits) from bde@ (cc:ed) in private correspondence; I can > forward it to you if he doesn't mind. OK. I think the final point was that it should go back to supporting signed numbers (only), and that means int64_t ones until scientificize^dehumanize^= W humanize_number() is fixed to support intmax_t ones. Bruce --0-127678578-1282608754=:22315-- From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 00:23:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7D0610656AE; Tue, 24 Aug 2010 00:23:40 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB7858FC1A; Tue, 24 Aug 2010 00:23:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7O0Ne4B058067; Tue, 24 Aug 2010 00:23:40 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7O0Neq9058065; Tue, 24 Aug 2010 00:23:40 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008240023.o7O0Neq9058065@svn.freebsd.org> From: Rui Paulo Date: Tue, 24 Aug 2010 00:23:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211729 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 00:23:41 -0000 Author: rpaulo Date: Tue Aug 24 00:23:40 2010 New Revision: 211729 URL: http://svn.freebsd.org/changeset/base/211729 Log: Mark the following static variables as __used__ instead of __unused__: o force_to_data o __CTOR_LIST__ o __do_global_dtors_aux_fini_array_entry o __frame_dummy_init_array_entry This is necessary because Clang is smart enough to optimize out these variables was they were marked as __unused__ (and they are also static). The end result was programs segfaulting because these symbols weren't present. This follows the upstream revision 159228 and the author of that revision (Jan Hubicka ) allowed us to backport this to our GPLv2 GCC. Discussed with: core Modified: head/contrib/gcc/crtstuff.c Modified: head/contrib/gcc/crtstuff.c ============================================================================== --- head/contrib/gcc/crtstuff.c Tue Aug 24 00:17:05 2010 (r211728) +++ head/contrib/gcc/crtstuff.c Tue Aug 24 00:23:40 2010 (r211729) @@ -175,14 +175,14 @@ CTOR_LIST_BEGIN; #elif defined(CTORS_SECTION_ASM_OP) /* Hack: force cc1 to switch to .data section early, so that assembling __CTOR_LIST__ does not undo our behind-the-back change to .ctors. */ -static func_ptr force_to_data[1] __attribute__ ((__unused__)) = { }; +static func_ptr force_to_data[1] __attribute__ ((__used__)) = { }; asm (CTORS_SECTION_ASM_OP); STATIC func_ptr __CTOR_LIST__[1] - __attribute__ ((__unused__, aligned(sizeof(func_ptr)))) + __attribute__ ((__used__, aligned(sizeof(func_ptr)))) = { (func_ptr) (-1) }; #else STATIC func_ptr __CTOR_LIST__[1] - __attribute__ ((__unused__, section(".ctors"), aligned(sizeof(func_ptr)))) + __attribute__ ((__used__, section(".ctors"), aligned(sizeof(func_ptr)))) = { (func_ptr) (-1) }; #endif /* __CTOR_LIST__ alternatives */ @@ -308,7 +308,7 @@ __do_global_dtors_aux (void) CRT_CALL_STATIC_FUNCTION (FINI_SECTION_ASM_OP, __do_global_dtors_aux) #else /* !defined(FINI_SECTION_ASM_OP) */ static func_ptr __do_global_dtors_aux_fini_array_entry[] - __attribute__ ((__unused__, section(".fini_array"))) + __attribute__ ((__used__, section(".fini_array"))) = { __do_global_dtors_aux }; #endif /* !defined(FINI_SECTION_ASM_OP) */ @@ -348,7 +348,7 @@ frame_dummy (void) CRT_CALL_STATIC_FUNCTION (INIT_SECTION_ASM_OP, frame_dummy) #else /* defined(INIT_SECTION_ASM_OP) */ static func_ptr __frame_dummy_init_array_entry[] - __attribute__ ((__unused__, section(".init_array"))) + __attribute__ ((__used__, section(".init_array"))) = { frame_dummy }; #endif /* !defined(INIT_SECTION_ASM_OP) */ #endif /* USE_EH_FRAME_REGISTRY || JCR_SECTION_NAME */ @@ -456,7 +456,7 @@ CTOR_LIST_END; #elif defined(CTORS_SECTION_ASM_OP) /* Hack: force cc1 to switch to .data section early, so that assembling __CTOR_LIST__ does not undo our behind-the-back change to .ctors. */ -static func_ptr force_to_data[1] __attribute__ ((__unused__)) = { }; +static func_ptr force_to_data[1] __attribute__ ((__used__)) = { }; asm (CTORS_SECTION_ASM_OP); STATIC func_ptr __CTOR_END__[1] __attribute__((aligned(sizeof(func_ptr)))) From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 06:11:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77CDE10656AB; Tue, 24 Aug 2010 06:11:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 659188FC0C; Tue, 24 Aug 2010 06:11:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7O6BkLZ065171; Tue, 24 Aug 2010 06:11:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7O6Bkpi065153; Tue, 24 Aug 2010 06:11:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008240611.o7O6Bkpi065153@svn.freebsd.org> From: Warner Losh Date: Tue, 24 Aug 2010 06:11:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211730 - in head/usr.sbin/pc-sysinstall: backend backend-query pc-sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 06:11:46 -0000 Author: imp Date: Tue Aug 24 06:11:46 2010 New Revision: 211730 URL: http://svn.freebsd.org/changeset/base/211730 Log: Indent things consistently PR: 149926 Submitted by: John Hixson Modified: head/usr.sbin/pc-sysinstall/backend-query/disk-info.sh head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh head/usr.sbin/pc-sysinstall/backend-query/disk-part.sh head/usr.sbin/pc-sysinstall/backend-query/enable-net.sh head/usr.sbin/pc-sysinstall/backend-query/get-packages.sh head/usr.sbin/pc-sysinstall/backend-query/list-packages.sh head/usr.sbin/pc-sysinstall/backend-query/set-mirror.sh head/usr.sbin/pc-sysinstall/backend-query/test-netup.sh head/usr.sbin/pc-sysinstall/backend-query/update-part-list.sh head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-models.sh head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-variants.sh head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh head/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh head/usr.sbin/pc-sysinstall/backend/functions-disk.sh head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh head/usr.sbin/pc-sysinstall/backend/functions-ftp.sh head/usr.sbin/pc-sysinstall/backend/functions-installcomponents.sh head/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh head/usr.sbin/pc-sysinstall/backend/functions-localize.sh head/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh head/usr.sbin/pc-sysinstall/backend/functions-mountoptical.sh head/usr.sbin/pc-sysinstall/backend/functions-networking.sh head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh head/usr.sbin/pc-sysinstall/backend/functions-packages.sh head/usr.sbin/pc-sysinstall/backend/functions-parse.sh head/usr.sbin/pc-sysinstall/backend/functions-unmount.sh head/usr.sbin/pc-sysinstall/backend/functions-upgrade.sh head/usr.sbin/pc-sysinstall/backend/functions-users.sh head/usr.sbin/pc-sysinstall/backend/functions.sh head/usr.sbin/pc-sysinstall/backend/parseconfig.sh head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh Modified: head/usr.sbin/pc-sysinstall/backend-query/disk-info.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/disk-info.sh Tue Aug 24 00:23:40 2010 (r211729) +++ head/usr.sbin/pc-sysinstall/backend-query/disk-info.sh Tue Aug 24 06:11:46 2010 (r211730) @@ -54,7 +54,6 @@ HEADS="${VAL}" get_disk_sectors "${DISK}" SECS="${VAL}" - # Now get the disks size in MB KB="`diskinfo -v ${1} | grep 'bytes' | cut -d '#' -f 1 | tr -s '\t' ' ' | tr -d ' '`" MB=$(convert_byte_to_megabyte ${KB}) @@ -62,10 +61,9 @@ MB=$(convert_byte_to_megabyte ${KB}) # Now get the Controller Type CTYPE="`dmesg | grep "^${1}:" | grep "B <" | cut -d '>' -f 2 | cut -d ' ' -f 3-10`" - echo "cylinders=${CYLS}" echo "heads=${HEADS}" echo "sectors=${SECS}" -echo "size=$MB" -echo "type=$CTYPE" +echo "size=${MB}" +echo "type=${CTYPE}" Modified: head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh Tue Aug 24 00:23:40 2010 (r211729) +++ head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh Tue Aug 24 06:11:46 2010 (r211730) @@ -26,16 +26,32 @@ # $FreeBSD$ ARGS=$1 +FLAGS_MD="" +FLAGS_VERBOSE="" + +shift +while [ -n "$1" ] +do + case "$1" in + -m) + FLAGS_MD=1 + ;; + -v) + FLAGS_VERBOSE=1 + ;; + esac + shift +done # Create our device listing SYSDISK=$(sysctl -n kern.disks) -if [ "${ARGS}" = "-m" ] +if [ -n "${FLAGS_MD}" ] then - MDS=`mdconfig -l` - if [ -n "${MDS}" ] - then - SYSDISK="${SYSDISK} ${MDS}" - fi + MDS=`mdconfig -l` + if [ -n "${MDS}" ] + then + SYSDISK="${SYSDISK} ${MDS}" + fi fi # Now loop through these devices, and list the disk drives @@ -47,7 +63,7 @@ do # Make sure we don't find any cd devices case "${DEV}" in - acd[0-9]*|cd[0-9]*|scd[0-9]*) continue ;; + acd[0-9]*|cd[0-9]*|scd[0-9]*) continue ;; esac # Check the dmesg output for some more info about this device @@ -55,11 +71,17 @@ do if [ -z "$NEWLINE" ]; then NEWLINE=" " fi - if echo "${DEV}" | grep -E '^md[0-9]+' >/dev/null 2>/dev/null + + if [ -n "${FLAGS_MD}" ] && echo "${DEV}" | grep -E '^md[0-9]+' >/dev/null 2>/dev/null then NEWLINE=" " fi + if [ -n "${FLAGS_VERBOSE}" ] + then + : + fi + # Save the disk list if [ ! -z "$DLIST" ] then Modified: head/usr.sbin/pc-sysinstall/backend-query/disk-part.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/disk-part.sh Tue Aug 24 00:23:40 2010 (r211729) +++ head/usr.sbin/pc-sysinstall/backend-query/disk-part.sh Tue Aug 24 06:11:46 2010 (r211730) @@ -51,8 +51,6 @@ MB=$(convert_byte_to_megabyte ${KB}) TOTALSIZE="$MB" TOTALB="`diskinfo -v ${1} | grep 'in sectors' | tr -s '\t' ' ' | cut -d ' ' -f 2`" - - gpart show ${1} >/dev/null 2>/dev/null if [ "$?" != "0" ] ; then # No partitions on this disk, display entire disk size and exit @@ -85,14 +83,14 @@ do # First get the sysid / label for this partition if [ "$TYPE" = "MBR" ] ; then - get_partition_sysid_mbr "${DISK}" "${curpart}" - echo "${curpart}-sysid: ${VAL}" - get_partition_label_mbr "${DISK}" "${curpart}" - echo "${curpart}-label: ${VAL}" + get_partition_sysid_mbr "${DISK}" "${curpart}" + echo "${curpart}-sysid: ${VAL}" + get_partition_label_mbr "${DISK}" "${curpart}" + echo "${curpart}-label: ${VAL}" else - get_partition_label_gpt "${DISK}" "${curpart}" - echo "${curpart}-sysid: ${VAL}" - echo "${curpart}-label: ${VAL}" + get_partition_label_gpt "${DISK}" "${curpart}" + echo "${curpart}-sysid: ${VAL}" + echo "${curpart}-label: ${VAL}" fi # Now get the startblock, blocksize and MB size of this partition Modified: head/usr.sbin/pc-sysinstall/backend-query/enable-net.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/enable-net.sh Tue Aug 24 00:23:40 2010 (r211729) +++ head/usr.sbin/pc-sysinstall/backend-query/enable-net.sh Tue Aug 24 06:11:46 2010 (r211730) @@ -60,6 +60,6 @@ else fi case ${MIRRORFETCH} in - ON|on|yes|YES) fetch -o /tmp/mirrors-list.txt ${MIRRORLIST} >/dev/null 2>/dev/null;; - *) ;; + ON|on|yes|YES) fetch -o /tmp/mirrors-list.txt ${MIRRORLIST} >/dev/null 2>/dev/null;; + *) ;; esac Modified: head/usr.sbin/pc-sysinstall/backend-query/get-packages.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/get-packages.sh Tue Aug 24 00:23:40 2010 (r211729) +++ head/usr.sbin/pc-sysinstall/backend-query/get-packages.sh Tue Aug 24 06:11:46 2010 (r211730) @@ -34,19 +34,19 @@ ID=`id -u` if [ "${ID}" -ne "0" ] then - echo "Error: must be root!" - exit 1 + echo "Error: must be root!" + exit 1 fi if [ ! -f "${PKGDIR}/INDEX" ] then - get_package_index + get_package_index fi if [ -f "${PKGDIR}/INDEX" ] then - echo "${PKGDIR}/INDEX" - exit 0 + echo "${PKGDIR}/INDEX" + exit 0 fi exit 1 Modified: head/usr.sbin/pc-sysinstall/backend-query/list-packages.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/list-packages.sh Tue Aug 24 00:23:40 2010 (r211729) +++ head/usr.sbin/pc-sysinstall/backend-query/list-packages.sh Tue Aug 24 06:11:46 2010 (r211730) @@ -37,50 +37,50 @@ NARGS=0 if [ ! -f "${PKGDIR}/INDEX" ] then - echo "Error: please fetch package index with get-packages!" - exit 1 + echo "Error: please fetch package index with get-packages!" + exit 1 fi if [ ! -f "${PKGDIR}/INDEX.parsed" ] then - parse_package_index + parse_package_index fi if [ -n "${PACKAGE_CATEGORY}" ] then - NARGS=$((NARGS+1)) + NARGS=$((NARGS+1)) fi if [ -n "${PACKAGE_NAME}" ] then - NARGS=$((NARGS+1)) + NARGS=$((NARGS+1)) fi if [ "${NARGS}" -eq "0" ] then - show_packages + show_packages elif [ "${NARGS}" -eq "1" ] then - if [ "${PACKAGE_CATEGORY}" = "@INDEX@" ] - then - if [ -f "${PKGDIR}/INDEX" ] - then - echo "${PKGDIR}/INDEX" - exit 0 - else - exit 1 - fi + if [ "${PACKAGE_CATEGORY}" = "@INDEX@" ] + then + if [ -f "${PKGDIR}/INDEX" ] + then + echo "${PKGDIR}/INDEX" + exit 0 + else + exit 1 + fi - else - show_packages_by_category "${PACKAGE_CATEGORY}" - fi + else + show_packages_by_category "${PACKAGE_CATEGORY}" + fi elif [ "${NARGS}" -eq "2" ] then - show_package_by_name "${PACKAGE_CATEGORY}" "${PACKAGE_NAME}" + show_package_by_name "${PACKAGE_CATEGORY}" "${PACKAGE_NAME}" else - show_packages + show_packages fi Modified: head/usr.sbin/pc-sysinstall/backend-query/set-mirror.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/set-mirror.sh Tue Aug 24 00:23:40 2010 (r211729) +++ head/usr.sbin/pc-sysinstall/backend-query/set-mirror.sh Tue Aug 24 06:11:46 2010 (r211730) @@ -32,8 +32,8 @@ MIRROR="${1}" if [ -z "${MIRROR}" ] then - echo "Error: No mirror specified!" - exit 1 + echo "Error: No mirror specified!" + exit 1 fi set_ftp_mirror "${MIRROR}" Modified: head/usr.sbin/pc-sysinstall/backend-query/test-netup.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/test-netup.sh Tue Aug 24 00:23:40 2010 (r211729) +++ head/usr.sbin/pc-sysinstall/backend-query/test-netup.sh Tue Aug 24 06:11:46 2010 (r211730) @@ -35,15 +35,15 @@ rm ${TMPDIR}/.testftp >/dev/null 2>/dev/ ping -c 2 www.pcbsd.org >/dev/null 2>/dev/null if [ "$?" = "0" ] then - echo "ftp: Up" - exit 0 + echo "ftp: Up" + exit 0 fi ping -c 2 www.freebsd.org >/dev/null 2>/dev/null if [ "$?" = "0" ] then - echo "ftp: Up" - exit 0 + echo "ftp: Up" + exit 0 fi echo "ftp: Down" Modified: head/usr.sbin/pc-sysinstall/backend-query/update-part-list.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/update-part-list.sh Tue Aug 24 00:23:40 2010 (r211729) +++ head/usr.sbin/pc-sysinstall/backend-query/update-part-list.sh Tue Aug 24 06:11:46 2010 (r211730) @@ -35,16 +35,17 @@ rm ${TMPDIR}/AvailUpgrades >/dev/null 2> FSMNT="/mnt" # Get the freebsd version on this partition -get_fbsd_ver() { +get_fbsd_ver() +{ VER="`file ${FSMNT}/bin/sh | grep 'for FreeBSD' | sed 's|for FreeBSD |;|g' | cut -d ';' -f 2 | cut -d ',' -f 1`" if [ "$?" = "0" ] ; then - file ${FSMNT}/bin/sh | grep '32-bit' >/dev/null 2>/dev/null - if [ "${?}" = "0" ] ; then - echo "${1}: FreeBSD ${VER} (32bit)" - else - echo "${1}: FreeBSD ${VER} (64bit)" - fi + file ${FSMNT}/bin/sh | grep '32-bit' >/dev/null 2>/dev/null + if [ "${?}" = "0" ] ; then + echo "${1}: FreeBSD ${VER} (32bit)" + else + echo "${1}: FreeBSD ${VER} (64bit)" + fi fi } @@ -62,7 +63,7 @@ do # Make sure we don't find any cd devices echo "${DEV}" | grep -e "^acd[0-9]" -e "^cd[0-9]" -e "^scd[0-9]" >/dev/null 2>/dev/null if [ "$?" != "0" ] ; then - DEVS="${DEVS} `ls /dev/${i}*`" + DEVS="${DEVS} `ls /dev/${i}*`" fi done @@ -70,25 +71,25 @@ done # Search for regular UFS / Geom Partitions to upgrade for i in $DEVS do - if [ ! -e "${i}a.journal" -a ! -e "${i}a" -a ! -e "${i}p2" -a ! -e "${i}p2.journal" ] ; then - continue - fi + if [ ! -e "${i}a.journal" -a ! -e "${i}a" -a ! -e "${i}p2" -a ! -e "${i}p2.journal" ] ; then + continue + fi - if [ -e "${i}a.journal" ] ; then - _dsk="${i}a.journal" - elif [ -e "${i}a" ] ; then - _dsk="${i}a" - elif [ -e "${i}p2" ] ; then - _dsk="${i}p2" - elif [ -e "${i}p2.journal" ] ; then - _dsk="${i}p2.journal" - fi + if [ -e "${i}a.journal" ] ; then + _dsk="${i}a.journal" + elif [ -e "${i}a" ] ; then + _dsk="${i}a" + elif [ -e "${i}p2" ] ; then + _dsk="${i}p2" + elif [ -e "${i}p2.journal" ] ; then + _dsk="${i}p2.journal" + fi - mount -o ro ${_dsk} ${FSMNT} >>${LOGOUT} 2>>${LOGOUT} - if [ "${?}" = "0" -a -e "${FSMNT}/bin/sh" ] ; then - get_fbsd_ver "`echo ${_dsk} | sed 's|/dev/||g'`" - umount -f ${FSMNT} >/dev/null 2>/dev/null - fi + mount -o ro ${_dsk} ${FSMNT} >>${LOGOUT} 2>>${LOGOUT} + if [ "${?}" = "0" -a -e "${FSMNT}/bin/sh" ] ; then + get_fbsd_ver "`echo ${_dsk} | sed 's|/dev/||g'`" + umount -f ${FSMNT} >/dev/null 2>/dev/null + fi done # Now search for any ZFS root partitions @@ -101,9 +102,9 @@ umount_all_dir "${FSMNT}" _zps="`zpool list | grep -v 'NAME' | cut -d ' ' -f 1`" for _zpools in ${_zps} do - mount -o ro -t zfs ${_zpools} ${FSMNT} >>${LOGOUT} 2>>${LOGOUT} - if [ "${?}" = "0" -a -e "${FSMNT}/bin/sh" ] ; then - get_fbsd_ver "${_zpools}" - umount -f ${FSMNT} >/dev/null 2>/dev/null - fi + mount -o ro -t zfs ${_zpools} ${FSMNT} >>${LOGOUT} 2>>${LOGOUT} + if [ "${?}" = "0" -a -e "${FSMNT}/bin/sh" ] ; then + get_fbsd_ver "${_zpools}" + umount -f ${FSMNT} >/dev/null 2>/dev/null + fi done Modified: head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh Tue Aug 24 00:23:40 2010 (r211729) +++ head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh Tue Aug 24 06:11:46 2010 (r211730) @@ -36,7 +36,7 @@ do echo $line | grep '! ' >/dev/null 2>/dev/null if [ "$?" = "0" ] then - exit 0 + exit 0 else echo "$line" fi Modified: head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-models.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-models.sh Tue Aug 24 00:23:40 2010 (r211729) +++ head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-models.sh Tue Aug 24 06:11:46 2010 (r211730) @@ -36,7 +36,7 @@ do echo $line | grep '! ' >/dev/null 2>/dev/null if [ "$?" = "0" ] then - exit 0 + exit 0 else model="`echo $line | sed 's|(|[|g'`" model="`echo $model | sed 's|)|]|g'`" Modified: head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-variants.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-variants.sh Tue Aug 24 00:23:40 2010 (r211729) +++ head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-variants.sh Tue Aug 24 06:11:46 2010 (r211730) @@ -36,7 +36,7 @@ do echo $line | grep '! ' >/dev/null 2>/dev/null if [ "$?" = "0" ] then - exit 0 + exit 0 else echo "$line" fi Modified: head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Tue Aug 24 00:23:40 2010 (r211729) +++ head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Tue Aug 24 06:11:46 2010 (r211730) @@ -76,7 +76,6 @@ get_fs_line_xvars() return fi # End of ZFS block - fi # End of xtra-options block # If we got here, set VAR to empty and export @@ -86,30 +85,31 @@ get_fs_line_xvars() }; # Init each zfs mirror disk with a boot sector so we can failover -setup_zfs_mirror_parts() { - - _nZFS="" - # Using mirroring, setup boot partitions on each disk - _mirrline="`echo ${1} | sed 's|mirror ||g'`" - for _zvars in $_mirrline - do - echo "Looping through _zvars: $_zvars" >>${LOGOUT} - echo "$_zvars" | grep "${2}" >/dev/null 2>/dev/null - if [ "$?" = "0" ] ; then continue ; fi - if [ -z "$_zvars" ] ; then continue ; fi - - is_disk "$_zvars" >/dev/null 2>/dev/null - if [ "$?" = "0" ] ; then - echo "Setting up ZFS mirror disk $_zvars" >>${LOGOUT} - init_gpt_full_disk "$_zvars" >/dev/null 2>/dev/null - rc_halt "gpart bootcode -p /boot/gptzfsboot -i 1 ${_zvars}" >/dev/null 2>/dev/null - rc_halt "gpart add -t freebsd-zfs ${_zvars}" >/dev/null 2>/dev/null - _nZFS="$_nZFS ${_zvars}p2" - else - _nZFS="$_nZFS ${_zvars}" - fi - done - echo "mirror $2 `echo $_nZFS | tr -s ' '`" +setup_zfs_mirror_parts() +{ + _nZFS="" + + # Using mirroring, setup boot partitions on each disk + _mirrline="`echo ${1} | sed 's|mirror ||g'`" + for _zvars in $_mirrline + do + echo "Looping through _zvars: $_zvars" >>${LOGOUT} + echo "$_zvars" | grep "${2}" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then continue ; fi + if [ -z "$_zvars" ] ; then continue ; fi + + is_disk "$_zvars" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + echo "Setting up ZFS mirror disk $_zvars" >>${LOGOUT} + init_gpt_full_disk "$_zvars" >/dev/null 2>/dev/null + rc_halt "gpart bootcode -p /boot/gptzfsboot -i 1 ${_zvars}" >/dev/null 2>/dev/null + rc_halt "gpart add -t freebsd-zfs ${_zvars}" >/dev/null 2>/dev/null + _nZFS="$_nZFS ${_zvars}p2" + else + _nZFS="$_nZFS ${_zvars}" + fi + done + echo "mirror $2 `echo $_nZFS | tr -s ' '`" } ; # Function which creates a unique label name for the specified mount @@ -161,7 +161,6 @@ gen_glabel_name() # Function to setup / stamp a legacy MBR bsdlabel setup_mbr_partitions() { - DISKTAG="$1" WRKSLICE="$2" FOUNDPARTS="1" @@ -218,7 +217,7 @@ setup_mbr_partitions() # Now check that these values are sane case $FS in - UFS|UFS+S|UFS+J|ZFS|SWAP) ;; + UFS|UFS+S|UFS+J|ZFS|SWAP) ;; *) exit_err "ERROR: Invalid file system specified on $line" ;; esac @@ -316,16 +315,16 @@ setup_mbr_partitions() # This partition letter is used, get the next one case ${PARTLETTER} in - a) PARTLETTER="b" ;; - b) # When we hit b, add the special c: setup for bsdlabel - echo "c: * * unused" >>${BSDLABEL} - PARTLETTER="d" ;; - d) PARTLETTER="e" ;; - e) PARTLETTER="f" ;; - f) PARTLETTER="g" ;; - g) PARTLETTER="h" ;; - h) PARTLETTER="ERR" ;; - *) exit_err "ERROR: bsdlabel only supports up to letter h for partitions." ;; + a) PARTLETTER="b" ;; + b) # When we hit b, add the special c: setup for bsdlabel + echo "c: * * unused" >>${BSDLABEL} + PARTLETTER="d" ;; + d) PARTLETTER="e" ;; + e) PARTLETTER="f" ;; + f) PARTLETTER="g" ;; + g) PARTLETTER="h" ;; + h) PARTLETTER="ERR" ;; + *) exit_err "ERROR: bsdlabel only supports up to letter h for partitions." ;; esac fi # End of subsection locating a slice in config @@ -402,7 +401,7 @@ setup_gpt_partitions() # Now check that these values are sane case $FS in - UFS|UFS+S|UFS+J|ZFS|SWAP) ;; + UFS|UFS+S|UFS+J|ZFS|SWAP) ;; *) exit_err "ERROR: Invalid file system specified on $line" ;; esac @@ -464,9 +463,9 @@ setup_gpt_partitions() # Figure out the gpart type to use case ${FS} in - ZFS) PARTYPE="freebsd-zfs" ;; - SWAP) PARTYPE="freebsd-swap" ;; - *) PARTYPE="freebsd-ufs" ;; + ZFS) PARTYPE="freebsd-zfs" ;; + SWAP) PARTYPE="freebsd-swap" ;; + *) PARTYPE="freebsd-ufs" ;; esac # Create the partition @@ -507,8 +506,8 @@ setup_gpt_partitions() # If this is the boot disk, stamp the right gptboot if [ ! -z "${BOOTTYPE}" ] ; then case ${BOOTTYPE} in - freebsd-ufs) rc_halt "gpart bootcode -p /boot/gptboot -i 1 ${DISK}" ;; - freebsd-zfs) rc_halt "gpart bootcode -p /boot/gptzfsboot -i 1 ${DISK}" ;; + freebsd-ufs) rc_halt "gpart bootcode -p /boot/gptboot -i 1 ${DISK}" ;; + freebsd-zfs) rc_halt "gpart bootcode -p /boot/gptzfsboot -i 1 ${DISK}" ;; esac fi Modified: head/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh Tue Aug 24 00:23:40 2010 (r211729) +++ head/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh Tue Aug 24 06:11:46 2010 (r211730) @@ -166,8 +166,8 @@ setup_fstab() # Set mount options for file-systems case $PARTFS in UFS+J) MNTOPTS="rw,noatime,async" ;; - SWAP) MNTOPTS="sw" ;; - *) MNTOPTS="rw,noatime" ;; + SWAP) MNTOPTS="sw" ;; + *) MNTOPTS="rw,noatime" ;; esac @@ -391,30 +391,28 @@ set_root_pw() run_final_cleanup() { + # Check if we need to run any gmirror setup + ls ${MIRRORCFGDIR}/* >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + # Lets setup gmirror now + setup_gmirror + fi - # Check if we need to run any gmirror setup - ls ${MIRRORCFGDIR}/* >/dev/null 2>/dev/null - if [ "$?" = "0" ] - then - # Lets setup gmirror now - setup_gmirror - fi - - # Check if we need to save any geli keys - ls ${GELIKEYDIR}/* >/dev/null 2>/dev/null - if [ "$?" = "0" ] - then - # Lets setup geli loading - setup_geli_loading - fi - - # Set a hostname on the install system - setup_hostname + # Check if we need to save any geli keys + ls ${GELIKEYDIR}/* >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + # Lets setup geli loading + setup_geli_loading + fi - # Set the root_pw if it is specified - set_root_pw + # Set a hostname on the install system + setup_hostname - # Generate the fstab for the installed system - setup_fstab + # Set the root_pw if it is specified + set_root_pw + # Generate the fstab for the installed system + setup_fstab }; Modified: head/usr.sbin/pc-sysinstall/backend/functions-disk.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-disk.sh Tue Aug 24 00:23:40 2010 (r211729) +++ head/usr.sbin/pc-sysinstall/backend/functions-disk.sh Tue Aug 24 06:11:46 2010 (r211730) @@ -28,13 +28,14 @@ # Functions related to disk operations using gpart # See if device is a full disk or partition/slice -is_disk() { - for _dsk in `sysctl -n kern.disks` - do - if [ "$_dsk" = "${1}" ] ; then return 0 ; fi - done +is_disk() +{ + for _dsk in `sysctl -n kern.disks` + do + if [ "$_dsk" = "${1}" ] ; then return 0 ; fi + done - return 1 + return 1 } # Get a MBR partitions sysid @@ -190,9 +191,9 @@ get_disk_partitions() for i in ${SLICES} do case $type in - MBR) name="${1}s${i}" ;; - GPT) name="${1}p${i}";; - *) name="${1}s${i}";; + MBR) name="${1}s${i}" ;; + GPT) name="${1}p${i}";; + *) name="${1}s${i}";; esac if [ -z "${RSLICES}" ] then @@ -226,8 +227,19 @@ get_disk_heads() VAL="${head}" ; export VAL }; +# Function which returns a target disks mediasize in sectors +get_disk_mediasize() +{ + mediasize=`diskinfo -v ${1} | grep "# mediasize in sectors" | tr -s ' ' | cut -f 2` + + # Not sure why this is, memory disks need it though. + mediasize=`expr ${mediasize} - 10` + VAL="${mediasize}" ; export VAL +}; + # Function which exports all zpools, making them safe to overwrite potentially -export_all_zpools() { +export_all_zpools() +{ # Export any zpools for i in `zpool list -H -o name` do @@ -434,20 +446,30 @@ setup_disk_slice() if [ ! -z "${DISK}" -a ! -z "${PTYPE}" ] then case ${PTYPE} in - all|ALL) if [ "$PSCHEME" = "MBR" -o -z "$PSCHEME" ] ; then - PSCHEME="MBR" - tmpSLICE="${DISK}s1" - else - tmpSLICE="${DISK}p1" - fi - run_gpart_full "${DISK}" "${BMANAGER}" "${PSCHEME}" ;; - s1|s2|s3|s4) tmpSLICE="${DISK}${PTYPE}" - # Get the number of the slice we are working on - s="`echo ${PTYPE} | awk '{print substr($0,length,1)}'`" - run_gpart_slice "${DISK}" "${BMANAGER}" "${s}" ;; - free|FREE) tmpSLICE="${DISK}s${LASTSLICE}" - run_gpart_free "${DISK}" "${LASTSLICE}" "${BMANAGER}" ;; - *) exit_err "ERROR: Unknown PTYPE: $PTYPE" ;; + all|ALL) + if [ "$PSCHEME" = "MBR" -o -z "$PSCHEME" ] ; then + PSCHEME="MBR" + tmpSLICE="${DISK}s1" + else + tmpSLICE="${DISK}p1" + fi + + run_gpart_full "${DISK}" "${BMANAGER}" "${PSCHEME}" + ;; + + s1|s2|s3|s4) + tmpSLICE="${DISK}${PTYPE}" + # Get the number of the slice we are working on + s="`echo ${PTYPE} | awk '{print substr($0,length,1)}'`" + run_gpart_slice "${DISK}" "${BMANAGER}" "${s}" + ;; + + free|FREE) + tmpSLICE="${DISK}s${LASTSLICE}" + run_gpart_free "${DISK}" "${LASTSLICE}" "${BMANAGER}" + ;; + + *) exit_err "ERROR: Unknown PTYPE: $PTYPE" ;; esac # Now save which disk this is, so we can parse it later during slice partition setup @@ -478,7 +500,8 @@ setup_disk_slice() }; # Stop all gjournals on disk / slice -stop_gjournal() { +stop_gjournal() +{ _gdsk="$1" # Check if we need to shutdown any journals on this drive ls /dev/${_gdsk}*.journal >/dev/null 2>/dev/null @@ -565,7 +588,11 @@ init_mbr_full_disk() # Multiply them all together to get our total blocks totalblocks="`expr ${cyl} \* ${head}`" totalblocks="`expr ${totalblocks} \* ${sec}`" - + if [ -z "${totalblocks}" ] + then + get_disk_mediasize "${_intDISK}" + totalblocks="${VAL}" + fi # Now set the ending block to the total disk block size sizeblock="`expr ${totalblocks} - ${startblock}`" Modified: head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh Tue Aug 24 00:23:40 2010 (r211729) +++ head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh Tue Aug 24 06:11:46 2010 (r211730) @@ -54,39 +54,41 @@ start_extract_uzip_tar() echo_log "pc-sysinstall: Starting Extraction" case ${PACKAGETYPE} in - uzip) # Start by mounting the uzip image - MDDEVICE=`mdconfig -a -t vnode -o readonly -f ${INSFILE}` - mkdir -p ${FSMNT}.uzip - mount -r /dev/${MDDEVICE}.uzip ${FSMNT}.uzip - if [ "$?" != "0" ] - then - exit_err "ERROR: Failed mounting the ${INSFILE}" - fi - cd ${FSMNT}.uzip - - # Copy over all the files now! - tar cvf - . 2>/dev/null | tar -xpv -C ${FSMNT} ${TAROPTS} -f - 2>&1 | tee -a ${FSMNT}/.tar-extract.log - if [ "$?" != "0" ] - then - cd / - echo "TAR failure occured:" >>${LOGOUT} - cat ${FSMNT}/.tar-extract.log | grep "tar:" >>${LOGOUT} - umount ${FSMNT}.uzip - mdconfig -d -u ${MDDEVICE} - exit_err "ERROR: Failed extracting the tar image" - fi - - # All finished, now lets umount and cleanup - cd / - umount ${FSMNT}.uzip - mdconfig -d -u ${MDDEVICE} - ;; - tar) tar -xpv -C ${FSMNT} -f ${INSFILE} ${TAROPTS} >&1 2>&1 - if [ "$?" != "0" ] - then - exit_err "ERROR: Failed extracting the tar image" - fi - ;; + uzip) + # Start by mounting the uzip image + MDDEVICE=`mdconfig -a -t vnode -o readonly -f ${INSFILE}` + mkdir -p ${FSMNT}.uzip + mount -r /dev/${MDDEVICE}.uzip ${FSMNT}.uzip + if [ "$?" != "0" ] + then + exit_err "ERROR: Failed mounting the ${INSFILE}" + fi + cd ${FSMNT}.uzip + + # Copy over all the files now! + tar cvf - . 2>/dev/null | tar -xpv -C ${FSMNT} ${TAROPTS} -f - 2>&1 | tee -a ${FSMNT}/.tar-extract.log + if [ "$?" != "0" ] + then + cd / + echo "TAR failure occured:" >>${LOGOUT} + cat ${FSMNT}/.tar-extract.log | grep "tar:" >>${LOGOUT} + umount ${FSMNT}.uzip + mdconfig -d -u ${MDDEVICE} + exit_err "ERROR: Failed extracting the tar image" + fi + + # All finished, now lets umount and cleanup + cd / + umount ${FSMNT}.uzip + mdconfig -d -u ${MDDEVICE} + ;; + tar) + tar -xpv -C ${FSMNT} -f ${INSFILE} ${TAROPTS} >&1 2>&1 + if [ "$?" != "0" ] + then + exit_err "ERROR: Failed extracting the tar image" + fi + ;; esac # Check if this was a FTP download and clean it up now @@ -120,10 +122,10 @@ start_extract_split() DIRS=`ls -d ${INSDIR}/*|grep -Ev '(uzip|kernels|src)'` for dir in ${DIRS} do - cd "${dir}" - if [ -f "install.sh" ] - then - echo_log "Extracting" `basename ${dir}` + cd "${dir}" + if [ -f "install.sh" ] + then + echo_log "Extracting" `basename ${dir}` echo "y" | sh install.sh >/dev/null if [ "$?" != "0" ] then @@ -139,13 +141,13 @@ start_extract_split() cd "${KERNELS}" if [ -f "install.sh" ] then - echo_log "Extracting" `basename ${KERNELS}` + echo_log "Extracting" `basename ${KERNELS}` echo "y" | sh install.sh generic >/dev/null if [ "$?" != "0" ] then exit_err "ERROR: Failed extracting ${KERNELS}" fi - echo 'kernel="GENERIC"' > "${FSMNT}/boot/loader.conf" + mv "${FSMNT}/boot/GENERIC" "${FSMNT}/boot/kernel" else exit_err "ERROR: ${KERNELS}/install.sh does not exist" fi @@ -155,7 +157,7 @@ start_extract_split() cd "${SOURCE}" if [ -f "install.sh" ] then - echo_log "Extracting" `basename ${SOURCE}` + echo_log "Extracting" `basename ${SOURCE}` echo "y" | sh install.sh all >/dev/null if [ "$?" != "0" ] then @@ -206,14 +208,14 @@ fetch_install_file() # Function which will download freebsd install files fetch_split_files() { - get_value_from_cfg ftpHost + get_ftpHost if [ -z "$VAL" ] then exit_err "ERROR: Install medium was set to ftp, but no ftpHost was provided!" fi FTPHOST="${VAL}" - get_value_from_cfg ftpDir + get_ftpDir if [ -z "$VAL" ] then exit_err "ERROR: Install medium was set to ftp, but no ftpDir was provided!" @@ -228,6 +230,18 @@ fetch_split_files() OUTFILE="${FSMNT}/.fetch-${INSFILE}" fi + DIRS="base catpages dict doc games info manpages proflibs kernels src" + if [ "${FBSD_ARCH}" = "amd64" ] + then + DIRS="${DIRS} lib32" + fi + + for d in ${DIRS} + do + mkdir -p "${OUTFILE}/${d}" + done + + NETRC="${OUTFILE}/.netrc" cat<"${NETRC}" machine ${FTPHOST} @@ -238,22 +252,16 @@ bin prompt EOF - DIRS="base catpages dict doc games info manpages proflibs kernels src" - if [ "${FBSD_ARCH}" = "amd64" ] - then - DIRS="${DIRS} lib32" - fi - for d in ${DIRS} do - cat<>"${NETRC}" + cat<>"${NETRC}" cd ${FTPDIR}/${d} lcd ${OUTFILE}/${d} mreget * EOF done - cat<>"${NETRC}" + cat<>"${NETRC}" bye @@ -335,19 +343,19 @@ init_extraction() if [ "$INSTALLTYPE" = "FreeBSD" ] then case $PACKAGETYPE in - uzip) INSFILE="${FBSD_UZIP_FILE}" ;; - tar) INSFILE="${FBSD_TAR_FILE}" ;; - split) - INSDIR="${FBSD_BRANCH_DIR}" - - # This is to trick opt_mount into not failing - INSFILE="${INSDIR}" - ;; + uzip) INSFILE="${FBSD_UZIP_FILE}" ;; + tar) INSFILE="${FBSD_TAR_FILE}" ;; + split) + INSDIR="${FBSD_BRANCH_DIR}" + + # This is to trick opt_mount into not failing + INSFILE="${INSDIR}" + ;; esac else case $PACKAGETYPE in - uzip) INSFILE="${UZIP_FILE}" ;; - tar) INSFILE="${TAR_FILE}" ;; + uzip) INSFILE="${UZIP_FILE}" ;; + tar) INSFILE="${TAR_FILE}" ;; esac fi export INSFILE @@ -355,33 +363,37 @@ init_extraction() # Lets start by figuring out what medium we are using case ${INSTALLMEDIUM} in - dvd|usb) # Lets start by mounting the disk - opt_mount - if [ ! -z "${INSDIR}" ] - then - INSDIR="${CDMNT}/${INSDIR}" ; export INSDIR - start_extract_split - - else - INSFILE="${CDMNT}/${INSFILE}" ; export INSFILE - start_extract_uzip_tar - fi - ;; - ftp) - if [ "$PACKAGETYPE" = "split" ] - then - fetch_split_files - - INSDIR="${INSFILE}" ; export INSDIR - start_extract_split - else - fetch_install_file - start_extract_uzip_tar - fi - ;; - rsync) start_rsync_copy - ;; - *) exit_err "ERROR: Unknown install medium" ;; + dvd|usb) + # Lets start by mounting the disk + opt_mount + if [ ! -z "${INSDIR}" ] + then + INSDIR="${CDMNT}/${INSDIR}" ; export INSDIR + start_extract_split + + else + INSFILE="${CDMNT}/${INSFILE}" ; export INSFILE + start_extract_uzip_tar + fi + ;; + + ftp|sftp) + if [ "$PACKAGETYPE" = "split" ] + then + fetch_split_files + + INSDIR="${INSFILE}" ; export INSDIR + start_extract_split + else + fetch_install_file + start_extract_uzip_tar + fi + ;; + + rsync) start_rsync_copy ;; + img) + ;; + *) exit_err "ERROR: Unknown install medium" ;; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 06:30:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9392E106566C; Tue, 24 Aug 2010 06:30:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68E8F8FC21; Tue, 24 Aug 2010 06:30:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7O6Ukrb065605; Tue, 24 Aug 2010 06:30:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7O6Uk87065603; Tue, 24 Aug 2010 06:30:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008240630.o7O6Uk87065603@svn.freebsd.org> From: Warner Losh Date: Tue, 24 Aug 2010 06:30:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211731 - head/gnu/lib/libdialog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 06:30:46 -0000 Author: imp Date: Tue Aug 24 06:30:46 2010 New Revision: 211731 URL: http://svn.freebsd.org/changeset/base/211731 Log: Create a checklist and call one of the *printw() functions from the selected() callback. When the dialog first appears, you will not see the printed statement on the dialog, if you move down one, you will, move up again and it now appears. I am assuming that you call a *printw() function on a line in the dialog box of course. The fix, from the pr: This is a hack at best, I looked at the redraw code in dialog_checklist() and took the minimal amount of it out to do a simple "refresh" right after the items are drawn. This doesn't hurt anything and makes the library work like it should. There is probably a better way however =). PR: 148609 Submitted by: John Hixson Modified: head/gnu/lib/libdialog/checklist.c Modified: head/gnu/lib/libdialog/checklist.c ============================================================================== --- head/gnu/lib/libdialog/checklist.c Tue Aug 24 06:11:46 2010 (r211730) +++ head/gnu/lib/libdialog/checklist.c Tue Aug 24 06:30:46 2010 (r211731) @@ -198,6 +198,24 @@ draw: wnoutrefresh(dialog); wmove(list, choice, check_x+1); wrefresh(list); + + /* + * XXX Black magic voodoo that allows printing to the checklist + * window. For some reason, if this "refresh" code is not in + * place, printing to the window from the selected callback + * prints "behind" the checklist window. There is probably a + * better way to do this. + */ + draw_box(dialog, box_y, box_x, list_height + 2, list_width + 2, menubox_border_attr, menubox_attr); + + for (i = 0; i < max_choice; i++) + print_item(list, items[i * 3], items[i * 3 + 1], status[i], i, i == choice, DREF(ditems, i), list_width, item_x, check_x); + print_arrows(dialog, scroll, list_height, item_no, box_x, box_y, check_x + 4, cur_x, cur_y); + + wmove(list, choice, check_x+1); + wnoutrefresh(dialog); + wrefresh(list); + /* XXX Black magic XXX */ while (key != ESC) { key = wgetch(dialog); From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 06:57:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8143B106564A; Tue, 24 Aug 2010 06:57:13 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 425178FC15; Tue, 24 Aug 2010 06:57:13 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:786b:92c8:74d6:de20] (unknown [IPv6:2001:7b8:3a7:0:786b:92c8:74d6:de20]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 3FCE75C59; Tue, 24 Aug 2010 08:57:12 +0200 (CEST) Message-ID: <4C736D4F.6080003@andric.com> Date: Tue, 24 Aug 2010 08:57:19 +0200 From: Dimitry Andric User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.9pre) Gecko/20100814 Lanikai/3.1.3pre MIME-Version: 1.0 To: Edwin Groothuis References: <201008232209.o7NM9Q5l055003@svn.freebsd.org> In-Reply-To: <201008232209.o7NM9Q5l055003@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r211723 - in stable/8/usr.bin/calendar: . calendars calendars/ru_RU.KOI8-R X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 06:57:13 -0000 On 2010-08-24 00:09, Edwin Groothuis wrote: > Author: edwin > Date: Mon Aug 23 22:09:25 2010 > New Revision: 211723 > URL: http://svn.freebsd.org/changeset/base/211723 > > Log: > MFC of r205821 r205827 r205828 r205862 r205872 r205937 r206568 > MFC of r208825 r208826 r208827 r208828 r208829 r208943 > > r205821: > Long awaited update to the calendar system: ... > Modified: > stable/8/usr.bin/calendar/Makefile > stable/8/usr.bin/calendar/calendar.1 > stable/8/usr.bin/calendar/calendar.c > stable/8/usr.bin/calendar/calendar.h > stable/8/usr.bin/calendar/calendars/calendar.australia > stable/8/usr.bin/calendar/calendars/calendar.dutch > stable/8/usr.bin/calendar/calendars/calendar.freebsd > stable/8/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.common (contents, props changed) > stable/8/usr.bin/calendar/day.c > stable/8/usr.bin/calendar/io.c > stable/8/usr.bin/calendar/ostern.c > stable/8/usr.bin/calendar/paskha.c > stable/8/usr.bin/calendar/pathnames.h > Directory Properties: > stable/8/usr.bin/calendar/ (props changed) Hi Edwin, I think you forgot to add usr.bin/calendar/locale.c here? The tinderboxes complain: ===> usr.bin/calendar (depend) make: don't know how to make locale.c. Stop *** Error code 2 From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 07:22:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E6661065672; Tue, 24 Aug 2010 07:22:24 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8DCBC8FC1B; Tue, 24 Aug 2010 07:22:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7O7MObH066649; Tue, 24 Aug 2010 07:22:24 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7O7MOH0066646; Tue, 24 Aug 2010 07:22:24 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201008240722.o7O7MOH0066646@svn.freebsd.org> From: David Xu Date: Tue, 24 Aug 2010 07:22:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211732 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 07:22:24 -0000 Author: davidxu Date: Tue Aug 24 07:22:24 2010 New Revision: 211732 URL: http://svn.freebsd.org/changeset/base/211732 Log: - According to specification, SI_USER code should only be generated by standard kill(). On other systems, SI_LWP is generated by lwp_kill(). This will allow conforming applications to differentiate between signals generated by standard events and those generated by other implementation events in a manner compatible with existing practice. - Bump __FreeBSD_version Modified: head/sys/kern/kern_thr.c head/sys/sys/signal.h Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Tue Aug 24 06:30:46 2010 (r211731) +++ head/sys/kern/kern_thr.c Tue Aug 24 07:22:24 2010 (r211732) @@ -312,7 +312,7 @@ thr_kill(struct thread *td, struct thr_k error = 0; ksiginfo_init(&ksi); ksi.ksi_signo = uap->sig; - ksi.ksi_code = SI_USER; + ksi.ksi_code = SI_LWP; ksi.ksi_pid = p->p_pid; ksi.ksi_uid = td->td_ucred->cr_ruid; PROC_LOCK(p); @@ -371,7 +371,7 @@ thr_kill2(struct thread *td, struct thr_ if (error == 0) { ksiginfo_init(&ksi); ksi.ksi_signo = uap->sig; - ksi.ksi_code = SI_USER; + ksi.ksi_code = SI_LWP; ksi.ksi_pid = td->td_proc->p_pid; ksi.ksi_uid = td->td_ucred->cr_ruid; if (uap->id == -1) { Modified: head/sys/sys/signal.h ============================================================================== --- head/sys/sys/signal.h Tue Aug 24 06:30:46 2010 (r211731) +++ head/sys/sys/signal.h Tue Aug 24 07:22:24 2010 (r211732) @@ -338,6 +338,7 @@ struct sigaction { #define SI_MESGQ 0x10005 /* Signal generated by arrival of a */ /* message on an empty message queue. */ #define SI_KERNEL 0x10006 +#define SI_LWP 0x10007 /* Signal sent by thr_kill */ #endif #if __BSD_VISIBLE #define SI_UNDEFINED 0 From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 07:29:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B2741065672; Tue, 24 Aug 2010 07:29:55 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B1FB8FC1E; Tue, 24 Aug 2010 07:29:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7O7Tt8H066820; Tue, 24 Aug 2010 07:29:55 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7O7TtBG066818; Tue, 24 Aug 2010 07:29:55 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201008240729.o7O7TtBG066818@svn.freebsd.org> From: David Xu Date: Tue, 24 Aug 2010 07:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211733 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 07:29:55 -0000 Author: davidxu Date: Tue Aug 24 07:29:55 2010 New Revision: 211733 URL: http://svn.freebsd.org/changeset/base/211733 Log: Optimize thr_suspend, if timeout is zero, don't call msleep, just return immediately. Modified: head/sys/kern/kern_thr.c Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Tue Aug 24 07:22:24 2010 (r211732) +++ head/sys/kern/kern_thr.c Tue Aug 24 07:29:55 2010 (r211733) @@ -430,15 +430,12 @@ int kern_thr_suspend(struct thread *td, struct timespec *tsp) { struct timeval tv; - int error = 0, hz = 0; + int error = 0; + int timo = 0; if (tsp != NULL) { if (tsp->tv_nsec < 0 || tsp->tv_nsec > 1000000000) return (EINVAL); - if (tsp->tv_sec == 0 && tsp->tv_nsec == 0) - return (ETIMEDOUT); - TIMESPEC_TO_TIMEVAL(&tv, tsp); - hz = tvtohz(&tv); } if (td->td_pflags & TDP_WAKEUP) { @@ -447,9 +444,17 @@ kern_thr_suspend(struct thread *td, stru } PROC_LOCK(td->td_proc); - if ((td->td_flags & TDF_THRWAKEUP) == 0) - error = msleep((void *)td, &td->td_proc->p_mtx, PCATCH, "lthr", - hz); + if ((td->td_flags & TDF_THRWAKEUP) == 0) { + if (tsp->tv_sec == 0 && tsp->tv_nsec == 0) + error = EWOULDBLOCK; + else { + TIMESPEC_TO_TIMEVAL(&tv, tsp); + timo = tvtohz(&tv); + error = msleep((void *)td, &td->td_proc->p_mtx, + PCATCH, "lthr", timo); + } + } + if (td->td_flags & TDF_THRWAKEUP) { thread_lock(td); td->td_flags &= ~TDF_THRWAKEUP; @@ -461,7 +466,7 @@ kern_thr_suspend(struct thread *td, stru if (error == EWOULDBLOCK) error = ETIMEDOUT; else if (error == ERESTART) { - if (hz != 0) + if (timo != 0) error = EINTR; } return (error); From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 07:51:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F3691065673; Tue, 24 Aug 2010 07:51:20 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: from k7.mavetju.org (unknown [IPv6:2001:44b8:7bf1:a51:20f:eaff:fe2c:d518]) by mx1.freebsd.org (Postfix) with ESMTP id D46BC8FC1D; Tue, 24 Aug 2010 07:51:19 +0000 (UTC) Received: by k7.mavetju.org (Postfix, from userid 1001) id C48434526C; Tue, 24 Aug 2010 17:51:17 +1000 (EST) Date: Tue, 24 Aug 2010 17:51:17 +1000 From: Edwin Groothuis To: Dimitry Andric Message-ID: <20100824075117.GE2361@mavetju.org> References: <201008232209.o7NM9Q5l055003@svn.freebsd.org> <4C736D4F.6080003@andric.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C736D4F.6080003@andric.com> User-Agent: Mutt/1.4.2.3i Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r211723 - in stable/8/usr.bin/calendar: . calendars calendars/ru_RU.KOI8-R X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 07:51:20 -0000 On Tue, Aug 24, 2010 at 08:57:19AM +0200, Dimitry Andric wrote: > I think you forgot to add usr.bin/calendar/locale.c here? The > tinderboxes complain: > > ===> usr.bin/calendar (depend) > make: don't know how to make locale.c. Stop > *** Error code 2 I'm confused, shouldn't they be added automatically because of the "svn merge"? Committing them now, my apologies. Edwin -- Edwin Groothuis Website: http://www.mavetju.org/ edwin@mavetju.org Weblog: http://www.mavetju.org/weblog/ From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 07:59:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 187CC10656AC; Tue, 24 Aug 2010 07:59:40 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05D058FC18; Tue, 24 Aug 2010 07:59:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7O7xdOC067441; Tue, 24 Aug 2010 07:59:39 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7O7xd4A067435; Tue, 24 Aug 2010 07:59:39 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201008240759.o7O7xd4A067435@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 24 Aug 2010 07:59:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211734 - stable/8/usr.bin/calendar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 07:59:40 -0000 Author: edwin Date: Tue Aug 24 07:59:39 2010 New Revision: 211734 URL: http://svn.freebsd.org/changeset/base/211734 Log: For some reason, the new files which got merged from the head branch didn't get automatically added to the repository. MFC of r205821 r205827 r205828 r205862 r205872 r205937 r206568 MFC of r208825 r208826 r208827 r208828 r208829 r208943 r205821: Long awaited update to the calendar system: - Repeating events which span multiple years (because of -A, -B or just the three days before the end of the year). - Support for lunar events (full moon, new moon) and solar events (equinox and solstice, chinese new year). Because of this, the options -U (UTC offset) and -l (longitude) are available to compensate if reality doesn't match the calculated values. r205828: Use local names for calendar.dutch r205862: Fix DST thingies in calendar.australia r205872: Make licenses 3 clause instead of 4 clause r205937: Make the dates in the Tasmanian part of calendar.australia properly variable. r206568: Typo in Allerheiligen in calendar.dutch r208825, r208826, r208827, r208828, r208829, r208943: Coverity Prevent related fixes. Added: stable/8/usr.bin/calendar/dates.c (contents, props changed) stable/8/usr.bin/calendar/events.c (contents, props changed) stable/8/usr.bin/calendar/locale.c (contents, props changed) stable/8/usr.bin/calendar/parsedata.c (contents, props changed) stable/8/usr.bin/calendar/pom.c (contents, props changed) stable/8/usr.bin/calendar/sunpos.c (contents, props changed) Added: stable/8/usr.bin/calendar/dates.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/usr.bin/calendar/dates.c Tue Aug 24 07:59:39 2010 (r211734) @@ -0,0 +1,452 @@ +/*- + * Copyright (c) 1992-2009 Edwin Groothuis . + * 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. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include "calendar.h" + +struct cal_year { + int year; /* 19xx, 20xx, 21xx */ + int easter; /* Julian day */ + int paskha; /* Julian day */ + int cny; /* Julian day */ + int firstdayofweek; /* 0 .. 6 */ + struct cal_month *months; + struct cal_year *nextyear; +} cal_year; + +struct cal_month { + int month; /* 01 .. 12 */ + int firstdayjulian; /* 000 .. 366 */ + int firstdayofweek; /* 0 .. 6 */ + struct cal_year *year; /* points back */ + struct cal_day *days; + struct cal_month *nextmonth; +} cal_month; + +struct cal_day { + int dayofmonth; /* 01 .. 31 */ + int julianday; /* 000 .. 366 */ + int dayofweek; /* 0 .. 6 */ + struct cal_day *nextday; + struct cal_month *month; /* points back */ + struct cal_year *year; /* points back */ + struct event *events; +} cal_day; + +int debug_remember = 0; +struct cal_year *hyear = NULL; + +/* 1-based month, 0-based days, cumulative */ +int *cumdays; +int cumdaytab[][14] = { + {0, -1, 30, 58, 89, 119, 150, 180, 211, 242, 272, 303, 333, 364}, + {0, -1, 30, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}, +}; +/* 1-based month, individual */ +int *mondays; +int mondaytab[][14] = { + {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 30}, + {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 30}, +}; + +static struct cal_day * find_day(int yy, int mm, int dd); + +static void +createdate(int y, int m, int d) +{ + struct cal_year *py, *pyp; + struct cal_month *pm, *pmp; + struct cal_day *pd, *pdp; + int *cumday; + + pyp = NULL; + py = hyear; + while (py != NULL) { + if (py->year == y + 1900) + break; + pyp = py; + py = py->nextyear; + } + + if (py == NULL) { + struct tm td; + time_t t; + py = (struct cal_year *)calloc(1, sizeof(struct cal_year)); + py->year = y + 1900; + py->easter = easter(y); + py->paskha = paskha(y); + + td = tm0; + td.tm_year = y; + td.tm_mday = 1; + t = mktime(&td); + localtime_r(&t, &td); + py->firstdayofweek = td.tm_wday; + + if (pyp != NULL) + pyp->nextyear = py; + } + if (pyp == NULL) { + /* The very very very first one */ + hyear = py; + } + + pmp = NULL; + pm = py->months; + while (pm != NULL) { + if (pm->month == m) + break; + pmp = pm; + pm = pm->nextmonth; + } + + if (pm == NULL) { + pm = (struct cal_month *)calloc(1, sizeof(struct cal_month)); + pm->year = py; + pm->month = m; + cumday = cumdaytab[isleap(y)]; + pm->firstdayjulian = cumday[m] + 2; + pm->firstdayofweek = + (py->firstdayofweek + pm->firstdayjulian -1) % 7; + if (pmp != NULL) + pmp->nextmonth = pm; + } + if (pmp == NULL) + py->months = pm; + + pdp = NULL; + pd = pm->days; + while (pd != NULL) { + pdp = pd; + pd = pd->nextday; + } + + if (pd == NULL) { /* Always true */ + pd = (struct cal_day *)calloc(1, sizeof(struct cal_day)); + pd->month = pm; + pd->year = py; + pd->dayofmonth = d; + pd->julianday = pm->firstdayjulian + d - 1; + pd->dayofweek = (pm->firstdayofweek + d - 1) % 7; + if (pdp != NULL) + pdp->nextday = pd; + } + if (pdp == NULL) + pm->days = pd; +} + +void +generatedates(struct tm *tp1, struct tm *tp2) +{ + int y1, m1, d1; + int y2, m2, d2; + int y, m, d; + + y1 = tp1->tm_year; + m1 = tp1->tm_mon + 1; + d1 = tp1->tm_mday; + y2 = tp2->tm_year; + m2 = tp2->tm_mon + 1; + d2 = tp2->tm_mday; + + if (y1 == y2) { + if (m1 == m2) { + /* Same year, same month. Easy! */ + for (d = d1; d <= d2; d++) + createdate(y1, m1, d); + return; + } + /* + * Same year, different month. + * - Take the leftover days from m1 + * - Take all days from + * - Take the first days from m2 + */ + mondays = mondaytab[isleap(y1)]; + for (d = d1; d <= mondays[m1]; d++) + createdate(y1, m1, d); + for (m = m1 + 1; m < m2; m++) + for (d = 1; d <= mondays[m]; d++) + createdate(y1, m, d); + for (d = 1; d <= d2; d++) + createdate(y1, m2, d); + return; + } + /* + * Different year, different month. + * - Take the leftover days from y1-m1 + * - Take all days from y1- + * - Take all days from y2-[1 .. m2> + * - Take the first days of y2-m2 + */ + mondays = mondaytab[isleap(y1)]; + for (d = d1; d <= mondays[m1]; d++) + createdate(y1, m1, d); + for (m = m1 + 1; m <= 12; m++) + for (d = 1; d <= mondays[m]; d++) + createdate(y1, m, d); + for (y = y1 + 1; y < y2; y++) { + mondays = mondaytab[isleap(y)]; + for (m = 1; m <= 12; m++) + for (d = 1; d <= mondays[m]; d++) + createdate(y, m, d); + } + mondays = mondaytab[isleap(y2)]; + for (m = 1; m < m2; m++) + for (d = 1; d <= mondays[m]; d++) + createdate(y2, m, d); + for (d = 1; d <= d2; d++) + createdate(y2, m2, d); +} + +void +dumpdates(void) +{ + struct cal_year *y; + struct cal_month *m; + struct cal_day *d; + + y = hyear; + while (y != NULL) { + printf("%-5d (wday:%d)\n", y->year, y->firstdayofweek); + m = y->months; + while (m != NULL) { + printf("-- %-5d (julian:%d, dow:%d)\n", m->month, + m->firstdayjulian, m->firstdayofweek); + d = m->days; + while (d != NULL) { + printf(" -- %-5d (julian:%d, dow:%d)\n", + d->dayofmonth, d->julianday, d->dayofweek); + d = d->nextday; + } + m = m->nextmonth; + } + y = y->nextyear; + } +} + +int +remember_ymd(int yy, int mm, int dd) +{ + struct cal_year *y; + struct cal_month *m; + struct cal_day *d; + + if (debug_remember) + printf("remember_ymd: %d - %d - %d\n", yy, mm, dd); + + y = hyear; + while (y != NULL) { + if (y->year != yy) { + y = y->nextyear; + continue; + } + m = y->months; + while (m != NULL) { + if (m->month != mm) { + m = m->nextmonth; + continue; + } + d = m->days; + while (d != NULL) { + if (d->dayofmonth == dd) + return (1); + d = d->nextday; + continue; + } + return (0); + } + return (0); + } + return (0); +} + +int +remember_yd(int yy, int dd, int *rm, int *rd) +{ + struct cal_year *y; + struct cal_month *m; + struct cal_day *d; + + if (debug_remember) + printf("remember_yd: %d - %d\n", yy, dd); + + y = hyear; + while (y != NULL) { + if (y->year != yy) { + y = y->nextyear; + continue; + } + m = y->months; + while (m != NULL) { + d = m->days; + while (d != NULL) { + if (d->julianday == dd) { + *rm = m->month; + *rd = d->dayofmonth; + return (1); + } + d = d->nextday; + } + m = m->nextmonth; + } + return (0); + } + return (0); +} + +int +first_dayofweek_of_year(int yy) +{ + struct cal_year *y; + + y = hyear; + while (y != NULL) { + if (y->year == yy) + return (y->firstdayofweek); + y = y->nextyear; + } + + /* Should not happen */ + return (-1); +} + +int +first_dayofweek_of_month(int yy, int mm) +{ + struct cal_year *y; + struct cal_month *m; + + y = hyear; + while (y != NULL) { + if (y->year != yy) { + y = y->nextyear; + continue; + } + m = y->months; + while (m != NULL) { + if (m->month == mm) + return (m->firstdayofweek); + m = m->nextmonth; + } + /* Should not happen */ + return (-1); + } + + /* Should not happen */ + return (-1); +} + +int +walkthrough_dates(struct event **e) +{ + static struct cal_year *y = NULL; + static struct cal_month *m = NULL; + static struct cal_day *d = NULL; + + if (y == NULL) { + y = hyear; + m = y->months; + d = m->days; + *e = d->events; + return (1); + }; + if (d->nextday != NULL) { + d = d->nextday; + *e = d->events; + return (1); + } + if (m->nextmonth != NULL) { + m = m->nextmonth; + d = m->days; + *e = d->events; + return (1); + } + if (y->nextyear != NULL) { + y = y->nextyear; + m = y->months; + d = m->days; + *e = d->events; + return (1); + } + + return (0); +} + +static struct cal_day * +find_day(int yy, int mm, int dd) +{ + struct cal_year *y; + struct cal_month *m; + struct cal_day *d; + + if (debug_remember) + printf("remember_ymd: %d - %d - %d\n", yy, mm, dd); + + y = hyear; + while (y != NULL) { + if (y->year != yy) { + y = y->nextyear; + continue; + } + m = y->months; + while (m != NULL) { + if (m->month != mm) { + m = m->nextmonth; + continue; + } + d = m->days; + while (d != NULL) { + if (d->dayofmonth == dd) + return (d); + d = d->nextday; + continue; + } + return (NULL); + } + return (NULL); + } + return (NULL); +} + +void +addtodate(struct event *e, int year, int month, int day) +{ + struct cal_day *d; + + d = find_day(year, month, day); + e->next = d->events; + d->events = e; +} Added: stable/8/usr.bin/calendar/events.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/usr.bin/calendar/events.c Tue Aug 24 07:59:39 2010 (r211734) @@ -0,0 +1,126 @@ +/*- + * Copyright (c) 1992-2009 Edwin Groothuis . + * 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. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include "pathnames.h" +#include "calendar.h" + +struct event * +event_add(int year, int month, int day, char *date, int var, char *txt, + char *extra) +{ + struct event *e; + + /* + * Creating a new event: + * - Create a new event + * - Copy the machine readable day and month + * - Copy the human readable and language specific date + * - Copy the text of the event + */ + e = (struct event *)calloc(1, sizeof(struct event)); + if (e == NULL) + errx(1, "event_add: cannot allocate memory"); + e->month = month; + e->day = day; + e->var = var; + e->date = strdup(date); + if (e->date == NULL) + errx(1, "event_add: cannot allocate memory"); + e->text = strdup(txt); + if (e->text == NULL) + errx(1, "event_add: cannot allocate memory"); + e->extra = NULL; + if (extra != NULL && extra[0] != '\0') + e->extra = strdup(extra); + addtodate(e, year, month, day); + return (e); +} + +void +event_continue(struct event *e, char *txt) +{ + char *text; + + /* + * Adding text to the event: + * - Save a copy of the old text (unknown length, so strdup()) + * - Allocate enough space for old text + \n + new text + 0 + * - Store the old text + \n + new text + * - Destroy the saved copy. + */ + text = strdup(e->text); + if (text == NULL) + errx(1, "event_continue: cannot allocate memory"); + + free(e->text); + e->text = (char *)malloc(strlen(text) + strlen(txt) + 3); + if (e->text == NULL) + errx(1, "event_continue: cannot allocate memory"); + strcpy(e->text, text); + strcat(e->text, "\n"); + strcat(e->text, txt); + free(text); + + return; +} + +void +event_print_all(FILE *fp) +{ + struct event *e; + + while (walkthrough_dates(&e) != 0) { +#ifdef DEBUG + fprintf(stderr, "event_print_allmonth: %d, day: %d\n", + month, day); +#endif + + /* + * Go through all events and print the text of the matching + * dates + */ + while (e != NULL) { + (void)fprintf(fp, "%s%c%s%s%s%s\n", e->date, + e->var ? '*' : ' ', e->text, + e->extra != NULL ? " (" : "", + e->extra != NULL ? e->extra : "", + e->extra != NULL ? ")" : "" + ); + + e = e->next; + } + } +} Added: stable/8/usr.bin/calendar/locale.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/usr.bin/calendar/locale.c Tue Aug 24 07:59:39 2010 (r211734) @@ -0,0 +1,166 @@ +/*- + * Copyright (c) 1989, 1993, 1994 + * The Regents of the University of California. 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. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include "calendar.h" + +const char *fdays[] = { + "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", + "Saturday", NULL, +}; + +const char *days[] = { + "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", NULL, +}; + +const char *fmonths[] = { + "January", "February", "March", "April", "May", "June", "Juli", + "August", "September", "October", "November", "December", NULL, +}; + +const char *months[] = { + "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", NULL, +}; + +const char *sequences[] = { + "First", "Second", "Third", "Fourth", "Fifth", "Last" +}; + +struct fixs fndays[8]; /* full national days names */ +struct fixs ndays[8]; /* short national days names */ +struct fixs fnmonths[13]; /* full national months names */ +struct fixs nmonths[13]; /* short national month names */ +struct fixs nsequences[10]; /* national sequence names */ + + +void +setnnames(void) +{ + char buf[80]; + int i, l; + struct tm tm; + + memset(&tm, 0, sizeof(struct tm)); + for (i = 0; i < 7; i++) { + tm.tm_wday = i; + strftime(buf, sizeof(buf), "%a", &tm); + for (l = strlen(buf); + l > 0 && isspace((unsigned char)buf[l - 1]); + l--) + ; + buf[l] = '\0'; + if (ndays[i].name != NULL) + free(ndays[i].name); + if ((ndays[i].name = strdup(buf)) == NULL) + errx(1, "cannot allocate memory"); + ndays[i].len = strlen(buf); + + strftime(buf, sizeof(buf), "%A", &tm); + for (l = strlen(buf); + l > 0 && isspace((unsigned char)buf[l - 1]); + l--) + ; + buf[l] = '\0'; + if (fndays[i].name != NULL) + free(fndays[i].name); + if ((fndays[i].name = strdup(buf)) == NULL) + errx(1, "cannot allocate memory"); + fndays[i].len = strlen(buf); + } + + memset(&tm, 0, sizeof(struct tm)); + for (i = 0; i < 12; i++) { + tm.tm_mon = i; + strftime(buf, sizeof(buf), "%b", &tm); + for (l = strlen(buf); + l > 0 && isspace((unsigned char)buf[l - 1]); + l--) + ; + buf[l] = '\0'; + if (nmonths[i].name != NULL) + free(nmonths[i].name); + if ((nmonths[i].name = strdup(buf)) == NULL) + errx(1, "cannot allocate memory"); + nmonths[i].len = strlen(buf); + + strftime(buf, sizeof(buf), "%B", &tm); + for (l = strlen(buf); + l > 0 && isspace((unsigned char)buf[l - 1]); + l--) + ; + buf[l] = '\0'; + if (fnmonths[i].name != NULL) + free(fnmonths[i].name); + if ((fnmonths[i].name = strdup(buf)) == NULL) + errx(1, "cannot allocate memory"); + fnmonths[i].len = strlen(buf); + } +} + +void +setnsequences(char *seq) +{ + int i; + char *p; + + p = seq; + for (i = 0; i < 5; i++) { + nsequences[i].name = p; + if ((p = strchr(p, ' ')) == NULL) { + /* Oh oh there is something wrong. Erase! Erase! */ + for (i = 0; i < 5; i++) { + nsequences[i].name = NULL; + nsequences[i].len = 0; + } + return; + } + *p = '\0'; + p++; + } + nsequences[i].name = p; + + for (i = 0; i < 5; i++) { + nsequences[i].name = strdup(nsequences[i].name); + nsequences[i].len = nsequences[i + 1].name - nsequences[i].name; + } + nsequences[i].name = strdup(nsequences[i].name); + nsequences[i].len = strlen(nsequences[i].name); + + return; +} Added: stable/8/usr.bin/calendar/parsedata.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/usr.bin/calendar/parsedata.c Tue Aug 24 07:59:39 2010 (r211734) @@ -0,0 +1,1009 @@ +/*- + * Copyright (c) 1992-2009 Edwin Groothuis . + * 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. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include "calendar.h" + +static char *showflags(int flags); +static int isonlydigits(char *s, int nostar); +static const char *getmonthname(int i); +static int checkmonth(char *s, size_t *len, size_t *offset, const char **month); +static const char *getdayofweekname(int i); +static int checkdayofweek(char *s, size_t *len, size_t *offset, const char **dow); +static int indextooffset(char *s); +static int parseoffset(char *s); +static char *floattoday(int year, double f); +static char *floattotime(double f); + +/* + * Expected styles: + * + * Date ::= Month . ' ' . DayOfMonth | + * Month . ' ' . DayOfWeek . ModifierIndex | + * Month . '/' . DayOfMonth | + * Month . '/' . DayOfWeek . ModifierIndex | + * DayOfMonth . ' ' . Month | + * DayOfMonth . '/' . Month | + * DayOfWeek . ModifierIndex . ' ' .Month | + * DayOfWeek . ModifierIndex . '/' .Month | + * DayOfWeek . ModifierIndex | + * SpecialDay . ModifierOffset + * + * Month ::= MonthName | MonthNumber | '*' + * MonthNumber ::= '0' ... '9' | '00' ... '09' | '10' ... '12' + * MonthName ::= MonthNameShort | MonthNameLong + * MonthNameLong ::= 'January' ... 'December' + * MonthNameShort ::= 'Jan' ... 'Dec' | 'Jan.' ... 'Dec.' + * + * DayOfWeek ::= DayOfWeekShort | DayOfWeekLong + * DayOfWeekShort ::= 'Mon' .. 'Sun' + * DayOfWeekLong ::= 'Monday' .. 'Sunday' + * DayOfMonth ::= '0' ... '9' | '00' ... '09' | '10' ... '29' | + * '30' ... '31' | '*' + * + * ModifierOffset ::= '' | '+' . ModifierNumber | '-' . ModifierNumber + * ModifierNumber ::= '0' ... '9' | '00' ... '99' | '000' ... '299' | + * '300' ... '359' | '360' ... '365' + * ModifierIndex ::= 'Second' | 'Third' | 'Fourth' | 'Fifth' | + * 'First' | 'Last' + * + * SpecialDay ::= 'Easter' | 'Pashka' | 'ChineseNewYear' + * + */ +static int +determinestyle(char *date, int *flags, + char *month, int *imonth, char *dayofmonth, int *idayofmonth, + char *dayofweek, int *idayofweek, char *modifieroffset, + char *modifierindex, char *specialday) +{ + char *p, *p1, *p2; + const char *dow, *pmonth; + char pold; + size_t len, offset; + + *flags = F_NONE; + *month = '\0'; + *imonth = 0; + *dayofmonth = '\0'; + *idayofmonth = 0; + *dayofweek = '\0'; + *idayofweek = 0; + *modifieroffset = '\0'; + *modifierindex = '\0'; + *specialday = '\0'; + +#define CHECKSPECIAL(s1, s2, lens2, type) \ + if (s2 != NULL && strncmp(s1, s2, lens2) == 0) { \ + *flags |= F_SPECIALDAY; \ + *flags |= type; \ + *flags |= F_VARIABLE; \ + if (strlen(s1) == lens2) { \ + strcpy(specialday, s1); \ + return (1); \ + } \ + strncpy(specialday, s1, lens2); \ + specialday[lens2] = '\0'; \ + strcpy(modifieroffset, s1 + lens2); \ + *flags |= F_MODIFIEROFFSET; \ + return (1); \ + } + + if ((p = strchr(date, ' ')) == NULL) { + if ((p = strchr(date, '/')) == NULL) { + CHECKSPECIAL(date, STRING_CNY, strlen(STRING_CNY), + F_CNY); + CHECKSPECIAL(date, ncny.name, ncny.len, F_CNY); + CHECKSPECIAL(date, STRING_NEWMOON, + strlen(STRING_NEWMOON), F_NEWMOON); + CHECKSPECIAL(date, nnewmoon.name, nnewmoon.len, + F_NEWMOON); + CHECKSPECIAL(date, STRING_FULLMOON, + strlen(STRING_FULLMOON), F_FULLMOON); + CHECKSPECIAL(date, nfullmoon.name, nfullmoon.len, + F_FULLMOON); + CHECKSPECIAL(date, STRING_PASKHA, + strlen(STRING_PASKHA), F_PASKHA); + CHECKSPECIAL(date, npaskha.name, npaskha.len, F_PASKHA); + CHECKSPECIAL(date, STRING_EASTER, + strlen(STRING_EASTER), F_EASTER); + CHECKSPECIAL(date, neaster.name, neaster.len, F_EASTER); + CHECKSPECIAL(date, STRING_MAREQUINOX, + strlen(STRING_MAREQUINOX), F_MAREQUINOX); + CHECKSPECIAL(date, nmarequinox.name, nmarequinox.len, + F_SEPEQUINOX); + CHECKSPECIAL(date, STRING_SEPEQUINOX, + strlen(STRING_SEPEQUINOX), F_SEPEQUINOX); + CHECKSPECIAL(date, nsepequinox.name, nsepequinox.len, + F_SEPEQUINOX); + CHECKSPECIAL(date, STRING_JUNSOLSTICE, + strlen(STRING_JUNSOLSTICE), F_JUNSOLSTICE); + CHECKSPECIAL(date, njunsolstice.name, njunsolstice.len, + F_JUNSOLSTICE); + CHECKSPECIAL(date, STRING_DECSOLSTICE, + strlen(STRING_DECSOLSTICE), F_DECSOLSTICE); + CHECKSPECIAL(date, ndecsolstice.name, ndecsolstice.len, + F_DECSOLSTICE); + if (checkdayofweek(date, &len, &offset, &dow) != 0) { + *flags |= F_DAYOFWEEK; + *flags |= F_VARIABLE; + *idayofweek = offset; + if (strlen(date) == len) { + strcpy(dayofweek, date); + return (1); + } + strncpy(dayofweek, date, len); + dayofweek[len] = '\0'; + strcpy(modifierindex, date + len); + *flags |= F_MODIFIERINDEX; + return (1); + } + if (isonlydigits(date, 1)) { + /* Assume month number only */ + *flags |= F_MONTH; + *imonth = (int)strtol(date, (char **)NULL, 10); + strcpy(month, getmonthname(*imonth)); + return(1); + } + return (0); + } + } + + /* + * AFTER this, leave by goto-ing to "allfine" or "fail" to restore the + * original data in `date'. + */ + pold = *p; + *p = 0; + p1 = date; + p2 = p + 1; + /* Now p2 points to the next field and p1 to the first field */ + + /* Check if there is a month-string in the date */ + if ((checkmonth(p1, &len, &offset, &pmonth) != 0) + || (checkmonth(p2, &len, &offset, &pmonth) != 0 && (p2 = p1))) { + /* p2 is the non-month part */ + *flags |= F_MONTH; + *imonth = offset; + + strcpy(month, getmonthname(offset)); + if (isonlydigits(p2, 1)) { + strcpy(dayofmonth, p2); + *idayofmonth = (int)strtol(p2, (char **)NULL, 10); + *flags |= F_DAYOFMONTH; + goto allfine; + } + if (strcmp(p2, "*") == 0) { + *flags |= F_ALLDAY; + goto allfine; + } + + if (checkdayofweek(p2, &len, &offset, &dow) != 0) { + *flags |= F_DAYOFWEEK; + *flags |= F_VARIABLE; + *idayofweek = offset; + strcpy(dayofweek, getdayofweekname(offset)); + if (strlen(p2) == len) + goto allfine; + strcpy(modifierindex, p2 + len); + *flags |= F_MODIFIERINDEX; + goto allfine; + } + + goto fail; + } + + /* Check if there is an every-day or every-month in the string */ + if ((strcmp(p1, "*") == 0 && isonlydigits(p2, 1)) + || (strcmp(p2, "*") == 0 && isonlydigits(p1, 1) && (p2 = p1))) { + int d; + + *flags |= F_ALLMONTH; + *flags |= F_DAYOFMONTH; + d = (int)strtol(p2, (char **)NULL, 10); + *idayofmonth = d; + sprintf(dayofmonth, "%d", d); + goto allfine; + } + + /* Month as a number, then a weekday */ + if (isonlydigits(p1, 1) + && checkdayofweek(p2, &len, &offset, &dow) != 0) { + int d; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 08:09:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5CD710656A5; Tue, 24 Aug 2010 08:09:30 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 958748FC38; Tue, 24 Aug 2010 08:09:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7O89U7k067761; Tue, 24 Aug 2010 08:09:30 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7O89UkT067759; Tue, 24 Aug 2010 08:09:30 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201008240809.o7O89UkT067759@svn.freebsd.org> From: David Xu Date: Tue, 24 Aug 2010 08:09:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211735 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 08:09:30 -0000 Author: davidxu Date: Tue Aug 24 08:09:30 2010 New Revision: 211735 URL: http://svn.freebsd.org/changeset/base/211735 Log: Bump __FreeBSD_version for revision 211732. Noticed by: thompa Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Aug 24 07:59:39 2010 (r211734) +++ head/sys/sys/param.h Tue Aug 24 08:09:30 2010 (r211735) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900017 /* Master, propagated to newvers */ +#define __FreeBSD_version 900018 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 09:05:01 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D70A1065698; Tue, 24 Aug 2010 09:05:01 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id DAA278FC1F; Tue, 24 Aug 2010 09:05:00 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 67A8F1FFC33; Tue, 24 Aug 2010 09:04:59 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 38CA284557; Tue, 24 Aug 2010 11:04:59 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Bruce Evans References: <201008141434.o7EEYaSA030301@svn.freebsd.org> <20100815205724.00007e0f@unknown> <86wrrraqk8.fsf@ds4.des.no> <4C7194E6.6080708@andric.com> <86y6bxybxc.fsf@ds4.des.no> <20100824100917.C22315@delplex.bde.org> Date: Tue, 24 Aug 2010 11:04:58 +0200 In-Reply-To: <20100824100917.C22315@delplex.bde.org> (Bruce Evans's message of "Tue, 24 Aug 2010 10:12:34 +1000 (EST)") Message-ID: <86tymkpeit.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: Bruce Cran , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Bruce Evans , svn-src-head@FreeBSD.org, Dimitry Andric Subject: Re: svn commit: r211304 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 09:05:01 -0000 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Bruce Evans writes: > Dag-Erling Sm=C3=B8rgrav writes: > > That's awesome! Any way I can convince you to fix expand_number() as > > well? I got a detailed explanation of what's wrong with it (both before > > and after my commits) from bde@ (cc:ed) in private correspondence; I can > > forward it to you if he doesn't mind. > OK. > > I think the final point was that it should go back to supporting signed > numbers (only), and that means int64_t ones until scientificize^dehumaniz= e^W > humanize_number() is fixed to support intmax_t ones. See attachments. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no --=-=-= Content-Type: message/rfc822 Date: Fri, 20 Aug 2010 06:51:47 +1000 (EST) From: Bruce Evans To: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: Re: svn commit: r211304 - head/lib/libutil Message-ID: <20100820043717.O18794@delplex.bde.org> References: <201008141434.o7EEYaSA030301@svn.freebsd.org> <20100815213757.M14856@delplex.bde.org> <20100815235422.K14924@delplex.bde.org> <20100819034102.F17926@delplex.bde.org> <8639uadf7s.fsf@ds4.des.no> MIME-Version: 1.0 >> The following places were even more broken to begin with: >> geom/core/geom.c: this calls expand_number() on an intmax_t * >> ipfw/dummynet.c: this calls expand_number() on an int64_t *, after starting >> with a uint64_t * and bogusly casting to int64_t *. > > I'll fix these two, do you have further suggestions or a list of other > instances that need fixing? > > BTW, would you prefer fixing geom.c to use uint64_t, or fixing > expand_number() to use uintmax_t? I prefer fixing expand_number() to support negative numbers again. It should support them since it is supposed to be the inverse of scientificize^Whumanize_number(), which can and does print them in a useful way for at least free space in df. I don't know of any use for them in input, but it simplifies at least the documentation to have an exact inverse. However, it should probably still return negative numbers via a uintmax_t, like strtoumax() does, so that yet another BAD API isn't required. Externally, this requires documenting what expand_number() actually does, since it uses strtoumax() internally but currently says nothing except for the false statement that it is the inverse of scientifize_number(), plus it requires something to determine whether the number is signed. Internally, this requires a bit more care with shifting of negative numbers. A negative number is by definition one with a leading minus sign. strtoumax() will return these converted to large positive numbers, and currently any shift of them will give overflow. Instead, they should be converted to a sign and a positive value before shifting. Pseudocode: num = strtoumax(); Return if error. shift = mumble(); /* mult = mumble() (recursive) for dd */ Return if error. Return if shift == 1 (this gives strtou*()'s/our historical arcane error handling for negative values, but only for non-shifted ones). snum = strtoimax(); Return if error (must be range error with snum < 0). signed = (snum < 0); if (signed) num = -(uintmax_t)snum; /* XXX assumes normal machine */ cutlim = (signed ? INTMAX_MAX / ((intmax_t)1 << shift) : UINTMAX_MAX / ((uintmax_t)1 << shift); if (num > cutlim) overflow(); else num <<= shift; if (signed) num = -(intmax_t)num; My dd get_off_t() gets this wrong, oops. Just using the unsigned version fails for things like "-1k". The -1 becomes UINTMAX_MAX and any shifing of this overflows (or if overflow is ignored, gives back -1 on normal machines). -1k isn't useful in dd -- all that is needed is for things like 0xFFFFFFFFFFFFFFFF (2**64-1) to work, which they don't if strtoimax() is used -- with 64-bit intmax_t, it clips this value to 0x7FFFFFFFFFFFFFFF/ ERANGE. Here is part of the man page for strtoumax() that gives details relevant to expand_number(): % STRTOUL(3) FreeBSD Library Functions Manual STRTOUL(3) Bug: there should be a separate man page for each function. % % NAME % strtoul, strtoull, strtoumax, strtouq -- convert a string to an unsigned % long, unsigned long long, uintmax_t, or u_quad_t integer % % LIBRARY % Standard C Library (libc, -lc) % % SYNOPSIS % #include % #include Bug: limits.h is not needed for using strtoul() or strtoull(). % % unsigned long % strtoul(const char * restrict nptr, char ** restrict endptr, int base); % % unsigned long long % strtoull(const char * restrict nptr, char ** restrict endptr, int base); % % #include Bug: not consistently buggy with the above -- no limits.h here. % % uintmax_t % strtoumax(const char * restrict nptr, char ** restrict endptr, int base); % % #include % #include % #include % % u_quad_t % strtouq(const char *nptr, char **endptr, int base); Bugs: 1. sys/types.h is needed in theory but not in practice, since someone changed the actual declaration of this in stdlib.h to use uint64_t. 2. stdlib.h says that this and strtoq() are to be removed in FreeBSD-6.0,. % % DESCRIPTION % The strtoul() function converts the string in nptr to an unsigned long % value. The strtoull() function converts the string in nptr to an % unsigned long long value. The strtoumax() function converts the string % in nptr to an uintmax_t value. The strtouq() function converts the % string in nptr to a u_quad_t value. The conversion is done according to % the given base, which must be between 2 and 36 inclusive, or be the spe- % cial value 0. % % The string may begin with an arbitrary amount of white space (as deter- % mined by isspace(3)) followed by a single optional `+' or `-' sign. If % base is zero or 16, the string may then include a ``0x'' prefix, and the % number will be read in base 16; otherwise, a zero base is taken as 10 % (decimal) unless the next character is `0', in which case it is taken as % 8 (octal). The detail about the base (0) and its prefixes, and the sign, are missing in expand_number.3. % % The remainder of the string is converted to an unsigned long value in the % obvious manner, stopping at the end of the string or at the first charac- % ter that does not produce a valid digit in the given base. More details missing. % (In bases % above 10, the letter `A' in either upper or lower case represents 10, `B' % represents 11, and so forth, with `Z' representing 35.) % % If endptr is not NULL, strtoul() stores the address of the first invalid Bug: this applies to all the functions, not just strtoul(), so all of them or better none of them should be explicitly mentioned here. % character in *endptr. If there were no digits at all, however, strtoul() % stores the original value of nptr in *endptr. (Thus, if *nptr is not % `\0' but **endptr is `\0' on return, the entire string was valid.) Other details not relevant, but expand_number is missing the detail on the error handling for trailing garbage. % % RETURN VALUES % The strtoul(), strtoull(), strtoumax() and strtouq() functions return % either the result of the conversion or, if there was a leading minus % sign, the negation of the result of the conversion, unless the original % (non-negated) value would overflow; in the latter case, strtoul() returns % ULONG_MAX, strtoull() returns ULLONG_MAX, strtoumax() returns % UINTMAX_MAX, and strtouq() returns ULLONG_MAX. In all cases, errno is Here are the details for negative values and how strtou*() handle them Bugs in expand_number.3, ones not already mentioned and a couple mentioned again. % EXPAND_NUMBER(3) FreeBSD Library Functions Manual EXPAND_NUMBER(3) % % NAME % expand_number -- format a number from human readable form Its bogus name is less than reflected in its bogus descrption. "format a number from human readable form" is exactly the same description as is given to scientificize_number(), where its only incorrectness is that it misspells "scientificize" as "humanize". But this is supposed to be the inverse function. % DESCRIPTION % The expand_number() function unformats the buf string and stores a % unsigned 64-bit quantity at address pointed out by the num argument. % % The expand_number() function follows the SI power of two convention. % % The prefixes are: Neither SI nor this function take prefixes. They take suffixes. % % Prefix Description Multiplier Another bogus "prefix". The bogus [bB] suffix is not mentioned here. Hmm, B would make sense as a suffix to these suffixes (thus KB could be an alias for K, but AFAIR scientificize number never produces either plain B or KB, and the parser only recognizes a single-letter suffix). % k kilo 1024 scientificize_number() only produces the K suffix, at least in df output. % ERRORS % The expand_number() function will fail if: % % [EINVAL] The given string contains no digits. Not quite right. "foo1" contains a digit, but should give EINVAL. % % [EINVAL] An unrecognized prefix was given. Another bogus "prefix". Only the undocumented octal and hex prefixes are supported, but this "prefix" means "suffix" as usual. To give an exact inverse of scientificize_number(), the API also needs to be bug for bug compatible (int64_t not uintmax_t), with no support for octal or hex (not too bad). Gak, prefixes (sic) are much more broken than I said above. They are also named prefixes in scientificize_number() sources, and there are several variations, most of which are not supported by the "inverse" function: % int % humanize_number(char *buf, size_t len, int64_t bytes, % const char *suffix, int scale, int flags) % { % const char *prefixes, *sep; The usual confusion. % int b, i, r, maxscale, s1, s2, sign; % int64_t divisor, max; % size_t baselen; Various style bugs. % % assert(buf != NULL); % assert(suffix != NULL); % assert(scale >= 0); % % if (flags & HN_DIVISOR_1000) { % /* SI for decimal multiplies */ mulipliers % divisor = 1000; % if (flags & HN_B) % prefixes = "B\0k\0M\0G\0T\0P\0E"; % else % prefixes = "\0\0k\0M\0G\0T\0P\0E"; Classic SI prefixes, in which k means 1000 (is B really an SI prefix?). expand_number() has no support for these. % } else { % /* % * binary multiplies % * XXX IEC 60027-2 recommends Ki, Mi, Gi... Blech. % */ % divisor = 1024; % if (flags & HN_B) % prefixes = "B\0K\0M\0G\0T\0P\0E"; % else % prefixes = "\0\0K\0M\0G\0T\0P\0E"; K seems to be the only letter that is non-ambiguous here. % } % % #define SCALE2PREFIX(scale) (&prefixes[(scale) << 1]) scientificize_number.3 duplicates some of the confusion: % DESCRIPTION % The humanize_number() function formats the signed 64-bit quantity given % in number into buffer. A space and then suffix is appended to the end. % The buffer pointed to by buffer must be at least len bytes long. % % If the formatted number (including suffix) would be too long to fit into % buffer, then divide number by 1024 until it will. In this case, prefix % suffix with the appropriate SI designator. The humanize_number() func- % tion follows the traditional computer science conventions rather than the ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ % proposed SI power of two convention. This paragaph hasn't caught up with the extension HN_DIVISOR_1000. % % The prefixes are: The usual confusion. % % Prefix Description Multiplier Multiplier 1000x % k kilo 1024 1000 % M mega 1048576 1000000 % G giga 1073741824 1000000000 % T tera 1099511627776 1000000000000 % P peta 1125899906842624 1000000000000000 % E exa 1152921504606846976 1000000000000000000 The "Multiplier 1000x" column covers the extension. Even a scientist wouldn't write numbers as 1152921504606846976 or 1000000000000000000. They would use exponential notation. % % The len argument must be at least 4 plus the length of suffix, in order % to ensure a useful result is generated into buffer. To use a specific % prefix, specify this as scale (multiplier = 1024 ^ scale). This cannot Not with HN_DIVISOR_1000. % HN_B Use `B' (bytes) as prefix if the original result % does not have a prefix. Now I see some B's (for 0B) in df output. Conclusions: - although I want a general number parser, expand_number() cannot be it since it needs to be the inverse of scientificize_number() which has too many warts to be inverted by a general number parser (short of one with billions of options). - negative numbers are useful after all, and many things become simpler by restricting to them at all levels. We lose the abilitity to "expand" UINTMAX_MAX, but scientificize() number never had that anyway. Bruce --=-=-= Content-Type: message/rfc822 Date: Sat, 21 Aug 2010 07:06:51 +1000 (EST) From: Bruce Evans To: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: Re: svn commit: r211304 - head/lib/libutil Message-ID: <20100821065444.B1255@besplex.bde.org> References: <201008141434.o7EEYaSA030301@svn.freebsd.org> <20100815213757.M14856@delplex.bde.org> <20100815235422.K14924@delplex.bde.org> <20100819034102.F17926@delplex.bde.org> <8639uadf7s.fsf@ds4.des.no> <20100820043717.O18794@delplex.bde.org> <86occxws1b.fsf@ds4.des.no> MIME-Version: 1.0 >> I prefer fixing expand_number() to support negative numbers again. > > "again"? It never did, AFAIK. %%% #include #include #include #include static void test(const char *s) { int64_t num; num = 0xdead; if (expand_number(s, &num) != 0) printf("%s -> error\n", s); else printf("%s -> %jd\n", s, (intmax_t)num); } int main(void) { test("-1"); test("-1k"); test("-1M"); test("-1G"); test("-1T"); test("-1P"); test("-1E"); return (0); } %%% Output when linked against the old libutil (-r--r--r-- 1 root wheel 123042 Jun 10 09:02 /usr/lib/libutil.a): %%% -1 -> -1 -1k -> -1024 -1M -> -1048576 -1G -> -1073741824 -1T -> -1099511627776 -1P -> -1125899906842624 -1E -> -1152921504606846976 %%% Output when compiled with current sources: [First, the breakage of libutil.h had to be fixed. The above no longer compiles since libutil.h was careful to only declare the types that it uses; it declares int64_t since it used that, and it doesn't declare uint64_t since it didn't use that and its typedefs haven't been updated. My first attempt to fix this broke it by changing the int64_t to uint64_t. This left int64_t undeclared, but it is still used by humanize_number().] %%% -1 -> -1 -1k -> error -1M -> error -1G -> error -1T -> error -1P -> error -1E -> error %%% Bruce --=-=-=-- From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 09:30:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B8361065697; Tue, 24 Aug 2010 09:30:03 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id E71528FC14; Tue, 24 Aug 2010 09:30:02 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id D9C751FFC33; Tue, 24 Aug 2010 09:30:01 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id AA2AC845D1; Tue, 24 Aug 2010 11:30:01 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Edwin Groothuis References: <201008232209.o7NM9Q5l055003@svn.freebsd.org> <4C736D4F.6080003@andric.com> <20100824075117.GE2361@mavetju.org> Date: Tue, 24 Aug 2010 11:30:01 +0200 In-Reply-To: <20100824075117.GE2361@mavetju.org> (Edwin Groothuis's message of "Tue, 24 Aug 2010 17:51:17 +1000") Message-ID: <86iq30pdd2.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, Dimitry Andric , src-committers@freebsd.org, svn-src-stable-8@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r211723 - in stable/8/usr.bin/calendar: . calendars calendars/ru_RU.KOI8-R X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 09:30:03 -0000 Edwin Groothuis writes: > Dimitry Andric writes: >> I think you forgot to add usr.bin/calendar/locale.c here? > I'm confused, shouldn't they be added automatically because of the > "svn merge"? It should, but this is a common mistake. What usually happens is that you do an svn merge, then figure out you did it wrong, revert it, and re-run it; but the new files are still there from the first attempt, so the second attempt will not overwrite them or record them as added. Everything looks and builds fine in your working copy, but the new files won't be committed. ISTR I actually wrote about this in the Subversion primer on the wiki. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 09:57:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 170AD10656AB; Tue, 24 Aug 2010 09:57:07 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05EFA8FC27; Tue, 24 Aug 2010 09:57:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7O9v6GU070050; Tue, 24 Aug 2010 09:57:06 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7O9v6BE070046; Tue, 24 Aug 2010 09:57:06 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201008240957.o7O9v6BE070046@svn.freebsd.org> From: David Xu Date: Tue, 24 Aug 2010 09:57:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211737 - in head/lib/libthr: . thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 09:57:07 -0000 Author: davidxu Date: Tue Aug 24 09:57:06 2010 New Revision: 211737 URL: http://svn.freebsd.org/changeset/base/211737 Log: Add wrapper for setcontext() and swapcontext(), the wrappers unblock SIGCANCEL which is needed by thread cancellation. Modified: head/lib/libthr/pthread.map head/lib/libthr/thread/thr_private.h head/lib/libthr/thread/thr_sig.c Modified: head/lib/libthr/pthread.map ============================================================================== --- head/lib/libthr/pthread.map Tue Aug 24 08:11:11 2010 (r211736) +++ head/lib/libthr/pthread.map Tue Aug 24 09:57:06 2010 (r211737) @@ -342,6 +342,7 @@ FBSDprivate_1.0 { _pthread_timedjoin_np; _pthread_yield; _raise; + _setcontext; _sigaction; _sigprocmask; _sigsuspend; @@ -351,6 +352,7 @@ FBSDprivate_1.0 { _spinlock; _spinlock_debug; _spinunlock; + _swapcontext; /* Debugger needs these. */ _libthr_debug; @@ -397,4 +399,6 @@ FBSD_1.1 { FBSD_1.2 { openat; + setcontext; + swapcontext; }; Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Tue Aug 24 08:11:11 2010 (r211736) +++ head/lib/libthr/thread/thr_private.h Tue Aug 24 09:57:06 2010 (r211737) @@ -709,6 +709,12 @@ int __sys_sigwaitinfo(const sigset_t *se int __sys_nanosleep(const struct timespec *, struct timespec *); #endif +/* #include */ +#ifdef _SYS_UCONTEXT_H_ +int __sys_setcontext(const ucontext_t *ucp); +int __sys_swapcontext(ucontext_t *oucp, const ucontext_t *ucp); +#endif + /* #include */ #ifdef _UNISTD_H_ int __sys_close(int); Modified: head/lib/libthr/thread/thr_sig.c ============================================================================== --- head/lib/libthr/thread/thr_sig.c Tue Aug 24 08:11:11 2010 (r211736) +++ head/lib/libthr/thread/thr_sig.c Tue Aug 24 09:57:06 2010 (r211737) @@ -59,7 +59,29 @@ int _sigwaitinfo(const sigset_t *set, si int __sigwait(const sigset_t *set, int *sig); int _sigwait(const sigset_t *set, int *sig); int __sigsuspend(const sigset_t *sigmask); +int _setcontext(const ucontext_t *); +int _swapcontext(ucontext_t *, const ucontext_t *); +static void +remove_thr_signals(sigset_t *set) +{ + if (SIGISMEMBER(*set, SIGCANCEL)) + SIGDELSET(*set, SIGCANCEL); +} + +static const sigset_t * +thr_remove_thr_signals(const sigset_t *set, sigset_t *newset) +{ + const sigset_t *pset; + + if (SIGISMEMBER(*set, SIGCANCEL)) { + *newset = *set; + SIGDELSET(*newset, SIGCANCEL); + pset = newset; + } else + pset = set; + return (pset); +} static void sigcancel_handler(int sig __unused, @@ -268,20 +290,6 @@ _pthread_sigmask(int how, const sigset_t __weak_reference(__sigsuspend, sigsuspend); -static const sigset_t * -thr_remove_thr_signals(const sigset_t *set, sigset_t *newset) -{ - const sigset_t *pset; - - if (SIGISMEMBER(*set, SIGCANCEL)) { - *newset = *set; - SIGDELSET(*newset, SIGCANCEL); - pset = newset; - } else - pset = set; - return (pset); -} - int _sigsuspend(const sigset_t * set) { @@ -389,3 +397,26 @@ __sigwait(const sigset_t *set, int *sig) _thr_cancel_leave_defer(curthread, (ret != 0)); return (ret); } + +__weak_reference(_setcontext, setcontext); +int +_setcontext(const ucontext_t *ucp) +{ + ucontext_t uc; + + (void) memcpy(&uc, ucp, sizeof (uc)); + remove_thr_signals(&uc.uc_sigmask); + + return __sys_setcontext(&uc); +} + +__weak_reference(_swapcontext, swapcontext); +int +_swapcontext(ucontext_t *oucp, const ucontext_t *ucp) +{ + ucontext_t uc; + + (void) memcpy(&uc, ucp, sizeof (uc)); + remove_thr_signals(&uc.uc_sigmask); + return __sys_swapcontext(oucp, &uc); +} From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 11:11:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2ADB1065675; Tue, 24 Aug 2010 11:11:58 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D08B08FC19; Tue, 24 Aug 2010 11:11:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OBBwkw074033; Tue, 24 Aug 2010 11:11:58 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OBBwvn074031; Tue, 24 Aug 2010 11:11:58 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008241111.o7OBBwvn074031@svn.freebsd.org> From: Rui Paulo Date: Tue, 24 Aug 2010 11:11:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211738 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 11:11:59 -0000 Author: rpaulo Date: Tue Aug 24 11:11:58 2010 New Revision: 211738 URL: http://svn.freebsd.org/changeset/base/211738 Log: Port the fasttrap provider to FreeBSD. This provider is responsible for injecting debugging probes in the userland programs and is the basis for the pid provider and the usdt provider. Sponsored by: The FreeBSD Foundation Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Tue Aug 24 09:57:06 2010 (r211737) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Tue Aug 24 11:11:58 2010 (r211738) @@ -17,6 +17,10 @@ * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END + * + * Portions Copyright 2010 The FreeBSD Foundation + * + * $FreeBSD$ */ /* @@ -24,7 +28,9 @@ * Use is subject to license terms. */ +#if defined(sun) #pragma ident "%Z%%M% %I% %E% SMI" +#endif #include #include @@ -32,11 +38,15 @@ #include #include #include +#if defined(sun) #include +#endif #include #include #include +#if defined(sun) #include +#endif #include #include #include @@ -44,9 +54,17 @@ #include #include #include -#include #include +#if defined(sun) #include +#endif +#include +#include +#if !defined(sun) +#include +#include +#include +#endif /* * User-Land Trap-Based Tracing @@ -125,11 +143,20 @@ * never hold the provider lock and creation lock simultaneously */ -static dev_info_t *fasttrap_devi; +static d_open_t fasttrap_open; +static d_ioctl_t fasttrap_ioctl; + +static struct cdevsw fasttrap_cdevsw = { + .d_version = D_VERSION, + .d_open = fasttrap_open, + .d_ioctl = fasttrap_ioctl, + .d_name = "fasttrap", +}; +static struct cdev *fasttrap_cdev; static dtrace_meta_provider_id_t fasttrap_meta_id; -static timeout_id_t fasttrap_timeout; -static kmutex_t fasttrap_cleanup_mtx; +static struct callout fasttrap_timeout; +static struct mtx fasttrap_cleanup_mtx; static uint_t fasttrap_cleanup_work; /* @@ -229,6 +256,7 @@ fasttrap_hash_str(const char *p) void fasttrap_sigtrap(proc_t *p, kthread_t *t, uintptr_t pc) { +#if defined(sun) sigqueue_t *sqp = kmem_zalloc(sizeof (sigqueue_t), KM_SLEEP); sqp->sq_info.si_signo = SIGTRAP; @@ -241,6 +269,17 @@ fasttrap_sigtrap(proc_t *p, kthread_t *t if (t != NULL) aston(t); +#else + ksiginfo_t *ksi = kmem_zalloc(sizeof (ksiginfo_t), KM_SLEEP); + + ksiginfo_init(ksi); + ksi->ksi_signo = SIGTRAP; + ksi->ksi_code = TRAP_DTRACE; + ksi->ksi_addr = (caddr_t)pc; + PROC_LOCK(p); + (void) pksignal(p, SIGTRAP, ksi); + PROC_UNLOCK(p); +#endif } /* @@ -250,17 +289,24 @@ fasttrap_sigtrap(proc_t *p, kthread_t *t static void fasttrap_mod_barrier(uint64_t gen) { +#if defined(sun) int i; +#endif if (gen < fasttrap_mod_gen) return; fasttrap_mod_gen++; +#if defined(sun) for (i = 0; i < NCPU; i++) { mutex_enter(&cpu_core[i].cpuc_pid_lock); mutex_exit(&cpu_core[i].cpuc_pid_lock); } +#else + /* XXX */ + __asm __volatile("": : :"memory"); +#endif } /* @@ -274,16 +320,15 @@ fasttrap_pid_cleanup_cb(void *data) fasttrap_provider_t **fpp, *fp; fasttrap_bucket_t *bucket; dtrace_provider_id_t provid; - int i, later; + int i, later = 0; static volatile int in = 0; ASSERT(in == 0); in = 1; - mutex_enter(&fasttrap_cleanup_mtx); while (fasttrap_cleanup_work) { fasttrap_cleanup_work = 0; - mutex_exit(&fasttrap_cleanup_mtx); + mtx_unlock(&fasttrap_cleanup_mtx); later = 0; @@ -349,10 +394,12 @@ fasttrap_pid_cleanup_cb(void *data) mutex_exit(&bucket->ftb_mtx); } - mutex_enter(&fasttrap_cleanup_mtx); + mtx_lock(&fasttrap_cleanup_mtx); } +#if 0 ASSERT(fasttrap_timeout != 0); +#endif /* * If we were unable to remove a retired provider, try again after @@ -364,14 +411,17 @@ fasttrap_pid_cleanup_cb(void *data) * get a chance to do that work if and when the timeout is reenabled * (if detach fails). */ - if (later > 0 && fasttrap_timeout != (timeout_id_t)1) - fasttrap_timeout = timeout(&fasttrap_pid_cleanup_cb, NULL, hz); + if (later > 0 && callout_active(&fasttrap_timeout)) + callout_reset(&fasttrap_timeout, hz, &fasttrap_pid_cleanup_cb, + NULL); else if (later > 0) fasttrap_cleanup_work = 1; - else - fasttrap_timeout = 0; + else { +#if !defined(sun) + /* Nothing to be done for FreeBSD */ +#endif + } - mutex_exit(&fasttrap_cleanup_mtx); in = 0; } @@ -381,11 +431,11 @@ fasttrap_pid_cleanup_cb(void *data) static void fasttrap_pid_cleanup(void) { - mutex_enter(&fasttrap_cleanup_mtx); + + mtx_lock(&fasttrap_cleanup_mtx); fasttrap_cleanup_work = 1; - if (fasttrap_timeout == 0) - fasttrap_timeout = timeout(&fasttrap_pid_cleanup_cb, NULL, 1); - mutex_exit(&fasttrap_cleanup_mtx); + callout_reset(&fasttrap_timeout, 1, &fasttrap_pid_cleanup_cb, NULL); + mtx_unlock(&fasttrap_cleanup_mtx); } /* @@ -400,9 +450,23 @@ fasttrap_fork(proc_t *p, proc_t *cp) pid_t ppid = p->p_pid; int i; +#if defined(sun) ASSERT(curproc == p); ASSERT(p->p_proc_flag & P_PR_LOCK); +#else + PROC_LOCK_ASSERT(p, MA_OWNED); +#endif +#if defined(sun) ASSERT(p->p_dtrace_count > 0); +#else + /* + * This check is purposely here instead of in kern_fork.c because, + * for legal resons, we cannot include the dtrace_cddl.h header + * inside kern_fork.c and insert if-clause there. + */ + if (p->p_dtrace_count == 0) + return; +#endif ASSERT(cp->p_dtrace_count == 0); /* @@ -419,9 +483,11 @@ fasttrap_fork(proc_t *p, proc_t *cp) * We don't have to worry about the child process disappearing * because we're in fork(). */ - mutex_enter(&cp->p_lock); +#if defined(sun) + mtx_lock_spin(&cp->p_slock); sprlock_proc(cp); - mutex_exit(&cp->p_lock); + mtx_unlock_spin(&cp->p_slock); +#endif /* * Iterate over every tracepoint looking for ones that belong to the @@ -451,8 +517,10 @@ fasttrap_fork(proc_t *p, proc_t *cp) mutex_exit(&bucket->ftb_mtx); } +#if defined(sun) mutex_enter(&cp->p_lock); sprunlock(cp); +#endif } /* @@ -463,24 +531,24 @@ fasttrap_fork(proc_t *p, proc_t *cp) static void fasttrap_exec_exit(proc_t *p) { +#if defined(sun) ASSERT(p == curproc); - ASSERT(MUTEX_HELD(&p->p_lock)); - - mutex_exit(&p->p_lock); +#endif + PROC_LOCK_ASSERT(p, MA_OWNED); + PROC_UNLOCK(p); /* * We clean up the pid provider for this process here; user-land * static probes are handled by the meta-provider remove entry point. */ fasttrap_provider_retire(p->p_pid, FASTTRAP_PID_NAME, 0); - - mutex_enter(&p->p_lock); + PROC_LOCK(p); } /*ARGSUSED*/ static void -fasttrap_pid_provide(void *arg, const dtrace_probedesc_t *desc) +fasttrap_pid_provide(void *arg, dtrace_probedesc_t *desc) { /* * There are no "default" pid probes. @@ -504,7 +572,9 @@ fasttrap_tracepoint_enable(proc_t *p, fa ASSERT(probe->ftp_tps[index].fit_tp->ftt_pid == pid); +#if defined(sun) ASSERT(!(p->p_flag & SVFORK)); +#endif /* * Before we make any modifications, make sure we've imposed a barrier @@ -610,7 +680,11 @@ again: * Increment the count of the number of tracepoints active in * the victim process. */ +#if defined(sun) ASSERT(p->p_proc_flag & P_PR_LOCK); +#else + PROC_LOCK_ASSERT(p, MA_OWNED); +#endif p->p_dtrace_count++; return (rc); @@ -666,7 +740,7 @@ fasttrap_tracepoint_disable(proc_t *p, f fasttrap_bucket_t *bucket; fasttrap_provider_t *provider = probe->ftp_prov; fasttrap_tracepoint_t **pp, *tp; - fasttrap_id_t *id, **idp; + fasttrap_id_t *id, **idp = NULL; pid_t pid; uintptr_t pc; @@ -800,7 +874,11 @@ fasttrap_tracepoint_disable(proc_t *p, f * Decrement the count of the number of tracepoints active * in the victim process. */ +#if defined(sun) ASSERT(p->p_proc_flag & P_PR_LOCK); +#else + PROC_LOCK_ASSERT(p, MA_OWNED); +#endif p->p_dtrace_count--; } @@ -851,26 +929,31 @@ fasttrap_enable_callbacks(void) static void fasttrap_disable_callbacks(void) { +#if defined(sun) ASSERT(MUTEX_HELD(&cpu_lock)); +#endif + mutex_enter(&fasttrap_count_mtx); ASSERT(fasttrap_pid_count > 0); fasttrap_pid_count--; if (fasttrap_pid_count == 0) { +#if defined(sun) cpu_t *cur, *cpu = CPU; for (cur = cpu->cpu_next_onln; cur != cpu; cur = cur->cpu_next_onln) { rw_enter(&cur->cpu_ft_lock, RW_WRITER); } - +#endif dtrace_pid_probe_ptr = NULL; dtrace_return_probe_ptr = NULL; - +#if defined(sun) for (cur = cpu->cpu_next_onln; cur != cpu; cur = cur->cpu_next_onln) { rw_exit(&cur->cpu_ft_lock); } +#endif } mutex_exit(&fasttrap_count_mtx); } @@ -880,13 +963,16 @@ static void fasttrap_pid_enable(void *arg, dtrace_id_t id, void *parg) { fasttrap_probe_t *probe = parg; - proc_t *p; + proc_t *p = NULL; int i, rc; + ASSERT(probe != NULL); ASSERT(!probe->ftp_enabled); ASSERT(id == probe->ftp_id); +#if defined(sun) ASSERT(MUTEX_HELD(&cpu_lock)); +#endif /* * Increment the count of enabled probes on this probe's provider; @@ -911,6 +997,7 @@ fasttrap_pid_enable(void *arg, dtrace_id * a fork in which the traced process is being born and we're copying * USDT probes. Otherwise, the process is gone so bail. */ +#if defined(sun) if ((p = sprlock(probe->ftp_pid)) == NULL) { if ((curproc->p_flag & SFORKING) == 0) return; @@ -934,13 +1021,19 @@ fasttrap_pid_enable(void *arg, dtrace_id ASSERT(!(p->p_flag & SVFORK)); mutex_exit(&p->p_lock); +#else + if ((p = pfind(probe->ftp_pid)) == NULL) + return; +#endif /* * We have to enable the trap entry point before any user threads have * the chance to execute the trap instruction we're about to place * in their process's text. */ + PROC_UNLOCK(p); fasttrap_enable_callbacks(); + PROC_LOCK(p); /* * Enable all the tracepoints and add this probe's id to each @@ -967,8 +1060,12 @@ fasttrap_pid_enable(void *arg, dtrace_id i--; } +#if defined(sun) mutex_enter(&p->p_lock); sprunlock(p); +#else + PROC_UNLOCK(p); +#endif /* * Since we're not actually enabling this probe, @@ -978,9 +1075,12 @@ fasttrap_pid_enable(void *arg, dtrace_id return; } } - +#if defined(sun) mutex_enter(&p->p_lock); sprunlock(p); +#else + PROC_UNLOCK(p); +#endif probe->ftp_enabled = 1; } @@ -996,19 +1096,19 @@ fasttrap_pid_disable(void *arg, dtrace_i ASSERT(id == probe->ftp_id); + mutex_enter(&provider->ftp_mtx); + /* * We won't be able to acquire a /proc-esque lock on the process * iff the process is dead and gone. In this case, we rely on the * provider lock as a point of mutual exclusion to prevent other * DTrace consumers from disabling this probe. */ - if ((p = sprlock(probe->ftp_pid)) != NULL) { - ASSERT(!(p->p_flag & SVFORK)); - mutex_exit(&p->p_lock); + if ((p = pfind(probe->ftp_pid)) == NULL) { + mutex_exit(&provider->ftp_mtx); + return; } - mutex_enter(&provider->ftp_mtx); - /* * Disable all the associated tracepoints (for fully enabled probes). */ @@ -1030,9 +1130,6 @@ fasttrap_pid_disable(void *arg, dtrace_i if (provider->ftp_retired && !provider->ftp_marked) whack = provider->ftp_marked = 1; mutex_exit(&provider->ftp_mtx); - - mutex_enter(&p->p_lock); - sprunlock(p); } else { /* * If the process is dead, we're just waiting for the @@ -1042,6 +1139,9 @@ fasttrap_pid_disable(void *arg, dtrace_i whack = provider->ftp_marked = 1; mutex_exit(&provider->ftp_mtx); } +#if !defined(sun) + PROC_UNLOCK(p); +#endif if (whack) fasttrap_pid_cleanup(); @@ -1051,7 +1151,9 @@ fasttrap_pid_disable(void *arg, dtrace_i probe->ftp_enabled = 0; +#if defined(sun) ASSERT(MUTEX_HELD(&cpu_lock)); +#endif fasttrap_disable_callbacks(); } @@ -1163,6 +1265,7 @@ fasttrap_proc_lookup(pid_t pid) fasttrap_bucket_t *bucket; fasttrap_proc_t *fprc, *new_fprc; + bucket = &fasttrap_procs.fth_table[FASTTRAP_PROCS_INDEX(pid)]; mutex_enter(&bucket->ftb_mtx); @@ -1189,6 +1292,10 @@ fasttrap_proc_lookup(pid_t pid) new_fprc->ftpc_pid = pid; new_fprc->ftpc_rcount = 1; new_fprc->ftpc_acount = 1; +#if !defined(sun) + mutex_init(&new_fprc->ftpc_mtx, "fasttrap proc mtx", MUTEX_DEFAULT, + NULL); +#endif mutex_enter(&bucket->ftb_mtx); @@ -1311,17 +1418,8 @@ fasttrap_provider_lookup(pid_t pid, cons * Make sure the process exists, isn't a child created as the result * of a vfork(2), and isn't a zombie (but may be in fork). */ - mutex_enter(&pidlock); - if ((p = prfind(pid)) == NULL) { - mutex_exit(&pidlock); + if ((p = pfind(pid)) == NULL) return (NULL); - } - mutex_enter(&p->p_lock); - mutex_exit(&pidlock); - if (p->p_flag & (SVFORK | SEXITING)) { - mutex_exit(&p->p_lock); - return (NULL); - } /* * Increment p_dtrace_probes so that the process knows to inform us @@ -1334,15 +1432,18 @@ fasttrap_provider_lookup(pid_t pid, cons * Grab the credentials for this process so we have * something to pass to dtrace_register(). */ - mutex_enter(&p->p_crlock); - crhold(p->p_cred); - cred = p->p_cred; - mutex_exit(&p->p_crlock); - mutex_exit(&p->p_lock); + PROC_LOCK_ASSERT(p, MA_OWNED); + crhold(p->p_ucred); + cred = p->p_ucred; + PROC_UNLOCK(p); new_fp = kmem_zalloc(sizeof (fasttrap_provider_t), KM_SLEEP); new_fp->ftp_pid = pid; new_fp->ftp_proc = fasttrap_proc_lookup(pid); +#if !defined(sun) + mutex_init(&new_fp->ftp_mtx, "provider mtx", MUTEX_DEFAULT, NULL); + mutex_init(&new_fp->ftp_cmtx, "lock on creating", MUTEX_DEFAULT, NULL); +#endif ASSERT(new_fp->ftp_proc != NULL); @@ -1420,6 +1521,10 @@ fasttrap_provider_free(fasttrap_provider fasttrap_proc_release(provider->ftp_proc); +#if !defined(sun) + mutex_destroy(&provider->ftp_mtx); + mutex_destroy(&provider->ftp_cmtx); +#endif kmem_free(provider, sizeof (fasttrap_provider_t)); /* @@ -1429,17 +1534,14 @@ fasttrap_provider_free(fasttrap_provider * corresponds to this process's hash chain in the provider hash * table. Don't sweat it if we can't find the process. */ - mutex_enter(&pidlock); - if ((p = prfind(pid)) == NULL) { - mutex_exit(&pidlock); + if ((p = pfind(pid)) == NULL) { return; } - mutex_enter(&p->p_lock); - mutex_exit(&pidlock); - p->p_dtrace_probes--; - mutex_exit(&p->p_lock); +#if !defined(sun) + PROC_UNLOCK(p); +#endif } static void @@ -1527,7 +1629,7 @@ fasttrap_add_probe(fasttrap_probe_spec_t fasttrap_probe_t *pp; fasttrap_tracepoint_t *tp; char *name; - int i, aframes, whack; + int i, aframes = 0, whack; /* * There needs to be at least one desired trace point. @@ -1715,7 +1817,7 @@ fasttrap_meta_provide(void *arg, dtrace_ */ if (strlen(dhpv->dthpv_provname) + 10 >= sizeof (provider->ftp_name)) { - cmn_err(CE_WARN, "failed to instantiate provider %s: " + printf("failed to instantiate provider %s: " "name too long to accomodate pid", dhpv->dthpv_provname); return (NULL); } @@ -1724,7 +1826,7 @@ fasttrap_meta_provide(void *arg, dtrace_ * Don't let folks spoof the true pid provider. */ if (strcmp(dhpv->dthpv_provname, FASTTRAP_PID_NAME) == 0) { - cmn_err(CE_WARN, "failed to instantiate provider %s: " + printf("failed to instantiate provider %s: " "%s is an invalid name", dhpv->dthpv_provname, FASTTRAP_PID_NAME); return (NULL); @@ -1747,7 +1849,7 @@ fasttrap_meta_provide(void *arg, dtrace_ if ((provider = fasttrap_provider_lookup(pid, dhpv->dthpv_provname, &dhpv->dthpv_pattr)) == NULL) { - cmn_err(CE_WARN, "failed to instantiate provider %s for " + printf("failed to instantiate provider %s for " "process %u", dhpv->dthpv_provname, (uint_t)pid); return (NULL); } @@ -1908,15 +2010,21 @@ static dtrace_mops_t fasttrap_mops = { /*ARGSUSED*/ static int -fasttrap_open(dev_t *devp, int flag, int otyp, cred_t *cred_p) +fasttrap_open(struct cdev *dev __unused, int oflags __unused, + int devtype __unused, struct thread *td __unused) { return (0); } /*ARGSUSED*/ static int -fasttrap_ioctl(dev_t dev, int cmd, intptr_t arg, int md, cred_t *cr, int *rv) +fasttrap_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int fflag, + struct thread *td) { +#ifdef notyet + struct kinfo_proc kp; + const cred_t *cr = td->td_ucred; +#endif if (!dtrace_attached()) return (EAGAIN); @@ -1928,9 +2036,13 @@ fasttrap_ioctl(dev_t dev, int cmd, intpt int ret; char *c; +#if defined(sun) if (copyin(&uprobe->ftps_noffs, &noffs, sizeof (uprobe->ftps_noffs))) return (EFAULT); +#else + noffs = uprobe->ftps_noffs; +#endif /* * Probes must have at least one tracepoint. @@ -1946,10 +2058,19 @@ fasttrap_ioctl(dev_t dev, int cmd, intpt probe = kmem_alloc(size, KM_SLEEP); +#if defined(sun) if (copyin(uprobe, probe, size) != 0) { kmem_free(probe, size); return (EFAULT); } +#else + memcpy(probe, uprobe, sizeof(*probe)); + if (noffs > 1 && copyin(uprobe + 1, probe + 1, size) != 0) { + kmem_free(probe, size); + return (EFAULT); + } +#endif + /* * Verify that the function and module strings contain no @@ -1969,30 +2090,52 @@ fasttrap_ioctl(dev_t dev, int cmd, intpt } } +#ifdef notyet if (!PRIV_POLICY_CHOICE(cr, PRIV_ALL, B_FALSE)) { proc_t *p; pid_t pid = probe->ftps_pid; +#if defined(sun) mutex_enter(&pidlock); +#endif /* * Report an error if the process doesn't exist * or is actively being birthed. */ - if ((p = prfind(pid)) == NULL || p->p_stat == SIDL) { + p = pfind(pid); + if (p) + fill_kinfo_proc(p, &kp); + if (p == NULL || kp.ki_stat == SIDL) { +#if defined(sun) mutex_exit(&pidlock); +#endif return (ESRCH); } +#if defined(sun) mutex_enter(&p->p_lock); mutex_exit(&pidlock); +#else + PROC_LOCK_ASSERT(p, MA_OWNED); +#endif +#ifdef notyet if ((ret = priv_proc_cred_perm(cr, p, NULL, VREAD | VWRITE)) != 0) { +#if defined(sun) mutex_exit(&p->p_lock); +#else + PROC_UNLOCK(p); +#endif return (ret); } - +#endif /* notyet */ +#if defined(sun) mutex_exit(&p->p_lock); +#else + PROC_UNLOCK(p); +#endif } +#endif /* notyet */ ret = fasttrap_add_probe(probe); err: @@ -2004,35 +2147,62 @@ err: fasttrap_instr_query_t instr; fasttrap_tracepoint_t *tp; uint_t index; +#if defined(sun) int ret; +#endif +#if defined(sun) if (copyin((void *)arg, &instr, sizeof (instr)) != 0) return (EFAULT); +#endif +#ifdef notyet if (!PRIV_POLICY_CHOICE(cr, PRIV_ALL, B_FALSE)) { proc_t *p; pid_t pid = instr.ftiq_pid; +#if defined(sun) mutex_enter(&pidlock); +#endif /* * Report an error if the process doesn't exist * or is actively being birthed. */ - if ((p = prfind(pid)) == NULL || p->p_stat == SIDL) { + p = pfind(pid); + if (p) + fill_kinfo_proc(p, &kp); + if (p == NULL || kp.ki_stat == SIDL) { +#if defined(sun) mutex_exit(&pidlock); +#endif return (ESRCH); } +#if defined(sun) mutex_enter(&p->p_lock); mutex_exit(&pidlock); +#else + PROC_LOCK_ASSERT(p, MA_OWNED); +#endif +#ifdef notyet if ((ret = priv_proc_cred_perm(cr, p, NULL, VREAD)) != 0) { +#if defined(sun) mutex_exit(&p->p_lock); +#else + PROC_UNLOCK(p); +#endif return (ret); } +#endif /* notyet */ +#if defined(sun) mutex_exit(&p->p_lock); +#else + PROC_UNLOCK(p); +#endif } +#endif /* notyet */ index = FASTTRAP_TPOINTS_INDEX(instr.ftiq_pid, instr.ftiq_pc); @@ -2065,84 +2235,45 @@ err: return (EINVAL); } -static struct cb_ops fasttrap_cb_ops = { - fasttrap_open, /* open */ - nodev, /* close */ - nulldev, /* strategy */ - nulldev, /* print */ - nodev, /* dump */ - nodev, /* read */ - nodev, /* write */ - fasttrap_ioctl, /* ioctl */ - nodev, /* devmap */ - nodev, /* mmap */ - nodev, /* segmap */ - nochpoll, /* poll */ - ddi_prop_op, /* cb_prop_op */ - 0, /* streamtab */ - D_NEW | D_MP /* Driver compatibility flag */ -}; - -/*ARGSUSED*/ static int -fasttrap_info(dev_info_t *dip, ddi_info_cmd_t infocmd, void *arg, void **result) -{ - int error; - - switch (infocmd) { - case DDI_INFO_DEVT2DEVINFO: - *result = (void *)fasttrap_devi; - error = DDI_SUCCESS; - break; - case DDI_INFO_DEVT2INSTANCE: - *result = (void *)0; - error = DDI_SUCCESS; - break; - default: - error = DDI_FAILURE; - } - return (error); -} - -static int -fasttrap_attach(dev_info_t *devi, ddi_attach_cmd_t cmd) +fasttrap_load(void) { ulong_t nent; + int i; - switch (cmd) { - case DDI_ATTACH: - break; - case DDI_RESUME: - return (DDI_SUCCESS); - default: - return (DDI_FAILURE); - } - - if (ddi_create_minor_node(devi, "fasttrap", S_IFCHR, 0, - DDI_PSEUDO, NULL) == DDI_FAILURE) { - ddi_remove_minor_node(devi, NULL); - return (DDI_FAILURE); - } - - ddi_report_dev(devi); - fasttrap_devi = devi; + /* Create the /dev/dtrace/fasttrap entry. */ + fasttrap_cdev = make_dev(&fasttrap_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, + "dtrace/fasttrap"); + + mtx_init(&fasttrap_cleanup_mtx, "fasttrap clean", "dtrace", MTX_DEF); + callout_init_mtx(&fasttrap_timeout, &fasttrap_cleanup_mtx, 0); + mutex_init(&fasttrap_count_mtx, "fasttrap count mtx", MUTEX_DEFAULT, + NULL); /* * Install our hooks into fork(2), exec(2), and exit(2). */ - dtrace_fasttrap_fork_ptr = &fasttrap_fork; - dtrace_fasttrap_exit_ptr = &fasttrap_exec_exit; - dtrace_fasttrap_exec_ptr = &fasttrap_exec_exit; + dtrace_fasttrap_fork = &fasttrap_fork; + dtrace_fasttrap_exit = &fasttrap_exec_exit; + dtrace_fasttrap_exec = &fasttrap_exec_exit; +#if defined(sun) fasttrap_max = ddi_getprop(DDI_DEV_T_ANY, devi, DDI_PROP_DONTPASS, "fasttrap-max-probes", FASTTRAP_MAX_DEFAULT); +#else + fasttrap_max = FASTTRAP_MAX_DEFAULT; +#endif fasttrap_total = 0; /* * Conjure up the tracepoints hashtable... */ +#if defined(sun) nent = ddi_getprop(DDI_DEV_T_ANY, devi, DDI_PROP_DONTPASS, "fasttrap-hash-size", FASTTRAP_TPOINTS_DEFAULT_SIZE); +#else + nent = FASTTRAP_TPOINTS_DEFAULT_SIZE; +#endif if (nent == 0 || nent > 0x1000000) nent = FASTTRAP_TPOINTS_DEFAULT_SIZE; @@ -2155,6 +2286,11 @@ fasttrap_attach(dev_info_t *devi, ddi_at fasttrap_tpoints.fth_mask = fasttrap_tpoints.fth_nent - 1; fasttrap_tpoints.fth_table = kmem_zalloc(fasttrap_tpoints.fth_nent * sizeof (fasttrap_bucket_t), KM_SLEEP); +#if !defined(sun) + for (i = 0; i < fasttrap_tpoints.fth_nent; i++) + mutex_init(&fasttrap_tpoints.fth_table[i].ftb_mtx, + "tracepoints bucket mtx", MUTEX_DEFAULT, NULL); +#endif /* * ... and the providers hash table... @@ -2168,6 +2304,11 @@ fasttrap_attach(dev_info_t *devi, ddi_at fasttrap_provs.fth_mask = fasttrap_provs.fth_nent - 1; fasttrap_provs.fth_table = kmem_zalloc(fasttrap_provs.fth_nent * sizeof (fasttrap_bucket_t), KM_SLEEP); +#if !defined(sun) + for (i = 0; i < fasttrap_provs.fth_nent; i++) + mutex_init(&fasttrap_provs.fth_table[i].ftb_mtx, + "providers bucket mtx", MUTEX_DEFAULT, NULL); +#endif /* * ... and the procs hash table. @@ -2181,27 +2322,22 @@ fasttrap_attach(dev_info_t *devi, ddi_at fasttrap_procs.fth_mask = fasttrap_procs.fth_nent - 1; fasttrap_procs.fth_table = kmem_zalloc(fasttrap_procs.fth_nent * sizeof (fasttrap_bucket_t), KM_SLEEP); +#if !defined(sun) + for (i = 0; i < fasttrap_procs.fth_nent; i++) + mutex_init(&fasttrap_procs.fth_table[i].ftb_mtx, + "processes bucket mtx", MUTEX_DEFAULT, NULL); +#endif (void) dtrace_meta_register("fasttrap", &fasttrap_mops, NULL, &fasttrap_meta_id); - return (DDI_SUCCESS); + return (0); } static int -fasttrap_detach(dev_info_t *devi, ddi_detach_cmd_t cmd) +fasttrap_unload(void) { int i, fail = 0; - timeout_id_t tmp; - - switch (cmd) { - case DDI_DETACH: - break; - case DDI_SUSPEND: - return (DDI_SUCCESS); - default: - return (DDI_FAILURE); - } /* * Unregister the meta-provider to make sure no new fasttrap- @@ -2212,28 +2348,16 @@ fasttrap_detach(dev_info_t *devi, ddi_de */ if (fasttrap_meta_id != DTRACE_METAPROVNONE && dtrace_meta_unregister(fasttrap_meta_id) != 0) - return (DDI_FAILURE); + return (-1); /* * Prevent any new timeouts from running by setting fasttrap_timeout * to a non-zero value, and wait for the current timeout to complete. */ - mutex_enter(&fasttrap_cleanup_mtx); - fasttrap_cleanup_work = 0; - - while (fasttrap_timeout != (timeout_id_t)1) { - tmp = fasttrap_timeout; - fasttrap_timeout = (timeout_id_t)1; - - if (tmp != 0) { - mutex_exit(&fasttrap_cleanup_mtx); - (void) untimeout(tmp); - mutex_enter(&fasttrap_cleanup_mtx); - } - } - + mtx_lock(&fasttrap_cleanup_mtx); fasttrap_cleanup_work = 0; - mutex_exit(&fasttrap_cleanup_mtx); + callout_drain(&fasttrap_timeout); + mtx_unlock(&fasttrap_cleanup_mtx); /* * Iterate over all of our providers. If there's still a process @@ -2275,10 +2399,10 @@ fasttrap_detach(dev_info_t *devi, ddi_de * and start a new timeout if any work has accumulated while * we've been unsuccessfully trying to detach. */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 11:48:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23D5C106564A; Tue, 24 Aug 2010 11:48:22 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id AB6CA8FC0C; Tue, 24 Aug 2010 11:48:20 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o7OBmJbS069954 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 24 Aug 2010 14:48:19 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o7OBmIMc026379; Tue, 24 Aug 2010 14:48:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o7OBmIfU026378; Tue, 24 Aug 2010 14:48:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 24 Aug 2010 14:48:18 +0300 From: Kostik Belousov To: Rui Paulo Message-ID: <20100824114818.GJ2396@deviant.kiev.zoral.com.ua> References: <201008241111.o7OBBwvn074031@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rkKICwW9XwtbZ5OV" Content-Disposition: inline In-Reply-To: <201008241111.o7OBBwvn074031@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211738 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 11:48:22 -0000 --rkKICwW9XwtbZ5OV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 24, 2010 at 11:11:58AM +0000, Rui Paulo wrote: > Author: rpaulo > Date: Tue Aug 24 11:11:58 2010 > New Revision: 211738 > URL: http://svn.freebsd.org/changeset/base/211738 >=20 > Log: > Port the fasttrap provider to FreeBSD. This provider is responsible for > injecting debugging probes in the userland programs and is the basis for > the pid provider and the usdt provider. > =20 > Sponsored by: The FreeBSD Foundation >=20 > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c >=20 > Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Tue Au= g 24 09:57:06 2010 (r211737) > +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Tue Au= g 24 11:11:58 2010 (r211738) > @@ -17,6 +17,10 @@ > * information: Portions Copyright [yyyy] [name of copyright owner] > * > * CDDL HEADER END > + * > + * Portions Copyright 2010 The FreeBSD Foundation > + * > + * $FreeBSD$ > */ > =20 > /* > @@ -24,7 +28,9 @@ > * Use is subject to license terms. > */ > =20 > +#if defined(sun) > #pragma ident "%Z%%M% %I% %E% SMI" > +#endif > =20 > #include > #include > @@ -32,11 +38,15 @@ > #include > #include > #include > +#if defined(sun) > #include > +#endif > #include > #include > #include > +#if defined(sun) > #include > +#endif > #include > #include > #include > @@ -44,9 +54,17 @@ > #include > #include > #include > -#include > #include > +#if defined(sun) > #include > +#endif > +#include > +#include > +#if !defined(sun) > +#include > +#include > +#include > +#endif > =20 > /* > * User-Land Trap-Based Tracing > @@ -125,11 +143,20 @@ > * never hold the provider lock and creation lock simultaneously > */ > =20 > -static dev_info_t *fasttrap_devi; > +static d_open_t fasttrap_open; > +static d_ioctl_t fasttrap_ioctl; > + > +static struct cdevsw fasttrap_cdevsw =3D { > + .d_version =3D D_VERSION, > + .d_open =3D fasttrap_open, > + .d_ioctl =3D fasttrap_ioctl, > + .d_name =3D "fasttrap", > +}; > +static struct cdev *fasttrap_cdev; > static dtrace_meta_provider_id_t fasttrap_meta_id; > =20 > -static timeout_id_t fasttrap_timeout; > -static kmutex_t fasttrap_cleanup_mtx; > +static struct callout fasttrap_timeout; > +static struct mtx fasttrap_cleanup_mtx; > static uint_t fasttrap_cleanup_work; > =20 > /* > @@ -229,6 +256,7 @@ fasttrap_hash_str(const char *p) > void > fasttrap_sigtrap(proc_t *p, kthread_t *t, uintptr_t pc) > { > +#if defined(sun) > sigqueue_t *sqp =3D kmem_zalloc(sizeof (sigqueue_t), KM_SLEEP); > =20 > sqp->sq_info.si_signo =3D SIGTRAP; > @@ -241,6 +269,17 @@ fasttrap_sigtrap(proc_t *p, kthread_t *t > =20 > if (t !=3D NULL) > aston(t); > +#else > + ksiginfo_t *ksi =3D kmem_zalloc(sizeof (ksiginfo_t), KM_SLEEP); > + > + ksiginfo_init(ksi); > + ksi->ksi_signo =3D SIGTRAP; > + ksi->ksi_code =3D TRAP_DTRACE; > + ksi->ksi_addr =3D (caddr_t)pc; > + PROC_LOCK(p); > + (void) pksignal(p, SIGTRAP, ksi); > + PROC_UNLOCK(p); > +#endif =46rom the quick look at the solaris part of the code, I think that the signal should be posted to the specific thread, and not to the process. > } > =20 > /* > @@ -250,17 +289,24 @@ fasttrap_sigtrap(proc_t *p, kthread_t *t > static void > fasttrap_mod_barrier(uint64_t gen) > { > +#if defined(sun) > int i; > +#endif > =20 > if (gen < fasttrap_mod_gen) > return; > =20 > fasttrap_mod_gen++; > =20 > +#if defined(sun) > for (i =3D 0; i < NCPU; i++) { > mutex_enter(&cpu_core[i].cpuc_pid_lock); > mutex_exit(&cpu_core[i].cpuc_pid_lock); > } > +#else > + /* XXX */ > + __asm __volatile("": : :"memory"); Indeed XXX. Semantic of acquiring/releasing a mutex, even on Solaris, is much stricter then performing compiler-level memory barrier. --rkKICwW9XwtbZ5OV Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkxzsYIACgkQC3+MBN1Mb4hPTQCfXTK0rzPjPNaWxkA9chaufUH/ 6mUAoMIvXOY2syzVf2NhYBANbbwj4tjs =Nfyt -----END PGP SIGNATURE----- --rkKICwW9XwtbZ5OV-- From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 11:53:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CAF21065698; Tue, 24 Aug 2010 11:53:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C4638FC12; Tue, 24 Aug 2010 11:53:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OBrV6X074924; Tue, 24 Aug 2010 11:53:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OBrUJ3074922; Tue, 24 Aug 2010 11:53:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008241153.o7OBrUJ3074922@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 24 Aug 2010 11:53:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211741 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 11:53:31 -0000 Author: kib Date: Tue Aug 24 11:53:30 2010 New Revision: 211741 URL: http://svn.freebsd.org/changeset/base/211741 Log: Use preferred spelling for the __attribute__. MFC after: 3 days Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Tue Aug 24 11:39:48 2010 (r211740) +++ head/sys/sys/cdefs.h Tue Aug 24 11:53:30 2010 (r211741) @@ -306,8 +306,8 @@ #endif #if __GNUC_PREREQ__(4, 2) -#define __hidden __attribute((visibility("hidden"))) -#define __exported __attribute((visibility("default"))) +#define __hidden __attribute__((visibility("hidden"))) +#define __exported __attribute__((visibility("default"))) #else #define __hidden #define __exported From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 11:54:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 297741065696; Tue, 24 Aug 2010 11:54:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18FA08FC12; Tue, 24 Aug 2010 11:54:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OBsm2S074984; Tue, 24 Aug 2010 11:54:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OBsmou074982; Tue, 24 Aug 2010 11:54:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008241154.o7OBsmou074982@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 24 Aug 2010 11:54:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211742 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 11:54:49 -0000 Author: kib Date: Tue Aug 24 11:54:48 2010 New Revision: 211742 URL: http://svn.freebsd.org/changeset/base/211742 Log: The __hidden definition is provided by sys/cdefs.h. MFC after: 2 weeks Modified: head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Tue Aug 24 11:53:30 2010 (r211741) +++ head/lib/libthr/thread/thr_private.h Tue Aug 24 11:54:48 2010 (r211742) @@ -66,10 +66,6 @@ WEAK_REF(func, SYM_FBP10(sym)); \ SYM_DEFAULT(sym, SYM_FBP10(sym), FBSDprivate_1.0) -#ifndef __hidden -#define __hidden __attribute__((visibility("hidden"))) -#endif - #include "pthread_md.h" #include "thr_umtx.h" #include "thread_db.h" From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 11:55:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 347DB1065674; Tue, 24 Aug 2010 11:55:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A23C8FC12; Tue, 24 Aug 2010 11:55:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OBtPn6075050; Tue, 24 Aug 2010 11:55:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OBtPXV075049; Tue, 24 Aug 2010 11:55:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008241155.o7OBtPXV075049@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 24 Aug 2010 11:55:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211743 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 11:55:26 -0000 Author: kib Date: Tue Aug 24 11:55:25 2010 New Revision: 211743 URL: http://svn.freebsd.org/changeset/base/211743 Log: Remove unused source. MFC after: 2 weeks Deleted: head/lib/libthr/thread/thr_atfork.c From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 11:59:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 738761065695; Tue, 24 Aug 2010 11:59:35 +0000 (UTC) (envelope-from rpaulo@freebsd.org) Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33]) by mx1.freebsd.org (Postfix) with ESMTP id 34A218FC20; Tue, 24 Aug 2010 11:59:35 +0000 (UTC) Received: from d.earth.lavabit.com (d.earth.lavabit.com [192.168.111.13]) by karen.lavabit.com (Postfix) with ESMTP id 6F0E624ED83; Tue, 24 Aug 2010 06:59:34 -0500 (CDT) Received: from 10.0.10.3 (221.163.108.93.rev.vodafone.pt [93.108.163.221]) by lavabit.com with ESMTP id 6STAX0DHCVY6; Tue, 24 Aug 2010 06:59:34 -0500 Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Rui Paulo In-Reply-To: <20100824114818.GJ2396@deviant.kiev.zoral.com.ua> Date: Tue, 24 Aug 2010 12:59:30 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <0329C085-13EF-47F1-B8BB-DB7679444FAE@freebsd.org> References: <201008241111.o7OBBwvn074031@svn.freebsd.org> <20100824114818.GJ2396@deviant.kiev.zoral.com.ua> To: Kostik Belousov X-Mailer: Apple Mail (2.1081) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211738 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 11:59:35 -0000 On 24 Aug 2010, at 12:48, Kostik Belousov wrote: > On Tue, Aug 24, 2010 at 11:11:58AM +0000, Rui Paulo wrote: >> Author: rpaulo >> Date: Tue Aug 24 11:11:58 2010 >> New Revision: 211738 >> URL: http://svn.freebsd.org/changeset/base/211738 >>=20 >> Log: >> Port the fasttrap provider to FreeBSD. This provider is responsible = for >> injecting debugging probes in the userland programs and is the basis = for >> the pid provider and the usdt provider. >>=20 >> Sponsored by: The FreeBSD Foundation >>=20 >> Modified: >> head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c >>=20 >> Modified: = head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c = Tue Aug 24 09:57:06 2010 (r211737) >> +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c = Tue Aug 24 11:11:58 2010 (r211738) >> @@ -17,6 +17,10 @@ >> * information: Portions Copyright [yyyy] [name of copyright owner] >> * >> * CDDL HEADER END >> + * >> + * Portions Copyright 2010 The FreeBSD Foundation >> + * >> + * $FreeBSD$ >> */ >>=20 >> /* >> @@ -24,7 +28,9 @@ >> * Use is subject to license terms. >> */ >>=20 >> +#if defined(sun) >> #pragma ident "%Z%%M% %I% %E% SMI" >> +#endif >>=20 >> #include >> #include >> @@ -32,11 +38,15 @@ >> #include >> #include >> #include >> +#if defined(sun) >> #include >> +#endif >> #include >> #include >> #include >> +#if defined(sun) >> #include >> +#endif >> #include >> #include >> #include >> @@ -44,9 +54,17 @@ >> #include >> #include >> #include >> -#include >> #include >> +#if defined(sun) >> #include >> +#endif >> +#include >> +#include >> +#if !defined(sun) >> +#include >> +#include >> +#include >> +#endif >>=20 >> /* >> * User-Land Trap-Based Tracing >> @@ -125,11 +143,20 @@ >> * never hold the provider lock and creation lock simultaneously >> */ >>=20 >> -static dev_info_t *fasttrap_devi; >> +static d_open_t fasttrap_open; >> +static d_ioctl_t fasttrap_ioctl; >> + >> +static struct cdevsw fasttrap_cdevsw =3D { >> + .d_version =3D D_VERSION, >> + .d_open =3D fasttrap_open, >> + .d_ioctl =3D fasttrap_ioctl, >> + .d_name =3D "fasttrap", >> +}; >> +static struct cdev *fasttrap_cdev; >> static dtrace_meta_provider_id_t fasttrap_meta_id; >>=20 >> -static timeout_id_t fasttrap_timeout; >> -static kmutex_t fasttrap_cleanup_mtx; >> +static struct callout fasttrap_timeout; >> +static struct mtx fasttrap_cleanup_mtx; >> static uint_t fasttrap_cleanup_work; >>=20 >> /* >> @@ -229,6 +256,7 @@ fasttrap_hash_str(const char *p) >> void >> fasttrap_sigtrap(proc_t *p, kthread_t *t, uintptr_t pc) >> { >> +#if defined(sun) >> sigqueue_t *sqp =3D kmem_zalloc(sizeof (sigqueue_t), KM_SLEEP); >>=20 >> sqp->sq_info.si_signo =3D SIGTRAP; >> @@ -241,6 +269,17 @@ fasttrap_sigtrap(proc_t *p, kthread_t *t >>=20 >> if (t !=3D NULL) >> aston(t); >> +#else >> + ksiginfo_t *ksi =3D kmem_zalloc(sizeof (ksiginfo_t), KM_SLEEP); >> + >> + ksiginfo_init(ksi); >> + ksi->ksi_signo =3D SIGTRAP; >> + ksi->ksi_code =3D TRAP_DTRACE; >> + ksi->ksi_addr =3D (caddr_t)pc; >> + PROC_LOCK(p); >> + (void) pksignal(p, SIGTRAP, ksi); >> + PROC_UNLOCK(p); >> +#endif > =46rom the quick look at the solaris part of the code, I think that = the > signal should be posted to the specific thread, and not to the = process. >=20 I'll use tdsignal, thanks. >> } >>=20 >> /* >> @@ -250,17 +289,24 @@ fasttrap_sigtrap(proc_t *p, kthread_t *t >> static void >> fasttrap_mod_barrier(uint64_t gen) >> { >> +#if defined(sun) >> int i; >> +#endif >>=20 >> if (gen < fasttrap_mod_gen) >> return; >>=20 >> fasttrap_mod_gen++; >>=20 >> +#if defined(sun) >> for (i =3D 0; i < NCPU; i++) { >> mutex_enter(&cpu_core[i].cpuc_pid_lock); >> mutex_exit(&cpu_core[i].cpuc_pid_lock); >> } >> +#else >> + /* XXX */ >> + __asm __volatile("": : :"memory"); > Indeed XXX. Semantic of acquiring/releasing a mutex, even on Solaris, > is much stricter then performing compiler-level memory barrier. I don't know what kind of mutexes we have in FreeBSD to mimc this = behavior. Regards, -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 12:05:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3753F10656BC; Tue, 24 Aug 2010 12:05:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id A099E8FC1A; Tue, 24 Aug 2010 12:05:39 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o7OC5c76071237 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 24 Aug 2010 15:05:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o7OC5cB2026906; Tue, 24 Aug 2010 15:05:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o7OC5c76026905; Tue, 24 Aug 2010 15:05:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 24 Aug 2010 15:05:38 +0300 From: Kostik Belousov To: Rui Paulo Message-ID: <20100824120538.GL2396@deviant.kiev.zoral.com.ua> References: <201008241111.o7OBBwvn074031@svn.freebsd.org> <20100824114818.GJ2396@deviant.kiev.zoral.com.ua> <0329C085-13EF-47F1-B8BB-DB7679444FAE@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eUhXrt0ludXSDj9h" Content-Disposition: inline In-Reply-To: <0329C085-13EF-47F1-B8BB-DB7679444FAE@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211738 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 12:05:40 -0000 --eUhXrt0ludXSDj9h Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 24, 2010 at 12:59:30PM +0100, Rui Paulo wrote: >=20 > On 24 Aug 2010, at 12:48, Kostik Belousov wrote: > >> +#if defined(sun) > >> for (i =3D 0; i < NCPU; i++) { > >> mutex_enter(&cpu_core[i].cpuc_pid_lock); > >> mutex_exit(&cpu_core[i].cpuc_pid_lock); > >> } > >> +#else > >> + /* XXX */ > >> + __asm __volatile("": : :"memory"); > > Indeed XXX. Semantic of acquiring/releasing a mutex, even on Solaris, > > is much stricter then performing compiler-level memory barrier. >=20 > I don't know what kind of mutexes we have in FreeBSD to mimc this behavio= r. I believe that the usual sleepable mutex acquisition provides full barrier both in Solaris and FreeBSD case. But, I also suspect that there is more then just membar on current CPU. They use per-cpu mutexes, that is a known technique to provide biased locking. See http://blogs.sun.com/dave/resource/Asymmetric-Dekker-Synchronization.txt for relatively long discussion. --eUhXrt0ludXSDj9h Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkxztZEACgkQC3+MBN1Mb4jahQCgvb3gyQEUP0mz9mnXz62u2cre ayIAoKv97KKKxnHeHsbWfN0o6udYgvbZ =j+cU -----END PGP SIGNATURE----- --eUhXrt0ludXSDj9h-- From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 12:05:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E31F110656A9; Tue, 24 Aug 2010 12:05:58 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0AE18FC18; Tue, 24 Aug 2010 12:05:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OC5ws9075324; Tue, 24 Aug 2010 12:05:58 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OC5w5w075322; Tue, 24 Aug 2010 12:05:58 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008241205.o7OC5w5w075322@svn.freebsd.org> From: Rui Paulo Date: Tue, 24 Aug 2010 12:05:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211744 - head/sys/cddl/contrib/opensolaris/uts/intel/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 12:05:59 -0000 Author: rpaulo Date: Tue Aug 24 12:05:58 2010 New Revision: 211744 URL: http://svn.freebsd.org/changeset/base/211744 Log: MD fasttrap implementation. Sponsored by: The FreeBSD Foundation Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Tue Aug 24 11:55:25 2010 (r211743) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Tue Aug 24 12:05:58 2010 (r211744) @@ -17,6 +17,10 @@ * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END + * + * Portions Copyright 2010 The FreeBSD Foundation + * + * $FreeBSD$ */ /* @@ -24,20 +28,86 @@ * Use is subject to license terms. */ +#if defined(sun) #pragma ident "%Z%%M% %I% %E% SMI" +#endif #include #include #include #include #include +#if defined(sun) #include #include #include #include +#else +#include +#include +#include +#include +#include +#include +#include +#include +#endif #include +#if defined(sun) #include #include +#else +#include + +static int +proc_ops(int op, proc_t *p, void *kaddr, off_t uaddr, size_t len) +{ + struct iovec iov; + struct uio uio; + + iov.iov_base = kaddr; + iov.iov_len = len; + uio.uio_offset = uaddr; + uio.uio_iov = &iov; + uio.uio_resid = len; + uio.uio_iovcnt = 1; + uio.uio_segflg = UIO_SYSSPACE; + uio.uio_td = curthread; + uio.uio_rw = op; + _PHOLD(p); + PROC_UNLOCK(p); + if (proc_rwmem(p, &uio) < 0) { + PROC_LOCK(p); + _PRELE(p); + return (-1); + } + PROC_LOCK(p); + _PRELE(p); + + return (0); +} + +static int +uread(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr) +{ + + return (proc_ops(UIO_READ, p, kaddr, uaddr, len)); +} + +static int +uwrite(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr) +{ + + return (proc_ops(UIO_WRITE, p, kaddr, uaddr, len)); +} +#endif +#ifdef __i386__ +#define r_rax r_eax +#define r_rbx r_ebx +#define r_rip r_eip +#define r_rflags r_eflags +#define r_rsp r_esp +#endif /* * Lossless User-Land Tracing on x86 @@ -188,12 +258,12 @@ static const uint8_t regmap[8] = { }; #endif -static ulong_t fasttrap_getreg(struct regs *, uint_t); +static ulong_t fasttrap_getreg(struct reg *, uint_t); static uint64_t -fasttrap_anarg(struct regs *rp, int function_entry, int argno) +fasttrap_anarg(struct reg *rp, int function_entry, int argno) { - uint64_t value; + uint64_t value = 0; int shift = function_entry ? 1 : 0; #ifdef __amd64 @@ -207,16 +277,18 @@ fasttrap_anarg(struct regs *rp, int func if (argno < 6) return ((&rp->r_rdi)[argno]); - stack = (uintptr_t *)rp->r_sp; + stack = (uintptr_t *)rp->r_rsp; DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); value = dtrace_fulword(&stack[argno - 6 + shift]); DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT | CPU_DTRACE_BADADDR); } else { #endif - uint32_t *stack = (uint32_t *)rp->r_sp; +#ifdef __i386 + uint32_t *stack = (uint32_t *)rp->r_esp; DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); value = dtrace_fuword32(&stack[argno + shift]); DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT | CPU_DTRACE_BADADDR); +#endif #ifdef __amd64 } #endif @@ -637,35 +709,41 @@ fasttrap_fulword_noerr(const void *uaddr { uintptr_t ret; - if (fasttrap_fulword(uaddr, &ret) == 0) + if ((ret = fasttrap_fulword(uaddr)) != -1) return (ret); return (0); } #endif +#ifdef __i386__ static uint32_t fasttrap_fuword32_noerr(const void *uaddr) { uint32_t ret; - if (fasttrap_fuword32(uaddr, &ret) == 0) + if ((ret = fasttrap_fuword32(uaddr)) != -1) return (ret); return (0); } +#endif static void -fasttrap_return_common(struct regs *rp, uintptr_t pc, pid_t pid, +fasttrap_return_common(struct reg *rp, uintptr_t pc, pid_t pid, uintptr_t new_pc) { fasttrap_tracepoint_t *tp; fasttrap_bucket_t *bucket; fasttrap_id_t *id; +#if defined(sun) kmutex_t *pid_mtx; +#endif +#if defined(sun) pid_mtx = &cpu_core[CPU->cpu_id].cpuc_pid_lock; mutex_enter(pid_mtx); +#endif bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)]; for (tp = bucket->ftb_data; tp != NULL; tp = tp->ftt_next) { @@ -680,7 +758,9 @@ fasttrap_return_common(struct regs *rp, * is not essential to the correct execution of the process. */ if (tp == NULL) { +#if defined(sun) mutex_exit(pid_mtx); +#endif return; } @@ -698,15 +778,18 @@ fasttrap_return_common(struct regs *rp, dtrace_probe(id->fti_probe->ftp_id, pc - id->fti_probe->ftp_faddr, - rp->r_r0, rp->r_r1, 0, 0); + rp->r_rax, rp->r_rbx, 0, 0); } +#if defined(sun) mutex_exit(pid_mtx); +#endif } static void fasttrap_sigsegv(proc_t *p, kthread_t *t, uintptr_t addr) { +#if defined(sun) sigqueue_t *sqp = kmem_zalloc(sizeof (sigqueue_t), KM_SLEEP); sqp->sq_info.si_signo = SIGSEGV; @@ -719,15 +802,24 @@ fasttrap_sigsegv(proc_t *p, kthread_t *t if (t != NULL) aston(t); +#else + ksiginfo_t *ksi = kmem_zalloc(sizeof (ksiginfo_t), KM_SLEEP); + + ksiginfo_init(ksi); + ksi->ksi_signo = SIGSEGV; + ksi->ksi_code = SEGV_MAPERR; + ksi->ksi_addr = (caddr_t)addr; + (void) tdksignal(t, SIGSEGV, ksi); +#endif } #ifdef __amd64 static void -fasttrap_usdt_args64(fasttrap_probe_t *probe, struct regs *rp, int argc, +fasttrap_usdt_args64(fasttrap_probe_t *probe, struct reg *rp, int argc, uintptr_t *argv) { int i, x, cap = MIN(argc, probe->ftp_nargs); - uintptr_t *stack = (uintptr_t *)rp->r_sp; + uintptr_t *stack = (uintptr_t *)rp->r_rsp; for (i = 0; i < cap; i++) { x = probe->ftp_argmap[i]; @@ -744,12 +836,13 @@ fasttrap_usdt_args64(fasttrap_probe_t *p } #endif +#ifdef __i386__ static void -fasttrap_usdt_args32(fasttrap_probe_t *probe, struct regs *rp, int argc, +fasttrap_usdt_args32(fasttrap_probe_t *probe, struct reg *rp, int argc, uint32_t *argv) { int i, x, cap = MIN(argc, probe->ftp_nargs); - uint32_t *stack = (uint32_t *)rp->r_sp; + uint32_t *stack = (uint32_t *)rp->r_rsp; for (i = 0; i < cap; i++) { x = probe->ftp_argmap[i]; @@ -761,13 +854,18 @@ fasttrap_usdt_args32(fasttrap_probe_t *p argv[i] = 0; } } +#endif static int -fasttrap_do_seg(fasttrap_tracepoint_t *tp, struct regs *rp, uintptr_t *addr) +fasttrap_do_seg(fasttrap_tracepoint_t *tp, struct reg *rp, uintptr_t *addr) { proc_t *p = curproc; - user_desc_t *desc; - uint16_t sel, ndx, type; +#ifdef __i386__ + struct segment_descriptor *desc; +#else + struct user_segment_descriptor *desc; +#endif + uint16_t sel = 0, ndx, type; uintptr_t limit; switch (tp->ftt_segment) { @@ -795,36 +893,49 @@ fasttrap_do_seg(fasttrap_tracepoint_t *t * Make sure the given segment register specifies a user priority * selector rather than a kernel selector. */ - if (!SELISUPL(sel)) + if (ISPL(sel) != SEL_UPL) return (-1); - ndx = SELTOIDX(sel); + ndx = IDXSEL(sel); /* * Check the bounds and grab the descriptor out of the specified * descriptor table. */ - if (SELISLDT(sel)) { - if (ndx > p->p_ldtlimit) + if (ISLDT(sel)) { +#ifdef __i386__ + if (ndx > p->p_md.md_ldt->ldt_len) + return (-1); + + desc = (struct segment_descriptor *) + p->p_md.md_ldt[ndx].ldt_base; +#else + if (ndx > max_ldt_segment) return (-1); - desc = p->p_ldt + ndx; + desc = (struct user_segment_descriptor *) + p->p_md.md_ldt[ndx].ldt_base; +#endif } else { if (ndx >= NGDT) return (-1); - desc = cpu_get_gdt() + ndx; +#ifdef __i386__ + desc = &gdt[ndx].sd; +#else + desc = &gdt[ndx]; +#endif } /* * The descriptor must have user privilege level and it must be * present in memory. */ - if (desc->usd_dpl != SEL_UPL || desc->usd_p != 1) + if (desc->sd_dpl != SEL_UPL || desc->sd_p != 1) return (-1); - type = desc->usd_type; + type = desc->sd_type; /* * If the S bit in the type field is not set, this descriptor can @@ -833,7 +944,7 @@ fasttrap_do_seg(fasttrap_tracepoint_t *t if ((type & 0x10) != 0x10) return (-1); - limit = USEGD_GETLIMIT(desc) * (desc->usd_gran ? PAGESIZE : 1); + limit = USD_GETLIMIT(desc) * (desc->sd_gran ? PAGESIZE : 1); if (tp->ftt_segment == FASTTRAP_SEG_CS) { /* @@ -861,7 +972,7 @@ fasttrap_do_seg(fasttrap_tracepoint_t *t if ((type & 0x4) == 0) { if (*addr > limit) return (-1); - } else if (desc->usd_def32) { + } else if (desc->sd_def32) { if (*addr < limit + 1 || 0xffff < *addr) return (-1); } else { @@ -870,18 +981,21 @@ fasttrap_do_seg(fasttrap_tracepoint_t *t } } - *addr += USEGD_GETBASE(desc); + *addr += USD_GETBASE(desc); return (0); } int -fasttrap_pid_probe(struct regs *rp) +fasttrap_pid_probe(struct reg *rp) { proc_t *p = curproc; - uintptr_t pc = rp->r_pc - 1, new_pc = 0; + uintptr_t pc = rp->r_rip - 1; + uintptr_t new_pc = 0; fasttrap_bucket_t *bucket; +#if defined(sun) kmutex_t *pid_mtx; +#endif fasttrap_tracepoint_t *tp, tp_local; pid_t pid; dtrace_icookie_t cookie; @@ -911,6 +1025,7 @@ fasttrap_pid_probe(struct regs *rp) curthread->t_dtrace_regv = 0; #endif +#if defined(sun) /* * Treat a child created by a call to vfork(2) as if it were its * parent. We know that there's only one thread of control in such a @@ -919,10 +1034,14 @@ fasttrap_pid_probe(struct regs *rp) while (p->p_flag & SVFORK) { p = p->p_parent; } +#endif + PROC_LOCK(p); pid = p->p_pid; +#if defined(sun) pid_mtx = &cpu_core[CPU->cpu_id].cpuc_pid_lock; mutex_enter(pid_mtx); +#endif bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)]; /* @@ -940,15 +1059,19 @@ fasttrap_pid_probe(struct regs *rp) * fasttrap_ioctl), or somehow we have mislaid this tracepoint. */ if (tp == NULL) { +#if defined(sun) mutex_exit(pid_mtx); +#endif + PROC_UNLOCK(p); return (-1); } + printf("found tracepoint\n"); /* * Set the program counter to the address of the traced instruction * so that it looks right in ustack() output. */ - rp->r_pc = pc; + rp->r_rip = pc; if (tp->ftt_ids != NULL) { fasttrap_id_t *id; @@ -995,9 +1118,9 @@ fasttrap_pid_probe(struct regs *rp) } } } else { -#endif +#else /* __amd64 */ uintptr_t s0, s1, s2, s3, s4, s5; - uint32_t *stack = (uint32_t *)rp->r_sp; + uint32_t *stack = (uint32_t *)rp->r_esp; /* * In 32-bit mode, all arguments are passed on the @@ -1050,6 +1173,7 @@ fasttrap_pid_probe(struct regs *rp) t[2], t[3], t[4]); } } +#endif /* __amd64 */ #ifdef __amd64 } #endif @@ -1061,7 +1185,10 @@ fasttrap_pid_probe(struct regs *rp) * tracepoint again later if we need to light up any return probes. */ tp_local = *tp; + PROC_UNLOCK(p); +#if defined(sun) mutex_exit(pid_mtx); +#endif tp = &tp_local; /* @@ -1069,7 +1196,7 @@ fasttrap_pid_probe(struct regs *rp) * had completely executed. This ensures that fasttrap_getreg() will * report the expected value for REG_RIP. */ - rp->r_pc = pc + tp->ftt_size; + rp->r_rip = pc + tp->ftt_size; /* * If there's an is-enabled probe connected to this tracepoint it @@ -1083,8 +1210,8 @@ fasttrap_pid_probe(struct regs *rp) * exotic way to shoot oneself in the foot. */ if (is_enabled) { - rp->r_r0 = 1; - new_pc = rp->r_pc; + rp->r_rax = 1; + new_pc = rp->r_rip; goto done; } @@ -1098,9 +1225,9 @@ fasttrap_pid_probe(struct regs *rp) case FASTTRAP_T_RET: case FASTTRAP_T_RET16: { - uintptr_t dst; - uintptr_t addr; - int ret; + uintptr_t dst = 0; + uintptr_t addr = 0; + int ret = 0; /* * We have to emulate _every_ facet of the behavior of a ret @@ -1109,20 +1236,22 @@ fasttrap_pid_probe(struct regs *rp) */ #ifdef __amd64 if (p->p_model == DATAMODEL_NATIVE) { -#endif - ret = fasttrap_fulword((void *)rp->r_sp, &dst); - addr = rp->r_sp + sizeof (uintptr_t); -#ifdef __amd64 + ret = dst = fasttrap_fulword((void *)rp->r_rsp); + addr = rp->r_rsp + sizeof (uintptr_t); } else { +#endif +#ifdef __i386__ uint32_t dst32; - ret = fasttrap_fuword32((void *)rp->r_sp, &dst32); + ret = dst32 = fasttrap_fuword32((void *)rp->r_esp); dst = dst32; - addr = rp->r_sp + sizeof (uint32_t); + addr = rp->r_esp + sizeof (uint32_t); +#endif +#ifdef __amd64 } #endif if (ret == -1) { - fasttrap_sigsegv(p, curthread, rp->r_sp); + fasttrap_sigsegv(p, curthread, rp->r_rsp); new_pc = pc; break; } @@ -1130,71 +1259,71 @@ fasttrap_pid_probe(struct regs *rp) if (tp->ftt_type == FASTTRAP_T_RET16) addr += tp->ftt_dest; - rp->r_sp = addr; + rp->r_rsp = addr; new_pc = dst; break; } case FASTTRAP_T_JCC: { - uint_t taken; + uint_t taken = 0; switch (tp->ftt_code) { case FASTTRAP_JO: - taken = (rp->r_ps & FASTTRAP_EFLAGS_OF) != 0; + taken = (rp->r_rflags & FASTTRAP_EFLAGS_OF) != 0; break; case FASTTRAP_JNO: - taken = (rp->r_ps & FASTTRAP_EFLAGS_OF) == 0; + taken = (rp->r_rflags & FASTTRAP_EFLAGS_OF) == 0; break; case FASTTRAP_JB: - taken = (rp->r_ps & FASTTRAP_EFLAGS_CF) != 0; + taken = (rp->r_rflags & FASTTRAP_EFLAGS_CF) != 0; break; case FASTTRAP_JAE: - taken = (rp->r_ps & FASTTRAP_EFLAGS_CF) == 0; + taken = (rp->r_rflags & FASTTRAP_EFLAGS_CF) == 0; break; case FASTTRAP_JE: - taken = (rp->r_ps & FASTTRAP_EFLAGS_ZF) != 0; + taken = (rp->r_rflags & FASTTRAP_EFLAGS_ZF) != 0; break; case FASTTRAP_JNE: - taken = (rp->r_ps & FASTTRAP_EFLAGS_ZF) == 0; + taken = (rp->r_rflags & FASTTRAP_EFLAGS_ZF) == 0; break; case FASTTRAP_JBE: - taken = (rp->r_ps & FASTTRAP_EFLAGS_CF) != 0 || - (rp->r_ps & FASTTRAP_EFLAGS_ZF) != 0; + taken = (rp->r_rflags & FASTTRAP_EFLAGS_CF) != 0 || + (rp->r_rflags & FASTTRAP_EFLAGS_ZF) != 0; break; case FASTTRAP_JA: - taken = (rp->r_ps & FASTTRAP_EFLAGS_CF) == 0 && - (rp->r_ps & FASTTRAP_EFLAGS_ZF) == 0; + taken = (rp->r_rflags & FASTTRAP_EFLAGS_CF) == 0 && + (rp->r_rflags & FASTTRAP_EFLAGS_ZF) == 0; break; case FASTTRAP_JS: - taken = (rp->r_ps & FASTTRAP_EFLAGS_SF) != 0; + taken = (rp->r_rflags & FASTTRAP_EFLAGS_SF) != 0; break; case FASTTRAP_JNS: - taken = (rp->r_ps & FASTTRAP_EFLAGS_SF) == 0; + taken = (rp->r_rflags & FASTTRAP_EFLAGS_SF) == 0; break; case FASTTRAP_JP: - taken = (rp->r_ps & FASTTRAP_EFLAGS_PF) != 0; + taken = (rp->r_rflags & FASTTRAP_EFLAGS_PF) != 0; break; case FASTTRAP_JNP: - taken = (rp->r_ps & FASTTRAP_EFLAGS_PF) == 0; + taken = (rp->r_rflags & FASTTRAP_EFLAGS_PF) == 0; break; case FASTTRAP_JL: - taken = ((rp->r_ps & FASTTRAP_EFLAGS_SF) == 0) != - ((rp->r_ps & FASTTRAP_EFLAGS_OF) == 0); + taken = ((rp->r_rflags & FASTTRAP_EFLAGS_SF) == 0) != + ((rp->r_rflags & FASTTRAP_EFLAGS_OF) == 0); break; case FASTTRAP_JGE: - taken = ((rp->r_ps & FASTTRAP_EFLAGS_SF) == 0) == - ((rp->r_ps & FASTTRAP_EFLAGS_OF) == 0); + taken = ((rp->r_rflags & FASTTRAP_EFLAGS_SF) == 0) == + ((rp->r_rflags & FASTTRAP_EFLAGS_OF) == 0); break; case FASTTRAP_JLE: - taken = (rp->r_ps & FASTTRAP_EFLAGS_ZF) != 0 || - ((rp->r_ps & FASTTRAP_EFLAGS_SF) == 0) != - ((rp->r_ps & FASTTRAP_EFLAGS_OF) == 0); + taken = (rp->r_rflags & FASTTRAP_EFLAGS_ZF) != 0 || + ((rp->r_rflags & FASTTRAP_EFLAGS_SF) == 0) != + ((rp->r_rflags & FASTTRAP_EFLAGS_OF) == 0); break; case FASTTRAP_JG: - taken = (rp->r_ps & FASTTRAP_EFLAGS_ZF) == 0 && - ((rp->r_ps & FASTTRAP_EFLAGS_SF) == 0) == - ((rp->r_ps & FASTTRAP_EFLAGS_OF) == 0); + taken = (rp->r_rflags & FASTTRAP_EFLAGS_ZF) == 0 && + ((rp->r_rflags & FASTTRAP_EFLAGS_SF) == 0) == + ((rp->r_rflags & FASTTRAP_EFLAGS_OF) == 0); break; } @@ -1208,7 +1337,7 @@ fasttrap_pid_probe(struct regs *rp) case FASTTRAP_T_LOOP: { - uint_t taken; + uint_t taken = 0; #ifdef __amd64 greg_t cx = rp->r_rcx--; #else @@ -1217,11 +1346,11 @@ fasttrap_pid_probe(struct regs *rp) switch (tp->ftt_code) { case FASTTRAP_LOOPNZ: - taken = (rp->r_ps & FASTTRAP_EFLAGS_ZF) == 0 && + taken = (rp->r_rflags & FASTTRAP_EFLAGS_ZF) == 0 && cx != 0; break; case FASTTRAP_LOOPZ: - taken = (rp->r_ps & FASTTRAP_EFLAGS_ZF) != 0 && + taken = (rp->r_rflags & FASTTRAP_EFLAGS_ZF) != 0 && cx != 0; break; case FASTTRAP_LOOP: @@ -1253,18 +1382,19 @@ fasttrap_pid_probe(struct regs *rp) case FASTTRAP_T_PUSHL_EBP: { - int ret; - uintptr_t addr; + int ret = 0; + uintptr_t addr = 0; #ifdef __amd64 if (p->p_model == DATAMODEL_NATIVE) { + addr = rp->r_rsp - sizeof (uintptr_t); + ret = fasttrap_sulword((void *)addr, &rp->r_rsp); + } else { +#endif +#ifdef __i386__ + addr = rp->r_rsp - sizeof (uint32_t); + ret = fasttrap_suword32((void *)addr, &rp->r_rsp); #endif - addr = rp->r_sp - sizeof (uintptr_t); - ret = fasttrap_sulword((void *)addr, rp->r_fp); #ifdef __amd64 - } else { - addr = rp->r_sp - sizeof (uint32_t); - ret = fasttrap_suword32((void *)addr, - (uint32_t)rp->r_fp); } #endif @@ -1274,7 +1404,7 @@ fasttrap_pid_probe(struct regs *rp) break; } - rp->r_sp = addr; + rp->r_rsp = addr; new_pc = pc + tp->ftt_size; break; } @@ -1288,7 +1418,10 @@ fasttrap_pid_probe(struct regs *rp) if (tp->ftt_code == 0) { new_pc = tp->ftt_dest; } else { - uintptr_t value, addr = tp->ftt_dest; +#ifdef __amd64 + uintptr_t value; +#endif + uintptr_t addr = tp->ftt_dest; if (tp->ftt_base != FASTTRAP_NOREG) addr += fasttrap_getreg(rp, tp->ftt_base); @@ -1312,32 +1445,34 @@ fasttrap_pid_probe(struct regs *rp) #ifdef __amd64 if (p->p_model == DATAMODEL_NATIVE) { -#endif - if (fasttrap_fulword((void *)addr, - &value) == -1) { + if ((value = fasttrap_fulword((void *)addr)) + == -1) { fasttrap_sigsegv(p, curthread, addr); new_pc = pc; break; } new_pc = value; -#ifdef __amd64 } else { +#endif +#ifdef __i386__ uint32_t value32; addr = (uintptr_t)(uint32_t)addr; - if (fasttrap_fuword32((void *)addr, - &value32) == -1) { + if ((value32 = fasttrap_fuword32((void *)addr)) + == -1) { fasttrap_sigsegv(p, curthread, addr); new_pc = pc; break; } new_pc = value32; - } #endif + } +#ifdef __amd64 } else { new_pc = addr; } +#endif } /* @@ -1347,18 +1482,20 @@ fasttrap_pid_probe(struct regs *rp) * this instruction weren't traced. */ if (tp->ftt_type == FASTTRAP_T_CALL) { - int ret; - uintptr_t addr; + int ret = 0; + uintptr_t addr = 0, pcps; #ifdef __amd64 if (p->p_model == DATAMODEL_NATIVE) { - addr = rp->r_sp - sizeof (uintptr_t); - ret = fasttrap_sulword((void *)addr, - pc + tp->ftt_size); + addr = rp->r_rsp - sizeof (uintptr_t); + pcps = pc + tp->ftt_size; + ret = fasttrap_sulword((void *)addr, &pcps); } else { #endif - addr = rp->r_sp - sizeof (uint32_t); - ret = fasttrap_suword32((void *)addr, - (uint32_t)(pc + tp->ftt_size)); +#ifdef __i386__ + addr = rp->r_rsp - sizeof (uint32_t); + pcps = (uint32_t)(pc + tp->ftt_size); + ret = fasttrap_suword32((void *)addr, &pcps); +#endif #ifdef __amd64 } #endif @@ -1369,7 +1506,7 @@ fasttrap_pid_probe(struct regs *rp) break; } - rp->r_sp = addr; + rp->r_rsp = addr; } break; @@ -1383,7 +1520,9 @@ fasttrap_pid_probe(struct regs *rp) uint8_t scratch[2 * FASTTRAP_MAX_INSTR_SIZE + 7]; #endif uint_t i = 0; +#if defined(sun) klwp_t *lwp = ttolwp(curthread); +#endif /* * Compute the address of the ulwp_t and step over the @@ -1391,6 +1530,7 @@ fasttrap_pid_probe(struct regs *rp) * thread pointer is very different on 32- and 64-bit * kernels. */ +#if defined(sun) #if defined(__amd64) if (p->p_model == DATAMODEL_LP64) { addr = lwp->lwp_pcb.pcb_fsbase; @@ -1400,9 +1540,16 @@ fasttrap_pid_probe(struct regs *rp) addr += sizeof (caddr32_t); } #else - addr = USEGD_GETBASE(&lwp->lwp_pcb.pcb_gsdesc); + addr = USD_GETBASE(&lwp->lwp_pcb.pcb_gsdesc); addr += sizeof (void *); #endif +#endif /* sun */ +#ifdef __i386__ + addr = USD_GETBASE(&curthread->td_pcb->pcb_gsd); +#else + addr = curthread->td_pcb->pcb_gsbase; +#endif + addr += sizeof (void *); /* * Generic Instruction Tracing @@ -1495,7 +1642,7 @@ fasttrap_pid_probe(struct regs *rp) #ifdef __amd64 if (tp->ftt_ripmode != 0) { - greg_t *reg; + greg_t *reg = NULL; ASSERT(p->p_model == DATAMODEL_LP64); ASSERT(tp->ftt_ripmode & @@ -1566,6 +1713,7 @@ fasttrap_pid_probe(struct regs *rp) i += sizeof (uint64_t); } else { #endif +#ifdef __i386__ /* * Set up the jmp to the next instruction; note that * the size of the traced instruction cancels out. @@ -1574,6 +1722,7 @@ fasttrap_pid_probe(struct regs *rp) /* LINTED - alignment */ *(uint32_t *)&scratch[i] = pc - addr - 5; i += sizeof (uint32_t); +#endif #ifdef __amd64 } #endif @@ -1632,7 +1781,7 @@ done: * output. We had previously set it to the end of the * instruction to simplify %rip-relative addressing. */ - rp->r_pc = pc; + rp->r_rip = pc; fasttrap_return_common(rp, pc, pid, new_pc); } else { @@ -1643,13 +1792,14 @@ done: } } - rp->r_pc = new_pc; + rp->r_rip = new_pc; + set_regs(curthread, rp); return (0); } int -fasttrap_return_probe(struct regs *rp) +fasttrap_return_probe(struct reg *rp) { proc_t *p = curproc; uintptr_t pc = curthread->t_dtrace_pc; @@ -1660,6 +1810,7 @@ fasttrap_return_probe(struct regs *rp) curthread->t_dtrace_scrpc = 0; curthread->t_dtrace_astpc = 0; +#if defined(sun) /* * Treat a child created by a call to vfork(2) as if it were its * parent. We know that there's only one thread of control in such a @@ -1668,15 +1819,16 @@ fasttrap_return_probe(struct regs *rp) while (p->p_flag & SVFORK) { p = p->p_parent; } +#endif /* - * We set rp->r_pc to the address of the traced instruction so + * We set rp->r_rip to the address of the traced instruction so * that it appears to dtrace_probe() that we're on the original * instruction, and so that the user can't easily detect our * complex web of lies. dtrace_return_probe() (our caller) * will correctly set %pc after we return. */ - rp->r_pc = pc; + rp->r_rip = pc; fasttrap_return_common(rp, pc, p->p_pid, npc); @@ -1688,7 +1840,11 @@ uint64_t fasttrap_pid_getarg(void *arg, dtrace_id_t id, void *parg, int argno, int aframes) { - return (fasttrap_anarg(ttolwp(curthread)->lwp_regs, 1, argno)); + struct reg r; + + fill_regs(curthread, &r); + + return (fasttrap_anarg(&r, 1, argno)); } /*ARGSUSED*/ @@ -1696,11 +1852,15 @@ uint64_t fasttrap_usdt_getarg(void *arg, dtrace_id_t id, void *parg, int argno, int aframes) { - return (fasttrap_anarg(ttolwp(curthread)->lwp_regs, 0, argno)); + struct reg r; + + fill_regs(curthread, &r); + + return (fasttrap_anarg(&r, 0, argno)); } static ulong_t -fasttrap_getreg(struct regs *rp, uint_t reg) +fasttrap_getreg(struct reg *rp, uint_t reg) { #ifdef __amd64 switch (reg) { @@ -1723,20 +1883,23 @@ fasttrap_getreg(struct regs *rp, uint_t case REG_ERR: return (rp->r_err); case REG_RIP: return (rp->r_rip); case REG_CS: return (rp->r_cs); +#if defined(sun) case REG_RFL: return (rp->r_rfl); +#endif case REG_RSP: return (rp->r_rsp); case REG_SS: return (rp->r_ss); case REG_FS: return (rp->r_fs); case REG_GS: return (rp->r_gs); case REG_DS: return (rp->r_ds); case REG_ES: return (rp->r_es); - case REG_FSBASE: return (rdmsr(MSR_AMD_FSBASE)); - case REG_GSBASE: return (rdmsr(MSR_AMD_GSBASE)); + case REG_FSBASE: return (rdmsr(MSR_FSBASE)); + case REG_GSBASE: return (rdmsr(MSR_GSBASE)); } panic("dtrace: illegal register constant"); /*NOTREACHED*/ #else +#define _NGREG 19 if (reg >= _NGREG) panic("dtrace: illegal register constant"); From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 12:12:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D34C710656AB; Tue, 24 Aug 2010 12:12:03 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C26D08FC16; Tue, 24 Aug 2010 12:12:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OCC3mb075486; Tue, 24 Aug 2010 12:12:03 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OCC3Kp075484; Tue, 24 Aug 2010 12:12:03 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008241212.o7OCC3Kp075484@svn.freebsd.org> From: Rui Paulo Date: Tue, 24 Aug 2010 12:12:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211745 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 12:12:03 -0000 Author: rpaulo Date: Tue Aug 24 12:12:03 2010 New Revision: 211745 URL: http://svn.freebsd.org/changeset/base/211745 Log: Replace a pksignal() call with tdksignal(). Pointed out by: kib Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Tue Aug 24 12:05:58 2010 (r211744) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Tue Aug 24 12:12:03 2010 (r211745) @@ -277,7 +277,7 @@ fasttrap_sigtrap(proc_t *p, kthread_t *t ksi->ksi_code = TRAP_DTRACE; ksi->ksi_addr = (caddr_t)pc; PROC_LOCK(p); - (void) pksignal(p, SIGTRAP, ksi); + (void) tdksignal(t, SIGTRAP, ksi); PROC_UNLOCK(p); #endif } From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 12:18:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 154DD10656AA; Tue, 24 Aug 2010 12:18:40 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04DB78FC1B; Tue, 24 Aug 2010 12:18:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OCIdnr075666; Tue, 24 Aug 2010 12:18:39 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OCId5L075664; Tue, 24 Aug 2010 12:18:39 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008241218.o7OCId5L075664@svn.freebsd.org> From: Rui Paulo Date: Tue, 24 Aug 2010 12:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211746 - head/sys/modules/dtrace/fasttrap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 12:18:40 -0000 Author: rpaulo Date: Tue Aug 24 12:18:39 2010 New Revision: 211746 URL: http://svn.freebsd.org/changeset/base/211746 Log: Update for the recent location of the fasttrap code. Sponsored by: The FreeBSD Foundation Modified: head/sys/modules/dtrace/fasttrap/Makefile Modified: head/sys/modules/dtrace/fasttrap/Makefile ============================================================================== --- head/sys/modules/dtrace/fasttrap/Makefile Tue Aug 24 12:12:03 2010 (r211745) +++ head/sys/modules/dtrace/fasttrap/Makefile Tue Aug 24 12:18:39 2010 (r211746) @@ -1,9 +1,9 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/dev/fasttrap +.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common/dtrace KMOD= fasttrap -SRCS= fasttrap.c +SRCS= fasttrap.c fasttrap_isa.c opt_compat.h SRCS+= vnode_if.h CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \ @@ -12,6 +12,7 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/intel +.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/uts/intel/dtrace .endif CFLAGS+= -DSMP -DDEBUG From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 12:56:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C1A11065674; Tue, 24 Aug 2010 12:56:46 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B9488FC12; Tue, 24 Aug 2010 12:56:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OCuksP076577; Tue, 24 Aug 2010 12:56:46 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OCukie076575; Tue, 24 Aug 2010 12:56:46 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008241256.o7OCukie076575@svn.freebsd.org> From: Rui Paulo Date: Tue, 24 Aug 2010 12:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211747 - head/sys/boot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 12:56:46 -0000 Author: rpaulo Date: Tue Aug 24 12:56:45 2010 New Revision: 211747 URL: http://svn.freebsd.org/changeset/base/211747 Log: Replace structure assignments with explicity memcpy calls. This allows Clang to compile this file: it was using the builtin memcpy and we want to use the memcpy defined in gptboot.c. (Clang can't compile boot2 yet). Submitted by: Dimitry Andric Reviewed by: jhb Modified: head/sys/boot/common/ufsread.c Modified: head/sys/boot/common/ufsread.c ============================================================================== --- head/sys/boot/common/ufsread.c Tue Aug 24 12:18:39 2010 (r211746) +++ head/sys/boot/common/ufsread.c Tue Aug 24 12:56:45 2010 (r211747) @@ -223,14 +223,19 @@ fsread(ino_t inode, void *buf, size_t nb return -1; n = INO_TO_VBO(n, inode); #if defined(UFS1_ONLY) - dp1 = ((struct ufs1_dinode *)blkbuf)[n]; + memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, + sizeof(struct ufs1_dinode)); #elif defined(UFS2_ONLY) - dp2 = ((struct ufs2_dinode *)blkbuf)[n]; + memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, + sizeof(struct ufs2_dinode)); #else if (fs->fs_magic == FS_UFS1_MAGIC) - dp1 = ((struct ufs1_dinode *)blkbuf)[n]; + memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, + sizeof(struct ufs1_dinode)); else - dp2 = ((struct ufs2_dinode *)blkbuf)[n]; + memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, + sizeof(struct ufs2_dinode)); + #endif inomap = inode; fs_off = 0; From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 12:58:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6174A1065698; Tue, 24 Aug 2010 12:58:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36AD38FC1C; Tue, 24 Aug 2010 12:58:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OCwtm5076653; Tue, 24 Aug 2010 12:58:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OCwtWq076649; Tue, 24 Aug 2010 12:58:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008241258.o7OCwtWq076649@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 24 Aug 2010 12:58:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211748 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 12:58:55 -0000 Author: kib Date: Tue Aug 24 12:58:54 2010 New Revision: 211748 URL: http://svn.freebsd.org/changeset/base/211748 Log: Move the __stack_chk_fail_local@FBSD_1.0 compat symbol definition into the separate .o for libc_pic.a. This prevents rtld from making the symbol global. Putting the stack_protector_compat.c into the public domain acknowledged by kan. Reviewed by: kan MFC after: 2 weeks Added: head/lib/libc/sys/stack_protector_compat.c (contents, props changed) Modified: head/lib/libc/sys/Makefile.inc head/lib/libc/sys/stack_protector.c Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Tue Aug 24 12:56:45 2010 (r211747) +++ head/lib/libc/sys/Makefile.inc Tue Aug 24 12:58:54 2010 (r211748) @@ -18,7 +18,7 @@ .endif # Sources common to both syscall interfaces: -SRCS+= stack_protector.c __error.c +SRCS+= stack_protector.c stack_protector_compat.c __error.c .if !defined(WITHOUT_SYSCALL_COMPAT) SRCS+= fcntl.c ftruncate.c lseek.c mmap.c pread.c pwrite.c truncate.c PSEUDO+= _fcntl.o Modified: head/lib/libc/sys/stack_protector.c ============================================================================== --- head/lib/libc/sys/stack_protector.c Tue Aug 24 12:56:45 2010 (r211747) +++ head/lib/libc/sys/stack_protector.c Tue Aug 24 12:58:54 2010 (r211748) @@ -116,8 +116,6 @@ __chk_fail(void) __fail("buffer overflow detected; terminated"); } -#ifdef PIC -__sym_compat(__stack_chk_fail_local, __stack_chk_fail, FBSD_1.0); -#else +#ifndef PIC __weak_reference(__stack_chk_fail, __stack_chk_fail_local); #endif Added: head/lib/libc/sys/stack_protector_compat.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/sys/stack_protector_compat.c Tue Aug 24 12:58:54 2010 (r211748) @@ -0,0 +1,20 @@ +/* + * Written by Alexander Kabaev + * The file is in public domain. + */ + +#include +__FBSDID("$FreeBSD$"); + +void __stack_chk_fail(void); + +#ifdef PIC +void +__stack_chk_fail_local_hidden(void) +{ + + __stack_chk_fail(); +} + +__sym_compat(__stack_chk_fail_local, __stack_chk_fail_local_hidden, FBSD_1.0); +#endif From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 13:01:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C57941065674; Tue, 24 Aug 2010 13:01:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2B5E8FC19; Tue, 24 Aug 2010 13:01:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OD1EfK076759; Tue, 24 Aug 2010 13:01:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OD1E5s076757; Tue, 24 Aug 2010 13:01:14 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008241301.o7OD1E5s076757@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 24 Aug 2010 13:01:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211749 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 13:01:15 -0000 Author: kib Date: Tue Aug 24 13:01:14 2010 New Revision: 211749 URL: http://svn.freebsd.org/changeset/base/211749 Log: Remove exports table. Export control by the version script is enough. Reviewed by: kan MFC after: 3 weeks Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Aug 24 12:58:54 2010 (r211748) +++ head/libexec/rtld-elf/rtld.c Tue Aug 24 13:01:14 2010 (r211749) @@ -104,7 +104,6 @@ static void init_dag1(Obj_Entry *, Obj_E static void init_rtld(caddr_t, Elf_Auxinfo **); static void initlist_add_neededs(Needed_Entry *, Objlist *); static void initlist_add_objects(Obj_Entry *, Obj_Entry **, Objlist *); -static bool is_exported(const Elf_Sym *); static void linkmap_add(Obj_Entry *); static void linkmap_delete(Obj_Entry *); static int load_needed_objects(Obj_Entry *, int); @@ -197,36 +196,6 @@ extern Elf_Dyn _DYNAMIC; int osreldate, pagesize; /* - * These are the functions the dynamic linker exports to application - * programs. They are the only symbols the dynamic linker is willing - * to export from itself. - */ -static func_ptr_type exports[] = { - (func_ptr_type) &_rtld_error, - (func_ptr_type) &dlclose, - (func_ptr_type) &dlerror, - (func_ptr_type) &dlopen, - (func_ptr_type) &dlsym, - (func_ptr_type) &dlfunc, - (func_ptr_type) &dlvsym, - (func_ptr_type) &dladdr, - (func_ptr_type) &dllockinit, - (func_ptr_type) &dlinfo, - (func_ptr_type) &_rtld_thread_init, -#ifdef __i386__ - (func_ptr_type) &___tls_get_addr, -#endif - (func_ptr_type) &__tls_get_addr, - (func_ptr_type) &_rtld_allocate_tls, - (func_ptr_type) &_rtld_free_tls, - (func_ptr_type) &dl_iterate_phdr, - (func_ptr_type) &_rtld_atfork_pre, - (func_ptr_type) &_rtld_atfork_post, - (func_ptr_type) &_rtld_addr_phdr, - NULL -}; - -/* * Global declarations normally provided by crt1. The dynamic linker is * not built with crt1, so we have to provide them ourselves. */ @@ -1445,19 +1414,6 @@ initlist_add_objects(Obj_Entry *obj, Obj #define FPTR_TARGET(f) ((Elf_Addr) (f)) #endif -static bool -is_exported(const Elf_Sym *def) -{ - Elf_Addr value; - const func_ptr_type *p; - - value = (Elf_Addr)(obj_rtld.relocbase + def->st_value); - for (p = exports; *p != NULL; p++) - if (FPTR_TARGET(*p) == value) - return true; - return false; -} - /* * Given a shared object, traverse its list of needed objects, and load * each of them. Returns 0 on success. Generates an error message and @@ -2161,12 +2117,11 @@ do_dlsym(void *handle, const char *name, /* * Search the dynamic linker itself, and possibly resolve the * symbol from there. This is how the application links to - * dynamic linker services such as dlopen. Only the values listed - * in the "exports" array can be resolved from the dynamic linker. + * dynamic linker services such as dlopen. */ if (def == NULL || ELF_ST_BIND(def->st_info) == STB_WEAK) { symp = symlook_obj(name, hash, &obj_rtld, ve, flags); - if (symp != NULL && is_exported(symp)) { + if (symp != NULL) { def = symp; defobj = &obj_rtld; } @@ -2746,12 +2701,11 @@ symlook_default(const char *name, unsign /* * Search the dynamic linker itself, and possibly resolve the * symbol from there. This is how the application links to - * dynamic linker services such as dlopen. Only the values listed - * in the "exports" array can be resolved from the dynamic linker. + * dynamic linker services such as dlopen. */ if (def == NULL || ELF_ST_BIND(def->st_info) == STB_WEAK) { symp = symlook_obj(name, hash, &obj_rtld, ventry, flags); - if (symp != NULL && is_exported(symp)) { + if (symp != NULL) { def = symp; defobj = &obj_rtld; } From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 13:02:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B30F81065694; Tue, 24 Aug 2010 13:02:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2D6C8FC1A; Tue, 24 Aug 2010 13:02:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OD2Mqa076814; Tue, 24 Aug 2010 13:02:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OD2MIb076812; Tue, 24 Aug 2010 13:02:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008241302.o7OD2MIb076812@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 24 Aug 2010 13:02:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211750 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 13:02:22 -0000 Author: kib Date: Tue Aug 24 13:02:22 2010 New Revision: 211750 URL: http://svn.freebsd.org/changeset/base/211750 Log: Remove extra FreeBSD tag. MFC after: 3 days Modified: head/lib/libc/sys/stack_protector.c Modified: head/lib/libc/sys/stack_protector.c ============================================================================== --- head/lib/libc/sys/stack_protector.c Tue Aug 24 13:01:14 2010 (r211749) +++ head/lib/libc/sys/stack_protector.c Tue Aug 24 13:02:22 2010 (r211750) @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /* $NetBSD: stack_protector.c,v 1.4 2006/11/22 17:23:25 christos Exp $ */ /* $OpenBSD: stack_protector.c,v 1.10 2006/03/31 05:34:44 deraadt Exp $ */ /* From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 13:11:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36C2B1065698; Tue, 24 Aug 2010 13:11:25 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 267BA8FC0C; Tue, 24 Aug 2010 13:11:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7ODBPGl077039; Tue, 24 Aug 2010 13:11:25 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7ODBPrD077037; Tue, 24 Aug 2010 13:11:25 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008241311.o7ODBPrD077037@svn.freebsd.org> From: Rui Paulo Date: Tue, 24 Aug 2010 13:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211751 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 13:11:25 -0000 Author: rpaulo Date: Tue Aug 24 13:11:24 2010 New Revision: 211751 URL: http://svn.freebsd.org/changeset/base/211751 Log: Add a trap code for DTrace induced traps. Sponsored by: The FreeBSD Foundation Modified: head/sys/sys/signal.h Modified: head/sys/sys/signal.h ============================================================================== --- head/sys/sys/signal.h Tue Aug 24 13:02:22 2010 (r211750) +++ head/sys/sys/signal.h Tue Aug 24 13:11:24 2010 (r211751) @@ -266,6 +266,7 @@ typedef struct __siginfo { /* codes for SIGTRAP */ #define TRAP_BRKPT 1 /* Process breakpoint. */ #define TRAP_TRACE 2 /* Process trace trap. */ +#define TRAP_DTRACE 3 /* DTrace induced trap. */ /* codes for SIGCHLD */ #define CLD_EXITED 1 /* Child has exited */ From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 13:13:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6ACE106566B; Tue, 24 Aug 2010 13:13:24 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5EBA8FC18; Tue, 24 Aug 2010 13:13:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7ODDOKV077119; Tue, 24 Aug 2010 13:13:24 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7ODDOQG077116; Tue, 24 Aug 2010 13:13:24 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008241313.o7ODDOQG077116@svn.freebsd.org> From: Rui Paulo Date: Tue, 24 Aug 2010 13:13:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211752 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 13:13:25 -0000 Author: rpaulo Date: Tue Aug 24 13:13:24 2010 New Revision: 211752 URL: http://svn.freebsd.org/changeset/base/211752 Log: Add two DTrace trap type values. Used by fasttrap. Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/include/trap.h head/sys/i386/include/trap.h Modified: head/sys/amd64/include/trap.h ============================================================================== --- head/sys/amd64/include/trap.h Tue Aug 24 13:11:24 2010 (r211751) +++ head/sys/amd64/include/trap.h Tue Aug 24 13:13:24 2010 (r211752) @@ -62,6 +62,8 @@ #define T_MCHK 28 /* machine check trap */ #define T_XMMFLT 29 /* SIMD floating-point exception */ #define T_RESERVED 30 /* reserved (unknown) */ +#define T_DTRACE_RET 31 /* DTrace pid return */ +#define T_DTRACE_PROBE 32 /* DTrace fasttrap probe */ /* XXX most of the following codes aren't used, but could be. */ Modified: head/sys/i386/include/trap.h ============================================================================== --- head/sys/i386/include/trap.h Tue Aug 24 13:11:24 2010 (r211751) +++ head/sys/i386/include/trap.h Tue Aug 24 13:13:24 2010 (r211752) @@ -62,6 +62,8 @@ #define T_MCHK 28 /* machine check trap */ #define T_XMMFLT 29 /* SIMD floating-point exception */ #define T_RESERVED 30 /* reserved (unknown) */ +#define T_DTRACE_RET 31 /* DTrace pid return */ +#define T_DTRACE_PROBE 32 /* DTrace fasttrap probe */ /* XXX most of the following codes aren't used, but could be. */ From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 13:21:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F0F910656A8; Tue, 24 Aug 2010 13:21:06 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7EB08FC13; Tue, 24 Aug 2010 13:21:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7ODL5tt077316; Tue, 24 Aug 2010 13:21:05 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7ODL5om077313; Tue, 24 Aug 2010 13:21:05 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008241321.o7ODL5om077313@svn.freebsd.org> From: Rui Paulo Date: Tue, 24 Aug 2010 13:21:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211753 - in head/sys/modules/dtrace: . dtraceall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 13:21:06 -0000 Author: rpaulo Date: Tue Aug 24 13:21:05 2010 New Revision: 211753 URL: http://svn.freebsd.org/changeset/base/211753 Log: Enable fasttrap and make dtraceall depend on fasttrap when building i386 or amd64. Sponsored by: The FreeBSD Foundation > Description of fields to fill in above: 76 columns --| > PR: If a GNATS PR is affected by the change. > Submitted by: If someone else sent in the change. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > Security: Vulnerability reference (one per line) or description. > Empty fields above will be automatically removed. M dtrace/dtraceall/dtraceall.c M dtrace/Makefile Modified: head/sys/modules/dtrace/Makefile head/sys/modules/dtrace/dtraceall/dtraceall.c Modified: head/sys/modules/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/Makefile Tue Aug 24 13:13:24 2010 (r211752) +++ head/sys/modules/dtrace/Makefile Tue Aug 24 13:21:05 2010 (r211753) @@ -15,7 +15,7 @@ SUBDIR= dtmalloc \ systrace .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" -SUBDIR+= fbt +SUBDIR+= fasttrap fbt .endif .include Modified: head/sys/modules/dtrace/dtraceall/dtraceall.c ============================================================================== --- head/sys/modules/dtrace/dtraceall/dtraceall.c Tue Aug 24 13:13:24 2010 (r211752) +++ head/sys/modules/dtrace/dtraceall/dtraceall.c Tue Aug 24 13:21:05 2010 (r211753) @@ -68,6 +68,7 @@ MODULE_DEPEND(dtraceall, dtmalloc, 1, 1, MODULE_DEPEND(dtraceall, dtnfsclient, 1, 1, 1); #if defined(__amd64__) || defined(__i386__) MODULE_DEPEND(dtraceall, fbt, 1, 1, 1); +MODULE_DEPEND(dtraceall, fasttrap, 1, 1, 1); #endif MODULE_DEPEND(dtraceall, lockstat, 1, 1, 1); MODULE_DEPEND(dtraceall, sdt, 1, 1, 1); From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 13:38:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77C2F1065695; Tue, 24 Aug 2010 13:38:53 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 62EF58FC08; Tue, 24 Aug 2010 13:38:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7ODcroU077793; Tue, 24 Aug 2010 13:38:53 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7ODcr1T077789; Tue, 24 Aug 2010 13:38:53 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008241338.o7ODcr1T077789@svn.freebsd.org> From: Rui Paulo Date: Tue, 24 Aug 2010 13:38:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211755 - in head/contrib/libstdc++: include/ext src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 13:38:53 -0000 Author: rpaulo Date: Tue Aug 24 13:38:53 2010 New Revision: 211755 URL: http://svn.freebsd.org/changeset/base/211755 Log: Some fixes so we can build libstdc++ with clang: o Make the value_type, vector_type, iterator, __mutex_type types of free_list class so we can access them o In some cases template keywords must be inserted to treat classes as dependent template names o Remove two 'inline' keywords where they do not make sense Submitted by: Dimitry Andric Reviewed by: trema Modified: head/contrib/libstdc++/include/ext/bitmap_allocator.h head/contrib/libstdc++/include/ext/ropeimpl.h head/contrib/libstdc++/src/locale-inst.cc Modified: head/contrib/libstdc++/include/ext/bitmap_allocator.h ============================================================================== --- head/contrib/libstdc++/include/ext/bitmap_allocator.h Tue Aug 24 13:22:01 2010 (r211754) +++ head/contrib/libstdc++/include/ext/bitmap_allocator.h Tue Aug 24 13:38:53 2010 (r211755) @@ -549,11 +549,13 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) */ class free_list { + public: typedef size_t* value_type; typedef __detail::__mini_vector vector_type; typedef vector_type::iterator iterator; typedef __mutex __mutex_type; + private: struct _LT_pointer_compare { bool Modified: head/contrib/libstdc++/include/ext/ropeimpl.h ============================================================================== --- head/contrib/libstdc++/include/ext/ropeimpl.h Tue Aug 24 13:22:01 2010 (r211754) +++ head/contrib/libstdc++/include/ext/ropeimpl.h Tue Aug 24 13:38:53 2010 (r211755) @@ -382,7 +382,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) { _Rope_RopeLeaf<_CharT, _Alloc>* __l = (_Rope_RopeLeaf<_CharT, _Alloc>*)this; - __l->_Rope_RopeLeaf<_CharT, _Alloc>::~_Rope_RopeLeaf(); + __l->template _Rope_RopeLeaf<_CharT, _Alloc>::~_Rope_RopeLeaf(); _L_deallocate(__l, 1); break; } @@ -390,7 +390,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) { _Rope_RopeConcatenation<_CharT,_Alloc>* __c = (_Rope_RopeConcatenation<_CharT, _Alloc>*)this; - __c->_Rope_RopeConcatenation<_CharT, _Alloc>:: + __c->template _Rope_RopeConcatenation<_CharT, _Alloc>:: ~_Rope_RopeConcatenation(); _C_deallocate(__c, 1); break; @@ -399,7 +399,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) { _Rope_RopeFunction<_CharT, _Alloc>* __f = (_Rope_RopeFunction<_CharT, _Alloc>*)this; - __f->_Rope_RopeFunction<_CharT, _Alloc>::~_Rope_RopeFunction(); + __f->template _Rope_RopeFunction<_CharT, _Alloc>::~_Rope_RopeFunction(); _F_deallocate(__f, 1); break; } @@ -407,7 +407,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) { _Rope_RopeSubstring<_CharT, _Alloc>* __ss = (_Rope_RopeSubstring<_CharT, _Alloc>*)this; - __ss->_Rope_RopeSubstring<_CharT, _Alloc>:: + __ss->template _Rope_RopeSubstring<_CharT, _Alloc>:: ~_Rope_RopeSubstring(); _S_deallocate(__ss, 1); break; @@ -433,7 +433,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) { size_t __old_len = __r->_M_size; _CharT* __new_data = (_CharT*) - _Data_allocate(_S_rounded_up_size(__old_len + __len)); + _Rope_rep_base<_CharT, _Alloc>::_Data_allocate(_S_rounded_up_size(__old_len + __len)); _RopeLeaf* __result; uninitialized_copy_n(__r->_M_data, __old_len, __new_data); @@ -817,7 +817,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) if (__result_len > __lazy_threshold) goto lazy; __section = (_CharT*) - _Data_allocate(_S_rounded_up_size(__result_len)); + _Rope_rep_base<_CharT, _Alloc>::_Data_allocate(_S_rounded_up_size(__result_len)); try { (*(__f->_M_fn))(__start, __result_len, __section); } catch(...) Modified: head/contrib/libstdc++/src/locale-inst.cc ============================================================================== --- head/contrib/libstdc++/src/locale-inst.cc Tue Aug 24 13:22:01 2010 (r211754) +++ head/contrib/libstdc++/src/locale-inst.cc Tue Aug 24 13:38:53 2010 (r211755) @@ -180,11 +180,11 @@ _GLIBCXX_END_LDBL_NAMESPACE template class messages_byname; // ctype - inline template class __ctype_abstract_base; + template class __ctype_abstract_base; template class ctype_byname; // codecvt - inline template class __codecvt_abstract_base; + template class __codecvt_abstract_base; template class codecvt_byname; // collate From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 14:03:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F18581065673; Tue, 24 Aug 2010 14:03:55 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id B3F818FC0A; Tue, 24 Aug 2010 14:03:55 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:786b:92c8:74d6:de20] (unknown [IPv6:2001:7b8:3a7:0:786b:92c8:74d6:de20]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 799885C59; Tue, 24 Aug 2010 16:03:54 +0200 (CEST) Message-ID: <4C73D152.7030501@andric.com> Date: Tue, 24 Aug 2010 16:04:02 +0200 From: Dimitry Andric User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.9pre) Gecko/20100814 Lanikai/3.1.3pre MIME-Version: 1.0 To: Rui Paulo References: <201008241338.o7ODcr1T077789@svn.freebsd.org> In-Reply-To: <201008241338.o7ODcr1T077789@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211755 - in head/contrib/libstdc++: include/ext src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 14:03:56 -0000 On 2010-08-24 15:38, Rui Paulo wrote: > Some fixes so we can build libstdc++ with clang: > o Make the value_type, vector_type, iterator, __mutex_type types of > free_list class so we can access them That should have been: o Make the value_type, vector_type, iterator, __mutex_type types of free_list class public, so we can access them From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 16:08:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EA1510656A4; Tue, 24 Aug 2010 16:08:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F247E8FC16; Tue, 24 Aug 2010 16:08:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OG810M081013; Tue, 24 Aug 2010 16:08:01 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OG814P081011; Tue, 24 Aug 2010 16:08:01 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201008241608.o7OG814P081011@svn.freebsd.org> From: Alexander Motin Date: Tue, 24 Aug 2010 16:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211756 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 16:08:02 -0000 Author: mav Date: Tue Aug 24 16:08:01 2010 New Revision: 211756 URL: http://svn.freebsd.org/changeset/base/211756 Log: Enable timer interrupt before starting timer. This allows to handle very short periods without interrupt loss. Modified: head/sys/x86/x86/local_apic.c Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Tue Aug 24 13:38:53 2010 (r211755) +++ head/sys/x86/x86/local_apic.c Tue Aug 24 16:08:01 2010 (r211756) @@ -369,12 +369,13 @@ lapic_setup(int boot) if (la->la_timer_mode != 0) { KASSERT(la->la_timer_period != 0, ("lapic%u: zero divisor", lapic_id())); + lapic_timer_stop(); lapic_timer_set_divisor(lapic_timer_divisor); + lapic_timer_enable_intr(); if (la->la_timer_mode == 1) lapic_timer_periodic(la->la_timer_period); else lapic_timer_oneshot(la->la_timer_period); - lapic_timer_enable_intr(); } /* Program error LVT and clear any existing errors. */ @@ -505,12 +506,10 @@ lapic_et_start(struct eventtimer *et, et->et_max_period.frac = ((0xfffffffeLLU << 32) / et->et_frequency) << 32; } - la = &lapics[lapic_id()]; - /* - * Start up the timer on the BSP. The APs will kick off their - * timer during lapic_setup(). - */ + lapic_timer_stop(); lapic_timer_set_divisor(lapic_timer_divisor); + lapic_timer_enable_intr(); + la = &lapics[lapic_id()]; if (period != NULL) { la->la_timer_mode = 1; la->la_timer_period = @@ -526,7 +525,6 @@ lapic_et_start(struct eventtimer *et, la->la_timer_period += et->et_frequency * first->sec; lapic_timer_oneshot(la->la_timer_period); } - lapic_timer_enable_intr(); return (0); } @@ -862,8 +860,9 @@ lapic_timer_stop(void) value = lapic->lvt_timer; value &= ~APIC_LVTT_TM; - value &= ~APIC_LVT_M; + value |= APIC_LVT_M; lapic->lvt_timer = value; + lapic->icr_timer = 0; } static void From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 16:29:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A336C1065679; Tue, 24 Aug 2010 16:29:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 936398FC08; Tue, 24 Aug 2010 16:29:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OGT992081534; Tue, 24 Aug 2010 16:29:09 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OGT9DU081532; Tue, 24 Aug 2010 16:29:09 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008241629.o7OGT9DU081532@svn.freebsd.org> From: Warner Losh Date: Tue, 24 Aug 2010 16:29:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211758 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 16:29:09 -0000 Author: imp Date: Tue Aug 24 16:29:09 2010 New Revision: 211758 URL: http://svn.freebsd.org/changeset/base/211758 Log: The order was correct before. I'd talked to Nathan about this before, so this must have been mismerged into tbemd before I merged it back to head. This unbreaks this on powerpc64 Submitted by: nathanw@ Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Aug 24 16:11:12 2010 (r211757) +++ head/Makefile.inc1 Tue Aug 24 16:29:09 2010 (r211758) @@ -1131,12 +1131,10 @@ _prereq_libs= gnu/lib/libssp/libssp_nons # all shared libraries for ELF. # _startup_libs= gnu/lib/csu -.if exists(${.CURDIR}/lib/csu/${MACHINE_CPUARCH}-elf) -_startup_libs+= lib/csu/${MACHINE_CPUARCH}-elf +.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf) +_startup_libs+= lib/csu/${MACHINE_ARCH}-elf .elif exists(${.CURDIR}/lib/csu/${MACHINE_CPUARCH}-elf) _startup_libs+= lib/csu/${MACHINE_CPUARCH}-elf -.elif exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}) -_startup_libs+= lib/csu/${MACHINE_ARCH} .else _startup_libs+= lib/csu/${MACHINE_CPUARCH} .endif From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 16:35:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8FA71065693; Tue, 24 Aug 2010 16:35:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8EFE8FC1A; Tue, 24 Aug 2010 16:35:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OGZQeK081710; Tue, 24 Aug 2010 16:35:26 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OGZQIM081708; Tue, 24 Aug 2010 16:35:26 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008241635.o7OGZQIM081708@svn.freebsd.org> From: Warner Losh Date: Tue, 24 Aug 2010 16:35:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211759 - head/lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 16:35:26 -0000 Author: imp Date: Tue Aug 24 16:35:26 2010 New Revision: 211759 URL: http://svn.freebsd.org/changeset/base/211759 Log: Change the logic here to match Makefile.inc1. Having it in two places suggests an opportunity for refactoring :) Submitted by: nathanw@ Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Tue Aug 24 16:29:09 2010 (r211758) +++ head/lib/Makefile Tue Aug 24 16:35:26 2010 (r211759) @@ -112,7 +112,9 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_bind} \ ${_clang} -.if exists(${.CURDIR}/csu/${MACHINE_CPUARCH}-elf) +.if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf) +_csu=csu/${MACHINE_ARCH}-elf +.elif exists(${.CURDIR}/csu/${MACHINE_CPUARCH}-elf) _csu=csu/${MACHINE_CPUARCH}-elf .elif exists(${.CURDIR}/csu/${MACHINE_CPUARCH}/Makefile) _csu=csu/${MACHINE_CPUARCH} From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 17:46:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 678501065695; Tue, 24 Aug 2010 17:46:43 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 561498FC16; Tue, 24 Aug 2010 17:46:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OHkh2N083228; Tue, 24 Aug 2010 17:46:43 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OHkhki083226; Tue, 24 Aug 2010 17:46:43 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201008241746.o7OHkhki083226@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 24 Aug 2010 17:46:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211760 - stable/8/bin/ps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 17:46:43 -0000 Author: trasz Date: Tue Aug 24 17:46:43 2010 New Revision: 211760 URL: http://svn.freebsd.org/changeset/base/211760 Log: MFC r210448: Fix alignment for the 'flags' label, and make more room for 'tdev'. Modified: stable/8/bin/ps/keyword.c Directory Properties: stable/8/bin/ps/ (props changed) Modified: stable/8/bin/ps/keyword.c ============================================================================== --- stable/8/bin/ps/keyword.c Tue Aug 24 16:35:26 2010 (r211759) +++ stable/8/bin/ps/keyword.c Tue Aug 24 17:46:43 2010 (r211760) @@ -89,7 +89,7 @@ static VAR var[] = { {"emul", "EMUL", NULL, LJUST, emulname, NULL, EMULLEN, 0, CHAR, NULL, 0}, {"etime", "ELAPSED", NULL, USER, elapsed, NULL, 12, 0, CHAR, NULL, 0}, - {"f", "F", NULL, 0, kvar, NULL, 7, KOFF(ki_flag), INT, "x", 0}, + {"f", "F", NULL, 0, kvar, NULL, 8, KOFF(ki_flag), INT, "x", 0}, {"flags", "", "f", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, {"ignored", "", "sigignore", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, {"inblk", "INBLK", NULL, USER, rvar, NULL, 4, ROFF(ru_inblock), LONG, @@ -186,7 +186,7 @@ static VAR var[] = { UINT, UIDFMT, 0}, {"svuid", "SVUID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_svuid), UINT, UIDFMT, 0}, - {"tdev", "TDEV", NULL, 0, tdev, NULL, 4, 0, CHAR, NULL, 0}, + {"tdev", "TDEV", NULL, 0, tdev, NULL, 5, 0, CHAR, NULL, 0}, {"tdnam", "TDNAM", NULL, LJUST, tdnam, NULL, COMMLEN, 0, CHAR, NULL, 0}, {"time", "TIME", NULL, USER, cputime, NULL, 9, 0, CHAR, NULL, 0}, {"tpgid", "TPGID", NULL, 0, kvar, NULL, 4, KOFF(ki_tpgid), UINT, From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 17:47:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2947E1065694; Tue, 24 Aug 2010 17:47:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 172D58FC0C; Tue, 24 Aug 2010 17:47:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OHlq2d083309; Tue, 24 Aug 2010 17:47:52 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OHlqjV083307; Tue, 24 Aug 2010 17:47:52 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201008241747.o7OHlqjV083307@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 24 Aug 2010 17:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211761 - stable/8/bin/ps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 17:47:53 -0000 Author: trasz Date: Tue Aug 24 17:47:52 2010 New Revision: 211761 URL: http://svn.freebsd.org/changeset/base/211761 Log: MFC r210447: Add P_HASTHREADS flag description. Modified: stable/8/bin/ps/ps.1 Directory Properties: stable/8/bin/ps/ (props changed) Modified: stable/8/bin/ps/ps.1 ============================================================================== --- stable/8/bin/ps/ps.1 Tue Aug 24 17:46:43 2010 (r211760) +++ stable/8/bin/ps/ps.1 Tue Aug 24 17:47:52 2010 (r211761) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd April 13, 2010 +.Dd July 24, 2010 .Dt PS 1 .Os .Sh NAME @@ -291,6 +291,7 @@ the include file .It Dv "P_PPWAIT" Ta No "0x00010 Parent is waiting for child to exec/exit" .It Dv "P_PROFIL" Ta No "0x00020 Has started profiling" .It Dv "P_STOPPROF" Ta No "0x00040 Has thread in requesting to stop prof" +.It Dv "P_HASTHREADS" Ta No "0x00080 Has had threads (no cleanup shortcuts)" .It Dv "P_SUGID" Ta No "0x00100 Had set id privileges since last exec" .It Dv "P_SYSTEM" Ta No "0x00200 System proc: no sigs, stats or swapping" .It Dv "P_SINGLE_EXIT" Ta No "0x00400 Threads suspending should exit, not wait" From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 17:48:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60AB010656AC; Tue, 24 Aug 2010 17:48:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FF588FC0C; Tue, 24 Aug 2010 17:48:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OHmM3T083359; Tue, 24 Aug 2010 17:48:22 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OHmM46083357; Tue, 24 Aug 2010 17:48:22 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201008241748.o7OHmM46083357@svn.freebsd.org> From: Andriy Gapon Date: Tue, 24 Aug 2010 17:48:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211762 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 17:48:22 -0000 Author: avg Date: Tue Aug 24 17:48:22 2010 New Revision: 211762 URL: http://svn.freebsd.org/changeset/base/211762 Log: zfs arc_reclaim_thread: no need to call arc_reclaim_needed when resetting needfree needfree is checked at the very start of arc_reclaim_needed. This change makes code easier to follow and maintain in face of potential changed in arc_reclaim_needed. Also, put the whole sub-block under _KERNEL because needfree can be set only in kernel code. To do: rename needfree to something else to aovid confusion with OpenSolaris global variable of the same name which is used in the same code, but has different meaning (page deficit). Note: I have an impression that locking around accesses to this variable as well as mutual notifications between arc_reclaim_thread and arc_lowmem are not proper. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Aug 24 17:47:52 2010 (r211761) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Aug 24 17:48:22 2010 (r211762) @@ -2317,12 +2317,12 @@ arc_reclaim_thread(void *dummy __unused) if (arc_eviction_list != NULL) arc_do_user_evicts(); - if (arc_reclaim_needed()) { - needfree = 0; #ifdef _KERNEL + if (needfree) { + needfree = 0; wakeup(&needfree); -#endif } +#endif /* block until needed, or one second, whichever is shorter */ CALLB_CPR_SAFE_BEGIN(&cpr); From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 17:57:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D6CD1065693; Tue, 24 Aug 2010 17:57:57 +0000 (UTC) (envelope-from prvs=18452e48d6=brian@FreeBSD.org) Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) by mx1.freebsd.org (Postfix) with ESMTP id 29D168FC19; Tue, 24 Aug 2010 17:57:56 +0000 (UTC) Received: from pd2ml3so-ssvc.prod.shaw.ca ([10.0.141.148]) by pd2mo1so-svcs.prod.shaw.ca with ESMTP; 24 Aug 2010 11:42:55 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=1h8qd3w5pbyJS47frJc7V6h9QwwiBhgsQMy9mbCO+wA= c=1 sm=1 a=VXq8tsqEoNMA:10 a=VphdPIyG4kEA:10 a=ORa4HqFjfvEA:10 a=kj9zAlcOel0A:10 a=MJPcHhXccCG8eBs0us8XwA==:17 a=MMwg4So0AAAA:8 a=6I5d2MoRAAAA:8 a=ewjxO-GcL1C7YubkKKgA:9 a=2myJdMm-X2qSscJqIk0A:7 a=l25c9elb4Vz6ucGck8InoVQsdIsA:4 a=CjuIK1q_8ugA:10 a=WJ3hkfHDukgA:10 a=SV7veod9ZcQA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO store.lan.Awfulhak.org) ([70.79.162.198]) by pd2ml3so-dmz.prod.shaw.ca with ESMTP; 24 Aug 2010 11:42:55 -0600 Received: from store.lan.Awfulhak.org (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id 6B889C433AC_C74043BB; Tue, 24 Aug 2010 17:41:15 +0000 (GMT) Received: from gw.Awfulhak.org (gw.lan.Awfulhak.org [172.16.0.1]) by store.lan.Awfulhak.org (Sophos Email Appliance) with ESMTP id DF96DC460F7_C740437F; Tue, 24 Aug 2010 17:41:11 +0000 (GMT) Received: from localhost (brian@gw.lan.Awfulhak.org [172.16.0.1]) by gw.Awfulhak.org (8.14.4/8.14.4) with ESMTP id o7OHfBDT046997; Tue, 24 Aug 2010 10:41:11 -0700 (PDT) (envelope-from brian@FreeBSD.org) Date: Tue, 24 Aug 2010 10:43:07 -0700 From: Brian Somers To: Jilles Tjoelker Message-ID: <20100824104307.54ca6c2a@FreeBSD.org> In-Reply-To: <20100823215850.GC67671@stack.nl> References: <201008221104.o7MB4Ung001538@svn.freebsd.org> <20100823003314.57d41b94@dev.lan.Awfulhak.org> <20100823215850.GC67671@stack.nl> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; i386-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r211609 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 17:57:57 -0000 On Mon, 23 Aug 2010 23:58:50 +0200, Jilles Tjoelker wrote: [.....] > > > ============================================================================== > > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > > +++ head/tools/regression/bin/sh/builtins/break3.0 Sun Aug 22 11:04:30 2010 (r211609) > > > @@ -0,0 +1,15 @@ > > > +# $FreeBSD$ > > > + > > > +# We accept this and people might rely on it. > > > +# However, various other shells do not accept it. > > > + > > > +f() { > > > + break > > > + echo bad1 > > > +} > > > + > > > +while :; do > > > + f > > > + echo bad2 > > > + exit 2 > > > +done [.....] > > Having said that, this behaviour is the same in bash except that bash > > will complain if it's asked to break when the context is wrong, > > perhaps we should complain too? [.....] > Warning messages to stderr mostly get lost in the noise, I don't really > like them. I do not expect people to test for failure of break and > continue, and bash even sets $? to 0 despite printing a warning. If this > error is so important as to need an error message I think should abort > the shell as well (via error(), so that "command break" will avoid > aborting). > > Furthermore note that bash disables these warnings in POSIX mode. [.....] I agree then, no error seems like the right thing to do. Thanks. -- Brian Somers Don't _EVER_ lose your sense of humour ! From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 18:08:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B0E710656A4; Tue, 24 Aug 2010 18:08:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E439A8FC16; Tue, 24 Aug 2010 18:07:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OI7xAe083814; Tue, 24 Aug 2010 18:07:59 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OI7xHF083812; Tue, 24 Aug 2010 18:07:59 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201008241807.o7OI7xHF083812@svn.freebsd.org> From: Alexander Motin Date: Tue, 24 Aug 2010 18:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211763 - head/usr.sbin/acpi/acpiconf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 18:08:00 -0000 Author: mav Date: Tue Aug 24 18:07:59 2010 New Revision: 211763 URL: http://svn.freebsd.org/changeset/base/211763 Log: When ACPI reports current battery consumption rate in mAmps, print it also in mWatts. Values in mAmps are not always suitable, because they depend on battery voltage, which depends on battery type and charge level. Modified: head/usr.sbin/acpi/acpiconf/acpiconf.c Modified: head/usr.sbin/acpi/acpiconf/acpiconf.c ============================================================================== --- head/usr.sbin/acpi/acpiconf/acpiconf.c Tue Aug 24 17:48:22 2010 (r211762) +++ head/usr.sbin/acpi/acpiconf/acpiconf.c Tue Aug 24 18:07:59 2010 (r211763) @@ -86,7 +86,8 @@ acpi_battinfo(int num) { union acpi_battery_ioctl_arg battio; const char *pwr_units; - int hours, min; + int hours, min, amp; + uint32_t volt; if (num < 0 || num > 64) err(EX_USAGE, "invalid battery %d", num); @@ -95,11 +96,8 @@ acpi_battinfo(int num) battio.unit = num; if (ioctl(acpifd, ACPIIO_BATT_GET_BIF, &battio) == -1) err(EX_IOERR, "get battery info (%d) failed", num); - if (battio.bif.units == 0) - pwr_units = "mW"; - else - pwr_units = "mA"; - + amp = battio.bif.units; + pwr_units = amp ? "mA" : "mW"; if (battio.bif.dcap == UNKNOWN_CAP) printf("Design capacity:\tunknown\n"); else @@ -125,6 +123,14 @@ acpi_battinfo(int num) printf("Type:\t\t\t%s\n", battio.bif.type); printf("OEM info:\t\t%s\n", battio.bif.oeminfo); + /* Fetch battery voltage information. */ + volt = UNKNOWN_VOLTAGE; + battio.unit = num; + if (ioctl(acpifd, ACPIIO_BATT_GET_BST, &battio) == -1) + err(EX_IOERR, "get battery status (%d) failed", num); + if (battio.bst.state != ACPI_BATT_STAT_NOT_PRESENT) + volt = battio.bst.volt; + /* Print current battery state information. */ battio.unit = num; if (ioctl(acpifd, ACPIIO_BATT_GET_BATTINFO, &battio) == -1) @@ -154,22 +160,21 @@ acpi_battinfo(int num) } if (battio.battinfo.rate == -1) printf("Present rate:\t\tunknown\n"); - else + else if (amp && volt != UNKNOWN_VOLTAGE) { + printf("Present rate:\t\t%d mA (%d mW)\n", + battio.battinfo.rate, + battio.battinfo.rate * volt / 1000); + } else printf("Present rate:\t\t%d %s\n", battio.battinfo.rate, pwr_units); } else printf("State:\t\t\tnot present\n"); /* Print battery voltage information. */ - battio.unit = num; - if (ioctl(acpifd, ACPIIO_BATT_GET_BST, &battio) == -1) - err(EX_IOERR, "get battery status (%d) failed", num); - if (battio.bst.state != ACPI_BATT_STAT_NOT_PRESENT) { - if (battio.bst.volt == UNKNOWN_VOLTAGE) - printf("Voltage:\t\tunknown\n"); - else - printf("Voltage:\t\t%d mV\n", battio.bst.volt); - } + if (volt == UNKNOWN_VOLTAGE) + printf("Present voltage:\tunknown\n"); + else + printf("Present voltage:\t%d mV\n", volt); return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 18:17:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CDC51065674; Tue, 24 Aug 2010 18:17:40 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C6968FC12; Tue, 24 Aug 2010 18:17:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OIHeCi084036; Tue, 24 Aug 2010 18:17:40 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OIHem5084034; Tue, 24 Aug 2010 18:17:40 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008241817.o7OIHem5084034@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 24 Aug 2010 18:17:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211764 - head/sys/dev/ed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 18:17:40 -0000 Author: yongari Date: Tue Aug 24 18:17:40 2010 New Revision: 211764 URL: http://svn.freebsd.org/changeset/base/211764 Log: Add PNP id for Compex RL2000. I'm not sure whether adding this logical id is correct or not because Compex RL2000 is in the list of supported hardware list. I guess the Compex RL2000 could be PCI variant while the controller in question is ISA controller. It seems PNP compat id didn't match or it had multiple compat ids so isa_pnp_probe() seemed to return ENOENT. PR: kern/80853 Modified: head/sys/dev/ed/if_ed_isa.c Modified: head/sys/dev/ed/if_ed_isa.c ============================================================================== --- head/sys/dev/ed/if_ed_isa.c Tue Aug 24 18:07:59 2010 (r211763) +++ head/sys/dev/ed/if_ed_isa.c Tue Aug 24 18:17:40 2010 (r211764) @@ -58,6 +58,7 @@ static struct isa_pnp_id ed_ids[] = { { 0x0131d805, NULL }, /* ANX3101 */ { 0x4cf48906, NULL }, /* ATIf44c */ { 0x01200507, NULL }, /* AXE2001 */ + { 0x0115180e, NULL }, /* CPX1501 */ { 0x0090252a, NULL }, /* JQE9000 */ { 0x0020832e, NULL }, /* KTC2000 */ { 0xd680d041, NULL }, /* PNP80d6 */ From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 18:40:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93B9910656A5; Tue, 24 Aug 2010 18:40:11 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 835668FC14; Tue, 24 Aug 2010 18:40:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OIeBBF084479; Tue, 24 Aug 2010 18:40:11 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OIeBj7084477; Tue, 24 Aug 2010 18:40:11 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008241840.o7OIeBj7084477@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 24 Aug 2010 18:40:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211765 - head/sys/dev/vr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 18:40:11 -0000 Author: yongari Date: Tue Aug 24 18:40:11 2010 New Revision: 211765 URL: http://svn.freebsd.org/changeset/base/211765 Log: Remove unnecessary controller reinitialization. CAM filter handling was rewritten long time ago so it should not require controller reinitialization. PR: kern/87506 Modified: head/sys/dev/vr/if_vr.c Modified: head/sys/dev/vr/if_vr.c ============================================================================== --- head/sys/dev/vr/if_vr.c Tue Aug 24 18:17:40 2010 (r211764) +++ head/sys/dev/vr/if_vr.c Tue Aug 24 18:40:11 2010 (r211765) @@ -1560,6 +1560,7 @@ vr_tick(void *xsc) sc->vr_stat.num_restart++; vr_stop(sc); vr_reset(sc); + sc->vr_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; vr_init_locked(sc); sc->vr_flags &= ~VR_F_RESTART; } @@ -2016,6 +2017,9 @@ vr_init_locked(struct vr_softc *sc) ifp = sc->vr_ifp; mii = device_get_softc(sc->vr_miibus); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + /* Cancel pending I/O and free all RX/TX buffers. */ vr_stop(sc); vr_reset(sc); @@ -2287,6 +2291,7 @@ vr_watchdog(struct vr_softc *sc) if_printf(sc->vr_ifp, "watchdog timeout " "(missed link)\n"); ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; vr_init_locked(sc); return; } @@ -2296,6 +2301,7 @@ vr_watchdog(struct vr_softc *sc) vr_stop(sc); vr_reset(sc); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; vr_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 18:44:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 511381065670; Tue, 24 Aug 2010 18:44:13 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 409968FC27; Tue, 24 Aug 2010 18:44:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OIiD6J084590; Tue, 24 Aug 2010 18:44:13 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OIiDLF084588; Tue, 24 Aug 2010 18:44:13 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008241844.o7OIiDLF084588@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 24 Aug 2010 18:44:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211766 - head/sys/dev/vr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 18:44:13 -0000 Author: yongari Date: Tue Aug 24 18:44:12 2010 New Revision: 211766 URL: http://svn.freebsd.org/changeset/base/211766 Log: vr_init_locked() will stop and reset the controller. Remove unnecessary vr_stop()/vr_reset() calls. Modified: head/sys/dev/vr/if_vr.c Modified: head/sys/dev/vr/if_vr.c ============================================================================== --- head/sys/dev/vr/if_vr.c Tue Aug 24 18:40:11 2010 (r211765) +++ head/sys/dev/vr/if_vr.c Tue Aug 24 18:44:12 2010 (r211766) @@ -1558,8 +1558,6 @@ vr_tick(void *xsc) if ((sc->vr_flags & VR_F_RESTART) != 0) { device_printf(sc->vr_dev, "restarting\n"); sc->vr_stat.num_restart++; - vr_stop(sc); - vr_reset(sc); sc->vr_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; vr_init_locked(sc); sc->vr_flags &= ~VR_F_RESTART; @@ -2299,8 +2297,6 @@ vr_watchdog(struct vr_softc *sc) ifp->if_oerrors++; if_printf(ifp, "watchdog timeout\n"); - vr_stop(sc); - vr_reset(sc); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; vr_init_locked(sc); From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 18:52:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 198F01065670; Tue, 24 Aug 2010 18:52:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2EEA8FC0A; Tue, 24 Aug 2010 18:52:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OIqOTE084770; Tue, 24 Aug 2010 18:52:24 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OIqOsK084768; Tue, 24 Aug 2010 18:52:24 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008241852.o7OIqOsK084768@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 24 Aug 2010 18:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211767 - head/sys/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 18:52:25 -0000 Author: yongari Date: Tue Aug 24 18:52:24 2010 New Revision: 211767 URL: http://svn.freebsd.org/changeset/base/211767 Log: Remove unnecessary controller reinitialization. PR: kern/87506 Modified: head/sys/pci/if_rl.c Modified: head/sys/pci/if_rl.c ============================================================================== --- head/sys/pci/if_rl.c Tue Aug 24 18:44:12 2010 (r211766) +++ head/sys/pci/if_rl.c Tue Aug 24 18:52:24 2010 (r211767) @@ -1302,6 +1302,7 @@ rl_rxeof(struct rl_softc *sc) total_len < ETHER_MIN_LEN || total_len > ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN) { ifp->if_ierrors++; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; rl_init_locked(sc); return (rx_npkts); } @@ -1413,6 +1414,7 @@ rl_txeof(struct rl_softc *sc) CSR_WRITE_4(sc, RL_TXCFG, RL_TXCFG_CONFIG); oldthresh = sc->rl_txthresh; /* error recovery */ + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; rl_init_locked(sc); /* restore original threshold */ sc->rl_txthresh = oldthresh; @@ -1606,8 +1608,10 @@ rl_poll_locked(struct ifnet *ifp, enum p /* XXX We should check behaviour on receiver stalls. */ - if (status & RL_ISR_SYSTEM_ERR) + if (status & RL_ISR_SYSTEM_ERR) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; rl_init_locked(sc); + } } return (rx_npkts); } @@ -1645,8 +1649,10 @@ rl_intr(void *arg) rl_rxeof(sc); if ((status & RL_ISR_TX_OK) || (status & RL_ISR_TX_ERR)) rl_txeof(sc); - if (status & RL_ISR_SYSTEM_ERR) + if (status & RL_ISR_SYSTEM_ERR) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; rl_init_locked(sc); + } } if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -1808,6 +1814,9 @@ rl_init_locked(struct rl_softc *sc) mii = device_get_softc(sc->rl_miibus); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + /* * Cancel pending I/O and free all RX/TX buffers. */ @@ -2036,6 +2045,7 @@ rl_watchdog(struct rl_softc *sc) rl_txeof(sc); rl_rxeof(sc); + sc->rl_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; rl_init_locked(sc); } From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 19:41:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09B31106567A; Tue, 24 Aug 2010 19:41:16 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED61A8FC15; Tue, 24 Aug 2010 19:41:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OJfFPq085858; Tue, 24 Aug 2010 19:41:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OJfFDk085856; Tue, 24 Aug 2010 19:41:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008241941.o7OJfFDk085856@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 24 Aug 2010 19:41:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211768 - head/sys/dev/age X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 19:41:16 -0000 Author: yongari Date: Tue Aug 24 19:41:15 2010 New Revision: 211768 URL: http://svn.freebsd.org/changeset/base/211768 Log: Remove unnecessary controller reinitialization. PR: kern/87506 Modified: head/sys/dev/age/if_age.c Modified: head/sys/dev/age/if_age.c ============================================================================== --- head/sys/dev/age/if_age.c Tue Aug 24 18:52:24 2010 (r211767) +++ head/sys/dev/age/if_age.c Tue Aug 24 19:41:15 2010 (r211768) @@ -1781,6 +1781,7 @@ age_watchdog(struct age_softc *sc) if ((sc->age_flags & AGE_FLAG_LINK) == 0) { if_printf(sc->age_ifp, "watchdog timeout (missed link)\n"); ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; age_init_locked(sc); return; } @@ -1793,6 +1794,7 @@ age_watchdog(struct age_softc *sc) } if_printf(sc->age_ifp, "watchdog timeout\n"); ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; age_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue(sc->age_tq, &sc->age_tx_task); @@ -1817,8 +1819,10 @@ age_ioctl(struct ifnet *ifp, u_long cmd, else if (ifp->if_mtu != ifr->ifr_mtu) { AGE_LOCK(sc); ifp->if_mtu = ifr->ifr_mtu; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; age_init_locked(sc); + } AGE_UNLOCK(sc); } break; @@ -2165,6 +2169,7 @@ age_int_task(void *arg, int pending) if ((status & INTR_DMA_WR_TO_RST) != 0) device_printf(sc->age_dev, "DMA write error! -- resetting\n"); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; age_init_locked(sc); } if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -2529,6 +2534,9 @@ age_init_locked(struct age_softc *sc) ifp = sc->age_ifp; mii = device_get_softc(sc->age_miibus); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + /* * Cancel any pending I/O. */ From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 20:50:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C67E106566C; Tue, 24 Aug 2010 20:50:09 +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 1031A8FC15; Tue, 24 Aug 2010 20:50:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OKo8YK087467; Tue, 24 Aug 2010 20:50:08 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OKo8mA087463; Tue, 24 Aug 2010 20:50:08 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201008242050.o7OKo8mA087463@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 24 Aug 2010 20:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211773 - in head/lib/libthr: . arch/powerpc arch/powerpc/include arch/powerpc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 20:50:09 -0000 Author: nwhitehorn Date: Tue Aug 24 20:50:08 2010 New Revision: 211773 URL: http://svn.freebsd.org/changeset/base/211773 Log: Unify 32-bit and 64-bit PowerPC libthr support. This reduces code duplication, and simplifies the TBEMD import. Requested by: imp Deleted: head/lib/libthr/arch/powerpc64/ Modified: head/lib/libthr/Makefile head/lib/libthr/arch/powerpc/Makefile.inc head/lib/libthr/arch/powerpc/include/pthread_md.h Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Tue Aug 24 20:45:21 2010 (r211772) +++ head/lib/libthr/Makefile Tue Aug 24 20:50:08 2010 (r211773) @@ -19,7 +19,7 @@ WARNS?= 3 CFLAGS+=-DPTHREAD_KERNEL CFLAGS+=-I${.CURDIR}/../libc/include -I${.CURDIR}/thread \ -I${.CURDIR}/../../include -CFLAGS+=-I${.CURDIR}/arch/${MACHINE_ARCH}/include +CFLAGS+=-I${.CURDIR}/arch/${MACHINE_CPUARCH}/include CFLAGS+=-I${.CURDIR}/sys CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_ARCH} @@ -38,7 +38,7 @@ CFLAGS+=-D_PTHREADS_INVARIANTS PRECIOUSLIB= -.include "${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.inc" +.include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc" .include "${.CURDIR}/sys/Makefile.inc" .include "${.CURDIR}/thread/Makefile.inc" Modified: head/lib/libthr/arch/powerpc/Makefile.inc ============================================================================== --- head/lib/libthr/arch/powerpc/Makefile.inc Tue Aug 24 20:45:21 2010 (r211772) +++ head/lib/libthr/arch/powerpc/Makefile.inc Tue Aug 24 20:50:08 2010 (r211773) @@ -1,5 +1,5 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} +.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH} SRCS+= pthread_md.c Modified: head/lib/libthr/arch/powerpc/include/pthread_md.h ============================================================================== --- head/lib/libthr/arch/powerpc/include/pthread_md.h Tue Aug 24 20:45:21 2010 (r211772) +++ head/lib/libthr/arch/powerpc/include/pthread_md.h Tue Aug 24 20:50:08 2010 (r211773) @@ -39,12 +39,16 @@ #define CPU_SPINWAIT #define DTV_OFFSET offsetof(struct tcb, tcb_dtv) +#ifdef __powerpc64__ +#define TP_OFFSET 0x7010 +#else #define TP_OFFSET 0x7008 +#endif /* * Variant I tcb. The structure layout is fixed, don't blindly * change it. - * %r2 points to end of the structure. + * %r2 (32-bit) or %r13 (64-bit) points to end of the structure. */ struct tcb { void *tcb_dtv; @@ -57,7 +61,11 @@ void _tcb_dtor(struct tcb *); static __inline void _tcb_set(struct tcb *tcb) { +#ifdef __powerpc64__ + register uint8_t *_tp __asm__("%r13"); +#else register uint8_t *_tp __asm__("%r2"); +#endif __asm __volatile("mr %0,%1" : "=r"(_tp) : "r"((uint8_t *)tcb + TP_OFFSET)); @@ -66,7 +74,11 @@ _tcb_set(struct tcb *tcb) static __inline struct tcb * _tcb_get(void) { +#ifdef __powerpc64__ + register uint8_t *_tp __asm__("%r13"); +#else register uint8_t *_tp __asm__("%r2"); +#endif return ((struct tcb *)(_tp - TP_OFFSET)); } From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 20:54:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11F2410656A6; Tue, 24 Aug 2010 20:54:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F37938FC27; Tue, 24 Aug 2010 20:54:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OKshk0087595; Tue, 24 Aug 2010 20:54:43 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OKshRm087585; Tue, 24 Aug 2010 20:54:43 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008242054.o7OKshRm087585@svn.freebsd.org> From: Warner Losh Date: Tue, 24 Aug 2010 20:54:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211774 - in head/lib/libc: . compat-43 gen locale quad softfloat stdlib string sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 20:54:44 -0000 Author: imp Date: Tue Aug 24 20:54:43 2010 New Revision: 211774 URL: http://svn.freebsd.org/changeset/base/211774 Log: Powerpc is special here. powerpc and powerpc64 use different ABIs, so their implementations aren't in the same files. Introduce LIBC_ARCH and use that in preference to MACHINE_CPUARCH. Tested by amd64 and powerpc64 builds (thanks nathanw@) Modified: head/lib/libc/Makefile head/lib/libc/compat-43/Makefile.inc head/lib/libc/gen/Makefile.inc head/lib/libc/locale/Makefile.inc head/lib/libc/quad/Makefile.inc head/lib/libc/softfloat/Makefile.inc head/lib/libc/stdlib/Makefile.inc head/lib/libc/string/Makefile.inc head/lib/libc/sys/Makefile.inc Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Tue Aug 24 20:50:08 2010 (r211773) +++ head/lib/libc/Makefile Tue Aug 24 20:54:43 2010 (r211774) @@ -5,6 +5,15 @@ SHLIBDIR?= /lib .include +# We have to special case powerpc and powerpc64, since they mostly have +# the same source implementation. libc is very different due to large +# ABI differences. +.if ${LIBC_ARCH} == "powerpc" +LIBC_ARCH=${MACHINE_ARCH} +.else +LIBC_ARCH=${LIBC_ARCH} +.endif + # All library objects contain FreeBSD revision strings by default; they may be # excluded as a space-saving measure. To produce a library that does # not contain these strings, add -DSTRIP_FBSDID (see ) to CFLAGS @@ -15,7 +24,7 @@ LIB=c SHLIB_MAJOR= 7 WARNS?= 2 CFLAGS+=-I${.CURDIR}/include -I${.CURDIR}/../../include -CFLAGS+=-I${.CURDIR}/${MACHINE_CPUARCH} +CFLAGS+=-I${.CURDIR}/${LIBC_ARCH} CFLAGS+=-DNLS CLEANFILES+=tags INSTALL_PIC_ARCHIVE= @@ -36,7 +45,7 @@ MDASM= MIASM= NOASM= -.include "${.CURDIR}/${MACHINE_CPUARCH}/Makefile.inc" +.include "${.CURDIR}/${LIBC_ARCH}/Makefile.inc" .include "${.CURDIR}/db/Makefile.inc" .include "${.CURDIR}/compat-43/Makefile.inc" .include "${.CURDIR}/gdtoa/Makefile.inc" @@ -49,14 +58,14 @@ NOASM= .include "${.CURDIR}/net/Makefile.inc" .include "${.CURDIR}/nls/Makefile.inc" .include "${.CURDIR}/posix1e/Makefile.inc" -.if ${MACHINE_CPUARCH} != "amd64" && \ - ${MACHINE_CPUARCH} != "ia64" && \ - ${MACHINE_ARCH} != "powerpc64" && \ - ${MACHINE_CPUARCH} != "sparc64" && \ - ${MACHINE_CPUARCH} != "mips" +.if ${LIBC_ARCH} != "amd64" && \ + ${LIBC_ARCH} != "ia64" && \ + ${LIBC_ARCH} != "powerpc64" && \ + ${LIBC_ARCH} != "sparc64" && \ + ${LIBC_ARCH} != "mips" .include "${.CURDIR}/quad/Makefile.inc" .endif -.if ${MACHINE_ARCH} == "mips" && \ +.if ${LIBC_ARCH} == "mips" && \ (!defined(TARGET_ABI) || ${TARGET_ABI} == "o32") .include "${.CURDIR}/quad/Makefile.inc" .endif @@ -70,7 +79,7 @@ NOASM= .include "${.CURDIR}/rpc/Makefile.inc" .include "${.CURDIR}/uuid/Makefile.inc" .include "${.CURDIR}/xdr/Makefile.inc" -.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" +.if ${LIBC_ARCH} == "arm" || ${LIBC_ARCH} == "mips" .include "${.CURDIR}/softfloat/Makefile.inc" .endif .if ${MK_NIS} != "no" @@ -115,14 +124,14 @@ KQSRCS= adddi3.c anddi3.c ashldi3.c ashr KSRCS= bcmp.c ffs.c ffsl.c fls.c flsl.c index.c mcount.c rindex.c \ strcat.c strcmp.c strcpy.c strlen.c strncpy.c -libkern: libkern.gen libkern.${MACHINE_CPUARCH} +libkern: libkern.gen libkern.${LIBC_ARCH} libkern.gen: ${KQSRCS} ${KSRCS} cp -p ${.CURDIR}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern -libkern.${MACHINE_CPUARCH}:: ${KMSRCS} +libkern.${LIBC_ARCH}:: ${KMSRCS} .if defined(KMSRCS) && !empty(KMSRCS) - cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${MACHINE_CPUARCH} + cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${LIBC_ARCH} .endif .include Modified: head/lib/libc/compat-43/Makefile.inc ============================================================================== --- head/lib/libc/compat-43/Makefile.inc Tue Aug 24 20:50:08 2010 (r211773) +++ head/lib/libc/compat-43/Makefile.inc Tue Aug 24 20:54:43 2010 (r211774) @@ -2,7 +2,7 @@ # $FreeBSD$ # compat-43 sources -.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/compat-43 ${.CURDIR}/compat-43 +.PATH: ${.CURDIR}/${LIBC_ARCH}/compat-43 ${.CURDIR}/compat-43 SRCS+= creat.c gethostid.c getwd.c killpg.c sethostid.c setpgrp.c \ setrgid.c setruid.c sigcompat.c Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Tue Aug 24 20:50:08 2010 (r211773) +++ head/lib/libc/gen/Makefile.inc Tue Aug 24 20:54:43 2010 (r211774) @@ -2,7 +2,7 @@ # $FreeBSD$ # machine-independent gen sources -.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/gen ${.CURDIR}/gen +.PATH: ${.CURDIR}/${LIBC_ARCH}/gen ${.CURDIR}/gen SRCS+= __getosreldate.c __xuname.c \ _once_stub.c _pthread_stubs.c _rand48.c _spinlock_stub.c \ @@ -38,9 +38,7 @@ SRCS+= __getosreldate.c __xuname.c \ SYM_MAPS+=${.CURDIR}/gen/Symbol.map # machine-dependent gen sources -.if exists(${.CURDIR}/${MACHINE_CPUARCH}/gen/Makefile.inc) -.include "${.CURDIR}/${MACHINE_CPUARCH}/gen/Makefile.inc" -.endif +.sinclude "${.CURDIR}/${LIBC_ARCH}/gen/Makefile.inc" MAN+= alarm.3 arc4random.3 \ basename.3 check_utility_compat.3 clock.3 \ Modified: head/lib/libc/locale/Makefile.inc ============================================================================== --- head/lib/libc/locale/Makefile.inc Tue Aug 24 20:50:08 2010 (r211773) +++ head/lib/libc/locale/Makefile.inc Tue Aug 24 20:54:43 2010 (r211774) @@ -2,7 +2,7 @@ # $FreeBSD$ # locale sources -.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/locale ${.CURDIR}/locale +.PATH: ${.CURDIR}/${LIBC_ARCH}/locale ${.CURDIR}/locale SRCS+= ascii.c big5.c btowc.c collate.c collcmp.c euc.c fix_grouping.c \ gb18030.c gb2312.c gbk.c isctype.c iswctype.c \ Modified: head/lib/libc/quad/Makefile.inc ============================================================================== --- head/lib/libc/quad/Makefile.inc Tue Aug 24 20:50:08 2010 (r211773) +++ head/lib/libc/quad/Makefile.inc Tue Aug 24 20:54:43 2010 (r211774) @@ -2,9 +2,9 @@ # $FreeBSD$ # Quad support, if needed -.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/quad ${.CURDIR}/quad +.PATH: ${.CURDIR}/${LIBC_ARCH}/quad ${.CURDIR}/quad -.if ${MACHINE_CPUARCH} == "i386" +.if ${LIBC_ARCH} == "i386" SRCS+= cmpdi2.c divdi3.c moddi3.c qdivrem.c ucmpdi2.c udivdi3.c umoddi3.c Modified: head/lib/libc/softfloat/Makefile.inc ============================================================================== --- head/lib/libc/softfloat/Makefile.inc Tue Aug 24 20:50:08 2010 (r211773) +++ head/lib/libc/softfloat/Makefile.inc Tue Aug 24 20:54:43 2010 (r211774) @@ -2,10 +2,10 @@ # $FreeBSD$ SOFTFLOAT_BITS?=64 -.PATH: ${MACHINE_CPUARCH}/softfloat \ +.PATH: ${LIBC_ARCH}/softfloat \ ${.CURDIR}/softfloat/bits${SOFTFLOAT_BITS} ${.CURDIR}/softfloat -CFLAGS+= -I${.CURDIR}/${MACHINE_CPUARCH}/softfloat -I${.CURDIR}/softfloat +CFLAGS+= -I${.CURDIR}/${LIBC_ARCH}/softfloat -I${.CURDIR}/softfloat CFLAGS+= -DSOFTFLOAT_FOR_GCC SRCS+= softfloat.c Modified: head/lib/libc/stdlib/Makefile.inc ============================================================================== --- head/lib/libc/stdlib/Makefile.inc Tue Aug 24 20:50:08 2010 (r211773) +++ head/lib/libc/stdlib/Makefile.inc Tue Aug 24 20:54:43 2010 (r211774) @@ -2,7 +2,7 @@ # $FreeBSD$ # machine-independent stdlib sources -.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/stdlib ${.CURDIR}/stdlib +.PATH: ${.CURDIR}/${LIBC_ARCH}/stdlib ${.CURDIR}/stdlib MISRCS+=_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \ bsearch.c div.c exit.c getenv.c getopt.c getopt_long.c \ @@ -16,7 +16,7 @@ MISRCS+=_Exit.c a64l.c abort.c abs.c ate SYM_MAPS+= ${.CURDIR}/stdlib/Symbol.map # machine-dependent stdlib sources -.sinclude "${.CURDIR}/${MACHINE_CPUARCH}/stdlib/Makefile.inc" +.sinclude "${.CURDIR}/${LIBC_ARCH}/stdlib/Makefile.inc" MAN+= a64l.3 abort.3 abs.3 alloca.3 atexit.3 atof.3 atoi.3 atol.3 bsearch.3 \ div.3 exit.3 getenv.3 getopt.3 getopt_long.3 getsubopt.3 \ Modified: head/lib/libc/string/Makefile.inc ============================================================================== --- head/lib/libc/string/Makefile.inc Tue Aug 24 20:50:08 2010 (r211773) +++ head/lib/libc/string/Makefile.inc Tue Aug 24 20:54:43 2010 (r211774) @@ -1,7 +1,7 @@ # @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 # $FreeBSD$ -.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/string ${.CURDIR}/string +.PATH: ${.CURDIR}/${LIBC_ARCH}/string ${.CURDIR}/string CFLAGS+= -I${.CURDIR}/locale @@ -26,9 +26,7 @@ SYM_MAPS+= ${.CURDIR}/string/Symbol.map # machine-dependent string sources -.if exists(${.CURDIR}/${MACHINE_CPUARCH}/string/Makefile.inc) -.include "${.CURDIR}/${MACHINE_CPUARCH}/string/Makefile.inc" -.endif +.sinclude "${.CURDIR}/${LIBC_ARCH}/string/Makefile.inc" MAN+= bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 index.3 memccpy.3 memchr.3 \ memcmp.3 memcpy.3 memmem.3 memmove.3 memset.3 strcasecmp.3 strcat.3 \ Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Tue Aug 24 20:50:08 2010 (r211773) +++ head/lib/libc/sys/Makefile.inc Tue Aug 24 20:54:43 2010 (r211774) @@ -2,7 +2,7 @@ # $FreeBSD$ # sys sources -.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/sys ${.CURDIR}/sys +.PATH: ${.CURDIR}/${LIBC_ARCH}/sys ${.CURDIR}/sys # Include the generated makefile containing the *complete* list # of syscall names in MIASM. @@ -13,9 +13,7 @@ # MDASM names override the default syscall names in MIASM. # NOASM will prevent the default syscall code from being generated. # -.if exists(${.CURDIR}/${MACHINE_CPUARCH}/sys/Makefile.inc) -.include "${.CURDIR}/${MACHINE_CPUARCH}/sys/Makefile.inc" -.endif +.sinclude "${.CURDIR}/${LIBC_ARCH}/sys/Makefile.inc" # Sources common to both syscall interfaces: SRCS+= stack_protector.c stack_protector_compat.c __error.c From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 21:28:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DB051065698; Tue, 24 Aug 2010 21:28:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D63A8FC15; Tue, 24 Aug 2010 21:28:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OLSYK8088620; Tue, 24 Aug 2010 21:28:34 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OLSYQZ088618; Tue, 24 Aug 2010 21:28:34 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008242128.o7OLSYQZ088618@svn.freebsd.org> From: Warner Losh Date: Tue, 24 Aug 2010 21:28:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211778 - head/lib/libc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 21:28:35 -0000 Author: imp Date: Tue Aug 24 21:28:34 2010 New Revision: 211778 URL: http://svn.freebsd.org/changeset/base/211778 Log: Fix an accidental sed... Modified: head/lib/libc/Makefile Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Tue Aug 24 21:27:02 2010 (r211777) +++ head/lib/libc/Makefile Tue Aug 24 21:28:34 2010 (r211778) @@ -8,10 +8,10 @@ SHLIBDIR?= /lib # We have to special case powerpc and powerpc64, since they mostly have # the same source implementation. libc is very different due to large # ABI differences. -.if ${LIBC_ARCH} == "powerpc" +.if ${MACHINE_ARCH} == "powerpc" LIBC_ARCH=${MACHINE_ARCH} .else -LIBC_ARCH=${LIBC_ARCH} +LIBC_ARCH=${MACHINE_CPUARCH} .endif # All library objects contain FreeBSD revision strings by default; they may be From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 21:38:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 327DC10656A5; Tue, 24 Aug 2010 21:38:45 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21D6C8FC16; Tue, 24 Aug 2010 21:38:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OLcjHD088982; Tue, 24 Aug 2010 21:38:45 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OLcjN3088980; Tue, 24 Aug 2010 21:38:45 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201008242138.o7OLcjN3088980@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 24 Aug 2010 21:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211780 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 21:38:45 -0000 Author: trasz Date: Tue Aug 24 21:38:44 2010 New Revision: 211780 URL: http://svn.freebsd.org/changeset/base/211780 Log: s/ithread/interrupt thread/ Modified: head/share/man/man9/locking.9 Modified: head/share/man/man9/locking.9 ============================================================================== --- head/share/man/man9/locking.9 Tue Aug 24 21:33:32 2010 (r211779) +++ head/share/man/man9/locking.9 Tue Aug 24 21:38:44 2010 (r211780) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2010 +.Dd August 24, 2010 .Dt LOCKING 9 .Os .Sh NAME @@ -334,7 +334,7 @@ At this time this is a rather easy to re .Em "Context:" Ta spin mtx Ta mutex Ta sx Ta rwlock Ta rmlock Ta sleep .Xc .It interrupt filter: Ta \&ok Ta \&no Ta \&no Ta \&no Ta \&no Ta \&no -.It ithread: Ta \&ok Ta \&ok Ta \&no Ta \&ok Ta \&ok Ta \&no +.It interrupt thread: Ta \&ok Ta \&ok Ta \&no Ta \&ok Ta \&ok Ta \&no .It callout: Ta \&ok Ta \&ok Ta \&no Ta \&ok Ta \&no Ta \&no .It syscall: Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok .El From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 23:14:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 440B010656A7; Tue, 24 Aug 2010 23:14:03 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 194DC8FC17; Tue, 24 Aug 2010 23:14:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7ONE2Dg092344; Tue, 24 Aug 2010 23:14:02 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7ONE2J4092343; Tue, 24 Aug 2010 23:14:02 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008242314.o7ONE2J4092343@svn.freebsd.org> From: Rui Paulo Date: Tue, 24 Aug 2010 23:14:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211782 - head/cddl/contrib/dtracetoolkit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 23:14:03 -0000 Author: rpaulo Date: Tue Aug 24 23:14:02 2010 New Revision: 211782 URL: http://svn.freebsd.org/changeset/base/211782 Log: Remove this directory for an attempt to merge from the vendor tree. Deleted: head/cddl/contrib/dtracetoolkit/ From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 23:17:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8808110656A3; Tue, 24 Aug 2010 23:17:30 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5ECFA8FC1F; Tue, 24 Aug 2010 23:17:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7ONHUeN092522; Tue, 24 Aug 2010 23:17:30 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7ONHUdR092521; Tue, 24 Aug 2010 23:17:30 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008242317.o7ONHUdR092521@svn.freebsd.org> From: Rui Paulo Date: Tue, 24 Aug 2010 23:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211784 - head/cddl/contrib/dtracetoolkit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 23:17:30 -0000 Author: rpaulo Date: Tue Aug 24 23:17:30 2010 New Revision: 211784 URL: http://svn.freebsd.org/changeset/base/211784 Log: Merge dtracetoolkit/dtruss from the vendor. Sponsored by: The FreeBSD Foundation Added: head/cddl/contrib/dtracetoolkit/ - copied from r211783, vendor/dtracetoolkit/dist/ From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 23:19:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 768F81065695; Tue, 24 Aug 2010 23:19:14 +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 65BB58FC0A; Tue, 24 Aug 2010 23:19:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7ONJE4R092596; Tue, 24 Aug 2010 23:19:14 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7ONJEHp092594; Tue, 24 Aug 2010 23:19:14 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201008242319.o7ONJEHp092594@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 24 Aug 2010 23:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211785 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 23:19:14 -0000 Author: nwhitehorn Date: Tue Aug 24 23:19:14 2010 New Revision: 211785 URL: http://svn.freebsd.org/changeset/base/211785 Log: Make RTLD work on powerpc64 again. If there is a sub-directory named MACHINE_ARCH, use that specific one, otherwise use MACHINE_CPUARCH. Reviewed by: imp Modified: head/libexec/rtld-elf/Makefile Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Tue Aug 24 23:17:30 2010 (r211784) +++ head/libexec/rtld-elf/Makefile Tue Aug 24 23:19:14 2010 (r211785) @@ -10,7 +10,12 @@ SRCS= rtld_start.S \ MAN= rtld.1 CSTD?= gnu99 CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD -CFLAGS+= -I${.CURDIR}/${MACHINE_CPUARCH} -I${.CURDIR} +.if exists(${.CURDIR}/${MACHINE_ARCH}) +RTLD_ARCH= ${MACHINE_ARCH} +.else +RTLD_ARCH= ${MACHINE_CPUARCH} +.endif +CFLAGS+= -I${.CURDIR}/${RTLD_ARCH} -I${.CURDIR} .if ${MACHINE_ARCH} == "powerpc64" LDFLAGS+= -nostdlib -e _rtld_start .else @@ -39,15 +44,13 @@ LDFLAGS+= -Wl,--version-script=${VERSION ${PROG}: ${VERSION_MAP} -.if exists(${.CURDIR}/${MACHINE_CPUARCH}/Symbol.map) -SYMBOL_MAPS+= ${.CURDIR}/${MACHINE_CPUARCH}/Symbol.map +.if exists(${.CURDIR}/${RTLD_ARCH}/Symbol.map) +SYMBOL_MAPS+= ${.CURDIR}/${RTLD_ARCH}/Symbol.map .endif .endif .endif -.if exists(${.CURDIR}/${MACHINE_CPUARCH}/Makefile.inc) -.include "${.CURDIR}/${MACHINE_CPUARCH}/Makefile.inc" -.endif +.sinclude "${.CURDIR}/${RTLD_ARCH}/Makefile.inc" # Since moving rtld-elf to /libexec, we need to create a symlink. # Fixup the existing binary that's there so we can symlink over it. @@ -56,7 +59,7 @@ beforeinstall: -chflags noschg ${DESTDIR}/usr/libexec/${PROG} .endif -.PATH: ${.CURDIR}/${MACHINE_CPUARCH} +.PATH: ${.CURDIR}/${RTLD_ARCH} .include .include From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 23:24:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8B811065695; Tue, 24 Aug 2010 23:24:43 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B82138FC0C; Tue, 24 Aug 2010 23:24:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7ONOhE6092789; Tue, 24 Aug 2010 23:24:43 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7ONOhAb092787; Tue, 24 Aug 2010 23:24:43 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008242324.o7ONOhAb092787@svn.freebsd.org> From: Rui Paulo Date: Tue, 24 Aug 2010 23:24:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211786 - head/cddl/contrib/dtracetoolkit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 23:24:43 -0000 Author: rpaulo Date: Tue Aug 24 23:24:43 2010 New Revision: 211786 URL: http://svn.freebsd.org/changeset/base/211786 Log: Port dtruss to FreeBSD. Sponsored by: The FreeBSD Foundation Modified: head/cddl/contrib/dtracetoolkit/dtruss Modified: head/cddl/contrib/dtracetoolkit/dtruss ============================================================================== --- head/cddl/contrib/dtracetoolkit/dtruss Tue Aug 24 23:19:14 2010 (r211785) +++ head/cddl/contrib/dtracetoolkit/dtruss Tue Aug 24 23:24:43 2010 (r211786) @@ -1,4 +1,4 @@ -#!/usr/bin/sh +#!/bin/sh # # dtruss - print process system call time details. # Written using DTrace (Solaris 10 3/05). @@ -240,7 +240,7 @@ syscall:::entry */ /* print 3 args, return as hex */ -syscall::lwp_sigmask:return +syscall::sigprocmask:return /self->start/ { /* calculate elapsed time */ @@ -268,10 +268,11 @@ syscall::lwp_sigmask:return } /* print 3 args, arg0 as a string */ +syscall::access*:return, syscall::stat*:return, syscall::lstat*:return, -syscall::open*:return, -syscall::resolvepath:return +syscall::readlink*:return, +syscall::open*:return /self->start/ { /* calculate elapsed time */ @@ -329,7 +330,6 @@ syscall::*read*:return } /* print 0 arg output */ -syscall::gtime:return, syscall::*fork*:return /self->start/ { @@ -357,9 +357,6 @@ syscall::*fork*:return } /* print 1 arg output */ -syscall::brk:return, -syscall::times:return, -syscall::stime:return, syscall::close:return /self->start/ { @@ -387,7 +384,7 @@ syscall::close:return } /* print 2 arg output */ -syscall::utime:return, +syscall::utimes:return, syscall::munmap:return /self->start/ { From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 00:35:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8D6A1065698; Wed, 25 Aug 2010 00:35:58 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A85018FC15; Wed, 25 Aug 2010 00:35:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7P0ZwN8094355; Wed, 25 Aug 2010 00:35:58 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7P0Zwkb094353; Wed, 25 Aug 2010 00:35:58 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201008250035.o7P0Zwkb094353@svn.freebsd.org> From: Rick Macklem Date: Wed, 25 Aug 2010 00:35:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211789 - head/sys/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 00:35:58 -0000 Author: rmacklem Date: Wed Aug 25 00:35:58 2010 New Revision: 211789 URL: http://svn.freebsd.org/changeset/base/211789 Log: If the first iteration of the do loop in replay_prune() succeeded and a subsequent interation failed to find an entry to prune, it could loop infinitely, since the "freed" variable wasn't reset to FALSE. This patch moves setting freed FALSE to inside the loop to fix the problem. Tested by: alan.bryan at yahoo.com MFC after: 2 weeks Modified: head/sys/rpc/replay.c Modified: head/sys/rpc/replay.c ============================================================================== --- head/sys/rpc/replay.c Wed Aug 25 00:05:14 2010 (r211788) +++ head/sys/rpc/replay.c Wed Aug 25 00:35:58 2010 (r211789) @@ -144,8 +144,8 @@ replay_prune(struct replay_cache *rc) bool_t freed_one; if (rc->rc_count >= REPLAY_MAX || rc->rc_size > rc->rc_maxsize) { - freed_one = FALSE; do { + freed_one = FALSE; /* * Try to free an entry. Don't free in-progress entries */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 02:03:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2F4010656A3; Wed, 25 Aug 2010 02:03:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91D758FC18; Wed, 25 Aug 2010 02:03:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7P23mBd096120; Wed, 25 Aug 2010 02:03:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7P23m2Z096117; Wed, 25 Aug 2010 02:03:48 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008250203.o7P23m2Z096117@svn.freebsd.org> From: Warner Losh Date: Wed, 25 Aug 2010 02:03:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211792 - head/sys/dev/ed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 02:03:48 -0000 Author: imp Date: Wed Aug 25 02:03:48 2010 New Revision: 211792 URL: http://svn.freebsd.org/changeset/base/211792 Log: Prodded by Yongari, add support for Holtek HT80232. Add the device ID, plus the ability to force '16-bit mode' which really means NE-2000 mode. Other open source drivers suggest that the Holtek misbehaves if you allow the 8-bit probe. Also, all of the PCI chips emulate NE-2000ish cards, so always force 16-bit mode for memory transfers. PR: 84202 (patch not used) Modified: head/sys/dev/ed/if_ed_novell.c head/sys/dev/ed/if_ed_pci.c Modified: head/sys/dev/ed/if_ed_novell.c ============================================================================== --- head/sys/dev/ed/if_ed_novell.c Wed Aug 25 01:50:12 2010 (r211791) +++ head/sys/dev/ed/if_ed_novell.c Wed Aug 25 02:03:48 2010 (r211792) @@ -123,39 +123,50 @@ ed_probe_Novell_generic(device_t dev, in ed_nic_outb(sc, ED_P0_PSTART, 8192 / ED_PAGE_SIZE); ed_nic_outb(sc, ED_P0_PSTOP, 16384 / ED_PAGE_SIZE); - sc->isa16bit = 0; - /* - * Write a test pattern in byte mode. If this fails, then there - * probably isn't any memory at 8k - which likely means that the board - * is an NE2000. + * Some devices identify themselves. Some of those devices + * can't handle being probed, so we allow forcing a mode. If + * these flags are set, force it, otherwise probe. */ - ed_pio_writemem(sc, test_pattern, 8192, sizeof(test_pattern)); - ed_pio_readmem(sc, 8192, test_buffer, sizeof(test_pattern)); - - if (bcmp(test_pattern, test_buffer, sizeof(test_pattern)) == 0) { + if (flags & ED_FLAGS_FORCE_8BIT_MODE) { + sc->isa16bit = 0; sc->type = ED_TYPE_NE1000; sc->type_str = "NE1000"; - } else { - - /* Not an NE1000 - try NE2000 */ - ed_nic_outb(sc, ED_P0_DCR, ED_DCR_WTS | ED_DCR_FT1 | ED_DCR_LS); - ed_nic_outb(sc, ED_P0_PSTART, 16384 / ED_PAGE_SIZE); - ed_nic_outb(sc, ED_P0_PSTOP, 32768 / ED_PAGE_SIZE); - + } else if (flags & ED_FLAGS_FORCE_16BIT_MODE) { sc->isa16bit = 1; - + sc->type = ED_TYPE_NE2000; + sc->type_str = "NE2000"; + } else { /* - * Write a test pattern in word mode. If this also fails, then - * we don't know what this board is. + * Write a test pattern in byte mode. If this fails, then there + * probably isn't any memory at 8k - which likely means that the board + * is an NE2000. */ - ed_pio_writemem(sc, test_pattern, 16384, sizeof(test_pattern)); - ed_pio_readmem(sc, 16384, test_buffer, sizeof(test_pattern)); + ed_pio_writemem(sc, test_pattern, 8192, sizeof(test_pattern)); + ed_pio_readmem(sc, 8192, test_buffer, sizeof(test_pattern)); + if (bcmp(test_pattern, test_buffer, sizeof(test_pattern)) == 0) { - sc->type = ED_TYPE_NE2000; - sc->type_str = "NE2000"; + sc->type = ED_TYPE_NE1000; + sc->type_str = "NE1000"; + sc->isa16bit = 0; } else { - return (ENXIO); + /* Not an NE1000 - try NE2000 */ + sc->isa16bit = 1; + ed_nic_outb(sc, ED_P0_DCR, ED_DCR_WTS | ED_DCR_FT1 | ED_DCR_LS); + ed_nic_outb(sc, ED_P0_PSTART, 16384 / ED_PAGE_SIZE); + ed_nic_outb(sc, ED_P0_PSTOP, 32768 / ED_PAGE_SIZE); + /* + * Write a test pattern in word mode. If this also fails, then + * we don't know what this board is. + */ + ed_pio_writemem(sc, test_pattern, 16384, sizeof(test_pattern)); + ed_pio_readmem(sc, 16384, test_buffer, sizeof(test_pattern)); + if (bcmp(test_pattern, test_buffer, sizeof(test_pattern)) == 0) { + sc->type = ED_TYPE_NE2000; + sc->type_str = "NE2000"; + } else { + return (ENXIO); + } } } sc->chip_type = ED_CHIP_TYPE_DP8390; Modified: head/sys/dev/ed/if_ed_pci.c ============================================================================== --- head/sys/dev/ed/if_ed_pci.c Wed Aug 25 01:50:12 2010 (r211791) +++ head/sys/dev/ed/if_ed_pci.c Wed Aug 25 02:03:48 2010 (r211792) @@ -49,18 +49,19 @@ static struct _pcsid const char *desc; } pci_ids[] = { - { ED_RTL8029_PCI_ID, "RealTek 8029" }, /* Needs realtek full duplex */ - { 0x50004a14, "NetVin NV5000SC" }, - { 0x09401050, "ProLAN" }, { 0x140111f6, "Compex RL2000" }, + { 0x005812c3, "Holtek HT80232" }, { 0x30008e2e, "KTI ET32P2" }, - { 0x19808c4a, "Winbond W89C940" }, + { 0x50004a14, "NetVin NV5000SC" }, + { 0x09401050, "ProLAN" }, + { ED_RTL8029_PCI_ID, "RealTek 8029" }, /* Needs realtek full duplex */ { 0x0e3410bd, "Surecom NE-34" }, - { 0x09261106, "VIA VT86C926" }, /* only do 16-bit */ + { 0x09261106, "VIA VT86C926" }, + { 0x19808c4a, "Winbond W89C940" }, { 0x5a5a1050, "Winbond W89C940F" }, #if 0 - /* Holtek needs special lovin', disabled by default */ - { 0x005812c3, "Holtek HT80232" }, /* Only 16-bit I/O, Holtek fdx */ + /* some Holtek needs special lovin', disabled by default */ + /* The Holtek can report/do full duplex, but that's unimplemented */ { 0x559812c3, "Holtek HT80229" }, /* Only 32-bit I/O, Holtek fdx, STOP_PG_60? */ #endif { 0x00000000, NULL } @@ -87,7 +88,6 @@ static int ed_pci_attach(device_t dev) { struct ed_softc *sc = device_get_softc(dev); - int flags = 0; int error = ENXIO; /* @@ -96,9 +96,10 @@ ed_pci_attach(device_t dev) * are areally just generic ne-2000 cards. */ if (pci_get_devid(dev) == ED_RTL8029_PCI_ID) - error = ed_probe_RTL80x9(dev, PCIR_BAR(0), flags); + error = ed_probe_RTL80x9(dev, PCIR_BAR(0), 0); if (error) - error = ed_probe_Novell(dev, PCIR_BAR(0), flags); + error = ed_probe_Novell(dev, PCIR_BAR(0), + ED_FLAGS_FORCE_16BIT_MODE); if (error) { ed_release_resources(dev); return (error); From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 02:09:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D904A1065694; Wed, 25 Aug 2010 02:09:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8C1C8FC1A; Wed, 25 Aug 2010 02:09:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7P297AR096249; Wed, 25 Aug 2010 02:09:07 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7P297uJ096247; Wed, 25 Aug 2010 02:09:07 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008250209.o7P297uJ096247@svn.freebsd.org> From: Warner Losh Date: Wed, 25 Aug 2010 02:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211793 - head/sys/dev/ed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 02:09:07 -0000 Author: imp Date: Wed Aug 25 02:09:07 2010 New Revision: 211793 URL: http://svn.freebsd.org/changeset/base/211793 Log: On second thought, we need to force 16-bit mode Modified: head/sys/dev/ed/if_ed_novell.c Modified: head/sys/dev/ed/if_ed_novell.c ============================================================================== --- head/sys/dev/ed/if_ed_novell.c Wed Aug 25 02:03:48 2010 (r211792) +++ head/sys/dev/ed/if_ed_novell.c Wed Aug 25 02:09:07 2010 (r211793) @@ -136,6 +136,9 @@ ed_probe_Novell_generic(device_t dev, in sc->isa16bit = 1; sc->type = ED_TYPE_NE2000; sc->type_str = "NE2000"; + ed_nic_outb(sc, ED_P0_DCR, ED_DCR_WTS | ED_DCR_FT1 | ED_DCR_LS); + ed_nic_outb(sc, ED_P0_PSTART, 16384 / ED_PAGE_SIZE); + ed_nic_outb(sc, ED_P0_PSTOP, 32768 / ED_PAGE_SIZE); } else { /* * Write a test pattern in byte mode. If this fails, then there From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 03:14:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10ED71065693; Wed, 25 Aug 2010 03:14:33 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA40F8FC12; Wed, 25 Aug 2010 03:14:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7P3EW7Y097814; Wed, 25 Aug 2010 03:14:32 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7P3EW1H097812; Wed, 25 Aug 2010 03:14:32 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201008250314.o7P3EW1H097812@svn.freebsd.org> From: David Xu Date: Wed, 25 Aug 2010 03:14:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211794 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 03:14:33 -0000 Author: davidxu Date: Wed Aug 25 03:14:32 2010 New Revision: 211794 URL: http://svn.freebsd.org/changeset/base/211794 Log: If a thread is removed from umtxq while sleeping, reset error code to zero, this gives userland a better indication that a thread needn't to be cancelled. Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Wed Aug 25 02:09:07 2010 (r211793) +++ head/sys/kern/kern_umtx.c Wed Aug 25 03:14:32 2010 (r211794) @@ -1059,8 +1059,10 @@ do_wait(struct thread *td, void *addr, u umtxq_lock(&uq->uq_key); for (;;) { error = umtxq_sleep(uq, "uwait", tvtohz(&tv)); - if (!(uq->uq_flags & UQF_UMTXQ)) + if (!(uq->uq_flags & UQF_UMTXQ)) { + error = 0; break; + } if (error != ETIMEDOUT) break; umtxq_unlock(&uq->uq_key); @@ -2404,25 +2406,14 @@ do_cv_wait(struct thread *td, struct uco } } - if (error != 0) { - if ((uq->uq_flags & UQF_UMTXQ) == 0) { - /* - * If we concurrently got do_cv_signal()d - * and we got an error or UNIX signals or a timeout, - * then, perform another umtxq_signal to avoid - * consuming the wakeup. This may cause supurious - * wakeup for another thread which was just queued, - * but SUSV3 explicitly allows supurious wakeup to - * occur, and indeed a kernel based implementation - * can not avoid it. - */ - if (!umtxq_signal(&uq->uq_key, 1)) - error = 0; - } + if ((uq->uq_flags & UQF_UMTXQ) == 0) + error = 0; + else { + umtxq_remove(uq); if (error == ERESTART) error = EINTR; } - umtxq_remove(uq); + umtxq_unlock(&uq->uq_key); umtx_key_release(&uq->uq_key); return (error); @@ -2891,15 +2882,13 @@ do_sem_wait(struct thread *td, struct _u } } - if (error != 0) { - if ((uq->uq_flags & UQF_UMTXQ) == 0) { - if (!umtxq_signal(&uq->uq_key, 1)) - error = 0; - } + if ((uq->uq_flags & UQF_UMTXQ) == 0) + error = 0; + else { + umtxq_remove(uq); if (error == ERESTART) error = EINTR; } - umtxq_remove(uq); umtxq_unlock(&uq->uq_key); umtx_key_release(&uq->uq_key); return (error); From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 07:33:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91B441065672; Wed, 25 Aug 2010 07:33:35 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 66F7F8FC12; Wed, 25 Aug 2010 07:33:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7P7XZvD003178; Wed, 25 Aug 2010 07:33:35 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7P7XZNU003176; Wed, 25 Aug 2010 07:33:35 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201008250733.o7P7XZNU003176@svn.freebsd.org> From: "Jayachandran C." Date: Wed, 25 Aug 2010 07:33:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211799 - head/sys/mips/rmi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 07:33:35 -0000 Author: jchandra Date: Wed Aug 25 07:33:35 2010 New Revision: 211799 URL: http://svn.freebsd.org/changeset/base/211799 Log: Sync up XLR tick.c with the new MIPS tick.c Modified: head/sys/mips/rmi/tick.c Modified: head/sys/mips/rmi/tick.c ============================================================================== --- head/sys/mips/rmi/tick.c Wed Aug 25 07:31:18 2010 (r211798) +++ head/sys/mips/rmi/tick.c Wed Aug 25 07:33:35 2010 (r211799) @@ -62,8 +62,8 @@ struct timecounter *platform_timecounter static DPCPU_DEFINE(uint32_t, cycles_per_tick); static uint32_t cycles_per_usec; -static DPCPU_DEFINE(uint32_t, counter_upper); -static DPCPU_DEFINE(uint32_t, counter_lower_last); +static DPCPU_DEFINE(volatile uint32_t, counter_upper); +static DPCPU_DEFINE(volatile uint32_t, counter_lower_last); static DPCPU_DEFINE(uint32_t, compare_ticks); static DPCPU_DEFINE(uint32_t, lost_ticks); @@ -108,23 +108,32 @@ tick_ticker(void) uint32_t t_lower_last, t_upper; /* - * XXX: MIPS64 platforms can read 64-bits of counter directly. - * Also: the tc code is supposed to cope with things wrapping - * from the time counter, so I'm not sure why all these hoops - * are even necessary. + * Disable preemption because we are working with cpu specific data. */ - ticktock = mips_rd_count(); critical_enter(); - t_lower_last = DPCPU_GET(counter_lower_last); - t_upper = DPCPU_GET(counter_upper); + + /* + * Note that even though preemption is disabled, interrupts are + * still enabled. In particular there is a race with clock_intr() + * reading the values of 'counter_upper' and 'counter_lower_last'. + * + * XXX this depends on clock_intr() being executed periodically + * so that 'counter_upper' and 'counter_lower_last' are not stale. + */ + do { + t_upper = DPCPU_GET(counter_upper); + t_lower_last = DPCPU_GET(counter_lower_last); + } while (t_upper != DPCPU_GET(counter_upper)); + + ticktock = mips_rd_count(); + + critical_exit(); + + /* COUNT register wrapped around */ if (ticktock < t_lower_last) t_upper++; - t_lower_last = ticktock; - DPCPU_SET(counter_upper, t_upper); - DPCPU_SET(counter_lower_last, t_lower_last); - critical_exit(); - ret = ((uint64_t)t_upper << 32) | t_lower_last; + ret = ((uint64_t)t_upper << 32) | ticktock; return (ret); } @@ -268,11 +277,11 @@ clock_intr(void *arg) } else /* In one-shot mode timer should be stopped after the event. */ mips_wr_compare(0xffffffff); - critical_enter(); + /* COUNT register wrapped around */ if (count < DPCPU_GET(counter_lower_last)) { DPCPU_SET(counter_upper, DPCPU_GET(counter_upper) + 1); - DPCPU_SET(counter_lower_last, count); } + DPCPU_SET(counter_lower_last, count); if (cycles_per_tick > 0) { @@ -302,7 +311,6 @@ clock_intr(void *arg) } if (sc->et.et_active) sc->et.et_event_cb(&sc->et, sc->et.et_arg); - critical_exit(); return (FILTER_HANDLED); } From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 08:09:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9846910656AA; Wed, 25 Aug 2010 08:09:42 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87C0A8FC08; Wed, 25 Aug 2010 08:09:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7P89gUK003875; Wed, 25 Aug 2010 08:09:42 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7P89gWj003873; Wed, 25 Aug 2010 08:09:42 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201008250809.o7P89gWj003873@svn.freebsd.org> From: Alexander Leidinger Date: Wed, 25 Aug 2010 08:09:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211800 - head/etc/periodic/daily X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 08:09:42 -0000 Author: netchild Date: Wed Aug 25 08:09:42 2010 New Revision: 211800 URL: http://svn.freebsd.org/changeset/base/211800 Log: - Change the threshold from 'running next scrub the th day after the last one' to 'running next scrub the th day after the last one'. - Improve wording. Requested by: jhell MFC after: 1 week Modified: head/etc/periodic/daily/800.scrub-zfs Modified: head/etc/periodic/daily/800.scrub-zfs ============================================================================== --- head/etc/periodic/daily/800.scrub-zfs Wed Aug 25 07:33:35 2010 (r211799) +++ head/etc/periodic/daily/800.scrub-zfs Wed Aug 25 08:09:42 2010 (r211800) @@ -53,7 +53,7 @@ case "$daily_scrub_zfs_enable" in # Now minus last scrub (both in seconds) converted to days. _scrub_diff=$(expr -e \( $(date +%s) - \ $(date -j -f %F.%T ${_last_scrub} +%s) \) / 60 / 60 / 24) - if [ ${_scrub_diff} -le ${_pool_threshold} ]; then + if [ ${_scrub_diff} -lt ${_pool_threshold} ]; then echo " skipping scrubbing of pool '${pool}':" echo " last scrubbing is ${_scrub_diff} days ago, threshold is set to ${_pool_threshold} days" continue @@ -65,11 +65,11 @@ case "$daily_scrub_zfs_enable" in echo " scrubbing of pool '${pool}' already in progress, skipping:" ;; *"none requested"*) - echo " starting first scrubbing (after reboot) of pool '${pool}':" + echo " starting first scrub (since reboot) of pool '${pool}':" zpool scrub ${pool} ;; *) - echo " starting scrubbing of pool '${pool}':" + echo " starting scrub of pool '${pool}':" zpool scrub ${pool} ;; esac From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 08:37:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 257A510656AA; Wed, 25 Aug 2010 08:37:19 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1579E8FC15; Wed, 25 Aug 2010 08:37:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7P8bIFM004558; Wed, 25 Aug 2010 08:37:18 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7P8bIxe004556; Wed, 25 Aug 2010 08:37:18 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201008250837.o7P8bIxe004556@svn.freebsd.org> From: Maxim Konovalov Date: Wed, 25 Aug 2010 08:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211801 - head/etc/defaults X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 08:37:19 -0000 Author: maxim Date: Wed Aug 25 08:37:18 2010 New Revision: 211801 URL: http://svn.freebsd.org/changeset/base/211801 Log: o Correct typo. Submitted by: Bojidara Marinchovska via -stable MFC after: 1 week Modified: head/etc/defaults/rc.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Wed Aug 25 08:09:42 2010 (r211800) +++ head/etc/defaults/rc.conf Wed Aug 25 08:37:18 2010 (r211801) @@ -216,7 +216,7 @@ ifconfig_lo0="inet 127.0.0.1" # default #ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64" # Sample IPv6 alias #ifconfig_fxp0_name="net0" # Change interface name from fxp0 to net0. #vlans_fxp0="101 vlan0" # vlan(4) interfaces for fxp0 device -#create_arg_vlan0="vlan 102" # vlan tag for vlan0 device +#create_args_vlan0="vlan 102" # vlan tag for vlan0 device #wlans_ath0="wlan0" # wlan(4) interfaces for ath0 device #wlandebug_wlan0="scan+auth+assoc" # Set debug flags with wlanddebug(8) #ipv4_addrs_fxp0="192.168.0.1/24 192.168.1.1-5/28" # example IPv4 address entry. From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 08:48:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C48181065672; Wed, 25 Aug 2010 08:48:54 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B31568FC0A; Wed, 25 Aug 2010 08:48:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7P8msVY004839; Wed, 25 Aug 2010 08:48:54 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7P8msUo004836; Wed, 25 Aug 2010 08:48:54 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201008250848.o7P8msUo004836@svn.freebsd.org> From: "Jayachandran C." Date: Wed, 25 Aug 2010 08:48:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211802 - head/sys/mips/rmi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 08:48:55 -0000 Author: jchandra Date: Wed Aug 25 08:48:54 2010 New Revision: 211802 URL: http://svn.freebsd.org/changeset/base/211802 Log: RMI XLR platform code clean-up. - move PIC code to xlr_machdep.c - move fast message ring code completely to on_chip.c - move memory initialization to a new function xlr_mem_init() - style fixes Modified: head/sys/mips/rmi/on_chip.c head/sys/mips/rmi/xlr_machdep.c Modified: head/sys/mips/rmi/on_chip.c ============================================================================== --- head/sys/mips/rmi/on_chip.c Wed Aug 25 08:37:18 2010 (r211801) +++ head/sys/mips/rmi/on_chip.c Wed Aug 25 08:48:54 2010 (r211802) @@ -1,4 +1,4 @@ -/*- + /*- * Copyright (c) 2003-2009 RMI Corporation * All rights reserved. * @@ -57,8 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include @@ -102,14 +100,11 @@ do { \ /* make this a read/write spinlock */ static struct mtx msgrng_lock; static int msgring_int_enabled; -struct mtx xlr_pic_lock; - static int msgring_pop_num_buckets; static uint32_t msgring_pop_bucket_mask; static int msgring_int_type; static int msgring_watermark_count; static uint32_t msgring_thread_mask; - uint32_t msgrng_msg_cycles = 0; void xlr_msgring_handler(struct trapframe *); @@ -169,10 +164,11 @@ xlr_msgring_cpu_init(void) void xlr_msgring_config(void) { + mtx_init(&msgrng_lock, "msgring", NULL, MTX_SPIN | MTX_RECURSE); msgring_int_type = 0x02; msgring_pop_num_buckets = 8; msgring_pop_bucket_mask = 0xff; - + msgring_int_enabled = 0; msgring_watermark_count = 1; msgring_thread_mask = 0x01; } @@ -221,9 +217,6 @@ xlr_msgring_handler(struct trapframe *tf } } } - - xlr_set_counter(MSGRNG_EXIT_STATUS, msgrng_read_status()); - msgrng_flags_restore(mflags); } @@ -387,48 +380,6 @@ register_msgring_handler(int major, return 0; } -static void -pic_init(void) -{ - xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET); - int i = 0; - int level; - - dbg_msg("Initializing PIC...\n"); - for (i = 0; i < PIC_NUM_IRTS; i++) { - - level = PIC_IRQ_IS_EDGE_TRIGGERED(i); - - /* Bind all PIC irqs to cpu 0 */ - xlr_write_reg(mmio, PIC_IRT_0_BASE + i, 0x01); - - /* - * Use local scheduling and high polarity for all IRTs - * Invalidate all IRTs, by default - */ - xlr_write_reg(mmio, PIC_IRT_1_BASE + i, (level << 30) | (1 << 6) | - (PIC_IRQ_BASE + i)); - } - dbg_msg("PIC init now done\n"); -} - -void -on_chip_init(void) -{ - /* Set xlr_io_base to the run time value */ - mtx_init(&msgrng_lock, "msgring", NULL, MTX_SPIN | MTX_RECURSE); - mtx_init(&xlr_pic_lock, "pic", NULL, MTX_SPIN); - - xlr_board_info_setup(); - - msgring_int_enabled = 0; - - xlr_msgring_config(); - pic_init(); - - xlr_msgring_cpu_init(); -} - static void start_msgring_threads(void *arg) { Modified: head/sys/mips/rmi/xlr_machdep.c ============================================================================== --- head/sys/mips/rmi/xlr_machdep.c Wed Aug 25 08:37:18 2010 (r211801) +++ head/sys/mips/rmi/xlr_machdep.c Wed Aug 25 08:48:54 2010 (r211802) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include void mpwait(void); unsigned long xlr_io_base = (unsigned long)(DEFAULT_XLR_IO_BASE); @@ -82,6 +83,8 @@ unsigned long xlr_io_base = (unsigned lo the dynamic kenv is setup */ char boot1_env[4096]; int rmi_spin_mutex_safe=0; +struct mtx xlr_pic_lock; + /* * Parameters from boot loader */ @@ -264,7 +267,6 @@ mips_init(void) init_param1(); init_param2(physmem); - /* XXX: Catch 22. Something touches the tlb. */ mips_cpu_init(); pmap_bootstrap(); #ifdef DDB @@ -277,20 +279,110 @@ mips_init(void) mutex_init(); } +static void +xlr_pic_init(void) +{ + xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET); + int i, level; + + mtx_init(&xlr_pic_lock, "pic", NULL, MTX_SPIN); + xlr_write_reg(mmio, PIC_CTRL, 0); + for (i = 0; i < PIC_NUM_IRTS; i++) { + level = PIC_IRQ_IS_EDGE_TRIGGERED(i); + + /* Bind all PIC irqs to cpu 0 */ + xlr_write_reg(mmio, PIC_IRT_0_BASE + i, 0x01); + + /* + * Use local scheduling and high polarity for all IRTs + * Invalidate all IRTs, by default + */ + xlr_write_reg(mmio, PIC_IRT_1_BASE + i, (level << 30) | (1 << 6) | + (PIC_IRQ_BASE + i)); + } +} + +static void +xlr_mem_init(void) +{ + struct xlr_boot1_mem_map *boot_map; + vm_size_t physsz = 0; + int i, j; + + /* get physical memory info from boot loader */ + boot_map = (struct xlr_boot1_mem_map *) + (unsigned long)xlr_boot1_info.psb_mem_map; + for (i = 0, j = 0; i < boot_map->num_entries; i++, j += 2) { + if (boot_map->physmem_map[i].type == BOOT1_MEM_RAM) { + if (j == 14) { + printf("*** ERROR *** memory map too large ***\n"); + break; + } + if (j == 0) { + /* TODO FIXME */ + /* start after kernel end */ + phys_avail[0] = (vm_paddr_t) + MIPS_KSEG0_TO_PHYS(&_end) + 0x20000; + /* boot loader start */ + /* HACK to Use bootloaders memory region */ + /* TODO FIXME */ + if (boot_map->physmem_map[0].size == 0x0c000000) { + boot_map->physmem_map[0].size = 0x0ff00000; + } + phys_avail[1] = boot_map->physmem_map[0].addr + + boot_map->physmem_map[0].size; + printf("First segment: addr:%p -> %p \n", + (void *)phys_avail[0], + (void *)phys_avail[1]); + + } else { +/* + * Can't use this code yet, because most of the fixed allocations happen from + * the biggest physical area. If we have more than 512M memory the kernel will try + * to map from the second are which is not in KSEG0 and not mapped + */ + phys_avail[j] = (vm_paddr_t) + boot_map->physmem_map[i].addr; + phys_avail[j + 1] = phys_avail[j] + + boot_map->physmem_map[i].size; + if (phys_avail[j + 1] < phys_avail[j] ) { + /* Houston we have an issue. Memory is + * larger than possible. Its probably in + * 64 bit > 4Gig and we are in 32 bit mode. + */ + phys_avail[j + 1] = 0xfffff000; + printf("boot map size was %jx\n", + (intmax_t)boot_map->physmem_map[i].size); + boot_map->physmem_map[i].size = phys_avail[j + 1] + - phys_avail[j]; + printf("reduced to %jx\n", + (intmax_t)boot_map->physmem_map[i].size); + } + printf("Next segment : addr:%p -> %p \n", + (void *)phys_avail[j], + (void *)phys_avail[j+1]); + } + physsz += boot_map->physmem_map[i].size; + } + } + + /* FIXME XLR TODO */ + phys_avail[j] = phys_avail[j + 1] = 0; + realmem = physmem = btoc(physsz); +} + void platform_start(__register_t a0 __unused, __register_t a1 __unused, __register_t a2 __unused, __register_t a3 __unused) { - vm_size_t physsz = 0; - int i, j; - struct xlr_boot1_mem_map *boot_map; + int i; #ifdef SMP uint32_t tmp; void (*wakeup) (void *, void *, unsigned int); - #endif + /* XXX FIXME the code below is not 64 bit clean */ /* Save boot loader and other stuff from scratch regs */ xlr_boot1_info = *(struct boot1_info *)(intptr_t)(int)read_c0_register32(MIPS_COP_0_OSSCRATCH, 0); @@ -345,64 +437,7 @@ platform_start(__register_t a0 __unused, xlr_set_boot_flags(); xlr_parse_mmu_options(); - /* get physical memory info from boot loader */ - boot_map = (struct xlr_boot1_mem_map *) - (unsigned long)xlr_boot1_info.psb_mem_map; - for (i = 0, j = 0; i < boot_map->num_entries; i++, j += 2) { - if (boot_map->physmem_map[i].type == BOOT1_MEM_RAM) { - if (j == 14) { - printf("*** ERROR *** memory map too large ***\n"); - break; - } - if (j == 0) { - /* TODO FIXME */ - /* start after kernel end */ - phys_avail[0] = (vm_paddr_t) - MIPS_KSEG0_TO_PHYS(&_end) + 0x20000; - /* boot loader start */ - /* HACK to Use bootloaders memory region */ - /* TODO FIXME */ - if (boot_map->physmem_map[0].size == 0x0c000000) { - boot_map->physmem_map[0].size = 0x0ff00000; - } - phys_avail[1] = boot_map->physmem_map[0].addr + - boot_map->physmem_map[0].size; - printf("First segment: addr:%p -> %p \n", - (void *)phys_avail[0], - (void *)phys_avail[1]); - - } else { -/* - * Can't use this code yet, because most of the fixed allocations happen from - * the biggest physical area. If we have more than 512M memory the kernel will try - * to map from the second are which is not in KSEG0 and not mapped - */ - phys_avail[j] = (vm_paddr_t) - boot_map->physmem_map[i].addr; - phys_avail[j + 1] = phys_avail[j] + - boot_map->physmem_map[i].size; - if (phys_avail[j + 1] < phys_avail[j] ) { - /* Houston we have an issue. Memory is - * larger than possible. Its probably in - * 64 bit > 4Gig and we are in 32 bit mode. - */ - phys_avail[j + 1] = 0xfffff000; - printf("boot map size was %jx\n", (intmax_t)boot_map->physmem_map[i].size); - boot_map->physmem_map[i].size = phys_avail[j + 1] - phys_avail[j]; - printf("reduced to %jx\n", (intmax_t)boot_map->physmem_map[i].size); - } - printf("Next segment : addr:%p -> %p \n", - (void *)phys_avail[j], - (void *)phys_avail[j+1]); - } - physsz += boot_map->physmem_map[i].size; - } - } - - /* FIXME XLR TODO */ - phys_avail[j] = phys_avail[j + 1] = 0; - realmem = physmem = btoc(physsz); - + xlr_mem_init(); /* Set up hz, among others. */ mips_init(); @@ -436,14 +471,14 @@ platform_start(__register_t a0 __unused, #endif /* xlr specific post initialization */ - /* - * The expectation is that mutex_init() is already done in - * mips_init() XXX NOTE: We may need to move this to SMP based init - * code for each CPU, later. - */ - rmi_spin_mutex_safe = 1; - on_chip_init(); + /* initialize other on chip stuff */ + xlr_board_info_setup(); + xlr_msgring_config(); + xlr_pic_init(); + xlr_msgring_cpu_init(); + mips_timer_init_params(xlr_boot1_info.cpu_frequency, 0); + printf("Platform specific startup now completes\n"); } @@ -455,6 +490,7 @@ platform_cpu_init() void platform_identify(void) { + printf("Board [%d:%d], processor 0x%08x\n", (int)xlr_boot1_info.board_major_version, (int)xlr_boot1_info.board_minor_version, mips_rd_prid()); } @@ -530,14 +566,17 @@ platform_init_ap(int cpuid) int platform_ipi_intrnum(void) { + return (IRQ_IPI); } void platform_ipi_send(int cpuid) { + pic_send_ipi(xlr_cpuid_to_hwtid[cpuid], platform_ipi_intrnum(), 0); + } void @@ -548,18 +587,21 @@ platform_ipi_clear(void) int platform_processor_id(void) { + return (xlr_hwtid_to_cpuid[xlr_cpu_id()]); } int platform_num_processors(void) { + return (xlr_ncores * xlr_threads_per_core); } struct cpu_group * platform_smp_topo() { + return (smp_topo_2level(CG_SHARE_L2, xlr_ncores, CG_SHARE_L1, xlr_threads_per_core, CG_FLAG_THREAD)); } From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 08:49:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E985010656B7; Wed, 25 Aug 2010 08:49:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8CCB8FC22; Wed, 25 Aug 2010 08:49:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7P8nLGK004885; Wed, 25 Aug 2010 08:49:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7P8nLQr004883; Wed, 25 Aug 2010 08:49:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201008250849.o7P8nLQr004883@svn.freebsd.org> From: Alexander Motin Date: Wed, 25 Aug 2010 08:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211803 - stable/8/sys/geom/mirror X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 08:49:22 -0000 Author: mav Date: Wed Aug 25 08:49:21 2010 New Revision: 211803 URL: http://svn.freebsd.org/changeset/base/211803 Log: MFC r211455: Remove bintime_cmp() function, unused since r200086. Modified: stable/8/sys/geom/mirror/g_mirror.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/8/sys/geom/mirror/g_mirror.c Wed Aug 25 08:48:54 2010 (r211802) +++ stable/8/sys/geom/mirror/g_mirror.c Wed Aug 25 08:49:21 2010 (r211803) @@ -844,21 +844,6 @@ g_mirror_unidle(struct g_mirror_softc *s } } -static __inline int -bintime_cmp(struct bintime *bt1, struct bintime *bt2) -{ - - if (bt1->sec < bt2->sec) - return (-1); - else if (bt1->sec > bt2->sec) - return (1); - if (bt1->frac < bt2->frac) - return (-1); - else if (bt1->frac > bt2->frac) - return (1); - return (0); -} - static void g_mirror_done(struct bio *bp) { From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 09:10:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8EF610656A6; Wed, 25 Aug 2010 09:10:32 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B86528FC0C; Wed, 25 Aug 2010 09:10:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7P9AWtE005440; Wed, 25 Aug 2010 09:10:32 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7P9AWsv005437; Wed, 25 Aug 2010 09:10:32 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008250910.o7P9AWsv005437@svn.freebsd.org> From: Rui Paulo Date: Wed, 25 Aug 2010 09:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211804 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 09:10:33 -0000 Author: rpaulo Date: Wed Aug 25 09:10:32 2010 New Revision: 211804 URL: http://svn.freebsd.org/changeset/base/211804 Log: Call the necessary DTrace function pointers when we have different kinds of traps. Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/trap.c head/sys/i386/i386/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Wed Aug 25 08:49:21 2010 (r211803) +++ head/sys/amd64/amd64/trap.c Wed Aug 25 09:10:32 2010 (r211804) @@ -109,6 +109,13 @@ dtrace_doubletrap_func_t dtrace_doubletr * implementation opaque. */ systrace_probe_func_t systrace_probe_func; + +/* + * These hooks are necessary for the pid, usdt and fasttrap providers. + */ +dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; +dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; +dtrace_return_probe_ptr_t dtrace_return_probe_ptr; #endif extern void trap(struct trapframe *frame); @@ -239,6 +246,55 @@ trap(struct trapframe *frame) if (dtrace_trap_func != NULL) if ((*dtrace_trap_func)(frame, type)) goto out; + if (type == T_DTRACE_PROBE || type == T_DTRACE_RET || + type == T_BPTFLT) { + struct reg regs; + + regs.r_r15 = frame->tf_r15; + regs.r_r14 = frame->tf_r14; + regs.r_r13 = frame->tf_r13; + regs.r_r12 = frame->tf_r12; + regs.r_r11 = frame->tf_r11; + regs.r_r10 = frame->tf_r10; + regs.r_r9 = frame->tf_r9; + regs.r_r8 = frame->tf_r8; + regs.r_rdi = frame->tf_rdi; + regs.r_rsi = frame->tf_rsi; + regs.r_rbp = frame->tf_rbp; + regs.r_rbx = frame->tf_rbx; + regs.r_rdx = frame->tf_rdx; + regs.r_rcx = frame->tf_rcx; + regs.r_rax = frame->tf_rax; + regs.r_rip = frame->tf_rip; + regs.r_cs = frame->tf_cs; + regs.r_rflags = frame->tf_rflags; + regs.r_rsp = frame->tf_rsp; + regs.r_ss = frame->tf_ss; + if (frame->tf_flags & TF_HASSEGS) { + regs.r_ds = frame->tf_ds; + regs.r_es = frame->tf_es; + regs.r_fs = frame->tf_fs; + regs.r_gs = frame->tf_gs; + } else { + regs.r_ds = 0; + regs.r_es = 0; + regs.r_fs = 0; + regs.r_gs = 0; + } + if (type == T_DTRACE_PROBE && + dtrace_fasttrap_probe_ptr != NULL && + dtrace_fasttrap_probe_ptr(®s) == 0) + goto out; + if (type == T_BPTFLT && + dtrace_pid_probe_ptr != NULL && + dtrace_pid_probe_ptr(®s) == 0) + goto out; + if (type == T_DTRACE_RET && + dtrace_return_probe_ptr != NULL && + dtrace_return_probe_ptr(®s) == 0) + goto out; + + } #endif if ((frame->tf_rflags & PSL_I) == 0) { Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Wed Aug 25 08:49:21 2010 (r211803) +++ head/sys/i386/i386/trap.c Wed Aug 25 09:10:32 2010 (r211804) @@ -118,6 +118,9 @@ dtrace_doubletrap_func_t dtrace_doubletr * implementation opaque. */ systrace_probe_func_t systrace_probe_func; + +dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; +dtrace_return_probe_ptr_t dtrace_return_probe_ptr; #endif extern void trap(struct trapframe *frame); @@ -260,6 +263,38 @@ trap(struct trapframe *frame) dtrace_trap_func != NULL) if ((*dtrace_trap_func)(frame, type)) goto out; + if (type == T_DTRACE_PROBE || type == T_DTRACE_RET || + type == T_BPTFLT) { + struct reg regs; + + regs.r_fs = frame->tf_fs; + regs.r_es = frame->tf_es; + regs.r_ds = frame->tf_ds; + regs.r_edi = frame->tf_edi; + regs.r_esi = frame->tf_esi; + regs.r_ebp = frame->tf_ebp; + regs.r_ebx = frame->tf_ebx; + regs.r_edx = frame->tf_edx; + regs.r_ecx = frame->tf_ecx; + regs.r_eax = frame->tf_eax; + regs.r_eip = frame->tf_eip; + regs.r_cs = frame->tf_cs; + regs.r_eflags = frame->tf_eflags; + regs.r_esp = frame->tf_esp; + regs.r_ss = frame->tf_ss; + if (type == T_DTRACE_PROBE && + dtrace_fasttrap_probe_ptr != NULL && + dtrace_fasttrap_probe_ptr(®s) == 0) + goto out; + if (type == T_BPTFLT && + dtrace_pid_probe_ptr != NULL && + dtrace_pid_probe_ptr(®s) == 0) + goto out; + if (type == T_DTRACE_RET && + dtrace_return_probe_ptr != NULL && + dtrace_return_probe_ptr(®s) == 0) + goto out; + } #endif if ((frame->tf_eflags & PSL_I) == 0) { From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 09:48:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A034610656A6; Wed, 25 Aug 2010 09:48:21 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54C318FC1F; Wed, 25 Aug 2010 09:48:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7P9mLNA006373; Wed, 25 Aug 2010 09:48:21 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7P9mLl9006371; Wed, 25 Aug 2010 09:48:21 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201008250948.o7P9mLl9006371@svn.freebsd.org> From: Gabor Kovesdan Date: Wed, 25 Aug 2010 09:48:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211808 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 09:48:21 -0000 Author: gabor Date: Wed Aug 25 09:48:21 2010 New Revision: 211808 URL: http://svn.freebsd.org/changeset/base/211808 Log: - Regen after adding WITH_BSD_GREP and removing WITH_GNU_GREP Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Aug 25 09:34:34 2010 (r211807) +++ head/share/man/man5/src.conf.5 Wed Aug 25 09:48:21 2010 (r211808) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 188848 2009-02-20 11:09:55Z mtm .\" $FreeBSD$ -.Dd July 22, 2010 +.Dd August 25, 2010 .Dt SRC.CONF 5 .Os .Sh NAME @@ -214,6 +214,9 @@ Set to not build the boot blocks and loa .\" from FreeBSD: head/tools/build/options/WITHOUT_BSD_CPIO 179813 2008-06-16 05:48:15Z dougb Set to not build the BSD licensed version of cpio based on .Xr libarchive 3 . +.It Va WITH_BSD_GREP +.\" from FreeBSD: head/tools/build/options/WITH_BSD_GREP 211701 2010-08-23 10:04:26Z gabor +Build BSD-licensed grep instead of GNU grep. .It Va WITHOUT_BSNMP .\" from FreeBSD: head/tools/build/options/WITHOUT_BSNMP 183306 2008-09-23 16:15:42Z sam Set to not build or install @@ -346,9 +349,6 @@ When set, it also enforces the following .It .Va WITHOUT_GNU_SUPPORT .El -.It Va WITH_GNU_GREP -.\" from FreeBSD: head/tools/build/options/WITH_GNU_GREP 210389 2010-07-22 19:11:57Z gabor -Set to build the base system with GNU grep instead of BSD grep .It Va WITHOUT_GNU_SUPPORT .\" from FreeBSD: head/tools/build/options/WITHOUT_GNU_SUPPORT 156932 2006-03-21 07:50:50Z ru Set to build some programs without optional GNU support. From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 09:53:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 940D61065693; Wed, 25 Aug 2010 09:53:00 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 709BC8FC16; Wed, 25 Aug 2010 09:53:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7P9r0tI006510; Wed, 25 Aug 2010 09:53:00 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7P9r0n0006507; Wed, 25 Aug 2010 09:53:00 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201008250953.o7P9r0n0006507@svn.freebsd.org> From: "Jayachandran C." Date: Wed, 25 Aug 2010 09:53:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211809 - head/sys/mips/rmi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 09:53:00 -0000 Author: jchandra Date: Wed Aug 25 09:53:00 2010 New Revision: 211809 URL: http://svn.freebsd.org/changeset/base/211809 Log: Rename on_chip.c to fmn.c, as the file has just the fast messaging network code. The iodi.c has the bus for SoC devices, so the name on_chip.c is misleading. Added: head/sys/mips/rmi/fmn.c - copied, changed from r211802, head/sys/mips/rmi/on_chip.c Deleted: head/sys/mips/rmi/on_chip.c Modified: head/sys/mips/rmi/files.xlr Modified: head/sys/mips/rmi/files.xlr ============================================================================== --- head/sys/mips/rmi/files.xlr Wed Aug 25 09:48:21 2010 (r211808) +++ head/sys/mips/rmi/files.xlr Wed Aug 25 09:53:00 2010 (r211809) @@ -7,14 +7,12 @@ mips/rmi/iodi.c standard mips/rmi/msgring.c standard mips/rmi/msgring_xls.c standard mips/rmi/board.c standard -mips/rmi/on_chip.c standard +mips/rmi/fmn.c standard mips/rmi/intr_machdep.c standard mips/rmi/mpwait.S optional smp mips/rmi/xlr_i2c.c optional iic mips/rmi/uart_bus_xlr_iodi.c optional uart mips/rmi/uart_cpu_mips_xlr.c optional uart -mips/rmi/perfmon_kern.c optional xlr_perfmon -mips/rmi/perfmon_percpu.c optional xlr_perfmon mips/rmi/xlr_pci.c optional pci mips/rmi/xls_ehci.c optional usb ehci mips/rmi/bus_space_rmi.c standard Copied and modified: head/sys/mips/rmi/fmn.c (from r211802, head/sys/mips/rmi/on_chip.c) ============================================================================== --- head/sys/mips/rmi/on_chip.c Wed Aug 25 08:48:54 2010 (r211802, copy source) +++ head/sys/mips/rmi/fmn.c Wed Aug 25 09:53:00 2010 (r211809) @@ -1,4 +1,4 @@ - /*- +/*- * Copyright (c) 2003-2009 RMI Corporation * All rights reserved. * From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 10:03:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B85EC106567A; Wed, 25 Aug 2010 10:03:40 +0000 (UTC) (envelope-from prvs=1846a26b27=brian@FreeBSD.org) Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) by mx1.freebsd.org (Postfix) with ESMTP id 612898FC19; Wed, 25 Aug 2010 10:03:40 +0000 (UTC) Received: from pd2ml1so-ssvc.prod.shaw.ca ([10.0.141.139]) by pd3mo1so-svcs.prod.shaw.ca with ESMTP; 25 Aug 2010 03:48:38 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=6EkEX6JM2LCztCEhkE317K9SpBSN4cB8nbuuHVfFIzI= c=1 sm=1 a=ac2em_AgDcUA:10 a=VphdPIyG4kEA:10 a=MJPcHhXccCG8eBs0us8XwA==:17 a=pGLkceISAAAA:8 a=6I5d2MoRAAAA:8 a=MMwg4So0AAAA:8 a=R6JeLM4sqc3GGkWqVeYA:9 a=OpXzp7ce0wvinjQXv7xuH7slwvoA:4 a=CjuIK1q_8ugA:10 a=MSl-tDqOz04A:10 a=WJ3hkfHDukgA:10 a=SV7veod9ZcQA:10 a=g5MSwxJAP8RBvM5y_GoA:9 a=ncedj2dnlp0M_f2ao4yuYJy9C9YA:4 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO store.lan.Awfulhak.org) ([70.79.162.198]) by pd2ml1so-dmz.prod.shaw.ca with ESMTP; 25 Aug 2010 03:48:37 -0600 Received: from store.lan.Awfulhak.org (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id 32F3FC433B1_C74E68FB; Wed, 25 Aug 2010 09:46:55 +0000 (GMT) Received: from gw.Awfulhak.org (gw.lan.Awfulhak.org [172.16.0.1]) by store.lan.Awfulhak.org (Sophos Email Appliance) with ESMTP id A7F02C4612C_C74E68BF; Wed, 25 Aug 2010 09:46:51 +0000 (GMT) Received: from dev.lan.Awfulhak.org (brian@dev.lan.Awfulhak.org [172.16.0.5]) by gw.Awfulhak.org (8.14.4/8.14.4) with ESMTP id o7P9kppY010758; Wed, 25 Aug 2010 02:46:51 -0700 (PDT) (envelope-from brian@FreeBSD.org) Date: Wed, 25 Aug 2010 02:46:51 -0700 From: Brian Somers To: Kostik Belousov Message-ID: <20100825024651.288b67b5@dev.lan.Awfulhak.org> In-Reply-To: <20100823102858.GD2396@deviant.kiev.zoral.com.ua> References: <201008230533.o7N5XVxa028293@svn.freebsd.org> <20100823102858.GD2396@deviant.kiev.zoral.com.ua> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; i386-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/yT/_rJXsc4uuF.p/1dzuPV+"; protocol="application/pgp-signature" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r211684 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 10:03:40 -0000 --Sig_/yT/_rJXsc4uuF.p/1dzuPV+ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Mon, 23 Aug 2010 13:28:58 +0300 Kostik Belousov wr= ote: > On Mon, Aug 23, 2010 at 05:33:31AM +0000, Brian Somers wrote: > > Author: brian > > Date: Mon Aug 23 05:33:31 2010 > > New Revision: 211684 > > URL: http://svn.freebsd.org/changeset/base/211684 > >=20 > > Log: > > uio_resid isn't updated by VOP_READDIR for nfs filesystems. Use > > the uio_offset adjustment instead to calculate a correct *len. > Isn't this should be fixed in nfs instead ? Please note that the moral > equivalent of the code is also present in compat/linux/linux_cwd.c: > linux_getcwd_scandir(). I did not inspected other callers of > VOP_READDIR. >=20 > > =20 > > Without this change, we run off the end of the directory data > > we're reading and panic horribly for nfs filesystems. > > =20 > > MFC after: 1 week > >=20 > > Modified: > > head/sys/kern/vfs_default.c > >=20 > > Modified: head/sys/kern/vfs_default.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sys/kern/vfs_default.c Mon Aug 23 05:33:20 2010 (r211683) > > +++ head/sys/kern/vfs_default.c Mon Aug 23 05:33:31 2010 (r211684) > > @@ -281,10 +281,9 @@ get_next_dirent(struct vnode *vp, struct > > if (error) > > return (error); > > =20 > > - *off =3D uio.uio_offset; > > - > > *cpos =3D dirbuf; > > - *len =3D (dirbuflen - uio.uio_resid); > > + *len =3D uio.uio_offset - *off; > > + *off =3D uio.uio_offset; > > } > > =20 > > dp =3D (struct dirent *)(*cpos); I'm looking into why uio_resid isn't being updated - it's a bit awkward as this is happening on a production box running 8.1 (just upgraded from 7), so it may take a few days. --=20 Brian Somers Don't _EVER_ lose your sense of humour ! --Sig_/yT/_rJXsc4uuF.p/1dzuPV+ Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iQCVAwUBTHTmiw7tvOdmanQhAQJMogP/SC2uLk3r3nOyJFsvHqdbu261T0BqGDBV foM72NRr0F2Fg97DWmEkjraU7mhHKJRynk9s1YBqrwV1856UWUdlnrc/91lcFpdO DOdnliNRtcUdfuS8UeqsfaHPFeSLAhmfLCK32X5Xo7naqix8CxRhyMTIjcbqoQtD pgeHIpAme2I= =4klp -----END PGP SIGNATURE----- --Sig_/yT/_rJXsc4uuF.p/1dzuPV+-- From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 10:58:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57C0C1065695; Wed, 25 Aug 2010 10:58:24 +0000 (UTC) (envelope-from prvs=1846a26b27=brian@Awfulhak.org) Received: from idcmail-mo2no.shaw.ca (idcmail-mo2no.shaw.ca [64.59.134.9]) by mx1.freebsd.org (Postfix) with ESMTP id E49A08FC08; Wed, 25 Aug 2010 10:58:23 +0000 (UTC) Received: from pd5ml1no-ssvc.prod.shaw.ca ([10.0.153.166]) by pd5mo1no-svcs.prod.shaw.ca with ESMTP; 25 Aug 2010 04:43:23 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=37qdrPIVUooonMxFi2BWZ8DhoCRe+hJcgJuumZcJ4K8= c=1 sm=1 a=ac2em_AgDcUA:10 a=VphdPIyG4kEA:10 a=MJPcHhXccCG8eBs0us8XwA==:17 a=6I5d2MoRAAAA:8 a=pGLkceISAAAA:8 a=MMwg4So0AAAA:8 a=Cf0GPqMsS1ijzaY0mdoA:9 a=EWXa41gkmEwbzuL6hUsA:7 a=34lhgKc9DzPs-LWaQYvXyiSyWBUA:4 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=MSl-tDqOz04A:10 a=WJ3hkfHDukgA:10 a=_j7Oz4fwN7ICFR0y:21 a=XY3BRwbVpKqtCihq:21 a=KSqKyckMdjsNzCdPUo0A:9 a=NJPTa544hkXawsaBHB8Pu1Jc7egA:4 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO store.lan.Awfulhak.org) ([70.79.162.198]) by pd5ml1no-dmz.prod.shaw.ca with ESMTP; 25 Aug 2010 04:43:22 -0600 Received: from store.lan.Awfulhak.org (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id 96164C433AC_C74F363B; Wed, 25 Aug 2010 10:41:39 +0000 (GMT) Received: from gw.Awfulhak.org (gw.lan.Awfulhak.org [172.16.0.1]) by store.lan.Awfulhak.org (Sophos Email Appliance) with ESMTP id EA7FAC4612C_C74F35EF; Wed, 25 Aug 2010 10:41:34 +0000 (GMT) Received: from dev.lan.Awfulhak.org (brian@dev.lan.Awfulhak.org [172.16.0.5]) by gw.Awfulhak.org (8.14.4/8.14.4) with ESMTP id o7PAfYsj003778; Wed, 25 Aug 2010 03:41:34 -0700 (PDT) (envelope-from brian@Awfulhak.org) Date: Wed, 25 Aug 2010 03:41:27 -0700 From: Brian Somers To: Brian Somers Message-ID: <20100825034127.174d03ab@dev.lan.Awfulhak.org> In-Reply-To: <20100825024651.288b67b5@dev.lan.Awfulhak.org> References: <201008230533.o7N5XVxa028293@svn.freebsd.org> <20100823102858.GD2396@deviant.kiev.zoral.com.ua> <20100825024651.288b67b5@dev.lan.Awfulhak.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; i386-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/yekzVUPQiBL_wEZc.Zr+aq5"; protocol="application/pgp-signature" Cc: Kostik Belousov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r211684 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 10:58:24 -0000 --Sig_/yekzVUPQiBL_wEZc.Zr+aq5 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 25 Aug 2010 02:46:51 -0700 Brian Somers wrote: > On Mon, 23 Aug 2010 13:28:58 +0300 Kostik Belousov = wrote: > > On Mon, Aug 23, 2010 at 05:33:31AM +0000, Brian Somers wrote: > > > Author: brian > > > Date: Mon Aug 23 05:33:31 2010 > > > New Revision: 211684 > > > URL: http://svn.freebsd.org/changeset/base/211684 > > >=20 > > > Log: > > > uio_resid isn't updated by VOP_READDIR for nfs filesystems. Use > > > the uio_offset adjustment instead to calculate a correct *len. > > Isn't this should be fixed in nfs instead ? Please note that the moral > > equivalent of the code is also present in compat/linux/linux_cwd.c: > > linux_getcwd_scandir(). I did not inspected other callers of > > VOP_READDIR. > >=20 > > > =20 > > > Without this change, we run off the end of the directory data > > > we're reading and panic horribly for nfs filesystems. > > > =20 > > > MFC after: 1 week > > >=20 > > > Modified: > > > head/sys/kern/vfs_default.c > > >=20 > > > Modified: head/sys/kern/vfs_default.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- head/sys/kern/vfs_default.c Mon Aug 23 05:33:20 2010 (r211683) > > > +++ head/sys/kern/vfs_default.c Mon Aug 23 05:33:31 2010 (r211684) > > > @@ -281,10 +281,9 @@ get_next_dirent(struct vnode *vp, struct > > > if (error) > > > return (error); > > > =20 > > > - *off =3D uio.uio_offset; > > > - > > > *cpos =3D dirbuf; > > > - *len =3D (dirbuflen - uio.uio_resid); > > > + *len =3D uio.uio_offset - *off; > > > + *off =3D uio.uio_offset; > > > } > > > =20 > > > dp =3D (struct dirent *)(*cpos); >=20 > I'm looking into why uio_resid isn't being updated - it's a bit awkward > as this is happening on a production box running 8.1 (just upgraded > from 7), so it may take a few days. Hmm, I've just seen a crash here with the new code.... (kgdb) p *len $2 =3D -35080 (kgdb) p uio.uio_offset $3 =3D 512 (kgdb) p uio.uio_resid $4 =3D 8192 So it looks like my fix is wrong (so much for real-world tests!). Note, the uio values above have survived on the stack from the first call to get_next_dirent() where *len was zero and we read the content of the directory. The directory file is 512 bytes and the crash happens when we run off the end of the 512 bytes read. (kgdb) p *(struct dirent *)(dirbuf + 512) $9 =3D {d_fileno =3D 680038892, d_reclen =3D 40, d_type =3D 12 '\f', d_naml= en =3D 34 '"',=20 d_name =3D "?\206\210(\000\000\000\000\025\000\000 ?\206\210(\004\222\210= ((\000\f\"?\206\210(\000\000\000\000\025\000\000 ?\206\210(\034\222\210((\0= 00\f\"?\206\210(\000\000\000\000\025\000\000 ?\206\210(4\222\210((\000\f\"?= \206\210(\000\000\000\000\025\000\000 \000\207\210(L\222\210((\000\f\"\000\= 207\210(\000\000\000\000\025\000\000 \020\207\210(d\222\210((\000\f\"\020\2= 07\210(\000\000\000\000\025\000\000 \207\210(|\222\210((\000\f\" \207\210(= \000\000\000\000\025\000\000 0\207\210(\224\222\210((\000\f\"0\207\210(\000= \000\000\000\025\000\000 @\207\210(?\222\210((\000\f\"@\207\210(\000\000\00= 0\000"...} (kgdb) p *(struct dirent *)(dirbuf + 552) $10 =3D {d_fileno =3D 536870933, d_reclen =3D 34528, d_type =3D 136 '\210',= d_namlen =3D 40 '(',=20 d_name =3D "\034\222\210((\000\f\"?\206\210(\000\000\000\000\025\000\000 = ?\206\210(4\222\210((\000\f\"?\206\210(\000\000\000\000\025\000\000 \000\20= 7\210(L\222\210((\000\f\"\000\207\210(\000\000\000\000\025\000\000 \020\207= \210(d\222\210((\000\f\"\020\207\210(\000\000\000\000\025\000\000 \207\210= (|\222\210((\000\f\" \207\210(\000\000\000\000\025\000\000 0\207\210(\224\2= 22\210((\000\f\"0\207\210(\000\000\000\000\025\000\000 @\207\210(?\222\210(= (\000\f\"@\207\210(\000\000\000\000\025\000\000 P\207\210(?\222\210((\000\f= \"P\207\210(\000\000\000\000\025\000\000 `\207\210(?\222\210((\000\f\""...} (kgdb) p dirbuf + 552 + 34528 $11 =3D 0xc8891908
So we can see that we're falling off the end of the 512 bytes we read because *len never reaches zero as it's intended to. The bit I can't understand yet is how len reaches -35080. That number is minus the sum of all the directory reclens and the two garbage dirents that we read from dirbuf + 512 and dirbuf + 552. This seems to imply that when we actually did the readdir(), we set *len to zero and then immediately adjusted it before returning from get_next_dirent(). This is exactly the deduction that made me make the original change. Having said all that, I also have diagnostics in this kernel that should tr= igger if nfs_readdir() tries to return with inconsistent uio_offset and uio_resid values and I saw no diagnostics. This means that assuming I haven't fat fingered the diagnostics, I was just absolutely wrong about uio_resid not being adjusted. Hmm, so after all this, I know what the problem is: The first read of 512 bytes works fine and we iterate through the dirents 'till we hit the end. We then read again and get zero from readdir, but fail to handle this case. We then drop out of the "if (*len =3D=3D 0)" par= t and start using garbage at dirbuf + 512, adjusting *len to -40. I'd suggest this patch, do you agree? I'll test it tomorrow... --- vfs_default.c.orig 2010-08-22 21:35:18.000000000 -0700 +++ vfs_default.c 2010-08-25 03:38:41.000000000 -0700 @@ -280,9 +280,13 @@ if (error) return (error); =20 - *cpos =3D dirbuf; - *len =3D uio.uio_offset - *off; *off =3D uio.uio_offset; + + *cpos =3D dirbuf; + *len =3D (dirbuflen - uio.uio_resid); + + if (*len =3D=3D 0) + return (ENOENT); } =20 dp =3D (struct dirent *)(*cpos); --=20 Brian Somers Don't _EVER_ lose your sense of humour ! --Sig_/yekzVUPQiBL_wEZc.Zr+aq5 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iQCVAwUBTHTzXg7tvOdmanQhAQIHDgP/XDdtOWjhu6iJcS5mmF1/QD+9bkTWXqsi /Tp902/8accI3ah353lLt6cFzTZ+pEykkVU8CZnublgH9C7InzkV8k6iwwILSaUv dHIdU+21GG060XWNsnxW4LhTp9mhtiv37GDn9JOQkoeSU6BZf1c4IgsGGV0+1zsc db41vAOFe68= =NXjx -----END PGP SIGNATURE----- --Sig_/yekzVUPQiBL_wEZc.Zr+aq5-- From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 11:11:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 572A910656A8; Wed, 25 Aug 2010 11:11:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 467658FC27; Wed, 25 Aug 2010 11:11:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7PBBFMi009692; Wed, 25 Aug 2010 11:11:15 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7PBBFkt009690; Wed, 25 Aug 2010 11:11:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201008251111.o7PBBFkt009690@svn.freebsd.org> From: Alexander Motin Date: Wed, 25 Aug 2010 11:11:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211810 - stable/7/sys/geom/mirror X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 11:11:15 -0000 Author: mav Date: Wed Aug 25 11:11:14 2010 New Revision: 211810 URL: http://svn.freebsd.org/changeset/base/211810 Log: MFC r211455: Remove bintime_cmp() function, unused since r200086. Modified: stable/7/sys/geom/mirror/g_mirror.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/7/sys/geom/mirror/g_mirror.c Wed Aug 25 09:53:00 2010 (r211809) +++ stable/7/sys/geom/mirror/g_mirror.c Wed Aug 25 11:11:14 2010 (r211810) @@ -844,21 +844,6 @@ g_mirror_unidle(struct g_mirror_softc *s } } -static __inline int -bintime_cmp(struct bintime *bt1, struct bintime *bt2) -{ - - if (bt1->sec < bt2->sec) - return (-1); - else if (bt1->sec > bt2->sec) - return (1); - if (bt1->frac < bt2->frac) - return (-1); - else if (bt1->frac > bt2->frac) - return (1); - return (0); -} - static void g_mirror_done(struct bio *bp) { From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 11:49:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96F5A1065673; Wed, 25 Aug 2010 11:49:48 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 855B78FC14; Wed, 25 Aug 2010 11:49:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7PBnm4k010464; Wed, 25 Aug 2010 11:49:48 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7PBnmQv010456; Wed, 25 Aug 2010 11:49:48 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201008251149.o7PBnmQv010456@svn.freebsd.org> From: "Jayachandran C." Date: Wed, 25 Aug 2010 11:49:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211811 - head/sys/mips/rmi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 11:49:48 -0000 Author: jchandra Date: Wed Aug 25 11:49:48 2010 New Revision: 211811 URL: http://svn.freebsd.org/changeset/base/211811 Log: XLR PIC code update and style(9) fixes. - style(9) fixes to mips/rmi platform files - update pic.h to add pic_setup_intr() and use pic_setup_intr() for setting up interrupts which are routed thru PIC. - remove rmi_spin_mutex_safe and haslock, and make sure that the functions are called only after mutexes are available. Modified: head/sys/mips/rmi/fmn.c head/sys/mips/rmi/intr_machdep.c head/sys/mips/rmi/iodi.c head/sys/mips/rmi/msgring.h head/sys/mips/rmi/pic.h head/sys/mips/rmi/xlr_machdep.c head/sys/mips/rmi/xlr_pci.c Modified: head/sys/mips/rmi/fmn.c ============================================================================== --- head/sys/mips/rmi/fmn.c Wed Aug 25 11:11:14 2010 (r211810) +++ head/sys/mips/rmi/fmn.c Wed Aug 25 11:49:48 2010 (r211811) @@ -362,14 +362,10 @@ register_msgring_handler(int major, if (major >= MAX_TX_STNS) return 1; - //dbg_msg("major=%d, action=%p, dev_id=%p\n", major, action, dev_id); - - if (rmi_spin_mutex_safe) - mtx_lock_spin(&msgrng_lock); + mtx_lock_spin(&msgrng_lock); tx_stn_handlers[major].action = action; tx_stn_handlers[major].dev_id = dev_id; - if (rmi_spin_mutex_safe) - mtx_unlock_spin(&msgrng_lock); + mtx_unlock_spin(&msgrng_lock); if (xlr_test_and_set(&msgring_int_enabled)) { create_msgring_thread(0, 0); Modified: head/sys/mips/rmi/intr_machdep.c ============================================================================== --- head/sys/mips/rmi/intr_machdep.c Wed Aug 25 11:11:14 2010 (r211810) +++ head/sys/mips/rmi/intr_machdep.c Wed Aug 25 11:49:48 2010 (r211811) @@ -168,7 +168,7 @@ cpu_intr(struct trapframe *tf) mips_intrcnt_inc(mips_intr_counters[i]); } write_c0_eirr64(1ULL << i); - pic_ack(i, 0); + pic_ack(i); if (!ie || TAILQ_EMPTY(&ie->ie_handlers)) { printf("stray interrupt %d\n", i); continue; @@ -176,7 +176,7 @@ cpu_intr(struct trapframe *tf) if (intr_event_handle(ie, tf) != 0) { printf("stray interrupt %d\n", i); } - pic_delayed_ack(i, 0); + pic_delayed_ack(i); } critical_exit(); } Modified: head/sys/mips/rmi/iodi.c ============================================================================== --- head/sys/mips/rmi/iodi.c Wed Aug 25 11:11:14 2010 (r211810) +++ head/sys/mips/rmi/iodi.c Wed Aug 25 11:49:48 2010 (r211811) @@ -91,53 +91,28 @@ struct iodi_softc *iodi_softc; /* There static int iodi_setup_intr(device_t dev, device_t child, - struct resource *ires, int flags, driver_filter_t * filt, driver_intr_t * intr, void *arg, - void **cookiep) + struct resource *ires, int flags, driver_filter_t * filt, + driver_intr_t *intr, void *arg, void **cookiep) { - int level; - xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET); - xlr_reg_t reg; - /* FIXME is this the right place to fiddle with PIC? */ if (strcmp(device_get_name(child), "uart") == 0) { /* FIXME uart 1? */ - if (rmi_spin_mutex_safe) - mtx_lock_spin(&xlr_pic_lock); - level = PIC_IRQ_IS_EDGE_TRIGGERED(PIC_IRT_UART_0_INDEX); - xlr_write_reg(mmio, PIC_IRT_0_UART_0, 0x01); - xlr_write_reg(mmio, PIC_IRT_1_UART_0, ((1 << 31) | (level << 30) | (1 << 6) | (PIC_UART_0_IRQ))); - if (rmi_spin_mutex_safe) - mtx_unlock_spin(&xlr_pic_lock); - cpu_establish_hardintr("uart", filt, - (driver_intr_t *) intr, (void *)arg, PIC_UART_0_IRQ, flags, cookiep); - + cpu_establish_hardintr("uart", filt, intr, arg, + PIC_UART_0_IRQ, flags, cookiep); + pic_setup_intr(PIC_IRT_UART_0_INDEX, PIC_UART_0_IRQ, 0x1); } else if (strcmp(device_get_name(child), "rge") == 0) { int irq; /* This is a hack to pass in the irq */ irq = (intptr_t)ires->__r_i; - if (rmi_spin_mutex_safe) - mtx_lock_spin(&xlr_pic_lock); - reg = xlr_read_reg(mmio, PIC_IRT_1_BASE + irq - PIC_IRQ_BASE); - xlr_write_reg(mmio, PIC_IRT_1_BASE + irq - PIC_IRQ_BASE, reg | (1 << 6) | (1 << 30) | (1 << 31)); - if (rmi_spin_mutex_safe) - mtx_unlock_spin(&xlr_pic_lock); - cpu_establish_hardintr("rge", filt, (driver_intr_t *) intr, (void *)arg, irq, flags, cookiep); - + cpu_establish_hardintr("rge", filt, intr, arg, irq, flags, + cookiep); + pic_setup_intr(irq - PIC_IRQ_BASE, irq, 0x1); } else if (strcmp(device_get_name(child), "ehci") == 0) { - if (rmi_spin_mutex_safe) - mtx_lock_spin(&xlr_pic_lock); - reg = xlr_read_reg(mmio, PIC_IRT_1_BASE + PIC_USB_IRQ - PIC_IRQ_BASE); - xlr_write_reg(mmio, PIC_IRT_1_BASE + PIC_USB_IRQ - PIC_IRQ_BASE, reg | (1 << 6) | (1 << 30) | (1 << 31)); - if (rmi_spin_mutex_safe) - mtx_unlock_spin(&xlr_pic_lock); - cpu_establish_hardintr("ehci", filt, (driver_intr_t *) intr, (void *)arg, PIC_USB_IRQ, flags, cookiep); + cpu_establish_hardintr("ehci", filt, intr, arg, PIC_USB_IRQ, flags, + cookiep); + pic_setup_intr(PIC_USB_IRQ - PIC_IRQ_BASE, PIC_USB_IRQ, 0x1); } - /* - * This causes a panic and looks recursive to me (RRS). - * BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, filt, - * intr, arg, cookiep); - */ return (0); } Modified: head/sys/mips/rmi/msgring.h ============================================================================== --- head/sys/mips/rmi/msgring.h Wed Aug 25 11:11:14 2010 (r211810) +++ head/sys/mips/rmi/msgring.h Wed Aug 25 11:49:48 2010 (r211811) @@ -25,6 +25,7 @@ * 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$ * * RMI_BSD */ #ifndef _RMI_MSGRING_H_ @@ -471,13 +472,13 @@ extern struct stn_cc xls_cc_table_sec; #define msgrng_access_save(lock, mflags) do { \ - if (rmi_spin_mutex_safe) mtx_lock_spin(lock); \ + mtx_lock_spin(lock); \ msgrng_flags_save(mflags); \ }while(0) #define msgrng_access_restore(lock, mflags) do { \ msgrng_flags_restore(mflags); \ - if (rmi_spin_mutex_safe) mtx_unlock_spin(lock); \ + mtx_unlock_spin(lock); \ }while(0) #define msgrng_access_enable(mflags) do { \ Modified: head/sys/mips/rmi/pic.h ============================================================================== --- head/sys/mips/rmi/pic.h Wed Aug 25 11:11:14 2010 (r211810) +++ head/sys/mips/rmi/pic.h Wed Aug 25 11:49:48 2010 (r211811) @@ -32,219 +32,154 @@ #define _RMI_PIC_H_ #include - - - -extern int rmi_spin_mutex_safe; - #include #include #include -#define PIC_IRT_WD_INDEX 0 -#define PIC_IRT_TIMER_0_INDEX 1 -#define PIC_IRT_TIMER_1_INDEX 2 -#define PIC_IRT_TIMER_2_INDEX 3 -#define PIC_IRT_TIMER_3_INDEX 4 -#define PIC_IRT_TIMER_4_INDEX 5 -#define PIC_IRT_TIMER_5_INDEX 6 -#define PIC_IRT_TIMER_6_INDEX 7 -#define PIC_IRT_TIMER_7_INDEX 8 -#define PIC_IRT_CLOCK_INDEX PIC_IRT_TIMER_7_INDEX -#define PIC_IRT_UART_0_INDEX 9 -#define PIC_IRT_UART_1_INDEX 10 -#define PIC_IRT_I2C_0_INDEX 11 -#define PIC_IRT_I2C_1_INDEX 12 -#define PIC_IRT_PCMCIA_INDEX 13 -#define PIC_IRT_GPIO_INDEX 14 -#define PIC_IRT_HYPER_INDEX 15 -#define PIC_IRT_PCIX_INDEX 16 -#define PIC_IRT_GMAC0_INDEX 17 -#define PIC_IRT_GMAC1_INDEX 18 -#define PIC_IRT_GMAC2_INDEX 19 -#define PIC_IRT_GMAC3_INDEX 20 -#define PIC_IRT_XGS0_INDEX 21 -#define PIC_IRT_XGS1_INDEX 22 -#define PIC_IRT_HYPER_FATAL_INDEX 23 -#define PIC_IRT_PCIX_FATAL_INDEX 24 -#define PIC_IRT_BRIDGE_AERR_INDEX 25 -#define PIC_IRT_BRIDGE_BERR_INDEX 26 -#define PIC_IRT_BRIDGE_TB_INDEX 27 -#define PIC_IRT_BRIDGE_AERR_NMI_INDEX 28 +#define PIC_IRT_WD_INDEX 0 +#define PIC_IRT_TIMER_INDEX(i) (1 + (i)) +#define PIC_IRT_CLOCK_INDEX PIC_IRT_TIMER_7_INDEX +#define PIC_IRT_UART_0_INDEX 9 +#define PIC_IRT_UART_1_INDEX 10 +#define PIC_IRT_I2C_0_INDEX 11 +#define PIC_IRT_I2C_1_INDEX 12 +#define PIC_IRT_PCMCIA_INDEX 13 +#define PIC_IRT_GPIO_INDEX 14 +#define PIC_IRT_HYPER_INDEX 15 +#define PIC_IRT_PCIX_INDEX 16 +#define PIC_IRT_GMAC0_INDEX 17 +#define PIC_IRT_GMAC1_INDEX 18 +#define PIC_IRT_GMAC2_INDEX 19 +#define PIC_IRT_GMAC3_INDEX 20 +#define PIC_IRT_XGS0_INDEX 21 +#define PIC_IRT_XGS1_INDEX 22 +#define PIC_IRT_HYPER_FATAL_INDEX 23 +#define PIC_IRT_PCIX_FATAL_INDEX 24 +#define PIC_IRT_BRIDGE_AERR_INDEX 25 +#define PIC_IRT_BRIDGE_BERR_INDEX 26 +#define PIC_IRT_BRIDGE_TB_INDEX 27 +#define PIC_IRT_BRIDGE_AERR_NMI_INDEX 28 /* numbering for XLS */ -#define PIC_IRT_BRIDGE_ERR_INDEX 25 -#define PIC_IRT_PCIE_LINK0_INDEX 26 -#define PIC_IRT_PCIE_LINK1_INDEX 27 -#define PIC_IRT_PCIE_LINK2_INDEX 23 -#define PIC_IRT_PCIE_LINK3_INDEX 24 -#define PIC_IRT_PCIE_INT_INDEX 28 -#define PIC_IRT_PCIE_FATAL_INDEX 29 -#define PIC_IRT_GPIO_B_INDEX 30 -#define PIC_IRT_USB_INDEX 31 - -#define PIC_NUM_IRTS 32 - -#define PIC_SYS_TIMER_MAXVAL_0_BASE 0x100 -#define PIC_SYS_TIMER_MAXVAL_1_BASE 0x110 - -#define PIC_SYS_TIMER_0_BASE 0x120 -#define PIC_SYS_TIMER_1_BASE 0x130 - -#define PIC_CLOCK_TIMER 7 - -#define PIC_CTRL 0x00 -#define PIC_IPI 0x04 -#define PIC_INT_ACK 0x06 - -#define WD_MAX_VAL_0 0x08 -#define WD_MAX_VAL_1 0x09 -#define WD_MASK_0 0x0a -#define WD_MASK_1 0x0b -#define WD_HEARBEAT_0 0x0c -#define WD_HEARBEAT_1 0x0d - -#define PIC_IRT_0_BASE 0x40 -#define PIC_IRT_1_BASE 0x80 - -#define PIC_IRT_0_WD (PIC_IRT_0_BASE + PIC_IRT_WD_INDEX) -#define PIC_IRT_1_WD (PIC_IRT_1_BASE + PIC_IRT_WD_INDEX) -#define PIC_IRT_0_TIMER_0 (PIC_IRT_0_BASE + PIC_IRT_TIMER_0_INDEX) -#define PIC_IRT_1_TIMER_0 (PIC_IRT_1_BASE + PIC_IRT_TIMER_0_INDEX) -#define PIC_IRT_0_TIMER_1 (PIC_IRT_0_BASE + PIC_IRT_TIMER_1_INDEX) -#define PIC_IRT_1_TIMER_1 (PIC_IRT_1_BASE + PIC_IRT_TIMER_1_INDEX) -#define PIC_IRT_0_TIMER_2 (PIC_IRT_0_BASE + PIC_IRT_TIMER_2_INDEX) -#define PIC_IRT_1_TIMER_2 (PIC_IRT_1_BASE + PIC_IRT_TIMER_2_INDEX) -#define PIC_IRT_0_TIMER_3 (PIC_IRT_0_BASE + PIC_IRT_TIMER_3_INDEX) -#define PIC_IRT_1_TIMER_3 (PIC_IRT_1_BASE + PIC_IRT_TIMER_3_INDEX) -#define PIC_IRT_0_TIMER_4 (PIC_IRT_0_BASE + PIC_IRT_TIMER_4_INDEX) -#define PIC_IRT_1_TIMER_4 (PIC_IRT_1_BASE + PIC_IRT_TIMER_4_INDEX) -#define PIC_IRT_0_TIMER_5 (PIC_IRT_0_BASE + PIC_IRT_TIMER_5_INDEX) -#define PIC_IRT_1_TIMER_5 (PIC_IRT_1_BASE + PIC_IRT_TIMER_5_INDEX) -#define PIC_IRT_0_TIMER_6 (PIC_IRT_0_BASE + PIC_IRT_TIMER_6_INDEX) -#define PIC_IRT_1_TIMER_6 (PIC_IRT_1_BASE + PIC_IRT_TIMER_6_INDEX) -#define PIC_IRT_0_TIMER_7 (PIC_IRT_0_BASE + PIC_IRT_TIMER_7_INDEX) -#define PIC_IRT_1_TIMER_7 (PIC_IRT_1_BASE + PIC_IRT_TIMER_7_INDEX) -#define PIC_IRT_0_CLOCK (PIC_IRT_0_TIMER_7) -#define PIC_IRT_1_CLOCK (PIC_IRT_1_TIMER_7) -#define PIC_IRT_0_UART_0 (PIC_IRT_0_BASE + PIC_IRT_UART_0_INDEX) -#define PIC_IRT_1_UART_0 (PIC_IRT_1_BASE + PIC_IRT_UART_0_INDEX) -#define PIC_IRT_0_UART_1 (PIC_IRT_0_BASE + PIC_IRT_UART_1_INDEX) -#define PIC_IRT_1_UART_1 (PIC_IRT_1_BASE + PIC_IRT_UART_1_INDEX) -#define PIC_IRT_0_I2C_0 (PIC_IRT_0_BASE + PIC_IRT_I2C_0_INDEX) -#define PIC_IRT_1_I2C_0 (PIC_IRT_1_BASE + PIC_IRT_I2C_0_INDEX) -#define PIC_IRT_0_I2C_1 (PIC_IRT_0_BASE + PIC_IRT_I2C_1_INDEX) -#define PIC_IRT_1_I2C_1 (PIC_IRT_1_BASE + PIC_IRT_I2C_1_INDEX) -#define PIC_IRT_0_HYPER (PIC_IRT_0_BASE + PIC_IRT_HYPER_INDEX) -#define PIC_IRT_1_HYPER (PIC_IRT_1_BASE + PIC_IRT_HYPER_INDEX) -#define PIC_IRT_0_PCIX (PIC_IRT_0_BASE + PIC_IRT_PCIX_INDEX) -#define PIC_IRT_1_PCIX (PIC_IRT_1_BASE + PIC_IRT_PCIX_INDEX) - -#define PIC_TIMER_0_MAXVAL_0 (PIC_SYS_TIMER_MAXVAL_0_BASE + 0) -#define PIC_TIMER_0_MAXVAL_1 (PIC_SYS_TIMER_MAXVAL_1_BASE + 0) -#define PIC_TIMER_0_COUNTER_0 (PIC_SYS_TIMER_0_BASE + 0) -#define PIC_TIMER_0_COUNTER_1 (PIC_SYS_TIMER_1_BASE + 0) -#define PIC_TIMER_6_MAXVAL_0 (PIC_SYS_TIMER_MAXVAL_0_BASE + 6) -#define PIC_TIMER_6_MAXVAL_1 (PIC_SYS_TIMER_MAXVAL_1_BASE + 6) -#define PIC_TIMER_6_COUNTER_0 (PIC_SYS_TIMER_0_BASE + 6) -#define PIC_TIMER_6_COUNTER_1 (PIC_SYS_TIMER_1_BASE + 6) -#define PIC_TIMER_7_MAXVAL_0 (PIC_SYS_TIMER_MAXVAL_0_BASE + 7) -#define PIC_TIMER_7_MAXVAL_1 (PIC_SYS_TIMER_MAXVAL_1_BASE + 7) -#define PIC_TIMER_7_COUNTER_0 (PIC_SYS_TIMER_0_BASE + 7) -#define PIC_TIMER_7_COUNTER_1 (PIC_SYS_TIMER_1_BASE + 7) - -#define PIC_IRQ_BASE 8 -#define PIC_IRT_FIRST_IRQ PIC_IRQ_BASE -#define PIC_WD_IRQ (PIC_IRQ_BASE + PIC_IRT_WD_INDEX) -#define PIC_TIMER_0_IRQ (PIC_IRQ_BASE + PIC_IRT_TIMER_0_INDEX) -#define PIC_TIMER_1_IRQ (PIC_IRQ_BASE + PIC_IRT_TIMER_1_INDEX) -#define PIC_TIMER_2_IRQ (PIC_IRQ_BASE + PIC_IRT_TIMER_2_INDEX) -#define PIC_TIMER_3_IRQ (PIC_IRQ_BASE + PIC_IRT_TIMER_3_INDEX) -#define PIC_TIMER_4_IRQ (PIC_IRQ_BASE + PIC_IRT_TIMER_4_INDEX) -#define PIC_TIMER_5_IRQ (PIC_IRQ_BASE + PIC_IRT_TIMER_5_INDEX) -#define PIC_TIMER_6_IRQ (PIC_IRQ_BASE + PIC_IRT_TIMER_6_INDEX) -#define PIC_TIMER_7_IRQ (PIC_IRQ_BASE + PIC_IRT_TIMER_7_INDEX) -#define PIC_CLOCK_IRQ (PIC_TIMER_7_IRQ) -#define PIC_UART_0_IRQ (PIC_IRQ_BASE + PIC_IRT_UART_0_INDEX) -#define PIC_UART_1_IRQ (PIC_IRQ_BASE + PIC_IRT_UART_1_INDEX) -#define PIC_I2C_0_IRQ (PIC_IRQ_BASE + PIC_IRT_I2C_0_INDEX) -#define PIC_I2C_1_IRQ (PIC_IRQ_BASE + PIC_IRT_I2C_1_INDEX) -#define PIC_PCMCIA_IRQ (PIC_IRQ_BASE + PIC_IRT_PCMCIA_INDEX) -#define PIC_GPIO_IRQ (PIC_IRQ_BASE + PIC_IRT_GPIO_INDEX) -#define PIC_HYPER_IRQ (PIC_IRQ_BASE + PIC_IRT_HYPER_INDEX) -#define PIC_PCIX_IRQ (PIC_IRQ_BASE + PIC_IRT_PCIX_INDEX) -#define PIC_GMAC_0_IRQ (PIC_IRQ_BASE + PIC_IRT_GMAC0_INDEX) -#define PIC_GMAC_1_IRQ (PIC_IRQ_BASE + PIC_IRT_GMAC1_INDEX) -#define PIC_GMAC_2_IRQ (PIC_IRQ_BASE + PIC_IRT_GMAC2_INDEX) -#define PIC_GMAC_3_IRQ (PIC_IRQ_BASE + PIC_IRT_GMAC3_INDEX) -#define PIC_XGS_0_IRQ (PIC_IRQ_BASE + PIC_IRT_XGS0_INDEX) -#define PIC_XGS_1_IRQ (PIC_IRQ_BASE + PIC_IRT_XGS1_INDEX) -#define PIC_HYPER_FATAL_IRQ (PIC_IRQ_BASE + PIC_IRT_HYPER_FATAL_INDEX) -#define PIC_PCIX_FATAL_IRQ (PIC_IRQ_BASE + PIC_IRT_PCIX_FATAL_INDEX) -#define PIC_BRIDGE_AERR_IRQ (PIC_IRQ_BASE + PIC_IRT_BRIDGE_AERR_INDEX) -#define PIC_BRIDGE_BERR_IRQ (PIC_IRQ_BASE + PIC_IRT_BRIDGE_BERR_INDEX) -#define PIC_BRIDGE_TB_IRQ (PIC_IRQ_BASE + PIC_IRT_BRIDGE_TB_INDEX) -#define PIC_BRIDGE_AERR_NMI_IRQ (PIC_IRQ_BASE + PIC_IRT_BRIDGE_AERR_NMI_INDEX) - -#define PIC_BRIDGE_ERR_IRQ (PIC_IRQ_BASE + PIC_IRT_BRIDGE_ERR_INDEX) -#define PIC_PCIE_LINK0_IRQ (PIC_IRQ_BASE + PIC_IRT_PCIE_LINK0_INDEX) -#define PIC_PCIE_LINK1_IRQ (PIC_IRQ_BASE + PIC_IRT_PCIE_LINK1_INDEX) -#define PIC_PCIE_LINK2_IRQ (PIC_IRQ_BASE + PIC_IRT_PCIE_LINK2_INDEX) -#define PIC_PCIE_LINK3_IRQ (PIC_IRQ_BASE + PIC_IRT_PCIE_LINK3_INDEX) -#define PIC_PCIE_INT_IRQ (PIC_IRQ_BASE + PIC_IRT_PCIE_INT__INDEX) -#define PIC_PCIE_FATAL_IRQ (PIC_IRQ_BASE + PIC_IRT_PCIE_FATAL_INDEX) -#define PIC_GPIO_B_IRQ (PIC_IRQ_BASE + PIC_IRT_GPIO_B_INDEX) -#define PIC_USB_IRQ (PIC_IRQ_BASE + PIC_IRT_USB_INDEX) - -#define PIC_IRT_LAST_IRQ PIC_USB_IRQ - -#define PIC_IRQ_IS_EDGE_TRIGGERED(irq) ( ((irq)>=PIC_TIMER_0_IRQ) && ((irq)<=PIC_TIMER_7_IRQ) ) - -#define PIC_IRQ_IS_IRT(irq) ( ((irq)>=PIC_IRT_FIRST_IRQ) && ((irq)<=PIC_IRT_LAST_IRQ) ) - +#define PIC_IRT_BRIDGE_ERR_INDEX 25 +#define PIC_IRT_PCIE_LINK0_INDEX 26 +#define PIC_IRT_PCIE_LINK1_INDEX 27 +#define PIC_IRT_PCIE_LINK2_INDEX 23 +#define PIC_IRT_PCIE_LINK3_INDEX 24 +#define PIC_IRT_PCIE_INT_INDEX 28 +#define PIC_IRT_PCIE_FATAL_INDEX 29 +#define PIC_IRT_GPIO_B_INDEX 30 +#define PIC_IRT_USB_INDEX 31 + +#define PIC_NUM_IRTS 32 + +#define PIC_CLOCK_TIMER 7 + +#define PIC_CTRL 0x00 +#define PIC_IPI 0x04 +#define PIC_INT_ACK 0x06 + +#define WD_MAX_VAL_0 0x08 +#define WD_MAX_VAL_1 0x09 +#define WD_MASK_0 0x0a +#define WD_MASK_1 0x0b +#define WD_HEARBEAT_0 0x0c +#define WD_HEARBEAT_1 0x0d + +#define PIC_IRT_0_BASE 0x40 +#define PIC_IRT_1_BASE 0x80 +#define PIC_TIMER_MAXVAL_0_BASE 0x100 +#define PIC_TIMER_MAXVAL_1_BASE 0x110 +#define PIC_TIMER_COUNT_0_BASE 0x120 +#define PIC_TIMER_COUNT_1_BASE 0x130 + + +#define PIC_IRT_0(picintr) (PIC_IRT_0_BASE + (picintr)) +#define PIC_IRT_1(picintr) (PIC_IRT_1_BASE + (picintr)) + +#define PIC_TIMER_MAXVAL_0(i) (PIC_TIMER_MAXVAL_0_BASE + (i)) +#define PIC_TIMER_MAXVAL_1(i) (PIC_TIMER_MAXVAL_1_BASE + (i)) +#define PIC_TIMER_COUNT_0(i) (PIC_TIMER_COUNT_0_BASE + (i)) +#define PIC_TIMER_COUNT_1(i) (PIC_TIMER_COUNT_0_BASE + (i)) + +#define PIC_IRQ_BASE 8 +#define PIC_IRT_FIRST_IRQ PIC_IRQ_BASE + +#define PIC_WD_IRQ (PIC_IRQ_BASE + PIC_IRT_WD_INDEX) +#define PIC_TIMER_IRQ(i) (PIC_IRQ_BASE + PIC_IRT_TIMER_INDEX(i)) +#define PIC_CLOCK_IRQ PIC_TIMER_IRQ(PIC_CLOCK_TIMER) + +#define PIC_UART_0_IRQ (PIC_IRQ_BASE + PIC_IRT_UART_0_INDEX) +#define PIC_UART_1_IRQ (PIC_IRQ_BASE + PIC_IRT_UART_1_INDEX) +#define PIC_I2C_0_IRQ (PIC_IRQ_BASE + PIC_IRT_I2C_0_INDEX) +#define PIC_I2C_1_IRQ (PIC_IRQ_BASE + PIC_IRT_I2C_1_INDEX) +#define PIC_PCMCIA_IRQ (PIC_IRQ_BASE + PIC_IRT_PCMCIA_INDEX) +#define PIC_GPIO_IRQ (PIC_IRQ_BASE + PIC_IRT_GPIO_INDEX) +#define PIC_HYPER_IRQ (PIC_IRQ_BASE + PIC_IRT_HYPER_INDEX) +#define PIC_PCIX_IRQ (PIC_IRQ_BASE + PIC_IRT_PCIX_INDEX) +#define PIC_GMAC_0_IRQ (PIC_IRQ_BASE + PIC_IRT_GMAC0_INDEX) +#define PIC_GMAC_1_IRQ (PIC_IRQ_BASE + PIC_IRT_GMAC1_INDEX) +#define PIC_GMAC_2_IRQ (PIC_IRQ_BASE + PIC_IRT_GMAC2_INDEX) +#define PIC_GMAC_3_IRQ (PIC_IRQ_BASE + PIC_IRT_GMAC3_INDEX) +#define PIC_XGS_0_IRQ (PIC_IRQ_BASE + PIC_IRT_XGS0_INDEX) +#define PIC_XGS_1_IRQ (PIC_IRQ_BASE + PIC_IRT_XGS1_INDEX) +#define PIC_HYPER_FATAL_IRQ (PIC_IRQ_BASE + PIC_IRT_HYPER_FATAL_INDEX) +#define PIC_PCIX_FATAL_IRQ (PIC_IRQ_BASE + PIC_IRT_PCIX_FATAL_INDEX) +#define PIC_BRIDGE_AERR_IRQ (PIC_IRQ_BASE + PIC_IRT_BRIDGE_AERR_INDEX) +#define PIC_BRIDGE_BERR_IRQ (PIC_IRQ_BASE + PIC_IRT_BRIDGE_BERR_INDEX) +#define PIC_BRIDGE_TB_IRQ (PIC_IRQ_BASE + PIC_IRT_BRIDGE_TB_INDEX) +#define PIC_BRIDGE_AERR_NMI_IRQ (PIC_IRQ_BASE + PIC_IRT_BRIDGE_AERR_NMI_INDEX) + +#define PIC_BRIDGE_ERR_IRQ (PIC_IRQ_BASE + PIC_IRT_BRIDGE_ERR_INDEX) +#define PIC_PCIE_LINK0_IRQ (PIC_IRQ_BASE + PIC_IRT_PCIE_LINK0_INDEX) +#define PIC_PCIE_LINK1_IRQ (PIC_IRQ_BASE + PIC_IRT_PCIE_LINK1_INDEX) +#define PIC_PCIE_LINK2_IRQ (PIC_IRQ_BASE + PIC_IRT_PCIE_LINK2_INDEX) +#define PIC_PCIE_LINK3_IRQ (PIC_IRQ_BASE + PIC_IRT_PCIE_LINK3_INDEX) +#define PIC_PCIE_INT_IRQ (PIC_IRQ_BASE + PIC_IRT_PCIE_INT__INDEX) +#define PIC_PCIE_FATAL_IRQ (PIC_IRQ_BASE + PIC_IRT_PCIE_FATAL_INDEX) +#define PIC_GPIO_B_IRQ (PIC_IRQ_BASE + PIC_IRT_GPIO_B_INDEX) +#define PIC_USB_IRQ (PIC_IRQ_BASE + PIC_IRT_USB_INDEX) + +#define PIC_IRT_LAST_IRQ PIC_USB_IRQ +#define PIC_IRQ_IS_EDGE_TRIGGERED(irq) (((irq) >= PIC_TIMER_IRQ(0)) && ((irq) <= PIC_TIMER_IRQ(7))) +#define PIC_IRQ_IS_IRT(irq) (((irq) >= PIC_IRT_FIRST_IRQ) && ((irq) <= PIC_IRT_LAST_IRQ)) extern struct mtx xlr_pic_lock; - -static __inline__ __uint32_t -pic_read_control(int haslock) +static __inline uint32_t +pic_read_control(void) { xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET); - __uint32_t reg; + uint32_t reg; - if ((rmi_spin_mutex_safe) && (haslock == 0)) - mtx_lock_spin(&xlr_pic_lock); + mtx_lock_spin(&xlr_pic_lock); xlr_read_reg(mmio, PIC_CTRL); - if ((rmi_spin_mutex_safe) && (haslock == 0)) - mtx_unlock_spin(&xlr_pic_lock); - return reg; + mtx_unlock_spin(&xlr_pic_lock); + return (reg); } -static __inline__ void -pic_write_control(__uint32_t control, int haslock) +static __inline void +pic_write_control(uint32_t control) { xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET); - if ((rmi_spin_mutex_safe) && (haslock == 0)) - mtx_lock_spin(&xlr_pic_lock); + mtx_lock_spin(&xlr_pic_lock); xlr_write_reg(mmio, PIC_CTRL, control); - if ((rmi_spin_mutex_safe) && (haslock == 0)) - mtx_unlock_spin(&xlr_pic_lock); + mtx_unlock_spin(&xlr_pic_lock); } -static __inline__ void -pic_update_control(__uint32_t control, int haslock) + +static __inline void +pic_update_control(__uint32_t control) { xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET); - if ((rmi_spin_mutex_safe) && (haslock == 0)) - mtx_lock_spin(&xlr_pic_lock); + mtx_lock_spin(&xlr_pic_lock); xlr_write_reg(mmio, PIC_CTRL, (control | xlr_read_reg(mmio, PIC_CTRL))); - if ((rmi_spin_mutex_safe) && (haslock == 0)) - mtx_unlock_spin(&xlr_pic_lock); + mtx_unlock_spin(&xlr_pic_lock); } -static __inline__ void -pic_ack(int irq, int haslock) +static __inline void +pic_ack(int irq) { xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET); @@ -253,44 +188,51 @@ pic_ack(int irq, int haslock) return; if (PIC_IRQ_IS_EDGE_TRIGGERED(irq)) { - if ((rmi_spin_mutex_safe) && (haslock == 0)) mtx_lock_spin(&xlr_pic_lock); - xlr_write_reg(mmio, PIC_INT_ACK, (1 << (irq - PIC_IRQ_BASE))); - if ((rmi_spin_mutex_safe) && (haslock == 0)) + xlr_write_reg(mmio, PIC_INT_ACK, (1 << (irq - PIC_IRQ_BASE))); mtx_unlock_spin(&xlr_pic_lock); - return; } return; } -static inline void -pic_delayed_ack(int irq, int haslock) +static __inline void +pic_delayed_ack(int irq) { xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET); if (!PIC_IRQ_IS_IRT(irq)) return; - if (!PIC_IRQ_IS_EDGE_TRIGGERED(irq)) { - if ((rmi_spin_mutex_safe)&& (haslock == 0)) - mtx_lock_spin(&xlr_pic_lock); + mtx_lock_spin(&xlr_pic_lock); xlr_write_reg(mmio, PIC_INT_ACK, (1 << (irq - PIC_IRQ_BASE))); - if ((rmi_spin_mutex_safe) && (haslock == 0)) - mtx_unlock_spin(&xlr_pic_lock); - return; + mtx_unlock_spin(&xlr_pic_lock); } + return; } -static inline -void pic_send_ipi(int cpu, int ipi, int haslock) +static __inline +void pic_send_ipi(int cpu, int ipi) { - xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET); - int tid, pid; + xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET); + int tid, pid; + + tid = cpu & 0x3; + pid = (cpu >> 2) & 0x7; + xlr_write_reg(mmio, PIC_IPI, (pid << 20) | (tid << 16) | ipi); +} - tid = cpu & 0x3; - pid = (cpu >> 2) & 0x7; +static __inline +void pic_setup_intr(int picintr, int irq, uint32_t cpumask) +{ + xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET); + int level; - xlr_write_reg(mmio, PIC_IPI, (pid << 20) | (tid << 16) | ipi); + mtx_lock_spin(&xlr_pic_lock); + level = PIC_IRQ_IS_EDGE_TRIGGERED(irq); + xlr_write_reg(mmio, PIC_IRT_0(picintr), cpumask); + xlr_write_reg(mmio, PIC_IRT_1(picintr), ((1 << 31) | (level << 30) | + (1 << 6) | irq)); + mtx_unlock_spin(&xlr_pic_lock); } -#endif /* _RMI_PIC_H_ */ +#endif /* _RMI_PIC_H_ */ Modified: head/sys/mips/rmi/xlr_machdep.c ============================================================================== --- head/sys/mips/rmi/xlr_machdep.c Wed Aug 25 11:11:14 2010 (r211810) +++ head/sys/mips/rmi/xlr_machdep.c Wed Aug 25 11:49:48 2010 (r211811) @@ -89,7 +89,6 @@ struct mtx xlr_pic_lock; * Parameters from boot loader */ struct boot1_info xlr_boot1_info; -struct xlr_loader_info xlr_loader_info; /* FIXME : Unused */ int xlr_run_mode; int xlr_argc; int32_t *xlr_argv, *xlr_envp; @@ -574,8 +573,7 @@ void platform_ipi_send(int cpuid) { - pic_send_ipi(xlr_cpuid_to_hwtid[cpuid], - platform_ipi_intrnum(), 0); + pic_send_ipi(xlr_cpuid_to_hwtid[cpuid], platform_ipi_intrnum()); } Modified: head/sys/mips/rmi/xlr_pci.c ============================================================================== --- head/sys/mips/rmi/xlr_pci.c Wed Aug 25 11:11:14 2010 (r211810) +++ head/sys/mips/rmi/xlr_pci.c Wed Aug 25 11:49:48 2010 (r211811) @@ -122,6 +122,7 @@ static struct rman irq_rman, port_rman, static void xlr_pci_init_resources(void) { + irq_rman.rm_start = 0; irq_rman.rm_end = 255; irq_rman.rm_type = RMAN_ARRAY; @@ -150,6 +151,7 @@ xlr_pci_init_resources(void) static int xlr_pcib_probe(device_t dev) { + if (xlr_board_info.is_xls) device_set_desc(dev, "XLS PCIe bus"); else @@ -158,12 +160,13 @@ xlr_pcib_probe(device_t dev) xlr_pci_init_resources(); xlr_pci_config_base = (void *)MIPS_PHYS_TO_KSEG1(DEFAULT_PCI_CONFIG_BASE); - return 0; + return (0); } static int xlr_pcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) { + switch (which) { case PCIB_IVAR_DOMAIN: *result = 0; @@ -190,14 +193,16 @@ xlr_pcib_write_ivar(device_t dev, device static int xlr_pcib_maxslots(device_t dev) { + return (PCI_SLOTMAX); } static __inline__ void disable_and_clear_cache_error(void) { - uint64_t lsu_cfg0 = read_64bit_phnx_ctrl_reg(CPU_BLOCKID_LSU, LSU_CFG0_REGID); + uint64_t lsu_cfg0; + lsu_cfg0 = read_64bit_phnx_ctrl_reg(CPU_BLOCKID_LSU, LSU_CFG0_REGID); lsu_cfg0 = lsu_cfg0 & ~0x2e; write_64bit_phnx_ctrl_reg(CPU_BLOCKID_LSU, LSU_CFG0_REGID, lsu_cfg0); /* Clear cache error log */ @@ -227,17 +232,17 @@ pci_cfg_read_32bit(uint32_t addr) uint64_t cerr_cpu_log = 0; disable_and_clear_cache_error(); - temp = bswap32(*p); /* Read cache err log */ - cerr_cpu_log = read_64bit_phnx_ctrl_reg(CPU_BLOCKID_LSU, LSU_CERRLOG_REGID); + cerr_cpu_log = read_64bit_phnx_ctrl_reg(CPU_BLOCKID_LSU, + LSU_CERRLOG_REGID); if (cerr_cpu_log) { /* Device don't exist. */ temp = ~0x0; } clear_and_enable_cache_error(); - return temp; + return (temp); } static u_int32_t @@ -258,7 +263,7 @@ xlr_pcib_read_config(device_t dev, u_int else if (width == 2) return ((data >> ((reg & 3) << 3)) & 0xffff); else - return data; + return (data); } static void @@ -294,14 +299,16 @@ xlr_pcib_write_config(device_t dev, u_in static int xlr_pcib_attach(device_t dev) { + device_add_child(dev, "pci", 0); bus_generic_attach(dev); - return 0; + return (0); } static void xlr_pcib_identify(driver_t * driver, device_t parent) { + if (xlr_board_info.is_xls) { xlr_reg_t *pcie_mmio_le = xlr_io_mmio(XLR_IO_PCIE_1_OFFSET); xlr_reg_t reg_link0 = xlr_read_reg(pcie_mmio_le, (0x80 >> 2)); @@ -325,14 +332,13 @@ xlr_alloc_msi(device_t pcib, device_t de int i; device_t parent, tmp; - /* find the lane on which the slot is connected to */ tmp = dev; while (1) { parent = device_get_parent(tmp); if (parent == NULL || parent == pcib) { device_printf(dev, "Cannot find parent bus\n"); - return ENXIO; + return (ENXIO); } if (strcmp(device_get_nameunit(parent), "pci0") == 0) break; @@ -353,7 +359,7 @@ xlr_alloc_msi(device_t pcib, device_t de pciirq = PIC_PCIE_LINK3_IRQ; break; default: - return ENXIO; + return (ENXIO); } irqs[0] = pciirq; @@ -364,45 +370,49 @@ xlr_alloc_msi(device_t pcib, device_t de for (i = 1; i < count; i++) irqs[i] = pciirq + 64 * i; - return 0; + return (0); } static int xlr_release_msi(device_t pcib, device_t dev, int count, int *irqs) { - device_printf(dev, "%s: msi release %d\n", device_get_nameunit(pcib), count); - return 0; + device_printf(dev, "%s: msi release %d\n", device_get_nameunit(pcib), + count); + return (0); } static int -xlr_map_msi(device_t pcib, device_t dev, int irq, uint64_t * addr, uint32_t * data) +xlr_map_msi(device_t pcib, device_t dev, int irq, uint64_t * addr, + uint32_t * data) { + switch (irq) { - case PIC_PCIE_LINK0_IRQ: - case PIC_PCIE_LINK1_IRQ: - case PIC_PCIE_LINK2_IRQ: - case PIC_PCIE_LINK3_IRQ: + case PIC_PCIE_LINK0_IRQ: + case PIC_PCIE_LINK1_IRQ: + case PIC_PCIE_LINK2_IRQ: + case PIC_PCIE_LINK3_IRQ: *addr = MIPS_MSI_ADDR(0); *data = MIPS_MSI_DATA(irq); - return 0; + return (0); default: - device_printf(dev, "%s: map_msi for irq %d - ignored", device_get_nameunit(pcib), - irq); + device_printf(dev, "%s: map_msi for irq %d - ignored", + device_get_nameunit(pcib), irq); return (ENXIO); } - } static void bridge_pcix_ack(void *arg) { + xlr_read_reg(xlr_io_mmio(XLR_IO_PCIX_OFFSET), 0x140 >> 2); } static void bridge_pcix_mask_ack(void *arg) { + xlr_mask_hard_irq(arg); bridge_pcix_ack(arg); } @@ -415,20 +425,28 @@ bridge_pcie_ack(void *arg) xlr_reg_t *pcie_mmio_le = xlr_io_mmio(XLR_IO_PCIE_1_OFFSET); switch (irq) { - case PIC_PCIE_LINK0_IRQ : reg = PCIE_LINK0_MSI_STATUS; break; - case PIC_PCIE_LINK1_IRQ : reg = PCIE_LINK1_MSI_STATUS; break; - case PIC_PCIE_LINK2_IRQ : reg = PCIE_LINK2_MSI_STATUS; break; - case PIC_PCIE_LINK3_IRQ : reg = PCIE_LINK3_MSI_STATUS; break; + case PIC_PCIE_LINK0_IRQ: + reg = PCIE_LINK0_MSI_STATUS; + break; + case PIC_PCIE_LINK1_IRQ: + reg = PCIE_LINK1_MSI_STATUS; + break; + case PIC_PCIE_LINK2_IRQ: + reg = PCIE_LINK2_MSI_STATUS; + break; + case PIC_PCIE_LINK3_IRQ: + reg = PCIE_LINK3_MSI_STATUS; + break; default: return; } - xlr_write_reg(pcie_mmio_le, reg>>2, 0xffffffff); } static void bridge_pcie_mask_ack(void *arg) { + xlr_mask_hard_irq(arg); bridge_pcie_ack(arg); } @@ -440,8 +458,6 @@ mips_platform_pci_setup_intr(device_t de driver_intr_t * intr, void *arg, void **cookiep) { - int level; - xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET); int error = 0; int xlrirq; @@ -451,43 +467,29 @@ mips_platform_pci_setup_intr(device_t de if (rman_get_start(irq) != rman_get_end(irq)) { device_printf(dev, "Interrupt allocation %lu != %lu\n", rman_get_start(irq), rman_get_end(irq)); - return EINVAL; + return (EINVAL); } xlrirq = rman_get_start(irq); if (strcmp(device_get_name(dev), "pcib") != 0) - return 0; + return (0); if (xlr_board_info.is_xls == 0) { - if (rmi_spin_mutex_safe) - mtx_lock_spin(&xlr_pic_lock); - level = PIC_IRQ_IS_EDGE_TRIGGERED(PIC_IRT_PCIX_INDEX); - xlr_write_reg(mmio, PIC_IRT_0_PCIX, 0x01); - xlr_write_reg(mmio, PIC_IRT_1_PCIX, ((1 << 31) | (level << 30) | - (1 << 6) | (PIC_PCIX_IRQ))); - if (rmi_spin_mutex_safe) - mtx_unlock_spin(&xlr_pic_lock); xlr_cpu_establish_hardintr(device_get_name(child), filt, intr, arg, PIC_PCIX_IRQ, flags, cookiep, bridge_pcix_mask_ack, xlr_unmask_hard_irq, bridge_pcix_ack, NULL); + pic_setup_intr(PIC_IRT_PCIX_INDEX, PIC_PCIX_IRQ, 0x1); } else { - if (rmi_spin_mutex_safe) - mtx_lock_spin(&xlr_pic_lock); - xlr_write_reg(mmio, PIC_IRT_0_BASE + xlrirq - PIC_IRQ_BASE, 0x01); - xlr_write_reg(mmio, PIC_IRT_1_BASE + xlrirq - PIC_IRQ_BASE, - ((1 << 31) | (1 << 30) | (1 << 6) | xlrirq)); - if (rmi_spin_mutex_safe) - mtx_unlock_spin(&xlr_pic_lock); - xlr_cpu_establish_hardintr(device_get_name(child), filt, intr, arg, xlrirq, flags, cookiep, bridge_pcie_mask_ack, xlr_unmask_hard_irq, bridge_pcie_ack, NULL); + pic_setup_intr(xlrirq - PIC_IRQ_BASE, xlrirq, 0x1); } - return bus_generic_setup_intr(dev, child, irq, flags, filt, intr, - arg, cookiep); + return (bus_generic_setup_intr(dev, child, irq, flags, filt, intr, + arg, cookiep)); } static int @@ -498,7 +500,7 @@ mips_platform_pci_teardown_intr(device_t /* if needed reprogram the pic to clear pcix related entry */ device_printf(dev, "teardown intr\n"); } - return bus_generic_teardown_intr(dev, child, irq, cookie); + return (bus_generic_teardown_intr(dev, child, irq, cookie)); } static struct resource * @@ -524,12 +526,12 @@ xlr_pci_alloc_resource(device_t bus, dev break; default: - return 0; + return (0); } rv = rman_reserve_resource(rm, start, end, count, flags, child); if (rv == 0) - return 0; + return (0); rman_set_rid(rv, *rid); @@ -547,13 +549,14 @@ xlr_pci_alloc_resource(device_t bus, dev return (NULL); } } - return rv; + return (rv); } static int xlr_pci_release_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { + return (rman_release_resource(r)); } @@ -561,6 +564,7 @@ static int xlr_pci_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { + return (rman_activate_resource(r)); } @@ -568,12 +572,14 @@ static int xlr_pci_deactivate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { + return (rman_deactivate_resource(r)); } static int mips_pci_route_interrupt(device_t bus, device_t dev, int pin) { + /* * Validate requested pin number. */ @@ -583,13 +589,13 @@ mips_pci_route_interrupt(device_t bus, d if (xlr_board_info.is_xls) { switch (pin) { case 1: - return PIC_PCIE_LINK0_IRQ; + return (PIC_PCIE_LINK0_IRQ); case 2: - return PIC_PCIE_LINK1_IRQ; + return (PIC_PCIE_LINK1_IRQ); case 3: - return PIC_PCIE_LINK2_IRQ; + return (PIC_PCIE_LINK2_IRQ); case 4: - return PIC_PCIE_LINK3_IRQ; + return (PIC_PCIE_LINK3_IRQ); } } else { if (pin == 1) { From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 12:10:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66F011065674; Wed, 25 Aug 2010 12:10:21 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C0A78FC18; Wed, 25 Aug 2010 12:10:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7PCALeE010956; Wed, 25 Aug 2010 12:10:21 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7PCALXt010953; Wed, 25 Aug 2010 12:10:21 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201008251210.o7PCALXt010953@svn.freebsd.org> From: "Jayachandran C." Date: Wed, 25 Aug 2010 12:10:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211812 - head/sys/mips/rmi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 12:10:21 -0000 Author: jchandra Date: Wed Aug 25 12:10:20 2010 New Revision: 211812 URL: http://svn.freebsd.org/changeset/base/211812 Log: XLR PIC code update. - Fix a bug in xlr_pic_init (use irq in PIC_IRQ_IS_EDGE_TRIGGERED) - use new macro PIC_INTR_TO_IRQ() and PIC_IRT_x() in xlr_pic_init Modified: head/sys/mips/rmi/pic.h head/sys/mips/rmi/xlr_machdep.c Modified: head/sys/mips/rmi/pic.h ============================================================================== --- head/sys/mips/rmi/pic.h Wed Aug 25 11:49:48 2010 (r211811) +++ head/sys/mips/rmi/pic.h Wed Aug 25 12:10:20 2010 (r211812) @@ -93,7 +93,6 @@ #define PIC_TIMER_COUNT_0_BASE 0x120 #define PIC_TIMER_COUNT_1_BASE 0x130 - #define PIC_IRT_0(picintr) (PIC_IRT_0_BASE + (picintr)) #define PIC_IRT_1(picintr) (PIC_IRT_1_BASE + (picintr)) @@ -102,7 +101,14 @@ #define PIC_TIMER_COUNT_0(i) (PIC_TIMER_COUNT_0_BASE + (i)) #define PIC_TIMER_COUNT_1(i) (PIC_TIMER_COUNT_0_BASE + (i)) +/* + * We use a simple mapping form PIC interrupts to CPU IRQs. + * The PIC interrupts 0-31 are mapped to CPU irq's 8-39. + * this leaves the lower 0-7 for the cpu interrupts (like + * count/compare, msgrng) and 40-63 for IPIs + */ #define PIC_IRQ_BASE 8 +#define PIC_INTR_TO_IRQ(i) (PIC_IRQ_BASE + (i)) #define PIC_IRT_FIRST_IRQ PIC_IRQ_BASE #define PIC_WD_IRQ (PIC_IRQ_BASE + PIC_IRT_WD_INDEX) Modified: head/sys/mips/rmi/xlr_machdep.c ============================================================================== --- head/sys/mips/rmi/xlr_machdep.c Wed Aug 25 11:49:48 2010 (r211811) +++ head/sys/mips/rmi/xlr_machdep.c Wed Aug 25 12:10:20 2010 (r211812) @@ -282,22 +282,23 @@ static void xlr_pic_init(void) { xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET); - int i, level; + int i, level, irq; mtx_init(&xlr_pic_lock, "pic", NULL, MTX_SPIN); xlr_write_reg(mmio, PIC_CTRL, 0); for (i = 0; i < PIC_NUM_IRTS; i++) { - level = PIC_IRQ_IS_EDGE_TRIGGERED(i); + irq = PIC_INTR_TO_IRQ(i); + level = PIC_IRQ_IS_EDGE_TRIGGERED(irq); /* Bind all PIC irqs to cpu 0 */ - xlr_write_reg(mmio, PIC_IRT_0_BASE + i, 0x01); + xlr_write_reg(mmio, PIC_IRT_0(i), 0x01); /* * Use local scheduling and high polarity for all IRTs * Invalidate all IRTs, by default */ - xlr_write_reg(mmio, PIC_IRT_1_BASE + i, (level << 30) | (1 << 6) | - (PIC_IRQ_BASE + i)); + xlr_write_reg(mmio, PIC_IRT_1(i), (level << 30) | (1 << 6) | + irq); } } From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 12:35:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B591210656AD; Wed, 25 Aug 2010 12:35:36 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A59428FC17; Wed, 25 Aug 2010 12:35:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7PCZaD3011628; Wed, 25 Aug 2010 12:35:36 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7PCZa88011626; Wed, 25 Aug 2010 12:35:36 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008251235.o7PCZa88011626@svn.freebsd.org> From: Rui Paulo Date: Wed, 25 Aug 2010 12:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211813 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 12:35:36 -0000 Author: rpaulo Date: Wed Aug 25 12:35:36 2010 New Revision: 211813 URL: http://svn.freebsd.org/changeset/base/211813 Log: Add the necessary DTrace function pointers. Sponsored by: The FreeBSD Foundation Modified: head/sys/sys/dtrace_bsd.h Modified: head/sys/sys/dtrace_bsd.h ============================================================================== --- head/sys/sys/dtrace_bsd.h Wed Aug 25 12:10:20 2010 (r211812) +++ head/sys/sys/dtrace_bsd.h Wed Aug 25 12:35:36 2010 (r211813) @@ -37,6 +37,7 @@ struct trapframe; struct thread; struct vattr; struct vnode; +struct reg; /* * Cyclic clock function type definition used to hook the cyclic @@ -71,6 +72,14 @@ typedef void (*dtrace_doubletrap_func_t) extern dtrace_invop_func_t dtrace_invop_func; extern dtrace_doubletrap_func_t dtrace_doubletrap_func; +/* Pid provider hooks */ +typedef int (*dtrace_fasttrap_probe_ptr_t)(struct reg *); +extern dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; +typedef int (*dtrace_pid_probe_ptr_t)(struct reg *); +extern dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; +typedef int (*dtrace_return_probe_ptr_t)(struct reg *); +extern dtrace_return_probe_ptr_t dtrace_return_probe_ptr; + /* Virtual time hook function type. */ typedef void (*dtrace_vtime_switch_func_t)(struct thread *); From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 13:37:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 819E410656A9; Wed, 25 Aug 2010 13:37:55 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5762C8FC0C; Wed, 25 Aug 2010 13:37:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7PDbtIq012952; Wed, 25 Aug 2010 13:37:55 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7PDbtWq012949; Wed, 25 Aug 2010 13:37:55 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201008251337.o7PDbtWq012949@svn.freebsd.org> From: "Jayachandran C." Date: Wed, 25 Aug 2010 13:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211814 - head/sys/mips/rmi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 13:37:55 -0000 Author: jchandra Date: Wed Aug 25 13:37:55 2010 New Revision: 211814 URL: http://svn.freebsd.org/changeset/base/211814 Log: Provide timecounter based on XLR PIC timer. - Use timer 7 in XLR PIC as a 32 counter - provide pic_init_timer(), pic_set_timer(), pic_timer_count32() and pic_timer_count() PIC timer operations. - register this timer as platform_timecounter on rmi platform. Modified: head/sys/mips/rmi/pic.h head/sys/mips/rmi/xlr_machdep.c Modified: head/sys/mips/rmi/pic.h ============================================================================== --- head/sys/mips/rmi/pic.h Wed Aug 25 12:35:36 2010 (r211813) +++ head/sys/mips/rmi/pic.h Wed Aug 25 13:37:55 2010 (r211814) @@ -100,6 +100,8 @@ #define PIC_TIMER_MAXVAL_1(i) (PIC_TIMER_MAXVAL_1_BASE + (i)) #define PIC_TIMER_COUNT_0(i) (PIC_TIMER_COUNT_0_BASE + (i)) #define PIC_TIMER_COUNT_1(i) (PIC_TIMER_COUNT_0_BASE + (i)) +#define PIC_TIMER_HZ 66000000U + /* * We use a simple mapping form PIC interrupts to CPU IRQs. @@ -241,4 +243,54 @@ void pic_setup_intr(int picintr, int irq mtx_unlock_spin(&xlr_pic_lock); } +static __inline void +pic_init_timer(int timer) +{ + xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET); + uint32_t val; + + mtx_lock_spin(&xlr_pic_lock); + val = xlr_read_reg(mmio, PIC_CTRL); + val |= (1 << (8 + timer)); + xlr_write_reg(mmio, PIC_CTRL, val); + mtx_unlock_spin(&xlr_pic_lock); +} + +static __inline void +pic_set_timer(int timer, uint64_t maxval) +{ + xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET); + + xlr_write_reg(mmio, PIC_TIMER_MAXVAL_0(timer), + (maxval & 0xffffffff)); + xlr_write_reg(mmio, PIC_TIMER_MAXVAL_1(timer), + (maxval >> 32) & 0xffffffff); +} + +static __inline uint32_t +pic_timer_count32(int timer) + { + xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET); + + return (xlr_read_reg(mmio, PIC_TIMER_COUNT_0(timer))); +} + +/* + * The timer can wrap 32 bits between the two reads, so we + * need additional logic to detect that. + */ +static __inline uint64_t +pic_timer_count(int timer) +{ + xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET); + uint32_t tu1, tu2, tl; + + tu1 = xlr_read_reg(mmio, PIC_TIMER_COUNT_1(timer)); + tl = xlr_read_reg(mmio, PIC_TIMER_COUNT_0(timer)); + tu2 = xlr_read_reg(mmio, PIC_TIMER_COUNT_1(timer)); + if (tu2 != tu1) + tl = xlr_read_reg(mmio, PIC_TIMER_COUNT_0(timer)); + return (((uint64_t)tu2 << 32) | tl); +} + #endif /* _RMI_PIC_H_ */ Modified: head/sys/mips/rmi/xlr_machdep.c ============================================================================== --- head/sys/mips/rmi/xlr_machdep.c Wed Aug 25 12:35:36 2010 (r211813) +++ head/sys/mips/rmi/xlr_machdep.c Wed Aug 25 13:37:55 2010 (r211814) @@ -278,14 +278,31 @@ mips_init(void) mutex_init(); } +u_int +platform_get_timecount(struct timecounter *tc __unused) +{ + + return (0xffffffffU - pic_timer_count32(PIC_CLOCK_TIMER)); +} + static void xlr_pic_init(void) { + struct timecounter pic_timecounter = { + platform_get_timecount, /* get_timecount */ + 0, /* no poll_pps */ + ~0U, /* counter_mask */ + PIC_TIMER_HZ, /* frequency */ + "XLRPIC", /* name */ + 2000, /* quality (adjusted in code) */ + }; xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET); int i, level, irq; mtx_init(&xlr_pic_lock, "pic", NULL, MTX_SPIN); xlr_write_reg(mmio, PIC_CTRL, 0); + + /* Initialize all IRT entries */ for (i = 0; i < PIC_NUM_IRTS; i++) { irq = PIC_INTR_TO_IRQ(i); level = PIC_IRQ_IS_EDGE_TRIGGERED(irq); @@ -300,6 +317,11 @@ xlr_pic_init(void) xlr_write_reg(mmio, PIC_IRT_1(i), (level << 30) | (1 << 6) | irq); } + + /* Setup timer 7 of PIC as a timestamp, no interrupts */ + pic_init_timer(PIC_CLOCK_TIMER); + pic_set_timer(PIC_CLOCK_TIMER, ~UINT64_C(0)); + platform_timecounter = &pic_timecounter; } static void From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 15:29:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51D311065670; Wed, 25 Aug 2010 15:29:13 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41DB08FC17; Wed, 25 Aug 2010 15:29:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7PFTDwI015514; Wed, 25 Aug 2010 15:29:13 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7PFTDuK015512; Wed, 25 Aug 2010 15:29:13 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201008251529.o7PFTDuK015512@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 25 Aug 2010 15:29:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211816 - head/sys/fs/devfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 15:29:13 -0000 Author: jh Date: Wed Aug 25 15:29:12 2010 New Revision: 211816 URL: http://svn.freebsd.org/changeset/base/211816 Log: Call devfs_populate_vp() from devfs_getattr(). It was possible that fstat(2) returned stale information through an open file descriptor. Modified: head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Wed Aug 25 15:21:26 2010 (r211815) +++ head/sys/fs/devfs/devfs_vnops.c Wed Aug 25 15:29:12 2010 (r211816) @@ -618,10 +618,18 @@ devfs_getattr(struct vop_getattr_args *a { struct vnode *vp = ap->a_vp; struct vattr *vap = ap->a_vap; - int error = 0; + int error; struct devfs_dirent *de; + struct devfs_mount *dmp; struct cdev *dev; + error = devfs_populate_vp(vp); + if (error != 0) + return (error); + + dmp = VFSTODEVFS(vp->v_mount); + sx_xunlock(&dmp->dm_lock); + de = vp->v_data; KASSERT(de != NULL, ("Null dirent in devfs_getattr vp=%p", vp)); if (vp->v_type == VDIR) { From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 16:23:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9CB01065674; Wed, 25 Aug 2010 16:23:50 +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 B94F28FC15; Wed, 25 Aug 2010 16:23:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7PGNoRq016682; Wed, 25 Aug 2010 16:23:50 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7PGNop8016680; Wed, 25 Aug 2010 16:23:50 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201008251623.o7PGNop8016680@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 25 Aug 2010 16:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211817 - head/sys/boot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 16:23:50 -0000 Author: nwhitehorn Date: Wed Aug 25 16:23:50 2010 New Revision: 211817 URL: http://svn.freebsd.org/changeset/base/211817 Log: Fix build of ppc32 loader. Modified: head/sys/boot/common/Makefile.inc Modified: head/sys/boot/common/Makefile.inc ============================================================================== --- head/sys/boot/common/Makefile.inc Wed Aug 25 15:29:12 2010 (r211816) +++ head/sys/boot/common/Makefile.inc Wed Aug 25 16:23:50 2010 (r211817) @@ -9,7 +9,7 @@ SRCS+= load_elf32.c load_elf32_obj.c rel SRCS+= load_elf64.c load_elf64_obj.c reloc_elf64.c .elif ${MACHINE} == "pc98" SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c -.elif ${MACHINE_ARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" +.elif ${MACHINE_CPUARCH} == "arm" SRCS+= load_elf32.c reloc_elf32.c .elif ${MACHINE_CPUARCH} == "powerpc" SRCS+= load_elf32.c reloc_elf32.c From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 18:09:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A8CF1065679; Wed, 25 Aug 2010 18:09:52 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A6528FC20; Wed, 25 Aug 2010 18:09:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7PI9qDo018745; Wed, 25 Aug 2010 18:09:52 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7PI9qdI018743; Wed, 25 Aug 2010 18:09:52 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201008251809.o7PI9qdI018743@svn.freebsd.org> From: Brian Somers Date: Wed, 25 Aug 2010 18:09:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211818 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 18:09:52 -0000 Author: brian Date: Wed Aug 25 18:09:51 2010 New Revision: 211818 URL: http://svn.freebsd.org/changeset/base/211818 Log: If we read zero bytes from the directory, early out with ENOENT rather than forging ahead and interpreting garbage buffer content and dirent structures. This change backs out r211684 which was essentially a no-op. MFC after: 1 week Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Wed Aug 25 16:23:50 2010 (r211817) +++ head/sys/kern/vfs_default.c Wed Aug 25 18:09:51 2010 (r211818) @@ -281,9 +281,13 @@ get_next_dirent(struct vnode *vp, struct if (error) return (error); - *cpos = dirbuf; - *len = uio.uio_offset - *off; *off = uio.uio_offset; + + *cpos = dirbuf; + *len = (dirbuflen - uio.uio_resid); + + if (*len == 0) + return (ENOENT); } dp = (struct dirent *)(*cpos); From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 18:11:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5430F1065694; Wed, 25 Aug 2010 18:11:02 +0000 (UTC) (envelope-from osa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 436A88FC2A; Wed, 25 Aug 2010 18:11:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7PIB2jv018822; Wed, 25 Aug 2010 18:11:02 GMT (envelope-from osa@svn.freebsd.org) Received: (from osa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7PIB2PI018820; Wed, 25 Aug 2010 18:11:02 GMT (envelope-from osa@svn.freebsd.org) Message-Id: <201008251811.o7PIB2PI018820@svn.freebsd.org> From: "Sergey A. Osokin" Date: Wed, 25 Aug 2010 18:11:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211819 - head/usr.bin/calendar/calendars/ru_RU.KOI8-R X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 18:11:02 -0000 Author: osa (ports committer) Date: Wed Aug 25 18:11:01 2010 New Revision: 211819 URL: http://svn.freebsd.org/changeset/base/211819 Log: Add one more new memory day for Russian Federation: the end of Second World War. Obtained from: http://kremlin.ru/acts/8444 Modified: head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.military (contents, props changed) Modified: head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.military ============================================================================== --- head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.military Wed Aug 25 18:09:51 2010 (r211818) +++ head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.military Wed Aug 25 18:11:01 2010 (r211819) @@ -16,6 +16,7 @@ LANG=ru_RU.KOI8-R 10 ÉŔĚ äĹÎŘ ĐĎÂĹÄŮ ŇŐÓÓËĎĘ ÁŇÍÉÉ ĐĎÄ ËĎÍÁÎÄĎ×ÁÎÉĹÍ đĹÔŇÁ đĹŇ×ĎÇĎ ÎÁÄ Ű×ĹÄÁÍÉ × đĎĚÔÁ×ÓËĎÍ ÓŇÁÖĹÎÉÉ (1709 ÇĎÄ) 9 Á×Ç äĹÎŘ ĐĹŇ×ĎĘ × ŇĎÓÓÉĘÓËĎĘ ÉÓÔĎŇÉÉ ÍĎŇÓËĎĘ ĐĎÂĹÄŮ ŇŐÓÓËĎÇĎ ĆĚĎÔÁ ĐĎÄ ËĎÍÁÎÄĎ×ÁÎÉĹÍ đĹÔŇÁ đĹŇ×ĎÇĎ ÎÁÄ Ű×ĹÄÁÍÉ Ő ÍŮÓÁ çÁÎÇŐÔ (1714 ÇĎÄ) 23 Á×Ç äĹÎŘ ŇÁÚÇŇĎÍÁ ÓĎ×ĹÔÓËÉÍÉ ×ĎĘÓËÁÍÉ ÎĹÍĹĂËĎ-ĆÁŰÉÓÔÓËÉČ ×ĎĘÓË × ëŐŇÓËĎĘ ÂÉÔ×Ĺ (1943 ÇĎÄ) + 2 ÓĹÎ äĹÎŘ ĎËĎÎŢÁÎÉŃ ÷ÔĎŇĎĘ ÍÉŇĎ×ĎĘ ×ĎĘÎŮ (1945 ÇĎÄ) 8 ÓĹÎ äĹÎŘ âĎŇĎÄÉÎÓËĎÇĎ ÓŇÁÖĹÎÉŃ ŇŐÓÓËĎĘ ÁŇÍÉÉ ĐĎÄ ËĎÍÁÎÄĎ×ÁÎÉĹÍ í.é. ëŐÔŐÚĎ×Á Ó ĆŇÁÎĂŐÚÓËĎĘ ÁŇÍÉĹĘ (1812 ÇĎÄ) 11 ÓĹÎ äĹÎŘ ĐĎÂĹÄŮ ŇŐÓÓËĎĘ ÜÓËÁÄŇŮ ĐĎÄ ËĎÍÁÎÄĎ×ÁÎÉĹÍ ć.ć. őŰÁËĎ×Á ÎÁÄ ÔŐŇĹĂËĎĘ ÜÓËÁÄŇĎĘ Ő ÍŮÓÁ ôĹÎÄŇÁ (1790 ÇĎÄ) 21 ÓĹÎ äĹÎŘ ĐĎÂĹÄŮ ŇŐÓÓËÉČ ĐĎĚËĎ× ×Ď ÇĚÁ×Ĺ Ó ×ĹĚÉËÉÍ ËÎŃÚĹÍ äÍÉÔŇÉĹÍ äĎÎÓËÉÍ ÎÁÄ ÍĎÎÇĎĚĎ-ÔÁÔÁŇÓËÉÍÉ ×ĎĘÓËÁÍÉ × ëŐĚÉËĎ×ÓËĎĘ ÂÉÔ×Ĺ (1380 ÇĎÄ) From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 19:12:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92071106564A; Wed, 25 Aug 2010 19:12:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 804738FC14; Wed, 25 Aug 2010 19:12:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7PJC5PN020043; Wed, 25 Aug 2010 19:12:05 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7PJC5nf020039; Wed, 25 Aug 2010 19:12:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201008251912.o7PJC5nf020039@svn.freebsd.org> From: John Baldwin Date: Wed, 25 Aug 2010 19:12:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211820 - in head/sys: conf x86/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 19:12:05 -0000 Author: jhb Date: Wed Aug 25 19:12:05 2010 New Revision: 211820 URL: http://svn.freebsd.org/changeset/base/211820 Log: Intel QPI chipsets actually provide two extra "non-core" PCI buses that provide PCI devices for various hardware such as memory controllers, etc. These PCI buses are not enumerated via ACPI however. Add qpi(4) psuedo bus and Host-PCI bridge drivers to enumerate these buses. Currently the driver uses the CPU ID to determine the bridges' presence. In collaboration with: Joseph Golio @ Isilon Systems MFC after: 2 weeks Added: head/sys/x86/pci/ head/sys/x86/pci/qpi.c (contents, props changed) Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Wed Aug 25 18:11:01 2010 (r211819) +++ head/sys/conf/files.amd64 Wed Aug 25 19:12:05 2010 (r211820) @@ -317,6 +317,7 @@ 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/x86/io_apic.c standard x86/x86/local_apic.c standard x86/x86/mca.c standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Wed Aug 25 18:11:01 2010 (r211819) +++ head/sys/conf/files.i386 Wed Aug 25 19:12:05 2010 (r211820) @@ -394,6 +394,7 @@ 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/x86/io_apic.c optional apic x86/x86/local_apic.c optional apic x86/x86/mca.c standard Added: head/sys/x86/pci/qpi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/pci/qpi.c Wed Aug 25 19:12:05 2010 (r211820) @@ -0,0 +1,286 @@ +/*- + * Copyright (c) 2010 Advanced Computing Technologies LLC + * Written by: John H. Baldwin + * 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 driver provides a psuedo-bus to enumerate the PCI buses + * present on a sytem using a QPI chipset. It creates a qpi0 bus that + * is a child of nexus0 and then creates two Host-PCI bridges as a + * child of that. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include "pcib_if.h" + +struct qpi_device { + int qd_pcibus; +}; + +static MALLOC_DEFINE(M_QPI, "qpidrv", "qpi system device"); + +static void +qpi_identify(driver_t *driver, device_t parent) +{ + + /* Check CPUID to ensure this is an i7 CPU of some sort. */ + if (!(cpu_vendor_id == CPU_VENDOR_INTEL && CPUID_TO_FAMILY(cpu_id) && + (CPUID_TO_MODEL(cpu_id) == 0x1a || CPUID_TO_MODEL(cpu_id) == 0x2c))) + return; + + /* PCI config register access is required. */ + if (pci_cfgregopen() == 0) + return; + + /* Add a qpi bus device. */ + if (BUS_ADD_CHILD(parent, 20, "qpi", -1) == NULL) + panic("Failed to add qpi bus"); +} + +static int +qpi_probe(device_t dev) +{ + + device_set_desc(dev, "QPI system bus"); + return (BUS_PROBE_SPECIFIC); +} + +static int +qpi_attach(device_t dev) +{ + struct qpi_device *qdev; + device_t child; + + /* + * Add two Host-PCI bridge devices, one for PCI bus 254 and + * one for PCI bus 255. + */ + child = BUS_ADD_CHILD(dev, 0, "pcib", -1); + if (child == NULL) + panic("%s: failed to add pci bus 254", + device_get_nameunit(dev)); + qdev = malloc(sizeof(struct qpi_device), M_QPI, M_WAITOK); + qdev->qd_pcibus = 254; + device_set_ivars(child, qdev); + + child = BUS_ADD_CHILD(dev, 0, "pcib", -1); + if (child == NULL) + panic("%s: failed to add pci bus 255", + device_get_nameunit(dev)); + qdev = malloc(sizeof(struct qpi_device), M_QPI, M_WAITOK); + qdev->qd_pcibus = 255; + device_set_ivars(child, qdev); + + return (bus_generic_attach(dev)); +} + +static int +qpi_print_child(device_t bus, device_t child) +{ + struct qpi_device *qdev; + int retval = 0; + + qdev = device_get_ivars(child); + retval += bus_print_child_header(bus, child); + if (qdev->qd_pcibus != -1) + retval += printf(" pcibus %d", qdev->qd_pcibus); + retval += bus_print_child_footer(bus, child); + + return (retval); +} + +static int +qpi_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) +{ + struct qpi_device *qdev; + + qdev = device_get_ivars(child); + switch (which) { + case PCIB_IVAR_BUS: + *result = qdev->qd_pcibus; + break; + default: + return (ENOENT); + } + return (0); +} + +static device_method_t qpi_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, qpi_identify), + DEVMETHOD(device_probe, qpi_probe), + DEVMETHOD(device_attach, qpi_attach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + + /* Bus interface */ + DEVMETHOD(bus_print_child, qpi_print_child), + DEVMETHOD(bus_add_child, bus_generic_add_child), + DEVMETHOD(bus_read_ivar, qpi_read_ivar), + DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + + { 0, 0 } +}; + +static devclass_t qpi_devclass; + +DEFINE_CLASS_0(qpi, qpi_driver, qpi_methods, 0); +DRIVER_MODULE(qpi, nexus, qpi_driver, qpi_devclass, 0, 0); + +static int +qpi_pcib_probe(device_t dev) +{ + + device_set_desc(dev, "QPI Host-PCI bridge"); + return (BUS_PROBE_SPECIFIC); +} + +static int +qpi_pcib_attach(device_t dev) +{ + + device_add_child(dev, "pci", pcib_get_bus(dev)); + return (bus_generic_attach(dev)); +} + +static int +qpi_pcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) +{ + + switch (which) { + case PCIB_IVAR_DOMAIN: + *result = 0; + return (0); + case PCIB_IVAR_BUS: + *result = pcib_get_bus(dev); + return (0); + default: + return (ENOENT); + } +} + +static uint32_t +qpi_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, int bytes) +{ + + return (pci_cfgregread(bus, slot, func, reg, bytes)); +} + +static void +qpi_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, uint32_t data, int bytes) +{ + + pci_cfgregwrite(bus, slot, func, reg, data, bytes); +} + +static int +qpi_pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, + int *irqs) +{ + device_t bus; + + bus = device_get_parent(pcib); + return (PCIB_ALLOC_MSI(device_get_parent(bus), dev, count, maxcount, + irqs)); +} + +static int +qpi_pcib_alloc_msix(device_t pcib, device_t dev, int *irq) +{ + device_t bus; + + bus = device_get_parent(pcib); + return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq)); +} + +static int +qpi_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, + uint32_t *data) +{ + device_t bus; + + bus = device_get_parent(pcib); + return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data)); +} + +static device_method_t qpi_pcib_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, qpi_pcib_probe), + DEVMETHOD(device_attach, qpi_pcib_attach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + + /* Bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(bus_read_ivar, qpi_pcib_read_ivar), + DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + + /* pcib interface */ + DEVMETHOD(pcib_maxslots, pcib_maxslots), + DEVMETHOD(pcib_read_config, qpi_pcib_read_config), + DEVMETHOD(pcib_write_config, qpi_pcib_write_config), + DEVMETHOD(pcib_alloc_msi, qpi_pcib_alloc_msi), + DEVMETHOD(pcib_release_msi, pcib_release_msi), + DEVMETHOD(pcib_alloc_msix, qpi_pcib_alloc_msix), + DEVMETHOD(pcib_release_msix, pcib_release_msix), + DEVMETHOD(pcib_map_msi, qpi_pcib_map_msi), + + {0, 0} +}; + +static devclass_t qpi_pcib_devclass; + +DEFINE_CLASS_0(pcib, qpi_pcib_driver, qpi_pcib_methods, 0); +DRIVER_MODULE(pcib, qpi, qpi_pcib_driver, qpi_pcib_devclass, 0, 0); From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 20:37:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E239106567A; Wed, 25 Aug 2010 20:37:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DC5F8FC16; Wed, 25 Aug 2010 20:37:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7PKbwU9021820; Wed, 25 Aug 2010 20:37:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7PKbwoY021818; Wed, 25 Aug 2010 20:37:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201008252037.o7PKbwoY021818@svn.freebsd.org> From: John Baldwin Date: Wed, 25 Aug 2010 20:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211821 - head/sys/x86/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 20:37:58 -0000 Author: jhb Date: Wed Aug 25 20:37:58 2010 New Revision: 211821 URL: http://svn.freebsd.org/changeset/base/211821 Log: Correctly ensure that the CPU family is 0x6, not non-zero. Submitted by: Dimitry Andric Modified: head/sys/x86/pci/qpi.c Modified: head/sys/x86/pci/qpi.c ============================================================================== --- head/sys/x86/pci/qpi.c Wed Aug 25 19:12:05 2010 (r211820) +++ head/sys/x86/pci/qpi.c Wed Aug 25 20:37:58 2010 (r211821) @@ -62,7 +62,8 @@ qpi_identify(driver_t *driver, device_t { /* Check CPUID to ensure this is an i7 CPU of some sort. */ - if (!(cpu_vendor_id == CPU_VENDOR_INTEL && CPUID_TO_FAMILY(cpu_id) && + if (!(cpu_vendor_id == CPU_VENDOR_INTEL && + CPUID_TO_FAMILY(cpu_id) == 0x6 && (CPUID_TO_MODEL(cpu_id) == 0x1a || CPUID_TO_MODEL(cpu_id) == 0x2c))) return; From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 20:48:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FA1810656AB; Wed, 25 Aug 2010 20:48:24 +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 6EF718FC16; Wed, 25 Aug 2010 20:48:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7PKmOZd022057; Wed, 25 Aug 2010 20:48:24 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7PKmO8f022055; Wed, 25 Aug 2010 20:48:24 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201008252048.o7PKmO8f022055@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 25 Aug 2010 20:48:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211822 - head/lib/libc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 20:48:24 -0000 Author: nwhitehorn Date: Wed Aug 25 20:48:24 2010 New Revision: 211822 URL: http://svn.freebsd.org/changeset/base/211822 Log: Allow ABIs to provide their own LIBC_ARCH in a more generic way. As a side effect, this fixes the build on powerpc64. Reviewed by: imp Modified: head/lib/libc/Makefile Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Wed Aug 25 20:37:58 2010 (r211821) +++ head/lib/libc/Makefile Wed Aug 25 20:48:24 2010 (r211822) @@ -5,10 +5,11 @@ SHLIBDIR?= /lib .include -# We have to special case powerpc and powerpc64, since they mostly have -# the same source implementation. libc is very different due to large -# ABI differences. -.if ${MACHINE_ARCH} == "powerpc" +# Pick the current architecture directory for libc. In general, this is +# named MACHINE_CPUARCH, but some ABIs are different enough to require +# their own libc, so allow a directory named MACHINE_ARCH to override this. + +.if exists(${.CURDIR}/${MACHINE_ARCH}) LIBC_ARCH=${MACHINE_ARCH} .else LIBC_ARCH=${MACHINE_CPUARCH} From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 20:52:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 645A71065673; Wed, 25 Aug 2010 20:52:40 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 540878FC0A; Wed, 25 Aug 2010 20:52:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7PKqeHh022171; Wed, 25 Aug 2010 20:52:40 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7PKqeWQ022169; Wed, 25 Aug 2010 20:52:40 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201008252052.o7PKqeWQ022169@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 25 Aug 2010 20:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211823 - head/sys/compat/x86bios X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 20:52:40 -0000 Author: jkim Date: Wed Aug 25 20:52:40 2010 New Revision: 211823 URL: http://svn.freebsd.org/changeset/base/211823 Log: Check opcode for short jump as well. Some option ROMs do short jumps (e.g., some NVIDIA video cards) and we were not able to do POST while resuming because we only honored long jump. MFC after: 3 days Modified: head/sys/compat/x86bios/x86bios.c Modified: head/sys/compat/x86bios/x86bios.c ============================================================================== --- head/sys/compat/x86bios/x86bios.c Wed Aug 25 20:48:24 2010 (r211822) +++ head/sys/compat/x86bios/x86bios.c Wed Aug 25 20:52:40 2010 (r211823) @@ -801,7 +801,8 @@ x86bios_get_orm(uint32_t offset) /* Does the shadow ROM contain BIOS POST code for x86? */ p = x86bios_offset(offset); - if (p == NULL || p[0] != 0x55 || p[1] != 0xaa || p[3] != 0xe9) + if (p == NULL || p[0] != 0x55 || p[1] != 0xaa || + (p[3] != 0xe9 && p[3] != 0xeb)) return (NULL); return (p); From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 21:03:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAE84106566B; Wed, 25 Aug 2010 21:03:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA2818FC08; Wed, 25 Aug 2010 21:03:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7PL3oKd022446; Wed, 25 Aug 2010 21:03:50 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7PL3obR022443; Wed, 25 Aug 2010 21:03:50 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201008252103.o7PL3obR022443@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 25 Aug 2010 21:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211824 - head/sys/compat/x86bios X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 21:03:50 -0000 Author: jkim Date: Wed Aug 25 21:03:50 2010 New Revision: 211824 URL: http://svn.freebsd.org/changeset/base/211824 Log: Add x86bios_set_intr() to set interrupt vectors for real mode and simplify x86bios_get_intr() a little. Modified: head/sys/compat/x86bios/x86bios.c head/sys/compat/x86bios/x86bios.h Modified: head/sys/compat/x86bios/x86bios.c ============================================================================== --- head/sys/compat/x86bios/x86bios.c Wed Aug 25 20:52:40 2010 (r211823) +++ head/sys/compat/x86bios/x86bios.c Wed Aug 25 21:03:50 2010 (r211824) @@ -204,6 +204,13 @@ x86bios_get_intr(int intno) } void +x86bios_set_intr(int intno, uint32_t saddr) +{ + + writel(BIOS_PADDRTOVADDR(intno * 4), saddr); +} + +void x86bios_intr(struct x86regs *regs, int intno) { struct vm86frame vmf; @@ -619,11 +626,15 @@ x86bios_call(struct x86regs *regs, uint1 uint32_t x86bios_get_intr(int intno) { - uint32_t *iv; - iv = (uint32_t *)((vm_offset_t)x86bios_ivt + intno * 4); + return (le32toh(*((uint32_t *)x86bios_ivt + intno))); +} + +void +x86bios_set_intr(int intno, uint32_t saddr) +{ - return (le32toh(*iv)); + *((uint32_t *)x86bios_ivt + intno) = htole32(saddr); } void Modified: head/sys/compat/x86bios/x86bios.h ============================================================================== --- head/sys/compat/x86bios/x86bios.h Wed Aug 25 20:52:40 2010 (r211823) +++ head/sys/compat/x86bios/x86bios.h Wed Aug 25 21:03:50 2010 (r211824) @@ -151,6 +151,7 @@ void x86bios_init_regs(struct x86regs * void x86bios_intr(struct x86regs *regs, int intno); int x86bios_match_device(uint32_t offset, device_t dev); void *x86bios_offset(uint32_t offset); +void x86bios_set_intr(int intno, uint32_t saddr); __END_DECLS #endif /* !_X86BIOS_H_ */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 21:13:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2915F1065693; Wed, 25 Aug 2010 21:13:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 188CD8FC08; Wed, 25 Aug 2010 21:13:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7PLDN10022671; Wed, 25 Aug 2010 21:13:23 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7PLDNST022669; Wed, 25 Aug 2010 21:13:23 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201008252113.o7PLDNST022669@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 25 Aug 2010 21:13:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211825 - head/sys/i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 21:13:24 -0000 Author: jkim Date: Wed Aug 25 21:13:23 2010 New Revision: 211825 URL: http://svn.freebsd.org/changeset/base/211825 Log: Increase maximum number of page table entries per VM86 context from 8 to 24 pages, yet again. Now we can allocate a whole segment, which is required for shadowing option ROM images, for example. Modified: head/sys/i386/include/vm86.h Modified: head/sys/i386/include/vm86.h ============================================================================== --- head/sys/i386/include/vm86.h Wed Aug 25 21:03:50 2010 (r211824) +++ head/sys/i386/include/vm86.h Wed Aug 25 21:13:23 2010 (r211825) @@ -100,7 +100,7 @@ struct vm86frame { #define vmf_eflags eflags.r_ex }; -#define VM86_PMAPSIZE 8 +#define VM86_PMAPSIZE 24 #define VMAP_MALLOC 1 /* page was malloced by us */ struct vm86context { From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 21:32:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 236711065670; Wed, 25 Aug 2010 21:32:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12BEB8FC0C; Wed, 25 Aug 2010 21:32:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7PLW8b2023166; Wed, 25 Aug 2010 21:32:08 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7PLW8j3023164; Wed, 25 Aug 2010 21:32:08 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201008252132.o7PLW8j3023164@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 25 Aug 2010 21:32:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211826 - head/sys/fs/unionfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 21:32:09 -0000 Author: trasz Date: Wed Aug 25 21:32:08 2010 New Revision: 211826 URL: http://svn.freebsd.org/changeset/base/211826 Log: Revert r210194, adding a comment explaining why calls to chgproccnt() in unionfs are actually needed. I have a better fix in trasz_hrl p4 branch, but now is not a good moment to commit it. Reported by: Alex Kozlov Modified: head/sys/fs/unionfs/union_subr.c Modified: head/sys/fs/unionfs/union_subr.c ============================================================================== --- head/sys/fs/unionfs/union_subr.c Wed Aug 25 21:13:23 2010 (r211825) +++ head/sys/fs/unionfs/union_subr.c Wed Aug 25 21:32:08 2010 (r211826) @@ -775,6 +775,11 @@ unionfs_mkshadowdir(struct unionfs_mount /* Authority change to root */ rootinfo = uifind((uid_t)0); cred = crdup(cnp->cn_cred); + /* + * The calls to chgproccnt() are needed to compensate for change_ruid() + * calling chgproccnt(). + */ + chgproccnt(cred->cr_ruidinfo, 1, 0); change_euid(cred, rootinfo); change_ruid(cred, rootinfo); change_svuid(cred, (uid_t)0); @@ -824,6 +829,7 @@ unionfs_mkshadowdir_free_out: unionfs_mkshadowdir_abort: cnp->cn_cred = credbk; + chgproccnt(cred->cr_ruidinfo, -1, 0); crfree(cred); return (error); From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 22:09:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FC0E1065675; Wed, 25 Aug 2010 22:09:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E91D8FC19; Wed, 25 Aug 2010 22:09:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7PM92oJ024007; Wed, 25 Aug 2010 22:09:02 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7PM92hY024005; Wed, 25 Aug 2010 22:09:02 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201008252209.o7PM92hY024005@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 25 Aug 2010 22:09:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211827 - head/sys/dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 22:09:03 -0000 Author: jkim Date: Wed Aug 25 22:09:02 2010 New Revision: 211827 URL: http://svn.freebsd.org/changeset/base/211827 Log: Add an experimental feature to shadow video BIOS. Long ago, this trick was supported by many BIOSes to improve performance of VESA BIOS calls for real mode OSes but it is not our intention here. However, this may help some platforms where the video ROMs are inaccessible after suspend, for example. Note it may consume up to 64K bytes of contiguous memory depending on video controller model when it is enabled. This feature can be disabled by setting zero to 'debug.vesa.shadow_rom' loader tunable via loader(8) or loader.conf(5). The default is 1 (enabled), for now. Modified: head/sys/dev/fb/vesa.c Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Wed Aug 25 21:32:08 2010 (r211826) +++ head/sys/dev/fb/vesa.c Wed Aug 25 22:09:02 2010 (r211827) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -61,6 +62,8 @@ __FBSDID("$FreeBSD$"); #include +#define VESA_BIOS_OFFSET 0xc0000 +#define VESA_PALETTE_SIZE (256 * 4) #define VESA_VIA_CLE266 "VIA CLE266\r\n" #ifndef VESA_DEBUG @@ -83,11 +86,21 @@ static ssize_t vesa_state_buf_size = 0; static u_char *vesa_palette = NULL; static uint32_t vesa_palette_offs = 0; -#define VESA_PALETTE_SIZE (256 * 4) + +static void *vesa_bios = NULL; +static uint32_t vesa_bios_offs = VESA_BIOS_OFFSET; +static uint32_t vesa_bios_int10 = 0; +static size_t vesa_bios_size = 0; /* VESA video adapter */ static video_adapter_t *vesa_adp = NULL; +SYSCTL_NODE(_debug, OID_AUTO, vesa, CTLFLAG_RD, NULL, "VESA debugging"); +static int vesa_shadow_rom = 1; +TUNABLE_INT("debug.vesa.shadow_rom", &vesa_shadow_rom); +SYSCTL_INT(_debug_vesa, OID_AUTO, shadow_rom, CTLFLAG_RDTUN, &vesa_shadow_rom, + 1, "Enable video BIOS shadow"); + /* VESA functions */ #if 0 static int vesa_nop(void); @@ -242,7 +255,7 @@ vesa_bios_post(void) device_t dev; int count, i, is_pci; - if (x86bios_get_orm(0xc0000) == NULL) + if (x86bios_get_orm(vesa_bios_offs) == NULL) return (1); dev = NULL; @@ -253,7 +266,7 @@ vesa_bios_post(void) if (dc != NULL && devclass_get_devices(dc, &devs, &count) == 0) { for (i = 0; i < count; i++) if (device_get_flags(devs[i]) != 0 && - x86bios_match_device(0xc0000, devs[i])) { + x86bios_match_device(vesa_bios_offs, devs[i])) { dev = devs[i]; is_pci = 1; break; @@ -279,7 +292,8 @@ vesa_bios_post(void) (pci_get_function(dev) & 0x07); } regs.R_DL = 0x80; - x86bios_call(®s, 0xc000, 0x0003); + x86bios_call(®s, X86BIOS_PHYSTOSEG(vesa_bios_offs + 3), + X86BIOS_PHYSTOOFF(vesa_bios_offs + 3)); if (x86bios_get_intr(0x10) == 0) return (1); @@ -754,6 +768,7 @@ vesa_bios_init(void) size_t bsize; size_t msize; void *vmbuf; + uint8_t *vbios; uint32_t offs; uint16_t vers; int is_via_cle266; @@ -765,22 +780,44 @@ vesa_bios_init(void) has_vesa_bios = FALSE; vesa_adp_info = NULL; + vesa_bios_offs = VESA_BIOS_OFFSET; vesa_vmode_max = 0; vesa_vmode[0].vi_mode = EOT; /* * If the VBE real mode interrupt vector is not found, try BIOS POST. */ - if (x86bios_get_intr(0x10) == 0) { + vesa_bios_int10 = x86bios_get_intr(0x10); + if (vesa_bios_int10 == 0) { if (vesa_bios_post() != 0) return (1); - if (bootverbose) { - offs = x86bios_get_intr(0x10); - printf("VESA: interrupt vector installed (0x%x)\n", - BIOS_SADDRTOLADDR(offs)); - } + vesa_bios_int10 = x86bios_get_intr(0x10); + if (vesa_bios_int10 == 0) + return (1); } + /* + * Shadow video ROM. + */ + offs = BIOS_SADDRTOLADDR(vesa_bios_int10); + if (vesa_shadow_rom) { + vbios = x86bios_get_orm(vesa_bios_offs); + if (vbios != NULL) { + vesa_bios_size = vbios[2] * 512; + vesa_bios = x86bios_alloc(&vesa_bios_offs, + vesa_bios_size, M_WAITOK); + memcpy(vesa_bios, vbios, vesa_bios_size); + offs = offs - VESA_BIOS_OFFSET + vesa_bios_offs; + offs = (X86BIOS_PHYSTOSEG(offs) << 16) + + X86BIOS_PHYSTOOFF(offs); + x86bios_set_intr(0x10, offs); + } else + printf("VESA: failed to shadow video ROM\n"); + } + if (bootverbose) + printf("VESA: INT 0x10 vector 0x%04x:0x%04x\n", + X86BIOS_PHYSTOSEG(offs), X86BIOS_PHYSTOOFF(offs)); + x86bios_init_regs(®s); regs.R_AX = 0x4f00; @@ -1011,6 +1048,12 @@ vesa_bios_init(void) return (0); fail: + if (vesa_bios != NULL) { + x86bios_set_intr(0x10, vesa_bios_int10); + vesa_bios_offs = VESA_BIOS_OFFSET; + x86bios_free(vesa_bios, vesa_bios_size); + vesa_bios = NULL; + } if (vmbuf != NULL) x86bios_free(vmbuf, sizeof(buf)); if (vesa_adp_info != NULL) { @@ -1862,6 +1905,10 @@ vesa_unload(void) } } + if (vesa_bios != NULL) { + x86bios_set_intr(0x10, vesa_bios_int10); + x86bios_free(vesa_bios, vesa_bios_size); + } if (vesa_adp_info != NULL) free(vesa_adp_info, M_DEVBUF); if (vesa_oemstr != NULL) From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 22:19:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82E1710656AB; Wed, 25 Aug 2010 22:19:52 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 713CE8FC1C; Wed, 25 Aug 2010 22:19:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7PMJqwE024248; Wed, 25 Aug 2010 22:19:52 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7PMJqLU024245; Wed, 25 Aug 2010 22:19:52 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201008252219.o7PMJqLU024245@svn.freebsd.org> From: Rick Macklem Date: Wed, 25 Aug 2010 22:19:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211828 - stable/8/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 22:19:52 -0000 Author: rmacklem Date: Wed Aug 25 22:19:52 2010 New Revision: 211828 URL: http://svn.freebsd.org/changeset/base/211828 Log: MFC: r210834 Add some mutex locking on the nfsnode to the regular NFS client. Modified: stable/8/sys/nfsclient/nfs_node.c stable/8/sys/nfsclient/nfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/nfsclient/nfs_node.c ============================================================================== --- stable/8/sys/nfsclient/nfs_node.c Wed Aug 25 22:09:02 2010 (r211827) +++ stable/8/sys/nfsclient/nfs_node.c Wed Aug 25 22:19:52 2010 (r211828) @@ -193,12 +193,14 @@ nfs_inactive(struct vop_inactive_args *a np = VTONFS(ap->a_vp); if (prtactive && vrefcnt(ap->a_vp) != 0) vprint("nfs_inactive: pushing active", ap->a_vp); + mtx_lock(&np->n_mtx); if (ap->a_vp->v_type != VDIR) { sp = np->n_sillyrename; np->n_sillyrename = NULL; } else sp = NULL; if (sp) { + mtx_unlock(&np->n_mtx); (void)nfs_vinvalbuf(ap->a_vp, 0, td, 1); /* * Remove the silly file that was rename'd earlier @@ -207,8 +209,10 @@ nfs_inactive(struct vop_inactive_args *a crfree(sp->s_cred); vrele(sp->s_dvp); free((caddr_t)sp, M_NFSREQ); + mtx_lock(&np->n_mtx); } np->n_flag &= NMODIFIED; + mtx_unlock(&np->n_mtx); return (0); } Modified: stable/8/sys/nfsclient/nfs_vnops.c ============================================================================== --- stable/8/sys/nfsclient/nfs_vnops.c Wed Aug 25 22:09:02 2010 (r211827) +++ stable/8/sys/nfsclient/nfs_vnops.c Wed Aug 25 22:19:52 2010 (r211828) @@ -521,7 +521,7 @@ nfs_open(struct vop_open_args *ap) */ mtx_lock(&np->n_mtx); if (np->n_flag & NMODIFIED) { - mtx_unlock(&np->n_mtx); + mtx_unlock(&np->n_mtx); error = nfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1); if (error == EINTR || error == EIO) return (error); @@ -536,9 +536,8 @@ nfs_open(struct vop_open_args *ap) return (error); mtx_lock(&np->n_mtx); np->n_mtime = vattr.va_mtime; - mtx_unlock(&np->n_mtx); } else { - mtx_unlock(&np->n_mtx); + mtx_unlock(&np->n_mtx); error = VOP_GETATTR(vp, &vattr, ap->a_cred); if (error) return (error); @@ -554,22 +553,22 @@ nfs_open(struct vop_open_args *ap) mtx_lock(&np->n_mtx); np->n_mtime = vattr.va_mtime; } - mtx_unlock(&np->n_mtx); } /* * If the object has >= 1 O_DIRECT active opens, we disable caching. */ if (nfs_directio_enable && (fmode & O_DIRECT) && (vp->v_type == VREG)) { if (np->n_directio_opens == 0) { + mtx_unlock(&np->n_mtx); error = nfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1); if (error) return (error); mtx_lock(&np->n_mtx); np->n_flag |= NNONCACHE; - mtx_unlock(&np->n_mtx); } np->n_directio_opens++; } + mtx_unlock(&np->n_mtx); vnode_create_vobject(vp, vattr.va_size, ap->a_td); return (0); } @@ -1745,7 +1744,9 @@ nfs_remove(struct vop_remove_args *ap) error = 0; } else if (!np->n_sillyrename) error = nfs_sillyrename(dvp, vp, cnp); + mtx_lock(&np->n_mtx); np->n_attrstamp = 0; + mtx_unlock(&np->n_mtx); KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); return (error); } From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 22:48:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68FE81065693; Wed, 25 Aug 2010 22:48:18 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 588878FC0A; Wed, 25 Aug 2010 22:48:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7PMmI7M024808; Wed, 25 Aug 2010 22:48:18 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7PMmIb8024806; Wed, 25 Aug 2010 22:48:18 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201008252248.o7PMmIb8024806@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 25 Aug 2010 22:48:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211829 - head/sys/dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 22:48:18 -0000 Author: jkim Date: Wed Aug 25 22:48:18 2010 New Revision: 211829 URL: http://svn.freebsd.org/changeset/base/211829 Log: Fix a debugging message under bootverbose. This address is not linear. Modified: head/sys/dev/fb/vesa.c Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Wed Aug 25 22:19:52 2010 (r211828) +++ head/sys/dev/fb/vesa.c Wed Aug 25 22:48:18 2010 (r211829) @@ -816,7 +816,7 @@ vesa_bios_init(void) } if (bootverbose) printf("VESA: INT 0x10 vector 0x%04x:0x%04x\n", - X86BIOS_PHYSTOSEG(offs), X86BIOS_PHYSTOOFF(offs)); + (offs >> 16) & 0xffff, offs & 0xffff); x86bios_init_regs(®s); regs.R_AX = 0x4f00; From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 23:23:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF45710656A4; Wed, 25 Aug 2010 23:23:00 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE7788FC1E; Wed, 25 Aug 2010 23:23:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7PNN05g025512; Wed, 25 Aug 2010 23:23:00 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7PNN0ST025510; Wed, 25 Aug 2010 23:23:00 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201008252323.o7PNN0ST025510@svn.freebsd.org> From: Rick Macklem Date: Wed, 25 Aug 2010 23:23:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211830 - head/sys/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 23:23:01 -0000 Author: rmacklem Date: Wed Aug 25 23:23:00 2010 New Revision: 211830 URL: http://svn.freebsd.org/changeset/base/211830 Log: Add mutex locking for the call to replay_prune() in replay_setsize(), since replay_prune() expects the rc_lock to be held when it is called. MFC after: 2 weeks Modified: head/sys/rpc/replay.c Modified: head/sys/rpc/replay.c ============================================================================== --- head/sys/rpc/replay.c Wed Aug 25 22:48:18 2010 (r211829) +++ head/sys/rpc/replay.c Wed Aug 25 23:23:00 2010 (r211830) @@ -90,8 +90,10 @@ void replay_setsize(struct replay_cache *rc, size_t newmaxsize) { + mtx_lock(&rc->rc_lock); rc->rc_maxsize = newmaxsize; replay_prune(rc); + mtx_unlock(&rc->rc_lock); } void From owner-svn-src-all@FreeBSD.ORG Thu Aug 26 05:16:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A05E1065674; Thu, 26 Aug 2010 05:16:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 302F38FC13; Thu, 26 Aug 2010 05:16:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7Q5G10u032405; Thu, 26 Aug 2010 05:16:01 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7Q5G1Ia032403; Thu, 26 Aug 2010 05:16:01 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008260516.o7Q5G1Ia032403@svn.freebsd.org> From: Warner Losh Date: Thu, 26 Aug 2010 05:16:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211831 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 05:16:01 -0000 Author: imp Date: Thu Aug 26 05:16:00 2010 New Revision: 211831 URL: http://svn.freebsd.org/changeset/base/211831 Log: Rescue doesn't work for n64. Modified: head/Makefile.mips Modified: head/Makefile.mips ============================================================================== --- head/Makefile.mips Wed Aug 25 23:23:00 2010 (r211830) +++ head/Makefile.mips Thu Aug 26 05:16:00 2010 (r211831) @@ -1,2 +1,5 @@ # $FreeBSD$ +.if ${TARGET_ABI} == "n64" +MK_RESCUE=no +.endif From owner-svn-src-all@FreeBSD.ORG Thu Aug 26 05:25:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09C3A106567A; Thu, 26 Aug 2010 05:25:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE1A28FC16; Thu, 26 Aug 2010 05:25:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7Q5Ppft032627; Thu, 26 Aug 2010 05:25:51 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7Q5PpGu032625; Thu, 26 Aug 2010 05:25:51 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008260525.o7Q5PpGu032625@svn.freebsd.org> From: Warner Losh Date: Thu, 26 Aug 2010 05:25:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211832 - head/usr.sbin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 05:25:52 -0000 Author: imp Date: Thu Aug 26 05:25:51 2010 New Revision: 211832 URL: http://svn.freebsd.org/changeset/base/211832 Log: Ugly kludge to paper over some kind of ld bug and/or misuse: don't build uathload on mips n64 either. Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Thu Aug 26 05:16:00 2010 (r211831) +++ head/usr.sbin/Makefile Thu Aug 26 05:25:51 2010 (r211832) @@ -412,7 +412,8 @@ _crunch= crunch .endif .if ${MK_USB} != "no" -.if ${MACHINE_ARCH} != "ia64" +.if ${MACHINE_ARCH} != "ia64" && \ + !(${MACHINE_ARCH} == "mips" && ${TARGET_ABI} == "n64") _uathload= uathload .endif _uhsoctl= uhsoctl From owner-svn-src-all@FreeBSD.ORG Thu Aug 26 05:48:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F01E106564A; Thu, 26 Aug 2010 05:48:42 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 8A1178FC0A; Thu, 26 Aug 2010 05:48:41 +0000 (UTC) Received: by wwb13 with SMTP id 13so2161258wwb.31 for ; Wed, 25 Aug 2010 22:48:40 -0700 (PDT) Received: by 10.216.46.15 with SMTP id q15mr8344073web.103.1282801720357; Wed, 25 Aug 2010 22:48:40 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.216.5.5 with HTTP; Wed, 25 Aug 2010 22:48:20 -0700 (PDT) In-Reply-To: <201008260525.o7Q5PpGu032625@svn.freebsd.org> References: <201008260525.o7Q5PpGu032625@svn.freebsd.org> From: Juli Mallett Date: Wed, 25 Aug 2010 22:48:20 -0700 X-Google-Sender-Auth: ilQAB3Fj6uY0joLFDG5RNfNFhLw Message-ID: To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211832 - head/usr.sbin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 05:48:42 -0000 On Wed, Aug 25, 2010 at 22:25, Warner Losh wrote: > Author: imp > Date: Thu Aug 26 05:25:51 2010 > New Revision: 211832 > URL: http://svn.freebsd.org/changeset/base/211832 > > Log: > =A0Ugly kludge to paper over some kind of ld bug and/or misuse: don't > =A0build uathload on mips n64 either. Thanks for taking care of this. If you could include n32 in this case, that'd be great. I don't know whether the rescue stuff is also broken on n32, but it's probably worth doing a quick build with TARGET_ABI=3Dn32 to check, if you're in the mood to commit these workarounds :) Juli. From owner-svn-src-all@FreeBSD.ORG Thu Aug 26 07:09:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E147F1065695; Thu, 26 Aug 2010 07:09:48 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D18058FC1A; Thu, 26 Aug 2010 07:09:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7Q79m1l034648; Thu, 26 Aug 2010 07:09:48 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7Q79mxU034646; Thu, 26 Aug 2010 07:09:48 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201008260709.o7Q79mxU034646@svn.freebsd.org> From: David Xu Date: Thu, 26 Aug 2010 07:09:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211833 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 07:09:49 -0000 Author: davidxu Date: Thu Aug 26 07:09:48 2010 New Revision: 211833 URL: http://svn.freebsd.org/changeset/base/211833 Log: Decrease rdlock count only when thread unlocked a reader lock. MFC after: 3 days Modified: head/lib/libthr/thread/thr_rtld.c Modified: head/lib/libthr/thread/thr_rtld.c ============================================================================== --- head/lib/libthr/thread/thr_rtld.c Thu Aug 26 05:25:51 2010 (r211832) +++ head/lib/libthr/thread/thr_rtld.c Thu Aug 26 07:09:48 2010 (r211833) @@ -149,8 +149,8 @@ _thr_rtld_lock_release(void *lock) state = l->lock.rw_state; if (_thr_rwlock_unlock(&l->lock) == 0) { - curthread->rdlock_count--; if ((state & URWLOCK_WRITE_OWNER) == 0) { + curthread->rdlock_count--; THR_CRITICAL_LEAVE(curthread); } else { _thr_signal_unblock(curthread); From owner-svn-src-all@FreeBSD.ORG Thu Aug 26 09:04:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBD301065675; Thu, 26 Aug 2010 09:04:27 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B14848FC1A; Thu, 26 Aug 2010 09:04:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7Q94Rgv037089; Thu, 26 Aug 2010 09:04:27 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7Q94R2t037086; Thu, 26 Aug 2010 09:04:27 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201008260904.o7Q94R2t037086@svn.freebsd.org> From: David Xu Date: Thu, 26 Aug 2010 09:04:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211836 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 09:04:28 -0000 Author: davidxu Date: Thu Aug 26 09:04:27 2010 New Revision: 211836 URL: http://svn.freebsd.org/changeset/base/211836 Log: eliminate unused code. Modified: head/lib/libthr/thread/thr_exit.c head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/thread/thr_exit.c ============================================================================== --- head/lib/libthr/thread/thr_exit.c Thu Aug 26 07:57:45 2010 (r211835) +++ head/lib/libthr/thread/thr_exit.c Thu Aug 26 09:04:27 2010 (r211836) @@ -55,16 +55,6 @@ _thread_exit(const char *fname, int line abort(); } -/* - * Only called when a thread is cancelled. It may be more useful - * to call it from pthread_exit() if other ways of asynchronous or - * abnormal thread termination can be found. - */ -void -_thr_exit_cleanup(void) -{ -} - void _pthread_exit(void *status) { @@ -84,8 +74,6 @@ _pthread_exit(void *status) curthread->cancel_enable = 0; curthread->cancel_async = 0; - _thr_exit_cleanup(); - /* Save the return value: */ curthread->ret = status; while (curthread->cleanup != NULL) { Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Thu Aug 26 07:57:45 2010 (r211835) +++ head/lib/libthr/thread/thr_private.h Thu Aug 26 09:04:27 2010 (r211836) @@ -623,7 +623,6 @@ void _mutex_fork(struct pthread *curthre void _libpthread_init(struct pthread *) __hidden; struct pthread *_thr_alloc(struct pthread *) __hidden; void _thread_exit(const char *, int, const char *) __hidden __dead2; -void _thr_exit_cleanup(void) __hidden; int _thr_ref_add(struct pthread *, struct pthread *, int) __hidden; void _thr_ref_delete(struct pthread *, struct pthread *) __hidden; void _thr_ref_delete_unlocked(struct pthread *, struct pthread *) __hidden; @@ -635,7 +634,6 @@ void _thr_stack_free(struct pthread_attr void _thr_free(struct pthread *, struct pthread *) __hidden; void _thr_gc(struct pthread *) __hidden; void _thread_cleanupspecific(void) __hidden; -void _thread_dump_info(void) __hidden; void _thread_printf(int, const char *, ...) __hidden; void _thr_spinlock_init(void) __hidden; void _thr_cancel_enter(struct pthread *) __hidden; @@ -671,9 +669,6 @@ int _schedparam_to_rtp(int policy, const void _thread_bp_create(void); void _thread_bp_death(void); int _sched_yield(void); -void _thr_sem_prefork(void); -void _thr_sem_postfork(void); -void _thr_sem_child_postfork(void); void _pthread_cleanup_push(void (*)(void *), void *); void _pthread_cleanup_pop(int); From owner-svn-src-all@FreeBSD.ORG Thu Aug 26 10:32:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D743D10656A8; Thu, 26 Aug 2010 10:32:35 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id E33AE8FC15; Thu, 26 Aug 2010 10:32:34 +0000 (UTC) Received: by eyx24 with SMTP id 24so1287558eyx.13 for ; Thu, 26 Aug 2010 03:32:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=fhC+w48FDHaLL6r6Q8iuRmB26+tJsqpRlmNwtbmW3GA=; b=FL/kslEfZDdt9E9h1lvpCWw5gb1G4ORDla/DcSHhvrO+/d8kyPJ8Di53SajDAfAni+ Aric2d3WRU1JEZ/nNSL3rrKEBuOPDn4M5QA+Z8SuWFNnXe4ngxDDtgHX7/9smlU18oaB aMjmixZFiQQcIBB4MT1Uskc+5M91Mdz5bKVro= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=iyjtiNDiBP2HGWWd6zT9XHdSt1SvWlXbyq8HH8A5Ki2YLXGnnQSQjvJNO1MfA29pzx ASM0lnIq7OSasgW93VEUXL47Rx+ghWqifI+f02f3N8/mbQBAqCDB1yBYhnmgq72wZYUQ BGY00DJyX0VJAxpTFEtKOdiHq9h72fKP6LPN0= MIME-Version: 1.0 Received: by 10.216.154.133 with SMTP id h5mr8718059wek.93.1282818753646; Thu, 26 Aug 2010 03:32:33 -0700 (PDT) Received: by 10.216.156.135 with HTTP; Thu, 26 Aug 2010 03:32:33 -0700 (PDT) In-Reply-To: <201008260525.o7Q5PpGu032625@svn.freebsd.org> References: <201008260525.o7Q5PpGu032625@svn.freebsd.org> Date: Thu, 26 Aug 2010 16:02:33 +0530 Message-ID: From: "Jayachandran C." To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211832 - head/usr.sbin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 10:32:35 -0000 On Thu, Aug 26, 2010 at 10:55 AM, Warner Losh wrote: > Author: imp > Date: Thu Aug 26 05:25:51 2010 > New Revision: 211832 > URL: http://svn.freebsd.org/changeset/base/211832 > > Log: > =A0Ugly kludge to paper over some kind of ld bug and/or misuse: don't > =A0build uathload on mips n64 either. I think the issue here is that the default bfd architecture for mips is 32bit (mips:3000). When the input is 'binary', the linker generates objects of this architecture, and this object cannot be linked to n32 or n64 executables. The definition is in contrib/binutils/bfd/cpu-mips.c, in definition of bfd_mips_arch. But to change this, we will need to patch the GNU contrib code... Another solution is to use 'objcopy -B mips:isa64' (which can set the bfd architecture) to convert the binary to elf object instead of using 'ld'. JC. From owner-svn-src-all@FreeBSD.ORG Thu Aug 26 11:20:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F71A1065673; Thu, 26 Aug 2010 11:20:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3B378FC1E; Thu, 26 Aug 2010 11:20:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7QBKvlh041259; Thu, 26 Aug 2010 11:20:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7QBKv5Y041257; Thu, 26 Aug 2010 11:20:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008261120.o7QBKv5Y041257@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 26 Aug 2010 11:20:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211838 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 11:20:58 -0000 Author: kib Date: Thu Aug 26 11:20:57 2010 New Revision: 211838 URL: http://svn.freebsd.org/changeset/base/211838 Log: Fix typo. Submitted by: Ben Kaduk Modified: head/sys/kern/syscalls.master Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Thu Aug 26 10:27:45 2010 (r211837) +++ head/sys/kern/syscalls.master Thu Aug 26 11:20:57 2010 (r211838) @@ -40,7 +40,7 @@ ; NOPROTO same as STD except do not create structure or ; function prototype in sys/sysproto.h. Does add a ; definition to syscall.h besides adding a sysent. -; NONSTATIC syscall is loadable +; NOTSTATIC syscall is loadable ; ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master From owner-svn-src-all@FreeBSD.ORG Thu Aug 26 11:22:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F03D71065693; Thu, 26 Aug 2010 11:22:12 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E05D08FC19; Thu, 26 Aug 2010 11:22:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7QBMCS8041336; Thu, 26 Aug 2010 11:22:12 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7QBMCWn041334; Thu, 26 Aug 2010 11:22:12 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008261122.o7QBMCWn041334@svn.freebsd.org> From: Rui Paulo Date: Thu, 26 Aug 2010 11:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211839 - head/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 11:22:13 -0000 Author: rpaulo Date: Thu Aug 26 11:22:12 2010 New Revision: 211839 URL: http://svn.freebsd.org/changeset/base/211839 Log: Sync DTrace bits with amd64 and fix the build. Sponsored by: The FreeBSD Foundation Modified: head/sys/i386/i386/trap.c Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Thu Aug 26 11:20:57 2010 (r211838) +++ head/sys/i386/i386/trap.c Thu Aug 26 11:22:12 2010 (r211839) @@ -119,8 +119,12 @@ dtrace_doubletrap_func_t dtrace_doubletr */ systrace_probe_func_t systrace_probe_func; -dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; -dtrace_return_probe_ptr_t dtrace_return_probe_ptr; +/* + * These hooks are necessary for the pid, usdt and fasttrap providers. + */ +dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; +dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; +dtrace_return_probe_ptr_t dtrace_return_probe_ptr; #endif extern void trap(struct trapframe *frame); From owner-svn-src-all@FreeBSD.ORG Thu Aug 26 11:25:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E379106564A; Thu, 26 Aug 2010 11:25:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D6B88FC22; Thu, 26 Aug 2010 11:25:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7QBP9Ca041445; Thu, 26 Aug 2010 11:25:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7QBP9vx041442; Thu, 26 Aug 2010 11:25:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008261125.o7QBP9vx041442@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 26 Aug 2010 11:25:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211840 - in stable/8/lib/libc: . stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 11:25:09 -0000 Author: kib Date: Thu Aug 26 11:25:09 2010 New Revision: 211840 URL: http://svn.freebsd.org/changeset/base/211840 Log: MFC r211704: Style. Modified: stable/8/lib/libc/Makefile stable/8/lib/libc/stdlib/atexit.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/locale/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) Modified: stable/8/lib/libc/Makefile ============================================================================== --- stable/8/lib/libc/Makefile Thu Aug 26 11:22:12 2010 (r211839) +++ stable/8/lib/libc/Makefile Thu Aug 26 11:25:09 2010 (r211840) @@ -118,7 +118,7 @@ libkern.${MACHINE_ARCH}:: ${KMSRCS} .if defined(KMSRCS) && !empty(KMSRCS) cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${MACHINE_ARCH} .endif - + .include # Disable warnings in contributed sources. Modified: stable/8/lib/libc/stdlib/atexit.c ============================================================================== --- stable/8/lib/libc/stdlib/atexit.c Thu Aug 26 11:22:12 2010 (r211839) +++ stable/8/lib/libc/stdlib/atexit.c Thu Aug 26 11:25:09 2010 (r211840) @@ -119,7 +119,7 @@ atexit(void (*func)(void)) int error; fn.fn_type = ATEXIT_FN_STD; - fn.fn_ptr.std_func = func;; + fn.fn_ptr.std_func = func; fn.fn_arg = NULL; fn.fn_dso = NULL; @@ -138,7 +138,7 @@ __cxa_atexit(void (*func)(void *), void int error; fn.fn_type = ATEXIT_FN_CXA; - fn.fn_ptr.cxa_func = func;; + fn.fn_ptr.cxa_func = func; fn.fn_arg = arg; fn.fn_dso = dso; From owner-svn-src-all@FreeBSD.ORG Thu Aug 26 11:45:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 950F51065693; Thu, 26 Aug 2010 11:45:39 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A3DF8FC15; Thu, 26 Aug 2010 11:45:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7QBjdqR041875; Thu, 26 Aug 2010 11:45:39 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7QBjdHm041873; Thu, 26 Aug 2010 11:45:39 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008261145.o7QBjdHm041873@svn.freebsd.org> From: Rui Paulo Date: Thu, 26 Aug 2010 11:45:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211841 - head/cddl/usr.sbin/dtruss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 11:45:39 -0000 Author: rpaulo Date: Thu Aug 26 11:45:39 2010 New Revision: 211841 URL: http://svn.freebsd.org/changeset/base/211841 Log: Add a man page for dtruss. Sponsored by: The FreeBSD Foundation Added: head/cddl/usr.sbin/dtruss/dtruss.1 (contents, props changed) Modified: head/cddl/usr.sbin/dtruss/Makefile Modified: head/cddl/usr.sbin/dtruss/Makefile ============================================================================== --- head/cddl/usr.sbin/dtruss/Makefile Thu Aug 26 11:25:09 2010 (r211840) +++ head/cddl/usr.sbin/dtruss/Makefile Thu Aug 26 11:45:39 2010 (r211841) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../../cddl/contrib/dtracetoolkit SCRIPTS=dtruss -NO_MAN= +MAN=dtruss.1 .include Added: head/cddl/usr.sbin/dtruss/dtruss.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.sbin/dtruss/dtruss.1 Thu Aug 26 11:45:39 2010 (r211841) @@ -0,0 +1,89 @@ +.\" +.\" Copyright (c) 2010 The FreeBSD Foundation +.\" All rights reserved. +.\" +.\" This software was developed by Rui Paulo under sponsorship from the +.\" FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd August 26, 2010 +.Dt DTRUSS 1 +.Os +.Sh NAME +.Nm dtruss +.Nd Trace system calls and userland stacks using DTrace +.Sh SYNOPSIS +.Nm +.Op Fl acdefholLs +.Op Fl t Ar syscall +.Op Fl n Ar name Fl p Ar pid Ar command +.Sh DESCRIPTION +The +.Nm +utility traces system calls and (optionally) userland stack traces for the +specified programs. +.Pp +The following options are available: +.Bl -tag -width indent +.It Fl p Ar pid +Trace the process with PID +.Ar pid . +.It Fl n Ar name +Trace the process with name +.Ar name . +.It Fl t Ar syscall +Trace the specified syscall only. +.It Fl a +Print all details. +.It Fl c +Print syscall counts. +.It Fl d +Print relative times (in microseconds). +.It Fl e +Print elapsed times (in microseconds). +.It Fl f +Follow the children processes. +.It Fl l +Force printing PID / TID. +.It Fl o +Print time spent on CPU. +.It Fl s +Print userland stack backtraces. +.It Fl L +Don't print PID / TID. +.It Fl b Ar bufsize +Specify the DTrace buffer size. +.El +.Sh EXIT STATUS +.Ex -std +.Sh SEE ALSO +.Xr dtrace 1 +.Sh HISTORY +The +.Nm +utility comes from the DTraceToolkit and was first imported into +.Fx 9.0 . +.Sh AUTHORS +.An Brendan Gregg From owner-svn-src-all@FreeBSD.ORG Thu Aug 26 11:46:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8A1E10656A4; Thu, 26 Aug 2010 11:46:38 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98AAB8FC1A; Thu, 26 Aug 2010 11:46:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7QBkcZ0041928; Thu, 26 Aug 2010 11:46:38 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7QBkcJx041926; Thu, 26 Aug 2010 11:46:38 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008261146.o7QBkcJx041926@svn.freebsd.org> From: Rui Paulo Date: Thu, 26 Aug 2010 11:46:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211842 - head/cddl/usr.sbin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 11:46:38 -0000 Author: rpaulo Date: Thu Aug 26 11:46:38 2010 New Revision: 211842 URL: http://svn.freebsd.org/changeset/base/211842 Log: Install dtruss. Sponsored by: The FreeBSD Foundation Modified: head/cddl/usr.sbin/Makefile Modified: head/cddl/usr.sbin/Makefile ============================================================================== --- head/cddl/usr.sbin/Makefile Thu Aug 26 11:45:39 2010 (r211841) +++ head/cddl/usr.sbin/Makefile Thu Aug 26 11:46:38 2010 (r211842) @@ -3,6 +3,7 @@ .include SUBDIR= ${_dtrace} \ + ${_dtruss} \ ${_lockstat} \ ${_zdb} @@ -14,6 +15,7 @@ _zdb= zdb .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" _dtrace= dtrace +_dtruss= dtruss _lockstat= lockstat .endif From owner-svn-src-all@FreeBSD.ORG Thu Aug 26 11:47:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A68B010656AE; Thu, 26 Aug 2010 11:47:44 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 0DD898FC18; Thu, 26 Aug 2010 11:47:32 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 52D9945E49; Thu, 26 Aug 2010 13:47:30 +0200 (CEST) Received: from localhost (pdawidek.whl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 5C55D4569A; Thu, 26 Aug 2010 13:47:25 +0200 (CEST) Date: Thu, 26 Aug 2010 13:47:20 +0200 From: Pawel Jakub Dawidek To: Rick Macklem Message-ID: <20100826114720.GA1996@garage.freebsd.pl> References: <201008252323.o7PNN0ST025510@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pWyiEgJYm5f9v55/" Content-Disposition: inline In-Reply-To: <201008252323.o7PNN0ST025510@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211830 - head/sys/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 11:47:44 -0000 --pWyiEgJYm5f9v55/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 25, 2010 at 11:23:00PM +0000, Rick Macklem wrote: > Author: rmacklem > Date: Wed Aug 25 23:23:00 2010 > New Revision: 211830 > URL: http://svn.freebsd.org/changeset/base/211830 >=20 > Log: > Add mutex locking for the call to replay_prune() in > replay_setsize(), since replay_prune() expects the > rc_lock to be held when it is called. Ah! Rick, I've more fixes to this file. Could you review the following patch: http://people.freebsd.org/~pjd/patches/rpc_replay.c.patch --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --pWyiEgJYm5f9v55/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkx2VEcACgkQForvXbEpPzQpcQCeL+zWJezNTSe4pwIBehCrXzCg sU0AoM0eSOTonMgmnku4FeXtYDgYgVjv =5GIf -----END PGP SIGNATURE----- --pWyiEgJYm5f9v55/-- From owner-svn-src-all@FreeBSD.ORG Thu Aug 26 12:51:37 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AF0010656A5; Thu, 26 Aug 2010 12:51:37 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 015B68FC28; Thu, 26 Aug 2010 12:51:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o7QCj853022139; Thu, 26 Aug 2010 06:45:08 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 26 Aug 2010 06:45:11 -0600 (MDT) Message-Id: <20100826.064511.725436840347784963.imp@bsdimp.com> To: jmallett@FreeBSD.org From: "M. Warner Losh" In-Reply-To: References: <201008260525.o7Q5PpGu032625@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r211832 - head/usr.sbin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 12:51:37 -0000 In message: Juli Mallett writes: : On Wed, Aug 25, 2010 at 22:25, Warner Losh wrote: : > Author: imp : > Date: Thu Aug 26 05:25:51 2010 : > New Revision: 211832 : > URL: http://svn.freebsd.org/changeset/base/211832 : > : > Log: : > =A0Ugly kludge to paper over some kind of ld bug and/or misuse: don= 't : > =A0build uathload on mips n64 either. : = : Thanks for taking care of this. : = : If you could include n32 in this case, that'd be great. I don't know= : whether the rescue stuff is also broken on n32, but it's probably : worth doing a quick build with TARGET_ABI=3Dn32 to check, if you're i= n : the mood to commit these workarounds :) OK. Too bad this ugly kludge broke the case when TARGET_ABI isn't defined :( Warner From owner-svn-src-all@FreeBSD.ORG Thu Aug 26 13:00:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B54E81065673; Thu, 26 Aug 2010 13:00:29 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AE528FC21; Thu, 26 Aug 2010 13:00:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7QD0Tul043488; Thu, 26 Aug 2010 13:00:29 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7QD0TH5043486; Thu, 26 Aug 2010 13:00:29 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008261300.o7QD0TH5043486@svn.freebsd.org> From: Rui Paulo Date: Thu, 26 Aug 2010 13:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211843 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 13:00:29 -0000 Author: rpaulo Date: Thu Aug 26 13:00:29 2010 New Revision: 211843 URL: http://svn.freebsd.org/changeset/base/211843 Log: Mark __JCR_LIST__, __DTOR_END__, __JCR_END__, __FRAME_END__ as used to avoid segfaults when building with clang. Permission to backport given by Jan hubicka . Modified: head/contrib/gcc/crtstuff.c Modified: head/contrib/gcc/crtstuff.c ============================================================================== --- head/contrib/gcc/crtstuff.c Thu Aug 26 11:46:38 2010 (r211842) +++ head/contrib/gcc/crtstuff.c Thu Aug 26 13:00:29 2010 (r211843) @@ -211,7 +211,7 @@ STATIC EH_FRAME_SECTION_CONST char __EH_ /* Stick a label at the beginning of the java class registration info so we can register them properly. */ STATIC void *__JCR_LIST__[] - __attribute__ ((unused, section(JCR_SECTION_NAME), aligned(sizeof(void*)))) + __attribute__ ((used, section(JCR_SECTION_NAME), aligned(sizeof(void*)))) = { }; #endif /* JCR_SECTION_NAME */ @@ -472,11 +472,11 @@ DTOR_LIST_END; #elif defined(DTORS_SECTION_ASM_OP) asm (DTORS_SECTION_ASM_OP); STATIC func_ptr __DTOR_END__[1] - __attribute__ ((unused, aligned(sizeof(func_ptr)))) + __attribute__ ((used, aligned(sizeof(func_ptr)))) = { (func_ptr) 0 }; #else STATIC func_ptr __DTOR_END__[1] - __attribute__((unused, section(".dtors"), aligned(sizeof(func_ptr)))) + __attribute__((used, section(".dtors"), aligned(sizeof(func_ptr)))) = { (func_ptr) 0 }; #endif @@ -493,7 +493,7 @@ typedef short int32; # error "Missing a 4 byte integer" # endif STATIC EH_FRAME_SECTION_CONST int32 __FRAME_END__[] - __attribute__ ((unused, section(EH_FRAME_SECTION_NAME), + __attribute__ ((used, section(EH_FRAME_SECTION_NAME), aligned(sizeof(int32)))) = { 0 }; #endif /* EH_FRAME_SECTION_NAME */ @@ -501,7 +501,7 @@ STATIC EH_FRAME_SECTION_CONST int32 __FR #ifdef JCR_SECTION_NAME /* Null terminate the .jcr section array. */ STATIC void *__JCR_END__[1] - __attribute__ ((unused, section(JCR_SECTION_NAME), + __attribute__ ((used, section(JCR_SECTION_NAME), aligned(sizeof(void *)))) = { 0 }; #endif /* JCR_SECTION_NAME */ From owner-svn-src-all@FreeBSD.ORG Thu Aug 26 13:04:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99CF410656A7; Thu, 26 Aug 2010 13:04:16 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89C858FC13; Thu, 26 Aug 2010 13:04:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7QD4GKJ043591; Thu, 26 Aug 2010 13:04:16 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7QD4GF6043589; Thu, 26 Aug 2010 13:04:16 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008261304.o7QD4GF6043589@svn.freebsd.org> From: Rui Paulo Date: Thu, 26 Aug 2010 13:04:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211844 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 13:04:16 -0000 Author: rpaulo Date: Thu Aug 26 13:04:16 2010 New Revision: 211844 URL: http://svn.freebsd.org/changeset/base/211844 Log: Mark __DTOR_LIST__, __EH_FRAME_BEGIN__ and __CTOR_END__ as used to avoid segfaults when building with clang. This comes (partly) from the LLVM svn r41105. Modified: head/contrib/gcc/crtstuff.c Modified: head/contrib/gcc/crtstuff.c ============================================================================== --- head/contrib/gcc/crtstuff.c Thu Aug 26 13:00:29 2010 (r211843) +++ head/contrib/gcc/crtstuff.c Thu Aug 26 13:04:16 2010 (r211844) @@ -191,11 +191,11 @@ DTOR_LIST_BEGIN; #elif defined(DTORS_SECTION_ASM_OP) asm (DTORS_SECTION_ASM_OP); STATIC func_ptr __DTOR_LIST__[1] - __attribute__ ((aligned(sizeof(func_ptr)))) + __attribute__ ((used, aligned(sizeof(func_ptr)))) = { (func_ptr) (-1) }; #else STATIC func_ptr __DTOR_LIST__[1] - __attribute__((section(".dtors"), aligned(sizeof(func_ptr)))) + __attribute__((used, section(".dtors"), aligned(sizeof(func_ptr)))) = { (func_ptr) (-1) }; #endif /* __DTOR_LIST__ alternatives */ @@ -203,7 +203,7 @@ STATIC func_ptr __DTOR_LIST__[1] /* Stick a label at the beginning of the frame unwind info so we can register and deregister it with the exception handling library code. */ STATIC EH_FRAME_SECTION_CONST char __EH_FRAME_BEGIN__[] - __attribute__((section(EH_FRAME_SECTION_NAME), aligned(4))) + __attribute__((used, section(EH_FRAME_SECTION_NAME), aligned(4))) = { }; #endif /* USE_EH_FRAME_REGISTRY */ @@ -459,11 +459,11 @@ CTOR_LIST_END; static func_ptr force_to_data[1] __attribute__ ((__used__)) = { }; asm (CTORS_SECTION_ASM_OP); STATIC func_ptr __CTOR_END__[1] - __attribute__((aligned(sizeof(func_ptr)))) + __attribute__((used, aligned(sizeof(func_ptr)))) = { (func_ptr) 0 }; #else STATIC func_ptr __CTOR_END__[1] - __attribute__((section(".ctors"), aligned(sizeof(func_ptr)))) + __attribute__((used, section(".ctors"), aligned(sizeof(func_ptr)))) = { (func_ptr) 0 }; #endif From owner-svn-src-all@FreeBSD.ORG Thu Aug 26 14:54:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 730731065695; Thu, 26 Aug 2010 14:54:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 492678FC1D; Thu, 26 Aug 2010 14:54:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7QEsCYh045839; Thu, 26 Aug 2010 14:54:12 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7QEsCfQ045837; Thu, 26 Aug 2010 14:54:12 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008261454.o7QEsCfQ045837@svn.freebsd.org> From: Warner Losh Date: Thu, 26 Aug 2010 14:54:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211845 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 14:54:12 -0000 Author: imp Date: Thu Aug 26 14:54:12 2010 New Revision: 211845 URL: http://svn.freebsd.org/changeset/base/211845 Log: Guard against TARGET_ABI being undefined (TARGET_ABI will go away soon) Modified: head/Makefile.mips Modified: head/Makefile.mips ============================================================================== --- head/Makefile.mips Thu Aug 26 13:04:16 2010 (r211844) +++ head/Makefile.mips Thu Aug 26 14:54:12 2010 (r211845) @@ -1,5 +1,5 @@ # $FreeBSD$ -.if ${TARGET_ABI} == "n64" +.if defined(TARGET_ABI) && ${TARGET_ABI} == "n64" MK_RESCUE=no .endif From owner-svn-src-all@FreeBSD.ORG Thu Aug 26 15:49:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 945F31065695; Thu, 26 Aug 2010 15:49:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83F1B8FC16; Thu, 26 Aug 2010 15:49:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7QFnqgi046939; Thu, 26 Aug 2010 15:49:52 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7QFnqRF046937; Thu, 26 Aug 2010 15:49:52 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008261549.o7QFnqRF046937@svn.freebsd.org> From: Warner Losh Date: Thu, 26 Aug 2010 15:49:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211846 - head/usr.sbin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 15:49:52 -0000 Author: imp Date: Thu Aug 26 15:49:52 2010 New Revision: 211846 URL: http://svn.freebsd.org/changeset/base/211846 Log: Make sure TARGET_ABI is defined. TARGET_ABI will die a horrible death after we get all of TBEMD merged back into head, and make mips64 imply n64, so don't bother to make this 100% pretty. You'll have to settle for only 64% pretty. Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Thu Aug 26 14:54:12 2010 (r211845) +++ head/usr.sbin/Makefile Thu Aug 26 15:49:52 2010 (r211846) @@ -413,7 +413,7 @@ _crunch= crunch .if ${MK_USB} != "no" .if ${MACHINE_ARCH} != "ia64" && \ - !(${MACHINE_ARCH} == "mips" && ${TARGET_ABI} == "n64") + !(${MACHINE_ARCH} == "mips" && defined(TARGET_ABI) && ${TARGET_ABI} == "n64") _uathload= uathload .endif _uhsoctl= uhsoctl From owner-svn-src-all@FreeBSD.ORG Thu Aug 26 16:01:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51C9B1065673; Thu, 26 Aug 2010 16:01:30 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 419AF8FC16; Thu, 26 Aug 2010 16:01:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7QG1UVY047275; Thu, 26 Aug 2010 16:01:30 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7QG1UeD047273; Thu, 26 Aug 2010 16:01:30 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201008261601.o7QG1UeD047273@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 26 Aug 2010 16:01:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211847 - head/sys/fs/devfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 16:01:30 -0000 Author: jh Date: Thu Aug 26 16:01:29 2010 New Revision: 211847 URL: http://svn.freebsd.org/changeset/base/211847 Log: Set de_dir for user created symbolic links. This will be needed to be able to resolve their parent directories. Modified: head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Thu Aug 26 15:49:52 2010 (r211846) +++ head/sys/fs/devfs/devfs_vnops.c Thu Aug 26 16:01:29 2010 (r211847) @@ -1539,6 +1539,7 @@ devfs_symlink(struct vop_symlink_args *a de->de_gid = 0; de->de_mode = 0755; de->de_inode = alloc_unr(devfs_inos); + de->de_dir = dd; de->de_dirent->d_type = DT_LNK; i = strlen(ap->a_target) + 1; de->de_symlink = malloc(i, M_DEVFS, M_WAITOK); From owner-svn-src-all@FreeBSD.ORG Thu Aug 26 19:55:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5A7D1065672; Thu, 26 Aug 2010 19:55:03 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DA7E8FC24; Thu, 26 Aug 2010 19:55:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7QJt3Ui052182; Thu, 26 Aug 2010 19:55:03 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7QJt3hG052175; Thu, 26 Aug 2010 19:55:03 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201008261955.o7QJt3hG052175@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 26 Aug 2010 19:55:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211848 - in stable/8/sys/dev/cxgb: . common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 19:55:03 -0000 Author: np Date: Thu Aug 26 19:55:03 2010 New Revision: 211848 URL: http://svn.freebsd.org/changeset/base/211848 Log: MFC r208887, r209115-209116, r209839-209841, r211345-211347 r208887 tunable to control mc5 partition r209115 make format string a string literal. r209116 Add knob to get packet timestamps from the hardware. r209839 Fix bufsize calculation so that cxgbtool can display information for the last I/O queue too. r209840 Eliminate ext_intr_task. The "slow" interrupt handler is already running on the adapter's task queue. Just do what the task does instead of enqueueing it. r209841 Improved link detection. r211345 wakeup is required if the adapter lock is released anywhere during init and not just for the may_sleep case. r211346 Always reset the XGMAC's XAUI PCS on a link up. r211347 Fix tx pause quanta and timer calculations. Modified: stable/8/sys/dev/cxgb/common/cxgb_ael1002.c stable/8/sys/dev/cxgb/common/cxgb_common.h stable/8/sys/dev/cxgb/common/cxgb_t3_hw.c stable/8/sys/dev/cxgb/common/cxgb_xgmac.c stable/8/sys/dev/cxgb/cxgb_adapter.h stable/8/sys/dev/cxgb/cxgb_main.c stable/8/sys/dev/cxgb/cxgb_sge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/cxgb/common/cxgb_ael1002.c ============================================================================== --- stable/8/sys/dev/cxgb/common/cxgb_ael1002.c Thu Aug 26 16:01:29 2010 (r211847) +++ stable/8/sys/dev/cxgb/common/cxgb_ael1002.c Thu Aug 26 19:55:03 2010 (r211848) @@ -297,6 +297,9 @@ static int get_link_status_r(struct cphy if (err) return err; *link_ok = (stat0 & stat1 & (stat2 >> 12)) & 1; + + if (*link_ok == 0) + return (0); } if (speed) *speed = SPEED_10000; @@ -1947,8 +1950,6 @@ static int ael2020_intr_enable(struct cp if (err) return err; - phy->caps |= POLL_LINK_1ST_TIME; - /* enable standard Link Alarm Status Interrupts */ err = t3_phy_lasi_intr_enable(phy); if (err) Modified: stable/8/sys/dev/cxgb/common/cxgb_common.h ============================================================================== --- stable/8/sys/dev/cxgb/common/cxgb_common.h Thu Aug 26 16:01:29 2010 (r211847) +++ stable/8/sys/dev/cxgb/common/cxgb_common.h Thu Aug 26 19:55:03 2010 (r211848) @@ -60,7 +60,6 @@ enum { /* skip 25 */ SUPPORTED_MISC_IRQ = 1 << 26, SUPPORTED_IRQ = (SUPPORTED_LINK_IRQ | SUPPORTED_MISC_IRQ), - POLL_LINK_1ST_TIME = 1 << 27 }; enum { /* adapter interrupt-maintained statistics */ @@ -701,7 +700,6 @@ void t3_port_intr_enable(adapter_t *adap void t3_port_intr_disable(adapter_t *adapter, int idx); void t3_port_intr_clear(adapter_t *adapter, int idx); int t3_slow_intr_handler(adapter_t *adapter); -int t3_phy_intr_handler(adapter_t *adapter); void t3_link_changed(adapter_t *adapter, int port_id); int t3_link_start(struct cphy *phy, struct cmac *mac, struct link_config *lc); @@ -747,6 +745,7 @@ int t3_mc7_bd_read(struct mc7 *mc7, unsi int t3_mac_init(struct cmac *mac); void t3b_pcs_reset(struct cmac *mac); +void t3c_pcs_force_los(struct cmac *mac); void t3_mac_disable_exact_filters(struct cmac *mac); void t3_mac_enable_exact_filters(struct cmac *mac); int t3_mac_enable(struct cmac *mac, int which); Modified: stable/8/sys/dev/cxgb/common/cxgb_t3_hw.c ============================================================================== --- stable/8/sys/dev/cxgb/common/cxgb_t3_hw.c Thu Aug 26 16:01:29 2010 (r211847) +++ stable/8/sys/dev/cxgb/common/cxgb_t3_hw.c Thu Aug 26 19:55:03 2010 (r211848) @@ -1530,6 +1530,9 @@ void t3_link_changed(adapter_t *adapter, phy->ops->get_link_status(phy, &link_ok, &speed, &duplex, &fc); + if (link_ok == 0) + pi->link_fault = LF_NO; + if (lc->requested_fc & PAUSE_AUTONEG) fc &= lc->requested_fc; else @@ -1555,6 +1558,13 @@ void t3_link_changed(adapter_t *adapter, pi->link_fault = LF_YES; } + if (uses_xaui(adapter)) { + if (adapter->params.rev >= T3_REV_C) + t3c_pcs_force_los(mac); + else + t3b_pcs_reset(mac); + } + /* Don't report link up */ link_ok = 0; } else { @@ -1581,12 +1591,20 @@ void t3_link_changed(adapter_t *adapter, /* down -> up, or up -> up with changed settings */ if (adapter->params.rev > 0 && uses_xaui(adapter)) { + + if (adapter->params.rev >= T3_REV_C) + t3c_pcs_force_los(mac); + else + t3b_pcs_reset(mac); + t3_write_reg(adapter, A_XGM_XAUI_ACT_CTRL + mac->offset, F_TXACTENABLE | F_RXEN); } + /* disable TX FIFO drain */ t3_set_reg_field(adapter, A_XGM_TXFIFO_CFG + mac->offset, F_ENDROPPKT, 0); + t3_mac_enable(mac, MAC_DIRECTION_TX | MAC_DIRECTION_RX); t3_set_reg_field(adapter, A_XGM_STAT_CTRL + mac->offset, F_CLRSTATS, 1); @@ -1606,24 +1624,21 @@ void t3_link_changed(adapter_t *adapter, t3_set_reg_field(adapter, A_XGM_INT_ENABLE + mac->offset, F_XGM_INT, 0); - } - if (!link_fault) { - if (is_10G(adapter)) - pi->phy.ops->power_down(&pi->phy, 1); t3_mac_disable(mac, MAC_DIRECTION_RX); - t3_link_start(phy, mac, lc); - } - /* - * Make sure Tx FIFO continues to drain, even as rxen is left - * high to help detect and indicate remote faults. - */ - t3_set_reg_field(adapter, A_XGM_TXFIFO_CFG + mac->offset, 0, - F_ENDROPPKT); - t3_write_reg(adapter, A_XGM_RX_CTRL + mac->offset, 0); - t3_write_reg(adapter, A_XGM_TX_CTRL + mac->offset, F_TXEN); - t3_write_reg(adapter, A_XGM_RX_CTRL + mac->offset, F_RXEN); + /* + * Make sure Tx FIFO continues to drain, even as rxen is + * left high to help detect and indicate remote faults. + */ + t3_set_reg_field(adapter, + A_XGM_TXFIFO_CFG + mac->offset, 0, F_ENDROPPKT); + t3_write_reg(adapter, A_XGM_RX_CTRL + mac->offset, 0); + t3_write_reg(adapter, + A_XGM_TX_CTRL + mac->offset, F_TXEN); + t3_write_reg(adapter, + A_XGM_RX_CTRL + mac->offset, F_RXEN); + } } t3_os_link_changed(adapter, port_id, link_ok, speed, duplex, fc, @@ -2160,13 +2175,14 @@ static int mac_intr_handler(adapter_t *a mac->stats.xaui_pcs_ctc_err++; if (cause & F_XAUIPCSALIGNCHANGE) mac->stats.xaui_pcs_align_change++; - if (cause & F_XGM_INT) { - t3_set_reg_field(adap, - A_XGM_INT_ENABLE + mac->offset, - F_XGM_INT, 0); + if (cause & F_XGM_INT & + t3_read_reg(adap, A_XGM_INT_ENABLE + mac->offset)) { + t3_set_reg_field(adap, A_XGM_INT_ENABLE + mac->offset, + F_XGM_INT, 0); /* link fault suspected */ pi->link_fault = LF_MAYBE; + t3_os_link_intr(pi); } t3_write_reg(adap, A_XGM_INT_CAUSE + mac->offset, cause); @@ -2180,7 +2196,7 @@ static int mac_intr_handler(adapter_t *a /* * Interrupt handler for PHY events. */ -int t3_phy_intr_handler(adapter_t *adapter) +static int phy_intr_handler(adapter_t *adapter) { u32 i, cause = t3_read_reg(adapter, A_T3DBG_INT_CAUSE); @@ -2194,7 +2210,7 @@ int t3_phy_intr_handler(adapter_t *adapt int phy_cause = p->phy.ops->intr_handler(&p->phy); if (phy_cause & cphy_cause_link_change) - t3_link_changed(adapter, i); + t3_os_link_intr(p); if (phy_cause & cphy_cause_fifo_error) p->phy.fifo_errors++; if (phy_cause & cphy_cause_module_change) @@ -2262,7 +2278,7 @@ int t3_slow_intr_handler(adapter_t *adap if (cause & F_XGMAC0_1) mac_intr_handler(adapter, 1); if (cause & F_T3DBG) - t3_os_ext_intr_handler(adapter); + phy_intr_handler(adapter); /* Clear the interrupts just processed. */ t3_write_reg(adapter, A_PL_INT_CAUSE0, cause); Modified: stable/8/sys/dev/cxgb/common/cxgb_xgmac.c ============================================================================== --- stable/8/sys/dev/cxgb/common/cxgb_xgmac.c Thu Aug 26 16:01:29 2010 (r211847) +++ stable/8/sys/dev/cxgb/common/cxgb_xgmac.c Thu Aug 26 19:55:03 2010 (r211848) @@ -97,11 +97,40 @@ void t3b_pcs_reset(struct cmac *mac) { t3_set_reg_field(mac->adapter, A_XGM_RESET_CTRL + mac->offset, F_PCS_RESET_, 0); - udelay(20); + + /* No delay required */ + t3_set_reg_field(mac->adapter, A_XGM_RESET_CTRL + mac->offset, 0, F_PCS_RESET_); } +void t3c_pcs_force_los(struct cmac *mac) +{ + t3_set_reg_field(mac->adapter, A_XGM_SERDES_STAT0 + mac->offset, + F_LOWSIGFORCEEN0 | F_LOWSIGFORCEVALUE0, + F_LOWSIGFORCEEN0 | F_LOWSIGFORCEVALUE0); + t3_set_reg_field(mac->adapter, A_XGM_SERDES_STAT1 + mac->offset, + F_LOWSIGFORCEEN1 | F_LOWSIGFORCEVALUE1, + F_LOWSIGFORCEEN1 | F_LOWSIGFORCEVALUE1); + t3_set_reg_field(mac->adapter, A_XGM_SERDES_STAT2 + mac->offset, + F_LOWSIGFORCEEN2 | F_LOWSIGFORCEVALUE2, + F_LOWSIGFORCEEN2 | F_LOWSIGFORCEVALUE2); + t3_set_reg_field(mac->adapter, A_XGM_SERDES_STAT3 + mac->offset, + F_LOWSIGFORCEEN3 | F_LOWSIGFORCEVALUE3, + F_LOWSIGFORCEEN3 | F_LOWSIGFORCEVALUE3); + + /* No delay required */ + + t3_set_reg_field(mac->adapter, A_XGM_SERDES_STAT0 + mac->offset, + F_LOWSIGFORCEEN0, 0); + t3_set_reg_field(mac->adapter, A_XGM_SERDES_STAT1 + mac->offset, + F_LOWSIGFORCEEN1, 0); + t3_set_reg_field(mac->adapter, A_XGM_SERDES_STAT2 + mac->offset, + F_LOWSIGFORCEEN2, 0); + t3_set_reg_field(mac->adapter, A_XGM_SERDES_STAT3 + mac->offset, + F_LOWSIGFORCEEN3, 0); +} + /** * t3_mac_init - initialize a MAC * @mac: the MAC to initialize @@ -433,7 +462,7 @@ static int rx_fifo_hwm(int mtu) */ int t3_mac_set_mtu(struct cmac *mac, unsigned int mtu) { - int hwm, lwm, divisor; + int hwm, lwm; int ipg; unsigned int thres, v, reg; adapter_t *adap = mac->adapter; @@ -512,16 +541,6 @@ int t3_mac_set_mtu(struct cmac *mac, uns t3_set_reg_field(adap, A_XGM_TXFIFO_CFG + mac->offset, V_TXFIFOTHRESH(M_TXFIFOTHRESH) | V_TXIPG(M_TXIPG), V_TXFIFOTHRESH(thres) | V_TXIPG(ipg)); - - /* Assuming a minimum drain rate of 2.5Gbps... - */ - if (adap->params.rev > 0) { - divisor = (adap->params.rev == T3_REV_C) ? 64 : 8; - t3_write_reg(adap, A_XGM_PAUSE_TIMER + mac->offset, - (hwm - lwm) * 4 / divisor); - } - t3_write_reg(adap, A_XGM_TX_PAUSE_QUANTA + mac->offset, - MAC_RXFIFO_SIZE * 4 * 8 / 512); return 0; } @@ -541,9 +560,17 @@ int t3_mac_set_speed_duplex_fc(struct cm u32 val; adapter_t *adap = mac->adapter; unsigned int oft = mac->offset; + unsigned int pause_bits; if (duplex >= 0 && duplex != DUPLEX_FULL) return -EINVAL; + + pause_bits = MAC_RXFIFO_SIZE * 4 * 8; + t3_write_reg(adap, A_XGM_TX_PAUSE_QUANTA + mac->offset, + pause_bits / 512); + t3_write_reg(adap, A_XGM_PAUSE_TIMER + mac->offset, + (pause_bits >> (adap->params.rev == T3_REV_C ? 10 : 7))); + if (mac->multiport) { u32 rx_max_pkt_size = G_RXMAXPKTSIZE(t3_read_reg(adap, @@ -552,9 +579,9 @@ int t3_mac_set_speed_duplex_fc(struct cm val &= ~V_RXFIFOPAUSEHWM(M_RXFIFOPAUSEHWM); val |= V_RXFIFOPAUSEHWM(rx_fifo_hwm(rx_max_pkt_size) / 8); t3_write_reg(adap, A_XGM_RXFIFO_CFG + oft, val); - t3_set_reg_field(adap, A_XGM_TX_CFG + oft, F_TXPAUSEEN, F_TXPAUSEEN); + return t3_vsc7323_set_speed_fc(adap, speed, fc, mac->ext_port); } if (speed >= 0) { Modified: stable/8/sys/dev/cxgb/cxgb_adapter.h ============================================================================== --- stable/8/sys/dev/cxgb/cxgb_adapter.h Thu Aug 26 16:01:29 2010 (r211847) +++ stable/8/sys/dev/cxgb/cxgb_adapter.h Thu Aug 26 19:55:03 2010 (r211848) @@ -106,6 +106,8 @@ struct port_info { int link_fault; uint8_t hw_addr[ETHER_ADDR_LEN]; + struct callout link_check_ch; + struct task link_check_task; struct task timer_reclaim_task; struct cdev *port_cdev; @@ -350,7 +352,6 @@ struct adapter { struct filter_info *filters; /* Tasks */ - struct task ext_intr_task; struct task slow_intr_task; struct task tick_task; struct taskqueue *tq; @@ -388,6 +389,8 @@ struct adapter { char reglockbuf[ADAPTER_LOCK_NAME_LEN]; char mdiolockbuf[ADAPTER_LOCK_NAME_LEN]; char elmerlockbuf[ADAPTER_LOCK_NAME_LEN]; + + int timestamp; }; struct t3_rx_mode { @@ -493,12 +496,12 @@ adap2pinfo(struct adapter *adap, int idx int t3_os_find_pci_capability(adapter_t *adapter, int cap); int t3_os_pci_save_state(struct adapter *adapter); int t3_os_pci_restore_state(struct adapter *adapter); +void t3_os_link_intr(struct port_info *); void t3_os_link_changed(adapter_t *adapter, int port_id, int link_status, int speed, int duplex, int fc, int mac_was_reset); void t3_os_phymod_changed(struct adapter *adap, int port_id); void t3_sge_err_intr_handler(adapter_t *adapter); int t3_offload_tx(struct t3cdev *, struct mbuf *); -void t3_os_ext_intr_handler(adapter_t *adapter); void t3_os_set_hw_addr(adapter_t *adapter, int port_idx, u8 hw_addr[]); int t3_mgmt_tx(adapter_t *adap, struct mbuf *m); @@ -527,10 +530,6 @@ int t3_get_desc(const struct sge_qset *q unsigned char *data); void t3_update_qset_coalesce(struct sge_qset *qs, const struct qset_params *p); -#define CXGB_TICKS(a) ((a)->params.linkpoll_period ? \ - (hz * (a)->params.linkpoll_period) / 10 : \ - (a)->params.stats_update_period * hz) - /* * XXX figure out how we can return this to being private to sge */ Modified: stable/8/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/8/sys/dev/cxgb/cxgb_main.c Thu Aug 26 16:01:29 2010 (r211847) +++ stable/8/sys/dev/cxgb/cxgb_main.c Thu Aug 26 19:55:03 2010 (r211848) @@ -95,9 +95,10 @@ static void cxgb_build_medialist(struct static void cxgb_media_status(struct ifnet *, struct ifmediareq *); static int setup_sge_qsets(adapter_t *); static void cxgb_async_intr(void *); -static void cxgb_ext_intr_handler(void *, int); static void cxgb_tick_handler(void *, int); static void cxgb_tick(void *); +static void link_check_callout(void *); +static void check_link_status(void *, int); static void setup_rss(adapter_t *sc); static int alloc_filters(struct adapter *); static int setup_hw_filters(struct adapter *); @@ -238,6 +239,10 @@ TUNABLE_INT("hw.cxgb.snd_queue_len", &cx SYSCTL_UINT(_hw_cxgb, OID_AUTO, snd_queue_len, CTLFLAG_RDTUN, &cxgb_snd_queue_len, 0, "send queue size "); +static int nfilters = -1; +TUNABLE_INT("hw.cxgb.nfilters", &nfilters); +SYSCTL_INT(_hw_cxgb, OID_AUTO, nfilters, CTLFLAG_RDTUN, + &nfilters, 0, "max number of entries in the filter table"); enum { MAX_TXQ_ENTRIES = 16384, @@ -582,7 +587,6 @@ cxgb_controller_attach(device_t dev) taskqueue_start_threads(&sc->tq, 1, PI_NET, "%s taskq", device_get_nameunit(dev)); - TASK_INIT(&sc->ext_intr_task, 0, cxgb_ext_intr_handler, sc); TASK_INIT(&sc->tick_task, 0, cxgb_tick_handler, sc); @@ -666,7 +670,7 @@ cxgb_controller_attach(device_t dev) sc->params.vpd.port_type[2], sc->params.vpd.port_type[3]); device_printf(sc->dev, "Firmware Version %s\n", &sc->fw_version[0]); - callout_reset(&sc->cxgb_tick_ch, CXGB_TICKS(sc), cxgb_tick, sc); + callout_reset(&sc->cxgb_tick_ch, hz, cxgb_tick, sc); t3_add_attach_sysctls(sc); out: if (error) @@ -974,7 +978,7 @@ cxgb_makedev(struct port_info *pi) { pi->port_cdev = make_dev(&cxgb_cdevsw, pi->ifp->if_dunit, - UID_ROOT, GID_WHEEL, 0600, if_name(pi->ifp)); + UID_ROOT, GID_WHEEL, 0600, "%s", if_name(pi->ifp)); if (pi->port_cdev == NULL) return (ENOMEM); @@ -1003,6 +1007,9 @@ cxgb_port_attach(device_t dev) device_get_unit(device_get_parent(dev)), p->port_id); PORT_LOCK_INIT(p, p->lockbuf); + callout_init(&p->link_check_ch, CALLOUT_MPSAFE); + TASK_INIT(&p->link_check_task, 0, check_link_status, p); + /* Allocate an ifnet object and set it up */ ifp = p->ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { @@ -1259,29 +1266,6 @@ void t3_os_phymod_changed(struct adapter } } -/* - * Interrupt-context handler for external (PHY) interrupts. - */ -void -t3_os_ext_intr_handler(adapter_t *sc) -{ - if (cxgb_debug) - printf("t3_os_ext_intr_handler\n"); - /* - * Schedule a task to handle external interrupts as they may be slow - * and we use a mutex to protect MDIO registers. We disable PHY - * interrupts in the meantime and let the task reenable them when - * it's done. - */ - if (sc->slow_intr_mask) { - ADAPTER_LOCK(sc); - sc->slow_intr_mask &= ~F_T3DBG; - t3_write_reg(sc, A_PL_INT_ENABLE0, sc->slow_intr_mask); - taskqueue_enqueue(sc->tq, &sc->ext_intr_task); - ADAPTER_UNLOCK(sc); - } -} - void t3_os_set_hw_addr(adapter_t *adapter, int port_idx, u8 hw_addr[]) { @@ -1650,6 +1634,7 @@ static int cxgb_up(struct adapter *sc) { int err = 0; + unsigned int mxf = t3_mc5_size(&sc->mc5) - MC5_MIN_TIDS; KASSERT(sc->open_device_map == 0, ("%s: device(s) already open (%x)", __func__, sc->open_device_map)); @@ -1666,11 +1651,13 @@ cxgb_up(struct adapter *sc) if ((err = update_tpsram(sc))) goto out; - if (is_offload(sc)) { + if (is_offload(sc) && nfilters != 0) { sc->params.mc5.nservers = 0; - sc->params.mc5.nroutes = 0; - sc->params.mc5.nfilters = t3_mc5_size(&sc->mc5) - - MC5_MIN_TIDS; + + if (nfilters < 0) + sc->params.mc5.nfilters = mxf; + else + sc->params.mc5.nfilters = min(nfilters, mxf); } err = t3_init_hw(sc, 0); @@ -1791,11 +1778,12 @@ cxgb_init_locked(struct port_info *p) struct adapter *sc = p->adapter; struct ifnet *ifp = p->ifp; struct cmac *mac = &p->mac; - int i, rc = 0, may_sleep = 0; + int i, rc = 0, may_sleep = 0, gave_up_lock = 0; ADAPTER_LOCK_ASSERT_OWNED(sc); while (!IS_DOOMED(p) && IS_BUSY(sc)) { + gave_up_lock = 1; if (mtx_sleep(&sc->flags, &sc->lock, PCATCH, "cxgbinit", 0)) { rc = EINTR; goto done; @@ -1815,6 +1803,7 @@ cxgb_init_locked(struct port_info *p) if (may_sleep) { SET_BUSY(sc); + gave_up_lock = 1; ADAPTER_UNLOCK(sc); } @@ -1843,8 +1832,6 @@ cxgb_init_locked(struct port_info *p) ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; PORT_UNLOCK(p); - t3_link_changed(sc, p->port_id); - for (i = p->first_qset; i < p->first_qset + p->nqsets; i++) { struct sge_qset *qs = &sc->sge.qs[i]; struct sge_txq *txq = &qs->txq[TXQ_ETH]; @@ -1855,14 +1842,18 @@ cxgb_init_locked(struct port_info *p) /* all ok */ setbit(&sc->open_device_map, p->port_id); + callout_reset(&p->link_check_ch, + p->phy.caps & SUPPORTED_LINK_IRQ ? hz * 3 : hz / 4, + link_check_callout, p); done: if (may_sleep) { ADAPTER_LOCK(sc); KASSERT(IS_BUSY(sc), ("%s: controller not busy.", __func__)); CLR_BUSY(sc); - wakeup_one(&sc->flags); } + if (gave_up_lock) + wakeup_one(&sc->flags); ADAPTER_UNLOCK(sc); return (rc); } @@ -1928,9 +1919,11 @@ cxgb_uninit_synchronized(struct port_inf clrbit(&sc->open_device_map, pi->port_id); t3_port_intr_disable(sc, pi->port_id); taskqueue_drain(sc->tq, &sc->slow_intr_task); - taskqueue_drain(sc->tq, &sc->ext_intr_task); taskqueue_drain(sc->tq, &sc->tick_task); + callout_drain(&pi->link_check_ch); + taskqueue_drain(sc->tq, &pi->link_check_task); + PORT_LOCK(pi); ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); @@ -2286,61 +2279,47 @@ cxgb_async_intr(void *data) { adapter_t *sc = data; - if (cxgb_debug) - device_printf(sc->dev, "cxgb_async_intr\n"); - /* - * May need to sleep - defer to taskqueue - */ + t3_write_reg(sc, A_PL_INT_ENABLE0, 0); + (void) t3_read_reg(sc, A_PL_INT_ENABLE0); taskqueue_enqueue(sc->tq, &sc->slow_intr_task); } static void -cxgb_ext_intr_handler(void *arg, int count) +link_check_callout(void *arg) { - adapter_t *sc = (adapter_t *)arg; - - if (cxgb_debug) - printf("cxgb_ext_intr_handler\n"); + struct port_info *pi = arg; + struct adapter *sc = pi->adapter; - t3_phy_intr_handler(sc); + if (!isset(&sc->open_device_map, pi->port_id)) + return; - /* Now reenable external interrupts */ - ADAPTER_LOCK(sc); - if (sc->slow_intr_mask) { - sc->slow_intr_mask |= F_T3DBG; - t3_write_reg(sc, A_PL_INT_CAUSE0, F_T3DBG); - t3_write_reg(sc, A_PL_INT_ENABLE0, sc->slow_intr_mask); - } - ADAPTER_UNLOCK(sc); + taskqueue_enqueue(sc->tq, &pi->link_check_task); } -static inline int -link_poll_needed(struct port_info *p) +static void +check_link_status(void *arg, int pending) { - struct cphy *phy = &p->phy; + struct port_info *pi = arg; + struct adapter *sc = pi->adapter; - if (phy->caps & POLL_LINK_1ST_TIME) { - p->phy.caps &= ~POLL_LINK_1ST_TIME; - return (1); - } + if (!isset(&sc->open_device_map, pi->port_id)) + return; + + t3_link_changed(sc, pi->port_id); - return (p->link_fault || !(phy->caps & SUPPORTED_LINK_IRQ)); + if (pi->link_fault || !(pi->phy.caps & SUPPORTED_LINK_IRQ)) + callout_reset(&pi->link_check_ch, hz, link_check_callout, pi); } -static void -check_link_status(adapter_t *sc) +void +t3_os_link_intr(struct port_info *pi) { - int i; - - for (i = 0; i < (sc)->params.nports; ++i) { - struct port_info *p = &sc->port[i]; - - if (!isset(&sc->open_device_map, p->port_id)) - continue; - - if (link_poll_needed(p)) - t3_link_changed(sc, i); - } + /* + * Schedule a link check in the near future. If the link is flapping + * rapidly we'll keep resetting the callout and delaying the check until + * things stabilize a bit. + */ + callout_reset(&pi->link_check_ch, hz / 4, link_check_callout, pi); } static void @@ -2392,7 +2371,7 @@ cxgb_tick(void *arg) return; taskqueue_enqueue(sc->tq, &sc->tick_task); - callout_reset(&sc->cxgb_tick_ch, CXGB_TICKS(sc), cxgb_tick, sc); + callout_reset(&sc->cxgb_tick_ch, hz, cxgb_tick, sc); } static void @@ -2406,8 +2385,6 @@ cxgb_tick_handler(void *arg, int count) if (sc->flags & CXGB_SHUTDOWN || !(sc->flags & FULL_INIT_DONE)) return; - check_link_status(sc); - if (p->rev == T3_REV_B2 && p->nports < 4 && sc->open_device_map) check_t3b2_mac(sc); @@ -3077,7 +3054,6 @@ cxgb_extension_ioctl(struct cdev *dev, u if (!error) { v = (uint32_t *)buf; - ioqs->bufsize -= 4 * sizeof(uint32_t); ioqs->ioq_rx_enable = *v++; ioqs->ioq_tx_enable = *v++; ioqs->ioq_rx_status = *v++; Modified: stable/8/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- stable/8/sys/dev/cxgb/cxgb_sge.c Thu Aug 26 16:01:29 2010 (r211847) +++ stable/8/sys/dev/cxgb/cxgb_sge.c Thu Aug 26 19:55:03 2010 (r211848) @@ -910,6 +910,8 @@ sge_slow_intr_handler(void *arg, int nco adapter_t *sc = arg; t3_slow_intr_handler(sc); + t3_write_reg(sc, A_PL_INT_ENABLE0, sc->slow_intr_mask); + (void) t3_read_reg(sc, A_PL_INT_ENABLE0); } /** @@ -2961,6 +2963,7 @@ process_responses(adapter_t *adap, struc struct lro_ctrl *lro_ctrl = &qs->lro.ctrl; struct mbuf *offload_mbufs[RX_BUNDLE_SIZE]; int ngathered = 0; + struct t3_mbuf_hdr *mh = &rspq->rspq_mh; #ifdef DEBUG static int last_holdoff = 0; if (cxgb_debug && rspq->holdoff_tmr != last_holdoff) { @@ -2984,9 +2987,9 @@ process_responses(adapter_t *adap, struc if (cxgb_debug) printf("async notification\n"); - if (rspq->rspq_mh.mh_head == NULL) { - rspq->rspq_mh.mh_head = m_gethdr(M_DONTWAIT, MT_DATA); - m = rspq->rspq_mh.mh_head; + if (mh->mh_head == NULL) { + mh->mh_head = m_gethdr(M_DONTWAIT, MT_DATA); + m = mh->mh_head; } else { m = m_gethdr(M_DONTWAIT, MT_DATA); } @@ -3005,27 +3008,28 @@ process_responses(adapter_t *adap, struc DPRINTF("IMM DATA VALID opcode=0x%x rspq->cidx=%d\n", r->rss_hdr.opcode, rspq->cidx); - if (rspq->rspq_mh.mh_head == NULL) - rspq->rspq_mh.mh_head = m_gethdr(M_DONTWAIT, MT_DATA); + if (mh->mh_head == NULL) + mh->mh_head = m_gethdr(M_DONTWAIT, MT_DATA); else m = m_gethdr(M_DONTWAIT, MT_DATA); - if (rspq->rspq_mh.mh_head == NULL && m == NULL) { + if (mh->mh_head == NULL && m == NULL) { no_mem: rspq->next_holdoff = NOMEM_INTR_DELAY; budget_left--; break; } - get_imm_packet(adap, r, rspq->rspq_mh.mh_head); + get_imm_packet(adap, r, mh->mh_head); eop = 1; rspq->imm_data++; } else if (r->len_cq) { int drop_thresh = eth ? SGE_RX_DROP_THRES : 0; - eop = get_packet(adap, drop_thresh, qs, &rspq->rspq_mh, r); + eop = get_packet(adap, drop_thresh, qs, mh, r); if (eop) { - rspq->rspq_mh.mh_head->m_flags |= M_FLOWID; - rspq->rspq_mh.mh_head->m_pkthdr.flowid = rss_hash; + if (r->rss_hdr.hash_type && !adap->timestamp) + mh->mh_head->m_flags |= M_FLOWID; + mh->mh_head->m_pkthdr.flowid = rss_hash; } ethpad = 2; @@ -3050,20 +3054,20 @@ process_responses(adapter_t *adap, struc rspq->credits = 0; } if (!eth && eop) { - rspq->rspq_mh.mh_head->m_pkthdr.csum_data = rss_csum; + mh->mh_head->m_pkthdr.csum_data = rss_csum; /* * XXX size mismatch */ - m_set_priority(rspq->rspq_mh.mh_head, rss_hash); + m_set_priority(mh->mh_head, rss_hash); ngathered = rx_offload(&adap->tdev, rspq, - rspq->rspq_mh.mh_head, offload_mbufs, ngathered); - rspq->rspq_mh.mh_head = NULL; + mh->mh_head, offload_mbufs, ngathered); + mh->mh_head = NULL; DPRINTF("received offload packet\n"); } else if (eth && eop) { - struct mbuf *m = rspq->rspq_mh.mh_head; + struct mbuf *m = mh->mh_head; t3_rx_eth(adap, rspq, m, ethpad); @@ -3092,7 +3096,7 @@ process_responses(adapter_t *adap, struc struct ifnet *ifp = m->m_pkthdr.rcvif; (*ifp->if_input)(ifp, m); } - rspq->rspq_mh.mh_head = NULL; + mh->mh_head = NULL; } __refill_fl_lt(adap, &qs->fl[0], 32); @@ -3166,8 +3170,11 @@ t3b_intr(void *data) if (!map) return; - if (__predict_false(map & F_ERRINTR)) + if (__predict_false(map & F_ERRINTR)) { + t3_write_reg(adap, A_PL_INT_ENABLE0, 0); + (void) t3_read_reg(adap, A_PL_INT_ENABLE0); taskqueue_enqueue(adap->tq, &adap->slow_intr_task); + } mtx_lock(&q0->lock); for_each_port(adap, i) @@ -3195,8 +3202,11 @@ t3_intr_msi(void *data) if (process_responses_gts(adap, &adap->sge.qs[i].rspq)) new_packets = 1; mtx_unlock(&q0->lock); - if (new_packets == 0) + if (new_packets == 0) { + t3_write_reg(adap, A_PL_INT_ENABLE0, 0); + (void) t3_read_reg(adap, A_PL_INT_ENABLE0); taskqueue_enqueue(adap->tq, &adap->slow_intr_task); + } } void @@ -3459,6 +3469,29 @@ t3_set_coalesce_usecs(SYSCTL_HANDLER_ARG return (0); } +static int +t3_pkt_timestamp(SYSCTL_HANDLER_ARGS) +{ + adapter_t *sc = arg1; + int rc, timestamp; + + if ((sc->flags & FULL_INIT_DONE) == 0) + return (ENXIO); + + timestamp = sc->timestamp; + rc = sysctl_handle_int(oidp, ×tamp, arg2, req); + + if (rc != 0) + return (rc); + + if (timestamp != sc->timestamp) { + t3_set_reg_field(sc, A_TP_PC_CONFIG2, F_ENABLERXPKTTMSTPRSS, + timestamp ? F_ENABLERXPKTTMSTPRSS : 0); + sc->timestamp = timestamp; + } + + return (0); +} void t3_add_attach_sysctls(adapter_t *sc) @@ -3493,6 +3526,10 @@ t3_add_attach_sysctls(adapter_t *sc) "txq_overrun", CTLFLAG_RD, &txq_fills, 0, "#times txq overrun"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "core_clock", + CTLFLAG_RD, &sc->params.vpd.cclk, + 0, "core clock frequency (in KHz)"); } @@ -3537,6 +3574,12 @@ t3_add_configured_sysctls(adapter_t *sc) 0, t3_set_coalesce_usecs, "I", "interrupt coalescing timer (us)"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + "pkt_timestamp", + CTLTYPE_INT | CTLFLAG_RW, sc, + 0, t3_pkt_timestamp, + "I", "provide packet timestamp instead of connection hash"); + for (i = 0; i < sc->params.nports; i++) { struct port_info *pi = &sc->port[i]; struct sysctl_oid *poid; From owner-svn-src-all@FreeBSD.ORG Thu Aug 26 20:44:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA9CF1065694; Thu, 26 Aug 2010 20:44:12 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5D158FC21; Thu, 26 Aug 2010 20:44:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7QKiCCr053235; Thu, 26 Aug 2010 20:44:12 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7QKiCrI053223; Thu, 26 Aug 2010 20:44:12 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201008262044.o7QKiCrI053223@svn.freebsd.org> From: Ulrich Spoerlein Date: Thu, 26 Aug 2010 20:44:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211849 - in stable/8: lib/libarchive sbin/restore sys/dev/cxgb/ulp/iw_cxgb sys/fs/msdosfs sys/gnu/fs/ext2fs usr.bin/cpio usr.bin/tar usr.bin/tar/test usr.bin/xinstall usr.sbin/mtree X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 20:44:12 -0000 Author: uqs Date: Thu Aug 26 20:44:12 2010 New Revision: 211849 URL: http://svn.freebsd.org/changeset/base/211849 Log: MFC r204111: Fix common misspelling of hierarchy Modified: stable/8/lib/libarchive/archive_write_disk.3 stable/8/sbin/restore/restore.h stable/8/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_qp.c stable/8/sys/fs/msdosfs/msdosfs_vnops.c stable/8/sys/gnu/fs/ext2fs/ext2_vnops.c stable/8/usr.bin/cpio/bsdcpio.1 stable/8/usr.bin/tar/test/test_option_T.c stable/8/usr.bin/tar/test/test_option_s.c stable/8/usr.bin/tar/tree.c stable/8/usr.bin/xinstall/xinstall.c stable/8/usr.sbin/mtree/mtree.5 Directory Properties: stable/8/lib/libarchive/ (props changed) stable/8/sbin/restore/ (props changed) stable/8/sys/ (props changed) stable/8/usr.bin/cpio/ (props changed) stable/8/usr.bin/tar/ (props changed) stable/8/usr.bin/xinstall/ (props changed) stable/8/usr.sbin/mtree/ (props changed) Modified: stable/8/lib/libarchive/archive_write_disk.3 ============================================================================== --- stable/8/lib/libarchive/archive_write_disk.3 Thu Aug 26 19:55:03 2010 (r211848) +++ stable/8/lib/libarchive/archive_write_disk.3 Thu Aug 26 20:44:12 2010 (r211849) @@ -339,7 +339,7 @@ In particular, the directory .Pa aa is created as well as the final object .Pa bb . -In theory, this can be exploited to create an entire directory heirarchy +In theory, this can be exploited to create an entire directory hierarchy with a single request. Of course, this does not work if the .Cm ARCHIVE_EXTRACT_NODOTDOT @@ -371,5 +371,5 @@ compact implementation when appropriate. .Pp There should be a corresponding .Nm archive_read_disk -interface that walks a directory heirarchy and returns archive +interface that walks a directory hierarchy and returns archive entry objects. \ No newline at end of file Modified: stable/8/sbin/restore/restore.h ============================================================================== --- stable/8/sbin/restore/restore.h Thu Aug 26 19:55:03 2010 (r211848) +++ stable/8/sbin/restore/restore.h Thu Aug 26 20:44:12 2010 (r211849) @@ -41,7 +41,7 @@ extern int bflag; /* set input block size */ extern int dflag; /* print out debugging info */ extern int Dflag; /* degraded mode - try hard to get stuff back */ -extern int hflag; /* restore heirarchies */ +extern int hflag; /* restore hierarchies */ extern int mflag; /* restore by name instead of inode number */ extern int Nflag; /* do not write the disk */ extern int uflag; /* unlink symlink targets */ Modified: stable/8/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_qp.c ============================================================================== --- stable/8/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_qp.c Thu Aug 26 19:55:03 2010 (r211848) +++ stable/8/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_qp.c Thu Aug 26 20:44:12 2010 (r211849) @@ -675,7 +675,7 @@ static void __flush_qp(struct iwch_qp *q qhp->refcnt++; mtx_unlock(&qhp->lock); - /* locking heirarchy: cq lock first, then qp lock. */ + /* locking hierarchy: cq lock first, then qp lock. */ mtx_lock(&rchp->lock); mtx_lock(&qhp->lock); cxio_flush_hw_cq(&rchp->cq); @@ -685,7 +685,7 @@ static void __flush_qp(struct iwch_qp *q mtx_unlock(&rchp->lock); (*rchp->ibcq.comp_handler)(&rchp->ibcq, rchp->ibcq.cq_context); - /* locking heirarchy: cq lock first, then qp lock. */ + /* locking hierarchy: cq lock first, then qp lock. */ mtx_lock(&schp->lock); mtx_lock(&qhp->lock); cxio_flush_hw_cq(&schp->cq); Modified: stable/8/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- stable/8/sys/fs/msdosfs/msdosfs_vnops.c Thu Aug 26 19:55:03 2010 (r211848) +++ stable/8/sys/fs/msdosfs/msdosfs_vnops.c Thu Aug 26 20:44:12 2010 (r211849) @@ -1072,7 +1072,7 @@ abortit: /* * If ".." must be changed (ie the directory gets a new * parent) then the source directory must not be in the - * directory heirarchy above the target, as this would + * directory hierarchy above the target, as this would * orphan everything below the source directory. Also * the user must have write permission in the source so * as to be able to change "..". We must repeat the call Modified: stable/8/sys/gnu/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/8/sys/gnu/fs/ext2fs/ext2_vnops.c Thu Aug 26 19:55:03 2010 (r211848) +++ stable/8/sys/gnu/fs/ext2fs/ext2_vnops.c Thu Aug 26 20:44:12 2010 (r211849) @@ -864,7 +864,7 @@ abortit: /* * If ".." must be changed (ie the directory gets a new * parent) then the source directory must not be in the - * directory heirarchy above the target, as this would + * directory hierarchy above the target, as this would * orphan everything below the source directory. Also * the user must have write permission in the source so * as to be able to change "..". We must repeat the call Modified: stable/8/usr.bin/cpio/bsdcpio.1 ============================================================================== --- stable/8/usr.bin/cpio/bsdcpio.1 Thu Aug 26 19:55:03 2010 (r211848) +++ stable/8/usr.bin/cpio/bsdcpio.1 Thu Aug 26 20:44:12 2010 (r211849) @@ -266,7 +266,7 @@ for more information. .Sh EXAMPLES The .Nm -command is traditionally used to copy file heirarchies in conjunction +command is traditionally used to copy file hierarchies in conjunction with the .Xr find 1 command. Modified: stable/8/usr.bin/tar/test/test_option_T.c ============================================================================== --- stable/8/usr.bin/tar/test/test_option_T.c Thu Aug 26 19:55:03 2010 (r211848) +++ stable/8/usr.bin/tar/test/test_option_T.c Thu Aug 26 20:44:12 2010 (r211849) @@ -43,7 +43,7 @@ DEFINE_TEST(test_option_T) int r; struct stat st; - /* Create a simple dir heirarchy; bail if anything fails. */ + /* Create a simple dir hierarchy; bail if anything fails. */ if (!assertEqualInt(0, mkdir("d1", 0755))) return; if (!assertEqualInt(0, mkdir("d1/d2", 0755))) return; if (!touch("d1/f1")) return; Modified: stable/8/usr.bin/tar/test/test_option_s.c ============================================================================== --- stable/8/usr.bin/tar/test/test_option_s.c Thu Aug 26 19:55:03 2010 (r211848) +++ stable/8/usr.bin/tar/test/test_option_s.c Thu Aug 26 20:44:12 2010 (r211849) @@ -44,7 +44,7 @@ DEFINE_TEST(test_option_s) { struct stat st; - /* Create a sample file heirarchy. */ + /* Create a sample file hierarchy. */ assertEqualInt(0, mkdir("in", 0755)); assertEqualInt(0, mkdir("in/d1", 0755)); assertEqualInt(0, mkfile("in/d1/foo", "foo")); Modified: stable/8/usr.bin/tar/tree.c ============================================================================== --- stable/8/usr.bin/tar/tree.c Thu Aug 26 19:55:03 2010 (r211848) +++ stable/8/usr.bin/tar/tree.c Thu Aug 26 20:44:12 2010 (r211849) @@ -313,7 +313,7 @@ tree_next(struct tree *t) * violation. Just crash now. */ if (t->visit_type == TREE_ERROR_FATAL) { const char *msg = "Unable to continue traversing" - " directory heirarchy after a fatal error."; + " directory hierarchy after a fatal error."; write(2, msg, strlen(msg)); *(int *)0 = 1; /* Deliberate SEGV; NULL pointer dereference. */ exit(1); /* In case the SEGV didn't work. */ Modified: stable/8/usr.bin/xinstall/xinstall.c ============================================================================== --- stable/8/usr.bin/xinstall/xinstall.c Thu Aug 26 19:55:03 2010 (r211848) +++ stable/8/usr.bin/xinstall/xinstall.c Thu Aug 26 20:44:12 2010 (r211849) @@ -734,7 +734,7 @@ strip(const char *to_name) /* * install_dir -- - * build directory heirarchy + * build directory hierarchy */ void install_dir(char *path) Modified: stable/8/usr.sbin/mtree/mtree.5 ============================================================================== --- stable/8/usr.sbin/mtree/mtree.5 Thu Aug 26 19:55:03 2010 (r211848) +++ stable/8/usr.sbin/mtree/mtree.5 Thu Aug 26 20:44:12 2010 (r211849) @@ -33,12 +33,12 @@ .Os .Sh NAME .Nm mtree -.Nd format of mtree dir heirarchy files +.Nd format of mtree dir hierarchy files .Sh DESCRIPTION The .Nm format is a textual format that describes a collection of filesystem objects. -Such files are typically used to create or verify directory heirarchies. +Such files are typically used to create or verify directory hierarchies. .Ss General Format An .Nm From owner-svn-src-all@FreeBSD.ORG Thu Aug 26 23:33:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD53F1065670; Thu, 26 Aug 2010 23:33:04 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82EAB8FC13; Thu, 26 Aug 2010 23:33:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7QNX4s6056763; Thu, 26 Aug 2010 23:33:04 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7QNX484056761; Thu, 26 Aug 2010 23:33:04 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008262333.o7QNX484056761@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 26 Aug 2010 23:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211853 - head/sys/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 23:33:04 -0000 Author: pjd Date: Thu Aug 26 23:33:04 2010 New Revision: 211853 URL: http://svn.freebsd.org/changeset/base/211853 Log: - Check the result of malloc(M_NOWAIT) in replay_alloc(). The caller (replay_alloc()) knows how to handle replay_alloc() failure. - Eliminate 'freed_one' variable, it is not needed - when no entry is found rce will be NULL. - Add locking assertions where we expect a rc_lock to be held. Reviewed by: rmacklem MFC after: 2 weeks Modified: head/sys/rpc/replay.c Modified: head/sys/rpc/replay.c ============================================================================== --- head/sys/rpc/replay.c Thu Aug 26 22:07:27 2010 (r211852) +++ head/sys/rpc/replay.c Thu Aug 26 23:33:04 2010 (r211853) @@ -113,8 +113,12 @@ replay_alloc(struct replay_cache *rc, { struct replay_cache_entry *rce; + mtx_assert(&rc->rc_lock, MA_OWNED); + rc->rc_count++; rce = malloc(sizeof(*rce), M_RPC, M_NOWAIT|M_ZERO); + if (!rce) + return (NULL); rce->rce_hash = h; rce->rce_msg = *msg; bcopy(addr, &rce->rce_addr, addr->sa_len); @@ -129,6 +133,8 @@ static void replay_free(struct replay_cache *rc, struct replay_cache_entry *rce) { + mtx_assert(&rc->rc_lock, MA_OWNED); + rc->rc_count--; TAILQ_REMOVE(&rc->rc_cache[rce->rce_hash], rce, rce_link); TAILQ_REMOVE(&rc->rc_all, rce, rce_alllink); @@ -143,26 +149,25 @@ static void replay_prune(struct replay_cache *rc) { struct replay_cache_entry *rce; - bool_t freed_one; - if (rc->rc_count >= REPLAY_MAX || rc->rc_size > rc->rc_maxsize) { - do { - freed_one = FALSE; - /* - * Try to free an entry. Don't free in-progress entries - */ - TAILQ_FOREACH_REVERSE(rce, &rc->rc_all, - replay_cache_list, rce_alllink) { - if (rce->rce_repmsg.rm_xid) { - replay_free(rc, rce); - freed_one = TRUE; - break; - } - } - } while (freed_one - && (rc->rc_count >= REPLAY_MAX - || rc->rc_size > rc->rc_maxsize)); - } + mtx_assert(&rc->rc_lock, MA_OWNED); + + if (rc->rc_count < REPLAY_MAX && rc->rc_size <= rc->rc_maxsize) + return; + + do { + /* + * Try to free an entry. Don't free in-progress entries. + */ + TAILQ_FOREACH_REVERSE(rce, &rc->rc_all, replay_cache_list, + rce_alllink) { + if (rce->rce_repmsg.rm_xid) + break; + } + if (rce) + replay_free(rc, rce); + } while (rce && (rc->rc_count >= REPLAY_MAX + || rc->rc_size > rc->rc_maxsize)); } enum replay_state From owner-svn-src-all@FreeBSD.ORG Thu Aug 26 23:41:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD6891065694; Thu, 26 Aug 2010 23:41:40 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD4278FC12; Thu, 26 Aug 2010 23:41:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7QNfeBM057183; Thu, 26 Aug 2010 23:41:40 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7QNfeR2057181; Thu, 26 Aug 2010 23:41:40 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008262341.o7QNfeR2057181@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 26 Aug 2010 23:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211854 - head/sys/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 23:41:41 -0000 Author: pjd Date: Thu Aug 26 23:41:40 2010 New Revision: 211854 URL: http://svn.freebsd.org/changeset/base/211854 Log: - When VFS_VGET() is not supported, switch to VOP_LOOKUP(). - We are fine by only share-locking the vnode. - Remove assertion that doesn't hold for ZFS where we cross mount points boundaries by going into .zfs/snapshot//. Reviewed by: rmacklem MFC after: 1 month Modified: head/sys/nfsserver/nfs_serv.c Modified: head/sys/nfsserver/nfs_serv.c ============================================================================== --- head/sys/nfsserver/nfs_serv.c Thu Aug 26 23:33:04 2010 (r211853) +++ head/sys/nfsserver/nfs_serv.c Thu Aug 26 23:41:40 2010 (r211854) @@ -3041,7 +3041,8 @@ nfsrv_readdirplus(struct nfsrv_descript u_quad_t off, toff, verf; u_long *cookies = NULL, *cookiep; /* needs to be int64_t or off_t */ int v3 = (nfsd->nd_flag & ND_NFSV3); - int vfslocked; + int usevget = 1, vfslocked; + struct componentname cn; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); vfslocked = 0; @@ -3186,28 +3187,6 @@ again: goto again; } - /* - * Probe one of the directory entries to see if the filesystem - * supports VGET. - */ - error = VFS_VGET(vp->v_mount, dp->d_fileno, LK_EXCLUSIVE, &nvp); - if (error) { - if (error == EOPNOTSUPP) - error = NFSERR_NOTSUPP; - else - error = NFSERR_SERVERFAULT; - vrele(vp); - vp = NULL; - free((caddr_t)cookies, M_TEMP); - free((caddr_t)rbuf, M_TEMP); - nfsm_reply(NFSX_V3POSTOPATTR); - nfsm_srvpostop_attr(getret, &at); - error = 0; - goto nfsmout; - } - vput(nvp); - nvp = NULL; - dirlen = len = NFSX_V3POSTOPATTR + NFSX_V3COOKIEVERF + 2 * NFSX_UNSIGNED; nfsm_reply(cnt); @@ -3224,23 +3203,49 @@ again: nlen = dp->d_namlen; rem = nfsm_rndup(nlen)-nlen; - /* - * For readdir_and_lookup get the vnode using - * the file number. - */ - if (VFS_VGET(vp->v_mount, dp->d_fileno, LK_EXCLUSIVE, - &nvp)) - goto invalid; + if (usevget) { + /* + * For readdir_and_lookup get the vnode using + * the file number. + */ + error = VFS_VGET(vp->v_mount, dp->d_fileno, + LK_SHARED, &nvp); + if (error != 0 && error != EOPNOTSUPP) { + error = 0; + goto invalid; + } else if (error == EOPNOTSUPP) { + /* + * VFS_VGET() not supported? + * Let's switch to VOP_LOOKUP(). + */ + error = 0; + usevget = 0; + cn.cn_nameiop = LOOKUP; + cn.cn_flags = ISLASTCN | NOFOLLOW | \ + LOCKSHARED | LOCKLEAF | MPSAFE; + cn.cn_lkflags = LK_SHARED | LK_RETRY; + cn.cn_cred = cred; + cn.cn_thread = curthread; + } + } + if (!usevget) { + cn.cn_nameptr = dp->d_name; + cn.cn_namelen = dp->d_namlen; + if (dp->d_namlen == 2 && + dp->d_name[0] == '.' && + dp->d_name[1] == '.') { + cn.cn_flags |= ISDOTDOT; + } else { + cn.cn_flags &= ~ISDOTDOT; + } + if (!VOP_ISLOCKED(vp)) + vn_lock(vp, LK_SHARED | LK_RETRY); + if (VOP_LOOKUP(vp, &nvp, &cn) != 0) + goto invalid; + } + bzero((caddr_t)nfhp, NFSX_V3FH); - nfhp->fh_fsid = - nvp->v_mount->mnt_stat.f_fsid; - /* - * XXXRW: Assert the mountpoints are the same so that - * we know that acquiring Giant based on the - * directory is the right thing for the child. - */ - KASSERT(nvp->v_mount == vp->v_mount, - ("nfsrv_readdirplus: nvp mount != vp mount")); + nfhp->fh_fsid = nvp->v_mount->mnt_stat.f_fsid; if (VOP_VPTOFH(nvp, &nfhp->fh_fid)) { vput(nvp); nvp = NULL; @@ -3336,7 +3341,10 @@ invalid: cookiep++; ncookies--; } - vrele(vp); + if (!usevget && VOP_ISLOCKED(vp)) + vput(vp); + else + vrele(vp); vp = NULL; nfsm_clget; *tl = nfsrv_nfs_false; From owner-svn-src-all@FreeBSD.ORG Thu Aug 26 23:44:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A26001065698; Thu, 26 Aug 2010 23:44:32 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91F3B8FC0C; Thu, 26 Aug 2010 23:44:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7QNiW9i057275; Thu, 26 Aug 2010 23:44:32 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7QNiW2W057273; Thu, 26 Aug 2010 23:44:32 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008262344.o7QNiW2W057273@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 26 Aug 2010 23:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211855 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2010 23:44:32 -0000 Author: pjd Date: Thu Aug 26 23:44:32 2010 New Revision: 211855 URL: http://svn.freebsd.org/changeset/base/211855 Log: Update comment now that I finally committed r211854. MFC after: 1 month Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Aug 26 23:41:40 2010 (r211854) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Aug 26 23:44:32 2010 (r211855) @@ -1563,15 +1563,9 @@ zfs_vget(vfs_t *vfsp, ino_t ino, int fla int err; /* - * XXXPJD: zfs_zget() can't operate on virtual entires like .zfs/ or - * .zfs/snapshot/ directories, so for now just return EOPNOTSUPP. - * This will make NFS to fall back to using READDIR instead of - * READDIRPLUS. - * Also snapshots are stored in AVL tree, but based on their names, - * not inode numbers, so it will be very inefficient to iterate - * over all snapshots to find the right one. - * Note that OpenSolaris READDIRPLUS implementation does LOOKUP on - * d_name, and not VGET on d_fileno as we do. + * zfs_zget() can't operate on virtual entires like .zfs/ or + * .zfs/snapshot/ directories, that's why we return EOPNOTSUPP. + * This will make NFS to switch to LOOKUP instead of using VGET. */ if (ino == ZFSCTL_INO_ROOT || ino == ZFSCTL_INO_SNAPDIR) return (EOPNOTSUPP); From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 02:14:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9A541065674; Fri, 27 Aug 2010 02:14:02 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A804C8FC1A; Fri, 27 Aug 2010 02:14:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7R2E2qK060112; Fri, 27 Aug 2010 02:14:02 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7R2E2tQ060108; Fri, 27 Aug 2010 02:14:02 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201008270214.o7R2E2tQ060108@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 27 Aug 2010 02:14:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211856 - stable/7/sys/dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 02:14:02 -0000 Author: np Date: Fri Aug 27 02:14:02 2010 New Revision: 211856 URL: http://svn.freebsd.org/changeset/base/211856 Log: MFC r204348, r206109 r204348 Support IFCAP_VLAN_HWTSO capability. r206109 Bump response queue size to 2K, add statistic for starvation. Modified: stable/7/sys/dev/cxgb/cxgb_adapter.h stable/7/sys/dev/cxgb/cxgb_main.c stable/7/sys/dev/cxgb/cxgb_sge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/cxgb/cxgb_adapter.h ============================================================================== --- stable/7/sys/dev/cxgb/cxgb_adapter.h Thu Aug 26 23:44:32 2010 (r211855) +++ stable/7/sys/dev/cxgb/cxgb_adapter.h Fri Aug 27 02:14:02 2010 (r211856) @@ -149,7 +149,7 @@ enum { #define FL_Q_SIZE 4096 #define JUMBO_Q_SIZE 1024 -#define RSPQ_Q_SIZE 1024 +#define RSPQ_Q_SIZE 2048 #define TX_ETH_Q_SIZE 1024 enum { TXQ_ETH = 0, @@ -187,6 +187,7 @@ struct sge_rspq { uint32_t offload_bundles; uint32_t pure_rsps; uint32_t unhandled_irqs; + uint32_t starved; bus_addr_t phys_addr; bus_dma_tag_t desc_tag; Modified: stable/7/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/7/sys/dev/cxgb/cxgb_main.c Thu Aug 26 23:44:32 2010 (r211855) +++ stable/7/sys/dev/cxgb/cxgb_main.c Fri Aug 27 02:14:02 2010 (r211856) @@ -1012,9 +1012,9 @@ cxgb_makedev(struct port_info *pi) } #ifdef TSO_SUPPORTED -#define CXGB_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO) +#define CXGB_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO | IFCAP_VLAN_HWTSO) /* Don't enable TSO6 yet */ -#define CXGB_CAP_ENABLE (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | IFCAP_TSO4 | IFCAP_JUMBO_MTU | IFCAP_LRO) +#define CXGB_CAP_ENABLE (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | IFCAP_TSO4 | IFCAP_JUMBO_MTU | IFCAP_LRO | IFCAP_VLAN_HWTSO) #else #define CXGB_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_JUMBO_MTU) /* Don't enable TSO6 yet */ @@ -1072,9 +1072,9 @@ cxgb_port_attach(device_t dev) /* * disable TSO on 4-port - it isn't supported by the firmware yet */ - if (p->adapter->params.nports > 2) { - ifp->if_capabilities &= ~(IFCAP_TSO4 | IFCAP_TSO6); - ifp->if_capenable &= ~(IFCAP_TSO4 | IFCAP_TSO6); + if (sc->params.nports > 2) { + ifp->if_capabilities &= ~(IFCAP_TSO4 | IFCAP_TSO6 | IFCAP_VLAN_HWTSO); + ifp->if_capenable &= ~(IFCAP_TSO4 | IFCAP_TSO6 | IFCAP_VLAN_HWTSO); ifp->if_hwassist &= ~CSUM_TSO; } @@ -2095,28 +2095,34 @@ fail: mask = ifr->ifr_reqcap ^ ifp->if_capenable; if (mask & IFCAP_TXCSUM) { - if (IFCAP_TXCSUM & ifp->if_capenable) { - ifp->if_capenable &= ~(IFCAP_TXCSUM|IFCAP_TSO4); - ifp->if_hwassist &= ~(CSUM_TCP | CSUM_UDP - | CSUM_IP | CSUM_TSO); - } else { - ifp->if_capenable |= IFCAP_TXCSUM; - ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP - | CSUM_IP); + ifp->if_capenable ^= IFCAP_TXCSUM; + ifp->if_hwassist ^= (CSUM_TCP | CSUM_UDP | CSUM_IP); + + if (IFCAP_TSO & ifp->if_capenable && + !(IFCAP_TXCSUM & ifp->if_capenable)) { + ifp->if_capenable &= ~IFCAP_TSO; + ifp->if_hwassist &= ~CSUM_TSO; + if_printf(ifp, + "tso disabled due to -txcsum.\n"); } } - if (mask & IFCAP_RXCSUM) { + if (mask & IFCAP_RXCSUM) ifp->if_capenable ^= IFCAP_RXCSUM; - } if (mask & IFCAP_TSO4) { - if (IFCAP_TSO4 & ifp->if_capenable) { - ifp->if_capenable &= ~IFCAP_TSO4; - ifp->if_hwassist &= ~CSUM_TSO; - } else if (IFCAP_TXCSUM & ifp->if_capenable) { - ifp->if_capenable |= IFCAP_TSO4; - ifp->if_hwassist |= CSUM_TSO; + ifp->if_capenable ^= IFCAP_TSO4; + + if (IFCAP_TSO & ifp->if_capenable) { + if (IFCAP_TXCSUM & ifp->if_capenable) + ifp->if_hwassist |= CSUM_TSO; + else { + ifp->if_capenable &= ~IFCAP_TSO; + ifp->if_hwassist &= ~CSUM_TSO; + if_printf(ifp, + "enable txcsum first.\n"); + error = EAGAIN; + } } else - error = EINVAL; + ifp->if_hwassist &= ~CSUM_TSO; } if (mask & IFCAP_LRO) { ifp->if_capenable ^= IFCAP_LRO; @@ -2140,6 +2146,8 @@ fail: PORT_UNLOCK(p); } } + if (mask & IFCAP_VLAN_HWTSO) + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; if (mask & IFCAP_VLAN_HWCSUM) ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; @@ -2431,25 +2439,33 @@ cxgb_tick_handler(void *arg, int count) if (p->rev == T3_REV_B2 && p->nports < 4 && sc->open_device_map) check_t3b2_mac(sc); - cause = t3_read_reg(sc, A_SG_INT_CAUSE); - reset = 0; - if (cause & F_FLEMPTY) { + cause = t3_read_reg(sc, A_SG_INT_CAUSE) & (F_RSPQSTARVE | F_FLEMPTY); + if (cause) { struct sge_qset *qs = &sc->sge.qs[0]; + uint32_t mask, v; + + v = t3_read_reg(sc, A_SG_RSPQ_FL_STATUS) & ~0xff00; + + mask = 1; + for (i = 0; i < SGE_QSETS; i++) { + if (v & mask) + qs[i].rspq.starved++; + mask <<= 1; + } - i = 0; - reset |= F_FLEMPTY; + mask <<= SGE_QSETS; /* skip RSPQXDISABLED */ - cause = (t3_read_reg(sc, A_SG_RSPQ_FL_STATUS) >> - S_FL0EMPTY) & 0xffff; - while (cause) { - qs->fl[i].empty += (cause & 1); - if (i) - qs++; - i ^= 1; - cause >>= 1; + for (i = 0; i < SGE_QSETS * 2; i++) { + if (v & mask) { + qs[i / 2].fl[i % 2].empty++; + } + mask <<= 1; } + + /* clear */ + t3_write_reg(sc, A_SG_RSPQ_FL_STATUS, v); + t3_write_reg(sc, A_SG_INT_CAUSE, cause); } - t3_write_reg(sc, A_SG_INT_CAUSE, reset); for (i = 0; i < sc->params.nports; i++) { struct port_info *pi = &sc->port[i]; Modified: stable/7/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- stable/7/sys/dev/cxgb/cxgb_sge.c Thu Aug 26 23:44:32 2010 (r211855) +++ stable/7/sys/dev/cxgb/cxgb_sge.c Fri Aug 27 02:14:02 2010 (r211856) @@ -52,6 +52,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + +#include +#include +#include #include #include @@ -1215,8 +1220,8 @@ write_wr_hdr_sgl(unsigned int ndesc, str } } -/* sizeof(*eh) + sizeof(*vhdr) + sizeof(*ip) + sizeof(*tcp) */ -#define TCPPKTHDRSIZE (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + 20 + 20) +/* sizeof(*eh) + sizeof(*ip) + sizeof(*tcp) */ +#define TCPPKTHDRSIZE (ETHER_HDR_LEN + 20 + 20) #ifdef VLAN_SUPPORTED #define GET_VTAG(cntrl, m) \ @@ -1266,12 +1271,7 @@ t3_encap(struct sge_qset *qs, struct mbu txsd = &txq->sdesc[txq->pidx]; sgl = txq->txq_sgl; m0 = *m; - - DPRINTF("t3_encap port_id=%d qsidx=%d ", pi->port_id, pi->first_qset); - DPRINTF("mlen=%d txpkt_intf=%d tx_chan=%d\n", m[0]->m_pkthdr.len, pi->txpkt_intf, pi->tx_chan); - if (cxgb_debug) - printf("mi_base=%p cidx=%d pidx=%d\n\n", txsd->mi.mi_base, txq->cidx, txq->pidx); - + mtx_assert(&txq->lock, MA_OWNED); cntrl = V_TXPKT_INTF(pi->txpkt_intf); /* @@ -1339,11 +1339,11 @@ t3_encap(struct sge_qset *qs, struct mbu return (0); } else if (tso_info) { - int min_size = TCPPKTHDRSIZE, eth_type, tagged; + int eth_type; struct cpl_tx_pkt_lso *hdr = (struct cpl_tx_pkt_lso *)txd; + struct ether_header *eh; struct ip *ip; struct tcphdr *tcp; - char *pkthdr; txd->flit[2] = 0; GET_VTAG(cntrl, m0); @@ -1352,13 +1352,7 @@ t3_encap(struct sge_qset *qs, struct mbu mlen = m0->m_pkthdr.len; hdr->len = htonl(mlen | 0x80000000); - DPRINTF("tso buf len=%d\n", mlen); - - tagged = m0->m_flags & M_VLANTAG; - if (!tagged) - min_size -= ETHER_VLAN_ENCAP_LEN; - - if (__predict_false(mlen < min_size)) { + if (__predict_false(mlen < TCPPKTHDRSIZE)) { printf("mbuf=%p,len=%d,tso_segsz=%d,csum_flags=%#x,flags=%#x", m0, mlen, m0->m_pkthdr.tso_segsz, m0->m_pkthdr.csum_flags, m0->m_flags); @@ -1366,25 +1360,23 @@ t3_encap(struct sge_qset *qs, struct mbu } /* Make sure that ether, ip, tcp headers are all in m0 */ - if (__predict_false(m0->m_len < min_size)) { - m0 = m_pullup(m0, min_size); + if (__predict_false(m0->m_len < TCPPKTHDRSIZE)) { + m0 = m_pullup(m0, TCPPKTHDRSIZE); if (__predict_false(m0 == NULL)) { /* XXX panic probably an overreaction */ panic("couldn't fit header into mbuf"); } } - pkthdr = m0->m_data; - if (tagged) { + eh = mtod(m0, struct ether_header *); + if (eh->ether_type == htons(ETHERTYPE_VLAN)) { eth_type = CPL_ETH_II_VLAN; - ip = (struct ip *)(pkthdr + ETHER_HDR_LEN + - ETHER_VLAN_ENCAP_LEN); + ip = (struct ip *)((struct ether_vlan_header *)eh + 1); } else { eth_type = CPL_ETH_II; - ip = (struct ip *)(pkthdr + ETHER_HDR_LEN); + ip = (struct ip *)(eh + 1); } - tcp = (struct tcphdr *)((uint8_t *)ip + - sizeof(*ip)); + tcp = (struct tcphdr *)(ip + 1); tso_info |= V_LSO_ETH_TYPE(eth_type) | V_LSO_IPHDR_WORDS(ip->ip_hl) | @@ -1392,11 +1384,10 @@ t3_encap(struct sge_qset *qs, struct mbu hdr->lso_info = htonl(tso_info); if (__predict_false(mlen <= PIO_LEN)) { - /* pkt not undersized but fits in PIO_LEN + /* + * pkt not undersized but fits in PIO_LEN * Indicates a TSO bug at the higher levels. */ - DPRINTF("**5592 Fix** mbuf=%p,len=%d,tso_segsz=%d,csum_flags=%#x,flags=%#x", - m0, mlen, m0->m_pkthdr.tso_segsz, m0->m_pkthdr.csum_flags, m0->m_flags); txq_prod(txq, 1, &txqs); m_copydata(m0, 0, mlen, (caddr_t)&txd->flit[3]); m_freem(m0); @@ -3487,6 +3478,9 @@ t3_add_configured_sysctls(adapter_t *sc) SYSCTL_ADD_UINT(ctx, rspqpoidlist, OID_AUTO, "credits", CTLFLAG_RD, &qs->rspq.credits, 0, "#credits"); + SYSCTL_ADD_UINT(ctx, rspqpoidlist, OID_AUTO, "starved", + CTLFLAG_RD, &qs->rspq.starved, + 0, "#times starved"); SYSCTL_ADD_XLONG(ctx, rspqpoidlist, OID_AUTO, "phys_addr", CTLFLAG_RD, &qs->rspq.phys_addr, "physical_address_of the queue"); From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 02:29:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8793106564A; Fri, 27 Aug 2010 02:29:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6E588FC08; Fri, 27 Aug 2010 02:29:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7R2TGIi060459; Fri, 27 Aug 2010 02:29:16 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7R2TGoV060456; Fri, 27 Aug 2010 02:29:16 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201008270229.o7R2TGoV060456@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 27 Aug 2010 02:29:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211857 - stable/7/sys/dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 02:29:17 -0000 Author: np Date: Fri Aug 27 02:29:16 2010 New Revision: 211857 URL: http://svn.freebsd.org/changeset/base/211857 Log: MFC r207643, r207687, r208887, r209115 r207643 T3 hardware filters. r207687 Do not hold the T3 firmware in memory all the time. r208887 tunable to control mc5 partition r209115 make format string a string literal Modified: stable/7/sys/dev/cxgb/cxgb_ioctl.h stable/7/sys/dev/cxgb/cxgb_main.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/cxgb/cxgb_ioctl.h ============================================================================== --- stable/7/sys/dev/cxgb/cxgb_ioctl.h Fri Aug 27 02:14:02 2010 (r211856) +++ stable/7/sys/dev/cxgb/cxgb_ioctl.h Fri Aug 27 02:29:16 2010 (r211857) @@ -59,6 +59,9 @@ enum { CH_CLEAR_STATS, CH_GET_UP_LA, CH_GET_UP_IOQS, + CH_SET_FILTER, + CH_DEL_FILTER, + CH_GET_FILTER, }; /* statistics categories */ @@ -215,6 +218,29 @@ struct ch_up_ioqs { struct t3_ioq_entry *data; }; +struct ch_filter_tuple { + uint32_t sip; + uint32_t dip; + uint16_t sport; + uint16_t dport; + uint16_t vlan:12; + uint16_t vlan_prio:3; +}; + +struct ch_filter { + uint32_t filter_id; + struct ch_filter_tuple val; + struct ch_filter_tuple mask; + uint16_t mac_addr_idx; + uint8_t mac_hit:1; + uint8_t proto:2; + + uint8_t want_filter_id:1; + uint8_t pass:1; + uint8_t rss:1; + uint8_t qset; +}; + #define CHELSIO_SETREG _IOW('f', CH_SETREG, struct ch_reg) #define CHELSIO_GETREG _IOWR('f', CH_GETREG, struct ch_reg) #define CHELSIO_GETMTUTAB _IOR('f', CH_GETMTUTAB, struct ch_mtus) @@ -239,4 +265,7 @@ struct ch_up_ioqs { #define CHELSIO_GET_EEPROM _IOWR('f', CH_GET_EEPROM, struct ch_eeprom) #define CHELSIO_GET_UP_LA _IOWR('f', CH_GET_UP_LA, struct ch_up_la) #define CHELSIO_GET_UP_IOQS _IOWR('f', CH_GET_UP_IOQS, struct ch_up_ioqs) +#define CHELSIO_SET_FILTER _IOW('f', CH_SET_FILTER, struct ch_filter) +#define CHELSIO_DEL_FILTER _IOW('f', CH_DEL_FILTER, struct ch_filter) +#define CHELSIO_GET_FILTER _IOWR('f', CH_GET_FILTER, struct ch_filter) #endif Modified: stable/7/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/7/sys/dev/cxgb/cxgb_main.c Fri Aug 27 02:14:02 2010 (r211856) +++ stable/7/sys/dev/cxgb/cxgb_main.c Fri Aug 27 02:29:16 2010 (r211857) @@ -103,6 +103,13 @@ static void cxgb_ext_intr_handler(void * static void cxgb_tick_handler(void *, int); static void cxgb_tick(void *); static void setup_rss(adapter_t *sc); +static int alloc_filters(struct adapter *); +static int setup_hw_filters(struct adapter *); +static int set_filter(struct adapter *, int, const struct filter_info *); +static inline void mk_set_tcb_field(struct cpl_set_tcb_field *, unsigned int, + unsigned int, u64, u64); +static inline void set_tcb_field_ulp(struct cpl_set_tcb_field *, unsigned int, + unsigned int, u64, u64); /* Attachment glue for the PCI controller end of the device. Each port of * the device is attached separately, as defined later. @@ -235,6 +242,10 @@ TUNABLE_INT("hw.cxgb.snd_queue_len", &cx SYSCTL_UINT(_hw_cxgb, OID_AUTO, snd_queue_len, CTLFLAG_RDTUN, &cxgb_snd_queue_len, 0, "send queue size "); +static int nfilters = -1; +TUNABLE_INT("hw.cxgb.nfilters", &nfilters); +SYSCTL_INT(_hw_cxgb, OID_AUTO, nfilters, CTLFLAG_RDTUN, + &nfilters, 0, "max number of entries in the filter table"); enum { MAX_TXQ_ENTRIES = 16384, @@ -1001,7 +1012,7 @@ cxgb_makedev(struct port_info *pi) { pi->port_cdev = make_dev(&cxgb_cdevsw, pi->ifp->if_dunit, - UID_ROOT, GID_WHEEL, 0600, if_name(pi->ifp)); + UID_ROOT, GID_WHEEL, 0600, "%s", if_name(pi->ifp)); if (pi->port_cdev == NULL) return (ENOMEM); @@ -1695,6 +1706,7 @@ static int cxgb_up(struct adapter *sc) { int err = 0; + unsigned int mxf = t3_mc5_size(&sc->mc5) - MC5_MIN_TIDS; KASSERT(sc->open_device_map == 0, ("%s: device(s) already open (%x)", __func__, sc->open_device_map)); @@ -1711,6 +1723,15 @@ cxgb_up(struct adapter *sc) if ((err = update_tpsram(sc))) goto out; + if (is_offload(sc) && nfilters != 0) { + sc->params.mc5.nservers = 0; + + if (nfilters < 0) + sc->params.mc5.nfilters = mxf; + else + sc->params.mc5.nfilters = min(nfilters, mxf); + } + err = t3_init_hw(sc, 0); if (err) goto out; @@ -1722,6 +1743,7 @@ cxgb_up(struct adapter *sc) if (err) goto out; + alloc_filters(sc); setup_rss(sc); t3_intr_clear(sc); @@ -1748,6 +1770,7 @@ cxgb_up(struct adapter *sc) if (!(sc->flags & QUEUES_BOUND)) { bind_qsets(sc); + setup_hw_filters(sc); sc->flags |= QUEUES_BOUND; } @@ -3130,6 +3153,139 @@ cxgb_extension_ioctl(struct cdev *dev, u free(buf, M_DEVBUF); break; } + case CHELSIO_SET_FILTER: { + struct ch_filter *f = (struct ch_filter *)data;; + struct filter_info *p; + unsigned int nfilters = sc->params.mc5.nfilters; + + if (!is_offload(sc)) + return (EOPNOTSUPP); /* No TCAM */ + if (!(sc->flags & FULL_INIT_DONE)) + return (EAGAIN); /* mc5 not setup yet */ + if (nfilters == 0) + return (EBUSY); /* TOE will use TCAM */ + + /* sanity checks */ + if (f->filter_id >= nfilters || + (f->val.dip && f->mask.dip != 0xffffffff) || + (f->val.sport && f->mask.sport != 0xffff) || + (f->val.dport && f->mask.dport != 0xffff) || + (f->val.vlan && f->mask.vlan != 0xfff) || + (f->val.vlan_prio && + f->mask.vlan_prio != FILTER_NO_VLAN_PRI) || + (f->mac_addr_idx != 0xffff && f->mac_addr_idx > 15) || + f->qset >= SGE_QSETS || + sc->rrss_map[f->qset] >= RSS_TABLE_SIZE) + return (EINVAL); + + /* Was allocated with M_WAITOK */ + KASSERT(sc->filters, ("filter table NULL\n")); + + p = &sc->filters[f->filter_id]; + if (p->locked) + return (EPERM); + + bzero(p, sizeof(*p)); + p->sip = f->val.sip; + p->sip_mask = f->mask.sip; + p->dip = f->val.dip; + p->sport = f->val.sport; + p->dport = f->val.dport; + p->vlan = f->mask.vlan ? f->val.vlan : 0xfff; + p->vlan_prio = f->mask.vlan_prio ? (f->val.vlan_prio & 6) : + FILTER_NO_VLAN_PRI; + p->mac_hit = f->mac_hit; + p->mac_vld = f->mac_addr_idx != 0xffff; + p->mac_idx = f->mac_addr_idx; + p->pkt_type = f->proto; + p->report_filter_id = f->want_filter_id; + p->pass = f->pass; + p->rss = f->rss; + p->qset = f->qset; + + error = set_filter(sc, f->filter_id, p); + if (error == 0) + p->valid = 1; + break; + } + case CHELSIO_DEL_FILTER: { + struct ch_filter *f = (struct ch_filter *)data; + struct filter_info *p; + unsigned int nfilters = sc->params.mc5.nfilters; + + if (!is_offload(sc)) + return (EOPNOTSUPP); + if (!(sc->flags & FULL_INIT_DONE)) + return (EAGAIN); + if (nfilters == 0 || sc->filters == NULL) + return (EINVAL); + if (f->filter_id >= nfilters) + return (EINVAL); + + p = &sc->filters[f->filter_id]; + if (p->locked) + return (EPERM); + if (!p->valid) + return (EFAULT); /* Read "Bad address" as "Bad index" */ + + bzero(p, sizeof(*p)); + p->sip = p->sip_mask = 0xffffffff; + p->vlan = 0xfff; + p->vlan_prio = FILTER_NO_VLAN_PRI; + p->pkt_type = 1; + error = set_filter(sc, f->filter_id, p); + break; + } + case CHELSIO_GET_FILTER: { + struct ch_filter *f = (struct ch_filter *)data; + struct filter_info *p; + unsigned int i, nfilters = sc->params.mc5.nfilters; + + if (!is_offload(sc)) + return (EOPNOTSUPP); + if (!(sc->flags & FULL_INIT_DONE)) + return (EAGAIN); + if (nfilters == 0 || sc->filters == NULL) + return (EINVAL); + + i = f->filter_id == 0xffffffff ? 0 : f->filter_id + 1; + for (; i < nfilters; i++) { + p = &sc->filters[i]; + if (!p->valid) + continue; + + bzero(f, sizeof(*f)); + + f->filter_id = i; + f->val.sip = p->sip; + f->mask.sip = p->sip_mask; + f->val.dip = p->dip; + f->mask.dip = p->dip ? 0xffffffff : 0; + f->val.sport = p->sport; + f->mask.sport = p->sport ? 0xffff : 0; + f->val.dport = p->dport; + f->mask.dport = p->dport ? 0xffff : 0; + f->val.vlan = p->vlan == 0xfff ? 0 : p->vlan; + f->mask.vlan = p->vlan == 0xfff ? 0 : 0xfff; + f->val.vlan_prio = p->vlan_prio == FILTER_NO_VLAN_PRI ? + 0 : p->vlan_prio; + f->mask.vlan_prio = p->vlan_prio == FILTER_NO_VLAN_PRI ? + 0 : FILTER_NO_VLAN_PRI; + f->mac_hit = p->mac_hit; + f->mac_addr_idx = p->mac_vld ? p->mac_idx : 0xffff; + f->proto = p->pkt_type; + f->want_filter_id = p->report_filter_id; + f->pass = p->pass; + f->rss = p->rss; + f->qset = p->qset; + + break; + } + + if (i == nfilters) + f->filter_id = 0xffffffff; + break; + } default: return (EOPNOTSUPP); break; @@ -3184,5 +3340,127 @@ cxgb_get_regs(adapter_t *sc, struct ch_i XGM_REG(A_XGM_RX_SPI4_SOP_EOP_CNT, 1)); } +static int +alloc_filters(struct adapter *sc) +{ + struct filter_info *p; + unsigned int nfilters = sc->params.mc5.nfilters; -MODULE_DEPEND(if_cxgb, cxgb_t3fw, 1, 1, 1); + if (nfilters == 0) + return (0); + + p = malloc(sizeof(*p) * nfilters, M_DEVBUF, M_WAITOK | M_ZERO); + sc->filters = p; + + p = &sc->filters[nfilters - 1]; + p->vlan = 0xfff; + p->vlan_prio = FILTER_NO_VLAN_PRI; + p->pass = p->rss = p->valid = p->locked = 1; + + return (0); +} + +static int +setup_hw_filters(struct adapter *sc) +{ + int i, rc; + unsigned int nfilters = sc->params.mc5.nfilters; + + if (!sc->filters) + return (0); + + t3_enable_filters(sc); + + for (i = rc = 0; i < nfilters && !rc; i++) { + if (sc->filters[i].locked) + rc = set_filter(sc, i, &sc->filters[i]); + } + + return (rc); +} + +static int +set_filter(struct adapter *sc, int id, const struct filter_info *f) +{ + int len; + struct mbuf *m; + struct ulp_txpkt *txpkt; + struct work_request_hdr *wr; + struct cpl_pass_open_req *oreq; + struct cpl_set_tcb_field *sreq; + + len = sizeof(*wr) + sizeof(*oreq) + 2 * sizeof(*sreq); + KASSERT(len <= MHLEN, ("filter request too big for an mbuf")); + + id += t3_mc5_size(&sc->mc5) - sc->params.mc5.nroutes - + sc->params.mc5.nfilters; + + m = m_gethdr(M_WAITOK, MT_DATA); + m->m_len = m->m_pkthdr.len = len; + bzero(mtod(m, char *), len); + + wr = mtod(m, struct work_request_hdr *); + wr->wr_hi = htonl(V_WR_OP(FW_WROPCODE_BYPASS) | F_WR_ATOMIC); + + oreq = (struct cpl_pass_open_req *)(wr + 1); + txpkt = (struct ulp_txpkt *)oreq; + txpkt->cmd_dest = htonl(V_ULPTX_CMD(ULP_TXPKT)); + txpkt->len = htonl(V_ULPTX_NFLITS(sizeof(*oreq) / 8)); + OPCODE_TID(oreq) = htonl(MK_OPCODE_TID(CPL_PASS_OPEN_REQ, id)); + oreq->local_port = htons(f->dport); + oreq->peer_port = htons(f->sport); + oreq->local_ip = htonl(f->dip); + oreq->peer_ip = htonl(f->sip); + oreq->peer_netmask = htonl(f->sip_mask); + oreq->opt0h = 0; + oreq->opt0l = htonl(F_NO_OFFLOAD); + oreq->opt1 = htonl(V_MAC_MATCH_VALID(f->mac_vld) | + V_CONN_POLICY(CPL_CONN_POLICY_FILTER) | + V_VLAN_PRI(f->vlan_prio >> 1) | + V_VLAN_PRI_VALID(f->vlan_prio != FILTER_NO_VLAN_PRI) | + V_PKT_TYPE(f->pkt_type) | V_OPT1_VLAN(f->vlan) | + V_MAC_MATCH(f->mac_idx | (f->mac_hit << 4))); + + sreq = (struct cpl_set_tcb_field *)(oreq + 1); + set_tcb_field_ulp(sreq, id, 1, 0x1800808000ULL, + (f->report_filter_id << 15) | (1 << 23) | + ((u64)f->pass << 35) | ((u64)!f->rss << 36)); + set_tcb_field_ulp(sreq + 1, id, 0, 0xffffffff, (2 << 19) | 1); + t3_mgmt_tx(sc, m); + + if (f->pass && !f->rss) { + len = sizeof(*sreq); + m = m_gethdr(M_WAITOK, MT_DATA); + m->m_len = m->m_pkthdr.len = len; + bzero(mtod(m, char *), len); + sreq = mtod(m, struct cpl_set_tcb_field *); + sreq->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); + mk_set_tcb_field(sreq, id, 25, 0x3f80000, + (u64)sc->rrss_map[f->qset] << 19); + t3_mgmt_tx(sc, m); + } + return 0; +} + +static inline void +mk_set_tcb_field(struct cpl_set_tcb_field *req, unsigned int tid, + unsigned int word, u64 mask, u64 val) +{ + OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, tid)); + req->reply = V_NO_REPLY(1); + req->cpu_idx = 0; + req->word = htons(word); + req->mask = htobe64(mask); + req->val = htobe64(val); +} + +static inline void +set_tcb_field_ulp(struct cpl_set_tcb_field *req, unsigned int tid, + unsigned int word, u64 mask, u64 val) +{ + struct ulp_txpkt *txpkt = (struct ulp_txpkt *)req; + + txpkt->cmd_dest = htonl(V_ULPTX_CMD(ULP_TXPKT)); + txpkt->len = htonl(V_ULPTX_NFLITS(sizeof(*req) / 8)); + mk_set_tcb_field(req, tid, word, mask, val); +} From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 02:46:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA1F7106566C; Fri, 27 Aug 2010 02:46:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97EC68FC0C; Fri, 27 Aug 2010 02:46:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7R2kLFQ060891; Fri, 27 Aug 2010 02:46:21 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7R2kLlS060883; Fri, 27 Aug 2010 02:46:21 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201008270246.o7R2kLlS060883@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 27 Aug 2010 02:46:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211858 - in stable/7/sys/dev/cxgb: . common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 02:46:21 -0000 Author: np Date: Fri Aug 27 02:46:21 2010 New Revision: 211858 URL: http://svn.freebsd.org/changeset/base/211858 Log: MFC r209839-209841, r211345-211347 r209839 Fix bufsize calculation so that cxgbtool can display information for the last I/O queue too. r209840 Eliminate ext_intr_task. The "slow" interrupt handler is already running on the adapter's task queue. Just do what the task does instead of enqueueing it. r209841 Improved link detection. r211345 wakeup is required if the adapter lock is released anywhere during init and not just for the may_sleep case. r211346 Always reset the XGMAC's XAUI PCS on a link up. r211347 Fix tx pause quanta and timer calculations. Modified: stable/7/sys/dev/cxgb/common/cxgb_ael1002.c stable/7/sys/dev/cxgb/common/cxgb_common.h stable/7/sys/dev/cxgb/common/cxgb_t3_hw.c stable/7/sys/dev/cxgb/common/cxgb_xgmac.c stable/7/sys/dev/cxgb/cxgb_adapter.h stable/7/sys/dev/cxgb/cxgb_main.c stable/7/sys/dev/cxgb/cxgb_sge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/cxgb/common/cxgb_ael1002.c ============================================================================== --- stable/7/sys/dev/cxgb/common/cxgb_ael1002.c Fri Aug 27 02:29:16 2010 (r211857) +++ stable/7/sys/dev/cxgb/common/cxgb_ael1002.c Fri Aug 27 02:46:21 2010 (r211858) @@ -301,6 +301,9 @@ static int get_link_status_r(struct cphy if (err) return err; *link_ok = (stat0 & stat1 & (stat2 >> 12)) & 1; + + if (*link_ok == 0) + return (0); } if (speed) *speed = SPEED_10000; @@ -1951,8 +1954,6 @@ static int ael2020_intr_enable(struct cp if (err) return err; - phy->caps |= POLL_LINK_1ST_TIME; - /* enable standard Link Alarm Status Interrupts */ err = t3_phy_lasi_intr_enable(phy); if (err) Modified: stable/7/sys/dev/cxgb/common/cxgb_common.h ============================================================================== --- stable/7/sys/dev/cxgb/common/cxgb_common.h Fri Aug 27 02:29:16 2010 (r211857) +++ stable/7/sys/dev/cxgb/common/cxgb_common.h Fri Aug 27 02:46:21 2010 (r211858) @@ -64,7 +64,6 @@ enum { /* skip 25 */ SUPPORTED_MISC_IRQ = 1 << 26, SUPPORTED_IRQ = (SUPPORTED_LINK_IRQ | SUPPORTED_MISC_IRQ), - POLL_LINK_1ST_TIME = 1 << 27 }; enum { /* adapter interrupt-maintained statistics */ @@ -714,7 +713,6 @@ void t3_port_intr_enable(adapter_t *adap void t3_port_intr_disable(adapter_t *adapter, int idx); void t3_port_intr_clear(adapter_t *adapter, int idx); int t3_slow_intr_handler(adapter_t *adapter); -int t3_phy_intr_handler(adapter_t *adapter); void t3_link_changed(adapter_t *adapter, int port_id); int t3_link_start(struct cphy *phy, struct cmac *mac, struct link_config *lc); @@ -760,6 +758,7 @@ int t3_mc7_bd_read(struct mc7 *mc7, unsi int t3_mac_init(struct cmac *mac); void t3b_pcs_reset(struct cmac *mac); +void t3c_pcs_force_los(struct cmac *mac); void t3_mac_disable_exact_filters(struct cmac *mac); void t3_mac_enable_exact_filters(struct cmac *mac); int t3_mac_enable(struct cmac *mac, int which); Modified: stable/7/sys/dev/cxgb/common/cxgb_t3_hw.c ============================================================================== --- stable/7/sys/dev/cxgb/common/cxgb_t3_hw.c Fri Aug 27 02:29:16 2010 (r211857) +++ stable/7/sys/dev/cxgb/common/cxgb_t3_hw.c Fri Aug 27 02:46:21 2010 (r211858) @@ -1533,6 +1533,9 @@ void t3_link_changed(adapter_t *adapter, phy->ops->get_link_status(phy, &link_ok, &speed, &duplex, &fc); + if (link_ok == 0) + pi->link_fault = LF_NO; + if (lc->requested_fc & PAUSE_AUTONEG) fc &= lc->requested_fc; else @@ -1558,6 +1561,13 @@ void t3_link_changed(adapter_t *adapter, pi->link_fault = LF_YES; } + if (uses_xaui(adapter)) { + if (adapter->params.rev >= T3_REV_C) + t3c_pcs_force_los(mac); + else + t3b_pcs_reset(mac); + } + /* Don't report link up */ link_ok = 0; } else { @@ -1584,12 +1594,20 @@ void t3_link_changed(adapter_t *adapter, /* down -> up, or up -> up with changed settings */ if (adapter->params.rev > 0 && uses_xaui(adapter)) { + + if (adapter->params.rev >= T3_REV_C) + t3c_pcs_force_los(mac); + else + t3b_pcs_reset(mac); + t3_write_reg(adapter, A_XGM_XAUI_ACT_CTRL + mac->offset, F_TXACTENABLE | F_RXEN); } + /* disable TX FIFO drain */ t3_set_reg_field(adapter, A_XGM_TXFIFO_CFG + mac->offset, F_ENDROPPKT, 0); + t3_mac_enable(mac, MAC_DIRECTION_TX | MAC_DIRECTION_RX); t3_set_reg_field(adapter, A_XGM_STAT_CTRL + mac->offset, F_CLRSTATS, 1); @@ -1609,24 +1627,21 @@ void t3_link_changed(adapter_t *adapter, t3_set_reg_field(adapter, A_XGM_INT_ENABLE + mac->offset, F_XGM_INT, 0); - } - if (!link_fault) { - if (is_10G(adapter)) - pi->phy.ops->power_down(&pi->phy, 1); t3_mac_disable(mac, MAC_DIRECTION_RX); - t3_link_start(phy, mac, lc); - } - /* - * Make sure Tx FIFO continues to drain, even as rxen is left - * high to help detect and indicate remote faults. - */ - t3_set_reg_field(adapter, A_XGM_TXFIFO_CFG + mac->offset, 0, - F_ENDROPPKT); - t3_write_reg(adapter, A_XGM_RX_CTRL + mac->offset, 0); - t3_write_reg(adapter, A_XGM_TX_CTRL + mac->offset, F_TXEN); - t3_write_reg(adapter, A_XGM_RX_CTRL + mac->offset, F_RXEN); + /* + * Make sure Tx FIFO continues to drain, even as rxen is + * left high to help detect and indicate remote faults. + */ + t3_set_reg_field(adapter, + A_XGM_TXFIFO_CFG + mac->offset, 0, F_ENDROPPKT); + t3_write_reg(adapter, A_XGM_RX_CTRL + mac->offset, 0); + t3_write_reg(adapter, + A_XGM_TX_CTRL + mac->offset, F_TXEN); + t3_write_reg(adapter, + A_XGM_RX_CTRL + mac->offset, F_RXEN); + } } t3_os_link_changed(adapter, port_id, link_ok, speed, duplex, fc, @@ -2165,13 +2180,14 @@ static int mac_intr_handler(adapter_t *a mac->stats.xaui_pcs_ctc_err++; if (cause & F_XAUIPCSALIGNCHANGE) mac->stats.xaui_pcs_align_change++; - if (cause & F_XGM_INT) { - t3_set_reg_field(adap, - A_XGM_INT_ENABLE + mac->offset, - F_XGM_INT, 0); + if (cause & F_XGM_INT & + t3_read_reg(adap, A_XGM_INT_ENABLE + mac->offset)) { + t3_set_reg_field(adap, A_XGM_INT_ENABLE + mac->offset, + F_XGM_INT, 0); /* link fault suspected */ pi->link_fault = LF_MAYBE; + t3_os_link_intr(pi); } t3_write_reg(adap, A_XGM_INT_CAUSE + mac->offset, cause); @@ -2185,7 +2201,7 @@ static int mac_intr_handler(adapter_t *a /* * Interrupt handler for PHY events. */ -int t3_phy_intr_handler(adapter_t *adapter) +static int phy_intr_handler(adapter_t *adapter) { u32 i, cause = t3_read_reg(adapter, A_T3DBG_INT_CAUSE); @@ -2199,7 +2215,7 @@ int t3_phy_intr_handler(adapter_t *adapt int phy_cause = p->phy.ops->intr_handler(&p->phy); if (phy_cause & cphy_cause_link_change) - t3_link_changed(adapter, i); + t3_os_link_intr(p); if (phy_cause & cphy_cause_fifo_error) p->phy.fifo_errors++; if (phy_cause & cphy_cause_module_change) @@ -2267,7 +2283,7 @@ int t3_slow_intr_handler(adapter_t *adap if (cause & F_XGMAC0_1) mac_intr_handler(adapter, 1); if (cause & F_T3DBG) - t3_os_ext_intr_handler(adapter); + phy_intr_handler(adapter); /* Clear the interrupts just processed. */ t3_write_reg(adapter, A_PL_INT_CAUSE0, cause); Modified: stable/7/sys/dev/cxgb/common/cxgb_xgmac.c ============================================================================== --- stable/7/sys/dev/cxgb/common/cxgb_xgmac.c Fri Aug 27 02:29:16 2010 (r211857) +++ stable/7/sys/dev/cxgb/common/cxgb_xgmac.c Fri Aug 27 02:46:21 2010 (r211858) @@ -101,11 +101,40 @@ void t3b_pcs_reset(struct cmac *mac) { t3_set_reg_field(mac->adapter, A_XGM_RESET_CTRL + mac->offset, F_PCS_RESET_, 0); - udelay(20); + + /* No delay required */ + t3_set_reg_field(mac->adapter, A_XGM_RESET_CTRL + mac->offset, 0, F_PCS_RESET_); } +void t3c_pcs_force_los(struct cmac *mac) +{ + t3_set_reg_field(mac->adapter, A_XGM_SERDES_STAT0 + mac->offset, + F_LOWSIGFORCEEN0 | F_LOWSIGFORCEVALUE0, + F_LOWSIGFORCEEN0 | F_LOWSIGFORCEVALUE0); + t3_set_reg_field(mac->adapter, A_XGM_SERDES_STAT1 + mac->offset, + F_LOWSIGFORCEEN1 | F_LOWSIGFORCEVALUE1, + F_LOWSIGFORCEEN1 | F_LOWSIGFORCEVALUE1); + t3_set_reg_field(mac->adapter, A_XGM_SERDES_STAT2 + mac->offset, + F_LOWSIGFORCEEN2 | F_LOWSIGFORCEVALUE2, + F_LOWSIGFORCEEN2 | F_LOWSIGFORCEVALUE2); + t3_set_reg_field(mac->adapter, A_XGM_SERDES_STAT3 + mac->offset, + F_LOWSIGFORCEEN3 | F_LOWSIGFORCEVALUE3, + F_LOWSIGFORCEEN3 | F_LOWSIGFORCEVALUE3); + + /* No delay required */ + + t3_set_reg_field(mac->adapter, A_XGM_SERDES_STAT0 + mac->offset, + F_LOWSIGFORCEEN0, 0); + t3_set_reg_field(mac->adapter, A_XGM_SERDES_STAT1 + mac->offset, + F_LOWSIGFORCEEN1, 0); + t3_set_reg_field(mac->adapter, A_XGM_SERDES_STAT2 + mac->offset, + F_LOWSIGFORCEEN2, 0); + t3_set_reg_field(mac->adapter, A_XGM_SERDES_STAT3 + mac->offset, + F_LOWSIGFORCEEN3, 0); +} + /** * t3_mac_init - initialize a MAC * @mac: the MAC to initialize @@ -437,7 +466,7 @@ static int rx_fifo_hwm(int mtu) */ int t3_mac_set_mtu(struct cmac *mac, unsigned int mtu) { - int hwm, lwm, divisor; + int hwm, lwm; int ipg; unsigned int thres, v, reg; adapter_t *adap = mac->adapter; @@ -516,16 +545,6 @@ int t3_mac_set_mtu(struct cmac *mac, uns t3_set_reg_field(adap, A_XGM_TXFIFO_CFG + mac->offset, V_TXFIFOTHRESH(M_TXFIFOTHRESH) | V_TXIPG(M_TXIPG), V_TXFIFOTHRESH(thres) | V_TXIPG(ipg)); - - /* Assuming a minimum drain rate of 2.5Gbps... - */ - if (adap->params.rev > 0) { - divisor = (adap->params.rev == T3_REV_C) ? 64 : 8; - t3_write_reg(adap, A_XGM_PAUSE_TIMER + mac->offset, - (hwm - lwm) * 4 / divisor); - } - t3_write_reg(adap, A_XGM_TX_PAUSE_QUANTA + mac->offset, - MAC_RXFIFO_SIZE * 4 * 8 / 512); return 0; } @@ -545,9 +564,17 @@ int t3_mac_set_speed_duplex_fc(struct cm u32 val; adapter_t *adap = mac->adapter; unsigned int oft = mac->offset; + unsigned int pause_bits; if (duplex >= 0 && duplex != DUPLEX_FULL) return -EINVAL; + + pause_bits = MAC_RXFIFO_SIZE * 4 * 8; + t3_write_reg(adap, A_XGM_TX_PAUSE_QUANTA + mac->offset, + pause_bits / 512); + t3_write_reg(adap, A_XGM_PAUSE_TIMER + mac->offset, + (pause_bits >> (adap->params.rev == T3_REV_C ? 10 : 7))); + if (mac->multiport) { u32 rx_max_pkt_size = G_RXMAXPKTSIZE(t3_read_reg(adap, @@ -556,9 +583,9 @@ int t3_mac_set_speed_duplex_fc(struct cm val &= ~V_RXFIFOPAUSEHWM(M_RXFIFOPAUSEHWM); val |= V_RXFIFOPAUSEHWM(rx_fifo_hwm(rx_max_pkt_size) / 8); t3_write_reg(adap, A_XGM_RXFIFO_CFG + oft, val); - t3_set_reg_field(adap, A_XGM_TX_CFG + oft, F_TXPAUSEEN, F_TXPAUSEEN); + return t3_vsc7323_set_speed_fc(adap, speed, fc, mac->ext_port); } if (speed >= 0) { Modified: stable/7/sys/dev/cxgb/cxgb_adapter.h ============================================================================== --- stable/7/sys/dev/cxgb/cxgb_adapter.h Fri Aug 27 02:29:16 2010 (r211857) +++ stable/7/sys/dev/cxgb/cxgb_adapter.h Fri Aug 27 02:46:21 2010 (r211858) @@ -116,6 +116,8 @@ struct port_info { int link_fault; uint8_t hw_addr[ETHER_ADDR_LEN]; + struct callout link_check_ch; + struct task link_check_task; struct task timer_reclaim_task; struct cdev *port_cdev; @@ -363,7 +365,6 @@ struct adapter { struct filter_info *filters; /* Tasks */ - struct task ext_intr_task; struct task slow_intr_task; struct task tick_task; struct taskqueue *tq; @@ -508,12 +509,12 @@ adap2pinfo(struct adapter *adap, int idx int t3_os_find_pci_capability(adapter_t *adapter, int cap); int t3_os_pci_save_state(struct adapter *adapter); int t3_os_pci_restore_state(struct adapter *adapter); +void t3_os_link_intr(struct port_info *); void t3_os_link_changed(adapter_t *adapter, int port_id, int link_status, int speed, int duplex, int fc, int mac_was_reset); void t3_os_phymod_changed(struct adapter *adap, int port_id); void t3_sge_err_intr_handler(adapter_t *adapter); int t3_offload_tx(struct t3cdev *, struct mbuf *); -void t3_os_ext_intr_handler(adapter_t *adapter); void t3_os_set_hw_addr(adapter_t *adapter, int port_idx, u8 hw_addr[]); int t3_mgmt_tx(adapter_t *adap, struct mbuf *m); @@ -545,10 +546,6 @@ int t3_get_desc(const struct sge_qset *q unsigned char *data); void t3_update_qset_coalesce(struct sge_qset *qs, const struct qset_params *p); -#define CXGB_TICKS(a) ((a)->params.linkpoll_period ? \ - (hz * (a)->params.linkpoll_period) / 10 : \ - (a)->params.stats_update_period * hz) - /* * XXX figure out how we can return this to being private to sge */ Modified: stable/7/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/7/sys/dev/cxgb/cxgb_main.c Fri Aug 27 02:29:16 2010 (r211857) +++ stable/7/sys/dev/cxgb/cxgb_main.c Fri Aug 27 02:46:21 2010 (r211858) @@ -99,9 +99,10 @@ static void cxgb_build_medialist(struct static void cxgb_media_status(struct ifnet *, struct ifmediareq *); static int setup_sge_qsets(adapter_t *); static void cxgb_async_intr(void *); -static void cxgb_ext_intr_handler(void *, int); static void cxgb_tick_handler(void *, int); static void cxgb_tick(void *); +static void link_check_callout(void *); +static void check_link_status(void *, int); static void setup_rss(adapter_t *sc); static int alloc_filters(struct adapter *); static int setup_hw_filters(struct adapter *); @@ -608,7 +609,6 @@ cxgb_controller_attach(device_t dev) taskqueue_start_threads(&sc->tq, 1, PI_NET, "%s taskq", device_get_nameunit(dev)); - TASK_INIT(&sc->ext_intr_task, 0, cxgb_ext_intr_handler, sc); TASK_INIT(&sc->tick_task, 0, cxgb_tick_handler, sc); @@ -692,7 +692,7 @@ cxgb_controller_attach(device_t dev) sc->params.vpd.port_type[2], sc->params.vpd.port_type[3]); device_printf(sc->dev, "Firmware Version %s\n", &sc->fw_version[0]); - callout_reset(&sc->cxgb_tick_ch, CXGB_TICKS(sc), cxgb_tick, sc); + callout_reset(&sc->cxgb_tick_ch, hz, cxgb_tick, sc); t3_add_attach_sysctls(sc); out: if (error) @@ -1051,6 +1051,9 @@ cxgb_port_attach(device_t dev) device_get_unit(device_get_parent(dev)), p->port_id); PORT_LOCK_INIT(p, p->lockbuf); + callout_init(&p->link_check_ch, CALLOUT_MPSAFE); + TASK_INIT(&p->link_check_task, 0, check_link_status, p); + /* Allocate an ifnet object and set it up */ ifp = p->ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { @@ -1307,29 +1310,6 @@ void t3_os_phymod_changed(struct adapter } } -/* - * Interrupt-context handler for external (PHY) interrupts. - */ -void -t3_os_ext_intr_handler(adapter_t *sc) -{ - if (cxgb_debug) - printf("t3_os_ext_intr_handler\n"); - /* - * Schedule a task to handle external interrupts as they may be slow - * and we use a mutex to protect MDIO registers. We disable PHY - * interrupts in the meantime and let the task reenable them when - * it's done. - */ - if (sc->slow_intr_mask) { - ADAPTER_LOCK(sc); - sc->slow_intr_mask &= ~F_T3DBG; - t3_write_reg(sc, A_PL_INT_ENABLE0, sc->slow_intr_mask); - taskqueue_enqueue(sc->tq, &sc->ext_intr_task); - ADAPTER_UNLOCK(sc); - } -} - void t3_os_set_hw_addr(adapter_t *adapter, int port_idx, u8 hw_addr[]) { @@ -1850,11 +1830,12 @@ cxgb_init_locked(struct port_info *p) struct adapter *sc = p->adapter; struct ifnet *ifp = p->ifp; struct cmac *mac = &p->mac; - int rc = 0, may_sleep = 0; + int rc = 0, may_sleep = 0, gave_up_lock = 0; ADAPTER_LOCK_ASSERT_OWNED(sc); while (!IS_DOOMED(p) && IS_BUSY(sc)) { + gave_up_lock = 1; if (mtx_sleep(&sc->flags, &sc->lock, PCATCH, "cxgbinit", 0)) { rc = EINTR; goto done; @@ -1874,6 +1855,7 @@ cxgb_init_locked(struct port_info *p) if (may_sleep) { SET_BUSY(sc); + gave_up_lock = 1; ADAPTER_UNLOCK(sc); } @@ -1902,18 +1884,20 @@ cxgb_init_locked(struct port_info *p) ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; PORT_UNLOCK(p); - t3_link_changed(sc, p->port_id); - /* all ok */ setbit(&sc->open_device_map, p->port_id); + callout_reset(&p->link_check_ch, + p->phy.caps & SUPPORTED_LINK_IRQ ? hz * 3 : hz / 4, + link_check_callout, p); done: if (may_sleep) { ADAPTER_LOCK(sc); KASSERT(IS_BUSY(sc), ("%s: controller not busy.", __func__)); CLR_BUSY(sc); - wakeup_one(&sc->flags); } + if (gave_up_lock) + wakeup_one(&sc->flags); ADAPTER_UNLOCK(sc); return (rc); } @@ -1979,9 +1963,11 @@ cxgb_uninit_synchronized(struct port_inf clrbit(&sc->open_device_map, pi->port_id); t3_port_intr_disable(sc, pi->port_id); taskqueue_drain(sc->tq, &sc->slow_intr_task); - taskqueue_drain(sc->tq, &sc->ext_intr_task); taskqueue_drain(sc->tq, &sc->tick_task); + callout_drain(&pi->link_check_ch); + taskqueue_drain(sc->tq, &pi->link_check_task); + PORT_LOCK(pi); ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); @@ -2337,61 +2323,47 @@ cxgb_async_intr(void *data) { adapter_t *sc = data; - if (cxgb_debug) - device_printf(sc->dev, "cxgb_async_intr\n"); - /* - * May need to sleep - defer to taskqueue - */ + t3_write_reg(sc, A_PL_INT_ENABLE0, 0); + (void) t3_read_reg(sc, A_PL_INT_ENABLE0); taskqueue_enqueue(sc->tq, &sc->slow_intr_task); } static void -cxgb_ext_intr_handler(void *arg, int count) +link_check_callout(void *arg) { - adapter_t *sc = (adapter_t *)arg; - - if (cxgb_debug) - printf("cxgb_ext_intr_handler\n"); + struct port_info *pi = arg; + struct adapter *sc = pi->adapter; - t3_phy_intr_handler(sc); + if (!isset(&sc->open_device_map, pi->port_id)) + return; - /* Now reenable external interrupts */ - ADAPTER_LOCK(sc); - if (sc->slow_intr_mask) { - sc->slow_intr_mask |= F_T3DBG; - t3_write_reg(sc, A_PL_INT_CAUSE0, F_T3DBG); - t3_write_reg(sc, A_PL_INT_ENABLE0, sc->slow_intr_mask); - } - ADAPTER_UNLOCK(sc); + taskqueue_enqueue(sc->tq, &pi->link_check_task); } -static inline int -link_poll_needed(struct port_info *p) +static void +check_link_status(void *arg, int pending) { - struct cphy *phy = &p->phy; + struct port_info *pi = arg; + struct adapter *sc = pi->adapter; - if (phy->caps & POLL_LINK_1ST_TIME) { - p->phy.caps &= ~POLL_LINK_1ST_TIME; - return (1); - } + if (!isset(&sc->open_device_map, pi->port_id)) + return; + + t3_link_changed(sc, pi->port_id); - return (p->link_fault || !(phy->caps & SUPPORTED_LINK_IRQ)); + if (pi->link_fault || !(pi->phy.caps & SUPPORTED_LINK_IRQ)) + callout_reset(&pi->link_check_ch, hz, link_check_callout, pi); } -static void -check_link_status(adapter_t *sc) +void +t3_os_link_intr(struct port_info *pi) { - int i; - - for (i = 0; i < (sc)->params.nports; ++i) { - struct port_info *p = &sc->port[i]; - - if (!isset(&sc->open_device_map, p->port_id)) - continue; - - if (link_poll_needed(p)) - t3_link_changed(sc, i); - } + /* + * Schedule a link check in the near future. If the link is flapping + * rapidly we'll keep resetting the callout and delaying the check until + * things stabilize a bit. + */ + callout_reset(&pi->link_check_ch, hz / 4, link_check_callout, pi); } static void @@ -2443,7 +2415,7 @@ cxgb_tick(void *arg) return; taskqueue_enqueue(sc->tq, &sc->tick_task); - callout_reset(&sc->cxgb_tick_ch, CXGB_TICKS(sc), cxgb_tick, sc); + callout_reset(&sc->cxgb_tick_ch, hz, cxgb_tick, sc); } static void @@ -2457,8 +2429,6 @@ cxgb_tick_handler(void *arg, int count) if (sc->flags & CXGB_SHUTDOWN || !(sc->flags & FULL_INIT_DONE)) return; - check_link_status(sc); - if (p->rev == T3_REV_B2 && p->nports < 4 && sc->open_device_map) check_t3b2_mac(sc); @@ -3141,7 +3111,6 @@ cxgb_extension_ioctl(struct cdev *dev, u if (!error) { v = (uint32_t *)buf; - ioqs->bufsize -= 4 * sizeof(uint32_t); ioqs->ioq_rx_enable = *v++; ioqs->ioq_tx_enable = *v++; ioqs->ioq_rx_status = *v++; Modified: stable/7/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- stable/7/sys/dev/cxgb/cxgb_sge.c Fri Aug 27 02:29:16 2010 (r211857) +++ stable/7/sys/dev/cxgb/cxgb_sge.c Fri Aug 27 02:46:21 2010 (r211858) @@ -731,6 +731,8 @@ sge_slow_intr_handler(void *arg, int nco adapter_t *sc = arg; t3_slow_intr_handler(sc); + t3_write_reg(sc, A_PL_INT_ENABLE0, sc->slow_intr_mask); + (void) t3_read_reg(sc, A_PL_INT_ENABLE0); } /** @@ -3009,8 +3011,11 @@ t3b_intr(void *data) if (!map) return; - if (__predict_false(map & F_ERRINTR)) + if (__predict_false(map & F_ERRINTR)) { + t3_write_reg(adap, A_PL_INT_ENABLE0, 0); + (void) t3_read_reg(adap, A_PL_INT_ENABLE0); taskqueue_enqueue(adap->tq, &adap->slow_intr_task); + } mtx_lock(&q0->lock); for_each_port(adap, i) @@ -3038,8 +3043,11 @@ t3_intr_msi(void *data) if (process_responses_gts(adap, &adap->sge.qs[i].rspq)) new_packets = 1; mtx_unlock(&q0->lock); - if (new_packets == 0) + if (new_packets == 0) { + t3_write_reg(adap, A_PL_INT_ENABLE0, 0); + (void) t3_read_reg(adap, A_PL_INT_ENABLE0); taskqueue_enqueue(adap->tq, &adap->slow_intr_task); + } } void From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 03:23:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 958821065674; Fri, 27 Aug 2010 03:23:07 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 855638FC27; Fri, 27 Aug 2010 03:23:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7R3N72E062040; Fri, 27 Aug 2010 03:23:07 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7R3N7EP062038; Fri, 27 Aug 2010 03:23:07 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201008270323.o7R3N7EP062038@svn.freebsd.org> From: David Xu Date: Fri, 27 Aug 2010 03:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211859 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 03:23:07 -0000 Author: davidxu Date: Fri Aug 27 03:23:07 2010 New Revision: 211859 URL: http://svn.freebsd.org/changeset/base/211859 Log: clear lock to zero state if it is destroyed. Modified: head/lib/libthr/thread/thr_rtld.c Modified: head/lib/libthr/thread/thr_rtld.c ============================================================================== --- head/lib/libthr/thread/thr_rtld.c Fri Aug 27 02:46:21 2010 (r211858) +++ head/lib/libthr/thread/thr_rtld.c Fri Aug 27 03:23:07 2010 (r211859) @@ -81,8 +81,11 @@ static void _thr_rtld_lock_destroy(void *lock) { int locki; + size_t i; locki = (struct rtld_lock *)lock - &lock_place[0]; + for (i = 0; i < sizeof(struct rtld_lock); ++i) + ((char *)lock)[i] = 0; busy_places &= ~(1 << locki); } From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 05:20:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 440ED1065697; Fri, 27 Aug 2010 05:20:23 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18FB68FC24; Fri, 27 Aug 2010 05:20:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7R5KMLd064573; Fri, 27 Aug 2010 05:20:22 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7R5KMCG064569; Fri, 27 Aug 2010 05:20:22 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201008270520.o7R5KMCG064569@svn.freebsd.org> From: David Xu Date: Fri, 27 Aug 2010 05:20:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211860 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 05:20:23 -0000 Author: davidxu Date: Fri Aug 27 05:20:22 2010 New Revision: 211860 URL: http://svn.freebsd.org/changeset/base/211860 Log: Unregister thread specific data destructor when a corresponding dso is unloaded. Modified: head/lib/libthr/thread/thr_fork.c head/lib/libthr/thread/thr_private.h head/lib/libthr/thread/thr_spec.c Modified: head/lib/libthr/thread/thr_fork.c ============================================================================== --- head/lib/libthr/thread/thr_fork.c Fri Aug 27 03:23:07 2010 (r211859) +++ head/lib/libthr/thread/thr_fork.c Fri Aug 27 05:20:22 2010 (r211860) @@ -114,6 +114,7 @@ __pthread_cxa_finalize(struct dl_phdr_in } } THR_UMUTEX_UNLOCK(curthread, &_thr_atfork_lock); + _thr_tsd_unload(phdr_info); } __weak_reference(_fork, fork); Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Fri Aug 27 03:23:07 2010 (r211859) +++ head/lib/libthr/thread/thr_private.h Fri Aug 27 05:20:22 2010 (r211860) @@ -739,6 +739,7 @@ _thr_check_init(void) struct dl_phdr_info; void __pthread_cxa_finalize(struct dl_phdr_info *phdr_info); +void _thr_tsd_unload(struct dl_phdr_info *phdr_info) __hidden; __END_DECLS Modified: head/lib/libthr/thread/thr_spec.c ============================================================================== --- head/lib/libthr/thread/thr_spec.c Fri Aug 27 03:23:07 2010 (r211859) +++ head/lib/libthr/thread/thr_spec.c Fri Aug 27 05:20:22 2010 (r211860) @@ -36,6 +36,7 @@ #include #include #include "un-namespace.h" +#include "libc_private.h" #include "thr_private.h" @@ -235,3 +236,23 @@ _pthread_getspecific(pthread_key_t key) data = NULL; return (__DECONST(void *, data)); } + +void +_thr_tsd_unload(struct dl_phdr_info *phdr_info) +{ + struct pthread *curthread = _get_curthread(); + void (*destructor)(void *); + int key; + + THR_LOCK_ACQUIRE(curthread, &_keytable_lock); + for (key = 0; key < PTHREAD_KEYS_MAX; key++) { + if (_thread_keytable[key].allocated) { + destructor = _thread_keytable[key].destructor; + if (destructor != NULL) { + if (__elf_phdr_match_addr(phdr_info, destructor)) + _thread_keytable[key].destructor = NULL; + } + } + } + THR_LOCK_RELEASE(curthread, &_keytable_lock); +} From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 05:29:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D568E1065679; Fri, 27 Aug 2010 05:29:59 +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 C4BC28FC16; Fri, 27 Aug 2010 05:29:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7R5TxFv064800; Fri, 27 Aug 2010 05:29:59 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7R5TxD9064798; Fri, 27 Aug 2010 05:29:59 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201008270529.o7R5TxD9064798@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 27 Aug 2010 05:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211861 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 05:29:59 -0000 Author: nwhitehorn Date: Fri Aug 27 05:29:59 2010 New Revision: 211861 URL: http://svn.freebsd.org/changeset/base/211861 Log: pmap_mapdev() does not appear to actually need GIANT to be held here, and asserting that is held breaks drm. MFC after: 2 weeks Modified: head/sys/powerpc/aim/mmu_oea.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Fri Aug 27 05:20:22 2010 (r211860) +++ head/sys/powerpc/aim/mmu_oea.c Fri Aug 27 05:29:59 2010 (r211861) @@ -2436,8 +2436,6 @@ moea_mapdev(mmu_t mmu, vm_offset_t pa, v offset = pa & PAGE_MASK; size = roundup(offset + size, PAGE_SIZE); - GIANT_REQUIRED; - /* * If the physical address lies within a valid BAT table entry, * return the 1:1 mapping. This currently doesn't work From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 07:45:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D95551065695; Fri, 27 Aug 2010 07:45:50 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7FC98FC12; Fri, 27 Aug 2010 07:45:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7R7jo4P067807; Fri, 27 Aug 2010 07:45:50 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7R7jo3Q067800; Fri, 27 Aug 2010 07:45:50 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201008270745.o7R7jo3Q067800@svn.freebsd.org> From: "Jayachandran C." Date: Fri, 27 Aug 2010 07:45:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211862 - head/sys/mips/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 07:45:50 -0000 Author: jchandra Date: Fri Aug 27 07:45:50 2010 New Revision: 211862 URL: http://svn.freebsd.org/changeset/base/211862 Log: Whitespace fixes in mips/include, remove unused 'struct tlb' from locore.h PR: misc/147471 Modified: head/sys/mips/include/atomic.h head/sys/mips/include/locore.h head/sys/mips/include/memdev.h head/sys/mips/include/pcb.h head/sys/mips/include/regnum.h head/sys/mips/include/ucontext.h Modified: head/sys/mips/include/atomic.h ============================================================================== --- head/sys/mips/include/atomic.h Fri Aug 27 05:29:59 2010 (r211861) +++ head/sys/mips/include/atomic.h Fri Aug 27 07:45:50 2010 (r211862) @@ -48,7 +48,7 @@ static __inline void mips_sync(void) { - __asm __volatile (".set noreorder\n\t" + __asm __volatile (".set noreorder\n\t" "sync\n\t" "nop\n\t" "nop\n\t" Modified: head/sys/mips/include/locore.h ============================================================================== --- head/sys/mips/include/locore.h Fri Aug 27 05:29:59 2010 (r211861) +++ head/sys/mips/include/locore.h Fri Aug 27 07:45:50 2010 (r211862) @@ -24,15 +24,13 @@ */ #ifndef _MIPS_LOCORE_H -#define _MIPS_LOCORE_H +#define _MIPS_LOCORE_H #include #include #include #include -struct tlb; - /* * CPU identification, from PRID register. */ @@ -47,22 +45,22 @@ typedef int mips_prid_t; #define MIPS_PRID_REV_MAJ(x) ((MIPS_PRID_REV(x) >> 4) & 0x0f) /* MIPS32/64 */ -#define MIPS_PRID_CID(x) (((x) >> 16) & 0x00ff) /* Company ID */ -#define MIPS_PRID_CID_PREHISTORIC 0x00 /* Not MIPS32/64 */ -#define MIPS_PRID_CID_MTI 0x01 /* MIPS Technologies, Inc. */ -#define MIPS_PRID_CID_BROADCOM 0x02 /* Broadcom */ -#define MIPS_PRID_CID_ALCHEMY 0x03 /* Alchemy Semiconductor */ -#define MIPS_PRID_CID_SIBYTE 0x04 /* SiByte */ -#define MIPS_PRID_CID_SANDCRAFT 0x05 /* SandCraft */ -#define MIPS_PRID_CID_PHILIPS 0x06 /* Philips */ -#define MIPS_PRID_CID_TOSHIBA 0x07 /* Toshiba */ -#define MIPS_PRID_CID_LSI 0x08 /* LSI */ +#define MIPS_PRID_CID(x) (((x) >> 16) & 0x00ff) /* Company ID */ +#define MIPS_PRID_CID_PREHISTORIC 0x00 /* Not MIPS32/64 */ +#define MIPS_PRID_CID_MTI 0x01 /* MIPS Technologies, Inc. */ +#define MIPS_PRID_CID_BROADCOM 0x02 /* Broadcom */ +#define MIPS_PRID_CID_ALCHEMY 0x03 /* Alchemy Semiconductor */ +#define MIPS_PRID_CID_SIBYTE 0x04 /* SiByte */ +#define MIPS_PRID_CID_SANDCRAFT 0x05 /* SandCraft */ +#define MIPS_PRID_CID_PHILIPS 0x06 /* Philips */ +#define MIPS_PRID_CID_TOSHIBA 0x07 /* Toshiba */ +#define MIPS_PRID_CID_LSI 0x08 /* LSI */ /* 0x09 unannounced */ /* 0x0a unannounced */ -#define MIPS_PRID_CID_LEXRA 0x0b /* Lexra */ -#define MIPS_PRID_CID_RMI 0x0c /* RMI */ -#define MIPS_PRID_CID_CAVIUM 0x0d /* Cavium */ -#define MIPS_PRID_COPTS(x) (((x) >> 24) & 0x00ff) /* Company Options */ +#define MIPS_PRID_CID_LEXRA 0x0b /* Lexra */ +#define MIPS_PRID_CID_RMI 0x0c /* RMI */ +#define MIPS_PRID_CID_CAVIUM 0x0d /* Cavium */ +#define MIPS_PRID_COPTS(x) (((x) >> 24) & 0x00ff) /* Company Options */ #ifdef _KERNEL #ifdef __HAVE_MIPS_MACHDEP_CACHE_CONFIG Modified: head/sys/mips/include/memdev.h ============================================================================== --- head/sys/mips/include/memdev.h Fri Aug 27 05:29:59 2010 (r211861) +++ head/sys/mips/include/memdev.h Fri Aug 27 07:45:50 2010 (r211862) @@ -28,7 +28,7 @@ */ #define CDEV_MINOR_MEM 0 -#define CDEV_MINOR_KMEM 1 +#define CDEV_MINOR_KMEM 1 d_open_t memopen; d_read_t memrw; Modified: head/sys/mips/include/pcb.h ============================================================================== --- head/sys/mips/include/pcb.h Fri Aug 27 05:29:59 2010 (r211861) +++ head/sys/mips/include/pcb.h Fri Aug 27 07:45:50 2010 (r211862) @@ -58,20 +58,20 @@ struct pcb /* these match the regnum's in regnum.h * used by switch.S */ -#define PCB_REG_S0 0 -#define PCB_REG_S1 1 -#define PCB_REG_S2 2 -#define PCB_REG_S3 3 -#define PCB_REG_S4 4 -#define PCB_REG_S5 5 -#define PCB_REG_S6 6 -#define PCB_REG_S7 7 -#define PCB_REG_SP 8 -#define PCB_REG_S8 9 -#define PCB_REG_RA 10 -#define PCB_REG_SR 11 -#define PCB_REG_GP 12 -#define PCB_REG_PC 13 +#define PCB_REG_S0 0 +#define PCB_REG_S1 1 +#define PCB_REG_S2 2 +#define PCB_REG_S3 3 +#define PCB_REG_S4 4 +#define PCB_REG_S5 5 +#define PCB_REG_S6 6 +#define PCB_REG_S7 7 +#define PCB_REG_SP 8 +#define PCB_REG_S8 9 +#define PCB_REG_RA 10 +#define PCB_REG_SR 11 +#define PCB_REG_GP 12 +#define PCB_REG_PC 13 #ifdef _KERNEL Modified: head/sys/mips/include/regnum.h ============================================================================== --- head/sys/mips/include/regnum.h Fri Aug 27 05:29:59 2010 (r211861) +++ head/sys/mips/include/regnum.h Fri Aug 27 07:45:50 2010 (r211862) @@ -46,20 +46,20 @@ * in pcb.h and is used by * swtch.S */ -#define PREG_S0 0 -#define PREG_S1 1 -#define PREG_S2 2 -#define PREG_S3 3 -#define PREG_S4 4 -#define PREG_S5 5 -#define PREG_S6 6 -#define PREG_S7 7 -#define PREG_SP 8 -#define PREG_S8 9 -#define PREG_RA 10 -#define PREG_SR 11 -#define PREG_GP 12 -#define PREG_PC 13 +#define PREG_S0 0 +#define PREG_S1 1 +#define PREG_S2 2 +#define PREG_S3 3 +#define PREG_S4 4 +#define PREG_S5 5 +#define PREG_S6 6 +#define PREG_S7 7 +#define PREG_SP 8 +#define PREG_S8 9 +#define PREG_RA 10 +#define PREG_SR 11 +#define PREG_GP 12 +#define PREG_PC 13 /* * Location of the saved registers relative to ZERO. Modified: head/sys/mips/include/ucontext.h ============================================================================== --- head/sys/mips/include/ucontext.h Fri Aug 27 05:29:59 2010 (r211861) +++ head/sys/mips/include/ucontext.h Fri Aug 27 07:45:50 2010 (r211862) @@ -48,13 +48,13 @@ typedef struct __mcontext { int mc_onstack; /* sigstack state to restore */ register_t mc_pc; /* pc at time of signal */ register_t mc_regs[32]; /* processor regs 0 to 31 */ - register_t sr; /* status register */ - register_t mullo, mulhi; /* mullo and mulhi registers... */ + register_t sr; /* status register */ + register_t mullo, mulhi; /* mullo and mulhi registers... */ int mc_fpused; /* fp has been used */ f_register_t mc_fpregs[33]; /* fp regs 0 to 31 and csr */ register_t mc_fpc_eir; /* fp exception instruction reg */ void *mc_tls; /* pointer to TLS area */ - int __spare__[8]; /* XXX reserved */ + int __spare__[8]; /* XXX reserved */ } mcontext_t; #endif @@ -101,7 +101,7 @@ typedef struct __mcontext { #define UCR_SP UCTX_REG(29) #define UCR_S8 UCTX_REG(30) #define UCR_RA UCTX_REG(31) -#define UCR_SR UCTX_REG(32) +#define UCR_SR UCTX_REG(32) #define UCR_MDLO UCTX_REG(33) #define UCR_MDHI UCTX_REG(34) From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 08:05:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98EBE1065679; Fri, 27 Aug 2010 08:05:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87A0A8FC19; Fri, 27 Aug 2010 08:05:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7R85iCb068282; Fri, 27 Aug 2010 08:05:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7R85i2w068280; Fri, 27 Aug 2010 08:05:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008270805.o7R85i2w068280@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 27 Aug 2010 08:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211863 - stable/8/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 08:05:44 -0000 Author: kib Date: Fri Aug 27 08:05:44 2010 New Revision: 211863 URL: http://svn.freebsd.org/changeset/base/211863 Log: MFC r211750: Remove extra FreeBSD tag. Modified: stable/8/lib/libc/sys/stack_protector.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/locale/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) Modified: stable/8/lib/libc/sys/stack_protector.c ============================================================================== --- stable/8/lib/libc/sys/stack_protector.c Fri Aug 27 07:45:50 2010 (r211862) +++ stable/8/lib/libc/sys/stack_protector.c Fri Aug 27 08:05:44 2010 (r211863) @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /* $NetBSD: stack_protector.c,v 1.4 2006/11/22 17:23:25 christos Exp $ */ /* $OpenBSD: stack_protector.c,v 1.10 2006/03/31 05:34:44 deraadt Exp $ */ /* From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 08:54:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA17D1065698; Fri, 27 Aug 2010 08:54:40 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B985E8FC16; Fri, 27 Aug 2010 08:54:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7R8seik069412; Fri, 27 Aug 2010 08:54:40 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7R8sesF069410; Fri, 27 Aug 2010 08:54:40 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201008270854.o7R8sesF069410@svn.freebsd.org> From: Brian Somers Date: Fri, 27 Aug 2010 08:54:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211864 - head/bin/pax X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 08:54:40 -0000 Author: brian Date: Fri Aug 27 08:54:40 2010 New Revision: 211864 URL: http://svn.freebsd.org/changeset/base/211864 Log: Fix an off-by-one error where we try to split a path name that's more than 100 characters long and the 101th last character is a '/'. MFC after: 3 weeks Modified: head/bin/pax/tar.c Modified: head/bin/pax/tar.c ============================================================================== --- head/bin/pax/tar.c Fri Aug 27 08:05:44 2010 (r211863) +++ head/bin/pax/tar.c Fri Aug 27 08:54:40 2010 (r211864) @@ -1095,7 +1095,7 @@ name_split(char *name, int len) * to find the biggest piece to fit in the name field (or the smallest * prefix we can find) */ - start = name + len - TNMSZ - 1; + start = name + len - TNMSZ; while ((*start != '\0') && (*start != '/')) ++start; From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 09:33:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14FDE1065694; Fri, 27 Aug 2010 09:33:27 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02D688FC15; Fri, 27 Aug 2010 09:33:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7R9XQqI070374; Fri, 27 Aug 2010 09:33:26 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7R9XQll070371; Fri, 27 Aug 2010 09:33:26 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201008270933.o7R9XQll070371@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 27 Aug 2010 09:33:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211865 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 09:33:27 -0000 Author: uqs Date: Fri Aug 27 09:33:26 2010 New Revision: 211865 URL: http://svn.freebsd.org/changeset/base/211865 Log: MFC r205208: - Use `Va' for variables instead of `Dv'. - Correctly spell negative values. - Also fixes make manlint. Modified: stable/8/share/man/man4/sysmouse.4 Directory Properties: stable/8/share/man/ (props changed) stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/sysmouse.4 ============================================================================== --- stable/8/share/man/man4/sysmouse.4 Fri Aug 27 08:54:40 2010 (r211864) +++ stable/8/share/man/man4/sysmouse.4 Fri Aug 27 09:33:26 2010 (r211865) @@ -94,18 +94,18 @@ Right button status; cleared if pressed, .El .It Byte 2 The first half of horizontal movement count in two's complement; --128 through 127. +\-128 through 127. .It Byte 3 The first half of vertical movement count in two's complement; --128 through 127. +\-128 through 127. .It Byte 4 The second half of the horizontal movement count in two's complement; --128 through 127. +\-128 through 127. To obtain the full horizontal movement count, add the byte 2 and 4. .It Byte 5 The second half of the vertical movement count in two's complement; --128 through 127. +\-128 through 127. To obtain the full vertical movement count, add the byte 3 and 5. .El @@ -148,7 +148,7 @@ These commands manipulate the operation Returns the hardware information of the attached device in the following structure. Only the -.Dv iftype +.Va iftype field is guaranteed to be filled with the correct value in the current version of the .Nm @@ -164,16 +164,16 @@ typedef struct mousehw { .Ed .Pp The -.Dv buttons +.Va buttons field holds the number of buttons detected by the driver. .Pp The -.Dv iftype +.Va iftype is always .Dv MOUSE_IF_SYSMOUSE . .Pp The -.Dv type +.Va type tells the device type: .Dv MOUSE_MOUSE , .Dv MOUSE_TRACKBALL , @@ -183,7 +183,7 @@ or .Dv MOUSE_UNKNOWN . .Pp The -.Dv model +.Va model is always .Dv MOUSE_MODEL_GENERIC at the operation level 0. @@ -194,7 +194,7 @@ or one of constants at higher operation levels. .Pp The -.Dv hwid +.Va hwid is always zero. .Pp .It Dv MOUSE_GETMODE Ar mousemode_t *mode @@ -213,7 +213,7 @@ typedef struct mousemode { .Ed .Pp The -.Dv protocol +.Va protocol field tells the format in which the device status is returned when the mouse data is read by the user program. It is @@ -223,19 +223,19 @@ at the operation level zero. at the operation level one. .Pp The -.Dv rate -is always set to -1. +.Va rate +is always set to \-1. .Pp The -.Dv resolution -is always set to -1. +.Va resolution +is always set to \-1. .Pp The -.Dv accelfactor +.Va accelfactor is always 0. .Pp The -.Dv packetsize +.Va packetsize field specifies the length of the data packet. It depends on the operation level. @@ -248,13 +248,13 @@ operation level. .El .Pp The array -.Dv syncmask +.Va syncmask holds a bit mask and pattern to detect the first byte of the data packet. -.Dv syncmask[0] +.Va syncmask[0] is the bit mask to be ANDed with a byte. If the result is equal to -.Dv syncmask[1] , +.Va syncmask[1] , the byte is likely to be the first byte of the data packet. Note that this method of detecting the first byte is not 100% reliable; thus, it should be taken only as an advisory measure. @@ -264,7 +264,7 @@ The command changes the current operatio as specified in .Ar mode . Only -.Dv level +.Va level may be modifiable. Setting values in the other field does not generate error and has no effect. @@ -323,7 +323,7 @@ struct mouse_info { .Ed .Pp .Bl -tag -width operation -compact -.It Dv operation +.It Va operation This can be one of .Pp .Bl -tag -width MOUSE_MOVEABS -compact @@ -333,21 +333,21 @@ Enables and displays mouse cursor. Disables and hides mouse cursor. .It Dv MOUSE_MOVEABS Moves mouse cursor to position supplied in -.Dv u.data . +.Va u.data . .It Dv MOUSE_MOVEREL Adds position supplied in -.Dv u.data +.Va u.data to current position. .It Dv MOUSE_GETINFO Returns current mouse position in the current virtual console and button status in -.Dv u.data . +.Va u.data . .It Dv MOUSE_MODE This sets the .Xr signal 3 to be delivered to the current process when a button is pressed. The signal to be delivered is set in -.Dv u.mode . +.Va u.mode . .El .Pp The above operations are for virtual consoles. @@ -360,7 +360,7 @@ to pass mouse data to the console driver .It Dv MOUSE_ACTION .It Dv MOUSE_MOTION_EVENT These operations take the information in -.Dv u.data +.Va u.data and act upon it. Mouse data will be sent to the .Nm @@ -370,7 +370,7 @@ also processes button press actions and requested or performs cut and paste operations if the current console is a text interface. .It Dv MOUSE_BUTTON_EVENT -.Dv u.data +.Va u.data specifies a button and its click count. The console driver will use this information for signal delivery if requested or @@ -385,11 +385,11 @@ They are intended to replace functions p .Dv MOUSE_ACTION alone. .Pp -.It Dv Sq u +.It Va u This union is one of .Pp .Bl -tag -width data -compact -.It Dv data +.It Va data .Bd -literal struct mouse_data { int x; @@ -399,18 +399,17 @@ struct mouse_data { }; .Ed .Pp -.Dv x , -.Dv y +.Va x , y and -.Dv z +.Va z represent movement of the mouse along respective directions. -.Dv buttons +.Va buttons tells the state of buttons. It encodes up to 31 buttons in the bit 0 though the bit 30. If a button is held down, the corresponding bit is set. .Pp -.It Dv mode +.It Va mode .Bd -literal struct mouse_mode { int mode; @@ -419,16 +418,16 @@ struct mouse_mode { .Ed .Pp The -.Dv signal +.Va signal field specifies the signal to be delivered to the process. It must be one of the values defined in .In signal.h . The -.Dv mode +.Va mode field is currently unused. .Pp -.It Dv event +.It Va event .Bd -literal struct mouse_event { int id; @@ -437,12 +436,12 @@ struct mouse_event { .Ed .Pp The -.Dv id +.Va id field specifies a button number as in -.Dv u.data.buttons . +.Va u.data.buttons . Only one bit/button is set. The -.Dv value +.Va value field holds the click count: the number of times the user has clicked the button successively. From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 09:35:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90C821065674; Fri, 27 Aug 2010 09:35:05 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7EC498FC13; Fri, 27 Aug 2010 09:35:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7R9Z5w2070507; Fri, 27 Aug 2010 09:35:05 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7R9Z55J070501; Fri, 27 Aug 2010 09:35:05 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201008270935.o7R9Z55J070501@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 27 Aug 2010 09:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211866 - in stable/8/lib/libc: gen locale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 09:35:05 -0000 Author: uqs Date: Fri Aug 27 09:35:05 2010 New Revision: 211866 URL: http://svn.freebsd.org/changeset/base/211866 Log: MFC r206615: remove .Pp where not needed Modified: stable/8/lib/libc/gen/confstr.3 stable/8/lib/libc/gen/sysconf.3 stable/8/lib/libc/gen/sysctl.3 stable/8/lib/libc/locale/isalnum.3 stable/8/lib/libc/locale/isalpha.3 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/locale/ (props changed) Modified: stable/8/lib/libc/gen/confstr.3 ============================================================================== --- stable/8/lib/libc/gen/confstr.3 Fri Aug 27 09:33:26 2010 (r211865) +++ stable/8/lib/libc/gen/confstr.3 Fri Aug 27 09:35:05 2010 (r211866) @@ -79,7 +79,6 @@ The copied value is always null terminat The available values are as follows: .Pp .Bl -tag -width 6n -.Pp .It Li _CS_PATH Return a value for the .Ev PATH Modified: stable/8/lib/libc/gen/sysconf.3 ============================================================================== --- stable/8/lib/libc/gen/sysconf.3 Fri Aug 27 09:33:26 2010 (r211865) +++ stable/8/lib/libc/gen/sysconf.3 Fri Aug 27 09:35:05 2010 (r211866) @@ -60,9 +60,7 @@ Shell programmers who need access to the utility. .Pp The available values are as follows: -.Pp .Bl -tag -width 6n -.Pp .It Li _SC_ARG_MAX The maximum bytes of argument to .Xr execve 2 . @@ -165,9 +163,7 @@ otherwise \-1. .El .Pp These values also exist, but may not be standard: -.Pp .Bl -tag -width 6n -.Pp .It Li _SC_PHYS_PAGES The number of pages of physical memory. Note that it is possible that the product of this value and the value of Modified: stable/8/lib/libc/gen/sysctl.3 ============================================================================== --- stable/8/lib/libc/gen/sysctl.3 Fri Aug 27 09:33:26 2010 (r211865) +++ stable/8/lib/libc/gen/sysctl.3 Fri Aug 27 09:35:05 2010 (r211866) @@ -286,7 +286,6 @@ privilege may change the value. .It "HW_MACHINE_ARCH string no" .It "HW_REALMEM integer no" .El -.Pp .Bl -tag -width 6n .It Li HW_MACHINE The machine class. @@ -352,7 +351,6 @@ information. .It "KERN_VERSION string no" .It "KERN_VNODE struct xvnode no" .El -.Pp .Bl -tag -width 6n .It Li KERN_ARGMAX The maximum bytes of argument to @@ -539,7 +537,6 @@ privilege may change the value. .It "PF_INET IPv4 values yes" .It "PF_INET6 IPv6 values yes" .El -.Pp .Bl -tag -width 6n .It Li PF_ROUTE Return the entire routing table or a subset of it. @@ -646,7 +643,6 @@ privilege may change the value. .It "USER_TZNAME_MAX integer no" .El .Bl -tag -width 6n -.Pp .It Li USER_BC_BASE_MAX The maximum ibase/obase values in the .Xr bc 1 @@ -736,7 +732,6 @@ privilege may change the value. .It "VM_V_INACTIVE_TARGET integer yes" .It "VM_V_PAGEOUT_FREE_MIN integer yes" .El -.Pp .Bl -tag -width 6n .It Li VM_LOADAVG Return the load average history. Modified: stable/8/lib/libc/locale/isalnum.3 ============================================================================== --- stable/8/lib/libc/locale/isalnum.3 Fri Aug 27 09:33:26 2010 (r211865) +++ stable/8/lib/libc/locale/isalnum.3 Fri Aug 27 09:35:05 2010 (r211866) @@ -59,7 +59,6 @@ or the value of .Pp In the ASCII character set, this includes the following characters (with their numeric values shown in octal): -.Pp .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ .It "\&060\ ``0'' \t061\ ``1'' \t062\ ``2'' \t063\ ``3'' \t064\ ``4''" .It "\&065\ ``5'' \t066\ ``6'' \t067\ ``7'' \t070\ ``8'' \t071\ ``9''" Modified: stable/8/lib/libc/locale/isalpha.3 ============================================================================== --- stable/8/lib/libc/locale/isalpha.3 Fri Aug 27 09:33:26 2010 (r211865) +++ stable/8/lib/libc/locale/isalpha.3 Fri Aug 27 09:35:05 2010 (r211866) @@ -59,7 +59,6 @@ or the value of .Pp In the ASCII character set, this includes the following characters (with their numeric values shown in octal): -.Pp .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ .It "\&101\ ``A'' \t102\ ``B'' \t103\ ``C'' \t104\ ``D'' \t105\ ``E''" .It "\&106\ ``F'' \t107\ ``G'' \t110\ ``H'' \t111\ ``I'' \t112\ ``J''" From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 09:36:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E7D41065695; Fri, 27 Aug 2010 09:36:03 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0DF48FC19; Fri, 27 Aug 2010 09:36:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7R9a2IL070569; Fri, 27 Aug 2010 09:36:02 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7R9a2uP070565; Fri, 27 Aug 2010 09:36:02 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201008270936.o7R9a2uP070565@svn.freebsd.org> From: Andre Oppermann Date: Fri, 27 Aug 2010 09:36:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211867 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 09:36:03 -0000 Author: andre Date: Fri Aug 27 09:36:02 2010 New Revision: 211867 URL: http://svn.freebsd.org/changeset/base/211867 Log: MFC r211462: Untangle the net.inet.tcp.log_in_vain and net.inet.tcp.log_debug sysctl's and remove any side effects. Modified: stable/8/sys/netinet/tcp_input.c stable/8/sys/netinet/tcp_subr.c stable/8/sys/netinet/tcp_var.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet/tcp_input.c ============================================================================== --- stable/8/sys/netinet/tcp_input.c Fri Aug 27 09:35:05 2010 (r211866) +++ stable/8/sys/netinet/tcp_input.c Fri Aug 27 09:36:02 2010 (r211867) @@ -571,7 +571,7 @@ findpcb: */ if ((tcp_log_in_vain == 1 && (thflags & TH_SYN)) || tcp_log_in_vain == 2) { - if ((s = tcp_log_addrs(NULL, th, (void *)ip, ip6))) + if ((s = tcp_log_vain(NULL, th, (void *)ip, ip6))) log(LOG_INFO, "%s; %s: Connection attempt " "to closed port\n", s, __func__); } Modified: stable/8/sys/netinet/tcp_subr.c ============================================================================== --- stable/8/sys/netinet/tcp_subr.c Fri Aug 27 09:35:05 2010 (r211866) +++ stable/8/sys/netinet/tcp_subr.c Fri Aug 27 09:36:02 2010 (r211867) @@ -262,6 +262,8 @@ VNET_DEFINE(uma_zone_t, sack_hole_zone); static struct inpcb *tcp_notify(struct inpcb *, int); static void tcp_isn_tick(void *); +static char * tcp_log_addr(struct in_conninfo *inc, struct tcphdr *th, + void *ip4hdr, const void *ip6hdr); /* * Target size of TCP PCB hash tables. Must be a power of two. @@ -2224,9 +2226,33 @@ SYSCTL_PROC(_net_inet_tcp, TCPCTL_DROP, * and ip6_hdr pointers have to be passed as void pointers. */ char * +tcp_log_vain(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr, + const void *ip6hdr) +{ + + /* Is logging enabled? */ + if (tcp_log_in_vain == 0) + return (NULL); + + return (tcp_log_addr(inc, th, ip4hdr, ip6hdr)); +} + +char * tcp_log_addrs(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr, const void *ip6hdr) { + + /* Is logging enabled? */ + if (tcp_log_debug == 0) + return (NULL); + + return (tcp_log_addr(inc, th, ip4hdr, ip6hdr)); +} + +static char * +tcp_log_addr(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr, + const void *ip6hdr) +{ char *s, *sp; size_t size; struct ip *ip; @@ -2249,10 +2275,6 @@ tcp_log_addrs(struct in_conninfo *inc, s 2 * INET_ADDRSTRLEN; #endif /* INET6 */ - /* Is logging enabled? */ - if (tcp_log_debug == 0 && tcp_log_in_vain == 0) - return (NULL); - s = malloc(size, M_TCPLOG, M_ZERO|M_NOWAIT); if (s == NULL) return (NULL); Modified: stable/8/sys/netinet/tcp_var.h ============================================================================== --- stable/8/sys/netinet/tcp_var.h Fri Aug 27 09:35:05 2010 (r211866) +++ stable/8/sys/netinet/tcp_var.h Fri Aug 27 09:36:02 2010 (r211867) @@ -602,6 +602,8 @@ void tcp_destroy(void); void tcp_fini(void *); char *tcp_log_addrs(struct in_conninfo *, struct tcphdr *, void *, const void *); +char *tcp_log_vain(struct in_conninfo *, struct tcphdr *, void *, + const void *); int tcp_reass(struct tcpcb *, struct tcphdr *, int *, struct mbuf *); void tcp_reass_init(void); #ifdef VIMAGE From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 09:55:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A9FA10656A7; Fri, 27 Aug 2010 09:55:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 29F6A8FC15; Fri, 27 Aug 2010 09:55:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7R9tq6I071400; Fri, 27 Aug 2010 09:55:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7R9tqkh071398; Fri, 27 Aug 2010 09:55:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008270955.o7R9tqkh071398@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 27 Aug 2010 09:55:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211868 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 09:55:52 -0000 Author: kib Date: Fri Aug 27 09:55:51 2010 New Revision: 211868 URL: http://svn.freebsd.org/changeset/base/211868 Log: Use private namespace for visibility keyword. Noted by: bde MFC after: 3 days Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Fri Aug 27 09:36:02 2010 (r211867) +++ head/sys/sys/cdefs.h Fri Aug 27 09:55:51 2010 (r211868) @@ -306,8 +306,8 @@ #endif #if __GNUC_PREREQ__(4, 2) -#define __hidden __attribute__((visibility("hidden"))) -#define __exported __attribute__((visibility("default"))) +#define __hidden __attribute__((__visibility__("hidden"))) +#define __exported __attribute__((__visibility__("default"))) #else #define __hidden #define __exported From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 09:59:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1C7D106566C; Fri, 27 Aug 2010 09:59:51 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C00208FC19; Fri, 27 Aug 2010 09:59:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7R9xpuV071573; Fri, 27 Aug 2010 09:59:51 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7R9xpBF071569; Fri, 27 Aug 2010 09:59:51 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201008270959.o7R9xpBF071569@svn.freebsd.org> From: Andre Oppermann Date: Fri, 27 Aug 2010 09:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211869 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 09:59:52 -0000 Author: andre Date: Fri Aug 27 09:59:51 2010 New Revision: 211869 URL: http://svn.freebsd.org/changeset/base/211869 Log: MFC r211462: Untangle the net.inet.tcp.log_in_vain and net.inet.tcp.log_debug sysctl's and remove any side effects. Modified: stable/7/sys/netinet/tcp_input.c stable/7/sys/netinet/tcp_subr.c stable/7/sys/netinet/tcp_var.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/tcp_input.c ============================================================================== --- stable/7/sys/netinet/tcp_input.c Fri Aug 27 09:55:51 2010 (r211868) +++ stable/7/sys/netinet/tcp_input.c Fri Aug 27 09:59:51 2010 (r211869) @@ -462,7 +462,7 @@ findpcb: */ if ((tcp_log_in_vain == 1 && (thflags & TH_SYN)) || tcp_log_in_vain == 2) { - if ((s = tcp_log_addrs(NULL, th, (void *)ip, ip6))) + if ((s = tcp_log_vain(NULL, th, (void *)ip, ip6))) log(LOG_INFO, "%s; %s: Connection attempt " "to closed port\n", s, __func__); } Modified: stable/7/sys/netinet/tcp_subr.c ============================================================================== --- stable/7/sys/netinet/tcp_subr.c Fri Aug 27 09:55:51 2010 (r211868) +++ stable/7/sys/netinet/tcp_subr.c Fri Aug 27 09:59:51 2010 (r211869) @@ -235,6 +235,8 @@ uma_zone_t sack_hole_zone; static struct inpcb *tcp_notify(struct inpcb *, int); static void tcp_isn_tick(void *); +static char * tcp_log_addr(struct in_conninfo *inc, struct tcphdr *th, + void *ip4hdr, const void *ip6hdr); /* * Target size of TCP PCB hash tables. Must be a power of two. @@ -2120,9 +2122,33 @@ SYSCTL_PROC(_net_inet_tcp, TCPCTL_DROP, * and ip6_hdr pointers have to be passed as void pointers. */ char * +tcp_log_vain(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr, + const void *ip6hdr) +{ + + /* Is logging enabled? */ + if (tcp_log_in_vain == 0) + return (NULL); + + return (tcp_log_addr(inc, th, ip4hdr, ip6hdr)); +} + +char * tcp_log_addrs(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr, const void *ip6hdr) { + + /* Is logging enabled? */ + if (tcp_log_debug == 0) + return (NULL); + + return (tcp_log_addr(inc, th, ip4hdr, ip6hdr)); +} + +static char * +tcp_log_addr(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr, + const void *ip6hdr) +{ char *s, *sp; size_t size; struct ip *ip; @@ -2145,10 +2171,6 @@ tcp_log_addrs(struct in_conninfo *inc, s 2 * INET_ADDRSTRLEN; #endif /* INET6 */ - /* Is logging enabled? */ - if (tcp_log_debug == 0 && tcp_log_in_vain == 0) - return (NULL); - s = malloc(size, M_TCPLOG, M_ZERO|M_NOWAIT); if (s == NULL) return (NULL); Modified: stable/7/sys/netinet/tcp_var.h ============================================================================== --- stable/7/sys/netinet/tcp_var.h Fri Aug 27 09:55:51 2010 (r211868) +++ stable/7/sys/netinet/tcp_var.h Fri Aug 27 09:59:51 2010 (r211869) @@ -538,6 +538,8 @@ void tcp_init(void); void tcp_fini(void *); char *tcp_log_addrs(struct in_conninfo *, struct tcphdr *, void *, const void *); +char *tcp_log_vain(struct in_conninfo *, struct tcphdr *, void *, + const void *); int tcp_reass(struct tcpcb *, struct tcphdr *, int *, struct mbuf *); void tcp_reass_init(void); void tcp_input(struct mbuf *, int); From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 10:15:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3636E10656A4; Fri, 27 Aug 2010 10:15:46 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 246678FC12; Fri, 27 Aug 2010 10:15:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RAFkAm072133; Fri, 27 Aug 2010 10:15:46 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RAFknT072130; Fri, 27 Aug 2010 10:15:46 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201008271015.o7RAFknT072130@svn.freebsd.org> From: Andre Oppermann Date: Fri, 27 Aug 2010 10:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211870 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 10:15:46 -0000 Author: andre Date: Fri Aug 27 10:15:45 2010 New Revision: 211870 URL: http://svn.freebsd.org/changeset/base/211870 Log: MFC r211464: If a TCP connection has been idle for one retransmit timeout or more it must reset its congestion window back to the initial window. RFC3390 has increased the initial window from 1 segment to up to 4 segments. The initial window increase of RFC3390 wasn't reflected into the restart window which remained at its original defaults of 4 segments for local and 1 segment for all other connections. Both values are controllable through sysctl net.inet.tcp.local_slowstart_flightsize and net.inet.tcp.slowstart_flightsize. The increase helps TCP's slow start algorithm to open up the congestion window much faster. Reviewed by: lstewart MFC after: 1 week Modified: stable/8/sys/netinet/tcp_output.c stable/8/sys/netinet/tcp_var.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet/tcp_output.c ============================================================================== --- stable/8/sys/netinet/tcp_output.c Fri Aug 27 09:59:51 2010 (r211869) +++ stable/8/sys/netinet/tcp_output.c Fri Aug 27 10:15:45 2010 (r211870) @@ -140,7 +140,7 @@ tcp_output(struct tcpcb *tp) { struct socket *so = tp->t_inpcb->inp_socket; long len, recwin, sendwin; - int off, flags, error; + int off, flags, error, rw; struct mbuf *m; struct ip *ip = NULL; struct ipovly *ipov = NULL; @@ -176,23 +176,34 @@ tcp_output(struct tcpcb *tp) idle = (tp->t_flags & TF_LASTIDLE) || (tp->snd_max == tp->snd_una); if (idle && ticks - tp->t_rcvtime >= tp->t_rxtcur) { /* - * We have been idle for "a while" and no acks are - * expected to clock out any data we send -- - * slow start to get ack "clock" running again. + * If we've been idle for more than one retransmit + * timeout the old congestion window is no longer + * current and we have to reduce it to the restart + * window before we can transmit again. * - * Set the slow-start flight size depending on whether - * this is a local network or not. + * The restart window is the initial window or the last + * CWND, whichever is smaller. + * + * This is done to prevent us from flooding the path with + * a full CWND at wirespeed, overloading router and switch + * buffers along the way. + * + * See RFC5681 Section 4.1. "Restarting Idle Connections". */ - int ss = V_ss_fltsz; + if (V_tcp_do_rfc3390) + rw = min(4 * tp->t_maxseg, + max(2 * tp->t_maxseg, 4380)); #ifdef INET6 - if (isipv6) { - if (in6_localaddr(&tp->t_inpcb->in6p_faddr)) - ss = V_ss_fltsz_local; - } else -#endif /* INET6 */ - if (in_localaddr(tp->t_inpcb->inp_faddr)) - ss = V_ss_fltsz_local; - tp->snd_cwnd = tp->t_maxseg * ss; + else if ((isipv6 ? in6_localaddr(&tp->t_inpcb->in6p_faddr) : + in_localaddr(tp->t_inpcb->inp_faddr))) +#else + else if (in_localaddr(tp->t_inpcb->inp_faddr)) +#endif + rw = V_ss_fltsz_local * tp->t_maxseg; + else + rw = V_ss_fltsz * tp->t_maxseg; + + tp->snd_cwnd = min(rw, tp->snd_cwnd); } tp->t_flags &= ~TF_LASTIDLE; if (idle) { Modified: stable/8/sys/netinet/tcp_var.h ============================================================================== --- stable/8/sys/netinet/tcp_var.h Fri Aug 27 09:59:51 2010 (r211869) +++ stable/8/sys/netinet/tcp_var.h Fri Aug 27 10:15:45 2010 (r211870) @@ -556,6 +556,7 @@ extern int tcp_log_in_vain; VNET_DECLARE(int, tcp_mssdflt); /* XXX */ VNET_DECLARE(int, tcp_minmss); VNET_DECLARE(int, tcp_delack_enabled); +VNET_DECLARE(int, tcp_do_rfc3390); VNET_DECLARE(int, tcp_do_newreno); VNET_DECLARE(int, path_mtu_discovery); VNET_DECLARE(int, ss_fltsz); @@ -566,6 +567,7 @@ VNET_DECLARE(int, ss_fltsz_local); #define V_tcp_mssdflt VNET(tcp_mssdflt) #define V_tcp_minmss VNET(tcp_minmss) #define V_tcp_delack_enabled VNET(tcp_delack_enabled) +#define V_tcp_do_rfc3390 VNET(tcp_do_rfc3390) #define V_tcp_do_newreno VNET(tcp_do_newreno) #define V_path_mtu_discovery VNET(path_mtu_discovery) #define V_ss_fltsz VNET(ss_fltsz) From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 10:16:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 906D310656B5; Fri, 27 Aug 2010 10:16:32 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E8988FC15; Fri, 27 Aug 2010 10:16:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RAGWrI074604; Fri, 27 Aug 2010 10:16:32 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RAGWgV074600; Fri, 27 Aug 2010 10:16:32 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201008271016.o7RAGWgV074600@svn.freebsd.org> From: Andre Oppermann Date: Fri, 27 Aug 2010 10:16:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211871 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 10:16:32 -0000 Author: andre Date: Fri Aug 27 10:16:32 2010 New Revision: 211871 URL: http://svn.freebsd.org/changeset/base/211871 Log: MFC r211464: If a TCP connection has been idle for one retransmit timeout or more it must reset its congestion window back to the initial window. RFC3390 has increased the initial window from 1 segment to up to 4 segments. The initial window increase of RFC3390 wasn't reflected into the restart window which remained at its original defaults of 4 segments for local and 1 segment for all other connections. Both values are controllable through sysctl net.inet.tcp.local_slowstart_flightsize and net.inet.tcp.slowstart_flightsize. The increase helps TCP's slow start algorithm to open up the congestion window much faster. Reviewed by: lstewart MFC after: 1 week Modified: stable/7/sys/netinet/tcp_input.c stable/7/sys/netinet/tcp_output.c stable/7/sys/netinet/tcp_var.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/tcp_input.c ============================================================================== --- stable/7/sys/netinet/tcp_input.c Fri Aug 27 10:15:45 2010 (r211870) +++ stable/7/sys/netinet/tcp_input.c Fri Aug 27 10:16:32 2010 (r211871) @@ -123,7 +123,7 @@ static int tcp_do_rfc3042 = 1; SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3042, CTLFLAG_RW, &tcp_do_rfc3042, 0, "Enable RFC 3042 (Limited Transmit)"); -static int tcp_do_rfc3390 = 1; +int tcp_do_rfc3390 = 1; SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3390, CTLFLAG_RW, &tcp_do_rfc3390, 0, "Enable RFC 3390 (Increasing TCP's Initial Congestion Window)"); Modified: stable/7/sys/netinet/tcp_output.c ============================================================================== --- stable/7/sys/netinet/tcp_output.c Fri Aug 27 10:15:45 2010 (r211870) +++ stable/7/sys/netinet/tcp_output.c Fri Aug 27 10:16:32 2010 (r211871) @@ -127,7 +127,7 @@ tcp_output(struct tcpcb *tp) { struct socket *so = tp->t_inpcb->inp_socket; long len, recwin, sendwin; - int off, flags, error; + int off, flags, error, rw; struct mbuf *m; struct ip *ip = NULL; struct ipovly *ipov = NULL; @@ -163,23 +163,34 @@ tcp_output(struct tcpcb *tp) idle = (tp->t_flags & TF_LASTIDLE) || (tp->snd_max == tp->snd_una); if (idle && (ticks - (int)tp->t_rcvtime) >= tp->t_rxtcur) { /* - * We have been idle for "a while" and no acks are - * expected to clock out any data we send -- - * slow start to get ack "clock" running again. + * If we've been idle for more than one retransmit + * timeout the old congestion window is no longer + * current and we have to reduce it to the restart + * window before we can transmit again. * - * Set the slow-start flight size depending on whether - * this is a local network or not. + * The restart window is the initial window or the last + * CWND, whichever is smaller. + * + * This is done to prevent us from flooding the path with + * a full CWND at wirespeed, overloading router and switch + * buffers along the way. + * + * See RFC5681 Section 4.1. "Restarting Idle Connections". */ - int ss = ss_fltsz; + if (tcp_do_rfc3390) + rw = min(4 * tp->t_maxseg, + max(2 * tp->t_maxseg, 4380)); #ifdef INET6 - if (isipv6) { - if (in6_localaddr(&tp->t_inpcb->in6p_faddr)) - ss = ss_fltsz_local; - } else -#endif /* INET6 */ - if (in_localaddr(tp->t_inpcb->inp_faddr)) - ss = ss_fltsz_local; - tp->snd_cwnd = tp->t_maxseg * ss; + else if ((isipv6 ? in6_localaddr(&tp->t_inpcb->in6p_faddr) : + in_localaddr(tp->t_inpcb->inp_faddr))) +#else + else if (in_localaddr(tp->t_inpcb->inp_faddr)) +#endif + rw = ss_fltsz_local * tp->t_maxseg; + else + rw = ss_fltsz * tp->t_maxseg; + + tp->snd_cwnd = min(rw, tp->snd_cwnd); } tp->t_flags &= ~TF_LASTIDLE; if (idle) { Modified: stable/7/sys/netinet/tcp_var.h ============================================================================== --- stable/7/sys/netinet/tcp_var.h Fri Aug 27 10:15:45 2010 (r211870) +++ stable/7/sys/netinet/tcp_var.h Fri Aug 27 10:16:32 2010 (r211871) @@ -513,6 +513,7 @@ extern int tcp_mssdflt; /* XXX */ extern int tcp_minmss; extern int tcp_delack_enabled; extern int tcp_do_newreno; +extern int tcp_do_rfc3390; extern int path_mtu_discovery; extern int ss_fltsz; extern int ss_fltsz_local; From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 10:47:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E05E10656A5; Fri, 27 Aug 2010 10:47:19 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EBD3D8FC14; Fri, 27 Aug 2010 10:47:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RAlIGx075475; Fri, 27 Aug 2010 10:47:18 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RAlHBe075388; Fri, 27 Aug 2010 10:47:17 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201008271047.o7RAlHBe075388@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 27 Aug 2010 10:47:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211872 - in stable/8: bin/pwait contrib/com_err contrib/csup games/pom gnu/usr.bin/gdb/kgdb lib/libarchive lib/libc/gen lib/libc/posix1e lib/libc/stdlib lib/libcam lib/libcompat/4.1 li... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 10:47:19 -0000 Author: uqs Date: Fri Aug 27 10:47:17 2010 New Revision: 211872 URL: http://svn.freebsd.org/changeset/base/211872 Log: MFC r206622,207939,208593,208732,209031: mdoc cleanup - order prologue by Dd/Dt/Os - fix prologue - remove empty lines and other garbage - uppercase document title Modified: stable/8/bin/pwait/pwait.1 stable/8/contrib/com_err/compile_et.1 stable/8/contrib/csup/csup.1 stable/8/games/pom/pom.6 stable/8/gnu/usr.bin/gdb/kgdb/kgdb.1 stable/8/lib/libarchive/archive_entry.3 stable/8/lib/libarchive/archive_read.3 stable/8/lib/libarchive/archive_read_disk.3 stable/8/lib/libarchive/archive_util.3 stable/8/lib/libarchive/archive_write.3 stable/8/lib/libarchive/archive_write_disk.3 stable/8/lib/libarchive/libarchive-formats.5 stable/8/lib/libarchive/tar.5 stable/8/lib/libc/gen/check_utility_compat.3 stable/8/lib/libc/gen/dladdr.3 stable/8/lib/libc/gen/dlinfo.3 stable/8/lib/libc/gen/dllockinit.3 stable/8/lib/libc/gen/dlopen.3 stable/8/lib/libc/gen/fmtcheck.3 stable/8/lib/libc/gen/ftok.3 stable/8/lib/libc/gen/setproctitle.3 stable/8/lib/libc/gen/stringlist.3 stable/8/lib/libc/posix1e/mac_prepare.3 stable/8/lib/libc/stdlib/hcreate.3 stable/8/lib/libc/stdlib/ptsname.3 stable/8/lib/libcam/cam.3 stable/8/lib/libcam/cam_cdbparse.3 stable/8/lib/libcompat/4.1/cftime.3 stable/8/lib/libcompat/4.4/cuserid.3 stable/8/lib/libedit/editline.3 stable/8/lib/libedit/editrc.5 stable/8/lib/libelf/elf.3 stable/8/lib/libelf/elf_begin.3 stable/8/lib/libelf/elf_cntl.3 stable/8/lib/libelf/elf_end.3 stable/8/lib/libelf/elf_errmsg.3 stable/8/lib/libelf/elf_fill.3 stable/8/lib/libelf/elf_flagdata.3 stable/8/lib/libelf/elf_getarhdr.3 stable/8/lib/libelf/elf_getarsym.3 stable/8/lib/libelf/elf_getbase.3 stable/8/lib/libelf/elf_getdata.3 stable/8/lib/libelf/elf_getident.3 stable/8/lib/libelf/elf_getphnum.3 stable/8/lib/libelf/elf_getscn.3 stable/8/lib/libelf/elf_getshnum.3 stable/8/lib/libelf/elf_getshstrndx.3 stable/8/lib/libelf/elf_hash.3 stable/8/lib/libelf/elf_kind.3 stable/8/lib/libelf/elf_memory.3 stable/8/lib/libelf/elf_next.3 stable/8/lib/libelf/elf_rand.3 stable/8/lib/libelf/elf_rawfile.3 stable/8/lib/libelf/elf_strptr.3 stable/8/lib/libelf/elf_update.3 stable/8/lib/libelf/elf_version.3 stable/8/lib/libelf/gelf.3 stable/8/lib/libelf/gelf_checksum.3 stable/8/lib/libelf/gelf_fsize.3 stable/8/lib/libelf/gelf_getcap.3 stable/8/lib/libelf/gelf_getclass.3 stable/8/lib/libelf/gelf_getdyn.3 stable/8/lib/libelf/gelf_getehdr.3 stable/8/lib/libelf/gelf_getmove.3 stable/8/lib/libelf/gelf_getphdr.3 stable/8/lib/libelf/gelf_getrel.3 stable/8/lib/libelf/gelf_getrela.3 stable/8/lib/libelf/gelf_getshdr.3 stable/8/lib/libelf/gelf_getsym.3 stable/8/lib/libelf/gelf_getsyminfo.3 stable/8/lib/libelf/gelf_getsymshndx.3 stable/8/lib/libelf/gelf_newehdr.3 stable/8/lib/libelf/gelf_newphdr.3 stable/8/lib/libelf/gelf_update_ehdr.3 stable/8/lib/libelf/gelf_xlatetof.3 stable/8/lib/libgssapi/gss_accept_sec_context.3 stable/8/lib/libgssapi/gss_acquire_cred.3 stable/8/lib/libgssapi/gss_add_cred.3 stable/8/lib/libgssapi/gss_add_oid_set_member.3 stable/8/lib/libgssapi/gss_canonicalize_name.3 stable/8/lib/libgssapi/gss_compare_name.3 stable/8/lib/libgssapi/gss_context_time.3 stable/8/lib/libgssapi/gss_create_empty_oid_set.3 stable/8/lib/libgssapi/gss_delete_sec_context.3 stable/8/lib/libgssapi/gss_display_name.3 stable/8/lib/libgssapi/gss_display_status.3 stable/8/lib/libgssapi/gss_duplicate_name.3 stable/8/lib/libgssapi/gss_export_name.3 stable/8/lib/libgssapi/gss_export_sec_context.3 stable/8/lib/libgssapi/gss_get_mic.3 stable/8/lib/libgssapi/gss_import_name.3 stable/8/lib/libgssapi/gss_import_sec_context.3 stable/8/lib/libgssapi/gss_indicate_mechs.3 stable/8/lib/libgssapi/gss_init_sec_context.3 stable/8/lib/libgssapi/gss_inquire_context.3 stable/8/lib/libgssapi/gss_inquire_cred.3 stable/8/lib/libgssapi/gss_inquire_cred_by_mech.3 stable/8/lib/libgssapi/gss_inquire_mechs_for_name.3 stable/8/lib/libgssapi/gss_inquire_names_for_mech.3 stable/8/lib/libgssapi/gss_process_context_token.3 stable/8/lib/libgssapi/gss_release_buffer.3 stable/8/lib/libgssapi/gss_release_cred.3 stable/8/lib/libgssapi/gss_release_name.3 stable/8/lib/libgssapi/gss_release_oid_set.3 stable/8/lib/libgssapi/gss_test_oid_set_member.3 stable/8/lib/libgssapi/gss_unwrap.3 stable/8/lib/libgssapi/gss_verify_mic.3 stable/8/lib/libgssapi/gss_wrap.3 stable/8/lib/libgssapi/gss_wrap_size_limit.3 stable/8/lib/libmemstat/libmemstat.3 stable/8/lib/libpmc/pmc.3 stable/8/lib/libpmc/pmc.atom.3 stable/8/lib/libpmc/pmc.core.3 stable/8/lib/libpmc/pmc.core2.3 stable/8/lib/libpmc/pmc.corei7.3 stable/8/lib/libpmc/pmc.corei7uc.3 stable/8/lib/libpmc/pmc.iaf.3 stable/8/lib/libpmc/pmc.k7.3 stable/8/lib/libpmc/pmc.k8.3 stable/8/lib/libpmc/pmc.p4.3 stable/8/lib/libpmc/pmc.p5.3 stable/8/lib/libpmc/pmc.p6.3 stable/8/lib/libpmc/pmc.tsc.3 stable/8/lib/libpmc/pmc.ucf.3 stable/8/lib/libpmc/pmc.westmere.3 stable/8/lib/libpmc/pmc.westmereuc.3 stable/8/lib/libpmc/pmc_allocate.3 stable/8/lib/libpmc/pmc_attach.3 stable/8/lib/libpmc/pmc_capabilities.3 stable/8/lib/libpmc/pmc_configure_logfile.3 stable/8/lib/libpmc/pmc_disable.3 stable/8/lib/libpmc/pmc_event_names_of_class.3 stable/8/lib/libpmc/pmc_get_driver_stats.3 stable/8/lib/libpmc/pmc_get_msr.3 stable/8/lib/libpmc/pmc_init.3 stable/8/lib/libpmc/pmc_name_of_capability.3 stable/8/lib/libpmc/pmc_read.3 stable/8/lib/libpmc/pmc_set.3 stable/8/lib/libpmc/pmc_start.3 stable/8/lib/libpmc/pmclog.3 stable/8/lib/libthr/libthr.3 stable/8/lib/libugidfw/bsde_get_rule.3 stable/8/lib/libugidfw/bsde_get_rule_count.3 stable/8/lib/libugidfw/bsde_parse_rule.3 stable/8/lib/libugidfw/bsde_rule_to_string.3 stable/8/lib/libugidfw/libugidfw.3 stable/8/lib/libutil/_secure_path.3 stable/8/lib/libutil/auth.3 stable/8/lib/libutil/hexdump.3 stable/8/lib/libutil/kinfo_getfile.3 stable/8/lib/libutil/kinfo_getvmmap.3 stable/8/lib/libutil/kld.3 stable/8/lib/libutil/login_auth.3 stable/8/lib/libutil/login_cap.3 stable/8/lib/libutil/login_class.3 stable/8/lib/libutil/login_ok.3 stable/8/lib/libutil/login_times.3 stable/8/lib/libutil/login_tty.3 stable/8/lib/libutil/property.3 stable/8/lib/libutil/pty.3 stable/8/lib/libutil/realhostname.3 stable/8/lib/libutil/realhostname_sa.3 stable/8/lib/libutil/trimdomain.3 stable/8/lib/libutil/uucplock.3 stable/8/sbin/iscontrol/iscsi.conf.5 stable/8/sbin/spppcontrol/spppcontrol.8 stable/8/share/man/man3/sysexits.3 stable/8/share/man/man3/tgmath.3 stable/8/share/man/man4/audit.4 stable/8/share/man/man4/auditpipe.4 stable/8/share/man/man4/coda.4 stable/8/share/man/man4/gbde.4 stable/8/share/man/man4/geom.4 stable/8/share/man/man4/geom_fox.4 stable/8/share/man/man4/geom_linux_lvm.4 stable/8/share/man/man4/geom_uzip.4 stable/8/share/man/man4/ipw.4 stable/8/share/man/man4/iscsi_initiator.4 stable/8/share/man/man4/iwi.4 stable/8/share/man/man4/iwn.4 stable/8/share/man/man4/kbdmux.4 stable/8/share/man/man4/lp.4 stable/8/share/man/man4/mac.4 stable/8/share/man/man4/mac_biba.4 stable/8/share/man/man4/mac_bsdextended.4 stable/8/share/man/man4/mac_ifoff.4 stable/8/share/man/man4/mac_lomac.4 stable/8/share/man/man4/mac_mls.4 stable/8/share/man/man4/mac_none.4 stable/8/share/man/man4/mac_partition.4 stable/8/share/man/man4/mac_seeotheruids.4 stable/8/share/man/man4/mac_stub.4 stable/8/share/man/man4/mac_test.4 stable/8/share/man/man4/ng_netflow.4 stable/8/share/man/man4/orm.4 stable/8/share/man/man4/ral.4 stable/8/share/man/man4/rp.4 stable/8/share/man/man4/rum.4 stable/8/share/man/man4/sched_4bsd.4 stable/8/share/man/man4/sched_ule.4 stable/8/share/man/man4/si.4 stable/8/share/man/man4/tap.4 stable/8/share/man/man4/textdump.4 stable/8/share/man/man4/uhso.4 stable/8/share/man/man4/upgt.4 stable/8/share/man/man4/ural.4 stable/8/share/man/man4/vkbd.4 stable/8/share/man/man4/wpi.4 stable/8/share/man/man5/ar.5 stable/8/share/man/man7/clocks.7 stable/8/share/man/man7/maclabel.7 stable/8/share/man/man8/picobsd.8 stable/8/share/man/man8/rescue.8 stable/8/share/man/man9/CTASSERT.9 stable/8/share/man/man9/DELAY.9 stable/8/share/man/man9/KASSERT.9 stable/8/share/man/man9/VFS.9 stable/8/share/man/man9/VFS_CHECKEXP.9 stable/8/share/man/man9/VFS_FHTOVP.9 stable/8/share/man/man9/VFS_MOUNT.9 stable/8/share/man/man9/VFS_QUOTACTL.9 stable/8/share/man/man9/VFS_ROOT.9 stable/8/share/man/man9/VFS_STATFS.9 stable/8/share/man/man9/VFS_SYNC.9 stable/8/share/man/man9/VFS_UNMOUNT.9 stable/8/share/man/man9/VFS_VGET.9 stable/8/share/man/man9/VOP_ACCESS.9 stable/8/share/man/man9/VOP_ACLCHECK.9 stable/8/share/man/man9/VOP_ADVLOCK.9 stable/8/share/man/man9/VOP_ATTRIB.9 stable/8/share/man/man9/VOP_BWRITE.9 stable/8/share/man/man9/VOP_CREATE.9 stable/8/share/man/man9/VOP_FSYNC.9 stable/8/share/man/man9/VOP_GETACL.9 stable/8/share/man/man9/VOP_GETEXTATTR.9 stable/8/share/man/man9/VOP_GETPAGES.9 stable/8/share/man/man9/VOP_GETVOBJECT.9 stable/8/share/man/man9/VOP_INACTIVE.9 stable/8/share/man/man9/VOP_IOCTL.9 stable/8/share/man/man9/VOP_LINK.9 stable/8/share/man/man9/VOP_LISTEXTATTR.9 stable/8/share/man/man9/VOP_LOCK.9 stable/8/share/man/man9/VOP_LOOKUP.9 stable/8/share/man/man9/VOP_OPENCLOSE.9 stable/8/share/man/man9/VOP_PATHCONF.9 stable/8/share/man/man9/VOP_PRINT.9 stable/8/share/man/man9/VOP_RDWR.9 stable/8/share/man/man9/VOP_READDIR.9 stable/8/share/man/man9/VOP_READLINK.9 stable/8/share/man/man9/VOP_REALLOCBLKS.9 stable/8/share/man/man9/VOP_REMOVE.9 stable/8/share/man/man9/VOP_RENAME.9 stable/8/share/man/man9/VOP_REVOKE.9 stable/8/share/man/man9/VOP_SETACL.9 stable/8/share/man/man9/VOP_SETEXTATTR.9 stable/8/share/man/man9/VOP_STRATEGY.9 stable/8/share/man/man9/VOP_VPTOCNP.9 stable/8/share/man/man9/VOP_VPTOFH.9 stable/8/share/man/man9/accept_filter.9 stable/8/share/man/man9/accf_data.9 stable/8/share/man/man9/accf_dns.9 stable/8/share/man/man9/accf_http.9 stable/8/share/man/man9/acl.9 stable/8/share/man/man9/atomic.9 stable/8/share/man/man9/bus_generic_new_pass.9 stable/8/share/man/man9/bus_set_pass.9 stable/8/share/man/man9/cr_cansee.9 stable/8/share/man/man9/cr_seeothergids.9 stable/8/share/man/man9/cr_seeotheruids.9 stable/8/share/man/man9/devfs_set_cdevpriv.9 stable/8/share/man/man9/devtoname.9 stable/8/share/man/man9/extattr.9 stable/8/share/man/man9/firmware.9 stable/8/share/man/man9/hexdump.9 stable/8/share/man/man9/ifnet.9 stable/8/share/man/man9/insmntque.9 stable/8/share/man/man9/make_dev.9 stable/8/share/man/man9/namei.9 stable/8/share/man/man9/p_candebug.9 stable/8/share/man/man9/p_cansee.9 stable/8/share/man/man9/pfind.9 stable/8/share/man/man9/pgfind.9 stable/8/share/man/man9/prison_check.9 stable/8/share/man/man9/random.9 stable/8/share/man/man9/rijndael.9 stable/8/share/man/man9/rtalloc.9 stable/8/share/man/man9/rtentry.9 stable/8/share/man/man9/sleep.9 stable/8/share/man/man9/spl.9 stable/8/share/man/man9/uio.9 stable/8/share/man/man9/usbdi.9 stable/8/share/man/man9/vaccess.9 stable/8/share/man/man9/vaccess_acl_nfs4.9 stable/8/share/man/man9/vaccess_acl_posix1e.9 stable/8/share/man/man9/vcount.9 stable/8/share/man/man9/vfs_mountedfrom.9 stable/8/share/man/man9/vget.9 stable/8/share/man/man9/vm_map_entry_resize_free.9 stable/8/share/man/man9/vnode.9 stable/8/share/man/man9/vput.9 stable/8/share/man/man9/vref.9 stable/8/share/man/man9/vrefcnt.9 stable/8/share/man/man9/vrele.9 stable/8/share/misc/mdoc.template stable/8/usr.bin/ar/ar.1 stable/8/usr.bin/c89/c89.1 stable/8/usr.bin/c99/c99.1 stable/8/usr.bin/column/column.1 stable/8/usr.bin/comm/comm.1 stable/8/usr.bin/enigma/enigma.1 stable/8/usr.bin/hexdump/od.1 stable/8/usr.bin/killall/killall.1 stable/8/usr.bin/lockf/lockf.1 stable/8/usr.sbin/asf/asf.8 stable/8/usr.sbin/burncd/burncd.8 stable/8/usr.sbin/ctm/ctm/ctm.1 stable/8/usr.sbin/ctm/ctm/ctm.5 stable/8/usr.sbin/devinfo/devinfo.8 stable/8/usr.sbin/fdcontrol/fdcontrol.8 stable/8/usr.sbin/fdformat/fdformat.1 stable/8/usr.sbin/fdread/fdread.1 stable/8/usr.sbin/fdwrite/fdwrite.1 stable/8/usr.sbin/fifolog/fifolog_create/fifolog.1 stable/8/usr.sbin/flowctl/flowctl.8 stable/8/usr.sbin/i2c/i2c.8 stable/8/usr.sbin/mtest/mtest.8 stable/8/usr.sbin/periodic/periodic.8 stable/8/usr.sbin/pmcannotate/pmcannotate.8 stable/8/usr.sbin/pmccontrol/pmccontrol.8 stable/8/usr.sbin/pmcstat/pmcstat.8 stable/8/usr.sbin/pppctl/pppctl.8 stable/8/usr.sbin/service/service.8 stable/8/usr.sbin/setfmac/setfsmac.8 stable/8/usr.sbin/setpmac/setpmac.8 stable/8/usr.sbin/smbmsg/smbmsg.8 stable/8/usr.sbin/uhsoctl/uhsoctl.1 Directory Properties: stable/8/bin/pwait/ (props changed) stable/8/contrib/com_err/ (props changed) stable/8/contrib/csup/ (props changed) stable/8/games/pom/ (props changed) stable/8/gnu/usr.bin/gdb/ (props changed) stable/8/gnu/usr.bin/gdb/kgdb/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/locale/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/sbin/iscontrol/ (props changed) stable/8/sbin/spppcontrol/ (props changed) stable/8/share/man/ (props changed) stable/8/share/man/man1/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man8/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/share/misc/ (props changed) stable/8/usr.bin/ar/ (props changed) stable/8/usr.bin/c89/ (props changed) stable/8/usr.bin/c99/ (props changed) stable/8/usr.bin/column/ (props changed) stable/8/usr.bin/comm/ (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/enigma/ (props changed) stable/8/usr.bin/hexdump/ (props changed) stable/8/usr.bin/killall/ (props changed) stable/8/usr.bin/lockf/ (props changed) stable/8/usr.sbin/asf/ (props changed) stable/8/usr.sbin/burncd/ (props changed) stable/8/usr.sbin/ctm/ (props changed) stable/8/usr.sbin/devinfo/ (props changed) stable/8/usr.sbin/fdcontrol/ (props changed) stable/8/usr.sbin/fdformat/ (props changed) stable/8/usr.sbin/fdread/ (props changed) stable/8/usr.sbin/fdwrite/ (props changed) stable/8/usr.sbin/fifolog/ (props changed) stable/8/usr.sbin/flowctl/ (props changed) stable/8/usr.sbin/i2c/ (props changed) stable/8/usr.sbin/mtest/ (props changed) stable/8/usr.sbin/periodic/ (props changed) stable/8/usr.sbin/pmcannotate/ (props changed) stable/8/usr.sbin/pmccontrol/ (props changed) stable/8/usr.sbin/pmcstat/ (props changed) stable/8/usr.sbin/pppctl/ (props changed) stable/8/usr.sbin/service/ (props changed) stable/8/usr.sbin/setfmac/ (props changed) stable/8/usr.sbin/setpmac/ (props changed) stable/8/usr.sbin/smbmsg/ (props changed) stable/8/usr.sbin/uhsoctl/ (props changed) Modified: stable/8/bin/pwait/pwait.1 ============================================================================== --- stable/8/bin/pwait/pwait.1 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/bin/pwait/pwait.1 Fri Aug 27 10:47:17 2010 (r211872) @@ -33,8 +33,8 @@ .\" $FreeBSD$ .\" .Dd November 1, 2009 -.Os .Dt PWAIT 1 +.Os .Sh NAME .Nm pwait .Nd wait for processes to terminate Modified: stable/8/contrib/com_err/compile_et.1 ============================================================================== --- stable/8/contrib/com_err/compile_et.1 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/contrib/com_err/compile_et.1 Fri Aug 27 10:47:17 2010 (r211872) @@ -4,8 +4,8 @@ .\" $FreeBSD$ .\" .Dd November 22, 1988 -.Os .Dt COMPILE_ET 1 +.Os .Sh NAME .Nm compile_et .Nd error table compiler Modified: stable/8/contrib/csup/csup.1 ============================================================================== --- stable/8/contrib/csup/csup.1 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/contrib/csup/csup.1 Fri Aug 27 10:47:17 2010 (r211872) @@ -25,8 +25,8 @@ .\" $FreeBSD$ .\" .Dd February 1, 2006 -.Os FreeBSD .Dt CSUP 1 +.Os FreeBSD .Sh NAME .Nm csup .Nd network distribution package for CVS repositories Modified: stable/8/games/pom/pom.6 ============================================================================== --- stable/8/games/pom/pom.6 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/games/pom/pom.6 Fri Aug 27 10:47:17 2010 (r211872) @@ -34,7 +34,7 @@ .\" .Dd July 14, 2010 .Dt POM 6 -.UC 7 +.Os .Sh NAME .Nm pom .Nd display the phase of the moon Modified: stable/8/gnu/usr.bin/gdb/kgdb/kgdb.1 ============================================================================== --- stable/8/gnu/usr.bin/gdb/kgdb/kgdb.1 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/gnu/usr.bin/gdb/kgdb/kgdb.1 Fri Aug 27 10:47:17 2010 (r211872) @@ -25,8 +25,8 @@ .\" $FreeBSD$ .\" .Dd October 11, 2006 -.Os .Dt KGDB 1 +.Os .Sh NAME .Nm kgdb .Nd "kernel debugger" Modified: stable/8/lib/libarchive/archive_entry.3 ============================================================================== --- stable/8/lib/libarchive/archive_entry.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libarchive/archive_entry.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd May 12, 2008 -.Dt archive_entry 3 +.Dt ARCHIVE_ENTRY 3 .Os .Sh NAME .Nm archive_entry_acl_add_entry , Modified: stable/8/lib/libarchive/archive_read.3 ============================================================================== --- stable/8/lib/libarchive/archive_read.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libarchive/archive_read.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd April 13, 2009 -.Dt archive_read 3 +.Dt ARCHIVE_READ 3 .Os .Sh NAME .Nm archive_read_new , Modified: stable/8/lib/libarchive/archive_read_disk.3 ============================================================================== --- stable/8/lib/libarchive/archive_read_disk.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libarchive/archive_read_disk.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd March 10, 2009 -.Dt archive_read_disk 3 +.Dt ARCHIVE_READ_DISK 3 .Os .Sh NAME .Nm archive_read_disk_new , Modified: stable/8/lib/libarchive/archive_util.3 ============================================================================== --- stable/8/lib/libarchive/archive_util.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libarchive/archive_util.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd January 8, 2005 -.Dt archive_util 3 +.Dt ARCHIVE_UTIL 3 .Os .Sh NAME .Nm archive_clear_error , Modified: stable/8/lib/libarchive/archive_write.3 ============================================================================== --- stable/8/lib/libarchive/archive_write.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libarchive/archive_write.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd May 11, 2008 -.Dt archive_write 3 +.Dt ARCHIVE_WRITE 3 .Os .Sh NAME .Nm archive_write_new , Modified: stable/8/lib/libarchive/archive_write_disk.3 ============================================================================== --- stable/8/lib/libarchive/archive_write_disk.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libarchive/archive_write_disk.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd August 5, 2008 -.Dt archive_write_disk 3 +.Dt ARCHIVE_WRITE_DISK 3 .Os .Sh NAME .Nm archive_write_disk_new , Modified: stable/8/lib/libarchive/libarchive-formats.5 ============================================================================== --- stable/8/lib/libarchive/libarchive-formats.5 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libarchive/libarchive-formats.5 Fri Aug 27 10:47:17 2010 (r211872) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd April 17, 2009 -.Dt libarchive-formats 5 +.Dt LIBARCHIVE-FORMATS 5 .Os .Sh NAME .Nm libarchive-formats Modified: stable/8/lib/libarchive/tar.5 ============================================================================== --- stable/8/lib/libarchive/tar.5 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libarchive/tar.5 Fri Aug 27 10:47:17 2010 (r211872) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd April 19, 2009 -.Dt tar 5 +.Dt TAR 5 .Os .Sh NAME .Nm tar Modified: stable/8/lib/libc/gen/check_utility_compat.3 ============================================================================== --- stable/8/lib/libc/gen/check_utility_compat.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libc/gen/check_utility_compat.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -29,8 +29,8 @@ .\" $FreeBSD$ .\" .Dd October 27, 2002 -.Os .Dt CHECK_UTILITY_COMPAT 3 +.Os .Sh NAME .Nm check_utility_compat .Nd "determine whether a utility should be compatible" Modified: stable/8/lib/libc/gen/dladdr.3 ============================================================================== --- stable/8/lib/libc/gen/dladdr.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libc/gen/dladdr.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -26,8 +26,8 @@ .\" $FreeBSD$ .\" .Dd February 5, 1998 -.Os .Dt DLADDR 3 +.Os .Sh NAME .Nm dladdr .Nd find the shared object containing a given address Modified: stable/8/lib/libc/gen/dlinfo.3 ============================================================================== --- stable/8/lib/libc/gen/dlinfo.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libc/gen/dlinfo.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -26,8 +26,8 @@ .\" $FreeBSD$ .\" .Dd February 14, 2003 -.Os .Dt DLINFO 3 +.Os .Sh NAME .Nm dlinfo .Nd information about dynamically loaded object Modified: stable/8/lib/libc/gen/dllockinit.3 ============================================================================== --- stable/8/lib/libc/gen/dllockinit.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libc/gen/dllockinit.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -26,8 +26,8 @@ .\" $FreeBSD$ .\" .Dd July 5, 2000 -.Os .Dt DLLOCKINIT 3 +.Os .Sh NAME .Nm dllockinit .Nd register thread locking methods with the dynamic linker Modified: stable/8/lib/libc/gen/dlopen.3 ============================================================================== --- stable/8/lib/libc/gen/dlopen.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libc/gen/dlopen.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -33,8 +33,8 @@ .\" $FreeBSD$ .\" .Dd July 7, 2009 -.Os .Dt DLOPEN 3 +.Os .Sh NAME .Nm dlopen , .Nm dlsym , Modified: stable/8/lib/libc/gen/fmtcheck.3 ============================================================================== --- stable/8/lib/libc/gen/fmtcheck.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libc/gen/fmtcheck.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -33,8 +33,8 @@ .\" .\" $FreeBSD$ .Dd October 16, 2002 -.Os .Dt FMTCHECK 3 +.Os .Sh NAME .Nm fmtcheck .Nd sanitizes user-supplied Modified: stable/8/lib/libc/gen/ftok.3 ============================================================================== --- stable/8/lib/libc/gen/ftok.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libc/gen/ftok.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -25,8 +25,8 @@ .\" .\" $FreeBSD$ .Dd July 9, 2009 -.Os .Dt FTOK 3 +.Os .Sh NAME .Nm ftok .Nd create IPC identifier from path name Modified: stable/8/lib/libc/gen/setproctitle.3 ============================================================================== --- stable/8/lib/libc/gen/setproctitle.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libc/gen/setproctitle.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -21,8 +21,8 @@ .\" .\" The following requests are required for all man pages. .Dd December 16, 1995 -.Os .Dt SETPROCTITLE 3 +.Os .Sh NAME .Nm setproctitle .Nd set process title Modified: stable/8/lib/libc/gen/stringlist.3 ============================================================================== --- stable/8/lib/libc/gen/stringlist.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libc/gen/stringlist.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -36,8 +36,8 @@ .\" $FreeBSD$ .\" .Dd November 28, 1999 -.Os .Dt STRINGLIST 3 +.Os .Sh NAME .Nm stringlist , .Nm sl_init , Modified: stable/8/lib/libc/posix1e/mac_prepare.3 ============================================================================== --- stable/8/lib/libc/posix1e/mac_prepare.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libc/posix1e/mac_prepare.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -31,8 +31,8 @@ .\" $FreeBSD$ .\" .Dd August 22, 2003 -.Os .Dt MAC_PREPARE 3 +.Os .Sh NAME .Nm mac_prepare , mac_prepare_type , mac_prepare_file_label , .Nm mac_prepare_ifnet_label , mac_prepare_process_label Modified: stable/8/lib/libc/stdlib/hcreate.3 ============================================================================== --- stable/8/lib/libc/stdlib/hcreate.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libc/stdlib/hcreate.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -29,8 +29,8 @@ .\" $FreeBSD$ .\" .Dd July 6, 2008 -.Os .Dt HCREATE 3 +.Os .Sh NAME .Nm hcreate , hdestroy , hsearch .Nd manage hash search table Modified: stable/8/lib/libc/stdlib/ptsname.3 ============================================================================== --- stable/8/lib/libc/stdlib/ptsname.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libc/stdlib/ptsname.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -32,8 +32,8 @@ .\" $FreeBSD$ .\" .Dd August 20, 2008 -.Os .Dt PTSNAME 3 +.Os .Sh NAME .Nm grantpt , .Nm ptsname , Modified: stable/8/lib/libcam/cam.3 ============================================================================== --- stable/8/lib/libcam/cam.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libcam/cam.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -28,8 +28,8 @@ .\" $FreeBSD$ .\" .Dd October 10, 1998 -.Os .Dt CAM 3 +.Os .Sh NAME .Nm cam_open_device , .Nm cam_open_spec_device , Modified: stable/8/lib/libcam/cam_cdbparse.3 ============================================================================== --- stable/8/lib/libcam/cam_cdbparse.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libcam/cam_cdbparse.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -62,8 +62,8 @@ .\" .\" .Dd October 13, 1998 -.Os .Dt CAM_CDBPARSE 3 +.Os .Sh NAME .Nm csio_build , .Nm csio_build_visit , Modified: stable/8/lib/libcompat/4.1/cftime.3 ============================================================================== --- stable/8/lib/libcompat/4.1/cftime.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libcompat/4.1/cftime.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -35,8 +35,8 @@ .\" $FreeBSD$ .\" .Dd June 15, 1993 -.Os .Dt CFTIME 3 +.Os .Sh NAME .Nm cftime , .Nm ascftime Modified: stable/8/lib/libcompat/4.4/cuserid.3 ============================================================================== --- stable/8/lib/libcompat/4.4/cuserid.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libcompat/4.4/cuserid.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -32,8 +32,8 @@ .\" $FreeBSD$ .\" .Dd April 10, 1995 -.Os .Dt CUSERID 3 +.Os .Sh NAME .Nm cuserid .Nd get user name associated with effective UID Modified: stable/8/lib/libedit/editline.3 ============================================================================== --- stable/8/lib/libedit/editline.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libedit/editline.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -32,8 +32,8 @@ .\" $FreeBSD$ .\" .Dd January 12, 2007 -.Os .Dt EDITLINE 3 +.Os .Sh NAME .Nm editline , .Nm el_init , Modified: stable/8/lib/libedit/editrc.5 ============================================================================== --- stable/8/lib/libedit/editrc.5 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libedit/editrc.5 Fri Aug 27 10:47:17 2010 (r211872) @@ -32,8 +32,8 @@ .\" $FreeBSD$ .\" .Dd October 18, 2003 -.Os .Dt EDITRC 5 +.Os .Sh NAME .Nm editrc .Nd configuration file for editline library Modified: stable/8/lib/libelf/elf.3 ============================================================================== --- stable/8/lib/libelf/elf.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd October 21, 2007 -.Os .Dt ELF 3 +.Os .Sh NAME .Nm elf .Nd API for manipulating ELF objects Modified: stable/8/lib/libelf/elf_begin.3 ============================================================================== --- stable/8/lib/libelf/elf_begin.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf_begin.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd June 21, 2006 -.Os .Dt ELF_BEGIN 3 +.Os .Sh NAME .Nm elf_begin .Nd open an ELF file or ar(1) archive Modified: stable/8/lib/libelf/elf_cntl.3 ============================================================================== --- stable/8/lib/libelf/elf_cntl.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf_cntl.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 9, 2006 -.Os .Dt ELF_CNTL 3 +.Os .Sh NAME .Nm elf_cntl .Nd control an elf file descriptor Modified: stable/8/lib/libelf/elf_end.3 ============================================================================== --- stable/8/lib/libelf/elf_end.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf_end.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd June 29, 2006 -.Os .Dt ELF_END 3 +.Os .Sh NAME .Nm elf_end .Nd release an ELF descriptor Modified: stable/8/lib/libelf/elf_errmsg.3 ============================================================================== --- stable/8/lib/libelf/elf_errmsg.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf_errmsg.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd June 11, 2006 -.Os .Dt ELF_ERRMSG 3 +.Os .Sh NAME .Nm elf_errmsg , .Nm elf_errno Modified: stable/8/lib/libelf/elf_fill.3 ============================================================================== --- stable/8/lib/libelf/elf_fill.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf_fill.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd June 11, 2006 -.Os .Dt ELF_FILL 3 +.Os .Sh NAME .Nm elf_fill .Nd set fill byte for inter-section padding Modified: stable/8/lib/libelf/elf_flagdata.3 ============================================================================== --- stable/8/lib/libelf/elf_flagdata.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf_flagdata.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd October 22, 2007 -.Os .Dt ELF_FLAGDATA 3 +.Os .Sh NAME .Nm elf_flagdata , .Nm elf_flagehdr , Modified: stable/8/lib/libelf/elf_getarhdr.3 ============================================================================== --- stable/8/lib/libelf/elf_getarhdr.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf_getarhdr.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 15, 2006 -.Os .Dt ELF_GETARHDR 3 +.Os .Sh NAME .Nm elf_getarhdr .Nd retrieve ar(1) header for an archive member Modified: stable/8/lib/libelf/elf_getarsym.3 ============================================================================== --- stable/8/lib/libelf/elf_getarsym.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf_getarsym.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 15, 2006 -.Os .Dt ELF_GETARSYM 3 +.Os .Sh NAME .Nm elf_getarsym .Nd retrieve the symbol table of an archive Modified: stable/8/lib/libelf/elf_getbase.3 ============================================================================== --- stable/8/lib/libelf/elf_getbase.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf_getbase.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd June 6, 2010 -.Os .Dt ELF_GETBASE 3 +.Os .Sh NAME .Nm elf_getbase .Nd get the base offset for an object file Modified: stable/8/lib/libelf/elf_getdata.3 ============================================================================== --- stable/8/lib/libelf/elf_getdata.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf_getdata.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 26, 2006 -.Os .Dt ELF_GETDATA 3 +.Os .Sh NAME .Nm elf_getdata , .Nm elf_newdata , Modified: stable/8/lib/libelf/elf_getident.3 ============================================================================== --- stable/8/lib/libelf/elf_getident.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf_getident.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd July 3, 2006 -.Os .Dt ELF_GETIDENT 3 +.Os .Sh NAME .Nm elf_getident .Nd return the initial bytes of a file Modified: stable/8/lib/libelf/elf_getphnum.3 ============================================================================== --- stable/8/lib/libelf/elf_getphnum.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf_getphnum.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd December 16, 2006 -.Os .Dt ELF_GETPHNUM 3 +.Os .Sh NAME .Nm elf_getphnum .Nd return the number of program headers in an ELF file Modified: stable/8/lib/libelf/elf_getscn.3 ============================================================================== --- stable/8/lib/libelf/elf_getscn.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf_getscn.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd October 22, 2007 -.Os .Dt ELF_GETSCN 3 +.Os .Sh NAME .Nm elf_getscn , .Nm elf_ndxscn , Modified: stable/8/lib/libelf/elf_getshnum.3 ============================================================================== --- stable/8/lib/libelf/elf_getshnum.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf_getshnum.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd October 31, 2006 -.Os .Dt ELF_GETSHNUM 3 +.Os .Sh NAME .Nm elf_getshnum .Nd return the number of sections in an ELF file Modified: stable/8/lib/libelf/elf_getshstrndx.3 ============================================================================== --- stable/8/lib/libelf/elf_getshstrndx.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf_getshstrndx.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd October 31, 2006 -.Os .Dt ELF_GETSHSTRNDX 3 +.Os .Sh NAME .Nm elf_getshstrndx , .Nm elf_setshstrndx Modified: stable/8/lib/libelf/elf_hash.3 ============================================================================== --- stable/8/lib/libelf/elf_hash.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf_hash.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 15, 2006 -.Os .Dt ELF_HASH 3 +.Os .Sh NAME .Nm elf_hash .Nd compute a hash value for a string Modified: stable/8/lib/libelf/elf_kind.3 ============================================================================== --- stable/8/lib/libelf/elf_kind.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf_kind.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd June 1, 2006 -.Os .Dt ELF_KIND 3 +.Os .Sh NAME .Nm elf_kind .Nd determine ELF file type Modified: stable/8/lib/libelf/elf_memory.3 ============================================================================== --- stable/8/lib/libelf/elf_memory.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf_memory.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd June 28, 2006 -.Os .Dt ELF_MEMORY 3 +.Os .Sh NAME .Nm elf_memory .Nd process an ELF or ar(1) archive mapped into memory Modified: stable/8/lib/libelf/elf_next.3 ============================================================================== --- stable/8/lib/libelf/elf_next.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf_next.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd June 17, 2006 -.Os .Dt ELF_NEXT 3 +.Os .Sh NAME .Nm elf_next .Nd provide sequential access to the next archive member Modified: stable/8/lib/libelf/elf_rand.3 ============================================================================== --- stable/8/lib/libelf/elf_rand.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf_rand.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd June 17, 2006 -.Os .Dt ELF_RAND 3 +.Os .Sh NAME .Nm elf_rand .Nd provide sequential access to the next archive member Modified: stable/8/lib/libelf/elf_rawfile.3 ============================================================================== --- stable/8/lib/libelf/elf_rawfile.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf_rawfile.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd July 3, 2006 -.Os .Dt ELF_RAWFILE 3 +.Os .Sh NAME .Nm elf_rawfile .Nd return uninterpreted contents of an ELF file Modified: stable/8/lib/libelf/elf_strptr.3 ============================================================================== --- stable/8/lib/libelf/elf_strptr.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf_strptr.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd December 16, 2006 -.Os .Dt ELF_STRPTR 3 +.Os .Sh NAME .Nm elf_strptr .Nd retrieve a string pointer in a string table Modified: stable/8/lib/libelf/elf_update.3 ============================================================================== --- stable/8/lib/libelf/elf_update.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf_update.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd March 19, 2008 -.Os .Dt ELF_UPDATE 3 +.Os .Sh NAME .Nm elf_update .Nd update an ELF descriptor Modified: stable/8/lib/libelf/elf_version.3 ============================================================================== --- stable/8/lib/libelf/elf_version.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/elf_version.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd June 1, 2006 -.Os .Dt ELF_VERSION 3 +.Os .Sh NAME .Nm elf_version .Nd retrieve or set ELF library operating version Modified: stable/8/lib/libelf/gelf.3 ============================================================================== --- stable/8/lib/libelf/gelf.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/gelf.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd September 1, 2006 -.Os .Dt GELF 3 +.Os .Sh NAME .Nm GElf .Nd class-independent API for ELF manipulation Modified: stable/8/lib/libelf/gelf_checksum.3 ============================================================================== --- stable/8/lib/libelf/gelf_checksum.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/gelf_checksum.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 29, 2006 -.Os .Dt GELF_CHECKSUM 3 +.Os .Sh NAME .Nm elf32_checksum , .Nm elf64_checksum , Modified: stable/8/lib/libelf/gelf_fsize.3 ============================================================================== --- stable/8/lib/libelf/gelf_fsize.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/gelf_fsize.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd February 5, 2008 -.Os .Dt GELF_FSIZE 3 +.Os .Sh NAME .Nm gelf_fsize , .Nm elf32_fsize , Modified: stable/8/lib/libelf/gelf_getcap.3 ============================================================================== --- stable/8/lib/libelf/gelf_getcap.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/gelf_getcap.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 29, 2006 -.Os .Dt GELF_GETCAP 3 +.Os .Sh NAME .Nm gelf_getcap , .Nm gelf_update_cap Modified: stable/8/lib/libelf/gelf_getclass.3 ============================================================================== --- stable/8/lib/libelf/gelf_getclass.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/gelf_getclass.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd July 3, 2006 -.Os .Dt GELF_GETCLASS 3 +.Os .Sh NAME .Nm gelf_getclass .Nd retrieve the class of an ELF descriptor Modified: stable/8/lib/libelf/gelf_getdyn.3 ============================================================================== --- stable/8/lib/libelf/gelf_getdyn.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/gelf_getdyn.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 29, 2006 -.Os .Dt GELF_GETDYN 3 +.Os .Sh NAME .Nm gelf_getdyn , .Nm gelf_update_dyn Modified: stable/8/lib/libelf/gelf_getehdr.3 ============================================================================== --- stable/8/lib/libelf/gelf_getehdr.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/gelf_getehdr.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd December 16, 2006 -.Os .Dt GELF_GETEHDR 3 +.Os .Sh NAME .Nm elf32_getehdr , .Nm elf64_getehdr , Modified: stable/8/lib/libelf/gelf_getmove.3 ============================================================================== --- stable/8/lib/libelf/gelf_getmove.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/gelf_getmove.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 29, 2006 -.Os .Dt GELF_GETMOVE 3 +.Os .Sh NAME .Nm gelf_getmove , .Nm gelf_update_move Modified: stable/8/lib/libelf/gelf_getphdr.3 ============================================================================== --- stable/8/lib/libelf/gelf_getphdr.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/gelf_getphdr.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd October 21, 2007 -.Os .Dt GELF_GETPHDR 3 +.Os .Sh NAME .Nm elf32_getphdr , .Nm elf64_getphdr , Modified: stable/8/lib/libelf/gelf_getrel.3 ============================================================================== --- stable/8/lib/libelf/gelf_getrel.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/gelf_getrel.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 29, 2006 -.Os .Dt GELF_GETREL 3 +.Os .Sh NAME .Nm gelf_getrel , .Nm gelf_update_rel Modified: stable/8/lib/libelf/gelf_getrela.3 ============================================================================== --- stable/8/lib/libelf/gelf_getrela.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/gelf_getrela.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 29, 2006 -.Os .Dt GELF_GETRELA 3 +.Os .Sh NAME .Nm gelf_getrela , .Nm gelf_update_rela Modified: stable/8/lib/libelf/gelf_getshdr.3 ============================================================================== --- stable/8/lib/libelf/gelf_getshdr.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/gelf_getshdr.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 27, 2006 -.Os .Dt GELF_GETSHDR 3 +.Os .Sh NAME .Nm elf32_getshdr , .Nm elf64_getshdr , Modified: stable/8/lib/libelf/gelf_getsym.3 ============================================================================== --- stable/8/lib/libelf/gelf_getsym.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/gelf_getsym.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 29, 2006 -.Os .Dt GELF_GETSYM 3 +.Os .Sh NAME .Nm gelf_getsym , .Nm gelf_update_sym Modified: stable/8/lib/libelf/gelf_getsyminfo.3 ============================================================================== --- stable/8/lib/libelf/gelf_getsyminfo.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/gelf_getsyminfo.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 29, 2006 -.Os .Dt GELF_GETSYMINFO 3 +.Os .Sh NAME .Nm gelf_getsyminfo , .Nm gelf_update_syminfo Modified: stable/8/lib/libelf/gelf_getsymshndx.3 ============================================================================== --- stable/8/lib/libelf/gelf_getsymshndx.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/gelf_getsymshndx.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd November 5, 2006 -.Os .Dt GELF_GETSYMSHNDX 3 +.Os .Sh NAME .Nm gelf_getsymshndx , .Nm gelf_update_symshndx Modified: stable/8/lib/libelf/gelf_newehdr.3 ============================================================================== --- stable/8/lib/libelf/gelf_newehdr.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/gelf_newehdr.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd October 22, 2007 -.Os .Dt GELF_NEWEHDR 3 +.Os .Sh NAME .Nm elf32_newehdr , .Nm elf64_newehdr , Modified: stable/8/lib/libelf/gelf_newphdr.3 ============================================================================== --- stable/8/lib/libelf/gelf_newphdr.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/gelf_newphdr.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd October 22, 2007 -.Os .Dt GELF_NEWPHDR 3 +.Os .Sh NAME .Nm elf32_newphdr , .Nm elf64_newphdr , Modified: stable/8/lib/libelf/gelf_update_ehdr.3 ============================================================================== --- stable/8/lib/libelf/gelf_update_ehdr.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/gelf_update_ehdr.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd August 27, 2006 -.Os .Dt GELF_UPDATE_EHDR 3 +.Os .Sh NAME .Nm gelf_update_ehdr , .Nm gelf_update_phdr , Modified: stable/8/lib/libelf/gelf_xlatetof.3 ============================================================================== --- stable/8/lib/libelf/gelf_xlatetof.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libelf/gelf_xlatetof.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -24,8 +24,8 @@ .\" $FreeBSD$ .\" .Dd July 24, 2006 -.Os .Dt GELF_XLATETOF 3 +.Os .Sh NAME .Nm elf32_xlate , .Nm elf64_xlate , Modified: stable/8/lib/libgssapi/gss_accept_sec_context.3 ============================================================================== --- stable/8/lib/libgssapi/gss_accept_sec_context.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libgssapi/gss_accept_sec_context.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_ACCEPT_SEC_CONTEXT 3 PRM +.Os .Sh NAME .Nm gss_accept_sec_context .Nd Accept a security context initiated by a peer application Modified: stable/8/lib/libgssapi/gss_acquire_cred.3 ============================================================================== --- stable/8/lib/libgssapi/gss_acquire_cred.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libgssapi/gss_acquire_cred.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_ACQUIRE_CRED 3 PRM +.Os .Sh NAME .Nm gss_acquire_cred .Nd Obtain a GSS-API credential handle for pre-existing credentials Modified: stable/8/lib/libgssapi/gss_add_cred.3 ============================================================================== --- stable/8/lib/libgssapi/gss_add_cred.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libgssapi/gss_add_cred.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_ADD_CRED 3 PRM +.Os .Sh NAME .Nm gss_add_cred .Nd Construct credentials incrementally Modified: stable/8/lib/libgssapi/gss_add_oid_set_member.3 ============================================================================== --- stable/8/lib/libgssapi/gss_add_oid_set_member.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libgssapi/gss_add_oid_set_member.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_ADD_OID_SET_MEMBER 3 PRM +.Os .Sh NAME .Nm gss_add_oid_set_member .Nd Add an object identifier to a set Modified: stable/8/lib/libgssapi/gss_canonicalize_name.3 ============================================================================== --- stable/8/lib/libgssapi/gss_canonicalize_name.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libgssapi/gss_canonicalize_name.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_CANONICALIZE_NAME 3 PRM +.Os .Sh NAME .Nm gss_canonicalize_name .Nd Convert an internal name to an MN Modified: stable/8/lib/libgssapi/gss_compare_name.3 ============================================================================== --- stable/8/lib/libgssapi/gss_compare_name.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libgssapi/gss_compare_name.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 +.Dt GSS_COMPARE_NAME 3 PRM .Os -.Dt GSS_COMPARE_NAME PRM .Sh NAME .Nm gss_compare_name .Nd Compare two internal-form names Modified: stable/8/lib/libgssapi/gss_context_time.3 ============================================================================== --- stable/8/lib/libgssapi/gss_context_time.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libgssapi/gss_context_time.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_CONTEXT_TIME 3 PRM +.Os .Sh NAME .Nm gss_context_time .Nd Determine for how long a context will remain valid Modified: stable/8/lib/libgssapi/gss_create_empty_oid_set.3 ============================================================================== --- stable/8/lib/libgssapi/gss_create_empty_oid_set.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libgssapi/gss_create_empty_oid_set.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_CREATE_EMPTY_OID_SET 3 PRM +.Os .Sh NAME .Nm gss_create_empty_oid_set .Nd Create a set containing no object identifiers Modified: stable/8/lib/libgssapi/gss_delete_sec_context.3 ============================================================================== --- stable/8/lib/libgssapi/gss_delete_sec_context.3 Fri Aug 27 10:16:32 2010 (r211871) +++ stable/8/lib/libgssapi/gss_delete_sec_context.3 Fri Aug 27 10:47:17 2010 (r211872) @@ -28,8 +28,8 @@ .\" .\" The following commands are required for all man pages. .Dd January 26, 2010 -.Os .Dt GSS_DELETE_SEC_CONTEXT 3 PRM +.Os .Sh NAME .Nm gss_delete_sec_context .Nd Discard a security context Modified: stable/8/lib/libgssapi/gss_display_name.3 ============================================================================== --- stable/8/lib/libgssapi/gss_display_name.3 Fri Aug 27 10:16:32 2010 (r211871) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 11:08:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFEE9106564A; Fri, 27 Aug 2010 11:08:11 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF2C08FC08; Fri, 27 Aug 2010 11:08:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RB8B1s075964; Fri, 27 Aug 2010 11:08:11 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RB8Bhv075962; Fri, 27 Aug 2010 11:08:11 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201008271108.o7RB8Bhv075962@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 27 Aug 2010 11:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211873 - head/sbin/bsdlabel X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 11:08:12 -0000 Author: jh Date: Fri Aug 27 11:08:11 2010 New Revision: 211873 URL: http://svn.freebsd.org/changeset/base/211873 Log: Don't attempt to write label with GEOM_BSD based method if the class is not available. This improves error reporting when bsdlabel(8) is unable to open a device for writing. If GEOM_BSD was unavailable, only a rather obscure error message "Class not found" was printed. PR: bin/58390 Reviewed by: ae Discussed with: marcel MFC after: 1 month Modified: head/sbin/bsdlabel/bsdlabel.c Modified: head/sbin/bsdlabel/bsdlabel.c ============================================================================== --- head/sbin/bsdlabel/bsdlabel.c Fri Aug 27 10:47:17 2010 (r211872) +++ head/sbin/bsdlabel/bsdlabel.c Fri Aug 27 11:08:11 2010 (r211873) @@ -80,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include "pathnames.h" static void makelabel(const char *, struct disklabel *); +static int geom_bsd_available(void); static int writelabel(void); static int readlabel(int flag); static void display(FILE *, const struct disklabel *); @@ -379,10 +380,33 @@ readboot(void) } static int +geom_bsd_available(void) +{ + struct gclass *class; + struct gmesh mesh; + int error; + + error = geom_gettree(&mesh); + if (error != 0) + errc(1, error, "Cannot get GEOM tree"); + + LIST_FOREACH(class, &mesh.lg_class, lg_class) { + if (strcmp(class->lg_name, "BSD") == 0) { + geom_deletetree(&mesh); + return (1); + } + } + + geom_deletetree(&mesh); + + return (0); +} + +static int writelabel(void) { uint64_t *p, sum; - int i, fd; + int i, fd, serrno; struct gctl_req *grq; char const *errstr; struct disklabel *lp = &lab; @@ -416,6 +440,13 @@ writelabel(void) if (is_file) { warn("cannot open file %s for writing label", specname); return(1); + } else + serrno = errno; + + /* Give up if GEOM_BSD is not available. */ + if (geom_bsd_available() == 0) { + warnc(serrno, "%s", specname); + return (1); } grq = gctl_get_handle(); From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 12:34:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEADD1065694; Fri, 27 Aug 2010 12:34:53 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE9578FC1A; Fri, 27 Aug 2010 12:34:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RCYra2077945; Fri, 27 Aug 2010 12:34:53 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RCYrl3077943; Fri, 27 Aug 2010 12:34:53 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201008271234.o7RCYrl3077943@svn.freebsd.org> From: Andre Oppermann Date: Fri, 27 Aug 2010 12:34:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211874 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 12:34:53 -0000 Author: andre Date: Fri Aug 27 12:34:53 2010 New Revision: 211874 URL: http://svn.freebsd.org/changeset/base/211874 Log: Use timestamp modulo comparison macro for automatic receive buffer scaling to correctly handle wrapping of ticks value. MFC after: 1 week Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Fri Aug 27 11:08:11 2010 (r211873) +++ head/sys/netinet/tcp_input.c Fri Aug 27 12:34:53 2010 (r211874) @@ -1441,7 +1441,7 @@ tcp_do_segment(struct mbuf *m, struct tc if (V_tcp_do_autorcvbuf && to.to_tsecr && (so->so_rcv.sb_flags & SB_AUTOSIZE)) { - if (to.to_tsecr > tp->rfbuf_ts && + if (TSTMP_GT(to.to_tsecr, tp->rfbuf_ts) && to.to_tsecr - tp->rfbuf_ts < hz) { if (tp->rfbuf_cnt > (so->so_rcv.sb_hiwat / 8 * 7) && From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 13:53:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 473841065672; Fri, 27 Aug 2010 13:53:20 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id E022C8FC15; Fri, 27 Aug 2010 13:53:19 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 66F4B45DD8; Fri, 27 Aug 2010 15:53:17 +0200 (CEST) Received: from localhost (pdawidek.whl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 6E12E45CA6; Fri, 27 Aug 2010 15:53:11 +0200 (CEST) Date: Fri, 27 Aug 2010 15:53:05 +0200 From: Pawel Jakub Dawidek To: David Xu Message-ID: <20100827135305.GB1884@garage.freebsd.pl> References: <201008270323.o7R3N7EP062038@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="24zk1gE8NUlDmwG9" Content-Disposition: inline In-Reply-To: <201008270323.o7R3N7EP062038@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211859 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 13:53:20 -0000 --24zk1gE8NUlDmwG9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 27, 2010 at 03:23:07AM +0000, David Xu wrote: [...] Hi David. While you at libthr... I found implementation of _pthread_mutex_isowned_np(), which makes me wonder: int _pthread_mutex_isowned_np(pthread_mutex_t *mutex) { struct pthread *curthread =3D _get_curthread(); int ret; if (__predict_false(*mutex =3D=3D NULL)) { ret =3D init_static(curthread, mutex); if (__predict_false(ret)) return (ret); } return ((*mutex)->m_owner =3D=3D curthread); } When init_static() fails, the caller will interpret the answer as 'true', which seems wrong. What does this if statement do exactly? It initializes mutex if it isn't? If so, can't we simply assert that it has to be initialized? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --24zk1gE8NUlDmwG9 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkx3w0EACgkQForvXbEpPzSw0ACeIx4QaDmnoP7j7cYEWGU2+TLn tqYAn2giJzmXTmqxudaZhLb68WLoQZoG =C3ol -----END PGP SIGNATURE----- --24zk1gE8NUlDmwG9-- From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 13:54:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58C2910656A3; Fri, 27 Aug 2010 13:54:17 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48C0B8FC23; Fri, 27 Aug 2010 13:54:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RDsHmX079651; Fri, 27 Aug 2010 13:54:17 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RDsHa2079649; Fri, 27 Aug 2010 13:54:17 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008271354.o7RDsHa2079649@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 27 Aug 2010 13:54:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211875 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 13:54:17 -0000 Author: pjd Date: Fri Aug 27 13:54:17 2010 New Revision: 211875 URL: http://svn.freebsd.org/changeset/base/211875 Log: Make comment more readable. MFC after: 2 weeks Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com Modified: head/sbin/hastd/proto_tcp4.c Modified: head/sbin/hastd/proto_tcp4.c ============================================================================== --- head/sbin/hastd/proto_tcp4.c Fri Aug 27 12:34:53 2010 (r211874) +++ head/sbin/hastd/proto_tcp4.c Fri Aug 27 13:54:17 2010 (r211875) @@ -242,8 +242,8 @@ tcp4_connect(void *ctx) return (errno); } /* - * We make socket non-blocking so we have decided about connection - * timeout. + * We make socket non-blocking so we can handle connection timeout + * manually. */ flags |= O_NONBLOCK; if (fcntl(tctx->tc_fd, F_SETFL, flags) == -1) { From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 13:58:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5522B1065696; Fri, 27 Aug 2010 13:58:38 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 454058FC13; Fri, 27 Aug 2010 13:58:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RDwcWc079787; Fri, 27 Aug 2010 13:58:38 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RDwcB4079785; Fri, 27 Aug 2010 13:58:38 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008271358.o7RDwcB4079785@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 27 Aug 2010 13:58:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211876 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 13:58:38 -0000 Author: pjd Date: Fri Aug 27 13:58:38 2010 New Revision: 211876 URL: http://svn.freebsd.org/changeset/base/211876 Log: Add mtx_owned() implementation. MFC after: 2 weeks Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com Modified: head/sbin/hastd/synch.h Modified: head/sbin/hastd/synch.h ============================================================================== --- head/sbin/hastd/synch.h Fri Aug 27 13:54:17 2010 (r211875) +++ head/sbin/hastd/synch.h Fri Aug 27 13:58:38 2010 (r211876) @@ -33,7 +33,9 @@ #define _SYNCH_H_ #include +#include #include +#include #include #include @@ -70,6 +72,12 @@ mtx_unlock(pthread_mutex_t *lock) error = pthread_mutex_unlock(lock); assert(error == 0); } +static __inline bool +mtx_owned(pthread_mutex_t *lock) +{ + + return (pthread_mutex_isowned_np(lock) != 0); +} static __inline void rw_init(pthread_rwlock_t *lock) From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 14:01:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94EE4106567A; Fri, 27 Aug 2010 14:01:28 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8438E8FC08; Fri, 27 Aug 2010 14:01:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RE1SYm079906; Fri, 27 Aug 2010 14:01:28 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RE1Sm9079904; Fri, 27 Aug 2010 14:01:28 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008271401.o7RE1Sm9079904@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 27 Aug 2010 14:01:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211877 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 14:01:28 -0000 Author: pjd Date: Fri Aug 27 14:01:28 2010 New Revision: 211877 URL: http://svn.freebsd.org/changeset/base/211877 Log: Add QUEUE_INSERT() and QUEUE_TAKE() macros that simplify the code a bit. MFC after: 2 weeks Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com Modified: head/sbin/hastd/secondary.c Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Fri Aug 27 13:58:38 2010 (r211876) +++ head/sbin/hastd/secondary.c Fri Aug 27 14:01:28 2010 (r211877) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2009-2010 The FreeBSD Foundation + * Copyright (c) 2010 Pawel Jakub Dawidek * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from @@ -102,6 +103,26 @@ static void *recv_thread(void *arg); static void *disk_thread(void *arg); static void *send_thread(void *arg); +#define QUEUE_INSERT(name, hio) do { \ + bool _wakeup; \ + \ + mtx_lock(&hio_##name##_list_lock); \ + _wakeup = TAILQ_EMPTY(&hio_##name##_list); \ + TAILQ_INSERT_TAIL(&hio_##name##_list, (hio), hio_next); \ + mtx_unlock(&hio_##name##_list_lock); \ + if (_wakeup) \ + cv_signal(&hio_##name##_list_cond); \ +} while (0) +#define QUEUE_TAKE(name, hio) do { \ + mtx_lock(&hio_##name##_list_lock); \ + while (((hio) = TAILQ_FIRST(&hio_##name##_list)) == NULL) { \ + cv_wait(&hio_##name##_list_cond, \ + &hio_##name##_list_lock); \ + } \ + TAILQ_REMOVE(&hio_##name##_list, (hio), hio_next); \ + mtx_unlock(&hio_##name##_list_lock); \ +} while (0) + static void init_environment(void) { @@ -478,24 +499,22 @@ recv_thread(void *arg) { struct hast_resource *res = arg; struct hio *hio; - bool wakeup; for (;;) { pjdlog_debug(2, "recv: Taking free request."); - mtx_lock(&hio_free_list_lock); - while ((hio = TAILQ_FIRST(&hio_free_list)) == NULL) { - pjdlog_debug(2, "recv: No free requests, waiting."); - cv_wait(&hio_free_list_cond, &hio_free_list_lock); - } - TAILQ_REMOVE(&hio_free_list, hio, hio_next); - mtx_unlock(&hio_free_list_lock); + QUEUE_TAKE(free, hio); pjdlog_debug(2, "recv: (%p) Got request.", hio); if (hast_proto_recv_hdr(res->hr_remotein, &hio->hio_nv) < 0) { pjdlog_exit(EX_TEMPFAIL, "Unable to receive request header"); } - if (requnpack(res, hio) != 0) - goto send_queue; + if (requnpack(res, hio) != 0) { + pjdlog_debug(2, + "recv: (%p) Moving request to the send queue.", + hio); + QUEUE_INSERT(send, hio); + continue; + } reqlog(LOG_DEBUG, 2, -1, hio, "recv: (%p) Got request header: ", hio); if (hio->hio_cmd == HIO_WRITE) { @@ -507,22 +526,7 @@ recv_thread(void *arg) } pjdlog_debug(2, "recv: (%p) Moving request to the disk queue.", hio); - mtx_lock(&hio_disk_list_lock); - wakeup = TAILQ_EMPTY(&hio_disk_list); - TAILQ_INSERT_TAIL(&hio_disk_list, hio, hio_next); - mtx_unlock(&hio_disk_list_lock); - if (wakeup) - cv_signal(&hio_disk_list_cond); - continue; -send_queue: - pjdlog_debug(2, "recv: (%p) Moving request to the send queue.", - hio); - mtx_lock(&hio_send_list_lock); - wakeup = TAILQ_EMPTY(&hio_send_list); - TAILQ_INSERT_TAIL(&hio_send_list, hio, hio_next); - mtx_unlock(&hio_send_list_lock); - if (wakeup) - cv_signal(&hio_send_list_cond); + QUEUE_INSERT(disk, hio); } /* NOTREACHED */ return (NULL); @@ -538,19 +542,13 @@ disk_thread(void *arg) struct hast_resource *res = arg; struct hio *hio; ssize_t ret; - bool clear_activemap, wakeup; + bool clear_activemap; clear_activemap = true; for (;;) { pjdlog_debug(2, "disk: Taking request."); - mtx_lock(&hio_disk_list_lock); - while ((hio = TAILQ_FIRST(&hio_disk_list)) == NULL) { - pjdlog_debug(2, "disk: No requests, waiting."); - cv_wait(&hio_disk_list_cond, &hio_disk_list_lock); - } - TAILQ_REMOVE(&hio_disk_list, hio, hio_next); - mtx_unlock(&hio_disk_list_lock); + QUEUE_TAKE(disk, hio); while (clear_activemap) { unsigned char *map; size_t mapsize; @@ -628,12 +626,7 @@ disk_thread(void *arg) } pjdlog_debug(2, "disk: (%p) Moving request to the send queue.", hio); - mtx_lock(&hio_send_list_lock); - wakeup = TAILQ_EMPTY(&hio_send_list); - TAILQ_INSERT_TAIL(&hio_send_list, hio, hio_next); - mtx_unlock(&hio_send_list_lock); - if (wakeup) - cv_signal(&hio_send_list_cond); + QUEUE_INSERT(send, hio); } /* NOTREACHED */ return (NULL); @@ -650,17 +643,10 @@ send_thread(void *arg) struct hio *hio; void *data; size_t length; - bool wakeup; for (;;) { pjdlog_debug(2, "send: Taking request."); - mtx_lock(&hio_send_list_lock); - while ((hio = TAILQ_FIRST(&hio_send_list)) == NULL) { - pjdlog_debug(2, "send: No requests, waiting."); - cv_wait(&hio_send_list_cond, &hio_send_list_lock); - } - TAILQ_REMOVE(&hio_send_list, hio, hio_next); - mtx_unlock(&hio_send_list_lock); + QUEUE_TAKE(send, hio); reqlog(LOG_DEBUG, 2, -1, hio, "send: (%p) Got request: ", hio); nvout = nv_alloc(); /* Copy sequence number. */ @@ -697,12 +683,7 @@ send_thread(void *arg) hio); nv_free(hio->hio_nv); hio->hio_error = 0; - mtx_lock(&hio_free_list_lock); - wakeup = TAILQ_EMPTY(&hio_free_list); - TAILQ_INSERT_TAIL(&hio_free_list, hio, hio_next); - mtx_unlock(&hio_free_list_lock); - if (wakeup) - cv_signal(&hio_free_list_cond); + QUEUE_INSERT(free, hio); } /* NOTREACHED */ return (NULL); From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 14:06:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7D221065698; Fri, 27 Aug 2010 14:06:00 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B79838FC12; Fri, 27 Aug 2010 14:06:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RE60tl080044; Fri, 27 Aug 2010 14:06:00 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RE60Vf080042; Fri, 27 Aug 2010 14:06:00 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008271406.o7RE60Vf080042@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 27 Aug 2010 14:06:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211878 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 14:06:00 -0000 Author: pjd Date: Fri Aug 27 14:06:00 2010 New Revision: 211878 URL: http://svn.freebsd.org/changeset/base/211878 Log: We have sync_start() function to start synchronization, introduce sync_stop() function to stop it. MFC after: 2 weeks Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Fri Aug 27 14:01:28 2010 (r211877) +++ head/sbin/hastd/primary.c Fri Aug 27 14:06:00 2010 (r211878) @@ -686,6 +686,16 @@ sync_start(void) } static void +sync_stop(void) +{ + + mtx_lock(&sync_lock); + if (sync_inprogress) + sync_inprogress = false; + mtx_unlock(&sync_lock); +} + +static void init_ggate(struct hast_resource *res) { struct g_gate_ctl_create ggiocreate; @@ -871,10 +881,7 @@ remote_close(struct hast_resource *res, /* * Stop synchronization if in-progress. */ - mtx_lock(&sync_lock); - if (sync_inprogress) - sync_inprogress = false; - mtx_unlock(&sync_lock); + sync_stop(); /* * Wake up guard thread, so it can immediately start reconnect. @@ -1526,9 +1533,7 @@ sync_thread(void *arg __unused) } } if (offset < 0) { - mtx_lock(&sync_lock); - sync_inprogress = false; - mtx_unlock(&sync_lock); + sync_stop(); pjdlog_debug(1, "Nothing to synchronize."); /* * Synchronization complete, make both localcnt and From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 14:08:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82F5E10656AE; Fri, 27 Aug 2010 14:08:10 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 730708FC28; Fri, 27 Aug 2010 14:08:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RE8A6w080120; Fri, 27 Aug 2010 14:08:10 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RE8AUh080118; Fri, 27 Aug 2010 14:08:10 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008271408.o7RE8AUh080118@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 27 Aug 2010 14:08:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211879 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 14:08:10 -0000 Author: pjd Date: Fri Aug 27 14:08:10 2010 New Revision: 211879 URL: http://svn.freebsd.org/changeset/base/211879 Log: Log that synchronization was interrupted in a proper place. MFC after: 2 weeks Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Fri Aug 27 14:06:00 2010 (r211878) +++ head/sbin/hastd/primary.c Fri Aug 27 14:08:10 2010 (r211879) @@ -1495,10 +1495,17 @@ sync_thread(void *arg __unused) ncomps = HAST_NCOMPONENTS; dorewind = true; - synced = 0; + synced = -1; for (;;) { mtx_lock(&sync_lock); + if (synced == -1) + synced = 0; + else if (!sync_inprogress) { + pjdlog_info("Synchronization interrupted. " + "%jd bytes synchronized so far.", + (intmax_t)synced); + } while (!sync_inprogress) { dorewind = true; synced = 0; @@ -1559,10 +1566,6 @@ sync_thread(void *arg __unused) (uintmax_t)res->hr_secondary_localcnt); (void)metadata_write(res); mtx_unlock(&metadata_lock); - } else if (synced > 0) { - pjdlog_info("Synchronization interrupted. " - "%jd bytes synchronized so far.", - (intmax_t)synced); } rw_unlock(&hio_remote_lock[ncomp]); continue; From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 14:10:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 905641065696; Fri, 27 Aug 2010 14:10:25 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 806878FC15; Fri, 27 Aug 2010 14:10:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7REAPsD080269; Fri, 27 Aug 2010 14:10:25 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7REAP8T080267; Fri, 27 Aug 2010 14:10:25 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008271410.o7REAP8T080267@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 27 Aug 2010 14:10:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211880 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 14:10:25 -0000 Author: pjd Date: Fri Aug 27 14:10:25 2010 New Revision: 211880 URL: http://svn.freebsd.org/changeset/base/211880 Log: Don't increase number synchronized bytes in case of an error. MFC after: 2 weeks Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Fri Aug 27 14:08:10 2010 (r211879) +++ head/sbin/hastd/primary.c Fri Aug 27 14:10:25 2010 (r211880) @@ -1699,15 +1699,14 @@ sync_thread(void *arg __unused) strerror(hio->hio_errors[ncomp])); goto free_queue; } + + synced += length; free_queue: mtx_lock(&range_lock); rangelock_del(range_sync, offset, length); if (range_regular_wait) cv_signal(&range_regular_cond); mtx_unlock(&range_lock); - - synced += length; - pjdlog_debug(2, "sync: (%p) Moving request to the free queue.", hio); QUEUE_INSERT2(hio, free); From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 14:12:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70D10106564A; Fri, 27 Aug 2010 14:12:53 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60C848FC15; Fri, 27 Aug 2010 14:12:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RECrZj080376; Fri, 27 Aug 2010 14:12:53 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RECrpo080374; Fri, 27 Aug 2010 14:12:53 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008271412.o7RECrpo080374@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 27 Aug 2010 14:12:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211881 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 14:12:53 -0000 Author: pjd Date: Fri Aug 27 14:12:53 2010 New Revision: 211881 URL: http://svn.freebsd.org/changeset/base/211881 Log: - Remove redundant and incorrect 'old' word from debug message. - Log disconnects as warnings. MFC after: 2 weeks Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Fri Aug 27 14:10:25 2010 (r211880) +++ head/sbin/hastd/primary.c Fri Aug 27 14:12:53 2010 (r211881) @@ -867,17 +867,19 @@ remote_close(struct hast_resource *res, assert(res->hr_remotein != NULL); assert(res->hr_remoteout != NULL); - pjdlog_debug(2, "Closing old incoming connection to %s.", + pjdlog_debug(2, "Closing incoming connection to %s.", res->hr_remoteaddr); proto_close(res->hr_remotein); res->hr_remotein = NULL; - pjdlog_debug(2, "Closing old outgoing connection to %s.", + pjdlog_debug(2, "Closing outgoing connection to %s.", res->hr_remoteaddr); proto_close(res->hr_remoteout); res->hr_remoteout = NULL; rw_unlock(&hio_remote_lock[ncomp]); + pjdlog_warning("Disconnected from %s.", res->hr_remoteaddr); + /* * Stop synchronization if in-progress. */ From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 14:26:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DEC41065695; Fri, 27 Aug 2010 14:26:38 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D09B8FC17; Fri, 27 Aug 2010 14:26:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7REQcIK080705; Fri, 27 Aug 2010 14:26:38 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7REQb1D080701; Fri, 27 Aug 2010 14:26:37 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008271426.o7REQb1D080701@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 27 Aug 2010 14:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211882 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 14:26:38 -0000 Author: pjd Date: Fri Aug 27 14:26:37 2010 New Revision: 211882 URL: http://svn.freebsd.org/changeset/base/211882 Log: Implement keepalive mechanism inside HAST protocol so we can detect secondary node failures quickly for HAST resources that are rarely modified. Remove XXX from a comment now that the guard thread never sleeps infinitely. MFC after: 2 weeks Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com Modified: head/sbin/hastd/hast.h head/sbin/hastd/primary.c head/sbin/hastd/secondary.c Modified: head/sbin/hastd/hast.h ============================================================================== --- head/sbin/hastd/hast.h Fri Aug 27 14:12:53 2010 (r211881) +++ head/sbin/hastd/hast.h Fri Aug 27 14:26:37 2010 (r211882) @@ -48,7 +48,12 @@ #include "proto.h" -#define HAST_PROTO_VERSION 0 +/* + * Version history: + * 0 - initial version + * 1 - HIO_KEEPALIVE added + */ +#define HAST_PROTO_VERSION 1 #define EHAST_OK 0 #define EHAST_NOENTRY 1 @@ -74,6 +79,7 @@ #define HIO_WRITE 2 #define HIO_DELETE 3 #define HIO_FLUSH 4 +#define HIO_KEEPALIVE 5 #define HAST_TIMEOUT 5 #define HAST_CONFIG "/etc/hast.conf" Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Fri Aug 27 14:12:53 2010 (r211881) +++ head/sbin/hastd/primary.c Fri Aug 27 14:26:37 2010 (r211882) @@ -151,7 +151,11 @@ static pthread_mutex_t metadata_lock; */ #define HAST_NCOMPONENTS 2 /* - * Number of seconds to sleep before next reconnect try. + * Number of seconds to sleep between keepalive packets. + */ +#define KEEPALIVE_SLEEP 10 +/* + * Number of seconds to sleep between reconnect retries. */ #define RECONNECT_SLEEP 5 @@ -886,11 +890,14 @@ remote_close(struct hast_resource *res, sync_stop(); /* - * Wake up guard thread, so it can immediately start reconnect. + * Wake up guard thread (if we are not called from within guard thread), + * so it can immediately start reconnect. */ - mtx_lock(&hio_guard_lock); - cv_signal(&hio_guard_cond); - mtx_unlock(&hio_guard_lock); + if (!mtx_owned(&hio_guard_lock)) { + mtx_lock(&hio_guard_lock); + cv_signal(&hio_guard_cond); + mtx_unlock(&hio_guard_lock); + } } /* @@ -1734,7 +1741,7 @@ sighandler(int sig) assert(!"invalid condition"); } /* - * XXX: Racy, but if we cannot obtain hio_guard_lock here, we don't + * Racy, but if we cannot obtain hio_guard_lock here, we don't * want to risk deadlock. */ unlock = mtx_trylock(&hio_guard_lock); @@ -1851,6 +1858,32 @@ failed: pjdlog_warning("Configuration not reloaded."); } +static void +keepalive_send(struct hast_resource *res, unsigned int ncomp) +{ + struct nv *nv; + + nv = nv_alloc(); + nv_add_uint8(nv, HIO_KEEPALIVE, "cmd"); + if (nv_error(nv) != 0) { + nv_free(nv); + pjdlog_debug(1, + "keepalive_send: Unable to prepare header to send."); + return; + } + if (hast_proto_send(res, res->hr_remoteout, nv, NULL, 0) < 0) { + pjdlog_common(LOG_DEBUG, 1, errno, + "keepalive_send: Unable to send request"); + nv_free(nv); + rw_unlock(&hio_remote_lock[ncomp]); + remote_close(res, ncomp); + rw_rlock(&hio_remote_lock[ncomp]); + return; + } + nv_free(nv); + pjdlog_debug(2, "keepalive_send: Request sent."); +} + /* * Thread guards remote connections and reconnects when needed, handles * signals, etc. @@ -1874,14 +1907,8 @@ guard_thread(void *arg) sighup_received = false; config_reload(); } - /* - * If all the connection will be fine, we will sleep until - * someone wakes us up. - * If any of the connections will be broken and we won't be - * able to connect, we will sleep only for RECONNECT_SLEEP - * seconds so we can retry soon. - */ - timeout = 0; + + timeout = KEEPALIVE_SLEEP; pjdlog_debug(2, "remote_guard: Checking connections."); mtx_lock(&hio_guard_lock); for (ii = 0; ii < ncomps; ii++) { @@ -1891,6 +1918,11 @@ guard_thread(void *arg) if (ISCONNECTED(res, ii)) { assert(res->hr_remotein != NULL); assert(res->hr_remoteout != NULL); + keepalive_send(res, ii); + } + if (ISCONNECTED(res, ii)) { + assert(res->hr_remotein != NULL); + assert(res->hr_remoteout != NULL); rw_unlock(&hio_remote_lock[ii]); pjdlog_debug(2, "remote_guard: Connection to %s is ok.", Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Fri Aug 27 14:12:53 2010 (r211881) +++ head/sbin/hastd/secondary.c Fri Aug 27 14:26:37 2010 (r211882) @@ -413,6 +413,9 @@ reqlog(int loglevel, int debuglevel, int "WRITE(%ju, %ju).", (uintmax_t)hio->hio_offset, (uintmax_t)hio->hio_length); break; + case HIO_KEEPALIVE: + (void)snprintf(msg + len, sizeof(msg) - len, "KEEPALIVE."); + break; default: (void)snprintf(msg + len, sizeof(msg) - len, "UNKNOWN(%u).", (unsigned int)hio->hio_cmd); @@ -433,6 +436,8 @@ requnpack(struct hast_resource *res, str goto end; } switch (hio->hio_cmd) { + case HIO_KEEPALIVE: + break; case HIO_READ: case HIO_WRITE: case HIO_DELETE: @@ -517,7 +522,14 @@ recv_thread(void *arg) } reqlog(LOG_DEBUG, 2, -1, hio, "recv: (%p) Got request header: ", hio); - if (hio->hio_cmd == HIO_WRITE) { + if (hio->hio_cmd == HIO_KEEPALIVE) { + pjdlog_debug(2, + "recv: (%p) Moving request to the free queue.", + hio); + nv_free(hio->hio_nv); + QUEUE_INSERT(free, hio); + continue; + } else if (hio->hio_cmd == HIO_WRITE) { if (hast_proto_recv_data(res, res->hr_remotein, hio->hio_nv, hio->hio_data, MAXPHYS) < 0) { pjdlog_exit(EX_TEMPFAIL, From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 14:28:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF73C1065697; Fri, 27 Aug 2010 14:28:39 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8503A8FC1D; Fri, 27 Aug 2010 14:28:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RESd3v080780; Fri, 27 Aug 2010 14:28:39 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RESdpu080778; Fri, 27 Aug 2010 14:28:39 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008271428.o7RESdpu080778@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 27 Aug 2010 14:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211883 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 14:28:39 -0000 Author: pjd Date: Fri Aug 27 14:28:39 2010 New Revision: 211883 URL: http://svn.freebsd.org/changeset/base/211883 Log: Reduce indent where possible. MFC after: 2 weeks Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com Modified: head/sbin/hastd/parse.y Modified: head/sbin/hastd/parse.y ============================================================================== --- head/sbin/hastd/parse.y Fri Aug 27 14:26:37 2010 (r211882) +++ head/sbin/hastd/parse.y Fri Aug 27 14:28:39 2010 (r211883) @@ -256,13 +256,13 @@ control_statement: CONTROL STR } break; case 1: - if (mynode) { - if (strlcpy(lconfig->hc_controladdr, $2, - sizeof(lconfig->hc_controladdr)) >= - sizeof(lconfig->hc_controladdr)) { - pjdlog_error("control argument is too long."); - return (1); - } + if (!mynode) + break; + if (strlcpy(lconfig->hc_controladdr, $2, + sizeof(lconfig->hc_controladdr)) >= + sizeof(lconfig->hc_controladdr)) { + pjdlog_error("control argument is too long."); + return (1); } break; default: @@ -283,13 +283,13 @@ listen_statement: LISTEN STR } break; case 1: - if (mynode) { - if (strlcpy(lconfig->hc_listenaddr, $2, - sizeof(lconfig->hc_listenaddr)) >= - sizeof(lconfig->hc_listenaddr)) { - pjdlog_error("listen argument is too long."); - return (1); - } + if (!mynode) + break; + if (strlcpy(lconfig->hc_listenaddr, $2, + sizeof(lconfig->hc_listenaddr)) >= + sizeof(lconfig->hc_listenaddr)) { + pjdlog_error("listen argument is too long."); + return (1); } break; default: @@ -493,14 +493,14 @@ name_statement: NAME STR } break; case 2: - if (mynode) { - assert(curres != NULL); - if (strlcpy(curres->hr_provname, $2, - sizeof(curres->hr_provname)) >= - sizeof(curres->hr_provname)) { - pjdlog_error("name argument is too long."); - return (1); - } + if (!mynode) + break; + assert(curres != NULL); + if (strlcpy(curres->hr_provname, $2, + sizeof(curres->hr_provname)) >= + sizeof(curres->hr_provname)) { + pjdlog_error("name argument is too long."); + return (1); } break; default: @@ -521,14 +521,14 @@ local_statement: LOCAL STR } break; case 2: - if (mynode) { - assert(curres != NULL); - if (strlcpy(curres->hr_localpath, $2, - sizeof(curres->hr_localpath)) >= - sizeof(curres->hr_localpath)) { - pjdlog_error("local argument is too long."); - return (1); - } + if (!mynode) + break; + assert(curres != NULL); + if (strlcpy(curres->hr_localpath, $2, + sizeof(curres->hr_localpath)) >= + sizeof(curres->hr_localpath)) { + pjdlog_error("local argument is too long."); + return (1); } break; default: From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 14:35:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87D2810656AA; Fri, 27 Aug 2010 14:35:39 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 77C8A8FC12; Fri, 27 Aug 2010 14:35:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7REZdDv080972; Fri, 27 Aug 2010 14:35:39 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7REZd97080970; Fri, 27 Aug 2010 14:35:39 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008271435.o7REZd97080970@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 27 Aug 2010 14:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211884 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 14:35:39 -0000 Author: pjd Date: Fri Aug 27 14:35:39 2010 New Revision: 211884 URL: http://svn.freebsd.org/changeset/base/211884 Log: When logging to stdout/stderr don't close those descriptors after fork(). MFC after: 2 weeks Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com Modified: head/sbin/hastd/hooks.c Modified: head/sbin/hastd/hooks.c ============================================================================== --- head/sbin/hastd/hooks.c Fri Aug 27 14:28:39 2010 (r211883) +++ head/sbin/hastd/hooks.c Fri Aug 27 14:35:39 2010 (r211884) @@ -61,8 +61,21 @@ descriptors(void) pjdlog_errno(LOG_WARNING, "sysconf(_SC_OPEN_MAX) failed"); maxfd = 1024; } - for (fd = 0; fd <= maxfd; fd++) - close(fd); + for (fd = 0; fd <= maxfd; fd++) { + switch (fd) { + case STDIN_FILENO: + case STDOUT_FILENO: + case STDERR_FILENO: + if (pjdlog_mode_get() == PJDLOG_MODE_STD) + break; + /* FALLTHROUGH */ + default: + close(fd); + break; + } + } + if (pjdlog_mode_get() == PJDLOG_MODE_STD) + return; /* * Redirect stdin, stdout and stderr to /dev/null. */ From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 14:38:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 538481065697; Fri, 27 Aug 2010 14:38:13 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 425818FC1D; Fri, 27 Aug 2010 14:38:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7REcDMu081055; Fri, 27 Aug 2010 14:38:13 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7REcDMT081052; Fri, 27 Aug 2010 14:38:13 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008271438.o7REcDMT081052@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 27 Aug 2010 14:38:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211885 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 14:38:13 -0000 Author: pjd Date: Fri Aug 27 14:38:12 2010 New Revision: 211885 URL: http://svn.freebsd.org/changeset/base/211885 Log: - Run hooks in background - don't block waiting for them to finish. - Keep all hooks we're running in a global list, so we can report when they finish and also report when they are running for too long. MFC after: 2 weeks Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com Modified: head/sbin/hastd/hooks.c head/sbin/hastd/hooks.h Modified: head/sbin/hastd/hooks.c ============================================================================== --- head/sbin/hastd/hooks.c Fri Aug 27 14:35:39 2010 (r211884) +++ head/sbin/hastd/hooks.c Fri Aug 27 14:38:12 2010 (r211885) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2010 The FreeBSD Foundation + * Copyright (c) 2010 Pawel Jakub Dawidek * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from @@ -31,21 +32,55 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include +#include #include +#include +#include +#include +#include +#include #include #include -#include #include #include -#include -#include +#include #include #include "hooks.h" +#include "synch.h" + +/* Report processes that are running for too long not often than this value. */ +#define REPORT_INTERVAL 60 + +/* Are we initialized? */ +static bool hooks_initialized = false; + +/* + * Keep all processes we forked on a global queue, so we can report nicely + * when they finish or report that they are running for a long time. + */ +#define HOOKPROC_MAGIC_ALLOCATED 0x80090ca +#define HOOKPROC_MAGIC_ONLIST 0x80090c0 +struct hookproc { + /* Magic. */ + int hp_magic; + /* PID of a forked child. */ + pid_t hp_pid; + /* When process were forked? */ + time_t hp_birthtime; + /* When we logged previous reported? */ + time_t hp_lastreport; + /* Path to executable and all the arguments we passed. */ + char hp_comm[PATH_MAX]; + TAILQ_ENTRY(hookproc) hp_next; +}; +static TAILQ_HEAD(, hookproc) hookprocs; +static pthread_mutex_t hookprocs_lock; static void descriptors(void) @@ -108,28 +143,197 @@ descriptors(void) } } -int +void +hook_init(void) +{ + + mtx_init(&hookprocs_lock); + TAILQ_INIT(&hookprocs); + hooks_initialized = true; +} + +static struct hookproc * +hook_alloc(const char *path, char **args) +{ + struct hookproc *hp; + unsigned int ii; + + hp = malloc(sizeof(*hp)); + if (hp == NULL) { + pjdlog_error("Unable to allocate %zu bytes of memory for a hook.", + sizeof(*hp)); + return (NULL); + } + + hp->hp_pid = 0; + hp->hp_birthtime = hp->hp_lastreport = time(NULL); + (void)strlcpy(hp->hp_comm, path, sizeof(hp->hp_comm)); + /* We start at 2nd argument as we don't want to have exec name twice. */ + for (ii = 1; args[ii] != NULL; ii++) { + (void)strlcat(hp->hp_comm, " ", sizeof(hp->hp_comm)); + (void)strlcat(hp->hp_comm, args[ii], sizeof(hp->hp_comm)); + } + if (strlen(hp->hp_comm) >= sizeof(hp->hp_comm) - 1) { + pjdlog_error("Exec path too long, correct configuration file."); + free(hp); + return (NULL); + } + hp->hp_magic = HOOKPROC_MAGIC_ALLOCATED; + return (hp); +} + +static void +hook_add(struct hookproc *hp, pid_t pid) +{ + + assert(hp->hp_magic == HOOKPROC_MAGIC_ALLOCATED); + assert(hp->hp_pid == 0); + + hp->hp_pid = pid; + mtx_lock(&hookprocs_lock); + hp->hp_magic = HOOKPROC_MAGIC_ONLIST; + TAILQ_INSERT_TAIL(&hookprocs, hp, hp_next); + mtx_unlock(&hookprocs_lock); +} + +static void +hook_remove(struct hookproc *hp) +{ + + assert(hp->hp_magic == HOOKPROC_MAGIC_ONLIST); + assert(hp->hp_pid > 0); + assert(mtx_owned(&hookprocs_lock)); + + TAILQ_REMOVE(&hookprocs, hp, hp_next); + hp->hp_magic = HOOKPROC_MAGIC_ALLOCATED; +} + +static void +hook_free(struct hookproc *hp) +{ + + assert(hp->hp_magic == HOOKPROC_MAGIC_ALLOCATED); + assert(hp->hp_pid > 0); + + hp->hp_magic = 0; + free(hp); +} + +static struct hookproc * +hook_find(pid_t pid) +{ + struct hookproc *hp; + + assert(mtx_owned(&hookprocs_lock)); + + TAILQ_FOREACH(hp, &hookprocs, hp_next) { + assert(hp->hp_magic == HOOKPROC_MAGIC_ONLIST); + assert(hp->hp_pid > 0); + + if (hp->hp_pid == pid) + break; + } + + return (hp); +} + +void +hook_check(bool sigchld) +{ + struct hookproc *hp, *hp2; + int status; + time_t now; + pid_t pid; + + assert(hooks_initialized); + + /* + * If SIGCHLD was received, garbage collect finished processes. + */ + while (sigchld && (pid = wait3(&status, WNOHANG, NULL)) > 0) { + mtx_lock(&hookprocs_lock); + hp = hook_find(pid); + if (hp == NULL) { + mtx_unlock(&hookprocs_lock); + pjdlog_warning("Unknown process pid=%u", pid); + continue; + } + hook_remove(hp); + mtx_unlock(&hookprocs_lock); + if (WIFEXITED(status) && WEXITSTATUS(status) == 0) { + pjdlog_debug(1, "Hook exited gracefully (pid=%u, cmd=[%s]).", + pid, hp->hp_comm); + } else if (WIFSIGNALED(status)) { + pjdlog_error("Hook was killed (pid=%u, signal=%d, cmd=[%s]).", + pid, WTERMSIG(status), hp->hp_comm); + } else { + pjdlog_error("Hook exited ungracefully (pid=%u, exitcode=%d, cmd=[%s]).", + pid, WIFEXITED(status) ? WEXITSTATUS(status) : -1, + hp->hp_comm); + } + hook_free(hp); + } + + /* + * Report about processes that are running for a long time. + */ + now = time(NULL); + mtx_lock(&hookprocs_lock); + TAILQ_FOREACH_SAFE(hp, &hookprocs, hp_next, hp2) { + assert(hp->hp_magic == HOOKPROC_MAGIC_ONLIST); + assert(hp->hp_pid > 0); + + /* + * If process doesn't exists we somehow missed it. + * Not much can be done expect for logging this situation. + */ + if (kill(hp->hp_pid, 0) == -1 && errno == ESRCH) { + pjdlog_warning("Hook disappeared (pid=%u, cmd=[%s]).", + hp->hp_pid, hp->hp_comm); + hook_remove(hp); + hook_free(hp); + continue; + } + + /* + * Skip proccesses younger than 1 minute. + */ + if (now - hp->hp_lastreport < REPORT_INTERVAL) + continue; + + /* + * Hook is running for too long, report it. + */ + pjdlog_warning("Hook is running for %ju seconds (pid=%u, cmd=[%s]).", + (uintmax_t)(now - hp->hp_birthtime), hp->hp_pid, + hp->hp_comm); + hp->hp_lastreport = now; + } + mtx_unlock(&hookprocs_lock); +} + +void hook_exec(const char *path, ...) { va_list ap; - int ret; va_start(ap, path); - ret = hook_execv(path, ap); + hook_execv(path, ap); va_end(ap); - return (ret); } -int +void hook_execv(const char *path, va_list ap) { + struct hookproc *hp; char *args[64]; unsigned int ii; - pid_t pid, wpid; - int status; + pid_t pid; + + assert(hooks_initialized); if (path == NULL || path[0] == '\0') - return (0); + return; memset(args, 0, sizeof(args)); args[0] = basename(path); @@ -140,22 +344,22 @@ hook_execv(const char *path, va_list ap) } assert(ii < sizeof(args) / sizeof(args[0])); + hp = hook_alloc(path, args); + if (hp == NULL) + return; + pid = fork(); switch (pid) { case -1: /* Error. */ - pjdlog_errno(LOG_ERR, "Unable to fork %s", path); - return (-1); + pjdlog_errno(LOG_ERR, "Unable to fork to execute %s", path); + return; case 0: /* Child. */ descriptors(); execv(path, args); pjdlog_errno(LOG_ERR, "Unable to execute %s", path); exit(EX_SOFTWARE); default: /* Parent. */ + hook_add(hp, pid); break; } - - wpid = waitpid(pid, &status, 0); - assert(wpid == pid); - - return (WEXITSTATUS(status)); } Modified: head/sbin/hastd/hooks.h ============================================================================== --- head/sbin/hastd/hooks.h Fri Aug 27 14:35:39 2010 (r211884) +++ head/sbin/hastd/hooks.h Fri Aug 27 14:38:12 2010 (r211885) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2010 The FreeBSD Foundation + * Copyright (c) 2010 Pawel Jakub Dawidek * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from @@ -33,8 +34,11 @@ #define _HOOKS_H_ #include +#include -int hook_exec(const char *path, ...); -int hook_execv(const char *path, va_list ap); +void hook_init(void); +void hook_check(bool sigchld); +void hook_exec(const char *path, ...); +void hook_execv(const char *path, va_list ap); #endif /* !_HOOKS_H_ */ From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 15:16:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EDF41065674; Fri, 27 Aug 2010 15:16:52 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72A368FC16; Fri, 27 Aug 2010 15:16:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RFGqJO081937; Fri, 27 Aug 2010 15:16:52 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RFGqNc081930; Fri, 27 Aug 2010 15:16:52 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008271516.o7RFGqNc081930@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 27 Aug 2010 15:16:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211886 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 15:16:52 -0000 Author: pjd Date: Fri Aug 27 15:16:52 2010 New Revision: 211886 URL: http://svn.freebsd.org/changeset/base/211886 Log: Allow to execute specified program on various HAST events. MFC after: 2 weeks Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com Modified: head/sbin/hastd/hast.h head/sbin/hastd/hastd.c head/sbin/hastd/hastd.h head/sbin/hastd/parse.y head/sbin/hastd/primary.c head/sbin/hastd/token.l Modified: head/sbin/hastd/hast.h ============================================================================== --- head/sbin/hastd/hast.h Fri Aug 27 14:38:12 2010 (r211885) +++ head/sbin/hastd/hast.h Fri Aug 27 15:16:52 2010 (r211886) @@ -127,6 +127,8 @@ struct hast_resource { int hr_extentsize; /* Maximum number of extents that are kept dirty. */ int hr_keepdirty; + /* Path to a program to execute on various events. */ + char hr_exec[PATH_MAX]; /* Path to local component. */ char hr_localpath[PATH_MAX]; Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Fri Aug 27 14:38:12 2010 (r211885) +++ head/sbin/hastd/hastd.c Fri Aug 27 15:16:52 2010 (r211886) @@ -62,7 +62,7 @@ const char *cfgpath = HAST_CONFIG; /* Hastd configuration. */ static struct hastd_config *cfg; /* Was SIGCHLD signal received? */ -static bool sigchld_received = false; +bool sigchld_received = false; /* Was SIGHUP signal received? */ bool sighup_received = false; /* Was SIGINT or SIGTERM signal received? */ @@ -189,6 +189,8 @@ resource_needs_restart(const struct hast return (true); if (res0->hr_timeout != res1->hr_timeout) return (true); + if (strcmp(res0->hr_exec, res1->hr_exec) != 0) + return (true); } return (false); } @@ -211,6 +213,8 @@ resource_needs_reload(const struct hast_ return (true); if (res0->hr_timeout != res1->hr_timeout) return (true); + if (strcmp(res0->hr_exec, res1->hr_exec) != 0) + return (true); return (false); } Modified: head/sbin/hastd/hastd.h ============================================================================== --- head/sbin/hastd/hastd.h Fri Aug 27 14:38:12 2010 (r211885) +++ head/sbin/hastd/hastd.h Fri Aug 27 15:16:52 2010 (r211886) @@ -40,7 +40,7 @@ #include "hast.h" extern const char *cfgpath; -extern bool sigexit_received, sighup_received; +extern bool sigchld_received, sigexit_received, sighup_received; extern struct pidfh *pfh; void hastd_primary(struct hast_resource *res); Modified: head/sbin/hastd/parse.y ============================================================================== --- head/sbin/hastd/parse.y Fri Aug 27 14:38:12 2010 (r211885) +++ head/sbin/hastd/parse.y Fri Aug 27 15:16:52 2010 (r211886) @@ -61,6 +61,7 @@ static char depth0_control[HAST_ADDRSIZE static char depth0_listen[HAST_ADDRSIZE]; static int depth0_replication; static int depth0_timeout; +static char depth0_exec[PATH_MAX]; static char depth1_provname[PATH_MAX]; static char depth1_localpath[PATH_MAX]; @@ -130,6 +131,7 @@ yy_config_parse(const char *config, bool depth0_replication = HAST_REPLICATION_MEMSYNC; strlcpy(depth0_control, HAST_CONTROL, sizeof(depth0_control)); strlcpy(depth0_listen, HASTD_LISTEN, sizeof(depth0_listen)); + depth0_exec[0] = '\0'; lconfig = calloc(1, sizeof(*lconfig)); if (lconfig == NULL) { @@ -190,6 +192,14 @@ yy_config_parse(const char *config, bool */ curres->hr_timeout = depth0_timeout; } + if (curres->hr_exec[0] == '\0') { + /* + * Exec is not set at resource-level. + * Use global or default setting. + */ + strlcpy(curres->hr_exec, depth0_exec, + sizeof(curres->hr_exec)); + } } return (lconfig); @@ -208,7 +218,7 @@ yy_config_free(struct hastd_config *conf } %} -%token CONTROL LISTEN PORT REPLICATION TIMEOUT EXTENTSIZE RESOURCE NAME LOCAL REMOTE ON +%token CONTROL LISTEN PORT REPLICATION TIMEOUT EXEC EXTENTSIZE RESOURCE NAME LOCAL REMOTE ON %token FULLSYNC MEMSYNC ASYNC %token NUM STR OB CB @@ -239,6 +249,8 @@ statement: | timeout_statement | + exec_statement + | node_statement | resource_statement @@ -338,6 +350,32 @@ timeout_statement: TIMEOUT NUM } ; +exec_statement: EXEC STR + { + switch (depth) { + case 0: + if (strlcpy(depth0_exec, $2, sizeof(depth0_exec)) >= + sizeof(depth0_exec)) { + pjdlog_error("Exec path is too long."); + return (1); + } + break; + case 1: + if (curres == NULL) + break; + if (strlcpy(curres->hr_exec, $2, + sizeof(curres->hr_exec)) >= + sizeof(curres->hr_exec)) { + pjdlog_error("Exec path is too long."); + return (1); + } + break; + default: + assert(!"exec at wrong depth level"); + } + } + ; + node_statement: ON node_start OB node_entries CB { mynode = false; @@ -456,6 +494,7 @@ resource_start: STR curres->hr_previous_role = HAST_ROLE_INIT; curres->hr_replication = -1; curres->hr_timeout = -1; + curres->hr_exec[0] = '\0'; curres->hr_provname[0] = '\0'; curres->hr_localpath[0] = '\0'; curres->hr_localfd = -1; @@ -474,6 +513,8 @@ resource_entry: | timeout_statement | + exec_statement + | name_statement | local_statement Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Fri Aug 27 14:38:12 2010 (r211885) +++ head/sbin/hastd/primary.c Fri Aug 27 15:16:52 2010 (r211886) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include "hast.h" #include "hast_proto.h" #include "hastd.h" +#include "hooks.h" #include "metadata.h" #include "proto.h" #include "pjdlog.h" @@ -433,6 +434,7 @@ init_environment(struct hast_resource *r signal(SIGINT, sighandler); signal(SIGTERM, sighandler); signal(SIGHUP, sighandler); + signal(SIGCHLD, sighandler); } static void @@ -791,6 +793,7 @@ hastd_primary(struct hast_resource *res) signal(SIGHUP, SIG_DFL); signal(SIGCHLD, SIG_DFL); + hook_init(); init_local(res); if (real_remote(res) && init_remote(res, NULL, NULL)) sync_start(); @@ -1737,6 +1740,9 @@ sighandler(int sig) case SIGHUP: sighup_received = true; break; + case SIGCHLD: + sigchld_received = true; + break; default: assert(!"invalid condition"); } @@ -1788,6 +1794,7 @@ config_reload(void) #define MODIFIED_REMOTEADDR 0x1 #define MODIFIED_REPLICATION 0x2 #define MODIFIED_TIMEOUT 0x4 +#define MODIFIED_EXEC 0x8 modified = 0; if (strcmp(gres->hr_remoteaddr, res->hr_remoteaddr) != 0) { /* @@ -1805,6 +1812,10 @@ config_reload(void) gres->hr_timeout = res->hr_timeout; modified |= MODIFIED_TIMEOUT; } + if (strcmp(gres->hr_exec, res->hr_exec) != 0) { + strlcpy(gres->hr_exec, res->hr_exec, sizeof(gres->hr_exec)); + modified |= MODIFIED_EXEC; + } /* * If only timeout was modified we only need to change it without * reconnecting. @@ -1830,7 +1841,8 @@ config_reload(void) "Unable to set connection timeout"); } } - } else { + } else if ((modified & + (MODIFIED_REMOTEADDR | MODIFIED_REPLICATION)) != 0) { for (ii = 0; ii < ncomps; ii++) { if (!ISREMOTE(ii)) continue; @@ -1844,6 +1856,7 @@ config_reload(void) #undef MODIFIED_REMOTEADDR #undef MODIFIED_REPLICATION #undef MODIFIED_TIMEOUT +#undef MODIFIED_EXEC pjdlog_info("Configuration reloaded successfully."); return; @@ -1907,6 +1920,9 @@ guard_thread(void *arg) sighup_received = false; config_reload(); } + hook_check(sigchld_received); + if (sigchld_received) + sigchld_received = false; timeout = KEEPALIVE_SLEEP; pjdlog_debug(2, "remote_guard: Checking connections."); Modified: head/sbin/hastd/token.l ============================================================================== --- head/sbin/hastd/token.l Fri Aug 27 14:38:12 2010 (r211885) +++ head/sbin/hastd/token.l Fri Aug 27 15:16:52 2010 (r211886) @@ -49,6 +49,7 @@ listen { DP; return LISTEN; } port { DP; return PORT; } replication { DP; return REPLICATION; } timeout { DP; return TIMEOUT; } +exec { DP; return EXEC; } resource { DP; return RESOURCE; } name { DP; return NAME; } local { DP; return LOCAL; } From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 15:18:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 451B0106564A; Fri, 27 Aug 2010 15:18:47 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id E52C08FC0C; Fri, 27 Aug 2010 15:18:46 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 66BC445C99; Fri, 27 Aug 2010 17:18:45 +0200 (CEST) Received: from localhost (pdawidek.whl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 9BCC045B36; Fri, 27 Aug 2010 17:18:41 +0200 (CEST) Date: Fri, 27 Aug 2010 17:18:35 +0200 From: Pawel Jakub Dawidek To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20100827151835.GC1884@garage.freebsd.pl> References: <201008271516.o7RFGqNc081930@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uXxzq0nDebZQVNAZ" Content-Disposition: inline In-Reply-To: <201008271516.o7RFGqNc081930@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: Subject: Re: svn commit: r211886 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 15:18:47 -0000 --uXxzq0nDebZQVNAZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 27, 2010 at 03:16:52PM +0000, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Fri Aug 27 15:16:52 2010 > New Revision: 211886 > URL: http://svn.freebsd.org/changeset/base/211886 >=20 > Log: > Allow to execute specified program on various HAST events. Manual page update will follow soon:) --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --uXxzq0nDebZQVNAZ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkx310sACgkQForvXbEpPzQX/ACgsKD3wteGSd+KRF3ngStSAKDf 0QEAnj0gaF5BIDQjMpfA1fIkQm2c9w1T =OsCo -----END PGP SIGNATURE----- --uXxzq0nDebZQVNAZ-- From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 15:20:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7F0D1065697; Fri, 27 Aug 2010 15:20:31 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD5FC8FC0A; Fri, 27 Aug 2010 15:20:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RFKV7n082137; Fri, 27 Aug 2010 15:20:31 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RFKVgX082135; Fri, 27 Aug 2010 15:20:31 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008271520.o7RFKVgX082135@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 27 Aug 2010 15:20:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211887 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 15:20:32 -0000 Author: pjd Date: Fri Aug 27 15:20:31 2010 New Revision: 211887 URL: http://svn.freebsd.org/changeset/base/211887 Log: Document new 'exec' parameter. MFC after: 2 weeks Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com Modified: head/sbin/hastd/hast.conf.5 Modified: head/sbin/hastd/hast.conf.5 ============================================================================== --- head/sbin/hastd/hast.conf.5 Fri Aug 27 15:16:52 2010 (r211886) +++ head/sbin/hastd/hast.conf.5 Fri Aug 27 15:20:31 2010 (r211887) @@ -1,4 +1,5 @@ .\" Copyright (c) 2010 The FreeBSD Foundation +.\" Copyright (c) 2010 Pawel Jakub Dawidek .\" All rights reserved. .\" .\" This software was developed by Pawel Jakub Dawidek under sponsorship from @@ -27,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 5, 2010 +.Dd August 27, 2010 .Dt HAST.CONF 5 .Os .Sh NAME @@ -59,6 +60,7 @@ control listen replication timeout +exec on { # Node section @@ -78,6 +80,7 @@ resource { name local timeout + exec on { # Resource-node section @@ -203,6 +206,41 @@ replication mode is currently not implem Connection timeout in seconds. The default value is .Va 5 . +.It Ic exec Aq path +.Pp +Execute the given program on various HAST events. +Below is the list of currently implemented events and arguments the given +program is executed with: +.Bl -tag -width ".Ic xxxx" +.It Ic " syncstart " +.Pp +Executed on primary node when synchronization process of secondary node is +started. +.Pp +.It Ic " syncdone " +.Pp +Executed on primary node when synchronization process of secondary node is +completed successfully. +.Pp +.It Ic " syncintr " +.Pp +Executed on primary node when synchronization process of secondary node is +interrupted, most likely due to secondary node outage or connection failure +between the nodes. +.Pp +.El +The +.Aq path +argument should contain full path to executable program. +If the given program exits with code different than +.Va 0 , +.Nm hastd +will log it as an error. +.Pp +The +.Aq resource +argument is resource name from the configuration file. +.Pp .It Ic name Aq name .Pp GEOM provider name that will appear as From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 15:48:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD1EA10656A3; Fri, 27 Aug 2010 15:48:14 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id 1D96F8FC18; Fri, 27 Aug 2010 15:48:13 +0000 (UTC) Received: by qyk8 with SMTP id 8so816794qyk.13 for ; Fri, 27 Aug 2010 08:48:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=SPYj/2xXZEHw8HGQM8VvYYMOOxQdXA1iPKQw4c+DpNw=; b=hEh/o3V5OkuW3tmBOs8Vw36g9jQuSF/rH4jO3G+xclRlYQgFOHFQEkXFexpsDs2wDk y0unFPXwJaw8EaIwyh47N/7W1cYk9Fd+yDHZta8r+jhGNcV0uC0XgmZSlJdTXTK/86Gk 0ShQzK8wY4ORCm3aqMGqEWEYSUUgyPLFz2zsY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Bvd0LASjJkY1wRfP6fgY/f4up0oWLZ+L5QZ/26vcP+UAZxG/TbSPXHrYlsqtxpx+jr Ozi086lY+cdpxyy8t7w9qZB92F8hep+J0oKWoVFSz6vCBqCFVJtGOT+ppA+NcwqKWQ4/ GvEiD6R3bENect855N9+TwUByeoUwVZHrNelA= MIME-Version: 1.0 Received: by 10.229.224.147 with SMTP id io19mr660313qcb.69.1282924089818; Fri, 27 Aug 2010 08:48:09 -0700 (PDT) Received: by 10.229.26.81 with HTTP; Fri, 27 Aug 2010 08:48:09 -0700 (PDT) In-Reply-To: <201008262333.o7QNX484056761@svn.freebsd.org> References: <201008262333.o7QNX484056761@svn.freebsd.org> Date: Fri, 27 Aug 2010 19:48:09 +0400 Message-ID: From: pluknet To: Pawel Jakub Dawidek Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211853 - head/sys/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 15:48:14 -0000 On 27 August 2010 03:33, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Thu Aug 26 23:33:04 2010 > New Revision: 211853 > URL: http://svn.freebsd.org/changeset/base/211853 > > Log: > =A0- Check the result of malloc(M_NOWAIT) in replay_alloc(). The caller > =A0 =A0(replay_alloc()) knows how to handle replay_alloc() failure. > =A0- Eliminate 'freed_one' variable, it is not needed - when no entry is = found > =A0 =A0rce will be NULL. > =A0- Add locking assertions where we expect a rc_lock to be held. Hi, may this help fixing memory leak seen on nfsclient.ko unload right after nfs_unmount()? Warning: memory type rpc leaked memory on destroy (3 allocations, 1216 bytes leaked). --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 18:17:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79B531065675; Fri, 27 Aug 2010 18:17:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6912B8FC27; Fri, 27 Aug 2010 18:17:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RIHljX002904; Fri, 27 Aug 2010 18:17:47 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RIHljG002903; Fri, 27 Aug 2010 18:17:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201008271817.o7RIHljG002903@svn.freebsd.org> From: John Baldwin Date: Fri, 27 Aug 2010 18:17:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211888 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 18:17:47 -0000 Author: jhb Date: Fri Aug 27 18:17:46 2010 New Revision: 211888 URL: http://svn.freebsd.org/changeset/base/211888 Log: Simplify the tcp pcblist estimate logic slightly. MFC after: 3 days Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Fri Aug 27 15:20:31 2010 (r211887) +++ head/sys/netinet/tcp_subr.c Fri Aug 27 18:17:46 2010 (r211888) @@ -1022,11 +1022,9 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) * resource-intensive to repeat twice on every request. */ if (req->oldptr == NULL) { - m = syncache_pcbcount(); - n = V_tcbinfo.ipi_count; - n += imax((m + n) / 8, 10); - req->oldidx = 2 * (sizeof xig) + - (m + n) * sizeof(struct xtcpcb); + n = V_tcbinfo.ipi_count + syncache_pcbcount(); + n += imax(n / 8, 10); + req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xtcpcb); return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 18:50:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C9BE106566B; Fri, 27 Aug 2010 18:50:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 705558FC14; Fri, 27 Aug 2010 18:50:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RIoCW5003705; Fri, 27 Aug 2010 18:50:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RIoCnl003700; Fri, 27 Aug 2010 18:50:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201008271850.o7RIoCnl003700@svn.freebsd.org> From: John Baldwin Date: Fri, 27 Aug 2010 18:50:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211889 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 18:50:12 -0000 Author: jhb Date: Fri Aug 27 18:50:12 2010 New Revision: 211889 URL: http://svn.freebsd.org/changeset/base/211889 Log: MFC 211433: Ensure a minimum "slop" of 10 extra pcb structures when providing a memory size estimate to userland for pcb list sysctls. The previous behavior of a "slop" of n/8 does not work well for small values of n (e.g. no slop at all if you have less than 8 open UDP connections). Modified: stable/8/sys/netinet/ip_divert.c stable/8/sys/netinet/raw_ip.c stable/8/sys/netinet/tcp_subr.c stable/8/sys/netinet/udp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet/ip_divert.c ============================================================================== --- stable/8/sys/netinet/ip_divert.c Fri Aug 27 18:17:46 2010 (r211888) +++ stable/8/sys/netinet/ip_divert.c Fri Aug 27 18:50:12 2010 (r211889) @@ -614,8 +614,8 @@ div_pcblist(SYSCTL_HANDLER_ARGS) */ if (req->oldptr == 0) { n = V_divcbinfo.ipi_count; - req->oldidx = 2 * (sizeof xig) - + (n + n/8) * sizeof(struct xinpcb); + n += imax(n / 8, 10); + req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xinpcb); return 0; } Modified: stable/8/sys/netinet/raw_ip.c ============================================================================== --- stable/8/sys/netinet/raw_ip.c Fri Aug 27 18:17:46 2010 (r211888) +++ stable/8/sys/netinet/raw_ip.c Fri Aug 27 18:50:12 2010 (r211889) @@ -1007,8 +1007,8 @@ rip_pcblist(SYSCTL_HANDLER_ARGS) */ if (req->oldptr == 0) { n = V_ripcbinfo.ipi_count; - req->oldidx = 2 * (sizeof xig) - + (n + n/8) * sizeof(struct xinpcb); + n += imax(n / 8, 10); + req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xinpcb); return (0); } Modified: stable/8/sys/netinet/tcp_subr.c ============================================================================== --- stable/8/sys/netinet/tcp_subr.c Fri Aug 27 18:17:46 2010 (r211888) +++ stable/8/sys/netinet/tcp_subr.c Fri Aug 27 18:50:12 2010 (r211889) @@ -1018,8 +1018,9 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) if (req->oldptr == NULL) { m = syncache_pcbcount(); n = V_tcbinfo.ipi_count; - req->oldidx = 2 * (sizeof xig) - + ((m + n) + n/8) * sizeof(struct xtcpcb); + n += imax(n / 8, 10); + req->oldidx = 2 * (sizeof xig) + + (m + n) * sizeof(struct xtcpcb); return (0); } Modified: stable/8/sys/netinet/udp_usrreq.c ============================================================================== --- stable/8/sys/netinet/udp_usrreq.c Fri Aug 27 18:17:46 2010 (r211888) +++ stable/8/sys/netinet/udp_usrreq.c Fri Aug 27 18:50:12 2010 (r211889) @@ -727,8 +727,8 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) */ if (req->oldptr == 0) { n = V_udbinfo.ipi_count; - req->oldidx = 2 * (sizeof xig) - + (n + n/8) * sizeof(struct xinpcb); + n += imax(n / 8, 10); + req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xinpcb); return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 18:50:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 219CA10656A8; Fri, 27 Aug 2010 18:50:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 056128FC12; Fri, 27 Aug 2010 18:50:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RIoWi2003750; Fri, 27 Aug 2010 18:50:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RIoWov003745; Fri, 27 Aug 2010 18:50:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201008271850.o7RIoWov003745@svn.freebsd.org> From: John Baldwin Date: Fri, 27 Aug 2010 18:50:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211890 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 18:50:33 -0000 Author: jhb Date: Fri Aug 27 18:50:32 2010 New Revision: 211890 URL: http://svn.freebsd.org/changeset/base/211890 Log: MFC 211433: Ensure a minimum "slop" of 10 extra pcb structures when providing a memory size estimate to userland for pcb list sysctls. The previous behavior of a "slop" of n/8 does not work well for small values of n (e.g. no slop at all if you have less than 8 open UDP connections). Modified: stable/7/sys/netinet/ip_divert.c stable/7/sys/netinet/raw_ip.c stable/7/sys/netinet/tcp_subr.c stable/7/sys/netinet/udp_usrreq.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/ip_divert.c ============================================================================== --- stable/7/sys/netinet/ip_divert.c Fri Aug 27 18:50:12 2010 (r211889) +++ stable/7/sys/netinet/ip_divert.c Fri Aug 27 18:50:32 2010 (r211890) @@ -579,8 +579,8 @@ div_pcblist(SYSCTL_HANDLER_ARGS) */ if (req->oldptr == 0) { n = divcbinfo.ipi_count; - req->oldidx = 2 * (sizeof xig) - + (n + n/8) * sizeof(struct xinpcb); + n += imax(n / 8, 10); + req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xinpcb); return 0; } Modified: stable/7/sys/netinet/raw_ip.c ============================================================================== --- stable/7/sys/netinet/raw_ip.c Fri Aug 27 18:50:12 2010 (r211889) +++ stable/7/sys/netinet/raw_ip.c Fri Aug 27 18:50:32 2010 (r211890) @@ -894,8 +894,8 @@ rip_pcblist(SYSCTL_HANDLER_ARGS) */ if (req->oldptr == 0) { n = ripcbinfo.ipi_count; - req->oldidx = 2 * (sizeof xig) - + (n + n/8) * sizeof(struct xinpcb); + n += imax(n / 8, 10); + req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xinpcb); return (0); } Modified: stable/7/sys/netinet/tcp_subr.c ============================================================================== --- stable/7/sys/netinet/tcp_subr.c Fri Aug 27 18:50:12 2010 (r211889) +++ stable/7/sys/netinet/tcp_subr.c Fri Aug 27 18:50:32 2010 (r211890) @@ -939,8 +939,9 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) if (req->oldptr == NULL) { m = syncache_pcbcount(); n = tcbinfo.ipi_count; - req->oldidx = 2 * (sizeof xig) - + ((m + n) + n/8) * sizeof(struct xtcpcb); + n += imax(n / 8, 10); + req->oldidx = 2 * (sizeof xig) + + (m + n) * sizeof(struct xtcpcb); return (0); } Modified: stable/7/sys/netinet/udp_usrreq.c ============================================================================== --- stable/7/sys/netinet/udp_usrreq.c Fri Aug 27 18:50:12 2010 (r211889) +++ stable/7/sys/netinet/udp_usrreq.c Fri Aug 27 18:50:32 2010 (r211890) @@ -684,8 +684,8 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) */ if (req->oldptr == 0) { n = udbinfo.ipi_count; - req->oldidx = 2 * (sizeof xig) - + (n + n/8) * sizeof(struct xinpcb); + n += imax(n / 8, 10); + req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xinpcb); return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 18:55:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A925F1065695; Fri, 27 Aug 2010 18:55:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9740A8FC1C; Fri, 27 Aug 2010 18:55:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RItOWA003932; Fri, 27 Aug 2010 18:55:24 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RItOYk003928; Fri, 27 Aug 2010 18:55:24 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201008271855.o7RItOYk003928@svn.freebsd.org> From: John Baldwin Date: Fri, 27 Aug 2010 18:55:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211891 - in stable/8/sys: amd64/amd64 i386/i386 kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 18:55:24 -0000 Author: jhb Date: Fri Aug 27 18:55:24 2010 New Revision: 211891 URL: http://svn.freebsd.org/changeset/base/211891 Log: MFC 210774,210935: - Tweak the logic to disable CLFLUSH in virtual environments to work around problems with flushing the local APIC register range so that it checks vm_guest directly. - Add Xen to the list of virtual vendors. In the non PV (HVM) case this fixes the virtualization detection successfully disabling the CLFLUSH instruction. Modified: stable/8/sys/amd64/amd64/initcpu.c stable/8/sys/i386/i386/initcpu.c stable/8/sys/kern/subr_param.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/8/sys/amd64/amd64/initcpu.c Fri Aug 27 18:50:32 2010 (r211890) +++ stable/8/sys/amd64/amd64/initcpu.c Fri Aug 27 18:55:24 2010 (r211891) @@ -177,17 +177,17 @@ initializecpucache() if ((cpu_feature & CPUID_CLFSH) != 0) cpu_clflush_line_size = ((cpu_procinfo >> 8) & 0xff) * 8; /* - * XXXKIB: (temporary) hack to work around traps generated when - * CLFLUSHing APIC registers window. + * XXXKIB: (temporary) hack to work around traps generated + * when CLFLUSHing APIC register window under virtualization + * environments. These environments tend to disable the + * CPUID_SS feature even though the native CPU supports it. */ TUNABLE_INT_FETCH("hw.clflush_disable", &hw_clflush_disable); - if (cpu_vendor_id == CPU_VENDOR_INTEL && !(cpu_feature & CPUID_SS) && - hw_clflush_disable == -1) + if (vm_guest != VM_GUEST_NO && hw_clflush_disable == -1) cpu_feature &= ~CPUID_CLFSH; /* * Allow to disable CLFLUSH feature manually by - * hw.clflush_disable tunable. This may help Xen guest on some AMD - * CPUs. + * hw.clflush_disable tunable. */ if (hw_clflush_disable == 1) cpu_feature &= ~CPUID_CLFSH; Modified: stable/8/sys/i386/i386/initcpu.c ============================================================================== --- stable/8/sys/i386/i386/initcpu.c Fri Aug 27 18:50:32 2010 (r211890) +++ stable/8/sys/i386/i386/initcpu.c Fri Aug 27 18:55:24 2010 (r211891) @@ -724,17 +724,17 @@ initializecpu(void) if ((cpu_feature & CPUID_CLFSH) != 0) cpu_clflush_line_size = ((cpu_procinfo >> 8) & 0xff) * 8; /* - * XXXKIB: (temporary) hack to work around traps generated when - * CLFLUSHing APIC registers window. + * XXXKIB: (temporary) hack to work around traps generated + * when CLFLUSHing APIC register window under virtualization + * environments. These environments tend to disable the + * CPUID_SS feature even though the native CPU supports it. */ TUNABLE_INT_FETCH("hw.clflush_disable", &hw_clflush_disable); - if (cpu_vendor_id == CPU_VENDOR_INTEL && !(cpu_feature & CPUID_SS) && - hw_clflush_disable == -1) + if (vm_guest != VM_GUEST_NO && hw_clflush_disable == -1) cpu_feature &= ~CPUID_CLFSH; /* * Allow to disable CLFLUSH feature manually by - * hw.clflush_disable tunable. This may help Xen guest on some AMD - * CPUs. + * hw.clflush_disable tunable. */ if (hw_clflush_disable == 1) cpu_feature &= ~CPUID_CLFSH; Modified: stable/8/sys/kern/subr_param.c ============================================================================== --- stable/8/sys/kern/subr_param.c Fri Aug 27 18:50:32 2010 (r211890) +++ stable/8/sys/kern/subr_param.c Fri Aug 27 18:55:24 2010 (r211891) @@ -149,6 +149,7 @@ static const char *const vm_bnames[] = { "QEMU", /* QEMU */ "Plex86", /* Plex86 */ "Bochs", /* Bochs */ + "Xen", /* Xen */ NULL }; From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 18:55:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C320910656A3; Fri, 27 Aug 2010 18:55:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B14418FC08; Fri, 27 Aug 2010 18:55:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RItmnW003976; Fri, 27 Aug 2010 18:55:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RItmVS003972; Fri, 27 Aug 2010 18:55:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201008271855.o7RItmVS003972@svn.freebsd.org> From: John Baldwin Date: Fri, 27 Aug 2010 18:55:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211892 - in stable/7/sys: amd64/amd64 i386/i386 kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 18:55:49 -0000 Author: jhb Date: Fri Aug 27 18:55:48 2010 New Revision: 211892 URL: http://svn.freebsd.org/changeset/base/211892 Log: MFC 210774,210935: - Tweak the logic to disable CLFLUSH in virtual environments to work around problems with flushing the local APIC register range so that it checks vm_guest directly. - Add Xen to the list of virtual vendors. In the non PV (HVM) case this fixes the virtualization detection successfully disabling the CLFLUSH instruction. Modified: stable/7/sys/amd64/amd64/initcpu.c stable/7/sys/i386/i386/initcpu.c stable/7/sys/kern/subr_param.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/7/sys/amd64/amd64/initcpu.c Fri Aug 27 18:55:24 2010 (r211891) +++ stable/7/sys/amd64/amd64/initcpu.c Fri Aug 27 18:55:48 2010 (r211892) @@ -177,17 +177,17 @@ initializecpucache() if ((cpu_feature & CPUID_CLFSH) != 0) cpu_clflush_line_size = ((cpu_procinfo >> 8) & 0xff) * 8; /* - * XXXKIB: (temporary) hack to work around traps generated when - * CLFLUSHing APIC registers window. + * XXXKIB: (temporary) hack to work around traps generated + * when CLFLUSHing APIC register window under virtualization + * environments. These environments tend to disable the + * CPUID_SS feature even though the native CPU supports it. */ TUNABLE_INT_FETCH("hw.clflush_disable", &hw_clflush_disable); - if (cpu_vendor_id == CPU_VENDOR_INTEL && !(cpu_feature & CPUID_SS) && - hw_clflush_disable == -1) + if (vm_guest != VM_GUEST_NO && hw_clflush_disable == -1) cpu_feature &= ~CPUID_CLFSH; /* * Allow to disable CLFLUSH feature manually by - * hw.clflush_disable tunable. This may help Xen guest on some AMD - * CPUs. + * hw.clflush_disable tunable. */ if (hw_clflush_disable == 1) cpu_feature &= ~CPUID_CLFSH; Modified: stable/7/sys/i386/i386/initcpu.c ============================================================================== --- stable/7/sys/i386/i386/initcpu.c Fri Aug 27 18:55:24 2010 (r211891) +++ stable/7/sys/i386/i386/initcpu.c Fri Aug 27 18:55:48 2010 (r211892) @@ -724,17 +724,17 @@ initializecpu(void) if ((cpu_feature & CPUID_CLFSH) != 0) cpu_clflush_line_size = ((cpu_procinfo >> 8) & 0xff) * 8; /* - * XXXKIB: (temporary) hack to work around traps generated when - * CLFLUSHing APIC registers window. + * XXXKIB: (temporary) hack to work around traps generated + * when CLFLUSHing APIC register window under virtualization + * environments. These environments tend to disable the + * CPUID_SS feature even though the native CPU supports it. */ TUNABLE_INT_FETCH("hw.clflush_disable", &hw_clflush_disable); - if (cpu_vendor_id == CPU_VENDOR_INTEL && !(cpu_feature & CPUID_SS) && - hw_clflush_disable == -1) + if (vm_guest != VM_GUEST_NO && hw_clflush_disable == -1) cpu_feature &= ~CPUID_CLFSH; /* * Allow to disable CLFLUSH feature manually by - * hw.clflush_disable tunable. This may help Xen guest on some AMD - * CPUs. + * hw.clflush_disable tunable. */ if (hw_clflush_disable == 1) cpu_feature &= ~CPUID_CLFSH; Modified: stable/7/sys/kern/subr_param.c ============================================================================== --- stable/7/sys/kern/subr_param.c Fri Aug 27 18:55:24 2010 (r211891) +++ stable/7/sys/kern/subr_param.c Fri Aug 27 18:55:48 2010 (r211892) @@ -145,6 +145,7 @@ static const char *const vm_bnames[] = { "QEMU", /* QEMU */ "Plex86", /* Plex86 */ "Bochs", /* Bochs */ + "Xen", /* Xen */ NULL }; From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 19:53:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 599E5106567A; Fri, 27 Aug 2010 19:53:57 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 47CEB8FC08; Fri, 27 Aug 2010 19:53:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RJrv6v005728; Fri, 27 Aug 2010 19:53:57 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RJrvgX005721; Fri, 27 Aug 2010 19:53:57 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201008271953.o7RJrvgX005721@svn.freebsd.org> From: "Jayachandran C." Date: Fri, 27 Aug 2010 19:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211893 - head/sys/mips/rmi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 19:53:57 -0000 Author: jchandra Date: Fri Aug 27 19:53:57 2010 New Revision: 211893 URL: http://svn.freebsd.org/changeset/base/211893 Log: Revamp XLR interrupt handling, the previous scheme does not work well on SMP. We used to route all PIC based interrupts to cpu 0, and used the per-CPU interrupt mask to enable/disable interrupts. But the interrupt threads can run on any cpu on SMP, and the interrupt thread will re-enable the interrupts on the CPU it runs on when it is done, and not on cpu0 where the PIC will still send interrupts to. The fix is move the disable/enable for PIC based interrupts to PIC, we will ack on PIC only when the interrupt thread is done, and we do not use the per-CPU interrupt mask. The changes also introduce a way for subsystems to add a function that will be called to clear the interrupt on the subsystem. Currently This is used by the PCI/PCIe for doing additional work during the interrupt handling. Modified: head/sys/mips/rmi/interrupt.h head/sys/mips/rmi/intr_machdep.c head/sys/mips/rmi/iodi.c head/sys/mips/rmi/pic.h head/sys/mips/rmi/xlr_machdep.c head/sys/mips/rmi/xlr_pci.c Modified: head/sys/mips/rmi/interrupt.h ============================================================================== --- head/sys/mips/rmi/interrupt.h Fri Aug 27 18:55:48 2010 (r211892) +++ head/sys/mips/rmi/interrupt.h Fri Aug 27 19:53:57 2010 (r211893) @@ -40,10 +40,9 @@ * XLR needs custom pre and post handlers for PCI/PCI-e interrupts * XXX: maybe follow i386 intsrc model */ -void xlr_cpu_establish_hardintr(const char *, driver_filter_t *, - driver_intr_t *, void *, int, int, void **, void (*)(void *), - void (*)(void *), void (*)(void *), int (*)(void *, u_char)); -void xlr_mask_hard_irq(void *); -void xlr_unmask_hard_irq(void *); +void xlr_establish_intr(const char *name, driver_filter_t filt, + driver_intr_t handler, void *arg, int irq, int flags, + void **cookiep, void (*busack)(int)); +void xlr_enable_irq(int irq); #endif /* _RMI_INTERRUPT_H_ */ Modified: head/sys/mips/rmi/intr_machdep.c ============================================================================== --- head/sys/mips/rmi/intr_machdep.c Fri Aug 27 18:55:48 2010 (r211892) +++ head/sys/mips/rmi/intr_machdep.c Fri Aug 27 19:53:57 2010 (r211893) @@ -49,34 +49,76 @@ __FBSDID("$FreeBSD$"); #include #include -/*#include */ +struct xlr_intrsrc { + void (*busack)(int); /* Additional ack */ + struct intr_event *ie; /* event corresponding to intr */ + int irq; +}; + +static struct xlr_intrsrc xlr_interrupts[XLR_MAX_INTR]; static mips_intrcnt_t mips_intr_counters[XLR_MAX_INTR]; -static struct intr_event *mips_intr_events[XLR_MAX_INTR]; static int intrcnt_index; void -xlr_mask_hard_irq(void *source) +xlr_enable_irq(int irq) { - uintptr_t irq = (uintptr_t) source; - write_c0_eimr64(read_c0_eimr64() & ~(1ULL << irq)); + write_c0_eimr64(read_c0_eimr64() | (1ULL << irq)); } void -xlr_unmask_hard_irq(void *source) +cpu_establish_softintr(const char *name, driver_filter_t * filt, + void (*handler) (void *), void *arg, int irq, int flags, + void **cookiep) { - uintptr_t irq = (uintptr_t) source; - write_c0_eimr64(read_c0_eimr64() | (1ULL << irq)); + panic("Soft interrupts unsupported!\n"); +} + +void +cpu_establish_hardintr(const char *name, driver_filter_t * filt, + void (*handler) (void *), void *arg, int irq, int flags, + void **cookiep) +{ + + xlr_establish_intr(name, filt, handler, arg, irq, flags, + cookiep, NULL); +} + +static void +xlr_post_filter(void *source) +{ + struct xlr_intrsrc *src = source; + + if (src->busack) + src->busack(src->irq); + pic_ack(PIC_IRQ_TO_INTR(src->irq)); +} + +static void +xlr_pre_ithread(void *source) +{ + struct xlr_intrsrc *src = source; + + if (src->busack) + src->busack(src->irq); +} + +static void +xlr_post_ithread(void *source) +{ + struct xlr_intrsrc *src = source; + + pic_ack(PIC_IRQ_TO_INTR(src->irq)); } void -xlr_cpu_establish_hardintr(const char *name, driver_filter_t * filt, - void (*handler) (void *), void *arg, int irq, int flags, void **cookiep, - void (*pre_ithread)(void *), void (*post_ithread)(void *), - void (*post_filter)(void *), int (*assign_cpu)(void *, u_char)) +xlr_establish_intr(const char *name, driver_filter_t filt, + driver_intr_t handler, void *arg, int irq, int flags, + void **cookiep, void (*busack)(int)) { struct intr_event *ie; /* descriptor for the IRQ */ + struct xlr_intrsrc *src = NULL; int errcode; if (irq < 0 || irq > XLR_MAX_INTR) @@ -86,43 +128,37 @@ xlr_cpu_establish_hardintr(const char *n * FIXME locking - not needed now, because we do this only on * startup from CPU0 */ - ie = mips_intr_events[irq]; - /* mih->cntp = &intrcnt[irq]; */ - if (ie == NULL) { - errcode = intr_event_create(&ie, (void *)(uintptr_t) irq, 0, - irq, pre_ithread, post_ithread, post_filter, assign_cpu, - "hard intr%d:", irq); + printf("[%s] Setup intr %d called on cpu %d (%d)\n", name, irq, + xlr_cpu_id(), PCPU_GET(cpuid)); + src = &xlr_interrupts[irq]; + ie = src->ie; + if (ie == NULL) { + /* + * PIC based interrupts need ack in PIC, and some SoC + * components need additional acks (e.g. PCI) + */ + if (PIC_IRQ_IS_PICINTR(irq)) + errcode = intr_event_create(&ie, src, 0, irq, + xlr_pre_ithread, xlr_post_ithread, xlr_post_filter, + NULL, "hard intr%d:", irq); + else { + if (filt == NULL) + panic("Not supported - non filter percpu intr"); + errcode = intr_event_create(&ie, src, 0, irq, + NULL, NULL, NULL, NULL, "hard intr%d:", irq); + } if (errcode) { printf("Could not create event for intr %d\n", irq); return; } - mips_intr_events[irq] = ie; + src->irq = irq; + src->busack = busack; + src->ie = ie; } - intr_event_add_handler(ie, name, filt, handler, arg, intr_priority(flags), flags, cookiep); - xlr_unmask_hard_irq((void *)(uintptr_t) irq); -} - -void -cpu_establish_hardintr(const char *name, driver_filter_t * filt, - void (*handler) (void *), void *arg, int irq, int flags, void **cookiep) -{ - xlr_cpu_establish_hardintr(name, filt, handler, arg, irq, - flags, cookiep, xlr_mask_hard_irq, xlr_unmask_hard_irq, - NULL, NULL); -} - -void -cpu_establish_softintr(const char *name, driver_filter_t * filt, - void (*handler) (void *), void *arg, int irq, int flags, - void **cookiep) -{ - /* we don't separate them into soft/hard like other mips */ - xlr_cpu_establish_hardintr(name, filt, handler, arg, irq, - flags, cookiep, xlr_mask_hard_irq, xlr_unmask_hard_irq, - NULL, NULL); + xlr_enable_irq(irq); } void @@ -148,7 +184,7 @@ cpu_intr(struct trapframe *tf) * compare which ACKs the interrupt. */ if (eirr & (1 << IRQ_TIMER)) { - intr_event_handle(mips_intr_events[IRQ_TIMER], tf); + intr_event_handle(xlr_interrupts[IRQ_TIMER].ie, tf); critical_exit(); return; } @@ -158,7 +194,7 @@ cpu_intr(struct trapframe *tf) if ((eirr & (1ULL << i)) == 0) continue; - ie = mips_intr_events[i]; + ie = xlr_interrupts[i].ie; /* Don't account special IRQs */ switch (i) { case IRQ_IPI: @@ -167,16 +203,12 @@ cpu_intr(struct trapframe *tf) default: mips_intrcnt_inc(mips_intr_counters[i]); } + + /* Ack the IRQ on the CPU */ write_c0_eirr64(1ULL << i); - pic_ack(i); - if (!ie || TAILQ_EMPTY(&ie->ie_handlers)) { - printf("stray interrupt %d\n", i); - continue; - } if (intr_event_handle(ie, tf) != 0) { printf("stray interrupt %d\n", i); } - pic_delayed_ack(i); } critical_exit(); } Modified: head/sys/mips/rmi/iodi.c ============================================================================== --- head/sys/mips/rmi/iodi.c Fri Aug 27 18:55:48 2010 (r211892) +++ head/sys/mips/rmi/iodi.c Fri Aug 27 19:53:57 2010 (r211893) @@ -99,7 +99,7 @@ iodi_setup_intr(device_t dev, device_t c /* FIXME uart 1? */ cpu_establish_hardintr("uart", filt, intr, arg, PIC_UART_0_IRQ, flags, cookiep); - pic_setup_intr(PIC_IRT_UART_0_INDEX, PIC_UART_0_IRQ, 0x1); + pic_setup_intr(PIC_IRT_UART_0_INDEX, PIC_UART_0_IRQ, 0x1, 0); } else if (strcmp(device_get_name(child), "rge") == 0) { int irq; @@ -107,11 +107,11 @@ iodi_setup_intr(device_t dev, device_t c irq = (intptr_t)ires->__r_i; cpu_establish_hardintr("rge", filt, intr, arg, irq, flags, cookiep); - pic_setup_intr(irq - PIC_IRQ_BASE, irq, 0x1); + pic_setup_intr(irq - PIC_IRQ_BASE, irq, 0x1, 0); } else if (strcmp(device_get_name(child), "ehci") == 0) { cpu_establish_hardintr("ehci", filt, intr, arg, PIC_USB_IRQ, flags, cookiep); - pic_setup_intr(PIC_USB_IRQ - PIC_IRQ_BASE, PIC_USB_IRQ, 0x1); + pic_setup_intr(PIC_USB_IRQ - PIC_IRQ_BASE, PIC_USB_IRQ, 0x1, 0); } return (0); Modified: head/sys/mips/rmi/pic.h ============================================================================== --- head/sys/mips/rmi/pic.h Fri Aug 27 18:55:48 2010 (r211892) +++ head/sys/mips/rmi/pic.h Fri Aug 27 19:53:57 2010 (r211893) @@ -29,16 +29,15 @@ * * RMI_BSD */ #ifndef _RMI_PIC_H_ -#define _RMI_PIC_H_ -#include +#define _RMI_PIC_H_ +#include #include #include #include #define PIC_IRT_WD_INDEX 0 #define PIC_IRT_TIMER_INDEX(i) (1 + (i)) -#define PIC_IRT_CLOCK_INDEX PIC_IRT_TIMER_7_INDEX #define PIC_IRT_UART_0_INDEX 9 #define PIC_IRT_UART_1_INDEX 10 #define PIC_IRT_I2C_0_INDEX 11 @@ -70,7 +69,6 @@ #define PIC_IRT_PCIE_FATAL_INDEX 29 #define PIC_IRT_GPIO_B_INDEX 30 #define PIC_IRT_USB_INDEX 31 - #define PIC_NUM_IRTS 32 #define PIC_CLOCK_TIMER 7 @@ -102,7 +100,6 @@ #define PIC_TIMER_COUNT_1(i) (PIC_TIMER_COUNT_0_BASE + (i)) #define PIC_TIMER_HZ 66000000U - /* * We use a simple mapping form PIC interrupts to CPU IRQs. * The PIC interrupts 0-31 are mapped to CPU irq's 8-39. @@ -111,7 +108,7 @@ */ #define PIC_IRQ_BASE 8 #define PIC_INTR_TO_IRQ(i) (PIC_IRQ_BASE + (i)) -#define PIC_IRT_FIRST_IRQ PIC_IRQ_BASE +#define PIC_IRQ_TO_INTR(i) ((i) - PIC_IRQ_BASE) #define PIC_WD_IRQ (PIC_IRQ_BASE + PIC_IRT_WD_INDEX) #define PIC_TIMER_IRQ(i) (PIC_IRQ_BASE + PIC_IRT_TIMER_INDEX(i)) @@ -137,7 +134,6 @@ #define PIC_BRIDGE_BERR_IRQ (PIC_IRQ_BASE + PIC_IRT_BRIDGE_BERR_INDEX) #define PIC_BRIDGE_TB_IRQ (PIC_IRQ_BASE + PIC_IRT_BRIDGE_TB_INDEX) #define PIC_BRIDGE_AERR_NMI_IRQ (PIC_IRQ_BASE + PIC_IRT_BRIDGE_AERR_NMI_INDEX) - #define PIC_BRIDGE_ERR_IRQ (PIC_IRQ_BASE + PIC_IRT_BRIDGE_ERR_INDEX) #define PIC_PCIE_LINK0_IRQ (PIC_IRQ_BASE + PIC_IRT_PCIE_LINK0_INDEX) #define PIC_PCIE_LINK1_IRQ (PIC_IRQ_BASE + PIC_IRT_PCIE_LINK1_INDEX) @@ -148,9 +144,10 @@ #define PIC_GPIO_B_IRQ (PIC_IRQ_BASE + PIC_IRT_GPIO_B_INDEX) #define PIC_USB_IRQ (PIC_IRQ_BASE + PIC_IRT_USB_INDEX) -#define PIC_IRT_LAST_IRQ PIC_USB_IRQ -#define PIC_IRQ_IS_EDGE_TRIGGERED(irq) (((irq) >= PIC_TIMER_IRQ(0)) && ((irq) <= PIC_TIMER_IRQ(7))) -#define PIC_IRQ_IS_IRT(irq) (((irq) >= PIC_IRT_FIRST_IRQ) && ((irq) <= PIC_IRT_LAST_IRQ)) +#define PIC_IRQ_IS_PICINTR(irq) ((irq) >= PIC_IRQ_BASE && \ + (irq) < PIC_IRQ_BASE + PIC_NUM_IRTS) +#define PIC_IS_EDGE_TRIGGERED(i) ((i) >= PIC_IRT_TIMER_INDEX(0) && \ + (i) <= PIC_IRT_TIMER_INDEX(7)) extern struct mtx xlr_pic_lock; @@ -187,35 +184,11 @@ pic_update_control(__uint32_t control) } static __inline void -pic_ack(int irq) -{ - xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET); - - /* ack the pic, if needed */ - if (!PIC_IRQ_IS_IRT(irq)) - return; - - if (PIC_IRQ_IS_EDGE_TRIGGERED(irq)) { - mtx_lock_spin(&xlr_pic_lock); - xlr_write_reg(mmio, PIC_INT_ACK, (1 << (irq - PIC_IRQ_BASE))); - mtx_unlock_spin(&xlr_pic_lock); - } - return; -} - -static __inline void -pic_delayed_ack(int irq) +pic_ack(int picintr) { xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET); - if (!PIC_IRQ_IS_IRT(irq)) - return; - if (!PIC_IRQ_IS_EDGE_TRIGGERED(irq)) { - mtx_lock_spin(&xlr_pic_lock); - xlr_write_reg(mmio, PIC_INT_ACK, (1 << (irq - PIC_IRQ_BASE))); - mtx_unlock_spin(&xlr_pic_lock); - } - return; + xlr_write_reg(mmio, PIC_INT_ACK, 1 << picintr); } static __inline @@ -230,13 +203,11 @@ void pic_send_ipi(int cpu, int ipi) } static __inline -void pic_setup_intr(int picintr, int irq, uint32_t cpumask) +void pic_setup_intr(int picintr, int irq, uint32_t cpumask, int level) { xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET); - int level; mtx_lock_spin(&xlr_pic_lock); - level = PIC_IRQ_IS_EDGE_TRIGGERED(irq); xlr_write_reg(mmio, PIC_IRT_0(picintr), cpumask); xlr_write_reg(mmio, PIC_IRT_1(picintr), ((1 << 31) | (level << 30) | (1 << 6) | irq)); Modified: head/sys/mips/rmi/xlr_machdep.c ============================================================================== --- head/sys/mips/rmi/xlr_machdep.c Fri Aug 27 18:55:48 2010 (r211892) +++ head/sys/mips/rmi/xlr_machdep.c Fri Aug 27 19:53:57 2010 (r211893) @@ -305,7 +305,7 @@ xlr_pic_init(void) /* Initialize all IRT entries */ for (i = 0; i < PIC_NUM_IRTS; i++) { irq = PIC_INTR_TO_IRQ(i); - level = PIC_IRQ_IS_EDGE_TRIGGERED(irq); + level = PIC_IS_EDGE_TRIGGERED(i); /* Bind all PIC irqs to cpu 0 */ xlr_write_reg(mmio, PIC_IRT_0(i), 0x01); @@ -575,11 +575,11 @@ platform_init_ap(int cpuid) stat |= MIPS_SR_COP_2_BIT | MIPS_SR_COP_0_BIT; mips_wr_status(stat); - xlr_unmask_hard_irq((void *)IRQ_IPI); - xlr_unmask_hard_irq((void *)IRQ_TIMER); + xlr_enable_irq(IRQ_IPI); + xlr_enable_irq(IRQ_TIMER); if (xlr_thr_id() == 0) { xlr_msgring_cpu_init(); - xlr_unmask_hard_irq((void *)IRQ_MSGRING); + xlr_enable_irq(IRQ_MSGRING); } return; Modified: head/sys/mips/rmi/xlr_pci.c ============================================================================== --- head/sys/mips/rmi/xlr_pci.c Fri Aug 27 18:55:48 2010 (r211892) +++ head/sys/mips/rmi/xlr_pci.c Fri Aug 27 19:53:57 2010 (r211893) @@ -403,24 +403,15 @@ xlr_map_msi(device_t pcib, device_t dev, } static void -bridge_pcix_ack(void *arg) +bridge_pcix_ack(int irq) { xlr_read_reg(xlr_io_mmio(XLR_IO_PCIX_OFFSET), 0x140 >> 2); } static void -bridge_pcix_mask_ack(void *arg) +bridge_pcie_ack(int irq) { - - xlr_mask_hard_irq(arg); - bridge_pcix_ack(arg); -} - -static void -bridge_pcie_ack(void *arg) -{ - int irq = (intptr_t)arg; uint32_t reg; xlr_reg_t *pcie_mmio_le = xlr_io_mmio(XLR_IO_PCIE_1_OFFSET); @@ -443,14 +434,6 @@ bridge_pcie_ack(void *arg) xlr_write_reg(pcie_mmio_le, reg>>2, 0xffffffff); } -static void -bridge_pcie_mask_ack(void *arg) -{ - - xlr_mask_hard_irq(arg); - bridge_pcie_ack(arg); -} - static int mips_platform_pci_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, @@ -475,17 +458,13 @@ mips_platform_pci_setup_intr(device_t de return (0); if (xlr_board_info.is_xls == 0) { - xlr_cpu_establish_hardintr(device_get_name(child), filt, - intr, arg, PIC_PCIX_IRQ, flags, cookiep, - bridge_pcix_mask_ack, xlr_unmask_hard_irq, - bridge_pcix_ack, NULL); - pic_setup_intr(PIC_IRT_PCIX_INDEX, PIC_PCIX_IRQ, 0x1); + xlr_establish_intr(device_get_name(child), filt, + intr, arg, PIC_PCIX_IRQ, flags, cookiep, bridge_pcix_ack); + pic_setup_intr(PIC_IRT_PCIX_INDEX, PIC_PCIX_IRQ, 0x1, 0); } else { - xlr_cpu_establish_hardintr(device_get_name(child), filt, - intr, arg, xlrirq, flags, cookiep, - bridge_pcie_mask_ack, xlr_unmask_hard_irq, - bridge_pcie_ack, NULL); - pic_setup_intr(xlrirq - PIC_IRQ_BASE, xlrirq, 0x1); + xlr_establish_intr(device_get_name(child), filt, + intr, arg, xlrirq, flags, cookiep, bridge_pcie_ack); + pic_setup_intr(xlrirq - PIC_IRQ_BASE, xlrirq, 0x1, 0); } return (bus_generic_setup_intr(dev, child, irq, flags, filt, intr, From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 19:57:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E9861065675; Fri, 27 Aug 2010 19:57:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E6AF8FC15; Fri, 27 Aug 2010 19:57:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RJvHL0005867; Fri, 27 Aug 2010 19:57:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RJvHwS005865; Fri, 27 Aug 2010 19:57:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008271957.o7RJvHwS005865@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 27 Aug 2010 19:57:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211894 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 19:57:17 -0000 Author: kib Date: Fri Aug 27 19:57:17 2010 New Revision: 211894 URL: http://svn.freebsd.org/changeset/base/211894 Log: Do not call __pthread_cxa_finalize with invalid struct dl_phdr_info. Reported and tested by: Fabian Keil MFC after: 17 days Modified: head/lib/libc/stdlib/atexit.c Modified: head/lib/libc/stdlib/atexit.c ============================================================================== --- head/lib/libc/stdlib/atexit.c Fri Aug 27 19:53:57 2010 (r211893) +++ head/lib/libc/stdlib/atexit.c Fri Aug 27 19:57:17 2010 (r211894) @@ -200,6 +200,6 @@ __cxa_finalize(void *dso) if (dso == NULL) _MUTEX_DESTROY(&atexit_mutex); - if (&__pthread_cxa_finalize != NULL) + if (has_phdr && &__pthread_cxa_finalize != NULL) __pthread_cxa_finalize(&phdr_info); } From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 20:48:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C55510656A8; Fri, 27 Aug 2010 20:48:13 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C17D8FC12; Fri, 27 Aug 2010 20:48:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RKmDLZ007087; Fri, 27 Aug 2010 20:48:13 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RKmCf0007085; Fri, 27 Aug 2010 20:48:13 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008272048.o7RKmCf0007085@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 27 Aug 2010 20:48:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211895 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 20:48:14 -0000 Author: pjd Date: Fri Aug 27 20:48:12 2010 New Revision: 211895 URL: http://svn.freebsd.org/changeset/base/211895 Log: Add hooks execution. MFC after: 2 weeks Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Fri Aug 27 19:57:17 2010 (r211894) +++ head/sbin/hastd/primary.c Fri Aug 27 20:48:12 2010 (r211895) @@ -1517,6 +1517,8 @@ sync_thread(void *arg __unused) pjdlog_info("Synchronization interrupted. " "%jd bytes synchronized so far.", (intmax_t)synced); + hook_exec(res->hr_exec, "syncintr", + res->hr_name, NULL); } while (!sync_inprogress) { dorewind = true; @@ -1549,6 +1551,8 @@ sync_thread(void *arg __unused) pjdlog_info("Synchronization started. %ju bytes to go.", (uintmax_t)(res->hr_extentsize * activemap_ndirty(res->hr_amp))); + hook_exec(res->hr_exec, "syncstart", + res->hr_name, NULL); } } if (offset < 0) { @@ -1565,6 +1569,8 @@ sync_thread(void *arg __unused) pjdlog_info("Synchronization complete. " "%jd bytes synchronized.", (intmax_t)synced); + hook_exec(res->hr_exec, "syncdone", + res->hr_name, NULL); } mtx_lock(&metadata_lock); res->hr_syncsrc = HAST_SYNCSRC_UNDEF; From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 20:49:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5EFA10656AE; Fri, 27 Aug 2010 20:49:06 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C60178FC19; Fri, 27 Aug 2010 20:49:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RKn6dJ007140; Fri, 27 Aug 2010 20:49:06 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RKn63o007138; Fri, 27 Aug 2010 20:49:06 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008272049.o7RKn63o007138@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 27 Aug 2010 20:49:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211896 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 20:49:06 -0000 Author: pjd Date: Fri Aug 27 20:49:06 2010 New Revision: 211896 URL: http://svn.freebsd.org/changeset/base/211896 Log: Check if no signals were delivered just before going to sleep. MFC after: 2 weeks Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Fri Aug 27 20:48:12 2010 (r211895) +++ head/sbin/hastd/primary.c Fri Aug 27 20:49:06 2010 (r211896) @@ -1988,7 +1988,9 @@ guard_thread(void *arg) rw_unlock(&hio_remote_lock[ii]); } } - (void)cv_timedwait(&hio_guard_cond, &hio_guard_lock, timeout); + /* Sleep only if a signal wasn't delivered in the meantime. */ + if (!sigexit_received && !sighup_received && !sigchld_received) + cv_timedwait(&hio_guard_cond, &hio_guard_lock, timeout); mtx_unlock(&hio_guard_lock); } /* NOTREACHED */ From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 21:20:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 890DD10656A6; Fri, 27 Aug 2010 21:20:32 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7911B8FC12; Fri, 27 Aug 2010 21:20:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RLKWhe007861; Fri, 27 Aug 2010 21:20:32 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RLKWIP007859; Fri, 27 Aug 2010 21:20:32 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008272120.o7RLKWIP007859@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 27 Aug 2010 21:20:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211897 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 21:20:32 -0000 Author: pjd Date: Fri Aug 27 21:20:32 2010 New Revision: 211897 URL: http://svn.freebsd.org/changeset/base/211897 Log: Correct when we log interrupted synchronization. MFC after: 2 weeks Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Fri Aug 27 20:49:06 2010 (r211896) +++ head/sbin/hastd/primary.c Fri Aug 27 21:20:32 2010 (r211897) @@ -1507,18 +1507,16 @@ sync_thread(void *arg __unused) ncomps = HAST_NCOMPONENTS; dorewind = true; - synced = -1; + synced = 0; + offset = -1; for (;;) { mtx_lock(&sync_lock); - if (synced == -1) - synced = 0; - else if (!sync_inprogress) { + if (offset >= 0 && !sync_inprogress) { pjdlog_info("Synchronization interrupted. " "%jd bytes synchronized so far.", (intmax_t)synced); - hook_exec(res->hr_exec, "syncintr", - res->hr_name, NULL); + hook_exec(res->hr_exec, "syncintr", res->hr_name, NULL); } while (!sync_inprogress) { dorewind = true; From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 21:26:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE13510656AC; Fri, 27 Aug 2010 21:26:55 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE6458FC2A; Fri, 27 Aug 2010 21:26:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RLQtk3008042; Fri, 27 Aug 2010 21:26:55 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RLQtBP008040; Fri, 27 Aug 2010 21:26:55 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008272126.o7RLQtBP008040@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 27 Aug 2010 21:26:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211898 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 21:26:56 -0000 Author: pjd Date: Fri Aug 27 21:26:55 2010 New Revision: 211898 URL: http://svn.freebsd.org/changeset/base/211898 Log: When logging to stdout/stderr, flush after each log. MFC after: 2 weeks Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com Modified: head/sbin/hastd/pjdlog.c Modified: head/sbin/hastd/pjdlog.c ============================================================================== --- head/sbin/hastd/pjdlog.c Fri Aug 27 21:20:32 2010 (r211897) +++ head/sbin/hastd/pjdlog.c Fri Aug 27 21:26:55 2010 (r211898) @@ -217,6 +217,7 @@ pjdlogv_common(int loglevel, int debugle if (error != -1) fprintf(out, ": %s.", strerror(error)); fprintf(out, "\n"); + fflush(out); break; } case PJDLOG_MODE_SYSLOG: From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 21:28:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F82D1065695; Fri, 27 Aug 2010 21:28:02 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F5BA8FC22; Fri, 27 Aug 2010 21:28:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RLS2Lh008099; Fri, 27 Aug 2010 21:28:02 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RLS2bn008097; Fri, 27 Aug 2010 21:28:02 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008272128.o7RLS2bn008097@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 27 Aug 2010 21:28:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211899 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 21:28:02 -0000 Author: pjd Date: Fri Aug 27 21:28:02 2010 New Revision: 211899 URL: http://svn.freebsd.org/changeset/base/211899 Log: When SIGTERM or SIGINT is received, terminate worker processes. MFC after: 2 weeks Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Fri Aug 27 21:26:55 2010 (r211898) +++ head/sbin/hastd/hastd.c Fri Aug 27 21:28:02 2010 (r211899) @@ -82,6 +82,10 @@ sighandler(int sig) { switch (sig) { + case SIGINT: + case SIGTERM: + sigexit_received = true; + break; case SIGCHLD: sigchld_received = true; break; @@ -374,6 +378,25 @@ failed: } static void +terminate_workers(void) +{ + struct hast_resource *res; + + pjdlog_info("Termination signal received, exiting."); + TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) { + if (res->hr_workerpid == 0) + continue; + pjdlog_info("Terminating worker process (resource=%s, role=%s, pid=%u).", + res->hr_name, role2str(res->hr_role), res->hr_workerpid); + if (kill(res->hr_workerpid, SIGTERM) == 0) + continue; + pjdlog_errno(LOG_WARNING, + "Unable to send signal to worker process (resource=%s, role=%s, pid=%u).", + res->hr_name, role2str(res->hr_role), res->hr_workerpid); + } +} + +static void listen_accept(void) { struct hast_resource *res; @@ -599,6 +622,11 @@ main_loop(void) int cfd, lfd, maxfd, ret; for (;;) { + if (sigexit_received) { + sigexit_received = false; + terminate_workers(); + exit(EX_OK); + } if (sigchld_received) { sigchld_received = false; child_exit(); @@ -692,6 +720,8 @@ main(int argc, char *argv[]) cfg = yy_config_parse(cfgpath, true); assert(cfg != NULL); + signal(SIGINT, sighandler); + signal(SIGTERM, sighandler); signal(SIGHUP, sighandler); signal(SIGCHLD, sighandler); From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 21:31:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 636221065672; Fri, 27 Aug 2010 21:31:15 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52F648FC21; Fri, 27 Aug 2010 21:31:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RLVFJL008199; Fri, 27 Aug 2010 21:31:15 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RLVFvY008197; Fri, 27 Aug 2010 21:31:15 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008272131.o7RLVFvY008197@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 27 Aug 2010 21:31:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211900 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 21:31:15 -0000 Author: pjd Date: Fri Aug 27 21:31:15 2010 New Revision: 211900 URL: http://svn.freebsd.org/changeset/base/211900 Log: Use ZFS_CTLDIR_NAME instead of hardcoding ".zfs". Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Aug 27 21:28:02 2010 (r211899) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Aug 27 21:31:15 2010 (r211900) @@ -965,9 +965,10 @@ zfsctl_snapdir_lookup(ap) dmu_objset_close(snap); domount: mountpoint_len = strlen(dvp->v_vfsp->mnt_stat.f_mntonname) + - strlen("/.zfs/snapshot/") + strlen(nm) + 1; + strlen("/" ZFS_CTLDIR_NAME "/snapshot/") + strlen(nm) + 1; mountpoint = kmem_alloc(mountpoint_len, KM_SLEEP); - (void) snprintf(mountpoint, mountpoint_len, "%s/.zfs/snapshot/%s", + (void) snprintf(mountpoint, mountpoint_len, + "%s/" ZFS_CTLDIR_NAME "/snapshot/%s", dvp->v_vfsp->mnt_stat.f_mntonname, nm); err = mount_snapshot(curthread, vpp, "zfs", mountpoint, snapname, 0); kmem_free(mountpoint, mountpoint_len); From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 21:38:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F170F10656A9; Fri, 27 Aug 2010 21:38:32 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 4C4F18FC0A; Fri, 27 Aug 2010 21:38:31 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o7RLcR4t083035 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 28 Aug 2010 00:38:27 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o7RLcRAw038234; Sat, 28 Aug 2010 00:38:27 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o7RLcRsJ038233; Sat, 28 Aug 2010 00:38:27 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 28 Aug 2010 00:38:27 +0300 From: Kostik Belousov To: Pawel Jakub Dawidek Message-ID: <20100827213827.GD2396@deviant.kiev.zoral.com.ua> References: <201008272049.o7RKn63o007138@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xdcVs9Jnmkyfpfbh" Content-Disposition: inline In-Reply-To: <201008272049.o7RKn63o007138@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_40, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211896 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 21:38:33 -0000 --xdcVs9Jnmkyfpfbh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 27, 2010 at 08:49:06PM +0000, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Fri Aug 27 20:49:06 2010 > New Revision: 211896 > URL: http://svn.freebsd.org/changeset/base/211896 >=20 > Log: > Check if no signals were delivered just before going to sleep. > =20 > MFC after: 2 weeks > Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com >=20 > Modified: > head/sbin/hastd/primary.c >=20 > Modified: head/sbin/hastd/primary.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sbin/hastd/primary.c Fri Aug 27 20:48:12 2010 (r211895) > +++ head/sbin/hastd/primary.c Fri Aug 27 20:49:06 2010 (r211896) > @@ -1988,7 +1988,9 @@ guard_thread(void *arg) > rw_unlock(&hio_remote_lock[ii]); > } > } > - (void)cv_timedwait(&hio_guard_cond, &hio_guard_lock, timeout); > + /* Sleep only if a signal wasn't delivered in the meantime. */ > + if (!sigexit_received && !sighup_received && !sigchld_received) > + cv_timedwait(&hio_guard_cond, &hio_guard_lock, timeout); > mtx_unlock(&hio_guard_lock); > } > /* NOTREACHED */ I wanted to say that this is racy, because if a signal is delivered after the check is done but before the sleep, you loose. After looking at the signal handler, I noted that you call not async-safe functions in the handler. This is easy way to get undefined behaviour, i.e. probably crash. And wakeup from the handler would have the same race as sigXXX_received check. --xdcVs9Jnmkyfpfbh Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkx4MFMACgkQC3+MBN1Mb4jynwCffUXFzlOu83zhUyVCrxI8POfT rIEAniRX+OPh21oUBgrZyes/YzqrMZcL =n2kn -----END PGP SIGNATURE----- --xdcVs9Jnmkyfpfbh-- From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 21:52:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4E171065696; Fri, 27 Aug 2010 21:52:05 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B432D8FC12; Fri, 27 Aug 2010 21:52:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RLq5RD008686; Fri, 27 Aug 2010 21:52:05 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RLq5jo008684; Fri, 27 Aug 2010 21:52:05 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201008272152.o7RLq5jo008684@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 27 Aug 2010 21:52:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211901 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 21:52:05 -0000 Author: bz Date: Fri Aug 27 21:52:05 2010 New Revision: 211901 URL: http://svn.freebsd.org/changeset/base/211901 Log: MFC r211451: When calculating the expected memory size for userspace, also take the number of syncache entries into account for the surplus we add to account for a possible increase of records in the re-entry window. Discussed with: jhb, silby Modified: stable/8/sys/netinet/tcp_subr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet/tcp_subr.c ============================================================================== --- stable/8/sys/netinet/tcp_subr.c Fri Aug 27 21:31:15 2010 (r211900) +++ stable/8/sys/netinet/tcp_subr.c Fri Aug 27 21:52:05 2010 (r211901) @@ -1018,7 +1018,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) if (req->oldptr == NULL) { m = syncache_pcbcount(); n = V_tcbinfo.ipi_count; - n += imax(n / 8, 10); + n += imax((m + n) / 8, 10); req->oldidx = 2 * (sizeof xig) + (m + n) * sizeof(struct xtcpcb); return (0); From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 21:52:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2CB910656B3; Fri, 27 Aug 2010 21:52:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E26EA8FC21; Fri, 27 Aug 2010 21:52:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RLqsGE008771; Fri, 27 Aug 2010 21:52:54 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RLqsfX008769; Fri, 27 Aug 2010 21:52:54 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201008272152.o7RLqsfX008769@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 27 Aug 2010 21:52:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211903 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 21:52:55 -0000 Author: bz Date: Fri Aug 27 21:52:54 2010 New Revision: 211903 URL: http://svn.freebsd.org/changeset/base/211903 Log: MFC r211451: When calculating the expected memory size for userspace, also take the number of syncache entries into account for the surplus we add to account for a possible increase of records in the re-entry window. Discussed with: jhb, silby Modified: stable/7/sys/netinet/tcp_subr.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/tcp_subr.c ============================================================================== --- stable/7/sys/netinet/tcp_subr.c Fri Aug 27 21:52:27 2010 (r211902) +++ stable/7/sys/netinet/tcp_subr.c Fri Aug 27 21:52:54 2010 (r211903) @@ -939,7 +939,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) if (req->oldptr == NULL) { m = syncache_pcbcount(); n = tcbinfo.ipi_count; - n += imax(n / 8, 10); + n += imax((m + n) / 8, 10); req->oldidx = 2 * (sizeof xig) + (m + n) * sizeof(struct xtcpcb); return (0); From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 21:54:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB91210656A8; Fri, 27 Aug 2010 21:54:16 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 929248FC1F; Fri, 27 Aug 2010 21:54:16 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id A1D6E45EE5; Fri, 27 Aug 2010 23:54:14 +0200 (CEST) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 9DF1945EA4; Fri, 27 Aug 2010 23:54:08 +0200 (CEST) Date: Fri, 27 Aug 2010 23:54:02 +0200 From: Pawel Jakub Dawidek To: Kostik Belousov Message-ID: <20100827215402.GB2077@garage.freebsd.pl> References: <201008272049.o7RKn63o007138@svn.freebsd.org> <20100827213827.GD2396@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TakKZr9L6Hm6aLOc" Content-Disposition: inline In-Reply-To: <20100827213827.GD2396@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211896 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 21:54:17 -0000 --TakKZr9L6Hm6aLOc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Aug 28, 2010 at 12:38:27AM +0300, Kostik Belousov wrote: > > --- head/sbin/hastd/primary.c Fri Aug 27 20:48:12 2010 (r211895) > > +++ head/sbin/hastd/primary.c Fri Aug 27 20:49:06 2010 (r211896) > > @@ -1988,7 +1988,9 @@ guard_thread(void *arg) > > rw_unlock(&hio_remote_lock[ii]); > > } > > } > > - (void)cv_timedwait(&hio_guard_cond, &hio_guard_lock, timeout); > > + /* Sleep only if a signal wasn't delivered in the meantime. */ > > + if (!sigexit_received && !sighup_received && !sigchld_received) > > + cv_timedwait(&hio_guard_cond, &hio_guard_lock, timeout); > > mtx_unlock(&hio_guard_lock); > > } > > /* NOTREACHED */ > I wanted to say that this is racy, because if a signal is delivered after > the check is done but before the sleep, you loose. Yes, I know it is racy, but the race isn't critical anymore, as we will eventually wait at most 10 seconds to handle signals. > After looking at the signal handler, I noted that you call not async-safe > functions in the handler. This is easy way to get undefined behaviour, > i.e. probably crash. And wakeup from the handler would have the same > race as sigXXX_received check. Which aren't async-safe? pthread stuff? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --TakKZr9L6Hm6aLOc Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkx4M/oACgkQForvXbEpPzSemQCePvHcTbrskj5kyX4ZspOgCWoh /iYAnAsnL57koDHXhA3063IMp9YU5jcJ =2+VM -----END PGP SIGNATURE----- --TakKZr9L6Hm6aLOc-- From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 23:22:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 708081065695; Fri, 27 Aug 2010 23:22:58 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60AFD8FC08; Fri, 27 Aug 2010 23:22:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RNMwS3010793; Fri, 27 Aug 2010 23:22:58 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RNMwDt010791; Fri, 27 Aug 2010 23:22:58 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201008272322.o7RNMwDt010791@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 27 Aug 2010 23:22:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211904 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 23:22:58 -0000 Author: bz Date: Fri Aug 27 23:22:58 2010 New Revision: 211904 URL: http://svn.freebsd.org/changeset/base/211904 Log: MFp4 CH=182972: Add explicit linkstate UP/DOWN for the epair. This is needed by carp(4) and other things to work. MFC after: 5 days Modified: head/sys/net/if_epair.c Modified: head/sys/net/if_epair.c ============================================================================== --- head/sys/net/if_epair.c Fri Aug 27 21:52:54 2010 (r211903) +++ head/sys/net/if_epair.c Fri Aug 27 23:22:58 2010 (r211904) @@ -832,6 +832,8 @@ epair_clone_create(struct if_clone *ifc, /* Tell the world, that we are ready to rock. */ sca->ifp->if_drv_flags |= IFF_DRV_RUNNING; scb->ifp->if_drv_flags |= IFF_DRV_RUNNING; + if_link_state_change(sca->ifp, LINK_STATE_UP); + if_link_state_change(scb->ifp, LINK_STATE_UP); return (0); } @@ -859,6 +861,8 @@ epair_clone_destroy(struct if_clone *ifc scb = oifp->if_softc; DPRINTF("ifp=%p oifp=%p\n", ifp, oifp); + if_link_state_change(ifp, LINK_STATE_DOWN); + if_link_state_change(oifp, LINK_STATE_DOWN); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; oifp->if_drv_flags &= ~IFF_DRV_RUNNING; ether_ifdetach(oifp); From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 23:24:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FED11065694; Fri, 27 Aug 2010 23:24:09 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 400798FC0A; Fri, 27 Aug 2010 23:24:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RNO9Bq010858; Fri, 27 Aug 2010 23:24:09 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RNO9CH010856; Fri, 27 Aug 2010 23:24:09 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201008272324.o7RNO9CH010856@svn.freebsd.org> From: Jack F Vogel Date: Fri, 27 Aug 2010 23:24:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211905 - head/sys/dev/ichsmb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 23:24:09 -0000 Author: jfv Date: Fri Aug 27 23:24:08 2010 New Revision: 211905 URL: http://svn.freebsd.org/changeset/base/211905 Log: Add support for Intel Cougar Point SMBus controller. MFC afer 1 week Modified: head/sys/dev/ichsmb/ichsmb_pci.c Modified: head/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- head/sys/dev/ichsmb/ichsmb_pci.c Fri Aug 27 23:22:58 2010 (r211904) +++ head/sys/dev/ichsmb/ichsmb_pci.c Fri Aug 27 23:24:08 2010 (r211905) @@ -81,6 +81,7 @@ __FBSDID("$FreeBSD$"); #define ID_PCH 0x3b308086 #define ID_6300ESB 0x25a48086 #define ID_631xESB 0x269b8086 +#define ID_CPT 0x1c228086 #define PCIS_SERIALBUS_SMBUS_PROGIF 0x00 @@ -174,6 +175,9 @@ ichsmb_pci_probe(device_t dev) case ID_631xESB: device_set_desc(dev, "Intel 631xESB/6321ESB (ESB2) SMBus controller"); break; + case ID_CPT: + device_set_desc(dev, "Intel Cougar Point SMBus controller"); + break; default: return (ENXIO); } From owner-svn-src-all@FreeBSD.ORG Fri Aug 27 23:50:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3812C106566C; Fri, 27 Aug 2010 23:50:14 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27F4E8FC16; Fri, 27 Aug 2010 23:50:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7RNoE6E011442; Fri, 27 Aug 2010 23:50:14 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7RNoEt5011440; Fri, 27 Aug 2010 23:50:14 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008272350.o7RNoEt5011440@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 27 Aug 2010 23:50:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211906 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 23:50:14 -0000 Author: yongari Date: Fri Aug 27 23:50:13 2010 New Revision: 211906 URL: http://svn.freebsd.org/changeset/base/211906 Log: Make sure not to access unallocated stats memory. Reviewed by: jfv Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Fri Aug 27 23:24:08 2010 (r211905) +++ head/sys/dev/e1000/if_igb.c Fri Aug 27 23:50:13 2010 (r211906) @@ -509,6 +509,11 @@ igb_attach(device_t dev) adapter->stats = (struct e1000_hw_stats *)malloc(sizeof \ (struct e1000_hw_stats), M_DEVBUF, M_NOWAIT | M_ZERO); + if (adapter->stats == NULL) { + device_printf(dev, "Can not allocate stats memory\n"); + error = ENOMEM; + goto err_late; + } /* ** Start from a known state, this is @@ -4893,7 +4898,8 @@ igb_vf_init_stats(struct adapter *adapte struct e1000_vf_stats *stats; stats = (struct e1000_vf_stats *)adapter->stats; - + if (stats == NULL) + return; stats->last_gprc = E1000_READ_REG(hw, E1000_VFGPRC); stats->last_gorc = E1000_READ_REG(hw, E1000_VFGORC); stats->last_gptc = E1000_READ_REG(hw, E1000_VFGPTC); From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 00:09:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C04410656C3; Sat, 28 Aug 2010 00:09:19 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A5D58FC16; Sat, 28 Aug 2010 00:09:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7S09Jjx011926; Sat, 28 Aug 2010 00:09:19 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7S09Jt9011920; Sat, 28 Aug 2010 00:09:19 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008280009.o7S09Jt9011920@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 28 Aug 2010 00:09:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211907 - in head/sys/dev: e1000 ixgb ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 00:09:19 -0000 Author: yongari Date: Sat Aug 28 00:09:19 2010 New Revision: 211907 URL: http://svn.freebsd.org/changeset/base/211907 Log: Do not call voluntary panic(9) in case of if_alloc() failure. Reviewed by: jfv Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_lem.c head/sys/dev/ixgb/if_ixgb.c head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Fri Aug 27 23:50:13 2010 (r211906) +++ head/sys/dev/e1000/if_em.c Sat Aug 28 00:09:19 2010 (r211907) @@ -213,7 +213,7 @@ static int em_setup_msix(struct adapter static void em_free_pci_resources(struct adapter *); static void em_local_timer(void *); static void em_reset(struct adapter *); -static void em_setup_interface(device_t, struct adapter *); +static int em_setup_interface(device_t, struct adapter *); static void em_setup_transmit_structures(struct adapter *); static void em_initialize_transmit_unit(struct adapter *); @@ -628,7 +628,8 @@ em_attach(device_t dev) em_get_wakeup(dev); /* Setup OS specific network interface */ - em_setup_interface(dev, adapter); + if (em_setup_interface(dev, adapter) != 0) + goto err_late; em_reset(adapter); @@ -669,6 +670,8 @@ err_late: em_free_transmit_structures(adapter); em_free_receive_structures(adapter); em_release_hw_control(adapter); + if (adapter->ifp != NULL) + if_free(adapter->ifp); err_pci: em_free_pci_resources(adapter); EM_CORE_LOCK_DESTROY(adapter); @@ -2646,7 +2649,7 @@ em_reset(struct adapter *adapter) * Setup networking device structure and register an interface. * **********************************************************************/ -static void +static int em_setup_interface(device_t dev, struct adapter *adapter) { struct ifnet *ifp; @@ -2654,8 +2657,10 @@ em_setup_interface(device_t dev, struct INIT_DEBUGOUT("em_setup_interface: begin"); ifp = adapter->ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) - panic("%s: can not if_alloc()", device_get_nameunit(dev)); + if (ifp == NULL) { + device_printf(dev, "can not allocate ifnet structure\n"); + return (-1); + } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_mtu = ETHERMTU; ifp->if_init = em_init; @@ -2742,6 +2747,7 @@ em_setup_interface(device_t dev, struct } ifmedia_add(&adapter->media, IFM_ETHER | IFM_AUTO, 0, NULL); ifmedia_set(&adapter->media, IFM_ETHER | IFM_AUTO); + return (0); } Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Fri Aug 27 23:50:13 2010 (r211906) +++ head/sys/dev/e1000/if_igb.c Sat Aug 28 00:09:19 2010 (r211907) @@ -178,7 +178,7 @@ static int igb_setup_msix(struct adapter static void igb_free_pci_resources(struct adapter *); static void igb_local_timer(void *); static void igb_reset(struct adapter *); -static void igb_setup_interface(device_t, struct adapter *); +static int igb_setup_interface(device_t, struct adapter *); static int igb_allocate_queues(struct adapter *); static void igb_configure_queues(struct adapter *); @@ -564,7 +564,8 @@ igb_attach(device_t dev) goto err_late; /* Setup OS specific network interface */ - igb_setup_interface(dev, adapter); + if (igb_setup_interface(dev, adapter) != 0) + goto err_late; /* Now get a good starting state */ igb_reset(adapter); @@ -613,6 +614,8 @@ err_late: igb_free_transmit_structures(adapter); igb_free_receive_structures(adapter); igb_release_hw_control(adapter); + if (adapter->ifp != NULL) + if_free(adapter->ifp); err_pci: igb_free_pci_resources(adapter); IGB_CORE_LOCK_DESTROY(adapter); @@ -2658,7 +2661,7 @@ igb_reset(struct adapter *adapter) * Setup networking device structure and register an interface. * **********************************************************************/ -static void +static int igb_setup_interface(device_t dev, struct adapter *adapter) { struct ifnet *ifp; @@ -2666,8 +2669,10 @@ igb_setup_interface(device_t dev, struct INIT_DEBUGOUT("igb_setup_interface: begin"); ifp = adapter->ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) - panic("%s: can not if_alloc()", device_get_nameunit(dev)); + if (ifp == NULL) { + device_printf(dev, "can not allocate ifnet structure\n"); + return (-1); + } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_mtu = ETHERMTU; ifp->if_init = igb_init; @@ -2744,6 +2749,7 @@ igb_setup_interface(device_t dev, struct } ifmedia_add(&adapter->media, IFM_ETHER | IFM_AUTO, 0, NULL); ifmedia_set(&adapter->media, IFM_ETHER | IFM_AUTO); + return (0); } Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Fri Aug 27 23:50:13 2010 (r211906) +++ head/sys/dev/e1000/if_lem.c Sat Aug 28 00:09:19 2010 (r211907) @@ -186,7 +186,7 @@ static int lem_allocate_irq(struct adapt static void lem_free_pci_resources(struct adapter *); static void lem_local_timer(void *); static int lem_hardware_init(struct adapter *); -static void lem_setup_interface(device_t, struct adapter *); +static int lem_setup_interface(device_t, struct adapter *); static void lem_setup_transmit_structures(struct adapter *); static void lem_initialize_transmit_unit(struct adapter *); static int lem_setup_receive_structures(struct adapter *); @@ -620,7 +620,8 @@ lem_attach(device_t dev) lem_get_wakeup(dev); /* Setup OS specific network interface */ - lem_setup_interface(dev, adapter); + if (lem_setup_interface(dev, adapter) != 0) + goto err_rx_struct; /* Initialize statistics */ lem_update_stats_counters(adapter); @@ -672,6 +673,8 @@ err_rx_desc: lem_dma_free(adapter, &adapter->txdma); err_tx_desc: err_pci: + if (adapter->ifp != NULL) + if_free(adapter->ifp); lem_free_pci_resources(adapter); EM_TX_LOCK_DESTROY(adapter); EM_RX_LOCK_DESTROY(adapter); @@ -2388,7 +2391,7 @@ lem_hardware_init(struct adapter *adapte * Setup networking device structure and register an interface. * **********************************************************************/ -static void +static int lem_setup_interface(device_t dev, struct adapter *adapter) { struct ifnet *ifp; @@ -2396,8 +2399,10 @@ lem_setup_interface(device_t dev, struct INIT_DEBUGOUT("lem_setup_interface: begin"); ifp = adapter->ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) - panic("%s: can not if_alloc()", device_get_nameunit(dev)); + if (ifp == NULL) { + device_printf(dev, "can not allocate ifnet structure\n"); + return (-1); + } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_mtu = ETHERMTU; ifp->if_init = lem_init; @@ -2473,6 +2478,7 @@ lem_setup_interface(device_t dev, struct } ifmedia_add(&adapter->media, IFM_ETHER | IFM_AUTO, 0, NULL); ifmedia_set(&adapter->media, IFM_ETHER | IFM_AUTO); + return (0); } Modified: head/sys/dev/ixgb/if_ixgb.c ============================================================================== --- head/sys/dev/ixgb/if_ixgb.c Fri Aug 27 23:50:13 2010 (r211906) +++ head/sys/dev/ixgb/if_ixgb.c Sat Aug 28 00:09:19 2010 (r211907) @@ -108,7 +108,7 @@ static int ixgb_allocate_pci_resour static void ixgb_free_pci_resources(struct adapter *); static void ixgb_local_timer(void *); static int ixgb_hardware_init(struct adapter *); -static void ixgb_setup_interface(device_t, struct adapter *); +static int ixgb_setup_interface(device_t, struct adapter *); static int ixgb_setup_transmit_structures(struct adapter *); static void ixgb_initialize_transmit_unit(struct adapter *); static int ixgb_setup_receive_structures(struct adapter *); @@ -331,7 +331,8 @@ ixgb_attach(device_t dev) goto err_hw_init; } /* Setup OS specific network interface */ - ixgb_setup_interface(dev, adapter); + if (ixgb_setup_interface(dev, adapter) != 0) + goto err_hw_init; /* Initialize statistics */ ixgb_clear_hw_cntrs(&adapter->hw); @@ -346,6 +347,8 @@ err_rx_desc: ixgb_dma_free(adapter, &adapter->txdma); err_tx_desc: err_pci: + if (adapter->ifp != NULL) + if_free(adapter->ifp); ixgb_free_pci_resources(adapter); sysctl_ctx_free(&adapter->sysctl_ctx); return (error); @@ -1319,15 +1322,17 @@ ixgb_hardware_init(struct adapter * adap * Setup networking device structure and register an interface. * **********************************************************************/ -static void +static int ixgb_setup_interface(device_t dev, struct adapter * adapter) { struct ifnet *ifp; INIT_DEBUGOUT("ixgb_setup_interface: begin"); ifp = adapter->ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) - panic("%s: can not if_alloc()\n", device_get_nameunit(dev)); + if (ifp == NULL) { + device_printf(dev, "can not allocate ifnet structure\n"); + return (-1); + } #if __FreeBSD_version >= 502000 if_initname(ifp, device_get_name(dev), device_get_unit(dev)); #else @@ -1379,7 +1384,7 @@ ixgb_setup_interface(device_t dev, struc ifmedia_add(&adapter->media, IFM_ETHER | IFM_AUTO, 0, NULL); ifmedia_set(&adapter->media, IFM_ETHER | IFM_AUTO); - return; + return (0); } /******************************************************************** Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Aug 27 23:50:13 2010 (r211906) +++ head/sys/dev/ixgbe/ixgbe.c Sat Aug 28 00:09:19 2010 (r211907) @@ -119,7 +119,7 @@ static int ixgbe_allocate_queues(struct static int ixgbe_setup_msix(struct adapter *); static void ixgbe_free_pci_resources(struct adapter *); static void ixgbe_local_timer(void *); -static void ixgbe_setup_interface(device_t, struct adapter *); +static int ixgbe_setup_interface(device_t, struct adapter *); static void ixgbe_config_link(struct adapter *); static int ixgbe_allocate_transmit_buffers(struct tx_ring *); @@ -586,7 +586,8 @@ ixgbe_attach(device_t dev) goto err_late; /* Setup OS specific network interface */ - ixgbe_setup_interface(dev, adapter); + if (ixgbe_setup_interface(dev, adapter) != 0) + goto err_late; /* Sysctl for limiting the amount of work done in the taskqueue */ ixgbe_add_rx_process_limit(adapter, "rx_processing_limit", @@ -632,6 +633,8 @@ err_late: ixgbe_free_transmit_structures(adapter); ixgbe_free_receive_structures(adapter); err_out: + if (adapter->ifp != NULL) + if_free(adapter->ifp); ixgbe_free_pci_resources(adapter); return (error); @@ -2357,7 +2360,7 @@ mem: * Setup networking device structure and register an interface. * **********************************************************************/ -static void +static int ixgbe_setup_interface(device_t dev, struct adapter *adapter) { struct ixgbe_hw *hw = &adapter->hw; @@ -2366,8 +2369,10 @@ ixgbe_setup_interface(device_t dev, stru INIT_DEBUGOUT("ixgbe_setup_interface: begin"); ifp = adapter->ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) - panic("%s: can not if_alloc()\n", device_get_nameunit(dev)); + if (ifp == NULL) { + device_printf(dev, "can not allocate ifnet structure\n"); + return (-1); + } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_mtu = ETHERMTU; ifp->if_baudrate = 1000000000; @@ -2415,7 +2420,7 @@ ixgbe_setup_interface(device_t dev, stru ifmedia_add(&adapter->media, IFM_ETHER | IFM_AUTO, 0, NULL); ifmedia_set(&adapter->media, IFM_ETHER | IFM_AUTO); - return; + return (0); } static void From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 00:09:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B37E106566B; Sat, 28 Aug 2010 00:09:47 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A7A18FC1F; Sat, 28 Aug 2010 00:09:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7S09kse011975; Sat, 28 Aug 2010 00:09:46 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7S09k6Z011972; Sat, 28 Aug 2010 00:09:46 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201008280009.o7S09k6Z011972@svn.freebsd.org> From: Jack F Vogel Date: Sat, 28 Aug 2010 00:09:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211908 - head/sys/dev/ichwd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 00:09:47 -0000 Author: jfv Date: Sat Aug 28 00:09:46 2010 New Revision: 211908 URL: http://svn.freebsd.org/changeset/base/211908 Log: Add Intel Cougar Point PCH LPC Controller Device IDs for watchdog support. Also add additional Intel Ibex Peak (5 Series/3400 Series) PCH IDs. MFC after a week Modified: head/sys/dev/ichwd/ichwd.c head/sys/dev/ichwd/ichwd.h Modified: head/sys/dev/ichwd/ichwd.c ============================================================================== --- head/sys/dev/ichwd/ichwd.c Sat Aug 28 00:09:19 2010 (r211907) +++ head/sys/dev/ichwd/ichwd.c Sat Aug 28 00:09:46 2010 (r211908) @@ -110,7 +110,53 @@ static struct ichwd_device ichwd_devices { DEVICEID_ICH10D, "Intel ICH10D watchdog timer", 10 }, { DEVICEID_ICH10DO, "Intel ICH10DO watchdog timer", 10 }, { DEVICEID_ICH10R, "Intel ICH10R watchdog timer", 10 }, + { DEVICEID_PCH, "Intel PCH watchdog timer", 10 }, + { DEVICEID_PCHM, "Intel PCH watchdog timer", 10 }, + { DEVICEID_P55, "Intel P55 watchdog timer", 10 }, + { DEVICEID_PM55, "Intel PM55 watchdog timer", 10 }, { DEVICEID_H55, "Intel H55 watchdog timer", 10 }, + { DEVICEID_QM57, "Intel QM57 watchdog timer", 10 }, + { DEVICEID_H57, "Intel H57 watchdog timer", 10 }, + { DEVICEID_HM55, "Intel HM55 watchdog timer", 10 }, + { DEVICEID_Q57, "Intel Q57 watchdog timer", 10 }, + { DEVICEID_HM57, "Intel HM57 watchdog timer", 10 }, + { DEVICEID_PCHMSFF, "Intel PCHMSFF watchdog timer", 10 }, + { DEVICEID_QS57, "Intel QS57 watchdog timer", 10 }, + { DEVICEID_3400, "Intel 3400 watchdog timer", 10 }, + { DEVICEID_3420, "Intel 3420 watchdog timer", 10 }, + { DEVICEID_3450, "Intel 3450 watchdog timer", 10 }, + { DEVICEID_CPT0, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT1, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT2, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT3, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT4, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT5, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT6, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT7, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT8, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT9, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT10, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT11, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT12, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT13, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT14, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT15, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT16, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT17, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT18, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT19, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT20, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT21, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT22, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT23, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT23, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT25, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT26, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT27, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT28, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT29, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT30, "Intel Cougar Point watchdog timer", 10 }, + { DEVICEID_CPT31, "Intel Cougar Point watchdog timer", 10 }, { 0, NULL, 0 }, }; Modified: head/sys/dev/ichwd/ichwd.h ============================================================================== --- head/sys/dev/ichwd/ichwd.h Sat Aug 28 00:09:19 2010 (r211907) +++ head/sys/dev/ichwd/ichwd.h Sat Aug 28 00:09:46 2010 (r211908) @@ -64,6 +64,38 @@ struct ichwd_softc { }; #define VENDORID_INTEL 0x8086 +#define DEVICEID_CPT0 0x1c40 +#define DEVICEID_CPT1 0x1c41 +#define DEVICEID_CPT2 0x1c42 +#define DEVICEID_CPT3 0x1c43 +#define DEVICEID_CPT4 0x1c44 +#define DEVICEID_CPT5 0x1c45 +#define DEVICEID_CPT6 0x1c46 +#define DEVICEID_CPT7 0x1c47 +#define DEVICEID_CPT8 0x1c48 +#define DEVICEID_CPT9 0x1c49 +#define DEVICEID_CPT10 0x1c4a +#define DEVICEID_CPT11 0x1c4b +#define DEVICEID_CPT12 0x1c4c +#define DEVICEID_CPT13 0x1c4d +#define DEVICEID_CPT14 0x1c4e +#define DEVICEID_CPT15 0x1c4f +#define DEVICEID_CPT16 0x1c50 +#define DEVICEID_CPT17 0x1c51 +#define DEVICEID_CPT18 0x1c52 +#define DEVICEID_CPT19 0x1c53 +#define DEVICEID_CPT20 0x1c54 +#define DEVICEID_CPT21 0x1c55 +#define DEVICEID_CPT22 0x1c56 +#define DEVICEID_CPT23 0x1c57 +#define DEVICEID_CPT24 0x1c58 +#define DEVICEID_CPT25 0x1c59 +#define DEVICEID_CPT26 0x1c5a +#define DEVICEID_CPT27 0x1c5b +#define DEVICEID_CPT28 0x1c5c +#define DEVICEID_CPT29 0x1c5d +#define DEVICEID_CPT30 0x1c5e +#define DEVICEID_CPT31 0x1c5f #define DEVICEID_82801AA 0x2410 #define DEVICEID_82801AB 0x2420 #define DEVICEID_82801BA 0x2440 @@ -100,7 +132,21 @@ struct ichwd_softc { #define DEVICEID_ICH10D 0x3a1a #define DEVICEID_ICH10DO 0x3a14 #define DEVICEID_ICH10R 0x3a16 +#define DEVICEID_PCH 0x3b00 +#define DEVICEID_PCHM 0x3b01 +#define DEVICEID_P55 0x3b02 +#define DEVICEID_PM55 0x3b03 #define DEVICEID_H55 0x3b06 +#define DEVICEID_QM57 0x3b07 +#define DEVICEID_H57 0x3b08 +#define DEVICEID_HM55 0x3b09 +#define DEVICEID_Q57 0x3b0a +#define DEVICEID_HM57 0x3b0b +#define DEVICEID_PCHMSFF 0x3b0d +#define DEVICEID_QS57 0x3b0f +#define DEVICEID_3400 0x3b12 +#define DEVICEID_3420 0x3b14 +#define DEVICEID_3450 0x3b16 /* ICH LPC Interface Bridge Registers (ICH5 and older) */ #define ICH_GEN_STA 0xd4 From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 00:16:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3177F1065695; Sat, 28 Aug 2010 00:16:50 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 212738FC16; Sat, 28 Aug 2010 00:16:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7S0GoYP012177; Sat, 28 Aug 2010 00:16:50 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7S0GoVQ012175; Sat, 28 Aug 2010 00:16:50 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008280016.o7S0GoVQ012175@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 28 Aug 2010 00:16:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211909 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 00:16:50 -0000 Author: yongari Date: Sat Aug 28 00:16:49 2010 New Revision: 211909 URL: http://svn.freebsd.org/changeset/base/211909 Log: If em(4) failed to allocate RX buffers, do not call panic(9). Just showing some buffer allocation error is more appropriate action for drivers. This should fix occasional panic reported on em(4) when driver encountered resource shortage. Reviewed by: jfv Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Sat Aug 28 00:09:46 2010 (r211908) +++ head/sys/dev/e1000/if_em.c Sat Aug 28 00:16:49 2010 (r211909) @@ -3843,7 +3843,7 @@ em_setup_receive_ring(struct rx_ring *rx rxbuf = &rxr->rx_buffers[j]; rxbuf->m_head = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); if (rxbuf->m_head == NULL) - panic("RX ring hdr initialization failed!\n"); + return (ENOBUFS); rxbuf->m_head->m_len = MCLBYTES; rxbuf->m_head->m_flags &= ~M_HASFCS; /* we strip it */ rxbuf->m_head->m_pkthdr.len = MCLBYTES; @@ -3852,8 +3852,11 @@ em_setup_receive_ring(struct rx_ring *rx error = bus_dmamap_load_mbuf_sg(rxr->rxtag, rxbuf->map, rxbuf->m_head, seg, &nsegs, BUS_DMA_NOWAIT); - if (error != 0) - panic("RX ring dma initialization failed!\n"); + if (error != 0) { + m_freem(rxbuf->m_head); + rxbuf->m_head = NULL; + return (error); + } bus_dmamap_sync(rxr->rxtag, rxbuf->map, BUS_DMASYNC_PREREAD); From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 00:23:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DEA61065693; Sat, 28 Aug 2010 00:23:13 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DD538FC14; Sat, 28 Aug 2010 00:23:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7S0NDdU012481; Sat, 28 Aug 2010 00:23:13 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7S0NDMK012479; Sat, 28 Aug 2010 00:23:13 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201008280023.o7S0NDMK012479@svn.freebsd.org> From: Jack F Vogel Date: Sat, 28 Aug 2010 00:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211910 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 00:23:13 -0000 Author: jfv Date: Sat Aug 28 00:23:13 2010 New Revision: 211910 URL: http://svn.freebsd.org/changeset/base/211910 Log: Add Intel Cougar Point PCH HD Audio Controller ID MFC in a week Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Sat Aug 28 00:16:49 2010 (r211909) +++ head/sys/dev/sound/pci/hda/hdac.c Sat Aug 28 00:23:13 2010 (r211910) @@ -140,6 +140,7 @@ SND_DECLARE_FILE("$FreeBSD$"); /* Intel */ #define INTEL_VENDORID 0x8086 +#define HDA_INTEL_CPT HDA_MODEL_CONSTRUCT(INTEL, 0x1c20) #define HDA_INTEL_82801F HDA_MODEL_CONSTRUCT(INTEL, 0x2668) #define HDA_INTEL_63XXESB HDA_MODEL_CONSTRUCT(INTEL, 0x269a) #define HDA_INTEL_82801G HDA_MODEL_CONSTRUCT(INTEL, 0x27d8) @@ -486,6 +487,7 @@ static const struct { char *desc; char flags; } hdac_devices[] = { + { HDA_INTEL_CPT, "Intel Cougar Point", 0 }, { HDA_INTEL_82801F, "Intel 82801F", 0 }, { HDA_INTEL_63XXESB, "Intel 631x/632xESB", 0 }, { HDA_INTEL_82801G, "Intel 82801G", 0 }, From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 00:27:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C6041065693; Sat, 28 Aug 2010 00:27:48 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B24D8FC17; Sat, 28 Aug 2010 00:27:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7S0Rm9N012668; Sat, 28 Aug 2010 00:27:48 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7S0Rmfv012666; Sat, 28 Aug 2010 00:27:48 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201008280027.o7S0Rmfv012666@svn.freebsd.org> From: Kirk McKusick Date: Sat, 28 Aug 2010 00:27:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211911 - stable/8/sbin/fsck_ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 00:27:48 -0000 Author: mckusick Date: Sat Aug 28 00:27:47 2010 New Revision: 211911 URL: http://svn.freebsd.org/changeset/base/211911 Log: MFC of -r210382 to note that foreground fsck should be run after a filesystem related panic. Also -r210933 and -r211397 by joel to fix typos and spelling mistakes. Modified: stable/8/sbin/fsck_ffs/fsck_ffs.8 Modified: stable/8/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- stable/8/sbin/fsck_ffs/fsck_ffs.8 Sat Aug 28 00:23:13 2010 (r211910) +++ stable/8/sbin/fsck_ffs/fsck_ffs.8 Sat Aug 28 00:27:47 2010 (r211911) @@ -176,10 +176,10 @@ the super block for the file system. An alternate super block is usually located at block 32 for UFS1, and block 160 for UFS2. .It Fl C -Check if file system was dismouted cleanly. +Check if file system was dismounted cleanly. If so, skip file system checks (like "preen"). However, if the file system was not cleanly dismounted, do full checks, -is if +as if .Nm was invoked without .Fl C . @@ -315,6 +315,15 @@ If the .Pa lost+found directory does not exist, it is created. If there is insufficient space its size is increased. +.Pp +The full foreground +.Nm +checks for many more problems that may occur after an +unrecoverable disk write error. +Thus, it is recommended that you perform foreground +.Nm +on your systems periodically and whenever you encounter +unrecoverable disk write errors or file-system\-related panics. .Sh FILES .Bl -tag -width /etc/fstab -compact .It Pa /etc/fstab From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 00:30:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 662191065698; Sat, 28 Aug 2010 00:30:57 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 553AE8FC08; Sat, 28 Aug 2010 00:30:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7S0UvWN012792; Sat, 28 Aug 2010 00:30:57 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7S0UvRh012790; Sat, 28 Aug 2010 00:30:57 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201008280030.o7S0UvRh012790@svn.freebsd.org> From: Kirk McKusick Date: Sat, 28 Aug 2010 00:30:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211912 - stable/8/sbin/fsck X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 00:30:57 -0000 Author: mckusick Date: Sat Aug 28 00:30:57 2010 New Revision: 211912 URL: http://svn.freebsd.org/changeset/base/211912 Log: MFC of -r210382 to note that foreground fsck should be run after a filesystem related panic. Also -r210933 by joel to fix typos and spelling mistakes. Modified: stable/8/sbin/fsck/fsck.8 Modified: stable/8/sbin/fsck/fsck.8 ============================================================================== --- stable/8/sbin/fsck/fsck.8 Sat Aug 28 00:27:47 2010 (r211911) +++ stable/8/sbin/fsck/fsck.8 Sat Aug 28 00:30:57 2010 (r211912) @@ -169,6 +169,17 @@ so the check program is invoked with the flag to indicate that a check on the active file system should be done. When running in background mode, only one file system at a time will be checked. +Note that background +.Nm +is limited to checking for only the most commonly occurring +file system abnormalities. +Under certain circumstances, +some errors can escape background +.Nm . +It is recommended that you perform foreground +.Nm +on your systems periodically and whenever you encounter +file-system\-related panics. .It Fl t Ar fstype Invoke .Nm From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 00:34:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1579010656A4; Sat, 28 Aug 2010 00:34:23 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03F818FC14; Sat, 28 Aug 2010 00:34:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7S0YMRT012909; Sat, 28 Aug 2010 00:34:22 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7S0YM0v012898; Sat, 28 Aug 2010 00:34:22 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008280034.o7S0YM0v012898@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 28 Aug 2010 00:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211913 - in head/sys/dev: e1000 ixgb ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 00:34:23 -0000 Author: yongari Date: Sat Aug 28 00:34:22 2010 New Revision: 211913 URL: http://svn.freebsd.org/changeset/base/211913 Log: Do not allocate multicast array memory in multicast filter configuration function. For failed memory allocations, em(4)/lem(4) called panic(9) which is not acceptable on production box. igb(4)/ixgb(4)/ix(4) allocated the required memory in stack which consumed 768 bytes of stack memory which looks too big. To address these issues, allocate multicast array memory in device attach time and make multicast configuration success under any conditions. This change also removes the excessive use of memory in stack. Reviewed by: jfv Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_em.h head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_igb.h head/sys/dev/e1000/if_lem.c head/sys/dev/e1000/if_lem.h head/sys/dev/ixgb/if_ixgb.c head/sys/dev/ixgb/if_ixgb.h head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Sat Aug 28 00:30:57 2010 (r211912) +++ head/sys/dev/e1000/if_em.c Sat Aug 28 00:34:22 2010 (r211913) @@ -576,6 +576,15 @@ em_attach(device_t dev) goto err_pci; } + /* Allocate multicast array memory. */ + adapter->mta = malloc(sizeof(u8) * ETH_ADDR_LEN * + MAX_NUM_MULTICAST_ADDRESSES, M_DEVBUF, M_NOWAIT); + if (adapter->mta == NULL) { + device_printf(dev, "Can not allocate multicast setup array\n"); + error = ENOMEM; + goto err_late; + } + /* ** Start from a known state, this is ** important in reading the nvm and @@ -674,6 +683,7 @@ err_late: if_free(adapter->ifp); err_pci: em_free_pci_resources(adapter); + free(adapter->mta, M_DEVBUF); EM_CORE_LOCK_DESTROY(adapter); return (error); @@ -739,6 +749,7 @@ em_detach(device_t dev) em_free_receive_structures(adapter); em_release_hw_control(adapter); + free(adapter->mta, M_DEVBUF); return (0); } @@ -1998,6 +2009,9 @@ em_set_multi(struct adapter *adapter) IOCTL_DEBUGOUT("em_set_multi: begin"); + mta = adapter->mta; + bzero(mta, sizeof(u8) * ETH_ADDR_LEN * MAX_NUM_MULTICAST_ADDRESSES); + if (adapter->hw.mac.type == e1000_82542 && adapter->hw.revision_id == E1000_REVISION_2) { reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL); @@ -2008,13 +2022,6 @@ em_set_multi(struct adapter *adapter) msec_delay(5); } - /* Allocate temporary memory to setup array */ - mta = malloc(sizeof(u8) * - (ETH_ADDR_LEN * MAX_NUM_MULTICAST_ADDRESSES), - M_DEVBUF, M_NOWAIT | M_ZERO); - if (mta == NULL) - panic("em_set_multi memory failure\n"); - #if __FreeBSD_version < 800000 IF_ADDR_LOCK(ifp); #else @@ -2052,7 +2059,6 @@ em_set_multi(struct adapter *adapter) if (adapter->hw.bus.pci_cmd_word & CMD_MEM_WRT_INVALIDATE) e1000_pci_set_mwi(&adapter->hw); } - free(mta, M_DEVBUF); } Modified: head/sys/dev/e1000/if_em.h ============================================================================== --- head/sys/dev/e1000/if_em.h Sat Aug 28 00:30:57 2010 (r211912) +++ head/sys/dev/e1000/if_em.h Sat Aug 28 00:34:22 2010 (r211913) @@ -391,6 +391,8 @@ struct adapter { bool has_manage; bool has_amt; + /* Multicast array memory */ + u8 *mta; /* Info about the board itself */ uint8_t link_active; uint16_t link_speed; Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Sat Aug 28 00:30:57 2010 (r211912) +++ head/sys/dev/e1000/if_igb.c Sat Aug 28 00:34:22 2010 (r211913) @@ -515,6 +515,15 @@ igb_attach(device_t dev) goto err_late; } + /* Allocate multicast array memory. */ + adapter->mta = malloc(sizeof(u8) * ETH_ADDR_LEN * + MAX_NUM_MULTICAST_ADDRESSES, M_DEVBUF, M_NOWAIT); + if (adapter->mta == NULL) { + device_printf(dev, "Can not allocate multicast setup array\n"); + error = ENOMEM; + goto err_late; + } + /* ** Start from a known state, this is ** important in reading the nvm and @@ -618,6 +627,7 @@ err_late: if_free(adapter->ifp); err_pci: igb_free_pci_resources(adapter); + free(adapter->mta, M_DEVBUF); IGB_CORE_LOCK_DESTROY(adapter); return (error); @@ -688,6 +698,7 @@ igb_detach(device_t dev) igb_free_transmit_structures(adapter); igb_free_receive_structures(adapter); + free(adapter->mta, M_DEVBUF); IGB_CORE_LOCK_DESTROY(adapter); @@ -1861,12 +1872,16 @@ igb_set_multi(struct adapter *adapter) struct ifnet *ifp = adapter->ifp; struct ifmultiaddr *ifma; u32 reg_rctl = 0; - u8 mta[MAX_NUM_MULTICAST_ADDRESSES * ETH_ADDR_LEN]; + u8 *mta; int mcnt = 0; IOCTL_DEBUGOUT("igb_set_multi: begin"); + mta = adapter->mta; + bzero(mta, sizeof(uint8_t) * ETH_ADDR_LEN * + MAX_NUM_MULTICAST_ADDRESSES); + #if __FreeBSD_version < 800000 IF_ADDR_LOCK(ifp); #else Modified: head/sys/dev/e1000/if_igb.h ============================================================================== --- head/sys/dev/e1000/if_igb.h Sat Aug 28 00:30:57 2010 (r211912) +++ head/sys/dev/e1000/if_igb.h Sat Aug 28 00:34:22 2010 (r211913) @@ -422,6 +422,8 @@ struct adapter { u32 rx_mbuf_sz; u32 rx_mask; + /* Multicast array memory */ + u8 *mta; /* Misc stats maintained by the driver */ unsigned long dropped_pkts; unsigned long mbuf_defrag_failed; Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Sat Aug 28 00:30:57 2010 (r211912) +++ head/sys/dev/e1000/if_lem.c Sat Aug 28 00:34:22 2010 (r211913) @@ -550,6 +550,15 @@ lem_attach(device_t dev) adapter->rx_desc_base = (struct e1000_rx_desc *)adapter->rxdma.dma_vaddr; + /* Allocate multicast array memory. */ + adapter->mta = malloc(sizeof(u8) * ETH_ADDR_LEN * + MAX_NUM_MULTICAST_ADDRESSES, M_DEVBUF, M_NOWAIT); + if (adapter->mta == NULL) { + device_printf(dev, "Can not allocate multicast setup array\n"); + error = ENOMEM; + goto err_hw_init; + } + /* ** Start from a known state, this is ** important in reading the nvm and @@ -676,6 +685,7 @@ err_pci: if (adapter->ifp != NULL) if_free(adapter->ifp); lem_free_pci_resources(adapter); + free(adapter->mta, M_DEVBUF); EM_TX_LOCK_DESTROY(adapter); EM_RX_LOCK_DESTROY(adapter); EM_CORE_LOCK_DESTROY(adapter); @@ -762,6 +772,7 @@ lem_detach(device_t dev) } lem_release_hw_control(adapter); + free(adapter->mta, M_DEVBUF); EM_TX_LOCK_DESTROY(adapter); EM_RX_LOCK_DESTROY(adapter); EM_CORE_LOCK_DESTROY(adapter); @@ -1942,6 +1953,9 @@ lem_set_multi(struct adapter *adapter) IOCTL_DEBUGOUT("lem_set_multi: begin"); + mta = adapter->mta; + bzero(mta, sizeof(u8) * ETH_ADDR_LEN * MAX_NUM_MULTICAST_ADDRESSES); + if (adapter->hw.mac.type == e1000_82542 && adapter->hw.revision_id == E1000_REVISION_2) { reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL); @@ -1952,13 +1966,6 @@ lem_set_multi(struct adapter *adapter) msec_delay(5); } - /* Allocate temporary memory to setup array */ - mta = malloc(sizeof(u8) * - (ETH_ADDR_LEN * MAX_NUM_MULTICAST_ADDRESSES), - M_DEVBUF, M_NOWAIT | M_ZERO); - if (mta == NULL) - panic("lem_set_multi memory failure\n"); - #if __FreeBSD_version < 800000 IF_ADDR_LOCK(ifp); #else @@ -1996,7 +2003,6 @@ lem_set_multi(struct adapter *adapter) if (adapter->hw.bus.pci_cmd_word & CMD_MEM_WRT_INVALIDATE) e1000_pci_set_mwi(&adapter->hw); } - free(mta, M_DEVBUF); } Modified: head/sys/dev/e1000/if_lem.h ============================================================================== --- head/sys/dev/e1000/if_lem.h Sat Aug 28 00:30:57 2010 (r211912) +++ head/sys/dev/e1000/if_lem.h Sat Aug 28 00:34:22 2010 (r211913) @@ -339,6 +339,8 @@ struct adapter { bool has_manage; bool has_amt; + /* Multicast array memory */ + u8 *mta; /* Info about the board itself */ uint8_t link_active; uint16_t link_speed; Modified: head/sys/dev/ixgb/if_ixgb.c ============================================================================== --- head/sys/dev/ixgb/if_ixgb.c Sat Aug 28 00:30:57 2010 (r211912) +++ head/sys/dev/ixgb/if_ixgb.c Sat Aug 28 00:34:22 2010 (r211913) @@ -324,6 +324,15 @@ ixgb_attach(device_t dev) } adapter->rx_desc_base = (struct ixgb_rx_desc *) adapter->rxdma.dma_vaddr; + /* Allocate multicast array memory. */ + adapter->mta = malloc(sizeof(u_int8_t) * IXGB_ETH_LENGTH_OF_ADDRESS * + MAX_NUM_MULTICAST_ADDRESSES, M_DEVBUF, M_NOWAIT); + if (adapter->mta == NULL) { + device_printf(dev, "Can not allocate multicast setup array\n"); + error = ENOMEM; + goto err_hw_init; + } + /* Initialize the hardware */ if (ixgb_hardware_init(adapter)) { device_printf(dev, "Unable to initialize the hardware\n"); @@ -351,6 +360,7 @@ err_pci: if_free(adapter->ifp); ixgb_free_pci_resources(adapter); sysctl_ctx_free(&adapter->sysctl_ctx); + free(adapter->mta, M_DEVBUF); return (error); } @@ -412,6 +422,7 @@ ixgb_detach(device_t dev) adapter->next->prev = adapter->prev; if (adapter->prev != NULL) adapter->prev->next = adapter->next; + free(adapter->mta, M_DEVBUF); IXGB_LOCK_DESTROY(adapter); return (0); @@ -1069,13 +1080,17 @@ static void ixgb_set_multi(struct adapter * adapter) { u_int32_t reg_rctl = 0; - u_int8_t mta[MAX_NUM_MULTICAST_ADDRESSES * IXGB_ETH_LENGTH_OF_ADDRESS]; + u_int8_t *mta; struct ifmultiaddr *ifma; int mcnt = 0; struct ifnet *ifp = adapter->ifp; IOCTL_DEBUGOUT("ixgb_set_multi: begin"); + mta = adapter->mta; + bzero(mta, sizeof(u_int8_t) * IXGB_ETH_LENGTH_OF_ADDRESS * + MAX_NUM_MULTICAST_ADDRESSES); + if_maddr_rlock(ifp); #if __FreeBSD_version < 500000 LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { Modified: head/sys/dev/ixgb/if_ixgb.h ============================================================================== --- head/sys/dev/ixgb/if_ixgb.h Sat Aug 28 00:30:57 2010 (r211912) +++ head/sys/dev/ixgb/if_ixgb.h Sat Aug 28 00:34:22 2010 (r211913) @@ -344,6 +344,8 @@ struct adapter { struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; + /* Multicast array memory */ + u_int8_t *mta; /* Misc stats maintained by the driver */ unsigned long dropped_pkts; unsigned long mbuf_alloc_failed; Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Sat Aug 28 00:30:57 2010 (r211912) +++ head/sys/dev/ixgbe/ixgbe.c Sat Aug 28 00:34:22 2010 (r211913) @@ -524,6 +524,15 @@ ixgbe_attach(device_t dev) goto err_out; } + /* Allocate multicast array memory. */ + adapter->mta = malloc(sizeof(u8) * IXGBE_ETH_LENGTH_OF_ADDRESS * + MAX_NUM_MULTICAST_ADDRESSES, M_DEVBUF, M_NOWAIT); + if (adapter->mta == NULL) { + device_printf(dev, "Can not allocate multicast setup array\n"); + error = ENOMEM; + goto err_late; + } + /* Initialize the shared code */ error = ixgbe_init_shared_code(hw); if (error == IXGBE_ERR_SFP_NOT_PRESENT) { @@ -636,6 +645,7 @@ err_out: if (adapter->ifp != NULL) if_free(adapter->ifp); ixgbe_free_pci_resources(adapter); + free(adapter->mta, M_DEVBUF); return (error); } @@ -706,6 +716,7 @@ ixgbe_detach(device_t dev) ixgbe_free_transmit_structures(adapter); ixgbe_free_receive_structures(adapter); + free(adapter->mta, M_DEVBUF); IXGBE_CORE_LOCK_DESTROY(adapter); return (0); @@ -1808,7 +1819,7 @@ static void ixgbe_set_multi(struct adapter *adapter) { u32 fctrl; - u8 mta[MAX_NUM_MULTICAST_ADDRESSES * IXGBE_ETH_LENGTH_OF_ADDRESS]; + u8 *mta; u8 *update_ptr; struct ifmultiaddr *ifma; int mcnt = 0; @@ -1816,6 +1827,10 @@ ixgbe_set_multi(struct adapter *adapter) IOCTL_DEBUGOUT("ixgbe_set_multi: begin"); + mta = adapter->mta; + bzero(mta, sizeof(u8) * IXGBE_ETH_LENGTH_OF_ADDRESS * + MAX_NUM_MULTICAST_ADDRESSES); + fctrl = IXGBE_READ_REG(&adapter->hw, IXGBE_FCTRL); fctrl |= (IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE); if (ifp->if_flags & IFF_PROMISC) Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Sat Aug 28 00:30:57 2010 (r211912) +++ head/sys/dev/ixgbe/ixgbe.h Sat Aug 28 00:34:22 2010 (r211913) @@ -421,6 +421,8 @@ struct adapter { u64 que_mask; u32 rx_process_limit; + /* Multicast array memory */ + u8 *mta; /* Misc stats maintained by the driver */ unsigned long dropped_pkts; unsigned long mbuf_defrag_failed; From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 00:48:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A4F01065698; Sat, 28 Aug 2010 00:48:41 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC42E8FC14; Sat, 28 Aug 2010 00:48:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7S0me9C013342; Sat, 28 Aug 2010 00:48:40 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7S0mee2013338; Sat, 28 Aug 2010 00:48:40 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201008280048.o7S0mee2013338@svn.freebsd.org> From: Xin LI Date: Sat, 28 Aug 2010 00:48:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211914 - in stable/8/sys: amd64/include dev/coretemp i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 00:48:41 -0000 Author: delphij Date: Sat Aug 28 00:48:40 2010 New Revision: 211914 URL: http://svn.freebsd.org/changeset/base/211914 Log: MFC r210624 and r210833: Improve cputemp(4) driver wrt newer Intel processors, especially Xeon 5500/5600 series: - Utilize IA32_TEMPERATURE_TARGET, a.k.a. Tj(target) in place of Tj(max) when a sane value is available, as documented in Intel whitepaper "CPU Monitoring With DTS/PECI"; (By sane value we mean 70C - 100C for now); - Print the probe results when booting verbose; - Replace cpu_mask with cpu_stepping; - Use CPUID_* macros instead of rolling our own. Catch known CPUs before using IA32_TEMPERATURE_TARGET. This way we would have an opportunity to hide the Tj(target) value doesn't seem right stuff if we know it's not working there. Add temperature value for Core2 Duo Extreme Mobile that I have access to. Modified: stable/8/sys/amd64/include/specialreg.h stable/8/sys/dev/coretemp/coretemp.c stable/8/sys/i386/include/specialreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/include/specialreg.h ============================================================================== --- stable/8/sys/amd64/include/specialreg.h Sat Aug 28 00:34:22 2010 (r211913) +++ stable/8/sys/amd64/include/specialreg.h Sat Aug 28 00:48:40 2010 (r211914) @@ -258,6 +258,7 @@ #define MSR_THERM_INTERRUPT 0x19b #define MSR_THERM_STATUS 0x19c #define MSR_IA32_MISC_ENABLE 0x1a0 +#define MSR_IA32_TEMPERATURE_TARGET 0x1a2 #define MSR_DEBUGCTLMSR 0x1d9 #define MSR_LASTBRANCHFROMIP 0x1db #define MSR_LASTBRANCHTOIP 0x1dc Modified: stable/8/sys/dev/coretemp/coretemp.c ============================================================================== --- stable/8/sys/dev/coretemp/coretemp.c Sat Aug 28 00:34:22 2010 (r211913) +++ stable/8/sys/dev/coretemp/coretemp.c Sat Aug 28 00:48:40 2010 (r211914) @@ -133,15 +133,13 @@ coretemp_attach(device_t dev) struct coretemp_softc *sc = device_get_softc(dev); device_t pdev; uint64_t msr; - int cpu_model; - int cpu_mask; + int cpu_model, cpu_stepping; + int ret, tjtarget; sc->sc_dev = dev; pdev = device_get_parent(dev); - cpu_model = (cpu_id >> 4) & 15; - /* extended model */ - cpu_model += ((cpu_id >> 16) & 0xf) << 4; - cpu_mask = cpu_id & 15; + cpu_model = CPUID_TO_MODEL(cpu_id); + cpu_stepping = cpu_id & CPUID_STEPPING; /* * Some CPUs, namely the PIII, don't have thermal sensors, but @@ -164,7 +162,7 @@ coretemp_attach(device_t dev) * * Adapted from the Linux coretemp driver. */ - if (cpu_model == 0xe && cpu_mask < 0xc) { + if (cpu_model == 0xe && cpu_stepping < 0xc) { msr = rdmsr(MSR_BIOS_SIGN); msr = msr >> 32; if (msr < 0x39) { @@ -174,20 +172,68 @@ coretemp_attach(device_t dev) } } #endif + /* - * On some Core 2 CPUs, there's an undocumented MSR that - * can tell us if Tj(max) is 100 or 85. - * - * The if-clause for CPUs having the MSR_IA32_EXT_CONFIG was adapted - * from the Linux coretemp driver. + * Use 100C as the initial value. */ sc->sc_tjmax = 100; - if ((cpu_model == 0xf && cpu_mask >= 2) || cpu_model == 0xe) { + + if ((cpu_model == 0xf && cpu_stepping >= 2) || cpu_model == 0xe) { + /* + * On some Core 2 CPUs, there's an undocumented MSR that + * can tell us if Tj(max) is 100 or 85. + * + * The if-clause for CPUs having the MSR_IA32_EXT_CONFIG was adapted + * from the Linux coretemp driver. + */ msr = rdmsr(MSR_IA32_EXT_CONFIG); if (msr & (1 << 30)) sc->sc_tjmax = 85; + } else if (cpu_model == 0x17) { + switch (cpu_stepping) { + case 0x6: /* Mobile Core 2 Duo */ + sc->sc_tjmax = 104; + break; + default: /* Unknown stepping */ + break; + } + } else { + /* + * Attempt to get Tj(max) from MSR IA32_TEMPERATURE_TARGET. + * + * This method is described in Intel white paper "CPU + * Monitoring With DTS/PECI". (#322683) + */ + ret = rdmsr_safe(MSR_IA32_TEMPERATURE_TARGET, &msr); + if (ret == 0) { + tjtarget = (msr >> 16) & 0xff; + + /* + * On earlier generation of processors, the value + * obtained from IA32_TEMPERATURE_TARGET register is + * an offset that needs to be summed with a model + * specific base. It is however not clear what + * these numbers are, with the publicly available + * documents from Intel. + * + * For now, we consider [70, 100]C range, as + * described in #322683, as "reasonable" and accept + * these values whenever the MSR is available for + * read, regardless the CPU model. + */ + if (tjtarget >= 70 && tjtarget <= 100) + sc->sc_tjmax = tjtarget; + else + device_printf(dev, "Tj(target) value %d " + "does not seem right.\n", tjtarget); + } else + device_printf(dev, "Can not get Tj(target) " + "from your CPU, using 100C.\n"); } + if (bootverbose) + device_printf(dev, "Setting TjMax=%d\n", sc->sc_tjmax); + /* * Add the "temperature" MIB to dev.cpu.N. */ Modified: stable/8/sys/i386/include/specialreg.h ============================================================================== --- stable/8/sys/i386/include/specialreg.h Sat Aug 28 00:34:22 2010 (r211913) +++ stable/8/sys/i386/include/specialreg.h Sat Aug 28 00:48:40 2010 (r211914) @@ -264,6 +264,7 @@ #define MSR_THERM_INTERRUPT 0x19b #define MSR_THERM_STATUS 0x19c #define MSR_IA32_MISC_ENABLE 0x1a0 +#define MSR_IA32_TEMPERATURE_TARGET 0x1a2 #define MSR_DEBUGCTLMSR 0x1d9 #define MSR_LASTBRANCHFROMIP 0x1db #define MSR_LASTBRANCHTOIP 0x1dc From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 06:33:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90A551065698; Sat, 28 Aug 2010 06:33:01 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F9A48FC08; Sat, 28 Aug 2010 06:33:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7S6X1ou021341; Sat, 28 Aug 2010 06:33:01 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7S6X17Y021339; Sat, 28 Aug 2010 06:33:01 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201008280633.o7S6X17Y021339@svn.freebsd.org> From: Jaakko Heinonen Date: Sat, 28 Aug 2010 06:33:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211919 - stable/7/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 06:33:01 -0000 Author: jh Date: Sat Aug 28 06:33:01 2010 New Revision: 211919 URL: http://svn.freebsd.org/changeset/base/211919 Log: MFC r204636: In reallocf(3), free the memory only when size != 0. Otherwise, when the System V compatibility option (malloc "V" flag) is in effect a zero sized reallocf() could cause a double free. PR: bin/141753 Modified: stable/7/lib/libc/stdlib/reallocf.c Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/stdlib/reallocf.c ============================================================================== --- stable/7/lib/libc/stdlib/reallocf.c Sat Aug 28 06:31:15 2010 (r211918) +++ stable/7/lib/libc/stdlib/reallocf.c Sat Aug 28 06:33:01 2010 (r211919) @@ -35,7 +35,14 @@ reallocf(void *ptr, size_t size) void *nptr; nptr = realloc(ptr, size); - if (!nptr && ptr) + + /* + * When the System V compatibility option (malloc "V" flag) is + * in effect, realloc(ptr, 0) frees the memory and returns NULL. + * So, to avoid double free, call free() only when size != 0. + * realloc(ptr, 0) can't fail when ptr != NULL. + */ + if (!nptr && ptr && size != 0) free(ptr); return (nptr); } From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 07:10:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EE43106566C; Sat, 28 Aug 2010 07:10:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DC028FC08; Sat, 28 Aug 2010 07:10:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7S7Ap8J022228; Sat, 28 Aug 2010 07:10:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7S7ApTC022225; Sat, 28 Aug 2010 07:10:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201008280710.o7S7ApTC022225@svn.freebsd.org> From: Alexander Motin Date: Sat, 28 Aug 2010 07:10:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211920 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 07:10:52 -0000 Author: mav Date: Sat Aug 28 07:10:51 2010 New Revision: 211920 URL: http://svn.freebsd.org/changeset/base/211920 Log: Add Intel Cougar Point PCH SATA Controller DeviceIDs. Correct some existing entries for Intel Ibex Peak (5 Series/3400 Series) PCH SATA controllers. Submitted by: jfv@ MFC after: 1 week Modified: head/sys/dev/ata/ata-pci.h head/sys/dev/ata/chipsets/ata-intel.c Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Sat Aug 28 06:33:01 2010 (r211919) +++ head/sys/dev/ata/ata-pci.h Sat Aug 28 07:10:51 2010 (r211920) @@ -204,6 +204,29 @@ struct ata_pci_controller { #define ATA_I82801JI_AH 0x3a228086 #define ATA_I82801JI_R1 0x3a258086 #define ATA_I82801JI_S2 0x3a268086 + +#define ATA_5Series_S1 0x3b208086 +#define ATA_5Series_S2 0x3b218086 +#define ATA_5Series_AH1 0x3b228086 +#define ATA_5Series_AH2 0x3b238086 +#define ATA_5Series_R1 0x3b258086 +#define ATA_5Series_S3 0x3b268086 +#define ATA_5Series_S4 0x3b288086 +#define ATA_5Series_AH3 0x3b298086 +#define ATA_5Series_R2 0x3b2c8086 +#define ATA_5Series_S5 0x3b2d8086 +#define ATA_5Series_S6 0x3b2e8086 +#define ATA_5Series_AH4 0x3b2f8086 + +#define ATA_CPT_S1 0x1c008086 +#define ATA_CPT_S2 0x1c018086 +#define ATA_CPT_AH1 0x1c028086 +#define ATA_CPT_AH2 0x1c038086 +#define ATA_CPT_R1 0x1c048086 +#define ATA_CPT_R2 0x1c058086 +#define ATA_CPT_S3 0x1c088086 +#define ATA_CPT_S4 0x1c098086 + #define ATA_I31244 0x32008086 #define ATA_ISCH 0x811a8086 Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Sat Aug 28 06:33:01 2010 (r211919) +++ head/sys/dev/ata/chipsets/ata-intel.c Sat Aug 28 07:10:51 2010 (r211920) @@ -140,22 +140,26 @@ ata_intel_probe(device_t dev) { ATA_I82801JI_AH, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, { ATA_I82801JI_R1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, { ATA_I82801JI_S2, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, - { 0x3b208086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3b218086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3b228086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3b238086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3b248086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3b258086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3b268086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3b278086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3b288086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3b298086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3b2a8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3b2b8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3b2c8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3b2d8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3b2e8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3b2f8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { ATA_5Series_S1, 0, INTEL_AHCI, 0, ATA_SA300, "5 Series/3400 Series PCH" }, + { ATA_5Series_S2, 0, INTEL_AHCI, 0, ATA_SA300, "5 Series/3400 Series PCH" }, + { ATA_5Series_AH1, 0, INTEL_AHCI, 0, ATA_SA300, "5 Series/3400 Series PCH" }, + { ATA_5Series_AH2, 0, INTEL_AHCI, 0, ATA_SA300, "5 Series/3400 Series PCH" }, + { ATA_5Series_R1, 0, INTEL_AHCI, 0, ATA_SA300, "5 Series/3400 Series PCH" }, + { ATA_5Series_S3, 0, INTEL_AHCI, 0, ATA_SA300, "5 Series/3400 Series PCH" }, + { ATA_5Series_S4, 0, INTEL_AHCI, 0, ATA_SA300, "5 Series/3400 Series PCH" }, + { ATA_5Series_AH3, 0, INTEL_AHCI, 0, ATA_SA300, "5 Series/3400 Series PCH" }, + { ATA_5Series_R2, 0, INTEL_AHCI, 0, ATA_SA300, "5 Series/3400 Series PCH" }, + { ATA_5Series_S5, 0, INTEL_AHCI, 0, ATA_SA300, "5 Series/3400 Series PCH" }, + { ATA_5Series_S6, 0, INTEL_AHCI, 0, ATA_SA300, "5 Series/3400 Series PCH" }, + { ATA_5Series_AH4, 0, INTEL_AHCI, 0, ATA_SA300, "5 Series/3400 Series PCH" }, + { ATA_CPT_S1, 0, INTEL_AHCI, 0, ATA_SA300, "Cougar Point" }, + { ATA_CPT_S2, 0, INTEL_AHCI, 0, ATA_SA300, "Cougar Point" }, + { ATA_CPT_AH1, 0, INTEL_AHCI, 0, ATA_SA300, "Cougar Point" }, + { ATA_CPT_AH2, 0, INTEL_AHCI, 0, ATA_SA300, "Cougar Point" }, + { ATA_CPT_R1, 0, INTEL_AHCI, 0, ATA_SA300, "Cougar Point" }, + { ATA_CPT_R2, 0, INTEL_AHCI, 0, ATA_SA300, "Cougar Point" }, + { ATA_CPT_S3, 0, INTEL_AHCI, 0, ATA_SA300, "Cougar Point" }, + { ATA_CPT_S4, 0, INTEL_AHCI, 0, ATA_SA300, "Cougar Point" }, { ATA_I31244, 0, 0, 2, ATA_SA150, "31244" }, { ATA_ISCH, 0, 0, 1, ATA_UDMA5, "SCH" }, { 0, 0, 0, 0, 0, 0}}; From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 07:21:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F08D110656AB; Sat, 28 Aug 2010 07:21:15 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD8138FC20; Sat, 28 Aug 2010 07:21:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7S7LFEp022512; Sat, 28 Aug 2010 07:21:15 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7S7LFG9022497; Sat, 28 Aug 2010 07:21:15 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201008280721.o7S7LFG9022497@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 28 Aug 2010 07:21:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211921 - in stable/8/sys: dev/bwi dev/bwn dev/iwn dev/ral dev/usb/wlan dev/wpi net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 07:21:16 -0000 Author: bschmidt Date: Sat Aug 28 07:21:15 2010 New Revision: 211921 URL: http://svn.freebsd.org/changeset/base/211921 Log: MFC r211295,211314,211546: Introduce IEEE80211_C_RATECTL, drivers which use the ratectl framework should set this capability. Initialize ni_txrate after txparams have been setup. Some drivers calculate various things prior to association based on ni_txrate and rely on it being nonzero. PR: kern/149185 Modified: stable/8/sys/dev/bwi/if_bwi.c stable/8/sys/dev/bwn/if_bwn.c stable/8/sys/dev/iwn/if_iwn.c stable/8/sys/dev/ral/rt2560.c stable/8/sys/dev/ral/rt2661.c stable/8/sys/dev/usb/wlan/if_rum.c stable/8/sys/dev/usb/wlan/if_run.c stable/8/sys/dev/usb/wlan/if_ural.c stable/8/sys/dev/usb/wlan/if_zyd.c stable/8/sys/dev/wpi/if_wpi.c stable/8/sys/net80211/ieee80211.c stable/8/sys/net80211/ieee80211_node.c stable/8/sys/net80211/ieee80211_sta.c stable/8/sys/net80211/ieee80211_var.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bwi/if_bwi.c ============================================================================== --- stable/8/sys/dev/bwi/if_bwi.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/dev/bwi/if_bwi.c Sat Aug 28 07:21:15 2010 (r211921) @@ -511,7 +511,8 @@ bwi_attach(struct bwi_softc *sc) IEEE80211_C_SHPREAMBLE | IEEE80211_C_WPA | IEEE80211_C_BGSCAN | - IEEE80211_C_MONITOR; + IEEE80211_C_MONITOR | + IEEE80211_C_RATECTL; ic->ic_opmode = IEEE80211_M_STA; ieee80211_ifattach(ic, macaddr); Modified: stable/8/sys/dev/bwn/if_bwn.c ============================================================================== --- stable/8/sys/dev/bwn/if_bwn.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/dev/bwn/if_bwn.c Sat Aug 28 07:21:15 2010 (r211921) @@ -1070,6 +1070,7 @@ bwn_attach_post(struct bwn_softc *sc) | IEEE80211_C_WPA /* capable of WPA1+WPA2 */ | IEEE80211_C_BGSCAN /* capable of bg scanning */ | IEEE80211_C_TXPMGT /* capable of txpow mgt */ + | IEEE80211_C_RATECTL /* use ratectl */ ; ic->ic_flags_ext |= IEEE80211_FEXT_SWBMISS; /* s/w bmiss */ Modified: stable/8/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/8/sys/dev/iwn/if_iwn.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/dev/iwn/if_iwn.c Sat Aug 28 07:21:15 2010 (r211921) @@ -580,6 +580,7 @@ iwn_attach(device_t dev) | IEEE80211_C_IBSS /* ibss/adhoc mode */ #endif | IEEE80211_C_WME /* WME */ + | IEEE80211_C_RATECTL /* use ratectl */ ; #if 0 /* HT */ /* XXX disable until HT channel setup works */ Modified: stable/8/sys/dev/ral/rt2560.c ============================================================================== --- stable/8/sys/dev/ral/rt2560.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/dev/ral/rt2560.c Sat Aug 28 07:21:15 2010 (r211921) @@ -291,6 +291,7 @@ rt2560_attach(device_t dev, int id) #ifdef notyet | IEEE80211_C_TXFRAG /* handle tx frags */ #endif + | IEEE80211_C_RATECTL /* use ratectl */ ; bands = 0; Modified: stable/8/sys/dev/ral/rt2661.c ============================================================================== --- stable/8/sys/dev/ral/rt2661.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/dev/ral/rt2661.c Sat Aug 28 07:21:15 2010 (r211921) @@ -294,6 +294,7 @@ rt2661_attach(device_t dev, int id) | IEEE80211_C_TXFRAG /* handle tx frags */ | IEEE80211_C_WME /* 802.11e */ #endif + | IEEE80211_C_RATECTL /* use ratectl */ ; bands = 0; Modified: stable/8/sys/dev/usb/wlan/if_rum.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_rum.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/dev/usb/wlan/if_rum.c Sat Aug 28 07:21:15 2010 (r211921) @@ -496,6 +496,7 @@ rum_attach(device_t self) | IEEE80211_C_SHSLOT /* short slot time supported */ | IEEE80211_C_BGSCAN /* bg scanning supported */ | IEEE80211_C_WPA /* 802.11i */ + | IEEE80211_C_RATECTL /* use ratectl */ ; bands = 0; Modified: stable/8/sys/dev/usb/wlan/if_run.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_run.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/dev/usb/wlan/if_run.c Sat Aug 28 07:21:15 2010 (r211921) @@ -634,7 +634,8 @@ run_attach(device_t self) IEEE80211_C_SHPREAMBLE | /* short preamble supported */ IEEE80211_C_SHSLOT | /* short slot time supported */ IEEE80211_C_WME | /* WME */ - IEEE80211_C_WPA; /* WPA1|WPA2(RSN) */ + IEEE80211_C_WPA | /* WPA1|WPA2(RSN) */ + IEEE80211_C_RATECTL; /* use ratectl */ ic->ic_cryptocaps = IEEE80211_CRYPTO_WEP | Modified: stable/8/sys/dev/usb/wlan/if_ural.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_ural.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/dev/usb/wlan/if_ural.c Sat Aug 28 07:21:15 2010 (r211921) @@ -485,6 +485,7 @@ ural_attach(device_t self) | IEEE80211_C_SHSLOT /* short slot time supported */ | IEEE80211_C_BGSCAN /* bg scanning supported */ | IEEE80211_C_WPA /* 802.11i */ + | IEEE80211_C_RATECTL /* use ratectl */ ; bands = 0; Modified: stable/8/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_zyd.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/dev/usb/wlan/if_zyd.c Sat Aug 28 07:21:15 2010 (r211921) @@ -397,6 +397,7 @@ zyd_attach(device_t dev) | IEEE80211_C_SHSLOT /* short slot time supported */ | IEEE80211_C_BGSCAN /* capable of bg scanning */ | IEEE80211_C_WPA /* 802.11i */ + | IEEE80211_C_RATECTL /* use ratectl */ ; bands = 0; Modified: stable/8/sys/dev/wpi/if_wpi.c ============================================================================== --- stable/8/sys/dev/wpi/if_wpi.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/dev/wpi/if_wpi.c Sat Aug 28 07:21:15 2010 (r211921) @@ -634,6 +634,7 @@ wpi_attach(device_t dev) | IEEE80211_C_WME /* 802.11e */ | IEEE80211_C_HOSTAP /* Host access point mode */ #endif + | IEEE80211_C_RATECTL /* use ratectl */ ; /* Modified: stable/8/sys/net80211/ieee80211.c ============================================================================== --- stable/8/sys/net80211/ieee80211.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/net80211/ieee80211.c Sat Aug 28 07:21:15 2010 (r211921) @@ -486,7 +486,8 @@ ieee80211_vap_setup(struct ieee80211com ieee80211_regdomain_vattach(vap); ieee80211_radiotap_vattach(vap); - ieee80211_ratectl_set(vap, IEEE80211_RATECTL_AMRR); + if (vap->iv_caps & IEEE80211_C_RATECTL) + ieee80211_ratectl_set(vap, IEEE80211_RATECTL_AMRR); return 0; } Modified: stable/8/sys/net80211/ieee80211_node.c ============================================================================== --- stable/8/sys/net80211/ieee80211_node.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/net80211/ieee80211_node.c Sat Aug 28 07:21:15 2010 (r211921) @@ -817,6 +817,8 @@ ieee80211_sta_join(struct ieee80211vap * if (ieee80211_iserp_rateset(&ni->ni_rates)) ni->ni_flags |= IEEE80211_NODE_ERP; ieee80211_node_setuptxparms(ni); + if (vap->iv_caps & IEEE80211_C_RATECTL) + ieee80211_ratectl_node_init(ni); return ieee80211_sta_join1(ieee80211_ref_node(ni)); } @@ -1036,7 +1038,8 @@ node_free(struct ieee80211_node *ni) { struct ieee80211com *ic = ni->ni_ic; - ieee80211_ratectl_node_deinit(ni); + if (ni->ni_vap->iv_caps & IEEE80211_C_RATECTL) + ieee80211_ratectl_node_deinit(ni); ic->ic_node_cleanup(ni); ieee80211_ies_cleanup(&ni->ni_ies); ieee80211_psq_cleanup(&ni->ni_psq); @@ -1401,6 +1404,8 @@ ieee80211_fakeup_adhoc_node(struct ieee8 #endif } ieee80211_node_setuptxparms(ni); + if (vap->iv_caps & IEEE80211_C_RATECTL) + ieee80211_ratectl_node_init(ni); if (ic->ic_newassoc != NULL) ic->ic_newassoc(ni, 1); /* XXX not right for 802.1x/WPA */ @@ -1470,6 +1475,8 @@ ieee80211_add_neighbor(struct ieee80211v if (ieee80211_iserp_rateset(&ni->ni_rates)) ni->ni_flags |= IEEE80211_NODE_ERP; ieee80211_node_setuptxparms(ni); + if (vap->iv_caps & IEEE80211_C_RATECTL) + ieee80211_ratectl_node_init(ni); if (ic->ic_newassoc != NULL) ic->ic_newassoc(ni, 1); /* XXX not right for 802.1x/WPA */ @@ -2338,6 +2345,8 @@ ieee80211_node_join(struct ieee80211_nod ); ieee80211_node_setuptxparms(ni); + if (vap->iv_caps & IEEE80211_C_RATECTL) + ieee80211_ratectl_node_init(ni); /* give driver a chance to setup state like ni_txrate */ if (ic->ic_newassoc != NULL) ic->ic_newassoc(ni, newassoc); Modified: stable/8/sys/net80211/ieee80211_sta.c ============================================================================== --- stable/8/sys/net80211/ieee80211_sta.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/net80211/ieee80211_sta.c Sat Aug 28 07:21:15 2010 (r211921) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #ifdef IEEE80211_SUPPORT_SUPERG #include #endif +#include #define IEEE80211_RATE2MBS(r) (((r) & IEEE80211_RATE_VAL) / 2) @@ -1597,6 +1598,8 @@ sta_recv_mgmt(struct ieee80211_node *ni, IEEE80211_F_JOIN | IEEE80211_F_DOBRS); ieee80211_setup_basic_htrates(ni, htinfo); ieee80211_node_setuptxparms(ni); + if (vap->iv_caps & IEEE80211_C_RATECTL) + ieee80211_ratectl_node_init(ni); } else { #ifdef IEEE80211_SUPPORT_SUPERG if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_ATH)) Modified: stable/8/sys/net80211/ieee80211_var.h ============================================================================== --- stable/8/sys/net80211/ieee80211_var.h Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/net80211/ieee80211_var.h Sat Aug 28 07:21:15 2010 (r211921) @@ -597,7 +597,8 @@ MALLOC_DECLARE(M_80211_VAP); #define IEEE80211_C_MONITOR 0x00010000 /* CAPABILITY: monitor mode */ #define IEEE80211_C_DFS 0x00020000 /* CAPABILITY: DFS/radar avail*/ #define IEEE80211_C_MBSS 0x00040000 /* CAPABILITY: MBSS available */ -/* 0x7c0000 available */ +#define IEEE80211_C_RATECTL 0x00080000 /* CAPABILITY: use ratectl */ +/* 0x700000 available */ #define IEEE80211_C_WPA1 0x00800000 /* CAPABILITY: WPA1 avail */ #define IEEE80211_C_WPA2 0x01000000 /* CAPABILITY: WPA2 avail */ #define IEEE80211_C_WPA 0x01800000 /* CAPABILITY: WPA1+WPA2 avail*/ From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 07:24:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83ED71065673; Sat, 28 Aug 2010 07:24:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73C9E8FC17; Sat, 28 Aug 2010 07:24:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7S7Ojvn022613; Sat, 28 Aug 2010 07:24:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7S7Ojib022611; Sat, 28 Aug 2010 07:24:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201008280724.o7S7Ojib022611@svn.freebsd.org> From: Alexander Motin Date: Sat, 28 Aug 2010 07:24:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211922 - head/sys/dev/ahci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 07:24:45 -0000 Author: mav Date: Sat Aug 28 07:24:45 2010 New Revision: 211922 URL: http://svn.freebsd.org/changeset/base/211922 Log: MFata(4): Add Intel Cougar Point PCH SATA Controller DeviceIDs. Correct some existing entries for Intel Ibex Peak (5 Series/3400 Series) PCH SATA controllers. Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Sat Aug 28 07:21:15 2010 (r211921) +++ head/sys/dev/ahci/ahci.c Sat Aug 28 07:24:45 2010 (r211922) @@ -151,14 +151,16 @@ static struct { {0x3a058086, 0x00, "Intel ICH10", 0}, {0x3a228086, 0x00, "Intel ICH10", 0}, {0x3a258086, 0x00, "Intel ICH10", 0}, - {0x3b228086, 0x00, "Intel PCH", 0}, - {0x3b238086, 0x00, "Intel PCH", 0}, - {0x3b248086, 0x00, "Intel PCH", 0}, - {0x3b258086, 0x00, "Intel PCH", 0}, - {0x3b298086, 0x00, "Intel PCH", 0}, - {0x3b2b8086, 0x00, "Intel PCH", 0}, - {0x3b2c8086, 0x00, "Intel PCH", 0}, - {0x3b2f8086, 0x00, "Intel PCH", 0}, + {0x3b228086, 0x00, "Intel 5 Series/3400 Series", 0}, + {0x3b238086, 0x00, "Intel 5 Series/3400 Series", 0}, + {0x3b258086, 0x00, "Intel 5 Series/3400 Series", 0}, + {0x3b298086, 0x00, "Intel 5 Series/3400 Series", 0}, + {0x3b2c8086, 0x00, "Intel 5 Series/3400 Series", 0}, + {0x3b2f8086, 0x00, "Intel 5 Series/3400 Series", 0}, + {0x1c028086, 0x00, "Intel Cougar Point", 0}, + {0x1c038086, 0x00, "Intel Cougar Point", 0}, + {0x1c048086, 0x00, "Intel Cougar Point", 0}, + {0x1c058086, 0x00, "Intel Cougar Point", 0}, {0x2361197b, 0x00, "JMicron JMB361", AHCI_Q_NOFORCE}, {0x2363197b, 0x00, "JMicron JMB363", AHCI_Q_NOFORCE}, {0x2365197b, 0x00, "JMicron JMB365", AHCI_Q_NOFORCE}, From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 07:58:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C01410656A3; Sat, 28 Aug 2010 07:58:11 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A2F98FC0C; Sat, 28 Aug 2010 07:58:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7S7wAFk023320; Sat, 28 Aug 2010 07:58:10 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7S7wAXq023314; Sat, 28 Aug 2010 07:58:10 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201008280758.o7S7wAXq023314@svn.freebsd.org> From: "Jayachandran C." Date: Sat, 28 Aug 2010 07:58:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211923 - head/sys/mips/rmi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 07:58:11 -0000 Author: jchandra Date: Sat Aug 28 07:58:10 2010 New Revision: 211923 URL: http://svn.freebsd.org/changeset/base/211923 Log: Initial code for XLR CompactFlash driver. Submitted by: Sreekanth M. S. Added: head/sys/mips/rmi/xlr_pcmcia.c (contents, props changed) Modified: head/sys/mips/rmi/board.c head/sys/mips/rmi/board.h head/sys/mips/rmi/files.xlr head/sys/mips/rmi/iodi.c Modified: head/sys/mips/rmi/board.c ============================================================================== --- head/sys/mips/rmi/board.c Sat Aug 28 07:24:45 2010 (r211922) +++ head/sys/mips/rmi/board.c Sat Aug 28 07:58:10 2010 (r211923) @@ -88,6 +88,16 @@ struct stn_cc *xls_core_cc_configs[] = { struct xlr_board_info xlr_board_info; +static int +xlr_pcmcia_present(void) +{ + xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_GPIO_OFFSET); + uint32_t resetconf; + + resetconf = xlr_read_reg(mmio, 21); + return ((resetconf & 0x4000) != 0); +} + /* * All our knowledge of chip and board that cannot be detected by probing * at run-time goes here @@ -103,6 +113,7 @@ xlr_board_info_setup() /* Board version 8 has NAND flash */ xlr_board_info.cfi = (xlr_boot1_info.board_major_version != RMI_XLR_BOARD_ARIZONA_VIII); + xlr_board_info.ata = xlr_pcmcia_present(); xlr_board_info.pci_irq = 0; xlr_board_info.credit_configs = xls_core_cc_configs; xlr_board_info.bucket_sizes = &xls_bucket_sizes; @@ -155,6 +166,7 @@ xlr_board_info_setup() xlr_board_info.nr_cpus = 32; xlr_board_info.usb = 0; xlr_board_info.cfi = 1; + xlr_board_info.ata = xlr_pcmcia_present(); xlr_board_info.pci_irq = 0; xlr_board_info.credit_configs = xlr_core_cc_configs; xlr_board_info.bucket_sizes = &bucket_sizes; Modified: head/sys/mips/rmi/board.h ============================================================================== --- head/sys/mips/rmi/board.h Sat Aug 28 07:24:45 2010 (r211922) +++ head/sys/mips/rmi/board.h Sat Aug 28 07:58:10 2010 (r211923) @@ -147,7 +147,8 @@ struct xlr_board_info { int is_xls; int nr_cpus; int usb; /* usb enabled ? */ - int cfi; /* compact flash driver for NOR? */ + int cfi; /* NOR flash */ + int ata; /* PCMCIA/compactflash driver */ int pci_irq; struct stn_cc **credit_configs; /* pointer to Core station credits */ struct bucket_size *bucket_sizes; /* pointer to Core station Modified: head/sys/mips/rmi/files.xlr ============================================================================== --- head/sys/mips/rmi/files.xlr Sat Aug 28 07:24:45 2010 (r211922) +++ head/sys/mips/rmi/files.xlr Sat Aug 28 07:58:10 2010 (r211923) @@ -14,6 +14,7 @@ mips/rmi/xlr_i2c.c option mips/rmi/uart_bus_xlr_iodi.c optional uart mips/rmi/uart_cpu_mips_xlr.c optional uart mips/rmi/xlr_pci.c optional pci +mips/rmi/xlr_pcmcia.c optional ata mips/rmi/xls_ehci.c optional usb ehci mips/rmi/bus_space_rmi.c standard mips/rmi/bus_space_rmi_pci.c standard Modified: head/sys/mips/rmi/iodi.c ============================================================================== --- head/sys/mips/rmi/iodi.c Sat Aug 28 07:24:45 2010 (r211922) +++ head/sys/mips/rmi/iodi.c Sat Aug 28 07:58:10 2010 (r211923) @@ -89,6 +89,20 @@ iodi_setup_intr(device_t, device_t, stru struct iodi_softc *iodi_softc; /* There can be only one. */ +/* + * We will manage the Flash/PCMCIA devices in IODI for now. + * The NOR flash, Compact flash etc. which can be connected on + * various chip selects on the peripheral IO, should have a + * separate bus later. + */ +static void +bridge_pcmcia_ack(int irq) +{ + xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_FLASH_OFFSET); + + xlr_write_reg(mmio, 0x60, 0xffffffff); +} + static int iodi_setup_intr(device_t dev, device_t child, struct resource *ires, int flags, driver_filter_t * filt, @@ -112,6 +126,10 @@ iodi_setup_intr(device_t dev, device_t c cpu_establish_hardintr("ehci", filt, intr, arg, PIC_USB_IRQ, flags, cookiep); pic_setup_intr(PIC_USB_IRQ - PIC_IRQ_BASE, PIC_USB_IRQ, 0x1, 0); + } else if (strcmp(device_get_name(child), "ata") == 0) { + xlr_establish_intr("ata", filt, intr, arg, PIC_PCMCIA_IRQ, flags, + cookiep, bridge_pcmcia_ack); + pic_setup_intr(PIC_PCMCIA_IRQ - PIC_IRQ_BASE, PIC_PCMCIA_IRQ, 0x1, 0); } return (0); @@ -158,6 +176,9 @@ iodi_alloc_resource(device_t bus, device } else if (strcmp(device_get_name(child), "cfi") == 0) { res->r_bushandle = MIPS_PHYS_TO_KSEG1(0x1c000000); res->r_bustag = 0; + } else if (strcmp(device_get_name(child), "ata") == 0) { + res->r_bushandle = MIPS_PHYS_TO_KSEG1(0x1d000000); + res->r_bustag = rmi_pci_bus_space; /* byte swapping (not really PCI) */ } /* res->r_start = *rid; */ return (res); @@ -206,6 +227,9 @@ iodi_attach(device_t dev) if (xlr_board_info.cfi) device_add_child(dev, "cfi", 0); + if (xlr_board_info.ata) + device_add_child(dev, "ata", 0); + if (xlr_board_info.gmac_block[0].enabled) { tmpd = device_add_child(dev, "rge", 0); device_set_ivars(tmpd, &xlr_board_info.gmac_block[0]); Added: head/sys/mips/rmi/xlr_pcmcia.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/rmi/xlr_pcmcia.c Sat Aug 28 07:58:10 2010 (r211923) @@ -0,0 +1,149 @@ +/*- + * Copyright (c) 2003-2009 RMI Corporation + * 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. Neither the name of RMI Corporation, nor the names of its contributors, + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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. + * + * RMI_BSD */ +/* + * ATA driver for the XLR_PCMCIA Host adapter on the RMI XLR/XLS/. + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#define XLR_PCMCIA_DATA_REG 0x1f0 +#define XLR_PCMCIA_ERROR_REG 0x1f1 +#define XLR_PCMCIA_SECT_CNT_REG 0x1f2 +#define XLR_PCMCIA_SECT_NUM_REG 0x1f3 +#define XLR_PCMCIA_CYLINDER_LOW_REG 0x1f4 +#define XLR_PCMCIA_CYLINDER_HIGH_REG 0x1f5 +#define XLR_PCMCIA_SECT_DRIVE_HEAD_REG 0x1f6 +#define XLR_PCMCIA_CMD_STATUS_REG 0x1f7 +#define XLR_PCMCIA_ALT_STATUS_REG 0x3f6 +#define XLR_PCMCIA_CONTROL_REG 0x3f6 + +/* + * Device methods + */ +static int xlr_pcmcia_probe(device_t); +static int xlr_pcmcia_attach(device_t); +static int xlr_pcmcia_detach(device_t); + +static int +xlr_pcmcia_probe(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + + ch->unit = 0; + ch->flags |= ATA_USE_16BIT | ATA_NO_SLAVE ; + device_set_desc(dev, "PCMCIA ATA controller"); + + return (ata_probe(dev)); +} + +/* + * We add all the devices which we know about. + * The generic attach routine will attach them if they are alive. + */ +static int +xlr_pcmcia_attach(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + int i; + int rid =0; + struct resource *mem_res; + + + mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + for (i = 0; i < ATA_MAX_RES; i++) + ch->r_io[i].res = mem_res; + + /* + * CF+ Specification. + */ + ch->r_io[ATA_DATA].offset = XLR_PCMCIA_DATA_REG; + ch->r_io[ATA_FEATURE].offset = XLR_PCMCIA_ERROR_REG; + ch->r_io[ATA_COUNT].offset = XLR_PCMCIA_SECT_CNT_REG; + ch->r_io[ATA_SECTOR].offset = XLR_PCMCIA_SECT_NUM_REG; + ch->r_io[ATA_CYL_LSB].offset = XLR_PCMCIA_CYLINDER_LOW_REG; + ch->r_io[ATA_CYL_MSB].offset = XLR_PCMCIA_CYLINDER_HIGH_REG; + ch->r_io[ATA_DRIVE].offset = XLR_PCMCIA_SECT_DRIVE_HEAD_REG; + ch->r_io[ATA_COMMAND].offset = XLR_PCMCIA_CMD_STATUS_REG; + ch->r_io[ATA_ERROR].offset = XLR_PCMCIA_ERROR_REG; + ch->r_io[ATA_IREASON].offset = XLR_PCMCIA_SECT_CNT_REG; + ch->r_io[ATA_STATUS].offset = XLR_PCMCIA_CMD_STATUS_REG; + ch->r_io[ATA_ALTSTAT].offset = XLR_PCMCIA_ALT_STATUS_REG; + ch->r_io[ATA_CONTROL].offset = XLR_PCMCIA_CONTROL_REG; + + /* Should point at the base of registers. */ + ch->r_io[ATA_IDX_ADDR].offset = XLR_PCMCIA_DATA_REG; + + ata_generic_hw(dev); + + return (ata_attach(dev)); +} + +static int +xlr_pcmcia_detach(device_t dev) +{ + bus_generic_detach(dev); + + return (0); +} + +static device_method_t xlr_pcmcia_methods[] = { + /* device interface */ + DEVMETHOD(device_probe, xlr_pcmcia_probe), + DEVMETHOD(device_attach, xlr_pcmcia_attach), + DEVMETHOD(device_detach, xlr_pcmcia_detach), + + { 0, 0 } +}; + +static driver_t xlr_pcmcia_driver = { + "ata", + xlr_pcmcia_methods, + sizeof(struct ata_channel), +}; + +DRIVER_MODULE(ata, iodi, xlr_pcmcia_driver, ata_devclass, 0, 0); From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 08:03:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B89A41065740; Sat, 28 Aug 2010 08:03:29 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6F4B8FC0C; Sat, 28 Aug 2010 08:03:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7S83TsA023476; Sat, 28 Aug 2010 08:03:29 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7S83TjJ023468; Sat, 28 Aug 2010 08:03:29 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008280803.o7S83TjJ023468@svn.freebsd.org> From: Rui Paulo Date: Sat, 28 Aug 2010 08:03:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211924 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 08:03:29 -0000 Author: rpaulo Date: Sat Aug 28 08:03:29 2010 New Revision: 211924 URL: http://svn.freebsd.org/changeset/base/211924 Log: Register an interrupt vector for DTrace return probes. There is some code missing in lapic to make sure that we don't overwrite this entry, but this will be done on a sequent commit. Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/exception.S head/sys/amd64/amd64/machdep.c head/sys/amd64/include/segments.h head/sys/i386/i386/exception.s head/sys/i386/i386/machdep.c head/sys/i386/include/segments.h Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Sat Aug 28 07:58:10 2010 (r211923) +++ head/sys/amd64/amd64/exception.S Sat Aug 28 08:03:29 2010 (r211924) @@ -108,6 +108,10 @@ IDTVEC(dbg) TRAP_NOEN(T_TRCTRAP) IDTVEC(bpt) TRAP_NOEN(T_BPTFLT) +#ifdef KDTRACE_HOOKS +IDTVEC(dtrace_ret) + TRAP_NOEN(T_DTRACE_RET) +#endif /* Regular traps; The cpu does not supply tf_err for these. */ #define TRAP(a) \ Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Sat Aug 28 07:58:10 2010 (r211923) +++ head/sys/amd64/amd64/machdep.c Sat Aug 28 08:03:29 2010 (r211924) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include "opt_msgbuf.h" #include "opt_perfmon.h" #include "opt_sched.h" +#include "opt_kdtrace.h" #include #include @@ -1089,6 +1090,9 @@ extern inthand_t IDTVEC(tss), IDTVEC(missing), IDTVEC(stk), IDTVEC(prot), IDTVEC(page), IDTVEC(mchk), IDTVEC(rsvd), IDTVEC(fpu), IDTVEC(align), IDTVEC(xmm), IDTVEC(dblfault), +#ifdef KDTRACE_HOOKS + IDTVEC(dtrace_ret), +#endif IDTVEC(fast_syscall), IDTVEC(fast_syscall32); #ifdef DDB @@ -1617,6 +1621,9 @@ hammer_time(u_int64_t modulep, u_int64_t setidt(IDT_AC, &IDTVEC(align), SDT_SYSIGT, SEL_KPL, 0); setidt(IDT_MC, &IDTVEC(mchk), SDT_SYSIGT, SEL_KPL, 0); setidt(IDT_XF, &IDTVEC(xmm), SDT_SYSIGT, SEL_KPL, 0); +#ifdef KDTRACE_HOOKS + setidt(IDT_DTRACE_RET, &IDTVEC(dtrace_ret), SDT_SYSIGT, SEL_UPL, 0); +#endif r_idt.rd_limit = sizeof(idt0) - 1; r_idt.rd_base = (long) idt; Modified: head/sys/amd64/include/segments.h ============================================================================== --- head/sys/amd64/include/segments.h Sat Aug 28 07:58:10 2010 (r211923) +++ head/sys/amd64/include/segments.h Sat Aug 28 08:03:29 2010 (r211924) @@ -214,6 +214,7 @@ struct region_descriptor { #define IDT_XF 19 /* #XF: SIMD Floating-Point Exception */ #define IDT_IO_INTS NRSVIDT /* Base of IDT entries for I/O interrupts. */ #define IDT_SYSCALL 0x80 /* System Call Interrupt Vector */ +#define IDT_DTRACE_RET 0x92 /* DTrace pid provider Interrupt Vector */ /* * Entries in the Global Descriptor Table (GDT) Modified: head/sys/i386/i386/exception.s ============================================================================== --- head/sys/i386/i386/exception.s Sat Aug 28 07:58:10 2010 (r211923) +++ head/sys/i386/i386/exception.s Sat Aug 28 08:03:29 2010 (r211924) @@ -108,6 +108,8 @@ IDTVEC(nmi) pushl $0; TRAP(T_NMI) IDTVEC(bpt) pushl $0; TRAP(T_BPTFLT) +IDTVEC(dtrace_ret) + pushl $0; TRAP(T_DTRACE_RET) IDTVEC(ofl) pushl $0; TRAP(T_OFLOW) IDTVEC(bnd) Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Sat Aug 28 07:58:10 2010 (r211923) +++ head/sys/i386/i386/machdep.c Sat Aug 28 08:03:29 2010 (r211924) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include "opt_npx.h" #include "opt_perfmon.h" #include "opt_xbox.h" +#include "opt_kdtrace.h" #include #include @@ -1876,7 +1877,11 @@ extern inthand_t IDTVEC(bnd), IDTVEC(ill), IDTVEC(dna), IDTVEC(fpusegm), IDTVEC(tss), IDTVEC(missing), IDTVEC(stk), IDTVEC(prot), IDTVEC(page), IDTVEC(mchk), IDTVEC(rsvd), IDTVEC(fpu), IDTVEC(align), - IDTVEC(xmm), IDTVEC(lcall_syscall), IDTVEC(int0x80_syscall); + IDTVEC(xmm), +#ifdef KDTRACE_HOOKS + IDTVEC(dtrace_ret), +#endif + IDTVEC(lcall_syscall), IDTVEC(int0x80_syscall); #ifdef DDB /* @@ -2825,6 +2830,10 @@ init386(first) GSEL(GCODE_SEL, SEL_KPL)); setidt(IDT_SYSCALL, &IDTVEC(int0x80_syscall), SDT_SYS386TGT, SEL_UPL, GSEL(GCODE_SEL, SEL_KPL)); +#ifdef KDTRACE_HOOKS + setidt(IDT_DTRACE_RET, &IDTVEC(dtrace_ret), SDT_SYS386TGT, SEL_UPL, + GSEL(GCODE_SEL, SEL_KPL)); +#endif r_idt.rd_limit = sizeof(idt0) - 1; r_idt.rd_base = (int) idt; Modified: head/sys/i386/include/segments.h ============================================================================== --- head/sys/i386/include/segments.h Sat Aug 28 07:58:10 2010 (r211923) +++ head/sys/i386/include/segments.h Sat Aug 28 08:03:29 2010 (r211924) @@ -207,6 +207,7 @@ struct region_descriptor { #define IDT_XF 19 /* #XF: SIMD Floating-Point Exception */ #define IDT_IO_INTS NRSVIDT /* Base of IDT entries for I/O interrupts. */ #define IDT_SYSCALL 0x80 /* System Call Interrupt Vector */ +#define IDT_DTRACE_RET 0x92 /* DTrace pid provider Interrupt Vector */ /* * Entries in the Global Descriptor Table (GDT) From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 08:13:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11F811065695; Sat, 28 Aug 2010 08:13:39 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DAE6A8FC08; Sat, 28 Aug 2010 08:13:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7S8DcRL023758; Sat, 28 Aug 2010 08:13:38 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7S8Dcq3023756; Sat, 28 Aug 2010 08:13:38 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008280813.o7S8Dcq3023756@svn.freebsd.org> From: Rui Paulo Date: Sat, 28 Aug 2010 08:13:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211925 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 08:13:39 -0000 Author: rpaulo Date: Sat Aug 28 08:13:38 2010 New Revision: 211925 URL: http://svn.freebsd.org/changeset/base/211925 Log: Replace a memory barrier with a mutex barrier. Sponsored by: The FreeBSD Foundation Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Sat Aug 28 08:03:29 2010 (r211924) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Sat Aug 28 08:13:38 2010 (r211925) @@ -208,6 +208,10 @@ static void fasttrap_proc_release(fasttr #define FASTTRAP_PROCS_INDEX(pid) ((pid) & fasttrap_procs.fth_mask) +#if !defined(sun) +static kmutex_t fasttrap_cpuc_pid_lock[MAXCPU]; +#endif + static int fasttrap_highbit(ulong_t i) { @@ -289,24 +293,17 @@ fasttrap_sigtrap(proc_t *p, kthread_t *t static void fasttrap_mod_barrier(uint64_t gen) { -#if defined(sun) int i; -#endif if (gen < fasttrap_mod_gen) return; fasttrap_mod_gen++; -#if defined(sun) - for (i = 0; i < NCPU; i++) { - mutex_enter(&cpu_core[i].cpuc_pid_lock); - mutex_exit(&cpu_core[i].cpuc_pid_lock); + CPU_FOREACH(i) { + mutex_enter(&fasttrap_cpuc_pid_lock[i]); + mutex_exit(&fasttrap_cpuc_pid_lock[i]); } -#else - /* XXX */ - __asm __volatile("": : :"memory"); -#endif } /* @@ -2326,6 +2323,11 @@ fasttrap_load(void) for (i = 0; i < fasttrap_procs.fth_nent; i++) mutex_init(&fasttrap_procs.fth_table[i].ftb_mtx, "processes bucket mtx", MUTEX_DEFAULT, NULL); + + CPU_FOREACH(i) { + mutex_init(&fasttrap_cpuc_pid_lock[i], "fasttrap barrier", + MUTEX_DEFAULT, NULL); + } #endif (void) dtrace_meta_register("fasttrap", &fasttrap_mops, NULL, @@ -2450,6 +2452,9 @@ fasttrap_unload(void) #if !defined(sun) destroy_dev(fasttrap_cdev); mutex_destroy(&fasttrap_count_mtx); + CPU_FOREACH(i) { + mutex_destroy(&fasttrap_cpuc_pid_lock[i]); + } #endif return (0); From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 08:18:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8ED7E1065695; Sat, 28 Aug 2010 08:18:20 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E7C18FC13; Sat, 28 Aug 2010 08:18:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7S8IK1n023899; Sat, 28 Aug 2010 08:18:20 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7S8IKXS023897; Sat, 28 Aug 2010 08:18:20 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008280818.o7S8IKXS023897@svn.freebsd.org> From: Rui Paulo Date: Sat, 28 Aug 2010 08:18:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211926 - head/sys/modules/dtrace/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 08:18:20 -0000 Author: rpaulo Date: Sat Aug 28 08:18:20 2010 New Revision: 211926 URL: http://svn.freebsd.org/changeset/base/211926 Log: Add the path necessary to find fasttrap_isa.h to CFLAGS. Sponsored by: The FreeBSD Foundation Modified: head/sys/modules/dtrace/dtrace/Makefile Modified: head/sys/modules/dtrace/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/dtrace/Makefile Sat Aug 28 08:13:38 2010 (r211925) +++ head/sys/modules/dtrace/dtrace/Makefile Sat Aug 28 08:18:20 2010 (r211926) @@ -15,6 +15,7 @@ SRCS= dtrace.c \ .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" SRCS+= dis_tables.c \ instr_size.c +CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/intel .endif SRCS+= bus_if.h device_if.h vnode_if.h From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 08:30:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F35C51065672; Sat, 28 Aug 2010 08:30:20 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C87C38FC14; Sat, 28 Aug 2010 08:30:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7S8UK1k024160; Sat, 28 Aug 2010 08:30:20 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7S8UKK3024157; Sat, 28 Aug 2010 08:30:20 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008280830.o7S8UKK3024157@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 28 Aug 2010 08:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211927 - head/sys/geom/eli X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 08:30:21 -0000 Author: pjd Date: Sat Aug 28 08:30:20 2010 New Revision: 211927 URL: http://svn.freebsd.org/changeset/base/211927 Log: Correct offset conversion to little endian. It was implemented in version 2, but because of a bug it was a no-op, so we were still using offsets in native byte order for the host. Do it properly this time, bump version to 4 and set the G_ELI_FLAG_NATIVE_BYTE_ORDER flag when version is under 4. MFC after: 2 weeks Modified: head/sys/geom/eli/g_eli.c head/sys/geom/eli/g_eli.h Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Sat Aug 28 08:18:20 2010 (r211926) +++ head/sys/geom/eli/g_eli.c Sat Aug 28 08:30:20 2010 (r211927) @@ -384,11 +384,13 @@ g_eli_crypto_ivgen(struct g_eli_softc *s u_char off[8], hash[SHA256_DIGEST_LENGTH]; SHA256_CTX ctx; - if (!(sc->sc_flags & G_ELI_FLAG_NATIVE_BYTE_ORDER)) + if ((sc->sc_flags & G_ELI_FLAG_NATIVE_BYTE_ORDER) != 0) + bcopy(&offset, off, sizeof(off)); + else le64enc(off, (uint64_t)offset); /* Copy precalculated SHA256 context for IV-Key. */ bcopy(&sc->sc_ivctx, &ctx, sizeof(ctx)); - SHA256_Update(&ctx, (uint8_t *)&offset, sizeof(offset)); + SHA256_Update(&ctx, off, sizeof(off)); SHA256_Final(hash, &ctx); bcopy(hash, iv, size); } @@ -544,7 +546,7 @@ g_eli_create(struct gctl_req *req, struc sc->sc_crypto = G_ELI_CRYPTO_SW; sc->sc_flags = md->md_flags; /* Backward compatibility. */ - if (md->md_version < 2) + if (md->md_version < 4) sc->sc_flags |= G_ELI_FLAG_NATIVE_BYTE_ORDER; sc->sc_ealgo = md->md_ealgo; sc->sc_nkey = nkey; Modified: head/sys/geom/eli/g_eli.h ============================================================================== --- head/sys/geom/eli/g_eli.h Sat Aug 28 08:18:20 2010 (r211926) +++ head/sys/geom/eli/g_eli.h Sat Aug 28 08:30:20 2010 (r211927) @@ -57,11 +57,11 @@ * 1 - Added data authentication support (md_aalgo field and * G_ELI_FLAG_AUTH flag). * 2 - Added G_ELI_FLAG_READONLY. - * - IV is generated from offset converted to little-endian - * (flag G_ELI_FLAG_NATIVE_BYTE_ORDER will be set for older versions). * 3 - Added 'configure' subcommand. + * 4 - IV is generated from offset converted to little-endian + * (flag G_ELI_FLAG_NATIVE_BYTE_ORDER will be set for older versions). */ -#define G_ELI_VERSION 3 +#define G_ELI_VERSION 4 /* ON DISK FLAGS. */ /* Use random, onetime keys. */ @@ -394,7 +394,7 @@ g_eli_keylen(u_int algo, u_int keylen) keylen = 0; } return (keylen); - case CRYPTO_AES_CBC: /* FALLTHROUGH */ + case CRYPTO_AES_CBC: case CRYPTO_CAMELLIA_CBC: switch (keylen) { case 0: From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 08:32:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58B8110656A6; Sat, 28 Aug 2010 08:32:06 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 03A328FC19; Sat, 28 Aug 2010 08:32:05 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 1015645EB2; Sat, 28 Aug 2010 10:32:04 +0200 (CEST) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id D30C145E86; Sat, 28 Aug 2010 10:31:58 +0200 (CEST) Date: Sat, 28 Aug 2010 10:31:51 +0200 From: Pawel Jakub Dawidek To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20100828083151.GD2077@garage.freebsd.pl> References: <201008280830.o7S8UKK3024157@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="q9KOos5vDmpwPx9o" Content-Disposition: inline In-Reply-To: <201008280830.o7S8UKK3024157@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: Subject: Re: svn commit: r211927 - head/sys/geom/eli X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 08:32:06 -0000 --q9KOos5vDmpwPx9o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Aug 28, 2010 at 08:30:20AM +0000, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Sat Aug 28 08:30:20 2010 > New Revision: 211927 > URL: http://svn.freebsd.org/changeset/base/211927 >=20 > Log: > Correct offset conversion to little endian. It was implemented in versi= on 2, > but because of a bug it was a no-op, so we were still using offsets in = native > byte order for the host. Do it properly this time, bump version to 4 an= d set > the G_ELI_FLAG_NATIVE_BYTE_ORDER flag when version is under 4. I forgot to add: Reported by: ivoras --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --q9KOos5vDmpwPx9o Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkx4yXcACgkQForvXbEpPzRPsQCfa4YjRkGTP6FtBKaVejSBTkGl HvUAn0UPZMbX70bgTc+wGPbkPvzFItER =mT8/ -----END PGP SIGNATURE----- --q9KOos5vDmpwPx9o-- From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 08:38:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EACF1065694; Sat, 28 Aug 2010 08:38:04 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2EAE78FC0C; Sat, 28 Aug 2010 08:38:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7S8c4kg024373; Sat, 28 Aug 2010 08:38:04 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7S8c4TQ024371; Sat, 28 Aug 2010 08:38:04 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008280838.o7S8c4TQ024371@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 28 Aug 2010 08:38:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211928 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 08:38:04 -0000 Author: pjd Date: Sat Aug 28 08:38:03 2010 New Revision: 211928 URL: http://svn.freebsd.org/changeset/base/211928 Log: Run all tasks from a proper context, with proper priority, etc. Reviewed by: jhb MFC after: 1 month Modified: head/sys/kern/subr_taskqueue.c Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Sat Aug 28 08:30:20 2010 (r211927) +++ head/sys/kern/subr_taskqueue.c Sat Aug 28 08:38:03 2010 (r211928) @@ -141,7 +141,6 @@ taskqueue_free(struct taskqueue *queue) TQ_LOCK(queue); queue->tq_flags &= ~TQ_FLAGS_ACTIVE; - taskqueue_run(queue, &queue->tq_running); taskqueue_terminate(queue->tq_threads, queue); mtx_destroy(&queue->tq_mutex); free(queue->tq_threads, M_TASKQUEUE); @@ -372,6 +371,7 @@ taskqueue_thread_loop(void *arg) break; TQ_SLEEP(tq, tq, &tq->tq_mutex, 0, "-", 0); } + taskqueue_run(tq, &running); /* rendezvous with thread that asked us to terminate */ tq->tq_tcount--; From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 08:39:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D00E1065672; Sat, 28 Aug 2010 08:39:37 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CA968FC1E; Sat, 28 Aug 2010 08:39:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7S8dbEt024446; Sat, 28 Aug 2010 08:39:37 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7S8dbMA024444; Sat, 28 Aug 2010 08:39:37 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008280839.o7S8dbMA024444@svn.freebsd.org> From: Rui Paulo Date: Sat, 28 Aug 2010 08:39:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211929 - head/sys/cddl/contrib/opensolaris/uts/intel/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 08:39:37 -0000 Author: rpaulo Date: Sat Aug 28 08:39:37 2010 New Revision: 211929 URL: http://svn.freebsd.org/changeset/base/211929 Log: Remove debugging. Sponsored by: The FreeBSD Foundation Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sat Aug 28 08:38:03 2010 (r211928) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sat Aug 28 08:39:37 2010 (r211929) @@ -1066,7 +1066,6 @@ fasttrap_pid_probe(struct reg *rp) return (-1); } - printf("found tracepoint\n"); /* * Set the program counter to the address of the traced instruction * so that it looks right in ustack() output. From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 08:44:00 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5185F1065670; Sat, 28 Aug 2010 08:44:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id B87918FC12; Sat, 28 Aug 2010 08:43:59 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o7S8htlY033909 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 28 Aug 2010 11:43:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o7S8htBI053756; Sat, 28 Aug 2010 11:43:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o7S8htRI053755; Sat, 28 Aug 2010 11:43:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 28 Aug 2010 11:43:55 +0300 From: Kostik Belousov To: Pawel Jakub Dawidek Message-ID: <20100828084355.GH2396@deviant.kiev.zoral.com.ua> References: <201008272049.o7RKn63o007138@svn.freebsd.org> <20100827213827.GD2396@deviant.kiev.zoral.com.ua> <20100827215402.GB2077@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="y3SX8pAkUMTjg65a" Content-Disposition: inline In-Reply-To: <20100827215402.GB2077@garage.freebsd.pl> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_20, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r211896 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 08:44:00 -0000 --y3SX8pAkUMTjg65a Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 27, 2010 at 11:54:02PM +0200, Pawel Jakub Dawidek wrote: > On Sat, Aug 28, 2010 at 12:38:27AM +0300, Kostik Belousov wrote: > > > --- head/sbin/hastd/primary.c Fri Aug 27 20:48:12 2010 (r211895) > > > +++ head/sbin/hastd/primary.c Fri Aug 27 20:49:06 2010 (r211896) > > > @@ -1988,7 +1988,9 @@ guard_thread(void *arg) > > > rw_unlock(&hio_remote_lock[ii]); > > > } > > > } > > > - (void)cv_timedwait(&hio_guard_cond, &hio_guard_lock, timeout); > > > + /* Sleep only if a signal wasn't delivered in the meantime. */ > > > + if (!sigexit_received && !sighup_received && !sigchld_received) > > > + cv_timedwait(&hio_guard_cond, &hio_guard_lock, timeout); > > > mtx_unlock(&hio_guard_lock); > > > } > > > /* NOTREACHED */ > > I wanted to say that this is racy, because if a signal is delivered aft= er > > the check is done but before the sleep, you loose. >=20 > Yes, I know it is racy, but the race isn't critical anymore, as we will > eventually wait at most 10 seconds to handle signals. >=20 > > After looking at the signal handler, I noted that you call not async-sa= fe > > functions in the handler. This is easy way to get undefined behaviour, > > i.e. probably crash. And wakeup from the handler would have the same > > race as sigXXX_received check. >=20 > Which aren't async-safe? pthread stuff? Yes. All pthread_* namespace is not async-signal safe. --y3SX8pAkUMTjg65a Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkx4zEsACgkQC3+MBN1Mb4jViACg3CXV6cQ8RlDfZP69PRseydkR lDUAn2dc13lxrLoKqBuCGGevRLokdKGC =3Pgt -----END PGP SIGNATURE----- --y3SX8pAkUMTjg65a-- From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 08:50:56 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B3B410656A3; Sat, 28 Aug 2010 08:50:56 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 30E018FC14; Sat, 28 Aug 2010 08:50:55 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 91AFE45E86; Sat, 28 Aug 2010 10:50:54 +0200 (CEST) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 4092245CD8; Sat, 28 Aug 2010 10:50:49 +0200 (CEST) Date: Sat, 28 Aug 2010 10:50:42 +0200 From: Pawel Jakub Dawidek To: Kostik Belousov Message-ID: <20100828085042.GE2077@garage.freebsd.pl> References: <201008272049.o7RKn63o007138@svn.freebsd.org> <20100827213827.GD2396@deviant.kiev.zoral.com.ua> <20100827215402.GB2077@garage.freebsd.pl> <20100828084355.GH2396@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5oH/S/bF6lOfqCQb" Content-Disposition: inline In-Reply-To: <20100828084355.GH2396@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r211896 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 08:50:56 -0000 --5oH/S/bF6lOfqCQb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Aug 28, 2010 at 11:43:55AM +0300, Kostik Belousov wrote: > On Fri, Aug 27, 2010 at 11:54:02PM +0200, Pawel Jakub Dawidek wrote: > > On Sat, Aug 28, 2010 at 12:38:27AM +0300, Kostik Belousov wrote: > > > > --- head/sbin/hastd/primary.c Fri Aug 27 20:48:12 2010 (r211895) > > > > +++ head/sbin/hastd/primary.c Fri Aug 27 20:49:06 2010 (r211896) > > > > @@ -1988,7 +1988,9 @@ guard_thread(void *arg) > > > > rw_unlock(&hio_remote_lock[ii]); > > > > } > > > > } > > > > - (void)cv_timedwait(&hio_guard_cond, &hio_guard_lock, timeout); > > > > + /* Sleep only if a signal wasn't delivered in the meantime. */ > > > > + if (!sigexit_received && !sighup_received && !sigchld_received) > > > > + cv_timedwait(&hio_guard_cond, &hio_guard_lock, timeout); > > > > mtx_unlock(&hio_guard_lock); > > > > } > > > > /* NOTREACHED */ > > > I wanted to say that this is racy, because if a signal is delivered a= fter > > > the check is done but before the sleep, you loose. > >=20 > > Yes, I know it is racy, but the race isn't critical anymore, as we will > > eventually wait at most 10 seconds to handle signals. > >=20 > > > After looking at the signal handler, I noted that you call not async-= safe > > > functions in the handler. This is easy way to get undefined behaviour, > > > i.e. probably crash. And wakeup from the handler would have the same > > > race as sigXXX_received check. > >=20 > > Which aren't async-safe? pthread stuff? >=20 > Yes. All pthread_* namespace is not async-signal safe. Ehh, I'm lame. All I need to do is to use cv_timedwait_sig() instead of cv_timedwait() and I can remove all pthread stuff from the sighandler. Thanks! --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --5oH/S/bF6lOfqCQb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkx4zeEACgkQForvXbEpPzQzVwCg6vf4JuovOKYGcXPIkBI+M8fK 6egAoJbBt5qDJAxFcTbQozb+dQUVfFK/ =EJHx -----END PGP SIGNATURE----- --5oH/S/bF6lOfqCQb-- From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 08:57:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A41AF10656A3; Sat, 28 Aug 2010 08:57:15 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 939678FC0A; Sat, 28 Aug 2010 08:57:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7S8vFc6024830; Sat, 28 Aug 2010 08:57:15 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7S8vFVx024826; Sat, 28 Aug 2010 08:57:15 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008280857.o7S8vFVx024826@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 28 Aug 2010 08:57:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211930 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 08:57:15 -0000 Author: pjd Date: Sat Aug 28 08:57:15 2010 New Revision: 211930 URL: http://svn.freebsd.org/changeset/base/211930 Log: There is a bug in vfs_allocate_syncvnode() failure handling in mount code. Actually it is hard to properly handle such a failure, especially in MNT_UPDATE case. The only reason for the vfs_allocate_syncvnode() function to fail is getnewvnode() failure. Fortunately it is impossible for current implementation of getnewvnode() to fail, so we can assert this and make vfs_allocate_syncvnode() void. This in turn free us from handling its failures in the mount code. Reviewed by: kib MFC after: 1 month Modified: head/sys/kern/vfs_mount.c head/sys/kern/vfs_subr.c head/sys/sys/mount.h Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Sat Aug 28 08:39:37 2010 (r211929) +++ head/sys/kern/vfs_mount.c Sat Aug 28 08:57:15 2010 (r211930) @@ -1036,7 +1036,7 @@ vfs_domount( MNT_IUNLOCK(mp); if ((mp->mnt_flag & MNT_RDONLY) == 0) { if (mp->mnt_syncer == NULL) - error = vfs_allocate_syncvnode(mp); + vfs_allocate_syncvnode(mp); } else { if (mp->mnt_syncer != NULL) vrele(mp->mnt_syncer); @@ -1078,10 +1078,8 @@ vfs_domount( mountcheckdirs(vp, newdp); vrele(newdp); if ((mp->mnt_flag & MNT_RDONLY) == 0) - error = vfs_allocate_syncvnode(mp); + vfs_allocate_syncvnode(mp); vfs_unbusy(mp); - if (error) - vrele(vp); } else { vfs_unbusy(mp); vfs_mount_destroy(mp); @@ -1311,7 +1309,7 @@ dounmount(mp, flags, td) mp->mnt_kern_flag &= ~MNTK_NOINSMNTQ; if ((mp->mnt_flag & MNT_RDONLY) == 0 && mp->mnt_syncer == NULL) { MNT_IUNLOCK(mp); - (void) vfs_allocate_syncvnode(mp); + vfs_allocate_syncvnode(mp); MNT_ILOCK(mp); } mp->mnt_kern_flag &= ~(MNTK_UNMOUNT | MNTK_UNMOUNTF); Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sat Aug 28 08:39:37 2010 (r211929) +++ head/sys/kern/vfs_subr.c Sat Aug 28 08:57:15 2010 (r211930) @@ -3365,7 +3365,7 @@ static struct vop_vector sync_vnodeops = /* * Create a new filesystem syncer vnode for the specified mount point. */ -int +void vfs_allocate_syncvnode(struct mount *mp) { struct vnode *vp; @@ -3374,16 +3374,15 @@ vfs_allocate_syncvnode(struct mount *mp) int error; /* Allocate a new vnode */ - if ((error = getnewvnode("syncer", mp, &sync_vnodeops, &vp)) != 0) { - mp->mnt_syncer = NULL; - return (error); - } + error = getnewvnode("syncer", mp, &sync_vnodeops, &vp); + if (error != 0) + panic("vfs_allocate_syncvnode: getnewvnode() failed"); vp->v_type = VNON; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); vp->v_vflag |= VV_FORCEINSMQ; error = insmntque(vp, mp); if (error != 0) - panic("vfs_allocate_syncvnode: insmntque failed"); + panic("vfs_allocate_syncvnode: insmntque() failed"); vp->v_vflag &= ~VV_FORCEINSMQ; VOP_UNLOCK(vp, 0); /* @@ -3411,7 +3410,6 @@ vfs_allocate_syncvnode(struct mount *mp) mtx_unlock(&sync_mtx); BO_UNLOCK(bo); mp->mnt_syncer = vp; - return (0); } /* Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Sat Aug 28 08:39:37 2010 (r211929) +++ head/sys/sys/mount.h Sat Aug 28 08:57:15 2010 (r211930) @@ -730,7 +730,7 @@ void vfs_msync(struct mount *, int); int vfs_busy(struct mount *, int); int vfs_export /* process mount export info */ (struct mount *, struct export_args *); -int vfs_allocate_syncvnode(struct mount *); +void vfs_allocate_syncvnode(struct mount *); int vfs_donmount(struct thread *td, int fsflags, struct uio *fsoptions); void vfs_getnewfsid(struct mount *); struct cdev *vfs_getrootfsid(struct mount *); From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 08:59:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA73D10656AB; Sat, 28 Aug 2010 08:59:55 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D755D8FC18; Sat, 28 Aug 2010 08:59:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7S8xt2v024931; Sat, 28 Aug 2010 08:59:55 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7S8xtM6024918; Sat, 28 Aug 2010 08:59:55 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201008280859.o7S8xtM6024918@svn.freebsd.org> From: Martin Matuska Date: Sat, 28 Aug 2010 08:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211931 - in head: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 08:59:56 -0000 Author: mm Date: Sat Aug 28 08:59:55 2010 New Revision: 211931 URL: http://svn.freebsd.org/changeset/base/211931 Log: Update ZFS metaslab code from OpenSolaris. This provides a noticeable write speedup, especially on pools with less than 30% of free space. Detailed information (OpenSolaris onnv changesets and Bug IDs): 11146:7e58f40bcb1c 6826241 Sync write IOPS drops dramatically during TXG sync 6869229 zfs should switch to shiny new metaslabs more frequently 11728:59fdb3b856f6 6918420 zdb -m has issues printing metaslab statistics 12047:7c1fcc8419ca 6917066 zfs block picking can be improved Approved by: delphij (mentor) Obtained from: OpenSolaris (Bug ID 6826241, 6869229, 6918420, 6917066) MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Aug 28 08:57:15 2010 (r211930) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Aug 28 08:59:55 2010 (r211931) @@ -491,35 +491,37 @@ dump_metaslab_stats(metaslab_t *msp) static void dump_metaslab(metaslab_t *msp) { - char freebuf[5]; - space_map_obj_t *smo = &msp->ms_smo; vdev_t *vd = msp->ms_group->mg_vd; spa_t *spa = vd->vdev_spa; + space_map_t *sm = &msp->ms_map; + space_map_obj_t *smo = &msp->ms_smo; + char freebuf[5]; - nicenum(msp->ms_map.sm_size - smo->smo_alloc, freebuf); + nicenum(sm->sm_size - smo->smo_alloc, freebuf); (void) printf( "\tvdev %5llu offset %12llx spacemap %6llu free %5s\n", - (u_longlong_t)vd->vdev_id, (u_longlong_t)msp->ms_map.sm_start, - (u_longlong_t)smo->smo_object, freebuf); + (u_longlong_t)(sm->sm_start / sm->sm_size), + (u_longlong_t)sm->sm_start, (u_longlong_t)smo->smo_object, freebuf); if (dump_opt['m'] > 1) { mutex_enter(&msp->ms_lock); - VERIFY(space_map_load(&msp->ms_map, zfs_metaslab_ops, - SM_FREE, &msp->ms_smo, spa->spa_meta_objset) == 0); + space_map_load_wait(sm); + if (!sm->sm_loaded) + VERIFY(space_map_load(sm, zfs_metaslab_ops, + SM_FREE, smo, spa->spa_meta_objset) == 0); dump_metaslab_stats(msp); - space_map_unload(&msp->ms_map); + space_map_unload(sm); mutex_exit(&msp->ms_lock); } if (dump_opt['d'] > 5 || dump_opt['m'] > 2) { - ASSERT(msp->ms_map.sm_size == (1ULL << vd->vdev_ms_shift)); + ASSERT(sm->sm_size == (1ULL << vd->vdev_ms_shift)); mutex_enter(&msp->ms_lock); - dump_spacemap(spa->spa_meta_objset, smo, &msp->ms_map); + dump_spacemap(spa->spa_meta_objset, smo, sm); mutex_exit(&msp->ms_lock); } - } static void Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Sat Aug 28 08:57:15 2010 (r211930) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Sat Aug 28 08:59:55 2010 (r211931) @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. */ #include @@ -37,7 +36,7 @@ uint64_t metaslab_gang_bang = SPA_MAXBLO /* * Minimum size which forces the dynamic allocator to change - * it's allocation strategy. Once the space map cannot satisfy + * it's allocation strategy. Once the space map cannot satisfy * an allocation of this size then it switches to using more * aggressive strategy (i.e search by size rather than offset). */ @@ -49,7 +48,23 @@ uint64_t metaslab_df_alloc_threshold = S * Once the space_map's free space drops below this level we dynamically * switch to using best-fit allocations. */ -int metaslab_df_free_pct = 30; +int metaslab_df_free_pct = 4; + +/* + * A metaslab is considered "free" if it contains a contiguous + * segment which is greater than metaslab_min_alloc_size. + */ +uint64_t metaslab_min_alloc_size = DMU_MAX_ACCESS; + +/* + * Max number of space_maps to prefetch. + */ +int metaslab_prefetch_limit = SPA_DVAS_PER_BP; + +/* + * Percentage bonus multiplier for metaslabs that are in the bonus area. + */ +int metaslab_smo_bonus_pct = 150; /* * ========================================================================== @@ -219,6 +234,32 @@ metaslab_group_sort(metaslab_group_t *mg } /* + * ========================================================================== + * Common allocator routines + * ========================================================================== + */ +static int +metaslab_segsize_compare(const void *x1, const void *x2) +{ + const space_seg_t *s1 = x1; + const space_seg_t *s2 = x2; + uint64_t ss_size1 = s1->ss_end - s1->ss_start; + uint64_t ss_size2 = s2->ss_end - s2->ss_start; + + if (ss_size1 < ss_size2) + return (-1); + if (ss_size1 > ss_size2) + return (1); + + if (s1->ss_start < s2->ss_start) + return (-1); + if (s1->ss_start > s2->ss_start) + return (1); + + return (0); +} + +/* * This is a helper function that can be used by the allocator to find * a suitable block to allocate. This will search the specified AVL * tree looking for a block that matches the specified criteria. @@ -258,68 +299,58 @@ metaslab_block_picker(avl_tree_t *t, uin return (metaslab_block_picker(t, cursor, size, align)); } -/* - * ========================================================================== - * The first-fit block allocator - * ========================================================================== - */ static void -metaslab_ff_load(space_map_t *sm) +metaslab_pp_load(space_map_t *sm) { + space_seg_t *ss; + ASSERT(sm->sm_ppd == NULL); sm->sm_ppd = kmem_zalloc(64 * sizeof (uint64_t), KM_SLEEP); - sm->sm_pp_root = NULL; + + sm->sm_pp_root = kmem_alloc(sizeof (avl_tree_t), KM_SLEEP); + avl_create(sm->sm_pp_root, metaslab_segsize_compare, + sizeof (space_seg_t), offsetof(struct space_seg, ss_pp_node)); + + for (ss = avl_first(&sm->sm_root); ss; ss = AVL_NEXT(&sm->sm_root, ss)) + avl_add(sm->sm_pp_root, ss); } static void -metaslab_ff_unload(space_map_t *sm) +metaslab_pp_unload(space_map_t *sm) { + void *cookie = NULL; + kmem_free(sm->sm_ppd, 64 * sizeof (uint64_t)); sm->sm_ppd = NULL; -} -static uint64_t -metaslab_ff_alloc(space_map_t *sm, uint64_t size) -{ - avl_tree_t *t = &sm->sm_root; - uint64_t align = size & -size; - uint64_t *cursor = (uint64_t *)sm->sm_ppd + highbit(align) - 1; + while (avl_destroy_nodes(sm->sm_pp_root, &cookie) != NULL) { + /* tear down the tree */ + } - return (metaslab_block_picker(t, cursor, size, align)); + avl_destroy(sm->sm_pp_root); + kmem_free(sm->sm_pp_root, sizeof (avl_tree_t)); + sm->sm_pp_root = NULL; } /* ARGSUSED */ static void -metaslab_ff_claim(space_map_t *sm, uint64_t start, uint64_t size) +metaslab_pp_claim(space_map_t *sm, uint64_t start, uint64_t size) { /* No need to update cursor */ } /* ARGSUSED */ static void -metaslab_ff_free(space_map_t *sm, uint64_t start, uint64_t size) +metaslab_pp_free(space_map_t *sm, uint64_t start, uint64_t size) { /* No need to update cursor */ } -static space_map_ops_t metaslab_ff_ops = { - metaslab_ff_load, - metaslab_ff_unload, - metaslab_ff_alloc, - metaslab_ff_claim, - metaslab_ff_free, - NULL /* maxsize */ -}; - /* - * Dynamic block allocator - - * Uses the first fit allocation scheme until space get low and then - * adjusts to a best fit allocation method. Uses metaslab_df_alloc_threshold - * and metaslab_df_free_pct to determine when to switch the allocation scheme. + * Return the maximum contiguous segment within the metaslab. */ - uint64_t -metaslab_df_maxsize(space_map_t *sm) +metaslab_pp_maxsize(space_map_t *sm) { avl_tree_t *t = sm->sm_pp_root; space_seg_t *ss; @@ -330,67 +361,53 @@ metaslab_df_maxsize(space_map_t *sm) return (ss->ss_end - ss->ss_start); } -static int -metaslab_df_seg_compare(const void *x1, const void *x2) +/* + * ========================================================================== + * The first-fit block allocator + * ========================================================================== + */ +static uint64_t +metaslab_ff_alloc(space_map_t *sm, uint64_t size) { - const space_seg_t *s1 = x1; - const space_seg_t *s2 = x2; - uint64_t ss_size1 = s1->ss_end - s1->ss_start; - uint64_t ss_size2 = s2->ss_end - s2->ss_start; - - if (ss_size1 < ss_size2) - return (-1); - if (ss_size1 > ss_size2) - return (1); - - if (s1->ss_start < s2->ss_start) - return (-1); - if (s1->ss_start > s2->ss_start) - return (1); + avl_tree_t *t = &sm->sm_root; + uint64_t align = size & -size; + uint64_t *cursor = (uint64_t *)sm->sm_ppd + highbit(align) - 1; - return (0); + return (metaslab_block_picker(t, cursor, size, align)); } -static void -metaslab_df_load(space_map_t *sm) +/* ARGSUSED */ +boolean_t +metaslab_ff_fragmented(space_map_t *sm) { - space_seg_t *ss; - - ASSERT(sm->sm_ppd == NULL); - sm->sm_ppd = kmem_zalloc(64 * sizeof (uint64_t), KM_SLEEP); - - sm->sm_pp_root = kmem_alloc(sizeof (avl_tree_t), KM_SLEEP); - avl_create(sm->sm_pp_root, metaslab_df_seg_compare, - sizeof (space_seg_t), offsetof(struct space_seg, ss_pp_node)); - - for (ss = avl_first(&sm->sm_root); ss; ss = AVL_NEXT(&sm->sm_root, ss)) - avl_add(sm->sm_pp_root, ss); + return (B_TRUE); } -static void -metaslab_df_unload(space_map_t *sm) -{ - void *cookie = NULL; - - kmem_free(sm->sm_ppd, 64 * sizeof (uint64_t)); - sm->sm_ppd = NULL; - - while (avl_destroy_nodes(sm->sm_pp_root, &cookie) != NULL) { - /* tear down the tree */ - } - - avl_destroy(sm->sm_pp_root); - kmem_free(sm->sm_pp_root, sizeof (avl_tree_t)); - sm->sm_pp_root = NULL; -} +static space_map_ops_t metaslab_ff_ops = { + metaslab_pp_load, + metaslab_pp_unload, + metaslab_ff_alloc, + metaslab_pp_claim, + metaslab_pp_free, + metaslab_pp_maxsize, + metaslab_ff_fragmented +}; +/* + * ========================================================================== + * Dynamic block allocator - + * Uses the first fit allocation scheme until space get low and then + * adjusts to a best fit allocation method. Uses metaslab_df_alloc_threshold + * and metaslab_df_free_pct to determine when to switch the allocation scheme. + * ========================================================================== + */ static uint64_t metaslab_df_alloc(space_map_t *sm, uint64_t size) { avl_tree_t *t = &sm->sm_root; uint64_t align = size & -size; uint64_t *cursor = (uint64_t *)sm->sm_ppd + highbit(align) - 1; - uint64_t max_size = metaslab_df_maxsize(sm); + uint64_t max_size = metaslab_pp_maxsize(sm); int free_pct = sm->sm_space * 100 / sm->sm_size; ASSERT(MUTEX_HELD(sm->sm_lock)); @@ -412,30 +429,158 @@ metaslab_df_alloc(space_map_t *sm, uint6 return (metaslab_block_picker(t, cursor, size, 1ULL)); } -/* ARGSUSED */ -static void -metaslab_df_claim(space_map_t *sm, uint64_t start, uint64_t size) +static boolean_t +metaslab_df_fragmented(space_map_t *sm) { - /* No need to update cursor */ -} + uint64_t max_size = metaslab_pp_maxsize(sm); + int free_pct = sm->sm_space * 100 / sm->sm_size; -/* ARGSUSED */ -static void -metaslab_df_free(space_map_t *sm, uint64_t start, uint64_t size) -{ - /* No need to update cursor */ + if (max_size >= metaslab_df_alloc_threshold && + free_pct >= metaslab_df_free_pct) + return (B_FALSE); + + return (B_TRUE); } static space_map_ops_t metaslab_df_ops = { - metaslab_df_load, - metaslab_df_unload, + metaslab_pp_load, + metaslab_pp_unload, metaslab_df_alloc, - metaslab_df_claim, - metaslab_df_free, - metaslab_df_maxsize + metaslab_pp_claim, + metaslab_pp_free, + metaslab_pp_maxsize, + metaslab_df_fragmented +}; + +/* + * ========================================================================== + * Other experimental allocators + * ========================================================================== + */ +static uint64_t +metaslab_cdf_alloc(space_map_t *sm, uint64_t size) +{ + avl_tree_t *t = &sm->sm_root; + uint64_t *cursor = (uint64_t *)sm->sm_ppd; + uint64_t *extent_end = (uint64_t *)sm->sm_ppd + 1; + uint64_t max_size = metaslab_pp_maxsize(sm); + uint64_t rsize = size; + uint64_t offset = 0; + + ASSERT(MUTEX_HELD(sm->sm_lock)); + ASSERT3U(avl_numnodes(&sm->sm_root), ==, avl_numnodes(sm->sm_pp_root)); + + if (max_size < size) + return (-1ULL); + + ASSERT3U(*extent_end, >=, *cursor); + + /* + * If we're running low on space switch to using the size + * sorted AVL tree (best-fit). + */ + if ((*cursor + size) > *extent_end) { + + t = sm->sm_pp_root; + *cursor = *extent_end = 0; + + if (max_size > 2 * SPA_MAXBLOCKSIZE) + rsize = MIN(metaslab_min_alloc_size, max_size); + offset = metaslab_block_picker(t, extent_end, rsize, 1ULL); + if (offset != -1) + *cursor = offset + size; + } else { + offset = metaslab_block_picker(t, cursor, rsize, 1ULL); + } + ASSERT3U(*cursor, <=, *extent_end); + return (offset); +} + +static boolean_t +metaslab_cdf_fragmented(space_map_t *sm) +{ + uint64_t max_size = metaslab_pp_maxsize(sm); + + if (max_size > (metaslab_min_alloc_size * 10)) + return (B_FALSE); + return (B_TRUE); +} + +static space_map_ops_t metaslab_cdf_ops = { + metaslab_pp_load, + metaslab_pp_unload, + metaslab_cdf_alloc, + metaslab_pp_claim, + metaslab_pp_free, + metaslab_pp_maxsize, + metaslab_cdf_fragmented +}; + +uint64_t metaslab_ndf_clump_shift = 4; + +static uint64_t +metaslab_ndf_alloc(space_map_t *sm, uint64_t size) +{ + avl_tree_t *t = &sm->sm_root; + avl_index_t where; + space_seg_t *ss, ssearch; + uint64_t hbit = highbit(size); + uint64_t *cursor = (uint64_t *)sm->sm_ppd + hbit - 1; + uint64_t max_size = metaslab_pp_maxsize(sm); + + ASSERT(MUTEX_HELD(sm->sm_lock)); + ASSERT3U(avl_numnodes(&sm->sm_root), ==, avl_numnodes(sm->sm_pp_root)); + + if (max_size < size) + return (-1ULL); + + ssearch.ss_start = *cursor; + ssearch.ss_end = *cursor + size; + + ss = avl_find(t, &ssearch, &where); + if (ss == NULL || (ss->ss_start + size > ss->ss_end)) { + t = sm->sm_pp_root; + + ssearch.ss_start = 0; + ssearch.ss_end = MIN(max_size, + 1ULL << (hbit + metaslab_ndf_clump_shift)); + ss = avl_find(t, &ssearch, &where); + if (ss == NULL) + ss = avl_nearest(t, where, AVL_AFTER); + ASSERT(ss != NULL); + } + + if (ss != NULL) { + if (ss->ss_start + size <= ss->ss_end) { + *cursor = ss->ss_start + size; + return (ss->ss_start); + } + } + return (-1ULL); +} + +static boolean_t +metaslab_ndf_fragmented(space_map_t *sm) +{ + uint64_t max_size = metaslab_pp_maxsize(sm); + + if (max_size > (metaslab_min_alloc_size << metaslab_ndf_clump_shift)) + return (B_FALSE); + return (B_TRUE); +} + + +static space_map_ops_t metaslab_ndf_ops = { + metaslab_pp_load, + metaslab_pp_unload, + metaslab_ndf_alloc, + metaslab_pp_claim, + metaslab_pp_free, + metaslab_pp_maxsize, + metaslab_ndf_fragmented }; -space_map_ops_t *zfs_metaslab_ops = &metaslab_df_ops; +space_map_ops_t *zfs_metaslab_ops = &metaslab_ndf_ops; /* * ========================================================================== @@ -522,7 +667,6 @@ metaslab_fini(metaslab_t *msp) #define METASLAB_WEIGHT_SECONDARY (1ULL << 62) #define METASLAB_ACTIVE_MASK \ (METASLAB_WEIGHT_PRIMARY | METASLAB_WEIGHT_SECONDARY) -#define METASLAB_SMO_BONUS_MULTIPLIER 2 static uint64_t metaslab_weight(metaslab_t *msp) @@ -555,25 +699,60 @@ metaslab_weight(metaslab_t *msp) ASSERT(weight >= space && weight <= 2 * space); /* - * For locality, assign higher weight to metaslabs we've used before. + * For locality, assign higher weight to metaslabs which have + * a lower offset than what we've already activated. */ - if (smo->smo_object != 0) - weight *= METASLAB_SMO_BONUS_MULTIPLIER; + if (sm->sm_start <= mg->mg_bonus_area) + weight *= (metaslab_smo_bonus_pct / 100); ASSERT(weight >= space && - weight <= 2 * METASLAB_SMO_BONUS_MULTIPLIER * space); + weight <= 2 * (metaslab_smo_bonus_pct / 100) * space); + + if (sm->sm_loaded && !sm->sm_ops->smop_fragmented(sm)) { + /* + * If this metaslab is one we're actively using, adjust its + * weight to make it preferable to any inactive metaslab so + * we'll polish it off. + */ + weight |= (msp->ms_weight & METASLAB_ACTIVE_MASK); + } + return (weight); +} + +static void +metaslab_prefetch(metaslab_group_t *mg) +{ + spa_t *spa = mg->mg_vd->vdev_spa; + metaslab_t *msp; + avl_tree_t *t = &mg->mg_metaslab_tree; + int m; + + mutex_enter(&mg->mg_lock); /* - * If this metaslab is one we're actively using, adjust its weight to - * make it preferable to any inactive metaslab so we'll polish it off. + * Prefetch the next potential metaslabs */ - weight |= (msp->ms_weight & METASLAB_ACTIVE_MASK); + for (msp = avl_first(t), m = 0; msp; msp = AVL_NEXT(t, msp), m++) { + space_map_t *sm = &msp->ms_map; + space_map_obj_t *smo = &msp->ms_smo; - return (weight); + /* If we have reached our prefetch limit then we're done */ + if (m >= metaslab_prefetch_limit) + break; + + if (!sm->sm_loaded && smo->smo_object != 0) { + mutex_exit(&mg->mg_lock); + dmu_prefetch(spa->spa_meta_objset, smo->smo_object, + 0ULL, smo->smo_objsize); + mutex_enter(&mg->mg_lock); + } + } + mutex_exit(&mg->mg_lock); } static int metaslab_activate(metaslab_t *msp, uint64_t activation_weight, uint64_t size) { + metaslab_group_t *mg = msp->ms_group; space_map_t *sm = &msp->ms_map; space_map_ops_t *sm_ops = msp->ms_group->mg_class->mc_ops; @@ -588,6 +767,15 @@ metaslab_activate(metaslab_t *msp, uint6 } /* + * Track the bonus area as we activate new metaslabs. + */ + if (sm->sm_start > mg->mg_bonus_area) { + mutex_enter(&mg->mg_lock); + mg->mg_bonus_area = sm->sm_start; + mutex_exit(&mg->mg_lock); + } + + /* * If we were able to load the map then make sure * that this map is still able to satisfy our request. */ @@ -773,6 +961,32 @@ metaslab_sync_done(metaslab_t *msp, uint mutex_exit(&msp->ms_lock); } +void +metaslab_sync_reassess(metaslab_group_t *mg) +{ + vdev_t *vd = mg->mg_vd; + + /* + * Re-evaluate all metaslabs which have lower offsets than the + * bonus area. + */ + for (int m = 0; m < vd->vdev_ms_count; m++) { + metaslab_t *msp = vd->vdev_ms[m]; + + if (msp->ms_map.sm_start > mg->mg_bonus_area) + break; + + mutex_enter(&msp->ms_lock); + metaslab_group_sort(mg, msp, metaslab_weight(msp)); + mutex_exit(&msp->ms_lock); + } + + /* + * Prefetch the next potential metaslabs + */ + metaslab_prefetch(mg); +} + static uint64_t metaslab_distance(metaslab_t *msp, dva_t *dva) { @@ -868,7 +1082,7 @@ metaslab_group_alloc(metaslab_group_t *m if ((offset = space_map_alloc(&msp->ms_map, size)) != -1ULL) break; - metaslab_passivate(msp, size - 1); + metaslab_passivate(msp, space_map_maxsize(&msp->ms_map)); mutex_exit(&msp->ms_lock); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Aug 28 08:57:15 2010 (r211930) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Aug 28 08:59:55 2010 (r211931) @@ -74,35 +74,38 @@ enum zti_modes { zti_mode_fixed, /* value is # of threads (min 1) */ zti_mode_online_percent, /* value is % of online CPUs */ zti_mode_tune, /* fill from zio_taskq_tune_* */ + zti_mode_null, /* don't create a taskq */ zti_nmodes }; -#define ZTI_THREAD_FIX(n) { zti_mode_fixed, (n) } -#define ZTI_THREAD_PCT(n) { zti_mode_online_percent, (n) } -#define ZTI_THREAD_TUNE { zti_mode_tune, 0 } +#define ZTI_FIX(n) { zti_mode_fixed, (n) } +#define ZTI_PCT(n) { zti_mode_online_percent, (n) } +#define ZTI_TUNE { zti_mode_tune, 0 } +#define ZTI_NULL { zti_mode_null, 0 } -#define ZTI_THREAD_ONE ZTI_THREAD_FIX(1) +#define ZTI_ONE ZTI_FIX(1) typedef struct zio_taskq_info { - const char *zti_name; - struct { - enum zti_modes zti_mode; - uint_t zti_value; - } zti_nthreads[ZIO_TASKQ_TYPES]; + enum zti_modes zti_mode; + uint_t zti_value; } zio_taskq_info_t; static const char *const zio_taskq_types[ZIO_TASKQ_TYPES] = { - "issue", "intr" + "issue", "issue_high", "intr", "intr_high" }; -const zio_taskq_info_t zio_taskqs[ZIO_TYPES] = { - /* ISSUE INTR */ - { "spa_zio_null", { ZTI_THREAD_ONE, ZTI_THREAD_ONE } }, - { "spa_zio_read", { ZTI_THREAD_FIX(8), ZTI_THREAD_TUNE } }, - { "spa_zio_write", { ZTI_THREAD_TUNE, ZTI_THREAD_FIX(8) } }, - { "spa_zio_free", { ZTI_THREAD_ONE, ZTI_THREAD_ONE } }, - { "spa_zio_claim", { ZTI_THREAD_ONE, ZTI_THREAD_ONE } }, - { "spa_zio_ioctl", { ZTI_THREAD_ONE, ZTI_THREAD_ONE } }, +/* + * Define the taskq threads for the following I/O types: + * NULL, READ, WRITE, FREE, CLAIM, and IOCTL + */ +const zio_taskq_info_t zio_taskqs[ZIO_TYPES][ZIO_TASKQ_TYPES] = { + /* ISSUE ISSUE_HIGH INTR INTR_HIGH */ + { ZTI_ONE, ZTI_NULL, ZTI_ONE, ZTI_NULL }, + { ZTI_FIX(8), ZTI_NULL, ZTI_TUNE, ZTI_NULL }, + { ZTI_TUNE, ZTI_FIX(5), ZTI_FIX(8), ZTI_FIX(5) }, + { ZTI_ONE, ZTI_NULL, ZTI_ONE, ZTI_NULL }, + { ZTI_ONE, ZTI_NULL, ZTI_ONE, ZTI_NULL }, + { ZTI_ONE, ZTI_NULL, ZTI_ONE, ZTI_NULL }, }; enum zti_modes zio_taskq_tune_mode = zti_mode_online_percent; @@ -581,14 +584,14 @@ spa_activate(spa_t *spa, int mode) spa->spa_log_class = metaslab_class_create(zfs_metaslab_ops); for (int t = 0; t < ZIO_TYPES; t++) { - const zio_taskq_info_t *ztip = &zio_taskqs[t]; for (int q = 0; q < ZIO_TASKQ_TYPES; q++) { - enum zti_modes mode = ztip->zti_nthreads[q].zti_mode; - uint_t value = ztip->zti_nthreads[q].zti_value; + const zio_taskq_info_t *ztip = &zio_taskqs[t][q]; + enum zti_modes mode = ztip->zti_mode; + uint_t value = ztip->zti_value; char name[32]; (void) snprintf(name, sizeof (name), - "%s_%s", ztip->zti_name, zio_taskq_types[q]); + "%s_%s", zio_type_name[t], zio_taskq_types[q]); if (mode == zti_mode_tune) { mode = zio_taskq_tune_mode; @@ -613,6 +616,10 @@ spa_activate(spa_t *spa, int mode) TASKQ_PREPOPULATE | TASKQ_THREADS_CPU_PCT); break; + case zti_mode_null: + spa->spa_zio_taskq[t][q] = NULL; + break; + case zti_mode_tune: default: panic("unrecognized mode for " @@ -659,7 +666,8 @@ spa_deactivate(spa_t *spa) for (int t = 0; t < ZIO_TYPES; t++) { for (int q = 0; q < ZIO_TASKQ_TYPES; q++) { - taskq_destroy(spa->spa_zio_taskq[t][q]); + if (spa->spa_zio_taskq[t][q] != NULL) + taskq_destroy(spa->spa_zio_taskq[t][q]); spa->spa_zio_taskq[t][q] = NULL; } } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Sat Aug 28 08:57:15 2010 (r211930) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Sat Aug 28 08:59:55 2010 (r211931) @@ -368,10 +368,8 @@ space_map_unload(space_map_t *sm) uint64_t space_map_maxsize(space_map_t *sm) { - if (sm->sm_loaded && sm->sm_ops != NULL) - return (sm->sm_ops->smop_max(sm)); - else - return (-1ULL); + ASSERT(sm->sm_ops != NULL); + return (sm->sm_ops->smop_max(sm)); } uint64_t Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h Sat Aug 28 08:57:15 2010 (r211930) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h Sat Aug 28 08:59:55 2010 (r211931) @@ -46,6 +46,7 @@ extern metaslab_t *metaslab_init(metasla extern void metaslab_fini(metaslab_t *msp); extern void metaslab_sync(metaslab_t *msp, uint64_t txg); extern void metaslab_sync_done(metaslab_t *msp, uint64_t txg); +extern void metaslab_sync_reassess(metaslab_group_t *mg); #define METASLAB_HINTBP_FAVOR 0x0 #define METASLAB_HINTBP_AVOID 0x1 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Sat Aug 28 08:57:15 2010 (r211930) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Sat Aug 28 08:59:55 2010 (r211931) @@ -46,6 +46,7 @@ struct metaslab_group { kmutex_t mg_lock; avl_tree_t mg_metaslab_tree; uint64_t mg_aliquot; + uint64_t mg_bonus_area; int64_t mg_bias; metaslab_class_t *mg_class; vdev_t *mg_vd; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Sat Aug 28 08:57:15 2010 (r211930) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Sat Aug 28 08:59:55 2010 (r211931) @@ -87,7 +87,9 @@ typedef enum spa_log_state { enum zio_taskq_type { ZIO_TASKQ_ISSUE = 0, + ZIO_TASKQ_ISSUE_HIGH, ZIO_TASKQ_INTERRUPT, + ZIO_TASKQ_INTERRUPT_HIGH, ZIO_TASKQ_TYPES }; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h Sat Aug 28 08:57:15 2010 (r211930) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h Sat Aug 28 08:59:55 2010 (r211931) @@ -77,6 +77,7 @@ struct space_map_ops { void (*smop_claim)(space_map_t *sm, uint64_t start, uint64_t size); void (*smop_free)(space_map_t *sm, uint64_t start, uint64_t size); uint64_t (*smop_max)(space_map_t *sm); + boolean_t (*smop_fragmented)(space_map_t *sm); }; /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Sat Aug 28 08:57:15 2010 (r211930) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Sat Aug 28 08:59:55 2010 (r211931) @@ -107,14 +107,15 @@ enum zio_compress { #define ZIO_PRIORITY_NOW (zio_priority_table[0]) #define ZIO_PRIORITY_SYNC_READ (zio_priority_table[1]) #define ZIO_PRIORITY_SYNC_WRITE (zio_priority_table[2]) -#define ZIO_PRIORITY_ASYNC_READ (zio_priority_table[3]) -#define ZIO_PRIORITY_ASYNC_WRITE (zio_priority_table[4]) -#define ZIO_PRIORITY_FREE (zio_priority_table[5]) -#define ZIO_PRIORITY_CACHE_FILL (zio_priority_table[6]) -#define ZIO_PRIORITY_LOG_WRITE (zio_priority_table[7]) -#define ZIO_PRIORITY_RESILVER (zio_priority_table[8]) -#define ZIO_PRIORITY_SCRUB (zio_priority_table[9]) -#define ZIO_PRIORITY_TABLE_SIZE 10 +#define ZIO_PRIORITY_LOG_WRITE (zio_priority_table[3]) +#define ZIO_PRIORITY_CACHE_FILL (zio_priority_table[4]) +#define ZIO_PRIORITY_AGG (zio_priority_table[5]) +#define ZIO_PRIORITY_FREE (zio_priority_table[6]) +#define ZIO_PRIORITY_ASYNC_WRITE (zio_priority_table[7]) +#define ZIO_PRIORITY_ASYNC_READ (zio_priority_table[8]) +#define ZIO_PRIORITY_RESILVER (zio_priority_table[9]) +#define ZIO_PRIORITY_SCRUB (zio_priority_table[10]) +#define ZIO_PRIORITY_TABLE_SIZE 11 #define ZIO_FLAG_MUSTSUCCEED 0x00000 #define ZIO_FLAG_CANFAIL 0x00001 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Sat Aug 28 08:57:15 2010 (r211930) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Sat Aug 28 08:59:55 2010 (r211931) @@ -1773,9 +1773,13 @@ void vdev_sync_done(vdev_t *vd, uint64_t txg) { metaslab_t *msp; + boolean_t reassess = !txg_list_empty(&vd->vdev_ms_list, TXG_CLEAN(txg)); while (msp = txg_list_remove(&vd->vdev_ms_list, TXG_CLEAN(txg))) metaslab_sync_done(msp, txg); + + if (reassess) + metaslab_sync_reassess(vd->vdev_mg); } void Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Sat Aug 28 08:57:15 2010 (r211930) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Sat Aug 28 08:59:55 2010 (r211931) @@ -233,7 +233,7 @@ vdev_queue_io_to_issue(vdev_queue_t *vq, ASSERT(size <= zfs_vdev_aggregation_limit); aio = zio_vdev_delegated_io(fio->io_vd, fio->io_offset, - zio_buf_alloc(size), size, fio->io_type, ZIO_PRIORITY_NOW, + zio_buf_alloc(size), size, fio->io_type, ZIO_PRIORITY_AGG, flags | ZIO_FLAG_DONT_CACHE | ZIO_FLAG_DONT_QUEUE, vdev_queue_agg_io_done, NULL); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sat Aug 28 08:57:15 2010 (r211930) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sat Aug 28 08:59:55 2010 (r211931) @@ -49,11 +49,12 @@ uint8_t zio_priority_table[ZIO_PRIORITY_ 0, /* ZIO_PRIORITY_NOW */ 0, /* ZIO_PRIORITY_SYNC_READ */ 0, /* ZIO_PRIORITY_SYNC_WRITE */ - 6, /* ZIO_PRIORITY_ASYNC_READ */ - 4, /* ZIO_PRIORITY_ASYNC_WRITE */ - 4, /* ZIO_PRIORITY_FREE */ - 0, /* ZIO_PRIORITY_CACHE_FILL */ 0, /* ZIO_PRIORITY_LOG_WRITE */ + 1, /* ZIO_PRIORITY_CACHE_FILL */ + 1, /* ZIO_PRIORITY_AGG */ + 4, /* ZIO_PRIORITY_FREE */ + 4, /* ZIO_PRIORITY_ASYNC_WRITE */ + 6, /* ZIO_PRIORITY_ASYNC_READ */ 10, /* ZIO_PRIORITY_RESILVER */ 20, /* ZIO_PRIORITY_SCRUB */ }; @@ -64,7 +65,9 @@ uint8_t zio_priority_table[ZIO_PRIORITY_ * ========================================================================== */ char *zio_type_name[ZIO_TYPES] = { - "null", "read", "write", "free", "claim", "ioctl" }; + "zio_null", "zio_read", "zio_write", "zio_free", "zio_claim", + "zio_ioctl" +}; #define SYNC_PASS_DEFERRED_FREE 1 /* defer frees after this pass */ #define SYNC_PASS_DONT_COMPRESS 4 /* don't compress after this pass */ @@ -942,6 +945,7 @@ zio_write_bp_init(zio_t *zio) static void zio_taskq_dispatch(zio_t *zio, enum zio_taskq_type q) { + spa_t *spa = zio->io_spa; zio_type_t t = zio->io_type; /* @@ -958,7 +962,15 @@ zio_taskq_dispatch(zio_t *zio, enum zio_ if (t == ZIO_TYPE_WRITE && zio->io_vd && zio->io_vd->vdev_aux) t = ZIO_TYPE_NULL; - (void) taskq_dispatch_safe(zio->io_spa->spa_zio_taskq[t][q], + /* + * If this is a high priority I/O, then use the high priority taskq. + */ + if (zio->io_priority == ZIO_PRIORITY_NOW && + spa->spa_zio_taskq[t][q + 1] != NULL) + q++; + + ASSERT3U(q, <, ZIO_TASKQ_TYPES); + (void) taskq_dispatch_safe(spa->spa_zio_taskq[t][q], (task_func_t *)zio_execute, zio, &zio->io_task); } From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 09:24:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9249B1065670; Sat, 28 Aug 2010 09:24:11 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E8158FC19; Sat, 28 Aug 2010 09:24:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7S9OBgw025480; Sat, 28 Aug 2010 09:24:11 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7S9OBgU025468; Sat, 28 Aug 2010 09:24:11 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201008280924.o7S9OBgU025468@svn.freebsd.org> From: Martin Matuska Date: Sat, 28 Aug 2010 09:24:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211932 - in head/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 09:24:11 -0000 Author: mm Date: Sat Aug 28 09:24:11 2010 New Revision: 211932 URL: http://svn.freebsd.org/changeset/base/211932 Log: Import changes from OpenSolaris that provide - better ACL caching and speedup of ACL permission checks - faster handling of stat() - lowered mutex contention in the read/writer lock (rrwlock) - several related bugfixes Detailed information (OpenSolaris onnv changesets and Bug IDs): 9749:105f407a2680 6802734 Support for Access Based Enumeration (not used on FreeBSD) 6844861 inconsistent xattr readdir behavior with too-small buffer 9866:ddc5f1d8eb4e 6848431 zfs with rstchown=0 or file_chown_self privilege allows user to "take" ownership 9981:b4907297e740 6775100 stat() performance on files on zfs should be improved 6827779 rrwlock is overly protective of its counters 10143:d2d432dfe597 6857433 memory leaks found at: zfs_acl_alloc/zfs_acl_node_alloc 6860318 truncate() on zfsroot succeeds when file has a component of its path set without access permission 10232:f37b85f7e03e 6865875 zfs sometimes incorrectly giving search access to a dir 10250:b179ceb34b62 6867395 zpool_upgrade_007_pos testcase panic'd with BAD TRAP: type=e (#pf Page fault) 10269:2788675568fd 6868276 zfs_rezget() can be hazardous when znode has a cached ACL 10295:f7a18a1e9610 6870564 panic in zfs_getsecattr Approved by: delphij (mentor) Obtained from: OpenSolaris (multiple Bug IDs) MFC after: 2 weeks Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c head/sys/cddl/compat/opensolaris/sys/policy.h head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c head/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c Sat Aug 28 08:59:55 2010 (r211931) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c Sat Aug 28 09:24:11 2010 (r211932) @@ -332,7 +332,7 @@ secpolicy_vnode_owner(struct vnode *vp, } int -secpolicy_vnode_chown(struct vnode *vp, cred_t *cred, boolean_t check_self) +secpolicy_vnode_chown(struct vnode *vp, cred_t *cred, uid_t owner) { if (secpolicy_fs_owner(vp->v_mount, cred) == 0) Modified: head/sys/cddl/compat/opensolaris/sys/policy.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/policy.h Sat Aug 28 08:59:55 2010 (r211931) +++ head/sys/cddl/compat/opensolaris/sys/policy.h Sat Aug 28 09:24:11 2010 (r211932) @@ -47,8 +47,7 @@ int secpolicy_zinject(struct ucred *cred int secpolicy_fs_unmount(struct ucred *cred, struct mount *vfsp); int secpolicy_basic_link(struct vnode *vp, struct ucred *cred); int secpolicy_vnode_owner(struct vnode *vp, cred_t *cred, uid_t owner); -int secpolicy_vnode_chown(struct vnode *vp, cred_t *cred, - boolean_t check_self); +int secpolicy_vnode_chown(struct vnode *vp, cred_t *cred, uid_t owner); int secpolicy_vnode_stky_modify(struct ucred *cred); int secpolicy_vnode_remove(struct vnode *vp, struct ucred *cred); int secpolicy_vnode_access(struct ucred *cred, struct vnode *vp, Modified: head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Sat Aug 28 08:59:55 2010 (r211931) +++ head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Sat Aug 28 09:24:11 2010 (r211932) @@ -19,6 +19,9 @@ # CDDL HEADER END # +ZUT_OBJS += \ + zut.o + # # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c Sat Aug 28 08:59:55 2010 (r211931) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c Sat Aug 28 09:24:11 2010 (r211932) @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include @@ -84,7 +82,7 @@ rrn_find(rrwlock_t *rrl) rrw_node_t *rn; if (refcount_count(&rrl->rr_linked_rcount) == 0) - return (NULL); + return (B_FALSE); for (rn = tsd_get(rrw_tsd_key); rn != NULL; rn = rn->rn_next) { if (rn->rn_rrl == rrl) @@ -159,6 +157,14 @@ static void rrw_enter_read(rrwlock_t *rrl, void *tag) { mutex_enter(&rrl->rr_lock); +#if !defined(DEBUG) && defined(_KERNEL) + if (!rrl->rr_writer && !rrl->rr_writer_wanted) { + rrl->rr_anon_rcount.rc_count++; + mutex_exit(&rrl->rr_lock); + return; + } + DTRACE_PROBE(zfs__rrwfastpath__rdmiss); +#endif ASSERT(rrl->rr_writer != curthread); ASSERT(refcount_count(&rrl->rr_anon_rcount) >= 0); @@ -208,19 +214,28 @@ void rrw_exit(rrwlock_t *rrl, void *tag) { mutex_enter(&rrl->rr_lock); +#if !defined(DEBUG) && defined(_KERNEL) + if (!rrl->rr_writer && rrl->rr_linked_rcount.rc_count == 0) { + rrl->rr_anon_rcount.rc_count--; + if (rrl->rr_anon_rcount.rc_count == 0) + cv_broadcast(&rrl->rr_cv); + mutex_exit(&rrl->rr_lock); + return; + } + DTRACE_PROBE(zfs__rrwfastpath__exitmiss); +#endif ASSERT(!refcount_is_zero(&rrl->rr_anon_rcount) || !refcount_is_zero(&rrl->rr_linked_rcount) || rrl->rr_writer != NULL); if (rrl->rr_writer == NULL) { - if (rrn_find_and_remove(rrl)) { - if (refcount_remove(&rrl->rr_linked_rcount, tag) == 0) - cv_broadcast(&rrl->rr_cv); - - } else { - if (refcount_remove(&rrl->rr_anon_rcount, tag) == 0) - cv_broadcast(&rrl->rr_cv); - } + int64_t count; + if (rrn_find_and_remove(rrl)) + count = refcount_remove(&rrl->rr_linked_rcount, tag); + else + count = refcount_remove(&rrl->rr_anon_rcount, tag); + if (count == 0) + cv_broadcast(&rrl->rr_cv); } else { ASSERT(rrl->rr_writer == curthread); ASSERT(refcount_is_zero(&rrl->rr_anon_rcount) && Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h Sat Aug 28 08:59:55 2010 (r211931) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h Sat Aug 28 09:24:11 2010 (r211932) @@ -200,7 +200,9 @@ int zfs_setacl(struct znode *, vsecattr_ void zfs_acl_rele(void *); void zfs_oldace_byteswap(ace_t *, int); void zfs_ace_byteswap(void *, size_t, boolean_t); +extern boolean_t zfs_has_access(struct znode *zp, cred_t *cr); extern int zfs_zaccess(struct znode *, int, int, boolean_t, cred_t *); +int zfs_fastaccesschk_execute(struct znode *, cred_t *); extern int zfs_zaccess_rwx(struct znode *, mode_t, int, cred_t *); extern int zfs_zaccess_unix(struct znode *, mode_t, cred_t *); extern int zfs_acl_access(struct znode *, int, cred_t *); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Sat Aug 28 08:59:55 2010 (r211931) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Sat Aug 28 09:24:11 2010 (r211932) @@ -74,6 +74,7 @@ extern "C" { #define ZFS_ACL_DEFAULTED 0x20 /* ACL should be defaulted */ #define ZFS_ACL_AUTO_INHERIT 0x40 /* ACL should be inherited */ #define ZFS_BONUS_SCANSTAMP 0x80 /* Scanstamp in bonus area */ +#define ZFS_NO_EXECS_DENIED 0x100 /* exec was given to everyone */ /* * Is ID ephemeral? @@ -202,6 +203,7 @@ typedef struct znode { uint64_t z_gen; /* generation (same as zp_gen) */ uint32_t z_sync_cnt; /* synchronous open count */ kmutex_t z_acl_lock; /* acl data lock */ + zfs_acl_t *z_acl_cached; /* cached acl */ list_node_t z_link_node; /* all znodes in fs link */ /* * These are dmu managed fields. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Sat Aug 28 08:59:55 2010 (r211931) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Sat Aug 28 09:24:11 2010 (r211932) @@ -91,6 +91,8 @@ #define ZFS_ACL_WIDE_FLAGS (V4_ACL_WIDE_FLAGS|ZFS_ACL_TRIVIAL|ZFS_INHERIT_ACE|\ ZFS_ACL_OBJ_ACE) +#define ALL_MODE_EXECS (S_IXUSR | S_IXGRP | S_IXOTH) + static uint16_t zfs_ace_v0_get_type(void *acep) { @@ -779,6 +781,7 @@ zfs_mode_compute(znode_t *zp, zfs_acl_t uint64_t who; uint16_t iflags, type; uint32_t access_mask; + boolean_t an_exec_denied = B_FALSE; mode = (zp->z_phys->zp_mode & (S_IFMT | S_ISUID | S_ISGID | S_ISVTX)); @@ -903,8 +906,32 @@ zfs_mode_compute(znode_t *zp, zfs_acl_t } } } + } else { + /* + * Only care if this IDENTIFIER_GROUP or + * USER ACE denies execute access to someone, + * mode is not affected + */ + if ((access_mask & ACE_EXECUTE) && type == DENY) + an_exec_denied = B_TRUE; } } + + /* + * Failure to allow is effectively a deny, so execute permission + * is denied if it was never mentioned or if we explicitly + * weren't allowed it. + */ + if (!an_exec_denied && + ((seen & ALL_MODE_EXECS) != ALL_MODE_EXECS || + (mode & ALL_MODE_EXECS) != ALL_MODE_EXECS)) + an_exec_denied = B_TRUE; + + if (an_exec_denied) + zp->z_phys->zp_flags &= ~ZFS_NO_EXECS_DENIED; + else + zp->z_phys->zp_flags |= ZFS_NO_EXECS_DENIED; + return (mode); } @@ -944,7 +971,8 @@ zfs_acl_node_read_internal(znode_t *zp, } /* - * Read an external acl object. + * Read an external acl object. If the intent is to modify, always + * create a new acl and leave any cached acl in place. */ static int zfs_acl_node_read(znode_t *zp, zfs_acl_t **aclpp, boolean_t will_modify) @@ -958,8 +986,15 @@ zfs_acl_node_read(znode_t *zp, zfs_acl_t ASSERT(MUTEX_HELD(&zp->z_acl_lock)); + if (zp->z_acl_cached && !will_modify) { + *aclpp = zp->z_acl_cached; + return (0); + } + if (zp->z_phys->zp_acl.z_acl_extern_obj == 0) { *aclpp = zfs_acl_node_read_internal(zp, will_modify); + if (!will_modify) + zp->z_acl_cached = *aclpp; return (0); } @@ -993,6 +1028,8 @@ zfs_acl_node_read(znode_t *zp, zfs_acl_t } *aclpp = aclp; + if (!will_modify) + zp->z_acl_cached = aclp; return (0); } @@ -1017,11 +1054,16 @@ zfs_aclset_common(znode_t *zp, zfs_acl_t dmu_buf_will_dirty(zp->z_dbuf, tx); + if (zp->z_acl_cached) { + zfs_acl_free(zp->z_acl_cached); + zp->z_acl_cached = NULL; + } + zphys->zp_mode = zfs_mode_compute(zp, aclp); /* - * Decide which opbject type to use. If we are forced to - * use old ACL format than transform ACL into zfs_oldace_t + * Decide which object type to use. If we are forced to + * use old ACL format then transform ACL into zfs_oldace_t * layout. */ if (!zfsvfs->z_use_fuids) { @@ -1871,7 +1913,6 @@ zfs_acl_ids_create(znode_t *dzp, int fla mutex_exit(&dzp->z_acl_lock); acl_ids->z_aclp = zfs_acl_inherit(zfsvfs, vap->va_type, paclp, acl_ids->z_mode, &need_chmod); - zfs_acl_free(paclp); } else { acl_ids->z_aclp = zfs_acl_alloc(zfs_acl_version_zp(dzp)); @@ -1972,8 +2013,6 @@ zfs_getacl(znode_t *zp, vsecattr_t *vsec if (mask & VSA_ACE) { size_t aclsz; - zfs_acl_node_t *aclnode = list_head(&aclp->z_acl); - aclsz = count * sizeof (ace_t) + sizeof (ace_object_t) * largeace; @@ -1984,8 +2023,17 @@ zfs_getacl(znode_t *zp, vsecattr_t *vsec zfs_copy_fuid_2_ace(zp->z_zfsvfs, aclp, cr, vsecp->vsa_aclentp, !(mask & VSA_ACE_ALLTYPES)); else { - bcopy(aclnode->z_acldata, vsecp->vsa_aclentp, - count * sizeof (ace_t)); + zfs_acl_node_t *aclnode; + void *start = vsecp->vsa_aclentp; + + for (aclnode = list_head(&aclp->z_acl); aclnode; + aclnode = list_next(&aclp->z_acl, aclnode)) { + bcopy(aclnode->z_acldata, start, + aclnode->z_size); + start = (caddr_t)start + aclnode->z_size; + } + ASSERT((caddr_t)start - (caddr_t)vsecp->vsa_aclentp == + aclp->z_acl_bytes); } } if (mask & VSA_ACE_ACLFLAGS) { @@ -2000,8 +2048,6 @@ zfs_getacl(znode_t *zp, vsecattr_t *vsec mutex_exit(&zp->z_acl_lock); - zfs_acl_free(aclp); - return (0); } @@ -2097,11 +2143,6 @@ zfs_setacl(znode_t *zp, vsecattr_t *vsec aclp->z_hints |= (zp->z_phys->zp_flags & V4_ACL_WIDE_FLAGS); } top: - if (error = zfs_zaccess(zp, ACE_WRITE_ACL, 0, skipaclchk, cr)) { - zfs_acl_free(aclp); - return (error); - } - mutex_enter(&zp->z_lock); mutex_enter(&zp->z_acl_lock); @@ -2147,6 +2188,7 @@ top: error = zfs_aclset_common(zp, aclp, cr, tx); ASSERT(error == 0); + zp->z_acl_cached = aclp; if (fuid_dirtied) zfs_fuid_sync(zfsvfs, tx); @@ -2156,7 +2198,6 @@ top: if (fuidp) zfs_fuid_info_free(fuidp); - zfs_acl_free(aclp); dmu_tx_commit(tx); done: mutex_exit(&zp->z_acl_lock); @@ -2166,46 +2207,17 @@ done: } /* - * working_mode returns the permissions that were not granted + * Check accesses of interest (AoI) against attributes of the dataset + * such as read-only. Returns zero if no AoI conflict with dataset + * attributes, otherwise an appropriate errno is returned. */ static int -zfs_zaccess_common(znode_t *zp, uint32_t v4_mode, uint32_t *working_mode, - boolean_t *check_privs, boolean_t skipaclchk, cred_t *cr) +zfs_zaccess_dataset_check(znode_t *zp, uint32_t v4_mode) { - zfs_acl_t *aclp; - zfsvfs_t *zfsvfs = zp->z_zfsvfs; - int error; - uid_t uid = crgetuid(cr); - uint64_t who; - uint16_t type, iflags; - uint16_t entry_type; - uint32_t access_mask; - uint32_t deny_mask = 0; - zfs_ace_hdr_t *acep = NULL; - boolean_t checkit; - uid_t fowner; - uid_t gowner; - - /* - * Short circuit empty requests - */ - if (v4_mode == 0) - return (0); - - *check_privs = B_TRUE; - - if (zfsvfs->z_replay) { - *working_mode = 0; - return (0); - } - - *working_mode = v4_mode; - if ((v4_mode & WRITE_MASK) && (zp->z_zfsvfs->z_vfs->vfs_flag & VFS_RDONLY) && (!IS_DEVVP(ZTOV(zp)) || (IS_DEVVP(ZTOV(zp)) && (v4_mode & WRITE_MASK_ATTRS)))) { - *check_privs = B_FALSE; return (EROFS); } @@ -2217,14 +2229,12 @@ zfs_zaccess_common(znode_t *zp, uint32_t (zp->z_phys->zp_flags & (ZFS_READONLY | ZFS_IMMUTABLE))) || (ZTOV(zp)->v_type == VDIR && (zp->z_phys->zp_flags & ZFS_IMMUTABLE)))) { - *check_privs = B_FALSE; return (EPERM); } #ifdef sun if ((v4_mode & (ACE_DELETE | ACE_DELETE_CHILD)) && (zp->z_phys->zp_flags & ZFS_NOUNLINK)) { - *check_privs = B_FALSE; return (EPERM); } #else @@ -2235,26 +2245,60 @@ zfs_zaccess_common(znode_t *zp, uint32_t */ if ((v4_mode & ACE_DELETE) && (zp->z_phys->zp_flags & ZFS_NOUNLINK)) { - *check_privs = B_FALSE; return (EPERM); } #endif if (((v4_mode & (ACE_READ_DATA|ACE_EXECUTE)) && (zp->z_phys->zp_flags & ZFS_AV_QUARANTINED))) { - *check_privs = B_FALSE; return (EACCES); } - /* - * The caller requested that the ACL check be skipped. This - * would only happen if the caller checked VOP_ACCESS() with a - * 32 bit ACE mask and already had the appropriate permissions. - */ - if (skipaclchk) { - *working_mode = 0; - return (0); - } + return (0); +} + +/* + * The primary usage of this function is to loop through all of the + * ACEs in the znode, determining what accesses of interest (AoI) to + * the caller are allowed or denied. The AoI are expressed as bits in + * the working_mode parameter. As each ACE is processed, bits covered + * by that ACE are removed from the working_mode. This removal + * facilitates two things. The first is that when the working mode is + * empty (= 0), we know we've looked at all the AoI. The second is + * that the ACE interpretation rules don't allow a later ACE to undo + * something granted or denied by an earlier ACE. Removing the + * discovered access or denial enforces this rule. At the end of + * processing the ACEs, all AoI that were found to be denied are + * placed into the working_mode, giving the caller a mask of denied + * accesses. Returns: + * 0 if all AoI granted + * EACCESS if the denied mask is non-zero + * other error if abnormal failure (e.g., IO error) + * + * A secondary usage of the function is to determine if any of the + * AoI are granted. If an ACE grants any access in + * the working_mode, we immediately short circuit out of the function. + * This mode is chosen by setting anyaccess to B_TRUE. The + * working_mode is not a denied access mask upon exit if the function + * is used in this manner. + */ +static int +zfs_zaccess_aces_check(znode_t *zp, uint32_t *working_mode, + boolean_t anyaccess, cred_t *cr) +{ + zfsvfs_t *zfsvfs = zp->z_zfsvfs; + zfs_acl_t *aclp; + int error; + uid_t uid = crgetuid(cr); + uint64_t who; + uint16_t type, iflags; + uint16_t entry_type; + uint32_t access_mask; + uint32_t deny_mask = 0; + zfs_ace_hdr_t *acep = NULL; + boolean_t checkit; + uid_t fowner; + uid_t gowner; zfs_fuid_map_ids(zp, cr, &fowner, &gowner); @@ -2268,6 +2312,7 @@ zfs_zaccess_common(znode_t *zp, uint32_t while (acep = zfs_acl_next_ace(aclp, acep, &who, &access_mask, &iflags, &type)) { + uint32_t mask_matched; if (!zfs_acl_valid_ace_type(type, iflags)) continue; @@ -2275,6 +2320,11 @@ zfs_zaccess_common(znode_t *zp, uint32_t if (ZTOV(zp)->v_type == VDIR && (iflags & ACE_INHERIT_ONLY_ACE)) continue; + /* Skip ACE if it does not affect any AoI */ + mask_matched = (access_mask & *working_mode); + if (!mask_matched) + continue; + entry_type = (iflags & ACE_TYPE_FLAGS); checkit = B_FALSE; @@ -2306,21 +2356,29 @@ zfs_zaccess_common(znode_t *zp, uint32_t checkit = B_TRUE; break; } else { - zfs_acl_free(aclp); mutex_exit(&zp->z_acl_lock); return (EIO); } } if (checkit) { - uint32_t mask_matched = (access_mask & *working_mode); - - if (mask_matched) { - if (type == DENY) - deny_mask |= mask_matched; - - *working_mode &= ~mask_matched; + if (type == DENY) { + DTRACE_PROBE3(zfs__ace__denies, + znode_t *, zp, + zfs_ace_hdr_t *, acep, + uint32_t, mask_matched); + deny_mask |= mask_matched; + } else { + DTRACE_PROBE3(zfs__ace__allows, + znode_t *, zp, + zfs_ace_hdr_t *, acep, + uint32_t, mask_matched); + if (anyaccess) { + mutex_exit(&zp->z_acl_lock); + return (0); + } } + *working_mode &= ~mask_matched; } /* Are we done? */ @@ -2329,7 +2387,6 @@ zfs_zaccess_common(znode_t *zp, uint32_t } mutex_exit(&zp->z_acl_lock); - zfs_acl_free(aclp); /* Put the found 'denies' back on the working mode */ if (deny_mask) { @@ -2342,6 +2399,68 @@ zfs_zaccess_common(znode_t *zp, uint32_t return (0); } +/* + * Return true if any access whatsoever granted, we don't actually + * care what access is granted. + */ +boolean_t +zfs_has_access(znode_t *zp, cred_t *cr) +{ + uint32_t have = ACE_ALL_PERMS; + + if (zfs_zaccess_aces_check(zp, &have, B_TRUE, cr) != 0) { + uid_t owner; + + owner = zfs_fuid_map_id(zp->z_zfsvfs, + zp->z_phys->zp_uid, cr, ZFS_OWNER); + + return ( + secpolicy_vnode_access(cr, ZTOV(zp), owner, VREAD) == 0 || + secpolicy_vnode_access(cr, ZTOV(zp), owner, VWRITE) == 0 || + secpolicy_vnode_access(cr, ZTOV(zp), owner, VEXEC) == 0 || + secpolicy_vnode_chown(ZTOV(zp), cr, owner) == 0 || + secpolicy_vnode_setdac(ZTOV(zp), cr, owner) == 0 || + secpolicy_vnode_remove(ZTOV(zp), cr) == 0); + } + return (B_TRUE); +} + +static int +zfs_zaccess_common(znode_t *zp, uint32_t v4_mode, uint32_t *working_mode, + boolean_t *check_privs, boolean_t skipaclchk, cred_t *cr) +{ + zfsvfs_t *zfsvfs = zp->z_zfsvfs; + int err; + + *working_mode = v4_mode; + *check_privs = B_TRUE; + + /* + * Short circuit empty requests + */ + if (v4_mode == 0 || zfsvfs->z_replay) { + *working_mode = 0; + return (0); + } + + if ((err = zfs_zaccess_dataset_check(zp, v4_mode)) != 0) { + *check_privs = B_FALSE; + return (err); + } + + /* + * The caller requested that the ACL check be skipped. This + * would only happen if the caller checked VOP_ACCESS() with a + * 32 bit ACE mask and already had the appropriate permissions. + */ + if (skipaclchk) { + *working_mode = 0; + return (0); + } + + return (zfs_zaccess_aces_check(zp, working_mode, B_FALSE, cr)); +} + static int zfs_zaccess_append(znode_t *zp, uint32_t *working_mode, boolean_t *check_privs, cred_t *cr) @@ -2353,6 +2472,78 @@ zfs_zaccess_append(znode_t *zp, uint32_t check_privs, B_FALSE, cr)); } +int +zfs_fastaccesschk_execute(znode_t *zdp, cred_t *cr) +{ + boolean_t owner = B_FALSE; + boolean_t groupmbr = B_FALSE; + boolean_t is_attr; + uid_t fowner; + uid_t gowner; + uid_t uid = crgetuid(cr); + int error; + + if (zdp->z_phys->zp_flags & ZFS_AV_QUARANTINED) + return (EACCES); + + is_attr = ((zdp->z_phys->zp_flags & ZFS_XATTR) && + (ZTOV(zdp)->v_type == VDIR)); + if (is_attr) + goto slow; + + mutex_enter(&zdp->z_acl_lock); + + if (zdp->z_phys->zp_flags & ZFS_NO_EXECS_DENIED) { + mutex_exit(&zdp->z_acl_lock); + return (0); + } + + if (FUID_INDEX(zdp->z_phys->zp_uid) != 0 || + FUID_INDEX(zdp->z_phys->zp_gid) != 0) { + mutex_exit(&zdp->z_acl_lock); + goto slow; + } + + fowner = (uid_t)zdp->z_phys->zp_uid; + gowner = (uid_t)zdp->z_phys->zp_gid; + + if (uid == fowner) { + owner = B_TRUE; + if (zdp->z_phys->zp_mode & S_IXUSR) { + mutex_exit(&zdp->z_acl_lock); + return (0); + } else { + mutex_exit(&zdp->z_acl_lock); + goto slow; + } + } + if (groupmember(gowner, cr)) { + groupmbr = B_TRUE; + if (zdp->z_phys->zp_mode & S_IXGRP) { + mutex_exit(&zdp->z_acl_lock); + return (0); + } else { + mutex_exit(&zdp->z_acl_lock); + goto slow; + } + } + if (!owner && !groupmbr) { + if (zdp->z_phys->zp_mode & S_IXOTH) { + mutex_exit(&zdp->z_acl_lock); + return (0); + } + } + + mutex_exit(&zdp->z_acl_lock); + +slow: + DTRACE_PROBE(zfs__fastpath__execute__access__miss); + ZFS_ENTER(zdp->z_zfsvfs); + error = zfs_zaccess(zdp, ACE_EXECUTE, 0, B_FALSE, cr); + ZFS_EXIT(zdp->z_zfsvfs); + return (error); +} + /* * Determine whether Access should be granted/denied, invoking least * priv subsytem when a deny is determined. @@ -2457,7 +2648,7 @@ zfs_zaccess(znode_t *zp, int mode, int f owner, checkmode); if (error == 0 && (working_mode & ACE_WRITE_OWNER)) - error = secpolicy_vnode_chown(ZTOV(check_zp), cr, B_TRUE); + error = secpolicy_vnode_chown(ZTOV(check_zp), cr, owner); if (error == 0 && (working_mode & ACE_WRITE_ACL)) error = secpolicy_vnode_setdac(ZTOV(check_zp), cr, owner); @@ -2466,7 +2657,7 @@ zfs_zaccess(znode_t *zp, int mode, int f error = secpolicy_vnode_remove(ZTOV(check_zp), cr); if (error == 0 && (working_mode & ACE_SYNCHRONIZE)) { - error = secpolicy_vnode_chown(ZTOV(check_zp), cr, B_FALSE); + error = secpolicy_vnode_chown(ZTOV(check_zp), cr, owner); } if (error == 0) { /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Aug 28 08:59:55 2010 (r211931) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Aug 28 09:24:11 2010 (r211932) @@ -994,6 +994,7 @@ zfs_set_fuid_feature(zfsvfs_t *zfsvfs) vfs_set_feature(zfsvfs->z_vfs, VFSFT_SYSATTR_VIEWS); vfs_set_feature(zfsvfs->z_vfs, VFSFT_ACEMASKONACCESS); vfs_set_feature(zfsvfs->z_vfs, VFSFT_ACLONCREATE); + vfs_set_feature(zfsvfs->z_vfs, VFSFT_ACCESS_FILTER); } } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Aug 28 08:59:55 2010 (r211931) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Aug 28 09:24:11 2010 (r211932) @@ -1164,6 +1164,27 @@ zfs_access(vnode_t *vp, int mode, int fl } /* + * If vnode is for a device return a specfs vnode instead. + */ +static int +specvp_check(vnode_t **vpp, cred_t *cr) +{ + int error = 0; + + if (IS_DEVVP(*vpp)) { + struct vnode *svp; + + svp = specvp(*vpp, (*vpp)->v_rdev, (*vpp)->v_type, cr); + VN_RELE(*vpp); + if (svp == NULL) + error = ENOSYS; + *vpp = svp; + } + return (error); +} + + +/* * Lookup an entry in a directory, or an extended attribute directory. * If it exists, return a held vnode reference for it. * @@ -1192,10 +1213,49 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode { znode_t *zdp = VTOZ(dvp); zfsvfs_t *zfsvfs = zdp->z_zfsvfs; - int error; + int error = 0; int *direntflags = NULL; void *realpnp = NULL; + /* fast path */ + if (!(flags & (LOOKUP_XATTR | FIGNORECASE))) { + + if (dvp->v_type != VDIR) { + return (ENOTDIR); + } else if (zdp->z_dbuf == NULL) { + return (EIO); + } + + if (nm[0] == 0 || (nm[0] == '.' && nm[1] == '\0')) { + error = zfs_fastaccesschk_execute(zdp, cr); + if (!error) { + *vpp = dvp; + VN_HOLD(*vpp); + return (0); + } + return (error); + } else { + vnode_t *tvp = dnlc_lookup(dvp, nm); + + if (tvp) { + error = zfs_fastaccesschk_execute(zdp, cr); + if (error) { + VN_RELE(tvp); + return (error); + } + if (tvp == DNLC_NO_VNODE) { + VN_RELE(tvp); + return (ENOENT); + } else { + *vpp = tvp; + return (specvp_check(vpp, cr)); + } + } + } + } + + DTRACE_PROBE2(zfs__fastpath__lookup__miss, vnode_t *, dvp, char *, nm); + ZFS_ENTER(zfsvfs); ZFS_VERIFY_ZP(zdp); @@ -1261,21 +1321,8 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode } error = zfs_dirlook(zdp, nm, vpp, flags, direntflags, realpnp); - if (error == 0) { - /* - * Convert device special files - */ - if (IS_DEVVP(*vpp)) { - vnode_t *svp; - - svp = specvp(*vpp, (*vpp)->v_rdev, (*vpp)->v_type, cr); - VN_RELE(*vpp); - if (svp == NULL) - error = ENOSYS; - else - *vpp = svp; - } - } + if (error == 0) + error = specvp_check(vpp, cr); /* Translate errors and add SAVENAME when needed. */ if (cnp->cn_flags & ISLASTCN) { @@ -1468,6 +1515,7 @@ top: &acl_ids)) != 0) goto out; if (zfs_acl_ids_overquota(zfsvfs, &acl_ids)) { + zfs_acl_ids_free(&acl_ids); error = EDQUOT; goto out; } @@ -1564,19 +1612,7 @@ out: VN_RELE(ZTOV(zp)); } else { *vpp = ZTOV(zp); - /* - * If vnode is for a device return a specfs vnode instead. - */ - if (IS_DEVVP(*vpp)) { - struct vnode *svp; - - svp = specvp(*vpp, (*vpp)->v_rdev, (*vpp)->v_type, cr); - VN_RELE(*vpp); - if (svp == NULL) { - error = ENOSYS; - } - *vpp = svp; - } + error = specvp_check(vpp, cr); } ZFS_EXIT(zfsvfs); @@ -1883,6 +1919,7 @@ top: return (error); } if (zfs_acl_ids_overquota(zfsvfs, &acl_ids)) { + zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); ZFS_EXIT(zfsvfs); return (EDQUOT); @@ -2274,6 +2311,21 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cre } } + if (flags & V_RDDIR_ACCFILTER) { + /* + * If we have no access at all, don't include + * this entry in the returned information + */ + znode_t *ezp; + if (zfs_zget(zp->z_zfsvfs, objnum, &ezp) != 0) + goto skip_entry; + if (!zfs_has_access(ezp, cr)) { + VN_RELE(ZTOV(ezp)); + goto skip_entry; + } + VN_RELE(ZTOV(ezp)); + } + if (flags & V_RDDIR_ENTFLAGS) reclen = EDIRENT_RECLEN(strlen(zap.za_name)); else @@ -2324,6 +2376,7 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cre if (prefetch) dmu_prefetch(os, objnum, 0, 0); + skip_entry: /* * Move to the next entry, fill in the previous offset. */ @@ -2712,6 +2765,7 @@ zfs_setattr(vnode_t *vp, vattr_t *vap, i top: attrzp = NULL; + /* Can this be moved to before the top label? */ if (zfsvfs->z_vfs->vfs_flag & VFS_RDONLY) { ZFS_EXIT(zfsvfs); return (EROFS); @@ -3036,6 +3090,8 @@ top: zp->z_phys->zp_mode = new_mode; err = zfs_aclset_common(zp, aclp, cr, tx); ASSERT3U(err, ==, 0); + zp->z_acl_cached = aclp; + aclp = NULL; mutex_exit(&zp->z_acl_lock); } @@ -3127,10 +3183,8 @@ out: if (attrzp) VN_RELE(ZTOV(attrzp)); - if (aclp) { + if (aclp) zfs_acl_free(aclp); - aclp = NULL; - } if (fuidp) { zfs_fuid_info_free(fuidp); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Aug 28 08:59:55 2010 (r211931) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Aug 28 09:24:11 2010 (r211932) @@ -177,6 +177,7 @@ zfs_znode_cache_constructor(void *buf, v zp->z_dbuf = NULL; zp->z_dirlocks = NULL; + zp->z_acl_cached = NULL; return (0); } @@ -199,6 +200,7 @@ zfs_znode_cache_destructor(void *buf, vo ASSERT(zp->z_dbuf == NULL); ASSERT(zp->z_dirlocks == NULL); + ASSERT(zp->z_acl_cached == NULL); } #ifdef ZNODE_STATS @@ -244,6 +246,15 @@ zfs_znode_move_impl(znode_t *ozp, znode_ nzp->z_phys = ozp->z_phys; nzp->z_dbuf = ozp->z_dbuf; + /* + * Since this is just an idle znode and kmem is already dealing with + * memory pressure, release any cached ACL. + */ + if (ozp->z_acl_cached) { + zfs_acl_free(ozp->z_acl_cached); + ozp->z_acl_cached = NULL; + } + /* Update back pointers. */ (void) dmu_buf_update_user(nzp->z_dbuf, ozp, nzp, &nzp->z_phys, znode_evict_error); @@ -497,6 +508,7 @@ zfs_znode_dmu_init(zfsvfs_t *zfsvfs, zno mutex_enter(&zp->z_lock); ASSERT(zp->z_dbuf == NULL); + ASSERT(zp->z_acl_cached == NULL); zp->z_dbuf = db; nzp = dmu_buf_set_user_ie(db, zp, &zp->z_phys, znode_evict_error); @@ -980,6 +992,13 @@ zfs_rezget(znode_t *zp) return (EIO); } + mutex_enter(&zp->z_acl_lock); + if (zp->z_acl_cached) { + zfs_acl_free(zp->z_acl_cached); + zp->z_acl_cached = NULL; + } + mutex_exit(&zp->z_acl_lock); + zfs_znode_dmu_init(zfsvfs, zp, db); zp->z_unlinked = (zp->z_phys->zp_links == 0); zp->z_blksz = doi.doi_data_block_size; @@ -1065,6 +1084,11 @@ zfs_znode_free(znode_t *zp) list_remove(&zfsvfs->z_all_znodes, zp); mutex_exit(&zfsvfs->z_znodes_lock); + if (zp->z_acl_cached) { + zfs_acl_free(zp->z_acl_cached); + zp->z_acl_cached = NULL; + } + kmem_cache_free(znode_cache, zp); VFS_RELE(zfsvfs->z_vfs); Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h Sat Aug 28 08:59:55 2010 (r211931) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h Sat Aug 28 09:24:11 2010 (r211932) @@ -378,6 +378,7 @@ struct taskq; * Flags for VOP_READDIR */ #define V_RDDIR_ENTFLAGS 0x01 /* request dirent flags */ +#define V_RDDIR_ACCFILTER 0x02 /* filter out inaccessible dirents */ /* * Public vnode manipulation functions. From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 10:13:34 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13DF2106566B; Sat, 28 Aug 2010 10:13:34 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id B173A8FC14; Sat, 28 Aug 2010 10:13:33 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 7784145EEF; Sat, 28 Aug 2010 12:13:32 +0200 (CEST) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id A062B45EE5; Sat, 28 Aug 2010 12:13:27 +0200 (CEST) Date: Sat, 28 Aug 2010 12:13:20 +0200 From: Pawel Jakub Dawidek To: Kostik Belousov Message-ID: <20100828101320.GI2077@garage.freebsd.pl> References: <201008272049.o7RKn63o007138@svn.freebsd.org> <20100827213827.GD2396@deviant.kiev.zoral.com.ua> <20100827215402.GB2077@garage.freebsd.pl> <20100828084355.GH2396@deviant.kiev.zoral.com.ua> <20100828085042.GE2077@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pe+tqlI1iYzVj1X/" Content-Disposition: inline In-Reply-To: <20100828085042.GE2077@garage.freebsd.pl> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r211896 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 10:13:34 -0000 --pe+tqlI1iYzVj1X/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Aug 28, 2010 at 10:50:42AM +0200, Pawel Jakub Dawidek wrote: > Ehh, I'm lame. All I need to do is to use cv_timedwait_sig() instead of > cv_timedwait() and I can remove all pthread stuff from the sighandler. =2E..not! This is userland, not the kernel so there is no equivalent of cv_timedwait_sig()... --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --pe+tqlI1iYzVj1X/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkx44T8ACgkQForvXbEpPzTYiwCg+YJ0BbIDybp4xUiFROW/QsDP DysAoIPEvRvie6qgYPCmNzyOgJvF3kJ0 =JpiZ -----END PGP SIGNATURE----- --pe+tqlI1iYzVj1X/-- From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 15:03:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5E3810656AB; Sat, 28 Aug 2010 15:03:11 +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 C33478FC08; Sat, 28 Aug 2010 15:03:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7SF3BEn034635; Sat, 28 Aug 2010 15:03:11 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7SF3B2j034626; Sat, 28 Aug 2010 15:03:11 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201008281503.o7SF3B2j034626@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 28 Aug 2010 15:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211934 - in head: . gnu/lib/libgomp lib lib/libkvm lib/libthread_db/arch/powerpc64 lib/msun secure/lib/libcrypto usr.sbin/kldxref X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 15:03:11 -0000 Author: nwhitehorn Date: Sat Aug 28 15:03:11 2010 New Revision: 211934 URL: http://svn.freebsd.org/changeset/base/211934 Log: Repair some build breakage introduced in r211725 and garbage collect some code made obsolete in the same commit. Deleted: head/lib/libthread_db/arch/powerpc64/ head/secure/lib/libcrypto/opensslconf-powerpc64.h Modified: head/Makefile.inc1 head/gnu/lib/libgomp/Makefile head/lib/Makefile head/lib/libkvm/Makefile head/lib/msun/Makefile head/secure/lib/libcrypto/Makefile head/secure/lib/libcrypto/opensslconf-powerpc.h head/usr.sbin/kldxref/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Aug 28 14:15:18 2010 (r211933) +++ head/Makefile.inc1 Sat Aug 28 15:03:11 2010 (r211934) @@ -1133,8 +1133,8 @@ _prereq_libs= gnu/lib/libssp/libssp_nons _startup_libs= gnu/lib/csu .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf) _startup_libs+= lib/csu/${MACHINE_ARCH}-elf -.elif exists(${.CURDIR}/lib/csu/${MACHINE_CPUARCH}-elf) -_startup_libs+= lib/csu/${MACHINE_CPUARCH}-elf +.elif exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}) +_startup_libs+= lib/csu/${MACHINE_ARCH} .else _startup_libs+= lib/csu/${MACHINE_CPUARCH} .endif Modified: head/gnu/lib/libgomp/Makefile ============================================================================== --- head/gnu/lib/libgomp/Makefile Sat Aug 28 14:15:18 2010 (r211933) +++ head/gnu/lib/libgomp/Makefile Sat Aug 28 15:03:11 2010 (r211934) @@ -24,7 +24,7 @@ VERSION_MAP= ${SRCDIR}/libgomp.map # Target-specific OpenMP configuration .if ${MACHINE_CPUARCH} == arm || ${MACHINE_CPUARCH} == i386 || \ - ${MACHINE_CPUARCH} == powerpc || \ + ${MACHINE_ARCH} == powerpc || \ (${MACHINE_CPUARCH} == mips && \ (!defined(TARGET_ABI) || ${TARGET_ABI} != "n64")) OMP_LOCK_ALIGN = 4 Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Sat Aug 28 14:15:18 2010 (r211933) +++ head/lib/Makefile Sat Aug 28 15:03:11 2010 (r211934) @@ -114,8 +114,8 @@ SUBDIR= ${SUBDIR_ORDERED} \ .if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf) _csu=csu/${MACHINE_ARCH}-elf -.elif exists(${.CURDIR}/csu/${MACHINE_CPUARCH}-elf) -_csu=csu/${MACHINE_CPUARCH}-elf +.elif exists(${.CURDIR}/csu/${MACHINE_ARCH}) +_csu=csu/${MACHINE_ARCH} .elif exists(${.CURDIR}/csu/${MACHINE_CPUARCH}/Makefile) _csu=csu/${MACHINE_CPUARCH} .else Modified: head/lib/libkvm/Makefile ============================================================================== --- head/lib/libkvm/Makefile Sat Aug 28 14:15:18 2010 (r211933) +++ head/lib/libkvm/Makefile Sat Aug 28 15:03:11 2010 (r211934) @@ -9,13 +9,19 @@ CFLAGS+=-DLIBC_SCCS -I${.CURDIR} CFLAGS+=-DSUN4V .endif +.if exists(${.CURDIR}/kvm_${MACHINE_ARCH}.c) +KVM_ARCH=${MACHINE_ARCH} +.else +KVM_ARCH=${MACHINE_CPUARCH} +.endif + WARNS?= 0 -SRCS= kvm.c kvm_${MACHINE_CPUARCH}.c kvm_cptime.c kvm_file.c kvm_getloadavg.c \ +SRCS= kvm.c kvm_${KVM_ARCH}.c kvm_cptime.c kvm_file.c kvm_getloadavg.c \ kvm_getswapinfo.c kvm_pcpu.c kvm_proc.c kvm_vnet.c .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ ${MACHINE_CPUARCH} == "arm" -SRCS+= kvm_minidump_${MACHINE_CPUARCH}.c +SRCS+= kvm_minidump_${KVM_ARCH}.c .endif INCS= kvm.h Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Sat Aug 28 14:15:18 2010 (r211933) +++ head/lib/msun/Makefile Sat Aug 28 15:03:11 2010 (r211934) @@ -75,8 +75,13 @@ COMMON_SRCS= b_exp.c b_log.c b_tgamma.c # Location of fpmath.h and _fpmath.h LIBCDIR= ${.CURDIR}/../libc +.if exists(${LIBCDIR}/${MACHINE_ARCH}) +LIBC_ARCH=${MACHINE_ARCH} +.else +LIBC_ARCH=${MACHINE_CPUARCH} +.endif CFLAGS+= -I${.CURDIR}/src -I${LIBCDIR}/include \ - -I${LIBCDIR}/${MACHINE_CPUARCH} + -I${LIBCDIR}/${LIBC_ARCH} SYM_MAPS+= ${.CURDIR}/Symbol.map VERSION_DEF= ${LIBCDIR}/Versions.def Modified: head/secure/lib/libcrypto/Makefile ============================================================================== --- head/secure/lib/libcrypto/Makefile Sat Aug 28 14:15:18 2010 (r211933) +++ head/secure/lib/libcrypto/Makefile Sat Aug 28 15:03:11 2010 (r211934) @@ -351,7 +351,7 @@ buildinf.h: ${.CURDIR}/Makefile ( echo "#ifndef MK1MF_BUILD"; \ echo " /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \ echo " #define CFLAGS \"$(CC)\""; \ - echo " #define PLATFORM \"FreeBSD-${MACHINE_CPUARCH}\""; \ + echo " #define PLATFORM \"FreeBSD-${MACHINE_ARCH}\""; \ echo "#endif" ) > ${.TARGET} opensslconf.h: opensslconf-${MACHINE_CPUARCH}.h Modified: head/secure/lib/libcrypto/opensslconf-powerpc.h ============================================================================== --- head/secure/lib/libcrypto/opensslconf-powerpc.h Sat Aug 28 14:15:18 2010 (r211933) +++ head/secure/lib/libcrypto/opensslconf-powerpc.h Sat Aug 28 15:03:11 2010 (r211934) @@ -110,13 +110,17 @@ /* If this is set to 'unsigned int' on a DEC Alpha, this gives about a * %20 speed up (longs are 8 bytes, int's are 4). */ #ifndef DES_LONG -#define DES_LONG unsigned long +#define DES_LONG unsigned int #endif #endif #if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) #define CONFIG_HEADER_BN_H +#ifdef __powerpc64__ +#undef BN_LLONG +#else #define BN_LLONG +#endif /* Should we define BN_DIV2W here? */ @@ -124,9 +128,14 @@ /* The prime number generation stuff may not work when * EIGHT_BIT but I don't care since I've only used this mode * for debuging the bignum libraries */ +#ifdef __powerpc64__ +#define SIXTY_FOUR_BIT_LONG +#undef THIRTY_TWO_BIT +#else #undef SIXTY_FOUR_BIT_LONG -#undef SIXTY_FOUR_BIT #define THIRTY_TWO_BIT +#endif +#undef SIXTY_FOUR_BIT #undef SIXTEEN_BIT #undef EIGHT_BIT #endif Modified: head/usr.sbin/kldxref/Makefile ============================================================================== --- head/usr.sbin/kldxref/Makefile Sat Aug 28 14:15:18 2010 (r211933) +++ head/usr.sbin/kldxref/Makefile Sat Aug 28 15:03:11 2010 (r211934) @@ -7,7 +7,7 @@ SRCS= kldxref.c ef.c ef_obj.c WARNS?= 2 CFLAGS+=-fno-strict-aliasing -.if exists(ef_${MACHINE_CPUARCH}.c) +.if exists(ef_${MACHINE_CPUARCH}.c) && ${MACHINE_ARCH} != "powerpc64" SRCS+= ef_${MACHINE_CPUARCH}.c .else SRCS+= ef_nop.c From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 15:04:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D50F106566C; Sat, 28 Aug 2010 15:04:54 +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 4C72A8FC1A; Sat, 28 Aug 2010 15:04:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7SF4sUU034710; Sat, 28 Aug 2010 15:04:54 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7SF4ssN034704; Sat, 28 Aug 2010 15:04:54 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201008281504.o7SF4ssN034704@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 28 Aug 2010 15:04:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211935 - head/usr.bin/truss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 15:04:54 -0000 Author: nwhitehorn Date: Sat Aug 28 15:04:53 2010 New Revision: 211935 URL: http://svn.freebsd.org/changeset/base/211935 Log: Fix breakage introduced in r211725 and improve functionality of truss on 64-bit powerpc by adding 32-bit compatibility features. Modified: head/usr.bin/truss/Makefile head/usr.bin/truss/extern.h head/usr.bin/truss/main.c head/usr.bin/truss/powerpc-fbsd.c head/usr.bin/truss/powerpc64-fbsd.c Modified: head/usr.bin/truss/Makefile ============================================================================== --- head/usr.bin/truss/Makefile Sat Aug 28 15:03:11 2010 (r211934) +++ head/usr.bin/truss/Makefile Sat Aug 28 15:04:53 2010 (r211935) @@ -2,7 +2,13 @@ NO_WERROR= PROG= truss -SRCS= main.c setup.c syscalls.c syscalls.h ioctl.c ${MACHINE_CPUARCH}-fbsd.c +SRCS= main.c setup.c syscalls.c syscalls.h ioctl.c + +.if exists(${.CURDIR}/${MACHINE_ARCH}-fbsd.c) +SRCS+= ${MACHINE_ARCH}-fbsd.c +.else +SRCS+= ${MACHINE_CPUARCH}-fbsd.c +.endif CFLAGS+= -I${.CURDIR} -I. CLEANFILES= syscalls.master syscalls.h ioctl.c @@ -53,4 +59,16 @@ freebsd32_syscalls.h: fbsd32-syscalls.ma ${.CURDIR}/fbsd32.conf .endif +.if ${MACHINE_ARCH} == "powerpc64" +SRCS+= powerpc-fbsd.c freebsd32_syscalls.h +CLEANFILES+=fbsd32-syscalls.master freebsd32_syscalls.h + +fbsd32-syscalls.master: ${.CURDIR}/../../sys/compat/freebsd32/syscalls.master + cat ${.ALLSRC} > ${.TARGET} + +freebsd32_syscalls.h: fbsd32-syscalls.master + /bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh ${.ALLSRC} \ + ${.CURDIR}/fbsd32.conf +.endif + .include Modified: head/usr.bin/truss/extern.h ============================================================================== --- head/usr.bin/truss/extern.h Sat Aug 28 15:03:11 2010 (r211934) +++ head/usr.bin/truss/extern.h Sat Aug 28 15:04:53 2010 (r211935) @@ -58,6 +58,8 @@ extern long ia64_syscall_exit(struct tru #ifdef __powerpc__ extern void powerpc_syscall_entry(struct trussinfo *, int); extern long powerpc_syscall_exit(struct trussinfo *, int); +extern void powerpc64_syscall_entry(struct trussinfo *, int); +extern long powerpc64_syscall_exit(struct trussinfo *, int); #endif #ifdef __sparc64__ extern void sparc64_syscall_entry(struct trussinfo *, int); Modified: head/usr.bin/truss/main.c ============================================================================== --- head/usr.bin/truss/main.c Sat Aug 28 15:03:11 2010 (r211934) +++ head/usr.bin/truss/main.c Sat Aug 28 15:04:53 2010 (r211935) @@ -97,6 +97,9 @@ struct ex_types { #ifdef __powerpc__ { "FreeBSD ELF", powerpc_syscall_entry, powerpc_syscall_exit }, { "FreeBSD ELF32", powerpc_syscall_entry, powerpc_syscall_exit }, +#ifdef __powerpc64__ + { "FreeBSD ELF64", powerpc64_syscall_entry, powerpc64_syscall_exit }, +#endif #endif #ifdef __sparc64__ { "FreeBSD ELF64", sparc64_syscall_entry, sparc64_syscall_exit }, Modified: head/usr.bin/truss/powerpc-fbsd.c ============================================================================== --- head/usr.bin/truss/powerpc-fbsd.c Sat Aug 28 15:03:11 2010 (r211934) +++ head/usr.bin/truss/powerpc-fbsd.c Sat Aug 28 15:04:53 2010 (r211935) @@ -63,7 +63,12 @@ static const char rcsid[] = static int cpid = -1; +#ifdef __powerpc64__ /* 32-bit compatibility */ +#include "freebsd32_syscalls.h" +#define syscallnames freebsd32_syscallnames +#else /* native 32-bit */ #include "syscalls.h" +#endif static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]); Modified: head/usr.bin/truss/powerpc64-fbsd.c ============================================================================== --- head/usr.bin/truss/powerpc64-fbsd.c Sat Aug 28 15:03:11 2010 (r211934) +++ head/usr.bin/truss/powerpc64-fbsd.c Sat Aug 28 15:04:53 2010 (r211935) @@ -109,7 +109,7 @@ clear_fsc(void) { */ void -powerpc_syscall_entry(struct trussinfo *trussinfo, int nargs) { +powerpc64_syscall_entry(struct trussinfo *trussinfo, int nargs) { char buf[32]; struct reg regs; void *args; @@ -254,7 +254,7 @@ powerpc_syscall_entry(struct trussinfo * */ long -powerpc_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused) +powerpc64_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused) { struct reg regs; long retval; From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 16:32:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51730106564A; Sat, 28 Aug 2010 16:32:02 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D2028FC12; Sat, 28 Aug 2010 16:32:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7SGW2FL036466; Sat, 28 Aug 2010 16:32:02 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7SGW18U036444; Sat, 28 Aug 2010 16:32:01 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201008281632.o7SGW18U036444@svn.freebsd.org> From: Bruce Cran Date: Sat, 28 Aug 2010 16:32:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211936 - in head: bin/test lib/libc/net lib/libc/stdio lib/libc/stdlib lib/libc/sys lib/libipx libexec/ypxfr sbin/ipfw secure/lib/libcrypto/man share/man/man4 share/man/man9 usr.sbin/I... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 16:32:02 -0000 Author: brucec Date: Sat Aug 28 16:32:01 2010 New Revision: 211936 URL: http://svn.freebsd.org/changeset/base/211936 Log: Fix incorrect usage of 'assure' and 'insure'. Approved by: rrs (mentor) Modified: head/bin/test/test.1 head/lib/libc/net/ethers.3 head/lib/libc/net/eui64.3 head/lib/libc/net/sctp_send.3 head/lib/libc/net/sctp_sendmsg.3 head/lib/libc/stdio/printf.3 head/lib/libc/stdlib/malloc.3 head/lib/libc/sys/semop.2 head/lib/libipx/ipx.3 head/libexec/ypxfr/ypxfr.8 head/sbin/ipfw/ipfw.8 head/secure/lib/libcrypto/man/BIO_s_bio.3 head/share/man/man4/ata.4 head/share/man/man4/bpf.4 head/share/man/man4/netgraph.4 head/share/man/man4/ng_hci.4 head/share/man/man4/re.4 head/share/man/man9/devstat.9 head/share/man/man9/ieee80211_node.9 head/usr.sbin/IPXrouted/IPXrouted.8 head/usr.sbin/ypbind/ypbind.8 Modified: head/bin/test/test.1 ============================================================================== --- head/bin/test/test.1 Sat Aug 28 15:04:53 2010 (r211935) +++ head/bin/test/test.1 Sat Aug 28 16:32:01 2010 (r211936) @@ -302,7 +302,7 @@ manual page. The .Nm grammar is inherently ambiguous. -In order to assure a degree of consistency, +In order to ensure a degree of consistency, the cases described in the .St -p1003.2 , section D11.2/4.62.4, standard Modified: head/lib/libc/net/ethers.3 ============================================================================== --- head/lib/libc/net/ethers.3 Sat Aug 28 15:04:53 2010 (r211935) +++ head/lib/libc/net/ethers.3 Sat Aug 28 16:32:01 2010 (r211936) @@ -189,7 +189,7 @@ unable to find a match in the .Pa /etc/ethers database. .Sh NOTES -The user must insure that the hostname strings passed to the +The user must ensure that the hostname strings passed to the .Fn ether_line , .Fn ether_ntohost and Modified: head/lib/libc/net/eui64.3 ============================================================================== --- head/lib/libc/net/eui64.3 Sat Aug 28 15:04:53 2010 (r211935) +++ head/lib/libc/net/eui64.3 Sat Aug 28 16:32:01 2010 (r211936) @@ -189,7 +189,7 @@ unable to find a match in the .Pa /etc/eui64 database. .Sh NOTES -The user must insure that the hostname strings passed to the +The user must ensure that the hostname strings passed to the .\" .Fn eui64_line , .Fn eui64_ntohost and Modified: head/lib/libc/net/sctp_send.3 ============================================================================== --- head/lib/libc/net/sctp_send.3 Sat Aug 28 15:04:53 2010 (r211935) +++ head/lib/libc/net/sctp_send.3 Sat Aug 28 16:32:01 2010 (r211936) @@ -191,7 +191,7 @@ If that many milliseconds elapse and the peer has not acknowledged the data, the data will be skipped and no longer transmitted. Note that this policy does -not even assure that the data will ever be sent. +not even ensure that the data will ever be sent. In times of a congestion with large amounts of data being queued, the .Fa sinfo->sinfo_timetolive @@ -218,7 +218,7 @@ policy transforms the .Fa sinfo->sinfo_timetolive into a number of retransmissions to allow. This policy -always assures that at a minimum one send attempt is +always ensures that at a minimum one send attempt is made of the data. After which no more than .Fa sinfo->sinfo_timetolive Modified: head/lib/libc/net/sctp_sendmsg.3 ============================================================================== --- head/lib/libc/net/sctp_sendmsg.3 Sat Aug 28 15:04:53 2010 (r211935) +++ head/lib/libc/net/sctp_sendmsg.3 Sat Aug 28 16:32:01 2010 (r211936) @@ -203,7 +203,7 @@ If that many milliseconds elapse and the peer has not acknowledged the data, the data will be skipped and no longer transmitted. Note that this policy does -not even assure that the data will ever be sent. +not even ensure that the data will ever be sent. In times of a congestion with large amounts of data being queued, the .Fa timetolive @@ -230,7 +230,7 @@ policy transforms the .Fa timetolive into a number of retransmissions to allow. This policy -always assures that at a minimum one send attempt is +always ensures that at a minimum one send attempt is made of the data. After which no more than .Fa timetolive Modified: head/lib/libc/stdio/printf.3 ============================================================================== --- head/lib/libc/stdio/printf.3 Sat Aug 28 15:04:53 2010 (r211935) +++ head/lib/libc/stdio/printf.3 Sat Aug 28 16:32:01 2010 (r211936) @@ -849,7 +849,7 @@ and .Fn vsprintf assume an infinitely long string, callers must be careful not to overflow the actual space; -this is often hard to assure. +this is often hard to ensure. For safety, programmers should use the .Fn snprintf interface instead. Modified: head/lib/libc/stdlib/malloc.3 ============================================================================== --- head/lib/libc/stdlib/malloc.3 Sat Aug 28 15:04:53 2010 (r211935) +++ head/lib/libc/stdlib/malloc.3 Sat Aug 28 16:32:01 2010 (r211936) @@ -266,7 +266,7 @@ options are enabled, the allocator prefe but allocation only fails if memory cannot be acquired via either method. If neither option is enabled, then the .Dq M -option is implicitly enabled in order to assure that there is a method for +option is implicitly enabled in order to ensure that there is a method for acquiring memory. .It N Double/halve the number of arenas. @@ -437,7 +437,7 @@ rounded up to the nearest multiple of th .Pp Allocations are packed tightly together, which can be an issue for multi-threaded applications. -If you need to assure that allocations do not suffer from cacheline sharing, +If you need to ensure that allocations do not suffer from cacheline sharing, round your allocation requests up to the nearest multiple of the cacheline size. .Sh DEBUGGING MALLOC PROBLEMS Modified: head/lib/libc/sys/semop.2 ============================================================================== --- head/lib/libc/sys/semop.2 Sat Aug 28 15:04:53 2010 (r211935) +++ head/lib/libc/sys/semop.2 Sat Aug 28 16:32:01 2010 (r211936) @@ -222,7 +222,7 @@ When a process exits, either voluntarily or involuntarily, the adjust on exit value for each semaphore is added to the semaphore's value. This can -be used to insure that a resource is released if a process terminates +be used to ensure that a resource is released if a process terminates unexpectedly. .Sh RETURN VALUES .Rv -std semop Modified: head/lib/libipx/ipx.3 ============================================================================== --- head/lib/libipx/ipx.3 Sat Aug 28 15:04:53 2010 (r211935) +++ head/lib/libipx/ipx.3 Sat Aug 28 16:32:01 2010 (r211936) @@ -70,7 +70,7 @@ trailing .Ql H appended. .Pp -An effort has been made to insure that +An effort has been made to ensure that .Fn ipx_addr be compatible with most formats in common use. It will first separate an address into 1 to 3 fields using a single delimiter Modified: head/libexec/ypxfr/ypxfr.8 ============================================================================== --- head/libexec/ypxfr/ypxfr.8 Sat Aug 28 15:04:53 2010 (r211935) +++ head/libexec/ypxfr/ypxfr.8 Sat Aug 28 16:32:01 2010 (r211936) @@ -234,7 +234,7 @@ Specify the name of the host from which .Tn NIS maps. This option -is used to insure that +is used to ensure that .Nm only copies maps from the .Tn NIS Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Sat Aug 28 15:04:53 2010 (r211935) +++ head/sbin/ipfw/ipfw.8 Sat Aug 28 16:32:01 2010 (r211936) @@ -2303,7 +2303,7 @@ Information necessary to route link-loca interface is not available after processing by .Nm dummynet so those packets are dropped in the output path. -Care should be taken to insure that link-local packets are not passed to +Care should be taken to ensure that link-local packets are not passed to .Nm dummynet . .Sh CHECKLIST Here are some important points to consider when designing your Modified: head/secure/lib/libcrypto/man/BIO_s_bio.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_s_bio.3 Sat Aug 28 15:04:53 2010 (r211935) +++ head/secure/lib/libcrypto/man/BIO_s_bio.3 Sat Aug 28 16:32:01 2010 (r211936) @@ -317,7 +317,7 @@ find out, how many bytes must be written .IX Header "WARNING" As the data is buffered, \fISSL_operation()\fR may return with a \s-1ERROR_SSL_WANT_READ\s0 condition, but there is still data in the write buffer. An application must -not rely on the error value of \fISSL_operation()\fR but must assure that the +not rely on the error value of \fISSL_operation()\fR but must ensure that the write buffer is always flushed first. Otherwise a deadlock may occur as the peer might be waiting for the data before being able to continue. .SH "SEE ALSO" Modified: head/share/man/man4/ata.4 ============================================================================== --- head/share/man/man4/ata.4 Sat Aug 28 15:04:53 2010 (r211935) +++ head/share/man/man4/ata.4 Sat Aug 28 16:32:01 2010 (r211936) @@ -243,7 +243,7 @@ based systems Please remember that in order to use UDMA4/ATA66 and above modes you .Em must use 80 conductor cables. -Please assure that ribbon cables are no longer than 45cm. +Please ensure that ribbon cables are no longer than 45cm. In case of rounded ATA cables, the length depends on the quality of the cables. SATA cables can be up to 1m long according to the specification. Modified: head/share/man/man4/bpf.4 ============================================================================== --- head/share/man/man4/bpf.4 Sat Aug 28 15:04:53 2010 (r211935) +++ head/share/man/man4/bpf.4 Sat Aug 28 16:32:01 2010 (r211936) @@ -683,7 +683,7 @@ padding between the header and the link The purpose here is to guarantee proper alignment of the packet data structures, which is required on alignment sensitive architectures and improves performance on many other architectures. -The packet filter insures that the +The packet filter ensures that the .Vt bpf_xhdr , .Vt bpf_hdr and the network layer Modified: head/share/man/man4/netgraph.4 ============================================================================== --- head/share/man/man4/netgraph.4 Sat Aug 28 15:04:53 2010 (r211935) +++ head/share/man/man4/netgraph.4 Sat Aug 28 16:32:01 2010 (r211936) @@ -892,7 +892,7 @@ by returning Each type should have an include file that defines the commands, argument format, and cookie for its own messages. The typecookie -insures that the same header file was included by both sender and +ensures that the same header file was included by both sender and receiver; when an incompatible change in the header file is made, the typecookie .Em must Modified: head/share/man/man4/ng_hci.4 ============================================================================== --- head/share/man/man4/ng_hci.4 Sat Aug 28 15:04:53 2010 (r211935) +++ head/share/man/man4/ng_hci.4 Sat Aug 28 16:32:01 2010 (r211936) @@ -108,7 +108,7 @@ piconet. Both asynchronous and isochronous services are supported. Between a master and a slave only a single ACL link can exist. For most ACL packets, -packet retransmission is applied to assure data integrity. +packet retransmission is applied to ensure data integrity. .Sh HOST CONTROLLER INTERFACE (HCI) The HCI provides a command interface to the baseband controller and link manager, and access to hardware status and control registers. Modified: head/share/man/man4/re.4 ============================================================================== --- head/share/man/man4/re.4 Sat Aug 28 15:04:53 2010 (r211935) +++ head/share/man/man4/re.4 Sat Aug 28 16:32:01 2010 (r211936) @@ -248,7 +248,7 @@ be echoed back unmodified. If the echoed data is corrupt, the driver will print an error message on the console and abort the device attach. The -user should insure the NIC is installed in a 32-bit PCI slot to +user should ensure the NIC is installed in a 32-bit PCI slot to avoid this problem. .Pp The RealTek 8169, 8169S and 8110S chips appear to only be capable of Modified: head/share/man/man9/devstat.9 ============================================================================== --- head/share/man/man9/devstat.9 Sat Aug 28 15:04:53 2010 (r211935) +++ head/share/man/man9/devstat.9 Sat Aug 28 16:32:01 2010 (r211936) @@ -437,7 +437,7 @@ There may be a need for .Fn spl protection around some of the .Nm -list manipulation code to insure, for example, that the list of devices +list manipulation code to ensure, for example, that the list of devices is not changed while someone is fetching the .Va kern.devstat.all .Nm sysctl Modified: head/share/man/man9/ieee80211_node.9 ============================================================================== --- head/share/man/man9/ieee80211_node.9 Sat Aug 28 15:04:53 2010 (r211935) +++ head/share/man/man9/ieee80211_node.9 Sat Aug 28 16:32:01 2010 (r211936) @@ -101,7 +101,7 @@ Node table entries are reference counted That is, there is a count of all long term references that determines when an entry may be reclaimed. References are held by every in-flight frame sent to a station to -insure the entry is not reclaimed while the frame is queued or otherwise +ensure the entry is not reclaimed while the frame is queued or otherwise held by a driver. Routines that lookup a table entry return a .Dq held reference Modified: head/usr.sbin/IPXrouted/IPXrouted.8 ============================================================================== --- head/usr.sbin/IPXrouted/IPXrouted.8 Sat Aug 28 15:04:53 2010 (r211935) +++ head/usr.sbin/IPXrouted/IPXrouted.8 Sat Aug 28 16:32:01 2010 (r211936) @@ -198,7 +198,7 @@ also periodically checks the routing tab If an entry has not been updated for 3 minutes, the entry's metric is set to infinity and marked for deletion. Deletions are delayed -an additional 60 seconds to insure the invalidation is propagated +an additional 60 seconds to ensure the invalidation is propagated to other routers. .Pp Hosts acting as internetwork routers gratuitously supply their Modified: head/usr.sbin/ypbind/ypbind.8 ============================================================================== --- head/usr.sbin/ypbind/ypbind.8 Sat Aug 28 15:04:53 2010 (r211935) +++ head/usr.sbin/ypbind/ypbind.8 Sat Aug 28 16:32:01 2010 (r211936) @@ -123,7 +123,7 @@ domain and group of NIS servers. Up to ten servers can be specified. There must not be any spaces between the commas in the domain/server specification. -This option is used to insure that the system binds +This option is used to ensure that the system binds only to one domain and only to one of the specified servers, which is useful for systems that are both NIS servers and NIS clients: it provides a way to restrict what machines the system can From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 16:57:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA1361065697; Sat, 28 Aug 2010 16:57:07 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F14C8FC0C; Sat, 28 Aug 2010 16:57:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7SGv7eC037499; Sat, 28 Aug 2010 16:57:07 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7SGv7YD037494; Sat, 28 Aug 2010 16:57:07 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201008281657.o7SGv7YD037494@svn.freebsd.org> From: Alan Cox Date: Sat, 28 Aug 2010 16:57:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211937 - in head: lib/libc/sys sys/sys sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 16:57:07 -0000 Author: alc Date: Sat Aug 28 16:57:07 2010 New Revision: 211937 URL: http://svn.freebsd.org/changeset/base/211937 Log: Add the MAP_PREFAULT_READ option to mmap(2). Reviewed by: jhb, kib Modified: head/lib/libc/sys/mmap.2 head/sys/sys/mman.h head/sys/sys/param.h head/sys/vm/vm_mmap.c Modified: head/lib/libc/sys/mmap.2 ============================================================================== --- head/lib/libc/sys/mmap.2 Sat Aug 28 16:32:01 2010 (r211936) +++ head/lib/libc/sys/mmap.2 Sat Aug 28 16:57:07 2010 (r211937) @@ -28,7 +28,7 @@ .\" @(#)mmap.2 8.4 (Berkeley) 5/11/95 .\" $FreeBSD$ .\" -.Dd November 6, 2009 +.Dd August 28, 2010 .Dt MMAP 2 .Os .Sh NAME @@ -211,6 +211,19 @@ implements a coherent file system buffer However, it may be used to associate dirty VM pages with file system buffers and thus cause them to be flushed to physical media sooner rather than later. +.It Dv MAP_PREFAULT_READ +Immediately update the calling process's lowest-level virtual address +translation structures, such as its page table, so that every memory +resident page within the region is mapped for read access. +Ordinarily these structures are updated lazily. +The effect of this option is to eliminate any soft faults that would +otherwise occur on the initial read accesses to the region. +Although this option does not preclude +.Fa prot +from including +.Dv PROT_WRITE , +it does not eliminate soft faults on the initial write accesses to the +region. .It Dv MAP_PRIVATE Modifications are private. .It Dv MAP_SHARED Modified: head/sys/sys/mman.h ============================================================================== --- head/sys/sys/mman.h Sat Aug 28 16:32:01 2010 (r211936) +++ head/sys/sys/mman.h Sat Aug 28 16:57:07 2010 (r211937) @@ -90,6 +90,7 @@ * Extended flags */ #define MAP_NOCORE 0x00020000 /* dont include these pages in a coredump */ +#define MAP_PREFAULT_READ 0x00040000 /* prefault mapping for reading */ #endif /* __BSD_VISIBLE */ #if __POSIX_VISIBLE >= 199309 Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Aug 28 16:32:01 2010 (r211936) +++ head/sys/sys/param.h Sat Aug 28 16:57:07 2010 (r211937) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900018 /* Master, propagated to newvers */ +#define __FreeBSD_version 900019 /* Master, propagated to newvers */ #ifndef LOCORE #include Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Sat Aug 28 16:32:01 2010 (r211936) +++ head/sys/vm/vm_mmap.c Sat Aug 28 16:57:07 2010 (r211937) @@ -1467,9 +1467,10 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, */ if (handle == 0) foff = 0; - } else { + } else if (flags & MAP_PREFAULT_READ) + docow = MAP_PREFAULT; + else docow = MAP_PREFAULT_PARTIAL; - } if ((flags & (MAP_ANON|MAP_SHARED)) == 0) docow |= MAP_COPY_ON_WRITE; From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 17:06:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D03C41065693; Sat, 28 Aug 2010 17:06:22 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE0EB8FC1E; Sat, 28 Aug 2010 17:06:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7SH6Mds037744; Sat, 28 Aug 2010 17:06:22 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7SH6M8d037732; Sat, 28 Aug 2010 17:06:22 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201008281706.o7SH6M8d037732@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 28 Aug 2010 17:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211938 - stable/8/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 17:06:22 -0000 Author: ume Date: Sat Aug 28 17:06:22 2010 New Revision: 211938 URL: http://svn.freebsd.org/changeset/base/211938 Log: MFC r211276: - When there is no room for returning the result, nss backend have to return ERANGE and terminate with NS_RETURN. - When gethostbyname_r(3) and the friends end with an error, set errno to the value nss backend returns, and return errno value. PR: kern/131623 Modified: stable/8/lib/libc/net/gethostbydns.c stable/8/lib/libc/net/gethostbyht.c stable/8/lib/libc/net/gethostbynis.c stable/8/lib/libc/net/gethostnamadr.c stable/8/lib/libc/net/getnetbydns.c stable/8/lib/libc/net/getnetbyht.c stable/8/lib/libc/net/getnetbynis.c stable/8/lib/libc/net/getnetnamadr.c stable/8/lib/libc/net/getproto.c stable/8/lib/libc/net/getprotoent.c stable/8/lib/libc/net/getprotoname.c Modified: stable/8/lib/libc/net/gethostbydns.c ============================================================================== --- stable/8/lib/libc/net/gethostbydns.c Sat Aug 28 16:57:07 2010 (r211937) +++ stable/8/lib/libc/net/gethostbydns.c Sat Aug 28 17:06:22 2010 (r211938) @@ -536,9 +536,12 @@ _dns_gethostbyname(void *rval, void *cb_ return (NS_NOTFOUND); } if (__copy_hostent(&he, hptr, buffer, buflen) != 0) { + *errnop = errno; + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + return (NS_RETURN); } + RES_SET_H_ERRNO(statp, NETDB_SUCCESS); *((struct hostent **)rval) = hptr; return (NS_SUCCESS); } @@ -683,11 +686,13 @@ _dns_gethostbyaddr(void *rval, void *cb_ he.h_addrtype = AF_INET6; he.h_length = NS_IN6ADDRSZ; } - RES_SET_H_ERRNO(statp, NETDB_SUCCESS); if (__copy_hostent(&he, hptr, buffer, buflen) != 0) { + *errnop = errno; + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + return (NS_RETURN); } + RES_SET_H_ERRNO(statp, NETDB_SUCCESS); *((struct hostent **)rval) = hptr; return (NS_SUCCESS); } Modified: stable/8/lib/libc/net/gethostbyht.c ============================================================================== --- stable/8/lib/libc/net/gethostbyht.c Sat Aug 28 16:57:07 2010 (r211937) +++ stable/8/lib/libc/net/gethostbyht.c Sat Aug 28 17:06:22 2010 (r211938) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -192,8 +193,11 @@ gethostent_r(struct hostent *hptr, char } if (gethostent_p(&he, hed, statp->options & RES_USE_INET6, statp) != 0) return (-1); - if (__copy_hostent(&he, hptr, buffer, buflen) != 0) - return (-1); + if (__copy_hostent(&he, hptr, buffer, buflen) != 0) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); + *h_errnop = statp->res_h_errno; + return ((errno != 0) ? errno : -1); + } *result = hptr; return (0); } @@ -268,8 +272,10 @@ found: return (NS_NOTFOUND); } if (__copy_hostent(&he, hptr, buffer, buflen) != 0) { + *errnop = errno; + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + return (NS_RETURN); } *((struct hostent **)rval) = hptr; return (NS_SUCCESS); @@ -323,8 +329,10 @@ _ht_gethostbyaddr(void *rval, void *cb_d if (error != 0) return (NS_NOTFOUND); if (__copy_hostent(&he, hptr, buffer, buflen) != 0) { + *errnop = errno; + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + return (NS_RETURN); } *((struct hostent **)rval) = hptr; return (NS_SUCCESS); Modified: stable/8/lib/libc/net/gethostbynis.c ============================================================================== --- stable/8/lib/libc/net/gethostbynis.c Sat Aug 28 16:57:07 2010 (r211937) +++ stable/8/lib/libc/net/gethostbynis.c Sat Aug 28 17:06:22 2010 (r211938) @@ -288,8 +288,10 @@ _nis_gethostbyname(void *rval, void *cb_ return (NS_NOTFOUND); } if (__copy_hostent(&he, hptr, buffer, buflen) != 0) { + *errnop = errno; + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + return (NS_RETURN); } *((struct hostent **)rval) = hptr; return (NS_SUCCESS); @@ -336,8 +338,10 @@ _nis_gethostbyaddr(void *rval, void *cb_ return (NS_NOTFOUND); } if (__copy_hostent(&he, hptr, buffer, buflen) != 0) { + *errnop = errno; + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + return (NS_RETURN); } *((struct hostent **)rval) = hptr; return (NS_SUCCESS); Modified: stable/8/lib/libc/net/gethostnamadr.c ============================================================================== --- stable/8/lib/libc/net/gethostnamadr.c Sat Aug 28 16:57:07 2010 (r211937) +++ stable/8/lib/libc/net/gethostnamadr.c Sat Aug 28 17:06:22 2010 (r211938) @@ -480,8 +480,12 @@ fakeaddr(const char *name, int af, struc hed->h_addr_ptrs[0] = (char *)hed->host_addr; hed->h_addr_ptrs[1] = NULL; he.h_addr_list = hed->h_addr_ptrs; + if (__copy_hostent(&he, hp, buf, buflen) != 0) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); + return (-1); + } RES_SET_H_ERRNO(statp, NETDB_SUCCESS); - return (__copy_hostent(&he, hp, buf, buflen)); + return (0); } int @@ -528,7 +532,7 @@ gethostbyname_internal(const char *name, size_t buflen, struct hostent **result, int *h_errnop, res_state statp) { const char *cp; - int rval, ret_errno; + int rval, ret_errno = 0; char abuf[MAXDNAME]; #ifdef NS_CACHING @@ -576,7 +580,11 @@ gethostbyname_internal(const char *name, "gethostbyname2_r", default_src, name, af, hp, buf, buflen, &ret_errno, h_errnop); - return ((rval == NS_SUCCESS) ? 0 : -1); + if (rval != NS_SUCCESS) { + errno = ret_errno; + return ((ret_errno != 0) ? ret_errno : -1); + } + return (0); } int @@ -586,7 +594,7 @@ gethostbyaddr_r(const void *addr, sockle const u_char *uaddr = (const u_char *)addr; const struct in6_addr *addr6; socklen_t size; - int rval, ret_errno; + int rval, ret_errno = 0; res_state statp; #ifdef NS_CACHING @@ -651,7 +659,11 @@ gethostbyaddr_r(const void *addr, sockle "gethostbyaddr_r", default_src, uaddr, len, af, hp, buf, buflen, &ret_errno, h_errnop); - return ((rval == NS_SUCCESS) ? 0 : -1); + if (rval != NS_SUCCESS) { + errno = ret_errno; + return ((ret_errno != 0) ? ret_errno : -1); + } + return (0); } struct hostent * Modified: stable/8/lib/libc/net/getnetbydns.c ============================================================================== --- stable/8/lib/libc/net/getnetbydns.c Sat Aug 28 16:57:07 2010 (r211937) +++ stable/8/lib/libc/net/getnetbydns.c Sat Aug 28 17:06:22 2010 (r211938) @@ -355,8 +355,10 @@ _dns_getnetbyaddr(void *rval, void *cb_d net >>= 8; ne.n_net = net; if (__copy_netent(&ne, nptr, buffer, buflen) != 0) { + *errnop = errno; + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + return (NS_RETURN); } *((struct netent **)rval) = nptr; return (NS_SUCCESS); @@ -431,8 +433,10 @@ _dns_getnetbyname(void *rval, void *cb_d return (NS_NOTFOUND); } if (__copy_netent(&ne, nptr, buffer, buflen) != 0) { + *errnop = errno; + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + return (NS_RETURN); } *((struct netent **)rval) = nptr; return (NS_SUCCESS); Modified: stable/8/lib/libc/net/getnetbyht.c ============================================================================== --- stable/8/lib/libc/net/getnetbyht.c Sat Aug 28 16:57:07 2010 (r211937) +++ stable/8/lib/libc/net/getnetbyht.c Sat Aug 28 17:06:22 2010 (r211938) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -162,8 +163,11 @@ getnetent_r(struct netent *nptr, char *b } if (getnetent_p(&ne, ned) != 0) return (-1); - if (__copy_netent(&ne, nptr, buffer, buflen) != 0) - return (-1); + if (__copy_netent(&ne, nptr, buffer, buflen) != 0) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); + *h_errnop = statp->res_h_errno; + return ((errno != 0) ? errno : -1); + } *result = nptr; return (0); } @@ -226,8 +230,10 @@ found: return (NS_NOTFOUND); } if (__copy_netent(&ne, nptr, buffer, buflen) != 0) { + *errnop = errno; + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + return (NS_RETURN); } *((struct netent **)rval) = nptr; return (NS_SUCCESS); @@ -272,8 +278,10 @@ _ht_getnetbyaddr(void *rval, void *cb_da return (NS_NOTFOUND); } if (__copy_netent(&ne, nptr, buffer, buflen) != 0) { + *errnop = errno; + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + return (NS_RETURN); } *((struct netent **)rval) = nptr; return (NS_SUCCESS); Modified: stable/8/lib/libc/net/getnetbynis.c ============================================================================== --- stable/8/lib/libc/net/getnetbynis.c Sat Aug 28 16:57:07 2010 (r211937) +++ stable/8/lib/libc/net/getnetbynis.c Sat Aug 28 17:06:22 2010 (r211938) @@ -160,8 +160,10 @@ _nis_getnetbyname(void *rval, void *cb_d return (NS_NOTFOUND); } if (__copy_netent(&ne, nptr, buffer, buflen) != 0) { + *errnop = errno; + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + return (NS_RETURN); } *((struct netent **)rval) = nptr; return (NS_SUCCESS); @@ -244,8 +246,10 @@ _nis_getnetbyaddr(void *rval, void *cb_d return (NS_NOTFOUND); } if (__copy_netent(&ne, nptr, buffer, buflen) != 0) { + *errnop = errno; + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + return (NS_RETURN); } *((struct netent **)rval) = nptr; return (NS_SUCCESS); Modified: stable/8/lib/libc/net/getnetnamadr.c ============================================================================== --- stable/8/lib/libc/net/getnetnamadr.c Sat Aug 28 16:57:07 2010 (r211937) +++ stable/8/lib/libc/net/getnetnamadr.c Sat Aug 28 17:06:22 2010 (r211938) @@ -360,13 +360,17 @@ getnetbyname_r(const char *name, struct #endif { 0 } }; - int rval, ret_errno; + int rval, ret_errno = 0; rval = _nsdispatch((void *)result, dtab, NSDB_NETWORKS, "getnetbyname_r", default_src, name, ne, buffer, buflen, &ret_errno, h_errorp); - return ((rval == NS_SUCCESS) ? 0 : -1); + if (rval != NS_SUCCESS) { + errno = ret_errno; + return ((ret_errno != 0) ? ret_errno : -1); + } + return (0); } int @@ -388,13 +392,17 @@ getnetbyaddr_r(uint32_t addr, int af, st #endif { 0 } }; - int rval, ret_errno; + int rval, ret_errno = 0; rval = _nsdispatch((void *)result, dtab, NSDB_NETWORKS, "getnetbyaddr_r", default_src, addr, af, ne, buffer, buflen, &ret_errno, h_errorp); - return ((rval == NS_SUCCESS) ? 0 : -1); + if (rval != NS_SUCCESS) { + errno = ret_errno; + return ((ret_errno != 0) ? ret_errno : -1); + } + return (0); } struct netent * Modified: stable/8/lib/libc/net/getproto.c ============================================================================== --- stable/8/lib/libc/net/getproto.c Sat Aug 28 16:57:07 2010 (r211937) +++ stable/8/lib/libc/net/getproto.c Sat Aug 28 17:06:22 2010 (r211938) @@ -33,6 +33,7 @@ static char sccsid[] = "@(#)getproto.c 8 #include __FBSDID("$FreeBSD$"); +#include #include #include #include "netdb_private.h" @@ -72,7 +73,7 @@ files_getprotobynumber(void *retval, voi errnop = va_arg(ap, int *); if ((ped = __protoent_data_init()) == NULL) { - *errnop = -1; + *errnop = errno; return (NS_NOTFOUND); } @@ -83,12 +84,12 @@ files_getprotobynumber(void *retval, voi if (!ped->stayopen) __endprotoent_p(ped); if (error != 0) { - *errnop = -1; + *errnop = errno; return (NS_NOTFOUND); } if (__copy_protoent(&pe, pptr, buffer, buflen) != 0) { - *errnop = -1; - return (NS_NOTFOUND); + *errnop = errno; + return (NS_RETURN); } *((struct protoent **)retval) = pptr; @@ -120,10 +121,11 @@ getprotobynumber_r(int proto, struct pro rv = nsdispatch(result, dtab, NSDB_PROTOCOLS, "getprotobynumber_r", defaultsrc, proto, pptr, buffer, buflen, &ret_errno); - if (rv == NS_SUCCESS) - return (0); - else - return (ret_errno); + if (rv != NS_SUCCESS) { + errno = ret_errno; + return ((ret_errno != 0) ? ret_errno : -1); + } + return (0); } struct protoent * Modified: stable/8/lib/libc/net/getprotoent.c ============================================================================== --- stable/8/lib/libc/net/getprotoent.c Sat Aug 28 16:57:07 2010 (r211937) +++ stable/8/lib/libc/net/getprotoent.c Sat Aug 28 17:06:22 2010 (r211938) @@ -424,8 +424,10 @@ files_getprotoent_r(void *retval, void * buflen = va_arg(ap, size_t); errnop = va_arg(ap, int *); - if ((ped = __protoent_data_init()) == NULL) - return (-1); + if ((ped = __protoent_data_init()) == NULL) { + *errnop = errno; + return (NS_NOTFOUND); + } if (__getprotoent_p(&pe, ped) != 0) { *errnop = errno; @@ -434,7 +436,7 @@ files_getprotoent_r(void *retval, void * if (__copy_protoent(&pe, pptr, buffer, buflen) != 0) { *errnop = errno; - return (NS_NOTFOUND); + return (NS_RETURN); } *((struct protoent **)retval) = pptr; @@ -490,10 +492,11 @@ getprotoent_r(struct protoent *pptr, cha rv = nsdispatch(result, dtab, NSDB_PROTOCOLS, "getprotoent_r", defaultsrc, pptr, buffer, buflen, &ret_errno); - if (rv == NS_SUCCESS) - return (0); - else - return (ret_errno); + if (rv != NS_SUCCESS) { + errno = ret_errno; + return ((ret_errno != 0) ? ret_errno : -1); + } + return (0); } void Modified: stable/8/lib/libc/net/getprotoname.c ============================================================================== --- stable/8/lib/libc/net/getprotoname.c Sat Aug 28 16:57:07 2010 (r211937) +++ stable/8/lib/libc/net/getprotoname.c Sat Aug 28 17:06:22 2010 (r211938) @@ -33,6 +33,7 @@ static char sccsid[] = "@(#)getprotoname #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -75,7 +76,7 @@ files_getprotobyname(void *retval, void if ((ped = __protoent_data_init()) == NULL) { - *errnop = -1; + *errnop = errno; return (NS_NOTFOUND); } @@ -91,12 +92,12 @@ found: if (!ped->stayopen) __endprotoent_p(ped); if (error != 0) { - *errnop = -1; + *errnop = errno; return (NS_NOTFOUND); } if (__copy_protoent(&pe, pptr, buffer, buflen) != 0) { - *errnop = -1; - return (NS_NOTFOUND); + *errnop = errno; + return (NS_RETURN); } *((struct protoent **)retval) = pptr; @@ -128,10 +129,11 @@ getprotobyname_r(const char *name, struc rv = nsdispatch(result, dtab, NSDB_PROTOCOLS, "getprotobyname_r", defaultsrc, name, pptr, buffer, buflen, &ret_errno); - if (rv == NS_SUCCESS) - return (0); - else - return (ret_errno); + if (rv != NS_SUCCESS) { + errno = ret_errno; + return ((ret_errno != 0) ? ret_errno : -1); + } + return (0); } struct protoent * From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 17:12:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EF1A1065670; Sat, 28 Aug 2010 17:12:53 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CC1B8FC21; Sat, 28 Aug 2010 17:12:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7SHCrXa037929; Sat, 28 Aug 2010 17:12:53 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7SHCqn2037917; Sat, 28 Aug 2010 17:12:52 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201008281712.o7SHCqn2037917@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 28 Aug 2010 17:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211939 - stable/7/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 17:12:53 -0000 Author: ume Date: Sat Aug 28 17:12:52 2010 New Revision: 211939 URL: http://svn.freebsd.org/changeset/base/211939 Log: MFC r211276: - When there is no room for returning the result, nss backend have to return ERANGE and terminate with NS_RETURN. - When gethostbyname_r(3) and the friends end with an error, set errno to the value nss backend returns, and return errno value. PR: kern/131623 Modified: stable/7/lib/libc/net/gethostbydns.c stable/7/lib/libc/net/gethostbyht.c stable/7/lib/libc/net/gethostbynis.c stable/7/lib/libc/net/gethostnamadr.c stable/7/lib/libc/net/getnetbydns.c stable/7/lib/libc/net/getnetbyht.c stable/7/lib/libc/net/getnetbynis.c stable/7/lib/libc/net/getnetnamadr.c stable/7/lib/libc/net/getproto.c stable/7/lib/libc/net/getprotoent.c stable/7/lib/libc/net/getprotoname.c Modified: stable/7/lib/libc/net/gethostbydns.c ============================================================================== --- stable/7/lib/libc/net/gethostbydns.c Sat Aug 28 17:06:22 2010 (r211938) +++ stable/7/lib/libc/net/gethostbydns.c Sat Aug 28 17:12:52 2010 (r211939) @@ -536,9 +536,12 @@ _dns_gethostbyname(void *rval, void *cb_ return (NS_NOTFOUND); } if (__copy_hostent(&he, hptr, buffer, buflen) != 0) { + *errnop = errno; + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + return (NS_RETURN); } + RES_SET_H_ERRNO(statp, NETDB_SUCCESS); *((struct hostent **)rval) = hptr; return (NS_SUCCESS); } @@ -683,11 +686,13 @@ _dns_gethostbyaddr(void *rval, void *cb_ he.h_addrtype = AF_INET6; he.h_length = NS_IN6ADDRSZ; } - RES_SET_H_ERRNO(statp, NETDB_SUCCESS); if (__copy_hostent(&he, hptr, buffer, buflen) != 0) { + *errnop = errno; + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + return (NS_RETURN); } + RES_SET_H_ERRNO(statp, NETDB_SUCCESS); *((struct hostent **)rval) = hptr; return (NS_SUCCESS); } Modified: stable/7/lib/libc/net/gethostbyht.c ============================================================================== --- stable/7/lib/libc/net/gethostbyht.c Sat Aug 28 17:06:22 2010 (r211938) +++ stable/7/lib/libc/net/gethostbyht.c Sat Aug 28 17:12:52 2010 (r211939) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -192,8 +193,11 @@ gethostent_r(struct hostent *hptr, char } if (gethostent_p(&he, hed, statp->options & RES_USE_INET6, statp) != 0) return (-1); - if (__copy_hostent(&he, hptr, buffer, buflen) != 0) - return (-1); + if (__copy_hostent(&he, hptr, buffer, buflen) != 0) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); + *h_errnop = statp->res_h_errno; + return ((errno != 0) ? errno : -1); + } *result = hptr; return (0); } @@ -268,8 +272,10 @@ found: return (NS_NOTFOUND); } if (__copy_hostent(&he, hptr, buffer, buflen) != 0) { + *errnop = errno; + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + return (NS_RETURN); } *((struct hostent **)rval) = hptr; return (NS_SUCCESS); @@ -323,8 +329,10 @@ _ht_gethostbyaddr(void *rval, void *cb_d if (error != 0) return (NS_NOTFOUND); if (__copy_hostent(&he, hptr, buffer, buflen) != 0) { + *errnop = errno; + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + return (NS_RETURN); } *((struct hostent **)rval) = hptr; return (NS_SUCCESS); Modified: stable/7/lib/libc/net/gethostbynis.c ============================================================================== --- stable/7/lib/libc/net/gethostbynis.c Sat Aug 28 17:06:22 2010 (r211938) +++ stable/7/lib/libc/net/gethostbynis.c Sat Aug 28 17:12:52 2010 (r211939) @@ -288,8 +288,10 @@ _nis_gethostbyname(void *rval, void *cb_ return (NS_NOTFOUND); } if (__copy_hostent(&he, hptr, buffer, buflen) != 0) { + *errnop = errno; + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + return (NS_RETURN); } *((struct hostent **)rval) = hptr; return (NS_SUCCESS); @@ -336,8 +338,10 @@ _nis_gethostbyaddr(void *rval, void *cb_ return (NS_NOTFOUND); } if (__copy_hostent(&he, hptr, buffer, buflen) != 0) { + *errnop = errno; + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + return (NS_RETURN); } *((struct hostent **)rval) = hptr; return (NS_SUCCESS); Modified: stable/7/lib/libc/net/gethostnamadr.c ============================================================================== --- stable/7/lib/libc/net/gethostnamadr.c Sat Aug 28 17:06:22 2010 (r211938) +++ stable/7/lib/libc/net/gethostnamadr.c Sat Aug 28 17:12:52 2010 (r211939) @@ -480,8 +480,12 @@ fakeaddr(const char *name, int af, struc hed->h_addr_ptrs[0] = (char *)hed->host_addr; hed->h_addr_ptrs[1] = NULL; he.h_addr_list = hed->h_addr_ptrs; + if (__copy_hostent(&he, hp, buf, buflen) != 0) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); + return (-1); + } RES_SET_H_ERRNO(statp, NETDB_SUCCESS); - return (__copy_hostent(&he, hp, buf, buflen)); + return (0); } int @@ -528,7 +532,7 @@ gethostbyname_internal(const char *name, size_t buflen, struct hostent **result, int *h_errnop, res_state statp) { const char *cp; - int rval, ret_errno; + int rval, ret_errno = 0; char abuf[MAXDNAME]; #ifdef NS_CACHING @@ -576,7 +580,11 @@ gethostbyname_internal(const char *name, "gethostbyname2_r", default_src, name, af, hp, buf, buflen, &ret_errno, h_errnop); - return ((rval == NS_SUCCESS) ? 0 : -1); + if (rval != NS_SUCCESS) { + errno = ret_errno; + return ((ret_errno != 0) ? ret_errno : -1); + } + return (0); } int @@ -586,7 +594,7 @@ gethostbyaddr_r(const void *addr, sockle const u_char *uaddr = (const u_char *)addr; const struct in6_addr *addr6; socklen_t size; - int rval, ret_errno; + int rval, ret_errno = 0; res_state statp; #ifdef NS_CACHING @@ -651,7 +659,11 @@ gethostbyaddr_r(const void *addr, sockle "gethostbyaddr_r", default_src, uaddr, len, af, hp, buf, buflen, &ret_errno, h_errnop); - return ((rval == NS_SUCCESS) ? 0 : -1); + if (rval != NS_SUCCESS) { + errno = ret_errno; + return ((ret_errno != 0) ? ret_errno : -1); + } + return (0); } struct hostent * Modified: stable/7/lib/libc/net/getnetbydns.c ============================================================================== --- stable/7/lib/libc/net/getnetbydns.c Sat Aug 28 17:06:22 2010 (r211938) +++ stable/7/lib/libc/net/getnetbydns.c Sat Aug 28 17:12:52 2010 (r211939) @@ -355,8 +355,10 @@ _dns_getnetbyaddr(void *rval, void *cb_d net >>= 8; ne.n_net = net; if (__copy_netent(&ne, nptr, buffer, buflen) != 0) { + *errnop = errno; + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + return (NS_RETURN); } *((struct netent **)rval) = nptr; return (NS_SUCCESS); @@ -431,8 +433,10 @@ _dns_getnetbyname(void *rval, void *cb_d return (NS_NOTFOUND); } if (__copy_netent(&ne, nptr, buffer, buflen) != 0) { + *errnop = errno; + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + return (NS_RETURN); } *((struct netent **)rval) = nptr; return (NS_SUCCESS); Modified: stable/7/lib/libc/net/getnetbyht.c ============================================================================== --- stable/7/lib/libc/net/getnetbyht.c Sat Aug 28 17:06:22 2010 (r211938) +++ stable/7/lib/libc/net/getnetbyht.c Sat Aug 28 17:12:52 2010 (r211939) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -162,8 +163,11 @@ getnetent_r(struct netent *nptr, char *b } if (getnetent_p(&ne, ned) != 0) return (-1); - if (__copy_netent(&ne, nptr, buffer, buflen) != 0) - return (-1); + if (__copy_netent(&ne, nptr, buffer, buflen) != 0) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); + *h_errnop = statp->res_h_errno; + return ((errno != 0) ? errno : -1); + } *result = nptr; return (0); } @@ -226,8 +230,10 @@ found: return (NS_NOTFOUND); } if (__copy_netent(&ne, nptr, buffer, buflen) != 0) { + *errnop = errno; + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + return (NS_RETURN); } *((struct netent **)rval) = nptr; return (NS_SUCCESS); @@ -272,8 +278,10 @@ _ht_getnetbyaddr(void *rval, void *cb_da return (NS_NOTFOUND); } if (__copy_netent(&ne, nptr, buffer, buflen) != 0) { + *errnop = errno; + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + return (NS_RETURN); } *((struct netent **)rval) = nptr; return (NS_SUCCESS); Modified: stable/7/lib/libc/net/getnetbynis.c ============================================================================== --- stable/7/lib/libc/net/getnetbynis.c Sat Aug 28 17:06:22 2010 (r211938) +++ stable/7/lib/libc/net/getnetbynis.c Sat Aug 28 17:12:52 2010 (r211939) @@ -160,8 +160,10 @@ _nis_getnetbyname(void *rval, void *cb_d return (NS_NOTFOUND); } if (__copy_netent(&ne, nptr, buffer, buflen) != 0) { + *errnop = errno; + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + return (NS_RETURN); } *((struct netent **)rval) = nptr; return (NS_SUCCESS); @@ -244,8 +246,10 @@ _nis_getnetbyaddr(void *rval, void *cb_d return (NS_NOTFOUND); } if (__copy_netent(&ne, nptr, buffer, buflen) != 0) { + *errnop = errno; + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + return (NS_RETURN); } *((struct netent **)rval) = nptr; return (NS_SUCCESS); Modified: stable/7/lib/libc/net/getnetnamadr.c ============================================================================== --- stable/7/lib/libc/net/getnetnamadr.c Sat Aug 28 17:06:22 2010 (r211938) +++ stable/7/lib/libc/net/getnetnamadr.c Sat Aug 28 17:12:52 2010 (r211939) @@ -360,13 +360,17 @@ getnetbyname_r(const char *name, struct #endif { 0 } }; - int rval, ret_errno; + int rval, ret_errno = 0; rval = _nsdispatch((void *)result, dtab, NSDB_NETWORKS, "getnetbyname_r", default_src, name, ne, buffer, buflen, &ret_errno, h_errorp); - return ((rval == NS_SUCCESS) ? 0 : -1); + if (rval != NS_SUCCESS) { + errno = ret_errno; + return ((ret_errno != 0) ? ret_errno : -1); + } + return (0); } int @@ -388,13 +392,17 @@ getnetbyaddr_r(uint32_t addr, int af, st #endif { 0 } }; - int rval, ret_errno; + int rval, ret_errno = 0; rval = _nsdispatch((void *)result, dtab, NSDB_NETWORKS, "getnetbyaddr_r", default_src, addr, af, ne, buffer, buflen, &ret_errno, h_errorp); - return ((rval == NS_SUCCESS) ? 0 : -1); + if (rval != NS_SUCCESS) { + errno = ret_errno; + return ((ret_errno != 0) ? ret_errno : -1); + } + return (0); } struct netent * Modified: stable/7/lib/libc/net/getproto.c ============================================================================== --- stable/7/lib/libc/net/getproto.c Sat Aug 28 17:06:22 2010 (r211938) +++ stable/7/lib/libc/net/getproto.c Sat Aug 28 17:12:52 2010 (r211939) @@ -33,6 +33,7 @@ static char sccsid[] = "@(#)getproto.c 8 #include __FBSDID("$FreeBSD$"); +#include #include #include #include "netdb_private.h" @@ -72,7 +73,7 @@ files_getprotobynumber(void *retval, voi errnop = va_arg(ap, int *); if ((ped = __protoent_data_init()) == NULL) { - *errnop = -1; + *errnop = errno; return (NS_NOTFOUND); } @@ -83,12 +84,12 @@ files_getprotobynumber(void *retval, voi if (!ped->stayopen) __endprotoent_p(ped); if (error != 0) { - *errnop = -1; + *errnop = errno; return (NS_NOTFOUND); } if (__copy_protoent(&pe, pptr, buffer, buflen) != 0) { - *errnop = -1; - return (NS_NOTFOUND); + *errnop = errno; + return (NS_RETURN); } *((struct protoent **)retval) = pptr; @@ -120,10 +121,11 @@ getprotobynumber_r(int proto, struct pro rv = nsdispatch(result, dtab, NSDB_PROTOCOLS, "getprotobynumber_r", defaultsrc, proto, pptr, buffer, buflen, &ret_errno); - if (rv == NS_SUCCESS) - return (0); - else - return (ret_errno); + if (rv != NS_SUCCESS) { + errno = ret_errno; + return ((ret_errno != 0) ? ret_errno : -1); + } + return (0); } struct protoent * Modified: stable/7/lib/libc/net/getprotoent.c ============================================================================== --- stable/7/lib/libc/net/getprotoent.c Sat Aug 28 17:06:22 2010 (r211938) +++ stable/7/lib/libc/net/getprotoent.c Sat Aug 28 17:12:52 2010 (r211939) @@ -424,8 +424,10 @@ files_getprotoent_r(void *retval, void * buflen = va_arg(ap, size_t); errnop = va_arg(ap, int *); - if ((ped = __protoent_data_init()) == NULL) - return (-1); + if ((ped = __protoent_data_init()) == NULL) { + *errnop = errno; + return (NS_NOTFOUND); + } if (__getprotoent_p(&pe, ped) != 0) { *errnop = errno; @@ -434,7 +436,7 @@ files_getprotoent_r(void *retval, void * if (__copy_protoent(&pe, pptr, buffer, buflen) != 0) { *errnop = errno; - return (NS_NOTFOUND); + return (NS_RETURN); } *((struct protoent **)retval) = pptr; @@ -490,10 +492,11 @@ getprotoent_r(struct protoent *pptr, cha rv = nsdispatch(result, dtab, NSDB_PROTOCOLS, "getprotoent_r", defaultsrc, pptr, buffer, buflen, &ret_errno); - if (rv == NS_SUCCESS) - return (0); - else - return (ret_errno); + if (rv != NS_SUCCESS) { + errno = ret_errno; + return ((ret_errno != 0) ? ret_errno : -1); + } + return (0); } void Modified: stable/7/lib/libc/net/getprotoname.c ============================================================================== --- stable/7/lib/libc/net/getprotoname.c Sat Aug 28 17:06:22 2010 (r211938) +++ stable/7/lib/libc/net/getprotoname.c Sat Aug 28 17:12:52 2010 (r211939) @@ -33,6 +33,7 @@ static char sccsid[] = "@(#)getprotoname #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -75,7 +76,7 @@ files_getprotobyname(void *retval, void if ((ped = __protoent_data_init()) == NULL) { - *errnop = -1; + *errnop = errno; return (NS_NOTFOUND); } @@ -91,12 +92,12 @@ found: if (!ped->stayopen) __endprotoent_p(ped); if (error != 0) { - *errnop = -1; + *errnop = errno; return (NS_NOTFOUND); } if (__copy_protoent(&pe, pptr, buffer, buflen) != 0) { - *errnop = -1; - return (NS_NOTFOUND); + *errnop = errno; + return (NS_RETURN); } *((struct protoent **)retval) = pptr; @@ -128,10 +129,11 @@ getprotobyname_r(const char *name, struc rv = nsdispatch(result, dtab, NSDB_PROTOCOLS, "getprotobyname_r", defaultsrc, name, pptr, buffer, buflen, &ret_errno); - if (rv == NS_SUCCESS) - return (0); - else - return (ret_errno); + if (rv != NS_SUCCESS) { + errno = ret_errno; + return ((ret_errno != 0) ? ret_errno : -1); + } + return (0); } struct protoent * From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 17:28:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98DBE10656A8; Sat, 28 Aug 2010 17:28:00 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 2EFDD8FC0A; Sat, 28 Aug 2010 17:27:59 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 63C3445EB2; Sat, 28 Aug 2010 19:27:57 +0200 (CEST) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 3A7F145C99; Sat, 28 Aug 2010 19:27:52 +0200 (CEST) Date: Sat, 28 Aug 2010 19:27:44 +0200 From: Pawel Jakub Dawidek To: Rui Paulo Message-ID: <20100828172744.GJ2077@garage.freebsd.pl> References: <201008211141.o7LBfWdv067923@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k1BdFSKqAqVdu8k/" Content-Disposition: inline In-Reply-To: <201008211141.o7LBfWdv067923@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211553 - head/sys/cddl/compat/opensolaris/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 17:28:00 -0000 --k1BdFSKqAqVdu8k/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Aug 21, 2010 at 11:41:32AM +0000, Rui Paulo wrote: > Author: rpaulo > Date: Sat Aug 21 11:41:32 2010 > New Revision: 211553 > URL: http://svn.freebsd.org/changeset/base/211553 >=20 > Log: > Add sysname to struct opensolaris_utsname. This is needed by one DTrace > test. > =20 > Sponsored by: The FreeBSD Foundation >=20 > Modified: > head/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c >=20 > Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c Sat Aug 21 1= 1:33:49 2010 (r211552) > +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c Sat Aug 21 1= 1:41:32 2010 (r211553) > @@ -38,7 +38,8 @@ __FBSDID("$FreeBSD$"); > char hw_serial[11] =3D "0"; > =20 > struct opensolaris_utsname utsname =3D { > - .nodename =3D "unset" > + .nodename =3D "unset", > + .sysname =3D "SunOS" This collides with the changes I have in perforce. Could you take a look at: //depot/user/pjd/zfs/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c //depot/user/pjd/zfs/sys/cddl/compat/opensolaris/sys/misc.h I'd prefer sysname to say FreeBSD on FreeBSD, rather than SunOS. I see it is being used in one DTrace test. Changing 'tst.str.d.out' to expect "FreeBSD" instead of "SunOS" is ok? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --k1BdFSKqAqVdu8k/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkx5Rw8ACgkQForvXbEpPzQYdACeOAyXMTQ1ZBkLlacuyC7tJMw5 h3IAoNLl/v2YI/FFxGbemxssRdODiltB =pXCv -----END PGP SIGNATURE----- --k1BdFSKqAqVdu8k/-- From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 17:38:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8436E1065675; Sat, 28 Aug 2010 17:38:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72BE68FC0A; Sat, 28 Aug 2010 17:38:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7SHce7f038499; Sat, 28 Aug 2010 17:38:40 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7SHce37038497; Sat, 28 Aug 2010 17:38:40 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008281738.o7SHce37038497@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 28 Aug 2010 17:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211940 - head/tools/regression/poll X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 17:38:40 -0000 Author: kib Date: Sat Aug 28 17:38:40 2010 New Revision: 211940 URL: http://svn.freebsd.org/changeset/base/211940 Log: Test the poll(2) return value. MFC after: 2 weeks Modified: head/tools/regression/poll/pipepoll.c Modified: head/tools/regression/poll/pipepoll.c ============================================================================== --- head/tools/regression/poll/pipepoll.c Sat Aug 28 17:12:52 2010 (r211939) +++ head/tools/regression/poll/pipepoll.c Sat Aug 28 17:38:40 2010 (r211940) @@ -44,16 +44,34 @@ decode_events(int events) } static void -report(int num, const char *state, int expected, int got) +report_state(const char *state) { - if (expected == got) - printf("ok %-2d ", num); - else - printf("not ok %-2d", num); - printf(" %s state %s: expected %s; got %s\n", + + printf(" %s state %s: ", filetype == FT_PIPE ? "Pipe" : filetype == FT_SOCKETPAIR ? "Sock" : "FIFO", - state, decode_events(expected), decode_events(got)); + state); +} + +static void +report(int num, const char *state, int expected, int got, int res, + int res_expected) +{ + + if (res != res_expected) { + printf("not ok %-2d", num); + report_state(state); + printf("poll result %d expected %d. ", + res, res_expected); + } else { + if (expected == got) + printf("ok %-2d ", num); + else + printf("not ok %-2d", num); + report_state(state); + } + printf("expected %s; got %s\n", decode_events(expected), + decode_events(got)); fflush(stdout); } @@ -62,8 +80,9 @@ static pid_t ppid; static volatile sig_atomic_t state; static void -catch(int sig) +catch(int sig __unused) { + state++; } @@ -71,7 +90,7 @@ static void child(int fd, int num) { struct pollfd pfd; - int fd2; + int fd2, res; char buf[256]; if (filetype == FT_FIFO) { @@ -83,9 +102,9 @@ child(int fd, int num) pfd.events = POLLIN; if (filetype == FT_FIFO) { - if (poll(&pfd, 1, 0) < 0) + if ((res = poll(&pfd, 1, 0)) < 0) err(1, "poll"); - report(num++, "0", 0, pfd.revents); + report(num++, "0", 0, pfd.revents, res, 0); } kill(ppid, SIGUSR1); @@ -101,30 +120,30 @@ child(int fd, int num) state = 4; goto state4; } - if (poll(&pfd, 1, 0) < 0) + if ((res = poll(&pfd, 1, 0)) < 0) err(1, "poll"); - report(num++, "1", 0, pfd.revents); + report(num++, "1", 0, pfd.revents, res, 0); kill(ppid, SIGUSR1); usleep(1); while (state != 2) ; - if (poll(&pfd, 1, 0) < 0) + if ((res = poll(&pfd, 1, 0)) < 0) err(1, "poll"); - report(num++, "2", POLLIN, pfd.revents); + report(num++, "2", POLLIN, pfd.revents, res, 1); if (read(fd, buf, sizeof buf) != 1) err(1, "read"); - if (poll(&pfd, 1, 0) < 0) + if ((res = poll(&pfd, 1, 0)) < 0) err(1, "poll"); - report(num++, "2a", 0, pfd.revents); + report(num++, "2a", 0, pfd.revents, res, 0); kill(ppid, SIGUSR1); usleep(1); while (state != 3) ; - if (poll(&pfd, 1, 0) < 0) + if ((res = poll(&pfd, 1, 0)) < 0) err(1, "poll"); - report(num++, "3", POLLHUP, pfd.revents); + report(num++, "3", POLLHUP, pfd.revents, res, 1); kill(ppid, SIGUSR1); /* @@ -137,17 +156,17 @@ child(int fd, int num) while (state != 4) ; state4: - if (poll(&pfd, 1, 0) < 0) + if ((res = poll(&pfd, 1, 0)) < 0) err(1, "poll"); - report(num++, "4", 0, pfd.revents); + report(num++, "4", 0, pfd.revents, res, 0); kill(ppid, SIGUSR1); usleep(1); while (state != 5) ; - if (poll(&pfd, 1, 0) < 0) + if ((res = poll(&pfd, 1, 0)) < 0) err(1, "poll"); - report(num++, "5", POLLIN, pfd.revents); + report(num++, "5", POLLIN, pfd.revents, res, 1); kill(ppid, SIGUSR1); usleep(1); @@ -163,14 +182,14 @@ state4: * is an example of a broken program that quits on POLLHUP only -- * see its event-loop.c. */ - if (poll(&pfd, 1, 0) < 0) + if ((res = poll(&pfd, 1, 0)) < 0) err(1, "poll"); - report(num++, "6", POLLIN | POLLHUP, pfd.revents); + report(num++, "6", POLLIN | POLLHUP, pfd.revents, res, 1); if (read(fd, buf, sizeof buf) != 1) err(1, "read"); - if (poll(&pfd, 1, 0) < 0) + if ((res = poll(&pfd, 1, 0)) < 0) err(1, "poll"); - report(num++, "6a", POLLHUP, pfd.revents); + report(num++, "6a", POLLHUP, pfd.revents, res, 1); if (filetype == FT_FIFO) { /* * Check that POLLHUP is sticky for a new reader and for @@ -180,17 +199,17 @@ state4: if (fd2 < 0) err(1, "open for read"); pfd.fd = fd2; - if (poll(&pfd, 1, 0) < 0) + if ((res = poll(&pfd, 1, 0)) < 0) err(1, "poll"); - report(num++, "6b", POLLHUP, pfd.revents); + report(num++, "6b", POLLHUP, pfd.revents, res, 1); pfd.fd = fd; - if (poll(&pfd, 1, 0) < 0) + if ((res = poll(&pfd, 1, 0)) < 0) err(1, "poll"); - report(num++, "6c", POLLHUP, pfd.revents); + report(num++, "6c", POLLHUP, pfd.revents, res, 1); close(fd2); - if (poll(&pfd, 1, 0) < 0) + if ((res = poll(&pfd, 1, 0)) < 0) err(1, "poll"); - report(num++, "6d", POLLHUP, pfd.revents); + report(num++, "6d", POLLHUP, pfd.revents, res, 1); } close(fd); kill(ppid, SIGUSR1); From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 17:40:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46C9A1065693; Sat, 28 Aug 2010 17:40:54 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id ADF668FC18; Sat, 28 Aug 2010 17:40:53 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 3EF8845EEF; Sat, 28 Aug 2010 19:40:52 +0200 (CEST) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id E1BA845EE5; Sat, 28 Aug 2010 19:40:46 +0200 (CEST) Date: Sat, 28 Aug 2010 19:40:39 +0200 From: Pawel Jakub Dawidek To: Martin Matuska Message-ID: <20100828174039.GK2077@garage.freebsd.pl> References: <201008280924.o7S9OBgU025468@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zPXeIxDajdrcF2en" Content-Disposition: inline In-Reply-To: <201008280924.o7S9OBgU025468@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211932 - in head/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 17:40:54 -0000 --zPXeIxDajdrcF2en Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Aug 28, 2010 at 09:24:11AM +0000, Martin Matuska wrote: > Author: mm > Date: Sat Aug 28 09:24:11 2010 > New Revision: 211932 > URL: http://svn.freebsd.org/changeset/base/211932 >=20 > Log: > Import changes from OpenSolaris that provide > - better ACL caching and speedup of ACL permission checks > - faster handling of stat() > - lowered mutex contention in the read/writer lock (rrwlock) > - several related bugfixes > =20 > Detailed information (OpenSolaris onnv changesets and Bug IDs): > =20 > 9749:105f407a2680 > 6802734 Support for Access Based Enumeration (not used on FreeBSD) > 6844861 inconsistent xattr readdir behavior with too-small buffer > =20 > 9866:ddc5f1d8eb4e > 6848431 zfs with rstchown=3D0 or file_chown_self privilege allows user = to "take" ownership > =20 > 9981:b4907297e740 > 6775100 stat() performance on files on zfs should be improved > 6827779 rrwlock is overly protective of its counters > =20 > 10143:d2d432dfe597 > 6857433 memory leaks found at: zfs_acl_alloc/zfs_acl_node_alloc > 6860318 truncate() on zfsroot succeeds when file has a component of its= path set without access permission > =20 > 10232:f37b85f7e03e > 6865875 zfs sometimes incorrectly giving search access to a dir > =20 > 10250:b179ceb34b62 > 6867395 zpool_upgrade_007_pos testcase panic'd with BAD TRAP: type=3De = (#pf Page fault) > =20 > 10269:2788675568fd > 6868276 zfs_rezget() can be hazardous when znode has a cached ACL > =20 > 10295:f7a18a1e9610 > 6870564 panic in zfs_getsecattr > =20 > Approved by: delphij (mentor) > Obtained from: OpenSolaris (multiple Bug IDs) > MFC after: 2 weeks [...] > --- head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Sat Aug 2= 8 08:59:55 2010 (r211931) > +++ head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Sat Aug 2= 8 09:24:11 2010 (r211932) > @@ -19,6 +19,9 @@ > # CDDL HEADER END > # > =20 > +ZUT_OBJS +=3D \ > + zut.o > + > # > # Copyright 2008 Sun Microsystems, Inc. All rights reserved. > # Use is subject to license terms. [...] > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c Sat Aug= 28 08:59:55 2010 (r211931) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c Sat Aug= 28 09:24:11 2010 (r211932) [...] > @@ -84,7 +82,7 @@ rrn_find(rrwlock_t *rrl) > rrw_node_t *rn; > =20 > if (refcount_count(&rrl->rr_linked_rcount) =3D=3D 0) > - return (NULL); > + return (B_FALSE); > =20 > for (rn =3D tsd_get(rrw_tsd_key); rn !=3D NULL; rn =3D rn->rn_next) { > if (rn->rn_rrl =3D=3D rrl) Those two chunks are incorrect, please consult my p4 branch. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --zPXeIxDajdrcF2en Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkx5ShYACgkQForvXbEpPzTWxgCgwLN01ElBY1uPLzm3Wy4AEpHK NQYAniB6L42r3bvjsGOWeYmkH7gZ8UX2 =DzFP -----END PGP SIGNATURE----- --zPXeIxDajdrcF2en-- From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 17:42:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA8011065672; Sat, 28 Aug 2010 17:42:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFD828FC12; Sat, 28 Aug 2010 17:42:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7SHg8Yw038630; Sat, 28 Aug 2010 17:42:08 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7SHg8gZ038628; Sat, 28 Aug 2010 17:42:08 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008281742.o7SHg8gZ038628@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 28 Aug 2010 17:42:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211941 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 17:42:08 -0000 Author: kib Date: Sat Aug 28 17:42:08 2010 New Revision: 211941 URL: http://svn.freebsd.org/changeset/base/211941 Log: For some file types, select code registers two selfd structures. E.g., for socket, when specified POLLIN|POLLOUT in events, you would have one selfd registered for receiving socket buffer, and one for sending. Now, if both events are not ready to fire at the time of the initial scan, but are simultaneously ready after the sleep, pollrescan() would iterate over the pollfd struct twice. Since both times revents is not zero, returned value would be off by one. Fix this by recalculating the return value in pollout(). PR: kern/143029 MFC after: 2 weeks Modified: head/sys/kern/sys_generic.c Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Sat Aug 28 17:38:40 2010 (r211940) +++ head/sys/kern/sys_generic.c Sat Aug 28 17:42:08 2010 (r211941) @@ -76,7 +76,8 @@ static MALLOC_DEFINE(M_IOCTLOPS, "ioctlo static MALLOC_DEFINE(M_SELECT, "select", "select() buffer"); MALLOC_DEFINE(M_IOV, "iov", "large iov's"); -static int pollout(struct pollfd *, struct pollfd *, u_int); +static int pollout(struct thread *, struct pollfd *, struct pollfd *, + u_int); static int pollscan(struct thread *, struct pollfd *, u_int); static int pollrescan(struct thread *); static int selscan(struct thread *, fd_mask **, fd_mask **, int); @@ -1207,7 +1208,7 @@ done: if (error == EWOULDBLOCK) error = 0; if (error == 0) { - error = pollout(bits, uap->fds, nfds); + error = pollout(td, bits, uap->fds, nfds); if (error) goto out; } @@ -1262,22 +1263,27 @@ pollrescan(struct thread *td) static int -pollout(fds, ufds, nfd) +pollout(td, fds, ufds, nfd) + struct thread *td; struct pollfd *fds; struct pollfd *ufds; u_int nfd; { int error = 0; u_int i = 0; + u_int n = 0; for (i = 0; i < nfd; i++) { error = copyout(&fds->revents, &ufds->revents, sizeof(ufds->revents)); if (error) return (error); + if (fds->revents != 0) + n++; fds++; ufds++; } + td->td_retval[0] = n; return (0); } From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 17:52:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F170106566C; Sat, 28 Aug 2010 17:52:53 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73A548FC0A; Sat, 28 Aug 2010 17:52:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7SHqrt2038925; Sat, 28 Aug 2010 17:52:53 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7SHqrpm038924; Sat, 28 Aug 2010 17:52:53 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201008281752.o7SHqrpm038924@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 28 Aug 2010 17:52:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211942 - in stable/8/lib/libc: . locale stdtime sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 17:52:53 -0000 Author: ume Date: Sat Aug 28 17:52:53 2010 New Revision: 211942 URL: http://svn.freebsd.org/changeset/base/211942 Log: Record mergeinfo for r211276. Modified: Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/locale/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 17:54:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0308D1065697; Sat, 28 Aug 2010 17:54:18 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC3CE8FC1E; Sat, 28 Aug 2010 17:54:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7SHsHes039001; Sat, 28 Aug 2010 17:54:17 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7SHsHKv039000; Sat, 28 Aug 2010 17:54:17 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201008281754.o7SHsHKv039000@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 28 Aug 2010 17:54:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211943 - in stable/7/lib/libc: . stdtime X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 17:54:18 -0000 Author: ume Date: Sat Aug 28 17:54:17 2010 New Revision: 211943 URL: http://svn.freebsd.org/changeset/base/211943 Log: Record mergeinfo for r211276. Modified: Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 17:59:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA6E0106566C; Sat, 28 Aug 2010 17:59:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98E078FC1C; Sat, 28 Aug 2010 17:59:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7SHxpLd039189; Sat, 28 Aug 2010 17:59:51 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7SHxp5X039176; Sat, 28 Aug 2010 17:59:51 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201008281759.o7SHxp5X039176@svn.freebsd.org> From: Michael Tuexen Date: Sat, 28 Aug 2010 17:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211944 - in head/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 17:59:51 -0000 Author: tuexen Date: Sat Aug 28 17:59:51 2010 New Revision: 211944 URL: http://svn.freebsd.org/changeset/base/211944 Log: Fix the switching on/off of CMT using sysctl and socket option. Fix the switching on/off of PF and NR-SACKs using sysctl. Add minor improvement in handling malloc failures. Improve the address checks when sending. MFC after: 4 weeks Modified: head/sys/netinet/sctp.h head/sys/netinet/sctp_cc_functions.c head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_peeloff.c head/sys/netinet/sctp_timer.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Sat Aug 28 17:54:17 2010 (r211943) +++ head/sys/netinet/sctp.h Sat Aug 28 17:59:51 2010 (r211944) @@ -155,10 +155,8 @@ struct sctp_paramhdr { /* CMT ON/OFF socket option */ #define SCTP_CMT_ON_OFF 0x00001200 #define SCTP_CMT_USE_DAC 0x00001201 -/* EY - NR_SACK on/off socket option */ -#define SCTP_NR_SACK_ON_OFF 0x00001300 /* JRS - Pluggable Congestion Control Socket option */ -#define SCTP_PLUGGABLE_CC 0x00001202 +#define SCTP_PLUGGABLE_CC 0x00001202 /* read only */ #define SCTP_GET_SNDBUF_USE 0x00001101 Modified: head/sys/netinet/sctp_cc_functions.c ============================================================================== --- head/sys/netinet/sctp_cc_functions.c Sat Aug 28 17:54:17 2010 (r211943) +++ head/sys/netinet/sctp_cc_functions.c Sat Aug 28 17:59:51 2010 (r211944) @@ -71,7 +71,8 @@ sctp_cwnd_update_after_fr(struct sctp_tc * (net->fast_retran_loss_recovery == 0))) */ TAILQ_FOREACH(net, &asoc->nets, sctp_next) { - if ((asoc->fast_retran_loss_recovery == 0) || (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 1)) { + if ((asoc->fast_retran_loss_recovery == 0) || + (asoc->sctp_cmt_on_off == 1)) { /* out of a RFC2582 Fast recovery window? */ if (net->net_ack > 0) { /* @@ -232,11 +233,11 @@ sctp_cwnd_update_after_sack(struct sctp_ * * Should we stop any running T3 timer here? */ - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && - SCTP_BASE_SYSCTL(sctp_cmt_pf) && + if ((asoc->sctp_cmt_on_off == 1) && + (asoc->sctp_cmt_pf > 0) && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { net->dest_state &= ~SCTP_ADDR_PF; - net->cwnd = net->mtu * SCTP_BASE_SYSCTL(sctp_cmt_pf); + net->cwnd = net->mtu * asoc->sctp_cmt_pf; SCTPDBG(SCTP_DEBUG_INDATA1, "Destination %p moved from PF to reachable with cwnd %d.\n", net, net->cwnd); /* @@ -260,7 +261,9 @@ sctp_cwnd_update_after_sack(struct sctp_ */ #endif - if (asoc->fast_retran_loss_recovery && will_exit == 0 && SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0) { + if (asoc->fast_retran_loss_recovery && + (will_exit == 0) && + (asoc->sctp_cmt_on_off == 0)) { /* * If we are in loss recovery we skip any cwnd * update @@ -271,7 +274,8 @@ sctp_cwnd_update_after_sack(struct sctp_ * CMT: CUC algorithm. Update cwnd if pseudo-cumack has * moved. */ - if (accum_moved || (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && net->new_pseudo_cumack)) { + if (accum_moved || + ((asoc->sctp_cmt_on_off == 1) && net->new_pseudo_cumack)) { /* If the cumulative ack moved we can proceed */ if (net->cwnd <= net->ssthresh) { /* We are in slow start */ @@ -697,7 +701,8 @@ sctp_hs_cwnd_update_after_fr(struct sctp * (net->fast_retran_loss_recovery == 0))) */ TAILQ_FOREACH(net, &asoc->nets, sctp_next) { - if ((asoc->fast_retran_loss_recovery == 0) || (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 1)) { + if ((asoc->fast_retran_loss_recovery == 0) || + (asoc->sctp_cmt_on_off == 1)) { /* out of a RFC2582 Fast recovery window? */ if (net->net_ack > 0) { /* @@ -850,11 +855,11 @@ sctp_hs_cwnd_update_after_sack(struct sc * * Should we stop any running T3 timer here? */ - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && - SCTP_BASE_SYSCTL(sctp_cmt_pf) && + if ((asoc->sctp_cmt_on_off == 1) && + (asoc->sctp_cmt_pf > 0) && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { net->dest_state &= ~SCTP_ADDR_PF; - net->cwnd = net->mtu * SCTP_BASE_SYSCTL(sctp_cmt_pf); + net->cwnd = net->mtu * asoc->sctp_cmt_pf; SCTPDBG(SCTP_DEBUG_INDATA1, "Destination %p moved from PF to reachable with cwnd %d.\n", net, net->cwnd); /* @@ -878,7 +883,9 @@ sctp_hs_cwnd_update_after_sack(struct sc */ #endif - if (asoc->fast_retran_loss_recovery && will_exit == 0 && SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0) { + if (asoc->fast_retran_loss_recovery && + (will_exit == 0) && + (asoc->sctp_cmt_on_off == 0)) { /* * If we are in loss recovery we skip any cwnd * update @@ -889,7 +896,8 @@ sctp_hs_cwnd_update_after_sack(struct sc * CMT: CUC algorithm. Update cwnd if pseudo-cumack has * moved. */ - if (accum_moved || (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && net->new_pseudo_cumack)) { + if (accum_moved || + ((asoc->sctp_cmt_on_off == 1) && net->new_pseudo_cumack)) { /* If the cumulative ack moved we can proceed */ if (net->cwnd <= net->ssthresh) { /* We are in slow start */ @@ -1333,11 +1341,11 @@ sctp_htcp_cwnd_update_after_sack(struct * * Should we stop any running T3 timer here? */ - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && - SCTP_BASE_SYSCTL(sctp_cmt_pf) && + if ((asoc->sctp_cmt_on_off == 1) && + (asoc->sctp_cmt_pf > 0) && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { net->dest_state &= ~SCTP_ADDR_PF; - net->cwnd = net->mtu * SCTP_BASE_SYSCTL(sctp_cmt_pf); + net->cwnd = net->mtu * asoc->sctp_cmt_pf; SCTPDBG(SCTP_DEBUG_INDATA1, "Destination %p moved from PF to reachable with cwnd %d.\n", net, net->cwnd); /* @@ -1361,7 +1369,9 @@ sctp_htcp_cwnd_update_after_sack(struct */ #endif - if (asoc->fast_retran_loss_recovery && will_exit == 0 && SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0) { + if (asoc->fast_retran_loss_recovery && + will_exit == 0 && + (asoc->sctp_cmt_on_off == 0)) { /* * If we are in loss recovery we skip any cwnd * update @@ -1372,7 +1382,8 @@ sctp_htcp_cwnd_update_after_sack(struct * CMT: CUC algorithm. Update cwnd if pseudo-cumack has * moved. */ - if (accum_moved || (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && net->new_pseudo_cumack)) { + if (accum_moved || + ((asoc->sctp_cmt_on_off == 1) && net->new_pseudo_cumack)) { htcp_cong_avoid(stcb, net); measure_achieved_throughput(stcb, net); } else { @@ -1412,7 +1423,8 @@ sctp_htcp_cwnd_update_after_fr(struct sc * (net->fast_retran_loss_recovery == 0))) */ TAILQ_FOREACH(net, &asoc->nets, sctp_next) { - if ((asoc->fast_retran_loss_recovery == 0) || (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 1)) { + if ((asoc->fast_retran_loss_recovery == 0) || + (asoc->sctp_cmt_on_off == 1)) { /* out of a RFC2582 Fast recovery window? */ if (net->net_ack > 0) { /* Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sat Aug 28 17:54:17 2010 (r211943) +++ head/sys/netinet/sctp_indata.c Sat Aug 28 17:59:51 2010 (r211944) @@ -2475,7 +2475,7 @@ sctp_sack_check(struct sctp_tcb *stcb, i (stcb->asoc.data_pkts_seen >= stcb->asoc.sack_freq) /* hit limit of pkts */ ) { - if ((SCTP_BASE_SYSCTL(sctp_cmt_on_off)) && + if ((stcb->asoc.sctp_cmt_on_off == 1) && (SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) && (stcb->asoc.send_sack == 0) && (stcb->asoc.numduptsns == 0) && @@ -3265,7 +3265,8 @@ sctp_strike_gap_ack_chunks(struct sctp_t } /* CMT DAC algo: finding out if SACK is a mixed SACK */ - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) { + if ((asoc->sctp_cmt_on_off == 1) && + SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) { TAILQ_FOREACH(net, &asoc->nets, sctp_next) { if (net->saw_newack) num_dests_sacked++; @@ -3381,7 +3382,8 @@ sctp_strike_gap_ack_chunks(struct sctp_t if (tp1->sent < SCTP_DATAGRAM_RESEND) { tp1->sent++; } - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) { + if ((asoc->sctp_cmt_on_off == 1) && + SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) { /* * CMT DAC algorithm: If SACK flag is set to * 0, then lowest_newack test will not pass @@ -3405,7 +3407,8 @@ sctp_strike_gap_ack_chunks(struct sctp_t tp1->sent++; } } - } else if ((tp1->rec.data.doing_fast_retransmit) && (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0)) { + } else if ((tp1->rec.data.doing_fast_retransmit) && + (asoc->sctp_cmt_on_off == 0)) { /* * For those that have done a FR we must take * special consideration if we strike. I.e the @@ -3445,7 +3448,8 @@ sctp_strike_gap_ack_chunks(struct sctp_t tp1->sent++; } strike_flag = 1; - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) { + if ((asoc->sctp_cmt_on_off == 1) && + SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) { /* * CMT DAC algorithm: If * SACK flag is set to 0, @@ -3505,7 +3509,8 @@ sctp_strike_gap_ack_chunks(struct sctp_t if (tp1->sent < SCTP_DATAGRAM_RESEND) { tp1->sent++; } - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) { + if ((asoc->sctp_cmt_on_off == 1) && + SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) { /* * CMT DAC algorithm: If SACK flag is set to * 0, then lowest_newack test will not pass @@ -3584,7 +3589,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t SCTP_STAT_INCR(sctps_sendmultfastretrans); } sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off)) { + if (asoc->sctp_cmt_on_off == 1) { /* * CMT: Using RTX_SSTHRESH policy for CMT. * If CMT is being used, then pick dest with @@ -3593,7 +3598,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t tp1->no_fr_allowed = 1; alt = tp1->whoTo; /* sa_ignore NO_NULL_CHK */ - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_pf)) { + if (asoc->sctp_cmt_pf > 0) { /* * JRS 5/18/07 - If CMT PF is on, * use the PF version of @@ -4800,7 +4805,7 @@ sctp_handle_sack(struct mbuf *m, int off /*******************************************/ /* cancel ALL T3-send timer if accum moved */ /*******************************************/ - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off)) { + if (asoc->sctp_cmt_on_off == 1) { TAILQ_FOREACH(net, &asoc->nets, sctp_next) { if (net->new_pseudo_cumack) sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, @@ -5100,7 +5105,9 @@ done_with_it: * to be done. Setting this_sack_lowest_newack to the cum_ack will * automatically ensure that. */ - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac) && (cmt_dac_flag == 0)) { + if ((asoc->sctp_cmt_on_off == 1) && + SCTP_BASE_SYSCTL(sctp_cmt_use_dac) && + (cmt_dac_flag == 0)) { this_sack_lowest_newack = cum_ack; } if ((num_seg > 0) || (num_nr_seg > 0)) { Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sat Aug 28 17:54:17 2010 (r211943) +++ head/sys/netinet/sctp_input.c Sat Aug 28 17:59:51 2010 (r211944) @@ -618,16 +618,16 @@ sctp_handle_heartbeat_ack(struct sctp_he * timer is running, for the destination, stop the timer because a * PF-heartbeat was received. */ - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && - SCTP_BASE_SYSCTL(sctp_cmt_pf) && - (net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF) { + if ((stcb->asoc.sctp_cmt_on_off == 1) && + (stcb->asoc.sctp_cmt_pf > 0) && + ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { if (SCTP_OS_TIMER_PENDING(&net->rxt_timer.timer)) { sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_5); } net->dest_state &= ~SCTP_ADDR_PF; - net->cwnd = net->mtu * SCTP_BASE_SYSCTL(sctp_cmt_pf); + net->cwnd = net->mtu * stcb->asoc.sctp_cmt_pf; SCTPDBG(SCTP_DEBUG_INPUT1, "Destination %p moved from PF to reachable with cwnd %d.\n", net, net->cwnd); } @@ -2723,6 +2723,7 @@ sctp_handle_cookie_echo(struct mbuf *m, inp->sctp_mobility_features = (*inp_p)->sctp_mobility_features; inp->sctp_socket = so; inp->sctp_frag_point = (*inp_p)->sctp_frag_point; + inp->sctp_cmt_on_off = (*inp_p)->sctp_cmt_on_off; inp->partial_delivery_point = (*inp_p)->partial_delivery_point; inp->sctp_context = (*inp_p)->sctp_context; inp->inp_starting_point_for_iterator = NULL; @@ -3067,7 +3068,7 @@ process_chunk_drop(struct sctp_tcb *stcb struct sctp_nets *net, uint8_t flg) { switch (desc->chunk_type) { - case SCTP_DATA: + case SCTP_DATA: /* find the tsn to resend (possibly */ { uint32_t tsn; @@ -4586,8 +4587,6 @@ process_control_chunks: return (NULL); break; case SCTP_SELECTIVE_ACK: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SACK\n"); - SCTP_STAT_INCR(sctps_recvsacks); { struct sctp_sack_chunk *sack; int abort_now = 0; @@ -4597,6 +4596,8 @@ process_control_chunks: int offset_seg, offset_dup; int nonce_sum_flag; + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SACK\n"); + SCTP_STAT_INCR(sctps_recvsacks); if (stcb == NULL) { SCTPDBG(SCTP_DEBUG_INDATA1, "No stcb when processing SACK chunk\n"); break; @@ -4673,8 +4674,6 @@ process_control_chunks: * nr_sack chunk */ case SCTP_NR_SELECTIVE_ACK: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_NR_SACK\n"); - SCTP_STAT_INCR(sctps_recvsacks); { struct sctp_nr_sack_chunk *nr_sack; int abort_now = 0; @@ -4684,13 +4683,10 @@ process_control_chunks: int offset_seg, offset_dup; int nonce_sum_flag; - /* - * EY nr_sacks have not been negotiated but - * the peer end sent an nr_sack, silently - * discard the chunk - */ - if (!(SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && - stcb->asoc.peer_supports_nr_sack)) { + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_NR_SACK\n"); + SCTP_STAT_INCR(sctps_recvsacks); + if ((stcb->asoc.sctp_nr_sack_on_off == 0) || + (stcb->asoc.peer_supports_nr_sack == 0)) { goto unknown_chunk; } if (stcb == NULL) { Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat Aug 28 17:54:17 2010 (r211943) +++ head/sys/netinet/sctp_output.c Sat Aug 28 17:59:51 2010 (r211944) @@ -3686,7 +3686,8 @@ sctp_lowlevel_chunk_output(struct sctp_i * Stop any running T3 * timers here? */ - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_pf)) { + if ((stcb->asoc.sctp_cmt_on_off == 1) && + (stcb->asoc.sctp_cmt_pf > 0)) { net->dest_state &= ~SCTP_ADDR_PF; SCTPDBG(SCTP_DEBUG_OUTPUT1, "Destination %p moved from PF to unreachable.\n", net); @@ -4323,11 +4324,7 @@ sctp_send_initiate(struct sctp_inpcb *in if (!SCTP_BASE_SYSCTL(sctp_auth_disable)) { pr_supported->chunk_types[num_ext++] = SCTP_AUTHENTICATION; } - /* - * EY if the initiator supports nr_sacks, need to report that to - * responder in INIT chunk - */ - if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off)) { + if (stcb->asoc.sctp_nr_sack_on_off == 1) { pr_supported->chunk_types[num_ext++] = SCTP_NR_SELECTIVE_ACK; } p_len = sizeof(*pr_supported) + num_ext; @@ -5447,10 +5444,6 @@ do_a_abort: pr_supported->chunk_types[num_ext++] = SCTP_STREAM_RESET; if (!SCTP_BASE_SYSCTL(sctp_auth_disable)) pr_supported->chunk_types[num_ext++] = SCTP_AUTHENTICATION; - /* - * EY if the sysctl variable is set, tell the assoc. initiator that - * we do nr_sack - */ if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off)) pr_supported->chunk_types[num_ext++] = SCTP_NR_SELECTIVE_ACK; p_len = sizeof(*pr_supported) + num_ext; @@ -7267,7 +7260,8 @@ sctp_fill_outqueue(struct sctp_tcb *stcb if (sp == NULL) { break; } - if ((sp->net != net) && (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0)) { + if ((sp->net != net) && + (asoc->sctp_cmt_on_off == 0)) { /* none for this network */ if (locked) { break; @@ -7326,11 +7320,11 @@ sctp_fill_outqueue(struct sctp_tcb *stcb *quit_now = 1; if (total_moved == 0) { - if ((SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0) && + if ((stcb->asoc.sctp_cmt_on_off == 0) && (net == stcb->asoc.primary_destination)) { /* ran dry for primary network net */ SCTP_STAT_INCR(sctps_primary_randry); - } else if (SCTP_BASE_SYSCTL(sctp_cmt_on_off)) { + } else if (stcb->asoc.sctp_cmt_on_off == 1) { /* ran dry with CMT on */ SCTP_STAT_INCR(sctps_cmt_randry); } @@ -7363,7 +7357,8 @@ sctp_move_to_an_alt(struct sctp_tcb *stc * destination using the PF algorithm for finding alternate * destinations. */ - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_pf)) { + if ((asoc->sctp_cmt_on_off == 1) && + (asoc->sctp_cmt_pf > 0)) { a_net = sctp_find_alternate_net(stcb, net, 2); } else { a_net = sctp_find_alternate_net(stcb, net, 0); @@ -7499,7 +7494,8 @@ sctp_med_chunk_output(struct sctp_inpcb } continue; } - if ((SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0) && (net->ref_count < 2)) { + if ((asoc->sctp_cmt_on_off == 0) && + (net->ref_count < 2)) { /* nothing can be in queue for this guy */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { sctp_log_cwnd(stcb, net, 2, @@ -7534,7 +7530,7 @@ sctp_med_chunk_output(struct sctp_inpcb *reason_code = 8; return (0); } - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off)) { + if (asoc->sctp_cmt_on_off == 1) { /* get the last start point */ start_at = asoc->last_net_cmt_send_started; if (start_at == NULL) { @@ -7560,7 +7556,7 @@ again_one_more_time: break; } tsns_sent = 0xa; - if ((SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0) && (net->ref_count < 2)) { + if ((asoc->sctp_cmt_on_off == 0) && (net->ref_count < 2)) { /* * Ref-count of 1 so we cannot have data or control * queued to this address. Skip it (non-CMT). @@ -8034,15 +8030,15 @@ again_one_more_time: } } /* JRI: if dest is in PF state, do not send data to it */ - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && - SCTP_BASE_SYSCTL(sctp_cmt_pf) && + if ((asoc->sctp_cmt_on_off == 1) && + (asoc->sctp_cmt_pf > 0) && (net->dest_state & SCTP_ADDR_PF)) { goto no_data_fill; } if (net->flight_size >= net->cwnd) { goto no_data_fill; } - if ((SCTP_BASE_SYSCTL(sctp_cmt_on_off)) && + if ((asoc->sctp_cmt_on_off == 1) && (net->flight_size > max_rwnd_per_dest)) { goto no_data_fill; } @@ -8096,7 +8092,7 @@ again_one_more_time: break; } nchk = TAILQ_NEXT(chk, sctp_next); - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off)) { + if (asoc->sctp_cmt_on_off == 1) { if (chk->whoTo != net) { /* * For CMT, steal the data @@ -8271,8 +8267,8 @@ no_data_fill: * restart it. */ sctp_timer_start(SCTP_TIMER_TYPE_SEND, inp, stcb, net); - } else if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && - SCTP_BASE_SYSCTL(sctp_cmt_pf) && + } else if ((asoc->sctp_cmt_on_off == 1) && + (asoc->sctp_cmt_pf > 0) && pf_hbflag && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF) && (!SCTP_OS_TIMER_PENDING(&net->rxt_timer.timer))) { @@ -9579,8 +9575,8 @@ sctp_chunk_output(struct sctp_inpcb *inp */ if (net->ref_count > 1) sctp_move_to_an_alt(stcb, asoc, net); - } else if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && - SCTP_BASE_SYSCTL(sctp_cmt_pf) && + } else if ((asoc->sctp_cmt_on_off == 1) && + (asoc->sctp_cmt_pf > 0) && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { /* * JRS 5/14/07 - If CMT PF is on and the current @@ -9926,8 +9922,8 @@ sctp_send_sack(struct sctp_tcb *stcb) uint8_t flags; uint8_t type; - if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && - stcb->asoc.peer_supports_nr_sack) { + if ((stcb->asoc.sctp_nr_sack_on_off == 1) && + (stcb->asoc.peer_supports_nr_sack == 1)) { type = SCTP_NR_SELECTIVE_ACK; } else { type = SCTP_SELECTIVE_ACK; @@ -10071,7 +10067,8 @@ sctp_send_sack(struct sctp_tcb *stcb) else flags = 0; - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) { + if ((asoc->sctp_cmt_on_off == 1) && + SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) { /*- * CMT DAC algorithm: If 2 (i.e., 0x10) packets have been * received, then set high bit to 1, else 0. Reset @@ -10839,7 +10836,8 @@ sctp_send_hb(struct sctp_tcb *stcb, int * heartbeat is being sent is in PF state, do NOT do threshold * management. */ - if ((SCTP_BASE_SYSCTL(sctp_cmt_pf) == 0) || ((net->dest_state & SCTP_ADDR_PF) != SCTP_ADDR_PF)) { + if ((stcb->asoc.sctp_cmt_pf == 0) || + ((net->dest_state & SCTP_ADDR_PF) != SCTP_ADDR_PF)) { /* ok we have a destination that needs a beat */ /* lets do the theshold management Qiaobing style */ if (sctp_threshold_management(stcb->sctp_ep, stcb, net, @@ -12105,7 +12103,7 @@ sctp_sosend(struct socket *so, struct sctp_sndrcvinfo srcv; struct sockaddr *addr_to_use; -#ifdef INET6 +#if defined(INET) && defined(INET6) struct sockaddr_in sin; #endif @@ -12120,7 +12118,7 @@ sctp_sosend(struct socket *so, } } addr_to_use = addr; -#if defined(INET6) && !defined(__Userspace__) /* TODO port in6_sin6_2_sin */ +#if defined(INET) && defined(INET6) if ((addr) && (addr->sa_family == AF_INET6)) { struct sockaddr_in6 *sin6; @@ -12212,20 +12210,33 @@ sctp_lower_sosend(struct socket *so, SCTPDBG(SCTP_DEBUG_OUTPUT1, "Send called addr:%p send length %d\n", addr, sndlen); - /*- + /** * Pre-screen address, if one is given the sin-len * must be set correctly! */ if (addr) { - if ((addr->sa_family == AF_INET) && - (addr->sa_len != sizeof(struct sockaddr_in))) { - SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); - error = EINVAL; - goto out_unlocked; - } else if ((addr->sa_family == AF_INET6) && - (addr->sa_len != sizeof(struct sockaddr_in6))) { - SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); - error = EINVAL; + switch (addr->sa_family) { +#if defined(INET) + case AF_INET: + if (addr->sa_len != sizeof(struct sockaddr_in)) { + SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); + error = EINVAL; + goto out_unlocked; + } + break; +#endif +#if defined(INET6) + case AF_INET6: + if (addr->sa_len != sizeof(struct sockaddr_in6)) { + SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); + error = EINVAL; + goto out_unlocked; + } + break; +#endif + default: + SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EAFNOSUPPORT); + error = EAFNOSUPPORT; goto out_unlocked; } } @@ -12657,7 +12668,8 @@ sctp_lower_sosend(struct socket *so, error = EINVAL; goto out_unlocked; } - if ((net->flight_size > net->cwnd) && (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0)) { + if ((net->flight_size > net->cwnd) && + (asoc->sctp_cmt_on_off == 0)) { /*- * CMT: Added check for CMT above. net above is the primary * dest. If CMT is ON, sender should always attempt to send @@ -13075,7 +13087,7 @@ skip_preblock: goto skip_out_eof; } if ((net->flight_size > net->cwnd) && - (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0)) { + (asoc->sctp_cmt_on_off == 0)) { queue_only = 1; } else if (asoc->ifp_had_enobuf) { SCTP_STAT_INCR(sctps_ifnomemqueued); @@ -13349,7 +13361,7 @@ skip_out_eof: some_on_control = 1; } if ((net->flight_size > net->cwnd) && - (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0)) { + (stcb->asoc.sctp_cmt_on_off == 0)) { queue_only = 1; } else if (asoc->ifp_had_enobuf) { SCTP_STAT_INCR(sctps_ifnomemqueued); Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sat Aug 28 17:54:17 2010 (r211943) +++ head/sys/netinet/sctp_pcb.c Sat Aug 28 17:59:51 2010 (r211944) @@ -2385,6 +2385,7 @@ sctp_inpcb_alloc(struct socket *so, uint inp->sctp_associd_counter = 1; inp->partial_delivery_point = SCTP_SB_LIMIT_RCV(so) >> SCTP_PARTIAL_DELIVERY_SHIFT; inp->sctp_frag_point = SCTP_DEFAULT_MAXSEGMENT; + inp->sctp_cmt_on_off = SCTP_BASE_SYSCTL(sctp_cmt_on_off); /* init the small hash table we use to track asocid <-> tcb */ inp->sctp_asocidhash = SCTP_HASH_INIT(SCTP_STACK_VTAG_HASH_SIZE, &inp->hashasocidmark); if (inp->sctp_asocidhash == NULL) { @@ -6241,10 +6242,7 @@ sctp_load_addresses_from_init(struct sct stcb->asoc.peer_supports_pktdrop = 1; break; case SCTP_NR_SELECTIVE_ACK: - if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off)) - stcb->asoc.peer_supports_nr_sack = 1; - else - stcb->asoc.peer_supports_nr_sack = 0; + stcb->asoc.peer_supports_nr_sack = 1; break; case SCTP_STREAM_RESET: stcb->asoc.peer_supports_strreset = 1; Modified: head/sys/netinet/sctp_pcb.h ============================================================================== --- head/sys/netinet/sctp_pcb.h Sat Aug 28 17:54:17 2010 (r211943) +++ head/sys/netinet/sctp_pcb.h Sat Aug 28 17:59:51 2010 (r211944) @@ -389,6 +389,7 @@ struct sctp_inpcb { uint32_t sctp_frag_point; uint32_t partial_delivery_point; uint32_t sctp_context; + uint32_t sctp_cmt_on_off; struct sctp_nonpad_sndrcvinfo def_send; /*- * These three are here for the sosend_dgram Modified: head/sys/netinet/sctp_peeloff.c ============================================================================== --- head/sys/netinet/sctp_peeloff.c Sat Aug 28 17:54:17 2010 (r211943) +++ head/sys/netinet/sctp_peeloff.c Sat Aug 28 17:59:51 2010 (r211944) @@ -112,6 +112,7 @@ sctp_do_peeloff(struct socket *head, str n_inp->sctp_features = inp->sctp_features; n_inp->sctp_mobility_features = inp->sctp_mobility_features; n_inp->sctp_frag_point = inp->sctp_frag_point; + n_inp->sctp_cmt_on_off = inp->sctp_cmt_on_off; n_inp->partial_delivery_point = inp->partial_delivery_point; n_inp->sctp_context = inp->sctp_context; n_inp->inp_starting_point_for_iterator = NULL; @@ -183,6 +184,7 @@ sctp_get_peeloff(struct socket *head, sc (SCTP_PCB_COPY_FLAGS & inp->sctp_flags)); n_inp->sctp_features = inp->sctp_features; n_inp->sctp_frag_point = inp->sctp_frag_point; + n_inp->sctp_cmt_on_off = inp->sctp_cmt_on_off; n_inp->partial_delivery_point = inp->partial_delivery_point; n_inp->sctp_context = inp->sctp_context; n_inp->inp_starting_point_for_iterator = NULL; Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Sat Aug 28 17:54:17 2010 (r211943) +++ head/sys/netinet/sctp_timer.c Sat Aug 28 17:59:51 2010 (r211944) @@ -215,7 +215,8 @@ sctp_threshold_management(struct sctp_in * not in PF state. */ /* Stop any running T3 timers here? */ - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_pf)) { + if ((stcb->asoc.sctp_cmt_on_off == 1) && + (stcb->asoc.sctp_cmt_pf > 0)) { net->dest_state &= ~SCTP_ADDR_PF; SCTPDBG(SCTP_DEBUG_TIMER4, "Destination %p moved from PF to unreachable.\n", net); @@ -419,7 +420,7 @@ sctp_find_alternate_net(struct sctp_tcb return (net); } min_errors_net->dest_state &= ~SCTP_ADDR_PF; - min_errors_net->cwnd = min_errors_net->mtu * SCTP_BASE_SYSCTL(sctp_cmt_pf); + min_errors_net->cwnd = min_errors_net->mtu * stcb->asoc.sctp_cmt_pf; if (SCTP_OS_TIMER_PENDING(&min_errors_net->rxt_timer.timer)) { sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, min_errors_net, @@ -843,7 +844,7 @@ start_again: /* * CMT: Do not allow FRs on retransmitted TSNs. */ - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 1) { + if (stcb->asoc.sctp_cmt_on_off == 1) { chk->no_fr_allowed = 1; } #ifdef THIS_SHOULD_NOT_BE_DONE @@ -1038,7 +1039,8 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, * addition, find an alternate destination with PF-based * find_alt_net(). */ - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_pf)) { + if ((stcb->asoc.sctp_cmt_on_off == 1) && + (stcb->asoc.sctp_cmt_pf > 0)) { if ((net->dest_state & SCTP_ADDR_PF) != SCTP_ADDR_PF) { net->dest_state |= SCTP_ADDR_PF; net->last_active = sctp_get_tick_count(); @@ -1046,7 +1048,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, net); } alt = sctp_find_alternate_net(stcb, net, 2); - } else if (SCTP_BASE_SYSCTL(sctp_cmt_on_off)) { + } else if (stcb->asoc.sctp_cmt_on_off == 1) { /* * CMT: Using RTX_SSTHRESH policy for CMT. If CMT is being * used, then pick dest with largest ssthresh for any @@ -1162,7 +1164,9 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, net->dest_state |= SCTP_ADDR_WAS_PRIMARY; } } - } else if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_pf) && (net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF) { + } else if ((stcb->asoc.sctp_cmt_on_off == 1) && + (stcb->asoc.sctp_cmt_pf > 0) && + ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { /* * JRS 5/14/07 - If the destination hasn't failed completely * but is in PF state, a PF-heartbeat needs to be sent Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sat Aug 28 17:54:17 2010 (r211943) +++ head/sys/netinet/sctp_usrreq.c Sat Aug 28 17:59:51 2010 (r211944) @@ -300,7 +300,8 @@ sctp_notify(struct sctp_inpcb *inp, * PF state. */ /* Stop any running T3 timers here? */ - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_pf)) { + if ((stcb->asoc.sctp_cmt_on_off == 1) && + (stcb->asoc.sctp_cmt_pf > 0)) { net->dest_state &= ~SCTP_ADDR_PF; SCTPDBG(SCTP_DEBUG_TIMER4, "Destination %p moved from PF to unreachable.\n", net); @@ -1736,42 +1737,14 @@ flags_out: struct sctp_assoc_value *av; SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, *optsize); - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off)) { - SCTP_FIND_STCB(inp, stcb, av->assoc_id); - if (stcb) { - av->assoc_value = stcb->asoc.sctp_cmt_on_off; - SCTP_TCB_UNLOCK(stcb); - - } else { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTCONN); - error = ENOTCONN; - } - } else { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); - error = ENOPROTOOPT; - } - *optsize = sizeof(*av); - } - break; - /* EY - set socket option for nr_sacks */ - case SCTP_NR_SACK_ON_OFF: - { - struct sctp_assoc_value *av; - - SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, *optsize); - if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off)) { - SCTP_FIND_STCB(inp, stcb, av->assoc_id); - if (stcb) { - av->assoc_value = stcb->asoc.sctp_nr_sack_on_off; - SCTP_TCB_UNLOCK(stcb); - - } else { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTCONN); - error = ENOTCONN; - } + SCTP_FIND_STCB(inp, stcb, av->assoc_id); + if (stcb) { + av->assoc_value = stcb->asoc.sctp_cmt_on_off; + SCTP_TCB_UNLOCK(stcb); } else { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); - error = ENOPROTOOPT; + SCTP_INP_RLOCK(inp); + av->assoc_value = inp->sctp_cmt_on_off; + SCTP_INP_RUNLOCK(inp); } *optsize = sizeof(*av); } @@ -2846,44 +2819,28 @@ sctp_setopt(struct socket *so, int optna } break; case SCTP_CMT_ON_OFF: - { + if (SCTP_BASE_SYSCTL(sctp_cmt_on_off)) { struct sctp_assoc_value *av; SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, optsize); - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off)) { - SCTP_FIND_STCB(inp, stcb, av->assoc_id); - if (stcb) { - stcb->asoc.sctp_cmt_on_off = (uint8_t) av->assoc_value; - SCTP_TCB_UNLOCK(stcb); - } else { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTCONN); - error = ENOTCONN; - } - } else { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); - error = ENOPROTOOPT; - } - } - break; - /* EY nr_sack_on_off socket option */ - case SCTP_NR_SACK_ON_OFF: - { - struct sctp_assoc_value *av; - - SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, optsize); - if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off)) { - SCTP_FIND_STCB(inp, stcb, av->assoc_id); - if (stcb) { - stcb->asoc.sctp_nr_sack_on_off = (uint8_t) av->assoc_value; - SCTP_TCB_UNLOCK(stcb); - } else { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTCONN); - error = ENOTCONN; - } + SCTP_FIND_STCB(inp, stcb, av->assoc_id); + if (stcb) { + if (av->assoc_value != 0) + stcb->asoc.sctp_cmt_on_off = 1; + else + stcb->asoc.sctp_cmt_on_off = 0; + SCTP_TCB_UNLOCK(stcb); } else { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); - error = ENOPROTOOPT; + SCTP_INP_WLOCK(inp); + if (av->assoc_value != 0) + inp->sctp_cmt_on_off = 1; + else + inp->sctp_cmt_on_off = 0; + SCTP_INP_WUNLOCK(inp); } + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); + error = ENOPROTOOPT; } break; /* JRS - Set socket option for pluggable congestion control */ Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sat Aug 28 17:54:17 2010 (r211943) +++ head/sys/netinet/sctputil.c Sat Aug 28 17:59:51 2010 (r211944) @@ -893,10 +893,8 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc->max_burst = m->sctp_ep.max_burst; asoc->heart_beat_delay = TICKS_TO_MSEC(m->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT]); asoc->cookie_life = m->sctp_ep.def_cookie_life; - asoc->sctp_cmt_on_off = (uint8_t) SCTP_BASE_SYSCTL(sctp_cmt_on_off); - /* EY Init nr_sack variable */ + asoc->sctp_cmt_on_off = m->sctp_cmt_on_off; asoc->sctp_nr_sack_on_off = (uint8_t) SCTP_BASE_SYSCTL(sctp_nr_sack_on_off); - /* JRS 5/21/07 - Init CMT PF variables */ asoc->sctp_cmt_pf = (uint8_t) SCTP_BASE_SYSCTL(sctp_cmt_pf); asoc->sctp_frag_point = m->sctp_frag_point; #ifdef INET @@ -4213,7 +4211,7 @@ void sctp_print_address_pkt(struct ip *iph, struct sctphdr *sh) { switch (iph->ip_v) { - case IPVERSION: + case IPVERSION: { struct sockaddr_in lsa, fsa; Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Sat Aug 28 17:54:17 2010 (r211943) +++ head/sys/netinet6/sctp6_usrreq.c Sat Aug 28 17:59:51 2010 (r211944) @@ -414,7 +414,8 @@ sctp6_notify(struct sctp_inpcb *inp, * PF state. */ /* Stop any running T3 timers here? */ - if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_pf)) { + if ((stcb->asoc.sctp_cmt_on_off == 1) && + (stcb->asoc.sctp_cmt_pf > 0)) { net->dest_state &= ~SCTP_ADDR_PF; SCTPDBG(SCTP_DEBUG_TIMER4, "Destination %p moved from PF to unreachable.\n", net); @@ -1069,6 +1070,8 @@ sctp6_getaddr(struct socket *so, struct * Do the malloc first in case it blocks. */ SCTP_MALLOC_SONAME(sin6, struct sockaddr_in6 *, sizeof *sin6); + if (sin6 == NULL) + return ENOMEM; sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(*sin6); @@ -1173,6 +1176,8 @@ sctp6_peeraddr(struct socket *so, struct return (ENOTCONN); } SCTP_MALLOC_SONAME(sin6, struct sockaddr_in6 *, sizeof *sin6); + if (sin6 == NULL) + return (ENOMEM); sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(*sin6); From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 18:28:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AA1D1065693; Sat, 28 Aug 2010 18:28:22 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id E881D8FC14; Sat, 28 Aug 2010 18:28:21 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 58D4945C9C; Sat, 28 Aug 2010 20:28:20 +0200 (CEST) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 6E32145C89; Sat, 28 Aug 2010 20:28:15 +0200 (CEST) Date: Sat, 28 Aug 2010 20:28:07 +0200 From: Pawel Jakub Dawidek To: pluknet Message-ID: <20100828182807.GM2077@garage.freebsd.pl> References: <201008262333.o7QNX484056761@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="P9KQiUGMzYCFwWCN" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211853 - head/sys/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 18:28:22 -0000 --P9KQiUGMzYCFwWCN Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 27, 2010 at 07:48:09PM +0400, pluknet wrote: > On 27 August 2010 03:33, Pawel Jakub Dawidek wrote: > > Author: pjd > > Date: Thu Aug 26 23:33:04 2010 > > New Revision: 211853 > > URL: http://svn.freebsd.org/changeset/base/211853 > > > > Log: > > =A0- Check the result of malloc(M_NOWAIT) in replay_alloc(). The caller > > =A0 =A0(replay_alloc()) knows how to handle replay_alloc() failure. > > =A0- Eliminate 'freed_one' variable, it is not needed - when no entry i= s found > > =A0 =A0rce will be NULL. > > =A0- Add locking assertions where we expect a rc_lock to be held. >=20 > Hi, >=20 > may this help fixing memory leak seen on nfsclient.ko unload right > after nfs_unmount()? >=20 > Warning: memory type rpc leaked memory on destroy (3 allocations, 1216 > bytes leaked). Nope. This change is related to NFS server, not client. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --P9KQiUGMzYCFwWCN Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkx5VTYACgkQForvXbEpPzTDwQCfQgfjyJdEoH2tfooA7EBmFw56 1OAAni3ekv9PIiA5aBWGfiHEJXFyt7Y7 =hzw4 -----END PGP SIGNATURE----- --P9KQiUGMzYCFwWCN-- From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 19:02:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3495C106564A; Sat, 28 Aug 2010 19:02:52 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 223188FC19; Sat, 28 Aug 2010 19:02:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7SJ2qjW040856; Sat, 28 Aug 2010 19:02:52 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7SJ2qD7040851; Sat, 28 Aug 2010 19:02:52 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201008281902.o7SJ2qD7040851@svn.freebsd.org> From: "Jayachandran C." Date: Sat, 28 Aug 2010 19:02:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211946 - in head/sys/mips/rmi: . dev/nlge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 19:02:52 -0000 Author: jchandra Date: Sat Aug 28 19:02:51 2010 New Revision: 211946 URL: http://svn.freebsd.org/changeset/base/211946 Log: New driver nlge for XLR/XLS Network Accelerator. This will support the XGMAC and XAUI 10G interfaces in addition RGMII/SGMII 1G interfaces. This driver is work in progress. board.c and board.h expanded to include more info. Only one of rge and nlge can be enabled at a time, rge will be deprecated when nlge stabilizes. Submitted by: Sriram Gorti Added: head/sys/mips/rmi/dev/nlge/ head/sys/mips/rmi/dev/nlge/if_nlge.c (contents, props changed) head/sys/mips/rmi/dev/nlge/if_nlge.h (contents, props changed) Modified: head/sys/mips/rmi/board.c head/sys/mips/rmi/board.h head/sys/mips/rmi/files.xlr head/sys/mips/rmi/iodi.c Modified: head/sys/mips/rmi/board.c ============================================================================== --- head/sys/mips/rmi/board.c Sat Aug 28 18:49:51 2010 (r211945) +++ head/sys/mips/rmi/board.c Sat Aug 28 19:02:51 2010 (r211946) @@ -78,13 +78,12 @@ static int xls_rxstn_to_txstn_map[128] = [120 ... 127] = TX_STN_SAE }; -struct stn_cc *xlr_core_cc_configs[] = {&cc_table_cpu_0, &cc_table_cpu_1, - &cc_table_cpu_2, &cc_table_cpu_3, - &cc_table_cpu_4, &cc_table_cpu_5, -&cc_table_cpu_6, &cc_table_cpu_7}; +struct stn_cc *xlr_core_cc_configs[] = { &cc_table_cpu_0, &cc_table_cpu_1, + &cc_table_cpu_2, &cc_table_cpu_3, &cc_table_cpu_4, &cc_table_cpu_5, + &cc_table_cpu_6, &cc_table_cpu_7}; -struct stn_cc *xls_core_cc_configs[] = {&xls_cc_table_cpu_0, &xls_cc_table_cpu_1, -&xls_cc_table_cpu_2, &xls_cc_table_cpu_3}; +struct stn_cc *xls_core_cc_configs[] = { &xls_cc_table_cpu_0, &xls_cc_table_cpu_1, + &xls_cc_table_cpu_2, &xls_cc_table_cpu_3 }; struct xlr_board_info xlr_board_info; @@ -98,6 +97,174 @@ xlr_pcmcia_present(void) return ((resetconf & 0x4000) != 0); } +static void +xlr_board_specific_overrides(struct xlr_board_info* board) +{ + struct xlr_gmac_block_t *blk1, *blk2; + + blk1 = &board->gmac_block[1]; + blk2 = &board->gmac_block[2]; + + switch (xlr_boot1_info.board_major_version) { + case RMI_XLR_BOARD_ARIZONA_I: + /* ATX-I has SPI-4, not XGMAC */ + blk1->type = XLR_SPI4; + blk1->enabled = 0; /* nlge does not + support SPI-4 */ + blk2->type = XLR_SPI4; + blk2->enabled = 0; + break; + + case RMI_XLR_BOARD_ARIZONA_II: + /* XGMII_A --> VSC7281, XGMII_B --> VSC7281 */ + blk1->enabled = 1; + blk1->num_ports = 1; + blk1->gmac_port[0].valid = 1; + + blk2->enabled = 1; + blk2->num_ports = 1; + blk2->gmac_port[0].valid = 1; + default: + break; + } +} + +static int +quad0_xaui(void) +{ + xlr_reg_t *gpio_mmio = + (unsigned int *)(DEFAULT_XLR_IO_BASE + XLR_IO_GPIO_OFFSET); + uint32_t bit24; + + bit24 = (xlr_read_reg(gpio_mmio, 0x15) >> 24) & 0x1; + return (bit24); +} + +static int +quad1_xaui(void) +{ + xlr_reg_t *gpio_mmio = + (unsigned int *)(DEFAULT_XLR_IO_BASE + XLR_IO_GPIO_OFFSET); + uint32_t bit25; + + bit25 = (xlr_read_reg(gpio_mmio, 0x15) >> 25) & 0x1; + return (bit25); +} + +static void +xls_board_specific_overrides(struct xlr_board_info* board) +{ + struct xlr_gmac_block_t *blk0, *blk1; + int i; + + blk0 = &board->gmac_block[0]; + blk1 = &board->gmac_block[1]; + + switch (xlr_boot1_info.board_major_version) { + case RMI_XLR_BOARD_ARIZONA_VI: + blk0->mode = XLR_PORT0_RGMII; + blk0->gmac_port[0].type = XLR_RGMII; + blk0->gmac_port[0].phy_addr = 0; + blk0->gmac_port[0].mii_addr = XLR_IO_GMAC_4_OFFSET; + /* Because of the Octal PHY, SGMII Quad1 is MII is also bound + * to the PHY attached to SGMII0_MDC/MDIO/MDINT. */ + for (i = 0; i < 4; i++) { + blk1->gmac_port[i].mii_addr = XLR_IO_GMAC_0_OFFSET; + blk1->gmac_port[i].serdes_addr = XLR_IO_GMAC_0_OFFSET; + } + blk1->gmac_port[1].mii_addr = XLR_IO_GMAC_0_OFFSET; + blk1->gmac_port[2].mii_addr = XLR_IO_GMAC_0_OFFSET; + blk1->gmac_port[3].mii_addr = XLR_IO_GMAC_0_OFFSET; + + blk1->gmac_port[1].serdes_addr = XLR_IO_GMAC_0_OFFSET; + blk1->gmac_port[2].serdes_addr = XLR_IO_GMAC_0_OFFSET; + blk1->gmac_port[3].serdes_addr = XLR_IO_GMAC_0_OFFSET; + + /* RGMII MDIO interrupt is thru NA1 and SGMII MDIO + * interrupts for ports in blk1 are from NA0 */ + blk0->gmac_port[0].mdint_id = 1; + + blk1->gmac_port[0].mdint_id = 0; + blk1->gmac_port[1].mdint_id = 0; + blk1->gmac_port[2].mdint_id = 0; + blk1->gmac_port[3].mdint_id = 0; + break; + + case RMI_XLR_BOARD_ARIZONA_VIII: + /* There is just one Octal PHY on the board and it is + * connected to the MII interface for NA Quad 0. */ + blk1->gmac_port[0].mii_addr = XLR_IO_GMAC_0_OFFSET; + blk1->gmac_port[1].mii_addr = XLR_IO_GMAC_0_OFFSET; + blk1->gmac_port[2].mii_addr = XLR_IO_GMAC_0_OFFSET; + blk1->gmac_port[3].mii_addr = XLR_IO_GMAC_0_OFFSET; + + /* Board 8.3 (Lite) has XLS108 */ + if (xlr_boot1_info.board_minor_version == 3) { + /* NA0 has 3 ports */ + blk0->gmac_port[3].valid = 1; + blk0->num_ports--; + /* NA1 is completely disabled */ + blk1->enabled = 0; + } + + break; + + case RMI_XLR_BOARD_ARIZONA_XI: + case RMI_XLR_BOARD_ARIZONA_XII: + if (quad0_xaui()) { /* GMAC ports 0-3 are set to XAUI */ + /* only GMAC0 is active i.e, the 0-th port on this quad. + * Disable all the other 7 possible ports. */ + for (i = 1; i < MAX_NA_PORTS; i++) { + memset(&blk0->gmac_port[i], 0, + sizeof(blk0->gmac_port[i])); + } + /* Setup for XAUI on N/w Acc0: gmac0 */ + blk0->type = XLR_XGMAC; + blk0->mode = XLR_XAUI; + blk0->num_ports = 1; + blk0->gmac_port[0].type = XLR_XAUI; + blk1->gmac_port[0].phy_addr = 16; + blk0->gmac_port[0].tx_bucket_id = blk0->station_txbase; + /* Other addresses etc need not be modified as XAUI_0 + * shares its addresses with SGMII GMAC_0, which was + * set in the caller. */ + } + else { + blk0->num_ports = 1; /* only 1 RGMII port */ + blk0->mode = XLR_PORT0_RGMII; + blk0->gmac_port[0].type = XLR_RGMII; + blk0->gmac_port[0].phy_addr = 0; + blk0->gmac_port[0].mii_addr = XLR_IO_GMAC_0_OFFSET; + } + + if (quad1_xaui()) { /* GMAC ports 4-7 are used for XAUI */ + /* only GMAC4 is active i.e, the 0-th port on this quad. + * Disable all the other 7 possible ports. */ + for (i = 1; i < MAX_NA_PORTS; i++) { + memset(&blk1->gmac_port[i], 0, + sizeof(blk1->gmac_port[i])); + } + /* Setup for XAUI on N/w Acc1: gmac4 */ + blk1->type = XLR_XGMAC; + blk1->mode = XLR_XAUI; + blk1->num_ports = 1; + /* XAUI and SGMII ports share FMN buckets on N/w Acc 1; + so, station_txbase, station_rfr need not be + patched up. */ + blk1->gmac_port[0].type = XLR_XAUI; + blk1->gmac_port[0].phy_addr = 16; + blk1->gmac_port[0].tx_bucket_id = blk1->station_txbase; + /* Other addresses etc need not be modified as XAUI_1 + * shares its addresses with SGMII GMAC_4, which was + * set in the caller. */ + } + break; + + default: + break; + } +} + /* * All our knowledge of chip and board that cannot be detected by probing * at run-time goes here @@ -105,6 +272,57 @@ xlr_pcmcia_present(void) int xlr_board_info_setup() { + struct xlr_gmac_block_t *blk0, *blk1, *blk2; + int i; + + /* This setup code is long'ish because the same base driver + * (if_nlge.c) is used for different: + * - CPUs (XLR/XLS) + * - boards (for each CPU, multiple board configs are possible + * and available). + * + * At the time of writing, there are atleast 12 boards, 4 with XLR + * and 8 with XLS. This means that the base driver needs to work with + * 12 different configurations, with varying levels of differences. + * To accomodate the different configs, the xlr_board_info struct + * has various attributes for paramters that could be different. + * These attributes are setup here and can be used directly in the + * base driver. + * It was seen that the setup code is not entirely trivial and + * it is possible to organize it in different ways. In the following, + * we choose an approach that sacrifices code-compactness/speed for + * readability. This is because configuration code executes once + * per reboot and hence has a minimal performance impact. + * On the other hand, driver debugging/enhancements require + * that different engineers can quickly comprehend the setup + * sequence. Hence, readability is seen as the key requirement for + * this code. It is for the reader to decide how much of this + * requirement is met with the current code organization !! + * + * The initialization is organized thus: + * + * if (CPU is XLS) { + * // initialize per XLS architecture + * // default inits (per chip spec) + * // board-specific overrides + * } else if (CPU is XLR) { + * // initialize per XLR architecture + * // default inits (per chip spec) + * // board-specific overrides + * } + * + * Within each CPU-specific initialization, all the default + * initializations are done first. This is followed up with + * board specific overrides. + */ + + /* start with a clean slate */ + memset(&xlr_board_info, 0, sizeof(xlr_board_info)); + xlr_board_info.ata = xlr_pcmcia_present(); + + blk0 = &xlr_board_info.gmac_block[0]; + blk1 = &xlr_board_info.gmac_block[1]; + blk2 = &xlr_board_info.gmac_block[2]; if (xlr_is_xls()) { xlr_board_info.is_xls = 1; @@ -113,98 +331,154 @@ xlr_board_info_setup() /* Board version 8 has NAND flash */ xlr_board_info.cfi = (xlr_boot1_info.board_major_version != RMI_XLR_BOARD_ARIZONA_VIII); - xlr_board_info.ata = xlr_pcmcia_present(); xlr_board_info.pci_irq = 0; xlr_board_info.credit_configs = xls_core_cc_configs; - xlr_board_info.bucket_sizes = &xls_bucket_sizes; - xlr_board_info.msgmap = xls_rxstn_to_txstn_map; - xlr_board_info.gmacports = 8; - - /* network block 0 */ - xlr_board_info.gmac_block[0].type = XLR_GMAC; - xlr_board_info.gmac_block[0].enabled = 0xf; - xlr_board_info.gmac_block[0].credit_config = &xls_cc_table_gmac0; - xlr_board_info.gmac_block[0].station_txbase = MSGRNG_STNID_GMACTX0; - xlr_board_info.gmac_block[0].station_rfr = MSGRNG_STNID_GMACRFR_0; - if (xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_VI || - xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_XI || - xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_XII) - xlr_board_info.gmac_block[0].mode = XLR_PORT0_RGMII; - else - xlr_board_info.gmac_block[0].mode = XLR_SGMII; - xlr_board_info.gmac_block[0].baseaddr = XLR_IO_GMAC_0_OFFSET; - xlr_board_info.gmac_block[0].baseirq = PIC_GMAC_0_IRQ; - xlr_board_info.gmac_block[0].baseinst = 0; - - /* network block 1 */ - xlr_board_info.gmac_block[1].type = XLR_GMAC; - xlr_board_info.gmac_block[1].enabled = xlr_is_xls1xx() ? 0 : 0xf; - if (xlr_is_xls4xx_lite()) { - xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_GPIO_OFFSET); - uint32_t tmp; - - /* some ports are not enabled on the condor 4xx, figure this - out from the GPIO fuse bank */ - tmp = xlr_read_reg(mmio, 35); - if (tmp & (1<<28)) - xlr_board_info.gmac_block[1].enabled &= ~0x8; - if (tmp & (1<<29)) - xlr_board_info.gmac_block[1].enabled &= ~0x4; - } - xlr_board_info.gmac_block[1].credit_config = &xls_cc_table_gmac1; - xlr_board_info.gmac_block[1].station_txbase = MSGRNG_STNID_GMAC1_TX0; - xlr_board_info.gmac_block[1].station_rfr = MSGRNG_STNID_GMAC1_FR_0; - xlr_board_info.gmac_block[1].mode = XLR_SGMII; - xlr_board_info.gmac_block[1].baseaddr = XLR_IO_GMAC_4_OFFSET; - xlr_board_info.gmac_block[1].baseirq = PIC_XGS_0_IRQ; - xlr_board_info.gmac_block[1].baseinst = 4; - - /* network block 2 */ - xlr_board_info.gmac_block[2].enabled = 0; /* disabled on XLS */ - } else { + xlr_board_info.bucket_sizes = &xls_bucket_sizes; + xlr_board_info.msgmap = xls_rxstn_to_txstn_map; + xlr_board_info.gmacports = MAX_NA_PORTS; + + /* ---------------- Network Acc 0 ---------------- */ + + blk0->type = XLR_GMAC; + blk0->enabled = 0xf; + blk0->credit_config = &xls_cc_table_gmac0; + blk0->station_id = TX_STN_GMAC0; + blk0->station_txbase = MSGRNG_STNID_GMACTX0; + blk0->station_rfr = MSGRNG_STNID_GMACRFR_0; + blk0->mode = XLR_SGMII; + blk0->baseaddr = XLR_IO_GMAC_0_OFFSET; + blk0->baseirq = PIC_GMAC_0_IRQ; + blk0->baseinst = 0; + + /* By default, assume SGMII is setup. But this can change based + on board-specific or setting-specific info. */ + for (i = 0; i < 4; i++) { + blk0->gmac_port[i].valid = 1; + blk0->gmac_port[i].instance = i + blk0->baseinst; + blk0->gmac_port[i].type = XLR_SGMII; + blk0->gmac_port[i].phy_addr = i + 16; + blk0->gmac_port[i].tx_bucket_id = + blk0->station_txbase + i; + blk0->gmac_port[i].mdint_id = 0; + blk0->num_ports++; + blk0->gmac_port[i].base_addr = XLR_IO_GMAC_0_OFFSET + i * 0x1000; + blk0->gmac_port[i].mii_addr = XLR_IO_GMAC_0_OFFSET; + blk0->gmac_port[i].pcs_addr = XLR_IO_GMAC_0_OFFSET; + blk0->gmac_port[i].serdes_addr = XLR_IO_GMAC_0_OFFSET; + } + + /* ---------------- Network Acc 1 ---------------- */ + blk1->type = XLR_GMAC; + blk1->enabled = 0xf; + blk1->credit_config = &xls_cc_table_gmac1; + blk1->station_id = TX_STN_GMAC1; + blk1->station_txbase = MSGRNG_STNID_GMAC1_TX0; + blk1->station_rfr = MSGRNG_STNID_GMAC1_FR_0; + blk1->mode = XLR_SGMII; + blk1->baseaddr = XLR_IO_GMAC_4_OFFSET; + blk1->baseirq = PIC_XGS_0_IRQ; + blk1->baseinst = 4; + + for (i = 0; i < 4; i++) { + blk1->gmac_port[i].valid = 1; + blk1->gmac_port[i].instance = i + blk1->baseinst; + blk1->gmac_port[i].type = XLR_SGMII; + blk1->gmac_port[i].phy_addr = i + 20; + blk1->gmac_port[i].tx_bucket_id = + blk1->station_txbase + i; + blk1->gmac_port[i].mdint_id = 1; + blk1->num_ports++; + blk1->gmac_port[i].base_addr = XLR_IO_GMAC_4_OFFSET + i * 0x1000; + blk1->gmac_port[i].mii_addr = XLR_IO_GMAC_4_OFFSET; + blk1->gmac_port[i].pcs_addr = XLR_IO_GMAC_4_OFFSET; + blk1->gmac_port[i].serdes_addr = XLR_IO_GMAC_0_OFFSET; + } + + /* ---------------- Network Acc 2 ---------------- */ + xlr_board_info.gmac_block[2].enabled = 0; /* disabled on XLS */ + + xls_board_specific_overrides(&xlr_board_info); + + } else { /* XLR */ xlr_board_info.is_xls = 0; xlr_board_info.nr_cpus = 32; xlr_board_info.usb = 0; xlr_board_info.cfi = 1; - xlr_board_info.ata = xlr_pcmcia_present(); xlr_board_info.pci_irq = 0; xlr_board_info.credit_configs = xlr_core_cc_configs; - xlr_board_info.bucket_sizes = &bucket_sizes; - xlr_board_info.msgmap = xlr_rxstn_to_txstn_map; - xlr_board_info.gmacports = 4; - - /* GMAC0 */ - xlr_board_info.gmac_block[0].type = XLR_GMAC; - xlr_board_info.gmac_block[0].enabled = 0xf; - xlr_board_info.gmac_block[0].credit_config = &cc_table_gmac; - xlr_board_info.gmac_block[0].station_txbase = MSGRNG_STNID_GMACTX0; - xlr_board_info.gmac_block[0].station_rfr = MSGRNG_STNID_GMACRFR_0; - xlr_board_info.gmac_block[0].mode = XLR_RGMII; - xlr_board_info.gmac_block[0].baseaddr = XLR_IO_GMAC_0_OFFSET; - xlr_board_info.gmac_block[0].baseirq = PIC_GMAC_0_IRQ; - xlr_board_info.gmac_block[0].baseinst = 0; - - /* XGMAC0 */ - xlr_board_info.gmac_block[1].type = XLR_XGMAC; - xlr_board_info.gmac_block[1].enabled = 1; - xlr_board_info.gmac_block[1].credit_config = &cc_table_xgs_0; - xlr_board_info.gmac_block[1].station_txbase = MSGRNG_STNID_XGS0_TX; - xlr_board_info.gmac_block[1].station_rfr = MSGRNG_STNID_XGS0FR; - xlr_board_info.gmac_block[1].mode = -1; - xlr_board_info.gmac_block[1].baseaddr = XLR_IO_XGMAC_0_OFFSET; - xlr_board_info.gmac_block[1].baseirq = PIC_XGS_0_IRQ; - xlr_board_info.gmac_block[1].baseinst = 4; - - /* XGMAC1 */ - xlr_board_info.gmac_block[2].type = XLR_XGMAC; - xlr_board_info.gmac_block[2].enabled = 1; - xlr_board_info.gmac_block[2].credit_config = &cc_table_xgs_1; - xlr_board_info.gmac_block[2].station_txbase = MSGRNG_STNID_XGS1_TX; - xlr_board_info.gmac_block[2].station_rfr = MSGRNG_STNID_XGS1FR; - xlr_board_info.gmac_block[2].mode = -1; - xlr_board_info.gmac_block[2].baseaddr = XLR_IO_XGMAC_1_OFFSET; - xlr_board_info.gmac_block[2].baseirq = PIC_XGS_1_IRQ; - xlr_board_info.gmac_block[2].baseinst = 5; - } - return 0; + xlr_board_info.bucket_sizes = &bucket_sizes; + xlr_board_info.msgmap = xlr_rxstn_to_txstn_map; + xlr_board_info.gmacports = 4; + + /* ---------------- GMAC0 ---------------- */ + blk0->type = XLR_GMAC; + blk0->enabled = 0xf; + blk0->credit_config = &cc_table_gmac; + blk0->station_id = TX_STN_GMAC; + blk0->station_txbase = MSGRNG_STNID_GMACTX0; + blk0->station_rfr = MSGRNG_STNID_GMACRFR_0; + blk0->mode = XLR_RGMII; + blk0->baseaddr = XLR_IO_GMAC_0_OFFSET; + blk0->baseirq = PIC_GMAC_0_IRQ; + blk0->baseinst = 0; + + /* first, do the common/easy stuff for all the ports */ + for (i = 0; i < 4; i++) { + blk0->gmac_port[i].valid = 1; + blk0->gmac_port[i].instance = i + blk0->baseinst; + blk0->gmac_port[i].type = XLR_RGMII; + blk0->gmac_port[i].phy_addr = i; + blk0->gmac_port[i].tx_bucket_id = + blk0->station_txbase + i; + blk0->gmac_port[i].mdint_id = 0; + blk0->gmac_port[i].base_addr = XLR_IO_GMAC_0_OFFSET + i * 0x1000; + blk0->gmac_port[i].mii_addr = XLR_IO_GMAC_0_OFFSET; + /* RGMII ports, no PCS/SERDES */ + blk0->num_ports++; + } + + /* ---------------- XGMAC0 ---------------- */ + blk1->type = XLR_XGMAC; + blk1->mode = XLR_XGMII; + blk1->enabled = 0; + blk1->credit_config = &cc_table_xgs_0; + blk1->station_txbase = MSGRNG_STNID_XGS0_TX; + blk1->station_rfr = MSGRNG_STNID_XMAC0RFR; + blk1->station_id = TX_STN_XGS_0; /* TBD: is this correct ? */ + blk1->baseaddr = XLR_IO_XGMAC_0_OFFSET; + blk1->baseirq = PIC_XGS_0_IRQ; + blk1->baseinst = 4; + + blk1->gmac_port[0].type = XLR_XGMII; + blk1->gmac_port[0].instance = 0; + blk1->gmac_port[0].phy_addr = 0; + blk1->gmac_port[0].base_addr = XLR_IO_XGMAC_0_OFFSET; + blk1->gmac_port[0].mii_addr = XLR_IO_XGMAC_0_OFFSET; + blk1->gmac_port[0].tx_bucket_id = blk1->station_txbase; + blk1->gmac_port[0].mdint_id = 1; + + /* ---------------- XGMAC1 ---------------- */ + blk2->type = XLR_XGMAC; + blk2->mode = XLR_XGMII; + blk2->enabled = 0; + blk2->credit_config = &cc_table_xgs_1; + blk2->station_txbase = MSGRNG_STNID_XGS1_TX; + blk2->station_rfr = MSGRNG_STNID_XMAC1RFR; + blk2->station_id = TX_STN_XGS_1; /* TBD: is this correct ? */ + blk2->baseaddr = XLR_IO_XGMAC_1_OFFSET; + blk2->baseirq = PIC_XGS_1_IRQ; + blk2->baseinst = 5; + + blk2->gmac_port[0].type = XLR_XGMII; + blk2->gmac_port[0].instance = 0; + blk2->gmac_port[0].phy_addr = 0; + blk2->gmac_port[0].base_addr = XLR_IO_XGMAC_1_OFFSET; + blk2->gmac_port[0].mii_addr = XLR_IO_XGMAC_1_OFFSET; + blk2->gmac_port[0].tx_bucket_id = blk2->station_txbase; + blk2->gmac_port[0].mdint_id = 2; + + /* Done with default setup. Now do board-specific tweaks. */ + xlr_board_specific_overrides(&xlr_board_info); + } + return 0; } Modified: head/sys/mips/rmi/board.h ============================================================================== --- head/sys/mips/rmi/board.h Sat Aug 28 18:49:51 2010 (r211945) +++ head/sys/mips/rmi/board.h Sat Aug 28 19:02:51 2010 (r211946) @@ -132,41 +132,53 @@ xlr_is_xls4xx_lite(void) uint32_t chipid = xlr_processor_id(); return (chipid == 0x88 || chipid == 0x8c); -} + } + +/* SPI-4 --> 8 ports, 1G MAC --> 4 ports and 10G MAC --> 1 port */ +#define MAX_NA_PORTS 8 /* all our knowledge of chip and board that cannot be detected run-time goes here */ -enum gmac_block_types { - XLR_GMAC, XLR_XGMAC, XLR_SPI4 -}; - -enum gmac_block_modes { - XLR_RGMII, XLR_SGMII, XLR_PORT0_RGMII -}; +enum gmac_block_types { XLR_GMAC, XLR_XGMAC, XLR_SPI4}; +enum gmac_port_types { XLR_RGMII, XLR_SGMII, XLR_PORT0_RGMII, XLR_XGMII, XLR_XAUI }; struct xlr_board_info { int is_xls; int nr_cpus; - int usb; /* usb enabled ? */ - int cfi; /* NOR flash */ - int ata; /* PCMCIA/compactflash driver */ + int usb; /* usb enabled ? */ + int cfi; /* compact flash driver for NOR? */ + int ata; /* ata driver */ int pci_irq; - struct stn_cc **credit_configs; /* pointer to Core station credits */ - struct bucket_size *bucket_sizes; /* pointer to Core station - * bucket */ - int *msgmap; /* mapping of message station to devices */ - int gmacports; /* number of gmac ports on the board */ - struct xlr_gmac_block_t { - int type; /* see enum gmac_block_types */ - unsigned int enabled; /* mask of ports enabled */ - struct stn_cc *credit_config; /* credit configuration */ - int station_txbase; /* station id for tx */ - int station_rfr;/* free desc bucket */ - int mode; /* see gmac_block_modes */ - uint32_t baseaddr; /* IO base */ - int baseirq; /* first irq for this block, the rest are in - * sequence */ - int baseinst; /* the first rge unit for this block */ - } gmac_block[3]; + struct stn_cc **credit_configs; /* pointer to Core station credits */ + struct bucket_size *bucket_sizes; /* pointer to Core station bucket */ + int *msgmap; /* mapping of message station to devices */ + int gmacports; /* number of gmac ports on the board */ + struct xlr_gmac_block_t { /* refers to the set of GMACs controlled by a + network accelarator */ + int type; /* see enum gmac_block_types */ + unsigned int enabled; /* mask of ports enabled */ + struct stn_cc *credit_config; /* credit configuration */ + int station_id; /* station id for sending msgs */ + int station_txbase; /* station id for tx */ + int station_rfr; /* free desc bucket */ + int mode; /* see gmac_block_modes */ + uint32_t baseaddr; /* IO base */ + int baseirq; /* first irq for this block, the rest are in sequence */ + int baseinst; /* the first rge unit for this block */ + int num_ports; + struct xlr_gmac_port { + int valid; + int type; /* see enum gmac_port_types */ + uint32_t instance; /* identifies the GMAC to which + this port is bound to. */ + uint32_t phy_addr; + uint32_t base_addr; + uint32_t mii_addr; + uint32_t pcs_addr; + uint32_t serdes_addr; + uint32_t tx_bucket_id; + uint32_t mdint_id; + } gmac_port[MAX_NA_PORTS]; + } gmac_block [3]; }; extern struct xlr_board_info xlr_board_info; Added: head/sys/mips/rmi/dev/nlge/if_nlge.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/rmi/dev/nlge/if_nlge.c Sat Aug 28 19:02:51 2010 (r211946) @@ -0,0 +1,2444 @@ +/*- + * Copyright (c) 2003-2009 RMI Corporation + * 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. Neither the name of RMI Corporation, nor the names of its contributors, + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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. + * + * RMI_BSD */ + +/* + * The XLR device supports upto four 10/100/1000 Ethernet MACs and upto + * two 10G Ethernet MACs (of XGMII). Alternatively, each 10G port can used + * as a SPI-4 interface, with 8 ports per such interface. The MACs are + * encapsulated in another hardware block referred to as network accelerator, + * such that there are three instances of these in a XLR. One of them controls + * the four 1G RGMII ports while one each of the others controls an XGMII port. + * Enabling MACs requires configuring the corresponding network accelerator + * and the individual port. + * The XLS device supports upto 8 10/100/1000 Ethernet MACs or max 2 10G + * Ethernet MACs. The 1G MACs are of SGMII and 10G MACs are of XAUI + * interface. These ports are part of two network accelerators. + * The nlge driver configures and initializes non-SPI4 Ethernet ports in the + * XLR/XLS devices and enables data transfer on them. + */ + +#include +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_device_polling.h" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define __RMAN_RESOURCE_VISIBLE +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include /* for DELAY */ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include "miidevs.h" +#include +#include "miibus_if.h" + +#include + +MODULE_DEPEND(nlna, nlge, 1, 1, 1); +MODULE_DEPEND(nlge, ether, 1, 1, 1); +MODULE_DEPEND(nlge, miibus, 1, 1, 1); + +/* Network accelarator entry points */ +static int nlna_probe(device_t); +static int nlna_attach(device_t); +static int nlna_detach(device_t); +static int nlna_suspend(device_t); +static int nlna_resume(device_t); +static int nlna_shutdown(device_t); + +/* GMAC port entry points */ +static int nlge_probe(device_t); +static int nlge_attach(device_t); +static int nlge_detach(device_t); +static int nlge_suspend(device_t); +static int nlge_resume(device_t); +static void nlge_init(void *); +static int nlge_ioctl(struct ifnet *, u_long, caddr_t); +static void nlge_start(struct ifnet *); +static void nlge_rx(struct nlge_softc *sc, vm_paddr_t paddr, int len); + +static int nlge_mii_write(struct device *, int, int, int); +static int nlge_mii_read(struct device *, int, int); +static void nlge_mac_mii_statchg(device_t); +static int nlge_mediachange(struct ifnet *ifp); +static void nlge_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr); + +/* Other internal/helper functions */ +static void *get_buf(void); +static struct mbuf *get_mbuf(void); + +static void nlna_add_to_port_set(struct nlge_port_set *pset, + struct nlge_softc *sc); +static void nlna_config_pde(struct nlna_softc *); +static void nlna_config_parser(struct nlna_softc *); +static void nlna_config_classifier(struct nlna_softc *); +static void nlna_config_fifo_spill_area(struct nlna_softc *sc); +static void nlna_config_common(struct nlna_softc *); +static void nlna_disable_ports(struct nlna_softc *sc); +static void nlna_enable_intr(struct nlna_softc *sc); +static void nlna_disable_intr(struct nlna_softc *sc); +static void nlna_enable_ports(struct nlna_softc *sc); +static void nlna_get_all_softc(device_t iodi_dev, + struct nlna_softc **sc_vec, uint32_t vec_sz); +static void nlna_hw_init(struct nlna_softc *sc); +static int nlna_is_last_active_na(struct nlna_softc *sc); +static void nlna_media_specific_config(struct nlna_softc *sc); +static void nlna_reset_ports(struct nlna_softc *sc, + struct xlr_gmac_block_t *blk); +static struct nlna_softc *nlna_sc_init(device_t dev, + struct xlr_gmac_block_t *blk); +static __inline__ int nlna_send_free_desc(struct nlna_softc *nlna, + vm_paddr_t addr); +static void nlna_setup_intr(struct nlna_softc *sc); +static void nlna_smp_update_pde(void *dummy __unused); +static void nlna_submit_rx_free_desc(struct nlna_softc *sc, + uint32_t n_desc); + +static int nlge_gmac_config_speed(struct nlge_softc *, int quick); +static void nlge_hw_init(struct nlge_softc *sc); +static int nlge_if_init(struct nlge_softc *sc); +static void nlge_intr(void *arg); +static int nlge_irq_init(struct nlge_softc *sc); +static void nlge_irq_fini(struct nlge_softc *sc); +static void nlge_media_specific_init(struct nlge_softc *sc); +static void nlge_mii_init(device_t dev, struct nlge_softc *sc); +static int nlge_mii_read_internal(xlr_reg_t *mii_base, int phyaddr, + int regidx); +static void nlge_mii_write_internal(xlr_reg_t *mii_base, int phyaddr, + int regidx, int regval); +void nlge_msgring_handler(int bucket, int size, int code, + int stid, struct msgrng_msg *msg, void *data); +static void nlge_port_disable(int id, xlr_reg_t *base, int port_type); +static void nlge_port_enable(struct nlge_softc *sc); +static void nlge_read_mac_addr(struct nlge_softc *sc); +static void nlge_sc_init(struct nlge_softc *sc, device_t dev, + struct xlr_gmac_port *port_info); +static void nlge_set_mac_addr(struct nlge_softc *sc); +static void nlge_set_port_attribs(struct nlge_softc *, + struct xlr_gmac_port *); +static void nlge_sgmii_init(struct nlge_softc *sc); +static void nlge_start_locked(struct ifnet *ifp, struct nlge_softc *sc); + +static int prepare_fmn_message(struct nlge_softc *sc, + struct msgrng_msg *msg, uint32_t *n_entries, struct mbuf *m_head, + uint64_t fr_stid, struct nlge_tx_desc **tx_desc); + +static void release_mbuf(uint64_t phy_addr); +static void release_tx_desc(struct msgrng_msg *msg, int rel_buf); +static int send_fmn_msg_tx(struct nlge_softc *, struct msgrng_msg *, + uint32_t n_entries); + +//#define DEBUG +#ifdef DEBUG +static int mac_debug = 1; +static int reg_dump = 0; +#undef PDEBUG +#define PDEBUG(fmt, args...) \ + do {\ + if (mac_debug) {\ + printf("[%s@%d|%s]: cpu_%d: " fmt, \ + __FILE__, __LINE__, __FUNCTION__, PCPU_GET(cpuid), ##args);\ + }\ + } while(0); + +/* Debug/dump functions */ +static void dump_reg(xlr_reg_t *addr, uint32_t offset, char *name); +static void dump_gmac_registers(struct nlge_softc *); +static void dump_na_registers(xlr_reg_t *base, int port_id); +static void dump_mac_stats(struct nlge_softc *sc); +static void dump_mii_regs(struct nlge_softc *sc) __attribute__((used)); +static void dump_mii_data(struct mii_data *mii) __attribute__((used)); +static void dump_board_info(struct xlr_board_info *); +static void dump_pcs_regs(struct nlge_softc *sc, int phy); + +#else +#undef PDEBUG +#define PDEBUG(fmt, args...) +#define dump_reg(a, o, n) /* nop */ +#define dump_gmac_registers(a) /* nop */ +#define dump_na_registers(a, p) /* nop */ +#define dump_board_info(b) /* nop */ +#define dump_mac_stats(sc) /* nop */ +#define dump_mii_regs(sc) /* nop */ +#define dump_mii_data(mii) /* nop */ +#define dump_pcs_regs(sc, phy) /* nop */ +#endif + +/* Wrappers etc. to export the driver entry points. */ +static device_method_t nlna_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, nlna_probe), + DEVMETHOD(device_attach, nlna_attach), + DEVMETHOD(device_detach, nlna_detach), + DEVMETHOD(device_shutdown, nlna_shutdown), + DEVMETHOD(device_suspend, nlna_suspend), + DEVMETHOD(device_resume, nlna_resume), + + /* bus interface : TBD : what are these for ? */ + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(bus_driver_added, bus_generic_driver_added), + + { 0, 0 } +}; + +static driver_t nlna_driver = { + "nlna", + nlna_methods, + sizeof(struct nlna_softc) +}; + +static devclass_t nlna_devclass; + +static device_method_t nlge_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, nlge_probe), + DEVMETHOD(device_attach, nlge_attach), + DEVMETHOD(device_detach, nlge_detach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, nlge_suspend), + DEVMETHOD(device_resume, nlge_resume), + + /* MII interface */ + DEVMETHOD(miibus_readreg, nlge_mii_read), + DEVMETHOD(miibus_writereg, nlge_mii_write), + DEVMETHOD(miibus_statchg, nlge_mac_mii_statchg), + + {0, 0} +}; + +static driver_t nlge_driver = { + "nlge", + nlge_methods, + sizeof(struct nlge_softc) +}; + +static devclass_t nlge_devclass; + +DRIVER_MODULE(nlna, iodi, nlna_driver, nlna_devclass, 0, 0); +DRIVER_MODULE(nlge, nlna, nlge_driver, nlge_devclass, 0, 0); +DRIVER_MODULE(miibus, nlge, miibus_driver, miibus_devclass, 0, 0); + +static uma_zone_t nl_tx_desc_zone; + +/* Function to atomically increment an integer with the given value. */ +static __inline__ unsigned int +ldadd_wu(unsigned int value, unsigned long *addr) +{ + __asm__ __volatile__( ".set push\n" + ".set noreorder\n" + "move $8, %2\n" + "move $9, %3\n" + /* "ldaddwu $8, $9\n" */ + ".word 0x71280011\n" + "move %0, $8\n" + ".set pop\n" + : "=&r"(value), "+m"(*addr) + : "0"(value), "r" ((unsigned long)addr) + : "$8", "$9"); + return value; +} + +static __inline__ uint32_t +xlr_enable_kx(void) +{ + uint32_t sr = mips_rd_status(); + + mips_wr_status((sr & ~MIPS_SR_INT_IE) | MIPS_SR_KX); + return sr; +} + +static int +nlna_probe(device_t dev) +{ + return (BUS_PROBE_DEFAULT); +} + +/* + * Add all attached GMAC/XGMAC ports to the device tree. Port + * configuration is spread in two regions - common configuration + * for all ports in the NA and per-port configuration in MAC-specific + * region. This function does the following: + * - adds the ports to the device tree + * - reset the ports + * - do all the common initialization + * - invoke bus_generic_attach for per-port configuration + * - supply initial free rx descriptors to ports + * - initialize s/w data structures + * - finally, enable interrupts (only in the last NA). + * + * For reference, sample address space for common and per-port + * registers is given below. + * + * The address map for RNA0 is: (typical value) + * + * XLR_IO_BASE +--------------------------------------+ 0xbef0_0000 + * | | + * | | + * | | + * | | + * | | + * | | + * GMAC0 ---> +--------------------------------------+ 0xbef0_c000 + * | | + * | | + * (common) -> |......................................| 0xbef0_c400 + * | | + * | (RGMII/SGMII: common registers) | + * | | + * GMAC1 ---> |--------------------------------------| 0xbef0_d000 + * | | + * | | + * (common) -> |......................................| 0xbef0_d400 + * | | + * | (RGMII/SGMII: common registers) | + * | | + * |......................................| + * and so on .... + * + * Ref: Figure 14-3 and Table 14-1 of XLR PRM + */ +static int +nlna_attach(device_t dev) +{ + struct xlr_gmac_block_t *block_info; + device_t gmac_dev; + struct nlna_softc *sc; + int error; + int i; + int id; + + id = device_get_unit(dev); + block_info = device_get_ivars(dev); + if (!block_info->enabled) { + return 0; + } + +#ifdef DEBUG + dump_board_info(&xlr_board_info); +#endif + block_info->baseaddr += DEFAULT_XLR_IO_BASE; + + /* Initialize nlna state in softc structure */ + sc = nlna_sc_init(dev, block_info); + + /* Add device's for the ports controlled by this NA. */ + if (block_info->type == XLR_GMAC) { + KASSERT(id < 2, ("No GMACs supported with this network" + "accelerator: %d", id)); + for (i = 0; i < sc->num_ports; i++) { + gmac_dev = device_add_child(dev, "nlge", -1); + device_set_ivars(gmac_dev, &block_info->gmac_port[i]); + } + } else if (block_info->type == XLR_XGMAC) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 19:28:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A562810656A7; Sat, 28 Aug 2010 19:28:12 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 94CA18FC0C; Sat, 28 Aug 2010 19:28:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7SJSCeQ041367; Sat, 28 Aug 2010 19:28:12 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7SJSCva041365; Sat, 28 Aug 2010 19:28:12 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008281928.o7SJSCva041365@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 28 Aug 2010 19:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211947 - head/sys/cddl/contrib/opensolaris/uts/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 19:28:12 -0000 Author: pjd Date: Sat Aug 28 19:28:12 2010 New Revision: 211947 URL: http://svn.freebsd.org/changeset/base/211947 Log: Move ZUT_OBJS in the same place that is used in vendor code. Obtained from: //depot/user/pjd/zfs/... Modified: head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Modified: head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Sat Aug 28 19:02:51 2010 (r211946) +++ head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Sat Aug 28 19:28:12 2010 (r211947) @@ -19,9 +19,6 @@ # CDDL HEADER END # -ZUT_OBJS += \ - zut.o - # # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. @@ -109,3 +106,6 @@ ZFS_OBJS += \ zfs_vfsops.o \ zfs_vnops.o \ zvol.o + +ZUT_OBJS += \ + zut.o From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 19:29:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC0F510656AB; Sat, 28 Aug 2010 19:29:06 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BA498FC1D; Sat, 28 Aug 2010 19:29:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7SJT6Qm041418; Sat, 28 Aug 2010 19:29:06 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7SJT65b041416; Sat, 28 Aug 2010 19:29:06 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008281929.o7SJT65b041416@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 28 Aug 2010 19:29:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211948 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 19:29:06 -0000 Author: pjd Date: Sat Aug 28 19:29:06 2010 New Revision: 211948 URL: http://svn.freebsd.org/changeset/base/211948 Log: Return NULL pointer instead of B_FALSE as it is done in the vendor code. Obtained from: //depot/user/pjd/zfs/... Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c Sat Aug 28 19:28:12 2010 (r211947) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c Sat Aug 28 19:29:06 2010 (r211948) @@ -82,7 +82,7 @@ rrn_find(rrwlock_t *rrl) rrw_node_t *rn; if (refcount_count(&rrl->rr_linked_rcount) == 0) - return (B_FALSE); + return (NULL); for (rn = tsd_get(rrw_tsd_key); rn != NULL; rn = rn->rn_next) { if (rn->rn_rrl == rrl) From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 19:29:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B11410656A8; Sat, 28 Aug 2010 19:29:44 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id A6AEB8FC1C; Sat, 28 Aug 2010 19:29:43 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id D58AE45EB2; Sat, 28 Aug 2010 21:29:41 +0200 (CEST) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 3890445E86; Sat, 28 Aug 2010 21:29:36 +0200 (CEST) Date: Sat, 28 Aug 2010 21:29:28 +0200 From: Pawel Jakub Dawidek To: Martin Matuska Message-ID: <20100828192928.GN2077@garage.freebsd.pl> References: <201008280924.o7S9OBgU025468@svn.freebsd.org> <20100828174039.GK2077@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="H7cT1SUwsqXggVRO" Content-Disposition: inline In-Reply-To: <20100828174039.GK2077@garage.freebsd.pl> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211932 - in head/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 19:29:44 -0000 --H7cT1SUwsqXggVRO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Aug 28, 2010 at 07:40:39PM +0200, Pawel Jakub Dawidek wrote: > Those two chunks are incorrect, please consult my p4 branch. I just went ahead and fixed those. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --H7cT1SUwsqXggVRO Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkx5Y5cACgkQForvXbEpPzQrgQCfeZY1S8S9uyqsoqnTXArpD2tB 8YwAn1IZBplES+Pq8By/GK1WrW6o4n6m =xGsX -----END PGP SIGNATURE----- --H7cT1SUwsqXggVRO-- From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 19:41:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 862D310656AA; Sat, 28 Aug 2010 19:41:39 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (core.vx.sk [IPv6:2a01:4f8:100:1043::2]) by mx1.freebsd.org (Postfix) with ESMTP id 147BB8FC18; Sat, 28 Aug 2010 19:41:39 +0000 (UTC) Received: from core.vx.sk (localhost [127.0.0.1]) by mail.vx.sk (Postfix) with ESMTP id 3561CE962B; Sat, 28 Aug 2010 21:41:38 +0200 (CEST) X-Virus-Scanned: amavisd-new at mail.vx.sk Received: from mail.vx.sk ([127.0.0.1]) by core.vx.sk (mail.vx.sk [127.0.0.1]) (amavisd-new, port 10024) with LMTP id fi9EvpMI5Vwz; Sat, 28 Aug 2010 21:41:36 +0200 (CEST) Received: from [10.9.8.1] (188-167-78-139.dynamic.chello.sk [188.167.78.139]) by mail.vx.sk (Postfix) with ESMTPSA id B141BE9621; Sat, 28 Aug 2010 21:41:35 +0200 (CEST) Message-ID: <4C796673.1090908@FreeBSD.org> Date: Sat, 28 Aug 2010 21:41:39 +0200 From: Martin Matuska User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; sk; rv:1.8.1.23) Gecko/20090812 Lightning/0.9 Thunderbird/2.0.0.23 Mnenhy/0.7.5.0 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201008280924.o7S9OBgU025468@svn.freebsd.org> <20100828174039.GK2077@garage.freebsd.pl> <20100828192928.GN2077@garage.freebsd.pl> In-Reply-To: <20100828192928.GN2077@garage.freebsd.pl> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=windows-1250 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211932 - in head/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 19:41:39 -0000 Thank you, committed just minutes ahead of me :-) Both mistakes are due to a mis-patch. I will include the fixed version it in the post-v15 merge. Dňa 28. 8. 2010 21:29, Pawel Jakub Dawidek wrote / napísal(a): > On Sat, Aug 28, 2010 at 07:40:39PM +0200, Pawel Jakub Dawidek wrote: >> Those two chunks are incorrect, please consult my p4 branch. > I just went ahead and fixed those. > From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 19:44:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9501D106566C; Sat, 28 Aug 2010 19:44:21 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 3A50C8FC17; Sat, 28 Aug 2010 19:44:21 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id BF21545C89; Sat, 28 Aug 2010 21:44:19 +0200 (CEST) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id D7E7945684; Sat, 28 Aug 2010 21:44:14 +0200 (CEST) Date: Sat, 28 Aug 2010 21:44:06 +0200 From: Pawel Jakub Dawidek To: Martin Matuska Message-ID: <20100828194406.GO2077@garage.freebsd.pl> References: <201008280924.o7S9OBgU025468@svn.freebsd.org> <20100828174039.GK2077@garage.freebsd.pl> <20100828192928.GN2077@garage.freebsd.pl> <4C796673.1090908@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vNrHrykRFvLVX6W3" Content-Disposition: inline In-Reply-To: <4C796673.1090908@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211932 - in head/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 19:44:21 -0000 --vNrHrykRFvLVX6W3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Aug 28, 2010 at 09:41:39PM +0200, Martin Matuska wrote: > Thank you, committed just minutes ahead of me :-) > Both mistakes are due to a mis-patch. I will include the fixed version > it in the post-v15 merge. BTW. 'zfs allow' doesn't work for me anymore. It might be due to py-zfs being compiled from more recent source than my userland and kernel was build. Does it work for you? # zfs allow foo/bar cannot access dataset foo/bar: Operation not supported --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --vNrHrykRFvLVX6W3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkx5ZwYACgkQForvXbEpPzTiwQCgnQPivhefTtQMFDgiyHxqsKg4 VBoAoK8MRBh9R76Nfyz6XEiwQt47GEnb =JPut -----END PGP SIGNATURE----- --vNrHrykRFvLVX6W3-- From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 21:06:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF6951065697; Sat, 28 Aug 2010 21:06:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0BEE8FC1C; Sat, 28 Aug 2010 21:06:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7SL6DaT043468; Sat, 28 Aug 2010 21:06:13 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7SL6Dan043466; Sat, 28 Aug 2010 21:06:13 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008282106.o7SL6Dan043466@svn.freebsd.org> From: Warner Losh Date: Sat, 28 Aug 2010 21:06:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211949 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 21:06:13 -0000 Author: imp Date: Sat Aug 28 21:06:13 2010 New Revision: 211949 URL: http://svn.freebsd.org/changeset/base/211949 Log: Now that we default to the proper endian, we don't need these for mips Modified: head/share/mk/bsd.cpu.mk Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Sat Aug 28 19:29:06 2010 (r211948) +++ head/share/mk/bsd.cpu.mk Sat Aug 28 21:06:13 2010 (r211949) @@ -203,13 +203,6 @@ LD += -EB .endif .if ${MACHINE_ARCH} == "mips" -. if defined(TARGET_BIG_ENDIAN) -CFLAGS += -EB -LD += -EB -. else -CFLAGS += -EL -LD += -EL -. endif CFLAGS += -G0 .endif From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 21:15:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E33910657A6; Sat, 28 Aug 2010 21:15:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F33BF8FC16; Sat, 28 Aug 2010 21:15:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7SLF0mj043672; Sat, 28 Aug 2010 21:15:00 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7SLF0Uf043670; Sat, 28 Aug 2010 21:15:00 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201008282115.o7SLF0Uf043670@svn.freebsd.org> From: Michael Tuexen Date: Sat, 28 Aug 2010 21:15:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211950 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 21:15:01 -0000 Author: tuexen Date: Sat Aug 28 21:15:00 2010 New Revision: 211950 URL: http://svn.freebsd.org/changeset/base/211950 Log: Bugfix: Do not send a packet drop report in response to a received INIT-ACK with incorrect CRC. Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat Aug 28 21:06:13 2010 (r211949) +++ head/sys/netinet/sctp_output.c Sat Aug 28 21:15:00 2010 (r211950) @@ -11001,9 +11001,12 @@ sctp_send_packet_dropped(struct sctp_tcb switch (ch->chunk_type) { case SCTP_PACKET_DROPPED: case SCTP_ABORT_ASSOCIATION: - /*- - * we don't respond with an PKT-DROP to an ABORT - * or PKT-DROP + case SCTP_INITIATION_ACK: + /** + * We don't respond with an PKT-DROP to an ABORT + * or PKT-DROP. We also do not respond to an + * INIT-ACK, because we can't know if the initiation + * tag is correct or not. */ sctp_free_a_chunk(stcb, chk); return; From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 21:41:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E59761065695; Sat, 28 Aug 2010 21:41:18 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D62BB8FC13; Sat, 28 Aug 2010 21:41:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7SLfIfd044211; Sat, 28 Aug 2010 21:41:18 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7SLfITb044206; Sat, 28 Aug 2010 21:41:18 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201008282141.o7SLfITb044206@svn.freebsd.org> From: Rick Macklem Date: Sat, 28 Aug 2010 21:41:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211951 - in head/sys/fs: nfs nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 21:41:19 -0000 Author: rmacklem Date: Sat Aug 28 21:41:18 2010 New Revision: 211951 URL: http://svn.freebsd.org/changeset/base/211951 Log: The timer routine in the experimental NFS server did not acquire the correct mutex when checking nfsv4root_lock. Although this could be fixed by adding mutex lock/unlock calls, zack.kirsch at isilon.com suggested a better fix that uses a non-blocking acquisition of a reference count on nfsv4root_lock. This fix allows the weird NFSLOCKSTATE(); NFSUNLOCKSTATE(); synchronization to be deleted. This patch applies this fix. Tested by: zack.kirsch at isilon.com MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsserver/nfs_nfsdsocket.c head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Sat Aug 28 21:15:00 2010 (r211950) +++ head/sys/fs/nfs/nfs_commonsubs.c Sat Aug 28 21:41:18 2010 (r211951) @@ -1824,6 +1824,21 @@ nfsv4_getref(struct nfsv4lock *lp, int * } /* + * Get a reference as above, but return failure instead of sleeping if + * an exclusive lock is held. + */ +APPLESTATIC int +nfsv4_getref_nonblock(struct nfsv4lock *lp) +{ + + if ((lp->nfslock_lock & NFSV4LOCK_LOCK) != 0) + return (0); + + lp->nfslock_usecnt++; + return (1); +} + +/* * Test for a lock. Return 1 if locked, 0 otherwise. */ APPLESTATIC int Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Sat Aug 28 21:15:00 2010 (r211950) +++ head/sys/fs/nfs/nfs_var.h Sat Aug 28 21:41:18 2010 (r211951) @@ -251,6 +251,7 @@ int nfsv4_lock(struct nfsv4lock *, int, void nfsv4_unlock(struct nfsv4lock *, int); void nfsv4_relref(struct nfsv4lock *); void nfsv4_getref(struct nfsv4lock *, int *, void *); +int nfsv4_getref_nonblock(struct nfsv4lock *); int nfsv4_testlock(struct nfsv4lock *); int nfsrv_mtostr(struct nfsrv_descript *, char *, int); int nfsrv_checkutf8(u_int8_t *, int); Modified: head/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdsocket.c Sat Aug 28 21:15:00 2010 (r211950) +++ head/sys/fs/nfsserver/nfs_nfsdsocket.c Sat Aug 28 21:41:18 2010 (r211951) @@ -533,8 +533,6 @@ nfsrvd_compound(struct nfsrv_descript *n NFSV4ROOTLOCKMUTEXPTR); NFSUNLOCKV4ROOTMUTEX(); if (igotlock) { - NFSLOCKSTATE(); /* to avoid a race with */ - NFSUNLOCKSTATE(); /* nfsrv_servertimer() */ /* * If I got the lock, I can update the stable storage file. * Done when the grace period is over or a client has long Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Sat Aug 28 21:15:00 2010 (r211950) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Sat Aug 28 21:41:18 2010 (r211951) @@ -164,8 +164,6 @@ nfsrv_setclient(struct nfsrv_descript *n NFSV4ROOTLOCKMUTEXPTR); } while (!igotlock); NFSUNLOCKV4ROOTMUTEX(); - NFSLOCKSTATE(); /* to avoid a race with */ - NFSUNLOCKSTATE(); /* nfsrv_servertimer() */ /* * Search for a match in the client list. @@ -416,8 +414,6 @@ nfsrv_getclient(nfsquad_t clientid, int NFSV4ROOTLOCKMUTEXPTR); } while (!igotlock); NFSUNLOCKV4ROOTMUTEX(); - NFSLOCKSTATE(); /* to avoid a race with */ - NFSUNLOCKSTATE(); /* nfsrv_servertimer() */ } else if (opflags != CLOPS_RENEW) { NFSLOCKSTATE(); } @@ -547,8 +543,6 @@ nfsrv_adminrevoke(struct nfsd_clid *revo NFSV4ROOTLOCKMUTEXPTR); } while (!igotlock); NFSUNLOCKV4ROOTMUTEX(); - NFSLOCKSTATE(); /* to avoid a race with */ - NFSUNLOCKSTATE(); /* nfsrv_servertimer() */ /* * Search for a match in the client list. @@ -824,11 +818,8 @@ nfsrv_dumplocks(vnode_t vp, struct nfsd_ /* * Server timer routine. It can scan any linked list, so long - * as it holds the spin lock and there is no exclusive lock on + * as it holds the spin/mutex lock and there is no exclusive lock on * nfsv4rootfs_lock. - * Must be called by a kernel thread and not a timer interrupt, - * so that it only runs when the nfsd threads are sleeping on a - * uniprocessor and uses the State spin lock for an SMP system. * (For OpenBSD, a kthread is ok. For FreeBSD, I think it is ok * to do this from a callout, since the spin locks work. For * Darwin, I'm not sure what will work correctly yet.) @@ -839,7 +830,7 @@ nfsrv_servertimer(void) { struct nfsclient *clp, *nclp; struct nfsstate *stp, *nstp; - int i; + int got_ref, i; /* * Make sure nfsboottime is set. This is used by V3 as well @@ -867,13 +858,14 @@ nfsrv_servertimer(void) } /* - * Return now if an nfsd thread has the exclusive lock on - * nfsv4rootfs_lock. The dirty trick here is that we have - * the spin lock already and the nfsd threads do a: - * NFSLOCKSTATE, NFSUNLOCKSTATE after getting the exclusive - * lock, so they won't race with code after this check. + * Try and get a reference count on the nfsv4rootfs_lock so that + * no nfsd thread can acquire an exclusive lock on it before this + * call is done. If it is already exclusively locked, just return. */ - if (nfsv4rootfs_lock.nfslock_lock & NFSV4LOCK_LOCK) { + NFSLOCKV4ROOTMUTEX(); + got_ref = nfsv4_getref_nonblock(&nfsv4rootfs_lock); + NFSUNLOCKV4ROOTMUTEX(); + if (got_ref == 0) { NFSUNLOCKSTATE(); return; } @@ -945,6 +937,9 @@ nfsrv_servertimer(void) } } NFSUNLOCKSTATE(); + NFSLOCKV4ROOTMUTEX(); + nfsv4_relref(&nfsv4rootfs_lock); + NFSUNLOCKV4ROOTMUTEX(); } /* @@ -4224,8 +4219,6 @@ nfsrv_clientconflict(struct nfsclient *c NFSV4ROOTLOCKMUTEXPTR); } while (!gotlock); NFSUNLOCKV4ROOTMUTEX(); - NFSLOCKSTATE(); /* to avoid a race with */ - NFSUNLOCKSTATE(); /* nfsrv_servertimer() */ *haslockp = 1; NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, p); return (1); @@ -4390,8 +4383,6 @@ nfsrv_delegconflict(struct nfsstate *stp NFSV4ROOTLOCKMUTEXPTR); } while (!gotlock); NFSUNLOCKV4ROOTMUTEX(); - NFSLOCKSTATE(); /* to avoid a race with */ - NFSUNLOCKSTATE(); /* nfsrv_servertimer() */ *haslockp = 1; NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, p); return (-1); From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 23:50:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA7B8106564A; Sat, 28 Aug 2010 23:50:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC6528FC14; Sat, 28 Aug 2010 23:50:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7SNo94W046808; Sat, 28 Aug 2010 23:50:09 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7SNo9H9046806; Sat, 28 Aug 2010 23:50:09 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201008282350.o7SNo9H9046806@svn.freebsd.org> From: Rick Macklem Date: Sat, 28 Aug 2010 23:50:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211953 - head/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 23:50:09 -0000 Author: rmacklem Date: Sat Aug 28 23:50:09 2010 New Revision: 211953 URL: http://svn.freebsd.org/changeset/base/211953 Log: Add acquisition of a reference count on nfsv4root_lock to the nfsd_recalldelegation() function, since this function is called by nfsd threads when they are handling NFSv2 or NFSv3 RPCs, where no reference count would have been acquired. MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Sat Aug 28 22:14:24 2010 (r211952) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Sat Aug 28 23:50:09 2010 (r211953) @@ -4563,6 +4563,14 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO return; /* + * First, get a reference on the nfsv4rootfs_lock so that an + * exclusive lock cannot be acquired by another thread. + */ + NFSLOCKV4ROOTMUTEX(); + nfsv4_getref(&nfsv4rootfs_lock, NULL, NFSV4ROOTLOCKMUTEXPTR); + NFSUNLOCKV4ROOTMUTEX(); + + /* * Now, call nfsrv_checkremove() in a loop while it returns * NFSERR_DELAY. Return upon any other error or when timed out. */ @@ -4576,11 +4584,14 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO NFS_REMOVETIMEO && ((u_int32_t)mytime.tv_sec - starttime) < 100000) - return; + break; /* Sleep for a short period of time */ (void) nfs_catnap(PZERO, 0, "nfsremove"); } } while (error == NFSERR_DELAY); + NFSLOCKV4ROOTMUTEX(); + nfsv4_relref(&nfsv4rootfs_lock); + NFSUNLOCKV4ROOTMUTEX(); } APPLESTATIC void